From 71548624f596e7ca894ae6a33b70d9852587c85b Mon Sep 17 00:00:00 2001 From: Benjamin Coenen Date: Tue, 20 Mar 2018 10:35:03 +0100 Subject: [PATCH 1/9] feat(search): add allowEmptyQuery on search Signed-off-by: Benjamin Coenen --- demo/src/app/pages/modules/search/search.page.ts | 9 +++++++++ src/modules/search/components/search.ts | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/demo/src/app/pages/modules/search/search.page.ts b/demo/src/app/pages/modules/search/search.page.ts index 230efdd18..3a00edfdf 100644 --- a/demo/src/app/pages/modules/search/search.page.ts +++ b/demo/src/app/pages/modules/search/search.page.ts @@ -6,12 +6,14 @@ import { AlertModal } from "../../../modals/alert.modal"; const exampleStandardTemplate = `
Has icon? + Allow empty query?
`; @@ -57,6 +59,12 @@ export class SearchPage { description: "Sets whether or not the search displays an icon.", defaultValue: "true" }, + { + name: "allowEmptyQuery", + type: "boolean", + description: "Sets whether the search element display result with empty query.", + defaultValue: "false" + }, { name: "options", type: "T[]", @@ -165,6 +173,7 @@ export class SearchExampleStandard { "Yellow", "Zebra"]; public hasIcon:boolean = true; + public allowEmptyQuery:boolean = true; public get options():string[] { return SearchExampleStandard.standardOptions; diff --git a/src/modules/search/components/search.ts b/src/modules/search/components/search.ts index d6dc2cfc7..8e6a3f091 100644 --- a/src/modules/search/components/search.ts +++ b/src/modules/search/components/search.ts @@ -73,6 +73,17 @@ export class SuiSearch implements AfterViewInit, OnDestroy { @Input() public hasIcon:boolean; + // Sets whether the search element display result with empty query. + @Input() + public set allowEmptyQuery(allowEmptyQuery:boolean) { + this._allowEmptyQuery = allowEmptyQuery; + this.searchService.allowEmptyQuery = allowEmptyQuery; + } + public get allowEmptyQuery():boolean { + return this._allowEmptyQuery; + } + + private _allowEmptyQuery:boolean; private _placeholder:string; // Gets & sets the placeholder text displayed inside the text input. @@ -102,7 +113,7 @@ export class SuiSearch implements AfterViewInit, OnDestroy { // Initialise a delayed search. this.searchService.updateQueryDelayed(query, () => // Set the results open state depending on whether a query has been entered. - this.dropdownService.setOpenState(this.searchService.query.length > 0)); + this.dropdownService.setOpenState(this.searchService.query.length > 0 || this.allowEmptyQuery)); } @Input() @@ -193,6 +204,7 @@ export class SuiSearch implements AfterViewInit, OnDestroy { this._searchClasses = true; this.hasIcon = true; + this.allowEmptyQuery = false; this.retainSelectedResult = true; this.searchDelay = 200; this.maxResults = 7; @@ -238,7 +250,7 @@ export class SuiSearch implements AfterViewInit, OnDestroy { } private open():void { - if (this.searchService.query.length > 0) { + if (this.searchService.query.length > 0 || this.allowEmptyQuery) { // Only open on click when there is a query entered. this.dropdownService.setOpenState(true); } From c4b80123fbb3795a6815a879ea16d6ba382509bb Mon Sep 17 00:00:00 2001 From: Benjamin Coenen Date: Tue, 20 Mar 2018 10:43:41 +0100 Subject: [PATCH 2/9] wip Signed-off-by: Benjamin Coenen --- .gitignore | 2 -- bundles/coucou | 0 dist/coucou | 0 3 files changed, 2 deletions(-) create mode 100644 bundles/coucou create mode 100644 dist/coucou diff --git a/.gitignore b/.gitignore index 465409354..5ae9fc49d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. # compiled output -/dist /tmp ## ngc logs @@ -44,4 +43,3 @@ Thumbs.db # output files demo/dist -bundles \ No newline at end of file diff --git a/bundles/coucou b/bundles/coucou new file mode 100644 index 000000000..e69de29bb diff --git a/dist/coucou b/dist/coucou new file mode 100644 index 000000000..e69de29bb From 89bb4488ae3953e9e9d129b0238efa226b4ecca2 Mon Sep 17 00:00:00 2001 From: Benjamin Coenen Date: Tue, 20 Mar 2018 11:15:08 +0100 Subject: [PATCH 3/9] dist Signed-off-by: Benjamin Coenen --- bundles/coucou | 0 dist/coucou | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 bundles/coucou delete mode 100644 dist/coucou diff --git a/bundles/coucou b/bundles/coucou deleted file mode 100644 index e69de29bb..000000000 diff --git a/dist/coucou b/dist/coucou deleted file mode 100644 index e69de29bb..000000000 From 47427e2b3ceb8e07d824edbd683fac6f0323e9f1 Mon Sep 17 00:00:00 2001 From: Benjamin Coenen Date: Tue, 20 Mar 2018 11:15:41 +0100 Subject: [PATCH 4/9] dist Signed-off-by: Benjamin Coenen --- .gitignore | 8 +- bundles/ng2-semantic-ui.umd.js | 14295 ++++++++++++++++ bundles/ng2-semantic-ui.umd.min.js | 7 + dist/behaviors/index.d.ts | 1 + dist/behaviors/index.js | 2 + dist/behaviors/index.js.map | 1 + dist/behaviors/index.metadata.json | 1 + dist/behaviors/localization/index.d.ts | 3 + dist/behaviors/localization/index.js | 3 + dist/behaviors/localization/index.js.map | 1 + .../localization/index.metadata.json | 1 + .../interfaces/datepicker-values.d.ts | 22 + .../interfaces/datepicker-values.js | 1 + .../interfaces/datepicker-values.js.map | 1 + .../datepicker-values.metadata.json | 1 + .../localization/interfaces/partial.d.ts | 3 + .../localization/interfaces/partial.js | 1 + .../localization/interfaces/partial.js.map | 1 + .../interfaces/partial.metadata.json | 1 + .../interfaces/search-values.d.ts | 7 + .../localization/interfaces/search-values.js | 1 + .../interfaces/search-values.js.map | 1 + .../interfaces/search-values.metadata.json | 1 + .../interfaces/select-values.d.ts | 11 + .../localization/interfaces/select-values.js | 1 + .../interfaces/select-values.js.map | 1 + .../interfaces/select-values.metadata.json | 1 + .../localization/interfaces/values.d.ts | 14 + .../localization/interfaces/values.js | 1 + .../localization/interfaces/values.js.map | 1 + .../interfaces/values.metadata.json | 1 + dist/behaviors/localization/locales/de.d.ts | 7 + dist/behaviors/localization/locales/de.js | 51 + dist/behaviors/localization/locales/de.js.map | 1 + .../behaviors/localization/locales/en-AU.d.ts | 7 + dist/behaviors/localization/locales/en-AU.js | 11 + .../localization/locales/en-AU.js.map | 1 + .../behaviors/localization/locales/en-GB.d.ts | 3 + dist/behaviors/localization/locales/en-GB.js | 56 + .../localization/locales/en-GB.js.map | 1 + .../behaviors/localization/locales/en-US.d.ts | 3 + dist/behaviors/localization/locales/en-US.js | 14 + .../localization/locales/en-US.js.map | 1 + dist/behaviors/localization/locales/es.d.ts | 7 + dist/behaviors/localization/locales/es.js | 51 + dist/behaviors/localization/locales/es.js.map | 1 + dist/behaviors/localization/locales/fr.d.ts | 7 + dist/behaviors/localization/locales/fr.js | 51 + dist/behaviors/localization/locales/fr.js.map | 1 + dist/behaviors/localization/locales/ge.d.ts | 7 + dist/behaviors/localization/locales/ge.js | 52 + dist/behaviors/localization/locales/ge.js.map | 1 + dist/behaviors/localization/locales/he.d.ts | 7 + dist/behaviors/localization/locales/he.js | 51 + dist/behaviors/localization/locales/he.js.map | 1 + .../behaviors/localization/locales/index.d.ts | 16 + dist/behaviors/localization/locales/index.js | 27 + .../localization/locales/index.js.map | 1 + dist/behaviors/localization/locales/it.d.ts | 7 + dist/behaviors/localization/locales/it.js | 51 + dist/behaviors/localization/locales/it.js.map | 1 + dist/behaviors/localization/locales/nl.d.ts | 7 + dist/behaviors/localization/locales/nl.js | 61 + dist/behaviors/localization/locales/nl.js.map | 1 + dist/behaviors/localization/locales/pt.d.ts | 7 + dist/behaviors/localization/locales/pt.js | 51 + dist/behaviors/localization/locales/pt.js.map | 1 + dist/behaviors/localization/locales/ru.d.ts | 7 + dist/behaviors/localization/locales/ru.js | 51 + dist/behaviors/localization/locales/ru.js.map | 1 + .../localization/localization.module.d.ts | 2 + .../localization/localization.module.js | 18 + .../localization/localization.module.js.map | 1 + .../localization.module.metadata.json | 1 + dist/behaviors/localization/public.d.ts | 2 + dist/behaviors/localization/public.js | 2 + dist/behaviors/localization/public.js.map | 1 + .../localization/public.metadata.json | 1 + .../services/localization.service.d.ts | 16 + .../services/localization.service.js | 69 + .../services/localization.service.js.map | 1 + .../localization.service.metadata.json | 1 + dist/behaviors/public.d.ts | 1 + dist/behaviors/public.js | 2 + dist/behaviors/public.js.map | 1 + dist/behaviors/public.metadata.json | 1 + dist/collections/index.d.ts | 2 + dist/collections/index.js | 3 + dist/collections/index.js.map | 1 + dist/collections/index.metadata.json | 1 + .../message/components/message.d.ts | 16 + .../collections/message/components/message.js | 39 + .../message/components/message.js.map | 1 + .../message/components/message.metadata.json | 1 + dist/collections/message/index.d.ts | 2 + dist/collections/message/index.js | 3 + dist/collections/message/index.js.map | 1 + dist/collections/message/index.metadata.json | 1 + dist/collections/message/message.module.d.ts | 2 + dist/collections/message/message.module.js | 27 + .../collections/message/message.module.js.map | 1 + .../message/message.module.metadata.json | 1 + dist/collections/message/public.d.ts | 1 + dist/collections/message/public.js | 2 + dist/collections/message/public.js.map | 1 + dist/collections/message/public.metadata.json | 1 + .../pagination/components/pagination.d.ts | 27 + .../pagination/components/pagination.js | 148 + .../pagination/components/pagination.js.map | 1 + .../components/pagination.metadata.json | 1 + dist/collections/pagination/index.d.ts | 2 + dist/collections/pagination/index.js | 3 + dist/collections/pagination/index.js.map | 1 + .../pagination/index.metadata.json | 1 + .../pagination/pagination.module.d.ts | 2 + .../pagination/pagination.module.js | 20 + .../pagination/pagination.module.js.map | 1 + .../pagination.module.metadata.json | 1 + dist/collections/pagination/public.d.ts | 1 + dist/collections/pagination/public.js | 2 + dist/collections/pagination/public.js.map | 1 + .../pagination/public.metadata.json | 1 + dist/collections/public.d.ts | 2 + dist/collections/public.js | 3 + dist/collections/public.js.map | 1 + dist/collections/public.metadata.json | 1 + dist/index.d.ts | 5 + dist/index.js | 6 + dist/index.js.map | 1 + dist/index.metadata.json | 1 + dist/karma.conf.d.ts | 0 dist/karma.conf.js | 36 + dist/karma.conf.js.map | 1 + dist/misc/index.d.ts | 1 + dist/misc/index.js | 2 + dist/misc/index.js.map | 1 + dist/misc/index.metadata.json | 1 + dist/misc/public.d.ts | 1 + dist/misc/public.js | 2 + dist/misc/public.js.map | 1 + dist/misc/public.metadata.json | 1 + dist/misc/util/helpers/custom-validator.d.ts | 18 + dist/misc/util/helpers/custom-validator.js | 24 + .../misc/util/helpers/custom-validator.js.map | 1 + .../helpers/custom-validator.metadata.json | 1 + .../util/helpers/custom-value-accessor.d.ts | 20 + .../util/helpers/custom-value-accessor.js | 28 + .../util/helpers/custom-value-accessor.js.map | 1 + .../custom-value-accessor.metadata.json | 1 + dist/misc/util/helpers/date.d.ts | 17 + dist/misc/util/helpers/date.js | 172 + dist/misc/util/helpers/date.js.map | 1 + dist/misc/util/helpers/date.metadata.json | 1 + dist/misc/util/helpers/focus-event.d.ts | 3 + dist/misc/util/helpers/focus-event.js | 1 + dist/misc/util/helpers/focus-event.js.map | 1 + .../util/helpers/focus-event.metadata.json | 1 + dist/misc/util/helpers/util.d.ts | 47 + dist/misc/util/helpers/util.js | 96 + dist/misc/util/helpers/util.js.map | 1 + dist/misc/util/helpers/util.metadata.json | 1 + dist/misc/util/index.d.ts | 8 + dist/misc/util/index.js | 8 + dist/misc/util/index.js.map | 1 + dist/misc/util/index.metadata.json | 1 + dist/misc/util/public.d.ts | 1 + dist/misc/util/public.js | 2 + dist/misc/util/public.js.map | 1 + dist/misc/util/public.metadata.json | 1 + .../services/component-factory.service.d.ts | 18 + .../services/component-factory.service.js | 75 + .../services/component-factory.service.js.map | 1 + .../component-factory.service.metadata.json | 1 + .../util/services/positioning.service.d.ts | 39 + .../misc/util/services/positioning.service.js | 137 + .../util/services/positioning.service.js.map | 1 + .../positioning.service.metadata.json | 1 + dist/misc/util/util.module.d.ts | 2 + dist/misc/util/util.module.js | 20 + dist/misc/util/util.module.js.map | 1 + dist/misc/util/util.module.metadata.json | 1 + dist/modules/accordion/accordion.module.d.ts | 2 + dist/modules/accordion/accordion.module.js | 33 + .../modules/accordion/accordion.module.js.map | 1 + .../accordion/accordion.module.metadata.json | 1 + .../accordion/components/accordion-panel.d.ts | 17 + .../accordion/components/accordion-panel.js | 88 + .../components/accordion-panel.js.map | 1 + .../components/accordion-panel.metadata.json | 1 + .../accordion/components/accordion.d.ts | 14 + .../modules/accordion/components/accordion.js | 63 + .../accordion/components/accordion.js.map | 1 + .../components/accordion.metadata.json | 1 + dist/modules/accordion/index.d.ts | 4 + dist/modules/accordion/index.js | 5 + dist/modules/accordion/index.js.map | 1 + dist/modules/accordion/index.metadata.json | 1 + dist/modules/accordion/public.d.ts | 1 + dist/modules/accordion/public.js | 2 + dist/modules/accordion/public.js.map | 1 + dist/modules/accordion/public.metadata.json | 1 + .../accordion/services/accordion.service.d.ts | 10 + .../accordion/services/accordion.service.js | 25 + .../services/accordion.service.js.map | 1 + .../services/accordion.service.metadata.json | 1 + dist/modules/checkbox/checkbox.module.d.ts | 2 + dist/modules/checkbox/checkbox.module.js | 37 + dist/modules/checkbox/checkbox.module.js.map | 1 + .../checkbox/checkbox.module.metadata.json | 1 + .../modules/checkbox/components/checkbox.d.ts | 24 + dist/modules/checkbox/components/checkbox.js | 105 + .../checkbox/components/checkbox.js.map | 1 + .../components/checkbox.metadata.json | 1 + dist/modules/checkbox/components/radio.d.ts | 26 + dist/modules/checkbox/components/radio.js | 108 + dist/modules/checkbox/components/radio.js.map | 1 + .../checkbox/components/radio.metadata.json | 1 + .../checkbox/directives/radio-manager.d.ts | 12 + .../checkbox/directives/radio-manager.js | 60 + .../checkbox/directives/radio-manager.js.map | 1 + .../directives/radio-manager.metadata.json | 1 + dist/modules/checkbox/index.d.ts | 4 + dist/modules/checkbox/index.js | 5 + dist/modules/checkbox/index.js.map | 1 + dist/modules/checkbox/index.metadata.json | 1 + dist/modules/checkbox/public.d.ts | 1 + dist/modules/checkbox/public.js | 2 + dist/modules/checkbox/public.js.map | 1 + dist/modules/checkbox/public.metadata.json | 1 + dist/modules/collapse/collapse.module.d.ts | 2 + dist/modules/collapse/collapse.module.js | 25 + dist/modules/collapse/collapse.module.js.map | 1 + .../collapse/collapse.module.metadata.json | 1 + .../modules/collapse/directives/collapse.d.ts | 16 + dist/modules/collapse/directives/collapse.js | 124 + .../collapse/directives/collapse.js.map | 1 + .../directives/collapse.metadata.json | 1 + dist/modules/collapse/index.d.ts | 2 + dist/modules/collapse/index.js | 3 + dist/modules/collapse/index.js.map | 1 + dist/modules/collapse/index.metadata.json | 1 + dist/modules/collapse/public.d.ts | 1 + dist/modules/collapse/public.js | 2 + dist/modules/collapse/public.js.map | 1 + dist/modules/collapse/public.metadata.json | 1 + .../datepicker/classes/calendar-config.d.ts | 32 + .../datepicker/classes/calendar-config.js | 80 + .../datepicker/classes/calendar-config.js.map | 1 + .../classes/calendar-config.metadata.json | 1 + .../datepicker/classes/calendar-mappings.d.ts | 23 + .../datepicker/classes/calendar-mappings.js | 119 + .../classes/calendar-mappings.js.map | 1 + .../classes/calendar-mappings.metadata.json | 1 + .../datepicker/classes/date-comparer.d.ts | 10 + .../datepicker/classes/date-comparer.js | 33 + .../datepicker/classes/date-comparer.js.map | 1 + .../classes/date-comparer.metadata.json | 1 + .../datepicker/classes/date-parser.d.ts | 12 + .../modules/datepicker/classes/date-parser.js | 44 + .../datepicker/classes/date-parser.js.map | 1 + .../classes/date-parser.metadata.json | 1 + .../components/calendar-view-title.d.ts | 7 + .../components/calendar-view-title.js | 23 + .../components/calendar-view-title.js.map | 1 + .../calendar-view-title.metadata.json | 1 + .../datepicker/components/datepicker.d.ts | 16 + .../datepicker/components/datepicker.js | 38 + .../datepicker/components/datepicker.js.map | 1 + .../components/datepicker.metadata.json | 1 + .../modules/datepicker/datepicker.module.d.ts | 2 + dist/modules/datepicker/datepicker.module.js | 59 + .../datepicker/datepicker.module.js.map | 1 + .../datepicker.module.metadata.json | 1 + .../datepicker/directives/calendar-item.d.ts | 23 + .../datepicker/directives/calendar-item.js | 67 + .../directives/calendar-item.js.map | 1 + .../directives/calendar-item.metadata.json | 1 + .../directives/datepicker.directive.d.ts | 43 + .../directives/datepicker.directive.js | 233 + .../directives/datepicker.directive.js.map | 1 + .../datepicker.directive.metadata.json | 1 + .../directives/input.directive.d.ts | 25 + .../datepicker/directives/input.directive.js | 155 + .../directives/input.directive.js.map | 1 + .../directives/input.directive.metadata.json | 1 + dist/modules/datepicker/helpers/date-fns.d.ts | 9 + dist/modules/datepicker/helpers/date-fns.js | 99 + .../datepicker/helpers/date-fns.js.map | 1 + .../datepicker/helpers/date-fns.metadata.json | 1 + .../datepicker/helpers/is-webview.d.ts | 1 + dist/modules/datepicker/helpers/is-webview.js | 1 + .../datepicker/helpers/is-webview.js.map | 1 + dist/modules/datepicker/index.d.ts | 19 + dist/modules/datepicker/index.js | 20 + dist/modules/datepicker/index.js.map | 1 + dist/modules/datepicker/index.metadata.json | 1 + dist/modules/datepicker/public.d.ts | 1 + dist/modules/datepicker/public.js | 2 + dist/modules/datepicker/public.js.map | 1 + dist/modules/datepicker/public.metadata.json | 1 + .../services/calendar-range.service.d.ts | 42 + .../services/calendar-range.service.js | 146 + .../services/calendar-range.service.js.map | 1 + .../calendar-range.service.metadata.json | 1 + .../datepicker/services/calendar.service.d.ts | 32 + .../datepicker/services/calendar.service.js | 129 + .../services/calendar.service.js.map | 1 + .../services/calendar.service.metadata.json | 1 + .../datepicker/views/calendar-view.d.ts | 32 + .../modules/datepicker/views/calendar-view.js | 174 + .../datepicker/views/calendar-view.js.map | 1 + .../views/calendar-view.metadata.json | 1 + dist/modules/datepicker/views/date-view.d.ts | 13 + dist/modules/datepicker/views/date-view.js | 68 + .../modules/datepicker/views/date-view.js.map | 1 + .../datepicker/views/date-view.metadata.json | 1 + dist/modules/datepicker/views/hour-view.d.ts | 11 + dist/modules/datepicker/views/hour-view.js | 55 + .../modules/datepicker/views/hour-view.js.map | 1 + .../datepicker/views/hour-view.metadata.json | 1 + .../modules/datepicker/views/minute-view.d.ts | 13 + dist/modules/datepicker/views/minute-view.js | 71 + .../datepicker/views/minute-view.js.map | 1 + .../views/minute-view.metadata.json | 1 + dist/modules/datepicker/views/month-view.d.ts | 11 + dist/modules/datepicker/views/month-view.js | 53 + .../datepicker/views/month-view.js.map | 1 + .../datepicker/views/month-view.metadata.json | 1 + dist/modules/datepicker/views/year-view.d.ts | 12 + dist/modules/datepicker/views/year-view.js | 57 + .../modules/datepicker/views/year-view.js.map | 1 + .../datepicker/views/year-view.metadata.json | 1 + dist/modules/dimmer/components/dimmer.d.ts | 15 + dist/modules/dimmer/components/dimmer.js | 77 + dist/modules/dimmer/components/dimmer.js.map | 1 + .../dimmer/components/dimmer.metadata.json | 1 + dist/modules/dimmer/dimmer.module.d.ts | 2 + dist/modules/dimmer/dimmer.module.js | 27 + dist/modules/dimmer/dimmer.module.js.map | 1 + .../dimmer/dimmer.module.metadata.json | 1 + dist/modules/dimmer/index.d.ts | 2 + dist/modules/dimmer/index.js | 3 + dist/modules/dimmer/index.js.map | 1 + dist/modules/dimmer/index.metadata.json | 1 + dist/modules/dimmer/public.d.ts | 1 + dist/modules/dimmer/public.js | 2 + dist/modules/dimmer/public.js.map | 1 + dist/modules/dimmer/public.metadata.json | 1 + .../dropdown/directives/dropdown-menu.d.ts | 43 + .../dropdown/directives/dropdown-menu.js | 315 + .../dropdown/directives/dropdown-menu.js.map | 1 + .../directives/dropdown-menu.metadata.json | 1 + .../modules/dropdown/directives/dropdown.d.ts | 24 + dist/modules/dropdown/directives/dropdown.js | 157 + .../dropdown/directives/dropdown.js.map | 1 + .../directives/dropdown.metadata.json | 1 + dist/modules/dropdown/dropdown.module.d.ts | 2 + dist/modules/dropdown/dropdown.module.js | 32 + dist/modules/dropdown/dropdown.module.js.map | 1 + .../dropdown/dropdown.module.metadata.json | 1 + dist/modules/dropdown/index.d.ts | 4 + dist/modules/dropdown/index.js | 5 + dist/modules/dropdown/index.js.map | 1 + dist/modules/dropdown/index.metadata.json | 1 + dist/modules/dropdown/public.d.ts | 1 + dist/modules/dropdown/public.js | 2 + dist/modules/dropdown/public.js.map | 1 + dist/modules/dropdown/public.metadata.json | 1 + .../dropdown/services/dropdown.service.d.ts | 25 + .../dropdown/services/dropdown.service.js | 100 + .../dropdown/services/dropdown.service.js.map | 1 + .../services/dropdown.service.metadata.json | 1 + dist/modules/index.d.ts | 15 + dist/modules/index.js | 16 + dist/modules/index.js.map | 1 + dist/modules/index.metadata.json | 1 + dist/modules/modal/classes/active-modal.d.ts | 14 + dist/modules/modal/classes/active-modal.js | 63 + .../modules/modal/classes/active-modal.js.map | 1 + .../modal/classes/active-modal.metadata.json | 1 + dist/modules/modal/classes/modal-config.d.ts | 31 + dist/modules/modal/classes/modal-config.js | 72 + .../modules/modal/classes/modal-config.js.map | 1 + .../modal/classes/modal-config.metadata.json | 1 + .../modules/modal/classes/modal-controls.d.ts | 10 + dist/modules/modal/classes/modal-controls.js | 46 + .../modal/classes/modal-controls.js.map | 1 + .../classes/modal-controls.metadata.json | 1 + .../modules/modal/classes/modal-template.d.ts | 7 + dist/modules/modal/classes/modal-template.js | 27 + .../modal/classes/modal-template.js.map | 1 + .../classes/modal-template.metadata.json | 1 + dist/modules/modal/components/modal.d.ts | 46 + dist/modules/modal/components/modal.js | 230 + dist/modules/modal/components/modal.js.map | 1 + .../modal/components/modal.metadata.json | 1 + dist/modules/modal/index.d.ts | 7 + dist/modules/modal/index.js | 8 + dist/modules/modal/index.js.map | 1 + dist/modules/modal/index.metadata.json | 1 + dist/modules/modal/modal.module.d.ts | 2 + dist/modules/modal/modal.module.js | 38 + dist/modules/modal/modal.module.js.map | 1 + dist/modules/modal/modal.module.metadata.json | 1 + dist/modules/modal/public.d.ts | 1 + dist/modules/modal/public.js | 2 + dist/modules/modal/public.js.map | 1 + dist/modules/modal/public.metadata.json | 1 + .../modules/modal/services/modal.service.d.ts | 8 + dist/modules/modal/services/modal.service.js | 65 + .../modal/services/modal.service.js.map | 1 + .../services/modal.service.metadata.json | 1 + .../classes/popup-component-controller.d.ts | 12 + .../classes/popup-component-controller.js | 45 + .../classes/popup-component-controller.js.map | 1 + .../popup-component-controller.metadata.json | 1 + dist/modules/popup/classes/popup-config.d.ts | 32 + dist/modules/popup/classes/popup-config.js | 24 + .../modules/popup/classes/popup-config.js.map | 1 + .../popup/classes/popup-config.metadata.json | 1 + .../popup/classes/popup-controller.d.ts | 32 + .../modules/popup/classes/popup-controller.js | 149 + .../popup/classes/popup-controller.js.map | 1 + .../classes/popup-controller.metadata.json | 1 + .../popup/classes/popup-lifecycle.d.ts | 10 + dist/modules/popup/classes/popup-lifecycle.js | 1 + .../popup/classes/popup-lifecycle.js.map | 1 + .../classes/popup-lifecycle.metadata.json | 1 + .../classes/popup-template-controller.d.ts | 22 + .../classes/popup-template-controller.js | 49 + .../classes/popup-template-controller.js.map | 1 + .../popup-template-controller.metadata.json | 1 + .../modules/popup/components/popup-arrow.d.ts | 7 + dist/modules/popup/components/popup-arrow.js | 44 + .../popup/components/popup-arrow.js.map | 1 + .../components/popup-arrow.metadata.json | 1 + dist/modules/popup/components/popup.d.ts | 28 + dist/modules/popup/components/popup.js | 143 + dist/modules/popup/components/popup.js.map | 1 + .../popup/components/popup.metadata.json | 1 + .../popup/directives/popup.directive.d.ts | 20 + .../popup/directives/popup.directive.js | 139 + .../popup/directives/popup.directive.js.map | 1 + .../directives/popup.directive.metadata.json | 1 + dist/modules/popup/index.d.ts | 10 + dist/modules/popup/index.js | 10 + dist/modules/popup/index.js.map | 1 + dist/modules/popup/index.metadata.json | 1 + dist/modules/popup/popup.module.d.ts | 2 + dist/modules/popup/popup.module.js | 41 + dist/modules/popup/popup.module.js.map | 1 + dist/modules/popup/popup.module.metadata.json | 1 + dist/modules/popup/public.d.ts | 3 + dist/modules/popup/public.js | 4 + dist/modules/popup/public.js.map | 1 + dist/modules/popup/public.metadata.json | 1 + .../modules/popup/services/popup.service.d.ts | 4 + dist/modules/popup/services/popup.service.js | 27 + .../popup/services/popup.service.js.map | 1 + .../services/popup.service.metadata.json | 1 + .../modules/progress/components/progress.d.ts | 16 + dist/modules/progress/components/progress.js | 109 + .../progress/components/progress.js.map | 1 + .../components/progress.metadata.json | 1 + dist/modules/progress/index.d.ts | 2 + dist/modules/progress/index.js | 3 + dist/modules/progress/index.js.map | 1 + dist/modules/progress/index.metadata.json | 1 + dist/modules/progress/progress.module.d.ts | 2 + dist/modules/progress/progress.module.js | 25 + dist/modules/progress/progress.module.js.map | 1 + .../progress/progress.module.metadata.json | 1 + dist/modules/progress/public.d.ts | 1 + dist/modules/progress/public.js | 2 + dist/modules/progress/public.js.map | 1 + dist/modules/progress/public.metadata.json | 1 + dist/modules/public.d.ts | 15 + dist/modules/public.js | 16 + dist/modules/public.js.map | 1 + dist/modules/public.metadata.json | 1 + dist/modules/rating/components/rating.d.ts | 20 + dist/modules/rating/components/rating.js | 93 + dist/modules/rating/components/rating.js.map | 1 + .../rating/components/rating.metadata.json | 1 + dist/modules/rating/index.d.ts | 2 + dist/modules/rating/index.js | 3 + dist/modules/rating/index.js.map | 1 + dist/modules/rating/index.metadata.json | 1 + dist/modules/rating/public.d.ts | 1 + dist/modules/rating/public.js | 2 + dist/modules/rating/public.js.map | 1 + dist/modules/rating/public.metadata.json | 1 + dist/modules/rating/rating.module.d.ts | 2 + dist/modules/rating/rating.module.js | 29 + dist/modules/rating/rating.module.js.map | 1 + .../rating/rating.module.metadata.json | 1 + .../search/components/search-result.d.ts | 14 + .../search/components/search-result.js | 49 + .../search/components/search-result.js.map | 1 + .../components/search-result.metadata.json | 1 + dist/modules/search/components/search.d.ts | 55 + dist/modules/search/components/search.js | 249 + dist/modules/search/components/search.js.map | 1 + .../search/components/search.metadata.json | 1 + dist/modules/search/helpers/lookup-fn.d.ts | 3 + dist/modules/search/helpers/lookup-fn.js | 1 + dist/modules/search/helpers/lookup-fn.js.map | 1 + .../search/helpers/lookup-fn.metadata.json | 1 + dist/modules/search/index.d.ts | 5 + dist/modules/search/index.js | 5 + dist/modules/search/index.js.map | 1 + dist/modules/search/index.metadata.json | 1 + dist/modules/search/public.d.ts | 1 + dist/modules/search/public.js | 2 + dist/modules/search/public.js.map | 1 + dist/modules/search/public.metadata.json | 1 + dist/modules/search/search.module.d.ts | 2 + dist/modules/search/search.module.js | 35 + dist/modules/search/search.module.js.map | 1 + .../search/search.module.metadata.json | 1 + .../search/services/search.service.d.ts | 30 + .../modules/search/services/search.service.js | 204 + .../search/services/search.service.js.map | 1 + .../services/search.service.metadata.json | 1 + dist/modules/select/classes/select-base.d.ts | 75 + dist/modules/select/classes/select-base.js | 414 + .../modules/select/classes/select-base.js.map | 1 + .../select/classes/select-base.metadata.json | 1 + .../select/components/multi-select-label.d.ts | 19 + .../select/components/multi-select-label.js | 82 + .../components/multi-select-label.js.map | 1 + .../multi-select-label.metadata.json | 1 + .../select/components/multi-select.d.ts | 31 + .../modules/select/components/multi-select.js | 225 + .../select/components/multi-select.js.map | 1 + .../components/multi-select.metadata.json | 1 + .../select/components/select-option.d.ts | 16 + .../select/components/select-option.js | 71 + .../select/components/select-option.js.map | 1 + .../components/select-option.metadata.json | 1 + dist/modules/select/components/select.d.ts | 23 + dist/modules/select/components/select.js | 146 + dist/modules/select/components/select.js.map | 1 + .../select/components/select.metadata.json | 1 + .../select/directives/select-search.d.ts | 14 + .../select/directives/select-search.js | 49 + .../select/directives/select-search.js.map | 1 + .../directives/select-search.metadata.json | 1 + dist/modules/select/index.d.ts | 7 + dist/modules/select/index.js | 8 + dist/modules/select/index.js.map | 1 + dist/modules/select/index.metadata.json | 1 + dist/modules/select/public.d.ts | 1 + dist/modules/select/public.js | 2 + dist/modules/select/public.js.map | 1 + dist/modules/select/public.metadata.json | 1 + dist/modules/select/select.module.d.ts | 2 + dist/modules/select/select.module.js | 48 + dist/modules/select/select.module.js.map | 1 + .../select/select.module.metadata.json | 1 + .../sidebar/components/sidebar-container.d.ts | 12 + .../sidebar/components/sidebar-container.js | 35 + .../components/sidebar-container.js.map | 1 + .../sidebar-container.metadata.json | 1 + .../sidebar/components/sidebar-sibling.d.ts | 15 + .../sidebar/components/sidebar-sibling.js | 81 + .../sidebar/components/sidebar-sibling.js.map | 1 + .../components/sidebar-sibling.metadata.json | 1 + dist/modules/sidebar/components/sidebar.d.ts | 19 + dist/modules/sidebar/components/sidebar.js | 109 + .../modules/sidebar/components/sidebar.js.map | 1 + .../sidebar/components/sidebar.metadata.json | 1 + dist/modules/sidebar/index.d.ts | 5 + dist/modules/sidebar/index.js | 6 + dist/modules/sidebar/index.js.map | 1 + dist/modules/sidebar/index.metadata.json | 1 + dist/modules/sidebar/public.d.ts | 1 + dist/modules/sidebar/public.js | 2 + dist/modules/sidebar/public.js.map | 1 + dist/modules/sidebar/public.metadata.json | 1 + .../sidebar/services/sidebar.service.d.ts | 35 + .../sidebar/services/sidebar.service.js | 81 + .../sidebar/services/sidebar.service.js.map | 1 + .../services/sidebar.service.metadata.json | 1 + dist/modules/sidebar/sidebar.module.d.ts | 2 + dist/modules/sidebar/sidebar.module.js | 31 + dist/modules/sidebar/sidebar.module.js.map | 1 + .../sidebar/sidebar.module.metadata.json | 1 + dist/modules/tabs/classes/tab.d.ts | 11 + dist/modules/tabs/classes/tab.js | 38 + dist/modules/tabs/classes/tab.js.map | 1 + dist/modules/tabs/classes/tab.metadata.json | 1 + dist/modules/tabs/components/tabset.d.ts | 17 + dist/modules/tabs/components/tabset.js | 170 + dist/modules/tabs/components/tabset.js.map | 1 + .../tabs/components/tabset.metadata.json | 1 + dist/modules/tabs/directives/tab-content.d.ts | 6 + dist/modules/tabs/directives/tab-content.js | 22 + .../tabs/directives/tab-content.js.map | 1 + .../tabs/directives/tab-content.metadata.json | 1 + dist/modules/tabs/directives/tab-header.d.ts | 16 + dist/modules/tabs/directives/tab-header.js | 97 + .../modules/tabs/directives/tab-header.js.map | 1 + .../tabs/directives/tab-header.metadata.json | 1 + dist/modules/tabs/index.d.ts | 5 + dist/modules/tabs/index.js | 6 + dist/modules/tabs/index.js.map | 1 + dist/modules/tabs/index.metadata.json | 1 + dist/modules/tabs/public.d.ts | 1 + dist/modules/tabs/public.js | 2 + dist/modules/tabs/public.js.map | 1 + dist/modules/tabs/public.metadata.json | 1 + dist/modules/tabs/tab.module.d.ts | 2 + dist/modules/tabs/tab.module.js | 31 + dist/modules/tabs/tab.module.js.map | 1 + dist/modules/tabs/tab.module.metadata.json | 1 + .../classes/transition-controller.d.ts | 29 + .../classes/transition-controller.js | 200 + .../classes/transition-controller.js.map | 1 + .../transition-controller.metadata.json | 1 + .../transition/classes/transition.d.ts | 15 + dist/modules/transition/classes/transition.js | 41 + .../transition/classes/transition.js.map | 1 + .../classes/transition.metadata.json | 1 + .../transition/directives/transition.d.ts | 14 + .../transition/directives/transition.js | 69 + .../transition/directives/transition.js.map | 1 + .../directives/transition.metadata.json | 1 + dist/modules/transition/index.d.ts | 4 + dist/modules/transition/index.js | 5 + dist/modules/transition/index.js.map | 1 + dist/modules/transition/index.metadata.json | 1 + dist/modules/transition/public.d.ts | 1 + dist/modules/transition/public.js | 2 + dist/modules/transition/public.js.map | 1 + dist/modules/transition/public.metadata.json | 1 + .../modules/transition/transition.module.d.ts | 2 + dist/modules/transition/transition.module.js | 24 + .../transition/transition.module.js.map | 1 + .../transition.module.metadata.json | 1 + dist/public.d.ts | 5 + dist/public.js | 6 + dist/public.js.map | 1 + dist/public.metadata.json | 1 + dist/sui.module.d.ts | 2 + dist/sui.module.js | 39 + dist/sui.module.js.map | 1 + dist/sui.module.metadata.json | 1 + locales/de.d.ts | 7 + locales/de.js | 51 + locales/de.js.map | 1 + locales/en-AU.d.ts | 7 + locales/en-AU.js | 11 + locales/en-AU.js.map | 1 + locales/en-GB.d.ts | 3 + locales/en-GB.js | 56 + locales/en-GB.js.map | 1 + locales/en-US.d.ts | 3 + locales/en-US.js | 14 + locales/en-US.js.map | 1 + locales/es.d.ts | 7 + locales/es.js | 51 + locales/es.js.map | 1 + locales/fr.d.ts | 7 + locales/fr.js | 51 + locales/fr.js.map | 1 + locales/ge.d.ts | 7 + locales/ge.js | 52 + locales/ge.js.map | 1 + locales/he.d.ts | 7 + locales/he.js | 51 + locales/he.js.map | 1 + locales/index.d.ts | 16 + locales/index.js | 27 + locales/index.js.map | 1 + locales/it.d.ts | 7 + locales/it.js | 51 + locales/it.js.map | 1 + locales/nl.d.ts | 7 + locales/nl.js | 61 + locales/nl.js.map | 1 + locales/pt.d.ts | 7 + locales/pt.js | 51 + locales/pt.js.map | 1 + locales/ru.d.ts | 7 + locales/ru.js | 51 + locales/ru.js.map | 1 + 687 files changed, 26145 insertions(+), 4 deletions(-) create mode 100644 bundles/ng2-semantic-ui.umd.js create mode 100644 bundles/ng2-semantic-ui.umd.min.js create mode 100644 dist/behaviors/index.d.ts create mode 100644 dist/behaviors/index.js create mode 100644 dist/behaviors/index.js.map create mode 100644 dist/behaviors/index.metadata.json create mode 100644 dist/behaviors/localization/index.d.ts create mode 100644 dist/behaviors/localization/index.js create mode 100644 dist/behaviors/localization/index.js.map create mode 100644 dist/behaviors/localization/index.metadata.json create mode 100644 dist/behaviors/localization/interfaces/datepicker-values.d.ts create mode 100644 dist/behaviors/localization/interfaces/datepicker-values.js create mode 100644 dist/behaviors/localization/interfaces/datepicker-values.js.map create mode 100644 dist/behaviors/localization/interfaces/datepicker-values.metadata.json create mode 100644 dist/behaviors/localization/interfaces/partial.d.ts create mode 100644 dist/behaviors/localization/interfaces/partial.js create mode 100644 dist/behaviors/localization/interfaces/partial.js.map create mode 100644 dist/behaviors/localization/interfaces/partial.metadata.json create mode 100644 dist/behaviors/localization/interfaces/search-values.d.ts create mode 100644 dist/behaviors/localization/interfaces/search-values.js create mode 100644 dist/behaviors/localization/interfaces/search-values.js.map create mode 100644 dist/behaviors/localization/interfaces/search-values.metadata.json create mode 100644 dist/behaviors/localization/interfaces/select-values.d.ts create mode 100644 dist/behaviors/localization/interfaces/select-values.js create mode 100644 dist/behaviors/localization/interfaces/select-values.js.map create mode 100644 dist/behaviors/localization/interfaces/select-values.metadata.json create mode 100644 dist/behaviors/localization/interfaces/values.d.ts create mode 100644 dist/behaviors/localization/interfaces/values.js create mode 100644 dist/behaviors/localization/interfaces/values.js.map create mode 100644 dist/behaviors/localization/interfaces/values.metadata.json create mode 100644 dist/behaviors/localization/locales/de.d.ts create mode 100644 dist/behaviors/localization/locales/de.js create mode 100644 dist/behaviors/localization/locales/de.js.map create mode 100644 dist/behaviors/localization/locales/en-AU.d.ts create mode 100644 dist/behaviors/localization/locales/en-AU.js create mode 100644 dist/behaviors/localization/locales/en-AU.js.map create mode 100644 dist/behaviors/localization/locales/en-GB.d.ts create mode 100644 dist/behaviors/localization/locales/en-GB.js create mode 100644 dist/behaviors/localization/locales/en-GB.js.map create mode 100644 dist/behaviors/localization/locales/en-US.d.ts create mode 100644 dist/behaviors/localization/locales/en-US.js create mode 100644 dist/behaviors/localization/locales/en-US.js.map create mode 100644 dist/behaviors/localization/locales/es.d.ts create mode 100644 dist/behaviors/localization/locales/es.js create mode 100644 dist/behaviors/localization/locales/es.js.map create mode 100644 dist/behaviors/localization/locales/fr.d.ts create mode 100644 dist/behaviors/localization/locales/fr.js create mode 100644 dist/behaviors/localization/locales/fr.js.map create mode 100644 dist/behaviors/localization/locales/ge.d.ts create mode 100644 dist/behaviors/localization/locales/ge.js create mode 100644 dist/behaviors/localization/locales/ge.js.map create mode 100644 dist/behaviors/localization/locales/he.d.ts create mode 100644 dist/behaviors/localization/locales/he.js create mode 100644 dist/behaviors/localization/locales/he.js.map create mode 100644 dist/behaviors/localization/locales/index.d.ts create mode 100644 dist/behaviors/localization/locales/index.js create mode 100644 dist/behaviors/localization/locales/index.js.map create mode 100644 dist/behaviors/localization/locales/it.d.ts create mode 100644 dist/behaviors/localization/locales/it.js create mode 100644 dist/behaviors/localization/locales/it.js.map create mode 100644 dist/behaviors/localization/locales/nl.d.ts create mode 100644 dist/behaviors/localization/locales/nl.js create mode 100644 dist/behaviors/localization/locales/nl.js.map create mode 100644 dist/behaviors/localization/locales/pt.d.ts create mode 100644 dist/behaviors/localization/locales/pt.js create mode 100644 dist/behaviors/localization/locales/pt.js.map create mode 100644 dist/behaviors/localization/locales/ru.d.ts create mode 100644 dist/behaviors/localization/locales/ru.js create mode 100644 dist/behaviors/localization/locales/ru.js.map create mode 100644 dist/behaviors/localization/localization.module.d.ts create mode 100644 dist/behaviors/localization/localization.module.js create mode 100644 dist/behaviors/localization/localization.module.js.map create mode 100644 dist/behaviors/localization/localization.module.metadata.json create mode 100644 dist/behaviors/localization/public.d.ts create mode 100644 dist/behaviors/localization/public.js create mode 100644 dist/behaviors/localization/public.js.map create mode 100644 dist/behaviors/localization/public.metadata.json create mode 100644 dist/behaviors/localization/services/localization.service.d.ts create mode 100644 dist/behaviors/localization/services/localization.service.js create mode 100644 dist/behaviors/localization/services/localization.service.js.map create mode 100644 dist/behaviors/localization/services/localization.service.metadata.json create mode 100644 dist/behaviors/public.d.ts create mode 100644 dist/behaviors/public.js create mode 100644 dist/behaviors/public.js.map create mode 100644 dist/behaviors/public.metadata.json create mode 100644 dist/collections/index.d.ts create mode 100644 dist/collections/index.js create mode 100644 dist/collections/index.js.map create mode 100644 dist/collections/index.metadata.json create mode 100644 dist/collections/message/components/message.d.ts create mode 100644 dist/collections/message/components/message.js create mode 100644 dist/collections/message/components/message.js.map create mode 100644 dist/collections/message/components/message.metadata.json create mode 100644 dist/collections/message/index.d.ts create mode 100644 dist/collections/message/index.js create mode 100644 dist/collections/message/index.js.map create mode 100644 dist/collections/message/index.metadata.json create mode 100644 dist/collections/message/message.module.d.ts create mode 100644 dist/collections/message/message.module.js create mode 100644 dist/collections/message/message.module.js.map create mode 100644 dist/collections/message/message.module.metadata.json create mode 100644 dist/collections/message/public.d.ts create mode 100644 dist/collections/message/public.js create mode 100644 dist/collections/message/public.js.map create mode 100644 dist/collections/message/public.metadata.json create mode 100644 dist/collections/pagination/components/pagination.d.ts create mode 100644 dist/collections/pagination/components/pagination.js create mode 100644 dist/collections/pagination/components/pagination.js.map create mode 100644 dist/collections/pagination/components/pagination.metadata.json create mode 100644 dist/collections/pagination/index.d.ts create mode 100644 dist/collections/pagination/index.js create mode 100644 dist/collections/pagination/index.js.map create mode 100644 dist/collections/pagination/index.metadata.json create mode 100644 dist/collections/pagination/pagination.module.d.ts create mode 100644 dist/collections/pagination/pagination.module.js create mode 100644 dist/collections/pagination/pagination.module.js.map create mode 100644 dist/collections/pagination/pagination.module.metadata.json create mode 100644 dist/collections/pagination/public.d.ts create mode 100644 dist/collections/pagination/public.js create mode 100644 dist/collections/pagination/public.js.map create mode 100644 dist/collections/pagination/public.metadata.json create mode 100644 dist/collections/public.d.ts create mode 100644 dist/collections/public.js create mode 100644 dist/collections/public.js.map create mode 100644 dist/collections/public.metadata.json create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/index.js.map create mode 100644 dist/index.metadata.json create mode 100644 dist/karma.conf.d.ts create mode 100644 dist/karma.conf.js create mode 100644 dist/karma.conf.js.map create mode 100644 dist/misc/index.d.ts create mode 100644 dist/misc/index.js create mode 100644 dist/misc/index.js.map create mode 100644 dist/misc/index.metadata.json create mode 100644 dist/misc/public.d.ts create mode 100644 dist/misc/public.js create mode 100644 dist/misc/public.js.map create mode 100644 dist/misc/public.metadata.json create mode 100644 dist/misc/util/helpers/custom-validator.d.ts create mode 100644 dist/misc/util/helpers/custom-validator.js create mode 100644 dist/misc/util/helpers/custom-validator.js.map create mode 100644 dist/misc/util/helpers/custom-validator.metadata.json create mode 100644 dist/misc/util/helpers/custom-value-accessor.d.ts create mode 100644 dist/misc/util/helpers/custom-value-accessor.js create mode 100644 dist/misc/util/helpers/custom-value-accessor.js.map create mode 100644 dist/misc/util/helpers/custom-value-accessor.metadata.json create mode 100644 dist/misc/util/helpers/date.d.ts create mode 100644 dist/misc/util/helpers/date.js create mode 100644 dist/misc/util/helpers/date.js.map create mode 100644 dist/misc/util/helpers/date.metadata.json create mode 100644 dist/misc/util/helpers/focus-event.d.ts create mode 100644 dist/misc/util/helpers/focus-event.js create mode 100644 dist/misc/util/helpers/focus-event.js.map create mode 100644 dist/misc/util/helpers/focus-event.metadata.json create mode 100644 dist/misc/util/helpers/util.d.ts create mode 100644 dist/misc/util/helpers/util.js create mode 100644 dist/misc/util/helpers/util.js.map create mode 100644 dist/misc/util/helpers/util.metadata.json create mode 100644 dist/misc/util/index.d.ts create mode 100644 dist/misc/util/index.js create mode 100644 dist/misc/util/index.js.map create mode 100644 dist/misc/util/index.metadata.json create mode 100644 dist/misc/util/public.d.ts create mode 100644 dist/misc/util/public.js create mode 100644 dist/misc/util/public.js.map create mode 100644 dist/misc/util/public.metadata.json create mode 100644 dist/misc/util/services/component-factory.service.d.ts create mode 100644 dist/misc/util/services/component-factory.service.js create mode 100644 dist/misc/util/services/component-factory.service.js.map create mode 100644 dist/misc/util/services/component-factory.service.metadata.json create mode 100644 dist/misc/util/services/positioning.service.d.ts create mode 100644 dist/misc/util/services/positioning.service.js create mode 100644 dist/misc/util/services/positioning.service.js.map create mode 100644 dist/misc/util/services/positioning.service.metadata.json create mode 100644 dist/misc/util/util.module.d.ts create mode 100644 dist/misc/util/util.module.js create mode 100644 dist/misc/util/util.module.js.map create mode 100644 dist/misc/util/util.module.metadata.json create mode 100644 dist/modules/accordion/accordion.module.d.ts create mode 100644 dist/modules/accordion/accordion.module.js create mode 100644 dist/modules/accordion/accordion.module.js.map create mode 100644 dist/modules/accordion/accordion.module.metadata.json create mode 100644 dist/modules/accordion/components/accordion-panel.d.ts create mode 100644 dist/modules/accordion/components/accordion-panel.js create mode 100644 dist/modules/accordion/components/accordion-panel.js.map create mode 100644 dist/modules/accordion/components/accordion-panel.metadata.json create mode 100644 dist/modules/accordion/components/accordion.d.ts create mode 100644 dist/modules/accordion/components/accordion.js create mode 100644 dist/modules/accordion/components/accordion.js.map create mode 100644 dist/modules/accordion/components/accordion.metadata.json create mode 100644 dist/modules/accordion/index.d.ts create mode 100644 dist/modules/accordion/index.js create mode 100644 dist/modules/accordion/index.js.map create mode 100644 dist/modules/accordion/index.metadata.json create mode 100644 dist/modules/accordion/public.d.ts create mode 100644 dist/modules/accordion/public.js create mode 100644 dist/modules/accordion/public.js.map create mode 100644 dist/modules/accordion/public.metadata.json create mode 100644 dist/modules/accordion/services/accordion.service.d.ts create mode 100644 dist/modules/accordion/services/accordion.service.js create mode 100644 dist/modules/accordion/services/accordion.service.js.map create mode 100644 dist/modules/accordion/services/accordion.service.metadata.json create mode 100644 dist/modules/checkbox/checkbox.module.d.ts create mode 100644 dist/modules/checkbox/checkbox.module.js create mode 100644 dist/modules/checkbox/checkbox.module.js.map create mode 100644 dist/modules/checkbox/checkbox.module.metadata.json create mode 100644 dist/modules/checkbox/components/checkbox.d.ts create mode 100644 dist/modules/checkbox/components/checkbox.js create mode 100644 dist/modules/checkbox/components/checkbox.js.map create mode 100644 dist/modules/checkbox/components/checkbox.metadata.json create mode 100644 dist/modules/checkbox/components/radio.d.ts create mode 100644 dist/modules/checkbox/components/radio.js create mode 100644 dist/modules/checkbox/components/radio.js.map create mode 100644 dist/modules/checkbox/components/radio.metadata.json create mode 100644 dist/modules/checkbox/directives/radio-manager.d.ts create mode 100644 dist/modules/checkbox/directives/radio-manager.js create mode 100644 dist/modules/checkbox/directives/radio-manager.js.map create mode 100644 dist/modules/checkbox/directives/radio-manager.metadata.json create mode 100644 dist/modules/checkbox/index.d.ts create mode 100644 dist/modules/checkbox/index.js create mode 100644 dist/modules/checkbox/index.js.map create mode 100644 dist/modules/checkbox/index.metadata.json create mode 100644 dist/modules/checkbox/public.d.ts create mode 100644 dist/modules/checkbox/public.js create mode 100644 dist/modules/checkbox/public.js.map create mode 100644 dist/modules/checkbox/public.metadata.json create mode 100644 dist/modules/collapse/collapse.module.d.ts create mode 100644 dist/modules/collapse/collapse.module.js create mode 100644 dist/modules/collapse/collapse.module.js.map create mode 100644 dist/modules/collapse/collapse.module.metadata.json create mode 100644 dist/modules/collapse/directives/collapse.d.ts create mode 100644 dist/modules/collapse/directives/collapse.js create mode 100644 dist/modules/collapse/directives/collapse.js.map create mode 100644 dist/modules/collapse/directives/collapse.metadata.json create mode 100644 dist/modules/collapse/index.d.ts create mode 100644 dist/modules/collapse/index.js create mode 100644 dist/modules/collapse/index.js.map create mode 100644 dist/modules/collapse/index.metadata.json create mode 100644 dist/modules/collapse/public.d.ts create mode 100644 dist/modules/collapse/public.js create mode 100644 dist/modules/collapse/public.js.map create mode 100644 dist/modules/collapse/public.metadata.json create mode 100644 dist/modules/datepicker/classes/calendar-config.d.ts create mode 100644 dist/modules/datepicker/classes/calendar-config.js create mode 100644 dist/modules/datepicker/classes/calendar-config.js.map create mode 100644 dist/modules/datepicker/classes/calendar-config.metadata.json create mode 100644 dist/modules/datepicker/classes/calendar-mappings.d.ts create mode 100644 dist/modules/datepicker/classes/calendar-mappings.js create mode 100644 dist/modules/datepicker/classes/calendar-mappings.js.map create mode 100644 dist/modules/datepicker/classes/calendar-mappings.metadata.json create mode 100644 dist/modules/datepicker/classes/date-comparer.d.ts create mode 100644 dist/modules/datepicker/classes/date-comparer.js create mode 100644 dist/modules/datepicker/classes/date-comparer.js.map create mode 100644 dist/modules/datepicker/classes/date-comparer.metadata.json create mode 100644 dist/modules/datepicker/classes/date-parser.d.ts create mode 100644 dist/modules/datepicker/classes/date-parser.js create mode 100644 dist/modules/datepicker/classes/date-parser.js.map create mode 100644 dist/modules/datepicker/classes/date-parser.metadata.json create mode 100644 dist/modules/datepicker/components/calendar-view-title.d.ts create mode 100644 dist/modules/datepicker/components/calendar-view-title.js create mode 100644 dist/modules/datepicker/components/calendar-view-title.js.map create mode 100644 dist/modules/datepicker/components/calendar-view-title.metadata.json create mode 100644 dist/modules/datepicker/components/datepicker.d.ts create mode 100644 dist/modules/datepicker/components/datepicker.js create mode 100644 dist/modules/datepicker/components/datepicker.js.map create mode 100644 dist/modules/datepicker/components/datepicker.metadata.json create mode 100644 dist/modules/datepicker/datepicker.module.d.ts create mode 100644 dist/modules/datepicker/datepicker.module.js create mode 100644 dist/modules/datepicker/datepicker.module.js.map create mode 100644 dist/modules/datepicker/datepicker.module.metadata.json create mode 100644 dist/modules/datepicker/directives/calendar-item.d.ts create mode 100644 dist/modules/datepicker/directives/calendar-item.js create mode 100644 dist/modules/datepicker/directives/calendar-item.js.map create mode 100644 dist/modules/datepicker/directives/calendar-item.metadata.json create mode 100644 dist/modules/datepicker/directives/datepicker.directive.d.ts create mode 100644 dist/modules/datepicker/directives/datepicker.directive.js create mode 100644 dist/modules/datepicker/directives/datepicker.directive.js.map create mode 100644 dist/modules/datepicker/directives/datepicker.directive.metadata.json create mode 100644 dist/modules/datepicker/directives/input.directive.d.ts create mode 100644 dist/modules/datepicker/directives/input.directive.js create mode 100644 dist/modules/datepicker/directives/input.directive.js.map create mode 100644 dist/modules/datepicker/directives/input.directive.metadata.json create mode 100644 dist/modules/datepicker/helpers/date-fns.d.ts create mode 100644 dist/modules/datepicker/helpers/date-fns.js create mode 100644 dist/modules/datepicker/helpers/date-fns.js.map create mode 100644 dist/modules/datepicker/helpers/date-fns.metadata.json create mode 100644 dist/modules/datepicker/helpers/is-webview.d.ts create mode 100644 dist/modules/datepicker/helpers/is-webview.js create mode 100644 dist/modules/datepicker/helpers/is-webview.js.map create mode 100644 dist/modules/datepicker/index.d.ts create mode 100644 dist/modules/datepicker/index.js create mode 100644 dist/modules/datepicker/index.js.map create mode 100644 dist/modules/datepicker/index.metadata.json create mode 100644 dist/modules/datepicker/public.d.ts create mode 100644 dist/modules/datepicker/public.js create mode 100644 dist/modules/datepicker/public.js.map create mode 100644 dist/modules/datepicker/public.metadata.json create mode 100644 dist/modules/datepicker/services/calendar-range.service.d.ts create mode 100644 dist/modules/datepicker/services/calendar-range.service.js create mode 100644 dist/modules/datepicker/services/calendar-range.service.js.map create mode 100644 dist/modules/datepicker/services/calendar-range.service.metadata.json create mode 100644 dist/modules/datepicker/services/calendar.service.d.ts create mode 100644 dist/modules/datepicker/services/calendar.service.js create mode 100644 dist/modules/datepicker/services/calendar.service.js.map create mode 100644 dist/modules/datepicker/services/calendar.service.metadata.json create mode 100644 dist/modules/datepicker/views/calendar-view.d.ts create mode 100644 dist/modules/datepicker/views/calendar-view.js create mode 100644 dist/modules/datepicker/views/calendar-view.js.map create mode 100644 dist/modules/datepicker/views/calendar-view.metadata.json create mode 100644 dist/modules/datepicker/views/date-view.d.ts create mode 100644 dist/modules/datepicker/views/date-view.js create mode 100644 dist/modules/datepicker/views/date-view.js.map create mode 100644 dist/modules/datepicker/views/date-view.metadata.json create mode 100644 dist/modules/datepicker/views/hour-view.d.ts create mode 100644 dist/modules/datepicker/views/hour-view.js create mode 100644 dist/modules/datepicker/views/hour-view.js.map create mode 100644 dist/modules/datepicker/views/hour-view.metadata.json create mode 100644 dist/modules/datepicker/views/minute-view.d.ts create mode 100644 dist/modules/datepicker/views/minute-view.js create mode 100644 dist/modules/datepicker/views/minute-view.js.map create mode 100644 dist/modules/datepicker/views/minute-view.metadata.json create mode 100644 dist/modules/datepicker/views/month-view.d.ts create mode 100644 dist/modules/datepicker/views/month-view.js create mode 100644 dist/modules/datepicker/views/month-view.js.map create mode 100644 dist/modules/datepicker/views/month-view.metadata.json create mode 100644 dist/modules/datepicker/views/year-view.d.ts create mode 100644 dist/modules/datepicker/views/year-view.js create mode 100644 dist/modules/datepicker/views/year-view.js.map create mode 100644 dist/modules/datepicker/views/year-view.metadata.json create mode 100644 dist/modules/dimmer/components/dimmer.d.ts create mode 100644 dist/modules/dimmer/components/dimmer.js create mode 100644 dist/modules/dimmer/components/dimmer.js.map create mode 100644 dist/modules/dimmer/components/dimmer.metadata.json create mode 100644 dist/modules/dimmer/dimmer.module.d.ts create mode 100644 dist/modules/dimmer/dimmer.module.js create mode 100644 dist/modules/dimmer/dimmer.module.js.map create mode 100644 dist/modules/dimmer/dimmer.module.metadata.json create mode 100644 dist/modules/dimmer/index.d.ts create mode 100644 dist/modules/dimmer/index.js create mode 100644 dist/modules/dimmer/index.js.map create mode 100644 dist/modules/dimmer/index.metadata.json create mode 100644 dist/modules/dimmer/public.d.ts create mode 100644 dist/modules/dimmer/public.js create mode 100644 dist/modules/dimmer/public.js.map create mode 100644 dist/modules/dimmer/public.metadata.json create mode 100644 dist/modules/dropdown/directives/dropdown-menu.d.ts create mode 100644 dist/modules/dropdown/directives/dropdown-menu.js create mode 100644 dist/modules/dropdown/directives/dropdown-menu.js.map create mode 100644 dist/modules/dropdown/directives/dropdown-menu.metadata.json create mode 100644 dist/modules/dropdown/directives/dropdown.d.ts create mode 100644 dist/modules/dropdown/directives/dropdown.js create mode 100644 dist/modules/dropdown/directives/dropdown.js.map create mode 100644 dist/modules/dropdown/directives/dropdown.metadata.json create mode 100644 dist/modules/dropdown/dropdown.module.d.ts create mode 100644 dist/modules/dropdown/dropdown.module.js create mode 100644 dist/modules/dropdown/dropdown.module.js.map create mode 100644 dist/modules/dropdown/dropdown.module.metadata.json create mode 100644 dist/modules/dropdown/index.d.ts create mode 100644 dist/modules/dropdown/index.js create mode 100644 dist/modules/dropdown/index.js.map create mode 100644 dist/modules/dropdown/index.metadata.json create mode 100644 dist/modules/dropdown/public.d.ts create mode 100644 dist/modules/dropdown/public.js create mode 100644 dist/modules/dropdown/public.js.map create mode 100644 dist/modules/dropdown/public.metadata.json create mode 100644 dist/modules/dropdown/services/dropdown.service.d.ts create mode 100644 dist/modules/dropdown/services/dropdown.service.js create mode 100644 dist/modules/dropdown/services/dropdown.service.js.map create mode 100644 dist/modules/dropdown/services/dropdown.service.metadata.json create mode 100644 dist/modules/index.d.ts create mode 100644 dist/modules/index.js create mode 100644 dist/modules/index.js.map create mode 100644 dist/modules/index.metadata.json create mode 100644 dist/modules/modal/classes/active-modal.d.ts create mode 100644 dist/modules/modal/classes/active-modal.js create mode 100644 dist/modules/modal/classes/active-modal.js.map create mode 100644 dist/modules/modal/classes/active-modal.metadata.json create mode 100644 dist/modules/modal/classes/modal-config.d.ts create mode 100644 dist/modules/modal/classes/modal-config.js create mode 100644 dist/modules/modal/classes/modal-config.js.map create mode 100644 dist/modules/modal/classes/modal-config.metadata.json create mode 100644 dist/modules/modal/classes/modal-controls.d.ts create mode 100644 dist/modules/modal/classes/modal-controls.js create mode 100644 dist/modules/modal/classes/modal-controls.js.map create mode 100644 dist/modules/modal/classes/modal-controls.metadata.json create mode 100644 dist/modules/modal/classes/modal-template.d.ts create mode 100644 dist/modules/modal/classes/modal-template.js create mode 100644 dist/modules/modal/classes/modal-template.js.map create mode 100644 dist/modules/modal/classes/modal-template.metadata.json create mode 100644 dist/modules/modal/components/modal.d.ts create mode 100644 dist/modules/modal/components/modal.js create mode 100644 dist/modules/modal/components/modal.js.map create mode 100644 dist/modules/modal/components/modal.metadata.json create mode 100644 dist/modules/modal/index.d.ts create mode 100644 dist/modules/modal/index.js create mode 100644 dist/modules/modal/index.js.map create mode 100644 dist/modules/modal/index.metadata.json create mode 100644 dist/modules/modal/modal.module.d.ts create mode 100644 dist/modules/modal/modal.module.js create mode 100644 dist/modules/modal/modal.module.js.map create mode 100644 dist/modules/modal/modal.module.metadata.json create mode 100644 dist/modules/modal/public.d.ts create mode 100644 dist/modules/modal/public.js create mode 100644 dist/modules/modal/public.js.map create mode 100644 dist/modules/modal/public.metadata.json create mode 100644 dist/modules/modal/services/modal.service.d.ts create mode 100644 dist/modules/modal/services/modal.service.js create mode 100644 dist/modules/modal/services/modal.service.js.map create mode 100644 dist/modules/modal/services/modal.service.metadata.json create mode 100644 dist/modules/popup/classes/popup-component-controller.d.ts create mode 100644 dist/modules/popup/classes/popup-component-controller.js create mode 100644 dist/modules/popup/classes/popup-component-controller.js.map create mode 100644 dist/modules/popup/classes/popup-component-controller.metadata.json create mode 100644 dist/modules/popup/classes/popup-config.d.ts create mode 100644 dist/modules/popup/classes/popup-config.js create mode 100644 dist/modules/popup/classes/popup-config.js.map create mode 100644 dist/modules/popup/classes/popup-config.metadata.json create mode 100644 dist/modules/popup/classes/popup-controller.d.ts create mode 100644 dist/modules/popup/classes/popup-controller.js create mode 100644 dist/modules/popup/classes/popup-controller.js.map create mode 100644 dist/modules/popup/classes/popup-controller.metadata.json create mode 100644 dist/modules/popup/classes/popup-lifecycle.d.ts create mode 100644 dist/modules/popup/classes/popup-lifecycle.js create mode 100644 dist/modules/popup/classes/popup-lifecycle.js.map create mode 100644 dist/modules/popup/classes/popup-lifecycle.metadata.json create mode 100644 dist/modules/popup/classes/popup-template-controller.d.ts create mode 100644 dist/modules/popup/classes/popup-template-controller.js create mode 100644 dist/modules/popup/classes/popup-template-controller.js.map create mode 100644 dist/modules/popup/classes/popup-template-controller.metadata.json create mode 100644 dist/modules/popup/components/popup-arrow.d.ts create mode 100644 dist/modules/popup/components/popup-arrow.js create mode 100644 dist/modules/popup/components/popup-arrow.js.map create mode 100644 dist/modules/popup/components/popup-arrow.metadata.json create mode 100644 dist/modules/popup/components/popup.d.ts create mode 100644 dist/modules/popup/components/popup.js create mode 100644 dist/modules/popup/components/popup.js.map create mode 100644 dist/modules/popup/components/popup.metadata.json create mode 100644 dist/modules/popup/directives/popup.directive.d.ts create mode 100644 dist/modules/popup/directives/popup.directive.js create mode 100644 dist/modules/popup/directives/popup.directive.js.map create mode 100644 dist/modules/popup/directives/popup.directive.metadata.json create mode 100644 dist/modules/popup/index.d.ts create mode 100644 dist/modules/popup/index.js create mode 100644 dist/modules/popup/index.js.map create mode 100644 dist/modules/popup/index.metadata.json create mode 100644 dist/modules/popup/popup.module.d.ts create mode 100644 dist/modules/popup/popup.module.js create mode 100644 dist/modules/popup/popup.module.js.map create mode 100644 dist/modules/popup/popup.module.metadata.json create mode 100644 dist/modules/popup/public.d.ts create mode 100644 dist/modules/popup/public.js create mode 100644 dist/modules/popup/public.js.map create mode 100644 dist/modules/popup/public.metadata.json create mode 100644 dist/modules/popup/services/popup.service.d.ts create mode 100644 dist/modules/popup/services/popup.service.js create mode 100644 dist/modules/popup/services/popup.service.js.map create mode 100644 dist/modules/popup/services/popup.service.metadata.json create mode 100644 dist/modules/progress/components/progress.d.ts create mode 100644 dist/modules/progress/components/progress.js create mode 100644 dist/modules/progress/components/progress.js.map create mode 100644 dist/modules/progress/components/progress.metadata.json create mode 100644 dist/modules/progress/index.d.ts create mode 100644 dist/modules/progress/index.js create mode 100644 dist/modules/progress/index.js.map create mode 100644 dist/modules/progress/index.metadata.json create mode 100644 dist/modules/progress/progress.module.d.ts create mode 100644 dist/modules/progress/progress.module.js create mode 100644 dist/modules/progress/progress.module.js.map create mode 100644 dist/modules/progress/progress.module.metadata.json create mode 100644 dist/modules/progress/public.d.ts create mode 100644 dist/modules/progress/public.js create mode 100644 dist/modules/progress/public.js.map create mode 100644 dist/modules/progress/public.metadata.json create mode 100644 dist/modules/public.d.ts create mode 100644 dist/modules/public.js create mode 100644 dist/modules/public.js.map create mode 100644 dist/modules/public.metadata.json create mode 100644 dist/modules/rating/components/rating.d.ts create mode 100644 dist/modules/rating/components/rating.js create mode 100644 dist/modules/rating/components/rating.js.map create mode 100644 dist/modules/rating/components/rating.metadata.json create mode 100644 dist/modules/rating/index.d.ts create mode 100644 dist/modules/rating/index.js create mode 100644 dist/modules/rating/index.js.map create mode 100644 dist/modules/rating/index.metadata.json create mode 100644 dist/modules/rating/public.d.ts create mode 100644 dist/modules/rating/public.js create mode 100644 dist/modules/rating/public.js.map create mode 100644 dist/modules/rating/public.metadata.json create mode 100644 dist/modules/rating/rating.module.d.ts create mode 100644 dist/modules/rating/rating.module.js create mode 100644 dist/modules/rating/rating.module.js.map create mode 100644 dist/modules/rating/rating.module.metadata.json create mode 100644 dist/modules/search/components/search-result.d.ts create mode 100644 dist/modules/search/components/search-result.js create mode 100644 dist/modules/search/components/search-result.js.map create mode 100644 dist/modules/search/components/search-result.metadata.json create mode 100644 dist/modules/search/components/search.d.ts create mode 100644 dist/modules/search/components/search.js create mode 100644 dist/modules/search/components/search.js.map create mode 100644 dist/modules/search/components/search.metadata.json create mode 100644 dist/modules/search/helpers/lookup-fn.d.ts create mode 100644 dist/modules/search/helpers/lookup-fn.js create mode 100644 dist/modules/search/helpers/lookup-fn.js.map create mode 100644 dist/modules/search/helpers/lookup-fn.metadata.json create mode 100644 dist/modules/search/index.d.ts create mode 100644 dist/modules/search/index.js create mode 100644 dist/modules/search/index.js.map create mode 100644 dist/modules/search/index.metadata.json create mode 100644 dist/modules/search/public.d.ts create mode 100644 dist/modules/search/public.js create mode 100644 dist/modules/search/public.js.map create mode 100644 dist/modules/search/public.metadata.json create mode 100644 dist/modules/search/search.module.d.ts create mode 100644 dist/modules/search/search.module.js create mode 100644 dist/modules/search/search.module.js.map create mode 100644 dist/modules/search/search.module.metadata.json create mode 100644 dist/modules/search/services/search.service.d.ts create mode 100644 dist/modules/search/services/search.service.js create mode 100644 dist/modules/search/services/search.service.js.map create mode 100644 dist/modules/search/services/search.service.metadata.json create mode 100644 dist/modules/select/classes/select-base.d.ts create mode 100644 dist/modules/select/classes/select-base.js create mode 100644 dist/modules/select/classes/select-base.js.map create mode 100644 dist/modules/select/classes/select-base.metadata.json create mode 100644 dist/modules/select/components/multi-select-label.d.ts create mode 100644 dist/modules/select/components/multi-select-label.js create mode 100644 dist/modules/select/components/multi-select-label.js.map create mode 100644 dist/modules/select/components/multi-select-label.metadata.json create mode 100644 dist/modules/select/components/multi-select.d.ts create mode 100644 dist/modules/select/components/multi-select.js create mode 100644 dist/modules/select/components/multi-select.js.map create mode 100644 dist/modules/select/components/multi-select.metadata.json create mode 100644 dist/modules/select/components/select-option.d.ts create mode 100644 dist/modules/select/components/select-option.js create mode 100644 dist/modules/select/components/select-option.js.map create mode 100644 dist/modules/select/components/select-option.metadata.json create mode 100644 dist/modules/select/components/select.d.ts create mode 100644 dist/modules/select/components/select.js create mode 100644 dist/modules/select/components/select.js.map create mode 100644 dist/modules/select/components/select.metadata.json create mode 100644 dist/modules/select/directives/select-search.d.ts create mode 100644 dist/modules/select/directives/select-search.js create mode 100644 dist/modules/select/directives/select-search.js.map create mode 100644 dist/modules/select/directives/select-search.metadata.json create mode 100644 dist/modules/select/index.d.ts create mode 100644 dist/modules/select/index.js create mode 100644 dist/modules/select/index.js.map create mode 100644 dist/modules/select/index.metadata.json create mode 100644 dist/modules/select/public.d.ts create mode 100644 dist/modules/select/public.js create mode 100644 dist/modules/select/public.js.map create mode 100644 dist/modules/select/public.metadata.json create mode 100644 dist/modules/select/select.module.d.ts create mode 100644 dist/modules/select/select.module.js create mode 100644 dist/modules/select/select.module.js.map create mode 100644 dist/modules/select/select.module.metadata.json create mode 100644 dist/modules/sidebar/components/sidebar-container.d.ts create mode 100644 dist/modules/sidebar/components/sidebar-container.js create mode 100644 dist/modules/sidebar/components/sidebar-container.js.map create mode 100644 dist/modules/sidebar/components/sidebar-container.metadata.json create mode 100644 dist/modules/sidebar/components/sidebar-sibling.d.ts create mode 100644 dist/modules/sidebar/components/sidebar-sibling.js create mode 100644 dist/modules/sidebar/components/sidebar-sibling.js.map create mode 100644 dist/modules/sidebar/components/sidebar-sibling.metadata.json create mode 100644 dist/modules/sidebar/components/sidebar.d.ts create mode 100644 dist/modules/sidebar/components/sidebar.js create mode 100644 dist/modules/sidebar/components/sidebar.js.map create mode 100644 dist/modules/sidebar/components/sidebar.metadata.json create mode 100644 dist/modules/sidebar/index.d.ts create mode 100644 dist/modules/sidebar/index.js create mode 100644 dist/modules/sidebar/index.js.map create mode 100644 dist/modules/sidebar/index.metadata.json create mode 100644 dist/modules/sidebar/public.d.ts create mode 100644 dist/modules/sidebar/public.js create mode 100644 dist/modules/sidebar/public.js.map create mode 100644 dist/modules/sidebar/public.metadata.json create mode 100644 dist/modules/sidebar/services/sidebar.service.d.ts create mode 100644 dist/modules/sidebar/services/sidebar.service.js create mode 100644 dist/modules/sidebar/services/sidebar.service.js.map create mode 100644 dist/modules/sidebar/services/sidebar.service.metadata.json create mode 100644 dist/modules/sidebar/sidebar.module.d.ts create mode 100644 dist/modules/sidebar/sidebar.module.js create mode 100644 dist/modules/sidebar/sidebar.module.js.map create mode 100644 dist/modules/sidebar/sidebar.module.metadata.json create mode 100644 dist/modules/tabs/classes/tab.d.ts create mode 100644 dist/modules/tabs/classes/tab.js create mode 100644 dist/modules/tabs/classes/tab.js.map create mode 100644 dist/modules/tabs/classes/tab.metadata.json create mode 100644 dist/modules/tabs/components/tabset.d.ts create mode 100644 dist/modules/tabs/components/tabset.js create mode 100644 dist/modules/tabs/components/tabset.js.map create mode 100644 dist/modules/tabs/components/tabset.metadata.json create mode 100644 dist/modules/tabs/directives/tab-content.d.ts create mode 100644 dist/modules/tabs/directives/tab-content.js create mode 100644 dist/modules/tabs/directives/tab-content.js.map create mode 100644 dist/modules/tabs/directives/tab-content.metadata.json create mode 100644 dist/modules/tabs/directives/tab-header.d.ts create mode 100644 dist/modules/tabs/directives/tab-header.js create mode 100644 dist/modules/tabs/directives/tab-header.js.map create mode 100644 dist/modules/tabs/directives/tab-header.metadata.json create mode 100644 dist/modules/tabs/index.d.ts create mode 100644 dist/modules/tabs/index.js create mode 100644 dist/modules/tabs/index.js.map create mode 100644 dist/modules/tabs/index.metadata.json create mode 100644 dist/modules/tabs/public.d.ts create mode 100644 dist/modules/tabs/public.js create mode 100644 dist/modules/tabs/public.js.map create mode 100644 dist/modules/tabs/public.metadata.json create mode 100644 dist/modules/tabs/tab.module.d.ts create mode 100644 dist/modules/tabs/tab.module.js create mode 100644 dist/modules/tabs/tab.module.js.map create mode 100644 dist/modules/tabs/tab.module.metadata.json create mode 100644 dist/modules/transition/classes/transition-controller.d.ts create mode 100644 dist/modules/transition/classes/transition-controller.js create mode 100644 dist/modules/transition/classes/transition-controller.js.map create mode 100644 dist/modules/transition/classes/transition-controller.metadata.json create mode 100644 dist/modules/transition/classes/transition.d.ts create mode 100644 dist/modules/transition/classes/transition.js create mode 100644 dist/modules/transition/classes/transition.js.map create mode 100644 dist/modules/transition/classes/transition.metadata.json create mode 100644 dist/modules/transition/directives/transition.d.ts create mode 100644 dist/modules/transition/directives/transition.js create mode 100644 dist/modules/transition/directives/transition.js.map create mode 100644 dist/modules/transition/directives/transition.metadata.json create mode 100644 dist/modules/transition/index.d.ts create mode 100644 dist/modules/transition/index.js create mode 100644 dist/modules/transition/index.js.map create mode 100644 dist/modules/transition/index.metadata.json create mode 100644 dist/modules/transition/public.d.ts create mode 100644 dist/modules/transition/public.js create mode 100644 dist/modules/transition/public.js.map create mode 100644 dist/modules/transition/public.metadata.json create mode 100644 dist/modules/transition/transition.module.d.ts create mode 100644 dist/modules/transition/transition.module.js create mode 100644 dist/modules/transition/transition.module.js.map create mode 100644 dist/modules/transition/transition.module.metadata.json create mode 100644 dist/public.d.ts create mode 100644 dist/public.js create mode 100644 dist/public.js.map create mode 100644 dist/public.metadata.json create mode 100644 dist/sui.module.d.ts create mode 100644 dist/sui.module.js create mode 100644 dist/sui.module.js.map create mode 100644 dist/sui.module.metadata.json create mode 100644 locales/de.d.ts create mode 100644 locales/de.js create mode 100644 locales/de.js.map create mode 100644 locales/en-AU.d.ts create mode 100644 locales/en-AU.js create mode 100644 locales/en-AU.js.map create mode 100644 locales/en-GB.d.ts create mode 100644 locales/en-GB.js create mode 100644 locales/en-GB.js.map create mode 100644 locales/en-US.d.ts create mode 100644 locales/en-US.js create mode 100644 locales/en-US.js.map create mode 100644 locales/es.d.ts create mode 100644 locales/es.js create mode 100644 locales/es.js.map create mode 100644 locales/fr.d.ts create mode 100644 locales/fr.js create mode 100644 locales/fr.js.map create mode 100644 locales/ge.d.ts create mode 100644 locales/ge.js create mode 100644 locales/ge.js.map create mode 100644 locales/he.d.ts create mode 100644 locales/he.js create mode 100644 locales/he.js.map create mode 100644 locales/index.d.ts create mode 100644 locales/index.js create mode 100644 locales/index.js.map create mode 100644 locales/it.d.ts create mode 100644 locales/it.js create mode 100644 locales/it.js.map create mode 100644 locales/nl.d.ts create mode 100644 locales/nl.js create mode 100644 locales/nl.js.map create mode 100644 locales/pt.d.ts create mode 100644 locales/pt.js create mode 100644 locales/pt.js.map create mode 100644 locales/ru.d.ts create mode 100644 locales/ru.js create mode 100644 locales/ru.js.map diff --git a/.gitignore b/.gitignore index 5ae9fc49d..3df38dff7 100644 --- a/.gitignore +++ b/.gitignore @@ -32,10 +32,10 @@ testem.log Thumbs.db # non TS files -*.d.ts -*.metadata.json -*.js -*.js.map +# *.d.ts +# *.metadata.json +# *.js +# *.js.map # build scripts !scripts/**/* diff --git a/bundles/ng2-semantic-ui.umd.js b/bundles/ng2-semantic-ui.umd.js new file mode 100644 index 000000000..d9561086d --- /dev/null +++ b/bundles/ng2-semantic-ui.umd.js @@ -0,0 +1,14295 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms')) : + typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@angular/forms'], factory) : + (factory((global['ng2-semantic-ui'] = global['ng2-semantic-ui'] || {}),global._angular_core,global._angular_common,global._angular_forms)); +}(this, (function (exports,_angular_core,_angular_common,_angular_forms) { 'use strict'; + +var enGB = { + datepicker: { + months: [ + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + ], + monthsShort: [ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + ], + weekdays: [ + "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" + ], + weekdaysShort: [ + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + ], + weekdaysNarrow: [ + "S", "M", "T", "W", "T", "F", "S" + ], + timesOfDay: [ + "a.m.", "p.m." + ], + timesOfDayUppercase: [ + "AM", "PM" + ], + timesOfDayLowercase: [ + "am", "pm" + ], + formats: { + time: "h:mm A", + datetime: "D MMMM YYYY h:mm A", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Search...", + noResults: { + header: "No Results", + message: "Your search returned no results." + } + }, + select: { + noResultsMessage: "No results", + single: { + placeholder: "Select one" + }, + multi: { + placeholder: "Select...", + maxSelectedMessage: "Max #{max} selections", + selectedMessage: "#{count} selections" + } + } +}; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +var index = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; +}; + + + +var $extend = Object.freeze({ + default: index, + __moduleExports: index +}); + +function deepClone(obj) { + return JSON.parse(JSON.stringify(obj)); +} +function deepExtend(target, source) { + // Rollup... + var extend = index || $extend; + return extend(true, target, source); +} +function lang(language) { + return language.toLowerCase().replace("-", ""); +} +var SuiLocalizationService = /** @class */ (function () { + function SuiLocalizationService() { + this.onLanguageUpdate = new _angular_core.EventEmitter(); + this._fallbackValues = enGB; + this._values = {}; + this._language = "en-GB"; + this.load("en-GB", enGB); + } + Object.defineProperty(SuiLocalizationService.prototype, "language", { + get: function () { + return this._language; + }, + enumerable: true, + configurable: true + }); + SuiLocalizationService.prototype.setLanguage = function (language) { + if (lang(this._language) !== lang(language)) { + this._language = language; + this.onLanguageUpdate.emit(); + } + }; + SuiLocalizationService.prototype.get = function (language) { + if (language === void 0) { language = this.language; } + var values = deepClone(this._fallbackValues); + if (!this._values[lang(language)]) { + throw new Error("Locale " + language + " is not loaded"); + } + deepExtend(values, this._values[lang(language)]); + return deepClone(values); + }; + SuiLocalizationService.prototype.override = function (values, overrides) { + return deepExtend(deepClone(values), overrides); + }; + SuiLocalizationService.prototype.load = function (language, values) { + this._values[lang(language)] = deepClone(values); + this.onLanguageUpdate.emit(); + }; + SuiLocalizationService.prototype.patch = function (language, values) { + deepExtend(this._values[lang(language)], values); + }; + SuiLocalizationService.prototype.interpolate = function (value, variables) { + return variables.reduce(function (s, _a) { + var k = _a[0], v = _a[1]; + return s.replace(new RegExp("#{" + k + "}", "g"), v); + }, value); + }; + SuiLocalizationService.decorators = [ + { type: _angular_core.Injectable }, + ]; + /** @nocollapse */ + SuiLocalizationService.ctorParameters = function () { return []; }; + return SuiLocalizationService; +}()); + +var SuiLocalizationModule = /** @class */ (function () { + function SuiLocalizationModule() { + } + SuiLocalizationModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [_angular_common.CommonModule], + providers: [SuiLocalizationService] + },] }, + ]; + /** @nocollapse */ + SuiLocalizationModule.ctorParameters = function () { return []; }; + return SuiLocalizationModule; +}()); + +// Possible directions for a transition. +// Possible directions for a transition. + +// Possible directions for a transition. +(function (TransitionDirection) { + TransitionDirection[TransitionDirection["In"] = 0] = "In"; + TransitionDirection[TransitionDirection["Out"] = 1] = "Out"; + TransitionDirection[TransitionDirection["Either"] = 2] = "Either"; + TransitionDirection[TransitionDirection["Static"] = 3] = "Static"; +})(exports.TransitionDirection || (exports.TransitionDirection = {})); +var Transition = /** @class */ (function () { + function Transition(name, duration, direction, onComplete) { + if (duration === void 0) { duration = 250; } + if (direction === void 0) { direction = exports.TransitionDirection.Either; } + if (onComplete === void 0) { onComplete = function () { }; } + this.type = name; + // We set a minimum duration of 1ms, to give the appearance of an immediate transition + // whilst allowing positioning calculations to happen without a visible flicker. + this.duration = Math.max(duration, 1); + this.direction = direction; + this.classes = this.type.split(" "); + this.onComplete = onComplete; + } + Object.defineProperty(Transition.prototype, "directionClass", { + // Converts TransitionDirection to class name. + get: + // Converts TransitionDirection to class name. + function () { + switch (this.direction) { + case exports.TransitionDirection.In: return "in"; + case exports.TransitionDirection.Out: return "out"; + } + return ""; + }, + enumerable: true, + configurable: true + }); + return Transition; +}()); + +var TransitionController = /** @class */ (function () { + function TransitionController(isInitiallyVisible, display) { + if (isInitiallyVisible === void 0) { isInitiallyVisible = true; } + if (display === void 0) { display = "block"; } + // isInitiallyVisible sets whether the element starts out visible. + this._isVisible = isInitiallyVisible; + this._isHidden = !this._isVisible; + this._display = display; + this._queue = []; + this._isAnimating = false; + } + Object.defineProperty(TransitionController.prototype, "_isReady", { + // Used to delay animations until we have an element to animate. + get: + // Used to delay animations until we have an element to animate. + function () { + return this._renderer != undefined && this._element != undefined && this._changeDetector != undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransitionController.prototype, "isAnimating", { + get: function () { + return this._isAnimating; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransitionController.prototype, "isVisible", { + get: function () { + return this._isVisible; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransitionController.prototype, "isHidden", { + get: function () { + return this._isHidden; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransitionController.prototype, "_queueFirst", { + // Gets the first transition in the queue. + get: + // Gets the first transition in the queue. + function () { + return this._queue[0]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransitionController.prototype, "_queueLast", { + // Gets the last transition in the queue. + get: + // Gets the last transition in the queue. + function () { + return this._queue[this._queue.length - 1]; + }, + enumerable: true, + configurable: true + }); + // Sets the renderer to be used for animating. + // Sets the renderer to be used for animating. + TransitionController.prototype.registerRenderer = + // Sets the renderer to be used for animating. + function (renderer) { + this._renderer = renderer; + this.performTransition(); + }; + // Sets the element to perform the animations on. + // Sets the element to perform the animations on. + TransitionController.prototype.registerElement = + // Sets the element to perform the animations on. + function (element) { + this._element = element; + this.performTransition(); + }; + // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. + // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. + TransitionController.prototype.registerChangeDetector = + // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. + function (changeDetector) { + this._changeDetector = changeDetector; + this.performTransition(); + }; + TransitionController.prototype.animate = function (transition) { + // Test if transition is one of the list that doesn't change the visible state. + // Should these eventually become classes? + var isDirectionless = ["jiggle", "flash", "shake", "pulse", "tada", "bounce"].indexOf(transition.type) !== -1; + if (isDirectionless) { + transition.direction = exports.TransitionDirection.Static; + } + else if (transition.direction == undefined || transition.direction === exports.TransitionDirection.Either) { + // Set the direction to the opposite of the current visible state automatically if not set, or set to either direction. + transition.direction = this._isVisible ? exports.TransitionDirection.Out : exports.TransitionDirection.In; + if (this._queueLast) { + // If there is an transition in the queue already, set the direction to the opposite of the direction of that transition. + if (this._queueLast.direction === exports.TransitionDirection.In) { + transition.direction = exports.TransitionDirection.Out; + } + else if (this._queueLast.direction === exports.TransitionDirection.Out) { + transition.direction = exports.TransitionDirection.In; + } + } + } + // Store the transition in the queue before attempting to perform it. + this._queue.push(transition); + this.performTransition(); + }; + TransitionController.prototype.performTransition = function () { + var _this = this; + if (!this._isReady || this._isAnimating || !this._queueFirst) { + // Don't transition until we are ready, or if we are animating, or if there aren't any transitions in the queue. + return; + } + this._isAnimating = true; + var transition = this._queueFirst; + // Set the Semantic UI classes for transitioning. + transition.classes.forEach(function (c) { return _this._renderer.addClass(_this._element, c); }); + this._renderer.addClass(this._element, "animating"); + this._renderer.addClass(this._element, transition.directionClass); + // Set the Semantic UI styles for transitioning. + this._renderer.setStyle(this._element, "animationDuration", transition.duration + "ms"); + this._renderer.setStyle(this._element, "display", this._display); + if (transition.direction === exports.TransitionDirection.In) { + // Unset hidden if we are transitioning in. + this._isHidden = false; + } + // Wait the length of the animation before calling the complete callback. + this._animationTimeout = window.setTimeout(function () { return _this.finishTransition(transition); }, transition.duration); + }; + // Called when a transition has completed. + // Called when a transition has completed. + TransitionController.prototype.finishTransition = + // Called when a transition has completed. + function (transition) { + var _this = this; + // Unset the Semantic UI classes & styles for transitioning. + transition.classes.forEach(function (c) { return _this._renderer.removeClass(_this._element, c); }); + this._renderer.removeClass(this._element, "animating"); + this._renderer.removeClass(this._element, transition.directionClass); + this._renderer.removeStyle(this._element, "animationDuration"); + this._renderer.removeStyle(this._element, "display"); + if (transition.direction === exports.TransitionDirection.In) { + // If we have just animated in, we are now visible. + this._isVisible = true; + } + else if (transition.direction === exports.TransitionDirection.Out) { + // If we have transitioned out, we should be invisible and hidden. + this._isVisible = false; + this._isHidden = true; + } + if (transition.onComplete) { + // Call the user-defined transition callback. + transition.onComplete(); + } + // Delete the transition from the queue. + this._queue.shift(); + this._isAnimating = false; + this._changeDetector.markForCheck(); + // Immediately attempt to perform another transition. + this.performTransition(); + }; + // Stops the current transition, leaves the rest of the queue intact. + // Stops the current transition, leaves the rest of the queue intact. + TransitionController.prototype.stop = + // Stops the current transition, leaves the rest of the queue intact. + function (transition) { + if (transition === void 0) { transition = this._queueFirst; } + if (!transition || !this._isAnimating) { + return; + } + clearTimeout(this._animationTimeout); + this.finishTransition(transition); + }; + // Stops the current transition, and empties the queue. + // Stops the current transition, and empties the queue. + TransitionController.prototype.stopAll = + // Stops the current transition, and empties the queue. + function () { + this.clearQueue(); + this.stop(); + }; + // Empties the transition queue but carries on with the current transition. + // Empties the transition queue but carries on with the current transition. + TransitionController.prototype.clearQueue = + // Empties the transition queue but carries on with the current transition. + function () { + if (this.isAnimating) { + this._queue = [this._queueFirst]; + return; + } + this._queue = []; + }; + return TransitionController; +}()); + +var SuiTransition = /** @class */ (function () { + function SuiTransition(_renderer, _element, _changeDetector) { + this._renderer = _renderer; + this._element = _element; + this._changeDetector = _changeDetector; + this.transitionClass = true; + } + Object.defineProperty(SuiTransition.prototype, "suiTransition", { + set: function (tC) { + // Set the transition controller (e.g. '
'). + this.setTransitionController(tC); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiTransition.prototype, "isVisible", { + get: function () { + if (this._controller) { + return this._controller.isVisible; + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiTransition.prototype, "isHidden", { + get: function () { + if (this._controller) { + return this._controller.isHidden; + } + return false; + }, + enumerable: true, + configurable: true + }); + // Initialises the controller with the injected renderer and elementRef. + // Initialises the controller with the injected renderer and elementRef. + SuiTransition.prototype.setTransitionController = + // Initialises the controller with the injected renderer and elementRef. + function (transitionController) { + this._controller = transitionController; + this._controller.registerRenderer(this._renderer); + this._controller.registerElement(this._element.nativeElement); + this._controller.registerChangeDetector(this._changeDetector); + }; + SuiTransition.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "[suiTransition]", + exportAs: "transition" + },] }, + ]; + /** @nocollapse */ + SuiTransition.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + { type: _angular_core.ChangeDetectorRef, }, + ]; }; + SuiTransition.propDecorators = { + "suiTransition": [{ type: _angular_core.Input },], + "transitionClass": [{ type: _angular_core.HostBinding, args: ["class.transition",] },], + "isVisible": [{ type: _angular_core.HostBinding, args: ["class.visible",] },], + "isHidden": [{ type: _angular_core.HostBinding, args: ["class.hidden",] },], + }; + return SuiTransition; +}()); + +var SuiTransitionModule = /** @class */ (function () { + function SuiTransitionModule() { + } + SuiTransitionModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [_angular_common.CommonModule], + declarations: [ + SuiTransition + ], + exports: [ + SuiTransition + ], + providers: [] + },] }, + ]; + /** @nocollapse */ + SuiTransitionModule.ctorParameters = function () { return []; }; + return SuiTransitionModule; +}()); + +var SuiMessage = /** @class */ (function () { + function SuiMessage() { + this.isDismissable = true; + this.onDismiss = new _angular_core.EventEmitter(); + this.isDismissed = false; + this.transitionController = new TransitionController(); + this.transition = "fade"; + this.transitionDuration = 300; + this.class = ""; + } + SuiMessage.prototype.dismiss = function () { + var _this = this; + this.transitionController.animate(new Transition(this.transition, this.transitionDuration, exports.TransitionDirection.Out, function () { + _this.isDismissed = true; + _this.onDismiss.emit(_this); + })); + }; + SuiMessage.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-message", + template: "\n
\n \n \n
\n", + styles: ["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiMessage.ctorParameters = function () { return []; }; + SuiMessage.propDecorators = { + "isDismissable": [{ type: _angular_core.Input },], + "onDismiss": [{ type: _angular_core.Output, args: ["dismiss",] },], + "transition": [{ type: _angular_core.Input },], + "transitionDuration": [{ type: _angular_core.Input },], + "class": [{ type: _angular_core.Input, args: ["class",] },], + }; + return SuiMessage; +}()); + +var SuiMessageModule = /** @class */ (function () { + function SuiMessageModule() { + } + SuiMessageModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule, + SuiTransitionModule + ], + declarations: [ + SuiMessage + ], + exports: [ + SuiMessage + ] + },] }, + ]; + /** @nocollapse */ + SuiMessageModule.ctorParameters = function () { return []; }; + return SuiMessageModule; +}()); + +var SuiPagination = /** @class */ (function () { + function SuiPagination() { + this._paginationClasses = true; + this.pageChange = new _angular_core.EventEmitter(); + this.pageSize = 10; + this._page = 1; + this._pages = []; + this.pageCount = 1; + this.hasNavigationLinks = true; + this.hasBoundaryLinks = false; + this.canRotate = false; + this.hasEllipses = true; + } + Object.defineProperty(SuiPagination.prototype, "maxSize", { + get: function () { + return this._maxSize; + }, + set: function (value) { + this._maxSize = (value != undefined) ? Math.max(value, 1) : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPagination.prototype, "collectionSize", { + get: function () { + return this._collectionSize; + }, + set: function (value) { + this._collectionSize = Math.max(value, 0); + this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize)); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPagination.prototype, "hasNavigationLinks", { + get: function () { + var maxSize = this._maxSize || this.pageCount; + return this._hasNavigationLinks || maxSize < this.pageCount; + }, + set: function (value) { + this._hasNavigationLinks = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPagination.prototype, "page", { + get: function () { + return this._page; + }, + set: function (value) { + this.setPage(value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPagination.prototype, "pages", { + get: function () { + return this._pages; + }, + enumerable: true, + configurable: true + }); + // Public methods + // Public methods + SuiPagination.prototype.hasPrevious = + // Public methods + function () { + return this.page > 1; + }; + SuiPagination.prototype.hasNext = function () { + return this.page < this.pageCount; + }; + SuiPagination.prototype.setPage = function (newPage) { + var value = (Number.isInteger(newPage)) ? Math.min(Math.max(newPage, 1), this.pageCount) : 1; + if (value !== this._page) { + this._page = value; + this.pageChange.emit(this._page); + } + }; + // Lifecycle hooks + // Lifecycle hooks + SuiPagination.prototype.ngOnChanges = + // Lifecycle hooks + function () { + this.updatePages(); + }; + // Private methods + // Private methods + SuiPagination.prototype.updatePages = + // Private methods + function () { + this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize)); + var _a = this.applyPagination(), start = _a[0], end = _a[1]; + this._pages = Array(end - start) + .fill(start + 1) + .map(function (s, i) { return s + i; }); + }; + SuiPagination.prototype.applyPagination = function () { + var maxSize = (this.maxSize != undefined) ? Math.min(this.maxSize, this.pageCount) : this.pageCount; + var page = Math.ceil(this.page / maxSize) - 1; + var start = 0; + var end = this.pageCount; + if (this.canRotate) { + var leftOffset = Math.floor(maxSize / 2); + var rightOffset = maxSize % 2 === 0 ? leftOffset - 1 : leftOffset; + if (this.page <= leftOffset) { + end = maxSize; + } + else if (this.pageCount - this.page < leftOffset) { + start = this.pageCount - maxSize; + } + else { + start = this.page - leftOffset - 1; + end = this.page + rightOffset; + } + } + else { + start = page * maxSize; + end = start + maxSize; + } + return [start, Math.min(end, this.pageCount)]; + }; + SuiPagination.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-pagination", + template: "\n\n \n\n\n \n\n\n \n 1\n \n 2\">...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n", + styles: ["\n:host .item {\n transition: none;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiPagination.ctorParameters = function () { return []; }; + SuiPagination.propDecorators = { + "_paginationClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.pagination",] }, { type: _angular_core.HostBinding, args: ["class.menu",] },], + "pageChange": [{ type: _angular_core.Output },], + "maxSize": [{ type: _angular_core.Input },], + "pageSize": [{ type: _angular_core.Input },], + "collectionSize": [{ type: _angular_core.Input },], + "hasNavigationLinks": [{ type: _angular_core.Input },], + "hasBoundaryLinks": [{ type: _angular_core.Input },], + "canRotate": [{ type: _angular_core.Input },], + "hasEllipses": [{ type: _angular_core.Input },], + "page": [{ type: _angular_core.Input },], + }; + return SuiPagination; +}()); + +var SuiPaginationModule = /** @class */ (function () { + function SuiPaginationModule() { + } + SuiPaginationModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [_angular_common.CommonModule], + exports: [SuiPagination], + declarations: [SuiPagination], + providers: [] + },] }, + ]; + /** @nocollapse */ + SuiPaginationModule.ctorParameters = function () { return []; }; + return SuiPaginationModule; +}()); + +var SuiAccordionPanel = /** @class */ (function () { + function SuiAccordionPanel(_changeDetector) { + this._changeDetector = _changeDetector; + this.transitionController = new TransitionController(false); + this._isOpen = false; + this.isOpenChange = new _angular_core.EventEmitter(false); + } + Object.defineProperty(SuiAccordionPanel.prototype, "service", { + set: function (service) { + this._service = service; + this._changeDetector.detectChanges(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiAccordionPanel.prototype, "isOpen", { + get: function () { + return this._isOpen; + }, + set: function (value) { + // Convert to boolean (fixes false != undefined) + var isOpen = !!value; + if (isOpen !== this.isOpen) { + // Only update if the value has changed. + this._isOpen = isOpen; + if (isOpen && this._service) { + // If we are opening this panel, we must close the other ones. + this._service.closeOtherPanels(this); + } + this.isOpenChange.emit(this.isOpen); + // Cancel all current animations, and fade the contents. The direction is automatic. + this.transitionController.stopAll(); + this.transitionController.animate(new Transition(this.transition, this.transitionDuration)); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiAccordionPanel.prototype, "transition", { + get: function () { + if (this._service) { + return this._service.transition; + } + return "fade"; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiAccordionPanel.prototype, "transitionDuration", { + get: function () { + if (this._service) { + // Return the service defined transition duration. + return this._service.transitionDuration; + } + // Revert to instantaneous if the service is not yet loaded. + return 0; + }, + enumerable: true, + configurable: true + }); + SuiAccordionPanel.prototype.toggle = function () { + if (!this.isDisabled) { + this.isOpen = !this.isOpen; + } + }; + SuiAccordionPanel.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-accordion-panel", + exportAs: "suiAccordionPanel", + template: "\n\n
\n \n
\n\n
\n
\n \n
\n
\n", + styles: ["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiAccordionPanel.ctorParameters = function () { return [ + { type: _angular_core.ChangeDetectorRef, }, + ]; }; + SuiAccordionPanel.propDecorators = { + "isDisabled": [{ type: _angular_core.Input },], + "isOpen": [{ type: _angular_core.Input },], + "isOpenChange": [{ type: _angular_core.Output },], + }; + return SuiAccordionPanel; +}()); + +var SuiAccordionService = /** @class */ (function () { + function SuiAccordionService() { + this.closeOthers = true; + this.transition = "fade"; + this.transitionDuration = 350; + this.panels = []; + } + SuiAccordionService.prototype.addPanel = function (panel) { + panel.service = this; + this.panels.push(panel); + }; + SuiAccordionService.prototype.closeOtherPanels = function (panel) { + if (!this.closeOthers) { + return; + } + this.panels.forEach(function (p) { + if (p !== panel) { + p.isOpen = false; + } + }); + }; + return SuiAccordionService; +}()); + +var SuiAccordion = /** @class */ (function () { + function SuiAccordion() { + // Accordion service is unique to each set of panels. + this._service = new SuiAccordionService(); + this.accordionClasses = true; + } + Object.defineProperty(SuiAccordion.prototype, "closeOthers", { + get: function () { + return this._service.closeOthers; + }, + set: function (value) { + this._service.closeOthers = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiAccordion.prototype, "transition", { + set: function (transition) { + this._service.transition = transition; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiAccordion.prototype, "transitionDuration", { + set: function (duration) { + this._service.transitionDuration = duration; + }, + enumerable: true, + configurable: true + }); + SuiAccordion.prototype.ngAfterContentInit = function () { + var _this = this; + this.updatePanels(); + // Reconnect panels after they have updated. + this._panels.changes.subscribe(function () { return _this.updatePanels(); }); + }; + SuiAccordion.prototype.updatePanels = function () { + var _this = this; + this._panels.forEach(function (p) { return _this._service.addPanel(p); }); + }; + SuiAccordion.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-accordion", + template: "\n\n", + styles: ["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiAccordion.ctorParameters = function () { return []; }; + SuiAccordion.propDecorators = { + "accordionClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.accordion",] },], + "closeOthers": [{ type: _angular_core.Input },], + "transition": [{ type: _angular_core.Input },], + "transitionDuration": [{ type: _angular_core.Input },], + "_panels": [{ type: _angular_core.ContentChildren, args: [SuiAccordionPanel,] },], + }; + return SuiAccordion; +}()); + +var SuiCollapse = /** @class */ (function () { + function SuiCollapse(_element, _renderer) { + this._element = _element; + this._renderer = _renderer; + this._pristine = true; + // Collapse animation duration is 350ms by default. + this.collapseDuration = 350; + this._isExpanded = false; + this._isCollapsing = false; + } + Object.defineProperty(SuiCollapse.prototype, "_isCollapsed", { + get: + // Set when the collapse is closed, and not animating. + function () { + return !this._isExpanded && !this._isCollapsing; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCollapse.prototype, "suiCollapse", { + get: function () { + return this._isExpanded; + }, + // Sets the state of the collapse, `true` is collapsed. + set: + // Sets the state of the collapse, `true` is collapsed. + function (value) { + if (value) { + this.hide(); + } + else { + this.show(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCollapse.prototype, "_animationDuration", { + get: function () { + return this._pristine ? 0 : this.collapseDuration; + }, + enumerable: true, + configurable: true + }); + SuiCollapse.prototype.hide = function () { + var _this = this; + this._isCollapsing = true; + this._isExpanded = false; + // Forcibly hide the overflow so that content is not visible past the boundaries of its container. + this._renderer.setStyle(this._element.nativeElement, "overflow", "hidden"); + // Animate the host element from its scroll height to 0. + this.animate(this._element.nativeElement.scrollHeight, 0, false, function () { + _this._isCollapsing = false; + }); + }; + SuiCollapse.prototype.show = function () { + var _this = this; + this._isCollapsing = true; + // Animate the host element from its offset height to its scroll height. + this.animate(this._element.nativeElement.offsetHeight, this._element.nativeElement.scrollHeight, true, function () { + // Remove the overflow override to enable user styling once again. + // Remove the overflow override to enable user styling once again. + _this._renderer.removeStyle(_this._element.nativeElement, "overflow"); + _this._isCollapsing = false; + _this._isExpanded = true; + }); + }; + SuiCollapse.prototype.animate = function (startHeight, endHeight, removeOnComplete, callback) { + if (removeOnComplete === void 0) { removeOnComplete = false; } + if (callback === void 0) { callback = function () { }; } + var heightFrames = [ + { + offset: 0, + height: startHeight + "px" + }, + { + offset: 1, + height: endHeight + "px" + } + ]; + if (removeOnComplete) { + heightFrames.push({ + offset: 1, + height: "auto" + }); + } + // Animate the collapse using the web animations API. + // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. + this._element.nativeElement.animate(heightFrames, { + delay: 0, + // Disable animation on 1st collapse / expansion. + duration: this._animationDuration, + iterations: 1, + easing: "ease", + fill: "both" + }); + if (this._pristine) { + // Remove pristine flag when first hit. + this._pristine = false; + } + setTimeout(function () { return callback(); }, this.collapseDuration); + }; + SuiCollapse.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "[suiCollapse]" + },] }, + ]; + /** @nocollapse */ + SuiCollapse.ctorParameters = function () { return [ + { type: _angular_core.ElementRef, }, + { type: _angular_core.Renderer2, }, + ]; }; + SuiCollapse.propDecorators = { + "_isExpanded": [{ type: _angular_core.HostBinding, args: ["class.expanded",] },], + "_isCollapsed": [{ type: _angular_core.HostBinding, args: ["class.collapsed",] },], + "_isCollapsing": [{ type: _angular_core.HostBinding, args: ["class.collapsing",] },], + "suiCollapse": [{ type: _angular_core.Input },], + "collapseDuration": [{ type: _angular_core.Input },], + }; + return SuiCollapse; +}()); + +var SuiCollapseModule = /** @class */ (function () { + function SuiCollapseModule() { + } + SuiCollapseModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule + ], + declarations: [ + SuiCollapse + ], + exports: [ + SuiCollapse + ] + },] }, + ]; + /** @nocollapse */ + SuiCollapseModule.ctorParameters = function () { return []; }; + return SuiCollapseModule; +}()); + +var SuiAccordionModule = /** @class */ (function () { + function SuiAccordionModule() { + } + SuiAccordionModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule, + SuiCollapseModule, + SuiTransitionModule + ], + declarations: [ + SuiAccordion, + SuiAccordionPanel + ], + exports: [ + SuiAccordion, + SuiAccordionPanel + ], + providers: [] + },] }, + ]; + /** @nocollapse */ + SuiAccordionModule.ctorParameters = function () { return []; }; + return SuiAccordionModule; +}()); + +var CustomValidator = /** @class */ (function () { + function CustomValidator(_host) { + this._host = _host; + this.onValidatorChange = function () { }; + } + CustomValidator.prototype.validate = function (c) { + return this._host.validate(c); + }; + CustomValidator.prototype.registerOnValidatorChange = function (fn) { + this.onValidatorChange = fn; + }; + return CustomValidator; +}()); +function customValidatorFactory(type) { + return { + provide: _angular_forms.NG_VALIDATORS, + useExisting: _angular_core.forwardRef(function () { return type; }), + multi: true + }; +} + +var CustomValueAccessor = /** @class */ (function () { + function CustomValueAccessor(_host) { + this._host = _host; + this.onChange = function () { }; + this.onTouched = function () { }; + } + CustomValueAccessor.prototype.writeValue = function (value) { + this._host.writeValue(value); + }; + CustomValueAccessor.prototype.registerOnChange = function (fn) { + this.onChange = fn; + }; + CustomValueAccessor.prototype.registerOnTouched = function (fn) { + this.onTouched = fn; + }; + return CustomValueAccessor; +}()); +function customValueAccessorFactory(type) { + return { + provide: _angular_forms.NG_VALUE_ACCESSOR, + useExisting: _angular_core.forwardRef(function () { return type; }), + multi: true + }; +} + +// Keyboard keycodes. +// Keyboard keycodes. + +// Keyboard keycodes. +(function (KeyCode) { + KeyCode[KeyCode["Left"] = 37] = "Left"; + KeyCode[KeyCode["Up"] = 38] = "Up"; + KeyCode[KeyCode["Right"] = 39] = "Right"; + KeyCode[KeyCode["Down"] = 40] = "Down"; + KeyCode[KeyCode["Escape"] = 27] = "Escape"; + KeyCode[KeyCode["Enter"] = 13] = "Enter"; + KeyCode[KeyCode["Space"] = 32] = "Space"; + KeyCode[KeyCode["Backspace"] = 8] = "Backspace"; +})(exports.KeyCode || (exports.KeyCode = {})); +var HandledEvent = /** @class */ (function () { + function HandledEvent() { + } + return HandledEvent; +}()); +var Util = { + Array: { + range: function (n, offset) { + if (offset === void 0) { offset = 0; } + return Array(n).fill(0).map(function (z, i) { return i + offset; }); + }, + group: function (items, groupLength) { + var mutable = items.slice(0); + var groups = []; + while (mutable.length > 0) { + groups.push(mutable.splice(0, groupLength)); + } + return groups; + }, + groupBy: function (items, field) { + return items.reduce(function (groups, i) { + var fieldValue = i[field].toString(); + groups[fieldValue] = groups[fieldValue] || []; + groups[fieldValue].push(i); + return groups; + }, Object()); + }, + flatten: function (items) { + return items.reduce(function (is, i) { return is.concat(i); }, []); + } + }, + String: { + padLeft: function (str, length, padding) { + var s = str; + while (s.length < length) { + s = padding + s; + } + return s; + } + }, + DOM: { + parseBooleanAttribute: function (attributeValue) { + var value = attributeValue; + if (typeof attributeValue === "string") { + value = true; + } + return value; + } + }, + Object: { + readValue: function (object, path) { + if (!path) { + return object; + } + var recursed; + for (var i = 0, p = path.split("."), len = p.length; i < len; i++) { + recursed = object[p[i]]; + } + return recursed; + } + }, + Math: { + round: function (r, n) { + return Math.round(r / n) * n; + }, + roundUp: function (r, n) { + return Math.ceil(r / n) * n; + }, + roundDown: function (r, n) { + return Math.floor(r / n) * n; + }, + mod: function (r, n) { + var rem = r % n; + if (rem < 0) { + return rem + n; + } + return rem; + } + } +}; + +(function (DatePrecision) { + DatePrecision[DatePrecision["Decade"] = 0] = "Decade"; + DatePrecision[DatePrecision["Year"] = 1] = "Year"; + DatePrecision[DatePrecision["Month"] = 2] = "Month"; + DatePrecision[DatePrecision["Date"] = 3] = "Date"; + DatePrecision[DatePrecision["Hour"] = 4] = "Hour"; + DatePrecision[DatePrecision["Minute"] = 5] = "Minute"; +})(exports.DatePrecision || (exports.DatePrecision = {})); +var DateUtil = { + startOf: function (precision, date, resetAll) { + if (resetAll === void 0) { resetAll = false; } + switch (precision) { + case exports.DatePrecision.Decade: + var start = Math.floor(date.getFullYear() / 10) * 10 + 1; + date.setFullYear(start); + if (!resetAll) { + break; + } + // falls through + case exports.DatePrecision.Year: + date.setMonth(0); + if (!resetAll) { + break; + } + // falls through + case exports.DatePrecision.Month: + date.setDate(1); + if (!resetAll) { + break; + } + // falls through + case exports.DatePrecision.Date: + date.setHours(0); + if (!resetAll) { + break; + } + // falls through + case exports.DatePrecision.Hour: + date.setMinutes(0); + if (!resetAll) { + break; + } + // falls through + case exports.DatePrecision.Minute: + date.setSeconds(0, 0); + } + return date; + }, + endOf: function (precision, date) { + switch (precision) { + case exports.DatePrecision.Year: + date.setMonth(12, 0); + // falls through + case exports.DatePrecision.Month: + date.setMonth(date.getMonth() + 1, 0); + // falls through + case exports.DatePrecision.Date: + date.setHours(23, 59, 59, 999); + break; + case exports.DatePrecision.Hour: + date.setMinutes(59, 59, 999); + break; + case exports.DatePrecision.Minute: + date.setSeconds(59, 999); + break; + } + return date; + }, + equal: function (precision, a, b) { + var equal = true; + switch (precision) { + case exports.DatePrecision.Minute: + equal = equal && a.getMinutes() === b.getMinutes(); + // falls through + case exports.DatePrecision.Hour: + equal = equal && a.getHours() === b.getHours(); + // falls through + case exports.DatePrecision.Date: + equal = equal && a.getDate() === b.getDate(); + // falls through + case exports.DatePrecision.Month: + equal = equal && a.getMonth() === b.getMonth(); + // falls through + case exports.DatePrecision.Year: + equal = equal && a.getFullYear() === b.getFullYear(); + } + return equal; + }, + next: function (precision, date) { + return DateUtil.add(precision, date, 1); + }, + add: function (precision, date, i) { + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + switch (precision) { + case exports.DatePrecision.Decade: + date.setFullYear(year + i * 10); + if (date.getMonth() !== month) { + date.setDate(0); + } + break; + case exports.DatePrecision.Year: + date.setFullYear(year + i); + if (date.getMonth() !== month) { + date.setDate(0); + } + break; + case exports.DatePrecision.Month: + date.setMonth(month + i); + if (date.getMonth() !== Util.Math.mod(month + i, 12)) { + date.setDate(0); + } + break; + case exports.DatePrecision.Date: + date.setDate(day + i); + break; + case exports.DatePrecision.Hour: + date.setHours(date.getHours() + i); + break; + case exports.DatePrecision.Minute: + date.setMinutes(date.getMinutes() + i); + break; + } + return date; + }, + previous: function (precision, date) { + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + switch (precision) { + case exports.DatePrecision.Decade: + date.setFullYear(year - 10); + if (date.getMonth() !== month) { + date.setDate(0); + } + break; + case exports.DatePrecision.Year: + date.setFullYear(year - 1); + if (date.getMonth() !== month) { + date.setDate(0); + } + break; + case exports.DatePrecision.Month: + date.setMonth(month - 1); + if (date.getMonth() !== Util.Math.mod(month - 1, 12)) { + date.setDate(0); + } + break; + case exports.DatePrecision.Date: + date.setDate(day - 1); + break; + case exports.DatePrecision.Hour: + var hours = date.getHours(); + date.setHours(hours - 1); + if (date.getHours() !== Util.Math.mod(hours - 1, 24)) { + date.setHours(hours - 2); + } + break; + case exports.DatePrecision.Minute: + var minutes = date.getMinutes(); + date.setMinutes(minutes - 1); + } + return date; + }, + clone: function (date) { + return new Date(date.getTime()); + } +}; + +var SuiComponentFactory = /** @class */ (function () { + function SuiComponentFactory(_applicationRef, _componentFactoryResolver, _injector) { + this._applicationRef = _applicationRef; + this._componentFactoryResolver = _componentFactoryResolver; + this._injector = _injector; + } + SuiComponentFactory.prototype.createComponent = function (type, providers) { + if (providers === void 0) { providers = []; } + // Resolve a factory for creating components of type `type`. + var factory = this._componentFactoryResolver.resolveComponentFactory(type); + // Resolve and create an injector with the specified providers. + var injector = _angular_core.ReflectiveInjector.resolveAndCreate(providers, this._injector); + // Create a component using the previously resolved factory & injector. + var componentRef = factory.create(injector); + return componentRef; + }; + SuiComponentFactory.prototype.createView = function (viewContainer, template, context) { + viewContainer.createEmbeddedView(template, context); + }; + // Inserts the component into the specified view container. + // Inserts the component into the specified view container. + SuiComponentFactory.prototype.attachToView = + // Inserts the component into the specified view container. + function (componentRef, viewContainer) { + viewContainer.insert(componentRef.hostView, 0); + }; + // Inserts the component in the root application node. + // Inserts the component in the root application node. + SuiComponentFactory.prototype.attachToApplication = + // Inserts the component in the root application node. + function (componentRef) { + this._applicationRef.attachView(componentRef.hostView); + }; + // Detaches the component from the root application node. + // Detaches the component from the root application node. + SuiComponentFactory.prototype.detachFromApplication = + // Detaches the component from the root application node. + function (componentRef) { + this._applicationRef.detachView(componentRef.hostView); + }; + // Moves the component to the specified DOM element. + // Moves the component to the specified DOM element. + SuiComponentFactory.prototype.moveToElement = + // Moves the component to the specified DOM element. + function (componentRef, element) { + element.appendChild(componentRef.location.nativeElement); + }; + // Moves the component to the document body. + // Moves the component to the document body. + SuiComponentFactory.prototype.moveToDocumentBody = + // Moves the component to the document body. + function (componentRef) { + this.moveToElement(componentRef, (document.querySelector("body"))); + }; + SuiComponentFactory.prototype.detachFromDocument = function (componentRef) { + var element = componentRef.location.nativeElement; + // We can't use `element.remove()` due to lack of IE11 support. + if (element.parentNode) { + element.parentNode.removeChild(element); + } + }; + SuiComponentFactory.decorators = [ + { type: _angular_core.Injectable }, + ]; + /** @nocollapse */ + SuiComponentFactory.ctorParameters = function () { return [ + { type: _angular_core.ApplicationRef, }, + { type: _angular_core.ComponentFactoryResolver, }, + { type: _angular_core.Injector, }, + ]; }; + return SuiComponentFactory; +}()); + +/**! + * @fileOverview Kickass library to create and place poppers near their reference elements. + * @version 1.14.1 + * @license + * Copyright (c) 2016 Federico Zivolo and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; +var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; +var timeoutDuration = 0; +for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { + if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { + timeoutDuration = 1; + break; + } +} + +function microtaskDebounce(fn) { + var called = false; + return function () { + if (called) { + return; + } + called = true; + window.Promise.resolve().then(function () { + called = false; + fn(); + }); + }; +} + +function taskDebounce(fn) { + var scheduled = false; + return function () { + if (!scheduled) { + scheduled = true; + setTimeout(function () { + scheduled = false; + fn(); + }, timeoutDuration); + } + }; +} + +var supportsMicroTasks = isBrowser && window.Promise; + +/** +* Create a debounced version of a method, that's asynchronously deferred +* but called in the minimum time possible. +* +* @method +* @memberof Popper.Utils +* @argument {Function} fn +* @returns {Function} +*/ +var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; + +/** + * Check if the given variable is a function + * @method + * @memberof Popper.Utils + * @argument {Any} functionToCheck - variable to check + * @returns {Boolean} answer to: is a function? + */ +function isFunction(functionToCheck) { + var getType = {}; + return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; +} + +/** + * Get CSS computed property of the given element + * @method + * @memberof Popper.Utils + * @argument {Eement} element + * @argument {String} property + */ +function getStyleComputedProperty(element, property) { + if (element.nodeType !== 1) { + return []; + } + // NOTE: 1 DOM access here + var css = getComputedStyle(element, null); + return property ? css[property] : css; +} + +/** + * Returns the parentNode or the host of the element + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} parent + */ +function getParentNode(element) { + if (element.nodeName === 'HTML') { + return element; + } + return element.parentNode || element.host; +} + +/** + * Returns the scrolling parent of the given element + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} scroll parent + */ +function getScrollParent(element) { + // Return body, `getScroll` will take care to get the correct `scrollTop` from it + if (!element) { + return document.body; + } + + switch (element.nodeName) { + case 'HTML': + case 'BODY': + return element.ownerDocument.body; + case '#document': + return element.body; + } + + // Firefox want us to check `-x` and `-y` variations as well + + var _getStyleComputedProp = getStyleComputedProperty(element), + overflow = _getStyleComputedProp.overflow, + overflowX = _getStyleComputedProp.overflowX, + overflowY = _getStyleComputedProp.overflowY; + + if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { + return element; + } + + return getScrollParent(getParentNode(element)); +} + +/** + * Tells if you are running Internet Explorer + * @method + * @memberof Popper.Utils + * @argument {number} version to check + * @returns {Boolean} isIE + */ +var cache = {}; + +var isIE = function () { + var version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all'; + + version = version.toString(); + if (cache.hasOwnProperty(version)) { + return cache[version]; + } + switch (version) { + case '11': + cache[version] = navigator.userAgent.indexOf('Trident') !== -1; + break; + case '10': + cache[version] = navigator.appVersion.indexOf('MSIE 10') !== -1; + break; + case 'all': + cache[version] = navigator.userAgent.indexOf('Trident') !== -1 || navigator.userAgent.indexOf('MSIE') !== -1; + break; + } + + //Set IE + cache.all = cache.all || Object.keys(cache).some(function (key) { + return cache[key]; + }); + return cache[version]; +}; + +/** + * Returns the offset parent of the given element + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} offset parent + */ +function getOffsetParent(element) { + if (!element) { + return document.documentElement; + } + + var noOffsetParent = isIE(10) ? document.body : null; + + // NOTE: 1 DOM access here + var offsetParent = element.offsetParent; + // Skip hidden elements which don't have an offsetParent + while (offsetParent === noOffsetParent && element.nextElementSibling) { + offsetParent = (element = element.nextElementSibling).offsetParent; + } + + var nodeName = offsetParent && offsetParent.nodeName; + + if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { + return element ? element.ownerDocument.documentElement : document.documentElement; + } + + // .offsetParent will return the closest TD or TABLE in case + // no offsetParent is present, I hate this job... + if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { + return getOffsetParent(offsetParent); + } + + return offsetParent; +} + +function isOffsetContainer(element) { + var nodeName = element.nodeName; + + if (nodeName === 'BODY') { + return false; + } + return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; +} + +/** + * Finds the root node (document, shadowDOM root) of the given element + * @method + * @memberof Popper.Utils + * @argument {Element} node + * @returns {Element} root node + */ +function getRoot(node) { + if (node.parentNode !== null) { + return getRoot(node.parentNode); + } + + return node; +} + +/** + * Finds the offset parent common to the two provided nodes + * @method + * @memberof Popper.Utils + * @argument {Element} element1 + * @argument {Element} element2 + * @returns {Element} common offset parent + */ +function findCommonOffsetParent(element1, element2) { + // This check is needed to avoid errors in case one of the elements isn't defined for any reason + if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { + return document.documentElement; + } + + // Here we make sure to give as "start" the element that comes first in the DOM + var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; + var start = order ? element1 : element2; + var end = order ? element2 : element1; + + // Get common ancestor container + var range = document.createRange(); + range.setStart(start, 0); + range.setEnd(end, 0); + var commonAncestorContainer = range.commonAncestorContainer; + + // Both nodes are inside #document + + if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { + if (isOffsetContainer(commonAncestorContainer)) { + return commonAncestorContainer; + } + + return getOffsetParent(commonAncestorContainer); + } + + // one of the nodes is inside shadowDOM, find which one + var element1root = getRoot(element1); + if (element1root.host) { + return findCommonOffsetParent(element1root.host, element2); + } else { + return findCommonOffsetParent(element1, getRoot(element2).host); + } +} + +/** + * Gets the scroll value of the given element in the given side (top and left) + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @argument {String} side `top` or `left` + * @returns {number} amount of scrolled pixels + */ +function getScroll(element) { + var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; + + var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; + var nodeName = element.nodeName; + + if (nodeName === 'BODY' || nodeName === 'HTML') { + var html = element.ownerDocument.documentElement; + var scrollingElement = element.ownerDocument.scrollingElement || html; + return scrollingElement[upperSide]; + } + + return element[upperSide]; +} + +/* + * Sum or subtract the element scroll values (left and top) from a given rect object + * @method + * @memberof Popper.Utils + * @param {Object} rect - Rect object you want to change + * @param {HTMLElement} element - The element from the function reads the scroll values + * @param {Boolean} subtract - set to true if you want to subtract the scroll values + * @return {Object} rect - The modifier rect object + */ +function includeScroll(rect, element) { + var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var scrollTop = getScroll(element, 'top'); + var scrollLeft = getScroll(element, 'left'); + var modifier = subtract ? -1 : 1; + rect.top += scrollTop * modifier; + rect.bottom += scrollTop * modifier; + rect.left += scrollLeft * modifier; + rect.right += scrollLeft * modifier; + return rect; +} + +/* + * Helper to detect borders of a given element + * @method + * @memberof Popper.Utils + * @param {CSSStyleDeclaration} styles + * Result of `getStyleComputedProperty` on the given element + * @param {String} axis - `x` or `y` + * @return {number} borders - The borders size of the given axis + */ + +function getBordersSize(styles, axis) { + var sideA = axis === 'x' ? 'Left' : 'Top'; + var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; + + return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); +} + +function getSize(axis, body, html, computedStyle) { + return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0); +} + +function getWindowSizes() { + var body = document.body; + var html = document.documentElement; + var computedStyle = isIE(10) && getComputedStyle(html); + + return { + height: getSize('Height', body, html, computedStyle), + width: getSize('Width', body, html, computedStyle) + }; +} + +var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + + + + + +var defineProperty = function (obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +}; + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; + +/** + * Given element offsets, generate an output similar to getBoundingClientRect + * @method + * @memberof Popper.Utils + * @argument {Object} offsets + * @returns {Object} ClientRect like output + */ +function getClientRect(offsets) { + return _extends({}, offsets, { + right: offsets.left + offsets.width, + bottom: offsets.top + offsets.height + }); +} + +/** + * Get bounding client rect of given element + * @method + * @memberof Popper.Utils + * @param {HTMLElement} element + * @return {Object} client rect + */ +function getBoundingClientRect(element) { + var rect = {}; + + // IE10 10 FIX: Please, don't ask, the element isn't + // considered in DOM in some circumstances... + // This isn't reproducible in IE10 compatibility mode of IE11 + try { + if (isIE(10)) { + rect = element.getBoundingClientRect(); + var scrollTop = getScroll(element, 'top'); + var scrollLeft = getScroll(element, 'left'); + rect.top += scrollTop; + rect.left += scrollLeft; + rect.bottom += scrollTop; + rect.right += scrollLeft; + } else { + rect = element.getBoundingClientRect(); + } + } catch (e) {} + + var result = { + left: rect.left, + top: rect.top, + width: rect.right - rect.left, + height: rect.bottom - rect.top + }; + + // subtract scrollbar size from sizes + var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {}; + var width = sizes.width || element.clientWidth || result.right - result.left; + var height = sizes.height || element.clientHeight || result.bottom - result.top; + + var horizScrollbar = element.offsetWidth - width; + var vertScrollbar = element.offsetHeight - height; + + // if an hypothetical scrollbar is detected, we must be sure it's not a `border` + // we make this check conditional for performance reasons + if (horizScrollbar || vertScrollbar) { + var styles = getStyleComputedProperty(element); + horizScrollbar -= getBordersSize(styles, 'x'); + vertScrollbar -= getBordersSize(styles, 'y'); + + result.width -= horizScrollbar; + result.height -= vertScrollbar; + } + + return getClientRect(result); +} + +function getOffsetRectRelativeToArbitraryNode(children, parent) { + var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var isIE10 = isIE(10); + var isHTML = parent.nodeName === 'HTML'; + var childrenRect = getBoundingClientRect(children); + var parentRect = getBoundingClientRect(parent); + var scrollParent = getScrollParent(children); + + var styles = getStyleComputedProperty(parent); + var borderTopWidth = parseFloat(styles.borderTopWidth, 10); + var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); + + // In cases where the parent is fixed, we must ignore negative scroll in offset calc + if (fixedPosition && parent.nodeName === 'HTML') { + parentRect.top = Math.max(parentRect.top, 0); + parentRect.left = Math.max(parentRect.left, 0); + } + var offsets = getClientRect({ + top: childrenRect.top - parentRect.top - borderTopWidth, + left: childrenRect.left - parentRect.left - borderLeftWidth, + width: childrenRect.width, + height: childrenRect.height + }); + offsets.marginTop = 0; + offsets.marginLeft = 0; + + // Subtract margins of documentElement in case it's being used as parent + // we do this only on HTML because it's the only element that behaves + // differently when margins are applied to it. The margins are included in + // the box of the documentElement, in the other cases not. + if (!isIE10 && isHTML) { + var marginTop = parseFloat(styles.marginTop, 10); + var marginLeft = parseFloat(styles.marginLeft, 10); + + offsets.top -= borderTopWidth - marginTop; + offsets.bottom -= borderTopWidth - marginTop; + offsets.left -= borderLeftWidth - marginLeft; + offsets.right -= borderLeftWidth - marginLeft; + + // Attach marginTop and marginLeft because in some circumstances we may need them + offsets.marginTop = marginTop; + offsets.marginLeft = marginLeft; + } + + if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { + offsets = includeScroll(offsets, parent); + } + + return offsets; +} + +function getViewportOffsetRectRelativeToArtbitraryNode(element) { + var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var html = element.ownerDocument.documentElement; + var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); + var width = Math.max(html.clientWidth, window.innerWidth || 0); + var height = Math.max(html.clientHeight, window.innerHeight || 0); + + var scrollTop = !excludeScroll ? getScroll(html) : 0; + var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; + + var offset = { + top: scrollTop - relativeOffset.top + relativeOffset.marginTop, + left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, + width: width, + height: height + }; + + return getClientRect(offset); +} + +/** + * Check if the given element is fixed or is inside a fixed parent + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @argument {Element} customContainer + * @returns {Boolean} answer to "isFixed?" + */ +function isFixed(element) { + var nodeName = element.nodeName; + if (nodeName === 'BODY' || nodeName === 'HTML') { + return false; + } + if (getStyleComputedProperty(element, 'position') === 'fixed') { + return true; + } + return isFixed(getParentNode(element)); +} + +/** + * Finds the first parent of an element that has a transformed property defined + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} first transformed parent or documentElement + */ + +function getFixedPositionOffsetParent(element) { + // This check is needed to avoid errors in case one of the elements isn't defined for any reason + if (!element || !element.parentElement || isIE()) { + return document.documentElement; + } + var el = element.parentElement; + while (el && getStyleComputedProperty(el, 'transform') === 'none') { + el = el.parentElement; + } + return el || document.documentElement; +} + +/** + * Computed the boundaries limits and return them + * @method + * @memberof Popper.Utils + * @param {HTMLElement} popper + * @param {HTMLElement} reference + * @param {number} padding + * @param {HTMLElement} boundariesElement - Element used to define the boundaries + * @param {Boolean} fixedPosition - Is in fixed position mode + * @returns {Object} Coordinates of the boundaries + */ +function getBoundaries(popper, reference, padding, boundariesElement) { + var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + // NOTE: 1 DOM access here + + var boundaries = { top: 0, left: 0 }; + var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); + + // Handle viewport case + if (boundariesElement === 'viewport') { + boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); + } else { + // Handle other cases based on DOM element used as boundaries + var boundariesNode = void 0; + if (boundariesElement === 'scrollParent') { + boundariesNode = getScrollParent(getParentNode(reference)); + if (boundariesNode.nodeName === 'BODY') { + boundariesNode = popper.ownerDocument.documentElement; + } + } else if (boundariesElement === 'window') { + boundariesNode = popper.ownerDocument.documentElement; + } else { + boundariesNode = boundariesElement; + } + + var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); + + // In case of HTML, we need a different computation + if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { + var _getWindowSizes = getWindowSizes(), + height = _getWindowSizes.height, + width = _getWindowSizes.width; + + boundaries.top += offsets.top - offsets.marginTop; + boundaries.bottom = height + offsets.top; + boundaries.left += offsets.left - offsets.marginLeft; + boundaries.right = width + offsets.left; + } else { + // for all the other DOM elements, this one is good + boundaries = offsets; + } + } + + // Add paddings + boundaries.left += padding; + boundaries.top += padding; + boundaries.right -= padding; + boundaries.bottom -= padding; + + return boundaries; +} + +function getArea(_ref) { + var width = _ref.width, + height = _ref.height; + + return width * height; +} + +/** + * Utility used to transform the `auto` placement to the placement with more + * available space. + * @method + * @memberof Popper.Utils + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { + var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; + + if (placement.indexOf('auto') === -1) { + return placement; + } + + var boundaries = getBoundaries(popper, reference, padding, boundariesElement); + + var rects = { + top: { + width: boundaries.width, + height: refRect.top - boundaries.top + }, + right: { + width: boundaries.right - refRect.right, + height: boundaries.height + }, + bottom: { + width: boundaries.width, + height: boundaries.bottom - refRect.bottom + }, + left: { + width: refRect.left - boundaries.left, + height: boundaries.height + } + }; + + var sortedAreas = Object.keys(rects).map(function (key) { + return _extends({ + key: key + }, rects[key], { + area: getArea(rects[key]) + }); + }).sort(function (a, b) { + return b.area - a.area; + }); + + var filteredAreas = sortedAreas.filter(function (_ref2) { + var width = _ref2.width, + height = _ref2.height; + return width >= popper.clientWidth && height >= popper.clientHeight; + }); + + var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; + + var variation = placement.split('-')[1]; + + return computedPlacement + (variation ? '-' + variation : ''); +} + +/** + * Get offsets to the reference element + * @method + * @memberof Popper.Utils + * @param {Object} state + * @param {Element} popper - the popper element + * @param {Element} reference - the reference element (the popper will be relative to this) + * @param {Element} fixedPosition - is in fixed position mode + * @returns {Object} An object containing the offsets which will be applied to the popper + */ +function getReferenceOffsets(state, popper, reference) { + var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + + var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); + return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); +} + +/** + * Get the outer sizes of the given element (offset size + margins) + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Object} object containing width and height properties + */ +function getOuterSizes(element) { + var styles = getComputedStyle(element); + var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom); + var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight); + var result = { + width: element.offsetWidth + y, + height: element.offsetHeight + x + }; + return result; +} + +/** + * Get the opposite placement of the given one + * @method + * @memberof Popper.Utils + * @argument {String} placement + * @returns {String} flipped placement + */ +function getOppositePlacement(placement) { + var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; + return placement.replace(/left|right|bottom|top/g, function (matched) { + return hash[matched]; + }); +} + +/** + * Get offsets to the popper + * @method + * @memberof Popper.Utils + * @param {Object} position - CSS position the Popper will get applied + * @param {HTMLElement} popper - the popper element + * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) + * @param {String} placement - one of the valid placement options + * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper + */ +function getPopperOffsets(popper, referenceOffsets, placement) { + placement = placement.split('-')[0]; + + // Get popper node sizes + var popperRect = getOuterSizes(popper); + + // Add position, width and height to our offsets object + var popperOffsets = { + width: popperRect.width, + height: popperRect.height + }; + + // depending by the popper placement we have to compute its offsets slightly differently + var isHoriz = ['right', 'left'].indexOf(placement) !== -1; + var mainSide = isHoriz ? 'top' : 'left'; + var secondarySide = isHoriz ? 'left' : 'top'; + var measurement = isHoriz ? 'height' : 'width'; + var secondaryMeasurement = !isHoriz ? 'height' : 'width'; + + popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; + if (placement === secondarySide) { + popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; + } else { + popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; + } + + return popperOffsets; +} + +/** + * Mimics the `find` method of Array + * @method + * @memberof Popper.Utils + * @argument {Array} arr + * @argument prop + * @argument value + * @returns index or -1 + */ +function find(arr, check) { + // use native find if supported + if (Array.prototype.find) { + return arr.find(check); + } + + // use `filter` to obtain the same behavior of `find` + return arr.filter(check)[0]; +} + +/** + * Return the index of the matching object + * @method + * @memberof Popper.Utils + * @argument {Array} arr + * @argument prop + * @argument value + * @returns index or -1 + */ +function findIndex(arr, prop, value) { + // use native findIndex if supported + if (Array.prototype.findIndex) { + return arr.findIndex(function (cur) { + return cur[prop] === value; + }); + } + + // use `find` + `indexOf` if `findIndex` isn't supported + var match = find(arr, function (obj) { + return obj[prop] === value; + }); + return arr.indexOf(match); +} + +/** + * Loop trough the list of modifiers and run them in order, + * each of them will then edit the data object. + * @method + * @memberof Popper.Utils + * @param {dataObject} data + * @param {Array} modifiers + * @param {String} ends - Optional modifier name used as stopper + * @returns {dataObject} + */ +function runModifiers(modifiers, data, ends) { + var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); + + modifiersToRun.forEach(function (modifier) { + if (modifier['function']) { + // eslint-disable-line dot-notation + console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); + } + var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation + if (modifier.enabled && isFunction(fn)) { + // Add properties to offsets to make them a complete clientRect object + // we do this before each modifier to make sure the previous one doesn't + // mess with these values + data.offsets.popper = getClientRect(data.offsets.popper); + data.offsets.reference = getClientRect(data.offsets.reference); + + data = fn(data, modifier); + } + }); + + return data; +} + +/** + * Updates the position of the popper, computing the new offsets and applying + * the new style.
+ * Prefer `scheduleUpdate` over `update` because of performance reasons. + * @method + * @memberof Popper + */ +function update() { + // if popper is destroyed, don't perform any further update + if (this.state.isDestroyed) { + return; + } + + var data = { + instance: this, + styles: {}, + arrowStyles: {}, + attributes: {}, + flipped: false, + offsets: {} + }; + + // compute reference element offsets + data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); + + // compute auto placement, store placement inside the data object, + // modifiers will be able to edit `placement` if needed + // and refer to originalPlacement to know the original value + data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); + + // store the computed placement inside `originalPlacement` + data.originalPlacement = data.placement; + + data.positionFixed = this.options.positionFixed; + + // compute the popper offsets + data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); + data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; + + // run the modifiers + data = runModifiers(this.modifiers, data); + + // the first `update` will call `onCreate` callback + // the other ones will call `onUpdate` callback + if (!this.state.isCreated) { + this.state.isCreated = true; + this.options.onCreate(data); + } else { + this.options.onUpdate(data); + } +} + +/** + * Helper used to know if the given modifier is enabled. + * @method + * @memberof Popper.Utils + * @returns {Boolean} + */ +function isModifierEnabled(modifiers, modifierName) { + return modifiers.some(function (_ref) { + var name = _ref.name, + enabled = _ref.enabled; + return enabled && name === modifierName; + }); +} + +/** + * Get the prefixed supported property name + * @method + * @memberof Popper.Utils + * @argument {String} property (camelCase) + * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) + */ +function getSupportedPropertyName(property) { + var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; + var upperProp = property.charAt(0).toUpperCase() + property.slice(1); + + for (var i = 0; i < prefixes.length; i++) { + var prefix = prefixes[i]; + var toCheck = prefix ? '' + prefix + upperProp : property; + if (typeof document.body.style[toCheck] !== 'undefined') { + return toCheck; + } + } + return null; +} + +/** + * Destroy the popper + * @method + * @memberof Popper + */ +function destroy() { + this.state.isDestroyed = true; + + // touch DOM only if `applyStyle` modifier is enabled + if (isModifierEnabled(this.modifiers, 'applyStyle')) { + this.popper.removeAttribute('x-placement'); + this.popper.style.position = ''; + this.popper.style.top = ''; + this.popper.style.left = ''; + this.popper.style.right = ''; + this.popper.style.bottom = ''; + this.popper.style.willChange = ''; + this.popper.style[getSupportedPropertyName('transform')] = ''; + } + + this.disableEventListeners(); + + // remove the popper if user explicity asked for the deletion on destroy + // do not use `remove` because IE11 doesn't support it + if (this.options.removeOnDestroy) { + this.popper.parentNode.removeChild(this.popper); + } + return this; +} + +/** + * Get the window associated with the element + * @argument {Element} element + * @returns {Window} + */ +function getWindow(element) { + var ownerDocument = element.ownerDocument; + return ownerDocument ? ownerDocument.defaultView : window; +} + +function attachToScrollParents(scrollParent, event, callback, scrollParents) { + var isBody = scrollParent.nodeName === 'BODY'; + var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; + target.addEventListener(event, callback, { passive: true }); + + if (!isBody) { + attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); + } + scrollParents.push(target); +} + +/** + * Setup needed event listeners used to update the popper position + * @method + * @memberof Popper.Utils + * @private + */ +function setupEventListeners(reference, options, state, updateBound) { + // Resize event listener on window + state.updateBound = updateBound; + getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); + + // Scroll event listener on scroll parents + var scrollElement = getScrollParent(reference); + attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); + state.scrollElement = scrollElement; + state.eventsEnabled = true; + + return state; +} + +/** + * It will add resize/scroll events and start recalculating + * position of the popper element when they are triggered. + * @method + * @memberof Popper + */ +function enableEventListeners() { + if (!this.state.eventsEnabled) { + this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); + } +} + +/** + * Remove event listeners used to update the popper position + * @method + * @memberof Popper.Utils + * @private + */ +function removeEventListeners(reference, state) { + // Remove resize event listener on window + getWindow(reference).removeEventListener('resize', state.updateBound); + + // Remove scroll event listener on scroll parents + state.scrollParents.forEach(function (target) { + target.removeEventListener('scroll', state.updateBound); + }); + + // Reset state + state.updateBound = null; + state.scrollParents = []; + state.scrollElement = null; + state.eventsEnabled = false; + return state; +} + +/** + * It will remove resize/scroll events and won't recalculate popper position + * when they are triggered. It also won't trigger onUpdate callback anymore, + * unless you call `update` method manually. + * @method + * @memberof Popper + */ +function disableEventListeners() { + if (this.state.eventsEnabled) { + cancelAnimationFrame(this.scheduleUpdate); + this.state = removeEventListeners(this.reference, this.state); + } +} + +/** + * Tells if a given input is a number + * @method + * @memberof Popper.Utils + * @param {*} input to check + * @return {Boolean} + */ +function isNumeric(n) { + return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); +} + +/** + * Set the style to the given popper + * @method + * @memberof Popper.Utils + * @argument {Element} element - Element to apply the style to + * @argument {Object} styles + * Object with a list of properties and values which will be applied to the element + */ +function setStyles(element, styles) { + Object.keys(styles).forEach(function (prop) { + var unit = ''; + // add unit if the value is numeric and is one of the following + if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { + unit = 'px'; + } + element.style[prop] = styles[prop] + unit; + }); +} + +/** + * Set the attributes to the given popper + * @method + * @memberof Popper.Utils + * @argument {Element} element - Element to apply the attributes to + * @argument {Object} styles + * Object with a list of properties and values which will be applied to the element + */ +function setAttributes(element, attributes) { + Object.keys(attributes).forEach(function (prop) { + var value = attributes[prop]; + if (value !== false) { + element.setAttribute(prop, attributes[prop]); + } else { + element.removeAttribute(prop); + } + }); +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} data.styles - List of style properties - values to apply to popper element + * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The same data object + */ +function applyStyle(data) { + // any property present in `data.styles` will be applied to the popper, + // in this way we can make the 3rd party modifiers add custom styles to it + // Be aware, modifiers could override the properties defined in the previous + // lines of this modifier! + setStyles(data.instance.popper, data.styles); + + // any property present in `data.attributes` will be applied to the popper, + // they will be set as HTML attributes of the element + setAttributes(data.instance.popper, data.attributes); + + // if arrowElement is defined and arrowStyles has some properties + if (data.arrowElement && Object.keys(data.arrowStyles).length) { + setStyles(data.arrowElement, data.arrowStyles); + } + + return data; +} + +/** + * Set the x-placement attribute before everything else because it could be used + * to add margins to the popper margins needs to be calculated to get the + * correct popper offsets. + * @method + * @memberof Popper.modifiers + * @param {HTMLElement} reference - The reference element used to position the popper + * @param {HTMLElement} popper - The HTML element used as popper + * @param {Object} options - Popper.js options + */ +function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { + // compute reference element offsets + var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); + + // compute auto placement, store placement inside the data object, + // modifiers will be able to edit `placement` if needed + // and refer to originalPlacement to know the original value + var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); + + popper.setAttribute('x-placement', placement); + + // Apply `position` to popper before anything else because + // without the position applied we can't guarantee correct computations + setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); + + return options; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function computeStyle(data, options) { + var x = options.x, + y = options.y; + var popper = data.offsets.popper; + + // Remove this legacy support in Popper.js v2 + + var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { + return modifier.name === 'applyStyle'; + }).gpuAcceleration; + if (legacyGpuAccelerationOption !== undefined) { + console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); + } + var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; + + var offsetParent = getOffsetParent(data.instance.popper); + var offsetParentRect = getBoundingClientRect(offsetParent); + + // Styles + var styles = { + position: popper.position + }; + + // floor sides to avoid blurry text + var offsets = { + left: Math.floor(popper.left), + top: Math.floor(popper.top), + bottom: Math.floor(popper.bottom), + right: Math.floor(popper.right) + }; + + var sideA = x === 'bottom' ? 'top' : 'bottom'; + var sideB = y === 'right' ? 'left' : 'right'; + + // if gpuAcceleration is set to `true` and transform is supported, + // we use `translate3d` to apply the position to the popper we + // automatically use the supported prefixed version if needed + var prefixedProperty = getSupportedPropertyName('transform'); + + // now, let's make a step back and look at this code closely (wtf?) + // If the content of the popper grows once it's been positioned, it + // may happen that the popper gets misplaced because of the new content + // overflowing its reference element + // To avoid this problem, we provide two options (x and y), which allow + // the consumer to define the offset origin. + // If we position a popper on top of a reference element, we can set + // `x` to `top` to make the popper grow towards its top instead of + // its bottom. + var left = void 0, + top = void 0; + if (sideA === 'bottom') { + top = -offsetParentRect.height + offsets.bottom; + } else { + top = offsets.top; + } + if (sideB === 'right') { + left = -offsetParentRect.width + offsets.right; + } else { + left = offsets.left; + } + if (gpuAcceleration && prefixedProperty) { + styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; + styles[sideA] = 0; + styles[sideB] = 0; + styles.willChange = 'transform'; + } else { + // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties + var invertTop = sideA === 'bottom' ? -1 : 1; + var invertLeft = sideB === 'right' ? -1 : 1; + styles[sideA] = top * invertTop; + styles[sideB] = left * invertLeft; + styles.willChange = sideA + ', ' + sideB; + } + + // Attributes + var attributes = { + 'x-placement': data.placement + }; + + // Update `data` attributes, styles and arrowStyles + data.attributes = _extends({}, attributes, data.attributes); + data.styles = _extends({}, styles, data.styles); + data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); + + return data; +} + +/** + * Helper used to know if the given modifier depends from another one.
+ * It checks if the needed modifier is listed and enabled. + * @method + * @memberof Popper.Utils + * @param {Array} modifiers - list of modifiers + * @param {String} requestingName - name of requesting modifier + * @param {String} requestedName - name of requested modifier + * @returns {Boolean} + */ +function isModifierRequired(modifiers, requestingName, requestedName) { + var requesting = find(modifiers, function (_ref) { + var name = _ref.name; + return name === requestingName; + }); + + var isRequired = !!requesting && modifiers.some(function (modifier) { + return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; + }); + + if (!isRequired) { + var _requesting = '`' + requestingName + '`'; + var requested = '`' + requestedName + '`'; + console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); + } + return isRequired; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function arrow(data, options) { + var _data$offsets$arrow; + + // arrow depends on keepTogether in order to work + if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { + return data; + } + + var arrowElement = options.element; + + // if arrowElement is a string, suppose it's a CSS selector + if (typeof arrowElement === 'string') { + arrowElement = data.instance.popper.querySelector(arrowElement); + + // if arrowElement is not found, don't run the modifier + if (!arrowElement) { + return data; + } + } else { + // if the arrowElement isn't a query selector we must check that the + // provided DOM node is child of its popper node + if (!data.instance.popper.contains(arrowElement)) { + console.warn('WARNING: `arrow.element` must be child of its popper element!'); + return data; + } + } + + var placement = data.placement.split('-')[0]; + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var isVertical = ['left', 'right'].indexOf(placement) !== -1; + + var len = isVertical ? 'height' : 'width'; + var sideCapitalized = isVertical ? 'Top' : 'Left'; + var side = sideCapitalized.toLowerCase(); + var altSide = isVertical ? 'left' : 'top'; + var opSide = isVertical ? 'bottom' : 'right'; + var arrowElementSize = getOuterSizes(arrowElement)[len]; + + // + // extends keepTogether behavior making sure the popper and its + // reference have enough pixels in conjuction + // + + // top/left side + if (reference[opSide] - arrowElementSize < popper[side]) { + data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); + } + // bottom/right side + if (reference[side] + arrowElementSize > popper[opSide]) { + data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; + } + data.offsets.popper = getClientRect(data.offsets.popper); + + // compute center of the popper + var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; + + // Compute the sideValue using the updated popper offsets + // take popper margin in account because we don't have this info available + var css = getStyleComputedProperty(data.instance.popper); + var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10); + var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10); + var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; + + // prevent arrowElement from being placed not contiguously to its popper + sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); + + data.arrowElement = arrowElement; + data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); + + return data; +} + +/** + * Get the opposite placement variation of the given one + * @method + * @memberof Popper.Utils + * @argument {String} placement variation + * @returns {String} flipped placement variation + */ +function getOppositeVariation(variation) { + if (variation === 'end') { + return 'start'; + } else if (variation === 'start') { + return 'end'; + } + return variation; +} + +/** + * List of accepted placements to use as values of the `placement` option.
+ * Valid placements are: + * - `auto` + * - `top` + * - `right` + * - `bottom` + * - `left` + * + * Each placement can have a variation from this list: + * - `-start` + * - `-end` + * + * Variations are interpreted easily if you think of them as the left to right + * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` + * is right.
+ * Vertically (`left` and `right`), `start` is top and `end` is bottom. + * + * Some valid examples are: + * - `top-end` (on top of reference, right aligned) + * - `right-start` (on right of reference, top aligned) + * - `bottom` (on bottom, centered) + * - `auto-right` (on the side with more space available, alignment depends by placement) + * + * @static + * @type {Array} + * @enum {String} + * @readonly + * @method placements + * @memberof Popper + */ +var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; + +// Get rid of `auto` `auto-start` and `auto-end` +var validPlacements = placements.slice(3); + +/** + * Given an initial placement, returns all the subsequent placements + * clockwise (or counter-clockwise). + * + * @method + * @memberof Popper.Utils + * @argument {String} placement - A valid placement (it accepts variations) + * @argument {Boolean} counter - Set to true to walk the placements counterclockwise + * @returns {Array} placements including their variations + */ +function clockwise(placement) { + var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var index = validPlacements.indexOf(placement); + var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); + return counter ? arr.reverse() : arr; +} + +var BEHAVIORS = { + FLIP: 'flip', + CLOCKWISE: 'clockwise', + COUNTERCLOCKWISE: 'counterclockwise' +}; + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function flip(data, options) { + // if `inner` modifier is enabled, we can't use the `flip` modifier + if (isModifierEnabled(data.instance.modifiers, 'inner')) { + return data; + } + + if (data.flipped && data.placement === data.originalPlacement) { + // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides + return data; + } + + var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); + + var placement = data.placement.split('-')[0]; + var placementOpposite = getOppositePlacement(placement); + var variation = data.placement.split('-')[1] || ''; + + var flipOrder = []; + + switch (options.behavior) { + case BEHAVIORS.FLIP: + flipOrder = [placement, placementOpposite]; + break; + case BEHAVIORS.CLOCKWISE: + flipOrder = clockwise(placement); + break; + case BEHAVIORS.COUNTERCLOCKWISE: + flipOrder = clockwise(placement, true); + break; + default: + flipOrder = options.behavior; + } + + flipOrder.forEach(function (step, index) { + if (placement !== step || flipOrder.length === index + 1) { + return data; + } + + placement = data.placement.split('-')[0]; + placementOpposite = getOppositePlacement(placement); + + var popperOffsets = data.offsets.popper; + var refOffsets = data.offsets.reference; + + // using floor because the reference offsets may contain decimals we are not going to consider here + var floor = Math.floor; + var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); + + var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); + var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); + var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); + var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); + + var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; + + // flip the variation if required + var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; + var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); + + if (overlapsRef || overflowsBoundaries || flippedVariation) { + // this boolean to detect any flip loop + data.flipped = true; + + if (overlapsRef || overflowsBoundaries) { + placement = flipOrder[index + 1]; + } + + if (flippedVariation) { + variation = getOppositeVariation(variation); + } + + data.placement = placement + (variation ? '-' + variation : ''); + + // this object contains `position`, we want to preserve it along with + // any additional property we may add in the future + data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); + + data = runModifiers(data.instance.modifiers, data, 'flip'); + } + }); + return data; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function keepTogether(data) { + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var placement = data.placement.split('-')[0]; + var floor = Math.floor; + var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; + var side = isVertical ? 'right' : 'bottom'; + var opSide = isVertical ? 'left' : 'top'; + var measurement = isVertical ? 'width' : 'height'; + + if (popper[side] < floor(reference[opSide])) { + data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; + } + if (popper[opSide] > floor(reference[side])) { + data.offsets.popper[opSide] = floor(reference[side]); + } + + return data; +} + +/** + * Converts a string containing value + unit into a px value number + * @function + * @memberof {modifiers~offset} + * @private + * @argument {String} str - Value + unit string + * @argument {String} measurement - `height` or `width` + * @argument {Object} popperOffsets + * @argument {Object} referenceOffsets + * @returns {Number|String} + * Value in pixels, or original string if no values were extracted + */ +function toValue(str, measurement, popperOffsets, referenceOffsets) { + // separate value from unit + var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); + var value = +split[1]; + var unit = split[2]; + + // If it's not a number it's an operator, I guess + if (!value) { + return str; + } + + if (unit.indexOf('%') === 0) { + var element = void 0; + switch (unit) { + case '%p': + element = popperOffsets; + break; + case '%': + case '%r': + default: + element = referenceOffsets; + } + + var rect = getClientRect(element); + return rect[measurement] / 100 * value; + } else if (unit === 'vh' || unit === 'vw') { + // if is a vh or vw, we calculate the size based on the viewport + var size = void 0; + if (unit === 'vh') { + size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); + } else { + size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); + } + return size / 100 * value; + } else { + // if is an explicit pixel unit, we get rid of the unit and keep the value + // if is an implicit unit, it's px, and we return just the value + return value; + } +} + +/** + * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. + * @function + * @memberof {modifiers~offset} + * @private + * @argument {String} offset + * @argument {Object} popperOffsets + * @argument {Object} referenceOffsets + * @argument {String} basePlacement + * @returns {Array} a two cells array with x and y offsets in numbers + */ +function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { + var offsets = [0, 0]; + + // Use height if placement is left or right and index is 0 otherwise use width + // in this way the first offset will use an axis and the second one + // will use the other one + var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; + + // Split the offset string to obtain a list of values and operands + // The regex addresses values with the plus or minus sign in front (+10, -20, etc) + var fragments = offset.split(/(\+|\-)/).map(function (frag) { + return frag.trim(); + }); + + // Detect if the offset string contains a pair of values or a single one + // they could be separated by comma or space + var divider = fragments.indexOf(find(fragments, function (frag) { + return frag.search(/,|\s/) !== -1; + })); + + if (fragments[divider] && fragments[divider].indexOf(',') === -1) { + console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); + } + + // If divider is found, we divide the list of values and operands to divide + // them by ofset X and Y. + var splitRegex = /\s*,\s*|\s+/; + var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; + + // Convert the values with units to absolute pixels to allow our computations + ops = ops.map(function (op, index) { + // Most of the units rely on the orientation of the popper + var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; + var mergeWithPrevious = false; + return op + // This aggregates any `+` or `-` sign that aren't considered operators + // e.g.: 10 + +5 => [10, +, +5] + .reduce(function (a, b) { + if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { + a[a.length - 1] = b; + mergeWithPrevious = true; + return a; + } else if (mergeWithPrevious) { + a[a.length - 1] += b; + mergeWithPrevious = false; + return a; + } else { + return a.concat(b); + } + }, []) + // Here we convert the string values into number values (in px) + .map(function (str) { + return toValue(str, measurement, popperOffsets, referenceOffsets); + }); + }); + + // Loop trough the offsets arrays and execute the operations + ops.forEach(function (op, index) { + op.forEach(function (frag, index2) { + if (isNumeric(frag)) { + offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); + } + }); + }); + return offsets; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @argument {Number|String} options.offset=0 + * The offset value as described in the modifier description + * @returns {Object} The data object, properly modified + */ +function offset(data, _ref) { + var offset = _ref.offset; + var placement = data.placement, + _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var basePlacement = placement.split('-')[0]; + + var offsets = void 0; + if (isNumeric(+offset)) { + offsets = [+offset, 0]; + } else { + offsets = parseOffset(offset, popper, reference, basePlacement); + } + + if (basePlacement === 'left') { + popper.top += offsets[0]; + popper.left -= offsets[1]; + } else if (basePlacement === 'right') { + popper.top += offsets[0]; + popper.left += offsets[1]; + } else if (basePlacement === 'top') { + popper.left += offsets[0]; + popper.top -= offsets[1]; + } else if (basePlacement === 'bottom') { + popper.left += offsets[0]; + popper.top += offsets[1]; + } + + data.popper = popper; + return data; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function preventOverflow(data, options) { + var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); + + // If offsetParent is the reference element, we really want to + // go one step up and use the next offsetParent as reference to + // avoid to make this modifier completely useless and look like broken + if (data.instance.reference === boundariesElement) { + boundariesElement = getOffsetParent(boundariesElement); + } + + var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); + options.boundaries = boundaries; + + var order = options.priority; + var popper = data.offsets.popper; + + var check = { + primary: function primary(placement) { + var value = popper[placement]; + if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { + value = Math.max(popper[placement], boundaries[placement]); + } + return defineProperty({}, placement, value); + }, + secondary: function secondary(placement) { + var mainSide = placement === 'right' ? 'left' : 'top'; + var value = popper[mainSide]; + if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { + value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); + } + return defineProperty({}, mainSide, value); + } + }; + + order.forEach(function (placement) { + var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; + popper = _extends({}, popper, check[side](placement)); + }); + + data.offsets.popper = popper; + + return data; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function shift(data) { + var placement = data.placement; + var basePlacement = placement.split('-')[0]; + var shiftvariation = placement.split('-')[1]; + + // if shift shiftvariation is specified, run the modifier + if (shiftvariation) { + var _data$offsets = data.offsets, + reference = _data$offsets.reference, + popper = _data$offsets.popper; + + var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; + var side = isVertical ? 'left' : 'top'; + var measurement = isVertical ? 'width' : 'height'; + + var shiftOffsets = { + start: defineProperty({}, side, reference[side]), + end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) + }; + + data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); + } + + return data; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function hide(data) { + if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { + return data; + } + + var refRect = data.offsets.reference; + var bound = find(data.instance.modifiers, function (modifier) { + return modifier.name === 'preventOverflow'; + }).boundaries; + + if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { + // Avoid unnecessary DOM access if visibility hasn't changed + if (data.hide === true) { + return data; + } + + data.hide = true; + data.attributes['x-out-of-boundaries'] = ''; + } else { + // Avoid unnecessary DOM access if visibility hasn't changed + if (data.hide === false) { + return data; + } + + data.hide = false; + data.attributes['x-out-of-boundaries'] = false; + } + + return data; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function inner(data) { + var placement = data.placement; + var basePlacement = placement.split('-')[0]; + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; + + var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; + + popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); + + data.placement = getOppositePlacement(placement); + data.offsets.popper = getClientRect(popper); + + return data; +} + +/** + * Modifier function, each modifier can have a function of this type assigned + * to its `fn` property.
+ * These functions will be called on each update, this means that you must + * make sure they are performant enough to avoid performance bottlenecks. + * + * @function ModifierFn + * @argument {dataObject} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {dataObject} The data object, properly modified + */ + +/** + * Modifiers are plugins used to alter the behavior of your poppers.
+ * Popper.js uses a set of 9 modifiers to provide all the basic functionalities + * needed by the library. + * + * Usually you don't want to override the `order`, `fn` and `onLoad` props. + * All the other properties are configurations that could be tweaked. + * @namespace modifiers + */ +var modifiers = { + /** + * Modifier used to shift the popper on the start or end of its reference + * element.
+ * It will read the variation of the `placement` property.
+ * It can be one either `-end` or `-start`. + * @memberof modifiers + * @inner + */ + shift: { + /** @prop {number} order=100 - Index used to define the order of execution */ + order: 100, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: shift + }, + + /** + * The `offset` modifier can shift your popper on both its axis. + * + * It accepts the following units: + * - `px` or unitless, interpreted as pixels + * - `%` or `%r`, percentage relative to the length of the reference element + * - `%p`, percentage relative to the length of the popper element + * - `vw`, CSS viewport width unit + * - `vh`, CSS viewport height unit + * + * For length is intended the main axis relative to the placement of the popper.
+ * This means that if the placement is `top` or `bottom`, the length will be the + * `width`. In case of `left` or `right`, it will be the height. + * + * You can provide a single value (as `Number` or `String`), or a pair of values + * as `String` divided by a comma or one (or more) white spaces.
+ * The latter is a deprecated method because it leads to confusion and will be + * removed in v2.
+ * Additionally, it accepts additions and subtractions between different units. + * Note that multiplications and divisions aren't supported. + * + * Valid examples are: + * ``` + * 10 + * '10%' + * '10, 10' + * '10%, 10' + * '10 + 10%' + * '10 - 5vh + 3%' + * '-10px + 5vh, 5px - 6%' + * ``` + * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap + * > with their reference element, unfortunately, you will have to disable the `flip` modifier. + * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373) + * + * @memberof modifiers + * @inner + */ + offset: { + /** @prop {number} order=200 - Index used to define the order of execution */ + order: 200, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: offset, + /** @prop {Number|String} offset=0 + * The offset value as described in the modifier description + */ + offset: 0 + }, + + /** + * Modifier used to prevent the popper from being positioned outside the boundary. + * + * An scenario exists where the reference itself is not within the boundaries.
+ * We can say it has "escaped the boundaries" — or just "escaped".
+ * In this case we need to decide whether the popper should either: + * + * - detach from the reference and remain "trapped" in the boundaries, or + * - if it should ignore the boundary and "escape with its reference" + * + * When `escapeWithReference` is set to`true` and reference is completely + * outside its boundaries, the popper will overflow (or completely leave) + * the boundaries in order to remain attached to the edge of the reference. + * + * @memberof modifiers + * @inner + */ + preventOverflow: { + /** @prop {number} order=300 - Index used to define the order of execution */ + order: 300, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: preventOverflow, + /** + * @prop {Array} [priority=['left','right','top','bottom']] + * Popper will try to prevent overflow following these priorities by default, + * then, it could overflow on the left and on top of the `boundariesElement` + */ + priority: ['left', 'right', 'top', 'bottom'], + /** + * @prop {number} padding=5 + * Amount of pixel used to define a minimum distance between the boundaries + * and the popper this makes sure the popper has always a little padding + * between the edges of its container + */ + padding: 5, + /** + * @prop {String|HTMLElement} boundariesElement='scrollParent' + * Boundaries used by the modifier, can be `scrollParent`, `window`, + * `viewport` or any DOM element. + */ + boundariesElement: 'scrollParent' + }, + + /** + * Modifier used to make sure the reference and its popper stay near eachothers + * without leaving any gap between the two. Expecially useful when the arrow is + * enabled and you want to assure it to point to its reference element. + * It cares only about the first axis, you can still have poppers with margin + * between the popper and its reference element. + * @memberof modifiers + * @inner + */ + keepTogether: { + /** @prop {number} order=400 - Index used to define the order of execution */ + order: 400, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: keepTogether + }, + + /** + * This modifier is used to move the `arrowElement` of the popper to make + * sure it is positioned between the reference element and its popper element. + * It will read the outer size of the `arrowElement` node to detect how many + * pixels of conjuction are needed. + * + * It has no effect if no `arrowElement` is provided. + * @memberof modifiers + * @inner + */ + arrow: { + /** @prop {number} order=500 - Index used to define the order of execution */ + order: 500, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: arrow, + /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ + element: '[x-arrow]' + }, + + /** + * Modifier used to flip the popper's placement when it starts to overlap its + * reference element. + * + * Requires the `preventOverflow` modifier before it in order to work. + * + * **NOTE:** this modifier will interrupt the current update cycle and will + * restart it if it detects the need to flip the placement. + * @memberof modifiers + * @inner + */ + flip: { + /** @prop {number} order=600 - Index used to define the order of execution */ + order: 600, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: flip, + /** + * @prop {String|Array} behavior='flip' + * The behavior used to change the popper's placement. It can be one of + * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid + * placements (with optional variations). + */ + behavior: 'flip', + /** + * @prop {number} padding=5 + * The popper will flip if it hits the edges of the `boundariesElement` + */ + padding: 5, + /** + * @prop {String|HTMLElement} boundariesElement='viewport' + * The element which will define the boundaries of the popper position, + * the popper will never be placed outside of the defined boundaries + * (except if keepTogether is enabled) + */ + boundariesElement: 'viewport' + }, + + /** + * Modifier used to make the popper flow toward the inner of the reference element. + * By default, when this modifier is disabled, the popper will be placed outside + * the reference element. + * @memberof modifiers + * @inner + */ + inner: { + /** @prop {number} order=700 - Index used to define the order of execution */ + order: 700, + /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ + enabled: false, + /** @prop {ModifierFn} */ + fn: inner + }, + + /** + * Modifier used to hide the popper when its reference element is outside of the + * popper boundaries. It will set a `x-out-of-boundaries` attribute which can + * be used to hide with a CSS selector the popper when its reference is + * out of boundaries. + * + * Requires the `preventOverflow` modifier before it in order to work. + * @memberof modifiers + * @inner + */ + hide: { + /** @prop {number} order=800 - Index used to define the order of execution */ + order: 800, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: hide + }, + + /** + * Computes the style that will be applied to the popper element to gets + * properly positioned. + * + * Note that this modifier will not touch the DOM, it just prepares the styles + * so that `applyStyle` modifier can apply it. This separation is useful + * in case you need to replace `applyStyle` with a custom implementation. + * + * This modifier has `850` as `order` value to maintain backward compatibility + * with previous versions of Popper.js. Expect the modifiers ordering method + * to change in future major versions of the library. + * + * @memberof modifiers + * @inner + */ + computeStyle: { + /** @prop {number} order=850 - Index used to define the order of execution */ + order: 850, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: computeStyle, + /** + * @prop {Boolean} gpuAcceleration=true + * If true, it uses the CSS 3d transformation to position the popper. + * Otherwise, it will use the `top` and `left` properties. + */ + gpuAcceleration: true, + /** + * @prop {string} [x='bottom'] + * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. + * Change this if your popper should grow in a direction different from `bottom` + */ + x: 'bottom', + /** + * @prop {string} [x='left'] + * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. + * Change this if your popper should grow in a direction different from `right` + */ + y: 'right' + }, + + /** + * Applies the computed styles to the popper element. + * + * All the DOM manipulations are limited to this modifier. This is useful in case + * you want to integrate Popper.js inside a framework or view library and you + * want to delegate all the DOM manipulations to it. + * + * Note that if you disable this modifier, you must make sure the popper element + * has its position set to `absolute` before Popper.js can do its work! + * + * Just disable this modifier and define you own to achieve the desired effect. + * + * @memberof modifiers + * @inner + */ + applyStyle: { + /** @prop {number} order=900 - Index used to define the order of execution */ + order: 900, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: applyStyle, + /** @prop {Function} */ + onLoad: applyStyleOnLoad, + /** + * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier + * @prop {Boolean} gpuAcceleration=true + * If true, it uses the CSS 3d transformation to position the popper. + * Otherwise, it will use the `top` and `left` properties. + */ + gpuAcceleration: undefined + } +}; + +/** + * The `dataObject` is an object containing all the informations used by Popper.js + * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks. + * @name dataObject + * @property {Object} data.instance The Popper.js instance + * @property {String} data.placement Placement applied to popper + * @property {String} data.originalPlacement Placement originally defined on init + * @property {Boolean} data.flipped True if popper has been flipped by flip modifier + * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper. + * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier + * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`) + * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`) + * @property {Object} data.boundaries Offsets of the popper boundaries + * @property {Object} data.offsets The measurements of popper, reference and arrow elements. + * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values + * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values + * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 + */ + +/** + * Default options provided to Popper.js constructor.
+ * These can be overriden using the `options` argument of Popper.js.
+ * To override an option, simply pass as 3rd argument an object with the same + * structure of this object, example: + * ``` + * new Popper(ref, pop, { + * modifiers: { + * preventOverflow: { enabled: false } + * } + * }) + * ``` + * @type {Object} + * @static + * @memberof Popper + */ +var Defaults = { + /** + * Popper's placement + * @prop {Popper.placements} placement='bottom' + */ + placement: 'bottom', + + /** + * Set this to true if you want popper to position it self in 'fixed' mode + * @prop {Boolean} positionFixed=false + */ + positionFixed: false, + + /** + * Whether events (resize, scroll) are initially enabled + * @prop {Boolean} eventsEnabled=true + */ + eventsEnabled: true, + + /** + * Set to true if you want to automatically remove the popper when + * you call the `destroy` method. + * @prop {Boolean} removeOnDestroy=false + */ + removeOnDestroy: false, + + /** + * Callback called when the popper is created.
+ * By default, is set to no-op.
+ * Access Popper.js instance with `data.instance`. + * @prop {onCreate} + */ + onCreate: function onCreate() {}, + + /** + * Callback called when the popper is updated, this callback is not called + * on the initialization/creation of the popper, but only on subsequent + * updates.
+ * By default, is set to no-op.
+ * Access Popper.js instance with `data.instance`. + * @prop {onUpdate} + */ + onUpdate: function onUpdate() {}, + + /** + * List of modifiers used to modify the offsets before they are applied to the popper. + * They provide most of the functionalities of Popper.js + * @prop {modifiers} + */ + modifiers: modifiers +}; + +/** + * @callback onCreate + * @param {dataObject} data + */ + +/** + * @callback onUpdate + * @param {dataObject} data + */ + +// Utils +// Methods +var Popper = function () { + /** + * Create a new Popper.js instance + * @class Popper + * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper + * @param {HTMLElement} popper - The HTML element used as popper. + * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) + * @return {Object} instance - The generated Popper.js instance + */ + function Popper(reference, popper) { + var _this = this; + + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + classCallCheck(this, Popper); + + this.scheduleUpdate = function () { + return requestAnimationFrame(_this.update); + }; + + // make update() debounced, so that it only runs at most once-per-tick + this.update = debounce(this.update.bind(this)); + + // with {} we create a new object with the options inside it + this.options = _extends({}, Popper.Defaults, options); + + // init state + this.state = { + isDestroyed: false, + isCreated: false, + scrollParents: [] + }; + + // get reference and popper elements (allow jQuery wrappers) + this.reference = reference && reference.jquery ? reference[0] : reference; + this.popper = popper && popper.jquery ? popper[0] : popper; + + // Deep merge modifiers options + this.options.modifiers = {}; + Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { + _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); + }); + + // Refactoring modifiers' list (Object => Array) + this.modifiers = Object.keys(this.options.modifiers).map(function (name) { + return _extends({ + name: name + }, _this.options.modifiers[name]); + }) + // sort the modifiers by order + .sort(function (a, b) { + return a.order - b.order; + }); + + // modifiers have the ability to execute arbitrary code when Popper.js get inited + // such code is executed in the same order of its modifier + // they could add new properties to their options configuration + // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! + this.modifiers.forEach(function (modifierOptions) { + if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { + modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); + } + }); + + // fire the first update to position the popper in the right place + this.update(); + + var eventsEnabled = this.options.eventsEnabled; + if (eventsEnabled) { + // setup event listeners, they will take care of update the position in specific situations + this.enableEventListeners(); + } + + this.state.eventsEnabled = eventsEnabled; + } + + // We can't use class properties because they don't get listed in the + // class prototype and break stuff like Sinon stubs + + + createClass(Popper, [{ + key: 'update', + value: function update$$1() { + return update.call(this); + } + }, { + key: 'destroy', + value: function destroy$$1() { + return destroy.call(this); + } + }, { + key: 'enableEventListeners', + value: function enableEventListeners$$1() { + return enableEventListeners.call(this); + } + }, { + key: 'disableEventListeners', + value: function disableEventListeners$$1() { + return disableEventListeners.call(this); + } + + /** + * Schedule an update, it will run on the next UI update available + * @method scheduleUpdate + * @memberof Popper + */ + + + /** + * Collection of utilities useful when writing custom modifiers. + * Starting from version 1.7, this method is available only if you + * include `popper-utils.js` before `popper.js`. + * + * **DEPRECATION**: This way to access PopperUtils is deprecated + * and will be removed in v2! Use the PopperUtils module directly instead. + * Due to the high instability of the methods contained in Utils, we can't + * guarantee them to follow semver. Use them at your own risk! + * @static + * @private + * @type {Object} + * @deprecated since version 1.8 + * @member Utils + * @memberof Popper + */ + + }]); + return Popper; +}(); + +/** + * The `referenceObject` is an object that provides an interface compatible with Popper.js + * and lets you use it as replacement of a real DOM node.
+ * You can use this method to position a popper relatively to a set of coordinates + * in case you don't have a DOM node to use as reference. + * + * ``` + * new Popper(referenceObject, popperNode); + * ``` + * + * NB: This feature isn't supported in Internet Explorer 10 + * @name referenceObject + * @property {Function} data.getBoundingClientRect + * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. + * @property {number} data.clientWidth + * An ES6 getter that will return the width of the virtual reference element. + * @property {number} data.clientHeight + * An ES6 getter that will return the height of the virtual reference element. + */ + + +Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; +Popper.placements = placements; +Popper.Defaults = Defaults; + +var PositioningPlacement = { + Auto: "auto", + TopLeft: "top left", + Top: "top", + TopRight: "top right", + LeftTop: "left top", + Left: "left", + LeftBottom: "left bottom", + BottomLeft: "bottom left", + Bottom: "bottom", + BottomRight: "bottom right", + RightTop: "right top", + Right: "right", + RightBottom: "right bottom" +}; +function placementToPopper(placement) { + if (!placement || placement === PositioningPlacement.Auto) { + return "auto"; + } + // All placements of the format: `direction alignment`, e.g. `top left`. + var _a = placement.split(" "), direction = _a[0], alignment = _a[1]; + // Direction alone covers case of just `top`, `left`, `bottom`, `right`. + var chosenPlacement = [direction]; + // Add `start` / `end` to placement, depending on alignment direction. + switch (alignment) { + case "top": + case "left": + chosenPlacement.push("start"); + break; + case "bottom": + case "right": + chosenPlacement.push("end"); + break; + } + // Join with hyphen to create Popper compatible placement. + return chosenPlacement.join("-"); +} +function popperToPlacement(popper) { + if (!popper || popper === "auto") { + return "auto"; + } + var _a = popper.split("-"), direction = _a[0], alignment = _a[1]; + var chosenPlacement = [direction]; + switch (direction) { + case "top": + case "bottom": + switch (alignment) { + case "start": + chosenPlacement.push("left"); + break; + case "end": + chosenPlacement.push("right"); + break; + } + break; + case "left": + case "right": + switch (alignment) { + case "start": + chosenPlacement.push("top"); + break; + case "end": + chosenPlacement.push("bottom"); + break; + } + break; + } + return chosenPlacement.join(" "); +} +var PositioningService = /** @class */ (function () { + function PositioningService(anchor, subject, placement, arrowSelector) { + var _this = this; + this.anchor = anchor; + this.subject = subject; + this._placement = placement; + var modifiers = { + computeStyle: { + gpuAcceleration: false + }, + preventOverflow: { + escapeWithReference: true, + boundariesElement: document.body + }, + arrow: { + element: arrowSelector + } + }; + if (!arrowSelector) { + delete modifiers.arrow; + } + this._popper = new Popper(anchor.nativeElement, subject.nativeElement, { + placement: placementToPopper(placement), + modifiers: modifiers, + onCreate: function (initial) { return _this._popperState = initial; }, + onUpdate: function (update) { return _this._popperState = update; } + }); + } + Object.defineProperty(PositioningService.prototype, "placement", { + get: function () { + return this._placement; + }, + set: function (placement) { + this._placement = placement; + this._popper.options.placement = placementToPopper(placement); + this.update(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PositioningService.prototype, "actualPlacement", { + get: function () { + if (!this._popperState) { + return PositioningPlacement.Auto; + } + return popperToPlacement(this._popperState.placement); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PositioningService.prototype, "state", { + get: function () { + return this._popperState; + }, + enumerable: true, + configurable: true + }); + PositioningService.prototype.update = function () { + this._popper.update(); + }; + PositioningService.prototype.destroy = function () { + this._popper.destroy(); + }; + return PositioningService; +}()); + +var SuiUtilityModule = /** @class */ (function () { + function SuiUtilityModule() { + } + SuiUtilityModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [_angular_common.CommonModule], + providers: [ + SuiComponentFactory + ] + },] }, + ]; + /** @nocollapse */ + SuiUtilityModule.ctorParameters = function () { return []; }; + return SuiUtilityModule; +}()); + +var __extends = (undefined && undefined.__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 __()); + }; +})(); +var SuiCheckbox = /** @class */ (function () { + function SuiCheckbox() { + this.isChecked = false; + this.onCheckChange = new _angular_core.EventEmitter(); + this.onTouched = new _angular_core.EventEmitter(); + this.isDisabled = false; + this.isReadonly = false; + this._checkboxClasses = true; + } + Object.defineProperty(SuiCheckbox.prototype, "checkedAttribute", { + get: function () { + return this.isChecked ? "" : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCheckbox.prototype, "isDisabledAttribute", { + get: function () { + return this.isDisabled ? "disabled" : undefined; + }, + enumerable: true, + configurable: true + }); + SuiCheckbox.prototype.onMouseDown = function (e) { + e.preventDefault(); + }; + SuiCheckbox.prototype.onClick = function () { + if (!this.isDisabled && !this.isReadonly) { + this.toggle(); + this.focusCheckbox(); + } + }; + SuiCheckbox.prototype.onFocusOut = function () { + this.onTouched.emit(); + }; + SuiCheckbox.prototype.toggle = function () { + this.isChecked = !this.isChecked; + this.onCheckChange.emit(this.isChecked); + }; + SuiCheckbox.prototype.writeValue = function (value) { + this.isChecked = value; + }; + SuiCheckbox.prototype.focusCheckbox = function () { + this._checkboxElement.nativeElement.focus(); + }; + SuiCheckbox.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-checkbox", + exportAs: "suiCheckbox", + template: "\n\n\n" + },] }, + ]; + /** @nocollapse */ + SuiCheckbox.ctorParameters = function () { return []; }; + SuiCheckbox.propDecorators = { + "_checkboxClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.checkbox",] },], + "name": [{ type: _angular_core.Input },], + "isChecked": [{ type: _angular_core.HostBinding, args: ["class.checked",] },], + "onCheckChange": [{ type: _angular_core.Output, args: ["checkChange",] },], + "onTouched": [{ type: _angular_core.Output, args: ["touched",] },], + "isDisabled": [{ type: _angular_core.Input },], + "isReadonly": [{ type: _angular_core.HostBinding, args: ["class.read-only",] }, { type: _angular_core.Input },], + "_checkboxElement": [{ type: _angular_core.ViewChild, args: ["checkbox",] },], + "onMouseDown": [{ type: _angular_core.HostListener, args: ["mousedown", ["$event"],] },], + "onClick": [{ type: _angular_core.HostListener, args: ["click",] },], + "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout",] },], + }; + return SuiCheckbox; +}()); +var SuiCheckboxValueAccessor = /** @class */ (function (_super) { + __extends(SuiCheckboxValueAccessor, _super); + function SuiCheckboxValueAccessor(host) { + return _super.call(this, host) || this; + } + SuiCheckboxValueAccessor.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "sui-checkbox", + host: { + "(checkChange)": "onChange($event)", + "(touched)": "onTouched()" + }, + providers: [customValueAccessorFactory(SuiCheckboxValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiCheckboxValueAccessor.ctorParameters = function () { return [ + { type: SuiCheckbox, }, + ]; }; + return SuiCheckboxValueAccessor; +}(CustomValueAccessor)); + +var __extends$1 = (undefined && undefined.__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 __()); + }; +})(); +var SuiRadio = /** @class */ (function () { + function SuiRadio() { + this._radioClasses = true; + this.isChecked = false; + this.onCurrentValueChange = new _angular_core.EventEmitter(); + this.onTouched = new _angular_core.EventEmitter(); + this.isDisabled = false; + this.isReadonly = false; + this._radioClasses = true; + } + Object.defineProperty(SuiRadio.prototype, "checkedAttribute", { + get: function () { + return this.isChecked ? "" : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiRadio.prototype, "isDisabledAttribute", { + get: function () { + return this.isDisabled ? "disabled" : undefined; + }, + enumerable: true, + configurable: true + }); + SuiRadio.prototype.onMouseDown = function (e) { + e.preventDefault(); + }; + SuiRadio.prototype.onClick = function () { + if (!this.isDisabled && !this.isReadonly) { + this.currentValue = this.value; + this.onCurrentValueChange.emit(this.currentValue); + this.update(); + this.focusRadio(); + } + }; + SuiRadio.prototype.onFocusOut = function () { + this.onTouched.emit(); + }; + SuiRadio.prototype.update = function () { + this.isChecked = this.currentValue === this.value; + }; + SuiRadio.prototype.writeValue = function (value) { + this.currentValue = value; + this.update(); + }; + SuiRadio.prototype.focusRadio = function () { + this._radioElement.nativeElement.focus(); + }; + SuiRadio.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-radio-button", + template: "\n\n\n" + },] }, + ]; + /** @nocollapse */ + SuiRadio.ctorParameters = function () { return []; }; + SuiRadio.propDecorators = { + "_radioClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.radio",] }, { type: _angular_core.HostBinding, args: ["class.checkbox",] },], + "name": [{ type: _angular_core.Input },], + "value": [{ type: _angular_core.Input },], + "isChecked": [{ type: _angular_core.HostBinding, args: ["class.checked",] },], + "onCurrentValueChange": [{ type: _angular_core.Output, args: ["currentValueChange",] },], + "onTouched": [{ type: _angular_core.Output, args: ["touched",] },], + "isDisabled": [{ type: _angular_core.Input },], + "isReadonly": [{ type: _angular_core.HostBinding, args: ["class.read-only",] }, { type: _angular_core.Input },], + "_radioElement": [{ type: _angular_core.ViewChild, args: ["radio",] },], + "onMouseDown": [{ type: _angular_core.HostListener, args: ["mousedown", ["$event"],] },], + "onClick": [{ type: _angular_core.HostListener, args: ["click",] },], + "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout",] },], + }; + return SuiRadio; +}()); +var SuiRadioValueAccessor = /** @class */ (function (_super) { + __extends$1(SuiRadioValueAccessor, _super); + function SuiRadioValueAccessor(host) { + return _super.call(this, host) || this; + } + SuiRadioValueAccessor.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "sui-radio-button", + host: { + "(currentValueChange)": "onChange($event)", + "(touched)": "onTouched()" + }, + providers: [customValueAccessorFactory(SuiRadioValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiRadioValueAccessor.ctorParameters = function () { return [ + { type: SuiRadio, }, + ]; }; + return SuiRadioValueAccessor; +}(CustomValueAccessor)); + +var SuiRadioManager = /** @class */ (function () { + function SuiRadioManager(element) { + this.element = element; + this.isNested = false; + this._radioSubs = []; + } + SuiRadioManager.prototype.ngAfterContentInit = function () { + var _this = this; + this.updateNesting(); + this._subManagers.changes.subscribe(function () { return _this.updateNesting(); }); + this.updateRadios(); + this._renderedRadios.changes.subscribe(function () { return _this.updateRadios(); }); + }; + SuiRadioManager.prototype.updateNesting = function () { + var _this = this; + this._subManagers + .filter(function (m) { return m !== _this; }) + .forEach(function (m) { return m.isNested = true; }); + }; + SuiRadioManager.prototype.updateRadios = function () { + var _this = this; + this._radioSubs.forEach(function (s) { return s.unsubscribe(); }); + this._radioSubs = []; + var groups = Util.Array.groupBy(this._renderedRadios.toArray(), "name"); + Object + .keys(groups) + .map(function (k) { return groups[k]; }) + .forEach(function (g) { + return g + .forEach(function (r) { + return _this._radioSubs + .push(r.onCurrentValueChange + .subscribe(function (v) { + if (!_this.isNested) { + g.forEach(function (radio) { return radio.writeValue(v); }); + } + })); + }); + }); + }; + SuiRadioManager.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]" + },] }, + ]; + /** @nocollapse */ + SuiRadioManager.ctorParameters = function () { return [ + { type: _angular_core.ElementRef, }, + ]; }; + SuiRadioManager.propDecorators = { + "_subManagers": [{ type: _angular_core.ContentChildren, args: [SuiRadioManager, { descendants: true },] },], + "_renderedRadios": [{ type: _angular_core.ContentChildren, args: [SuiRadio, { descendants: true },] },], + }; + return SuiRadioManager; +}()); + +var SuiCheckboxModule = /** @class */ (function () { + function SuiCheckboxModule() { + } + SuiCheckboxModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule, + _angular_forms.FormsModule + ], + declarations: [ + SuiCheckbox, + SuiCheckboxValueAccessor, + SuiRadio, + SuiRadioValueAccessor, + SuiRadioManager + ], + exports: [ + SuiCheckbox, + SuiCheckboxValueAccessor, + SuiRadio, + SuiRadioValueAccessor, + SuiRadioManager + ] + },] }, + ]; + /** @nocollapse */ + SuiCheckboxModule.ctorParameters = function () { return []; }; + return SuiCheckboxModule; +}()); + +(function (CalendarMode) { + CalendarMode[CalendarMode["DateOnly"] = 0] = "DateOnly"; + CalendarMode[CalendarMode["TimeOnly"] = 1] = "TimeOnly"; + CalendarMode[CalendarMode["Both"] = 2] = "Both"; +})(exports.CalendarMode || (exports.CalendarMode = {})); +var CalendarService = /** @class */ (function () { + function CalendarService(config, localeValues) { + this.localeValues = localeValues; + this.onManualUpdate = function () { }; + this.config = config; + this.currentDate = new Date(); + this.firstDayOfWeek = this.localeValues.firstDayOfWeek; + this.onDateChange = new _angular_core.EventEmitter(); + this.reset(); + } + Object.defineProperty(CalendarService.prototype, "config", { + get: function () { + return this._config; + }, + set: function (config) { + this._config = config; + config.updateBounds(this._selectedDate || this.currentDate); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarService.prototype, "inFinalView", { + get: function () { + return this.currentView === this.config.mappings.finalView; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarService.prototype, "selectedDate", { + get: function () { + return this._selectedDate; + }, + set: function (date) { + if (date) { + this._selectedDate = DateUtil.clone(date); + this.currentDate = DateUtil.clone(date); + } + else { + this._selectedDate = undefined; + } + this.config.updateBounds(this._selectedDate || this.currentDate); + this.onManualUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarService.prototype, "minDate", { + get: function () { + if (this._minDate && this.config.dateMinBound) { + return this._minDate > this.config.dateMinBound ? this._minDate : this.config.dateMinBound; + } + return this._minDate || this.config.dateMinBound; + }, + set: function (min) { + this._minDate = min; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarService.prototype, "maxDate", { + get: function () { + if (this._maxDate && this.config.dateMaxBound) { + return this._maxDate < this.config.dateMaxBound ? this._maxDate : this.config.dateMaxBound; + } + return this._maxDate || this.config.dateMaxBound; + }, + set: function (max) { + this._maxDate = max; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarService.prototype, "firstDayOfWeek", { + get: function () { + return this._firstDayOfWeek; + }, + set: function (firstDayOfWeek) { + if (firstDayOfWeek != undefined) { + this._firstDayOfWeek = Math.max(0, Math.min(6, firstDayOfWeek)); + } + }, + enumerable: true, + configurable: true + }); + CalendarService.prototype.reset = function () { + this.currentView = this.config.mappings.finalView; + if (!this._selectedDate) { + var current = this.currentDate.getTime(); + if (this._minDate) { + current = Math.max(current, this._minDate.getTime()); + } + if (this._maxDate) { + current = Math.min(current, this._maxDate.getTime()); + } + this.currentDate = new Date(current); + this.config.updateBounds(this.currentDate); + this.currentView = this.config.mappings.initialView; + } + }; + CalendarService.prototype.changeDate = function (date, fromView) { + this.currentDate = date; + if (fromView === this.config.mappings.finalView) { + this.selectedDate = date; + return this.onDateChange.emit(date); + } + this.updateView(this.config.mappings.changed, fromView); + }; + CalendarService.prototype.zoomOut = function (fromView) { + this.updateView(this.config.mappings.zoom, fromView); + }; + CalendarService.prototype.updateView = function (mappings, fromView) { + var mapping = mappings.get(fromView); + if (mapping == undefined) { + throw new Error("Unknown view type."); + } + this.currentView = mapping; + }; + return CalendarService; +}()); + +var CalendarItem = /** @class */ (function () { + function CalendarItem(date) { + this.date = date; + } + return CalendarItem; +}()); +var SuiCalendarItem = /** @class */ (function () { + function SuiCalendarItem(changeDetector) { + this.changeDetector = changeDetector; + this.hasFocus = false; + this.onFocussed = new _angular_core.EventEmitter(); + } + Object.defineProperty(SuiCalendarItem.prototype, "isSelectable", { + get: function () { + return this.item.isSelectable; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCalendarItem.prototype, "isActive", { + get: function () { + return this.item.isActive; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCalendarItem.prototype, "isToday", { + get: function () { + return this.item.isToday; + }, + enumerable: true, + configurable: true + }); + SuiCalendarItem.prototype.onMouseMove = function () { + if (!this.hasFocus) { + this.hasFocus = true; + this.onFocussed.emit(this.hasFocus); + } + }; + SuiCalendarItem.prototype.onMouseLeave = function () { + this.hasFocus = false; + this.onFocussed.emit(this.hasFocus); + }; + SuiCalendarItem.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "[calendarItem]" + },] }, + ]; + /** @nocollapse */ + SuiCalendarItem.ctorParameters = function () { return [ + { type: _angular_core.ChangeDetectorRef, }, + ]; }; + SuiCalendarItem.propDecorators = { + "item": [{ type: _angular_core.Input, args: ["calendarItem",] },], + "isSelectable": [{ type: _angular_core.HostBinding, args: ["class.disabled",] },], + "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], + "isToday": [{ type: _angular_core.HostBinding, args: ["class.today",] },], + "hasFocus": [{ type: _angular_core.HostBinding, args: ["class.focus",] },], + "onMouseMove": [{ type: _angular_core.HostListener, args: ["mousemove",] },], + "onMouseLeave": [{ type: _angular_core.HostListener, args: ["mouseleave",] },], + }; + return SuiCalendarItem; +}()); + +(function (CalendarViewType) { + CalendarViewType[CalendarViewType["Year"] = 0] = "Year"; + CalendarViewType[CalendarViewType["Month"] = 1] = "Month"; + CalendarViewType[CalendarViewType["Date"] = 2] = "Date"; + CalendarViewType[CalendarViewType["Hour"] = 3] = "Hour"; + CalendarViewType[CalendarViewType["Minute"] = 4] = "Minute"; +})(exports.CalendarViewType || (exports.CalendarViewType = {})); +var CalendarView = /** @class */ (function () { + function CalendarView(renderer, viewType, ranges) { + var _this = this; + this._type = viewType; + this.ranges = ranges; + this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); + } + Object.defineProperty(CalendarView.prototype, "service", { + get: function () { + return this._service; + }, + set: function (service) { + var _this = this; + this._service = service; + this.ranges.loadService(service); + this.service.onManualUpdate = function () { + _this.ranges.refresh(); + delete _this._highlightedItem; + _this.autoHighlight(); + }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarView.prototype, "currentDate", { + get: function () { + return this.service.currentDate; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarView.prototype, "selectedDate", { + get: function () { + return this.service.selectedDate; + }, + enumerable: true, + configurable: true + }); + // Template Methods + // Template Methods + CalendarView.prototype.setDate = + // Template Methods + function (item) { + this.service.changeDate(item.date, this._type); + }; + CalendarView.prototype.zoomOut = function () { + this.service.zoomOut(this._type); + }; + // Keyboard Control + // Keyboard Control + CalendarView.prototype.ngAfterViewInit = + // Keyboard Control + function () { + var _this = this; + this._renderedItems.changes.subscribe(function () { return _this.onRenderedItemsChanged(); }); + this.onRenderedItemsChanged(); + }; + CalendarView.prototype.onRenderedItemsChanged = function () { + var _this = this; + this._renderedItems.forEach(function (i) { + return i.onFocussed.subscribe(function (hasFocus) { + if (hasFocus) { + _this.highlightItem(i.item); + } + }); + }); + this.autoHighlight(); + this.highlightItem(this._highlightedItem); + }; + CalendarView.prototype.autoHighlight = function () { + var _this = this; + var date = this.selectedDate && this.ranges.current.containsDate(this.selectedDate) ? this.selectedDate : this.currentDate; + if (this._highlightedItem && this.ranges.current.containsDate(this._highlightedItem.date)) { + date = this._highlightedItem.date; + } + var initiallyHighlighted = this.ranges.current.items.find(function (i) { return _this.ranges.dateComparer.equal(i.date, date); }); + if (initiallyHighlighted && !initiallyHighlighted.isDisabled) { + this._highlightedItem = initiallyHighlighted; + } + }; + CalendarView.prototype.highlightItem = function (item) { + if (item) { + this._renderedItems.forEach(function (i) { return i.hasFocus = false; }); + var rendered = this._renderedItems.find(function (ri) { return ri.item === item; }); + if (rendered && !rendered.hasFocus) { + rendered.hasFocus = true; + rendered.changeDetector.detectChanges(); + } + this._highlightedItem = item; + } + }; + CalendarView.prototype.onDocumentKeyDown = function (e) { + if (this._highlightedItem && e.keyCode === exports.KeyCode.Enter) { + this.setDate(this._highlightedItem); + return; + } + if (!this._highlightedItem) { + this.autoHighlight(); + } + var index = this.ranges.current.findIndex(this._highlightedItem); + var isMovingForward = true; + var delta = 0; + switch (e.keyCode) { + case exports.KeyCode.Right: + delta += 1; + break; + case exports.KeyCode.Left: + delta -= 1; + isMovingForward = false; + break; + case exports.KeyCode.Down: + delta += this.ranges.columns; + break; + case exports.KeyCode.Up: + delta -= this.ranges.columns; + isMovingForward = false; + break; + default: + return; + } + // Stop these keypresses being captured elsewhere. + e.preventDefault(); + var nextItem = this.ranges.current.items[index + delta]; + if (nextItem && nextItem.isDisabled) { + return; + } + if (nextItem && !nextItem.isOutsideRange) { + return this.highlightItem(nextItem); + } + if (nextItem && nextItem.isOutsideRange) { + if (index + delta >= this.ranges.current.inRange.length) { + isMovingForward = true; + } + } + if (!nextItem) { + var adjustedIndex = this.ranges.current.findIndex(this._highlightedItem); + var nextItems = this.ranges.calc(isMovingForward).inRange; + if (isMovingForward) { + adjustedIndex -= this.ranges.current.inRange.length; + } + else { + adjustedIndex += nextItems.length; + } + nextItem = nextItems[adjustedIndex + delta]; + if (nextItem.isDisabled) { + return; + } + } + this.ranges.move(isMovingForward); + this._highlightedItem = this.ranges.current.find(nextItem); + }; + CalendarView.prototype.ngOnDestroy = function () { + this._documentKeyDownListener(); + }; + CalendarView.propDecorators = { + "_renderedItems": [{ type: _angular_core.ViewChildren, args: [SuiCalendarItem,] },], + "service": [{ type: _angular_core.Input },], + }; + return CalendarView; +}()); + +var __extends$3 = (undefined && undefined.__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 __()); + }; +})(); +var CalendarMappings = /** @class */ (function () { + function CalendarMappings() { + } + return CalendarMappings; +}()); +var DateMappings = /** @class */ (function (_super) { + __extends$3(DateMappings, _super); + function DateMappings() { + var _this = _super.call(this) || this; + _this.initialView = exports.CalendarViewType.Date; + _this.finalView = exports.CalendarViewType.Date; + _this.changed = new Map([ + [exports.CalendarViewType.Year, exports.CalendarViewType.Month], + [exports.CalendarViewType.Month, exports.CalendarViewType.Date], + [exports.CalendarViewType.Date, exports.CalendarViewType.Date] + ]); + _this.zoom = new Map([ + [exports.CalendarViewType.Year, exports.CalendarViewType.Date], + [exports.CalendarViewType.Month, exports.CalendarViewType.Year], + [exports.CalendarViewType.Date, exports.CalendarViewType.Month] + ]); + return _this; + } + return DateMappings; +}(CalendarMappings)); +var TimeMappings = /** @class */ (function (_super) { + __extends$3(TimeMappings, _super); + function TimeMappings() { + var _this = _super.call(this) || this; + _this.initialView = exports.CalendarViewType.Hour; + _this.finalView = exports.CalendarViewType.Minute; + _this.changed = new Map([ + [exports.CalendarViewType.Hour, exports.CalendarViewType.Minute], + [exports.CalendarViewType.Minute, exports.CalendarViewType.Minute] + ]); + _this.zoom = new Map([ + [exports.CalendarViewType.Hour, exports.CalendarViewType.Minute], + [exports.CalendarViewType.Minute, exports.CalendarViewType.Hour] + ]); + return _this; + } + return TimeMappings; +}(CalendarMappings)); +var DatetimeMappings = /** @class */ (function (_super) { + __extends$3(DatetimeMappings, _super); + function DatetimeMappings() { + var _this = _super.call(this) || this; + _this.initialView = exports.CalendarViewType.Date; + _this.finalView = exports.CalendarViewType.Minute; + _this.changed = new Map([ + [exports.CalendarViewType.Year, exports.CalendarViewType.Month], + [exports.CalendarViewType.Month, exports.CalendarViewType.Date], + [exports.CalendarViewType.Date, exports.CalendarViewType.Hour], + [exports.CalendarViewType.Hour, exports.CalendarViewType.Minute], + [exports.CalendarViewType.Minute, exports.CalendarViewType.Minute] + ]); + _this.zoom = new Map([ + [exports.CalendarViewType.Year, exports.CalendarViewType.Date], + [exports.CalendarViewType.Month, exports.CalendarViewType.Year], + [exports.CalendarViewType.Date, exports.CalendarViewType.Month], + [exports.CalendarViewType.Hour, exports.CalendarViewType.Date], + [exports.CalendarViewType.Minute, exports.CalendarViewType.Hour] + ]); + return _this; + } + return DatetimeMappings; +}(CalendarMappings)); +var MonthMappings = /** @class */ (function (_super) { + __extends$3(MonthMappings, _super); + function MonthMappings() { + var _this = _super.call(this) || this; + _this.initialView = exports.CalendarViewType.Month; + _this.finalView = exports.CalendarViewType.Month; + _this.changed = new Map([ + [exports.CalendarViewType.Year, exports.CalendarViewType.Month], + [exports.CalendarViewType.Month, exports.CalendarViewType.Month] + ]); + _this.zoom = new Map([ + [exports.CalendarViewType.Year, exports.CalendarViewType.Month], + [exports.CalendarViewType.Month, exports.CalendarViewType.Year] + ]); + return _this; + } + return MonthMappings; +}(CalendarMappings)); +var YearMappings = /** @class */ (function (_super) { + __extends$3(YearMappings, _super); + function YearMappings() { + var _this = _super.call(this) || this; + _this.initialView = exports.CalendarViewType.Year; + _this.finalView = exports.CalendarViewType.Year; + _this.changed = new Map([ + [exports.CalendarViewType.Year, exports.CalendarViewType.Year] + ]); + _this.zoom = new Map([ + [exports.CalendarViewType.Year, exports.CalendarViewType.Year] + ]); + return _this; + } + return YearMappings; +}(CalendarMappings)); + +var __extends$2 = (undefined && undefined.__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 __()); + }; +})(); +var CalendarConfig = /** @class */ (function () { + function CalendarConfig(mode, precision, mappings, fallback) { + this.mode = mode; + this.precision = precision; + this.mappings = mappings; + this.fallback = fallback; + } + CalendarConfig.prototype.updateBounds = function (providedDate) { + this.dateMinBound = DateUtil.startOf(exports.DatePrecision.Year, new Date(), true); + this.dateMinBound.setFullYear(0); + }; + return CalendarConfig; +}()); +var DateConfigBase = /** @class */ (function (_super) { + __extends$2(DateConfigBase, _super); + function DateConfigBase(precision, mappings, fallback) { + return _super.call(this, exports.CalendarMode.DateOnly, precision, mappings, fallback) || this; + } + return DateConfigBase; +}(CalendarConfig)); +var YearConfig = /** @class */ (function (_super) { + __extends$2(YearConfig, _super); + function YearConfig() { + return _super.call(this, exports.DatePrecision.Year, new YearMappings(), "number") || this; + } + return YearConfig; +}(DateConfigBase)); +var MonthConfig = /** @class */ (function (_super) { + __extends$2(MonthConfig, _super); + function MonthConfig() { + return _super.call(this, exports.DatePrecision.Month, new MonthMappings(), "month") || this; + } + return MonthConfig; +}(DateConfigBase)); +var DateConfig = /** @class */ (function (_super) { + __extends$2(DateConfig, _super); + function DateConfig() { + return _super.call(this, exports.DatePrecision.Date, new DateMappings(), "date") || this; + } + return DateConfig; +}(DateConfigBase)); +var DatetimeConfig = /** @class */ (function (_super) { + __extends$2(DatetimeConfig, _super); + function DatetimeConfig() { + return _super.call(this, exports.CalendarMode.Both, exports.DatePrecision.Minute, new DatetimeMappings(), "datetime-local") || this; + } + return DatetimeConfig; +}(CalendarConfig)); +var TimeConfig = /** @class */ (function (_super) { + __extends$2(TimeConfig, _super); + function TimeConfig() { + return _super.call(this, exports.CalendarMode.TimeOnly, exports.DatePrecision.Minute, new TimeMappings(), "time") || this; + } + TimeConfig.prototype.updateBounds = function (providedDate) { + this.dateMaxBound = DateUtil.endOf(exports.DatePrecision.Date, DateUtil.clone(providedDate)); + this.dateMinBound = DateUtil.previous(exports.DatePrecision.Date, DateUtil.clone(this.dateMaxBound)); + }; + return TimeConfig; +}(CalendarConfig)); + +var DateComparer = /** @class */ (function () { + function DateComparer(precision, isSmallest) { + this._precision = precision; + this._isSmallest = isSmallest; + } + DateComparer.prototype.equal = function (a, b) { + if (this._precision === exports.DatePrecision.Minute) { + return !!b && + DateUtil.equal(exports.DatePrecision.Hour, b, a) && + Util.Math.roundDown(b.getMinutes(), 5) === Util.Math.roundDown(a.getMinutes(), 5); + } + return !!b && DateUtil.equal(this._precision, a, b); + }; + DateComparer.prototype.lessThan = function (a, b) { + if (this._isSmallest) { + return !b || (b >= a); + } + return !b || (DateUtil.endOf(this._precision, DateUtil.clone(b)) >= a); + }; + DateComparer.prototype.greaterThan = function (a, b) { + if (this._isSmallest) { + return !b || (b <= a); + } + return !b || (DateUtil.startOf(this._precision, DateUtil.clone(b)) <= a); + }; + DateComparer.prototype.between = function (date, left, right) { + return this.greaterThan(date, left) && this.lessThan(date, right); + }; + return DateComparer; +}()); + +var MILLISECONDS_IN_HOUR = 3600000; +var MILLISECONDS_IN_MINUTE = 60000; +var DEFAULT_ADDITIONAL_DIGITS = 2; + +var patterns = { + dateTimeDelimeter: /[T ]/, + plainTime: /:/, + + // year tokens + YY: /^(\d{2})$/, + YYY: [ + /^([+-]\d{2})$/, // 0 additional digits + /^([+-]\d{3})$/, // 1 additional digit + /^([+-]\d{4})$/ // 2 additional digits + ], + YYYY: /^(\d{4})/, + YYYYY: [ + /^([+-]\d{4})/, // 0 additional digits + /^([+-]\d{5})/, // 1 additional digit + /^([+-]\d{6})/ // 2 additional digits + ], + + // date tokens + MM: /^-(\d{2})$/, + DDD: /^-?(\d{3})$/, + MMDD: /^-?(\d{2})-?(\d{2})$/, + Www: /^-?W(\d{2})$/, + WwwD: /^-?W(\d{2})-?(\d{1})$/, + + HH: /^(\d{2}([.,]\d*)?)$/, + HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/, + HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/, + + // timezone tokens + timezone: /([Z+-].*)$/, + timezoneZ: /^(Z)$/, + timezoneHH: /^([+-])(\d{2})$/, + timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/ +}; + +/** + * @name toDate + * @category Common Helpers + * @summary Convert the given argument to an instance of Date. + * + * @description + * Convert the given argument to an instance of Date. + * + * If the argument is an instance of Date, the function returns its clone. + * + * If the argument is a number, it is treated as a timestamp. + * + * If an argument is a string, the function tries to parse it. + * Function accepts complete ISO 8601 formats as well as partial implementations. + * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 + * + * If all above fails, the function passes the given argument to Date constructor. + * + * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`. + * All *date-fns* functions will throw `RangeError` if `options.additionalDigits` is not 0, 1, 2 or undefined. + * + * @param {Date|String|Number} argument - the value to convert + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format + * @returns {Date} the parsed date in the local time zone + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Convert string '2014-02-11T11:30:30' to date: + * var result = toDate('2014-02-11T11:30:30') + * //=> Tue Feb 11 2014 11:30:30 + * + * @example + * // Convert string '+02014101' to date, + * // if the additional number of digits in the extended year format is 1: + * var result = toDate('+02014101', {additionalDigits: 1}) + * //=> Fri Apr 11 2014 00:00:00 + */ +function toDate (argument, dirtyOptions) { + var options = dirtyOptions || {}; + + var additionalDigits = options.additionalDigits === undefined ? DEFAULT_ADDITIONAL_DIGITS : Number(options.additionalDigits); + if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) { + throw new RangeError('additionalDigits must be 0, 1 or 2') + } + + // Clone the date + if (argument instanceof Date) { + // Prevent the date to lose the milliseconds when passed to new Date() in IE10 + return new Date(argument.getTime()) + } else if (typeof argument !== 'string') { + return new Date(argument) + } + + var dateStrings = splitDateString(argument); + + var parseYearResult = parseYear(dateStrings.date, additionalDigits); + var year = parseYearResult.year; + var restDateString = parseYearResult.restDateString; + + var date = parseDate(restDateString, year); + + if (date) { + var timestamp = date.getTime(); + var time = 0; + var offset; + + if (dateStrings.time) { + time = parseTime(dateStrings.time); + } + + if (dateStrings.timezone) { + offset = parseTimezone(dateStrings.timezone); + } else { + // get offset accurate to hour in timezones that change offset + offset = new Date(timestamp + time).getTimezoneOffset(); + offset = new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE).getTimezoneOffset(); + } + + return new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE) + } else { + return new Date(argument) + } +} + +function splitDateString (dateString) { + var dateStrings = {}; + var array = dateString.split(patterns.dateTimeDelimeter); + var timeString; + + if (patterns.plainTime.test(array[0])) { + dateStrings.date = null; + timeString = array[0]; + } else { + dateStrings.date = array[0]; + timeString = array[1]; + } + + if (timeString) { + var token = patterns.timezone.exec(timeString); + if (token) { + dateStrings.time = timeString.replace(token[1], ''); + dateStrings.timezone = token[1]; + } else { + dateStrings.time = timeString; + } + } + + return dateStrings +} + +function parseYear (dateString, additionalDigits) { + var patternYYY = patterns.YYY[additionalDigits]; + var patternYYYYY = patterns.YYYYY[additionalDigits]; + + var token; + + // YYYY or ±YYYYY + token = patterns.YYYY.exec(dateString) || patternYYYYY.exec(dateString); + if (token) { + var yearString = token[1]; + return { + year: parseInt(yearString, 10), + restDateString: dateString.slice(yearString.length) + } + } + + // YY or ±YYY + token = patterns.YY.exec(dateString) || patternYYY.exec(dateString); + if (token) { + var centuryString = token[1]; + return { + year: parseInt(centuryString, 10) * 100, + restDateString: dateString.slice(centuryString.length) + } + } + + // Invalid ISO-formatted year + return { + year: null + } +} + +function parseDate (dateString, year) { + // Invalid ISO-formatted year + if (year === null) { + return null + } + + var token; + var date; + var month; + var week; + + // YYYY + if (dateString.length === 0) { + date = new Date(0); + date.setUTCFullYear(year); + return date + } + + // YYYY-MM + token = patterns.MM.exec(dateString); + if (token) { + date = new Date(0); + month = parseInt(token[1], 10) - 1; + date.setUTCFullYear(year, month); + return date + } + + // YYYY-DDD or YYYYDDD + token = patterns.DDD.exec(dateString); + if (token) { + date = new Date(0); + var dayOfYear = parseInt(token[1], 10); + date.setUTCFullYear(year, 0, dayOfYear); + return date + } + + // YYYY-MM-DD or YYYYMMDD + token = patterns.MMDD.exec(dateString); + if (token) { + date = new Date(0); + month = parseInt(token[1], 10) - 1; + var day = parseInt(token[2], 10); + date.setUTCFullYear(year, month, day); + return date + } + + // YYYY-Www or YYYYWww + token = patterns.Www.exec(dateString); + if (token) { + week = parseInt(token[1], 10) - 1; + return dayOfISOYear(year, week) + } + + // YYYY-Www-D or YYYYWwwD + token = patterns.WwwD.exec(dateString); + if (token) { + week = parseInt(token[1], 10) - 1; + var dayOfWeek = parseInt(token[2], 10) - 1; + return dayOfISOYear(year, week, dayOfWeek) + } + + // Invalid ISO-formatted date + return null +} + +function parseTime (timeString) { + var token; + var hours; + var minutes; + + // hh + token = patterns.HH.exec(timeString); + if (token) { + hours = parseFloat(token[1].replace(',', '.')); + return (hours % 24) * MILLISECONDS_IN_HOUR + } + + // hh:mm or hhmm + token = patterns.HHMM.exec(timeString); + if (token) { + hours = parseInt(token[1], 10); + minutes = parseFloat(token[2].replace(',', '.')); + return (hours % 24) * MILLISECONDS_IN_HOUR + + minutes * MILLISECONDS_IN_MINUTE + } + + // hh:mm:ss or hhmmss + token = patterns.HHMMSS.exec(timeString); + if (token) { + hours = parseInt(token[1], 10); + minutes = parseInt(token[2], 10); + var seconds = parseFloat(token[3].replace(',', '.')); + return (hours % 24) * MILLISECONDS_IN_HOUR + + minutes * MILLISECONDS_IN_MINUTE + + seconds * 1000 + } + + // Invalid ISO-formatted time + return null +} + +function parseTimezone (timezoneString) { + var token; + var absoluteOffset; + + // Z + token = patterns.timezoneZ.exec(timezoneString); + if (token) { + return 0 + } + + // ±hh + token = patterns.timezoneHH.exec(timezoneString); + if (token) { + absoluteOffset = parseInt(token[2], 10) * 60; + return (token[1] === '+') ? -absoluteOffset : absoluteOffset + } + + // ±hh:mm or ±hhmm + token = patterns.timezoneHHMM.exec(timezoneString); + if (token) { + absoluteOffset = parseInt(token[2], 10) * 60 + parseInt(token[3], 10); + return (token[1] === '+') ? -absoluteOffset : absoluteOffset + } + + return 0 +} + +function dayOfISOYear (isoYear, week, day) { + week = week || 0; + day = day || 0; + var date = new Date(0); + date.setUTCFullYear(isoYear, 0, 4); + var fourthOfJanuaryDay = date.getUTCDay() || 7; + var diff = week * 7 + day + 1 - fourthOfJanuaryDay; + date.setUTCDate(date.getUTCDate() + diff); + return date +} + +/** + * @name addMilliseconds + * @category Millisecond Helpers + * @summary Add the specified number of milliseconds to the given date. + * + * @description + * Add the specified number of milliseconds to the given date. + * + * @param {Date|String|Number} date - the date to be changed + * @param {Number} amount - the amount of milliseconds to be added + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Date} the new date with the milliseconds added + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Add 750 milliseconds to 10 July 2014 12:45:30.000: + * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) + * //=> Thu Jul 10 2014 12:45:30.750 + */ +function addMilliseconds (dirtyDate, dirtyAmount, dirtyOptions) { + var timestamp = toDate(dirtyDate, dirtyOptions).getTime(); + var amount = Number(dirtyAmount); + return new Date(timestamp + amount) +} + +function cloneObject (dirtyObject) { + dirtyObject = dirtyObject || {}; + var object = {}; + + for (var property in dirtyObject) { + if (dirtyObject.hasOwnProperty(property)) { + object[property] = dirtyObject[property]; + } + } + + return object +} + +var MILLISECONDS_IN_MINUTE$2 = 60000; + +/** + * @name addMinutes + * @category Minute Helpers + * @summary Add the specified number of minutes to the given date. + * + * @description + * Add the specified number of minutes to the given date. + * + * @param {Date|String|Number} date - the date to be changed + * @param {Number} amount - the amount of minutes to be added + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Date} the new date with the minutes added + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Add 30 minutes to 10 July 2014 12:00:00: + * var result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) + * //=> Thu Jul 10 2014 12:30:00 + */ +function addMinutes (dirtyDate, dirtyAmount, dirtyOptions) { + var amount = Number(dirtyAmount); + return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE$2, dirtyOptions) +} + +/** + * @name isValid + * @category Common Helpers + * @summary Is the given date valid? + * + * @description + * Returns false if argument is Invalid Date and true otherwise. + * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * Invalid Date is a Date, whose time value is NaN. + * + * Time value of Date: http://es5.github.io/#x15.9.1.1 + * + * @param {Date|String|Number} date - the date to check + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Boolean} the date is valid + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // For the valid date: + * var result = isValid(new Date(2014, 1, 31)) + * //=> true + * + * @example + * // For the value, convertable into a date: + * var result = isValid('2014-02-31') + * //=> true + * + * @example + * // For the invalid date: + * var result = isValid(new Date('')) + * //=> false + */ +function isValid (dirtyDate, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + return !isNaN(date) +} + +var formatDistanceLocale = { + lessThanXSeconds: { + one: 'less than a second', + other: 'less than {{count}} seconds' + }, + + xSeconds: { + one: '1 second', + other: '{{count}} seconds' + }, + + halfAMinute: 'half a minute', + + lessThanXMinutes: { + one: 'less than a minute', + other: 'less than {{count}} minutes' + }, + + xMinutes: { + one: '1 minute', + other: '{{count}} minutes' + }, + + aboutXHours: { + one: 'about 1 hour', + other: 'about {{count}} hours' + }, + + xHours: { + one: '1 hour', + other: '{{count}} hours' + }, + + xDays: { + one: '1 day', + other: '{{count}} days' + }, + + aboutXMonths: { + one: 'about 1 month', + other: 'about {{count}} months' + }, + + xMonths: { + one: '1 month', + other: '{{count}} months' + }, + + aboutXYears: { + one: 'about 1 year', + other: 'about {{count}} years' + }, + + xYears: { + one: '1 year', + other: '{{count}} years' + }, + + overXYears: { + one: 'over 1 year', + other: 'over {{count}} years' + }, + + almostXYears: { + one: 'almost 1 year', + other: 'almost {{count}} years' + } +}; + +function formatDistance (token, count, options) { + options = options || {}; + + var result; + if (typeof formatDistanceLocale[token] === 'string') { + result = formatDistanceLocale[token]; + } else if (count === 1) { + result = formatDistanceLocale[token].one; + } else { + result = formatDistanceLocale[token].other.replace('{{count}}', count); + } + + if (options.addSuffix) { + if (options.comparison > 0) { + return 'in ' + result + } else { + return result + ' ago' + } + } + + return result +} + +var tokensToBeShortedPattern = /MMMM|MM|DD|dddd/g; + +function buildShortLongFormat (format) { + return format.replace(tokensToBeShortedPattern, function (token) { + return token.slice(1) + }) +} + +/** + * @name buildFormatLongFn + * @category Locale Helpers + * @summary Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. + * + * @description + * Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. + * Returns a function which takes one of the following tokens as the argument: + * `'LTS'`, `'LT'`, `'L'`, `'LL'`, `'LLL'`, `'l'`, `'ll'`, `'lll'`, `'llll'` + * and returns a long format string written as `format` token strings. + * See [format]{@link https://date-fns.org/docs/format} + * + * `'l'`, `'ll'`, `'lll'` and `'llll'` formats are built automatically + * by shortening some of the tokens from corresponding unshortened formats + * (e.g., if `LL` is `'MMMM DD YYYY'` then `ll` will be `MMM D YYYY`) + * + * @param {Object} obj - the object with long formats written as `format` token strings + * @param {String} obj.LT - time format: hours and minutes + * @param {String} obj.LTS - time format: hours, minutes and seconds + * @param {String} obj.L - short date format: numeric day, month and year + * @param {String} [obj.l] - short date format: numeric day, month and year (shortened) + * @param {String} obj.LL - long date format: day, month in words, and year + * @param {String} [obj.ll] - long date format: day, month in words, and year (shortened) + * @param {String} obj.LLL - long date and time format + * @param {String} [obj.lll] - long date and time format (shortened) + * @param {String} obj.LLLL - long date, time and weekday format + * @param {String} [obj.llll] - long date, time and weekday format (shortened) + * @returns {Function} `formatLong` property of the locale + * + * @example + * // For `en-US` locale: + * locale.formatLong = buildFormatLongFn({ + * LT: 'h:mm aa', + * LTS: 'h:mm:ss aa', + * L: 'MM/DD/YYYY', + * LL: 'MMMM D YYYY', + * LLL: 'MMMM D YYYY h:mm aa', + * LLLL: 'dddd, MMMM D YYYY h:mm aa' + * }) + */ +function buildFormatLongFn (obj) { + var formatLongLocale = { + LTS: obj.LTS, + LT: obj.LT, + L: obj.L, + LL: obj.LL, + LLL: obj.LLL, + LLLL: obj.LLLL, + l: obj.l || buildShortLongFormat(obj.L), + ll: obj.ll || buildShortLongFormat(obj.LL), + lll: obj.lll || buildShortLongFormat(obj.LLL), + llll: obj.llll || buildShortLongFormat(obj.LLLL) + }; + + return function (token) { + return formatLongLocale[token] + } +} + +var formatLong = buildFormatLongFn({ + LT: 'h:mm aa', + LTS: 'h:mm:ss aa', + L: 'MM/DD/YYYY', + LL: 'MMMM D YYYY', + LLL: 'MMMM D YYYY h:mm aa', + LLLL: 'dddd, MMMM D YYYY h:mm aa' +}); + +var formatRelativeLocale = { + lastWeek: '[last] dddd [at] LT', + yesterday: '[yesterday at] LT', + today: '[today at] LT', + tomorrow: '[tomorrow at] LT', + nextWeek: 'dddd [at] LT', + other: 'L' +}; + +function formatRelative (token, date, baseDate, options) { + return formatRelativeLocale[token] +} + +/** + * @name buildLocalizeFn + * @category Locale Helpers + * @summary Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale. + * + * @description + * Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale + * used by `format` function. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * + * `localize.weekday` function takes the weekday index as argument (0 - Sunday). + * `localize.month` takes the month index (0 - January). + * `localize.timeOfDay` takes the hours. Use `indexCallback` to convert them to an array index (see example). + * + * @param {Object} values - the object with arrays of values + * @param {String} defaultType - the default type for the localize function + * @param {Function} [indexCallback] - the callback which takes the resulting function argument + * and converts it into value array index + * @returns {Function} the resulting function + * + * @example + * var timeOfDayValues = { + * uppercase: ['AM', 'PM'], + * lowercase: ['am', 'pm'], + * long: ['a.m.', 'p.m.'] + * } + * locale.localize.timeOfDay = buildLocalizeFn(timeOfDayValues, 'long', function (hours) { + * // 0 is a.m. array index, 1 is p.m. array index + * return (hours / 12) >= 1 ? 1 : 0 + * }) + * locale.localize.timeOfDay(16, {type: 'uppercase'}) //=> 'PM' + * locale.localize.timeOfDay(5) //=> 'a.m.' + */ +function buildLocalizeFn$1 (values, defaultType, indexCallback) { + return function (dirtyIndex, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var valuesArray = values[type] || values[defaultType]; + var index = indexCallback ? indexCallback(Number(dirtyIndex)) : Number(dirtyIndex); + return valuesArray[index] + } +} + +/** + * @name buildLocalizeArrayFn + * @category Locale Helpers + * @summary Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. + * + * @description + * Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * + * @param {Object} values - the object with arrays of values + * @param {String} defaultType - the default type for the localize function + * @returns {Function} the resulting function + * + * @example + * var weekdayValues = { + * narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + * short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + * long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] + * } + * locale.localize.weekdays = buildLocalizeArrayFn(weekdayValues, 'long') + * locale.localize.weekdays({type: 'narrow'}) //=> ['Su', 'Mo', ...] + * locale.localize.weekdays() //=> ['Sunday', 'Monday', ...] + */ +function buildLocalizeArrayFn$1 (values, defaultType) { + return function (dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + return values[type] || values[defaultType] + } +} + +// Note: in English, the names of days of the week and months are capitalized. +// If you are making a new locale based on this one, check if the same is true for the language you're working on. +// Generally, formatted dates should look like they are in the middle of a sentence, +// e.g. in Spanish language the weekdays and months should be in the lowercase. +var weekdayValues = { + narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] +}; + +var monthValues = { + short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] +}; + +// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. +// Use the system which is used the most commonly in the locale. +// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: +// +// var timeOfDayValues = { +// any: ['in the night', 'in the morning', 'in the afternoon', 'in the evening'] +// } +// +// And later: +// +// var localize = { +// // The callback takes the hours as the argument and returns the array index +// timeOfDay: buildLocalizeFn(timeOfDayValues, 'any', function (hours) { +// if (hours >= 17) { +// return 3 +// } else if (hours >= 12) { +// return 2 +// } else if (hours >= 4) { +// return 1 +// } else { +// return 0 +// } +// }), +// timesOfDay: buildLocalizeArrayFn(timeOfDayValues, 'any') +// } +var timeOfDayValues = { + uppercase: ['AM', 'PM'], + lowercase: ['am', 'pm'], + long: ['a.m.', 'p.m.'] +}; + +function ordinalNumber (dirtyNumber, dirtyOptions) { + var number = Number(dirtyNumber); + + // If ordinal numbers depend on context, for example, + // if they are different for different grammatical genders, + // use `options.unit`: + // + // var options = dirtyOptions || {} + // var unit = String(options.unit) + // + // where `unit` can be 'month', 'quarter', 'week', 'isoWeek', 'dayOfYear', + // 'dayOfMonth' or 'dayOfWeek' + + var rem100 = number % 100; + if (rem100 > 20 || rem100 < 10) { + switch (rem100 % 10) { + case 1: + return number + 'st' + case 2: + return number + 'nd' + case 3: + return number + 'rd' + } + } + return number + 'th' +} + +var localize = { + ordinalNumber: ordinalNumber, + weekday: buildLocalizeFn$1(weekdayValues, 'long'), + weekdays: buildLocalizeArrayFn$1(weekdayValues, 'long'), + month: buildLocalizeFn$1(monthValues, 'long'), + months: buildLocalizeArrayFn$1(monthValues, 'long'), + timeOfDay: buildLocalizeFn$1(timeOfDayValues, 'long', function (hours) { + return (hours / 12) >= 1 ? 1 : 0 + }), + timesOfDay: buildLocalizeArrayFn$1(timeOfDayValues, 'long') +}; + +/** + * @name buildMatchFn + * @category Locale Helpers + * @summary Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale. + * + * @description + * Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale used by `parse` function. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * The result of the match function will be passed into corresponding parser function + * (`match.weekday`, `match.month` or `match.timeOfDay` respectively. See `buildParseFn`). + * + * @param {Object} values - the object with RegExps + * @param {String} defaultType - the default type for the match function + * @returns {Function} the resulting function + * + * @example + * var matchWeekdaysPatterns = { + * narrow: /^(su|mo|tu|we|th|fr|sa)/i, + * short: /^(sun|mon|tue|wed|thu|fri|sat)/i, + * long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i + * } + * locale.match.weekdays = buildMatchFn(matchWeekdaysPatterns, 'long') + * locale.match.weekdays('Sunday', {type: 'narrow'}) //=> ['Su', 'Su', ...] + * locale.match.weekdays('Sunday') //=> ['Sunday', 'Sunday', ...] + */ +function buildMatchFn$1 (patterns, defaultType) { + return function (dirtyString, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var pattern = patterns[type] || patterns[defaultType]; + var string = String(dirtyString); + return string.match(pattern) + } +} + +/** + * @name buildParseFn + * @category Locale Helpers + * @summary Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale. + * + * @description + * Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale used by `parse` function. + * The argument of the resulting function is the result of the corresponding match function + * (`match.weekdays`, `match.months` or `match.timesOfDay` respectively. See `buildMatchFn`). + * + * @param {Object} values - the object with arrays of RegExps + * @param {String} defaultType - the default type for the parser function + * @returns {Function} the resulting function + * + * @example + * var parseWeekdayPatterns = { + * any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] + * } + * locale.match.weekday = buildParseFn(matchWeekdaysPatterns, 'long') + * var matchResult = locale.match.weekdays('Friday') + * locale.match.weekday(matchResult) //=> 5 + */ +function buildParseFn$1 (patterns, defaultType) { + return function (matchResult, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var patternsArray = patterns[type] || patterns[defaultType]; + var string = matchResult[1]; + + return patternsArray.findIndex(function (pattern) { + return pattern.test(string) + }) + } +} + +/** + * @name buildMatchPatternFn + * @category Locale Helpers + * @summary Build match function from a single RegExp. + * + * @description + * Build match function from a single RegExp. + * Usually used for building `match.ordinalNumbers` property of the locale. + * + * @param {Object} pattern - the RegExp + * @returns {Function} the resulting function + * + * @example + * locale.match.ordinalNumbers = buildMatchPatternFn(/^(\d+)(th|st|nd|rd)?/i) + * locale.match.ordinalNumbers('3rd') //=> ['3rd', '3', 'rd', ...] + */ +function buildMatchPatternFn (pattern) { + return function (dirtyString) { + var string = String(dirtyString); + return string.match(pattern) + } +} + +/** + * @name parseDecimal + * @category Locale Helpers + * @summary Parses the match result into decimal number. + * + * @description + * Parses the match result into decimal number. + * Uses the string matched with the first set of parentheses of match RegExp. + * + * @param {Array} matchResult - the object returned by matching function + * @returns {Number} the parsed value + * + * @example + * locale.match = { + * ordinalNumbers: (dirtyString) { + * return String(dirtyString).match(/^(\d+)(th|st|nd|rd)?/i) + * }, + * ordinalNumber: parseDecimal + * } + */ +function parseDecimal (matchResult) { + return parseInt(matchResult[1], 10) +} + +var matchOrdinalNumbersPattern = /^(\d+)(th|st|nd|rd)?/i; + +var matchWeekdaysPatterns = { + narrow: /^(su|mo|tu|we|th|fr|sa)/i, + short: /^(sun|mon|tue|wed|thu|fri|sat)/i, + long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i +}; + +var parseWeekdayPatterns = { + any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] +}; + +var matchMonthsPatterns = { + short: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, + long: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i +}; + +var parseMonthPatterns = { + any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i] +}; + +// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. +// Use the system which is used the most commonly in the locale. +// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: +// +// var matchTimesOfDayPatterns = { +// long: /^((in the)? (night|morning|afternoon|evening?))/i +// } +// +// var parseTimeOfDayPatterns = { +// any: [/(night|morning)/i, /(afternoon|evening)/i] +// } +var matchTimesOfDayPatterns = { + short: /^(am|pm)/i, + long: /^([ap]\.?\s?m\.?)/i +}; + +var parseTimeOfDayPatterns = { + any: [/^a/i, /^p/i] +}; + +var match = { + ordinalNumbers: buildMatchPatternFn(matchOrdinalNumbersPattern), + ordinalNumber: parseDecimal, + weekdays: buildMatchFn$1(matchWeekdaysPatterns, 'long'), + weekday: buildParseFn$1(parseWeekdayPatterns, 'any'), + months: buildMatchFn$1(matchMonthsPatterns, 'long'), + month: buildParseFn$1(parseMonthPatterns, 'any'), + timesOfDay: buildMatchFn$1(matchTimesOfDayPatterns, 'long'), + timeOfDay: buildParseFn$1(parseTimeOfDayPatterns, 'any') +}; + +/** + * @type {Locale} + * @category Locales + * @summary English locale (United States). + * @language English + * @iso-639-2 eng + */ +var locale = { + formatDistance: formatDistance, + formatLong: formatLong, + formatRelative: formatRelative, + localize: localize, + match: match, + options: { + weekStartsOn: 0 /* Sunday */, + firstWeekContainsDate: 1 + } +}; + +var MILLISECONDS_IN_DAY$1 = 86400000; + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function getUTCDayOfYear (dirtyDate, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var timestamp = date.getTime(); + date.setUTCMonth(0, 1); + date.setUTCHours(0, 0, 0, 0); + var startOfYearTimestamp = date.getTime(); + var difference = timestamp - startOfYearTimestamp; + return Math.floor(difference / MILLISECONDS_IN_DAY$1) + 1 +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function startOfUTCISOWeek (dirtyDate, dirtyOptions) { + var weekStartsOn = 1; + + var date = toDate(dirtyDate, dirtyOptions); + var day = date.getUTCDay(); + var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; + + date.setUTCDate(date.getUTCDate() - diff); + date.setUTCHours(0, 0, 0, 0); + return date +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function getUTCISOWeekYear (dirtyDate, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var year = date.getUTCFullYear(); + + var fourthOfJanuaryOfNextYear = new Date(0); + fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); + fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); + var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear, dirtyOptions); + + var fourthOfJanuaryOfThisYear = new Date(0); + fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); + fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); + var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear, dirtyOptions); + + if (date.getTime() >= startOfNextYear.getTime()) { + return year + 1 + } else if (date.getTime() >= startOfThisYear.getTime()) { + return year + } else { + return year - 1 + } +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function startOfUTCISOWeekYear (dirtyDate, dirtyOptions) { + var year = getUTCISOWeekYear(dirtyDate, dirtyOptions); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setUTCFullYear(year, 0, 4); + fourthOfJanuary.setUTCHours(0, 0, 0, 0); + var date = startOfUTCISOWeek(fourthOfJanuary, dirtyOptions); + return date +} + +var MILLISECONDS_IN_WEEK$2 = 604800000; + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function getUTCISOWeek (dirtyDate, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var diff = startOfUTCISOWeek(date, dirtyOptions).getTime() - startOfUTCISOWeekYear(date, dirtyOptions).getTime(); + + // Round the number of days to the nearest integer + // because the number of milliseconds in a week is not constant + // (e.g. it's different in the week of the daylight saving time clock shift) + return Math.round(diff / MILLISECONDS_IN_WEEK$2) + 1 +} + +var formatters = { + // Month: 1, 2, ..., 12 + 'M': function (date) { + return date.getUTCMonth() + 1 + }, + + // Month: 1st, 2nd, ..., 12th + 'Mo': function (date, options) { + var month = date.getUTCMonth() + 1; + return options.locale.localize.ordinalNumber(month, {unit: 'month'}) + }, + + // Month: 01, 02, ..., 12 + 'MM': function (date) { + return addLeadingZeros(date.getUTCMonth() + 1, 2) + }, + + // Month: Jan, Feb, ..., Dec + 'MMM': function (date, options) { + return options.locale.localize.month(date.getUTCMonth(), {type: 'short'}) + }, + + // Month: January, February, ..., December + 'MMMM': function (date, options) { + return options.locale.localize.month(date.getUTCMonth(), {type: 'long'}) + }, + + // Quarter: 1, 2, 3, 4 + 'Q': function (date) { + return Math.ceil((date.getUTCMonth() + 1) / 3) + }, + + // Quarter: 1st, 2nd, 3rd, 4th + 'Qo': function (date, options) { + var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); + return options.locale.localize.ordinalNumber(quarter, {unit: 'quarter'}) + }, + + // Day of month: 1, 2, ..., 31 + 'D': function (date) { + return date.getUTCDate() + }, + + // Day of month: 1st, 2nd, ..., 31st + 'Do': function (date, options) { + return options.locale.localize.ordinalNumber(date.getUTCDate(), {unit: 'dayOfMonth'}) + }, + + // Day of month: 01, 02, ..., 31 + 'DD': function (date) { + return addLeadingZeros(date.getUTCDate(), 2) + }, + + // Day of year: 1, 2, ..., 366 + 'DDD': function (date) { + return getUTCDayOfYear(date) + }, + + // Day of year: 1st, 2nd, ..., 366th + 'DDDo': function (date, options) { + return options.locale.localize.ordinalNumber(getUTCDayOfYear(date), {unit: 'dayOfYear'}) + }, + + // Day of year: 001, 002, ..., 366 + 'DDDD': function (date) { + return addLeadingZeros(getUTCDayOfYear(date), 3) + }, + + // Day of week: Su, Mo, ..., Sa + 'dd': function (date, options) { + return options.locale.localize.weekday(date.getUTCDay(), {type: 'narrow'}) + }, + + // Day of week: Sun, Mon, ..., Sat + 'ddd': function (date, options) { + return options.locale.localize.weekday(date.getUTCDay(), {type: 'short'}) + }, + + // Day of week: Sunday, Monday, ..., Saturday + 'dddd': function (date, options) { + return options.locale.localize.weekday(date.getUTCDay(), {type: 'long'}) + }, + + // Day of week: 0, 1, ..., 6 + 'd': function (date) { + return date.getUTCDay() + }, + + // Day of week: 0th, 1st, 2nd, ..., 6th + 'do': function (date, options) { + return options.locale.localize.ordinalNumber(date.getUTCDay(), {unit: 'dayOfWeek'}) + }, + + // Day of ISO week: 1, 2, ..., 7 + 'E': function (date) { + return date.getUTCDay() || 7 + }, + + // ISO week: 1, 2, ..., 53 + 'W': function (date) { + return getUTCISOWeek(date) + }, + + // ISO week: 1st, 2nd, ..., 53th + 'Wo': function (date, options) { + return options.locale.localize.ordinalNumber(getUTCISOWeek(date), {unit: 'isoWeek'}) + }, + + // ISO week: 01, 02, ..., 53 + 'WW': function (date) { + return addLeadingZeros(getUTCISOWeek(date), 2) + }, + + // Year: 00, 01, ..., 99 + 'YY': function (date) { + return addLeadingZeros(date.getUTCFullYear(), 4).substr(2) + }, + + // Year: 1900, 1901, ..., 2099 + 'YYYY': function (date) { + return addLeadingZeros(date.getUTCFullYear(), 4) + }, + + // ISO week-numbering year: 00, 01, ..., 99 + 'GG': function (date) { + return String(getUTCISOWeekYear(date)).substr(2) + }, + + // ISO week-numbering year: 1900, 1901, ..., 2099 + 'GGGG': function (date) { + return getUTCISOWeekYear(date) + }, + + // Hour: 0, 1, ... 23 + 'H': function (date) { + return date.getUTCHours() + }, + + // Hour: 00, 01, ..., 23 + 'HH': function (date) { + return addLeadingZeros(date.getUTCHours(), 2) + }, + + // Hour: 1, 2, ..., 12 + 'h': function (date) { + var hours = date.getUTCHours(); + if (hours === 0) { + return 12 + } else if (hours > 12) { + return hours % 12 + } else { + return hours + } + }, + + // Hour: 01, 02, ..., 12 + 'hh': function (date) { + return addLeadingZeros(formatters['h'](date), 2) + }, + + // Minute: 0, 1, ..., 59 + 'm': function (date) { + return date.getUTCMinutes() + }, + + // Minute: 00, 01, ..., 59 + 'mm': function (date) { + return addLeadingZeros(date.getUTCMinutes(), 2) + }, + + // Second: 0, 1, ..., 59 + 's': function (date) { + return date.getUTCSeconds() + }, + + // Second: 00, 01, ..., 59 + 'ss': function (date) { + return addLeadingZeros(date.getUTCSeconds(), 2) + }, + + // 1/10 of second: 0, 1, ..., 9 + 'S': function (date) { + return Math.floor(date.getUTCMilliseconds() / 100) + }, + + // 1/100 of second: 00, 01, ..., 99 + 'SS': function (date) { + return addLeadingZeros(Math.floor(date.getUTCMilliseconds() / 10), 2) + }, + + // Millisecond: 000, 001, ..., 999 + 'SSS': function (date) { + return addLeadingZeros(date.getUTCMilliseconds(), 3) + }, + + // Timezone: -01:00, +00:00, ... +12:00 + 'Z': function (date, options) { + var originalDate = options._originalDate || date; + return formatTimezone(originalDate.getTimezoneOffset(), ':') + }, + + // Timezone: -0100, +0000, ... +1200 + 'ZZ': function (date, options) { + var originalDate = options._originalDate || date; + return formatTimezone(originalDate.getTimezoneOffset()) + }, + + // Seconds timestamp: 512969520 + 'X': function (date, options) { + var originalDate = options._originalDate || date; + return Math.floor(originalDate.getTime() / 1000) + }, + + // Milliseconds timestamp: 512969520900 + 'x': function (date, options) { + var originalDate = options._originalDate || date; + return originalDate.getTime() + }, + + // AM, PM + 'A': function (date, options) { + return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'uppercase'}) + }, + + // am, pm + 'a': function (date, options) { + return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'lowercase'}) + }, + + // a.m., p.m. + 'aa': function (date, options) { + return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'long'}) + } +}; + +function formatTimezone (offset, delimeter) { + delimeter = delimeter || ''; + var sign = offset > 0 ? '-' : '+'; + var absOffset = Math.abs(offset); + var hours = Math.floor(absOffset / 60); + var minutes = absOffset % 60; + return sign + addLeadingZeros(hours, 2) + delimeter + addLeadingZeros(minutes, 2) +} + +function addLeadingZeros (number, targetLength) { + var output = Math.abs(number).toString(); + while (output.length < targetLength) { + output = '0' + output; + } + return output +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function addUTCMinutes (dirtyDate, dirtyAmount, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var amount = Number(dirtyAmount); + date.setUTCMinutes(date.getUTCMinutes() + amount); + return date +} + +var longFormattingTokensRegExp = /(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g; +var defaultFormattingTokensRegExp = /(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g; + +/** + * @name format + * @category Common Helpers + * @summary Format the date. + * + * @description + * Return the formatted date string in the given format. + * + * Accepted tokens: + * | Unit | Token | Result examples | + * |-------------------------|-------|----------------------------------| + * | Month | M | 1, 2, ..., 12 | + * | | Mo | 1st, 2nd, ..., 12th | + * | | MM | 01, 02, ..., 12 | + * | | MMM | Jan, Feb, ..., Dec | + * | | MMMM | January, February, ..., December | + * | Quarter | Q | 1, 2, 3, 4 | + * | | Qo | 1st, 2nd, 3rd, 4th | + * | Day of month | D | 1, 2, ..., 31 | + * | | Do | 1st, 2nd, ..., 31st | + * | | DD | 01, 02, ..., 31 | + * | Day of year | DDD | 1, 2, ..., 366 | + * | | DDDo | 1st, 2nd, ..., 366th | + * | | DDDD | 001, 002, ..., 366 | + * | Day of week | d | 0, 1, ..., 6 | + * | | do | 0th, 1st, ..., 6th | + * | | dd | Su, Mo, ..., Sa | + * | | ddd | Sun, Mon, ..., Sat | + * | | dddd | Sunday, Monday, ..., Saturday | + * | Day of ISO week | E | 1, 2, ..., 7 | + * | ISO week | W | 1, 2, ..., 53 | + * | | Wo | 1st, 2nd, ..., 53rd | + * | | WW | 01, 02, ..., 53 | + * | Year | YY | 00, 01, ..., 99 | + * | | YYYY | 1900, 1901, ..., 2099 | + * | ISO week-numbering year | GG | 00, 01, ..., 99 | + * | | GGGG | 1900, 1901, ..., 2099 | + * | AM/PM | A | AM, PM | + * | | a | am, pm | + * | | aa | a.m., p.m. | + * | Hour | H | 0, 1, ... 23 | + * | | HH | 00, 01, ... 23 | + * | | h | 1, 2, ..., 12 | + * | | hh | 01, 02, ..., 12 | + * | Minute | m | 0, 1, ..., 59 | + * | | mm | 00, 01, ..., 59 | + * | Second | s | 0, 1, ..., 59 | + * | | ss | 00, 01, ..., 59 | + * | 1/10 of second | S | 0, 1, ..., 9 | + * | 1/100 of second | SS | 00, 01, ..., 99 | + * | Millisecond | SSS | 000, 001, ..., 999 | + * | Timezone | Z | -01:00, +00:00, ... +12:00 | + * | | ZZ | -0100, +0000, ..., +1200 | + * | Seconds timestamp | X | 512969520 | + * | Milliseconds timestamp | x | 512969520900 | + * | Long format | LT | 05:30 a.m. | + * | | LTS | 05:30:15 a.m. | + * | | L | 07/02/1995 | + * | | l | 7/2/1995 | + * | | LL | July 2 1995 | + * | | ll | Jul 2 1995 | + * | | LLL | July 2 1995 05:30 a.m. | + * | | lll | Jul 2 1995 05:30 a.m. | + * | | LLLL | Sunday, July 2 1995 05:30 a.m. | + * | | llll | Sun, Jul 2 1995 05:30 a.m. | + * + * The characters wrapped in square brackets are escaped. + * + * The result may vary by locale. + * + * @param {Date|String|Number} date - the original date + * @param {String} format - the string of tokens + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @returns {String} the formatted date string + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * @throws {RangeError} `options.locale` must contain `localize` property + * @throws {RangeError} `options.locale` must contain `formatLong` property + * + * @example + * // Represent 11 February 2014 in middle-endian format: + * var result = format( + * new Date(2014, 1, 11), + * 'MM/DD/YYYY' + * ) + * //=> '02/11/2014' + * + * @example + * // Represent 2 July 2014 in Esperanto: + * import { eoLocale } from 'date-fns/locale/eo' + * var result = format( + * new Date(2014, 6, 2), + * 'Do [de] MMMM YYYY', + * {locale: eoLocale} + * ) + * //=> '2-a de julio 2014' + */ +function format (dirtyDate, dirtyFormatStr, dirtyOptions) { + var formatStr = String(dirtyFormatStr); + var options = dirtyOptions || {}; + + var locale$$1 = options.locale || locale; + + if (!locale$$1.localize) { + throw new RangeError('locale must contain localize property') + } + + if (!locale$$1.formatLong) { + throw new RangeError('locale must contain formatLong property') + } + + var localeFormatters = locale$$1.formatters || {}; + var formattingTokensRegExp = locale$$1.formattingTokensRegExp || defaultFormattingTokensRegExp; + var formatLong = locale$$1.formatLong; + + var originalDate = toDate(dirtyDate, options); + + if (!isValid(originalDate, options)) { + return 'Invalid Date' + } + + // Convert the date in system timezone to the same date in UTC+00:00 timezone. + // This ensures that when UTC functions will be implemented, locales will be compatible with them. + // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376 + var timezoneOffset = originalDate.getTimezoneOffset(); + var utcDate = addUTCMinutes(originalDate, -timezoneOffset, options); + + var formatterOptions = cloneObject(options); + formatterOptions.locale = locale$$1; + formatterOptions.formatters = formatters; + + // When UTC functions will be implemented, options._originalDate will likely be a part of public API. + // Right now, please don't use it in locales. If you have to use an original date, + // please restore it from `date`, adding a timezone offset to it. + formatterOptions._originalDate = originalDate; + + var result = formatStr + .replace(longFormattingTokensRegExp, function (substring) { + if (substring[0] === '[') { + return substring + } + + if (substring[0] === '\\') { + return cleanEscapedString(substring) + } + + return formatLong(substring) + }) + .replace(formattingTokensRegExp, function (substring) { + var formatter = localeFormatters[substring] || formatters[substring]; + + if (formatter) { + return formatter(utcDate, formatterOptions) + } else { + return cleanEscapedString(substring) + } + }); + + return result +} + +function cleanEscapedString (input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|]$/g, '') + } + return input.replace(/\\/g, '') +} + +/** + * @name subMinutes + * @category Minute Helpers + * @summary Subtract the specified number of minutes from the given date. + * + * @description + * Subtract the specified number of minutes from the given date. + * + * @param {Date|String|Number} date - the date to be changed + * @param {Number} amount - the amount of minutes to be subtracted + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Date} the new date with the mintues subtracted + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Subtract 30 minutes from 10 July 2014 12:00:00: + * var result = subMinutes(new Date(2014, 6, 10, 12, 0), 30) + * //=> Thu Jul 10 2014 11:30:00 + */ +function subMinutes (dirtyDate, dirtyAmount, dirtyOptions) { + var amount = Number(dirtyAmount); + return addMinutes(dirtyDate, -amount, dirtyOptions) +} + +var patterns$1 = { + 'M': /^(1[0-2]|0?\d)/, // 0 to 12 + 'D': /^(3[0-1]|[0-2]?\d)/, // 0 to 31 + 'DDD': /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366 + 'W': /^(5[0-3]|[0-4]?\d)/, // 0 to 53 + 'YYYY': /^(\d{1,4})/, // 0 to 9999 + 'H': /^(2[0-3]|[0-1]?\d)/, // 0 to 23 + 'm': /^([0-5]?\d)/, // 0 to 59 + 'Z': /^([+-])(\d{2}):(\d{2})/, + 'ZZ': /^([+-])(\d{2})(\d{2})/, + singleDigit: /^(\d)/, + twoDigits: /^(\d{2})/, + threeDigits: /^(\d{3})/, + fourDigits: /^(\d{4})/, + anyDigits: /^(\d+)/ +}; + +function parseDecimal$1 (matchResult) { + return parseInt(matchResult[1], 10) +} + +var parsers = { + // Year: 00, 01, ..., 99 + 'YY': { + unit: 'twoDigitYear', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) + } + }, + + // Year: 1900, 1901, ..., 2099 + 'YYYY': { + unit: 'year', + match: patterns$1.YYYY, + parse: parseDecimal$1 + }, + + // ISO week-numbering year: 00, 01, ..., 99 + 'GG': { + unit: 'isoYear', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) + 1900 + } + }, + + // ISO week-numbering year: 1900, 1901, ..., 2099 + 'GGGG': { + unit: 'isoYear', + match: patterns$1.YYYY, + parse: parseDecimal$1 + }, + + // Quarter: 1, 2, 3, 4 + 'Q': { + unit: 'quarter', + match: patterns$1.singleDigit, + parse: parseDecimal$1 + }, + + // Ordinal quarter + 'Qo': { + unit: 'quarter', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'quarter'}) + }, + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'quarter'}) + } + }, + + // Month: 1, 2, ..., 12 + 'M': { + unit: 'month', + match: patterns$1.M, + parse: function (matchResult) { + return parseDecimal$1(matchResult) - 1 + } + }, + + // Ordinal month + 'Mo': { + unit: 'month', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'month'}) + }, + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'month'}) - 1 + } + }, + + // Month: 01, 02, ..., 12 + 'MM': { + unit: 'month', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) - 1 + } + }, + + // Month: Jan, Feb, ..., Dec + 'MMM': { + unit: 'month', + match: function (string, options) { + return options.locale.match.months(string, {type: 'short'}) + }, + parse: function (matchResult, options) { + return options.locale.match.month(matchResult, {type: 'short'}) + } + }, + + // Month: January, February, ..., December + 'MMMM': { + unit: 'month', + match: function (string, options) { + return options.locale.match.months(string, {type: 'long'}) || + options.locale.match.months(string, {type: 'short'}) + }, + parse: function (matchResult, options) { + var parseResult = options.locale.match.month(matchResult, {type: 'long'}); + + if (parseResult == null) { + parseResult = options.locale.match.month(matchResult, {type: 'short'}); + } + + return parseResult + } + }, + + // ISO week: 1, 2, ..., 53 + 'W': { + unit: 'isoWeek', + match: patterns$1.W, + parse: parseDecimal$1 + }, + + // Ordinal ISO week + 'Wo': { + unit: 'isoWeek', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'isoWeek'}) + }, + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'isoWeek'}) + } + }, + + // ISO week: 01, 02, ..., 53 + 'WW': { + unit: 'isoWeek', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // Day of week: 0, 1, ..., 6 + 'd': { + unit: 'dayOfWeek', + match: patterns$1.singleDigit, + parse: parseDecimal$1 + }, + + // Ordinal day of week + 'do': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'dayOfWeek'}) + }, + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfWeek'}) + } + }, + + // Day of week: Su, Mo, ..., Sa + 'dd': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.weekdays(string, {type: 'narrow'}) + }, + parse: function (matchResult, options) { + return options.locale.match.weekday(matchResult, {type: 'narrow'}) + } + }, + + // Day of week: Sun, Mon, ..., Sat + 'ddd': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.weekdays(string, {type: 'short'}) || + options.locale.match.weekdays(string, {type: 'narrow'}) + }, + parse: function (matchResult, options) { + var parseResult = options.locale.match.weekday(matchResult, {type: 'short'}); + + if (parseResult == null) { + parseResult = options.locale.match.weekday(matchResult, {type: 'narrow'}); + } + + return parseResult + } + }, + + // Day of week: Sunday, Monday, ..., Saturday + 'dddd': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.weekdays(string, {type: 'long'}) || + options.locale.match.weekdays(string, {type: 'short'}) || + options.locale.match.weekdays(string, {type: 'narrow'}) + }, + parse: function (matchResult, options) { + var parseResult = options.locale.match.weekday(matchResult, {type: 'long'}); + + if (parseResult == null) { + parseResult = options.locale.match.weekday(matchResult, {type: 'short'}); + + if (parseResult == null) { + parseResult = options.locale.match.weekday(matchResult, {type: 'narrow'}); + } + } + + return parseResult + } + }, + + // Day of ISO week: 1, 2, ..., 7 + 'E': { + unit: 'dayOfISOWeek', + match: patterns$1.singleDigit, + parse: function (matchResult) { + return parseDecimal$1(matchResult) + } + }, + + // Day of month: 1, 2, ..., 31 + 'D': { + unit: 'dayOfMonth', + match: patterns$1.D, + parse: parseDecimal$1 + }, + + // Ordinal day of month + 'Do': { + unit: 'dayOfMonth', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'dayOfMonth'}) + }, + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfMonth'}) + } + }, + + // Day of month: 01, 02, ..., 31 + 'DD': { + unit: 'dayOfMonth', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // Day of year: 1, 2, ..., 366 + 'DDD': { + unit: 'dayOfYear', + match: patterns$1.DDD, + parse: parseDecimal$1 + }, + + // Ordinal day of year + 'DDDo': { + unit: 'dayOfYear', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'dayOfYear'}) + }, + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfYear'}) + } + }, + + // Day of year: 001, 002, ..., 366 + 'DDDD': { + unit: 'dayOfYear', + match: patterns$1.threeDigits, + parse: parseDecimal$1 + }, + + // AM, PM + 'A': { + unit: 'timeOfDay', + match: function (string, options) { + return options.locale.match.timesOfDay(string, {type: 'short'}) + }, + parse: function (matchResult, options) { + return options.locale.match.timeOfDay(matchResult, {type: 'short'}) + } + }, + + // a.m., p.m. + 'aa': { + unit: 'timeOfDay', + match: function (string, options) { + return options.locale.match.timesOfDay(string, {type: 'long'}) || + options.locale.match.timesOfDay(string, {type: 'short'}) + }, + parse: function (matchResult, options) { + var parseResult = options.locale.match.timeOfDay(matchResult, {type: 'long'}); + + if (parseResult == null) { + parseResult = options.locale.match.timeOfDay(matchResult, {type: 'short'}); + } + + return parseResult + } + }, + + // Hour: 0, 1, ... 23 + 'H': { + unit: 'hours', + match: patterns$1.H, + parse: parseDecimal$1 + }, + + // Hour: 00, 01, ..., 23 + 'HH': { + unit: 'hours', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // Hour: 1, 2, ..., 12 + 'h': { + unit: 'timeOfDayHours', + match: patterns$1.M, + parse: parseDecimal$1 + }, + + // Hour: 01, 02, ..., 12 + 'hh': { + unit: 'timeOfDayHours', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // Minute: 0, 1, ..., 59 + 'm': { + unit: 'minutes', + match: patterns$1.m, + parse: parseDecimal$1 + }, + + // Minute: 00, 01, ..., 59 + 'mm': { + unit: 'minutes', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // Second: 0, 1, ..., 59 + 's': { + unit: 'seconds', + match: patterns$1.m, + parse: parseDecimal$1 + }, + + // Second: 00, 01, ..., 59 + 'ss': { + unit: 'seconds', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // 1/10 of second: 0, 1, ..., 9 + 'S': { + unit: 'milliseconds', + match: patterns$1.singleDigit, + parse: function (matchResult) { + return parseDecimal$1(matchResult) * 100 + } + }, + + // 1/100 of second: 00, 01, ..., 99 + 'SS': { + unit: 'milliseconds', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) * 10 + } + }, + + // Millisecond: 000, 001, ..., 999 + 'SSS': { + unit: 'milliseconds', + match: patterns$1.threeDigits, + parse: parseDecimal$1 + }, + + // Timezone: -01:00, +00:00, ... +12:00 + 'Z': { + unit: 'timezone', + match: patterns$1.Z, + parse: function (matchResult) { + var sign = matchResult[1]; + var hours = parseInt(matchResult[2], 10); + var minutes = parseInt(matchResult[3], 10); + var absoluteOffset = hours * 60 + minutes; + return (sign === '+') ? absoluteOffset : -absoluteOffset + } + }, + + // Timezone: -0100, +0000, ... +1200 + 'ZZ': { + unit: 'timezone', + match: patterns$1.ZZ, + parse: function (matchResult) { + var sign = matchResult[1]; + var hours = parseInt(matchResult[2], 10); + var minutes = parseInt(matchResult[3], 10); + var absoluteOffset = hours * 60 + minutes; + return (sign === '+') ? absoluteOffset : -absoluteOffset + } + }, + + // Seconds timestamp: 512969520 + 'X': { + unit: 'timestamp', + match: patterns$1.anyDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) * 1000 + } + }, + + // Milliseconds timestamp: 512969520900 + 'x': { + unit: 'timestamp', + match: patterns$1.anyDigits, + parse: parseDecimal$1 + } +}; + +parsers['a'] = parsers['A']; + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCDay (dirtyDate, dirtyDay, dirtyOptions) { + var options = dirtyOptions || {}; + var locale = options.locale; + var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; + var defaultWeekStartsOn = localeWeekStartsOn === undefined ? 0 : Number(localeWeekStartsOn); + var weekStartsOn = options.weekStartsOn === undefined ? defaultWeekStartsOn : Number(options.weekStartsOn); + + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { + throw new RangeError('weekStartsOn must be between 0 and 6 inclusively') + } + + var date = toDate(dirtyDate, dirtyOptions); + var day = Number(dirtyDay); + + var currentDay = date.getUTCDay(); + + var remainder = day % 7; + var dayIndex = (remainder + 7) % 7; + + var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; + + date.setUTCDate(date.getUTCDate() + diff); + return date +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCISODay (dirtyDate, dirtyDay, dirtyOptions) { + var day = Number(dirtyDay); + + if (day % 7 === 0) { + day = day - 7; + } + + var weekStartsOn = 1; + var date = toDate(dirtyDate, dirtyOptions); + var currentDay = date.getUTCDay(); + + var remainder = day % 7; + var dayIndex = (remainder + 7) % 7; + + var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; + + date.setUTCDate(date.getUTCDate() + diff); + return date +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCISOWeek (dirtyDate, dirtyISOWeek, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var isoWeek = Number(dirtyISOWeek); + var diff = getUTCISOWeek(date, dirtyOptions) - isoWeek; + date.setUTCDate(date.getUTCDate() - diff * 7); + return date +} + +var MILLISECONDS_IN_DAY$3 = 86400000; + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCISOWeekYear (dirtyDate, dirtyISOYear, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var isoYear = Number(dirtyISOYear); + var dateStartOfYear = startOfUTCISOWeekYear(date, dirtyOptions); + var diff = Math.floor((date.getTime() - dateStartOfYear.getTime()) / MILLISECONDS_IN_DAY$3); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setUTCFullYear(isoYear, 0, 4); + fourthOfJanuary.setUTCHours(0, 0, 0, 0); + date = startOfUTCISOWeekYear(fourthOfJanuary, dirtyOptions); + date.setUTCDate(date.getUTCDate() + diff); + return date +} + +var MILLISECONDS_IN_MINUTE$7 = 60000; + +function setTimeOfDay (hours, timeOfDay) { + var isAM = timeOfDay === 0; + + if (isAM) { + if (hours === 12) { + return 0 + } + } else { + if (hours !== 12) { + return 12 + hours + } + } + + return hours +} + +var units = { + twoDigitYear: { + priority: 10, + set: function (dateValues, value) { + var century = Math.floor(dateValues.date.getUTCFullYear() / 100); + var year = century * 100 + value; + dateValues.date.setUTCFullYear(year, 0, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, + + year: { + priority: 10, + set: function (dateValues, value) { + dateValues.date.setUTCFullYear(value, 0, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, + + isoYear: { + priority: 10, + set: function (dateValues, value, options) { + dateValues.date = startOfUTCISOWeekYear(setUTCISOWeekYear(dateValues.date, value, options), options); + return dateValues + } + }, + + quarter: { + priority: 20, + set: function (dateValues, value) { + dateValues.date.setUTCMonth((value - 1) * 3, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, + + month: { + priority: 30, + set: function (dateValues, value) { + dateValues.date.setUTCMonth(value, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, + + isoWeek: { + priority: 40, + set: function (dateValues, value, options) { + dateValues.date = startOfUTCISOWeek(setUTCISOWeek(dateValues.date, value, options), options); + return dateValues + } + }, + + dayOfWeek: { + priority: 50, + set: function (dateValues, value, options) { + dateValues.date = setUTCDay(dateValues.date, value, options); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, + + dayOfISOWeek: { + priority: 50, + set: function (dateValues, value, options) { + dateValues.date = setUTCISODay(dateValues.date, value, options); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, + + dayOfMonth: { + priority: 50, + set: function (dateValues, value) { + dateValues.date.setUTCDate(value); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, + + dayOfYear: { + priority: 50, + set: function (dateValues, value) { + dateValues.date.setUTCMonth(0, value); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, + + timeOfDay: { + priority: 60, + set: function (dateValues, value, options) { + dateValues.timeOfDay = value; + return dateValues + } + }, + + hours: { + priority: 70, + set: function (dateValues, value, options) { + dateValues.date.setUTCHours(value, 0, 0, 0); + return dateValues + } + }, + + timeOfDayHours: { + priority: 70, + set: function (dateValues, value, options) { + var timeOfDay = dateValues.timeOfDay; + if (timeOfDay != null) { + value = setTimeOfDay(value, timeOfDay); + } + dateValues.date.setUTCHours(value, 0, 0, 0); + return dateValues + } + }, + + minutes: { + priority: 80, + set: function (dateValues, value) { + dateValues.date.setUTCMinutes(value, 0, 0); + return dateValues + } + }, + + seconds: { + priority: 90, + set: function (dateValues, value) { + dateValues.date.setUTCSeconds(value, 0); + return dateValues + } + }, + + milliseconds: { + priority: 100, + set: function (dateValues, value) { + dateValues.date.setUTCMilliseconds(value); + return dateValues + } + }, + + timezone: { + priority: 110, + set: function (dateValues, value) { + dateValues.date = new Date(dateValues.date.getTime() - value * MILLISECONDS_IN_MINUTE$7); + return dateValues + } + }, + + timestamp: { + priority: 120, + set: function (dateValues, value) { + dateValues.date = new Date(value); + return dateValues + } + } +}; + +var TIMEZONE_UNIT_PRIORITY = 110; +var MILLISECONDS_IN_MINUTE$6 = 60000; + +var longFormattingTokensRegExp$1 = /(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g; +var defaultParsingTokensRegExp = /(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g; + +/** + * @name parse + * @category Common Helpers + * @summary Parse the date. + * + * @description + * Return the date parsed from string using the given format. + * + * Accepted format tokens: + * | Unit | Priority | Token | Input examples | + * |-------------------------|----------|-------|----------------------------------| + * | Year | 10 | YY | 00, 01, ..., 99 | + * | | | YYYY | 1900, 1901, ..., 2099 | + * | ISO week-numbering year | 10 | GG | 00, 01, ..., 99 | + * | | | GGGG | 1900, 1901, ..., 2099 | + * | Quarter | 20 | Q | 1, 2, 3, 4 | + * | | | Qo | 1st, 2nd, 3rd, 4th | + * | Month | 30 | M | 1, 2, ..., 12 | + * | | | Mo | 1st, 2nd, ..., 12th | + * | | | MM | 01, 02, ..., 12 | + * | | | MMM | Jan, Feb, ..., Dec | + * | | | MMMM | January, February, ..., December | + * | ISO week | 40 | W | 1, 2, ..., 53 | + * | | | Wo | 1st, 2nd, ..., 53rd | + * | | | WW | 01, 02, ..., 53 | + * | Day of week | 50 | d | 0, 1, ..., 6 | + * | | | do | 0th, 1st, ..., 6th | + * | | | dd | Su, Mo, ..., Sa | + * | | | ddd | Sun, Mon, ..., Sat | + * | | | dddd | Sunday, Monday, ..., Saturday | + * | Day of ISO week | 50 | E | 1, 2, ..., 7 | + * | Day of month | 50 | D | 1, 2, ..., 31 | + * | | | Do | 1st, 2nd, ..., 31st | + * | | | DD | 01, 02, ..., 31 | + * | Day of year | 50 | DDD | 1, 2, ..., 366 | + * | | | DDDo | 1st, 2nd, ..., 366th | + * | | | DDDD | 001, 002, ..., 366 | + * | Time of day | 60 | A | AM, PM | + * | | | a | am, pm | + * | | | aa | a.m., p.m. | + * | Hour | 70 | H | 0, 1, ... 23 | + * | | | HH | 00, 01, ... 23 | + * | Time of day hour | 70 | h | 1, 2, ..., 12 | + * | | | hh | 01, 02, ..., 12 | + * | Minute | 80 | m | 0, 1, ..., 59 | + * | | | mm | 00, 01, ..., 59 | + * | Second | 90 | s | 0, 1, ..., 59 | + * | | | ss | 00, 01, ..., 59 | + * | 1/10 of second | 100 | S | 0, 1, ..., 9 | + * | 1/100 of second | 100 | SS | 00, 01, ..., 99 | + * | Millisecond | 100 | SSS | 000, 001, ..., 999 | + * | Timezone | 110 | Z | -01:00, +00:00, ... +12:00 | + * | | | ZZ | -0100, +0000, ..., +1200 | + * | Seconds timestamp | 120 | X | 512969520 | + * | Milliseconds timestamp | 120 | x | 512969520900 | + * + * Values will be assigned to the date in the ascending order of its unit's priority. + * Units of an equal priority overwrite each other in the order of appearance. + * + * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year), + * the values will be taken from 3rd argument `baseDate` which works as a context of parsing. + * + * `baseDate` must be passed for correct work of the function. + * If you're not sure which `baseDate` to supply, create a new instance of Date: + * `parse('02/11/2014', 'MM/DD/YYYY', new Date())` + * In this case parsing will be done in the context of the current date. + * If `baseDate` is `Invalid Date` or a value not convertible to valid `Date`, + * then `Invalid Date` will be returned. + * + * Also, `parse` unfolds long formats like those in [format]{@link https://date-fns.org/docs/format}: + * | Token | Input examples | + * |-------|--------------------------------| + * | LT | 05:30 a.m. | + * | LTS | 05:30:15 a.m. | + * | L | 07/02/1995 | + * | l | 7/2/1995 | + * | LL | July 2 1995 | + * | ll | Jul 2 1995 | + * | LLL | July 2 1995 05:30 a.m. | + * | lll | Jul 2 1995 05:30 a.m. | + * | LLLL | Sunday, July 2 1995 05:30 a.m. | + * | llll | Sun, Jul 2 1995 05:30 a.m. | + * + * The characters wrapped in square brackets in the format string are escaped. + * + * The result may vary by locale. + * + * If `formatString` matches with `dateString` but does not provides tokens, `baseDate` will be returned. + * + * If parsing failed, `Invalid Date` will be returned. + * Invalid Date is a Date, whose time value is NaN. + * Time value of Date: http://es5.github.io/#x15.9.1.1 + * + * @param {String} dateString - the string to parse + * @param {String} formatString - the string of tokens + * @param {Date|String|Number} baseDate - the date to took the missing higher priority values from + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {Date} the parsed date + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.locale` must contain `match` property + * @throws {RangeError} `options.locale` must contain `formatLong` property + * + * @example + * // Parse 11 February 2014 from middle-endian format: + * var result = parse( + * '02/11/2014', + * 'MM/DD/YYYY', + * new Date() + * ) + * //=> Tue Feb 11 2014 00:00:00 + * + * @example + * // Parse 28th of February in English locale in the context of 2010 year: + * import eoLocale from 'date-fns/locale/eo' + * var result = parse( + * '28-a de februaro', + * 'Do [de] MMMM', + * new Date(2010, 0, 1) + * {locale: eoLocale} + * ) + * //=> Sun Feb 28 2010 00:00:00 + */ +function parse (dirtyDateString, dirtyFormatString, dirtyBaseDate, dirtyOptions) { + var dateString = String(dirtyDateString); + var options = dirtyOptions || {}; + + var weekStartsOn = options.weekStartsOn === undefined ? 0 : Number(options.weekStartsOn); + + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { + throw new RangeError('weekStartsOn must be between 0 and 6 inclusively') + } + + var locale$$1 = options.locale || locale; + var localeParsers = locale$$1.parsers || {}; + var localeUnits = locale$$1.units || {}; + + if (!locale$$1.match) { + throw new RangeError('locale must contain match property') + } + + if (!locale$$1.formatLong) { + throw new RangeError('locale must contain formatLong property') + } + + var formatString = String(dirtyFormatString) + .replace(longFormattingTokensRegExp$1, function (substring) { + if (substring[0] === '[') { + return substring + } + + if (substring[0] === '\\') { + return cleanEscapedString$1(substring) + } + + return locale$$1.formatLong(substring) + }); + + if (formatString === '') { + if (dateString === '') { + return toDate(dirtyBaseDate, options) + } else { + return new Date(NaN) + } + } + + var subFnOptions = cloneObject(options); + subFnOptions.locale = locale$$1; + + var tokens = formatString.match(locale$$1.parsingTokensRegExp || defaultParsingTokensRegExp); + var tokensLength = tokens.length; + + // If timezone isn't specified, it will be set to the system timezone + var setters = [{ + priority: TIMEZONE_UNIT_PRIORITY, + set: dateToSystemTimezone, + index: 0 + }]; + + var i; + for (i = 0; i < tokensLength; i++) { + var token = tokens[i]; + var parser = localeParsers[token] || parsers[token]; + if (parser) { + var matchResult; + + if (parser.match instanceof RegExp) { + matchResult = parser.match.exec(dateString); + } else { + matchResult = parser.match(dateString, subFnOptions); + } + + if (!matchResult) { + return new Date(NaN) + } + + var unitName = parser.unit; + var unit = localeUnits[unitName] || units[unitName]; + + setters.push({ + priority: unit.priority, + set: unit.set, + value: parser.parse(matchResult, subFnOptions), + index: setters.length + }); + + var substring = matchResult[0]; + dateString = dateString.slice(substring.length); + } else { + var head = tokens[i].match(/^\[.*]$/) ? tokens[i].replace(/^\[|]$/g, '') : tokens[i]; + if (dateString.indexOf(head) === 0) { + dateString = dateString.slice(head.length); + } else { + return new Date(NaN) + } + } + } + + var uniquePrioritySetters = setters + .map(function (setter) { + return setter.priority + }) + .sort(function (a, b) { + return a - b + }) + .filter(function (priority, index, array) { + return array.indexOf(priority) === index + }) + .map(function (priority) { + return setters + .filter(function (setter) { + return setter.priority === priority + }) + .reverse() + }) + .map(function (setterArray) { + return setterArray[0] + }); + + var date = toDate(dirtyBaseDate, options); + + if (isNaN(date)) { + return new Date(NaN) + } + + // Convert the date in system timezone to the same date in UTC+00:00 timezone. + // This ensures that when UTC functions will be implemented, locales will be compatible with them. + // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37 + var utcDate = subMinutes(date, date.getTimezoneOffset()); + + var dateValues = {date: utcDate}; + + var settersLength = uniquePrioritySetters.length; + for (i = 0; i < settersLength; i++) { + var setter = uniquePrioritySetters[i]; + dateValues = setter.set(dateValues, setter.value, subFnOptions); + } + + return dateValues.date +} + +function dateToSystemTimezone (dateValues) { + var date = dateValues.date; + var time = date.getTime(); + + // Get the system timezone offset at (moment of time - offset) + var offset = date.getTimezoneOffset(); + + // Get the system timezone offset at the exact moment of time + offset = new Date(time + offset * MILLISECONDS_IN_MINUTE$6).getTimezoneOffset(); + + // Convert date in timezone "UTC+00:00" to the system timezone + dateValues.date = new Date(time + offset * MILLISECONDS_IN_MINUTE$6); + + return dateValues +} + +function cleanEscapedString$1 (input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|]$/g, '') + } + return input.replace(/\\/g, '') +} + +// This file is generated automatically by `scripts/build/indices.js`. Please, don't change it. + +var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + + +function unwrapExports (x) { + return x && x.__esModule ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var index$4 = createCommonjsModule(function (module, exports) { +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = formatDistance; +var formatDistanceLocale = { + lessThanXSeconds: { + one: 'less than a second', + other: 'less than {{count}} seconds' + }, + + xSeconds: { + one: '1 second', + other: '{{count}} seconds' + }, + + halfAMinute: 'half a minute', + + lessThanXMinutes: { + one: 'less than a minute', + other: 'less than {{count}} minutes' + }, + + xMinutes: { + one: '1 minute', + other: '{{count}} minutes' + }, + + aboutXHours: { + one: 'about 1 hour', + other: 'about {{count}} hours' + }, + + xHours: { + one: '1 hour', + other: '{{count}} hours' + }, + + xDays: { + one: '1 day', + other: '{{count}} days' + }, + + aboutXMonths: { + one: 'about 1 month', + other: 'about {{count}} months' + }, + + xMonths: { + one: '1 month', + other: '{{count}} months' + }, + + aboutXYears: { + one: 'about 1 year', + other: 'about {{count}} years' + }, + + xYears: { + one: '1 year', + other: '{{count}} years' + }, + + overXYears: { + one: 'over 1 year', + other: 'over {{count}} years' + }, + + almostXYears: { + one: 'almost 1 year', + other: 'almost {{count}} years' + } +}; + +function formatDistance(token, count, options) { + options = options || {}; + + var result; + if (typeof formatDistanceLocale[token] === 'string') { + result = formatDistanceLocale[token]; + } else if (count === 1) { + result = formatDistanceLocale[token].one; + } else { + result = formatDistanceLocale[token].other.replace('{{count}}', count); + } + + if (options.addSuffix) { + if (options.comparison > 0) { + return 'in ' + result; + } else { + return result + ' ago'; + } + } + + return result; +} +module.exports = exports['default']; +}); + +var index$8 = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = buildFormatLongFn; +var tokensToBeShortedPattern = /MMMM|MM|DD|dddd/g; + +function buildShortLongFormat(format) { + return format.replace(tokensToBeShortedPattern, function (token) { + return token.slice(1); + }); +} + +/** + * @name buildFormatLongFn + * @category Locale Helpers + * @summary Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. + * + * @description + * Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. + * Returns a function which takes one of the following tokens as the argument: + * `'LTS'`, `'LT'`, `'L'`, `'LL'`, `'LLL'`, `'l'`, `'ll'`, `'lll'`, `'llll'` + * and returns a long format string written as `format` token strings. + * See [format]{@link https://date-fns.org/docs/format} + * + * `'l'`, `'ll'`, `'lll'` and `'llll'` formats are built automatically + * by shortening some of the tokens from corresponding unshortened formats + * (e.g., if `LL` is `'MMMM DD YYYY'` then `ll` will be `MMM D YYYY`) + * + * @param {Object} obj - the object with long formats written as `format` token strings + * @param {String} obj.LT - time format: hours and minutes + * @param {String} obj.LTS - time format: hours, minutes and seconds + * @param {String} obj.L - short date format: numeric day, month and year + * @param {String} [obj.l] - short date format: numeric day, month and year (shortened) + * @param {String} obj.LL - long date format: day, month in words, and year + * @param {String} [obj.ll] - long date format: day, month in words, and year (shortened) + * @param {String} obj.LLL - long date and time format + * @param {String} [obj.lll] - long date and time format (shortened) + * @param {String} obj.LLLL - long date, time and weekday format + * @param {String} [obj.llll] - long date, time and weekday format (shortened) + * @returns {Function} `formatLong` property of the locale + * + * @example + * // For `en-US` locale: + * locale.formatLong = buildFormatLongFn({ + * LT: 'h:mm aa', + * LTS: 'h:mm:ss aa', + * L: 'MM/DD/YYYY', + * LL: 'MMMM D YYYY', + * LLL: 'MMMM D YYYY h:mm aa', + * LLLL: 'dddd, MMMM D YYYY h:mm aa' + * }) + */ +function buildFormatLongFn(obj) { + var formatLongLocale = { + LTS: obj.LTS, + LT: obj.LT, + L: obj.L, + LL: obj.LL, + LLL: obj.LLL, + LLLL: obj.LLLL, + l: obj.l || buildShortLongFormat(obj.L), + ll: obj.ll || buildShortLongFormat(obj.LL), + lll: obj.lll || buildShortLongFormat(obj.LLL), + llll: obj.llll || buildShortLongFormat(obj.LLLL) + }; + + return function (token) { + return formatLongLocale[token]; + }; +} +module.exports = exports["default"]; +}); + +var index$6 = createCommonjsModule(function (module, exports) { +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _index = index$8; + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var formatLong = (0, _index2.default)({ + LT: 'h:mm aa', + LTS: 'h:mm:ss aa', + L: 'MM/DD/YYYY', + LL: 'MMMM D YYYY', + LLL: 'MMMM D YYYY h:mm aa', + LLLL: 'dddd, MMMM D YYYY h:mm aa' +}); + +exports.default = formatLong; +module.exports = exports['default']; +}); + +var index$10 = createCommonjsModule(function (module, exports) { +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = formatRelative; +var formatRelativeLocale = { + lastWeek: '[last] dddd [at] LT', + yesterday: '[yesterday at] LT', + today: '[today at] LT', + tomorrow: '[tomorrow at] LT', + nextWeek: 'dddd [at] LT', + other: 'L' +}; + +function formatRelative(token, date, baseDate, options) { + return formatRelativeLocale[token]; +} +module.exports = exports['default']; +}); + +var index$14 = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = buildLocalizeFn; +/** + * @name buildLocalizeFn + * @category Locale Helpers + * @summary Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale. + * + * @description + * Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale + * used by `format` function. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * + * `localize.weekday` function takes the weekday index as argument (0 - Sunday). + * `localize.month` takes the month index (0 - January). + * `localize.timeOfDay` takes the hours. Use `indexCallback` to convert them to an array index (see example). + * + * @param {Object} values - the object with arrays of values + * @param {String} defaultType - the default type for the localize function + * @param {Function} [indexCallback] - the callback which takes the resulting function argument + * and converts it into value array index + * @returns {Function} the resulting function + * + * @example + * var timeOfDayValues = { + * uppercase: ['AM', 'PM'], + * lowercase: ['am', 'pm'], + * long: ['a.m.', 'p.m.'] + * } + * locale.localize.timeOfDay = buildLocalizeFn(timeOfDayValues, 'long', function (hours) { + * // 0 is a.m. array index, 1 is p.m. array index + * return (hours / 12) >= 1 ? 1 : 0 + * }) + * locale.localize.timeOfDay(16, {type: 'uppercase'}) //=> 'PM' + * locale.localize.timeOfDay(5) //=> 'a.m.' + */ +function buildLocalizeFn(values, defaultType, indexCallback) { + return function (dirtyIndex, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var valuesArray = values[type] || values[defaultType]; + var index = indexCallback ? indexCallback(Number(dirtyIndex)) : Number(dirtyIndex); + return valuesArray[index]; + }; +} +module.exports = exports["default"]; +}); + +var index$16 = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = buildLocalizeArrayFn; +/** + * @name buildLocalizeArrayFn + * @category Locale Helpers + * @summary Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. + * + * @description + * Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * + * @param {Object} values - the object with arrays of values + * @param {String} defaultType - the default type for the localize function + * @returns {Function} the resulting function + * + * @example + * var weekdayValues = { + * narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + * short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + * long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] + * } + * locale.localize.weekdays = buildLocalizeArrayFn(weekdayValues, 'long') + * locale.localize.weekdays({type: 'narrow'}) //=> ['Su', 'Mo', ...] + * locale.localize.weekdays() //=> ['Sunday', 'Monday', ...] + */ +function buildLocalizeArrayFn(values, defaultType) { + return function (dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + return values[type] || values[defaultType]; + }; +} +module.exports = exports["default"]; +}); + +var index$12 = createCommonjsModule(function (module, exports) { +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _index = index$14; + +var _index2 = _interopRequireDefault(_index); + +var _index3 = index$16; + +var _index4 = _interopRequireDefault(_index3); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Note: in English, the names of days of the week and months are capitalized. +// If you are making a new locale based on this one, check if the same is true for the language you're working on. +// Generally, formatted dates should look like they are in the middle of a sentence, +// e.g. in Spanish language the weekdays and months should be in the lowercase. +var weekdayValues = { + narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] +}; + +var monthValues = { + short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] +}; + +// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. +// Use the system which is used the most commonly in the locale. +// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: +// +// var timeOfDayValues = { +// any: ['in the night', 'in the morning', 'in the afternoon', 'in the evening'] +// } +// +// And later: +// +// var localize = { +// // The callback takes the hours as the argument and returns the array index +// timeOfDay: buildLocalizeFn(timeOfDayValues, 'any', function (hours) { +// if (hours >= 17) { +// return 3 +// } else if (hours >= 12) { +// return 2 +// } else if (hours >= 4) { +// return 1 +// } else { +// return 0 +// } +// }), +// timesOfDay: buildLocalizeArrayFn(timeOfDayValues, 'any') +// } +var timeOfDayValues = { + uppercase: ['AM', 'PM'], + lowercase: ['am', 'pm'], + long: ['a.m.', 'p.m.'] +}; + +function ordinalNumber(dirtyNumber, dirtyOptions) { + var number = Number(dirtyNumber); + + // If ordinal numbers depend on context, for example, + // if they are different for different grammatical genders, + // use `options.unit`: + // + // var options = dirtyOptions || {} + // var unit = String(options.unit) + // + // where `unit` can be 'month', 'quarter', 'week', 'isoWeek', 'dayOfYear', + // 'dayOfMonth' or 'dayOfWeek' + + var rem100 = number % 100; + if (rem100 > 20 || rem100 < 10) { + switch (rem100 % 10) { + case 1: + return number + 'st'; + case 2: + return number + 'nd'; + case 3: + return number + 'rd'; + } + } + return number + 'th'; +} + +var localize = { + ordinalNumber: ordinalNumber, + weekday: (0, _index2.default)(weekdayValues, 'long'), + weekdays: (0, _index4.default)(weekdayValues, 'long'), + month: (0, _index2.default)(monthValues, 'long'), + months: (0, _index4.default)(monthValues, 'long'), + timeOfDay: (0, _index2.default)(timeOfDayValues, 'long', function (hours) { + return hours / 12 >= 1 ? 1 : 0; + }), + timesOfDay: (0, _index4.default)(timeOfDayValues, 'long') +}; + +exports.default = localize; +module.exports = exports['default']; +}); + +var index$20 = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = buildMatchFn; +/** + * @name buildMatchFn + * @category Locale Helpers + * @summary Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale. + * + * @description + * Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale used by `parse` function. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * The result of the match function will be passed into corresponding parser function + * (`match.weekday`, `match.month` or `match.timeOfDay` respectively. See `buildParseFn`). + * + * @param {Object} values - the object with RegExps + * @param {String} defaultType - the default type for the match function + * @returns {Function} the resulting function + * + * @example + * var matchWeekdaysPatterns = { + * narrow: /^(su|mo|tu|we|th|fr|sa)/i, + * short: /^(sun|mon|tue|wed|thu|fri|sat)/i, + * long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i + * } + * locale.match.weekdays = buildMatchFn(matchWeekdaysPatterns, 'long') + * locale.match.weekdays('Sunday', {type: 'narrow'}) //=> ['Su', 'Su', ...] + * locale.match.weekdays('Sunday') //=> ['Sunday', 'Sunday', ...] + */ +function buildMatchFn(patterns, defaultType) { + return function (dirtyString, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var pattern = patterns[type] || patterns[defaultType]; + var string = String(dirtyString); + return string.match(pattern); + }; +} +module.exports = exports["default"]; +}); + +var index$22 = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = buildParseFn; +/** + * @name buildParseFn + * @category Locale Helpers + * @summary Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale. + * + * @description + * Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale used by `parse` function. + * The argument of the resulting function is the result of the corresponding match function + * (`match.weekdays`, `match.months` or `match.timesOfDay` respectively. See `buildMatchFn`). + * + * @param {Object} values - the object with arrays of RegExps + * @param {String} defaultType - the default type for the parser function + * @returns {Function} the resulting function + * + * @example + * var parseWeekdayPatterns = { + * any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] + * } + * locale.match.weekday = buildParseFn(matchWeekdaysPatterns, 'long') + * var matchResult = locale.match.weekdays('Friday') + * locale.match.weekday(matchResult) //=> 5 + */ +function buildParseFn(patterns, defaultType) { + return function (matchResult, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var patternsArray = patterns[type] || patterns[defaultType]; + var string = matchResult[1]; + + return patternsArray.findIndex(function (pattern) { + return pattern.test(string); + }); + }; +} +module.exports = exports["default"]; +}); + +var index$24 = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = buildMatchPatternFn; +/** + * @name buildMatchPatternFn + * @category Locale Helpers + * @summary Build match function from a single RegExp. + * + * @description + * Build match function from a single RegExp. + * Usually used for building `match.ordinalNumbers` property of the locale. + * + * @param {Object} pattern - the RegExp + * @returns {Function} the resulting function + * + * @example + * locale.match.ordinalNumbers = buildMatchPatternFn(/^(\d+)(th|st|nd|rd)?/i) + * locale.match.ordinalNumbers('3rd') //=> ['3rd', '3', 'rd', ...] + */ +function buildMatchPatternFn(pattern) { + return function (dirtyString) { + var string = String(dirtyString); + return string.match(pattern); + }; +} +module.exports = exports["default"]; +}); + +var index$26 = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = parseDecimal; +/** + * @name parseDecimal + * @category Locale Helpers + * @summary Parses the match result into decimal number. + * + * @description + * Parses the match result into decimal number. + * Uses the string matched with the first set of parentheses of match RegExp. + * + * @param {Array} matchResult - the object returned by matching function + * @returns {Number} the parsed value + * + * @example + * locale.match = { + * ordinalNumbers: (dirtyString) { + * return String(dirtyString).match(/^(\d+)(th|st|nd|rd)?/i) + * }, + * ordinalNumber: parseDecimal + * } + */ +function parseDecimal(matchResult) { + return parseInt(matchResult[1], 10); +} +module.exports = exports["default"]; +}); + +var index$18 = createCommonjsModule(function (module, exports) { +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _index = index$20; + +var _index2 = _interopRequireDefault(_index); + +var _index3 = index$22; + +var _index4 = _interopRequireDefault(_index3); + +var _index5 = index$24; + +var _index6 = _interopRequireDefault(_index5); + +var _index7 = index$26; + +var _index8 = _interopRequireDefault(_index7); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var matchOrdinalNumbersPattern = /^(\d+)(th|st|nd|rd)?/i; + +var matchWeekdaysPatterns = { + narrow: /^(su|mo|tu|we|th|fr|sa)/i, + short: /^(sun|mon|tue|wed|thu|fri|sat)/i, + long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i +}; + +var parseWeekdayPatterns = { + any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] +}; + +var matchMonthsPatterns = { + short: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, + long: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i +}; + +var parseMonthPatterns = { + any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i] +}; + +// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. +// Use the system which is used the most commonly in the locale. +// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: +// +// var matchTimesOfDayPatterns = { +// long: /^((in the)? (night|morning|afternoon|evening?))/i +// } +// +// var parseTimeOfDayPatterns = { +// any: [/(night|morning)/i, /(afternoon|evening)/i] +// } +var matchTimesOfDayPatterns = { + short: /^(am|pm)/i, + long: /^([ap]\.?\s?m\.?)/i +}; + +var parseTimeOfDayPatterns = { + any: [/^a/i, /^p/i] +}; + +var match = { + ordinalNumbers: (0, _index6.default)(matchOrdinalNumbersPattern), + ordinalNumber: _index8.default, + weekdays: (0, _index2.default)(matchWeekdaysPatterns, 'long'), + weekday: (0, _index4.default)(parseWeekdayPatterns, 'any'), + months: (0, _index2.default)(matchMonthsPatterns, 'long'), + month: (0, _index4.default)(parseMonthPatterns, 'any'), + timesOfDay: (0, _index2.default)(matchTimesOfDayPatterns, 'long'), + timeOfDay: (0, _index4.default)(parseTimeOfDayPatterns, 'any') +}; + +exports.default = match; +module.exports = exports['default']; +}); + +var index$2 = createCommonjsModule(function (module, exports) { +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _index = index$4; + +var _index2 = _interopRequireDefault(_index); + +var _index3 = index$6; + +var _index4 = _interopRequireDefault(_index3); + +var _index5 = index$10; + +var _index6 = _interopRequireDefault(_index5); + +var _index7 = index$12; + +var _index8 = _interopRequireDefault(_index7); + +var _index9 = index$18; + +var _index10 = _interopRequireDefault(_index9); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @type {Locale} + * @category Locales + * @summary English locale (United States). + * @language English + * @iso-639-2 eng + */ +var locale = { + formatDistance: _index2.default, + formatLong: _index4.default, + formatRelative: _index6.default, + localize: _index8.default, + match: _index10.default, + options: { + weekStartsOn: 0 /* Sunday */ + , firstWeekContainsDate: 1 + } +}; + +exports.default = locale; +module.exports = exports['default']; +}); + +var index$3 = unwrapExports(index$2); + + +var defaultLocale$1 = Object.freeze({ + default: index$3, + __moduleExports: index$2 +}); + +var __assign = (undefined && undefined.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +function buildLocalizeFn(values, defaultType, indexCallback) { + return function (dirtyIndex, _a) { + var type = (_a === void 0 ? { type: defaultType } : _a).type; + var index = indexCallback ? indexCallback(dirtyIndex) : dirtyIndex; + return values[type][index]; + }; +} +function buildLocalizeArrayFn(values, defaultType) { + return function (_a) { + var type = (_a === void 0 ? { type: defaultType } : _a).type; + return values[type]; + }; +} +function buildMatchFn(patterns, defaultType) { + return function (dirtyString, _a) { + var type = (_a === void 0 ? { type: defaultType } : _a).type; + return dirtyString.match("^(" + patterns[type].join("|") + ")"); + }; +} +function buildParseFn(patterns, defaultType) { + return function (_a, _b) { + var result = _a[1]; + var type = (_b === void 0 ? { type: defaultType } : _b).type; + return (patterns[type] || patterns[defaultType]) + .map(function (p) { return new RegExp("^" + p); }) + .findIndex(function (pattern) { return pattern.test(result); }); + }; +} +var DateFnsParser = /** @class */ (function () { + function DateFnsParser(locale) { + this._weekStartsOn = locale.firstDayOfWeek; + var weekdayValues = { + long: locale.weekdays, + short: locale.weekdaysShort, + narrow: locale.weekdaysNarrow + }; + var monthValues = { + long: locale.months, + short: locale.monthsShort + }; + var timeOfDayValues = { + long: locale.timesOfDay, + uppercase: locale.timesOfDayUppercase, + lowercase: locale.timesOfDayLowercase + }; + var timeOfDayMatchValues = { + long: locale.timesOfDay, + short: locale.timesOfDayUppercase.concat(locale.timesOfDayLowercase) + }; + this._locale = defaultLocale$1; + this._locale.localize = __assign({}, this._locale.localize, { + weekday: buildLocalizeFn(weekdayValues, "long"), + weekdays: buildLocalizeArrayFn(weekdayValues, "long"), + month: buildLocalizeFn(monthValues, "long"), + months: buildLocalizeArrayFn(monthValues, "long"), + timeOfDay: buildLocalizeFn(timeOfDayValues, "long", function (hours) { + return hours / 12 >= 1 ? 1 : 0; + }), + timesOfDay: buildLocalizeArrayFn(timeOfDayValues, "long") + }); + this._locale.match = __assign({}, this._locale.match, { + weekdays: buildMatchFn(weekdayValues, "long"), + weekday: buildParseFn(weekdayValues, "long"), + months: buildMatchFn(monthValues, "long"), + month: buildParseFn(monthValues, "long"), + timesOfDay: buildMatchFn(timeOfDayMatchValues, "long"), + timeOfDay: buildParseFn(timeOfDayMatchValues, "long") + }); + } + Object.defineProperty(DateFnsParser.prototype, "_config", { + get: function () { + return { + weekStartsOn: this._weekStartsOn, + locale: this._locale + }; + }, + enumerable: true, + configurable: true + }); + DateFnsParser.prototype.format = function (d, f) { + return format(d, f, this._config); + }; + DateFnsParser.prototype.parse = function (dS, f, bD) { + return parse(dS, f, bD, this._config); + }; + return DateFnsParser; +}()); + +var __extends$4 = (undefined && undefined.__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 __()); + }; +})(); +var DateParser = /** @class */ (function () { + function DateParser(format, locale) { + this._format = format; + this._parser = new DateFnsParser(locale); + } + DateParser.prototype.format = function (date) { + return this._parser.format(date, this._format); + }; + DateParser.prototype.parse = function (dateString, baseDate) { + if (baseDate === void 0) { baseDate = new Date(); } + return this._parser.parse(dateString, this._format, baseDate); + }; + return DateParser; +}()); +var InternalDateParser = /** @class */ (function (_super) { + __extends$4(InternalDateParser, _super); + function InternalDateParser(mode, locale) { + var _this = this; + var internalFormats = { + time: "HH:mm", + datetime: "YYYY-MM-DDTHH:mm", + date: "YYYY-MM-DD", + month: "YYYY-MM", + year: "YYYY" + }; + _this = _super.call(this, internalFormats[mode], locale) || this; + return _this; + } + return InternalDateParser; +}(DateParser)); + +var CalendarRange = /** @class */ (function () { + function CalendarRange(start, dates, items, grouped, comparer) { + this.start = start; + this.dates = dates; + this.items = items; + this.groupedItems = grouped; + this._comparer = comparer; + } + Object.defineProperty(CalendarRange.prototype, "inRange", { + get: function () { + return this.items.filter(function (i) { return !i.isOutsideRange; }); + }, + enumerable: true, + configurable: true + }); + CalendarRange.prototype.find = function (item) { + var _this = this; + return this.items.find(function (i) { return _this._comparer.equal(i.date, item.date); }); + }; + CalendarRange.prototype.findIndex = function (item) { + var _this = this; + if (!item) { + return -1; + } + return this.items.findIndex(function (i) { return _this._comparer.equal(i.date, item.date); }); + }; + CalendarRange.prototype.containsDate = function (date) { + var _this = this; + return !!this.inRange.find(function (i) { return _this._comparer.equal(i.date, date); }); + }; + return CalendarRange; +}()); +var CalendarRangeService = /** @class */ (function () { + function CalendarRangeService(interval, rows, columns) { + this.interval = interval; + this.marginal = interval + 1; + this.rows = rows; + this.columns = columns; + } + Object.defineProperty(CalendarRangeService.prototype, "dateComparer", { + get: function () { + return new DateComparer(this.marginal, this.service.inFinalView); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarRangeService.prototype, "length", { + get: function () { + return this.rows * this.columns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarRangeService.prototype, "canMoveNext", { + get: function () { + var firstItem = this.next.inRange[0]; + if (firstItem && this.service.maxDate) { + return firstItem.date <= this.service.maxDate; + } + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarRangeService.prototype, "canMovePrevious", { + get: function () { + var lastItem = this.previous.inRange.slice(-1).pop(); + if (lastItem && this.service.minDate) { + return lastItem.date >= this.service.minDate; + } + return true; + }, + enumerable: true, + configurable: true + }); + CalendarRangeService.prototype.loadService = function (service) { + this.service = service; + this.refresh(); + }; + CalendarRangeService.prototype.refresh = function () { + this.current = this.calcRange(this.service.currentDate); + this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate))); + this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate))); + }; + CalendarRangeService.prototype.move = function (forwards) { + if (forwards) { + return this.moveNext(); + } + return this.movePrevious(); + }; + CalendarRangeService.prototype.moveNext = function () { + DateUtil.next(this.interval, this.service.currentDate); + this.previous = this.current; + this.current = this.next; + this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate))); + }; + CalendarRangeService.prototype.movePrevious = function () { + DateUtil.previous(this.interval, this.service.currentDate); + this.next = this.current; + this.current = this.previous; + this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate))); + }; + CalendarRangeService.prototype.calc = function (forwards) { + if (forwards) { + return this.next; + } + return this.previous; + }; + CalendarRangeService.prototype.calcRange = function (startDate) { + var start = this.calcStart(startDate); + if (this.service.inFinalView) { + DateUtil.startOf(this.marginal, start, true); + } + var dates = this.calcDates(start); + var items = this.calcItems(dates, startDate); + return new CalendarRange(start, dates, items, Util.Array.group(items, this.columns), this.dateComparer); + }; + CalendarRangeService.prototype.calcStart = function (date) { + return DateUtil.startOf(this.interval, DateUtil.clone(date)); + }; + CalendarRangeService.prototype.calcDates = function (rangeStart) { + var _this = this; + return Util.Array + .range(this.length) + .map(function (i) { return DateUtil.add(_this.marginal, DateUtil.clone(rangeStart), i); }); + }; + CalendarRangeService.prototype.calcItems = function (dateRange, baseDate) { + var _this = this; + return dateRange.map(function (date) { + var item = new CalendarItem(date); + item.isDisabled = !_this.dateComparer.between(item.date, _this.service.minDate, _this.service.maxDate); + item.isActive = _this.dateComparer.equal(item.date, _this.service.selectedDate); + item.isToday = _this.dateComparer.equal(item.date, new Date()); + item.isSelectable = item.isDisabled; + _this.configureItem(item, baseDate); + return item; + }); + }; + return CalendarRangeService; +}()); + +var SuiCalendarViewTitle = /** @class */ (function () { + function SuiCalendarViewTitle() { + this.onZoomOut = new _angular_core.EventEmitter(); + } + SuiCalendarViewTitle.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-calendar-view-title", + template: "\n\n \n\n\n \n\n\n \n\n", + styles: ["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiCalendarViewTitle.ctorParameters = function () { return []; }; + SuiCalendarViewTitle.propDecorators = { + "ranges": [{ type: _angular_core.Input },], + "onZoomOut": [{ type: _angular_core.Output, args: ["zoomOut",] },], + }; + return SuiCalendarViewTitle; +}()); + +var DatepickerMode = { + Year: "year", + Month: "month", + Date: "date", + Datetime: "datetime", + Time: "time" +}; +var SuiDatepicker = /** @class */ (function () { + function SuiDatepicker(localizationService) { + this.service = new CalendarService(new DatetimeConfig(), localizationService.get().datepicker); + this._calendarClasses = true; + } + SuiDatepicker.prototype.onMouseDown = function (e) { + e.preventDefault(); + }; + SuiDatepicker.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-datepicker", + template: "\n\n \n \n \n \n \n\n", + styles: ["\n:host {\n user-select: none;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiDatepicker.ctorParameters = function () { return [ + { type: SuiLocalizationService, }, + ]; }; + SuiDatepicker.propDecorators = { + "_calendarClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.active",] }, { type: _angular_core.HostBinding, args: ["class.calendar",] },], + "onMouseDown": [{ type: _angular_core.HostListener, args: ["mousedown", ["$event"],] },], + }; + return SuiDatepicker; +}()); + +var PopupTrigger = { + Hover: "hover", + Click: "click", + OutsideClick: "outsideClick", + Focus: "focus", + Manual: "manual" +}; +var PopupConfig = /** @class */ (function () { + function PopupConfig(defaults) { + if (defaults === void 0) { defaults = {}; } + this.placement = PositioningPlacement.TopLeft; + this.trigger = PopupTrigger.Hover; + this.isInverted = false; + this.delay = 0; + this.isBasic = false; + this.transition = "scale"; + this.transitionDuration = 200; + Object.assign(this, defaults); + } + return PopupConfig; +}()); + +var SuiPopup = /** @class */ (function () { + function SuiPopup(elementRef) { + this.elementRef = elementRef; + this.transitionController = new TransitionController(false); + this._isOpen = false; + this.onOpen = new _angular_core.EventEmitter(); + this.onClose = new _angular_core.EventEmitter(); + this._tabindex = 0; + } + Object.defineProperty(SuiPopup.prototype, "isOpen", { + get: function () { + return this._isOpen; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopup.prototype, "anchor", { + set: function (anchor) { + // Whenever the anchor is set (which is when the popup is created), recreate the positioning service with the appropriate options. + this.positioningService = new PositioningService(anchor, this._container.element, this.config.placement, ".dynamic.arrow"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopup.prototype, "direction", { + // Returns the direction (`top`, `left`, `right`, `bottom`) of the current placement. + get: + // Returns the direction (`top`, `left`, `right`, `bottom`) of the current placement. + function () { + if (this.positioningService) { + return this.positioningService.actualPlacement.split(" ").shift(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopup.prototype, "alignment", { + // Returns the alignment (`top`, `left`, `right`, `bottom`) of the current placement. + get: + // Returns the alignment (`top`, `left`, `right`, `bottom`) of the current placement. + function () { + if (this.positioningService) { + return this.positioningService.actualPlacement.split(" ").pop(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopup.prototype, "dynamicClasses", { + get: function () { + var classes = {}; + if (this.direction) { + classes[this.direction] = true; + } + if (this.alignment) { + classes[this.alignment] = true; + } + if (this.config.isInverted) { + classes.inverted = true; + } + if (this.config.isBasic) { + classes.basic = true; + } + return classes; + }, + enumerable: true, + configurable: true + }); + SuiPopup.prototype.open = function () { + var _this = this; + // Only attempt to open if currently closed. + if (!this.isOpen) { + // Cancel the closing timer. + clearTimeout(this.closingTimeout); + // Cancel all other transitions, and initiate the opening transition. + this.transitionController.stopAll(); + this.transitionController.animate(new Transition(this.config.transition, this.config.transitionDuration, exports.TransitionDirection.In, function () { + // Focus any element with [autofocus] attribute. + var autoFocus = _this.elementRef.nativeElement.querySelector("[autofocus]"); + if (autoFocus) { + // Autofocus after the browser has had time to process other event handlers. + setTimeout(function () { return autoFocus.focus(); }, 10); + // Try to focus again when the modal has opened so that autofocus works in IE11. + setTimeout(function () { return autoFocus.focus(); }, _this.config.transitionDuration); + } + })); + // Refresh the popup position after a brief delay to allow for browser processing time. + this.positioningService.placement = this.config.placement; + setTimeout(function () { return _this.positioningService.update(); }); + // Finally, set the popup to be open. + this._isOpen = true; + this.onOpen.emit(); + } + }; + SuiPopup.prototype.toggle = function () { + if (!this.isOpen) { + return this.open(); + } + return this.close(); + }; + SuiPopup.prototype.close = function () { + var _this = this; + // Only attempt to close if currently open. + if (this.isOpen) { + // Cancel all other transitions, and initiate the closing transition. + this.transitionController.stopAll(); + this.transitionController.animate(new Transition(this.config.transition, this.config.transitionDuration, exports.TransitionDirection.Out)); + // Cancel the closing timer. + clearTimeout(this.closingTimeout); + // Start the closing timer, that fires the `onClose` event after the transition duration number of milliseconds. + this.closingTimeout = window.setTimeout(function () { return _this.onClose.emit(); }, this.config.transitionDuration); + // Finally, set the popup to be closed. + this._isOpen = false; + } + }; + SuiPopup.prototype.onClick = function (event) { + // Makes sense here, as the popup shouldn't be attached to any DOM element. + event.stopPropagation(); + }; + SuiPopup.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-popup", + template: "\n
\n\n \n
{{ config.header }}
\n
{{ config.text }}
\n
\n
\n\n \n
\n", + styles: ["\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor's mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed 'vertically'. */\n.ui.popup[direction=\"top\"],\n.ui.popup[direction=\"bottom\"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed 'horizontally'. */\n.ui.popup[direction=\"left\"],\n.ui.popup[direction=\"right\"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiPopup.ctorParameters = function () { return [ + { type: _angular_core.ElementRef, }, + ]; }; + SuiPopup.propDecorators = { + "_container": [{ type: _angular_core.ViewChild, args: ["container", { read: _angular_core.ViewContainerRef },] },], + "templateSibling": [{ type: _angular_core.ViewChild, args: ["templateSibling", { read: _angular_core.ViewContainerRef },] },], + "_tabindex": [{ type: _angular_core.HostBinding, args: ["attr.tabindex",] },], + "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], + }; + return SuiPopup; +}()); + +var SuiPopupController = /** @class */ (function () { + function SuiPopupController(renderer, _element, _componentFactory, config) { + var _this = this; + this._element = _element; + this._componentFactory = _componentFactory; + // Generate a new SuiPopup component and attach it to the application view. + this._componentRef = this._componentFactory.createComponent(SuiPopup); + // Configure popup with provided config. + this.popup.config = config; + // When the popup is closed (onClose fires on animation complete), + this.popup.onClose.subscribe(function () { return _this.cleanup(); }); + this._documentListener = renderer.listen("document", "click", function (e) { return _this.onDocumentClick(e); }); + } + Object.defineProperty(SuiPopupController.prototype, "popup", { + // Returns generated popup instance. + get: + // Returns generated popup instance. + function () { + // Use non-null assertion as we only access this when a popup exists. + return this._componentRef.instance; + }, + enumerable: true, + configurable: true + }); + SuiPopupController.prototype.configure = function (config) { + if (config) { + Object.assign(this.popup.config, config); + } + }; + SuiPopupController.prototype.openDelayed = function () { + var _this = this; + // Cancel the opening timer. + clearTimeout(this._openingTimeout); + // Start the popup opening after the specified delay interval. + this._openingTimeout = window.setTimeout(function () { return _this.open(); }, this.popup.config.delay); + }; + SuiPopupController.prototype.open = function () { + // Attach the generated component to the current application. + this._componentFactory.attachToApplication(this._componentRef); + // Move the generated element to the body to avoid any positioning issues. + this._componentFactory.moveToDocumentBody(this._componentRef); + // Attach a reference to the anchor element. We do it here because IE11 loves to complain. + this.popup.anchor = this._element; + // Start popup open transition. + this.popup.open(); + // Call lifecyle hook + var lifecycle = this.popupOnOpen; + if (lifecycle) { + lifecycle.call(this); + } + }; + SuiPopupController.prototype.close = function () { + // Cancel the opening timer to stop the popup opening after close has been called. + clearTimeout(this._openingTimeout); + if (this._componentRef) { + // Start popup close transition. + this.popup.close(); + } + // Call lifecyle hook + var lifecycle = this.popupOnClose; + if (lifecycle) { + lifecycle.call(this); + } + }; + SuiPopupController.prototype.toggleDelayed = function () { + // If the popup hasn't been created, or it has but it isn't currently open, open the popup. + if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) { + return this.openDelayed(); + } + // O'wise, close it. + return this.close(); + }; + SuiPopupController.prototype.toggle = function () { + // If the popup hasn't been created, or it has but it isn't currently open, open the popup. + if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) { + return this.open(); + } + // O'wise, close it. + return this.close(); + }; + SuiPopupController.prototype.onMouseEnter = function () { + if (this.popup.config.trigger === PopupTrigger.Hover) { + this.openDelayed(); + } + }; + SuiPopupController.prototype.onMouseLeave = function () { + if (this.popup.config.trigger === PopupTrigger.Hover) { + this.close(); + } + }; + SuiPopupController.prototype.onClick = function () { + if (this.popup.config.trigger === PopupTrigger.Click || + this.popup.config.trigger === PopupTrigger.OutsideClick) { + // Repeated clicks require a toggle, rather than just opening the popup each time. + this.toggleDelayed(); + } + else if (this.popup.config.trigger === PopupTrigger.Focus && + (!this._componentRef || (this._componentRef && !this.popup.isOpen))) { + // Repeated clicks with a focus trigger requires an open (as focus isn't ever lost on repeated click). + this.openDelayed(); + } + }; + SuiPopupController.prototype.onDocumentClick = function (e) { + // If the popup trigger is outside click, + if (this._componentRef && this.popup.config.trigger === PopupTrigger.OutsideClick) { + var target = e.target; + // Close the popup if the click is outside of the popup element. + if (!this._element.nativeElement.contains(target)) { + this.close(); + } + } + }; + SuiPopupController.prototype.onFocusIn = function () { + if (this.popup.config.trigger === PopupTrigger.Focus) { + this.openDelayed(); + } + }; + SuiPopupController.prototype.onFocusOut = function (e) { + if (!this._element.nativeElement.contains(e.relatedTarget) && + !this.popup.elementRef.nativeElement.contains(e.relatedTarget) && + this.popup.config.trigger === PopupTrigger.Focus) { + this.close(); + } + }; + SuiPopupController.prototype.cleanup = function () { + clearTimeout(this._openingTimeout); + if (this._componentRef.instance && this._componentRef.instance.positioningService) { + this._componentRef.instance.positioningService.destroy(); + } + this._componentFactory.detachFromApplication(this._componentRef); + }; + SuiPopupController.prototype.ngOnDestroy = function () { + this.cleanup(); + this._documentListener(); + }; + SuiPopupController.propDecorators = { + "onMouseEnter": [{ type: _angular_core.HostListener, args: ["mouseenter",] },], + "onMouseLeave": [{ type: _angular_core.HostListener, args: ["mouseleave",] },], + "onClick": [{ type: _angular_core.HostListener, args: ["click",] },], + "onFocusIn": [{ type: _angular_core.HostListener, args: ["focusin",] },], + "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout", ["$event"],] },], + }; + return SuiPopupController; +}()); + +var __extends$6 = (undefined && undefined.__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 __()); + }; +})(); +var SuiPopupComponentController = /** @class */ (function (_super) { + __extends$6(SuiPopupComponentController, _super); + function SuiPopupComponentController(renderer, element, componentFactory, _component, config) { + var _this = _super.call(this, renderer, element, componentFactory, config) || this; + _this._component = _component; + return _this; + } + Object.defineProperty(SuiPopupComponentController.prototype, "componentInstance", { + get: function () { + if (this._contentComponentRef) { + return this._contentComponentRef.instance; + } + }, + enumerable: true, + configurable: true + }); + SuiPopupComponentController.prototype.open = function () { + if (!this._contentComponentRef) { + this._contentComponentRef = this._componentFactory.createComponent(this._component); + this._componentFactory.attachToView(this._contentComponentRef, this.popup.templateSibling); + } + _super.prototype.open.call(this); + }; + SuiPopupComponentController.prototype.cleanup = function () { + _super.prototype.cleanup.call(this); + if (this._contentComponentRef) { + this._contentComponentRef.destroy(); + this._contentComponentRef = undefined; + } + }; + return SuiPopupComponentController; +}(SuiPopupController)); + +var __extends$7 = (undefined && undefined.__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 __()); + }; +})(); +var TemplatePopupConfig = /** @class */ (function (_super) { + __extends$7(TemplatePopupConfig, _super); + function TemplatePopupConfig() { + return _super !== null && _super.apply(this, arguments) || this; + } + return TemplatePopupConfig; +}(PopupConfig)); +var SuiPopupTemplateController = /** @class */ (function (_super) { + __extends$7(SuiPopupTemplateController, _super); + function SuiPopupTemplateController(renderer, element, componentFactory, config) { + return _super.call(this, renderer, element, componentFactory, config) || this; + } + SuiPopupTemplateController.prototype.configure = function (config) { + _super.prototype.configure.call(this, config); + if (config) { + this.template = config.template; + this.context = config.context; + } + }; + SuiPopupTemplateController.prototype.open = function () { + // If there is a template, inject it into the view. + if (this.template) { + this.popup.templateSibling.clear(); + this._componentFactory.createView(this.popup.templateSibling, this.template, { + $implicit: this.popup, + context: this.context + }); + } + _super.prototype.open.call(this); + }; + return SuiPopupTemplateController; +}(SuiPopupController)); + +var SuiPopupArrow = /** @class */ (function () { + function SuiPopupArrow() { + } + Object.defineProperty(SuiPopupArrow.prototype, "direction", { + get: function () { + if (this.placement) { + return this.placement.split(" ").shift(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupArrow.prototype, "alignment", { + get: function () { + if (this.placement) { + var alignment = this.placement.split(" ").pop(); + if (alignment === this.direction) { + return "center"; + } + return alignment; + } + }, + enumerable: true, + configurable: true + }); + SuiPopupArrow.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-popup-arrow", + template: "\n
\n
\n", + styles: ["\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction=\"top\"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction=\"left\"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction=\"bottom\"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction=\"right\"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"left\"],\n.static.arrow[direction=\"top\"][alignment=\"left\"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"top\"],\n.static.arrow[direction=\"right\"][alignment=\"top\"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"right\"],\n.static.arrow[direction=\"top\"][alignment=\"right\"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"bottom\"],\n.static.arrow[direction=\"right\"][alignment=\"bottom\"] {\n top: auto;\n bottom: 1em;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiPopupArrow.ctorParameters = function () { return []; }; + SuiPopupArrow.propDecorators = { + "placement": [{ type: _angular_core.Input },], + "inverted": [{ type: _angular_core.HostBinding, args: ["class.inverted",] }, { type: _angular_core.Input },], + }; + return SuiPopupArrow; +}()); + +var __extends$9 = (undefined && undefined.__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 __()); + }; +})(); +var SuiPopupConfig = /** @class */ (function (_super) { + __extends$9(SuiPopupConfig, _super); + function SuiPopupConfig() { + // We use an empty constructor to ensure Angular DI works correctly. + return _super.call(this) || this; + } + SuiPopupConfig.decorators = [ + { type: _angular_core.Injectable }, + ]; + /** @nocollapse */ + SuiPopupConfig.ctorParameters = function () { return []; }; + return SuiPopupConfig; +}(PopupConfig)); + +var __extends$8 = (undefined && undefined.__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 __()); + }; +})(); +var SuiPopupDirective = /** @class */ (function (_super) { + __extends$8(SuiPopupDirective, _super); + function SuiPopupDirective(renderer, element, componentFactory, popupDefaults) { + return _super.call(this, renderer, element, componentFactory, new PopupConfig(popupDefaults)) || this; + } + Object.defineProperty(SuiPopupDirective.prototype, "popupHeader", { + set: function (header) { + this.popup.config.header = header; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupText", { + set: function (text) { + this.popup.config.text = text; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupInverted", { + set: function (inverted) { + this.popup.config.isInverted = Util.DOM.parseBooleanAttribute(inverted); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupBasic", { + set: function (basic) { + this.popup.config.isBasic = Util.DOM.parseBooleanAttribute(basic); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupTransition", { + set: function (transition) { + this.popup.config.transition = transition; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupTransitionDuration", { + set: function (duration) { + this.popup.config.transitionDuration = duration; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupPlacement", { + set: function (placement) { + this.popup.config.placement = placement; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupDelay", { + set: function (delay) { + this.popup.config.delay = delay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupTrigger", { + get: function () { + return this.popup.config.trigger; + }, + set: function (trigger) { + this.popup.config.trigger = trigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupTemplate", { + set: function (template) { + this.template = template; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupTemplateContext", { + set: function (context) { + this.context = context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupConfig", { + set: function (config) { + this.configure(config); + }, + enumerable: true, + configurable: true + }); + SuiPopupDirective.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "[suiPopup]", + exportAs: "suiPopup" + },] }, + ]; + /** @nocollapse */ + SuiPopupDirective.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + { type: SuiComponentFactory, }, + { type: SuiPopupConfig, }, + ]; }; + SuiPopupDirective.propDecorators = { + "popupHeader": [{ type: _angular_core.Input },], + "popupText": [{ type: _angular_core.Input },], + "popupInverted": [{ type: _angular_core.Input },], + "popupBasic": [{ type: _angular_core.Input },], + "popupTransition": [{ type: _angular_core.Input },], + "popupTransitionDuration": [{ type: _angular_core.Input },], + "popupPlacement": [{ type: _angular_core.Input },], + "popupDelay": [{ type: _angular_core.Input },], + "popupTrigger": [{ type: _angular_core.Input },], + "popupTemplate": [{ type: _angular_core.Input },], + "popupTemplateContext": [{ type: _angular_core.Input },], + "popupConfig": [{ type: _angular_core.Input },], + }; + return SuiPopupDirective; +}(SuiPopupTemplateController)); + +var SuiPopupModule = /** @class */ (function () { + function SuiPopupModule() { + } + SuiPopupModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule, + SuiTransitionModule, + SuiUtilityModule + ], + declarations: [ + SuiPopupDirective, + SuiPopupArrow, + SuiPopup + ], + exports: [ + SuiPopupDirective, + SuiPopup + ], + providers: [ + SuiPopupConfig + ], + entryComponents: [ + SuiPopup + ] + },] }, + ]; + /** @nocollapse */ + SuiPopupModule.ctorParameters = function () { return []; }; + return SuiPopupModule; +}()); + +var __extends$5 = (undefined && undefined.__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 __()); + }; +})(); +var SuiDatepickerDirective = /** @class */ (function (_super) { + __extends$5(SuiDatepickerDirective, _super); + function SuiDatepickerDirective(renderer, element, componentFactory, localizationService) { + var _this = _super.call(this, renderer, element, componentFactory, SuiDatepicker, new PopupConfig({ + trigger: PopupTrigger.Focus, + placement: PositioningPlacement.BottomLeft, + transition: "scale", + transitionDuration: 200 + })) || this; + _this.renderer = renderer; + _this.localizationService = localizationService; + // This ensures the popup is drawn correctly (i.e. no border). + // This ensures the popup is drawn correctly (i.e. no border). + _this.renderer.addClass(_this.popup.elementRef.nativeElement, "ui"); + _this.renderer.addClass(_this.popup.elementRef.nativeElement, "calendar"); + _this.onLocaleUpdate(); + _this.localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); + _this.onSelectedDateChange = new _angular_core.EventEmitter(); + _this.onValidatorChange = new _angular_core.EventEmitter(); + _this.mode = DatepickerMode.Datetime; + return _this; + } + Object.defineProperty(SuiDatepickerDirective.prototype, "selectedDate", { + get: function () { + return this._selectedDate; + }, + set: function (date) { + this._selectedDate = date; + this.onSelectedDateChange.emit(date); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerDirective.prototype, "mode", { + get: function () { + return this._mode; + }, + set: function (mode) { + this._mode = mode || DatepickerMode.Datetime; + switch (this._mode) { + case DatepickerMode.Year: + this.config = new YearConfig(); + break; + case DatepickerMode.Month: + this.config = new MonthConfig(); + break; + case DatepickerMode.Date: + default: + this.config = new DateConfig(); + break; + case DatepickerMode.Datetime: + this.config = new DatetimeConfig(); + break; + case DatepickerMode.Time: + this.config = new TimeConfig(); + break; + } + this.writeValue(this.selectedDate); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerDirective.prototype, "localeValues", { + get: function () { + return this.localizationService.override(this._localeValues, this.localeOverrides); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerDirective.prototype, "placement", { + set: function (placement) { + this.popup.config.placement = placement; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerDirective.prototype, "transition", { + set: function (transition) { + this.popup.config.transition = transition; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerDirective.prototype, "transitionDuration", { + set: function (duration) { + this.popup.config.transitionDuration = duration; + }, + enumerable: true, + configurable: true + }); + SuiDatepickerDirective.prototype.popupOnOpen = function () { + var _this = this; + if (this.componentInstance) { + this.componentInstance.service.config = this.config; + this.componentInstance.service.localeValues = this.localeValues; + this.componentInstance.service.currentDate = this.initialDate || new Date(); + this.componentInstance.service.selectedDate = this.selectedDate; + this.componentInstance.service.maxDate = this.maxDate; + this.componentInstance.service.minDate = this.minDate; + if (this.firstDayOfWeek != undefined) { + this.componentInstance.service.firstDayOfWeek = this.firstDayOfWeek; + } + this.componentInstance.service.reset(); + this.componentInstance.service.onDateChange.subscribe(function (d) { + _this.selectedDate = d; + _this.close(); + }); + } + }; + SuiDatepickerDirective.prototype.ngOnChanges = function (_a) { + var maxDate = _a.maxDate, minDate = _a.minDate, mode = _a.mode; + if (maxDate || minDate || mode) { + this.onValidatorChange.emit(); + } + }; + SuiDatepickerDirective.prototype.onLocaleUpdate = function () { + this._localeValues = this.localizationService.get().datepicker; + }; + SuiDatepickerDirective.prototype.validate = function (c) { + var value = c.value; + if (value != undefined) { + // We post process the min & max date because sometimes this puts the date outside of the allowed range. + if (this.minDate && value < this.minDate) { + return { suiMinDate: { required: this.minDate, actual: value } }; + } + if (this.maxDate && value > this.maxDate) { + return { suiMaxDate: { required: this.maxDate, actual: value } }; + } + } + // Angular expects null + // tslint:disable-next-line:no-null-keyword + return null; + }; + SuiDatepickerDirective.prototype.writeValue = function (value) { + this.selectedDate = value; + if (this.componentInstance) { + this.componentInstance.service.selectedDate = value; + } + }; + SuiDatepickerDirective.prototype.onKeyDown = function (e) { + if (e.keyCode === exports.KeyCode.Escape) { + this.close(); + } + }; + SuiDatepickerDirective.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "[suiDatepicker]", + providers: [customValidatorFactory(SuiDatepickerDirective)] + },] }, + ]; + /** @nocollapse */ + SuiDatepickerDirective.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + { type: SuiComponentFactory, }, + { type: SuiLocalizationService, }, + ]; }; + SuiDatepickerDirective.propDecorators = { + "mode": [{ type: _angular_core.Input, args: ["pickerMode",] },], + "initialDate": [{ type: _angular_core.Input, args: ["pickerInitialDate",] },], + "maxDate": [{ type: _angular_core.Input, args: ["pickerMaxDate",] },], + "minDate": [{ type: _angular_core.Input, args: ["pickerMinDate",] },], + "firstDayOfWeek": [{ type: _angular_core.Input, args: ["pickerFirstDayOfWeek",] },], + "localeOverrides": [{ type: _angular_core.Input, args: ["pickerLocaleOverrides",] },], + "placement": [{ type: _angular_core.Input, args: ["pickerPlacement",] },], + "transition": [{ type: _angular_core.Input, args: ["pickerTransition",] },], + "transitionDuration": [{ type: _angular_core.Input, args: ["pickerTransitionDuration",] },], + "onSelectedDateChange": [{ type: _angular_core.Output, args: ["pickerSelectedDateChange",] },], + "onValidatorChange": [{ type: _angular_core.Output, args: ["pickerValidatorChange",] },], + "onKeyDown": [{ type: _angular_core.HostListener, args: ["keydown", ["$event"],] },], + }; + return SuiDatepickerDirective; +}(SuiPopupComponentController)); +var SuiDatepickerDirectiveValueAccessor = /** @class */ (function (_super) { + __extends$5(SuiDatepickerDirectiveValueAccessor, _super); + function SuiDatepickerDirectiveValueAccessor(host) { + var _this = _super.call(this, host) || this; + _this.host = host; + return _this; + } + SuiDatepickerDirectiveValueAccessor.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "[suiDatepicker]", + host: { "(pickerSelectedDateChange)": "onChange($event)" }, + providers: [customValueAccessorFactory(SuiDatepickerDirectiveValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiDatepickerDirectiveValueAccessor.ctorParameters = function () { return [ + { type: SuiDatepickerDirective, }, + ]; }; + return SuiDatepickerDirectiveValueAccessor; +}(CustomValueAccessor)); +var SuiDatepickerDirectiveValidator = /** @class */ (function (_super) { + __extends$5(SuiDatepickerDirectiveValidator, _super); + function SuiDatepickerDirectiveValidator(host) { + var _this = _super.call(this, host) || this; + _this.host = host; + return _this; + } + SuiDatepickerDirectiveValidator.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "[suiDatepicker]", + host: { "(pickerValidatorChange)": "onValidatorChange()" }, + providers: [customValidatorFactory(SuiDatepickerDirectiveValidator)] + },] }, + ]; + /** @nocollapse */ + SuiDatepickerDirectiveValidator.ctorParameters = function () { return [ + { type: SuiDatepickerDirective, }, + ]; }; + return SuiDatepickerDirectiveValidator; +}(CustomValidator)); + +var bowser = createCommonjsModule(function (module) { +/*! + * Bowser - a browser detector + * https://github.com/ded/bowser + * MIT License | (c) Dustin Diaz 2015 + */ + +!function (root, name, definition) { + if ('object' != 'undefined' && module.exports) module.exports = definition(); + else if (typeof undefined == 'function' && undefined.amd) undefined(name, definition); + else root[name] = definition(); +}(commonjsGlobal, 'bowser', function () { + /** + * See useragents.js for examples of navigator.userAgent + */ + + var t = true; + + function detect(ua) { + + function getFirstMatch(regex) { + var match = ua.match(regex); + return (match && match.length > 1 && match[1]) || ''; + } + + function getSecondMatch(regex) { + var match = ua.match(regex); + return (match && match.length > 1 && match[2]) || ''; + } + + var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase() + , likeAndroid = /like android/i.test(ua) + , android = !likeAndroid && /android/i.test(ua) + , nexusMobile = /nexus\s*[0-6]\s*/i.test(ua) + , nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua) + , chromeos = /CrOS/.test(ua) + , silk = /silk/i.test(ua) + , sailfish = /sailfish/i.test(ua) + , tizen = /tizen/i.test(ua) + , webos = /(web|hpw)os/i.test(ua) + , windowsphone = /windows phone/i.test(ua) + , samsungBrowser = /SamsungBrowser/i.test(ua) + , windows = !windowsphone && /windows/i.test(ua) + , mac = !iosdevice && !silk && /macintosh/i.test(ua) + , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua) + , edgeVersion = getSecondMatch(/edg([ea]|ios)\/(\d+(\.\d+)?)/i) + , versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) + , tablet = /tablet/i.test(ua) && !/tablet pc/i.test(ua) + , mobile = !tablet && /[^-]mobi/i.test(ua) + , xbox = /xbox/i.test(ua) + , result; + + if (/opera/i.test(ua)) { + // an old Opera + result = { + name: 'Opera' + , opera: t + , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) + }; + } else if (/opr\/|opios/i.test(ua)) { + // a new Opera + result = { + name: 'Opera' + , opera: t + , version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier + }; + } + else if (/SamsungBrowser/i.test(ua)) { + result = { + name: 'Samsung Internet for Android' + , samsungBrowser: t + , version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i) + }; + } + else if (/coast/i.test(ua)) { + result = { + name: 'Opera Coast' + , coast: t + , version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) + }; + } + else if (/yabrowser/i.test(ua)) { + result = { + name: 'Yandex Browser' + , yandexbrowser: t + , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) + }; + } + else if (/ucbrowser/i.test(ua)) { + result = { + name: 'UC Browser' + , ucbrowser: t + , version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) + }; + } + else if (/mxios/i.test(ua)) { + result = { + name: 'Maxthon' + , maxthon: t + , version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) + }; + } + else if (/epiphany/i.test(ua)) { + result = { + name: 'Epiphany' + , epiphany: t + , version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) + }; + } + else if (/puffin/i.test(ua)) { + result = { + name: 'Puffin' + , puffin: t + , version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) + }; + } + else if (/sleipnir/i.test(ua)) { + result = { + name: 'Sleipnir' + , sleipnir: t + , version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) + }; + } + else if (/k-meleon/i.test(ua)) { + result = { + name: 'K-Meleon' + , kMeleon: t + , version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) + }; + } + else if (windowsphone) { + result = { + name: 'Windows Phone' + , osname: 'Windows Phone' + , windowsphone: t + }; + if (edgeVersion) { + result.msedge = t; + result.version = edgeVersion; + } + else { + result.msie = t; + result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i); + } + } + else if (/msie|trident/i.test(ua)) { + result = { + name: 'Internet Explorer' + , msie: t + , version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) + }; + } else if (chromeos) { + result = { + name: 'Chrome' + , osname: 'Chrome OS' + , chromeos: t + , chromeBook: t + , chrome: t + , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) + }; + } else if (/edg([ea]|ios)/i.test(ua)) { + result = { + name: 'Microsoft Edge' + , msedge: t + , version: edgeVersion + }; + } + else if (/vivaldi/i.test(ua)) { + result = { + name: 'Vivaldi' + , vivaldi: t + , version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier + }; + } + else if (sailfish) { + result = { + name: 'Sailfish' + , osname: 'Sailfish OS' + , sailfish: t + , version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i) + }; + } + else if (/seamonkey\//i.test(ua)) { + result = { + name: 'SeaMonkey' + , seamonkey: t + , version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i) + }; + } + else if (/firefox|iceweasel|fxios/i.test(ua)) { + result = { + name: 'Firefox' + , firefox: t + , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) + }; + if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { + result.firefoxos = t; + result.osname = 'Firefox OS'; + } + } + else if (silk) { + result = { + name: 'Amazon Silk' + , silk: t + , version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) + }; + } + else if (/phantom/i.test(ua)) { + result = { + name: 'PhantomJS' + , phantom: t + , version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i) + }; + } + else if (/slimerjs/i.test(ua)) { + result = { + name: 'SlimerJS' + , slimer: t + , version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i) + }; + } + else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) { + result = { + name: 'BlackBerry' + , osname: 'BlackBerry OS' + , blackberry: t + , version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i) + }; + } + else if (webos) { + result = { + name: 'WebOS' + , osname: 'WebOS' + , webos: t + , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) + }; + /touchpad\//i.test(ua) && (result.touchpad = t); + } + else if (/bada/i.test(ua)) { + result = { + name: 'Bada' + , osname: 'Bada' + , bada: t + , version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i) + }; + } + else if (tizen) { + result = { + name: 'Tizen' + , osname: 'Tizen' + , tizen: t + , version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier + }; + } + else if (/qupzilla/i.test(ua)) { + result = { + name: 'QupZilla' + , qupzilla: t + , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier + }; + } + else if (/chromium/i.test(ua)) { + result = { + name: 'Chromium' + , chromium: t + , version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier + }; + } + else if (/chrome|crios|crmo/i.test(ua)) { + result = { + name: 'Chrome' + , chrome: t + , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) + }; + } + else if (android) { + result = { + name: 'Android' + , version: versionIdentifier + }; + } + else if (/safari|applewebkit/i.test(ua)) { + result = { + name: 'Safari' + , safari: t + }; + if (versionIdentifier) { + result.version = versionIdentifier; + } + } + else if (iosdevice) { + result = { + name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod' + }; + // WTF: version is not part of user agent in web apps + if (versionIdentifier) { + result.version = versionIdentifier; + } + } + else if(/googlebot/i.test(ua)) { + result = { + name: 'Googlebot' + , googlebot: t + , version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier + }; + } + else { + result = { + name: getFirstMatch(/^(.*)\/(.*) /), + version: getSecondMatch(/^(.*)\/(.*) /) + }; + } + + // set webkit or gecko flag for browsers based on these engines + if (!result.msedge && /(apple)?webkit/i.test(ua)) { + if (/(apple)?webkit\/537\.36/i.test(ua)) { + result.name = result.name || "Blink"; + result.blink = t; + } else { + result.name = result.name || "Webkit"; + result.webkit = t; + } + if (!result.version && versionIdentifier) { + result.version = versionIdentifier; + } + } else if (!result.opera && /gecko\//i.test(ua)) { + result.name = result.name || "Gecko"; + result.gecko = t; + result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i); + } + + // set OS flags for platforms that have multiple browsers + if (!result.windowsphone && (android || result.silk)) { + result.android = t; + result.osname = 'Android'; + } else if (!result.windowsphone && iosdevice) { + result[iosdevice] = t; + result.ios = t; + result.osname = 'iOS'; + } else if (mac) { + result.mac = t; + result.osname = 'macOS'; + } else if (xbox) { + result.xbox = t; + result.osname = 'Xbox'; + } else if (windows) { + result.windows = t; + result.osname = 'Windows'; + } else if (linux) { + result.linux = t; + result.osname = 'Linux'; + } + + function getWindowsVersion (s) { + switch (s) { + case 'NT': return 'NT' + case 'XP': return 'XP' + case 'NT 5.0': return '2000' + case 'NT 5.1': return 'XP' + case 'NT 5.2': return '2003' + case 'NT 6.0': return 'Vista' + case 'NT 6.1': return '7' + case 'NT 6.2': return '8' + case 'NT 6.3': return '8.1' + case 'NT 10.0': return '10' + default: return undefined + } + } + + // OS version extraction + var osVersion = ''; + if (result.windows) { + osVersion = getWindowsVersion(getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i)); + } else if (result.windowsphone) { + osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); + } else if (result.mac) { + osVersion = getFirstMatch(/Mac OS X (\d+([_\.\s]\d+)*)/i); + osVersion = osVersion.replace(/[_\s]/g, '.'); + } else if (iosdevice) { + osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i); + osVersion = osVersion.replace(/[_\s]/g, '.'); + } else if (android) { + osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i); + } else if (result.webos) { + osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); + } else if (result.blackberry) { + osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); + } else if (result.bada) { + osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i); + } else if (result.tizen) { + osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i); + } + if (osVersion) { + result.osversion = osVersion; + } + + // device type extraction + var osMajorVersion = !result.windows && osVersion.split('.')[0]; + if ( + tablet + || nexusTablet + || iosdevice == 'ipad' + || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile))) + || result.silk + ) { + result.tablet = t; + } else if ( + mobile + || iosdevice == 'iphone' + || iosdevice == 'ipod' + || android + || nexusMobile + || result.blackberry + || result.webos + || result.bada + ) { + result.mobile = t; + } + + // Graded Browser Support + // http://developer.yahoo.com/yui/articles/gbs + if (result.msedge || + (result.msie && result.version >= 10) || + (result.yandexbrowser && result.version >= 15) || + (result.vivaldi && result.version >= 1.0) || + (result.chrome && result.version >= 20) || + (result.samsungBrowser && result.version >= 4) || + (result.firefox && result.version >= 20.0) || + (result.safari && result.version >= 6) || + (result.opera && result.version >= 10.0) || + (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || + (result.blackberry && result.version >= 10.1) + || (result.chromium && result.version >= 20) + ) { + result.a = t; + } + else if ((result.msie && result.version < 10) || + (result.chrome && result.version < 20) || + (result.firefox && result.version < 20.0) || + (result.safari && result.version < 6) || + (result.opera && result.version < 10.0) || + (result.ios && result.osversion && result.osversion.split(".")[0] < 6) + || (result.chromium && result.version < 20) + ) { + result.c = t; + } else result.x = t; + + return result + } + + var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : ''); + + bowser.test = function (browserList) { + for (var i = 0; i < browserList.length; ++i) { + var browserItem = browserList[i]; + if (typeof browserItem=== 'string') { + if (browserItem in bowser) { + return true; + } + } + } + return false; + }; + + /** + * Get version precisions count + * + * @example + * getVersionPrecision("1.10.3") // 3 + * + * @param {string} version + * @return {number} + */ + function getVersionPrecision(version) { + return version.split(".").length; + } + + /** + * Array::map polyfill + * + * @param {Array} arr + * @param {Function} iterator + * @return {Array} + */ + function map(arr, iterator) { + var result = [], i; + if (Array.prototype.map) { + return Array.prototype.map.call(arr, iterator); + } + for (i = 0; i < arr.length; i++) { + result.push(iterator(arr[i])); + } + return result; + } + + /** + * Calculate browser version weight + * + * @example + * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 + * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 + * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 + * compareVersions(['1.10.2.1', '1.0800.2']); // -1 + * + * @param {Array} versions versions to compare + * @return {Number} comparison result + */ + function compareVersions(versions) { + // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 + var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); + var chunks = map(versions, function (version) { + var delta = precision - getVersionPrecision(version); + + // 2) "9" -> "9.0" (for precision = 2) + version = version + new Array(delta + 1).join(".0"); + + // 3) "9.0" -> ["000000000"", "000000009"] + return map(version.split("."), function (chunk) { + return new Array(20 - chunk.length).join("0") + chunk; + }).reverse(); + }); + + // iterate in reverse order by reversed chunks array + while (--precision >= 0) { + // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) + if (chunks[0][precision] > chunks[1][precision]) { + return 1; + } + else if (chunks[0][precision] === chunks[1][precision]) { + if (precision === 0) { + // all version chunks are same + return 0; + } + } + else { + return -1; + } + } + } + + /** + * Check if browser is unsupported + * + * @example + * bowser.isUnsupportedBrowser({ + * msie: "10", + * firefox: "23", + * chrome: "29", + * safari: "5.1", + * opera: "16", + * phantom: "534" + * }); + * + * @param {Object} minVersions map of minimal version to browser + * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map + * @param {String} [ua] user agent string + * @return {Boolean} + */ + function isUnsupportedBrowser(minVersions, strictMode, ua) { + var _bowser = bowser; + + // make strictMode param optional with ua param usage + if (typeof strictMode === 'string') { + ua = strictMode; + strictMode = void(0); + } + + if (strictMode === void(0)) { + strictMode = false; + } + if (ua) { + _bowser = detect(ua); + } + + var version = "" + _bowser.version; + for (var browser in minVersions) { + if (minVersions.hasOwnProperty(browser)) { + if (_bowser[browser]) { + if (typeof minVersions[browser] !== 'string') { + throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions)); + } + + // browser version and min supported version. + return compareVersions([version, minVersions[browser]]) < 0; + } + } + } + + return strictMode; // not found + } + + /** + * Check if browser is supported + * + * @param {Object} minVersions map of minimal version to browser + * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map + * @param {String} [ua] user agent string + * @return {Boolean} + */ + function check(minVersions, strictMode, ua) { + return !isUnsupportedBrowser(minVersions, strictMode, ua); + } + + bowser.isUnsupportedBrowser = isUnsupportedBrowser; + bowser.compareVersions = compareVersions; + bowser.check = check; + + /* + * Set our detect method to the main bowser object so we can + * reuse it to test other user agents. + * This is needed to implement future tests. + */ + bowser._detect = detect; + + /* + * Set our detect public method to the main bowser object + * This is needed to implement bowser in server side + */ + bowser.detect = detect; + return bowser +}); +}); + +var bowser_1 = bowser.mobile; +var bowser_2 = bowser.tablet; + +var rules$1 = [ + // if it says it's a webview, let's go with that + 'WebView', + // iOS webview will be the same as safari but missing "Safari" + '(iPhone|iPod|iPad)(?!.*Safari)', + // Android Lollipop and Above: webview will be the same as native but it will contain "wv" + // Android KitKat to lollipop webview will put {version}.0.0.0 + 'Android.*(wv|\.0\.0\.0)', + // old chrome android webview agent + 'Linux; U; Android' +]; + +var rules = rules$1; +var webviewRegExp = new RegExp('(' + rules.join('|') + ')', 'ig'); + +var index$28 = function isWebview(ua) { + return !!ua.match(webviewRegExp) +}; + + + +var isUAWebView = Object.freeze({ + default: index$28, + __moduleExports: index$28 +}); + +var isWebView = index$28 || isUAWebView; +var SuiDatepickerInputDirective = /** @class */ (function () { + function SuiDatepickerInputDirective(datepicker, valueAccessor, element, localizationService) { + var _this = this; + this.datepicker = datepicker; + this.valueAccessor = valueAccessor; + this.element = element; + this.useNativeOnMobile = true; + this.fallbackActive = false; + // Whenever the datepicker value updates, update the input text alongside it. + this.datepicker.onSelectedDateChange.subscribe(function () { + return _this.updateValue(_this.selectedDateString); + }); + localizationService.onLanguageUpdate.subscribe(function () { + return _this.updateValue(_this.selectedDateString); + }); + } + Object.defineProperty(SuiDatepickerInputDirective.prototype, "useNativeOnMobile", { + get: function () { + return this._useNativeOnMobile; + }, + set: function (fallback) { + this._useNativeOnMobile = fallback; + var isOnMobile = bowser_1 || bowser_2 || isWebView(navigator.userAgent); + this.fallbackActive = this.useNativeOnMobile && isOnMobile; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "fallbackActive", { + get: function () { + return this._fallbackActive; + }, + set: function (active) { + this._fallbackActive = active; + // If the fallback is active, then the trigger must be manual so the datepicker never opens. + this.datepicker.popup.config.trigger = this.fallbackActive ? PopupTrigger.Manual : PopupTrigger.Focus; + // Update the input value (this will insert the `T` as required). + this.updateValue(this.selectedDateString); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "parser", { + get: function () { + if (this.fallbackActive) { + return new InternalDateParser(this.datepicker.mode, this.datepicker.localeValues); + } + return new DateParser(this.datepicker.localeValues.formats[this.datepicker.mode], this.datepicker.localeValues); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "selectedDateString", { + get: function () { + if (this.datepicker.selectedDate) { + return this.parser.format(this.datepicker.selectedDate); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "type", { + get: function () { + if (this.fallbackActive) { + return this.datepicker.config.fallback; + } + return "text"; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "max", { + get: function () { + if (this.fallbackActive && this.datepicker.maxDate) { + // Since HTML doesn't use a date object max is somewhat tricky. + // Our Datepicker will always choose the 1st date on the provided precision, + // meaning anything below the maxDate will work, hence endOf. + var max = DateUtil.endOf(this.datepicker.config.precision, DateUtil.clone(this.datepicker.maxDate)); + return this.parser.format(max); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "min", { + get: function () { + if (this.fallbackActive && this.datepicker.minDate) { + // Since HTML doesn't use a date object min is somewhat tricky. + // We use 1 minute before the next date at the configured precision since + // our Datepicker picks the first available date at that precision. + var min = DateUtil.clone(this.datepicker.minDate); + return this.parser.format(min); + } + }, + enumerable: true, + configurable: true + }); + SuiDatepickerInputDirective.prototype.updateValue = function (value) { + // Only update the current value if it is different to what it's being updated to. + // This is so that the editing position isn't changed when manually typing the date. + if (!this._lastUpdateTyped) { + this.datepicker.renderer.setProperty(this.element.nativeElement, "value", value || ""); + } + this._lastUpdateTyped = false; + }; + SuiDatepickerInputDirective.prototype.typeValue = function (value) { + this._lastUpdateTyped = true; + this._currentInputValue = value; + if (!value) { + // Delete the selected date if no date was entered manually. + return this.datepicker.writeValue(undefined); + } + var parsed = this.parser.parse(value, this.datepicker.selectedDate); + if (!isNaN(parsed.getTime()) && value === this.parser.format(parsed)) { + return this.datepicker.writeValue(parsed); + } + return this.datepicker.writeValue(undefined); + }; + SuiDatepickerInputDirective.prototype.onFocusOut = function () { + this.valueAccessor.onTouched(); + }; + SuiDatepickerInputDirective.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "input[suiDatepicker]" + },] }, + ]; + /** @nocollapse */ + SuiDatepickerInputDirective.ctorParameters = function () { return [ + { type: SuiDatepickerDirective, decorators: [{ type: _angular_core.Host },] }, + { type: SuiDatepickerDirectiveValueAccessor, decorators: [{ type: _angular_core.Host },] }, + { type: _angular_core.ElementRef, }, + { type: SuiLocalizationService, }, + ]; }; + SuiDatepickerInputDirective.propDecorators = { + "useNativeOnMobile": [{ type: _angular_core.Input, args: ["pickerUseNativeOnMobile",] },], + "type": [{ type: _angular_core.HostBinding, args: ["attr.type",] },], + "max": [{ type: _angular_core.HostBinding, args: ["attr.max",] },], + "min": [{ type: _angular_core.HostBinding, args: ["attr.min",] },], + "typeValue": [{ type: _angular_core.HostListener, args: ["input", ["$event.target.value"],] },], + "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout",] },], + }; + return SuiDatepickerInputDirective; +}()); + +var __extends$10 = (undefined && undefined.__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 __()); + }; +})(); +var CalendarRangeDateService = /** @class */ (function (_super) { + __extends$10(CalendarRangeDateService, _super); + function CalendarRangeDateService() { + return _super !== null && _super.apply(this, arguments) || this; + } + CalendarRangeDateService.prototype.calcStart = function (start) { + var monthStart = DateUtil.startOf(exports.DatePrecision.Month, DateUtil.clone(start)); + monthStart.setDate((1 - monthStart.getDay() + this.service.firstDayOfWeek - 7) % 7); + return monthStart; + }; + CalendarRangeDateService.prototype.configureItem = function (item, baseDate) { + item.humanReadable = item.date.getDate().toString(); + item.isOutsideRange = item.date.getMonth() !== baseDate.getMonth(); + item.isSelectable = item.isDisabled; + }; + return CalendarRangeDateService; +}(CalendarRangeService)); +var SuiCalendarDateView = /** @class */ (function (_super) { + __extends$10(SuiCalendarDateView, _super); + function SuiCalendarDateView(renderer) { + return _super.call(this, renderer, exports.CalendarViewType.Date, new CalendarRangeDateService(exports.DatePrecision.Month, 6, 7)) || this; + } + Object.defineProperty(SuiCalendarDateView.prototype, "days", { + get: function () { + var _this = this; + var days = this.service.localeValues.weekdaysNarrow; + return days.map(function (d, i) { return days[(i + _this.service.firstDayOfWeek) % days.length]; }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCalendarDateView.prototype, "date", { + get: function () { + return new DateParser(this.service.localeValues.formats.month, this.service.localeValues).format(this.currentDate); + }, + enumerable: true, + configurable: true + }); + SuiCalendarDateView.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-calendar-date-view", + template: "\n\n\n \n \n \n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ day }}
{{ item.humanReadable }}\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiCalendarDateView.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + ]; }; + return SuiCalendarDateView; +}(CalendarView)); + +var __extends$11 = (undefined && undefined.__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 __()); + }; +})(); +var CalendarRangeHourService = /** @class */ (function (_super) { + __extends$11(CalendarRangeHourService, _super); + function CalendarRangeHourService() { + return _super !== null && _super.apply(this, arguments) || this; + } + CalendarRangeHourService.prototype.configureItem = function (item, baseDate) { + // Set minutes and seconds to 0 + var customFormat = this.service.localeValues.formats.time.replace(/[ms]/g, "0"); + item.humanReadable = new DateParser(customFormat, this.service.localeValues).format(item.date); + item.isOutsideRange = false; + }; + return CalendarRangeHourService; +}(CalendarRangeService)); +var SuiCalendarHourView = /** @class */ (function (_super) { + __extends$11(SuiCalendarHourView, _super); + function SuiCalendarHourView(renderer) { + return _super.call(this, renderer, exports.CalendarViewType.Hour, new CalendarRangeHourService(exports.DatePrecision.Date, 6, 4)) || this; + } + Object.defineProperty(SuiCalendarHourView.prototype, "date", { + get: function () { + return new DateParser(this.service.localeValues.formats.date, this.service.localeValues).format(this.currentDate); + }, + enumerable: true, + configurable: true + }); + SuiCalendarHourView.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-calendar-hour-view", + template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiCalendarHourView.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + ]; }; + return SuiCalendarHourView; +}(CalendarView)); + +var __extends$12 = (undefined && undefined.__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 __()); + }; +})(); +var CalendarRangeMinuteService = /** @class */ (function (_super) { + __extends$12(CalendarRangeMinuteService, _super); + function CalendarRangeMinuteService() { + return _super !== null && _super.apply(this, arguments) || this; + } + CalendarRangeMinuteService.prototype.calcStart = function (start) { + return DateUtil.startOf(exports.DatePrecision.Hour, DateUtil.clone(start), true); + }; + CalendarRangeMinuteService.prototype.calcDates = function (start) { + return Util.Array + .range(this.length) + .map(function (i) { return DateUtil.add(exports.DatePrecision.Minute, DateUtil.clone(start), i * 5); }); + }; + CalendarRangeMinuteService.prototype.configureItem = function (item, baseDate) { + item.humanReadable = new DateParser(this.service.localeValues.formats.time, this.service.localeValues).format(item.date); + item.isOutsideRange = false; + }; + return CalendarRangeMinuteService; +}(CalendarRangeService)); +var SuiCalendarMinuteView = /** @class */ (function (_super) { + __extends$12(SuiCalendarMinuteView, _super); + function SuiCalendarMinuteView(renderer) { + return _super.call(this, renderer, exports.CalendarViewType.Minute, new CalendarRangeMinuteService(exports.DatePrecision.Hour, 4, 3)) || this; + } + Object.defineProperty(SuiCalendarMinuteView.prototype, "date", { + get: function () { + if (this.service.config.mode !== exports.CalendarMode.TimeOnly) { + // Set minutes and seconds to 0 + var dateTimeFormat = this.service.localeValues.formats.datetime.replace(/[ms]/g, "0"); + return new DateParser(dateTimeFormat, this.service.localeValues).format(this.currentDate); + } + else { + // Set minutes and seconds to 0 + var timeFormat = this.service.localeValues.formats.time.replace(/[ms]/g, "0"); + return new DateParser(timeFormat, this.service.localeValues).format(this.currentDate); + } + }, + enumerable: true, + configurable: true + }); + SuiCalendarMinuteView.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-calendar-minute-view", + template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiCalendarMinuteView.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + ]; }; + return SuiCalendarMinuteView; +}(CalendarView)); + +var __extends$13 = (undefined && undefined.__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 __()); + }; +})(); +var CalendarRangeMonthService = /** @class */ (function (_super) { + __extends$13(CalendarRangeMonthService, _super); + function CalendarRangeMonthService() { + return _super !== null && _super.apply(this, arguments) || this; + } + CalendarRangeMonthService.prototype.configureItem = function (item, baseDate) { + item.humanReadable = this.service.localeValues.monthsShort[item.date.getMonth()]; + item.isOutsideRange = false; + }; + return CalendarRangeMonthService; +}(CalendarRangeService)); +var SuiCalendarMonthView = /** @class */ (function (_super) { + __extends$13(SuiCalendarMonthView, _super); + function SuiCalendarMonthView(renderer) { + return _super.call(this, renderer, exports.CalendarViewType.Month, new CalendarRangeMonthService(exports.DatePrecision.Year, 4, 3)) || this; + } + Object.defineProperty(SuiCalendarMonthView.prototype, "year", { + get: function () { + return new DateParser(this.service.localeValues.formats.year, this.service.localeValues).format(this.currentDate); + }, + enumerable: true, + configurable: true + }); + SuiCalendarMonthView.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-calendar-month-view", + template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
{{ item.humanReadable }}\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiCalendarMonthView.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + ]; }; + return SuiCalendarMonthView; +}(CalendarView)); + +var __extends$14 = (undefined && undefined.__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 __()); + }; +})(); +var CalendarRangeYearService = /** @class */ (function (_super) { + __extends$14(CalendarRangeYearService, _super); + function CalendarRangeYearService() { + return _super !== null && _super.apply(this, arguments) || this; + } + CalendarRangeYearService.prototype.configureItem = function (item, baseDate) { + item.humanReadable = Util.String.padLeft(item.date.getFullYear().toString(), 4, "0"); + item.isOutsideRange = item.date.getFullYear() >= this.calcStart(baseDate).getFullYear() + 10; + }; + return CalendarRangeYearService; +}(CalendarRangeService)); +var SuiCalendarYearView = /** @class */ (function (_super) { + __extends$14(SuiCalendarYearView, _super); + function SuiCalendarYearView(renderer) { + return _super.call(this, renderer, exports.CalendarViewType.Year, new CalendarRangeYearService(exports.DatePrecision.Decade, 4, 3)) || this; + } + Object.defineProperty(SuiCalendarYearView.prototype, "decadeStart", { + get: function () { + return DateUtil + .startOf(exports.DatePrecision.Decade, DateUtil.clone(this.service.currentDate)) + .getFullYear(); + }, + enumerable: true, + configurable: true + }); + SuiCalendarYearView.prototype.pad = function (year) { + return Util.String.padLeft(year.toString(), 4, "0"); + }; + SuiCalendarYearView.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-calendar-year-view", + template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
{{ item.humanReadable }}\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiCalendarYearView.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + ]; }; + return SuiCalendarYearView; +}(CalendarView)); + +var SuiDatepickerModule = /** @class */ (function () { + function SuiDatepickerModule() { + } + SuiDatepickerModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule, + _angular_forms.FormsModule, + SuiPopupModule, + SuiLocalizationModule, + SuiUtilityModule + ], + declarations: [ + SuiCalendarItem, + SuiCalendarViewTitle, + SuiCalendarYearView, + SuiCalendarMonthView, + SuiCalendarDateView, + SuiCalendarHourView, + SuiCalendarMinuteView, + SuiDatepicker, + SuiDatepickerDirective, + SuiDatepickerDirectiveValueAccessor, + SuiDatepickerDirectiveValidator, + SuiDatepickerInputDirective + ], + exports: [ + SuiDatepickerDirective, + SuiDatepickerDirectiveValueAccessor, + SuiDatepickerDirectiveValidator, + SuiDatepickerInputDirective + ], + entryComponents: [ + SuiDatepicker + ] + },] }, + ]; + /** @nocollapse */ + SuiDatepickerModule.ctorParameters = function () { return []; }; + return SuiDatepickerModule; +}()); + +var __extends$15 = (undefined && undefined.__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 __()); + }; +})(); +var SuiDimmer = /** @class */ (function (_super) { + __extends$15(SuiDimmer, _super); + function SuiDimmer(renderer, element, changeDetector) { + var _this = _super.call(this, renderer, element, changeDetector) || this; + _this._isDimmed = false; + _this.isDimmedChange = new _angular_core.EventEmitter(); + _this.isClickable = true; + _this.wrapContent = true; + _this._dimmerClasses = true; + return _this; + } + Object.defineProperty(SuiDimmer.prototype, "isDimmed", { + get: function () { + return this._isDimmed; + }, + set: function (value) { + var isDimmed = !!value; + if (!this._transitionController) { + // Initialise transition functionality when first setting dimmed, to ensure initial state doesn't transition. + this._transitionController = new TransitionController(isDimmed, "block"); + this.setTransitionController(this._transitionController); + this._isDimmed = isDimmed; + } + else if (this._isDimmed !== isDimmed) { + this._isDimmed = isDimmed; + this._transitionController.stopAll(); + this._transitionController.animate(new Transition("fade", this.transitionDuration, isDimmed ? exports.TransitionDirection.In : exports.TransitionDirection.Out)); + } + }, + enumerable: true, + configurable: true + }); + SuiDimmer.prototype.onClick = function () { + if (this.isClickable) { + this.isDimmed = false; + this.isDimmedChange.emit(this.isDimmed); + } + }; + SuiDimmer.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-dimmer", + template: "\n
\n
\n \n
\n
\n", + styles: ["\n:host.dimmer {\n transition: none;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiDimmer.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + { type: _angular_core.ChangeDetectorRef, }, + ]; }; + SuiDimmer.propDecorators = { + "_dimmerClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.dimmer",] },], + "isDimmed": [{ type: _angular_core.HostBinding, args: ["class.active",] }, { type: _angular_core.Input },], + "isDimmedChange": [{ type: _angular_core.Output },], + "isClickable": [{ type: _angular_core.Input },], + "transition": [{ type: _angular_core.Input },], + "transitionDuration": [{ type: _angular_core.Input },], + "wrapContent": [{ type: _angular_core.Input },], + "onClick": [{ type: _angular_core.HostListener, args: ["click",] },], + }; + return SuiDimmer; +}(SuiTransition)); + +var SuiDimmerModule = /** @class */ (function () { + function SuiDimmerModule() { + } + SuiDimmerModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule, + SuiTransitionModule + ], + declarations: [ + SuiDimmer + ], + exports: [ + SuiDimmer + ] + },] }, + ]; + /** @nocollapse */ + SuiDimmerModule.ctorParameters = function () { return []; }; + return SuiDimmerModule; +}()); + +// Creates essentially a 'string' enum. +var DropdownAutoCloseType = { + ItemClick: "itemClick", + OutsideClick: "outsideClick", + Disabled: "disabled" +}; +var DropdownService = /** @class */ (function () { + function DropdownService(autoCloseMode) { + if (autoCloseMode === void 0) { autoCloseMode = DropdownAutoCloseType.ItemClick; } + this.isOpen = false; + this.isOpenChange = new _angular_core.EventEmitter(); + this.isDisabled = false; + this.autoCloseMode = autoCloseMode; + this.children = []; + } + Object.defineProperty(DropdownService.prototype, "isNested", { + get: function () { + return !!this.parent; + }, + enumerable: true, + configurable: true + }); + DropdownService.prototype.setOpenState = function (isOpen, reflectInParent) { + var _this = this; + if (reflectInParent === void 0) { reflectInParent = false; } + if (this.isOpen !== isOpen && !this.isDisabled) { + // Only update the state if it has changed, and the dropdown isn't disabled. + this.isOpen = !!isOpen; + this.isAnimating = true; + // We must delay the emitting to avoid the 'changed after checked' Angular errors. + this.delay(function () { return _this.isOpenChange.emit(_this.isOpen); }); + if (!this.isOpen) { + // Close the child dropdowns when this one closes. + this.children.forEach(function (c) { return c.setOpenState(_this.isOpen); }); + } + if (this.parent && reflectInParent) { + // Open the parent dropdowns when this one opens. + this.parent.setOpenState(this.isOpen, true); + } + } + else if (this.isOpen !== isOpen && this.isDisabled) { + // If the state has changed, but the dropdown is disabled, re-emit the original isOpen value. + this.delay(function () { return _this.isOpenChange.emit(_this.isOpen); }); + } + }; + DropdownService.prototype.setDisabledState = function (isDisabled) { + if (this.isDisabled !== isDisabled) { + if (!!isDisabled) { + // Close the dropdown as it is now disabled + this.setOpenState(false); + } + this.isDisabled = !!isDisabled; + } + }; + DropdownService.prototype.toggleOpenState = function () { + this.setOpenState(!this.isOpen); + }; + // Registers a dropdown service as a child of this service. + // Registers a dropdown service as a child of this service. + DropdownService.prototype.registerChild = + // Registers a dropdown service as a child of this service. + function (child) { + if (!this.isChildRegistered(child)) { + this.children.push(child); + child.parent = this; + } + }; + // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. + // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. + DropdownService.prototype.isChildRegistered = + // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. + function (child) { + return this === child || !!this.children + .find(function (c) { + return !!c.children + .find(function (cChild) { return cChild.isChildRegistered(child); }); + }); + }; + // Wipes any nested data, so all services can be cleanly reattached. + // Wipes any nested data, so all services can be cleanly reattached. + DropdownService.prototype.clearChildren = + // Wipes any nested data, so all services can be cleanly reattached. + function () { + this.children.forEach(function (c) { + c.parent = undefined; + }); + this.children = []; + }; + // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. + // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. + DropdownService.prototype.delay = + // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. + function (callback) { + setTimeout(function () { return callback(); }); + }; + return DropdownService; +}()); + +// element-closest | CC0-1.0 | github.com/jonathantneal/closest + +(function (ElementProto) { + if (typeof ElementProto.matches !== 'function') { + ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) { + var element = this; + var elements = (element.document || element.ownerDocument).querySelectorAll(selector); + var index = 0; + + while (elements[index] && elements[index] !== element) { + ++index; + } + + return Boolean(elements[index]); + }; + } + + if (typeof ElementProto.closest !== 'function') { + ElementProto.closest = function closest(selector) { + var element = this; + + while (element && element.nodeType === 1) { + if (element.matches(selector)) { + return element; + } + + element = element.parentNode; + } + + return null; + }; + } +})(window.Element.prototype); + +var __extends$16 = (undefined && undefined.__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 __()); + }; +})(); +var SuiDropdownMenuItem = /** @class */ (function () { + function SuiDropdownMenuItem(_renderer, element) { + this._renderer = _renderer; + this.element = element; + this.isSelected = false; + this.selectedClass = "selected"; + } + Object.defineProperty(SuiDropdownMenuItem.prototype, "isDisabled", { + get: function () { + // We must use nativeElement as Angular doesn't have a way of reading class information. + var element = this.element.nativeElement; + return element.classList.contains("disabled"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdownMenuItem.prototype, "isSelected", { + get: function () { + return this._isSelected; + }, + set: function (value) { + // Renderer is used to enable a dynamic class name. + if (value) { + this._renderer.addClass(this.element.nativeElement, this.selectedClass); + } + else { + this._renderer.removeClass(this.element.nativeElement, this.selectedClass); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdownMenuItem.prototype, "hasChildDropdown", { + get: function () { + return !!this.childDropdownMenu; + }, + enumerable: true, + configurable: true + }); + SuiDropdownMenuItem.prototype.performClick = function () { + // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. + this.element.nativeElement.click(); + }; + SuiDropdownMenuItem.decorators = [ + { type: _angular_core.Directive, args: [{ + // We must attach to every '.item' as Angular doesn't support > selectors. + selector: ".item" + },] }, + ]; + /** @nocollapse */ + SuiDropdownMenuItem.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + ]; }; + SuiDropdownMenuItem.propDecorators = { + "childDropdownMenu": [{ type: _angular_core.ContentChild, args: [_angular_core.forwardRef(function () { return SuiDropdownMenu; }),] },], + }; + return SuiDropdownMenuItem; +}()); +var SuiDropdownMenu = /** @class */ (function (_super) { + __extends$16(SuiDropdownMenu, _super); + function SuiDropdownMenu(renderer, element, changeDetector) { + var _this = _super.call(this, renderer, element, changeDetector) || this; + _this.element = element; + // Initialise transition functionality. + // Initialise transition functionality. + _this._transitionController = new TransitionController(false); + _this.setTransitionController(_this._transitionController); + _this.menuTransition = "slide down"; + _this.menuTransitionDuration = 200; + _this.menuAutoSelectFirst = false; + _this.menuSelectedItemClass = "selected"; + _this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); + return _this; + } + Object.defineProperty(SuiDropdownMenu.prototype, "service", { + get: function () { + return this._service; + }, + set: function (value) { + var _this = this; + this._service = value; + var previousIsOpen = this._service.isOpen; + this._service.isOpenChange.subscribe(function (isOpen) { + if (isOpen !== previousIsOpen) { + // Only run transitions if the open state has changed. + // Only run transitions if the open state has changed. + _this._transitionController.stopAll(); + _this._transitionController.animate(new Transition(_this.menuTransition, _this.menuTransitionDuration, exports.TransitionDirection.Either, function () { return _this._service.isAnimating = false; })); + } + if (!isOpen) { + // Reset the item selections when a nested item is selected to avoid incosistent open states. + if (_this.selectedItems.length > 1) { + _this.resetSelection(); + } + } + previousIsOpen = isOpen; + }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdownMenu.prototype, "items", { + set: function (items) { + this._itemsQueryOverride = items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdownMenu.prototype, "_itemsQuery", { + get: function () { + return this._itemsQueryOverride || this._itemsQueryInternal; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdownMenu.prototype, "_items", { + // Get the list of items, ignoring those that are disabled. + get: + // Get the list of items, ignoring those that are disabled. + function () { + return this._itemsQuery.filter(function (i) { return !i.isDisabled; }); + }, + enumerable: true, + configurable: true + }); + SuiDropdownMenu.prototype.onClick = function (e) { + if (!e.eventHandled) { + e.eventHandled = true; + if (this._service.autoCloseMode === DropdownAutoCloseType.ItemClick) { + var target = e.target; + if (this.element.nativeElement.contains(target.closest(".item")) && !/input|textarea/i.test(target.tagName)) { + // Once an item is selected, we can close the entire dropdown. + this._service.setOpenState(false, true); + } + } + } + }; + SuiDropdownMenu.prototype.onDocumentKeyDown = function (e) { + // Only the root dropdown (i.e. not nested dropdowns) is responsible for keeping track of the currently selected item. + if (this._service.isOpen && !this._service.isNested) { + // Stop document events like scrolling while open. + var target = e.target; + if (!/input/i.test(target.tagName) && + [exports.KeyCode.Escape, exports.KeyCode.Enter, exports.KeyCode.Up, exports.KeyCode.Down, exports.KeyCode.Left, exports.KeyCode.Right].find(function (kC) { return kC === e.keyCode; })) { + e.preventDefault(); + } + // Gets the top selected item from the stack. + var selected = this.selectedItems.slice(-1)[0]; + // Keeping track of the menu containing the currently selected element allows us to easily determine its siblings. + var selectedContainer = this; + if (this.selectedItems.length >= 2) { + var selectedParent = this.selectedItems.slice(-2)[0]; + selectedContainer = selectedParent.childDropdownMenu; + } + switch (e.keyCode) { + // Escape : close the entire dropdown. + case exports.KeyCode.Escape: { + this._service.setOpenState(false); + break; + } + // Down : select the next item below the current one, or the 1st if none selected. + case exports.KeyCode.Down: + // Up : select the next item above the current one, or the 1st if none selected. + case exports.KeyCode.Up: { + this.selectedItems.pop(); + this.selectedItems.push(selectedContainer.updateSelection(selected, e.keyCode)); + // Prevent default regardless of whether we are in an input, to stop jumping to the start or end of the query string. + e.preventDefault(); + break; + } + // Enter : if the item doesn't contain a nested dropdown, 'click' it. Otherwise, fall through to 'Right' action. + case exports.KeyCode.Enter: { + if (selected && !selected.hasChildDropdown) { + selected.performClick(); + break; + } + } + // falls through + // Right : if the selected item contains a nested dropdown, open the dropdown & select the 1st item. + case exports.KeyCode.Right: { + if (selected && selected.hasChildDropdown) { + selected.childDropdownMenu.service.setOpenState(true); + this.selectedItems.push(selected.childDropdownMenu.updateSelection(selected, e.keyCode)); + } + break; + } + // Left : if the selected item is in a nested dropdown, close it and select the containing item. + case exports.KeyCode.Left: { + if (this.selectedItems.length >= 2) { + this.selectedItems.pop(); + var selectedParent = this.selectedItems.slice(-1)[0]; + selectedParent.childDropdownMenu.service.setOpenState(false); + selectedParent.isSelected = true; + } + break; + } + } + } + }; + SuiDropdownMenu.prototype.resetSelection = function () { + var _this = this; + this.selectedItems = []; + this._items.forEach(function (i) { + i.selectedClass = _this.menuSelectedItemClass; + i.isSelected = false; + }); + if (this.menuAutoSelectFirst && this._items.length > 0) { + // Autoselect 1st item if required & possible. + this._items[0].isSelected = true; + this.scrollToItem(this._items[0]); + this.selectedItems.push(this._itemsQuery.first); + } + }; + // Determines the item to next be selected, based on the keyboard input & the currently selected item. + // Determines the item to next be selected, based on the keyboard input & the currently selected item. + SuiDropdownMenu.prototype.updateSelection = + // Determines the item to next be selected, based on the keyboard input & the currently selected item. + function (selectedItem, keyCode) { + if (selectedItem) { + // Remove the selected status on the previously selected item. + selectedItem.isSelected = false; + } + var selectedIndex = this._items + .findIndex(function (i) { return i === selectedItem; }); + var newSelection; + switch (keyCode) { + case exports.KeyCode.Enter: + case exports.KeyCode.Right: + case exports.KeyCode.Down: + selectedIndex += 1; + break; + case exports.KeyCode.Up: + if (selectedIndex === -1) { + // If none are selected, select the 1st item. Should this be `this.items.last - 1`? + selectedIndex = 0; + break; + } + selectedIndex -= 1; + break; + } + // Select the item at the updated index. The || is to stop us selecting past the start or end of the item list. + newSelection = this._items[selectedIndex] || selectedItem; + if (newSelection) { + // Set the selected status on the newly selected item. + newSelection.isSelected = true; + // Set the current scroll position to the location of the newly selected item. + this.scrollToItem(newSelection); + } + return newSelection; + }; + SuiDropdownMenu.prototype.scrollToItem = function (item) { + var menu = this.element.nativeElement; + var selectedRect = item.element.nativeElement.getBoundingClientRect(); + var menuRect = menu.getBoundingClientRect(); + var scrollAmount = 0; + if (selectedRect.bottom > menuRect.bottom) { + scrollAmount = selectedRect.bottom - menuRect.bottom; + } + if (selectedRect.top < menuRect.top) { + scrollAmount = selectedRect.top - menuRect.top; + } + menu.scrollTop += Math.round(scrollAmount); + }; + SuiDropdownMenu.prototype.ngAfterContentInit = function () { + var _this = this; + this.onItemsChanged(); + this._itemsQuery.changes.subscribe(function () { return _this.onItemsChanged(); }); + }; + SuiDropdownMenu.prototype.onItemsChanged = function () { + // We use `_items` rather than `items` in case one or more have become disabled. + this.resetSelection(); + }; + SuiDropdownMenu.prototype.ngOnDestroy = function () { + this._documentKeyDownListener(); + }; + SuiDropdownMenu.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "[suiDropdownMenu]" + },] }, + ]; + /** @nocollapse */ + SuiDropdownMenu.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + { type: _angular_core.ChangeDetectorRef, }, + ]; }; + SuiDropdownMenu.propDecorators = { + "menuTransition": [{ type: _angular_core.Input },], + "menuTransitionDuration": [{ type: _angular_core.Input },], + "_itemsQueryInternal": [{ type: _angular_core.ContentChildren, args: [SuiDropdownMenuItem,] },], + "menuAutoSelectFirst": [{ type: _angular_core.Input },], + "menuSelectedItemClass": [{ type: _angular_core.Input },], + "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], + }; + return SuiDropdownMenu; +}(SuiTransition)); + +var SuiDropdown = /** @class */ (function () { + function SuiDropdown(_element) { + var _this = this; + this._element = _element; + this.service = new DropdownService(); + this.service.isOpenChange.subscribe(function () { + if (_this.service.isOpen) { + _this._element.nativeElement.focus(); + } + }); + } + Object.defineProperty(SuiDropdown.prototype, "children", { + get: function () { + var _this = this; + // @ContentChildren includes the current element by default. + return this._children.filter(function (c) { return c !== _this; }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "isOpenChange", { + get: function () { + return this.service.isOpenChange; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "isActive", { + get: function () { + // This is to ensure nested dropdowns don't get made bold. + return this.service.isOpen && !this.service.isNested; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "isOpen", { + get: function () { + return this.service.isOpen; + }, + set: function (value) { + // If we are opening the dropdown, we want to always open its parents. + this.service.setOpenState(value, !!value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "isDisabled", { + get: function () { + return this.service.isDisabled; + }, + set: function (value) { + this.service.setDisabledState(value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "tabIndex", { + get: function () { + if (this.isDisabled || this.service.isNested) { + // If disabled, remove from tabindex. + return undefined; + } + if (this._tabIndex != undefined) { + // If custom tabindex, default to that. + return this._tabIndex; + } + // Otherwise, return default of 0. + return 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "autoClose", { + get: function () { + return this.service.autoCloseMode; + }, + set: function (value) { + this.service.autoCloseMode = value; + }, + enumerable: true, + configurable: true + }); + SuiDropdown.prototype.ngAfterContentInit = function () { + var _this = this; + if (!this._menu) { + throw new Error("You must set [suiDropdownMenu] on the menu element."); + } + this._menu.service = this.service; + this.childrenUpdated(); + this._children.changes + .subscribe(function () { return _this.childrenUpdated(); }); + }; + SuiDropdown.prototype.childrenUpdated = function () { + var _this = this; + // Reregister child dropdowns each time the menu content changes. + this.children + .map(function (c) { return c.service; }) + .forEach(function (s) { return _this.service.registerChild(s); }); + }; + SuiDropdown.prototype.onClick = function (e) { + if (!e.eventHandled) { + e.eventHandled = true; + this.service.toggleOpenState(); + } + }; + SuiDropdown.prototype.onFocusOut = function (e) { + if (!this._element.nativeElement.contains(e.relatedTarget)) { + this.externallyClose(); + } + }; + SuiDropdown.prototype.onKeypress = function (e) { + // Block the keyboard event from being fired on parent dropdowns. + if (!e.eventHandled) { + if (e.keyCode === exports.KeyCode.Enter) { + e.eventHandled = true; + this.service.setOpenState(true); + } + } + }; + SuiDropdown.prototype.externallyClose = function () { + if (this.service.autoCloseMode === DropdownAutoCloseType.ItemClick || + this.service.autoCloseMode === DropdownAutoCloseType.OutsideClick) { + // No need to reflect in parent since they are also bound to document. + this.service.setOpenState(false); + } + }; + SuiDropdown.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "[suiDropdown]" + },] }, + ]; + /** @nocollapse */ + SuiDropdown.ctorParameters = function () { return [ + { type: _angular_core.ElementRef, }, + ]; }; + SuiDropdown.propDecorators = { + "_menu": [{ type: _angular_core.ContentChild, args: [SuiDropdownMenu,] },], + "_children": [{ type: _angular_core.ContentChildren, args: [SuiDropdown, { descendants: true },] },], + "isOpenChange": [{ type: _angular_core.Output },], + "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], + "isOpen": [{ type: _angular_core.Input },], + "isDisabled": [{ type: _angular_core.HostBinding, args: ["class.disabled",] }, { type: _angular_core.Input },], + "_tabIndex": [{ type: _angular_core.Input, args: ["tabindex",] },], + "tabIndex": [{ type: _angular_core.HostBinding, args: ["attr.tabindex",] },], + "autoClose": [{ type: _angular_core.Input },], + "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], + "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout", ["$event"],] },], + "onKeypress": [{ type: _angular_core.HostListener, args: ["keypress", ["$event"],] },], + }; + return SuiDropdown; +}()); + +var SuiDropdownModule = /** @class */ (function () { + function SuiDropdownModule() { + } + SuiDropdownModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule, + SuiTransitionModule + ], + declarations: [ + SuiDropdown, + SuiDropdownMenu, + SuiDropdownMenuItem + ], + exports: [ + SuiDropdown, + SuiDropdownMenu, + SuiDropdownMenuItem + ] + },] }, + ]; + /** @nocollapse */ + SuiDropdownModule.ctorParameters = function () { return []; }; + return SuiDropdownModule; +}()); + +// Helper class to support method chaining when calling `SuiModalService.open(...)`. +var ActiveModal = /** @class */ (function () { + function ActiveModal(instance, componentRef) { + var _this = this; + this._config = instance; + this._componentRef = componentRef; + // Automatically destroy the modal component when it has been dismissed. + this.component.onDismiss.subscribe(function () { return _this._componentRef.destroy(); }); + } + Object.defineProperty(ActiveModal.prototype, "component", { + // Shorthand for direct access to the `SuiModal` instance. + get: + // Shorthand for direct access to the `SuiModal` instance. + function () { + return this._componentRef.instance; + }, + enumerable: true, + configurable: true + }); + // Registers a callback for when `onApprove` is fired. + // Registers a callback for when `onApprove` is fired. + ActiveModal.prototype.onApprove = + // Registers a callback for when `onApprove` is fired. + function (callback) { + this.component.onApprove.subscribe(function (res) { return callback(res); }); + return this; + }; + // Registers a callback for when `onDeny` is fired. + // Registers a callback for when `onDeny` is fired. + ActiveModal.prototype.onDeny = + // Registers a callback for when `onDeny` is fired. + function (callback) { + this.component.onDeny.subscribe(function (res) { return callback(res); }); + return this; + }; + // Fires the approve event of the modal manually. + // Fires the approve event of the modal manually. + ActiveModal.prototype.approve = + // Fires the approve event of the modal manually. + function (result) { + this.component.approve(result); + }; + // Fires the deny event of the modal manually. + // Fires the deny event of the modal manually. + ActiveModal.prototype.deny = + // Fires the deny event of the modal manually. + function (result) { + this.component.deny(result); + }; + // Removes the modal component instantly, without transitions or firing any events. + // Removes the modal component instantly, without transitions or firing any events. + ActiveModal.prototype.destroy = + // Removes the modal component instantly, without transitions or firing any events. + function () { + this._componentRef.destroy(); + }; + return ActiveModal; +}()); + +var __extends$17 = (undefined && undefined.__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 __()); + }; +})(); +var ModalSize = { + Mini: "mini", + Tiny: "tiny", + Small: "small", + Normal: "normal", + Large: "large" +}; +// Stores a basic set of configuration options for a modal. +var ModalConfig = /** @class */ (function () { + function ModalConfig(context, isClosable) { + if (context === void 0) { context = undefined; } + if (isClosable === void 0) { isClosable = true; } + // Initialise with default values. + this.isClosable = isClosable; + this.context = context; + this.size = ModalSize.Normal; + this.isFullScreen = false; + this.isBasic = false; + this.isInverted = false; + this.mustScroll = false; + this.transition = "scale"; + this.transitionDuration = 500; + } + return ModalConfig; +}()); +// Used when creating a modal from a `TemplateRef`. +var TemplateModalConfig = /** @class */ (function (_super) { + __extends$17(TemplateModalConfig, _super); + function TemplateModalConfig(template, context, isClosable) { + if (context === void 0) { context = undefined; } + if (isClosable === void 0) { isClosable = true; } + var _this = _super.call(this, context, isClosable) || this; + _this.template = template; + return _this; + } + return TemplateModalConfig; +}(ModalConfig)); +// Used when creating a modal from an existing component. +var ComponentModalConfig = /** @class */ (function (_super) { + __extends$17(ComponentModalConfig, _super); + function ComponentModalConfig(component, context, isClosable) { + if (context === void 0) { context = undefined; } + if (isClosable === void 0) { isClosable = true; } + var _this = _super.call(this, context, isClosable) || this; + _this.component = component; + return _this; + } + return ComponentModalConfig; +}(ModalConfig)); + +var __extends$18 = (undefined && undefined.__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 __()); + }; +})(); +// Used to pass ability to control a modal to a component. +var ModalControls = /** @class */ (function () { + function ModalControls(approve, deny) { + this.approve = approve; + this.deny = deny; + } + // Use method here rather than arrow variables to make intellisense show they're methods. + // Use method here rather than arrow variables to make intellisense show they're methods. + ModalControls.prototype.approve = + // Use method here rather than arrow variables to make intellisense show they're methods. + function (result) { }; + ModalControls.prototype.deny = function (result) { }; + return ModalControls; +}()); +// Injected into custom modal components, to allow control of the modal, and access to a context object. +var Modal = /** @class */ (function (_super) { + __extends$18(Modal, _super); + function Modal(controls, context) { + var _this = + // Instances of `ModalControls` are only created in the `SuiModal` constructor, + // so we take an initialised instance rather than remaking one each time. + _super.call(this, controls.approve, controls.deny) || this; + _this.context = context; + return _this; + } + return Modal; +}(ModalControls)); + +var __extends$19 = (undefined && undefined.__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 __()); + }; +})(); +// Shorthand for a modal template. Sets up ability to write: `...` +// We use an abstract class as ModalTemplate tends to be used within decorated properties, which means it needs to exist! +var ModalTemplate = /** @class */ (function (_super) { + __extends$19(ModalTemplate, _super); + function ModalTemplate() { + return _super !== null && _super.apply(this, arguments) || this; + } + return ModalTemplate; +}(_angular_core.TemplateRef)); + +var SuiModal = /** @class */ (function () { + function SuiModal(_renderer, _element, _componentFactory) { + var _this = this; + this._renderer = _renderer; + this._element = _element; + this._componentFactory = _componentFactory; + // Initialise with default configuration from `ModalConfig` (to avoid writing defaults twice). + var config = new ModalConfig(); + this.loadConfig(config); + // Event emitters for each of the possible modal outcomes. + this.onApprove = new _angular_core.EventEmitter(); + this.onDeny = new _angular_core.EventEmitter(); + this.onDismiss = new _angular_core.EventEmitter(); + // Initialise controls with actions for the `approve` and `deny` cases. + this.controls = new ModalControls(function (res) { return _this.dismiss(function () { return _this.onApprove.emit(res); }); }, function (res) { return _this.dismiss(function () { return _this.onDeny.emit(res); }); }); + // Internal variable initialisation. + this.dimBackground = false; + this._isClosing = false; + this.transitionController = new TransitionController(false); + } + Object.defineProperty(SuiModal.prototype, "approve", { + get: function () { + return this.controls.approve; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiModal.prototype, "deny", { + get: function () { + return this.controls.deny; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiModal.prototype, "isFullScreen", { + get: + // Value to deny with when closing via `isClosable`. + function () { + return this._isFullScreen; + }, + set: function (fullScreen) { + this._isFullScreen = Util.DOM.parseBooleanAttribute(fullScreen); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiModal.prototype, "mustScroll", { + get: function () { + return this._mustScroll; + }, + set: function (mustScroll) { + this._mustScroll = mustScroll; + // 'Cache' value in _mustAlwaysScroll so that if `true`, _mustScroll isn't ever auto-updated. + this._mustAlwaysScroll = mustScroll; + this.updateScroll(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiModal.prototype, "isInverted", { + get: function () { + return this._isInverted; + }, + set: function (inverted) { + this._isInverted = Util.DOM.parseBooleanAttribute(inverted); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiModal.prototype, "dynamicClasses", { + get: function () { + var classes = {}; + if (this.size) { + classes[this.size] = true; + } + return classes; + }, + enumerable: true, + configurable: true + }); + SuiModal.prototype.ngOnInit = function () { + var _this = this; + // Transition the modal to be visible. + this.transitionController.animate(new Transition(this.transition, this.transitionDuration, exports.TransitionDirection.In)); + setTimeout(function () { return _this.dimBackground = true; }); + }; + SuiModal.prototype.ngAfterViewInit = function () { + var _this = this; + // Move the modal to the document body to ensure correct scrolling. + this._originalContainer = this._element.nativeElement.parentNode; + document.querySelector("body").appendChild(this._element.nativeElement); + // Remove the #templateSibling element from the DOM to fix bottom border styles. + var templateElement = this.templateSibling.element.nativeElement; + if (templateElement.parentNode) { + templateElement.parentNode.removeChild(templateElement); + } + // Update margin offset to center modal correctly on-screen. + var element = this._modalElement.nativeElement; + setTimeout(function () { + _this._renderer.setStyle(element, "margin-top", "-" + element.clientHeight / 2 + "px"); + _this.updateScroll(); + }); + // Focus any element with [autofocus] attribute. + var autoFocus = element.querySelector("[autofocus]"); + if (autoFocus) { + // Autofocus after the browser has had time to process other event handlers. + setTimeout(function () { return autoFocus.focus(); }, 10); + // Try to focus again when the modal has opened so that autofocus works in IE11. + setTimeout(function () { return autoFocus.focus(); }, this.transitionDuration); + } + }; + // Updates the modal with the specified configuration. + // Updates the modal with the specified configuration. + SuiModal.prototype.loadConfig = + // Updates the modal with the specified configuration. + function (config) { + this.isClosable = config.isClosable; + this.closeResult = config.closeResult; + this.size = config.size; + this.isFullScreen = config.isFullScreen; + this.isBasic = config.isBasic; + this.isInverted = config.isInverted; + this.mustScroll = config.mustScroll; + this.transition = config.transition; + this.transitionDuration = config.transitionDuration; + }; + // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. + // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. + SuiModal.prototype.dismiss = + // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. + function (callback) { + var _this = this; + if (callback === void 0) { callback = function () { }; } + // If we aren't currently closing, + if (!this._isClosing) { + this._isClosing = true; + // Transition the modal to be invisible. + this.dimBackground = false; + this.transitionController.stopAll(); + this.transitionController.animate(new Transition(this.transition, this.transitionDuration, exports.TransitionDirection.Out, function () { + // When done, move the modal back to its original location, emit a dismiss event, and fire the callback. + if (_this._originalContainer) { + _this._originalContainer.appendChild(_this._element.nativeElement); + } + _this.onDismiss.emit(); + callback(); + })); + } + }; + // Closes the modal with a 'deny' outcome, using the specified default reason. + // Closes the modal with a 'deny' outcome, using the specified default reason. + SuiModal.prototype.close = + // Closes the modal with a 'deny' outcome, using the specified default reason. + function () { + if (this.isClosable) { + // If we are allowed to close, fire the deny result with the default value. + this.deny(this.closeResult); + } + }; + // Decides whether the modal needs to reposition to allow scrolling. + // Decides whether the modal needs to reposition to allow scrolling. + SuiModal.prototype.updateScroll = + // Decides whether the modal needs to reposition to allow scrolling. + function () { + // Semantic UI modal margin is 3.5rem, which is relative to the global font size, so for compatibility: + var fontSize = parseFloat(window.getComputedStyle(document.documentElement).getPropertyValue("font-size")); + var margin = fontSize * 3.5; + // _mustAlwaysScroll works by stopping _mustScroll from being automatically updated, so it stays `true`. + if (!this._mustAlwaysScroll && this._modalElement) { + var element = this._modalElement.nativeElement; + // The modal must scroll if the window height is smaller than the modal height + both margins. + this._mustScroll = window.innerHeight < element.clientHeight + margin * 2; + } + }; + SuiModal.prototype.onClick = function (e) { + // Makes sense here, as the modal shouldn't be attached to any DOM element. + e.stopPropagation(); + }; + // Document listener is fine here because nobody will enough modals open. + SuiModal.prototype.onDocumentKeyUp = + // Document listener is fine here because nobody will enough modals open. + function (e) { + if (e.keyCode === exports.KeyCode.Escape) { + // Close automatically covers case of `!isClosable`, so check not needed. + this.close(); + } + }; + SuiModal.prototype.onDocumentResize = function () { + this.updateScroll(); + }; + SuiModal.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-modal", + template: "\n\n\n\n \n
\n\n \n \n \n \n \n
\n
\n
\n", + styles: ["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiModal.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + { type: SuiComponentFactory, }, + ]; }; + SuiModal.propDecorators = { + "isClosable": [{ type: _angular_core.Input },], + "closeResult": [{ type: _angular_core.Input },], + "onApprove": [{ type: _angular_core.Output, args: ["approved",] },], + "onDeny": [{ type: _angular_core.Output, args: ["denied",] },], + "onDismiss": [{ type: _angular_core.Output, args: ["dismissed",] },], + "_modalElement": [{ type: _angular_core.ViewChild, args: ["modal",] },], + "size": [{ type: _angular_core.Input },], + "isFullScreen": [{ type: _angular_core.Input },], + "isBasic": [{ type: _angular_core.Input },], + "mustScroll": [{ type: _angular_core.Input },], + "isInverted": [{ type: _angular_core.Input },], + "transition": [{ type: _angular_core.Input },], + "transitionDuration": [{ type: _angular_core.Input },], + "templateSibling": [{ type: _angular_core.ViewChild, args: ["templateSibling", { read: _angular_core.ViewContainerRef },] },], + "onDocumentKeyUp": [{ type: _angular_core.HostListener, args: ["document:keyup", ["$event"],] },], + "onDocumentResize": [{ type: _angular_core.HostListener, args: ["window:resize",] },], + }; + return SuiModal; +}()); + +var SuiModalService = /** @class */ (function () { + function SuiModalService(_componentFactory) { + this._componentFactory = _componentFactory; + } + SuiModalService.prototype.open = function (modal) { + // Generate the modal component to be shown. + var componentRef = this._componentFactory.createComponent(SuiModal); + // Shorthand for the created modal component instance. + var modalComponent = componentRef.instance; + if (modal instanceof TemplateModalConfig) { + // Inject the template into the view. + this._componentFactory.createView(modalComponent.templateSibling, modal.template, { + // `let-context` + $implicit: modal.context, + // `let-modal="modal"` + modal: componentRef.instance.controls + }); + } + else if (modal instanceof ComponentModalConfig) { + // Generate the component to be used as the modal content, + // injecting an instance of `Modal` to be used in the component constructor. + var contentComponentRef = this._componentFactory.createComponent(modal.component, [ + { + provide: Modal, + useValue: new Modal(modalComponent.controls, modal.context) + } + ]); + // Insert the new component into the content of the modal. + this._componentFactory.attachToView(contentComponentRef, modalComponent.templateSibling); + // Shorthand for access to the content component's DOM element. + var contentElement = contentComponentRef.location.nativeElement; + // Move all of the DOM elements inside the component to the main modal element. + // This is done so that CSS classes apply correctly. It does stop any custom styles from working however, + // so other ways may have to be investigated. + while (contentElement.hasChildNodes() && contentElement.parentElement && contentElement.firstChild) { + contentElement.parentElement.appendChild(contentElement.removeChild(contentElement.firstChild)); + } + // Remove the generated component's 'empty shell' from the DOM. + this._componentFactory.detachFromDocument(contentComponentRef); + } + // Attach the new modal component to the application. + // The component will move itself to the document body for correctl styling. + this._componentFactory.attachToApplication(componentRef); + // Initialise the generated modal with the provided config. + modalComponent.loadConfig(modal); + // Return an instance of an `ActiveModal`, so the user can control the new modal. + return new ActiveModal(modal, componentRef); + }; + SuiModalService.decorators = [ + { type: _angular_core.Injectable }, + ]; + /** @nocollapse */ + SuiModalService.ctorParameters = function () { return [ + { type: SuiComponentFactory, }, + ]; }; + return SuiModalService; +}()); + +var SuiModalModule = /** @class */ (function () { + function SuiModalModule() { + } + SuiModalModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule, + SuiDimmerModule, + SuiTransitionModule, + SuiUtilityModule + ], + declarations: [ + SuiModal + ], + exports: [ + SuiModal + ], + providers: [ + SuiModalService + ], + entryComponents: [ + SuiModal + ] + },] }, + ]; + /** @nocollapse */ + SuiModalModule.ctorParameters = function () { return []; }; + return SuiModalModule; +}()); + +var SuiProgress = /** @class */ (function () { + function SuiProgress() { + this._popupClasses = true; + this.value = 0; + this.maximum = 100; + this.precision = 0; + this._overrideSuccess = false; + this.autoSuccess = true; + this.showProgress = true; + this._popupClasses = true; + } + Object.defineProperty(SuiProgress.prototype, "value", { + get: function () { + return this._value; + }, + set: function (value) { + // Convert value from string to number where necessary. + var converted = +value; + if (Number.isNaN(converted)) { + return; + } + this._value = converted; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiProgress.prototype, "maximum", { + get: function () { + return this._maximum; + }, + set: function (value) { + // Convert value from string to number where necessary. + var converted = +value; + if (Number.isNaN(converted)) { + return; + } + this._maximum = converted; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiProgress.prototype, "precision", { + get: function () { + return this._precision; + }, + set: function (value) { + // Convert value from string to number where necessary. + var converted = +value; + if (Number.isNaN(converted)) { + return; + } + this._precision = Math.min(Math.max(converted, 0), 20); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiProgress.prototype, "_reachedMaximum", { + get: function () { + return this._overrideSuccess || ((this.value >= this.maximum) && this.autoSuccess); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiProgress.prototype, "percentage", { + get: function () { + var boundedValue = Math.min(Math.max(this.value, 0), this.maximum); + var percentage = (boundedValue / this.maximum) * 100; + return percentage.toFixed(this.precision); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiProgress.prototype, "classValue", { + set: function (classes) { + if (classes.includes("attached") || classes.includes("tiny")) { + this.showProgress = false; + } + if (classes.includes("success")) { + this._overrideSuccess = true; + } + }, + enumerable: true, + configurable: true + }); + SuiProgress.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-progress", + template: "\n
\n
{{ percentage }}%
\n
\n
\n \n
\n", + styles: ["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiProgress.ctorParameters = function () { return []; }; + SuiProgress.propDecorators = { + "_popupClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.progress",] },], + "autoSuccess": [{ type: _angular_core.Input },], + "showProgress": [{ type: _angular_core.Input },], + "value": [{ type: _angular_core.Input },], + "maximum": [{ type: _angular_core.Input },], + "precision": [{ type: _angular_core.Input },], + "_reachedMaximum": [{ type: _angular_core.HostBinding, args: ["class.success",] },], + "percentage": [{ type: _angular_core.HostBinding, args: ["attr.data-percent",] },], + "classValue": [{ type: _angular_core.Input, args: ["class",] },], + }; + return SuiProgress; +}()); + +var SuiProgressModule = /** @class */ (function () { + function SuiProgressModule() { + } + SuiProgressModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule + ], + declarations: [ + SuiProgress + ], + exports: [ + SuiProgress + ] + },] }, + ]; + /** @nocollapse */ + SuiProgressModule.ctorParameters = function () { return []; }; + return SuiProgressModule; +}()); + +var __extends$20 = (undefined && undefined.__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 __()); + }; +})(); +var SuiRating = /** @class */ (function () { + function SuiRating() { + this.hoveredIndex = -1; + this.value = 0; + this.valueChange = new _angular_core.EventEmitter(); + this.maximum = 5; + this.isReadonly = false; + this._ratingClasses = true; + } + Object.defineProperty(SuiRating.prototype, "maximum", { + get: function () { + return this._maximum; + }, + set: function (value) { + this._maximum = +value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiRating.prototype, "icons", { + get: function () { + // tslint:disable-next-line:prefer-literal + return new Array(this.maximum); + }, + enumerable: true, + configurable: true + }); + SuiRating.prototype.onClick = function (i) { + if (!this.isReadonly) { + this.value = i + 1; + this.valueChange.emit(this.value); + } + }; + SuiRating.prototype.onMouseover = function (i) { + this.hoveredIndex = i; + }; + SuiRating.prototype.onMouseout = function () { + this.hoveredIndex = -1; + }; + SuiRating.prototype.writeValue = function (value) { + this.value = value; + }; + SuiRating.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-rating", + template: "\n= i && !isReadonly\"\n [class.active]=\"value > i\">\n\n", + styles: ["\n:host.read-only .icon {\n cursor: auto\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiRating.ctorParameters = function () { return []; }; + SuiRating.propDecorators = { + "_ratingClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.rating",] },], + "valueChange": [{ type: _angular_core.Output },], + "maximum": [{ type: _angular_core.Input },], + "isReadonly": [{ type: _angular_core.HostBinding, args: ["class.read-only",] }, { type: _angular_core.Input },], + "onMouseout": [{ type: _angular_core.HostListener, args: ["mouseout",] },], + }; + return SuiRating; +}()); +var SuiRatingValueAccessor = /** @class */ (function (_super) { + __extends$20(SuiRatingValueAccessor, _super); + function SuiRatingValueAccessor(host) { + return _super.call(this, host) || this; + } + SuiRatingValueAccessor.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "sui-rating", + host: { "(valueChange)": "onChange($event)" }, + providers: [customValueAccessorFactory(SuiRatingValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiRatingValueAccessor.ctorParameters = function () { return [ + { type: SuiRating, }, + ]; }; + return SuiRatingValueAccessor; +}(CustomValueAccessor)); + +var SuiRatingModule = /** @class */ (function () { + function SuiRatingModule() { + } + SuiRatingModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_forms.FormsModule, + _angular_common.CommonModule + ], + declarations: [ + SuiRating, + SuiRatingValueAccessor + ], + exports: [ + SuiRating, + SuiRatingValueAccessor + ] + },] }, + ]; + /** @nocollapse */ + SuiRatingModule.ctorParameters = function () { return []; }; + return SuiRatingModule; +}()); + +var SuiSearchResult = /** @class */ (function () { + function SuiSearchResult(componentFactory) { + this.componentFactory = componentFactory; + this._optionClasses = true; + // By default we make this function return an empty string, for the brief moment when it isn't displaying the correct label. + this.formatter = function (value) { return ""; }; + } + Object.defineProperty(SuiSearchResult.prototype, "template", { + get: function () { + return this._template; + }, + set: function (template) { + this._template = template; + if (this.template) { + this.componentFactory.createView(this.templateSibling, this.template, { + $implicit: this.value, + query: this.query + }); + } + }, + enumerable: true, + configurable: true + }); + SuiSearchResult.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-search-result", + template: "\n\n\n" + },] }, + ]; + /** @nocollapse */ + SuiSearchResult.ctorParameters = function () { return [ + { type: SuiComponentFactory, }, + ]; }; + SuiSearchResult.propDecorators = { + "_optionClasses": [{ type: _angular_core.HostBinding, args: ["class.result",] },], + "value": [{ type: _angular_core.Input },], + "query": [{ type: _angular_core.Input },], + "formatter": [{ type: _angular_core.Input },], + "template": [{ type: _angular_core.Input },], + "templateSibling": [{ type: _angular_core.ViewChild, args: ["templateSibling", { read: _angular_core.ViewContainerRef },] },], + }; + return SuiSearchResult; +}()); + +var SearchService = /** @class */ (function () { + function SearchService(allowEmptyQuery) { + if (allowEmptyQuery === void 0) { allowEmptyQuery = false; } + var _this = this; + this._options = []; + this.optionsFilter = function (os, q) { + // Convert the query string to a RegExp. + var regex = _this.toRegex(_this._query); + if (regex instanceof RegExp) { + // Only update the results if the query was valid regex. + // This avoids the results suddenly becoming empty if an invalid regex string is inputted. + return os + .filter(function (o) { + return Util.Object.readValue(o, _this._optionsField) + .toString() + .match(regex); + }); + } + // Don't update since it wasn't a valid regex. + return false; + }; + // Set default values and reset. + this.allowEmptyQuery = allowEmptyQuery; + this.searchDelay = 0; + this.reset(); + } + Object.defineProperty(SearchService.prototype, "options", { + get: function () { + return this._options; + }, + set: function (options) { + this._options = options || []; + // We cannot use both local & remote options simultaneously. + this._optionsLookup = undefined; + // Reset entire service with new options. + this.reset(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "optionsLookup", { + get: function () { + return this._optionsLookup; + }, + set: function (lookupFn) { + this._optionsLookup = lookupFn; + // As before, cannot use local & remote options simultaneously. + this._options = []; + this.reset(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "hasItemLookup", { + get: function () { + return !!this.optionsLookup && this.optionsLookup.length === 2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "optionsField", { + get: function () { + return this._optionsField; + }, + set: function (field) { + this._optionsField = field; + // We need to reset otherwise we would now be showing invalid search results. + this.reset(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "results", { + get: function () { + return this._results; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "query", { + get: function () { + return this._query; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "isSearching", { + get: function () { + return this._isSearching; + }, + enumerable: true, + configurable: true + }); + // Updates the query after the specified search delay. + // Updates the query after the specified search delay. + SearchService.prototype.updateQueryDelayed = + // Updates the query after the specified search delay. + function (query, callback) { + var _this = this; + if (callback === void 0) { callback = function () { }; } + this._query = query; + clearTimeout(this._searchDelayTimeout); + this._searchDelayTimeout = window.setTimeout(function () { + _this.updateQuery(query, callback); + }, this.searchDelay); + }; + // Updates the current search query. + // Updates the current search query. + SearchService.prototype.updateQuery = + // Updates the current search query. + function (query, callback) { + var _this = this; + if (callback === void 0) { callback = function () { }; } + this._query = query; + if (this._query === "" && !this.allowEmptyQuery) { + // Don't update if the new query is empty (and we don't allow empty queries). + // Don't reset so that when animating closed we don't get a judder. + return callback(); + } + if (this._resultsCache.hasOwnProperty(this._query)) { + // If the query is already cached, make use of it. + this._results = this._resultsCache[this._query]; + return callback(); + } + if (this._optionsLookup) { + this._isSearching = true; + // Call the options lookup without a this context. + var queryLookup = this._optionsLookup.call(undefined, this._query); + queryLookup + .then(function (results) { + _this._isSearching = false; + _this.updateResults(results); + return callback(); + }) + .catch(function (error) { + // Unset 'loading' state, and throw the returned error without updating the results. + // Unset 'loading' state, and throw the returned error without updating the results. + _this._isSearching = false; + return callback(error); + }); + return; + } + var filtered = this.optionsFilter.call(undefined, this._options, this._query); + if (filtered) { + this.updateResults(filtered); + } + return callback(); + }; + // Updates & caches the new set of results. + // Updates & caches the new set of results. + SearchService.prototype.updateResults = + // Updates & caches the new set of results. + function (results) { + this._resultsCache[this._query] = results; + this._results = results; + }; + // tslint:disable-next-line:promise-function-async + // tslint:disable-next-line:promise-function-async + SearchService.prototype.initialLookup = + // tslint:disable-next-line:promise-function-async + function (initial) { + if (initial instanceof Array) { + return this._optionsLookup(undefined, initial); + } + return this._optionsLookup(undefined, initial); + }; + // Converts a query string to regex without throwing an error. + // Converts a query string to regex without throwing an error. + SearchService.prototype.toRegex = + // Converts a query string to regex without throwing an error. + function (query) { + try { + return new RegExp(query, "i"); + } + catch (e) { + return query; + } + }; + // Generates HTML for highlighted match text. + // Generates HTML for highlighted match text. + SearchService.prototype.highlightMatches = + // Generates HTML for highlighted match text. + function (text, query) { + var regex = this.toRegex(query); + if (regex instanceof RegExp) { + return text.replace(regex, function (match) { return "" + match + ""; }); + } + return text; + }; + // Resets the search back to a pristine state. + // Resets the search back to a pristine state. + SearchService.prototype.reset = + // Resets the search back to a pristine state. + function () { + this._results = []; + this._resultsCache = {}; + this._isSearching = false; + this.updateQuery(""); + }; + return SearchService; +}()); + +var SuiSearch = /** @class */ (function () { + function SuiSearch(_element, renderer, _localizationService) { + var _this = this; + this._element = _element; + this._localizationService = _localizationService; + this.dropdownService = new DropdownService(); + this.searchService = new SearchService(); + this.onLocaleUpdate(); + this._localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); + this._searchClasses = true; + this.hasIcon = true; + this.allowEmptyQuery = false; + this.retainSelectedResult = true; + this.searchDelay = 200; + this.maxResults = 7; + this.onResultSelected = new _angular_core.EventEmitter(); + this.transition = "scale"; + this.transitionDuration = 200; + this._documentClickListener = renderer.listen("document", "click", function (e) { return _this.onDocumentClick(e); }); + } + Object.defineProperty(SuiSearch.prototype, "isActive", { + get: function () { + return this.dropdownService.isOpen; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "allowEmptyQuery", { + get: function () { + return this._allowEmptyQuery; + }, + set: + // Sets whether the search element display result with empty query. + function (allowEmptyQuery) { + this._allowEmptyQuery = allowEmptyQuery; + this.searchService.allowEmptyQuery = allowEmptyQuery; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "placeholder", { + get: + // Gets & sets the placeholder text displayed inside the text input. + function () { + return this._placeholder || this.localeValues.placeholder; + }, + set: function (placeholder) { + this._placeholder = placeholder; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "localeValues", { + get: function () { + return this._localizationService.override(this._localeValues, this.localeOverrides); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "query", { + get: function () { + return this.searchService.query; + }, + set: function (query) { + var _this = this; + this.selectedResult = undefined; + // Initialise a delayed search. + this.searchService.updateQueryDelayed(query, function () { + // Set the results open state depending on whether a query has been entered. + return + // Set the results open state depending on whether a query has been entered. + _this.dropdownService.setOpenState(_this.searchService.query.length > 0 || _this.allowEmptyQuery); + }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "options", { + set: function (options) { + if (options) { + this.searchService.options = options; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "optionsFilter", { + set: function (filter) { + if (filter) { + this.searchService.optionsFilter = filter; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "optionsLookup", { + set: function (lookupFn) { + this.searchService.optionsLookup = lookupFn; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "optionsField", { + set: function (field) { + this.searchService.optionsField = field; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "resultFormatter", { + get: function () { + var _this = this; + if (this._resultFormatter) { + return this._resultFormatter; + } + else if (this.searchService.optionsLookup) { + return function (r) { return _this.readValue(r); }; + } + else { + return function (r, q) { return _this.searchService.highlightMatches(_this.readValue(r), q); }; + } + }, + set: function (formatter) { + this._resultFormatter = formatter; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "searchDelay", { + set: function (delay) { + this.searchService.searchDelay = delay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "isSearching", { + get: function () { + return this.searchService.isSearching; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "results", { + get: function () { + return this.searchService.results.slice(0, this.maxResults); + }, + enumerable: true, + configurable: true + }); + SuiSearch.prototype.ngAfterViewInit = function () { + this._menu.service = this.dropdownService; + }; + SuiSearch.prototype.onLocaleUpdate = function () { + this._localeValues = this._localizationService.get().search; + }; + // Selects a result. + // Selects a result. + SuiSearch.prototype.select = + // Selects a result. + function (result) { + this.onResultSelected.emit(result); + this.dropdownService.setOpenState(false); + if (this.retainSelectedResult) { + this.selectedResult = result; + this.searchService.updateQuery(this.readValue(result)); + } + else { + this.searchService.updateQuery(""); + } + }; + SuiSearch.prototype.onClick = function (e) { + this.open(); + }; + SuiSearch.prototype.onFocusIn = function () { + if (!this.dropdownService.isAnimating) { + this.open(); + } + }; + SuiSearch.prototype.open = function () { + if (this.searchService.query.length > 0 || this.allowEmptyQuery) { + // Only open on click when there is a query entered. + this.dropdownService.setOpenState(true); + } + }; + SuiSearch.prototype.onFocusOut = function (e) { + if (!this._element.nativeElement.contains(e.relatedTarget)) { + this.dropdownService.setOpenState(false); + } + }; + SuiSearch.prototype.onDocumentClick = function (e) { + if (!this._element.nativeElement.contains(e.target)) { + this.dropdownService.setOpenState(false); + } + }; + // Reads the specified field from an item. + // Reads the specified field from an item. + SuiSearch.prototype.readValue = + // Reads the specified field from an item. + function (object) { + return Util.Object.readValue(object, this.searchService.optionsField); + }; + SuiSearch.prototype.ngOnDestroy = function () { + this._documentClickListener(); + }; + SuiSearch.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-search", + template: "\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n", + styles: ["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiSearch.ctorParameters = function () { return [ + { type: _angular_core.ElementRef, }, + { type: _angular_core.Renderer2, }, + { type: SuiLocalizationService, }, + ]; }; + SuiSearch.propDecorators = { + "_menu": [{ type: _angular_core.ViewChild, args: [SuiDropdownMenu,] },], + "_searchClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.search",] },], + "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], + "hasIcon": [{ type: _angular_core.Input },], + "allowEmptyQuery": [{ type: _angular_core.Input },], + "placeholder": [{ type: _angular_core.Input },], + "options": [{ type: _angular_core.Input },], + "optionsFilter": [{ type: _angular_core.Input },], + "optionsLookup": [{ type: _angular_core.Input },], + "optionsField": [{ type: _angular_core.Input },], + "resultFormatter": [{ type: _angular_core.Input },], + "resultTemplate": [{ type: _angular_core.Input },], + "retainSelectedResult": [{ type: _angular_core.Input },], + "searchDelay": [{ type: _angular_core.Input },], + "isSearching": [{ type: _angular_core.HostBinding, args: ["class.loading",] },], + "maxResults": [{ type: _angular_core.Input },], + "onResultSelected": [{ type: _angular_core.Output, args: ["resultSelected",] },], + "transition": [{ type: _angular_core.Input },], + "transitionDuration": [{ type: _angular_core.Input },], + "onFocusIn": [{ type: _angular_core.HostListener, args: ["focusin",] },], + "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout", ["$event"],] },], + }; + return SuiSearch; +}()); + +var SuiSearchModule = /** @class */ (function () { + function SuiSearchModule() { + } + SuiSearchModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule, + _angular_forms.FormsModule, + SuiDropdownModule, + SuiLocalizationModule, + SuiUtilityModule + ], + declarations: [ + SuiSearch, + SuiSearchResult + ], + exports: [ + SuiSearch + ] + },] }, + ]; + /** @nocollapse */ + SuiSearchModule.ctorParameters = function () { return []; }; + return SuiSearchModule; +}()); + +var __extends$21 = (undefined && undefined.__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 __()); + }; +})(); +var SuiSelectOption = /** @class */ (function (_super) { + __extends$21(SuiSelectOption, _super); + function SuiSelectOption(renderer, element, changeDetector) { + var _this = + // We inherit SuiDropdownMenuItem to automatically gain all keyboard navigation functionality. + // This is not done via adding the .item class because it isn't supported by Angular. + _super.call(this, renderer, element) || this; + _this.changeDetector = changeDetector; + _this._optionClasses = true; + _this.isActive = false; + _this.onSelected = new _angular_core.EventEmitter(); + // By default we make the default text an empty label, for the brief moment when it isn't displaying the correct one. + // By default we make the default text an empty label, for the brief moment when it isn't displaying the correct one. + _this.renderedText = ""; + _this.usesTemplate = false; + return _this; + } + Object.defineProperty(SuiSelectOption.prototype, "formatter", { + set: function (formatter) { + if (!this.usesTemplate) { + this.renderedText = formatter(this.value); + } + else { + this.renderedText = ""; + } + }, + enumerable: true, + configurable: true + }); + SuiSelectOption.prototype.onClick = function (e) { + var _this = this; + e.eventHandled = true; + setTimeout(function () { return _this.onSelected.emit(_this.value); }); + }; + SuiSelectOption.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-select-option", + template: "\n\n\n" + },] }, + ]; + /** @nocollapse */ + SuiSelectOption.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + { type: _angular_core.ChangeDetectorRef, }, + ]; }; + SuiSelectOption.propDecorators = { + "_optionClasses": [{ type: _angular_core.HostBinding, args: ["class.item",] },], + "value": [{ type: _angular_core.Input },], + "onSelected": [{ type: _angular_core.Output },], + "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], + "templateSibling": [{ type: _angular_core.ViewChild, args: ["templateSibling", { read: _angular_core.ViewContainerRef },] },], + "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], + }; + return SuiSelectOption; +}(SuiDropdownMenuItem)); + +var SuiSelectSearch = /** @class */ (function () { + function SuiSelectSearch(_renderer, _element) { + this._renderer = _renderer; + this._element = _element; + this.onQueryUpdated = new _angular_core.EventEmitter(); + this.onQueryKeyDown = new _angular_core.EventEmitter(); + this._searchClass = true; + this._autoComplete = "off"; + } + Object.defineProperty(SuiSelectSearch.prototype, "query", { + set: function (query) { + this._renderer.setProperty(this._element.nativeElement, "value", query); + }, + enumerable: true, + configurable: true + }); + SuiSelectSearch.prototype.updateQuery = function (query) { + this.onQueryUpdated.emit(query); + }; + SuiSelectSearch.prototype.onKeyDown = function (e) { + this.onQueryKeyDown.emit(e); + }; + SuiSelectSearch.prototype.focus = function () { + var _this = this; + // Slightly delay to support in menu search. + this._element.nativeElement.focus(); + setTimeout(function () { return _this._element.nativeElement.focus(); }); + }; + SuiSelectSearch.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "input[suiSelectSearch]" + },] }, + ]; + /** @nocollapse */ + SuiSelectSearch.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + ]; }; + SuiSelectSearch.propDecorators = { + "_searchClass": [{ type: _angular_core.HostBinding, args: ["class.search",] },], + "_autoComplete": [{ type: _angular_core.HostBinding, args: ["attr.autocomplete",] },], + "updateQuery": [{ type: _angular_core.HostListener, args: ["input", ["$event.target.value"],] },], + "onKeyDown": [{ type: _angular_core.HostListener, args: ["keydown", ["$event"],] },], + }; + return SuiSelectSearch; +}()); + +// We use generic type T to specify the type of the options we are working with, +// and U to specify the type of the property of the option used as the value. +var SuiSelectBase = /** @class */ (function () { + function SuiSelectBase(_element, renderer, _localizationService) { + var _this = this; + this._element = _element; + this._localizationService = _localizationService; + this.dropdownService = new DropdownService(); + // We do want an empty query to return all results. + this.searchService = new SearchService(true); + this.isSearchable = false; + this.onLocaleUpdate(); + this._localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); + this._renderedSubscriptions = []; + this.icon = "dropdown"; + this.transition = "slide down"; + this.transitionDuration = 200; + this.onTouched = new _angular_core.EventEmitter(); + this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); + this._selectClasses = true; + } + Object.defineProperty(SuiSelectBase.prototype, "isActive", { + get: function () { + return this.dropdownService.isOpen; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "isVisible", { + get: function () { + return this._menu.isVisible; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "_searchClass", { + get: function () { + return this.isSearchable && !this.isSearchExternal; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "isSearching", { + get: function () { + return this.searchService.isSearching; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "searchInput", { + get: function () { + return this._manualSearch || this._internalSearch; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "tabIndex", { + get: function () { + if (this.isDisabled) { + // If disabled, remove from tabindex. + return -1; + } + if (this.dropdownService.isOpen && this.isSearchExternal) { + // If open & in menu search, remove from tabindex (as input always autofocusses). + return -1; + } + if (this._tabIndex != undefined) { + // If custom tabindex, default to that. + return this._tabIndex; + } + if (this._searchClass) { + // If search input enabled, tab goes to input. + return -1; + } + // Otherwise, return default of 0. + return 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "isDisabled", { + get: function () { + return this.dropdownService.isDisabled; + }, + set: function (value) { + this.dropdownService.isDisabled = !!value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "options", { + set: function (options) { + if (options) { + this.searchService.options = options; + this.optionsUpdateHook(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "optionsFilter", { + set: function (filter) { + if (filter) { + this.searchService.optionsFilter = filter; + this.optionsUpdateHook(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "optionsLookup", { + set: function (lookup) { + if (lookup) { + this.searchService.optionsLookup = lookup; + this.optionsUpdateHook(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "filteredOptions", { + get: function () { + return this.searchService.results; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "availableOptions", { + // Deprecated + get: + // Deprecated + function () { + return this.filteredOptions; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "query", { + get: function () { + return this.isSearchable ? this.searchService.query : undefined; + }, + set: function (query) { + var _this = this; + if (query != undefined) { + this.queryUpdateHook(); + this.updateQuery(query); + // Update the rendered text as query has changed. + this._renderedOptions.forEach(function (ro) { return _this.initialiseRenderedOption(ro); }); + if (this.searchInput) { + this.searchInput.query = query; + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "labelField", { + get: function () { + return this.searchService.optionsField; + }, + set: function (field) { + this.searchService.optionsField = field; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "labelGetter", { + get: function () { + var _this = this; + // Helper function to retrieve the label from an item. + return function (obj) { + var label = Util.Object.readValue(obj, _this.labelField); + if (label != undefined) { + return label.toString(); + } + return ""; + }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "valueGetter", { + get: function () { + var _this = this; + // Helper function to retrieve the value from an item. + return function (obj) { return Util.Object.readValue(obj, _this.valueField); }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "configuredFormatter", { + get: function () { + var _this = this; + if (this._optionFormatter) { + return function (o) { return _this._optionFormatter(o, _this.isSearchable ? _this.query : undefined); }; + } + else if (this.searchService.optionsLookup) { + return function (o) { return _this.labelGetter(o); }; + } + else { + return function (o) { return _this.searchService.highlightMatches(_this.labelGetter(o), _this.query || ""); }; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "optionFormatter", { + set: function (formatter) { + this._optionFormatter = formatter; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "localeValues", { + get: function () { + return this._localizationService.override(this._localeValues, this.localeOverrides); + }, + enumerable: true, + configurable: true + }); + SuiSelectBase.prototype.ngAfterContentInit = function () { + var _this = this; + this._menu.service = this.dropdownService; + // We manually specify the menu items to the menu because the @ContentChildren doesn't pick up our dynamically rendered items. + this._menu.items = this._renderedOptions; + if (this._manualSearch) { + this.isSearchable = true; + this.isSearchExternal = true; + } + if (this.searchInput) { + this.searchInput.onQueryUpdated.subscribe(function (q) { return _this.query = q; }); + this.searchInput.onQueryKeyDown.subscribe(function (e) { return _this.onQueryInputKeydown(e); }); + } + // We must call this immediately as changes doesn't fire when you subscribe. + this.onAvailableOptionsRendered(); + this._renderedOptions.changes.subscribe(function () { return _this.onAvailableOptionsRendered(); }); + }; + SuiSelectBase.prototype.onLocaleUpdate = function () { + this._localeValues = this._localizationService.get().select; + }; + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + SuiSelectBase.prototype.optionsUpdateHook = + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + function () { }; + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + SuiSelectBase.prototype.queryUpdateHook = + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + function () { }; + SuiSelectBase.prototype.updateQuery = function (query) { + var _this = this; + // Update the query then open the dropdown, as after keyboard input it should always be open. + this.searchService.updateQuery(query, function () { + return _this.dropdownService.setOpenState(true); + }); + }; + SuiSelectBase.prototype.resetQuery = function (delayed) { + if (delayed === void 0) { delayed = true; } + // The search delay is set to the transition duration to ensure results + // aren't rendered as the select closes as that causes a sudden flash. + if (delayed) { + this.searchService.searchDelay = this._menu.menuTransitionDuration; + this.searchService.updateQueryDelayed(""); + } + else { + this.searchService.updateQuery(""); + } + if (this.searchInput) { + this.searchInput.query = ""; + } + }; + SuiSelectBase.prototype.onAvailableOptionsRendered = function () { + var _this = this; + // Unsubscribe from all previous subscriptions to avoid memory leaks on large selects. + this._renderedSubscriptions.forEach(function (rs) { return rs.unsubscribe(); }); + this._renderedSubscriptions = []; + this._renderedOptions.forEach(function (ro) { + // Slightly delay initialisation to avoid change after checked errors. TODO - look into avoiding this! + setTimeout(function () { return _this.initialiseRenderedOption(ro); }); + _this._renderedSubscriptions.push(ro.onSelected.subscribe(function () { return _this.selectOption(ro.value); })); + }); + // If no options have been provided, autogenerate them from the rendered ones. + if (this.searchService.options.length === 0 && !this.searchService.optionsLookup) { + this.options = this._renderedOptions.map(function (ro) { return ro.value; }); + } + }; + SuiSelectBase.prototype.initialiseRenderedOption = function (option) { + option.usesTemplate = !!this.optionTemplate; + option.formatter = this.configuredFormatter; + if (option.usesTemplate) { + this.drawTemplate(option.templateSibling, option.value); + } + option.changeDetector.markForCheck(); + }; + SuiSelectBase.prototype.findOption = function (options, value) { + var _this = this; + // Tries to find an option in options array + return options.find(function (o) { return value === _this.valueGetter(o); }); + }; + SuiSelectBase.prototype.onCaretClick = function (e) { + if (!e.eventHandled) { + e.eventHandled = true; + if (!this.dropdownService.isAnimating) { + this.dropdownService.setOpenState(!this.dropdownService.isOpen); + this.focus(); + } + } + }; + SuiSelectBase.prototype.onClick = function (e) { + if (!e.eventHandled && !this.dropdownService.isAnimating) { + e.eventHandled = true; + // If the dropdown is searchable, clicking should keep it open, otherwise we toggle the open state. + this.dropdownService.setOpenState(this.isSearchable ? true : !this.dropdownService.isOpen); + // Immediately focus the search input whenever clicking on the select. + this.focus(); + } + }; + SuiSelectBase.prototype.onFocusIn = function () { + if (!this.dropdownService.isOpen && !this.dropdownService.isAnimating) { + this.dropdownService.setOpenState(true); + this.focus(); + } + }; + SuiSelectBase.prototype.onFocusOut = function (e) { + if (!this._element.nativeElement.contains(e.relatedTarget)) { + this.dropdownService.setOpenState(false); + this.onTouched.emit(); + } + }; + SuiSelectBase.prototype.onKeyPress = function (e) { + if (e.keyCode === exports.KeyCode.Enter) { + // Enables support for focussing and opening with the keyboard alone. + // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. + this._element.nativeElement.click(); + } + }; + SuiSelectBase.prototype.onDocumentKeyDown = function (e) { + if (this._element.nativeElement.contains(e.target) && + !this.dropdownService.isOpen && + e.keyCode === exports.KeyCode.Down) { + // Enables support for focussing and opening with the keyboard alone. + // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. + this._element.nativeElement.click(); + e.preventDefault(); + } + }; + SuiSelectBase.prototype.onQueryInputKeydown = function (event) { }; + SuiSelectBase.prototype.focus = function () { + if (this.isSearchable && this.searchInput) { + // Focusses the search input only when searchable. + // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. + this.searchInput.focus(); + } + else { + this._element.nativeElement.focus(); + } + }; + // Helper that draws the provided template beside the provided ViewContainerRef. + // Helper that draws the provided template beside the provided ViewContainerRef. + SuiSelectBase.prototype.drawTemplate = + // Helper that draws the provided template beside the provided ViewContainerRef. + function (siblingRef, value) { + siblingRef.clear(); + // Use of `$implicit` means use of syntax is supported. + siblingRef.createEmbeddedView(this.optionTemplate, { + $implicit: value, + query: this.query + }); + }; + SuiSelectBase.prototype.ngOnDestroy = function () { + this._renderedSubscriptions.forEach(function (s) { return s.unsubscribe(); }); + this._documentKeyDownListener(); + }; + SuiSelectBase.propDecorators = { + "_menu": [{ type: _angular_core.ViewChild, args: [SuiDropdownMenu,] },], + "_renderedOptions": [{ type: _angular_core.ContentChildren, args: [SuiSelectOption, { descendants: true },] },], + "_selectClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.dropdown",] },], + "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], + "isVisible": [{ type: _angular_core.HostBinding, args: ["class.visible",] },], + "isSearchable": [{ type: _angular_core.Input },], + "_searchClass": [{ type: _angular_core.HostBinding, args: ["class.search",] },], + "isSearching": [{ type: _angular_core.HostBinding, args: ["class.loading",] },], + "_internalSearch": [{ type: _angular_core.ViewChild, args: [SuiSelectSearch,] },], + "_manualSearch": [{ type: _angular_core.ContentChild, args: [SuiSelectSearch,] },], + "_tabIndex": [{ type: _angular_core.Input, args: ["tabindex",] },], + "tabIndex": [{ type: _angular_core.HostBinding, args: ["attr.tabindex",] },], + "isDisabled": [{ type: _angular_core.HostBinding, args: ["class.disabled",] }, { type: _angular_core.Input },], + "options": [{ type: _angular_core.Input },], + "optionsFilter": [{ type: _angular_core.Input },], + "optionsLookup": [{ type: _angular_core.Input },], + "labelField": [{ type: _angular_core.Input },], + "valueField": [{ type: _angular_core.Input },], + "optionTemplate": [{ type: _angular_core.Input },], + "optionFormatter": [{ type: _angular_core.Input },], + "icon": [{ type: _angular_core.Input },], + "transition": [{ type: _angular_core.Input },], + "transitionDuration": [{ type: _angular_core.Input },], + "onTouched": [{ type: _angular_core.Output, args: ["touched",] },], + "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], + "onFocusIn": [{ type: _angular_core.HostListener, args: ["focusin",] },], + "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout", ["$event"],] },], + "onKeyPress": [{ type: _angular_core.HostListener, args: ["keypress", ["$event"],] },], + }; + return SuiSelectBase; +}()); + +var __extends$22 = (undefined && undefined.__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 __()); + }; +})(); +var SuiMultiSelectLabel = /** @class */ (function (_super) { + __extends$22(SuiMultiSelectLabel, _super); + function SuiMultiSelectLabel(renderer, element, changeDetector, componentFactory) { + var _this = _super.call(this, renderer, element, changeDetector) || this; + _this.componentFactory = componentFactory; + // Initialise transition functionality. + // Initialise transition functionality. + _this._transitionController = new TransitionController(false, "inline-block"); + _this.setTransitionController(_this._transitionController); + _this.onDeselected = new _angular_core.EventEmitter(); + _this._labelClasses = true; + _this._transitionController.animate(new Transition("scale", 100, exports.TransitionDirection.In)); + return _this; + } + Object.defineProperty(SuiMultiSelectLabel.prototype, "template", { + get: function () { + return this._template; + }, + set: function (template) { + this._template = template; + if (this.template) { + this.componentFactory.createView(this.templateSibling, this.template, { + $implicit: this.value, + query: this.query + }); + } + }, + enumerable: true, + configurable: true + }); + SuiMultiSelectLabel.prototype.deselectOption = function (e) { + var _this = this; + e.eventHandled = true; + this._transitionController.animate(new Transition("scale", 100, exports.TransitionDirection.Out, function () { + return _this.onDeselected.emit(_this.value); + })); + }; + SuiMultiSelectLabel.prototype.onClick = function (e) { + e.eventHandled = true; + }; + SuiMultiSelectLabel.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-multi-select-label", + template: "\n\n\n\n" + },] }, + ]; + /** @nocollapse */ + SuiMultiSelectLabel.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + { type: _angular_core.ChangeDetectorRef, }, + { type: SuiComponentFactory, }, + ]; }; + SuiMultiSelectLabel.propDecorators = { + "_labelClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.label",] },], + "value": [{ type: _angular_core.Input },], + "query": [{ type: _angular_core.Input },], + "onDeselected": [{ type: _angular_core.Output, args: ["deselected",] },], + "formatter": [{ type: _angular_core.Input },], + "template": [{ type: _angular_core.Input },], + "templateSibling": [{ type: _angular_core.ViewChild, args: ["templateSibling", { read: _angular_core.ViewContainerRef },] },], + "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], + }; + return SuiMultiSelectLabel; +}(SuiTransition)); + +var __extends$23 = (undefined && undefined.__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 __()); + }; +})(); +var SuiMultiSelect = /** @class */ (function (_super) { + __extends$23(SuiMultiSelect, _super); + function SuiMultiSelect(element, renderer, localizationService) { + var _this = _super.call(this, element, renderer, localizationService) || this; + _this.selectedOptions = []; + _this.selectedOptionsChange = new _angular_core.EventEmitter(); + _this.hasLabels = true; + _this._multiSelectClasses = true; + return _this; + } + Object.defineProperty(SuiMultiSelect.prototype, "filteredOptions", { + get: function () { + var _this = this; + if (this.maxSelectedReached) { + // If we have reached the maximum number of selections, then empty the results completely. + return []; + } + var searchResults = this.searchService.results; + if (!this.hasLabels) { + return searchResults; + } + else { + // Returns the search results \ selected options. + return searchResults + .filter(function (r) { return _this.selectedOptions.find(function (o) { return r === o; }) == undefined; }); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "availableOptions", { + get: function () { + return this.filteredOptions; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "hasLabels", { + get: function () { + return this._hasLabels; + }, + set: function (hasLabels) { + this._hasLabels = hasLabels; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "placeholder", { + get: function () { + return this._placeholder || this.localeValues.multi.placeholder; + }, + set: function (placeholder) { + this._placeholder = placeholder; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "maxSelectedReached", { + get: function () { + if (this.maxSelected == undefined) { + // If there is no maximum then we can immediately return. + return false; + } + return this.selectedOptions.length === this.maxSelected; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "maxSelectedMessage", { + get: function () { + return this._localizationService.interpolate(this.localeValues.multi.maxSelectedMessage, [["max", this.maxSelected.toString()]]); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "selectedMessage", { + get: function () { + return this._localizationService.interpolate(this.localeValues.multi.selectedMessage, [["count", this.selectedOptions.length.toString()]]); + }, + enumerable: true, + configurable: true + }); + SuiMultiSelect.prototype.optionsUpdateHook = function () { + var _this = this; + if (!this._writtenOptions && this.selectedOptions.length > 0) { + // We need to check the options still exist. + this.writeValue(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); + } + if (this._writtenOptions && this.searchService.options.length > 0) { + // If there were values written by ngModel before the options had been loaded, this runs to fix it. + this.selectedOptions = this._writtenOptions + .map(function (v) { return _this.findOption(_this.searchService.options, v); }) + .filter(function (v) { return v != undefined; }); + if (this.selectedOptions.length === this._writtenOptions.length) { + this._writtenOptions = undefined; + } + } + }; + SuiMultiSelect.prototype.initialiseRenderedOption = function (option) { + _super.prototype.initialiseRenderedOption.call(this, option); + // Boldens the item so it appears selected in the dropdown. + option.isActive = !this.hasLabels && this.selectedOptions.indexOf(option.value) !== -1; + }; + SuiMultiSelect.prototype.selectOption = function (option) { + var _this = this; + if (this.selectedOptions.indexOf(option) !== -1) { + this.deselectOption(option); + return; + } + this.selectedOptions.push(option); + this.selectedOptionsChange.emit(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); + this.resetQuery(false); + // Automatically refocus the search input for better keyboard accessibility. + this.focus(); + if (!this.hasLabels) { + this.onAvailableOptionsRendered(); + } + }; + SuiMultiSelect.prototype.writeValue = function (values) { + var _this = this; + if (values instanceof Array) { + if (this.searchService.options.length > 0) { + // If the options have already been loaded, we can immediately match the ngModel values to options. + this.selectedOptions = values + .map(function (v) { return _this.findOption(_this.searchService.options, v); }) + .filter(function (v) { return v != undefined; }); + } + if (values.length > 0 && this.selectedOptions.length === 0) { + if (this.valueField && this.searchService.hasItemLookup) { + // If the search service has a selected lookup function, make use of that to load the initial values. + this.searchService + .initialLookup(values) + .then(function (items) { return _this.selectedOptions = items; }); + } + else { + // Otherwise, cache the written value for when options are set. + this._writtenOptions = values; + } + } + if (values.length === 0) { + this.selectedOptions = []; + } + } + else { + this.selectedOptions = []; + } + }; + SuiMultiSelect.prototype.deselectOption = function (option) { + var _this = this; + // Update selected options to the previously selected options \ {option}. + this.selectedOptions = this.selectedOptions.filter(function (so) { return so !== option; }); + this.selectedOptionsChange.emit(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); + // Automatically refocus the search input for better keyboard accessibility. + this.focus(); + if (!this.hasLabels) { + this.onAvailableOptionsRendered(); + } + }; + SuiMultiSelect.prototype.onQueryInputKeydown = function (event) { + if (event.keyCode === exports.KeyCode.Backspace && this.query === "" && this.selectedOptions.length > 0) { + // Deselect the rightmost option when the user presses backspace in the search input. + this.deselectOption(this.selectedOptions[this.selectedOptions.length - 1]); + } + }; + SuiMultiSelect.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-multi-select", + template: "\n\n\n\n\n\n \n\n\n\n\n\n\n
\n \n \n {{ placeholder }}\n \n \n {{ selectedMessage }}\n
\n\n\n
\n\n \n \n
{{ localeValues.noResultsMessage }}
\n
{{ maxSelectedMessage }}
\n
\n
\n", + styles: ["\n:host input.search {\n width: 12em !important;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiMultiSelect.ctorParameters = function () { return [ + { type: _angular_core.ElementRef, }, + { type: _angular_core.Renderer2, }, + { type: SuiLocalizationService, }, + ]; }; + SuiMultiSelect.propDecorators = { + "selectedOptionsChange": [{ type: _angular_core.Output },], + "hasLabels": [{ type: _angular_core.Input },], + "placeholder": [{ type: _angular_core.Input },], + "maxSelected": [{ type: _angular_core.Input },], + "_multiSelectClasses": [{ type: _angular_core.HostBinding, args: ["class.multiple",] },], + }; + return SuiMultiSelect; +}(SuiSelectBase)); +// Value accessor directive for the select to support ngModel. +var SuiMultiSelectValueAccessor = /** @class */ (function (_super) { + __extends$23(SuiMultiSelectValueAccessor, _super); + function SuiMultiSelectValueAccessor(host) { + return _super.call(this, host) || this; + } + SuiMultiSelectValueAccessor.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "sui-multi-select", + host: { + "(selectedOptionsChange)": "onChange($event)", + "(touched)": "onTouched()" + }, + providers: [customValueAccessorFactory(SuiMultiSelectValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiMultiSelectValueAccessor.ctorParameters = function () { return [ + { type: SuiMultiSelect, }, + ]; }; + return SuiMultiSelectValueAccessor; +}(CustomValueAccessor)); + +var __extends$24 = (undefined && undefined.__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 __()); + }; +})(); +var SuiSelect = /** @class */ (function (_super) { + __extends$24(SuiSelect, _super); + function SuiSelect(element, renderer, localizationService) { + var _this = _super.call(this, element, renderer, localizationService) || this; + _this.selectedOptionChange = new _angular_core.EventEmitter(); + return _this; + } + Object.defineProperty(SuiSelect.prototype, "placeholder", { + get: function () { + return this._placeholder || this.localeValues.single.placeholder; + }, + set: function (placeholder) { + this._placeholder = placeholder; + }, + enumerable: true, + configurable: true + }); + SuiSelect.prototype.optionsUpdateHook = function () { + if (!this._writtenOption && this.selectedOption) { + // We need to check the option still exists. + this.writeValue(this.valueGetter(this.selectedOption)); + } + if (this._writtenOption && this.searchService.options.length > 0) { + // If there was an value written by ngModel before the options had been loaded, this runs to fix it. + this.selectedOption = this.findOption(this.searchService.options, this._writtenOption); + if (this.selectedOption) { + this._writtenOption = undefined; + this.drawSelectedOption(); + } + } + }; + SuiSelect.prototype.queryUpdateHook = function () { + // When the query is updated, we just abandon the current selection. + this.selectedOption = undefined; + }; + SuiSelect.prototype.selectOption = function (option) { + // Choose and emit the selected option. + this.selectedOption = option; + this.selectedOptionChange.emit(this.valueGetter(option)); + this.dropdownService.setOpenState(false); + this.resetQuery(); + this.drawSelectedOption(); + // Automatically refocus the search input for better keyboard accessibility. + this.focus(); + }; + SuiSelect.prototype.writeValue = function (value) { + var _this = this; + if (value != undefined) { + if (this.searchService.options.length > 0) { + // If the options have already been loaded, we can immediately match the ngModel value to an option. + this.selectedOption = this.findOption(this.searchService.options, value); + this.drawSelectedOption(); + } + if (this.selectedOption == undefined) { + if (this.valueField && this.searchService.hasItemLookup) { + // If the search service has a selected lookup function, make use of that to load the initial value. + this.searchService + .initialLookup(value) + .then(function (i) { + _this.selectedOption = i; + _this.drawSelectedOption(); + }); + } + else { + // Otherwise, cache the written value for when options are set. + this._writtenOption = value; + } + } + } + else { + this.selectedOption = undefined; + this.drawSelectedOption(); + } + }; + SuiSelect.prototype.initialiseRenderedOption = function (option) { + _super.prototype.initialiseRenderedOption.call(this, option); + // Boldens the item so it appears selected in the dropdown. + option.isActive = option.value === this.selectedOption; + }; + SuiSelect.prototype.drawSelectedOption = function () { + // Updates the active class on the newly selected option. + if (this._renderedOptions) { + this.onAvailableOptionsRendered(); + } + if (this.selectedOption != undefined && this.optionTemplate) { + this.drawTemplate(this._optionTemplateSibling, this.selectedOption); + } + }; + SuiSelect.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-select", + template: "\n\n\n\n\n
{{ placeholder }}
\n\n
\n \n \n
\n\n\n\n
\n\n \n
\n {{ localeValues.noResultsMessage }}\n
\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiSelect.ctorParameters = function () { return [ + { type: _angular_core.ElementRef, }, + { type: _angular_core.Renderer2, }, + { type: SuiLocalizationService, }, + ]; }; + SuiSelect.propDecorators = { + "_optionTemplateSibling": [{ type: _angular_core.ViewChild, args: ["optionTemplateSibling", { read: _angular_core.ViewContainerRef },] },], + "selectedOptionChange": [{ type: _angular_core.Output },], + "placeholder": [{ type: _angular_core.Input },], + }; + return SuiSelect; +}(SuiSelectBase)); +// Value accessor directive for the select to support ngModel. +var SuiSelectValueAccessor = /** @class */ (function (_super) { + __extends$24(SuiSelectValueAccessor, _super); + function SuiSelectValueAccessor(host) { + return _super.call(this, host) || this; + } + SuiSelectValueAccessor.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "sui-select", + host: { + "(selectedOptionChange)": "onChange($event)", + "(touched)": "onTouched()" + }, + providers: [customValueAccessorFactory(SuiSelectValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiSelectValueAccessor.ctorParameters = function () { return [ + { type: SuiSelect, }, + ]; }; + return SuiSelectValueAccessor; +}(CustomValueAccessor)); + +var SuiSelectModule = /** @class */ (function () { + function SuiSelectModule() { + } + SuiSelectModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule, + _angular_forms.FormsModule, + SuiDropdownModule, + SuiUtilityModule, + SuiLocalizationModule + ], + declarations: [ + SuiSelect, + SuiSelectOption, + SuiSelectSearch, + SuiSelectValueAccessor, + SuiMultiSelect, + SuiMultiSelectLabel, + SuiMultiSelectValueAccessor + ], + exports: [ + SuiSelect, + SuiSelectOption, + SuiSelectSearch, + SuiSelectValueAccessor, + SuiMultiSelect, + SuiMultiSelectValueAccessor + ] + },] }, + ]; + /** @nocollapse */ + SuiSelectModule.ctorParameters = function () { return []; }; + return SuiSelectModule; +}()); + +var SidebarTransition = { + Overlay: "overlay", + Push: "push", + ScaleDown: "scale down", + Uncover: "uncover", + SlideAlong: "slide along", + SlideOut: "slide out" +}; +var SidebarDirection = { + Left: "left", + Right: "right", + Top: "top", + Bottom: "bottom" +}; +var SidebarService = /** @class */ (function () { + function SidebarService(isVisible) { + if (isVisible === void 0) { isVisible = false; } + this.isVisible = isVisible; + this.isAnimating = false; + this.wasJustOpened = false; + this.isVisibleChange = new _angular_core.EventEmitter(); + this.widthChange = new _angular_core.EventEmitter(); + this.heightChange = new _angular_core.EventEmitter(); + this.width = 260; + this.height = 0; + this.transition = SidebarTransition.Uncover; + } + Object.defineProperty(SidebarService.prototype, "width", { + get: function () { + if (this.direction === SidebarDirection.Left) { + return this._width; + } + if (this.direction === SidebarDirection.Right) { + return -this._width; + } + return 0; + }, + set: function (width) { + this._width = width; + this.widthChange.emit(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SidebarService.prototype, "height", { + get: function () { + if (this.direction === SidebarDirection.Top) { + return this._height; + } + if (this.direction === SidebarDirection.Bottom) { + return -this._height; + } + return 0; + }, + set: function (height) { + this._height = height; + this.heightChange.emit(); + }, + enumerable: true, + configurable: true + }); + SidebarService.prototype.setVisibleState = function (isVisible) { + var _this = this; + if (this.isVisible !== isVisible) { + this.isVisible = isVisible; + this.isAnimating = true; + this.wasJustOpened = true; + this.isVisibleChange.emit(isVisible); + setTimeout(function () { return _this.wasJustOpened = false; }); + clearTimeout(this._isAnimatingTimeout); + this._isAnimatingTimeout = window.setTimeout(function () { return _this.isAnimating = false; }, 500); + } + }; + SidebarService.prototype.toggleVisibleState = function () { + this.setVisibleState(!this.isVisible); + }; + return SidebarService; +}()); + +var SuiSidebar = /** @class */ (function () { + function SuiSidebar(_renderer, _element) { + var _this = this; + this._renderer = _renderer; + this._element = _element; + this.service = new SidebarService(); + // We set the default here as well to force the classes to update. + this.transition = SidebarTransition.Uncover; + this.direction = SidebarDirection.Left; + setTimeout(function () { return _this.updateDimensions(); }); + this.service.isVisibleChange.subscribe(function () { return _this.updateDimensions(); }); + this._sidebarClasses = true; + } + Object.defineProperty(SuiSidebar.prototype, "transition", { + get: function () { + return this.service.transition; + }, + set: function (transition) { + var _this = this; + this.service.transition.split(" ").forEach(function (c) { return _this.setClass(c, false); }); + this.service.transition = transition; + this.service.transition.split(" ").forEach(function (c) { return _this.setClass(c, true); }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebar.prototype, "direction", { + get: function () { + return this.service.direction; + }, + set: function (direction) { + this.setClass(this.service.direction, false); + this.service.direction = direction; + this.setClass(this.service.direction, true); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebar.prototype, "isVisible", { + get: function () { + return this.service.isVisible; + }, + set: function (isVisible) { + this.service.setVisibleState(isVisible); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebar.prototype, "isVisibleChange", { + get: function () { + return this.service.isVisibleChange; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebar.prototype, "isAnimating", { + get: function () { + return this.service.isAnimating; + }, + enumerable: true, + configurable: true + }); + SuiSidebar.prototype.updateDimensions = function () { + this.service.width = this._element.nativeElement.offsetWidth; + this.service.height = this._element.nativeElement.offsetHeight; + }; + SuiSidebar.prototype.setClass = function (className, isAdd) { + if (isAdd === void 0) { isAdd = true; } + if (isAdd) { + this._renderer.addClass(this._element.nativeElement, className); + } + else { + this._renderer.removeClass(this._element.nativeElement, className); + } + }; + SuiSidebar.prototype.open = function () { + this.service.setVisibleState(true); + }; + SuiSidebar.prototype.close = function () { + this.service.setVisibleState(false); + }; + SuiSidebar.prototype.toggle = function () { + this.service.toggleVisibleState(); + }; + SuiSidebar.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-sidebar", + template: "" + },] }, + ]; + /** @nocollapse */ + SuiSidebar.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + ]; }; + SuiSidebar.propDecorators = { + "_sidebarClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.sidebar",] }, { type: _angular_core.HostBinding, args: ["class.menu",] },], + "transition": [{ type: _angular_core.Input },], + "direction": [{ type: _angular_core.Input },], + "isVisible": [{ type: _angular_core.HostBinding, args: ["class.visible",] }, { type: _angular_core.Input },], + "isVisibleChange": [{ type: _angular_core.Output },], + "isAnimating": [{ type: _angular_core.HostBinding, args: ["class.animating",] },], + }; + return SuiSidebar; +}()); + +var SuiSidebarSibling = /** @class */ (function () { + function SuiSidebarSibling(_renderer, _element) { + this._renderer = _renderer; + this._element = _element; + this.isDimmedWhenVisible = false; + this._siblingClasses = true; + } + Object.defineProperty(SuiSidebarSibling.prototype, "service", { + get: function () { + return this._service; + }, + set: function (service) { + var _this = this; + this._service = service; + setTimeout(function () { return _this.updateTransform(); }); + this._service.isVisibleChange.subscribe(function () { return _this.updateTransform(); }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebarSibling.prototype, "isVisible", { + get: function () { + if (!this.service) { + return false; + } + return this.service.isVisible; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebarSibling.prototype, "isDimmed", { + get: function () { + if (!this.service) { + return false; + } + return this.service.isVisible && this.isDimmedWhenVisible; + }, + enumerable: true, + configurable: true + }); + SuiSidebarSibling.prototype.updateTransform = function () { + this._renderer.removeStyle(this._element.nativeElement, "transform"); + this._renderer.removeStyle(this._element.nativeElement, "-webkit-transform"); + if (this.service.isVisible && + this.service.transition !== SidebarTransition.Overlay && + this.service.transition !== SidebarTransition.ScaleDown) { + var translate = "translate3d(" + this.service.width + "px, " + this.service.height + "px, 0)"; + this._renderer.setStyle(this._element.nativeElement, "transform", translate); + this._renderer.setStyle(this._element.nativeElement, "-webkit-transform", translate); + } + }; + SuiSidebarSibling.prototype.onClick = function (event) { + if (this.service.isVisible && !this.service.wasJustOpened) { + this.service.setVisibleState(false); + } + }; + SuiSidebarSibling.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-sidebar-sibling", + template: "", + styles: ["\n:host {\n display: block;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiSidebarSibling.ctorParameters = function () { return [ + { type: _angular_core.Renderer2, }, + { type: _angular_core.ElementRef, }, + ]; }; + SuiSidebarSibling.propDecorators = { + "isDimmedWhenVisible": [{ type: _angular_core.Input },], + "isVisible": [{ type: _angular_core.HostBinding, args: ["class.visible",] },], + "isDimmed": [{ type: _angular_core.HostBinding, args: ["class.dimmed",] },], + "_siblingClasses": [{ type: _angular_core.HostBinding, args: ["class.pusher",] },], + "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], + }; + return SuiSidebarSibling; +}()); + +var SuiSidebarContainer = /** @class */ (function () { + function SuiSidebarContainer() { + this._containerClasses = true; + } + SuiSidebarContainer.prototype.ngAfterContentInit = function () { + if (!this.sidebar) { + throw new Error("You must include a element within the container."); + } + this.service = this.sidebar.service; + if (!this.sibling) { + throw new Error("You must include a element within the container."); + } + this.sibling.service = this.service; + }; + SuiSidebarContainer.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-sidebar-container", + template: "", + styles: ["\n:host {\n display: block;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiSidebarContainer.ctorParameters = function () { return []; }; + SuiSidebarContainer.propDecorators = { + "_containerClasses": [{ type: _angular_core.HostBinding, args: ["class.pushable",] },], + "sidebar": [{ type: _angular_core.ContentChild, args: [SuiSidebar,] },], + "sibling": [{ type: _angular_core.ContentChild, args: [SuiSidebarSibling,] },], + }; + return SuiSidebarContainer; +}()); + +var SuiSidebarModule = /** @class */ (function () { + function SuiSidebarModule() { + } + SuiSidebarModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule + ], + declarations: [ + SuiSidebar, + SuiSidebarContainer, + SuiSidebarSibling + ], + exports: [ + SuiSidebar, + SuiSidebarContainer, + SuiSidebarSibling + ] + },] }, + ]; + /** @nocollapse */ + SuiSidebarModule.ctorParameters = function () { return []; }; + return SuiSidebarModule; +}()); + +var Tab = /** @class */ (function () { + function Tab(header, content) { + var _this = this; + this.id = header.id; + this.header = header; + this.content = content; + // So that the header and content isActive properties are always in sync. + this.header.isActiveChange + .subscribe(function () { return _this.content.isActive = _this.isActive; }); + } + Object.defineProperty(Tab.prototype, "isActive", { + // Saves accessing .header.isActive every time. + get: + // Saves accessing .header.isActive every time. + function () { + return this.header.isActive; + }, + set: function (active) { + // Use `setActiveState` so as not to fire 'external changes' event. + this.header.setActiveState(active); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Tab.prototype, "isDisabled", { + // Saves accessing .header.isDisabled every time. + get: + // Saves accessing .header.isDisabled every time. + function () { + return this.header.isDisabled; + }, + enumerable: true, + configurable: true + }); + return Tab; +}()); + +var SuiTabHeader = /** @class */ (function () { + function SuiTabHeader() { + this._isActive = false; + this.isActiveChange = new _angular_core.EventEmitter(); + this.isActiveExternalChange = new _angular_core.EventEmitter(); + this.onActivate = new _angular_core.EventEmitter(); + this.onDeactivate = new _angular_core.EventEmitter(); + this.isDisabled = false; + this._headerClasses = true; + } + Object.defineProperty(SuiTabHeader.prototype, "isActive", { + get: function () { + return this._isActive; + }, + set: function (active) { + var _this = this; + var isActive = active; + // Only used by @Input(), runs whenever user input changes `isActive`. + // Run in timeout because `isDisabled` can prohibit user from changing `isActive`. + // so update is delayed to avoid 'changed after checked' error. + setTimeout(function () { + // Only allow change if tab header is not disabled. + isActive = !_this.isDisabled ? active : false; + _this.setActiveState(isActive); + // Fire 'external change' event as user input has occured. + // Fire 'external change' event as user input has occured. + _this.isActiveExternalChange.emit(isActive); + }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiTabHeader.prototype, "isDisabled", { + get: function () { + return this._isDisabled; + }, + set: function (disabled) { + // Only update if value provided is different to current one. + if (this._isDisabled !== disabled) { + this._isDisabled = disabled; + // If now disabled, then tab header must be deactivated. + if (this.isDisabled) { + this.isActive = false; + } + } + }, + enumerable: true, + configurable: true + }); + // Internally update active state. + // Internally update active state. + SuiTabHeader.prototype.setActiveState = + // Internally update active state. + function (active) { + // If (cast) active value has changed: + if (!!this._isActive !== active) { + // Update to the new value. + this._isActive = active; + // Fire the appropriate activation event. + if (active) { + this.onActivate.emit(); + } + else { + this.onDeactivate.emit(); + } + } + // Regardless, emit a change to `isActive`, so [(isActive)] works correctly. + this.isActiveChange.emit(active); + }; + SuiTabHeader.prototype.onClick = function () { + if (!this.isDisabled) { + // Activate the tab when clicked, so long as it isn't disabled. + this.isActive = true; + } + }; + SuiTabHeader.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "[suiTabHeader]" + },] }, + ]; + /** @nocollapse */ + SuiTabHeader.ctorParameters = function () { return []; }; + SuiTabHeader.propDecorators = { + "_headerClasses": [{ type: _angular_core.HostBinding, args: ["class.item",] },], + "id": [{ type: _angular_core.Input, args: ["suiTabHeader",] },], + "isActiveChange": [{ type: _angular_core.Output },], + "onActivate": [{ type: _angular_core.Output, args: ["activate",] },], + "onDeactivate": [{ type: _angular_core.Output, args: ["deactivate",] },], + "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] }, { type: _angular_core.Input },], + "isDisabled": [{ type: _angular_core.HostBinding, args: ["class.disabled",] }, { type: _angular_core.Input },], + "onClick": [{ type: _angular_core.HostListener, args: ["click",] },], + }; + return SuiTabHeader; +}()); + +var SuiTabContent = /** @class */ (function () { + function SuiTabContent() { + this.isActive = false; + this._contentClasses = true; + } + SuiTabContent.decorators = [ + { type: _angular_core.Directive, args: [{ + selector: "[suiTabContent]" + },] }, + ]; + /** @nocollapse */ + SuiTabContent.ctorParameters = function () { return []; }; + SuiTabContent.propDecorators = { + "_contentClasses": [{ type: _angular_core.HostBinding, args: ["class.tab",] },], + "id": [{ type: _angular_core.Input, args: ["suiTabContent",] },], + "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], + }; + return SuiTabContent; +}()); + +var SuiTabset = /** @class */ (function () { + function SuiTabset() { + this.tabs = []; + this._barrierCount = 0; + } + Object.defineProperty(SuiTabset.prototype, "activeTab", { + get: function () { + return this._activeTab; + }, + // When setting a tab as the currently active tab, it automatically gains + // `isActive` status (saves littering `isActive = true` everywhere). + set: + // When setting a tab as the currently active tab, it automatically gains + // `isActive` status (saves littering `isActive = true` everywhere). + function (tab) { + this._activeTab = tab; + tab.isActive = true; + }, + enumerable: true, + configurable: true + }); + SuiTabset.prototype.ngAfterContentInit = function () { + var _this = this; + // Fire `internalComponentsUpdated` when the query lists change. + this._tabHeaders.changes.subscribe(function () { return _this.internalComponentsUpdated(); }); + this._tabContents.changes.subscribe(function () { return _this.internalComponentsUpdated(); }); + // Initially load the tabs. + this.loadTabs(); + }; + // Fires whenever either the tab headers or tab contents query lists update. + // Fires whenever either the tab headers or tab contents query lists update. + SuiTabset.prototype.internalComponentsUpdated = + // Fires whenever either the tab headers or tab contents query lists update. + function () { + // We are using a 'counting barrier of n = 2', i.e. the code within only runs after the method is called twice. + // This is so that both the headers and contents query lists can update before we run code that matches the two up. + this._barrierCount++; + if (this._barrierCount === 2) { + // Reset the barrier so it can be called again. + this._barrierCount = 0; + // Update the tabs. + this.loadTabs(); + } + }; + // Connects tab headers to tab contents, and creates a tab instance for each pairing. + // Connects tab headers to tab contents, and creates a tab instance for each pairing. + SuiTabset.prototype.loadTabs = + // Connects tab headers to tab contents, and creates a tab instance for each pairing. + function () { + var _this = this; + // Remove any tabs that no longer have an associated header. + this.tabs = this.tabs.filter(function (t) { return !!_this._tabHeaders.find(function (tH) { return tH === t.header; }); }); + this._tabHeaders + .filter(function (tH) { return !_this.tabs.find(function (t) { return t.header === tH; }); }) + .forEach(function (tH) { + var content = _this._tabContents.find(function (tC) { return tC.id === tH.id; }); + if (!content) { + // Error if an associated tab content cannot be found for the given header. + throw new Error("A [suiTabHeader] must have a related [suiTabContent]."); + } + // Create a new tab instance for this header & content combo. + var tab = new Tab(tH, content); + // Subscribe to any external changes in the tab header's active state. External changes are triggered by user input. + tab.header.isActiveExternalChange.subscribe(function () { return _this.onHeaderActiveChanged(tab); }); + // Add the new instance to the list of tabs. + // Add the new instance to the list of tabs. + _this.tabs.push(tab); + }); + // Assign each tab an index (which denotes the order they physically appear in). + this._tabHeaders + .forEach(function (tH, i) { + var tab = _this.tabs.find(function (t) { return t.header === tH; }); + if (tab) { + tab.index = i; + } + }); + // Sort the tabs by their index. + this.tabs.sort(function (a, b) { return a.index - b.index; }); + if (!this.activeTab) { + // Check if there are no current existing active tabs. + // If so, we must activate the first available tab. + this.activateFirstTab(); + } + else if (!this.tabs.find(function (t) { return t === _this.activeTab; })) { + // O'wise check if current active tab has been deleted. + // If so, we must find the closest. + // Use `setTimeout` as this causes a 'changed after checked' error o'wise. + setTimeout(function () { return _this.activateClosestTab(_this.activeTab); }); + } + if (this.tabs.length === 0) { + // Error if there aren't any tabs in the tabset. + throw new Error("You cannot have no tabs!"); + } + }; + // Fires whenever a tab header's active state is externally changed. + // Fires whenever a tab header's active state is externally changed. + SuiTabset.prototype.onHeaderActiveChanged = + // Fires whenever a tab header's active state is externally changed. + function (tab) { + // If the tab has become activated, but was not previously the active tab: + if (tab.isActive && this.activeTab !== tab) { + // Deactivate all of the tabs. + this.tabs.filter(function (t) { return t !== tab; }).forEach(function (t) { return t.isActive = false; }); + // Set the currently active tab to this one. + this.activeTab = tab; + } + // If the tab has become deactivated, but was previously the active tab: + if (!tab.isActive && this.activeTab === tab) { + // Activate the closest tab to it. + this.activateClosestTab(tab); + } + }; + // Activate the first tab in the set. + // Activate the first tab in the set. + SuiTabset.prototype.activateFirstTab = + // Activate the first tab in the set. + function () { + this.activeTab = this.tabs[0]; + }; + // Activates the closest available tab to a given one. + // Activates the closest available tab to a given one. + SuiTabset.prototype.activateClosestTab = + // Activates the closest available tab to a given one. + function (tab) { + var nextAvailable; + // When the exited tab's index is higher than all available tabs, + if (tab.index >= this.tabs.length) { + // Activate the last tab. + nextAvailable = this.tabs[this.tabs.length - 1]; + } + // If that didn't work, try the following cases: + if (!nextAvailable) { + if (!this.tabs.find(function (t) { return t === tab; })) { + // When the exited tab no longer exists, + // Replace it with a tab at the same index. + nextAvailable = this.tabs[tab.index]; + } + else { + // Or if the exited tab still exists, + // Go to the tab immediately to the left. + nextAvailable = this.tabs[Math.max(tab.index - 1, 0)]; + } + } + // However, if the chosen tab is disabled, + if (nextAvailable.isDisabled) { + // Activate the closest available tab to it. + return this.activateClosestTab(nextAvailable); + } + this.activeTab = nextAvailable; + }; + SuiTabset.decorators = [ + { type: _angular_core.Component, args: [{ + selector: "sui-tabset", + template: "" + },] }, + ]; + /** @nocollapse */ + SuiTabset.ctorParameters = function () { return []; }; + SuiTabset.propDecorators = { + "_tabHeaders": [{ type: _angular_core.ContentChildren, args: [SuiTabHeader,] },], + "_tabContents": [{ type: _angular_core.ContentChildren, args: [SuiTabContent,] },], + }; + return SuiTabset; +}()); + +var SuiTabsModule = /** @class */ (function () { + function SuiTabsModule() { + } + SuiTabsModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [ + _angular_common.CommonModule + ], + declarations: [ + SuiTabset, + SuiTabHeader, + SuiTabContent + ], + exports: [ + SuiTabset, + SuiTabHeader, + SuiTabContent + ] + },] }, + ]; + /** @nocollapse */ + SuiTabsModule.ctorParameters = function () { return []; }; + return SuiTabsModule; +}()); + +var SuiModule = /** @class */ (function () { + function SuiModule() { + } + SuiModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + exports: [ + SuiMessageModule, + SuiPaginationModule, + SuiAccordionModule, + SuiCheckboxModule, + SuiCollapseModule, + SuiDatepickerModule, + SuiDimmerModule, + SuiDropdownModule, + SuiModalModule, + SuiPopupModule, + SuiProgressModule, + SuiRatingModule, + SuiSearchModule, + SuiSelectModule, + SuiSidebarModule, + SuiTabsModule, + SuiTransitionModule, + SuiLocalizationModule, + SuiUtilityModule + ] + },] }, + ]; + /** @nocollapse */ + SuiModule.ctorParameters = function () { return []; }; + return SuiModule; +}()); + +exports.SuiLocalizationService = SuiLocalizationService; +exports.SuiLocalizationModule = SuiLocalizationModule; +exports.SuiMessage = SuiMessage; +exports.SuiMessageModule = SuiMessageModule; +exports.SuiPagination = SuiPagination; +exports.SuiPaginationModule = SuiPaginationModule; +exports.SuiAccordionPanel = SuiAccordionPanel; +exports.SuiAccordion = SuiAccordion; +exports.SuiAccordionService = SuiAccordionService; +exports.SuiAccordionModule = SuiAccordionModule; +exports.SuiCheckbox = SuiCheckbox; +exports.SuiCheckboxValueAccessor = SuiCheckboxValueAccessor; +exports.SuiRadio = SuiRadio; +exports.SuiRadioValueAccessor = SuiRadioValueAccessor; +exports.SuiRadioManager = SuiRadioManager; +exports.SuiCheckboxModule = SuiCheckboxModule; +exports.SuiCollapse = SuiCollapse; +exports.SuiCollapseModule = SuiCollapseModule; +exports.CalendarConfig = CalendarConfig; +exports.DateConfigBase = DateConfigBase; +exports.YearConfig = YearConfig; +exports.MonthConfig = MonthConfig; +exports.DateConfig = DateConfig; +exports.DatetimeConfig = DatetimeConfig; +exports.TimeConfig = TimeConfig; +exports.CalendarMappings = CalendarMappings; +exports.DateMappings = DateMappings; +exports.TimeMappings = TimeMappings; +exports.DatetimeMappings = DatetimeMappings; +exports.MonthMappings = MonthMappings; +exports.YearMappings = YearMappings; +exports.DateComparer = DateComparer; +exports.DateParser = DateParser; +exports.InternalDateParser = InternalDateParser; +exports.SuiCalendarViewTitle = SuiCalendarViewTitle; +exports.DatepickerMode = DatepickerMode; +exports.SuiDatepicker = SuiDatepicker; +exports.CalendarItem = CalendarItem; +exports.SuiCalendarItem = SuiCalendarItem; +exports.SuiDatepickerDirective = SuiDatepickerDirective; +exports.SuiDatepickerDirectiveValueAccessor = SuiDatepickerDirectiveValueAccessor; +exports.SuiDatepickerDirectiveValidator = SuiDatepickerDirectiveValidator; +exports.SuiDatepickerInputDirective = SuiDatepickerInputDirective; +exports.DateFnsParser = DateFnsParser; +exports.CalendarRange = CalendarRange; +exports.CalendarRangeService = CalendarRangeService; +exports.CalendarService = CalendarService; +exports.CalendarView = CalendarView; +exports.CalendarRangeDateService = CalendarRangeDateService; +exports.SuiCalendarDateView = SuiCalendarDateView; +exports.CalendarRangeHourService = CalendarRangeHourService; +exports.SuiCalendarHourView = SuiCalendarHourView; +exports.CalendarRangeMinuteService = CalendarRangeMinuteService; +exports.SuiCalendarMinuteView = SuiCalendarMinuteView; +exports.CalendarRangeMonthService = CalendarRangeMonthService; +exports.SuiCalendarMonthView = SuiCalendarMonthView; +exports.CalendarRangeYearService = CalendarRangeYearService; +exports.SuiCalendarYearView = SuiCalendarYearView; +exports.SuiDatepickerModule = SuiDatepickerModule; +exports.SuiDimmer = SuiDimmer; +exports.SuiDimmerModule = SuiDimmerModule; +exports.SuiDropdownMenuItem = SuiDropdownMenuItem; +exports.SuiDropdownMenu = SuiDropdownMenu; +exports.SuiDropdown = SuiDropdown; +exports.DropdownAutoCloseType = DropdownAutoCloseType; +exports.DropdownService = DropdownService; +exports.SuiDropdownModule = SuiDropdownModule; +exports.ActiveModal = ActiveModal; +exports.ModalSize = ModalSize; +exports.ModalConfig = ModalConfig; +exports.TemplateModalConfig = TemplateModalConfig; +exports.ComponentModalConfig = ComponentModalConfig; +exports.ModalControls = ModalControls; +exports.Modal = Modal; +exports.ModalTemplate = ModalTemplate; +exports.SuiModal = SuiModal; +exports.SuiModalService = SuiModalService; +exports.SuiModalModule = SuiModalModule; +exports.SuiPopupComponentController = SuiPopupComponentController; +exports.PopupTrigger = PopupTrigger; +exports.PopupConfig = PopupConfig; +exports.SuiPopupController = SuiPopupController; +exports.TemplatePopupConfig = TemplatePopupConfig; +exports.SuiPopupTemplateController = SuiPopupTemplateController; +exports.SuiPopupArrow = SuiPopupArrow; +exports.SuiPopup = SuiPopup; +exports.SuiPopupDirective = SuiPopupDirective; +exports.SuiPopupConfig = SuiPopupConfig; +exports.SuiPopupModule = SuiPopupModule; +exports.SuiProgress = SuiProgress; +exports.SuiProgressModule = SuiProgressModule; +exports.SuiRating = SuiRating; +exports.SuiRatingValueAccessor = SuiRatingValueAccessor; +exports.SuiRatingModule = SuiRatingModule; +exports.SuiSearchResult = SuiSearchResult; +exports.SuiSearch = SuiSearch; +exports.SearchService = SearchService; +exports.SuiSearchModule = SuiSearchModule; +exports.SuiSelectBase = SuiSelectBase; +exports.SuiMultiSelectLabel = SuiMultiSelectLabel; +exports.SuiMultiSelect = SuiMultiSelect; +exports.SuiMultiSelectValueAccessor = SuiMultiSelectValueAccessor; +exports.SuiSelectOption = SuiSelectOption; +exports.SuiSelect = SuiSelect; +exports.SuiSelectValueAccessor = SuiSelectValueAccessor; +exports.SuiSelectSearch = SuiSelectSearch; +exports.SuiSelectModule = SuiSelectModule; +exports.SuiSidebarContainer = SuiSidebarContainer; +exports.SuiSidebarSibling = SuiSidebarSibling; +exports.SuiSidebar = SuiSidebar; +exports.SidebarTransition = SidebarTransition; +exports.SidebarDirection = SidebarDirection; +exports.SidebarService = SidebarService; +exports.SuiSidebarModule = SuiSidebarModule; +exports.Tab = Tab; +exports.SuiTabset = SuiTabset; +exports.SuiTabContent = SuiTabContent; +exports.SuiTabHeader = SuiTabHeader; +exports.SuiTabsModule = SuiTabsModule; +exports.TransitionController = TransitionController; +exports.Transition = Transition; +exports.SuiTransition = SuiTransition; +exports.SuiTransitionModule = SuiTransitionModule; +exports.CustomValidator = CustomValidator; +exports.customValidatorFactory = customValidatorFactory; +exports.CustomValueAccessor = CustomValueAccessor; +exports.customValueAccessorFactory = customValueAccessorFactory; +exports.DateUtil = DateUtil; +exports.HandledEvent = HandledEvent; +exports.Util = Util; +exports.SuiComponentFactory = SuiComponentFactory; +exports.PositioningPlacement = PositioningPlacement; +exports.PositioningService = PositioningService; +exports.SuiUtilityModule = SuiUtilityModule; +exports.SuiModule = SuiModule; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/bundles/ng2-semantic-ui.umd.min.js b/bundles/ng2-semantic-ui.umd.min.js new file mode 100644 index 000000000..828ca0b3b --- /dev/null +++ b/bundles/ng2-semantic-ui.umd.min.js @@ -0,0 +1,7 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/forms"],t):t(e["ng2-semantic-ui"]=e["ng2-semantic-ui"]||{},e._angular_core,e._angular_common,e._angular_forms)}(this,function(e,t,n,i){"use strict";function r(e){return JSON.parse(JSON.stringify(e))}function o(e,t){return(dt||ft)(!0,e,t)}function s(e){return e.toLowerCase().replace("-","")}function a(e){return{provide:i.NG_VALIDATORS,useExisting:t.forwardRef(function(){return e}),multi:!0}}function c(e){return{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef(function(){return e}),multi:!0}}function u(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function l(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},Ft))}}function p(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function h(e,t){if(1!==e.nodeType)return[];var n=getComputedStyle(e,null);return t?n[t]:n}function d(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function f(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=h(e),n=t.overflow,i=t.overflowX;return/(auto|scroll|overlay)/.test(n+t.overflowY+i)?e:f(d(e))}function m(e){if(!e)return document.documentElement;for(var t=zt(10)?document.body:null,n=e.offsetParent;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TD","TABLE"].indexOf(n.nodeName)&&"static"===h(n,"position")?m(n):n:e?e.ownerDocument.documentElement:document.documentElement}function g(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||m(e.firstElementChild)===e)}function y(e){return null!==e.parentNode?y(e.parentNode):e}function v(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?e:t,r=n?t:e,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var s=o.commonAncestorContainer;if(e!==s&&t!==s||i.contains(r))return g(s)?s:m(s);var a=y(e);return a.host?v(a.host,t):v(e,y(t).host)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",i=e.nodeName;if("BODY"===i||"HTML"===i){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[n]}return e[n]}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=b(t,"top"),r=b(t,"left"),o=n?-1:1;return e.top+=i*o,e.bottom+=i*o,e.left+=r*o,e.right+=r*o,e}function _(e,t){var n="x"===t?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+i+"Width"],10)}function D(e,t,n,i){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],zt(10)?n["offset"+e]+i["margin"+("Height"===e?"Top":"Left")]+i["margin"+("Height"===e?"Bottom":"Right")]:0)}function C(){var e=document.body,t=document.documentElement,n=zt(10)&&getComputedStyle(t);return{height:D("Height",e,t,n),width:D("Width",e,t,n)}}function O(e){return $t({},e,{right:e.left+e.width,bottom:e.top+e.height})}function S(e){var t={};try{if(zt(10)){t=e.getBoundingClientRect();var n=b(e,"top"),i=b(e,"left");t.top+=n,t.left+=i,t.bottom+=n,t.right+=i}else t=e.getBoundingClientRect()}catch(e){}var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?C():{},s=o.width||e.clientWidth||r.right-r.left,a=o.height||e.clientHeight||r.bottom-r.top,c=e.offsetWidth-s,u=e.offsetHeight-a;if(c||u){var l=h(e);c-=_(l,"x"),u-=_(l,"y"),r.width-=c,r.height-=u}return O(r)}function M(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=zt(10),r="HTML"===t.nodeName,o=S(e),s=S(t),a=f(e),c=h(t),u=parseFloat(c.borderTopWidth,10),l=parseFloat(c.borderLeftWidth,10);n&&"HTML"===t.nodeName&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=O({top:o.top-s.top-u,left:o.left-s.left-l,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!i&&r){var d=parseFloat(c.marginTop,10),m=parseFloat(c.marginLeft,10);p.top-=u-d,p.bottom-=u-d,p.left-=l-m,p.right-=l-m,p.marginTop=d,p.marginLeft=m}return(i&&!n?t.contains(a):t===a&&"BODY"!==a.nodeName)&&(p=w(p,t)),p}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,i=M(e,n),r=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),s=t?0:b(n),a=t?0:b(n,"left");return O({top:s-i.top+i.marginTop,left:a-i.left+i.marginLeft,width:r,height:o})}function k(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===h(e,"position")||k(d(e)))}function P(e){if(!e||!e.parentElement||zt())return document.documentElement;for(var t=e.parentElement;t&&"none"===h(t,"transform");)t=t.parentElement;return t||document.documentElement}function x(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},s=r?P(e):v(e,t);if("viewport"===i)o=T(s,r);else{var a=void 0;"scrollParent"===i?(a=f(d(t)),"BODY"===a.nodeName&&(a=e.ownerDocument.documentElement)):a="window"===i?e.ownerDocument.documentElement:i;var c=M(a,s,r);if("HTML"!==a.nodeName||k(s))o=c;else{var u=C(),l=u.height,p=u.width;o.top+=c.top-c.marginTop,o.bottom=l+c.top,o.left+=c.left-c.marginLeft,o.right=p+c.left}}return o.left+=n,o.top+=n,o.right-=n,o.bottom-=n,o}function I(e){return e.width*e.height}function E(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var s=x(n,i,o,r),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},c=Object.keys(a).map(function(e){return $t({key:e},a[e],{area:I(a[e])})}).sort(function(e,t){return t.area-e.area}),u=c.filter(function(e){var t=e.width,i=e.height;return t>=n.clientWidth&&i>=n.clientHeight}),l=u.length>0?u[0].key:c[0].key,p=e.split("-")[1];return l+(p?"-"+p:"")}function L(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return M(n,i?P(t):v(t,n),i)}function j(e){var t=getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+i,height:e.offsetHeight+n}}function V(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function H(e,t,n){n=n.split("-")[0];var i=j(e),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),s=o?"top":"left",a=o?"left":"top",c=o?"height":"width",u=o?"width":"height";return r[s]=t[s]+t[c]/2-i[c]/2,r[a]=n===a?t[a]-i[u]:t[V(a)],r}function R(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function A(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var i=R(e,function(e){return e[t]===n});return e.indexOf(i)}function F(e,t,n){return(void 0===n?e:e.slice(0,A(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&p(n)&&(t.offsets.popper=O(t.offsets.popper),t.offsets.reference=O(t.offsets.reference),t=n(t,e))}),t}function Y(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=E(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=H(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=F(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function B(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function N(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;is[f]&&(e.offsets.popper[p]+=a[p]+m-s[f]),e.offsets.popper=O(e.offsets.popper);var g=a[p]+a[u]/2-m/2,y=h(e.instance.popper),v=parseFloat(y["margin"+l],10),b=parseFloat(y["border"+l+"Width"],10),w=g-e.offsets.popper[p]-v-b;return w=Math.max(Math.min(s[u]-m,w),0),e.arrowElement=i,e.offsets.arrow=(n={},Kt(n,p,Math.round(w)),Kt(n,d,""),n),e}function re(e){return"end"===e?"start":"start"===e?"end":e}function oe(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Gt.indexOf(e),i=Gt.slice(n+1).concat(Gt.slice(0,n));return t?i.reverse():i}function se(e,t){if(B(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=x(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),i=e.placement.split("-")[0],r=V(i),o=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case Jt.FLIP:s=[i,r];break;case Jt.CLOCKWISE:s=oe(i);break;case Jt.COUNTERCLOCKWISE:s=oe(i,!0);break;default:s=t.behavior}return s.forEach(function(a,c){if(i!==a||s.length===c+1)return e;i=e.placement.split("-")[0],r=V(i);var u=e.offsets.popper,l=e.offsets.reference,p=Math.floor,h="left"===i&&p(u.right)>p(l.left)||"right"===i&&p(u.left)p(l.top)||"bottom"===i&&p(u.top)p(n.right),m=p(u.top)p(n.bottom),y="left"===i&&d||"right"===i&&f||"top"===i&&m||"bottom"===i&&g,v=-1!==["top","bottom"].indexOf(i),b=!!t.flipVariations&&(v&&"start"===o&&d||v&&"end"===o&&f||!v&&"start"===o&&m||!v&&"end"===o&&g);(h||y||b)&&(e.flipped=!0,(h||y)&&(i=s[c+1]),b&&(o=re(o)),e.placement=i+(o?"-"+o:""),e.offsets.popper=$t({},e.offsets.popper,H(e.instance.popper,e.offsets.reference,e.placement)),e=F(e.instance.modifiers,e,"flip"))}),e}function ae(e){var t=e.offsets,n=t.popper,i=t.reference,r=e.placement.split("-")[0],o=Math.floor,s=-1!==["top","bottom"].indexOf(r),a=s?"right":"bottom",c=s?"left":"top",u=s?"width":"height";return n[a]o(i[a])&&(e.offsets.popper[c]=o(i[a])),e}function ce(e,t,n,i){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+r[1],s=r[2];if(!o)return e;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=i}return O(a)[t]/100*o}if("vh"===s||"vw"===s){return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}function ue(e,t,n,i){var r=[0,0],o=-1!==["right","left"].indexOf(i),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(R(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,u=-1!==a?[s.slice(0,a).concat([s[a].split(c)[0]]),[s[a].split(c)[1]].concat(s.slice(a+1))]:[s];return u=u.map(function(e,i){var r=(1===i?!o:o)?"height":"width",s=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return ce(e,r,t,n)})}),u.forEach(function(e,t){e.forEach(function(n,i){G(n)&&(r[t]+=n*("-"===e[i-1]?-1:1))})}),r}function le(e,t){var n=t.offset,i=e.placement,r=e.offsets,o=r.popper,s=r.reference,a=i.split("-")[0],c=void 0;return c=G(+n)?[+n,0]:ue(n,o,s,a),"left"===a?(o.top+=c[0],o.left-=c[1]):"right"===a?(o.top+=c[0],o.left+=c[1]):"top"===a?(o.left+=c[0],o.top-=c[1]):"bottom"===a&&(o.left+=c[0],o.top+=c[1]),e.popper=o,e}function pe(e,t){var n=t.boundariesElement||m(e.instance.popper);e.instance.reference===n&&(n=m(n));var i=x(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);t.boundaries=i;var r=t.priority,o=e.offsets.popper,s={primary:function(e){var n=o[e];return o[e]i[e]&&!t.escapeWithReference&&(r=Math.min(o[n],i[e]-("right"===e?o.width:o.height))),Kt({},n,r)}};return r.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";o=$t({},o,s[t](e))}),e.offsets.popper=o,e}function he(e){var t=e.placement,n=t.split("-")[0],i=t.split("-")[1];if(i){var r=e.offsets,o=r.reference,s=r.popper,a=-1!==["bottom","top"].indexOf(n),c=a?"left":"top",u=a?"width":"height",l={start:Kt({},c,o[c]),end:Kt({},c,o[c]+o[u]-s[u])};e.offsets.popper=$t({},s,l[i])}return e}function de(e){if(!ne(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=R(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right0?"in "+i:i+" ago":i}function Pe(e){return e.replace(Fn,function(e){return e.slice(1)})}function xe(e,t,n,i){return Bn[e]}function Ie(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}function Ee(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}function Le(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}function je(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}function Ve(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}function He(e){return parseInt(e[1],10)}function Re(e,t){var n=ye(e,t),i=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime(),o=i-r;return Math.floor(o/ti)+1}function Ae(e,t){var n=ye(e,t),i=n.getUTCDay(),r=(i<1?7:0)+i-1;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function Fe(e,t){var n=ye(e,t),i=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(i+1,0,4),r.setUTCHours(0,0,0,0);var o=Ae(r,t),s=new Date(0);s.setUTCFullYear(i,0,4),s.setUTCHours(0,0,0,0);var a=Ae(s,t);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Ye(e,t){var n=Fe(e,t),i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),Ae(i,t)}function Be(e,t){var n=ye(e,t),i=Ae(n,t).getTime()-Ye(n,t).getTime();return Math.round(i/ni)+1}function Ne(e,t){t=t||"";var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;return n+Ue(r,2)+t+Ue(o,2)}function Ue(e,t){for(var n=Math.abs(e).toString();n.length=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=ye(e,n),u=Number(t),l=c.getUTCDay(),p=u%7,h=(p+7)%7,d=(h=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=o.locale||ei,c=a.parsers||{},u=a.units||{};if(!a.match)throw new RangeError("locale must contain match property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var l=String(t).replace(hi,function(e){return"["===e[0]?e:"\\"===e[0]?nt(e):a.formatLong(e)});if(""===l)return""===r?ye(n,o):new Date(NaN);var p=Se(o);p.locale=a;var h,d=l.match(a.parsingTokensRegExp||di),f=d.length,m=[{priority:li,set:tt,index:0}];for(h=0;h\n \n \n\n',styles:["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"]}]}],n.ctorParameters=function(){return[]},n.propDecorators={isDismissable:[{type:t.Input}],onDismiss:[{type:t.Output,args:["dismiss"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],class:[{type:t.Input,args:["class"]}]},n}(),Dt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[_t],exports:[_t]}]}],e.ctorParameters=function(){return[]},e}(),Ct=function(){function e(){this._paginationClasses=!0,this.pageChange=new t.EventEmitter,this.pageSize=10,this._page=1,this._pages=[],this.pageCount=1,this.hasNavigationLinks=!0,this.hasBoundaryLinks=!1,this.canRotate=!1,this.hasEllipses=!0}return Object.defineProperty(e.prototype,"maxSize",{get:function(){return this._maxSize},set:function(e){this._maxSize=void 0!=e?Math.max(e,1):void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collectionSize",{get:function(){return this._collectionSize},set:function(e){this._collectionSize=Math.max(e,0),this.pageCount=Math.max(1,Math.ceil(this._collectionSize/this.pageSize))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNavigationLinks",{get:function(){var e=this._maxSize||this.pageCount;return this._hasNavigationLinks||e1},e.prototype.hasNext=function(){return this.page\n \n\n\n \n\n\n \n 1\n \n ...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n',styles:["\n:host .item {\n transition: none;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_paginationClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.pagination"]},{type:t.HostBinding,args:["class.menu"]}],pageChange:[{type:t.Output}],maxSize:[{type:t.Input}],pageSize:[{type:t.Input}],collectionSize:[{type:t.Input}],hasNavigationLinks:[{type:t.Input}],hasBoundaryLinks:[{type:t.Input}],canRotate:[{type:t.Input}],hasEllipses:[{type:t.Input}],page:[{type:t.Input}]},e}(),Ot=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],exports:[Ct],declarations:[Ct],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),St=function(){function e(e){this._changeDetector=e,this.transitionController=new vt(!1),this._isOpen=!1,this.isOpenChange=new t.EventEmitter(!1)}return Object.defineProperty(e.prototype,"service",{set:function(e){this._service=e,this._changeDetector.detectChanges()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},set:function(e){var t=!!e;t!==this.isOpen&&(this._isOpen=t,t&&this._service&&this._service.closeOtherPanels(this),this.isOpenChange.emit(this.isOpen),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.transition,this.transitionDuration)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{get:function(){return this._service?this._service.transition:"fade"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{get:function(){return this._service?this._service.transitionDuration:0},enumerable:!0,configurable:!0}),e.prototype.toggle=function(){this.isDisabled||(this.isOpen=!this.isOpen)},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion-panel",exportAs:"suiAccordionPanel",template:'\n\x3c!-- Title --\x3e\n
\n \n
\n\x3c!-- Content --\x3e\n
\n
\n \n
\n
\n',styles:["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},e.propDecorators={isDisabled:[{type:t.Input}],isOpen:[{type:t.Input}],isOpenChange:[{type:t.Output}]},e}(),Mt=function(){function e(){this.closeOthers=!0,this.transition="fade",this.transitionDuration=350,this.panels=[]}return e.prototype.addPanel=function(e){e.service=this,this.panels.push(e)},e.prototype.closeOtherPanels=function(e){this.closeOthers&&this.panels.forEach(function(t){t!==e&&(t.isOpen=!1)})},e}(),Tt=function(){function e(){this._service=new Mt,this.accordionClasses=!0}return Object.defineProperty(e.prototype,"closeOthers",{get:function(){return this._service.closeOthers},set:function(e){this._service.closeOthers=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{set:function(e){this._service.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{set:function(e){this._service.transitionDuration=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.updatePanels(),this._panels.changes.subscribe(function(){return e.updatePanels()})},e.prototype.updatePanels=function(){var e=this;this._panels.forEach(function(t){return e._service.addPanel(t)})},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion",template:"\n\n",styles:["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={accordionClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.accordion"]}],closeOthers:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],_panels:[{type:t.ContentChildren,args:[St]}]},e}(),kt=function(){function e(e,t){this._element=e,this._renderer=t,this._pristine=!0,this.collapseDuration=350,this._isExpanded=!1,this._isCollapsing=!1}return Object.defineProperty(e.prototype,"_isCollapsed",{get:function(){return!this._isExpanded&&!this._isCollapsing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suiCollapse",{get:function(){return this._isExpanded},set:function(e){e?this.hide():this.show()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_animationDuration",{get:function(){return this._pristine?0:this.collapseDuration},enumerable:!0,configurable:!0}),e.prototype.hide=function(){var e=this;this._isCollapsing=!0,this._isExpanded=!1,this._renderer.setStyle(this._element.nativeElement,"overflow","hidden"),this.animate(this._element.nativeElement.scrollHeight,0,!1,function(){e._isCollapsing=!1})},e.prototype.show=function(){var e=this;this._isCollapsing=!0,this.animate(this._element.nativeElement.offsetHeight,this._element.nativeElement.scrollHeight,!0,function(){e._renderer.removeStyle(e._element.nativeElement,"overflow"),e._isCollapsing=!1,e._isExpanded=!0})},e.prototype.animate=function(e,t,n,i){void 0===n&&(n=!1),void 0===i&&(i=function(){});var r=[{offset:0,height:e+"px"},{offset:1,height:t+"px"}];n&&r.push({offset:1,height:"auto"}),this._element.nativeElement.animate(r,{delay:0,duration:this._animationDuration,iterations:1,easing:"ease",fill:"both"}),this._pristine&&(this._pristine=!1),setTimeout(function(){return i()},this.collapseDuration)},e.decorators=[{type:t.Directive,args:[{selector:"[suiCollapse]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e.propDecorators={_isExpanded:[{type:t.HostBinding,args:["class.expanded"]}],_isCollapsed:[{type:t.HostBinding,args:["class.collapsed"]}],_isCollapsing:[{type:t.HostBinding,args:["class.collapsing"]}],suiCollapse:[{type:t.Input}],collapseDuration:[{type:t.Input}]},e}(),Pt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[kt],exports:[kt]}]}],e.ctorParameters=function(){return[]},e}(),xt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Pt,wt],declarations:[Tt,St],exports:[Tt,St],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),It=function(){function e(e){this._host=e,this.onValidatorChange=function(){}}return e.prototype.validate=function(e){return this._host.validate(e)},e.prototype.registerOnValidatorChange=function(e){this.onValidatorChange=e},e}(),Et=function(){function e(e){this._host=e,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){this._host.writeValue(e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e}();!function(e){e[e.Left=37]="Left",e[e.Up=38]="Up",e[e.Right=39]="Right",e[e.Down=40]="Down",e[e.Escape=27]="Escape",e[e.Enter=13]="Enter",e[e.Space=32]="Space",e[e.Backspace=8]="Backspace"}(e.KeyCode||(e.KeyCode={}));var Lt=function(){function e(){}return e}(),jt={Array:{range:function(e,t){return void 0===t&&(t=0),Array(e).fill(0).map(function(e,n){return n+t})},group:function(e,t){for(var n=e.slice(0),i=[];n.length>0;)i.push(n.splice(0,t));return i},groupBy:function(e,t){return e.reduce(function(e,n){var i=n[t].toString();return e[i]=e[i]||[],e[i].push(n),e},Object())},flatten:function(e){return e.reduce(function(e,t){return e.concat(t)},[])}},String:{padLeft:function(e,t,n){for(var i=e;i.length=0){Ft=1;break}var Bt=Rt&&window.Promise,Nt=Bt?u:l,Ut={},zt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";if(e=e.toString(),Ut.hasOwnProperty(e))return Ut[e];switch(e){case"11":Ut[e]=-1!==navigator.userAgent.indexOf("Trident");break;case"10":Ut[e]=-1!==navigator.appVersion.indexOf("MSIE 10");break;case"all":Ut[e]=-1!==navigator.userAgent.indexOf("Trident")||-1!==navigator.userAgent.indexOf("MSIE")}return Ut.all=Ut.all||Object.keys(Ut).some(function(e){return Ut[e]}),Ut[e]},Wt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},qt=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Wt(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=Nt(this.update.bind(this)),this.options=$t({},e.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys($t({},e.Defaults.modifiers,r.modifiers)).forEach(function(t){i.options.modifiers[t]=$t({},e.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return $t({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&p(e.onLoad)&&e.onLoad(i.reference,i.popper,i.options,e,i.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return qt(e,[{key:"update",value:function(){return Y.call(this)}},{key:"destroy",value:function(){return U.call(this)}},{key:"enableEventListeners",value:function(){return K.call(this)}},{key:"disableEventListeners",value:function(){return Q.call(this)}}]),e}();en.Utils=("undefined"!=typeof window?window:global).PopperUtils,en.placements=Qt,en.Defaults=Xt;var tn={Auto:"auto",TopLeft:"top left",Top:"top",TopRight:"top right",LeftTop:"left top",Left:"left",LeftBottom:"left bottom",BottomLeft:"bottom left",Bottom:"bottom",BottomRight:"bottom right",RightTop:"right top",Right:"right",RightBottom:"right bottom"},nn=function(){function e(e,t,n,i){var r=this;this.anchor=e,this.subject=t,this._placement=n;var o={computeStyle:{gpuAcceleration:!1},preventOverflow:{escapeWithReference:!0,boundariesElement:document.body},arrow:{element:i}};i||delete o.arrow,this._popper=new en(e.nativeElement,t.nativeElement,{placement:me(n),modifiers:o,onCreate:function(e){return r._popperState=e},onUpdate:function(e){return r._popperState=e}})}return Object.defineProperty(e.prototype,"placement",{get:function(){return this._placement},set:function(e){this._placement=e,this._popper.options.placement=me(e),this.update()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"actualPlacement",{get:function(){return this._popperState?ge(this._popperState.placement):tn.Auto},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._popperState},enumerable:!0,configurable:!0}),e.prototype.update=function(){this._popper.update()},e.prototype.destroy=function(){this._popper.destroy()},e}(),rn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],providers:[Ht]}]}],e.ctorParameters=function(){return[]},e}(),on=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),sn=function(){function e(){this.isChecked=!1,this.onCheckChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._checkboxClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.toggle(),this.focusCheckbox())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.toggle=function(){this.isChecked=!this.isChecked,this.onCheckChange.emit(this.isChecked)},e.prototype.writeValue=function(e){this.isChecked=e},e.prototype.focusCheckbox=function(){this._checkboxElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-checkbox",exportAs:"suiCheckbox",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_checkboxClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCheckChange:[{type:t.Output,args:["checkChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_checkboxElement:[{type:t.ViewChild,args:["checkbox"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),an=function(e){function n(t){return e.call(this,t)||this}return on(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-checkbox",host:{"(checkChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:sn}]},n}(Et),cn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),un=function(){function e(){this._radioClasses=!0,this.isChecked=!1,this.onCurrentValueChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._radioClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.currentValue=this.value,this.onCurrentValueChange.emit(this.currentValue),this.update(),this.focusRadio())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.update=function(){this.isChecked=this.currentValue===this.value},e.prototype.writeValue=function(e){this.currentValue=e,this.update()},e.prototype.focusRadio=function(){this._radioElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-radio-button",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_radioClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.radio"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],value:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCurrentValueChange:[{type:t.Output,args:["currentValueChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_radioElement:[{type:t.ViewChild,args:["radio"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),ln=function(e){function n(t){return e.call(this,t)||this}return cn(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-radio-button",host:{"(currentValueChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:un}]},n}(Et),pn=function(){function e(e){this.element=e,this.isNested=!1,this._radioSubs=[]}return e.prototype.ngAfterContentInit=function(){var e=this;this.updateNesting(),this._subManagers.changes.subscribe(function(){return e.updateNesting()}),this.updateRadios(),this._renderedRadios.changes.subscribe(function(){return e.updateRadios()})},e.prototype.updateNesting=function(){var e=this;this._subManagers.filter(function(t){return t!==e}).forEach(function(e){return e.isNested=!0})},e.prototype.updateRadios=function(){var e=this;this._radioSubs.forEach(function(e){return e.unsubscribe()}),this._radioSubs=[];var t=jt.Array.groupBy(this._renderedRadios.toArray(),"name");Object.keys(t).map(function(e){return t[e]}).forEach(function(t){return t.forEach(function(n){return e._radioSubs.push(n.onCurrentValueChange.subscribe(function(n){e.isNested||t.forEach(function(e){return e.writeValue(n)})}))})})},e.decorators=[{type:t.Directive,args:[{selector:"form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={_subManagers:[{type:t.ContentChildren,args:[e,{descendants:!0}]}],_renderedRadios:[{type:t.ContentChildren,args:[un,{descendants:!0}]}]},e}(),hn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule],declarations:[sn,an,un,ln,pn],exports:[sn,an,un,ln,pn]}]}],e.ctorParameters=function(){return[]},e}();!function(e){e[e.DateOnly=0]="DateOnly",e[e.TimeOnly=1]="TimeOnly",e[e.Both=2]="Both"}(e.CalendarMode||(e.CalendarMode={}));var dn=function(){function e(e,n){this.localeValues=n,this.onManualUpdate=function(){},this.config=e,this.currentDate=new Date,this.firstDayOfWeek=this.localeValues.firstDayOfWeek,this.onDateChange=new t.EventEmitter,this.reset()}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},set:function(e){this._config=e,e.updateBounds(this._selectedDate||this.currentDate)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inFinalView",{get:function(){return this.currentView===this.config.mappings.finalView},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){e?(this._selectedDate=Vt.clone(e),this.currentDate=Vt.clone(e)):this._selectedDate=void 0,this.config.updateBounds(this._selectedDate||this.currentDate),this.onManualUpdate()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){ +return this._minDate&&this.config.dateMinBound?this._minDate>this.config.dateMinBound?this._minDate:this.config.dateMinBound:this._minDate||this.config.dateMinBound},set:function(e){this._minDate=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate&&this.config.dateMaxBound?this._maxDate=this.ranges.current.inRange.length&&(i=!0),!o){var s=this.ranges.current.findIndex(this._highlightedItem),a=this.ranges.calc(i).inRange;if(i?s-=this.ranges.current.inRange.length:s+=a.length,o=a[s+r],o.isDisabled)return}this.ranges.move(i),this._highlightedItem=this.ranges.current.find(o)}},n.prototype.ngOnDestroy=function(){this._documentKeyDownListener()},n.propDecorators={_renderedItems:[{type:t.ViewChildren,args:[mn]}],service:[{type:t.Input}]},n}(),yn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vn=function(){function e(){}return e}(),bn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Date,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Date]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month]]),n}return yn(n,t),n}(vn),wn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Hour,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),_n=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Hour],[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month],[e.CalendarViewType.Hour,e.CalendarViewType.Date],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),Dn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Month,n.finalView=e.CalendarViewType.Month,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Month]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),Cn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Year,n.finalView=e.CalendarViewType.Year,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),On=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sn=function(){function t(e,t,n,i){this.mode=e,this.precision=t,this.mappings=n,this.fallback=i}return t.prototype.updateBounds=function(t){this.dateMinBound=Vt.startOf(e.DatePrecision.Year,new Date,!0),this.dateMinBound.setFullYear(0)},t}(),Mn=function(t){function n(n,i,r){return t.call(this,e.CalendarMode.DateOnly,n,i,r)||this}return On(n,t),n}(Sn),Tn=function(t){function n(){return t.call(this,e.DatePrecision.Year,new Cn,"number")||this}return On(n,t),n}(Mn),kn=function(t){function n(){return t.call(this,e.DatePrecision.Month,new Dn,"month")||this}return On(n,t),n}(Mn),Pn=function(t){function n(){return t.call(this,e.DatePrecision.Date,new bn,"date")||this}return On(n,t),n}(Mn),xn=function(t){function n(){return t.call(this,e.CalendarMode.Both,e.DatePrecision.Minute,new _n,"datetime-local")||this}return On(n,t),n}(Sn),In=function(t){function n(){return t.call(this,e.CalendarMode.TimeOnly,e.DatePrecision.Minute,new wn,"time")||this}return On(n,t),n.prototype.updateBounds=function(t){this.dateMaxBound=Vt.endOf(e.DatePrecision.Date,Vt.clone(t)),this.dateMinBound=Vt.previous(e.DatePrecision.Date,Vt.clone(this.dateMaxBound))},n}(Sn),En=function(){function t(e,t){this._precision=e,this._isSmallest=t}return t.prototype.equal=function(t,n){return this._precision===e.DatePrecision.Minute?!!n&&Vt.equal(e.DatePrecision.Hour,n,t)&&jt.Math.roundDown(n.getMinutes(),5)===jt.Math.roundDown(t.getMinutes(),5):!!n&&Vt.equal(this._precision,t,n)},t.prototype.lessThan=function(e,t){return this._isSmallest?!t||t>=e:!t||Vt.endOf(this._precision,Vt.clone(t))>=e},t.prototype.greaterThan=function(e,t){return this._isSmallest?!t||t<=e:!t||Vt.startOf(this._precision,Vt.clone(t))<=e},t.prototype.between=function(e,t,n){return this.greaterThan(e,t)&&this.lessThan(e,n)},t}(),Ln=36e5,jn=6e4,Vn=2,Hn={dateTimeDelimeter:/[T ]/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-])(\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/},Rn=6e4,An={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Fn=/MMMM|MM|DD|dddd/g,Yn=function(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||Pe(e.L),ll:e.ll||Pe(e.LL),lll:e.lll||Pe(e.LLL),llll:e.llll||Pe(e.LLLL)};return function(e){return t[e]}}({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"}),Bn={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"},Nn={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Un={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},zn={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},Wn={ordinalNumber:Le,weekday:Ie(Nn,"long"),weekdays:Ee(Nn,"long"),month:Ie(Un,"long"),months:Ee(Un,"long"),timeOfDay:Ie(zn,"long",function(e){return e/12>=1?1:0}),timesOfDay:Ee(zn,"long")},qn=/^(\d+)(th|st|nd|rd)?/i,Kn={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},$n={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Qn={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Gn={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Jn={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},Zn={any:[/^a/i,/^p/i]},Xn={ordinalNumbers:function(e){return function(t){return String(t).match(e)}}(qn),ordinalNumber:He,weekdays:je(Kn,"long"),weekday:Ve($n,"any"),months:je(Qn,"long"),month:Ve(Gn,"any"),timesOfDay:je(Jn,"long"),timeOfDay:Ve(Zn,"any")},ei={formatDistance:ke,formatLong:Yn,formatRelative:xe,localize:Wn,match:Xn,options:{weekStartsOn:0,firstWeekContainsDate:1}},ti=864e5,ni=6048e5,ii={M:function(e){return e.getUTCMonth()+1},Mo:function(e,t){var n=e.getUTCMonth()+1;return t.locale.localize.ordinalNumber(n,{unit:"month"})},MM:function(e){return Ue(e.getUTCMonth()+1,2)},MMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"short"})},MMMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"long"})},Q:function(e){return Math.ceil((e.getUTCMonth()+1)/3)},Qo:function(e,t){var n=Math.ceil((e.getUTCMonth()+1)/3);return t.locale.localize.ordinalNumber(n,{unit:"quarter"})},D:function(e){return e.getUTCDate()},Do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDate(),{unit:"dayOfMonth"})},DD:function(e){return Ue(e.getUTCDate(),2)},DDD:function(e){return Re(e)},DDDo:function(e,t){return t.locale.localize.ordinalNumber(Re(e),{unit:"dayOfYear"})},DDDD:function(e){return Ue(Re(e),3)},dd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"narrow"})},ddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"short"})},dddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"long"})},d:function(e){return e.getUTCDay()},do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDay(),{unit:"dayOfWeek"})},E:function(e){return e.getUTCDay()||7},W:function(e){return Be(e)},Wo:function(e,t){return t.locale.localize.ordinalNumber(Be(e),{unit:"isoWeek"})},WW:function(e){return Ue(Be(e),2)},YY:function(e){return Ue(e.getUTCFullYear(),4).substr(2)},YYYY:function(e){return Ue(e.getUTCFullYear(),4)},GG:function(e){return String(Fe(e)).substr(2)},GGGG:function(e){return Fe(e)},H:function(e){return e.getUTCHours()},HH:function(e){return Ue(e.getUTCHours(),2)},h:function(e){var t=e.getUTCHours();return 0===t?12:t>12?t%12:t},hh:function(e){return Ue(ii.h(e),2)},m:function(e){return e.getUTCMinutes()},mm:function(e){return Ue(e.getUTCMinutes(),2)},s:function(e){return e.getUTCSeconds()},ss:function(e){return Ue(e.getUTCSeconds(),2)},S:function(e){return Math.floor(e.getUTCMilliseconds()/100)},SS:function(e){return Ue(Math.floor(e.getUTCMilliseconds()/10),2)},SSS:function(e){return Ue(e.getUTCMilliseconds(),3)},Z:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset(),":")},ZZ:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset())},X:function(e,t){var n=t._originalDate||e;return Math.floor(n.getTime()/1e3)},x:function(e,t){return(t._originalDate||e).getTime()},A:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"uppercase"})},a:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"lowercase"})},aa:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"long"})}},ri=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,oi=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,si={M:/^(1[0-2]|0?\d)/,D:/^(3[0-1]|[0-2]?\d)/,DDD:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,W:/^(5[0-3]|[0-4]?\d)/,YYYY:/^(\d{1,4})/,H:/^(2[0-3]|[0-1]?\d)/,m:/^([0-5]?\d)/,Z:/^([+-])(\d{2}):(\d{2})/,ZZ:/^([+-])(\d{2})(\d{2})/,singleDigit:/^(\d)/,twoDigits:/^(\d{2})/,threeDigits:/^(\d{3})/,fourDigits:/^(\d{4})/,anyDigits:/^(\d+)/},ai={YY:{unit:"twoDigitYear",match:si.twoDigits,parse:function(e){return $e(e)}},YYYY:{unit:"year",match:si.YYYY,parse:$e},GG:{unit:"isoYear",match:si.twoDigits,parse:function(e){return $e(e)+1900}},GGGG:{unit:"isoYear",match:si.YYYY,parse:$e},Q:{unit:"quarter",match:si.singleDigit,parse:$e},Qo:{unit:"quarter",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"quarter"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"quarter"})}},M:{unit:"month",match:si.M,parse:function(e){return $e(e)-1}},Mo:{unit:"month",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"month"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"month"})-1}},MM:{unit:"month",match:si.twoDigits,parse:function(e){return $e(e)-1}},MMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"short"})},parse:function(e,t){return t.locale.match.month(e,{type:"short"})}},MMMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"long"})||t.locale.match.months(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.month(e,{type:"long"});return null==n&&(n=t.locale.match.month(e,{type:"short"})),n}},W:{unit:"isoWeek",match:si.W,parse:$e},Wo:{unit:"isoWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"isoWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"isoWeek"})}},WW:{unit:"isoWeek",match:si.twoDigits,parse:$e},d:{unit:"dayOfWeek",match:si.singleDigit,parse:$e},do:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfWeek"})}},dd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){return t.locale.match.weekday(e,{type:"narrow"})}},ddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"short"});return null==n&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},dddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"long"})||t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"long"});return null==n&&null==(n=t.locale.match.weekday(e,{type:"short"}))&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},E:{unit:"dayOfISOWeek",match:si.singleDigit,parse:function(e){return $e(e)}},D:{unit:"dayOfMonth",match:si.D,parse:$e},Do:{unit:"dayOfMonth",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfMonth"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfMonth"})}},DD:{unit:"dayOfMonth",match:si.twoDigits,parse:$e},DDD:{unit:"dayOfYear",match:si.DDD,parse:$e},DDDo:{unit:"dayOfYear",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfYear"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfYear"})}},DDDD:{unit:"dayOfYear",match:si.threeDigits,parse:$e},A:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){return t.locale.match.timeOfDay(e,{type:"short"})}},aa:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"long"})||t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.timeOfDay(e,{type:"long"});return null==n&&(n=t.locale.match.timeOfDay(e,{type:"short"})),n}},H:{unit:"hours",match:si.H,parse:$e},HH:{unit:"hours",match:si.twoDigits,parse:$e},h:{unit:"timeOfDayHours",match:si.M,parse:$e},hh:{unit:"timeOfDayHours",match:si.twoDigits,parse:$e},m:{unit:"minutes",match:si.m,parse:$e},mm:{unit:"minutes",match:si.twoDigits,parse:$e},s:{unit:"seconds",match:si.m,parse:$e},ss:{unit:"seconds",match:si.twoDigits,parse:$e},S:{unit:"milliseconds",match:si.singleDigit,parse:function(e){return 100*$e(e)}},SS:{unit:"milliseconds",match:si.twoDigits,parse:function(e){return 10*$e(e)}},SSS:{unit:"milliseconds",match:si.threeDigits,parse:$e},Z:{unit:"timezone",match:si.Z,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},ZZ:{unit:"timezone",match:si.ZZ,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},X:{unit:"timestamp",match:si.anyDigits,parse:function(e){return 1e3*$e(e)}},x:{unit:"timestamp",match:si.anyDigits,parse:$e}};ai.a=ai.A;var ci=864e5,ui={twoDigitYear:{priority:10,set:function(e,t){var n=Math.floor(e.date.getUTCFullYear()/100),i=100*n+t;return e.date.setUTCFullYear(i,0,1),e.date.setUTCHours(0,0,0,0),e}},year:{priority:10,set:function(e,t){return e.date.setUTCFullYear(t,0,1),e.date.setUTCHours(0,0,0,0),e}},isoYear:{priority:10,set:function(e,t,n){return e.date=Ye(Ze(e.date,t,n),n),e}},quarter:{priority:20,set:function(e,t){return e.date.setUTCMonth(3*(t-1),1),e.date.setUTCHours(0,0,0,0),e}},month:{priority:30,set:function(e,t){return e.date.setUTCMonth(t,1),e.date.setUTCHours(0,0,0,0),e}},isoWeek:{priority:40,set:function(e,t,n){return e.date=Ae(Je(e.date,t,n),n),e}},dayOfWeek:{priority:50,set:function(e,t,n){return e.date=Qe(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfISOWeek:{priority:50,set:function(e,t,n){return e.date=Ge(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfMonth:{priority:50,set:function(e,t){return e.date.setUTCDate(t),e.date.setUTCHours(0,0,0,0),e}},dayOfYear:{priority:50,set:function(e,t){return e.date.setUTCMonth(0,t),e.date.setUTCHours(0,0,0,0),e}},timeOfDay:{priority:60,set:function(e,t,n){return e.timeOfDay=t,e}},hours:{priority:70,set:function(e,t,n){return e.date.setUTCHours(t,0,0,0),e}},timeOfDayHours:{priority:70,set:function(e,t,n){var i=e.timeOfDay;return null!=i&&(t=Xe(t,i)),e.date.setUTCHours(t,0,0,0),e}},minutes:{priority:80,set:function(e,t){return e.date.setUTCMinutes(t,0,0),e}},seconds:{priority:90,set:function(e,t){return e.date.setUTCSeconds(t,0),e}},milliseconds:{priority:100,set:function(e,t){return e.date.setUTCMilliseconds(t),e}},timezone:{priority:110,set:function(e,t){return e.date=new Date(e.date.getTime()-6e4*t),e}},timestamp:{priority:120,set:function(e,t){return e.date=new Date(t),e}}},li=110,pi=6e4,hi=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,di=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,fi="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},mi=it(function(e,t){function n(e,t,n){n=n||{};var r;return r="string"==typeof i[e]?i[e]:1===t?i[e].one:i[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};e.exports=t.default}),gi=it(function(e,t){function n(e){return e.replace(r,function(e){return e.slice(1)})}function i(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||n(e.L),ll:e.ll||n(e.LL),lll:e.lll||n(e.LLL),llll:e.llll||n(e.LLLL)};return function(e){return t[e]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=/MMMM|MM|DD|dddd/g;e.exports=t.default}),yi=it(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=gi,i=function(e){return e&&e.__esModule?e:{default:e}}(n),r=(0,i.default)({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"});t.default=r,e.exports=t.default}),vi=it(function(e,t){function n(e,t,n,r){return i[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"};e.exports=t.default}),bi=it(function(e,t){function n(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),wi=it(function(e,t){function n(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),_i=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}Object.defineProperty(t,"__esModule",{value:!0});var r=bi,o=n(r),s=wi,a=n(s),c={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},l={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},p={ordinalNumber:i,weekday:(0,o.default)(c,"long"),weekdays:(0,a.default)(c,"long"),month:(0,o.default)(u,"long"),months:(0,a.default)(u,"long"),timeOfDay:(0,o.default)(l,"long",function(e){return e/12>=1?1:0}),timesOfDay:(0,a.default)(l,"long")};t.default=p,e.exports=t.default}),Di=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Ci=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Oi=it(function(e,t){function n(e){return function(t){return String(t).match(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Si=it(function(e,t){function n(e){return parseInt(e[1],10)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Mi=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Di,r=n(i),o=Ci,s=n(o),a=Oi,c=n(a),u=Si,l=n(u),p=/^(\d+)(th|st|nd|rd)?/i,h={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},d={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},f={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},m={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},g={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},y={any:[/^a/i,/^p/i]},v={ordinalNumbers:(0,c.default)(p),ordinalNumber:l.default,weekdays:(0,r.default)(h,"long"),weekday:(0,s.default)(d,"any"),months:(0,r.default)(f,"long"),month:(0,s.default)(m,"any"),timesOfDay:(0,r.default)(g,"long"),timeOfDay:(0,s.default)(y,"any")};t.default=v,e.exports=t.default}),Ti=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=mi,r=n(i),o=yi,s=n(o),a=vi,c=n(a),u=_i,l=n(u),p=Mi,h=n(p),d={formatDistance:r.default,formatLong:s.default,formatRelative:c.default,localize:l.default,match:h.default,options:{weekStartsOn:0,firstWeekContainsDate:1}};t.default=d,e.exports=t.default}),ki=function(e){return e&&e.__esModule?e.default:e}(Ti),Pi=Object.freeze({default:ki,__moduleExports:Ti}),xi=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=1?1:0}),timesOfDay:ot(i,"long")}),this._locale.match=xi({},this._locale.match,{weekdays:st(t,"long"),weekday:at(t,"long"),months:st(n,"long"),month:at(n,"long"),timesOfDay:st(r,"long"),timeOfDay:at(r,"long")})}return Object.defineProperty(e.prototype,"_config",{get:function(){return{weekStartsOn:this._weekStartsOn,locale:this._locale}},enumerable:!0,configurable:!0}),e.prototype.format=function(e,t){return We(e,t,this._config)},e.prototype.parse=function(e,t,n){return et(e,t,n,this._config)},e}(),Ei=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Li=function(){function e(e,t){this._format=e,this._parser=new Ii(t)}return e.prototype.format=function(e){return this._parser.format(e,this._format)},e.prototype.parse=function(e,t){return void 0===t&&(t=new Date),this._parser.parse(e,this._format,t)},e}(),ji=function(e){function t(t,n){var i={time:"HH:mm",datetime:"YYYY-MM-DDTHH:mm",date:"YYYY-MM-DD",month:"YYYY-MM",year:"YYYY"};return e.call(this,i[t],n)||this}return Ei(t,e),t}(Li),Vi=function(){function e(e,t,n,i,r){this.start=e,this.dates=t,this.items=n,this.groupedItems=i,this._comparer=r}return Object.defineProperty(e.prototype,"inRange",{get:function(){return this.items.filter(function(e){return!e.isOutsideRange})},enumerable:!0,configurable:!0}),e.prototype.find=function(e){var t=this;return this.items.find(function(n){return t._comparer.equal(n.date,e.date)})},e.prototype.findIndex=function(e){var t=this +;return e?this.items.findIndex(function(n){return t._comparer.equal(n.date,e.date)}):-1},e.prototype.containsDate=function(e){var t=this;return!!this.inRange.find(function(n){return t._comparer.equal(n.date,e)})},e}(),Hi=function(){function e(e,t,n){this.interval=e,this.marginal=e+1,this.rows=t,this.columns=n}return Object.defineProperty(e.prototype,"dateComparer",{get:function(){return new En(this.marginal,this.service.inFinalView)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.rows*this.columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMoveNext",{get:function(){var e=this.next.inRange[0];return!e||!this.service.maxDate||e.date<=this.service.maxDate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMovePrevious",{get:function(){var e=this.previous.inRange.slice(-1).pop();return!e||!this.service.minDate||e.date>=this.service.minDate},enumerable:!0,configurable:!0}),e.prototype.loadService=function(e){this.service=e,this.refresh()},e.prototype.refresh=function(){this.current=this.calcRange(this.service.currentDate),this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate))),this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.move=function(e){return e?this.moveNext():this.movePrevious()},e.prototype.moveNext=function(){Vt.next(this.interval,this.service.currentDate),this.previous=this.current,this.current=this.next,this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.movePrevious=function(){Vt.previous(this.interval,this.service.currentDate),this.next=this.current,this.current=this.previous,this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.calc=function(e){return e?this.next:this.previous},e.prototype.calcRange=function(e){var t=this.calcStart(e);this.service.inFinalView&&Vt.startOf(this.marginal,t,!0);var n=this.calcDates(t),i=this.calcItems(n,e);return new Vi(t,n,i,jt.Array.group(i,this.columns),this.dateComparer)},e.prototype.calcStart=function(e){return Vt.startOf(this.interval,Vt.clone(e))},e.prototype.calcDates=function(e){var t=this;return jt.Array.range(this.length).map(function(n){return Vt.add(t.marginal,Vt.clone(e),n)})},e.prototype.calcItems=function(e,t){var n=this;return e.map(function(e){var i=new fn(e);return i.isDisabled=!n.dateComparer.between(i.date,n.service.minDate,n.service.maxDate),i.isActive=n.dateComparer.equal(i.date,n.service.selectedDate),i.isToday=n.dateComparer.equal(i.date,new Date),i.isSelectable=i.isDisabled,n.configureItem(i,t),i})},e}(),Ri=function(){function e(){this.onZoomOut=new t.EventEmitter}return e.decorators=[{type:t.Component,args:[{selector:"sui-calendar-view-title",template:'\n\n \n\n\n \n\n\n \n\n',styles:["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={ranges:[{type:t.Input}],onZoomOut:[{type:t.Output,args:["zoomOut"]}]},e}(),Ai={Year:"year",Month:"month",Date:"date",Datetime:"datetime",Time:"time"},Fi=function(){function e(e){this.service=new dn(new xn,e.get().datepicker),this._calendarClasses=!0}return e.prototype.onMouseDown=function(e){e.preventDefault()},e.decorators=[{type:t.Component,args:[{selector:"sui-datepicker",template:'\n\n \n \n \n \n \n\n',styles:["\n:host {\n user-select: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:mt}]},e.propDecorators={_calendarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.active"]},{type:t.HostBinding,args:["class.calendar"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}]},e}(),Yi={Hover:"hover",Click:"click",OutsideClick:"outsideClick",Focus:"focus",Manual:"manual"},Bi=function(){function e(e){void 0===e&&(e={}),this.placement=tn.TopLeft,this.trigger=Yi.Hover,this.isInverted=!1,this.delay=0,this.isBasic=!1,this.transition="scale",this.transitionDuration=200,Object.assign(this,e)}return e}(),Ni=function(){function n(e){this.elementRef=e,this.transitionController=new vt(!1),this._isOpen=!1,this.onOpen=new t.EventEmitter,this.onClose=new t.EventEmitter,this._tabindex=0}return Object.defineProperty(n.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"anchor",{set:function(e){this.positioningService=new nn(e,this._container.element,this.config.placement,".dynamic.arrow")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"direction",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"alignment",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").pop()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dynamicClasses",{get:function(){var e={};return this.direction&&(e[this.direction]=!0),this.alignment&&(e[this.alignment]=!0),this.config.isInverted&&(e.inverted=!0),this.config.isBasic&&(e.basic=!0),e},enumerable:!0,configurable:!0}),n.prototype.open=function(){var t=this;this.isOpen||(clearTimeout(this.closingTimeout),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.In,function(){var e=t.elementRef.nativeElement.querySelector("[autofocus]");e&&(setTimeout(function(){return e.focus()},10),setTimeout(function(){return e.focus()},t.config.transitionDuration))})),this.positioningService.placement=this.config.placement,setTimeout(function(){return t.positioningService.update()}),this._isOpen=!0,this.onOpen.emit())},n.prototype.toggle=function(){return this.isOpen?this.close():this.open()},n.prototype.close=function(){var t=this;this.isOpen&&(this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.Out)),clearTimeout(this.closingTimeout),this.closingTimeout=window.setTimeout(function(){return t.onClose.emit()},this.config.transitionDuration),this._isOpen=!1)},n.prototype.onClick=function(e){e.stopPropagation()},n.decorators=[{type:t.Component,args:[{selector:"sui-popup",template:'\n\n',styles:['\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor\'s mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed \'vertically\'. */\n.ui.popup[direction="top"],\n.ui.popup[direction="bottom"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed \'horizontally\'. */\n.ui.popup[direction="left"],\n.ui.popup[direction="right"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n']}]}],n.ctorParameters=function(){return[{type:t.ElementRef}]},n.propDecorators={_container:[{type:t.ViewChild,args:["container",{read:t.ViewContainerRef}]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],_tabindex:[{type:t.HostBinding,args:["attr.tabindex"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(),Ui=function(){function e(e,t,n,i){var r=this;this._element=t,this._componentFactory=n,this._componentRef=this._componentFactory.createComponent(Ni),this.popup.config=i,this.popup.onClose.subscribe(function(){return r.cleanup()}),this._documentListener=e.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"popup",{get:function(){return this._componentRef.instance},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){e&&Object.assign(this.popup.config,e)},e.prototype.openDelayed=function(){var e=this;clearTimeout(this._openingTimeout),this._openingTimeout=window.setTimeout(function(){return e.open()},this.popup.config.delay)},e.prototype.open=function(){this._componentFactory.attachToApplication(this._componentRef),this._componentFactory.moveToDocumentBody(this._componentRef),this.popup.anchor=this._element,this.popup.open();var e=this.popupOnOpen;e&&e.call(this)},e.prototype.close=function(){clearTimeout(this._openingTimeout),this._componentRef&&this.popup.close();var e=this.popupOnClose;e&&e.call(this)},e.prototype.toggleDelayed=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.openDelayed():this.close()},e.prototype.toggle=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.open():this.close()},e.prototype.onMouseEnter=function(){this.popup.config.trigger===Yi.Hover&&this.openDelayed()},e.prototype.onMouseLeave=function(){this.popup.config.trigger===Yi.Hover&&this.close()},e.prototype.onClick=function(){this.popup.config.trigger===Yi.Click||this.popup.config.trigger===Yi.OutsideClick?this.toggleDelayed():this.popup.config.trigger!==Yi.Focus||this._componentRef&&(!this._componentRef||this.popup.isOpen)||this.openDelayed()},e.prototype.onDocumentClick=function(e){if(this._componentRef&&this.popup.config.trigger===Yi.OutsideClick){var t=e.target;this._element.nativeElement.contains(t)||this.close()}},e.prototype.onFocusIn=function(){this.popup.config.trigger===Yi.Focus&&this.openDelayed()},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.popup.elementRef.nativeElement.contains(e.relatedTarget)||this.popup.config.trigger!==Yi.Focus||this.close()},e.prototype.cleanup=function(){clearTimeout(this._openingTimeout),this._componentRef.instance&&this._componentRef.instance.positioningService&&this._componentRef.instance.positioningService.destroy(),this._componentFactory.detachFromApplication(this._componentRef)},e.prototype.ngOnDestroy=function(){this.cleanup(),this._documentListener()},e.propDecorators={onMouseEnter:[{type:t.HostListener,args:["mouseenter"]}],onMouseLeave:[{type:t.HostListener,args:["mouseleave"]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wi=function(e){function t(t,n,i,r,o){var s=e.call(this,t,n,i,o)||this;return s._component=r,s}return zi(t,e),Object.defineProperty(t.prototype,"componentInstance",{get:function(){if(this._contentComponentRef)return this._contentComponentRef.instance},enumerable:!0,configurable:!0}),t.prototype.open=function(){this._contentComponentRef||(this._contentComponentRef=this._componentFactory.createComponent(this._component),this._componentFactory.attachToView(this._contentComponentRef,this.popup.templateSibling)),e.prototype.open.call(this)},t.prototype.cleanup=function(){e.prototype.cleanup.call(this),this._contentComponentRef&&(this._contentComponentRef.destroy(),this._contentComponentRef=void 0)},t}(Ui),qi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ki=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return qi(t,e),t}(Bi),$i=function(e){function t(t,n,i,r){return e.call(this,t,n,i,r)||this}return qi(t,e),t.prototype.configure=function(t){e.prototype.configure.call(this,t),t&&(this.template=t.template,this.context=t.context)},t.prototype.open=function(){this.template&&(this.popup.templateSibling.clear(),this._componentFactory.createView(this.popup.templateSibling,this.template,{$implicit:this.popup,context:this.context})),e.prototype.open.call(this)},t}(Ui),Qi=function(){function e(){}return Object.defineProperty(e.prototype,"direction",{get:function(){if(this.placement)return this.placement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){if(this.placement){var e=this.placement.split(" ").pop();return e===this.direction?"center":e}},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-popup-arrow",template:'\n
\n
\n',styles:['\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction="top"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction="left"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction="bottom"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction="right"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction="bottom"][alignment="left"],\n.static.arrow[direction="top"][alignment="left"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction="left"][alignment="top"],\n.static.arrow[direction="right"][alignment="top"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction="bottom"][alignment="right"],\n.static.arrow[direction="top"][alignment="right"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction="left"][alignment="bottom"],\n.static.arrow[direction="right"][alignment="bottom"] {\n top: auto;\n bottom: 1em;\n}\n']}]}],e.ctorParameters=function(){return[]},e.propDecorators={placement:[{type:t.Input}],inverted:[{type:t.HostBinding,args:["class.inverted"]},{type:t.Input}]},e}(),Gi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ji=function(e){function n(){return e.call(this)||this}return Gi(n,e),n.decorators=[{type:t.Injectable}],n.ctorParameters=function(){return[]},n}(Bi),Zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xi=function(e){function n(t,n,i,r){return e.call(this,t,n,i,new Bi(r))||this}return Zi(n,e),Object.defineProperty(n.prototype,"popupHeader",{set:function(e){this.popup.config.header=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupText",{set:function(e){this.popup.config.text=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupInverted",{set:function(e){this.popup.config.isInverted=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupBasic",{set:function(e){this.popup.config.isBasic=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupPlacement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupDelay",{set:function(e){this.popup.config.delay=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTrigger",{get:function(){return this.popup.config.trigger},set:function(e){this.popup.config.trigger=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplate",{set:function(e){this.template=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplateContext",{set:function(e){this.context=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupConfig",{set:function(e){this.configure(e)},enumerable:!0,configurable:!0}),n.decorators=[{type:t.Directive,args:[{selector:"[suiPopup]",exportAs:"suiPopup"}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:Ji}]},n.propDecorators={popupHeader:[{type:t.Input}],popupText:[{type:t.Input}],popupInverted:[{type:t.Input}],popupBasic:[{type:t.Input}],popupTransition:[{type:t.Input}],popupTransitionDuration:[{type:t.Input}],popupPlacement:[{type:t.Input}],popupDelay:[{type:t.Input}],popupTrigger:[{type:t.Input}],popupTemplate:[{type:t.Input}],popupTemplateContext:[{type:t.Input}],popupConfig:[{type:t.Input}]},n}($i),er=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt,rn],declarations:[Xi,Qi,Ni],exports:[Xi,Ni],providers:[Ji],entryComponents:[Ni]}]}],e.ctorParameters=function(){return[]},e}(),tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),nr=function(n){function i(e,i,r,o){var s=n.call(this,e,i,r,Fi,new Bi({trigger:Yi.Focus,placement:tn.BottomLeft,transition:"scale",transitionDuration:200}))||this;return s.renderer=e,s.localizationService=o,s.renderer.addClass(s.popup.elementRef.nativeElement,"ui"),s.renderer.addClass(s.popup.elementRef.nativeElement,"calendar"),s.onLocaleUpdate(),s.localizationService.onLanguageUpdate.subscribe(function(){return s.onLocaleUpdate()}),s.onSelectedDateChange=new t.EventEmitter,s.onValidatorChange=new t.EventEmitter,s.mode=Ai.Datetime,s}return tr(i,n),Object.defineProperty(i.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){this._selectedDate=e,this.onSelectedDateChange.emit(e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mode",{get:function(){return this._mode},set:function(e){switch(this._mode=e||Ai.Datetime,this._mode){case Ai.Year:this.config=new Tn;break;case Ai.Month:this.config=new kn;break;case Ai.Date:default:this.config=new Pn;break;case Ai.Datetime:this.config=new xn;break;case Ai.Time:this.config=new In}this.writeValue(this.selectedDate)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localeValues",{get:function(){return this.localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),i.prototype.popupOnOpen=function(){var e=this;this.componentInstance&&(this.componentInstance.service.config=this.config,this.componentInstance.service.localeValues=this.localeValues,this.componentInstance.service.currentDate=this.initialDate||new Date,this.componentInstance.service.selectedDate=this.selectedDate,this.componentInstance.service.maxDate=this.maxDate,this.componentInstance.service.minDate=this.minDate,void 0!=this.firstDayOfWeek&&(this.componentInstance.service.firstDayOfWeek=this.firstDayOfWeek),this.componentInstance.service.reset(),this.componentInstance.service.onDateChange.subscribe(function(t){e.selectedDate=t,e.close()}))},i.prototype.ngOnChanges=function(e){var t=e.maxDate,n=e.minDate,i=e.mode;(t||n||i)&&this.onValidatorChange.emit()},i.prototype.onLocaleUpdate=function(){this._localeValues=this.localizationService.get().datepicker},i.prototype.validate=function(e){var t=e.value;if(void 0!=t){if(this.minDate&&tthis.maxDate)return{suiMaxDate:{required:this.maxDate,actual:t}}}return null},i.prototype.writeValue=function(e){this.selectedDate=e,this.componentInstance&&(this.componentInstance.service.selectedDate=e)},i.prototype.onKeyDown=function(t){t.keyCode===e.KeyCode.Escape&&this.close()},i.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",providers:[a(i)]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:mt}]},i.propDecorators={mode:[{type:t.Input,args:["pickerMode"]}],initialDate:[{type:t.Input,args:["pickerInitialDate"]}],maxDate:[{type:t.Input,args:["pickerMaxDate"]}],minDate:[{type:t.Input,args:["pickerMinDate"]}],firstDayOfWeek:[{type:t.Input,args:["pickerFirstDayOfWeek"]}],localeOverrides:[{type:t.Input,args:["pickerLocaleOverrides"]}],placement:[{type:t.Input,args:["pickerPlacement"]}],transition:[{type:t.Input,args:["pickerTransition"]}],transitionDuration:[{type:t.Input,args:["pickerTransitionDuration"]}],onSelectedDateChange:[{type:t.Output,args:["pickerSelectedDateChange"]}],onValidatorChange:[{type:t.Output,args:["pickerValidatorChange"]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},i}(Wi),ir=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerSelectedDateChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(Et),rr=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerValidatorChange)":"onValidatorChange()"},providers:[a(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(It),or=it(function(e){!function(t,n,i){e.exports?e.exports=i():t.bowser=i()}(fi,0,function(){function e(e){function t(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}function n(t){var n=e.match(t);return n&&n.length>1&&n[2]||""}var i,r=t(/(ipod|iphone|ipad)/i).toLowerCase(),o=/like android/i.test(e),a=!o&&/android/i.test(e),c=/nexus\s*[0-6]\s*/i.test(e),u=!c&&/nexus\s*[0-9]+/i.test(e),l=/CrOS/.test(e),p=/silk/i.test(e),h=/sailfish/i.test(e),d=/tizen/i.test(e),f=/(web|hpw)os/i.test(e),m=/windows phone/i.test(e),g=(/SamsungBrowser/i.test(e),!m&&/windows/i.test(e)),y=!r&&!p&&/macintosh/i.test(e),v=!a&&!h&&!d&&!f&&/linux/i.test(e),b=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),w=t(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(e)&&!/tablet pc/i.test(e),D=!_&&/[^-]mobi/i.test(e),C=/xbox/i.test(e);/opera/i.test(e)?i={name:"Opera",opera:s,version:w||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?i={name:"Opera",opera:s,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||w}:/SamsungBrowser/i.test(e)?i={name:"Samsung Internet for Android",samsungBrowser:s,version:w||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?i={name:"Opera Coast",coast:s,version:w||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?i={name:"Yandex Browser",yandexbrowser:s,version:w||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?i={name:"UC Browser",ucbrowser:s,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?i={name:"Maxthon",maxthon:s,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?i={name:"Epiphany",epiphany:s,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?i={name:"Puffin",puffin:s,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?i={name:"Sleipnir",sleipnir:s,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?i={name:"K-Meleon",kMeleon:s,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:m?(i={name:"Windows Phone",osname:"Windows Phone",windowsphone:s},b?(i.msedge=s,i.version=b):(i.msie=s,i.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?i={name:"Internet Explorer",msie:s,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:l?i={name:"Chrome",osname:"Chrome OS",chromeos:s,chromeBook:s,chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(e)?i={name:"Microsoft Edge",msedge:s,version:b}:/vivaldi/i.test(e)?i={name:"Vivaldi",vivaldi:s,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||w}:h?i={name:"Sailfish",osname:"Sailfish OS",sailfish:s,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?i={name:"SeaMonkey",seamonkey:s,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(i={name:"Firefox",firefox:s,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(i.firefoxos=s,i.osname="Firefox OS")):p?i={name:"Amazon Silk",silk:s,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?i={name:"PhantomJS",phantom:s,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?i={name:"SlimerJS",slimer:s,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?i={name:"BlackBerry",osname:"BlackBerry OS",blackberry:s,version:w||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:f?(i={name:"WebOS",osname:"WebOS",webos:s,version:w||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(i.touchpad=s)):/bada/i.test(e)?i={name:"Bada",osname:"Bada",bada:s,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:d?i={name:"Tizen",osname:"Tizen",tizen:s,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||w}:/qupzilla/i.test(e)?i={name:"QupZilla",qupzilla:s,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||w}:/chromium/i.test(e)?i={name:"Chromium",chromium:s,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||w}:/chrome|crios|crmo/i.test(e)?i={name:"Chrome",chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:a?i={name:"Android",version:w}:/safari|applewebkit/i.test(e)?(i={name:"Safari",safari:s},w&&(i.version=w)):r?(i={name:"iphone"==r?"iPhone":"ipad"==r?"iPad":"iPod"},w&&(i.version=w)):i=/googlebot/i.test(e)?{name:"Googlebot",googlebot:s,version:t(/googlebot\/(\d+(\.\d+))/i)||w}:{name:t(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!i.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(i.name=i.name||"Blink",i.blink=s):(i.name=i.name||"Webkit",i.webkit=s),!i.version&&w&&(i.version=w)):!i.opera&&/gecko\//i.test(e)&&(i.name=i.name||"Gecko",i.gecko=s,i.version=i.version||t(/gecko\/(\d+(\.\d+)?)/i)),i.windowsphone||!a&&!i.silk?!i.windowsphone&&r?(i[r]=s,i.ios=s,i.osname="iOS"):y?(i.mac=s,i.osname="macOS"):C?(i.xbox=s,i.osname="Xbox"):g?(i.windows=s,i.osname="Windows"):v&&(i.linux=s,i.osname="Linux"):(i.android=s,i.osname="Android");var O="";i.windows?O=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)):i.windowsphone?O=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):i.mac?(O=t(/Mac OS X (\d+([_\.\s]\d+)*)/i),O=O.replace(/[_\s]/g,".")):r?(O=t(/os (\d+([_\s]\d+)*) like mac os x/i),O=O.replace(/[_\s]/g,".")):a?O=t(/android[ \/-](\d+(\.\d+)*)/i):i.webos?O=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):i.blackberry?O=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):i.bada?O=t(/bada\/(\d+(\.\d+)*)/i):i.tizen&&(O=t(/tizen[\/\s](\d+(\.\d+)*)/i)),O&&(i.osversion=O);var S=!i.windows&&O.split(".")[0];return _||u||"ipad"==r||a&&(3==S||S>=4&&!D)||i.silk?i.tablet=s:(D||"iphone"==r||"ipod"==r||a||c||i.blackberry||i.webos||i.bada)&&(i.mobile=s),i.msedge||i.msie&&i.version>=10||i.yandexbrowser&&i.version>=15||i.vivaldi&&i.version>=1||i.chrome&&i.version>=20||i.samsungBrowser&&i.version>=4||i.firefox&&i.version>=20||i.safari&&i.version>=6||i.opera&&i.version>=10||i.ios&&i.osversion&&i.osversion.split(".")[0]>=6||i.blackberry&&i.version>=10.1||i.chromium&&i.version>=20?i.a=s:i.msie&&i.version<10||i.chrome&&i.version<20||i.firefox&&i.version<20||i.safari&&i.version<6||i.opera&&i.version<10||i.ios&&i.osversion&&i.osversion.split(".")[0]<6||i.chromium&&i.version<20?i.c=s:i.x=s,i}function t(e){return e.split(".").length}function n(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n=0;){if(r[0][i]>r[1][i])return 1;if(r[0][i]!==r[1][i])return-1;if(0===i)return 0}}function r(t,n,r){var o=a;"string"==typeof n&&(r=n,n=void 0),void 0===n&&(n=!1),r&&(o=e(r));var s=""+o.version;for(var c in t)if(t.hasOwnProperty(c)&&o[c]){if("string"!=typeof t[c])throw new Error("Browser version in the minVersion map should be a string: "+c+": "+String(t));return i([s,t[c]])<0}return n}function o(e,t,n){return!r(e,t,n)}var s=!0,a=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return a.test=function(e){for(var t=0;t\n\n \n \n \n {{ date }}\n \n \n \n \n {{ day }}\n \n\n\n \n {{ item.humanReadable }}\n \n \n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),vr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),br=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vr(t,e),t.prototype.configureItem=function(e,t){var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");e.humanReadable=new Li(n,this.service.localeValues).format(e.date),e.isOutsideRange=!1},t}(Hi),wr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Hour,new br(e.DatePrecision.Date,6,4))||this}return vr(i,n),Object.defineProperty(i.prototype,"date",{get:function(){return new Li(this.service.localeValues.formats.date,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-hour-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),_r=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Dr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _r(n,t),n.prototype.calcStart=function(t){return Vt.startOf(e.DatePrecision.Hour,Vt.clone(t),!0)},n.prototype.calcDates=function(t){return jt.Array.range(this.length).map(function(n){return Vt.add(e.DatePrecision.Minute,Vt.clone(t),5*n)})},n.prototype.configureItem=function(e,t){e.humanReadable=new Li(this.service.localeValues.formats.time,this.service.localeValues).format(e.date),e.isOutsideRange=!1},n}(Hi),Cr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Minute,new Dr(e.DatePrecision.Hour,4,3))||this}return _r(i,n),Object.defineProperty(i.prototype,"date",{get:function(){if(this.service.config.mode!==e.CalendarMode.TimeOnly){var t=this.service.localeValues.formats.datetime.replace(/[ms]/g,"0");return new Li(t,this.service.localeValues).format(this.currentDate)}var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");return new Li(n,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-minute-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Or=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Or(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=this.service.localeValues.monthsShort[e.date.getMonth()],e.isOutsideRange=!1},t}(Hi),Mr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Month,new Sr(e.DatePrecision.Year,4,3))||this}return Or(i,n),Object.defineProperty(i.prototype,"year",{get:function(){return new Li(this.service.localeValues.formats.year,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-month-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Tr(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=jt.String.padLeft(e.date.getFullYear().toString(),4,"0"),e.isOutsideRange=e.date.getFullYear()>=this.calcStart(t).getFullYear()+10},t}(Hi),Pr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Year,new kr(e.DatePrecision.Decade,4,3))||this}return Tr(i,n),Object.defineProperty(i.prototype,"decadeStart",{get:function(){return Vt.startOf(e.DatePrecision.Decade,Vt.clone(this.service.currentDate)).getFullYear()},enumerable:!0,configurable:!0}),i.prototype.pad=function(e){return jt.String.padLeft(e.toString(),4,"0")},i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-year-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),xr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,er,gt,rn],declarations:[mn,Ri,Pr,Mr,yr,wr,Cr,Fi,nr,ir,rr,fr],exports:[nr,ir,rr,fr],entryComponents:[Fi]}]}],e.ctorParameters=function(){return[]},e}(),Ir=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Er=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o._isDimmed=!1,o.isDimmedChange=new t.EventEmitter,o.isClickable=!0,o.wrapContent=!0,o._dimmerClasses=!0,o}return Ir(i,n),Object.defineProperty(i.prototype,"isDimmed",{get:function(){return this._isDimmed},set:function(t){var n=!!t;this._transitionController?this._isDimmed!==n&&(this._isDimmed=n,this._transitionController.stopAll(),this._transitionController.animate(new yt("fade",this.transitionDuration,n?e.TransitionDirection.In:e.TransitionDirection.Out))):(this._transitionController=new vt(n,"block"),this.setTransitionController(this._transitionController),this._isDimmed=n)},enumerable:!0,configurable:!0}),i.prototype.onClick=function(){this.isClickable&&(this.isDimmed=!1,this.isDimmedChange.emit(this.isDimmed))},i.decorators=[{type:t.Component,args:[{selector:"sui-dimmer",template:'\n
\n
\n \n
\n
\n',styles:["\n:host.dimmer {\n transition: none;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},i.propDecorators={_dimmerClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dimmer"]}],isDimmed:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDimmedChange:[{type:t.Output}],isClickable:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],wrapContent:[{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},i}(bt),Lr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[Er],exports:[Er]}]}],e.ctorParameters=function(){return[]},e}(),jr={ItemClick:"itemClick",OutsideClick:"outsideClick",Disabled:"disabled"},Vr=function(){function e(e){void 0===e&&(e=jr.ItemClick),this.isOpen=!1,this.isOpenChange=new t.EventEmitter,this.isDisabled=!1,this.autoCloseMode=e,this.children=[]}return Object.defineProperty(e.prototype,"isNested",{get:function(){return!!this.parent},enumerable:!0,configurable:!0}),e.prototype.setOpenState=function(e,t){var n=this;void 0===t&&(t=!1),this.isOpen===e||this.isDisabled?this.isOpen!==e&&this.isDisabled&&this.delay(function(){return n.isOpenChange.emit(n.isOpen)}):(this.isOpen=!!e,this.isAnimating=!0,this.delay(function(){return n.isOpenChange.emit(n.isOpen)}),this.isOpen||this.children.forEach(function(e){return e.setOpenState(n.isOpen)}),this.parent&&t&&this.parent.setOpenState(this.isOpen,!0))},e.prototype.setDisabledState=function(e){this.isDisabled!==e&&(e&&this.setOpenState(!1),this.isDisabled=!!e)},e.prototype.toggleOpenState=function(){this.setOpenState(!this.isOpen)},e.prototype.registerChild=function(e){this.isChildRegistered(e)||(this.children.push(e),e.parent=this)},e.prototype.isChildRegistered=function(e){return this===e||!!this.children.find(function(t){return!!t.children.find(function(t){return t.isChildRegistered(e)})})},e.prototype.clearChildren=function(){this.children.forEach(function(e){e.parent=void 0}),this.children=[]},e.prototype.delay=function(e){setTimeout(function(){return e()})},e}();!function(e){"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,n=(t.document||t.ownerDocument).querySelectorAll(e),i=0;n[i]&&n[i]!==t;)++i;return Boolean(n[i])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window.Element.prototype);var Hr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rr=function(){function e(e,t){this._renderer=e,this.element=t,this.isSelected=!1,this.selectedClass="selected"}return Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.element.nativeElement.classList.contains("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},set:function(e){e?this._renderer.addClass(this.element.nativeElement,this.selectedClass):this._renderer.removeClass(this.element.nativeElement,this.selectedClass)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasChildDropdown",{get:function(){return!!this.childDropdownMenu},enumerable:!0,configurable:!0}),e.prototype.performClick=function(){this.element.nativeElement.click()},e.decorators=[{type:t.Directive,args:[{selector:".item"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={childDropdownMenu:[{type:t.ContentChild,args:[t.forwardRef(function(){return Ar})]}]},e}(),Ar=function(n){function i(e,t,i){var r=n.call(this,e,t,i)||this;return r.element=t,r._transitionController=new vt(!1),r.setTransitionController(r._transitionController),r.menuTransition="slide down",r.menuTransitionDuration=200,r.menuAutoSelectFirst=!1,r.menuSelectedItemClass="selected",r._documentKeyDownListener=e.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),r}return Hr(i,n),Object.defineProperty(i.prototype,"service",{get:function(){return this._service},set:function(t){var n=this;this._service=t;var i=this._service.isOpen;this._service.isOpenChange.subscribe(function(t){t!==i&&(n._transitionController.stopAll(),n._transitionController.animate(new yt(n.menuTransition,n.menuTransitionDuration,e.TransitionDirection.Either,function(){return n._service.isAnimating=!1}))),t||n.selectedItems.length>1&&n.resetSelection(),i=t})},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"items",{set:function(e){this._itemsQueryOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_itemsQuery",{get:function(){return this._itemsQueryOverride||this._itemsQueryInternal},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_items",{get:function(){return this._itemsQuery.filter(function(e){return!e.isDisabled})},enumerable:!0,configurable:!0}),i.prototype.onClick=function(e){if(!e.eventHandled&&(e.eventHandled=!0,this._service.autoCloseMode===jr.ItemClick)){var t=e.target;this.element.nativeElement.contains(t.closest(".item"))&&!/input|textarea/i.test(t.tagName)&&this._service.setOpenState(!1,!0)}},i.prototype.onDocumentKeyDown=function(t){if(this._service.isOpen&&!this._service.isNested){!/input/i.test(t.target.tagName)&&[e.KeyCode.Escape,e.KeyCode.Enter,e.KeyCode.Up,e.KeyCode.Down,e.KeyCode.Left,e.KeyCode.Right].find(function(e){return e===t.keyCode})&&t.preventDefault();var n=this.selectedItems.slice(-1)[0],i=this;if(this.selectedItems.length>=2){var r=this.selectedItems.slice(-2)[0];i=r.childDropdownMenu}switch(t.keyCode){case e.KeyCode.Escape:this._service.setOpenState(!1);break;case e.KeyCode.Down:case e.KeyCode.Up:this.selectedItems.pop(),this.selectedItems.push(i.updateSelection(n,t.keyCode)),t.preventDefault();break;case e.KeyCode.Enter:if(n&&!n.hasChildDropdown){n.performClick();break}case e.KeyCode.Right:n&&n.hasChildDropdown&&(n.childDropdownMenu.service.setOpenState(!0),this.selectedItems.push(n.childDropdownMenu.updateSelection(n,t.keyCode)));break;case e.KeyCode.Left:if(this.selectedItems.length>=2){this.selectedItems.pop();var r=this.selectedItems.slice(-1)[0];r.childDropdownMenu.service.setOpenState(!1),r.isSelected=!0}}}},i.prototype.resetSelection=function(){var e=this;this.selectedItems=[],this._items.forEach(function(t){t.selectedClass=e.menuSelectedItemClass,t.isSelected=!1}),this.menuAutoSelectFirst&&this._items.length>0&&(this._items[0].isSelected=!0,this.scrollToItem(this._items[0]),this.selectedItems.push(this._itemsQuery.first))},i.prototype.updateSelection=function(t,n){t&&(t.isSelected=!1);var i,r=this._items.findIndex(function(e){return e===t});switch(n){case e.KeyCode.Enter:case e.KeyCode.Right:case e.KeyCode.Down:r+=1;break;case e.KeyCode.Up:if(-1===r){r=0;break}r-=1}return i=this._items[r]||t,i&&(i.isSelected=!0,this.scrollToItem(i)),i},i.prototype.scrollToItem=function(e){var t=this.element.nativeElement,n=e.element.nativeElement.getBoundingClientRect(),i=t.getBoundingClientRect(),r=0;n.bottom>i.bottom&&(r=n.bottom-i.bottom),n.top\n\n \x3c!-- Modal component, with transition component attached --\x3e\n \n\n',styles:["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"]}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht}]},n.propDecorators={isClosable:[{type:t.Input}],closeResult:[{type:t.Input}],onApprove:[{type:t.Output,args:["approved"]}],onDeny:[{type:t.Output,args:["denied"]}],onDismiss:[{type:t.Output,args:["dismissed"]}],_modalElement:[{type:t.ViewChild,args:["modal"]}],size:[{type:t.Input}],isFullScreen:[{type:t.Input}],isBasic:[{type:t.Input}],mustScroll:[{type:t.Input}],isInverted:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onDocumentKeyUp:[{type:t.HostListener,args:["document:keyup",["$event"]]}],onDocumentResize:[{type:t.HostListener,args:["window:resize"]}]},n}(),Xr=function(){function e(e){this._componentFactory=e}return e.prototype.open=function(e){var t=this._componentFactory.createComponent(Zr),n=t.instance;if(e instanceof Wr)this._componentFactory.createView(n.templateSibling,e.template,{$implicit:e.context,modal:t.instance.controls});else if(e instanceof qr){var i=this._componentFactory.createComponent(e.component,[{provide:Qr,useValue:new Qr(n.controls,e.context)}]);this._componentFactory.attachToView(i,n.templateSibling);for(var r=i.location.nativeElement;r.hasChildNodes()&&r.parentElement&&r.firstChild;)r.parentElement.appendChild(r.removeChild(r.firstChild));this._componentFactory.detachFromDocument(i)}return this._componentFactory.attachToApplication(t),n.loadConfig(e),new Br(e,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Ht}]},e}(),eo=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Lr,wt,rn],declarations:[Zr],exports:[Zr],providers:[Xr],entryComponents:[Zr]}]}],e.ctorParameters=function(){return[]},e}(),to=function(){function e(){this._popupClasses=!0,this.value=0,this.maximum=100,this.precision=0,this._overrideSuccess=!1,this.autoSuccess=!0,this.showProgress=!0,this._popupClasses=!0}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){var t=+e;Number.isNaN(t)||(this._value=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){var t=+e;Number.isNaN(t)||(this._maximum=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"precision",{get:function(){return this._precision},set:function(e){var t=+e;Number.isNaN(t)||(this._precision=Math.min(Math.max(t,0),20))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_reachedMaximum",{get:function(){return this._overrideSuccess||this.value>=this.maximum&&this.autoSuccess},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"percentage",{get:function(){return(Math.min(Math.max(this.value,0),this.maximum)/this.maximum*100).toFixed(this.precision)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classValue",{set:function(e){(e.includes("attached")||e.includes("tiny"))&&(this.showProgress=!1),e.includes("success")&&(this._overrideSuccess=!0)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-progress",template:'\n
\n
{{ percentage }}%
\n
\n
\n \n
\n',styles:["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_popupClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.progress"]}],autoSuccess:[{type:t.Input}],showProgress:[{type:t.Input}],value:[{type:t.Input}],maximum:[{type:t.Input}],precision:[{type:t.Input}],_reachedMaximum:[{type:t.HostBinding,args:["class.success"]}],percentage:[{type:t.HostBinding,args:["attr.data-percent"]}],classValue:[{type:t.Input,args:["class"]}]},e}(),no=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[to],exports:[to]}]}],e.ctorParameters=function(){return[]},e}(),io=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ro=function(){function e(){this.hoveredIndex=-1,this.value=0,this.valueChange=new t.EventEmitter,this.maximum=5,this.isReadonly=!1,this._ratingClasses=!0}return Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){this._maximum=+e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icons",{get:function(){return new Array(this.maximum)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){this.isReadonly||(this.value=e+1,this.valueChange.emit(this.value))},e.prototype.onMouseover=function(e){this.hoveredIndex=e},e.prototype.onMouseout=function(){this.hoveredIndex=-1},e.prototype.writeValue=function(e){this.value=e},e.decorators=[{type:t.Component,args:[{selector:"sui-rating",template:'\n\n\n',styles:["\n:host.read-only .icon {\n cursor: auto\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_ratingClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.rating"]}],valueChange:[{type:t.Output}],maximum:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],onMouseout:[{type:t.HostListener,args:["mouseout"]}]},e}(),oo=function(e){function n(t){return e.call(this,t)||this}return io(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-rating",host:{"(valueChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:ro}]},n}(Et),so=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[i.FormsModule,n.CommonModule],declarations:[ro,oo],exports:[ro,oo]}]}],e.ctorParameters=function(){return[]},e}(),ao=function(){function e(e){this.componentFactory=e,this._optionClasses=!0,this.formatter=function(e){return""}}return Object.defineProperty(e.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-search-result",template:'\n\n\n'}]}],e.ctorParameters=function(){return[{type:Ht}]},e.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.result"]}],value:[{type:t.Input}],query:[{type:t.Input}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}]},e}(),co=function(){function e(e){void 0===e&&(e=!1);var t=this;this._options=[],this.optionsFilter=function(e,n){var i=t.toRegex(t._query);return i instanceof RegExp&&e.filter(function(e){return jt.Object.readValue(e,t._optionsField).toString().match(i)})},this.allowEmptyQuery=e,this.searchDelay=0,this.reset()}return Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e||[],this._optionsLookup=void 0,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{get:function(){return this._optionsLookup},set:function(e){this._optionsLookup=e,this._options=[],this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasItemLookup",{get:function(){return!!this.optionsLookup&&2===this.optionsLookup.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{get:function(){return this._optionsField},set:function(e){this._optionsField=e,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this._results},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this._isSearching},enumerable:!0,configurable:!0}),e.prototype.updateQueryDelayed=function(e,t){var n=this;void 0===t&&(t=function(){}),this._query=e,clearTimeout(this._searchDelayTimeout),this._searchDelayTimeout=window.setTimeout(function(){n.updateQuery(e,t)},this.searchDelay)},e.prototype.updateQuery=function(e,t){var n=this;if(void 0===t&&(t=function(){}),this._query=e,""===this._query&&!this.allowEmptyQuery)return t();if(this._resultsCache.hasOwnProperty(this._query))return this._results=this._resultsCache[this._query],t();if(this._optionsLookup){this._isSearching=!0;return void this._optionsLookup.call(void 0,this._query).then(function(e){return n._isSearching=!1,n.updateResults(e),t()}).catch(function(e){return n._isSearching=!1,t(e)})}var i=this.optionsFilter.call(void 0,this._options,this._query);return i&&this.updateResults(i),t()},e.prototype.updateResults=function(e){this._resultsCache[this._query]=e,this._results=e},e.prototype.initialLookup=function(e){return Array,this._optionsLookup(void 0,e)},e.prototype.toRegex=function(e){try{return new RegExp(e,"i")}catch(t){return e}},e.prototype.highlightMatches=function(e,t){var n=this.toRegex(t);return n instanceof RegExp?e.replace(n,function(e){return""+e+""}):e},e.prototype.reset=function(){this._results=[],this._resultsCache={},this._isSearching=!1,this.updateQuery("")},e}(),uo=function(){function e(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._searchClasses=!0,this.hasIcon=!0,this.allowEmptyQuery=!1,this.retainSelectedResult=!0,this.searchDelay=200,this.maxResults=7,this.onResultSelected=new t.EventEmitter,this.transition="scale",this.transitionDuration=200,this._documentClickListener=n.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowEmptyQuery",{get:function(){return this._allowEmptyQuery},set:function(e){this._allowEmptyQuery=e,this.searchService.allowEmptyQuery=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this.searchService.query},set:function(e){this.selectedResult=void 0,this.searchService.updateQueryDelayed(e,function(){})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{set:function(e){e&&(this.searchService.options=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{set:function(e){this.searchService.optionsLookup=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resultFormatter",{get:function(){var e=this;return this._resultFormatter?this._resultFormatter:this.searchService.optionsLookup?function(t){return e.readValue(t)}:function(t,n){return e.searchService.highlightMatches(e.readValue(t),n)}},set:function(e){this._resultFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"searchDelay",{set:function(e){this.searchService.searchDelay=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this.searchService.results.slice(0,this.maxResults)},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this._menu.service=this.dropdownService},e.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().search},e.prototype.select=function(e){this.onResultSelected.emit(e),this.dropdownService.setOpenState(!1),this.retainSelectedResult?(this.selectedResult=e,this.searchService.updateQuery(this.readValue(e))):this.searchService.updateQuery("")},e.prototype.onClick=function(e){this.open()},e.prototype.onFocusIn=function(){this.dropdownService.isAnimating||this.open()},e.prototype.open=function(){(this.searchService.query.length>0||this.allowEmptyQuery)&&this.dropdownService.setOpenState(!0)},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.dropdownService.setOpenState(!1)},e.prototype.onDocumentClick=function(e){this._element.nativeElement.contains(e.target)||this.dropdownService.setOpenState(!1)},e.prototype.readValue=function(e){return jt.Object.readValue(e,this.searchService.optionsField)},e.prototype.ngOnDestroy=function(){this._documentClickListener()},e.decorators=[{type:t.Component,args:[{selector:"sui-search",template:'\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n',styles:["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},e.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_searchClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.search"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],hasIcon:[{type:t.Input}],allowEmptyQuery:[{type:t.Input}],placeholder:[{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],optionsField:[{type:t.Input}],resultFormatter:[{type:t.Input}],resultTemplate:[{type:t.Input}],retainSelectedResult:[{type:t.Input}],searchDelay:[{type:t.Input}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],maxResults:[{type:t.Input}],onResultSelected:[{type:t.Output,args:["resultSelected"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),lo=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,gt,rn],declarations:[uo,ao],exports:[uo]}]}],e.ctorParameters=function(){return[]},e}(),po=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ho=function(e){function n(n,i,r){var o=e.call(this,n,i)||this;return o.changeDetector=r,o._optionClasses=!0,o.isActive=!1,o.onSelected=new t.EventEmitter,o.renderedText="",o.usesTemplate=!1,o}return po(n,e),Object.defineProperty(n.prototype,"formatter",{set:function(e){this.usesTemplate?this.renderedText="":this.renderedText=e(this.value)},enumerable:!0,configurable:!0}),n.prototype.onClick=function(e){var t=this;e.eventHandled=!0,setTimeout(function(){return t.onSelected.emit(t.value)})},n.decorators=[{type:t.Component,args:[{selector:"sui-select-option",template:'\n\n\n'}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},n.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.item"]}],value:[{type:t.Input}],onSelected:[{type:t.Output}],isActive:[{type:t.HostBinding,args:["class.active"]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(Rr),fo=function(){function e(e,n){this._renderer=e,this._element=n,this.onQueryUpdated=new t.EventEmitter,this.onQueryKeyDown=new t.EventEmitter,this._searchClass=!0,this._autoComplete="off"}return Object.defineProperty(e.prototype,"query",{set:function(e){this._renderer.setProperty(this._element.nativeElement,"value",e)},enumerable:!0,configurable:!0}),e.prototype.updateQuery=function(e){this.onQueryUpdated.emit(e)},e.prototype.onKeyDown=function(e){this.onQueryKeyDown.emit(e)},e.prototype.focus=function(){var e=this;this._element.nativeElement.focus(),setTimeout(function(){return e._element.nativeElement.focus()})},e.decorators=[{type:t.Directive,args:[{selector:"input[suiSelectSearch]"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_searchClass:[{type:t.HostBinding,args:["class.search"]}],_autoComplete:[{type:t.HostBinding,args:["attr.autocomplete"]}],updateQuery:[{type:t.HostListener,args:["input",["$event.target.value"]]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}(),mo=function(){function n(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co(!0),this.isSearchable=!1,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._renderedSubscriptions=[],this.icon="dropdown",this.transition="slide down",this.transitionDuration=200,this.onTouched=new t.EventEmitter,this._documentKeyDownListener=n.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),this._selectClasses=!0}return Object.defineProperty(n.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isVisible",{get:function(){return this._menu.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_searchClass",{get:function(){return this.isSearchable&&!this.isSearchExternal},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"searchInput",{get:function(){return this._manualSearch||this._internalSearch},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tabIndex",{get:function(){return this.isDisabled?-1:this.dropdownService.isOpen&&this.isSearchExternal?-1:void 0!=this._tabIndex?this._tabIndex:this._searchClass?-1:0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isDisabled",{get:function(){return this.dropdownService.isDisabled},set:function(e){this.dropdownService.isDisabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"options",{set:function(e){e&&(this.searchService.options=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsLookup",{set:function(e){e&&(this.searchService.optionsLookup=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"filteredOptions",{get:function(){return this.searchService.results},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"query",{get:function(){return this.isSearchable?this.searchService.query:void 0},set:function(e){var t=this;void 0!=e&&(this.queryUpdateHook(),this.updateQuery(e),this._renderedOptions.forEach(function(e){return t.initialiseRenderedOption(e)}),this.searchInput&&(this.searchInput.query=e))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelField",{get:function(){return this.searchService.optionsField},set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelGetter",{get:function(){var e=this;return function(t){var n=jt.Object.readValue(t,e.labelField);return void 0!=n?n.toString():""}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valueGetter",{get:function(){var e=this;return function(t){return jt.Object.readValue(t,e.valueField)}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"configuredFormatter",{get:function(){var e=this;return this._optionFormatter?function(t){return e._optionFormatter(t,e.isSearchable?e.query:void 0)}:this.searchService.optionsLookup?function(t){return e.labelGetter(t)}:function(t){return e.searchService.highlightMatches(e.labelGetter(t),e.query||"")}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionFormatter",{set:function(e){this._optionFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),n.prototype.ngAfterContentInit=function(){var e=this;this._menu.service=this.dropdownService,this._menu.items=this._renderedOptions,this._manualSearch&&(this.isSearchable=!0,this.isSearchExternal=!0),this.searchInput&&(this.searchInput.onQueryUpdated.subscribe(function(t){return e.query=t}),this.searchInput.onQueryKeyDown.subscribe(function(t){return e.onQueryInputKeydown(t)})),this.onAvailableOptionsRendered(),this._renderedOptions.changes.subscribe(function(){return e.onAvailableOptionsRendered()})},n.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().select},n.prototype.optionsUpdateHook=function(){},n.prototype.queryUpdateHook=function(){},n.prototype.updateQuery=function(e){var t=this;this.searchService.updateQuery(e,function(){return t.dropdownService.setOpenState(!0)})},n.prototype.resetQuery=function(e){void 0===e&&(e=!0),e?(this.searchService.searchDelay=this._menu.menuTransitionDuration,this.searchService.updateQueryDelayed("")):this.searchService.updateQuery(""),this.searchInput&&(this.searchInput.query="")},n.prototype.onAvailableOptionsRendered=function(){var e=this;this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._renderedSubscriptions=[],this._renderedOptions.forEach(function(t){setTimeout(function(){return e.initialiseRenderedOption(t)}),e._renderedSubscriptions.push(t.onSelected.subscribe(function(){return e.selectOption(t.value)}))}),0!==this.searchService.options.length||this.searchService.optionsLookup||(this.options=this._renderedOptions.map(function(e){return e.value}))},n.prototype.initialiseRenderedOption=function(e){e.usesTemplate=!!this.optionTemplate,e.formatter=this.configuredFormatter,e.usesTemplate&&this.drawTemplate(e.templateSibling,e.value),e.changeDetector.markForCheck()},n.prototype.findOption=function(e,t){var n=this;return e.find(function(e){return t===n.valueGetter(e)})},n.prototype.onCaretClick=function(e){e.eventHandled||(e.eventHandled=!0,this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!this.dropdownService.isOpen),this.focus()))},n.prototype.onClick=function(e){e.eventHandled||this.dropdownService.isAnimating||(e.eventHandled=!0,this.dropdownService.setOpenState(!!this.isSearchable||!this.dropdownService.isOpen),this.focus())},n.prototype.onFocusIn=function(){this.dropdownService.isOpen||this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!0),this.focus())},n.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||(this.dropdownService.setOpenState(!1),this.onTouched.emit())},n.prototype.onKeyPress=function(t){t.keyCode===e.KeyCode.Enter&&this._element.nativeElement.click()},n.prototype.onDocumentKeyDown=function(t){this._element.nativeElement.contains(t.target)&&!this.dropdownService.isOpen&&t.keyCode===e.KeyCode.Down&&(this._element.nativeElement.click(),t.preventDefault())},n.prototype.onQueryInputKeydown=function(e){},n.prototype.focus=function(){this.isSearchable&&this.searchInput?this.searchInput.focus():this._element.nativeElement.focus()},n.prototype.drawTemplate=function(e,t){e.clear(),e.createEmbeddedView(this.optionTemplate,{$implicit:t,query:this.query})},n.prototype.ngOnDestroy=function(){this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._documentKeyDownListener()},n.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_renderedOptions:[{type:t.ContentChildren,args:[ho,{descendants:!0}]}],_selectClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dropdown"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isSearchable:[{type:t.Input}],_searchClass:[{type:t.HostBinding,args:["class.search"]}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],_internalSearch:[{type:t.ViewChild,args:[fo]}],_manualSearch:[{type:t.ContentChild,args:[fo]}],_tabIndex:[{type:t.Input,args:["tabindex"]}],tabIndex:[{type:t.HostBinding,args:["attr.tabindex"]}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],labelField:[{type:t.Input}],valueField:[{type:t.Input}],optionTemplate:[{type:t.Input}],optionFormatter:[{type:t.Input}],icon:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onTouched:[{type:t.Output,args:["touched"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}],onKeyPress:[{type:t.HostListener,args:["keypress",["$event"]]}]},n}(),go=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),yo=function(n){function i(i,r,o,s){var a=n.call(this,i,r,o)||this;return a.componentFactory=s,a._transitionController=new vt(!1,"inline-block"),a.setTransitionController(a._transitionController),a.onDeselected=new t.EventEmitter,a._labelClasses=!0,a._transitionController.animate(new yt("scale",100,e.TransitionDirection.In)),a}return go(i,n),Object.defineProperty(i.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),i.prototype.deselectOption=function(t){var n=this;t.eventHandled=!0,this._transitionController.animate(new yt("scale",100,e.TransitionDirection.Out,function(){return n.onDeselected.emit(n.value)}))},i.prototype.onClick=function(e){e.eventHandled=!0},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select-label",template:'\n\n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:Ht}]},i.propDecorators={_labelClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.label"]}],value:[{type:t.Input}],query:[{type:t.Input}],onDeselected:[{type:t.Output,args:["deselected"]}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},i}(bt),vo=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bo=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o.selectedOptions=[],o.selectedOptionsChange=new t.EventEmitter,o.hasLabels=!0,o._multiSelectClasses=!0,o}return vo(i,n),Object.defineProperty(i.prototype,"filteredOptions",{get:function(){var e=this;if(this.maxSelectedReached)return[];var t=this.searchService.results;return this.hasLabels?t.filter(function(t){return void 0==e.selectedOptions.find(function(e){return t===e})}):t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasLabels",{get:function(){return this._hasLabels},set:function(e){this._hasLabels=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.multi.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}), +Object.defineProperty(i.prototype,"maxSelectedReached",{get:function(){return void 0!=this.maxSelected&&this.selectedOptions.length===this.maxSelected},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxSelectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.maxSelectedMessage,[["max",this.maxSelected.toString()]])},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.selectedMessage,[["count",this.selectedOptions.length.toString()]])},enumerable:!0,configurable:!0}),i.prototype.optionsUpdateHook=function(){var e=this;!this._writtenOptions&&this.selectedOptions.length>0&&this.writeValue(this.selectedOptions.map(function(t){return e.valueGetter(t)})),this._writtenOptions&&this.searchService.options.length>0&&(this.selectedOptions=this._writtenOptions.map(function(t){return e.findOption(e.searchService.options,t)}).filter(function(e){return void 0!=e}),this.selectedOptions.length===this._writtenOptions.length&&(this._writtenOptions=void 0))},i.prototype.initialiseRenderedOption=function(e){n.prototype.initialiseRenderedOption.call(this,e),e.isActive=!this.hasLabels&&-1!==this.selectedOptions.indexOf(e.value)},i.prototype.selectOption=function(e){var t=this;if(-1!==this.selectedOptions.indexOf(e))return void this.deselectOption(e);this.selectedOptions.push(e),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.resetQuery(!1),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.writeValue=function(e){var t=this;e instanceof Array?(this.searchService.options.length>0&&(this.selectedOptions=e.map(function(e){return t.findOption(t.searchService.options,e)}).filter(function(e){return void 0!=e})),e.length>0&&0===this.selectedOptions.length&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){return t.selectedOptions=e}):this._writtenOptions=e),0===e.length&&(this.selectedOptions=[])):this.selectedOptions=[]},i.prototype.deselectOption=function(e){var t=this;this.selectedOptions=this.selectedOptions.filter(function(t){return t!==e}),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.onQueryInputKeydown=function(t){t.keyCode===e.KeyCode.Backspace&&""===this.query&&this.selectedOptions.length>0&&this.deselectOption(this.selectedOptions[this.selectedOptions.length-1])},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select",template:'\n\x3c!-- Dropdown icon --\x3e\n\n\n\n\x3c!-- Multi-select labels --\x3e\n \n\n\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Helper text --\x3e\n
\n \n \x3c!-- Placeholder text --\x3e\n {{ placeholder }}\n \n \x3c!-- Summary shown when labels are hidden --\x3e\n {{ selectedMessage }}\n
\n\n\x3c!-- Select dropdown menu --\x3e\n\n',styles:["\n:host input.search {\n width: 12em !important;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},i.propDecorators={selectedOptionsChange:[{type:t.Output}],hasLabels:[{type:t.Input}],placeholder:[{type:t.Input}],maxSelected:[{type:t.Input}],_multiSelectClasses:[{type:t.HostBinding,args:["class.multiple"]}]},i}(mo),wo=function(e){function n(t){return e.call(this,t)||this}return vo(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-multi-select",host:{"(selectedOptionsChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:bo}]},n}(Et),_o=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Do=function(e){function n(n,i,r){var o=e.call(this,n,i,r)||this;return o.selectedOptionChange=new t.EventEmitter,o}return _o(n,e),Object.defineProperty(n.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.single.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),n.prototype.optionsUpdateHook=function(){!this._writtenOption&&this.selectedOption&&this.writeValue(this.valueGetter(this.selectedOption)),this._writtenOption&&this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,this._writtenOption),this.selectedOption&&(this._writtenOption=void 0,this.drawSelectedOption()))},n.prototype.queryUpdateHook=function(){this.selectedOption=void 0},n.prototype.selectOption=function(e){this.selectedOption=e,this.selectedOptionChange.emit(this.valueGetter(e)),this.dropdownService.setOpenState(!1),this.resetQuery(),this.drawSelectedOption(),this.focus()},n.prototype.writeValue=function(e){var t=this;void 0!=e?(this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,e),this.drawSelectedOption()),void 0==this.selectedOption&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){t.selectedOption=e,t.drawSelectedOption()}):this._writtenOption=e)):(this.selectedOption=void 0,this.drawSelectedOption())},n.prototype.initialiseRenderedOption=function(t){e.prototype.initialiseRenderedOption.call(this,t),t.isActive=t.value===this.selectedOption},n.prototype.drawSelectedOption=function(){this._renderedOptions&&this.onAvailableOptionsRendered(),void 0!=this.selectedOption&&this.optionTemplate&&this.drawTemplate(this._optionTemplateSibling,this.selectedOption)},n.decorators=[{type:t.Component,args:[{selector:"sui-select",template:'\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Placeholder text --\x3e\n
{{ placeholder }}
\n\x3c!-- Selected item --\x3e\n
\n \n \n
\n\x3c!-- Dropdown icon --\x3e\n\n\x3c!-- Select dropdown menu --\x3e\n\n'}]}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},n.propDecorators={_optionTemplateSibling:[{type:t.ViewChild,args:["optionTemplateSibling",{read:t.ViewContainerRef}]}],selectedOptionChange:[{type:t.Output}],placeholder:[{type:t.Input}]},n}(mo),Co=function(e){function n(t){return e.call(this,t)||this}return _o(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-select",host:{"(selectedOptionChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:Do}]},n}(Et),Oo=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,rn,gt],declarations:[Do,ho,fo,Co,bo,yo,wo],exports:[Do,ho,fo,Co,bo,wo]}]}],e.ctorParameters=function(){return[]},e}(),So={Overlay:"overlay",Push:"push",ScaleDown:"scale down",Uncover:"uncover",SlideAlong:"slide along",SlideOut:"slide out"},Mo={Left:"left",Right:"right",Top:"top",Bottom:"bottom"},To=function(){function e(e){void 0===e&&(e=!1),this.isVisible=e,this.isAnimating=!1,this.wasJustOpened=!1,this.isVisibleChange=new t.EventEmitter,this.widthChange=new t.EventEmitter,this.heightChange=new t.EventEmitter,this.width=260,this.height=0,this.transition=So.Uncover}return Object.defineProperty(e.prototype,"width",{get:function(){return this.direction===Mo.Left?this._width:this.direction===Mo.Right?-this._width:0},set:function(e){this._width=e,this.widthChange.emit()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.direction===Mo.Top?this._height:this.direction===Mo.Bottom?-this._height:0},set:function(e){this._height=e,this.heightChange.emit()},enumerable:!0,configurable:!0}),e.prototype.setVisibleState=function(e){var t=this;this.isVisible!==e&&(this.isVisible=e,this.isAnimating=!0,this.wasJustOpened=!0,this.isVisibleChange.emit(e),setTimeout(function(){return t.wasJustOpened=!1}),clearTimeout(this._isAnimatingTimeout),this._isAnimatingTimeout=window.setTimeout(function(){return t.isAnimating=!1},500))},e.prototype.toggleVisibleState=function(){this.setVisibleState(!this.isVisible)},e}(),ko=function(){function e(e,t){var n=this;this._renderer=e,this._element=t,this.service=new To,this.transition=So.Uncover,this.direction=Mo.Left,setTimeout(function(){return n.updateDimensions()}),this.service.isVisibleChange.subscribe(function(){return n.updateDimensions()}),this._sidebarClasses=!0}return Object.defineProperty(e.prototype,"transition",{get:function(){return this.service.transition},set:function(e){var t=this;this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!1)}),this.service.transition=e,this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!0)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"direction",{get:function(){return this.service.direction},set:function(e){this.setClass(this.service.direction,!1),this.service.direction=e,this.setClass(this.service.direction,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.service.isVisible},set:function(e){this.service.setVisibleState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisibleChange",{get:function(){return this.service.isVisibleChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAnimating",{get:function(){return this.service.isAnimating},enumerable:!0,configurable:!0}),e.prototype.updateDimensions=function(){this.service.width=this._element.nativeElement.offsetWidth,this.service.height=this._element.nativeElement.offsetHeight},e.prototype.setClass=function(e,t){void 0===t&&(t=!0),t?this._renderer.addClass(this._element.nativeElement,e):this._renderer.removeClass(this._element.nativeElement,e)},e.prototype.open=function(){this.service.setVisibleState(!0)},e.prototype.close=function(){this.service.setVisibleState(!1)},e.prototype.toggle=function(){this.service.toggleVisibleState()},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar",template:""}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_sidebarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.sidebar"]},{type:t.HostBinding,args:["class.menu"]}],transition:[{type:t.Input}],direction:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]},{type:t.Input}],isVisibleChange:[{type:t.Output}],isAnimating:[{type:t.HostBinding,args:["class.animating"]}]},e}(),Po=function(){function e(e,t){this._renderer=e,this._element=t,this.isDimmedWhenVisible=!1,this._siblingClasses=!0}return Object.defineProperty(e.prototype,"service",{get:function(){return this._service},set:function(e){var t=this;this._service=e,setTimeout(function(){return t.updateTransform()}),this._service.isVisibleChange.subscribe(function(){return t.updateTransform()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return!!this.service&&this.service.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDimmed",{get:function(){return!!this.service&&(this.service.isVisible&&this.isDimmedWhenVisible)},enumerable:!0,configurable:!0}),e.prototype.updateTransform=function(){if(this._renderer.removeStyle(this._element.nativeElement,"transform"),this._renderer.removeStyle(this._element.nativeElement,"-webkit-transform"),this.service.isVisible&&this.service.transition!==So.Overlay&&this.service.transition!==So.ScaleDown){var e="translate3d("+this.service.width+"px, "+this.service.height+"px, 0)";this._renderer.setStyle(this._element.nativeElement,"transform",e),this._renderer.setStyle(this._element.nativeElement,"-webkit-transform",e)}},e.prototype.onClick=function(e){this.service.isVisible&&!this.service.wasJustOpened&&this.service.setVisibleState(!1)},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-sibling",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={isDimmedWhenVisible:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isDimmed:[{type:t.HostBinding,args:["class.dimmed"]}],_siblingClasses:[{type:t.HostBinding,args:["class.pusher"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},e}(),xo=function(){function e(){this._containerClasses=!0}return e.prototype.ngAfterContentInit=function(){if(!this.sidebar)throw new Error("You must include a element within the container.");if(this.service=this.sidebar.service,!this.sibling)throw new Error("You must include a element within the container.");this.sibling.service=this.service},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-container",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_containerClasses:[{type:t.HostBinding,args:["class.pushable"]}],sidebar:[{type:t.ContentChild,args:[ko]}],sibling:[{type:t.ContentChild,args:[Po]}]},e}(),Io=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[ko,xo,Po],exports:[ko,xo,Po]}]}],e.ctorParameters=function(){return[]},e}(),Eo=function(){function e(e,t){var n=this;this.id=e.id,this.header=e,this.content=t,this.header.isActiveChange.subscribe(function(){return n.content.isActive=n.isActive})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.header.isActive},set:function(e){this.header.setActiveState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.header.isDisabled},enumerable:!0,configurable:!0}),e}(),Lo=function(){function e(){this._isActive=!1,this.isActiveChange=new t.EventEmitter,this.isActiveExternalChange=new t.EventEmitter,this.onActivate=new t.EventEmitter,this.onDeactivate=new t.EventEmitter,this.isDisabled=!1,this._headerClasses=!0}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},set:function(e){var t=this,n=e;setTimeout(function(){n=!t.isDisabled&&e,t.setActiveState(n),t.isActiveExternalChange.emit(n)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(e){this._isDisabled!==e&&(this._isDisabled=e,this.isDisabled&&(this.isActive=!1))},enumerable:!0,configurable:!0}),e.prototype.setActiveState=function(e){!!this._isActive!==e&&(this._isActive=e,e?this.onActivate.emit():this.onDeactivate.emit()),this.isActiveChange.emit(e)},e.prototype.onClick=function(){this.isDisabled||(this.isActive=!0)},e.decorators=[{type:t.Directive,args:[{selector:"[suiTabHeader]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_headerClasses:[{type:t.HostBinding,args:["class.item"]}],id:[{type:t.Input,args:["suiTabHeader"]}],isActiveChange:[{type:t.Output}],onActivate:[{type:t.Output,args:["activate"]}],onDeactivate:[{type:t.Output,args:["deactivate"]}],isActive:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},e}(),jo=function(){function e(){this.isActive=!1,this._contentClasses=!0}return e.decorators=[{type:t.Directive,args:[{selector:"[suiTabContent]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_contentClasses:[{type:t.HostBinding,args:["class.tab"]}],id:[{type:t.Input,args:["suiTabContent"]}],isActive:[{type:t.HostBinding,args:["class.active"]}]},e}(),Vo=function(){function e(){this.tabs=[],this._barrierCount=0}return Object.defineProperty(e.prototype,"activeTab",{get:function(){return this._activeTab},set:function(e){this._activeTab=e,e.isActive=!0},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this._tabHeaders.changes.subscribe(function(){return e.internalComponentsUpdated()}),this._tabContents.changes.subscribe(function(){return e.internalComponentsUpdated()}),this.loadTabs()},e.prototype.internalComponentsUpdated=function(){2===++this._barrierCount&&(this._barrierCount=0,this.loadTabs())},e.prototype.loadTabs=function(){var e=this;if(this.tabs=this.tabs.filter(function(t){return!!e._tabHeaders.find(function(e){return e===t.header})}),this._tabHeaders.filter(function(t){return!e.tabs.find(function(e){return e.header===t})}).forEach(function(t){var n=e._tabContents.find(function(e){return e.id===t.id});if(!n)throw new Error("A [suiTabHeader] must have a related [suiTabContent].");var i=new Eo(t,n);i.header.isActiveExternalChange.subscribe(function(){return e.onHeaderActiveChanged(i)}),e.tabs.push(i)}),this._tabHeaders.forEach(function(t,n){var i=e.tabs.find(function(e){return e.header===t});i&&(i.index=n)}),this.tabs.sort(function(e,t){return e.index-t.index}),this.activeTab?this.tabs.find(function(t){return t===e.activeTab})||setTimeout(function(){return e.activateClosestTab(e.activeTab)}):this.activateFirstTab(),0===this.tabs.length)throw new Error("You cannot have no tabs!")},e.prototype.onHeaderActiveChanged=function(e){e.isActive&&this.activeTab!==e&&(this.tabs.filter(function(t){return t!==e}).forEach(function(e){return e.isActive=!1}),this.activeTab=e),e.isActive||this.activeTab!==e||this.activateClosestTab(e)},e.prototype.activateFirstTab=function(){this.activeTab=this.tabs[0]},e.prototype.activateClosestTab=function(e){var t;if(e.index>=this.tabs.length&&(t=this.tabs[this.tabs.length-1]),t||(t=this.tabs.find(function(t){return t===e})?this.tabs[Math.max(e.index-1,0)]:this.tabs[e.index]),t.isDisabled)return this.activateClosestTab(t);this.activeTab=t},e.decorators=[{type:t.Component,args:[{selector:"sui-tabset",template:""}]}],e.ctorParameters=function(){return[]},e.propDecorators={_tabHeaders:[{type:t.ContentChildren,args:[Lo]}],_tabContents:[{type:t.ContentChildren,args:[jo]}]},e}(),Ho=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[Vo,Lo,jo],exports:[Vo,Lo,jo]}]}],e.ctorParameters=function(){return[]},e}(),Ro=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{exports:[Dt,Ot,xt,hn,Pt,xr,Lr,Yr,eo,er,no,so,lo,Oo,Io,Ho,wt,gt,rn]}]}],e.ctorParameters=function(){return[]},e}();e.SuiLocalizationService=mt,e.SuiLocalizationModule=gt,e.SuiMessage=_t,e.SuiMessageModule=Dt,e.SuiPagination=Ct,e.SuiPaginationModule=Ot,e.SuiAccordionPanel=St,e.SuiAccordion=Tt,e.SuiAccordionService=Mt,e.SuiAccordionModule=xt,e.SuiCheckbox=sn,e.SuiCheckboxValueAccessor=an,e.SuiRadio=un,e.SuiRadioValueAccessor=ln,e.SuiRadioManager=pn,e.SuiCheckboxModule=hn,e.SuiCollapse=kt,e.SuiCollapseModule=Pt,e.CalendarConfig=Sn,e.DateConfigBase=Mn,e.YearConfig=Tn,e.MonthConfig=kn,e.DateConfig=Pn,e.DatetimeConfig=xn,e.TimeConfig=In,e.CalendarMappings=vn,e.DateMappings=bn,e.TimeMappings=wn,e.DatetimeMappings=_n,e.MonthMappings=Dn,e.YearMappings=Cn,e.DateComparer=En,e.DateParser=Li,e.InternalDateParser=ji,e.SuiCalendarViewTitle=Ri,e.DatepickerMode=Ai,e.SuiDatepicker=Fi,e.CalendarItem=fn,e.SuiCalendarItem=mn,e.SuiDatepickerDirective=nr,e.SuiDatepickerDirectiveValueAccessor=ir,e.SuiDatepickerDirectiveValidator=rr,e.SuiDatepickerInputDirective=fr,e.DateFnsParser=Ii,e.CalendarRange=Vi,e.CalendarRangeService=Hi,e.CalendarService=dn,e.CalendarView=gn,e.CalendarRangeDateService=gr,e.SuiCalendarDateView=yr,e.CalendarRangeHourService=br,e.SuiCalendarHourView=wr,e.CalendarRangeMinuteService=Dr,e.SuiCalendarMinuteView=Cr,e.CalendarRangeMonthService=Sr,e.SuiCalendarMonthView=Mr,e.CalendarRangeYearService=kr,e.SuiCalendarYearView=Pr,e.SuiDatepickerModule=xr,e.SuiDimmer=Er,e.SuiDimmerModule=Lr,e.SuiDropdownMenuItem=Rr,e.SuiDropdownMenu=Ar,e.SuiDropdown=Fr,e.DropdownAutoCloseType=jr,e.DropdownService=Vr,e.SuiDropdownModule=Yr,e.ActiveModal=Br,e.ModalSize=Ur,e.ModalConfig=zr,e.TemplateModalConfig=Wr,e.ComponentModalConfig=qr,e.ModalControls=$r,e.Modal=Qr,e.ModalTemplate=Jr,e.SuiModal=Zr,e.SuiModalService=Xr,e.SuiModalModule=eo,e.SuiPopupComponentController=Wi,e.PopupTrigger=Yi,e.PopupConfig=Bi,e.SuiPopupController=Ui,e.TemplatePopupConfig=Ki,e.SuiPopupTemplateController=$i,e.SuiPopupArrow=Qi,e.SuiPopup=Ni,e.SuiPopupDirective=Xi,e.SuiPopupConfig=Ji,e.SuiPopupModule=er,e.SuiProgress=to,e.SuiProgressModule=no,e.SuiRating=ro,e.SuiRatingValueAccessor=oo,e.SuiRatingModule=so,e.SuiSearchResult=ao,e.SuiSearch=uo,e.SearchService=co,e.SuiSearchModule=lo,e.SuiSelectBase=mo,e.SuiMultiSelectLabel=yo,e.SuiMultiSelect=bo,e.SuiMultiSelectValueAccessor=wo,e.SuiSelectOption=ho,e.SuiSelect=Do,e.SuiSelectValueAccessor=Co,e.SuiSelectSearch=fo,e.SuiSelectModule=Oo,e.SuiSidebarContainer=xo,e.SuiSidebarSibling=Po,e.SuiSidebar=ko,e.SidebarTransition=So,e.SidebarDirection=Mo,e.SidebarService=To,e.SuiSidebarModule=Io,e.Tab=Eo,e.SuiTabset=Vo,e.SuiTabContent=jo,e.SuiTabHeader=Lo,e.SuiTabsModule=Ho,e.TransitionController=vt,e.Transition=yt,e.SuiTransition=bt,e.SuiTransitionModule=wt,e.CustomValidator=It,e.customValidatorFactory=a,e.CustomValueAccessor=Et,e.customValueAccessorFactory=c,e.DateUtil=Vt,e.HandledEvent=Lt,e.Util=jt,e.SuiComponentFactory=Ht,e.PositioningPlacement=tn,e.PositioningService=nn,e.SuiUtilityModule=rn,e.SuiModule=Ro,Object.defineProperty(e,"__esModule",{value:!0})}); diff --git a/dist/behaviors/index.d.ts b/dist/behaviors/index.d.ts new file mode 100644 index 000000000..51cd25e0c --- /dev/null +++ b/dist/behaviors/index.d.ts @@ -0,0 +1 @@ +export * from "./localization/index"; diff --git a/dist/behaviors/index.js b/dist/behaviors/index.js new file mode 100644 index 000000000..655700b40 --- /dev/null +++ b/dist/behaviors/index.js @@ -0,0 +1,2 @@ +export * from "./localization/index"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/behaviors/index.js.map b/dist/behaviors/index.js.map new file mode 100644 index 000000000..c6f381923 --- /dev/null +++ b/dist/behaviors/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/behaviors/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC","sourcesContent":["export * from \"./localization/index\";\n"]} \ No newline at end of file diff --git a/dist/behaviors/index.metadata.json b/dist/behaviors/index.metadata.json new file mode 100644 index 000000000..822062a3a --- /dev/null +++ b/dist/behaviors/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./localization/index"}]}] \ No newline at end of file diff --git a/dist/behaviors/localization/index.d.ts b/dist/behaviors/localization/index.d.ts new file mode 100644 index 000000000..4b94872dd --- /dev/null +++ b/dist/behaviors/localization/index.d.ts @@ -0,0 +1,3 @@ +export * from "./interfaces/values"; +export * from "./services/localization.service"; +export * from "./localization.module"; diff --git a/dist/behaviors/localization/index.js b/dist/behaviors/localization/index.js new file mode 100644 index 000000000..3e38ea74a --- /dev/null +++ b/dist/behaviors/localization/index.js @@ -0,0 +1,3 @@ +export * from "./services/localization.service"; +export * from "./localization.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/index.js.map b/dist/behaviors/localization/index.js.map new file mode 100644 index 000000000..32c73da4e --- /dev/null +++ b/dist/behaviors/localization/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/behaviors/localization/index.ts"],"names":[],"mappings":"AAEA,cAAc,iCAAiC,CAAC;AAEhD,cAAc,uBAAuB,CAAC","sourcesContent":["// This file exports all of the other interfaces.\nexport * from \"./interfaces/values\";\nexport * from \"./services/localization.service\";\n\nexport * from \"./localization.module\";\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/index.metadata.json b/dist/behaviors/localization/index.metadata.json new file mode 100644 index 000000000..261e05527 --- /dev/null +++ b/dist/behaviors/localization/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./interfaces/values"},{"from":"./services/localization.service"},{"from":"./localization.module"}]}] \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/datepicker-values.d.ts b/dist/behaviors/localization/interfaces/datepicker-values.d.ts new file mode 100644 index 000000000..c35ee60b3 --- /dev/null +++ b/dist/behaviors/localization/interfaces/datepicker-values.d.ts @@ -0,0 +1,22 @@ +export declare type Septuple = [T, T, T, T, T, T, T]; +export declare type Duodecuple = [T, T, T, T, T, T, T, T, T, T, T, T]; +export declare type Pair = [T, T]; +export interface IDatepickerFormatsLocaleValues { + year: string; + month: string; + date: string; + datetime: string; + time: string; +} +export interface IDatepickerLocaleValues { + months: Duodecuple; + monthsShort: Duodecuple; + weekdays: Septuple; + weekdaysShort: Septuple; + weekdaysNarrow: Septuple; + timesOfDay: Pair; + timesOfDayUppercase: Pair; + timesOfDayLowercase: Pair; + firstDayOfWeek: number; + formats: IDatepickerFormatsLocaleValues; +} diff --git a/dist/behaviors/localization/interfaces/datepicker-values.js b/dist/behaviors/localization/interfaces/datepicker-values.js new file mode 100644 index 000000000..b88bffcd8 --- /dev/null +++ b/dist/behaviors/localization/interfaces/datepicker-values.js @@ -0,0 +1 @@ +//# sourceMappingURL=datepicker-values.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/datepicker-values.js.map b/dist/behaviors/localization/interfaces/datepicker-values.js.map new file mode 100644 index 000000000..323e9092a --- /dev/null +++ b/dist/behaviors/localization/interfaces/datepicker-values.js.map @@ -0,0 +1 @@ +{"version":3,"file":"datepicker-values.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/interfaces/datepicker-values.ts"],"names":[],"mappings":"","sourcesContent":["export type Septuple = [T, T, T, T, T, T, T];\nexport type Duodecuple = [T, T, T, T, T, T, T, T, T, T, T, T];\nexport type Pair = [T, T];\n\nexport interface IDatepickerFormatsLocaleValues {\n year:string;\n month:string;\n date:string;\n datetime:string;\n time:string;\n}\n\nexport interface IDatepickerLocaleValues {\n months:Duodecuple;\n monthsShort:Duodecuple;\n weekdays:Septuple;\n weekdaysShort:Septuple;\n weekdaysNarrow:Septuple;\n timesOfDay:Pair;\n timesOfDayUppercase:Pair;\n timesOfDayLowercase:Pair;\n firstDayOfWeek:number;\n formats:IDatepickerFormatsLocaleValues;\n}\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/datepicker-values.metadata.json b/dist/behaviors/localization/interfaces/datepicker-values.metadata.json new file mode 100644 index 000000000..03b38fd6c --- /dev/null +++ b/dist/behaviors/localization/interfaces/datepicker-values.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"Septuple":{"__symbolic":"interface"},"Duodecuple":{"__symbolic":"interface"},"Pair":{"__symbolic":"interface"},"IDatepickerFormatsLocaleValues":{"__symbolic":"interface"},"IDatepickerLocaleValues":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/partial.d.ts b/dist/behaviors/localization/interfaces/partial.d.ts new file mode 100644 index 000000000..97f965bf1 --- /dev/null +++ b/dist/behaviors/localization/interfaces/partial.d.ts @@ -0,0 +1,3 @@ +export declare type RecursivePartial = { + [P in keyof T]?: RecursivePartial; +}; diff --git a/dist/behaviors/localization/interfaces/partial.js b/dist/behaviors/localization/interfaces/partial.js new file mode 100644 index 000000000..1aae8b3ae --- /dev/null +++ b/dist/behaviors/localization/interfaces/partial.js @@ -0,0 +1 @@ +//# sourceMappingURL=partial.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/partial.js.map b/dist/behaviors/localization/interfaces/partial.js.map new file mode 100644 index 000000000..5a83db7f8 --- /dev/null +++ b/dist/behaviors/localization/interfaces/partial.js.map @@ -0,0 +1 @@ +{"version":3,"file":"partial.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/interfaces/partial.ts"],"names":[],"mappings":"","sourcesContent":["export type RecursivePartial = {\n [P in keyof T]?:RecursivePartial;\n};\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/partial.metadata.json b/dist/behaviors/localization/interfaces/partial.metadata.json new file mode 100644 index 000000000..c5011bf5b --- /dev/null +++ b/dist/behaviors/localization/interfaces/partial.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"RecursivePartial":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/search-values.d.ts b/dist/behaviors/localization/interfaces/search-values.d.ts new file mode 100644 index 000000000..43e098a60 --- /dev/null +++ b/dist/behaviors/localization/interfaces/search-values.d.ts @@ -0,0 +1,7 @@ +export interface ISearchLocaleValues { + placeholder: string; + noResults: { + header: string; + message: string; + }; +} diff --git a/dist/behaviors/localization/interfaces/search-values.js b/dist/behaviors/localization/interfaces/search-values.js new file mode 100644 index 000000000..6052c136e --- /dev/null +++ b/dist/behaviors/localization/interfaces/search-values.js @@ -0,0 +1 @@ +//# sourceMappingURL=search-values.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/search-values.js.map b/dist/behaviors/localization/interfaces/search-values.js.map new file mode 100644 index 000000000..289a342af --- /dev/null +++ b/dist/behaviors/localization/interfaces/search-values.js.map @@ -0,0 +1 @@ +{"version":3,"file":"search-values.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/interfaces/search-values.ts"],"names":[],"mappings":"","sourcesContent":["export interface ISearchLocaleValues {\n placeholder:string;\n noResults:{\n header:string;\n message:string;\n };\n}\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/search-values.metadata.json b/dist/behaviors/localization/interfaces/search-values.metadata.json new file mode 100644 index 000000000..79cbd0ba6 --- /dev/null +++ b/dist/behaviors/localization/interfaces/search-values.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"ISearchLocaleValues":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/select-values.d.ts b/dist/behaviors/localization/interfaces/select-values.d.ts new file mode 100644 index 000000000..8d4b50495 --- /dev/null +++ b/dist/behaviors/localization/interfaces/select-values.d.ts @@ -0,0 +1,11 @@ +export interface ISearchTailoredLocaleValues { + placeholder: string; +} +export interface ISelectLocaleValues { + noResultsMessage: string; + single: ISearchTailoredLocaleValues; + multi: ISearchTailoredLocaleValues & { + maxSelectedMessage: string; + selectedMessage: string; + }; +} diff --git a/dist/behaviors/localization/interfaces/select-values.js b/dist/behaviors/localization/interfaces/select-values.js new file mode 100644 index 000000000..f8551cca2 --- /dev/null +++ b/dist/behaviors/localization/interfaces/select-values.js @@ -0,0 +1 @@ +//# sourceMappingURL=select-values.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/select-values.js.map b/dist/behaviors/localization/interfaces/select-values.js.map new file mode 100644 index 000000000..c1977130d --- /dev/null +++ b/dist/behaviors/localization/interfaces/select-values.js.map @@ -0,0 +1 @@ +{"version":3,"file":"select-values.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/interfaces/select-values.ts"],"names":[],"mappings":"","sourcesContent":["export interface ISearchTailoredLocaleValues {\n placeholder:string;\n}\n\nexport interface ISelectLocaleValues {\n noResultsMessage:string;\n single:ISearchTailoredLocaleValues;\n multi:ISearchTailoredLocaleValues & {\n maxSelectedMessage:string; // `max` variable passed\n selectedMessage:string; // `count` variable passed\n };\n}\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/select-values.metadata.json b/dist/behaviors/localization/interfaces/select-values.metadata.json new file mode 100644 index 000000000..e671c583c --- /dev/null +++ b/dist/behaviors/localization/interfaces/select-values.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"ISearchTailoredLocaleValues":{"__symbolic":"interface"},"ISelectLocaleValues":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/values.d.ts b/dist/behaviors/localization/interfaces/values.d.ts new file mode 100644 index 000000000..55b491d1f --- /dev/null +++ b/dist/behaviors/localization/interfaces/values.d.ts @@ -0,0 +1,14 @@ +import { RecursivePartial } from "./partial"; +import { IDatepickerLocaleValues, IDatepickerFormatsLocaleValues } from "./datepicker-values"; +import { ISearchLocaleValues } from "./search-values"; +import { ISelectLocaleValues, ISearchTailoredLocaleValues } from "./select-values"; +export interface ILocaleValues { + datepicker: IDatepickerLocaleValues; + search: ISearchLocaleValues; + select: ISelectLocaleValues; +} +export declare type IPartialLocaleValues = RecursivePartial; +export { RecursivePartial }; +export { IDatepickerLocaleValues, IDatepickerFormatsLocaleValues }; +export { ISearchLocaleValues }; +export { ISelectLocaleValues, ISearchTailoredLocaleValues }; diff --git a/dist/behaviors/localization/interfaces/values.js b/dist/behaviors/localization/interfaces/values.js new file mode 100644 index 000000000..ea6f618de --- /dev/null +++ b/dist/behaviors/localization/interfaces/values.js @@ -0,0 +1 @@ +//# sourceMappingURL=values.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/values.js.map b/dist/behaviors/localization/interfaces/values.js.map new file mode 100644 index 000000000..3428300e5 --- /dev/null +++ b/dist/behaviors/localization/interfaces/values.js.map @@ -0,0 +1 @@ +{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/interfaces/values.ts"],"names":[],"mappings":"","sourcesContent":["import { RecursivePartial } from \"./partial\";\nimport { IDatepickerLocaleValues, IDatepickerFormatsLocaleValues } from \"./datepicker-values\";\nimport { ISearchLocaleValues } from \"./search-values\";\nimport { ISelectLocaleValues, ISearchTailoredLocaleValues } from \"./select-values\";\n\nexport interface ILocaleValues {\n datepicker:IDatepickerLocaleValues;\n search:ISearchLocaleValues;\n select:ISelectLocaleValues;\n}\n\nexport type IPartialLocaleValues = RecursivePartial;\n\nexport {RecursivePartial};\n\nexport {IDatepickerLocaleValues, IDatepickerFormatsLocaleValues};\nexport {ISearchLocaleValues};\nexport {ISelectLocaleValues, ISearchTailoredLocaleValues};\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/values.metadata.json b/dist/behaviors/localization/interfaces/values.metadata.json new file mode 100644 index 000000000..d895f54a1 --- /dev/null +++ b/dist/behaviors/localization/interfaces/values.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"ILocaleValues":{"__symbolic":"interface"},"IPartialLocaleValues":{"__symbolic":"interface"},"RecursivePartial":{"__symbolic":"reference","module":"./partial","name":"RecursivePartial","line":13,"character":8},"IDatepickerLocaleValues":{"__symbolic":"reference","module":"./datepicker-values","name":"IDatepickerLocaleValues","line":15,"character":8},"IDatepickerFormatsLocaleValues":{"__symbolic":"reference","module":"./datepicker-values","name":"IDatepickerFormatsLocaleValues","line":15,"character":33},"ISearchLocaleValues":{"__symbolic":"reference","module":"./search-values","name":"ISearchLocaleValues","line":16,"character":8},"ISelectLocaleValues":{"__symbolic":"reference","module":"./select-values","name":"ISelectLocaleValues","line":17,"character":8},"ISearchTailoredLocaleValues":{"__symbolic":"reference","module":"./select-values","name":"ISearchTailoredLocaleValues","line":17,"character":29}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/locales/de.d.ts b/dist/behaviors/localization/locales/de.d.ts new file mode 100644 index 000000000..7b3373b2b --- /dev/null +++ b/dist/behaviors/localization/locales/de.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../interfaces/values"; +/** + * locale : German (de) + * author : Ciara Ward : https://github.com/ciaraward + */ +declare const de: IPartialLocaleValues; +export default de; diff --git a/dist/behaviors/localization/locales/de.js b/dist/behaviors/localization/locales/de.js new file mode 100644 index 000000000..e8ab71aa3 --- /dev/null +++ b/dist/behaviors/localization/locales/de.js @@ -0,0 +1,51 @@ +/** + * locale : German (de) + * author : Ciara Ward : https://github.com/ciaraward + */ +var de = { + datepicker: { + months: [ + "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember" + ], + monthsShort: [ + "Jan", "Febr", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez" + ], + weekdays: [ + "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" + ], + weekdaysShort: [ + "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" + ], + weekdaysNarrow: [ + "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" + ], + formats: { + time: "HH:mm", + datetime: "D. MMMM YYYY HH:mm", + date: "D. MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Suchen...", + noResults: { + header: "Keine Ergebnisse", + message: "Ihre Suche ergab keine Ergebnisse." + } + }, + select: { + noResultsMessage: "Keine Ergebnisse", + single: { + placeholder: "Eintrag auswählen..." + }, + multi: { + placeholder: "Einträge auswählen...", + maxSelectedMessage: "Höchstens #{max} Einträge", + selectedMessage: "#{count} Einträge ausgewählt" + } + } +}; +export default de; +//# sourceMappingURL=de.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/de.js.map b/dist/behaviors/localization/locales/de.js.map new file mode 100644 index 000000000..d57b05467 --- /dev/null +++ b/dist/behaviors/localization/locales/de.js.map @@ -0,0 +1 @@ +{"version":3,"file":"de.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/de.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SACxH;QACD,WAAW,EAAE;YACT,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACtF;QACD,QAAQ,EAAE;YACN,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS;SAClF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,cAAc,EAAE;YACZ,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,oBAAoB;YAC9B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,OAAO,EAAE,oCAAoC;SAChD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,kBAAkB;QACpC,MAAM,EAAE;YACJ,WAAW,EAAE,sBAAsB;SACtC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,uBAAuB;YACpC,kBAAkB,EAAE,2BAA2B;YAC/C,eAAe,EAAE,8BAA8B;SAClD;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : German (de)\n * author : Ciara Ward : https://github.com/ciaraward\n */\n\nconst de:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"\n ],\n monthsShort: [\n \"Jan\", \"Febr\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"\n ],\n weekdays: [\n \"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"\n ],\n weekdaysShort: [\n \"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"\n ],\n weekdaysNarrow: [\n \"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D. MMMM YYYY HH:mm\",\n date: \"D. MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Suchen...\",\n noResults: {\n header: \"Keine Ergebnisse\",\n message: \"Ihre Suche ergab keine Ergebnisse.\"\n }\n },\n select: {\n noResultsMessage: \"Keine Ergebnisse\",\n single: {\n placeholder: \"Eintrag auswählen...\"\n },\n multi: {\n placeholder: \"Einträge auswählen...\",\n maxSelectedMessage: \"Höchstens #{max} Einträge\",\n selectedMessage: \"#{count} Einträge ausgewählt\"\n }\n }\n};\n\nexport default de;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-AU.d.ts b/dist/behaviors/localization/locales/en-AU.d.ts new file mode 100644 index 000000000..00d4e3feb --- /dev/null +++ b/dist/behaviors/localization/locales/en-AU.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../interfaces/values"; +/** + * locale : Australian (en-AU) + * author : Trevor Daniels : https://github.com/trevordaniels + */ +declare const enAU: IPartialLocaleValues; +export default enAU; diff --git a/dist/behaviors/localization/locales/en-AU.js b/dist/behaviors/localization/locales/en-AU.js new file mode 100644 index 000000000..573b2c8e4 --- /dev/null +++ b/dist/behaviors/localization/locales/en-AU.js @@ -0,0 +1,11 @@ +/** + * locale : Australian (en-AU) + * author : Trevor Daniels : https://github.com/trevordaniels + */ +var enAU = { + datepicker: { + firstDayOfWeek: 0 + } +}; +export default enAU; +//# sourceMappingURL=en-AU.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-AU.js.map b/dist/behaviors/localization/locales/en-AU.js.map new file mode 100644 index 000000000..d4565d579 --- /dev/null +++ b/dist/behaviors/localization/locales/en-AU.js.map @@ -0,0 +1 @@ +{"version":3,"file":"en-AU.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-AU.ts"],"names":[],"mappings":";;;;AAOA,IAAM,IAAI,GAAwB;IAC9B,UAAU,EAAE;QACR,cAAc,EAAE,CAAC;KACpB;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Australian (en-AU)\n * author : Trevor Daniels : https://github.com/trevordaniels\n */\n\nconst enAU:IPartialLocaleValues = {\n datepicker: {\n firstDayOfWeek: 0\n }\n};\n\nexport default enAU;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-GB.d.ts b/dist/behaviors/localization/locales/en-GB.d.ts new file mode 100644 index 000000000..709846578 --- /dev/null +++ b/dist/behaviors/localization/locales/en-GB.d.ts @@ -0,0 +1,3 @@ +import { ILocaleValues } from "../interfaces/values"; +declare const enGB: ILocaleValues; +export default enGB; diff --git a/dist/behaviors/localization/locales/en-GB.js b/dist/behaviors/localization/locales/en-GB.js new file mode 100644 index 000000000..e78f0f4e9 --- /dev/null +++ b/dist/behaviors/localization/locales/en-GB.js @@ -0,0 +1,56 @@ +var enGB = { + datepicker: { + months: [ + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + ], + monthsShort: [ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + ], + weekdays: [ + "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" + ], + weekdaysShort: [ + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + ], + weekdaysNarrow: [ + "S", "M", "T", "W", "T", "F", "S" + ], + timesOfDay: [ + "a.m.", "p.m." + ], + timesOfDayUppercase: [ + "AM", "PM" + ], + timesOfDayLowercase: [ + "am", "pm" + ], + formats: { + time: "h:mm A", + datetime: "D MMMM YYYY h:mm A", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Search...", + noResults: { + header: "No Results", + message: "Your search returned no results." + } + }, + select: { + noResultsMessage: "No results", + single: { + placeholder: "Select one" + }, + multi: { + placeholder: "Select...", + maxSelectedMessage: "Max #{max} selections", + selectedMessage: "#{count} selections" + } + } +}; +export default enGB; +//# sourceMappingURL=en-GB.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-GB.js.map b/dist/behaviors/localization/locales/en-GB.js.map new file mode 100644 index 000000000..0dff648ce --- /dev/null +++ b/dist/behaviors/localization/locales/en-GB.js.map @@ -0,0 +1 @@ +{"version":3,"file":"en-GB.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-GB.ts"],"names":[],"mappings":"AAEA,IAAM,IAAI,GAAiB;IACvB,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SAC3H;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU;SAC/E;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,UAAU,EAAE;YACR,MAAM,EAAE,MAAM;SACjB;QACD,mBAAmB,EAAE;YACjB,IAAI,EAAE,IAAI;SACb;QACD,mBAAmB,EAAE;YACjB,IAAI,EAAE,IAAI;SACb;QACD,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,oBAAoB;YAC9B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE;YACP,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,kCAAkC;SAC9C;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,YAAY;QAC9B,MAAM,EAAE;YACJ,WAAW,EAAE,YAAY;SAC5B;QACD,KAAK,EAAE;YACH,WAAW,EAAE,WAAW;YACxB,kBAAkB,EAAE,uBAAuB;YAC3C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { ILocaleValues } from \"../interfaces/values\";\n\nconst enGB:ILocaleValues = {\n datepicker: {\n months: [\n \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"\n ],\n monthsShort: [\n \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"\n ],\n weekdays: [\n \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"\n ],\n weekdaysShort: [\n \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"\n ],\n weekdaysNarrow: [\n \"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"\n ],\n timesOfDay: [\n \"a.m.\", \"p.m.\"\n ],\n timesOfDayUppercase: [\n \"AM\", \"PM\"\n ],\n timesOfDayLowercase: [\n \"am\", \"pm\"\n ],\n formats: {\n time: \"h:mm A\",\n datetime: \"D MMMM YYYY h:mm A\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Search...\",\n noResults: {\n header: \"No Results\",\n message: \"Your search returned no results.\"\n }\n },\n select: {\n noResultsMessage: \"No results\",\n single: {\n placeholder: \"Select one\"\n },\n multi: {\n placeholder: \"Select...\",\n maxSelectedMessage: \"Max #{max} selections\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default enGB;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-US.d.ts b/dist/behaviors/localization/locales/en-US.d.ts new file mode 100644 index 000000000..f824c67df --- /dev/null +++ b/dist/behaviors/localization/locales/en-US.d.ts @@ -0,0 +1,3 @@ +import { IPartialLocaleValues } from "../interfaces/values"; +declare const enUS: IPartialLocaleValues; +export default enUS; diff --git a/dist/behaviors/localization/locales/en-US.js b/dist/behaviors/localization/locales/en-US.js new file mode 100644 index 000000000..3c00b6edd --- /dev/null +++ b/dist/behaviors/localization/locales/en-US.js @@ -0,0 +1,14 @@ +var enUS = { + datepicker: { + firstDayOfWeek: 0, + formats: { + time: "h:mm A", + datetime: "MMMM D, YYYY h:mm A", + date: "MMMM D, YYYY", + month: "MMMM YYYY", + year: "YYYY" + } + } +}; +export default enUS; +//# sourceMappingURL=en-US.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-US.js.map b/dist/behaviors/localization/locales/en-US.js.map new file mode 100644 index 000000000..0c0a0d507 --- /dev/null +++ b/dist/behaviors/localization/locales/en-US.js.map @@ -0,0 +1 @@ +{"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-US.ts"],"names":[],"mappings":"AAEA,IAAM,IAAI,GAAwB;IAC9B,UAAU,EAAE;QACR,cAAc,EAAE,CAAC;QACjB,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,qBAAqB;YAC/B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\nconst enUS:IPartialLocaleValues = {\n datepicker: {\n firstDayOfWeek: 0,\n formats: {\n time: \"h:mm A\",\n datetime: \"MMMM D, YYYY h:mm A\",\n date: \"MMMM D, YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n }\n }\n};\n\nexport default enUS;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/es.d.ts b/dist/behaviors/localization/locales/es.d.ts new file mode 100644 index 000000000..7415cbf06 --- /dev/null +++ b/dist/behaviors/localization/locales/es.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../interfaces/values"; +/** + * locale : Spanish (es) + * author : Facundo Donato : https://github.com/genuinefafa + */ +declare const es: IPartialLocaleValues; +export default es; diff --git a/dist/behaviors/localization/locales/es.js b/dist/behaviors/localization/locales/es.js new file mode 100644 index 000000000..9916a4d14 --- /dev/null +++ b/dist/behaviors/localization/locales/es.js @@ -0,0 +1,51 @@ +/** + * locale : Spanish (es) + * author : Facundo Donato : https://github.com/genuinefafa + */ +var es = { + datepicker: { + months: [ + "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" + ], + monthsShort: [ + "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic" + ], + weekdays: [ + "Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado" + ], + weekdaysShort: [ + "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb" + ], + weekdaysNarrow: [ + "D", "L", "M", "M", "J", "V", "S" + ], + formats: { + time: "HH:mm", + datetime: "D [de] MMMM [de] YYYY HH:mm", + date: "D [de] MMMM [de] YYYY", + month: "MMMM [de] YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Buscar...", + noResults: { + header: "Sin resultados", + message: "La búsqueda no obtuvo resultados." + } + }, + select: { + noResultsMessage: "Sin resultados", + single: { + placeholder: "Seleccione uno" + }, + multi: { + placeholder: "Seleccione...", + maxSelectedMessage: "Puede elegir hasta #{max}", + selectedMessage: "Seleccionados #{count}" + } + } +}; +export default es; +//# sourceMappingURL=es.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/es.js.map b/dist/behaviors/localization/locales/es.js.map new file mode 100644 index 000000000..c1e823e1a --- /dev/null +++ b/dist/behaviors/localization/locales/es.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/es.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW;SAC9H;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;SAC3E;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,6BAA6B;YACvC,IAAI,EAAE,uBAAuB;YAC7B,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE;YACP,MAAM,EAAE,gBAAgB;YACxB,OAAO,EAAE,mCAAmC;SAC/C;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,gBAAgB;QAClC,MAAM,EAAE;YACJ,WAAW,EAAE,gBAAgB;SAChC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,eAAe;YAC5B,kBAAkB,EAAE,2BAA2B;YAC/C,eAAe,EAAE,wBAAwB;SAC5C;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Spanish (es)\n * author : Facundo Donato : https://github.com/genuinefafa\n */\n\nconst es:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"\n ],\n monthsShort: [\n \"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"\n ],\n weekdays: [\n \"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"\n ],\n weekdaysShort: [\n \"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"\n ],\n weekdaysNarrow: [\n \"D\", \"L\", \"M\", \"M\", \"J\", \"V\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D [de] MMMM [de] YYYY HH:mm\",\n date: \"D [de] MMMM [de] YYYY\",\n month: \"MMMM [de] YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Buscar...\",\n noResults: {\n header: \"Sin resultados\",\n message: \"La búsqueda no obtuvo resultados.\"\n }\n },\n select: {\n noResultsMessage: \"Sin resultados\",\n single: {\n placeholder: \"Seleccione uno\"\n },\n multi: {\n placeholder: \"Seleccione...\",\n maxSelectedMessage: \"Puede elegir hasta #{max}\",\n selectedMessage: \"Seleccionados #{count}\"\n }\n }\n};\n\nexport default es;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/fr.d.ts b/dist/behaviors/localization/locales/fr.d.ts new file mode 100644 index 000000000..e4c69b224 --- /dev/null +++ b/dist/behaviors/localization/locales/fr.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../interfaces/values"; +/** + * locale : French (fr) + * author : Ciara Ward : https://github.com/ciaraward + */ +declare const fr: IPartialLocaleValues; +export default fr; diff --git a/dist/behaviors/localization/locales/fr.js b/dist/behaviors/localization/locales/fr.js new file mode 100644 index 000000000..aca0e7c5a --- /dev/null +++ b/dist/behaviors/localization/locales/fr.js @@ -0,0 +1,51 @@ +/** + * locale : French (fr) + * author : Ciara Ward : https://github.com/ciaraward + */ +var fr = { + datepicker: { + months: [ + "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" + ], + monthsShort: [ + "Janv", "Févr", "Mars", "Avr", "Mai", "Juin", "Juil", "Août", "Sept", "Oct", "Nov", "Déc" + ], + weekdays: [ + "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" + ], + weekdaysShort: [ + "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" + ], + weekdaysNarrow: [ + "Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM YYYY HH:mm", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Cherche...", + noResults: { + header: "Aucun Résultats", + message: "Votre recherche n'a pas donné de résultats." + } + }, + select: { + noResultsMessage: "Aucun résultats", + single: { + placeholder: "Choisissez-en un" + }, + multi: { + placeholder: "Choisissez-en...", + maxSelectedMessage: "Max #{max} sélections", + selectedMessage: "#{count} selections" + } + } +}; +export default fr; +//# sourceMappingURL=fr.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/fr.js.map b/dist/behaviors/localization/locales/fr.js.map new file mode 100644 index 000000000..d7c77ffd4 --- /dev/null +++ b/dist/behaviors/localization/locales/fr.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/fr.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SAC1H;QACD,WAAW,EAAE;YACT,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAC5F;QACD,QAAQ,EAAE;YACN,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ;SAC1E;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,YAAY;QACzB,SAAS,EAAE;YACP,MAAM,EAAE,iBAAiB;YACzB,OAAO,EAAE,6CAA6C;SACzD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,iBAAiB;QACnC,MAAM,EAAE;YACJ,WAAW,EAAE,kBAAkB;SAClC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,kBAAkB;YAC/B,kBAAkB,EAAE,uBAAuB;YAC3C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : French (fr)\n * author : Ciara Ward : https://github.com/ciaraward\n */\n\nconst fr:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"\n ],\n monthsShort: [\n \"Janv\", \"Févr\", \"Mars\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Août\", \"Sept\", \"Oct\", \"Nov\", \"Déc\"\n ],\n weekdays: [\n \"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"\n ],\n weekdaysShort: [\n \"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"\n ],\n weekdaysNarrow: [\n \"Di\", \"Lu\", \"Ma\", \"Me\", \"Je\", \"Ve\", \"Sa\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Cherche...\",\n noResults: {\n header: \"Aucun Résultats\",\n message: \"Votre recherche n'a pas donné de résultats.\"\n }\n },\n select: {\n noResultsMessage: \"Aucun résultats\",\n single: {\n placeholder: \"Choisissez-en un\"\n },\n multi: {\n placeholder: \"Choisissez-en...\",\n maxSelectedMessage: \"Max #{max} sélections\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default fr;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/ge.d.ts b/dist/behaviors/localization/locales/ge.d.ts new file mode 100644 index 000000000..c0820006d --- /dev/null +++ b/dist/behaviors/localization/locales/ge.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../interfaces/values"; +/** + * locale : Georgian (ge) + * author : Vaso Gazdeliani : https://github.com/vaso991 + */ +declare const ge: IPartialLocaleValues; +export default ge; diff --git a/dist/behaviors/localization/locales/ge.js b/dist/behaviors/localization/locales/ge.js new file mode 100644 index 000000000..84c947903 --- /dev/null +++ b/dist/behaviors/localization/locales/ge.js @@ -0,0 +1,52 @@ +/** + * locale : Georgian (ge) + * author : Vaso Gazdeliani : https://github.com/vaso991 + */ +var ge = { + datepicker: { + months: [ + "იანვარი", "თებერვალი", "მარტი", "აპრილი", "მაისი", "ივნისი", + "ივლისი", "აგვისტო", "სექტემბერი", "ოქტომბერი", "ნოემბერი", "დეკემბერი" + ], + monthsShort: [ + "იან", "თებ", "მარ", "აპრ", "მაი", "ივნ", "ივლ", "აგვ", "სექ", "ოქტ", "ნოემ", "დეკ" + ], + weekdays: [ + "კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი" + ], + weekdaysShort: [ + "კვ", "ორ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ" + ], + weekdaysNarrow: [ + "კ", "ორ", "ს", "ოთ", "ხ", "პ", "შ" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM YYYY HH:mm", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "ძებნა...", + noResults: { + header: "მონაცემები არ მოიძებნა", + message: "თქვენმა ძებნამ არ დააბრუნა შედეგი." + } + }, + select: { + noResultsMessage: "მონაცემები არ მოიძებნა", + single: { + placeholder: "აირჩიე" + }, + multi: { + placeholder: "აირჩიე...", + maxSelectedMessage: "მაქსიმუმ #{max}", + selectedMessage: "არჩეულია #{count}" + } + } +}; +export default ge; +//# sourceMappingURL=ge.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/ge.js.map b/dist/behaviors/localization/locales/ge.js.map new file mode 100644 index 000000000..a648c8061 --- /dev/null +++ b/dist/behaviors/localization/locales/ge.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ge.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/ge.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ;YAC5D,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW;SAC1E;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK;SACtF;QACD,QAAQ,EAAE;YACN,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ;SACpF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAChD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACtC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE;YACP,MAAM,EAAE,wBAAwB;YAChC,OAAO,EAAE,oCAAoC;SAChD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,wBAAwB;QAC1C,MAAM,EAAE;YACJ,WAAW,EAAE,QAAQ;SACxB;QACD,KAAK,EAAE;YACH,WAAW,EAAE,WAAW;YACxB,kBAAkB,EAAE,iBAAiB;YACrC,eAAe,EAAE,mBAAmB;SACvC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Georgian (ge)\n * author : Vaso Gazdeliani : https://github.com/vaso991\n */\n\nconst ge:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"იანვარი\", \"თებერვალი\", \"მარტი\", \"აპრილი\", \"მაისი\", \"ივნისი\",\n \"ივლისი\", \"აგვისტო\", \"სექტემბერი\", \"ოქტომბერი\", \"ნოემბერი\", \"დეკემბერი\"\n ],\n monthsShort: [\n \"იან\", \"თებ\", \"მარ\", \"აპრ\", \"მაი\", \"ივნ\", \"ივლ\", \"აგვ\", \"სექ\", \"ოქტ\", \"ნოემ\", \"დეკ\"\n ],\n weekdays: [\n \"კვირა\", \"ორშაბათი\", \"სამშაბათი\", \"ოთხშაბათი\", \"ხუთშაბათი\", \"პარასკევი\", \"შაბათი\"\n ],\n weekdaysShort: [\n \"კვ\", \"ორ\", \"სამ\", \"ოთხ\", \"ხუთ\", \"პარ\", \"შაბ\"\n ],\n weekdaysNarrow: [\n \"კ\", \"ორ\", \"ს\", \"ოთ\", \"ხ\", \"პ\", \"შ\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"ძებნა...\",\n noResults: {\n header: \"მონაცემები არ მოიძებნა\",\n message: \"თქვენმა ძებნამ არ დააბრუნა შედეგი.\"\n }\n },\n select: {\n noResultsMessage: \"მონაცემები არ მოიძებნა\",\n single: {\n placeholder: \"აირჩიე\"\n },\n multi: {\n placeholder: \"აირჩიე...\",\n maxSelectedMessage: \"მაქსიმუმ #{max}\",\n selectedMessage: \"არჩეულია #{count}\"\n }\n }\n};\n\nexport default ge;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/he.d.ts b/dist/behaviors/localization/locales/he.d.ts new file mode 100644 index 000000000..5857c35a4 --- /dev/null +++ b/dist/behaviors/localization/locales/he.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../interfaces/values"; +/** + * locale : Hebrew (he) + * author : David limkys : https://github.com/gotenxds + */ +declare const he: IPartialLocaleValues; +export default he; diff --git a/dist/behaviors/localization/locales/he.js b/dist/behaviors/localization/locales/he.js new file mode 100644 index 000000000..08eda8755 --- /dev/null +++ b/dist/behaviors/localization/locales/he.js @@ -0,0 +1,51 @@ +/** + * locale : Hebrew (he) + * author : David limkys : https://github.com/gotenxds + */ +var he = { + datepicker: { + months: [ + "ינואר", "פבואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר" + ], + monthsShort: [ + "ינו", "פבו", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ" + ], + weekdays: [ + "ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת" + ], + weekdaysShort: [ + "ראש", "שני", "שלי", "רבי", "חמי", "שיש", "שבת" + ], + weekdaysNarrow: [ + "ר", "ש", "ש", "ר", "ח", "ש", "ש" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM YYYY HH:mm", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 0 + }, + search: { + placeholder: "חפש...", + noResults: { + header: "אין תוצאות", + message: "החיפוש שלך לא אחזיר תוצאות." + } + }, + select: { + noResultsMessage: "אין תוצאות", + single: { + placeholder: "בחר אחד" + }, + multi: { + placeholder: "בחר...", + maxSelectedMessage: "מקסימום #{max} אפשרויות", + selectedMessage: "#{count} selections" + } + } +}; +export default he; +//# sourceMappingURL=he.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/he.js.map b/dist/behaviors/localization/locales/he.js.map new file mode 100644 index 000000000..6bc955dd6 --- /dev/null +++ b/dist/behaviors/localization/locales/he.js.map @@ -0,0 +1 @@ +{"version":3,"file":"he.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/he.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO;SAC5G;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK;SAC3D;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,QAAQ;QACrB,SAAS,EAAE;YACP,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,6BAA6B;SACzC;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,YAAY;QAC9B,MAAM,EAAE;YACJ,WAAW,EAAE,SAAS;SACzB;QACD,KAAK,EAAE;YACH,WAAW,EAAE,QAAQ;YACrB,kBAAkB,EAAE,yBAAyB;YAC7C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Hebrew (he)\n * author : David limkys : https://github.com/gotenxds\n */\n\nconst he:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"ינואר\", \"פבואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"\n ],\n monthsShort: [\n \"ינו\", \"פבו\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"\n ],\n weekdays: [\n \"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"\n ],\n weekdaysShort: [\n \"ראש\", \"שני\", \"שלי\", \"רבי\", \"חמי\", \"שיש\", \"שבת\"\n ],\n weekdaysNarrow: [\n \"ר\", \"ש\", \"ש\", \"ר\", \"ח\", \"ש\", \"ש\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 0\n },\n search: {\n placeholder: \"חפש...\",\n noResults: {\n header: \"אין תוצאות\",\n message: \"החיפוש שלך לא אחזיר תוצאות.\"\n }\n },\n select: {\n noResultsMessage: \"אין תוצאות\",\n single: {\n placeholder: \"בחר אחד\"\n },\n multi: {\n placeholder: \"בחר...\",\n maxSelectedMessage: \"מקסימום #{max} אפשרויות\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default he;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/index.d.ts b/dist/behaviors/localization/locales/index.d.ts new file mode 100644 index 000000000..7e332a61d --- /dev/null +++ b/dist/behaviors/localization/locales/index.d.ts @@ -0,0 +1,16 @@ +import { RecursivePartial, ILocaleValues } from "../interfaces/values"; +declare const _default: { + de: RecursivePartial; + enAU: RecursivePartial; + enGB: ILocaleValues; + enUS: RecursivePartial; + es: RecursivePartial; + it: RecursivePartial; + fr: RecursivePartial; + pt: RecursivePartial; + ru: RecursivePartial; + he: RecursivePartial; + ge: RecursivePartial; + nl: RecursivePartial; +}; +export default _default; diff --git a/dist/behaviors/localization/locales/index.js b/dist/behaviors/localization/locales/index.js new file mode 100644 index 000000000..ecf35198a --- /dev/null +++ b/dist/behaviors/localization/locales/index.js @@ -0,0 +1,27 @@ +import de from "./de"; +import enAU from "./en-AU"; +import enGB from "./en-GB"; +import enUS from "./en-US"; +import es from "./es"; +import fr from "./fr"; +import pt from "./pt"; +import it from "./it"; +import ru from "./ru"; +import he from "./he"; +import ge from "./ge"; +import nl from "./nl"; +export default { + de: de, + enAU: enAU, + enGB: enGB, + enUS: enUS, + es: es, + it: it, + fr: fr, + pt: pt, + ru: ru, + he: he, + ge: ge, + nl: nl +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/index.js.map b/dist/behaviors/localization/locales/index.js.map new file mode 100644 index 000000000..c19fbd7d6 --- /dev/null +++ b/dist/behaviors/localization/locales/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AAGtB,eAAe;IACX,EAAE,IAAA;IACF,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;CACL,CAAC","sourcesContent":["import { RecursivePartial, ILocaleValues } from \"../interfaces/values\";\n\nimport de from \"./de\";\nimport enAU from \"./en-AU\";\nimport enGB from \"./en-GB\";\nimport enUS from \"./en-US\";\nimport es from \"./es\";\nimport fr from \"./fr\";\nimport pt from \"./pt\";\nimport it from \"./it\";\nimport ru from \"./ru\";\nimport he from \"./he\";\nimport ge from \"./ge\";\nimport nl from \"./nl\";\n\n// This file exists for the demo app. Don't use this in real life.\nexport default {\n de,\n enAU,\n enGB,\n enUS,\n es,\n it,\n fr,\n pt,\n ru,\n he,\n ge,\n nl\n};\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/it.d.ts b/dist/behaviors/localization/locales/it.d.ts new file mode 100644 index 000000000..9f4a18c6e --- /dev/null +++ b/dist/behaviors/localization/locales/it.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../interfaces/values"; +/** + * locale : Italian (it) + * author : Massimo Costa : https://github.com/mcosta74 + */ +declare const it: IPartialLocaleValues; +export default it; diff --git a/dist/behaviors/localization/locales/it.js b/dist/behaviors/localization/locales/it.js new file mode 100644 index 000000000..7773f624f --- /dev/null +++ b/dist/behaviors/localization/locales/it.js @@ -0,0 +1,51 @@ +/** + * locale : Italian (it) + * author : Massimo Costa : https://github.com/mcosta74 + */ +var it = { + datepicker: { + months: [ + "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" + ], + monthsShort: [ + "Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic" + ], + weekdays: [ + "Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato" + ], + weekdaysShort: [ + "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" + ], + weekdaysNarrow: [ + "D", "L", "M", "M", "G", "V", "S" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM YYYY HH:mm", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Cerca...", + noResults: { + header: "Nessun risultato", + message: "La tua ricerca non ha trovato risultati." + } + }, + select: { + noResultsMessage: "Nessun risultato", + single: { + placeholder: "Scegli uno" + }, + multi: { + placeholder: "Scegli...", + maxSelectedMessage: "Puoi effettuare fino a #{max} scelte.", + selectedMessage: "#{count} scelte" + } + } +}; +export default it; +//# sourceMappingURL=it.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/it.js.map b/dist/behaviors/localization/locales/it.js.map new file mode 100644 index 000000000..02d505ecc --- /dev/null +++ b/dist/behaviors/localization/locales/it.js.map @@ -0,0 +1 @@ +{"version":3,"file":"it.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/it.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SACnI;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ;SAC/E;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,OAAO,EAAE,0CAA0C;SACtD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,kBAAkB;QACpC,MAAM,EAAE;YACJ,WAAW,EAAE,YAAY;SAC5B;QACD,KAAK,EAAE;YACH,WAAW,EAAE,WAAW;YACxB,kBAAkB,EAAE,uCAAuC;YAC3D,eAAe,EAAE,iBAAiB;SACrC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Italian (it)\n * author : Massimo Costa : https://github.com/mcosta74\n */\n\nconst it:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"\n ],\n monthsShort: [\n \"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"\n ],\n weekdays: [\n \"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"\n ],\n weekdaysShort: [\n \"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"\n ],\n weekdaysNarrow: [\n \"D\", \"L\", \"M\", \"M\", \"G\", \"V\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Cerca...\",\n noResults: {\n header: \"Nessun risultato\",\n message: \"La tua ricerca non ha trovato risultati.\"\n }\n },\n select: {\n noResultsMessage: \"Nessun risultato\",\n single: {\n placeholder: \"Scegli uno\"\n },\n multi: {\n placeholder: \"Scegli...\",\n maxSelectedMessage: \"Puoi effettuare fino a #{max} scelte.\",\n selectedMessage: \"#{count} scelte\"\n }\n }\n};\n\nexport default it;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/nl.d.ts b/dist/behaviors/localization/locales/nl.d.ts new file mode 100644 index 000000000..25ff660ce --- /dev/null +++ b/dist/behaviors/localization/locales/nl.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../interfaces/values"; +/** + * locale : Dutch (nl) + * author : Martijn Melchers : https://github.com/martijnmelchers + */ +declare const nl: IPartialLocaleValues; +export default nl; diff --git a/dist/behaviors/localization/locales/nl.js b/dist/behaviors/localization/locales/nl.js new file mode 100644 index 000000000..3502ed1a8 --- /dev/null +++ b/dist/behaviors/localization/locales/nl.js @@ -0,0 +1,61 @@ +/** + * locale : Dutch (nl) + * author : Martijn Melchers : https://github.com/martijnmelchers + */ +var nl = { + datepicker: { + months: [ + "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December" + ], + monthsShort: [ + "Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec" + ], + weekdays: [ + "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag" + ], + weekdaysShort: [ + "Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za" + ], + weekdaysNarrow: [ + "Z", "M", "D", "W", "D", "V", "Z" + ], + /* Dutch does not have a translation for am/pm */ + timesOfDay: [ + "a.m.", "p.m." + ], + timesOfDayUppercase: [ + "AM", "PM" + ], + timesOfDayLowercase: [ + "am", "pm" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM YYYY HH:mm", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Zoeken...", + noResults: { + header: "Geen resultaten", + message: "Er zijn geen resultaten gevonden." + } + }, + select: { + noResultsMessage: "Geen resultation", + single: { + placeholder: "Selecteer een" + }, + multi: { + placeholder: "Selecteren...", + maxSelectedMessage: "Max #{max} selecteren", + selectedMessage: "#{count} geselecteerd" + } + } +}; +export default nl; +//# sourceMappingURL=nl.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/nl.js.map b/dist/behaviors/localization/locales/nl.js.map new file mode 100644 index 000000000..519646049 --- /dev/null +++ b/dist/behaviors/localization/locales/nl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nl.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/nl.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SAC7H;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU;SACjF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;;QAED,UAAU,EAAE;YACR,MAAM,EAAE,MAAM;SACjB;QACD,mBAAmB,EAAE;YACjB,IAAI,EAAE,IAAI;SACb;QACD,mBAAmB,EAAE;YACjB,IAAI,EAAE,IAAI;SACb;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE;YACP,MAAM,EAAE,iBAAiB;YACzB,OAAO,EAAE,mCAAmC;SAC/C;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,kBAAkB;QACpC,MAAM,EAAE;YACJ,WAAW,EAAE,eAAe;SAC/B;QACD,KAAK,EAAE;YACH,WAAW,EAAE,eAAe;YAC5B,kBAAkB,EAAE,uBAAuB;YAC3C,eAAe,EAAE,uBAAuB;SAC3C;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Dutch (nl)\n * author : Martijn Melchers : https://github.com/martijnmelchers\n */\n\nconst nl:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"\n ],\n monthsShort: [\n \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"\n ],\n weekdays: [\n \"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"\n ],\n weekdaysShort: [\n \"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"\n ],\n weekdaysNarrow: [\n \"Z\", \"M\", \"D\", \"W\", \"D\", \"V\", \"Z\"\n ],\n\t\t/* Dutch does not have a translation for am/pm */\n timesOfDay: [\n \"a.m.\", \"p.m.\"\n ],\n timesOfDayUppercase: [\n \"AM\", \"PM\"\n ],\n timesOfDayLowercase: [\n \"am\", \"pm\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Zoeken...\",\n noResults: {\n header: \"Geen resultaten\",\n message: \"Er zijn geen resultaten gevonden.\"\n }\n },\n select: {\n noResultsMessage: \"Geen resultation\",\n single: {\n placeholder: \"Selecteer een\"\n },\n multi: {\n placeholder: \"Selecteren...\",\n maxSelectedMessage: \"Max #{max} selecteren\",\n selectedMessage: \"#{count} geselecteerd\"\n }\n }\n};\n\nexport default nl;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/pt.d.ts b/dist/behaviors/localization/locales/pt.d.ts new file mode 100644 index 000000000..83a63f0d9 --- /dev/null +++ b/dist/behaviors/localization/locales/pt.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../interfaces/values"; +/** + * locale : Portuguese (pt) + * author : Fernando Niwes : https://github.com/fniwes + */ +declare const pt: IPartialLocaleValues; +export default pt; diff --git a/dist/behaviors/localization/locales/pt.js b/dist/behaviors/localization/locales/pt.js new file mode 100644 index 000000000..e925bfd10 --- /dev/null +++ b/dist/behaviors/localization/locales/pt.js @@ -0,0 +1,51 @@ +/** + * locale : Portuguese (pt) + * author : Fernando Niwes : https://github.com/fniwes + */ +var pt = { + datepicker: { + months: [ + "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro" + ], + monthsShort: [ + "jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez" + ], + weekdays: [ + "Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado" + ], + weekdaysShort: [ + "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" + ], + weekdaysNarrow: [ + "D", "1", "2", "3", "4", "5", "S" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM [de] YYYY HH:mm", + date: "D [de] MMMM [de] YYYY", + month: "MMMM [de] YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Pesquisar...", + noResults: { + header: "Sem resultados", + message: "Sua pesquisa não retornou resultados." + } + }, + select: { + noResultsMessage: "Sem resultados", + single: { + placeholder: "Escolha uma opção" + }, + multi: { + placeholder: "Escolher...", + maxSelectedMessage: "Max #{max} opçãoes", + selectedMessage: "#{count} selections" + } + } +}; +export default pt; +//# sourceMappingURL=pt.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/pt.js.map b/dist/behaviors/localization/locales/pt.js.map new file mode 100644 index 000000000..b43494bfd --- /dev/null +++ b/dist/behaviors/localization/locales/pt.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/pt.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SAC9H;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ;SACvE;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,wBAAwB;YAClC,IAAI,EAAE,uBAAuB;YAC7B,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,cAAc;QAC3B,SAAS,EAAE;YACP,MAAM,EAAE,gBAAgB;YACxB,OAAO,EAAE,uCAAuC;SACnD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,gBAAgB;QAClC,MAAM,EAAE;YACJ,WAAW,EAAE,mBAAmB;SACnC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,aAAa;YAC1B,kBAAkB,EAAE,oBAAoB;YACxC,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Portuguese (pt)\n * author : Fernando Niwes : https://github.com/fniwes\n */\n\nconst pt:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"janeiro\", \"fevereiro\", \"março\", \"abril\", \"maio\", \"junho\", \"julho\", \"agosto\", \"setembro\", \"outubro\", \"novembro\", \"dezembro\"\n ],\n monthsShort: [\n \"jan\", \"fev\", \"mar\", \"abr\", \"mai\", \"jun\", \"jul\", \"ago\", \"set\", \"out\", \"nov\", \"dez\"\n ],\n weekdays: [\n \"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"\n ],\n weekdaysShort: [\n \"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"\n ],\n weekdaysNarrow: [\n \"D\", \"1\", \"2\", \"3\", \"4\", \"5\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM [de] YYYY HH:mm\",\n date: \"D [de] MMMM [de] YYYY\",\n month: \"MMMM [de] YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Pesquisar...\",\n noResults: {\n header: \"Sem resultados\",\n message: \"Sua pesquisa não retornou resultados.\"\n }\n },\n select: {\n noResultsMessage: \"Sem resultados\",\n single: {\n placeholder: \"Escolha uma opção\"\n },\n multi: {\n placeholder: \"Escolher...\",\n maxSelectedMessage: \"Max #{max} opçãoes\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default pt;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/ru.d.ts b/dist/behaviors/localization/locales/ru.d.ts new file mode 100644 index 000000000..395f86b38 --- /dev/null +++ b/dist/behaviors/localization/locales/ru.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../interfaces/values"; +/** + * locale : Russian (ru) + * author : Maksim Moiseikin : https://github.com/maksim-m + */ +declare const ru: IPartialLocaleValues; +export default ru; diff --git a/dist/behaviors/localization/locales/ru.js b/dist/behaviors/localization/locales/ru.js new file mode 100644 index 000000000..c06c2847a --- /dev/null +++ b/dist/behaviors/localization/locales/ru.js @@ -0,0 +1,51 @@ +/** + * locale : Russian (ru) + * author : Maksim Moiseikin : https://github.com/maksim-m + */ +var ru = { + datepicker: { + months: [ + "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" + ], + monthsShort: [ + "Янв", "Февр", "Март", "Апр", "Май", "Июнь", "Июль", "Авг", "Сент", "Окт", "Ноя", "Дек" + ], + weekdays: [ + "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота" + ], + weekdaysShort: [ + "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" + ], + weekdaysNarrow: [ + "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" + ], + formats: { + time: "HH:mm", + datetime: "DD.MM.YYYY HH:mm", + date: "DD.MM.YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Поиск...", + noResults: { + header: "Нет результатов", + message: "Поиск не дал результатов." + } + }, + select: { + noResultsMessage: "Нет результатов", + single: { + placeholder: "Выберите одно значение" + }, + multi: { + placeholder: "Выберите...", + maxSelectedMessage: "Не более #{max} значений", + selectedMessage: "#{count} selections" + } + } +}; +export default ru; +//# sourceMappingURL=ru.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/ru.js.map b/dist/behaviors/localization/locales/ru.js.map new file mode 100644 index 000000000..8908bf702 --- /dev/null +++ b/dist/behaviors/localization/locales/ru.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ru.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/ru.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS;SACrH;QACD,WAAW,EAAE;YACT,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAC1F;QACD,QAAQ,EAAE;YACN,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;SACpF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,cAAc,EAAE;YACZ,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,kBAAkB;YAC5B,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE;YACP,MAAM,EAAE,iBAAiB;YACzB,OAAO,EAAE,2BAA2B;SACvC;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,iBAAiB;QACnC,MAAM,EAAE;YACJ,WAAW,EAAE,wBAAwB;SACxC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,aAAa;YAC1B,kBAAkB,EAAE,0BAA0B;YAC9C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Russian (ru)\n * author : Maksim Moiseikin : https://github.com/maksim-m\n */\n\nconst ru:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Май\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Октябрь\", \"Ноябрь\", \"Декабрь\"\n ],\n monthsShort: [\n \"Янв\", \"Февр\", \"Март\", \"Апр\", \"Май\", \"Июнь\", \"Июль\", \"Авг\", \"Сент\", \"Окт\", \"Ноя\", \"Дек\"\n ],\n weekdays: [\n \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"\n ],\n weekdaysShort: [\n \"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"\n ],\n weekdaysNarrow: [\n \"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"DD.MM.YYYY HH:mm\",\n date: \"DD.MM.YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Поиск...\",\n noResults: {\n header: \"Нет результатов\",\n message: \"Поиск не дал результатов.\"\n }\n },\n select: {\n noResultsMessage: \"Нет результатов\",\n single: {\n placeholder: \"Выберите одно значение\"\n },\n multi: {\n placeholder: \"Выберите...\",\n maxSelectedMessage: \"Не более #{max} значений\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default ru;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/localization.module.d.ts b/dist/behaviors/localization/localization.module.d.ts new file mode 100644 index 000000000..52e6a5cf5 --- /dev/null +++ b/dist/behaviors/localization/localization.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiLocalizationModule { +} diff --git a/dist/behaviors/localization/localization.module.js b/dist/behaviors/localization/localization.module.js new file mode 100644 index 000000000..9e477cd33 --- /dev/null +++ b/dist/behaviors/localization/localization.module.js @@ -0,0 +1,18 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiLocalizationService } from "./services/localization.service"; +var SuiLocalizationModule = /** @class */ (function () { + function SuiLocalizationModule() { + } + SuiLocalizationModule.decorators = [ + { type: NgModule, args: [{ + imports: [CommonModule], + providers: [SuiLocalizationService] + },] }, + ]; + /** @nocollapse */ + SuiLocalizationModule.ctorParameters = function () { return []; }; + return SuiLocalizationModule; +}()); +export { SuiLocalizationModule }; +//# sourceMappingURL=localization.module.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/localization.module.js.map b/dist/behaviors/localization/localization.module.js.map new file mode 100644 index 000000000..09caf032a --- /dev/null +++ b/dist/behaviors/localization/localization.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"localization.module.js","sourceRoot":"","sources":["../../../src/behaviors/localization/localization.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;;;;;gBAExE,QAAQ,SAAC;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,SAAS,EAAE,CAAC,sBAAsB,CAAC;iBACtC;;;;gCARD;;SASa,qBAAqB","sourcesContent":["\nimport { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiLocalizationService } from \"./services/localization.service\";\n\n@NgModule({\n imports: [CommonModule],\n providers: [SuiLocalizationService]\n})\nexport class SuiLocalizationModule {}\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/localization.module.metadata.json b/dist/behaviors/localization/localization.module.metadata.json new file mode 100644 index 000000000..d7d014dfa --- /dev/null +++ b/dist/behaviors/localization/localization.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiLocalizationModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":14}],"providers":[{"__symbolic":"reference","module":"./services/localization.service","name":"SuiLocalizationService","line":7,"character":16}]}]}]}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/public.d.ts b/dist/behaviors/localization/public.d.ts new file mode 100644 index 000000000..c3de32328 --- /dev/null +++ b/dist/behaviors/localization/public.d.ts @@ -0,0 +1,2 @@ +export * from "./interfaces/values"; +export { SuiLocalizationModule, SuiLocalizationService } from "./index"; diff --git a/dist/behaviors/localization/public.js b/dist/behaviors/localization/public.js new file mode 100644 index 000000000..4a6c6e1c4 --- /dev/null +++ b/dist/behaviors/localization/public.js @@ -0,0 +1,2 @@ +export { SuiLocalizationModule, SuiLocalizationService } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/public.js.map b/dist/behaviors/localization/public.js.map new file mode 100644 index 000000000..5ecc350ea --- /dev/null +++ b/dist/behaviors/localization/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/behaviors/localization/public.ts"],"names":[],"mappings":"AACA,OAAO,EACH,qBAAqB,EACrB,sBAAsB,EACzB,MAAM,SAAS,CAAC","sourcesContent":["export * from \"./interfaces/values\";\nexport {\n SuiLocalizationModule,\n SuiLocalizationService\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/public.metadata.json b/dist/behaviors/localization/public.metadata.json new file mode 100644 index 000000000..392a7fb66 --- /dev/null +++ b/dist/behaviors/localization/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./interfaces/values"},{"from":"./index","export":["SuiLocalizationModule","SuiLocalizationService"]}]}] \ No newline at end of file diff --git a/dist/behaviors/localization/services/localization.service.d.ts b/dist/behaviors/localization/services/localization.service.d.ts new file mode 100644 index 000000000..dcd47d878 --- /dev/null +++ b/dist/behaviors/localization/services/localization.service.d.ts @@ -0,0 +1,16 @@ +import { EventEmitter } from "@angular/core"; +import { ILocaleValues, IPartialLocaleValues, RecursivePartial } from "../interfaces/values"; +export declare class SuiLocalizationService { + private _language; + private _fallbackValues; + private _values; + readonly language: string; + onLanguageUpdate: EventEmitter; + constructor(); + setLanguage(language: string): void; + get(language?: string): ILocaleValues; + override(values: ILocaleValues[T], overrides: RecursivePartial): ILocaleValues[T]; + load(language: string, values: IPartialLocaleValues): void; + patch(language: string, values: IPartialLocaleValues): void; + interpolate(value: string, variables: [string, string][]): string; +} diff --git a/dist/behaviors/localization/services/localization.service.js b/dist/behaviors/localization/services/localization.service.js new file mode 100644 index 000000000..76fc9aa5e --- /dev/null +++ b/dist/behaviors/localization/services/localization.service.js @@ -0,0 +1,69 @@ +import { Injectable, EventEmitter } from "@angular/core"; +import enGB from "../locales/en-GB"; +import * as $extend from "extend"; +function deepClone(obj) { + return JSON.parse(JSON.stringify(obj)); +} +function deepExtend(target, source) { + // Rollup... + var extend = $extend.default || $extend; + return extend(true, target, source); +} +function lang(language) { + return language.toLowerCase().replace("-", ""); +} +var SuiLocalizationService = /** @class */ (function () { + function SuiLocalizationService() { + this.onLanguageUpdate = new EventEmitter(); + this._fallbackValues = enGB; + this._values = {}; + this._language = "en-GB"; + this.load("en-GB", enGB); + } + Object.defineProperty(SuiLocalizationService.prototype, "language", { + get: function () { + return this._language; + }, + enumerable: true, + configurable: true + }); + SuiLocalizationService.prototype.setLanguage = function (language) { + if (lang(this._language) !== lang(language)) { + this._language = language; + this.onLanguageUpdate.emit(); + } + }; + SuiLocalizationService.prototype.get = function (language) { + if (language === void 0) { language = this.language; } + var values = deepClone(this._fallbackValues); + if (!this._values[lang(language)]) { + throw new Error("Locale " + language + " is not loaded"); + } + deepExtend(values, this._values[lang(language)]); + return deepClone(values); + }; + SuiLocalizationService.prototype.override = function (values, overrides) { + return deepExtend(deepClone(values), overrides); + }; + SuiLocalizationService.prototype.load = function (language, values) { + this._values[lang(language)] = deepClone(values); + this.onLanguageUpdate.emit(); + }; + SuiLocalizationService.prototype.patch = function (language, values) { + deepExtend(this._values[lang(language)], values); + }; + SuiLocalizationService.prototype.interpolate = function (value, variables) { + return variables.reduce(function (s, _a) { + var k = _a[0], v = _a[1]; + return s.replace(new RegExp("#{" + k + "}", "g"), v); + }, value); + }; + SuiLocalizationService.decorators = [ + { type: Injectable }, + ]; + /** @nocollapse */ + SuiLocalizationService.ctorParameters = function () { return []; }; + return SuiLocalizationService; +}()); +export { SuiLocalizationService }; +//# sourceMappingURL=localization.service.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/services/localization.service.js.map b/dist/behaviors/localization/services/localization.service.js.map new file mode 100644 index 000000000..e3602a8be --- /dev/null +++ b/dist/behaviors/localization/services/localization.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"localization.service.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/services/localization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":["import { Injectable, EventEmitter } from \"@angular/core\";\nimport { ILocaleValues, IPartialLocaleValues, RecursivePartial } from \"../interfaces/values\";\nimport enGB from \"../locales/en-GB\";\nimport * as $extend from \"extend\";\n\nfunction deepClone(obj:T):T {\n return JSON.parse(JSON.stringify(obj));\n}\n\nfunction deepExtend(target:T, source:U):T & U {\n // Rollup...\n const extend = ($extend as any).default || $extend;\n return extend(true, target, source);\n}\n\nfunction lang(language:string):string {\n return language.toLowerCase().replace(\"-\", \"\");\n}\n\ninterface ILocalizationValuesContainer {\n [name:string]:IPartialLocaleValues;\n}\n\n@Injectable()\nexport class SuiLocalizationService {\n private _language:string;\n\n private _fallbackValues:ILocaleValues;\n private _values:ILocalizationValuesContainer;\n\n public get language():string {\n return this._language;\n }\n\n public onLanguageUpdate:EventEmitter;\n\n constructor() {\n this.onLanguageUpdate = new EventEmitter();\n\n this._fallbackValues = enGB;\n this._values = {};\n this._language = \"en-GB\";\n this.load(\"en-GB\", enGB);\n }\n\n public setLanguage(language:string):void {\n if (lang(this._language) !== lang(language)) {\n this._language = language;\n this.onLanguageUpdate.emit();\n }\n }\n\n public get(language:string = this.language):ILocaleValues {\n const values = deepClone(this._fallbackValues);\n if (!this._values[lang(language)]) {\n throw new Error(`Locale ${language} is not loaded`);\n }\n deepExtend(values, this._values[lang(language)]);\n return deepClone(values);\n }\n\n public override(\n values:ILocaleValues[T],\n overrides:RecursivePartial\n ):ILocaleValues[T] {\n return deepExtend(deepClone(values), overrides);\n }\n\n public load(language:string, values:IPartialLocaleValues):void {\n this._values[lang(language)] = deepClone(values);\n this.onLanguageUpdate.emit();\n }\n\n public patch(language:string, values:IPartialLocaleValues):void {\n deepExtend(this._values[lang(language)], values);\n }\n\n public interpolate(value:string, variables:[string, string][]):string {\n return variables.reduce((s, [k, v]) => s.replace(new RegExp(`#{${k}}`, \"g\"), v), value);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/services/localization.service.metadata.json b/dist/behaviors/localization/services/localization.service.metadata.json new file mode 100644 index 000000000..535d2f5fb --- /dev/null +++ b/dist/behaviors/localization/services/localization.service.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiLocalizationService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":23,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"setLanguage":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"override":[{"__symbolic":"method"}],"load":[{"__symbolic":"method"}],"patch":[{"__symbolic":"method"}],"interpolate":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/behaviors/public.d.ts b/dist/behaviors/public.d.ts new file mode 100644 index 000000000..fd8cf9a43 --- /dev/null +++ b/dist/behaviors/public.d.ts @@ -0,0 +1 @@ +export * from "./localization/public"; diff --git a/dist/behaviors/public.js b/dist/behaviors/public.js new file mode 100644 index 000000000..ebd79f4bc --- /dev/null +++ b/dist/behaviors/public.js @@ -0,0 +1,2 @@ +export * from "./localization/public"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/behaviors/public.js.map b/dist/behaviors/public.js.map new file mode 100644 index 000000000..e94e9bbc9 --- /dev/null +++ b/dist/behaviors/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/behaviors/public.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC","sourcesContent":["export * from \"./localization/public\";\n"]} \ No newline at end of file diff --git a/dist/behaviors/public.metadata.json b/dist/behaviors/public.metadata.json new file mode 100644 index 000000000..d2d3fb878 --- /dev/null +++ b/dist/behaviors/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./localization/public"}]}] \ No newline at end of file diff --git a/dist/collections/index.d.ts b/dist/collections/index.d.ts new file mode 100644 index 000000000..6ea9faf05 --- /dev/null +++ b/dist/collections/index.d.ts @@ -0,0 +1,2 @@ +export * from "./message/index"; +export * from "./pagination/index"; diff --git a/dist/collections/index.js b/dist/collections/index.js new file mode 100644 index 000000000..01971a150 --- /dev/null +++ b/dist/collections/index.js @@ -0,0 +1,3 @@ +export * from "./message/index"; +export * from "./pagination/index"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/collections/index.js.map b/dist/collections/index.js.map new file mode 100644 index 000000000..94a0942eb --- /dev/null +++ b/dist/collections/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./message/index\";\nexport * from \"./pagination/index\";\n"]} \ No newline at end of file diff --git a/dist/collections/index.metadata.json b/dist/collections/index.metadata.json new file mode 100644 index 000000000..99ee2e86b --- /dev/null +++ b/dist/collections/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./message/index"},{"from":"./pagination/index"}]}] \ No newline at end of file diff --git a/dist/collections/message/components/message.d.ts b/dist/collections/message/components/message.d.ts new file mode 100644 index 000000000..76b3bce61 --- /dev/null +++ b/dist/collections/message/components/message.d.ts @@ -0,0 +1,16 @@ +import { EventEmitter } from "@angular/core"; +import { TransitionController } from "../../../modules/transition/index"; +export interface IMessage { + dismiss(): void; +} +export declare class SuiMessage implements IMessage { + isDismissable: boolean; + onDismiss: EventEmitter; + isDismissed: boolean; + transitionController: TransitionController; + transition: string; + transitionDuration: number; + class: string; + constructor(); + dismiss(): void; +} diff --git a/dist/collections/message/components/message.js b/dist/collections/message/components/message.js new file mode 100644 index 000000000..01b4e3de4 --- /dev/null +++ b/dist/collections/message/components/message.js @@ -0,0 +1,39 @@ +import { Component, Input, Output, EventEmitter } from "@angular/core"; +import { TransitionController, Transition, TransitionDirection } from "../../../modules/transition/index"; +var SuiMessage = /** @class */ (function () { + function SuiMessage() { + this.isDismissable = true; + this.onDismiss = new EventEmitter(); + this.isDismissed = false; + this.transitionController = new TransitionController(); + this.transition = "fade"; + this.transitionDuration = 300; + this.class = ""; + } + SuiMessage.prototype.dismiss = function () { + var _this = this; + this.transitionController.animate(new Transition(this.transition, this.transitionDuration, TransitionDirection.Out, function () { + _this.isDismissed = true; + _this.onDismiss.emit(_this); + })); + }; + SuiMessage.decorators = [ + { type: Component, args: [{ + selector: "sui-message", + template: "\n
\n \n \n
\n", + styles: ["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiMessage.ctorParameters = function () { return []; }; + SuiMessage.propDecorators = { + "isDismissable": [{ type: Input },], + "onDismiss": [{ type: Output, args: ["dismiss",] },], + "transition": [{ type: Input },], + "transitionDuration": [{ type: Input },], + "class": [{ type: Input, args: ["class",] },], + }; + return SuiMessage; +}()); +export { SuiMessage }; +//# sourceMappingURL=message.js.map \ No newline at end of file diff --git a/dist/collections/message/components/message.js.map b/dist/collections/message/components/message.js.map new file mode 100644 index 000000000..5d47d1766 --- /dev/null +++ b/dist/collections/message/components/message.js.map @@ -0,0 +1 @@ +{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../src/collections/message/components/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;;IAyCtG;QACI,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAc,CAAC;QAEhD,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAEzB,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACvD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC;QAE9B,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;KACnB;IAEM,4BAAO,GAAd;QAAA,iBAKC;QAJG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,GAAG,EAAE;YAChH,KAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;SAC7B,CAAC,CAAC,CAAC;KACP;;gBArDJ,SAAS,SAAC;oBACP,QAAQ,EAAE,aAAa;oBACvB,QAAQ,EAAE,mOAKb;oBACG,MAAM,EAAE,CAAC,yFAKZ,CAAC;iBACD;;;;;kCAEI,KAAK;8BAGL,MAAM,SAAC,SAAS;+BAOhB,KAAK;uCAGL,KAAK;0BAGL,KAAK,SAAC,OAAO;;qBAvClB;;SAsBa,UAAU","sourcesContent":["import { Component, Input, Output, EventEmitter } from \"@angular/core\";\nimport { TransitionController, Transition, TransitionDirection } from \"../../../modules/transition/index\";\n\nexport interface IMessage {\n dismiss():void;\n}\n\n@Component({\n selector: \"sui-message\",\n template: `\n
\n \n \n
\n`,\n styles: [`\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n`]\n})\nexport class SuiMessage implements IMessage {\n @Input()\n public isDismissable:boolean;\n\n @Output(\"dismiss\")\n public onDismiss:EventEmitter;\n\n public isDismissed:boolean;\n\n public transitionController:TransitionController;\n\n @Input()\n public transition:string;\n\n @Input()\n public transitionDuration:number;\n\n @Input(\"class\")\n public class:string;\n\n constructor() {\n this.isDismissable = true;\n this.onDismiss = new EventEmitter();\n\n this.isDismissed = false;\n\n this.transitionController = new TransitionController();\n this.transition = \"fade\";\n this.transitionDuration = 300;\n\n this.class = \"\";\n }\n\n public dismiss():void {\n this.transitionController.animate(new Transition(this.transition, this.transitionDuration, TransitionDirection.Out, () => {\n this.isDismissed = true;\n this.onDismiss.emit(this);\n }));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/collections/message/components/message.metadata.json b/dist/collections/message/components/message.metadata.json new file mode 100644 index 000000000..390b2d775 --- /dev/null +++ b/dist/collections/message/components/message.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"IMessage":{"__symbolic":"interface"},"SuiMessage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":7,"character":1},"arguments":[{"selector":"sui-message","template":"\n
\n \n \n
\n","styles":["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"]}]}],"members":{"isDismissable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":5}}]}],"onDismiss":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":26,"character":5},"arguments":["dismiss"]}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":5}}]}],"class":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":5},"arguments":["class"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"dismiss":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/collections/message/index.d.ts b/dist/collections/message/index.d.ts new file mode 100644 index 000000000..dc2eb4437 --- /dev/null +++ b/dist/collections/message/index.d.ts @@ -0,0 +1,2 @@ +export * from "./components/message"; +export * from "./message.module"; diff --git a/dist/collections/message/index.js b/dist/collections/message/index.js new file mode 100644 index 000000000..90e277c2a --- /dev/null +++ b/dist/collections/message/index.js @@ -0,0 +1,3 @@ +export * from "./components/message"; +export * from "./message.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/collections/message/index.js.map b/dist/collections/message/index.js.map new file mode 100644 index 000000000..a52e4291d --- /dev/null +++ b/dist/collections/message/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/collections/message/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AAErC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from \"./components/message\";\n\nexport * from \"./message.module\";\n"]} \ No newline at end of file diff --git a/dist/collections/message/index.metadata.json b/dist/collections/message/index.metadata.json new file mode 100644 index 000000000..edd21452c --- /dev/null +++ b/dist/collections/message/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/message"},{"from":"./message.module"}]}] \ No newline at end of file diff --git a/dist/collections/message/message.module.d.ts b/dist/collections/message/message.module.d.ts new file mode 100644 index 000000000..83dd26826 --- /dev/null +++ b/dist/collections/message/message.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiMessageModule { +} diff --git a/dist/collections/message/message.module.js b/dist/collections/message/message.module.js new file mode 100644 index 000000000..320fac44d --- /dev/null +++ b/dist/collections/message/message.module.js @@ -0,0 +1,27 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiTransitionModule } from "../../modules/transition/index"; +import { SuiMessage } from "./components/message"; +var SuiMessageModule = /** @class */ (function () { + function SuiMessageModule() { + } + SuiMessageModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule, + SuiTransitionModule + ], + declarations: [ + SuiMessage + ], + exports: [ + SuiMessage + ] + },] }, + ]; + /** @nocollapse */ + SuiMessageModule.ctorParameters = function () { return []; }; + return SuiMessageModule; +}()); +export { SuiMessageModule }; +//# sourceMappingURL=message.module.js.map \ No newline at end of file diff --git a/dist/collections/message/message.module.js.map b/dist/collections/message/message.module.js.map new file mode 100644 index 000000000..17b5a3d62 --- /dev/null +++ b/dist/collections/message/message.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"message.module.js","sourceRoot":"","sources":["../../../src/collections/message/message.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;;;;;gBAEjD,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,mBAAmB;qBACtB;oBACD,YAAY,EAAE;wBACV,UAAU;qBACb;oBACD,OAAO,EAAE;wBACL,UAAU;qBACb;iBACJ;;;;2BAhBD;;SAiBa,gBAAgB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTransitionModule } from \"../../modules/transition/index\";\nimport { SuiMessage } from \"./components/message\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiTransitionModule\n ],\n declarations: [\n SuiMessage\n ],\n exports: [\n SuiMessage\n ]\n})\nexport class SuiMessageModule {}\n"]} \ No newline at end of file diff --git a/dist/collections/message/message.module.metadata.json b/dist/collections/message/message.module.metadata.json new file mode 100644 index 000000000..2f2ac4a0e --- /dev/null +++ b/dist/collections/message/message.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiMessageModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":7,"character":8},{"__symbolic":"reference","module":"../../modules/transition/index","name":"SuiTransitionModule","line":8,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/message","name":"SuiMessage","line":11,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/message","name":"SuiMessage","line":14,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/collections/message/public.d.ts b/dist/collections/message/public.d.ts new file mode 100644 index 000000000..6b81037a1 --- /dev/null +++ b/dist/collections/message/public.d.ts @@ -0,0 +1 @@ +export { SuiMessageModule, IMessage } from "./index"; diff --git a/dist/collections/message/public.js b/dist/collections/message/public.js new file mode 100644 index 000000000..aa4fef653 --- /dev/null +++ b/dist/collections/message/public.js @@ -0,0 +1,2 @@ +export { SuiMessageModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/collections/message/public.js.map b/dist/collections/message/public.js.map new file mode 100644 index 000000000..fb3925c1b --- /dev/null +++ b/dist/collections/message/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/collections/message/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAEnB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiMessageModule,\n IMessage\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/collections/message/public.metadata.json b/dist/collections/message/public.metadata.json new file mode 100644 index 000000000..c1e7ea4eb --- /dev/null +++ b/dist/collections/message/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiMessageModule","IMessage"]}]}] \ No newline at end of file diff --git a/dist/collections/pagination/components/pagination.d.ts b/dist/collections/pagination/components/pagination.d.ts new file mode 100644 index 000000000..61ffa7ab5 --- /dev/null +++ b/dist/collections/pagination/components/pagination.d.ts @@ -0,0 +1,27 @@ +import { OnChanges, EventEmitter } from "@angular/core"; +export declare class SuiPagination implements OnChanges { + private _paginationClasses; + pageCount: number; + pageChange: EventEmitter; + private _maxSize?; + private _collectionSize; + private _page; + private _pages; + private _hasNavigationLinks; + maxSize: number | undefined; + pageSize: number; + collectionSize: number; + hasNavigationLinks: boolean; + hasBoundaryLinks: boolean; + canRotate: boolean; + hasEllipses: boolean; + page: number; + readonly pages: number[]; + constructor(); + hasPrevious(): boolean; + hasNext(): boolean; + setPage(newPage: number): void; + ngOnChanges(): void; + private updatePages(); + private applyPagination(); +} diff --git a/dist/collections/pagination/components/pagination.js b/dist/collections/pagination/components/pagination.js new file mode 100644 index 000000000..18a89250a --- /dev/null +++ b/dist/collections/pagination/components/pagination.js @@ -0,0 +1,148 @@ +import { Component, Input, Output, EventEmitter, HostBinding } from "@angular/core"; +var SuiPagination = /** @class */ (function () { + function SuiPagination() { + this._paginationClasses = true; + this.pageChange = new EventEmitter(); + this.pageSize = 10; + this._page = 1; + this._pages = []; + this.pageCount = 1; + this.hasNavigationLinks = true; + this.hasBoundaryLinks = false; + this.canRotate = false; + this.hasEllipses = true; + } + Object.defineProperty(SuiPagination.prototype, "maxSize", { + get: function () { + return this._maxSize; + }, + set: function (value) { + this._maxSize = (value != undefined) ? Math.max(value, 1) : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPagination.prototype, "collectionSize", { + get: function () { + return this._collectionSize; + }, + set: function (value) { + this._collectionSize = Math.max(value, 0); + this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize)); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPagination.prototype, "hasNavigationLinks", { + get: function () { + var maxSize = this._maxSize || this.pageCount; + return this._hasNavigationLinks || maxSize < this.pageCount; + }, + set: function (value) { + this._hasNavigationLinks = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPagination.prototype, "page", { + get: function () { + return this._page; + }, + set: function (value) { + this.setPage(value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPagination.prototype, "pages", { + get: function () { + return this._pages; + }, + enumerable: true, + configurable: true + }); + // Public methods + // Public methods + SuiPagination.prototype.hasPrevious = + // Public methods + function () { + return this.page > 1; + }; + SuiPagination.prototype.hasNext = function () { + return this.page < this.pageCount; + }; + SuiPagination.prototype.setPage = function (newPage) { + var value = (Number.isInteger(newPage)) ? Math.min(Math.max(newPage, 1), this.pageCount) : 1; + if (value !== this._page) { + this._page = value; + this.pageChange.emit(this._page); + } + }; + // Lifecycle hooks + // Lifecycle hooks + SuiPagination.prototype.ngOnChanges = + // Lifecycle hooks + function () { + this.updatePages(); + }; + // Private methods + // Private methods + SuiPagination.prototype.updatePages = + // Private methods + function () { + this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize)); + var _a = this.applyPagination(), start = _a[0], end = _a[1]; + this._pages = Array(end - start) + .fill(start + 1) + .map(function (s, i) { return s + i; }); + }; + SuiPagination.prototype.applyPagination = function () { + var maxSize = (this.maxSize != undefined) ? Math.min(this.maxSize, this.pageCount) : this.pageCount; + var page = Math.ceil(this.page / maxSize) - 1; + var start = 0; + var end = this.pageCount; + if (this.canRotate) { + var leftOffset = Math.floor(maxSize / 2); + var rightOffset = maxSize % 2 === 0 ? leftOffset - 1 : leftOffset; + if (this.page <= leftOffset) { + end = maxSize; + } + else if (this.pageCount - this.page < leftOffset) { + start = this.pageCount - maxSize; + } + else { + start = this.page - leftOffset - 1; + end = this.page + rightOffset; + } + } + else { + start = page * maxSize; + end = start + maxSize; + } + return [start, Math.min(end, this.pageCount)]; + }; + SuiPagination.decorators = [ + { type: Component, args: [{ + selector: "sui-pagination", + template: "\n\n \n\n\n \n\n\n \n 1\n \n 2\">...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n", + styles: ["\n:host .item {\n transition: none;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiPagination.ctorParameters = function () { return []; }; + SuiPagination.propDecorators = { + "_paginationClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.pagination",] }, { type: HostBinding, args: ["class.menu",] },], + "pageChange": [{ type: Output },], + "maxSize": [{ type: Input },], + "pageSize": [{ type: Input },], + "collectionSize": [{ type: Input },], + "hasNavigationLinks": [{ type: Input },], + "hasBoundaryLinks": [{ type: Input },], + "canRotate": [{ type: Input },], + "hasEllipses": [{ type: Input },], + "page": [{ type: Input },], + }; + return SuiPagination; +}()); +export { SuiPagination }; +//# sourceMappingURL=pagination.js.map \ No newline at end of file diff --git a/dist/collections/pagination/components/pagination.js.map b/dist/collections/pagination/components/pagination.js.map new file mode 100644 index 000000000..a3fb1ee02 --- /dev/null +++ b/dist/collections/pagination/components/pagination.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../../src/collections/pagination/components/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAa,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;IAiH3F;QACI,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,YAAY,EAAU,CAAC;QAE7C,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;KAC3B;0BAjEU,kCAAO;;YACd,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;;aAGzB,UAAmB,KAAwB;YACvC,IAAI,CAAC,QAAQ,GAAG,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;SACzE;;;;0BAMU,yCAAc;;YACrB,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC;;aAGhC,UAA0B,KAAY;YAClC,IAAI,CAAC,eAAe,GAAG,IAAI,CAA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CAAC,CAAC,UAAU,CAAC;YAEpE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC;gBAC1B,GAAG,GAAG,OAAO,CAAC;aACjB;YAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC;gBACjD,KAAK,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;aACpC;YAAC,IAAI,CAAC,CAAC;gBACJ,KAAK,GAAG,IAAI,CAAC,IAAI,GAAG,UAAU,GAAG,CAAC,CAAC;gBACnC,GAAG,GAAG,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;aACjC;SACJ;QAAC,IAAI,CAAC,CAAC;YACJ,KAAK,GAAG,IAAI,GAAG,OAAO,CAAC;YACvB,GAAG,GAAG,KAAK,GAAG,OAAO,CAAC;SACzB;QAED,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;KACjD;;gBAvLJ,SAAS,SAAC;oBACP,QAAQ,EAAE,gBAAgB;oBAC1B,QAAQ,EAAE,gzCA4Bb;oBACG,MAAM,EAAE,CAAC,6CAIZ,CAAC;iBACD;;;;;uCAGI,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,kBAAkB,cAC9B,WAAW,SAAC,YAAY;+BAMxB,MAAM;4BAUN,KAAK;6BASL,KAAK;mCAGL,KAAK;uCAUL,KAAK;qCAUL,KAAK;8BAGL,KAAK;gCAGL,KAAK;yBAGL,KAAK;;wBApGV;;SAuCa,aAAa","sourcesContent":["import { Component, Input, Output, OnChanges, EventEmitter, HostBinding } from \"@angular/core\";\n\n@Component({\n selector: \"sui-pagination\",\n template: `\n\n \n\n\n \n\n\n \n 1\n \n 2\">...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n`,\n styles: [`\n:host .item {\n transition: none;\n}\n`]\n})\nexport class SuiPagination implements OnChanges {\n\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.pagination\")\n @HostBinding(\"class.menu\")\n private _paginationClasses:boolean;\n\n // Public members\n public pageCount:number;\n\n @Output()\n public pageChange:EventEmitter;\n\n // Private members\n private _maxSize?:number;\n private _collectionSize:number;\n private _page:number;\n private _pages:number[];\n private _hasNavigationLinks:boolean;\n\n @Input()\n public get maxSize():number|undefined {\n return this._maxSize;\n }\n\n public set maxSize(value:number | undefined) {\n this._maxSize = (value != undefined) ? Math.max(value, 1) : undefined;\n }\n\n @Input()\n public pageSize:number;\n\n @Input()\n public get collectionSize():number {\n return this._collectionSize;\n }\n\n public set collectionSize(value:number) {\n this._collectionSize = Math.max(value, 0);\n this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize));\n }\n\n @Input()\n public get hasNavigationLinks():boolean {\n const maxSize = this._maxSize || this.pageCount;\n return this._hasNavigationLinks || maxSize < this.pageCount;\n }\n\n public set hasNavigationLinks(value:boolean) {\n this._hasNavigationLinks = value;\n }\n\n @Input()\n public hasBoundaryLinks:boolean;\n\n @Input()\n public canRotate:boolean;\n\n @Input()\n public hasEllipses:boolean;\n\n @Input()\n public get page():number {\n return this._page;\n }\n\n public set page(value:number) {\n this.setPage(value);\n }\n\n public get pages():number[] {\n return this._pages;\n }\n\n constructor() {\n this._paginationClasses = true;\n this.pageChange = new EventEmitter();\n\n this.pageSize = 10;\n this._page = 1;\n this._pages = [];\n this.pageCount = 1;\n this.hasNavigationLinks = true;\n this.hasBoundaryLinks = false;\n this.canRotate = false;\n this.hasEllipses = true;\n }\n\n // Public methods\n public hasPrevious():boolean {\n return this.page > 1;\n }\n\n public hasNext():boolean {\n return this.page < this.pageCount;\n }\n\n public setPage(newPage:number):void {\n const value:number = (Number.isInteger(newPage)) ? Math.min(Math.max(newPage, 1), this.pageCount) : 1;\n if (value !== this._page) {\n this._page = value;\n this.pageChange.emit(this._page);\n }\n }\n\n // Lifecycle hooks\n public ngOnChanges():void {\n this.updatePages();\n }\n\n // Private methods\n private updatePages():void {\n this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize));\n\n const [start, end] = this.applyPagination();\n\n this._pages = Array(end - start)\n .fill(start + 1)\n .map((s, i) => s + i);\n }\n\n private applyPagination():[number, number] {\n const maxSize = (this.maxSize != undefined) ? Math.min(this.maxSize, this.pageCount) : this.pageCount;\n\n const page = Math.ceil(this.page / maxSize) - 1;\n let start = 0;\n let end = this.pageCount;\n\n if (this.canRotate) {\n const leftOffset = Math.floor(maxSize / 2);\n const rightOffset = maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;\n\n if (this.page <= leftOffset) {\n end = maxSize;\n } else if (this.pageCount - this.page < leftOffset) {\n start = this.pageCount - maxSize;\n } else {\n start = this.page - leftOffset - 1;\n end = this.page + rightOffset;\n }\n } else {\n start = page * maxSize;\n end = start + maxSize;\n }\n\n return [start, Math.min(end, this.pageCount)];\n }\n}\n"]} \ No newline at end of file diff --git a/dist/collections/pagination/components/pagination.metadata.json b/dist/collections/pagination/components/pagination.metadata.json new file mode 100644 index 000000000..8661ff0cf --- /dev/null +++ b/dist/collections/pagination/components/pagination.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiPagination":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"sui-pagination","template":"\n\n \n\n\n \n\n\n \n 1\n \n 2\">...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n","styles":["\n:host .item {\n transition: none;\n}\n"]}]}],"members":{"_paginationClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":41,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":42,"character":5},"arguments":["class.pagination"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":43,"character":5},"arguments":["class.menu"]}]}],"pageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":49,"character":5}}]}],"maxSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":5}}]}],"pageSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":5}}]}],"collectionSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":71,"character":5}}]}],"hasNavigationLinks":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":81,"character":5}}]}],"hasBoundaryLinks":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":91,"character":5}}]}],"canRotate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":94,"character":5}}]}],"hasEllipses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":97,"character":5}}]}],"page":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":100,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor"}],"hasPrevious":[{"__symbolic":"method"}],"hasNext":[{"__symbolic":"method"}],"setPage":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"updatePages":[{"__symbolic":"method"}],"applyPagination":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/collections/pagination/index.d.ts b/dist/collections/pagination/index.d.ts new file mode 100644 index 000000000..53656f8ca --- /dev/null +++ b/dist/collections/pagination/index.d.ts @@ -0,0 +1,2 @@ +export * from "./components/pagination"; +export * from "./pagination.module"; diff --git a/dist/collections/pagination/index.js b/dist/collections/pagination/index.js new file mode 100644 index 000000000..6bb26c5c5 --- /dev/null +++ b/dist/collections/pagination/index.js @@ -0,0 +1,3 @@ +export * from "./components/pagination"; +export * from "./pagination.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/collections/pagination/index.js.map b/dist/collections/pagination/index.js.map new file mode 100644 index 000000000..6ad1765ee --- /dev/null +++ b/dist/collections/pagination/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/collections/pagination/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AAExC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./components/pagination\";\n\nexport * from \"./pagination.module\";\n"]} \ No newline at end of file diff --git a/dist/collections/pagination/index.metadata.json b/dist/collections/pagination/index.metadata.json new file mode 100644 index 000000000..ccda0463a --- /dev/null +++ b/dist/collections/pagination/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/pagination"},{"from":"./pagination.module"}]}] \ No newline at end of file diff --git a/dist/collections/pagination/pagination.module.d.ts b/dist/collections/pagination/pagination.module.d.ts new file mode 100644 index 000000000..d5d66e9b1 --- /dev/null +++ b/dist/collections/pagination/pagination.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiPaginationModule { +} diff --git a/dist/collections/pagination/pagination.module.js b/dist/collections/pagination/pagination.module.js new file mode 100644 index 000000000..d64e0e8e6 --- /dev/null +++ b/dist/collections/pagination/pagination.module.js @@ -0,0 +1,20 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiPagination } from "./components/pagination"; +var SuiPaginationModule = /** @class */ (function () { + function SuiPaginationModule() { + } + SuiPaginationModule.decorators = [ + { type: NgModule, args: [{ + imports: [CommonModule], + exports: [SuiPagination], + declarations: [SuiPagination], + providers: [] + },] }, + ]; + /** @nocollapse */ + SuiPaginationModule.ctorParameters = function () { return []; }; + return SuiPaginationModule; +}()); +export { SuiPaginationModule }; +//# sourceMappingURL=pagination.module.js.map \ No newline at end of file diff --git a/dist/collections/pagination/pagination.module.js.map b/dist/collections/pagination/pagination.module.js.map new file mode 100644 index 000000000..19b1a310b --- /dev/null +++ b/dist/collections/pagination/pagination.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pagination.module.js","sourceRoot":"","sources":["../../../src/collections/pagination/pagination.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;;;;;gBAEvD,QAAQ,SAAC;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,YAAY,EAAE,CAAC,aAAa,CAAC;oBAC7B,SAAS,EAAE,EAAE;iBAChB;;;;8BAVD;;SAWa,mBAAmB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { SuiPagination } from \"./components/pagination\";\n\n@NgModule({\n imports: [CommonModule],\n exports: [SuiPagination],\n declarations: [SuiPagination],\n providers: []\n})\nexport class SuiPaginationModule { }\n"]} \ No newline at end of file diff --git a/dist/collections/pagination/pagination.module.metadata.json b/dist/collections/pagination/pagination.module.metadata.json new file mode 100644 index 000000000..56a2ce555 --- /dev/null +++ b/dist/collections/pagination/pagination.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiPaginationModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":14}],"exports":[{"__symbolic":"reference","module":"./components/pagination","name":"SuiPagination","line":7,"character":14}],"declarations":[{"__symbolic":"reference","module":"./components/pagination","name":"SuiPagination","line":8,"character":19}],"providers":[]}]}]}}}] \ No newline at end of file diff --git a/dist/collections/pagination/public.d.ts b/dist/collections/pagination/public.d.ts new file mode 100644 index 000000000..be68cb0b4 --- /dev/null +++ b/dist/collections/pagination/public.d.ts @@ -0,0 +1 @@ +export { SuiPaginationModule } from "./index"; diff --git a/dist/collections/pagination/public.js b/dist/collections/pagination/public.js new file mode 100644 index 000000000..8dfdda395 --- /dev/null +++ b/dist/collections/pagination/public.js @@ -0,0 +1,2 @@ +export { SuiPaginationModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/collections/pagination/public.js.map b/dist/collections/pagination/public.js.map new file mode 100644 index 000000000..59eddc086 --- /dev/null +++ b/dist/collections/pagination/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/collections/pagination/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACtB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiPaginationModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/collections/pagination/public.metadata.json b/dist/collections/pagination/public.metadata.json new file mode 100644 index 000000000..32763abfe --- /dev/null +++ b/dist/collections/pagination/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiPaginationModule"]}]}] \ No newline at end of file diff --git a/dist/collections/public.d.ts b/dist/collections/public.d.ts new file mode 100644 index 000000000..ff35fd1e6 --- /dev/null +++ b/dist/collections/public.d.ts @@ -0,0 +1,2 @@ +export * from "./message/public"; +export * from "./pagination/public"; diff --git a/dist/collections/public.js b/dist/collections/public.js new file mode 100644 index 000000000..75430a00f --- /dev/null +++ b/dist/collections/public.js @@ -0,0 +1,3 @@ +export * from "./message/public"; +export * from "./pagination/public"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/collections/public.js.map b/dist/collections/public.js.map new file mode 100644 index 000000000..10e8bb7d0 --- /dev/null +++ b/dist/collections/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/collections/public.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./message/public\";\nexport * from \"./pagination/public\";\n"]} \ No newline at end of file diff --git a/dist/collections/public.metadata.json b/dist/collections/public.metadata.json new file mode 100644 index 000000000..f028491dd --- /dev/null +++ b/dist/collections/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./message/public"},{"from":"./pagination/public"}]}] \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 000000000..2274a9c08 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,5 @@ +export * from "./behaviors/index"; +export * from "./collections/index"; +export * from "./modules/index"; +export * from "./misc/index"; +export * from "./sui.module"; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 000000000..d12ac7275 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,6 @@ +export * from "./behaviors/index"; +export * from "./collections/index"; +export * from "./modules/index"; +export * from "./misc/index"; +export * from "./sui.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 000000000..31ce3a474 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC","sourcesContent":["export * from \"./behaviors/index\";\nexport * from \"./collections/index\";\nexport * from \"./modules/index\";\n\nexport * from \"./misc/index\";\nexport * from \"./sui.module\";\n"]} \ No newline at end of file diff --git a/dist/index.metadata.json b/dist/index.metadata.json new file mode 100644 index 000000000..0b566f23b --- /dev/null +++ b/dist/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./behaviors/index"},{"from":"./collections/index"},{"from":"./modules/index"},{"from":"./misc/index"},{"from":"./sui.module"}]}] \ No newline at end of file diff --git a/dist/karma.conf.d.ts b/dist/karma.conf.d.ts new file mode 100644 index 000000000..e69de29bb diff --git a/dist/karma.conf.js b/dist/karma.conf.js new file mode 100644 index 000000000..2b8b7fc86 --- /dev/null +++ b/dist/karma.conf.js @@ -0,0 +1,36 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/0.13/config/configuration-file.html +//tslint:disable +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular/cli'], + plugins: [ + require('karma-jasmine'), + require('karma-phantomjs-launcher'), + require('karma-chrome-launcher'), + require('karma-min-reporter'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular/cli/plugins/karma') + ], + client: { + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + angularCli: { + environment: 'dev' + }, + reporters: ['min'], + coverageIstanbulReporter: { + reports: ['html', 'text-summary'], + fixWebpackSourcePaths: true + }, + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['PhantomJS'], + singleRun: true + }); +}; +//# sourceMappingURL=karma.conf.js.map \ No newline at end of file diff --git a/dist/karma.conf.js.map b/dist/karma.conf.js.map new file mode 100644 index 000000000..862bdeb9d --- /dev/null +++ b/dist/karma.conf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"karma.conf.js","sourceRoot":"","sources":["../src/karma.conf.ts"],"names":[],"mappings":";;;AAKA,MAAM,CAAC,OAAO,GAAG,UAAC,MAAU;IAC1B,MAAM,CAAC,GAAG,CAAC;QACT,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC;QACvC,OAAO,EAAE;YACP,OAAO,CAAC,eAAe,CAAC;YACxB,OAAO,CAAC,0BAA0B,CAAC;YACnC,OAAO,CAAC,uBAAuB,CAAC;YAChC,OAAO,CAAC,oBAAoB,CAAC;YAC7B,OAAO,CAAC,6BAA6B,CAAC;YACtC,OAAO,CAAC,kCAAkC,CAAC;YAC3C,OAAO,CAAC,4BAA4B,CAAC;SACtC;QACD,MAAM,EAAC;YACL,YAAY,EAAE,KAAK;SACpB;QACD,UAAU,EAAE;YACV,WAAW,EAAE,KAAK;SACnB;QACD,SAAS,EAAE,CAAC,KAAK,CAAC;QAClB,wBAAwB,EAAE;YACxB,OAAO,EAAE,CAAE,MAAM,EAAE,cAAc,CAAE;YACnC,qBAAqB,EAAE,IAAI;SAC5B;QACD,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,CAAC,WAAW,CAAC;QACvB,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;CACJ,CAAA","sourcesContent":["// Karma configuration file, see link for more information\n// https://karma-runner.github.io/0.13/config/configuration-file.html\n\n//tslint:disable\n\nmodule.exports = (config:any) => {\n config.set({\n basePath: '',\n frameworks: ['jasmine', '@angular/cli'],\n plugins: [\n require('karma-jasmine'),\n require('karma-phantomjs-launcher'),\n require('karma-chrome-launcher'),\n require('karma-min-reporter'),\n require('karma-jasmine-html-reporter'),\n require('karma-coverage-istanbul-reporter'),\n require('@angular/cli/plugins/karma')\n ],\n client:{\n clearContext: false // leave Jasmine Spec Runner output visible in browser\n },\n angularCli: {\n environment: 'dev'\n },\n reporters: ['min'],\n coverageIstanbulReporter: {\n reports: [ 'html', 'text-summary' ],\n fixWebpackSourcePaths: true\n },\n port: 9876,\n colors: true,\n logLevel: config.LOG_INFO,\n autoWatch: true,\n browsers: ['PhantomJS'],\n singleRun: true\n });\n}\n"]} \ No newline at end of file diff --git a/dist/misc/index.d.ts b/dist/misc/index.d.ts new file mode 100644 index 000000000..2dd8370cf --- /dev/null +++ b/dist/misc/index.d.ts @@ -0,0 +1 @@ +export * from "./util/index"; diff --git a/dist/misc/index.js b/dist/misc/index.js new file mode 100644 index 000000000..c03c028d1 --- /dev/null +++ b/dist/misc/index.js @@ -0,0 +1,2 @@ +export * from "./util/index"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/misc/index.js.map b/dist/misc/index.js.map new file mode 100644 index 000000000..6dc46c29a --- /dev/null +++ b/dist/misc/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/misc/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC","sourcesContent":["export * from \"./util/index\";\n"]} \ No newline at end of file diff --git a/dist/misc/index.metadata.json b/dist/misc/index.metadata.json new file mode 100644 index 000000000..3ddd5cd98 --- /dev/null +++ b/dist/misc/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./util/index"}]}] \ No newline at end of file diff --git a/dist/misc/public.d.ts b/dist/misc/public.d.ts new file mode 100644 index 000000000..5cce5192f --- /dev/null +++ b/dist/misc/public.d.ts @@ -0,0 +1 @@ +export * from "./util/public"; diff --git a/dist/misc/public.js b/dist/misc/public.js new file mode 100644 index 000000000..f9b299234 --- /dev/null +++ b/dist/misc/public.js @@ -0,0 +1,2 @@ +export * from "./util/public"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/misc/public.js.map b/dist/misc/public.js.map new file mode 100644 index 000000000..f1e93dedb --- /dev/null +++ b/dist/misc/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/misc/public.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC","sourcesContent":["export * from \"./util/public\";\n"]} \ No newline at end of file diff --git a/dist/misc/public.metadata.json b/dist/misc/public.metadata.json new file mode 100644 index 000000000..895c7107e --- /dev/null +++ b/dist/misc/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./util/public"}]}] \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-validator.d.ts b/dist/misc/util/helpers/custom-validator.d.ts new file mode 100644 index 000000000..59a9a2fc3 --- /dev/null +++ b/dist/misc/util/helpers/custom-validator.d.ts @@ -0,0 +1,18 @@ +import { AbstractControl, ValidationErrors, Validator } from "@angular/forms"; +import { InjectionToken, Type } from "@angular/core"; +export interface ICustomValidatorHost { + validate(c: AbstractControl): ValidationErrors | null; +} +export declare class CustomValidator implements Validator { + private _host; + constructor(_host: T); + onValidatorChange: () => void; + validate(c: AbstractControl): ValidationErrors | null; + registerOnValidatorChange(fn: () => void): void; +} +export interface IValidationProvider { + provide: InjectionToken<(Function | Validator)[]>; + useExisting: Type; + multi: boolean; +} +export declare function customValidatorFactory(type: Function): IValidationProvider; diff --git a/dist/misc/util/helpers/custom-validator.js b/dist/misc/util/helpers/custom-validator.js new file mode 100644 index 000000000..c43984c20 --- /dev/null +++ b/dist/misc/util/helpers/custom-validator.js @@ -0,0 +1,24 @@ +import { NG_VALIDATORS } from "@angular/forms"; +import { forwardRef } from "@angular/core"; +var CustomValidator = /** @class */ (function () { + function CustomValidator(_host) { + this._host = _host; + this.onValidatorChange = function () { }; + } + CustomValidator.prototype.validate = function (c) { + return this._host.validate(c); + }; + CustomValidator.prototype.registerOnValidatorChange = function (fn) { + this.onValidatorChange = fn; + }; + return CustomValidator; +}()); +export { CustomValidator }; +export function customValidatorFactory(type) { + return { + provide: NG_VALIDATORS, + useExisting: forwardRef(function () { return type; }), + multi: true + }; +} +//# sourceMappingURL=custom-validator.js.map \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-validator.js.map b/dist/misc/util/helpers/custom-validator.js.map new file mode 100644 index 000000000..7b344913c --- /dev/null +++ b/dist/misc/util/helpers/custom-validator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"custom-validator.js","sourceRoot":"","sources":["../../../../src/misc/util/helpers/custom-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgD,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAwB,MAAM,eAAe,CAAC;AAMjE,IAAA;IACI,yBAAoB,KAAO;QAAP,UAAK,GAAL,KAAK,CAAE;iCAEA,eAAQ;KAFJ;IAIxB,kCAAQ,GAAf,UAAgB,CAAiB;QAC7B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;KACjC;IAEM,mDAAyB,GAAhC,UAAiC,EAAa;QAC1C,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;KAC/B;0BAlBL;IAmBC,CAAA;AAZD,2BAYC;AAQD,MAAM,iCAAiC,IAAa;IAChD,MAAM,CAAC;QACH,OAAO,EAAE,aAAa;QACtB,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;QACnC,KAAK,EAAE,IAAI;KACd,CAAC;CACL","sourcesContent":["import { NG_VALIDATORS, AbstractControl, ValidationErrors, Validator } from \"@angular/forms\";\nimport { forwardRef, InjectionToken, Type } from \"@angular/core\";\n\nexport interface ICustomValidatorHost {\n validate(c:AbstractControl):ValidationErrors | null;\n}\n\nexport class CustomValidator implements Validator {\n constructor(private _host:T) {}\n\n public onValidatorChange = () => {};\n\n public validate(c:AbstractControl):ValidationErrors | null {\n return this._host.validate(c);\n }\n\n public registerOnValidatorChange(fn:() => void):void {\n this.onValidatorChange = fn;\n }\n}\n\nexport interface IValidationProvider {\n provide:InjectionToken<(Function | Validator)[]>;\n useExisting:Type;\n multi:boolean;\n}\n\nexport function customValidatorFactory(type:Function):IValidationProvider {\n return {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => type),\n multi: true\n };\n}\n"]} \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-validator.metadata.json b/dist/misc/util/helpers/custom-validator.metadata.json new file mode 100644 index 000000000..ae709776f --- /dev/null +++ b/dist/misc/util/helpers/custom-validator.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"ICustomValidatorHost":{"__symbolic":"interface"},"CustomValidator":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":8,"character":30,"context":{"typeName":"T"}}]}],"validate":[{"__symbolic":"method"}],"registerOnValidatorChange":[{"__symbolic":"method"}]}},"IValidationProvider":{"__symbolic":"interface"},"customValidatorFactory":{"__symbolic":"function","parameters":["type"],"value":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALIDATORS","line":29,"character":17},"useExisting":{"__symbolic":"reference","name":"type"},"multi":true}}}}] \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-value-accessor.d.ts b/dist/misc/util/helpers/custom-value-accessor.d.ts new file mode 100644 index 000000000..961cafcc7 --- /dev/null +++ b/dist/misc/util/helpers/custom-value-accessor.d.ts @@ -0,0 +1,20 @@ +import { ControlValueAccessor } from "@angular/forms"; +import { InjectionToken, Type } from "@angular/core"; +export interface ICustomValueAccessorHost { + writeValue(value: T): void; +} +export declare class CustomValueAccessor> implements ControlValueAccessor { + private _host; + constructor(_host: T); + onChange: () => void; + onTouched: () => void; + writeValue(value: U): void; + registerOnChange(fn: () => void): void; + registerOnTouched(fn: () => void): void; +} +export interface IValueAccessorProvider { + provide: InjectionToken; + useExisting: Type; + multi: boolean; +} +export declare function customValueAccessorFactory(type: Function): IValueAccessorProvider; diff --git a/dist/misc/util/helpers/custom-value-accessor.js b/dist/misc/util/helpers/custom-value-accessor.js new file mode 100644 index 000000000..38fec4488 --- /dev/null +++ b/dist/misc/util/helpers/custom-value-accessor.js @@ -0,0 +1,28 @@ +import { NG_VALUE_ACCESSOR } from "@angular/forms"; +import { forwardRef } from "@angular/core"; +var CustomValueAccessor = /** @class */ (function () { + function CustomValueAccessor(_host) { + this._host = _host; + this.onChange = function () { }; + this.onTouched = function () { }; + } + CustomValueAccessor.prototype.writeValue = function (value) { + this._host.writeValue(value); + }; + CustomValueAccessor.prototype.registerOnChange = function (fn) { + this.onChange = fn; + }; + CustomValueAccessor.prototype.registerOnTouched = function (fn) { + this.onTouched = fn; + }; + return CustomValueAccessor; +}()); +export { CustomValueAccessor }; +export function customValueAccessorFactory(type) { + return { + provide: NG_VALUE_ACCESSOR, + useExisting: forwardRef(function () { return type; }), + multi: true + }; +} +//# sourceMappingURL=custom-value-accessor.js.map \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-value-accessor.js.map b/dist/misc/util/helpers/custom-value-accessor.js.map new file mode 100644 index 000000000..f46038eb1 --- /dev/null +++ b/dist/misc/util/helpers/custom-value-accessor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"custom-value-accessor.js","sourceRoot":"","sources":["../../../../src/misc/util/helpers/custom-value-accessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAwB,MAAM,eAAe,CAAC;AAMjE,IAAA;IACI,6BAAoB,KAAO;QAAP,UAAK,GAAL,KAAK,CAAE;wBAET,eAAQ;yBACP,eAAQ;KAHI;IAKxB,wCAAU,GAAjB,UAAkB,KAAO;QACrB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;KAChC;IAEM,8CAAgB,GAAvB,UAAwB,EAAa;QACjC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;KACtB;IAEM,+CAAiB,GAAxB,UAAyB,EAAa;QAClC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;KACvB;8BAvBL;IAwBC,CAAA;AAjBD,+BAiBC;AAQD,MAAM,qCAAqC,IAAa;IACpD,MAAM,CAAC;QACH,OAAO,EAAE,iBAAiB;QAC1B,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;QACnC,KAAK,EAAE,IAAI;KACd,CAAC;CACL","sourcesContent":["import { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\nimport { forwardRef, InjectionToken, Type } from \"@angular/core\";\n\nexport interface ICustomValueAccessorHost {\n writeValue(value:T):void;\n}\n\nexport class CustomValueAccessor> implements ControlValueAccessor {\n constructor(private _host:T) {}\n\n public onChange = () => {};\n public onTouched = () => {};\n\n public writeValue(value:U):void {\n this._host.writeValue(value);\n }\n\n public registerOnChange(fn:() => void):void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn:() => void):void {\n this.onTouched = fn;\n }\n}\n\nexport interface IValueAccessorProvider {\n provide:InjectionToken;\n useExisting:Type;\n multi:boolean;\n}\n\nexport function customValueAccessorFactory(type:Function):IValueAccessorProvider {\n return {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => type),\n multi: true\n };\n}\n"]} \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-value-accessor.metadata.json b/dist/misc/util/helpers/custom-value-accessor.metadata.json new file mode 100644 index 000000000..243cbab65 --- /dev/null +++ b/dist/misc/util/helpers/custom-value-accessor.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"ICustomValueAccessorHost":{"__symbolic":"interface"},"CustomValueAccessor":{"__symbolic":"class","arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":8,"character":30,"context":{"typeName":"T"}}]}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}]}},"IValueAccessorProvider":{"__symbolic":"interface"},"customValueAccessorFactory":{"__symbolic":"function","parameters":["type"],"value":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR","line":34,"character":17},"useExisting":{"__symbolic":"reference","name":"type"},"multi":true}}}}] \ No newline at end of file diff --git a/dist/misc/util/helpers/date.d.ts b/dist/misc/util/helpers/date.d.ts new file mode 100644 index 000000000..2ce4c158f --- /dev/null +++ b/dist/misc/util/helpers/date.d.ts @@ -0,0 +1,17 @@ +export declare enum DatePrecision { + Decade = 0, + Year = 1, + Month = 2, + Date = 3, + Hour = 4, + Minute = 5, +} +export declare const DateUtil: { + startOf(precision: DatePrecision, date: Date, resetAll?: boolean): Date; + endOf(precision: DatePrecision, date: Date): Date; + equal(precision: DatePrecision, a: Date, b: Date): boolean; + next(precision: DatePrecision, date: Date): Date; + add(precision: DatePrecision, date: Date, i: number): Date; + previous(precision: DatePrecision, date: Date): Date; + clone(date: Date): Date; +}; diff --git a/dist/misc/util/helpers/date.js b/dist/misc/util/helpers/date.js new file mode 100644 index 000000000..9a7125097 --- /dev/null +++ b/dist/misc/util/helpers/date.js @@ -0,0 +1,172 @@ +import { Util } from "./util"; +export var DatePrecision; +(function (DatePrecision) { + DatePrecision[DatePrecision["Decade"] = 0] = "Decade"; + DatePrecision[DatePrecision["Year"] = 1] = "Year"; + DatePrecision[DatePrecision["Month"] = 2] = "Month"; + DatePrecision[DatePrecision["Date"] = 3] = "Date"; + DatePrecision[DatePrecision["Hour"] = 4] = "Hour"; + DatePrecision[DatePrecision["Minute"] = 5] = "Minute"; +})(DatePrecision || (DatePrecision = {})); +export var DateUtil = { + startOf: function (precision, date, resetAll) { + if (resetAll === void 0) { resetAll = false; } + switch (precision) { + case DatePrecision.Decade: + var start = Math.floor(date.getFullYear() / 10) * 10 + 1; + date.setFullYear(start); + if (!resetAll) { + break; + } + // falls through + case DatePrecision.Year: + date.setMonth(0); + if (!resetAll) { + break; + } + // falls through + case DatePrecision.Month: + date.setDate(1); + if (!resetAll) { + break; + } + // falls through + case DatePrecision.Date: + date.setHours(0); + if (!resetAll) { + break; + } + // falls through + case DatePrecision.Hour: + date.setMinutes(0); + if (!resetAll) { + break; + } + // falls through + case DatePrecision.Minute: + date.setSeconds(0, 0); + } + return date; + }, + endOf: function (precision, date) { + switch (precision) { + case DatePrecision.Year: + date.setMonth(12, 0); + // falls through + case DatePrecision.Month: + date.setMonth(date.getMonth() + 1, 0); + // falls through + case DatePrecision.Date: + date.setHours(23, 59, 59, 999); + break; + case DatePrecision.Hour: + date.setMinutes(59, 59, 999); + break; + case DatePrecision.Minute: + date.setSeconds(59, 999); + break; + } + return date; + }, + equal: function (precision, a, b) { + var equal = true; + switch (precision) { + case DatePrecision.Minute: + equal = equal && a.getMinutes() === b.getMinutes(); + // falls through + case DatePrecision.Hour: + equal = equal && a.getHours() === b.getHours(); + // falls through + case DatePrecision.Date: + equal = equal && a.getDate() === b.getDate(); + // falls through + case DatePrecision.Month: + equal = equal && a.getMonth() === b.getMonth(); + // falls through + case DatePrecision.Year: + equal = equal && a.getFullYear() === b.getFullYear(); + } + return equal; + }, + next: function (precision, date) { + return DateUtil.add(precision, date, 1); + }, + add: function (precision, date, i) { + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + switch (precision) { + case DatePrecision.Decade: + date.setFullYear(year + i * 10); + if (date.getMonth() !== month) { + date.setDate(0); + } + break; + case DatePrecision.Year: + date.setFullYear(year + i); + if (date.getMonth() !== month) { + date.setDate(0); + } + break; + case DatePrecision.Month: + date.setMonth(month + i); + if (date.getMonth() !== Util.Math.mod(month + i, 12)) { + date.setDate(0); + } + break; + case DatePrecision.Date: + date.setDate(day + i); + break; + case DatePrecision.Hour: + date.setHours(date.getHours() + i); + break; + case DatePrecision.Minute: + date.setMinutes(date.getMinutes() + i); + break; + } + return date; + }, + previous: function (precision, date) { + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + switch (precision) { + case DatePrecision.Decade: + date.setFullYear(year - 10); + if (date.getMonth() !== month) { + date.setDate(0); + } + break; + case DatePrecision.Year: + date.setFullYear(year - 1); + if (date.getMonth() !== month) { + date.setDate(0); + } + break; + case DatePrecision.Month: + date.setMonth(month - 1); + if (date.getMonth() !== Util.Math.mod(month - 1, 12)) { + date.setDate(0); + } + break; + case DatePrecision.Date: + date.setDate(day - 1); + break; + case DatePrecision.Hour: + var hours = date.getHours(); + date.setHours(hours - 1); + if (date.getHours() !== Util.Math.mod(hours - 1, 24)) { + date.setHours(hours - 2); + } + break; + case DatePrecision.Minute: + var minutes = date.getMinutes(); + date.setMinutes(minutes - 1); + } + return date; + }, + clone: function (date) { + return new Date(date.getTime()); + } +}; +//# sourceMappingURL=date.js.map \ No newline at end of file diff --git a/dist/misc/util/helpers/date.js.map b/dist/misc/util/helpers/date.js.map new file mode 100644 index 000000000..65fd3dde9 --- /dev/null +++ b/dist/misc/util/helpers/date.js.map @@ -0,0 +1 @@ +{"version":3,"file":"date.js","sourceRoot":"","sources":["../../../../src/misc/util/helpers/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACrB,qDAAU,CAAA;IACV,iDAAQ,CAAA;IACR,mDAAS,CAAA;IACT,iDAAQ,CAAA;IACR,iDAAQ,CAAA;IACR,qDAAU,CAAA;GANF,aAAa,KAAb,aAAa,QAOxB;AAED,MAAM,CAAC,IAAM,QAAQ,GAAG;IACpB,OAAO,EAAP,UAAQ,SAAuB,EAAE,IAAS,EAAE,QAAwB;QAAxB,yBAAA,EAAA,gBAAwB;QAChE,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;YAChB,KAAK,aAAa,CAAC,MAAM;gBACrB,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBAC3D,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;gBACxB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;oBACZ,KAAK,CAAC;iBACT;;YAEL,KAAK,aAAa,CAAC,IAAI;gBACnB,IAAI,CAAC,QAAQ,CA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;gBACD,KAAK,CAAC;YACV,KAAK,aAAa,CAAC,IAAI;gBACnB,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;gBACtB,KAAK,CAAC;YACV,KAAK,aAAa,CAAC,IAAI;gBACnB,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAC9B,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;gBACzB,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;oBACnD,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;iBAC5B;gBACD,KAAK,CAAC;YACV,KAAK,aAAa,CAAC,MAAM;gBACrB,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClC,IAAI,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;SACpC;QACD,MAAM,CAAC,IAAI,CAAC;KACf;IAED,KAAK,EAAL,UAAM,IAAS;QACX,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;KACnC;CACJ,CAAC","sourcesContent":["import { Util } from \"./util\";\n\nexport enum DatePrecision {\n Decade = 0,\n Year = 1,\n Month = 2,\n Date = 3,\n Hour = 4,\n Minute = 5\n}\n\nexport const DateUtil = {\n startOf(precision:DatePrecision, date:Date, resetAll:boolean = false):Date {\n switch (precision) {\n case DatePrecision.Decade:\n const start = Math.floor(date.getFullYear() / 10) * 10 + 1;\n date.setFullYear(start);\n if (!resetAll) {\n break;\n }\n // falls through\n case DatePrecision.Year:\n date.setMonth(0);\n if (!resetAll) {\n break;\n }\n // falls through\n case DatePrecision.Month:\n date.setDate(1);\n if (!resetAll) {\n break;\n }\n // falls through\n case DatePrecision.Date:\n date.setHours(0);\n if (!resetAll) {\n break;\n }\n // falls through\n case DatePrecision.Hour:\n date.setMinutes(0);\n if (!resetAll) {\n break;\n }\n // falls through\n case DatePrecision.Minute:\n date.setSeconds(0, 0);\n }\n\n return date;\n },\n\n endOf(precision:DatePrecision, date:Date):Date {\n switch (precision) {\n case DatePrecision.Year:\n date.setMonth(12, 0);\n // falls through\n case DatePrecision.Month:\n date.setMonth(date.getMonth() + 1, 0);\n // falls through\n case DatePrecision.Date:\n date.setHours(23, 59, 59, 999);\n break;\n case DatePrecision.Hour:\n date.setMinutes(59, 59, 999);\n break;\n case DatePrecision.Minute:\n date.setSeconds(59, 999);\n break;\n }\n\n return date;\n },\n\n equal(precision:DatePrecision, a:Date, b:Date):boolean {\n let equal = true;\n switch (precision) {\n case DatePrecision.Minute:\n equal = equal && a.getMinutes() === b.getMinutes();\n // falls through\n case DatePrecision.Hour:\n equal = equal && a.getHours() === b.getHours();\n // falls through\n case DatePrecision.Date:\n equal = equal && a.getDate() === b.getDate();\n // falls through\n case DatePrecision.Month:\n equal = equal && a.getMonth() === b.getMonth();\n // falls through\n case DatePrecision.Year:\n equal = equal && a.getFullYear() === b.getFullYear();\n }\n return equal;\n },\n\n next(precision:DatePrecision, date:Date):Date {\n return DateUtil.add(precision, date, 1);\n },\n\n add(precision:DatePrecision, date:Date, i:number):Date {\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n\n switch (precision) {\n case DatePrecision.Decade:\n date.setFullYear(year + i * 10);\n if (date.getMonth() !== month) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Year:\n date.setFullYear(year + i);\n if (date.getMonth() !== month) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Month:\n date.setMonth(month + i);\n if (date.getMonth() !== Util.Math.mod(month + i, 12)) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Date:\n date.setDate(day + i);\n break;\n case DatePrecision.Hour:\n date.setHours(date.getHours() + i);\n break;\n case DatePrecision.Minute:\n date.setMinutes(date.getMinutes() + i);\n break;\n }\n return date;\n },\n\n previous(precision:DatePrecision, date:Date):Date {\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n\n switch (precision) {\n case DatePrecision.Decade:\n date.setFullYear(year - 10);\n if (date.getMonth() !== month) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Year:\n date.setFullYear(year - 1);\n if (date.getMonth() !== month) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Month:\n date.setMonth(month - 1);\n if (date.getMonth() !== Util.Math.mod(month - 1, 12)) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Date:\n date.setDate(day - 1);\n break;\n case DatePrecision.Hour:\n const hours = date.getHours();\n date.setHours(hours - 1);\n if (date.getHours() !== Util.Math.mod(hours - 1, 24)) {\n date.setHours(hours - 2);\n }\n break;\n case DatePrecision.Minute:\n const minutes = date.getMinutes();\n date.setMinutes(minutes - 1);\n }\n return date;\n },\n\n clone(date:Date):Date {\n return new Date(date.getTime());\n }\n};\n"]} \ No newline at end of file diff --git a/dist/misc/util/helpers/date.metadata.json b/dist/misc/util/helpers/date.metadata.json new file mode 100644 index 000000000..ac4da176e --- /dev/null +++ b/dist/misc/util/helpers/date.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"DatePrecision":{"Decade":0,"Year":1,"Month":2,"Date":3,"Hour":4,"Minute":5},"DateUtil":{}}}] \ No newline at end of file diff --git a/dist/misc/util/helpers/focus-event.d.ts b/dist/misc/util/helpers/focus-event.d.ts new file mode 100644 index 000000000..5b15ad3e8 --- /dev/null +++ b/dist/misc/util/helpers/focus-event.d.ts @@ -0,0 +1,3 @@ +export interface IFocusEvent extends Event { + relatedTarget: EventTarget; +} diff --git a/dist/misc/util/helpers/focus-event.js b/dist/misc/util/helpers/focus-event.js new file mode 100644 index 000000000..21a63476a --- /dev/null +++ b/dist/misc/util/helpers/focus-event.js @@ -0,0 +1 @@ +//# sourceMappingURL=focus-event.js.map \ No newline at end of file diff --git a/dist/misc/util/helpers/focus-event.js.map b/dist/misc/util/helpers/focus-event.js.map new file mode 100644 index 000000000..eb484d7ea --- /dev/null +++ b/dist/misc/util/helpers/focus-event.js.map @@ -0,0 +1 @@ +{"version":3,"file":"focus-event.js","sourceRoot":"","sources":["../../../../src/misc/util/helpers/focus-event.ts"],"names":[],"mappings":"","sourcesContent":["export interface IFocusEvent extends Event {\n relatedTarget:EventTarget;\n}\n"]} \ No newline at end of file diff --git a/dist/misc/util/helpers/focus-event.metadata.json b/dist/misc/util/helpers/focus-event.metadata.json new file mode 100644 index 000000000..14dd59630 --- /dev/null +++ b/dist/misc/util/helpers/focus-event.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"IFocusEvent":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/misc/util/helpers/util.d.ts b/dist/misc/util/helpers/util.d.ts new file mode 100644 index 000000000..17f9e2af0 --- /dev/null +++ b/dist/misc/util/helpers/util.d.ts @@ -0,0 +1,47 @@ +export declare enum KeyCode { + Left = 37, + Up = 38, + Right = 39, + Down = 40, + Escape = 27, + Enter = 13, + Space = 32, + Backspace = 8, +} +export interface ITemplateRefContext { + $implicit: T; +} +export interface IAugmentedElement extends Element { + closest(selector: string): IAugmentedElement; +} +export declare class HandledEvent { + eventHandled: boolean; +} +export interface IDynamicClasses { + [name: string]: true; +} +export declare const Util: { + Array: { + range(n: number, offset?: number): number[]; + group(items: T[], groupLength: number): T[][]; + groupBy(items: T[], field: keyof T): { + [name: string]: T[]; + }; + flatten(items: T[][]): T[]; + }; + String: { + padLeft(str: string, length: number, padding: string): string; + }; + DOM: { + parseBooleanAttribute(attributeValue: boolean): boolean; + }; + Object: { + readValue(object: T, path?: string | undefined): U; + }; + Math: { + round(r: number, n: number): number; + roundUp(r: number, n: number): number; + roundDown(r: number, n: number): number; + mod(r: number, n: number): number; + }; +}; diff --git a/dist/misc/util/helpers/util.js b/dist/misc/util/helpers/util.js new file mode 100644 index 000000000..1c4e341d8 --- /dev/null +++ b/dist/misc/util/helpers/util.js @@ -0,0 +1,96 @@ +// Keyboard keycodes. +// Keyboard keycodes. +export var KeyCode; +// Keyboard keycodes. +(function (KeyCode) { + KeyCode[KeyCode["Left"] = 37] = "Left"; + KeyCode[KeyCode["Up"] = 38] = "Up"; + KeyCode[KeyCode["Right"] = 39] = "Right"; + KeyCode[KeyCode["Down"] = 40] = "Down"; + KeyCode[KeyCode["Escape"] = 27] = "Escape"; + KeyCode[KeyCode["Enter"] = 13] = "Enter"; + KeyCode[KeyCode["Space"] = 32] = "Space"; + KeyCode[KeyCode["Backspace"] = 8] = "Backspace"; +})(KeyCode || (KeyCode = {})); +var HandledEvent = /** @class */ (function () { + function HandledEvent() { + } + return HandledEvent; +}()); +export { HandledEvent }; +export var Util = { + Array: { + range: function (n, offset) { + if (offset === void 0) { offset = 0; } + return Array(n).fill(0).map(function (z, i) { return i + offset; }); + }, + group: function (items, groupLength) { + var mutable = items.slice(0); + var groups = []; + while (mutable.length > 0) { + groups.push(mutable.splice(0, groupLength)); + } + return groups; + }, + groupBy: function (items, field) { + return items.reduce(function (groups, i) { + var fieldValue = i[field].toString(); + groups[fieldValue] = groups[fieldValue] || []; + groups[fieldValue].push(i); + return groups; + }, Object()); + }, + flatten: function (items) { + return items.reduce(function (is, i) { return is.concat(i); }, []); + } + }, + String: { + padLeft: function (str, length, padding) { + var s = str; + while (s.length < length) { + s = padding + s; + } + return s; + } + }, + DOM: { + parseBooleanAttribute: function (attributeValue) { + var value = attributeValue; + if (typeof attributeValue === "string") { + value = true; + } + return value; + } + }, + Object: { + readValue: function (object, path) { + if (!path) { + return object; + } + var recursed; + for (var i = 0, p = path.split("."), len = p.length; i < len; i++) { + recursed = object[p[i]]; + } + return recursed; + } + }, + Math: { + round: function (r, n) { + return Math.round(r / n) * n; + }, + roundUp: function (r, n) { + return Math.ceil(r / n) * n; + }, + roundDown: function (r, n) { + return Math.floor(r / n) * n; + }, + mod: function (r, n) { + var rem = r % n; + if (rem < 0) { + return rem + n; + } + return rem; + } + } +}; +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/dist/misc/util/helpers/util.js.map b/dist/misc/util/helpers/util.js.map new file mode 100644 index 000000000..619c0a9bf --- /dev/null +++ b/dist/misc/util/helpers/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/misc/util/helpers/util.ts"],"names":[],"mappings":"AAAA,qBAAqB;;AACrB,MAAM,CAAN,IAAY,OAWX;;AAXD,WAAY,OAAO;IACf,sCAAS,CAAA;IACT,kCAAO,CAAA;IACP,wCAAU,CAAA;IACV,sCAAS,CAAA;IAET,0CAAW,CAAA;IACX,wCAAU,CAAA;IAEV,wCAAU,CAAA;IACV,+CAAa,CAAA;GAVL,OAAO,KAAP,OAAO,QAWlB;AAUD,IAAA;;;uBAtBA;IAwBC,CAAA;AAFD,wBAEC;AAMD,MAAM,CAAC,IAAM,IAAI,GAAG;IAChB,KAAK,EAAE;QACH,KAAK,EAAL,UAAM,CAAQ,EAAE,MAAiB;YAAjB,uBAAA,EAAA,UAAiB;YAC7B,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,GAAG,MAAM,EAAV,CAAU,CAAC,CAAC;SACrD;QACD,KAAK,EAAL,UAAS,KAAS,EAAE,WAAkB;YAClC,IAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAM,MAAM,GAAS,EAAE,CAAC;YACxB,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;aAC/C;YACD,MAAM,CAAC,MAAM,CAAC;SACjB;QACD,OAAO,EAAP,UAAW,KAAS,EAAE,KAAa;YAC/B,M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AC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChE,QAAQ,GAAI,MAAkC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACxD;YAED,MAAM,CAAC,QAAoB,CAAC;SAC/B;KACJ;IAED,IAAI,EAAE;QACF,KAAK,EAAL,UAAM,CAAQ,EAAE,CAAQ;YACpB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;SAChC;QACD,OAAO,EAAP,UAAQ,CAAQ,EAAE,CAAQ;YACtB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;SAC/B;QACD,SAAS,EAAT,UAAU,CAAQ,EAAE,CAAQ;YACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;SAChC;QACD,GAAG,EAAH,UAAI,CAAQ,EAAE,CAAQ;YAClB,IAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YAClB,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;gBACV,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC;aAClB;YACD,MAAM,CAAC,GAAG,CAAC;SACd;KACJ;CACJ,CAAC","sourcesContent":["// Keyboard keycodes.\nexport enum KeyCode {\n Left = 37,\n Up = 38,\n Right = 39,\n Down = 40,\n\n Escape = 27,\n Enter = 13,\n\n Space = 32,\n Backspace = 8\n}\n\ninterface IRecursiveObject { [name:string]:IRecursiveObject; }\n\nexport interface ITemplateRefContext { $implicit:T; }\n\nexport interface IAugmentedElement extends Element {\n closest(selector:string):IAugmentedElement;\n}\n\nexport class HandledEvent {\n public eventHandled:boolean;\n}\n\nexport interface IDynamicClasses {\n [name:string]:true;\n}\n\nexport const Util = {\n Array: {\n range(n:number, offset:number = 0):number[] {\n return Array(n).fill(0).map((z, i) => i + offset);\n },\n group(items:T[], groupLength:number):T[][] {\n const mutable = items.slice(0);\n\n const groups:T[][] = [];\n while (mutable.length > 0) {\n groups.push(mutable.splice(0, groupLength));\n }\n return groups;\n },\n groupBy(items:T[], field:keyof T):{ [name:string]:T[] } {\n return items.reduce<{ [name:string]:T[] }>(\n (groups, i) => {\n const fieldValue = i[field].toString();\n groups[fieldValue] = groups[fieldValue] || [];\n groups[fieldValue].push(i);\n return groups;\n },\n Object());\n },\n flatten(items:T[][]):T[] {\n return items.reduce((is, i) => is.concat(i), []);\n }\n },\n\n String: {\n padLeft(str:string, length:number, padding:string):string {\n let s = str;\n while (s.length < length) {\n s = padding + s;\n }\n return s;\n }\n },\n\n DOM: {\n parseBooleanAttribute(attributeValue:boolean):boolean {\n let value = attributeValue;\n if (typeof attributeValue === \"string\") {\n value = true;\n }\n\n return value;\n }\n },\n\n Object: {\n readValue(object:T, path?:string):U {\n if (!path) {\n return object as any as U;\n }\n\n let recursed:IRecursiveObject | undefined;\n\n for (let i = 0, p = path.split(\".\"), len = p.length; i < len; i++) {\n recursed = (object as any as IRecursiveObject)[p[i]];\n }\n\n return recursed as any as U;\n }\n },\n\n Math: {\n round(r:number, n:number):number {\n return Math.round(r / n) * n;\n },\n roundUp(r:number, n:number):number {\n return Math.ceil(r / n) * n;\n },\n roundDown(r:number, n:number):number {\n return Math.floor(r / n) * n;\n },\n mod(r:number, n:number):number {\n const rem = r % n;\n if (rem < 0) {\n return rem + n;\n }\n return rem;\n }\n }\n};\n"]} \ No newline at end of file diff --git a/dist/misc/util/helpers/util.metadata.json b/dist/misc/util/helpers/util.metadata.json new file mode 100644 index 000000000..371a2d118 --- /dev/null +++ b/dist/misc/util/helpers/util.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"KeyCode":{"Left":37,"Up":38,"Right":39,"Down":40,"Escape":27,"Enter":13,"Space":32,"Backspace":8},"ITemplateRefContext":{"__symbolic":"interface"},"IAugmentedElement":{"__symbolic":"interface"},"HandledEvent":{"__symbolic":"class"},"IDynamicClasses":{"__symbolic":"interface"},"Util":{"Array":{},"String":{},"DOM":{},"Object":{},"Math":{}}}}] \ No newline at end of file diff --git a/dist/misc/util/index.d.ts b/dist/misc/util/index.d.ts new file mode 100644 index 000000000..d28c84a76 --- /dev/null +++ b/dist/misc/util/index.d.ts @@ -0,0 +1,8 @@ +export * from "./helpers/custom-validator"; +export * from "./helpers/custom-value-accessor"; +export * from "./helpers/date"; +export * from "./helpers/focus-event"; +export * from "./helpers/util"; +export * from "./services/component-factory.service"; +export * from "./services/positioning.service"; +export * from "./util.module"; diff --git a/dist/misc/util/index.js b/dist/misc/util/index.js new file mode 100644 index 000000000..c99993726 --- /dev/null +++ b/dist/misc/util/index.js @@ -0,0 +1,8 @@ +export * from "./helpers/custom-validator"; +export * from "./helpers/custom-value-accessor"; +export * from "./helpers/date"; +export * from "./helpers/util"; +export * from "./services/component-factory.service"; +export * from "./services/positioning.service"; +export * from "./util.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/misc/util/index.js.map b/dist/misc/util/index.js.map new file mode 100644 index 000000000..cbcdcb19b --- /dev/null +++ b/dist/misc/util/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/misc/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gBAAgB,CAAC;AAE/B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,eAAe,CAAC","sourcesContent":["export * from \"./helpers/custom-validator\";\nexport * from \"./helpers/custom-value-accessor\";\nexport * from \"./helpers/date\";\nexport * from \"./helpers/focus-event\";\nexport * from \"./helpers/util\";\n\nexport * from \"./services/component-factory.service\";\nexport * from \"./services/positioning.service\";\n\nexport * from \"./util.module\";\n"]} \ No newline at end of file diff --git a/dist/misc/util/index.metadata.json b/dist/misc/util/index.metadata.json new file mode 100644 index 000000000..962866182 --- /dev/null +++ b/dist/misc/util/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./helpers/custom-validator"},{"from":"./helpers/custom-value-accessor"},{"from":"./helpers/date"},{"from":"./helpers/focus-event"},{"from":"./helpers/util"},{"from":"./services/component-factory.service"},{"from":"./services/positioning.service"},{"from":"./util.module"}]}] \ No newline at end of file diff --git a/dist/misc/util/public.d.ts b/dist/misc/util/public.d.ts new file mode 100644 index 000000000..0e210927c --- /dev/null +++ b/dist/misc/util/public.d.ts @@ -0,0 +1 @@ +export { SuiUtilityModule } from "./index"; diff --git a/dist/misc/util/public.js b/dist/misc/util/public.js new file mode 100644 index 000000000..f1b0b9140 --- /dev/null +++ b/dist/misc/util/public.js @@ -0,0 +1,2 @@ +export { SuiUtilityModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/misc/util/public.js.map b/dist/misc/util/public.js.map new file mode 100644 index 000000000..91687bfc0 --- /dev/null +++ b/dist/misc/util/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/misc/util/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EACnB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiUtilityModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/misc/util/public.metadata.json b/dist/misc/util/public.metadata.json new file mode 100644 index 000000000..3a4a50211 --- /dev/null +++ b/dist/misc/util/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiUtilityModule"]}]}] \ No newline at end of file diff --git a/dist/misc/util/services/component-factory.service.d.ts b/dist/misc/util/services/component-factory.service.d.ts new file mode 100644 index 000000000..c7f70eeb7 --- /dev/null +++ b/dist/misc/util/services/component-factory.service.d.ts @@ -0,0 +1,18 @@ +import { ApplicationRef, ComponentFactoryResolver, Injector, ComponentRef, Provider, Type, ViewContainerRef, TemplateRef } from "@angular/core"; +export interface IImplicitContext { + $implicit?: T; +} +export declare class SuiComponentFactory { + private _applicationRef; + private _componentFactoryResolver; + private _injector; + constructor(_applicationRef: ApplicationRef, _componentFactoryResolver: ComponentFactoryResolver, _injector: Injector); + createComponent(type: Type, providers?: Provider[]): ComponentRef; + createView>(viewContainer: ViewContainerRef, template: TemplateRef, context: U): void; + attachToView(componentRef: ComponentRef, viewContainer: ViewContainerRef): void; + attachToApplication(componentRef: ComponentRef): void; + detachFromApplication(componentRef: ComponentRef): void; + moveToElement(componentRef: ComponentRef, element: Element): void; + moveToDocumentBody(componentRef: ComponentRef): void; + detachFromDocument(componentRef: ComponentRef): void; +} diff --git a/dist/misc/util/services/component-factory.service.js b/dist/misc/util/services/component-factory.service.js new file mode 100644 index 000000000..cc54ec72c --- /dev/null +++ b/dist/misc/util/services/component-factory.service.js @@ -0,0 +1,75 @@ +import { Injectable, ApplicationRef, ComponentFactoryResolver, Injector, ReflectiveInjector } from "@angular/core"; +var SuiComponentFactory = /** @class */ (function () { + function SuiComponentFactory(_applicationRef, _componentFactoryResolver, _injector) { + this._applicationRef = _applicationRef; + this._componentFactoryResolver = _componentFactoryResolver; + this._injector = _injector; + } + SuiComponentFactory.prototype.createComponent = function (type, providers) { + if (providers === void 0) { providers = []; } + // Resolve a factory for creating components of type `type`. + var factory = this._componentFactoryResolver.resolveComponentFactory(type); + // Resolve and create an injector with the specified providers. + var injector = ReflectiveInjector.resolveAndCreate(providers, this._injector); + // Create a component using the previously resolved factory & injector. + var componentRef = factory.create(injector); + return componentRef; + }; + SuiComponentFactory.prototype.createView = function (viewContainer, template, context) { + viewContainer.createEmbeddedView(template, context); + }; + // Inserts the component into the specified view container. + // Inserts the component into the specified view container. + SuiComponentFactory.prototype.attachToView = + // Inserts the component into the specified view container. + function (componentRef, viewContainer) { + viewContainer.insert(componentRef.hostView, 0); + }; + // Inserts the component in the root application node. + // Inserts the component in the root application node. + SuiComponentFactory.prototype.attachToApplication = + // Inserts the component in the root application node. + function (componentRef) { + this._applicationRef.attachView(componentRef.hostView); + }; + // Detaches the component from the root application node. + // Detaches the component from the root application node. + SuiComponentFactory.prototype.detachFromApplication = + // Detaches the component from the root application node. + function (componentRef) { + this._applicationRef.detachView(componentRef.hostView); + }; + // Moves the component to the specified DOM element. + // Moves the component to the specified DOM element. + SuiComponentFactory.prototype.moveToElement = + // Moves the component to the specified DOM element. + function (componentRef, element) { + element.appendChild(componentRef.location.nativeElement); + }; + // Moves the component to the document body. + // Moves the component to the document body. + SuiComponentFactory.prototype.moveToDocumentBody = + // Moves the component to the document body. + function (componentRef) { + this.moveToElement(componentRef, (document.querySelector("body"))); + }; + SuiComponentFactory.prototype.detachFromDocument = function (componentRef) { + var element = componentRef.location.nativeElement; + // We can't use `element.remove()` due to lack of IE11 support. + if (element.parentNode) { + element.parentNode.removeChild(element); + } + }; + SuiComponentFactory.decorators = [ + { type: Injectable }, + ]; + /** @nocollapse */ + SuiComponentFactory.ctorParameters = function () { return [ + { type: ApplicationRef, }, + { type: ComponentFactoryResolver, }, + { type: Injector, }, + ]; }; + return SuiComponentFactory; +}()); +export { SuiComponentFactory }; +//# sourceMappingURL=component-factory.service.js.map \ No newline at end of file diff --git a/dist/misc/util/services/component-factory.service.js.map b/dist/misc/util/services/component-factory.service.js.map new file mode 100644 index 000000000..d5e7d8494 --- /dev/null +++ b/dist/misc/util/services/component-factory.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"component-factory.service.js","sourceRoot":"","sources":["../../../../src/misc/util/services/component-factory.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EAAE,cAAc,EAAE,wBAAwB,EAAE,QAAQ,EAC9D,kBAAkB,EACrB,MAAM,eAA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IACrC,gDAAkB;;IAAzB,UAA6B,YAA4B;QACrD,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAA,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAE,CAAA,CAAC,CAAC;KACrE;IAEM,gDAAkB,GAAzB,UAA6B,YAA4B;QACrD,IAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAC,aAAwB,CAAC;;QAE/D,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;YACrB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SAC3C;KACJ;;gBAzDJ,UAAU;;;;gBARK,cAAc;gBAAE,wBAAwB;gBAAE,QAAQ;;8BADlE;;SAUa,mBAAmB","sourcesContent":["import {\n Injectable, ApplicationRef, ComponentFactoryResolver, Injector, ComponentRef,\n ReflectiveInjector, Provider, Type, ViewContainerRef, TemplateRef\n} from \"@angular/core\";\n\nexport interface IImplicitContext {\n $implicit?:T;\n}\n\n@Injectable()\nexport class SuiComponentFactory {\n constructor(private _applicationRef:ApplicationRef,\n private _componentFactoryResolver:ComponentFactoryResolver,\n private _injector:Injector) {}\n\n public createComponent(type:Type, providers:Provider[] = []):ComponentRef {\n // Resolve a factory for creating components of type `type`.\n const factory = this._componentFactoryResolver.resolveComponentFactory(type as Type);\n\n // Resolve and create an injector with the specified providers.\n const injector = ReflectiveInjector.resolveAndCreate(\n providers,\n this._injector\n );\n\n // Create a component using the previously resolved factory & injector.\n const componentRef = factory.create(injector);\n\n return componentRef;\n }\n\n public createView>(viewContainer:ViewContainerRef, template:TemplateRef, context:U):void {\n viewContainer.createEmbeddedView(template, context);\n }\n\n // Inserts the component into the specified view container.\n public attachToView(componentRef:ComponentRef, viewContainer:ViewContainerRef):void {\n viewContainer.insert(componentRef.hostView, 0);\n }\n\n // Inserts the component in the root application node.\n public attachToApplication(componentRef:ComponentRef):void {\n this._applicationRef.attachView(componentRef.hostView);\n }\n\n // Detaches the component from the root application node.\n public detachFromApplication(componentRef:ComponentRef):void {\n this._applicationRef.detachView(componentRef.hostView);\n }\n\n // Moves the component to the specified DOM element.\n public moveToElement(componentRef:ComponentRef, element:Element):void {\n element.appendChild(componentRef.location.nativeElement);\n }\n\n // Moves the component to the document body.\n public moveToDocumentBody(componentRef:ComponentRef):void {\n this.moveToElement(componentRef, document.querySelector(\"body\")!);\n }\n\n public detachFromDocument(componentRef:ComponentRef):void {\n const element = componentRef.location.nativeElement as Element;\n // We can't use `element.remove()` due to lack of IE11 support.\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/misc/util/services/component-factory.service.metadata.json b/dist/misc/util/services/component-factory.service.metadata.json new file mode 100644 index 000000000..6b536dca7 --- /dev/null +++ b/dist/misc/util/services/component-factory.service.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"IImplicitContext":{"__symbolic":"interface"},"SuiComponentFactory":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":9,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ApplicationRef","line":11,"character":40},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver","line":12,"character":50},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":13,"character":34}]}],"createComponent":[{"__symbolic":"method"}],"createView":[{"__symbolic":"method"}],"attachToView":[{"__symbolic":"method"}],"attachToApplication":[{"__symbolic":"method"}],"detachFromApplication":[{"__symbolic":"method"}],"moveToElement":[{"__symbolic":"method"}],"moveToDocumentBody":[{"__symbolic":"method"}],"detachFromDocument":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/misc/util/services/positioning.service.d.ts b/dist/misc/util/services/positioning.service.d.ts new file mode 100644 index 000000000..bdf0666e7 --- /dev/null +++ b/dist/misc/util/services/positioning.service.d.ts @@ -0,0 +1,39 @@ +import { ElementRef } from "@angular/core"; +import { Data } from "popper.js"; +export declare type PositioningPlacement = "auto" | "top left" | "top" | "top right" | "bottom left" | "bottom" | "bottom right" | "left top" | "left" | "left bottom" | "right top" | "right" | "right bottom"; +export declare const PositioningPlacement: { + Auto: PositioningPlacement; + TopLeft: PositioningPlacement; + Top: PositioningPlacement; + TopRight: PositioningPlacement; + LeftTop: PositioningPlacement; + Left: PositioningPlacement; + LeftBottom: PositioningPlacement; + BottomLeft: PositioningPlacement; + Bottom: PositioningPlacement; + BottomRight: PositioningPlacement; + RightTop: PositioningPlacement; + Right: PositioningPlacement; + RightBottom: PositioningPlacement; +}; +export interface IPositionBoundingBox { + width: number; + height: number; + top: number; + left: number; + bottom: number; + right: number; +} +export declare class PositioningService { + readonly anchor: ElementRef; + readonly subject: ElementRef; + private _popper; + private _popperState; + private _placement; + placement: PositioningPlacement; + readonly actualPlacement: PositioningPlacement; + readonly state: Data; + constructor(anchor: ElementRef, subject: ElementRef, placement: PositioningPlacement, arrowSelector?: string); + update(): void; + destroy(): void; +} diff --git a/dist/misc/util/services/positioning.service.js b/dist/misc/util/services/positioning.service.js new file mode 100644 index 000000000..41a24871e --- /dev/null +++ b/dist/misc/util/services/positioning.service.js @@ -0,0 +1,137 @@ +import Popper from "popper.js"; +export var PositioningPlacement = { + Auto: "auto", + TopLeft: "top left", + Top: "top", + TopRight: "top right", + LeftTop: "left top", + Left: "left", + LeftBottom: "left bottom", + BottomLeft: "bottom left", + Bottom: "bottom", + BottomRight: "bottom right", + RightTop: "right top", + Right: "right", + RightBottom: "right bottom" +}; +function placementToPopper(placement) { + if (!placement || placement === PositioningPlacement.Auto) { + return "auto"; + } + // All placements of the format: `direction alignment`, e.g. `top left`. + var _a = placement.split(" "), direction = _a[0], alignment = _a[1]; + // Direction alone covers case of just `top`, `left`, `bottom`, `right`. + var chosenPlacement = [direction]; + // Add `start` / `end` to placement, depending on alignment direction. + switch (alignment) { + case "top": + case "left": + chosenPlacement.push("start"); + break; + case "bottom": + case "right": + chosenPlacement.push("end"); + break; + } + // Join with hyphen to create Popper compatible placement. + return chosenPlacement.join("-"); +} +function popperToPlacement(popper) { + if (!popper || popper === "auto") { + return "auto"; + } + var _a = popper.split("-"), direction = _a[0], alignment = _a[1]; + var chosenPlacement = [direction]; + switch (direction) { + case "top": + case "bottom": + switch (alignment) { + case "start": + chosenPlacement.push("left"); + break; + case "end": + chosenPlacement.push("right"); + break; + } + break; + case "left": + case "right": + switch (alignment) { + case "start": + chosenPlacement.push("top"); + break; + case "end": + chosenPlacement.push("bottom"); + break; + } + break; + } + return chosenPlacement.join(" "); +} +var PositioningService = /** @class */ (function () { + function PositioningService(anchor, subject, placement, arrowSelector) { + var _this = this; + this.anchor = anchor; + this.subject = subject; + this._placement = placement; + var modifiers = { + computeStyle: { + gpuAcceleration: false + }, + preventOverflow: { + escapeWithReference: true, + boundariesElement: document.body + }, + arrow: { + element: arrowSelector + } + }; + if (!arrowSelector) { + delete modifiers.arrow; + } + this._popper = new Popper(anchor.nativeElement, subject.nativeElement, { + placement: placementToPopper(placement), + modifiers: modifiers, + onCreate: function (initial) { return _this._popperState = initial; }, + onUpdate: function (update) { return _this._popperState = update; } + }); + } + Object.defineProperty(PositioningService.prototype, "placement", { + get: function () { + return this._placement; + }, + set: function (placement) { + this._placement = placement; + this._popper.options.placement = placementToPopper(placement); + this.update(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PositioningService.prototype, "actualPlacement", { + get: function () { + if (!this._popperState) { + return PositioningPlacement.Auto; + } + return popperToPlacement(this._popperState.placement); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PositioningService.prototype, "state", { + get: function () { + return this._popperState; + }, + enumerable: true, + configurable: true + }); + PositioningService.prototype.update = function () { + this._popper.update(); + }; + PositioningService.prototype.destroy = function () { + this._popper.destroy(); + }; + return PositioningService; +}()); +export { PositioningService }; +//# sourceMappingURL=positioning.service.js.map \ No newline at end of file diff --git a/dist/misc/util/services/positioning.service.js.map b/dist/misc/util/services/positioning.service.js.map new file mode 100644 index 000000000..ce0c22dbe --- /dev/null +++ b/dist/misc/util/services/positioning.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"positioning.service.js","sourceRoot":"","sources":["../../../../src/misc/util/services/positioning.service.ts"],"names":[],"mappings":"AACA,OAAO,MAAqD,MAAM,WAAW,CAAC;AAmB9E,MAAM,CAAC,IAAM,oBAAoB,GAAG;IAChC,IAAI,EAAE,MAA8B;IACpC,OAAO,EAAE,UAAkC;IAC3C,GAAG,EAAE,KAA6B;IAClC,QAAQ,EAAE,WAAmC;IAC7C,OAAO,EAAE,UAAkC;IAC3C,IAAI,EAAE,MAA8B;IACpC,UAAU,EAAE,aAAqC;IACjD,UAAU,EAAE,aAAqC;IACjD,MAAM,EAAE,QAAgC;IACxC,WAAW,EAAE,cAAsC;IACnD,QAAQ,EAAE,WAAmC;IAC7C,KAAK,EAAE,OAA+B;IACtC,WAAW,EAAE,cAAsC;CACtD,CAAC;AAWF,2BAA2B,SAA8B;IACrD,EAAE,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,KAAK,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;QACxD,MAAM,CAAC,MAAM,CAAC;KACjB;;IAGD,+BAAO,iBAAS,EAAE,iBAAS,CAAyB;;IAGpD,IAAM,eAAe,GAAG,CAAC,SAAS,CAAC,CAAC;;IAGpC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QAChB,KAAK,KAAK,CAAC;QACX,KAAK,MAAM;YACP,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9B,KAAK,CAAC;QACV,KAAK,QAAQ,CAAC;QACd,KAAK,OAAO;YACR,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5B,KAAK,CAAC;KACb;;IAGD,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAc,CAAC;CACjD;AAED,2BAA2B,MAAa;IACpC,EAAE,CAAC,CAAC,C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C,OAAO,CAAC,OAAO,EAAE,CAAC;KAC1B;6BAlLL;IAmLC,CAAA;AAtED,8BAsEC","sourcesContent":["import { ElementRef } from \"@angular/core\";\nimport Popper, { Modifiers, PopperOptions, Placement, Data } from \"popper.js\";\n\ntype PopperModifiers = Modifiers & {\n computeStyle?:{\n gpuAcceleration:boolean;\n };\n};\ntype PopperInstance = Popper & {\n options:PopperOptions & {\n modifiers:PopperModifiers;\n };\n};\n\nexport type PositioningPlacement = \"auto\" |\n \"top left\" | \"top\" | \"top right\" |\n \"bottom left\" | \"bottom\" | \"bottom right\" |\n \"left top\" | \"left\" | \"left bottom\" |\n \"right top\" | \"right\" | \"right bottom\";\n\nexport const PositioningPlacement = {\n Auto: \"auto\" as PositioningPlacement,\n TopLeft: \"top left\" as PositioningPlacement,\n Top: \"top\" as PositioningPlacement,\n TopRight: \"top right\" as PositioningPlacement,\n LeftTop: \"left top\" as PositioningPlacement,\n Left: \"left\" as PositioningPlacement,\n LeftBottom: \"left bottom\" as PositioningPlacement,\n BottomLeft: \"bottom left\" as PositioningPlacement,\n Bottom: \"bottom\" as PositioningPlacement,\n BottomRight: \"bottom right\" as PositioningPlacement,\n RightTop: \"right top\" as PositioningPlacement,\n Right: \"right\" as PositioningPlacement,\n RightBottom: \"right bottom\" as PositioningPlacement\n};\n\nexport interface IPositionBoundingBox {\n width:number;\n height:number;\n top:number;\n left:number;\n bottom:number;\n right:number;\n}\n\nfunction placementToPopper(placement:PositioningPlacement):Placement {\n if (!placement || placement === PositioningPlacement.Auto) {\n return \"auto\";\n }\n\n // All placements of the format: `direction alignment`, e.g. `top left`.\n const [direction, alignment] = placement.split(\" \");\n\n // Direction alone covers case of just `top`, `left`, `bottom`, `right`.\n const chosenPlacement = [direction];\n\n // Add `start` / `end` to placement, depending on alignment direction.\n switch (alignment) {\n case \"top\":\n case \"left\":\n chosenPlacement.push(\"start\");\n break;\n case \"bottom\":\n case \"right\":\n chosenPlacement.push(\"end\");\n break;\n }\n\n // Join with hyphen to create Popper compatible placement.\n return chosenPlacement.join(\"-\") as Placement;\n}\n\nfunction popperToPlacement(popper:string):PositioningPlacement {\n if (!popper || popper === \"auto\") {\n return \"auto\";\n }\n\n const [direction, alignment] = popper.split(\"-\");\n\n const chosenPlacement = [direction];\n\n switch (direction) {\n case \"top\":\n case \"bottom\":\n switch (alignment) {\n case \"start\":\n chosenPlacement.push(\"left\");\n break;\n case \"end\":\n chosenPlacement.push(\"right\");\n break;\n }\n break;\n case \"left\":\n case \"right\":\n switch (alignment) {\n case \"start\":\n chosenPlacement.push(\"top\");\n break;\n case \"end\":\n chosenPlacement.push(\"bottom\");\n break;\n }\n break;\n }\n\n return chosenPlacement.join(\" \") as PositioningPlacement;\n}\n\nexport class PositioningService {\n public readonly anchor:ElementRef;\n public readonly subject:ElementRef;\n\n private _popper:PopperInstance;\n private _popperState:Data;\n private _placement:PositioningPlacement;\n\n public get placement():PositioningPlacement {\n return this._placement;\n }\n\n public set placement(placement:PositioningPlacement) {\n this._placement = placement;\n this._popper.options.placement = placementToPopper(placement);\n this.update();\n }\n\n public get actualPlacement():PositioningPlacement {\n if (!this._popperState) {\n return PositioningPlacement.Auto;\n }\n\n return popperToPlacement(this._popperState.placement);\n }\n\n public get state():Data {\n return this._popperState;\n }\n\n constructor(anchor:ElementRef, subject:ElementRef, placement:PositioningPlacement, arrowSelector?:string) {\n this.anchor = anchor;\n this.subject = subject;\n this._placement = placement;\n\n const modifiers:PopperModifiers = {\n computeStyle: {\n gpuAcceleration: false\n },\n preventOverflow: {\n escapeWithReference: true,\n boundariesElement: document.body\n },\n arrow: {\n element: arrowSelector\n }\n };\n\n if (!arrowSelector) {\n delete modifiers.arrow;\n }\n\n this._popper = new Popper(\n anchor.nativeElement,\n subject.nativeElement,\n {\n placement: placementToPopper(placement),\n modifiers,\n onCreate: initial => this._popperState = initial,\n onUpdate: update => this._popperState = update\n }) as PopperInstance;\n }\n\n public update():void {\n this._popper.update();\n }\n\n public destroy():void {\n this._popper.destroy();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/misc/util/services/positioning.service.metadata.json b/dist/misc/util/services/positioning.service.metadata.json new file mode 100644 index 000000000..d33b88fc9 --- /dev/null +++ b/dist/misc/util/services/positioning.service.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"PositioningPlacement":{"Auto":"auto","TopLeft":"top left","Top":"top","TopRight":"top right","LeftTop":"left top","Left":"left","LeftBottom":"left bottom","BottomLeft":"bottom left","Bottom":"bottom","BottomRight":"bottom right","RightTop":"right top","Right":"right","RightBottom":"right bottom"},"IPositionBoundingBox":{"__symbolic":"interface"},"PositioningService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":139,"character":23},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":139,"character":23},{"__symbolic":"error","message":"Could not resolve type","line":139,"character":65,"context":{"typeName":"PositioningPlacement"}},{"__symbolic":"reference","name":"string"}]}],"update":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/misc/util/util.module.d.ts b/dist/misc/util/util.module.d.ts new file mode 100644 index 000000000..e7ba03d96 --- /dev/null +++ b/dist/misc/util/util.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiUtilityModule { +} diff --git a/dist/misc/util/util.module.js b/dist/misc/util/util.module.js new file mode 100644 index 000000000..7b3e6c4b0 --- /dev/null +++ b/dist/misc/util/util.module.js @@ -0,0 +1,20 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiComponentFactory } from "./services/component-factory.service"; +var SuiUtilityModule = /** @class */ (function () { + function SuiUtilityModule() { + } + SuiUtilityModule.decorators = [ + { type: NgModule, args: [{ + imports: [CommonModule], + providers: [ + SuiComponentFactory + ] + },] }, + ]; + /** @nocollapse */ + SuiUtilityModule.ctorParameters = function () { return []; }; + return SuiUtilityModule; +}()); +export { SuiUtilityModule }; +//# sourceMappingURL=util.module.js.map \ No newline at end of file diff --git a/dist/misc/util/util.module.js.map b/dist/misc/util/util.module.js.map new file mode 100644 index 000000000..bfee6cd18 --- /dev/null +++ b/dist/misc/util/util.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.module.js","sourceRoot":"","sources":["../../../src/misc/util/util.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;;;;;gBAE1E,QAAQ,SAAC;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,SAAS,EAAE;wBACP,mBAAmB;qBACtB;iBACJ;;;;2BATD;;SAUa,gBAAgB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiComponentFactory } from \"./services/component-factory.service\";\n\n@NgModule({\n imports: [CommonModule],\n providers: [\n SuiComponentFactory\n ]\n})\nexport class SuiUtilityModule {}\n"]} \ No newline at end of file diff --git a/dist/misc/util/util.module.metadata.json b/dist/misc/util/util.module.metadata.json new file mode 100644 index 000000000..1216dabb0 --- /dev/null +++ b/dist/misc/util/util.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiUtilityModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":5,"character":14}],"providers":[{"__symbolic":"reference","module":"./services/component-factory.service","name":"SuiComponentFactory","line":7,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/accordion/accordion.module.d.ts b/dist/modules/accordion/accordion.module.d.ts new file mode 100644 index 000000000..5e71fd672 --- /dev/null +++ b/dist/modules/accordion/accordion.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiAccordionModule { +} diff --git a/dist/modules/accordion/accordion.module.js b/dist/modules/accordion/accordion.module.js new file mode 100644 index 000000000..fe6b6fdcd --- /dev/null +++ b/dist/modules/accordion/accordion.module.js @@ -0,0 +1,33 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiCollapseModule } from "../collapse/index"; +import { SuiTransitionModule } from "../transition/index"; +import { SuiAccordion } from "./components/accordion"; +import { SuiAccordionPanel } from "./components/accordion-panel"; +var SuiAccordionModule = /** @class */ (function () { + function SuiAccordionModule() { + } + SuiAccordionModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule, + SuiCollapseModule, + SuiTransitionModule + ], + declarations: [ + SuiAccordion, + SuiAccordionPanel + ], + exports: [ + SuiAccordion, + SuiAccordionPanel + ], + providers: [] + },] }, + ]; + /** @nocollapse */ + SuiAccordionModule.ctorParameters = function () { return []; }; + return SuiAccordionModule; +}()); +export { SuiAccordionModule }; +//# sourceMappingURL=accordion.module.js.map \ No newline at end of file diff --git a/dist/modules/accordion/accordion.module.js.map b/dist/modules/accordion/accordion.module.js.map new file mode 100644 index 000000000..d305526dc --- /dev/null +++ b/dist/modules/accordion/accordion.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"accordion.module.js","sourceRoot":"","sources":["../../../src/modules/accordion/accordion.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;;;;;gBAEhE,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,iBAAiB;wBACjB,mBAAmB;qBACtB;oBACD,YAAY,EAAE;wBACV,YAAY;wBACZ,iBAAiB;qBACpB;oBACD,OAAO,EAAE;wBACL,YAAY;wBACZ,iBAAiB;qBACpB;oBACD,SAAS,EAAE,EAAE;iBAChB;;;;6BAtBD;;SAuBa,kBAAkB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiCollapseModule } from \"../collapse/index\";\nimport { SuiTransitionModule } from \"../transition/index\";\nimport { SuiAccordion } from \"./components/accordion\";\nimport { SuiAccordionPanel } from \"./components/accordion-panel\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiCollapseModule,\n SuiTransitionModule\n ],\n declarations: [\n SuiAccordion,\n SuiAccordionPanel\n ],\n exports: [\n SuiAccordion,\n SuiAccordionPanel\n ],\n providers: []\n})\nexport class SuiAccordionModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/accordion.module.metadata.json b/dist/modules/accordion/accordion.module.metadata.json new file mode 100644 index 000000000..3efa77f7b --- /dev/null +++ b/dist/modules/accordion/accordion.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiAccordionModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":8},{"__symbolic":"reference","module":"../collapse/index","name":"SuiCollapseModule","line":10,"character":8},{"__symbolic":"reference","module":"../transition/index","name":"SuiTransitionModule","line":11,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/accordion","name":"SuiAccordion","line":14,"character":8},{"__symbolic":"reference","module":"./components/accordion-panel","name":"SuiAccordionPanel","line":15,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/accordion","name":"SuiAccordion","line":18,"character":8},{"__symbolic":"reference","module":"./components/accordion-panel","name":"SuiAccordionPanel","line":19,"character":8}],"providers":[]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion-panel.d.ts b/dist/modules/accordion/components/accordion-panel.d.ts new file mode 100644 index 000000000..5d8d8f98f --- /dev/null +++ b/dist/modules/accordion/components/accordion-panel.d.ts @@ -0,0 +1,17 @@ +import { EventEmitter, ChangeDetectorRef } from "@angular/core"; +import { SuiAccordionService } from "../services/accordion.service"; +import { TransitionController } from "../../transition/index"; +export declare class SuiAccordionPanel { + private _changeDetector; + private _service; + transitionController: TransitionController; + service: SuiAccordionService; + isDisabled: boolean; + private _isOpen; + isOpen: boolean; + readonly transition: string; + readonly transitionDuration: number; + isOpenChange: EventEmitter; + constructor(_changeDetector: ChangeDetectorRef); + toggle(): void; +} diff --git a/dist/modules/accordion/components/accordion-panel.js b/dist/modules/accordion/components/accordion-panel.js new file mode 100644 index 000000000..6e3b03cb8 --- /dev/null +++ b/dist/modules/accordion/components/accordion-panel.js @@ -0,0 +1,88 @@ +import { Component, Input, Output, EventEmitter, ChangeDetectorRef } from "@angular/core"; +import { TransitionController, Transition } from "../../transition/index"; +var SuiAccordionPanel = /** @class */ (function () { + function SuiAccordionPanel(_changeDetector) { + this._changeDetector = _changeDetector; + this.transitionController = new TransitionController(false); + this._isOpen = false; + this.isOpenChange = new EventEmitter(false); + } + Object.defineProperty(SuiAccordionPanel.prototype, "service", { + set: function (service) { + this._service = service; + this._changeDetector.detectChanges(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiAccordionPanel.prototype, "isOpen", { + get: function () { + return this._isOpen; + }, + set: function (value) { + // Convert to boolean (fixes false != undefined) + var isOpen = !!value; + if (isOpen !== this.isOpen) { + // Only update if the value has changed. + this._isOpen = isOpen; + if (isOpen && this._service) { + // If we are opening this panel, we must close the other ones. + this._service.closeOtherPanels(this); + } + this.isOpenChange.emit(this.isOpen); + // Cancel all current animations, and fade the contents. The direction is automatic. + this.transitionController.stopAll(); + this.transitionController.animate(new Transition(this.transition, this.transitionDuration)); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiAccordionPanel.prototype, "transition", { + get: function () { + if (this._service) { + return this._service.transition; + } + return "fade"; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiAccordionPanel.prototype, "transitionDuration", { + get: function () { + if (this._service) { + // Return the service defined transition duration. + return this._service.transitionDuration; + } + // Revert to instantaneous if the service is not yet loaded. + return 0; + }, + enumerable: true, + configurable: true + }); + SuiAccordionPanel.prototype.toggle = function () { + if (!this.isDisabled) { + this.isOpen = !this.isOpen; + } + }; + SuiAccordionPanel.decorators = [ + { type: Component, args: [{ + selector: "sui-accordion-panel", + exportAs: "suiAccordionPanel", + template: "\n\n
\n \n
\n\n
\n
\n \n
\n
\n", + styles: ["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiAccordionPanel.ctorParameters = function () { return [ + { type: ChangeDetectorRef, }, + ]; }; + SuiAccordionPanel.propDecorators = { + "isDisabled": [{ type: Input },], + "isOpen": [{ type: Input },], + "isOpenChange": [{ type: Output },], + }; + return SuiAccordionPanel; +}()); +export { SuiAccordionPanel }; +//# sourceMappingURL=accordion-panel.js.map \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion-panel.js.map b/dist/modules/accordion/components/accordion-panel.js.map new file mode 100644 index 000000000..86ab8b7ef --- /dev/null +++ b/dist/modules/accordion/components/accordion-panel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"accordion-panel.js","sourceRoot":"","sources":["../../../../src/modules/accordion/components/accordion-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;IAyFtE,2BAAoB,eAAiC;QAAjC,oBA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DAAkB;aAA7B;YACI,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;;gBAEhB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC;aAC3C;;YAED,MAAM,CAAC,CAAC,CAAC;SACZ;;;OAAA;IAYM,kCAAM,GAAb;QACI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;SAC9B;KACJ;;gBAlGJ,SAAS,SAAC;oBACP,QAAQ,EAAE,qBAAqB;oBAC/B,QAAQ,EAAE,mBAAmB;oBAC7B,QAAQ,EAAE,8ZAWb;oBACG,MAAM,EAAE,CAAC,2LAUZ,CAAC;iBACD;;;;gBA9BgD,iBAAiB;;;+BAyC7D,KAAK;2BAKL,KAAK;iCA0CL,MAAM;;4BAxFX;;SA+Ba,iBAAiB","sourcesContent":["import { Component, Input, Output, EventEmitter, ChangeDetectorRef } from \"@angular/core\";\nimport { SuiAccordionService } from \"../services/accordion.service\";\nimport { TransitionController, Transition } from \"../../transition/index\";\n\n@Component({\n selector: \"sui-accordion-panel\",\n exportAs: \"suiAccordionPanel\",\n template: `\n\n
\n \n
\n\n
\n
\n \n
\n
\n`,\n styles: [`\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n`]\n})\nexport class SuiAccordionPanel {\n private _service:SuiAccordionService;\n\n public transitionController:TransitionController;\n\n public set service(service:SuiAccordionService) {\n this._service = service;\n this._changeDetector.detectChanges();\n }\n\n @Input()\n public isDisabled:boolean;\n\n private _isOpen:boolean;\n\n @Input()\n public get isOpen():boolean {\n return this._isOpen;\n }\n\n public set isOpen(value:boolean) {\n // Convert to boolean (fixes false != undefined)\n const isOpen = !!value;\n\n if (isOpen !== this.isOpen) {\n // Only update if the value has changed.\n this._isOpen = isOpen;\n\n if (isOpen && this._service) {\n // If we are opening this panel, we must close the other ones.\n this._service.closeOtherPanels(this);\n }\n this.isOpenChange.emit(this.isOpen);\n\n // Cancel all current animations, and fade the contents. The direction is automatic.\n this.transitionController.stopAll();\n this.transitionController.animate(new Transition(this.transition, this.transitionDuration));\n }\n }\n\n public get transition():string {\n if (this._service) {\n return this._service.transition;\n }\n\n return \"fade\";\n }\n\n public get transitionDuration():number {\n if (this._service) {\n // Return the service defined transition duration.\n return this._service.transitionDuration;\n }\n // Revert to instantaneous if the service is not yet loaded.\n return 0;\n }\n\n @Output()\n public isOpenChange:EventEmitter;\n\n constructor(private _changeDetector:ChangeDetectorRef) {\n this.transitionController = new TransitionController(false);\n\n this._isOpen = false;\n this.isOpenChange = new EventEmitter(false);\n }\n\n public toggle():void {\n if (!this.isDisabled) {\n this.isOpen = !this.isOpen;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion-panel.metadata.json b/dist/modules/accordion/components/accordion-panel.metadata.json new file mode 100644 index 000000000..5409b82d4 --- /dev/null +++ b/dist/modules/accordion/components/accordion-panel.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiAccordionPanel":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"sui-accordion-panel","exportAs":"suiAccordionPanel","template":"\n\n
\n \n
\n\n
\n
\n \n
\n
\n","styles":["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"]}]}],"members":{"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":5}}]}],"isOpen":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":5}}]}],"isOpenChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":88,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":91,"character":40}]}],"toggle":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion.d.ts b/dist/modules/accordion/components/accordion.d.ts new file mode 100644 index 000000000..7ed82d443 --- /dev/null +++ b/dist/modules/accordion/components/accordion.d.ts @@ -0,0 +1,14 @@ +import { QueryList, AfterContentInit } from "@angular/core"; +import { SuiAccordionPanel } from "./accordion-panel"; +import { SuiAccordionService } from "../services/accordion.service"; +export declare class SuiAccordion implements AfterContentInit { + accordionClasses: boolean; + closeOthers: boolean; + transition: string; + transitionDuration: number; + protected _service: SuiAccordionService; + protected _panels: QueryList; + constructor(); + ngAfterContentInit(): void; + updatePanels(): void; +} diff --git a/dist/modules/accordion/components/accordion.js b/dist/modules/accordion/components/accordion.js new file mode 100644 index 000000000..e7b4c79d3 --- /dev/null +++ b/dist/modules/accordion/components/accordion.js @@ -0,0 +1,63 @@ +import { Component, Input, HostBinding, ContentChildren, QueryList } from "@angular/core"; +import { SuiAccordionPanel } from "./accordion-panel"; +import { SuiAccordionService } from "../services/accordion.service"; +var SuiAccordion = /** @class */ (function () { + function SuiAccordion() { + // Accordion service is unique to each set of panels. + this._service = new SuiAccordionService(); + this.accordionClasses = true; + } + Object.defineProperty(SuiAccordion.prototype, "closeOthers", { + get: function () { + return this._service.closeOthers; + }, + set: function (value) { + this._service.closeOthers = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiAccordion.prototype, "transition", { + set: function (transition) { + this._service.transition = transition; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiAccordion.prototype, "transitionDuration", { + set: function (duration) { + this._service.transitionDuration = duration; + }, + enumerable: true, + configurable: true + }); + SuiAccordion.prototype.ngAfterContentInit = function () { + var _this = this; + this.updatePanels(); + // Reconnect panels after they have updated. + this._panels.changes.subscribe(function () { return _this.updatePanels(); }); + }; + SuiAccordion.prototype.updatePanels = function () { + var _this = this; + this._panels.forEach(function (p) { return _this._service.addPanel(p); }); + }; + SuiAccordion.decorators = [ + { type: Component, args: [{ + selector: "sui-accordion", + template: "\n\n", + styles: ["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiAccordion.ctorParameters = function () { return []; }; + SuiAccordion.propDecorators = { + "accordionClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.accordion",] },], + "closeOthers": [{ type: Input },], + "transition": [{ type: Input },], + "transitionDuration": [{ type: Input },], + "_panels": [{ type: ContentChildren, args: [SuiAccordionPanel,] },], + }; + return SuiAccordion; +}()); +export { SuiAccordion }; +//# sourceMappingURL=accordion.js.map \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion.js.map b/dist/modules/accordion/components/accordion.js.map new file mode 100644 index 000000000..10f6399bd --- /dev/null +++ b/dist/modules/accordion/components/accordion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../../src/modules/accordion/components/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAoB,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;;IAgDhE;;QAEI,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAE1C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;KAChC;0BA5BU,qCAAW;;YAClB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;;aAGrC,UAAuB,KAAa;YAChC,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,KAAK,CAAC;SACrC;;;;0BAGU,oCAAU;uBAAC,UAAiB;YACnC,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC;;;;;0BAI/B,4CAAkB;uBAAC,QAAe;YACzC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,GAAG,QAAQ,CAAC;;;;;IAezC,yCAAkB,GAAzB;QAAA,iBAKC;QAJG,IAAI,CAAC,YAAY,EAAE,CAAC;;QAGpB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,YAAY,EAAE,EAAnB,CAAmB,CAAC,CAAC;KAC7D;IAEM,mCAAY,GAAnB;QAAA,iBAEC;QADG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,KAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAzB,CAAyB,CAAC,CAAC;KACxD;;gBA9DJ,SAAS,SAAC;oBACP,QAAQ,EAAE,eAAe;oBACzB,QAAQ,EAAE,+BAEb;oBACG,MAAM,EAAE,CAAC,gMAUZ,CAAC;iBACD;;;;;qCAEI,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,iBAAiB;gCAG7B,KAAK;+BASL,KAAK;uCAKL,KAAK;4BAOL,eAAe,SAAC,iBAAiB;;uBA/CtC;;SAqBa,YAAY","sourcesContent":["import { Component, Input, HostBinding, ContentChildren, QueryList, AfterContentInit } from \"@angular/core\";\nimport { SuiAccordionPanel } from \"./accordion-panel\";\nimport { SuiAccordionService } from \"../services/accordion.service\";\n\n@Component({\n selector: \"sui-accordion\",\n template: `\n\n`,\n styles: [`\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n`]\n})\nexport class SuiAccordion implements AfterContentInit {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.accordion\")\n public accordionClasses:boolean;\n\n @Input()\n public get closeOthers():boolean {\n return this._service.closeOthers;\n }\n\n public set closeOthers(value:boolean) {\n this._service.closeOthers = value;\n }\n\n @Input()\n public set transition(transition:string) {\n this._service.transition = transition;\n }\n\n @Input()\n public set transitionDuration(duration:number) {\n this._service.transitionDuration = duration;\n }\n\n protected _service:SuiAccordionService;\n\n @ContentChildren(SuiAccordionPanel)\n protected _panels:QueryList;\n\n constructor() {\n // Accordion service is unique to each set of panels.\n this._service = new SuiAccordionService();\n\n this.accordionClasses = true;\n }\n\n public ngAfterContentInit():void {\n this.updatePanels();\n\n // Reconnect panels after they have updated.\n this._panels.changes.subscribe(() => this.updatePanels());\n }\n\n public updatePanels():void {\n this._panels.forEach(p => this._service.addPanel(p));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion.metadata.json b/dist/modules/accordion/components/accordion.metadata.json new file mode 100644 index 000000000..be07d8dc8 --- /dev/null +++ b/dist/modules/accordion/components/accordion.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiAccordion":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"sui-accordion","template":"\n\n","styles":["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"]}]}],"members":{"accordionClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":22,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":23,"character":5},"arguments":["class.accordion"]}]}],"closeOthers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":5}}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":5}}]}],"_panels":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":47,"character":5},"arguments":[{"__symbolic":"reference","module":"./accordion-panel","name":"SuiAccordionPanel","line":47,"character":21}]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngAfterContentInit":[{"__symbolic":"method"}],"updatePanels":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/accordion/index.d.ts b/dist/modules/accordion/index.d.ts new file mode 100644 index 000000000..896dfdbf3 --- /dev/null +++ b/dist/modules/accordion/index.d.ts @@ -0,0 +1,4 @@ +export * from "./components/accordion-panel"; +export * from "./components/accordion"; +export * from "./services/accordion.service"; +export * from "./accordion.module"; diff --git a/dist/modules/accordion/index.js b/dist/modules/accordion/index.js new file mode 100644 index 000000000..734002508 --- /dev/null +++ b/dist/modules/accordion/index.js @@ -0,0 +1,5 @@ +export * from "./components/accordion-panel"; +export * from "./components/accordion"; +export * from "./services/accordion.service"; +export * from "./accordion.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/accordion/index.js.map b/dist/modules/accordion/index.js.map new file mode 100644 index 000000000..5662209db --- /dev/null +++ b/dist/modules/accordion/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/accordion/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AAEvC,cAAc,8BAA8B,CAAC;AAE7C,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./components/accordion-panel\";\nexport * from \"./components/accordion\";\n\nexport * from \"./services/accordion.service\";\n\nexport * from \"./accordion.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/index.metadata.json b/dist/modules/accordion/index.metadata.json new file mode 100644 index 000000000..aa6b00556 --- /dev/null +++ b/dist/modules/accordion/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/accordion-panel"},{"from":"./components/accordion"},{"from":"./services/accordion.service"},{"from":"./accordion.module"}]}] \ No newline at end of file diff --git a/dist/modules/accordion/public.d.ts b/dist/modules/accordion/public.d.ts new file mode 100644 index 000000000..fa2e1c44a --- /dev/null +++ b/dist/modules/accordion/public.d.ts @@ -0,0 +1 @@ +export { SuiAccordionModule } from "./index"; diff --git a/dist/modules/accordion/public.js b/dist/modules/accordion/public.js new file mode 100644 index 000000000..92bd30f52 --- /dev/null +++ b/dist/modules/accordion/public.js @@ -0,0 +1,2 @@ +export { SuiAccordionModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/accordion/public.js.map b/dist/modules/accordion/public.js.map new file mode 100644 index 000000000..0c82b149f --- /dev/null +++ b/dist/modules/accordion/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/accordion/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EACrB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiAccordionModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/public.metadata.json b/dist/modules/accordion/public.metadata.json new file mode 100644 index 000000000..39e93a7b5 --- /dev/null +++ b/dist/modules/accordion/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiAccordionModule"]}]}] \ No newline at end of file diff --git a/dist/modules/accordion/services/accordion.service.d.ts b/dist/modules/accordion/services/accordion.service.d.ts new file mode 100644 index 000000000..3ce70abe1 --- /dev/null +++ b/dist/modules/accordion/services/accordion.service.d.ts @@ -0,0 +1,10 @@ +import { SuiAccordionPanel } from "../components/accordion-panel"; +export declare class SuiAccordionService { + closeOthers: boolean; + transition: string; + transitionDuration: number; + panels: SuiAccordionPanel[]; + constructor(); + addPanel(panel: SuiAccordionPanel): void; + closeOtherPanels(panel: SuiAccordionPanel): void; +} diff --git a/dist/modules/accordion/services/accordion.service.js b/dist/modules/accordion/services/accordion.service.js new file mode 100644 index 000000000..a52133bd7 --- /dev/null +++ b/dist/modules/accordion/services/accordion.service.js @@ -0,0 +1,25 @@ +var SuiAccordionService = /** @class */ (function () { + function SuiAccordionService() { + this.closeOthers = true; + this.transition = "fade"; + this.transitionDuration = 350; + this.panels = []; + } + SuiAccordionService.prototype.addPanel = function (panel) { + panel.service = this; + this.panels.push(panel); + }; + SuiAccordionService.prototype.closeOtherPanels = function (panel) { + if (!this.closeOthers) { + return; + } + this.panels.forEach(function (p) { + if (p !== panel) { + p.isOpen = false; + } + }); + }; + return SuiAccordionService; +}()); +export { SuiAccordionService }; +//# sourceMappingURL=accordion.service.js.map \ No newline at end of file diff --git a/dist/modules/accordion/services/accordion.service.js.map b/dist/modules/accordion/services/accordion.service.js.map new file mode 100644 index 000000000..2b3d6ae27 --- /dev/null +++ b/dist/modules/accordion/services/accordion.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"accordion.service.js","sourceRoot":"","sources":["../../../../src/modules/accordion/services/accordion.service.ts"],"names":[],"mappings":"AAEA,IAAA;IAQI;QACI,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAExB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC;QAE9B,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;KACpB;IAEM,sCAAQ,GAAf,UAAgB,KAAuB;QACnC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC3B;IAEM,8CAAgB,GAAvB,UAAwB,KAAuB;QAC3C,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;YACpB,MAAM,CAAC;SACV;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC;YACjB,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;gBACd,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;aACpB;SACJ,CAAC,CAAC;KACN;8BAlCL;IAmCC,CAAA;AAjCD,+BAiCC","sourcesContent":["import { SuiAccordionPanel } from \"../components/accordion-panel\";\n\nexport class SuiAccordionService {\n public closeOthers:boolean;\n\n public transition:string;\n public transitionDuration:number;\n\n public panels:SuiAccordionPanel[];\n\n constructor() {\n this.closeOthers = true;\n\n this.transition = \"fade\";\n this.transitionDuration = 350;\n\n this.panels = [];\n }\n\n public addPanel(panel:SuiAccordionPanel):void {\n panel.service = this;\n this.panels.push(panel);\n }\n\n public closeOtherPanels(panel:SuiAccordionPanel):void {\n if (!this.closeOthers) {\n return;\n }\n\n this.panels.forEach(p => {\n if (p !== panel) {\n p.isOpen = false;\n }\n });\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/services/accordion.service.metadata.json b/dist/modules/accordion/services/accordion.service.metadata.json new file mode 100644 index 000000000..d973e1e32 --- /dev/null +++ b/dist/modules/accordion/services/accordion.service.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiAccordionService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor"}],"addPanel":[{"__symbolic":"method"}],"closeOtherPanels":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/checkbox/checkbox.module.d.ts b/dist/modules/checkbox/checkbox.module.d.ts new file mode 100644 index 000000000..7dd0fb9d5 --- /dev/null +++ b/dist/modules/checkbox/checkbox.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiCheckboxModule { +} diff --git a/dist/modules/checkbox/checkbox.module.js b/dist/modules/checkbox/checkbox.module.js new file mode 100644 index 000000000..1f2a059bc --- /dev/null +++ b/dist/modules/checkbox/checkbox.module.js @@ -0,0 +1,37 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; +import { SuiCheckbox, SuiCheckboxValueAccessor } from "./components/checkbox"; +import { SuiRadio, SuiRadioValueAccessor } from "./components/radio"; +import { SuiRadioManager } from "./directives/radio-manager"; +var SuiCheckboxModule = /** @class */ (function () { + function SuiCheckboxModule() { + } + SuiCheckboxModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule, + FormsModule + ], + declarations: [ + SuiCheckbox, + SuiCheckboxValueAccessor, + SuiRadio, + SuiRadioValueAccessor, + SuiRadioManager + ], + exports: [ + SuiCheckbox, + SuiCheckboxValueAccessor, + SuiRadio, + SuiRadioValueAccessor, + SuiRadioManager + ] + },] }, + ]; + /** @nocollapse */ + SuiCheckboxModule.ctorParameters = function () { return []; }; + return SuiCheckboxModule; +}()); +export { SuiCheckboxModule }; +//# sourceMappingURL=checkbox.module.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/checkbox.module.js.map b/dist/modules/checkbox/checkbox.module.js.map new file mode 100644 index 000000000..5f378b4ff --- /dev/null +++ b/dist/modules/checkbox/checkbox.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"checkbox.module.js","sourceRoot":"","sources":["../../../src/modules/checkbox/checkbox.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;;;;;gBAE5D,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;qBACd;oBACD,YAAY,EAAE;wBACV,WAAW;wBACX,wBAAwB;wBACxB,QAAQ;wBACR,qBAAqB;wBACrB,eAAe;qBAClB;oBACD,OAAO,EAAE;wBACL,WAAW;wBACX,wBAAwB;wBACxB,QAAQ;wBACR,qBAAqB;wBACrB,eAAe;qBAClB;iBACJ;;;;4BA1BD;;SA2Ba,iBAAiB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { SuiCheckbox, SuiCheckboxValueAccessor } from \"./components/checkbox\";\nimport { SuiRadio, SuiRadioValueAccessor } from \"./components/radio\";\nimport { SuiRadioManager } from \"./directives/radio-manager\";\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule\n ],\n declarations: [\n SuiCheckbox,\n SuiCheckboxValueAccessor,\n SuiRadio,\n SuiRadioValueAccessor,\n SuiRadioManager\n ],\n exports: [\n SuiCheckbox,\n SuiCheckboxValueAccessor,\n SuiRadio,\n SuiRadioValueAccessor,\n SuiRadioManager\n ]\n})\nexport class SuiCheckboxModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/checkbox.module.metadata.json b/dist/modules/checkbox/checkbox.module.metadata.json new file mode 100644 index 000000000..edcf61967 --- /dev/null +++ b/dist/modules/checkbox/checkbox.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiCheckboxModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":10,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/checkbox","name":"SuiCheckbox","line":13,"character":8},{"__symbolic":"reference","module":"./components/checkbox","name":"SuiCheckboxValueAccessor","line":14,"character":8},{"__symbolic":"reference","module":"./components/radio","name":"SuiRadio","line":15,"character":8},{"__symbolic":"reference","module":"./components/radio","name":"SuiRadioValueAccessor","line":16,"character":8},{"__symbolic":"reference","module":"./directives/radio-manager","name":"SuiRadioManager","line":17,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/checkbox","name":"SuiCheckbox","line":20,"character":8},{"__symbolic":"reference","module":"./components/checkbox","name":"SuiCheckboxValueAccessor","line":21,"character":8},{"__symbolic":"reference","module":"./components/radio","name":"SuiRadio","line":22,"character":8},{"__symbolic":"reference","module":"./components/radio","name":"SuiRadioValueAccessor","line":23,"character":8},{"__symbolic":"reference","module":"./directives/radio-manager","name":"SuiRadioManager","line":24,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/checkbox/components/checkbox.d.ts b/dist/modules/checkbox/components/checkbox.d.ts new file mode 100644 index 000000000..7d5860293 --- /dev/null +++ b/dist/modules/checkbox/components/checkbox.d.ts @@ -0,0 +1,24 @@ +import { EventEmitter } from "@angular/core"; +import { ICustomValueAccessorHost, CustomValueAccessor } from "../../../misc/util/index"; +export declare class SuiCheckbox implements ICustomValueAccessorHost { + private _checkboxClasses; + name: string; + isChecked: boolean; + onCheckChange: EventEmitter; + onTouched: EventEmitter; + isDisabled: boolean; + isReadonly: boolean; + readonly checkedAttribute: string | undefined; + readonly isDisabledAttribute: string | undefined; + private _checkboxElement; + constructor(); + onMouseDown(e: MouseEvent): void; + onClick(): void; + onFocusOut(): void; + toggle(): void; + writeValue(value: boolean): void; + private focusCheckbox(); +} +export declare class SuiCheckboxValueAccessor extends CustomValueAccessor { + constructor(host: SuiCheckbox); +} diff --git a/dist/modules/checkbox/components/checkbox.js b/dist/modules/checkbox/components/checkbox.js new file mode 100644 index 000000000..0e836847e --- /dev/null +++ b/dist/modules/checkbox/components/checkbox.js @@ -0,0 +1,105 @@ +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 __()); + }; +})(); +import { Component, Directive, Input, Output, HostListener, HostBinding, EventEmitter, ViewChild, ElementRef } from "@angular/core"; +import { customValueAccessorFactory, CustomValueAccessor } from "../../../misc/util/index"; +var SuiCheckbox = /** @class */ (function () { + function SuiCheckbox() { + this.isChecked = false; + this.onCheckChange = new EventEmitter(); + this.onTouched = new EventEmitter(); + this.isDisabled = false; + this.isReadonly = false; + this._checkboxClasses = true; + } + Object.defineProperty(SuiCheckbox.prototype, "checkedAttribute", { + get: function () { + return this.isChecked ? "" : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCheckbox.prototype, "isDisabledAttribute", { + get: function () { + return this.isDisabled ? "disabled" : undefined; + }, + enumerable: true, + configurable: true + }); + SuiCheckbox.prototype.onMouseDown = function (e) { + e.preventDefault(); + }; + SuiCheckbox.prototype.onClick = function () { + if (!this.isDisabled && !this.isReadonly) { + this.toggle(); + this.focusCheckbox(); + } + }; + SuiCheckbox.prototype.onFocusOut = function () { + this.onTouched.emit(); + }; + SuiCheckbox.prototype.toggle = function () { + this.isChecked = !this.isChecked; + this.onCheckChange.emit(this.isChecked); + }; + SuiCheckbox.prototype.writeValue = function (value) { + this.isChecked = value; + }; + SuiCheckbox.prototype.focusCheckbox = function () { + this._checkboxElement.nativeElement.focus(); + }; + SuiCheckbox.decorators = [ + { type: Component, args: [{ + selector: "sui-checkbox", + exportAs: "suiCheckbox", + template: "\n\n\n" + },] }, + ]; + /** @nocollapse */ + SuiCheckbox.ctorParameters = function () { return []; }; + SuiCheckbox.propDecorators = { + "_checkboxClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.checkbox",] },], + "name": [{ type: Input },], + "isChecked": [{ type: HostBinding, args: ["class.checked",] },], + "onCheckChange": [{ type: Output, args: ["checkChange",] },], + "onTouched": [{ type: Output, args: ["touched",] },], + "isDisabled": [{ type: Input },], + "isReadonly": [{ type: HostBinding, args: ["class.read-only",] }, { type: Input },], + "_checkboxElement": [{ type: ViewChild, args: ["checkbox",] },], + "onMouseDown": [{ type: HostListener, args: ["mousedown", ["$event"],] },], + "onClick": [{ type: HostListener, args: ["click",] },], + "onFocusOut": [{ type: HostListener, args: ["focusout",] },], + }; + return SuiCheckbox; +}()); +export { SuiCheckbox }; +var SuiCheckboxValueAccessor = /** @class */ (function (_super) { + __extends(SuiCheckboxValueAccessor, _super); + function SuiCheckboxValueAccessor(host) { + return _super.call(this, host) || this; + } + SuiCheckboxValueAccessor.decorators = [ + { type: Directive, args: [{ + selector: "sui-checkbox", + host: { + "(checkChange)": "onChange($event)", + "(touched)": "onTouched()" + }, + providers: [customValueAccessorFactory(SuiCheckboxValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiCheckboxValueAccessor.ctorParameters = function () { return [ + { type: SuiCheckbox, }, + ]; }; + return SuiCheckboxValueAccessor; +}(CustomValueAccessor)); +export { SuiCheckboxValueAccessor }; +//# sourceMappingURL=checkbox.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/components/checkbox.js.map b/dist/modules/checkbox/components/checkbox.js.map new file mode 100644 index 000000000..05d869985 --- /dev/null +++ b/dist/modules/checkbox/components/checkbox.js.map @@ -0,0 +1 @@ +{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../../src/modules/checkbox/components/checkbox.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAC9D,YAAY,EAAE,SAAS,EAAE,UAAU,EACtC,MAAM,eAAe,CAAC;AACvB,OAAO,EAA4B,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;;IAqDj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,EAAE,cAAc;oBACxB,QAAQ,EAAE,aAAa;oBACvB,QAAQ,EAAE,uRAWb;iBACA;;;;;qCAEI,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,gBAAgB;yBAG5B,KAAK;8BAGL,WAAW,SAAC,eAAe;kCAG3B,MAAM,SAAC,aAAa;8BAGpB,MAAM,SAAC,SAAS;+BAGhB,KAAK;+BAGL,WAAW,SAAC,iBAAiB,cAC7B,KAAK;qCAWL,SAAS,SAAC,UAAU;gCAcpB,YAAY,SAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;4BAKpC,YAAY,SAAC,OAAO;+BAQpB,YAAY,SAAC,UAAU;;sBAjF5B;;SAsBa,WAAW;;IAsFsB,4CAAyC;IACnF,kCAAY,IAAgB;eACxB,kBAAM,IAAI,CAAC;KACd;;gBAXJ,SAAS,SAAC;oBACP,QAAQ,EAAE,cAAc;oBACxB,IAAI,EAAE;wBACF,eAAe,EAAE,kBAAkB;wBACnC,WAAW,EAAE,aAAa;qBAC7B;oBACD,SAAS,EAAE,CAAC,0BAA0B,CAAC,wBAAwB,CAAC,CAAC;iBACpE;;;;gBArFY,WAAW;;mCAtBxB;EA4G8C,mBAAmB;SAApD,wBAAwB","sourcesContent":["import {\n Component, Directive, Input, Output, HostListener, HostBinding,\n EventEmitter, ViewChild, ElementRef\n} from \"@angular/core\";\nimport { ICustomValueAccessorHost, customValueAccessorFactory, CustomValueAccessor } from \"../../../misc/util/index\";\n\n@Component({\n selector: \"sui-checkbox\",\n exportAs: \"suiCheckbox\",\n template: `\n\n\n`\n})\nexport class SuiCheckbox implements ICustomValueAccessorHost {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.checkbox\")\n private _checkboxClasses:boolean;\n\n @Input()\n public name:string;\n\n @HostBinding(\"class.checked\")\n public isChecked:boolean;\n\n @Output(\"checkChange\")\n public onCheckChange:EventEmitter;\n\n @Output(\"touched\")\n public onTouched:EventEmitter;\n\n @Input()\n public isDisabled:boolean;\n\n @HostBinding(\"class.read-only\")\n @Input()\n public isReadonly:boolean;\n\n public get checkedAttribute():string | undefined {\n return this.isChecked ? \"\" : undefined;\n }\n\n public get isDisabledAttribute():string | undefined {\n return this.isDisabled ? \"disabled\" : undefined;\n }\n\n @ViewChild(\"checkbox\")\n private _checkboxElement:ElementRef;\n\n constructor() {\n this.isChecked = false;\n this.onCheckChange = new EventEmitter();\n this.onTouched = new EventEmitter();\n\n this.isDisabled = false;\n this.isReadonly = false;\n\n this._checkboxClasses = true;\n }\n\n @HostListener(\"mousedown\", [\"$event\"])\n public onMouseDown(e:MouseEvent):void {\n e.preventDefault();\n }\n\n @HostListener(\"click\")\n public onClick():void {\n if (!this.isDisabled && !this.isReadonly) {\n this.toggle();\n this.focusCheckbox();\n }\n }\n\n @HostListener(\"focusout\")\n public onFocusOut():void {\n this.onTouched.emit();\n }\n\n public toggle():void {\n this.isChecked = !this.isChecked;\n this.onCheckChange.emit(this.isChecked);\n }\n\n public writeValue(value:boolean):void {\n this.isChecked = value;\n }\n\n private focusCheckbox():void {\n this._checkboxElement.nativeElement.focus();\n }\n}\n\n@Directive({\n selector: \"sui-checkbox\",\n host: {\n \"(checkChange)\": \"onChange($event)\",\n \"(touched)\": \"onTouched()\"\n },\n providers: [customValueAccessorFactory(SuiCheckboxValueAccessor)]\n})\nexport class SuiCheckboxValueAccessor extends CustomValueAccessor {\n constructor(host:SuiCheckbox) {\n super(host);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/components/checkbox.metadata.json b/dist/modules/checkbox/components/checkbox.metadata.json new file mode 100644 index 000000000..613ba0059 --- /dev/null +++ b/dist/modules/checkbox/components/checkbox.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiCheckbox":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"sui-checkbox","exportAs":"suiCheckbox","template":"\n\n\n"}]}],"members":{"_checkboxClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":23,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":24,"character":5},"arguments":["class.checkbox"]}]}],"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":5}}]}],"isChecked":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":30,"character":5},"arguments":["class.checked"]}]}],"onCheckChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":33,"character":5},"arguments":["checkChange"]}]}],"onTouched":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":36,"character":5},"arguments":["touched"]}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":5}}]}],"isReadonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":42,"character":5},"arguments":["class.read-only"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":5}}]}],"_checkboxElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":54,"character":5},"arguments":["checkbox"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"onMouseDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":68,"character":5},"arguments":["mousedown",["$event"]]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":73,"character":5},"arguments":["click"]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":81,"character":5},"arguments":["focusout"]}]}],"toggle":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"focusCheckbox":[{"__symbolic":"method"}]}},"SuiCheckboxValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":108,"character":46},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":100,"character":1},"arguments":[{"selector":"sui-checkbox","host":{"(checkChange)":"onChange($event)","(touched)":"onTouched()","$quoted$":["(checkChange)","(touched)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":106,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiCheckboxValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiCheckbox"}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/checkbox/components/radio.d.ts b/dist/modules/checkbox/components/radio.d.ts new file mode 100644 index 000000000..98689925c --- /dev/null +++ b/dist/modules/checkbox/components/radio.d.ts @@ -0,0 +1,26 @@ +import { EventEmitter } from "@angular/core"; +import { ICustomValueAccessorHost, CustomValueAccessor } from "../../../misc/util/index"; +export declare class SuiRadio implements ICustomValueAccessorHost { + private _radioClasses; + name: string; + value: T; + isChecked: boolean; + currentValue: T; + onCurrentValueChange: EventEmitter; + onTouched: EventEmitter; + isDisabled: boolean; + isReadonly: boolean; + private _radioElement; + readonly checkedAttribute: string | undefined; + readonly isDisabledAttribute: string | undefined; + constructor(); + onMouseDown(e: MouseEvent): void; + onClick(): void; + onFocusOut(): void; + update(): void; + writeValue(value: T): void; + private focusRadio(); +} +export declare class SuiRadioValueAccessor extends CustomValueAccessor> { + constructor(host: SuiRadio); +} diff --git a/dist/modules/checkbox/components/radio.js b/dist/modules/checkbox/components/radio.js new file mode 100644 index 000000000..dd078f8d9 --- /dev/null +++ b/dist/modules/checkbox/components/radio.js @@ -0,0 +1,108 @@ +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 __()); + }; +})(); +import { Component, Directive, Input, Output, HostListener, HostBinding, EventEmitter, ViewChild, ElementRef } from "@angular/core"; +import { customValueAccessorFactory, CustomValueAccessor } from "../../../misc/util/index"; +var SuiRadio = /** @class */ (function () { + function SuiRadio() { + this._radioClasses = true; + this.isChecked = false; + this.onCurrentValueChange = new EventEmitter(); + this.onTouched = new EventEmitter(); + this.isDisabled = false; + this.isReadonly = false; + this._radioClasses = true; + } + Object.defineProperty(SuiRadio.prototype, "checkedAttribute", { + get: function () { + return this.isChecked ? "" : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiRadio.prototype, "isDisabledAttribute", { + get: function () { + return this.isDisabled ? "disabled" : undefined; + }, + enumerable: true, + configurable: true + }); + SuiRadio.prototype.onMouseDown = function (e) { + e.preventDefault(); + }; + SuiRadio.prototype.onClick = function () { + if (!this.isDisabled && !this.isReadonly) { + this.currentValue = this.value; + this.onCurrentValueChange.emit(this.currentValue); + this.update(); + this.focusRadio(); + } + }; + SuiRadio.prototype.onFocusOut = function () { + this.onTouched.emit(); + }; + SuiRadio.prototype.update = function () { + this.isChecked = this.currentValue === this.value; + }; + SuiRadio.prototype.writeValue = function (value) { + this.currentValue = value; + this.update(); + }; + SuiRadio.prototype.focusRadio = function () { + this._radioElement.nativeElement.focus(); + }; + SuiRadio.decorators = [ + { type: Component, args: [{ + selector: "sui-radio-button", + template: "\n\n\n" + },] }, + ]; + /** @nocollapse */ + SuiRadio.ctorParameters = function () { return []; }; + SuiRadio.propDecorators = { + "_radioClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.radio",] }, { type: HostBinding, args: ["class.checkbox",] },], + "name": [{ type: Input },], + "value": [{ type: Input },], + "isChecked": [{ type: HostBinding, args: ["class.checked",] },], + "onCurrentValueChange": [{ type: Output, args: ["currentValueChange",] },], + "onTouched": [{ type: Output, args: ["touched",] },], + "isDisabled": [{ type: Input },], + "isReadonly": [{ type: HostBinding, args: ["class.read-only",] }, { type: Input },], + "_radioElement": [{ type: ViewChild, args: ["radio",] },], + "onMouseDown": [{ type: HostListener, args: ["mousedown", ["$event"],] },], + "onClick": [{ type: HostListener, args: ["click",] },], + "onFocusOut": [{ type: HostListener, args: ["focusout",] },], + }; + return SuiRadio; +}()); +export { SuiRadio }; +var SuiRadioValueAccessor = /** @class */ (function (_super) { + __extends(SuiRadioValueAccessor, _super); + function SuiRadioValueAccessor(host) { + return _super.call(this, host) || this; + } + SuiRadioValueAccessor.decorators = [ + { type: Directive, args: [{ + selector: "sui-radio-button", + host: { + "(currentValueChange)": "onChange($event)", + "(touched)": "onTouched()" + }, + providers: [customValueAccessorFactory(SuiRadioValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiRadioValueAccessor.ctorParameters = function () { return [ + { type: SuiRadio, }, + ]; }; + return SuiRadioValueAccessor; +}(CustomValueAccessor)); +export { SuiRadioValueAccessor }; +//# sourceMappingURL=radio.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/components/radio.js.map b/dist/modules/checkbox/components/radio.js.map new file mode 100644 index 000000000..c42ea42ea --- /dev/null +++ b/dist/modules/checkbox/components/radio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/modules/checkbox/components/radio.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EA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AC,KAAK,CAAC;KACrD;IAEM,6BAAU,GAAjB,UAAkB,KAAO;QACrB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,MAAM,EAAE,CAAC;KACjB;IAEO,6BAAU,GAAlB;QACI,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;KAC5C;;gBAnGJ,SAAS,SAAC;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,QAAQ,EAAE,6TAYb;iBACA;;;;;kCAEI,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,aAAa,cACzB,WAAW,SAAC,gBAAgB;yBAG5B,KAAK;0BAGL,KAAK;8BAGL,WAAW,SAAC,eAAe;yCAK3B,MAAM,SAAC,oBAAoB;8BAG3B,MAAM,SAAC,SAAS;+BAGhB,KAAK;+BAGL,WAAW,SAAC,iBAAiB,cAC7B,KAAK;kCAGL,SAAS,SAAC,OAAO;gCAsBjB,YAAY,SAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;4BAKpC,YAAY,SAAC,OAAO;+BAUpB,YAAY,SAAC,UAAU;;mBA7F5B;;SA0Ba,QAAQ;;IA8FyB,yCAAmC;IAC7E,+BAAY,IAAgB;eACxB,kBAAM,IAAI,CAAC;KACd;;gBAXJ,SAAS,SAAC;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE;wBACF,sBAAsB,EAAE,kBAAkB;wBAC1C,WAAW,EAAE,aAAa;qBAC7B;oBACD,SAAS,EAAE,CAAC,0BAA0B,CAAC,qBAAqB,CAAC,CAAC;iBACjE;;;;gBA7FY,QAAQ;;gCA1BrB;EAwH8C,mBAAmB;SAApD,qBAAqB","sourcesContent":["import {\n Component, Directive, Input, Output, HostListener, HostBinding,\n EventEmitter, ViewChild, ElementRef, ContentChildren, AfterContentInit, QueryList\n} from \"@angular/core\";\nimport {\n ICustomValueAccessorHost, customValueAccessorFactory, CustomValueAccessor,\n Util\n} from \"../../../misc/util/index\";\nimport { Subscription } from \"rxjs/Subscription\";\n\n@Component({\n selector: \"sui-radio-button\",\n template: `\n\n\n`\n})\nexport class SuiRadio implements ICustomValueAccessorHost {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.radio\")\n @HostBinding(\"class.checkbox\")\n private _radioClasses:boolean = true;\n\n @Input()\n public name:string;\n\n @Input()\n public value:T;\n\n @HostBinding(\"class.checked\")\n public isChecked:boolean;\n\n public currentValue:T;\n\n @Output(\"currentValueChange\")\n public onCurrentValueChange:EventEmitter;\n\n @Output(\"touched\")\n public onTouched:EventEmitter;\n\n @Input()\n public isDisabled:boolean;\n\n @HostBinding(\"class.read-only\")\n @Input()\n public isReadonly:boolean;\n\n @ViewChild(\"radio\")\n private _radioElement:ElementRef;\n\n public get checkedAttribute():string | undefined {\n return this.isChecked ? \"\" : undefined;\n }\n\n public get isDisabledAttribute():string | undefined {\n return this.isDisabled ? \"disabled\" : undefined;\n }\n\n constructor() {\n this.isChecked = false;\n this.onCurrentValueChange = new EventEmitter();\n this.onTouched = new EventEmitter();\n\n this.isDisabled = false;\n this.isReadonly = false;\n\n this._radioClasses = true;\n }\n\n @HostListener(\"mousedown\", [\"$event\"])\n public onMouseDown(e:MouseEvent):void {\n e.preventDefault();\n }\n\n @HostListener(\"click\")\n public onClick():void {\n if (!this.isDisabled && !this.isReadonly) {\n this.currentValue = this.value;\n this.onCurrentValueChange.emit(this.currentValue);\n this.update();\n this.focusRadio();\n }\n }\n\n @HostListener(\"focusout\")\n public onFocusOut():void {\n this.onTouched.emit();\n }\n\n public update():void {\n this.isChecked = this.currentValue === this.value;\n }\n\n public writeValue(value:T):void {\n this.currentValue = value;\n this.update();\n }\n\n private focusRadio():void {\n this._radioElement.nativeElement.focus();\n }\n}\n\n@Directive({\n selector: \"sui-radio-button\",\n host: {\n \"(currentValueChange)\": \"onChange($event)\",\n \"(touched)\": \"onTouched()\"\n },\n providers: [customValueAccessorFactory(SuiRadioValueAccessor)]\n})\nexport class SuiRadioValueAccessor extends CustomValueAccessor> {\n constructor(host:SuiRadio) {\n super(host);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/components/radio.metadata.json b/dist/modules/checkbox/components/radio.metadata.json new file mode 100644 index 000000000..cfc1a00f0 --- /dev/null +++ b/dist/modules/checkbox/components/radio.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiRadio":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":10,"character":1},"arguments":[{"selector":"sui-radio-button","template":"\n\n\n"}]}],"members":{"_radioClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":27,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":28,"character":5},"arguments":["class.radio"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":29,"character":5},"arguments":["class.checkbox"]}]}],"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":5}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":5}}]}],"isChecked":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":38,"character":5},"arguments":["class.checked"]}]}],"onCurrentValueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":43,"character":5},"arguments":["currentValueChange"]}]}],"onTouched":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":46,"character":5},"arguments":["touched"]}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":5}}]}],"isReadonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":52,"character":5},"arguments":["class.read-only"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":53,"character":5}}]}],"_radioElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":56,"character":5},"arguments":["radio"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"onMouseDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":78,"character":5},"arguments":["mousedown",["$event"]]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":83,"character":5},"arguments":["click"]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":93,"character":5},"arguments":["focusout"]}]}],"update":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"focusRadio":[{"__symbolic":"method"}]}},"SuiRadioValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":120,"character":46},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":112,"character":1},"arguments":[{"selector":"sui-radio-button","host":{"(currentValueChange)":"onChange($event)","(touched)":"onTouched()","$quoted$":["(currentValueChange)","(touched)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":118,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiRadioValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiRadio","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":121,"character":30,"context":{"typeName":"T"}}]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/checkbox/directives/radio-manager.d.ts b/dist/modules/checkbox/directives/radio-manager.d.ts new file mode 100644 index 000000000..3ce014f29 --- /dev/null +++ b/dist/modules/checkbox/directives/radio-manager.d.ts @@ -0,0 +1,12 @@ +import { AfterContentInit, ElementRef } from "@angular/core"; +export declare class SuiRadioManager implements AfterContentInit { + element: ElementRef; + isNested: boolean; + private _subManagers; + private _renderedRadios; + private _radioSubs; + constructor(element: ElementRef); + ngAfterContentInit(): void; + private updateNesting(); + private updateRadios(); +} diff --git a/dist/modules/checkbox/directives/radio-manager.js b/dist/modules/checkbox/directives/radio-manager.js new file mode 100644 index 000000000..1c8fe0ef4 --- /dev/null +++ b/dist/modules/checkbox/directives/radio-manager.js @@ -0,0 +1,60 @@ +import { Directive, ContentChildren, QueryList, ElementRef } from "@angular/core"; +import { SuiRadio } from "../components/radio"; +import { Util } from "../../../misc/util/index"; +var SuiRadioManager = /** @class */ (function () { + function SuiRadioManager(element) { + this.element = element; + this.isNested = false; + this._radioSubs = []; + } + SuiRadioManager.prototype.ngAfterContentInit = function () { + var _this = this; + this.updateNesting(); + this._subManagers.changes.subscribe(function () { return _this.updateNesting(); }); + this.updateRadios(); + this._renderedRadios.changes.subscribe(function () { return _this.updateRadios(); }); + }; + SuiRadioManager.prototype.updateNesting = function () { + var _this = this; + this._subManagers + .filter(function (m) { return m !== _this; }) + .forEach(function (m) { return m.isNested = true; }); + }; + SuiRadioManager.prototype.updateRadios = function () { + var _this = this; + this._radioSubs.forEach(function (s) { return s.unsubscribe(); }); + this._radioSubs = []; + var groups = Util.Array.groupBy(this._renderedRadios.toArray(), "name"); + Object + .keys(groups) + .map(function (k) { return groups[k]; }) + .forEach(function (g) { + return g + .forEach(function (r) { + return _this._radioSubs + .push(r.onCurrentValueChange + .subscribe(function (v) { + if (!_this.isNested) { + g.forEach(function (radio) { return radio.writeValue(v); }); + } + })); + }); + }); + }; + SuiRadioManager.decorators = [ + { type: Directive, args: [{ + selector: "form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]" + },] }, + ]; + /** @nocollapse */ + SuiRadioManager.ctorParameters = function () { return [ + { type: ElementRef, }, + ]; }; + SuiRadioManager.propDecorators = { + "_subManagers": [{ type: ContentChildren, args: [SuiRadioManager, { descendants: true },] },], + "_renderedRadios": [{ type: ContentChildren, args: [SuiRadio, { descendants: true },] },], + }; + return SuiRadioManager; +}()); +export { SuiRadioManager }; +//# sourceMappingURL=radio-manager.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/directives/radio-manager.js.map b/dist/modules/checkbox/directives/radio-manager.js.map new file mode 100644 index 000000000..67f7fb833 --- /dev/null +++ b/dist/modules/checkbox/directives/radio-manager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"radio-manager.js","sourceRoot":"","sources":["../../../../src/modules/checkbox/directives/radio-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;;IAiB5C,yBAAmB,OAAkB;QAAlB,YAAO,GAAP,OAAO,CAAW;QACjC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;KACxB;IAEM,4CAAkB,GAAzB;QAAA,iBAMC;QALG,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,aAAa,EAAE,EAApB,CAAoB,CAAC,CAAC;QAEhE,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,YAAY,EAAE,EAAnB,C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Ae,SAAC,eAAe,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;oCAGtD,eAAe,SAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;0BAfpD;;SAQa,eAAe","sourcesContent":["import { Directive, AfterContentInit, ContentChildren, QueryList, ElementRef } from \"@angular/core\";\nimport { SuiRadio } from \"../components/radio\";\nimport { Subscription } from \"rxjs/Subscription\";\nimport { Util } from \"../../../misc/util/index\";\n\n@Directive({\n selector: \"form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]\"\n})\nexport class SuiRadioManager implements AfterContentInit {\n\n public isNested:boolean;\n\n @ContentChildren(SuiRadioManager, { descendants: true })\n private _subManagers:QueryList>;\n\n @ContentChildren(SuiRadio, { descendants: true })\n private _renderedRadios:QueryList>;\n\n private _radioSubs:Subscription[];\n\n constructor(public element:ElementRef) {\n this.isNested = false;\n this._radioSubs = [];\n }\n\n public ngAfterContentInit():void {\n this.updateNesting();\n this._subManagers.changes.subscribe(() => this.updateNesting());\n\n this.updateRadios();\n this._renderedRadios.changes.subscribe(() => this.updateRadios());\n }\n\n private updateNesting():void {\n this._subManagers\n .filter(m => m !== this)\n .forEach(m => m.isNested = true);\n }\n\n private updateRadios():void {\n this._radioSubs.forEach(s => s.unsubscribe());\n this._radioSubs = [];\n\n const groups = Util.Array.groupBy(this._renderedRadios.toArray(), \"name\");\n Object\n .keys(groups)\n .map(k => groups[k])\n .forEach(g => g\n .forEach(r => this._radioSubs\n .push(r.onCurrentValueChange\n .subscribe((v:T) => {\n if (!this.isNested) {\n g.forEach(radio => radio.writeValue(v));\n }\n }))));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/directives/radio-manager.metadata.json b/dist/modules/checkbox/directives/radio-manager.metadata.json new file mode 100644 index 000000000..8e19c0c61 --- /dev/null +++ b/dist/modules/checkbox/directives/radio-manager.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiRadioManager":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":5,"character":1},"arguments":[{"selector":"form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]"}]}],"members":{"_subManagers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":12,"character":5},"arguments":[{"__symbolic":"reference","name":"SuiRadioManager"},{"descendants":true}]}]}],"_renderedRadios":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":15,"character":5},"arguments":[{"__symbolic":"reference","module":"../components/radio","name":"SuiRadio","line":15,"character":21},{"descendants":true}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":20,"character":31}]}],"ngAfterContentInit":[{"__symbolic":"method"}],"updateNesting":[{"__symbolic":"method"}],"updateRadios":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/checkbox/index.d.ts b/dist/modules/checkbox/index.d.ts new file mode 100644 index 000000000..d690cc347 --- /dev/null +++ b/dist/modules/checkbox/index.d.ts @@ -0,0 +1,4 @@ +export * from "./components/checkbox"; +export * from "./components/radio"; +export * from "./directives/radio-manager"; +export * from "./checkbox.module"; diff --git a/dist/modules/checkbox/index.js b/dist/modules/checkbox/index.js new file mode 100644 index 000000000..b8481b9e7 --- /dev/null +++ b/dist/modules/checkbox/index.js @@ -0,0 +1,5 @@ +export * from "./components/checkbox"; +export * from "./components/radio"; +export * from "./directives/radio-manager"; +export * from "./checkbox.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/index.js.map b/dist/modules/checkbox/index.js.map new file mode 100644 index 000000000..7fd19b3e8 --- /dev/null +++ b/dist/modules/checkbox/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/checkbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./components/checkbox\";\nexport * from \"./components/radio\";\n\nexport * from \"./directives/radio-manager\";\n\nexport * from \"./checkbox.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/index.metadata.json b/dist/modules/checkbox/index.metadata.json new file mode 100644 index 000000000..7d90c1adb --- /dev/null +++ b/dist/modules/checkbox/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/checkbox"},{"from":"./components/radio"},{"from":"./directives/radio-manager"},{"from":"./checkbox.module"}]}] \ No newline at end of file diff --git a/dist/modules/checkbox/public.d.ts b/dist/modules/checkbox/public.d.ts new file mode 100644 index 000000000..67db58523 --- /dev/null +++ b/dist/modules/checkbox/public.d.ts @@ -0,0 +1 @@ +export { SuiCheckboxModule } from "./index"; diff --git a/dist/modules/checkbox/public.js b/dist/modules/checkbox/public.js new file mode 100644 index 000000000..50bc10c8e --- /dev/null +++ b/dist/modules/checkbox/public.js @@ -0,0 +1,2 @@ +export { SuiCheckboxModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/public.js.map b/dist/modules/checkbox/public.js.map new file mode 100644 index 000000000..34244d890 --- /dev/null +++ b/dist/modules/checkbox/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/checkbox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACpB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiCheckboxModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/public.metadata.json b/dist/modules/checkbox/public.metadata.json new file mode 100644 index 000000000..c830a6b45 --- /dev/null +++ b/dist/modules/checkbox/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiCheckboxModule"]}]}] \ No newline at end of file diff --git a/dist/modules/collapse/collapse.module.d.ts b/dist/modules/collapse/collapse.module.d.ts new file mode 100644 index 000000000..fd6913dea --- /dev/null +++ b/dist/modules/collapse/collapse.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiCollapseModule { +} diff --git a/dist/modules/collapse/collapse.module.js b/dist/modules/collapse/collapse.module.js new file mode 100644 index 000000000..6aefa990b --- /dev/null +++ b/dist/modules/collapse/collapse.module.js @@ -0,0 +1,25 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiCollapse } from "./directives/collapse"; +var SuiCollapseModule = /** @class */ (function () { + function SuiCollapseModule() { + } + SuiCollapseModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule + ], + declarations: [ + SuiCollapse + ], + exports: [ + SuiCollapse + ] + },] }, + ]; + /** @nocollapse */ + SuiCollapseModule.ctorParameters = function () { return []; }; + return SuiCollapseModule; +}()); +export { SuiCollapseModule }; +//# sourceMappingURL=collapse.module.js.map \ No newline at end of file diff --git a/dist/modules/collapse/collapse.module.js.map b/dist/modules/collapse/collapse.module.js.map new file mode 100644 index 000000000..52c387758 --- /dev/null +++ b/dist/modules/collapse/collapse.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"collapse.module.js","sourceRoot":"","sources":["../../../src/modules/collapse/collapse.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;;;;;gBAEnD,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;qBACf;oBACD,YAAY,EAAE;wBACV,WAAW;qBACd;oBACD,OAAO,EAAE;wBACL,WAAW;qBACd;iBACJ;;;;4BAdD;;SAea,iBAAiB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiCollapse } from \"./directives/collapse\";\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n SuiCollapse\n ],\n exports: [\n SuiCollapse\n ]\n})\nexport class SuiCollapseModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/collapse/collapse.module.metadata.json b/dist/modules/collapse/collapse.module.metadata.json new file mode 100644 index 000000000..b48a2a0ee --- /dev/null +++ b/dist/modules/collapse/collapse.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiCollapseModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":8}],"declarations":[{"__symbolic":"reference","module":"./directives/collapse","name":"SuiCollapse","line":9,"character":8}],"exports":[{"__symbolic":"reference","module":"./directives/collapse","name":"SuiCollapse","line":12,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/collapse/directives/collapse.d.ts b/dist/modules/collapse/directives/collapse.d.ts new file mode 100644 index 000000000..3ec972eb3 --- /dev/null +++ b/dist/modules/collapse/directives/collapse.d.ts @@ -0,0 +1,16 @@ +import { ElementRef, Renderer2 } from "@angular/core"; +export declare class SuiCollapse { + private _element; + private _renderer; + private _isExpanded; + private readonly _isCollapsed; + private _isCollapsing; + private _pristine; + suiCollapse: boolean; + collapseDuration: number; + private readonly _animationDuration; + constructor(_element: ElementRef, _renderer: Renderer2); + hide(): void; + show(): void; + private animate(startHeight, endHeight, removeOnComplete?, callback?); +} diff --git a/dist/modules/collapse/directives/collapse.js b/dist/modules/collapse/directives/collapse.js new file mode 100644 index 000000000..eb2fec8a0 --- /dev/null +++ b/dist/modules/collapse/directives/collapse.js @@ -0,0 +1,124 @@ +import { Directive, ElementRef, Input, HostBinding, Renderer2 } from "@angular/core"; +var SuiCollapse = /** @class */ (function () { + function SuiCollapse(_element, _renderer) { + this._element = _element; + this._renderer = _renderer; + this._pristine = true; + // Collapse animation duration is 350ms by default. + this.collapseDuration = 350; + this._isExpanded = false; + this._isCollapsing = false; + } + Object.defineProperty(SuiCollapse.prototype, "_isCollapsed", { + get: + // Set when the collapse is closed, and not animating. + function () { + return !this._isExpanded && !this._isCollapsing; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCollapse.prototype, "suiCollapse", { + get: function () { + return this._isExpanded; + }, + // Sets the state of the collapse, `true` is collapsed. + set: + // Sets the state of the collapse, `true` is collapsed. + function (value) { + if (value) { + this.hide(); + } + else { + this.show(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCollapse.prototype, "_animationDuration", { + get: function () { + return this._pristine ? 0 : this.collapseDuration; + }, + enumerable: true, + configurable: true + }); + SuiCollapse.prototype.hide = function () { + var _this = this; + this._isCollapsing = true; + this._isExpanded = false; + // Forcibly hide the overflow so that content is not visible past the boundaries of its container. + this._renderer.setStyle(this._element.nativeElement, "overflow", "hidden"); + // Animate the host element from its scroll height to 0. + this.animate(this._element.nativeElement.scrollHeight, 0, false, function () { + _this._isCollapsing = false; + }); + }; + SuiCollapse.prototype.show = function () { + var _this = this; + this._isCollapsing = true; + // Animate the host element from its offset height to its scroll height. + this.animate(this._element.nativeElement.offsetHeight, this._element.nativeElement.scrollHeight, true, function () { + // Remove the overflow override to enable user styling once again. + // Remove the overflow override to enable user styling once again. + _this._renderer.removeStyle(_this._element.nativeElement, "overflow"); + _this._isCollapsing = false; + _this._isExpanded = true; + }); + }; + SuiCollapse.prototype.animate = function (startHeight, endHeight, removeOnComplete, callback) { + if (removeOnComplete === void 0) { removeOnComplete = false; } + if (callback === void 0) { callback = function () { }; } + var heightFrames = [ + { + offset: 0, + height: startHeight + "px" + }, + { + offset: 1, + height: endHeight + "px" + } + ]; + if (removeOnComplete) { + heightFrames.push({ + offset: 1, + height: "auto" + }); + } + // Animate the collapse using the web animations API. + // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. + this._element.nativeElement.animate(heightFrames, { + delay: 0, + // Disable animation on 1st collapse / expansion. + duration: this._animationDuration, + iterations: 1, + easing: "ease", + fill: "both" + }); + if (this._pristine) { + // Remove pristine flag when first hit. + this._pristine = false; + } + setTimeout(function () { return callback(); }, this.collapseDuration); + }; + SuiCollapse.decorators = [ + { type: Directive, args: [{ + selector: "[suiCollapse]" + },] }, + ]; + /** @nocollapse */ + SuiCollapse.ctorParameters = function () { return [ + { type: ElementRef, }, + { type: Renderer2, }, + ]; }; + SuiCollapse.propDecorators = { + "_isExpanded": [{ type: HostBinding, args: ["class.expanded",] },], + "_isCollapsed": [{ type: HostBinding, args: ["class.collapsed",] },], + "_isCollapsing": [{ type: HostBinding, args: ["class.collapsing",] },], + "suiCollapse": [{ type: Input },], + "collapseDuration": [{ type: Input },], + }; + return SuiCollapse; +}()); +export { SuiCollapse }; +//# sourceMappingURL=collapse.js.map \ No newline at end of file diff --git a/dist/modules/collapse/directives/collapse.js.map b/dist/modules/collapse/directives/collapse.js.map new file mode 100644 index 000000000..321e2238d --- /dev/null +++ b/dist/modules/collapse/directives/collapse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"collapse.js","sourceRoot":"","sources":["../../../../src/modules/collapse/directives/collapse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;IA4CjF,qBAA2B,QAAmB,EAAU,SAAmB;QAAhD,aAAQ,GAAR,QAAQ,CAAW;QAAU,cAAS,GAAT,SAAS,CAAU;QACvE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;;QAGtB,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAC;QAE5B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;KAC9B;0BAxCW,qCAAY;;;;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{ Directive, ElementRef, Input, HostBinding, Renderer2 } from \"@angular/core\";\n\n@Directive({\n selector: \"[suiCollapse]\"\n})\nexport class SuiCollapse {\n // Set when the collapse is open, and not animating.\n @HostBinding(\"class.expanded\")\n private _isExpanded:boolean;\n\n // Set when the collapse is closed, and not animating.\n @HostBinding(\"class.collapsed\")\n private get _isCollapsed():boolean {\n return !this._isExpanded && !this._isCollapsing;\n }\n\n // Set when the collapse is animating.\n @HostBinding(\"class.collapsing\")\n private _isCollapsing:boolean;\n\n // Flag that is initially true, to make the 1st animation instantaneous.\n private _pristine:boolean;\n\n @Input()\n public get suiCollapse():boolean {\n return this._isExpanded;\n }\n\n // Sets the state of the collapse, `true` is collapsed.\n public set suiCollapse(value:boolean) {\n if (value) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n @Input()\n public collapseDuration:number;\n\n private get _animationDuration():number {\n return this._pristine ? 0 : this.collapseDuration;\n }\n\n public constructor(private _element:ElementRef, private _renderer:Renderer2) {\n this._pristine = true;\n\n // Collapse animation duration is 350ms by default.\n this.collapseDuration = 350;\n\n this._isExpanded = false;\n this._isCollapsing = false;\n }\n\n public hide():void {\n this._isCollapsing = true;\n this._isExpanded = false;\n\n // Forcibly hide the overflow so that content is not visible past the boundaries of its container.\n this._renderer.setStyle(this._element.nativeElement, \"overflow\", \"hidden\");\n\n // Animate the host element from its scroll height to 0.\n this.animate(this._element.nativeElement.scrollHeight, 0, false, () => {\n this._isCollapsing = false;\n });\n }\n\n public show():void {\n this._isCollapsing = true;\n\n // Animate the host element from its offset height to its scroll height.\n this.animate(this._element.nativeElement.offsetHeight, this._element.nativeElement.scrollHeight, true, () => {\n // Remove the overflow override to enable user styling once again.\n this._renderer.removeStyle(this._element.nativeElement, \"overflow\");\n\n this._isCollapsing = false;\n this._isExpanded = true;\n });\n }\n\n private animate(startHeight:number, endHeight:number, removeOnComplete:boolean = false, callback:() => void = () => {}):void {\n const heightFrames = [\n {\n offset: 0,\n height: `${startHeight}px`\n },\n {\n offset: 1,\n height: `${endHeight}px`\n }\n ];\n\n if (removeOnComplete) {\n heightFrames.push({\n offset: 1,\n height: `auto`\n });\n }\n\n // Animate the collapse using the web animations API.\n // Using directly because Renderer2 doesn't have invokeElementMethod method anymore.\n this._element.nativeElement.animate(\n heightFrames,\n {\n delay: 0,\n // Disable animation on 1st collapse / expansion.\n duration: this._animationDuration,\n iterations: 1,\n easing: \"ease\",\n fill: \"both\"\n }\n );\n\n if (this._pristine) {\n // Remove pristine flag when first hit.\n this._pristine = false;\n }\n\n setTimeout(() => callback(), this.collapseDuration);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/collapse/directives/collapse.metadata.json b/dist/modules/collapse/directives/collapse.metadata.json new file mode 100644 index 000000000..1f9ef8550 --- /dev/null +++ b/dist/modules/collapse/directives/collapse.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiCollapse":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[suiCollapse]"}]}],"members":{"_isExpanded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":7,"character":5},"arguments":["class.expanded"]}]}],"_isCollapsed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":11,"character":5},"arguments":["class.collapsed"]}]}],"_isCollapsing":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":17,"character":5},"arguments":["class.collapsing"]}]}],"suiCollapse":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":5}}]}],"collapseDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":44,"character":40},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":44,"character":70}]}],"hide":[{"__symbolic":"method"}],"show":[{"__symbolic":"method"}],"animate":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/collapse/index.d.ts b/dist/modules/collapse/index.d.ts new file mode 100644 index 000000000..f5801a4da --- /dev/null +++ b/dist/modules/collapse/index.d.ts @@ -0,0 +1,2 @@ +export * from "./directives/collapse"; +export * from "./collapse.module"; diff --git a/dist/modules/collapse/index.js b/dist/modules/collapse/index.js new file mode 100644 index 000000000..d5ff3f675 --- /dev/null +++ b/dist/modules/collapse/index.js @@ -0,0 +1,3 @@ +export * from "./directives/collapse"; +export * from "./collapse.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/collapse/index.js.map b/dist/modules/collapse/index.js.map new file mode 100644 index 000000000..742a36bf2 --- /dev/null +++ b/dist/modules/collapse/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/collapse/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AAEtC,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./directives/collapse\";\n\nexport * from \"./collapse.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/collapse/index.metadata.json b/dist/modules/collapse/index.metadata.json new file mode 100644 index 000000000..842632f74 --- /dev/null +++ b/dist/modules/collapse/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./directives/collapse"},{"from":"./collapse.module"}]}] \ No newline at end of file diff --git a/dist/modules/collapse/public.d.ts b/dist/modules/collapse/public.d.ts new file mode 100644 index 000000000..dc596fca6 --- /dev/null +++ b/dist/modules/collapse/public.d.ts @@ -0,0 +1 @@ +export { SuiCollapseModule } from "./index"; diff --git a/dist/modules/collapse/public.js b/dist/modules/collapse/public.js new file mode 100644 index 000000000..e6f448298 --- /dev/null +++ b/dist/modules/collapse/public.js @@ -0,0 +1,2 @@ +export { SuiCollapseModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/collapse/public.js.map b/dist/modules/collapse/public.js.map new file mode 100644 index 000000000..27f183dad --- /dev/null +++ b/dist/modules/collapse/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/collapse/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACpB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiCollapseModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/collapse/public.metadata.json b/dist/modules/collapse/public.metadata.json new file mode 100644 index 000000000..cd9c02b24 --- /dev/null +++ b/dist/modules/collapse/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiCollapseModule"]}]}] \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-config.d.ts b/dist/modules/datepicker/classes/calendar-config.d.ts new file mode 100644 index 000000000..8431a0ed3 --- /dev/null +++ b/dist/modules/datepicker/classes/calendar-config.d.ts @@ -0,0 +1,32 @@ +import { CalendarMode } from "../services/calendar.service"; +import { CalendarMappings } from "./calendar-mappings"; +import { DatePrecision } from "../../../misc/util/index"; +export declare abstract class CalendarConfig { + mode: CalendarMode; + precision: DatePrecision; + mappings: CalendarMappings; + fallback: string; + dateMinBound?: Date; + dateMaxBound?: Date; + constructor(mode: CalendarMode, precision: DatePrecision, mappings: CalendarMappings, fallback: string); + updateBounds(providedDate: Date): void; +} +export declare class DateConfigBase extends CalendarConfig { + constructor(precision: DatePrecision, mappings: CalendarMappings, fallback: string); +} +export declare class YearConfig extends DateConfigBase { + constructor(); +} +export declare class MonthConfig extends DateConfigBase { + constructor(); +} +export declare class DateConfig extends DateConfigBase { + constructor(); +} +export declare class DatetimeConfig extends CalendarConfig { + constructor(); +} +export declare class TimeConfig extends CalendarConfig { + constructor(); + updateBounds(providedDate: Date): void; +} diff --git a/dist/modules/datepicker/classes/calendar-config.js b/dist/modules/datepicker/classes/calendar-config.js new file mode 100644 index 000000000..624773738 --- /dev/null +++ b/dist/modules/datepicker/classes/calendar-config.js @@ -0,0 +1,80 @@ +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 __()); + }; +})(); +import { CalendarMode } from "../services/calendar.service"; +import { DatetimeMappings, DateMappings, TimeMappings, MonthMappings, YearMappings } from "./calendar-mappings"; +import { DatePrecision, DateUtil } from "../../../misc/util/index"; +var CalendarConfig = /** @class */ (function () { + function CalendarConfig(mode, precision, mappings, fallback) { + this.mode = mode; + this.precision = precision; + this.mappings = mappings; + this.fallback = fallback; + } + CalendarConfig.prototype.updateBounds = function (providedDate) { + this.dateMinBound = DateUtil.startOf(DatePrecision.Year, new Date(), true); + this.dateMinBound.setFullYear(0); + }; + return CalendarConfig; +}()); +export { CalendarConfig }; +var DateConfigBase = /** @class */ (function (_super) { + __extends(DateConfigBase, _super); + function DateConfigBase(precision, mappings, fallback) { + return _super.call(this, CalendarMode.DateOnly, precision, mappings, fallback) || this; + } + return DateConfigBase; +}(CalendarConfig)); +export { DateConfigBase }; +var YearConfig = /** @class */ (function (_super) { + __extends(YearConfig, _super); + function YearConfig() { + return _super.call(this, DatePrecision.Year, new YearMappings(), "number") || this; + } + return YearConfig; +}(DateConfigBase)); +export { YearConfig }; +var MonthConfig = /** @class */ (function (_super) { + __extends(MonthConfig, _super); + function MonthConfig() { + return _super.call(this, DatePrecision.Month, new MonthMappings(), "month") || this; + } + return MonthConfig; +}(DateConfigBase)); +export { MonthConfig }; +var DateConfig = /** @class */ (function (_super) { + __extends(DateConfig, _super); + function DateConfig() { + return _super.call(this, DatePrecision.Date, new DateMappings(), "date") || this; + } + return DateConfig; +}(DateConfigBase)); +export { DateConfig }; +var DatetimeConfig = /** @class */ (function (_super) { + __extends(DatetimeConfig, _super); + function DatetimeConfig() { + return _super.call(this, CalendarMode.Both, DatePrecision.Minute, new DatetimeMappings(), "datetime-local") || this; + } + return DatetimeConfig; +}(CalendarConfig)); +export { DatetimeConfig }; +var TimeConfig = /** @class */ (function (_super) { + __extends(TimeConfig, _super); + function TimeConfig() { + return _super.call(this, CalendarMode.TimeOnly, DatePrecision.Minute, new TimeMappings(), "time") || this; + } + TimeConfig.prototype.updateBounds = function (providedDate) { + this.dateMaxBound = DateUtil.endOf(DatePrecision.Date, DateUtil.clone(providedDate)); + this.dateMinBound = DateUtil.previous(DatePrecision.Date, DateUtil.clone(this.dateMaxBound)); + }; + return TimeConfig; +}(CalendarConfig)); +export { TimeConfig }; +//# sourceMappingURL=calendar-config.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-config.js.map b/dist/modules/datepicker/classes/calendar-config.js.map new file mode 100644 index 000000000..71c9d2952 --- /dev/null +++ b/dist/modules/datepicker/classes/calendar-config.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calendar-config.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/classes/calendar-config.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAoB,gBAAgB,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClI,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEnE,IAAA;IAUI,wBAAY,IAAiB,EAAE,SAAuB,EAAE,QAAyB,EAAE,QAAe;QAC9F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACj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,cAAc,EAQjD,CAAA;AARD,0BAQC;AAED,IAAA;IAAgC,8BAAc;IAC1C;eACI,kBACI,YAAY,CAAC,QAAQ,EACrB,aAAa,CAAC,MAAM,EACpB,IAAI,YAAY,EAAE,EAClB,MAAM,CAAC;KACd;IAEM,iCAAY,GAAnB,UAAoB,YAAiB;QACjC,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;QACrF,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;KAChG;qBAlFL;EAsEgC,cAAc,EAa7C,CAAA;AAbD,sBAaC","sourcesContent":["import { CalendarMode } from \"../services/calendar.service\";\nimport { CalendarMappings, DatetimeMappings, DateMappings, TimeMappings, MonthMappings, YearMappings } from \"./calendar-mappings\";\nimport { DatePrecision, DateUtil } from \"../../../misc/util/index\";\n\nexport abstract class CalendarConfig {\n public mode:CalendarMode;\n public precision:DatePrecision;\n public mappings:CalendarMappings;\n\n public fallback:string;\n\n public dateMinBound?:Date;\n public dateMaxBound?:Date;\n\n constructor(mode:CalendarMode, precision:DatePrecision, mappings:CalendarMappings, fallback:string) {\n this.mode = mode;\n this.precision = precision;\n this.mappings = mappings;\n this.fallback = fallback;\n }\n\n public updateBounds(providedDate:Date):void {\n this.dateMinBound = DateUtil.startOf(DatePrecision.Year, new Date(), true);\n this.dateMinBound.setFullYear(0);\n }\n}\n\nexport class DateConfigBase extends CalendarConfig {\n constructor(precision:DatePrecision, mappings:CalendarMappings, fallback:string) {\n super(CalendarMode.DateOnly, precision, mappings, fallback);\n }\n}\n\nexport class YearConfig extends DateConfigBase {\n constructor() {\n super(\n DatePrecision.Year,\n new YearMappings(),\n \"number\");\n }\n}\n\nexport class MonthConfig extends DateConfigBase {\n constructor() {\n super(\n DatePrecision.Month,\n new MonthMappings(),\n \"month\");\n }\n}\n\nexport class DateConfig extends DateConfigBase {\n constructor() {\n super(\n DatePrecision.Date,\n new DateMappings(),\n \"date\");\n }\n}\n\nexport class DatetimeConfig extends CalendarConfig {\n constructor() {\n super(\n CalendarMode.Both,\n DatePrecision.Minute,\n new DatetimeMappings(),\n \"datetime-local\");\n }\n}\n\nexport class TimeConfig extends CalendarConfig {\n constructor() {\n super(\n CalendarMode.TimeOnly,\n DatePrecision.Minute,\n new TimeMappings(),\n \"time\");\n }\n\n public updateBounds(providedDate:Date):void {\n this.dateMaxBound = DateUtil.endOf(DatePrecision.Date, DateUtil.clone(providedDate));\n this.dateMinBound = DateUtil.previous(DatePrecision.Date, DateUtil.clone(this.dateMaxBound));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-config.metadata.json b/dist/modules/datepicker/classes/calendar-config.metadata.json new file mode 100644 index 000000000..66a63fde3 --- /dev/null +++ b/dist/modules/datepicker/classes/calendar-config.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"CalendarConfig":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../services/calendar.service","name":"CalendarMode","line":14,"character":21},{"__symbolic":"reference","module":"../../../misc/util/index","name":"DatePrecision","line":14,"character":45},{"__symbolic":"reference","module":"./calendar-mappings","name":"CalendarMappings","line":14,"character":69},{"__symbolic":"reference","name":"string"}]}],"updateBounds":[{"__symbolic":"method"}]}},"DateConfigBase":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarConfig"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../misc/util/index","name":"DatePrecision","line":14,"character":45},{"__symbolic":"reference","module":"./calendar-mappings","name":"CalendarMappings","line":14,"character":69},{"__symbolic":"reference","name":"string"}]}]}},"YearConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"DateConfigBase"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"MonthConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"DateConfigBase"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"DateConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"DateConfigBase"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"DatetimeConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarConfig"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"TimeConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarConfig"},"members":{"__ctor__":[{"__symbolic":"constructor"}],"updateBounds":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-mappings.d.ts b/dist/modules/datepicker/classes/calendar-mappings.d.ts new file mode 100644 index 000000000..dfcafa993 --- /dev/null +++ b/dist/modules/datepicker/classes/calendar-mappings.d.ts @@ -0,0 +1,23 @@ +import { CalendarViewType } from "../views/calendar-view"; +export declare type CalendarMapping = Map; +export declare abstract class CalendarMappings { + initialView: CalendarViewType; + finalView: CalendarViewType; + changed: CalendarMapping; + zoom: CalendarMapping; +} +export declare class DateMappings extends CalendarMappings { + constructor(); +} +export declare class TimeMappings extends CalendarMappings { + constructor(); +} +export declare class DatetimeMappings extends CalendarMappings { + constructor(); +} +export declare class MonthMappings extends CalendarMappings { + constructor(); +} +export declare class YearMappings extends CalendarMappings { + constructor(); +} diff --git a/dist/modules/datepicker/classes/calendar-mappings.js b/dist/modules/datepicker/classes/calendar-mappings.js new file mode 100644 index 000000000..cbc9ebfe6 --- /dev/null +++ b/dist/modules/datepicker/classes/calendar-mappings.js @@ -0,0 +1,119 @@ +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 __()); + }; +})(); +import { CalendarViewType } from "../views/calendar-view"; +var CalendarMappings = /** @class */ (function () { + function CalendarMappings() { + } + return CalendarMappings; +}()); +export { CalendarMappings }; +var DateMappings = /** @class */ (function (_super) { + __extends(DateMappings, _super); + function DateMappings() { + var _this = _super.call(this) || this; + _this.initialView = CalendarViewType.Date; + _this.finalView = CalendarViewType.Date; + _this.changed = new Map([ + [CalendarViewType.Year, CalendarViewType.Month], + [CalendarViewType.Month, CalendarViewType.Date], + [CalendarViewType.Date, CalendarViewType.Date] + ]); + _this.zoom = new Map([ + [CalendarViewType.Year, CalendarViewType.Date], + [CalendarViewType.Month, CalendarViewType.Year], + [CalendarViewType.Date, CalendarViewType.Month] + ]); + return _this; + } + return DateMappings; +}(CalendarMappings)); +export { DateMappings }; +var TimeMappings = /** @class */ (function (_super) { + __extends(TimeMappings, _super); + function TimeMappings() { + var _this = _super.call(this) || this; + _this.initialView = CalendarViewType.Hour; + _this.finalView = CalendarViewType.Minute; + _this.changed = new Map([ + [CalendarViewType.Hour, CalendarViewType.Minute], + [CalendarViewType.Minute, CalendarViewType.Minute] + ]); + _this.zoom = new Map([ + [CalendarViewType.Hour, CalendarViewType.Minute], + [CalendarViewType.Minute, CalendarViewType.Hour] + ]); + return _this; + } + return TimeMappings; +}(CalendarMappings)); +export { TimeMappings }; +var DatetimeMappings = /** @class */ (function (_super) { + __extends(DatetimeMappings, _super); + function DatetimeMappings() { + var _this = _super.call(this) || this; + _this.initialView = CalendarViewType.Date; + _this.finalView = CalendarViewType.Minute; + _this.changed = new Map([ + [CalendarViewType.Year, CalendarViewType.Month], + [CalendarViewType.Month, CalendarViewType.Date], + [CalendarViewType.Date, CalendarViewType.Hour], + [CalendarViewType.Hour, CalendarViewType.Minute], + [CalendarViewType.Minute, CalendarViewType.Minute] + ]); + _this.zoom = new Map([ + [CalendarViewType.Year, CalendarViewType.Date], + [CalendarViewType.Month, CalendarViewType.Year], + [CalendarViewType.Date, CalendarViewType.Month], + [CalendarViewType.Hour, CalendarViewType.Date], + [CalendarViewType.Minute, CalendarViewType.Hour] + ]); + return _this; + } + return DatetimeMappings; +}(CalendarMappings)); +export { DatetimeMappings }; +var MonthMappings = /** @class */ (function (_super) { + __extends(MonthMappings, _super); + function MonthMappings() { + var _this = _super.call(this) || this; + _this.initialView = CalendarViewType.Month; + _this.finalView = CalendarViewType.Month; + _this.changed = new Map([ + [CalendarViewType.Year, CalendarViewType.Month], + [CalendarViewType.Month, CalendarViewType.Month] + ]); + _this.zoom = new Map([ + [CalendarViewType.Year, CalendarViewType.Month], + [CalendarViewType.Month, CalendarViewType.Year] + ]); + return _this; + } + return MonthMappings; +}(CalendarMappings)); +export { MonthMappings }; +var YearMappings = /** @class */ (function (_super) { + __extends(YearMappings, _super); + function YearMappings() { + var _this = _super.call(this) || this; + _this.initialView = CalendarViewType.Year; + _this.finalView = CalendarViewType.Year; + _this.changed = new Map([ + [CalendarViewType.Year, CalendarViewType.Year] + ]); + _this.zoom = new Map([ + [CalendarViewType.Year, CalendarViewType.Year] + ]); + return _this; + } + return YearMappings; +}(CalendarMappings)); +export { YearMappings }; +//# sourceMappingURL=calendar-mappings.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-mappings.js.map b/dist/modules/datepicker/classes/calendar-mappings.js.map new file mode 100644 index 000000000..afe609896 --- /dev/null +++ b/dist/modules/datepicker/classes/calendar-mappings.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calendar-mappings.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/classes/calendar-mappings.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI1D,IAAA;;;2BAJA;IASC,CAAA;AALD,4BAKC;AAED,IAAA;IAAkC,gCAAgB;IAC9C;QAAA,YACI,iBAAO,SAgBV;QAdG,KAAI,CAAC,WAAW,G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AC,SAAS,GAAG,gBAAgB,CAAC,KAAK,CAAC;QAExC,KAAI,CAAC,OAAO,GAAG,IAAI,GAAG,CAAqC;YACvD,CAAC,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC;YAC/C,CAAC,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC;SACnD,CAAC,CAAC;QAEH,KAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAqC;YACpD,CAAC,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC;YAC/C,CAAC,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC;SAClD,CAAC,CAAC;;KACN;wBA5FL;EA4EmC,gBAAgB,EAiBlD,CAAA;AAjBD,yBAiBC;AAED,IAAA;IAAkC,gCAAgB;IAC9C;QAAA,YACI,iBAAO,SAYV;QAVG,KAAI,CAAC,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC;QACzC,KAAI,CAAC,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC;QAEvC,KAAI,CAAC,OAAO,GAAG,IAAI,GAAG,CAAqC;YACvD,CAAC,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;SACjD,CAAC,CAAC;QAEH,KAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAqC;YACpD,CAAC,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;SACjD,CAAC,CAAC;;KACN;uBA7GL;EA+FkC,gBAAgB,EAejD,CAAA;AAfD,wBAeC","sourcesContent":["import { CalendarViewType } from \"../views/calendar-view\";\n\nexport type CalendarMapping = Map;\n\nexport abstract class CalendarMappings {\n public initialView:CalendarViewType;\n public finalView:CalendarViewType;\n public changed:CalendarMapping;\n public zoom:CalendarMapping;\n}\n\nexport class DateMappings extends CalendarMappings {\n constructor() {\n super();\n\n this.initialView = CalendarViewType.Date;\n this.finalView = CalendarViewType.Date;\n\n this.changed = new Map([\n [CalendarViewType.Year, CalendarViewType.Month],\n [CalendarViewType.Month, CalendarViewType.Date],\n [CalendarViewType.Date, CalendarViewType.Date]\n ]);\n\n this.zoom = new Map([\n [CalendarViewType.Year, CalendarViewType.Date],\n [CalendarViewType.Month, CalendarViewType.Year],\n [CalendarViewType.Date, CalendarViewType.Month]\n ]);\n }\n}\n\nexport class TimeMappings extends CalendarMappings {\n constructor() {\n super();\n\n this.initialView = CalendarViewType.Hour;\n this.finalView = CalendarViewType.Minute;\n\n this.changed = new Map([\n [CalendarViewType.Hour, CalendarViewType.Minute],\n [CalendarViewType.Minute, CalendarViewType.Minute]\n ]);\n\n this.zoom = new Map([\n [CalendarViewType.Hour, CalendarViewType.Minute],\n [CalendarViewType.Minute, CalendarViewType.Hour]\n ]);\n }\n}\n\nexport class DatetimeMappings extends CalendarMappings {\n constructor() {\n super();\n\n this.initialView = CalendarViewType.Date;\n this.finalView = CalendarViewType.Minute;\n\n this.changed = new Map([\n [CalendarViewType.Year, CalendarViewType.Month],\n [CalendarViewType.Month, CalendarViewType.Date],\n [CalendarViewType.Date, CalendarViewType.Hour],\n [CalendarViewType.Hour, CalendarViewType.Minute],\n [CalendarViewType.Minute, CalendarViewType.Minute]\n ]);\n\n this.zoom = new Map([\n [CalendarViewType.Year, CalendarViewType.Date],\n [CalendarViewType.Month, CalendarViewType.Year],\n [CalendarViewType.Date, CalendarViewType.Month],\n [CalendarViewType.Hour, CalendarViewType.Date],\n [CalendarViewType.Minute, CalendarViewType.Hour]\n ]);\n }\n}\n\nexport class MonthMappings extends CalendarMappings {\n constructor() {\n super();\n\n this.initialView = CalendarViewType.Month;\n this.finalView = CalendarViewType.Month;\n\n this.changed = new Map([\n [CalendarViewType.Year, CalendarViewType.Month],\n [CalendarViewType.Month, CalendarViewType.Month]\n ]);\n\n this.zoom = new Map([\n [CalendarViewType.Year, CalendarViewType.Month],\n [CalendarViewType.Month, CalendarViewType.Year]\n ]);\n }\n}\n\nexport class YearMappings extends CalendarMappings {\n constructor() {\n super();\n\n this.initialView = CalendarViewType.Year;\n this.finalView = CalendarViewType.Year;\n\n this.changed = new Map([\n [CalendarViewType.Year, CalendarViewType.Year]\n ]);\n\n this.zoom = new Map([\n [CalendarViewType.Year, CalendarViewType.Year]\n ]);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-mappings.metadata.json b/dist/modules/datepicker/classes/calendar-mappings.metadata.json new file mode 100644 index 000000000..fbc168e28 --- /dev/null +++ b/dist/modules/datepicker/classes/calendar-mappings.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"CalendarMapping":{"__symbolic":"interface"},"CalendarMappings":{"__symbolic":"class"},"DateMappings":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarMappings"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"TimeMappings":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarMappings"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"DatetimeMappings":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarMappings"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"MonthMappings":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarMappings"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"YearMappings":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarMappings"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-comparer.d.ts b/dist/modules/datepicker/classes/date-comparer.d.ts new file mode 100644 index 000000000..7aa75ff27 --- /dev/null +++ b/dist/modules/datepicker/classes/date-comparer.d.ts @@ -0,0 +1,10 @@ +import { DatePrecision } from "../../../misc/util/index"; +export declare class DateComparer { + private _precision; + private _isSmallest; + constructor(precision: DatePrecision, isSmallest: boolean); + equal(a: Date, b: Date | undefined): boolean; + lessThan(a: Date, b: Date | undefined): boolean; + greaterThan(a: Date, b: Date | undefined): boolean; + between(date: Date, left: Date | undefined, right: Date | undefined): boolean; +} diff --git a/dist/modules/datepicker/classes/date-comparer.js b/dist/modules/datepicker/classes/date-comparer.js new file mode 100644 index 000000000..6a5fe0c95 --- /dev/null +++ b/dist/modules/datepicker/classes/date-comparer.js @@ -0,0 +1,33 @@ +import { DatePrecision, DateUtil, Util } from "../../../misc/util/index"; +var DateComparer = /** @class */ (function () { + function DateComparer(precision, isSmallest) { + this._precision = precision; + this._isSmallest = isSmallest; + } + DateComparer.prototype.equal = function (a, b) { + if (this._precision === DatePrecision.Minute) { + return !!b && + DateUtil.equal(DatePrecision.Hour, b, a) && + Util.Math.roundDown(b.getMinutes(), 5) === Util.Math.roundDown(a.getMinutes(), 5); + } + return !!b && DateUtil.equal(this._precision, a, b); + }; + DateComparer.prototype.lessThan = function (a, b) { + if (this._isSmallest) { + return !b || (b >= a); + } + return !b || (DateUtil.endOf(this._precision, DateUtil.clone(b)) >= a); + }; + DateComparer.prototype.greaterThan = function (a, b) { + if (this._isSmallest) { + return !b || (b <= a); + } + return !b || (DateUtil.startOf(this._precision, DateUtil.clone(b)) <= a); + }; + DateComparer.prototype.between = function (date, left, right) { + return this.greaterThan(date, left) && this.lessThan(date, right); + }; + return DateComparer; +}()); +export { DateComparer }; +//# sourceMappingURL=date-comparer.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-comparer.js.map b/dist/modules/datepicker/classes/date-comparer.js.map new file mode 100644 index 000000000..444e651ed --- /dev/null +++ b/dist/modules/datepicker/classes/date-comparer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"date-comparer.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/classes/date-comparer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEzE,IAAA;IAII,sBAAY,SAAuB,EAAE,UAAkB;QACnD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC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,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;KAC5E;IAEM,8BAAO,GAAd,UAAe,IAAS,EAAE,IAAqB,EAAE,KAAsB;QACnE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KACrE;uBAvCL;IAwCC,CAAA;AAtCD,wBAsCC","sourcesContent":["import { DatePrecision, DateUtil, Util } from \"../../../misc/util/index\";\n\nexport class DateComparer {\n private _precision:DatePrecision;\n private _isSmallest:boolean;\n\n constructor(precision:DatePrecision, isSmallest:boolean) {\n this._precision = precision;\n this._isSmallest = isSmallest;\n }\n\n public equal(a:Date, b:Date | undefined):boolean {\n if (this._precision === DatePrecision.Minute) {\n return !!b &&\n DateUtil.equal(DatePrecision.Hour, b, a) &&\n Util.Math.roundDown(b.getMinutes(), 5) === Util.Math.roundDown(a.getMinutes(), 5);\n }\n\n return !!b && DateUtil.equal(this._precision, a, b);\n }\n\n public lessThan(a:Date, b:Date | undefined):boolean {\n if (this._isSmallest) {\n return !b || (b >= a);\n }\n\n return !b || (DateUtil.endOf(this._precision, DateUtil.clone(b)) >= a);\n }\n\n public greaterThan(a:Date, b:Date | undefined):boolean {\n if (this._isSmallest) {\n return !b || (b <= a);\n }\n\n return !b || (DateUtil.startOf(this._precision, DateUtil.clone(b)) <= a);\n }\n\n public between(date:Date, left:Date | undefined, right:Date | undefined):boolean {\n return this.greaterThan(date, left) && this.lessThan(date, right);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-comparer.metadata.json b/dist/modules/datepicker/classes/date-comparer.metadata.json new file mode 100644 index 000000000..691ec2618 --- /dev/null +++ b/dist/modules/datepicker/classes/date-comparer.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"DateComparer":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../misc/util/index","name":"DatePrecision","line":6,"character":26},{"__symbolic":"reference","name":"boolean"}]}],"equal":[{"__symbolic":"method"}],"lessThan":[{"__symbolic":"method"}],"greaterThan":[{"__symbolic":"method"}],"between":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-parser.d.ts b/dist/modules/datepicker/classes/date-parser.d.ts new file mode 100644 index 000000000..51904d934 --- /dev/null +++ b/dist/modules/datepicker/classes/date-parser.d.ts @@ -0,0 +1,12 @@ +import { DatepickerMode } from "../components/datepicker"; +import { IDatepickerLocaleValues } from "../../../behaviors/localization/index"; +export declare class DateParser { + private _format; + private _parser; + constructor(format: string, locale: IDatepickerLocaleValues); + format(date: Date): string; + parse(dateString: string, baseDate?: Date): Date; +} +export declare class InternalDateParser extends DateParser { + constructor(mode: DatepickerMode, locale: IDatepickerLocaleValues); +} diff --git a/dist/modules/datepicker/classes/date-parser.js b/dist/modules/datepicker/classes/date-parser.js new file mode 100644 index 000000000..3574b22de --- /dev/null +++ b/dist/modules/datepicker/classes/date-parser.js @@ -0,0 +1,44 @@ +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 __()); + }; +})(); +import { DateFnsParser } from "../helpers/date-fns"; +var DateParser = /** @class */ (function () { + function DateParser(format, locale) { + this._format = format; + this._parser = new DateFnsParser(locale); + } + DateParser.prototype.format = function (date) { + return this._parser.format(date, this._format); + }; + DateParser.prototype.parse = function (dateString, baseDate) { + if (baseDate === void 0) { baseDate = new Date(); } + return this._parser.parse(dateString, this._format, baseDate); + }; + return DateParser; +}()); +export { DateParser }; +var InternalDateParser = /** @class */ (function (_super) { + __extends(InternalDateParser, _super); + function InternalDateParser(mode, locale) { + var _this = this; + var internalFormats = { + time: "HH:mm", + datetime: "YYYY-MM-DDTHH:mm", + date: "YYYY-MM-DD", + month: "YYYY-MM", + year: "YYYY" + }; + _this = _super.call(this, internalFormats[mode], locale) || this; + return _this; + } + return InternalDateParser; +}(DateParser)); +export { InternalDateParser }; +//# sourceMappingURL=date-parser.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-parser.js.map b/dist/modules/datepicker/classes/date-parser.js.map new file mode 100644 index 000000000..e44629904 --- /dev/null +++ b/dist/modules/datepicker/classes/date-parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"date-parser.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/classes/date-parser.ts"],"names":[],"mappings":";;;;;;;;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,IAAA;IAII,oBAAY,MAAa,EAAE,MAA8B;QACrD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;KAC5C;IAEM,2BAAM,GAAb,UAAc,IAAS;QACnB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KAClD;IAEM,0BAAK,GAAZ,UAAa,UAAiB,EAAE,QAA0B;QAA1B,yBAAA,EAAA,eAAoB,IAAI,EAAE;QACtD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KACjE;qBAnBL;IAoBC,CAAA;AAhBD,sBAgBC;AAED,IAAA;IAAwC,sCAAU;IAC9C,4BAAY,IAAmB,EAAE,MAA8B;QAA/D,iBAUC;QATG,IAAM,eAAe,GAAkC;YACnD,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,kBAAkB;YAC5B,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,MAAM;SACf,CAAC;QAEF,QAAA,kBAAM,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,SAAC;;KACxC;6BAjCL;EAsBwC,UAAU,EAYjD,CAAA;AAZD,8BAYC","sourcesContent":["import { DatepickerMode } from \"../components/datepicker\";\nimport { DateFnsParser } from \"../helpers/date-fns\";\nimport { IDatepickerLocaleValues, IDatepickerFormatsLocaleValues } from \"../../../behaviors/localization/index\";\n\nexport class DateParser {\n private _format:string;\n private _parser:DateFnsParser;\n\n constructor(format:string, locale:IDatepickerLocaleValues) {\n this._format = format;\n this._parser = new DateFnsParser(locale);\n }\n\n public format(date:Date):string {\n return this._parser.format(date, this._format);\n }\n\n public parse(dateString:string, baseDate:Date = new Date()):Date {\n return this._parser.parse(dateString, this._format, baseDate);\n }\n}\n\nexport class InternalDateParser extends DateParser {\n constructor(mode:DatepickerMode, locale:IDatepickerLocaleValues) {\n const internalFormats:IDatepickerFormatsLocaleValues = {\n time: \"HH:mm\",\n datetime: \"YYYY-MM-DDTHH:mm\",\n date: \"YYYY-MM-DD\",\n month: \"YYYY-MM\",\n year: \"YYYY\"\n };\n\n super(internalFormats[mode], locale);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-parser.metadata.json b/dist/modules/datepicker/classes/date-parser.metadata.json new file mode 100644 index 000000000..1c83b69a8 --- /dev/null +++ b/dist/modules/datepicker/classes/date-parser.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"DateParser":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"IDatepickerLocaleValues","line":8,"character":38}]}],"format":[{"__symbolic":"method"}],"parse":[{"__symbolic":"method"}]}},"InternalDateParser":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"DateParser"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../components/datepicker","name":"DatepickerMode","line":23,"character":21},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"IDatepickerLocaleValues","line":8,"character":38}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/components/calendar-view-title.d.ts b/dist/modules/datepicker/components/calendar-view-title.d.ts new file mode 100644 index 000000000..06015c43c --- /dev/null +++ b/dist/modules/datepicker/components/calendar-view-title.d.ts @@ -0,0 +1,7 @@ +import { EventEmitter } from "@angular/core"; +import { CalendarRangeService } from "../services/calendar-range.service"; +export declare class SuiCalendarViewTitle { + ranges: CalendarRangeService; + onZoomOut: EventEmitter; + constructor(); +} diff --git a/dist/modules/datepicker/components/calendar-view-title.js b/dist/modules/datepicker/components/calendar-view-title.js new file mode 100644 index 000000000..3f0c620ad --- /dev/null +++ b/dist/modules/datepicker/components/calendar-view-title.js @@ -0,0 +1,23 @@ +import { Component, Input, EventEmitter, Output } from "@angular/core"; +import { CalendarRangeService } from "../services/calendar-range.service"; +var SuiCalendarViewTitle = /** @class */ (function () { + function SuiCalendarViewTitle() { + this.onZoomOut = new EventEmitter(); + } + SuiCalendarViewTitle.decorators = [ + { type: Component, args: [{ + selector: "sui-calendar-view-title", + template: "\n\n \n\n\n \n\n\n \n\n", + styles: ["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiCalendarViewTitle.ctorParameters = function () { return []; }; + SuiCalendarViewTitle.propDecorators = { + "ranges": [{ type: Input },], + "onZoomOut": [{ type: Output, args: ["zoomOut",] },], + }; + return SuiCalendarViewTitle; +}()); +export { SuiCalendarViewTitle }; +//# sourceMappingURL=calendar-view-title.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/components/calendar-view-title.js.map b/dist/modules/datepicker/components/calendar-view-title.js.map new file mode 100644 index 000000000..15b73e5e8 --- /dev/null +++ b/dist/modules/datepicker/components/calendar-view-title.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calendar-view-title.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/components/calendar-view-title.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;;IA+BtE;QACI,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAQ,CAAC;KAC7C;;gBA/BJ,SAAS,SAAC;oBACP,QAAQ,EAAE,yBAAyB;oBACnC,QAAQ,EAAE,6ZAUb;oBACG,MAAM,EAAE,CAAC,mGAMZ,CAAC;iBACD;;;;;2BAGI,KAAK;8BAGL,MAAM,SAAC,SAAS;;+BA7BrB;;SAwBa,oBAAoB","sourcesContent":["import { Component, Input, EventEmitter, Output } from \"@angular/core\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\n\n@Component({\n selector: \"sui-calendar-view-title\",\n template: `\n\n \n\n\n \n\n\n \n\n`,\n styles: [`\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n`]\n})\nexport class SuiCalendarViewTitle {\n\n @Input()\n public ranges:CalendarRangeService;\n\n @Output(\"zoomOut\")\n public onZoomOut:EventEmitter;\n\n constructor() {\n this.onZoomOut = new EventEmitter();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/components/calendar-view-title.metadata.json b/dist/modules/datepicker/components/calendar-view-title.metadata.json new file mode 100644 index 000000000..fc549e514 --- /dev/null +++ b/dist/modules/datepicker/components/calendar-view-title.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiCalendarViewTitle":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"sui-calendar-view-title","template":"\n\n \n\n\n \n\n\n \n\n","styles":["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"]}]}],"members":{"ranges":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":5}}]}],"onZoomOut":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":29,"character":5},"arguments":["zoomOut"]}]}],"__ctor__":[{"__symbolic":"constructor"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/components/datepicker.d.ts b/dist/modules/datepicker/components/datepicker.d.ts new file mode 100644 index 000000000..9af373d14 --- /dev/null +++ b/dist/modules/datepicker/components/datepicker.d.ts @@ -0,0 +1,16 @@ +import { CalendarService } from "./../services/calendar.service"; +import { SuiLocalizationService } from "../../../behaviors/localization/index"; +export declare type DatepickerMode = "year" | "month" | "date" | "datetime" | "time"; +export declare const DatepickerMode: { + Year: "time" | "year" | "month" | "date" | "datetime"; + Month: "time" | "year" | "month" | "date" | "datetime"; + Date: "time" | "year" | "month" | "date" | "datetime"; + Datetime: "time" | "year" | "month" | "date" | "datetime"; + Time: "time" | "year" | "month" | "date" | "datetime"; +}; +export declare class SuiDatepicker { + private _calendarClasses; + service: CalendarService; + constructor(localizationService: SuiLocalizationService); + onMouseDown(e: MouseEvent): void; +} diff --git a/dist/modules/datepicker/components/datepicker.js b/dist/modules/datepicker/components/datepicker.js new file mode 100644 index 000000000..1d122dbac --- /dev/null +++ b/dist/modules/datepicker/components/datepicker.js @@ -0,0 +1,38 @@ +import { Component, HostBinding, HostListener } from "@angular/core"; +import { CalendarService } from "./../services/calendar.service"; +import { DatetimeConfig } from "../classes/calendar-config"; +import { SuiLocalizationService } from "../../../behaviors/localization/index"; +export var DatepickerMode = { + Year: "year", + Month: "month", + Date: "date", + Datetime: "datetime", + Time: "time" +}; +var SuiDatepicker = /** @class */ (function () { + function SuiDatepicker(localizationService) { + this.service = new CalendarService(new DatetimeConfig(), localizationService.get().datepicker); + this._calendarClasses = true; + } + SuiDatepicker.prototype.onMouseDown = function (e) { + e.preventDefault(); + }; + SuiDatepicker.decorators = [ + { type: Component, args: [{ + selector: "sui-datepicker", + template: "\n\n \n \n \n \n \n\n", + styles: ["\n:host {\n user-select: none;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiDatepicker.ctorParameters = function () { return [ + { type: SuiLocalizationService, }, + ]; }; + SuiDatepicker.propDecorators = { + "_calendarClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.active",] }, { type: HostBinding, args: ["class.calendar",] },], + "onMouseDown": [{ type: HostListener, args: ["mousedown", ["$event"],] },], + }; + return SuiDatepicker; +}()); +export { SuiDatepicker }; +//# sourceMappingURL=datepicker.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/components/datepicker.js.map b/dist/modules/datepicker/components/datepicker.js.map new file mode 100644 index 000000000..231dc1cb4 --- /dev/null +++ b/dist/modules/datepicker/components/datepicker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"datepicker.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/components/datepicker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAI/E,MAAM,CAAC,IAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,MAAwB;IAC9B,KAAK,EAAE,OAAyB;IAChC,IAAI,EAAE,MAAwB;IAC9B,QAAQ,EAAE,UAA4B;IACtC,IAAI,EAAE,MAAwB;CACjC,CAAC;;IA2BE,uBAAY,mBAA0C;QAClD,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,cAAc,EAAE,EAAE,mBAAmB,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC;QAE/F,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;KAChC;IAGM,mCAAW,aAAC,CAAY;QAC3B,CAAC,CAAC,cAAc,EAAE,CAAC;;;gBAjC1B,SAAS,SAAC;oBACP,QAAQ,EAAE,gBAAgB;oBAC1B,QAAQ,EAAE,mkBAQb;oBACG,MAAM,EAAE,CAAC,wCAIZ,CAAC;iBACD;;;;gBA5BQ,sBAAsB;;;qCA8B1B,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,cAAc,cAC1B,WAAW,SAAC,gBAAgB;gCAW5B,YAAY,SAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;;wBA9CzC;;SAgCa,aAAa","sourcesContent":["import { Component, HostBinding, HostListener } from \"@angular/core\";\nimport { CalendarService } from \"./../services/calendar.service\";\nimport { DatetimeConfig } from \"../classes/calendar-config\";\nimport { SuiLocalizationService } from \"../../../behaviors/localization/index\";\n\nexport type DatepickerMode = \"year\" | \"month\" | \"date\" | \"datetime\" | \"time\";\n\nexport const DatepickerMode = {\n Year: \"year\" as DatepickerMode,\n Month: \"month\" as DatepickerMode,\n Date: \"date\" as DatepickerMode,\n Datetime: \"datetime\" as DatepickerMode,\n Time: \"time\" as DatepickerMode\n};\n\n@Component({\n selector: \"sui-datepicker\",\n template: `\n\n \n \n \n \n \n\n`,\n styles: [`\n:host {\n user-select: none;\n}\n`]\n})\nexport class SuiDatepicker {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.active\")\n @HostBinding(\"class.calendar\")\n private _calendarClasses:boolean;\n\n public service:CalendarService;\n\n constructor(localizationService:SuiLocalizationService) {\n this.service = new CalendarService(new DatetimeConfig(), localizationService.get().datepicker);\n\n this._calendarClasses = true;\n }\n\n @HostListener(\"mousedown\", [\"$event\"])\n public onMouseDown(e:MouseEvent):void {\n e.preventDefault();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/components/datepicker.metadata.json b/dist/modules/datepicker/components/datepicker.metadata.json new file mode 100644 index 000000000..f5541172a --- /dev/null +++ b/dist/modules/datepicker/components/datepicker.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"DatepickerMode":{"Year":"year","Month":"month","Date":"date","Datetime":"datetime","Time":"time"},"SuiDatepicker":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":15,"character":1},"arguments":[{"selector":"sui-datepicker","template":"\n\n \n \n \n \n \n\n","styles":["\n:host {\n user-select: none;\n}\n"]}]}],"members":{"_calendarClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":33,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":34,"character":5},"arguments":["class.active"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":35,"character":5},"arguments":["class.calendar"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":40,"character":36}]}],"onMouseDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":46,"character":5},"arguments":["mousedown",["$event"]]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/datepicker.module.d.ts b/dist/modules/datepicker/datepicker.module.d.ts new file mode 100644 index 000000000..548df1ade --- /dev/null +++ b/dist/modules/datepicker/datepicker.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiDatepickerModule { +} diff --git a/dist/modules/datepicker/datepicker.module.js b/dist/modules/datepicker/datepicker.module.js new file mode 100644 index 000000000..04bcab133 --- /dev/null +++ b/dist/modules/datepicker/datepicker.module.js @@ -0,0 +1,59 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; +import { SuiPopupModule } from "../popup/index"; +import { SuiLocalizationModule } from "../../behaviors/localization/index"; +import { SuiUtilityModule } from "../../misc/util/index"; +import { SuiCalendarViewTitle } from "./components/calendar-view-title"; +import { SuiCalendarYearView } from "./views/year-view"; +import { SuiCalendarMonthView } from "./views/month-view"; +import { SuiCalendarItem } from "./directives/calendar-item"; +import { SuiCalendarDateView } from "./views/date-view"; +import { SuiDatepicker } from "./components/datepicker"; +import { SuiCalendarHourView } from "./views/hour-view"; +import { SuiCalendarMinuteView } from "./views/minute-view"; +import { SuiDatepickerInputDirective } from "./directives/input.directive"; +import { SuiDatepickerDirective, SuiDatepickerDirectiveValueAccessor, SuiDatepickerDirectiveValidator } from "./directives/datepicker.directive"; +var SuiDatepickerModule = /** @class */ (function () { + function SuiDatepickerModule() { + } + SuiDatepickerModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule, + FormsModule, + SuiPopupModule, + SuiLocalizationModule, + SuiUtilityModule + ], + declarations: [ + SuiCalendarItem, + SuiCalendarViewTitle, + SuiCalendarYearView, + SuiCalendarMonthView, + SuiCalendarDateView, + SuiCalendarHourView, + SuiCalendarMinuteView, + SuiDatepicker, + SuiDatepickerDirective, + SuiDatepickerDirectiveValueAccessor, + SuiDatepickerDirectiveValidator, + SuiDatepickerInputDirective + ], + exports: [ + SuiDatepickerDirective, + SuiDatepickerDirectiveValueAccessor, + SuiDatepickerDirectiveValidator, + SuiDatepickerInputDirective + ], + entryComponents: [ + SuiDatepicker + ] + },] }, + ]; + /** @nocollapse */ + SuiDatepickerModule.ctorParameters = function () { return []; }; + return SuiDatepickerModule; +}()); +export { SuiDatepickerModule }; +//# sourceMappingURL=datepicker.module.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/datepicker.module.js.map b/dist/modules/datepicker/datepicker.module.js.map new file mode 100644 index 000000000..e468b952e --- /dev/null +++ b/dist/modules/datepicker/datepicker.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"datepicker.module.js","sourceRoot":"","sources":["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AC9B;oBACD,OAAO,EAAE;wBACL,sBAAsB;wBACtB,mCAAmC;wBACnC,+BAA+B;wBAC/B,2BAA2B;qBAC9B;oBACD,eAAe,EAAE;wBACb,aAAa;qBAChB;iBACJ;;;;8BArDD;;SAsDa,mBAAmB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { SuiPopupModule } from \"../popup/index\";\nimport { SuiLocalizationModule } from \"../../behaviors/localization/index\";\nimport { SuiUtilityModule } from \"../../misc/util/index\";\nimport { SuiCalendarViewTitle } from \"./components/calendar-view-title\";\nimport { SuiCalendarYearView } from \"./views/year-view\";\nimport { SuiCalendarMonthView } from \"./views/month-view\";\nimport { SuiCalendarItem } from \"./directives/calendar-item\";\nimport { SuiCalendarDateView } from \"./views/date-view\";\nimport { SuiDatepicker } from \"./components/datepicker\";\nimport { SuiCalendarHourView } from \"./views/hour-view\";\nimport { SuiCalendarMinuteView } from \"./views/minute-view\";\nimport { SuiDatepickerInputDirective } from \"./directives/input.directive\";\nimport {\n SuiDatepickerDirective, SuiDatepickerDirectiveValueAccessor,\n SuiDatepickerDirectiveValidator\n} from \"./directives/datepicker.directive\";\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SuiPopupModule,\n SuiLocalizationModule,\n SuiUtilityModule\n ],\n declarations: [\n SuiCalendarItem,\n\n SuiCalendarViewTitle,\n SuiCalendarYearView,\n SuiCalendarMonthView,\n SuiCalendarDateView,\n SuiCalendarHourView,\n SuiCalendarMinuteView,\n\n SuiDatepicker,\n SuiDatepickerDirective,\n SuiDatepickerDirectiveValueAccessor,\n SuiDatepickerDirectiveValidator,\n SuiDatepickerInputDirective\n ],\n exports: [\n SuiDatepickerDirective,\n SuiDatepickerDirectiveValueAccessor,\n SuiDatepickerDirectiveValidator,\n SuiDatepickerInputDirective\n ],\n entryComponents: [\n SuiDatepicker\n ]\n})\nexport class SuiDatepickerModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/datepicker.module.metadata.json b/dist/modules/datepicker/datepicker.module.metadata.json new file mode 100644 index 000000000..456c13e2b --- /dev/null +++ b/dist/modules/datepicker/datepicker.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiDatepickerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":20,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":22,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":23,"character":8},{"__symbolic":"reference","module":"../popup/index","name":"SuiPopupModule","line":24,"character":8},{"__symbolic":"reference","module":"../../behaviors/localization/index","name":"SuiLocalizationModule","line":25,"character":8},{"__symbolic":"reference","module":"../../misc/util/index","name":"SuiUtilityModule","line":26,"character":8}],"declarations":[{"__symbolic":"reference","module":"./directives/calendar-item","name":"SuiCalendarItem","line":29,"character":8},{"__symbolic":"reference","module":"./components/calendar-view-title","name":"SuiCalendarViewTitle","line":31,"character":8},{"__symbolic":"reference","module":"./views/year-view","name":"SuiCalendarYearView","line":32,"character":8},{"__symbolic":"reference","module":"./views/month-view","name":"SuiCalendarMonthView","line":33,"character":8},{"__symbolic":"reference","module":"./views/date-view","name":"SuiCalendarDateView","line":34,"character":8},{"__symbolic":"reference","module":"./views/hour-view","name":"SuiCalendarHourView","line":35,"character":8},{"__symbolic":"reference","module":"./views/minute-view","name":"SuiCalendarMinuteView","line":36,"character":8},{"__symbolic":"reference","module":"./components/datepicker","name":"SuiDatepicker","line":38,"character":8},{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirective","line":39,"character":8},{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirectiveValueAccessor","line":40,"character":8},{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirectiveValidator","line":41,"character":8},{"__symbolic":"reference","module":"./directives/input.directive","name":"SuiDatepickerInputDirective","line":42,"character":8}],"exports":[{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirective","line":45,"character":8},{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirectiveValueAccessor","line":46,"character":8},{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirectiveValidator","line":47,"character":8},{"__symbolic":"reference","module":"./directives/input.directive","name":"SuiDatepickerInputDirective","line":48,"character":8}],"entryComponents":[{"__symbolic":"reference","module":"./components/datepicker","name":"SuiDatepicker","line":51,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/directives/calendar-item.d.ts b/dist/modules/datepicker/directives/calendar-item.d.ts new file mode 100644 index 000000000..4201c5e64 --- /dev/null +++ b/dist/modules/datepicker/directives/calendar-item.d.ts @@ -0,0 +1,23 @@ +import { EventEmitter, ChangeDetectorRef } from "@angular/core"; +export declare class CalendarItem { + date: Date; + humanReadable: string; + isDisabled: boolean; + isActive: boolean; + isOutsideRange: boolean; + isToday: boolean; + isSelectable: boolean; + constructor(date: Date); +} +export declare class SuiCalendarItem { + changeDetector: ChangeDetectorRef; + item: CalendarItem; + readonly isSelectable: boolean; + readonly isActive: boolean; + readonly isToday: boolean; + hasFocus: boolean; + onFocussed: EventEmitter; + constructor(changeDetector: ChangeDetectorRef); + onMouseMove(): void; + onMouseLeave(): void; +} diff --git a/dist/modules/datepicker/directives/calendar-item.js b/dist/modules/datepicker/directives/calendar-item.js new file mode 100644 index 000000000..a2b886b2e --- /dev/null +++ b/dist/modules/datepicker/directives/calendar-item.js @@ -0,0 +1,67 @@ +import { Directive, HostBinding, HostListener, Input, EventEmitter, ChangeDetectorRef } from "@angular/core"; +var CalendarItem = /** @class */ (function () { + function CalendarItem(date) { + this.date = date; + } + return CalendarItem; +}()); +export { CalendarItem }; +var SuiCalendarItem = /** @class */ (function () { + function SuiCalendarItem(changeDetector) { + this.changeDetector = changeDetector; + this.hasFocus = false; + this.onFocussed = new EventEmitter(); + } + Object.defineProperty(SuiCalendarItem.prototype, "isSelectable", { + get: function () { + return this.item.isSelectable; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCalendarItem.prototype, "isActive", { + get: function () { + return this.item.isActive; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCalendarItem.prototype, "isToday", { + get: function () { + return this.item.isToday; + }, + enumerable: true, + configurable: true + }); + SuiCalendarItem.prototype.onMouseMove = function () { + if (!this.hasFocus) { + this.hasFocus = true; + this.onFocussed.emit(this.hasFocus); + } + }; + SuiCalendarItem.prototype.onMouseLeave = function () { + this.hasFocus = false; + this.onFocussed.emit(this.hasFocus); + }; + SuiCalendarItem.decorators = [ + { type: Directive, args: [{ + selector: "[calendarItem]" + },] }, + ]; + /** @nocollapse */ + SuiCalendarItem.ctorParameters = function () { return [ + { type: ChangeDetectorRef, }, + ]; }; + SuiCalendarItem.propDecorators = { + "item": [{ type: Input, args: ["calendarItem",] },], + "isSelectable": [{ type: HostBinding, args: ["class.disabled",] },], + "isActive": [{ type: HostBinding, args: ["class.active",] },], + "isToday": [{ type: HostBinding, args: ["class.today",] },], + "hasFocus": [{ type: HostBinding, args: ["class.focus",] },], + "onMouseMove": [{ type: HostListener, args: ["mousemove",] },], + "onMouseLeave": [{ type: HostListener, args: ["mouseleave",] },], + }; + return SuiCalendarItem; +}()); +export { SuiCalendarItem }; +//# sourceMappingURL=calendar-item.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/directives/calendar-item.js.map b/dist/modules/datepicker/directives/calendar-item.js.map new file mode 100644 index 000000000..281fd1ae1 --- /dev/null +++ b/dist/modules/datepicker/directives/calendar-item.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calendar-item.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/directives/calendar-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAA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CalendarItem {\n public date:Date;\n public humanReadable:string;\n public isDisabled:boolean;\n public isActive:boolean;\n public isOutsideRange:boolean;\n public isToday:boolean;\n public isSelectable:boolean;\n\n constructor(date:Date) {\n this.date = date;\n }\n}\n\n@Directive({\n selector: \"[calendarItem]\"\n})\nexport class SuiCalendarItem {\n @Input(\"calendarItem\")\n public item:CalendarItem;\n\n @HostBinding(\"class.disabled\")\n public get isSelectable():boolean {\n return this.item.isSelectable;\n }\n\n @HostBinding(\"class.active\")\n public get isActive():boolean {\n return this.item.isActive;\n }\n\n @HostBinding(\"class.today\")\n public get isToday():boolean {\n return this.item.isToday;\n }\n\n @HostBinding(\"class.focus\")\n public hasFocus:boolean;\n\n public onFocussed:EventEmitter;\n\n constructor(public changeDetector:ChangeDetectorRef) {\n this.hasFocus = false;\n\n this.onFocussed = new EventEmitter();\n }\n\n @HostListener(\"mousemove\")\n public onMouseMove():void {\n if (!this.hasFocus) {\n this.hasFocus = true;\n this.onFocussed.emit(this.hasFocus);\n }\n }\n\n @HostListener(\"mouseleave\")\n public onMouseLeave():void {\n this.hasFocus = false;\n this.onFocussed.emit(this.hasFocus);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/directives/calendar-item.metadata.json b/dist/modules/datepicker/directives/calendar-item.metadata.json new file mode 100644 index 000000000..67d271080 --- /dev/null +++ b/dist/modules/datepicker/directives/calendar-item.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"CalendarItem":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Date"}]}]}},"SuiCalendarItem":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":17,"character":1},"arguments":[{"selector":"[calendarItem]"}]}],"members":{"item":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":5},"arguments":["calendarItem"]}]}],"isSelectable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":24,"character":5},"arguments":["class.disabled"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":29,"character":5},"arguments":["class.active"]}]}],"isToday":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":34,"character":5},"arguments":["class.today"]}]}],"hasFocus":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":39,"character":5},"arguments":["class.focus"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":44,"character":38}]}],"onMouseMove":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":50,"character":5},"arguments":["mousemove"]}]}],"onMouseLeave":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":58,"character":5},"arguments":["mouseleave"]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/directives/datepicker.directive.d.ts b/dist/modules/datepicker/directives/datepicker.directive.d.ts new file mode 100644 index 000000000..8106d2a26 --- /dev/null +++ b/dist/modules/datepicker/directives/datepicker.directive.d.ts @@ -0,0 +1,43 @@ +import { ElementRef, Renderer2, EventEmitter, OnChanges, SimpleChanges } from "@angular/core"; +import { AbstractControl, ValidationErrors } from "@angular/forms"; +import { ICustomValueAccessorHost, CustomValueAccessor, ICustomValidatorHost, CustomValidator, PositioningPlacement, SuiComponentFactory } from "../../../misc/util/index"; +import { IDatepickerLocaleValues, RecursivePartial, SuiLocalizationService } from "../../../behaviors/localization/index"; +import { SuiPopupComponentController, PopupAfterOpen } from "../../popup/index"; +import { SuiDatepicker, DatepickerMode } from "../components/datepicker"; +import { CalendarConfig } from "../classes/calendar-config"; +export declare class SuiDatepickerDirective extends SuiPopupComponentController implements ICustomValueAccessorHost, ICustomValidatorHost, OnChanges, PopupAfterOpen { + renderer: Renderer2; + localizationService: SuiLocalizationService; + private _selectedDate?; + selectedDate: Date | undefined; + private _mode; + config: CalendarConfig; + mode: DatepickerMode; + initialDate?: Date; + maxDate?: Date; + minDate?: Date; + firstDayOfWeek?: number; + private _localeValues; + localeOverrides: RecursivePartial; + readonly localeValues: IDatepickerLocaleValues; + placement: PositioningPlacement; + transition: string; + transitionDuration: number; + onSelectedDateChange: EventEmitter; + onValidatorChange: EventEmitter; + constructor(renderer: Renderer2, element: ElementRef, componentFactory: SuiComponentFactory, localizationService: SuiLocalizationService); + popupOnOpen(): void; + ngOnChanges({maxDate, minDate, mode}: SimpleChanges): void; + private onLocaleUpdate(); + validate(c: AbstractControl): ValidationErrors | null; + writeValue(value: Date | undefined): void; + onKeyDown(e: KeyboardEvent): void; +} +export declare class SuiDatepickerDirectiveValueAccessor extends CustomValueAccessor { + host: SuiDatepickerDirective; + constructor(host: SuiDatepickerDirective); +} +export declare class SuiDatepickerDirectiveValidator extends CustomValidator { + host: SuiDatepickerDirective; + constructor(host: SuiDatepickerDirective); +} diff --git a/dist/modules/datepicker/directives/datepicker.directive.js b/dist/modules/datepicker/directives/datepicker.directive.js new file mode 100644 index 000000000..9c3ef7e46 --- /dev/null +++ b/dist/modules/datepicker/directives/datepicker.directive.js @@ -0,0 +1,233 @@ +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 __()); + }; +})(); +import { Directive, ElementRef, Renderer2, EventEmitter, Output, Input, HostListener } from "@angular/core"; +import { customValueAccessorFactory, CustomValueAccessor, customValidatorFactory, CustomValidator, PositioningPlacement, SuiComponentFactory, KeyCode } from "../../../misc/util/index"; +import { SuiLocalizationService } from "../../../behaviors/localization/index"; +import { SuiPopupComponentController, PopupConfig, PopupTrigger } from "../../popup/index"; +import { SuiDatepicker, DatepickerMode } from "../components/datepicker"; +import { YearConfig, MonthConfig, DatetimeConfig, TimeConfig, DateConfig } from "../classes/calendar-config"; +var SuiDatepickerDirective = /** @class */ (function (_super) { + __extends(SuiDatepickerDirective, _super); + function SuiDatepickerDirective(renderer, element, componentFactory, localizationService) { + var _this = _super.call(this, renderer, element, componentFactory, SuiDatepicker, new PopupConfig({ + trigger: PopupTrigger.Focus, + placement: PositioningPlacement.BottomLeft, + transition: "scale", + transitionDuration: 200 + })) || this; + _this.renderer = renderer; + _this.localizationService = localizationService; + // This ensures the popup is drawn correctly (i.e. no border). + // This ensures the popup is drawn correctly (i.e. no border). + _this.renderer.addClass(_this.popup.elementRef.nativeElement, "ui"); + _this.renderer.addClass(_this.popup.elementRef.nativeElement, "calendar"); + _this.onLocaleUpdate(); + _this.localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); + _this.onSelectedDateChange = new EventEmitter(); + _this.onValidatorChange = new EventEmitter(); + _this.mode = DatepickerMode.Datetime; + return _this; + } + Object.defineProperty(SuiDatepickerDirective.prototype, "selectedDate", { + get: function () { + return this._selectedDate; + }, + set: function (date) { + this._selectedDate = date; + this.onSelectedDateChange.emit(date); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerDirective.prototype, "mode", { + get: function () { + return this._mode; + }, + set: function (mode) { + this._mode = mode || DatepickerMode.Datetime; + switch (this._mode) { + case DatepickerMode.Year: + this.config = new YearConfig(); + break; + case DatepickerMode.Month: + this.config = new MonthConfig(); + break; + case DatepickerMode.Date: + default: + this.config = new DateConfig(); + break; + case DatepickerMode.Datetime: + this.config = new DatetimeConfig(); + break; + case DatepickerMode.Time: + this.config = new TimeConfig(); + break; + } + this.writeValue(this.selectedDate); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerDirective.prototype, "localeValues", { + get: function () { + return this.localizationService.override(this._localeValues, this.localeOverrides); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerDirective.prototype, "placement", { + set: function (placement) { + this.popup.config.placement = placement; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerDirective.prototype, "transition", { + set: function (transition) { + this.popup.config.transition = transition; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerDirective.prototype, "transitionDuration", { + set: function (duration) { + this.popup.config.transitionDuration = duration; + }, + enumerable: true, + configurable: true + }); + SuiDatepickerDirective.prototype.popupOnOpen = function () { + var _this = this; + if (this.componentInstance) { + this.componentInstance.service.config = this.config; + this.componentInstance.service.localeValues = this.localeValues; + this.componentInstance.service.currentDate = this.initialDate || new Date(); + this.componentInstance.service.selectedDate = this.selectedDate; + this.componentInstance.service.maxDate = this.maxDate; + this.componentInstance.service.minDate = this.minDate; + if (this.firstDayOfWeek != undefined) { + this.componentInstance.service.firstDayOfWeek = this.firstDayOfWeek; + } + this.componentInstance.service.reset(); + this.componentInstance.service.onDateChange.subscribe(function (d) { + _this.selectedDate = d; + _this.close(); + }); + } + }; + SuiDatepickerDirective.prototype.ngOnChanges = function (_a) { + var maxDate = _a.maxDate, minDate = _a.minDate, mode = _a.mode; + if (maxDate || minDate || mode) { + this.onValidatorChange.emit(); + } + }; + SuiDatepickerDirective.prototype.onLocaleUpdate = function () { + this._localeValues = this.localizationService.get().datepicker; + }; + SuiDatepickerDirective.prototype.validate = function (c) { + var value = c.value; + if (value != undefined) { + // We post process the min & max date because sometimes this puts the date outside of the allowed range. + if (this.minDate && value < this.minDate) { + return { suiMinDate: { required: this.minDate, actual: value } }; + } + if (this.maxDate && value > this.maxDate) { + return { suiMaxDate: { required: this.maxDate, actual: value } }; + } + } + // Angular expects null + // tslint:disable-next-line:no-null-keyword + return null; + }; + SuiDatepickerDirective.prototype.writeValue = function (value) { + this.selectedDate = value; + if (this.componentInstance) { + this.componentInstance.service.selectedDate = value; + } + }; + SuiDatepickerDirective.prototype.onKeyDown = function (e) { + if (e.keyCode === KeyCode.Escape) { + this.close(); + } + }; + SuiDatepickerDirective.decorators = [ + { type: Directive, args: [{ + selector: "[suiDatepicker]", + providers: [customValidatorFactory(SuiDatepickerDirective)] + },] }, + ]; + /** @nocollapse */ + SuiDatepickerDirective.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + { type: SuiComponentFactory, }, + { type: SuiLocalizationService, }, + ]; }; + SuiDatepickerDirective.propDecorators = { + "mode": [{ type: Input, args: ["pickerMode",] },], + "initialDate": [{ type: Input, args: ["pickerInitialDate",] },], + "maxDate": [{ type: Input, args: ["pickerMaxDate",] },], + "minDate": [{ type: Input, args: ["pickerMinDate",] },], + "firstDayOfWeek": [{ type: Input, args: ["pickerFirstDayOfWeek",] },], + "localeOverrides": [{ type: Input, args: ["pickerLocaleOverrides",] },], + "placement": [{ type: Input, args: ["pickerPlacement",] },], + "transition": [{ type: Input, args: ["pickerTransition",] },], + "transitionDuration": [{ type: Input, args: ["pickerTransitionDuration",] },], + "onSelectedDateChange": [{ type: Output, args: ["pickerSelectedDateChange",] },], + "onValidatorChange": [{ type: Output, args: ["pickerValidatorChange",] },], + "onKeyDown": [{ type: HostListener, args: ["keydown", ["$event"],] },], + }; + return SuiDatepickerDirective; +}(SuiPopupComponentController)); +export { SuiDatepickerDirective }; +var SuiDatepickerDirectiveValueAccessor = /** @class */ (function (_super) { + __extends(SuiDatepickerDirectiveValueAccessor, _super); + function SuiDatepickerDirectiveValueAccessor(host) { + var _this = _super.call(this, host) || this; + _this.host = host; + return _this; + } + SuiDatepickerDirectiveValueAccessor.decorators = [ + { type: Directive, args: [{ + selector: "[suiDatepicker]", + host: { "(pickerSelectedDateChange)": "onChange($event)" }, + providers: [customValueAccessorFactory(SuiDatepickerDirectiveValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiDatepickerDirectiveValueAccessor.ctorParameters = function () { return [ + { type: SuiDatepickerDirective, }, + ]; }; + return SuiDatepickerDirectiveValueAccessor; +}(CustomValueAccessor)); +export { SuiDatepickerDirectiveValueAccessor }; +var SuiDatepickerDirectiveValidator = /** @class */ (function (_super) { + __extends(SuiDatepickerDirectiveValidator, _super); + function SuiDatepickerDirectiveValidator(host) { + var _this = _super.call(this, host) || this; + _this.host = host; + return _this; + } + SuiDatepickerDirectiveValidator.decorators = [ + { type: Directive, args: [{ + selector: "[suiDatepicker]", + host: { "(pickerValidatorChange)": "onValidatorChange()" }, + providers: [customValidatorFactory(SuiDatepickerDirectiveValidator)] + },] }, + ]; + /** @nocollapse */ + SuiDatepickerDirectiveValidator.ctorParameters = function () { return [ + { type: SuiDatepickerDirective, }, + ]; }; + return SuiDatepickerDirectiveValidator; +}(CustomValidator)); +export { SuiDatepickerDirectiveValidator }; +//# sourceMappingURL=datepicker.directive.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/directives/datepicker.directive.js.map b/dist/modules/datepicker/directives/datepicker.directive.js.map new file mode 100644 index 000000000..1b5c01178 --- /dev/null +++ b/dist/modules/datepicker/directives/datepicker.directive.js.map @@ -0,0 +1 @@ +{"version":3,"file":"datepicker.directive.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/directives/datepicker.directive.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAC7D,YAAY,EACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EACuB,0BAA0B,EAAE,mBAAmB,EACnD,sBAAsB,EAAE,eAAe,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,OAAO,EACpH,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAA6C,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC1H,OAAO,EAAE,2BAA2B,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;oBAC3B,IAAI,EAAE,EAAE,yBAAyB,EAAE,qBAAqB,EAAE;oBAC1D,SAAS,EAAE,CAAC,sBAAsB,CAAC,+BAA+B,CAAC,CAAC;iBACvE;;;;gBAjMY,sBAAsB;;0CAlBnC;EAoNqD,eAAe;SAAvD,+BAA+B","sourcesContent":["import {\n Directive, ElementRef, Renderer2, EventEmitter, Output, Input,\n HostListener, OnChanges, SimpleChanges\n} from \"@angular/core\";\nimport { AbstractControl, ValidationErrors } from \"@angular/forms\";\nimport {\n ICustomValueAccessorHost, customValueAccessorFactory, CustomValueAccessor,\n ICustomValidatorHost, customValidatorFactory, CustomValidator, PositioningPlacement, SuiComponentFactory, KeyCode\n} from \"../../../misc/util/index\";\nimport { IDatepickerLocaleValues, RecursivePartial, SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SuiPopupComponentController, PopupAfterOpen, PopupConfig, PopupTrigger } from \"../../popup/index\";\nimport { SuiDatepicker, DatepickerMode } from \"../components/datepicker\";\nimport { CalendarConfig, YearConfig, MonthConfig, DatetimeConfig, TimeConfig, DateConfig } from \"../classes/calendar-config\";\n\n@Directive({\n selector: \"[suiDatepicker]\",\n providers: [customValidatorFactory(SuiDatepickerDirective)]\n})\nexport class SuiDatepickerDirective\n extends SuiPopupComponentController\n implements ICustomValueAccessorHost, ICustomValidatorHost, OnChanges, PopupAfterOpen {\n\n private _selectedDate?:Date;\n\n public get selectedDate():Date | undefined {\n return this._selectedDate;\n }\n\n public set selectedDate(date:Date | undefined) {\n this._selectedDate = date;\n this.onSelectedDateChange.emit(date);\n }\n\n private _mode:DatepickerMode;\n public config:CalendarConfig;\n\n @Input(\"pickerMode\")\n public get mode():DatepickerMode {\n return this._mode;\n }\n\n public set mode(mode:DatepickerMode) {\n this._mode = mode || DatepickerMode.Datetime;\n switch (this._mode) {\n case DatepickerMode.Year:\n this.config = new YearConfig();\n break;\n case DatepickerMode.Month:\n this.config = new MonthConfig();\n break;\n case DatepickerMode.Date:\n default:\n this.config = new DateConfig();\n break;\n case DatepickerMode.Datetime:\n this.config = new DatetimeConfig();\n break;\n case DatepickerMode.Time:\n this.config = new TimeConfig();\n break;\n }\n this.writeValue(this.selectedDate);\n }\n\n @Input(\"pickerInitialDate\")\n public initialDate?:Date;\n\n @Input(\"pickerMaxDate\")\n public maxDate?:Date;\n\n @Input(\"pickerMinDate\")\n public minDate?:Date;\n\n @Input(\"pickerFirstDayOfWeek\")\n public firstDayOfWeek?:number;\n\n private _localeValues:IDatepickerLocaleValues;\n\n @Input(\"pickerLocaleOverrides\")\n public localeOverrides:RecursivePartial;\n\n public get localeValues():IDatepickerLocaleValues {\n return this.localizationService.override<\"datepicker\">(this._localeValues, this.localeOverrides);\n }\n\n @Input(\"pickerPlacement\")\n public set placement(placement:PositioningPlacement) {\n this.popup.config.placement = placement;\n }\n\n @Input(\"pickerTransition\")\n public set transition(transition:string) {\n this.popup.config.transition = transition;\n }\n\n @Input(\"pickerTransitionDuration\")\n public set transitionDuration(duration:number) {\n this.popup.config.transitionDuration = duration;\n }\n\n @Output(\"pickerSelectedDateChange\")\n public onSelectedDateChange:EventEmitter;\n\n @Output(\"pickerValidatorChange\")\n public onValidatorChange:EventEmitter;\n\n constructor(public renderer:Renderer2,\n element:ElementRef,\n componentFactory:SuiComponentFactory,\n public localizationService:SuiLocalizationService) {\n\n super(renderer, element, componentFactory, SuiDatepicker, new PopupConfig({\n trigger: PopupTrigger.Focus,\n placement: PositioningPlacement.BottomLeft,\n transition: \"scale\",\n transitionDuration: 200\n }));\n\n // This ensures the popup is drawn correctly (i.e. no border).\n this.renderer.addClass(this.popup.elementRef.nativeElement, \"ui\");\n this.renderer.addClass(this.popup.elementRef.nativeElement, \"calendar\");\n\n this.onLocaleUpdate();\n this.localizationService.onLanguageUpdate.subscribe(() => this.onLocaleUpdate());\n\n this.onSelectedDateChange = new EventEmitter();\n this.onValidatorChange = new EventEmitter();\n\n this.mode = DatepickerMode.Datetime;\n }\n\n public popupOnOpen():void {\n if (this.componentInstance) {\n this.componentInstance.service.config = this.config;\n this.componentInstance.service.localeValues = this.localeValues;\n this.componentInstance.service.currentDate = this.initialDate || new Date();\n this.componentInstance.service.selectedDate = this.selectedDate;\n this.componentInstance.service.maxDate = this.maxDate;\n this.componentInstance.service.minDate = this.minDate;\n\n if (this.firstDayOfWeek != undefined) {\n this.componentInstance.service.firstDayOfWeek = this.firstDayOfWeek;\n }\n\n this.componentInstance.service.reset();\n\n this.componentInstance.service.onDateChange.subscribe((d:Date) => {\n this.selectedDate = d;\n this.close();\n });\n }\n }\n\n public ngOnChanges({ maxDate, minDate, mode }:SimpleChanges):void {\n if (maxDate || minDate || mode) {\n this.onValidatorChange.emit();\n }\n }\n\n private onLocaleUpdate():void {\n this._localeValues = this.localizationService.get().datepicker;\n }\n\n public validate(c:AbstractControl):ValidationErrors | null {\n const value = c.value;\n\n if (value != undefined) {\n // We post process the min & max date because sometimes this puts the date outside of the allowed range.\n if (this.minDate && value < this.minDate) {\n return { suiMinDate: { required: this.minDate, actual: value } };\n }\n\n if (this.maxDate && value > this.maxDate) {\n return { suiMaxDate: { required: this.maxDate, actual: value } };\n }\n }\n\n // Angular expects null\n // tslint:disable-next-line:no-null-keyword\n return null;\n }\n\n public writeValue(value:Date | undefined):void {\n this.selectedDate = value;\n\n if (this.componentInstance) {\n this.componentInstance.service.selectedDate = value;\n }\n }\n\n @HostListener(\"keydown\", [\"$event\"])\n public onKeyDown(e:KeyboardEvent):void {\n if (e.keyCode === KeyCode.Escape) {\n this.close();\n }\n }\n}\n\n@Directive({\n selector: \"[suiDatepicker]\",\n host: { \"(pickerSelectedDateChange)\": \"onChange($event)\" },\n providers: [customValueAccessorFactory(SuiDatepickerDirectiveValueAccessor)]\n})\nexport class SuiDatepickerDirectiveValueAccessor extends CustomValueAccessor {\n constructor(public host:SuiDatepickerDirective) { super(host); }\n}\n\n@Directive({\n selector: \"[suiDatepicker]\",\n host: { \"(pickerValidatorChange)\": \"onValidatorChange()\" },\n providers: [customValidatorFactory(SuiDatepickerDirectiveValidator)]\n})\nexport class SuiDatepickerDirectiveValidator extends CustomValidator {\n constructor(public host:SuiDatepickerDirective) { super(host); }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/directives/datepicker.directive.metadata.json b/dist/modules/datepicker/directives/datepicker.directive.metadata.json new file mode 100644 index 000000000..aea918c8b --- /dev/null +++ b/dist/modules/datepicker/directives/datepicker.directive.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiDatepickerDirective":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../popup/index","name":"SuiPopupComponentController","line":19,"character":15},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":14,"character":1},"arguments":[{"selector":"[suiDatepicker]","providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValidatorFactory","line":16,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiDatepickerDirective"}]}]}]}],"members":{"mode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":5},"arguments":["pickerMode"]}]}],"initialDate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5},"arguments":["pickerInitialDate"]}]}],"maxDate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":67,"character":5},"arguments":["pickerMaxDate"]}]}],"minDate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":5},"arguments":["pickerMinDate"]}]}],"firstDayOfWeek":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":5},"arguments":["pickerFirstDayOfWeek"]}]}],"localeOverrides":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":78,"character":5},"arguments":["pickerLocaleOverrides"]}]}],"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":85,"character":5},"arguments":["pickerPlacement"]}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":90,"character":5},"arguments":["pickerTransition"]}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":95,"character":5},"arguments":["pickerTransitionDuration"]}]}],"onSelectedDateChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":100,"character":5},"arguments":["pickerSelectedDateChange"]}]}],"onValidatorChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":103,"character":5},"arguments":["pickerValidatorChange"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":106,"character":32},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":107,"character":24},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":108,"character":33},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":109,"character":43}]}],"popupOnOpen":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"onLocaleUpdate":[{"__symbolic":"method"}],"validate":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"onKeyDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":190,"character":5},"arguments":["keydown",["$event"]]}]}]}},"SuiDatepickerDirectiveValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":203,"character":57},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":198,"character":1},"arguments":[{"selector":"[suiDatepicker]","host":{"(pickerSelectedDateChange)":"onChange($event)","$quoted$":["(pickerSelectedDateChange)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":201,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiDatepickerDirectiveValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiDatepickerDirective"}]}]}},"SuiDatepickerDirectiveValidator":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValidator","line":212,"character":53},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":207,"character":1},"arguments":[{"selector":"[suiDatepicker]","host":{"(pickerValidatorChange)":"onValidatorChange()","$quoted$":["(pickerValidatorChange)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValidatorFactory","line":210,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiDatepickerDirectiveValidator"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiDatepickerDirective"}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/directives/input.directive.d.ts b/dist/modules/datepicker/directives/input.directive.d.ts new file mode 100644 index 000000000..0b801db88 --- /dev/null +++ b/dist/modules/datepicker/directives/input.directive.d.ts @@ -0,0 +1,25 @@ +import { ElementRef } from "@angular/core"; +import { SuiLocalizationService } from "../../../behaviors/localization/index"; +import { SuiDatepickerDirective, SuiDatepickerDirectiveValueAccessor } from "./datepicker.directive"; +import { DateParser } from "../classes/date-parser"; +import "../helpers/is-webview"; +export declare class SuiDatepickerInputDirective { + datepicker: SuiDatepickerDirective; + valueAccessor: SuiDatepickerDirectiveValueAccessor; + element: ElementRef; + private _useNativeOnMobile; + useNativeOnMobile: boolean; + private _fallbackActive; + fallbackActive: boolean; + readonly parser: DateParser; + private _currentInputValue; + private _lastUpdateTyped; + readonly selectedDateString: string | undefined; + readonly type: string; + readonly max: string | undefined; + readonly min: string | undefined; + constructor(datepicker: SuiDatepickerDirective, valueAccessor: SuiDatepickerDirectiveValueAccessor, element: ElementRef, localizationService: SuiLocalizationService); + private updateValue(value); + typeValue(value: string | undefined): void; + onFocusOut(): void; +} diff --git a/dist/modules/datepicker/directives/input.directive.js b/dist/modules/datepicker/directives/input.directive.js new file mode 100644 index 000000000..f9839f3fd --- /dev/null +++ b/dist/modules/datepicker/directives/input.directive.js @@ -0,0 +1,155 @@ +import { Directive, Host, Input, ElementRef, HostBinding, HostListener } from "@angular/core"; +import { DateUtil } from "../../../misc/util/index"; +import { SuiLocalizationService } from "../../../behaviors/localization/index"; +import { PopupTrigger } from "../../popup/index"; +import { SuiDatepickerDirective, SuiDatepickerDirectiveValueAccessor } from "./datepicker.directive"; +import { InternalDateParser, DateParser } from "../classes/date-parser"; +import * as bowser from "bowser"; +import "../helpers/is-webview"; +import * as isUAWebView from "is-ua-webview"; +var isWebView = isUAWebView["default"] || isUAWebView; +var SuiDatepickerInputDirective = /** @class */ (function () { + function SuiDatepickerInputDirective(datepicker, valueAccessor, element, localizationService) { + var _this = this; + this.datepicker = datepicker; + this.valueAccessor = valueAccessor; + this.element = element; + this.useNativeOnMobile = true; + this.fallbackActive = false; + // Whenever the datepicker value updates, update the input text alongside it. + this.datepicker.onSelectedDateChange.subscribe(function () { + return _this.updateValue(_this.selectedDateString); + }); + localizationService.onLanguageUpdate.subscribe(function () { + return _this.updateValue(_this.selectedDateString); + }); + } + Object.defineProperty(SuiDatepickerInputDirective.prototype, "useNativeOnMobile", { + get: function () { + return this._useNativeOnMobile; + }, + set: function (fallback) { + this._useNativeOnMobile = fallback; + var isOnMobile = bowser.mobile || bowser.tablet || isWebView(navigator.userAgent); + this.fallbackActive = this.useNativeOnMobile && isOnMobile; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "fallbackActive", { + get: function () { + return this._fallbackActive; + }, + set: function (active) { + this._fallbackActive = active; + // If the fallback is active, then the trigger must be manual so the datepicker never opens. + this.datepicker.popup.config.trigger = this.fallbackActive ? PopupTrigger.Manual : PopupTrigger.Focus; + // Update the input value (this will insert the `T` as required). + this.updateValue(this.selectedDateString); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "parser", { + get: function () { + if (this.fallbackActive) { + return new InternalDateParser(this.datepicker.mode, this.datepicker.localeValues); + } + return new DateParser(this.datepicker.localeValues.formats[this.datepicker.mode], this.datepicker.localeValues); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "selectedDateString", { + get: function () { + if (this.datepicker.selectedDate) { + return this.parser.format(this.datepicker.selectedDate); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "type", { + get: function () { + if (this.fallbackActive) { + return this.datepicker.config.fallback; + } + return "text"; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "max", { + get: function () { + if (this.fallbackActive && this.datepicker.maxDate) { + // Since HTML doesn't use a date object max is somewhat tricky. + // Our Datepicker will always choose the 1st date on the provided precision, + // meaning anything below the maxDate will work, hence endOf. + var max = DateUtil.endOf(this.datepicker.config.precision, DateUtil.clone(this.datepicker.maxDate)); + return this.parser.format(max); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDatepickerInputDirective.prototype, "min", { + get: function () { + if (this.fallbackActive && this.datepicker.minDate) { + // Since HTML doesn't use a date object min is somewhat tricky. + // We use 1 minute before the next date at the configured precision since + // our Datepicker picks the first available date at that precision. + var min = DateUtil.clone(this.datepicker.minDate); + return this.parser.format(min); + } + }, + enumerable: true, + configurable: true + }); + SuiDatepickerInputDirective.prototype.updateValue = function (value) { + // Only update the current value if it is different to what it's being updated to. + // This is so that the editing position isn't changed when manually typing the date. + if (!this._lastUpdateTyped) { + this.datepicker.renderer.setProperty(this.element.nativeElement, "value", value || ""); + } + this._lastUpdateTyped = false; + }; + SuiDatepickerInputDirective.prototype.typeValue = function (value) { + this._lastUpdateTyped = true; + this._currentInputValue = value; + if (!value) { + // Delete the selected date if no date was entered manually. + return this.datepicker.writeValue(undefined); + } + var parsed = this.parser.parse(value, this.datepicker.selectedDate); + if (!isNaN(parsed.getTime()) && value === this.parser.format(parsed)) { + return this.datepicker.writeValue(parsed); + } + return this.datepicker.writeValue(undefined); + }; + SuiDatepickerInputDirective.prototype.onFocusOut = function () { + this.valueAccessor.onTouched(); + }; + SuiDatepickerInputDirective.decorators = [ + { type: Directive, args: [{ + selector: "input[suiDatepicker]" + },] }, + ]; + /** @nocollapse */ + SuiDatepickerInputDirective.ctorParameters = function () { return [ + { type: SuiDatepickerDirective, decorators: [{ type: Host },] }, + { type: SuiDatepickerDirectiveValueAccessor, decorators: [{ type: Host },] }, + { type: ElementRef, }, + { type: SuiLocalizationService, }, + ]; }; + SuiDatepickerInputDirective.propDecorators = { + "useNativeOnMobile": [{ type: Input, args: ["pickerUseNativeOnMobile",] },], + "type": [{ type: HostBinding, args: ["attr.type",] },], + "max": [{ type: HostBinding, args: ["attr.max",] },], + "min": [{ type: HostBinding, args: ["attr.min",] },], + "typeValue": [{ type: HostListener, args: ["input", ["$event.target.value"],] },], + "onFocusOut": [{ type: HostListener, args: ["focusout",] },], + }; + return SuiDatepickerInputDirective; +}()); +export { SuiDatepickerInputDirective }; +//# sourceMappingURL=input.directive.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/directives/input.directive.js.map b/dist/modules/datepicker/directives/input.directive.js.map new file mode 100644 index 000000000..3f5590f77 --- /dev/null +++ b/dist/modules/datepicker/directives/input.directive.js.map @@ -0,0 +1 @@ +{"version":3,"file":"input.directive.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/directives/input.directive.ts"],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C;QAEhC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;;YAET,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;SAChD;QAED,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QACtE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACnE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;SAC7C;QACD,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;;IAI1C,gDAAU;QACb,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;;;gBAzHtC,SAAS,SAAC;oBACP,QAAQ,EAAE,sBAAsB;iBACnC;;;;gBAVQ,sBAAsB,uBAqFd,IAAI;gBArFY,mCAAmC,uBAsFnD,IAAI;gBA1FY,UAAU;gBAElC,sBAAsB;;;sCAgB1B,KAAK,SAAC,yBAAyB;yBAyC/B,WAAW,SAAC,WAAW;wBAQvB,WAAW,SAAC,UAAU;wBAWtB,WAAW,SAAC,UAAU;8BAoCtB,YAAY,SAAC,OAAO,EAAE,CAAC,qBAAqB,CAAC;+BAiB7C,YAAY,SAAC,UAAU;;sCApI5B;;SAgBa,2BAA2B","sourcesContent":["\nimport { Directive, Host, Input, ElementRef, HostBinding, HostListener } from \"@angular/core\";\nimport { DateUtil, DatePrecision } from \"../../../misc/util/index\";\nimport { SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { PopupTrigger } from \"../../popup/index\";\nimport { SuiDatepickerDirective, SuiDatepickerDirectiveValueAccessor } from \"./datepicker.directive\";\nimport { InternalDateParser, DateParser } from \"../classes/date-parser\";\nimport * as bowser from \"bowser\";\n\nimport \"../helpers/is-webview\";\nimport * as isUAWebView from \"is-ua-webview\";\nconst isWebView = isUAWebView[\"default\"] || isUAWebView;\n\n@Directive({\n selector: \"input[suiDatepicker]\"\n})\nexport class SuiDatepickerInputDirective {\n private _useNativeOnMobile:boolean;\n\n @Input(\"pickerUseNativeOnMobile\")\n public get useNativeOnMobile():boolean {\n return this._useNativeOnMobile;\n }\n\n public set useNativeOnMobile(fallback:boolean) {\n this._useNativeOnMobile = fallback;\n const isOnMobile = bowser.mobile || bowser.tablet || isWebView(navigator.userAgent);\n this.fallbackActive = this.useNativeOnMobile && isOnMobile;\n }\n\n private _fallbackActive:boolean;\n\n public get fallbackActive():boolean {\n return this._fallbackActive;\n }\n\n public set fallbackActive(active:boolean) {\n this._fallbackActive = active;\n // If the fallback is active, then the trigger must be manual so the datepicker never opens.\n this.datepicker.popup.config.trigger = this.fallbackActive ? PopupTrigger.Manual : PopupTrigger.Focus;\n // Update the input value (this will insert the `T` as required).\n this.updateValue(this.selectedDateString);\n }\n\n public get parser():DateParser {\n if (this.fallbackActive) {\n return new InternalDateParser(this.datepicker.mode, this.datepicker.localeValues);\n }\n return new DateParser(this.datepicker.localeValues.formats[this.datepicker.mode], this.datepicker.localeValues);\n }\n\n private _currentInputValue:string | undefined;\n private _lastUpdateTyped:boolean;\n\n public get selectedDateString():string | undefined {\n if (this.datepicker.selectedDate) {\n return this.parser.format(this.datepicker.selectedDate);\n }\n }\n\n @HostBinding(\"attr.type\")\n public get type():string {\n if (this.fallbackActive) {\n return this.datepicker.config.fallback;\n }\n return \"text\";\n }\n\n @HostBinding(\"attr.max\")\n public get max():string | undefined {\n if (this.fallbackActive && this.datepicker.maxDate) {\n // Since HTML doesn't use a date object max is somewhat tricky.\n // Our Datepicker will always choose the 1st date on the provided precision,\n // meaning anything below the maxDate will work, hence endOf.\n const max = DateUtil.endOf(this.datepicker.config.precision, DateUtil.clone(this.datepicker.maxDate));\n return this.parser.format(max);\n }\n }\n\n @HostBinding(\"attr.min\")\n public get min():string | undefined {\n if (this.fallbackActive && this.datepicker.minDate) {\n // Since HTML doesn't use a date object min is somewhat tricky.\n // We use 1 minute before the next date at the configured precision since\n // our Datepicker picks the first available date at that precision.\n const min = DateUtil.clone(this.datepicker.minDate);\n return this.parser.format(min);\n }\n }\n\n constructor(@Host() public datepicker:SuiDatepickerDirective,\n @Host() public valueAccessor:SuiDatepickerDirectiveValueAccessor,\n public element:ElementRef,\n localizationService:SuiLocalizationService) {\n this.useNativeOnMobile = true;\n this.fallbackActive = false;\n\n // Whenever the datepicker value updates, update the input text alongside it.\n this.datepicker.onSelectedDateChange.subscribe(() =>\n this.updateValue(this.selectedDateString));\n\n localizationService.onLanguageUpdate.subscribe(() =>\n this.updateValue(this.selectedDateString));\n }\n\n private updateValue(value:string | undefined):void {\n // Only update the current value if it is different to what it's being updated to.\n // This is so that the editing position isn't changed when manually typing the date.\n if (!this._lastUpdateTyped) {\n this.datepicker.renderer.setProperty(this.element.nativeElement, \"value\", value || \"\");\n }\n\n this._lastUpdateTyped = false;\n }\n\n @HostListener(\"input\", [\"$event.target.value\"])\n public typeValue(value:string | undefined):void {\n this._lastUpdateTyped = true;\n this._currentInputValue = value;\n\n if (!value) {\n // Delete the selected date if no date was entered manually.\n return this.datepicker.writeValue(undefined);\n }\n\n const parsed = this.parser.parse(value, this.datepicker.selectedDate);\n if (!isNaN(parsed.getTime()) && value === this.parser.format(parsed)) {\n return this.datepicker.writeValue(parsed);\n }\n return this.datepicker.writeValue(undefined);\n }\n\n @HostListener(\"focusout\")\n public onFocusOut():void {\n this.valueAccessor.onTouched();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/directives/input.directive.metadata.json b/dist/modules/datepicker/directives/input.directive.metadata.json new file mode 100644 index 000000000..de0f485b9 --- /dev/null +++ b/dist/modules/datepicker/directives/input.directive.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiDatepickerInputDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":13,"character":1},"arguments":[{"selector":"input[suiDatepicker]"}]}],"members":{"useNativeOnMobile":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":5},"arguments":["pickerUseNativeOnMobile"]}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":60,"character":5},"arguments":["attr.type"]}]}],"max":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":68,"character":5},"arguments":["attr.max"]}]}],"min":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":79,"character":5},"arguments":["attr.min"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host","line":90,"character":17}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host","line":91,"character":17}}],null,null],"parameters":[{"__symbolic":"reference","module":"./datepicker.directive","name":"SuiDatepickerDirective","line":90,"character":42},{"__symbolic":"reference","module":"./datepicker.directive","name":"SuiDatepickerDirectiveValueAccessor","line":91,"character":45},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":92,"character":31},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":93,"character":36}]}],"updateValue":[{"__symbolic":"method"}],"typeValue":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":115,"character":5},"arguments":["input",["$event.target.value"]]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":132,"character":5},"arguments":["focusout"]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/date-fns.d.ts b/dist/modules/datepicker/helpers/date-fns.d.ts new file mode 100644 index 000000000..f3bcc2e2b --- /dev/null +++ b/dist/modules/datepicker/helpers/date-fns.d.ts @@ -0,0 +1,9 @@ +import { IDatepickerLocaleValues } from "../../../behaviors/localization/index"; +export declare class DateFnsParser { + private _weekStartsOn; + private _locale; + private readonly _config; + constructor(locale: IDatepickerLocaleValues); + format(d: Date, f: string): string; + parse(dS: string, f: string, bD: Date): Date; +} diff --git a/dist/modules/datepicker/helpers/date-fns.js b/dist/modules/datepicker/helpers/date-fns.js new file mode 100644 index 000000000..f480f3fad --- /dev/null +++ b/dist/modules/datepicker/helpers/date-fns.js @@ -0,0 +1,99 @@ +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +import { format, parse } from "date-fns"; +import * as defaultLocale from "date-fns/locale/en-US"; +function buildLocalizeFn(values, defaultType, indexCallback) { + return function (dirtyIndex, _a) { + var type = (_a === void 0 ? { type: defaultType } : _a).type; + var index = indexCallback ? indexCallback(dirtyIndex) : dirtyIndex; + return values[type][index]; + }; +} +function buildLocalizeArrayFn(values, defaultType) { + return function (_a) { + var type = (_a === void 0 ? { type: defaultType } : _a).type; + return values[type]; + }; +} +function buildMatchFn(patterns, defaultType) { + return function (dirtyString, _a) { + var type = (_a === void 0 ? { type: defaultType } : _a).type; + return dirtyString.match("^(" + patterns[type].join("|") + ")"); + }; +} +function buildParseFn(patterns, defaultType) { + return function (_a, _b) { + var result = _a[1]; + var type = (_b === void 0 ? { type: defaultType } : _b).type; + return (patterns[type] || patterns[defaultType]) + .map(function (p) { return new RegExp("^" + p); }) + .findIndex(function (pattern) { return pattern.test(result); }); + }; +} +var DateFnsParser = /** @class */ (function () { + function DateFnsParser(locale) { + this._weekStartsOn = locale.firstDayOfWeek; + var weekdayValues = { + long: locale.weekdays, + short: locale.weekdaysShort, + narrow: locale.weekdaysNarrow + }; + var monthValues = { + long: locale.months, + short: locale.monthsShort + }; + var timeOfDayValues = { + long: locale.timesOfDay, + uppercase: locale.timesOfDayUppercase, + lowercase: locale.timesOfDayLowercase + }; + var timeOfDayMatchValues = { + long: locale.timesOfDay, + short: locale.timesOfDayUppercase.concat(locale.timesOfDayLowercase) + }; + this._locale = defaultLocale; + this._locale.localize = __assign({}, this._locale.localize, { + weekday: buildLocalizeFn(weekdayValues, "long"), + weekdays: buildLocalizeArrayFn(weekdayValues, "long"), + month: buildLocalizeFn(monthValues, "long"), + months: buildLocalizeArrayFn(monthValues, "long"), + timeOfDay: buildLocalizeFn(timeOfDayValues, "long", function (hours) { + return hours / 12 >= 1 ? 1 : 0; + }), + timesOfDay: buildLocalizeArrayFn(timeOfDayValues, "long") + }); + this._locale.match = __assign({}, this._locale.match, { + weekdays: buildMatchFn(weekdayValues, "long"), + weekday: buildParseFn(weekdayValues, "long"), + months: buildMatchFn(monthValues, "long"), + month: buildParseFn(monthValues, "long"), + timesOfDay: buildMatchFn(timeOfDayMatchValues, "long"), + timeOfDay: buildParseFn(timeOfDayMatchValues, "long") + }); + } + Object.defineProperty(DateFnsParser.prototype, "_config", { + get: function () { + return { + weekStartsOn: this._weekStartsOn, + locale: this._locale + }; + }, + enumerable: true, + configurable: true + }); + DateFnsParser.prototype.format = function (d, f) { + return format(d, f, this._config); + }; + DateFnsParser.prototype.parse = function (dS, f, bD) { + return parse(dS, f, bD, this._config); + }; + return DateFnsParser; +}()); +export { DateFnsParser }; +//# sourceMappingURL=date-fns.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/date-fns.js.map b/dist/modules/datepicker/helpers/date-fns.js.map new file mode 100644 index 000000000..ecb110385 --- /dev/null +++ b/dist/modules/datepicker/helpers/date-fns.js.map @@ -0,0 +1 @@ +{"version":3,"file":"date-fns.js","s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AAe,EAAE,MAAM,CAAC;SAC5D,CACJ,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,KAAK,gBACX,IAAI,CAAC,OAAO,CAAC,KAAK,EAClB;YACC,QAAQ,EAAE,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC;YAC7C,OAAO,EAAE,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC;YAC5C,MAAM,EAAE,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC;YACzC,KAAK,EAAE,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC;YACxC,UAAU,EAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC;YACrD,SAAS,EAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC;SACvD,CACJ,CAAC;KACL;IAzDD,sBAAY,kCAAO;aAAnB;YACI,MAAM,CAAC;gBACH,YAAY,EAAE,IAAI,CAAC,aAAa;gBAChC,MAAM,EAAE,IAAI,CAAC,OAAO;aACvB,CAAC;SACL;;;OAAA;IAsDM,8BAAM,GAAb,UAAc,CAAM,EAAE,CAAQ;QAC1B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KACrC;IAEM,6BAAK,GAAZ,UAAa,EAAS,EAAE,CAAQ,EAAE,EAAO;QACrC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KACzC;wBA9HL;IA+HC,CAAA;AAtED,yBAsEC","sourcesContent":["import { IDatepickerLocaleValues } from \"../../../behaviors/localization/index\";\nimport { format, parse } from \"date-fns\";\nimport * as defaultLocale from \"date-fns/locale/en-US\";\n\ninterface IDateFnsLocaleValues { [name:string]:string[]; }\ninterface IDateFnsHelperOptions { type?:string; }\ntype DateFnsHelper = (value:U, options:IDateFnsHelperOptions) => T;\ntype DateFnsWeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\ninterface IDateFnsCustomLocale {\n localize:{\n weekday:DateFnsHelper;\n weekdays:DateFnsHelper;\n month:DateFnsHelper;\n months:DateFnsHelper;\n timeOfDay:DateFnsHelper;\n timesOfDay:DateFnsHelper;\n };\n match:{\n weekdays:DateFnsHelper;\n weekday?:DateFnsHelper;\n months:DateFnsHelper;\n month?:DateFnsHelper;\n timesOfDay:DateFnsHelper;\n timeOfDay?:DateFnsHelper;\n };\n options?:{\n weekStartsOn?:number;\n };\n}\n\nfunction buildLocalizeFn(values:IDateFnsLocaleValues,\n defaultType:string,\n indexCallback?:(oldIndex:number) => number):DateFnsHelper {\n\n return (dirtyIndex:number, { type } = { type: defaultType }) => {\n const index = indexCallback ? indexCallback(dirtyIndex) : dirtyIndex;\n return values[type][index];\n };\n}\n\nfunction buildLocalizeArrayFn(values:IDateFnsLocaleValues, defaultType:string):DateFnsHelper {\n return ({ type } = { type: defaultType }) => values[type];\n}\n\nfunction buildMatchFn(patterns:IDateFnsLocaleValues, defaultType:string):DateFnsHelper {\n return (dirtyString, { type } = { type: defaultType }) =>\n dirtyString.match(`^(${patterns[type].join(\"|\")})`);\n}\n\nfunction buildParseFn(patterns:IDateFnsLocaleValues, defaultType:string):DateFnsHelper {\n return ([, result], { type } = { type: defaultType }) =>\n (patterns[type] || patterns[defaultType])\n .map(p => new RegExp(`^${p}`))\n .findIndex(pattern => pattern.test(result));\n}\n\nexport class DateFnsParser {\n private _weekStartsOn:DateFnsWeekStartsOn;\n private _locale:IDateFnsCustomLocale;\n\n private get _config():any {\n return {\n weekStartsOn: this._weekStartsOn,\n locale: this._locale\n };\n }\n\n constructor(locale:IDatepickerLocaleValues) {\n this._weekStartsOn = locale.firstDayOfWeek as DateFnsWeekStartsOn;\n\n const weekdayValues = {\n long: locale.weekdays,\n short: locale.weekdaysShort,\n narrow: locale.weekdaysNarrow\n };\n\n const monthValues = {\n long: locale.months,\n short: locale.monthsShort\n };\n\n const timeOfDayValues = {\n long: locale.timesOfDay,\n uppercase: locale.timesOfDayUppercase,\n lowercase: locale.timesOfDayLowercase\n };\n\n const timeOfDayMatchValues = {\n long: locale.timesOfDay,\n short: locale.timesOfDayUppercase.concat(locale.timesOfDayLowercase)\n };\n\n this._locale = defaultLocale as any;\n this._locale.localize = {\n ...this._locale.localize,\n ...{\n weekday: buildLocalizeFn(weekdayValues, \"long\"),\n weekdays: buildLocalizeArrayFn(weekdayValues, \"long\"),\n month: buildLocalizeFn(monthValues, \"long\"),\n months: buildLocalizeArrayFn(monthValues, \"long\"),\n timeOfDay: buildLocalizeFn(timeOfDayValues, \"long\", (hours:number) => {\n return hours / 12 >= 1 ? 1 : 0;\n }),\n timesOfDay: buildLocalizeArrayFn(timeOfDayValues, \"long\")\n }\n };\n this._locale.match = {\n ...this._locale.match,\n ...{\n weekdays: buildMatchFn(weekdayValues, \"long\"),\n weekday: buildParseFn(weekdayValues, \"long\"),\n months: buildMatchFn(monthValues, \"long\"),\n month: buildParseFn(monthValues, \"long\"),\n timesOfDay:buildMatchFn(timeOfDayMatchValues, \"long\"),\n timeOfDay:buildParseFn(timeOfDayMatchValues, \"long\")\n }\n };\n }\n\n public format(d:Date, f:string):string {\n return format(d, f, this._config);\n }\n\n public parse(dS:string, f:string, bD:Date):Date {\n return parse(dS, f, bD, this._config);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/date-fns.metadata.json b/dist/modules/datepicker/helpers/date-fns.metadata.json new file mode 100644 index 000000000..0b666b0b2 --- /dev/null +++ b/dist/modules/datepicker/helpers/date-fns.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"DateFnsParser":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"IDatepickerLocaleValues","line":68,"character":23}]}],"format":[{"__symbolic":"method"}],"parse":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/is-webview.d.ts b/dist/modules/datepicker/helpers/is-webview.d.ts new file mode 100644 index 000000000..62436b41a --- /dev/null +++ b/dist/modules/datepicker/helpers/is-webview.d.ts @@ -0,0 +1 @@ +declare module "is-ua-webview"; \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/is-webview.js b/dist/modules/datepicker/helpers/is-webview.js new file mode 100644 index 000000000..7749f6d81 --- /dev/null +++ b/dist/modules/datepicker/helpers/is-webview.js @@ -0,0 +1 @@ +//# sourceMappingURL=is-webview.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/is-webview.js.map b/dist/modules/datepicker/helpers/is-webview.js.map new file mode 100644 index 000000000..57ed4f9d3 --- /dev/null +++ b/dist/modules/datepicker/helpers/is-webview.js.map @@ -0,0 +1 @@ +{"version":3,"file":"is-webview.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/helpers/is-webview.ts"],"names":[],"mappings":"","sourcesContent":["declare module \"is-ua-webview\";\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/index.d.ts b/dist/modules/datepicker/index.d.ts new file mode 100644 index 000000000..b57534aaa --- /dev/null +++ b/dist/modules/datepicker/index.d.ts @@ -0,0 +1,19 @@ +export * from "./classes/calendar-config"; +export * from "./classes/calendar-mappings"; +export * from "./classes/date-comparer"; +export * from "./classes/date-parser"; +export * from "./components/calendar-view-title"; +export * from "./components/datepicker"; +export * from "./directives/calendar-item"; +export * from "./directives/datepicker.directive"; +export * from "./directives/input.directive"; +export * from "./helpers/date-fns"; +export * from "./services/calendar-range.service"; +export * from "./services/calendar.service"; +export * from "./views/calendar-view"; +export * from "./views/date-view"; +export * from "./views/hour-view"; +export * from "./views/minute-view"; +export * from "./views/month-view"; +export * from "./views/year-view"; +export * from "./datepicker.module"; diff --git a/dist/modules/datepicker/index.js b/dist/modules/datepicker/index.js new file mode 100644 index 000000000..1a6d3068f --- /dev/null +++ b/dist/modules/datepicker/index.js @@ -0,0 +1,20 @@ +export * from "./classes/calendar-config"; +export * from "./classes/calendar-mappings"; +export * from "./classes/date-comparer"; +export * from "./classes/date-parser"; +export * from "./components/calendar-view-title"; +export * from "./components/datepicker"; +export * from "./directives/calendar-item"; +export * from "./directives/datepicker.directive"; +export * from "./directives/input.directive"; +export * from "./helpers/date-fns"; +export * from "./services/calendar-range.service"; +export * from "./services/calendar.service"; +export * from "./views/calendar-view"; +export * from "./views/date-view"; +export * from "./views/hour-view"; +export * from "./views/minute-view"; +export * from "./views/month-view"; +export * from "./views/year-view"; +export * from "./datepicker.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/index.js.map b/dist/modules/datepicker/index.js.map new file mode 100644 index 000000000..f046575f8 --- /dev/null +++ b/dist/modules/datepicker/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/datepicker/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC;AAExC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAE5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAElC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./classes/calendar-config\";\nexport * from \"./classes/calendar-mappings\";\nexport * from \"./classes/date-comparer\";\nexport * from \"./classes/date-parser\";\n\nexport * from \"./components/calendar-view-title\";\nexport * from \"./components/datepicker\";\n\nexport * from \"./directives/calendar-item\";\nexport * from \"./directives/datepicker.directive\";\nexport * from \"./directives/input.directive\";\n\nexport * from \"./helpers/date-fns\";\n\nexport * from \"./services/calendar-range.service\";\nexport * from \"./services/calendar.service\";\n\nexport * from \"./views/calendar-view\";\nexport * from \"./views/date-view\";\nexport * from \"./views/hour-view\";\nexport * from \"./views/minute-view\";\nexport * from \"./views/month-view\";\nexport * from \"./views/year-view\";\n\nexport * from \"./datepicker.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/index.metadata.json b/dist/modules/datepicker/index.metadata.json new file mode 100644 index 000000000..52d43d44e --- /dev/null +++ b/dist/modules/datepicker/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/calendar-config"},{"from":"./classes/calendar-mappings"},{"from":"./classes/date-comparer"},{"from":"./classes/date-parser"},{"from":"./components/calendar-view-title"},{"from":"./components/datepicker"},{"from":"./directives/calendar-item"},{"from":"./directives/datepicker.directive"},{"from":"./directives/input.directive"},{"from":"./helpers/date-fns"},{"from":"./services/calendar-range.service"},{"from":"./services/calendar.service"},{"from":"./views/calendar-view"},{"from":"./views/date-view"},{"from":"./views/hour-view"},{"from":"./views/minute-view"},{"from":"./views/month-view"},{"from":"./views/year-view"},{"from":"./datepicker.module"}]}] \ No newline at end of file diff --git a/dist/modules/datepicker/public.d.ts b/dist/modules/datepicker/public.d.ts new file mode 100644 index 000000000..c66907cfb --- /dev/null +++ b/dist/modules/datepicker/public.d.ts @@ -0,0 +1 @@ +export { SuiDatepickerModule, DatepickerMode } from "./index"; diff --git a/dist/modules/datepicker/public.js b/dist/modules/datepicker/public.js new file mode 100644 index 000000000..966a59c9f --- /dev/null +++ b/dist/modules/datepicker/public.js @@ -0,0 +1,2 @@ +export { SuiDatepickerModule, DatepickerMode } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/public.js.map b/dist/modules/datepicker/public.js.map new file mode 100644 index 000000000..96833ac1a --- /dev/null +++ b/dist/modules/datepicker/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/datepicker/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,cAAc,EACjB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiDatepickerModule,\n DatepickerMode\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/public.metadata.json b/dist/modules/datepicker/public.metadata.json new file mode 100644 index 000000000..782a6dd0c --- /dev/null +++ b/dist/modules/datepicker/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiDatepickerModule","DatepickerMode"]}]}] \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar-range.service.d.ts b/dist/modules/datepicker/services/calendar-range.service.d.ts new file mode 100644 index 000000000..9cd84b292 --- /dev/null +++ b/dist/modules/datepicker/services/calendar-range.service.d.ts @@ -0,0 +1,42 @@ +import { DatePrecision } from "../../../misc/util/index"; +import { CalendarItem } from "../directives/calendar-item"; +import { CalendarService } from "./calendar.service"; +import { DateComparer } from "../classes/date-comparer"; +export declare class CalendarRange { + start: Date; + dates: Date[]; + items: CalendarItem[]; + readonly inRange: CalendarItem[]; + groupedItems: CalendarItem[][]; + private _comparer; + constructor(start: Date, dates: Date[], items: CalendarItem[], grouped: CalendarItem[][], comparer: DateComparer); + find(item: CalendarItem): CalendarItem | undefined; + findIndex(item: CalendarItem | undefined): number; + containsDate(date: Date): boolean; +} +export declare abstract class CalendarRangeService { + previous: CalendarRange; + current: CalendarRange; + next: CalendarRange; + service: CalendarService; + interval: DatePrecision; + marginal: DatePrecision; + rows: number; + columns: number; + readonly dateComparer: DateComparer; + readonly length: number; + readonly canMoveNext: boolean; + readonly canMovePrevious: boolean; + constructor(interval: DatePrecision, rows: number, columns: number); + loadService(service: CalendarService): void; + refresh(): void; + move(forwards: boolean): void; + moveNext(): void; + movePrevious(): void; + calc(forwards: boolean): CalendarRange; + private calcRange(startDate); + protected calcStart(date: Date): Date; + protected calcDates(rangeStart: Date): Date[]; + protected calcItems(dateRange: Date[], baseDate: Date): CalendarItem[]; + protected abstract configureItem(item: CalendarItem, baseDate: Date): void; +} diff --git a/dist/modules/datepicker/services/calendar-range.service.js b/dist/modules/datepicker/services/calendar-range.service.js new file mode 100644 index 000000000..935bdbc88 --- /dev/null +++ b/dist/modules/datepicker/services/calendar-range.service.js @@ -0,0 +1,146 @@ +import { DateUtil, Util } from "../../../misc/util/index"; +import { CalendarItem } from "../directives/calendar-item"; +import { DateComparer } from "../classes/date-comparer"; +var CalendarRange = /** @class */ (function () { + function CalendarRange(start, dates, items, grouped, comparer) { + this.start = start; + this.dates = dates; + this.items = items; + this.groupedItems = grouped; + this._comparer = comparer; + } + Object.defineProperty(CalendarRange.prototype, "inRange", { + get: function () { + return this.items.filter(function (i) { return !i.isOutsideRange; }); + }, + enumerable: true, + configurable: true + }); + CalendarRange.prototype.find = function (item) { + var _this = this; + return this.items.find(function (i) { return _this._comparer.equal(i.date, item.date); }); + }; + CalendarRange.prototype.findIndex = function (item) { + var _this = this; + if (!item) { + return -1; + } + return this.items.findIndex(function (i) { return _this._comparer.equal(i.date, item.date); }); + }; + CalendarRange.prototype.containsDate = function (date) { + var _this = this; + return !!this.inRange.find(function (i) { return _this._comparer.equal(i.date, date); }); + }; + return CalendarRange; +}()); +export { CalendarRange }; +var CalendarRangeService = /** @class */ (function () { + function CalendarRangeService(interval, rows, columns) { + this.interval = interval; + this.marginal = interval + 1; + this.rows = rows; + this.columns = columns; + } + Object.defineProperty(CalendarRangeService.prototype, "dateComparer", { + get: function () { + return new DateComparer(this.marginal, this.service.inFinalView); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarRangeService.prototype, "length", { + get: function () { + return this.rows * this.columns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarRangeService.prototype, "canMoveNext", { + get: function () { + var firstItem = this.next.inRange[0]; + if (firstItem && this.service.maxDate) { + return firstItem.date <= this.service.maxDate; + } + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarRangeService.prototype, "canMovePrevious", { + get: function () { + var lastItem = this.previous.inRange.slice(-1).pop(); + if (lastItem && this.service.minDate) { + return lastItem.date >= this.service.minDate; + } + return true; + }, + enumerable: true, + configurable: true + }); + CalendarRangeService.prototype.loadService = function (service) { + this.service = service; + this.refresh(); + }; + CalendarRangeService.prototype.refresh = function () { + this.current = this.calcRange(this.service.currentDate); + this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate))); + this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate))); + }; + CalendarRangeService.prototype.move = function (forwards) { + if (forwards) { + return this.moveNext(); + } + return this.movePrevious(); + }; + CalendarRangeService.prototype.moveNext = function () { + DateUtil.next(this.interval, this.service.currentDate); + this.previous = this.current; + this.current = this.next; + this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate))); + }; + CalendarRangeService.prototype.movePrevious = function () { + DateUtil.previous(this.interval, this.service.currentDate); + this.next = this.current; + this.current = this.previous; + this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate))); + }; + CalendarRangeService.prototype.calc = function (forwards) { + if (forwards) { + return this.next; + } + return this.previous; + }; + CalendarRangeService.prototype.calcRange = function (startDate) { + var start = this.calcStart(startDate); + if (this.service.inFinalView) { + DateUtil.startOf(this.marginal, start, true); + } + var dates = this.calcDates(start); + var items = this.calcItems(dates, startDate); + return new CalendarRange(start, dates, items, Util.Array.group(items, this.columns), this.dateComparer); + }; + CalendarRangeService.prototype.calcStart = function (date) { + return DateUtil.startOf(this.interval, DateUtil.clone(date)); + }; + CalendarRangeService.prototype.calcDates = function (rangeStart) { + var _this = this; + return Util.Array + .range(this.length) + .map(function (i) { return DateUtil.add(_this.marginal, DateUtil.clone(rangeStart), i); }); + }; + CalendarRangeService.prototype.calcItems = function (dateRange, baseDate) { + var _this = this; + return dateRange.map(function (date) { + var item = new CalendarItem(date); + item.isDisabled = !_this.dateComparer.between(item.date, _this.service.minDate, _this.service.maxDate); + item.isActive = _this.dateComparer.equal(item.date, _this.service.selectedDate); + item.isToday = _this.dateComparer.equal(item.date, new Date()); + item.isSelectable = item.isDisabled; + _this.configureItem(item, baseDate); + return item; + }); + }; + return CalendarRangeService; +}()); +export { CalendarRangeService }; +//# sourceMappingURL=calendar-range.service.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar-range.service.js.map b/dist/modules/datepicker/services/calendar-range.service.js.map new file mode 100644 index 000000000..aaf3bf2dc --- /dev/null +++ b/dist/modules/datepicker/services/calendar-range.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calendar-range.service.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/services/calendar-range.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,IAAA;IAUI,uBAAY,KAAU,EAAE,KAAY,EAAE,KAAoB,EAAE,OAAwB,EAAE,QAAqB;QACvG,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;KAC7B;IAZD,sBAAW,kCAAO;aAAlB;YACI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,cAAc,EAAjB,CAAiB,CAAC,CAAC;SACpD;;;OAAA;IAYM,4BAAI,GAAX,UAAY,IAAiB;QAA7B,iBAEC;QADG,MAAM,CAAC,IAAI,CAAC,KAAK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G,CAAC,UAAA,IAAI;YACrB,IAAM,IAAI,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;YAEpC,IAAI,CAAC,UAAU,GAAG,CAAC,KAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAI,CAAC,OAAO,CAAC,OAAO,EAAE,KAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpG,IAAI,CAAC,QAAQ,GAAG,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAC9E,IAAI,CAAC,OAAO,GAAG,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC9D,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC;YAEpC,KAAI,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAEnC,MAAM,CAAC,IAAI,CAAC;SACf,CAAC,CAAC;KACN;+BA9JL;IAiKC,CAAA;AA1HD,gCA0HC","sourcesContent":["import { DatePrecision, DateUtil, Util } from \"../../../misc/util/index\";\nimport { CalendarItem } from \"../directives/calendar-item\";\nimport { CalendarService } from \"./calendar.service\";\nimport { DateComparer } from \"../classes/date-comparer\";\n\nexport class CalendarRange {\n public start:Date;\n public dates:Date[];\n public items:CalendarItem[];\n public get inRange():CalendarItem[] {\n return this.items.filter(i => !i.isOutsideRange);\n }\n public groupedItems:CalendarItem[][];\n private _comparer:DateComparer;\n\n constructor(start:Date, dates:Date[], items:CalendarItem[], grouped:CalendarItem[][], comparer:DateComparer) {\n this.start = start;\n this.dates = dates;\n this.items = items;\n this.groupedItems = grouped;\n this._comparer = comparer;\n }\n\n public find(item:CalendarItem):CalendarItem | undefined {\n return this.items.find(i => this._comparer.equal(i.date, item.date));\n }\n\n public findIndex(item:CalendarItem | undefined):number {\n if (!item) {\n return -1;\n }\n return this.items.findIndex(i => this._comparer.equal(i.date, item.date));\n }\n\n public containsDate(date:Date):boolean {\n return !!this.inRange.find(i => this._comparer.equal(i.date, date));\n }\n}\n\nexport abstract class CalendarRangeService {\n public previous:CalendarRange;\n public current:CalendarRange;\n public next:CalendarRange;\n\n public service:CalendarService;\n\n public interval:DatePrecision;\n public marginal:DatePrecision;\n public rows:number;\n public columns:number;\n\n public get dateComparer():DateComparer {\n return new DateComparer(this.marginal, this.service.inFinalView);\n }\n\n public get length():number {\n return this.rows * this.columns;\n }\n\n public get canMoveNext():boolean {\n const firstItem = this.next.inRange[0];\n if (firstItem && this.service.maxDate) {\n return firstItem.date <= this.service.maxDate;\n }\n return true;\n }\n\n public get canMovePrevious():boolean {\n const lastItem = this.previous.inRange.slice(-1).pop();\n if (lastItem && this.service.minDate) {\n return lastItem.date >= this.service.minDate;\n }\n return true;\n }\n\n constructor(interval:DatePrecision, rows:number, columns:number) {\n this.interval = interval;\n this.marginal = interval as number + 1;\n this.rows = rows;\n this.columns = columns;\n }\n\n public loadService(service:CalendarService):void {\n this.service = service;\n\n this.refresh();\n }\n\n public refresh():void {\n this.current = this.calcRange(this.service.currentDate);\n\n this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate)));\n this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate)));\n }\n\n public move(forwards:boolean):void {\n if (forwards) {\n return this.moveNext();\n }\n return this.movePrevious();\n }\n\n public moveNext():void {\n DateUtil.next(this.interval, this.service.currentDate);\n this.previous = this.current;\n this.current = this.next;\n this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate)));\n }\n\n public movePrevious():void {\n DateUtil.previous(this.interval, this.service.currentDate);\n this.next = this.current;\n this.current = this.previous;\n this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate)));\n }\n\n public calc(forwards:boolean):CalendarRange {\n if (forwards) {\n return this.next;\n }\n return this.previous;\n }\n\n private calcRange(startDate:Date):CalendarRange {\n const start = this.calcStart(startDate);\n if (this.service.inFinalView) {\n DateUtil.startOf(this.marginal, start, true);\n }\n const dates = this.calcDates(start);\n const items = this.calcItems(dates, startDate);\n\n return new CalendarRange(start, dates, items, Util.Array.group(items, this.columns), this.dateComparer);\n }\n\n protected calcStart(date:Date):Date {\n return DateUtil.startOf(this.interval, DateUtil.clone(date));\n }\n\n protected calcDates(rangeStart:Date):Date[] {\n return Util.Array\n .range(this.length)\n .map(i => DateUtil.add(this.marginal, DateUtil.clone(rangeStart), i));\n\n }\n\n protected calcItems(dateRange:Date[], baseDate:Date):CalendarItem[] {\n return dateRange.map(date => {\n const item = new CalendarItem(date);\n\n item.isDisabled = !this.dateComparer.between(item.date, this.service.minDate, this.service.maxDate);\n item.isActive = this.dateComparer.equal(item.date, this.service.selectedDate);\n item.isToday = this.dateComparer.equal(item.date, new Date());\n item.isSelectable = item.isDisabled;\n\n this.configureItem(item, baseDate);\n\n return item;\n });\n }\n\n protected abstract configureItem(item:CalendarItem, baseDate:Date):void;\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar-range.service.metadata.json b/dist/modules/datepicker/services/calendar-range.service.metadata.json new file mode 100644 index 000000000..9bfd30398 --- /dev/null +++ b/dist/modules/datepicker/services/calendar-range.service.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"CalendarRange":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Date"},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","name":"Date"}]},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"../directives/calendar-item","name":"CalendarItem","line":15,"character":48}]},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"../directives/calendar-item","name":"CalendarItem","line":15,"character":48}]}]},{"__symbolic":"reference","module":"../classes/date-comparer","name":"DateComparer","line":15,"character":99}]}],"find":[{"__symbolic":"method"}],"findIndex":[{"__symbolic":"method"}],"containsDate":[{"__symbolic":"method"}]}},"CalendarRangeService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../misc/util/index","name":"DatePrecision","line":75,"character":25},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"}]}],"loadService":[{"__symbolic":"method"}],"refresh":[{"__symbolic":"method"}],"move":[{"__symbolic":"method"}],"moveNext":[{"__symbolic":"method"}],"movePrevious":[{"__symbolic":"method"}],"calc":[{"__symbolic":"method"}],"calcRange":[{"__symbolic":"method"}],"calcStart":[{"__symbolic":"method"}],"calcDates":[{"__symbolic":"method"}],"calcItems":[{"__symbolic":"method"}],"configureItem":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar.service.d.ts b/dist/modules/datepicker/services/calendar.service.d.ts new file mode 100644 index 000000000..b906217fd --- /dev/null +++ b/dist/modules/datepicker/services/calendar.service.d.ts @@ -0,0 +1,32 @@ +import { EventEmitter } from "@angular/core"; +import { IDatepickerLocaleValues } from "../../../behaviors/localization/index"; +import { CalendarViewType } from "../views/calendar-view"; +import { CalendarConfig } from "../classes/calendar-config"; +export declare enum CalendarMode { + DateOnly = 0, + TimeOnly = 1, + Both = 2, +} +export declare class CalendarService { + localeValues: IDatepickerLocaleValues; + private _config; + config: CalendarConfig; + currentView: CalendarViewType; + readonly inFinalView: boolean; + currentDate: Date; + private _selectedDate?; + selectedDate: Date | undefined; + private _minDate?; + private _maxDate?; + minDate: Date | undefined; + maxDate: Date | undefined; + private _firstDayOfWeek; + firstDayOfWeek: number; + onDateChange: EventEmitter; + constructor(config: CalendarConfig, localeValues: IDatepickerLocaleValues); + onManualUpdate: () => void; + reset(): void; + changeDate(date: Date, fromView: CalendarViewType): void; + zoomOut(fromView: CalendarViewType): void; + private updateView(mappings, fromView); +} diff --git a/dist/modules/datepicker/services/calendar.service.js b/dist/modules/datepicker/services/calendar.service.js new file mode 100644 index 000000000..9c4060358 --- /dev/null +++ b/dist/modules/datepicker/services/calendar.service.js @@ -0,0 +1,129 @@ +import { EventEmitter } from "@angular/core"; +import { DateUtil } from "../../../misc/util/index"; +export var CalendarMode; +(function (CalendarMode) { + CalendarMode[CalendarMode["DateOnly"] = 0] = "DateOnly"; + CalendarMode[CalendarMode["TimeOnly"] = 1] = "TimeOnly"; + CalendarMode[CalendarMode["Both"] = 2] = "Both"; +})(CalendarMode || (CalendarMode = {})); +var CalendarService = /** @class */ (function () { + function CalendarService(config, localeValues) { + this.localeValues = localeValues; + this.onManualUpdate = function () { }; + this.config = config; + this.currentDate = new Date(); + this.firstDayOfWeek = this.localeValues.firstDayOfWeek; + this.onDateChange = new EventEmitter(); + this.reset(); + } + Object.defineProperty(CalendarService.prototype, "config", { + get: function () { + return this._config; + }, + set: function (config) { + this._config = config; + config.updateBounds(this._selectedDate || this.currentDate); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarService.prototype, "inFinalView", { + get: function () { + return this.currentView === this.config.mappings.finalView; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarService.prototype, "selectedDate", { + get: function () { + return this._selectedDate; + }, + set: function (date) { + if (date) { + this._selectedDate = DateUtil.clone(date); + this.currentDate = DateUtil.clone(date); + } + else { + this._selectedDate = undefined; + } + this.config.updateBounds(this._selectedDate || this.currentDate); + this.onManualUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarService.prototype, "minDate", { + get: function () { + if (this._minDate && this.config.dateMinBound) { + return this._minDate > this.config.dateMinBound ? this._minDate : this.config.dateMinBound; + } + return this._minDate || this.config.dateMinBound; + }, + set: function (min) { + this._minDate = min; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarService.prototype, "maxDate", { + get: function () { + if (this._maxDate && this.config.dateMaxBound) { + return this._maxDate < this.config.dateMaxBound ? this._maxDate : this.config.dateMaxBound; + } + return this._maxDate || this.config.dateMaxBound; + }, + set: function (max) { + this._maxDate = max; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarService.prototype, "firstDayOfWeek", { + get: function () { + return this._firstDayOfWeek; + }, + set: function (firstDayOfWeek) { + if (firstDayOfWeek != undefined) { + this._firstDayOfWeek = Math.max(0, Math.min(6, firstDayOfWeek)); + } + }, + enumerable: true, + configurable: true + }); + CalendarService.prototype.reset = function () { + this.currentView = this.config.mappings.finalView; + if (!this._selectedDate) { + var current = this.currentDate.getTime(); + if (this._minDate) { + current = Math.max(current, this._minDate.getTime()); + } + if (this._maxDate) { + current = Math.min(current, this._maxDate.getTime()); + } + this.currentDate = new Date(current); + this.config.updateBounds(this.currentDate); + this.currentView = this.config.mappings.initialView; + } + }; + CalendarService.prototype.changeDate = function (date, fromView) { + this.currentDate = date; + if (fromView === this.config.mappings.finalView) { + this.selectedDate = date; + return this.onDateChange.emit(date); + } + this.updateView(this.config.mappings.changed, fromView); + }; + CalendarService.prototype.zoomOut = function (fromView) { + this.updateView(this.config.mappings.zoom, fromView); + }; + CalendarService.prototype.updateView = function (mappings, fromView) { + var mapping = mappings.get(fromView); + if (mapping == undefined) { + throw new Error("Unknown view type."); + } + this.currentView = mapping; + }; + return CalendarService; +}()); +export { CalendarService }; +//# sourceMappingURL=calendar.service.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar.service.js.map b/dist/modules/datepicker/services/calendar.service.js.map new file mode 100644 index 000000000..294a94f09 --- /dev/null +++ b/dist/modules/datepicker/services/calendar.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calendar.service.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/services/calendar.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIpD,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,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CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KAC3D;IAEM,iCAAO,GAAd,UAAe,QAAyB;QACpC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACxD;IAEO,oCAAU,GAAlB,UAAmB,QAAgD,EAAE,QAAyB;QAC1F,IAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvC,EAAE,CAAC,CAAC,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;SACzC;QACD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;KAC9B;0BA9IL;IA+IC,CAAA;AAnID,2BAmIC","sourcesContent":["import { EventEmitter } from \"@angular/core\";\nimport { IDatepickerLocaleValues } from \"../../../behaviors/localization/index\";\nimport { DateUtil } from \"../../../misc/util/index\";\nimport { CalendarViewType } from \"../views/calendar-view\";\nimport { CalendarConfig } from \"../classes/calendar-config\";\n\nexport enum CalendarMode {\n DateOnly = 0,\n TimeOnly = 1,\n Both = 2\n}\n\nexport class CalendarService {\n private _config:CalendarConfig;\n\n public get config():CalendarConfig {\n return this._config;\n }\n\n public set config(config:CalendarConfig) {\n this._config = config;\n config.updateBounds(this._selectedDate || this.currentDate);\n }\n\n public currentView:CalendarViewType;\n public get inFinalView():boolean {\n return this.currentView === this.config.mappings.finalView;\n }\n\n public currentDate:Date;\n private _selectedDate?:Date;\n\n public get selectedDate():Date | undefined {\n return this._selectedDate;\n }\n\n public set selectedDate(date:Date | undefined) {\n if (date) {\n this._selectedDate = DateUtil.clone(date);\n this.currentDate = DateUtil.clone(date);\n } else {\n this._selectedDate = undefined;\n }\n\n this.config.updateBounds(this._selectedDate || this.currentDate);\n this.onManualUpdate();\n }\n\n private _minDate?:Date;\n private _maxDate?:Date;\n\n public get minDate():Date | undefined {\n if (this._minDate && this.config.dateMinBound) {\n return this._minDate > this.config.dateMinBound ? this._minDate : this.config.dateMinBound;\n }\n return this._minDate || this.config.dateMinBound;\n }\n\n public set minDate(min:Date | undefined) {\n this._minDate = min;\n }\n\n public get maxDate():Date | undefined {\n if (this._maxDate && this.config.dateMaxBound) {\n return this._maxDate < this.config.dateMaxBound ? this._maxDate : this.config.dateMaxBound;\n }\n return this._maxDate || this.config.dateMaxBound;\n }\n\n public set maxDate(max:Date | undefined) {\n this._maxDate = max;\n }\n\n private _firstDayOfWeek:number;\n\n public get firstDayOfWeek():number {\n return this._firstDayOfWeek;\n }\n\n public set firstDayOfWeek(firstDayOfWeek:number) {\n if (firstDayOfWeek != undefined) {\n this._firstDayOfWeek = Math.max(0, Math.min(6, firstDayOfWeek));\n }\n }\n\n public onDateChange:EventEmitter;\n\n constructor(config:CalendarConfig, public localeValues:IDatepickerLocaleValues) {\n this.config = config;\n\n this.currentDate = new Date();\n\n this.firstDayOfWeek = this.localeValues.firstDayOfWeek;\n\n this.onDateChange = new EventEmitter();\n\n this.reset();\n }\n\n public onManualUpdate:() => void = () => {};\n\n public reset():void {\n this.currentView = this.config.mappings.finalView;\n\n if (!this._selectedDate) {\n let current = this.currentDate.getTime();\n if (this._minDate) {\n current = Math.max(current, this._minDate.getTime());\n }\n if (this._maxDate) {\n current = Math.min(current, this._maxDate.getTime());\n }\n\n this.currentDate = new Date(current);\n this.config.updateBounds(this.currentDate);\n\n this.currentView = this.config.mappings.initialView;\n }\n }\n\n public changeDate(date:Date, fromView:CalendarViewType):void {\n this.currentDate = date;\n\n if (fromView === this.config.mappings.finalView) {\n this.selectedDate = date;\n\n return this.onDateChange.emit(date);\n }\n\n this.updateView(this.config.mappings.changed, fromView);\n }\n\n public zoomOut(fromView:CalendarViewType):void {\n this.updateView(this.config.mappings.zoom, fromView);\n }\n\n private updateView(mappings:Map, fromView:CalendarViewType):void {\n const mapping = mappings.get(fromView);\n if (mapping == undefined) {\n throw new Error(\"Unknown view type.\");\n }\n this.currentView = mapping;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar.service.metadata.json b/dist/modules/datepicker/services/calendar.service.metadata.json new file mode 100644 index 000000000..df55e6c8b --- /dev/null +++ b/dist/modules/datepicker/services/calendar.service.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"CalendarMode":{"DateOnly":0,"TimeOnly":1,"Both":2},"CalendarService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../classes/calendar-config","name":"CalendarConfig","line":87,"character":23},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"IDatepickerLocaleValues","line":87,"character":59}]}],"reset":[{"__symbolic":"method"}],"changeDate":[{"__symbolic":"method"}],"zoomOut":[{"__symbolic":"method"}],"updateView":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/calendar-view.d.ts b/dist/modules/datepicker/views/calendar-view.d.ts new file mode 100644 index 000000000..0b5bbe7fb --- /dev/null +++ b/dist/modules/datepicker/views/calendar-view.d.ts @@ -0,0 +1,32 @@ +import { AfterViewInit, Renderer2, OnDestroy } from "@angular/core"; +import { CalendarItem } from "../directives/calendar-item"; +import { CalendarService } from "../services/calendar.service"; +import { CalendarRangeService } from "../services/calendar-range.service"; +export declare enum CalendarViewType { + Year = 0, + Month = 1, + Date = 2, + Hour = 3, + Minute = 4, +} +export declare type CalendarViewResult = [Date, CalendarViewType]; +export declare abstract class CalendarView implements AfterViewInit, OnDestroy { + private _type; + private _service; + private _renderedItems; + private _highlightedItem?; + service: CalendarService; + ranges: CalendarRangeService; + readonly currentDate: Date; + readonly selectedDate: Date | undefined; + private _documentKeyDownListener; + constructor(renderer: Renderer2, viewType: CalendarViewType, ranges: CalendarRangeService); + setDate(item: CalendarItem): void; + zoomOut(): void; + ngAfterViewInit(): void; + private onRenderedItemsChanged(); + private autoHighlight(); + private highlightItem(item); + private onDocumentKeyDown(e); + ngOnDestroy(): void; +} diff --git a/dist/modules/datepicker/views/calendar-view.js b/dist/modules/datepicker/views/calendar-view.js new file mode 100644 index 000000000..d2f69e374 --- /dev/null +++ b/dist/modules/datepicker/views/calendar-view.js @@ -0,0 +1,174 @@ +import { Input, QueryList, ViewChildren } from "@angular/core"; +import { KeyCode } from "../../../misc/util/index"; +import { SuiCalendarItem } from "../directives/calendar-item"; +import { CalendarService } from "../services/calendar.service"; +export var CalendarViewType; +(function (CalendarViewType) { + CalendarViewType[CalendarViewType["Year"] = 0] = "Year"; + CalendarViewType[CalendarViewType["Month"] = 1] = "Month"; + CalendarViewType[CalendarViewType["Date"] = 2] = "Date"; + CalendarViewType[CalendarViewType["Hour"] = 3] = "Hour"; + CalendarViewType[CalendarViewType["Minute"] = 4] = "Minute"; +})(CalendarViewType || (CalendarViewType = {})); +var CalendarView = /** @class */ (function () { + function CalendarView(renderer, viewType, ranges) { + var _this = this; + this._type = viewType; + this.ranges = ranges; + this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); + } + Object.defineProperty(CalendarView.prototype, "service", { + get: function () { + return this._service; + }, + set: function (service) { + var _this = this; + this._service = service; + this.ranges.loadService(service); + this.service.onManualUpdate = function () { + _this.ranges.refresh(); + delete _this._highlightedItem; + _this.autoHighlight(); + }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarView.prototype, "currentDate", { + get: function () { + return this.service.currentDate; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarView.prototype, "selectedDate", { + get: function () { + return this.service.selectedDate; + }, + enumerable: true, + configurable: true + }); + // Template Methods + // Template Methods + CalendarView.prototype.setDate = + // Template Methods + function (item) { + this.service.changeDate(item.date, this._type); + }; + CalendarView.prototype.zoomOut = function () { + this.service.zoomOut(this._type); + }; + // Keyboard Control + // Keyboard Control + CalendarView.prototype.ngAfterViewInit = + // Keyboard Control + function () { + var _this = this; + this._renderedItems.changes.subscribe(function () { return _this.onRenderedItemsChanged(); }); + this.onRenderedItemsChanged(); + }; + CalendarView.prototype.onRenderedItemsChanged = function () { + var _this = this; + this._renderedItems.forEach(function (i) { + return i.onFocussed.subscribe(function (hasFocus) { + if (hasFocus) { + _this.highlightItem(i.item); + } + }); + }); + this.autoHighlight(); + this.highlightItem(this._highlightedItem); + }; + CalendarView.prototype.autoHighlight = function () { + var _this = this; + var date = this.selectedDate && this.ranges.current.containsDate(this.selectedDate) ? this.selectedDate : this.currentDate; + if (this._highlightedItem && this.ranges.current.containsDate(this._highlightedItem.date)) { + date = this._highlightedItem.date; + } + var initiallyHighlighted = this.ranges.current.items.find(function (i) { return _this.ranges.dateComparer.equal(i.date, date); }); + if (initiallyHighlighted && !initiallyHighlighted.isDisabled) { + this._highlightedItem = initiallyHighlighted; + } + }; + CalendarView.prototype.highlightItem = function (item) { + if (item) { + this._renderedItems.forEach(function (i) { return i.hasFocus = false; }); + var rendered = this._renderedItems.find(function (ri) { return ri.item === item; }); + if (rendered && !rendered.hasFocus) { + rendered.hasFocus = true; + rendered.changeDetector.detectChanges(); + } + this._highlightedItem = item; + } + }; + CalendarView.prototype.onDocumentKeyDown = function (e) { + if (this._highlightedItem && e.keyCode === KeyCode.Enter) { + this.setDate(this._highlightedItem); + return; + } + if (!this._highlightedItem) { + this.autoHighlight(); + } + var index = this.ranges.current.findIndex(this._highlightedItem); + var isMovingForward = true; + var delta = 0; + switch (e.keyCode) { + case KeyCode.Right: + delta += 1; + break; + case KeyCode.Left: + delta -= 1; + isMovingForward = false; + break; + case KeyCode.Down: + delta += this.ranges.columns; + break; + case KeyCode.Up: + delta -= this.ranges.columns; + isMovingForward = false; + break; + default: + return; + } + // Stop these keypresses being captured elsewhere. + e.preventDefault(); + var nextItem = this.ranges.current.items[index + delta]; + if (nextItem && nextItem.isDisabled) { + return; + } + if (nextItem && !nextItem.isOutsideRange) { + return this.highlightItem(nextItem); + } + if (nextItem && nextItem.isOutsideRange) { + if (index + delta >= this.ranges.current.inRange.length) { + isMovingForward = true; + } + } + if (!nextItem) { + var adjustedIndex = this.ranges.current.findIndex(this._highlightedItem); + var nextItems = this.ranges.calc(isMovingForward).inRange; + if (isMovingForward) { + adjustedIndex -= this.ranges.current.inRange.length; + } + else { + adjustedIndex += nextItems.length; + } + nextItem = nextItems[adjustedIndex + delta]; + if (nextItem.isDisabled) { + return; + } + } + this.ranges.move(isMovingForward); + this._highlightedItem = this.ranges.current.find(nextItem); + }; + CalendarView.prototype.ngOnDestroy = function () { + this._documentKeyDownListener(); + }; + CalendarView.propDecorators = { + "_renderedItems": [{ type: ViewChildren, args: [SuiCalendarItem,] },], + "service": [{ type: Input },], + }; + return CalendarView; +}()); +export { CalendarView }; +//# sourceMappingURL=calendar-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/calendar-view.js.map b/dist/modules/datepicker/views/calendar-view.js.map new file mode 100644 index 000000000..f8c38d4d1 --- /dev/null +++ b/dist/modules/datepicker/views/calendar-view.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calendar-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/calendar-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAqD,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAgB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IACxB,uDAAQ,CAAA;IACR,yDAAS,CAAA;IACT,uDAAQ,CAAA;IACR,uDAAQ,CAAA;IACR,2DAAU,CAAA;GALF,gBAAgB,KAAhB,gBAAgB,QAM3B;;IAwCG,sBAAY,QAAkB,EAAE,QAAyB,EAAE,MAA2B;QAAtF,iBAKC;QAJG,IAAI,CAAC,KAAK,GAAG,QAAQ,C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AAC,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC;YAE5D,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;gBAClB,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;aACvD;YAAC,IAAI,CAAC,CAAC;gBACJ,aAAa,IAAI,SAAS,CAAC,MAAM,CAAC;aACrC;YAED,QAAQ,GAAG,SAAS,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;YAE5C,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;gBACtB,MAAM,CAAC;aACV;SACJ;QAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAClC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KAC9D;IAEM,kCAAW,GAAlB;QACI,IAAI,CAAC,wBAAwB,EAAE,CAAC;KACnC;;mCA1KA,YAAY,SAAC,eAAe;4BAI5B,KAAK;;uBAvBV;;SAesB,YAAY","sourcesContent":["import { Input, QueryList, ViewChildren, AfterViewInit, HostListener, Renderer2, OnDestroy } from \"@angular/core\";\nimport { KeyCode } from \"../../../misc/util/index\";\nimport { CalendarItem, SuiCalendarItem } from \"../directives/calendar-item\";\nimport { CalendarService } from \"../services/calendar.service\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\n\nexport enum CalendarViewType {\n Year = 0,\n Month = 1,\n Date = 2,\n Hour = 3,\n Minute = 4\n}\nexport type CalendarViewResult = [Date, CalendarViewType];\n\nexport abstract class CalendarView implements AfterViewInit, OnDestroy {\n private _type:CalendarViewType;\n private _service:CalendarService;\n\n @ViewChildren(SuiCalendarItem)\n private _renderedItems:QueryList;\n private _highlightedItem?:CalendarItem;\n\n @Input()\n public set service(service:CalendarService) {\n this._service = service;\n this.ranges.loadService(service);\n\n this.service.onManualUpdate = () => {\n this.ranges.refresh();\n\n delete this._highlightedItem;\n this.autoHighlight();\n };\n }\n\n public get service():CalendarService {\n return this._service;\n }\n\n public ranges:CalendarRangeService;\n\n public get currentDate():Date {\n return this.service.currentDate;\n }\n\n public get selectedDate():Date | undefined {\n return this.service.selectedDate;\n }\n\n private _documentKeyDownListener:() => void;\n\n constructor(renderer:Renderer2, viewType:CalendarViewType, ranges:CalendarRangeService) {\n this._type = viewType;\n this.ranges = ranges;\n\n this._documentKeyDownListener = renderer.listen(\"document\", \"keydown\", (e:KeyboardEvent) => this.onDocumentKeyDown(e));\n }\n\n // Template Methods\n\n public setDate(item:CalendarItem):void {\n this.service.changeDate(item.date, this._type);\n }\n\n public zoomOut():void {\n this.service.zoomOut(this._type);\n }\n\n // Keyboard Control\n\n public ngAfterViewInit():void {\n this._renderedItems.changes.subscribe(() => this.onRenderedItemsChanged());\n this.onRenderedItemsChanged();\n }\n\n private onRenderedItemsChanged():void {\n this._renderedItems.forEach(i =>\n i.onFocussed.subscribe((hasFocus:boolean) => {\n if (hasFocus) {\n this.highlightItem(i.item);\n }\n }));\n\n this.autoHighlight();\n this.highlightItem(this._highlightedItem);\n }\n\n private autoHighlight():void {\n let date = this.selectedDate && this.ranges.current.containsDate(this.selectedDate) ? this.selectedDate : this.currentDate;\n if (this._highlightedItem && this.ranges.current.containsDate(this._highlightedItem.date)) {\n date = this._highlightedItem.date;\n }\n\n const initiallyHighlighted = this.ranges.current.items.find(i => this.ranges.dateComparer.equal(i.date, date));\n if (initiallyHighlighted && !initiallyHighlighted.isDisabled) {\n this._highlightedItem = initiallyHighlighted;\n }\n }\n\n private highlightItem(item:CalendarItem | undefined):void {\n if (item) {\n this._renderedItems.forEach(i => i.hasFocus = false);\n const rendered = this._renderedItems.find(ri => ri.item === item);\n if (rendered && !rendered.hasFocus) {\n rendered.hasFocus = true;\n rendered.changeDetector.detectChanges();\n }\n\n this._highlightedItem = item;\n }\n }\n\n private onDocumentKeyDown(e:KeyboardEvent):void {\n if (this._highlightedItem && e.keyCode === KeyCode.Enter) {\n this.setDate(this._highlightedItem);\n return;\n }\n\n if (!this._highlightedItem) {\n this.autoHighlight();\n }\n\n const index = this.ranges.current.findIndex(this._highlightedItem);\n let isMovingForward = true;\n let delta = 0;\n\n switch (e.keyCode) {\n case KeyCode.Right:\n delta += 1;\n break;\n case KeyCode.Left:\n delta -= 1;\n isMovingForward = false;\n break;\n case KeyCode.Down:\n delta += this.ranges.columns;\n break;\n case KeyCode.Up:\n delta -= this.ranges.columns;\n isMovingForward = false;\n break;\n default:\n return;\n }\n\n // Stop these keypresses being captured elsewhere.\n e.preventDefault();\n\n let nextItem = this.ranges.current.items[index + delta];\n\n if (nextItem && nextItem.isDisabled) {\n return;\n }\n\n if (nextItem && !nextItem.isOutsideRange) {\n return this.highlightItem(nextItem);\n }\n\n if (nextItem && nextItem.isOutsideRange) {\n if (index + delta >= this.ranges.current.inRange.length) {\n isMovingForward = true;\n }\n }\n\n if (!nextItem) {\n let adjustedIndex = this.ranges.current.findIndex(this._highlightedItem);\n\n const nextItems = this.ranges.calc(isMovingForward).inRange;\n\n if (isMovingForward) {\n adjustedIndex -= this.ranges.current.inRange.length;\n } else {\n adjustedIndex += nextItems.length;\n }\n\n nextItem = nextItems[adjustedIndex + delta];\n\n if (nextItem.isDisabled) {\n return;\n }\n }\n\n this.ranges.move(isMovingForward);\n this._highlightedItem = this.ranges.current.find(nextItem);\n }\n\n public ngOnDestroy():void {\n this._documentKeyDownListener();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/calendar-view.metadata.json b/dist/modules/datepicker/views/calendar-view.metadata.json new file mode 100644 index 000000000..423899f2d --- /dev/null +++ b/dist/modules/datepicker/views/calendar-view.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"CalendarViewType":{"Year":0,"Month":1,"Date":2,"Hour":3,"Minute":4},"CalendarViewResult":{"__symbolic":"interface"},"CalendarView":{"__symbolic":"class","members":{"_renderedItems":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChildren","line":19,"character":5},"arguments":[{"__symbolic":"reference","module":"../directives/calendar-item","name":"SuiCalendarItem","line":19,"character":18}]}]}],"service":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":52,"character":25},{"__symbolic":"error","message":"Could not resolve type","line":52,"character":45,"context":{"typeName":"CalendarViewType"}},{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":52,"character":70}]}],"setDate":[{"__symbolic":"method"}],"zoomOut":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"onRenderedItemsChanged":[{"__symbolic":"method"}],"autoHighlight":[{"__symbolic":"method"}],"highlightItem":[{"__symbolic":"method"}],"onDocumentKeyDown":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/date-view.d.ts b/dist/modules/datepicker/views/date-view.d.ts new file mode 100644 index 000000000..78c261e58 --- /dev/null +++ b/dist/modules/datepicker/views/date-view.d.ts @@ -0,0 +1,13 @@ +import { Renderer2 } from "@angular/core"; +import { CalendarItem } from "../directives/calendar-item"; +import { CalendarView } from "./calendar-view"; +import { CalendarRangeService } from "../services/calendar-range.service"; +export declare class CalendarRangeDateService extends CalendarRangeService { + calcStart(start: Date): Date; + configureItem(item: CalendarItem, baseDate: Date): void; +} +export declare class SuiCalendarDateView extends CalendarView { + readonly days: string[]; + readonly date: string; + constructor(renderer: Renderer2); +} diff --git a/dist/modules/datepicker/views/date-view.js b/dist/modules/datepicker/views/date-view.js new file mode 100644 index 000000000..4afe31d6b --- /dev/null +++ b/dist/modules/datepicker/views/date-view.js @@ -0,0 +1,68 @@ +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 __()); + }; +})(); +import { Component, Renderer2 } from "@angular/core"; +import { DateUtil, DatePrecision } from "../../../misc/util/index"; +import { CalendarView, CalendarViewType } from "./calendar-view"; +import { CalendarRangeService } from "../services/calendar-range.service"; +import { DateParser } from "../classes/date-parser"; +var CalendarRangeDateService = /** @class */ (function (_super) { + __extends(CalendarRangeDateService, _super); + function CalendarRangeDateService() { + return _super !== null && _super.apply(this, arguments) || this; + } + CalendarRangeDateService.prototype.calcStart = function (start) { + var monthStart = DateUtil.startOf(DatePrecision.Month, DateUtil.clone(start)); + monthStart.setDate((1 - monthStart.getDay() + this.service.firstDayOfWeek - 7) % 7); + return monthStart; + }; + CalendarRangeDateService.prototype.configureItem = function (item, baseDate) { + item.humanReadable = item.date.getDate().toString(); + item.isOutsideRange = item.date.getMonth() !== baseDate.getMonth(); + item.isSelectable = item.isDisabled; + }; + return CalendarRangeDateService; +}(CalendarRangeService)); +export { CalendarRangeDateService }; +var SuiCalendarDateView = /** @class */ (function (_super) { + __extends(SuiCalendarDateView, _super); + function SuiCalendarDateView(renderer) { + return _super.call(this, renderer, CalendarViewType.Date, new CalendarRangeDateService(DatePrecision.Month, 6, 7)) || this; + } + Object.defineProperty(SuiCalendarDateView.prototype, "days", { + get: function () { + var _this = this; + var days = this.service.localeValues.weekdaysNarrow; + return days.map(function (d, i) { return days[(i + _this.service.firstDayOfWeek) % days.length]; }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiCalendarDateView.prototype, "date", { + get: function () { + return new DateParser(this.service.localeValues.formats.month, this.service.localeValues).format(this.currentDate); + }, + enumerable: true, + configurable: true + }); + SuiCalendarDateView.decorators = [ + { type: Component, args: [{ + selector: "sui-calendar-date-view", + template: "\n\n\n \n \n \n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ day }}
{{ item.humanReadable }}\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiCalendarDateView.ctorParameters = function () { return [ + { type: Renderer2, }, + ]; }; + return SuiCalendarDateView; +}(CalendarView)); +export { SuiCalendarDateView }; +//# sourceMappingURL=date-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/date-view.js.map b/dist/modules/datepicker/views/date-view.js.map new file mode 100644 index 000000000..e9eeac9de --- /dev/null +++ b/dist/modules/datepicker/views/date-view.js.map @@ -0,0 +1 @@ +{"version":3,"file":"date-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/date-view.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,IAAA;IAA8C,4CAAoB;;;;IACvD,4CAAS,GAAhB,UAAiB,KAAU;QACvB,IAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAChF,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACpF,MAAM,CAAC,UAAU,CAAC;KACrB;IAEM,gDAAa,GAApB,UAAqB,IAAiB,EAAE,QAAa;QACjD,IAAI,CAAC,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{ CalendarItem } from \"../directives/calendar-item\";\nimport { CalendarView, CalendarViewType } from \"./calendar-view\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\nimport { DateParser } from \"../classes/date-parser\";\n\nexport class CalendarRangeDateService extends CalendarRangeService {\n public calcStart(start:Date):Date {\n const monthStart = DateUtil.startOf(DatePrecision.Month, DateUtil.clone(start));\n monthStart.setDate((1 - monthStart.getDay() + this.service.firstDayOfWeek - 7) % 7);\n return monthStart;\n }\n\n public configureItem(item:CalendarItem, baseDate:Date):void {\n item.humanReadable = item.date.getDate().toString();\n item.isOutsideRange = item.date.getMonth() !== baseDate.getMonth();\n item.isSelectable = item.isDisabled;\n }\n}\n\n@Component({\n selector: \"sui-calendar-date-view\",\n template: `\n\n\n \n \n \n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ day }}
{{ item.humanReadable }}\n
\n`\n})\nexport class SuiCalendarDateView extends CalendarView {\n public get days():string[] {\n const days = this.service.localeValues.weekdaysNarrow;\n return days.map((d, i) => days[(i + this.service.firstDayOfWeek) % days.length]);\n }\n\n public get date():string {\n return new DateParser(this.service.localeValues.formats.month, this.service.localeValues).format(this.currentDate);\n }\n\n constructor(renderer:Renderer2) {\n super(renderer, CalendarViewType.Date, new CalendarRangeDateService(DatePrecision.Month, 6, 7));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/date-view.metadata.json b/dist/modules/datepicker/views/date-view.metadata.json new file mode 100644 index 000000000..d6224dbdd --- /dev/null +++ b/dist/modules/datepicker/views/date-view.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"CalendarRangeDateService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":7,"character":46},"members":{"calcStart":[{"__symbolic":"method"}],"configureItem":[{"__symbolic":"method"}]}},"SuiCalendarDateView":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./calendar-view","name":"CalendarView","line":49,"character":41},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":21,"character":1},"arguments":[{"selector":"sui-calendar-date-view","template":"\n\n\n \n \n \n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ day }}
{{ item.humanReadable }}\n
\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":59,"character":25}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/hour-view.d.ts b/dist/modules/datepicker/views/hour-view.d.ts new file mode 100644 index 000000000..87a69b302 --- /dev/null +++ b/dist/modules/datepicker/views/hour-view.d.ts @@ -0,0 +1,11 @@ +import { Renderer2 } from "@angular/core"; +import { CalendarView } from "./calendar-view"; +import { CalendarItem } from "../directives/calendar-item"; +import { CalendarRangeService } from "../services/calendar-range.service"; +export declare class CalendarRangeHourService extends CalendarRangeService { + configureItem(item: CalendarItem, baseDate: Date): void; +} +export declare class SuiCalendarHourView extends CalendarView { + readonly date: string; + constructor(renderer: Renderer2); +} diff --git a/dist/modules/datepicker/views/hour-view.js b/dist/modules/datepicker/views/hour-view.js new file mode 100644 index 000000000..7b78ca3f2 --- /dev/null +++ b/dist/modules/datepicker/views/hour-view.js @@ -0,0 +1,55 @@ +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 __()); + }; +})(); +import { Component, Renderer2 } from "@angular/core"; +import { DatePrecision } from "../../../misc/util/index"; +import { CalendarView, CalendarViewType } from "./calendar-view"; +import { CalendarRangeService } from "../services/calendar-range.service"; +import { DateParser } from "../classes/date-parser"; +var CalendarRangeHourService = /** @class */ (function (_super) { + __extends(CalendarRangeHourService, _super); + function CalendarRangeHourService() { + return _super !== null && _super.apply(this, arguments) || this; + } + CalendarRangeHourService.prototype.configureItem = function (item, baseDate) { + // Set minutes and seconds to 0 + var customFormat = this.service.localeValues.formats.time.replace(/[ms]/g, "0"); + item.humanReadable = new DateParser(customFormat, this.service.localeValues).format(item.date); + item.isOutsideRange = false; + }; + return CalendarRangeHourService; +}(CalendarRangeService)); +export { CalendarRangeHourService }; +var SuiCalendarHourView = /** @class */ (function (_super) { + __extends(SuiCalendarHourView, _super); + function SuiCalendarHourView(renderer) { + return _super.call(this, renderer, CalendarViewType.Hour, new CalendarRangeHourService(DatePrecision.Date, 6, 4)) || this; + } + Object.defineProperty(SuiCalendarHourView.prototype, "date", { + get: function () { + return new DateParser(this.service.localeValues.formats.date, this.service.localeValues).format(this.currentDate); + }, + enumerable: true, + configurable: true + }); + SuiCalendarHourView.decorators = [ + { type: Component, args: [{ + selector: "sui-calendar-hour-view", + template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiCalendarHourView.ctorParameters = function () { return [ + { type: Renderer2, }, + ]; }; + return SuiCalendarHourView; +}(CalendarView)); +export { SuiCalendarHourView }; +//# sourceMappingURL=hour-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/hour-view.js.map b/dist/modules/datepicker/views/hour-view.js.map new file mode 100644 index 000000000..bb55b9f71 --- /dev/null +++ b/dist/modules/datepicker/views/hour-view.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hour-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/hour-view.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,IAAA;IAA8C,4CAAoB;;;;IACvD,gDAAa,GAApB,UAAqB,IAAiB,EAAE,QAAa;;QAEjD,IAAM,YAAY,GAAU,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACzF,IAAI,CAAC,aAAa,GAAG,IAAI,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/F,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;KAC/B;mCAbL;EAO8C,oBAAoB,EAOjE,CAAA;AAPD,oCAOC;;IA2BwC,uCAAY;IAMjD,6BAAY,QAAkB;eAC1B,kBAAM,QAAQ,EAAE,gBAAgB,CAAC,IAAI,EAAE,IAAI,wBAAwB,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACjG;IAND,sBAAW,qCAAI;aAAf;YACI,MAAM,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACrH;;;OAAA;;gBA7BJ,SAAS,SAAC;oBACP,QAAQ,EAAE,wBAAwB;oBAClC,QAAQ,EAAE,goBAqBb;iBACA;;;;gBAxCmB,SAAS;;8BAA7B;EAyCyC,YAAY;SAAxC,mBAAmB","sourcesContent":["import { Component, Renderer2 } from \"@angular/core\";\nimport { DatePrecision } from \"../../../misc/util/index\";\nimport { CalendarView, CalendarViewType } from \"./calendar-view\";\nimport { CalendarItem } from \"../directives/calendar-item\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\nimport { DateParser } from \"../classes/date-parser\";\n\nexport class CalendarRangeHourService extends CalendarRangeService {\n public configureItem(item:CalendarItem, baseDate:Date):void {\n // Set minutes and seconds to 0\n const customFormat:string = this.service.localeValues.formats.time.replace(/[ms]/g, \"0\");\n item.humanReadable = new DateParser(customFormat, this.service.localeValues).format(item.date);\n item.isOutsideRange = false;\n }\n}\n\n@Component({\n selector: \"sui-calendar-hour-view\",\n template: `\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n`\n})\nexport class SuiCalendarHourView extends CalendarView {\n\n public get date():string {\n return new DateParser(this.service.localeValues.formats.date, this.service.localeValues).format(this.currentDate);\n }\n\n constructor(renderer:Renderer2) {\n super(renderer, CalendarViewType.Hour, new CalendarRangeHourService(DatePrecision.Date, 6, 4));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/hour-view.metadata.json b/dist/modules/datepicker/views/hour-view.metadata.json new file mode 100644 index 000000000..f4636df12 --- /dev/null +++ b/dist/modules/datepicker/views/hour-view.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"CalendarRangeHourService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":7,"character":46},"members":{"configureItem":[{"__symbolic":"method"}]}},"SuiCalendarHourView":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./calendar-view","name":"CalendarView","line":41,"character":41},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":16,"character":1},"arguments":[{"selector":"sui-calendar-hour-view","template":"\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":47,"character":25}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/minute-view.d.ts b/dist/modules/datepicker/views/minute-view.d.ts new file mode 100644 index 000000000..f2c01405c --- /dev/null +++ b/dist/modules/datepicker/views/minute-view.d.ts @@ -0,0 +1,13 @@ +import { Renderer2 } from "@angular/core"; +import { CalendarView } from "./calendar-view"; +import { CalendarItem } from "../directives/calendar-item"; +import { CalendarRangeService } from "../services/calendar-range.service"; +export declare class CalendarRangeMinuteService extends CalendarRangeService { + calcStart(start: Date): Date; + calcDates(start: Date): Date[]; + configureItem(item: CalendarItem, baseDate: Date): void; +} +export declare class SuiCalendarMinuteView extends CalendarView { + readonly date: string; + constructor(renderer: Renderer2); +} diff --git a/dist/modules/datepicker/views/minute-view.js b/dist/modules/datepicker/views/minute-view.js new file mode 100644 index 000000000..17b495f35 --- /dev/null +++ b/dist/modules/datepicker/views/minute-view.js @@ -0,0 +1,71 @@ +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 __()); + }; +})(); +import { Component, Renderer2 } from "@angular/core"; +import { Util, DateUtil, DatePrecision } from "../../../misc/util/index"; +import { CalendarView, CalendarViewType } from "./calendar-view"; +import { CalendarMode } from "../services/calendar.service"; +import { CalendarRangeService } from "../services/calendar-range.service"; +import { DateParser } from "../classes/date-parser"; +var CalendarRangeMinuteService = /** @class */ (function (_super) { + __extends(CalendarRangeMinuteService, _super); + function CalendarRangeMinuteService() { + return _super !== null && _super.apply(this, arguments) || this; + } + CalendarRangeMinuteService.prototype.calcStart = function (start) { + return DateUtil.startOf(DatePrecision.Hour, DateUtil.clone(start), true); + }; + CalendarRangeMinuteService.prototype.calcDates = function (start) { + return Util.Array + .range(this.length) + .map(function (i) { return DateUtil.add(DatePrecision.Minute, DateUtil.clone(start), i * 5); }); + }; + CalendarRangeMinuteService.prototype.configureItem = function (item, baseDate) { + item.humanReadable = new DateParser(this.service.localeValues.formats.time, this.service.localeValues).format(item.date); + item.isOutsideRange = false; + }; + return CalendarRangeMinuteService; +}(CalendarRangeService)); +export { CalendarRangeMinuteService }; +var SuiCalendarMinuteView = /** @class */ (function (_super) { + __extends(SuiCalendarMinuteView, _super); + function SuiCalendarMinuteView(renderer) { + return _super.call(this, renderer, CalendarViewType.Minute, new CalendarRangeMinuteService(DatePrecision.Hour, 4, 3)) || this; + } + Object.defineProperty(SuiCalendarMinuteView.prototype, "date", { + get: function () { + if (this.service.config.mode !== CalendarMode.TimeOnly) { + // Set minutes and seconds to 0 + var dateTimeFormat = this.service.localeValues.formats.datetime.replace(/[ms]/g, "0"); + return new DateParser(dateTimeFormat, this.service.localeValues).format(this.currentDate); + } + else { + // Set minutes and seconds to 0 + var timeFormat = this.service.localeValues.formats.time.replace(/[ms]/g, "0"); + return new DateParser(timeFormat, this.service.localeValues).format(this.currentDate); + } + }, + enumerable: true, + configurable: true + }); + SuiCalendarMinuteView.decorators = [ + { type: Component, args: [{ + selector: "sui-calendar-minute-view", + template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiCalendarMinuteView.ctorParameters = function () { return [ + { type: Renderer2, }, + ]; }; + return SuiCalendarMinuteView; +}(CalendarView)); +export { SuiCalendarMinuteView }; +//# sourceMappingURL=minute-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/minute-view.js.map b/dist/modules/datepicker/views/minute-view.js.map new file mode 100644 index 000000000..fe813e5e3 --- /dev/null +++ b/dist/modules/datepicker/views/minute-view.js.map @@ -0,0 +1 @@ +{"version":3,"file":"minute-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/minute-view.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,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AAgB,CAAC,MAAM,EAAE,IAAI,0BAA0B,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACrG;IAdD,sBAAW,uCAAI;aAAf;YACI,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;;gBAErD,IAAM,cAAc,GAAU,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC/F,MAAM,CAAC,IAAI,UAAU,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aAC7F;YAAC,IAAI,CAAC,CAAC;;gBAEJ,IAAM,UAAU,GAAU,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBACvF,MAAM,CAAC,IAAI,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aACzF;SACJ;;;OAAA;;gBApCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,0BAA0B;oBACpC,QAAQ,EAAE,gmBAqBb;iBACA;;;;gBAjDmB,SAAS;;gCAA7B;EAkD2C,YAAY;SAA1C,qBAAqB","sourcesContent":["import { Component, Renderer2 } from \"@angular/core\";\nimport { Util, DateUtil, DatePrecision } from \"../../../misc/util/index\";\nimport { CalendarView, CalendarViewType } from \"./calendar-view\";\nimport { CalendarItem } from \"../directives/calendar-item\";\nimport { CalendarMode } from \"../services/calendar.service\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\nimport { DateParser } from \"../classes/date-parser\";\n\nexport class CalendarRangeMinuteService extends CalendarRangeService {\n public calcStart(start:Date):Date {\n return DateUtil.startOf(DatePrecision.Hour, DateUtil.clone(start), true);\n }\n\n public calcDates(start:Date):Date[] {\n return Util.Array\n .range(this.length)\n .map(i => DateUtil.add(DatePrecision.Minute, DateUtil.clone(start), i * 5));\n }\n\n public configureItem(item:CalendarItem, baseDate:Date):void {\n item.humanReadable = new DateParser(this.service.localeValues.formats.time, this.service.localeValues).format(item.date);\n item.isOutsideRange = false;\n }\n}\n\n@Component({\n selector: \"sui-calendar-minute-view\",\n template: `\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n`\n})\nexport class SuiCalendarMinuteView extends CalendarView {\n public get date():string {\n if (this.service.config.mode !== CalendarMode.TimeOnly) {\n // Set minutes and seconds to 0\n const dateTimeFormat:string = this.service.localeValues.formats.datetime.replace(/[ms]/g, \"0\");\n return new DateParser(dateTimeFormat, this.service.localeValues).format(this.currentDate);\n } else {\n // Set minutes and seconds to 0\n const timeFormat:string = this.service.localeValues.formats.time.replace(/[ms]/g, \"0\");\n return new DateParser(timeFormat, this.service.localeValues).format(this.currentDate);\n }\n }\n\n constructor(renderer:Renderer2) {\n super(renderer, CalendarViewType.Minute, new CalendarRangeMinuteService(DatePrecision.Hour, 4, 3));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/minute-view.metadata.json b/dist/modules/datepicker/views/minute-view.metadata.json new file mode 100644 index 000000000..610f39373 --- /dev/null +++ b/dist/modules/datepicker/views/minute-view.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"CalendarRangeMinuteService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":8,"character":48},"members":{"calcStart":[{"__symbolic":"method"}],"calcDates":[{"__symbolic":"method"}],"configureItem":[{"__symbolic":"method"}]}},"SuiCalendarMinuteView":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./calendar-view","name":"CalendarView","line":50,"character":43},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":25,"character":1},"arguments":[{"selector":"sui-calendar-minute-view","template":"\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":63,"character":25}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/month-view.d.ts b/dist/modules/datepicker/views/month-view.d.ts new file mode 100644 index 000000000..20150fb62 --- /dev/null +++ b/dist/modules/datepicker/views/month-view.d.ts @@ -0,0 +1,11 @@ +import { Renderer2 } from "@angular/core"; +import { CalendarView } from "./calendar-view"; +import { CalendarItem } from "../directives/calendar-item"; +import { CalendarRangeService } from "../services/calendar-range.service"; +export declare class CalendarRangeMonthService extends CalendarRangeService { + configureItem(item: CalendarItem, baseDate: Date): void; +} +export declare class SuiCalendarMonthView extends CalendarView { + readonly year: string; + constructor(renderer: Renderer2); +} diff --git a/dist/modules/datepicker/views/month-view.js b/dist/modules/datepicker/views/month-view.js new file mode 100644 index 000000000..4320e0818 --- /dev/null +++ b/dist/modules/datepicker/views/month-view.js @@ -0,0 +1,53 @@ +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 __()); + }; +})(); +import { Component, Renderer2 } from "@angular/core"; +import { DatePrecision } from "../../../misc/util/index"; +import { CalendarView, CalendarViewType } from "./calendar-view"; +import { CalendarRangeService } from "../services/calendar-range.service"; +import { DateParser } from "../classes/date-parser"; +var CalendarRangeMonthService = /** @class */ (function (_super) { + __extends(CalendarRangeMonthService, _super); + function CalendarRangeMonthService() { + return _super !== null && _super.apply(this, arguments) || this; + } + CalendarRangeMonthService.prototype.configureItem = function (item, baseDate) { + item.humanReadable = this.service.localeValues.monthsShort[item.date.getMonth()]; + item.isOutsideRange = false; + }; + return CalendarRangeMonthService; +}(CalendarRangeService)); +export { CalendarRangeMonthService }; +var SuiCalendarMonthView = /** @class */ (function (_super) { + __extends(SuiCalendarMonthView, _super); + function SuiCalendarMonthView(renderer) { + return _super.call(this, renderer, CalendarViewType.Month, new CalendarRangeMonthService(DatePrecision.Year, 4, 3)) || this; + } + Object.defineProperty(SuiCalendarMonthView.prototype, "year", { + get: function () { + return new DateParser(this.service.localeValues.formats.year, this.service.localeValues).format(this.currentDate); + }, + enumerable: true, + configurable: true + }); + SuiCalendarMonthView.decorators = [ + { type: Component, args: [{ + selector: "sui-calendar-month-view", + template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
{{ item.humanReadable }}\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiCalendarMonthView.ctorParameters = function () { return [ + { type: Renderer2, }, + ]; }; + return SuiCalendarMonthView; +}(CalendarView)); +export { SuiCalendarMonthView }; +//# sourceMappingURL=month-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/month-view.js.map b/dist/modules/datepicker/views/month-view.js.map new file mode 100644 index 000000000..592ca7099 --- /dev/null +++ b/dist/modules/datepicker/views/month-view.js.map @@ -0,0 +1 @@ +{"version":3,"file":"month-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/month-view.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,IAAA;IAA+C,6CAAoB;;;;IACxD,iDAAa,GAApB,UAAqB,IAAiB,EAAE,QAAa;QACjD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;KAC/B;oCAXL;EAO+C,oBAAoB,EAKlE,CAAA;AALD,qCAKC;;IA2ByC,wCAAY;IAKlD,8BAAY,QAAkB;eAC1B,kBAAM,QAAQ,EAAE,gBAAgB,CAAC,KAAK,EAAE,IAAI,yBAAyB,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACnG;IAND,sBAAW,sCAAI;aAAf;YACI,MAAM,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACrH;;;OAAA;;gBA5BJ,SAAS,SAAC;oBACP,QAAQ,EAAE,yBAAyB;oBACnC,QAAQ,EAAE,+lBAqBb;iBACA;;;;gBAtCmB,SAAS;;+BAA7B;EAuC0C,YAAY;SAAzC,oBAAoB","sourcesContent":["import { Component, Renderer2 } from \"@angular/core\";\nimport { DatePrecision } from \"../../../misc/util/index\";\nimport { CalendarView, CalendarViewType } from \"./calendar-view\";\nimport { CalendarItem } from \"../directives/calendar-item\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\nimport { DateParser } from \"../classes/date-parser\";\n\nexport class CalendarRangeMonthService extends CalendarRangeService {\n public configureItem(item:CalendarItem, baseDate:Date):void {\n item.humanReadable = this.service.localeValues.monthsShort[item.date.getMonth()];\n item.isOutsideRange = false;\n }\n}\n\n@Component({\n selector: \"sui-calendar-month-view\",\n template: `\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
{{ item.humanReadable }}\n
\n`\n})\nexport class SuiCalendarMonthView extends CalendarView {\n public get year():string {\n return new DateParser(this.service.localeValues.formats.year, this.service.localeValues).format(this.currentDate);\n }\n\n constructor(renderer:Renderer2) {\n super(renderer, CalendarViewType.Month, new CalendarRangeMonthService(DatePrecision.Year, 4, 3));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/month-view.metadata.json b/dist/modules/datepicker/views/month-view.metadata.json new file mode 100644 index 000000000..28e950593 --- /dev/null +++ b/dist/modules/datepicker/views/month-view.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"CalendarRangeMonthService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":7,"character":47},"members":{"configureItem":[{"__symbolic":"method"}]}},"SuiCalendarMonthView":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./calendar-view","name":"CalendarView","line":39,"character":42},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"selector":"sui-calendar-month-view","template":"\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
{{ item.humanReadable }}\n
\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":44,"character":25}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/year-view.d.ts b/dist/modules/datepicker/views/year-view.d.ts new file mode 100644 index 000000000..c743c7e4f --- /dev/null +++ b/dist/modules/datepicker/views/year-view.d.ts @@ -0,0 +1,12 @@ +import { Renderer2 } from "@angular/core"; +import { CalendarView } from "./calendar-view"; +import { CalendarItem } from "../directives/calendar-item"; +import { CalendarRangeService } from "../services/calendar-range.service"; +export declare class CalendarRangeYearService extends CalendarRangeService { + configureItem(item: CalendarItem, baseDate: Date): void; +} +export declare class SuiCalendarYearView extends CalendarView { + readonly decadeStart: number; + constructor(renderer: Renderer2); + pad(year: number): string; +} diff --git a/dist/modules/datepicker/views/year-view.js b/dist/modules/datepicker/views/year-view.js new file mode 100644 index 000000000..6d15a5fff --- /dev/null +++ b/dist/modules/datepicker/views/year-view.js @@ -0,0 +1,57 @@ +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 __()); + }; +})(); +import { Component, Renderer2 } from "@angular/core"; +import { Util, DateUtil, DatePrecision } from "../../../misc/util/index"; +import { CalendarView, CalendarViewType } from "./calendar-view"; +import { CalendarRangeService } from "../services/calendar-range.service"; +var CalendarRangeYearService = /** @class */ (function (_super) { + __extends(CalendarRangeYearService, _super); + function CalendarRangeYearService() { + return _super !== null && _super.apply(this, arguments) || this; + } + CalendarRangeYearService.prototype.configureItem = function (item, baseDate) { + item.humanReadable = Util.String.padLeft(item.date.getFullYear().toString(), 4, "0"); + item.isOutsideRange = item.date.getFullYear() >= this.calcStart(baseDate).getFullYear() + 10; + }; + return CalendarRangeYearService; +}(CalendarRangeService)); +export { CalendarRangeYearService }; +var SuiCalendarYearView = /** @class */ (function (_super) { + __extends(SuiCalendarYearView, _super); + function SuiCalendarYearView(renderer) { + return _super.call(this, renderer, CalendarViewType.Year, new CalendarRangeYearService(DatePrecision.Decade, 4, 3)) || this; + } + Object.defineProperty(SuiCalendarYearView.prototype, "decadeStart", { + get: function () { + return DateUtil + .startOf(DatePrecision.Decade, DateUtil.clone(this.service.currentDate)) + .getFullYear(); + }, + enumerable: true, + configurable: true + }); + SuiCalendarYearView.prototype.pad = function (year) { + return Util.String.padLeft(year.toString(), 4, "0"); + }; + SuiCalendarYearView.decorators = [ + { type: Component, args: [{ + selector: "sui-calendar-year-view", + template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
{{ item.humanReadable }}\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiCalendarYearView.ctorParameters = function () { return [ + { type: Renderer2, }, + ]; }; + return SuiCalendarYearView; +}(CalendarView)); +export { SuiCalendarYearView }; +//# sourceMappingURL=year-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/year-view.js.map b/dist/modules/datepicker/views/year-view.js.map new file mode 100644 index 000000000..1ca8f5a9a --- /dev/null +++ b/dist/modules/datepicker/views/year-view.js.map @@ -0,0 +1 @@ +{"version":3,"file":"year-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/year-view.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,IAAA;IAA8C,4CAAoB;;;;IACvD,gDAAa,GAApB,UAAqB,IAAiB,EAAE,QAAa;QACjD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACrF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC;KAChG;mCAVL;EAM8C,oBAAoB,EAKjE,CAAA;AALD,oCAKC;;IA2BwC,uCAAY;IAOjD,6BAAY,QAAkB;eAC1B,kBAAM,QAAQ,EAAE,gBAAgB,CAAC,IAAI,EAAE,IAAI,wBAAwB,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACnG;IARD,sBAAW,4CAAW;aAAtB;YACI,MAAM,CAAC,QAAQ;iBACV,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;iBACvE,WAAW,EAAE,CAAC;SACtB;;;OAAA;IAMM,iCAAG,GAAV,UAAW,IAAW;QAClB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;KACvD;;gBAtCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,wBAAwB;oBAClC,QAAQ,EAAE,woBAqBb;iBACA;;;;gBArCmB,SAAS;;8BAA7B;EAsCyC,YAAY;SAAxC,mBAAmB","sourcesContent":["import { Component, Renderer2 } from \"@angular/core\";\nimport { Util, DateUtil, DatePrecision } from \"../../../misc/util/index\";\nimport { CalendarView, CalendarViewType } from \"./calendar-view\";\nimport { CalendarItem } from \"../directives/calendar-item\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\n\nexport class CalendarRangeYearService extends CalendarRangeService {\n public configureItem(item:CalendarItem, baseDate:Date):void {\n item.humanReadable = Util.String.padLeft(item.date.getFullYear().toString(), 4, \"0\");\n item.isOutsideRange = item.date.getFullYear() >= this.calcStart(baseDate).getFullYear() + 10;\n }\n}\n\n@Component({\n selector: \"sui-calendar-year-view\",\n template: `\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
{{ item.humanReadable }}\n
\n`\n})\nexport class SuiCalendarYearView extends CalendarView {\n public get decadeStart():number {\n return DateUtil\n .startOf(DatePrecision.Decade, DateUtil.clone(this.service.currentDate))\n .getFullYear();\n }\n\n constructor(renderer:Renderer2) {\n super(renderer, CalendarViewType.Year, new CalendarRangeYearService(DatePrecision.Decade, 4, 3));\n }\n\n public pad(year:number):string {\n return Util.String.padLeft(year.toString(), 4, \"0\");\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/year-view.metadata.json b/dist/modules/datepicker/views/year-view.metadata.json new file mode 100644 index 000000000..1c5334af8 --- /dev/null +++ b/dist/modules/datepicker/views/year-view.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"CalendarRangeYearService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":6,"character":46},"members":{"configureItem":[{"__symbolic":"method"}]}},"SuiCalendarYearView":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./calendar-view","name":"CalendarView","line":38,"character":41},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":13,"character":1},"arguments":[{"selector":"sui-calendar-year-view","template":"\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
{{ item.humanReadable }}\n
\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":45,"character":25}]}],"pad":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/dimmer/components/dimmer.d.ts b/dist/modules/dimmer/components/dimmer.d.ts new file mode 100644 index 000000000..dd645f35c --- /dev/null +++ b/dist/modules/dimmer/components/dimmer.d.ts @@ -0,0 +1,15 @@ +import { EventEmitter, Renderer2, ElementRef, ChangeDetectorRef } from "@angular/core"; +import { SuiTransition } from "../../transition/index"; +export declare class SuiDimmer extends SuiTransition { + private _dimmerClasses; + private _transitionController; + private _isDimmed; + isDimmed: boolean; + isDimmedChange: EventEmitter; + isClickable: boolean; + transition: string; + transitionDuration: number; + wrapContent: boolean; + constructor(renderer: Renderer2, element: ElementRef, changeDetector: ChangeDetectorRef); + private onClick(); +} diff --git a/dist/modules/dimmer/components/dimmer.js b/dist/modules/dimmer/components/dimmer.js new file mode 100644 index 000000000..f5e4b1344 --- /dev/null +++ b/dist/modules/dimmer/components/dimmer.js @@ -0,0 +1,77 @@ +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 __()); + }; +})(); +import { Component, Input, Output, HostBinding, HostListener, EventEmitter, Renderer2, ElementRef, ChangeDetectorRef } from "@angular/core"; +import { TransitionController, SuiTransition, TransitionDirection, Transition } from "../../transition/index"; +var SuiDimmer = /** @class */ (function (_super) { + __extends(SuiDimmer, _super); + function SuiDimmer(renderer, element, changeDetector) { + var _this = _super.call(this, renderer, element, changeDetector) || this; + _this._isDimmed = false; + _this.isDimmedChange = new EventEmitter(); + _this.isClickable = true; + _this.wrapContent = true; + _this._dimmerClasses = true; + return _this; + } + Object.defineProperty(SuiDimmer.prototype, "isDimmed", { + get: function () { + return this._isDimmed; + }, + set: function (value) { + var isDimmed = !!value; + if (!this._transitionController) { + // Initialise transition functionality when first setting dimmed, to ensure initial state doesn't transition. + this._transitionController = new TransitionController(isDimmed, "block"); + this.setTransitionController(this._transitionController); + this._isDimmed = isDimmed; + } + else if (this._isDimmed !== isDimmed) { + this._isDimmed = isDimmed; + this._transitionController.stopAll(); + this._transitionController.animate(new Transition("fade", this.transitionDuration, isDimmed ? TransitionDirection.In : TransitionDirection.Out)); + } + }, + enumerable: true, + configurable: true + }); + SuiDimmer.prototype.onClick = function () { + if (this.isClickable) { + this.isDimmed = false; + this.isDimmedChange.emit(this.isDimmed); + } + }; + SuiDimmer.decorators = [ + { type: Component, args: [{ + selector: "sui-dimmer", + template: "\n
\n
\n \n
\n
\n", + styles: ["\n:host.dimmer {\n transition: none;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiDimmer.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + { type: ChangeDetectorRef, }, + ]; }; + SuiDimmer.propDecorators = { + "_dimmerClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.dimmer",] },], + "isDimmed": [{ type: HostBinding, args: ["class.active",] }, { type: Input },], + "isDimmedChange": [{ type: Output },], + "isClickable": [{ type: Input },], + "transition": [{ type: Input },], + "transitionDuration": [{ type: Input },], + "wrapContent": [{ type: Input },], + "onClick": [{ type: HostListener, args: ["click",] },], + }; + return SuiDimmer; +}(SuiTransition)); +export { SuiDimmer }; +//# sourceMappingURL=dimmer.js.map \ No newline at end of file diff --git a/dist/modules/dimmer/components/dimmer.js.map b/dist/modules/dimmer/components/dimmer.js.map new file mode 100644 index 000000000..66b2ba3bb --- /dev/null +++ b/dist/modules/dimmer/components/dimmer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dimmer.js","sourceRoot":"","sources":["../../../../src/modules/dimmer/components/dimmer.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAC5E,UAAU,EAAE,iBAAiB,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;IAiB/E,6BAAa;IAmDxC,mBAAY,QAAkB,EAAE,OAAkB,EAAE,cAAgC;QAApF,YACI,kBAAM,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,SAS3C;QAPG,KAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,KAAI,CAAC,cAAc,GAA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,EAAE,4IAMb;oBACG,MAAM,EAAE,CAAC,8CAIZ,CAAC;iBACD;;;;gBAnBsE,SAAS;gBAC5E,UAAU;gBAAE,iBAAiB;;;mCAoB5B,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,cAAc;6BAO1B,WAAW,SAAC,cAAc,cAC1B,KAAK;mCAyBL,MAAM;gCAGN,KAAK;+BAGL,KAAK;uCAGL,KAAK;gCAIL,KAAK;4BAeL,YAAY,SAAC,OAAO;;oBApFzB;EAqB+B,aAAa;SAA/B,SAAS","sourcesContent":["import {\n Component, Input, Output, HostBinding, HostListener, EventEmitter, Renderer2,\n ElementRef, ChangeDetectorRef\n} from \"@angular/core\";\nimport { TransitionController, SuiTransition, TransitionDirection, Transition } from \"../../transition/index\";\n\n@Component({\n selector: \"sui-dimmer\",\n template: `\n
\n
\n \n
\n
\n`,\n styles: [`\n:host.dimmer {\n transition: none;\n}\n`]\n})\nexport class SuiDimmer extends SuiTransition {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.dimmer\")\n private _dimmerClasses:boolean;\n\n private _transitionController:TransitionController;\n\n private _isDimmed:boolean;\n\n @HostBinding(\"class.active\")\n @Input()\n public get isDimmed():boolean {\n return this._isDimmed;\n }\n\n public set isDimmed(value:boolean) {\n const isDimmed = !!value;\n\n if (!this._transitionController) {\n // Initialise transition functionality when first setting dimmed, to ensure initial state doesn't transition.\n this._transitionController = new TransitionController(isDimmed, \"block\");\n\n this.setTransitionController(this._transitionController);\n\n this._isDimmed = isDimmed;\n } else if (this._isDimmed !== isDimmed) {\n\n this._isDimmed = isDimmed;\n\n this._transitionController.stopAll();\n this._transitionController.animate(\n new Transition(\"fade\", this.transitionDuration, isDimmed ? TransitionDirection.In : TransitionDirection.Out));\n }\n }\n\n @Output()\n public isDimmedChange:EventEmitter;\n\n @Input()\n public isClickable:boolean;\n\n @Input()\n public transition:string;\n\n @Input()\n public transitionDuration:number;\n\n /* Internal for now */\n @Input()\n public wrapContent:boolean;\n\n constructor(renderer:Renderer2, element:ElementRef, changeDetector:ChangeDetectorRef) {\n super(renderer, element, changeDetector);\n\n this._isDimmed = false;\n this.isDimmedChange = new EventEmitter();\n this.isClickable = true;\n\n this.wrapContent = true;\n\n this._dimmerClasses = true;\n }\n\n @HostListener(\"click\")\n private onClick():void {\n if (this.isClickable) {\n this.isDimmed = false;\n this.isDimmedChange.emit(this.isDimmed);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/dimmer/components/dimmer.metadata.json b/dist/modules/dimmer/components/dimmer.metadata.json new file mode 100644 index 000000000..5221ad019 --- /dev/null +++ b/dist/modules/dimmer/components/dimmer.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiDimmer":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../transition/index","name":"SuiTransition","line":21,"character":31},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"sui-dimmer","template":"\n
\n
\n \n
\n
\n","styles":["\n:host.dimmer {\n transition: none;\n}\n"]}]}],"members":{"_dimmerClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":22,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":23,"character":5},"arguments":["class.dimmer"]}]}],"isDimmed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":30,"character":5},"arguments":["class.active"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":5}}]}],"isDimmedChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":56,"character":5}}]}],"isClickable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":5}}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":62,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":65,"character":5}}]}],"wrapContent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":69,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":72,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":72,"character":44},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":72,"character":71}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":84,"character":5},"arguments":["click"]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/dimmer/dimmer.module.d.ts b/dist/modules/dimmer/dimmer.module.d.ts new file mode 100644 index 000000000..492275b11 --- /dev/null +++ b/dist/modules/dimmer/dimmer.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiDimmerModule { +} diff --git a/dist/modules/dimmer/dimmer.module.js b/dist/modules/dimmer/dimmer.module.js new file mode 100644 index 000000000..01384d2ac --- /dev/null +++ b/dist/modules/dimmer/dimmer.module.js @@ -0,0 +1,27 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiTransitionModule } from "../transition/index"; +import { SuiDimmer } from "./components/dimmer"; +var SuiDimmerModule = /** @class */ (function () { + function SuiDimmerModule() { + } + SuiDimmerModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule, + SuiTransitionModule + ], + declarations: [ + SuiDimmer + ], + exports: [ + SuiDimmer + ] + },] }, + ]; + /** @nocollapse */ + SuiDimmerModule.ctorParameters = function () { return []; }; + return SuiDimmerModule; +}()); +export { SuiDimmerModule }; +//# sourceMappingURL=dimmer.module.js.map \ No newline at end of file diff --git a/dist/modules/dimmer/dimmer.module.js.map b/dist/modules/dimmer/dimmer.module.js.map new file mode 100644 index 000000000..345a06bfd --- /dev/null +++ b/dist/modules/dimmer/dimmer.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dimmer.module.js","sourceRoot":"","sources":["../../../src/modules/dimmer/dimmer.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;;;;;gBAE/C,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,mBAAmB;qBACtB;oBACD,YAAY,EAAE;wBACV,SAAS;qBACZ;oBACD,OAAO,EAAE;wBACL,SAAS;qBACZ;iBACJ;;;;0BAhBD;;SAiBa,eAAe","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTransitionModule } from \"../transition/index\";\nimport { SuiDimmer } from \"./components/dimmer\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiTransitionModule\n ],\n declarations: [\n SuiDimmer\n ],\n exports: [\n SuiDimmer\n ]\n})\nexport class SuiDimmerModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/dimmer/dimmer.module.metadata.json b/dist/modules/dimmer/dimmer.module.metadata.json new file mode 100644 index 000000000..41df51f23 --- /dev/null +++ b/dist/modules/dimmer/dimmer.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiDimmerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":7,"character":8},{"__symbolic":"reference","module":"../transition/index","name":"SuiTransitionModule","line":8,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/dimmer","name":"SuiDimmer","line":11,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/dimmer","name":"SuiDimmer","line":14,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/dimmer/index.d.ts b/dist/modules/dimmer/index.d.ts new file mode 100644 index 000000000..b445fad21 --- /dev/null +++ b/dist/modules/dimmer/index.d.ts @@ -0,0 +1,2 @@ +export * from "./components/dimmer"; +export * from "./dimmer.module"; diff --git a/dist/modules/dimmer/index.js b/dist/modules/dimmer/index.js new file mode 100644 index 000000000..5082bf6f0 --- /dev/null +++ b/dist/modules/dimmer/index.js @@ -0,0 +1,3 @@ +export * from "./components/dimmer"; +export * from "./dimmer.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/dimmer/index.js.map b/dist/modules/dimmer/index.js.map new file mode 100644 index 000000000..122796c1c --- /dev/null +++ b/dist/modules/dimmer/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/dimmer/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AAEpC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./components/dimmer\";\n\nexport * from \"./dimmer.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/dimmer/index.metadata.json b/dist/modules/dimmer/index.metadata.json new file mode 100644 index 000000000..556c4a5ec --- /dev/null +++ b/dist/modules/dimmer/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/dimmer"},{"from":"./dimmer.module"}]}] \ No newline at end of file diff --git a/dist/modules/dimmer/public.d.ts b/dist/modules/dimmer/public.d.ts new file mode 100644 index 000000000..7893f514a --- /dev/null +++ b/dist/modules/dimmer/public.d.ts @@ -0,0 +1 @@ +export { SuiDimmerModule } from "./index"; diff --git a/dist/modules/dimmer/public.js b/dist/modules/dimmer/public.js new file mode 100644 index 000000000..1a4a66510 --- /dev/null +++ b/dist/modules/dimmer/public.js @@ -0,0 +1,2 @@ +export { SuiDimmerModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/dimmer/public.js.map b/dist/modules/dimmer/public.js.map new file mode 100644 index 000000000..373025ee7 --- /dev/null +++ b/dist/modules/dimmer/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/dimmer/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EAClB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiDimmerModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/dimmer/public.metadata.json b/dist/modules/dimmer/public.metadata.json new file mode 100644 index 000000000..738af32a6 --- /dev/null +++ b/dist/modules/dimmer/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiDimmerModule"]}]}] \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown-menu.d.ts b/dist/modules/dropdown/directives/dropdown-menu.d.ts new file mode 100644 index 000000000..7f0281632 --- /dev/null +++ b/dist/modules/dropdown/directives/dropdown-menu.d.ts @@ -0,0 +1,43 @@ +import { Renderer2, ElementRef, AfterContentInit, QueryList, ChangeDetectorRef, OnDestroy } from "@angular/core"; +import { SuiTransition } from "../../transition/index"; +import { HandledEvent, KeyCode } from "../../../misc/util/index"; +import { DropdownService } from "../services/dropdown.service"; +import "element-closest"; +export declare class SuiDropdownMenuItem { + private _renderer; + element: ElementRef; + readonly isDisabled: boolean; + private _isSelected; + isSelected: boolean; + selectedClass: string; + childDropdownMenu: SuiDropdownMenu; + readonly hasChildDropdown: boolean; + constructor(_renderer: Renderer2, element: ElementRef); + performClick(): void; +} +export declare class SuiDropdownMenu extends SuiTransition implements AfterContentInit, OnDestroy { + element: ElementRef; + private _service; + private _transitionController; + menuTransition: string; + menuTransitionDuration: number; + service: DropdownService; + private _itemsQueryInternal; + private _itemsQueryOverride; + items: QueryList; + private readonly _itemsQuery; + private readonly _items; + selectedItems: SuiDropdownMenuItem[]; + menuAutoSelectFirst: boolean; + menuSelectedItemClass: string; + private _documentKeyDownListener; + constructor(renderer: Renderer2, element: ElementRef, changeDetector: ChangeDetectorRef); + onClick(e: HandledEvent & MouseEvent): void; + onDocumentKeyDown(e: KeyboardEvent): void; + resetSelection(): void; + updateSelection(selectedItem: SuiDropdownMenuItem, keyCode: KeyCode): SuiDropdownMenuItem; + scrollToItem(item: SuiDropdownMenuItem): void; + ngAfterContentInit(): void; + private onItemsChanged(); + ngOnDestroy(): void; +} diff --git a/dist/modules/dropdown/directives/dropdown-menu.js b/dist/modules/dropdown/directives/dropdown-menu.js new file mode 100644 index 000000000..ee8824151 --- /dev/null +++ b/dist/modules/dropdown/directives/dropdown-menu.js @@ -0,0 +1,315 @@ +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 __()); + }; +})(); +import { Directive, ContentChild, forwardRef, Renderer2, ElementRef, ContentChildren, QueryList, Input, HostListener, ChangeDetectorRef } from "@angular/core"; +import { Transition, SuiTransition, TransitionController, TransitionDirection } from "../../transition/index"; +import { KeyCode } from "../../../misc/util/index"; +import { DropdownAutoCloseType } from "../services/dropdown.service"; +import "element-closest"; +var SuiDropdownMenuItem = /** @class */ (function () { + function SuiDropdownMenuItem(_renderer, element) { + this._renderer = _renderer; + this.element = element; + this.isSelected = false; + this.selectedClass = "selected"; + } + Object.defineProperty(SuiDropdownMenuItem.prototype, "isDisabled", { + get: function () { + // We must use nativeElement as Angular doesn't have a way of reading class information. + var element = this.element.nativeElement; + return element.classList.contains("disabled"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdownMenuItem.prototype, "isSelected", { + get: function () { + return this._isSelected; + }, + set: function (value) { + // Renderer is used to enable a dynamic class name. + if (value) { + this._renderer.addClass(this.element.nativeElement, this.selectedClass); + } + else { + this._renderer.removeClass(this.element.nativeElement, this.selectedClass); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdownMenuItem.prototype, "hasChildDropdown", { + get: function () { + return !!this.childDropdownMenu; + }, + enumerable: true, + configurable: true + }); + SuiDropdownMenuItem.prototype.performClick = function () { + // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. + this.element.nativeElement.click(); + }; + SuiDropdownMenuItem.decorators = [ + { type: Directive, args: [{ + // We must attach to every '.item' as Angular doesn't support > selectors. + selector: ".item" + },] }, + ]; + /** @nocollapse */ + SuiDropdownMenuItem.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + ]; }; + SuiDropdownMenuItem.propDecorators = { + "childDropdownMenu": [{ type: ContentChild, args: [forwardRef(function () { return SuiDropdownMenu; }),] },], + }; + return SuiDropdownMenuItem; +}()); +export { SuiDropdownMenuItem }; +var SuiDropdownMenu = /** @class */ (function (_super) { + __extends(SuiDropdownMenu, _super); + function SuiDropdownMenu(renderer, element, changeDetector) { + var _this = _super.call(this, renderer, element, changeDetector) || this; + _this.element = element; + // Initialise transition functionality. + // Initialise transition functionality. + _this._transitionController = new TransitionController(false); + _this.setTransitionController(_this._transitionController); + _this.menuTransition = "slide down"; + _this.menuTransitionDuration = 200; + _this.menuAutoSelectFirst = false; + _this.menuSelectedItemClass = "selected"; + _this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); + return _this; + } + Object.defineProperty(SuiDropdownMenu.prototype, "service", { + get: function () { + return this._service; + }, + set: function (value) { + var _this = this; + this._service = value; + var previousIsOpen = this._service.isOpen; + this._service.isOpenChange.subscribe(function (isOpen) { + if (isOpen !== previousIsOpen) { + // Only run transitions if the open state has changed. + // Only run transitions if the open state has changed. + _this._transitionController.stopAll(); + _this._transitionController.animate(new Transition(_this.menuTransition, _this.menuTransitionDuration, TransitionDirection.Either, function () { return _this._service.isAnimating = false; })); + } + if (!isOpen) { + // Reset the item selections when a nested item is selected to avoid incosistent open states. + if (_this.selectedItems.length > 1) { + _this.resetSelection(); + } + } + previousIsOpen = isOpen; + }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdownMenu.prototype, "items", { + set: function (items) { + this._itemsQueryOverride = items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdownMenu.prototype, "_itemsQuery", { + get: function () { + return this._itemsQueryOverride || this._itemsQueryInternal; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdownMenu.prototype, "_items", { + // Get the list of items, ignoring those that are disabled. + get: + // Get the list of items, ignoring those that are disabled. + function () { + return this._itemsQuery.filter(function (i) { return !i.isDisabled; }); + }, + enumerable: true, + configurable: true + }); + SuiDropdownMenu.prototype.onClick = function (e) { + if (!e.eventHandled) { + e.eventHandled = true; + if (this._service.autoCloseMode === DropdownAutoCloseType.ItemClick) { + var target = e.target; + if (this.element.nativeElement.contains(target.closest(".item")) && !/input|textarea/i.test(target.tagName)) { + // Once an item is selected, we can close the entire dropdown. + this._service.setOpenState(false, true); + } + } + } + }; + SuiDropdownMenu.prototype.onDocumentKeyDown = function (e) { + // Only the root dropdown (i.e. not nested dropdowns) is responsible for keeping track of the currently selected item. + if (this._service.isOpen && !this._service.isNested) { + // Stop document events like scrolling while open. + var target = e.target; + if (!/input/i.test(target.tagName) && + [KeyCode.Escape, KeyCode.Enter, KeyCode.Up, KeyCode.Down, KeyCode.Left, KeyCode.Right].find(function (kC) { return kC === e.keyCode; })) { + e.preventDefault(); + } + // Gets the top selected item from the stack. + var selected = this.selectedItems.slice(-1)[0]; + // Keeping track of the menu containing the currently selected element allows us to easily determine its siblings. + var selectedContainer = this; + if (this.selectedItems.length >= 2) { + var selectedParent = this.selectedItems.slice(-2)[0]; + selectedContainer = selectedParent.childDropdownMenu; + } + switch (e.keyCode) { + // Escape : close the entire dropdown. + case KeyCode.Escape: { + this._service.setOpenState(false); + break; + } + // Down : select the next item below the current one, or the 1st if none selected. + case KeyCode.Down: + // Up : select the next item above the current one, or the 1st if none selected. + case KeyCode.Up: { + this.selectedItems.pop(); + this.selectedItems.push(selectedContainer.updateSelection(selected, e.keyCode)); + // Prevent default regardless of whether we are in an input, to stop jumping to the start or end of the query string. + e.preventDefault(); + break; + } + // Enter : if the item doesn't contain a nested dropdown, 'click' it. Otherwise, fall through to 'Right' action. + case KeyCode.Enter: { + if (selected && !selected.hasChildDropdown) { + selected.performClick(); + break; + } + } + // falls through + // Right : if the selected item contains a nested dropdown, open the dropdown & select the 1st item. + case KeyCode.Right: { + if (selected && selected.hasChildDropdown) { + selected.childDropdownMenu.service.setOpenState(true); + this.selectedItems.push(selected.childDropdownMenu.updateSelection(selected, e.keyCode)); + } + break; + } + // Left : if the selected item is in a nested dropdown, close it and select the containing item. + case KeyCode.Left: { + if (this.selectedItems.length >= 2) { + this.selectedItems.pop(); + var selectedParent = this.selectedItems.slice(-1)[0]; + selectedParent.childDropdownMenu.service.setOpenState(false); + selectedParent.isSelected = true; + } + break; + } + } + } + }; + SuiDropdownMenu.prototype.resetSelection = function () { + var _this = this; + this.selectedItems = []; + this._items.forEach(function (i) { + i.selectedClass = _this.menuSelectedItemClass; + i.isSelected = false; + }); + if (this.menuAutoSelectFirst && this._items.length > 0) { + // Autoselect 1st item if required & possible. + this._items[0].isSelected = true; + this.scrollToItem(this._items[0]); + this.selectedItems.push(this._itemsQuery.first); + } + }; + // Determines the item to next be selected, based on the keyboard input & the currently selected item. + // Determines the item to next be selected, based on the keyboard input & the currently selected item. + SuiDropdownMenu.prototype.updateSelection = + // Determines the item to next be selected, based on the keyboard input & the currently selected item. + function (selectedItem, keyCode) { + if (selectedItem) { + // Remove the selected status on the previously selected item. + selectedItem.isSelected = false; + } + var selectedIndex = this._items + .findIndex(function (i) { return i === selectedItem; }); + var newSelection; + switch (keyCode) { + case KeyCode.Enter: + case KeyCode.Right: + case KeyCode.Down: + selectedIndex += 1; + break; + case KeyCode.Up: + if (selectedIndex === -1) { + // If none are selected, select the 1st item. Should this be `this.items.last - 1`? + selectedIndex = 0; + break; + } + selectedIndex -= 1; + break; + } + // Select the item at the updated index. The || is to stop us selecting past the start or end of the item list. + newSelection = this._items[selectedIndex] || selectedItem; + if (newSelection) { + // Set the selected status on the newly selected item. + newSelection.isSelected = true; + // Set the current scroll position to the location of the newly selected item. + this.scrollToItem(newSelection); + } + return newSelection; + }; + SuiDropdownMenu.prototype.scrollToItem = function (item) { + var menu = this.element.nativeElement; + var selectedRect = item.element.nativeElement.getBoundingClientRect(); + var menuRect = menu.getBoundingClientRect(); + var scrollAmount = 0; + if (selectedRect.bottom > menuRect.bottom) { + scrollAmount = selectedRect.bottom - menuRect.bottom; + } + if (selectedRect.top < menuRect.top) { + scrollAmount = selectedRect.top - menuRect.top; + } + menu.scrollTop += Math.round(scrollAmount); + }; + SuiDropdownMenu.prototype.ngAfterContentInit = function () { + var _this = this; + this.onItemsChanged(); + this._itemsQuery.changes.subscribe(function () { return _this.onItemsChanged(); }); + }; + SuiDropdownMenu.prototype.onItemsChanged = function () { + // We use `_items` rather than `items` in case one or more have become disabled. + this.resetSelection(); + }; + SuiDropdownMenu.prototype.ngOnDestroy = function () { + this._documentKeyDownListener(); + }; + SuiDropdownMenu.decorators = [ + { type: Directive, args: [{ + selector: "[suiDropdownMenu]" + },] }, + ]; + /** @nocollapse */ + SuiDropdownMenu.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + { type: ChangeDetectorRef, }, + ]; }; + SuiDropdownMenu.propDecorators = { + "menuTransition": [{ type: Input },], + "menuTransitionDuration": [{ type: Input },], + "_itemsQueryInternal": [{ type: ContentChildren, args: [SuiDropdownMenuItem,] },], + "menuAutoSelectFirst": [{ type: Input },], + "menuSelectedItemClass": [{ type: Input },], + "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], + }; + return SuiDropdownMenu; +}(SuiTransition)); +export { SuiDropdownMenu }; +//# sourceMappingURL=dropdown-menu.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown-menu.js.map b/dist/modules/dropdown/directives/dropdown-menu.js.map new file mode 100644 index 000000000..31b7f868f --- /dev/null +++ b/dist/modules/dropdown/directives/dropdown-menu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../../src/modules/dropdown/directives/dropdown-menu.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAC1D,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,iBAAiB,EACrE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC9G,OAAO,EAAmC,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAmB,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAEtF,OAAO,iBAAiB,CAAC;;IAsCrB,6BAAoB,SAAmB,EAAS,OAAkB;QAA9C,cAAS,GAAT,SAAS,CAAU;QAAS,YAAO,GAAP,OAAO,CAAW;QAC9D,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC;KACnC;IAnCD,sBAAW,2CAAU;aAArB;;YAEI,IAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,aAAwB,CAAC;YACtD,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;SACjD;;;OAAA;IAID,sBAAW,2CAAU;aAArB;YACI,MAAM,CAAC,IAA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AI,CAAC,qBAAqB,EAAE,CAAC;QAE9C,IAAI,YAAY,GAAG,CAAC,CAAC;QAErB,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;YACxC,YAAY,GAAG,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;SACxD;QAED,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAClC,YAAY,GAAG,YAAY,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;SAClD;QAED,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;KAC9C;IAEM,4CAAkB,GAAzB;QAAA,iBAGC;QAFG,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,cAAc,EAAE,EAArB,CAAqB,CAAC,CAAC;KACnE;IAEO,wCAAc,GAAtB;;QAEI,IAAI,CAAC,cAAc,EAAE,CAAC;KACzB;IAEM,qCAAW,GAAlB;QACI,IAAI,CAAC,wBAAwB,EAAE,CAAC;KACnC;;gBAtQJ,SAAS,SAAC;oBACP,QAAQ,EAAE,mBAAmB;iBAChC;;;;gBA3DwC,SAAS;gBAAE,UAAU;gBACT,iBAAiB;;;mCA+DjE,KAAK;2CAGL,KAAK;wCAkCL,eAAe,SAAC,mBAAmB;wCAuBnC,KAAK;0CAGL,KAAK;4BAqBL,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;0BArJrC;EA6DqC,aAAa;SAArC,eAAe","sourcesContent":["import {\n Directive, ContentChild, forwardRef, Renderer2, ElementRef, AfterContentInit,\n ContentChildren, QueryList, Input, HostListener, ChangeDetectorRef, OnDestroy\n} from \"@angular/core\";\nimport { Transition, SuiTransition, TransitionController, TransitionDirection } from \"../../transition/index\";\nimport { HandledEvent, IAugmentedElement, KeyCode } from \"../../../misc/util/index\";\nimport { DropdownService, DropdownAutoCloseType } from \"../services/dropdown.service\";\n// Polyfill for IE\nimport \"element-closest\";\n\n@Directive({\n // We must attach to every '.item' as Angular doesn't support > selectors.\n selector: \".item\"\n})\nexport class SuiDropdownMenuItem {\n public get isDisabled():boolean {\n // We must use nativeElement as Angular doesn't have a way of reading class information.\n const element = this.element.nativeElement as Element;\n return element.classList.contains(\"disabled\");\n }\n\n private _isSelected:boolean;\n\n public get isSelected():boolean {\n return this._isSelected;\n }\n\n public set isSelected(value:boolean) {\n // Renderer is used to enable a dynamic class name.\n if (value) {\n this._renderer.addClass(this.element.nativeElement, this.selectedClass);\n } else {\n this._renderer.removeClass(this.element.nativeElement, this.selectedClass);\n }\n }\n\n // Stores the class name used for a 'selected' item.\n public selectedClass:string;\n\n @ContentChild(forwardRef(() => SuiDropdownMenu))\n public childDropdownMenu:SuiDropdownMenu;\n\n public get hasChildDropdown():boolean {\n return !!this.childDropdownMenu;\n }\n\n constructor(private _renderer:Renderer2, public element:ElementRef) {\n this.isSelected = false;\n\n this.selectedClass = \"selected\";\n }\n\n public performClick():void {\n // Using directly because Renderer2 doesn't have invokeElementMethod method anymore.\n this.element.nativeElement.click();\n }\n}\n\n@Directive({\n selector: \"[suiDropdownMenu]\"\n})\nexport class SuiDropdownMenu extends SuiTransition implements AfterContentInit, OnDestroy {\n private _service:DropdownService;\n private _transitionController:TransitionController;\n\n @Input()\n public menuTransition:string;\n\n @Input()\n public menuTransitionDuration:number;\n\n public get service():DropdownService {\n return this._service;\n }\n\n public set service(value:DropdownService) {\n this._service = value;\n\n let previousIsOpen = this._service.isOpen;\n this._service.isOpenChange.subscribe((isOpen:boolean) => {\n if (isOpen !== previousIsOpen) {\n // Only run transitions if the open state has changed.\n this._transitionController.stopAll();\n this._transitionController.animate(\n new Transition(\n this.menuTransition,\n this.menuTransitionDuration,\n TransitionDirection.Either,\n () => this._service.isAnimating = false));\n }\n\n if (!isOpen) {\n // Reset the item selections when a nested item is selected to avoid incosistent open states.\n if (this.selectedItems.length > 1) {\n this.resetSelection();\n }\n }\n\n previousIsOpen = isOpen;\n });\n }\n\n @ContentChildren(SuiDropdownMenuItem)\n private _itemsQueryInternal:QueryList;\n\n private _itemsQueryOverride:QueryList;\n\n public set items(items:QueryList) {\n this._itemsQueryOverride = items;\n }\n\n private get _itemsQuery():QueryList {\n return this._itemsQueryOverride || this._itemsQueryInternal;\n }\n\n // Get the list of items, ignoring those that are disabled.\n private get _items():SuiDropdownMenuItem[] {\n return this._itemsQuery.filter(i => !i.isDisabled);\n }\n\n // Stack that keeps track of the currently selected item.\n // Selected items lower in the stack are necessarily the parent of the item one higher.\n public selectedItems:SuiDropdownMenuItem[];\n\n // Sets whether or not to automatically select the 1st item when the dropdown is opened.\n @Input()\n public menuAutoSelectFirst:boolean;\n\n @Input()\n public menuSelectedItemClass:string;\n\n private _documentKeyDownListener:() => void;\n\n constructor(renderer:Renderer2, public element:ElementRef, changeDetector:ChangeDetectorRef) {\n super(renderer, element, changeDetector);\n\n // Initialise transition functionality.\n this._transitionController = new TransitionController(false);\n this.setTransitionController(this._transitionController);\n\n this.menuTransition = \"slide down\";\n this.menuTransitionDuration = 200;\n\n this.menuAutoSelectFirst = false;\n this.menuSelectedItemClass = \"selected\";\n\n this._documentKeyDownListener = renderer.listen(\"document\", \"keydown\", (e:KeyboardEvent) => this.onDocumentKeyDown(e));\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(e:HandledEvent & MouseEvent):void {\n if (!e.eventHandled) {\n e.eventHandled = true;\n\n if (this._service.autoCloseMode === DropdownAutoCloseType.ItemClick) {\n const target = e.target as IAugmentedElement;\n if (this.element.nativeElement.contains(target.closest(\".item\")) && !/input|textarea/i.test(target.tagName)) {\n // Once an item is selected, we can close the entire dropdown.\n this._service.setOpenState(false, true);\n }\n }\n }\n }\n\n public onDocumentKeyDown(e:KeyboardEvent):void {\n // Only the root dropdown (i.e. not nested dropdowns) is responsible for keeping track of the currently selected item.\n if (this._service.isOpen && !this._service.isNested) {\n // Stop document events like scrolling while open.\n const target = e.target as Element;\n if (!/input/i.test(target.tagName) &&\n [KeyCode.Escape, KeyCode.Enter, KeyCode.Up, KeyCode.Down, KeyCode.Left, KeyCode.Right].find(kC => kC === e.keyCode)) {\n e.preventDefault();\n }\n\n // Gets the top selected item from the stack.\n const [selected] = this.selectedItems.slice(-1);\n // Keeping track of the menu containing the currently selected element allows us to easily determine its siblings.\n let selectedContainer:SuiDropdownMenu = this;\n if (this.selectedItems.length >= 2) {\n const [selectedParent] = this.selectedItems.slice(-2);\n selectedContainer = selectedParent.childDropdownMenu;\n }\n\n switch (e.keyCode) {\n // Escape : close the entire dropdown.\n case KeyCode.Escape: {\n this._service.setOpenState(false);\n break;\n }\n // Down : select the next item below the current one, or the 1st if none selected.\n case KeyCode.Down:\n // Up : select the next item above the current one, or the 1st if none selected.\n case KeyCode.Up: {\n this.selectedItems.pop();\n this.selectedItems.push(selectedContainer.updateSelection(selected, e.keyCode));\n // Prevent default regardless of whether we are in an input, to stop jumping to the start or end of the query string.\n e.preventDefault();\n break;\n }\n // Enter : if the item doesn't contain a nested dropdown, 'click' it. Otherwise, fall through to 'Right' action.\n case KeyCode.Enter: {\n if (selected && !selected.hasChildDropdown) {\n selected.performClick();\n break;\n }\n }\n // falls through\n // Right : if the selected item contains a nested dropdown, open the dropdown & select the 1st item.\n case KeyCode.Right: {\n if (selected && selected.hasChildDropdown) {\n selected.childDropdownMenu.service.setOpenState(true);\n\n this.selectedItems.push(selected.childDropdownMenu.updateSelection(selected, e.keyCode));\n }\n break;\n }\n // Left : if the selected item is in a nested dropdown, close it and select the containing item.\n case KeyCode.Left: {\n if (this.selectedItems.length >= 2) {\n this.selectedItems.pop();\n const [selectedParent] = this.selectedItems.slice(-1);\n\n selectedParent.childDropdownMenu.service.setOpenState(false);\n selectedParent.isSelected = true;\n }\n break;\n }\n }\n }\n }\n\n public resetSelection():void {\n this.selectedItems = [];\n this._items.forEach(i => {\n i.selectedClass = this.menuSelectedItemClass;\n i.isSelected = false;\n });\n\n if (this.menuAutoSelectFirst && this._items.length > 0) {\n // Autoselect 1st item if required & possible.\n this._items[0].isSelected = true;\n this.scrollToItem(this._items[0]);\n this.selectedItems.push(this._itemsQuery.first);\n }\n }\n\n // Determines the item to next be selected, based on the keyboard input & the currently selected item.\n public updateSelection(selectedItem:SuiDropdownMenuItem, keyCode:KeyCode):SuiDropdownMenuItem {\n if (selectedItem) {\n // Remove the selected status on the previously selected item.\n selectedItem.isSelected = false;\n }\n\n let selectedIndex = this._items\n .findIndex(i => i === selectedItem);\n\n let newSelection:SuiDropdownMenuItem;\n\n switch (keyCode) {\n case KeyCode.Enter:\n case KeyCode.Right:\n case KeyCode.Down:\n selectedIndex += 1;\n break;\n case KeyCode.Up:\n if (selectedIndex === -1) {\n // If none are selected, select the 1st item. Should this be `this.items.last - 1`?\n selectedIndex = 0;\n break;\n }\n\n selectedIndex -= 1;\n break;\n }\n\n // Select the item at the updated index. The || is to stop us selecting past the start or end of the item list.\n newSelection = this._items[selectedIndex] || selectedItem;\n\n if (newSelection) {\n // Set the selected status on the newly selected item.\n newSelection.isSelected = true;\n\n // Set the current scroll position to the location of the newly selected item.\n this.scrollToItem(newSelection);\n }\n\n return newSelection;\n }\n\n public scrollToItem(item:SuiDropdownMenuItem):void {\n const menu:Element = this.element.nativeElement;\n const selectedRect:ClientRect = item.element.nativeElement.getBoundingClientRect();\n\n const menuRect = menu.getBoundingClientRect();\n\n let scrollAmount = 0;\n\n if (selectedRect.bottom > menuRect.bottom) {\n scrollAmount = selectedRect.bottom - menuRect.bottom;\n }\n\n if (selectedRect.top < menuRect.top) {\n scrollAmount = selectedRect.top - menuRect.top;\n }\n\n menu.scrollTop += Math.round(scrollAmount);\n }\n\n public ngAfterContentInit():void {\n this.onItemsChanged();\n this._itemsQuery.changes.subscribe(() => this.onItemsChanged());\n }\n\n private onItemsChanged():void {\n // We use `_items` rather than `items` in case one or more have become disabled.\n this.resetSelection();\n }\n\n public ngOnDestroy():void {\n this._documentKeyDownListener();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown-menu.metadata.json b/dist/modules/dropdown/directives/dropdown-menu.metadata.json new file mode 100644 index 000000000..641e72ae7 --- /dev/null +++ b/dist/modules/dropdown/directives/dropdown-menu.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiDropdownMenuItem":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":10,"character":1},"arguments":[{"selector":".item"}]}],"members":{"childDropdownMenu":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":39,"character":5},"arguments":[{"__symbolic":"reference","name":"SuiDropdownMenu"}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":46,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":46,"character":60}]}],"performClick":[{"__symbolic":"method"}]}},"SuiDropdownMenu":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../transition/index","name":"SuiTransition","line":61,"character":37},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":58,"character":1},"arguments":[{"selector":"[suiDropdownMenu]"}]}],"members":{"menuTransition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":65,"character":5}}]}],"menuTransitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":5}}]}],"_itemsQueryInternal":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":102,"character":5},"arguments":[{"__symbolic":"reference","name":"SuiDropdownMenuItem"}]}]}],"menuAutoSelectFirst":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":125,"character":5}}]}],"menuSelectedItemClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":128,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":46,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":46,"character":60},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":133,"character":78}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":149,"character":5},"arguments":["click",["$event"]]}]}],"onDocumentKeyDown":[{"__symbolic":"method"}],"resetSelection":[{"__symbolic":"method"}],"updateSelection":[{"__symbolic":"method"}],"scrollToItem":[{"__symbolic":"method"}],"ngAfterContentInit":[{"__symbolic":"method"}],"onItemsChanged":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown.d.ts b/dist/modules/dropdown/directives/dropdown.d.ts new file mode 100644 index 000000000..e192706e5 --- /dev/null +++ b/dist/modules/dropdown/directives/dropdown.d.ts @@ -0,0 +1,24 @@ +import { EventEmitter, AfterContentInit, ElementRef } from "@angular/core"; +import { HandledEvent } from "../../../misc/util/index"; +import { DropdownService, DropdownAutoCloseType } from "../services/dropdown.service"; +export declare class SuiDropdown implements AfterContentInit { + private _element; + service: DropdownService; + private _menu; + private _children; + readonly children: SuiDropdown[]; + readonly isOpenChange: EventEmitter; + readonly isActive: boolean; + isOpen: boolean; + isDisabled: boolean; + private _tabIndex?; + readonly tabIndex: number | undefined; + autoClose: DropdownAutoCloseType; + constructor(_element: ElementRef); + ngAfterContentInit(): void; + private childrenUpdated(); + onClick(e: HandledEvent): void; + private onFocusOut(e); + onKeypress(e: HandledEvent & KeyboardEvent): void; + private externallyClose(); +} diff --git a/dist/modules/dropdown/directives/dropdown.js b/dist/modules/dropdown/directives/dropdown.js new file mode 100644 index 000000000..059583d6a --- /dev/null +++ b/dist/modules/dropdown/directives/dropdown.js @@ -0,0 +1,157 @@ +import { Directive, Input, HostBinding, EventEmitter, Output, ContentChild, ElementRef, HostListener, QueryList, ContentChildren } from "@angular/core"; +import { HandledEvent, KeyCode } from "../../../misc/util/index"; +import { DropdownService, DropdownAutoCloseType } from "../services/dropdown.service"; +import { SuiDropdownMenu } from "./dropdown-menu"; +var SuiDropdown = /** @class */ (function () { + function SuiDropdown(_element) { + var _this = this; + this._element = _element; + this.service = new DropdownService(); + this.service.isOpenChange.subscribe(function () { + if (_this.service.isOpen) { + _this._element.nativeElement.focus(); + } + }); + } + Object.defineProperty(SuiDropdown.prototype, "children", { + get: function () { + var _this = this; + // @ContentChildren includes the current element by default. + return this._children.filter(function (c) { return c !== _this; }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "isOpenChange", { + get: function () { + return this.service.isOpenChange; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "isActive", { + get: function () { + // This is to ensure nested dropdowns don't get made bold. + return this.service.isOpen && !this.service.isNested; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "isOpen", { + get: function () { + return this.service.isOpen; + }, + set: function (value) { + // If we are opening the dropdown, we want to always open its parents. + this.service.setOpenState(value, !!value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "isDisabled", { + get: function () { + return this.service.isDisabled; + }, + set: function (value) { + this.service.setDisabledState(value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "tabIndex", { + get: function () { + if (this.isDisabled || this.service.isNested) { + // If disabled, remove from tabindex. + return undefined; + } + if (this._tabIndex != undefined) { + // If custom tabindex, default to that. + return this._tabIndex; + } + // Otherwise, return default of 0. + return 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiDropdown.prototype, "autoClose", { + get: function () { + return this.service.autoCloseMode; + }, + set: function (value) { + this.service.autoCloseMode = value; + }, + enumerable: true, + configurable: true + }); + SuiDropdown.prototype.ngAfterContentInit = function () { + var _this = this; + if (!this._menu) { + throw new Error("You must set [suiDropdownMenu] on the menu element."); + } + this._menu.service = this.service; + this.childrenUpdated(); + this._children.changes + .subscribe(function () { return _this.childrenUpdated(); }); + }; + SuiDropdown.prototype.childrenUpdated = function () { + var _this = this; + // Reregister child dropdowns each time the menu content changes. + this.children + .map(function (c) { return c.service; }) + .forEach(function (s) { return _this.service.registerChild(s); }); + }; + SuiDropdown.prototype.onClick = function (e) { + if (!e.eventHandled) { + e.eventHandled = true; + this.service.toggleOpenState(); + } + }; + SuiDropdown.prototype.onFocusOut = function (e) { + if (!this._element.nativeElement.contains(e.relatedTarget)) { + this.externallyClose(); + } + }; + SuiDropdown.prototype.onKeypress = function (e) { + // Block the keyboard event from being fired on parent dropdowns. + if (!e.eventHandled) { + if (e.keyCode === KeyCode.Enter) { + e.eventHandled = true; + this.service.setOpenState(true); + } + } + }; + SuiDropdown.prototype.externallyClose = function () { + if (this.service.autoCloseMode === DropdownAutoCloseType.ItemClick || + this.service.autoCloseMode === DropdownAutoCloseType.OutsideClick) { + // No need to reflect in parent since they are also bound to document. + this.service.setOpenState(false); + } + }; + SuiDropdown.decorators = [ + { type: Directive, args: [{ + selector: "[suiDropdown]" + },] }, + ]; + /** @nocollapse */ + SuiDropdown.ctorParameters = function () { return [ + { type: ElementRef, }, + ]; }; + SuiDropdown.propDecorators = { + "_menu": [{ type: ContentChild, args: [SuiDropdownMenu,] },], + "_children": [{ type: ContentChildren, args: [SuiDropdown, { descendants: true },] },], + "isOpenChange": [{ type: Output },], + "isActive": [{ type: HostBinding, args: ["class.active",] },], + "isOpen": [{ type: Input },], + "isDisabled": [{ type: HostBinding, args: ["class.disabled",] }, { type: Input },], + "_tabIndex": [{ type: Input, args: ["tabindex",] },], + "tabIndex": [{ type: HostBinding, args: ["attr.tabindex",] },], + "autoClose": [{ type: Input },], + "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], + "onFocusOut": [{ type: HostListener, args: ["focusout", ["$event"],] },], + "onKeypress": [{ type: HostListener, args: ["keypress", ["$event"],] },], + }; + return SuiDropdown; +}()); +export { SuiDropdown }; +//# sourceMappingURL=dropdown.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown.js.map b/dist/modules/dropdown/directives/dropdown.js.map new file mode 100644 index 000000000..903ef5f39 --- /dev/null +++ b/dist/modules/dropdown/directives/dropdown.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../../src/modules/dropdown/directives/dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAoB,YAAY,EACnF,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EACvD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,OAAO,EAAe,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;;IA4E9C,qBAAoB,QAAmB;QAAvC,iBAOC;QAPmB,aAAQ,GAAR,QAAQ,CAAW;QACnC,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC;YAChC,EAAE,CAAC,CAAC,KAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;gBACtB,KAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;aACvC;SACJ,CAAC,CAAC;KACN;IArED,sBAAW,iCAAQ;aAAnB;YAAA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CAAC;aACnC;SACJ;;IAGG,qCAAe,GAAvB;QACI,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,KAAK,qBAAqB,CAAC,SAAS;YAC1D,IAAI,CAAC,OAAO,CAAC,aAAa,KAAK,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC;;YAExE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;SACpC;KACJ;;gBAxIJ,SAAS,SAAC;oBACP,QAAQ,EAAE,eAAe;iBAC5B;;;;gBARG,UAAU;;;0BAYT,YAAY,SAAC,eAAe;8BAG5B,eAAe,SAAC,WAAW,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;iCAQlD,MAAM;6BAKN,WAAW,SAAC,cAAc;2BAM1B,KAAK;+BAUL,WAAW,SAAC,gBAAgB,cAC5B,KAAK;8BASL,KAAK,SAAC,UAAU;6BAGhB,WAAW,SAAC,eAAe;8BAc3B,KAAK;4BAoCL,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;+BAShC,YAAY,SAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;+BAOnC,YAAY,SAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;sBA7HxC;;SAWa,WAAW","sourcesContent":["import {\n Directive, Input, HostBinding, EventEmitter, Output, AfterContentInit, ContentChild,\n ElementRef, HostListener, QueryList, ContentChildren\n} from \"@angular/core\";\nimport { HandledEvent, KeyCode, IFocusEvent } from \"../../../misc/util/index\";\nimport { DropdownService, DropdownAutoCloseType } from \"../services/dropdown.service\";\nimport { SuiDropdownMenu } from \"./dropdown-menu\";\n\n@Directive({\n selector: \"[suiDropdown]\"\n})\nexport class SuiDropdown implements AfterContentInit {\n public service:DropdownService;\n\n @ContentChild(SuiDropdownMenu)\n private _menu:SuiDropdownMenu;\n\n @ContentChildren(SuiDropdown, { descendants: true })\n private _children:QueryList;\n\n public get children():SuiDropdown[] {\n // @ContentChildren includes the current element by default.\n return this._children.filter(c => c !== this);\n }\n\n @Output()\n public get isOpenChange():EventEmitter {\n return this.service.isOpenChange;\n }\n\n @HostBinding(\"class.active\")\n public get isActive():boolean {\n // This is to ensure nested dropdowns don't get made bold.\n return this.service.isOpen && !this.service.isNested;\n }\n\n @Input()\n public get isOpen():boolean {\n return this.service.isOpen;\n }\n\n public set isOpen(value:boolean) {\n // If we are opening the dropdown, we want to always open its parents.\n this.service.setOpenState(value, !!value);\n }\n\n @HostBinding(\"class.disabled\")\n @Input()\n public get isDisabled():boolean {\n return this.service.isDisabled;\n }\n\n public set isDisabled(value:boolean) {\n this.service.setDisabledState(value);\n }\n\n @Input(\"tabindex\")\n private _tabIndex?:number;\n\n @HostBinding(\"attr.tabindex\")\n public get tabIndex():number | undefined {\n if (this.isDisabled || this.service.isNested) {\n // If disabled, remove from tabindex.\n return undefined;\n }\n if (this._tabIndex != undefined) {\n // If custom tabindex, default to that.\n return this._tabIndex;\n }\n // Otherwise, return default of 0.\n return 0;\n }\n\n @Input()\n public get autoClose():DropdownAutoCloseType {\n return this.service.autoCloseMode;\n }\n\n public set autoClose(value:DropdownAutoCloseType) {\n this.service.autoCloseMode = value;\n }\n\n constructor(private _element:ElementRef) {\n this.service = new DropdownService();\n this.service.isOpenChange.subscribe(() => {\n if (this.service.isOpen) {\n this._element.nativeElement.focus();\n }\n });\n }\n\n public ngAfterContentInit():void {\n if (!this._menu) {\n throw new Error(\"You must set [suiDropdownMenu] on the menu element.\");\n }\n this._menu.service = this.service;\n\n this.childrenUpdated();\n this._children.changes\n .subscribe(() => this.childrenUpdated());\n }\n\n private childrenUpdated():void {\n // Reregister child dropdowns each time the menu content changes.\n this.children\n .map(c => c.service)\n .forEach(s => this.service.registerChild(s));\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(e:HandledEvent):void {\n if (!e.eventHandled) {\n e.eventHandled = true;\n\n this.service.toggleOpenState();\n }\n }\n\n @HostListener(\"focusout\", [\"$event\"])\n private onFocusOut(e:IFocusEvent):void {\n if (!this._element.nativeElement.contains(e.relatedTarget)) {\n this.externallyClose();\n }\n }\n\n @HostListener(\"keypress\", [\"$event\"])\n public onKeypress(e:HandledEvent & KeyboardEvent):void {\n // Block the keyboard event from being fired on parent dropdowns.\n if (!e.eventHandled) {\n\n if (e.keyCode === KeyCode.Enter) {\n e.eventHandled = true;\n\n this.service.setOpenState(true);\n }\n }\n }\n\n private externallyClose():void {\n if (this.service.autoCloseMode === DropdownAutoCloseType.ItemClick ||\n this.service.autoCloseMode === DropdownAutoCloseType.OutsideClick) {\n // No need to reflect in parent since they are also bound to document.\n this.service.setOpenState(false);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown.metadata.json b/dist/modules/dropdown/directives/dropdown.metadata.json new file mode 100644 index 000000000..10fccbf4e --- /dev/null +++ b/dist/modules/dropdown/directives/dropdown.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiDropdown":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":8,"character":1},"arguments":[{"selector":"[suiDropdown]"}]}],"members":{"_menu":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":14,"character":5},"arguments":[{"__symbolic":"reference","module":"./dropdown-menu","name":"SuiDropdownMenu","line":14,"character":18}]}]}],"_children":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":17,"character":5},"arguments":[{"__symbolic":"reference","name":"SuiDropdown"},{"descendants":true}]}]}],"isOpenChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":25,"character":5}}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":30,"character":5},"arguments":["class.active"]}]}],"isOpen":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":5}}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":46,"character":5},"arguments":["class.disabled"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":5}}]}],"_tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":56,"character":5},"arguments":["tabindex"]}]}],"tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":59,"character":5},"arguments":["attr.tabindex"]}]}],"autoClose":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":82,"character":33}]}],"ngAfterContentInit":[{"__symbolic":"method"}],"childrenUpdated":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":109,"character":5},"arguments":["click",["$event"]]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":118,"character":5},"arguments":["focusout",["$event"]]}]}],"onKeypress":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":125,"character":5},"arguments":["keypress",["$event"]]}]}],"externallyClose":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/dropdown/dropdown.module.d.ts b/dist/modules/dropdown/dropdown.module.d.ts new file mode 100644 index 000000000..5f1d02c44 --- /dev/null +++ b/dist/modules/dropdown/dropdown.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiDropdownModule { +} diff --git a/dist/modules/dropdown/dropdown.module.js b/dist/modules/dropdown/dropdown.module.js new file mode 100644 index 000000000..e3c2fcb09 --- /dev/null +++ b/dist/modules/dropdown/dropdown.module.js @@ -0,0 +1,32 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiTransitionModule } from "../transition/index"; +import { SuiDropdown } from "./directives/dropdown"; +import { SuiDropdownMenu, SuiDropdownMenuItem } from "./directives/dropdown-menu"; +var SuiDropdownModule = /** @class */ (function () { + function SuiDropdownModule() { + } + SuiDropdownModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule, + SuiTransitionModule + ], + declarations: [ + SuiDropdown, + SuiDropdownMenu, + SuiDropdownMenuItem + ], + exports: [ + SuiDropdown, + SuiDropdownMenu, + SuiDropdownMenuItem + ] + },] }, + ]; + /** @nocollapse */ + SuiDropdownModule.ctorParameters = function () { return []; }; + return SuiDropdownModule; +}()); +export { SuiDropdownModule }; +//# sourceMappingURL=dropdown.module.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/dropdown.module.js.map b/dist/modules/dropdown/dropdown.module.js.map new file mode 100644 index 000000000..99513d61d --- /dev/null +++ b/dist/modules/dropdown/dropdown.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dropdown.module.js","sourceRoot":"","sources":["../../../src/modules/dropdown/dropdown.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;;;;;gBAEjF,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,mBAAmB;qBACtB;oBACD,YAAY,EAAE;wBACV,WAAW;wBACX,eAAe;wBACf,mBAAmB;qBACtB;oBACD,OAAO,EAAE;wBACL,WAAW;wBACX,eAAe;wBACf,mBAAmB;qBACtB;iBACJ;;;;4BArBD;;SAsBa,iBAAiB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTransitionModule } from \"../transition/index\";\nimport { SuiDropdown } from \"./directives/dropdown\";\nimport { SuiDropdownMenu, SuiDropdownMenuItem } from \"./directives/dropdown-menu\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiTransitionModule\n ],\n declarations: [\n SuiDropdown,\n SuiDropdownMenu,\n SuiDropdownMenuItem\n ],\n exports: [\n SuiDropdown,\n SuiDropdownMenu,\n SuiDropdownMenuItem\n ]\n})\nexport class SuiDropdownModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/dropdown.module.metadata.json b/dist/modules/dropdown/dropdown.module.metadata.json new file mode 100644 index 000000000..aa1969740 --- /dev/null +++ b/dist/modules/dropdown/dropdown.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiDropdownModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":8},{"__symbolic":"reference","module":"../transition/index","name":"SuiTransitionModule","line":9,"character":8}],"declarations":[{"__symbolic":"reference","module":"./directives/dropdown","name":"SuiDropdown","line":12,"character":8},{"__symbolic":"reference","module":"./directives/dropdown-menu","name":"SuiDropdownMenu","line":13,"character":8},{"__symbolic":"reference","module":"./directives/dropdown-menu","name":"SuiDropdownMenuItem","line":14,"character":8}],"exports":[{"__symbolic":"reference","module":"./directives/dropdown","name":"SuiDropdown","line":17,"character":8},{"__symbolic":"reference","module":"./directives/dropdown-menu","name":"SuiDropdownMenu","line":18,"character":8},{"__symbolic":"reference","module":"./directives/dropdown-menu","name":"SuiDropdownMenuItem","line":19,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/dropdown/index.d.ts b/dist/modules/dropdown/index.d.ts new file mode 100644 index 000000000..1f5a3dac0 --- /dev/null +++ b/dist/modules/dropdown/index.d.ts @@ -0,0 +1,4 @@ +export * from "./directives/dropdown-menu"; +export * from "./directives/dropdown"; +export * from "./services/dropdown.service"; +export * from "./dropdown.module"; diff --git a/dist/modules/dropdown/index.js b/dist/modules/dropdown/index.js new file mode 100644 index 000000000..1e99740fb --- /dev/null +++ b/dist/modules/dropdown/index.js @@ -0,0 +1,5 @@ +export * from "./directives/dropdown-menu"; +export * from "./directives/dropdown"; +export * from "./services/dropdown.service"; +export * from "./dropdown.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/index.js.map b/dist/modules/dropdown/index.js.map new file mode 100644 index 000000000..69b0b0a73 --- /dev/null +++ b/dist/modules/dropdown/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/dropdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AAEtC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./directives/dropdown-menu\";\nexport * from \"./directives/dropdown\";\n\nexport * from \"./services/dropdown.service\";\n\nexport * from \"./dropdown.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/index.metadata.json b/dist/modules/dropdown/index.metadata.json new file mode 100644 index 000000000..f6781a9e4 --- /dev/null +++ b/dist/modules/dropdown/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./directives/dropdown-menu"},{"from":"./directives/dropdown"},{"from":"./services/dropdown.service"},{"from":"./dropdown.module"}]}] \ No newline at end of file diff --git a/dist/modules/dropdown/public.d.ts b/dist/modules/dropdown/public.d.ts new file mode 100644 index 000000000..9c71a37b2 --- /dev/null +++ b/dist/modules/dropdown/public.d.ts @@ -0,0 +1 @@ +export { SuiDropdownModule, DropdownAutoCloseType } from "./index"; diff --git a/dist/modules/dropdown/public.js b/dist/modules/dropdown/public.js new file mode 100644 index 000000000..9c76ef77e --- /dev/null +++ b/dist/modules/dropdown/public.js @@ -0,0 +1,2 @@ +export { SuiDropdownModule, DropdownAutoCloseType } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/public.js.map b/dist/modules/dropdown/public.js.map new file mode 100644 index 000000000..36ff1a80f --- /dev/null +++ b/dist/modules/dropdown/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/dropdown/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,qBAAqB,EACxB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiDropdownModule,\n DropdownAutoCloseType\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/public.metadata.json b/dist/modules/dropdown/public.metadata.json new file mode 100644 index 000000000..8de249cb2 --- /dev/null +++ b/dist/modules/dropdown/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiDropdownModule","DropdownAutoCloseType"]}]}] \ No newline at end of file diff --git a/dist/modules/dropdown/services/dropdown.service.d.ts b/dist/modules/dropdown/services/dropdown.service.d.ts new file mode 100644 index 000000000..24444ed3f --- /dev/null +++ b/dist/modules/dropdown/services/dropdown.service.d.ts @@ -0,0 +1,25 @@ +import { EventEmitter } from "@angular/core"; +export declare type DropdownAutoCloseType = "itemClick" | "outsideClick" | "disabled"; +export declare const DropdownAutoCloseType: { + ItemClick: DropdownAutoCloseType; + OutsideClick: DropdownAutoCloseType; + Disabled: DropdownAutoCloseType; +}; +export declare class DropdownService { + isOpen: boolean; + isAnimating: boolean; + isOpenChange: EventEmitter; + isDisabled: boolean; + autoCloseMode: DropdownAutoCloseType; + parent?: DropdownService; + children: DropdownService[]; + readonly isNested: boolean; + constructor(autoCloseMode?: DropdownAutoCloseType); + setOpenState(isOpen: boolean, reflectInParent?: boolean): void; + setDisabledState(isDisabled: boolean): void; + toggleOpenState(): void; + registerChild(child: DropdownService): void; + isChildRegistered(child: DropdownService): boolean; + clearChildren(): void; + private delay(callback); +} diff --git a/dist/modules/dropdown/services/dropdown.service.js b/dist/modules/dropdown/services/dropdown.service.js new file mode 100644 index 000000000..b08d24fd2 --- /dev/null +++ b/dist/modules/dropdown/services/dropdown.service.js @@ -0,0 +1,100 @@ +import { EventEmitter } from "@angular/core"; +// Creates essentially a 'string' enum. +export var DropdownAutoCloseType = { + ItemClick: "itemClick", + OutsideClick: "outsideClick", + Disabled: "disabled" +}; +var DropdownService = /** @class */ (function () { + function DropdownService(autoCloseMode) { + if (autoCloseMode === void 0) { autoCloseMode = DropdownAutoCloseType.ItemClick; } + this.isOpen = false; + this.isOpenChange = new EventEmitter(); + this.isDisabled = false; + this.autoCloseMode = autoCloseMode; + this.children = []; + } + Object.defineProperty(DropdownService.prototype, "isNested", { + get: function () { + return !!this.parent; + }, + enumerable: true, + configurable: true + }); + DropdownService.prototype.setOpenState = function (isOpen, reflectInParent) { + var _this = this; + if (reflectInParent === void 0) { reflectInParent = false; } + if (this.isOpen !== isOpen && !this.isDisabled) { + // Only update the state if it has changed, and the dropdown isn't disabled. + this.isOpen = !!isOpen; + this.isAnimating = true; + // We must delay the emitting to avoid the 'changed after checked' Angular errors. + this.delay(function () { return _this.isOpenChange.emit(_this.isOpen); }); + if (!this.isOpen) { + // Close the child dropdowns when this one closes. + this.children.forEach(function (c) { return c.setOpenState(_this.isOpen); }); + } + if (this.parent && reflectInParent) { + // Open the parent dropdowns when this one opens. + this.parent.setOpenState(this.isOpen, true); + } + } + else if (this.isOpen !== isOpen && this.isDisabled) { + // If the state has changed, but the dropdown is disabled, re-emit the original isOpen value. + this.delay(function () { return _this.isOpenChange.emit(_this.isOpen); }); + } + }; + DropdownService.prototype.setDisabledState = function (isDisabled) { + if (this.isDisabled !== isDisabled) { + if (!!isDisabled) { + // Close the dropdown as it is now disabled + this.setOpenState(false); + } + this.isDisabled = !!isDisabled; + } + }; + DropdownService.prototype.toggleOpenState = function () { + this.setOpenState(!this.isOpen); + }; + // Registers a dropdown service as a child of this service. + // Registers a dropdown service as a child of this service. + DropdownService.prototype.registerChild = + // Registers a dropdown service as a child of this service. + function (child) { + if (!this.isChildRegistered(child)) { + this.children.push(child); + child.parent = this; + } + }; + // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. + // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. + DropdownService.prototype.isChildRegistered = + // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. + function (child) { + return this === child || !!this.children + .find(function (c) { + return !!c.children + .find(function (cChild) { return cChild.isChildRegistered(child); }); + }); + }; + // Wipes any nested data, so all services can be cleanly reattached. + // Wipes any nested data, so all services can be cleanly reattached. + DropdownService.prototype.clearChildren = + // Wipes any nested data, so all services can be cleanly reattached. + function () { + this.children.forEach(function (c) { + c.parent = undefined; + }); + this.children = []; + }; + // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. + // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. + DropdownService.prototype.delay = + // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. + function (callback) { + setTimeout(function () { return callback(); }); + }; + return DropdownService; +}()); +export { DropdownService }; +//# sourceMappingURL=dropdown.service.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/services/dropdown.service.js.map b/dist/modules/dropdown/services/dropdown.service.js.map new file mode 100644 index 000000000..14581213a --- /dev/null +++ b/dist/modules/dropdown/services/dropdown.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dropdown.service.js","sourceRoot":"","sources":["../../../../src/modules/dropdown/services/dropdown.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EA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;iBAClB,IAAI,CAAC,UAAA,MAAM,IAAI,OAAA,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAA/B,CAA+B,CAAC;QADzC,CACyC,CAAC,CAAC;KAC7D;IAED,oEAAoE;;IAC7D,uCAAa;;IAApB;QACI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,CAAC;YACnB,CAAC,CAAC,MAAM,GAAG,SAAS,CAAC;SACxB,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;KACtB;IAED,mGAAmG;;IAC3F,+BAAK;;IAAb,UAAc,QAAmB;QAC7B,UAAU,CAAC,cAAM,OAAA,QAAQ,EAAE,EAAV,CAAU,CAAC,CAAC;KAChC;0BA3GL;IA4GC,CAAA;AAjGD,2BAiGC","sourcesContent":["import { EventEmitter } from \"@angular/core\";\n\nexport type DropdownAutoCloseType = \"itemClick\" | \"outsideClick\" | \"disabled\";\n\n// Creates essentially a 'string' enum.\nexport const DropdownAutoCloseType = {\n ItemClick: \"itemClick\" as DropdownAutoCloseType,\n OutsideClick: \"outsideClick\" as DropdownAutoCloseType,\n Disabled: \"disabled\" as DropdownAutoCloseType\n};\n\nexport class DropdownService {\n // Open state of the dropdown\n public isOpen:boolean;\n // Animating state of the dropdown.\n public isAnimating:boolean;\n // Emitter for when dropdown open state changes.\n public isOpenChange:EventEmitter;\n\n public isDisabled:boolean;\n\n // Sets the \"autoclose\" mode of the dropdown - i.e. what user action causes it to autoclose.\n public autoCloseMode:DropdownAutoCloseType;\n\n // Keep track of the containing dropdown so we can open it as necessary.\n public parent?:DropdownService;\n // Also keep track of dropdowns nested in this one so we can close them as necessary.\n public children:DropdownService[];\n public get isNested():boolean {\n return !!this.parent;\n }\n\n constructor(autoCloseMode:DropdownAutoCloseType = DropdownAutoCloseType.ItemClick) {\n this.isOpen = false;\n this.isOpenChange = new EventEmitter();\n\n this.isDisabled = false;\n\n this.autoCloseMode = autoCloseMode;\n\n this.children = [];\n }\n\n public setOpenState(isOpen:boolean, reflectInParent:boolean = false):void {\n if (this.isOpen !== isOpen && !this.isDisabled) {\n // Only update the state if it has changed, and the dropdown isn't disabled.\n this.isOpen = !!isOpen;\n this.isAnimating = true;\n // We must delay the emitting to avoid the 'changed after checked' Angular errors.\n this.delay(() => this.isOpenChange.emit(this.isOpen));\n\n if (!this.isOpen) {\n // Close the child dropdowns when this one closes.\n this.children.forEach(c => c.setOpenState(this.isOpen));\n }\n\n if (this.parent && reflectInParent) {\n // Open the parent dropdowns when this one opens.\n this.parent.setOpenState(this.isOpen, true);\n }\n } else if (this.isOpen !== isOpen && this.isDisabled) {\n // If the state has changed, but the dropdown is disabled, re-emit the original isOpen value.\n this.delay(() => this.isOpenChange.emit(this.isOpen));\n }\n }\n\n public setDisabledState(isDisabled:boolean):void {\n if (this.isDisabled !== isDisabled) {\n if (!!isDisabled) {\n // Close the dropdown as it is now disabled\n this.setOpenState(false);\n }\n\n this.isDisabled = !!isDisabled;\n }\n }\n\n public toggleOpenState():void {\n this.setOpenState(!this.isOpen);\n }\n\n // Registers a dropdown service as a child of this service.\n public registerChild(child:DropdownService):void {\n if (!this.isChildRegistered(child)) {\n this.children.push(child);\n child.parent = this;\n }\n }\n\n // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child.\n public isChildRegistered(child:DropdownService):boolean {\n return this === child || !!this.children\n .find(c => !!c.children\n .find(cChild => cChild.isChildRegistered(child)));\n }\n\n // Wipes any nested data, so all services can be cleanly reattached.\n public clearChildren():void {\n this.children.forEach(c => {\n c.parent = undefined;\n });\n this.children = [];\n }\n\n // Method for delaying an event into the next tick, to avoid Angular \"changed after checked\" error.\n private delay(callback:() => void):void {\n setTimeout(() => callback());\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/services/dropdown.service.metadata.json b/dist/modules/dropdown/services/dropdown.service.metadata.json new file mode 100644 index 000000000..e1684c318 --- /dev/null +++ b/dist/modules/dropdown/services/dropdown.service.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"DropdownAutoCloseType":{"ItemClick":"itemClick","OutsideClick":"outsideClick","Disabled":"disabled"},"DropdownService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":32,"character":30,"context":{"typeName":"DropdownAutoCloseType"}}]}],"setOpenState":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}],"toggleOpenState":[{"__symbolic":"method"}],"registerChild":[{"__symbolic":"method"}],"isChildRegistered":[{"__symbolic":"method"}],"clearChildren":[{"__symbolic":"method"}],"delay":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/index.d.ts b/dist/modules/index.d.ts new file mode 100644 index 000000000..7758999cc --- /dev/null +++ b/dist/modules/index.d.ts @@ -0,0 +1,15 @@ +export * from "./accordion/index"; +export * from "./checkbox/index"; +export * from "./collapse/index"; +export * from "./datepicker/index"; +export * from "./dimmer/index"; +export * from "./dropdown/index"; +export * from "./modal/index"; +export * from "./popup/index"; +export * from "./progress/index"; +export * from "./rating/index"; +export * from "./search/index"; +export * from "./select/index"; +export * from "./sidebar/index"; +export * from "./tabs/index"; +export * from "./transition/index"; diff --git a/dist/modules/index.js b/dist/modules/index.js new file mode 100644 index 000000000..70b61dbf5 --- /dev/null +++ b/dist/modules/index.js @@ -0,0 +1,16 @@ +export * from "./accordion/index"; +export * from "./checkbox/index"; +export * from "./collapse/index"; +export * from "./datepicker/index"; +export * from "./dimmer/index"; +export * from "./dropdown/index"; +export * from "./modal/index"; +export * from "./popup/index"; +export * from "./progress/index"; +export * from "./rating/index"; +export * from "./search/index"; +export * from "./select/index"; +export * from "./sidebar/index"; +export * from "./tabs/index"; +export * from "./transition/index"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/index.js.map b/dist/modules/index.js.map new file mode 100644 index 000000000..5ab82fc72 --- /dev/null +++ b/dist/modules/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./accordion/index\";\nexport * from \"./checkbox/index\";\nexport * from \"./collapse/index\";\nexport * from \"./datepicker/index\";\nexport * from \"./dimmer/index\";\nexport * from \"./dropdown/index\";\nexport * from \"./modal/index\";\nexport * from \"./popup/index\";\nexport * from \"./progress/index\";\nexport * from \"./rating/index\";\nexport * from \"./search/index\";\nexport * from \"./select/index\";\nexport * from \"./sidebar/index\";\nexport * from \"./tabs/index\";\nexport * from \"./transition/index\";\n"]} \ No newline at end of file diff --git a/dist/modules/index.metadata.json b/dist/modules/index.metadata.json new file mode 100644 index 000000000..3ee50e222 --- /dev/null +++ b/dist/modules/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./accordion/index"},{"from":"./checkbox/index"},{"from":"./collapse/index"},{"from":"./datepicker/index"},{"from":"./dimmer/index"},{"from":"./dropdown/index"},{"from":"./modal/index"},{"from":"./popup/index"},{"from":"./progress/index"},{"from":"./rating/index"},{"from":"./search/index"},{"from":"./select/index"},{"from":"./sidebar/index"},{"from":"./tabs/index"},{"from":"./transition/index"}]}] \ No newline at end of file diff --git a/dist/modules/modal/classes/active-modal.d.ts b/dist/modules/modal/classes/active-modal.d.ts new file mode 100644 index 000000000..326edf8a6 --- /dev/null +++ b/dist/modules/modal/classes/active-modal.d.ts @@ -0,0 +1,14 @@ +import { ComponentRef } from "@angular/core"; +import { ModalConfig } from "./modal-config"; +import { SuiModal } from "../components/modal"; +export declare class ActiveModal { + private _config; + private _componentRef; + readonly component: SuiModal; + constructor(instance: ModalConfig, componentRef: ComponentRef>); + onApprove(callback: (result: U) => void): ActiveModal; + onDeny(callback: (result: V) => void): ActiveModal; + approve(result: U): void; + deny(result: V): void; + destroy(): void; +} diff --git a/dist/modules/modal/classes/active-modal.js b/dist/modules/modal/classes/active-modal.js new file mode 100644 index 000000000..deba96369 --- /dev/null +++ b/dist/modules/modal/classes/active-modal.js @@ -0,0 +1,63 @@ +// Helper class to support method chaining when calling `SuiModalService.open(...)`. +var +// Helper class to support method chaining when calling `SuiModalService.open(...)`. +ActiveModal = /** @class */ (function () { + function ActiveModal(instance, componentRef) { + var _this = this; + this._config = instance; + this._componentRef = componentRef; + // Automatically destroy the modal component when it has been dismissed. + this.component.onDismiss.subscribe(function () { return _this._componentRef.destroy(); }); + } + Object.defineProperty(ActiveModal.prototype, "component", { + // Shorthand for direct access to the `SuiModal` instance. + get: + // Shorthand for direct access to the `SuiModal` instance. + function () { + return this._componentRef.instance; + }, + enumerable: true, + configurable: true + }); + // Registers a callback for when `onApprove` is fired. + // Registers a callback for when `onApprove` is fired. + ActiveModal.prototype.onApprove = + // Registers a callback for when `onApprove` is fired. + function (callback) { + this.component.onApprove.subscribe(function (res) { return callback(res); }); + return this; + }; + // Registers a callback for when `onDeny` is fired. + // Registers a callback for when `onDeny` is fired. + ActiveModal.prototype.onDeny = + // Registers a callback for when `onDeny` is fired. + function (callback) { + this.component.onDeny.subscribe(function (res) { return callback(res); }); + return this; + }; + // Fires the approve event of the modal manually. + // Fires the approve event of the modal manually. + ActiveModal.prototype.approve = + // Fires the approve event of the modal manually. + function (result) { + this.component.approve(result); + }; + // Fires the deny event of the modal manually. + // Fires the deny event of the modal manually. + ActiveModal.prototype.deny = + // Fires the deny event of the modal manually. + function (result) { + this.component.deny(result); + }; + // Removes the modal component instantly, without transitions or firing any events. + // Removes the modal component instantly, without transitions or firing any events. + ActiveModal.prototype.destroy = + // Removes the modal component instantly, without transitions or firing any events. + function () { + this._componentRef.destroy(); + }; + return ActiveModal; +}()); +// Helper class to support method chaining when calling `SuiModalService.open(...)`. +export { ActiveModal }; +//# sourceMappingURL=active-modal.js.map \ No newline at end of file diff --git a/dist/modules/modal/classes/active-modal.js.map b/dist/modules/modal/classes/active-modal.js.map new file mode 100644 index 000000000..7b76dd994 --- /dev/null +++ b/dist/modules/modal/classes/active-modal.js.map @@ -0,0 +1 @@ +{"version":3,"file":"active-modal.js","sourceRoot":"","sources":["../../../../src/modules/modal/classes/active-modal.ts"],"names":[],"mappings":";AAKA;;AAAA;IASI,qBAAY,QAA6B,EAAE,YAAyC;QAApF,iBAMC;QALG,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;;QAGlC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,aAAa,CAAC,OAAO,EAAE,EAA5B,CAA4B,CAAC,CAAC;KAC1E;IAVD,sBAAW,kCAAS;QADpB,0DAA0D;;;QAC1D;YACI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;SACtC;;;OAAA;IAUD,sDAAsD;;IAC/C,+BAAS;;IAAhB,UAAiB,QAA2B;QACxC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,UAAC,GAAK,IAAK,OAAA,QAAQ,CAAC,GAAG,CAAC,EAAb,CAAa,CAAC,CAAC;QAC7D,MAAM,CAAC,IAAI,CAAC;KACf;IAED,mDAAmD;;IAC5C,4BAAM;;IAAb,UAAc,QAA2B;QACrC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,UAAC,GAAK,IAAK,OAAA,QAAQ,CAAC,GAAG,CAAC,EAAb,CAAa,CAAC,CAAC;QAC1D,MAAM,CAAC,IAAI,CAAC;KACf;IAED,iDAAiD;;IAC1C,6BAAO;;IAAd,UAAe,MAAQ;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;KAClC;IAED,8CAA8C;;IACvC,0BAAI;;IAAX,UAAY,MAAQ;QAChB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC/B;IAED,mFAAmF;;IAC5E,6BAAO;;IAAd;QACI,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;KAChC;sBA/CL;IAgDC,CAAA;;AA3CD,uBA2CC","sourcesContent":["import { ComponentRef } from \"@angular/core\";\nimport { ModalConfig } from \"./modal-config\";\nimport { SuiModal } from \"../components/modal\";\n\n// Helper class to support method chaining when calling `SuiModalService.open(...)`.\nexport class ActiveModal {\n private _config:ModalConfig;\n private _componentRef:ComponentRef>;\n\n // Shorthand for direct access to the `SuiModal` instance.\n public get component():SuiModal {\n return this._componentRef.instance;\n }\n\n constructor(instance:ModalConfig, componentRef:ComponentRef>) {\n this._config = instance;\n this._componentRef = componentRef;\n\n // Automatically destroy the modal component when it has been dismissed.\n this.component.onDismiss.subscribe(() => this._componentRef.destroy());\n }\n\n // Registers a callback for when `onApprove` is fired.\n public onApprove(callback:(result:U) => void):ActiveModal {\n this.component.onApprove.subscribe((res:U) => callback(res));\n return this;\n }\n\n // Registers a callback for when `onDeny` is fired.\n public onDeny(callback:(result:V) => void):ActiveModal {\n this.component.onDeny.subscribe((res:V) => callback(res));\n return this;\n }\n\n // Fires the approve event of the modal manually.\n public approve(result:U):void {\n this.component.approve(result);\n }\n\n // Fires the deny event of the modal manually.\n public deny(result:V):void {\n this.component.deny(result);\n }\n\n // Removes the modal component instantly, without transitions or firing any events.\n public destroy():void {\n this._componentRef.destroy();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/classes/active-modal.metadata.json b/dist/modules/modal/classes/active-modal.metadata.json new file mode 100644 index 000000000..760d96eff --- /dev/null +++ b/dist/modules/modal/classes/active-modal.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"ActiveModal":{"__symbolic":"class","arity":3,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./modal-config","name":"ModalConfig","line":14,"character":25,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":14,"character":37,"context":{"typeName":"T"}},{"__symbolic":"error","message":"Could not resolve type","line":14,"character":40,"context":{"typeName":"U"}},{"__symbolic":"error","message":"Could not resolve type","line":14,"character":43,"context":{"typeName":"V"}}]},{"__symbolic":"reference","module":"@angular/core","name":"ComponentRef","line":14,"character":60,"arguments":[{"__symbolic":"reference","module":"../components/modal","name":"SuiModal","line":14,"character":73,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":14,"character":82,"context":{"typeName":"U"}},{"__symbolic":"error","message":"Could not resolve type","line":14,"character":85,"context":{"typeName":"V"}}]}]}]}],"onApprove":[{"__symbolic":"method"}],"onDeny":[{"__symbolic":"method"}],"approve":[{"__symbolic":"method"}],"deny":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-config.d.ts b/dist/modules/modal/classes/modal-config.d.ts new file mode 100644 index 000000000..ecd371919 --- /dev/null +++ b/dist/modules/modal/classes/modal-config.d.ts @@ -0,0 +1,31 @@ +import { Type } from "@angular/core"; +import { ModalTemplate } from "./modal-template"; +export declare type ModalSize = "mini" | "tiny" | "small" | "normal" | "large"; +export declare const ModalSize: { + Mini: ModalSize; + Tiny: ModalSize; + Small: ModalSize; + Normal: ModalSize; + Large: ModalSize; +}; +export declare class ModalConfig { + isClosable: boolean; + closeResult: V; + context?: T; + size: ModalSize; + isFullScreen: boolean; + isBasic: boolean; + isInverted: boolean; + mustScroll: boolean; + transition: string; + transitionDuration: number; + constructor(context?: T | undefined, isClosable?: boolean); +} +export declare class TemplateModalConfig extends ModalConfig { + template: ModalTemplate; + constructor(template: ModalTemplate, context?: T | undefined, isClosable?: boolean); +} +export declare class ComponentModalConfig extends ModalConfig { + component: Type; + constructor(component: Type, context?: T | undefined, isClosable?: boolean); +} diff --git a/dist/modules/modal/classes/modal-config.js b/dist/modules/modal/classes/modal-config.js new file mode 100644 index 000000000..23b0e7989 --- /dev/null +++ b/dist/modules/modal/classes/modal-config.js @@ -0,0 +1,72 @@ +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 __()); + }; +})(); +export var ModalSize = { + Mini: "mini", + Tiny: "tiny", + Small: "small", + Normal: "normal", + Large: "large" +}; +// Stores a basic set of configuration options for a modal. +var +// Stores a basic set of configuration options for a modal. +ModalConfig = /** @class */ (function () { + function ModalConfig(context, isClosable) { + if (context === void 0) { context = undefined; } + if (isClosable === void 0) { isClosable = true; } + // Initialise with default values. + this.isClosable = isClosable; + this.context = context; + this.size = ModalSize.Normal; + this.isFullScreen = false; + this.isBasic = false; + this.isInverted = false; + this.mustScroll = false; + this.transition = "scale"; + this.transitionDuration = 500; + } + return ModalConfig; +}()); +// Stores a basic set of configuration options for a modal. +export { ModalConfig }; +// Used when creating a modal from a `TemplateRef`. +var +// Used when creating a modal from a `TemplateRef`. +TemplateModalConfig = /** @class */ (function (_super) { + __extends(TemplateModalConfig, _super); + function TemplateModalConfig(template, context, isClosable) { + if (context === void 0) { context = undefined; } + if (isClosable === void 0) { isClosable = true; } + var _this = _super.call(this, context, isClosable) || this; + _this.template = template; + return _this; + } + return TemplateModalConfig; +}(ModalConfig)); +// Used when creating a modal from a `TemplateRef`. +export { TemplateModalConfig }; +// Used when creating a modal from an existing component. +var +// Used when creating a modal from an existing component. +ComponentModalConfig = /** @class */ (function (_super) { + __extends(ComponentModalConfig, _super); + function ComponentModalConfig(component, context, isClosable) { + if (context === void 0) { context = undefined; } + if (isClosable === void 0) { isClosable = true; } + var _this = _super.call(this, context, isClosable) || this; + _this.component = component; + return _this; + } + return ComponentModalConfig; +}(ModalConfig)); +// Used when creating a modal from an existing component. +export { ComponentModalConfig }; +//# sourceMappingURL=modal-config.js.map \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-config.js.map b/dist/modules/modal/classes/modal-config.js.map new file mode 100644 index 000000000..051da9e98 --- /dev/null +++ b/dist/modules/modal/classes/modal-config.js.map @@ -0,0 +1 @@ +{"version":3,"file":"modal-config.js","sourceRoot":"","sources":["../../../../src/modules/modal/classes/modal-config.ts"],"names":[],"mappings":";;;;;;;;;;AAKA,MAAM,CAAC,IAAM,SAAS,GAAG;IACrB,IAAI,EAAE,MAAmB;IACzB,IAAI,EAAE,MAAmB;IACzB,KAAK,EAAE,OAAoB;IAC3B,MAAM,EAAE,QAAqB;IAC7B,KAAK,EAAE,OAAoB;CAC9B,CAAC;;AAGF;;AAAA;IA0BI,qBAAY,OAAiC,EAAE,UAAyB;QAA5D,wBAAA,EAAA,mBAAiC;QAAE,2BAAA,EAAA,iBAAyB;;QAEpE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;QAC1B,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC;KACjC;sBAtDL;IAuDC,CAAA;;AAzCD,uBAyCC;;AAGD;;AAAA;IAA0E,uCAAoB;IAG1F,6BAAY,QAA+B,EAAE,OAAiC,EAAE,UAAyB;QAA5D,wBAAA,EAAA,mBAAiC;QAAE,2BAAA,EAAA,iBAAyB;QAAzG,YACI,kBAAM,OAAO,EAAE,UAAU,CAAC,SAG7B;QADG,KAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;;KAC5B;8BAjEL;EA0D0E,WAAW,EAQpF,CAAA;;AARD,+BAQC;;AAGD;;AAAA;IAA2E,wCAAoB;IAG3F,8BAAY,SAAmB,EAAE,OAAiC,EAAE,UAAyB;QAA5D,wBAAA,EAAA,mBAAiC;QAAE,2BAAA,EAAA,iBAAyB;QAA7F,YACI,kBAAM,OAAO,EAAE,UAAU,CAAC,SAG7B;QADG,KAAI,CAAC,SAAS,GAAG,SAAS,CAAC;;KAC9B;+BA5EL;EAqE2E,WAAW,EAQrF,CAAA;;AARD,gCAQC","sourcesContent":["import { Type } from \"@angular/core\";\nimport { ModalTemplate } from \"./modal-template\";\n\nexport type ModalSize = \"mini\" | \"tiny\" | \"small\" | \"normal\" | \"large\";\n\nexport const ModalSize = {\n Mini: \"mini\" as ModalSize,\n Tiny: \"tiny\" as ModalSize,\n Small: \"small\" as ModalSize,\n Normal: \"normal\" as ModalSize,\n Large: \"large\" as ModalSize\n};\n\n// Stores a basic set of configuration options for a modal.\nexport class ModalConfig {\n // Determines whether the modal can be closed with a close button, clicking outside, or the escape key.\n public isClosable:boolean;\n // Value to deny with when closing via `isClosable`.\n public closeResult:V;\n\n // Data to pass to the modal instance when opened.\n public context?:T;\n\n // Size used to display the modal.\n public size:ModalSize;\n // Whether the modal takes up the full width of the screen.\n public isFullScreen:boolean;\n // Whether or not the modal has basic styles applied.\n public isBasic:boolean;\n // Whether the modal shows against a light background.\n public isInverted:boolean;\n\n // Whether or not the modal should always display a scrollbar.\n public mustScroll:boolean;\n\n // Transition to display modal with.\n public transition:string;\n // Duration of the modal & dimmer transitions.\n public transitionDuration:number;\n\n constructor(context:T | undefined = undefined, isClosable:boolean = true) {\n // Initialise with default values.\n this.isClosable = isClosable;\n this.context = context;\n\n this.size = ModalSize.Normal;\n this.isFullScreen = false;\n this.isBasic = false;\n this.isInverted = false;\n\n this.mustScroll = false;\n\n this.transition = \"scale\";\n this.transitionDuration = 500;\n }\n}\n\n// Used when creating a modal from a `TemplateRef`.\nexport class TemplateModalConfig extends ModalConfig {\n public template:ModalTemplate;\n\n constructor(template:ModalTemplate, context:T | undefined = undefined, isClosable:boolean = true) {\n super(context, isClosable);\n\n this.template = template;\n }\n}\n\n// Used when creating a modal from an existing component.\nexport class ComponentModalConfig extends ModalConfig {\n public component:Type;\n\n constructor(component:Type, context:T | undefined = undefined, isClosable:boolean = true) {\n super(context, isClosable);\n\n this.component = component;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-config.metadata.json b/dist/modules/modal/classes/modal-config.metadata.json new file mode 100644 index 000000000..43e86d9bd --- /dev/null +++ b/dist/modules/modal/classes/modal-config.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"ModalSize":{"Mini":"mini","Tiny":"tiny","Small":"small","Normal":"normal","Large":"large"},"ModalConfig":{"__symbolic":"class","arity":3,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":40,"character":24,"context":{"typeName":"T"}},{"__symbolic":"reference","name":"boolean"}]}]}},"TemplateModalConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ModalConfig"},"arity":3,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./modal-template","name":"ModalTemplate","line":61,"character":25,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":61,"character":39,"context":{"typeName":"T"}},{"__symbolic":"error","message":"Could not resolve type","line":61,"character":42,"context":{"typeName":"U"}},{"__symbolic":"error","message":"Could not resolve type","line":61,"character":45,"context":{"typeName":"V"}}]},{"__symbolic":"error","message":"Could not resolve type","line":61,"character":57,"context":{"typeName":"T"}},{"__symbolic":"reference","name":"boolean"}]}]}},"ComponentModalConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ModalConfig"},"arity":3,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Type","line":72,"character":26,"arguments":[{"__symbolic":"reference","name":"any"}]},{"__symbolic":"error","message":"Could not resolve type","line":72,"character":45,"context":{"typeName":"T"}},{"__symbolic":"reference","name":"boolean"}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-controls.d.ts b/dist/modules/modal/classes/modal-controls.d.ts new file mode 100644 index 000000000..7d83ae197 --- /dev/null +++ b/dist/modules/modal/classes/modal-controls.d.ts @@ -0,0 +1,10 @@ +export declare type ModalResult = (result: T) => void; +export declare class ModalControls { + constructor(approve: ModalResult, deny: ModalResult); + approve(result: T): void; + deny(result: U): void; +} +export declare class Modal extends ModalControls { + context: T; + constructor(controls: ModalControls, context: T); +} diff --git a/dist/modules/modal/classes/modal-controls.js b/dist/modules/modal/classes/modal-controls.js new file mode 100644 index 000000000..c934d8723 --- /dev/null +++ b/dist/modules/modal/classes/modal-controls.js @@ -0,0 +1,46 @@ +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 __()); + }; +})(); +// Used to pass ability to control a modal to a component. +var +// Used to pass ability to control a modal to a component. +ModalControls = /** @class */ (function () { + function ModalControls(approve, deny) { + this.approve = approve; + this.deny = deny; + } + // Use method here rather than arrow variables to make intellisense show they're methods. + // Use method here rather than arrow variables to make intellisense show they're methods. + ModalControls.prototype.approve = + // Use method here rather than arrow variables to make intellisense show they're methods. + function (result) { }; + ModalControls.prototype.deny = function (result) { }; + return ModalControls; +}()); +// Used to pass ability to control a modal to a component. +export { ModalControls }; +// Injected into custom modal components, to allow control of the modal, and access to a context object. +var +// Injected into custom modal components, to allow control of the modal, and access to a context object. +Modal = /** @class */ (function (_super) { + __extends(Modal, _super); + function Modal(controls, context) { + var _this = + // Instances of `ModalControls` are only created in the `SuiModal` constructor, + // so we take an initialised instance rather than remaking one each time. + _super.call(this, controls.approve, controls.deny) || this; + _this.context = context; + return _this; + } + return Modal; +}(ModalControls)); +// Injected into custom modal components, to allow control of the modal, and access to a context object. +export { Modal }; +//# sourceMappingURL=modal-controls.js.map \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-controls.js.map b/dist/modules/modal/classes/modal-controls.js.map new file mode 100644 index 000000000..7490f7c26 --- /dev/null +++ b/dist/modules/modal/classes/modal-controls.js.map @@ -0,0 +1 @@ +{"version":3,"file":"modal-controls.js","sourceRoot":"","sources":["../../../../src/modules/modal/classes/modal-controls.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA;;AAAA;IACI,uBAAY,OAAsB,EAAE,IAAmB;QACnD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;KACpB;IAED,yFAAyF;;IAClF,+BAAO;;IAAd,UAAe,MAAQ,KAAS;IACzB,4BAAI,GAAX,UAAY,MAAQ,KAAS;wBAZjC;IAaC,CAAA;;AATD,yBASC;;AAGD;;AAAA;IAA4D,yBAAmB;IAG3E,eAAY,QAA4B,EAAE,OAAS;QAAnD;QACI,+EAA+E;QAC/E,yEAAyE;QACzE,kBAAM,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,SAGzC;QADG,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;KAC1B;gBAzBL;EAgB4D,aAAa,EAUxE,CAAA;;AAVD,iBAUC","sourcesContent":["// Shorthand to avoid writing arrow types everywhere.\nexport type ModalResult = (result:T) => void;\n\n// Used to pass ability to control a modal to a component.\nexport class ModalControls {\n constructor(approve:ModalResult, deny:ModalResult) {\n this.approve = approve;\n this.deny = deny;\n }\n\n // Use method here rather than arrow variables to make intellisense show they're methods.\n public approve(result:T):void {}\n public deny(result:U):void {}\n}\n\n// Injected into custom modal components, to allow control of the modal, and access to a context object.\nexport class Modal extends ModalControls {\n public context:T;\n\n constructor(controls:ModalControls, context:T) {\n // Instances of `ModalControls` are only created in the `SuiModal` constructor,\n // so we take an initialised instance rather than remaking one each time.\n super(controls.approve, controls.deny);\n\n this.context = context;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-controls.metadata.json b/dist/modules/modal/classes/modal-controls.metadata.json new file mode 100644 index 000000000..9b8da18ac --- /dev/null +++ b/dist/modules/modal/classes/modal-controls.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"ModalResult":{"__symbolic":"interface"},"ModalControls":{"__symbolic":"class","arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":5,"character":24,"context":{"typeName":"ModalResult"}},{"__symbolic":"error","message":"Could not resolve type","line":5,"character":45,"context":{"typeName":"ModalResult"}}]}],"approve":[{"__symbolic":"method"}],"deny":[{"__symbolic":"method"}]}},"Modal":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ModalControls"},"arity":3,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ModalControls","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":19,"character":39,"context":{"typeName":"U"}},{"__symbolic":"error","message":"Could not resolve type","line":19,"character":42,"context":{"typeName":"V"}}]},{"__symbolic":"error","message":"Could not resolve type","line":19,"character":54,"context":{"typeName":"T"}}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-template.d.ts b/dist/modules/modal/classes/modal-template.d.ts new file mode 100644 index 000000000..a97e54f0b --- /dev/null +++ b/dist/modules/modal/classes/modal-template.d.ts @@ -0,0 +1,7 @@ +import { TemplateRef } from "@angular/core"; +import { ModalControls } from "./modal-controls"; +export declare abstract class ModalTemplate extends TemplateRef<{ + $implicit: T; + modal: ModalControls; +}> { +} diff --git a/dist/modules/modal/classes/modal-template.js b/dist/modules/modal/classes/modal-template.js new file mode 100644 index 000000000..18caa0a96 --- /dev/null +++ b/dist/modules/modal/classes/modal-template.js @@ -0,0 +1,27 @@ +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 __()); + }; +})(); +import { TemplateRef } from "@angular/core"; +// Shorthand for a modal template. Sets up ability to write: `...` +// We use an abstract class as ModalTemplate tends to be used within decorated properties, which means it needs to exist! +var +// Shorthand for a modal template. Sets up ability to write: `...` +// We use an abstract class as ModalTemplate tends to be used within decorated properties, which means it needs to exist! +ModalTemplate = /** @class */ (function (_super) { + __extends(ModalTemplate, _super); + function ModalTemplate() { + return _super !== null && _super.apply(this, arguments) || this; + } + return ModalTemplate; +}(TemplateRef)); +// Shorthand for a modal template. Sets up ability to write: `...` +// We use an abstract class as ModalTemplate tends to be used within decorated properties, which means it needs to exist! +export { ModalTemplate }; +//# sourceMappingURL=modal-template.js.map \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-template.js.map b/dist/modules/modal/classes/modal-template.js.map new file mode 100644 index 000000000..9b4e2500d --- /dev/null +++ b/dist/modules/modal/classes/modal-template.js.map @@ -0,0 +1 @@ +{"version":3,"file":"modal-template.js","sourceRoot":"","sources":["../../../../src/modules/modal/classes/modal-template.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;;AAK5C;;;AAAA;IAAqD,iCAAuD;;;;wBAL5G;EAKqD,WAAW,EAA+C,CAAA;;;AAA/G,yBAA+G","sourcesContent":["import { TemplateRef } from \"@angular/core\";\nimport { ModalControls } from \"./modal-controls\";\n\n// Shorthand for a modal template. Sets up ability to write: `...`\n// We use an abstract class as ModalTemplate tends to be used within decorated properties, which means it needs to exist!\nexport abstract class ModalTemplate extends TemplateRef<{ $implicit:T; modal:ModalControls }> {}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-template.metadata.json b/dist/modules/modal/classes/modal-template.metadata.json new file mode 100644 index 000000000..a9059b174 --- /dev/null +++ b/dist/modules/modal/classes/modal-template.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"ModalTemplate":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","line":5,"character":53},"arity":3}}}] \ No newline at end of file diff --git a/dist/modules/modal/components/modal.d.ts b/dist/modules/modal/components/modal.d.ts new file mode 100644 index 000000000..4c18a93f4 --- /dev/null +++ b/dist/modules/modal/components/modal.d.ts @@ -0,0 +1,46 @@ +import { OnInit, ElementRef, Renderer2, EventEmitter, ViewContainerRef, AfterViewInit } from "@angular/core"; +import { IDynamicClasses, SuiComponentFactory } from "../../../misc/util/index"; +import { TransitionController } from "../../transition/index"; +import { ModalControls, ModalResult } from "../classes/modal-controls"; +import { ModalConfig, ModalSize } from "../classes/modal-config"; +export declare class SuiModal implements OnInit, AfterViewInit { + private _renderer; + private _element; + private _componentFactory; + isClosable: boolean; + closeResult: U; + controls: ModalControls; + readonly approve: ModalResult; + readonly deny: ModalResult; + onApprove: EventEmitter; + onDeny: EventEmitter; + onDismiss: EventEmitter; + private _modalElement; + size: ModalSize; + private _isFullScreen; + isFullScreen: boolean; + isBasic: boolean; + private _mustScroll; + private _mustAlwaysScroll; + mustScroll: boolean; + private _isInverted; + isInverted: boolean; + transitionController: TransitionController; + transition: string; + transitionDuration: number; + dimBackground: boolean; + private _isClosing; + templateSibling: ViewContainerRef; + private _originalContainer?; + readonly dynamicClasses: IDynamicClasses; + constructor(_renderer: Renderer2, _element: ElementRef, _componentFactory: SuiComponentFactory); + ngOnInit(): void; + ngAfterViewInit(): void; + loadConfig(config: ModalConfig): void; + private dismiss(callback?); + close(): void; + private updateScroll(); + onClick(e: MouseEvent): void; + onDocumentKeyUp(e: KeyboardEvent): void; + onDocumentResize(): void; +} diff --git a/dist/modules/modal/components/modal.js b/dist/modules/modal/components/modal.js new file mode 100644 index 000000000..ef3645f95 --- /dev/null +++ b/dist/modules/modal/components/modal.js @@ -0,0 +1,230 @@ +import { Component, Input, ViewChild, ElementRef, Renderer2, EventEmitter, Output, HostListener, ViewContainerRef } from "@angular/core"; +import { Util, KeyCode, SuiComponentFactory } from "../../../misc/util/index"; +import { TransitionController, Transition, TransitionDirection } from "../../transition/index"; +import { ModalControls } from "../classes/modal-controls"; +import { ModalConfig, ModalSize } from "../classes/modal-config"; +var SuiModal = /** @class */ (function () { + function SuiModal(_renderer, _element, _componentFactory) { + var _this = this; + this._renderer = _renderer; + this._element = _element; + this._componentFactory = _componentFactory; + // Initialise with default configuration from `ModalConfig` (to avoid writing defaults twice). + var config = new ModalConfig(); + this.loadConfig(config); + // Event emitters for each of the possible modal outcomes. + this.onApprove = new EventEmitter(); + this.onDeny = new EventEmitter(); + this.onDismiss = new EventEmitter(); + // Initialise controls with actions for the `approve` and `deny` cases. + this.controls = new ModalControls(function (res) { return _this.dismiss(function () { return _this.onApprove.emit(res); }); }, function (res) { return _this.dismiss(function () { return _this.onDeny.emit(res); }); }); + // Internal variable initialisation. + this.dimBackground = false; + this._isClosing = false; + this.transitionController = new TransitionController(false); + } + Object.defineProperty(SuiModal.prototype, "approve", { + get: function () { + return this.controls.approve; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiModal.prototype, "deny", { + get: function () { + return this.controls.deny; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiModal.prototype, "isFullScreen", { + get: + // Value to deny with when closing via `isClosable`. + function () { + return this._isFullScreen; + }, + set: function (fullScreen) { + this._isFullScreen = Util.DOM.parseBooleanAttribute(fullScreen); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiModal.prototype, "mustScroll", { + get: function () { + return this._mustScroll; + }, + set: function (mustScroll) { + this._mustScroll = mustScroll; + // 'Cache' value in _mustAlwaysScroll so that if `true`, _mustScroll isn't ever auto-updated. + this._mustAlwaysScroll = mustScroll; + this.updateScroll(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiModal.prototype, "isInverted", { + get: function () { + return this._isInverted; + }, + set: function (inverted) { + this._isInverted = Util.DOM.parseBooleanAttribute(inverted); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiModal.prototype, "dynamicClasses", { + get: function () { + var classes = {}; + if (this.size) { + classes[this.size] = true; + } + return classes; + }, + enumerable: true, + configurable: true + }); + SuiModal.prototype.ngOnInit = function () { + var _this = this; + // Transition the modal to be visible. + this.transitionController.animate(new Transition(this.transition, this.transitionDuration, TransitionDirection.In)); + setTimeout(function () { return _this.dimBackground = true; }); + }; + SuiModal.prototype.ngAfterViewInit = function () { + var _this = this; + // Move the modal to the document body to ensure correct scrolling. + this._originalContainer = this._element.nativeElement.parentNode; + document.querySelector("body").appendChild(this._element.nativeElement); + // Remove the #templateSibling element from the DOM to fix bottom border styles. + var templateElement = this.templateSibling.element.nativeElement; + if (templateElement.parentNode) { + templateElement.parentNode.removeChild(templateElement); + } + // Update margin offset to center modal correctly on-screen. + var element = this._modalElement.nativeElement; + setTimeout(function () { + _this._renderer.setStyle(element, "margin-top", "-" + element.clientHeight / 2 + "px"); + _this.updateScroll(); + }); + // Focus any element with [autofocus] attribute. + var autoFocus = element.querySelector("[autofocus]"); + if (autoFocus) { + // Autofocus after the browser has had time to process other event handlers. + setTimeout(function () { return autoFocus.focus(); }, 10); + // Try to focus again when the modal has opened so that autofocus works in IE11. + setTimeout(function () { return autoFocus.focus(); }, this.transitionDuration); + } + }; + // Updates the modal with the specified configuration. + // Updates the modal with the specified configuration. + SuiModal.prototype.loadConfig = + // Updates the modal with the specified configuration. + function (config) { + this.isClosable = config.isClosable; + this.closeResult = config.closeResult; + this.size = config.size; + this.isFullScreen = config.isFullScreen; + this.isBasic = config.isBasic; + this.isInverted = config.isInverted; + this.mustScroll = config.mustScroll; + this.transition = config.transition; + this.transitionDuration = config.transitionDuration; + }; + // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. + // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. + SuiModal.prototype.dismiss = + // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. + function (callback) { + var _this = this; + if (callback === void 0) { callback = function () { }; } + // If we aren't currently closing, + if (!this._isClosing) { + this._isClosing = true; + // Transition the modal to be invisible. + this.dimBackground = false; + this.transitionController.stopAll(); + this.transitionController.animate(new Transition(this.transition, this.transitionDuration, TransitionDirection.Out, function () { + // When done, move the modal back to its original location, emit a dismiss event, and fire the callback. + if (_this._originalContainer) { + _this._originalContainer.appendChild(_this._element.nativeElement); + } + _this.onDismiss.emit(); + callback(); + })); + } + }; + // Closes the modal with a 'deny' outcome, using the specified default reason. + // Closes the modal with a 'deny' outcome, using the specified default reason. + SuiModal.prototype.close = + // Closes the modal with a 'deny' outcome, using the specified default reason. + function () { + if (this.isClosable) { + // If we are allowed to close, fire the deny result with the default value. + this.deny(this.closeResult); + } + }; + // Decides whether the modal needs to reposition to allow scrolling. + // Decides whether the modal needs to reposition to allow scrolling. + SuiModal.prototype.updateScroll = + // Decides whether the modal needs to reposition to allow scrolling. + function () { + // Semantic UI modal margin is 3.5rem, which is relative to the global font size, so for compatibility: + var fontSize = parseFloat(window.getComputedStyle(document.documentElement).getPropertyValue("font-size")); + var margin = fontSize * 3.5; + // _mustAlwaysScroll works by stopping _mustScroll from being automatically updated, so it stays `true`. + if (!this._mustAlwaysScroll && this._modalElement) { + var element = this._modalElement.nativeElement; + // The modal must scroll if the window height is smaller than the modal height + both margins. + this._mustScroll = window.innerHeight < element.clientHeight + margin * 2; + } + }; + SuiModal.prototype.onClick = function (e) { + // Makes sense here, as the modal shouldn't be attached to any DOM element. + e.stopPropagation(); + }; + // Document listener is fine here because nobody will enough modals open. + SuiModal.prototype.onDocumentKeyUp = + // Document listener is fine here because nobody will enough modals open. + function (e) { + if (e.keyCode === KeyCode.Escape) { + // Close automatically covers case of `!isClosable`, so check not needed. + this.close(); + } + }; + SuiModal.prototype.onDocumentResize = function () { + this.updateScroll(); + }; + SuiModal.decorators = [ + { type: Component, args: [{ + selector: "sui-modal", + template: "\n\n\n\n \n
\n\n \n \n \n \n \n
\n
\n
\n", + styles: ["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiModal.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + { type: SuiComponentFactory, }, + ]; }; + SuiModal.propDecorators = { + "isClosable": [{ type: Input },], + "closeResult": [{ type: Input },], + "onApprove": [{ type: Output, args: ["approved",] },], + "onDeny": [{ type: Output, args: ["denied",] },], + "onDismiss": [{ type: Output, args: ["dismissed",] },], + "_modalElement": [{ type: ViewChild, args: ["modal",] },], + "size": [{ type: Input },], + "isFullScreen": [{ type: Input },], + "isBasic": [{ type: Input },], + "mustScroll": [{ type: Input },], + "isInverted": [{ type: Input },], + "transition": [{ type: Input },], + "transitionDuration": [{ type: Input },], + "templateSibling": [{ type: ViewChild, args: ["templateSibling", { read: ViewContainerRef },] },], + "onDocumentKeyUp": [{ type: HostListener, args: ["document:keyup", ["$event"],] },], + "onDocumentResize": [{ type: HostListener, args: ["window:resize",] },], + }; + return SuiModal; +}()); +export { SuiModal }; +//# sourceMappingURL=modal.js.map \ No newline at end of file diff --git a/dist/modules/modal/components/modal.js.map b/dist/modules/modal/components/modal.js.map new file mode 100644 index 000000000..cb69ce0cf --- /dev/null +++ b/dist/modules/modal/components/modal.js.map @@ -0,0 +1 @@ +{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../../src/modules/modal/components/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,KAAK,EAAU,SAAS,EAAE,UAAU,EAAE,SAAS,EAC1D,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EACvD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAmB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAe,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;;IAoK7D,kBAAoB,SAAmB,EAAU,QAAmB,EAAU,iBAAqC;QAAnH,iBAmBC;QAnBmB,cAAS,GAAT,SAAS,CAAU;QAAU,aAAQ,GAAR,QAAQ,CAAW;QAAU,sBAAiB,GAAjB,iBAAiB,CAAoB;;QAE/G,IAAM,MAAM,GAAG,IAAI,WAAW,EAAmB,CAAC;QAClD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;;QAGxB,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAK,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,EAAK,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAQ,CAAC;;QAG1C,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,CAC7B,UAAA,GAAG,IAAI,OAAA,KAAI,CAAC,OAAO,CAAC,cAAM,OAAA,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAxB,CAAwB,CAAC,EAA5C,CAA4C,EACnD,UAAA,GAAG,IAAI,OAAA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YZ,CAAC;iBACD;;;;gBAtDoD,SAAS;gBAArB,UAAU;gBAGV,mBAAmB;;;+BAqDvD,KAAK;gCAIL,KAAK;8BAgBL,MAAM,SAAC,UAAU;2BAIjB,MAAM,SAAC,QAAQ;8BAIf,MAAM,SAAC,WAAW;kCAGlB,SAAS,SAAC,OAAO;yBAIjB,KAAK;iCAOL,KAAK;4BAUL,KAAK;+BAQL,KAAK;+BAeL,KAAK;+BAYL,KAAK;uCAIL,KAAK;oCASL,SAAS,SAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;oCAsIvD,YAAY,SAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;qCAQzC,YAAY,SAAC,eAAe;;mBA3SjC;;SAwDa,QAAQ","sourcesContent":["import {\n Component, Input, OnInit, ViewChild, ElementRef, Renderer2,\n EventEmitter, Output, HostListener, ViewContainerRef, AfterViewInit\n} from \"@angular/core\";\nimport { Util, IDynamicClasses, KeyCode, SuiComponentFactory } from \"../../../misc/util/index\";\nimport { TransitionController, Transition, TransitionDirection } from \"../../transition/index\";\nimport { ModalControls, ModalResult } from \"../classes/modal-controls\";\nimport { ModalConfig, ModalSize } from \"../classes/modal-config\";\n\n@Component({\n selector: \"sui-modal\",\n template: `\n\n\n\n \n
\n\n \n \n \n \n \n
\n
\n
\n`,\n styles: [`\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n`]\n})\nexport class SuiModal implements OnInit, AfterViewInit {\n @Input()\n // Determines whether the modal can be closed with a close button, clicking outside, or the escape key.\n public isClosable:boolean;\n\n @Input()\n // Value to deny with when closing via `isClosable`.\n public closeResult:U;\n\n // Separate class for the `approve` and `deny` methods to support passing into components.\n public controls:ModalControls;\n\n public get approve():ModalResult {\n return this.controls.approve;\n }\n\n public get deny():ModalResult {\n return this.controls.deny;\n }\n\n // Fires when the modal closes, after `approve` has been called.\n @Output(\"approved\")\n public onApprove:EventEmitter;\n\n // Fires when the modal closes, after `deny` has been called.\n @Output(\"denied\")\n public onDeny:EventEmitter;\n\n // Fires when the modal closes.\n @Output(\"dismissed\")\n public onDismiss:EventEmitter;\n\n @ViewChild(\"modal\")\n private _modalElement:ElementRef;\n\n // Size used to display the modal.\n @Input()\n public size:ModalSize;\n\n // Whether the modal takes up the full width of the screen.\n private _isFullScreen:boolean;\n\n // Value to deny with when closing via `isClosable`.\n @Input()\n public get isFullScreen():boolean {\n return this._isFullScreen;\n }\n\n public set isFullScreen(fullScreen:boolean) {\n this._isFullScreen = Util.DOM.parseBooleanAttribute(fullScreen);\n }\n\n // Whether or not the modal has basic styles applied.\n @Input()\n public isBasic:boolean;\n\n // Whether the modal currently is displaying a scrollbar.\n private _mustScroll:boolean;\n // Whether or not the modal should always display a scrollbar.\n private _mustAlwaysScroll:boolean;\n\n @Input()\n public get mustScroll():boolean {\n return this._mustScroll;\n }\n\n public set mustScroll(mustScroll:boolean) {\n this._mustScroll = mustScroll;\n // 'Cache' value in _mustAlwaysScroll so that if `true`, _mustScroll isn't ever auto-updated.\n this._mustAlwaysScroll = mustScroll;\n this.updateScroll();\n }\n\n // Whether the modal shows against a light background.\n private _isInverted:boolean;\n\n @Input()\n public get isInverted():boolean {\n return this._isInverted;\n }\n\n public set isInverted(inverted:boolean) {\n this._isInverted = Util.DOM.parseBooleanAttribute(inverted);\n }\n\n public transitionController:TransitionController;\n\n // Transition to display modal with.\n @Input()\n public transition:string;\n\n // Duration of the modal & dimmer transitions.\n @Input()\n public transitionDuration:number;\n\n // Whether or not the backround dimmer is active.\n public dimBackground:boolean;\n // True after `approve` or `deny` has been called.\n private _isClosing:boolean;\n\n // `ViewContainerRef` for the element the template gets injected as a sibling of.\n @ViewChild(\"templateSibling\", { read: ViewContainerRef })\n public templateSibling:ViewContainerRef;\n\n // Parent element of modal before relocation to document body.\n private _originalContainer?:Element;\n\n public get dynamicClasses():IDynamicClasses {\n const classes:IDynamicClasses = {};\n if (this.size) {\n classes[this.size] = true;\n }\n return classes;\n }\n\n constructor(private _renderer:Renderer2, private _element:ElementRef, private _componentFactory:SuiComponentFactory) {\n // Initialise with default configuration from `ModalConfig` (to avoid writing defaults twice).\n const config = new ModalConfig();\n this.loadConfig(config);\n\n // Event emitters for each of the possible modal outcomes.\n this.onApprove = new EventEmitter();\n this.onDeny = new EventEmitter();\n this.onDismiss = new EventEmitter();\n\n // Initialise controls with actions for the `approve` and `deny` cases.\n this.controls = new ModalControls(\n res => this.dismiss(() => this.onApprove.emit(res)),\n res => this.dismiss(() => this.onDeny.emit(res)));\n\n // Internal variable initialisation.\n this.dimBackground = false;\n this._isClosing = false;\n this.transitionController = new TransitionController(false);\n }\n\n public ngOnInit():void {\n // Transition the modal to be visible.\n this.transitionController.animate(new Transition(this.transition, this.transitionDuration, TransitionDirection.In));\n setTimeout(() => this.dimBackground = true);\n }\n\n public ngAfterViewInit():void {\n // Move the modal to the document body to ensure correct scrolling.\n this._originalContainer = this._element.nativeElement.parentNode;\n document.querySelector(\"body\")!.appendChild(this._element.nativeElement);\n // Remove the #templateSibling element from the DOM to fix bottom border styles.\n const templateElement = this.templateSibling.element.nativeElement as Element;\n if (templateElement.parentNode) {\n templateElement.parentNode.removeChild(templateElement);\n }\n\n // Update margin offset to center modal correctly on-screen.\n const element = this._modalElement.nativeElement as Element;\n setTimeout(() => {\n this._renderer.setStyle(element, \"margin-top\", `-${element.clientHeight / 2}px`);\n this.updateScroll();\n });\n\n // Focus any element with [autofocus] attribute.\n const autoFocus = element.querySelector(\"[autofocus]\") as HTMLElement | null;\n if (autoFocus) {\n // Autofocus after the browser has had time to process other event handlers.\n setTimeout(() => autoFocus.focus(), 10);\n // Try to focus again when the modal has opened so that autofocus works in IE11.\n setTimeout(() => autoFocus.focus(), this.transitionDuration);\n }\n }\n\n // Updates the modal with the specified configuration.\n public loadConfig(config:ModalConfig):void {\n this.isClosable = config.isClosable;\n this.closeResult = config.closeResult;\n\n this.size = config.size;\n this.isFullScreen = config.isFullScreen;\n this.isBasic = config.isBasic;\n this.isInverted = config.isInverted;\n\n this.mustScroll = config.mustScroll;\n\n this.transition = config.transition;\n this.transitionDuration = config.transitionDuration;\n }\n\n // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning.\n private dismiss(callback:() => void = () => {}):void {\n // If we aren't currently closing,\n if (!this._isClosing) {\n this._isClosing = true;\n\n // Transition the modal to be invisible.\n this.dimBackground = false;\n this.transitionController.stopAll();\n this.transitionController.animate(\n new Transition(this.transition, this.transitionDuration, TransitionDirection.Out, () => {\n // When done, move the modal back to its original location, emit a dismiss event, and fire the callback.\n if (this._originalContainer) {\n this._originalContainer.appendChild(this._element.nativeElement);\n }\n this.onDismiss.emit();\n callback();\n }));\n }\n }\n\n // Closes the modal with a 'deny' outcome, using the specified default reason.\n public close():void {\n if (this.isClosable) {\n // If we are allowed to close, fire the deny result with the default value.\n this.deny(this.closeResult);\n }\n }\n\n // Decides whether the modal needs to reposition to allow scrolling.\n private updateScroll():void {\n // Semantic UI modal margin is 3.5rem, which is relative to the global font size, so for compatibility:\n const fontSize = parseFloat(window.getComputedStyle(document.documentElement).getPropertyValue(\"font-size\"));\n const margin = fontSize * 3.5;\n\n // _mustAlwaysScroll works by stopping _mustScroll from being automatically updated, so it stays `true`.\n if (!this._mustAlwaysScroll && this._modalElement) {\n const element = this._modalElement.nativeElement as Element;\n\n // The modal must scroll if the window height is smaller than the modal height + both margins.\n this._mustScroll = window.innerHeight < element.clientHeight + margin * 2;\n }\n }\n\n public onClick(e:MouseEvent):void {\n // Makes sense here, as the modal shouldn't be attached to any DOM element.\n e.stopPropagation();\n }\n\n // Document listener is fine here because nobody will enough modals open.\n @HostListener(\"document:keyup\", [\"$event\"])\n public onDocumentKeyUp(e:KeyboardEvent):void {\n if (e.keyCode === KeyCode.Escape) {\n // Close automatically covers case of `!isClosable`, so check not needed.\n this.close();\n }\n }\n\n @HostListener(\"window:resize\")\n public onDocumentResize():void {\n this.updateScroll();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/components/modal.metadata.json b/dist/modules/modal/components/modal.metadata.json new file mode 100644 index 000000000..4e9bd9fc6 --- /dev/null +++ b/dist/modules/modal/components/modal.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiModal":{"__symbolic":"class","arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":9,"character":1},"arguments":[{"selector":"sui-modal","template":"\n\n\n\n \n
\n\n \n \n \n \n \n
\n
\n
\n","styles":["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"]}]}],"members":{"isClosable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":57,"character":5}}]}],"closeResult":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":61,"character":5}}]}],"onApprove":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":77,"character":5},"arguments":["approved"]}]}],"onDeny":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":81,"character":5},"arguments":["denied"]}]}],"onDismiss":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":85,"character":5},"arguments":["dismissed"]}]}],"_modalElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":88,"character":5},"arguments":["modal"]}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":92,"character":5}}]}],"isFullScreen":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":99,"character":5}}]}],"isBasic":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":109,"character":5}}]}],"mustScroll":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":117,"character":5}}]}],"isInverted":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":132,"character":5}}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":144,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":148,"character":5}}]}],"templateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":157,"character":5},"arguments":["templateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":157,"character":42}}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":171,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":171,"character":62},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":171,"character":100}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"loadConfig":[{"__symbolic":"method"}],"dismiss":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"updateScroll":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method"}],"onDocumentKeyUp":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":291,"character":5},"arguments":["document:keyup",["$event"]]}]}],"onDocumentResize":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":299,"character":5},"arguments":["window:resize"]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/modal/index.d.ts b/dist/modules/modal/index.d.ts new file mode 100644 index 000000000..7fb60fe55 --- /dev/null +++ b/dist/modules/modal/index.d.ts @@ -0,0 +1,7 @@ +export * from "./classes/active-modal"; +export * from "./classes/modal-config"; +export * from "./classes/modal-controls"; +export * from "./classes/modal-template"; +export * from "./components/modal"; +export * from "./services/modal.service"; +export * from "./modal.module"; diff --git a/dist/modules/modal/index.js b/dist/modules/modal/index.js new file mode 100644 index 000000000..5c6f95bf6 --- /dev/null +++ b/dist/modules/modal/index.js @@ -0,0 +1,8 @@ +export * from "./classes/active-modal"; +export * from "./classes/modal-config"; +export * from "./classes/modal-controls"; +export * from "./classes/modal-template"; +export * from "./components/modal"; +export * from "./services/modal.service"; +export * from "./modal.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/modal/index.js.map b/dist/modules/modal/index.js.map new file mode 100644 index 000000000..6a5ab2536 --- /dev/null +++ b/dist/modules/modal/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/modal/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,gBAAgB,CAAC","sourcesContent":["export * from \"./classes/active-modal\";\nexport * from \"./classes/modal-config\";\nexport * from \"./classes/modal-controls\";\nexport * from \"./classes/modal-template\";\n\nexport * from \"./components/modal\";\n\nexport * from \"./services/modal.service\";\n\nexport * from \"./modal.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/modal/index.metadata.json b/dist/modules/modal/index.metadata.json new file mode 100644 index 000000000..b79ad135e --- /dev/null +++ b/dist/modules/modal/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/active-modal"},{"from":"./classes/modal-config"},{"from":"./classes/modal-controls"},{"from":"./classes/modal-template"},{"from":"./components/modal"},{"from":"./services/modal.service"},{"from":"./modal.module"}]}] \ No newline at end of file diff --git a/dist/modules/modal/modal.module.d.ts b/dist/modules/modal/modal.module.d.ts new file mode 100644 index 000000000..e91373acc --- /dev/null +++ b/dist/modules/modal/modal.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiModalModule { +} diff --git a/dist/modules/modal/modal.module.js b/dist/modules/modal/modal.module.js new file mode 100644 index 000000000..52c3bdb0a --- /dev/null +++ b/dist/modules/modal/modal.module.js @@ -0,0 +1,38 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiDimmerModule } from "../dimmer/index"; +import { SuiTransitionModule } from "../transition/index"; +import { SuiUtilityModule } from "../../misc/util/index"; +import { SuiModalService } from "./services/modal.service"; +import { SuiModal } from "./components/modal"; +var SuiModalModule = /** @class */ (function () { + function SuiModalModule() { + } + SuiModalModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule, + SuiDimmerModule, + SuiTransitionModule, + SuiUtilityModule + ], + declarations: [ + SuiModal + ], + exports: [ + SuiModal + ], + providers: [ + SuiModalService + ], + entryComponents: [ + SuiModal + ] + },] }, + ]; + /** @nocollapse */ + SuiModalModule.ctorParameters = function () { return []; }; + return SuiModalModule; +}()); +export { SuiModalModule }; +//# sourceMappingURL=modal.module.js.map \ No newline at end of file diff --git a/dist/modules/modal/modal.module.js.map b/dist/modules/modal/modal.module.js.map new file mode 100644 index 000000000..1c0b06951 --- /dev/null +++ b/dist/modules/modal/modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"modal.module.js","sourceRoot":"","sources":["../../../src/modules/modal/modal.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;;;;;gBAE7C,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,eAAe;wBACf,mBAAmB;wBACnB,gBAAgB;qBACnB;oBACD,YAAY,EAAE;wBACV,QAAQ;qBACX;oBACD,OAAO,EAAE;wBACL,QAAQ;qBACX;oBACD,SAAS,EAAE;wBACP,eAAe;qBAClB;oBACD,eAAe,EAAE;wBACb,QAAQ;qBACX;iBACJ;;;;yBA3BD;;SA4Ba,cAAc","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiDimmerModule } from \"../dimmer/index\";\nimport { SuiTransitionModule } from \"../transition/index\";\nimport { SuiUtilityModule } from \"../../misc/util/index\";\nimport { SuiModalService } from \"./services/modal.service\";\nimport { SuiModal } from \"./components/modal\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiDimmerModule,\n SuiTransitionModule,\n SuiUtilityModule\n ],\n declarations: [\n SuiModal\n ],\n exports: [\n SuiModal\n ],\n providers: [\n SuiModalService\n ],\n entryComponents: [\n SuiModal\n ]\n})\nexport class SuiModalModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/modal.module.metadata.json b/dist/modules/modal/modal.module.metadata.json new file mode 100644 index 000000000..e3e4cd35c --- /dev/null +++ b/dist/modules/modal/modal.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiModalModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":8,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":10,"character":8},{"__symbolic":"reference","module":"../dimmer/index","name":"SuiDimmerModule","line":11,"character":8},{"__symbolic":"reference","module":"../transition/index","name":"SuiTransitionModule","line":12,"character":8},{"__symbolic":"reference","module":"../../misc/util/index","name":"SuiUtilityModule","line":13,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/modal","name":"SuiModal","line":16,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/modal","name":"SuiModal","line":19,"character":8}],"providers":[{"__symbolic":"reference","module":"./services/modal.service","name":"SuiModalService","line":22,"character":8}],"entryComponents":[{"__symbolic":"reference","module":"./components/modal","name":"SuiModal","line":25,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/modal/public.d.ts b/dist/modules/modal/public.d.ts new file mode 100644 index 000000000..0777eab8e --- /dev/null +++ b/dist/modules/modal/public.d.ts @@ -0,0 +1 @@ +export { SuiModalModule, SuiModalService, Modal as SuiModal, ModalResult, ModalControls, ActiveModal as SuiActiveModal, ModalConfig, TemplateModalConfig, ComponentModalConfig, ModalTemplate, ModalSize } from "./index"; diff --git a/dist/modules/modal/public.js b/dist/modules/modal/public.js new file mode 100644 index 000000000..68adc35b3 --- /dev/null +++ b/dist/modules/modal/public.js @@ -0,0 +1,2 @@ +export { SuiModalModule, SuiModalService, Modal as SuiModal, ModalControls, ActiveModal as SuiActiveModal, ModalConfig, TemplateModalConfig, ComponentModalConfig, ModalTemplate, ModalSize } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/modal/public.js.map b/dist/modules/modal/public.js.map new file mode 100644 index 000000000..e106ac2cb --- /dev/null +++ b/dist/modules/modal/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/modal/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EACd,eAAe,EACf,KAAK,IAAI,QAAQ,EAEjB,aAAa,EACb,WAAW,IAAI,cAAc,EAC7B,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACZ,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiModalModule,\n SuiModalService,\n Modal as SuiModal,\n ModalResult,\n ModalControls,\n ActiveModal as SuiActiveModal,\n ModalConfig,\n TemplateModalConfig,\n ComponentModalConfig,\n ModalTemplate,\n ModalSize\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/modal/public.metadata.json b/dist/modules/modal/public.metadata.json new file mode 100644 index 000000000..8c81fbf20 --- /dev/null +++ b/dist/modules/modal/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiModalModule","SuiModalService",{"name":"Modal","as":"SuiModal"},"ModalResult","ModalControls",{"name":"ActiveModal","as":"SuiActiveModal"},"ModalConfig","TemplateModalConfig","ComponentModalConfig","ModalTemplate","ModalSize"]}]}] \ No newline at end of file diff --git a/dist/modules/modal/services/modal.service.d.ts b/dist/modules/modal/services/modal.service.d.ts new file mode 100644 index 000000000..535e51488 --- /dev/null +++ b/dist/modules/modal/services/modal.service.d.ts @@ -0,0 +1,8 @@ +import { SuiComponentFactory } from "../../../misc/util/index"; +import { ModalConfig } from "../classes/modal-config"; +import { ActiveModal } from "../classes/active-modal"; +export declare class SuiModalService { + private _componentFactory; + constructor(_componentFactory: SuiComponentFactory); + open(modal: ModalConfig): ActiveModal; +} diff --git a/dist/modules/modal/services/modal.service.js b/dist/modules/modal/services/modal.service.js new file mode 100644 index 000000000..0cc9e45d7 --- /dev/null +++ b/dist/modules/modal/services/modal.service.js @@ -0,0 +1,65 @@ +import { Injectable } from "@angular/core"; +import { SuiComponentFactory } from "../../../misc/util/index"; +import { TemplateModalConfig, ComponentModalConfig } from "../classes/modal-config"; +import { SuiModal } from "../components/modal"; +import { Modal } from "../classes/modal-controls"; +import { ActiveModal } from "../classes/active-modal"; +var SuiModalService = /** @class */ (function () { + function SuiModalService(_componentFactory) { + this._componentFactory = _componentFactory; + } + SuiModalService.prototype.open = function (modal) { + // Generate the modal component to be shown. + var componentRef = this._componentFactory.createComponent(SuiModal); + // Shorthand for the created modal component instance. + var modalComponent = componentRef.instance; + if (modal instanceof TemplateModalConfig) { + // Inject the template into the view. + this._componentFactory.createView(modalComponent.templateSibling, modal.template, { + // `let-context` + $implicit: modal.context, + // `let-modal="modal"` + modal: componentRef.instance.controls + }); + } + else if (modal instanceof ComponentModalConfig) { + // Generate the component to be used as the modal content, + // injecting an instance of `Modal` to be used in the component constructor. + var contentComponentRef = this._componentFactory.createComponent(modal.component, [ + { + provide: Modal, + useValue: new Modal(modalComponent.controls, modal.context) + } + ]); + // Insert the new component into the content of the modal. + this._componentFactory.attachToView(contentComponentRef, modalComponent.templateSibling); + // Shorthand for access to the content component's DOM element. + var contentElement = contentComponentRef.location.nativeElement; + // Move all of the DOM elements inside the component to the main modal element. + // This is done so that CSS classes apply correctly. It does stop any custom styles from working however, + // so other ways may have to be investigated. + while (contentElement.hasChildNodes() && contentElement.parentElement && contentElement.firstChild) { + contentElement.parentElement.appendChild(contentElement.removeChild(contentElement.firstChild)); + } + // Remove the generated component's 'empty shell' from the DOM. + this._componentFactory.detachFromDocument(contentComponentRef); + } + // Attach the new modal component to the application. + // The component will move itself to the document body for correctl styling. + this._componentFactory.attachToApplication(componentRef); + // Initialise the generated modal with the provided config. + modalComponent.loadConfig(modal); + // Return an instance of an `ActiveModal`, so the user can control the new modal. + return new ActiveModal(modal, componentRef); + }; + SuiModalService.decorators = [ + { type: Injectable }, + ]; + /** @nocollapse */ + SuiModalService.ctorParameters = function () { return [ + { type: SuiComponentFactory, }, + ]; }; + return SuiModalService; +}()); +export { SuiModalService }; +//# sourceMappingURL=modal.service.js.map \ No newline at end of file diff --git a/dist/modules/modal/services/modal.service.js.map b/dist/modules/modal/services/modal.service.js.map new file mode 100644 index 000000000..d8f6e9d74 --- /dev/null +++ b/dist/modules/modal/services/modal.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"modal.service.js","sourceRoot":"","sources":["../../../../src/modules/modal/services/modal.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAe,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;;IAIlD,yBAAoB,iBAAqC;QAArC,sBAAiB,GAAjB,iBAAiB,CAAoB;KAAI;IAEtD,8BAAI,GAAX,UAAqB,KAA0B;;QAE3C,IAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAiB,QAAQ,CAAC,CAAC;;QAGtF,IAAM,cAAc,GAAG,YAAY,CAAC,QAAQ,CAAC;QAE7C,EAAE,CAAC,CAAC,KAAK,YAAY,mBAAmB,CAAC,CAAC,CAAC;;YAEvC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,cAAc,CAAC,eAAe,EAAE,KAAK,CAAC,QAAQ,EAAE;;gBAE9E,SAAS,EAAE,KAAK,CAAC,OAAO;;gBAExB,KAAK,EAAE,YAAY,CAAC,QAAQ,CAAC,QAAQ;aACxC,CAAC,CAAC;SACN;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,YAAY,oBAAoB,CAAC,CAAC,CAAC;;;YAG/C,IAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAC9D,KAAK,CAAC,SAAS,EACf;gBACI;oBACI,OAAO,EAAE,KAAK;oBACd,QAAQ,EAAE,IAAI,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC;iBAC9D;aACJ,CACJ,CAAC;;YAGF,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,mBAAmB,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;;YAGzF,IAAM,cAAc,GAAG,mBAAmB,CAAC,QAAQ,CAAC,aAAwB,CAAC;;;;YAK7E,OAAO,cAAc,CAAC,aAAa,EAAE,IAAI,cAAc,CAAC,aAAa,IAAI,cAAc,CAAC,UAAU,EAAE,CAAC;gBACjG,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,cAAc,CAAC,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;aACnG;;YAED,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;SAClE;;;QAID,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;;QAGzD,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;;QAGjC,MAAM,CAAC,IAAI,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;KAC/C;;gBAzDJ,UAAU;;;;gBANF,mBAAmB;;0BAD5B;;SAQa,eAAe","sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { SuiComponentFactory } from \"../../../misc/util/index\";\nimport { ModalConfig, TemplateModalConfig, ComponentModalConfig } from \"../classes/modal-config\";\nimport { SuiModal } from \"../components/modal\";\nimport { Modal } from \"../classes/modal-controls\";\nimport { ActiveModal } from \"../classes/active-modal\";\n\n@Injectable()\nexport class SuiModalService {\n constructor(private _componentFactory:SuiComponentFactory) {}\n\n public open(modal:ModalConfig):ActiveModal {\n // Generate the modal component to be shown.\n const componentRef = this._componentFactory.createComponent>(SuiModal);\n\n // Shorthand for the created modal component instance.\n const modalComponent = componentRef.instance;\n\n if (modal instanceof TemplateModalConfig) {\n // Inject the template into the view.\n this._componentFactory.createView(modalComponent.templateSibling, modal.template, {\n // `let-context`\n $implicit: modal.context,\n // `let-modal=\"modal\"`\n modal: componentRef.instance.controls\n });\n } else if (modal instanceof ComponentModalConfig) {\n // Generate the component to be used as the modal content,\n // injecting an instance of `Modal` to be used in the component constructor.\n const contentComponentRef = this._componentFactory.createComponent(\n modal.component,\n [\n {\n provide: Modal,\n useValue: new Modal(modalComponent.controls, modal.context)\n }\n ]\n );\n\n // Insert the new component into the content of the modal.\n this._componentFactory.attachToView(contentComponentRef, modalComponent.templateSibling);\n\n // Shorthand for access to the content component's DOM element.\n const contentElement = contentComponentRef.location.nativeElement as Element;\n\n // Move all of the DOM elements inside the component to the main modal element.\n // This is done so that CSS classes apply correctly. It does stop any custom styles from working however,\n // so other ways may have to be investigated.\n while (contentElement.hasChildNodes() && contentElement.parentElement && contentElement.firstChild) {\n contentElement.parentElement.appendChild(contentElement.removeChild(contentElement.firstChild));\n }\n // Remove the generated component's 'empty shell' from the DOM.\n this._componentFactory.detachFromDocument(contentComponentRef);\n }\n\n // Attach the new modal component to the application.\n // The component will move itself to the document body for correctl styling.\n this._componentFactory.attachToApplication(componentRef);\n\n // Initialise the generated modal with the provided config.\n modalComponent.loadConfig(modal);\n\n // Return an instance of an `ActiveModal`, so the user can control the new modal.\n return new ActiveModal(modal, componentRef);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/services/modal.service.metadata.json b/dist/modules/modal/services/modal.service.metadata.json new file mode 100644 index 000000000..9ca6676c0 --- /dev/null +++ b/dist/modules/modal/services/modal.service.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiModalService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":7,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":9,"character":42}]}],"open":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-component-controller.d.ts b/dist/modules/popup/classes/popup-component-controller.d.ts new file mode 100644 index 000000000..940a0bd3a --- /dev/null +++ b/dist/modules/popup/classes/popup-component-controller.d.ts @@ -0,0 +1,12 @@ +import { ElementRef, Type, Renderer2 } from "@angular/core"; +import { SuiComponentFactory } from "../../../misc/util/index"; +import { SuiPopupController } from "./popup-controller"; +import { PopupConfig } from "./popup-config"; +export declare class SuiPopupComponentController extends SuiPopupController { + private _component; + private _contentComponentRef?; + readonly componentInstance: T | undefined; + constructor(renderer: Renderer2, element: ElementRef, componentFactory: SuiComponentFactory, _component: Type, config: PopupConfig); + open(): void; + protected cleanup(): void; +} diff --git a/dist/modules/popup/classes/popup-component-controller.js b/dist/modules/popup/classes/popup-component-controller.js new file mode 100644 index 000000000..76327e848 --- /dev/null +++ b/dist/modules/popup/classes/popup-component-controller.js @@ -0,0 +1,45 @@ +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 __()); + }; +})(); +import { SuiPopupController } from "./popup-controller"; +var SuiPopupComponentController = /** @class */ (function (_super) { + __extends(SuiPopupComponentController, _super); + function SuiPopupComponentController(renderer, element, componentFactory, _component, config) { + var _this = _super.call(this, renderer, element, componentFactory, config) || this; + _this._component = _component; + return _this; + } + Object.defineProperty(SuiPopupComponentController.prototype, "componentInstance", { + get: function () { + if (this._contentComponentRef) { + return this._contentComponentRef.instance; + } + }, + enumerable: true, + configurable: true + }); + SuiPopupComponentController.prototype.open = function () { + if (!this._contentComponentRef) { + this._contentComponentRef = this._componentFactory.createComponent(this._component); + this._componentFactory.attachToView(this._contentComponentRef, this.popup.templateSibling); + } + _super.prototype.open.call(this); + }; + SuiPopupComponentController.prototype.cleanup = function () { + _super.prototype.cleanup.call(this); + if (this._contentComponentRef) { + this._contentComponentRef.destroy(); + this._contentComponentRef = undefined; + } + }; + return SuiPopupComponentController; +}(SuiPopupController)); +export { SuiPopupComponentController }; +//# sourceMappingURL=popup-component-controller.js.map \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-component-controller.js.map b/dist/modules/popup/classes/popup-component-controller.js.map new file mode 100644 index 000000000..462769fef --- /dev/null +++ b/dist/modules/popup/classes/popup-component-controller.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popup-component-controller.js","sourceRoot":"","sources":["../../../../src/modules/popup/classes/popup-component-controller.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,IAAA;IAAoD,+CAAkB;IAUlE,qCAAY,QAAkB,EAClB,OAAkB,EAClB,gBAAoC,EAC5B,UAAkB,EAC1B,MAAkB;QAJ9B,YAMI,kBAAM,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC,SACrD;QAJmB,gBAAU,GAAV,UAAU,CAAQ;;KAIrC;IAbD,sBAAW,0DAAiB;aAA5B;YACI,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;gBAC5B,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC;aAC7C;SACJ;;;OAAA;IAWM,0CAAI,GAAX;QACI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;YAC7B,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,UAAqB,CAAC,CAAC;YAC/F,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;SAC9F;QAED,iBAAM,IAAI,WAAE,CAAC;KAChB;IAES,6CAAO,GAAjB;QACI,iBAAM,OAAO,WAAE,CAAC;QAEhB,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;YAC5B,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC;YACpC,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;SACzC;KACJ;sCAxCL;EAKoD,kBAAkB,EAoCrE,CAAA;AApCD,uCAoCC","sourcesContent":["import { ComponentRef, ElementRef, Type, Renderer2, OnDestroy } from \"@angular/core\";\nimport { SuiComponentFactory } from \"../../../misc/util/index\";\nimport { SuiPopupController } from \"./popup-controller\";\nimport { PopupConfig } from \"./popup-config\";\n\nexport class SuiPopupComponentController extends SuiPopupController {\n // Stores reference to generated content component.\n private _contentComponentRef?:ComponentRef;\n\n public get componentInstance():T | undefined {\n if (this._contentComponentRef) {\n return this._contentComponentRef.instance;\n }\n }\n\n constructor(renderer:Renderer2,\n element:ElementRef,\n componentFactory:SuiComponentFactory,\n private _component:Type,\n config:PopupConfig) {\n\n super(renderer, element, componentFactory, config);\n }\n\n public open():void {\n if (!this._contentComponentRef) {\n this._contentComponentRef = this._componentFactory.createComponent(this._component as Type);\n this._componentFactory.attachToView(this._contentComponentRef, this.popup.templateSibling);\n }\n\n super.open();\n }\n\n protected cleanup():void {\n super.cleanup();\n\n if (this._contentComponentRef) {\n this._contentComponentRef.destroy();\n this._contentComponentRef = undefined;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-component-controller.metadata.json b/dist/modules/popup/classes/popup-component-controller.metadata.json new file mode 100644 index 000000000..c787c0d1a --- /dev/null +++ b/dist/modules/popup/classes/popup-component-controller.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiPopupComponentController":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./popup-controller","name":"SuiPopupController","line":5,"character":52},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":15,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":16,"character":24},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":17,"character":33},{"__symbolic":"reference","module":"@angular/core","name":"Type","line":18,"character":35,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":18,"character":40,"context":{"typeName":"T"}}]},{"__symbolic":"reference","module":"./popup-config","name":"PopupConfig","line":19,"character":23}]}],"open":[{"__symbolic":"method"}],"cleanup":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-config.d.ts b/dist/modules/popup/classes/popup-config.d.ts new file mode 100644 index 000000000..9c471c590 --- /dev/null +++ b/dist/modules/popup/classes/popup-config.d.ts @@ -0,0 +1,32 @@ +import { PositioningPlacement } from "../../../misc/util/index"; +export declare type PopupTrigger = "hover" | "click" | "outsideClick" | "focus" | "manual"; +export declare const PopupTrigger: { + Hover: PopupTrigger; + Click: PopupTrigger; + OutsideClick: PopupTrigger; + Focus: PopupTrigger; + Manual: PopupTrigger; +}; +export interface IPopupConfig { + header?: string; + text?: string; + placement?: PositioningPlacement; + trigger?: PopupTrigger; + isInverted?: boolean; + delay?: number; + isBasic?: boolean; + transition?: string; + transitionDuration?: number; +} +export declare class PopupConfig implements IPopupConfig { + header?: string; + text?: string; + placement: PositioningPlacement; + trigger: PopupTrigger; + isInverted: boolean; + delay: number; + isBasic: boolean; + transition: string; + transitionDuration: number; + constructor(defaults?: IPopupConfig); +} diff --git a/dist/modules/popup/classes/popup-config.js b/dist/modules/popup/classes/popup-config.js new file mode 100644 index 000000000..dd546d26b --- /dev/null +++ b/dist/modules/popup/classes/popup-config.js @@ -0,0 +1,24 @@ +import { PositioningPlacement } from "../../../misc/util/index"; +export var PopupTrigger = { + Hover: "hover", + Click: "click", + OutsideClick: "outsideClick", + Focus: "focus", + Manual: "manual" +}; +var PopupConfig = /** @class */ (function () { + function PopupConfig(defaults) { + if (defaults === void 0) { defaults = {}; } + this.placement = PositioningPlacement.TopLeft; + this.trigger = PopupTrigger.Hover; + this.isInverted = false; + this.delay = 0; + this.isBasic = false; + this.transition = "scale"; + this.transitionDuration = 200; + Object.assign(this, defaults); + } + return PopupConfig; +}()); +export { PopupConfig }; +//# sourceMappingURL=popup-config.js.map \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-config.js.map b/dist/modules/popup/classes/popup-config.js.map new file mode 100644 index 000000000..3eb53b4bb --- /dev/null +++ b/dist/modules/popup/classes/popup-config.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popup-config.js","sourceRoot":"","sources":["../../../../src/modules/popup/classes/popup-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAKrF,MAAM,CAAC,IAAM,YAAY,GAAG;IACxB,KAAK,EAAE,OAAuB;IAC9B,KAAK,EAAE,OAAuB;IAC9B,YAAY,EAAE,cAA8B;IAC5C,KAAK,EAAE,OAAuB;IAC9B,MAAM,EAAE,QAAwB;CACnC,CAAC;AAcF,IAAA;IAWI,qBAAY,QAA0B;QAA1B,yBAAA,EAAA,aAA0B;QAClC,IAAI,CAAC,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;QAC1B,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC;QAE9B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACjC;sBA/CL;IAgDC,CAAA;AAtBD,uBAsBC","sourcesContent":["import { TemplateRef } from \"@angular/core\";\nimport { ITemplateRefContext, PositioningPlacement } from \"../../../misc/util/index\";\nimport { IPopup } from \"./popup-controller\";\n\nexport type PopupTrigger = \"hover\" | \"click\" | \"outsideClick\" | \"focus\" | \"manual\";\n\nexport const PopupTrigger = {\n Hover: \"hover\" as PopupTrigger,\n Click: \"click\" as PopupTrigger,\n OutsideClick: \"outsideClick\" as PopupTrigger,\n Focus: \"focus\" as PopupTrigger,\n Manual: \"manual\" as PopupTrigger\n};\n\nexport interface IPopupConfig {\n header?:string;\n text?:string;\n placement?:PositioningPlacement;\n trigger?:PopupTrigger;\n isInverted?:boolean;\n delay?:number;\n isBasic?:boolean;\n transition?:string;\n transitionDuration?:number;\n}\n\nexport class PopupConfig implements IPopupConfig {\n public header?:string;\n public text?:string;\n public placement:PositioningPlacement;\n public trigger:PopupTrigger;\n public isInverted:boolean;\n public delay:number;\n public isBasic:boolean;\n public transition:string;\n public transitionDuration:number;\n\n constructor(defaults:IPopupConfig = {}) {\n this.placement = PositioningPlacement.TopLeft;\n this.trigger = PopupTrigger.Hover;\n this.isInverted = false;\n this.delay = 0;\n this.isBasic = false;\n this.transition = \"scale\";\n this.transitionDuration = 200;\n\n Object.assign(this, defaults);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-config.metadata.json b/dist/modules/popup/classes/popup-config.metadata.json new file mode 100644 index 000000000..e50cfb0b6 --- /dev/null +++ b/dist/modules/popup/classes/popup-config.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"PopupTrigger":{"Hover":"hover","Click":"click","OutsideClick":"outsideClick","Focus":"focus","Manual":"manual"},"IPopupConfig":{"__symbolic":"interface"},"PopupConfig":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-controller.d.ts b/dist/modules/popup/classes/popup-controller.d.ts new file mode 100644 index 000000000..5ba43c7c5 --- /dev/null +++ b/dist/modules/popup/classes/popup-controller.d.ts @@ -0,0 +1,32 @@ +import { ElementRef, OnDestroy, Renderer2 } from "@angular/core"; +import { SuiComponentFactory } from "../../../misc/util/index"; +import { PopupConfig, IPopupConfig } from "./popup-config"; +import { SuiPopup } from "../components/popup"; +export interface IPopup { + open(): void; + close(): void; + toggle(): void; +} +export declare abstract class SuiPopupController implements IPopup, OnDestroy { + protected _element: ElementRef; + protected _componentFactory: SuiComponentFactory; + private _componentRef; + readonly popup: SuiPopup; + private _openingTimeout; + private _documentListener; + constructor(renderer: Renderer2, _element: ElementRef, _componentFactory: SuiComponentFactory, config: PopupConfig); + configure(config?: IPopupConfig): void; + openDelayed(): void; + open(): void; + close(): void; + toggleDelayed(): void; + toggle(): void; + private onMouseEnter(); + private onMouseLeave(); + private onClick(); + onDocumentClick(e: MouseEvent): void; + private onFocusIn(); + private onFocusOut(e); + protected cleanup(): void; + ngOnDestroy(): void; +} diff --git a/dist/modules/popup/classes/popup-controller.js b/dist/modules/popup/classes/popup-controller.js new file mode 100644 index 000000000..367f9119b --- /dev/null +++ b/dist/modules/popup/classes/popup-controller.js @@ -0,0 +1,149 @@ +import { HostListener } from "@angular/core"; +import { PopupTrigger } from "./popup-config"; +import { SuiPopup } from "../components/popup"; +var SuiPopupController = /** @class */ (function () { + function SuiPopupController(renderer, _element, _componentFactory, config) { + var _this = this; + this._element = _element; + this._componentFactory = _componentFactory; + // Generate a new SuiPopup component and attach it to the application view. + this._componentRef = this._componentFactory.createComponent(SuiPopup); + // Configure popup with provided config. + this.popup.config = config; + // When the popup is closed (onClose fires on animation complete), + this.popup.onClose.subscribe(function () { return _this.cleanup(); }); + this._documentListener = renderer.listen("document", "click", function (e) { return _this.onDocumentClick(e); }); + } + Object.defineProperty(SuiPopupController.prototype, "popup", { + // Returns generated popup instance. + get: + // Returns generated popup instance. + function () { + // Use non-null assertion as we only access this when a popup exists. + return this._componentRef.instance; + }, + enumerable: true, + configurable: true + }); + SuiPopupController.prototype.configure = function (config) { + if (config) { + Object.assign(this.popup.config, config); + } + }; + SuiPopupController.prototype.openDelayed = function () { + var _this = this; + // Cancel the opening timer. + clearTimeout(this._openingTimeout); + // Start the popup opening after the specified delay interval. + this._openingTimeout = window.setTimeout(function () { return _this.open(); }, this.popup.config.delay); + }; + SuiPopupController.prototype.open = function () { + // Attach the generated component to the current application. + this._componentFactory.attachToApplication(this._componentRef); + // Move the generated element to the body to avoid any positioning issues. + this._componentFactory.moveToDocumentBody(this._componentRef); + // Attach a reference to the anchor element. We do it here because IE11 loves to complain. + this.popup.anchor = this._element; + // Start popup open transition. + this.popup.open(); + // Call lifecyle hook + var lifecycle = this.popupOnOpen; + if (lifecycle) { + lifecycle.call(this); + } + }; + SuiPopupController.prototype.close = function () { + // Cancel the opening timer to stop the popup opening after close has been called. + clearTimeout(this._openingTimeout); + if (this._componentRef) { + // Start popup close transition. + this.popup.close(); + } + // Call lifecyle hook + var lifecycle = this.popupOnClose; + if (lifecycle) { + lifecycle.call(this); + } + }; + SuiPopupController.prototype.toggleDelayed = function () { + // If the popup hasn't been created, or it has but it isn't currently open, open the popup. + if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) { + return this.openDelayed(); + } + // O'wise, close it. + return this.close(); + }; + SuiPopupController.prototype.toggle = function () { + // If the popup hasn't been created, or it has but it isn't currently open, open the popup. + if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) { + return this.open(); + } + // O'wise, close it. + return this.close(); + }; + SuiPopupController.prototype.onMouseEnter = function () { + if (this.popup.config.trigger === PopupTrigger.Hover) { + this.openDelayed(); + } + }; + SuiPopupController.prototype.onMouseLeave = function () { + if (this.popup.config.trigger === PopupTrigger.Hover) { + this.close(); + } + }; + SuiPopupController.prototype.onClick = function () { + if (this.popup.config.trigger === PopupTrigger.Click || + this.popup.config.trigger === PopupTrigger.OutsideClick) { + // Repeated clicks require a toggle, rather than just opening the popup each time. + this.toggleDelayed(); + } + else if (this.popup.config.trigger === PopupTrigger.Focus && + (!this._componentRef || (this._componentRef && !this.popup.isOpen))) { + // Repeated clicks with a focus trigger requires an open (as focus isn't ever lost on repeated click). + this.openDelayed(); + } + }; + SuiPopupController.prototype.onDocumentClick = function (e) { + // If the popup trigger is outside click, + if (this._componentRef && this.popup.config.trigger === PopupTrigger.OutsideClick) { + var target = e.target; + // Close the popup if the click is outside of the popup element. + if (!this._element.nativeElement.contains(target)) { + this.close(); + } + } + }; + SuiPopupController.prototype.onFocusIn = function () { + if (this.popup.config.trigger === PopupTrigger.Focus) { + this.openDelayed(); + } + }; + SuiPopupController.prototype.onFocusOut = function (e) { + if (!this._element.nativeElement.contains(e.relatedTarget) && + !this.popup.elementRef.nativeElement.contains(e.relatedTarget) && + this.popup.config.trigger === PopupTrigger.Focus) { + this.close(); + } + }; + SuiPopupController.prototype.cleanup = function () { + clearTimeout(this._openingTimeout); + if (this._componentRef.instance && this._componentRef.instance.positioningService) { + this._componentRef.instance.positioningService.destroy(); + } + this._componentFactory.detachFromApplication(this._componentRef); + }; + SuiPopupController.prototype.ngOnDestroy = function () { + this.cleanup(); + this._documentListener(); + }; + SuiPopupController.propDecorators = { + "onMouseEnter": [{ type: HostListener, args: ["mouseenter",] },], + "onMouseLeave": [{ type: HostListener, args: ["mouseleave",] },], + "onClick": [{ type: HostListener, args: ["click",] },], + "onFocusIn": [{ type: HostListener, args: ["focusin",] },], + "onFocusOut": [{ type: HostListener, args: ["focusout", ["$event"],] },], + }; + return SuiPopupController; +}()); +export { SuiPopupController }; +//# sourceMappingURL=popup-controller.js.map \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-controller.js.map b/dist/modules/popup/classes/popup-controller.js.map new file mode 100644 index 000000000..bdca88f42 --- /dev/null +++ b/dist/modules/popup/classes/popup-controller.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popup-controller.js","sourceRoot":"","sources":["../../../../src/modules/popup/classes/popup-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAwB,MAAM,eAAe,CAAC;AAE7F,OAAO,EAAe,YAAY,EAAgB,MAAM,gB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AC,QAAQ,CAAC;;6BAjKxC;;SAYsB,kBAAkB","sourcesContent":["import { ComponentRef, ElementRef, HostListener, OnDestroy, Renderer2 } from \"@angular/core\";\nimport { SuiComponentFactory } from \"../../../misc/util/index\";\nimport { PopupConfig, PopupTrigger, IPopupConfig } from \"./popup-config\";\nimport { SuiPopup } from \"../components/popup\";\nimport { IPopupLifecycle } from \"./popup-lifecycle\";\n\nexport interface IPopup {\n open():void;\n close():void;\n toggle():void;\n}\n\nexport abstract class SuiPopupController implements IPopup, OnDestroy {\n // Stores reference to generated popup component.\n private _componentRef:ComponentRef;\n\n // Returns generated popup instance.\n public get popup():SuiPopup {\n // Use non-null assertion as we only access this when a popup exists.\n return this._componentRef.instance;\n }\n\n // `setTimeout` timer pointer for delayed popup open.\n private _openingTimeout:number;\n\n // Function to remove the document click handler.\n private _documentListener:() => void;\n\n constructor(renderer:Renderer2,\n protected _element:ElementRef,\n protected _componentFactory:SuiComponentFactory,\n config:PopupConfig) {\n\n // Generate a new SuiPopup component and attach it to the application view.\n this._componentRef = this._componentFactory.createComponent(SuiPopup);\n\n // Configure popup with provided config.\n this.popup.config = config;\n\n // When the popup is closed (onClose fires on animation complete),\n this.popup.onClose.subscribe(() => this.cleanup());\n\n this._documentListener = renderer.listen(\"document\", \"click\", (e:MouseEvent) => this.onDocumentClick(e));\n }\n\n public configure(config?:IPopupConfig):void {\n if (config) {\n Object.assign(this.popup.config, config);\n }\n }\n\n public openDelayed():void {\n // Cancel the opening timer.\n clearTimeout(this._openingTimeout);\n\n // Start the popup opening after the specified delay interval.\n this._openingTimeout = window.setTimeout(() => this.open(), this.popup.config.delay);\n }\n\n public open():void {\n // Attach the generated component to the current application.\n this._componentFactory.attachToApplication(this._componentRef);\n\n // Move the generated element to the body to avoid any positioning issues.\n this._componentFactory.moveToDocumentBody(this._componentRef);\n\n // Attach a reference to the anchor element. We do it here because IE11 loves to complain.\n this.popup.anchor = this._element;\n\n // Start popup open transition.\n this.popup.open();\n\n // Call lifecyle hook\n const lifecycle = (this as IPopupLifecycle).popupOnOpen;\n if (lifecycle) {\n lifecycle.call(this);\n }\n }\n\n public close():void {\n // Cancel the opening timer to stop the popup opening after close has been called.\n clearTimeout(this._openingTimeout);\n\n if (this._componentRef) {\n // Start popup close transition.\n this.popup.close();\n }\n\n // Call lifecyle hook\n const lifecycle = (this as IPopupLifecycle).popupOnClose;\n if (lifecycle) {\n lifecycle.call(this);\n }\n }\n\n public toggleDelayed():void {\n // If the popup hasn't been created, or it has but it isn't currently open, open the popup.\n if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) {\n return this.openDelayed();\n }\n\n // O'wise, close it.\n return this.close();\n }\n\n public toggle():void {\n // If the popup hasn't been created, or it has but it isn't currently open, open the popup.\n if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) {\n return this.open();\n }\n\n // O'wise, close it.\n return this.close();\n }\n\n @HostListener(\"mouseenter\")\n private onMouseEnter():void {\n if (this.popup.config.trigger === PopupTrigger.Hover) {\n this.openDelayed();\n }\n }\n\n @HostListener(\"mouseleave\")\n private onMouseLeave():void {\n if (this.popup.config.trigger === PopupTrigger.Hover) {\n this.close();\n }\n }\n\n @HostListener(\"click\")\n private onClick():void {\n if (this.popup.config.trigger === PopupTrigger.Click ||\n this.popup.config.trigger === PopupTrigger.OutsideClick) {\n\n // Repeated clicks require a toggle, rather than just opening the popup each time.\n this.toggleDelayed();\n } else if (this.popup.config.trigger === PopupTrigger.Focus &&\n (!this._componentRef || (this._componentRef && !this.popup.isOpen))) {\n // Repeated clicks with a focus trigger requires an open (as focus isn't ever lost on repeated click).\n this.openDelayed();\n }\n }\n\n public onDocumentClick(e:MouseEvent):void {\n // If the popup trigger is outside click,\n if (this._componentRef && this.popup.config.trigger === PopupTrigger.OutsideClick) {\n const target = e.target as Element;\n // Close the popup if the click is outside of the popup element.\n if (!(this._element.nativeElement as Element).contains(target)) {\n this.close();\n }\n }\n }\n\n @HostListener(\"focusin\")\n private onFocusIn():void {\n if (this.popup.config.trigger === PopupTrigger.Focus) {\n this.openDelayed();\n }\n }\n\n @HostListener(\"focusout\", [\"$event\"])\n private onFocusOut(e:any):void {\n if (!this._element.nativeElement.contains(e.relatedTarget) &&\n !this.popup.elementRef.nativeElement.contains(e.relatedTarget) &&\n this.popup.config.trigger === PopupTrigger.Focus) {\n\n this.close();\n }\n }\n\n protected cleanup():void {\n clearTimeout(this._openingTimeout);\n\n if (this._componentRef.instance && this._componentRef.instance.positioningService) {\n this._componentRef.instance.positioningService.destroy();\n }\n\n this._componentFactory.detachFromApplication(this._componentRef);\n }\n\n public ngOnDestroy():void {\n this.cleanup();\n\n this._documentListener();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-controller.metadata.json b/dist/modules/popup/classes/popup-controller.metadata.json new file mode 100644 index 000000000..9a828c227 --- /dev/null +++ b/dist/modules/popup/classes/popup-controller.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"IPopup":{"__symbolic":"interface"},"SuiPopupController":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":28,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":29,"character":35},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":30,"character":44},{"__symbolic":"reference","module":"./popup-config","name":"PopupConfig","line":31,"character":23}]}],"configure":[{"__symbolic":"method"}],"openDelayed":[{"__symbolic":"method"}],"open":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"toggleDelayed":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"onMouseEnter":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":115,"character":5},"arguments":["mouseenter"]}]}],"onMouseLeave":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":122,"character":5},"arguments":["mouseleave"]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":129,"character":5},"arguments":["click"]}]}],"onDocumentClick":[{"__symbolic":"method"}],"onFocusIn":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":154,"character":5},"arguments":["focusin"]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":161,"character":5},"arguments":["focusout",["$event"]]}]}],"cleanup":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-lifecycle.d.ts b/dist/modules/popup/classes/popup-lifecycle.d.ts new file mode 100644 index 000000000..bffa28df2 --- /dev/null +++ b/dist/modules/popup/classes/popup-lifecycle.d.ts @@ -0,0 +1,10 @@ +export interface PopupAfterOpen { + popupOnOpen(): void; +} +export interface PopupAfterClose { + popupOnClose(): void; +} +export interface IPopupLifecycle { + popupOnOpen?(): void; + popupOnClose?(): void; +} diff --git a/dist/modules/popup/classes/popup-lifecycle.js b/dist/modules/popup/classes/popup-lifecycle.js new file mode 100644 index 000000000..f6aaf6815 --- /dev/null +++ b/dist/modules/popup/classes/popup-lifecycle.js @@ -0,0 +1 @@ +//# sourceMappingURL=popup-lifecycle.js.map \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-lifecycle.js.map b/dist/modules/popup/classes/popup-lifecycle.js.map new file mode 100644 index 000000000..56ee220ee --- /dev/null +++ b/dist/modules/popup/classes/popup-lifecycle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popup-lifecycle.js","sourceRoot":"","sources":["../../../../src/modules/popup/classes/popup-lifecycle.ts"],"names":[],"mappings":"","sourcesContent":["// tslint:disable-next-line:ext-variable-name\nexport interface PopupAfterOpen {\n popupOnOpen():void;\n}\n\n// tslint:disable-next-line:ext-variable-name\nexport interface PopupAfterClose {\n popupOnClose():void;\n}\n\nexport interface IPopupLifecycle {\n popupOnOpen?():void;\n popupOnClose?():void;\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-lifecycle.metadata.json b/dist/modules/popup/classes/popup-lifecycle.metadata.json new file mode 100644 index 000000000..09a84c47d --- /dev/null +++ b/dist/modules/popup/classes/popup-lifecycle.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"PopupAfterOpen":{"__symbolic":"interface"},"PopupAfterClose":{"__symbolic":"interface"},"IPopupLifecycle":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-template-controller.d.ts b/dist/modules/popup/classes/popup-template-controller.d.ts new file mode 100644 index 000000000..de608a964 --- /dev/null +++ b/dist/modules/popup/classes/popup-template-controller.d.ts @@ -0,0 +1,22 @@ +import { TemplateRef, Renderer2, ElementRef } from "@angular/core"; +import { SuiPopupController, IPopup } from "./popup-controller"; +import { SuiComponentFactory, IImplicitContext } from "../../../misc/util"; +import { PopupConfig, IPopupConfig } from "./popup-config"; +export interface ITemplatePopupContext extends IImplicitContext { + context?: T; +} +export interface ITemplatePopupConfig extends IPopupConfig { + template?: TemplateRef>; + context?: T; +} +export declare class TemplatePopupConfig extends PopupConfig { + template?: TemplateRef>; + context?: T; +} +export declare class SuiPopupTemplateController extends SuiPopupController { + template?: TemplateRef>; + context?: T; + constructor(renderer: Renderer2, element: ElementRef, componentFactory: SuiComponentFactory, config: PopupConfig); + configure(config?: ITemplatePopupConfig): void; + open(): void; +} diff --git a/dist/modules/popup/classes/popup-template-controller.js b/dist/modules/popup/classes/popup-template-controller.js new file mode 100644 index 000000000..eea1ddb93 --- /dev/null +++ b/dist/modules/popup/classes/popup-template-controller.js @@ -0,0 +1,49 @@ +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 __()); + }; +})(); +import { TemplateRef } from "@angular/core"; +import { SuiPopupController } from "./popup-controller"; +import { PopupConfig } from "./popup-config"; +var templateRef = TemplateRef; +var TemplatePopupConfig = /** @class */ (function (_super) { + __extends(TemplatePopupConfig, _super); + function TemplatePopupConfig() { + return _super !== null && _super.apply(this, arguments) || this; + } + return TemplatePopupConfig; +}(PopupConfig)); +export { TemplatePopupConfig }; +var SuiPopupTemplateController = /** @class */ (function (_super) { + __extends(SuiPopupTemplateController, _super); + function SuiPopupTemplateController(renderer, element, componentFactory, config) { + return _super.call(this, renderer, element, componentFactory, config) || this; + } + SuiPopupTemplateController.prototype.configure = function (config) { + _super.prototype.configure.call(this, config); + if (config) { + this.template = config.template; + this.context = config.context; + } + }; + SuiPopupTemplateController.prototype.open = function () { + // If there is a template, inject it into the view. + if (this.template) { + this.popup.templateSibling.clear(); + this._componentFactory.createView(this.popup.templateSibling, this.template, { + $implicit: this.popup, + context: this.context + }); + } + _super.prototype.open.call(this); + }; + return SuiPopupTemplateController; +}(SuiPopupController)); +export { SuiPopupTemplateController }; +//# sourceMappingURL=popup-template-controller.js.map \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-template-controller.js.map b/dist/modules/popup/classes/popup-template-controller.js.map new file mode 100644 index 000000000..07f5246c4 --- /dev/null +++ b/dist/modules/popup/classes/popup-template-controller.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popup-template-controller.js","sourceRoot":"","sources":["../../../../src/modules/popup/classes/popup-template-controller.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAU,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAE3D,IAAM,WAAW,GAAG,WAAW,CAAC;AAWhC,IAAA;IAA4C,uCAAW;;;;8BAhBvD;EAgB4C,WAAW,EAGtD,CAAA;AAHD,+BAGC;AAED,IAAA;IAAmD,8CAAkB;IAIjE,oCAAY,QAAkB,EAClB,OAAkB,EAClB,gBAAoC,EACpC,MAAkB;eAE1B,kBAAM,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC;KACrD;IAEM,8CAAS,GAAhB,UAAiB,MAA+B;QAC5C,iBAAM,SAAS,YAAC,MAAM,CAAC,CAAC;QAExB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACT,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;YAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;SACjC;KACJ;IAEM,yCAAI,GAAX;;QAEI,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAChB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;YAEnC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,CAAC,QAAQ,EAAE;gBACzE,SAAS,EAAE,IAAI,CAAC,KAAK;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;aACxB,CAAC,CAAC;SACN;QAED,iBAAM,IAAI,WAAE,CAAC;KAChB;qCAtDL;EAqBmD,kBAAkB,EAkCpE,CAAA;AAlCD,sCAkCC","sourcesContent":["import { TemplateRef, Renderer2, ElementRef } from \"@angular/core\";\nimport { SuiPopupController, IPopup } from \"./popup-controller\";\nimport { ITemplateRefContext, SuiComponentFactory, IImplicitContext } from \"../../../misc/util\";\nimport { PopupConfig, IPopupConfig } from \"./popup-config\";\n\nconst templateRef = TemplateRef;\n\nexport interface ITemplatePopupContext extends IImplicitContext {\n context?:T;\n}\n\nexport interface ITemplatePopupConfig extends IPopupConfig {\n template?:TemplateRef>;\n context?:T;\n}\n\nexport class TemplatePopupConfig extends PopupConfig {\n public template?:TemplateRef>;\n public context?:T;\n}\n\nexport class SuiPopupTemplateController extends SuiPopupController {\n public template?:TemplateRef>;\n public context?:T;\n\n constructor(renderer:Renderer2,\n element:ElementRef,\n componentFactory:SuiComponentFactory,\n config:PopupConfig) {\n\n super(renderer, element, componentFactory, config);\n }\n\n public configure(config?:ITemplatePopupConfig):void {\n super.configure(config);\n\n if (config) {\n this.template = config.template;\n this.context = config.context;\n }\n }\n\n public open():void {\n // If there is a template, inject it into the view.\n if (this.template) {\n this.popup.templateSibling.clear();\n\n this._componentFactory.createView(this.popup.templateSibling, this.template, {\n $implicit: this.popup,\n context: this.context\n });\n }\n\n super.open();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-template-controller.metadata.json b/dist/modules/popup/classes/popup-template-controller.metadata.json new file mode 100644 index 000000000..65df6165f --- /dev/null +++ b/dist/modules/popup/classes/popup-template-controller.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"ITemplatePopupContext":{"__symbolic":"interface"},"ITemplatePopupConfig":{"__symbolic":"interface"},"TemplatePopupConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./popup-config","name":"PopupConfig","line":16,"character":44},"arity":1},"SuiPopupTemplateController":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./popup-controller","name":"SuiPopupController","line":21,"character":51},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":25,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":26,"character":24},{"__symbolic":"reference","module":"../../../misc/util","name":"SuiComponentFactory","line":27,"character":33},{"__symbolic":"reference","module":"./popup-config","name":"PopupConfig","line":28,"character":23}]}],"configure":[{"__symbolic":"method"}],"open":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/components/popup-arrow.d.ts b/dist/modules/popup/components/popup-arrow.d.ts new file mode 100644 index 000000000..cb4ad6d6f --- /dev/null +++ b/dist/modules/popup/components/popup-arrow.d.ts @@ -0,0 +1,7 @@ +import { PositioningPlacement } from "../../../misc/util/index"; +export declare class SuiPopupArrow { + placement: PositioningPlacement; + inverted: boolean; + readonly direction: string | undefined; + readonly alignment: string | undefined; +} diff --git a/dist/modules/popup/components/popup-arrow.js b/dist/modules/popup/components/popup-arrow.js new file mode 100644 index 000000000..fcab5a75e --- /dev/null +++ b/dist/modules/popup/components/popup-arrow.js @@ -0,0 +1,44 @@ +import { Component, Input, HostBinding } from "@angular/core"; +import { PositioningPlacement } from "../../../misc/util/index"; +var SuiPopupArrow = /** @class */ (function () { + function SuiPopupArrow() { + } + Object.defineProperty(SuiPopupArrow.prototype, "direction", { + get: function () { + if (this.placement) { + return this.placement.split(" ").shift(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupArrow.prototype, "alignment", { + get: function () { + if (this.placement) { + var alignment = this.placement.split(" ").pop(); + if (alignment === this.direction) { + return "center"; + } + return alignment; + } + }, + enumerable: true, + configurable: true + }); + SuiPopupArrow.decorators = [ + { type: Component, args: [{ + selector: "sui-popup-arrow", + template: "\n
\n
\n", + styles: ["\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction=\"top\"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction=\"left\"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction=\"bottom\"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction=\"right\"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"left\"],\n.static.arrow[direction=\"top\"][alignment=\"left\"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"top\"],\n.static.arrow[direction=\"right\"][alignment=\"top\"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"right\"],\n.static.arrow[direction=\"top\"][alignment=\"right\"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"bottom\"],\n.static.arrow[direction=\"right\"][alignment=\"bottom\"] {\n top: auto;\n bottom: 1em;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiPopupArrow.ctorParameters = function () { return []; }; + SuiPopupArrow.propDecorators = { + "placement": [{ type: Input },], + "inverted": [{ type: HostBinding, args: ["class.inverted",] }, { type: Input },], + }; + return SuiPopupArrow; +}()); +export { SuiPopupArrow }; +//# sourceMappingURL=popup-arrow.js.map \ No newline at end of file diff --git a/dist/modules/popup/components/popup-arrow.js.map b/dist/modules/popup/components/popup-arrow.js.map new file mode 100644 index 000000000..470833871 --- /dev/null +++ b/dist/modules/popup/components/popup-arrow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popup-arrow.js","sourceRoot":"","sources":["../../../../src/modules/popup/components/popup-arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;;;;IA6E5D,sBAAW,oCAAS;aAApB;YACI,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;aAC5C;SACJ;;;OAAA;IAED,sBAAW,oCAAS;aAApB;YACI,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;gBACjB,IAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;gBAClD,EAAE,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;oBAC/B,MAAM,CAAC,QAAQ,CAAC;iBACnB;gBACD,MAAM,CAAC,SAAS,CAAC;aACpB;SACJ;;;OAAA;;gBAzFJ,SAAS,SAAC;oBACP,QAAQ,EAAE,iBAAiB;oBAC3B,QAAQ,EAAE,0OAGb;oBACG,MAAM,EAAE,CAAC,2yCA2DZ,CAAC;iBACD;;;;;8BAEI,KAAK;6BAGL,WAAW,SAAC,gBAAgB,cAC5B,KAAK;;wBA3EV;;SAsEa,aAAa","sourcesContent":["import { Component, Input, HostBinding } from \"@angular/core\";\nimport { PositioningPlacement } from \"../../../misc/util/index\";\n\n@Component({\n selector: \"sui-popup-arrow\",\n template: `\n
\n
\n`,\n styles: [`\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction=\"top\"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction=\"left\"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction=\"bottom\"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction=\"right\"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"left\"],\n.static.arrow[direction=\"top\"][alignment=\"left\"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"top\"],\n.static.arrow[direction=\"right\"][alignment=\"top\"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"right\"],\n.static.arrow[direction=\"top\"][alignment=\"right\"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"bottom\"],\n.static.arrow[direction=\"right\"][alignment=\"bottom\"] {\n top: auto;\n bottom: 1em;\n}\n`]\n})\nexport class SuiPopupArrow {\n @Input()\n public placement:PositioningPlacement;\n\n @HostBinding(\"class.inverted\")\n @Input()\n public inverted:boolean;\n\n public get direction():string | undefined {\n if (this.placement) {\n return this.placement.split(\" \").shift();\n }\n }\n\n public get alignment():string | undefined {\n if (this.placement) {\n const alignment = this.placement.split(\" \").pop();\n if (alignment === this.direction) {\n return \"center\";\n }\n return alignment;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/components/popup-arrow.metadata.json b/dist/modules/popup/components/popup-arrow.metadata.json new file mode 100644 index 000000000..5768450ae --- /dev/null +++ b/dist/modules/popup/components/popup-arrow.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiPopupArrow":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"sui-popup-arrow","template":"\n
\n
\n","styles":["\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction=\"top\"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction=\"left\"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction=\"bottom\"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction=\"right\"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"left\"],\n.static.arrow[direction=\"top\"][alignment=\"left\"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"top\"],\n.static.arrow[direction=\"right\"][alignment=\"top\"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"right\"],\n.static.arrow[direction=\"top\"][alignment=\"right\"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"bottom\"],\n.static.arrow[direction=\"right\"][alignment=\"bottom\"] {\n top: auto;\n bottom: 1em;\n}\n"]}]}],"members":{"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":71,"character":5}}]}],"inverted":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":74,"character":5},"arguments":["class.inverted"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":75,"character":5}}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/components/popup.d.ts b/dist/modules/popup/components/popup.d.ts new file mode 100644 index 000000000..06b5972a4 --- /dev/null +++ b/dist/modules/popup/components/popup.d.ts @@ -0,0 +1,28 @@ +import { ViewContainerRef, ElementRef, EventEmitter } from "@angular/core"; +import { PositioningService, IDynamicClasses } from "../../../misc/util/index"; +import { TransitionController } from "../../transition/index"; +import { IPopup } from "../classes/popup-controller"; +import { TemplatePopupConfig } from "../classes/popup-template-controller"; +export declare class SuiPopup implements IPopup { + elementRef: ElementRef; + config: TemplatePopupConfig; + transitionController: TransitionController; + positioningService: PositioningService; + private _isOpen; + closingTimeout: number; + onOpen: EventEmitter; + onClose: EventEmitter; + readonly isOpen: boolean; + private _container; + anchor: ElementRef; + readonly direction: string | undefined; + readonly alignment: string | undefined; + readonly dynamicClasses: IDynamicClasses; + templateSibling: ViewContainerRef; + private _tabindex; + constructor(elementRef: ElementRef); + open(): void; + toggle(): void; + close(): void; + onClick(event: MouseEvent): void; +} diff --git a/dist/modules/popup/components/popup.js b/dist/modules/popup/components/popup.js new file mode 100644 index 000000000..d3639ccd2 --- /dev/null +++ b/dist/modules/popup/components/popup.js @@ -0,0 +1,143 @@ +import { Component, ViewChild, ViewContainerRef, ElementRef, EventEmitter, HostListener, HostBinding } from "@angular/core"; +import { PositioningService } from "../../../misc/util/index"; +import { TransitionController, TransitionDirection, Transition } from "../../transition/index"; +var SuiPopup = /** @class */ (function () { + function SuiPopup(elementRef) { + this.elementRef = elementRef; + this.transitionController = new TransitionController(false); + this._isOpen = false; + this.onOpen = new EventEmitter(); + this.onClose = new EventEmitter(); + this._tabindex = 0; + } + Object.defineProperty(SuiPopup.prototype, "isOpen", { + get: function () { + return this._isOpen; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopup.prototype, "anchor", { + set: function (anchor) { + // Whenever the anchor is set (which is when the popup is created), recreate the positioning service with the appropriate options. + this.positioningService = new PositioningService(anchor, this._container.element, this.config.placement, ".dynamic.arrow"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopup.prototype, "direction", { + // Returns the direction (`top`, `left`, `right`, `bottom`) of the current placement. + get: + // Returns the direction (`top`, `left`, `right`, `bottom`) of the current placement. + function () { + if (this.positioningService) { + return this.positioningService.actualPlacement.split(" ").shift(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopup.prototype, "alignment", { + // Returns the alignment (`top`, `left`, `right`, `bottom`) of the current placement. + get: + // Returns the alignment (`top`, `left`, `right`, `bottom`) of the current placement. + function () { + if (this.positioningService) { + return this.positioningService.actualPlacement.split(" ").pop(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopup.prototype, "dynamicClasses", { + get: function () { + var classes = {}; + if (this.direction) { + classes[this.direction] = true; + } + if (this.alignment) { + classes[this.alignment] = true; + } + if (this.config.isInverted) { + classes.inverted = true; + } + if (this.config.isBasic) { + classes.basic = true; + } + return classes; + }, + enumerable: true, + configurable: true + }); + SuiPopup.prototype.open = function () { + var _this = this; + // Only attempt to open if currently closed. + if (!this.isOpen) { + // Cancel the closing timer. + clearTimeout(this.closingTimeout); + // Cancel all other transitions, and initiate the opening transition. + this.transitionController.stopAll(); + this.transitionController.animate(new Transition(this.config.transition, this.config.transitionDuration, TransitionDirection.In, function () { + // Focus any element with [autofocus] attribute. + var autoFocus = _this.elementRef.nativeElement.querySelector("[autofocus]"); + if (autoFocus) { + // Autofocus after the browser has had time to process other event handlers. + setTimeout(function () { return autoFocus.focus(); }, 10); + // Try to focus again when the modal has opened so that autofocus works in IE11. + setTimeout(function () { return autoFocus.focus(); }, _this.config.transitionDuration); + } + })); + // Refresh the popup position after a brief delay to allow for browser processing time. + this.positioningService.placement = this.config.placement; + setTimeout(function () { return _this.positioningService.update(); }); + // Finally, set the popup to be open. + this._isOpen = true; + this.onOpen.emit(); + } + }; + SuiPopup.prototype.toggle = function () { + if (!this.isOpen) { + return this.open(); + } + return this.close(); + }; + SuiPopup.prototype.close = function () { + var _this = this; + // Only attempt to close if currently open. + if (this.isOpen) { + // Cancel all other transitions, and initiate the closing transition. + this.transitionController.stopAll(); + this.transitionController.animate(new Transition(this.config.transition, this.config.transitionDuration, TransitionDirection.Out)); + // Cancel the closing timer. + clearTimeout(this.closingTimeout); + // Start the closing timer, that fires the `onClose` event after the transition duration number of milliseconds. + this.closingTimeout = window.setTimeout(function () { return _this.onClose.emit(); }, this.config.transitionDuration); + // Finally, set the popup to be closed. + this._isOpen = false; + } + }; + SuiPopup.prototype.onClick = function (event) { + // Makes sense here, as the popup shouldn't be attached to any DOM element. + event.stopPropagation(); + }; + SuiPopup.decorators = [ + { type: Component, args: [{ + selector: "sui-popup", + template: "\n
\n\n \n
{{ config.header }}
\n
{{ config.text }}
\n
\n
\n\n \n
\n", + styles: ["\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor's mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed 'vertically'. */\n.ui.popup[direction=\"top\"],\n.ui.popup[direction=\"bottom\"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed 'horizontally'. */\n.ui.popup[direction=\"left\"],\n.ui.popup[direction=\"right\"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiPopup.ctorParameters = function () { return [ + { type: ElementRef, }, + ]; }; + SuiPopup.propDecorators = { + "_container": [{ type: ViewChild, args: ["container", { read: ViewContainerRef },] },], + "templateSibling": [{ type: ViewChild, args: ["templateSibling", { read: ViewContainerRef },] },], + "_tabindex": [{ type: HostBinding, args: ["attr.tabindex",] },], + "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], + }; + return SuiPopup; +}()); +export { SuiPopup }; +//# sourceMappingURL=popup.js.map \ No newline at end of file diff --git a/dist/modules/popup/components/popup.js.map b/dist/modules/popup/components/popup.js.map new file mode 100644 index 000000000..a494a5792 --- /dev/null +++ b/dist/modules/popup/components/popup.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popup.js","sourceRoot":"","sources":["../../../../src/modules/popup/components/popup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAE,kBAAkB,EAAmB,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,wBAAwB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M,EAAE,CAAC,42BA+BZ,CAAC;iBACD;;;;gBA1DgD,UAAU;;;+BAiFtD,SAAS,SAAC,WAAW,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;oCAwCjD,SAAS,SAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;8BAGvD,WAAW,SAAC,eAAe;4BAsE3B,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;mBAlMrC;;SA2Da,QAAQ","sourcesContent":["import { Component, ViewChild, ViewContainerRef, ElementRef, EventEmitter, HostListener, HostBinding } from \"@angular/core\";\nimport { PositioningService, IDynamicClasses } from \"../../../misc/util/index\";\nimport { TransitionController, TransitionDirection, Transition } from \"../../transition/index\";\nimport { IPopup } from \"../classes/popup-controller\";\nimport { TemplatePopupConfig } from \"../classes/popup-template-controller\";\n\n@Component({\n selector: \"sui-popup\",\n template: `\n
\n\n \n
{{ config.header }}
\n
{{ config.text }}
\n
\n
\n\n \n
\n`,\n styles: [`\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor's mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed 'vertically'. */\n.ui.popup[direction=\"top\"],\n.ui.popup[direction=\"bottom\"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed 'horizontally'. */\n.ui.popup[direction=\"left\"],\n.ui.popup[direction=\"right\"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n`]\n})\nexport class SuiPopup implements IPopup {\n // Config settings for this popup.\n public config:TemplatePopupConfig;\n\n public transitionController:TransitionController;\n public positioningService:PositioningService;\n\n // Keeps track of whether the popup is open internally.\n private _isOpen:boolean;\n // `setTimeout` timer pointer for cancelling popup close.\n public closingTimeout:number;\n\n // Fires when the popup opens (and the animation is completed).\n public onOpen:EventEmitter;\n // Fires when the popup closes (and the animation is completed).\n public onClose:EventEmitter;\n\n public get isOpen():boolean {\n return this._isOpen;\n }\n\n // `ElementRef` for the positioning subject.\n @ViewChild(\"container\", { read: ViewContainerRef })\n private _container:ViewContainerRef;\n\n public set anchor(anchor:ElementRef) {\n // Whenever the anchor is set (which is when the popup is created), recreate the positioning service with the appropriate options.\n this.positioningService = new PositioningService(anchor, this._container.element, this.config.placement, \".dynamic.arrow\");\n }\n\n // Returns the direction (`top`, `left`, `right`, `bottom`) of the current placement.\n public get direction():string | undefined {\n if (this.positioningService) {\n return this.positioningService.actualPlacement.split(\" \").shift();\n }\n }\n\n // Returns the alignment (`top`, `left`, `right`, `bottom`) of the current placement.\n public get alignment():string | undefined {\n if (this.positioningService) {\n return this.positioningService.actualPlacement.split(\" \").pop();\n }\n }\n\n public get dynamicClasses():IDynamicClasses {\n const classes:IDynamicClasses = {};\n if (this.direction) {\n classes[this.direction] = true;\n }\n if (this.alignment) {\n classes[this.alignment] = true;\n }\n if (this.config.isInverted) {\n classes.inverted = true;\n }\n if (this.config.isBasic) {\n classes.basic = true;\n }\n return classes;\n }\n\n // `ViewContainerRef` for the element the template gets injected as a sibling of.\n @ViewChild(\"templateSibling\", { read: ViewContainerRef })\n public templateSibling:ViewContainerRef;\n\n @HostBinding(\"attr.tabindex\")\n private _tabindex:number;\n\n constructor(public elementRef:ElementRef) {\n this.transitionController = new TransitionController(false);\n\n this._isOpen = false;\n\n this.onOpen = new EventEmitter();\n this.onClose = new EventEmitter();\n\n this._tabindex = 0;\n }\n\n public open():void {\n // Only attempt to open if currently closed.\n if (!this.isOpen) {\n // Cancel the closing timer.\n clearTimeout(this.closingTimeout);\n\n // Cancel all other transitions, and initiate the opening transition.\n this.transitionController.stopAll();\n this.transitionController.animate(\n new Transition(this.config.transition, this.config.transitionDuration, TransitionDirection.In, () => {\n // Focus any element with [autofocus] attribute.\n const autoFocus = this.elementRef.nativeElement.querySelector(\"[autofocus]\") as HTMLElement | null;\n if (autoFocus) {\n // Autofocus after the browser has had time to process other event handlers.\n setTimeout(() => autoFocus.focus(), 10);\n // Try to focus again when the modal has opened so that autofocus works in IE11.\n setTimeout(() => autoFocus.focus(), this.config.transitionDuration);\n }\n }));\n\n // Refresh the popup position after a brief delay to allow for browser processing time.\n this.positioningService.placement = this.config.placement;\n setTimeout(() => this.positioningService.update());\n\n // Finally, set the popup to be open.\n this._isOpen = true;\n this.onOpen.emit();\n }\n }\n\n public toggle():void {\n if (!this.isOpen) {\n return this.open();\n }\n\n return this.close();\n }\n\n public close():void {\n // Only attempt to close if currently open.\n if (this.isOpen) {\n // Cancel all other transitions, and initiate the closing transition.\n this.transitionController.stopAll();\n this.transitionController.animate(\n new Transition(this.config.transition, this.config.transitionDuration, TransitionDirection.Out));\n\n // Cancel the closing timer.\n clearTimeout(this.closingTimeout);\n // Start the closing timer, that fires the `onClose` event after the transition duration number of milliseconds.\n this.closingTimeout = window.setTimeout(() => this.onClose.emit(), this.config.transitionDuration);\n\n // Finally, set the popup to be closed.\n this._isOpen = false;\n }\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(event:MouseEvent):void {\n // Makes sense here, as the popup shouldn't be attached to any DOM element.\n event.stopPropagation();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/components/popup.metadata.json b/dist/modules/popup/components/popup.metadata.json new file mode 100644 index 000000000..659aa0c15 --- /dev/null +++ b/dist/modules/popup/components/popup.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiPopup":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"sui-popup","template":"\n
\n\n \n
{{ config.header }}
\n
{{ config.text }}
\n
\n
\n\n \n
\n","styles":["\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor's mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed 'vertically'. */\n.ui.popup[direction=\"top\"],\n.ui.popup[direction=\"bottom\"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed 'horizontally'. */\n.ui.popup[direction=\"left\"],\n.ui.popup[direction=\"right\"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n"]}]}],"members":{"_container":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":81,"character":5},"arguments":["container",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":81,"character":36}}]}]}],"templateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":121,"character":5},"arguments":["templateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":121,"character":42}}]}]}],"_tabindex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":124,"character":5},"arguments":["attr.tabindex"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":127,"character":34}]}],"open":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":194,"character":5},"arguments":["click",["$event"]]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/directives/popup.directive.d.ts b/dist/modules/popup/directives/popup.directive.d.ts new file mode 100644 index 000000000..d2615e178 --- /dev/null +++ b/dist/modules/popup/directives/popup.directive.d.ts @@ -0,0 +1,20 @@ +import { ElementRef, TemplateRef, Renderer2 } from "@angular/core"; +import { PositioningPlacement, SuiComponentFactory } from "../../../misc/util/index"; +import { PopupTrigger } from "../classes/popup-config"; +import { SuiPopupConfig } from "../services/popup.service"; +import { SuiPopupTemplateController, ITemplatePopupContext, ITemplatePopupConfig } from "../classes/popup-template-controller"; +export declare class SuiPopupDirective extends SuiPopupTemplateController { + popupHeader: string; + popupText: string; + popupInverted: boolean; + popupBasic: boolean; + popupTransition: string; + popupTransitionDuration: number; + popupPlacement: PositioningPlacement; + popupDelay: number; + popupTrigger: PopupTrigger; + popupTemplate: TemplateRef> | undefined; + popupTemplateContext: T | undefined; + popupConfig: ITemplatePopupConfig | undefined; + constructor(renderer: Renderer2, element: ElementRef, componentFactory: SuiComponentFactory, popupDefaults: SuiPopupConfig); +} diff --git a/dist/modules/popup/directives/popup.directive.js b/dist/modules/popup/directives/popup.directive.js new file mode 100644 index 000000000..22fde1996 --- /dev/null +++ b/dist/modules/popup/directives/popup.directive.js @@ -0,0 +1,139 @@ +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 __()); + }; +})(); +import { Directive, Input, ElementRef, TemplateRef, Renderer2 } from "@angular/core"; +import { Util, PositioningPlacement, SuiComponentFactory } from "../../../misc/util/index"; +import { PopupConfig, PopupTrigger } from "../classes/popup-config"; +import { SuiPopupConfig } from "../services/popup.service"; +import { SuiPopupTemplateController } from "../classes/popup-template-controller"; +var templateRef = TemplateRef; +var SuiPopupDirective = /** @class */ (function (_super) { + __extends(SuiPopupDirective, _super); + function SuiPopupDirective(renderer, element, componentFactory, popupDefaults) { + return _super.call(this, renderer, element, componentFactory, new PopupConfig(popupDefaults)) || this; + } + Object.defineProperty(SuiPopupDirective.prototype, "popupHeader", { + set: function (header) { + this.popup.config.header = header; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupText", { + set: function (text) { + this.popup.config.text = text; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupInverted", { + set: function (inverted) { + this.popup.config.isInverted = Util.DOM.parseBooleanAttribute(inverted); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupBasic", { + set: function (basic) { + this.popup.config.isBasic = Util.DOM.parseBooleanAttribute(basic); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupTransition", { + set: function (transition) { + this.popup.config.transition = transition; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupTransitionDuration", { + set: function (duration) { + this.popup.config.transitionDuration = duration; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupPlacement", { + set: function (placement) { + this.popup.config.placement = placement; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupDelay", { + set: function (delay) { + this.popup.config.delay = delay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupTrigger", { + get: function () { + return this.popup.config.trigger; + }, + set: function (trigger) { + this.popup.config.trigger = trigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupTemplate", { + set: function (template) { + this.template = template; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupTemplateContext", { + set: function (context) { + this.context = context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiPopupDirective.prototype, "popupConfig", { + set: function (config) { + this.configure(config); + }, + enumerable: true, + configurable: true + }); + SuiPopupDirective.decorators = [ + { type: Directive, args: [{ + selector: "[suiPopup]", + exportAs: "suiPopup" + },] }, + ]; + /** @nocollapse */ + SuiPopupDirective.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + { type: SuiComponentFactory, }, + { type: SuiPopupConfig, }, + ]; }; + SuiPopupDirective.propDecorators = { + "popupHeader": [{ type: Input },], + "popupText": [{ type: Input },], + "popupInverted": [{ type: Input },], + "popupBasic": [{ type: Input },], + "popupTransition": [{ type: Input },], + "popupTransitionDuration": [{ type: Input },], + "popupPlacement": [{ type: Input },], + "popupDelay": [{ type: Input },], + "popupTrigger": [{ type: Input },], + "popupTemplate": [{ type: Input },], + "popupTemplateContext": [{ type: Input },], + "popupConfig": [{ type: Input },], + }; + return SuiPopupDirective; +}(SuiPopupTemplateController)); +export { SuiPopupDirective }; +//# sourceMappingURL=popup.directive.js.map \ No newline at end of file diff --git a/dist/modules/popup/directives/popup.directive.js.map b/dist/modules/popup/directives/popup.directive.js.map new file mode 100644 index 000000000..0b288a9f2 --- /dev/null +++ b/dist/modules/popup/directives/popup.directive.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popup.directive.js","sourceRoot":"","sources":["../../../../src/modules/popup/directives/popup.directive.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAuB,IAAI,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEhH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,0BAA0B,EAA+C,MAAM,sCAAsC,CAAC;AAE/H,IAAM,WAAW,GAAG,WAAW,CAAC;;IAMU,qCAA6B;IAiEnE,2BAAY,QAAkB,EAClB,OAAkB,EAClB,gBAAoC,EACp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AAC,QAAQ,GAAG,QAAQ,CAAC;;;;;0BAIlB,mDAAoB;uBAAC,OAAqB;YACjD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;;;;0BAIhB,0CAAW;uBAAC,MAA0C;YAC7D,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;;;;;;gBAlE9B,SAAS,SAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,UAAU;iBACvB;;;;gBAbmD,SAAS;gBAAlC,UAAU;gBACqB,mBAAmB;gBAGpE,cAAc;;;gCAWlB,KAAK;8BAKL,KAAK;kCAKL,KAAK;+BAKL,KAAK;oCAKL,KAAK;4CAKL,KAAK;mCAKL,KAAK;+BAKL,KAAK;iCAKL,KAAK;kCASL,KAAK;yCAKL,KAAK;gCAKL,KAAK;;4BA1EV;EAc0C,0BAA0B;SAAvD,iBAAiB","sourcesContent":["import { Directive, Input, ElementRef, TemplateRef, Renderer2 } from \"@angular/core\";\nimport { ITemplateRefContext, Util, PositioningPlacement, SuiComponentFactory } from \"../../../misc/util/index\";\nimport { SuiPopup } from \"../components/popup\";\nimport { PopupConfig, PopupTrigger } from \"../classes/popup-config\";\nimport { SuiPopupConfig } from \"../services/popup.service\";\nimport { SuiPopupController } from \"../classes/popup-controller\";\nimport { SuiPopupTemplateController, ITemplatePopupContext, ITemplatePopupConfig } from \"../classes/popup-template-controller\";\n\nconst templateRef = TemplateRef;\n\n@Directive({\n selector: \"[suiPopup]\",\n exportAs: \"suiPopup\"\n})\nexport class SuiPopupDirective extends SuiPopupTemplateController {\n @Input()\n public set popupHeader(header:string) {\n this.popup.config.header = header;\n }\n\n @Input()\n public set popupText(text:string) {\n this.popup.config.text = text;\n }\n\n @Input()\n public set popupInverted(inverted:boolean) {\n this.popup.config.isInverted = Util.DOM.parseBooleanAttribute(inverted);\n }\n\n @Input()\n public set popupBasic(basic:boolean) {\n this.popup.config.isBasic = Util.DOM.parseBooleanAttribute(basic);\n }\n\n @Input()\n public set popupTransition(transition:string) {\n this.popup.config.transition = transition;\n }\n\n @Input()\n public set popupTransitionDuration(duration:number) {\n this.popup.config.transitionDuration = duration;\n }\n\n @Input()\n public set popupPlacement(placement:PositioningPlacement) {\n this.popup.config.placement = placement;\n }\n\n @Input()\n public set popupDelay(delay:number) {\n this.popup.config.delay = delay;\n }\n\n @Input()\n public get popupTrigger():PopupTrigger {\n return this.popup.config.trigger;\n }\n\n public set popupTrigger(trigger:PopupTrigger) {\n this.popup.config.trigger = trigger;\n }\n\n @Input()\n public set popupTemplate(template:TemplateRef> | undefined) {\n this.template = template;\n }\n\n @Input()\n public set popupTemplateContext(context:T | undefined) {\n this.context = context;\n }\n\n @Input()\n public set popupConfig(config:ITemplatePopupConfig | undefined) {\n this.configure(config);\n }\n\n constructor(renderer:Renderer2,\n element:ElementRef,\n componentFactory:SuiComponentFactory,\n popupDefaults:SuiPopupConfig) {\n\n super(renderer, element, componentFactory, new PopupConfig(popupDefaults));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/directives/popup.directive.metadata.json b/dist/modules/popup/directives/popup.directive.metadata.json new file mode 100644 index 000000000..ec3e547a3 --- /dev/null +++ b/dist/modules/popup/directives/popup.directive.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiPopupDirective":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../classes/popup-template-controller","name":"SuiPopupTemplateController","line":14,"character":42},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":10,"character":1},"arguments":[{"selector":"[suiPopup]","exportAs":"suiPopup"}]}],"members":{"popupHeader":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":5}}]}],"popupText":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":5}}]}],"popupInverted":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":5}}]}],"popupBasic":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":5}}]}],"popupTransition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":5}}]}],"popupTransitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":5}}]}],"popupPlacement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":5}}]}],"popupDelay":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":5}}]}],"popupTrigger":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":5}}]}],"popupTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5}}]}],"popupTemplateContext":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":69,"character":5}}]}],"popupConfig":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":74,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":79,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":80,"character":24},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":81,"character":33},{"__symbolic":"reference","module":"../services/popup.service","name":"SuiPopupConfig","line":82,"character":30}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/index.d.ts b/dist/modules/popup/index.d.ts new file mode 100644 index 000000000..5893ad9bf --- /dev/null +++ b/dist/modules/popup/index.d.ts @@ -0,0 +1,10 @@ +export * from "./classes/popup-component-controller"; +export * from "./classes/popup-config"; +export * from "./classes/popup-controller"; +export * from "./classes/popup-lifecycle"; +export * from "./classes/popup-template-controller"; +export * from "./components/popup-arrow"; +export * from "./components/popup"; +export * from "./directives/popup.directive"; +export * from "./services/popup.service"; +export * from "./popup.module"; diff --git a/dist/modules/popup/index.js b/dist/modules/popup/index.js new file mode 100644 index 000000000..ee9b35353 --- /dev/null +++ b/dist/modules/popup/index.js @@ -0,0 +1,10 @@ +export * from "./classes/popup-component-controller"; +export * from "./classes/popup-config"; +export * from "./classes/popup-controller"; +export * from "./classes/popup-template-controller"; +export * from "./components/popup-arrow"; +export * from "./components/popup"; +export * from "./directives/popup.directive"; +export * from "./services/popup.service"; +export * from "./popup.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/popup/index.js.map b/dist/modules/popup/index.js.map new file mode 100644 index 000000000..58ca4c03a --- /dev/null +++ b/dist/modules/popup/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/popup/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,qCAAqC,CAAC;AAEpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,8BAA8B,CAAC;AAE7C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,gBAAgB,CAAC","sourcesContent":["export * from \"./classes/popup-component-controller\";\nexport * from \"./classes/popup-config\";\nexport * from \"./classes/popup-controller\";\nexport * from \"./classes/popup-lifecycle\";\nexport * from \"./classes/popup-template-controller\";\n\nexport * from \"./components/popup-arrow\";\nexport * from \"./components/popup\";\n\nexport * from \"./directives/popup.directive\";\n\nexport * from \"./services/popup.service\";\n\nexport * from \"./popup.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/popup/index.metadata.json b/dist/modules/popup/index.metadata.json new file mode 100644 index 000000000..7258f3de4 --- /dev/null +++ b/dist/modules/popup/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/popup-component-controller"},{"from":"./classes/popup-config"},{"from":"./classes/popup-controller"},{"from":"./classes/popup-lifecycle"},{"from":"./classes/popup-template-controller"},{"from":"./components/popup-arrow"},{"from":"./components/popup"},{"from":"./directives/popup.directive"},{"from":"./services/popup.service"},{"from":"./popup.module"}]}] \ No newline at end of file diff --git a/dist/modules/popup/popup.module.d.ts b/dist/modules/popup/popup.module.d.ts new file mode 100644 index 000000000..f615ae043 --- /dev/null +++ b/dist/modules/popup/popup.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiPopupModule { +} diff --git a/dist/modules/popup/popup.module.js b/dist/modules/popup/popup.module.js new file mode 100644 index 000000000..2d250ff66 --- /dev/null +++ b/dist/modules/popup/popup.module.js @@ -0,0 +1,41 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiTransitionModule } from "../transition/index"; +import { SuiUtilityModule } from "../../misc/util/index"; +import { SuiPopupDirective } from "./directives/popup.directive"; +import { SuiPopupArrow } from "./components/popup-arrow"; +import { SuiPopup } from "./components/popup"; +import { SuiPopupConfig } from "./services/popup.service"; +var SuiPopupModule = /** @class */ (function () { + function SuiPopupModule() { + } + SuiPopupModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule, + SuiTransitionModule, + SuiUtilityModule + ], + declarations: [ + SuiPopupDirective, + SuiPopupArrow, + SuiPopup + ], + exports: [ + SuiPopupDirective, + SuiPopup + ], + providers: [ + SuiPopupConfig + ], + entryComponents: [ + SuiPopup + ] + },] }, + ]; + /** @nocollapse */ + SuiPopupModule.ctorParameters = function () { return []; }; + return SuiPopupModule; +}()); +export { SuiPopupModule }; +//# sourceMappingURL=popup.module.js.map \ No newline at end of file diff --git a/dist/modules/popup/popup.module.js.map b/dist/modules/popup/popup.module.js.map new file mode 100644 index 000000000..599fd637f --- /dev/null +++ b/dist/modules/popup/popup.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popup.module.js","sourceRoot":"","sources":["../../../src/modules/popup/popup.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;;;;;gBAEzD,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,mBAAmB;wBACnB,gBAAgB;qBACnB;oBACD,YAAY,EAAE;wBACV,iBAAiB;wBACjB,aAAa;wBACb,QAAQ;qBACX;oBACD,OAAO,EAAE;wBACL,iBAAiB;wBACjB,QAAQ;qBACX;oBACD,SAAS,EAAE;wBACP,cAAc;qBACjB;oBACD,eAAe,EAAE;wBACb,QAAQ;qBACX;iBACJ;;;;yBA9BD;;SAgCa,cAAc","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTransitionModule } from \"../transition/index\";\nimport { SuiUtilityModule } from \"../../misc/util/index\";\nimport { SuiPopupDirective } from \"./directives/popup.directive\";\nimport { SuiPopupArrow } from \"./components/popup-arrow\";\nimport { SuiPopup } from \"./components/popup\";\nimport { SuiPopupConfig } from \"./services/popup.service\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiTransitionModule,\n SuiUtilityModule\n ],\n declarations: [\n SuiPopupDirective,\n SuiPopupArrow,\n SuiPopup\n ],\n exports: [\n SuiPopupDirective,\n SuiPopup\n ],\n providers: [\n SuiPopupConfig\n ],\n entryComponents: [\n SuiPopup\n ]\n})\n\nexport class SuiPopupModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/popup.module.metadata.json b/dist/modules/popup/popup.module.metadata.json new file mode 100644 index 000000000..d11b4b68f --- /dev/null +++ b/dist/modules/popup/popup.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiPopupModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":9,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":11,"character":8},{"__symbolic":"reference","module":"../transition/index","name":"SuiTransitionModule","line":12,"character":8},{"__symbolic":"reference","module":"../../misc/util/index","name":"SuiUtilityModule","line":13,"character":8}],"declarations":[{"__symbolic":"reference","module":"./directives/popup.directive","name":"SuiPopupDirective","line":16,"character":8},{"__symbolic":"reference","module":"./components/popup-arrow","name":"SuiPopupArrow","line":17,"character":8},{"__symbolic":"reference","module":"./components/popup","name":"SuiPopup","line":18,"character":8}],"exports":[{"__symbolic":"reference","module":"./directives/popup.directive","name":"SuiPopupDirective","line":21,"character":8},{"__symbolic":"reference","module":"./components/popup","name":"SuiPopup","line":22,"character":8}],"providers":[{"__symbolic":"reference","module":"./services/popup.service","name":"SuiPopupConfig","line":25,"character":8}],"entryComponents":[{"__symbolic":"reference","module":"./components/popup","name":"SuiPopup","line":28,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/popup/public.d.ts b/dist/modules/popup/public.d.ts new file mode 100644 index 000000000..8fb4df92b --- /dev/null +++ b/dist/modules/popup/public.d.ts @@ -0,0 +1,3 @@ +export { SuiPopupModule, IPopup, SuiPopupConfig, IPopupConfig, ITemplatePopupConfig, ITemplatePopupContext, PopupTrigger } from "./index"; +import { PositioningPlacement } from "../../misc/util/index"; +export { PositioningPlacement as PopupPlacement }; diff --git a/dist/modules/popup/public.js b/dist/modules/popup/public.js new file mode 100644 index 000000000..9e03d8f83 --- /dev/null +++ b/dist/modules/popup/public.js @@ -0,0 +1,4 @@ +export { SuiPopupModule, SuiPopupConfig, PopupTrigger } from "./index"; +import { PositioningPlacement } from "../../misc/util/index"; +export { PositioningPlacement as PopupPlacement }; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/popup/public.js.map b/dist/modules/popup/public.js.map new file mode 100644 index 000000000..93a646b58 --- /dev/null +++ b/dist/modules/popup/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/popup/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EAEd,cAAc,EAId,YAAY,EACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,IAAI,cAAc,EAAE,CAAC","sourcesContent":["export {\n SuiPopupModule,\n IPopup,\n SuiPopupConfig,\n IPopupConfig,\n ITemplatePopupConfig,\n ITemplatePopupContext,\n PopupTrigger\n} from \"./index\";\n\nimport { PositioningPlacement } from \"../../misc/util/index\";\nexport { PositioningPlacement as PopupPlacement };\n"]} \ No newline at end of file diff --git a/dist/modules/popup/public.metadata.json b/dist/modules/popup/public.metadata.json new file mode 100644 index 000000000..ef59a4181 --- /dev/null +++ b/dist/modules/popup/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"PopupPlacement":{"__symbolic":"reference","module":"../../misc/util/index","name":"PositioningPlacement","line":11,"character":9}},"exports":[{"from":"./index","export":["SuiPopupModule","IPopup","SuiPopupConfig","IPopupConfig","ITemplatePopupConfig","ITemplatePopupContext","PopupTrigger"]}]}] \ No newline at end of file diff --git a/dist/modules/popup/services/popup.service.d.ts b/dist/modules/popup/services/popup.service.d.ts new file mode 100644 index 000000000..1f8e5b4f6 --- /dev/null +++ b/dist/modules/popup/services/popup.service.d.ts @@ -0,0 +1,4 @@ +import { PopupConfig } from "../classes/popup-config"; +export declare class SuiPopupConfig extends PopupConfig { + constructor(); +} diff --git a/dist/modules/popup/services/popup.service.js b/dist/modules/popup/services/popup.service.js new file mode 100644 index 000000000..f351e5591 --- /dev/null +++ b/dist/modules/popup/services/popup.service.js @@ -0,0 +1,27 @@ +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 __()); + }; +})(); +import { Injectable } from "@angular/core"; +import { PopupConfig } from "../classes/popup-config"; +var SuiPopupConfig = /** @class */ (function (_super) { + __extends(SuiPopupConfig, _super); + function SuiPopupConfig() { + // We use an empty constructor to ensure Angular DI works correctly. + return _super.call(this) || this; + } + SuiPopupConfig.decorators = [ + { type: Injectable }, + ]; + /** @nocollapse */ + SuiPopupConfig.ctorParameters = function () { return []; }; + return SuiPopupConfig; +}(PopupConfig)); +export { SuiPopupConfig }; +//# sourceMappingURL=popup.service.js.map \ No newline at end of file diff --git a/dist/modules/popup/services/popup.service.js.map b/dist/modules/popup/services/popup.service.js.map new file mode 100644 index 000000000..04766ef0f --- /dev/null +++ b/dist/modules/popup/services/popup.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popup.service.js","sourceRoot":"","sources":["../../../../src/modules/popup/services/popup.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;;IAGlB,kCAAW;IAC3C;QACI,oEAAoE;eACpE,iBAAO;KACV;;gBALJ,UAAU;;;;yBAHX;EAIoC,WAAW;SAAlC,cAAc","sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { PopupConfig } from \"../classes/popup-config\";\n\n@Injectable()\nexport class SuiPopupConfig extends PopupConfig {\n constructor() {\n // We use an empty constructor to ensure Angular DI works correctly.\n super();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/services/popup.service.metadata.json b/dist/modules/popup/services/popup.service.metadata.json new file mode 100644 index 000000000..0024b3dc1 --- /dev/null +++ b/dist/modules/popup/services/popup.service.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiPopupConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../classes/popup-config","name":"PopupConfig","line":4,"character":36},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":3,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}]}}}}] \ No newline at end of file diff --git a/dist/modules/progress/components/progress.d.ts b/dist/modules/progress/components/progress.d.ts new file mode 100644 index 000000000..0ffc4c085 --- /dev/null +++ b/dist/modules/progress/components/progress.d.ts @@ -0,0 +1,16 @@ +export declare class SuiProgress { + private _popupClasses; + private _value; + private _maximum; + private _precision; + private _overrideSuccess; + autoSuccess: boolean; + showProgress: boolean; + value: number; + maximum: number; + precision: number; + private readonly _reachedMaximum; + readonly percentage: string; + classValue: string; + constructor(); +} diff --git a/dist/modules/progress/components/progress.js b/dist/modules/progress/components/progress.js new file mode 100644 index 000000000..90cc65f7e --- /dev/null +++ b/dist/modules/progress/components/progress.js @@ -0,0 +1,109 @@ +import { Component, Input, HostBinding } from "@angular/core"; +var SuiProgress = /** @class */ (function () { + function SuiProgress() { + this._popupClasses = true; + this.value = 0; + this.maximum = 100; + this.precision = 0; + this._overrideSuccess = false; + this.autoSuccess = true; + this.showProgress = true; + this._popupClasses = true; + } + Object.defineProperty(SuiProgress.prototype, "value", { + get: function () { + return this._value; + }, + set: function (value) { + // Convert value from string to number where necessary. + var converted = +value; + if (Number.isNaN(converted)) { + return; + } + this._value = converted; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiProgress.prototype, "maximum", { + get: function () { + return this._maximum; + }, + set: function (value) { + // Convert value from string to number where necessary. + var converted = +value; + if (Number.isNaN(converted)) { + return; + } + this._maximum = converted; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiProgress.prototype, "precision", { + get: function () { + return this._precision; + }, + set: function (value) { + // Convert value from string to number where necessary. + var converted = +value; + if (Number.isNaN(converted)) { + return; + } + this._precision = Math.min(Math.max(converted, 0), 20); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiProgress.prototype, "_reachedMaximum", { + get: function () { + return this._overrideSuccess || ((this.value >= this.maximum) && this.autoSuccess); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiProgress.prototype, "percentage", { + get: function () { + var boundedValue = Math.min(Math.max(this.value, 0), this.maximum); + var percentage = (boundedValue / this.maximum) * 100; + return percentage.toFixed(this.precision); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiProgress.prototype, "classValue", { + set: function (classes) { + if (classes.includes("attached") || classes.includes("tiny")) { + this.showProgress = false; + } + if (classes.includes("success")) { + this._overrideSuccess = true; + } + }, + enumerable: true, + configurable: true + }); + SuiProgress.decorators = [ + { type: Component, args: [{ + selector: "sui-progress", + template: "\n
\n
{{ percentage }}%
\n
\n
\n \n
\n", + styles: ["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiProgress.ctorParameters = function () { return []; }; + SuiProgress.propDecorators = { + "_popupClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.progress",] },], + "autoSuccess": [{ type: Input },], + "showProgress": [{ type: Input },], + "value": [{ type: Input },], + "maximum": [{ type: Input },], + "precision": [{ type: Input },], + "_reachedMaximum": [{ type: HostBinding, args: ["class.success",] },], + "percentage": [{ type: HostBinding, args: ["attr.data-percent",] },], + "classValue": [{ type: Input, args: ["class",] },], + }; + return SuiProgress; +}()); +export { SuiProgress }; +//# sourceMappingURL=progress.js.map \ No newline at end of file diff --git a/dist/modules/progress/components/progress.js.map b/dist/modules/progress/components/progress.js.map new file mode 100644 index 000000000..8f553cb76 --- /dev/null +++ b/dist/modules/progress/components/progress.js.map @@ -0,0 +1 @@ +{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../../src/modules/progress/components/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;IA4G1D;6BAtFgC,IAAI;QAuFhC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QAEnB,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAEzB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;KAC7B;0BAjFU,8BAAK;;YACZ,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;;aAGvB,UAAiB,KAAY;;YAEzB,IAAM,SAAS,GAAG,CAAC,KAAK,CAAC;YAEzB,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;gBAC1B,MAAM,CAAC;aACV;YAED,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;SAC3B;;;;0BAGU,gCAAO;;YACd,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;;aAGzB,UAAmB,KAAY;;YAE3B,IAAM,SAAS,GAAG,CAAC,KAAK,CAAC;YAEzB,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;gBAC1B,MAAM,CAAC;aACV;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ChC;;;;;;gBAvGR,SAAS,SAAC;oBACP,QAAQ,EAAE,cAAc;oBACxB,QAAQ,EAAE,0MAOb;oBACG,MAAM,EAAE,CAAC,4EAKZ,CAAC;iBACD;;;;;kCAEI,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,gBAAgB;gCAS5B,KAAK;iCAGL,KAAK;0BAGL,KAAK;4BAgBL,KAAK;8BAgBL,KAAK;oCAgBL,WAAW,SAAC,eAAe;+BAK3B,WAAW,SAAC,mBAAmB;+BAS/B,KAAK,SAAC,OAAO;;sBAlGlB;;SAmBa,WAAW","sourcesContent":["import { Component, Input, HostBinding } from \"@angular/core\";\n\n@Component({\n selector: \"sui-progress\",\n template: `\n
\n
{{ percentage }}%
\n
\n
\n \n
\n`,\n styles: [`\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n`]\n})\nexport class SuiProgress {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.progress\")\n private _popupClasses:boolean = true;\n\n private _value:number;\n private _maximum:number;\n private _precision:number;\n\n private _overrideSuccess:boolean;\n\n @Input()\n public autoSuccess:boolean;\n\n @Input()\n public showProgress:boolean;\n\n @Input()\n public get value():number {\n return this._value;\n }\n\n public set value(value:number) {\n // Convert value from string to number where necessary.\n const converted = +value;\n\n if (Number.isNaN(converted)) {\n return;\n }\n\n this._value = converted;\n }\n\n @Input()\n public get maximum():number {\n return this._maximum;\n }\n\n public set maximum(value:number) {\n // Convert value from string to number where necessary.\n const converted = +value;\n\n if (Number.isNaN(converted)) {\n return;\n }\n\n this._maximum = converted;\n }\n\n @Input()\n public get precision():number {\n return this._precision;\n }\n\n public set precision(value:number) {\n // Convert value from string to number where necessary.\n const converted = +value;\n\n if (Number.isNaN(converted)) {\n return;\n }\n\n this._precision = Math.min(Math.max(converted, 0), 20);\n }\n\n @HostBinding(\"class.success\")\n private get _reachedMaximum():boolean {\n return this._overrideSuccess || ((this.value >= this.maximum) && this.autoSuccess);\n }\n\n @HostBinding(\"attr.data-percent\")\n public get percentage():string {\n const boundedValue = Math.min(Math.max(this.value, 0), this.maximum);\n\n const percentage = (boundedValue / this.maximum) * 100;\n\n return percentage.toFixed(this.precision);\n }\n\n @Input(\"class\")\n public set classValue(classes:string) {\n if (classes.includes(\"attached\") || classes.includes(\"tiny\")) {\n this.showProgress = false;\n }\n if (classes.includes(\"success\")) {\n this._overrideSuccess = true;\n }\n }\n\n constructor() {\n this.value = 0;\n this.maximum = 100;\n this.precision = 0;\n\n this._overrideSuccess = false;\n this.autoSuccess = true;\n this.showProgress = true;\n\n this._popupClasses = true;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/progress/components/progress.metadata.json b/dist/modules/progress/components/progress.metadata.json new file mode 100644 index 000000000..59cfcbaf9 --- /dev/null +++ b/dist/modules/progress/components/progress.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiProgress":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"sui-progress","template":"\n
\n
{{ percentage }}%
\n
\n
\n \n
\n","styles":["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"]}]}],"members":{"_popupClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":20,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":21,"character":5},"arguments":["class.progress"]}]}],"autoSuccess":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":5}}]}],"showProgress":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":5}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":5}}]}],"maximum":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":52,"character":5}}]}],"precision":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":5}}]}],"_reachedMaximum":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":84,"character":5},"arguments":["class.success"]}]}],"percentage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":89,"character":5},"arguments":["attr.data-percent"]}]}],"classValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":98,"character":5},"arguments":["class"]}]}],"__ctor__":[{"__symbolic":"constructor"}]}}}}] \ No newline at end of file diff --git a/dist/modules/progress/index.d.ts b/dist/modules/progress/index.d.ts new file mode 100644 index 000000000..bf07723f0 --- /dev/null +++ b/dist/modules/progress/index.d.ts @@ -0,0 +1,2 @@ +export * from "./components/progress"; +export * from "./progress.module"; diff --git a/dist/modules/progress/index.js b/dist/modules/progress/index.js new file mode 100644 index 000000000..88ba5e50f --- /dev/null +++ b/dist/modules/progress/index.js @@ -0,0 +1,3 @@ +export * from "./components/progress"; +export * from "./progress.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/progress/index.js.map b/dist/modules/progress/index.js.map new file mode 100644 index 000000000..5c719bac7 --- /dev/null +++ b/dist/modules/progress/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/progress/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AAEtC,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./components/progress\";\n\nexport * from \"./progress.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/progress/index.metadata.json b/dist/modules/progress/index.metadata.json new file mode 100644 index 000000000..5303500af --- /dev/null +++ b/dist/modules/progress/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/progress"},{"from":"./progress.module"}]}] \ No newline at end of file diff --git a/dist/modules/progress/progress.module.d.ts b/dist/modules/progress/progress.module.d.ts new file mode 100644 index 000000000..589de550a --- /dev/null +++ b/dist/modules/progress/progress.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiProgressModule { +} diff --git a/dist/modules/progress/progress.module.js b/dist/modules/progress/progress.module.js new file mode 100644 index 000000000..b0ef1d925 --- /dev/null +++ b/dist/modules/progress/progress.module.js @@ -0,0 +1,25 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiProgress } from "./components/progress"; +var SuiProgressModule = /** @class */ (function () { + function SuiProgressModule() { + } + SuiProgressModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule + ], + declarations: [ + SuiProgress + ], + exports: [ + SuiProgress + ] + },] }, + ]; + /** @nocollapse */ + SuiProgressModule.ctorParameters = function () { return []; }; + return SuiProgressModule; +}()); +export { SuiProgressModule }; +//# sourceMappingURL=progress.module.js.map \ No newline at end of file diff --git a/dist/modules/progress/progress.module.js.map b/dist/modules/progress/progress.module.js.map new file mode 100644 index 000000000..1003650e9 --- /dev/null +++ b/dist/modules/progress/progress.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"progress.module.js","sourceRoot":"","sources":["../../../src/modules/progress/progress.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;;;;;gBAEnD,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;qBACf;oBACD,YAAY,EAAE;wBACV,WAAW;qBACd;oBACD,OAAO,EAAE;wBACL,WAAW;qBACd;iBACJ;;;;4BAdD;;SAea,iBAAiB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiProgress } from \"./components/progress\";\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n SuiProgress\n ],\n exports: [\n SuiProgress\n ]\n})\nexport class SuiProgressModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/progress/progress.module.metadata.json b/dist/modules/progress/progress.module.metadata.json new file mode 100644 index 000000000..004cfa651 --- /dev/null +++ b/dist/modules/progress/progress.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiProgressModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/progress","name":"SuiProgress","line":9,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/progress","name":"SuiProgress","line":12,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/progress/public.d.ts b/dist/modules/progress/public.d.ts new file mode 100644 index 000000000..c15945dfe --- /dev/null +++ b/dist/modules/progress/public.d.ts @@ -0,0 +1 @@ +export { SuiProgressModule } from "./index"; diff --git a/dist/modules/progress/public.js b/dist/modules/progress/public.js new file mode 100644 index 000000000..0b073b696 --- /dev/null +++ b/dist/modules/progress/public.js @@ -0,0 +1,2 @@ +export { SuiProgressModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/progress/public.js.map b/dist/modules/progress/public.js.map new file mode 100644 index 000000000..b9bbc7fa9 --- /dev/null +++ b/dist/modules/progress/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/progress/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACpB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiProgressModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/progress/public.metadata.json b/dist/modules/progress/public.metadata.json new file mode 100644 index 000000000..4b677bbc0 --- /dev/null +++ b/dist/modules/progress/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiProgressModule"]}]}] \ No newline at end of file diff --git a/dist/modules/public.d.ts b/dist/modules/public.d.ts new file mode 100644 index 000000000..0630b7934 --- /dev/null +++ b/dist/modules/public.d.ts @@ -0,0 +1,15 @@ +export * from "./accordion/public"; +export * from "./checkbox/public"; +export * from "./collapse/public"; +export * from "./datepicker/public"; +export * from "./dimmer/public"; +export * from "./dropdown/public"; +export * from "./modal/public"; +export * from "./popup/public"; +export * from "./progress/public"; +export * from "./rating/public"; +export * from "./search/public"; +export * from "./select/public"; +export * from "./sidebar/public"; +export * from "./tabs/public"; +export * from "./transition/public"; diff --git a/dist/modules/public.js b/dist/modules/public.js new file mode 100644 index 000000000..ed455fb44 --- /dev/null +++ b/dist/modules/public.js @@ -0,0 +1,16 @@ +export * from "./accordion/public"; +export * from "./checkbox/public"; +export * from "./collapse/public"; +export * from "./datepicker/public"; +export * from "./dimmer/public"; +export * from "./dropdown/public"; +export * from "./modal/public"; +export * from "./popup/public"; +export * from "./progress/public"; +export * from "./rating/public"; +export * from "./search/public"; +export * from "./select/public"; +export * from "./sidebar/public"; +export * from "./tabs/public"; +export * from "./transition/public"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/public.js.map b/dist/modules/public.js.map new file mode 100644 index 000000000..e53826b50 --- /dev/null +++ b/dist/modules/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/modules/public.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./accordion/public\";\nexport * from \"./checkbox/public\";\nexport * from \"./collapse/public\";\nexport * from \"./datepicker/public\";\nexport * from \"./dimmer/public\";\nexport * from \"./dropdown/public\";\nexport * from \"./modal/public\";\nexport * from \"./popup/public\";\nexport * from \"./progress/public\";\nexport * from \"./rating/public\";\nexport * from \"./search/public\";\nexport * from \"./select/public\";\nexport * from \"./sidebar/public\";\nexport * from \"./tabs/public\";\nexport * from \"./transition/public\";\n"]} \ No newline at end of file diff --git a/dist/modules/public.metadata.json b/dist/modules/public.metadata.json new file mode 100644 index 000000000..623899ee0 --- /dev/null +++ b/dist/modules/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./accordion/public"},{"from":"./checkbox/public"},{"from":"./collapse/public"},{"from":"./datepicker/public"},{"from":"./dimmer/public"},{"from":"./dropdown/public"},{"from":"./modal/public"},{"from":"./popup/public"},{"from":"./progress/public"},{"from":"./rating/public"},{"from":"./search/public"},{"from":"./select/public"},{"from":"./sidebar/public"},{"from":"./tabs/public"},{"from":"./transition/public"}]}] \ No newline at end of file diff --git a/dist/modules/rating/components/rating.d.ts b/dist/modules/rating/components/rating.d.ts new file mode 100644 index 000000000..4322955d0 --- /dev/null +++ b/dist/modules/rating/components/rating.d.ts @@ -0,0 +1,20 @@ +import { EventEmitter } from "@angular/core"; +import { ICustomValueAccessorHost, CustomValueAccessor } from "../../../misc/util/index"; +export declare class SuiRating implements ICustomValueAccessorHost { + private _ratingClasses; + value: number; + valueChange: EventEmitter; + private _maximum; + maximum: number; + isReadonly: boolean; + readonly icons: undefined[]; + hoveredIndex: number; + constructor(); + onClick(i: number): void; + onMouseover(i: number): void; + onMouseout(): void; + writeValue(value: number): void; +} +export declare class SuiRatingValueAccessor extends CustomValueAccessor { + constructor(host: SuiRating); +} diff --git a/dist/modules/rating/components/rating.js b/dist/modules/rating/components/rating.js new file mode 100644 index 000000000..ca075580a --- /dev/null +++ b/dist/modules/rating/components/rating.js @@ -0,0 +1,93 @@ +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 __()); + }; +})(); +import { Component, Directive, Input, Output, EventEmitter, HostBinding, HostListener } from "@angular/core"; +import { customValueAccessorFactory, CustomValueAccessor } from "../../../misc/util/index"; +var SuiRating = /** @class */ (function () { + function SuiRating() { + this.hoveredIndex = -1; + this.value = 0; + this.valueChange = new EventEmitter(); + this.maximum = 5; + this.isReadonly = false; + this._ratingClasses = true; + } + Object.defineProperty(SuiRating.prototype, "maximum", { + get: function () { + return this._maximum; + }, + set: function (value) { + this._maximum = +value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiRating.prototype, "icons", { + get: function () { + // tslint:disable-next-line:prefer-literal + return new Array(this.maximum); + }, + enumerable: true, + configurable: true + }); + SuiRating.prototype.onClick = function (i) { + if (!this.isReadonly) { + this.value = i + 1; + this.valueChange.emit(this.value); + } + }; + SuiRating.prototype.onMouseover = function (i) { + this.hoveredIndex = i; + }; + SuiRating.prototype.onMouseout = function () { + this.hoveredIndex = -1; + }; + SuiRating.prototype.writeValue = function (value) { + this.value = value; + }; + SuiRating.decorators = [ + { type: Component, args: [{ + selector: "sui-rating", + template: "\n= i && !isReadonly\"\n [class.active]=\"value > i\">\n\n", + styles: ["\n:host.read-only .icon {\n cursor: auto\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiRating.ctorParameters = function () { return []; }; + SuiRating.propDecorators = { + "_ratingClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.rating",] },], + "valueChange": [{ type: Output },], + "maximum": [{ type: Input },], + "isReadonly": [{ type: HostBinding, args: ["class.read-only",] }, { type: Input },], + "onMouseout": [{ type: HostListener, args: ["mouseout",] },], + }; + return SuiRating; +}()); +export { SuiRating }; +var SuiRatingValueAccessor = /** @class */ (function (_super) { + __extends(SuiRatingValueAccessor, _super); + function SuiRatingValueAccessor(host) { + return _super.call(this, host) || this; + } + SuiRatingValueAccessor.decorators = [ + { type: Directive, args: [{ + selector: "sui-rating", + host: { "(valueChange)": "onChange($event)" }, + providers: [customValueAccessorFactory(SuiRatingValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiRatingValueAccessor.ctorParameters = function () { return [ + { type: SuiRating, }, + ]; }; + return SuiRatingValueAccessor; +}(CustomValueAccessor)); +export { SuiRatingValueAccessor }; +//# sourceMappingURL=rating.js.map \ No newline at end of file diff --git a/dist/modules/rating/components/rating.js.map b/dist/modules/rating/components/rating.js.map new file mode 100644 index 000000000..f0092526c --- /dev/null +++ b/dist/modules/rating/components/rating.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rating.js","sourceRoot":"","sources":["../../../../src/modules/rating/components/rating.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAA4B,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;;IAmDjH;4BAF6B,CAAC,CAAC;QAG3B,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,IAAI,YAAY,EAAU,C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,SAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,EAAE,eAAe,EAAE,kBAAkB,EAAE;oBAC7C,SAAS,EAAE,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,CAAC;iBAClE;;;;gBAnEY,SAAS;;iCApBtB;EAwF4C,mBAAmB;SAAlD,sBAAsB","sourcesContent":["import { Component, Directive, Input, Output, EventEmitter, HostBinding, HostListener } from \"@angular/core\";\nimport { ICustomValueAccessorHost, customValueAccessorFactory, CustomValueAccessor } from \"../../../misc/util/index\";\n\n@Component({\n selector: \"sui-rating\",\n template: `\n= i && !isReadonly\"\n [class.active]=\"value > i\">\n\n`,\n styles: [`\n:host.read-only .icon {\n cursor: auto\n}\n`]\n})\nexport class SuiRating implements ICustomValueAccessorHost {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.rating\")\n private _ratingClasses:boolean;\n\n public value:number;\n\n @Output()\n public valueChange:EventEmitter;\n\n private _maximum:number;\n\n @Input()\n public get maximum():number {\n return this._maximum;\n }\n\n public set maximum(value:number) {\n this._maximum = +value;\n }\n\n @HostBinding(\"class.read-only\")\n @Input()\n public isReadonly:boolean;\n\n public get icons():undefined[] {\n // tslint:disable-next-line:prefer-literal\n return new Array(this.maximum);\n }\n\n public hoveredIndex:number = -1;\n\n constructor() {\n this.value = 0;\n this.valueChange = new EventEmitter();\n\n this.maximum = 5;\n this.isReadonly = false;\n\n this._ratingClasses = true;\n }\n\n public onClick(i:number):void {\n if (!this.isReadonly) {\n this.value = i + 1;\n this.valueChange.emit(this.value);\n }\n }\n\n public onMouseover(i:number):void {\n this.hoveredIndex = i;\n }\n\n @HostListener(\"mouseout\")\n public onMouseout():void {\n this.hoveredIndex = -1;\n }\n\n public writeValue(value:number):void {\n this.value = value;\n }\n}\n\n@Directive({\n selector: \"sui-rating\",\n host: { \"(valueChange)\": \"onChange($event)\" },\n providers: [customValueAccessorFactory(SuiRatingValueAccessor)]\n})\nexport class SuiRatingValueAccessor extends CustomValueAccessor {\n constructor(host:SuiRating) {\n super(host);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/rating/components/rating.metadata.json b/dist/modules/rating/components/rating.metadata.json new file mode 100644 index 000000000..e8259410a --- /dev/null +++ b/dist/modules/rating/components/rating.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiRating":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"sui-rating","template":"\n= i && !isReadonly\"\n [class.active]=\"value > i\">\n\n","styles":["\n:host.read-only .icon {\n cursor: auto\n}\n"]}]}],"members":{"_ratingClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":21,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":22,"character":5},"arguments":["class.rating"]}]}],"valueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":27,"character":5}}]}],"maximum":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":5}}]}],"isReadonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":41,"character":5},"arguments":["class.read-only"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor"}],"onClick":[{"__symbolic":"method"}],"onMouseover":[{"__symbolic":"method"}],"onMouseout":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":73,"character":5},"arguments":["mouseout"]}]}],"writeValue":[{"__symbolic":"method"}]}},"SuiRatingValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":88,"character":44},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":83,"character":1},"arguments":[{"selector":"sui-rating","host":{"(valueChange)":"onChange($event)","$quoted$":["(valueChange)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":86,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiRatingValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiRating"}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/rating/index.d.ts b/dist/modules/rating/index.d.ts new file mode 100644 index 000000000..fb9752189 --- /dev/null +++ b/dist/modules/rating/index.d.ts @@ -0,0 +1,2 @@ +export * from "./components/rating"; +export * from "./rating.module"; diff --git a/dist/modules/rating/index.js b/dist/modules/rating/index.js new file mode 100644 index 000000000..9ed835b3e --- /dev/null +++ b/dist/modules/rating/index.js @@ -0,0 +1,3 @@ +export * from "./components/rating"; +export * from "./rating.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/rating/index.js.map b/dist/modules/rating/index.js.map new file mode 100644 index 000000000..de36d171e --- /dev/null +++ b/dist/modules/rating/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/rating/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AAEpC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./components/rating\";\n\nexport * from \"./rating.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/rating/index.metadata.json b/dist/modules/rating/index.metadata.json new file mode 100644 index 000000000..9e753e76d --- /dev/null +++ b/dist/modules/rating/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/rating"},{"from":"./rating.module"}]}] \ No newline at end of file diff --git a/dist/modules/rating/public.d.ts b/dist/modules/rating/public.d.ts new file mode 100644 index 000000000..4cc3e4b9c --- /dev/null +++ b/dist/modules/rating/public.d.ts @@ -0,0 +1 @@ +export { SuiRatingModule } from "./index"; diff --git a/dist/modules/rating/public.js b/dist/modules/rating/public.js new file mode 100644 index 000000000..ba155b150 --- /dev/null +++ b/dist/modules/rating/public.js @@ -0,0 +1,2 @@ +export { SuiRatingModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/rating/public.js.map b/dist/modules/rating/public.js.map new file mode 100644 index 000000000..0fa7af970 --- /dev/null +++ b/dist/modules/rating/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/rating/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EAClB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiRatingModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/rating/public.metadata.json b/dist/modules/rating/public.metadata.json new file mode 100644 index 000000000..e1c41f32b --- /dev/null +++ b/dist/modules/rating/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiRatingModule"]}]}] \ No newline at end of file diff --git a/dist/modules/rating/rating.module.d.ts b/dist/modules/rating/rating.module.d.ts new file mode 100644 index 000000000..d3331e33c --- /dev/null +++ b/dist/modules/rating/rating.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiRatingModule { +} diff --git a/dist/modules/rating/rating.module.js b/dist/modules/rating/rating.module.js new file mode 100644 index 000000000..4c290172b --- /dev/null +++ b/dist/modules/rating/rating.module.js @@ -0,0 +1,29 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; +import { SuiRating, SuiRatingValueAccessor } from "./components/rating"; +var SuiRatingModule = /** @class */ (function () { + function SuiRatingModule() { + } + SuiRatingModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + FormsModule, + CommonModule + ], + declarations: [ + SuiRating, + SuiRatingValueAccessor + ], + exports: [ + SuiRating, + SuiRatingValueAccessor + ] + },] }, + ]; + /** @nocollapse */ + SuiRatingModule.ctorParameters = function () { return []; }; + return SuiRatingModule; +}()); +export { SuiRatingModule }; +//# sourceMappingURL=rating.module.js.map \ No newline at end of file diff --git a/dist/modules/rating/rating.module.js.map b/dist/modules/rating/rating.module.js.map new file mode 100644 index 000000000..5cdc2b54f --- /dev/null +++ b/dist/modules/rating/rating.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rating.module.js","sourceRoot":"","sources":["../../../src/modules/rating/rating.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;;;;;gBAEvE,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,WAAW;wBACX,YAAY;qBACf;oBACD,YAAY,EAAE;wBACV,SAAS;wBACT,sBAAsB;qBACzB;oBACD,OAAO,EAAE;wBACL,SAAS;wBACT,sBAAsB;qBACzB;iBACJ;;;;0BAlBD;;SAmBa,eAAe","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { SuiRating, SuiRatingValueAccessor } from \"./components/rating\";\n\n@NgModule({\n imports: [\n FormsModule,\n CommonModule\n ],\n declarations: [\n SuiRating,\n SuiRatingValueAccessor\n ],\n exports: [\n SuiRating,\n SuiRatingValueAccessor\n ]\n})\nexport class SuiRatingModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/rating/rating.module.metadata.json b/dist/modules/rating/rating.module.metadata.json new file mode 100644 index 000000000..ee6030e1a --- /dev/null +++ b/dist/modules/rating/rating.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiRatingModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":7,"character":8},{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/rating","name":"SuiRating","line":11,"character":8},{"__symbolic":"reference","module":"./components/rating","name":"SuiRatingValueAccessor","line":12,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/rating","name":"SuiRating","line":15,"character":8},{"__symbolic":"reference","module":"./components/rating","name":"SuiRatingValueAccessor","line":16,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/search/components/search-result.d.ts b/dist/modules/search/components/search-result.d.ts new file mode 100644 index 000000000..29e8d3af2 --- /dev/null +++ b/dist/modules/search/components/search-result.d.ts @@ -0,0 +1,14 @@ +import { ViewContainerRef, TemplateRef } from "@angular/core"; +import { SuiComponentFactory } from "../../../misc/util/index"; +import { IResultContext } from "./search"; +export declare class SuiSearchResult { + componentFactory: SuiComponentFactory; + private _optionClasses; + value: T; + query: string; + formatter: (obj: T, query: string) => string; + private _template?; + template: TemplateRef> | undefined; + templateSibling: ViewContainerRef; + constructor(componentFactory: SuiComponentFactory); +} diff --git a/dist/modules/search/components/search-result.js b/dist/modules/search/components/search-result.js new file mode 100644 index 000000000..54d19d43c --- /dev/null +++ b/dist/modules/search/components/search-result.js @@ -0,0 +1,49 @@ +import { Component, ViewChild, ViewContainerRef, HostBinding, Input, TemplateRef } from "@angular/core"; +import { SuiComponentFactory } from "../../../misc/util/index"; +// See https://github.com/Microsoft/TypeScript/issues/13449. +var templateRef = TemplateRef; +var SuiSearchResult = /** @class */ (function () { + function SuiSearchResult(componentFactory) { + this.componentFactory = componentFactory; + this._optionClasses = true; + // By default we make this function return an empty string, for the brief moment when it isn't displaying the correct label. + this.formatter = function (value) { return ""; }; + } + Object.defineProperty(SuiSearchResult.prototype, "template", { + get: function () { + return this._template; + }, + set: function (template) { + this._template = template; + if (this.template) { + this.componentFactory.createView(this.templateSibling, this.template, { + $implicit: this.value, + query: this.query + }); + } + }, + enumerable: true, + configurable: true + }); + SuiSearchResult.decorators = [ + { type: Component, args: [{ + selector: "sui-search-result", + template: "\n\n\n" + },] }, + ]; + /** @nocollapse */ + SuiSearchResult.ctorParameters = function () { return [ + { type: SuiComponentFactory, }, + ]; }; + SuiSearchResult.propDecorators = { + "_optionClasses": [{ type: HostBinding, args: ["class.result",] },], + "value": [{ type: Input },], + "query": [{ type: Input },], + "formatter": [{ type: Input },], + "template": [{ type: Input },], + "templateSibling": [{ type: ViewChild, args: ["templateSibling", { read: ViewContainerRef },] },], + }; + return SuiSearchResult; +}()); +export { SuiSearchResult }; +//# sourceMappingURL=search-result.js.map \ No newline at end of file diff --git a/dist/modules/search/components/search-result.js.map b/dist/modules/search/components/search-result.js.map new file mode 100644 index 000000000..6ba99227e --- /dev/null +++ b/dist/modules/search/components/search-result.js.map @@ -0,0 +1 @@ +{"version":3,"file":"search-result.js","sourceRoot":"","sources":["../../../../src/modules/search/components/search-result.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAyB,WAAW,EAC1E,KAAK,EAAE,WAAW,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAuB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;;AAIpF,IAAM,WAAW,GAAG,WAAW,CAAC;;IA6C5B,yBAAmB,gBAAoC;QAApC,qBAAgB,GAAhB,gBAAgB,CAAoB;QACnD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;;QAG3B,IAAI,CAAC,SAAS,GAAG,UAAA,KAAK,IAAI,OAAA,EAAE,EAAF,CAAE,CAAC;KAChC;0BAvBU,qCAAQ;;YACf,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;;aAG1B,UAAoB,QAAmD;YACnE,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1B,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAChB,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,QAAQ,EAAE;oBAClE,SAAS,EAAE,IAAI,CAAC,KAAK;oBACrB,KAAK,EAAE,IAAI,CAAC,KAAK;iBACpB,CAAC,CAAC;aACN;SACJ;;;;;gBArCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,mBAAmB;oBAC7B,QAAQ,EAAE,+GAGb;iBACA;;;;gBAZ6B,mBAAmB;;;mCAe5C,WAAW,SAAC,cAAc;0BAG1B,KAAK;0BAGL,KAAK;8BAIL,KAAK;6BAKL,KAAK;oCAgBL,SAAS,SAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;;0BAlD5D;;SAiBa,eAAe","sourcesContent":["import {\n Component, ViewChild, ViewContainerRef, Renderer2, ElementRef, HostBinding,\n Input, TemplateRef\n} from \"@angular/core\";\nimport { ITemplateRefContext, SuiComponentFactory } from \"../../../misc/util/index\";\nimport { IResultContext } from \"./search\";\n\n// See https://github.com/Microsoft/TypeScript/issues/13449.\nconst templateRef = TemplateRef;\n\n@Component({\n selector: \"sui-search-result\",\n template: `\n\n\n`\n})\nexport class SuiSearchResult {\n // Sets the Semantic UI classes on the host element.\n @HostBinding(\"class.result\")\n private _optionClasses:boolean;\n\n @Input()\n public value:T;\n\n @Input()\n public query:string;\n\n // Returns the label from a given value.\n @Input()\n public formatter:(obj:T, query:string) => string;\n\n private _template?:TemplateRef>;\n\n @Input()\n public get template():TemplateRef> | undefined {\n return this._template;\n }\n\n public set template(template:TemplateRef> | undefined) {\n this._template = template;\n if (this.template) {\n this.componentFactory.createView(this.templateSibling, this.template, {\n $implicit: this.value,\n query: this.query\n });\n }\n }\n\n // Placeholder to draw template beside.\n @ViewChild(\"templateSibling\", { read: ViewContainerRef })\n public templateSibling:ViewContainerRef;\n\n constructor(public componentFactory:SuiComponentFactory) {\n this._optionClasses = true;\n\n // By default we make this function return an empty string, for the brief moment when it isn't displaying the correct label.\n this.formatter = value => \"\";\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/search/components/search-result.metadata.json b/dist/modules/search/components/search-result.metadata.json new file mode 100644 index 000000000..da7ec6bae --- /dev/null +++ b/dist/modules/search/components/search-result.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiSearchResult":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":10,"character":1},"arguments":[{"selector":"sui-search-result","template":"\n\n\n"}]}],"members":{"_optionClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":19,"character":5},"arguments":["class.result"]}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":22,"character":5}}]}],"query":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":5}}]}],"formatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":5}}]}],"template":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":5}}]}],"templateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":50,"character":5},"arguments":["templateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":50,"character":42}}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":53,"character":40}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/search/components/search.d.ts b/dist/modules/search/components/search.d.ts new file mode 100644 index 000000000..4458cb9ef --- /dev/null +++ b/dist/modules/search/components/search.d.ts @@ -0,0 +1,55 @@ +import { AfterViewInit, EventEmitter, ElementRef, TemplateRef, Renderer2, OnDestroy } from "@angular/core"; +import { ITemplateRefContext } from "../../../misc/util/index"; +import { DropdownService } from "../../dropdown/index"; +import { ISearchLocaleValues, RecursivePartial, SuiLocalizationService } from "../../../behaviors/localization/index"; +import { SearchService } from "../services/search.service"; +import { LookupFn, FilterFn } from "../helpers/lookup-fn"; +export interface IResultContext extends ITemplateRefContext { + query: string; +} +export declare class SuiSearch implements AfterViewInit, OnDestroy { + private _element; + private _localizationService; + dropdownService: DropdownService; + searchService: SearchService; + private _menu; + private _searchClasses; + readonly isActive: boolean; + hasIcon: boolean; + allowEmptyQuery: boolean; + private _allowEmptyQuery; + private _placeholder; + placeholder: string; + private _localeValues; + localeOverrides: RecursivePartial; + readonly localeValues: ISearchLocaleValues; + query: string; + options: T[] | undefined; + optionsFilter: FilterFn | undefined; + optionsLookup: LookupFn | undefined; + optionsField: string | undefined; + private _resultFormatter?; + resultFormatter: (result: T, query: string) => string; + resultTemplate: TemplateRef>; + retainSelectedResult: boolean; + searchDelay: number; + readonly isSearching: boolean; + maxResults: number; + readonly results: T[]; + selectedResult?: T; + onResultSelected: EventEmitter; + transition: string; + transitionDuration: number; + private _documentClickListener; + constructor(_element: ElementRef, renderer: Renderer2, _localizationService: SuiLocalizationService); + ngAfterViewInit(): void; + private onLocaleUpdate(); + select(result: T): void; + onClick(e: MouseEvent): void; + private onFocusIn(); + private open(); + private onFocusOut(e); + onDocumentClick(e: MouseEvent): void; + readValue(object: T): string; + ngOnDestroy(): void; +} diff --git a/dist/modules/search/components/search.js b/dist/modules/search/components/search.js new file mode 100644 index 000000000..b5fac4977 --- /dev/null +++ b/dist/modules/search/components/search.js @@ -0,0 +1,249 @@ +import { Component, ViewChild, HostBinding, Input, HostListener, EventEmitter, Output, ElementRef, TemplateRef, Renderer2 } from "@angular/core"; +import { Util } from "../../../misc/util/index"; +import { DropdownService, SuiDropdownMenu } from "../../dropdown/index"; +import { SuiLocalizationService } from "../../../behaviors/localization/index"; +import { SearchService } from "../services/search.service"; +var SuiSearch = /** @class */ (function () { + function SuiSearch(_element, renderer, _localizationService) { + var _this = this; + this._element = _element; + this._localizationService = _localizationService; + this.dropdownService = new DropdownService(); + this.searchService = new SearchService(); + this.onLocaleUpdate(); + this._localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); + this._searchClasses = true; + this.hasIcon = true; + this.allowEmptyQuery = false; + this.retainSelectedResult = true; + this.searchDelay = 200; + this.maxResults = 7; + this.onResultSelected = new EventEmitter(); + this.transition = "scale"; + this.transitionDuration = 200; + this._documentClickListener = renderer.listen("document", "click", function (e) { return _this.onDocumentClick(e); }); + } + Object.defineProperty(SuiSearch.prototype, "isActive", { + get: function () { + return this.dropdownService.isOpen; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "allowEmptyQuery", { + get: function () { + return this._allowEmptyQuery; + }, + set: + // Sets whether the search element display result with empty query. + function (allowEmptyQuery) { + this._allowEmptyQuery = allowEmptyQuery; + this.searchService.allowEmptyQuery = allowEmptyQuery; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "placeholder", { + get: + // Gets & sets the placeholder text displayed inside the text input. + function () { + return this._placeholder || this.localeValues.placeholder; + }, + set: function (placeholder) { + this._placeholder = placeholder; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "localeValues", { + get: function () { + return this._localizationService.override(this._localeValues, this.localeOverrides); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "query", { + get: function () { + return this.searchService.query; + }, + set: function (query) { + var _this = this; + this.selectedResult = undefined; + // Initialise a delayed search. + this.searchService.updateQueryDelayed(query, function () { + // Set the results open state depending on whether a query has been entered. + return + // Set the results open state depending on whether a query has been entered. + _this.dropdownService.setOpenState(_this.searchService.query.length > 0 || _this.allowEmptyQuery); + }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "options", { + set: function (options) { + if (options) { + this.searchService.options = options; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "optionsFilter", { + set: function (filter) { + if (filter) { + this.searchService.optionsFilter = filter; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "optionsLookup", { + set: function (lookupFn) { + this.searchService.optionsLookup = lookupFn; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "optionsField", { + set: function (field) { + this.searchService.optionsField = field; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "resultFormatter", { + get: function () { + var _this = this; + if (this._resultFormatter) { + return this._resultFormatter; + } + else if (this.searchService.optionsLookup) { + return function (r) { return _this.readValue(r); }; + } + else { + return function (r, q) { return _this.searchService.highlightMatches(_this.readValue(r), q); }; + } + }, + set: function (formatter) { + this._resultFormatter = formatter; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "searchDelay", { + set: function (delay) { + this.searchService.searchDelay = delay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "isSearching", { + get: function () { + return this.searchService.isSearching; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSearch.prototype, "results", { + get: function () { + return this.searchService.results.slice(0, this.maxResults); + }, + enumerable: true, + configurable: true + }); + SuiSearch.prototype.ngAfterViewInit = function () { + this._menu.service = this.dropdownService; + }; + SuiSearch.prototype.onLocaleUpdate = function () { + this._localeValues = this._localizationService.get().search; + }; + // Selects a result. + // Selects a result. + SuiSearch.prototype.select = + // Selects a result. + function (result) { + this.onResultSelected.emit(result); + this.dropdownService.setOpenState(false); + if (this.retainSelectedResult) { + this.selectedResult = result; + this.searchService.updateQuery(this.readValue(result)); + } + else { + this.searchService.updateQuery(""); + } + }; + SuiSearch.prototype.onClick = function (e) { + this.open(); + }; + SuiSearch.prototype.onFocusIn = function () { + if (!this.dropdownService.isAnimating) { + this.open(); + } + }; + SuiSearch.prototype.open = function () { + if (this.searchService.query.length > 0 || this.allowEmptyQuery) { + // Only open on click when there is a query entered. + this.dropdownService.setOpenState(true); + } + }; + SuiSearch.prototype.onFocusOut = function (e) { + if (!this._element.nativeElement.contains(e.relatedTarget)) { + this.dropdownService.setOpenState(false); + } + }; + SuiSearch.prototype.onDocumentClick = function (e) { + if (!this._element.nativeElement.contains(e.target)) { + this.dropdownService.setOpenState(false); + } + }; + // Reads the specified field from an item. + // Reads the specified field from an item. + SuiSearch.prototype.readValue = + // Reads the specified field from an item. + function (object) { + return Util.Object.readValue(object, this.searchService.optionsField); + }; + SuiSearch.prototype.ngOnDestroy = function () { + this._documentClickListener(); + }; + SuiSearch.decorators = [ + { type: Component, args: [{ + selector: "sui-search", + template: "\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n", + styles: ["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiSearch.ctorParameters = function () { return [ + { type: ElementRef, }, + { type: Renderer2, }, + { type: SuiLocalizationService, }, + ]; }; + SuiSearch.propDecorators = { + "_menu": [{ type: ViewChild, args: [SuiDropdownMenu,] },], + "_searchClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.search",] },], + "isActive": [{ type: HostBinding, args: ["class.active",] },], + "hasIcon": [{ type: Input },], + "allowEmptyQuery": [{ type: Input },], + "placeholder": [{ type: Input },], + "options": [{ type: Input },], + "optionsFilter": [{ type: Input },], + "optionsLookup": [{ type: Input },], + "optionsField": [{ type: Input },], + "resultFormatter": [{ type: Input },], + "resultTemplate": [{ type: Input },], + "retainSelectedResult": [{ type: Input },], + "searchDelay": [{ type: Input },], + "isSearching": [{ type: HostBinding, args: ["class.loading",] },], + "maxResults": [{ type: Input },], + "onResultSelected": [{ type: Output, args: ["resultSelected",] },], + "transition": [{ type: Input },], + "transitionDuration": [{ type: Input },], + "onFocusIn": [{ type: HostListener, args: ["focusin",] },], + "onFocusOut": [{ type: HostListener, args: ["focusout", ["$event"],] },], + }; + return SuiSearch; +}()); +export { SuiSearch }; +//# sourceMappingURL=search.js.map \ No newline at end of file diff --git a/dist/modules/search/components/search.js.map b/dist/modules/search/components/search.js.map new file mode 100644 index 000000000..206d03741 --- /dev/null +++ b/dist/modules/search/components/search.js.map @@ -0,0 +1 @@ +{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../src/modules/search/components/search.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAiB,YAAY,EACrE,YAAY,EAAE,MAAM,EAAa,UAAU,EAAE,WAAW,EAAE,SAAS,EACtE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAoC,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAyC,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;;IA8LvD,mBAAoB,QAAmB,EAAE,QAAkB,EAAU,oBAA2C;QAAhH,iBAoBC;QApBmB,aAAQ,GAAR,QAAQ,CAAW;QAA8B,yBAAoB,GAApB,oBAAoB,CAAuB;QAC5G,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;QAC7C,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,EAAQ,CAAC;QAE/C,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,SAAS,CAAC,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,iMAUZ,CAAC;iBACD;;;;gBAlDoC,UAAU;gBAAe,SAAS;gBAIvB,sBAAsB;;;0BAmDjE,SAAS,SAAC,eAAe;mCAKzB,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,cAAc;6BAG1B,WAAW,SAAC,cAAc;4BAM1B,KAAK;oCAIL,KAAK;gCAaL,KAAK;4BA6BL,KAAK;kCAOL,KAAK;kCAOL,KAAK;iCAKL,KAAK;oCAiBL,KAAK;mCAKL,KAAK;yCAGL,KAAK;gCAGL,KAAK;gCAKL,WAAW,SAAC,eAAe;+BAK3B,KAAK;qCAWL,MAAM,SAAC,gBAAgB;+BAGvB,KAAK;uCAGL,KAAK;8BAoDL,YAAY,SAAC,SAAS;+BActB,YAAY,SAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;oBAlQxC;;SAqDa,SAAS","sourcesContent":["import {\n Component, ViewChild, HostBinding, Input, AfterViewInit, HostListener,\n EventEmitter, Output, Directive, ElementRef, TemplateRef, Renderer2, OnDestroy\n} from \"@angular/core\";\nimport { Util, ITemplateRefContext, IFocusEvent } from \"../../../misc/util/index\";\nimport { DropdownService, SuiDropdownMenu } from \"../../dropdown/index\";\nimport { ISearchLocaleValues, RecursivePartial, SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SearchService } from \"../services/search.service\";\nimport { LookupFn, FilterFn } from \"../helpers/lookup-fn\";\n\nexport interface IResultContext extends ITemplateRefContext {\n query:string;\n}\n\n@Component({\n selector: \"sui-search\",\n template: `\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n`,\n styles: [`\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n`]\n})\nexport class SuiSearch implements AfterViewInit, OnDestroy {\n public dropdownService:DropdownService;\n public searchService:SearchService;\n\n @ViewChild(SuiDropdownMenu)\n private _menu:SuiDropdownMenu;\n\n // Sets the Semantic UI classes on the host element.\n // Doing it on the host enables use in menus etc.\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.search\")\n private _searchClasses:boolean;\n\n @HostBinding(\"class.active\")\n public get isActive():boolean {\n return this.dropdownService.isOpen;\n }\n\n // Sets whether the search element has a visible search icon.\n @Input()\n public hasIcon:boolean;\n\n // Sets whether the search element display result with empty query.\n @Input()\n public set allowEmptyQuery(allowEmptyQuery:boolean) {\n this._allowEmptyQuery = allowEmptyQuery;\n this.searchService.allowEmptyQuery = allowEmptyQuery;\n }\n public get allowEmptyQuery():boolean {\n return this._allowEmptyQuery;\n }\n\n private _allowEmptyQuery:boolean;\n private _placeholder:string;\n\n // Gets & sets the placeholder text displayed inside the text input.\n @Input()\n public get placeholder():string {\n return this._placeholder || this.localeValues.placeholder;\n }\n\n public set placeholder(placeholder:string) {\n this._placeholder = placeholder;\n }\n\n private _localeValues:ISearchLocaleValues;\n\n public localeOverrides:RecursivePartial;\n\n public get localeValues():ISearchLocaleValues {\n return this._localizationService.override<\"search\">(this._localeValues, this.localeOverrides);\n }\n\n public get query():string {\n return this.searchService.query;\n }\n\n public set query(query:string) {\n this.selectedResult = undefined;\n // Initialise a delayed search.\n this.searchService.updateQueryDelayed(query, () =>\n // Set the results open state depending on whether a query has been entered.\n this.dropdownService.setOpenState(this.searchService.query.length > 0 || this.allowEmptyQuery));\n }\n\n @Input()\n public set options(options:T[] | undefined) {\n if (options) {\n this.searchService.options = options;\n }\n }\n\n @Input()\n public set optionsFilter(filter:FilterFn | undefined) {\n if (filter) {\n this.searchService.optionsFilter = filter;\n }\n }\n\n @Input()\n public set optionsLookup(lookupFn:LookupFn | undefined) {\n this.searchService.optionsLookup = lookupFn;\n }\n\n @Input()\n public set optionsField(field:string | undefined) {\n this.searchService.optionsField = field;\n }\n\n private _resultFormatter?:(r:T, q:string) => string;\n\n public get resultFormatter():(result:T, query:string) => string {\n if (this._resultFormatter) {\n return this._resultFormatter;\n } else if (this.searchService.optionsLookup) {\n return r => this.readValue(r);\n } else {\n return (r, q) => this.searchService.highlightMatches(this.readValue(r), q);\n }\n }\n\n @Input()\n public set resultFormatter(formatter:(result:T, query:string) => string) {\n this._resultFormatter = formatter;\n }\n\n @Input()\n public resultTemplate:TemplateRef>;\n\n @Input()\n public retainSelectedResult:boolean;\n\n @Input()\n public set searchDelay(delay:number) {\n this.searchService.searchDelay = delay;\n }\n\n @HostBinding(\"class.loading\")\n public get isSearching():boolean {\n return this.searchService.isSearching;\n }\n\n @Input()\n public maxResults:number;\n\n public get results():T[] {\n return this.searchService.results.slice(0, this.maxResults);\n }\n\n // Stores the currently selected result.\n public selectedResult?:T;\n\n // Emits whenever a new result is selected.\n @Output(\"resultSelected\")\n public onResultSelected:EventEmitter;\n\n @Input()\n public transition:string;\n\n @Input()\n public transitionDuration:number;\n\n private _documentClickListener:() => void;\n\n constructor(private _element:ElementRef, renderer:Renderer2, private _localizationService:SuiLocalizationService) {\n this.dropdownService = new DropdownService();\n this.searchService = new SearchService();\n\n this.onLocaleUpdate();\n this._localizationService.onLanguageUpdate.subscribe(() => this.onLocaleUpdate());\n\n this._searchClasses = true;\n this.hasIcon = true;\n this.allowEmptyQuery = false;\n this.retainSelectedResult = true;\n this.searchDelay = 200;\n this.maxResults = 7;\n\n this.onResultSelected = new EventEmitter();\n\n this.transition = \"scale\";\n this.transitionDuration = 200;\n\n this._documentClickListener = renderer.listen(\"document\", \"click\", (e:MouseEvent) => this.onDocumentClick(e));\n }\n\n public ngAfterViewInit():void {\n this._menu.service = this.dropdownService;\n }\n\n private onLocaleUpdate():void {\n this._localeValues = this._localizationService.get().search;\n }\n\n // Selects a result.\n public select(result:T):void {\n this.onResultSelected.emit(result);\n this.dropdownService.setOpenState(false);\n\n if (this.retainSelectedResult) {\n this.selectedResult = result;\n this.searchService.updateQuery(this.readValue(result));\n } else {\n this.searchService.updateQuery(\"\");\n }\n }\n\n public onClick(e:MouseEvent):void {\n this.open();\n }\n\n @HostListener(\"focusin\")\n private onFocusIn():void {\n if (!this.dropdownService.isAnimating) {\n this.open();\n }\n }\n\n private open():void {\n if (this.searchService.query.length > 0 || this.allowEmptyQuery) {\n // Only open on click when there is a query entered.\n this.dropdownService.setOpenState(true);\n }\n }\n\n @HostListener(\"focusout\", [\"$event\"])\n private onFocusOut(e:IFocusEvent):void {\n if (!this._element.nativeElement.contains(e.relatedTarget)) {\n this.dropdownService.setOpenState(false);\n }\n }\n\n public onDocumentClick(e:MouseEvent):void {\n if (!this._element.nativeElement.contains(e.target)) {\n this.dropdownService.setOpenState(false);\n }\n }\n\n // Reads the specified field from an item.\n public readValue(object:T):string {\n return Util.Object.readValue(object, this.searchService.optionsField);\n }\n\n public ngOnDestroy():void {\n this._documentClickListener();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/search/components/search.metadata.json b/dist/modules/search/components/search.metadata.json new file mode 100644 index 000000000..ae8ab5ff6 --- /dev/null +++ b/dist/modules/search/components/search.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"IResultContext":{"__symbolic":"interface"},"SuiSearch":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"selector":"sui-search","template":"\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n","styles":["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"]}]}],"members":{"_menu":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":57,"character":5},"arguments":[{"__symbolic":"reference","module":"../../dropdown/index","name":"SuiDropdownMenu","line":57,"character":15}]}]}],"_searchClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":62,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":63,"character":5},"arguments":["class.search"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":66,"character":5},"arguments":["class.active"]}]}],"hasIcon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":72,"character":5}}]}],"allowEmptyQuery":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":76,"character":5}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":89,"character":5}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":118,"character":5}}]}],"optionsFilter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":125,"character":5}}]}],"optionsLookup":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":132,"character":5}}]}],"optionsField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":137,"character":5}}]}],"resultFormatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":154,"character":5}}]}],"resultTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":159,"character":5}}]}],"retainSelectedResult":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":162,"character":5}}]}],"searchDelay":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":165,"character":5}}]}],"isSearching":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":170,"character":5},"arguments":["class.loading"]}]}],"maxResults":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":175,"character":5}}]}],"onResultSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":186,"character":5},"arguments":["resultSelected"]}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":189,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":192,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":197,"character":33},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":197,"character":54},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":197,"character":94}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"onLocaleUpdate":[{"__symbolic":"method"}],"select":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method"}],"onFocusIn":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":244,"character":5},"arguments":["focusin"]}]}],"open":[{"__symbolic":"method"}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":258,"character":5},"arguments":["focusout",["$event"]]}]}],"onDocumentClick":[{"__symbolic":"method"}],"readValue":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/search/helpers/lookup-fn.d.ts b/dist/modules/search/helpers/lookup-fn.d.ts new file mode 100644 index 000000000..5797d7aae --- /dev/null +++ b/dist/modules/search/helpers/lookup-fn.d.ts @@ -0,0 +1,3 @@ +export declare type LookupFnResult = Promise; +export declare type LookupFn = (query: string | undefined, initial?: U | U[]) => LookupFnResult | LookupFnResult; +export declare type FilterFn = (options: T[], query: string) => T[] | false; diff --git a/dist/modules/search/helpers/lookup-fn.js b/dist/modules/search/helpers/lookup-fn.js new file mode 100644 index 000000000..81fe19cf7 --- /dev/null +++ b/dist/modules/search/helpers/lookup-fn.js @@ -0,0 +1 @@ +//# sourceMappingURL=lookup-fn.js.map \ No newline at end of file diff --git a/dist/modules/search/helpers/lookup-fn.js.map b/dist/modules/search/helpers/lookup-fn.js.map new file mode 100644 index 000000000..9f26fefe6 --- /dev/null +++ b/dist/modules/search/helpers/lookup-fn.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lookup-fn.js","sourceRoot":"","sources":["../../../../src/modules/search/helpers/lookup-fn.ts"],"names":[],"mappings":"","sourcesContent":["// Define useful types to avoid any.\nexport type LookupFnResult = Promise;\nexport type LookupFn = (query:string | undefined, initial?:U | U[]) => LookupFnResult | LookupFnResult;\nexport type FilterFn = (options:T[], query:string) => T[] | false;\n"]} \ No newline at end of file diff --git a/dist/modules/search/helpers/lookup-fn.metadata.json b/dist/modules/search/helpers/lookup-fn.metadata.json new file mode 100644 index 000000000..00621eb4b --- /dev/null +++ b/dist/modules/search/helpers/lookup-fn.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"LookupFnResult":{"__symbolic":"interface"},"LookupFn":{"__symbolic":"interface"},"FilterFn":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/modules/search/index.d.ts b/dist/modules/search/index.d.ts new file mode 100644 index 000000000..53546db8c --- /dev/null +++ b/dist/modules/search/index.d.ts @@ -0,0 +1,5 @@ +export * from "./components/search-result"; +export * from "./components/search"; +export * from "./helpers/lookup-fn"; +export * from "./services/search.service"; +export * from "./search.module"; diff --git a/dist/modules/search/index.js b/dist/modules/search/index.js new file mode 100644 index 000000000..efcdc7ef9 --- /dev/null +++ b/dist/modules/search/index.js @@ -0,0 +1,5 @@ +export * from "./components/search-result"; +export * from "./components/search"; +export * from "./services/search.service"; +export * from "./search.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/search/index.js.map b/dist/modules/search/index.js.map new file mode 100644 index 000000000..194bf22c2 --- /dev/null +++ b/dist/modules/search/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/search/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AAIpC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./components/search-result\";\nexport * from \"./components/search\";\n\nexport * from \"./helpers/lookup-fn\";\n\nexport * from \"./services/search.service\";\n\nexport * from \"./search.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/search/index.metadata.json b/dist/modules/search/index.metadata.json new file mode 100644 index 000000000..b1ada1a3e --- /dev/null +++ b/dist/modules/search/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/search-result"},{"from":"./components/search"},{"from":"./helpers/lookup-fn"},{"from":"./services/search.service"},{"from":"./search.module"}]}] \ No newline at end of file diff --git a/dist/modules/search/public.d.ts b/dist/modules/search/public.d.ts new file mode 100644 index 000000000..1b29b07f9 --- /dev/null +++ b/dist/modules/search/public.d.ts @@ -0,0 +1 @@ +export { SuiSearchModule, SearchService, LookupFn, FilterFn, IResultContext } from "./index"; diff --git a/dist/modules/search/public.js b/dist/modules/search/public.js new file mode 100644 index 000000000..8b44e072d --- /dev/null +++ b/dist/modules/search/public.js @@ -0,0 +1,2 @@ +export { SuiSearchModule, SearchService } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/search/public.js.map b/dist/modules/search/public.js.map new file mode 100644 index 000000000..44b21e336 --- /dev/null +++ b/dist/modules/search/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/search/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,aAAa,EAIhB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiSearchModule,\n SearchService,\n LookupFn,\n FilterFn,\n IResultContext\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/search/public.metadata.json b/dist/modules/search/public.metadata.json new file mode 100644 index 000000000..4d7c184ee --- /dev/null +++ b/dist/modules/search/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiSearchModule","SearchService","LookupFn","FilterFn","IResultContext"]}]}] \ No newline at end of file diff --git a/dist/modules/search/search.module.d.ts b/dist/modules/search/search.module.d.ts new file mode 100644 index 000000000..4c0258f11 --- /dev/null +++ b/dist/modules/search/search.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiSearchModule { +} diff --git a/dist/modules/search/search.module.js b/dist/modules/search/search.module.js new file mode 100644 index 000000000..9c4c3dbba --- /dev/null +++ b/dist/modules/search/search.module.js @@ -0,0 +1,35 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; +import { SuiDropdownModule } from "../dropdown/index"; +import { SuiLocalizationModule } from "../../behaviors/localization/index"; +import { SuiUtilityModule } from "../../misc/util/index"; +import { SuiSearch } from "./components/search"; +import { SuiSearchResult } from "./components/search-result"; +var SuiSearchModule = /** @class */ (function () { + function SuiSearchModule() { + } + SuiSearchModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule, + FormsModule, + SuiDropdownModule, + SuiLocalizationModule, + SuiUtilityModule + ], + declarations: [ + SuiSearch, + SuiSearchResult + ], + exports: [ + SuiSearch + ] + },] }, + ]; + /** @nocollapse */ + SuiSearchModule.ctorParameters = function () { return []; }; + return SuiSearchModule; +}()); +export { SuiSearchModule }; +//# sourceMappingURL=search.module.js.map \ No newline at end of file diff --git a/dist/modules/search/search.module.js.map b/dist/modules/search/search.module.js.map new file mode 100644 index 000000000..71b55d278 --- /dev/null +++ b/dist/modules/search/search.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"search.module.js","sourceRoot":"","sources":["../../../src/modules/search/search.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;;;;;gBAE5D,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,iBAAiB;wBACjB,qBAAqB;wBACrB,gBAAgB;qBACnB;oBACD,YAAY,EAAE;wBACV,SAAS;wBACT,eAAe;qBAClB;oBACD,OAAO,EAAE;wBACL,SAAS;qBACZ;iBACJ;;;;0BAxBD;;SAyBa,eAAe","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { SuiDropdownModule } from \"../dropdown/index\";\nimport { SuiLocalizationModule } from \"../../behaviors/localization/index\";\nimport { SuiUtilityModule } from \"../../misc/util/index\";\nimport { SuiSearch } from \"./components/search\";\nimport { SuiSearchResult } from \"./components/search-result\";\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SuiDropdownModule,\n SuiLocalizationModule,\n SuiUtilityModule\n ],\n declarations: [\n SuiSearch,\n SuiSearchResult\n ],\n exports: [\n SuiSearch\n ]\n})\nexport class SuiSearchModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/search/search.module.metadata.json b/dist/modules/search/search.module.metadata.json new file mode 100644 index 000000000..489c208a3 --- /dev/null +++ b/dist/modules/search/search.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiSearchModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":9,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":11,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":12,"character":8},{"__symbolic":"reference","module":"../dropdown/index","name":"SuiDropdownModule","line":13,"character":8},{"__symbolic":"reference","module":"../../behaviors/localization/index","name":"SuiLocalizationModule","line":14,"character":8},{"__symbolic":"reference","module":"../../misc/util/index","name":"SuiUtilityModule","line":15,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/search","name":"SuiSearch","line":18,"character":8},{"__symbolic":"reference","module":"./components/search-result","name":"SuiSearchResult","line":19,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/search","name":"SuiSearch","line":22,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/search/services/search.service.d.ts b/dist/modules/search/services/search.service.d.ts new file mode 100644 index 000000000..b7736e52c --- /dev/null +++ b/dist/modules/search/services/search.service.d.ts @@ -0,0 +1,30 @@ +import { LookupFn, LookupFnResult, FilterFn } from "../helpers/lookup-fn"; +export declare class SearchService { + private _options; + private _optionsLookup?; + private _optionsField?; + optionsFilter: FilterFn; + options: T[]; + optionsLookup: LookupFn | undefined; + readonly hasItemLookup: boolean; + optionsField: string | undefined; + private _results; + private _resultsCache; + readonly results: T[]; + private _query; + allowEmptyQuery: boolean; + searchDelay: number; + private _searchDelayTimeout; + private _isSearching; + readonly query: string; + readonly isSearching: boolean; + constructor(allowEmptyQuery?: boolean); + updateQueryDelayed(query: string, callback?: (err?: Error) => void): void; + updateQuery(query: string, callback?: (err?: Error) => void): void; + private updateResults(results); + initialLookup(initial: U): LookupFnResult; + initialLookup(initial: U[]): LookupFnResult; + private toRegex(query); + highlightMatches(text: string, query: string): string; + private reset(); +} diff --git a/dist/modules/search/services/search.service.js b/dist/modules/search/services/search.service.js new file mode 100644 index 000000000..1300bad3a --- /dev/null +++ b/dist/modules/search/services/search.service.js @@ -0,0 +1,204 @@ +import { Util } from "../../../misc/util/index"; +var SearchService = /** @class */ (function () { + function SearchService(allowEmptyQuery) { + if (allowEmptyQuery === void 0) { allowEmptyQuery = false; } + var _this = this; + this._options = []; + this.optionsFilter = function (os, q) { + // Convert the query string to a RegExp. + var regex = _this.toRegex(_this._query); + if (regex instanceof RegExp) { + // Only update the results if the query was valid regex. + // This avoids the results suddenly becoming empty if an invalid regex string is inputted. + return os + .filter(function (o) { + return Util.Object.readValue(o, _this._optionsField) + .toString() + .match(regex); + }); + } + // Don't update since it wasn't a valid regex. + return false; + }; + // Set default values and reset. + this.allowEmptyQuery = allowEmptyQuery; + this.searchDelay = 0; + this.reset(); + } + Object.defineProperty(SearchService.prototype, "options", { + get: function () { + return this._options; + }, + set: function (options) { + this._options = options || []; + // We cannot use both local & remote options simultaneously. + this._optionsLookup = undefined; + // Reset entire service with new options. + this.reset(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "optionsLookup", { + get: function () { + return this._optionsLookup; + }, + set: function (lookupFn) { + this._optionsLookup = lookupFn; + // As before, cannot use local & remote options simultaneously. + this._options = []; + this.reset(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "hasItemLookup", { + get: function () { + return !!this.optionsLookup && this.optionsLookup.length === 2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "optionsField", { + get: function () { + return this._optionsField; + }, + set: function (field) { + this._optionsField = field; + // We need to reset otherwise we would now be showing invalid search results. + this.reset(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "results", { + get: function () { + return this._results; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "query", { + get: function () { + return this._query; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchService.prototype, "isSearching", { + get: function () { + return this._isSearching; + }, + enumerable: true, + configurable: true + }); + // Updates the query after the specified search delay. + // Updates the query after the specified search delay. + SearchService.prototype.updateQueryDelayed = + // Updates the query after the specified search delay. + function (query, callback) { + var _this = this; + if (callback === void 0) { callback = function () { }; } + this._query = query; + clearTimeout(this._searchDelayTimeout); + this._searchDelayTimeout = window.setTimeout(function () { + _this.updateQuery(query, callback); + }, this.searchDelay); + }; + // Updates the current search query. + // Updates the current search query. + SearchService.prototype.updateQuery = + // Updates the current search query. + function (query, callback) { + var _this = this; + if (callback === void 0) { callback = function () { }; } + this._query = query; + if (this._query === "" && !this.allowEmptyQuery) { + // Don't update if the new query is empty (and we don't allow empty queries). + // Don't reset so that when animating closed we don't get a judder. + return callback(); + } + if (this._resultsCache.hasOwnProperty(this._query)) { + // If the query is already cached, make use of it. + this._results = this._resultsCache[this._query]; + return callback(); + } + if (this._optionsLookup) { + this._isSearching = true; + // Call the options lookup without a this context. + var queryLookup = this._optionsLookup.call(undefined, this._query); + queryLookup + .then(function (results) { + _this._isSearching = false; + _this.updateResults(results); + return callback(); + }) + .catch(function (error) { + // Unset 'loading' state, and throw the returned error without updating the results. + // Unset 'loading' state, and throw the returned error without updating the results. + _this._isSearching = false; + return callback(error); + }); + return; + } + var filtered = this.optionsFilter.call(undefined, this._options, this._query); + if (filtered) { + this.updateResults(filtered); + } + return callback(); + }; + // Updates & caches the new set of results. + // Updates & caches the new set of results. + SearchService.prototype.updateResults = + // Updates & caches the new set of results. + function (results) { + this._resultsCache[this._query] = results; + this._results = results; + }; + // tslint:disable-next-line:promise-function-async + // tslint:disable-next-line:promise-function-async + SearchService.prototype.initialLookup = + // tslint:disable-next-line:promise-function-async + function (initial) { + if (initial instanceof Array) { + return this._optionsLookup(undefined, initial); + } + return this._optionsLookup(undefined, initial); + }; + // Converts a query string to regex without throwing an error. + // Converts a query string to regex without throwing an error. + SearchService.prototype.toRegex = + // Converts a query string to regex without throwing an error. + function (query) { + try { + return new RegExp(query, "i"); + } + catch (e) { + return query; + } + }; + // Generates HTML for highlighted match text. + // Generates HTML for highlighted match text. + SearchService.prototype.highlightMatches = + // Generates HTML for highlighted match text. + function (text, query) { + var regex = this.toRegex(query); + if (regex instanceof RegExp) { + return text.replace(regex, function (match) { return "" + match + ""; }); + } + return text; + }; + // Resets the search back to a pristine state. + // Resets the search back to a pristine state. + SearchService.prototype.reset = + // Resets the search back to a pristine state. + function () { + this._results = []; + this._resultsCache = {}; + this._isSearching = false; + this.updateQuery(""); + }; + return SearchService; +}()); +export { SearchService }; +//# sourceMappingURL=search.service.js.map \ No newline at end of file diff --git a/dist/modules/search/services/search.service.js.map b/dist/modules/search/services/search.service.js.map new file mode 100644 index 000000000..e6804d275 --- /dev/null +++ b/dist/modules/search/services/search.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"search.service.js","sourceRoot":"","sources":["../../../../src/modules/search/services/search.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKhD,IAAA;IA0EI,uBAAY,eAA+B;QAA/B,gCAAA,EAAA,uBAA+B;QAA3C,iBAwBC;QAvBG,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,UAAC,EAAE,EAAE,CAAC;;YAEvB,IAAM,KAAK,GAAG,KAAI,CAAC,OAAO,CAAC,KAAI,CAAC,MAAM,CAAC,CAAC;YAExC,EAAE,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC,CAAC,CAAC;;;gBAG1B,MAAM,CAAC,EAAE;qBAEJ,MAAM,CAAC,UAAA,CAAC;oBAAI,OAAA,IAAI,CAAC,MAAM,CAAC,SAAS,CAA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SACjC;QAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACT,MAAM,CAAC,KAAK,CAAC;SAChB;KACJ;IAED,6CAA6C;;IACtC,wCAAgB;;IAAvB,UAAwB,IAAW,EAAE,KAAY;QAC7C,IAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClC,EAAE,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC,CAAC,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,QAAM,KAAK,SAAM,EAAjB,CAAiB,CAAC,CAAC;SAC1D;QACD,MAAM,CAAC,IAAI,CAAC;KACf;IAED,8CAA8C;;IACtC,6BAAK;;IAAb;QACI,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;KACxB;wBA9ML;IA+MC,CAAA;AA1MD,yBA0MC","sourcesContent":["import { Util } from \"../../../misc/util/index\";\nimport { LookupFn, LookupFnResult, FilterFn } from \"../helpers/lookup-fn\";\n\ninterface ICachedArray { [query:string]:T[]; }\n\nexport class SearchService {\n // Stores the available options.\n private _options:T[];\n // Converts a query string into an array of options. Must be a function returning a promise.\n private _optionsLookup?:LookupFn;\n // Field that options are searched & displayed on.\n private _optionsField?:string;\n // Filters a list of options.\n public optionsFilter:FilterFn;\n\n public get options():T[] {\n return this._options;\n }\n\n public set options(options:T[]) {\n this._options = options || [];\n // We cannot use both local & remote options simultaneously.\n this._optionsLookup = undefined;\n // Reset entire service with new options.\n this.reset();\n }\n\n public get optionsLookup():LookupFn | undefined {\n return this._optionsLookup;\n }\n\n public set optionsLookup(lookupFn:LookupFn | undefined) {\n this._optionsLookup = lookupFn;\n // As before, cannot use local & remote options simultaneously.\n this._options = [];\n this.reset();\n }\n\n public get hasItemLookup():boolean {\n return !!this.optionsLookup && this.optionsLookup.length === 2;\n }\n\n public get optionsField():string | undefined {\n return this._optionsField;\n }\n\n public set optionsField(field:string | undefined) {\n this._optionsField = field;\n // We need to reset otherwise we would now be showing invalid search results.\n this.reset();\n }\n\n // Stores the results of the query.\n private _results:T[];\n // Cache of results, indexed by query.\n private _resultsCache:ICachedArray;\n\n public get results():T[] {\n return this._results;\n }\n\n private _query:string;\n // Allows the empty query to produce results.\n public allowEmptyQuery:boolean;\n // How long to delay the search for when using updateQueryDelayed. Stored in ms.\n public searchDelay:number;\n // Stores the search timeout handle so we can cancel it.\n private _searchDelayTimeout:number;\n // Provides 'loading' functionality.\n private _isSearching:boolean;\n\n public get query():string {\n return this._query;\n }\n\n public get isSearching():boolean {\n return this._isSearching;\n }\n\n constructor(allowEmptyQuery:boolean = false) {\n this._options = [];\n this.optionsFilter = (os, q) => {\n // Convert the query string to a RegExp.\n const regex = this.toRegex(this._query);\n\n if (regex instanceof RegExp) {\n // Only update the results if the query was valid regex.\n // This avoids the results suddenly becoming empty if an invalid regex string is inputted.\n return os\n // Filter on the options with a string match on the field we are testing.\n .filter(o => Util.Object.readValue(o, this._optionsField)\n .toString()\n .match(regex));\n }\n\n // Don't update since it wasn't a valid regex.\n return false;\n };\n\n // Set default values and reset.\n this.allowEmptyQuery = allowEmptyQuery;\n this.searchDelay = 0;\n this.reset();\n }\n\n // Updates the query after the specified search delay.\n public updateQueryDelayed(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n clearTimeout(this._searchDelayTimeout);\n this._searchDelayTimeout = window.setTimeout(\n () => {\n this.updateQuery(query, callback);\n },\n this.searchDelay\n );\n }\n\n // Updates the current search query.\n public updateQuery(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n if (this._query === \"\" && !this.allowEmptyQuery) {\n // Don't update if the new query is empty (and we don't allow empty queries).\n // Don't reset so that when animating closed we don't get a judder.\n return callback();\n }\n\n if (this._resultsCache.hasOwnProperty(this._query)) {\n // If the query is already cached, make use of it.\n this._results = this._resultsCache[this._query];\n\n return callback();\n }\n\n if (this._optionsLookup) {\n this._isSearching = true;\n\n // Call the options lookup without a this context.\n const queryLookup = this._optionsLookup.call(undefined, this._query) as LookupFnResult;\n\n queryLookup\n .then(results => {\n this._isSearching = false;\n\n this.updateResults(results);\n return callback();\n })\n .catch(error => {\n // Unset 'loading' state, and throw the returned error without updating the results.\n this._isSearching = false;\n return callback(error);\n });\n\n return;\n }\n\n const filtered = this.optionsFilter.call(undefined, this._options, this._query);\n if (filtered) {\n this.updateResults(filtered);\n }\n return callback();\n }\n\n // Updates & caches the new set of results.\n private updateResults(results:T[]):void {\n this._resultsCache[this._query] = results;\n this._results = results;\n }\n\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U[]):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U | U[]):LookupFnResult | LookupFnResult {\n if (initial instanceof Array) {\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n\n // Converts a query string to regex without throwing an error.\n private toRegex(query:string):RegExp | string {\n try {\n return new RegExp(query, \"i\");\n } catch (e) {\n return query;\n }\n }\n\n // Generates HTML for highlighted match text.\n public highlightMatches(text:string, query:string):string {\n const regex = this.toRegex(query);\n if (regex instanceof RegExp) {\n return text.replace(regex, match => `${match}`);\n }\n return text;\n }\n\n // Resets the search back to a pristine state.\n private reset():void {\n this._results = [];\n this._resultsCache = {};\n this._isSearching = false;\n this.updateQuery(\"\");\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/search/services/search.service.metadata.json b/dist/modules/search/services/search.service.metadata.json new file mode 100644 index 000000000..2914007c0 --- /dev/null +++ b/dist/modules/search/services/search.service.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SearchService":{"__symbolic":"class","arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"boolean"}]}],"updateQueryDelayed":[{"__symbolic":"method"}],"updateQuery":[{"__symbolic":"method"}],"updateResults":[{"__symbolic":"method"}],"initialLookup":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"toRegex":[{"__symbolic":"method"}],"highlightMatches":[{"__symbolic":"method"}],"reset":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/classes/select-base.d.ts b/dist/modules/select/classes/select-base.d.ts new file mode 100644 index 000000000..0a66b1a33 --- /dev/null +++ b/dist/modules/select/classes/select-base.d.ts @@ -0,0 +1,75 @@ +import { ElementRef, QueryList, AfterContentInit, TemplateRef, ViewContainerRef, EventEmitter, OnDestroy, Renderer2 } from "@angular/core"; +import { DropdownService, SuiDropdownMenu } from "../../dropdown/index"; +import { SearchService, LookupFn, FilterFn } from "../../search/index"; +import { ITemplateRefContext, HandledEvent } from "../../../misc/util/index"; +import { ISelectLocaleValues, RecursivePartial, SuiLocalizationService } from "../../../behaviors/localization/index"; +import { SuiSelectOption } from "../components/select-option"; +import { SuiSelectSearch } from "../directives/select-search"; +export interface IOptionContext extends ITemplateRefContext { + query?: string; +} +export declare abstract class SuiSelectBase implements AfterContentInit, OnDestroy { + private _element; + protected _localizationService: SuiLocalizationService; + dropdownService: DropdownService; + searchService: SearchService; + protected _menu: SuiDropdownMenu; + protected _renderedOptions: QueryList>; + private _renderedSubscriptions; + private _selectClasses; + readonly isActive: boolean; + readonly isVisible: boolean; + isSearchable: boolean; + isSearchExternal: boolean; + private readonly _searchClass; + readonly isSearching: boolean; + private _internalSearch?; + private _manualSearch?; + readonly searchInput: SuiSelectSearch | undefined; + private _tabIndex?; + readonly tabIndex: number; + isDisabled: boolean; + options: T[]; + optionsFilter: FilterFn | undefined; + optionsLookup: LookupFn | undefined; + readonly filteredOptions: T[]; + readonly availableOptions: T[]; + query: string | undefined; + labelField: string | undefined; + readonly labelGetter: (obj: T) => string; + valueField: string; + readonly valueGetter: (obj: T) => U; + optionTemplate: TemplateRef>; + private _optionFormatter?; + readonly configuredFormatter: (option: T) => string; + optionFormatter: ((option: T, query?: string) => string) | undefined; + private _localeValues; + localeOverrides: RecursivePartial; + readonly localeValues: ISelectLocaleValues; + icon: string; + transition: string; + transitionDuration: number; + onTouched: EventEmitter; + private _documentKeyDownListener; + constructor(_element: ElementRef, renderer: Renderer2, _localizationService: SuiLocalizationService); + ngAfterContentInit(): void; + private onLocaleUpdate(); + protected optionsUpdateHook(): void; + protected queryUpdateHook(): void; + protected updateQuery(query: string): void; + protected resetQuery(delayed?: boolean): void; + protected onAvailableOptionsRendered(): void; + protected initialiseRenderedOption(option: SuiSelectOption): void; + abstract selectOption(option: T): void; + protected findOption(options: T[], value: U): T | undefined; + onCaretClick(e: HandledEvent): void; + onClick(e: HandledEvent): void; + private onFocusIn(); + private onFocusOut(e); + onKeyPress(e: KeyboardEvent): void; + onDocumentKeyDown(e: KeyboardEvent): void; + onQueryInputKeydown(event: KeyboardEvent): void; + protected focus(): void; + protected drawTemplate(siblingRef: ViewContainerRef, value: T): void; + ngOnDestroy(): void; +} diff --git a/dist/modules/select/classes/select-base.js b/dist/modules/select/classes/select-base.js new file mode 100644 index 000000000..9a1435a65 --- /dev/null +++ b/dist/modules/select/classes/select-base.js @@ -0,0 +1,414 @@ +import { ViewChild, HostBinding, HostListener, Input, ContentChildren, QueryList, TemplateRef, ContentChild, EventEmitter, Output } from "@angular/core"; +import { DropdownService, SuiDropdownMenu } from "../../dropdown/index"; +import { SearchService } from "../../search/index"; +import { Util, HandledEvent, KeyCode } from "../../../misc/util/index"; +import { SuiSelectOption } from "../components/select-option"; +import { SuiSelectSearch } from "../directives/select-search"; +// We use generic type T to specify the type of the options we are working with, +// and U to specify the type of the property of the option used as the value. +var SuiSelectBase = /** @class */ (function () { + function SuiSelectBase(_element, renderer, _localizationService) { + var _this = this; + this._element = _element; + this._localizationService = _localizationService; + this.dropdownService = new DropdownService(); + // We do want an empty query to return all results. + this.searchService = new SearchService(true); + this.isSearchable = false; + this.onLocaleUpdate(); + this._localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); + this._renderedSubscriptions = []; + this.icon = "dropdown"; + this.transition = "slide down"; + this.transitionDuration = 200; + this.onTouched = new EventEmitter(); + this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); + this._selectClasses = true; + } + Object.defineProperty(SuiSelectBase.prototype, "isActive", { + get: function () { + return this.dropdownService.isOpen; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "isVisible", { + get: function () { + return this._menu.isVisible; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "_searchClass", { + get: function () { + return this.isSearchable && !this.isSearchExternal; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "isSearching", { + get: function () { + return this.searchService.isSearching; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "searchInput", { + get: function () { + return this._manualSearch || this._internalSearch; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "tabIndex", { + get: function () { + if (this.isDisabled) { + // If disabled, remove from tabindex. + return -1; + } + if (this.dropdownService.isOpen && this.isSearchExternal) { + // If open & in menu search, remove from tabindex (as input always autofocusses). + return -1; + } + if (this._tabIndex != undefined) { + // If custom tabindex, default to that. + return this._tabIndex; + } + if (this._searchClass) { + // If search input enabled, tab goes to input. + return -1; + } + // Otherwise, return default of 0. + return 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "isDisabled", { + get: function () { + return this.dropdownService.isDisabled; + }, + set: function (value) { + this.dropdownService.isDisabled = !!value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "options", { + set: function (options) { + if (options) { + this.searchService.options = options; + this.optionsUpdateHook(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "optionsFilter", { + set: function (filter) { + if (filter) { + this.searchService.optionsFilter = filter; + this.optionsUpdateHook(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "optionsLookup", { + set: function (lookup) { + if (lookup) { + this.searchService.optionsLookup = lookup; + this.optionsUpdateHook(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "filteredOptions", { + get: function () { + return this.searchService.results; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "availableOptions", { + // Deprecated + get: + // Deprecated + function () { + return this.filteredOptions; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "query", { + get: function () { + return this.isSearchable ? this.searchService.query : undefined; + }, + set: function (query) { + var _this = this; + if (query != undefined) { + this.queryUpdateHook(); + this.updateQuery(query); + // Update the rendered text as query has changed. + this._renderedOptions.forEach(function (ro) { return _this.initialiseRenderedOption(ro); }); + if (this.searchInput) { + this.searchInput.query = query; + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "labelField", { + get: function () { + return this.searchService.optionsField; + }, + set: function (field) { + this.searchService.optionsField = field; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "labelGetter", { + get: function () { + var _this = this; + // Helper function to retrieve the label from an item. + return function (obj) { + var label = Util.Object.readValue(obj, _this.labelField); + if (label != undefined) { + return label.toString(); + } + return ""; + }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "valueGetter", { + get: function () { + var _this = this; + // Helper function to retrieve the value from an item. + return function (obj) { return Util.Object.readValue(obj, _this.valueField); }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "configuredFormatter", { + get: function () { + var _this = this; + if (this._optionFormatter) { + return function (o) { return _this._optionFormatter(o, _this.isSearchable ? _this.query : undefined); }; + } + else if (this.searchService.optionsLookup) { + return function (o) { return _this.labelGetter(o); }; + } + else { + return function (o) { return _this.searchService.highlightMatches(_this.labelGetter(o), _this.query || ""); }; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "optionFormatter", { + set: function (formatter) { + this._optionFormatter = formatter; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSelectBase.prototype, "localeValues", { + get: function () { + return this._localizationService.override(this._localeValues, this.localeOverrides); + }, + enumerable: true, + configurable: true + }); + SuiSelectBase.prototype.ngAfterContentInit = function () { + var _this = this; + this._menu.service = this.dropdownService; + // We manually specify the menu items to the menu because the @ContentChildren doesn't pick up our dynamically rendered items. + this._menu.items = this._renderedOptions; + if (this._manualSearch) { + this.isSearchable = true; + this.isSearchExternal = true; + } + if (this.searchInput) { + this.searchInput.onQueryUpdated.subscribe(function (q) { return _this.query = q; }); + this.searchInput.onQueryKeyDown.subscribe(function (e) { return _this.onQueryInputKeydown(e); }); + } + // We must call this immediately as changes doesn't fire when you subscribe. + this.onAvailableOptionsRendered(); + this._renderedOptions.changes.subscribe(function () { return _this.onAvailableOptionsRendered(); }); + }; + SuiSelectBase.prototype.onLocaleUpdate = function () { + this._localeValues = this._localizationService.get().select; + }; + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + SuiSelectBase.prototype.optionsUpdateHook = + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + function () { }; + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + SuiSelectBase.prototype.queryUpdateHook = + // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. + function () { }; + SuiSelectBase.prototype.updateQuery = function (query) { + var _this = this; + // Update the query then open the dropdown, as after keyboard input it should always be open. + this.searchService.updateQuery(query, function () { + return _this.dropdownService.setOpenState(true); + }); + }; + SuiSelectBase.prototype.resetQuery = function (delayed) { + if (delayed === void 0) { delayed = true; } + // The search delay is set to the transition duration to ensure results + // aren't rendered as the select closes as that causes a sudden flash. + if (delayed) { + this.searchService.searchDelay = this._menu.menuTransitionDuration; + this.searchService.updateQueryDelayed(""); + } + else { + this.searchService.updateQuery(""); + } + if (this.searchInput) { + this.searchInput.query = ""; + } + }; + SuiSelectBase.prototype.onAvailableOptionsRendered = function () { + var _this = this; + // Unsubscribe from all previous subscriptions to avoid memory leaks on large selects. + this._renderedSubscriptions.forEach(function (rs) { return rs.unsubscribe(); }); + this._renderedSubscriptions = []; + this._renderedOptions.forEach(function (ro) { + // Slightly delay initialisation to avoid change after checked errors. TODO - look into avoiding this! + setTimeout(function () { return _this.initialiseRenderedOption(ro); }); + _this._renderedSubscriptions.push(ro.onSelected.subscribe(function () { return _this.selectOption(ro.value); })); + }); + // If no options have been provided, autogenerate them from the rendered ones. + if (this.searchService.options.length === 0 && !this.searchService.optionsLookup) { + this.options = this._renderedOptions.map(function (ro) { return ro.value; }); + } + }; + SuiSelectBase.prototype.initialiseRenderedOption = function (option) { + option.usesTemplate = !!this.optionTemplate; + option.formatter = this.configuredFormatter; + if (option.usesTemplate) { + this.drawTemplate(option.templateSibling, option.value); + } + option.changeDetector.markForCheck(); + }; + SuiSelectBase.prototype.findOption = function (options, value) { + var _this = this; + // Tries to find an option in options array + return options.find(function (o) { return value === _this.valueGetter(o); }); + }; + SuiSelectBase.prototype.onCaretClick = function (e) { + if (!e.eventHandled) { + e.eventHandled = true; + if (!this.dropdownService.isAnimating) { + this.dropdownService.setOpenState(!this.dropdownService.isOpen); + this.focus(); + } + } + }; + SuiSelectBase.prototype.onClick = function (e) { + if (!e.eventHandled && !this.dropdownService.isAnimating) { + e.eventHandled = true; + // If the dropdown is searchable, clicking should keep it open, otherwise we toggle the open state. + this.dropdownService.setOpenState(this.isSearchable ? true : !this.dropdownService.isOpen); + // Immediately focus the search input whenever clicking on the select. + this.focus(); + } + }; + SuiSelectBase.prototype.onFocusIn = function () { + if (!this.dropdownService.isOpen && !this.dropdownService.isAnimating) { + this.dropdownService.setOpenState(true); + this.focus(); + } + }; + SuiSelectBase.prototype.onFocusOut = function (e) { + if (!this._element.nativeElement.contains(e.relatedTarget)) { + this.dropdownService.setOpenState(false); + this.onTouched.emit(); + } + }; + SuiSelectBase.prototype.onKeyPress = function (e) { + if (e.keyCode === KeyCode.Enter) { + // Enables support for focussing and opening with the keyboard alone. + // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. + this._element.nativeElement.click(); + } + }; + SuiSelectBase.prototype.onDocumentKeyDown = function (e) { + if (this._element.nativeElement.contains(e.target) && + !this.dropdownService.isOpen && + e.keyCode === KeyCode.Down) { + // Enables support for focussing and opening with the keyboard alone. + // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. + this._element.nativeElement.click(); + e.preventDefault(); + } + }; + SuiSelectBase.prototype.onQueryInputKeydown = function (event) { }; + SuiSelectBase.prototype.focus = function () { + if (this.isSearchable && this.searchInput) { + // Focusses the search input only when searchable. + // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. + this.searchInput.focus(); + } + else { + this._element.nativeElement.focus(); + } + }; + // Helper that draws the provided template beside the provided ViewContainerRef. + // Helper that draws the provided template beside the provided ViewContainerRef. + SuiSelectBase.prototype.drawTemplate = + // Helper that draws the provided template beside the provided ViewContainerRef. + function (siblingRef, value) { + siblingRef.clear(); + // Use of `$implicit` means use of syntax is supported. + siblingRef.createEmbeddedView(this.optionTemplate, { + $implicit: value, + query: this.query + }); + }; + SuiSelectBase.prototype.ngOnDestroy = function () { + this._renderedSubscriptions.forEach(function (s) { return s.unsubscribe(); }); + this._documentKeyDownListener(); + }; + SuiSelectBase.propDecorators = { + "_menu": [{ type: ViewChild, args: [SuiDropdownMenu,] },], + "_renderedOptions": [{ type: ContentChildren, args: [SuiSelectOption, { descendants: true },] },], + "_selectClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.dropdown",] },], + "isActive": [{ type: HostBinding, args: ["class.active",] },], + "isVisible": [{ type: HostBinding, args: ["class.visible",] },], + "isSearchable": [{ type: Input },], + "_searchClass": [{ type: HostBinding, args: ["class.search",] },], + "isSearching": [{ type: HostBinding, args: ["class.loading",] },], + "_internalSearch": [{ type: ViewChild, args: [SuiSelectSearch,] },], + "_manualSearch": [{ type: ContentChild, args: [SuiSelectSearch,] },], + "_tabIndex": [{ type: Input, args: ["tabindex",] },], + "tabIndex": [{ type: HostBinding, args: ["attr.tabindex",] },], + "isDisabled": [{ type: HostBinding, args: ["class.disabled",] }, { type: Input },], + "options": [{ type: Input },], + "optionsFilter": [{ type: Input },], + "optionsLookup": [{ type: Input },], + "labelField": [{ type: Input },], + "valueField": [{ type: Input },], + "optionTemplate": [{ type: Input },], + "optionFormatter": [{ type: Input },], + "icon": [{ type: Input },], + "transition": [{ type: Input },], + "transitionDuration": [{ type: Input },], + "onTouched": [{ type: Output, args: ["touched",] },], + "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], + "onFocusIn": [{ type: HostListener, args: ["focusin",] },], + "onFocusOut": [{ type: HostListener, args: ["focusout", ["$event"],] },], + "onKeyPress": [{ type: HostListener, args: ["keypress", ["$event"],] },], + }; + return SuiSelectBase; +}()); +export { SuiSelectBase }; +//# sourceMappingURL=select-base.js.map \ No newline at end of file diff --git a/dist/modules/select/classes/select-base.js.map b/dist/modules/select/classes/select-base.js.map new file mode 100644 index 000000000..645654002 --- /dev/null +++ b/dist/modules/select/classes/select-base.js.map @@ -0,0 +1 @@ +{"version":3,"file":"select-base.js","sourceRoot":"","sources":["../../../../src/modules/select/classes/select-base.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,WAAW,EAAc,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,SAAS,EACjE,WAAW,EAAoB,YAAY,EAAE,YAAY,EAAE,MAAM,EACtF,MAAM,eAAe,CAAC;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,cACtB,WAAW,SAAC,gBAAgB;6BAG5B,WAAW,SAAC,cAAc;8BAK1B,WAAW,SAAC,eAAe;iCAK3B,KAAK;iCAKL,WAAW,SAAC,cAAc;gCAK1B,WAAW,SAAC,eAAe;oCAK3B,SAAS,SAAC,eAAe;kCAGzB,YAAY,SAAC,eAAe;8BAO5B,KAAK,SAAC,UAAU;6BAGhB,WAAW,SAAC,eAAe;+BAsB3B,WAAW,SAAC,gBAAgB,cAC5B,KAAK;4BASL,KAAK;kCASL,KAAK;kCASL,KAAK;+BAmCL,KAAK;+BAoBL,KAAK;mCAQL,KAAK;oCAeL,KAAK;yBAYL,KAAK;+BAGL,KAAK;uCAGL,KAAK;8BAGL,MAAM,SAAC,SAAS;4BA6HhB,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;8BAahC,YAAY,SAAC,SAAS;+BAStB,YAAY,SAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;+BAQnC,YAAY,SAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;wBA3XxC;;SAkBsB,aAAa","sourcesContent":["import {\n ViewChild, HostBinding, ElementRef, HostListener, Input, ContentChildren, QueryList,\n AfterContentInit, TemplateRef, ViewContainerRef, ContentChild, EventEmitter, Output, OnDestroy, Renderer2\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs/Subscription\";\nimport { DropdownService, SuiDropdownMenu } from \"../../dropdown/index\";\nimport { SearchService, LookupFn, FilterFn } from \"../../search/index\";\nimport { Util, ITemplateRefContext, HandledEvent, KeyCode, IFocusEvent } from \"../../../misc/util/index\";\nimport { ISelectLocaleValues, RecursivePartial, SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SuiSelectOption } from \"../components/select-option\";\nimport { SuiSelectSearch } from \"../directives/select-search\";\n\nexport interface IOptionContext extends ITemplateRefContext {\n query?:string;\n}\n\n// We use generic type T to specify the type of the options we are working with,\n// and U to specify the type of the property of the option used as the value.\nexport abstract class SuiSelectBase implements AfterContentInit, OnDestroy {\n public dropdownService:DropdownService;\n public searchService:SearchService;\n\n @ViewChild(SuiDropdownMenu)\n protected _menu:SuiDropdownMenu;\n\n // Keep track of all of the rendered select options. (Rendered by the user using *ngFor).\n @ContentChildren(SuiSelectOption, { descendants: true })\n protected _renderedOptions:QueryList>;\n\n // Keep track of all of the subscriptions to the selected events on the rendered options.\n private _renderedSubscriptions:Subscription[];\n\n // Sets the Semantic UI classes on the host element.\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.dropdown\")\n private _selectClasses:boolean;\n\n @HostBinding(\"class.active\")\n public get isActive():boolean {\n return this.dropdownService.isOpen;\n }\n\n @HostBinding(\"class.visible\")\n public get isVisible():boolean {\n return this._menu.isVisible;\n }\n\n @Input()\n public isSearchable:boolean;\n\n public isSearchExternal:boolean;\n\n @HostBinding(\"class.search\")\n private get _searchClass():boolean {\n return this.isSearchable && !this.isSearchExternal;\n }\n\n @HostBinding(\"class.loading\")\n public get isSearching():boolean {\n return this.searchService.isSearching;\n }\n\n @ViewChild(SuiSelectSearch)\n private _internalSearch?:SuiSelectSearch;\n\n @ContentChild(SuiSelectSearch)\n private _manualSearch?:SuiSelectSearch;\n\n public get searchInput():SuiSelectSearch | undefined {\n return this._manualSearch || this._internalSearch;\n }\n\n @Input(\"tabindex\")\n private _tabIndex?:number;\n\n @HostBinding(\"attr.tabindex\")\n public get tabIndex():number {\n if (this.isDisabled) {\n // If disabled, remove from tabindex.\n return -1;\n }\n if (this.dropdownService.isOpen && this.isSearchExternal) {\n // If open & in menu search, remove from tabindex (as input always autofocusses).\n return -1;\n }\n if (this._tabIndex != undefined) {\n // If custom tabindex, default to that.\n return this._tabIndex;\n }\n if (this._searchClass) {\n // If search input enabled, tab goes to input.\n return -1;\n }\n // Otherwise, return default of 0.\n return 0;\n }\n\n @HostBinding(\"class.disabled\")\n @Input()\n public get isDisabled():boolean {\n return this.dropdownService.isDisabled;\n }\n\n public set isDisabled(value:boolean) {\n this.dropdownService.isDisabled = !!value;\n }\n\n @Input()\n public set options(options:T[]) {\n if (options) {\n this.searchService.options = options;\n\n this.optionsUpdateHook();\n }\n }\n\n @Input()\n public set optionsFilter(filter:FilterFn | undefined) {\n if (filter) {\n this.searchService.optionsFilter = filter;\n\n this.optionsUpdateHook();\n }\n }\n\n @Input()\n public set optionsLookup(lookup:LookupFn | undefined) {\n if (lookup) {\n this.searchService.optionsLookup = lookup;\n\n this.optionsUpdateHook();\n }\n }\n\n public get filteredOptions():T[] {\n return this.searchService.results;\n }\n\n // Deprecated\n public get availableOptions():T[] {\n return this.filteredOptions;\n }\n\n public get query():string | undefined {\n return this.isSearchable ? this.searchService.query : undefined;\n }\n\n public set query(query:string | undefined) {\n if (query != undefined) {\n this.queryUpdateHook();\n this.updateQuery(query);\n // Update the rendered text as query has changed.\n this._renderedOptions.forEach(ro => this.initialiseRenderedOption(ro));\n\n if (this.searchInput) {\n this.searchInput.query = query;\n }\n }\n }\n\n @Input()\n public get labelField():string | undefined {\n return this.searchService.optionsField;\n }\n\n public set labelField(field:string | undefined) {\n this.searchService.optionsField = field;\n }\n\n public get labelGetter():(obj:T) => string {\n // Helper function to retrieve the label from an item.\n return (obj:T) => {\n const label = Util.Object.readValue(obj, this.labelField);\n if (label != undefined) {\n return label.toString();\n }\n return \"\";\n };\n }\n\n @Input()\n public valueField:string;\n\n public get valueGetter():(obj:T) => U {\n // Helper function to retrieve the value from an item.\n return (obj:T) => Util.Object.readValue(obj, this.valueField);\n }\n\n @Input()\n public optionTemplate:TemplateRef>;\n\n private _optionFormatter?:(o:T, q?:string) => string;\n\n public get configuredFormatter():(option:T) => string {\n if (this._optionFormatter) {\n return o => this._optionFormatter!(o, this.isSearchable ? this.query : undefined);\n } else if (this.searchService.optionsLookup) {\n return o => this.labelGetter(o);\n } else {\n return o => this.searchService.highlightMatches(this.labelGetter(o), this.query || \"\");\n }\n }\n\n @Input()\n public set optionFormatter(formatter:((option:T, query?:string) => string) | undefined) {\n this._optionFormatter = formatter;\n }\n\n private _localeValues:ISelectLocaleValues;\n public localeOverrides:RecursivePartial;\n\n public get localeValues():ISelectLocaleValues {\n return this._localizationService.override<\"select\">(this._localeValues, this.localeOverrides);\n }\n\n @Input()\n public icon:string;\n\n @Input()\n public transition:string;\n\n @Input()\n public transitionDuration:number;\n\n @Output(\"touched\")\n public onTouched:EventEmitter;\n\n private _documentKeyDownListener:() => void;\n\n constructor(private _element:ElementRef, renderer:Renderer2, protected _localizationService:SuiLocalizationService) {\n this.dropdownService = new DropdownService();\n // We do want an empty query to return all results.\n this.searchService = new SearchService(true);\n\n this.isSearchable = false;\n\n this.onLocaleUpdate();\n this._localizationService.onLanguageUpdate.subscribe(() => this.onLocaleUpdate());\n this._renderedSubscriptions = [];\n\n this.icon = \"dropdown\";\n this.transition = \"slide down\";\n this.transitionDuration = 200;\n\n this.onTouched = new EventEmitter();\n this._documentKeyDownListener = renderer.listen(\"document\", \"keydown\", (e:KeyboardEvent) => this.onDocumentKeyDown(e));\n\n this._selectClasses = true;\n }\n\n public ngAfterContentInit():void {\n this._menu.service = this.dropdownService;\n // We manually specify the menu items to the menu because the @ContentChildren doesn't pick up our dynamically rendered items.\n this._menu.items = this._renderedOptions;\n\n if (this._manualSearch) {\n this.isSearchable = true;\n this.isSearchExternal = true;\n }\n\n if (this.searchInput) {\n this.searchInput.onQueryUpdated.subscribe((q:string) => this.query = q);\n this.searchInput.onQueryKeyDown.subscribe((e:KeyboardEvent) => this.onQueryInputKeydown(e));\n }\n\n // We must call this immediately as changes doesn't fire when you subscribe.\n this.onAvailableOptionsRendered();\n this._renderedOptions.changes.subscribe(() => this.onAvailableOptionsRendered());\n }\n\n private onLocaleUpdate():void {\n this._localeValues = this._localizationService.get().select;\n }\n\n // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass.\n protected optionsUpdateHook():void {}\n\n // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass.\n protected queryUpdateHook():void {}\n\n protected updateQuery(query:string):void {\n // Update the query then open the dropdown, as after keyboard input it should always be open.\n this.searchService.updateQuery(query, () =>\n this.dropdownService.setOpenState(true));\n }\n\n protected resetQuery(delayed:boolean = true):void {\n // The search delay is set to the transition duration to ensure results\n // aren't rendered as the select closes as that causes a sudden flash.\n if (delayed) {\n this.searchService.searchDelay = this._menu.menuTransitionDuration;\n this.searchService.updateQueryDelayed(\"\");\n } else {\n this.searchService.updateQuery(\"\");\n }\n\n if (this.searchInput) {\n this.searchInput.query = \"\";\n }\n }\n\n protected onAvailableOptionsRendered():void {\n // Unsubscribe from all previous subscriptions to avoid memory leaks on large selects.\n this._renderedSubscriptions.forEach(rs => rs.unsubscribe());\n this._renderedSubscriptions = [];\n\n this._renderedOptions.forEach(ro => {\n // Slightly delay initialisation to avoid change after checked errors. TODO - look into avoiding this!\n setTimeout(() => this.initialiseRenderedOption(ro));\n\n this._renderedSubscriptions.push(ro.onSelected.subscribe(() => this.selectOption(ro.value)));\n });\n\n // If no options have been provided, autogenerate them from the rendered ones.\n if (this.searchService.options.length === 0 && !this.searchService.optionsLookup) {\n this.options = this._renderedOptions.map(ro => ro.value);\n }\n }\n\n protected initialiseRenderedOption(option:SuiSelectOption):void {\n option.usesTemplate = !!this.optionTemplate;\n option.formatter = this.configuredFormatter;\n\n if (option.usesTemplate) {\n this.drawTemplate(option.templateSibling, option.value);\n }\n\n option.changeDetector.markForCheck();\n }\n\n public abstract selectOption(option:T):void;\n\n protected findOption(options:T[], value:U):T | undefined {\n // Tries to find an option in options array\n return options.find(o => value === this.valueGetter(o));\n }\n\n public onCaretClick(e:HandledEvent):void {\n if (!e.eventHandled) {\n e.eventHandled = true;\n\n if (!this.dropdownService.isAnimating) {\n this.dropdownService.setOpenState(!this.dropdownService.isOpen);\n\n this.focus();\n }\n }\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(e:HandledEvent):void {\n if (!e.eventHandled && !this.dropdownService.isAnimating) {\n e.eventHandled = true;\n\n // If the dropdown is searchable, clicking should keep it open, otherwise we toggle the open state.\n this.dropdownService.setOpenState(this.isSearchable ? true : !this.dropdownService.isOpen);\n\n // Immediately focus the search input whenever clicking on the select.\n this.focus();\n }\n }\n\n @HostListener(\"focusin\")\n private onFocusIn():void {\n if (!this.dropdownService.isOpen && !this.dropdownService.isAnimating) {\n this.dropdownService.setOpenState(true);\n\n this.focus();\n }\n }\n\n @HostListener(\"focusout\", [\"$event\"])\n private onFocusOut(e:IFocusEvent):void {\n if (!this._element.nativeElement.contains(e.relatedTarget)) {\n this.dropdownService.setOpenState(false);\n this.onTouched.emit();\n }\n }\n\n @HostListener(\"keypress\", [\"$event\"])\n public onKeyPress(e:KeyboardEvent):void {\n if (e.keyCode === KeyCode.Enter) {\n // Enables support for focussing and opening with the keyboard alone.\n // Using directly because Renderer2 doesn't have invokeElementMethod method anymore.\n this._element.nativeElement.click();\n }\n }\n\n public onDocumentKeyDown(e:KeyboardEvent):void {\n if (this._element.nativeElement.contains(e.target) &&\n !this.dropdownService.isOpen &&\n e.keyCode === KeyCode.Down) {\n\n // Enables support for focussing and opening with the keyboard alone.\n // Using directly because Renderer2 doesn't have invokeElementMethod method anymore.\n this._element.nativeElement.click();\n\n e.preventDefault();\n }\n }\n\n public onQueryInputKeydown(event:KeyboardEvent):void {}\n\n protected focus():void {\n if (this.isSearchable && this.searchInput) {\n // Focusses the search input only when searchable.\n // Using directly because Renderer2 doesn't have invokeElementMethod method anymore.\n this.searchInput.focus();\n } else {\n this._element.nativeElement.focus();\n }\n }\n\n // Helper that draws the provided template beside the provided ViewContainerRef.\n protected drawTemplate(siblingRef:ViewContainerRef, value:T):void {\n siblingRef.clear();\n // Use of `$implicit` means use of syntax is supported.\n siblingRef.createEmbeddedView(this.optionTemplate, {\n $implicit: value,\n query: this.query\n });\n }\n\n public ngOnDestroy():void {\n this._renderedSubscriptions.forEach(s => s.unsubscribe());\n this._documentKeyDownListener();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/classes/select-base.metadata.json b/dist/modules/select/classes/select-base.metadata.json new file mode 100644 index 000000000..c094a5ffc --- /dev/null +++ b/dist/modules/select/classes/select-base.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"IOptionContext":{"__symbolic":"interface"},"SuiSelectBase":{"__symbolic":"class","arity":2,"members":{"_menu":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":22,"character":5},"arguments":[{"__symbolic":"reference","module":"../../dropdown/index","name":"SuiDropdownMenu","line":22,"character":15}]}]}],"_renderedOptions":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":26,"character":5},"arguments":[{"__symbolic":"reference","module":"../components/select-option","name":"SuiSelectOption","line":26,"character":21},{"descendants":true}]}]}],"_selectClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":33,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":34,"character":5},"arguments":["class.dropdown"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":37,"character":5},"arguments":["class.active"]}]}],"isVisible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":42,"character":5},"arguments":["class.visible"]}]}],"isSearchable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":5}}]}],"_searchClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":52,"character":5},"arguments":["class.search"]}]}],"isSearching":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":57,"character":5},"arguments":["class.loading"]}]}],"_internalSearch":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":62,"character":5},"arguments":[{"__symbolic":"reference","module":"../directives/select-search","name":"SuiSelectSearch","line":62,"character":15}]}]}],"_manualSearch":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":65,"character":5},"arguments":[{"__symbolic":"reference","module":"../directives/select-search","name":"SuiSelectSearch","line":65,"character":18}]}]}],"_tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":72,"character":5},"arguments":["tabindex"]}]}],"tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":75,"character":5},"arguments":["attr.tabindex"]}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":97,"character":5},"arguments":["class.disabled"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":98,"character":5}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":107,"character":5}}]}],"optionsFilter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":116,"character":5}}]}],"optionsLookup":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":125,"character":5}}]}],"labelField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":160,"character":5}}]}],"valueField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":180,"character":5}}]}],"optionTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":188,"character":5}}]}],"optionFormatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":203,"character":5}}]}],"icon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":215,"character":5}}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":218,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":221,"character":5}}]}],"onTouched":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":224,"character":5},"arguments":["touched"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":229,"character":33},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":229,"character":54},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":229,"character":96}]}],"ngAfterContentInit":[{"__symbolic":"method"}],"onLocaleUpdate":[{"__symbolic":"method"}],"optionsUpdateHook":[{"__symbolic":"method"}],"queryUpdateHook":[{"__symbolic":"method"}],"updateQuery":[{"__symbolic":"method"}],"resetQuery":[{"__symbolic":"method"}],"onAvailableOptionsRendered":[{"__symbolic":"method"}],"initialiseRenderedOption":[{"__symbolic":"method"}],"selectOption":[{"__symbolic":"method"}],"findOption":[{"__symbolic":"method"}],"onCaretClick":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":349,"character":5},"arguments":["click",["$event"]]}]}],"onFocusIn":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":362,"character":5},"arguments":["focusin"]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":371,"character":5},"arguments":["focusout",["$event"]]}]}],"onKeyPress":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":379,"character":5},"arguments":["keypress",["$event"]]}]}],"onDocumentKeyDown":[{"__symbolic":"method"}],"onQueryInputKeydown":[{"__symbolic":"method"}],"focus":[{"__symbolic":"method"}],"drawTemplate":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/components/multi-select-label.d.ts b/dist/modules/select/components/multi-select-label.d.ts new file mode 100644 index 000000000..d8d86303e --- /dev/null +++ b/dist/modules/select/components/multi-select-label.d.ts @@ -0,0 +1,19 @@ +import { EventEmitter, ViewContainerRef, Renderer2, ElementRef, ChangeDetectorRef, TemplateRef } from "@angular/core"; +import { SuiTransition } from "../../transition/index"; +import { HandledEvent, SuiComponentFactory } from "../../../misc/util/index"; +import { IOptionContext } from "../classes/select-base"; +export declare class SuiMultiSelectLabel extends SuiTransition { + componentFactory: SuiComponentFactory; + private _labelClasses; + private _transitionController; + value: T; + query?: string; + onDeselected: EventEmitter; + formatter: (obj: T) => string; + private _template?; + template: TemplateRef> | undefined; + templateSibling: ViewContainerRef; + constructor(renderer: Renderer2, element: ElementRef, changeDetector: ChangeDetectorRef, componentFactory: SuiComponentFactory); + deselectOption(e: HandledEvent): void; + onClick(e: HandledEvent): void; +} diff --git a/dist/modules/select/components/multi-select-label.js b/dist/modules/select/components/multi-select-label.js new file mode 100644 index 000000000..e94e63d7a --- /dev/null +++ b/dist/modules/select/components/multi-select-label.js @@ -0,0 +1,82 @@ +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 __()); + }; +})(); +import { Component, Input, HostBinding, HostListener, EventEmitter, ViewContainerRef, ViewChild, Renderer2, ElementRef, Output, ChangeDetectorRef, TemplateRef } from "@angular/core"; +import { SuiTransition, TransitionController, Transition, TransitionDirection } from "../../transition/index"; +import { HandledEvent, SuiComponentFactory } from "../../../misc/util/index"; +// See https://github.com/Microsoft/TypeScript/issues/13449. +var templateRef = TemplateRef; +var SuiMultiSelectLabel = /** @class */ (function (_super) { + __extends(SuiMultiSelectLabel, _super); + function SuiMultiSelectLabel(renderer, element, changeDetector, componentFactory) { + var _this = _super.call(this, renderer, element, changeDetector) || this; + _this.componentFactory = componentFactory; + // Initialise transition functionality. + // Initialise transition functionality. + _this._transitionController = new TransitionController(false, "inline-block"); + _this.setTransitionController(_this._transitionController); + _this.onDeselected = new EventEmitter(); + _this._labelClasses = true; + _this._transitionController.animate(new Transition("scale", 100, TransitionDirection.In)); + return _this; + } + Object.defineProperty(SuiMultiSelectLabel.prototype, "template", { + get: function () { + return this._template; + }, + set: function (template) { + this._template = template; + if (this.template) { + this.componentFactory.createView(this.templateSibling, this.template, { + $implicit: this.value, + query: this.query + }); + } + }, + enumerable: true, + configurable: true + }); + SuiMultiSelectLabel.prototype.deselectOption = function (e) { + var _this = this; + e.eventHandled = true; + this._transitionController.animate(new Transition("scale", 100, TransitionDirection.Out, function () { + return _this.onDeselected.emit(_this.value); + })); + }; + SuiMultiSelectLabel.prototype.onClick = function (e) { + e.eventHandled = true; + }; + SuiMultiSelectLabel.decorators = [ + { type: Component, args: [{ + selector: "sui-multi-select-label", + template: "\n\n\n\n" + },] }, + ]; + /** @nocollapse */ + SuiMultiSelectLabel.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + { type: ChangeDetectorRef, }, + { type: SuiComponentFactory, }, + ]; }; + SuiMultiSelectLabel.propDecorators = { + "_labelClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.label",] },], + "value": [{ type: Input },], + "query": [{ type: Input },], + "onDeselected": [{ type: Output, args: ["deselected",] },], + "formatter": [{ type: Input },], + "template": [{ type: Input },], + "templateSibling": [{ type: ViewChild, args: ["templateSibling", { read: ViewContainerRef },] },], + "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], + }; + return SuiMultiSelectLabel; +}(SuiTransition)); +export { SuiMultiSelectLabel }; +//# sourceMappingURL=multi-select-label.js.map \ No newline at end of file diff --git a/dist/modules/select/components/multi-select-label.js.map b/dist/modules/select/components/multi-select-label.js.map new file mode 100644 index 000000000..017482be3 --- /dev/null +++ b/dist/modules/select/components/multi-select-label.js.map @@ -0,0 +1 @@ +{"version":3,"file":"multi-select-label.js","sourceRoot":"","sources":["../../../../src/modules/select/components/multi-select-label.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAC3E,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAC3E,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC9G,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;;AAI7E,IAAM,WAAW,GAAG,WAAW,CAAC;;IAUY,uCAAa;IA0CrD,6BAAY,QAAkB,EAClB,OAAkB,EAClB,cAAgC,EACzB,gBAAoC;QAHvD,YAKI,kBAAM,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,SAW3C;QAbkB,sBAAgB,GAAhB,gBAAgB,CAAoB;;QAKnD,AADA,uCAAuC;QACvC,KAAI,CAAC,qBAAqB,GAAG,IAAI,oBAAoB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC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C,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,aAAa;0BAKzB,KAAK;0BAGL,KAAK;iCAGL,MAAM,SAAC,YAAY;8BAGnB,KAAK;6BAKL,KAAK;oCAgBL,SAAS,SAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;4BA6BvD,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;8BAvFrC;EAmB4C,aAAa;SAA5C,mBAAmB","sourcesContent":["import {\n Component, Input, HostBinding, HostListener, EventEmitter, ViewContainerRef,\n ViewChild, Renderer2, ElementRef, Output, ChangeDetectorRef, TemplateRef\n} from \"@angular/core\";\nimport { SuiTransition, TransitionController, Transition, TransitionDirection } from \"../../transition/index\";\nimport { HandledEvent, SuiComponentFactory } from \"../../../misc/util/index\";\nimport { IOptionContext } from \"../classes/select-base\";\n\n// See https://github.com/Microsoft/TypeScript/issues/13449.\nconst templateRef = TemplateRef;\n\n@Component({\n selector: \"sui-multi-select-label\",\n template: `\n\n\n\n`\n})\nexport class SuiMultiSelectLabel extends SuiTransition {\n // Sets the Semantic UI classes on the host element.\n // Doing it on the host enables use in menus etc.\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.label\")\n private _labelClasses:boolean;\n\n private _transitionController:TransitionController;\n\n @Input()\n public value:T;\n\n @Input()\n public query?:string;\n\n @Output(\"deselected\")\n public onDeselected:EventEmitter;\n\n @Input()\n public formatter:(obj:T) => string;\n\n private _template?:TemplateRef>;\n\n @Input()\n public get template():TemplateRef> | undefined {\n return this._template;\n }\n\n public set template(template:TemplateRef> | undefined) {\n this._template = template;\n if (this.template) {\n this.componentFactory.createView(this.templateSibling, this.template, {\n $implicit: this.value,\n query: this.query\n });\n }\n }\n\n // Placeholder to draw template beside.\n @ViewChild(\"templateSibling\", { read: ViewContainerRef })\n public templateSibling:ViewContainerRef;\n\n constructor(renderer:Renderer2,\n element:ElementRef,\n changeDetector:ChangeDetectorRef,\n public componentFactory:SuiComponentFactory) {\n\n super(renderer, element, changeDetector);\n\n // Initialise transition functionality.\n this._transitionController = new TransitionController(false, \"inline-block\");\n this.setTransitionController(this._transitionController);\n\n this.onDeselected = new EventEmitter();\n\n this._labelClasses = true;\n\n this._transitionController.animate(new Transition(\"scale\", 100, TransitionDirection.In));\n }\n\n public deselectOption(e:HandledEvent):void {\n e.eventHandled = true;\n\n this._transitionController.animate(\n new Transition(\"scale\", 100, TransitionDirection.Out, () =>\n this.onDeselected.emit(this.value)));\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(e:HandledEvent):void {\n e.eventHandled = true;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/components/multi-select-label.metadata.json b/dist/modules/select/components/multi-select-label.metadata.json new file mode 100644 index 000000000..281eb00f4 --- /dev/null +++ b/dist/modules/select/components/multi-select-label.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiMultiSelectLabel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../transition/index","name":"SuiTransition","line":19,"character":44},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":11,"character":1},"arguments":[{"selector":"sui-multi-select-label","template":"\n\n\n\n"}]}],"members":{"_labelClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":22,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":23,"character":5},"arguments":["class.label"]}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":28,"character":5}}]}],"query":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":5}}]}],"onDeselected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":34,"character":5},"arguments":["deselected"]}]}],"formatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":5}}]}],"template":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":5}}]}],"templateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":58,"character":5},"arguments":["templateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":58,"character":42}}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":61,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":62,"character":24},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":63,"character":31},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":64,"character":40}]}],"deselectOption":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":87,"character":5},"arguments":["click",["$event"]]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/components/multi-select.d.ts b/dist/modules/select/components/multi-select.d.ts new file mode 100644 index 000000000..aac8976a7 --- /dev/null +++ b/dist/modules/select/components/multi-select.d.ts @@ -0,0 +1,31 @@ +import { ElementRef, EventEmitter, Renderer2 } from "@angular/core"; +import { ICustomValueAccessorHost, CustomValueAccessor } from "../../../misc/util/index"; +import { SuiLocalizationService } from "../../../behaviors/localization/index"; +import { SuiSelectBase } from "../classes/select-base"; +import { SuiSelectOption } from "./select-option"; +export declare class SuiMultiSelect extends SuiSelectBase implements ICustomValueAccessorHost { + selectedOptions: T[]; + private _writtenOptions?; + selectedOptionsChange: EventEmitter; + readonly filteredOptions: T[]; + readonly availableOptions: T[]; + private _hasLabels; + hasLabels: boolean; + private _placeholder; + placeholder: string; + maxSelected: number; + readonly maxSelectedReached: boolean; + readonly maxSelectedMessage: string; + readonly selectedMessage: string; + private _multiSelectClasses; + constructor(element: ElementRef, renderer: Renderer2, localizationService: SuiLocalizationService); + protected optionsUpdateHook(): void; + protected initialiseRenderedOption(option: SuiSelectOption): void; + selectOption(option: T): void; + writeValue(values: U[]): void; + deselectOption(option: T): void; + onQueryInputKeydown(event: KeyboardEvent): void; +} +export declare class SuiMultiSelectValueAccessor extends CustomValueAccessor> { + constructor(host: SuiMultiSelect); +} diff --git a/dist/modules/select/components/multi-select.js b/dist/modules/select/components/multi-select.js new file mode 100644 index 000000000..4123e2714 --- /dev/null +++ b/dist/modules/select/components/multi-select.js @@ -0,0 +1,225 @@ +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 __()); + }; +})(); +import { Component, HostBinding, ElementRef, EventEmitter, Output, Input, Directive, Renderer2 } from "@angular/core"; +import { KeyCode, customValueAccessorFactory, CustomValueAccessor } from "../../../misc/util/index"; +import { SuiLocalizationService } from "../../../behaviors/localization/index"; +import { SuiSelectBase } from "../classes/select-base"; +var SuiMultiSelect = /** @class */ (function (_super) { + __extends(SuiMultiSelect, _super); + function SuiMultiSelect(element, renderer, localizationService) { + var _this = _super.call(this, element, renderer, localizationService) || this; + _this.selectedOptions = []; + _this.selectedOptionsChange = new EventEmitter(); + _this.hasLabels = true; + _this._multiSelectClasses = true; + return _this; + } + Object.defineProperty(SuiMultiSelect.prototype, "filteredOptions", { + get: function () { + var _this = this; + if (this.maxSelectedReached) { + // If we have reached the maximum number of selections, then empty the results completely. + return []; + } + var searchResults = this.searchService.results; + if (!this.hasLabels) { + return searchResults; + } + else { + // Returns the search results \ selected options. + return searchResults + .filter(function (r) { return _this.selectedOptions.find(function (o) { return r === o; }) == undefined; }); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "availableOptions", { + get: function () { + return this.filteredOptions; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "hasLabels", { + get: function () { + return this._hasLabels; + }, + set: function (hasLabels) { + this._hasLabels = hasLabels; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "placeholder", { + get: function () { + return this._placeholder || this.localeValues.multi.placeholder; + }, + set: function (placeholder) { + this._placeholder = placeholder; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "maxSelectedReached", { + get: function () { + if (this.maxSelected == undefined) { + // If there is no maximum then we can immediately return. + return false; + } + return this.selectedOptions.length === this.maxSelected; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "maxSelectedMessage", { + get: function () { + return this._localizationService.interpolate(this.localeValues.multi.maxSelectedMessage, [["max", this.maxSelected.toString()]]); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiMultiSelect.prototype, "selectedMessage", { + get: function () { + return this._localizationService.interpolate(this.localeValues.multi.selectedMessage, [["count", this.selectedOptions.length.toString()]]); + }, + enumerable: true, + configurable: true + }); + SuiMultiSelect.prototype.optionsUpdateHook = function () { + var _this = this; + if (!this._writtenOptions && this.selectedOptions.length > 0) { + // We need to check the options still exist. + this.writeValue(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); + } + if (this._writtenOptions && this.searchService.options.length > 0) { + // If there were values written by ngModel before the options had been loaded, this runs to fix it. + this.selectedOptions = this._writtenOptions + .map(function (v) { return _this.findOption(_this.searchService.options, v); }) + .filter(function (v) { return v != undefined; }); + if (this.selectedOptions.length === this._writtenOptions.length) { + this._writtenOptions = undefined; + } + } + }; + SuiMultiSelect.prototype.initialiseRenderedOption = function (option) { + _super.prototype.initialiseRenderedOption.call(this, option); + // Boldens the item so it appears selected in the dropdown. + option.isActive = !this.hasLabels && this.selectedOptions.indexOf(option.value) !== -1; + }; + SuiMultiSelect.prototype.selectOption = function (option) { + var _this = this; + if (this.selectedOptions.indexOf(option) !== -1) { + this.deselectOption(option); + return; + } + this.selectedOptions.push(option); + this.selectedOptionsChange.emit(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); + this.resetQuery(false); + // Automatically refocus the search input for better keyboard accessibility. + this.focus(); + if (!this.hasLabels) { + this.onAvailableOptionsRendered(); + } + }; + SuiMultiSelect.prototype.writeValue = function (values) { + var _this = this; + if (values instanceof Array) { + if (this.searchService.options.length > 0) { + // If the options have already been loaded, we can immediately match the ngModel values to options. + this.selectedOptions = values + .map(function (v) { return _this.findOption(_this.searchService.options, v); }) + .filter(function (v) { return v != undefined; }); + } + if (values.length > 0 && this.selectedOptions.length === 0) { + if (this.valueField && this.searchService.hasItemLookup) { + // If the search service has a selected lookup function, make use of that to load the initial values. + this.searchService + .initialLookup(values) + .then(function (items) { return _this.selectedOptions = items; }); + } + else { + // Otherwise, cache the written value for when options are set. + this._writtenOptions = values; + } + } + if (values.length === 0) { + this.selectedOptions = []; + } + } + else { + this.selectedOptions = []; + } + }; + SuiMultiSelect.prototype.deselectOption = function (option) { + var _this = this; + // Update selected options to the previously selected options \ {option}. + this.selectedOptions = this.selectedOptions.filter(function (so) { return so !== option; }); + this.selectedOptionsChange.emit(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); + // Automatically refocus the search input for better keyboard accessibility. + this.focus(); + if (!this.hasLabels) { + this.onAvailableOptionsRendered(); + } + }; + SuiMultiSelect.prototype.onQueryInputKeydown = function (event) { + if (event.keyCode === KeyCode.Backspace && this.query === "" && this.selectedOptions.length > 0) { + // Deselect the rightmost option when the user presses backspace in the search input. + this.deselectOption(this.selectedOptions[this.selectedOptions.length - 1]); + } + }; + SuiMultiSelect.decorators = [ + { type: Component, args: [{ + selector: "sui-multi-select", + template: "\n\n\n\n\n\n \n\n\n\n\n\n\n
\n \n \n {{ placeholder }}\n \n \n {{ selectedMessage }}\n
\n\n\n
\n\n \n \n
{{ localeValues.noResultsMessage }}
\n
{{ maxSelectedMessage }}
\n
\n
\n", + styles: ["\n:host input.search {\n width: 12em !important;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiMultiSelect.ctorParameters = function () { return [ + { type: ElementRef, }, + { type: Renderer2, }, + { type: SuiLocalizationService, }, + ]; }; + SuiMultiSelect.propDecorators = { + "selectedOptionsChange": [{ type: Output },], + "hasLabels": [{ type: Input },], + "placeholder": [{ type: Input },], + "maxSelected": [{ type: Input },], + "_multiSelectClasses": [{ type: HostBinding, args: ["class.multiple",] },], + }; + return SuiMultiSelect; +}(SuiSelectBase)); +export { SuiMultiSelect }; +// Value accessor directive for the select to support ngModel. +var SuiMultiSelectValueAccessor = /** @class */ (function (_super) { + __extends(SuiMultiSelectValueAccessor, _super); + function SuiMultiSelectValueAccessor(host) { + return _super.call(this, host) || this; + } + SuiMultiSelectValueAccessor.decorators = [ + { type: Directive, args: [{ + selector: "sui-multi-select", + host: { + "(selectedOptionsChange)": "onChange($event)", + "(touched)": "onTouched()" + }, + providers: [customValueAccessorFactory(SuiMultiSelectValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiMultiSelectValueAccessor.ctorParameters = function () { return [ + { type: SuiMultiSelect, }, + ]; }; + return SuiMultiSelectValueAccessor; +}(CustomValueAccessor)); +export { SuiMultiSelectValueAccessor }; +//# sourceMappingURL=multi-select.js.map \ No newline at end of file diff --git a/dist/modules/select/components/multi-select.js.map b/dist/modules/select/components/multi-select.js.map new file mode 100644 index 000000000..63b7ebf97 --- /dev/null +++ b/dist/modules/select/components/multi-select.js.map @@ -0,0 +1 @@ +{"version":3,"file":"multi-select.js","sourceRoot":"","sources":["../../../../src/modules/select/components/multi-select.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY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BA1DgC,UAAU;gBAA0C,SAAS;gBAErF,sBAAsB;;;0CA8D1B,MAAM;8BA0BN,KAAK;gCAWL,KAAK;gCASL,KAAK;wCAuBL,WAAW,SAAC,gBAAgB;;yBArIjC;EA2D0C,aAAa;SAA1C,cAAc;;;IA6L4B,+CAA8C;IACjG,qCAAY,IAAyB;eACjC,kBAAM,IAAI,CAAC;KACd;;gBAXJ,SAAS,SAAC;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE;wBACF,yBAAyB,EAAE,kBAAkB;wBAC7C,WAAW,EAAE,aAAa;qBAC7B;oBACD,SAAS,EAAE,CAAC,0BAA0B,CAAC,2BAA2B,CAAC,CAAC;iBACvE;;;;gBA5LY,cAAc;;sCA3D3B;EAwPuD,mBAAmB;SAA7D,2BAA2B","sourcesContent":["import { Component, HostBinding, ElementRef, EventEmitter, Output, Input, Directive, Renderer2 } from \"@angular/core\";\nimport { ICustomValueAccessorHost, KeyCode, customValueAccessorFactory, CustomValueAccessor } from \"../../../misc/util/index\";\nimport { SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SuiSelectBase } from \"../classes/select-base\";\nimport { SuiSelectOption } from \"./select-option\";\n\n@Component({\n selector: \"sui-multi-select\",\n template: `\n\n\n\n\n\n \n\n\n\n\n\n\n
\n \n \n {{ placeholder }}\n \n \n {{ selectedMessage }}\n
\n\n\n
\n\n \n \n
{{ localeValues.noResultsMessage }}
\n
{{ maxSelectedMessage }}
\n
\n
\n`,\n styles: [`\n:host input.search {\n width: 12em !important;\n}\n`]\n})\nexport class SuiMultiSelect extends SuiSelectBase implements ICustomValueAccessorHost {\n public selectedOptions:T[];\n // Stores the values written by ngModel before it can be matched to an option from `options`.\n private _writtenOptions?:U[];\n\n @Output()\n public selectedOptionsChange:EventEmitter;\n\n public get filteredOptions():T[] {\n if (this.maxSelectedReached) {\n // If we have reached the maximum number of selections, then empty the results completely.\n return [];\n }\n\n const searchResults:T[] = this.searchService.results;\n\n if (!this.hasLabels) {\n return searchResults;\n } else {\n // Returns the search results \\ selected options.\n return searchResults\n .filter(r => this.selectedOptions.find(o => r === o) == undefined);\n }\n }\n\n public get availableOptions():T[] {\n return this.filteredOptions;\n }\n\n private _hasLabels:boolean;\n\n @Input()\n public get hasLabels():boolean {\n return this._hasLabels;\n }\n\n public set hasLabels(hasLabels:boolean) {\n this._hasLabels = hasLabels;\n }\n\n private _placeholder:string;\n\n @Input()\n public get placeholder():string {\n return this._placeholder || this.localeValues.multi.placeholder;\n }\n\n public set placeholder(placeholder:string) {\n this._placeholder = placeholder;\n }\n\n @Input()\n public maxSelected:number;\n\n public get maxSelectedReached():boolean {\n if (this.maxSelected == undefined) {\n // If there is no maximum then we can immediately return.\n return false;\n }\n return this.selectedOptions.length === this.maxSelected;\n }\n\n public get maxSelectedMessage():string {\n return this._localizationService.interpolate(\n this.localeValues.multi.maxSelectedMessage,\n [[\"max\", this.maxSelected.toString()]]);\n }\n\n public get selectedMessage():string {\n return this._localizationService.interpolate(\n this.localeValues.multi.selectedMessage,\n [[\"count\", this.selectedOptions.length.toString()]]);\n }\n\n @HostBinding(\"class.multiple\")\n private _multiSelectClasses:boolean;\n\n constructor(element:ElementRef, renderer:Renderer2, localizationService:SuiLocalizationService) {\n super(element, renderer, localizationService);\n\n this.selectedOptions = [];\n this.selectedOptionsChange = new EventEmitter();\n\n this.hasLabels = true;\n this._multiSelectClasses = true;\n }\n\n protected optionsUpdateHook():void {\n if (!this._writtenOptions && this.selectedOptions.length > 0) {\n // We need to check the options still exist.\n this.writeValue(this.selectedOptions.map(o => this.valueGetter(o)));\n }\n\n if (this._writtenOptions && this.searchService.options.length > 0) {\n // If there were values written by ngModel before the options had been loaded, this runs to fix it.\n this.selectedOptions = this._writtenOptions\n // non-null assertion added here because Typescript doesn't recognise the non-null filter.\n .map(v => this.findOption(this.searchService.options, v)!)\n .filter(v => v != undefined);\n\n if (this.selectedOptions.length === this._writtenOptions.length) {\n this._writtenOptions = undefined;\n }\n }\n }\n\n protected initialiseRenderedOption(option:SuiSelectOption):void {\n super.initialiseRenderedOption(option);\n\n // Boldens the item so it appears selected in the dropdown.\n option.isActive = !this.hasLabels && this.selectedOptions.indexOf(option.value) !== -1;\n }\n\n public selectOption(option:T):void {\n if (this.selectedOptions.indexOf(option) !== -1) {\n this.deselectOption(option);\n return;\n }\n this.selectedOptions.push(option);\n this.selectedOptionsChange.emit(this.selectedOptions.map(o => this.valueGetter(o)));\n\n this.resetQuery(false);\n\n // Automatically refocus the search input for better keyboard accessibility.\n this.focus();\n\n if (!this.hasLabels) {\n this.onAvailableOptionsRendered();\n }\n }\n\n public writeValue(values:U[]):void {\n if (values instanceof Array) {\n if (this.searchService.options.length > 0) {\n // If the options have already been loaded, we can immediately match the ngModel values to options.\n this.selectedOptions = values\n // non-null assertion added here because Typescript doesn't recognise the non-null filter.\n .map(v => this.findOption(this.searchService.options, v)!)\n .filter(v => v != undefined);\n }\n if (values.length > 0 && this.selectedOptions.length === 0) {\n if (this.valueField && this.searchService.hasItemLookup) {\n // If the search service has a selected lookup function, make use of that to load the initial values.\n this.searchService\n .initialLookup(values)\n .then(items => this.selectedOptions = items);\n } else {\n // Otherwise, cache the written value for when options are set.\n this._writtenOptions = values;\n }\n }\n if (values.length === 0) {\n this.selectedOptions = [];\n }\n } else {\n this.selectedOptions = [];\n }\n }\n\n public deselectOption(option:T):void {\n // Update selected options to the previously selected options \\ {option}.\n this.selectedOptions = this.selectedOptions.filter(so => so !== option);\n this.selectedOptionsChange.emit(this.selectedOptions.map(o => this.valueGetter(o)));\n\n // Automatically refocus the search input for better keyboard accessibility.\n this.focus();\n\n if (!this.hasLabels) {\n this.onAvailableOptionsRendered();\n }\n }\n\n public onQueryInputKeydown(event:KeyboardEvent):void {\n if (event.keyCode === KeyCode.Backspace && this.query === \"\" && this.selectedOptions.length > 0) {\n // Deselect the rightmost option when the user presses backspace in the search input.\n this.deselectOption(this.selectedOptions[this.selectedOptions.length - 1]);\n }\n }\n}\n\n// Value accessor directive for the select to support ngModel.\n@Directive({\n selector: \"sui-multi-select\",\n host: {\n \"(selectedOptionsChange)\": \"onChange($event)\",\n \"(touched)\": \"onTouched()\"\n },\n providers: [customValueAccessorFactory(SuiMultiSelectValueAccessor)]\n})\nexport class SuiMultiSelectValueAccessor extends CustomValueAccessor> {\n constructor(host:SuiMultiSelect) {\n super(host);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/components/multi-select.metadata.json b/dist/modules/select/components/multi-select.metadata.json new file mode 100644 index 000000000..4c1b04217 --- /dev/null +++ b/dist/modules/select/components/multi-select.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiMultiSelect":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../classes/select-base","name":"SuiSelectBase","line":59,"character":42},"arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"sui-multi-select","template":"\n\n\n\n\n\n \n\n\n\n\n\n\n
\n \n \n {{ placeholder }}\n \n \n {{ selectedMessage }}\n
\n\n\n
\n\n \n \n
{{ localeValues.noResultsMessage }}
\n
{{ maxSelectedMessage }}
\n
\n
\n","styles":["\n:host input.search {\n width: 12em !important;\n}\n"]}]}],"members":{"selectedOptionsChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":64,"character":5}}]}],"hasLabels":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":90,"character":5}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":101,"character":5}}]}],"maxSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":110,"character":5}}]}],"_multiSelectClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":133,"character":5},"arguments":["class.multiple"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":136,"character":24},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":136,"character":45},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":136,"character":76}]}],"optionsUpdateHook":[{"__symbolic":"method"}],"initialiseRenderedOption":[{"__symbolic":"method"}],"selectOption":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"deselectOption":[{"__symbolic":"method"}],"onQueryInputKeydown":[{"__symbolic":"method"}]}},"SuiMultiSelectValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":248,"character":55},"arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":240,"character":1},"arguments":[{"selector":"sui-multi-select","host":{"(selectedOptionsChange)":"onChange($event)","(touched)":"onTouched()","$quoted$":["(selectedOptionsChange)","(touched)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":246,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiMultiSelectValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiMultiSelect","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":249,"character":36,"context":{"typeName":"T"}},{"__symbolic":"error","message":"Could not resolve type","line":249,"character":39,"context":{"typeName":"U"}}]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/components/select-option.d.ts b/dist/modules/select/components/select-option.d.ts new file mode 100644 index 000000000..3484760d6 --- /dev/null +++ b/dist/modules/select/components/select-option.d.ts @@ -0,0 +1,16 @@ +import { EventEmitter, ViewContainerRef, Renderer2, ElementRef, ChangeDetectorRef } from "@angular/core"; +import { SuiDropdownMenuItem } from "../../dropdown/index"; +import { HandledEvent } from "../../../misc/util/index"; +export declare class SuiSelectOption extends SuiDropdownMenuItem { + changeDetector: ChangeDetectorRef; + private _optionClasses; + value: T; + onSelected: EventEmitter; + isActive: boolean; + renderedText?: string; + formatter: (obj: T) => string; + usesTemplate: boolean; + templateSibling: ViewContainerRef; + constructor(renderer: Renderer2, element: ElementRef, changeDetector: ChangeDetectorRef); + onClick(e: HandledEvent): void; +} diff --git a/dist/modules/select/components/select-option.js b/dist/modules/select/components/select-option.js new file mode 100644 index 000000000..a5fb98c03 --- /dev/null +++ b/dist/modules/select/components/select-option.js @@ -0,0 +1,71 @@ +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 __()); + }; +})(); +import { Component, Input, HostBinding, HostListener, EventEmitter, ViewContainerRef, ViewChild, Renderer2, ElementRef, Output, ChangeDetectorRef } from "@angular/core"; +import { SuiDropdownMenuItem } from "../../dropdown/index"; +import { HandledEvent } from "../../../misc/util/index"; +var SuiSelectOption = /** @class */ (function (_super) { + __extends(SuiSelectOption, _super); + function SuiSelectOption(renderer, element, changeDetector) { + var _this = + // We inherit SuiDropdownMenuItem to automatically gain all keyboard navigation functionality. + // This is not done via adding the .item class because it isn't supported by Angular. + _super.call(this, renderer, element) || this; + _this.changeDetector = changeDetector; + _this._optionClasses = true; + _this.isActive = false; + _this.onSelected = new EventEmitter(); + // By default we make the default text an empty label, for the brief moment when it isn't displaying the correct one. + // By default we make the default text an empty label, for the brief moment when it isn't displaying the correct one. + _this.renderedText = ""; + _this.usesTemplate = false; + return _this; + } + Object.defineProperty(SuiSelectOption.prototype, "formatter", { + set: function (formatter) { + if (!this.usesTemplate) { + this.renderedText = formatter(this.value); + } + else { + this.renderedText = ""; + } + }, + enumerable: true, + configurable: true + }); + SuiSelectOption.prototype.onClick = function (e) { + var _this = this; + e.eventHandled = true; + setTimeout(function () { return _this.onSelected.emit(_this.value); }); + }; + SuiSelectOption.decorators = [ + { type: Component, args: [{ + selector: "sui-select-option", + template: "\n\n\n" + },] }, + ]; + /** @nocollapse */ + SuiSelectOption.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + { type: ChangeDetectorRef, }, + ]; }; + SuiSelectOption.propDecorators = { + "_optionClasses": [{ type: HostBinding, args: ["class.item",] },], + "value": [{ type: Input },], + "onSelected": [{ type: Output },], + "isActive": [{ type: HostBinding, args: ["class.active",] },], + "templateSibling": [{ type: ViewChild, args: ["templateSibling", { read: ViewContainerRef },] },], + "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], + }; + return SuiSelectOption; +}(SuiDropdownMenuItem)); +export { SuiSelectOption }; +//# sourceMappingURL=select-option.js.map \ No newline at end of file diff --git a/dist/modules/select/components/select-option.js.map b/dist/modules/select/components/select-option.js.map new file mode 100644 index 000000000..666b858cb --- /dev/null +++ b/dist/modules/select/components/select-option.js.map @@ -0,0 +1 @@ +{"version":3,"file":"select-option.js","sourceRoot":"","sources":["../../../../src/modules/select/components/select-option.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAC3E,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAC9D,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;;IAShB,mCAAmB;IA+BvD,yBAAY,QAAkB,EAAE,OAAkB,EAAS,cAAgC;QAA3F;QACI,8FAA8F;QAC9F,qFAAqF;QACrF,kBAAM,QAAQ,EAAE,OAAO,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eDetectorRef\n} from \"@angular/core\";\nimport { SuiDropdownMenuItem } from \"../../dropdown/index\";\nimport { HandledEvent } from \"../../../misc/util/index\";\n\n@Component({\n selector: \"sui-select-option\",\n template: `\n\n\n`\n})\nexport class SuiSelectOption extends SuiDropdownMenuItem {\n // Sets the Semantic UI classes on the host element.\n @HostBinding(\"class.item\")\n private _optionClasses:boolean;\n\n @Input()\n public value:T;\n\n // Fires when the option is selected, whether by clicking or by keyboard.\n @Output()\n public onSelected:EventEmitter;\n\n @HostBinding(\"class.active\")\n public isActive:boolean;\n\n public renderedText?:string;\n\n public set formatter(formatter:(obj:T) => string) {\n if (!this.usesTemplate) {\n this.renderedText = formatter(this.value);\n } else {\n this.renderedText = \"\";\n }\n }\n\n public usesTemplate:boolean;\n\n // Placeholder to draw template beside.\n @ViewChild(\"templateSibling\", { read: ViewContainerRef })\n public templateSibling:ViewContainerRef;\n\n constructor(renderer:Renderer2, element:ElementRef, public changeDetector:ChangeDetectorRef) {\n // We inherit SuiDropdownMenuItem to automatically gain all keyboard navigation functionality.\n // This is not done via adding the .item class because it isn't supported by Angular.\n super(renderer, element);\n\n this._optionClasses = true;\n this.isActive = false;\n this.onSelected = new EventEmitter();\n\n // By default we make the default text an empty label, for the brief moment when it isn't displaying the correct one.\n this.renderedText = \"\";\n\n this.usesTemplate = false;\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(e:HandledEvent):void {\n e.eventHandled = true;\n\n setTimeout(() => this.onSelected.emit(this.value));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/components/select-option.metadata.json b/dist/modules/select/components/select-option.metadata.json new file mode 100644 index 000000000..1ddc44694 --- /dev/null +++ b/dist/modules/select/components/select-option.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiSelectOption":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../dropdown/index","name":"SuiDropdownMenuItem","line":14,"character":40},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":7,"character":1},"arguments":[{"selector":"sui-select-option","template":"\n\n\n"}]}],"members":{"_optionClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":16,"character":5},"arguments":["class.item"]}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":5}}]}],"onSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":23,"character":5}}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":26,"character":5},"arguments":["class.active"]}]}],"templateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":42,"character":5},"arguments":["templateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":42,"character":42}}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":45,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":45,"character":44},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":45,"character":78}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":60,"character":5},"arguments":["click",["$event"]]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/components/select.d.ts b/dist/modules/select/components/select.d.ts new file mode 100644 index 000000000..5f4335586 --- /dev/null +++ b/dist/modules/select/components/select.d.ts @@ -0,0 +1,23 @@ +import { EventEmitter, ElementRef, Renderer2 } from "@angular/core"; +import { ICustomValueAccessorHost, CustomValueAccessor } from "../../../misc/util/index"; +import { SuiLocalizationService } from "../../../behaviors/localization/index"; +import { SuiSelectBase } from "../classes/select-base"; +import { SuiSelectOption } from "./select-option"; +export declare class SuiSelect extends SuiSelectBase implements ICustomValueAccessorHost { + selectedOption?: T; + private _writtenOption?; + private _optionTemplateSibling; + selectedOptionChange: EventEmitter; + private _placeholder; + placeholder: string; + constructor(element: ElementRef, renderer: Renderer2, localizationService: SuiLocalizationService); + protected optionsUpdateHook(): void; + protected queryUpdateHook(): void; + selectOption(option: T): void; + writeValue(value: U): void; + protected initialiseRenderedOption(option: SuiSelectOption): void; + private drawSelectedOption(); +} +export declare class SuiSelectValueAccessor extends CustomValueAccessor> { + constructor(host: SuiSelect); +} diff --git a/dist/modules/select/components/select.js b/dist/modules/select/components/select.js new file mode 100644 index 000000000..63841840e --- /dev/null +++ b/dist/modules/select/components/select.js @@ -0,0 +1,146 @@ +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 __()); + }; +})(); +import { Component, ViewContainerRef, ViewChild, Output, EventEmitter, ElementRef, Directive, Input, Renderer2 } from "@angular/core"; +import { customValueAccessorFactory, CustomValueAccessor } from "../../../misc/util/index"; +import { SuiLocalizationService } from "../../../behaviors/localization/index"; +import { SuiSelectBase } from "../classes/select-base"; +var SuiSelect = /** @class */ (function (_super) { + __extends(SuiSelect, _super); + function SuiSelect(element, renderer, localizationService) { + var _this = _super.call(this, element, renderer, localizationService) || this; + _this.selectedOptionChange = new EventEmitter(); + return _this; + } + Object.defineProperty(SuiSelect.prototype, "placeholder", { + get: function () { + return this._placeholder || this.localeValues.single.placeholder; + }, + set: function (placeholder) { + this._placeholder = placeholder; + }, + enumerable: true, + configurable: true + }); + SuiSelect.prototype.optionsUpdateHook = function () { + if (!this._writtenOption && this.selectedOption) { + // We need to check the option still exists. + this.writeValue(this.valueGetter(this.selectedOption)); + } + if (this._writtenOption && this.searchService.options.length > 0) { + // If there was an value written by ngModel before the options had been loaded, this runs to fix it. + this.selectedOption = this.findOption(this.searchService.options, this._writtenOption); + if (this.selectedOption) { + this._writtenOption = undefined; + this.drawSelectedOption(); + } + } + }; + SuiSelect.prototype.queryUpdateHook = function () { + // When the query is updated, we just abandon the current selection. + this.selectedOption = undefined; + }; + SuiSelect.prototype.selectOption = function (option) { + // Choose and emit the selected option. + this.selectedOption = option; + this.selectedOptionChange.emit(this.valueGetter(option)); + this.dropdownService.setOpenState(false); + this.resetQuery(); + this.drawSelectedOption(); + // Automatically refocus the search input for better keyboard accessibility. + this.focus(); + }; + SuiSelect.prototype.writeValue = function (value) { + var _this = this; + if (value != undefined) { + if (this.searchService.options.length > 0) { + // If the options have already been loaded, we can immediately match the ngModel value to an option. + this.selectedOption = this.findOption(this.searchService.options, value); + this.drawSelectedOption(); + } + if (this.selectedOption == undefined) { + if (this.valueField && this.searchService.hasItemLookup) { + // If the search service has a selected lookup function, make use of that to load the initial value. + this.searchService + .initialLookup(value) + .then(function (i) { + _this.selectedOption = i; + _this.drawSelectedOption(); + }); + } + else { + // Otherwise, cache the written value for when options are set. + this._writtenOption = value; + } + } + } + else { + this.selectedOption = undefined; + this.drawSelectedOption(); + } + }; + SuiSelect.prototype.initialiseRenderedOption = function (option) { + _super.prototype.initialiseRenderedOption.call(this, option); + // Boldens the item so it appears selected in the dropdown. + option.isActive = option.value === this.selectedOption; + }; + SuiSelect.prototype.drawSelectedOption = function () { + // Updates the active class on the newly selected option. + if (this._renderedOptions) { + this.onAvailableOptionsRendered(); + } + if (this.selectedOption != undefined && this.optionTemplate) { + this.drawTemplate(this._optionTemplateSibling, this.selectedOption); + } + }; + SuiSelect.decorators = [ + { type: Component, args: [{ + selector: "sui-select", + template: "\n\n\n\n\n
{{ placeholder }}
\n\n
\n \n \n
\n\n\n\n
\n\n \n
\n {{ localeValues.noResultsMessage }}\n
\n
\n" + },] }, + ]; + /** @nocollapse */ + SuiSelect.ctorParameters = function () { return [ + { type: ElementRef, }, + { type: Renderer2, }, + { type: SuiLocalizationService, }, + ]; }; + SuiSelect.propDecorators = { + "_optionTemplateSibling": [{ type: ViewChild, args: ["optionTemplateSibling", { read: ViewContainerRef },] },], + "selectedOptionChange": [{ type: Output },], + "placeholder": [{ type: Input },], + }; + return SuiSelect; +}(SuiSelectBase)); +export { SuiSelect }; +// Value accessor directive for the select to support ngModel. +var SuiSelectValueAccessor = /** @class */ (function (_super) { + __extends(SuiSelectValueAccessor, _super); + function SuiSelectValueAccessor(host) { + return _super.call(this, host) || this; + } + SuiSelectValueAccessor.decorators = [ + { type: Directive, args: [{ + selector: "sui-select", + host: { + "(selectedOptionChange)": "onChange($event)", + "(touched)": "onTouched()" + }, + providers: [customValueAccessorFactory(SuiSelectValueAccessor)] + },] }, + ]; + /** @nocollapse */ + SuiSelectValueAccessor.ctorParameters = function () { return [ + { type: SuiSelect, }, + ]; }; + return SuiSelectValueAccessor; +}(CustomValueAccessor)); +export { SuiSelectValueAccessor }; +//# sourceMappingURL=select.js.map \ No newline at end of file diff --git a/dist/modules/select/components/select.js.map b/dist/modules/select/components/select.js.map new file mode 100644 index 000000000..4388630e5 --- /dev/null +++ b/dist/modules/select/components/select.js.map @@ -0,0 +1 @@ +{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/modules/select/components/select.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtI,OAAO,EAA4B,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACrH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;;IAkClB,6BA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AAC,KAAK,KAAK,IAAI,CAAC,cAAc,CAAC;KAC1D;IAEO,sCAAkB,GAA1B;;QAEI,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,0BAA0B,EAAE,CAAC;SACrC;QAED,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,IAAI,SAAS,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;YAC1D,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,sBAAsB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;SACvE;KACJ;;gBA3IJ,SAAS,SAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,ohCA2Bb;iBACA;;;;gBApCsE,UAAU;gBAAoB,SAAS;gBAErG,sBAAsB;;;2CAwC1B,SAAS,SAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;yCAG7D,MAAM;gCAKN,KAAK;;oBAlDV;EAqCqC,aAAa;SAArC,SAAS;;;IAwH4B,0CAAuC;IACrF,gCAAY,IAAoB;eAC5B,kBAAM,IAAI,CAAC;KACd;;gBAXJ,SAAS,SAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE;wBACF,wBAAwB,EAAE,kBAAkB;wBAC5C,WAAW,EAAE,aAAa;qBAC7B;oBACD,SAAS,EAAE,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,CAAC;iBAClE;;;;gBAvHY,SAAS;;iCArCtB;EA6JkD,mBAAmB;SAAxD,sBAAsB","sourcesContent":["import { Component, ViewContainerRef, ViewChild, Output, EventEmitter, ElementRef, Directive, Input, Renderer2 } from \"@angular/core\";\nimport { ICustomValueAccessorHost, customValueAccessorFactory, CustomValueAccessor } from \"../../../misc/util/index\";\nimport { SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SuiSelectBase } from \"../classes/select-base\";\nimport { SuiSelectOption } from \"./select-option\";\n\n@Component({\n selector: \"sui-select\",\n template: `\n\n\n\n\n
{{ placeholder }}
\n\n
\n \n \n
\n\n\n\n
\n\n \n
\n {{ localeValues.noResultsMessage }}\n
\n
\n`\n})\nexport class SuiSelect extends SuiSelectBase implements ICustomValueAccessorHost {\n public selectedOption?:T;\n // Stores the value written by ngModel before it can be matched to an option from `options`.\n private _writtenOption?:U;\n\n @ViewChild(\"optionTemplateSibling\", { read: ViewContainerRef })\n private _optionTemplateSibling:ViewContainerRef;\n\n @Output()\n public selectedOptionChange:EventEmitter;\n\n private _placeholder:string;\n\n @Input()\n public get placeholder():string {\n return this._placeholder || this.localeValues.single.placeholder;\n }\n\n public set placeholder(placeholder:string) {\n this._placeholder = placeholder;\n }\n\n constructor(element:ElementRef, renderer:Renderer2, localizationService:SuiLocalizationService) {\n super(element, renderer, localizationService);\n\n this.selectedOptionChange = new EventEmitter();\n }\n\n protected optionsUpdateHook():void {\n if (!this._writtenOption && this.selectedOption) {\n // We need to check the option still exists.\n this.writeValue(this.valueGetter(this.selectedOption));\n }\n\n if (this._writtenOption && this.searchService.options.length > 0) {\n // If there was an value written by ngModel before the options had been loaded, this runs to fix it.\n this.selectedOption = this.findOption(this.searchService.options, this._writtenOption);\n if (this.selectedOption) {\n this._writtenOption = undefined;\n this.drawSelectedOption();\n }\n }\n }\n\n protected queryUpdateHook():void {\n // When the query is updated, we just abandon the current selection.\n this.selectedOption = undefined;\n }\n\n public selectOption(option:T):void {\n // Choose and emit the selected option.\n this.selectedOption = option;\n this.selectedOptionChange.emit(this.valueGetter(option));\n\n this.dropdownService.setOpenState(false);\n\n this.resetQuery();\n\n this.drawSelectedOption();\n\n // Automatically refocus the search input for better keyboard accessibility.\n this.focus();\n }\n\n public writeValue(value:U):void {\n if (value != undefined) {\n if (this.searchService.options.length > 0) {\n // If the options have already been loaded, we can immediately match the ngModel value to an option.\n this.selectedOption = this.findOption(this.searchService.options, value);\n\n this.drawSelectedOption();\n }\n if (this.selectedOption == undefined) {\n if (this.valueField && this.searchService.hasItemLookup) {\n // If the search service has a selected lookup function, make use of that to load the initial value.\n this.searchService\n .initialLookup(value)\n .then(i => {\n this.selectedOption = i;\n this.drawSelectedOption();\n });\n } else {\n // Otherwise, cache the written value for when options are set.\n this._writtenOption = value;\n }\n }\n } else {\n this.selectedOption = undefined;\n this.drawSelectedOption();\n }\n }\n\n protected initialiseRenderedOption(option:SuiSelectOption):void {\n super.initialiseRenderedOption(option);\n\n // Boldens the item so it appears selected in the dropdown.\n option.isActive = option.value === this.selectedOption;\n }\n\n private drawSelectedOption():void {\n // Updates the active class on the newly selected option.\n if (this._renderedOptions) {\n this.onAvailableOptionsRendered();\n }\n\n if (this.selectedOption != undefined && this.optionTemplate) {\n this.drawTemplate(this._optionTemplateSibling, this.selectedOption);\n }\n }\n}\n\n// Value accessor directive for the select to support ngModel.\n@Directive({\n selector: \"sui-select\",\n host: {\n \"(selectedOptionChange)\": \"onChange($event)\",\n \"(touched)\": \"onTouched()\"\n },\n providers: [customValueAccessorFactory(SuiSelectValueAccessor)]\n})\nexport class SuiSelectValueAccessor extends CustomValueAccessor> {\n constructor(host:SuiSelect) {\n super(host);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/components/select.metadata.json b/dist/modules/select/components/select.metadata.json new file mode 100644 index 000000000..01e5b392f --- /dev/null +++ b/dist/modules/select/components/select.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiSelect":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../classes/select-base","name":"SuiSelectBase","line":37,"character":37},"arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"sui-select","template":"\n\n\n\n\n
{{ placeholder }}
\n\n
\n \n \n
\n\n\n\n
\n\n \n
\n {{ localeValues.noResultsMessage }}\n
\n
\n"}]}],"members":{"_optionTemplateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":42,"character":5},"arguments":["optionTemplateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":42,"character":48}}]}]}],"selectedOptionChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":45,"character":5}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":59,"character":24},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":59,"character":45},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":59,"character":76}]}],"optionsUpdateHook":[{"__symbolic":"method"}],"queryUpdateHook":[{"__symbolic":"method"}],"selectOption":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"initialiseRenderedOption":[{"__symbolic":"method"}],"drawSelectedOption":[{"__symbolic":"method"}]}},"SuiSelectValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":157,"character":50},"arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":149,"character":1},"arguments":[{"selector":"sui-select","host":{"(selectedOptionChange)":"onChange($event)","(touched)":"onTouched()","$quoted$":["(selectedOptionChange)","(touched)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":155,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiSelectValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiSelect","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":158,"character":31,"context":{"typeName":"T"}},{"__symbolic":"error","message":"Could not resolve type","line":158,"character":34,"context":{"typeName":"U"}}]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/directives/select-search.d.ts b/dist/modules/select/directives/select-search.d.ts new file mode 100644 index 000000000..4b14d86a8 --- /dev/null +++ b/dist/modules/select/directives/select-search.d.ts @@ -0,0 +1,14 @@ +import { EventEmitter, Renderer2, ElementRef } from "@angular/core"; +export declare class SuiSelectSearch { + private _renderer; + private _element; + private _searchClass; + private _autoComplete; + query: string; + onQueryUpdated: EventEmitter; + onQueryKeyDown: EventEmitter; + constructor(_renderer: Renderer2, _element: ElementRef); + private updateQuery(query); + private onKeyDown(e); + focus(): void; +} diff --git a/dist/modules/select/directives/select-search.js b/dist/modules/select/directives/select-search.js new file mode 100644 index 000000000..213aad2dd --- /dev/null +++ b/dist/modules/select/directives/select-search.js @@ -0,0 +1,49 @@ +import { Directive, EventEmitter, Renderer2, ElementRef, HostListener, HostBinding } from "@angular/core"; +var SuiSelectSearch = /** @class */ (function () { + function SuiSelectSearch(_renderer, _element) { + this._renderer = _renderer; + this._element = _element; + this.onQueryUpdated = new EventEmitter(); + this.onQueryKeyDown = new EventEmitter(); + this._searchClass = true; + this._autoComplete = "off"; + } + Object.defineProperty(SuiSelectSearch.prototype, "query", { + set: function (query) { + this._renderer.setProperty(this._element.nativeElement, "value", query); + }, + enumerable: true, + configurable: true + }); + SuiSelectSearch.prototype.updateQuery = function (query) { + this.onQueryUpdated.emit(query); + }; + SuiSelectSearch.prototype.onKeyDown = function (e) { + this.onQueryKeyDown.emit(e); + }; + SuiSelectSearch.prototype.focus = function () { + var _this = this; + // Slightly delay to support in menu search. + this._element.nativeElement.focus(); + setTimeout(function () { return _this._element.nativeElement.focus(); }); + }; + SuiSelectSearch.decorators = [ + { type: Directive, args: [{ + selector: "input[suiSelectSearch]" + },] }, + ]; + /** @nocollapse */ + SuiSelectSearch.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + ]; }; + SuiSelectSearch.propDecorators = { + "_searchClass": [{ type: HostBinding, args: ["class.search",] },], + "_autoComplete": [{ type: HostBinding, args: ["attr.autocomplete",] },], + "updateQuery": [{ type: HostListener, args: ["input", ["$event.target.value"],] },], + "onKeyDown": [{ type: HostListener, args: ["keydown", ["$event"],] },], + }; + return SuiSelectSearch; +}()); +export { SuiSelectSearch }; +//# sourceMappingURL=select-search.js.map \ No newline at end of file diff --git a/dist/modules/select/directives/select-search.js.map b/dist/modules/select/directives/select-search.js.map new file mode 100644 index 000000000..911ad0064 --- /dev/null +++ b/dist/modules/select/directives/select-search.js.map @@ -0,0 +1 @@ +{"version":3,"file":"select-search.js","sourceRoot":"","sources":["../../../../src/modules/select/directives/select-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;IAmB7G,yBAAoB,SAAmB,EAAU,QAAmB;QAAhD,cAAS,GAAT,SAAS,CAAU;QAAU,aAAQ,GAAR,QAAQ,CAAW;QAChE,IAAI,CAAC,cAAc,GAAG,IAAI,YAAY,EAAU,CAAC;QACjD,IAAI,CAAC,cAAc,GAAG,IAAI,YAAY,EAAiB,CAAC;QAExD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;KAC9B;IAbD,sBAAW,kCAAK;aAAhB,UAAiB,KAAY;YACzB,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;SAC3E;;;OAAA;IAcO,qCAAW,aAAC,KAAY;QAC5B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;;IAI5B,mCAAS,aAAC,CAAe;QAC7B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;IAGzB,+BAAK,GAAZ;QAAA,iBAIC;;QAFG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QACpC,UAAU,CAAC,cAAM,OAAA,KAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,EAAnC,CAAmC,CAAC,CAAC;KACzD;;gBAvCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,wBAAwB;iBACrC;;;;gBAJwC,SAAS;gBAAE,UAAU;;;iCAMzD,WAAW,SAAC,cAAc;kCAG1B,WAAW,SAAC,mBAAmB;gCAkB/B,YAAY,SAAC,OAAO,EAAE,CAAC,qBAAqB,CAAC;8BAK7C,YAAY,SAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;;0BAhCvC;;SAKa,eAAe","sourcesContent":["import { Directive, Input, EventEmitter, Renderer2, ElementRef, HostListener, HostBinding } from \"@angular/core\";\n\n@Directive({\n selector: \"input[suiSelectSearch]\"\n})\nexport class SuiSelectSearch {\n @HostBinding(\"class.search\")\n private _searchClass:boolean;\n\n @HostBinding(\"attr.autocomplete\")\n private _autoComplete:string;\n\n public set query(query:string) {\n this._renderer.setProperty(this._element.nativeElement, \"value\", query);\n }\n\n public onQueryUpdated:EventEmitter;\n public onQueryKeyDown:EventEmitter;\n\n constructor(private _renderer:Renderer2, private _element:ElementRef) {\n this.onQueryUpdated = new EventEmitter();\n this.onQueryKeyDown = new EventEmitter();\n\n this._searchClass = true;\n this._autoComplete = \"off\";\n }\n\n @HostListener(\"input\", [\"$event.target.value\"])\n private updateQuery(query:string):void {\n this.onQueryUpdated.emit(query);\n }\n\n @HostListener(\"keydown\", [\"$event\"])\n private onKeyDown(e:KeyboardEvent):void {\n this.onQueryKeyDown.emit(e);\n }\n\n public focus():void {\n // Slightly delay to support in menu search.\n this._element.nativeElement.focus();\n setTimeout(() => this._element.nativeElement.focus());\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/directives/select-search.metadata.json b/dist/modules/select/directives/select-search.metadata.json new file mode 100644 index 000000000..b1cd41e69 --- /dev/null +++ b/dist/modules/select/directives/select-search.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiSelectSearch":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"input[suiSelectSearch]"}]}],"members":{"_searchClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":6,"character":5},"arguments":["class.search"]}]}],"_autoComplete":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":9,"character":5},"arguments":["attr.autocomplete"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":19,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":19,"character":62}]}],"updateQuery":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":27,"character":5},"arguments":["input",["$event.target.value"]]}]}],"onKeyDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":32,"character":5},"arguments":["keydown",["$event"]]}]}],"focus":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/index.d.ts b/dist/modules/select/index.d.ts new file mode 100644 index 000000000..e3880daec --- /dev/null +++ b/dist/modules/select/index.d.ts @@ -0,0 +1,7 @@ +export * from "./classes/select-base"; +export * from "./components/multi-select-label"; +export * from "./components/multi-select"; +export * from "./components/select-option"; +export * from "./components/select"; +export * from "./directives/select-search"; +export * from "./select.module"; diff --git a/dist/modules/select/index.js b/dist/modules/select/index.js new file mode 100644 index 000000000..ebd9f7ac4 --- /dev/null +++ b/dist/modules/select/index.js @@ -0,0 +1,8 @@ +export * from "./classes/select-base"; +export * from "./components/multi-select-label"; +export * from "./components/multi-select"; +export * from "./components/select-option"; +export * from "./components/select"; +export * from "./directives/select-search"; +export * from "./select.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/select/index.js.map b/dist/modules/select/index.js.map new file mode 100644 index 000000000..758f592fd --- /dev/null +++ b/dist/modules/select/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/select/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AAEtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AAEpC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./classes/select-base\";\n\nexport * from \"./components/multi-select-label\";\nexport * from \"./components/multi-select\";\nexport * from \"./components/select-option\";\nexport * from \"./components/select\";\n\nexport * from \"./directives/select-search\";\n\nexport * from \"./select.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/select/index.metadata.json b/dist/modules/select/index.metadata.json new file mode 100644 index 000000000..c5652f5a2 --- /dev/null +++ b/dist/modules/select/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/select-base"},{"from":"./components/multi-select-label"},{"from":"./components/multi-select"},{"from":"./components/select-option"},{"from":"./components/select"},{"from":"./directives/select-search"},{"from":"./select.module"}]}] \ No newline at end of file diff --git a/dist/modules/select/public.d.ts b/dist/modules/select/public.d.ts new file mode 100644 index 000000000..33dfd1bcf --- /dev/null +++ b/dist/modules/select/public.d.ts @@ -0,0 +1 @@ +export { SuiSelectModule, IOptionContext } from "./index"; diff --git a/dist/modules/select/public.js b/dist/modules/select/public.js new file mode 100644 index 000000000..ace7cd339 --- /dev/null +++ b/dist/modules/select/public.js @@ -0,0 +1,2 @@ +export { SuiSelectModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/select/public.js.map b/dist/modules/select/public.js.map new file mode 100644 index 000000000..75eee67fc --- /dev/null +++ b/dist/modules/select/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/select/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EAElB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiSelectModule,\n IOptionContext\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/select/public.metadata.json b/dist/modules/select/public.metadata.json new file mode 100644 index 000000000..d328957b7 --- /dev/null +++ b/dist/modules/select/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiSelectModule","IOptionContext"]}]}] \ No newline at end of file diff --git a/dist/modules/select/select.module.d.ts b/dist/modules/select/select.module.d.ts new file mode 100644 index 000000000..cab394b8e --- /dev/null +++ b/dist/modules/select/select.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiSelectModule { +} diff --git a/dist/modules/select/select.module.js b/dist/modules/select/select.module.js new file mode 100644 index 000000000..57a2ab2ed --- /dev/null +++ b/dist/modules/select/select.module.js @@ -0,0 +1,48 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; +import { SuiDropdownModule } from "../dropdown/index"; +import { SuiUtilityModule } from "../../misc/util/index"; +import { SuiLocalizationModule } from "../../behaviors/localization/index"; +import { SuiSelect, SuiSelectValueAccessor } from "./components/select"; +import { SuiSelectOption } from "./components/select-option"; +import { SuiSelectSearch } from "./directives/select-search"; +import { SuiMultiSelect, SuiMultiSelectValueAccessor } from "./components/multi-select"; +import { SuiMultiSelectLabel } from "./components/multi-select-label"; +var SuiSelectModule = /** @class */ (function () { + function SuiSelectModule() { + } + SuiSelectModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule, + FormsModule, + SuiDropdownModule, + SuiUtilityModule, + SuiLocalizationModule + ], + declarations: [ + SuiSelect, + SuiSelectOption, + SuiSelectSearch, + SuiSelectValueAccessor, + SuiMultiSelect, + SuiMultiSelectLabel, + SuiMultiSelectValueAccessor + ], + exports: [ + SuiSelect, + SuiSelectOption, + SuiSelectSearch, + SuiSelectValueAccessor, + SuiMultiSelect, + SuiMultiSelectValueAccessor + ] + },] }, + ]; + /** @nocollapse */ + SuiSelectModule.ctorParameters = function () { return []; }; + return SuiSelectModule; +}()); +export { SuiSelectModule }; +//# sourceMappingURL=select.module.js.map \ No newline at end of file diff --git a/dist/modules/select/select.module.js.map b/dist/modules/select/select.module.js.map new file mode 100644 index 000000000..e273ab442 --- /dev/null +++ b/dist/modules/select/select.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"select.module.js","sourceRoot":"","sources":["../../../src/modules/select/select.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;;;;;gBAErE,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,iBAAiB;wBACjB,gBAAgB;wBAChB,qBAAqB;qBACxB;oBACD,YAAY,EAAE;wBACV,SAAS;wBACT,eAAe;wBACf,eAAe;wBACf,sBAAsB;wBACtB,cAAc;wBACd,mBAAmB;wBACnB,2BAA2B;qBAC9B;oBACD,OAAO,EAAE;wBACL,SAAS;wBACT,eAAe;wBACf,eAAe;wBACf,sBAAsB;wBACtB,cAAc;wBACd,2BAA2B;qBAC9B;iBACJ;;;;0BArCD;;SAsCa,eAAe","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { SuiDropdownModule } from \"../dropdown/index\";\nimport { SuiUtilityModule } from \"../../misc/util/index\";\nimport { SuiLocalizationModule } from \"../../behaviors/localization/index\";\nimport { SuiSelect, SuiSelectValueAccessor } from \"./components/select\";\nimport { SuiSelectOption } from \"./components/select-option\";\nimport { SuiSelectSearch } from \"./directives/select-search\";\nimport { SuiMultiSelect, SuiMultiSelectValueAccessor } from \"./components/multi-select\";\nimport { SuiMultiSelectLabel } from \"./components/multi-select-label\";\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SuiDropdownModule,\n SuiUtilityModule,\n SuiLocalizationModule\n ],\n declarations: [\n SuiSelect,\n SuiSelectOption,\n SuiSelectSearch,\n SuiSelectValueAccessor,\n SuiMultiSelect,\n SuiMultiSelectLabel,\n SuiMultiSelectValueAccessor\n ],\n exports: [\n SuiSelect,\n SuiSelectOption,\n SuiSelectSearch,\n SuiSelectValueAccessor,\n SuiMultiSelect,\n SuiMultiSelectValueAccessor\n ]\n})\nexport class SuiSelectModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/select/select.module.metadata.json b/dist/modules/select/select.module.metadata.json new file mode 100644 index 000000000..dce964d96 --- /dev/null +++ b/dist/modules/select/select.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiSelectModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":12,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":14,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":15,"character":8},{"__symbolic":"reference","module":"../dropdown/index","name":"SuiDropdownModule","line":16,"character":8},{"__symbolic":"reference","module":"../../misc/util/index","name":"SuiUtilityModule","line":17,"character":8},{"__symbolic":"reference","module":"../../behaviors/localization/index","name":"SuiLocalizationModule","line":18,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/select","name":"SuiSelect","line":21,"character":8},{"__symbolic":"reference","module":"./components/select-option","name":"SuiSelectOption","line":22,"character":8},{"__symbolic":"reference","module":"./directives/select-search","name":"SuiSelectSearch","line":23,"character":8},{"__symbolic":"reference","module":"./components/select","name":"SuiSelectValueAccessor","line":24,"character":8},{"__symbolic":"reference","module":"./components/multi-select","name":"SuiMultiSelect","line":25,"character":8},{"__symbolic":"reference","module":"./components/multi-select-label","name":"SuiMultiSelectLabel","line":26,"character":8},{"__symbolic":"reference","module":"./components/multi-select","name":"SuiMultiSelectValueAccessor","line":27,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/select","name":"SuiSelect","line":30,"character":8},{"__symbolic":"reference","module":"./components/select-option","name":"SuiSelectOption","line":31,"character":8},{"__symbolic":"reference","module":"./directives/select-search","name":"SuiSelectSearch","line":32,"character":8},{"__symbolic":"reference","module":"./components/select","name":"SuiSelectValueAccessor","line":33,"character":8},{"__symbolic":"reference","module":"./components/multi-select","name":"SuiMultiSelect","line":34,"character":8},{"__symbolic":"reference","module":"./components/multi-select","name":"SuiMultiSelectValueAccessor","line":35,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-container.d.ts b/dist/modules/sidebar/components/sidebar-container.d.ts new file mode 100644 index 000000000..9528a22eb --- /dev/null +++ b/dist/modules/sidebar/components/sidebar-container.d.ts @@ -0,0 +1,12 @@ +import { AfterContentInit } from "@angular/core"; +import { SidebarService } from "../services/sidebar.service"; +import { SuiSidebar } from "./sidebar"; +import { SuiSidebarSibling } from "./sidebar-sibling"; +export declare class SuiSidebarContainer implements AfterContentInit { + service: SidebarService; + private _containerClasses; + sidebar: SuiSidebar; + sibling: SuiSidebarSibling; + constructor(); + ngAfterContentInit(): void; +} diff --git a/dist/modules/sidebar/components/sidebar-container.js b/dist/modules/sidebar/components/sidebar-container.js new file mode 100644 index 000000000..6128d4881 --- /dev/null +++ b/dist/modules/sidebar/components/sidebar-container.js @@ -0,0 +1,35 @@ +import { Component, HostBinding, ContentChild } from "@angular/core"; +import { SuiSidebar } from "./sidebar"; +import { SuiSidebarSibling } from "./sidebar-sibling"; +var SuiSidebarContainer = /** @class */ (function () { + function SuiSidebarContainer() { + this._containerClasses = true; + } + SuiSidebarContainer.prototype.ngAfterContentInit = function () { + if (!this.sidebar) { + throw new Error("You must include a element within the container."); + } + this.service = this.sidebar.service; + if (!this.sibling) { + throw new Error("You must include a element within the container."); + } + this.sibling.service = this.service; + }; + SuiSidebarContainer.decorators = [ + { type: Component, args: [{ + selector: "sui-sidebar-container", + template: "", + styles: ["\n:host {\n display: block;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiSidebarContainer.ctorParameters = function () { return []; }; + SuiSidebarContainer.propDecorators = { + "_containerClasses": [{ type: HostBinding, args: ["class.pushable",] },], + "sidebar": [{ type: ContentChild, args: [SuiSidebar,] },], + "sibling": [{ type: ContentChild, args: [SuiSidebarSibling,] },], + }; + return SuiSidebarContainer; +}()); +export { SuiSidebarContainer }; +//# sourceMappingURL=sidebar-container.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-container.js.map b/dist/modules/sidebar/components/sidebar-container.js.map new file mode 100644 index 000000000..58f616202 --- /dev/null +++ b/dist/modules/sidebar/components/sidebar-container.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sidebar-container.js","sourceRoot":"","sources":["../../../../src/modules/sidebar/components/sidebar-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;;IAuBlD;QACI,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;KACjC;IAEM,gDAAkB,GAAzB;QACI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;SACrF;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QAEpC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;SAC7F;QACD,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;KACvC;;gBAnCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE,2BAA2B;oBACrC,MAAM,EAAE,CAAC,qCAIZ,CAAC;iBACD;;;;;sCAII,WAAW,SAAC,gBAAgB;4BAG5B,YAAY,SAAC,UAAU;4BAGvB,YAAY,SAAC,iBAAiB;;8BAvBnC;;SAca,mBAAmB","sourcesContent":["import { Component, AfterContentInit, HostBinding, ContentChild } from \"@angular/core\";\nimport { SidebarService } from \"../services/sidebar.service\";\nimport { SuiSidebar } from \"./sidebar\";\nimport { SuiSidebarSibling } from \"./sidebar-sibling\";\n\n@Component({\n selector: \"sui-sidebar-container\",\n template: ``,\n styles: [`\n:host {\n display: block;\n}\n`]\n})\nexport class SuiSidebarContainer implements AfterContentInit {\n public service:SidebarService;\n\n @HostBinding(\"class.pushable\")\n private _containerClasses:boolean;\n\n @ContentChild(SuiSidebar)\n public sidebar:SuiSidebar;\n\n @ContentChild(SuiSidebarSibling)\n public sibling:SuiSidebarSibling;\n\n constructor() {\n this._containerClasses = true;\n }\n\n public ngAfterContentInit():void {\n if (!this.sidebar) {\n throw new Error(\"You must include a element within the container.\");\n }\n this.service = this.sidebar.service;\n\n if (!this.sibling) {\n throw new Error(\"You must include a element within the container.\");\n }\n this.sibling.service = this.service;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-container.metadata.json b/dist/modules/sidebar/components/sidebar-container.metadata.json new file mode 100644 index 000000000..8efa95d69 --- /dev/null +++ b/dist/modules/sidebar/components/sidebar-container.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiSidebarContainer":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"sui-sidebar-container","template":"","styles":["\n:host {\n display: block;\n}\n"]}]}],"members":{"_containerClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":17,"character":5},"arguments":["class.pushable"]}]}],"sidebar":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":20,"character":5},"arguments":[{"__symbolic":"reference","module":"./sidebar","name":"SuiSidebar","line":20,"character":18}]}]}],"sibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":23,"character":5},"arguments":[{"__symbolic":"reference","module":"./sidebar-sibling","name":"SuiSidebarSibling","line":23,"character":18}]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngAfterContentInit":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-sibling.d.ts b/dist/modules/sidebar/components/sidebar-sibling.d.ts new file mode 100644 index 000000000..fc4e5fb72 --- /dev/null +++ b/dist/modules/sidebar/components/sidebar-sibling.d.ts @@ -0,0 +1,15 @@ +import { ElementRef, Renderer2 } from "@angular/core"; +import { SidebarService } from "../services/sidebar.service"; +export declare class SuiSidebarSibling { + private _renderer; + private _element; + private _service; + service: SidebarService; + isDimmedWhenVisible: boolean; + readonly isVisible: boolean; + readonly isDimmed: boolean; + private _siblingClasses; + constructor(_renderer: Renderer2, _element: ElementRef); + private updateTransform(); + onClick(event: MouseEvent): void; +} diff --git a/dist/modules/sidebar/components/sidebar-sibling.js b/dist/modules/sidebar/components/sidebar-sibling.js new file mode 100644 index 000000000..953a27664 --- /dev/null +++ b/dist/modules/sidebar/components/sidebar-sibling.js @@ -0,0 +1,81 @@ +import { Component, Input, HostBinding, HostListener, ElementRef, Renderer2 } from "@angular/core"; +import { SidebarTransition } from "../services/sidebar.service"; +var SuiSidebarSibling = /** @class */ (function () { + function SuiSidebarSibling(_renderer, _element) { + this._renderer = _renderer; + this._element = _element; + this.isDimmedWhenVisible = false; + this._siblingClasses = true; + } + Object.defineProperty(SuiSidebarSibling.prototype, "service", { + get: function () { + return this._service; + }, + set: function (service) { + var _this = this; + this._service = service; + setTimeout(function () { return _this.updateTransform(); }); + this._service.isVisibleChange.subscribe(function () { return _this.updateTransform(); }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebarSibling.prototype, "isVisible", { + get: function () { + if (!this.service) { + return false; + } + return this.service.isVisible; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebarSibling.prototype, "isDimmed", { + get: function () { + if (!this.service) { + return false; + } + return this.service.isVisible && this.isDimmedWhenVisible; + }, + enumerable: true, + configurable: true + }); + SuiSidebarSibling.prototype.updateTransform = function () { + this._renderer.removeStyle(this._element.nativeElement, "transform"); + this._renderer.removeStyle(this._element.nativeElement, "-webkit-transform"); + if (this.service.isVisible && + this.service.transition !== SidebarTransition.Overlay && + this.service.transition !== SidebarTransition.ScaleDown) { + var translate = "translate3d(" + this.service.width + "px, " + this.service.height + "px, 0)"; + this._renderer.setStyle(this._element.nativeElement, "transform", translate); + this._renderer.setStyle(this._element.nativeElement, "-webkit-transform", translate); + } + }; + SuiSidebarSibling.prototype.onClick = function (event) { + if (this.service.isVisible && !this.service.wasJustOpened) { + this.service.setVisibleState(false); + } + }; + SuiSidebarSibling.decorators = [ + { type: Component, args: [{ + selector: "sui-sidebar-sibling", + template: "", + styles: ["\n:host {\n display: block;\n}\n"] + },] }, + ]; + /** @nocollapse */ + SuiSidebarSibling.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + ]; }; + SuiSidebarSibling.propDecorators = { + "isDimmedWhenVisible": [{ type: Input },], + "isVisible": [{ type: HostBinding, args: ["class.visible",] },], + "isDimmed": [{ type: HostBinding, args: ["class.dimmed",] },], + "_siblingClasses": [{ type: HostBinding, args: ["class.pusher",] },], + "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], + }; + return SuiSidebarSibling; +}()); +export { SuiSidebarSibling }; +//# sourceMappingURL=sidebar-sibling.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-sibling.js.map b/dist/modules/sidebar/components/sidebar-sibling.js.map new file mode 100644 index 000000000..312df5c62 --- /dev/null +++ b/dist/modules/sidebar/components/sidebar-sibling.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sidebar-sibling.js","sourceRoot":"","sources":["../../../../src/modules/sidebar/components/sidebar-sibling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAkB,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;;IA+C5E,2BAAoB,SAAmB,EAAU,QAAmB;QAAhD,cAAS,GAAT,SAAS,CAAU;QAAU,aAAQ,GAAR,QAAQ,CAAW;QAChE,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;QAEjC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;KAC/B;IArCD,sBAAW,sCAAO;aAAlB;YACI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;SACxB;aAED,UAAmB,OAAsB;Y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C,QAAQ,CAAC,aAAa,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;YAC7E,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,mBAAmB,EAAE,SAAS,CAAC,CAAC;SACxF;KACJ;IAGM,mCAAO,aAAC,KAAgB;QAC3B,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;YACxD,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;SACvC;;;gBArER,SAAS,SAAC;oBACP,QAAQ,EAAE,qBAAqB;oBAC/B,QAAQ,EAAE,2BAA2B;oBACrC,MAAM,EAAE,CAAC,qCAIZ,CAAC;iBACD;;;;gBAXiE,SAAS;gBAArB,UAAU;;;wCA0B3D,KAAK;8BAGL,WAAW,SAAC,eAAe;6BAQ3B,WAAW,SAAC,cAAc;oCAQ1B,WAAW,SAAC,cAAc;4BAuB1B,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;4BApErC;;SAYa,iBAAiB","sourcesContent":["import { Component, Input, HostBinding, HostListener, ElementRef, Renderer2 } from \"@angular/core\";\nimport { SidebarService, SidebarTransition } from \"../services/sidebar.service\";\n\n@Component({\n selector: \"sui-sidebar-sibling\",\n template: ``,\n styles: [`\n:host {\n display: block;\n}\n`]\n})\nexport class SuiSidebarSibling {\n private _service:SidebarService;\n\n public get service():SidebarService {\n return this._service;\n }\n\n public set service(service:SidebarService) {\n this._service = service;\n\n setTimeout(() => this.updateTransform());\n this._service.isVisibleChange.subscribe(() => this.updateTransform());\n }\n\n @Input()\n public isDimmedWhenVisible:boolean;\n\n @HostBinding(\"class.visible\")\n public get isVisible():boolean {\n if (!this.service) {\n return false;\n }\n return this.service.isVisible;\n }\n\n @HostBinding(\"class.dimmed\")\n public get isDimmed():boolean {\n if (!this.service) {\n return false;\n }\n return this.service.isVisible && this.isDimmedWhenVisible;\n }\n\n @HostBinding(\"class.pusher\")\n private _siblingClasses:boolean;\n\n constructor(private _renderer:Renderer2, private _element:ElementRef) {\n this.isDimmedWhenVisible = false;\n\n this._siblingClasses = true;\n }\n\n private updateTransform():void {\n this._renderer.removeStyle(this._element.nativeElement, \"transform\");\n this._renderer.removeStyle(this._element.nativeElement, \"-webkit-transform\");\n\n if (this.service.isVisible &&\n this.service.transition !== SidebarTransition.Overlay &&\n this.service.transition !== SidebarTransition.ScaleDown) {\n\n const translate = `translate3d(${this.service.width}px, ${this.service.height}px, 0)`;\n this._renderer.setStyle(this._element.nativeElement, \"transform\", translate);\n this._renderer.setStyle(this._element.nativeElement, \"-webkit-transform\", translate);\n }\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(event:MouseEvent):void {\n if (this.service.isVisible && !this.service.wasJustOpened) {\n this.service.setVisibleState(false);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-sibling.metadata.json b/dist/modules/sidebar/components/sidebar-sibling.metadata.json new file mode 100644 index 000000000..0fd54ee6e --- /dev/null +++ b/dist/modules/sidebar/components/sidebar-sibling.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiSidebarSibling":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"sui-sidebar-sibling","template":"","styles":["\n:host {\n display: block;\n}\n"]}]}],"members":{"isDimmedWhenVisible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":5}}]}],"isVisible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":29,"character":5},"arguments":["class.visible"]}]}],"isDimmed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":37,"character":5},"arguments":["class.dimmed"]}]}],"_siblingClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":45,"character":5},"arguments":["class.pusher"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":48,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":48,"character":62}]}],"updateTransform":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":68,"character":5},"arguments":["click",["$event"]]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar.d.ts b/dist/modules/sidebar/components/sidebar.d.ts new file mode 100644 index 000000000..c24246c2d --- /dev/null +++ b/dist/modules/sidebar/components/sidebar.d.ts @@ -0,0 +1,19 @@ +import { Renderer2, ElementRef, EventEmitter } from "@angular/core"; +import { SidebarService, SidebarTransition, SidebarDirection } from "../services/sidebar.service"; +export declare class SuiSidebar { + private _renderer; + private _element; + service: SidebarService; + private _sidebarClasses; + transition: SidebarTransition; + direction: SidebarDirection; + isVisible: boolean; + readonly isVisibleChange: EventEmitter; + readonly isAnimating: boolean; + constructor(_renderer: Renderer2, _element: ElementRef); + private updateDimensions(); + private setClass(className, isAdd?); + open(): void; + close(): void; + toggle(): void; +} diff --git a/dist/modules/sidebar/components/sidebar.js b/dist/modules/sidebar/components/sidebar.js new file mode 100644 index 000000000..be00fd0de --- /dev/null +++ b/dist/modules/sidebar/components/sidebar.js @@ -0,0 +1,109 @@ +import { Component, HostBinding, Input, Output, Renderer2, ElementRef, EventEmitter } from "@angular/core"; +import { SidebarService, SidebarTransition, SidebarDirection } from "../services/sidebar.service"; +var SuiSidebar = /** @class */ (function () { + function SuiSidebar(_renderer, _element) { + var _this = this; + this._renderer = _renderer; + this._element = _element; + this.service = new SidebarService(); + // We set the default here as well to force the classes to update. + this.transition = SidebarTransition.Uncover; + this.direction = SidebarDirection.Left; + setTimeout(function () { return _this.updateDimensions(); }); + this.service.isVisibleChange.subscribe(function () { return _this.updateDimensions(); }); + this._sidebarClasses = true; + } + Object.defineProperty(SuiSidebar.prototype, "transition", { + get: function () { + return this.service.transition; + }, + set: function (transition) { + var _this = this; + this.service.transition.split(" ").forEach(function (c) { return _this.setClass(c, false); }); + this.service.transition = transition; + this.service.transition.split(" ").forEach(function (c) { return _this.setClass(c, true); }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebar.prototype, "direction", { + get: function () { + return this.service.direction; + }, + set: function (direction) { + this.setClass(this.service.direction, false); + this.service.direction = direction; + this.setClass(this.service.direction, true); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebar.prototype, "isVisible", { + get: function () { + return this.service.isVisible; + }, + set: function (isVisible) { + this.service.setVisibleState(isVisible); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebar.prototype, "isVisibleChange", { + get: function () { + return this.service.isVisibleChange; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiSidebar.prototype, "isAnimating", { + get: function () { + return this.service.isAnimating; + }, + enumerable: true, + configurable: true + }); + SuiSidebar.prototype.updateDimensions = function () { + this.service.width = this._element.nativeElement.offsetWidth; + this.service.height = this._element.nativeElement.offsetHeight; + }; + SuiSidebar.prototype.setClass = function (className, isAdd) { + if (isAdd === void 0) { isAdd = true; } + if (isAdd) { + this._renderer.addClass(this._element.nativeElement, className); + } + else { + this._renderer.removeClass(this._element.nativeElement, className); + } + }; + SuiSidebar.prototype.open = function () { + this.service.setVisibleState(true); + }; + SuiSidebar.prototype.close = function () { + this.service.setVisibleState(false); + }; + SuiSidebar.prototype.toggle = function () { + this.service.toggleVisibleState(); + }; + SuiSidebar.decorators = [ + { type: Component, args: [{ + selector: "sui-sidebar", + template: "" + },] }, + ]; + /** @nocollapse */ + SuiSidebar.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + ]; }; + SuiSidebar.propDecorators = { + "_sidebarClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.sidebar",] }, { type: HostBinding, args: ["class.menu",] },], + "transition": [{ type: Input },], + "direction": [{ type: Input },], + "isVisible": [{ type: HostBinding, args: ["class.visible",] }, { type: Input },], + "isVisibleChange": [{ type: Output },], + "isAnimating": [{ type: HostBinding, args: ["class.animating",] },], + }; + return SuiSidebar; +}()); +export { SuiSidebar }; +//# sourceMappingURL=sidebar.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar.js.map b/dist/modules/sidebar/components/sidebar.js.map new file mode 100644 index 000000000..06b639be3 --- /dev/null +++ b/dist/modules/sidebar/components/sidebar.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../../../../src/modules/sidebar/components/sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;;IA4D9F,oBAAoB,SAAmB,EAAU,QAAmB;QAApE,iBAUC;QAVmB,cAAS,GAAT,SAAS,CAAU;QAAU,aAAQ,GAAR,QAAQ,CAAW;QAChE,IAAI,CAAC,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;;QAEpC,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC;QAC5C,IAAI,CAAC,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC;QAEvC,UAAU,CAAC,cAAM,OAAA,KAAI,CAAC,gBAAgB,EAAE,EAAvB,CAAuB,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,gBAAgB,E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\"@angular/core\";\nimport { SidebarService, SidebarTransition, SidebarDirection } from \"../services/sidebar.service\";\n\n@Component({\n selector: \"sui-sidebar\",\n template: ``\n})\nexport class SuiSidebar {\n public service:SidebarService;\n\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.sidebar\")\n @HostBinding(\"class.menu\")\n private _sidebarClasses:boolean;\n\n @Input()\n public get transition():SidebarTransition {\n return this.service.transition;\n }\n\n public set transition(transition:SidebarTransition) {\n this.service.transition.split(\" \").forEach(c => this.setClass(c, false));\n\n this.service.transition = transition;\n\n this.service.transition.split(\" \").forEach(c => this.setClass(c, true));\n }\n\n @Input()\n public get direction():SidebarDirection {\n return this.service.direction;\n }\n\n public set direction(direction:SidebarDirection) {\n this.setClass(this.service.direction, false);\n\n this.service.direction = direction;\n\n this.setClass(this.service.direction, true);\n }\n\n @HostBinding(\"class.visible\")\n @Input()\n public get isVisible():boolean {\n return this.service.isVisible;\n }\n\n public set isVisible(isVisible:boolean) {\n this.service.setVisibleState(isVisible);\n }\n\n @Output()\n public get isVisibleChange():EventEmitter {\n return this.service.isVisibleChange;\n }\n\n @HostBinding(\"class.animating\")\n public get isAnimating():boolean {\n return this.service.isAnimating;\n }\n\n constructor(private _renderer:Renderer2, private _element:ElementRef) {\n this.service = new SidebarService();\n // We set the default here as well to force the classes to update.\n this.transition = SidebarTransition.Uncover;\n this.direction = SidebarDirection.Left;\n\n setTimeout(() => this.updateDimensions());\n this.service.isVisibleChange.subscribe(() => this.updateDimensions());\n\n this._sidebarClasses = true;\n }\n\n private updateDimensions():void {\n this.service.width = this._element.nativeElement.offsetWidth;\n this.service.height = this._element.nativeElement.offsetHeight;\n }\n\n private setClass(className:string, isAdd:boolean = true):void {\n if (isAdd) {\n this._renderer.addClass(this._element.nativeElement, className);\n } else {\n this._renderer.removeClass(this._element.nativeElement, className);\n }\n }\n\n public open():void {\n this.service.setVisibleState(true);\n }\n\n public close():void {\n this.service.setVisibleState(false);\n }\n\n public toggle():void {\n this.service.toggleVisibleState();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar.metadata.json b/dist/modules/sidebar/components/sidebar.metadata.json new file mode 100644 index 000000000..5181c288a --- /dev/null +++ b/dist/modules/sidebar/components/sidebar.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiSidebar":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"sui-sidebar","template":""}]}],"members":{"_sidebarClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":10,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":11,"character":5},"arguments":["class.sidebar"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":12,"character":5},"arguments":["class.menu"]}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":5}}]}],"direction":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":28,"character":5}}]}],"isVisible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":41,"character":5},"arguments":["class.visible"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":5}}]}],"isVisibleChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":51,"character":5}}]}],"isAnimating":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":56,"character":5},"arguments":["class.animating"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":61,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":61,"character":62}]}],"updateDimensions":[{"__symbolic":"method"}],"setClass":[{"__symbolic":"method"}],"open":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/sidebar/index.d.ts b/dist/modules/sidebar/index.d.ts new file mode 100644 index 000000000..c3e2caf54 --- /dev/null +++ b/dist/modules/sidebar/index.d.ts @@ -0,0 +1,5 @@ +export * from "./components/sidebar-container"; +export * from "./components/sidebar-sibling"; +export * from "./components/sidebar"; +export * from "./services/sidebar.service"; +export * from "./sidebar.module"; diff --git a/dist/modules/sidebar/index.js b/dist/modules/sidebar/index.js new file mode 100644 index 000000000..7fbeb6ffe --- /dev/null +++ b/dist/modules/sidebar/index.js @@ -0,0 +1,6 @@ +export * from "./components/sidebar-container"; +export * from "./components/sidebar-sibling"; +export * from "./components/sidebar"; +export * from "./services/sidebar.service"; +export * from "./sidebar.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/index.js.map b/dist/modules/sidebar/index.js.map new file mode 100644 index 000000000..e1db05de4 --- /dev/null +++ b/dist/modules/sidebar/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/sidebar/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AAErC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,kBAAkB,CAAC","sourcesContent":["export * from \"./components/sidebar-container\";\nexport * from \"./components/sidebar-sibling\";\nexport * from \"./components/sidebar\";\n\nexport * from \"./services/sidebar.service\";\n\nexport * from \"./sidebar.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/index.metadata.json b/dist/modules/sidebar/index.metadata.json new file mode 100644 index 000000000..4353a3862 --- /dev/null +++ b/dist/modules/sidebar/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/sidebar-container"},{"from":"./components/sidebar-sibling"},{"from":"./components/sidebar"},{"from":"./services/sidebar.service"},{"from":"./sidebar.module"}]}] \ No newline at end of file diff --git a/dist/modules/sidebar/public.d.ts b/dist/modules/sidebar/public.d.ts new file mode 100644 index 000000000..2c63a8929 --- /dev/null +++ b/dist/modules/sidebar/public.d.ts @@ -0,0 +1 @@ +export { SuiSidebarModule, SidebarDirection, SidebarTransition } from "./index"; diff --git a/dist/modules/sidebar/public.js b/dist/modules/sidebar/public.js new file mode 100644 index 000000000..06726fe2e --- /dev/null +++ b/dist/modules/sidebar/public.js @@ -0,0 +1,2 @@ +export { SuiSidebarModule, SidebarDirection, SidebarTransition } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/public.js.map b/dist/modules/sidebar/public.js.map new file mode 100644 index 000000000..0c90c37b5 --- /dev/null +++ b/dist/modules/sidebar/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/sidebar/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACpB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiSidebarModule,\n SidebarDirection,\n SidebarTransition\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/public.metadata.json b/dist/modules/sidebar/public.metadata.json new file mode 100644 index 000000000..378d6a6c0 --- /dev/null +++ b/dist/modules/sidebar/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiSidebarModule","SidebarDirection","SidebarTransition"]}]}] \ No newline at end of file diff --git a/dist/modules/sidebar/services/sidebar.service.d.ts b/dist/modules/sidebar/services/sidebar.service.d.ts new file mode 100644 index 000000000..924f12c1a --- /dev/null +++ b/dist/modules/sidebar/services/sidebar.service.d.ts @@ -0,0 +1,35 @@ +import { EventEmitter } from "@angular/core"; +export declare type SidebarTransition = "overlay" | "push" | "scale down" | "uncover" | "slide along" | "slide out"; +export declare const SidebarTransition: { + Overlay: SidebarTransition; + Push: SidebarTransition; + ScaleDown: SidebarTransition; + Uncover: SidebarTransition; + SlideAlong: SidebarTransition; + SlideOut: SidebarTransition; +}; +export declare type SidebarDirection = "left" | "right" | "top" | "bottom"; +export declare const SidebarDirection: { + Left: "left" | "right" | "top" | "bottom"; + Right: "left" | "right" | "top" | "bottom"; + Top: "left" | "right" | "top" | "bottom"; + Bottom: "left" | "right" | "top" | "bottom"; +}; +export declare class SidebarService { + isVisible: boolean; + isAnimating: boolean; + wasJustOpened: boolean; + direction: SidebarDirection; + private _width; + private _height; + width: number; + height: number; + isVisibleChange: EventEmitter; + widthChange: EventEmitter; + heightChange: EventEmitter; + private _isAnimatingTimeout; + transition: SidebarTransition; + constructor(isVisible?: boolean); + setVisibleState(isVisible: boolean): void; + toggleVisibleState(): void; +} diff --git a/dist/modules/sidebar/services/sidebar.service.js b/dist/modules/sidebar/services/sidebar.service.js new file mode 100644 index 000000000..879f749e7 --- /dev/null +++ b/dist/modules/sidebar/services/sidebar.service.js @@ -0,0 +1,81 @@ +import { EventEmitter } from "@angular/core"; +export var SidebarTransition = { + Overlay: "overlay", + Push: "push", + ScaleDown: "scale down", + Uncover: "uncover", + SlideAlong: "slide along", + SlideOut: "slide out" +}; +export var SidebarDirection = { + Left: "left", + Right: "right", + Top: "top", + Bottom: "bottom" +}; +var SidebarService = /** @class */ (function () { + function SidebarService(isVisible) { + if (isVisible === void 0) { isVisible = false; } + this.isVisible = isVisible; + this.isAnimating = false; + this.wasJustOpened = false; + this.isVisibleChange = new EventEmitter(); + this.widthChange = new EventEmitter(); + this.heightChange = new EventEmitter(); + this.width = 260; + this.height = 0; + this.transition = SidebarTransition.Uncover; + } + Object.defineProperty(SidebarService.prototype, "width", { + get: function () { + if (this.direction === SidebarDirection.Left) { + return this._width; + } + if (this.direction === SidebarDirection.Right) { + return -this._width; + } + return 0; + }, + set: function (width) { + this._width = width; + this.widthChange.emit(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SidebarService.prototype, "height", { + get: function () { + if (this.direction === SidebarDirection.Top) { + return this._height; + } + if (this.direction === SidebarDirection.Bottom) { + return -this._height; + } + return 0; + }, + set: function (height) { + this._height = height; + this.heightChange.emit(); + }, + enumerable: true, + configurable: true + }); + SidebarService.prototype.setVisibleState = function (isVisible) { + var _this = this; + if (this.isVisible !== isVisible) { + this.isVisible = isVisible; + this.isAnimating = true; + this.wasJustOpened = true; + this.isVisibleChange.emit(isVisible); + setTimeout(function () { return _this.wasJustOpened = false; }); + clearTimeout(this._isAnimatingTimeout); + this._isAnimatingTimeout = window.setTimeout(function () { return _this.isAnimating = false; }, 500); + } + }; + SidebarService.prototype.toggleVisibleState = function () { + this.setVisibleState(!this.isVisible); + }; + return SidebarService; +}()); +export { SidebarService }; +//# sourceMappingURL=sidebar.service.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/services/sidebar.service.js.map b/dist/modules/sidebar/services/sidebar.service.js.map new file mode 100644 index 000000000..292c3b2dc --- /dev/null +++ b/dist/modules/sidebar/services/sidebar.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sidebar.service.js","sourceRoot":"","sources":["../../../../src/modules/sidebar/services/sidebar.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAI7C,MAAM,CAAC,IAAM,iBAAiB,GAAG;IAC7B,OAAO,EAAE,SAA8B;IACvC,IAAI,EAAE,MAA2B;IACjC,SAAS,EAAE,YAAiC;IAC5C,OAAO,EAAE,SAA8B;IACvC,UAAU,EAAE,aAAkC;IAC9C,QAAQ,EAAE,WAAgC;CAC7C,CAAC;AAIF,MAAM,CAAC,IAAM,gBAAgB,GAAG;IAC5B,IAAI,EAAE,MAA0B;IAChC,KAAK,EAAE,OAA2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AAC,SAAS,KAAK,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC7C,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;aACxB;YACD,MAAM,CAAC,CAAC,CAAC;SACZ;aAED,UAAkB,MAAa;YAC3B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;YACtB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;SAC5B;;;OALA;IA8BM,wCAAe,GAAtB,UAAuB,SAAiB;QAAxC,iBAYC;QAXG,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC;YAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;YAE1B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAErC,UAAU,CAAC,cAAM,OAAA,KAAI,CAAC,aAAa,GAAG,KAAK,EAA1B,CAA0B,CAAC,CAAC;YAC7C,YAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACvC,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,UAAU,CAAC,cAAM,OAAA,KAAI,CAAC,WAAW,GAAG,KAAK,EAAxB,CAAwB,EAAE,GAAG,CAAC,CAAC;SACrF;KACJ;IAEM,2CAAkB,GAAzB;QACI,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACzC;yBArGL;IAsGC,CAAA;AAhFD,0BAgFC","sourcesContent":["import { EventEmitter } from \"@angular/core\";\n\nexport type SidebarTransition = \"overlay\" | \"push\" | \"scale down\" | \"uncover\" | \"slide along\" | \"slide out\";\n\nexport const SidebarTransition = {\n Overlay: \"overlay\" as SidebarTransition,\n Push: \"push\" as SidebarTransition,\n ScaleDown: \"scale down\" as SidebarTransition,\n Uncover: \"uncover\" as SidebarTransition,\n SlideAlong: \"slide along\" as SidebarTransition,\n SlideOut: \"slide out\" as SidebarTransition\n};\n\nexport type SidebarDirection = \"left\" | \"right\" | \"top\" | \"bottom\";\n\nexport const SidebarDirection = {\n Left: \"left\" as SidebarDirection,\n Right: \"right\" as SidebarDirection,\n Top: \"top\" as SidebarDirection,\n Bottom: \"bottom\" as SidebarDirection\n};\n\nexport class SidebarService {\n public isVisible:boolean;\n public isAnimating:boolean;\n public wasJustOpened:boolean;\n\n public direction:SidebarDirection;\n\n private _width:number;\n private _height:number;\n\n public get width():number {\n if (this.direction === SidebarDirection.Left) {\n return this._width;\n }\n if (this.direction === SidebarDirection.Right) {\n return -this._width;\n }\n return 0;\n }\n\n public set width(width:number) {\n this._width = width;\n this.widthChange.emit();\n }\n\n public get height():number {\n if (this.direction === SidebarDirection.Top) {\n return this._height;\n }\n if (this.direction === SidebarDirection.Bottom) {\n return -this._height;\n }\n return 0;\n }\n\n public set height(height:number) {\n this._height = height;\n this.heightChange.emit();\n }\n\n public isVisibleChange:EventEmitter;\n public widthChange:EventEmitter;\n public heightChange:EventEmitter;\n\n private _isAnimatingTimeout:number;\n\n public transition:SidebarTransition;\n\n constructor(isVisible:boolean = false) {\n this.isVisible = isVisible;\n this.isAnimating = false;\n this.wasJustOpened = false;\n\n this.isVisibleChange = new EventEmitter();\n this.widthChange = new EventEmitter();\n this.heightChange = new EventEmitter();\n\n this.width = 260;\n this.height = 0;\n\n this.transition = SidebarTransition.Uncover;\n }\n\n public setVisibleState(isVisible:boolean):void {\n if (this.isVisible !== isVisible) {\n this.isVisible = isVisible;\n this.isAnimating = true;\n this.wasJustOpened = true;\n\n this.isVisibleChange.emit(isVisible);\n\n setTimeout(() => this.wasJustOpened = false);\n clearTimeout(this._isAnimatingTimeout);\n this._isAnimatingTimeout = window.setTimeout(() => this.isAnimating = false, 500);\n }\n }\n\n public toggleVisibleState():void {\n this.setVisibleState(!this.isVisible);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/services/sidebar.service.metadata.json b/dist/modules/sidebar/services/sidebar.service.metadata.json new file mode 100644 index 000000000..0b9badc31 --- /dev/null +++ b/dist/modules/sidebar/services/sidebar.service.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SidebarTransition":{"Overlay":"overlay","Push":"push","ScaleDown":"scale down","Uncover":"uncover","SlideAlong":"slide along","SlideOut":"slide out"},"SidebarDirection":{"Left":"left","Right":"right","Top":"top","Bottom":"bottom"},"SidebarService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"boolean"}]}],"setVisibleState":[{"__symbolic":"method"}],"toggleVisibleState":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/sidebar/sidebar.module.d.ts b/dist/modules/sidebar/sidebar.module.d.ts new file mode 100644 index 000000000..e5fe163b4 --- /dev/null +++ b/dist/modules/sidebar/sidebar.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiSidebarModule { +} diff --git a/dist/modules/sidebar/sidebar.module.js b/dist/modules/sidebar/sidebar.module.js new file mode 100644 index 000000000..b93ec8730 --- /dev/null +++ b/dist/modules/sidebar/sidebar.module.js @@ -0,0 +1,31 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiSidebar } from "./components/sidebar"; +import { SuiSidebarContainer } from "./components/sidebar-container"; +import { SuiSidebarSibling } from "./components/sidebar-sibling"; +var SuiSidebarModule = /** @class */ (function () { + function SuiSidebarModule() { + } + SuiSidebarModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule + ], + declarations: [ + SuiSidebar, + SuiSidebarContainer, + SuiSidebarSibling + ], + exports: [ + SuiSidebar, + SuiSidebarContainer, + SuiSidebarSibling + ] + },] }, + ]; + /** @nocollapse */ + SuiSidebarModule.ctorParameters = function () { return []; }; + return SuiSidebarModule; +}()); +export { SuiSidebarModule }; +//# sourceMappingURL=sidebar.module.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/sidebar.module.js.map b/dist/modules/sidebar/sidebar.module.js.map new file mode 100644 index 000000000..fa6175436 --- /dev/null +++ b/dist/modules/sidebar/sidebar.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sidebar.module.js","sourceRoot":"","sources":["../../../src/modules/sidebar/sidebar.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;;;;;gBAEhE,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;qBACf;oBACD,YAAY,EAAE;wBACV,UAAU;wBACV,mBAAmB;wBACnB,iBAAiB;qBACpB;oBACD,OAAO,EAAE;wBACL,UAAU;wBACV,mBAAmB;wBACnB,iBAAiB;qBACpB;iBACJ;;;;2BApBD;;SAqBa,gBAAgB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiSidebar } from \"./components/sidebar\";\nimport { SuiSidebarContainer } from \"./components/sidebar-container\";\nimport { SuiSidebarSibling } from \"./components/sidebar-sibling\";\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n SuiSidebar,\n SuiSidebarContainer,\n SuiSidebarSibling\n ],\n exports: [\n SuiSidebar,\n SuiSidebarContainer,\n SuiSidebarSibling\n ]\n})\nexport class SuiSidebarModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/sidebar.module.metadata.json b/dist/modules/sidebar/sidebar.module.metadata.json new file mode 100644 index 000000000..f0f6644af --- /dev/null +++ b/dist/modules/sidebar/sidebar.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiSidebarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/sidebar","name":"SuiSidebar","line":11,"character":8},{"__symbolic":"reference","module":"./components/sidebar-container","name":"SuiSidebarContainer","line":12,"character":8},{"__symbolic":"reference","module":"./components/sidebar-sibling","name":"SuiSidebarSibling","line":13,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/sidebar","name":"SuiSidebar","line":16,"character":8},{"__symbolic":"reference","module":"./components/sidebar-container","name":"SuiSidebarContainer","line":17,"character":8},{"__symbolic":"reference","module":"./components/sidebar-sibling","name":"SuiSidebarSibling","line":18,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/tabs/classes/tab.d.ts b/dist/modules/tabs/classes/tab.d.ts new file mode 100644 index 000000000..ceb6e815a --- /dev/null +++ b/dist/modules/tabs/classes/tab.d.ts @@ -0,0 +1,11 @@ +import { SuiTabHeader } from "../directives/tab-header"; +import { SuiTabContent } from "../directives/tab-content"; +export declare class Tab { + id: string; + header: SuiTabHeader; + content: SuiTabContent; + index: number; + constructor(header: SuiTabHeader, content: SuiTabContent); + isActive: boolean; + readonly isDisabled: boolean; +} diff --git a/dist/modules/tabs/classes/tab.js b/dist/modules/tabs/classes/tab.js new file mode 100644 index 000000000..f1e6d1c3f --- /dev/null +++ b/dist/modules/tabs/classes/tab.js @@ -0,0 +1,38 @@ +var Tab = /** @class */ (function () { + function Tab(header, content) { + var _this = this; + this.id = header.id; + this.header = header; + this.content = content; + // So that the header and content isActive properties are always in sync. + this.header.isActiveChange + .subscribe(function () { return _this.content.isActive = _this.isActive; }); + } + Object.defineProperty(Tab.prototype, "isActive", { + // Saves accessing .header.isActive every time. + get: + // Saves accessing .header.isActive every time. + function () { + return this.header.isActive; + }, + set: function (active) { + // Use `setActiveState` so as not to fire 'external changes' event. + this.header.setActiveState(active); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Tab.prototype, "isDisabled", { + // Saves accessing .header.isDisabled every time. + get: + // Saves accessing .header.isDisabled every time. + function () { + return this.header.isDisabled; + }, + enumerable: true, + configurable: true + }); + return Tab; +}()); +export { Tab }; +//# sourceMappingURL=tab.js.map \ No newline at end of file diff --git a/dist/modules/tabs/classes/tab.js.map b/dist/modules/tabs/classes/tab.js.map new file mode 100644 index 000000000..6c496e839 --- /dev/null +++ b/dist/modules/tabs/classes/tab.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tab.js","sourceRoot":"","sources":["../../../../src/modules/tabs/classes/tab.ts"],"names":[],"mappings":"AAGA,IAAA;IAMI,aAAY,MAAmB,EAAE,OAAqB;QAAtD,iBAQC;QAPG,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;QAGvB,IAAI,CAAC,MAAM,CAAC,cAAc;aACrB,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,KAAI,CAAC,QAAQ,EAArC,CAAqC,CAAC,CAAC;KAC/D;IAGD,sBAAW,yBAAQ;QADnB,+CAA+C;;;QAC/C;YACI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;SAC/B;aAED,UAAoB,MAAc;;YAE9B,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;SACtC;;;OALA;IAQD,sBAAW,2BAAU;QADrB,iDAAiD;;;QACjD;YACI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;SACjC;;;OAAA;cAhCL;IAiCC,CAAA;AA9BD,eA8BC","sourcesContent":["import { SuiTabHeader } from \"../directives/tab-header\";\nimport { SuiTabContent } from \"../directives/tab-content\";\n\nexport class Tab {\n public id:string;\n public header:SuiTabHeader;\n public content:SuiTabContent;\n public index:number;\n\n constructor(header:SuiTabHeader, content:SuiTabContent) {\n this.id = header.id;\n this.header = header;\n this.content = content;\n\n // So that the header and content isActive properties are always in sync.\n this.header.isActiveChange\n .subscribe(() => this.content.isActive = this.isActive);\n }\n\n // Saves accessing .header.isActive every time.\n public get isActive():boolean {\n return this.header.isActive;\n }\n\n public set isActive(active:boolean) {\n // Use `setActiveState` so as not to fire 'external changes' event.\n this.header.setActiveState(active);\n }\n\n // Saves accessing .header.isDisabled every time.\n public get isDisabled():boolean {\n return this.header.isDisabled;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/classes/tab.metadata.json b/dist/modules/tabs/classes/tab.metadata.json new file mode 100644 index 000000000..9c19e4315 --- /dev/null +++ b/dist/modules/tabs/classes/tab.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"Tab":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../directives/tab-header","name":"SuiTabHeader","line":9,"character":23},{"__symbolic":"reference","module":"../directives/tab-content","name":"SuiTabContent","line":9,"character":45}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/tabs/components/tabset.d.ts b/dist/modules/tabs/components/tabset.d.ts new file mode 100644 index 000000000..ccc7783a8 --- /dev/null +++ b/dist/modules/tabs/components/tabset.d.ts @@ -0,0 +1,17 @@ +import { AfterContentInit } from "@angular/core"; +import { Tab } from "../classes/tab"; +export declare class SuiTabset implements AfterContentInit { + private _tabHeaders; + private _tabContents; + tabs: Tab[]; + private _activeTab; + activeTab: Tab; + private _barrierCount; + constructor(); + ngAfterContentInit(): void; + private internalComponentsUpdated(); + private loadTabs(); + private onHeaderActiveChanged(tab); + activateFirstTab(): void; + activateClosestTab(tab: Tab): void; +} diff --git a/dist/modules/tabs/components/tabset.js b/dist/modules/tabs/components/tabset.js new file mode 100644 index 000000000..ed478501a --- /dev/null +++ b/dist/modules/tabs/components/tabset.js @@ -0,0 +1,170 @@ +import { Component, ContentChildren, QueryList } from "@angular/core"; +import { SuiTabHeader } from "../directives/tab-header"; +import { SuiTabContent } from "../directives/tab-content"; +import { Tab } from "../classes/tab"; +var SuiTabset = /** @class */ (function () { + function SuiTabset() { + this.tabs = []; + this._barrierCount = 0; + } + Object.defineProperty(SuiTabset.prototype, "activeTab", { + get: function () { + return this._activeTab; + }, + // When setting a tab as the currently active tab, it automatically gains + // `isActive` status (saves littering `isActive = true` everywhere). + set: + // When setting a tab as the currently active tab, it automatically gains + // `isActive` status (saves littering `isActive = true` everywhere). + function (tab) { + this._activeTab = tab; + tab.isActive = true; + }, + enumerable: true, + configurable: true + }); + SuiTabset.prototype.ngAfterContentInit = function () { + var _this = this; + // Fire `internalComponentsUpdated` when the query lists change. + this._tabHeaders.changes.subscribe(function () { return _this.internalComponentsUpdated(); }); + this._tabContents.changes.subscribe(function () { return _this.internalComponentsUpdated(); }); + // Initially load the tabs. + this.loadTabs(); + }; + // Fires whenever either the tab headers or tab contents query lists update. + // Fires whenever either the tab headers or tab contents query lists update. + SuiTabset.prototype.internalComponentsUpdated = + // Fires whenever either the tab headers or tab contents query lists update. + function () { + // We are using a 'counting barrier of n = 2', i.e. the code within only runs after the method is called twice. + // This is so that both the headers and contents query lists can update before we run code that matches the two up. + this._barrierCount++; + if (this._barrierCount === 2) { + // Reset the barrier so it can be called again. + this._barrierCount = 0; + // Update the tabs. + this.loadTabs(); + } + }; + // Connects tab headers to tab contents, and creates a tab instance for each pairing. + // Connects tab headers to tab contents, and creates a tab instance for each pairing. + SuiTabset.prototype.loadTabs = + // Connects tab headers to tab contents, and creates a tab instance for each pairing. + function () { + var _this = this; + // Remove any tabs that no longer have an associated header. + this.tabs = this.tabs.filter(function (t) { return !!_this._tabHeaders.find(function (tH) { return tH === t.header; }); }); + this._tabHeaders + .filter(function (tH) { return !_this.tabs.find(function (t) { return t.header === tH; }); }) + .forEach(function (tH) { + var content = _this._tabContents.find(function (tC) { return tC.id === tH.id; }); + if (!content) { + // Error if an associated tab content cannot be found for the given header. + throw new Error("A [suiTabHeader] must have a related [suiTabContent]."); + } + // Create a new tab instance for this header & content combo. + var tab = new Tab(tH, content); + // Subscribe to any external changes in the tab header's active state. External changes are triggered by user input. + tab.header.isActiveExternalChange.subscribe(function () { return _this.onHeaderActiveChanged(tab); }); + // Add the new instance to the list of tabs. + // Add the new instance to the list of tabs. + _this.tabs.push(tab); + }); + // Assign each tab an index (which denotes the order they physically appear in). + this._tabHeaders + .forEach(function (tH, i) { + var tab = _this.tabs.find(function (t) { return t.header === tH; }); + if (tab) { + tab.index = i; + } + }); + // Sort the tabs by their index. + this.tabs.sort(function (a, b) { return a.index - b.index; }); + if (!this.activeTab) { + // Check if there are no current existing active tabs. + // If so, we must activate the first available tab. + this.activateFirstTab(); + } + else if (!this.tabs.find(function (t) { return t === _this.activeTab; })) { + // O'wise check if current active tab has been deleted. + // If so, we must find the closest. + // Use `setTimeout` as this causes a 'changed after checked' error o'wise. + setTimeout(function () { return _this.activateClosestTab(_this.activeTab); }); + } + if (this.tabs.length === 0) { + // Error if there aren't any tabs in the tabset. + throw new Error("You cannot have no tabs!"); + } + }; + // Fires whenever a tab header's active state is externally changed. + // Fires whenever a tab header's active state is externally changed. + SuiTabset.prototype.onHeaderActiveChanged = + // Fires whenever a tab header's active state is externally changed. + function (tab) { + // If the tab has become activated, but was not previously the active tab: + if (tab.isActive && this.activeTab !== tab) { + // Deactivate all of the tabs. + this.tabs.filter(function (t) { return t !== tab; }).forEach(function (t) { return t.isActive = false; }); + // Set the currently active tab to this one. + this.activeTab = tab; + } + // If the tab has become deactivated, but was previously the active tab: + if (!tab.isActive && this.activeTab === tab) { + // Activate the closest tab to it. + this.activateClosestTab(tab); + } + }; + // Activate the first tab in the set. + // Activate the first tab in the set. + SuiTabset.prototype.activateFirstTab = + // Activate the first tab in the set. + function () { + this.activeTab = this.tabs[0]; + }; + // Activates the closest available tab to a given one. + // Activates the closest available tab to a given one. + SuiTabset.prototype.activateClosestTab = + // Activates the closest available tab to a given one. + function (tab) { + var nextAvailable; + // When the exited tab's index is higher than all available tabs, + if (tab.index >= this.tabs.length) { + // Activate the last tab. + nextAvailable = this.tabs[this.tabs.length - 1]; + } + // If that didn't work, try the following cases: + if (!nextAvailable) { + if (!this.tabs.find(function (t) { return t === tab; })) { + // When the exited tab no longer exists, + // Replace it with a tab at the same index. + nextAvailable = this.tabs[tab.index]; + } + else { + // Or if the exited tab still exists, + // Go to the tab immediately to the left. + nextAvailable = this.tabs[Math.max(tab.index - 1, 0)]; + } + } + // However, if the chosen tab is disabled, + if (nextAvailable.isDisabled) { + // Activate the closest available tab to it. + return this.activateClosestTab(nextAvailable); + } + this.activeTab = nextAvailable; + }; + SuiTabset.decorators = [ + { type: Component, args: [{ + selector: "sui-tabset", + template: "" + },] }, + ]; + /** @nocollapse */ + SuiTabset.ctorParameters = function () { return []; }; + SuiTabset.propDecorators = { + "_tabHeaders": [{ type: ContentChildren, args: [SuiTabHeader,] },], + "_tabContents": [{ type: ContentChildren, args: [SuiTabContent,] },], + }; + return SuiTabset; +}()); +export { SuiTabset }; +//# sourceMappingURL=tabset.js.map \ No newline at end of file diff --git a/dist/modules/tabs/components/tabset.js.map b/dist/modules/tabs/components/tabset.js.map new file mode 100644 index 000000000..1df2dc9ae --- /dev/null +++ b/dist/modules/tabs/components/tabset.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tabset.js","sourceRoot":"","sources":["../../../../src/modules/tabs/components/tabset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAoB,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;;IAiCjC;QACI,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,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AC7B,IAAI,aAA6B,CAAC;;QAGlC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;;YAEhC,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SACnD;;QAGD,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;YACjB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,GAAG,EAAT,CAAS,CAAC,CAAC,CAAC,CAAC;;;gBAElC,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aACxC;YAAC,IAAI,CAAC,CAAC;;;gBAEJ,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;aACzD;SACJ;;QAGD,EAAE,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;;YAE3B,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;SACjD;QAED,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;KAClC;;gBArKJ,SAAS,SAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,2BAA2B;iBACxC;;;;;gCAEI,eAAe,SAAC,YAAY;iCAG5B,eAAe,SAAC,aAAa;;oBAblC;;SASa,SAAS","sourcesContent":["import { Component, ContentChildren, QueryList, AfterContentInit } from \"@angular/core\";\nimport { SuiTabHeader } from \"../directives/tab-header\";\nimport { SuiTabContent } from \"../directives/tab-content\";\nimport { Tab } from \"../classes/tab\";\n\n@Component({\n selector: \"sui-tabset\",\n template: ``\n})\nexport class SuiTabset implements AfterContentInit {\n @ContentChildren(SuiTabHeader)\n private _tabHeaders:QueryList;\n\n @ContentChildren(SuiTabContent)\n private _tabContents:QueryList;\n\n // List of all tabs in the tabset.\n public tabs:Tab[];\n\n // Keeps track of the currently active tab.\n private _activeTab:Tab;\n\n public get activeTab():Tab {\n return this._activeTab;\n }\n\n // When setting a tab as the currently active tab, it automatically gains\n // `isActive` status (saves littering `isActive = true` everywhere).\n public set activeTab(tab:Tab) {\n this._activeTab = tab;\n tab.isActive = true;\n }\n\n // Keeps track of the number of times `internalComponentsUpdated` is called.\n private _barrierCount:number;\n\n constructor() {\n this.tabs = [];\n this._barrierCount = 0;\n }\n\n public ngAfterContentInit():void {\n // Fire `internalComponentsUpdated` when the query lists change.\n this._tabHeaders.changes.subscribe(() => this.internalComponentsUpdated());\n this._tabContents.changes.subscribe(() => this.internalComponentsUpdated());\n\n // Initially load the tabs.\n this.loadTabs();\n }\n\n // Fires whenever either the tab headers or tab contents query lists update.\n private internalComponentsUpdated():void {\n // We are using a 'counting barrier of n = 2', i.e. the code within only runs after the method is called twice.\n // This is so that both the headers and contents query lists can update before we run code that matches the two up.\n this._barrierCount++;\n\n if (this._barrierCount === 2) {\n // Reset the barrier so it can be called again.\n this._barrierCount = 0;\n\n // Update the tabs.\n this.loadTabs();\n }\n }\n\n // Connects tab headers to tab contents, and creates a tab instance for each pairing.\n private loadTabs():void {\n // Remove any tabs that no longer have an associated header.\n this.tabs = this.tabs.filter(t => !!this._tabHeaders.find(tH => tH === t.header));\n\n this._tabHeaders\n // Filter out the loaded headers with attached tab instances.\n .filter(tH => !this.tabs.find(t => t.header === tH))\n .forEach(tH => {\n const content = this._tabContents.find(tC => tC.id === tH.id);\n\n if (!content) {\n // Error if an associated tab content cannot be found for the given header.\n throw new Error(\"A [suiTabHeader] must have a related [suiTabContent].\");\n }\n\n // Create a new tab instance for this header & content combo.\n const tab = new Tab(tH, content);\n\n // Subscribe to any external changes in the tab header's active state. External changes are triggered by user input.\n tab.header.isActiveExternalChange.subscribe(() => this.onHeaderActiveChanged(tab));\n\n // Add the new instance to the list of tabs.\n this.tabs.push(tab);\n });\n\n // Assign each tab an index (which denotes the order they physically appear in).\n this._tabHeaders\n .forEach((tH, i) => {\n const tab = this.tabs.find(t => t.header === tH);\n if (tab) {\n tab.index = i;\n }\n });\n\n // Sort the tabs by their index.\n this.tabs.sort((a, b) => a.index - b.index);\n\n\n if (!this.activeTab) { // Check if there are no current existing active tabs.\n // If so, we must activate the first available tab.\n this.activateFirstTab();\n } else if (!this.tabs.find(t => t === this.activeTab)) { // O'wise check if current active tab has been deleted.\n // If so, we must find the closest.\n // Use `setTimeout` as this causes a 'changed after checked' error o'wise.\n setTimeout(() => this.activateClosestTab(this.activeTab));\n }\n\n if (this.tabs.length === 0) {\n // Error if there aren't any tabs in the tabset.\n throw new Error(\"You cannot have no tabs!\");\n }\n }\n\n // Fires whenever a tab header's active state is externally changed.\n private onHeaderActiveChanged(tab:Tab):void {\n // If the tab has become activated, but was not previously the active tab:\n if (tab.isActive && this.activeTab !== tab) {\n // Deactivate all of the tabs.\n this.tabs.filter(t => t !== tab).forEach(t => t.isActive = false);\n\n // Set the currently active tab to this one.\n this.activeTab = tab;\n }\n\n // If the tab has become deactivated, but was previously the active tab:\n if (!tab.isActive && this.activeTab === tab) {\n // Activate the closest tab to it.\n this.activateClosestTab(tab);\n }\n }\n\n // Activate the first tab in the set.\n public activateFirstTab():void {\n this.activeTab = this.tabs[0];\n }\n\n // Activates the closest available tab to a given one.\n public activateClosestTab(tab:Tab):void {\n let nextAvailable:Tab | undefined;\n\n // When the exited tab's index is higher than all available tabs,\n if (tab.index >= this.tabs.length) {\n // Activate the last tab.\n nextAvailable = this.tabs[this.tabs.length - 1];\n }\n\n // If that didn't work, try the following cases:\n if (!nextAvailable) {\n if (!this.tabs.find(t => t === tab)) { // When the exited tab no longer exists,\n // Replace it with a tab at the same index.\n nextAvailable = this.tabs[tab.index];\n } else { // Or if the exited tab still exists,\n // Go to the tab immediately to the left.\n nextAvailable = this.tabs[Math.max(tab.index - 1, 0)];\n }\n }\n\n // However, if the chosen tab is disabled,\n if (nextAvailable.isDisabled) {\n // Activate the closest available tab to it.\n return this.activateClosestTab(nextAvailable);\n }\n\n this.activeTab = nextAvailable;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/components/tabset.metadata.json b/dist/modules/tabs/components/tabset.metadata.json new file mode 100644 index 000000000..0eac6359d --- /dev/null +++ b/dist/modules/tabs/components/tabset.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiTabset":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"sui-tabset","template":""}]}],"members":{"_tabHeaders":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":10,"character":5},"arguments":[{"__symbolic":"reference","module":"../directives/tab-header","name":"SuiTabHeader","line":10,"character":21}]}]}],"_tabContents":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":13,"character":5},"arguments":[{"__symbolic":"reference","module":"../directives/tab-content","name":"SuiTabContent","line":13,"character":21}]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngAfterContentInit":[{"__symbolic":"method"}],"internalComponentsUpdated":[{"__symbolic":"method"}],"loadTabs":[{"__symbolic":"method"}],"onHeaderActiveChanged":[{"__symbolic":"method"}],"activateFirstTab":[{"__symbolic":"method"}],"activateClosestTab":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-content.d.ts b/dist/modules/tabs/directives/tab-content.d.ts new file mode 100644 index 000000000..9071c8847 --- /dev/null +++ b/dist/modules/tabs/directives/tab-content.d.ts @@ -0,0 +1,6 @@ +export declare class SuiTabContent { + private _contentClasses; + id: string; + isActive: boolean; + constructor(); +} diff --git a/dist/modules/tabs/directives/tab-content.js b/dist/modules/tabs/directives/tab-content.js new file mode 100644 index 000000000..70e482784 --- /dev/null +++ b/dist/modules/tabs/directives/tab-content.js @@ -0,0 +1,22 @@ +import { HostBinding, Directive, Input } from "@angular/core"; +var SuiTabContent = /** @class */ (function () { + function SuiTabContent() { + this.isActive = false; + this._contentClasses = true; + } + SuiTabContent.decorators = [ + { type: Directive, args: [{ + selector: "[suiTabContent]" + },] }, + ]; + /** @nocollapse */ + SuiTabContent.ctorParameters = function () { return []; }; + SuiTabContent.propDecorators = { + "_contentClasses": [{ type: HostBinding, args: ["class.tab",] },], + "id": [{ type: Input, args: ["suiTabContent",] },], + "isActive": [{ type: HostBinding, args: ["class.active",] },], + }; + return SuiTabContent; +}()); +export { SuiTabContent }; +//# sourceMappingURL=tab-content.js.map \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-content.js.map b/dist/modules/tabs/directives/tab-content.js.map new file mode 100644 index 000000000..55c193c88 --- /dev/null +++ b/dist/modules/tabs/directives/tab-content.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tab-content.js","sourceRoot":"","sources":["../../../../src/modules/tabs/directives/tab-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;IAe1D;QACI,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;KAC/B;;gBAjBJ,SAAS,SAAC;oBACP,QAAQ,EAAE,iBAAiB;iBAC9B;;;;;oCAEI,WAAW,SAAC,WAAW;uBAGvB,KAAK,SAAC,eAAe;6BAGrB,WAAW,SAAC,cAAc;;wBAZ/B;;SAKa,aAAa","sourcesContent":["import { HostBinding, Directive, Input } from \"@angular/core\";\n\n@Directive({\n selector: \"[suiTabContent]\"\n})\nexport class SuiTabContent {\n @HostBinding(\"class.tab\")\n private _contentClasses:boolean;\n\n @Input(\"suiTabContent\")\n public id:string;\n\n @HostBinding(\"class.active\")\n public isActive:boolean;\n\n constructor() {\n this.isActive = false;\n\n this._contentClasses = true;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-content.metadata.json b/dist/modules/tabs/directives/tab-content.metadata.json new file mode 100644 index 000000000..84186728a --- /dev/null +++ b/dist/modules/tabs/directives/tab-content.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiTabContent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[suiTabContent]"}]}],"members":{"_contentClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":6,"character":5},"arguments":["class.tab"]}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":5},"arguments":["suiTabContent"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":12,"character":5},"arguments":["class.active"]}]}],"__ctor__":[{"__symbolic":"constructor"}]}}}}] \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-header.d.ts b/dist/modules/tabs/directives/tab-header.d.ts new file mode 100644 index 000000000..b9943a1b5 --- /dev/null +++ b/dist/modules/tabs/directives/tab-header.d.ts @@ -0,0 +1,16 @@ +import { EventEmitter } from "@angular/core"; +export declare class SuiTabHeader { + private _headerClasses; + id: string; + private _isActive; + isActiveChange: EventEmitter; + isActiveExternalChange: EventEmitter; + onActivate: EventEmitter; + onDeactivate: EventEmitter; + isActive: boolean; + private _isDisabled; + isDisabled: boolean; + constructor(); + setActiveState(active: boolean): void; + private onClick(); +} diff --git a/dist/modules/tabs/directives/tab-header.js b/dist/modules/tabs/directives/tab-header.js new file mode 100644 index 000000000..5626759bb --- /dev/null +++ b/dist/modules/tabs/directives/tab-header.js @@ -0,0 +1,97 @@ +import { HostBinding, Input, Directive, EventEmitter, HostListener, Output } from "@angular/core"; +var SuiTabHeader = /** @class */ (function () { + function SuiTabHeader() { + this._isActive = false; + this.isActiveChange = new EventEmitter(); + this.isActiveExternalChange = new EventEmitter(); + this.onActivate = new EventEmitter(); + this.onDeactivate = new EventEmitter(); + this.isDisabled = false; + this._headerClasses = true; + } + Object.defineProperty(SuiTabHeader.prototype, "isActive", { + get: function () { + return this._isActive; + }, + set: function (active) { + var _this = this; + var isActive = active; + // Only used by @Input(), runs whenever user input changes `isActive`. + // Run in timeout because `isDisabled` can prohibit user from changing `isActive`. + // so update is delayed to avoid 'changed after checked' error. + setTimeout(function () { + // Only allow change if tab header is not disabled. + isActive = !_this.isDisabled ? active : false; + _this.setActiveState(isActive); + // Fire 'external change' event as user input has occured. + // Fire 'external change' event as user input has occured. + _this.isActiveExternalChange.emit(isActive); + }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiTabHeader.prototype, "isDisabled", { + get: function () { + return this._isDisabled; + }, + set: function (disabled) { + // Only update if value provided is different to current one. + if (this._isDisabled !== disabled) { + this._isDisabled = disabled; + // If now disabled, then tab header must be deactivated. + if (this.isDisabled) { + this.isActive = false; + } + } + }, + enumerable: true, + configurable: true + }); + // Internally update active state. + // Internally update active state. + SuiTabHeader.prototype.setActiveState = + // Internally update active state. + function (active) { + // If (cast) active value has changed: + if (!!this._isActive !== active) { + // Update to the new value. + this._isActive = active; + // Fire the appropriate activation event. + if (active) { + this.onActivate.emit(); + } + else { + this.onDeactivate.emit(); + } + } + // Regardless, emit a change to `isActive`, so [(isActive)] works correctly. + this.isActiveChange.emit(active); + }; + SuiTabHeader.prototype.onClick = function () { + if (!this.isDisabled) { + // Activate the tab when clicked, so long as it isn't disabled. + this.isActive = true; + } + }; + SuiTabHeader.decorators = [ + { type: Directive, args: [{ + selector: "[suiTabHeader]" + },] }, + ]; + /** @nocollapse */ + SuiTabHeader.ctorParameters = function () { return []; }; + SuiTabHeader.propDecorators = { + "_headerClasses": [{ type: HostBinding, args: ["class.item",] },], + "id": [{ type: Input, args: ["suiTabHeader",] },], + "isActiveChange": [{ type: Output },], + "onActivate": [{ type: Output, args: ["activate",] },], + "onDeactivate": [{ type: Output, args: ["deactivate",] },], + "isActive": [{ type: HostBinding, args: ["class.active",] }, { type: Input },], + "isDisabled": [{ type: HostBinding, args: ["class.disabled",] }, { type: Input },], + "onClick": [{ type: HostListener, args: ["click",] },], + }; + return SuiTabHeader; +}()); +export { SuiTabHeader }; +//# sourceMappingURL=tab-header.js.map \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-header.js.map b/dist/modules/tabs/directives/tab-header.js.map new file mode 100644 index 000000000..ce6c9d9df --- /dev/null +++ b/dist/modules/tabs/directives/tab-header.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tab-header.js","sourceRoot":"","sources":["../../../../src/modules/tabs/directives/tab-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;IAuE9F;QACI,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,IAAI,YAAY,EAAW,CAAC;QAClD,IAAI,CAAC,sBAAsB,GAAG,IAAI,YAAY,EAAW,CAAC;QAE1D,IAAI,CAAC,UAAU,GAAG,IAAI,YAAY,EAAQ,CAAC;QAC3C,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,EAAQ,CAAC;QAE7C,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;KAC9B;0BAlDU,kCAAQ;;YACf,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;;aAG1B,UAAoB,MAAc;YAAlC,iBAaC;YAZG,IAAI,QAAQ,GAAG,MAAM,CAAC;;;;YAItB,UAAU,CAAC;;gBAEP,QAAQ,GAAG,CA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AY;uBAGxB,KAAK,SAAC,cAAc;mCAOpB,MAAM;+BAON,MAAM,SAAC,UAAU;iCAIjB,MAAM,SAAC,YAAY;6BAGnB,WAAW,SAAC,cAAc,cAC1B,KAAK;+BAsBL,WAAW,SAAC,gBAAgB,cAC5B,KAAK;4BAiDL,YAAY,SAAC,OAAO;;uBAvGzB;;SAKa,YAAY","sourcesContent":["import { HostBinding, Input, Directive, EventEmitter, HostListener, Output } from \"@angular/core\";\n\n@Directive({\n selector: \"[suiTabHeader]\"\n})\nexport class SuiTabHeader {\n @HostBinding(\"class.item\")\n private _headerClasses:boolean;\n\n @Input(\"suiTabHeader\")\n public id:string;\n\n // Internally keeps track of whether the header is active.\n private _isActive:boolean;\n\n // Enables use of [(isActive)] so state can be set using booleans.\n @Output()\n public isActiveChange:EventEmitter;\n\n // Fires only when `isActive` changes due to user input.\n public isActiveExternalChange:EventEmitter;\n\n // Fires whenever a tab is activated having previously been deactivated.\n @Output(\"activate\")\n public onActivate:EventEmitter;\n\n // Fires whenever a tab is deactivated having previously been activated.\n @Output(\"deactivate\")\n public onDeactivate:EventEmitter;\n\n @HostBinding(\"class.active\")\n @Input()\n public get isActive():boolean {\n return this._isActive;\n }\n\n public set isActive(active:boolean) {\n let isActive = active;\n // Only used by @Input(), runs whenever user input changes `isActive`.\n // Run in timeout because `isDisabled` can prohibit user from changing `isActive`.\n // so update is delayed to avoid 'changed after checked' error.\n setTimeout(() => {\n // Only allow change if tab header is not disabled.\n isActive = !this.isDisabled ? active : false;\n this.setActiveState(isActive);\n\n // Fire 'external change' event as user input has occured.\n this.isActiveExternalChange.emit(isActive);\n });\n }\n\n private _isDisabled:boolean;\n\n @HostBinding(\"class.disabled\")\n @Input()\n public get isDisabled():boolean {\n return this._isDisabled;\n }\n\n public set isDisabled(disabled:boolean) {\n // Only update if value provided is different to current one.\n if (this._isDisabled !== disabled) {\n this._isDisabled = disabled;\n\n // If now disabled, then tab header must be deactivated.\n if (this.isDisabled) {\n this.isActive = false;\n }\n }\n }\n\n constructor() {\n this._isActive = false;\n this.isActiveChange = new EventEmitter();\n this.isActiveExternalChange = new EventEmitter();\n\n this.onActivate = new EventEmitter();\n this.onDeactivate = new EventEmitter();\n\n this.isDisabled = false;\n\n this._headerClasses = true;\n }\n\n // Internally update active state.\n public setActiveState(active:boolean):void {\n // If (cast) active value has changed:\n if (!!this._isActive !== active) {\n // Update to the new value.\n this._isActive = active;\n\n // Fire the appropriate activation event.\n if (active) {\n this.onActivate.emit();\n } else {\n this.onDeactivate.emit();\n }\n }\n\n // Regardless, emit a change to `isActive`, so [(isActive)] works correctly.\n this.isActiveChange.emit(active);\n }\n\n @HostListener(\"click\")\n private onClick():void {\n if (!this.isDisabled) {\n // Activate the tab when clicked, so long as it isn't disabled.\n this.isActive = true;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-header.metadata.json b/dist/modules/tabs/directives/tab-header.metadata.json new file mode 100644 index 000000000..2f2cf30d8 --- /dev/null +++ b/dist/modules/tabs/directives/tab-header.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiTabHeader":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[suiTabHeader]"}]}],"members":{"_headerClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":6,"character":5},"arguments":["class.item"]}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":5},"arguments":["suiTabHeader"]}]}],"isActiveChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":16,"character":5}}]}],"onActivate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":23,"character":5},"arguments":["activate"]}]}],"onDeactivate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":27,"character":5},"arguments":["deactivate"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":30,"character":5},"arguments":["class.active"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":5}}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":53,"character":5},"arguments":["class.disabled"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":54,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor"}],"setActiveState":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":103,"character":5},"arguments":["click"]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/tabs/index.d.ts b/dist/modules/tabs/index.d.ts new file mode 100644 index 000000000..49e44a0f9 --- /dev/null +++ b/dist/modules/tabs/index.d.ts @@ -0,0 +1,5 @@ +export * from "./classes/tab"; +export * from "./components/tabset"; +export * from "./directives/tab-content"; +export * from "./directives/tab-header"; +export * from "./tab.module"; diff --git a/dist/modules/tabs/index.js b/dist/modules/tabs/index.js new file mode 100644 index 000000000..b684fd921 --- /dev/null +++ b/dist/modules/tabs/index.js @@ -0,0 +1,6 @@ +export * from "./classes/tab"; +export * from "./components/tabset"; +export * from "./directives/tab-content"; +export * from "./directives/tab-header"; +export * from "./tab.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/tabs/index.js.map b/dist/modules/tabs/index.js.map new file mode 100644 index 000000000..bef18f76d --- /dev/null +++ b/dist/modules/tabs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/tabs/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAE9B,cAAc,qBAAqB,CAAC;AAEpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AAExC,cAAc,cAAc,CAAC","sourcesContent":["export * from \"./classes/tab\";\n\nexport * from \"./components/tabset\";\n\nexport * from \"./directives/tab-content\";\nexport * from \"./directives/tab-header\";\n\nexport * from \"./tab.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/index.metadata.json b/dist/modules/tabs/index.metadata.json new file mode 100644 index 000000000..9922efcdc --- /dev/null +++ b/dist/modules/tabs/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/tab"},{"from":"./components/tabset"},{"from":"./directives/tab-content"},{"from":"./directives/tab-header"},{"from":"./tab.module"}]}] \ No newline at end of file diff --git a/dist/modules/tabs/public.d.ts b/dist/modules/tabs/public.d.ts new file mode 100644 index 000000000..9cdba2925 --- /dev/null +++ b/dist/modules/tabs/public.d.ts @@ -0,0 +1 @@ +export { SuiTabsModule } from "./index"; diff --git a/dist/modules/tabs/public.js b/dist/modules/tabs/public.js new file mode 100644 index 000000000..aa5d3195b --- /dev/null +++ b/dist/modules/tabs/public.js @@ -0,0 +1,2 @@ +export { SuiTabsModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/tabs/public.js.map b/dist/modules/tabs/public.js.map new file mode 100644 index 000000000..d1ef321f1 --- /dev/null +++ b/dist/modules/tabs/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/tabs/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAChB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiTabsModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/public.metadata.json b/dist/modules/tabs/public.metadata.json new file mode 100644 index 000000000..d87797ecf --- /dev/null +++ b/dist/modules/tabs/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiTabsModule"]}]}] \ No newline at end of file diff --git a/dist/modules/tabs/tab.module.d.ts b/dist/modules/tabs/tab.module.d.ts new file mode 100644 index 000000000..2fd5fedba --- /dev/null +++ b/dist/modules/tabs/tab.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiTabsModule { +} diff --git a/dist/modules/tabs/tab.module.js b/dist/modules/tabs/tab.module.js new file mode 100644 index 000000000..2513ab579 --- /dev/null +++ b/dist/modules/tabs/tab.module.js @@ -0,0 +1,31 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiTabset } from "./components/tabset"; +import { SuiTabHeader } from "./directives/tab-header"; +import { SuiTabContent } from "./directives/tab-content"; +var SuiTabsModule = /** @class */ (function () { + function SuiTabsModule() { + } + SuiTabsModule.decorators = [ + { type: NgModule, args: [{ + imports: [ + CommonModule + ], + declarations: [ + SuiTabset, + SuiTabHeader, + SuiTabContent + ], + exports: [ + SuiTabset, + SuiTabHeader, + SuiTabContent + ] + },] }, + ]; + /** @nocollapse */ + SuiTabsModule.ctorParameters = function () { return []; }; + return SuiTabsModule; +}()); +export { SuiTabsModule }; +//# sourceMappingURL=tab.module.js.map \ No newline at end of file diff --git a/dist/modules/tabs/tab.module.js.map b/dist/modules/tabs/tab.module.js.map new file mode 100644 index 000000000..7635d8a63 --- /dev/null +++ b/dist/modules/tabs/tab.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tab.module.js","sourceRoot":"","sources":["../../../src/modules/tabs/tab.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;;;;;gBAExD,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;qBACf;oBACD,YAAY,EAAE;wBACV,SAAS;wBACT,YAAY;wBACZ,aAAa;qBAChB;oBACD,OAAO,EAAE;wBACL,SAAS;wBACT,YAAY;wBACZ,aAAa;qBAChB;iBACJ;;;;wBApBD;;SAqBa,aAAa","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTabset } from \"./components/tabset\";\nimport { SuiTabHeader } from \"./directives/tab-header\";\nimport { SuiTabContent } from \"./directives/tab-content\";\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n SuiTabset,\n SuiTabHeader,\n SuiTabContent\n ],\n exports: [\n SuiTabset,\n SuiTabHeader,\n SuiTabContent\n ]\n})\nexport class SuiTabsModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/tab.module.metadata.json b/dist/modules/tabs/tab.module.metadata.json new file mode 100644 index 000000000..fc089e291 --- /dev/null +++ b/dist/modules/tabs/tab.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiTabsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/tabset","name":"SuiTabset","line":11,"character":8},{"__symbolic":"reference","module":"./directives/tab-header","name":"SuiTabHeader","line":12,"character":8},{"__symbolic":"reference","module":"./directives/tab-content","name":"SuiTabContent","line":13,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/tabset","name":"SuiTabset","line":16,"character":8},{"__symbolic":"reference","module":"./directives/tab-header","name":"SuiTabHeader","line":17,"character":8},{"__symbolic":"reference","module":"./directives/tab-content","name":"SuiTabContent","line":18,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/transition/classes/transition-controller.d.ts b/dist/modules/transition/classes/transition-controller.d.ts new file mode 100644 index 000000000..15a3cd2b3 --- /dev/null +++ b/dist/modules/transition/classes/transition-controller.d.ts @@ -0,0 +1,29 @@ +import { Renderer2, ElementRef, ChangeDetectorRef } from "@angular/core"; +import { Transition } from "./transition"; +export declare class TransitionController { + private _renderer; + private _element; + private _changeDetector; + private readonly _isReady; + private _display; + private _queue; + private _isAnimating; + readonly isAnimating: boolean; + private _isVisible; + readonly isVisible: boolean; + private _isHidden; + readonly isHidden: boolean; + private readonly _queueFirst; + private readonly _queueLast; + private _animationTimeout; + constructor(isInitiallyVisible?: boolean, display?: string); + registerRenderer(renderer: Renderer2): void; + registerElement(element: ElementRef): void; + registerChangeDetector(changeDetector: ChangeDetectorRef): void; + animate(transition: Transition): void; + private performTransition(); + private finishTransition(transition); + stop(transition?: Transition): void; + stopAll(): void; + clearQueue(): void; +} diff --git a/dist/modules/transition/classes/transition-controller.js b/dist/modules/transition/classes/transition-controller.js new file mode 100644 index 000000000..7881c201c --- /dev/null +++ b/dist/modules/transition/classes/transition-controller.js @@ -0,0 +1,200 @@ +import { TransitionDirection } from "./transition"; +var TransitionController = /** @class */ (function () { + function TransitionController(isInitiallyVisible, display) { + if (isInitiallyVisible === void 0) { isInitiallyVisible = true; } + if (display === void 0) { display = "block"; } + // isInitiallyVisible sets whether the element starts out visible. + this._isVisible = isInitiallyVisible; + this._isHidden = !this._isVisible; + this._display = display; + this._queue = []; + this._isAnimating = false; + } + Object.defineProperty(TransitionController.prototype, "_isReady", { + // Used to delay animations until we have an element to animate. + get: + // Used to delay animations until we have an element to animate. + function () { + return this._renderer != undefined && this._element != undefined && this._changeDetector != undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransitionController.prototype, "isAnimating", { + get: function () { + return this._isAnimating; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransitionController.prototype, "isVisible", { + get: function () { + return this._isVisible; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransitionController.prototype, "isHidden", { + get: function () { + return this._isHidden; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransitionController.prototype, "_queueFirst", { + // Gets the first transition in the queue. + get: + // Gets the first transition in the queue. + function () { + return this._queue[0]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransitionController.prototype, "_queueLast", { + // Gets the last transition in the queue. + get: + // Gets the last transition in the queue. + function () { + return this._queue[this._queue.length - 1]; + }, + enumerable: true, + configurable: true + }); + // Sets the renderer to be used for animating. + // Sets the renderer to be used for animating. + TransitionController.prototype.registerRenderer = + // Sets the renderer to be used for animating. + function (renderer) { + this._renderer = renderer; + this.performTransition(); + }; + // Sets the element to perform the animations on. + // Sets the element to perform the animations on. + TransitionController.prototype.registerElement = + // Sets the element to perform the animations on. + function (element) { + this._element = element; + this.performTransition(); + }; + // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. + // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. + TransitionController.prototype.registerChangeDetector = + // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. + function (changeDetector) { + this._changeDetector = changeDetector; + this.performTransition(); + }; + TransitionController.prototype.animate = function (transition) { + // Test if transition is one of the list that doesn't change the visible state. + // Should these eventually become classes? + var isDirectionless = ["jiggle", "flash", "shake", "pulse", "tada", "bounce"].indexOf(transition.type) !== -1; + if (isDirectionless) { + transition.direction = TransitionDirection.Static; + } + else if (transition.direction == undefined || transition.direction === TransitionDirection.Either) { + // Set the direction to the opposite of the current visible state automatically if not set, or set to either direction. + transition.direction = this._isVisible ? TransitionDirection.Out : TransitionDirection.In; + if (this._queueLast) { + // If there is an transition in the queue already, set the direction to the opposite of the direction of that transition. + if (this._queueLast.direction === TransitionDirection.In) { + transition.direction = TransitionDirection.Out; + } + else if (this._queueLast.direction === TransitionDirection.Out) { + transition.direction = TransitionDirection.In; + } + } + } + // Store the transition in the queue before attempting to perform it. + this._queue.push(transition); + this.performTransition(); + }; + TransitionController.prototype.performTransition = function () { + var _this = this; + if (!this._isReady || this._isAnimating || !this._queueFirst) { + // Don't transition until we are ready, or if we are animating, or if there aren't any transitions in the queue. + return; + } + this._isAnimating = true; + var transition = this._queueFirst; + // Set the Semantic UI classes for transitioning. + transition.classes.forEach(function (c) { return _this._renderer.addClass(_this._element, c); }); + this._renderer.addClass(this._element, "animating"); + this._renderer.addClass(this._element, transition.directionClass); + // Set the Semantic UI styles for transitioning. + this._renderer.setStyle(this._element, "animationDuration", transition.duration + "ms"); + this._renderer.setStyle(this._element, "display", this._display); + if (transition.direction === TransitionDirection.In) { + // Unset hidden if we are transitioning in. + this._isHidden = false; + } + // Wait the length of the animation before calling the complete callback. + this._animationTimeout = window.setTimeout(function () { return _this.finishTransition(transition); }, transition.duration); + }; + // Called when a transition has completed. + // Called when a transition has completed. + TransitionController.prototype.finishTransition = + // Called when a transition has completed. + function (transition) { + var _this = this; + // Unset the Semantic UI classes & styles for transitioning. + transition.classes.forEach(function (c) { return _this._renderer.removeClass(_this._element, c); }); + this._renderer.removeClass(this._element, "animating"); + this._renderer.removeClass(this._element, transition.directionClass); + this._renderer.removeStyle(this._element, "animationDuration"); + this._renderer.removeStyle(this._element, "display"); + if (transition.direction === TransitionDirection.In) { + // If we have just animated in, we are now visible. + this._isVisible = true; + } + else if (transition.direction === TransitionDirection.Out) { + // If we have transitioned out, we should be invisible and hidden. + this._isVisible = false; + this._isHidden = true; + } + if (transition.onComplete) { + // Call the user-defined transition callback. + transition.onComplete(); + } + // Delete the transition from the queue. + this._queue.shift(); + this._isAnimating = false; + this._changeDetector.markForCheck(); + // Immediately attempt to perform another transition. + this.performTransition(); + }; + // Stops the current transition, leaves the rest of the queue intact. + // Stops the current transition, leaves the rest of the queue intact. + TransitionController.prototype.stop = + // Stops the current transition, leaves the rest of the queue intact. + function (transition) { + if (transition === void 0) { transition = this._queueFirst; } + if (!transition || !this._isAnimating) { + return; + } + clearTimeout(this._animationTimeout); + this.finishTransition(transition); + }; + // Stops the current transition, and empties the queue. + // Stops the current transition, and empties the queue. + TransitionController.prototype.stopAll = + // Stops the current transition, and empties the queue. + function () { + this.clearQueue(); + this.stop(); + }; + // Empties the transition queue but carries on with the current transition. + // Empties the transition queue but carries on with the current transition. + TransitionController.prototype.clearQueue = + // Empties the transition queue but carries on with the current transition. + function () { + if (this.isAnimating) { + this._queue = [this._queueFirst]; + return; + } + this._queue = []; + }; + return TransitionController; +}()); +export { TransitionController }; +//# sourceMappingURL=transition-controller.js.map \ No newline at end of file diff --git a/dist/modules/transition/classes/transition-controller.js.map b/dist/modules/transition/classes/transition-controller.js.map new file mode 100644 index 000000000..86981b0ef --- /dev/null +++ b/dist/modules/transition/classes/transition-controller.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transition-controller.js","sourceRoot":"","sources":["../../../../src/modules/transition/classes/transition-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE/D,IAAA;IAmDI,8BAAY,kBAAiC,EAAE,OAAwB;QAA3D,mCAAA,EAAA,yBAAiC;QAAE,wBAAA,EAAA,iBAAwB;;QAEnE,IAAI,CAAC,UAAU,GAAG,kBAAkB,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;QAElC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAEjB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;KAC7B;IApDD,sBAAY,0CAAQ;QADpB,gEAAgE;;;QAChE;YACI,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,SAAS,IAAI,IAAI,CAAC,QAAQ,IAAI,SAAS,IAAI,IAAI,CAAC,eAAe,IAAI,SAAS,CAAC;SACzG;;;OAAA;IAUD,sBAAW,6CAAW;aAAtB;YACI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;SAC5B;;;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,WAAW,CAAC,CAAC;YACjC,MAAM,CAAC;SACV;QACD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;KACpB;+BAjML;IAkMC,CAAA;AA/LD,gCA+LC","sourcesContent":["import { Renderer2, ElementRef, ChangeDetectorRef } from \"@angular/core\";\nimport { Transition, TransitionDirection } from \"./transition\";\n\nexport class TransitionController {\n private _renderer:Renderer2;\n\n private _element:ElementRef;\n\n private _changeDetector:ChangeDetectorRef;\n\n // Used to delay animations until we have an element to animate.\n private get _isReady():boolean {\n return this._renderer != undefined && this._element != undefined && this._changeDetector != undefined;\n }\n\n // Sets the 'display' style when visible.\n private _display:string;\n\n // Stores queued transitions.\n private _queue:Transition[];\n\n private _isAnimating:boolean;\n\n public get isAnimating():boolean {\n return this._isAnimating;\n }\n\n // Set when the element is visible, and while it is transitioning out.\n private _isVisible:boolean;\n\n public get isVisible():boolean {\n return this._isVisible;\n }\n\n // Set when the element is hidden, and not while it is transitioning.\n private _isHidden:boolean;\n\n public get isHidden():boolean {\n return this._isHidden;\n }\n\n // Gets the first transition in the queue.\n private get _queueFirst():Transition {\n return this._queue[0];\n }\n\n // Gets the last transition in the queue.\n private get _queueLast():Transition {\n return this._queue[this._queue.length - 1];\n }\n\n // Stores the setTimeout pointer for cancelling the animation callback.\n private _animationTimeout:number;\n\n constructor(isInitiallyVisible:boolean = true, display:string = \"block\") {\n // isInitiallyVisible sets whether the element starts out visible.\n this._isVisible = isInitiallyVisible;\n this._isHidden = !this._isVisible;\n\n this._display = display;\n this._queue = [];\n\n this._isAnimating = false;\n }\n\n // Sets the renderer to be used for animating.\n public registerRenderer(renderer:Renderer2):void {\n this._renderer = renderer;\n this.performTransition();\n }\n\n // Sets the element to perform the animations on.\n public registerElement(element:ElementRef):void {\n this._element = element;\n this.performTransition();\n }\n\n // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush.\n public registerChangeDetector(changeDetector:ChangeDetectorRef):void {\n this._changeDetector = changeDetector;\n this.performTransition();\n }\n\n public animate(transition:Transition):void {\n // Test if transition is one of the list that doesn't change the visible state.\n // Should these eventually become classes?\n const isDirectionless = [\"jiggle\", \"flash\", \"shake\", \"pulse\", \"tada\", \"bounce\"].indexOf(transition.type) !== -1;\n if (isDirectionless) {\n transition.direction = TransitionDirection.Static;\n } else if (transition.direction == undefined || transition.direction === TransitionDirection.Either) {\n // Set the direction to the opposite of the current visible state automatically if not set, or set to either direction.\n transition.direction = this._isVisible ? TransitionDirection.Out : TransitionDirection.In;\n if (this._queueLast) {\n // If there is an transition in the queue already, set the direction to the opposite of the direction of that transition.\n if (this._queueLast.direction === TransitionDirection.In) {\n transition.direction = TransitionDirection.Out;\n } else if (this._queueLast.direction === TransitionDirection.Out) {\n transition.direction = TransitionDirection.In;\n }\n }\n }\n\n // Store the transition in the queue before attempting to perform it.\n this._queue.push(transition);\n\n this.performTransition();\n }\n\n private performTransition():void {\n if (!this._isReady || this._isAnimating || !this._queueFirst) {\n // Don't transition until we are ready, or if we are animating, or if there aren't any transitions in the queue.\n return;\n }\n\n this._isAnimating = true;\n\n const transition = this._queueFirst;\n\n // Set the Semantic UI classes for transitioning.\n transition.classes.forEach(c => this._renderer.addClass(this._element, c));\n this._renderer.addClass(this._element, `animating`);\n this._renderer.addClass(this._element, transition.directionClass);\n\n // Set the Semantic UI styles for transitioning.\n this._renderer.setStyle(this._element, `animationDuration`, `${transition.duration}ms`);\n this._renderer.setStyle(this._element, `display`, this._display);\n\n if (transition.direction === TransitionDirection.In) {\n // Unset hidden if we are transitioning in.\n this._isHidden = false;\n }\n\n // Wait the length of the animation before calling the complete callback.\n this._animationTimeout = window.setTimeout(() => this.finishTransition(transition), transition.duration);\n }\n\n // Called when a transition has completed.\n private finishTransition(transition:Transition):void {\n // Unset the Semantic UI classes & styles for transitioning.\n transition.classes.forEach(c => this._renderer.removeClass(this._element, c));\n this._renderer.removeClass(this._element, `animating`);\n this._renderer.removeClass(this._element, transition.directionClass);\n\n this._renderer.removeStyle(this._element, `animationDuration`);\n this._renderer.removeStyle(this._element, `display`);\n\n if (transition.direction === TransitionDirection.In) {\n // If we have just animated in, we are now visible.\n this._isVisible = true;\n } else if (transition.direction === TransitionDirection.Out) {\n // If we have transitioned out, we should be invisible and hidden.\n this._isVisible = false;\n this._isHidden = true;\n }\n\n if (transition.onComplete) {\n // Call the user-defined transition callback.\n transition.onComplete();\n }\n\n // Delete the transition from the queue.\n this._queue.shift();\n this._isAnimating = false;\n\n this._changeDetector.markForCheck();\n\n // Immediately attempt to perform another transition.\n this.performTransition();\n }\n\n // Stops the current transition, leaves the rest of the queue intact.\n public stop(transition:Transition = this._queueFirst):void {\n if (!transition || !this._isAnimating) {\n return;\n }\n\n clearTimeout(this._animationTimeout);\n this.finishTransition(transition);\n }\n\n // Stops the current transition, and empties the queue.\n public stopAll():void {\n this.clearQueue();\n this.stop();\n }\n\n // Empties the transition queue but carries on with the current transition.\n public clearQueue():void {\n if (this.isAnimating) {\n this._queue = [this._queueFirst];\n return;\n }\n this._queue = [];\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/transition/classes/transition-controller.metadata.json b/dist/modules/transition/classes/transition-controller.metadata.json new file mode 100644 index 000000000..dc140c21b --- /dev/null +++ b/dist/modules/transition/classes/transition-controller.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"TransitionController":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"boolean"},{"__symbolic":"reference","name":"string"}]}],"registerRenderer":[{"__symbolic":"method"}],"registerElement":[{"__symbolic":"method"}],"registerChangeDetector":[{"__symbolic":"method"}],"animate":[{"__symbolic":"method"}],"performTransition":[{"__symbolic":"method"}],"finishTransition":[{"__symbolic":"method"}],"stop":[{"__symbolic":"method"}],"stopAll":[{"__symbolic":"method"}],"clearQueue":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/transition/classes/transition.d.ts b/dist/modules/transition/classes/transition.d.ts new file mode 100644 index 000000000..f929d622c --- /dev/null +++ b/dist/modules/transition/classes/transition.d.ts @@ -0,0 +1,15 @@ +export declare enum TransitionDirection { + In = 0, + Out = 1, + Either = 2, + Static = 3, +} +export declare class Transition { + readonly type: string; + readonly duration: number; + direction: TransitionDirection; + readonly directionClass: string; + readonly classes: string[]; + onComplete: () => void; + constructor(name: string, duration?: number, direction?: TransitionDirection, onComplete?: (() => void)); +} diff --git a/dist/modules/transition/classes/transition.js b/dist/modules/transition/classes/transition.js new file mode 100644 index 000000000..34962f6b3 --- /dev/null +++ b/dist/modules/transition/classes/transition.js @@ -0,0 +1,41 @@ +// Possible directions for a transition. +// Possible directions for a transition. +export var TransitionDirection; +// Possible directions for a transition. +(function (TransitionDirection) { + TransitionDirection[TransitionDirection["In"] = 0] = "In"; + TransitionDirection[TransitionDirection["Out"] = 1] = "Out"; + TransitionDirection[TransitionDirection["Either"] = 2] = "Either"; + TransitionDirection[TransitionDirection["Static"] = 3] = "Static"; +})(TransitionDirection || (TransitionDirection = {})); +var Transition = /** @class */ (function () { + function Transition(name, duration, direction, onComplete) { + if (duration === void 0) { duration = 250; } + if (direction === void 0) { direction = TransitionDirection.Either; } + if (onComplete === void 0) { onComplete = function () { }; } + this.type = name; + // We set a minimum duration of 1ms, to give the appearance of an immediate transition + // whilst allowing positioning calculations to happen without a visible flicker. + this.duration = Math.max(duration, 1); + this.direction = direction; + this.classes = this.type.split(" "); + this.onComplete = onComplete; + } + Object.defineProperty(Transition.prototype, "directionClass", { + // Converts TransitionDirection to class name. + get: + // Converts TransitionDirection to class name. + function () { + switch (this.direction) { + case TransitionDirection.In: return "in"; + case TransitionDirection.Out: return "out"; + } + return ""; + }, + enumerable: true, + configurable: true + }); + return Transition; +}()); +export { Transition }; +//# sourceMappingURL=transition.js.map \ No newline at end of file diff --git a/dist/modules/transition/classes/transition.js.map b/dist/modules/transition/classes/transition.js.map new file mode 100644 index 000000000..0dd0fecf4 --- /dev/null +++ b/dist/modules/transition/classes/transition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transition.js","sourceRoot":"","sources":["../../../../src/modules/transition/classes/transition.ts"],"names":[],"mappings":"AAAA,wCAAwC;;AACxC,MAAM,CAAN,IAAY,mBAKX;;AALD,WAAY,mBAAmB;IAC3B,yDAAE,CAAA;IACF,2DAAG,CAAA;IACH,iEAAM,CAAA;IACN,iEAAM,CAAA;GAJE,mBAAmB,KAAnB,mBAAmB,QAK9B;AAED,IAAA;IAsBI,oBAAY,IAAW,EACX,QAAqB,EACrB,SAA0D,EAC1D,UAAkC;QAFlC,yBAAA,EAAA,cAAqB;QACrB,0BAAA,EAAA,YAAgC,mBAAmB,CAAC,MAAM;QAC1D,2BAAA,EAAA,4BAAkC;QAE1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;;;QAIjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAEtC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;KAChC;IA5BD,sBAAW,sCAAc;QADzB,8CAA8C;;;QAC9C;YACI,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;gBACrB,KAAK,mBAAmB,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC;gBACzC,KAAK,mBAAmB,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC;aAC9C;YAED,MAAM,CAAC,EAAE,CAAC;SACb;;;OAAA;qBAvBL;IA6CC,CAAA;AArCD,sBAqCC","sourcesContent":["// Possible directions for a transition.\nexport enum TransitionDirection {\n In,\n Out,\n Either,\n Static\n}\n\nexport class Transition {\n public readonly type:string;\n\n public readonly duration:number;\n\n public direction:TransitionDirection;\n\n // Converts TransitionDirection to class name.\n public get directionClass():string {\n switch (this.direction) {\n case TransitionDirection.In: return \"in\";\n case TransitionDirection.Out: return \"out\";\n }\n\n return \"\";\n }\n\n // Stores the individual classes for the transition, e.g. \"fade out\" -> [\"fade\", \"out\"].\n public readonly classes:string[];\n\n public onComplete:() => void;\n\n constructor(name:string,\n duration:number = 250,\n direction:TransitionDirection = TransitionDirection.Either,\n onComplete:(() => void) = () => {}) {\n\n this.type = name;\n\n // We set a minimum duration of 1ms, to give the appearance of an immediate transition\n // whilst allowing positioning calculations to happen without a visible flicker.\n this.duration = Math.max(duration, 1);\n\n this.direction = direction;\n this.classes = this.type.split(\" \");\n this.onComplete = onComplete;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/transition/classes/transition.metadata.json b/dist/modules/transition/classes/transition.metadata.json new file mode 100644 index 000000000..aa97bd2ab --- /dev/null +++ b/dist/modules/transition/classes/transition.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"TransitionDirection":{"In":0,"Out":1,"Either":2,"Static":3},"Transition":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"number"},{"__symbolic":"error","message":"Could not resolve type","line":32,"character":26,"context":{"typeName":"TransitionDirection"}},{"__symbolic":"error","message":"Expression form not supported","line":33,"character":27}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/transition/directives/transition.d.ts b/dist/modules/transition/directives/transition.d.ts new file mode 100644 index 000000000..a6a1b3e3f --- /dev/null +++ b/dist/modules/transition/directives/transition.d.ts @@ -0,0 +1,14 @@ +import { Renderer2, ElementRef, ChangeDetectorRef } from "@angular/core"; +import { TransitionController } from "../classes/transition-controller"; +export declare class SuiTransition { + private _renderer; + private _element; + private _changeDetector; + private _controller; + suiTransition: TransitionController; + transitionClass: boolean; + readonly isVisible: boolean; + readonly isHidden: boolean; + constructor(_renderer: Renderer2, _element: ElementRef, _changeDetector: ChangeDetectorRef); + setTransitionController(transitionController: TransitionController): void; +} diff --git a/dist/modules/transition/directives/transition.js b/dist/modules/transition/directives/transition.js new file mode 100644 index 000000000..b98758b2a --- /dev/null +++ b/dist/modules/transition/directives/transition.js @@ -0,0 +1,69 @@ +import { Renderer2, ElementRef, Directive, Input, HostBinding, ChangeDetectorRef } from "@angular/core"; +import { TransitionController } from "../classes/transition-controller"; +var SuiTransition = /** @class */ (function () { + function SuiTransition(_renderer, _element, _changeDetector) { + this._renderer = _renderer; + this._element = _element; + this._changeDetector = _changeDetector; + this.transitionClass = true; + } + Object.defineProperty(SuiTransition.prototype, "suiTransition", { + set: function (tC) { + // Set the transition controller (e.g. '
'). + this.setTransitionController(tC); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiTransition.prototype, "isVisible", { + get: function () { + if (this._controller) { + return this._controller.isVisible; + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SuiTransition.prototype, "isHidden", { + get: function () { + if (this._controller) { + return this._controller.isHidden; + } + return false; + }, + enumerable: true, + configurable: true + }); + // Initialises the controller with the injected renderer and elementRef. + // Initialises the controller with the injected renderer and elementRef. + SuiTransition.prototype.setTransitionController = + // Initialises the controller with the injected renderer and elementRef. + function (transitionController) { + this._controller = transitionController; + this._controller.registerRenderer(this._renderer); + this._controller.registerElement(this._element.nativeElement); + this._controller.registerChangeDetector(this._changeDetector); + }; + SuiTransition.decorators = [ + { type: Directive, args: [{ + selector: "[suiTransition]", + exportAs: "transition" + },] }, + ]; + /** @nocollapse */ + SuiTransition.ctorParameters = function () { return [ + { type: Renderer2, }, + { type: ElementRef, }, + { type: ChangeDetectorRef, }, + ]; }; + SuiTransition.propDecorators = { + "suiTransition": [{ type: Input },], + "transitionClass": [{ type: HostBinding, args: ["class.transition",] },], + "isVisible": [{ type: HostBinding, args: ["class.visible",] },], + "isHidden": [{ type: HostBinding, args: ["class.hidden",] },], + }; + return SuiTransition; +}()); +export { SuiTransition }; +//# sourceMappingURL=transition.js.map \ No newline at end of file diff --git a/dist/modules/transition/directives/transition.js.map b/dist/modules/transition/directives/transition.js.map new file mode 100644 index 000000000..ec72c86b2 --- /dev/null +++ b/dist/modules/transition/directives/transition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transition.js","sourceRoot":"","sources":["../../../../src/modules/transition/directives/transition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACxG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;;IAmCpE,uBAAoB,SAAmB,EAAU,QAAmB,EAAU,eAAiC;QAA3F,cAAS,GAAT,SAAS,CAAU;QAAU,aAAQ,GAAR,QAAQ,CAAW;QAAU,oBAAe,GAAf,eAAe,CAAkB;+BAlB9E,IAAI;KAkB8E;0BAxBxG,wCAAa;uBAAC,EAAuB;;YAE5C,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;;;;;0BAO1B,oCAAS;;YAChB,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;gBACnB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;aACrC;YACD,MAAM,CAAC,KAAK,CAAC;;;;;0BAIN,mCAAQ;;YACf,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;gBACnB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;aACpC;YACD,MAAM,CAAC,KAAK,CAAC;;;;;IAKjB,wEAAwE;;IACjE,+CAAuB;;IAA9B,UAA+B,oBAAyC;QACpE,IAAI,CAAC,WAAW,GAAG,oBAAoB,CAAC;QACxC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAC9D,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACjE;;gBAzCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,iBAAiB;oBAC3B,QAAQ,EAAE,YAAY;iBACzB;;;;gBANQ,SAAS;gBAAE,UAAU;gBAAiC,iBAAiB;;;kCAW3E,KAAK;oCAML,WAAW,SAAC,kBAAkB;8BAG9B,WAAW,SAAC,eAAe;6BAQ3B,WAAW,SAAC,cAAc;;wBA5B/B;;SAOa,aAAa","sourcesContent":["import { Renderer2, ElementRef, Directive, Input, HostBinding, ChangeDetectorRef } from \"@angular/core\";\nimport { TransitionController } from \"../classes/transition-controller\";\n\n@Directive({\n selector: \"[suiTransition]\",\n exportAs: \"transition\"\n})\nexport class SuiTransition {\n // Each transition must have a controller associated that dispatches the transitions.\n private _controller:TransitionController;\n\n @Input()\n public set suiTransition(tC:TransitionController) {\n // Set the transition controller (e.g. '
').\n this.setTransitionController(tC);\n }\n\n @HostBinding(\"class.transition\")\n public transitionClass:boolean = true;\n\n @HostBinding(\"class.visible\")\n public get isVisible():boolean {\n if (this._controller) {\n return this._controller.isVisible;\n }\n return false;\n }\n\n @HostBinding(\"class.hidden\")\n public get isHidden():boolean {\n if (this._controller) {\n return this._controller.isHidden;\n }\n return false;\n }\n\n constructor(private _renderer:Renderer2, private _element:ElementRef, private _changeDetector:ChangeDetectorRef) {}\n\n // Initialises the controller with the injected renderer and elementRef.\n public setTransitionController(transitionController:TransitionController):void {\n this._controller = transitionController;\n this._controller.registerRenderer(this._renderer);\n this._controller.registerElement(this._element.nativeElement);\n this._controller.registerChangeDetector(this._changeDetector);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/transition/directives/transition.metadata.json b/dist/modules/transition/directives/transition.metadata.json new file mode 100644 index 000000000..fadfa961a --- /dev/null +++ b/dist/modules/transition/directives/transition.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiTransition":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":3,"character":1},"arguments":[{"selector":"[suiTransition]","exportAs":"transition"}]}],"members":{"suiTransition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":5}}]}],"transitionClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":17,"character":5},"arguments":["class.transition"]}]}],"isVisible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":20,"character":5},"arguments":["class.visible"]}]}],"isHidden":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":28,"character":5},"arguments":["class.hidden"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":36,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":36,"character":62},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":36,"character":98}]}],"setTransitionController":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/transition/index.d.ts b/dist/modules/transition/index.d.ts new file mode 100644 index 000000000..564d46c40 --- /dev/null +++ b/dist/modules/transition/index.d.ts @@ -0,0 +1,4 @@ +export * from "./classes/transition-controller"; +export * from "./classes/transition"; +export * from "./directives/transition"; +export * from "./transition.module"; diff --git a/dist/modules/transition/index.js b/dist/modules/transition/index.js new file mode 100644 index 000000000..3c6709cac --- /dev/null +++ b/dist/modules/transition/index.js @@ -0,0 +1,5 @@ +export * from "./classes/transition-controller"; +export * from "./classes/transition"; +export * from "./directives/transition"; +export * from "./transition.module"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/transition/index.js.map b/dist/modules/transition/index.js.map new file mode 100644 index 000000000..2f6f147c2 --- /dev/null +++ b/dist/modules/transition/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/transition/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC;AAErC,cAAc,yBAAyB,CAAC;AAExC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./classes/transition-controller\";\nexport * from \"./classes/transition\";\n\nexport * from \"./directives/transition\";\n\nexport * from \"./transition.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/transition/index.metadata.json b/dist/modules/transition/index.metadata.json new file mode 100644 index 000000000..8fda5c2cb --- /dev/null +++ b/dist/modules/transition/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/transition-controller"},{"from":"./classes/transition"},{"from":"./directives/transition"},{"from":"./transition.module"}]}] \ No newline at end of file diff --git a/dist/modules/transition/public.d.ts b/dist/modules/transition/public.d.ts new file mode 100644 index 000000000..dbdee865f --- /dev/null +++ b/dist/modules/transition/public.d.ts @@ -0,0 +1 @@ +export { SuiTransitionModule, SuiTransition, Transition, TransitionDirection, TransitionController } from "./index"; diff --git a/dist/modules/transition/public.js b/dist/modules/transition/public.js new file mode 100644 index 000000000..70da82a4c --- /dev/null +++ b/dist/modules/transition/public.js @@ -0,0 +1,2 @@ +export { SuiTransitionModule, SuiTransition, Transition, TransitionDirection, TransitionController } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/transition/public.js.map b/dist/modules/transition/public.js.map new file mode 100644 index 000000000..37f73de4f --- /dev/null +++ b/dist/modules/transition/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/transition/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACvB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiTransitionModule,\n SuiTransition,\n Transition,\n TransitionDirection,\n TransitionController\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/transition/public.metadata.json b/dist/modules/transition/public.metadata.json new file mode 100644 index 000000000..6ab6c1133 --- /dev/null +++ b/dist/modules/transition/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiTransitionModule","SuiTransition","Transition","TransitionDirection","TransitionController"]}]}] \ No newline at end of file diff --git a/dist/modules/transition/transition.module.d.ts b/dist/modules/transition/transition.module.d.ts new file mode 100644 index 000000000..e58b2743b --- /dev/null +++ b/dist/modules/transition/transition.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiTransitionModule { +} diff --git a/dist/modules/transition/transition.module.js b/dist/modules/transition/transition.module.js new file mode 100644 index 000000000..d4d96919f --- /dev/null +++ b/dist/modules/transition/transition.module.js @@ -0,0 +1,24 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SuiTransition } from "./directives/transition"; +var SuiTransitionModule = /** @class */ (function () { + function SuiTransitionModule() { + } + SuiTransitionModule.decorators = [ + { type: NgModule, args: [{ + imports: [CommonModule], + declarations: [ + SuiTransition + ], + exports: [ + SuiTransition + ], + providers: [] + },] }, + ]; + /** @nocollapse */ + SuiTransitionModule.ctorParameters = function () { return []; }; + return SuiTransitionModule; +}()); +export { SuiTransitionModule }; +//# sourceMappingURL=transition.module.js.map \ No newline at end of file diff --git a/dist/modules/transition/transition.module.js.map b/dist/modules/transition/transition.module.js.map new file mode 100644 index 000000000..da40bc625 --- /dev/null +++ b/dist/modules/transition/transition.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transition.module.js","sourceRoot":"","sources":["../../../src/modules/transition/transition.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;;;;;gBAEvD,QAAQ,SAAC;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE;wBACV,aAAa;qBAChB;oBACD,OAAO,EAAE;wBACL,aAAa;qBAChB;oBACD,SAAS,EAAE,EAAE;iBAChB;;;;8BAbD;;SAca,mBAAmB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTransition } from \"./directives/transition\";\n\n@NgModule({\n imports: [CommonModule],\n declarations: [\n SuiTransition\n ],\n exports: [\n SuiTransition\n ],\n providers: []\n})\nexport class SuiTransitionModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/transition/transition.module.metadata.json b/dist/modules/transition/transition.module.metadata.json new file mode 100644 index 000000000..eda687d63 --- /dev/null +++ b/dist/modules/transition/transition.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiTransitionModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":5,"character":14}],"declarations":[{"__symbolic":"reference","module":"./directives/transition","name":"SuiTransition","line":7,"character":8}],"exports":[{"__symbolic":"reference","module":"./directives/transition","name":"SuiTransition","line":10,"character":8}],"providers":[]}]}]}}}] \ No newline at end of file diff --git a/dist/public.d.ts b/dist/public.d.ts new file mode 100644 index 000000000..e829d9267 --- /dev/null +++ b/dist/public.d.ts @@ -0,0 +1,5 @@ +export * from "./behaviors/public"; +export * from "./collections/public"; +export * from "./modules/public"; +export * from "./misc/public"; +export { SuiModule } from "./index"; diff --git a/dist/public.js b/dist/public.js new file mode 100644 index 000000000..f1815b7e9 --- /dev/null +++ b/dist/public.js @@ -0,0 +1,6 @@ +export * from "./behaviors/public"; +export * from "./collections/public"; +export * from "./modules/public"; +export * from "./misc/public"; +export { SuiModule } from "./index"; +//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/public.js.map b/dist/public.js.map new file mode 100644 index 000000000..d13fee553 --- /dev/null +++ b/dist/public.js.map @@ -0,0 +1 @@ +{"version":3,"file":"public.js","sourceRoot":"","sources":["../src/public.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export * from \"./behaviors/public\";\nexport * from \"./collections/public\";\nexport * from \"./modules/public\";\n\nexport * from \"./misc/public\";\nexport { SuiModule } from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/public.metadata.json b/dist/public.metadata.json new file mode 100644 index 000000000..ab9538389 --- /dev/null +++ b/dist/public.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./behaviors/public"},{"from":"./collections/public"},{"from":"./modules/public"},{"from":"./misc/public"},{"from":"./index","export":["SuiModule"]}]}] \ No newline at end of file diff --git a/dist/sui.module.d.ts b/dist/sui.module.d.ts new file mode 100644 index 000000000..c9191ff6d --- /dev/null +++ b/dist/sui.module.d.ts @@ -0,0 +1,2 @@ +export declare class SuiModule { +} diff --git a/dist/sui.module.js b/dist/sui.module.js new file mode 100644 index 000000000..22b57f711 --- /dev/null +++ b/dist/sui.module.js @@ -0,0 +1,39 @@ +import { NgModule } from "@angular/core"; +import { SuiMessageModule, SuiPaginationModule } from "./collections"; +import { SuiAccordionModule, SuiCheckboxModule, SuiCollapseModule, SuiDatepickerModule, SuiDimmerModule, SuiDropdownModule, SuiModalModule, SuiPopupModule, SuiProgressModule, SuiRatingModule, SuiSearchModule, SuiSidebarModule, SuiTabsModule, SuiSelectModule, SuiTransitionModule } from "./modules"; +import { SuiLocalizationModule } from "./behaviors"; +import { SuiUtilityModule } from "./misc"; +var SuiModule = /** @class */ (function () { + function SuiModule() { + } + SuiModule.decorators = [ + { type: NgModule, args: [{ + exports: [ + SuiMessageModule, + SuiPaginationModule, + SuiAccordionModule, + SuiCheckboxModule, + SuiCollapseModule, + SuiDatepickerModule, + SuiDimmerModule, + SuiDropdownModule, + SuiModalModule, + SuiPopupModule, + SuiProgressModule, + SuiRatingModule, + SuiSearchModule, + SuiSelectModule, + SuiSidebarModule, + SuiTabsModule, + SuiTransitionModule, + SuiLocalizationModule, + SuiUtilityModule + ] + },] }, + ]; + /** @nocollapse */ + SuiModule.ctorParameters = function () { return []; }; + return SuiModule; +}()); +export { SuiModule }; +//# sourceMappingURL=sui.module.js.map \ No newline at end of file diff --git a/dist/sui.module.js.map b/dist/sui.module.js.map new file mode 100644 index 000000000..efcbfc6e4 --- /dev/null +++ b/dist/sui.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sui.module.js","sourceRoot":"","sources":["../src/sui.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACtB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACH,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,mBAAmB,EACtB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACH,qBAAqB,EACxB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACH,gBAAgB,EACnB,MAAM,QAAQ,CAAC;;;;;gBAEf,QAAQ,SAAC;oBACN,OAAO,EAAE;wBAEL,gBAAgB;wBAChB,mBAAmB;wBAGnB,kBAAkB;wBAClB,iBAAiB;wBACjB,iBAAiB;wBACjB,mBAAmB;wBACnB,eAAe;wBACf,iBAAiB;wBACjB,cAAc;wBACd,cAAc;wBACd,iBAAiB;wBACjB,eAAe;wBACf,eAAe;wBACf,eAAe;wBACf,gBAAgB;wBAChB,aAAa;wBACb,mBAAmB;wBAGnB,qBAAqB;wBAGrB,gBAAgB;qBACnB;iBACJ;;;;oBAlED;;SAmEa,SAAS","sourcesContent":["import { NgModule } from \"@angular/core\";\n\n// Collections\nimport {\n SuiMessageModule,\n SuiPaginationModule\n} from \"./collections\";\n\n// Modules\nimport {\n SuiAccordionModule,\n SuiCheckboxModule,\n SuiCollapseModule,\n SuiDatepickerModule,\n SuiDimmerModule,\n SuiDropdownModule,\n SuiModalModule,\n SuiPopupModule,\n SuiProgressModule,\n SuiRatingModule,\n SuiSearchModule,\n SuiSidebarModule,\n SuiTabsModule,\n SuiSelectModule,\n SuiTransitionModule\n} from \"./modules\";\n\n// Behaviors\nimport {\n SuiLocalizationModule\n} from \"./behaviors\";\n\n// Misc\nimport {\n SuiUtilityModule\n} from \"./misc\";\n\n@NgModule({\n exports: [\n // Collections\n SuiMessageModule,\n SuiPaginationModule,\n\n // Modules\n SuiAccordionModule,\n SuiCheckboxModule,\n SuiCollapseModule,\n SuiDatepickerModule,\n SuiDimmerModule,\n SuiDropdownModule,\n SuiModalModule,\n SuiPopupModule,\n SuiProgressModule,\n SuiRatingModule,\n SuiSearchModule,\n SuiSelectModule,\n SuiSidebarModule,\n SuiTabsModule,\n SuiTransitionModule,\n\n // Behaviors\n SuiLocalizationModule,\n\n // Misc\n SuiUtilityModule\n ]\n})\nexport class SuiModule {}\n"]} \ No newline at end of file diff --git a/dist/sui.module.metadata.json b/dist/sui.module.metadata.json new file mode 100644 index 000000000..61fa97650 --- /dev/null +++ b/dist/sui.module.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":4,"metadata":{"SuiModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":37,"character":1},"arguments":[{"exports":[{"__symbolic":"reference","module":"./collections","name":"SuiMessageModule","line":40,"character":8},{"__symbolic":"reference","module":"./collections","name":"SuiPaginationModule","line":41,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiAccordionModule","line":44,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiCheckboxModule","line":45,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiCollapseModule","line":46,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiDatepickerModule","line":47,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiDimmerModule","line":48,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiDropdownModule","line":49,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiModalModule","line":50,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiPopupModule","line":51,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiProgressModule","line":52,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiRatingModule","line":53,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiSearchModule","line":54,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiSelectModule","line":55,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiSidebarModule","line":56,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiTabsModule","line":57,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiTransitionModule","line":58,"character":8},{"__symbolic":"reference","module":"./behaviors","name":"SuiLocalizationModule","line":61,"character":8},{"__symbolic":"reference","module":"./misc","name":"SuiUtilityModule","line":64,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/locales/de.d.ts b/locales/de.d.ts new file mode 100644 index 000000000..591ccb4da --- /dev/null +++ b/locales/de.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../dist"; +/** + * locale : German (de) + * author : Ciara Ward : https://github.com/ciaraward + */ +declare const de: IPartialLocaleValues; +export default de; diff --git a/locales/de.js b/locales/de.js new file mode 100644 index 000000000..e8ab71aa3 --- /dev/null +++ b/locales/de.js @@ -0,0 +1,51 @@ +/** + * locale : German (de) + * author : Ciara Ward : https://github.com/ciaraward + */ +var de = { + datepicker: { + months: [ + "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember" + ], + monthsShort: [ + "Jan", "Febr", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez" + ], + weekdays: [ + "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" + ], + weekdaysShort: [ + "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" + ], + weekdaysNarrow: [ + "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" + ], + formats: { + time: "HH:mm", + datetime: "D. MMMM YYYY HH:mm", + date: "D. MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Suchen...", + noResults: { + header: "Keine Ergebnisse", + message: "Ihre Suche ergab keine Ergebnisse." + } + }, + select: { + noResultsMessage: "Keine Ergebnisse", + single: { + placeholder: "Eintrag auswählen..." + }, + multi: { + placeholder: "Einträge auswählen...", + maxSelectedMessage: "Höchstens #{max} Einträge", + selectedMessage: "#{count} Einträge ausgewählt" + } + } +}; +export default de; +//# sourceMappingURL=de.js.map \ No newline at end of file diff --git a/locales/de.js.map b/locales/de.js.map new file mode 100644 index 000000000..d57b05467 --- /dev/null +++ b/locales/de.js.map @@ -0,0 +1 @@ +{"version":3,"file":"de.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/de.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SACxH;QACD,WAAW,EAAE;YACT,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACtF;QACD,QAAQ,EAAE;YACN,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS;SAClF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,cAAc,EAAE;YACZ,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,oBAAoB;YAC9B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,OAAO,EAAE,oCAAoC;SAChD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,kBAAkB;QACpC,MAAM,EAAE;YACJ,WAAW,EAAE,sBAAsB;SACtC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,uBAAuB;YACpC,kBAAkB,EAAE,2BAA2B;YAC/C,eAAe,EAAE,8BAA8B;SAClD;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : German (de)\n * author : Ciara Ward : https://github.com/ciaraward\n */\n\nconst de:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"\n ],\n monthsShort: [\n \"Jan\", \"Febr\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"\n ],\n weekdays: [\n \"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"\n ],\n weekdaysShort: [\n \"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"\n ],\n weekdaysNarrow: [\n \"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D. MMMM YYYY HH:mm\",\n date: \"D. MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Suchen...\",\n noResults: {\n header: \"Keine Ergebnisse\",\n message: \"Ihre Suche ergab keine Ergebnisse.\"\n }\n },\n select: {\n noResultsMessage: \"Keine Ergebnisse\",\n single: {\n placeholder: \"Eintrag auswählen...\"\n },\n multi: {\n placeholder: \"Einträge auswählen...\",\n maxSelectedMessage: \"Höchstens #{max} Einträge\",\n selectedMessage: \"#{count} Einträge ausgewählt\"\n }\n }\n};\n\nexport default de;\n"]} \ No newline at end of file diff --git a/locales/en-AU.d.ts b/locales/en-AU.d.ts new file mode 100644 index 000000000..c12e3c047 --- /dev/null +++ b/locales/en-AU.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../dist"; +/** + * locale : Australian (en-AU) + * author : Trevor Daniels : https://github.com/trevordaniels + */ +declare const enAU: IPartialLocaleValues; +export default enAU; diff --git a/locales/en-AU.js b/locales/en-AU.js new file mode 100644 index 000000000..573b2c8e4 --- /dev/null +++ b/locales/en-AU.js @@ -0,0 +1,11 @@ +/** + * locale : Australian (en-AU) + * author : Trevor Daniels : https://github.com/trevordaniels + */ +var enAU = { + datepicker: { + firstDayOfWeek: 0 + } +}; +export default enAU; +//# sourceMappingURL=en-AU.js.map \ No newline at end of file diff --git a/locales/en-AU.js.map b/locales/en-AU.js.map new file mode 100644 index 000000000..d4565d579 --- /dev/null +++ b/locales/en-AU.js.map @@ -0,0 +1 @@ +{"version":3,"file":"en-AU.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-AU.ts"],"names":[],"mappings":";;;;AAOA,IAAM,IAAI,GAAwB;IAC9B,UAAU,EAAE;QACR,cAAc,EAAE,CAAC;KACpB;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Australian (en-AU)\n * author : Trevor Daniels : https://github.com/trevordaniels\n */\n\nconst enAU:IPartialLocaleValues = {\n datepicker: {\n firstDayOfWeek: 0\n }\n};\n\nexport default enAU;\n"]} \ No newline at end of file diff --git a/locales/en-GB.d.ts b/locales/en-GB.d.ts new file mode 100644 index 000000000..498f120c9 --- /dev/null +++ b/locales/en-GB.d.ts @@ -0,0 +1,3 @@ +import { ILocaleValues } from "../dist"; +declare const enGB: ILocaleValues; +export default enGB; diff --git a/locales/en-GB.js b/locales/en-GB.js new file mode 100644 index 000000000..e78f0f4e9 --- /dev/null +++ b/locales/en-GB.js @@ -0,0 +1,56 @@ +var enGB = { + datepicker: { + months: [ + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + ], + monthsShort: [ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + ], + weekdays: [ + "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" + ], + weekdaysShort: [ + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + ], + weekdaysNarrow: [ + "S", "M", "T", "W", "T", "F", "S" + ], + timesOfDay: [ + "a.m.", "p.m." + ], + timesOfDayUppercase: [ + "AM", "PM" + ], + timesOfDayLowercase: [ + "am", "pm" + ], + formats: { + time: "h:mm A", + datetime: "D MMMM YYYY h:mm A", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Search...", + noResults: { + header: "No Results", + message: "Your search returned no results." + } + }, + select: { + noResultsMessage: "No results", + single: { + placeholder: "Select one" + }, + multi: { + placeholder: "Select...", + maxSelectedMessage: "Max #{max} selections", + selectedMessage: "#{count} selections" + } + } +}; +export default enGB; +//# sourceMappingURL=en-GB.js.map \ No newline at end of file diff --git a/locales/en-GB.js.map b/locales/en-GB.js.map new file mode 100644 index 000000000..0dff648ce --- /dev/null +++ b/locales/en-GB.js.map @@ -0,0 +1 @@ +{"version":3,"file":"en-GB.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-GB.ts"],"names":[],"mappings":"AAEA,IAAM,IAAI,GAAiB;IACvB,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SAC3H;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU;SAC/E;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,UAAU,EAAE;YACR,MAAM,EAAE,MAAM;SACjB;QACD,mBAAmB,EAAE;YACjB,IAAI,EAAE,IAAI;SACb;QACD,mBAAmB,EAAE;YACjB,IAAI,EAAE,IAAI;SACb;QACD,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,oBAAoB;YAC9B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE;YACP,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,kCAAkC;SAC9C;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,YAAY;QAC9B,MAAM,EAAE;YACJ,WAAW,EAAE,YAAY;SAC5B;QACD,KAAK,EAAE;YACH,WAAW,EAAE,WAAW;YACxB,kBAAkB,EAAE,uBAAuB;YAC3C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { ILocaleValues } from \"../interfaces/values\";\n\nconst enGB:ILocaleValues = {\n datepicker: {\n months: [\n \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"\n ],\n monthsShort: [\n \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"\n ],\n weekdays: [\n \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"\n ],\n weekdaysShort: [\n \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"\n ],\n weekdaysNarrow: [\n \"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"\n ],\n timesOfDay: [\n \"a.m.\", \"p.m.\"\n ],\n timesOfDayUppercase: [\n \"AM\", \"PM\"\n ],\n timesOfDayLowercase: [\n \"am\", \"pm\"\n ],\n formats: {\n time: \"h:mm A\",\n datetime: \"D MMMM YYYY h:mm A\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Search...\",\n noResults: {\n header: \"No Results\",\n message: \"Your search returned no results.\"\n }\n },\n select: {\n noResultsMessage: \"No results\",\n single: {\n placeholder: \"Select one\"\n },\n multi: {\n placeholder: \"Select...\",\n maxSelectedMessage: \"Max #{max} selections\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default enGB;\n"]} \ No newline at end of file diff --git a/locales/en-US.d.ts b/locales/en-US.d.ts new file mode 100644 index 000000000..71757c935 --- /dev/null +++ b/locales/en-US.d.ts @@ -0,0 +1,3 @@ +import { IPartialLocaleValues } from "../dist"; +declare const enUS: IPartialLocaleValues; +export default enUS; diff --git a/locales/en-US.js b/locales/en-US.js new file mode 100644 index 000000000..3c00b6edd --- /dev/null +++ b/locales/en-US.js @@ -0,0 +1,14 @@ +var enUS = { + datepicker: { + firstDayOfWeek: 0, + formats: { + time: "h:mm A", + datetime: "MMMM D, YYYY h:mm A", + date: "MMMM D, YYYY", + month: "MMMM YYYY", + year: "YYYY" + } + } +}; +export default enUS; +//# sourceMappingURL=en-US.js.map \ No newline at end of file diff --git a/locales/en-US.js.map b/locales/en-US.js.map new file mode 100644 index 000000000..0c0a0d507 --- /dev/null +++ b/locales/en-US.js.map @@ -0,0 +1 @@ +{"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-US.ts"],"names":[],"mappings":"AAEA,IAAM,IAAI,GAAwB;IAC9B,UAAU,EAAE;QACR,cAAc,EAAE,CAAC;QACjB,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,qBAAqB;YAC/B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\nconst enUS:IPartialLocaleValues = {\n datepicker: {\n firstDayOfWeek: 0,\n formats: {\n time: \"h:mm A\",\n datetime: \"MMMM D, YYYY h:mm A\",\n date: \"MMMM D, YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n }\n }\n};\n\nexport default enUS;\n"]} \ No newline at end of file diff --git a/locales/es.d.ts b/locales/es.d.ts new file mode 100644 index 000000000..26dbd33c6 --- /dev/null +++ b/locales/es.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../dist"; +/** + * locale : Spanish (es) + * author : Facundo Donato : https://github.com/genuinefafa + */ +declare const es: IPartialLocaleValues; +export default es; diff --git a/locales/es.js b/locales/es.js new file mode 100644 index 000000000..9916a4d14 --- /dev/null +++ b/locales/es.js @@ -0,0 +1,51 @@ +/** + * locale : Spanish (es) + * author : Facundo Donato : https://github.com/genuinefafa + */ +var es = { + datepicker: { + months: [ + "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" + ], + monthsShort: [ + "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic" + ], + weekdays: [ + "Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado" + ], + weekdaysShort: [ + "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb" + ], + weekdaysNarrow: [ + "D", "L", "M", "M", "J", "V", "S" + ], + formats: { + time: "HH:mm", + datetime: "D [de] MMMM [de] YYYY HH:mm", + date: "D [de] MMMM [de] YYYY", + month: "MMMM [de] YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Buscar...", + noResults: { + header: "Sin resultados", + message: "La búsqueda no obtuvo resultados." + } + }, + select: { + noResultsMessage: "Sin resultados", + single: { + placeholder: "Seleccione uno" + }, + multi: { + placeholder: "Seleccione...", + maxSelectedMessage: "Puede elegir hasta #{max}", + selectedMessage: "Seleccionados #{count}" + } + } +}; +export default es; +//# sourceMappingURL=es.js.map \ No newline at end of file diff --git a/locales/es.js.map b/locales/es.js.map new file mode 100644 index 000000000..c1e823e1a --- /dev/null +++ b/locales/es.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/es.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW;SAC9H;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;SAC3E;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,6BAA6B;YACvC,IAAI,EAAE,uBAAuB;YAC7B,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE;YACP,MAAM,EAAE,gBAAgB;YACxB,OAAO,EAAE,mCAAmC;SAC/C;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,gBAAgB;QAClC,MAAM,EAAE;YACJ,WAAW,EAAE,gBAAgB;SAChC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,eAAe;YAC5B,kBAAkB,EAAE,2BAA2B;YAC/C,eAAe,EAAE,wBAAwB;SAC5C;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Spanish (es)\n * author : Facundo Donato : https://github.com/genuinefafa\n */\n\nconst es:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"\n ],\n monthsShort: [\n \"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"\n ],\n weekdays: [\n \"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"\n ],\n weekdaysShort: [\n \"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"\n ],\n weekdaysNarrow: [\n \"D\", \"L\", \"M\", \"M\", \"J\", \"V\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D [de] MMMM [de] YYYY HH:mm\",\n date: \"D [de] MMMM [de] YYYY\",\n month: \"MMMM [de] YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Buscar...\",\n noResults: {\n header: \"Sin resultados\",\n message: \"La búsqueda no obtuvo resultados.\"\n }\n },\n select: {\n noResultsMessage: \"Sin resultados\",\n single: {\n placeholder: \"Seleccione uno\"\n },\n multi: {\n placeholder: \"Seleccione...\",\n maxSelectedMessage: \"Puede elegir hasta #{max}\",\n selectedMessage: \"Seleccionados #{count}\"\n }\n }\n};\n\nexport default es;\n"]} \ No newline at end of file diff --git a/locales/fr.d.ts b/locales/fr.d.ts new file mode 100644 index 000000000..21c08462f --- /dev/null +++ b/locales/fr.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../dist"; +/** + * locale : French (fr) + * author : Ciara Ward : https://github.com/ciaraward + */ +declare const fr: IPartialLocaleValues; +export default fr; diff --git a/locales/fr.js b/locales/fr.js new file mode 100644 index 000000000..aca0e7c5a --- /dev/null +++ b/locales/fr.js @@ -0,0 +1,51 @@ +/** + * locale : French (fr) + * author : Ciara Ward : https://github.com/ciaraward + */ +var fr = { + datepicker: { + months: [ + "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" + ], + monthsShort: [ + "Janv", "Févr", "Mars", "Avr", "Mai", "Juin", "Juil", "Août", "Sept", "Oct", "Nov", "Déc" + ], + weekdays: [ + "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" + ], + weekdaysShort: [ + "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" + ], + weekdaysNarrow: [ + "Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM YYYY HH:mm", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Cherche...", + noResults: { + header: "Aucun Résultats", + message: "Votre recherche n'a pas donné de résultats." + } + }, + select: { + noResultsMessage: "Aucun résultats", + single: { + placeholder: "Choisissez-en un" + }, + multi: { + placeholder: "Choisissez-en...", + maxSelectedMessage: "Max #{max} sélections", + selectedMessage: "#{count} selections" + } + } +}; +export default fr; +//# sourceMappingURL=fr.js.map \ No newline at end of file diff --git a/locales/fr.js.map b/locales/fr.js.map new file mode 100644 index 000000000..d7c77ffd4 --- /dev/null +++ b/locales/fr.js.map @@ -0,0 +1 @@ +{"version":3,"file":"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uB;YAC3C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : French (fr)\n * author : Ciara Ward : https://github.com/ciaraward\n */\n\nconst fr:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"\n ],\n monthsShort: [\n \"Janv\", \"Févr\", \"Mars\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Août\", \"Sept\", \"Oct\", \"Nov\", \"Déc\"\n ],\n weekdays: [\n \"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"\n ],\n weekdaysShort: [\n \"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"\n ],\n weekdaysNarrow: [\n \"Di\", \"Lu\", \"Ma\", \"Me\", \"Je\", \"Ve\", \"Sa\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Cherche...\",\n noResults: {\n header: \"Aucun Résultats\",\n message: \"Votre recherche n'a pas donné de résultats.\"\n }\n },\n select: {\n noResultsMessage: \"Aucun résultats\",\n single: {\n placeholder: \"Choisissez-en un\"\n },\n multi: {\n placeholder: \"Choisissez-en...\",\n maxSelectedMessage: \"Max #{max} sélections\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default fr;\n"]} \ No newline at end of file diff --git a/locales/ge.d.ts b/locales/ge.d.ts new file mode 100644 index 000000000..f01ce2b9f --- /dev/null +++ b/locales/ge.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../dist"; +/** + * locale : Georgian (ge) + * author : Vaso Gazdeliani : https://github.com/vaso991 + */ +declare const ge: IPartialLocaleValues; +export default ge; diff --git a/locales/ge.js b/locales/ge.js new file mode 100644 index 000000000..84c947903 --- /dev/null +++ b/locales/ge.js @@ -0,0 +1,52 @@ +/** + * locale : Georgian (ge) + * author : Vaso Gazdeliani : https://github.com/vaso991 + */ +var ge = { + datepicker: { + months: [ + "იანვარი", "თებერვალი", "მარტი", "აპრილი", "მაისი", "ივნისი", + "ივლისი", "აგვისტო", "სექტემბერი", "ოქტომბერი", "ნოემბერი", "დეკემბერი" + ], + monthsShort: [ + "იან", "თებ", "მარ", "აპრ", "მაი", "ივნ", "ივლ", "აგვ", "სექ", "ოქტ", "ნოემ", "დეკ" + ], + weekdays: [ + "კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი" + ], + weekdaysShort: [ + "კვ", "ორ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ" + ], + weekdaysNarrow: [ + "კ", "ორ", "ს", "ოთ", "ხ", "პ", "შ" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM YYYY HH:mm", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "ძებნა...", + noResults: { + header: "მონაცემები არ მოიძებნა", + message: "თქვენმა ძებნამ არ დააბრუნა შედეგი." + } + }, + select: { + noResultsMessage: "მონაცემები არ მოიძებნა", + single: { + placeholder: "აირჩიე" + }, + multi: { + placeholder: "აირჩიე...", + maxSelectedMessage: "მაქსიმუმ #{max}", + selectedMessage: "არჩეულია #{count}" + } + } +}; +export default ge; +//# sourceMappingURL=ge.js.map \ No newline at end of file diff --git a/locales/ge.js.map b/locales/ge.js.map new file mode 100644 index 000000000..a648c8061 --- /dev/null +++ b/locales/ge.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ge.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/ge.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CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Georgian (ge)\n * author : Vaso Gazdeliani : https://github.com/vaso991\n */\n\nconst ge:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"იანვარი\", \"თებერვალი\", \"მარტი\", \"აპრილი\", \"მაისი\", \"ივნისი\",\n \"ივლისი\", \"აგვისტო\", \"სექტემბერი\", \"ოქტომბერი\", \"ნოემბერი\", \"დეკემბერი\"\n ],\n monthsShort: [\n \"იან\", \"თებ\", \"მარ\", \"აპრ\", \"მაი\", \"ივნ\", \"ივლ\", \"აგვ\", \"სექ\", \"ოქტ\", \"ნოემ\", \"დეკ\"\n ],\n weekdays: [\n \"კვირა\", \"ორშაბათი\", \"სამშაბათი\", \"ოთხშაბათი\", \"ხუთშაბათი\", \"პარასკევი\", \"შაბათი\"\n ],\n weekdaysShort: [\n \"კვ\", \"ორ\", \"სამ\", \"ოთხ\", \"ხუთ\", \"პარ\", \"შაბ\"\n ],\n weekdaysNarrow: [\n \"კ\", \"ორ\", \"ს\", \"ოთ\", \"ხ\", \"პ\", \"შ\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"ძებნა...\",\n noResults: {\n header: \"მონაცემები არ მოიძებნა\",\n message: \"თქვენმა ძებნამ არ დააბრუნა შედეგი.\"\n }\n },\n select: {\n noResultsMessage: \"მონაცემები არ მოიძებნა\",\n single: {\n placeholder: \"აირჩიე\"\n },\n multi: {\n placeholder: \"აირჩიე...\",\n maxSelectedMessage: \"მაქსიმუმ #{max}\",\n selectedMessage: \"არჩეულია #{count}\"\n }\n }\n};\n\nexport default ge;\n"]} \ No newline at end of file diff --git a/locales/he.d.ts b/locales/he.d.ts new file mode 100644 index 000000000..2718957ce --- /dev/null +++ b/locales/he.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../dist"; +/** + * locale : Hebrew (he) + * author : David limkys : https://github.com/gotenxds + */ +declare const he: IPartialLocaleValues; +export default he; diff --git a/locales/he.js b/locales/he.js new file mode 100644 index 000000000..08eda8755 --- /dev/null +++ b/locales/he.js @@ -0,0 +1,51 @@ +/** + * locale : Hebrew (he) + * author : David limkys : https://github.com/gotenxds + */ +var he = { + datepicker: { + months: [ + "ינואר", "פבואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר" + ], + monthsShort: [ + "ינו", "פבו", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ" + ], + weekdays: [ + "ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת" + ], + weekdaysShort: [ + "ראש", "שני", "שלי", "רבי", "חמי", "שיש", "שבת" + ], + weekdaysNarrow: [ + "ר", "ש", "ש", "ר", "ח", "ש", "ש" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM YYYY HH:mm", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 0 + }, + search: { + placeholder: "חפש...", + noResults: { + header: "אין תוצאות", + message: "החיפוש שלך לא אחזיר תוצאות." + } + }, + select: { + noResultsMessage: "אין תוצאות", + single: { + placeholder: "בחר אחד" + }, + multi: { + placeholder: "בחר...", + maxSelectedMessage: "מקסימום #{max} אפשרויות", + selectedMessage: "#{count} selections" + } + } +}; +export default he; +//# sourceMappingURL=he.js.map \ No newline at end of file diff --git a/locales/he.js.map b/locales/he.js.map new file mode 100644 index 000000000..6bc955dd6 --- /dev/null +++ b/locales/he.js.map @@ -0,0 +1 @@ +{"version":3,"file":"he.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/he.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAA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n * locale : Hebrew (he)\n * author : David limkys : https://github.com/gotenxds\n */\n\nconst he:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"ינואר\", \"פבואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"\n ],\n monthsShort: [\n \"ינו\", \"פבו\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"\n ],\n weekdays: [\n \"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"\n ],\n weekdaysShort: [\n \"ראש\", \"שני\", \"שלי\", \"רבי\", \"חמי\", \"שיש\", \"שבת\"\n ],\n weekdaysNarrow: [\n \"ר\", \"ש\", \"ש\", \"ר\", \"ח\", \"ש\", \"ש\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 0\n },\n search: {\n placeholder: \"חפש...\",\n noResults: {\n header: \"אין תוצאות\",\n message: \"החיפוש שלך לא אחזיר תוצאות.\"\n }\n },\n select: {\n noResultsMessage: \"אין תוצאות\",\n single: {\n placeholder: \"בחר אחד\"\n },\n multi: {\n placeholder: \"בחר...\",\n maxSelectedMessage: \"מקסימום #{max} אפשרויות\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default he;\n"]} \ No newline at end of file diff --git a/locales/index.d.ts b/locales/index.d.ts new file mode 100644 index 000000000..4d375a215 --- /dev/null +++ b/locales/index.d.ts @@ -0,0 +1,16 @@ +import { RecursivePartial, ILocaleValues } from "../dist"; +declare const _default: { + de: RecursivePartial; + enAU: RecursivePartial; + enGB: ILocaleValues; + enUS: RecursivePartial; + es: RecursivePartial; + it: RecursivePartial; + fr: RecursivePartial; + pt: RecursivePartial; + ru: RecursivePartial; + he: RecursivePartial; + ge: RecursivePartial; + nl: RecursivePartial; +}; +export default _default; diff --git a/locales/index.js b/locales/index.js new file mode 100644 index 000000000..ecf35198a --- /dev/null +++ b/locales/index.js @@ -0,0 +1,27 @@ +import de from "./de"; +import enAU from "./en-AU"; +import enGB from "./en-GB"; +import enUS from "./en-US"; +import es from "./es"; +import fr from "./fr"; +import pt from "./pt"; +import it from "./it"; +import ru from "./ru"; +import he from "./he"; +import ge from "./ge"; +import nl from "./nl"; +export default { + de: de, + enAU: enAU, + enGB: enGB, + enUS: enUS, + es: es, + it: it, + fr: fr, + pt: pt, + ru: ru, + he: he, + ge: ge, + nl: nl +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/locales/index.js.map b/locales/index.js.map new file mode 100644 index 000000000..c19fbd7d6 --- /dev/null +++ b/locales/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AAGtB,eAAe;IACX,EAAE,IAAA;IACF,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;CACL,CAAC","sourcesContent":["import { RecursivePartial, ILocaleValues } from \"../interfaces/values\";\n\nimport de from \"./de\";\nimport enAU from \"./en-AU\";\nimport enGB from \"./en-GB\";\nimport enUS from \"./en-US\";\nimport es from \"./es\";\nimport fr from \"./fr\";\nimport pt from \"./pt\";\nimport it from \"./it\";\nimport ru from \"./ru\";\nimport he from \"./he\";\nimport ge from \"./ge\";\nimport nl from \"./nl\";\n\n// This file exists for the demo app. Don't use this in real life.\nexport default {\n de,\n enAU,\n enGB,\n enUS,\n es,\n it,\n fr,\n pt,\n ru,\n he,\n ge,\n nl\n};\n"]} \ No newline at end of file diff --git a/locales/it.d.ts b/locales/it.d.ts new file mode 100644 index 000000000..9078717e8 --- /dev/null +++ b/locales/it.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../dist"; +/** + * locale : Italian (it) + * author : Massimo Costa : https://github.com/mcosta74 + */ +declare const it: IPartialLocaleValues; +export default it; diff --git a/locales/it.js b/locales/it.js new file mode 100644 index 000000000..7773f624f --- /dev/null +++ b/locales/it.js @@ -0,0 +1,51 @@ +/** + * locale : Italian (it) + * author : Massimo Costa : https://github.com/mcosta74 + */ +var it = { + datepicker: { + months: [ + "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" + ], + monthsShort: [ + "Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic" + ], + weekdays: [ + "Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato" + ], + weekdaysShort: [ + "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" + ], + weekdaysNarrow: [ + "D", "L", "M", "M", "G", "V", "S" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM YYYY HH:mm", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Cerca...", + noResults: { + header: "Nessun risultato", + message: "La tua ricerca non ha trovato risultati." + } + }, + select: { + noResultsMessage: "Nessun risultato", + single: { + placeholder: "Scegli uno" + }, + multi: { + placeholder: "Scegli...", + maxSelectedMessage: "Puoi effettuare fino a #{max} scelte.", + selectedMessage: "#{count} scelte" + } + } +}; +export default it; +//# sourceMappingURL=it.js.map \ No newline at end of file diff --git a/locales/it.js.map b/locales/it.js.map new file mode 100644 index 000000000..02d505ecc --- /dev/null +++ b/locales/it.js.map @@ -0,0 +1 @@ +{"version":3,"file":"it.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/it.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SACnI;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ;SAC/E;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,OAAO,EAAE,0CAA0C;SACtD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,kBAAkB;QACpC,MAAM,EAAE;YACJ,WAAW,EAAE,YAAY;SAC5B;QACD,KAAK,EAAE;YACH,WAAW,EAAE,WAAW;YACxB,kBAAkB,EAAE,uCAAuC;YAC3D,eAAe,EAAE,iBAAiB;SACrC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Italian (it)\n * author : Massimo Costa : https://github.com/mcosta74\n */\n\nconst it:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"\n ],\n monthsShort: [\n \"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"\n ],\n weekdays: [\n \"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"\n ],\n weekdaysShort: [\n \"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"\n ],\n weekdaysNarrow: [\n \"D\", \"L\", \"M\", \"M\", \"G\", \"V\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Cerca...\",\n noResults: {\n header: \"Nessun risultato\",\n message: \"La tua ricerca non ha trovato risultati.\"\n }\n },\n select: {\n noResultsMessage: \"Nessun risultato\",\n single: {\n placeholder: \"Scegli uno\"\n },\n multi: {\n placeholder: \"Scegli...\",\n maxSelectedMessage: \"Puoi effettuare fino a #{max} scelte.\",\n selectedMessage: \"#{count} scelte\"\n }\n }\n};\n\nexport default it;\n"]} \ No newline at end of file diff --git a/locales/nl.d.ts b/locales/nl.d.ts new file mode 100644 index 000000000..603ed0105 --- /dev/null +++ b/locales/nl.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../dist"; +/** + * locale : Dutch (nl) + * author : Martijn Melchers : https://github.com/martijnmelchers + */ +declare const nl: IPartialLocaleValues; +export default nl; diff --git a/locales/nl.js b/locales/nl.js new file mode 100644 index 000000000..3502ed1a8 --- /dev/null +++ b/locales/nl.js @@ -0,0 +1,61 @@ +/** + * locale : Dutch (nl) + * author : Martijn Melchers : https://github.com/martijnmelchers + */ +var nl = { + datepicker: { + months: [ + "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December" + ], + monthsShort: [ + "Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec" + ], + weekdays: [ + "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag" + ], + weekdaysShort: [ + "Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za" + ], + weekdaysNarrow: [ + "Z", "M", "D", "W", "D", "V", "Z" + ], + /* Dutch does not have a translation for am/pm */ + timesOfDay: [ + "a.m.", "p.m." + ], + timesOfDayUppercase: [ + "AM", "PM" + ], + timesOfDayLowercase: [ + "am", "pm" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM YYYY HH:mm", + date: "D MMMM YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Zoeken...", + noResults: { + header: "Geen resultaten", + message: "Er zijn geen resultaten gevonden." + } + }, + select: { + noResultsMessage: "Geen resultation", + single: { + placeholder: "Selecteer een" + }, + multi: { + placeholder: "Selecteren...", + maxSelectedMessage: "Max #{max} selecteren", + selectedMessage: "#{count} geselecteerd" + } + } +}; +export default nl; +//# sourceMappingURL=nl.js.map \ No newline at end of file diff --git a/locales/nl.js.map b/locales/nl.js.map new file mode 100644 index 000000000..519646049 --- /dev/null +++ b/locales/nl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nl.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/nl.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SAC7H;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU;SACjF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;;QAED,UAAU,EAAE;YACR,MAAM,EAAE,MAAM;SACjB;QACD,mBAAmB,EAAE;YACjB,IAAI,EAAE,IAAI;SACb;QACD,mBAAmB,EAAE;YACjB,IAAI,EAAE,IAAI;SACb;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE;YACP,MAAM,EAAE,iBAAiB;YACzB,OAAO,EAAE,mCAAmC;SAC/C;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,kBAAkB;QACpC,MAAM,EAAE;YACJ,WAAW,EAAE,eAAe;SAC/B;QACD,KAAK,EAAE;YACH,WAAW,EAAE,eAAe;YAC5B,kBAAkB,EAAE,uBAAuB;YAC3C,eAAe,EAAE,uBAAuB;SAC3C;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Dutch (nl)\n * author : Martijn Melchers : https://github.com/martijnmelchers\n */\n\nconst nl:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"\n ],\n monthsShort: [\n \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"\n ],\n weekdays: [\n \"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"\n ],\n weekdaysShort: [\n \"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"\n ],\n weekdaysNarrow: [\n \"Z\", \"M\", \"D\", \"W\", \"D\", \"V\", \"Z\"\n ],\n\t\t/* Dutch does not have a translation for am/pm */\n timesOfDay: [\n \"a.m.\", \"p.m.\"\n ],\n timesOfDayUppercase: [\n \"AM\", \"PM\"\n ],\n timesOfDayLowercase: [\n \"am\", \"pm\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Zoeken...\",\n noResults: {\n header: \"Geen resultaten\",\n message: \"Er zijn geen resultaten gevonden.\"\n }\n },\n select: {\n noResultsMessage: \"Geen resultation\",\n single: {\n placeholder: \"Selecteer een\"\n },\n multi: {\n placeholder: \"Selecteren...\",\n maxSelectedMessage: \"Max #{max} selecteren\",\n selectedMessage: \"#{count} geselecteerd\"\n }\n }\n};\n\nexport default nl;\n"]} \ No newline at end of file diff --git a/locales/pt.d.ts b/locales/pt.d.ts new file mode 100644 index 000000000..1b03f334c --- /dev/null +++ b/locales/pt.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../dist"; +/** + * locale : Portuguese (pt) + * author : Fernando Niwes : https://github.com/fniwes + */ +declare const pt: IPartialLocaleValues; +export default pt; diff --git a/locales/pt.js b/locales/pt.js new file mode 100644 index 000000000..e925bfd10 --- /dev/null +++ b/locales/pt.js @@ -0,0 +1,51 @@ +/** + * locale : Portuguese (pt) + * author : Fernando Niwes : https://github.com/fniwes + */ +var pt = { + datepicker: { + months: [ + "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro" + ], + monthsShort: [ + "jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez" + ], + weekdays: [ + "Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado" + ], + weekdaysShort: [ + "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" + ], + weekdaysNarrow: [ + "D", "1", "2", "3", "4", "5", "S" + ], + formats: { + time: "HH:mm", + datetime: "D MMMM [de] YYYY HH:mm", + date: "D [de] MMMM [de] YYYY", + month: "MMMM [de] YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Pesquisar...", + noResults: { + header: "Sem resultados", + message: "Sua pesquisa não retornou resultados." + } + }, + select: { + noResultsMessage: "Sem resultados", + single: { + placeholder: "Escolha uma opção" + }, + multi: { + placeholder: "Escolher...", + maxSelectedMessage: "Max #{max} opçãoes", + selectedMessage: "#{count} selections" + } + } +}; +export default pt; +//# sourceMappingURL=pt.js.map \ No newline at end of file diff --git a/locales/pt.js.map b/locales/pt.js.map new file mode 100644 index 000000000..b43494bfd --- /dev/null +++ b/locales/pt.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/pt.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SAC9H;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ;SACvE;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,wBAAwB;YAClC,IAAI,EAAE,uBAAuB;YAC7B,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,cAAc;QAC3B,SAAS,EAAE;YACP,MAAM,EAAE,gBAAgB;YACxB,OAAO,EAAE,uCAAuC;SACnD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,gBAAgB;QAClC,MAAM,EAAE;YACJ,WAAW,EAAE,mBAAmB;SACnC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,aAAa;YAC1B,kBAAkB,EAAE,oBAAoB;YACxC,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Portuguese (pt)\n * author : Fernando Niwes : https://github.com/fniwes\n */\n\nconst pt:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"janeiro\", \"fevereiro\", \"março\", \"abril\", \"maio\", \"junho\", \"julho\", \"agosto\", \"setembro\", \"outubro\", \"novembro\", \"dezembro\"\n ],\n monthsShort: [\n \"jan\", \"fev\", \"mar\", \"abr\", \"mai\", \"jun\", \"jul\", \"ago\", \"set\", \"out\", \"nov\", \"dez\"\n ],\n weekdays: [\n \"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"\n ],\n weekdaysShort: [\n \"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"\n ],\n weekdaysNarrow: [\n \"D\", \"1\", \"2\", \"3\", \"4\", \"5\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM [de] YYYY HH:mm\",\n date: \"D [de] MMMM [de] YYYY\",\n month: \"MMMM [de] YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Pesquisar...\",\n noResults: {\n header: \"Sem resultados\",\n message: \"Sua pesquisa não retornou resultados.\"\n }\n },\n select: {\n noResultsMessage: \"Sem resultados\",\n single: {\n placeholder: \"Escolha uma opção\"\n },\n multi: {\n placeholder: \"Escolher...\",\n maxSelectedMessage: \"Max #{max} opçãoes\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default pt;\n"]} \ No newline at end of file diff --git a/locales/ru.d.ts b/locales/ru.d.ts new file mode 100644 index 000000000..806fd4177 --- /dev/null +++ b/locales/ru.d.ts @@ -0,0 +1,7 @@ +import { IPartialLocaleValues } from "../dist"; +/** + * locale : Russian (ru) + * author : Maksim Moiseikin : https://github.com/maksim-m + */ +declare const ru: IPartialLocaleValues; +export default ru; diff --git a/locales/ru.js b/locales/ru.js new file mode 100644 index 000000000..c06c2847a --- /dev/null +++ b/locales/ru.js @@ -0,0 +1,51 @@ +/** + * locale : Russian (ru) + * author : Maksim Moiseikin : https://github.com/maksim-m + */ +var ru = { + datepicker: { + months: [ + "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" + ], + monthsShort: [ + "Янв", "Февр", "Март", "Апр", "Май", "Июнь", "Июль", "Авг", "Сент", "Окт", "Ноя", "Дек" + ], + weekdays: [ + "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота" + ], + weekdaysShort: [ + "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" + ], + weekdaysNarrow: [ + "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" + ], + formats: { + time: "HH:mm", + datetime: "DD.MM.YYYY HH:mm", + date: "DD.MM.YYYY", + month: "MMMM YYYY", + year: "YYYY" + }, + firstDayOfWeek: 1 + }, + search: { + placeholder: "Поиск...", + noResults: { + header: "Нет результатов", + message: "Поиск не дал результатов." + } + }, + select: { + noResultsMessage: "Нет результатов", + single: { + placeholder: "Выберите одно значение" + }, + multi: { + placeholder: "Выберите...", + maxSelectedMessage: "Не более #{max} значений", + selectedMessage: "#{count} selections" + } + } +}; +export default ru; +//# sourceMappingURL=ru.js.map \ No newline at end of file diff --git a/locales/ru.js.map b/locales/ru.js.map new file mode 100644 index 000000000..8908bf702 --- /dev/null +++ b/locales/ru.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ru.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/ru.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS;SACrH;QACD,WAAW,EAAE;YACT,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAC1F;QACD,QAAQ,EAAE;YACN,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;SACpF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,cAAc,EAAE;YACZ,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,kBAAkB;YAC5B,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE;YACP,MAAM,EAAE,iBAAiB;YACzB,OAAO,EAAE,2BAA2B;SACvC;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,iBAAiB;QACnC,MAAM,EAAE;YACJ,WAAW,EAAE,wBAAwB;SACxC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,aAAa;YAC1B,kBAAkB,EAAE,0BAA0B;YAC9C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Russian (ru)\n * author : Maksim Moiseikin : https://github.com/maksim-m\n */\n\nconst ru:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Май\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Октябрь\", \"Ноябрь\", \"Декабрь\"\n ],\n monthsShort: [\n \"Янв\", \"Февр\", \"Март\", \"Апр\", \"Май\", \"Июнь\", \"Июль\", \"Авг\", \"Сент\", \"Окт\", \"Ноя\", \"Дек\"\n ],\n weekdays: [\n \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"\n ],\n weekdaysShort: [\n \"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"\n ],\n weekdaysNarrow: [\n \"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"DD.MM.YYYY HH:mm\",\n date: \"DD.MM.YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Поиск...\",\n noResults: {\n header: \"Нет результатов\",\n message: \"Поиск не дал результатов.\"\n }\n },\n select: {\n noResultsMessage: \"Нет результатов\",\n single: {\n placeholder: \"Выберите одно значение\"\n },\n multi: {\n placeholder: \"Выберите...\",\n maxSelectedMessage: \"Не более #{max} значений\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default ru;\n"]} \ No newline at end of file From 411afa8221d472f637132ea438d024b8a7ca1c6e Mon Sep 17 00:00:00 2001 From: Benjamin Coenen Date: Tue, 20 Mar 2018 15:40:57 +0100 Subject: [PATCH 5/9] dist Signed-off-by: Benjamin Coenen --- bundles/ng2-semantic-ui.umd.js | 15 ++++++++++++++- bundles/ng2-semantic-ui.umd.min.js | 14 +++++++------- dist/modules/search/components/search.d.ts | 1 + dist/modules/search/components/search.js | 11 +++++++++++ dist/modules/search/components/search.js.map | 2 +- .../search/components/search.metadata.json | 2 +- dist/modules/search/services/search.service.d.ts | 1 + dist/modules/search/services/search.service.js | 4 +++- .../modules/search/services/search.service.js.map | 2 +- src/modules/search/components/search.ts | 7 +++++++ src/modules/search/services/search.service.ts | 6 +++++- 11 files changed, 52 insertions(+), 13 deletions(-) diff --git a/bundles/ng2-semantic-ui.umd.js b/bundles/ng2-semantic-ui.umd.js index d9561086d..7c3dfb631 100644 --- a/bundles/ng2-semantic-ui.umd.js +++ b/bundles/ng2-semantic-ui.umd.js @@ -12194,7 +12194,9 @@ var SearchService = /** @class */ (function () { this._results = []; this._resultsCache = {}; this._isSearching = false; - this.updateQuery(""); + if (this.resetQueryOnChange) { + this.updateQuery(""); + } }; return SearchService; }()); @@ -12211,6 +12213,7 @@ var SuiSearch = /** @class */ (function () { this._searchClasses = true; this.hasIcon = true; this.allowEmptyQuery = false; + this.resetQueryOnChange = true; this.retainSelectedResult = true; this.searchDelay = 200; this.maxResults = 7; @@ -12226,6 +12229,15 @@ var SuiSearch = /** @class */ (function () { enumerable: true, configurable: true }); + Object.defineProperty(SuiSearch.prototype, "resetQueryOnChange", { + set: + // Sets whether the query is reset if options change. + function (resetQueryOnChange) { + this.searchService.resetQueryOnChange = resetQueryOnChange; + }, + enumerable: true, + configurable: true + }); Object.defineProperty(SuiSearch.prototype, "allowEmptyQuery", { get: function () { return this._allowEmptyQuery; @@ -12421,6 +12433,7 @@ var SuiSearch = /** @class */ (function () { "_searchClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.search",] },], "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], "hasIcon": [{ type: _angular_core.Input },], + "resetQueryOnChange": [{ type: _angular_core.Input },], "allowEmptyQuery": [{ type: _angular_core.Input },], "placeholder": [{ type: _angular_core.Input },], "options": [{ type: _angular_core.Input },], diff --git a/bundles/ng2-semantic-ui.umd.min.js b/bundles/ng2-semantic-ui.umd.min.js index 828ca0b3b..0011b0499 100644 --- a/bundles/ng2-semantic-ui.umd.min.js +++ b/bundles/ng2-semantic-ui.umd.min.js @@ -1,7 +1,7 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/forms"],t):t(e["ng2-semantic-ui"]=e["ng2-semantic-ui"]||{},e._angular_core,e._angular_common,e._angular_forms)}(this,function(e,t,n,i){"use strict";function r(e){return JSON.parse(JSON.stringify(e))}function o(e,t){return(dt||ft)(!0,e,t)}function s(e){return e.toLowerCase().replace("-","")}function a(e){return{provide:i.NG_VALIDATORS,useExisting:t.forwardRef(function(){return e}),multi:!0}}function c(e){return{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef(function(){return e}),multi:!0}}function u(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function l(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},Ft))}}function p(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function h(e,t){if(1!==e.nodeType)return[];var n=getComputedStyle(e,null);return t?n[t]:n}function d(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function f(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=h(e),n=t.overflow,i=t.overflowX;return/(auto|scroll|overlay)/.test(n+t.overflowY+i)?e:f(d(e))}function m(e){if(!e)return document.documentElement;for(var t=zt(10)?document.body:null,n=e.offsetParent;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TD","TABLE"].indexOf(n.nodeName)&&"static"===h(n,"position")?m(n):n:e?e.ownerDocument.documentElement:document.documentElement}function g(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||m(e.firstElementChild)===e)}function y(e){return null!==e.parentNode?y(e.parentNode):e}function v(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?e:t,r=n?t:e,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var s=o.commonAncestorContainer;if(e!==s&&t!==s||i.contains(r))return g(s)?s:m(s);var a=y(e);return a.host?v(a.host,t):v(e,y(t).host)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",i=e.nodeName;if("BODY"===i||"HTML"===i){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[n]}return e[n]}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=b(t,"top"),r=b(t,"left"),o=n?-1:1;return e.top+=i*o,e.bottom+=i*o,e.left+=r*o,e.right+=r*o,e}function _(e,t){var n="x"===t?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+i+"Width"],10)}function D(e,t,n,i){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],zt(10)?n["offset"+e]+i["margin"+("Height"===e?"Top":"Left")]+i["margin"+("Height"===e?"Bottom":"Right")]:0)}function C(){var e=document.body,t=document.documentElement,n=zt(10)&&getComputedStyle(t);return{height:D("Height",e,t,n),width:D("Width",e,t,n)}}function O(e){return $t({},e,{right:e.left+e.width,bottom:e.top+e.height})}function S(e){var t={};try{if(zt(10)){t=e.getBoundingClientRect();var n=b(e,"top"),i=b(e,"left");t.top+=n,t.left+=i,t.bottom+=n,t.right+=i}else t=e.getBoundingClientRect()}catch(e){}var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?C():{},s=o.width||e.clientWidth||r.right-r.left,a=o.height||e.clientHeight||r.bottom-r.top,c=e.offsetWidth-s,u=e.offsetHeight-a;if(c||u){var l=h(e);c-=_(l,"x"),u-=_(l,"y"),r.width-=c,r.height-=u}return O(r)}function M(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=zt(10),r="HTML"===t.nodeName,o=S(e),s=S(t),a=f(e),c=h(t),u=parseFloat(c.borderTopWidth,10),l=parseFloat(c.borderLeftWidth,10);n&&"HTML"===t.nodeName&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=O({top:o.top-s.top-u,left:o.left-s.left-l,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!i&&r){var d=parseFloat(c.marginTop,10),m=parseFloat(c.marginLeft,10);p.top-=u-d,p.bottom-=u-d,p.left-=l-m,p.right-=l-m,p.marginTop=d,p.marginLeft=m}return(i&&!n?t.contains(a):t===a&&"BODY"!==a.nodeName)&&(p=w(p,t)),p}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,i=M(e,n),r=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),s=t?0:b(n),a=t?0:b(n,"left");return O({top:s-i.top+i.marginTop,left:a-i.left+i.marginLeft,width:r,height:o})}function k(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===h(e,"position")||k(d(e)))}function P(e){if(!e||!e.parentElement||zt())return document.documentElement;for(var t=e.parentElement;t&&"none"===h(t,"transform");)t=t.parentElement;return t||document.documentElement}function x(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},s=r?P(e):v(e,t);if("viewport"===i)o=T(s,r);else{var a=void 0;"scrollParent"===i?(a=f(d(t)),"BODY"===a.nodeName&&(a=e.ownerDocument.documentElement)):a="window"===i?e.ownerDocument.documentElement:i;var c=M(a,s,r);if("HTML"!==a.nodeName||k(s))o=c;else{var u=C(),l=u.height,p=u.width;o.top+=c.top-c.marginTop,o.bottom=l+c.top,o.left+=c.left-c.marginLeft,o.right=p+c.left}}return o.left+=n,o.top+=n,o.right-=n,o.bottom-=n,o}function I(e){return e.width*e.height}function E(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var s=x(n,i,o,r),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},c=Object.keys(a).map(function(e){return $t({key:e},a[e],{area:I(a[e])})}).sort(function(e,t){return t.area-e.area}),u=c.filter(function(e){var t=e.width,i=e.height;return t>=n.clientWidth&&i>=n.clientHeight}),l=u.length>0?u[0].key:c[0].key,p=e.split("-")[1];return l+(p?"-"+p:"")}function L(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return M(n,i?P(t):v(t,n),i)}function j(e){var t=getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+i,height:e.offsetHeight+n}}function V(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function H(e,t,n){n=n.split("-")[0];var i=j(e),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),s=o?"top":"left",a=o?"left":"top",c=o?"height":"width",u=o?"width":"height";return r[s]=t[s]+t[c]/2-i[c]/2,r[a]=n===a?t[a]-i[u]:t[V(a)],r}function R(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function A(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var i=R(e,function(e){return e[t]===n});return e.indexOf(i)}function F(e,t,n){return(void 0===n?e:e.slice(0,A(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&p(n)&&(t.offsets.popper=O(t.offsets.popper),t.offsets.reference=O(t.offsets.reference),t=n(t,e))}),t}function Y(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=E(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=H(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=F(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function B(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function N(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;is[f]&&(e.offsets.popper[p]+=a[p]+m-s[f]),e.offsets.popper=O(e.offsets.popper);var g=a[p]+a[u]/2-m/2,y=h(e.instance.popper),v=parseFloat(y["margin"+l],10),b=parseFloat(y["border"+l+"Width"],10),w=g-e.offsets.popper[p]-v-b;return w=Math.max(Math.min(s[u]-m,w),0),e.arrowElement=i,e.offsets.arrow=(n={},Kt(n,p,Math.round(w)),Kt(n,d,""),n),e}function re(e){return"end"===e?"start":"start"===e?"end":e}function oe(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Gt.indexOf(e),i=Gt.slice(n+1).concat(Gt.slice(0,n));return t?i.reverse():i}function se(e,t){if(B(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=x(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),i=e.placement.split("-")[0],r=V(i),o=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case Jt.FLIP:s=[i,r];break;case Jt.CLOCKWISE:s=oe(i);break;case Jt.COUNTERCLOCKWISE:s=oe(i,!0);break;default:s=t.behavior}return s.forEach(function(a,c){if(i!==a||s.length===c+1)return e;i=e.placement.split("-")[0],r=V(i);var u=e.offsets.popper,l=e.offsets.reference,p=Math.floor,h="left"===i&&p(u.right)>p(l.left)||"right"===i&&p(u.left)p(l.top)||"bottom"===i&&p(u.top)p(n.right),m=p(u.top)p(n.bottom),y="left"===i&&d||"right"===i&&f||"top"===i&&m||"bottom"===i&&g,v=-1!==["top","bottom"].indexOf(i),b=!!t.flipVariations&&(v&&"start"===o&&d||v&&"end"===o&&f||!v&&"start"===o&&m||!v&&"end"===o&&g);(h||y||b)&&(e.flipped=!0,(h||y)&&(i=s[c+1]),b&&(o=re(o)),e.placement=i+(o?"-"+o:""),e.offsets.popper=$t({},e.offsets.popper,H(e.instance.popper,e.offsets.reference,e.placement)),e=F(e.instance.modifiers,e,"flip"))}),e}function ae(e){var t=e.offsets,n=t.popper,i=t.reference,r=e.placement.split("-")[0],o=Math.floor,s=-1!==["top","bottom"].indexOf(r),a=s?"right":"bottom",c=s?"left":"top",u=s?"width":"height";return n[a]o(i[a])&&(e.offsets.popper[c]=o(i[a])),e}function ce(e,t,n,i){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+r[1],s=r[2];if(!o)return e;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=i}return O(a)[t]/100*o}if("vh"===s||"vw"===s){return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}function ue(e,t,n,i){var r=[0,0],o=-1!==["right","left"].indexOf(i),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(R(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,u=-1!==a?[s.slice(0,a).concat([s[a].split(c)[0]]),[s[a].split(c)[1]].concat(s.slice(a+1))]:[s];return u=u.map(function(e,i){var r=(1===i?!o:o)?"height":"width",s=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return ce(e,r,t,n)})}),u.forEach(function(e,t){e.forEach(function(n,i){G(n)&&(r[t]+=n*("-"===e[i-1]?-1:1))})}),r}function le(e,t){var n=t.offset,i=e.placement,r=e.offsets,o=r.popper,s=r.reference,a=i.split("-")[0],c=void 0;return c=G(+n)?[+n,0]:ue(n,o,s,a),"left"===a?(o.top+=c[0],o.left-=c[1]):"right"===a?(o.top+=c[0],o.left+=c[1]):"top"===a?(o.left+=c[0],o.top-=c[1]):"bottom"===a&&(o.left+=c[0],o.top+=c[1]),e.popper=o,e}function pe(e,t){var n=t.boundariesElement||m(e.instance.popper);e.instance.reference===n&&(n=m(n));var i=x(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);t.boundaries=i;var r=t.priority,o=e.offsets.popper,s={primary:function(e){var n=o[e];return o[e]i[e]&&!t.escapeWithReference&&(r=Math.min(o[n],i[e]-("right"===e?o.width:o.height))),Kt({},n,r)}};return r.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";o=$t({},o,s[t](e))}),e.offsets.popper=o,e}function he(e){var t=e.placement,n=t.split("-")[0],i=t.split("-")[1];if(i){var r=e.offsets,o=r.reference,s=r.popper,a=-1!==["bottom","top"].indexOf(n),c=a?"left":"top",u=a?"width":"height",l={start:Kt({},c,o[c]),end:Kt({},c,o[c]+o[u]-s[u])};e.offsets.popper=$t({},s,l[i])}return e}function de(e){if(!ne(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=R(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right0?"in "+i:i+" ago":i}function Pe(e){return e.replace(Fn,function(e){return e.slice(1)})}function xe(e,t,n,i){return Bn[e]}function Ie(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}function Ee(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}function Le(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}function je(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}function Ve(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}function He(e){return parseInt(e[1],10)}function Re(e,t){var n=ye(e,t),i=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime(),o=i-r;return Math.floor(o/ti)+1}function Ae(e,t){var n=ye(e,t),i=n.getUTCDay(),r=(i<1?7:0)+i-1;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function Fe(e,t){var n=ye(e,t),i=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(i+1,0,4),r.setUTCHours(0,0,0,0);var o=Ae(r,t),s=new Date(0);s.setUTCFullYear(i,0,4),s.setUTCHours(0,0,0,0);var a=Ae(s,t);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Ye(e,t){var n=Fe(e,t),i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),Ae(i,t)}function Be(e,t){var n=ye(e,t),i=Ae(n,t).getTime()-Ye(n,t).getTime();return Math.round(i/ni)+1}function Ne(e,t){t=t||"";var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;return n+Ue(r,2)+t+Ue(o,2)}function Ue(e,t){for(var n=Math.abs(e).toString();n.length=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=ye(e,n),u=Number(t),l=c.getUTCDay(),p=u%7,h=(p+7)%7,d=(h=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=o.locale||ei,c=a.parsers||{},u=a.units||{};if(!a.match)throw new RangeError("locale must contain match property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var l=String(t).replace(hi,function(e){return"["===e[0]?e:"\\"===e[0]?nt(e):a.formatLong(e)});if(""===l)return""===r?ye(n,o):new Date(NaN);var p=Se(o);p.locale=a;var h,d=l.match(a.parsingTokensRegExp||di),f=d.length,m=[{priority:li,set:tt,index:0}];for(h=0;h\n \n \n\n',styles:["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"]}]}],n.ctorParameters=function(){return[]},n.propDecorators={isDismissable:[{type:t.Input}],onDismiss:[{type:t.Output,args:["dismiss"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],class:[{type:t.Input,args:["class"]}]},n}(),Dt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[_t],exports:[_t]}]}],e.ctorParameters=function(){return[]},e}(),Ct=function(){function e(){this._paginationClasses=!0,this.pageChange=new t.EventEmitter,this.pageSize=10,this._page=1,this._pages=[],this.pageCount=1,this.hasNavigationLinks=!0,this.hasBoundaryLinks=!1,this.canRotate=!1,this.hasEllipses=!0}return Object.defineProperty(e.prototype,"maxSize",{get:function(){return this._maxSize},set:function(e){this._maxSize=void 0!=e?Math.max(e,1):void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collectionSize",{get:function(){return this._collectionSize},set:function(e){this._collectionSize=Math.max(e,0),this.pageCount=Math.max(1,Math.ceil(this._collectionSize/this.pageSize))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNavigationLinks",{get:function(){var e=this._maxSize||this.pageCount;return this._hasNavigationLinks||e1},e.prototype.hasNext=function(){return this.page\n \n\n\n \n\n\n \n 1\n \n ...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n',styles:["\n:host .item {\n transition: none;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_paginationClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.pagination"]},{type:t.HostBinding,args:["class.menu"]}],pageChange:[{type:t.Output}],maxSize:[{type:t.Input}],pageSize:[{type:t.Input}],collectionSize:[{type:t.Input}],hasNavigationLinks:[{type:t.Input}],hasBoundaryLinks:[{type:t.Input}],canRotate:[{type:t.Input}],hasEllipses:[{type:t.Input}],page:[{type:t.Input}]},e}(),Ot=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],exports:[Ct],declarations:[Ct],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),St=function(){function e(e){this._changeDetector=e,this.transitionController=new vt(!1),this._isOpen=!1,this.isOpenChange=new t.EventEmitter(!1)}return Object.defineProperty(e.prototype,"service",{set:function(e){this._service=e,this._changeDetector.detectChanges()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},set:function(e){var t=!!e;t!==this.isOpen&&(this._isOpen=t,t&&this._service&&this._service.closeOtherPanels(this),this.isOpenChange.emit(this.isOpen),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.transition,this.transitionDuration)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{get:function(){return this._service?this._service.transition:"fade"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{get:function(){return this._service?this._service.transitionDuration:0},enumerable:!0,configurable:!0}),e.prototype.toggle=function(){this.isDisabled||(this.isOpen=!this.isOpen)},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion-panel",exportAs:"suiAccordionPanel",template:'\n\x3c!-- Title --\x3e\n
\n \n
\n\x3c!-- Content --\x3e\n
\n
\n \n
\n
\n',styles:["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},e.propDecorators={isDisabled:[{type:t.Input}],isOpen:[{type:t.Input}],isOpenChange:[{type:t.Output}]},e}(),Mt=function(){function e(){this.closeOthers=!0,this.transition="fade",this.transitionDuration=350,this.panels=[]}return e.prototype.addPanel=function(e){e.service=this,this.panels.push(e)},e.prototype.closeOtherPanels=function(e){this.closeOthers&&this.panels.forEach(function(t){t!==e&&(t.isOpen=!1)})},e}(),Tt=function(){function e(){this._service=new Mt,this.accordionClasses=!0}return Object.defineProperty(e.prototype,"closeOthers",{get:function(){return this._service.closeOthers},set:function(e){this._service.closeOthers=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{set:function(e){this._service.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{set:function(e){this._service.transitionDuration=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.updatePanels(),this._panels.changes.subscribe(function(){return e.updatePanels()})},e.prototype.updatePanels=function(){var e=this;this._panels.forEach(function(t){return e._service.addPanel(t)})},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion",template:"\n\n",styles:["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={accordionClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.accordion"]}],closeOthers:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],_panels:[{type:t.ContentChildren,args:[St]}]},e}(),kt=function(){function e(e,t){this._element=e,this._renderer=t,this._pristine=!0,this.collapseDuration=350,this._isExpanded=!1,this._isCollapsing=!1}return Object.defineProperty(e.prototype,"_isCollapsed",{get:function(){return!this._isExpanded&&!this._isCollapsing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suiCollapse",{get:function(){return this._isExpanded},set:function(e){e?this.hide():this.show()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_animationDuration",{get:function(){return this._pristine?0:this.collapseDuration},enumerable:!0,configurable:!0}),e.prototype.hide=function(){var e=this;this._isCollapsing=!0,this._isExpanded=!1,this._renderer.setStyle(this._element.nativeElement,"overflow","hidden"),this.animate(this._element.nativeElement.scrollHeight,0,!1,function(){e._isCollapsing=!1})},e.prototype.show=function(){var e=this;this._isCollapsing=!0,this.animate(this._element.nativeElement.offsetHeight,this._element.nativeElement.scrollHeight,!0,function(){e._renderer.removeStyle(e._element.nativeElement,"overflow"),e._isCollapsing=!1,e._isExpanded=!0})},e.prototype.animate=function(e,t,n,i){void 0===n&&(n=!1),void 0===i&&(i=function(){});var r=[{offset:0,height:e+"px"},{offset:1,height:t+"px"}];n&&r.push({offset:1,height:"auto"}),this._element.nativeElement.animate(r,{delay:0,duration:this._animationDuration,iterations:1,easing:"ease",fill:"both"}),this._pristine&&(this._pristine=!1),setTimeout(function(){return i()},this.collapseDuration)},e.decorators=[{type:t.Directive,args:[{selector:"[suiCollapse]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e.propDecorators={_isExpanded:[{type:t.HostBinding,args:["class.expanded"]}],_isCollapsed:[{type:t.HostBinding,args:["class.collapsed"]}],_isCollapsing:[{type:t.HostBinding,args:["class.collapsing"]}],suiCollapse:[{type:t.Input}],collapseDuration:[{type:t.Input}]},e}(),Pt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[kt],exports:[kt]}]}],e.ctorParameters=function(){return[]},e}(),xt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Pt,wt],declarations:[Tt,St],exports:[Tt,St],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),It=function(){function e(e){this._host=e,this.onValidatorChange=function(){}}return e.prototype.validate=function(e){return this._host.validate(e)},e.prototype.registerOnValidatorChange=function(e){this.onValidatorChange=e},e}(),Et=function(){function e(e){this._host=e,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){this._host.writeValue(e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e}();!function(e){e[e.Left=37]="Left",e[e.Up=38]="Up",e[e.Right=39]="Right",e[e.Down=40]="Down",e[e.Escape=27]="Escape",e[e.Enter=13]="Enter",e[e.Space=32]="Space",e[e.Backspace=8]="Backspace"}(e.KeyCode||(e.KeyCode={}));var Lt=function(){function e(){}return e}(),jt={Array:{range:function(e,t){return void 0===t&&(t=0),Array(e).fill(0).map(function(e,n){return n+t})},group:function(e,t){for(var n=e.slice(0),i=[];n.length>0;)i.push(n.splice(0,t));return i},groupBy:function(e,t){return e.reduce(function(e,n){var i=n[t].toString();return e[i]=e[i]||[],e[i].push(n),e},Object())},flatten:function(e){return e.reduce(function(e,t){return e.concat(t)},[])}},String:{padLeft:function(e,t,n){for(var i=e;i.length=0){Ft=1;break}var Bt=Rt&&window.Promise,Nt=Bt?u:l,Ut={},zt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";if(e=e.toString(),Ut.hasOwnProperty(e))return Ut[e];switch(e){case"11":Ut[e]=-1!==navigator.userAgent.indexOf("Trident");break;case"10":Ut[e]=-1!==navigator.appVersion.indexOf("MSIE 10");break;case"all":Ut[e]=-1!==navigator.userAgent.indexOf("Trident")||-1!==navigator.userAgent.indexOf("MSIE")}return Ut.all=Ut.all||Object.keys(Ut).some(function(e){return Ut[e]}),Ut[e]},Wt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},qt=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Wt(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=Nt(this.update.bind(this)),this.options=$t({},e.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys($t({},e.Defaults.modifiers,r.modifiers)).forEach(function(t){i.options.modifiers[t]=$t({},e.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return $t({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&p(e.onLoad)&&e.onLoad(i.reference,i.popper,i.options,e,i.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return qt(e,[{key:"update",value:function(){return Y.call(this)}},{key:"destroy",value:function(){return U.call(this)}},{key:"enableEventListeners",value:function(){return K.call(this)}},{key:"disableEventListeners",value:function(){return Q.call(this)}}]),e}();en.Utils=("undefined"!=typeof window?window:global).PopperUtils,en.placements=Qt,en.Defaults=Xt;var tn={Auto:"auto",TopLeft:"top left",Top:"top",TopRight:"top right",LeftTop:"left top",Left:"left",LeftBottom:"left bottom",BottomLeft:"bottom left",Bottom:"bottom",BottomRight:"bottom right",RightTop:"right top",Right:"right",RightBottom:"right bottom"},nn=function(){function e(e,t,n,i){var r=this;this.anchor=e,this.subject=t,this._placement=n;var o={computeStyle:{gpuAcceleration:!1},preventOverflow:{escapeWithReference:!0,boundariesElement:document.body},arrow:{element:i}};i||delete o.arrow,this._popper=new en(e.nativeElement,t.nativeElement,{placement:me(n),modifiers:o,onCreate:function(e){return r._popperState=e},onUpdate:function(e){return r._popperState=e}})}return Object.defineProperty(e.prototype,"placement",{get:function(){return this._placement},set:function(e){this._placement=e,this._popper.options.placement=me(e),this.update()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"actualPlacement",{get:function(){return this._popperState?ge(this._popperState.placement):tn.Auto},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._popperState},enumerable:!0,configurable:!0}),e.prototype.update=function(){this._popper.update()},e.prototype.destroy=function(){this._popper.destroy()},e}(),rn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],providers:[Ht]}]}],e.ctorParameters=function(){return[]},e}(),on=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),sn=function(){function e(){this.isChecked=!1,this.onCheckChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._checkboxClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.toggle(),this.focusCheckbox())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.toggle=function(){this.isChecked=!this.isChecked,this.onCheckChange.emit(this.isChecked)},e.prototype.writeValue=function(e){this.isChecked=e},e.prototype.focusCheckbox=function(){this._checkboxElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-checkbox",exportAs:"suiCheckbox",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_checkboxClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCheckChange:[{type:t.Output,args:["checkChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_checkboxElement:[{type:t.ViewChild,args:["checkbox"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),an=function(e){function n(t){return e.call(this,t)||this}return on(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-checkbox",host:{"(checkChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:sn}]},n}(Et),cn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),un=function(){function e(){this._radioClasses=!0,this.isChecked=!1,this.onCurrentValueChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._radioClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.currentValue=this.value,this.onCurrentValueChange.emit(this.currentValue),this.update(),this.focusRadio())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.update=function(){this.isChecked=this.currentValue===this.value},e.prototype.writeValue=function(e){this.currentValue=e,this.update()},e.prototype.focusRadio=function(){this._radioElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-radio-button",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_radioClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.radio"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],value:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCurrentValueChange:[{type:t.Output,args:["currentValueChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_radioElement:[{type:t.ViewChild,args:["radio"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),ln=function(e){function n(t){return e.call(this,t)||this}return cn(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-radio-button",host:{"(currentValueChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:un}]},n}(Et),pn=function(){function e(e){this.element=e,this.isNested=!1,this._radioSubs=[]}return e.prototype.ngAfterContentInit=function(){var e=this;this.updateNesting(),this._subManagers.changes.subscribe(function(){return e.updateNesting()}),this.updateRadios(),this._renderedRadios.changes.subscribe(function(){return e.updateRadios()})},e.prototype.updateNesting=function(){var e=this;this._subManagers.filter(function(t){return t!==e}).forEach(function(e){return e.isNested=!0})},e.prototype.updateRadios=function(){var e=this;this._radioSubs.forEach(function(e){return e.unsubscribe()}),this._radioSubs=[];var t=jt.Array.groupBy(this._renderedRadios.toArray(),"name");Object.keys(t).map(function(e){return t[e]}).forEach(function(t){return t.forEach(function(n){return e._radioSubs.push(n.onCurrentValueChange.subscribe(function(n){e.isNested||t.forEach(function(e){return e.writeValue(n)})}))})})},e.decorators=[{type:t.Directive,args:[{selector:"form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={_subManagers:[{type:t.ContentChildren,args:[e,{descendants:!0}]}],_renderedRadios:[{type:t.ContentChildren,args:[un,{descendants:!0}]}]},e}(),hn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule],declarations:[sn,an,un,ln,pn],exports:[sn,an,un,ln,pn]}]}],e.ctorParameters=function(){return[]},e}();!function(e){e[e.DateOnly=0]="DateOnly",e[e.TimeOnly=1]="TimeOnly",e[e.Both=2]="Both"}(e.CalendarMode||(e.CalendarMode={}));var dn=function(){function e(e,n){this.localeValues=n,this.onManualUpdate=function(){},this.config=e,this.currentDate=new Date,this.firstDayOfWeek=this.localeValues.firstDayOfWeek,this.onDateChange=new t.EventEmitter,this.reset()}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},set:function(e){this._config=e,e.updateBounds(this._selectedDate||this.currentDate)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inFinalView",{get:function(){return this.currentView===this.config.mappings.finalView},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){e?(this._selectedDate=Vt.clone(e),this.currentDate=Vt.clone(e)):this._selectedDate=void 0,this.config.updateBounds(this._selectedDate||this.currentDate),this.onManualUpdate()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){ -return this._minDate&&this.config.dateMinBound?this._minDate>this.config.dateMinBound?this._minDate:this.config.dateMinBound:this._minDate||this.config.dateMinBound},set:function(e){this._minDate=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate&&this.config.dateMaxBound?this._maxDate=this.ranges.current.inRange.length&&(i=!0),!o){var s=this.ranges.current.findIndex(this._highlightedItem),a=this.ranges.calc(i).inRange;if(i?s-=this.ranges.current.inRange.length:s+=a.length,o=a[s+r],o.isDisabled)return}this.ranges.move(i),this._highlightedItem=this.ranges.current.find(o)}},n.prototype.ngOnDestroy=function(){this._documentKeyDownListener()},n.propDecorators={_renderedItems:[{type:t.ViewChildren,args:[mn]}],service:[{type:t.Input}]},n}(),yn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vn=function(){function e(){}return e}(),bn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Date,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Date]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month]]),n}return yn(n,t),n}(vn),wn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Hour,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),_n=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Hour],[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month],[e.CalendarViewType.Hour,e.CalendarViewType.Date],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),Dn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Month,n.finalView=e.CalendarViewType.Month,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Month]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),Cn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Year,n.finalView=e.CalendarViewType.Year,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),On=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sn=function(){function t(e,t,n,i){this.mode=e,this.precision=t,this.mappings=n,this.fallback=i}return t.prototype.updateBounds=function(t){this.dateMinBound=Vt.startOf(e.DatePrecision.Year,new Date,!0),this.dateMinBound.setFullYear(0)},t}(),Mn=function(t){function n(n,i,r){return t.call(this,e.CalendarMode.DateOnly,n,i,r)||this}return On(n,t),n}(Sn),Tn=function(t){function n(){return t.call(this,e.DatePrecision.Year,new Cn,"number")||this}return On(n,t),n}(Mn),kn=function(t){function n(){return t.call(this,e.DatePrecision.Month,new Dn,"month")||this}return On(n,t),n}(Mn),Pn=function(t){function n(){return t.call(this,e.DatePrecision.Date,new bn,"date")||this}return On(n,t),n}(Mn),xn=function(t){function n(){return t.call(this,e.CalendarMode.Both,e.DatePrecision.Minute,new _n,"datetime-local")||this}return On(n,t),n}(Sn),In=function(t){function n(){return t.call(this,e.CalendarMode.TimeOnly,e.DatePrecision.Minute,new wn,"time")||this}return On(n,t),n.prototype.updateBounds=function(t){this.dateMaxBound=Vt.endOf(e.DatePrecision.Date,Vt.clone(t)),this.dateMinBound=Vt.previous(e.DatePrecision.Date,Vt.clone(this.dateMaxBound))},n}(Sn),En=function(){function t(e,t){this._precision=e,this._isSmallest=t}return t.prototype.equal=function(t,n){return this._precision===e.DatePrecision.Minute?!!n&&Vt.equal(e.DatePrecision.Hour,n,t)&&jt.Math.roundDown(n.getMinutes(),5)===jt.Math.roundDown(t.getMinutes(),5):!!n&&Vt.equal(this._precision,t,n)},t.prototype.lessThan=function(e,t){return this._isSmallest?!t||t>=e:!t||Vt.endOf(this._precision,Vt.clone(t))>=e},t.prototype.greaterThan=function(e,t){return this._isSmallest?!t||t<=e:!t||Vt.startOf(this._precision,Vt.clone(t))<=e},t.prototype.between=function(e,t,n){return this.greaterThan(e,t)&&this.lessThan(e,n)},t}(),Ln=36e5,jn=6e4,Vn=2,Hn={dateTimeDelimeter:/[T ]/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-])(\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/},Rn=6e4,An={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Fn=/MMMM|MM|DD|dddd/g,Yn=function(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||Pe(e.L),ll:e.ll||Pe(e.LL),lll:e.lll||Pe(e.LLL),llll:e.llll||Pe(e.LLLL)};return function(e){return t[e]}}({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"}),Bn={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"},Nn={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Un={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},zn={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},Wn={ordinalNumber:Le,weekday:Ie(Nn,"long"),weekdays:Ee(Nn,"long"),month:Ie(Un,"long"),months:Ee(Un,"long"),timeOfDay:Ie(zn,"long",function(e){return e/12>=1?1:0}),timesOfDay:Ee(zn,"long")},qn=/^(\d+)(th|st|nd|rd)?/i,Kn={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},$n={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Qn={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Gn={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Jn={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},Zn={any:[/^a/i,/^p/i]},Xn={ordinalNumbers:function(e){return function(t){return String(t).match(e)}}(qn),ordinalNumber:He,weekdays:je(Kn,"long"),weekday:Ve($n,"any"),months:je(Qn,"long"),month:Ve(Gn,"any"),timesOfDay:je(Jn,"long"),timeOfDay:Ve(Zn,"any")},ei={formatDistance:ke,formatLong:Yn,formatRelative:xe,localize:Wn,match:Xn,options:{weekStartsOn:0,firstWeekContainsDate:1}},ti=864e5,ni=6048e5,ii={M:function(e){return e.getUTCMonth()+1},Mo:function(e,t){var n=e.getUTCMonth()+1;return t.locale.localize.ordinalNumber(n,{unit:"month"})},MM:function(e){return Ue(e.getUTCMonth()+1,2)},MMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"short"})},MMMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"long"})},Q:function(e){return Math.ceil((e.getUTCMonth()+1)/3)},Qo:function(e,t){var n=Math.ceil((e.getUTCMonth()+1)/3);return t.locale.localize.ordinalNumber(n,{unit:"quarter"})},D:function(e){return e.getUTCDate()},Do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDate(),{unit:"dayOfMonth"})},DD:function(e){return Ue(e.getUTCDate(),2)},DDD:function(e){return Re(e)},DDDo:function(e,t){return t.locale.localize.ordinalNumber(Re(e),{unit:"dayOfYear"})},DDDD:function(e){return Ue(Re(e),3)},dd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"narrow"})},ddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"short"})},dddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"long"})},d:function(e){return e.getUTCDay()},do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDay(),{unit:"dayOfWeek"})},E:function(e){return e.getUTCDay()||7},W:function(e){return Be(e)},Wo:function(e,t){return t.locale.localize.ordinalNumber(Be(e),{unit:"isoWeek"})},WW:function(e){return Ue(Be(e),2)},YY:function(e){return Ue(e.getUTCFullYear(),4).substr(2)},YYYY:function(e){return Ue(e.getUTCFullYear(),4)},GG:function(e){return String(Fe(e)).substr(2)},GGGG:function(e){return Fe(e)},H:function(e){return e.getUTCHours()},HH:function(e){return Ue(e.getUTCHours(),2)},h:function(e){var t=e.getUTCHours();return 0===t?12:t>12?t%12:t},hh:function(e){return Ue(ii.h(e),2)},m:function(e){return e.getUTCMinutes()},mm:function(e){return Ue(e.getUTCMinutes(),2)},s:function(e){return e.getUTCSeconds()},ss:function(e){return Ue(e.getUTCSeconds(),2)},S:function(e){return Math.floor(e.getUTCMilliseconds()/100)},SS:function(e){return Ue(Math.floor(e.getUTCMilliseconds()/10),2)},SSS:function(e){return Ue(e.getUTCMilliseconds(),3)},Z:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset(),":")},ZZ:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset())},X:function(e,t){var n=t._originalDate||e;return Math.floor(n.getTime()/1e3)},x:function(e,t){return(t._originalDate||e).getTime()},A:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"uppercase"})},a:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"lowercase"})},aa:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"long"})}},ri=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,oi=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,si={M:/^(1[0-2]|0?\d)/,D:/^(3[0-1]|[0-2]?\d)/,DDD:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,W:/^(5[0-3]|[0-4]?\d)/,YYYY:/^(\d{1,4})/,H:/^(2[0-3]|[0-1]?\d)/,m:/^([0-5]?\d)/,Z:/^([+-])(\d{2}):(\d{2})/,ZZ:/^([+-])(\d{2})(\d{2})/,singleDigit:/^(\d)/,twoDigits:/^(\d{2})/,threeDigits:/^(\d{3})/,fourDigits:/^(\d{4})/,anyDigits:/^(\d+)/},ai={YY:{unit:"twoDigitYear",match:si.twoDigits,parse:function(e){return $e(e)}},YYYY:{unit:"year",match:si.YYYY,parse:$e},GG:{unit:"isoYear",match:si.twoDigits,parse:function(e){return $e(e)+1900}},GGGG:{unit:"isoYear",match:si.YYYY,parse:$e},Q:{unit:"quarter",match:si.singleDigit,parse:$e},Qo:{unit:"quarter",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"quarter"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"quarter"})}},M:{unit:"month",match:si.M,parse:function(e){return $e(e)-1}},Mo:{unit:"month",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"month"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"month"})-1}},MM:{unit:"month",match:si.twoDigits,parse:function(e){return $e(e)-1}},MMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"short"})},parse:function(e,t){return t.locale.match.month(e,{type:"short"})}},MMMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"long"})||t.locale.match.months(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.month(e,{type:"long"});return null==n&&(n=t.locale.match.month(e,{type:"short"})),n}},W:{unit:"isoWeek",match:si.W,parse:$e},Wo:{unit:"isoWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"isoWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"isoWeek"})}},WW:{unit:"isoWeek",match:si.twoDigits,parse:$e},d:{unit:"dayOfWeek",match:si.singleDigit,parse:$e},do:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfWeek"})}},dd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){return t.locale.match.weekday(e,{type:"narrow"})}},ddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"short"});return null==n&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},dddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"long"})||t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"long"});return null==n&&null==(n=t.locale.match.weekday(e,{type:"short"}))&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},E:{unit:"dayOfISOWeek",match:si.singleDigit,parse:function(e){return $e(e)}},D:{unit:"dayOfMonth",match:si.D,parse:$e},Do:{unit:"dayOfMonth",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfMonth"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfMonth"})}},DD:{unit:"dayOfMonth",match:si.twoDigits,parse:$e},DDD:{unit:"dayOfYear",match:si.DDD,parse:$e},DDDo:{unit:"dayOfYear",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfYear"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfYear"})}},DDDD:{unit:"dayOfYear",match:si.threeDigits,parse:$e},A:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){return t.locale.match.timeOfDay(e,{type:"short"})}},aa:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"long"})||t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.timeOfDay(e,{type:"long"});return null==n&&(n=t.locale.match.timeOfDay(e,{type:"short"})),n}},H:{unit:"hours",match:si.H,parse:$e},HH:{unit:"hours",match:si.twoDigits,parse:$e},h:{unit:"timeOfDayHours",match:si.M,parse:$e},hh:{unit:"timeOfDayHours",match:si.twoDigits,parse:$e},m:{unit:"minutes",match:si.m,parse:$e},mm:{unit:"minutes",match:si.twoDigits,parse:$e},s:{unit:"seconds",match:si.m,parse:$e},ss:{unit:"seconds",match:si.twoDigits,parse:$e},S:{unit:"milliseconds",match:si.singleDigit,parse:function(e){return 100*$e(e)}},SS:{unit:"milliseconds",match:si.twoDigits,parse:function(e){return 10*$e(e)}},SSS:{unit:"milliseconds",match:si.threeDigits,parse:$e},Z:{unit:"timezone",match:si.Z,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},ZZ:{unit:"timezone",match:si.ZZ,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},X:{unit:"timestamp",match:si.anyDigits,parse:function(e){return 1e3*$e(e)}},x:{unit:"timestamp",match:si.anyDigits,parse:$e}};ai.a=ai.A;var ci=864e5,ui={twoDigitYear:{priority:10,set:function(e,t){var n=Math.floor(e.date.getUTCFullYear()/100),i=100*n+t;return e.date.setUTCFullYear(i,0,1),e.date.setUTCHours(0,0,0,0),e}},year:{priority:10,set:function(e,t){return e.date.setUTCFullYear(t,0,1),e.date.setUTCHours(0,0,0,0),e}},isoYear:{priority:10,set:function(e,t,n){return e.date=Ye(Ze(e.date,t,n),n),e}},quarter:{priority:20,set:function(e,t){return e.date.setUTCMonth(3*(t-1),1),e.date.setUTCHours(0,0,0,0),e}},month:{priority:30,set:function(e,t){return e.date.setUTCMonth(t,1),e.date.setUTCHours(0,0,0,0),e}},isoWeek:{priority:40,set:function(e,t,n){return e.date=Ae(Je(e.date,t,n),n),e}},dayOfWeek:{priority:50,set:function(e,t,n){return e.date=Qe(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfISOWeek:{priority:50,set:function(e,t,n){return e.date=Ge(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfMonth:{priority:50,set:function(e,t){return e.date.setUTCDate(t),e.date.setUTCHours(0,0,0,0),e}},dayOfYear:{priority:50,set:function(e,t){return e.date.setUTCMonth(0,t),e.date.setUTCHours(0,0,0,0),e}},timeOfDay:{priority:60,set:function(e,t,n){return e.timeOfDay=t,e}},hours:{priority:70,set:function(e,t,n){return e.date.setUTCHours(t,0,0,0),e}},timeOfDayHours:{priority:70,set:function(e,t,n){var i=e.timeOfDay;return null!=i&&(t=Xe(t,i)),e.date.setUTCHours(t,0,0,0),e}},minutes:{priority:80,set:function(e,t){return e.date.setUTCMinutes(t,0,0),e}},seconds:{priority:90,set:function(e,t){return e.date.setUTCSeconds(t,0),e}},milliseconds:{priority:100,set:function(e,t){return e.date.setUTCMilliseconds(t),e}},timezone:{priority:110,set:function(e,t){return e.date=new Date(e.date.getTime()-6e4*t),e}},timestamp:{priority:120,set:function(e,t){return e.date=new Date(t),e}}},li=110,pi=6e4,hi=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,di=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,fi="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},mi=it(function(e,t){function n(e,t,n){n=n||{};var r;return r="string"==typeof i[e]?i[e]:1===t?i[e].one:i[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};e.exports=t.default}),gi=it(function(e,t){function n(e){return e.replace(r,function(e){return e.slice(1)})}function i(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||n(e.L),ll:e.ll||n(e.LL),lll:e.lll||n(e.LLL),llll:e.llll||n(e.LLLL)};return function(e){return t[e]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=/MMMM|MM|DD|dddd/g;e.exports=t.default}),yi=it(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=gi,i=function(e){return e&&e.__esModule?e:{default:e}}(n),r=(0,i.default)({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"});t.default=r,e.exports=t.default}),vi=it(function(e,t){function n(e,t,n,r){return i[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"};e.exports=t.default}),bi=it(function(e,t){function n(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),wi=it(function(e,t){function n(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),_i=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}Object.defineProperty(t,"__esModule",{value:!0});var r=bi,o=n(r),s=wi,a=n(s),c={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},l={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},p={ordinalNumber:i,weekday:(0,o.default)(c,"long"),weekdays:(0,a.default)(c,"long"),month:(0,o.default)(u,"long"),months:(0,a.default)(u,"long"),timeOfDay:(0,o.default)(l,"long",function(e){return e/12>=1?1:0}),timesOfDay:(0,a.default)(l,"long")};t.default=p,e.exports=t.default}),Di=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Ci=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Oi=it(function(e,t){function n(e){return function(t){return String(t).match(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Si=it(function(e,t){function n(e){return parseInt(e[1],10)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Mi=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Di,r=n(i),o=Ci,s=n(o),a=Oi,c=n(a),u=Si,l=n(u),p=/^(\d+)(th|st|nd|rd)?/i,h={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},d={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},f={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},m={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},g={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},y={any:[/^a/i,/^p/i]},v={ordinalNumbers:(0,c.default)(p),ordinalNumber:l.default,weekdays:(0,r.default)(h,"long"),weekday:(0,s.default)(d,"any"),months:(0,r.default)(f,"long"),month:(0,s.default)(m,"any"),timesOfDay:(0,r.default)(g,"long"),timeOfDay:(0,s.default)(y,"any")};t.default=v,e.exports=t.default}),Ti=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=mi,r=n(i),o=yi,s=n(o),a=vi,c=n(a),u=_i,l=n(u),p=Mi,h=n(p),d={formatDistance:r.default,formatLong:s.default,formatRelative:c.default,localize:l.default,match:h.default,options:{weekStartsOn:0,firstWeekContainsDate:1}};t.default=d,e.exports=t.default}),ki=function(e){return e&&e.__esModule?e.default:e}(Ti),Pi=Object.freeze({default:ki,__moduleExports:Ti}),xi=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=1?1:0}),timesOfDay:ot(i,"long")}),this._locale.match=xi({},this._locale.match,{weekdays:st(t,"long"),weekday:at(t,"long"),months:st(n,"long"),month:at(n,"long"),timesOfDay:st(r,"long"),timeOfDay:at(r,"long")})}return Object.defineProperty(e.prototype,"_config",{get:function(){return{weekStartsOn:this._weekStartsOn,locale:this._locale}},enumerable:!0,configurable:!0}),e.prototype.format=function(e,t){return We(e,t,this._config)},e.prototype.parse=function(e,t,n){return et(e,t,n,this._config)},e}(),Ei=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Li=function(){function e(e,t){this._format=e,this._parser=new Ii(t)}return e.prototype.format=function(e){return this._parser.format(e,this._format)},e.prototype.parse=function(e,t){return void 0===t&&(t=new Date),this._parser.parse(e,this._format,t)},e}(),ji=function(e){function t(t,n){var i={time:"HH:mm",datetime:"YYYY-MM-DDTHH:mm",date:"YYYY-MM-DD",month:"YYYY-MM",year:"YYYY"};return e.call(this,i[t],n)||this}return Ei(t,e),t}(Li),Vi=function(){function e(e,t,n,i,r){this.start=e,this.dates=t,this.items=n,this.groupedItems=i,this._comparer=r}return Object.defineProperty(e.prototype,"inRange",{get:function(){return this.items.filter(function(e){return!e.isOutsideRange})},enumerable:!0,configurable:!0}),e.prototype.find=function(e){var t=this;return this.items.find(function(n){return t._comparer.equal(n.date,e.date)})},e.prototype.findIndex=function(e){var t=this -;return e?this.items.findIndex(function(n){return t._comparer.equal(n.date,e.date)}):-1},e.prototype.containsDate=function(e){var t=this;return!!this.inRange.find(function(n){return t._comparer.equal(n.date,e)})},e}(),Hi=function(){function e(e,t,n){this.interval=e,this.marginal=e+1,this.rows=t,this.columns=n}return Object.defineProperty(e.prototype,"dateComparer",{get:function(){return new En(this.marginal,this.service.inFinalView)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.rows*this.columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMoveNext",{get:function(){var e=this.next.inRange[0];return!e||!this.service.maxDate||e.date<=this.service.maxDate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMovePrevious",{get:function(){var e=this.previous.inRange.slice(-1).pop();return!e||!this.service.minDate||e.date>=this.service.minDate},enumerable:!0,configurable:!0}),e.prototype.loadService=function(e){this.service=e,this.refresh()},e.prototype.refresh=function(){this.current=this.calcRange(this.service.currentDate),this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate))),this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.move=function(e){return e?this.moveNext():this.movePrevious()},e.prototype.moveNext=function(){Vt.next(this.interval,this.service.currentDate),this.previous=this.current,this.current=this.next,this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.movePrevious=function(){Vt.previous(this.interval,this.service.currentDate),this.next=this.current,this.current=this.previous,this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.calc=function(e){return e?this.next:this.previous},e.prototype.calcRange=function(e){var t=this.calcStart(e);this.service.inFinalView&&Vt.startOf(this.marginal,t,!0);var n=this.calcDates(t),i=this.calcItems(n,e);return new Vi(t,n,i,jt.Array.group(i,this.columns),this.dateComparer)},e.prototype.calcStart=function(e){return Vt.startOf(this.interval,Vt.clone(e))},e.prototype.calcDates=function(e){var t=this;return jt.Array.range(this.length).map(function(n){return Vt.add(t.marginal,Vt.clone(e),n)})},e.prototype.calcItems=function(e,t){var n=this;return e.map(function(e){var i=new fn(e);return i.isDisabled=!n.dateComparer.between(i.date,n.service.minDate,n.service.maxDate),i.isActive=n.dateComparer.equal(i.date,n.service.selectedDate),i.isToday=n.dateComparer.equal(i.date,new Date),i.isSelectable=i.isDisabled,n.configureItem(i,t),i})},e}(),Ri=function(){function e(){this.onZoomOut=new t.EventEmitter}return e.decorators=[{type:t.Component,args:[{selector:"sui-calendar-view-title",template:'\n\n \n\n\n \n\n\n \n\n',styles:["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={ranges:[{type:t.Input}],onZoomOut:[{type:t.Output,args:["zoomOut"]}]},e}(),Ai={Year:"year",Month:"month",Date:"date",Datetime:"datetime",Time:"time"},Fi=function(){function e(e){this.service=new dn(new xn,e.get().datepicker),this._calendarClasses=!0}return e.prototype.onMouseDown=function(e){e.preventDefault()},e.decorators=[{type:t.Component,args:[{selector:"sui-datepicker",template:'\n\n \n \n \n \n \n\n',styles:["\n:host {\n user-select: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:mt}]},e.propDecorators={_calendarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.active"]},{type:t.HostBinding,args:["class.calendar"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}]},e}(),Yi={Hover:"hover",Click:"click",OutsideClick:"outsideClick",Focus:"focus",Manual:"manual"},Bi=function(){function e(e){void 0===e&&(e={}),this.placement=tn.TopLeft,this.trigger=Yi.Hover,this.isInverted=!1,this.delay=0,this.isBasic=!1,this.transition="scale",this.transitionDuration=200,Object.assign(this,e)}return e}(),Ni=function(){function n(e){this.elementRef=e,this.transitionController=new vt(!1),this._isOpen=!1,this.onOpen=new t.EventEmitter,this.onClose=new t.EventEmitter,this._tabindex=0}return Object.defineProperty(n.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"anchor",{set:function(e){this.positioningService=new nn(e,this._container.element,this.config.placement,".dynamic.arrow")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"direction",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"alignment",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").pop()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dynamicClasses",{get:function(){var e={};return this.direction&&(e[this.direction]=!0),this.alignment&&(e[this.alignment]=!0),this.config.isInverted&&(e.inverted=!0),this.config.isBasic&&(e.basic=!0),e},enumerable:!0,configurable:!0}),n.prototype.open=function(){var t=this;this.isOpen||(clearTimeout(this.closingTimeout),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.In,function(){var e=t.elementRef.nativeElement.querySelector("[autofocus]");e&&(setTimeout(function(){return e.focus()},10),setTimeout(function(){return e.focus()},t.config.transitionDuration))})),this.positioningService.placement=this.config.placement,setTimeout(function(){return t.positioningService.update()}),this._isOpen=!0,this.onOpen.emit())},n.prototype.toggle=function(){return this.isOpen?this.close():this.open()},n.prototype.close=function(){var t=this;this.isOpen&&(this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.Out)),clearTimeout(this.closingTimeout),this.closingTimeout=window.setTimeout(function(){return t.onClose.emit()},this.config.transitionDuration),this._isOpen=!1)},n.prototype.onClick=function(e){e.stopPropagation()},n.decorators=[{type:t.Component,args:[{selector:"sui-popup",template:'\n\n',styles:['\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor\'s mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed \'vertically\'. */\n.ui.popup[direction="top"],\n.ui.popup[direction="bottom"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed \'horizontally\'. */\n.ui.popup[direction="left"],\n.ui.popup[direction="right"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n']}]}],n.ctorParameters=function(){return[{type:t.ElementRef}]},n.propDecorators={_container:[{type:t.ViewChild,args:["container",{read:t.ViewContainerRef}]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],_tabindex:[{type:t.HostBinding,args:["attr.tabindex"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(),Ui=function(){function e(e,t,n,i){var r=this;this._element=t,this._componentFactory=n,this._componentRef=this._componentFactory.createComponent(Ni),this.popup.config=i,this.popup.onClose.subscribe(function(){return r.cleanup()}),this._documentListener=e.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"popup",{get:function(){return this._componentRef.instance},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){e&&Object.assign(this.popup.config,e)},e.prototype.openDelayed=function(){var e=this;clearTimeout(this._openingTimeout),this._openingTimeout=window.setTimeout(function(){return e.open()},this.popup.config.delay)},e.prototype.open=function(){this._componentFactory.attachToApplication(this._componentRef),this._componentFactory.moveToDocumentBody(this._componentRef),this.popup.anchor=this._element,this.popup.open();var e=this.popupOnOpen;e&&e.call(this)},e.prototype.close=function(){clearTimeout(this._openingTimeout),this._componentRef&&this.popup.close();var e=this.popupOnClose;e&&e.call(this)},e.prototype.toggleDelayed=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.openDelayed():this.close()},e.prototype.toggle=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.open():this.close()},e.prototype.onMouseEnter=function(){this.popup.config.trigger===Yi.Hover&&this.openDelayed()},e.prototype.onMouseLeave=function(){this.popup.config.trigger===Yi.Hover&&this.close()},e.prototype.onClick=function(){this.popup.config.trigger===Yi.Click||this.popup.config.trigger===Yi.OutsideClick?this.toggleDelayed():this.popup.config.trigger!==Yi.Focus||this._componentRef&&(!this._componentRef||this.popup.isOpen)||this.openDelayed()},e.prototype.onDocumentClick=function(e){if(this._componentRef&&this.popup.config.trigger===Yi.OutsideClick){var t=e.target;this._element.nativeElement.contains(t)||this.close()}},e.prototype.onFocusIn=function(){this.popup.config.trigger===Yi.Focus&&this.openDelayed()},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.popup.elementRef.nativeElement.contains(e.relatedTarget)||this.popup.config.trigger!==Yi.Focus||this.close()},e.prototype.cleanup=function(){clearTimeout(this._openingTimeout),this._componentRef.instance&&this._componentRef.instance.positioningService&&this._componentRef.instance.positioningService.destroy(),this._componentFactory.detachFromApplication(this._componentRef)},e.prototype.ngOnDestroy=function(){this.cleanup(),this._documentListener()},e.propDecorators={onMouseEnter:[{type:t.HostListener,args:["mouseenter"]}],onMouseLeave:[{type:t.HostListener,args:["mouseleave"]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wi=function(e){function t(t,n,i,r,o){var s=e.call(this,t,n,i,o)||this;return s._component=r,s}return zi(t,e),Object.defineProperty(t.prototype,"componentInstance",{get:function(){if(this._contentComponentRef)return this._contentComponentRef.instance},enumerable:!0,configurable:!0}),t.prototype.open=function(){this._contentComponentRef||(this._contentComponentRef=this._componentFactory.createComponent(this._component),this._componentFactory.attachToView(this._contentComponentRef,this.popup.templateSibling)),e.prototype.open.call(this)},t.prototype.cleanup=function(){e.prototype.cleanup.call(this),this._contentComponentRef&&(this._contentComponentRef.destroy(),this._contentComponentRef=void 0)},t}(Ui),qi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ki=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return qi(t,e),t}(Bi),$i=function(e){function t(t,n,i,r){return e.call(this,t,n,i,r)||this}return qi(t,e),t.prototype.configure=function(t){e.prototype.configure.call(this,t),t&&(this.template=t.template,this.context=t.context)},t.prototype.open=function(){this.template&&(this.popup.templateSibling.clear(),this._componentFactory.createView(this.popup.templateSibling,this.template,{$implicit:this.popup,context:this.context})),e.prototype.open.call(this)},t}(Ui),Qi=function(){function e(){}return Object.defineProperty(e.prototype,"direction",{get:function(){if(this.placement)return this.placement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){if(this.placement){var e=this.placement.split(" ").pop();return e===this.direction?"center":e}},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-popup-arrow",template:'\n
\n
\n',styles:['\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction="top"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction="left"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction="bottom"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction="right"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction="bottom"][alignment="left"],\n.static.arrow[direction="top"][alignment="left"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction="left"][alignment="top"],\n.static.arrow[direction="right"][alignment="top"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction="bottom"][alignment="right"],\n.static.arrow[direction="top"][alignment="right"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction="left"][alignment="bottom"],\n.static.arrow[direction="right"][alignment="bottom"] {\n top: auto;\n bottom: 1em;\n}\n']}]}],e.ctorParameters=function(){return[]},e.propDecorators={placement:[{type:t.Input}],inverted:[{type:t.HostBinding,args:["class.inverted"]},{type:t.Input}]},e}(),Gi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ji=function(e){function n(){return e.call(this)||this}return Gi(n,e),n.decorators=[{type:t.Injectable}],n.ctorParameters=function(){return[]},n}(Bi),Zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xi=function(e){function n(t,n,i,r){return e.call(this,t,n,i,new Bi(r))||this}return Zi(n,e),Object.defineProperty(n.prototype,"popupHeader",{set:function(e){this.popup.config.header=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupText",{set:function(e){this.popup.config.text=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupInverted",{set:function(e){this.popup.config.isInverted=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupBasic",{set:function(e){this.popup.config.isBasic=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupPlacement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupDelay",{set:function(e){this.popup.config.delay=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTrigger",{get:function(){return this.popup.config.trigger},set:function(e){this.popup.config.trigger=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplate",{set:function(e){this.template=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplateContext",{set:function(e){this.context=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupConfig",{set:function(e){this.configure(e)},enumerable:!0,configurable:!0}),n.decorators=[{type:t.Directive,args:[{selector:"[suiPopup]",exportAs:"suiPopup"}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:Ji}]},n.propDecorators={popupHeader:[{type:t.Input}],popupText:[{type:t.Input}],popupInverted:[{type:t.Input}],popupBasic:[{type:t.Input}],popupTransition:[{type:t.Input}],popupTransitionDuration:[{type:t.Input}],popupPlacement:[{type:t.Input}],popupDelay:[{type:t.Input}],popupTrigger:[{type:t.Input}],popupTemplate:[{type:t.Input}],popupTemplateContext:[{type:t.Input}],popupConfig:[{type:t.Input}]},n}($i),er=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt,rn],declarations:[Xi,Qi,Ni],exports:[Xi,Ni],providers:[Ji],entryComponents:[Ni]}]}],e.ctorParameters=function(){return[]},e}(),tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),nr=function(n){function i(e,i,r,o){var s=n.call(this,e,i,r,Fi,new Bi({trigger:Yi.Focus,placement:tn.BottomLeft,transition:"scale",transitionDuration:200}))||this;return s.renderer=e,s.localizationService=o,s.renderer.addClass(s.popup.elementRef.nativeElement,"ui"),s.renderer.addClass(s.popup.elementRef.nativeElement,"calendar"),s.onLocaleUpdate(),s.localizationService.onLanguageUpdate.subscribe(function(){return s.onLocaleUpdate()}),s.onSelectedDateChange=new t.EventEmitter,s.onValidatorChange=new t.EventEmitter,s.mode=Ai.Datetime,s}return tr(i,n),Object.defineProperty(i.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){this._selectedDate=e,this.onSelectedDateChange.emit(e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mode",{get:function(){return this._mode},set:function(e){switch(this._mode=e||Ai.Datetime,this._mode){case Ai.Year:this.config=new Tn;break;case Ai.Month:this.config=new kn;break;case Ai.Date:default:this.config=new Pn;break;case Ai.Datetime:this.config=new xn;break;case Ai.Time:this.config=new In}this.writeValue(this.selectedDate)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localeValues",{get:function(){return this.localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),i.prototype.popupOnOpen=function(){var e=this;this.componentInstance&&(this.componentInstance.service.config=this.config,this.componentInstance.service.localeValues=this.localeValues,this.componentInstance.service.currentDate=this.initialDate||new Date,this.componentInstance.service.selectedDate=this.selectedDate,this.componentInstance.service.maxDate=this.maxDate,this.componentInstance.service.minDate=this.minDate,void 0!=this.firstDayOfWeek&&(this.componentInstance.service.firstDayOfWeek=this.firstDayOfWeek),this.componentInstance.service.reset(),this.componentInstance.service.onDateChange.subscribe(function(t){e.selectedDate=t,e.close()}))},i.prototype.ngOnChanges=function(e){var t=e.maxDate,n=e.minDate,i=e.mode;(t||n||i)&&this.onValidatorChange.emit()},i.prototype.onLocaleUpdate=function(){this._localeValues=this.localizationService.get().datepicker},i.prototype.validate=function(e){var t=e.value;if(void 0!=t){if(this.minDate&&tthis.maxDate)return{suiMaxDate:{required:this.maxDate,actual:t}}}return null},i.prototype.writeValue=function(e){this.selectedDate=e,this.componentInstance&&(this.componentInstance.service.selectedDate=e)},i.prototype.onKeyDown=function(t){t.keyCode===e.KeyCode.Escape&&this.close()},i.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",providers:[a(i)]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:mt}]},i.propDecorators={mode:[{type:t.Input,args:["pickerMode"]}],initialDate:[{type:t.Input,args:["pickerInitialDate"]}],maxDate:[{type:t.Input,args:["pickerMaxDate"]}],minDate:[{type:t.Input,args:["pickerMinDate"]}],firstDayOfWeek:[{type:t.Input,args:["pickerFirstDayOfWeek"]}],localeOverrides:[{type:t.Input,args:["pickerLocaleOverrides"]}],placement:[{type:t.Input,args:["pickerPlacement"]}],transition:[{type:t.Input,args:["pickerTransition"]}],transitionDuration:[{type:t.Input,args:["pickerTransitionDuration"]}],onSelectedDateChange:[{type:t.Output,args:["pickerSelectedDateChange"]}],onValidatorChange:[{type:t.Output,args:["pickerValidatorChange"]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},i}(Wi),ir=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerSelectedDateChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(Et),rr=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerValidatorChange)":"onValidatorChange()"},providers:[a(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(It),or=it(function(e){!function(t,n,i){e.exports?e.exports=i():t.bowser=i()}(fi,0,function(){function e(e){function t(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}function n(t){var n=e.match(t);return n&&n.length>1&&n[2]||""}var i,r=t(/(ipod|iphone|ipad)/i).toLowerCase(),o=/like android/i.test(e),a=!o&&/android/i.test(e),c=/nexus\s*[0-6]\s*/i.test(e),u=!c&&/nexus\s*[0-9]+/i.test(e),l=/CrOS/.test(e),p=/silk/i.test(e),h=/sailfish/i.test(e),d=/tizen/i.test(e),f=/(web|hpw)os/i.test(e),m=/windows phone/i.test(e),g=(/SamsungBrowser/i.test(e),!m&&/windows/i.test(e)),y=!r&&!p&&/macintosh/i.test(e),v=!a&&!h&&!d&&!f&&/linux/i.test(e),b=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),w=t(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(e)&&!/tablet pc/i.test(e),D=!_&&/[^-]mobi/i.test(e),C=/xbox/i.test(e);/opera/i.test(e)?i={name:"Opera",opera:s,version:w||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?i={name:"Opera",opera:s,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||w}:/SamsungBrowser/i.test(e)?i={name:"Samsung Internet for Android",samsungBrowser:s,version:w||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?i={name:"Opera Coast",coast:s,version:w||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?i={name:"Yandex Browser",yandexbrowser:s,version:w||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?i={name:"UC Browser",ucbrowser:s,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?i={name:"Maxthon",maxthon:s,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?i={name:"Epiphany",epiphany:s,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?i={name:"Puffin",puffin:s,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?i={name:"Sleipnir",sleipnir:s,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?i={name:"K-Meleon",kMeleon:s,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:m?(i={name:"Windows Phone",osname:"Windows Phone",windowsphone:s},b?(i.msedge=s,i.version=b):(i.msie=s,i.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?i={name:"Internet Explorer",msie:s,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:l?i={name:"Chrome",osname:"Chrome OS",chromeos:s,chromeBook:s,chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(e)?i={name:"Microsoft Edge",msedge:s,version:b}:/vivaldi/i.test(e)?i={name:"Vivaldi",vivaldi:s,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||w}:h?i={name:"Sailfish",osname:"Sailfish OS",sailfish:s,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?i={name:"SeaMonkey",seamonkey:s,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(i={name:"Firefox",firefox:s,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(i.firefoxos=s,i.osname="Firefox OS")):p?i={name:"Amazon Silk",silk:s,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?i={name:"PhantomJS",phantom:s,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?i={name:"SlimerJS",slimer:s,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?i={name:"BlackBerry",osname:"BlackBerry OS",blackberry:s,version:w||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:f?(i={name:"WebOS",osname:"WebOS",webos:s,version:w||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(i.touchpad=s)):/bada/i.test(e)?i={name:"Bada",osname:"Bada",bada:s,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:d?i={name:"Tizen",osname:"Tizen",tizen:s,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||w}:/qupzilla/i.test(e)?i={name:"QupZilla",qupzilla:s,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||w}:/chromium/i.test(e)?i={name:"Chromium",chromium:s,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||w}:/chrome|crios|crmo/i.test(e)?i={name:"Chrome",chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:a?i={name:"Android",version:w}:/safari|applewebkit/i.test(e)?(i={name:"Safari",safari:s},w&&(i.version=w)):r?(i={name:"iphone"==r?"iPhone":"ipad"==r?"iPad":"iPod"},w&&(i.version=w)):i=/googlebot/i.test(e)?{name:"Googlebot",googlebot:s,version:t(/googlebot\/(\d+(\.\d+))/i)||w}:{name:t(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!i.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(i.name=i.name||"Blink",i.blink=s):(i.name=i.name||"Webkit",i.webkit=s),!i.version&&w&&(i.version=w)):!i.opera&&/gecko\//i.test(e)&&(i.name=i.name||"Gecko",i.gecko=s,i.version=i.version||t(/gecko\/(\d+(\.\d+)?)/i)),i.windowsphone||!a&&!i.silk?!i.windowsphone&&r?(i[r]=s,i.ios=s,i.osname="iOS"):y?(i.mac=s,i.osname="macOS"):C?(i.xbox=s,i.osname="Xbox"):g?(i.windows=s,i.osname="Windows"):v&&(i.linux=s,i.osname="Linux"):(i.android=s,i.osname="Android");var O="";i.windows?O=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)):i.windowsphone?O=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):i.mac?(O=t(/Mac OS X (\d+([_\.\s]\d+)*)/i),O=O.replace(/[_\s]/g,".")):r?(O=t(/os (\d+([_\s]\d+)*) like mac os x/i),O=O.replace(/[_\s]/g,".")):a?O=t(/android[ \/-](\d+(\.\d+)*)/i):i.webos?O=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):i.blackberry?O=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):i.bada?O=t(/bada\/(\d+(\.\d+)*)/i):i.tizen&&(O=t(/tizen[\/\s](\d+(\.\d+)*)/i)),O&&(i.osversion=O);var S=!i.windows&&O.split(".")[0];return _||u||"ipad"==r||a&&(3==S||S>=4&&!D)||i.silk?i.tablet=s:(D||"iphone"==r||"ipod"==r||a||c||i.blackberry||i.webos||i.bada)&&(i.mobile=s),i.msedge||i.msie&&i.version>=10||i.yandexbrowser&&i.version>=15||i.vivaldi&&i.version>=1||i.chrome&&i.version>=20||i.samsungBrowser&&i.version>=4||i.firefox&&i.version>=20||i.safari&&i.version>=6||i.opera&&i.version>=10||i.ios&&i.osversion&&i.osversion.split(".")[0]>=6||i.blackberry&&i.version>=10.1||i.chromium&&i.version>=20?i.a=s:i.msie&&i.version<10||i.chrome&&i.version<20||i.firefox&&i.version<20||i.safari&&i.version<6||i.opera&&i.version<10||i.ios&&i.osversion&&i.osversion.split(".")[0]<6||i.chromium&&i.version<20?i.c=s:i.x=s,i}function t(e){return e.split(".").length}function n(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n=0;){if(r[0][i]>r[1][i])return 1;if(r[0][i]!==r[1][i])return-1;if(0===i)return 0}}function r(t,n,r){var o=a;"string"==typeof n&&(r=n,n=void 0),void 0===n&&(n=!1),r&&(o=e(r));var s=""+o.version;for(var c in t)if(t.hasOwnProperty(c)&&o[c]){if("string"!=typeof t[c])throw new Error("Browser version in the minVersion map should be a string: "+c+": "+String(t));return i([s,t[c]])<0}return n}function o(e,t,n){return!r(e,t,n)}var s=!0,a=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return a.test=function(e){for(var t=0;t\n\n \n \n \n {{ date }}\n \n \n \n \n {{ day }}\n \n\n\n \n {{ item.humanReadable }}\n \n \n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),vr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),br=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vr(t,e),t.prototype.configureItem=function(e,t){var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");e.humanReadable=new Li(n,this.service.localeValues).format(e.date),e.isOutsideRange=!1},t}(Hi),wr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Hour,new br(e.DatePrecision.Date,6,4))||this}return vr(i,n),Object.defineProperty(i.prototype,"date",{get:function(){return new Li(this.service.localeValues.formats.date,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-hour-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),_r=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Dr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _r(n,t),n.prototype.calcStart=function(t){return Vt.startOf(e.DatePrecision.Hour,Vt.clone(t),!0)},n.prototype.calcDates=function(t){return jt.Array.range(this.length).map(function(n){return Vt.add(e.DatePrecision.Minute,Vt.clone(t),5*n)})},n.prototype.configureItem=function(e,t){e.humanReadable=new Li(this.service.localeValues.formats.time,this.service.localeValues).format(e.date),e.isOutsideRange=!1},n}(Hi),Cr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Minute,new Dr(e.DatePrecision.Hour,4,3))||this}return _r(i,n),Object.defineProperty(i.prototype,"date",{get:function(){if(this.service.config.mode!==e.CalendarMode.TimeOnly){var t=this.service.localeValues.formats.datetime.replace(/[ms]/g,"0");return new Li(t,this.service.localeValues).format(this.currentDate)}var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");return new Li(n,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-minute-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Or=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Or(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=this.service.localeValues.monthsShort[e.date.getMonth()],e.isOutsideRange=!1},t}(Hi),Mr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Month,new Sr(e.DatePrecision.Year,4,3))||this}return Or(i,n),Object.defineProperty(i.prototype,"year",{get:function(){return new Li(this.service.localeValues.formats.year,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-month-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Tr(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=jt.String.padLeft(e.date.getFullYear().toString(),4,"0"),e.isOutsideRange=e.date.getFullYear()>=this.calcStart(t).getFullYear()+10},t}(Hi),Pr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Year,new kr(e.DatePrecision.Decade,4,3))||this}return Tr(i,n),Object.defineProperty(i.prototype,"decadeStart",{get:function(){return Vt.startOf(e.DatePrecision.Decade,Vt.clone(this.service.currentDate)).getFullYear()},enumerable:!0,configurable:!0}),i.prototype.pad=function(e){return jt.String.padLeft(e.toString(),4,"0")},i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-year-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),xr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,er,gt,rn],declarations:[mn,Ri,Pr,Mr,yr,wr,Cr,Fi,nr,ir,rr,fr],exports:[nr,ir,rr,fr],entryComponents:[Fi]}]}],e.ctorParameters=function(){return[]},e}(),Ir=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Er=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o._isDimmed=!1,o.isDimmedChange=new t.EventEmitter,o.isClickable=!0,o.wrapContent=!0,o._dimmerClasses=!0,o}return Ir(i,n),Object.defineProperty(i.prototype,"isDimmed",{get:function(){return this._isDimmed},set:function(t){var n=!!t;this._transitionController?this._isDimmed!==n&&(this._isDimmed=n,this._transitionController.stopAll(),this._transitionController.animate(new yt("fade",this.transitionDuration,n?e.TransitionDirection.In:e.TransitionDirection.Out))):(this._transitionController=new vt(n,"block"),this.setTransitionController(this._transitionController),this._isDimmed=n)},enumerable:!0,configurable:!0}),i.prototype.onClick=function(){this.isClickable&&(this.isDimmed=!1,this.isDimmedChange.emit(this.isDimmed))},i.decorators=[{type:t.Component,args:[{selector:"sui-dimmer",template:'\n
\n
\n \n
\n
\n',styles:["\n:host.dimmer {\n transition: none;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},i.propDecorators={_dimmerClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dimmer"]}],isDimmed:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDimmedChange:[{type:t.Output}],isClickable:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],wrapContent:[{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},i}(bt),Lr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[Er],exports:[Er]}]}],e.ctorParameters=function(){return[]},e}(),jr={ItemClick:"itemClick",OutsideClick:"outsideClick",Disabled:"disabled"},Vr=function(){function e(e){void 0===e&&(e=jr.ItemClick),this.isOpen=!1,this.isOpenChange=new t.EventEmitter,this.isDisabled=!1,this.autoCloseMode=e,this.children=[]}return Object.defineProperty(e.prototype,"isNested",{get:function(){return!!this.parent},enumerable:!0,configurable:!0}),e.prototype.setOpenState=function(e,t){var n=this;void 0===t&&(t=!1),this.isOpen===e||this.isDisabled?this.isOpen!==e&&this.isDisabled&&this.delay(function(){return n.isOpenChange.emit(n.isOpen)}):(this.isOpen=!!e,this.isAnimating=!0,this.delay(function(){return n.isOpenChange.emit(n.isOpen)}),this.isOpen||this.children.forEach(function(e){return e.setOpenState(n.isOpen)}),this.parent&&t&&this.parent.setOpenState(this.isOpen,!0))},e.prototype.setDisabledState=function(e){this.isDisabled!==e&&(e&&this.setOpenState(!1),this.isDisabled=!!e)},e.prototype.toggleOpenState=function(){this.setOpenState(!this.isOpen)},e.prototype.registerChild=function(e){this.isChildRegistered(e)||(this.children.push(e),e.parent=this)},e.prototype.isChildRegistered=function(e){return this===e||!!this.children.find(function(t){return!!t.children.find(function(t){return t.isChildRegistered(e)})})},e.prototype.clearChildren=function(){this.children.forEach(function(e){e.parent=void 0}),this.children=[]},e.prototype.delay=function(e){setTimeout(function(){return e()})},e}();!function(e){"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,n=(t.document||t.ownerDocument).querySelectorAll(e),i=0;n[i]&&n[i]!==t;)++i;return Boolean(n[i])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window.Element.prototype);var Hr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rr=function(){function e(e,t){this._renderer=e,this.element=t,this.isSelected=!1,this.selectedClass="selected"}return Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.element.nativeElement.classList.contains("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},set:function(e){e?this._renderer.addClass(this.element.nativeElement,this.selectedClass):this._renderer.removeClass(this.element.nativeElement,this.selectedClass)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasChildDropdown",{get:function(){return!!this.childDropdownMenu},enumerable:!0,configurable:!0}),e.prototype.performClick=function(){this.element.nativeElement.click()},e.decorators=[{type:t.Directive,args:[{selector:".item"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={childDropdownMenu:[{type:t.ContentChild,args:[t.forwardRef(function(){return Ar})]}]},e}(),Ar=function(n){function i(e,t,i){var r=n.call(this,e,t,i)||this;return r.element=t,r._transitionController=new vt(!1),r.setTransitionController(r._transitionController),r.menuTransition="slide down",r.menuTransitionDuration=200,r.menuAutoSelectFirst=!1,r.menuSelectedItemClass="selected",r._documentKeyDownListener=e.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),r}return Hr(i,n),Object.defineProperty(i.prototype,"service",{get:function(){return this._service},set:function(t){var n=this;this._service=t;var i=this._service.isOpen;this._service.isOpenChange.subscribe(function(t){t!==i&&(n._transitionController.stopAll(),n._transitionController.animate(new yt(n.menuTransition,n.menuTransitionDuration,e.TransitionDirection.Either,function(){return n._service.isAnimating=!1}))),t||n.selectedItems.length>1&&n.resetSelection(),i=t})},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"items",{set:function(e){this._itemsQueryOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_itemsQuery",{get:function(){return this._itemsQueryOverride||this._itemsQueryInternal},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_items",{get:function(){return this._itemsQuery.filter(function(e){return!e.isDisabled})},enumerable:!0,configurable:!0}),i.prototype.onClick=function(e){if(!e.eventHandled&&(e.eventHandled=!0,this._service.autoCloseMode===jr.ItemClick)){var t=e.target;this.element.nativeElement.contains(t.closest(".item"))&&!/input|textarea/i.test(t.tagName)&&this._service.setOpenState(!1,!0)}},i.prototype.onDocumentKeyDown=function(t){if(this._service.isOpen&&!this._service.isNested){!/input/i.test(t.target.tagName)&&[e.KeyCode.Escape,e.KeyCode.Enter,e.KeyCode.Up,e.KeyCode.Down,e.KeyCode.Left,e.KeyCode.Right].find(function(e){return e===t.keyCode})&&t.preventDefault();var n=this.selectedItems.slice(-1)[0],i=this;if(this.selectedItems.length>=2){var r=this.selectedItems.slice(-2)[0];i=r.childDropdownMenu}switch(t.keyCode){case e.KeyCode.Escape:this._service.setOpenState(!1);break;case e.KeyCode.Down:case e.KeyCode.Up:this.selectedItems.pop(),this.selectedItems.push(i.updateSelection(n,t.keyCode)),t.preventDefault();break;case e.KeyCode.Enter:if(n&&!n.hasChildDropdown){n.performClick();break}case e.KeyCode.Right:n&&n.hasChildDropdown&&(n.childDropdownMenu.service.setOpenState(!0),this.selectedItems.push(n.childDropdownMenu.updateSelection(n,t.keyCode)));break;case e.KeyCode.Left:if(this.selectedItems.length>=2){this.selectedItems.pop();var r=this.selectedItems.slice(-1)[0];r.childDropdownMenu.service.setOpenState(!1),r.isSelected=!0}}}},i.prototype.resetSelection=function(){var e=this;this.selectedItems=[],this._items.forEach(function(t){t.selectedClass=e.menuSelectedItemClass,t.isSelected=!1}),this.menuAutoSelectFirst&&this._items.length>0&&(this._items[0].isSelected=!0,this.scrollToItem(this._items[0]),this.selectedItems.push(this._itemsQuery.first))},i.prototype.updateSelection=function(t,n){t&&(t.isSelected=!1);var i,r=this._items.findIndex(function(e){return e===t});switch(n){case e.KeyCode.Enter:case e.KeyCode.Right:case e.KeyCode.Down:r+=1;break;case e.KeyCode.Up:if(-1===r){r=0;break}r-=1}return i=this._items[r]||t,i&&(i.isSelected=!0,this.scrollToItem(i)),i},i.prototype.scrollToItem=function(e){var t=this.element.nativeElement,n=e.element.nativeElement.getBoundingClientRect(),i=t.getBoundingClientRect(),r=0;n.bottom>i.bottom&&(r=n.bottom-i.bottom),n.top\n\n \x3c!-- Modal component, with transition component attached --\x3e\n \n\n',styles:["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"]}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht}]},n.propDecorators={isClosable:[{type:t.Input}],closeResult:[{type:t.Input}],onApprove:[{type:t.Output,args:["approved"]}],onDeny:[{type:t.Output,args:["denied"]}],onDismiss:[{type:t.Output,args:["dismissed"]}],_modalElement:[{type:t.ViewChild,args:["modal"]}],size:[{type:t.Input}],isFullScreen:[{type:t.Input}],isBasic:[{type:t.Input}],mustScroll:[{type:t.Input}],isInverted:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onDocumentKeyUp:[{type:t.HostListener,args:["document:keyup",["$event"]]}],onDocumentResize:[{type:t.HostListener,args:["window:resize"]}]},n}(),Xr=function(){function e(e){this._componentFactory=e}return e.prototype.open=function(e){var t=this._componentFactory.createComponent(Zr),n=t.instance;if(e instanceof Wr)this._componentFactory.createView(n.templateSibling,e.template,{$implicit:e.context,modal:t.instance.controls});else if(e instanceof qr){var i=this._componentFactory.createComponent(e.component,[{provide:Qr,useValue:new Qr(n.controls,e.context)}]);this._componentFactory.attachToView(i,n.templateSibling);for(var r=i.location.nativeElement;r.hasChildNodes()&&r.parentElement&&r.firstChild;)r.parentElement.appendChild(r.removeChild(r.firstChild));this._componentFactory.detachFromDocument(i)}return this._componentFactory.attachToApplication(t),n.loadConfig(e),new Br(e,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Ht}]},e}(),eo=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Lr,wt,rn],declarations:[Zr],exports:[Zr],providers:[Xr],entryComponents:[Zr]}]}],e.ctorParameters=function(){return[]},e}(),to=function(){function e(){this._popupClasses=!0,this.value=0,this.maximum=100,this.precision=0,this._overrideSuccess=!1,this.autoSuccess=!0,this.showProgress=!0,this._popupClasses=!0}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){var t=+e;Number.isNaN(t)||(this._value=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){var t=+e;Number.isNaN(t)||(this._maximum=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"precision",{get:function(){return this._precision},set:function(e){var t=+e;Number.isNaN(t)||(this._precision=Math.min(Math.max(t,0),20))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_reachedMaximum",{get:function(){return this._overrideSuccess||this.value>=this.maximum&&this.autoSuccess},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"percentage",{get:function(){return(Math.min(Math.max(this.value,0),this.maximum)/this.maximum*100).toFixed(this.precision)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classValue",{set:function(e){(e.includes("attached")||e.includes("tiny"))&&(this.showProgress=!1),e.includes("success")&&(this._overrideSuccess=!0)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-progress",template:'\n
\n
{{ percentage }}%
\n
\n
\n \n
\n',styles:["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_popupClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.progress"]}],autoSuccess:[{type:t.Input}],showProgress:[{type:t.Input}],value:[{type:t.Input}],maximum:[{type:t.Input}],precision:[{type:t.Input}],_reachedMaximum:[{type:t.HostBinding,args:["class.success"]}],percentage:[{type:t.HostBinding,args:["attr.data-percent"]}],classValue:[{type:t.Input,args:["class"]}]},e}(),no=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[to],exports:[to]}]}],e.ctorParameters=function(){return[]},e}(),io=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ro=function(){function e(){this.hoveredIndex=-1,this.value=0,this.valueChange=new t.EventEmitter,this.maximum=5,this.isReadonly=!1,this._ratingClasses=!0}return Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){this._maximum=+e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icons",{get:function(){return new Array(this.maximum)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){this.isReadonly||(this.value=e+1,this.valueChange.emit(this.value))},e.prototype.onMouseover=function(e){this.hoveredIndex=e},e.prototype.onMouseout=function(){this.hoveredIndex=-1},e.prototype.writeValue=function(e){this.value=e},e.decorators=[{type:t.Component,args:[{selector:"sui-rating",template:'\n\n\n',styles:["\n:host.read-only .icon {\n cursor: auto\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_ratingClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.rating"]}],valueChange:[{type:t.Output}],maximum:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],onMouseout:[{type:t.HostListener,args:["mouseout"]}]},e}(),oo=function(e){function n(t){return e.call(this,t)||this}return io(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-rating",host:{"(valueChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:ro}]},n}(Et),so=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[i.FormsModule,n.CommonModule],declarations:[ro,oo],exports:[ro,oo]}]}],e.ctorParameters=function(){return[]},e}(),ao=function(){function e(e){this.componentFactory=e,this._optionClasses=!0,this.formatter=function(e){return""}}return Object.defineProperty(e.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-search-result",template:'\n\n\n'}]}],e.ctorParameters=function(){return[{type:Ht}]},e.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.result"]}],value:[{type:t.Input}],query:[{type:t.Input}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}]},e}(),co=function(){function e(e){void 0===e&&(e=!1);var t=this;this._options=[],this.optionsFilter=function(e,n){var i=t.toRegex(t._query);return i instanceof RegExp&&e.filter(function(e){return jt.Object.readValue(e,t._optionsField).toString().match(i)})},this.allowEmptyQuery=e,this.searchDelay=0,this.reset()}return Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e||[],this._optionsLookup=void 0,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{get:function(){return this._optionsLookup},set:function(e){this._optionsLookup=e,this._options=[],this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasItemLookup",{get:function(){return!!this.optionsLookup&&2===this.optionsLookup.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{get:function(){return this._optionsField},set:function(e){this._optionsField=e,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this._results},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this._isSearching},enumerable:!0,configurable:!0}),e.prototype.updateQueryDelayed=function(e,t){var n=this;void 0===t&&(t=function(){}),this._query=e,clearTimeout(this._searchDelayTimeout),this._searchDelayTimeout=window.setTimeout(function(){n.updateQuery(e,t)},this.searchDelay)},e.prototype.updateQuery=function(e,t){var n=this;if(void 0===t&&(t=function(){}),this._query=e,""===this._query&&!this.allowEmptyQuery)return t();if(this._resultsCache.hasOwnProperty(this._query))return this._results=this._resultsCache[this._query],t();if(this._optionsLookup){this._isSearching=!0;return void this._optionsLookup.call(void 0,this._query).then(function(e){return n._isSearching=!1,n.updateResults(e),t()}).catch(function(e){return n._isSearching=!1,t(e)})}var i=this.optionsFilter.call(void 0,this._options,this._query);return i&&this.updateResults(i),t()},e.prototype.updateResults=function(e){this._resultsCache[this._query]=e,this._results=e},e.prototype.initialLookup=function(e){return Array,this._optionsLookup(void 0,e)},e.prototype.toRegex=function(e){try{return new RegExp(e,"i")}catch(t){return e}},e.prototype.highlightMatches=function(e,t){var n=this.toRegex(t);return n instanceof RegExp?e.replace(n,function(e){return""+e+""}):e},e.prototype.reset=function(){this._results=[],this._resultsCache={},this._isSearching=!1,this.updateQuery("")},e}(),uo=function(){function e(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._searchClasses=!0,this.hasIcon=!0,this.allowEmptyQuery=!1,this.retainSelectedResult=!0,this.searchDelay=200,this.maxResults=7,this.onResultSelected=new t.EventEmitter,this.transition="scale",this.transitionDuration=200,this._documentClickListener=n.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowEmptyQuery",{get:function(){return this._allowEmptyQuery},set:function(e){this._allowEmptyQuery=e,this.searchService.allowEmptyQuery=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this.searchService.query},set:function(e){this.selectedResult=void 0,this.searchService.updateQueryDelayed(e,function(){})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{set:function(e){e&&(this.searchService.options=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{set:function(e){this.searchService.optionsLookup=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resultFormatter",{get:function(){var e=this;return this._resultFormatter?this._resultFormatter:this.searchService.optionsLookup?function(t){return e.readValue(t)}:function(t,n){return e.searchService.highlightMatches(e.readValue(t),n)}},set:function(e){this._resultFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"searchDelay",{set:function(e){this.searchService.searchDelay=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this.searchService.results.slice(0,this.maxResults)},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this._menu.service=this.dropdownService},e.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().search},e.prototype.select=function(e){this.onResultSelected.emit(e),this.dropdownService.setOpenState(!1),this.retainSelectedResult?(this.selectedResult=e,this.searchService.updateQuery(this.readValue(e))):this.searchService.updateQuery("")},e.prototype.onClick=function(e){this.open()},e.prototype.onFocusIn=function(){this.dropdownService.isAnimating||this.open()},e.prototype.open=function(){(this.searchService.query.length>0||this.allowEmptyQuery)&&this.dropdownService.setOpenState(!0)},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.dropdownService.setOpenState(!1)},e.prototype.onDocumentClick=function(e){this._element.nativeElement.contains(e.target)||this.dropdownService.setOpenState(!1)},e.prototype.readValue=function(e){return jt.Object.readValue(e,this.searchService.optionsField)},e.prototype.ngOnDestroy=function(){this._documentClickListener()},e.decorators=[{type:t.Component,args:[{selector:"sui-search",template:'\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n',styles:["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},e.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_searchClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.search"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],hasIcon:[{type:t.Input}],allowEmptyQuery:[{type:t.Input}],placeholder:[{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],optionsField:[{type:t.Input}],resultFormatter:[{type:t.Input}],resultTemplate:[{type:t.Input}],retainSelectedResult:[{type:t.Input}],searchDelay:[{type:t.Input}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],maxResults:[{type:t.Input}],onResultSelected:[{type:t.Output,args:["resultSelected"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),lo=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,gt,rn],declarations:[uo,ao],exports:[uo]}]}],e.ctorParameters=function(){return[]},e}(),po=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ho=function(e){function n(n,i,r){var o=e.call(this,n,i)||this;return o.changeDetector=r,o._optionClasses=!0,o.isActive=!1,o.onSelected=new t.EventEmitter,o.renderedText="",o.usesTemplate=!1,o}return po(n,e),Object.defineProperty(n.prototype,"formatter",{set:function(e){this.usesTemplate?this.renderedText="":this.renderedText=e(this.value)},enumerable:!0,configurable:!0}),n.prototype.onClick=function(e){var t=this;e.eventHandled=!0,setTimeout(function(){return t.onSelected.emit(t.value)})},n.decorators=[{type:t.Component,args:[{selector:"sui-select-option",template:'\n\n\n'}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},n.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.item"]}],value:[{type:t.Input}],onSelected:[{type:t.Output}],isActive:[{type:t.HostBinding,args:["class.active"]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(Rr),fo=function(){function e(e,n){this._renderer=e,this._element=n,this.onQueryUpdated=new t.EventEmitter,this.onQueryKeyDown=new t.EventEmitter,this._searchClass=!0,this._autoComplete="off"}return Object.defineProperty(e.prototype,"query",{set:function(e){this._renderer.setProperty(this._element.nativeElement,"value",e)},enumerable:!0,configurable:!0}),e.prototype.updateQuery=function(e){this.onQueryUpdated.emit(e)},e.prototype.onKeyDown=function(e){this.onQueryKeyDown.emit(e)},e.prototype.focus=function(){var e=this;this._element.nativeElement.focus(),setTimeout(function(){return e._element.nativeElement.focus()})},e.decorators=[{type:t.Directive,args:[{selector:"input[suiSelectSearch]"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_searchClass:[{type:t.HostBinding,args:["class.search"]}],_autoComplete:[{type:t.HostBinding,args:["attr.autocomplete"]}],updateQuery:[{type:t.HostListener,args:["input",["$event.target.value"]]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}(),mo=function(){function n(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co(!0),this.isSearchable=!1,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._renderedSubscriptions=[],this.icon="dropdown",this.transition="slide down",this.transitionDuration=200,this.onTouched=new t.EventEmitter,this._documentKeyDownListener=n.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),this._selectClasses=!0}return Object.defineProperty(n.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isVisible",{get:function(){return this._menu.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_searchClass",{get:function(){return this.isSearchable&&!this.isSearchExternal},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"searchInput",{get:function(){return this._manualSearch||this._internalSearch},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tabIndex",{get:function(){return this.isDisabled?-1:this.dropdownService.isOpen&&this.isSearchExternal?-1:void 0!=this._tabIndex?this._tabIndex:this._searchClass?-1:0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isDisabled",{get:function(){return this.dropdownService.isDisabled},set:function(e){this.dropdownService.isDisabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"options",{set:function(e){e&&(this.searchService.options=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsLookup",{set:function(e){e&&(this.searchService.optionsLookup=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"filteredOptions",{get:function(){return this.searchService.results},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"query",{get:function(){return this.isSearchable?this.searchService.query:void 0},set:function(e){var t=this;void 0!=e&&(this.queryUpdateHook(),this.updateQuery(e),this._renderedOptions.forEach(function(e){return t.initialiseRenderedOption(e)}),this.searchInput&&(this.searchInput.query=e))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelField",{get:function(){return this.searchService.optionsField},set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelGetter",{get:function(){var e=this;return function(t){var n=jt.Object.readValue(t,e.labelField);return void 0!=n?n.toString():""}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valueGetter",{get:function(){var e=this;return function(t){return jt.Object.readValue(t,e.valueField)}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"configuredFormatter",{get:function(){var e=this;return this._optionFormatter?function(t){return e._optionFormatter(t,e.isSearchable?e.query:void 0)}:this.searchService.optionsLookup?function(t){return e.labelGetter(t)}:function(t){return e.searchService.highlightMatches(e.labelGetter(t),e.query||"")}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionFormatter",{set:function(e){this._optionFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),n.prototype.ngAfterContentInit=function(){var e=this;this._menu.service=this.dropdownService,this._menu.items=this._renderedOptions,this._manualSearch&&(this.isSearchable=!0,this.isSearchExternal=!0),this.searchInput&&(this.searchInput.onQueryUpdated.subscribe(function(t){return e.query=t}),this.searchInput.onQueryKeyDown.subscribe(function(t){return e.onQueryInputKeydown(t)})),this.onAvailableOptionsRendered(),this._renderedOptions.changes.subscribe(function(){return e.onAvailableOptionsRendered()})},n.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().select},n.prototype.optionsUpdateHook=function(){},n.prototype.queryUpdateHook=function(){},n.prototype.updateQuery=function(e){var t=this;this.searchService.updateQuery(e,function(){return t.dropdownService.setOpenState(!0)})},n.prototype.resetQuery=function(e){void 0===e&&(e=!0),e?(this.searchService.searchDelay=this._menu.menuTransitionDuration,this.searchService.updateQueryDelayed("")):this.searchService.updateQuery(""),this.searchInput&&(this.searchInput.query="")},n.prototype.onAvailableOptionsRendered=function(){var e=this;this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._renderedSubscriptions=[],this._renderedOptions.forEach(function(t){setTimeout(function(){return e.initialiseRenderedOption(t)}),e._renderedSubscriptions.push(t.onSelected.subscribe(function(){return e.selectOption(t.value)}))}),0!==this.searchService.options.length||this.searchService.optionsLookup||(this.options=this._renderedOptions.map(function(e){return e.value}))},n.prototype.initialiseRenderedOption=function(e){e.usesTemplate=!!this.optionTemplate,e.formatter=this.configuredFormatter,e.usesTemplate&&this.drawTemplate(e.templateSibling,e.value),e.changeDetector.markForCheck()},n.prototype.findOption=function(e,t){var n=this;return e.find(function(e){return t===n.valueGetter(e)})},n.prototype.onCaretClick=function(e){e.eventHandled||(e.eventHandled=!0,this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!this.dropdownService.isOpen),this.focus()))},n.prototype.onClick=function(e){e.eventHandled||this.dropdownService.isAnimating||(e.eventHandled=!0,this.dropdownService.setOpenState(!!this.isSearchable||!this.dropdownService.isOpen),this.focus())},n.prototype.onFocusIn=function(){this.dropdownService.isOpen||this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!0),this.focus())},n.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||(this.dropdownService.setOpenState(!1),this.onTouched.emit())},n.prototype.onKeyPress=function(t){t.keyCode===e.KeyCode.Enter&&this._element.nativeElement.click()},n.prototype.onDocumentKeyDown=function(t){this._element.nativeElement.contains(t.target)&&!this.dropdownService.isOpen&&t.keyCode===e.KeyCode.Down&&(this._element.nativeElement.click(),t.preventDefault())},n.prototype.onQueryInputKeydown=function(e){},n.prototype.focus=function(){this.isSearchable&&this.searchInput?this.searchInput.focus():this._element.nativeElement.focus()},n.prototype.drawTemplate=function(e,t){e.clear(),e.createEmbeddedView(this.optionTemplate,{$implicit:t,query:this.query})},n.prototype.ngOnDestroy=function(){this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._documentKeyDownListener()},n.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_renderedOptions:[{type:t.ContentChildren,args:[ho,{descendants:!0}]}],_selectClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dropdown"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isSearchable:[{type:t.Input}],_searchClass:[{type:t.HostBinding,args:["class.search"]}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],_internalSearch:[{type:t.ViewChild,args:[fo]}],_manualSearch:[{type:t.ContentChild,args:[fo]}],_tabIndex:[{type:t.Input,args:["tabindex"]}],tabIndex:[{type:t.HostBinding,args:["attr.tabindex"]}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],labelField:[{type:t.Input}],valueField:[{type:t.Input}],optionTemplate:[{type:t.Input}],optionFormatter:[{type:t.Input}],icon:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onTouched:[{type:t.Output,args:["touched"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}],onKeyPress:[{type:t.HostListener,args:["keypress",["$event"]]}]},n}(),go=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),yo=function(n){function i(i,r,o,s){var a=n.call(this,i,r,o)||this;return a.componentFactory=s,a._transitionController=new vt(!1,"inline-block"),a.setTransitionController(a._transitionController),a.onDeselected=new t.EventEmitter,a._labelClasses=!0,a._transitionController.animate(new yt("scale",100,e.TransitionDirection.In)),a}return go(i,n),Object.defineProperty(i.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),i.prototype.deselectOption=function(t){var n=this;t.eventHandled=!0,this._transitionController.animate(new yt("scale",100,e.TransitionDirection.Out,function(){return n.onDeselected.emit(n.value)}))},i.prototype.onClick=function(e){e.eventHandled=!0},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select-label",template:'\n\n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:Ht}]},i.propDecorators={_labelClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.label"]}],value:[{type:t.Input}],query:[{type:t.Input}],onDeselected:[{type:t.Output,args:["deselected"]}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},i}(bt),vo=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bo=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o.selectedOptions=[],o.selectedOptionsChange=new t.EventEmitter,o.hasLabels=!0,o._multiSelectClasses=!0,o}return vo(i,n),Object.defineProperty(i.prototype,"filteredOptions",{get:function(){var e=this;if(this.maxSelectedReached)return[];var t=this.searchService.results;return this.hasLabels?t.filter(function(t){return void 0==e.selectedOptions.find(function(e){return t===e})}):t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasLabels",{get:function(){return this._hasLabels},set:function(e){this._hasLabels=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.multi.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}), -Object.defineProperty(i.prototype,"maxSelectedReached",{get:function(){return void 0!=this.maxSelected&&this.selectedOptions.length===this.maxSelected},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxSelectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.maxSelectedMessage,[["max",this.maxSelected.toString()]])},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.selectedMessage,[["count",this.selectedOptions.length.toString()]])},enumerable:!0,configurable:!0}),i.prototype.optionsUpdateHook=function(){var e=this;!this._writtenOptions&&this.selectedOptions.length>0&&this.writeValue(this.selectedOptions.map(function(t){return e.valueGetter(t)})),this._writtenOptions&&this.searchService.options.length>0&&(this.selectedOptions=this._writtenOptions.map(function(t){return e.findOption(e.searchService.options,t)}).filter(function(e){return void 0!=e}),this.selectedOptions.length===this._writtenOptions.length&&(this._writtenOptions=void 0))},i.prototype.initialiseRenderedOption=function(e){n.prototype.initialiseRenderedOption.call(this,e),e.isActive=!this.hasLabels&&-1!==this.selectedOptions.indexOf(e.value)},i.prototype.selectOption=function(e){var t=this;if(-1!==this.selectedOptions.indexOf(e))return void this.deselectOption(e);this.selectedOptions.push(e),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.resetQuery(!1),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.writeValue=function(e){var t=this;e instanceof Array?(this.searchService.options.length>0&&(this.selectedOptions=e.map(function(e){return t.findOption(t.searchService.options,e)}).filter(function(e){return void 0!=e})),e.length>0&&0===this.selectedOptions.length&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){return t.selectedOptions=e}):this._writtenOptions=e),0===e.length&&(this.selectedOptions=[])):this.selectedOptions=[]},i.prototype.deselectOption=function(e){var t=this;this.selectedOptions=this.selectedOptions.filter(function(t){return t!==e}),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.onQueryInputKeydown=function(t){t.keyCode===e.KeyCode.Backspace&&""===this.query&&this.selectedOptions.length>0&&this.deselectOption(this.selectedOptions[this.selectedOptions.length-1])},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select",template:'\n\x3c!-- Dropdown icon --\x3e\n\n\n\n\x3c!-- Multi-select labels --\x3e\n \n\n\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Helper text --\x3e\n
\n \n \x3c!-- Placeholder text --\x3e\n {{ placeholder }}\n \n \x3c!-- Summary shown when labels are hidden --\x3e\n {{ selectedMessage }}\n
\n\n\x3c!-- Select dropdown menu --\x3e\n\n',styles:["\n:host input.search {\n width: 12em !important;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},i.propDecorators={selectedOptionsChange:[{type:t.Output}],hasLabels:[{type:t.Input}],placeholder:[{type:t.Input}],maxSelected:[{type:t.Input}],_multiSelectClasses:[{type:t.HostBinding,args:["class.multiple"]}]},i}(mo),wo=function(e){function n(t){return e.call(this,t)||this}return vo(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-multi-select",host:{"(selectedOptionsChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:bo}]},n}(Et),_o=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Do=function(e){function n(n,i,r){var o=e.call(this,n,i,r)||this;return o.selectedOptionChange=new t.EventEmitter,o}return _o(n,e),Object.defineProperty(n.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.single.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),n.prototype.optionsUpdateHook=function(){!this._writtenOption&&this.selectedOption&&this.writeValue(this.valueGetter(this.selectedOption)),this._writtenOption&&this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,this._writtenOption),this.selectedOption&&(this._writtenOption=void 0,this.drawSelectedOption()))},n.prototype.queryUpdateHook=function(){this.selectedOption=void 0},n.prototype.selectOption=function(e){this.selectedOption=e,this.selectedOptionChange.emit(this.valueGetter(e)),this.dropdownService.setOpenState(!1),this.resetQuery(),this.drawSelectedOption(),this.focus()},n.prototype.writeValue=function(e){var t=this;void 0!=e?(this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,e),this.drawSelectedOption()),void 0==this.selectedOption&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){t.selectedOption=e,t.drawSelectedOption()}):this._writtenOption=e)):(this.selectedOption=void 0,this.drawSelectedOption())},n.prototype.initialiseRenderedOption=function(t){e.prototype.initialiseRenderedOption.call(this,t),t.isActive=t.value===this.selectedOption},n.prototype.drawSelectedOption=function(){this._renderedOptions&&this.onAvailableOptionsRendered(),void 0!=this.selectedOption&&this.optionTemplate&&this.drawTemplate(this._optionTemplateSibling,this.selectedOption)},n.decorators=[{type:t.Component,args:[{selector:"sui-select",template:'\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Placeholder text --\x3e\n
{{ placeholder }}
\n\x3c!-- Selected item --\x3e\n
\n \n \n
\n\x3c!-- Dropdown icon --\x3e\n\n\x3c!-- Select dropdown menu --\x3e\n\n'}]}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},n.propDecorators={_optionTemplateSibling:[{type:t.ViewChild,args:["optionTemplateSibling",{read:t.ViewContainerRef}]}],selectedOptionChange:[{type:t.Output}],placeholder:[{type:t.Input}]},n}(mo),Co=function(e){function n(t){return e.call(this,t)||this}return _o(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-select",host:{"(selectedOptionChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:Do}]},n}(Et),Oo=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,rn,gt],declarations:[Do,ho,fo,Co,bo,yo,wo],exports:[Do,ho,fo,Co,bo,wo]}]}],e.ctorParameters=function(){return[]},e}(),So={Overlay:"overlay",Push:"push",ScaleDown:"scale down",Uncover:"uncover",SlideAlong:"slide along",SlideOut:"slide out"},Mo={Left:"left",Right:"right",Top:"top",Bottom:"bottom"},To=function(){function e(e){void 0===e&&(e=!1),this.isVisible=e,this.isAnimating=!1,this.wasJustOpened=!1,this.isVisibleChange=new t.EventEmitter,this.widthChange=new t.EventEmitter,this.heightChange=new t.EventEmitter,this.width=260,this.height=0,this.transition=So.Uncover}return Object.defineProperty(e.prototype,"width",{get:function(){return this.direction===Mo.Left?this._width:this.direction===Mo.Right?-this._width:0},set:function(e){this._width=e,this.widthChange.emit()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.direction===Mo.Top?this._height:this.direction===Mo.Bottom?-this._height:0},set:function(e){this._height=e,this.heightChange.emit()},enumerable:!0,configurable:!0}),e.prototype.setVisibleState=function(e){var t=this;this.isVisible!==e&&(this.isVisible=e,this.isAnimating=!0,this.wasJustOpened=!0,this.isVisibleChange.emit(e),setTimeout(function(){return t.wasJustOpened=!1}),clearTimeout(this._isAnimatingTimeout),this._isAnimatingTimeout=window.setTimeout(function(){return t.isAnimating=!1},500))},e.prototype.toggleVisibleState=function(){this.setVisibleState(!this.isVisible)},e}(),ko=function(){function e(e,t){var n=this;this._renderer=e,this._element=t,this.service=new To,this.transition=So.Uncover,this.direction=Mo.Left,setTimeout(function(){return n.updateDimensions()}),this.service.isVisibleChange.subscribe(function(){return n.updateDimensions()}),this._sidebarClasses=!0}return Object.defineProperty(e.prototype,"transition",{get:function(){return this.service.transition},set:function(e){var t=this;this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!1)}),this.service.transition=e,this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!0)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"direction",{get:function(){return this.service.direction},set:function(e){this.setClass(this.service.direction,!1),this.service.direction=e,this.setClass(this.service.direction,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.service.isVisible},set:function(e){this.service.setVisibleState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisibleChange",{get:function(){return this.service.isVisibleChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAnimating",{get:function(){return this.service.isAnimating},enumerable:!0,configurable:!0}),e.prototype.updateDimensions=function(){this.service.width=this._element.nativeElement.offsetWidth,this.service.height=this._element.nativeElement.offsetHeight},e.prototype.setClass=function(e,t){void 0===t&&(t=!0),t?this._renderer.addClass(this._element.nativeElement,e):this._renderer.removeClass(this._element.nativeElement,e)},e.prototype.open=function(){this.service.setVisibleState(!0)},e.prototype.close=function(){this.service.setVisibleState(!1)},e.prototype.toggle=function(){this.service.toggleVisibleState()},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar",template:""}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_sidebarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.sidebar"]},{type:t.HostBinding,args:["class.menu"]}],transition:[{type:t.Input}],direction:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]},{type:t.Input}],isVisibleChange:[{type:t.Output}],isAnimating:[{type:t.HostBinding,args:["class.animating"]}]},e}(),Po=function(){function e(e,t){this._renderer=e,this._element=t,this.isDimmedWhenVisible=!1,this._siblingClasses=!0}return Object.defineProperty(e.prototype,"service",{get:function(){return this._service},set:function(e){var t=this;this._service=e,setTimeout(function(){return t.updateTransform()}),this._service.isVisibleChange.subscribe(function(){return t.updateTransform()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return!!this.service&&this.service.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDimmed",{get:function(){return!!this.service&&(this.service.isVisible&&this.isDimmedWhenVisible)},enumerable:!0,configurable:!0}),e.prototype.updateTransform=function(){if(this._renderer.removeStyle(this._element.nativeElement,"transform"),this._renderer.removeStyle(this._element.nativeElement,"-webkit-transform"),this.service.isVisible&&this.service.transition!==So.Overlay&&this.service.transition!==So.ScaleDown){var e="translate3d("+this.service.width+"px, "+this.service.height+"px, 0)";this._renderer.setStyle(this._element.nativeElement,"transform",e),this._renderer.setStyle(this._element.nativeElement,"-webkit-transform",e)}},e.prototype.onClick=function(e){this.service.isVisible&&!this.service.wasJustOpened&&this.service.setVisibleState(!1)},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-sibling",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={isDimmedWhenVisible:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isDimmed:[{type:t.HostBinding,args:["class.dimmed"]}],_siblingClasses:[{type:t.HostBinding,args:["class.pusher"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},e}(),xo=function(){function e(){this._containerClasses=!0}return e.prototype.ngAfterContentInit=function(){if(!this.sidebar)throw new Error("You must include a element within the container.");if(this.service=this.sidebar.service,!this.sibling)throw new Error("You must include a element within the container.");this.sibling.service=this.service},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-container",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_containerClasses:[{type:t.HostBinding,args:["class.pushable"]}],sidebar:[{type:t.ContentChild,args:[ko]}],sibling:[{type:t.ContentChild,args:[Po]}]},e}(),Io=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[ko,xo,Po],exports:[ko,xo,Po]}]}],e.ctorParameters=function(){return[]},e}(),Eo=function(){function e(e,t){var n=this;this.id=e.id,this.header=e,this.content=t,this.header.isActiveChange.subscribe(function(){return n.content.isActive=n.isActive})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.header.isActive},set:function(e){this.header.setActiveState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.header.isDisabled},enumerable:!0,configurable:!0}),e}(),Lo=function(){function e(){this._isActive=!1,this.isActiveChange=new t.EventEmitter,this.isActiveExternalChange=new t.EventEmitter,this.onActivate=new t.EventEmitter,this.onDeactivate=new t.EventEmitter,this.isDisabled=!1,this._headerClasses=!0}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},set:function(e){var t=this,n=e;setTimeout(function(){n=!t.isDisabled&&e,t.setActiveState(n),t.isActiveExternalChange.emit(n)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(e){this._isDisabled!==e&&(this._isDisabled=e,this.isDisabled&&(this.isActive=!1))},enumerable:!0,configurable:!0}),e.prototype.setActiveState=function(e){!!this._isActive!==e&&(this._isActive=e,e?this.onActivate.emit():this.onDeactivate.emit()),this.isActiveChange.emit(e)},e.prototype.onClick=function(){this.isDisabled||(this.isActive=!0)},e.decorators=[{type:t.Directive,args:[{selector:"[suiTabHeader]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_headerClasses:[{type:t.HostBinding,args:["class.item"]}],id:[{type:t.Input,args:["suiTabHeader"]}],isActiveChange:[{type:t.Output}],onActivate:[{type:t.Output,args:["activate"]}],onDeactivate:[{type:t.Output,args:["deactivate"]}],isActive:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},e}(),jo=function(){function e(){this.isActive=!1,this._contentClasses=!0}return e.decorators=[{type:t.Directive,args:[{selector:"[suiTabContent]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_contentClasses:[{type:t.HostBinding,args:["class.tab"]}],id:[{type:t.Input,args:["suiTabContent"]}],isActive:[{type:t.HostBinding,args:["class.active"]}]},e}(),Vo=function(){function e(){this.tabs=[],this._barrierCount=0}return Object.defineProperty(e.prototype,"activeTab",{get:function(){return this._activeTab},set:function(e){this._activeTab=e,e.isActive=!0},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this._tabHeaders.changes.subscribe(function(){return e.internalComponentsUpdated()}),this._tabContents.changes.subscribe(function(){return e.internalComponentsUpdated()}),this.loadTabs()},e.prototype.internalComponentsUpdated=function(){2===++this._barrierCount&&(this._barrierCount=0,this.loadTabs())},e.prototype.loadTabs=function(){var e=this;if(this.tabs=this.tabs.filter(function(t){return!!e._tabHeaders.find(function(e){return e===t.header})}),this._tabHeaders.filter(function(t){return!e.tabs.find(function(e){return e.header===t})}).forEach(function(t){var n=e._tabContents.find(function(e){return e.id===t.id});if(!n)throw new Error("A [suiTabHeader] must have a related [suiTabContent].");var i=new Eo(t,n);i.header.isActiveExternalChange.subscribe(function(){return e.onHeaderActiveChanged(i)}),e.tabs.push(i)}),this._tabHeaders.forEach(function(t,n){var i=e.tabs.find(function(e){return e.header===t});i&&(i.index=n)}),this.tabs.sort(function(e,t){return e.index-t.index}),this.activeTab?this.tabs.find(function(t){return t===e.activeTab})||setTimeout(function(){return e.activateClosestTab(e.activeTab)}):this.activateFirstTab(),0===this.tabs.length)throw new Error("You cannot have no tabs!")},e.prototype.onHeaderActiveChanged=function(e){e.isActive&&this.activeTab!==e&&(this.tabs.filter(function(t){return t!==e}).forEach(function(e){return e.isActive=!1}),this.activeTab=e),e.isActive||this.activeTab!==e||this.activateClosestTab(e)},e.prototype.activateFirstTab=function(){this.activeTab=this.tabs[0]},e.prototype.activateClosestTab=function(e){var t;if(e.index>=this.tabs.length&&(t=this.tabs[this.tabs.length-1]),t||(t=this.tabs.find(function(t){return t===e})?this.tabs[Math.max(e.index-1,0)]:this.tabs[e.index]),t.isDisabled)return this.activateClosestTab(t);this.activeTab=t},e.decorators=[{type:t.Component,args:[{selector:"sui-tabset",template:""}]}],e.ctorParameters=function(){return[]},e.propDecorators={_tabHeaders:[{type:t.ContentChildren,args:[Lo]}],_tabContents:[{type:t.ContentChildren,args:[jo]}]},e}(),Ho=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[Vo,Lo,jo],exports:[Vo,Lo,jo]}]}],e.ctorParameters=function(){return[]},e}(),Ro=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{exports:[Dt,Ot,xt,hn,Pt,xr,Lr,Yr,eo,er,no,so,lo,Oo,Io,Ho,wt,gt,rn]}]}],e.ctorParameters=function(){return[]},e}();e.SuiLocalizationService=mt,e.SuiLocalizationModule=gt,e.SuiMessage=_t,e.SuiMessageModule=Dt,e.SuiPagination=Ct,e.SuiPaginationModule=Ot,e.SuiAccordionPanel=St,e.SuiAccordion=Tt,e.SuiAccordionService=Mt,e.SuiAccordionModule=xt,e.SuiCheckbox=sn,e.SuiCheckboxValueAccessor=an,e.SuiRadio=un,e.SuiRadioValueAccessor=ln,e.SuiRadioManager=pn,e.SuiCheckboxModule=hn,e.SuiCollapse=kt,e.SuiCollapseModule=Pt,e.CalendarConfig=Sn,e.DateConfigBase=Mn,e.YearConfig=Tn,e.MonthConfig=kn,e.DateConfig=Pn,e.DatetimeConfig=xn,e.TimeConfig=In,e.CalendarMappings=vn,e.DateMappings=bn,e.TimeMappings=wn,e.DatetimeMappings=_n,e.MonthMappings=Dn,e.YearMappings=Cn,e.DateComparer=En,e.DateParser=Li,e.InternalDateParser=ji,e.SuiCalendarViewTitle=Ri,e.DatepickerMode=Ai,e.SuiDatepicker=Fi,e.CalendarItem=fn,e.SuiCalendarItem=mn,e.SuiDatepickerDirective=nr,e.SuiDatepickerDirectiveValueAccessor=ir,e.SuiDatepickerDirectiveValidator=rr,e.SuiDatepickerInputDirective=fr,e.DateFnsParser=Ii,e.CalendarRange=Vi,e.CalendarRangeService=Hi,e.CalendarService=dn,e.CalendarView=gn,e.CalendarRangeDateService=gr,e.SuiCalendarDateView=yr,e.CalendarRangeHourService=br,e.SuiCalendarHourView=wr,e.CalendarRangeMinuteService=Dr,e.SuiCalendarMinuteView=Cr,e.CalendarRangeMonthService=Sr,e.SuiCalendarMonthView=Mr,e.CalendarRangeYearService=kr,e.SuiCalendarYearView=Pr,e.SuiDatepickerModule=xr,e.SuiDimmer=Er,e.SuiDimmerModule=Lr,e.SuiDropdownMenuItem=Rr,e.SuiDropdownMenu=Ar,e.SuiDropdown=Fr,e.DropdownAutoCloseType=jr,e.DropdownService=Vr,e.SuiDropdownModule=Yr,e.ActiveModal=Br,e.ModalSize=Ur,e.ModalConfig=zr,e.TemplateModalConfig=Wr,e.ComponentModalConfig=qr,e.ModalControls=$r,e.Modal=Qr,e.ModalTemplate=Jr,e.SuiModal=Zr,e.SuiModalService=Xr,e.SuiModalModule=eo,e.SuiPopupComponentController=Wi,e.PopupTrigger=Yi,e.PopupConfig=Bi,e.SuiPopupController=Ui,e.TemplatePopupConfig=Ki,e.SuiPopupTemplateController=$i,e.SuiPopupArrow=Qi,e.SuiPopup=Ni,e.SuiPopupDirective=Xi,e.SuiPopupConfig=Ji,e.SuiPopupModule=er,e.SuiProgress=to,e.SuiProgressModule=no,e.SuiRating=ro,e.SuiRatingValueAccessor=oo,e.SuiRatingModule=so,e.SuiSearchResult=ao,e.SuiSearch=uo,e.SearchService=co,e.SuiSearchModule=lo,e.SuiSelectBase=mo,e.SuiMultiSelectLabel=yo,e.SuiMultiSelect=bo,e.SuiMultiSelectValueAccessor=wo,e.SuiSelectOption=ho,e.SuiSelect=Do,e.SuiSelectValueAccessor=Co,e.SuiSelectSearch=fo,e.SuiSelectModule=Oo,e.SuiSidebarContainer=xo,e.SuiSidebarSibling=Po,e.SuiSidebar=ko,e.SidebarTransition=So,e.SidebarDirection=Mo,e.SidebarService=To,e.SuiSidebarModule=Io,e.Tab=Eo,e.SuiTabset=Vo,e.SuiTabContent=jo,e.SuiTabHeader=Lo,e.SuiTabsModule=Ho,e.TransitionController=vt,e.Transition=yt,e.SuiTransition=bt,e.SuiTransitionModule=wt,e.CustomValidator=It,e.customValidatorFactory=a,e.CustomValueAccessor=Et,e.customValueAccessorFactory=c,e.DateUtil=Vt,e.HandledEvent=Lt,e.Util=jt,e.SuiComponentFactory=Ht,e.PositioningPlacement=tn,e.PositioningService=nn,e.SuiUtilityModule=rn,e.SuiModule=Ro,Object.defineProperty(e,"__esModule",{value:!0})}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/forms"],t):t(e["ng2-semantic-ui"]=e["ng2-semantic-ui"]||{},e._angular_core,e._angular_common,e._angular_forms)}(this,function(e,t,n,i){"use strict";function r(e){return JSON.parse(JSON.stringify(e))}function o(e,t){return(dt||ft)(!0,e,t)}function s(e){return e.toLowerCase().replace("-","")}function a(e){return{provide:i.NG_VALIDATORS,useExisting:t.forwardRef(function(){return e}),multi:!0}}function c(e){return{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef(function(){return e}),multi:!0}}function u(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function p(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},Ft))}}function l(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function h(e,t){if(1!==e.nodeType)return[];var n=getComputedStyle(e,null);return t?n[t]:n}function d(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function f(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=h(e),n=t.overflow,i=t.overflowX;return/(auto|scroll|overlay)/.test(n+t.overflowY+i)?e:f(d(e))}function m(e){if(!e)return document.documentElement;for(var t=zt(10)?document.body:null,n=e.offsetParent;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TD","TABLE"].indexOf(n.nodeName)&&"static"===h(n,"position")?m(n):n:e?e.ownerDocument.documentElement:document.documentElement}function g(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||m(e.firstElementChild)===e)}function y(e){return null!==e.parentNode?y(e.parentNode):e}function v(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?e:t,r=n?t:e,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var s=o.commonAncestorContainer;if(e!==s&&t!==s||i.contains(r))return g(s)?s:m(s);var a=y(e);return a.host?v(a.host,t):v(e,y(t).host)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",i=e.nodeName;if("BODY"===i||"HTML"===i){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[n]}return e[n]}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=b(t,"top"),r=b(t,"left"),o=n?-1:1;return e.top+=i*o,e.bottom+=i*o,e.left+=r*o,e.right+=r*o,e}function _(e,t){var n="x"===t?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+i+"Width"],10)}function D(e,t,n,i){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],zt(10)?n["offset"+e]+i["margin"+("Height"===e?"Top":"Left")]+i["margin"+("Height"===e?"Bottom":"Right")]:0)}function O(){var e=document.body,t=document.documentElement,n=zt(10)&&getComputedStyle(t);return{height:D("Height",e,t,n),width:D("Width",e,t,n)}}function C(e){return Qt({},e,{right:e.left+e.width,bottom:e.top+e.height})}function S(e){var t={};try{if(zt(10)){t=e.getBoundingClientRect();var n=b(e,"top"),i=b(e,"left");t.top+=n,t.left+=i,t.bottom+=n,t.right+=i}else t=e.getBoundingClientRect()}catch(e){}var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?O():{},s=o.width||e.clientWidth||r.right-r.left,a=o.height||e.clientHeight||r.bottom-r.top,c=e.offsetWidth-s,u=e.offsetHeight-a;if(c||u){var p=h(e);c-=_(p,"x"),u-=_(p,"y"),r.width-=c,r.height-=u}return C(r)}function M(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=zt(10),r="HTML"===t.nodeName,o=S(e),s=S(t),a=f(e),c=h(t),u=parseFloat(c.borderTopWidth,10),p=parseFloat(c.borderLeftWidth,10);n&&"HTML"===t.nodeName&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var l=C({top:o.top-s.top-u,left:o.left-s.left-p,width:o.width,height:o.height});if(l.marginTop=0,l.marginLeft=0,!i&&r){var d=parseFloat(c.marginTop,10),m=parseFloat(c.marginLeft,10);l.top-=u-d,l.bottom-=u-d,l.left-=p-m,l.right-=p-m,l.marginTop=d,l.marginLeft=m}return(i&&!n?t.contains(a):t===a&&"BODY"!==a.nodeName)&&(l=w(l,t)),l}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,i=M(e,n),r=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),s=t?0:b(n),a=t?0:b(n,"left");return C({top:s-i.top+i.marginTop,left:a-i.left+i.marginLeft,width:r,height:o})}function k(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===h(e,"position")||k(d(e)))}function P(e){if(!e||!e.parentElement||zt())return document.documentElement;for(var t=e.parentElement;t&&"none"===h(t,"transform");)t=t.parentElement;return t||document.documentElement}function x(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},s=r?P(e):v(e,t);if("viewport"===i)o=T(s,r);else{var a=void 0;"scrollParent"===i?(a=f(d(t)),"BODY"===a.nodeName&&(a=e.ownerDocument.documentElement)):a="window"===i?e.ownerDocument.documentElement:i;var c=M(a,s,r);if("HTML"!==a.nodeName||k(s))o=c;else{var u=O(),p=u.height,l=u.width;o.top+=c.top-c.marginTop,o.bottom=p+c.top,o.left+=c.left-c.marginLeft,o.right=l+c.left}}return o.left+=n,o.top+=n,o.right-=n,o.bottom-=n,o}function I(e){return e.width*e.height}function E(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var s=x(n,i,o,r),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},c=Object.keys(a).map(function(e){return Qt({key:e},a[e],{area:I(a[e])})}).sort(function(e,t){return t.area-e.area}),u=c.filter(function(e){var t=e.width,i=e.height;return t>=n.clientWidth&&i>=n.clientHeight}),p=u.length>0?u[0].key:c[0].key,l=e.split("-")[1];return p+(l?"-"+l:"")}function L(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return M(n,i?P(t):v(t,n),i)}function j(e){var t=getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+i,height:e.offsetHeight+n}}function V(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function H(e,t,n){n=n.split("-")[0];var i=j(e),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),s=o?"top":"left",a=o?"left":"top",c=o?"height":"width",u=o?"width":"height";return r[s]=t[s]+t[c]/2-i[c]/2,r[a]=n===a?t[a]-i[u]:t[V(a)],r}function R(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function A(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var i=R(e,function(e){return e[t]===n});return e.indexOf(i)}function F(e,t,n){return(void 0===n?e:e.slice(0,A(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&l(n)&&(t.offsets.popper=C(t.offsets.popper),t.offsets.reference=C(t.offsets.reference),t=n(t,e))}),t}function Y(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=E(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=H(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=F(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function B(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function N(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;is[f]&&(e.offsets.popper[l]+=a[l]+m-s[f]),e.offsets.popper=C(e.offsets.popper);var g=a[l]+a[u]/2-m/2,y=h(e.instance.popper),v=parseFloat(y["margin"+p],10),b=parseFloat(y["border"+p+"Width"],10),w=g-e.offsets.popper[l]-v-b;return w=Math.max(Math.min(s[u]-m,w),0),e.arrowElement=i,e.offsets.arrow=(n={},Kt(n,l,Math.round(w)),Kt(n,d,""),n),e}function re(e){return"end"===e?"start":"start"===e?"end":e}function oe(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Gt.indexOf(e),i=Gt.slice(n+1).concat(Gt.slice(0,n));return t?i.reverse():i}function se(e,t){if(B(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=x(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),i=e.placement.split("-")[0],r=V(i),o=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case Jt.FLIP:s=[i,r];break;case Jt.CLOCKWISE:s=oe(i);break;case Jt.COUNTERCLOCKWISE:s=oe(i,!0);break;default:s=t.behavior}return s.forEach(function(a,c){if(i!==a||s.length===c+1)return e;i=e.placement.split("-")[0],r=V(i);var u=e.offsets.popper,p=e.offsets.reference,l=Math.floor,h="left"===i&&l(u.right)>l(p.left)||"right"===i&&l(u.left)l(p.top)||"bottom"===i&&l(u.top)l(n.right),m=l(u.top)l(n.bottom),y="left"===i&&d||"right"===i&&f||"top"===i&&m||"bottom"===i&&g,v=-1!==["top","bottom"].indexOf(i),b=!!t.flipVariations&&(v&&"start"===o&&d||v&&"end"===o&&f||!v&&"start"===o&&m||!v&&"end"===o&&g);(h||y||b)&&(e.flipped=!0,(h||y)&&(i=s[c+1]),b&&(o=re(o)),e.placement=i+(o?"-"+o:""),e.offsets.popper=Qt({},e.offsets.popper,H(e.instance.popper,e.offsets.reference,e.placement)),e=F(e.instance.modifiers,e,"flip"))}),e}function ae(e){var t=e.offsets,n=t.popper,i=t.reference,r=e.placement.split("-")[0],o=Math.floor,s=-1!==["top","bottom"].indexOf(r),a=s?"right":"bottom",c=s?"left":"top",u=s?"width":"height";return n[a]o(i[a])&&(e.offsets.popper[c]=o(i[a])),e}function ce(e,t,n,i){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+r[1],s=r[2];if(!o)return e;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=i}return C(a)[t]/100*o}if("vh"===s||"vw"===s){return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}function ue(e,t,n,i){var r=[0,0],o=-1!==["right","left"].indexOf(i),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(R(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,u=-1!==a?[s.slice(0,a).concat([s[a].split(c)[0]]),[s[a].split(c)[1]].concat(s.slice(a+1))]:[s];return u=u.map(function(e,i){var r=(1===i?!o:o)?"height":"width",s=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return ce(e,r,t,n)})}),u.forEach(function(e,t){e.forEach(function(n,i){G(n)&&(r[t]+=n*("-"===e[i-1]?-1:1))})}),r}function pe(e,t){var n=t.offset,i=e.placement,r=e.offsets,o=r.popper,s=r.reference,a=i.split("-")[0],c=void 0;return c=G(+n)?[+n,0]:ue(n,o,s,a),"left"===a?(o.top+=c[0],o.left-=c[1]):"right"===a?(o.top+=c[0],o.left+=c[1]):"top"===a?(o.left+=c[0],o.top-=c[1]):"bottom"===a&&(o.left+=c[0],o.top+=c[1]),e.popper=o,e}function le(e,t){var n=t.boundariesElement||m(e.instance.popper);e.instance.reference===n&&(n=m(n));var i=x(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);t.boundaries=i;var r=t.priority,o=e.offsets.popper,s={primary:function(e){var n=o[e];return o[e]i[e]&&!t.escapeWithReference&&(r=Math.min(o[n],i[e]-("right"===e?o.width:o.height))),Kt({},n,r)}};return r.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";o=Qt({},o,s[t](e))}),e.offsets.popper=o,e}function he(e){var t=e.placement,n=t.split("-")[0],i=t.split("-")[1];if(i){var r=e.offsets,o=r.reference,s=r.popper,a=-1!==["bottom","top"].indexOf(n),c=a?"left":"top",u=a?"width":"height",p={start:Kt({},c,o[c]),end:Kt({},c,o[c]+o[u]-s[u])};e.offsets.popper=Qt({},s,p[i])}return e}function de(e){if(!ne(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=R(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right0?"in "+i:i+" ago":i}function Pe(e){return e.replace(Fn,function(e){return e.slice(1)})}function xe(e,t,n,i){return Bn[e]}function Ie(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}function Ee(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}function Le(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}function je(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}function Ve(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}function He(e){return parseInt(e[1],10)}function Re(e,t){var n=ye(e,t),i=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime(),o=i-r;return Math.floor(o/ti)+1}function Ae(e,t){var n=ye(e,t),i=n.getUTCDay(),r=(i<1?7:0)+i-1;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function Fe(e,t){var n=ye(e,t),i=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(i+1,0,4),r.setUTCHours(0,0,0,0);var o=Ae(r,t),s=new Date(0);s.setUTCFullYear(i,0,4),s.setUTCHours(0,0,0,0);var a=Ae(s,t);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Ye(e,t){var n=Fe(e,t),i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),Ae(i,t)}function Be(e,t){var n=ye(e,t),i=Ae(n,t).getTime()-Ye(n,t).getTime();return Math.round(i/ni)+1}function Ne(e,t){t=t||"";var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;return n+Ue(r,2)+t+Ue(o,2)}function Ue(e,t){for(var n=Math.abs(e).toString();n.length=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=ye(e,n),u=Number(t),p=c.getUTCDay(),l=u%7,h=(l+7)%7,d=(h=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=o.locale||ei,c=a.parsers||{},u=a.units||{};if(!a.match)throw new RangeError("locale must contain match property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var p=String(t).replace(hi,function(e){return"["===e[0]?e:"\\"===e[0]?nt(e):a.formatLong(e)});if(""===p)return""===r?ye(n,o):new Date(NaN);var l=Se(o);l.locale=a;var h,d=p.match(a.parsingTokensRegExp||di),f=d.length,m=[{priority:pi,set:tt,index:0}];for(h=0;h\n \n \n\n',styles:["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"]}]}],n.ctorParameters=function(){return[]},n.propDecorators={isDismissable:[{type:t.Input}],onDismiss:[{type:t.Output,args:["dismiss"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],class:[{type:t.Input,args:["class"]}]},n}(),Dt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[_t],exports:[_t]}]}],e.ctorParameters=function(){return[]},e}(),Ot=function(){function e(){this._paginationClasses=!0,this.pageChange=new t.EventEmitter,this.pageSize=10,this._page=1,this._pages=[],this.pageCount=1,this.hasNavigationLinks=!0,this.hasBoundaryLinks=!1,this.canRotate=!1,this.hasEllipses=!0}return Object.defineProperty(e.prototype,"maxSize",{get:function(){return this._maxSize},set:function(e){this._maxSize=void 0!=e?Math.max(e,1):void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collectionSize",{get:function(){return this._collectionSize},set:function(e){this._collectionSize=Math.max(e,0),this.pageCount=Math.max(1,Math.ceil(this._collectionSize/this.pageSize))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNavigationLinks",{get:function(){var e=this._maxSize||this.pageCount;return this._hasNavigationLinks||e1},e.prototype.hasNext=function(){return this.page\n \n\n\n \n\n\n \n 1\n \n ...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n',styles:["\n:host .item {\n transition: none;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_paginationClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.pagination"]},{type:t.HostBinding,args:["class.menu"]}],pageChange:[{type:t.Output}],maxSize:[{type:t.Input}],pageSize:[{type:t.Input}],collectionSize:[{type:t.Input}],hasNavigationLinks:[{type:t.Input}],hasBoundaryLinks:[{type:t.Input}],canRotate:[{type:t.Input}],hasEllipses:[{type:t.Input}],page:[{type:t.Input}]},e}(),Ct=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],exports:[Ot],declarations:[Ot],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),St=function(){function e(e){this._changeDetector=e,this.transitionController=new vt(!1),this._isOpen=!1,this.isOpenChange=new t.EventEmitter(!1)}return Object.defineProperty(e.prototype,"service",{set:function(e){this._service=e,this._changeDetector.detectChanges()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},set:function(e){var t=!!e;t!==this.isOpen&&(this._isOpen=t,t&&this._service&&this._service.closeOtherPanels(this),this.isOpenChange.emit(this.isOpen),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.transition,this.transitionDuration)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{get:function(){return this._service?this._service.transition:"fade"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{get:function(){return this._service?this._service.transitionDuration:0},enumerable:!0,configurable:!0}),e.prototype.toggle=function(){this.isDisabled||(this.isOpen=!this.isOpen)},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion-panel",exportAs:"suiAccordionPanel",template:'\n\x3c!-- Title --\x3e\n
\n \n
\n\x3c!-- Content --\x3e\n
\n
\n \n
\n
\n',styles:["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},e.propDecorators={isDisabled:[{type:t.Input}],isOpen:[{type:t.Input}],isOpenChange:[{type:t.Output}]},e}(),Mt=function(){function e(){this.closeOthers=!0,this.transition="fade",this.transitionDuration=350,this.panels=[]}return e.prototype.addPanel=function(e){e.service=this,this.panels.push(e)},e.prototype.closeOtherPanels=function(e){this.closeOthers&&this.panels.forEach(function(t){t!==e&&(t.isOpen=!1)})},e}(),Tt=function(){function e(){this._service=new Mt,this.accordionClasses=!0}return Object.defineProperty(e.prototype,"closeOthers",{get:function(){return this._service.closeOthers},set:function(e){this._service.closeOthers=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{set:function(e){this._service.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{set:function(e){this._service.transitionDuration=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.updatePanels(),this._panels.changes.subscribe(function(){return e.updatePanels()})},e.prototype.updatePanels=function(){var e=this;this._panels.forEach(function(t){return e._service.addPanel(t)})},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion",template:"\n\n",styles:["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={accordionClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.accordion"]}],closeOthers:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],_panels:[{type:t.ContentChildren,args:[St]}]},e}(),kt=function(){function e(e,t){this._element=e,this._renderer=t,this._pristine=!0,this.collapseDuration=350,this._isExpanded=!1,this._isCollapsing=!1}return Object.defineProperty(e.prototype,"_isCollapsed",{get:function(){return!this._isExpanded&&!this._isCollapsing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suiCollapse",{get:function(){return this._isExpanded},set:function(e){e?this.hide():this.show()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_animationDuration",{get:function(){return this._pristine?0:this.collapseDuration},enumerable:!0,configurable:!0}),e.prototype.hide=function(){var e=this;this._isCollapsing=!0,this._isExpanded=!1,this._renderer.setStyle(this._element.nativeElement,"overflow","hidden"),this.animate(this._element.nativeElement.scrollHeight,0,!1,function(){e._isCollapsing=!1})},e.prototype.show=function(){var e=this;this._isCollapsing=!0,this.animate(this._element.nativeElement.offsetHeight,this._element.nativeElement.scrollHeight,!0,function(){e._renderer.removeStyle(e._element.nativeElement,"overflow"),e._isCollapsing=!1,e._isExpanded=!0})},e.prototype.animate=function(e,t,n,i){void 0===n&&(n=!1),void 0===i&&(i=function(){});var r=[{offset:0,height:e+"px"},{offset:1,height:t+"px"}];n&&r.push({offset:1,height:"auto"}),this._element.nativeElement.animate(r,{delay:0,duration:this._animationDuration,iterations:1,easing:"ease",fill:"both"}),this._pristine&&(this._pristine=!1),setTimeout(function(){return i()},this.collapseDuration)},e.decorators=[{type:t.Directive,args:[{selector:"[suiCollapse]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e.propDecorators={_isExpanded:[{type:t.HostBinding,args:["class.expanded"]}],_isCollapsed:[{type:t.HostBinding,args:["class.collapsed"]}],_isCollapsing:[{type:t.HostBinding,args:["class.collapsing"]}],suiCollapse:[{type:t.Input}],collapseDuration:[{type:t.Input}]},e}(),Pt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[kt],exports:[kt]}]}],e.ctorParameters=function(){return[]},e}(),xt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Pt,wt],declarations:[Tt,St],exports:[Tt,St],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),It=function(){function e(e){this._host=e,this.onValidatorChange=function(){}}return e.prototype.validate=function(e){return this._host.validate(e)},e.prototype.registerOnValidatorChange=function(e){this.onValidatorChange=e},e}(),Et=function(){function e(e){this._host=e,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){this._host.writeValue(e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e}();!function(e){e[e.Left=37]="Left",e[e.Up=38]="Up",e[e.Right=39]="Right",e[e.Down=40]="Down",e[e.Escape=27]="Escape",e[e.Enter=13]="Enter",e[e.Space=32]="Space",e[e.Backspace=8]="Backspace"}(e.KeyCode||(e.KeyCode={}));var Lt=function(){function e(){}return e}(),jt={Array:{range:function(e,t){return void 0===t&&(t=0),Array(e).fill(0).map(function(e,n){return n+t})},group:function(e,t){for(var n=e.slice(0),i=[];n.length>0;)i.push(n.splice(0,t));return i},groupBy:function(e,t){return e.reduce(function(e,n){var i=n[t].toString();return e[i]=e[i]||[],e[i].push(n),e},Object())},flatten:function(e){return e.reduce(function(e,t){return e.concat(t)},[])}},String:{padLeft:function(e,t,n){for(var i=e;i.length=0){Ft=1;break}var Bt=Rt&&window.Promise,Nt=Bt?u:p,Ut={},zt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";if(e=e.toString(),Ut.hasOwnProperty(e))return Ut[e];switch(e){case"11":Ut[e]=-1!==navigator.userAgent.indexOf("Trident");break;case"10":Ut[e]=-1!==navigator.appVersion.indexOf("MSIE 10");break;case"all":Ut[e]=-1!==navigator.userAgent.indexOf("Trident")||-1!==navigator.userAgent.indexOf("MSIE")}return Ut.all=Ut.all||Object.keys(Ut).some(function(e){return Ut[e]}),Ut[e]},Wt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},qt=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Wt(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=Nt(this.update.bind(this)),this.options=Qt({},e.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(Qt({},e.Defaults.modifiers,r.modifiers)).forEach(function(t){i.options.modifiers[t]=Qt({},e.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return Qt({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&l(e.onLoad)&&e.onLoad(i.reference,i.popper,i.options,e,i.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return qt(e,[{key:"update",value:function(){return Y.call(this)}},{key:"destroy",value:function(){return U.call(this)}},{key:"enableEventListeners",value:function(){return K.call(this)}},{key:"disableEventListeners",value:function(){return $.call(this)}}]),e}();en.Utils=("undefined"!=typeof window?window:global).PopperUtils,en.placements=$t,en.Defaults=Xt;var tn={Auto:"auto",TopLeft:"top left",Top:"top",TopRight:"top right",LeftTop:"left top",Left:"left",LeftBottom:"left bottom",BottomLeft:"bottom left",Bottom:"bottom",BottomRight:"bottom right",RightTop:"right top",Right:"right",RightBottom:"right bottom"},nn=function(){function e(e,t,n,i){var r=this;this.anchor=e,this.subject=t,this._placement=n;var o={computeStyle:{gpuAcceleration:!1},preventOverflow:{escapeWithReference:!0,boundariesElement:document.body},arrow:{element:i}};i||delete o.arrow,this._popper=new en(e.nativeElement,t.nativeElement,{placement:me(n),modifiers:o,onCreate:function(e){return r._popperState=e},onUpdate:function(e){return r._popperState=e}})}return Object.defineProperty(e.prototype,"placement",{get:function(){return this._placement},set:function(e){this._placement=e,this._popper.options.placement=me(e),this.update()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"actualPlacement",{get:function(){return this._popperState?ge(this._popperState.placement):tn.Auto},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._popperState},enumerable:!0,configurable:!0}),e.prototype.update=function(){this._popper.update()},e.prototype.destroy=function(){this._popper.destroy()},e}(),rn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],providers:[Ht]}]}],e.ctorParameters=function(){return[]},e}(),on=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),sn=function(){function e(){this.isChecked=!1,this.onCheckChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._checkboxClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.toggle(),this.focusCheckbox())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.toggle=function(){this.isChecked=!this.isChecked,this.onCheckChange.emit(this.isChecked)},e.prototype.writeValue=function(e){this.isChecked=e},e.prototype.focusCheckbox=function(){this._checkboxElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-checkbox",exportAs:"suiCheckbox",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_checkboxClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCheckChange:[{type:t.Output,args:["checkChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_checkboxElement:[{type:t.ViewChild,args:["checkbox"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),an=function(e){function n(t){return e.call(this,t)||this}return on(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-checkbox",host:{"(checkChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:sn}]},n}(Et),cn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),un=function(){function e(){this._radioClasses=!0,this.isChecked=!1,this.onCurrentValueChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._radioClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.currentValue=this.value,this.onCurrentValueChange.emit(this.currentValue),this.update(),this.focusRadio())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.update=function(){this.isChecked=this.currentValue===this.value},e.prototype.writeValue=function(e){this.currentValue=e,this.update()},e.prototype.focusRadio=function(){this._radioElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-radio-button",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_radioClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.radio"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],value:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCurrentValueChange:[{type:t.Output,args:["currentValueChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_radioElement:[{type:t.ViewChild,args:["radio"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),pn=function(e){function n(t){return e.call(this,t)||this}return cn(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-radio-button",host:{"(currentValueChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:un}]},n}(Et),ln=function(){function e(e){this.element=e,this.isNested=!1,this._radioSubs=[]}return e.prototype.ngAfterContentInit=function(){var e=this;this.updateNesting(),this._subManagers.changes.subscribe(function(){return e.updateNesting()}),this.updateRadios(),this._renderedRadios.changes.subscribe(function(){return e.updateRadios()})},e.prototype.updateNesting=function(){var e=this;this._subManagers.filter(function(t){return t!==e}).forEach(function(e){return e.isNested=!0})},e.prototype.updateRadios=function(){var e=this;this._radioSubs.forEach(function(e){return e.unsubscribe()}),this._radioSubs=[];var t=jt.Array.groupBy(this._renderedRadios.toArray(),"name");Object.keys(t).map(function(e){return t[e]}).forEach(function(t){return t.forEach(function(n){return e._radioSubs.push(n.onCurrentValueChange.subscribe(function(n){e.isNested||t.forEach(function(e){return e.writeValue(n)})}))})})},e.decorators=[{type:t.Directive,args:[{selector:"form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={_subManagers:[{type:t.ContentChildren,args:[e,{descendants:!0}]}],_renderedRadios:[{type:t.ContentChildren,args:[un,{descendants:!0}]}]},e}(),hn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule],declarations:[sn,an,un,pn,ln],exports:[sn,an,un,pn,ln]}]}],e.ctorParameters=function(){return[]},e}();!function(e){e[e.DateOnly=0]="DateOnly",e[e.TimeOnly=1]="TimeOnly",e[e.Both=2]="Both"}(e.CalendarMode||(e.CalendarMode={}));var dn=function(){function e(e,n){this.localeValues=n,this.onManualUpdate=function(){},this.config=e,this.currentDate=new Date,this.firstDayOfWeek=this.localeValues.firstDayOfWeek,this.onDateChange=new t.EventEmitter,this.reset()}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},set:function(e){this._config=e,e.updateBounds(this._selectedDate||this.currentDate)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inFinalView",{get:function(){return this.currentView===this.config.mappings.finalView},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){e?(this._selectedDate=Vt.clone(e),this.currentDate=Vt.clone(e)):this._selectedDate=void 0,this.config.updateBounds(this._selectedDate||this.currentDate),this.onManualUpdate()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){ +return this._minDate&&this.config.dateMinBound?this._minDate>this.config.dateMinBound?this._minDate:this.config.dateMinBound:this._minDate||this.config.dateMinBound},set:function(e){this._minDate=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate&&this.config.dateMaxBound?this._maxDate=this.ranges.current.inRange.length&&(i=!0),!o){var s=this.ranges.current.findIndex(this._highlightedItem),a=this.ranges.calc(i).inRange;if(i?s-=this.ranges.current.inRange.length:s+=a.length,o=a[s+r],o.isDisabled)return}this.ranges.move(i),this._highlightedItem=this.ranges.current.find(o)}},n.prototype.ngOnDestroy=function(){this._documentKeyDownListener()},n.propDecorators={_renderedItems:[{type:t.ViewChildren,args:[mn]}],service:[{type:t.Input}]},n}(),yn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vn=function(){function e(){}return e}(),bn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Date,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Date]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month]]),n}return yn(n,t),n}(vn),wn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Hour,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),_n=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Hour],[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month],[e.CalendarViewType.Hour,e.CalendarViewType.Date],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),Dn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Month,n.finalView=e.CalendarViewType.Month,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Month]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),On=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Year,n.finalView=e.CalendarViewType.Year,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),Cn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sn=function(){function t(e,t,n,i){this.mode=e,this.precision=t,this.mappings=n,this.fallback=i}return t.prototype.updateBounds=function(t){this.dateMinBound=Vt.startOf(e.DatePrecision.Year,new Date,!0),this.dateMinBound.setFullYear(0)},t}(),Mn=function(t){function n(n,i,r){return t.call(this,e.CalendarMode.DateOnly,n,i,r)||this}return Cn(n,t),n}(Sn),Tn=function(t){function n(){return t.call(this,e.DatePrecision.Year,new On,"number")||this}return Cn(n,t),n}(Mn),kn=function(t){function n(){return t.call(this,e.DatePrecision.Month,new Dn,"month")||this}return Cn(n,t),n}(Mn),Pn=function(t){function n(){return t.call(this,e.DatePrecision.Date,new bn,"date")||this}return Cn(n,t),n}(Mn),xn=function(t){function n(){return t.call(this,e.CalendarMode.Both,e.DatePrecision.Minute,new _n,"datetime-local")||this}return Cn(n,t),n}(Sn),In=function(t){function n(){return t.call(this,e.CalendarMode.TimeOnly,e.DatePrecision.Minute,new wn,"time")||this}return Cn(n,t),n.prototype.updateBounds=function(t){this.dateMaxBound=Vt.endOf(e.DatePrecision.Date,Vt.clone(t)),this.dateMinBound=Vt.previous(e.DatePrecision.Date,Vt.clone(this.dateMaxBound))},n}(Sn),En=function(){function t(e,t){this._precision=e,this._isSmallest=t}return t.prototype.equal=function(t,n){return this._precision===e.DatePrecision.Minute?!!n&&Vt.equal(e.DatePrecision.Hour,n,t)&&jt.Math.roundDown(n.getMinutes(),5)===jt.Math.roundDown(t.getMinutes(),5):!!n&&Vt.equal(this._precision,t,n)},t.prototype.lessThan=function(e,t){return this._isSmallest?!t||t>=e:!t||Vt.endOf(this._precision,Vt.clone(t))>=e},t.prototype.greaterThan=function(e,t){return this._isSmallest?!t||t<=e:!t||Vt.startOf(this._precision,Vt.clone(t))<=e},t.prototype.between=function(e,t,n){return this.greaterThan(e,t)&&this.lessThan(e,n)},t}(),Ln=36e5,jn=6e4,Vn=2,Hn={dateTimeDelimeter:/[T ]/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-])(\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/},Rn=6e4,An={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Fn=/MMMM|MM|DD|dddd/g,Yn=function(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||Pe(e.L),ll:e.ll||Pe(e.LL),lll:e.lll||Pe(e.LLL),llll:e.llll||Pe(e.LLLL)};return function(e){return t[e]}}({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"}),Bn={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"},Nn={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Un={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},zn={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},Wn={ordinalNumber:Le,weekday:Ie(Nn,"long"),weekdays:Ee(Nn,"long"),month:Ie(Un,"long"),months:Ee(Un,"long"),timeOfDay:Ie(zn,"long",function(e){return e/12>=1?1:0}),timesOfDay:Ee(zn,"long")},qn=/^(\d+)(th|st|nd|rd)?/i,Kn={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Qn={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$n={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Gn={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Jn={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},Zn={any:[/^a/i,/^p/i]},Xn={ordinalNumbers:function(e){return function(t){return String(t).match(e)}}(qn),ordinalNumber:He,weekdays:je(Kn,"long"),weekday:Ve(Qn,"any"),months:je($n,"long"),month:Ve(Gn,"any"),timesOfDay:je(Jn,"long"),timeOfDay:Ve(Zn,"any")},ei={formatDistance:ke,formatLong:Yn,formatRelative:xe,localize:Wn,match:Xn,options:{weekStartsOn:0,firstWeekContainsDate:1}},ti=864e5,ni=6048e5,ii={M:function(e){return e.getUTCMonth()+1},Mo:function(e,t){var n=e.getUTCMonth()+1;return t.locale.localize.ordinalNumber(n,{unit:"month"})},MM:function(e){return Ue(e.getUTCMonth()+1,2)},MMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"short"})},MMMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"long"})},Q:function(e){return Math.ceil((e.getUTCMonth()+1)/3)},Qo:function(e,t){var n=Math.ceil((e.getUTCMonth()+1)/3);return t.locale.localize.ordinalNumber(n,{unit:"quarter"})},D:function(e){return e.getUTCDate()},Do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDate(),{unit:"dayOfMonth"})},DD:function(e){return Ue(e.getUTCDate(),2)},DDD:function(e){return Re(e)},DDDo:function(e,t){return t.locale.localize.ordinalNumber(Re(e),{unit:"dayOfYear"})},DDDD:function(e){return Ue(Re(e),3)},dd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"narrow"})},ddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"short"})},dddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"long"})},d:function(e){return e.getUTCDay()},do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDay(),{unit:"dayOfWeek"})},E:function(e){return e.getUTCDay()||7},W:function(e){return Be(e)},Wo:function(e,t){return t.locale.localize.ordinalNumber(Be(e),{unit:"isoWeek"})},WW:function(e){return Ue(Be(e),2)},YY:function(e){return Ue(e.getUTCFullYear(),4).substr(2)},YYYY:function(e){return Ue(e.getUTCFullYear(),4)},GG:function(e){return String(Fe(e)).substr(2)},GGGG:function(e){return Fe(e)},H:function(e){return e.getUTCHours()},HH:function(e){return Ue(e.getUTCHours(),2)},h:function(e){var t=e.getUTCHours();return 0===t?12:t>12?t%12:t},hh:function(e){return Ue(ii.h(e),2)},m:function(e){return e.getUTCMinutes()},mm:function(e){return Ue(e.getUTCMinutes(),2)},s:function(e){return e.getUTCSeconds()},ss:function(e){return Ue(e.getUTCSeconds(),2)},S:function(e){return Math.floor(e.getUTCMilliseconds()/100)},SS:function(e){return Ue(Math.floor(e.getUTCMilliseconds()/10),2)},SSS:function(e){return Ue(e.getUTCMilliseconds(),3)},Z:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset(),":")},ZZ:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset())},X:function(e,t){var n=t._originalDate||e;return Math.floor(n.getTime()/1e3)},x:function(e,t){return(t._originalDate||e).getTime()},A:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"uppercase"})},a:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"lowercase"})},aa:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"long"})}},ri=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,oi=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,si={M:/^(1[0-2]|0?\d)/,D:/^(3[0-1]|[0-2]?\d)/,DDD:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,W:/^(5[0-3]|[0-4]?\d)/,YYYY:/^(\d{1,4})/,H:/^(2[0-3]|[0-1]?\d)/,m:/^([0-5]?\d)/,Z:/^([+-])(\d{2}):(\d{2})/,ZZ:/^([+-])(\d{2})(\d{2})/,singleDigit:/^(\d)/,twoDigits:/^(\d{2})/,threeDigits:/^(\d{3})/,fourDigits:/^(\d{4})/,anyDigits:/^(\d+)/},ai={YY:{unit:"twoDigitYear",match:si.twoDigits,parse:function(e){return Qe(e)}},YYYY:{unit:"year",match:si.YYYY,parse:Qe},GG:{unit:"isoYear",match:si.twoDigits,parse:function(e){return Qe(e)+1900}},GGGG:{unit:"isoYear",match:si.YYYY,parse:Qe},Q:{unit:"quarter",match:si.singleDigit,parse:Qe},Qo:{unit:"quarter",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"quarter"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"quarter"})}},M:{unit:"month",match:si.M,parse:function(e){return Qe(e)-1}},Mo:{unit:"month",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"month"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"month"})-1}},MM:{unit:"month",match:si.twoDigits,parse:function(e){return Qe(e)-1}},MMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"short"})},parse:function(e,t){return t.locale.match.month(e,{type:"short"})}},MMMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"long"})||t.locale.match.months(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.month(e,{type:"long"});return null==n&&(n=t.locale.match.month(e,{type:"short"})),n}},W:{unit:"isoWeek",match:si.W,parse:Qe},Wo:{unit:"isoWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"isoWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"isoWeek"})}},WW:{unit:"isoWeek",match:si.twoDigits,parse:Qe},d:{unit:"dayOfWeek",match:si.singleDigit,parse:Qe},do:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfWeek"})}},dd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){return t.locale.match.weekday(e,{type:"narrow"})}},ddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"short"});return null==n&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},dddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"long"})||t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"long"});return null==n&&null==(n=t.locale.match.weekday(e,{type:"short"}))&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},E:{unit:"dayOfISOWeek",match:si.singleDigit,parse:function(e){return Qe(e)}},D:{unit:"dayOfMonth",match:si.D,parse:Qe},Do:{unit:"dayOfMonth",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfMonth"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfMonth"})}},DD:{unit:"dayOfMonth",match:si.twoDigits,parse:Qe},DDD:{unit:"dayOfYear",match:si.DDD,parse:Qe},DDDo:{unit:"dayOfYear",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfYear"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfYear"})}},DDDD:{unit:"dayOfYear",match:si.threeDigits,parse:Qe},A:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){return t.locale.match.timeOfDay(e,{type:"short"})}},aa:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"long"})||t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.timeOfDay(e,{type:"long"});return null==n&&(n=t.locale.match.timeOfDay(e,{type:"short"})),n}},H:{unit:"hours",match:si.H,parse:Qe},HH:{unit:"hours",match:si.twoDigits,parse:Qe},h:{unit:"timeOfDayHours",match:si.M,parse:Qe},hh:{unit:"timeOfDayHours",match:si.twoDigits,parse:Qe},m:{unit:"minutes",match:si.m,parse:Qe},mm:{unit:"minutes",match:si.twoDigits,parse:Qe},s:{unit:"seconds",match:si.m,parse:Qe},ss:{unit:"seconds",match:si.twoDigits,parse:Qe},S:{unit:"milliseconds",match:si.singleDigit,parse:function(e){return 100*Qe(e)}},SS:{unit:"milliseconds",match:si.twoDigits,parse:function(e){return 10*Qe(e)}},SSS:{unit:"milliseconds",match:si.threeDigits,parse:Qe},Z:{unit:"timezone",match:si.Z,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},ZZ:{unit:"timezone",match:si.ZZ,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},X:{unit:"timestamp",match:si.anyDigits,parse:function(e){return 1e3*Qe(e)}},x:{unit:"timestamp",match:si.anyDigits,parse:Qe}};ai.a=ai.A;var ci=864e5,ui={twoDigitYear:{priority:10,set:function(e,t){var n=Math.floor(e.date.getUTCFullYear()/100),i=100*n+t;return e.date.setUTCFullYear(i,0,1),e.date.setUTCHours(0,0,0,0),e}},year:{priority:10,set:function(e,t){return e.date.setUTCFullYear(t,0,1),e.date.setUTCHours(0,0,0,0),e}},isoYear:{priority:10,set:function(e,t,n){return e.date=Ye(Ze(e.date,t,n),n),e}},quarter:{priority:20,set:function(e,t){return e.date.setUTCMonth(3*(t-1),1),e.date.setUTCHours(0,0,0,0),e}},month:{priority:30,set:function(e,t){return e.date.setUTCMonth(t,1),e.date.setUTCHours(0,0,0,0),e}},isoWeek:{priority:40,set:function(e,t,n){return e.date=Ae(Je(e.date,t,n),n),e}},dayOfWeek:{priority:50,set:function(e,t,n){return e.date=$e(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfISOWeek:{priority:50,set:function(e,t,n){return e.date=Ge(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfMonth:{priority:50,set:function(e,t){return e.date.setUTCDate(t),e.date.setUTCHours(0,0,0,0),e}},dayOfYear:{priority:50,set:function(e,t){return e.date.setUTCMonth(0,t),e.date.setUTCHours(0,0,0,0),e}},timeOfDay:{priority:60,set:function(e,t,n){return e.timeOfDay=t,e}},hours:{priority:70,set:function(e,t,n){return e.date.setUTCHours(t,0,0,0),e}},timeOfDayHours:{priority:70,set:function(e,t,n){var i=e.timeOfDay;return null!=i&&(t=Xe(t,i)),e.date.setUTCHours(t,0,0,0),e}},minutes:{priority:80,set:function(e,t){return e.date.setUTCMinutes(t,0,0),e}},seconds:{priority:90,set:function(e,t){return e.date.setUTCSeconds(t,0),e}},milliseconds:{priority:100,set:function(e,t){return e.date.setUTCMilliseconds(t),e}},timezone:{priority:110,set:function(e,t){return e.date=new Date(e.date.getTime()-6e4*t),e}},timestamp:{priority:120,set:function(e,t){return e.date=new Date(t),e}}},pi=110,li=6e4,hi=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,di=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,fi="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},mi=it(function(e,t){function n(e,t,n){n=n||{};var r;return r="string"==typeof i[e]?i[e]:1===t?i[e].one:i[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};e.exports=t.default}),gi=it(function(e,t){function n(e){return e.replace(r,function(e){return e.slice(1)})}function i(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||n(e.L),ll:e.ll||n(e.LL),lll:e.lll||n(e.LLL),llll:e.llll||n(e.LLLL)};return function(e){return t[e]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=/MMMM|MM|DD|dddd/g;e.exports=t.default}),yi=it(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=gi,i=function(e){return e&&e.__esModule?e:{default:e}}(n),r=(0,i.default)({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"});t.default=r,e.exports=t.default}),vi=it(function(e,t){function n(e,t,n,r){return i[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"};e.exports=t.default}),bi=it(function(e,t){function n(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),wi=it(function(e,t){function n(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),_i=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}Object.defineProperty(t,"__esModule",{value:!0});var r=bi,o=n(r),s=wi,a=n(s),c={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},p={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},l={ordinalNumber:i,weekday:(0,o.default)(c,"long"),weekdays:(0,a.default)(c,"long"),month:(0,o.default)(u,"long"),months:(0,a.default)(u,"long"),timeOfDay:(0,o.default)(p,"long",function(e){return e/12>=1?1:0}),timesOfDay:(0,a.default)(p,"long")};t.default=l,e.exports=t.default}),Di=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Oi=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Ci=it(function(e,t){function n(e){return function(t){return String(t).match(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Si=it(function(e,t){function n(e){return parseInt(e[1],10)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Mi=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Di,r=n(i),o=Oi,s=n(o),a=Ci,c=n(a),u=Si,p=n(u),l=/^(\d+)(th|st|nd|rd)?/i,h={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},d={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},f={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},m={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},g={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},y={any:[/^a/i,/^p/i]},v={ordinalNumbers:(0,c.default)(l),ordinalNumber:p.default,weekdays:(0,r.default)(h,"long"),weekday:(0,s.default)(d,"any"),months:(0,r.default)(f,"long"),month:(0,s.default)(m,"any"),timesOfDay:(0,r.default)(g,"long"),timeOfDay:(0,s.default)(y,"any")};t.default=v,e.exports=t.default}),Ti=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=mi,r=n(i),o=yi,s=n(o),a=vi,c=n(a),u=_i,p=n(u),l=Mi,h=n(l),d={formatDistance:r.default,formatLong:s.default,formatRelative:c.default,localize:p.default,match:h.default,options:{weekStartsOn:0,firstWeekContainsDate:1}};t.default=d,e.exports=t.default}),ki=function(e){return e&&e.__esModule?e.default:e}(Ti),Pi=Object.freeze({default:ki,__moduleExports:Ti}),xi=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=1?1:0}),timesOfDay:ot(i,"long")}),this._locale.match=xi({},this._locale.match,{weekdays:st(t,"long"),weekday:at(t,"long"),months:st(n,"long"),month:at(n,"long"),timesOfDay:st(r,"long"),timeOfDay:at(r,"long")})}return Object.defineProperty(e.prototype,"_config",{get:function(){return{weekStartsOn:this._weekStartsOn,locale:this._locale}},enumerable:!0,configurable:!0}),e.prototype.format=function(e,t){return We(e,t,this._config)},e.prototype.parse=function(e,t,n){return et(e,t,n,this._config)},e}(),Ei=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Li=function(){function e(e,t){this._format=e,this._parser=new Ii(t)}return e.prototype.format=function(e){return this._parser.format(e,this._format)},e.prototype.parse=function(e,t){return void 0===t&&(t=new Date),this._parser.parse(e,this._format,t)},e}(),ji=function(e){function t(t,n){var i={time:"HH:mm",datetime:"YYYY-MM-DDTHH:mm",date:"YYYY-MM-DD",month:"YYYY-MM",year:"YYYY"};return e.call(this,i[t],n)||this}return Ei(t,e),t}(Li),Vi=function(){function e(e,t,n,i,r){this.start=e,this.dates=t,this.items=n,this.groupedItems=i,this._comparer=r}return Object.defineProperty(e.prototype,"inRange",{get:function(){return this.items.filter(function(e){return!e.isOutsideRange})},enumerable:!0,configurable:!0}),e.prototype.find=function(e){var t=this;return this.items.find(function(n){return t._comparer.equal(n.date,e.date)})},e.prototype.findIndex=function(e){var t=this +;return e?this.items.findIndex(function(n){return t._comparer.equal(n.date,e.date)}):-1},e.prototype.containsDate=function(e){var t=this;return!!this.inRange.find(function(n){return t._comparer.equal(n.date,e)})},e}(),Hi=function(){function e(e,t,n){this.interval=e,this.marginal=e+1,this.rows=t,this.columns=n}return Object.defineProperty(e.prototype,"dateComparer",{get:function(){return new En(this.marginal,this.service.inFinalView)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.rows*this.columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMoveNext",{get:function(){var e=this.next.inRange[0];return!e||!this.service.maxDate||e.date<=this.service.maxDate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMovePrevious",{get:function(){var e=this.previous.inRange.slice(-1).pop();return!e||!this.service.minDate||e.date>=this.service.minDate},enumerable:!0,configurable:!0}),e.prototype.loadService=function(e){this.service=e,this.refresh()},e.prototype.refresh=function(){this.current=this.calcRange(this.service.currentDate),this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate))),this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.move=function(e){return e?this.moveNext():this.movePrevious()},e.prototype.moveNext=function(){Vt.next(this.interval,this.service.currentDate),this.previous=this.current,this.current=this.next,this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.movePrevious=function(){Vt.previous(this.interval,this.service.currentDate),this.next=this.current,this.current=this.previous,this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.calc=function(e){return e?this.next:this.previous},e.prototype.calcRange=function(e){var t=this.calcStart(e);this.service.inFinalView&&Vt.startOf(this.marginal,t,!0);var n=this.calcDates(t),i=this.calcItems(n,e);return new Vi(t,n,i,jt.Array.group(i,this.columns),this.dateComparer)},e.prototype.calcStart=function(e){return Vt.startOf(this.interval,Vt.clone(e))},e.prototype.calcDates=function(e){var t=this;return jt.Array.range(this.length).map(function(n){return Vt.add(t.marginal,Vt.clone(e),n)})},e.prototype.calcItems=function(e,t){var n=this;return e.map(function(e){var i=new fn(e);return i.isDisabled=!n.dateComparer.between(i.date,n.service.minDate,n.service.maxDate),i.isActive=n.dateComparer.equal(i.date,n.service.selectedDate),i.isToday=n.dateComparer.equal(i.date,new Date),i.isSelectable=i.isDisabled,n.configureItem(i,t),i})},e}(),Ri=function(){function e(){this.onZoomOut=new t.EventEmitter}return e.decorators=[{type:t.Component,args:[{selector:"sui-calendar-view-title",template:'\n\n \n\n\n \n\n\n \n\n',styles:["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={ranges:[{type:t.Input}],onZoomOut:[{type:t.Output,args:["zoomOut"]}]},e}(),Ai={Year:"year",Month:"month",Date:"date",Datetime:"datetime",Time:"time"},Fi=function(){function e(e){this.service=new dn(new xn,e.get().datepicker),this._calendarClasses=!0}return e.prototype.onMouseDown=function(e){e.preventDefault()},e.decorators=[{type:t.Component,args:[{selector:"sui-datepicker",template:'\n\n \n \n \n \n \n\n',styles:["\n:host {\n user-select: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:mt}]},e.propDecorators={_calendarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.active"]},{type:t.HostBinding,args:["class.calendar"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}]},e}(),Yi={Hover:"hover",Click:"click",OutsideClick:"outsideClick",Focus:"focus",Manual:"manual"},Bi=function(){function e(e){void 0===e&&(e={}),this.placement=tn.TopLeft,this.trigger=Yi.Hover,this.isInverted=!1,this.delay=0,this.isBasic=!1,this.transition="scale",this.transitionDuration=200,Object.assign(this,e)}return e}(),Ni=function(){function n(e){this.elementRef=e,this.transitionController=new vt(!1),this._isOpen=!1,this.onOpen=new t.EventEmitter,this.onClose=new t.EventEmitter,this._tabindex=0}return Object.defineProperty(n.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"anchor",{set:function(e){this.positioningService=new nn(e,this._container.element,this.config.placement,".dynamic.arrow")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"direction",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"alignment",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").pop()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dynamicClasses",{get:function(){var e={};return this.direction&&(e[this.direction]=!0),this.alignment&&(e[this.alignment]=!0),this.config.isInverted&&(e.inverted=!0),this.config.isBasic&&(e.basic=!0),e},enumerable:!0,configurable:!0}),n.prototype.open=function(){var t=this;this.isOpen||(clearTimeout(this.closingTimeout),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.In,function(){var e=t.elementRef.nativeElement.querySelector("[autofocus]");e&&(setTimeout(function(){return e.focus()},10),setTimeout(function(){return e.focus()},t.config.transitionDuration))})),this.positioningService.placement=this.config.placement,setTimeout(function(){return t.positioningService.update()}),this._isOpen=!0,this.onOpen.emit())},n.prototype.toggle=function(){return this.isOpen?this.close():this.open()},n.prototype.close=function(){var t=this;this.isOpen&&(this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.Out)),clearTimeout(this.closingTimeout),this.closingTimeout=window.setTimeout(function(){return t.onClose.emit()},this.config.transitionDuration),this._isOpen=!1)},n.prototype.onClick=function(e){e.stopPropagation()},n.decorators=[{type:t.Component,args:[{selector:"sui-popup",template:'\n\n',styles:['\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor\'s mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed \'vertically\'. */\n.ui.popup[direction="top"],\n.ui.popup[direction="bottom"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed \'horizontally\'. */\n.ui.popup[direction="left"],\n.ui.popup[direction="right"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n']}]}],n.ctorParameters=function(){return[{type:t.ElementRef}]},n.propDecorators={_container:[{type:t.ViewChild,args:["container",{read:t.ViewContainerRef}]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],_tabindex:[{type:t.HostBinding,args:["attr.tabindex"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(),Ui=function(){function e(e,t,n,i){var r=this;this._element=t,this._componentFactory=n,this._componentRef=this._componentFactory.createComponent(Ni),this.popup.config=i,this.popup.onClose.subscribe(function(){return r.cleanup()}),this._documentListener=e.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"popup",{get:function(){return this._componentRef.instance},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){e&&Object.assign(this.popup.config,e)},e.prototype.openDelayed=function(){var e=this;clearTimeout(this._openingTimeout),this._openingTimeout=window.setTimeout(function(){return e.open()},this.popup.config.delay)},e.prototype.open=function(){this._componentFactory.attachToApplication(this._componentRef),this._componentFactory.moveToDocumentBody(this._componentRef),this.popup.anchor=this._element,this.popup.open();var e=this.popupOnOpen;e&&e.call(this)},e.prototype.close=function(){clearTimeout(this._openingTimeout),this._componentRef&&this.popup.close();var e=this.popupOnClose;e&&e.call(this)},e.prototype.toggleDelayed=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.openDelayed():this.close()},e.prototype.toggle=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.open():this.close()},e.prototype.onMouseEnter=function(){this.popup.config.trigger===Yi.Hover&&this.openDelayed()},e.prototype.onMouseLeave=function(){this.popup.config.trigger===Yi.Hover&&this.close()},e.prototype.onClick=function(){this.popup.config.trigger===Yi.Click||this.popup.config.trigger===Yi.OutsideClick?this.toggleDelayed():this.popup.config.trigger!==Yi.Focus||this._componentRef&&(!this._componentRef||this.popup.isOpen)||this.openDelayed()},e.prototype.onDocumentClick=function(e){if(this._componentRef&&this.popup.config.trigger===Yi.OutsideClick){var t=e.target;this._element.nativeElement.contains(t)||this.close()}},e.prototype.onFocusIn=function(){this.popup.config.trigger===Yi.Focus&&this.openDelayed()},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.popup.elementRef.nativeElement.contains(e.relatedTarget)||this.popup.config.trigger!==Yi.Focus||this.close()},e.prototype.cleanup=function(){clearTimeout(this._openingTimeout),this._componentRef.instance&&this._componentRef.instance.positioningService&&this._componentRef.instance.positioningService.destroy(),this._componentFactory.detachFromApplication(this._componentRef)},e.prototype.ngOnDestroy=function(){this.cleanup(),this._documentListener()},e.propDecorators={onMouseEnter:[{type:t.HostListener,args:["mouseenter"]}],onMouseLeave:[{type:t.HostListener,args:["mouseleave"]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wi=function(e){function t(t,n,i,r,o){var s=e.call(this,t,n,i,o)||this;return s._component=r,s}return zi(t,e),Object.defineProperty(t.prototype,"componentInstance",{get:function(){if(this._contentComponentRef)return this._contentComponentRef.instance},enumerable:!0,configurable:!0}),t.prototype.open=function(){this._contentComponentRef||(this._contentComponentRef=this._componentFactory.createComponent(this._component),this._componentFactory.attachToView(this._contentComponentRef,this.popup.templateSibling)),e.prototype.open.call(this)},t.prototype.cleanup=function(){e.prototype.cleanup.call(this),this._contentComponentRef&&(this._contentComponentRef.destroy(),this._contentComponentRef=void 0)},t}(Ui),qi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ki=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return qi(t,e),t}(Bi),Qi=function(e){function t(t,n,i,r){return e.call(this,t,n,i,r)||this}return qi(t,e),t.prototype.configure=function(t){e.prototype.configure.call(this,t),t&&(this.template=t.template,this.context=t.context)},t.prototype.open=function(){this.template&&(this.popup.templateSibling.clear(),this._componentFactory.createView(this.popup.templateSibling,this.template,{$implicit:this.popup,context:this.context})),e.prototype.open.call(this)},t}(Ui),$i=function(){function e(){}return Object.defineProperty(e.prototype,"direction",{get:function(){if(this.placement)return this.placement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){if(this.placement){var e=this.placement.split(" ").pop();return e===this.direction?"center":e}},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-popup-arrow",template:'\n
\n
\n',styles:['\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction="top"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction="left"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction="bottom"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction="right"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction="bottom"][alignment="left"],\n.static.arrow[direction="top"][alignment="left"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction="left"][alignment="top"],\n.static.arrow[direction="right"][alignment="top"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction="bottom"][alignment="right"],\n.static.arrow[direction="top"][alignment="right"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction="left"][alignment="bottom"],\n.static.arrow[direction="right"][alignment="bottom"] {\n top: auto;\n bottom: 1em;\n}\n']}]}],e.ctorParameters=function(){return[]},e.propDecorators={placement:[{type:t.Input}],inverted:[{type:t.HostBinding,args:["class.inverted"]},{type:t.Input}]},e}(),Gi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ji=function(e){function n(){return e.call(this)||this}return Gi(n,e),n.decorators=[{type:t.Injectable}],n.ctorParameters=function(){return[]},n}(Bi),Zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xi=function(e){function n(t,n,i,r){return e.call(this,t,n,i,new Bi(r))||this}return Zi(n,e),Object.defineProperty(n.prototype,"popupHeader",{set:function(e){this.popup.config.header=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupText",{set:function(e){this.popup.config.text=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupInverted",{set:function(e){this.popup.config.isInverted=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupBasic",{set:function(e){this.popup.config.isBasic=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupPlacement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupDelay",{set:function(e){this.popup.config.delay=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTrigger",{get:function(){return this.popup.config.trigger},set:function(e){this.popup.config.trigger=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplate",{set:function(e){this.template=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplateContext",{set:function(e){this.context=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupConfig",{set:function(e){this.configure(e)},enumerable:!0,configurable:!0}),n.decorators=[{type:t.Directive,args:[{selector:"[suiPopup]",exportAs:"suiPopup"}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:Ji}]},n.propDecorators={popupHeader:[{type:t.Input}],popupText:[{type:t.Input}],popupInverted:[{type:t.Input}],popupBasic:[{type:t.Input}],popupTransition:[{type:t.Input}],popupTransitionDuration:[{type:t.Input}],popupPlacement:[{type:t.Input}],popupDelay:[{type:t.Input}],popupTrigger:[{type:t.Input}],popupTemplate:[{type:t.Input}],popupTemplateContext:[{type:t.Input}],popupConfig:[{type:t.Input}]},n}(Qi),er=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt,rn],declarations:[Xi,$i,Ni],exports:[Xi,Ni],providers:[Ji],entryComponents:[Ni]}]}],e.ctorParameters=function(){return[]},e}(),tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),nr=function(n){function i(e,i,r,o){var s=n.call(this,e,i,r,Fi,new Bi({trigger:Yi.Focus,placement:tn.BottomLeft,transition:"scale",transitionDuration:200}))||this;return s.renderer=e,s.localizationService=o,s.renderer.addClass(s.popup.elementRef.nativeElement,"ui"),s.renderer.addClass(s.popup.elementRef.nativeElement,"calendar"),s.onLocaleUpdate(),s.localizationService.onLanguageUpdate.subscribe(function(){return s.onLocaleUpdate()}),s.onSelectedDateChange=new t.EventEmitter,s.onValidatorChange=new t.EventEmitter,s.mode=Ai.Datetime,s}return tr(i,n),Object.defineProperty(i.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){this._selectedDate=e,this.onSelectedDateChange.emit(e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mode",{get:function(){return this._mode},set:function(e){switch(this._mode=e||Ai.Datetime,this._mode){case Ai.Year:this.config=new Tn;break;case Ai.Month:this.config=new kn;break;case Ai.Date:default:this.config=new Pn;break;case Ai.Datetime:this.config=new xn;break;case Ai.Time:this.config=new In}this.writeValue(this.selectedDate)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localeValues",{get:function(){return this.localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),i.prototype.popupOnOpen=function(){var e=this;this.componentInstance&&(this.componentInstance.service.config=this.config,this.componentInstance.service.localeValues=this.localeValues,this.componentInstance.service.currentDate=this.initialDate||new Date,this.componentInstance.service.selectedDate=this.selectedDate,this.componentInstance.service.maxDate=this.maxDate,this.componentInstance.service.minDate=this.minDate,void 0!=this.firstDayOfWeek&&(this.componentInstance.service.firstDayOfWeek=this.firstDayOfWeek),this.componentInstance.service.reset(),this.componentInstance.service.onDateChange.subscribe(function(t){e.selectedDate=t,e.close()}))},i.prototype.ngOnChanges=function(e){var t=e.maxDate,n=e.minDate,i=e.mode;(t||n||i)&&this.onValidatorChange.emit()},i.prototype.onLocaleUpdate=function(){this._localeValues=this.localizationService.get().datepicker},i.prototype.validate=function(e){var t=e.value;if(void 0!=t){if(this.minDate&&tthis.maxDate)return{suiMaxDate:{required:this.maxDate,actual:t}}}return null},i.prototype.writeValue=function(e){this.selectedDate=e,this.componentInstance&&(this.componentInstance.service.selectedDate=e)},i.prototype.onKeyDown=function(t){t.keyCode===e.KeyCode.Escape&&this.close()},i.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",providers:[a(i)]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:mt}]},i.propDecorators={mode:[{type:t.Input,args:["pickerMode"]}],initialDate:[{type:t.Input,args:["pickerInitialDate"]}],maxDate:[{type:t.Input,args:["pickerMaxDate"]}],minDate:[{type:t.Input,args:["pickerMinDate"]}],firstDayOfWeek:[{type:t.Input,args:["pickerFirstDayOfWeek"]}],localeOverrides:[{type:t.Input,args:["pickerLocaleOverrides"]}],placement:[{type:t.Input,args:["pickerPlacement"]}],transition:[{type:t.Input,args:["pickerTransition"]}],transitionDuration:[{type:t.Input,args:["pickerTransitionDuration"]}],onSelectedDateChange:[{type:t.Output,args:["pickerSelectedDateChange"]}],onValidatorChange:[{type:t.Output,args:["pickerValidatorChange"]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},i}(Wi),ir=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerSelectedDateChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(Et),rr=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerValidatorChange)":"onValidatorChange()"},providers:[a(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(It),or=it(function(e){!function(t,n,i){e.exports?e.exports=i():t.bowser=i()}(fi,0,function(){function e(e){function t(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}function n(t){var n=e.match(t);return n&&n.length>1&&n[2]||""}var i,r=t(/(ipod|iphone|ipad)/i).toLowerCase(),o=/like android/i.test(e),a=!o&&/android/i.test(e),c=/nexus\s*[0-6]\s*/i.test(e),u=!c&&/nexus\s*[0-9]+/i.test(e),p=/CrOS/.test(e),l=/silk/i.test(e),h=/sailfish/i.test(e),d=/tizen/i.test(e),f=/(web|hpw)os/i.test(e),m=/windows phone/i.test(e),g=(/SamsungBrowser/i.test(e),!m&&/windows/i.test(e)),y=!r&&!l&&/macintosh/i.test(e),v=!a&&!h&&!d&&!f&&/linux/i.test(e),b=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),w=t(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(e)&&!/tablet pc/i.test(e),D=!_&&/[^-]mobi/i.test(e),O=/xbox/i.test(e);/opera/i.test(e)?i={name:"Opera",opera:s,version:w||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?i={name:"Opera",opera:s,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||w}:/SamsungBrowser/i.test(e)?i={name:"Samsung Internet for Android",samsungBrowser:s,version:w||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?i={name:"Opera Coast",coast:s,version:w||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?i={name:"Yandex Browser",yandexbrowser:s,version:w||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?i={name:"UC Browser",ucbrowser:s,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?i={name:"Maxthon",maxthon:s,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?i={name:"Epiphany",epiphany:s,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?i={name:"Puffin",puffin:s,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?i={name:"Sleipnir",sleipnir:s,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?i={name:"K-Meleon",kMeleon:s,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:m?(i={name:"Windows Phone",osname:"Windows Phone",windowsphone:s},b?(i.msedge=s,i.version=b):(i.msie=s,i.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?i={name:"Internet Explorer",msie:s,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:p?i={name:"Chrome",osname:"Chrome OS",chromeos:s,chromeBook:s,chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(e)?i={name:"Microsoft Edge",msedge:s,version:b}:/vivaldi/i.test(e)?i={name:"Vivaldi",vivaldi:s,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||w}:h?i={name:"Sailfish",osname:"Sailfish OS",sailfish:s,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?i={name:"SeaMonkey",seamonkey:s,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(i={name:"Firefox",firefox:s,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(i.firefoxos=s,i.osname="Firefox OS")):l?i={name:"Amazon Silk",silk:s,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?i={name:"PhantomJS",phantom:s,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?i={name:"SlimerJS",slimer:s,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?i={name:"BlackBerry",osname:"BlackBerry OS",blackberry:s,version:w||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:f?(i={name:"WebOS",osname:"WebOS",webos:s,version:w||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(i.touchpad=s)):/bada/i.test(e)?i={name:"Bada",osname:"Bada",bada:s,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:d?i={name:"Tizen",osname:"Tizen",tizen:s,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||w}:/qupzilla/i.test(e)?i={name:"QupZilla",qupzilla:s,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||w}:/chromium/i.test(e)?i={name:"Chromium",chromium:s,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||w}:/chrome|crios|crmo/i.test(e)?i={name:"Chrome",chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:a?i={name:"Android",version:w}:/safari|applewebkit/i.test(e)?(i={name:"Safari",safari:s},w&&(i.version=w)):r?(i={name:"iphone"==r?"iPhone":"ipad"==r?"iPad":"iPod"},w&&(i.version=w)):i=/googlebot/i.test(e)?{name:"Googlebot",googlebot:s,version:t(/googlebot\/(\d+(\.\d+))/i)||w}:{name:t(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!i.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(i.name=i.name||"Blink",i.blink=s):(i.name=i.name||"Webkit",i.webkit=s),!i.version&&w&&(i.version=w)):!i.opera&&/gecko\//i.test(e)&&(i.name=i.name||"Gecko",i.gecko=s,i.version=i.version||t(/gecko\/(\d+(\.\d+)?)/i)),i.windowsphone||!a&&!i.silk?!i.windowsphone&&r?(i[r]=s,i.ios=s,i.osname="iOS"):y?(i.mac=s,i.osname="macOS"):O?(i.xbox=s,i.osname="Xbox"):g?(i.windows=s,i.osname="Windows"):v&&(i.linux=s,i.osname="Linux"):(i.android=s,i.osname="Android");var C="";i.windows?C=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)):i.windowsphone?C=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):i.mac?(C=t(/Mac OS X (\d+([_\.\s]\d+)*)/i),C=C.replace(/[_\s]/g,".")):r?(C=t(/os (\d+([_\s]\d+)*) like mac os x/i),C=C.replace(/[_\s]/g,".")):a?C=t(/android[ \/-](\d+(\.\d+)*)/i):i.webos?C=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):i.blackberry?C=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):i.bada?C=t(/bada\/(\d+(\.\d+)*)/i):i.tizen&&(C=t(/tizen[\/\s](\d+(\.\d+)*)/i)),C&&(i.osversion=C);var S=!i.windows&&C.split(".")[0];return _||u||"ipad"==r||a&&(3==S||S>=4&&!D)||i.silk?i.tablet=s:(D||"iphone"==r||"ipod"==r||a||c||i.blackberry||i.webos||i.bada)&&(i.mobile=s),i.msedge||i.msie&&i.version>=10||i.yandexbrowser&&i.version>=15||i.vivaldi&&i.version>=1||i.chrome&&i.version>=20||i.samsungBrowser&&i.version>=4||i.firefox&&i.version>=20||i.safari&&i.version>=6||i.opera&&i.version>=10||i.ios&&i.osversion&&i.osversion.split(".")[0]>=6||i.blackberry&&i.version>=10.1||i.chromium&&i.version>=20?i.a=s:i.msie&&i.version<10||i.chrome&&i.version<20||i.firefox&&i.version<20||i.safari&&i.version<6||i.opera&&i.version<10||i.ios&&i.osversion&&i.osversion.split(".")[0]<6||i.chromium&&i.version<20?i.c=s:i.x=s,i}function t(e){return e.split(".").length}function n(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n=0;){if(r[0][i]>r[1][i])return 1;if(r[0][i]!==r[1][i])return-1;if(0===i)return 0}}function r(t,n,r){var o=a;"string"==typeof n&&(r=n,n=void 0),void 0===n&&(n=!1),r&&(o=e(r));var s=""+o.version;for(var c in t)if(t.hasOwnProperty(c)&&o[c]){if("string"!=typeof t[c])throw new Error("Browser version in the minVersion map should be a string: "+c+": "+String(t));return i([s,t[c]])<0}return n}function o(e,t,n){return!r(e,t,n)}var s=!0,a=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return a.test=function(e){for(var t=0;t\n\n \n \n \n {{ date }}\n \n \n \n \n {{ day }}\n \n\n\n \n {{ item.humanReadable }}\n \n \n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),vr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),br=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vr(t,e),t.prototype.configureItem=function(e,t){var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");e.humanReadable=new Li(n,this.service.localeValues).format(e.date),e.isOutsideRange=!1},t}(Hi),wr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Hour,new br(e.DatePrecision.Date,6,4))||this}return vr(i,n),Object.defineProperty(i.prototype,"date",{get:function(){return new Li(this.service.localeValues.formats.date,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-hour-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),_r=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Dr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _r(n,t),n.prototype.calcStart=function(t){return Vt.startOf(e.DatePrecision.Hour,Vt.clone(t),!0)},n.prototype.calcDates=function(t){return jt.Array.range(this.length).map(function(n){return Vt.add(e.DatePrecision.Minute,Vt.clone(t),5*n)})},n.prototype.configureItem=function(e,t){e.humanReadable=new Li(this.service.localeValues.formats.time,this.service.localeValues).format(e.date),e.isOutsideRange=!1},n}(Hi),Or=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Minute,new Dr(e.DatePrecision.Hour,4,3))||this}return _r(i,n),Object.defineProperty(i.prototype,"date",{get:function(){if(this.service.config.mode!==e.CalendarMode.TimeOnly){var t=this.service.localeValues.formats.datetime.replace(/[ms]/g,"0");return new Li(t,this.service.localeValues).format(this.currentDate)}var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");return new Li(n,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-minute-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Cr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Cr(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=this.service.localeValues.monthsShort[e.date.getMonth()],e.isOutsideRange=!1},t}(Hi),Mr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Month,new Sr(e.DatePrecision.Year,4,3))||this}return Cr(i,n),Object.defineProperty(i.prototype,"year",{get:function(){return new Li(this.service.localeValues.formats.year,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-month-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Tr(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=jt.String.padLeft(e.date.getFullYear().toString(),4,"0"),e.isOutsideRange=e.date.getFullYear()>=this.calcStart(t).getFullYear()+10},t}(Hi),Pr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Year,new kr(e.DatePrecision.Decade,4,3))||this}return Tr(i,n),Object.defineProperty(i.prototype,"decadeStart",{get:function(){return Vt.startOf(e.DatePrecision.Decade,Vt.clone(this.service.currentDate)).getFullYear()},enumerable:!0,configurable:!0}),i.prototype.pad=function(e){return jt.String.padLeft(e.toString(),4,"0")},i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-year-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),xr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,er,gt,rn],declarations:[mn,Ri,Pr,Mr,yr,wr,Or,Fi,nr,ir,rr,fr],exports:[nr,ir,rr,fr],entryComponents:[Fi]}]}],e.ctorParameters=function(){return[]},e}(),Ir=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Er=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o._isDimmed=!1,o.isDimmedChange=new t.EventEmitter,o.isClickable=!0,o.wrapContent=!0,o._dimmerClasses=!0,o}return Ir(i,n),Object.defineProperty(i.prototype,"isDimmed",{get:function(){return this._isDimmed},set:function(t){var n=!!t;this._transitionController?this._isDimmed!==n&&(this._isDimmed=n,this._transitionController.stopAll(),this._transitionController.animate(new yt("fade",this.transitionDuration,n?e.TransitionDirection.In:e.TransitionDirection.Out))):(this._transitionController=new vt(n,"block"),this.setTransitionController(this._transitionController),this._isDimmed=n)},enumerable:!0,configurable:!0}),i.prototype.onClick=function(){this.isClickable&&(this.isDimmed=!1,this.isDimmedChange.emit(this.isDimmed))},i.decorators=[{type:t.Component,args:[{selector:"sui-dimmer",template:'\n
\n
\n \n
\n
\n',styles:["\n:host.dimmer {\n transition: none;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},i.propDecorators={_dimmerClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dimmer"]}],isDimmed:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDimmedChange:[{type:t.Output}],isClickable:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],wrapContent:[{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},i}(bt),Lr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[Er],exports:[Er]}]}],e.ctorParameters=function(){return[]},e}(),jr={ItemClick:"itemClick",OutsideClick:"outsideClick",Disabled:"disabled"},Vr=function(){function e(e){void 0===e&&(e=jr.ItemClick),this.isOpen=!1,this.isOpenChange=new t.EventEmitter,this.isDisabled=!1,this.autoCloseMode=e,this.children=[]}return Object.defineProperty(e.prototype,"isNested",{get:function(){return!!this.parent},enumerable:!0,configurable:!0}),e.prototype.setOpenState=function(e,t){var n=this;void 0===t&&(t=!1),this.isOpen===e||this.isDisabled?this.isOpen!==e&&this.isDisabled&&this.delay(function(){return n.isOpenChange.emit(n.isOpen)}):(this.isOpen=!!e,this.isAnimating=!0,this.delay(function(){return n.isOpenChange.emit(n.isOpen)}),this.isOpen||this.children.forEach(function(e){return e.setOpenState(n.isOpen)}),this.parent&&t&&this.parent.setOpenState(this.isOpen,!0))},e.prototype.setDisabledState=function(e){this.isDisabled!==e&&(e&&this.setOpenState(!1),this.isDisabled=!!e)},e.prototype.toggleOpenState=function(){this.setOpenState(!this.isOpen)},e.prototype.registerChild=function(e){this.isChildRegistered(e)||(this.children.push(e),e.parent=this)},e.prototype.isChildRegistered=function(e){return this===e||!!this.children.find(function(t){return!!t.children.find(function(t){return t.isChildRegistered(e)})})},e.prototype.clearChildren=function(){this.children.forEach(function(e){e.parent=void 0}),this.children=[]},e.prototype.delay=function(e){setTimeout(function(){return e()})},e}();!function(e){"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,n=(t.document||t.ownerDocument).querySelectorAll(e),i=0;n[i]&&n[i]!==t;)++i;return Boolean(n[i])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window.Element.prototype);var Hr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rr=function(){function e(e,t){this._renderer=e,this.element=t,this.isSelected=!1,this.selectedClass="selected"}return Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.element.nativeElement.classList.contains("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},set:function(e){e?this._renderer.addClass(this.element.nativeElement,this.selectedClass):this._renderer.removeClass(this.element.nativeElement,this.selectedClass)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasChildDropdown",{get:function(){return!!this.childDropdownMenu},enumerable:!0,configurable:!0}),e.prototype.performClick=function(){this.element.nativeElement.click()},e.decorators=[{type:t.Directive,args:[{selector:".item"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={childDropdownMenu:[{type:t.ContentChild,args:[t.forwardRef(function(){return Ar})]}]},e}(),Ar=function(n){function i(e,t,i){var r=n.call(this,e,t,i)||this;return r.element=t,r._transitionController=new vt(!1),r.setTransitionController(r._transitionController),r.menuTransition="slide down",r.menuTransitionDuration=200,r.menuAutoSelectFirst=!1,r.menuSelectedItemClass="selected",r._documentKeyDownListener=e.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),r}return Hr(i,n),Object.defineProperty(i.prototype,"service",{get:function(){return this._service},set:function(t){var n=this;this._service=t;var i=this._service.isOpen;this._service.isOpenChange.subscribe(function(t){t!==i&&(n._transitionController.stopAll(),n._transitionController.animate(new yt(n.menuTransition,n.menuTransitionDuration,e.TransitionDirection.Either,function(){return n._service.isAnimating=!1}))),t||n.selectedItems.length>1&&n.resetSelection(),i=t})},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"items",{set:function(e){this._itemsQueryOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_itemsQuery",{get:function(){return this._itemsQueryOverride||this._itemsQueryInternal},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_items",{get:function(){return this._itemsQuery.filter(function(e){return!e.isDisabled})},enumerable:!0,configurable:!0}),i.prototype.onClick=function(e){if(!e.eventHandled&&(e.eventHandled=!0,this._service.autoCloseMode===jr.ItemClick)){var t=e.target;this.element.nativeElement.contains(t.closest(".item"))&&!/input|textarea/i.test(t.tagName)&&this._service.setOpenState(!1,!0)}},i.prototype.onDocumentKeyDown=function(t){if(this._service.isOpen&&!this._service.isNested){!/input/i.test(t.target.tagName)&&[e.KeyCode.Escape,e.KeyCode.Enter,e.KeyCode.Up,e.KeyCode.Down,e.KeyCode.Left,e.KeyCode.Right].find(function(e){return e===t.keyCode})&&t.preventDefault();var n=this.selectedItems.slice(-1)[0],i=this;if(this.selectedItems.length>=2){var r=this.selectedItems.slice(-2)[0];i=r.childDropdownMenu}switch(t.keyCode){case e.KeyCode.Escape:this._service.setOpenState(!1);break;case e.KeyCode.Down:case e.KeyCode.Up:this.selectedItems.pop(),this.selectedItems.push(i.updateSelection(n,t.keyCode)),t.preventDefault();break;case e.KeyCode.Enter:if(n&&!n.hasChildDropdown){n.performClick();break}case e.KeyCode.Right:n&&n.hasChildDropdown&&(n.childDropdownMenu.service.setOpenState(!0),this.selectedItems.push(n.childDropdownMenu.updateSelection(n,t.keyCode)));break;case e.KeyCode.Left:if(this.selectedItems.length>=2){this.selectedItems.pop();var r=this.selectedItems.slice(-1)[0];r.childDropdownMenu.service.setOpenState(!1),r.isSelected=!0}}}},i.prototype.resetSelection=function(){var e=this;this.selectedItems=[],this._items.forEach(function(t){t.selectedClass=e.menuSelectedItemClass,t.isSelected=!1}),this.menuAutoSelectFirst&&this._items.length>0&&(this._items[0].isSelected=!0,this.scrollToItem(this._items[0]),this.selectedItems.push(this._itemsQuery.first))},i.prototype.updateSelection=function(t,n){t&&(t.isSelected=!1);var i,r=this._items.findIndex(function(e){return e===t});switch(n){case e.KeyCode.Enter:case e.KeyCode.Right:case e.KeyCode.Down:r+=1;break;case e.KeyCode.Up:if(-1===r){r=0;break}r-=1}return i=this._items[r]||t,i&&(i.isSelected=!0,this.scrollToItem(i)),i},i.prototype.scrollToItem=function(e){var t=this.element.nativeElement,n=e.element.nativeElement.getBoundingClientRect(),i=t.getBoundingClientRect(),r=0;n.bottom>i.bottom&&(r=n.bottom-i.bottom),n.top\n\n \x3c!-- Modal component, with transition component attached --\x3e\n \n\n',styles:["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"]}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht}]},n.propDecorators={isClosable:[{type:t.Input}],closeResult:[{type:t.Input}],onApprove:[{type:t.Output,args:["approved"]}],onDeny:[{type:t.Output,args:["denied"]}],onDismiss:[{type:t.Output,args:["dismissed"]}],_modalElement:[{type:t.ViewChild,args:["modal"]}],size:[{type:t.Input}],isFullScreen:[{type:t.Input}],isBasic:[{type:t.Input}],mustScroll:[{type:t.Input}],isInverted:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onDocumentKeyUp:[{type:t.HostListener,args:["document:keyup",["$event"]]}],onDocumentResize:[{type:t.HostListener,args:["window:resize"]}]},n}(),Xr=function(){function e(e){this._componentFactory=e}return e.prototype.open=function(e){var t=this._componentFactory.createComponent(Zr),n=t.instance;if(e instanceof Wr)this._componentFactory.createView(n.templateSibling,e.template,{$implicit:e.context,modal:t.instance.controls});else if(e instanceof qr){var i=this._componentFactory.createComponent(e.component,[{provide:$r,useValue:new $r(n.controls,e.context)}]);this._componentFactory.attachToView(i,n.templateSibling);for(var r=i.location.nativeElement;r.hasChildNodes()&&r.parentElement&&r.firstChild;)r.parentElement.appendChild(r.removeChild(r.firstChild));this._componentFactory.detachFromDocument(i)}return this._componentFactory.attachToApplication(t),n.loadConfig(e),new Br(e,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Ht}]},e}(),eo=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Lr,wt,rn],declarations:[Zr],exports:[Zr],providers:[Xr],entryComponents:[Zr]}]}],e.ctorParameters=function(){return[]},e}(),to=function(){function e(){this._popupClasses=!0,this.value=0,this.maximum=100,this.precision=0,this._overrideSuccess=!1,this.autoSuccess=!0,this.showProgress=!0,this._popupClasses=!0}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){var t=+e;Number.isNaN(t)||(this._value=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){var t=+e;Number.isNaN(t)||(this._maximum=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"precision",{get:function(){return this._precision},set:function(e){var t=+e;Number.isNaN(t)||(this._precision=Math.min(Math.max(t,0),20))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_reachedMaximum",{get:function(){return this._overrideSuccess||this.value>=this.maximum&&this.autoSuccess},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"percentage",{get:function(){return(Math.min(Math.max(this.value,0),this.maximum)/this.maximum*100).toFixed(this.precision)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classValue",{set:function(e){(e.includes("attached")||e.includes("tiny"))&&(this.showProgress=!1),e.includes("success")&&(this._overrideSuccess=!0)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-progress",template:'\n
\n
{{ percentage }}%
\n
\n
\n \n
\n',styles:["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_popupClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.progress"]}],autoSuccess:[{type:t.Input}],showProgress:[{type:t.Input}],value:[{type:t.Input}],maximum:[{type:t.Input}],precision:[{type:t.Input}],_reachedMaximum:[{type:t.HostBinding,args:["class.success"]}],percentage:[{type:t.HostBinding,args:["attr.data-percent"]}],classValue:[{type:t.Input,args:["class"]}]},e}(),no=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[to],exports:[to]}]}],e.ctorParameters=function(){return[]},e}(),io=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ro=function(){function e(){this.hoveredIndex=-1,this.value=0,this.valueChange=new t.EventEmitter,this.maximum=5,this.isReadonly=!1,this._ratingClasses=!0}return Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){this._maximum=+e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icons",{get:function(){return new Array(this.maximum)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){this.isReadonly||(this.value=e+1,this.valueChange.emit(this.value))},e.prototype.onMouseover=function(e){this.hoveredIndex=e},e.prototype.onMouseout=function(){this.hoveredIndex=-1},e.prototype.writeValue=function(e){this.value=e},e.decorators=[{type:t.Component,args:[{selector:"sui-rating",template:'\n\n\n',styles:["\n:host.read-only .icon {\n cursor: auto\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_ratingClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.rating"]}],valueChange:[{type:t.Output}],maximum:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],onMouseout:[{type:t.HostListener,args:["mouseout"]}]},e}(),oo=function(e){function n(t){return e.call(this,t)||this}return io(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-rating",host:{"(valueChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:ro}]},n}(Et),so=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[i.FormsModule,n.CommonModule],declarations:[ro,oo],exports:[ro,oo]}]}],e.ctorParameters=function(){return[]},e}(),ao=function(){function e(e){this.componentFactory=e,this._optionClasses=!0,this.formatter=function(e){return""}}return Object.defineProperty(e.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-search-result",template:'\n\n\n'}]}],e.ctorParameters=function(){return[{type:Ht}]},e.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.result"]}],value:[{type:t.Input}],query:[{type:t.Input}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}]},e}(),co=function(){function e(e){void 0===e&&(e=!1);var t=this;this._options=[],this.optionsFilter=function(e,n){var i=t.toRegex(t._query);return i instanceof RegExp&&e.filter(function(e){return jt.Object.readValue(e,t._optionsField).toString().match(i)})},this.allowEmptyQuery=e,this.searchDelay=0,this.reset()}return Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e||[],this._optionsLookup=void 0,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{get:function(){return this._optionsLookup},set:function(e){this._optionsLookup=e,this._options=[],this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasItemLookup",{get:function(){return!!this.optionsLookup&&2===this.optionsLookup.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{get:function(){return this._optionsField},set:function(e){this._optionsField=e,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this._results},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this._isSearching},enumerable:!0,configurable:!0}),e.prototype.updateQueryDelayed=function(e,t){var n=this;void 0===t&&(t=function(){}),this._query=e,clearTimeout(this._searchDelayTimeout),this._searchDelayTimeout=window.setTimeout(function(){n.updateQuery(e,t)},this.searchDelay)},e.prototype.updateQuery=function(e,t){var n=this;if(void 0===t&&(t=function(){}),this._query=e,""===this._query&&!this.allowEmptyQuery)return t();if(this._resultsCache.hasOwnProperty(this._query))return this._results=this._resultsCache[this._query],t();if(this._optionsLookup){this._isSearching=!0;return void this._optionsLookup.call(void 0,this._query).then(function(e){return n._isSearching=!1,n.updateResults(e),t()}).catch(function(e){return n._isSearching=!1,t(e)})}var i=this.optionsFilter.call(void 0,this._options,this._query);return i&&this.updateResults(i),t()},e.prototype.updateResults=function(e){this._resultsCache[this._query]=e,this._results=e},e.prototype.initialLookup=function(e){return Array,this._optionsLookup(void 0,e)},e.prototype.toRegex=function(e){try{return new RegExp(e,"i")}catch(t){return e}},e.prototype.highlightMatches=function(e,t){var n=this.toRegex(t);return n instanceof RegExp?e.replace(n,function(e){return""+e+""}):e},e.prototype.reset=function(){this._results=[],this._resultsCache={},this._isSearching=!1,this.resetQueryOnChange&&this.updateQuery("")},e}(),uo=function(){function e(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._searchClasses=!0,this.hasIcon=!0,this.allowEmptyQuery=!1,this.resetQueryOnChange=!0,this.retainSelectedResult=!0,this.searchDelay=200,this.maxResults=7,this.onResultSelected=new t.EventEmitter,this.transition="scale",this.transitionDuration=200,this._documentClickListener=n.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resetQueryOnChange",{set:function(e){this.searchService.resetQueryOnChange=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowEmptyQuery",{get:function(){return this._allowEmptyQuery},set:function(e){this._allowEmptyQuery=e,this.searchService.allowEmptyQuery=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this.searchService.query},set:function(e){this.selectedResult=void 0,this.searchService.updateQueryDelayed(e,function(){})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{set:function(e){e&&(this.searchService.options=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{set:function(e){this.searchService.optionsLookup=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resultFormatter",{get:function(){var e=this;return this._resultFormatter?this._resultFormatter:this.searchService.optionsLookup?function(t){return e.readValue(t)}:function(t,n){return e.searchService.highlightMatches(e.readValue(t),n)}},set:function(e){this._resultFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"searchDelay",{set:function(e){this.searchService.searchDelay=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this.searchService.results.slice(0,this.maxResults)},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this._menu.service=this.dropdownService},e.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().search},e.prototype.select=function(e){this.onResultSelected.emit(e),this.dropdownService.setOpenState(!1),this.retainSelectedResult?(this.selectedResult=e,this.searchService.updateQuery(this.readValue(e))):this.searchService.updateQuery("")},e.prototype.onClick=function(e){this.open()},e.prototype.onFocusIn=function(){this.dropdownService.isAnimating||this.open()},e.prototype.open=function(){(this.searchService.query.length>0||this.allowEmptyQuery)&&this.dropdownService.setOpenState(!0)},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.dropdownService.setOpenState(!1)},e.prototype.onDocumentClick=function(e){this._element.nativeElement.contains(e.target)||this.dropdownService.setOpenState(!1)},e.prototype.readValue=function(e){return jt.Object.readValue(e,this.searchService.optionsField)},e.prototype.ngOnDestroy=function(){this._documentClickListener()},e.decorators=[{type:t.Component,args:[{selector:"sui-search",template:'\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n',styles:["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},e.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_searchClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.search"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],hasIcon:[{type:t.Input}],resetQueryOnChange:[{type:t.Input}],allowEmptyQuery:[{type:t.Input}],placeholder:[{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],optionsField:[{type:t.Input}],resultFormatter:[{type:t.Input}],resultTemplate:[{type:t.Input}],retainSelectedResult:[{type:t.Input}],searchDelay:[{type:t.Input}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],maxResults:[{type:t.Input}],onResultSelected:[{type:t.Output,args:["resultSelected"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),po=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,gt,rn],declarations:[uo,ao],exports:[uo]}]}],e.ctorParameters=function(){return[]},e}(),lo=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ho=function(e){function n(n,i,r){var o=e.call(this,n,i)||this;return o.changeDetector=r,o._optionClasses=!0,o.isActive=!1,o.onSelected=new t.EventEmitter,o.renderedText="",o.usesTemplate=!1,o}return lo(n,e),Object.defineProperty(n.prototype,"formatter",{set:function(e){this.usesTemplate?this.renderedText="":this.renderedText=e(this.value)},enumerable:!0,configurable:!0}),n.prototype.onClick=function(e){var t=this;e.eventHandled=!0,setTimeout(function(){return t.onSelected.emit(t.value)})},n.decorators=[{type:t.Component,args:[{selector:"sui-select-option",template:'\n\n\n'}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},n.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.item"]}],value:[{type:t.Input}],onSelected:[{type:t.Output}],isActive:[{type:t.HostBinding,args:["class.active"]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(Rr),fo=function(){function e(e,n){this._renderer=e,this._element=n,this.onQueryUpdated=new t.EventEmitter,this.onQueryKeyDown=new t.EventEmitter,this._searchClass=!0,this._autoComplete="off"}return Object.defineProperty(e.prototype,"query",{set:function(e){this._renderer.setProperty(this._element.nativeElement,"value",e)},enumerable:!0,configurable:!0}),e.prototype.updateQuery=function(e){this.onQueryUpdated.emit(e)},e.prototype.onKeyDown=function(e){this.onQueryKeyDown.emit(e)},e.prototype.focus=function(){var e=this;this._element.nativeElement.focus(),setTimeout(function(){return e._element.nativeElement.focus()})},e.decorators=[{type:t.Directive,args:[{selector:"input[suiSelectSearch]"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_searchClass:[{type:t.HostBinding,args:["class.search"]}],_autoComplete:[{type:t.HostBinding,args:["attr.autocomplete"]}],updateQuery:[{type:t.HostListener,args:["input",["$event.target.value"]]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}(),mo=function(){function n(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co(!0),this.isSearchable=!1,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._renderedSubscriptions=[],this.icon="dropdown",this.transition="slide down",this.transitionDuration=200,this.onTouched=new t.EventEmitter,this._documentKeyDownListener=n.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),this._selectClasses=!0}return Object.defineProperty(n.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isVisible",{get:function(){return this._menu.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_searchClass",{get:function(){return this.isSearchable&&!this.isSearchExternal},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"searchInput",{get:function(){return this._manualSearch||this._internalSearch},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tabIndex",{get:function(){return this.isDisabled?-1:this.dropdownService.isOpen&&this.isSearchExternal?-1:void 0!=this._tabIndex?this._tabIndex:this._searchClass?-1:0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isDisabled",{get:function(){return this.dropdownService.isDisabled},set:function(e){this.dropdownService.isDisabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"options",{set:function(e){e&&(this.searchService.options=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsLookup",{set:function(e){e&&(this.searchService.optionsLookup=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"filteredOptions",{get:function(){return this.searchService.results},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"query",{get:function(){return this.isSearchable?this.searchService.query:void 0},set:function(e){var t=this;void 0!=e&&(this.queryUpdateHook(),this.updateQuery(e),this._renderedOptions.forEach(function(e){return t.initialiseRenderedOption(e)}),this.searchInput&&(this.searchInput.query=e))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelField",{get:function(){return this.searchService.optionsField},set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelGetter",{get:function(){var e=this;return function(t){var n=jt.Object.readValue(t,e.labelField);return void 0!=n?n.toString():""}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valueGetter",{get:function(){var e=this;return function(t){return jt.Object.readValue(t,e.valueField)}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"configuredFormatter",{get:function(){var e=this;return this._optionFormatter?function(t){return e._optionFormatter(t,e.isSearchable?e.query:void 0)}:this.searchService.optionsLookup?function(t){return e.labelGetter(t)}:function(t){return e.searchService.highlightMatches(e.labelGetter(t),e.query||"")}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionFormatter",{set:function(e){this._optionFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),n.prototype.ngAfterContentInit=function(){var e=this;this._menu.service=this.dropdownService,this._menu.items=this._renderedOptions,this._manualSearch&&(this.isSearchable=!0,this.isSearchExternal=!0),this.searchInput&&(this.searchInput.onQueryUpdated.subscribe(function(t){return e.query=t}),this.searchInput.onQueryKeyDown.subscribe(function(t){return e.onQueryInputKeydown(t)})),this.onAvailableOptionsRendered(),this._renderedOptions.changes.subscribe(function(){return e.onAvailableOptionsRendered()})},n.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().select},n.prototype.optionsUpdateHook=function(){},n.prototype.queryUpdateHook=function(){},n.prototype.updateQuery=function(e){var t=this;this.searchService.updateQuery(e,function(){return t.dropdownService.setOpenState(!0)})},n.prototype.resetQuery=function(e){void 0===e&&(e=!0),e?(this.searchService.searchDelay=this._menu.menuTransitionDuration,this.searchService.updateQueryDelayed("")):this.searchService.updateQuery(""),this.searchInput&&(this.searchInput.query="")},n.prototype.onAvailableOptionsRendered=function(){var e=this;this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._renderedSubscriptions=[],this._renderedOptions.forEach(function(t){setTimeout(function(){return e.initialiseRenderedOption(t)}),e._renderedSubscriptions.push(t.onSelected.subscribe(function(){return e.selectOption(t.value)}))}),0!==this.searchService.options.length||this.searchService.optionsLookup||(this.options=this._renderedOptions.map(function(e){return e.value}))},n.prototype.initialiseRenderedOption=function(e){e.usesTemplate=!!this.optionTemplate,e.formatter=this.configuredFormatter,e.usesTemplate&&this.drawTemplate(e.templateSibling,e.value),e.changeDetector.markForCheck()},n.prototype.findOption=function(e,t){var n=this;return e.find(function(e){return t===n.valueGetter(e)})},n.prototype.onCaretClick=function(e){e.eventHandled||(e.eventHandled=!0,this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!this.dropdownService.isOpen),this.focus()))},n.prototype.onClick=function(e){e.eventHandled||this.dropdownService.isAnimating||(e.eventHandled=!0,this.dropdownService.setOpenState(!!this.isSearchable||!this.dropdownService.isOpen),this.focus())},n.prototype.onFocusIn=function(){this.dropdownService.isOpen||this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!0),this.focus())},n.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||(this.dropdownService.setOpenState(!1),this.onTouched.emit())},n.prototype.onKeyPress=function(t){t.keyCode===e.KeyCode.Enter&&this._element.nativeElement.click()},n.prototype.onDocumentKeyDown=function(t){this._element.nativeElement.contains(t.target)&&!this.dropdownService.isOpen&&t.keyCode===e.KeyCode.Down&&(this._element.nativeElement.click(),t.preventDefault())},n.prototype.onQueryInputKeydown=function(e){},n.prototype.focus=function(){this.isSearchable&&this.searchInput?this.searchInput.focus():this._element.nativeElement.focus()},n.prototype.drawTemplate=function(e,t){e.clear(),e.createEmbeddedView(this.optionTemplate,{$implicit:t,query:this.query})},n.prototype.ngOnDestroy=function(){this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._documentKeyDownListener()},n.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_renderedOptions:[{type:t.ContentChildren,args:[ho,{descendants:!0}]}],_selectClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dropdown"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isSearchable:[{type:t.Input}],_searchClass:[{type:t.HostBinding,args:["class.search"]}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],_internalSearch:[{type:t.ViewChild,args:[fo]}],_manualSearch:[{type:t.ContentChild,args:[fo]}],_tabIndex:[{type:t.Input,args:["tabindex"]}],tabIndex:[{type:t.HostBinding,args:["attr.tabindex"]}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],labelField:[{type:t.Input}],valueField:[{type:t.Input}],optionTemplate:[{type:t.Input}],optionFormatter:[{type:t.Input}],icon:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onTouched:[{type:t.Output,args:["touched"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}],onKeyPress:[{type:t.HostListener,args:["keypress",["$event"]]}]},n}(),go=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),yo=function(n){function i(i,r,o,s){var a=n.call(this,i,r,o)||this;return a.componentFactory=s,a._transitionController=new vt(!1,"inline-block"),a.setTransitionController(a._transitionController),a.onDeselected=new t.EventEmitter,a._labelClasses=!0,a._transitionController.animate(new yt("scale",100,e.TransitionDirection.In)),a}return go(i,n),Object.defineProperty(i.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),i.prototype.deselectOption=function(t){var n=this;t.eventHandled=!0,this._transitionController.animate(new yt("scale",100,e.TransitionDirection.Out,function(){return n.onDeselected.emit(n.value)}))},i.prototype.onClick=function(e){e.eventHandled=!0},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select-label",template:'\n\n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:Ht}]},i.propDecorators={_labelClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.label"]}],value:[{type:t.Input}],query:[{type:t.Input}],onDeselected:[{type:t.Output,args:["deselected"]}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},i}(bt),vo=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bo=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o.selectedOptions=[],o.selectedOptionsChange=new t.EventEmitter,o.hasLabels=!0,o._multiSelectClasses=!0,o}return vo(i,n),Object.defineProperty(i.prototype,"filteredOptions",{get:function(){var e=this;if(this.maxSelectedReached)return[];var t=this.searchService.results;return this.hasLabels?t.filter(function(t){return void 0==e.selectedOptions.find(function(e){return t===e})}):t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasLabels",{get:function(){return this._hasLabels},set:function(e){this._hasLabels=e}, +enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.multi.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxSelectedReached",{get:function(){return void 0!=this.maxSelected&&this.selectedOptions.length===this.maxSelected},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxSelectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.maxSelectedMessage,[["max",this.maxSelected.toString()]])},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.selectedMessage,[["count",this.selectedOptions.length.toString()]])},enumerable:!0,configurable:!0}),i.prototype.optionsUpdateHook=function(){var e=this;!this._writtenOptions&&this.selectedOptions.length>0&&this.writeValue(this.selectedOptions.map(function(t){return e.valueGetter(t)})),this._writtenOptions&&this.searchService.options.length>0&&(this.selectedOptions=this._writtenOptions.map(function(t){return e.findOption(e.searchService.options,t)}).filter(function(e){return void 0!=e}),this.selectedOptions.length===this._writtenOptions.length&&(this._writtenOptions=void 0))},i.prototype.initialiseRenderedOption=function(e){n.prototype.initialiseRenderedOption.call(this,e),e.isActive=!this.hasLabels&&-1!==this.selectedOptions.indexOf(e.value)},i.prototype.selectOption=function(e){var t=this;if(-1!==this.selectedOptions.indexOf(e))return void this.deselectOption(e);this.selectedOptions.push(e),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.resetQuery(!1),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.writeValue=function(e){var t=this;e instanceof Array?(this.searchService.options.length>0&&(this.selectedOptions=e.map(function(e){return t.findOption(t.searchService.options,e)}).filter(function(e){return void 0!=e})),e.length>0&&0===this.selectedOptions.length&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){return t.selectedOptions=e}):this._writtenOptions=e),0===e.length&&(this.selectedOptions=[])):this.selectedOptions=[]},i.prototype.deselectOption=function(e){var t=this;this.selectedOptions=this.selectedOptions.filter(function(t){return t!==e}),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.onQueryInputKeydown=function(t){t.keyCode===e.KeyCode.Backspace&&""===this.query&&this.selectedOptions.length>0&&this.deselectOption(this.selectedOptions[this.selectedOptions.length-1])},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select",template:'\n\x3c!-- Dropdown icon --\x3e\n\n\n\n\x3c!-- Multi-select labels --\x3e\n \n\n\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Helper text --\x3e\n
\n \n \x3c!-- Placeholder text --\x3e\n {{ placeholder }}\n \n \x3c!-- Summary shown when labels are hidden --\x3e\n {{ selectedMessage }}\n
\n\n\x3c!-- Select dropdown menu --\x3e\n\n',styles:["\n:host input.search {\n width: 12em !important;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},i.propDecorators={selectedOptionsChange:[{type:t.Output}],hasLabels:[{type:t.Input}],placeholder:[{type:t.Input}],maxSelected:[{type:t.Input}],_multiSelectClasses:[{type:t.HostBinding,args:["class.multiple"]}]},i}(mo),wo=function(e){function n(t){return e.call(this,t)||this}return vo(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-multi-select",host:{"(selectedOptionsChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:bo}]},n}(Et),_o=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Do=function(e){function n(n,i,r){var o=e.call(this,n,i,r)||this;return o.selectedOptionChange=new t.EventEmitter,o}return _o(n,e),Object.defineProperty(n.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.single.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),n.prototype.optionsUpdateHook=function(){!this._writtenOption&&this.selectedOption&&this.writeValue(this.valueGetter(this.selectedOption)),this._writtenOption&&this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,this._writtenOption),this.selectedOption&&(this._writtenOption=void 0,this.drawSelectedOption()))},n.prototype.queryUpdateHook=function(){this.selectedOption=void 0},n.prototype.selectOption=function(e){this.selectedOption=e,this.selectedOptionChange.emit(this.valueGetter(e)),this.dropdownService.setOpenState(!1),this.resetQuery(),this.drawSelectedOption(),this.focus()},n.prototype.writeValue=function(e){var t=this;void 0!=e?(this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,e),this.drawSelectedOption()),void 0==this.selectedOption&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){t.selectedOption=e,t.drawSelectedOption()}):this._writtenOption=e)):(this.selectedOption=void 0,this.drawSelectedOption())},n.prototype.initialiseRenderedOption=function(t){e.prototype.initialiseRenderedOption.call(this,t),t.isActive=t.value===this.selectedOption},n.prototype.drawSelectedOption=function(){this._renderedOptions&&this.onAvailableOptionsRendered(),void 0!=this.selectedOption&&this.optionTemplate&&this.drawTemplate(this._optionTemplateSibling,this.selectedOption)},n.decorators=[{type:t.Component,args:[{selector:"sui-select",template:'\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Placeholder text --\x3e\n
{{ placeholder }}
\n\x3c!-- Selected item --\x3e\n
\n \n \n
\n\x3c!-- Dropdown icon --\x3e\n\n\x3c!-- Select dropdown menu --\x3e\n\n'}]}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},n.propDecorators={_optionTemplateSibling:[{type:t.ViewChild,args:["optionTemplateSibling",{read:t.ViewContainerRef}]}],selectedOptionChange:[{type:t.Output}],placeholder:[{type:t.Input}]},n}(mo),Oo=function(e){function n(t){return e.call(this,t)||this}return _o(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-select",host:{"(selectedOptionChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:Do}]},n}(Et),Co=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,rn,gt],declarations:[Do,ho,fo,Oo,bo,yo,wo],exports:[Do,ho,fo,Oo,bo,wo]}]}],e.ctorParameters=function(){return[]},e}(),So={Overlay:"overlay",Push:"push",ScaleDown:"scale down",Uncover:"uncover",SlideAlong:"slide along",SlideOut:"slide out"},Mo={Left:"left",Right:"right",Top:"top",Bottom:"bottom"},To=function(){function e(e){void 0===e&&(e=!1),this.isVisible=e,this.isAnimating=!1,this.wasJustOpened=!1,this.isVisibleChange=new t.EventEmitter,this.widthChange=new t.EventEmitter,this.heightChange=new t.EventEmitter,this.width=260,this.height=0,this.transition=So.Uncover}return Object.defineProperty(e.prototype,"width",{get:function(){return this.direction===Mo.Left?this._width:this.direction===Mo.Right?-this._width:0},set:function(e){this._width=e,this.widthChange.emit()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.direction===Mo.Top?this._height:this.direction===Mo.Bottom?-this._height:0},set:function(e){this._height=e,this.heightChange.emit()},enumerable:!0,configurable:!0}),e.prototype.setVisibleState=function(e){var t=this;this.isVisible!==e&&(this.isVisible=e,this.isAnimating=!0,this.wasJustOpened=!0,this.isVisibleChange.emit(e),setTimeout(function(){return t.wasJustOpened=!1}),clearTimeout(this._isAnimatingTimeout),this._isAnimatingTimeout=window.setTimeout(function(){return t.isAnimating=!1},500))},e.prototype.toggleVisibleState=function(){this.setVisibleState(!this.isVisible)},e}(),ko=function(){function e(e,t){var n=this;this._renderer=e,this._element=t,this.service=new To,this.transition=So.Uncover,this.direction=Mo.Left,setTimeout(function(){return n.updateDimensions()}),this.service.isVisibleChange.subscribe(function(){return n.updateDimensions()}),this._sidebarClasses=!0}return Object.defineProperty(e.prototype,"transition",{get:function(){return this.service.transition},set:function(e){var t=this;this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!1)}),this.service.transition=e,this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!0)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"direction",{get:function(){return this.service.direction},set:function(e){this.setClass(this.service.direction,!1),this.service.direction=e,this.setClass(this.service.direction,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.service.isVisible},set:function(e){this.service.setVisibleState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisibleChange",{get:function(){return this.service.isVisibleChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAnimating",{get:function(){return this.service.isAnimating},enumerable:!0,configurable:!0}),e.prototype.updateDimensions=function(){this.service.width=this._element.nativeElement.offsetWidth,this.service.height=this._element.nativeElement.offsetHeight},e.prototype.setClass=function(e,t){void 0===t&&(t=!0),t?this._renderer.addClass(this._element.nativeElement,e):this._renderer.removeClass(this._element.nativeElement,e)},e.prototype.open=function(){this.service.setVisibleState(!0)},e.prototype.close=function(){this.service.setVisibleState(!1)},e.prototype.toggle=function(){this.service.toggleVisibleState()},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar",template:""}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_sidebarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.sidebar"]},{type:t.HostBinding,args:["class.menu"]}],transition:[{type:t.Input}],direction:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]},{type:t.Input}],isVisibleChange:[{type:t.Output}],isAnimating:[{type:t.HostBinding,args:["class.animating"]}]},e}(),Po=function(){function e(e,t){this._renderer=e,this._element=t,this.isDimmedWhenVisible=!1,this._siblingClasses=!0}return Object.defineProperty(e.prototype,"service",{get:function(){return this._service},set:function(e){var t=this;this._service=e,setTimeout(function(){return t.updateTransform()}),this._service.isVisibleChange.subscribe(function(){return t.updateTransform()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return!!this.service&&this.service.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDimmed",{get:function(){return!!this.service&&(this.service.isVisible&&this.isDimmedWhenVisible)},enumerable:!0,configurable:!0}),e.prototype.updateTransform=function(){if(this._renderer.removeStyle(this._element.nativeElement,"transform"),this._renderer.removeStyle(this._element.nativeElement,"-webkit-transform"),this.service.isVisible&&this.service.transition!==So.Overlay&&this.service.transition!==So.ScaleDown){var e="translate3d("+this.service.width+"px, "+this.service.height+"px, 0)";this._renderer.setStyle(this._element.nativeElement,"transform",e),this._renderer.setStyle(this._element.nativeElement,"-webkit-transform",e)}},e.prototype.onClick=function(e){this.service.isVisible&&!this.service.wasJustOpened&&this.service.setVisibleState(!1)},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-sibling",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={isDimmedWhenVisible:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isDimmed:[{type:t.HostBinding,args:["class.dimmed"]}],_siblingClasses:[{type:t.HostBinding,args:["class.pusher"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},e}(),xo=function(){function e(){this._containerClasses=!0}return e.prototype.ngAfterContentInit=function(){if(!this.sidebar)throw new Error("You must include a element within the container.");if(this.service=this.sidebar.service,!this.sibling)throw new Error("You must include a element within the container.");this.sibling.service=this.service},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-container",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_containerClasses:[{type:t.HostBinding,args:["class.pushable"]}],sidebar:[{type:t.ContentChild,args:[ko]}],sibling:[{type:t.ContentChild,args:[Po]}]},e}(),Io=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[ko,xo,Po],exports:[ko,xo,Po]}]}],e.ctorParameters=function(){return[]},e}(),Eo=function(){function e(e,t){var n=this;this.id=e.id,this.header=e,this.content=t,this.header.isActiveChange.subscribe(function(){return n.content.isActive=n.isActive})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.header.isActive},set:function(e){this.header.setActiveState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.header.isDisabled},enumerable:!0,configurable:!0}),e}(),Lo=function(){function e(){this._isActive=!1,this.isActiveChange=new t.EventEmitter,this.isActiveExternalChange=new t.EventEmitter,this.onActivate=new t.EventEmitter,this.onDeactivate=new t.EventEmitter,this.isDisabled=!1,this._headerClasses=!0}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},set:function(e){var t=this,n=e;setTimeout(function(){n=!t.isDisabled&&e,t.setActiveState(n),t.isActiveExternalChange.emit(n)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(e){this._isDisabled!==e&&(this._isDisabled=e,this.isDisabled&&(this.isActive=!1))},enumerable:!0,configurable:!0}),e.prototype.setActiveState=function(e){!!this._isActive!==e&&(this._isActive=e,e?this.onActivate.emit():this.onDeactivate.emit()),this.isActiveChange.emit(e)},e.prototype.onClick=function(){this.isDisabled||(this.isActive=!0)},e.decorators=[{type:t.Directive,args:[{selector:"[suiTabHeader]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_headerClasses:[{type:t.HostBinding,args:["class.item"]}],id:[{type:t.Input,args:["suiTabHeader"]}],isActiveChange:[{type:t.Output}],onActivate:[{type:t.Output,args:["activate"]}],onDeactivate:[{type:t.Output,args:["deactivate"]}],isActive:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},e}(),jo=function(){function e(){this.isActive=!1,this._contentClasses=!0}return e.decorators=[{type:t.Directive,args:[{selector:"[suiTabContent]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_contentClasses:[{type:t.HostBinding,args:["class.tab"]}],id:[{type:t.Input,args:["suiTabContent"]}],isActive:[{type:t.HostBinding,args:["class.active"]}]},e}(),Vo=function(){function e(){this.tabs=[],this._barrierCount=0}return Object.defineProperty(e.prototype,"activeTab",{get:function(){return this._activeTab},set:function(e){this._activeTab=e,e.isActive=!0},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this._tabHeaders.changes.subscribe(function(){return e.internalComponentsUpdated()}),this._tabContents.changes.subscribe(function(){return e.internalComponentsUpdated()}),this.loadTabs()},e.prototype.internalComponentsUpdated=function(){2===++this._barrierCount&&(this._barrierCount=0,this.loadTabs())},e.prototype.loadTabs=function(){var e=this;if(this.tabs=this.tabs.filter(function(t){return!!e._tabHeaders.find(function(e){return e===t.header})}),this._tabHeaders.filter(function(t){return!e.tabs.find(function(e){return e.header===t})}).forEach(function(t){var n=e._tabContents.find(function(e){return e.id===t.id});if(!n)throw new Error("A [suiTabHeader] must have a related [suiTabContent].");var i=new Eo(t,n);i.header.isActiveExternalChange.subscribe(function(){return e.onHeaderActiveChanged(i)}),e.tabs.push(i)}),this._tabHeaders.forEach(function(t,n){var i=e.tabs.find(function(e){return e.header===t});i&&(i.index=n)}),this.tabs.sort(function(e,t){return e.index-t.index}),this.activeTab?this.tabs.find(function(t){return t===e.activeTab})||setTimeout(function(){return e.activateClosestTab(e.activeTab)}):this.activateFirstTab(),0===this.tabs.length)throw new Error("You cannot have no tabs!")},e.prototype.onHeaderActiveChanged=function(e){e.isActive&&this.activeTab!==e&&(this.tabs.filter(function(t){return t!==e}).forEach(function(e){return e.isActive=!1}),this.activeTab=e),e.isActive||this.activeTab!==e||this.activateClosestTab(e)},e.prototype.activateFirstTab=function(){this.activeTab=this.tabs[0]},e.prototype.activateClosestTab=function(e){var t;if(e.index>=this.tabs.length&&(t=this.tabs[this.tabs.length-1]),t||(t=this.tabs.find(function(t){return t===e})?this.tabs[Math.max(e.index-1,0)]:this.tabs[e.index]),t.isDisabled)return this.activateClosestTab(t);this.activeTab=t},e.decorators=[{type:t.Component,args:[{selector:"sui-tabset",template:""}]}],e.ctorParameters=function(){return[]},e.propDecorators={_tabHeaders:[{type:t.ContentChildren,args:[Lo]}],_tabContents:[{type:t.ContentChildren,args:[jo]}]},e}(),Ho=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[Vo,Lo,jo],exports:[Vo,Lo,jo]}]}],e.ctorParameters=function(){return[]},e}(),Ro=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{exports:[Dt,Ct,xt,hn,Pt,xr,Lr,Yr,eo,er,no,so,po,Co,Io,Ho,wt,gt,rn]}]}],e.ctorParameters=function(){return[]},e}();e.SuiLocalizationService=mt,e.SuiLocalizationModule=gt,e.SuiMessage=_t,e.SuiMessageModule=Dt,e.SuiPagination=Ot,e.SuiPaginationModule=Ct,e.SuiAccordionPanel=St,e.SuiAccordion=Tt,e.SuiAccordionService=Mt,e.SuiAccordionModule=xt,e.SuiCheckbox=sn,e.SuiCheckboxValueAccessor=an,e.SuiRadio=un,e.SuiRadioValueAccessor=pn,e.SuiRadioManager=ln,e.SuiCheckboxModule=hn,e.SuiCollapse=kt,e.SuiCollapseModule=Pt,e.CalendarConfig=Sn,e.DateConfigBase=Mn,e.YearConfig=Tn,e.MonthConfig=kn,e.DateConfig=Pn,e.DatetimeConfig=xn,e.TimeConfig=In,e.CalendarMappings=vn,e.DateMappings=bn,e.TimeMappings=wn,e.DatetimeMappings=_n,e.MonthMappings=Dn,e.YearMappings=On,e.DateComparer=En,e.DateParser=Li,e.InternalDateParser=ji,e.SuiCalendarViewTitle=Ri,e.DatepickerMode=Ai,e.SuiDatepicker=Fi,e.CalendarItem=fn,e.SuiCalendarItem=mn,e.SuiDatepickerDirective=nr,e.SuiDatepickerDirectiveValueAccessor=ir,e.SuiDatepickerDirectiveValidator=rr,e.SuiDatepickerInputDirective=fr,e.DateFnsParser=Ii,e.CalendarRange=Vi,e.CalendarRangeService=Hi,e.CalendarService=dn,e.CalendarView=gn,e.CalendarRangeDateService=gr,e.SuiCalendarDateView=yr,e.CalendarRangeHourService=br,e.SuiCalendarHourView=wr,e.CalendarRangeMinuteService=Dr,e.SuiCalendarMinuteView=Or,e.CalendarRangeMonthService=Sr,e.SuiCalendarMonthView=Mr,e.CalendarRangeYearService=kr,e.SuiCalendarYearView=Pr,e.SuiDatepickerModule=xr,e.SuiDimmer=Er,e.SuiDimmerModule=Lr,e.SuiDropdownMenuItem=Rr,e.SuiDropdownMenu=Ar,e.SuiDropdown=Fr,e.DropdownAutoCloseType=jr,e.DropdownService=Vr,e.SuiDropdownModule=Yr,e.ActiveModal=Br,e.ModalSize=Ur,e.ModalConfig=zr,e.TemplateModalConfig=Wr,e.ComponentModalConfig=qr,e.ModalControls=Qr,e.Modal=$r,e.ModalTemplate=Jr,e.SuiModal=Zr,e.SuiModalService=Xr,e.SuiModalModule=eo,e.SuiPopupComponentController=Wi,e.PopupTrigger=Yi,e.PopupConfig=Bi,e.SuiPopupController=Ui,e.TemplatePopupConfig=Ki,e.SuiPopupTemplateController=Qi,e.SuiPopupArrow=$i,e.SuiPopup=Ni,e.SuiPopupDirective=Xi,e.SuiPopupConfig=Ji,e.SuiPopupModule=er,e.SuiProgress=to,e.SuiProgressModule=no,e.SuiRating=ro,e.SuiRatingValueAccessor=oo,e.SuiRatingModule=so,e.SuiSearchResult=ao,e.SuiSearch=uo,e.SearchService=co,e.SuiSearchModule=po,e.SuiSelectBase=mo,e.SuiMultiSelectLabel=yo,e.SuiMultiSelect=bo,e.SuiMultiSelectValueAccessor=wo,e.SuiSelectOption=ho,e.SuiSelect=Do,e.SuiSelectValueAccessor=Oo,e.SuiSelectSearch=fo,e.SuiSelectModule=Co,e.SuiSidebarContainer=xo,e.SuiSidebarSibling=Po,e.SuiSidebar=ko,e.SidebarTransition=So,e.SidebarDirection=Mo,e.SidebarService=To,e.SuiSidebarModule=Io,e.Tab=Eo,e.SuiTabset=Vo,e.SuiTabContent=jo,e.SuiTabHeader=Lo,e.SuiTabsModule=Ho,e.TransitionController=vt,e.Transition=yt,e.SuiTransition=bt,e.SuiTransitionModule=wt,e.CustomValidator=It,e.customValidatorFactory=a,e.CustomValueAccessor=Et,e.customValueAccessorFactory=c,e.DateUtil=Vt,e.HandledEvent=Lt,e.Util=jt,e.SuiComponentFactory=Ht,e.PositioningPlacement=tn,e.PositioningService=nn,e.SuiUtilityModule=rn,e.SuiModule=Ro,Object.defineProperty(e,"__esModule",{value:!0})}); diff --git a/dist/modules/search/components/search.d.ts b/dist/modules/search/components/search.d.ts index 4458cb9ef..cca0478a3 100644 --- a/dist/modules/search/components/search.d.ts +++ b/dist/modules/search/components/search.d.ts @@ -16,6 +16,7 @@ export declare class SuiSearch implements AfterViewInit, OnDestroy { private _searchClasses; readonly isActive: boolean; hasIcon: boolean; + resetQueryOnChange: boolean; allowEmptyQuery: boolean; private _allowEmptyQuery; private _placeholder; diff --git a/dist/modules/search/components/search.js b/dist/modules/search/components/search.js index b5fac4977..18c68430f 100644 --- a/dist/modules/search/components/search.js +++ b/dist/modules/search/components/search.js @@ -15,6 +15,7 @@ var SuiSearch = /** @class */ (function () { this._searchClasses = true; this.hasIcon = true; this.allowEmptyQuery = false; + this.resetQueryOnChange = true; this.retainSelectedResult = true; this.searchDelay = 200; this.maxResults = 7; @@ -30,6 +31,15 @@ var SuiSearch = /** @class */ (function () { enumerable: true, configurable: true }); + Object.defineProperty(SuiSearch.prototype, "resetQueryOnChange", { + set: + // Sets whether the query is reset if options change. + function (resetQueryOnChange) { + this.searchService.resetQueryOnChange = resetQueryOnChange; + }, + enumerable: true, + configurable: true + }); Object.defineProperty(SuiSearch.prototype, "allowEmptyQuery", { get: function () { return this._allowEmptyQuery; @@ -225,6 +235,7 @@ var SuiSearch = /** @class */ (function () { "_searchClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.search",] },], "isActive": [{ type: HostBinding, args: ["class.active",] },], "hasIcon": [{ type: Input },], + "resetQueryOnChange": [{ type: Input },], "allowEmptyQuery": [{ type: Input },], "placeholder": [{ type: Input },], "options": [{ type: Input },], diff --git a/dist/modules/search/components/search.js.map b/dist/modules/search/components/search.js.map index 206d03741..d8c013d9d 100644 --- a/dist/modules/search/components/search.js.map +++ b/dist/modules/search/components/search.js.map @@ -1 +1 @@ -{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../src/modules/search/components/search.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAiB,YAAY,EACrE,YAAY,EAAE,MAAM,EAAa,UAAU,EAAE,WAAW,EAAE,SAAS,EACtE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAoC,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAyC,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;;IA8LvD,mBAAoB,QAAmB,EAAE,QAAkB,EAAU,oBAA2C;QAAhH,iBAoBC;QApBmB,aAAQ,GAAR,QAAQ,CAAW;QAA8B,yBAAoB,GAApB,oBAAoB,CAAuB;QAC5G,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;QAC7C,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,EAAQ,CAAC;QAE/C,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,cAAc,EAAE,EAArB,CAAqB,CAAC,CAAC;QAElF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CA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C,cAAc;6BAG1B,WAAW,SAAC,cAAc;4BAM1B,KAAK;oCAIL,KAAK;gCAaL,KAAK;4BA6BL,KAAK;kCAOL,KAAK;kCAOL,KAAK;iCAKL,KAAK;oCAiBL,KAAK;mCAKL,KAAK;yCAGL,KAAK;gCAGL,KAAK;gCAKL,WAAW,SAAC,eAAe;+BAK3B,KAAK;qCAWL,MAAM,SAAC,gBAAgB;+BAGvB,KAAK;uCAGL,KAAK;8BAoDL,YAAY,SAAC,SAAS;+BActB,YAAY,SAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;oBAlQxC;;SAqDa,SAAS","sourcesContent":["import {\n Component, ViewChild, HostBinding, Input, AfterViewInit, HostListener,\n EventEmitter, Output, Directive, ElementRef, TemplateRef, Renderer2, OnDestroy\n} from \"@angular/core\";\nimport { Util, ITemplateRefContext, IFocusEvent } from \"../../../misc/util/index\";\nimport { DropdownService, SuiDropdownMenu } from \"../../dropdown/index\";\nimport { ISearchLocaleValues, RecursivePartial, SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SearchService } from \"../services/search.service\";\nimport { LookupFn, FilterFn } from \"../helpers/lookup-fn\";\n\nexport interface IResultContext extends ITemplateRefContext {\n query:string;\n}\n\n@Component({\n selector: \"sui-search\",\n template: `\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n`,\n styles: [`\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n`]\n})\nexport class SuiSearch implements AfterViewInit, OnDestroy {\n public dropdownService:DropdownService;\n public searchService:SearchService;\n\n @ViewChild(SuiDropdownMenu)\n private _menu:SuiDropdownMenu;\n\n // Sets the Semantic UI classes on the host element.\n // Doing it on the host enables use in menus etc.\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.search\")\n private _searchClasses:boolean;\n\n @HostBinding(\"class.active\")\n public get isActive():boolean {\n return this.dropdownService.isOpen;\n }\n\n // Sets whether the search element has a visible search icon.\n @Input()\n public hasIcon:boolean;\n\n // Sets whether the search element display result with empty query.\n @Input()\n public set allowEmptyQuery(allowEmptyQuery:boolean) {\n this._allowEmptyQuery = allowEmptyQuery;\n this.searchService.allowEmptyQuery = allowEmptyQuery;\n }\n public get allowEmptyQuery():boolean {\n return this._allowEmptyQuery;\n }\n\n private _allowEmptyQuery:boolean;\n private _placeholder:string;\n\n // Gets & sets the placeholder text displayed inside the text input.\n @Input()\n public get placeholder():string {\n return this._placeholder || this.localeValues.placeholder;\n }\n\n public set placeholder(placeholder:string) {\n this._placeholder = placeholder;\n }\n\n private _localeValues:ISearchLocaleValues;\n\n public localeOverrides:RecursivePartial;\n\n public get localeValues():ISearchLocaleValues {\n return this._localizationService.override<\"search\">(this._localeValues, this.localeOverrides);\n }\n\n public get query():string {\n return this.searchService.query;\n }\n\n public set query(query:string) {\n this.selectedResult = undefined;\n // Initialise a delayed search.\n this.searchService.updateQueryDelayed(query, () =>\n // Set the results open state depending on whether a query has been entered.\n this.dropdownService.setOpenState(this.searchService.query.length > 0 || this.allowEmptyQuery));\n }\n\n @Input()\n public set options(options:T[] | undefined) {\n if (options) {\n this.searchService.options = options;\n }\n }\n\n @Input()\n public set optionsFilter(filter:FilterFn | undefined) {\n if (filter) {\n this.searchService.optionsFilter = filter;\n }\n }\n\n @Input()\n public set optionsLookup(lookupFn:LookupFn | undefined) {\n this.searchService.optionsLookup = lookupFn;\n }\n\n @Input()\n public set optionsField(field:string | undefined) {\n this.searchService.optionsField = field;\n }\n\n private _resultFormatter?:(r:T, q:string) => string;\n\n public get resultFormatter():(result:T, query:string) => string {\n if (this._resultFormatter) {\n return this._resultFormatter;\n } else if (this.searchService.optionsLookup) {\n return r => this.readValue(r);\n } else {\n return (r, q) => this.searchService.highlightMatches(this.readValue(r), q);\n }\n }\n\n @Input()\n public set resultFormatter(formatter:(result:T, query:string) => string) {\n this._resultFormatter = formatter;\n }\n\n @Input()\n public resultTemplate:TemplateRef>;\n\n @Input()\n public retainSelectedResult:boolean;\n\n @Input()\n public set searchDelay(delay:number) {\n this.searchService.searchDelay = delay;\n }\n\n @HostBinding(\"class.loading\")\n public get isSearching():boolean {\n return this.searchService.isSearching;\n }\n\n @Input()\n public maxResults:number;\n\n public get results():T[] {\n return this.searchService.results.slice(0, this.maxResults);\n }\n\n // Stores the currently selected result.\n public selectedResult?:T;\n\n // Emits whenever a new result is selected.\n @Output(\"resultSelected\")\n public onResultSelected:EventEmitter;\n\n @Input()\n public transition:string;\n\n @Input()\n public transitionDuration:number;\n\n private _documentClickListener:() => void;\n\n constructor(private _element:ElementRef, renderer:Renderer2, private _localizationService:SuiLocalizationService) {\n this.dropdownService = new DropdownService();\n this.searchService = new SearchService();\n\n this.onLocaleUpdate();\n this._localizationService.onLanguageUpdate.subscribe(() => this.onLocaleUpdate());\n\n this._searchClasses = true;\n this.hasIcon = true;\n this.allowEmptyQuery = false;\n this.retainSelectedResult = true;\n this.searchDelay = 200;\n this.maxResults = 7;\n\n this.onResultSelected = new EventEmitter();\n\n this.transition = \"scale\";\n this.transitionDuration = 200;\n\n this._documentClickListener = renderer.listen(\"document\", \"click\", (e:MouseEvent) => this.onDocumentClick(e));\n }\n\n public ngAfterViewInit():void {\n this._menu.service = this.dropdownService;\n }\n\n private onLocaleUpdate():void {\n this._localeValues = this._localizationService.get().search;\n }\n\n // Selects a result.\n public select(result:T):void {\n this.onResultSelected.emit(result);\n this.dropdownService.setOpenState(false);\n\n if (this.retainSelectedResult) {\n this.selectedResult = result;\n this.searchService.updateQuery(this.readValue(result));\n } else {\n this.searchService.updateQuery(\"\");\n }\n }\n\n public onClick(e:MouseEvent):void {\n this.open();\n }\n\n @HostListener(\"focusin\")\n private onFocusIn():void {\n if (!this.dropdownService.isAnimating) {\n this.open();\n }\n }\n\n private open():void {\n if (this.searchService.query.length > 0 || this.allowEmptyQuery) {\n // Only open on click when there is a query entered.\n this.dropdownService.setOpenState(true);\n }\n }\n\n @HostListener(\"focusout\", [\"$event\"])\n private onFocusOut(e:IFocusEvent):void {\n if (!this._element.nativeElement.contains(e.relatedTarget)) {\n this.dropdownService.setOpenState(false);\n }\n }\n\n public onDocumentClick(e:MouseEvent):void {\n if (!this._element.nativeElement.contains(e.target)) {\n this.dropdownService.setOpenState(false);\n }\n }\n\n // Reads the specified field from an item.\n public readValue(object:T):string {\n return Util.Object.readValue(object, this.searchService.optionsField);\n }\n\n public ngOnDestroy():void {\n this._documentClickListener();\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../src/modules/search/components/search.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAiB,YAAY,EACrE,YAAY,EAAE,MAAM,EAAa,UAAU,EAAE,WAAW,EAAE,SAAS,EACtE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAoC,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAyC,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;;IAoMvD,mBAAoB,QAAmB,EAAE,QAAkB,EAAU,oBAA2C;QAAhH,iBAqBC;QArBmB,aAAQ,GAAR,QAAQ,CAAW;QAA8B,yBAAoB,GAApB,oBAAoB,CAAuB;QAC5G,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;QAC7C,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,EAAQ,CAAC;QAE/C,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,cAAc,EAAE,EAArB,CAAqB,CAAC,CAAC;QAElF,IAAI,CAAC,cAAc,GAAG,IAAI,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,QAAQ,EAAE,ygCAwBb;oBACG,MAAM,EAAE,CAAC,iMAUZ,CAAC;iBACD;;;;gBAlDoC,UAAU;gBAAe,SAAS;gBAIvB,sBAAsB;;;0BAmDjE,SAAS,SAAC,eAAe;mCAKzB,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,cAAc;6BAG1B,WAAW,SAAC,cAAc;4BAM1B,KAAK;uCAIL,KAAK;oCAML,KAAK;gCAaL,KAAK;4BA6BL,KAAK;kCAOL,KAAK;kCAOL,KAAK;iCAKL,KAAK;oCAiBL,KAAK;mCAKL,KAAK;yCAGL,KAAK;gCAGL,KAAK;gCAKL,WAAW,SAAC,eAAe;+BAK3B,KAAK;qCAWL,MAAM,SAAC,gBAAgB;+BAGvB,KAAK;uCAGL,KAAK;8BAqDL,YAAY,SAAC,SAAS;+BActB,YAAY,SAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;oBAzQxC;;SAqDa,SAAS","sourcesContent":["import {\n Component, ViewChild, HostBinding, Input, AfterViewInit, HostListener,\n EventEmitter, Output, Directive, ElementRef, TemplateRef, Renderer2, OnDestroy\n} from \"@angular/core\";\nimport { Util, ITemplateRefContext, IFocusEvent } from \"../../../misc/util/index\";\nimport { DropdownService, SuiDropdownMenu } from \"../../dropdown/index\";\nimport { ISearchLocaleValues, RecursivePartial, SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SearchService } from \"../services/search.service\";\nimport { LookupFn, FilterFn } from \"../helpers/lookup-fn\";\n\nexport interface IResultContext extends ITemplateRefContext {\n query:string;\n}\n\n@Component({\n selector: \"sui-search\",\n template: `\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n`,\n styles: [`\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n`]\n})\nexport class SuiSearch implements AfterViewInit, OnDestroy {\n public dropdownService:DropdownService;\n public searchService:SearchService;\n\n @ViewChild(SuiDropdownMenu)\n private _menu:SuiDropdownMenu;\n\n // Sets the Semantic UI classes on the host element.\n // Doing it on the host enables use in menus etc.\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.search\")\n private _searchClasses:boolean;\n\n @HostBinding(\"class.active\")\n public get isActive():boolean {\n return this.dropdownService.isOpen;\n }\n\n // Sets whether the search element has a visible search icon.\n @Input()\n public hasIcon:boolean;\n\n // Sets whether the query is reset if options change.\n @Input()\n public set resetQueryOnChange(resetQueryOnChange:boolean) {\n this.searchService.resetQueryOnChange = resetQueryOnChange;\n }\n\n // Sets whether the search element display result with empty query.\n @Input()\n public set allowEmptyQuery(allowEmptyQuery:boolean) {\n this._allowEmptyQuery = allowEmptyQuery;\n this.searchService.allowEmptyQuery = allowEmptyQuery;\n }\n public get allowEmptyQuery():boolean {\n return this._allowEmptyQuery;\n }\n\n private _allowEmptyQuery:boolean;\n private _placeholder:string;\n\n // Gets & sets the placeholder text displayed inside the text input.\n @Input()\n public get placeholder():string {\n return this._placeholder || this.localeValues.placeholder;\n }\n\n public set placeholder(placeholder:string) {\n this._placeholder = placeholder;\n }\n\n private _localeValues:ISearchLocaleValues;\n\n public localeOverrides:RecursivePartial;\n\n public get localeValues():ISearchLocaleValues {\n return this._localizationService.override<\"search\">(this._localeValues, this.localeOverrides);\n }\n\n public get query():string {\n return this.searchService.query;\n }\n\n public set query(query:string) {\n this.selectedResult = undefined;\n // Initialise a delayed search.\n this.searchService.updateQueryDelayed(query, () =>\n // Set the results open state depending on whether a query has been entered.\n this.dropdownService.setOpenState(this.searchService.query.length > 0 || this.allowEmptyQuery));\n }\n\n @Input()\n public set options(options:T[] | undefined) {\n if (options) {\n this.searchService.options = options;\n }\n }\n\n @Input()\n public set optionsFilter(filter:FilterFn | undefined) {\n if (filter) {\n this.searchService.optionsFilter = filter;\n }\n }\n\n @Input()\n public set optionsLookup(lookupFn:LookupFn | undefined) {\n this.searchService.optionsLookup = lookupFn;\n }\n\n @Input()\n public set optionsField(field:string | undefined) {\n this.searchService.optionsField = field;\n }\n\n private _resultFormatter?:(r:T, q:string) => string;\n\n public get resultFormatter():(result:T, query:string) => string {\n if (this._resultFormatter) {\n return this._resultFormatter;\n } else if (this.searchService.optionsLookup) {\n return r => this.readValue(r);\n } else {\n return (r, q) => this.searchService.highlightMatches(this.readValue(r), q);\n }\n }\n\n @Input()\n public set resultFormatter(formatter:(result:T, query:string) => string) {\n this._resultFormatter = formatter;\n }\n\n @Input()\n public resultTemplate:TemplateRef>;\n\n @Input()\n public retainSelectedResult:boolean;\n\n @Input()\n public set searchDelay(delay:number) {\n this.searchService.searchDelay = delay;\n }\n\n @HostBinding(\"class.loading\")\n public get isSearching():boolean {\n return this.searchService.isSearching;\n }\n\n @Input()\n public maxResults:number;\n\n public get results():T[] {\n return this.searchService.results.slice(0, this.maxResults);\n }\n\n // Stores the currently selected result.\n public selectedResult?:T;\n\n // Emits whenever a new result is selected.\n @Output(\"resultSelected\")\n public onResultSelected:EventEmitter;\n\n @Input()\n public transition:string;\n\n @Input()\n public transitionDuration:number;\n\n private _documentClickListener:() => void;\n\n constructor(private _element:ElementRef, renderer:Renderer2, private _localizationService:SuiLocalizationService) {\n this.dropdownService = new DropdownService();\n this.searchService = new SearchService();\n\n this.onLocaleUpdate();\n this._localizationService.onLanguageUpdate.subscribe(() => this.onLocaleUpdate());\n\n this._searchClasses = true;\n this.hasIcon = true;\n this.allowEmptyQuery = false;\n this.resetQueryOnChange = true;\n this.retainSelectedResult = true;\n this.searchDelay = 200;\n this.maxResults = 7;\n\n this.onResultSelected = new EventEmitter();\n\n this.transition = \"scale\";\n this.transitionDuration = 200;\n\n this._documentClickListener = renderer.listen(\"document\", \"click\", (e:MouseEvent) => this.onDocumentClick(e));\n }\n\n public ngAfterViewInit():void {\n this._menu.service = this.dropdownService;\n }\n\n private onLocaleUpdate():void {\n this._localeValues = this._localizationService.get().search;\n }\n\n // Selects a result.\n public select(result:T):void {\n this.onResultSelected.emit(result);\n this.dropdownService.setOpenState(false);\n\n if (this.retainSelectedResult) {\n this.selectedResult = result;\n this.searchService.updateQuery(this.readValue(result));\n } else {\n this.searchService.updateQuery(\"\");\n }\n }\n\n public onClick(e:MouseEvent):void {\n this.open();\n }\n\n @HostListener(\"focusin\")\n private onFocusIn():void {\n if (!this.dropdownService.isAnimating) {\n this.open();\n }\n }\n\n private open():void {\n if (this.searchService.query.length > 0 || this.allowEmptyQuery) {\n // Only open on click when there is a query entered.\n this.dropdownService.setOpenState(true);\n }\n }\n\n @HostListener(\"focusout\", [\"$event\"])\n private onFocusOut(e:IFocusEvent):void {\n if (!this._element.nativeElement.contains(e.relatedTarget)) {\n this.dropdownService.setOpenState(false);\n }\n }\n\n public onDocumentClick(e:MouseEvent):void {\n if (!this._element.nativeElement.contains(e.target)) {\n this.dropdownService.setOpenState(false);\n }\n }\n\n // Reads the specified field from an item.\n public readValue(object:T):string {\n return Util.Object.readValue(object, this.searchService.optionsField);\n }\n\n public ngOnDestroy():void {\n this._documentClickListener();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/search/components/search.metadata.json b/dist/modules/search/components/search.metadata.json index ae8ab5ff6..2880e7866 100644 --- a/dist/modules/search/components/search.metadata.json +++ b/dist/modules/search/components/search.metadata.json @@ -1 +1 @@ -[{"__symbolic":"module","version":4,"metadata":{"IResultContext":{"__symbolic":"interface"},"SuiSearch":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"selector":"sui-search","template":"\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n","styles":["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"]}]}],"members":{"_menu":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":57,"character":5},"arguments":[{"__symbolic":"reference","module":"../../dropdown/index","name":"SuiDropdownMenu","line":57,"character":15}]}]}],"_searchClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":62,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":63,"character":5},"arguments":["class.search"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":66,"character":5},"arguments":["class.active"]}]}],"hasIcon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":72,"character":5}}]}],"allowEmptyQuery":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":76,"character":5}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":89,"character":5}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":118,"character":5}}]}],"optionsFilter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":125,"character":5}}]}],"optionsLookup":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":132,"character":5}}]}],"optionsField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":137,"character":5}}]}],"resultFormatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":154,"character":5}}]}],"resultTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":159,"character":5}}]}],"retainSelectedResult":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":162,"character":5}}]}],"searchDelay":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":165,"character":5}}]}],"isSearching":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":170,"character":5},"arguments":["class.loading"]}]}],"maxResults":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":175,"character":5}}]}],"onResultSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":186,"character":5},"arguments":["resultSelected"]}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":189,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":192,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":197,"character":33},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":197,"character":54},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":197,"character":94}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"onLocaleUpdate":[{"__symbolic":"method"}],"select":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method"}],"onFocusIn":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":244,"character":5},"arguments":["focusin"]}]}],"open":[{"__symbolic":"method"}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":258,"character":5},"arguments":["focusout",["$event"]]}]}],"onDocumentClick":[{"__symbolic":"method"}],"readValue":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file +[{"__symbolic":"module","version":4,"metadata":{"IResultContext":{"__symbolic":"interface"},"SuiSearch":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"selector":"sui-search","template":"\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n","styles":["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"]}]}],"members":{"_menu":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":57,"character":5},"arguments":[{"__symbolic":"reference","module":"../../dropdown/index","name":"SuiDropdownMenu","line":57,"character":15}]}]}],"_searchClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":62,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":63,"character":5},"arguments":["class.search"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":66,"character":5},"arguments":["class.active"]}]}],"hasIcon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":72,"character":5}}]}],"resetQueryOnChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":76,"character":5}}]}],"allowEmptyQuery":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":82,"character":5}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":95,"character":5}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":124,"character":5}}]}],"optionsFilter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":131,"character":5}}]}],"optionsLookup":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":138,"character":5}}]}],"optionsField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":143,"character":5}}]}],"resultFormatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":160,"character":5}}]}],"resultTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":165,"character":5}}]}],"retainSelectedResult":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":168,"character":5}}]}],"searchDelay":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":171,"character":5}}]}],"isSearching":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":176,"character":5},"arguments":["class.loading"]}]}],"maxResults":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":181,"character":5}}]}],"onResultSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":192,"character":5},"arguments":["resultSelected"]}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":195,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":198,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":203,"character":33},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":203,"character":54},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":203,"character":94}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"onLocaleUpdate":[{"__symbolic":"method"}],"select":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method"}],"onFocusIn":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":251,"character":5},"arguments":["focusin"]}]}],"open":[{"__symbolic":"method"}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":265,"character":5},"arguments":["focusout",["$event"]]}]}],"onDocumentClick":[{"__symbolic":"method"}],"readValue":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/search/services/search.service.d.ts b/dist/modules/search/services/search.service.d.ts index b7736e52c..c6a99be28 100644 --- a/dist/modules/search/services/search.service.d.ts +++ b/dist/modules/search/services/search.service.d.ts @@ -12,6 +12,7 @@ export declare class SearchService { private _resultsCache; readonly results: T[]; private _query; + resetQueryOnChange: boolean; allowEmptyQuery: boolean; searchDelay: number; private _searchDelayTimeout; diff --git a/dist/modules/search/services/search.service.js b/dist/modules/search/services/search.service.js index 1300bad3a..08f148159 100644 --- a/dist/modules/search/services/search.service.js +++ b/dist/modules/search/services/search.service.js @@ -196,7 +196,9 @@ var SearchService = /** @class */ (function () { this._results = []; this._resultsCache = {}; this._isSearching = false; - this.updateQuery(""); + if (this.resetQueryOnChange) { + this.updateQuery(""); + } }; return SearchService; }()); diff --git a/dist/modules/search/services/search.service.js.map b/dist/modules/search/services/search.service.js.map index e6804d275..d9ca6e48e 100644 --- a/dist/modules/search/services/search.service.js.map +++ b/dist/modules/search/services/search.service.js.map @@ -1 +1 @@ -{"version":3,"file":"search.service.js","sourceRoot":"","sources":["../../../../src/modules/search/services/search.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKhD,IAAA;IA0EI,uBAAY,eAA+B;QAA/B,gCAAA,EAAA,uBAA+B;QAA3C,iBAwBC;QAvBG,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,UAAC,EAAE,EAAE,CAAC;;YAEvB,IAAM,KAAK,GAAG,KAAI,CAAC,OAAO,CAAC,KAAI,CAAC,MAAM,CAAC,CAAC;YAExC,EAAE,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC,CAAC,CAAC;;;gBAG1B,MAAM,CAAC,EAAE;qBAEJ,MAAM,CAAC,UAAA,CAAC;oBAAI,OAAA,IAAI,CAAC,MAAM,CAAC,SAAS,CAAY,CAAC,EAAE,KAAI,CAAC,aAAa,CAAC;yBAC/D,QAAQ,EAAE;yBACV,KAAK,CAAC,KAAK,CAAC;gBAFJ,CAEI,CAAC,CAAC;aAC1B;;YAGD,MAAM,CAAC,KAAK,CAAC;SAChB,CAAC;;QAGF,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,EAAE,CAAC;KAChB;IAxFD,sBAAW,kCAAO;aAAlB;YACI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;SACxB;aAED,UAAmB,OAAW;YAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,EAAE,CAAC;;YAE9B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;;YAEhC,IAAI,CAAC,KAAK,EAAE,CAAC;SAChB;;;O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aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;KACxB;wBA9ML;IA+MC,CAAA;AA1MD,yBA0MC","sourcesContent":["import { Util } from \"../../../misc/util/index\";\nimport { LookupFn, LookupFnResult, FilterFn } from \"../helpers/lookup-fn\";\n\ninterface ICachedArray { [query:string]:T[]; }\n\nexport class SearchService {\n // Stores the available options.\n private _options:T[];\n // Converts a query string into an array of options. Must be a function returning a promise.\n private _optionsLookup?:LookupFn;\n // Field that options are searched & displayed on.\n private _optionsField?:string;\n // Filters a list of options.\n public optionsFilter:FilterFn;\n\n public get options():T[] {\n return this._options;\n }\n\n public set options(options:T[]) {\n this._options = options || [];\n // We cannot use both local & remote options simultaneously.\n this._optionsLookup = undefined;\n // Reset entire service with new options.\n this.reset();\n }\n\n public get optionsLookup():LookupFn | undefined {\n return this._optionsLookup;\n }\n\n public set optionsLookup(lookupFn:LookupFn | undefined) {\n this._optionsLookup = lookupFn;\n // As before, cannot use local & remote options simultaneously.\n this._options = [];\n this.reset();\n }\n\n public get hasItemLookup():boolean {\n return !!this.optionsLookup && this.optionsLookup.length === 2;\n }\n\n public get optionsField():string | undefined {\n return this._optionsField;\n }\n\n public set optionsField(field:string | undefined) {\n this._optionsField = field;\n // We need to reset otherwise we would now be showing invalid search results.\n this.reset();\n }\n\n // Stores the results of the query.\n private _results:T[];\n // Cache of results, indexed by query.\n private _resultsCache:ICachedArray;\n\n public get results():T[] {\n return this._results;\n }\n\n private _query:string;\n // Allows the empty query to produce results.\n public allowEmptyQuery:boolean;\n // How long to delay the search for when using updateQueryDelayed. Stored in ms.\n public searchDelay:number;\n // Stores the search timeout handle so we can cancel it.\n private _searchDelayTimeout:number;\n // Provides 'loading' functionality.\n private _isSearching:boolean;\n\n public get query():string {\n return this._query;\n }\n\n public get isSearching():boolean {\n return this._isSearching;\n }\n\n constructor(allowEmptyQuery:boolean = false) {\n this._options = [];\n this.optionsFilter = (os, q) => {\n // Convert the query string to a RegExp.\n const regex = this.toRegex(this._query);\n\n if (regex instanceof RegExp) {\n // Only update the results if the query was valid regex.\n // This avoids the results suddenly becoming empty if an invalid regex string is inputted.\n return os\n // Filter on the options with a string match on the field we are testing.\n .filter(o => Util.Object.readValue(o, this._optionsField)\n .toString()\n .match(regex));\n }\n\n // Don't update since it wasn't a valid regex.\n return false;\n };\n\n // Set default values and reset.\n this.allowEmptyQuery = allowEmptyQuery;\n this.searchDelay = 0;\n this.reset();\n }\n\n // Updates the query after the specified search delay.\n public updateQueryDelayed(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n clearTimeout(this._searchDelayTimeout);\n this._searchDelayTimeout = window.setTimeout(\n () => {\n this.updateQuery(query, callback);\n },\n this.searchDelay\n );\n }\n\n // Updates the current search query.\n public updateQuery(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n if (this._query === \"\" && !this.allowEmptyQuery) {\n // Don't update if the new query is empty (and we don't allow empty queries).\n // Don't reset so that when animating closed we don't get a judder.\n return callback();\n }\n\n if (this._resultsCache.hasOwnProperty(this._query)) {\n // If the query is already cached, make use of it.\n this._results = this._resultsCache[this._query];\n\n return callback();\n }\n\n if (this._optionsLookup) {\n this._isSearching = true;\n\n // Call the options lookup without a this context.\n const queryLookup = this._optionsLookup.call(undefined, this._query) as LookupFnResult;\n\n queryLookup\n .then(results => {\n this._isSearching = false;\n\n this.updateResults(results);\n return callback();\n })\n .catch(error => {\n // Unset 'loading' state, and throw the returned error without updating the results.\n this._isSearching = false;\n return callback(error);\n });\n\n return;\n }\n\n const filtered = this.optionsFilter.call(undefined, this._options, this._query);\n if (filtered) {\n this.updateResults(filtered);\n }\n return callback();\n }\n\n // Updates & caches the new set of results.\n private updateResults(results:T[]):void {\n this._resultsCache[this._query] = results;\n this._results = results;\n }\n\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U[]):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U | U[]):LookupFnResult | LookupFnResult {\n if (initial instanceof Array) {\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n\n // Converts a query string to regex without throwing an error.\n private toRegex(query:string):RegExp | string {\n try {\n return new RegExp(query, \"i\");\n } catch (e) {\n return query;\n }\n }\n\n // Generates HTML for highlighted match text.\n public highlightMatches(text:string, query:string):string {\n const regex = this.toRegex(query);\n if (regex instanceof RegExp) {\n return text.replace(regex, match => `${match}`);\n }\n return text;\n }\n\n // Resets the search back to a pristine state.\n private reset():void {\n this._results = [];\n this._resultsCache = {};\n this._isSearching = false;\n this.updateQuery(\"\");\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"search.service.js","sourceRoot":"","sources":["../../../../src/modules/search/services/search.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKhD,IAAA;IA4EI,uBAAY,eAA+B;QAA/B,gCAAA,EAAA,uBAA+B;QAA3C,iBAwBC;QAvBG,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,UAAC,EAAE,EAAE,CAAC;;YAEvB,IAAM,KAAK,GAAG,KAAI,CAAC,OAAO,CAAC,KAAI,CAAC,MAAM,CAAC,CAAC;YAExC,EAAE,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC,CAAC,CAAC;;;gBAG1B,MAAM,CAAC,EAAE;qBAEJ,MAAM,CAAC,UAAA,CAAC;oBAAI,OAAA,IAAI,CAAC,MAAM,CAAC,SAAS,CAAY,CAAC,EAAE,KAAI,CAAC,aAAa,CAAC;yBAC/D,QAAQ,EAAE;yBACV,KAAK,CAAC,KAAK,CAAC;gBAFJ,CAEI,CAAC,CAAC;aAC1B;;YAGD,MAAM,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W,EAAE,KAAY;QAC7C,IAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClC,EAAE,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC,CAAC,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,QAAM,KAAK,SAAM,EAAjB,CAAiB,CAAC,CAAC;SAC1D;QACD,MAAM,CAAC,IAAI,CAAC;KACf;IAED,8CAA8C;;IACtC,6BAAK;;IAAb;QACI,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;YAC1B,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;SACxB;KACJ;wBAlNL;IAmNC,CAAA;AA9MD,yBA8MC","sourcesContent":["import { Util } from \"../../../misc/util/index\";\nimport { LookupFn, LookupFnResult, FilterFn } from \"../helpers/lookup-fn\";\n\ninterface ICachedArray { [query:string]:T[]; }\n\nexport class SearchService {\n // Stores the available options.\n private _options:T[];\n // Converts a query string into an array of options. Must be a function returning a promise.\n private _optionsLookup?:LookupFn;\n // Field that options are searched & displayed on.\n private _optionsField?:string;\n // Filters a list of options.\n public optionsFilter:FilterFn;\n\n public get options():T[] {\n return this._options;\n }\n\n public set options(options:T[]) {\n this._options = options || [];\n // We cannot use both local & remote options simultaneously.\n this._optionsLookup = undefined;\n // Reset entire service with new options.\n this.reset();\n }\n\n public get optionsLookup():LookupFn | undefined {\n return this._optionsLookup;\n }\n\n public set optionsLookup(lookupFn:LookupFn | undefined) {\n this._optionsLookup = lookupFn;\n // As before, cannot use local & remote options simultaneously.\n this._options = [];\n this.reset();\n }\n\n public get hasItemLookup():boolean {\n return !!this.optionsLookup && this.optionsLookup.length === 2;\n }\n\n public get optionsField():string | undefined {\n return this._optionsField;\n }\n\n public set optionsField(field:string | undefined) {\n this._optionsField = field;\n // We need to reset otherwise we would now be showing invalid search results.\n this.reset();\n }\n\n // Stores the results of the query.\n private _results:T[];\n // Cache of results, indexed by query.\n private _resultsCache:ICachedArray;\n\n public get results():T[] {\n return this._results;\n }\n\n private _query:string;\n // Allows the query to be empty when the options change.\n public resetQueryOnChange:boolean;\n // Allows the empty query to produce results.\n public allowEmptyQuery:boolean;\n // How long to delay the search for when using updateQueryDelayed. Stored in ms.\n public searchDelay:number;\n // Stores the search timeout handle so we can cancel it.\n private _searchDelayTimeout:number;\n // Provides 'loading' functionality.\n private _isSearching:boolean;\n\n public get query():string {\n return this._query;\n }\n\n public get isSearching():boolean {\n return this._isSearching;\n }\n\n constructor(allowEmptyQuery:boolean = false) {\n this._options = [];\n this.optionsFilter = (os, q) => {\n // Convert the query string to a RegExp.\n const regex = this.toRegex(this._query);\n\n if (regex instanceof RegExp) {\n // Only update the results if the query was valid regex.\n // This avoids the results suddenly becoming empty if an invalid regex string is inputted.\n return os\n // Filter on the options with a string match on the field we are testing.\n .filter(o => Util.Object.readValue(o, this._optionsField)\n .toString()\n .match(regex));\n }\n\n // Don't update since it wasn't a valid regex.\n return false;\n };\n\n // Set default values and reset.\n this.allowEmptyQuery = allowEmptyQuery;\n this.searchDelay = 0;\n this.reset();\n }\n\n // Updates the query after the specified search delay.\n public updateQueryDelayed(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n clearTimeout(this._searchDelayTimeout);\n this._searchDelayTimeout = window.setTimeout(\n () => {\n this.updateQuery(query, callback);\n },\n this.searchDelay\n );\n }\n\n // Updates the current search query.\n public updateQuery(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n if (this._query === \"\" && !this.allowEmptyQuery) {\n // Don't update if the new query is empty (and we don't allow empty queries).\n // Don't reset so that when animating closed we don't get a judder.\n return callback();\n }\n\n if (this._resultsCache.hasOwnProperty(this._query)) {\n // If the query is already cached, make use of it.\n this._results = this._resultsCache[this._query];\n\n return callback();\n }\n\n if (this._optionsLookup) {\n this._isSearching = true;\n\n // Call the options lookup without a this context.\n const queryLookup = this._optionsLookup.call(undefined, this._query) as LookupFnResult;\n\n queryLookup\n .then(results => {\n this._isSearching = false;\n\n this.updateResults(results);\n return callback();\n })\n .catch(error => {\n // Unset 'loading' state, and throw the returned error without updating the results.\n this._isSearching = false;\n return callback(error);\n });\n\n return;\n }\n\n const filtered = this.optionsFilter.call(undefined, this._options, this._query);\n if (filtered) {\n this.updateResults(filtered);\n }\n return callback();\n }\n\n // Updates & caches the new set of results.\n private updateResults(results:T[]):void {\n this._resultsCache[this._query] = results;\n this._results = results;\n }\n\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U[]):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U | U[]):LookupFnResult | LookupFnResult {\n if (initial instanceof Array) {\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n\n // Converts a query string to regex without throwing an error.\n private toRegex(query:string):RegExp | string {\n try {\n return new RegExp(query, \"i\");\n } catch (e) {\n return query;\n }\n }\n\n // Generates HTML for highlighted match text.\n public highlightMatches(text:string, query:string):string {\n const regex = this.toRegex(query);\n if (regex instanceof RegExp) {\n return text.replace(regex, match => `${match}`);\n }\n return text;\n }\n\n // Resets the search back to a pristine state.\n private reset():void {\n this._results = [];\n this._resultsCache = {};\n this._isSearching = false;\n if (this.resetQueryOnChange) {\n this.updateQuery(\"\");\n }\n }\n}\n"]} \ No newline at end of file diff --git a/src/modules/search/components/search.ts b/src/modules/search/components/search.ts index 8e6a3f091..0f22cc257 100644 --- a/src/modules/search/components/search.ts +++ b/src/modules/search/components/search.ts @@ -73,6 +73,12 @@ export class SuiSearch implements AfterViewInit, OnDestroy { @Input() public hasIcon:boolean; + // Sets whether the query is reset if options change. + @Input() + public set resetQueryOnChange(resetQueryOnChange:boolean) { + this.searchService.resetQueryOnChange = resetQueryOnChange; + } + // Sets whether the search element display result with empty query. @Input() public set allowEmptyQuery(allowEmptyQuery:boolean) { @@ -205,6 +211,7 @@ export class SuiSearch implements AfterViewInit, OnDestroy { this._searchClasses = true; this.hasIcon = true; this.allowEmptyQuery = false; + this.resetQueryOnChange = true; this.retainSelectedResult = true; this.searchDelay = 200; this.maxResults = 7; diff --git a/src/modules/search/services/search.service.ts b/src/modules/search/services/search.service.ts index fb6122fdd..cb9ac4e59 100644 --- a/src/modules/search/services/search.service.ts +++ b/src/modules/search/services/search.service.ts @@ -60,6 +60,8 @@ export class SearchService { } private _query:string; + // Allows the query to be empty when the options change. + public resetQueryOnChange:boolean; // Allows the empty query to produce results. public allowEmptyQuery:boolean; // How long to delay the search for when using updateQueryDelayed. Stored in ms. @@ -203,6 +205,8 @@ export class SearchService { this._results = []; this._resultsCache = {}; this._isSearching = false; - this.updateQuery(""); + if (this.resetQueryOnChange) { + this.updateQuery(""); + } } } From 175e447709025dfcdd339c7793b8a0257f6b4e2e Mon Sep 17 00:00:00 2001 From: Benjamin Coenen Date: Tue, 20 Mar 2018 16:03:58 +0100 Subject: [PATCH 6/9] dist Signed-off-by: Benjamin Coenen --- bundles/ng2-semantic-ui.umd.js | 7 ++++++- bundles/ng2-semantic-ui.umd.min.js | 14 +++++++------- dist/modules/search/services/search.service.js | 7 ++++++- dist/modules/search/services/search.service.js.map | 2 +- src/modules/search/services/search.service.ts | 6 +++++- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/bundles/ng2-semantic-ui.umd.js b/bundles/ng2-semantic-ui.umd.js index 7c3dfb631..cb649369a 100644 --- a/bundles/ng2-semantic-ui.umd.js +++ b/bundles/ng2-semantic-ui.umd.js @@ -12020,6 +12020,8 @@ var SearchService = /** @class */ (function () { }; // Set default values and reset. this.allowEmptyQuery = allowEmptyQuery; + this._query = ""; + this.resetQueryOnChange = true; this.searchDelay = 0; this.reset(); } @@ -12194,9 +12196,12 @@ var SearchService = /** @class */ (function () { this._results = []; this._resultsCache = {}; this._isSearching = false; - if (this.resetQueryOnChange) { + if (this.resetQueryOnChange || !this.query) { this.updateQuery(""); } + else { + this.updateQuery(this.query); + } }; return SearchService; }()); diff --git a/bundles/ng2-semantic-ui.umd.min.js b/bundles/ng2-semantic-ui.umd.min.js index 0011b0499..6d109de83 100644 --- a/bundles/ng2-semantic-ui.umd.min.js +++ b/bundles/ng2-semantic-ui.umd.min.js @@ -1,7 +1,7 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/forms"],t):t(e["ng2-semantic-ui"]=e["ng2-semantic-ui"]||{},e._angular_core,e._angular_common,e._angular_forms)}(this,function(e,t,n,i){"use strict";function r(e){return JSON.parse(JSON.stringify(e))}function o(e,t){return(dt||ft)(!0,e,t)}function s(e){return e.toLowerCase().replace("-","")}function a(e){return{provide:i.NG_VALIDATORS,useExisting:t.forwardRef(function(){return e}),multi:!0}}function c(e){return{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef(function(){return e}),multi:!0}}function u(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function p(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},Ft))}}function l(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function h(e,t){if(1!==e.nodeType)return[];var n=getComputedStyle(e,null);return t?n[t]:n}function d(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function f(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=h(e),n=t.overflow,i=t.overflowX;return/(auto|scroll|overlay)/.test(n+t.overflowY+i)?e:f(d(e))}function m(e){if(!e)return document.documentElement;for(var t=zt(10)?document.body:null,n=e.offsetParent;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TD","TABLE"].indexOf(n.nodeName)&&"static"===h(n,"position")?m(n):n:e?e.ownerDocument.documentElement:document.documentElement}function g(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||m(e.firstElementChild)===e)}function y(e){return null!==e.parentNode?y(e.parentNode):e}function v(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?e:t,r=n?t:e,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var s=o.commonAncestorContainer;if(e!==s&&t!==s||i.contains(r))return g(s)?s:m(s);var a=y(e);return a.host?v(a.host,t):v(e,y(t).host)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",i=e.nodeName;if("BODY"===i||"HTML"===i){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[n]}return e[n]}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=b(t,"top"),r=b(t,"left"),o=n?-1:1;return e.top+=i*o,e.bottom+=i*o,e.left+=r*o,e.right+=r*o,e}function _(e,t){var n="x"===t?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+i+"Width"],10)}function D(e,t,n,i){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],zt(10)?n["offset"+e]+i["margin"+("Height"===e?"Top":"Left")]+i["margin"+("Height"===e?"Bottom":"Right")]:0)}function O(){var e=document.body,t=document.documentElement,n=zt(10)&&getComputedStyle(t);return{height:D("Height",e,t,n),width:D("Width",e,t,n)}}function C(e){return Qt({},e,{right:e.left+e.width,bottom:e.top+e.height})}function S(e){var t={};try{if(zt(10)){t=e.getBoundingClientRect();var n=b(e,"top"),i=b(e,"left");t.top+=n,t.left+=i,t.bottom+=n,t.right+=i}else t=e.getBoundingClientRect()}catch(e){}var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?O():{},s=o.width||e.clientWidth||r.right-r.left,a=o.height||e.clientHeight||r.bottom-r.top,c=e.offsetWidth-s,u=e.offsetHeight-a;if(c||u){var p=h(e);c-=_(p,"x"),u-=_(p,"y"),r.width-=c,r.height-=u}return C(r)}function M(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=zt(10),r="HTML"===t.nodeName,o=S(e),s=S(t),a=f(e),c=h(t),u=parseFloat(c.borderTopWidth,10),p=parseFloat(c.borderLeftWidth,10);n&&"HTML"===t.nodeName&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var l=C({top:o.top-s.top-u,left:o.left-s.left-p,width:o.width,height:o.height});if(l.marginTop=0,l.marginLeft=0,!i&&r){var d=parseFloat(c.marginTop,10),m=parseFloat(c.marginLeft,10);l.top-=u-d,l.bottom-=u-d,l.left-=p-m,l.right-=p-m,l.marginTop=d,l.marginLeft=m}return(i&&!n?t.contains(a):t===a&&"BODY"!==a.nodeName)&&(l=w(l,t)),l}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,i=M(e,n),r=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),s=t?0:b(n),a=t?0:b(n,"left");return C({top:s-i.top+i.marginTop,left:a-i.left+i.marginLeft,width:r,height:o})}function k(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===h(e,"position")||k(d(e)))}function P(e){if(!e||!e.parentElement||zt())return document.documentElement;for(var t=e.parentElement;t&&"none"===h(t,"transform");)t=t.parentElement;return t||document.documentElement}function x(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},s=r?P(e):v(e,t);if("viewport"===i)o=T(s,r);else{var a=void 0;"scrollParent"===i?(a=f(d(t)),"BODY"===a.nodeName&&(a=e.ownerDocument.documentElement)):a="window"===i?e.ownerDocument.documentElement:i;var c=M(a,s,r);if("HTML"!==a.nodeName||k(s))o=c;else{var u=O(),p=u.height,l=u.width;o.top+=c.top-c.marginTop,o.bottom=p+c.top,o.left+=c.left-c.marginLeft,o.right=l+c.left}}return o.left+=n,o.top+=n,o.right-=n,o.bottom-=n,o}function I(e){return e.width*e.height}function E(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var s=x(n,i,o,r),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},c=Object.keys(a).map(function(e){return Qt({key:e},a[e],{area:I(a[e])})}).sort(function(e,t){return t.area-e.area}),u=c.filter(function(e){var t=e.width,i=e.height;return t>=n.clientWidth&&i>=n.clientHeight}),p=u.length>0?u[0].key:c[0].key,l=e.split("-")[1];return p+(l?"-"+l:"")}function L(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return M(n,i?P(t):v(t,n),i)}function j(e){var t=getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+i,height:e.offsetHeight+n}}function V(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function H(e,t,n){n=n.split("-")[0];var i=j(e),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),s=o?"top":"left",a=o?"left":"top",c=o?"height":"width",u=o?"width":"height";return r[s]=t[s]+t[c]/2-i[c]/2,r[a]=n===a?t[a]-i[u]:t[V(a)],r}function R(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function A(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var i=R(e,function(e){return e[t]===n});return e.indexOf(i)}function F(e,t,n){return(void 0===n?e:e.slice(0,A(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&l(n)&&(t.offsets.popper=C(t.offsets.popper),t.offsets.reference=C(t.offsets.reference),t=n(t,e))}),t}function Y(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=E(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=H(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=F(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function B(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function N(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;is[f]&&(e.offsets.popper[l]+=a[l]+m-s[f]),e.offsets.popper=C(e.offsets.popper);var g=a[l]+a[u]/2-m/2,y=h(e.instance.popper),v=parseFloat(y["margin"+p],10),b=parseFloat(y["border"+p+"Width"],10),w=g-e.offsets.popper[l]-v-b;return w=Math.max(Math.min(s[u]-m,w),0),e.arrowElement=i,e.offsets.arrow=(n={},Kt(n,l,Math.round(w)),Kt(n,d,""),n),e}function re(e){return"end"===e?"start":"start"===e?"end":e}function oe(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Gt.indexOf(e),i=Gt.slice(n+1).concat(Gt.slice(0,n));return t?i.reverse():i}function se(e,t){if(B(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=x(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),i=e.placement.split("-")[0],r=V(i),o=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case Jt.FLIP:s=[i,r];break;case Jt.CLOCKWISE:s=oe(i);break;case Jt.COUNTERCLOCKWISE:s=oe(i,!0);break;default:s=t.behavior}return s.forEach(function(a,c){if(i!==a||s.length===c+1)return e;i=e.placement.split("-")[0],r=V(i);var u=e.offsets.popper,p=e.offsets.reference,l=Math.floor,h="left"===i&&l(u.right)>l(p.left)||"right"===i&&l(u.left)l(p.top)||"bottom"===i&&l(u.top)l(n.right),m=l(u.top)l(n.bottom),y="left"===i&&d||"right"===i&&f||"top"===i&&m||"bottom"===i&&g,v=-1!==["top","bottom"].indexOf(i),b=!!t.flipVariations&&(v&&"start"===o&&d||v&&"end"===o&&f||!v&&"start"===o&&m||!v&&"end"===o&&g);(h||y||b)&&(e.flipped=!0,(h||y)&&(i=s[c+1]),b&&(o=re(o)),e.placement=i+(o?"-"+o:""),e.offsets.popper=Qt({},e.offsets.popper,H(e.instance.popper,e.offsets.reference,e.placement)),e=F(e.instance.modifiers,e,"flip"))}),e}function ae(e){var t=e.offsets,n=t.popper,i=t.reference,r=e.placement.split("-")[0],o=Math.floor,s=-1!==["top","bottom"].indexOf(r),a=s?"right":"bottom",c=s?"left":"top",u=s?"width":"height";return n[a]o(i[a])&&(e.offsets.popper[c]=o(i[a])),e}function ce(e,t,n,i){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+r[1],s=r[2];if(!o)return e;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=i}return C(a)[t]/100*o}if("vh"===s||"vw"===s){return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}function ue(e,t,n,i){var r=[0,0],o=-1!==["right","left"].indexOf(i),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(R(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,u=-1!==a?[s.slice(0,a).concat([s[a].split(c)[0]]),[s[a].split(c)[1]].concat(s.slice(a+1))]:[s];return u=u.map(function(e,i){var r=(1===i?!o:o)?"height":"width",s=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return ce(e,r,t,n)})}),u.forEach(function(e,t){e.forEach(function(n,i){G(n)&&(r[t]+=n*("-"===e[i-1]?-1:1))})}),r}function pe(e,t){var n=t.offset,i=e.placement,r=e.offsets,o=r.popper,s=r.reference,a=i.split("-")[0],c=void 0;return c=G(+n)?[+n,0]:ue(n,o,s,a),"left"===a?(o.top+=c[0],o.left-=c[1]):"right"===a?(o.top+=c[0],o.left+=c[1]):"top"===a?(o.left+=c[0],o.top-=c[1]):"bottom"===a&&(o.left+=c[0],o.top+=c[1]),e.popper=o,e}function le(e,t){var n=t.boundariesElement||m(e.instance.popper);e.instance.reference===n&&(n=m(n));var i=x(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);t.boundaries=i;var r=t.priority,o=e.offsets.popper,s={primary:function(e){var n=o[e];return o[e]i[e]&&!t.escapeWithReference&&(r=Math.min(o[n],i[e]-("right"===e?o.width:o.height))),Kt({},n,r)}};return r.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";o=Qt({},o,s[t](e))}),e.offsets.popper=o,e}function he(e){var t=e.placement,n=t.split("-")[0],i=t.split("-")[1];if(i){var r=e.offsets,o=r.reference,s=r.popper,a=-1!==["bottom","top"].indexOf(n),c=a?"left":"top",u=a?"width":"height",p={start:Kt({},c,o[c]),end:Kt({},c,o[c]+o[u]-s[u])};e.offsets.popper=Qt({},s,p[i])}return e}function de(e){if(!ne(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=R(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right0?"in "+i:i+" ago":i}function Pe(e){return e.replace(Fn,function(e){return e.slice(1)})}function xe(e,t,n,i){return Bn[e]}function Ie(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}function Ee(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}function Le(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}function je(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}function Ve(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}function He(e){return parseInt(e[1],10)}function Re(e,t){var n=ye(e,t),i=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime(),o=i-r;return Math.floor(o/ti)+1}function Ae(e,t){var n=ye(e,t),i=n.getUTCDay(),r=(i<1?7:0)+i-1;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function Fe(e,t){var n=ye(e,t),i=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(i+1,0,4),r.setUTCHours(0,0,0,0);var o=Ae(r,t),s=new Date(0);s.setUTCFullYear(i,0,4),s.setUTCHours(0,0,0,0);var a=Ae(s,t);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Ye(e,t){var n=Fe(e,t),i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),Ae(i,t)}function Be(e,t){var n=ye(e,t),i=Ae(n,t).getTime()-Ye(n,t).getTime();return Math.round(i/ni)+1}function Ne(e,t){t=t||"";var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;return n+Ue(r,2)+t+Ue(o,2)}function Ue(e,t){for(var n=Math.abs(e).toString();n.length=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=ye(e,n),u=Number(t),p=c.getUTCDay(),l=u%7,h=(l+7)%7,d=(h=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=o.locale||ei,c=a.parsers||{},u=a.units||{};if(!a.match)throw new RangeError("locale must contain match property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var p=String(t).replace(hi,function(e){return"["===e[0]?e:"\\"===e[0]?nt(e):a.formatLong(e)});if(""===p)return""===r?ye(n,o):new Date(NaN);var l=Se(o);l.locale=a;var h,d=p.match(a.parsingTokensRegExp||di),f=d.length,m=[{priority:pi,set:tt,index:0}];for(h=0;h\n \n \n\n',styles:["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"]}]}],n.ctorParameters=function(){return[]},n.propDecorators={isDismissable:[{type:t.Input}],onDismiss:[{type:t.Output,args:["dismiss"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],class:[{type:t.Input,args:["class"]}]},n}(),Dt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[_t],exports:[_t]}]}],e.ctorParameters=function(){return[]},e}(),Ot=function(){function e(){this._paginationClasses=!0,this.pageChange=new t.EventEmitter,this.pageSize=10,this._page=1,this._pages=[],this.pageCount=1,this.hasNavigationLinks=!0,this.hasBoundaryLinks=!1,this.canRotate=!1,this.hasEllipses=!0}return Object.defineProperty(e.prototype,"maxSize",{get:function(){return this._maxSize},set:function(e){this._maxSize=void 0!=e?Math.max(e,1):void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collectionSize",{get:function(){return this._collectionSize},set:function(e){this._collectionSize=Math.max(e,0),this.pageCount=Math.max(1,Math.ceil(this._collectionSize/this.pageSize))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNavigationLinks",{get:function(){var e=this._maxSize||this.pageCount;return this._hasNavigationLinks||e1},e.prototype.hasNext=function(){return this.page\n \n\n\n \n\n\n \n 1\n \n ...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n',styles:["\n:host .item {\n transition: none;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_paginationClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.pagination"]},{type:t.HostBinding,args:["class.menu"]}],pageChange:[{type:t.Output}],maxSize:[{type:t.Input}],pageSize:[{type:t.Input}],collectionSize:[{type:t.Input}],hasNavigationLinks:[{type:t.Input}],hasBoundaryLinks:[{type:t.Input}],canRotate:[{type:t.Input}],hasEllipses:[{type:t.Input}],page:[{type:t.Input}]},e}(),Ct=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],exports:[Ot],declarations:[Ot],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),St=function(){function e(e){this._changeDetector=e,this.transitionController=new vt(!1),this._isOpen=!1,this.isOpenChange=new t.EventEmitter(!1)}return Object.defineProperty(e.prototype,"service",{set:function(e){this._service=e,this._changeDetector.detectChanges()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},set:function(e){var t=!!e;t!==this.isOpen&&(this._isOpen=t,t&&this._service&&this._service.closeOtherPanels(this),this.isOpenChange.emit(this.isOpen),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.transition,this.transitionDuration)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{get:function(){return this._service?this._service.transition:"fade"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{get:function(){return this._service?this._service.transitionDuration:0},enumerable:!0,configurable:!0}),e.prototype.toggle=function(){this.isDisabled||(this.isOpen=!this.isOpen)},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion-panel",exportAs:"suiAccordionPanel",template:'\n\x3c!-- Title --\x3e\n
\n \n
\n\x3c!-- Content --\x3e\n
\n
\n \n
\n
\n',styles:["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},e.propDecorators={isDisabled:[{type:t.Input}],isOpen:[{type:t.Input}],isOpenChange:[{type:t.Output}]},e}(),Mt=function(){function e(){this.closeOthers=!0,this.transition="fade",this.transitionDuration=350,this.panels=[]}return e.prototype.addPanel=function(e){e.service=this,this.panels.push(e)},e.prototype.closeOtherPanels=function(e){this.closeOthers&&this.panels.forEach(function(t){t!==e&&(t.isOpen=!1)})},e}(),Tt=function(){function e(){this._service=new Mt,this.accordionClasses=!0}return Object.defineProperty(e.prototype,"closeOthers",{get:function(){return this._service.closeOthers},set:function(e){this._service.closeOthers=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{set:function(e){this._service.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{set:function(e){this._service.transitionDuration=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.updatePanels(),this._panels.changes.subscribe(function(){return e.updatePanels()})},e.prototype.updatePanels=function(){var e=this;this._panels.forEach(function(t){return e._service.addPanel(t)})},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion",template:"\n\n",styles:["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={accordionClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.accordion"]}],closeOthers:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],_panels:[{type:t.ContentChildren,args:[St]}]},e}(),kt=function(){function e(e,t){this._element=e,this._renderer=t,this._pristine=!0,this.collapseDuration=350,this._isExpanded=!1,this._isCollapsing=!1}return Object.defineProperty(e.prototype,"_isCollapsed",{get:function(){return!this._isExpanded&&!this._isCollapsing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suiCollapse",{get:function(){return this._isExpanded},set:function(e){e?this.hide():this.show()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_animationDuration",{get:function(){return this._pristine?0:this.collapseDuration},enumerable:!0,configurable:!0}),e.prototype.hide=function(){var e=this;this._isCollapsing=!0,this._isExpanded=!1,this._renderer.setStyle(this._element.nativeElement,"overflow","hidden"),this.animate(this._element.nativeElement.scrollHeight,0,!1,function(){e._isCollapsing=!1})},e.prototype.show=function(){var e=this;this._isCollapsing=!0,this.animate(this._element.nativeElement.offsetHeight,this._element.nativeElement.scrollHeight,!0,function(){e._renderer.removeStyle(e._element.nativeElement,"overflow"),e._isCollapsing=!1,e._isExpanded=!0})},e.prototype.animate=function(e,t,n,i){void 0===n&&(n=!1),void 0===i&&(i=function(){});var r=[{offset:0,height:e+"px"},{offset:1,height:t+"px"}];n&&r.push({offset:1,height:"auto"}),this._element.nativeElement.animate(r,{delay:0,duration:this._animationDuration,iterations:1,easing:"ease",fill:"both"}),this._pristine&&(this._pristine=!1),setTimeout(function(){return i()},this.collapseDuration)},e.decorators=[{type:t.Directive,args:[{selector:"[suiCollapse]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e.propDecorators={_isExpanded:[{type:t.HostBinding,args:["class.expanded"]}],_isCollapsed:[{type:t.HostBinding,args:["class.collapsed"]}],_isCollapsing:[{type:t.HostBinding,args:["class.collapsing"]}],suiCollapse:[{type:t.Input}],collapseDuration:[{type:t.Input}]},e}(),Pt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[kt],exports:[kt]}]}],e.ctorParameters=function(){return[]},e}(),xt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Pt,wt],declarations:[Tt,St],exports:[Tt,St],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),It=function(){function e(e){this._host=e,this.onValidatorChange=function(){}}return e.prototype.validate=function(e){return this._host.validate(e)},e.prototype.registerOnValidatorChange=function(e){this.onValidatorChange=e},e}(),Et=function(){function e(e){this._host=e,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){this._host.writeValue(e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e}();!function(e){e[e.Left=37]="Left",e[e.Up=38]="Up",e[e.Right=39]="Right",e[e.Down=40]="Down",e[e.Escape=27]="Escape",e[e.Enter=13]="Enter",e[e.Space=32]="Space",e[e.Backspace=8]="Backspace"}(e.KeyCode||(e.KeyCode={}));var Lt=function(){function e(){}return e}(),jt={Array:{range:function(e,t){return void 0===t&&(t=0),Array(e).fill(0).map(function(e,n){return n+t})},group:function(e,t){for(var n=e.slice(0),i=[];n.length>0;)i.push(n.splice(0,t));return i},groupBy:function(e,t){return e.reduce(function(e,n){var i=n[t].toString();return e[i]=e[i]||[],e[i].push(n),e},Object())},flatten:function(e){return e.reduce(function(e,t){return e.concat(t)},[])}},String:{padLeft:function(e,t,n){for(var i=e;i.length=0){Ft=1;break}var Bt=Rt&&window.Promise,Nt=Bt?u:p,Ut={},zt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";if(e=e.toString(),Ut.hasOwnProperty(e))return Ut[e];switch(e){case"11":Ut[e]=-1!==navigator.userAgent.indexOf("Trident");break;case"10":Ut[e]=-1!==navigator.appVersion.indexOf("MSIE 10");break;case"all":Ut[e]=-1!==navigator.userAgent.indexOf("Trident")||-1!==navigator.userAgent.indexOf("MSIE")}return Ut.all=Ut.all||Object.keys(Ut).some(function(e){return Ut[e]}),Ut[e]},Wt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},qt=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Wt(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=Nt(this.update.bind(this)),this.options=Qt({},e.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(Qt({},e.Defaults.modifiers,r.modifiers)).forEach(function(t){i.options.modifiers[t]=Qt({},e.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return Qt({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&l(e.onLoad)&&e.onLoad(i.reference,i.popper,i.options,e,i.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return qt(e,[{key:"update",value:function(){return Y.call(this)}},{key:"destroy",value:function(){return U.call(this)}},{key:"enableEventListeners",value:function(){return K.call(this)}},{key:"disableEventListeners",value:function(){return $.call(this)}}]),e}();en.Utils=("undefined"!=typeof window?window:global).PopperUtils,en.placements=$t,en.Defaults=Xt;var tn={Auto:"auto",TopLeft:"top left",Top:"top",TopRight:"top right",LeftTop:"left top",Left:"left",LeftBottom:"left bottom",BottomLeft:"bottom left",Bottom:"bottom",BottomRight:"bottom right",RightTop:"right top",Right:"right",RightBottom:"right bottom"},nn=function(){function e(e,t,n,i){var r=this;this.anchor=e,this.subject=t,this._placement=n;var o={computeStyle:{gpuAcceleration:!1},preventOverflow:{escapeWithReference:!0,boundariesElement:document.body},arrow:{element:i}};i||delete o.arrow,this._popper=new en(e.nativeElement,t.nativeElement,{placement:me(n),modifiers:o,onCreate:function(e){return r._popperState=e},onUpdate:function(e){return r._popperState=e}})}return Object.defineProperty(e.prototype,"placement",{get:function(){return this._placement},set:function(e){this._placement=e,this._popper.options.placement=me(e),this.update()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"actualPlacement",{get:function(){return this._popperState?ge(this._popperState.placement):tn.Auto},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._popperState},enumerable:!0,configurable:!0}),e.prototype.update=function(){this._popper.update()},e.prototype.destroy=function(){this._popper.destroy()},e}(),rn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],providers:[Ht]}]}],e.ctorParameters=function(){return[]},e}(),on=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),sn=function(){function e(){this.isChecked=!1,this.onCheckChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._checkboxClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.toggle(),this.focusCheckbox())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.toggle=function(){this.isChecked=!this.isChecked,this.onCheckChange.emit(this.isChecked)},e.prototype.writeValue=function(e){this.isChecked=e},e.prototype.focusCheckbox=function(){this._checkboxElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-checkbox",exportAs:"suiCheckbox",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_checkboxClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCheckChange:[{type:t.Output,args:["checkChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_checkboxElement:[{type:t.ViewChild,args:["checkbox"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),an=function(e){function n(t){return e.call(this,t)||this}return on(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-checkbox",host:{"(checkChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:sn}]},n}(Et),cn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),un=function(){function e(){this._radioClasses=!0,this.isChecked=!1,this.onCurrentValueChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._radioClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.currentValue=this.value,this.onCurrentValueChange.emit(this.currentValue),this.update(),this.focusRadio())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.update=function(){this.isChecked=this.currentValue===this.value},e.prototype.writeValue=function(e){this.currentValue=e,this.update()},e.prototype.focusRadio=function(){this._radioElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-radio-button",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_radioClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.radio"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],value:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCurrentValueChange:[{type:t.Output,args:["currentValueChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_radioElement:[{type:t.ViewChild,args:["radio"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),pn=function(e){function n(t){return e.call(this,t)||this}return cn(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-radio-button",host:{"(currentValueChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:un}]},n}(Et),ln=function(){function e(e){this.element=e,this.isNested=!1,this._radioSubs=[]}return e.prototype.ngAfterContentInit=function(){var e=this;this.updateNesting(),this._subManagers.changes.subscribe(function(){return e.updateNesting()}),this.updateRadios(),this._renderedRadios.changes.subscribe(function(){return e.updateRadios()})},e.prototype.updateNesting=function(){var e=this;this._subManagers.filter(function(t){return t!==e}).forEach(function(e){return e.isNested=!0})},e.prototype.updateRadios=function(){var e=this;this._radioSubs.forEach(function(e){return e.unsubscribe()}),this._radioSubs=[];var t=jt.Array.groupBy(this._renderedRadios.toArray(),"name");Object.keys(t).map(function(e){return t[e]}).forEach(function(t){return t.forEach(function(n){return e._radioSubs.push(n.onCurrentValueChange.subscribe(function(n){e.isNested||t.forEach(function(e){return e.writeValue(n)})}))})})},e.decorators=[{type:t.Directive,args:[{selector:"form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={_subManagers:[{type:t.ContentChildren,args:[e,{descendants:!0}]}],_renderedRadios:[{type:t.ContentChildren,args:[un,{descendants:!0}]}]},e}(),hn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule],declarations:[sn,an,un,pn,ln],exports:[sn,an,un,pn,ln]}]}],e.ctorParameters=function(){return[]},e}();!function(e){e[e.DateOnly=0]="DateOnly",e[e.TimeOnly=1]="TimeOnly",e[e.Both=2]="Both"}(e.CalendarMode||(e.CalendarMode={}));var dn=function(){function e(e,n){this.localeValues=n,this.onManualUpdate=function(){},this.config=e,this.currentDate=new Date,this.firstDayOfWeek=this.localeValues.firstDayOfWeek,this.onDateChange=new t.EventEmitter,this.reset()}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},set:function(e){this._config=e,e.updateBounds(this._selectedDate||this.currentDate)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inFinalView",{get:function(){return this.currentView===this.config.mappings.finalView},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){e?(this._selectedDate=Vt.clone(e),this.currentDate=Vt.clone(e)):this._selectedDate=void 0,this.config.updateBounds(this._selectedDate||this.currentDate),this.onManualUpdate()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){ -return this._minDate&&this.config.dateMinBound?this._minDate>this.config.dateMinBound?this._minDate:this.config.dateMinBound:this._minDate||this.config.dateMinBound},set:function(e){this._minDate=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate&&this.config.dateMaxBound?this._maxDate=this.ranges.current.inRange.length&&(i=!0),!o){var s=this.ranges.current.findIndex(this._highlightedItem),a=this.ranges.calc(i).inRange;if(i?s-=this.ranges.current.inRange.length:s+=a.length,o=a[s+r],o.isDisabled)return}this.ranges.move(i),this._highlightedItem=this.ranges.current.find(o)}},n.prototype.ngOnDestroy=function(){this._documentKeyDownListener()},n.propDecorators={_renderedItems:[{type:t.ViewChildren,args:[mn]}],service:[{type:t.Input}]},n}(),yn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vn=function(){function e(){}return e}(),bn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Date,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Date]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month]]),n}return yn(n,t),n}(vn),wn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Hour,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),_n=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Hour],[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month],[e.CalendarViewType.Hour,e.CalendarViewType.Date],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),Dn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Month,n.finalView=e.CalendarViewType.Month,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Month]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),On=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Year,n.finalView=e.CalendarViewType.Year,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),Cn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sn=function(){function t(e,t,n,i){this.mode=e,this.precision=t,this.mappings=n,this.fallback=i}return t.prototype.updateBounds=function(t){this.dateMinBound=Vt.startOf(e.DatePrecision.Year,new Date,!0),this.dateMinBound.setFullYear(0)},t}(),Mn=function(t){function n(n,i,r){return t.call(this,e.CalendarMode.DateOnly,n,i,r)||this}return Cn(n,t),n}(Sn),Tn=function(t){function n(){return t.call(this,e.DatePrecision.Year,new On,"number")||this}return Cn(n,t),n}(Mn),kn=function(t){function n(){return t.call(this,e.DatePrecision.Month,new Dn,"month")||this}return Cn(n,t),n}(Mn),Pn=function(t){function n(){return t.call(this,e.DatePrecision.Date,new bn,"date")||this}return Cn(n,t),n}(Mn),xn=function(t){function n(){return t.call(this,e.CalendarMode.Both,e.DatePrecision.Minute,new _n,"datetime-local")||this}return Cn(n,t),n}(Sn),In=function(t){function n(){return t.call(this,e.CalendarMode.TimeOnly,e.DatePrecision.Minute,new wn,"time")||this}return Cn(n,t),n.prototype.updateBounds=function(t){this.dateMaxBound=Vt.endOf(e.DatePrecision.Date,Vt.clone(t)),this.dateMinBound=Vt.previous(e.DatePrecision.Date,Vt.clone(this.dateMaxBound))},n}(Sn),En=function(){function t(e,t){this._precision=e,this._isSmallest=t}return t.prototype.equal=function(t,n){return this._precision===e.DatePrecision.Minute?!!n&&Vt.equal(e.DatePrecision.Hour,n,t)&&jt.Math.roundDown(n.getMinutes(),5)===jt.Math.roundDown(t.getMinutes(),5):!!n&&Vt.equal(this._precision,t,n)},t.prototype.lessThan=function(e,t){return this._isSmallest?!t||t>=e:!t||Vt.endOf(this._precision,Vt.clone(t))>=e},t.prototype.greaterThan=function(e,t){return this._isSmallest?!t||t<=e:!t||Vt.startOf(this._precision,Vt.clone(t))<=e},t.prototype.between=function(e,t,n){return this.greaterThan(e,t)&&this.lessThan(e,n)},t}(),Ln=36e5,jn=6e4,Vn=2,Hn={dateTimeDelimeter:/[T ]/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-])(\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/},Rn=6e4,An={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Fn=/MMMM|MM|DD|dddd/g,Yn=function(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||Pe(e.L),ll:e.ll||Pe(e.LL),lll:e.lll||Pe(e.LLL),llll:e.llll||Pe(e.LLLL)};return function(e){return t[e]}}({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"}),Bn={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"},Nn={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Un={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},zn={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},Wn={ordinalNumber:Le,weekday:Ie(Nn,"long"),weekdays:Ee(Nn,"long"),month:Ie(Un,"long"),months:Ee(Un,"long"),timeOfDay:Ie(zn,"long",function(e){return e/12>=1?1:0}),timesOfDay:Ee(zn,"long")},qn=/^(\d+)(th|st|nd|rd)?/i,Kn={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Qn={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$n={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Gn={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Jn={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},Zn={any:[/^a/i,/^p/i]},Xn={ordinalNumbers:function(e){return function(t){return String(t).match(e)}}(qn),ordinalNumber:He,weekdays:je(Kn,"long"),weekday:Ve(Qn,"any"),months:je($n,"long"),month:Ve(Gn,"any"),timesOfDay:je(Jn,"long"),timeOfDay:Ve(Zn,"any")},ei={formatDistance:ke,formatLong:Yn,formatRelative:xe,localize:Wn,match:Xn,options:{weekStartsOn:0,firstWeekContainsDate:1}},ti=864e5,ni=6048e5,ii={M:function(e){return e.getUTCMonth()+1},Mo:function(e,t){var n=e.getUTCMonth()+1;return t.locale.localize.ordinalNumber(n,{unit:"month"})},MM:function(e){return Ue(e.getUTCMonth()+1,2)},MMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"short"})},MMMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"long"})},Q:function(e){return Math.ceil((e.getUTCMonth()+1)/3)},Qo:function(e,t){var n=Math.ceil((e.getUTCMonth()+1)/3);return t.locale.localize.ordinalNumber(n,{unit:"quarter"})},D:function(e){return e.getUTCDate()},Do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDate(),{unit:"dayOfMonth"})},DD:function(e){return Ue(e.getUTCDate(),2)},DDD:function(e){return Re(e)},DDDo:function(e,t){return t.locale.localize.ordinalNumber(Re(e),{unit:"dayOfYear"})},DDDD:function(e){return Ue(Re(e),3)},dd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"narrow"})},ddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"short"})},dddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"long"})},d:function(e){return e.getUTCDay()},do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDay(),{unit:"dayOfWeek"})},E:function(e){return e.getUTCDay()||7},W:function(e){return Be(e)},Wo:function(e,t){return t.locale.localize.ordinalNumber(Be(e),{unit:"isoWeek"})},WW:function(e){return Ue(Be(e),2)},YY:function(e){return Ue(e.getUTCFullYear(),4).substr(2)},YYYY:function(e){return Ue(e.getUTCFullYear(),4)},GG:function(e){return String(Fe(e)).substr(2)},GGGG:function(e){return Fe(e)},H:function(e){return e.getUTCHours()},HH:function(e){return Ue(e.getUTCHours(),2)},h:function(e){var t=e.getUTCHours();return 0===t?12:t>12?t%12:t},hh:function(e){return Ue(ii.h(e),2)},m:function(e){return e.getUTCMinutes()},mm:function(e){return Ue(e.getUTCMinutes(),2)},s:function(e){return e.getUTCSeconds()},ss:function(e){return Ue(e.getUTCSeconds(),2)},S:function(e){return Math.floor(e.getUTCMilliseconds()/100)},SS:function(e){return Ue(Math.floor(e.getUTCMilliseconds()/10),2)},SSS:function(e){return Ue(e.getUTCMilliseconds(),3)},Z:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset(),":")},ZZ:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset())},X:function(e,t){var n=t._originalDate||e;return Math.floor(n.getTime()/1e3)},x:function(e,t){return(t._originalDate||e).getTime()},A:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"uppercase"})},a:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"lowercase"})},aa:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"long"})}},ri=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,oi=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,si={M:/^(1[0-2]|0?\d)/,D:/^(3[0-1]|[0-2]?\d)/,DDD:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,W:/^(5[0-3]|[0-4]?\d)/,YYYY:/^(\d{1,4})/,H:/^(2[0-3]|[0-1]?\d)/,m:/^([0-5]?\d)/,Z:/^([+-])(\d{2}):(\d{2})/,ZZ:/^([+-])(\d{2})(\d{2})/,singleDigit:/^(\d)/,twoDigits:/^(\d{2})/,threeDigits:/^(\d{3})/,fourDigits:/^(\d{4})/,anyDigits:/^(\d+)/},ai={YY:{unit:"twoDigitYear",match:si.twoDigits,parse:function(e){return Qe(e)}},YYYY:{unit:"year",match:si.YYYY,parse:Qe},GG:{unit:"isoYear",match:si.twoDigits,parse:function(e){return Qe(e)+1900}},GGGG:{unit:"isoYear",match:si.YYYY,parse:Qe},Q:{unit:"quarter",match:si.singleDigit,parse:Qe},Qo:{unit:"quarter",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"quarter"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"quarter"})}},M:{unit:"month",match:si.M,parse:function(e){return Qe(e)-1}},Mo:{unit:"month",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"month"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"month"})-1}},MM:{unit:"month",match:si.twoDigits,parse:function(e){return Qe(e)-1}},MMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"short"})},parse:function(e,t){return t.locale.match.month(e,{type:"short"})}},MMMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"long"})||t.locale.match.months(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.month(e,{type:"long"});return null==n&&(n=t.locale.match.month(e,{type:"short"})),n}},W:{unit:"isoWeek",match:si.W,parse:Qe},Wo:{unit:"isoWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"isoWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"isoWeek"})}},WW:{unit:"isoWeek",match:si.twoDigits,parse:Qe},d:{unit:"dayOfWeek",match:si.singleDigit,parse:Qe},do:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfWeek"})}},dd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){return t.locale.match.weekday(e,{type:"narrow"})}},ddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"short"});return null==n&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},dddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"long"})||t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"long"});return null==n&&null==(n=t.locale.match.weekday(e,{type:"short"}))&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},E:{unit:"dayOfISOWeek",match:si.singleDigit,parse:function(e){return Qe(e)}},D:{unit:"dayOfMonth",match:si.D,parse:Qe},Do:{unit:"dayOfMonth",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfMonth"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfMonth"})}},DD:{unit:"dayOfMonth",match:si.twoDigits,parse:Qe},DDD:{unit:"dayOfYear",match:si.DDD,parse:Qe},DDDo:{unit:"dayOfYear",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfYear"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfYear"})}},DDDD:{unit:"dayOfYear",match:si.threeDigits,parse:Qe},A:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){return t.locale.match.timeOfDay(e,{type:"short"})}},aa:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"long"})||t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.timeOfDay(e,{type:"long"});return null==n&&(n=t.locale.match.timeOfDay(e,{type:"short"})),n}},H:{unit:"hours",match:si.H,parse:Qe},HH:{unit:"hours",match:si.twoDigits,parse:Qe},h:{unit:"timeOfDayHours",match:si.M,parse:Qe},hh:{unit:"timeOfDayHours",match:si.twoDigits,parse:Qe},m:{unit:"minutes",match:si.m,parse:Qe},mm:{unit:"minutes",match:si.twoDigits,parse:Qe},s:{unit:"seconds",match:si.m,parse:Qe},ss:{unit:"seconds",match:si.twoDigits,parse:Qe},S:{unit:"milliseconds",match:si.singleDigit,parse:function(e){return 100*Qe(e)}},SS:{unit:"milliseconds",match:si.twoDigits,parse:function(e){return 10*Qe(e)}},SSS:{unit:"milliseconds",match:si.threeDigits,parse:Qe},Z:{unit:"timezone",match:si.Z,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},ZZ:{unit:"timezone",match:si.ZZ,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},X:{unit:"timestamp",match:si.anyDigits,parse:function(e){return 1e3*Qe(e)}},x:{unit:"timestamp",match:si.anyDigits,parse:Qe}};ai.a=ai.A;var ci=864e5,ui={twoDigitYear:{priority:10,set:function(e,t){var n=Math.floor(e.date.getUTCFullYear()/100),i=100*n+t;return e.date.setUTCFullYear(i,0,1),e.date.setUTCHours(0,0,0,0),e}},year:{priority:10,set:function(e,t){return e.date.setUTCFullYear(t,0,1),e.date.setUTCHours(0,0,0,0),e}},isoYear:{priority:10,set:function(e,t,n){return e.date=Ye(Ze(e.date,t,n),n),e}},quarter:{priority:20,set:function(e,t){return e.date.setUTCMonth(3*(t-1),1),e.date.setUTCHours(0,0,0,0),e}},month:{priority:30,set:function(e,t){return e.date.setUTCMonth(t,1),e.date.setUTCHours(0,0,0,0),e}},isoWeek:{priority:40,set:function(e,t,n){return e.date=Ae(Je(e.date,t,n),n),e}},dayOfWeek:{priority:50,set:function(e,t,n){return e.date=$e(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfISOWeek:{priority:50,set:function(e,t,n){return e.date=Ge(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfMonth:{priority:50,set:function(e,t){return e.date.setUTCDate(t),e.date.setUTCHours(0,0,0,0),e}},dayOfYear:{priority:50,set:function(e,t){return e.date.setUTCMonth(0,t),e.date.setUTCHours(0,0,0,0),e}},timeOfDay:{priority:60,set:function(e,t,n){return e.timeOfDay=t,e}},hours:{priority:70,set:function(e,t,n){return e.date.setUTCHours(t,0,0,0),e}},timeOfDayHours:{priority:70,set:function(e,t,n){var i=e.timeOfDay;return null!=i&&(t=Xe(t,i)),e.date.setUTCHours(t,0,0,0),e}},minutes:{priority:80,set:function(e,t){return e.date.setUTCMinutes(t,0,0),e}},seconds:{priority:90,set:function(e,t){return e.date.setUTCSeconds(t,0),e}},milliseconds:{priority:100,set:function(e,t){return e.date.setUTCMilliseconds(t),e}},timezone:{priority:110,set:function(e,t){return e.date=new Date(e.date.getTime()-6e4*t),e}},timestamp:{priority:120,set:function(e,t){return e.date=new Date(t),e}}},pi=110,li=6e4,hi=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,di=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,fi="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},mi=it(function(e,t){function n(e,t,n){n=n||{};var r;return r="string"==typeof i[e]?i[e]:1===t?i[e].one:i[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};e.exports=t.default}),gi=it(function(e,t){function n(e){return e.replace(r,function(e){return e.slice(1)})}function i(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||n(e.L),ll:e.ll||n(e.LL),lll:e.lll||n(e.LLL),llll:e.llll||n(e.LLLL)};return function(e){return t[e]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=/MMMM|MM|DD|dddd/g;e.exports=t.default}),yi=it(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=gi,i=function(e){return e&&e.__esModule?e:{default:e}}(n),r=(0,i.default)({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"});t.default=r,e.exports=t.default}),vi=it(function(e,t){function n(e,t,n,r){return i[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"};e.exports=t.default}),bi=it(function(e,t){function n(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),wi=it(function(e,t){function n(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),_i=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}Object.defineProperty(t,"__esModule",{value:!0});var r=bi,o=n(r),s=wi,a=n(s),c={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},p={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},l={ordinalNumber:i,weekday:(0,o.default)(c,"long"),weekdays:(0,a.default)(c,"long"),month:(0,o.default)(u,"long"),months:(0,a.default)(u,"long"),timeOfDay:(0,o.default)(p,"long",function(e){return e/12>=1?1:0}),timesOfDay:(0,a.default)(p,"long")};t.default=l,e.exports=t.default}),Di=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Oi=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Ci=it(function(e,t){function n(e){return function(t){return String(t).match(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Si=it(function(e,t){function n(e){return parseInt(e[1],10)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Mi=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Di,r=n(i),o=Oi,s=n(o),a=Ci,c=n(a),u=Si,p=n(u),l=/^(\d+)(th|st|nd|rd)?/i,h={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},d={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},f={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},m={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},g={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},y={any:[/^a/i,/^p/i]},v={ordinalNumbers:(0,c.default)(l),ordinalNumber:p.default,weekdays:(0,r.default)(h,"long"),weekday:(0,s.default)(d,"any"),months:(0,r.default)(f,"long"),month:(0,s.default)(m,"any"),timesOfDay:(0,r.default)(g,"long"),timeOfDay:(0,s.default)(y,"any")};t.default=v,e.exports=t.default}),Ti=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=mi,r=n(i),o=yi,s=n(o),a=vi,c=n(a),u=_i,p=n(u),l=Mi,h=n(l),d={formatDistance:r.default,formatLong:s.default,formatRelative:c.default,localize:p.default,match:h.default,options:{weekStartsOn:0,firstWeekContainsDate:1}};t.default=d,e.exports=t.default}),ki=function(e){return e&&e.__esModule?e.default:e}(Ti),Pi=Object.freeze({default:ki,__moduleExports:Ti}),xi=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=1?1:0}),timesOfDay:ot(i,"long")}),this._locale.match=xi({},this._locale.match,{weekdays:st(t,"long"),weekday:at(t,"long"),months:st(n,"long"),month:at(n,"long"),timesOfDay:st(r,"long"),timeOfDay:at(r,"long")})}return Object.defineProperty(e.prototype,"_config",{get:function(){return{weekStartsOn:this._weekStartsOn,locale:this._locale}},enumerable:!0,configurable:!0}),e.prototype.format=function(e,t){return We(e,t,this._config)},e.prototype.parse=function(e,t,n){return et(e,t,n,this._config)},e}(),Ei=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Li=function(){function e(e,t){this._format=e,this._parser=new Ii(t)}return e.prototype.format=function(e){return this._parser.format(e,this._format)},e.prototype.parse=function(e,t){return void 0===t&&(t=new Date),this._parser.parse(e,this._format,t)},e}(),ji=function(e){function t(t,n){var i={time:"HH:mm",datetime:"YYYY-MM-DDTHH:mm",date:"YYYY-MM-DD",month:"YYYY-MM",year:"YYYY"};return e.call(this,i[t],n)||this}return Ei(t,e),t}(Li),Vi=function(){function e(e,t,n,i,r){this.start=e,this.dates=t,this.items=n,this.groupedItems=i,this._comparer=r}return Object.defineProperty(e.prototype,"inRange",{get:function(){return this.items.filter(function(e){return!e.isOutsideRange})},enumerable:!0,configurable:!0}),e.prototype.find=function(e){var t=this;return this.items.find(function(n){return t._comparer.equal(n.date,e.date)})},e.prototype.findIndex=function(e){var t=this -;return e?this.items.findIndex(function(n){return t._comparer.equal(n.date,e.date)}):-1},e.prototype.containsDate=function(e){var t=this;return!!this.inRange.find(function(n){return t._comparer.equal(n.date,e)})},e}(),Hi=function(){function e(e,t,n){this.interval=e,this.marginal=e+1,this.rows=t,this.columns=n}return Object.defineProperty(e.prototype,"dateComparer",{get:function(){return new En(this.marginal,this.service.inFinalView)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.rows*this.columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMoveNext",{get:function(){var e=this.next.inRange[0];return!e||!this.service.maxDate||e.date<=this.service.maxDate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMovePrevious",{get:function(){var e=this.previous.inRange.slice(-1).pop();return!e||!this.service.minDate||e.date>=this.service.minDate},enumerable:!0,configurable:!0}),e.prototype.loadService=function(e){this.service=e,this.refresh()},e.prototype.refresh=function(){this.current=this.calcRange(this.service.currentDate),this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate))),this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.move=function(e){return e?this.moveNext():this.movePrevious()},e.prototype.moveNext=function(){Vt.next(this.interval,this.service.currentDate),this.previous=this.current,this.current=this.next,this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.movePrevious=function(){Vt.previous(this.interval,this.service.currentDate),this.next=this.current,this.current=this.previous,this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.calc=function(e){return e?this.next:this.previous},e.prototype.calcRange=function(e){var t=this.calcStart(e);this.service.inFinalView&&Vt.startOf(this.marginal,t,!0);var n=this.calcDates(t),i=this.calcItems(n,e);return new Vi(t,n,i,jt.Array.group(i,this.columns),this.dateComparer)},e.prototype.calcStart=function(e){return Vt.startOf(this.interval,Vt.clone(e))},e.prototype.calcDates=function(e){var t=this;return jt.Array.range(this.length).map(function(n){return Vt.add(t.marginal,Vt.clone(e),n)})},e.prototype.calcItems=function(e,t){var n=this;return e.map(function(e){var i=new fn(e);return i.isDisabled=!n.dateComparer.between(i.date,n.service.minDate,n.service.maxDate),i.isActive=n.dateComparer.equal(i.date,n.service.selectedDate),i.isToday=n.dateComparer.equal(i.date,new Date),i.isSelectable=i.isDisabled,n.configureItem(i,t),i})},e}(),Ri=function(){function e(){this.onZoomOut=new t.EventEmitter}return e.decorators=[{type:t.Component,args:[{selector:"sui-calendar-view-title",template:'\n\n \n\n\n \n\n\n \n\n',styles:["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={ranges:[{type:t.Input}],onZoomOut:[{type:t.Output,args:["zoomOut"]}]},e}(),Ai={Year:"year",Month:"month",Date:"date",Datetime:"datetime",Time:"time"},Fi=function(){function e(e){this.service=new dn(new xn,e.get().datepicker),this._calendarClasses=!0}return e.prototype.onMouseDown=function(e){e.preventDefault()},e.decorators=[{type:t.Component,args:[{selector:"sui-datepicker",template:'\n\n \n \n \n \n \n\n',styles:["\n:host {\n user-select: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:mt}]},e.propDecorators={_calendarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.active"]},{type:t.HostBinding,args:["class.calendar"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}]},e}(),Yi={Hover:"hover",Click:"click",OutsideClick:"outsideClick",Focus:"focus",Manual:"manual"},Bi=function(){function e(e){void 0===e&&(e={}),this.placement=tn.TopLeft,this.trigger=Yi.Hover,this.isInverted=!1,this.delay=0,this.isBasic=!1,this.transition="scale",this.transitionDuration=200,Object.assign(this,e)}return e}(),Ni=function(){function n(e){this.elementRef=e,this.transitionController=new vt(!1),this._isOpen=!1,this.onOpen=new t.EventEmitter,this.onClose=new t.EventEmitter,this._tabindex=0}return Object.defineProperty(n.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"anchor",{set:function(e){this.positioningService=new nn(e,this._container.element,this.config.placement,".dynamic.arrow")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"direction",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"alignment",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").pop()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dynamicClasses",{get:function(){var e={};return this.direction&&(e[this.direction]=!0),this.alignment&&(e[this.alignment]=!0),this.config.isInverted&&(e.inverted=!0),this.config.isBasic&&(e.basic=!0),e},enumerable:!0,configurable:!0}),n.prototype.open=function(){var t=this;this.isOpen||(clearTimeout(this.closingTimeout),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.In,function(){var e=t.elementRef.nativeElement.querySelector("[autofocus]");e&&(setTimeout(function(){return e.focus()},10),setTimeout(function(){return e.focus()},t.config.transitionDuration))})),this.positioningService.placement=this.config.placement,setTimeout(function(){return t.positioningService.update()}),this._isOpen=!0,this.onOpen.emit())},n.prototype.toggle=function(){return this.isOpen?this.close():this.open()},n.prototype.close=function(){var t=this;this.isOpen&&(this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.Out)),clearTimeout(this.closingTimeout),this.closingTimeout=window.setTimeout(function(){return t.onClose.emit()},this.config.transitionDuration),this._isOpen=!1)},n.prototype.onClick=function(e){e.stopPropagation()},n.decorators=[{type:t.Component,args:[{selector:"sui-popup",template:'\n\n',styles:['\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor\'s mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed \'vertically\'. */\n.ui.popup[direction="top"],\n.ui.popup[direction="bottom"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed \'horizontally\'. */\n.ui.popup[direction="left"],\n.ui.popup[direction="right"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n']}]}],n.ctorParameters=function(){return[{type:t.ElementRef}]},n.propDecorators={_container:[{type:t.ViewChild,args:["container",{read:t.ViewContainerRef}]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],_tabindex:[{type:t.HostBinding,args:["attr.tabindex"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(),Ui=function(){function e(e,t,n,i){var r=this;this._element=t,this._componentFactory=n,this._componentRef=this._componentFactory.createComponent(Ni),this.popup.config=i,this.popup.onClose.subscribe(function(){return r.cleanup()}),this._documentListener=e.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"popup",{get:function(){return this._componentRef.instance},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){e&&Object.assign(this.popup.config,e)},e.prototype.openDelayed=function(){var e=this;clearTimeout(this._openingTimeout),this._openingTimeout=window.setTimeout(function(){return e.open()},this.popup.config.delay)},e.prototype.open=function(){this._componentFactory.attachToApplication(this._componentRef),this._componentFactory.moveToDocumentBody(this._componentRef),this.popup.anchor=this._element,this.popup.open();var e=this.popupOnOpen;e&&e.call(this)},e.prototype.close=function(){clearTimeout(this._openingTimeout),this._componentRef&&this.popup.close();var e=this.popupOnClose;e&&e.call(this)},e.prototype.toggleDelayed=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.openDelayed():this.close()},e.prototype.toggle=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.open():this.close()},e.prototype.onMouseEnter=function(){this.popup.config.trigger===Yi.Hover&&this.openDelayed()},e.prototype.onMouseLeave=function(){this.popup.config.trigger===Yi.Hover&&this.close()},e.prototype.onClick=function(){this.popup.config.trigger===Yi.Click||this.popup.config.trigger===Yi.OutsideClick?this.toggleDelayed():this.popup.config.trigger!==Yi.Focus||this._componentRef&&(!this._componentRef||this.popup.isOpen)||this.openDelayed()},e.prototype.onDocumentClick=function(e){if(this._componentRef&&this.popup.config.trigger===Yi.OutsideClick){var t=e.target;this._element.nativeElement.contains(t)||this.close()}},e.prototype.onFocusIn=function(){this.popup.config.trigger===Yi.Focus&&this.openDelayed()},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.popup.elementRef.nativeElement.contains(e.relatedTarget)||this.popup.config.trigger!==Yi.Focus||this.close()},e.prototype.cleanup=function(){clearTimeout(this._openingTimeout),this._componentRef.instance&&this._componentRef.instance.positioningService&&this._componentRef.instance.positioningService.destroy(),this._componentFactory.detachFromApplication(this._componentRef)},e.prototype.ngOnDestroy=function(){this.cleanup(),this._documentListener()},e.propDecorators={onMouseEnter:[{type:t.HostListener,args:["mouseenter"]}],onMouseLeave:[{type:t.HostListener,args:["mouseleave"]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wi=function(e){function t(t,n,i,r,o){var s=e.call(this,t,n,i,o)||this;return s._component=r,s}return zi(t,e),Object.defineProperty(t.prototype,"componentInstance",{get:function(){if(this._contentComponentRef)return this._contentComponentRef.instance},enumerable:!0,configurable:!0}),t.prototype.open=function(){this._contentComponentRef||(this._contentComponentRef=this._componentFactory.createComponent(this._component),this._componentFactory.attachToView(this._contentComponentRef,this.popup.templateSibling)),e.prototype.open.call(this)},t.prototype.cleanup=function(){e.prototype.cleanup.call(this),this._contentComponentRef&&(this._contentComponentRef.destroy(),this._contentComponentRef=void 0)},t}(Ui),qi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ki=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return qi(t,e),t}(Bi),Qi=function(e){function t(t,n,i,r){return e.call(this,t,n,i,r)||this}return qi(t,e),t.prototype.configure=function(t){e.prototype.configure.call(this,t),t&&(this.template=t.template,this.context=t.context)},t.prototype.open=function(){this.template&&(this.popup.templateSibling.clear(),this._componentFactory.createView(this.popup.templateSibling,this.template,{$implicit:this.popup,context:this.context})),e.prototype.open.call(this)},t}(Ui),$i=function(){function e(){}return Object.defineProperty(e.prototype,"direction",{get:function(){if(this.placement)return this.placement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){if(this.placement){var e=this.placement.split(" ").pop();return e===this.direction?"center":e}},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-popup-arrow",template:'\n
\n
\n',styles:['\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction="top"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction="left"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction="bottom"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction="right"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction="bottom"][alignment="left"],\n.static.arrow[direction="top"][alignment="left"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction="left"][alignment="top"],\n.static.arrow[direction="right"][alignment="top"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction="bottom"][alignment="right"],\n.static.arrow[direction="top"][alignment="right"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction="left"][alignment="bottom"],\n.static.arrow[direction="right"][alignment="bottom"] {\n top: auto;\n bottom: 1em;\n}\n']}]}],e.ctorParameters=function(){return[]},e.propDecorators={placement:[{type:t.Input}],inverted:[{type:t.HostBinding,args:["class.inverted"]},{type:t.Input}]},e}(),Gi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ji=function(e){function n(){return e.call(this)||this}return Gi(n,e),n.decorators=[{type:t.Injectable}],n.ctorParameters=function(){return[]},n}(Bi),Zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xi=function(e){function n(t,n,i,r){return e.call(this,t,n,i,new Bi(r))||this}return Zi(n,e),Object.defineProperty(n.prototype,"popupHeader",{set:function(e){this.popup.config.header=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupText",{set:function(e){this.popup.config.text=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupInverted",{set:function(e){this.popup.config.isInverted=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupBasic",{set:function(e){this.popup.config.isBasic=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupPlacement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupDelay",{set:function(e){this.popup.config.delay=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTrigger",{get:function(){return this.popup.config.trigger},set:function(e){this.popup.config.trigger=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplate",{set:function(e){this.template=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplateContext",{set:function(e){this.context=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupConfig",{set:function(e){this.configure(e)},enumerable:!0,configurable:!0}),n.decorators=[{type:t.Directive,args:[{selector:"[suiPopup]",exportAs:"suiPopup"}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:Ji}]},n.propDecorators={popupHeader:[{type:t.Input}],popupText:[{type:t.Input}],popupInverted:[{type:t.Input}],popupBasic:[{type:t.Input}],popupTransition:[{type:t.Input}],popupTransitionDuration:[{type:t.Input}],popupPlacement:[{type:t.Input}],popupDelay:[{type:t.Input}],popupTrigger:[{type:t.Input}],popupTemplate:[{type:t.Input}],popupTemplateContext:[{type:t.Input}],popupConfig:[{type:t.Input}]},n}(Qi),er=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt,rn],declarations:[Xi,$i,Ni],exports:[Xi,Ni],providers:[Ji],entryComponents:[Ni]}]}],e.ctorParameters=function(){return[]},e}(),tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),nr=function(n){function i(e,i,r,o){var s=n.call(this,e,i,r,Fi,new Bi({trigger:Yi.Focus,placement:tn.BottomLeft,transition:"scale",transitionDuration:200}))||this;return s.renderer=e,s.localizationService=o,s.renderer.addClass(s.popup.elementRef.nativeElement,"ui"),s.renderer.addClass(s.popup.elementRef.nativeElement,"calendar"),s.onLocaleUpdate(),s.localizationService.onLanguageUpdate.subscribe(function(){return s.onLocaleUpdate()}),s.onSelectedDateChange=new t.EventEmitter,s.onValidatorChange=new t.EventEmitter,s.mode=Ai.Datetime,s}return tr(i,n),Object.defineProperty(i.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){this._selectedDate=e,this.onSelectedDateChange.emit(e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mode",{get:function(){return this._mode},set:function(e){switch(this._mode=e||Ai.Datetime,this._mode){case Ai.Year:this.config=new Tn;break;case Ai.Month:this.config=new kn;break;case Ai.Date:default:this.config=new Pn;break;case Ai.Datetime:this.config=new xn;break;case Ai.Time:this.config=new In}this.writeValue(this.selectedDate)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localeValues",{get:function(){return this.localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),i.prototype.popupOnOpen=function(){var e=this;this.componentInstance&&(this.componentInstance.service.config=this.config,this.componentInstance.service.localeValues=this.localeValues,this.componentInstance.service.currentDate=this.initialDate||new Date,this.componentInstance.service.selectedDate=this.selectedDate,this.componentInstance.service.maxDate=this.maxDate,this.componentInstance.service.minDate=this.minDate,void 0!=this.firstDayOfWeek&&(this.componentInstance.service.firstDayOfWeek=this.firstDayOfWeek),this.componentInstance.service.reset(),this.componentInstance.service.onDateChange.subscribe(function(t){e.selectedDate=t,e.close()}))},i.prototype.ngOnChanges=function(e){var t=e.maxDate,n=e.minDate,i=e.mode;(t||n||i)&&this.onValidatorChange.emit()},i.prototype.onLocaleUpdate=function(){this._localeValues=this.localizationService.get().datepicker},i.prototype.validate=function(e){var t=e.value;if(void 0!=t){if(this.minDate&&tthis.maxDate)return{suiMaxDate:{required:this.maxDate,actual:t}}}return null},i.prototype.writeValue=function(e){this.selectedDate=e,this.componentInstance&&(this.componentInstance.service.selectedDate=e)},i.prototype.onKeyDown=function(t){t.keyCode===e.KeyCode.Escape&&this.close()},i.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",providers:[a(i)]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:mt}]},i.propDecorators={mode:[{type:t.Input,args:["pickerMode"]}],initialDate:[{type:t.Input,args:["pickerInitialDate"]}],maxDate:[{type:t.Input,args:["pickerMaxDate"]}],minDate:[{type:t.Input,args:["pickerMinDate"]}],firstDayOfWeek:[{type:t.Input,args:["pickerFirstDayOfWeek"]}],localeOverrides:[{type:t.Input,args:["pickerLocaleOverrides"]}],placement:[{type:t.Input,args:["pickerPlacement"]}],transition:[{type:t.Input,args:["pickerTransition"]}],transitionDuration:[{type:t.Input,args:["pickerTransitionDuration"]}],onSelectedDateChange:[{type:t.Output,args:["pickerSelectedDateChange"]}],onValidatorChange:[{type:t.Output,args:["pickerValidatorChange"]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},i}(Wi),ir=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerSelectedDateChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(Et),rr=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerValidatorChange)":"onValidatorChange()"},providers:[a(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(It),or=it(function(e){!function(t,n,i){e.exports?e.exports=i():t.bowser=i()}(fi,0,function(){function e(e){function t(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}function n(t){var n=e.match(t);return n&&n.length>1&&n[2]||""}var i,r=t(/(ipod|iphone|ipad)/i).toLowerCase(),o=/like android/i.test(e),a=!o&&/android/i.test(e),c=/nexus\s*[0-6]\s*/i.test(e),u=!c&&/nexus\s*[0-9]+/i.test(e),p=/CrOS/.test(e),l=/silk/i.test(e),h=/sailfish/i.test(e),d=/tizen/i.test(e),f=/(web|hpw)os/i.test(e),m=/windows phone/i.test(e),g=(/SamsungBrowser/i.test(e),!m&&/windows/i.test(e)),y=!r&&!l&&/macintosh/i.test(e),v=!a&&!h&&!d&&!f&&/linux/i.test(e),b=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),w=t(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(e)&&!/tablet pc/i.test(e),D=!_&&/[^-]mobi/i.test(e),O=/xbox/i.test(e);/opera/i.test(e)?i={name:"Opera",opera:s,version:w||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?i={name:"Opera",opera:s,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||w}:/SamsungBrowser/i.test(e)?i={name:"Samsung Internet for Android",samsungBrowser:s,version:w||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?i={name:"Opera Coast",coast:s,version:w||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?i={name:"Yandex Browser",yandexbrowser:s,version:w||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?i={name:"UC Browser",ucbrowser:s,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?i={name:"Maxthon",maxthon:s,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?i={name:"Epiphany",epiphany:s,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?i={name:"Puffin",puffin:s,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?i={name:"Sleipnir",sleipnir:s,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?i={name:"K-Meleon",kMeleon:s,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:m?(i={name:"Windows Phone",osname:"Windows Phone",windowsphone:s},b?(i.msedge=s,i.version=b):(i.msie=s,i.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?i={name:"Internet Explorer",msie:s,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:p?i={name:"Chrome",osname:"Chrome OS",chromeos:s,chromeBook:s,chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(e)?i={name:"Microsoft Edge",msedge:s,version:b}:/vivaldi/i.test(e)?i={name:"Vivaldi",vivaldi:s,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||w}:h?i={name:"Sailfish",osname:"Sailfish OS",sailfish:s,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?i={name:"SeaMonkey",seamonkey:s,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(i={name:"Firefox",firefox:s,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(i.firefoxos=s,i.osname="Firefox OS")):l?i={name:"Amazon Silk",silk:s,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?i={name:"PhantomJS",phantom:s,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?i={name:"SlimerJS",slimer:s,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?i={name:"BlackBerry",osname:"BlackBerry OS",blackberry:s,version:w||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:f?(i={name:"WebOS",osname:"WebOS",webos:s,version:w||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(i.touchpad=s)):/bada/i.test(e)?i={name:"Bada",osname:"Bada",bada:s,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:d?i={name:"Tizen",osname:"Tizen",tizen:s,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||w}:/qupzilla/i.test(e)?i={name:"QupZilla",qupzilla:s,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||w}:/chromium/i.test(e)?i={name:"Chromium",chromium:s,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||w}:/chrome|crios|crmo/i.test(e)?i={name:"Chrome",chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:a?i={name:"Android",version:w}:/safari|applewebkit/i.test(e)?(i={name:"Safari",safari:s},w&&(i.version=w)):r?(i={name:"iphone"==r?"iPhone":"ipad"==r?"iPad":"iPod"},w&&(i.version=w)):i=/googlebot/i.test(e)?{name:"Googlebot",googlebot:s,version:t(/googlebot\/(\d+(\.\d+))/i)||w}:{name:t(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!i.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(i.name=i.name||"Blink",i.blink=s):(i.name=i.name||"Webkit",i.webkit=s),!i.version&&w&&(i.version=w)):!i.opera&&/gecko\//i.test(e)&&(i.name=i.name||"Gecko",i.gecko=s,i.version=i.version||t(/gecko\/(\d+(\.\d+)?)/i)),i.windowsphone||!a&&!i.silk?!i.windowsphone&&r?(i[r]=s,i.ios=s,i.osname="iOS"):y?(i.mac=s,i.osname="macOS"):O?(i.xbox=s,i.osname="Xbox"):g?(i.windows=s,i.osname="Windows"):v&&(i.linux=s,i.osname="Linux"):(i.android=s,i.osname="Android");var C="";i.windows?C=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)):i.windowsphone?C=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):i.mac?(C=t(/Mac OS X (\d+([_\.\s]\d+)*)/i),C=C.replace(/[_\s]/g,".")):r?(C=t(/os (\d+([_\s]\d+)*) like mac os x/i),C=C.replace(/[_\s]/g,".")):a?C=t(/android[ \/-](\d+(\.\d+)*)/i):i.webos?C=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):i.blackberry?C=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):i.bada?C=t(/bada\/(\d+(\.\d+)*)/i):i.tizen&&(C=t(/tizen[\/\s](\d+(\.\d+)*)/i)),C&&(i.osversion=C);var S=!i.windows&&C.split(".")[0];return _||u||"ipad"==r||a&&(3==S||S>=4&&!D)||i.silk?i.tablet=s:(D||"iphone"==r||"ipod"==r||a||c||i.blackberry||i.webos||i.bada)&&(i.mobile=s),i.msedge||i.msie&&i.version>=10||i.yandexbrowser&&i.version>=15||i.vivaldi&&i.version>=1||i.chrome&&i.version>=20||i.samsungBrowser&&i.version>=4||i.firefox&&i.version>=20||i.safari&&i.version>=6||i.opera&&i.version>=10||i.ios&&i.osversion&&i.osversion.split(".")[0]>=6||i.blackberry&&i.version>=10.1||i.chromium&&i.version>=20?i.a=s:i.msie&&i.version<10||i.chrome&&i.version<20||i.firefox&&i.version<20||i.safari&&i.version<6||i.opera&&i.version<10||i.ios&&i.osversion&&i.osversion.split(".")[0]<6||i.chromium&&i.version<20?i.c=s:i.x=s,i}function t(e){return e.split(".").length}function n(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n=0;){if(r[0][i]>r[1][i])return 1;if(r[0][i]!==r[1][i])return-1;if(0===i)return 0}}function r(t,n,r){var o=a;"string"==typeof n&&(r=n,n=void 0),void 0===n&&(n=!1),r&&(o=e(r));var s=""+o.version;for(var c in t)if(t.hasOwnProperty(c)&&o[c]){if("string"!=typeof t[c])throw new Error("Browser version in the minVersion map should be a string: "+c+": "+String(t));return i([s,t[c]])<0}return n}function o(e,t,n){return!r(e,t,n)}var s=!0,a=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return a.test=function(e){for(var t=0;t\n\n \n \n \n {{ date }}\n \n \n \n \n {{ day }}\n \n\n\n \n {{ item.humanReadable }}\n \n \n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),vr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),br=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vr(t,e),t.prototype.configureItem=function(e,t){var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");e.humanReadable=new Li(n,this.service.localeValues).format(e.date),e.isOutsideRange=!1},t}(Hi),wr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Hour,new br(e.DatePrecision.Date,6,4))||this}return vr(i,n),Object.defineProperty(i.prototype,"date",{get:function(){return new Li(this.service.localeValues.formats.date,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-hour-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),_r=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Dr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _r(n,t),n.prototype.calcStart=function(t){return Vt.startOf(e.DatePrecision.Hour,Vt.clone(t),!0)},n.prototype.calcDates=function(t){return jt.Array.range(this.length).map(function(n){return Vt.add(e.DatePrecision.Minute,Vt.clone(t),5*n)})},n.prototype.configureItem=function(e,t){e.humanReadable=new Li(this.service.localeValues.formats.time,this.service.localeValues).format(e.date),e.isOutsideRange=!1},n}(Hi),Or=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Minute,new Dr(e.DatePrecision.Hour,4,3))||this}return _r(i,n),Object.defineProperty(i.prototype,"date",{get:function(){if(this.service.config.mode!==e.CalendarMode.TimeOnly){var t=this.service.localeValues.formats.datetime.replace(/[ms]/g,"0");return new Li(t,this.service.localeValues).format(this.currentDate)}var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");return new Li(n,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-minute-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Cr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Cr(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=this.service.localeValues.monthsShort[e.date.getMonth()],e.isOutsideRange=!1},t}(Hi),Mr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Month,new Sr(e.DatePrecision.Year,4,3))||this}return Cr(i,n),Object.defineProperty(i.prototype,"year",{get:function(){return new Li(this.service.localeValues.formats.year,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-month-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Tr(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=jt.String.padLeft(e.date.getFullYear().toString(),4,"0"),e.isOutsideRange=e.date.getFullYear()>=this.calcStart(t).getFullYear()+10},t}(Hi),Pr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Year,new kr(e.DatePrecision.Decade,4,3))||this}return Tr(i,n),Object.defineProperty(i.prototype,"decadeStart",{get:function(){return Vt.startOf(e.DatePrecision.Decade,Vt.clone(this.service.currentDate)).getFullYear()},enumerable:!0,configurable:!0}),i.prototype.pad=function(e){return jt.String.padLeft(e.toString(),4,"0")},i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-year-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),xr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,er,gt,rn],declarations:[mn,Ri,Pr,Mr,yr,wr,Or,Fi,nr,ir,rr,fr],exports:[nr,ir,rr,fr],entryComponents:[Fi]}]}],e.ctorParameters=function(){return[]},e}(),Ir=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Er=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o._isDimmed=!1,o.isDimmedChange=new t.EventEmitter,o.isClickable=!0,o.wrapContent=!0,o._dimmerClasses=!0,o}return Ir(i,n),Object.defineProperty(i.prototype,"isDimmed",{get:function(){return this._isDimmed},set:function(t){var n=!!t;this._transitionController?this._isDimmed!==n&&(this._isDimmed=n,this._transitionController.stopAll(),this._transitionController.animate(new yt("fade",this.transitionDuration,n?e.TransitionDirection.In:e.TransitionDirection.Out))):(this._transitionController=new vt(n,"block"),this.setTransitionController(this._transitionController),this._isDimmed=n)},enumerable:!0,configurable:!0}),i.prototype.onClick=function(){this.isClickable&&(this.isDimmed=!1,this.isDimmedChange.emit(this.isDimmed))},i.decorators=[{type:t.Component,args:[{selector:"sui-dimmer",template:'\n
\n
\n \n
\n
\n',styles:["\n:host.dimmer {\n transition: none;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},i.propDecorators={_dimmerClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dimmer"]}],isDimmed:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDimmedChange:[{type:t.Output}],isClickable:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],wrapContent:[{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},i}(bt),Lr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[Er],exports:[Er]}]}],e.ctorParameters=function(){return[]},e}(),jr={ItemClick:"itemClick",OutsideClick:"outsideClick",Disabled:"disabled"},Vr=function(){function e(e){void 0===e&&(e=jr.ItemClick),this.isOpen=!1,this.isOpenChange=new t.EventEmitter,this.isDisabled=!1,this.autoCloseMode=e,this.children=[]}return Object.defineProperty(e.prototype,"isNested",{get:function(){return!!this.parent},enumerable:!0,configurable:!0}),e.prototype.setOpenState=function(e,t){var n=this;void 0===t&&(t=!1),this.isOpen===e||this.isDisabled?this.isOpen!==e&&this.isDisabled&&this.delay(function(){return n.isOpenChange.emit(n.isOpen)}):(this.isOpen=!!e,this.isAnimating=!0,this.delay(function(){return n.isOpenChange.emit(n.isOpen)}),this.isOpen||this.children.forEach(function(e){return e.setOpenState(n.isOpen)}),this.parent&&t&&this.parent.setOpenState(this.isOpen,!0))},e.prototype.setDisabledState=function(e){this.isDisabled!==e&&(e&&this.setOpenState(!1),this.isDisabled=!!e)},e.prototype.toggleOpenState=function(){this.setOpenState(!this.isOpen)},e.prototype.registerChild=function(e){this.isChildRegistered(e)||(this.children.push(e),e.parent=this)},e.prototype.isChildRegistered=function(e){return this===e||!!this.children.find(function(t){return!!t.children.find(function(t){return t.isChildRegistered(e)})})},e.prototype.clearChildren=function(){this.children.forEach(function(e){e.parent=void 0}),this.children=[]},e.prototype.delay=function(e){setTimeout(function(){return e()})},e}();!function(e){"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,n=(t.document||t.ownerDocument).querySelectorAll(e),i=0;n[i]&&n[i]!==t;)++i;return Boolean(n[i])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window.Element.prototype);var Hr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rr=function(){function e(e,t){this._renderer=e,this.element=t,this.isSelected=!1,this.selectedClass="selected"}return Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.element.nativeElement.classList.contains("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},set:function(e){e?this._renderer.addClass(this.element.nativeElement,this.selectedClass):this._renderer.removeClass(this.element.nativeElement,this.selectedClass)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasChildDropdown",{get:function(){return!!this.childDropdownMenu},enumerable:!0,configurable:!0}),e.prototype.performClick=function(){this.element.nativeElement.click()},e.decorators=[{type:t.Directive,args:[{selector:".item"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={childDropdownMenu:[{type:t.ContentChild,args:[t.forwardRef(function(){return Ar})]}]},e}(),Ar=function(n){function i(e,t,i){var r=n.call(this,e,t,i)||this;return r.element=t,r._transitionController=new vt(!1),r.setTransitionController(r._transitionController),r.menuTransition="slide down",r.menuTransitionDuration=200,r.menuAutoSelectFirst=!1,r.menuSelectedItemClass="selected",r._documentKeyDownListener=e.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),r}return Hr(i,n),Object.defineProperty(i.prototype,"service",{get:function(){return this._service},set:function(t){var n=this;this._service=t;var i=this._service.isOpen;this._service.isOpenChange.subscribe(function(t){t!==i&&(n._transitionController.stopAll(),n._transitionController.animate(new yt(n.menuTransition,n.menuTransitionDuration,e.TransitionDirection.Either,function(){return n._service.isAnimating=!1}))),t||n.selectedItems.length>1&&n.resetSelection(),i=t})},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"items",{set:function(e){this._itemsQueryOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_itemsQuery",{get:function(){return this._itemsQueryOverride||this._itemsQueryInternal},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_items",{get:function(){return this._itemsQuery.filter(function(e){return!e.isDisabled})},enumerable:!0,configurable:!0}),i.prototype.onClick=function(e){if(!e.eventHandled&&(e.eventHandled=!0,this._service.autoCloseMode===jr.ItemClick)){var t=e.target;this.element.nativeElement.contains(t.closest(".item"))&&!/input|textarea/i.test(t.tagName)&&this._service.setOpenState(!1,!0)}},i.prototype.onDocumentKeyDown=function(t){if(this._service.isOpen&&!this._service.isNested){!/input/i.test(t.target.tagName)&&[e.KeyCode.Escape,e.KeyCode.Enter,e.KeyCode.Up,e.KeyCode.Down,e.KeyCode.Left,e.KeyCode.Right].find(function(e){return e===t.keyCode})&&t.preventDefault();var n=this.selectedItems.slice(-1)[0],i=this;if(this.selectedItems.length>=2){var r=this.selectedItems.slice(-2)[0];i=r.childDropdownMenu}switch(t.keyCode){case e.KeyCode.Escape:this._service.setOpenState(!1);break;case e.KeyCode.Down:case e.KeyCode.Up:this.selectedItems.pop(),this.selectedItems.push(i.updateSelection(n,t.keyCode)),t.preventDefault();break;case e.KeyCode.Enter:if(n&&!n.hasChildDropdown){n.performClick();break}case e.KeyCode.Right:n&&n.hasChildDropdown&&(n.childDropdownMenu.service.setOpenState(!0),this.selectedItems.push(n.childDropdownMenu.updateSelection(n,t.keyCode)));break;case e.KeyCode.Left:if(this.selectedItems.length>=2){this.selectedItems.pop();var r=this.selectedItems.slice(-1)[0];r.childDropdownMenu.service.setOpenState(!1),r.isSelected=!0}}}},i.prototype.resetSelection=function(){var e=this;this.selectedItems=[],this._items.forEach(function(t){t.selectedClass=e.menuSelectedItemClass,t.isSelected=!1}),this.menuAutoSelectFirst&&this._items.length>0&&(this._items[0].isSelected=!0,this.scrollToItem(this._items[0]),this.selectedItems.push(this._itemsQuery.first))},i.prototype.updateSelection=function(t,n){t&&(t.isSelected=!1);var i,r=this._items.findIndex(function(e){return e===t});switch(n){case e.KeyCode.Enter:case e.KeyCode.Right:case e.KeyCode.Down:r+=1;break;case e.KeyCode.Up:if(-1===r){r=0;break}r-=1}return i=this._items[r]||t,i&&(i.isSelected=!0,this.scrollToItem(i)),i},i.prototype.scrollToItem=function(e){var t=this.element.nativeElement,n=e.element.nativeElement.getBoundingClientRect(),i=t.getBoundingClientRect(),r=0;n.bottom>i.bottom&&(r=n.bottom-i.bottom),n.top\n\n \x3c!-- Modal component, with transition component attached --\x3e\n \n\n',styles:["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"]}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht}]},n.propDecorators={isClosable:[{type:t.Input}],closeResult:[{type:t.Input}],onApprove:[{type:t.Output,args:["approved"]}],onDeny:[{type:t.Output,args:["denied"]}],onDismiss:[{type:t.Output,args:["dismissed"]}],_modalElement:[{type:t.ViewChild,args:["modal"]}],size:[{type:t.Input}],isFullScreen:[{type:t.Input}],isBasic:[{type:t.Input}],mustScroll:[{type:t.Input}],isInverted:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onDocumentKeyUp:[{type:t.HostListener,args:["document:keyup",["$event"]]}],onDocumentResize:[{type:t.HostListener,args:["window:resize"]}]},n}(),Xr=function(){function e(e){this._componentFactory=e}return e.prototype.open=function(e){var t=this._componentFactory.createComponent(Zr),n=t.instance;if(e instanceof Wr)this._componentFactory.createView(n.templateSibling,e.template,{$implicit:e.context,modal:t.instance.controls});else if(e instanceof qr){var i=this._componentFactory.createComponent(e.component,[{provide:$r,useValue:new $r(n.controls,e.context)}]);this._componentFactory.attachToView(i,n.templateSibling);for(var r=i.location.nativeElement;r.hasChildNodes()&&r.parentElement&&r.firstChild;)r.parentElement.appendChild(r.removeChild(r.firstChild));this._componentFactory.detachFromDocument(i)}return this._componentFactory.attachToApplication(t),n.loadConfig(e),new Br(e,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Ht}]},e}(),eo=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Lr,wt,rn],declarations:[Zr],exports:[Zr],providers:[Xr],entryComponents:[Zr]}]}],e.ctorParameters=function(){return[]},e}(),to=function(){function e(){this._popupClasses=!0,this.value=0,this.maximum=100,this.precision=0,this._overrideSuccess=!1,this.autoSuccess=!0,this.showProgress=!0,this._popupClasses=!0}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){var t=+e;Number.isNaN(t)||(this._value=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){var t=+e;Number.isNaN(t)||(this._maximum=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"precision",{get:function(){return this._precision},set:function(e){var t=+e;Number.isNaN(t)||(this._precision=Math.min(Math.max(t,0),20))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_reachedMaximum",{get:function(){return this._overrideSuccess||this.value>=this.maximum&&this.autoSuccess},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"percentage",{get:function(){return(Math.min(Math.max(this.value,0),this.maximum)/this.maximum*100).toFixed(this.precision)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classValue",{set:function(e){(e.includes("attached")||e.includes("tiny"))&&(this.showProgress=!1),e.includes("success")&&(this._overrideSuccess=!0)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-progress",template:'\n
\n
{{ percentage }}%
\n
\n
\n \n
\n',styles:["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_popupClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.progress"]}],autoSuccess:[{type:t.Input}],showProgress:[{type:t.Input}],value:[{type:t.Input}],maximum:[{type:t.Input}],precision:[{type:t.Input}],_reachedMaximum:[{type:t.HostBinding,args:["class.success"]}],percentage:[{type:t.HostBinding,args:["attr.data-percent"]}],classValue:[{type:t.Input,args:["class"]}]},e}(),no=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[to],exports:[to]}]}],e.ctorParameters=function(){return[]},e}(),io=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ro=function(){function e(){this.hoveredIndex=-1,this.value=0,this.valueChange=new t.EventEmitter,this.maximum=5,this.isReadonly=!1,this._ratingClasses=!0}return Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){this._maximum=+e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icons",{get:function(){return new Array(this.maximum)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){this.isReadonly||(this.value=e+1,this.valueChange.emit(this.value))},e.prototype.onMouseover=function(e){this.hoveredIndex=e},e.prototype.onMouseout=function(){this.hoveredIndex=-1},e.prototype.writeValue=function(e){this.value=e},e.decorators=[{type:t.Component,args:[{selector:"sui-rating",template:'\n\n\n',styles:["\n:host.read-only .icon {\n cursor: auto\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_ratingClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.rating"]}],valueChange:[{type:t.Output}],maximum:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],onMouseout:[{type:t.HostListener,args:["mouseout"]}]},e}(),oo=function(e){function n(t){return e.call(this,t)||this}return io(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-rating",host:{"(valueChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:ro}]},n}(Et),so=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[i.FormsModule,n.CommonModule],declarations:[ro,oo],exports:[ro,oo]}]}],e.ctorParameters=function(){return[]},e}(),ao=function(){function e(e){this.componentFactory=e,this._optionClasses=!0,this.formatter=function(e){return""}}return Object.defineProperty(e.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-search-result",template:'\n\n\n'}]}],e.ctorParameters=function(){return[{type:Ht}]},e.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.result"]}],value:[{type:t.Input}],query:[{type:t.Input}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}]},e}(),co=function(){function e(e){void 0===e&&(e=!1);var t=this;this._options=[],this.optionsFilter=function(e,n){var i=t.toRegex(t._query);return i instanceof RegExp&&e.filter(function(e){return jt.Object.readValue(e,t._optionsField).toString().match(i)})},this.allowEmptyQuery=e,this.searchDelay=0,this.reset()}return Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e||[],this._optionsLookup=void 0,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{get:function(){return this._optionsLookup},set:function(e){this._optionsLookup=e,this._options=[],this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasItemLookup",{get:function(){return!!this.optionsLookup&&2===this.optionsLookup.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{get:function(){return this._optionsField},set:function(e){this._optionsField=e,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this._results},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this._isSearching},enumerable:!0,configurable:!0}),e.prototype.updateQueryDelayed=function(e,t){var n=this;void 0===t&&(t=function(){}),this._query=e,clearTimeout(this._searchDelayTimeout),this._searchDelayTimeout=window.setTimeout(function(){n.updateQuery(e,t)},this.searchDelay)},e.prototype.updateQuery=function(e,t){var n=this;if(void 0===t&&(t=function(){}),this._query=e,""===this._query&&!this.allowEmptyQuery)return t();if(this._resultsCache.hasOwnProperty(this._query))return this._results=this._resultsCache[this._query],t();if(this._optionsLookup){this._isSearching=!0;return void this._optionsLookup.call(void 0,this._query).then(function(e){return n._isSearching=!1,n.updateResults(e),t()}).catch(function(e){return n._isSearching=!1,t(e)})}var i=this.optionsFilter.call(void 0,this._options,this._query);return i&&this.updateResults(i),t()},e.prototype.updateResults=function(e){this._resultsCache[this._query]=e,this._results=e},e.prototype.initialLookup=function(e){return Array,this._optionsLookup(void 0,e)},e.prototype.toRegex=function(e){try{return new RegExp(e,"i")}catch(t){return e}},e.prototype.highlightMatches=function(e,t){var n=this.toRegex(t);return n instanceof RegExp?e.replace(n,function(e){return""+e+""}):e},e.prototype.reset=function(){this._results=[],this._resultsCache={},this._isSearching=!1,this.resetQueryOnChange&&this.updateQuery("")},e}(),uo=function(){function e(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._searchClasses=!0,this.hasIcon=!0,this.allowEmptyQuery=!1,this.resetQueryOnChange=!0,this.retainSelectedResult=!0,this.searchDelay=200,this.maxResults=7,this.onResultSelected=new t.EventEmitter,this.transition="scale",this.transitionDuration=200,this._documentClickListener=n.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resetQueryOnChange",{set:function(e){this.searchService.resetQueryOnChange=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowEmptyQuery",{get:function(){return this._allowEmptyQuery},set:function(e){this._allowEmptyQuery=e,this.searchService.allowEmptyQuery=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this.searchService.query},set:function(e){this.selectedResult=void 0,this.searchService.updateQueryDelayed(e,function(){})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{set:function(e){e&&(this.searchService.options=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{set:function(e){this.searchService.optionsLookup=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resultFormatter",{get:function(){var e=this;return this._resultFormatter?this._resultFormatter:this.searchService.optionsLookup?function(t){return e.readValue(t)}:function(t,n){return e.searchService.highlightMatches(e.readValue(t),n)}},set:function(e){this._resultFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"searchDelay",{set:function(e){this.searchService.searchDelay=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this.searchService.results.slice(0,this.maxResults)},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this._menu.service=this.dropdownService},e.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().search},e.prototype.select=function(e){this.onResultSelected.emit(e),this.dropdownService.setOpenState(!1),this.retainSelectedResult?(this.selectedResult=e,this.searchService.updateQuery(this.readValue(e))):this.searchService.updateQuery("")},e.prototype.onClick=function(e){this.open()},e.prototype.onFocusIn=function(){this.dropdownService.isAnimating||this.open()},e.prototype.open=function(){(this.searchService.query.length>0||this.allowEmptyQuery)&&this.dropdownService.setOpenState(!0)},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.dropdownService.setOpenState(!1)},e.prototype.onDocumentClick=function(e){this._element.nativeElement.contains(e.target)||this.dropdownService.setOpenState(!1)},e.prototype.readValue=function(e){return jt.Object.readValue(e,this.searchService.optionsField)},e.prototype.ngOnDestroy=function(){this._documentClickListener()},e.decorators=[{type:t.Component,args:[{selector:"sui-search",template:'\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n',styles:["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},e.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_searchClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.search"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],hasIcon:[{type:t.Input}],resetQueryOnChange:[{type:t.Input}],allowEmptyQuery:[{type:t.Input}],placeholder:[{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],optionsField:[{type:t.Input}],resultFormatter:[{type:t.Input}],resultTemplate:[{type:t.Input}],retainSelectedResult:[{type:t.Input}],searchDelay:[{type:t.Input}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],maxResults:[{type:t.Input}],onResultSelected:[{type:t.Output,args:["resultSelected"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),po=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,gt,rn],declarations:[uo,ao],exports:[uo]}]}],e.ctorParameters=function(){return[]},e}(),lo=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ho=function(e){function n(n,i,r){var o=e.call(this,n,i)||this;return o.changeDetector=r,o._optionClasses=!0,o.isActive=!1,o.onSelected=new t.EventEmitter,o.renderedText="",o.usesTemplate=!1,o}return lo(n,e),Object.defineProperty(n.prototype,"formatter",{set:function(e){this.usesTemplate?this.renderedText="":this.renderedText=e(this.value)},enumerable:!0,configurable:!0}),n.prototype.onClick=function(e){var t=this;e.eventHandled=!0,setTimeout(function(){return t.onSelected.emit(t.value)})},n.decorators=[{type:t.Component,args:[{selector:"sui-select-option",template:'\n\n\n'}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},n.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.item"]}],value:[{type:t.Input}],onSelected:[{type:t.Output}],isActive:[{type:t.HostBinding,args:["class.active"]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(Rr),fo=function(){function e(e,n){this._renderer=e,this._element=n,this.onQueryUpdated=new t.EventEmitter,this.onQueryKeyDown=new t.EventEmitter,this._searchClass=!0,this._autoComplete="off"}return Object.defineProperty(e.prototype,"query",{set:function(e){this._renderer.setProperty(this._element.nativeElement,"value",e)},enumerable:!0,configurable:!0}),e.prototype.updateQuery=function(e){this.onQueryUpdated.emit(e)},e.prototype.onKeyDown=function(e){this.onQueryKeyDown.emit(e)},e.prototype.focus=function(){var e=this;this._element.nativeElement.focus(),setTimeout(function(){return e._element.nativeElement.focus()})},e.decorators=[{type:t.Directive,args:[{selector:"input[suiSelectSearch]"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_searchClass:[{type:t.HostBinding,args:["class.search"]}],_autoComplete:[{type:t.HostBinding,args:["attr.autocomplete"]}],updateQuery:[{type:t.HostListener,args:["input",["$event.target.value"]]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}(),mo=function(){function n(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co(!0),this.isSearchable=!1,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._renderedSubscriptions=[],this.icon="dropdown",this.transition="slide down",this.transitionDuration=200,this.onTouched=new t.EventEmitter,this._documentKeyDownListener=n.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),this._selectClasses=!0}return Object.defineProperty(n.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isVisible",{get:function(){return this._menu.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_searchClass",{get:function(){return this.isSearchable&&!this.isSearchExternal},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"searchInput",{get:function(){return this._manualSearch||this._internalSearch},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tabIndex",{get:function(){return this.isDisabled?-1:this.dropdownService.isOpen&&this.isSearchExternal?-1:void 0!=this._tabIndex?this._tabIndex:this._searchClass?-1:0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isDisabled",{get:function(){return this.dropdownService.isDisabled},set:function(e){this.dropdownService.isDisabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"options",{set:function(e){e&&(this.searchService.options=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsLookup",{set:function(e){e&&(this.searchService.optionsLookup=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"filteredOptions",{get:function(){return this.searchService.results},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"query",{get:function(){return this.isSearchable?this.searchService.query:void 0},set:function(e){var t=this;void 0!=e&&(this.queryUpdateHook(),this.updateQuery(e),this._renderedOptions.forEach(function(e){return t.initialiseRenderedOption(e)}),this.searchInput&&(this.searchInput.query=e))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelField",{get:function(){return this.searchService.optionsField},set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelGetter",{get:function(){var e=this;return function(t){var n=jt.Object.readValue(t,e.labelField);return void 0!=n?n.toString():""}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valueGetter",{get:function(){var e=this;return function(t){return jt.Object.readValue(t,e.valueField)}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"configuredFormatter",{get:function(){var e=this;return this._optionFormatter?function(t){return e._optionFormatter(t,e.isSearchable?e.query:void 0)}:this.searchService.optionsLookup?function(t){return e.labelGetter(t)}:function(t){return e.searchService.highlightMatches(e.labelGetter(t),e.query||"")}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionFormatter",{set:function(e){this._optionFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),n.prototype.ngAfterContentInit=function(){var e=this;this._menu.service=this.dropdownService,this._menu.items=this._renderedOptions,this._manualSearch&&(this.isSearchable=!0,this.isSearchExternal=!0),this.searchInput&&(this.searchInput.onQueryUpdated.subscribe(function(t){return e.query=t}),this.searchInput.onQueryKeyDown.subscribe(function(t){return e.onQueryInputKeydown(t)})),this.onAvailableOptionsRendered(),this._renderedOptions.changes.subscribe(function(){return e.onAvailableOptionsRendered()})},n.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().select},n.prototype.optionsUpdateHook=function(){},n.prototype.queryUpdateHook=function(){},n.prototype.updateQuery=function(e){var t=this;this.searchService.updateQuery(e,function(){return t.dropdownService.setOpenState(!0)})},n.prototype.resetQuery=function(e){void 0===e&&(e=!0),e?(this.searchService.searchDelay=this._menu.menuTransitionDuration,this.searchService.updateQueryDelayed("")):this.searchService.updateQuery(""),this.searchInput&&(this.searchInput.query="")},n.prototype.onAvailableOptionsRendered=function(){var e=this;this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._renderedSubscriptions=[],this._renderedOptions.forEach(function(t){setTimeout(function(){return e.initialiseRenderedOption(t)}),e._renderedSubscriptions.push(t.onSelected.subscribe(function(){return e.selectOption(t.value)}))}),0!==this.searchService.options.length||this.searchService.optionsLookup||(this.options=this._renderedOptions.map(function(e){return e.value}))},n.prototype.initialiseRenderedOption=function(e){e.usesTemplate=!!this.optionTemplate,e.formatter=this.configuredFormatter,e.usesTemplate&&this.drawTemplate(e.templateSibling,e.value),e.changeDetector.markForCheck()},n.prototype.findOption=function(e,t){var n=this;return e.find(function(e){return t===n.valueGetter(e)})},n.prototype.onCaretClick=function(e){e.eventHandled||(e.eventHandled=!0,this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!this.dropdownService.isOpen),this.focus()))},n.prototype.onClick=function(e){e.eventHandled||this.dropdownService.isAnimating||(e.eventHandled=!0,this.dropdownService.setOpenState(!!this.isSearchable||!this.dropdownService.isOpen),this.focus())},n.prototype.onFocusIn=function(){this.dropdownService.isOpen||this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!0),this.focus())},n.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||(this.dropdownService.setOpenState(!1),this.onTouched.emit())},n.prototype.onKeyPress=function(t){t.keyCode===e.KeyCode.Enter&&this._element.nativeElement.click()},n.prototype.onDocumentKeyDown=function(t){this._element.nativeElement.contains(t.target)&&!this.dropdownService.isOpen&&t.keyCode===e.KeyCode.Down&&(this._element.nativeElement.click(),t.preventDefault())},n.prototype.onQueryInputKeydown=function(e){},n.prototype.focus=function(){this.isSearchable&&this.searchInput?this.searchInput.focus():this._element.nativeElement.focus()},n.prototype.drawTemplate=function(e,t){e.clear(),e.createEmbeddedView(this.optionTemplate,{$implicit:t,query:this.query})},n.prototype.ngOnDestroy=function(){this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._documentKeyDownListener()},n.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_renderedOptions:[{type:t.ContentChildren,args:[ho,{descendants:!0}]}],_selectClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dropdown"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isSearchable:[{type:t.Input}],_searchClass:[{type:t.HostBinding,args:["class.search"]}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],_internalSearch:[{type:t.ViewChild,args:[fo]}],_manualSearch:[{type:t.ContentChild,args:[fo]}],_tabIndex:[{type:t.Input,args:["tabindex"]}],tabIndex:[{type:t.HostBinding,args:["attr.tabindex"]}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],labelField:[{type:t.Input}],valueField:[{type:t.Input}],optionTemplate:[{type:t.Input}],optionFormatter:[{type:t.Input}],icon:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onTouched:[{type:t.Output,args:["touched"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}],onKeyPress:[{type:t.HostListener,args:["keypress",["$event"]]}]},n}(),go=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),yo=function(n){function i(i,r,o,s){var a=n.call(this,i,r,o)||this;return a.componentFactory=s,a._transitionController=new vt(!1,"inline-block"),a.setTransitionController(a._transitionController),a.onDeselected=new t.EventEmitter,a._labelClasses=!0,a._transitionController.animate(new yt("scale",100,e.TransitionDirection.In)),a}return go(i,n),Object.defineProperty(i.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),i.prototype.deselectOption=function(t){var n=this;t.eventHandled=!0,this._transitionController.animate(new yt("scale",100,e.TransitionDirection.Out,function(){return n.onDeselected.emit(n.value)}))},i.prototype.onClick=function(e){e.eventHandled=!0},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select-label",template:'\n\n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:Ht}]},i.propDecorators={_labelClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.label"]}],value:[{type:t.Input}],query:[{type:t.Input}],onDeselected:[{type:t.Output,args:["deselected"]}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},i}(bt),vo=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bo=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o.selectedOptions=[],o.selectedOptionsChange=new t.EventEmitter,o.hasLabels=!0,o._multiSelectClasses=!0,o}return vo(i,n),Object.defineProperty(i.prototype,"filteredOptions",{get:function(){var e=this;if(this.maxSelectedReached)return[];var t=this.searchService.results;return this.hasLabels?t.filter(function(t){return void 0==e.selectedOptions.find(function(e){return t===e})}):t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasLabels",{get:function(){return this._hasLabels},set:function(e){this._hasLabels=e}, -enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.multi.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxSelectedReached",{get:function(){return void 0!=this.maxSelected&&this.selectedOptions.length===this.maxSelected},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxSelectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.maxSelectedMessage,[["max",this.maxSelected.toString()]])},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.selectedMessage,[["count",this.selectedOptions.length.toString()]])},enumerable:!0,configurable:!0}),i.prototype.optionsUpdateHook=function(){var e=this;!this._writtenOptions&&this.selectedOptions.length>0&&this.writeValue(this.selectedOptions.map(function(t){return e.valueGetter(t)})),this._writtenOptions&&this.searchService.options.length>0&&(this.selectedOptions=this._writtenOptions.map(function(t){return e.findOption(e.searchService.options,t)}).filter(function(e){return void 0!=e}),this.selectedOptions.length===this._writtenOptions.length&&(this._writtenOptions=void 0))},i.prototype.initialiseRenderedOption=function(e){n.prototype.initialiseRenderedOption.call(this,e),e.isActive=!this.hasLabels&&-1!==this.selectedOptions.indexOf(e.value)},i.prototype.selectOption=function(e){var t=this;if(-1!==this.selectedOptions.indexOf(e))return void this.deselectOption(e);this.selectedOptions.push(e),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.resetQuery(!1),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.writeValue=function(e){var t=this;e instanceof Array?(this.searchService.options.length>0&&(this.selectedOptions=e.map(function(e){return t.findOption(t.searchService.options,e)}).filter(function(e){return void 0!=e})),e.length>0&&0===this.selectedOptions.length&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){return t.selectedOptions=e}):this._writtenOptions=e),0===e.length&&(this.selectedOptions=[])):this.selectedOptions=[]},i.prototype.deselectOption=function(e){var t=this;this.selectedOptions=this.selectedOptions.filter(function(t){return t!==e}),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.onQueryInputKeydown=function(t){t.keyCode===e.KeyCode.Backspace&&""===this.query&&this.selectedOptions.length>0&&this.deselectOption(this.selectedOptions[this.selectedOptions.length-1])},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select",template:'\n\x3c!-- Dropdown icon --\x3e\n\n\n\n\x3c!-- Multi-select labels --\x3e\n \n\n\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Helper text --\x3e\n
\n \n \x3c!-- Placeholder text --\x3e\n {{ placeholder }}\n \n \x3c!-- Summary shown when labels are hidden --\x3e\n {{ selectedMessage }}\n
\n\n\x3c!-- Select dropdown menu --\x3e\n\n',styles:["\n:host input.search {\n width: 12em !important;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},i.propDecorators={selectedOptionsChange:[{type:t.Output}],hasLabels:[{type:t.Input}],placeholder:[{type:t.Input}],maxSelected:[{type:t.Input}],_multiSelectClasses:[{type:t.HostBinding,args:["class.multiple"]}]},i}(mo),wo=function(e){function n(t){return e.call(this,t)||this}return vo(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-multi-select",host:{"(selectedOptionsChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:bo}]},n}(Et),_o=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Do=function(e){function n(n,i,r){var o=e.call(this,n,i,r)||this;return o.selectedOptionChange=new t.EventEmitter,o}return _o(n,e),Object.defineProperty(n.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.single.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),n.prototype.optionsUpdateHook=function(){!this._writtenOption&&this.selectedOption&&this.writeValue(this.valueGetter(this.selectedOption)),this._writtenOption&&this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,this._writtenOption),this.selectedOption&&(this._writtenOption=void 0,this.drawSelectedOption()))},n.prototype.queryUpdateHook=function(){this.selectedOption=void 0},n.prototype.selectOption=function(e){this.selectedOption=e,this.selectedOptionChange.emit(this.valueGetter(e)),this.dropdownService.setOpenState(!1),this.resetQuery(),this.drawSelectedOption(),this.focus()},n.prototype.writeValue=function(e){var t=this;void 0!=e?(this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,e),this.drawSelectedOption()),void 0==this.selectedOption&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){t.selectedOption=e,t.drawSelectedOption()}):this._writtenOption=e)):(this.selectedOption=void 0,this.drawSelectedOption())},n.prototype.initialiseRenderedOption=function(t){e.prototype.initialiseRenderedOption.call(this,t),t.isActive=t.value===this.selectedOption},n.prototype.drawSelectedOption=function(){this._renderedOptions&&this.onAvailableOptionsRendered(),void 0!=this.selectedOption&&this.optionTemplate&&this.drawTemplate(this._optionTemplateSibling,this.selectedOption)},n.decorators=[{type:t.Component,args:[{selector:"sui-select",template:'\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Placeholder text --\x3e\n
{{ placeholder }}
\n\x3c!-- Selected item --\x3e\n
\n \n \n
\n\x3c!-- Dropdown icon --\x3e\n\n\x3c!-- Select dropdown menu --\x3e\n\n'}]}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},n.propDecorators={_optionTemplateSibling:[{type:t.ViewChild,args:["optionTemplateSibling",{read:t.ViewContainerRef}]}],selectedOptionChange:[{type:t.Output}],placeholder:[{type:t.Input}]},n}(mo),Oo=function(e){function n(t){return e.call(this,t)||this}return _o(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-select",host:{"(selectedOptionChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:Do}]},n}(Et),Co=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,rn,gt],declarations:[Do,ho,fo,Oo,bo,yo,wo],exports:[Do,ho,fo,Oo,bo,wo]}]}],e.ctorParameters=function(){return[]},e}(),So={Overlay:"overlay",Push:"push",ScaleDown:"scale down",Uncover:"uncover",SlideAlong:"slide along",SlideOut:"slide out"},Mo={Left:"left",Right:"right",Top:"top",Bottom:"bottom"},To=function(){function e(e){void 0===e&&(e=!1),this.isVisible=e,this.isAnimating=!1,this.wasJustOpened=!1,this.isVisibleChange=new t.EventEmitter,this.widthChange=new t.EventEmitter,this.heightChange=new t.EventEmitter,this.width=260,this.height=0,this.transition=So.Uncover}return Object.defineProperty(e.prototype,"width",{get:function(){return this.direction===Mo.Left?this._width:this.direction===Mo.Right?-this._width:0},set:function(e){this._width=e,this.widthChange.emit()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.direction===Mo.Top?this._height:this.direction===Mo.Bottom?-this._height:0},set:function(e){this._height=e,this.heightChange.emit()},enumerable:!0,configurable:!0}),e.prototype.setVisibleState=function(e){var t=this;this.isVisible!==e&&(this.isVisible=e,this.isAnimating=!0,this.wasJustOpened=!0,this.isVisibleChange.emit(e),setTimeout(function(){return t.wasJustOpened=!1}),clearTimeout(this._isAnimatingTimeout),this._isAnimatingTimeout=window.setTimeout(function(){return t.isAnimating=!1},500))},e.prototype.toggleVisibleState=function(){this.setVisibleState(!this.isVisible)},e}(),ko=function(){function e(e,t){var n=this;this._renderer=e,this._element=t,this.service=new To,this.transition=So.Uncover,this.direction=Mo.Left,setTimeout(function(){return n.updateDimensions()}),this.service.isVisibleChange.subscribe(function(){return n.updateDimensions()}),this._sidebarClasses=!0}return Object.defineProperty(e.prototype,"transition",{get:function(){return this.service.transition},set:function(e){var t=this;this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!1)}),this.service.transition=e,this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!0)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"direction",{get:function(){return this.service.direction},set:function(e){this.setClass(this.service.direction,!1),this.service.direction=e,this.setClass(this.service.direction,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.service.isVisible},set:function(e){this.service.setVisibleState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisibleChange",{get:function(){return this.service.isVisibleChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAnimating",{get:function(){return this.service.isAnimating},enumerable:!0,configurable:!0}),e.prototype.updateDimensions=function(){this.service.width=this._element.nativeElement.offsetWidth,this.service.height=this._element.nativeElement.offsetHeight},e.prototype.setClass=function(e,t){void 0===t&&(t=!0),t?this._renderer.addClass(this._element.nativeElement,e):this._renderer.removeClass(this._element.nativeElement,e)},e.prototype.open=function(){this.service.setVisibleState(!0)},e.prototype.close=function(){this.service.setVisibleState(!1)},e.prototype.toggle=function(){this.service.toggleVisibleState()},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar",template:""}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_sidebarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.sidebar"]},{type:t.HostBinding,args:["class.menu"]}],transition:[{type:t.Input}],direction:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]},{type:t.Input}],isVisibleChange:[{type:t.Output}],isAnimating:[{type:t.HostBinding,args:["class.animating"]}]},e}(),Po=function(){function e(e,t){this._renderer=e,this._element=t,this.isDimmedWhenVisible=!1,this._siblingClasses=!0}return Object.defineProperty(e.prototype,"service",{get:function(){return this._service},set:function(e){var t=this;this._service=e,setTimeout(function(){return t.updateTransform()}),this._service.isVisibleChange.subscribe(function(){return t.updateTransform()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return!!this.service&&this.service.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDimmed",{get:function(){return!!this.service&&(this.service.isVisible&&this.isDimmedWhenVisible)},enumerable:!0,configurable:!0}),e.prototype.updateTransform=function(){if(this._renderer.removeStyle(this._element.nativeElement,"transform"),this._renderer.removeStyle(this._element.nativeElement,"-webkit-transform"),this.service.isVisible&&this.service.transition!==So.Overlay&&this.service.transition!==So.ScaleDown){var e="translate3d("+this.service.width+"px, "+this.service.height+"px, 0)";this._renderer.setStyle(this._element.nativeElement,"transform",e),this._renderer.setStyle(this._element.nativeElement,"-webkit-transform",e)}},e.prototype.onClick=function(e){this.service.isVisible&&!this.service.wasJustOpened&&this.service.setVisibleState(!1)},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-sibling",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={isDimmedWhenVisible:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isDimmed:[{type:t.HostBinding,args:["class.dimmed"]}],_siblingClasses:[{type:t.HostBinding,args:["class.pusher"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},e}(),xo=function(){function e(){this._containerClasses=!0}return e.prototype.ngAfterContentInit=function(){if(!this.sidebar)throw new Error("You must include a element within the container.");if(this.service=this.sidebar.service,!this.sibling)throw new Error("You must include a element within the container.");this.sibling.service=this.service},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-container",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_containerClasses:[{type:t.HostBinding,args:["class.pushable"]}],sidebar:[{type:t.ContentChild,args:[ko]}],sibling:[{type:t.ContentChild,args:[Po]}]},e}(),Io=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[ko,xo,Po],exports:[ko,xo,Po]}]}],e.ctorParameters=function(){return[]},e}(),Eo=function(){function e(e,t){var n=this;this.id=e.id,this.header=e,this.content=t,this.header.isActiveChange.subscribe(function(){return n.content.isActive=n.isActive})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.header.isActive},set:function(e){this.header.setActiveState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.header.isDisabled},enumerable:!0,configurable:!0}),e}(),Lo=function(){function e(){this._isActive=!1,this.isActiveChange=new t.EventEmitter,this.isActiveExternalChange=new t.EventEmitter,this.onActivate=new t.EventEmitter,this.onDeactivate=new t.EventEmitter,this.isDisabled=!1,this._headerClasses=!0}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},set:function(e){var t=this,n=e;setTimeout(function(){n=!t.isDisabled&&e,t.setActiveState(n),t.isActiveExternalChange.emit(n)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(e){this._isDisabled!==e&&(this._isDisabled=e,this.isDisabled&&(this.isActive=!1))},enumerable:!0,configurable:!0}),e.prototype.setActiveState=function(e){!!this._isActive!==e&&(this._isActive=e,e?this.onActivate.emit():this.onDeactivate.emit()),this.isActiveChange.emit(e)},e.prototype.onClick=function(){this.isDisabled||(this.isActive=!0)},e.decorators=[{type:t.Directive,args:[{selector:"[suiTabHeader]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_headerClasses:[{type:t.HostBinding,args:["class.item"]}],id:[{type:t.Input,args:["suiTabHeader"]}],isActiveChange:[{type:t.Output}],onActivate:[{type:t.Output,args:["activate"]}],onDeactivate:[{type:t.Output,args:["deactivate"]}],isActive:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},e}(),jo=function(){function e(){this.isActive=!1,this._contentClasses=!0}return e.decorators=[{type:t.Directive,args:[{selector:"[suiTabContent]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_contentClasses:[{type:t.HostBinding,args:["class.tab"]}],id:[{type:t.Input,args:["suiTabContent"]}],isActive:[{type:t.HostBinding,args:["class.active"]}]},e}(),Vo=function(){function e(){this.tabs=[],this._barrierCount=0}return Object.defineProperty(e.prototype,"activeTab",{get:function(){return this._activeTab},set:function(e){this._activeTab=e,e.isActive=!0},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this._tabHeaders.changes.subscribe(function(){return e.internalComponentsUpdated()}),this._tabContents.changes.subscribe(function(){return e.internalComponentsUpdated()}),this.loadTabs()},e.prototype.internalComponentsUpdated=function(){2===++this._barrierCount&&(this._barrierCount=0,this.loadTabs())},e.prototype.loadTabs=function(){var e=this;if(this.tabs=this.tabs.filter(function(t){return!!e._tabHeaders.find(function(e){return e===t.header})}),this._tabHeaders.filter(function(t){return!e.tabs.find(function(e){return e.header===t})}).forEach(function(t){var n=e._tabContents.find(function(e){return e.id===t.id});if(!n)throw new Error("A [suiTabHeader] must have a related [suiTabContent].");var i=new Eo(t,n);i.header.isActiveExternalChange.subscribe(function(){return e.onHeaderActiveChanged(i)}),e.tabs.push(i)}),this._tabHeaders.forEach(function(t,n){var i=e.tabs.find(function(e){return e.header===t});i&&(i.index=n)}),this.tabs.sort(function(e,t){return e.index-t.index}),this.activeTab?this.tabs.find(function(t){return t===e.activeTab})||setTimeout(function(){return e.activateClosestTab(e.activeTab)}):this.activateFirstTab(),0===this.tabs.length)throw new Error("You cannot have no tabs!")},e.prototype.onHeaderActiveChanged=function(e){e.isActive&&this.activeTab!==e&&(this.tabs.filter(function(t){return t!==e}).forEach(function(e){return e.isActive=!1}),this.activeTab=e),e.isActive||this.activeTab!==e||this.activateClosestTab(e)},e.prototype.activateFirstTab=function(){this.activeTab=this.tabs[0]},e.prototype.activateClosestTab=function(e){var t;if(e.index>=this.tabs.length&&(t=this.tabs[this.tabs.length-1]),t||(t=this.tabs.find(function(t){return t===e})?this.tabs[Math.max(e.index-1,0)]:this.tabs[e.index]),t.isDisabled)return this.activateClosestTab(t);this.activeTab=t},e.decorators=[{type:t.Component,args:[{selector:"sui-tabset",template:""}]}],e.ctorParameters=function(){return[]},e.propDecorators={_tabHeaders:[{type:t.ContentChildren,args:[Lo]}],_tabContents:[{type:t.ContentChildren,args:[jo]}]},e}(),Ho=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[Vo,Lo,jo],exports:[Vo,Lo,jo]}]}],e.ctorParameters=function(){return[]},e}(),Ro=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{exports:[Dt,Ct,xt,hn,Pt,xr,Lr,Yr,eo,er,no,so,po,Co,Io,Ho,wt,gt,rn]}]}],e.ctorParameters=function(){return[]},e}();e.SuiLocalizationService=mt,e.SuiLocalizationModule=gt,e.SuiMessage=_t,e.SuiMessageModule=Dt,e.SuiPagination=Ot,e.SuiPaginationModule=Ct,e.SuiAccordionPanel=St,e.SuiAccordion=Tt,e.SuiAccordionService=Mt,e.SuiAccordionModule=xt,e.SuiCheckbox=sn,e.SuiCheckboxValueAccessor=an,e.SuiRadio=un,e.SuiRadioValueAccessor=pn,e.SuiRadioManager=ln,e.SuiCheckboxModule=hn,e.SuiCollapse=kt,e.SuiCollapseModule=Pt,e.CalendarConfig=Sn,e.DateConfigBase=Mn,e.YearConfig=Tn,e.MonthConfig=kn,e.DateConfig=Pn,e.DatetimeConfig=xn,e.TimeConfig=In,e.CalendarMappings=vn,e.DateMappings=bn,e.TimeMappings=wn,e.DatetimeMappings=_n,e.MonthMappings=Dn,e.YearMappings=On,e.DateComparer=En,e.DateParser=Li,e.InternalDateParser=ji,e.SuiCalendarViewTitle=Ri,e.DatepickerMode=Ai,e.SuiDatepicker=Fi,e.CalendarItem=fn,e.SuiCalendarItem=mn,e.SuiDatepickerDirective=nr,e.SuiDatepickerDirectiveValueAccessor=ir,e.SuiDatepickerDirectiveValidator=rr,e.SuiDatepickerInputDirective=fr,e.DateFnsParser=Ii,e.CalendarRange=Vi,e.CalendarRangeService=Hi,e.CalendarService=dn,e.CalendarView=gn,e.CalendarRangeDateService=gr,e.SuiCalendarDateView=yr,e.CalendarRangeHourService=br,e.SuiCalendarHourView=wr,e.CalendarRangeMinuteService=Dr,e.SuiCalendarMinuteView=Or,e.CalendarRangeMonthService=Sr,e.SuiCalendarMonthView=Mr,e.CalendarRangeYearService=kr,e.SuiCalendarYearView=Pr,e.SuiDatepickerModule=xr,e.SuiDimmer=Er,e.SuiDimmerModule=Lr,e.SuiDropdownMenuItem=Rr,e.SuiDropdownMenu=Ar,e.SuiDropdown=Fr,e.DropdownAutoCloseType=jr,e.DropdownService=Vr,e.SuiDropdownModule=Yr,e.ActiveModal=Br,e.ModalSize=Ur,e.ModalConfig=zr,e.TemplateModalConfig=Wr,e.ComponentModalConfig=qr,e.ModalControls=Qr,e.Modal=$r,e.ModalTemplate=Jr,e.SuiModal=Zr,e.SuiModalService=Xr,e.SuiModalModule=eo,e.SuiPopupComponentController=Wi,e.PopupTrigger=Yi,e.PopupConfig=Bi,e.SuiPopupController=Ui,e.TemplatePopupConfig=Ki,e.SuiPopupTemplateController=Qi,e.SuiPopupArrow=$i,e.SuiPopup=Ni,e.SuiPopupDirective=Xi,e.SuiPopupConfig=Ji,e.SuiPopupModule=er,e.SuiProgress=to,e.SuiProgressModule=no,e.SuiRating=ro,e.SuiRatingValueAccessor=oo,e.SuiRatingModule=so,e.SuiSearchResult=ao,e.SuiSearch=uo,e.SearchService=co,e.SuiSearchModule=po,e.SuiSelectBase=mo,e.SuiMultiSelectLabel=yo,e.SuiMultiSelect=bo,e.SuiMultiSelectValueAccessor=wo,e.SuiSelectOption=ho,e.SuiSelect=Do,e.SuiSelectValueAccessor=Oo,e.SuiSelectSearch=fo,e.SuiSelectModule=Co,e.SuiSidebarContainer=xo,e.SuiSidebarSibling=Po,e.SuiSidebar=ko,e.SidebarTransition=So,e.SidebarDirection=Mo,e.SidebarService=To,e.SuiSidebarModule=Io,e.Tab=Eo,e.SuiTabset=Vo,e.SuiTabContent=jo,e.SuiTabHeader=Lo,e.SuiTabsModule=Ho,e.TransitionController=vt,e.Transition=yt,e.SuiTransition=bt,e.SuiTransitionModule=wt,e.CustomValidator=It,e.customValidatorFactory=a,e.CustomValueAccessor=Et,e.customValueAccessorFactory=c,e.DateUtil=Vt,e.HandledEvent=Lt,e.Util=jt,e.SuiComponentFactory=Ht,e.PositioningPlacement=tn,e.PositioningService=nn,e.SuiUtilityModule=rn,e.SuiModule=Ro,Object.defineProperty(e,"__esModule",{value:!0})}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/forms"],t):t(e["ng2-semantic-ui"]=e["ng2-semantic-ui"]||{},e._angular_core,e._angular_common,e._angular_forms)}(this,function(e,t,n,i){"use strict";function r(e){return JSON.parse(JSON.stringify(e))}function o(e,t){return(dt||ft)(!0,e,t)}function s(e){return e.toLowerCase().replace("-","")}function a(e){return{provide:i.NG_VALIDATORS,useExisting:t.forwardRef(function(){return e}),multi:!0}}function c(e){return{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef(function(){return e}),multi:!0}}function u(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function p(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},Ft))}}function l(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function h(e,t){if(1!==e.nodeType)return[];var n=getComputedStyle(e,null);return t?n[t]:n}function d(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function f(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=h(e),n=t.overflow,i=t.overflowX;return/(auto|scroll|overlay)/.test(n+t.overflowY+i)?e:f(d(e))}function m(e){if(!e)return document.documentElement;for(var t=zt(10)?document.body:null,n=e.offsetParent;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TD","TABLE"].indexOf(n.nodeName)&&"static"===h(n,"position")?m(n):n:e?e.ownerDocument.documentElement:document.documentElement}function g(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||m(e.firstElementChild)===e)}function y(e){return null!==e.parentNode?y(e.parentNode):e}function v(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?e:t,r=n?t:e,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var s=o.commonAncestorContainer;if(e!==s&&t!==s||i.contains(r))return g(s)?s:m(s);var a=y(e);return a.host?v(a.host,t):v(e,y(t).host)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",i=e.nodeName;if("BODY"===i||"HTML"===i){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[n]}return e[n]}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=b(t,"top"),r=b(t,"left"),o=n?-1:1;return e.top+=i*o,e.bottom+=i*o,e.left+=r*o,e.right+=r*o,e}function _(e,t){var n="x"===t?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+i+"Width"],10)}function D(e,t,n,i){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],zt(10)?n["offset"+e]+i["margin"+("Height"===e?"Top":"Left")]+i["margin"+("Height"===e?"Bottom":"Right")]:0)}function O(){var e=document.body,t=document.documentElement,n=zt(10)&&getComputedStyle(t);return{height:D("Height",e,t,n),width:D("Width",e,t,n)}}function C(e){return Kt({},e,{right:e.left+e.width,bottom:e.top+e.height})}function S(e){var t={};try{if(zt(10)){t=e.getBoundingClientRect();var n=b(e,"top"),i=b(e,"left");t.top+=n,t.left+=i,t.bottom+=n,t.right+=i}else t=e.getBoundingClientRect()}catch(e){}var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?O():{},s=o.width||e.clientWidth||r.right-r.left,a=o.height||e.clientHeight||r.bottom-r.top,c=e.offsetWidth-s,u=e.offsetHeight-a;if(c||u){var p=h(e);c-=_(p,"x"),u-=_(p,"y"),r.width-=c,r.height-=u}return C(r)}function M(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=zt(10),r="HTML"===t.nodeName,o=S(e),s=S(t),a=f(e),c=h(t),u=parseFloat(c.borderTopWidth,10),p=parseFloat(c.borderLeftWidth,10);n&&"HTML"===t.nodeName&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var l=C({top:o.top-s.top-u,left:o.left-s.left-p,width:o.width,height:o.height});if(l.marginTop=0,l.marginLeft=0,!i&&r){var d=parseFloat(c.marginTop,10),m=parseFloat(c.marginLeft,10);l.top-=u-d,l.bottom-=u-d,l.left-=p-m,l.right-=p-m,l.marginTop=d,l.marginLeft=m}return(i&&!n?t.contains(a):t===a&&"BODY"!==a.nodeName)&&(l=w(l,t)),l}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,i=M(e,n),r=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),s=t?0:b(n),a=t?0:b(n,"left");return C({top:s-i.top+i.marginTop,left:a-i.left+i.marginLeft,width:r,height:o})}function k(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===h(e,"position")||k(d(e)))}function P(e){if(!e||!e.parentElement||zt())return document.documentElement;for(var t=e.parentElement;t&&"none"===h(t,"transform");)t=t.parentElement;return t||document.documentElement}function x(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},s=r?P(e):v(e,t);if("viewport"===i)o=T(s,r);else{var a=void 0;"scrollParent"===i?(a=f(d(t)),"BODY"===a.nodeName&&(a=e.ownerDocument.documentElement)):a="window"===i?e.ownerDocument.documentElement:i;var c=M(a,s,r);if("HTML"!==a.nodeName||k(s))o=c;else{var u=O(),p=u.height,l=u.width;o.top+=c.top-c.marginTop,o.bottom=p+c.top,o.left+=c.left-c.marginLeft,o.right=l+c.left}}return o.left+=n,o.top+=n,o.right-=n,o.bottom-=n,o}function I(e){return e.width*e.height}function E(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var s=x(n,i,o,r),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},c=Object.keys(a).map(function(e){return Kt({key:e},a[e],{area:I(a[e])})}).sort(function(e,t){return t.area-e.area}),u=c.filter(function(e){var t=e.width,i=e.height;return t>=n.clientWidth&&i>=n.clientHeight}),p=u.length>0?u[0].key:c[0].key,l=e.split("-")[1];return p+(l?"-"+l:"")}function L(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return M(n,i?P(t):v(t,n),i)}function j(e){var t=getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+i,height:e.offsetHeight+n}}function V(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function H(e,t,n){n=n.split("-")[0];var i=j(e),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),s=o?"top":"left",a=o?"left":"top",c=o?"height":"width",u=o?"width":"height";return r[s]=t[s]+t[c]/2-i[c]/2,r[a]=n===a?t[a]-i[u]:t[V(a)],r}function R(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function A(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var i=R(e,function(e){return e[t]===n});return e.indexOf(i)}function F(e,t,n){return(void 0===n?e:e.slice(0,A(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&l(n)&&(t.offsets.popper=C(t.offsets.popper),t.offsets.reference=C(t.offsets.reference),t=n(t,e))}),t}function Y(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=E(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=H(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=F(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function B(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function N(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;is[f]&&(e.offsets.popper[l]+=a[l]+m-s[f]),e.offsets.popper=C(e.offsets.popper);var g=a[l]+a[u]/2-m/2,y=h(e.instance.popper),v=parseFloat(y["margin"+p],10),b=parseFloat(y["border"+p+"Width"],10),w=g-e.offsets.popper[l]-v-b;return w=Math.max(Math.min(s[u]-m,w),0),e.arrowElement=i,e.offsets.arrow=(n={},Qt(n,l,Math.round(w)),Qt(n,d,""),n),e}function re(e){return"end"===e?"start":"start"===e?"end":e}function oe(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Gt.indexOf(e),i=Gt.slice(n+1).concat(Gt.slice(0,n));return t?i.reverse():i}function se(e,t){if(B(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=x(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),i=e.placement.split("-")[0],r=V(i),o=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case Jt.FLIP:s=[i,r];break;case Jt.CLOCKWISE:s=oe(i);break;case Jt.COUNTERCLOCKWISE:s=oe(i,!0);break;default:s=t.behavior}return s.forEach(function(a,c){if(i!==a||s.length===c+1)return e;i=e.placement.split("-")[0],r=V(i);var u=e.offsets.popper,p=e.offsets.reference,l=Math.floor,h="left"===i&&l(u.right)>l(p.left)||"right"===i&&l(u.left)l(p.top)||"bottom"===i&&l(u.top)l(n.right),m=l(u.top)l(n.bottom),y="left"===i&&d||"right"===i&&f||"top"===i&&m||"bottom"===i&&g,v=-1!==["top","bottom"].indexOf(i),b=!!t.flipVariations&&(v&&"start"===o&&d||v&&"end"===o&&f||!v&&"start"===o&&m||!v&&"end"===o&&g);(h||y||b)&&(e.flipped=!0,(h||y)&&(i=s[c+1]),b&&(o=re(o)),e.placement=i+(o?"-"+o:""),e.offsets.popper=Kt({},e.offsets.popper,H(e.instance.popper,e.offsets.reference,e.placement)),e=F(e.instance.modifiers,e,"flip"))}),e}function ae(e){var t=e.offsets,n=t.popper,i=t.reference,r=e.placement.split("-")[0],o=Math.floor,s=-1!==["top","bottom"].indexOf(r),a=s?"right":"bottom",c=s?"left":"top",u=s?"width":"height";return n[a]o(i[a])&&(e.offsets.popper[c]=o(i[a])),e}function ce(e,t,n,i){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+r[1],s=r[2];if(!o)return e;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=i}return C(a)[t]/100*o}if("vh"===s||"vw"===s){return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}function ue(e,t,n,i){var r=[0,0],o=-1!==["right","left"].indexOf(i),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(R(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,u=-1!==a?[s.slice(0,a).concat([s[a].split(c)[0]]),[s[a].split(c)[1]].concat(s.slice(a+1))]:[s];return u=u.map(function(e,i){var r=(1===i?!o:o)?"height":"width",s=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return ce(e,r,t,n)})}),u.forEach(function(e,t){e.forEach(function(n,i){G(n)&&(r[t]+=n*("-"===e[i-1]?-1:1))})}),r}function pe(e,t){var n=t.offset,i=e.placement,r=e.offsets,o=r.popper,s=r.reference,a=i.split("-")[0],c=void 0;return c=G(+n)?[+n,0]:ue(n,o,s,a),"left"===a?(o.top+=c[0],o.left-=c[1]):"right"===a?(o.top+=c[0],o.left+=c[1]):"top"===a?(o.left+=c[0],o.top-=c[1]):"bottom"===a&&(o.left+=c[0],o.top+=c[1]),e.popper=o,e}function le(e,t){var n=t.boundariesElement||m(e.instance.popper);e.instance.reference===n&&(n=m(n));var i=x(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);t.boundaries=i;var r=t.priority,o=e.offsets.popper,s={primary:function(e){var n=o[e];return o[e]i[e]&&!t.escapeWithReference&&(r=Math.min(o[n],i[e]-("right"===e?o.width:o.height))),Qt({},n,r)}};return r.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";o=Kt({},o,s[t](e))}),e.offsets.popper=o,e}function he(e){var t=e.placement,n=t.split("-")[0],i=t.split("-")[1];if(i){var r=e.offsets,o=r.reference,s=r.popper,a=-1!==["bottom","top"].indexOf(n),c=a?"left":"top",u=a?"width":"height",p={start:Qt({},c,o[c]),end:Qt({},c,o[c]+o[u]-s[u])};e.offsets.popper=Kt({},s,p[i])}return e}function de(e){if(!ne(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=R(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right0?"in "+i:i+" ago":i}function Pe(e){return e.replace(Fn,function(e){return e.slice(1)})}function xe(e,t,n,i){return Bn[e]}function Ie(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}function Ee(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}function Le(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}function je(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}function Ve(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}function He(e){return parseInt(e[1],10)}function Re(e,t){var n=ye(e,t),i=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime(),o=i-r;return Math.floor(o/ti)+1}function Ae(e,t){var n=ye(e,t),i=n.getUTCDay(),r=(i<1?7:0)+i-1;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function Fe(e,t){var n=ye(e,t),i=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(i+1,0,4),r.setUTCHours(0,0,0,0);var o=Ae(r,t),s=new Date(0);s.setUTCFullYear(i,0,4),s.setUTCHours(0,0,0,0);var a=Ae(s,t);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Ye(e,t){var n=Fe(e,t),i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),Ae(i,t)}function Be(e,t){var n=ye(e,t),i=Ae(n,t).getTime()-Ye(n,t).getTime();return Math.round(i/ni)+1}function Ne(e,t){t=t||"";var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;return n+Ue(r,2)+t+Ue(o,2)}function Ue(e,t){for(var n=Math.abs(e).toString();n.length=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=ye(e,n),u=Number(t),p=c.getUTCDay(),l=u%7,h=(l+7)%7,d=(h=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=o.locale||ei,c=a.parsers||{},u=a.units||{};if(!a.match)throw new RangeError("locale must contain match property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var p=String(t).replace(hi,function(e){return"["===e[0]?e:"\\"===e[0]?nt(e):a.formatLong(e)});if(""===p)return""===r?ye(n,o):new Date(NaN);var l=Se(o);l.locale=a;var h,d=p.match(a.parsingTokensRegExp||di),f=d.length,m=[{priority:pi,set:tt,index:0}];for(h=0;h\n \n \n\n',styles:["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"]}]}],n.ctorParameters=function(){return[]},n.propDecorators={isDismissable:[{type:t.Input}],onDismiss:[{type:t.Output,args:["dismiss"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],class:[{type:t.Input,args:["class"]}]},n}(),Dt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[_t],exports:[_t]}]}],e.ctorParameters=function(){return[]},e}(),Ot=function(){function e(){this._paginationClasses=!0,this.pageChange=new t.EventEmitter,this.pageSize=10,this._page=1,this._pages=[],this.pageCount=1,this.hasNavigationLinks=!0,this.hasBoundaryLinks=!1,this.canRotate=!1,this.hasEllipses=!0}return Object.defineProperty(e.prototype,"maxSize",{get:function(){return this._maxSize},set:function(e){this._maxSize=void 0!=e?Math.max(e,1):void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collectionSize",{get:function(){return this._collectionSize},set:function(e){this._collectionSize=Math.max(e,0),this.pageCount=Math.max(1,Math.ceil(this._collectionSize/this.pageSize))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNavigationLinks",{get:function(){var e=this._maxSize||this.pageCount;return this._hasNavigationLinks||e1},e.prototype.hasNext=function(){return this.page\n \n\n\n \n\n\n \n 1\n \n ...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n',styles:["\n:host .item {\n transition: none;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_paginationClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.pagination"]},{type:t.HostBinding,args:["class.menu"]}],pageChange:[{type:t.Output}],maxSize:[{type:t.Input}],pageSize:[{type:t.Input}],collectionSize:[{type:t.Input}],hasNavigationLinks:[{type:t.Input}],hasBoundaryLinks:[{type:t.Input}],canRotate:[{type:t.Input}],hasEllipses:[{type:t.Input}],page:[{type:t.Input}]},e}(),Ct=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],exports:[Ot],declarations:[Ot],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),St=function(){function e(e){this._changeDetector=e,this.transitionController=new vt(!1),this._isOpen=!1,this.isOpenChange=new t.EventEmitter(!1)}return Object.defineProperty(e.prototype,"service",{set:function(e){this._service=e,this._changeDetector.detectChanges()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},set:function(e){var t=!!e;t!==this.isOpen&&(this._isOpen=t,t&&this._service&&this._service.closeOtherPanels(this),this.isOpenChange.emit(this.isOpen),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.transition,this.transitionDuration)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{get:function(){return this._service?this._service.transition:"fade"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{get:function(){return this._service?this._service.transitionDuration:0},enumerable:!0,configurable:!0}),e.prototype.toggle=function(){this.isDisabled||(this.isOpen=!this.isOpen)},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion-panel",exportAs:"suiAccordionPanel",template:'\n\x3c!-- Title --\x3e\n
\n \n
\n\x3c!-- Content --\x3e\n
\n
\n \n
\n
\n',styles:["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},e.propDecorators={isDisabled:[{type:t.Input}],isOpen:[{type:t.Input}],isOpenChange:[{type:t.Output}]},e}(),Mt=function(){function e(){this.closeOthers=!0,this.transition="fade",this.transitionDuration=350,this.panels=[]}return e.prototype.addPanel=function(e){e.service=this,this.panels.push(e)},e.prototype.closeOtherPanels=function(e){this.closeOthers&&this.panels.forEach(function(t){t!==e&&(t.isOpen=!1)})},e}(),Tt=function(){function e(){this._service=new Mt,this.accordionClasses=!0}return Object.defineProperty(e.prototype,"closeOthers",{get:function(){return this._service.closeOthers},set:function(e){this._service.closeOthers=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{set:function(e){this._service.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{set:function(e){this._service.transitionDuration=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.updatePanels(),this._panels.changes.subscribe(function(){return e.updatePanels()})},e.prototype.updatePanels=function(){var e=this;this._panels.forEach(function(t){return e._service.addPanel(t)})},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion",template:"\n\n",styles:["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={accordionClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.accordion"]}],closeOthers:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],_panels:[{type:t.ContentChildren,args:[St]}]},e}(),kt=function(){function e(e,t){this._element=e,this._renderer=t,this._pristine=!0,this.collapseDuration=350,this._isExpanded=!1,this._isCollapsing=!1}return Object.defineProperty(e.prototype,"_isCollapsed",{get:function(){return!this._isExpanded&&!this._isCollapsing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suiCollapse",{get:function(){return this._isExpanded},set:function(e){e?this.hide():this.show()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_animationDuration",{get:function(){return this._pristine?0:this.collapseDuration},enumerable:!0,configurable:!0}),e.prototype.hide=function(){var e=this;this._isCollapsing=!0,this._isExpanded=!1,this._renderer.setStyle(this._element.nativeElement,"overflow","hidden"),this.animate(this._element.nativeElement.scrollHeight,0,!1,function(){e._isCollapsing=!1})},e.prototype.show=function(){var e=this;this._isCollapsing=!0,this.animate(this._element.nativeElement.offsetHeight,this._element.nativeElement.scrollHeight,!0,function(){e._renderer.removeStyle(e._element.nativeElement,"overflow"),e._isCollapsing=!1,e._isExpanded=!0})},e.prototype.animate=function(e,t,n,i){void 0===n&&(n=!1),void 0===i&&(i=function(){});var r=[{offset:0,height:e+"px"},{offset:1,height:t+"px"}];n&&r.push({offset:1,height:"auto"}),this._element.nativeElement.animate(r,{delay:0,duration:this._animationDuration,iterations:1,easing:"ease",fill:"both"}),this._pristine&&(this._pristine=!1),setTimeout(function(){return i()},this.collapseDuration)},e.decorators=[{type:t.Directive,args:[{selector:"[suiCollapse]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e.propDecorators={_isExpanded:[{type:t.HostBinding,args:["class.expanded"]}],_isCollapsed:[{type:t.HostBinding,args:["class.collapsed"]}],_isCollapsing:[{type:t.HostBinding,args:["class.collapsing"]}],suiCollapse:[{type:t.Input}],collapseDuration:[{type:t.Input}]},e}(),Pt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[kt],exports:[kt]}]}],e.ctorParameters=function(){return[]},e}(),xt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Pt,wt],declarations:[Tt,St],exports:[Tt,St],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),It=function(){function e(e){this._host=e,this.onValidatorChange=function(){}}return e.prototype.validate=function(e){return this._host.validate(e)},e.prototype.registerOnValidatorChange=function(e){this.onValidatorChange=e},e}(),Et=function(){function e(e){this._host=e,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){this._host.writeValue(e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e}();!function(e){e[e.Left=37]="Left",e[e.Up=38]="Up",e[e.Right=39]="Right",e[e.Down=40]="Down",e[e.Escape=27]="Escape",e[e.Enter=13]="Enter",e[e.Space=32]="Space",e[e.Backspace=8]="Backspace"}(e.KeyCode||(e.KeyCode={}));var Lt=function(){function e(){}return e}(),jt={Array:{range:function(e,t){return void 0===t&&(t=0),Array(e).fill(0).map(function(e,n){return n+t})},group:function(e,t){for(var n=e.slice(0),i=[];n.length>0;)i.push(n.splice(0,t));return i},groupBy:function(e,t){return e.reduce(function(e,n){var i=n[t].toString();return e[i]=e[i]||[],e[i].push(n),e},Object())},flatten:function(e){return e.reduce(function(e,t){return e.concat(t)},[])}},String:{padLeft:function(e,t,n){for(var i=e;i.length=0){Ft=1;break}var Bt=Rt&&window.Promise,Nt=Bt?u:p,Ut={},zt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";if(e=e.toString(),Ut.hasOwnProperty(e))return Ut[e];switch(e){case"11":Ut[e]=-1!==navigator.userAgent.indexOf("Trident");break;case"10":Ut[e]=-1!==navigator.appVersion.indexOf("MSIE 10");break;case"all":Ut[e]=-1!==navigator.userAgent.indexOf("Trident")||-1!==navigator.userAgent.indexOf("MSIE")}return Ut.all=Ut.all||Object.keys(Ut).some(function(e){return Ut[e]}),Ut[e]},Wt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},qt=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Wt(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=Nt(this.update.bind(this)),this.options=Kt({},e.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(Kt({},e.Defaults.modifiers,r.modifiers)).forEach(function(t){i.options.modifiers[t]=Kt({},e.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return Kt({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&l(e.onLoad)&&e.onLoad(i.reference,i.popper,i.options,e,i.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return qt(e,[{key:"update",value:function(){return Y.call(this)}},{key:"destroy",value:function(){return U.call(this)}},{key:"enableEventListeners",value:function(){return Q.call(this)}},{key:"disableEventListeners",value:function(){return $.call(this)}}]),e}();en.Utils=("undefined"!=typeof window?window:global).PopperUtils,en.placements=$t,en.Defaults=Xt;var tn={Auto:"auto",TopLeft:"top left",Top:"top",TopRight:"top right",LeftTop:"left top",Left:"left",LeftBottom:"left bottom",BottomLeft:"bottom left",Bottom:"bottom",BottomRight:"bottom right",RightTop:"right top",Right:"right",RightBottom:"right bottom"},nn=function(){function e(e,t,n,i){var r=this;this.anchor=e,this.subject=t,this._placement=n;var o={computeStyle:{gpuAcceleration:!1},preventOverflow:{escapeWithReference:!0,boundariesElement:document.body},arrow:{element:i}};i||delete o.arrow,this._popper=new en(e.nativeElement,t.nativeElement,{placement:me(n),modifiers:o,onCreate:function(e){return r._popperState=e},onUpdate:function(e){return r._popperState=e}})}return Object.defineProperty(e.prototype,"placement",{get:function(){return this._placement},set:function(e){this._placement=e,this._popper.options.placement=me(e),this.update()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"actualPlacement",{get:function(){return this._popperState?ge(this._popperState.placement):tn.Auto},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._popperState},enumerable:!0,configurable:!0}),e.prototype.update=function(){this._popper.update()},e.prototype.destroy=function(){this._popper.destroy()},e}(),rn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],providers:[Ht]}]}],e.ctorParameters=function(){return[]},e}(),on=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),sn=function(){function e(){this.isChecked=!1,this.onCheckChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._checkboxClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.toggle(),this.focusCheckbox())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.toggle=function(){this.isChecked=!this.isChecked,this.onCheckChange.emit(this.isChecked)},e.prototype.writeValue=function(e){this.isChecked=e},e.prototype.focusCheckbox=function(){this._checkboxElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-checkbox",exportAs:"suiCheckbox",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_checkboxClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCheckChange:[{type:t.Output,args:["checkChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_checkboxElement:[{type:t.ViewChild,args:["checkbox"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),an=function(e){function n(t){return e.call(this,t)||this}return on(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-checkbox",host:{"(checkChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:sn}]},n}(Et),cn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),un=function(){function e(){this._radioClasses=!0,this.isChecked=!1,this.onCurrentValueChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._radioClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.currentValue=this.value,this.onCurrentValueChange.emit(this.currentValue),this.update(),this.focusRadio())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.update=function(){this.isChecked=this.currentValue===this.value},e.prototype.writeValue=function(e){this.currentValue=e,this.update()},e.prototype.focusRadio=function(){this._radioElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-radio-button",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_radioClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.radio"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],value:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCurrentValueChange:[{type:t.Output,args:["currentValueChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_radioElement:[{type:t.ViewChild,args:["radio"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),pn=function(e){function n(t){return e.call(this,t)||this}return cn(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-radio-button",host:{"(currentValueChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:un}]},n}(Et),ln=function(){function e(e){this.element=e,this.isNested=!1,this._radioSubs=[]}return e.prototype.ngAfterContentInit=function(){var e=this;this.updateNesting(),this._subManagers.changes.subscribe(function(){return e.updateNesting()}),this.updateRadios(),this._renderedRadios.changes.subscribe(function(){return e.updateRadios()})},e.prototype.updateNesting=function(){var e=this;this._subManagers.filter(function(t){return t!==e}).forEach(function(e){return e.isNested=!0})},e.prototype.updateRadios=function(){var e=this;this._radioSubs.forEach(function(e){return e.unsubscribe()}),this._radioSubs=[];var t=jt.Array.groupBy(this._renderedRadios.toArray(),"name");Object.keys(t).map(function(e){return t[e]}).forEach(function(t){return t.forEach(function(n){return e._radioSubs.push(n.onCurrentValueChange.subscribe(function(n){e.isNested||t.forEach(function(e){return e.writeValue(n)})}))})})},e.decorators=[{type:t.Directive,args:[{selector:"form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={_subManagers:[{type:t.ContentChildren,args:[e,{descendants:!0}]}],_renderedRadios:[{type:t.ContentChildren,args:[un,{descendants:!0}]}]},e}(),hn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule],declarations:[sn,an,un,pn,ln],exports:[sn,an,un,pn,ln]}]}],e.ctorParameters=function(){return[]},e}();!function(e){e[e.DateOnly=0]="DateOnly",e[e.TimeOnly=1]="TimeOnly",e[e.Both=2]="Both"}(e.CalendarMode||(e.CalendarMode={}));var dn=function(){function e(e,n){this.localeValues=n,this.onManualUpdate=function(){},this.config=e,this.currentDate=new Date,this.firstDayOfWeek=this.localeValues.firstDayOfWeek,this.onDateChange=new t.EventEmitter,this.reset()}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},set:function(e){this._config=e,e.updateBounds(this._selectedDate||this.currentDate)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inFinalView",{get:function(){return this.currentView===this.config.mappings.finalView},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){e?(this._selectedDate=Vt.clone(e),this.currentDate=Vt.clone(e)):this._selectedDate=void 0,this.config.updateBounds(this._selectedDate||this.currentDate),this.onManualUpdate()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){ +return this._minDate&&this.config.dateMinBound?this._minDate>this.config.dateMinBound?this._minDate:this.config.dateMinBound:this._minDate||this.config.dateMinBound},set:function(e){this._minDate=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate&&this.config.dateMaxBound?this._maxDate=this.ranges.current.inRange.length&&(i=!0),!o){var s=this.ranges.current.findIndex(this._highlightedItem),a=this.ranges.calc(i).inRange;if(i?s-=this.ranges.current.inRange.length:s+=a.length,o=a[s+r],o.isDisabled)return}this.ranges.move(i),this._highlightedItem=this.ranges.current.find(o)}},n.prototype.ngOnDestroy=function(){this._documentKeyDownListener()},n.propDecorators={_renderedItems:[{type:t.ViewChildren,args:[mn]}],service:[{type:t.Input}]},n}(),yn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vn=function(){function e(){}return e}(),bn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Date,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Date]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month]]),n}return yn(n,t),n}(vn),wn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Hour,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),_n=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Hour],[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month],[e.CalendarViewType.Hour,e.CalendarViewType.Date],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),Dn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Month,n.finalView=e.CalendarViewType.Month,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Month]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),On=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Year,n.finalView=e.CalendarViewType.Year,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),Cn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sn=function(){function t(e,t,n,i){this.mode=e,this.precision=t,this.mappings=n,this.fallback=i}return t.prototype.updateBounds=function(t){this.dateMinBound=Vt.startOf(e.DatePrecision.Year,new Date,!0),this.dateMinBound.setFullYear(0)},t}(),Mn=function(t){function n(n,i,r){return t.call(this,e.CalendarMode.DateOnly,n,i,r)||this}return Cn(n,t),n}(Sn),Tn=function(t){function n(){return t.call(this,e.DatePrecision.Year,new On,"number")||this}return Cn(n,t),n}(Mn),kn=function(t){function n(){return t.call(this,e.DatePrecision.Month,new Dn,"month")||this}return Cn(n,t),n}(Mn),Pn=function(t){function n(){return t.call(this,e.DatePrecision.Date,new bn,"date")||this}return Cn(n,t),n}(Mn),xn=function(t){function n(){return t.call(this,e.CalendarMode.Both,e.DatePrecision.Minute,new _n,"datetime-local")||this}return Cn(n,t),n}(Sn),In=function(t){function n(){return t.call(this,e.CalendarMode.TimeOnly,e.DatePrecision.Minute,new wn,"time")||this}return Cn(n,t),n.prototype.updateBounds=function(t){this.dateMaxBound=Vt.endOf(e.DatePrecision.Date,Vt.clone(t)),this.dateMinBound=Vt.previous(e.DatePrecision.Date,Vt.clone(this.dateMaxBound))},n}(Sn),En=function(){function t(e,t){this._precision=e,this._isSmallest=t}return t.prototype.equal=function(t,n){return this._precision===e.DatePrecision.Minute?!!n&&Vt.equal(e.DatePrecision.Hour,n,t)&&jt.Math.roundDown(n.getMinutes(),5)===jt.Math.roundDown(t.getMinutes(),5):!!n&&Vt.equal(this._precision,t,n)},t.prototype.lessThan=function(e,t){return this._isSmallest?!t||t>=e:!t||Vt.endOf(this._precision,Vt.clone(t))>=e},t.prototype.greaterThan=function(e,t){return this._isSmallest?!t||t<=e:!t||Vt.startOf(this._precision,Vt.clone(t))<=e},t.prototype.between=function(e,t,n){return this.greaterThan(e,t)&&this.lessThan(e,n)},t}(),Ln=36e5,jn=6e4,Vn=2,Hn={dateTimeDelimeter:/[T ]/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-])(\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/},Rn=6e4,An={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Fn=/MMMM|MM|DD|dddd/g,Yn=function(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||Pe(e.L),ll:e.ll||Pe(e.LL),lll:e.lll||Pe(e.LLL),llll:e.llll||Pe(e.LLLL)};return function(e){return t[e]}}({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"}),Bn={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"},Nn={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Un={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},zn={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},Wn={ordinalNumber:Le,weekday:Ie(Nn,"long"),weekdays:Ee(Nn,"long"),month:Ie(Un,"long"),months:Ee(Un,"long"),timeOfDay:Ie(zn,"long",function(e){return e/12>=1?1:0}),timesOfDay:Ee(zn,"long")},qn=/^(\d+)(th|st|nd|rd)?/i,Qn={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Kn={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$n={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Gn={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Jn={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},Zn={any:[/^a/i,/^p/i]},Xn={ordinalNumbers:function(e){return function(t){return String(t).match(e)}}(qn),ordinalNumber:He,weekdays:je(Qn,"long"),weekday:Ve(Kn,"any"),months:je($n,"long"),month:Ve(Gn,"any"),timesOfDay:je(Jn,"long"),timeOfDay:Ve(Zn,"any")},ei={formatDistance:ke,formatLong:Yn,formatRelative:xe,localize:Wn,match:Xn,options:{weekStartsOn:0,firstWeekContainsDate:1}},ti=864e5,ni=6048e5,ii={M:function(e){return e.getUTCMonth()+1},Mo:function(e,t){var n=e.getUTCMonth()+1;return t.locale.localize.ordinalNumber(n,{unit:"month"})},MM:function(e){return Ue(e.getUTCMonth()+1,2)},MMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"short"})},MMMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"long"})},Q:function(e){return Math.ceil((e.getUTCMonth()+1)/3)},Qo:function(e,t){var n=Math.ceil((e.getUTCMonth()+1)/3);return t.locale.localize.ordinalNumber(n,{unit:"quarter"})},D:function(e){return e.getUTCDate()},Do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDate(),{unit:"dayOfMonth"})},DD:function(e){return Ue(e.getUTCDate(),2)},DDD:function(e){return Re(e)},DDDo:function(e,t){return t.locale.localize.ordinalNumber(Re(e),{unit:"dayOfYear"})},DDDD:function(e){return Ue(Re(e),3)},dd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"narrow"})},ddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"short"})},dddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"long"})},d:function(e){return e.getUTCDay()},do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDay(),{unit:"dayOfWeek"})},E:function(e){return e.getUTCDay()||7},W:function(e){return Be(e)},Wo:function(e,t){return t.locale.localize.ordinalNumber(Be(e),{unit:"isoWeek"})},WW:function(e){return Ue(Be(e),2)},YY:function(e){return Ue(e.getUTCFullYear(),4).substr(2)},YYYY:function(e){return Ue(e.getUTCFullYear(),4)},GG:function(e){return String(Fe(e)).substr(2)},GGGG:function(e){return Fe(e)},H:function(e){return e.getUTCHours()},HH:function(e){return Ue(e.getUTCHours(),2)},h:function(e){var t=e.getUTCHours();return 0===t?12:t>12?t%12:t},hh:function(e){return Ue(ii.h(e),2)},m:function(e){return e.getUTCMinutes()},mm:function(e){return Ue(e.getUTCMinutes(),2)},s:function(e){return e.getUTCSeconds()},ss:function(e){return Ue(e.getUTCSeconds(),2)},S:function(e){return Math.floor(e.getUTCMilliseconds()/100)},SS:function(e){return Ue(Math.floor(e.getUTCMilliseconds()/10),2)},SSS:function(e){return Ue(e.getUTCMilliseconds(),3)},Z:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset(),":")},ZZ:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset())},X:function(e,t){var n=t._originalDate||e;return Math.floor(n.getTime()/1e3)},x:function(e,t){return(t._originalDate||e).getTime()},A:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"uppercase"})},a:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"lowercase"})},aa:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"long"})}},ri=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,oi=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,si={M:/^(1[0-2]|0?\d)/,D:/^(3[0-1]|[0-2]?\d)/,DDD:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,W:/^(5[0-3]|[0-4]?\d)/,YYYY:/^(\d{1,4})/,H:/^(2[0-3]|[0-1]?\d)/,m:/^([0-5]?\d)/,Z:/^([+-])(\d{2}):(\d{2})/,ZZ:/^([+-])(\d{2})(\d{2})/,singleDigit:/^(\d)/,twoDigits:/^(\d{2})/,threeDigits:/^(\d{3})/,fourDigits:/^(\d{4})/,anyDigits:/^(\d+)/},ai={YY:{unit:"twoDigitYear",match:si.twoDigits,parse:function(e){return Ke(e)}},YYYY:{unit:"year",match:si.YYYY,parse:Ke},GG:{unit:"isoYear",match:si.twoDigits,parse:function(e){return Ke(e)+1900}},GGGG:{unit:"isoYear",match:si.YYYY,parse:Ke},Q:{unit:"quarter",match:si.singleDigit,parse:Ke},Qo:{unit:"quarter",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"quarter"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"quarter"})}},M:{unit:"month",match:si.M,parse:function(e){return Ke(e)-1}},Mo:{unit:"month",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"month"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"month"})-1}},MM:{unit:"month",match:si.twoDigits,parse:function(e){return Ke(e)-1}},MMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"short"})},parse:function(e,t){return t.locale.match.month(e,{type:"short"})}},MMMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"long"})||t.locale.match.months(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.month(e,{type:"long"});return null==n&&(n=t.locale.match.month(e,{type:"short"})),n}},W:{unit:"isoWeek",match:si.W,parse:Ke},Wo:{unit:"isoWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"isoWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"isoWeek"})}},WW:{unit:"isoWeek",match:si.twoDigits,parse:Ke},d:{unit:"dayOfWeek",match:si.singleDigit,parse:Ke},do:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfWeek"})}},dd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){return t.locale.match.weekday(e,{type:"narrow"})}},ddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"short"});return null==n&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},dddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"long"})||t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"long"});return null==n&&null==(n=t.locale.match.weekday(e,{type:"short"}))&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},E:{unit:"dayOfISOWeek",match:si.singleDigit,parse:function(e){return Ke(e)}},D:{unit:"dayOfMonth",match:si.D,parse:Ke},Do:{unit:"dayOfMonth",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfMonth"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfMonth"})}},DD:{unit:"dayOfMonth",match:si.twoDigits,parse:Ke},DDD:{unit:"dayOfYear",match:si.DDD,parse:Ke},DDDo:{unit:"dayOfYear",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfYear"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfYear"})}},DDDD:{unit:"dayOfYear",match:si.threeDigits,parse:Ke},A:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){return t.locale.match.timeOfDay(e,{type:"short"})}},aa:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"long"})||t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.timeOfDay(e,{type:"long"});return null==n&&(n=t.locale.match.timeOfDay(e,{type:"short"})),n}},H:{unit:"hours",match:si.H,parse:Ke},HH:{unit:"hours",match:si.twoDigits,parse:Ke},h:{unit:"timeOfDayHours",match:si.M,parse:Ke},hh:{unit:"timeOfDayHours",match:si.twoDigits,parse:Ke},m:{unit:"minutes",match:si.m,parse:Ke},mm:{unit:"minutes",match:si.twoDigits,parse:Ke},s:{unit:"seconds",match:si.m,parse:Ke},ss:{unit:"seconds",match:si.twoDigits,parse:Ke},S:{unit:"milliseconds",match:si.singleDigit,parse:function(e){return 100*Ke(e)}},SS:{unit:"milliseconds",match:si.twoDigits,parse:function(e){return 10*Ke(e)}},SSS:{unit:"milliseconds",match:si.threeDigits,parse:Ke},Z:{unit:"timezone",match:si.Z,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},ZZ:{unit:"timezone",match:si.ZZ,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},X:{unit:"timestamp",match:si.anyDigits,parse:function(e){return 1e3*Ke(e)}},x:{unit:"timestamp",match:si.anyDigits,parse:Ke}};ai.a=ai.A;var ci=864e5,ui={twoDigitYear:{priority:10,set:function(e,t){var n=Math.floor(e.date.getUTCFullYear()/100),i=100*n+t;return e.date.setUTCFullYear(i,0,1),e.date.setUTCHours(0,0,0,0),e}},year:{priority:10,set:function(e,t){return e.date.setUTCFullYear(t,0,1),e.date.setUTCHours(0,0,0,0),e}},isoYear:{priority:10,set:function(e,t,n){return e.date=Ye(Ze(e.date,t,n),n),e}},quarter:{priority:20,set:function(e,t){return e.date.setUTCMonth(3*(t-1),1),e.date.setUTCHours(0,0,0,0),e}},month:{priority:30,set:function(e,t){return e.date.setUTCMonth(t,1),e.date.setUTCHours(0,0,0,0),e}},isoWeek:{priority:40,set:function(e,t,n){return e.date=Ae(Je(e.date,t,n),n),e}},dayOfWeek:{priority:50,set:function(e,t,n){return e.date=$e(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfISOWeek:{priority:50,set:function(e,t,n){return e.date=Ge(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfMonth:{priority:50,set:function(e,t){return e.date.setUTCDate(t),e.date.setUTCHours(0,0,0,0),e}},dayOfYear:{priority:50,set:function(e,t){return e.date.setUTCMonth(0,t),e.date.setUTCHours(0,0,0,0),e}},timeOfDay:{priority:60,set:function(e,t,n){return e.timeOfDay=t,e}},hours:{priority:70,set:function(e,t,n){return e.date.setUTCHours(t,0,0,0),e}},timeOfDayHours:{priority:70,set:function(e,t,n){var i=e.timeOfDay;return null!=i&&(t=Xe(t,i)),e.date.setUTCHours(t,0,0,0),e}},minutes:{priority:80,set:function(e,t){return e.date.setUTCMinutes(t,0,0),e}},seconds:{priority:90,set:function(e,t){return e.date.setUTCSeconds(t,0),e}},milliseconds:{priority:100,set:function(e,t){return e.date.setUTCMilliseconds(t),e}},timezone:{priority:110,set:function(e,t){return e.date=new Date(e.date.getTime()-6e4*t),e}},timestamp:{priority:120,set:function(e,t){return e.date=new Date(t),e}}},pi=110,li=6e4,hi=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,di=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,fi="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},mi=it(function(e,t){function n(e,t,n){n=n||{};var r;return r="string"==typeof i[e]?i[e]:1===t?i[e].one:i[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};e.exports=t.default}),gi=it(function(e,t){function n(e){return e.replace(r,function(e){return e.slice(1)})}function i(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||n(e.L),ll:e.ll||n(e.LL),lll:e.lll||n(e.LLL),llll:e.llll||n(e.LLLL)};return function(e){return t[e]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=/MMMM|MM|DD|dddd/g;e.exports=t.default}),yi=it(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=gi,i=function(e){return e&&e.__esModule?e:{default:e}}(n),r=(0,i.default)({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"});t.default=r,e.exports=t.default}),vi=it(function(e,t){function n(e,t,n,r){return i[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"};e.exports=t.default}),bi=it(function(e,t){function n(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),wi=it(function(e,t){function n(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),_i=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}Object.defineProperty(t,"__esModule",{value:!0});var r=bi,o=n(r),s=wi,a=n(s),c={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},p={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},l={ordinalNumber:i,weekday:(0,o.default)(c,"long"),weekdays:(0,a.default)(c,"long"),month:(0,o.default)(u,"long"),months:(0,a.default)(u,"long"),timeOfDay:(0,o.default)(p,"long",function(e){return e/12>=1?1:0}),timesOfDay:(0,a.default)(p,"long")};t.default=l,e.exports=t.default}),Di=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Oi=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Ci=it(function(e,t){function n(e){return function(t){return String(t).match(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Si=it(function(e,t){function n(e){return parseInt(e[1],10)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Mi=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Di,r=n(i),o=Oi,s=n(o),a=Ci,c=n(a),u=Si,p=n(u),l=/^(\d+)(th|st|nd|rd)?/i,h={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},d={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},f={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},m={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},g={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},y={any:[/^a/i,/^p/i]},v={ordinalNumbers:(0,c.default)(l),ordinalNumber:p.default,weekdays:(0,r.default)(h,"long"),weekday:(0,s.default)(d,"any"),months:(0,r.default)(f,"long"),month:(0,s.default)(m,"any"),timesOfDay:(0,r.default)(g,"long"),timeOfDay:(0,s.default)(y,"any")};t.default=v,e.exports=t.default}),Ti=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=mi,r=n(i),o=yi,s=n(o),a=vi,c=n(a),u=_i,p=n(u),l=Mi,h=n(l),d={formatDistance:r.default,formatLong:s.default,formatRelative:c.default,localize:p.default,match:h.default,options:{weekStartsOn:0,firstWeekContainsDate:1}};t.default=d,e.exports=t.default}),ki=function(e){return e&&e.__esModule?e.default:e}(Ti),Pi=Object.freeze({default:ki,__moduleExports:Ti}),xi=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=1?1:0}),timesOfDay:ot(i,"long")}),this._locale.match=xi({},this._locale.match,{weekdays:st(t,"long"),weekday:at(t,"long"),months:st(n,"long"),month:at(n,"long"),timesOfDay:st(r,"long"),timeOfDay:at(r,"long")})}return Object.defineProperty(e.prototype,"_config",{get:function(){return{weekStartsOn:this._weekStartsOn,locale:this._locale}},enumerable:!0,configurable:!0}),e.prototype.format=function(e,t){return We(e,t,this._config)},e.prototype.parse=function(e,t,n){return et(e,t,n,this._config)},e}(),Ei=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Li=function(){function e(e,t){this._format=e,this._parser=new Ii(t)}return e.prototype.format=function(e){return this._parser.format(e,this._format)},e.prototype.parse=function(e,t){return void 0===t&&(t=new Date),this._parser.parse(e,this._format,t)},e}(),ji=function(e){function t(t,n){var i={time:"HH:mm",datetime:"YYYY-MM-DDTHH:mm",date:"YYYY-MM-DD",month:"YYYY-MM",year:"YYYY"};return e.call(this,i[t],n)||this}return Ei(t,e),t}(Li),Vi=function(){function e(e,t,n,i,r){this.start=e,this.dates=t,this.items=n,this.groupedItems=i,this._comparer=r}return Object.defineProperty(e.prototype,"inRange",{get:function(){return this.items.filter(function(e){return!e.isOutsideRange})},enumerable:!0,configurable:!0}),e.prototype.find=function(e){var t=this;return this.items.find(function(n){return t._comparer.equal(n.date,e.date)})},e.prototype.findIndex=function(e){var t=this +;return e?this.items.findIndex(function(n){return t._comparer.equal(n.date,e.date)}):-1},e.prototype.containsDate=function(e){var t=this;return!!this.inRange.find(function(n){return t._comparer.equal(n.date,e)})},e}(),Hi=function(){function e(e,t,n){this.interval=e,this.marginal=e+1,this.rows=t,this.columns=n}return Object.defineProperty(e.prototype,"dateComparer",{get:function(){return new En(this.marginal,this.service.inFinalView)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.rows*this.columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMoveNext",{get:function(){var e=this.next.inRange[0];return!e||!this.service.maxDate||e.date<=this.service.maxDate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMovePrevious",{get:function(){var e=this.previous.inRange.slice(-1).pop();return!e||!this.service.minDate||e.date>=this.service.minDate},enumerable:!0,configurable:!0}),e.prototype.loadService=function(e){this.service=e,this.refresh()},e.prototype.refresh=function(){this.current=this.calcRange(this.service.currentDate),this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate))),this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.move=function(e){return e?this.moveNext():this.movePrevious()},e.prototype.moveNext=function(){Vt.next(this.interval,this.service.currentDate),this.previous=this.current,this.current=this.next,this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.movePrevious=function(){Vt.previous(this.interval,this.service.currentDate),this.next=this.current,this.current=this.previous,this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.calc=function(e){return e?this.next:this.previous},e.prototype.calcRange=function(e){var t=this.calcStart(e);this.service.inFinalView&&Vt.startOf(this.marginal,t,!0);var n=this.calcDates(t),i=this.calcItems(n,e);return new Vi(t,n,i,jt.Array.group(i,this.columns),this.dateComparer)},e.prototype.calcStart=function(e){return Vt.startOf(this.interval,Vt.clone(e))},e.prototype.calcDates=function(e){var t=this;return jt.Array.range(this.length).map(function(n){return Vt.add(t.marginal,Vt.clone(e),n)})},e.prototype.calcItems=function(e,t){var n=this;return e.map(function(e){var i=new fn(e);return i.isDisabled=!n.dateComparer.between(i.date,n.service.minDate,n.service.maxDate),i.isActive=n.dateComparer.equal(i.date,n.service.selectedDate),i.isToday=n.dateComparer.equal(i.date,new Date),i.isSelectable=i.isDisabled,n.configureItem(i,t),i})},e}(),Ri=function(){function e(){this.onZoomOut=new t.EventEmitter}return e.decorators=[{type:t.Component,args:[{selector:"sui-calendar-view-title",template:'\n\n \n\n\n \n\n\n \n\n',styles:["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={ranges:[{type:t.Input}],onZoomOut:[{type:t.Output,args:["zoomOut"]}]},e}(),Ai={Year:"year",Month:"month",Date:"date",Datetime:"datetime",Time:"time"},Fi=function(){function e(e){this.service=new dn(new xn,e.get().datepicker),this._calendarClasses=!0}return e.prototype.onMouseDown=function(e){e.preventDefault()},e.decorators=[{type:t.Component,args:[{selector:"sui-datepicker",template:'\n\n \n \n \n \n \n\n',styles:["\n:host {\n user-select: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:mt}]},e.propDecorators={_calendarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.active"]},{type:t.HostBinding,args:["class.calendar"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}]},e}(),Yi={Hover:"hover",Click:"click",OutsideClick:"outsideClick",Focus:"focus",Manual:"manual"},Bi=function(){function e(e){void 0===e&&(e={}),this.placement=tn.TopLeft,this.trigger=Yi.Hover,this.isInverted=!1,this.delay=0,this.isBasic=!1,this.transition="scale",this.transitionDuration=200,Object.assign(this,e)}return e}(),Ni=function(){function n(e){this.elementRef=e,this.transitionController=new vt(!1),this._isOpen=!1,this.onOpen=new t.EventEmitter,this.onClose=new t.EventEmitter,this._tabindex=0}return Object.defineProperty(n.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"anchor",{set:function(e){this.positioningService=new nn(e,this._container.element,this.config.placement,".dynamic.arrow")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"direction",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"alignment",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").pop()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dynamicClasses",{get:function(){var e={};return this.direction&&(e[this.direction]=!0),this.alignment&&(e[this.alignment]=!0),this.config.isInverted&&(e.inverted=!0),this.config.isBasic&&(e.basic=!0),e},enumerable:!0,configurable:!0}),n.prototype.open=function(){var t=this;this.isOpen||(clearTimeout(this.closingTimeout),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.In,function(){var e=t.elementRef.nativeElement.querySelector("[autofocus]");e&&(setTimeout(function(){return e.focus()},10),setTimeout(function(){return e.focus()},t.config.transitionDuration))})),this.positioningService.placement=this.config.placement,setTimeout(function(){return t.positioningService.update()}),this._isOpen=!0,this.onOpen.emit())},n.prototype.toggle=function(){return this.isOpen?this.close():this.open()},n.prototype.close=function(){var t=this;this.isOpen&&(this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.Out)),clearTimeout(this.closingTimeout),this.closingTimeout=window.setTimeout(function(){return t.onClose.emit()},this.config.transitionDuration),this._isOpen=!1)},n.prototype.onClick=function(e){e.stopPropagation()},n.decorators=[{type:t.Component,args:[{selector:"sui-popup",template:'\n\n',styles:['\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor\'s mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed \'vertically\'. */\n.ui.popup[direction="top"],\n.ui.popup[direction="bottom"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed \'horizontally\'. */\n.ui.popup[direction="left"],\n.ui.popup[direction="right"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n']}]}],n.ctorParameters=function(){return[{type:t.ElementRef}]},n.propDecorators={_container:[{type:t.ViewChild,args:["container",{read:t.ViewContainerRef}]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],_tabindex:[{type:t.HostBinding,args:["attr.tabindex"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(),Ui=function(){function e(e,t,n,i){var r=this;this._element=t,this._componentFactory=n,this._componentRef=this._componentFactory.createComponent(Ni),this.popup.config=i,this.popup.onClose.subscribe(function(){return r.cleanup()}),this._documentListener=e.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"popup",{get:function(){return this._componentRef.instance},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){e&&Object.assign(this.popup.config,e)},e.prototype.openDelayed=function(){var e=this;clearTimeout(this._openingTimeout),this._openingTimeout=window.setTimeout(function(){return e.open()},this.popup.config.delay)},e.prototype.open=function(){this._componentFactory.attachToApplication(this._componentRef),this._componentFactory.moveToDocumentBody(this._componentRef),this.popup.anchor=this._element,this.popup.open();var e=this.popupOnOpen;e&&e.call(this)},e.prototype.close=function(){clearTimeout(this._openingTimeout),this._componentRef&&this.popup.close();var e=this.popupOnClose;e&&e.call(this)},e.prototype.toggleDelayed=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.openDelayed():this.close()},e.prototype.toggle=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.open():this.close()},e.prototype.onMouseEnter=function(){this.popup.config.trigger===Yi.Hover&&this.openDelayed()},e.prototype.onMouseLeave=function(){this.popup.config.trigger===Yi.Hover&&this.close()},e.prototype.onClick=function(){this.popup.config.trigger===Yi.Click||this.popup.config.trigger===Yi.OutsideClick?this.toggleDelayed():this.popup.config.trigger!==Yi.Focus||this._componentRef&&(!this._componentRef||this.popup.isOpen)||this.openDelayed()},e.prototype.onDocumentClick=function(e){if(this._componentRef&&this.popup.config.trigger===Yi.OutsideClick){var t=e.target;this._element.nativeElement.contains(t)||this.close()}},e.prototype.onFocusIn=function(){this.popup.config.trigger===Yi.Focus&&this.openDelayed()},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.popup.elementRef.nativeElement.contains(e.relatedTarget)||this.popup.config.trigger!==Yi.Focus||this.close()},e.prototype.cleanup=function(){clearTimeout(this._openingTimeout),this._componentRef.instance&&this._componentRef.instance.positioningService&&this._componentRef.instance.positioningService.destroy(),this._componentFactory.detachFromApplication(this._componentRef)},e.prototype.ngOnDestroy=function(){this.cleanup(),this._documentListener()},e.propDecorators={onMouseEnter:[{type:t.HostListener,args:["mouseenter"]}],onMouseLeave:[{type:t.HostListener,args:["mouseleave"]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wi=function(e){function t(t,n,i,r,o){var s=e.call(this,t,n,i,o)||this;return s._component=r,s}return zi(t,e),Object.defineProperty(t.prototype,"componentInstance",{get:function(){if(this._contentComponentRef)return this._contentComponentRef.instance},enumerable:!0,configurable:!0}),t.prototype.open=function(){this._contentComponentRef||(this._contentComponentRef=this._componentFactory.createComponent(this._component),this._componentFactory.attachToView(this._contentComponentRef,this.popup.templateSibling)),e.prototype.open.call(this)},t.prototype.cleanup=function(){e.prototype.cleanup.call(this),this._contentComponentRef&&(this._contentComponentRef.destroy(),this._contentComponentRef=void 0)},t}(Ui),qi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Qi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return qi(t,e),t}(Bi),Ki=function(e){function t(t,n,i,r){return e.call(this,t,n,i,r)||this}return qi(t,e),t.prototype.configure=function(t){e.prototype.configure.call(this,t),t&&(this.template=t.template,this.context=t.context)},t.prototype.open=function(){this.template&&(this.popup.templateSibling.clear(),this._componentFactory.createView(this.popup.templateSibling,this.template,{$implicit:this.popup,context:this.context})),e.prototype.open.call(this)},t}(Ui),$i=function(){function e(){}return Object.defineProperty(e.prototype,"direction",{get:function(){if(this.placement)return this.placement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){if(this.placement){var e=this.placement.split(" ").pop();return e===this.direction?"center":e}},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-popup-arrow",template:'\n
\n
\n',styles:['\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction="top"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction="left"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction="bottom"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction="right"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction="bottom"][alignment="left"],\n.static.arrow[direction="top"][alignment="left"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction="left"][alignment="top"],\n.static.arrow[direction="right"][alignment="top"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction="bottom"][alignment="right"],\n.static.arrow[direction="top"][alignment="right"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction="left"][alignment="bottom"],\n.static.arrow[direction="right"][alignment="bottom"] {\n top: auto;\n bottom: 1em;\n}\n']}]}],e.ctorParameters=function(){return[]},e.propDecorators={placement:[{type:t.Input}],inverted:[{type:t.HostBinding,args:["class.inverted"]},{type:t.Input}]},e}(),Gi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ji=function(e){function n(){return e.call(this)||this}return Gi(n,e),n.decorators=[{type:t.Injectable}],n.ctorParameters=function(){return[]},n}(Bi),Zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xi=function(e){function n(t,n,i,r){return e.call(this,t,n,i,new Bi(r))||this}return Zi(n,e),Object.defineProperty(n.prototype,"popupHeader",{set:function(e){this.popup.config.header=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupText",{set:function(e){this.popup.config.text=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupInverted",{set:function(e){this.popup.config.isInverted=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupBasic",{set:function(e){this.popup.config.isBasic=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupPlacement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupDelay",{set:function(e){this.popup.config.delay=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTrigger",{get:function(){return this.popup.config.trigger},set:function(e){this.popup.config.trigger=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplate",{set:function(e){this.template=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplateContext",{set:function(e){this.context=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupConfig",{set:function(e){this.configure(e)},enumerable:!0,configurable:!0}),n.decorators=[{type:t.Directive,args:[{selector:"[suiPopup]",exportAs:"suiPopup"}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:Ji}]},n.propDecorators={popupHeader:[{type:t.Input}],popupText:[{type:t.Input}],popupInverted:[{type:t.Input}],popupBasic:[{type:t.Input}],popupTransition:[{type:t.Input}],popupTransitionDuration:[{type:t.Input}],popupPlacement:[{type:t.Input}],popupDelay:[{type:t.Input}],popupTrigger:[{type:t.Input}],popupTemplate:[{type:t.Input}],popupTemplateContext:[{type:t.Input}],popupConfig:[{type:t.Input}]},n}(Ki),er=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt,rn],declarations:[Xi,$i,Ni],exports:[Xi,Ni],providers:[Ji],entryComponents:[Ni]}]}],e.ctorParameters=function(){return[]},e}(),tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),nr=function(n){function i(e,i,r,o){var s=n.call(this,e,i,r,Fi,new Bi({trigger:Yi.Focus,placement:tn.BottomLeft,transition:"scale",transitionDuration:200}))||this;return s.renderer=e,s.localizationService=o,s.renderer.addClass(s.popup.elementRef.nativeElement,"ui"),s.renderer.addClass(s.popup.elementRef.nativeElement,"calendar"),s.onLocaleUpdate(),s.localizationService.onLanguageUpdate.subscribe(function(){return s.onLocaleUpdate()}),s.onSelectedDateChange=new t.EventEmitter,s.onValidatorChange=new t.EventEmitter,s.mode=Ai.Datetime,s}return tr(i,n),Object.defineProperty(i.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){this._selectedDate=e,this.onSelectedDateChange.emit(e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mode",{get:function(){return this._mode},set:function(e){switch(this._mode=e||Ai.Datetime,this._mode){case Ai.Year:this.config=new Tn;break;case Ai.Month:this.config=new kn;break;case Ai.Date:default:this.config=new Pn;break;case Ai.Datetime:this.config=new xn;break;case Ai.Time:this.config=new In}this.writeValue(this.selectedDate)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localeValues",{get:function(){return this.localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),i.prototype.popupOnOpen=function(){var e=this;this.componentInstance&&(this.componentInstance.service.config=this.config,this.componentInstance.service.localeValues=this.localeValues,this.componentInstance.service.currentDate=this.initialDate||new Date,this.componentInstance.service.selectedDate=this.selectedDate,this.componentInstance.service.maxDate=this.maxDate,this.componentInstance.service.minDate=this.minDate,void 0!=this.firstDayOfWeek&&(this.componentInstance.service.firstDayOfWeek=this.firstDayOfWeek),this.componentInstance.service.reset(),this.componentInstance.service.onDateChange.subscribe(function(t){e.selectedDate=t,e.close()}))},i.prototype.ngOnChanges=function(e){var t=e.maxDate,n=e.minDate,i=e.mode;(t||n||i)&&this.onValidatorChange.emit()},i.prototype.onLocaleUpdate=function(){this._localeValues=this.localizationService.get().datepicker},i.prototype.validate=function(e){var t=e.value;if(void 0!=t){if(this.minDate&&tthis.maxDate)return{suiMaxDate:{required:this.maxDate,actual:t}}}return null},i.prototype.writeValue=function(e){this.selectedDate=e,this.componentInstance&&(this.componentInstance.service.selectedDate=e)},i.prototype.onKeyDown=function(t){t.keyCode===e.KeyCode.Escape&&this.close()},i.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",providers:[a(i)]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:mt}]},i.propDecorators={mode:[{type:t.Input,args:["pickerMode"]}],initialDate:[{type:t.Input,args:["pickerInitialDate"]}],maxDate:[{type:t.Input,args:["pickerMaxDate"]}],minDate:[{type:t.Input,args:["pickerMinDate"]}],firstDayOfWeek:[{type:t.Input,args:["pickerFirstDayOfWeek"]}],localeOverrides:[{type:t.Input,args:["pickerLocaleOverrides"]}],placement:[{type:t.Input,args:["pickerPlacement"]}],transition:[{type:t.Input,args:["pickerTransition"]}],transitionDuration:[{type:t.Input,args:["pickerTransitionDuration"]}],onSelectedDateChange:[{type:t.Output,args:["pickerSelectedDateChange"]}],onValidatorChange:[{type:t.Output,args:["pickerValidatorChange"]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},i}(Wi),ir=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerSelectedDateChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(Et),rr=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerValidatorChange)":"onValidatorChange()"},providers:[a(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(It),or=it(function(e){!function(t,n,i){e.exports?e.exports=i():t.bowser=i()}(fi,0,function(){function e(e){function t(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}function n(t){var n=e.match(t);return n&&n.length>1&&n[2]||""}var i,r=t(/(ipod|iphone|ipad)/i).toLowerCase(),o=/like android/i.test(e),a=!o&&/android/i.test(e),c=/nexus\s*[0-6]\s*/i.test(e),u=!c&&/nexus\s*[0-9]+/i.test(e),p=/CrOS/.test(e),l=/silk/i.test(e),h=/sailfish/i.test(e),d=/tizen/i.test(e),f=/(web|hpw)os/i.test(e),m=/windows phone/i.test(e),g=(/SamsungBrowser/i.test(e),!m&&/windows/i.test(e)),y=!r&&!l&&/macintosh/i.test(e),v=!a&&!h&&!d&&!f&&/linux/i.test(e),b=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),w=t(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(e)&&!/tablet pc/i.test(e),D=!_&&/[^-]mobi/i.test(e),O=/xbox/i.test(e);/opera/i.test(e)?i={name:"Opera",opera:s,version:w||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?i={name:"Opera",opera:s,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||w}:/SamsungBrowser/i.test(e)?i={name:"Samsung Internet for Android",samsungBrowser:s,version:w||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?i={name:"Opera Coast",coast:s,version:w||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?i={name:"Yandex Browser",yandexbrowser:s,version:w||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?i={name:"UC Browser",ucbrowser:s,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?i={name:"Maxthon",maxthon:s,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?i={name:"Epiphany",epiphany:s,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?i={name:"Puffin",puffin:s,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?i={name:"Sleipnir",sleipnir:s,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?i={name:"K-Meleon",kMeleon:s,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:m?(i={name:"Windows Phone",osname:"Windows Phone",windowsphone:s},b?(i.msedge=s,i.version=b):(i.msie=s,i.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?i={name:"Internet Explorer",msie:s,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:p?i={name:"Chrome",osname:"Chrome OS",chromeos:s,chromeBook:s,chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(e)?i={name:"Microsoft Edge",msedge:s,version:b}:/vivaldi/i.test(e)?i={name:"Vivaldi",vivaldi:s,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||w}:h?i={name:"Sailfish",osname:"Sailfish OS",sailfish:s,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?i={name:"SeaMonkey",seamonkey:s,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(i={name:"Firefox",firefox:s,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(i.firefoxos=s,i.osname="Firefox OS")):l?i={name:"Amazon Silk",silk:s,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?i={name:"PhantomJS",phantom:s,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?i={name:"SlimerJS",slimer:s,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?i={name:"BlackBerry",osname:"BlackBerry OS",blackberry:s,version:w||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:f?(i={name:"WebOS",osname:"WebOS",webos:s,version:w||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(i.touchpad=s)):/bada/i.test(e)?i={name:"Bada",osname:"Bada",bada:s,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:d?i={name:"Tizen",osname:"Tizen",tizen:s,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||w}:/qupzilla/i.test(e)?i={name:"QupZilla",qupzilla:s,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||w}:/chromium/i.test(e)?i={name:"Chromium",chromium:s,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||w}:/chrome|crios|crmo/i.test(e)?i={name:"Chrome",chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:a?i={name:"Android",version:w}:/safari|applewebkit/i.test(e)?(i={name:"Safari",safari:s},w&&(i.version=w)):r?(i={name:"iphone"==r?"iPhone":"ipad"==r?"iPad":"iPod"},w&&(i.version=w)):i=/googlebot/i.test(e)?{name:"Googlebot",googlebot:s,version:t(/googlebot\/(\d+(\.\d+))/i)||w}:{name:t(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!i.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(i.name=i.name||"Blink",i.blink=s):(i.name=i.name||"Webkit",i.webkit=s),!i.version&&w&&(i.version=w)):!i.opera&&/gecko\//i.test(e)&&(i.name=i.name||"Gecko",i.gecko=s,i.version=i.version||t(/gecko\/(\d+(\.\d+)?)/i)),i.windowsphone||!a&&!i.silk?!i.windowsphone&&r?(i[r]=s,i.ios=s,i.osname="iOS"):y?(i.mac=s,i.osname="macOS"):O?(i.xbox=s,i.osname="Xbox"):g?(i.windows=s,i.osname="Windows"):v&&(i.linux=s,i.osname="Linux"):(i.android=s,i.osname="Android");var C="";i.windows?C=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)):i.windowsphone?C=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):i.mac?(C=t(/Mac OS X (\d+([_\.\s]\d+)*)/i),C=C.replace(/[_\s]/g,".")):r?(C=t(/os (\d+([_\s]\d+)*) like mac os x/i),C=C.replace(/[_\s]/g,".")):a?C=t(/android[ \/-](\d+(\.\d+)*)/i):i.webos?C=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):i.blackberry?C=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):i.bada?C=t(/bada\/(\d+(\.\d+)*)/i):i.tizen&&(C=t(/tizen[\/\s](\d+(\.\d+)*)/i)),C&&(i.osversion=C);var S=!i.windows&&C.split(".")[0];return _||u||"ipad"==r||a&&(3==S||S>=4&&!D)||i.silk?i.tablet=s:(D||"iphone"==r||"ipod"==r||a||c||i.blackberry||i.webos||i.bada)&&(i.mobile=s),i.msedge||i.msie&&i.version>=10||i.yandexbrowser&&i.version>=15||i.vivaldi&&i.version>=1||i.chrome&&i.version>=20||i.samsungBrowser&&i.version>=4||i.firefox&&i.version>=20||i.safari&&i.version>=6||i.opera&&i.version>=10||i.ios&&i.osversion&&i.osversion.split(".")[0]>=6||i.blackberry&&i.version>=10.1||i.chromium&&i.version>=20?i.a=s:i.msie&&i.version<10||i.chrome&&i.version<20||i.firefox&&i.version<20||i.safari&&i.version<6||i.opera&&i.version<10||i.ios&&i.osversion&&i.osversion.split(".")[0]<6||i.chromium&&i.version<20?i.c=s:i.x=s,i}function t(e){return e.split(".").length}function n(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n=0;){if(r[0][i]>r[1][i])return 1;if(r[0][i]!==r[1][i])return-1;if(0===i)return 0}}function r(t,n,r){var o=a;"string"==typeof n&&(r=n,n=void 0),void 0===n&&(n=!1),r&&(o=e(r));var s=""+o.version;for(var c in t)if(t.hasOwnProperty(c)&&o[c]){if("string"!=typeof t[c])throw new Error("Browser version in the minVersion map should be a string: "+c+": "+String(t));return i([s,t[c]])<0}return n}function o(e,t,n){return!r(e,t,n)}var s=!0,a=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return a.test=function(e){for(var t=0;t\n\n \n \n \n {{ date }}\n \n \n \n \n {{ day }}\n \n\n\n \n {{ item.humanReadable }}\n \n \n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),vr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),br=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vr(t,e),t.prototype.configureItem=function(e,t){var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");e.humanReadable=new Li(n,this.service.localeValues).format(e.date),e.isOutsideRange=!1},t}(Hi),wr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Hour,new br(e.DatePrecision.Date,6,4))||this}return vr(i,n),Object.defineProperty(i.prototype,"date",{get:function(){return new Li(this.service.localeValues.formats.date,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-hour-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),_r=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Dr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _r(n,t),n.prototype.calcStart=function(t){return Vt.startOf(e.DatePrecision.Hour,Vt.clone(t),!0)},n.prototype.calcDates=function(t){return jt.Array.range(this.length).map(function(n){return Vt.add(e.DatePrecision.Minute,Vt.clone(t),5*n)})},n.prototype.configureItem=function(e,t){e.humanReadable=new Li(this.service.localeValues.formats.time,this.service.localeValues).format(e.date),e.isOutsideRange=!1},n}(Hi),Or=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Minute,new Dr(e.DatePrecision.Hour,4,3))||this}return _r(i,n),Object.defineProperty(i.prototype,"date",{get:function(){if(this.service.config.mode!==e.CalendarMode.TimeOnly){var t=this.service.localeValues.formats.datetime.replace(/[ms]/g,"0");return new Li(t,this.service.localeValues).format(this.currentDate)}var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");return new Li(n,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-minute-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Cr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Cr(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=this.service.localeValues.monthsShort[e.date.getMonth()],e.isOutsideRange=!1},t}(Hi),Mr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Month,new Sr(e.DatePrecision.Year,4,3))||this}return Cr(i,n),Object.defineProperty(i.prototype,"year",{get:function(){return new Li(this.service.localeValues.formats.year,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-month-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Tr(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=jt.String.padLeft(e.date.getFullYear().toString(),4,"0"),e.isOutsideRange=e.date.getFullYear()>=this.calcStart(t).getFullYear()+10},t}(Hi),Pr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Year,new kr(e.DatePrecision.Decade,4,3))||this}return Tr(i,n),Object.defineProperty(i.prototype,"decadeStart",{get:function(){return Vt.startOf(e.DatePrecision.Decade,Vt.clone(this.service.currentDate)).getFullYear()},enumerable:!0,configurable:!0}),i.prototype.pad=function(e){return jt.String.padLeft(e.toString(),4,"0")},i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-year-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),xr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,er,gt,rn],declarations:[mn,Ri,Pr,Mr,yr,wr,Or,Fi,nr,ir,rr,fr],exports:[nr,ir,rr,fr],entryComponents:[Fi]}]}],e.ctorParameters=function(){return[]},e}(),Ir=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Er=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o._isDimmed=!1,o.isDimmedChange=new t.EventEmitter,o.isClickable=!0,o.wrapContent=!0,o._dimmerClasses=!0,o}return Ir(i,n),Object.defineProperty(i.prototype,"isDimmed",{get:function(){return this._isDimmed},set:function(t){var n=!!t;this._transitionController?this._isDimmed!==n&&(this._isDimmed=n,this._transitionController.stopAll(),this._transitionController.animate(new yt("fade",this.transitionDuration,n?e.TransitionDirection.In:e.TransitionDirection.Out))):(this._transitionController=new vt(n,"block"),this.setTransitionController(this._transitionController),this._isDimmed=n)},enumerable:!0,configurable:!0}),i.prototype.onClick=function(){this.isClickable&&(this.isDimmed=!1,this.isDimmedChange.emit(this.isDimmed))},i.decorators=[{type:t.Component,args:[{selector:"sui-dimmer",template:'\n
\n
\n \n
\n
\n',styles:["\n:host.dimmer {\n transition: none;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},i.propDecorators={_dimmerClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dimmer"]}],isDimmed:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDimmedChange:[{type:t.Output}],isClickable:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],wrapContent:[{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},i}(bt),Lr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[Er],exports:[Er]}]}],e.ctorParameters=function(){return[]},e}(),jr={ItemClick:"itemClick",OutsideClick:"outsideClick",Disabled:"disabled"},Vr=function(){function e(e){void 0===e&&(e=jr.ItemClick),this.isOpen=!1,this.isOpenChange=new t.EventEmitter,this.isDisabled=!1,this.autoCloseMode=e,this.children=[]}return Object.defineProperty(e.prototype,"isNested",{get:function(){return!!this.parent},enumerable:!0,configurable:!0}),e.prototype.setOpenState=function(e,t){var n=this;void 0===t&&(t=!1),this.isOpen===e||this.isDisabled?this.isOpen!==e&&this.isDisabled&&this.delay(function(){return n.isOpenChange.emit(n.isOpen)}):(this.isOpen=!!e,this.isAnimating=!0,this.delay(function(){return n.isOpenChange.emit(n.isOpen)}),this.isOpen||this.children.forEach(function(e){return e.setOpenState(n.isOpen)}),this.parent&&t&&this.parent.setOpenState(this.isOpen,!0))},e.prototype.setDisabledState=function(e){this.isDisabled!==e&&(e&&this.setOpenState(!1),this.isDisabled=!!e)},e.prototype.toggleOpenState=function(){this.setOpenState(!this.isOpen)},e.prototype.registerChild=function(e){this.isChildRegistered(e)||(this.children.push(e),e.parent=this)},e.prototype.isChildRegistered=function(e){return this===e||!!this.children.find(function(t){return!!t.children.find(function(t){return t.isChildRegistered(e)})})},e.prototype.clearChildren=function(){this.children.forEach(function(e){e.parent=void 0}),this.children=[]},e.prototype.delay=function(e){setTimeout(function(){return e()})},e}();!function(e){"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,n=(t.document||t.ownerDocument).querySelectorAll(e),i=0;n[i]&&n[i]!==t;)++i;return Boolean(n[i])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window.Element.prototype);var Hr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rr=function(){function e(e,t){this._renderer=e,this.element=t,this.isSelected=!1,this.selectedClass="selected"}return Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.element.nativeElement.classList.contains("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},set:function(e){e?this._renderer.addClass(this.element.nativeElement,this.selectedClass):this._renderer.removeClass(this.element.nativeElement,this.selectedClass)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasChildDropdown",{get:function(){return!!this.childDropdownMenu},enumerable:!0,configurable:!0}),e.prototype.performClick=function(){this.element.nativeElement.click()},e.decorators=[{type:t.Directive,args:[{selector:".item"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={childDropdownMenu:[{type:t.ContentChild,args:[t.forwardRef(function(){return Ar})]}]},e}(),Ar=function(n){function i(e,t,i){var r=n.call(this,e,t,i)||this;return r.element=t,r._transitionController=new vt(!1),r.setTransitionController(r._transitionController),r.menuTransition="slide down",r.menuTransitionDuration=200,r.menuAutoSelectFirst=!1,r.menuSelectedItemClass="selected",r._documentKeyDownListener=e.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),r}return Hr(i,n),Object.defineProperty(i.prototype,"service",{get:function(){return this._service},set:function(t){var n=this;this._service=t;var i=this._service.isOpen;this._service.isOpenChange.subscribe(function(t){t!==i&&(n._transitionController.stopAll(),n._transitionController.animate(new yt(n.menuTransition,n.menuTransitionDuration,e.TransitionDirection.Either,function(){return n._service.isAnimating=!1}))),t||n.selectedItems.length>1&&n.resetSelection(),i=t})},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"items",{set:function(e){this._itemsQueryOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_itemsQuery",{get:function(){return this._itemsQueryOverride||this._itemsQueryInternal},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_items",{get:function(){return this._itemsQuery.filter(function(e){return!e.isDisabled})},enumerable:!0,configurable:!0}),i.prototype.onClick=function(e){if(!e.eventHandled&&(e.eventHandled=!0,this._service.autoCloseMode===jr.ItemClick)){var t=e.target;this.element.nativeElement.contains(t.closest(".item"))&&!/input|textarea/i.test(t.tagName)&&this._service.setOpenState(!1,!0)}},i.prototype.onDocumentKeyDown=function(t){if(this._service.isOpen&&!this._service.isNested){!/input/i.test(t.target.tagName)&&[e.KeyCode.Escape,e.KeyCode.Enter,e.KeyCode.Up,e.KeyCode.Down,e.KeyCode.Left,e.KeyCode.Right].find(function(e){return e===t.keyCode})&&t.preventDefault();var n=this.selectedItems.slice(-1)[0],i=this;if(this.selectedItems.length>=2){var r=this.selectedItems.slice(-2)[0];i=r.childDropdownMenu}switch(t.keyCode){case e.KeyCode.Escape:this._service.setOpenState(!1);break;case e.KeyCode.Down:case e.KeyCode.Up:this.selectedItems.pop(),this.selectedItems.push(i.updateSelection(n,t.keyCode)),t.preventDefault();break;case e.KeyCode.Enter:if(n&&!n.hasChildDropdown){n.performClick();break}case e.KeyCode.Right:n&&n.hasChildDropdown&&(n.childDropdownMenu.service.setOpenState(!0),this.selectedItems.push(n.childDropdownMenu.updateSelection(n,t.keyCode)));break;case e.KeyCode.Left:if(this.selectedItems.length>=2){this.selectedItems.pop();var r=this.selectedItems.slice(-1)[0];r.childDropdownMenu.service.setOpenState(!1),r.isSelected=!0}}}},i.prototype.resetSelection=function(){var e=this;this.selectedItems=[],this._items.forEach(function(t){t.selectedClass=e.menuSelectedItemClass,t.isSelected=!1}),this.menuAutoSelectFirst&&this._items.length>0&&(this._items[0].isSelected=!0,this.scrollToItem(this._items[0]),this.selectedItems.push(this._itemsQuery.first))},i.prototype.updateSelection=function(t,n){t&&(t.isSelected=!1);var i,r=this._items.findIndex(function(e){return e===t});switch(n){case e.KeyCode.Enter:case e.KeyCode.Right:case e.KeyCode.Down:r+=1;break;case e.KeyCode.Up:if(-1===r){r=0;break}r-=1}return i=this._items[r]||t,i&&(i.isSelected=!0,this.scrollToItem(i)),i},i.prototype.scrollToItem=function(e){var t=this.element.nativeElement,n=e.element.nativeElement.getBoundingClientRect(),i=t.getBoundingClientRect(),r=0;n.bottom>i.bottom&&(r=n.bottom-i.bottom),n.top\n\n \x3c!-- Modal component, with transition component attached --\x3e\n \n\n',styles:["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"]}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht}]},n.propDecorators={isClosable:[{type:t.Input}],closeResult:[{type:t.Input}],onApprove:[{type:t.Output,args:["approved"]}],onDeny:[{type:t.Output,args:["denied"]}],onDismiss:[{type:t.Output,args:["dismissed"]}],_modalElement:[{type:t.ViewChild,args:["modal"]}],size:[{type:t.Input}],isFullScreen:[{type:t.Input}],isBasic:[{type:t.Input}],mustScroll:[{type:t.Input}],isInverted:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onDocumentKeyUp:[{type:t.HostListener,args:["document:keyup",["$event"]]}],onDocumentResize:[{type:t.HostListener,args:["window:resize"]}]},n}(),Xr=function(){function e(e){this._componentFactory=e}return e.prototype.open=function(e){var t=this._componentFactory.createComponent(Zr),n=t.instance;if(e instanceof Wr)this._componentFactory.createView(n.templateSibling,e.template,{$implicit:e.context,modal:t.instance.controls});else if(e instanceof qr){var i=this._componentFactory.createComponent(e.component,[{provide:$r,useValue:new $r(n.controls,e.context)}]);this._componentFactory.attachToView(i,n.templateSibling);for(var r=i.location.nativeElement;r.hasChildNodes()&&r.parentElement&&r.firstChild;)r.parentElement.appendChild(r.removeChild(r.firstChild));this._componentFactory.detachFromDocument(i)}return this._componentFactory.attachToApplication(t),n.loadConfig(e),new Br(e,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Ht}]},e}(),eo=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Lr,wt,rn],declarations:[Zr],exports:[Zr],providers:[Xr],entryComponents:[Zr]}]}],e.ctorParameters=function(){return[]},e}(),to=function(){function e(){this._popupClasses=!0,this.value=0,this.maximum=100,this.precision=0,this._overrideSuccess=!1,this.autoSuccess=!0,this.showProgress=!0,this._popupClasses=!0}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){var t=+e;Number.isNaN(t)||(this._value=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){var t=+e;Number.isNaN(t)||(this._maximum=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"precision",{get:function(){return this._precision},set:function(e){var t=+e;Number.isNaN(t)||(this._precision=Math.min(Math.max(t,0),20))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_reachedMaximum",{get:function(){return this._overrideSuccess||this.value>=this.maximum&&this.autoSuccess},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"percentage",{get:function(){return(Math.min(Math.max(this.value,0),this.maximum)/this.maximum*100).toFixed(this.precision)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classValue",{set:function(e){(e.includes("attached")||e.includes("tiny"))&&(this.showProgress=!1),e.includes("success")&&(this._overrideSuccess=!0)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-progress",template:'\n
\n
{{ percentage }}%
\n
\n
\n \n
\n',styles:["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_popupClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.progress"]}],autoSuccess:[{type:t.Input}],showProgress:[{type:t.Input}],value:[{type:t.Input}],maximum:[{type:t.Input}],precision:[{type:t.Input}],_reachedMaximum:[{type:t.HostBinding,args:["class.success"]}],percentage:[{type:t.HostBinding,args:["attr.data-percent"]}],classValue:[{type:t.Input,args:["class"]}]},e}(),no=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[to],exports:[to]}]}],e.ctorParameters=function(){return[]},e}(),io=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ro=function(){function e(){this.hoveredIndex=-1,this.value=0,this.valueChange=new t.EventEmitter,this.maximum=5,this.isReadonly=!1,this._ratingClasses=!0}return Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){this._maximum=+e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icons",{get:function(){return new Array(this.maximum)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){this.isReadonly||(this.value=e+1,this.valueChange.emit(this.value))},e.prototype.onMouseover=function(e){this.hoveredIndex=e},e.prototype.onMouseout=function(){this.hoveredIndex=-1},e.prototype.writeValue=function(e){this.value=e},e.decorators=[{type:t.Component,args:[{selector:"sui-rating",template:'\n\n\n',styles:["\n:host.read-only .icon {\n cursor: auto\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_ratingClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.rating"]}],valueChange:[{type:t.Output}],maximum:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],onMouseout:[{type:t.HostListener,args:["mouseout"]}]},e}(),oo=function(e){function n(t){return e.call(this,t)||this}return io(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-rating",host:{"(valueChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:ro}]},n}(Et),so=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[i.FormsModule,n.CommonModule],declarations:[ro,oo],exports:[ro,oo]}]}],e.ctorParameters=function(){return[]},e}(),ao=function(){function e(e){this.componentFactory=e,this._optionClasses=!0,this.formatter=function(e){return""}}return Object.defineProperty(e.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-search-result",template:'\n\n\n'}]}],e.ctorParameters=function(){return[{type:Ht}]},e.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.result"]}],value:[{type:t.Input}],query:[{type:t.Input}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}]},e}(),co=function(){function e(e){void 0===e&&(e=!1);var t=this;this._options=[],this.optionsFilter=function(e,n){var i=t.toRegex(t._query);return i instanceof RegExp&&e.filter(function(e){return jt.Object.readValue(e,t._optionsField).toString().match(i)})},this.allowEmptyQuery=e,this._query="",this.resetQueryOnChange=!0,this.searchDelay=0,this.reset()}return Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e||[],this._optionsLookup=void 0,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{get:function(){return this._optionsLookup},set:function(e){this._optionsLookup=e,this._options=[],this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasItemLookup",{get:function(){return!!this.optionsLookup&&2===this.optionsLookup.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{get:function(){return this._optionsField},set:function(e){this._optionsField=e,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this._results},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this._isSearching},enumerable:!0,configurable:!0}),e.prototype.updateQueryDelayed=function(e,t){var n=this;void 0===t&&(t=function(){}),this._query=e,clearTimeout(this._searchDelayTimeout),this._searchDelayTimeout=window.setTimeout(function(){n.updateQuery(e,t)},this.searchDelay)},e.prototype.updateQuery=function(e,t){var n=this;if(void 0===t&&(t=function(){}),this._query=e,""===this._query&&!this.allowEmptyQuery)return t();if(this._resultsCache.hasOwnProperty(this._query))return this._results=this._resultsCache[this._query],t();if(this._optionsLookup){this._isSearching=!0;return void this._optionsLookup.call(void 0,this._query).then(function(e){return n._isSearching=!1,n.updateResults(e),t()}).catch(function(e){return n._isSearching=!1,t(e)})}var i=this.optionsFilter.call(void 0,this._options,this._query);return i&&this.updateResults(i),t()},e.prototype.updateResults=function(e){this._resultsCache[this._query]=e,this._results=e},e.prototype.initialLookup=function(e){return Array,this._optionsLookup(void 0,e)},e.prototype.toRegex=function(e){try{return new RegExp(e,"i")}catch(t){return e}},e.prototype.highlightMatches=function(e,t){var n=this.toRegex(t);return n instanceof RegExp?e.replace(n,function(e){return""+e+""}):e},e.prototype.reset=function(){this._results=[],this._resultsCache={},this._isSearching=!1,this.resetQueryOnChange||!this.query?this.updateQuery(""):this.updateQuery(this.query)},e}(),uo=function(){function e(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._searchClasses=!0,this.hasIcon=!0,this.allowEmptyQuery=!1,this.resetQueryOnChange=!0,this.retainSelectedResult=!0,this.searchDelay=200,this.maxResults=7,this.onResultSelected=new t.EventEmitter,this.transition="scale",this.transitionDuration=200,this._documentClickListener=n.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resetQueryOnChange",{set:function(e){this.searchService.resetQueryOnChange=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowEmptyQuery",{get:function(){return this._allowEmptyQuery},set:function(e){this._allowEmptyQuery=e,this.searchService.allowEmptyQuery=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this.searchService.query},set:function(e){this.selectedResult=void 0,this.searchService.updateQueryDelayed(e,function(){})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{set:function(e){e&&(this.searchService.options=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{set:function(e){this.searchService.optionsLookup=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resultFormatter",{get:function(){var e=this;return this._resultFormatter?this._resultFormatter:this.searchService.optionsLookup?function(t){return e.readValue(t)}:function(t,n){return e.searchService.highlightMatches(e.readValue(t),n)}},set:function(e){this._resultFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"searchDelay",{set:function(e){this.searchService.searchDelay=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this.searchService.results.slice(0,this.maxResults)},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this._menu.service=this.dropdownService},e.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().search},e.prototype.select=function(e){this.onResultSelected.emit(e),this.dropdownService.setOpenState(!1),this.retainSelectedResult?(this.selectedResult=e,this.searchService.updateQuery(this.readValue(e))):this.searchService.updateQuery("")},e.prototype.onClick=function(e){this.open()},e.prototype.onFocusIn=function(){this.dropdownService.isAnimating||this.open()},e.prototype.open=function(){(this.searchService.query.length>0||this.allowEmptyQuery)&&this.dropdownService.setOpenState(!0)},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.dropdownService.setOpenState(!1)},e.prototype.onDocumentClick=function(e){this._element.nativeElement.contains(e.target)||this.dropdownService.setOpenState(!1)},e.prototype.readValue=function(e){return jt.Object.readValue(e,this.searchService.optionsField)},e.prototype.ngOnDestroy=function(){this._documentClickListener()},e.decorators=[{type:t.Component,args:[{selector:"sui-search",template:'\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n',styles:["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},e.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_searchClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.search"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],hasIcon:[{type:t.Input}],resetQueryOnChange:[{type:t.Input}],allowEmptyQuery:[{type:t.Input}],placeholder:[{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],optionsField:[{type:t.Input}],resultFormatter:[{type:t.Input}],resultTemplate:[{type:t.Input}],retainSelectedResult:[{type:t.Input}],searchDelay:[{type:t.Input}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],maxResults:[{type:t.Input}],onResultSelected:[{type:t.Output,args:["resultSelected"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),po=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,gt,rn],declarations:[uo,ao],exports:[uo]}]}],e.ctorParameters=function(){return[]},e}(),lo=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ho=function(e){function n(n,i,r){var o=e.call(this,n,i)||this;return o.changeDetector=r,o._optionClasses=!0,o.isActive=!1,o.onSelected=new t.EventEmitter,o.renderedText="",o.usesTemplate=!1,o}return lo(n,e),Object.defineProperty(n.prototype,"formatter",{set:function(e){this.usesTemplate?this.renderedText="":this.renderedText=e(this.value)},enumerable:!0,configurable:!0}),n.prototype.onClick=function(e){var t=this;e.eventHandled=!0,setTimeout(function(){return t.onSelected.emit(t.value)})},n.decorators=[{type:t.Component,args:[{selector:"sui-select-option",template:'\n\n\n'}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},n.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.item"]}],value:[{type:t.Input}],onSelected:[{type:t.Output}],isActive:[{type:t.HostBinding,args:["class.active"]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(Rr),fo=function(){function e(e,n){this._renderer=e,this._element=n,this.onQueryUpdated=new t.EventEmitter,this.onQueryKeyDown=new t.EventEmitter,this._searchClass=!0,this._autoComplete="off"}return Object.defineProperty(e.prototype,"query",{set:function(e){this._renderer.setProperty(this._element.nativeElement,"value",e)},enumerable:!0,configurable:!0}),e.prototype.updateQuery=function(e){this.onQueryUpdated.emit(e)},e.prototype.onKeyDown=function(e){this.onQueryKeyDown.emit(e)},e.prototype.focus=function(){var e=this;this._element.nativeElement.focus(),setTimeout(function(){return e._element.nativeElement.focus()})},e.decorators=[{type:t.Directive,args:[{selector:"input[suiSelectSearch]"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_searchClass:[{type:t.HostBinding,args:["class.search"]}],_autoComplete:[{type:t.HostBinding,args:["attr.autocomplete"]}],updateQuery:[{type:t.HostListener,args:["input",["$event.target.value"]]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}(),mo=function(){function n(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co(!0),this.isSearchable=!1,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._renderedSubscriptions=[],this.icon="dropdown",this.transition="slide down",this.transitionDuration=200,this.onTouched=new t.EventEmitter,this._documentKeyDownListener=n.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),this._selectClasses=!0}return Object.defineProperty(n.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isVisible",{get:function(){return this._menu.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_searchClass",{get:function(){return this.isSearchable&&!this.isSearchExternal},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"searchInput",{get:function(){return this._manualSearch||this._internalSearch},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tabIndex",{get:function(){return this.isDisabled?-1:this.dropdownService.isOpen&&this.isSearchExternal?-1:void 0!=this._tabIndex?this._tabIndex:this._searchClass?-1:0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isDisabled",{get:function(){return this.dropdownService.isDisabled},set:function(e){this.dropdownService.isDisabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"options",{set:function(e){e&&(this.searchService.options=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsLookup",{set:function(e){e&&(this.searchService.optionsLookup=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"filteredOptions",{get:function(){return this.searchService.results},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"query",{get:function(){return this.isSearchable?this.searchService.query:void 0},set:function(e){var t=this;void 0!=e&&(this.queryUpdateHook(),this.updateQuery(e),this._renderedOptions.forEach(function(e){return t.initialiseRenderedOption(e)}),this.searchInput&&(this.searchInput.query=e))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelField",{get:function(){return this.searchService.optionsField},set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelGetter",{get:function(){var e=this;return function(t){var n=jt.Object.readValue(t,e.labelField);return void 0!=n?n.toString():""}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valueGetter",{get:function(){var e=this;return function(t){return jt.Object.readValue(t,e.valueField)}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"configuredFormatter",{get:function(){var e=this;return this._optionFormatter?function(t){return e._optionFormatter(t,e.isSearchable?e.query:void 0)}:this.searchService.optionsLookup?function(t){return e.labelGetter(t)}:function(t){return e.searchService.highlightMatches(e.labelGetter(t),e.query||"")}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionFormatter",{set:function(e){this._optionFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),n.prototype.ngAfterContentInit=function(){var e=this;this._menu.service=this.dropdownService,this._menu.items=this._renderedOptions,this._manualSearch&&(this.isSearchable=!0,this.isSearchExternal=!0),this.searchInput&&(this.searchInput.onQueryUpdated.subscribe(function(t){return e.query=t}),this.searchInput.onQueryKeyDown.subscribe(function(t){return e.onQueryInputKeydown(t)})),this.onAvailableOptionsRendered(),this._renderedOptions.changes.subscribe(function(){return e.onAvailableOptionsRendered()})},n.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().select},n.prototype.optionsUpdateHook=function(){},n.prototype.queryUpdateHook=function(){},n.prototype.updateQuery=function(e){var t=this;this.searchService.updateQuery(e,function(){return t.dropdownService.setOpenState(!0)})},n.prototype.resetQuery=function(e){void 0===e&&(e=!0),e?(this.searchService.searchDelay=this._menu.menuTransitionDuration,this.searchService.updateQueryDelayed("")):this.searchService.updateQuery(""),this.searchInput&&(this.searchInput.query="")},n.prototype.onAvailableOptionsRendered=function(){var e=this;this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._renderedSubscriptions=[],this._renderedOptions.forEach(function(t){setTimeout(function(){return e.initialiseRenderedOption(t)}),e._renderedSubscriptions.push(t.onSelected.subscribe(function(){return e.selectOption(t.value)}))}),0!==this.searchService.options.length||this.searchService.optionsLookup||(this.options=this._renderedOptions.map(function(e){return e.value}))},n.prototype.initialiseRenderedOption=function(e){e.usesTemplate=!!this.optionTemplate,e.formatter=this.configuredFormatter,e.usesTemplate&&this.drawTemplate(e.templateSibling,e.value),e.changeDetector.markForCheck()},n.prototype.findOption=function(e,t){var n=this;return e.find(function(e){return t===n.valueGetter(e)})},n.prototype.onCaretClick=function(e){e.eventHandled||(e.eventHandled=!0,this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!this.dropdownService.isOpen),this.focus()))},n.prototype.onClick=function(e){e.eventHandled||this.dropdownService.isAnimating||(e.eventHandled=!0,this.dropdownService.setOpenState(!!this.isSearchable||!this.dropdownService.isOpen),this.focus())},n.prototype.onFocusIn=function(){this.dropdownService.isOpen||this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!0),this.focus())},n.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||(this.dropdownService.setOpenState(!1),this.onTouched.emit())},n.prototype.onKeyPress=function(t){t.keyCode===e.KeyCode.Enter&&this._element.nativeElement.click()},n.prototype.onDocumentKeyDown=function(t){this._element.nativeElement.contains(t.target)&&!this.dropdownService.isOpen&&t.keyCode===e.KeyCode.Down&&(this._element.nativeElement.click(),t.preventDefault())},n.prototype.onQueryInputKeydown=function(e){},n.prototype.focus=function(){this.isSearchable&&this.searchInput?this.searchInput.focus():this._element.nativeElement.focus()},n.prototype.drawTemplate=function(e,t){e.clear(),e.createEmbeddedView(this.optionTemplate,{$implicit:t,query:this.query})},n.prototype.ngOnDestroy=function(){this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._documentKeyDownListener()},n.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_renderedOptions:[{type:t.ContentChildren,args:[ho,{descendants:!0}]}],_selectClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dropdown"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isSearchable:[{type:t.Input}],_searchClass:[{type:t.HostBinding,args:["class.search"]}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],_internalSearch:[{type:t.ViewChild,args:[fo]}],_manualSearch:[{type:t.ContentChild,args:[fo]}],_tabIndex:[{type:t.Input,args:["tabindex"]}],tabIndex:[{type:t.HostBinding,args:["attr.tabindex"]}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],labelField:[{type:t.Input}],valueField:[{type:t.Input}],optionTemplate:[{type:t.Input}],optionFormatter:[{type:t.Input}],icon:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onTouched:[{type:t.Output,args:["touched"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}],onKeyPress:[{type:t.HostListener,args:["keypress",["$event"]]}]},n}(),go=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),yo=function(n){function i(i,r,o,s){var a=n.call(this,i,r,o)||this;return a.componentFactory=s,a._transitionController=new vt(!1,"inline-block"),a.setTransitionController(a._transitionController),a.onDeselected=new t.EventEmitter,a._labelClasses=!0,a._transitionController.animate(new yt("scale",100,e.TransitionDirection.In)),a}return go(i,n),Object.defineProperty(i.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),i.prototype.deselectOption=function(t){var n=this;t.eventHandled=!0,this._transitionController.animate(new yt("scale",100,e.TransitionDirection.Out,function(){return n.onDeselected.emit(n.value)}))},i.prototype.onClick=function(e){e.eventHandled=!0},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select-label",template:'\n\n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:Ht}]},i.propDecorators={_labelClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.label"]}],value:[{type:t.Input}],query:[{type:t.Input}],onDeselected:[{type:t.Output,args:["deselected"]}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},i}(bt),vo=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bo=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o.selectedOptions=[],o.selectedOptionsChange=new t.EventEmitter,o.hasLabels=!0,o._multiSelectClasses=!0,o}return vo(i,n),Object.defineProperty(i.prototype,"filteredOptions",{get:function(){var e=this;if(this.maxSelectedReached)return[];var t=this.searchService.results;return this.hasLabels?t.filter(function(t){return void 0==e.selectedOptions.find(function(e){return t===e})}):t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasLabels",{ +get:function(){return this._hasLabels},set:function(e){this._hasLabels=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.multi.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxSelectedReached",{get:function(){return void 0!=this.maxSelected&&this.selectedOptions.length===this.maxSelected},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxSelectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.maxSelectedMessage,[["max",this.maxSelected.toString()]])},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.selectedMessage,[["count",this.selectedOptions.length.toString()]])},enumerable:!0,configurable:!0}),i.prototype.optionsUpdateHook=function(){var e=this;!this._writtenOptions&&this.selectedOptions.length>0&&this.writeValue(this.selectedOptions.map(function(t){return e.valueGetter(t)})),this._writtenOptions&&this.searchService.options.length>0&&(this.selectedOptions=this._writtenOptions.map(function(t){return e.findOption(e.searchService.options,t)}).filter(function(e){return void 0!=e}),this.selectedOptions.length===this._writtenOptions.length&&(this._writtenOptions=void 0))},i.prototype.initialiseRenderedOption=function(e){n.prototype.initialiseRenderedOption.call(this,e),e.isActive=!this.hasLabels&&-1!==this.selectedOptions.indexOf(e.value)},i.prototype.selectOption=function(e){var t=this;if(-1!==this.selectedOptions.indexOf(e))return void this.deselectOption(e);this.selectedOptions.push(e),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.resetQuery(!1),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.writeValue=function(e){var t=this;e instanceof Array?(this.searchService.options.length>0&&(this.selectedOptions=e.map(function(e){return t.findOption(t.searchService.options,e)}).filter(function(e){return void 0!=e})),e.length>0&&0===this.selectedOptions.length&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){return t.selectedOptions=e}):this._writtenOptions=e),0===e.length&&(this.selectedOptions=[])):this.selectedOptions=[]},i.prototype.deselectOption=function(e){var t=this;this.selectedOptions=this.selectedOptions.filter(function(t){return t!==e}),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.onQueryInputKeydown=function(t){t.keyCode===e.KeyCode.Backspace&&""===this.query&&this.selectedOptions.length>0&&this.deselectOption(this.selectedOptions[this.selectedOptions.length-1])},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select",template:'\n\x3c!-- Dropdown icon --\x3e\n\n\n\n\x3c!-- Multi-select labels --\x3e\n \n\n\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Helper text --\x3e\n
\n \n \x3c!-- Placeholder text --\x3e\n {{ placeholder }}\n \n \x3c!-- Summary shown when labels are hidden --\x3e\n {{ selectedMessage }}\n
\n\n\x3c!-- Select dropdown menu --\x3e\n\n',styles:["\n:host input.search {\n width: 12em !important;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},i.propDecorators={selectedOptionsChange:[{type:t.Output}],hasLabels:[{type:t.Input}],placeholder:[{type:t.Input}],maxSelected:[{type:t.Input}],_multiSelectClasses:[{type:t.HostBinding,args:["class.multiple"]}]},i}(mo),wo=function(e){function n(t){return e.call(this,t)||this}return vo(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-multi-select",host:{"(selectedOptionsChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:bo}]},n}(Et),_o=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Do=function(e){function n(n,i,r){var o=e.call(this,n,i,r)||this;return o.selectedOptionChange=new t.EventEmitter,o}return _o(n,e),Object.defineProperty(n.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.single.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),n.prototype.optionsUpdateHook=function(){!this._writtenOption&&this.selectedOption&&this.writeValue(this.valueGetter(this.selectedOption)),this._writtenOption&&this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,this._writtenOption),this.selectedOption&&(this._writtenOption=void 0,this.drawSelectedOption()))},n.prototype.queryUpdateHook=function(){this.selectedOption=void 0},n.prototype.selectOption=function(e){this.selectedOption=e,this.selectedOptionChange.emit(this.valueGetter(e)),this.dropdownService.setOpenState(!1),this.resetQuery(),this.drawSelectedOption(),this.focus()},n.prototype.writeValue=function(e){var t=this;void 0!=e?(this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,e),this.drawSelectedOption()),void 0==this.selectedOption&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){t.selectedOption=e,t.drawSelectedOption()}):this._writtenOption=e)):(this.selectedOption=void 0,this.drawSelectedOption())},n.prototype.initialiseRenderedOption=function(t){e.prototype.initialiseRenderedOption.call(this,t),t.isActive=t.value===this.selectedOption},n.prototype.drawSelectedOption=function(){this._renderedOptions&&this.onAvailableOptionsRendered(),void 0!=this.selectedOption&&this.optionTemplate&&this.drawTemplate(this._optionTemplateSibling,this.selectedOption)},n.decorators=[{type:t.Component,args:[{selector:"sui-select",template:'\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Placeholder text --\x3e\n
{{ placeholder }}
\n\x3c!-- Selected item --\x3e\n
\n \n \n
\n\x3c!-- Dropdown icon --\x3e\n\n\x3c!-- Select dropdown menu --\x3e\n\n'}]}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},n.propDecorators={_optionTemplateSibling:[{type:t.ViewChild,args:["optionTemplateSibling",{read:t.ViewContainerRef}]}],selectedOptionChange:[{type:t.Output}],placeholder:[{type:t.Input}]},n}(mo),Oo=function(e){function n(t){return e.call(this,t)||this}return _o(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-select",host:{"(selectedOptionChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:Do}]},n}(Et),Co=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,rn,gt],declarations:[Do,ho,fo,Oo,bo,yo,wo],exports:[Do,ho,fo,Oo,bo,wo]}]}],e.ctorParameters=function(){return[]},e}(),So={Overlay:"overlay",Push:"push",ScaleDown:"scale down",Uncover:"uncover",SlideAlong:"slide along",SlideOut:"slide out"},Mo={Left:"left",Right:"right",Top:"top",Bottom:"bottom"},To=function(){function e(e){void 0===e&&(e=!1),this.isVisible=e,this.isAnimating=!1,this.wasJustOpened=!1,this.isVisibleChange=new t.EventEmitter,this.widthChange=new t.EventEmitter,this.heightChange=new t.EventEmitter,this.width=260,this.height=0,this.transition=So.Uncover}return Object.defineProperty(e.prototype,"width",{get:function(){return this.direction===Mo.Left?this._width:this.direction===Mo.Right?-this._width:0},set:function(e){this._width=e,this.widthChange.emit()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.direction===Mo.Top?this._height:this.direction===Mo.Bottom?-this._height:0},set:function(e){this._height=e,this.heightChange.emit()},enumerable:!0,configurable:!0}),e.prototype.setVisibleState=function(e){var t=this;this.isVisible!==e&&(this.isVisible=e,this.isAnimating=!0,this.wasJustOpened=!0,this.isVisibleChange.emit(e),setTimeout(function(){return t.wasJustOpened=!1}),clearTimeout(this._isAnimatingTimeout),this._isAnimatingTimeout=window.setTimeout(function(){return t.isAnimating=!1},500))},e.prototype.toggleVisibleState=function(){this.setVisibleState(!this.isVisible)},e}(),ko=function(){function e(e,t){var n=this;this._renderer=e,this._element=t,this.service=new To,this.transition=So.Uncover,this.direction=Mo.Left,setTimeout(function(){return n.updateDimensions()}),this.service.isVisibleChange.subscribe(function(){return n.updateDimensions()}),this._sidebarClasses=!0}return Object.defineProperty(e.prototype,"transition",{get:function(){return this.service.transition},set:function(e){var t=this;this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!1)}),this.service.transition=e,this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!0)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"direction",{get:function(){return this.service.direction},set:function(e){this.setClass(this.service.direction,!1),this.service.direction=e,this.setClass(this.service.direction,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.service.isVisible},set:function(e){this.service.setVisibleState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisibleChange",{get:function(){return this.service.isVisibleChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAnimating",{get:function(){return this.service.isAnimating},enumerable:!0,configurable:!0}),e.prototype.updateDimensions=function(){this.service.width=this._element.nativeElement.offsetWidth,this.service.height=this._element.nativeElement.offsetHeight},e.prototype.setClass=function(e,t){void 0===t&&(t=!0),t?this._renderer.addClass(this._element.nativeElement,e):this._renderer.removeClass(this._element.nativeElement,e)},e.prototype.open=function(){this.service.setVisibleState(!0)},e.prototype.close=function(){this.service.setVisibleState(!1)},e.prototype.toggle=function(){this.service.toggleVisibleState()},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar",template:""}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_sidebarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.sidebar"]},{type:t.HostBinding,args:["class.menu"]}],transition:[{type:t.Input}],direction:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]},{type:t.Input}],isVisibleChange:[{type:t.Output}],isAnimating:[{type:t.HostBinding,args:["class.animating"]}]},e}(),Po=function(){function e(e,t){this._renderer=e,this._element=t,this.isDimmedWhenVisible=!1,this._siblingClasses=!0}return Object.defineProperty(e.prototype,"service",{get:function(){return this._service},set:function(e){var t=this;this._service=e,setTimeout(function(){return t.updateTransform()}),this._service.isVisibleChange.subscribe(function(){return t.updateTransform()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return!!this.service&&this.service.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDimmed",{get:function(){return!!this.service&&(this.service.isVisible&&this.isDimmedWhenVisible)},enumerable:!0,configurable:!0}),e.prototype.updateTransform=function(){if(this._renderer.removeStyle(this._element.nativeElement,"transform"),this._renderer.removeStyle(this._element.nativeElement,"-webkit-transform"),this.service.isVisible&&this.service.transition!==So.Overlay&&this.service.transition!==So.ScaleDown){var e="translate3d("+this.service.width+"px, "+this.service.height+"px, 0)";this._renderer.setStyle(this._element.nativeElement,"transform",e),this._renderer.setStyle(this._element.nativeElement,"-webkit-transform",e)}},e.prototype.onClick=function(e){this.service.isVisible&&!this.service.wasJustOpened&&this.service.setVisibleState(!1)},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-sibling",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={isDimmedWhenVisible:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isDimmed:[{type:t.HostBinding,args:["class.dimmed"]}],_siblingClasses:[{type:t.HostBinding,args:["class.pusher"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},e}(),xo=function(){function e(){this._containerClasses=!0}return e.prototype.ngAfterContentInit=function(){if(!this.sidebar)throw new Error("You must include a element within the container.");if(this.service=this.sidebar.service,!this.sibling)throw new Error("You must include a element within the container.");this.sibling.service=this.service},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-container",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_containerClasses:[{type:t.HostBinding,args:["class.pushable"]}],sidebar:[{type:t.ContentChild,args:[ko]}],sibling:[{type:t.ContentChild,args:[Po]}]},e}(),Io=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[ko,xo,Po],exports:[ko,xo,Po]}]}],e.ctorParameters=function(){return[]},e}(),Eo=function(){function e(e,t){var n=this;this.id=e.id,this.header=e,this.content=t,this.header.isActiveChange.subscribe(function(){return n.content.isActive=n.isActive})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.header.isActive},set:function(e){this.header.setActiveState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.header.isDisabled},enumerable:!0,configurable:!0}),e}(),Lo=function(){function e(){this._isActive=!1,this.isActiveChange=new t.EventEmitter,this.isActiveExternalChange=new t.EventEmitter,this.onActivate=new t.EventEmitter,this.onDeactivate=new t.EventEmitter,this.isDisabled=!1,this._headerClasses=!0}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},set:function(e){var t=this,n=e;setTimeout(function(){n=!t.isDisabled&&e,t.setActiveState(n),t.isActiveExternalChange.emit(n)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(e){this._isDisabled!==e&&(this._isDisabled=e,this.isDisabled&&(this.isActive=!1))},enumerable:!0,configurable:!0}),e.prototype.setActiveState=function(e){!!this._isActive!==e&&(this._isActive=e,e?this.onActivate.emit():this.onDeactivate.emit()),this.isActiveChange.emit(e)},e.prototype.onClick=function(){this.isDisabled||(this.isActive=!0)},e.decorators=[{type:t.Directive,args:[{selector:"[suiTabHeader]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_headerClasses:[{type:t.HostBinding,args:["class.item"]}],id:[{type:t.Input,args:["suiTabHeader"]}],isActiveChange:[{type:t.Output}],onActivate:[{type:t.Output,args:["activate"]}],onDeactivate:[{type:t.Output,args:["deactivate"]}],isActive:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},e}(),jo=function(){function e(){this.isActive=!1,this._contentClasses=!0}return e.decorators=[{type:t.Directive,args:[{selector:"[suiTabContent]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_contentClasses:[{type:t.HostBinding,args:["class.tab"]}],id:[{type:t.Input,args:["suiTabContent"]}],isActive:[{type:t.HostBinding,args:["class.active"]}]},e}(),Vo=function(){function e(){this.tabs=[],this._barrierCount=0}return Object.defineProperty(e.prototype,"activeTab",{get:function(){return this._activeTab},set:function(e){this._activeTab=e,e.isActive=!0},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this._tabHeaders.changes.subscribe(function(){return e.internalComponentsUpdated()}),this._tabContents.changes.subscribe(function(){return e.internalComponentsUpdated()}),this.loadTabs()},e.prototype.internalComponentsUpdated=function(){2===++this._barrierCount&&(this._barrierCount=0,this.loadTabs())},e.prototype.loadTabs=function(){var e=this;if(this.tabs=this.tabs.filter(function(t){return!!e._tabHeaders.find(function(e){return e===t.header})}),this._tabHeaders.filter(function(t){return!e.tabs.find(function(e){return e.header===t})}).forEach(function(t){var n=e._tabContents.find(function(e){return e.id===t.id});if(!n)throw new Error("A [suiTabHeader] must have a related [suiTabContent].");var i=new Eo(t,n);i.header.isActiveExternalChange.subscribe(function(){return e.onHeaderActiveChanged(i)}),e.tabs.push(i)}),this._tabHeaders.forEach(function(t,n){var i=e.tabs.find(function(e){return e.header===t});i&&(i.index=n)}),this.tabs.sort(function(e,t){return e.index-t.index}),this.activeTab?this.tabs.find(function(t){return t===e.activeTab})||setTimeout(function(){return e.activateClosestTab(e.activeTab)}):this.activateFirstTab(),0===this.tabs.length)throw new Error("You cannot have no tabs!")},e.prototype.onHeaderActiveChanged=function(e){e.isActive&&this.activeTab!==e&&(this.tabs.filter(function(t){return t!==e}).forEach(function(e){return e.isActive=!1}),this.activeTab=e),e.isActive||this.activeTab!==e||this.activateClosestTab(e)},e.prototype.activateFirstTab=function(){this.activeTab=this.tabs[0]},e.prototype.activateClosestTab=function(e){var t;if(e.index>=this.tabs.length&&(t=this.tabs[this.tabs.length-1]),t||(t=this.tabs.find(function(t){return t===e})?this.tabs[Math.max(e.index-1,0)]:this.tabs[e.index]),t.isDisabled)return this.activateClosestTab(t);this.activeTab=t},e.decorators=[{type:t.Component,args:[{selector:"sui-tabset",template:""}]}],e.ctorParameters=function(){return[]},e.propDecorators={_tabHeaders:[{type:t.ContentChildren,args:[Lo]}],_tabContents:[{type:t.ContentChildren,args:[jo]}]},e}(),Ho=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[Vo,Lo,jo],exports:[Vo,Lo,jo]}]}],e.ctorParameters=function(){return[]},e}(),Ro=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{exports:[Dt,Ct,xt,hn,Pt,xr,Lr,Yr,eo,er,no,so,po,Co,Io,Ho,wt,gt,rn]}]}],e.ctorParameters=function(){return[]},e}();e.SuiLocalizationService=mt,e.SuiLocalizationModule=gt,e.SuiMessage=_t,e.SuiMessageModule=Dt,e.SuiPagination=Ot,e.SuiPaginationModule=Ct,e.SuiAccordionPanel=St,e.SuiAccordion=Tt,e.SuiAccordionService=Mt,e.SuiAccordionModule=xt,e.SuiCheckbox=sn,e.SuiCheckboxValueAccessor=an,e.SuiRadio=un,e.SuiRadioValueAccessor=pn,e.SuiRadioManager=ln,e.SuiCheckboxModule=hn,e.SuiCollapse=kt,e.SuiCollapseModule=Pt,e.CalendarConfig=Sn,e.DateConfigBase=Mn,e.YearConfig=Tn,e.MonthConfig=kn,e.DateConfig=Pn,e.DatetimeConfig=xn,e.TimeConfig=In,e.CalendarMappings=vn,e.DateMappings=bn,e.TimeMappings=wn,e.DatetimeMappings=_n,e.MonthMappings=Dn,e.YearMappings=On,e.DateComparer=En,e.DateParser=Li,e.InternalDateParser=ji,e.SuiCalendarViewTitle=Ri,e.DatepickerMode=Ai,e.SuiDatepicker=Fi,e.CalendarItem=fn,e.SuiCalendarItem=mn,e.SuiDatepickerDirective=nr,e.SuiDatepickerDirectiveValueAccessor=ir,e.SuiDatepickerDirectiveValidator=rr,e.SuiDatepickerInputDirective=fr,e.DateFnsParser=Ii,e.CalendarRange=Vi,e.CalendarRangeService=Hi,e.CalendarService=dn,e.CalendarView=gn,e.CalendarRangeDateService=gr,e.SuiCalendarDateView=yr,e.CalendarRangeHourService=br,e.SuiCalendarHourView=wr,e.CalendarRangeMinuteService=Dr,e.SuiCalendarMinuteView=Or,e.CalendarRangeMonthService=Sr,e.SuiCalendarMonthView=Mr,e.CalendarRangeYearService=kr,e.SuiCalendarYearView=Pr,e.SuiDatepickerModule=xr,e.SuiDimmer=Er,e.SuiDimmerModule=Lr,e.SuiDropdownMenuItem=Rr,e.SuiDropdownMenu=Ar,e.SuiDropdown=Fr,e.DropdownAutoCloseType=jr,e.DropdownService=Vr,e.SuiDropdownModule=Yr,e.ActiveModal=Br,e.ModalSize=Ur,e.ModalConfig=zr,e.TemplateModalConfig=Wr,e.ComponentModalConfig=qr,e.ModalControls=Kr,e.Modal=$r,e.ModalTemplate=Jr,e.SuiModal=Zr,e.SuiModalService=Xr,e.SuiModalModule=eo,e.SuiPopupComponentController=Wi,e.PopupTrigger=Yi,e.PopupConfig=Bi,e.SuiPopupController=Ui,e.TemplatePopupConfig=Qi,e.SuiPopupTemplateController=Ki,e.SuiPopupArrow=$i,e.SuiPopup=Ni,e.SuiPopupDirective=Xi,e.SuiPopupConfig=Ji,e.SuiPopupModule=er,e.SuiProgress=to,e.SuiProgressModule=no,e.SuiRating=ro,e.SuiRatingValueAccessor=oo,e.SuiRatingModule=so,e.SuiSearchResult=ao,e.SuiSearch=uo,e.SearchService=co,e.SuiSearchModule=po,e.SuiSelectBase=mo,e.SuiMultiSelectLabel=yo,e.SuiMultiSelect=bo,e.SuiMultiSelectValueAccessor=wo,e.SuiSelectOption=ho,e.SuiSelect=Do,e.SuiSelectValueAccessor=Oo,e.SuiSelectSearch=fo,e.SuiSelectModule=Co,e.SuiSidebarContainer=xo,e.SuiSidebarSibling=Po,e.SuiSidebar=ko,e.SidebarTransition=So,e.SidebarDirection=Mo,e.SidebarService=To,e.SuiSidebarModule=Io,e.Tab=Eo,e.SuiTabset=Vo,e.SuiTabContent=jo,e.SuiTabHeader=Lo,e.SuiTabsModule=Ho,e.TransitionController=vt,e.Transition=yt,e.SuiTransition=bt,e.SuiTransitionModule=wt,e.CustomValidator=It,e.customValidatorFactory=a,e.CustomValueAccessor=Et,e.customValueAccessorFactory=c,e.DateUtil=Vt,e.HandledEvent=Lt,e.Util=jt,e.SuiComponentFactory=Ht,e.PositioningPlacement=tn,e.PositioningService=nn,e.SuiUtilityModule=rn,e.SuiModule=Ro,Object.defineProperty(e,"__esModule",{value:!0})}); diff --git a/dist/modules/search/services/search.service.js b/dist/modules/search/services/search.service.js index 08f148159..070edfc69 100644 --- a/dist/modules/search/services/search.service.js +++ b/dist/modules/search/services/search.service.js @@ -22,6 +22,8 @@ var SearchService = /** @class */ (function () { }; // Set default values and reset. this.allowEmptyQuery = allowEmptyQuery; + this._query = ""; + this.resetQueryOnChange = true; this.searchDelay = 0; this.reset(); } @@ -196,9 +198,12 @@ var SearchService = /** @class */ (function () { this._results = []; this._resultsCache = {}; this._isSearching = false; - if (this.resetQueryOnChange) { + if (this.resetQueryOnChange || !this.query) { this.updateQuery(""); } + else { + this.updateQuery(this.query); + } }; return SearchService; }()); diff --git a/dist/modules/search/services/search.service.js.map b/dist/modules/search/services/search.service.js.map index d9ca6e48e..e07ce4f20 100644 --- a/dist/modules/search/services/search.service.js.map +++ b/dist/modules/search/services/search.service.js.map @@ -1 +1 @@ -{"version":3,"file":"search.service.js","sourceRoot":"","sources":["../../../../src/modules/search/services/search.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKhD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n, LookupFnResult, FilterFn } from \"../helpers/lookup-fn\";\n\ninterface ICachedArray { [query:string]:T[]; }\n\nexport class SearchService {\n // Stores the available options.\n private _options:T[];\n // Converts a query string into an array of options. Must be a function returning a promise.\n private _optionsLookup?:LookupFn;\n // Field that options are searched & displayed on.\n private _optionsField?:string;\n // Filters a list of options.\n public optionsFilter:FilterFn;\n\n public get options():T[] {\n return this._options;\n }\n\n public set options(options:T[]) {\n this._options = options || [];\n // We cannot use both local & remote options simultaneously.\n this._optionsLookup = undefined;\n // Reset entire service with new options.\n this.reset();\n }\n\n public get optionsLookup():LookupFn | undefined {\n return this._optionsLookup;\n }\n\n public set optionsLookup(lookupFn:LookupFn | undefined) {\n this._optionsLookup = lookupFn;\n // As before, cannot use local & remote options simultaneously.\n this._options = [];\n this.reset();\n }\n\n public get hasItemLookup():boolean {\n return !!this.optionsLookup && this.optionsLookup.length === 2;\n }\n\n public get optionsField():string | undefined {\n return this._optionsField;\n }\n\n public set optionsField(field:string | undefined) {\n this._optionsField = field;\n // We need to reset otherwise we would now be showing invalid search results.\n this.reset();\n }\n\n // Stores the results of the query.\n private _results:T[];\n // Cache of results, indexed by query.\n private _resultsCache:ICachedArray;\n\n public get results():T[] {\n return this._results;\n }\n\n private _query:string;\n // Allows the query to be empty when the options change.\n public resetQueryOnChange:boolean;\n // Allows the empty query to produce results.\n public allowEmptyQuery:boolean;\n // How long to delay the search for when using updateQueryDelayed. Stored in ms.\n public searchDelay:number;\n // Stores the search timeout handle so we can cancel it.\n private _searchDelayTimeout:number;\n // Provides 'loading' functionality.\n private _isSearching:boolean;\n\n public get query():string {\n return this._query;\n }\n\n public get isSearching():boolean {\n return this._isSearching;\n }\n\n constructor(allowEmptyQuery:boolean = false) {\n this._options = [];\n this.optionsFilter = (os, q) => {\n // Convert the query string to a RegExp.\n const regex = this.toRegex(this._query);\n\n if (regex instanceof RegExp) {\n // Only update the results if the query was valid regex.\n // This avoids the results suddenly becoming empty if an invalid regex string is inputted.\n return os\n // Filter on the options with a string match on the field we are testing.\n .filter(o => Util.Object.readValue(o, this._optionsField)\n .toString()\n .match(regex));\n }\n\n // Don't update since it wasn't a valid regex.\n return false;\n };\n\n // Set default values and reset.\n this.allowEmptyQuery = allowEmptyQuery;\n this.searchDelay = 0;\n this.reset();\n }\n\n // Updates the query after the specified search delay.\n public updateQueryDelayed(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n clearTimeout(this._searchDelayTimeout);\n this._searchDelayTimeout = window.setTimeout(\n () => {\n this.updateQuery(query, callback);\n },\n this.searchDelay\n );\n }\n\n // Updates the current search query.\n public updateQuery(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n if (this._query === \"\" && !this.allowEmptyQuery) {\n // Don't update if the new query is empty (and we don't allow empty queries).\n // Don't reset so that when animating closed we don't get a judder.\n return callback();\n }\n\n if (this._resultsCache.hasOwnProperty(this._query)) {\n // If the query is already cached, make use of it.\n this._results = this._resultsCache[this._query];\n\n return callback();\n }\n\n if (this._optionsLookup) {\n this._isSearching = true;\n\n // Call the options lookup without a this context.\n const queryLookup = this._optionsLookup.call(undefined, this._query) as LookupFnResult;\n\n queryLookup\n .then(results => {\n this._isSearching = false;\n\n this.updateResults(results);\n return callback();\n })\n .catch(error => {\n // Unset 'loading' state, and throw the returned error without updating the results.\n this._isSearching = false;\n return callback(error);\n });\n\n return;\n }\n\n const filtered = this.optionsFilter.call(undefined, this._options, this._query);\n if (filtered) {\n this.updateResults(filtered);\n }\n return callback();\n }\n\n // Updates & caches the new set of results.\n private updateResults(results:T[]):void {\n this._resultsCache[this._query] = results;\n this._results = results;\n }\n\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U[]):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U | U[]):LookupFnResult | LookupFnResult {\n if (initial instanceof Array) {\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n\n // Converts a query string to regex without throwing an error.\n private toRegex(query:string):RegExp | string {\n try {\n return new RegExp(query, \"i\");\n } catch (e) {\n return query;\n }\n }\n\n // Generates HTML for highlighted match text.\n public highlightMatches(text:string, query:string):string {\n const regex = this.toRegex(query);\n if (regex instanceof RegExp) {\n return text.replace(regex, match => `${match}`);\n }\n return text;\n }\n\n // Resets the search back to a pristine state.\n private reset():void {\n this._results = [];\n this._resultsCache = {};\n this._isSearching = false;\n if (this.resetQueryOnChange) {\n this.updateQuery(\"\");\n }\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"search.service.js","sourceRoot":"","sources":["../../../../src/modules/search/services/search.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKhD,IAAA;IA4EI,uBAAY,eAA+B;QAA/B,gCAAA,EAAA,uBAA+B;QAA3C,iBA0BC;QAzBG,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,UAAC,EAAE,EAAE,CAAC;;YAEvB,IAAM,KAAK,GAAG,KAAI,CAAC,OAAO,CAAC,KAAI,CAAC,MAAM,CAAC,CAAC;YAExC,EAAE,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC,CAAC,CAAC;;;gBAG1B,MAAM,CAAC,EAAE;qBAEJ,MAAM,CAAC,UAAA,CAAC;oBAAI,OAAA,IAAI,CAAC,MAAM,CAAC,SAAS,CAAY,CAAC,EAAE,KAAI,CAAC,aAAa,CAAC;yBAC/D,QAAQ,EAAE;yBACV,KAAK,CAAC,KAAK,CAAC;gBAFJ,CAEI,CAAC,CAAC;aAC1B;;YAGD,MAAM,CAAC,KAAK,CAAC;SAChB,CAAC;;QAGF,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,kBA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C,OAAO,CAAC,KAAK,CAAC,CAAC;QAClC,EAAE,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC,CAAC,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,QAAM,KAAK,SAAM,EAAjB,CAAiB,CAAC,CAAC;SAC1D;QACD,MAAM,CAAC,IAAI,CAAC;KACf;IAED,8CAA8C;;IACtC,6BAAK;;IAAb;QACI,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACzC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;SACxB;QAAC,IAAI,CAAC,CAAC;YACJ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAChC;KACJ;wBAtNL;IAuNC,CAAA;AAlND,yBAkNC","sourcesContent":["import { Util } from \"../../../misc/util/index\";\nimport { LookupFn, LookupFnResult, FilterFn } from \"../helpers/lookup-fn\";\n\ninterface ICachedArray { [query:string]:T[]; }\n\nexport class SearchService {\n // Stores the available options.\n private _options:T[];\n // Converts a query string into an array of options. Must be a function returning a promise.\n private _optionsLookup?:LookupFn;\n // Field that options are searched & displayed on.\n private _optionsField?:string;\n // Filters a list of options.\n public optionsFilter:FilterFn;\n\n public get options():T[] {\n return this._options;\n }\n\n public set options(options:T[]) {\n this._options = options || [];\n // We cannot use both local & remote options simultaneously.\n this._optionsLookup = undefined;\n // Reset entire service with new options.\n this.reset();\n }\n\n public get optionsLookup():LookupFn | undefined {\n return this._optionsLookup;\n }\n\n public set optionsLookup(lookupFn:LookupFn | undefined) {\n this._optionsLookup = lookupFn;\n // As before, cannot use local & remote options simultaneously.\n this._options = [];\n this.reset();\n }\n\n public get hasItemLookup():boolean {\n return !!this.optionsLookup && this.optionsLookup.length === 2;\n }\n\n public get optionsField():string | undefined {\n return this._optionsField;\n }\n\n public set optionsField(field:string | undefined) {\n this._optionsField = field;\n // We need to reset otherwise we would now be showing invalid search results.\n this.reset();\n }\n\n // Stores the results of the query.\n private _results:T[];\n // Cache of results, indexed by query.\n private _resultsCache:ICachedArray;\n\n public get results():T[] {\n return this._results;\n }\n\n private _query:string;\n // Allows the query to be empty when the options change.\n public resetQueryOnChange:boolean;\n // Allows the empty query to produce results.\n public allowEmptyQuery:boolean;\n // How long to delay the search for when using updateQueryDelayed. Stored in ms.\n public searchDelay:number;\n // Stores the search timeout handle so we can cancel it.\n private _searchDelayTimeout:number;\n // Provides 'loading' functionality.\n private _isSearching:boolean;\n\n public get query():string {\n return this._query;\n }\n\n public get isSearching():boolean {\n return this._isSearching;\n }\n\n constructor(allowEmptyQuery:boolean = false) {\n this._options = [];\n this.optionsFilter = (os, q) => {\n // Convert the query string to a RegExp.\n const regex = this.toRegex(this._query);\n\n if (regex instanceof RegExp) {\n // Only update the results if the query was valid regex.\n // This avoids the results suddenly becoming empty if an invalid regex string is inputted.\n return os\n // Filter on the options with a string match on the field we are testing.\n .filter(o => Util.Object.readValue(o, this._optionsField)\n .toString()\n .match(regex));\n }\n\n // Don't update since it wasn't a valid regex.\n return false;\n };\n\n // Set default values and reset.\n this.allowEmptyQuery = allowEmptyQuery;\n this._query = \"\";\n this.resetQueryOnChange = true;\n this.searchDelay = 0;\n this.reset();\n }\n\n // Updates the query after the specified search delay.\n public updateQueryDelayed(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n clearTimeout(this._searchDelayTimeout);\n this._searchDelayTimeout = window.setTimeout(\n () => {\n this.updateQuery(query, callback);\n },\n this.searchDelay\n );\n }\n\n // Updates the current search query.\n public updateQuery(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n if (this._query === \"\" && !this.allowEmptyQuery) {\n // Don't update if the new query is empty (and we don't allow empty queries).\n // Don't reset so that when animating closed we don't get a judder.\n return callback();\n }\n\n if (this._resultsCache.hasOwnProperty(this._query)) {\n // If the query is already cached, make use of it.\n this._results = this._resultsCache[this._query];\n\n return callback();\n }\n\n if (this._optionsLookup) {\n this._isSearching = true;\n\n // Call the options lookup without a this context.\n const queryLookup = this._optionsLookup.call(undefined, this._query) as LookupFnResult;\n\n queryLookup\n .then(results => {\n this._isSearching = false;\n\n this.updateResults(results);\n return callback();\n })\n .catch(error => {\n // Unset 'loading' state, and throw the returned error without updating the results.\n this._isSearching = false;\n return callback(error);\n });\n\n return;\n }\n\n const filtered = this.optionsFilter.call(undefined, this._options, this._query);\n if (filtered) {\n this.updateResults(filtered);\n }\n return callback();\n }\n\n // Updates & caches the new set of results.\n private updateResults(results:T[]):void {\n this._resultsCache[this._query] = results;\n this._results = results;\n }\n\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U[]):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U | U[]):LookupFnResult | LookupFnResult {\n if (initial instanceof Array) {\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n\n // Converts a query string to regex without throwing an error.\n private toRegex(query:string):RegExp | string {\n try {\n return new RegExp(query, \"i\");\n } catch (e) {\n return query;\n }\n }\n\n // Generates HTML for highlighted match text.\n public highlightMatches(text:string, query:string):string {\n const regex = this.toRegex(query);\n if (regex instanceof RegExp) {\n return text.replace(regex, match => `${match}`);\n }\n return text;\n }\n\n // Resets the search back to a pristine state.\n private reset():void {\n this._results = [];\n this._resultsCache = {};\n this._isSearching = false;\n if (this.resetQueryOnChange || !this.query) {\n this.updateQuery(\"\");\n } else {\n this.updateQuery(this.query);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/src/modules/search/services/search.service.ts b/src/modules/search/services/search.service.ts index cb9ac4e59..a6db71032 100644 --- a/src/modules/search/services/search.service.ts +++ b/src/modules/search/services/search.service.ts @@ -101,6 +101,8 @@ export class SearchService { // Set default values and reset. this.allowEmptyQuery = allowEmptyQuery; + this._query = ""; + this.resetQueryOnChange = true; this.searchDelay = 0; this.reset(); } @@ -205,8 +207,10 @@ export class SearchService { this._results = []; this._resultsCache = {}; this._isSearching = false; - if (this.resetQueryOnChange) { + if (this.resetQueryOnChange || !this.query) { this.updateQuery(""); + } else { + this.updateQuery(this.query); } } } From dbc2a26ceb495fe41fdf1ecc606bbe2b506cf264 Mon Sep 17 00:00:00 2001 From: Benjamin Coenen Date: Tue, 20 Mar 2018 17:08:03 +0100 Subject: [PATCH 7/9] feat(search): add allowEmptyQuery and resetQueryOnChange on search Signed-off-by: Benjamin Coenen --- .gitignore | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 3df38dff7..8a6276391 100644 --- a/.gitignore +++ b/.gitignore @@ -32,10 +32,10 @@ testem.log Thumbs.db # non TS files -# *.d.ts -# *.metadata.json -# *.js -# *.js.map +*.d.ts +*.metadata.json +*.js +*.js.map # build scripts !scripts/**/* @@ -43,3 +43,5 @@ Thumbs.db # output files demo/dist +dist +bundles From 1908beb967c347da98e5e0b3fdd96cfd4c7885e7 Mon Sep 17 00:00:00 2001 From: Benjamin Coenen Date: Tue, 20 Mar 2018 17:08:25 +0100 Subject: [PATCH 8/9] feat(search): add allowEmptyQuery and resetQueryOnChange on search Signed-off-by: Benjamin Coenen --- bundles/ng2-semantic-ui.umd.js | 14313 ---------------- bundles/ng2-semantic-ui.umd.min.js | 7 - dist/behaviors/index.d.ts | 1 - dist/behaviors/index.js | 2 - dist/behaviors/index.js.map | 1 - dist/behaviors/index.metadata.json | 1 - dist/behaviors/localization/index.d.ts | 3 - dist/behaviors/localization/index.js | 3 - dist/behaviors/localization/index.js.map | 1 - .../localization/index.metadata.json | 1 - .../interfaces/datepicker-values.d.ts | 22 - .../interfaces/datepicker-values.js | 1 - .../interfaces/datepicker-values.js.map | 1 - .../datepicker-values.metadata.json | 1 - .../localization/interfaces/partial.d.ts | 3 - .../localization/interfaces/partial.js | 1 - .../localization/interfaces/partial.js.map | 1 - .../interfaces/partial.metadata.json | 1 - .../interfaces/search-values.d.ts | 7 - .../localization/interfaces/search-values.js | 1 - .../interfaces/search-values.js.map | 1 - .../interfaces/search-values.metadata.json | 1 - .../interfaces/select-values.d.ts | 11 - .../localization/interfaces/select-values.js | 1 - .../interfaces/select-values.js.map | 1 - .../interfaces/select-values.metadata.json | 1 - .../localization/interfaces/values.d.ts | 14 - .../localization/interfaces/values.js | 1 - .../localization/interfaces/values.js.map | 1 - .../interfaces/values.metadata.json | 1 - dist/behaviors/localization/locales/de.d.ts | 7 - dist/behaviors/localization/locales/de.js | 51 - dist/behaviors/localization/locales/de.js.map | 1 - .../behaviors/localization/locales/en-AU.d.ts | 7 - dist/behaviors/localization/locales/en-AU.js | 11 - .../localization/locales/en-AU.js.map | 1 - .../behaviors/localization/locales/en-GB.d.ts | 3 - dist/behaviors/localization/locales/en-GB.js | 56 - .../localization/locales/en-GB.js.map | 1 - .../behaviors/localization/locales/en-US.d.ts | 3 - dist/behaviors/localization/locales/en-US.js | 14 - .../localization/locales/en-US.js.map | 1 - dist/behaviors/localization/locales/es.d.ts | 7 - dist/behaviors/localization/locales/es.js | 51 - dist/behaviors/localization/locales/es.js.map | 1 - dist/behaviors/localization/locales/fr.d.ts | 7 - dist/behaviors/localization/locales/fr.js | 51 - dist/behaviors/localization/locales/fr.js.map | 1 - dist/behaviors/localization/locales/ge.d.ts | 7 - dist/behaviors/localization/locales/ge.js | 52 - dist/behaviors/localization/locales/ge.js.map | 1 - dist/behaviors/localization/locales/he.d.ts | 7 - dist/behaviors/localization/locales/he.js | 51 - dist/behaviors/localization/locales/he.js.map | 1 - .../behaviors/localization/locales/index.d.ts | 16 - dist/behaviors/localization/locales/index.js | 27 - .../localization/locales/index.js.map | 1 - dist/behaviors/localization/locales/it.d.ts | 7 - dist/behaviors/localization/locales/it.js | 51 - dist/behaviors/localization/locales/it.js.map | 1 - dist/behaviors/localization/locales/nl.d.ts | 7 - dist/behaviors/localization/locales/nl.js | 61 - dist/behaviors/localization/locales/nl.js.map | 1 - dist/behaviors/localization/locales/pt.d.ts | 7 - dist/behaviors/localization/locales/pt.js | 51 - dist/behaviors/localization/locales/pt.js.map | 1 - dist/behaviors/localization/locales/ru.d.ts | 7 - dist/behaviors/localization/locales/ru.js | 51 - dist/behaviors/localization/locales/ru.js.map | 1 - .../localization/localization.module.d.ts | 2 - .../localization/localization.module.js | 18 - .../localization/localization.module.js.map | 1 - .../localization.module.metadata.json | 1 - dist/behaviors/localization/public.d.ts | 2 - dist/behaviors/localization/public.js | 2 - dist/behaviors/localization/public.js.map | 1 - .../localization/public.metadata.json | 1 - .../services/localization.service.d.ts | 16 - .../services/localization.service.js | 69 - .../services/localization.service.js.map | 1 - .../localization.service.metadata.json | 1 - dist/behaviors/public.d.ts | 1 - dist/behaviors/public.js | 2 - dist/behaviors/public.js.map | 1 - dist/behaviors/public.metadata.json | 1 - dist/collections/index.d.ts | 2 - dist/collections/index.js | 3 - dist/collections/index.js.map | 1 - dist/collections/index.metadata.json | 1 - .../message/components/message.d.ts | 16 - .../collections/message/components/message.js | 39 - .../message/components/message.js.map | 1 - .../message/components/message.metadata.json | 1 - dist/collections/message/index.d.ts | 2 - dist/collections/message/index.js | 3 - dist/collections/message/index.js.map | 1 - dist/collections/message/index.metadata.json | 1 - dist/collections/message/message.module.d.ts | 2 - dist/collections/message/message.module.js | 27 - .../collections/message/message.module.js.map | 1 - .../message/message.module.metadata.json | 1 - dist/collections/message/public.d.ts | 1 - dist/collections/message/public.js | 2 - dist/collections/message/public.js.map | 1 - dist/collections/message/public.metadata.json | 1 - .../pagination/components/pagination.d.ts | 27 - .../pagination/components/pagination.js | 148 - .../pagination/components/pagination.js.map | 1 - .../components/pagination.metadata.json | 1 - dist/collections/pagination/index.d.ts | 2 - dist/collections/pagination/index.js | 3 - dist/collections/pagination/index.js.map | 1 - .../pagination/index.metadata.json | 1 - .../pagination/pagination.module.d.ts | 2 - .../pagination/pagination.module.js | 20 - .../pagination/pagination.module.js.map | 1 - .../pagination.module.metadata.json | 1 - dist/collections/pagination/public.d.ts | 1 - dist/collections/pagination/public.js | 2 - dist/collections/pagination/public.js.map | 1 - .../pagination/public.metadata.json | 1 - dist/collections/public.d.ts | 2 - dist/collections/public.js | 3 - dist/collections/public.js.map | 1 - dist/collections/public.metadata.json | 1 - dist/index.d.ts | 5 - dist/index.js | 6 - dist/index.js.map | 1 - dist/index.metadata.json | 1 - dist/karma.conf.d.ts | 0 dist/karma.conf.js | 36 - dist/karma.conf.js.map | 1 - dist/misc/index.d.ts | 1 - dist/misc/index.js | 2 - dist/misc/index.js.map | 1 - dist/misc/index.metadata.json | 1 - dist/misc/public.d.ts | 1 - dist/misc/public.js | 2 - dist/misc/public.js.map | 1 - dist/misc/public.metadata.json | 1 - dist/misc/util/helpers/custom-validator.d.ts | 18 - dist/misc/util/helpers/custom-validator.js | 24 - .../misc/util/helpers/custom-validator.js.map | 1 - .../helpers/custom-validator.metadata.json | 1 - .../util/helpers/custom-value-accessor.d.ts | 20 - .../util/helpers/custom-value-accessor.js | 28 - .../util/helpers/custom-value-accessor.js.map | 1 - .../custom-value-accessor.metadata.json | 1 - dist/misc/util/helpers/date.d.ts | 17 - dist/misc/util/helpers/date.js | 172 - dist/misc/util/helpers/date.js.map | 1 - dist/misc/util/helpers/date.metadata.json | 1 - dist/misc/util/helpers/focus-event.d.ts | 3 - dist/misc/util/helpers/focus-event.js | 1 - dist/misc/util/helpers/focus-event.js.map | 1 - .../util/helpers/focus-event.metadata.json | 1 - dist/misc/util/helpers/util.d.ts | 47 - dist/misc/util/helpers/util.js | 96 - dist/misc/util/helpers/util.js.map | 1 - dist/misc/util/helpers/util.metadata.json | 1 - dist/misc/util/index.d.ts | 8 - dist/misc/util/index.js | 8 - dist/misc/util/index.js.map | 1 - dist/misc/util/index.metadata.json | 1 - dist/misc/util/public.d.ts | 1 - dist/misc/util/public.js | 2 - dist/misc/util/public.js.map | 1 - dist/misc/util/public.metadata.json | 1 - .../services/component-factory.service.d.ts | 18 - .../services/component-factory.service.js | 75 - .../services/component-factory.service.js.map | 1 - .../component-factory.service.metadata.json | 1 - .../util/services/positioning.service.d.ts | 39 - .../misc/util/services/positioning.service.js | 137 - .../util/services/positioning.service.js.map | 1 - .../positioning.service.metadata.json | 1 - dist/misc/util/util.module.d.ts | 2 - dist/misc/util/util.module.js | 20 - dist/misc/util/util.module.js.map | 1 - dist/misc/util/util.module.metadata.json | 1 - dist/modules/accordion/accordion.module.d.ts | 2 - dist/modules/accordion/accordion.module.js | 33 - .../modules/accordion/accordion.module.js.map | 1 - .../accordion/accordion.module.metadata.json | 1 - .../accordion/components/accordion-panel.d.ts | 17 - .../accordion/components/accordion-panel.js | 88 - .../components/accordion-panel.js.map | 1 - .../components/accordion-panel.metadata.json | 1 - .../accordion/components/accordion.d.ts | 14 - .../modules/accordion/components/accordion.js | 63 - .../accordion/components/accordion.js.map | 1 - .../components/accordion.metadata.json | 1 - dist/modules/accordion/index.d.ts | 4 - dist/modules/accordion/index.js | 5 - dist/modules/accordion/index.js.map | 1 - dist/modules/accordion/index.metadata.json | 1 - dist/modules/accordion/public.d.ts | 1 - dist/modules/accordion/public.js | 2 - dist/modules/accordion/public.js.map | 1 - dist/modules/accordion/public.metadata.json | 1 - .../accordion/services/accordion.service.d.ts | 10 - .../accordion/services/accordion.service.js | 25 - .../services/accordion.service.js.map | 1 - .../services/accordion.service.metadata.json | 1 - dist/modules/checkbox/checkbox.module.d.ts | 2 - dist/modules/checkbox/checkbox.module.js | 37 - dist/modules/checkbox/checkbox.module.js.map | 1 - .../checkbox/checkbox.module.metadata.json | 1 - .../modules/checkbox/components/checkbox.d.ts | 24 - dist/modules/checkbox/components/checkbox.js | 105 - .../checkbox/components/checkbox.js.map | 1 - .../components/checkbox.metadata.json | 1 - dist/modules/checkbox/components/radio.d.ts | 26 - dist/modules/checkbox/components/radio.js | 108 - dist/modules/checkbox/components/radio.js.map | 1 - .../checkbox/components/radio.metadata.json | 1 - .../checkbox/directives/radio-manager.d.ts | 12 - .../checkbox/directives/radio-manager.js | 60 - .../checkbox/directives/radio-manager.js.map | 1 - .../directives/radio-manager.metadata.json | 1 - dist/modules/checkbox/index.d.ts | 4 - dist/modules/checkbox/index.js | 5 - dist/modules/checkbox/index.js.map | 1 - dist/modules/checkbox/index.metadata.json | 1 - dist/modules/checkbox/public.d.ts | 1 - dist/modules/checkbox/public.js | 2 - dist/modules/checkbox/public.js.map | 1 - dist/modules/checkbox/public.metadata.json | 1 - dist/modules/collapse/collapse.module.d.ts | 2 - dist/modules/collapse/collapse.module.js | 25 - dist/modules/collapse/collapse.module.js.map | 1 - .../collapse/collapse.module.metadata.json | 1 - .../modules/collapse/directives/collapse.d.ts | 16 - dist/modules/collapse/directives/collapse.js | 124 - .../collapse/directives/collapse.js.map | 1 - .../directives/collapse.metadata.json | 1 - dist/modules/collapse/index.d.ts | 2 - dist/modules/collapse/index.js | 3 - dist/modules/collapse/index.js.map | 1 - dist/modules/collapse/index.metadata.json | 1 - dist/modules/collapse/public.d.ts | 1 - dist/modules/collapse/public.js | 2 - dist/modules/collapse/public.js.map | 1 - dist/modules/collapse/public.metadata.json | 1 - .../datepicker/classes/calendar-config.d.ts | 32 - .../datepicker/classes/calendar-config.js | 80 - .../datepicker/classes/calendar-config.js.map | 1 - .../classes/calendar-config.metadata.json | 1 - .../datepicker/classes/calendar-mappings.d.ts | 23 - .../datepicker/classes/calendar-mappings.js | 119 - .../classes/calendar-mappings.js.map | 1 - .../classes/calendar-mappings.metadata.json | 1 - .../datepicker/classes/date-comparer.d.ts | 10 - .../datepicker/classes/date-comparer.js | 33 - .../datepicker/classes/date-comparer.js.map | 1 - .../classes/date-comparer.metadata.json | 1 - .../datepicker/classes/date-parser.d.ts | 12 - .../modules/datepicker/classes/date-parser.js | 44 - .../datepicker/classes/date-parser.js.map | 1 - .../classes/date-parser.metadata.json | 1 - .../components/calendar-view-title.d.ts | 7 - .../components/calendar-view-title.js | 23 - .../components/calendar-view-title.js.map | 1 - .../calendar-view-title.metadata.json | 1 - .../datepicker/components/datepicker.d.ts | 16 - .../datepicker/components/datepicker.js | 38 - .../datepicker/components/datepicker.js.map | 1 - .../components/datepicker.metadata.json | 1 - .../modules/datepicker/datepicker.module.d.ts | 2 - dist/modules/datepicker/datepicker.module.js | 59 - .../datepicker/datepicker.module.js.map | 1 - .../datepicker.module.metadata.json | 1 - .../datepicker/directives/calendar-item.d.ts | 23 - .../datepicker/directives/calendar-item.js | 67 - .../directives/calendar-item.js.map | 1 - .../directives/calendar-item.metadata.json | 1 - .../directives/datepicker.directive.d.ts | 43 - .../directives/datepicker.directive.js | 233 - .../directives/datepicker.directive.js.map | 1 - .../datepicker.directive.metadata.json | 1 - .../directives/input.directive.d.ts | 25 - .../datepicker/directives/input.directive.js | 155 - .../directives/input.directive.js.map | 1 - .../directives/input.directive.metadata.json | 1 - dist/modules/datepicker/helpers/date-fns.d.ts | 9 - dist/modules/datepicker/helpers/date-fns.js | 99 - .../datepicker/helpers/date-fns.js.map | 1 - .../datepicker/helpers/date-fns.metadata.json | 1 - .../datepicker/helpers/is-webview.d.ts | 1 - dist/modules/datepicker/helpers/is-webview.js | 1 - .../datepicker/helpers/is-webview.js.map | 1 - dist/modules/datepicker/index.d.ts | 19 - dist/modules/datepicker/index.js | 20 - dist/modules/datepicker/index.js.map | 1 - dist/modules/datepicker/index.metadata.json | 1 - dist/modules/datepicker/public.d.ts | 1 - dist/modules/datepicker/public.js | 2 - dist/modules/datepicker/public.js.map | 1 - dist/modules/datepicker/public.metadata.json | 1 - .../services/calendar-range.service.d.ts | 42 - .../services/calendar-range.service.js | 146 - .../services/calendar-range.service.js.map | 1 - .../calendar-range.service.metadata.json | 1 - .../datepicker/services/calendar.service.d.ts | 32 - .../datepicker/services/calendar.service.js | 129 - .../services/calendar.service.js.map | 1 - .../services/calendar.service.metadata.json | 1 - .../datepicker/views/calendar-view.d.ts | 32 - .../modules/datepicker/views/calendar-view.js | 174 - .../datepicker/views/calendar-view.js.map | 1 - .../views/calendar-view.metadata.json | 1 - dist/modules/datepicker/views/date-view.d.ts | 13 - dist/modules/datepicker/views/date-view.js | 68 - .../modules/datepicker/views/date-view.js.map | 1 - .../datepicker/views/date-view.metadata.json | 1 - dist/modules/datepicker/views/hour-view.d.ts | 11 - dist/modules/datepicker/views/hour-view.js | 55 - .../modules/datepicker/views/hour-view.js.map | 1 - .../datepicker/views/hour-view.metadata.json | 1 - .../modules/datepicker/views/minute-view.d.ts | 13 - dist/modules/datepicker/views/minute-view.js | 71 - .../datepicker/views/minute-view.js.map | 1 - .../views/minute-view.metadata.json | 1 - dist/modules/datepicker/views/month-view.d.ts | 11 - dist/modules/datepicker/views/month-view.js | 53 - .../datepicker/views/month-view.js.map | 1 - .../datepicker/views/month-view.metadata.json | 1 - dist/modules/datepicker/views/year-view.d.ts | 12 - dist/modules/datepicker/views/year-view.js | 57 - .../modules/datepicker/views/year-view.js.map | 1 - .../datepicker/views/year-view.metadata.json | 1 - dist/modules/dimmer/components/dimmer.d.ts | 15 - dist/modules/dimmer/components/dimmer.js | 77 - dist/modules/dimmer/components/dimmer.js.map | 1 - .../dimmer/components/dimmer.metadata.json | 1 - dist/modules/dimmer/dimmer.module.d.ts | 2 - dist/modules/dimmer/dimmer.module.js | 27 - dist/modules/dimmer/dimmer.module.js.map | 1 - .../dimmer/dimmer.module.metadata.json | 1 - dist/modules/dimmer/index.d.ts | 2 - dist/modules/dimmer/index.js | 3 - dist/modules/dimmer/index.js.map | 1 - dist/modules/dimmer/index.metadata.json | 1 - dist/modules/dimmer/public.d.ts | 1 - dist/modules/dimmer/public.js | 2 - dist/modules/dimmer/public.js.map | 1 - dist/modules/dimmer/public.metadata.json | 1 - .../dropdown/directives/dropdown-menu.d.ts | 43 - .../dropdown/directives/dropdown-menu.js | 315 - .../dropdown/directives/dropdown-menu.js.map | 1 - .../directives/dropdown-menu.metadata.json | 1 - .../modules/dropdown/directives/dropdown.d.ts | 24 - dist/modules/dropdown/directives/dropdown.js | 157 - .../dropdown/directives/dropdown.js.map | 1 - .../directives/dropdown.metadata.json | 1 - dist/modules/dropdown/dropdown.module.d.ts | 2 - dist/modules/dropdown/dropdown.module.js | 32 - dist/modules/dropdown/dropdown.module.js.map | 1 - .../dropdown/dropdown.module.metadata.json | 1 - dist/modules/dropdown/index.d.ts | 4 - dist/modules/dropdown/index.js | 5 - dist/modules/dropdown/index.js.map | 1 - dist/modules/dropdown/index.metadata.json | 1 - dist/modules/dropdown/public.d.ts | 1 - dist/modules/dropdown/public.js | 2 - dist/modules/dropdown/public.js.map | 1 - dist/modules/dropdown/public.metadata.json | 1 - .../dropdown/services/dropdown.service.d.ts | 25 - .../dropdown/services/dropdown.service.js | 100 - .../dropdown/services/dropdown.service.js.map | 1 - .../services/dropdown.service.metadata.json | 1 - dist/modules/index.d.ts | 15 - dist/modules/index.js | 16 - dist/modules/index.js.map | 1 - dist/modules/index.metadata.json | 1 - dist/modules/modal/classes/active-modal.d.ts | 14 - dist/modules/modal/classes/active-modal.js | 63 - .../modules/modal/classes/active-modal.js.map | 1 - .../modal/classes/active-modal.metadata.json | 1 - dist/modules/modal/classes/modal-config.d.ts | 31 - dist/modules/modal/classes/modal-config.js | 72 - .../modules/modal/classes/modal-config.js.map | 1 - .../modal/classes/modal-config.metadata.json | 1 - .../modules/modal/classes/modal-controls.d.ts | 10 - dist/modules/modal/classes/modal-controls.js | 46 - .../modal/classes/modal-controls.js.map | 1 - .../classes/modal-controls.metadata.json | 1 - .../modules/modal/classes/modal-template.d.ts | 7 - dist/modules/modal/classes/modal-template.js | 27 - .../modal/classes/modal-template.js.map | 1 - .../classes/modal-template.metadata.json | 1 - dist/modules/modal/components/modal.d.ts | 46 - dist/modules/modal/components/modal.js | 230 - dist/modules/modal/components/modal.js.map | 1 - .../modal/components/modal.metadata.json | 1 - dist/modules/modal/index.d.ts | 7 - dist/modules/modal/index.js | 8 - dist/modules/modal/index.js.map | 1 - dist/modules/modal/index.metadata.json | 1 - dist/modules/modal/modal.module.d.ts | 2 - dist/modules/modal/modal.module.js | 38 - dist/modules/modal/modal.module.js.map | 1 - dist/modules/modal/modal.module.metadata.json | 1 - dist/modules/modal/public.d.ts | 1 - dist/modules/modal/public.js | 2 - dist/modules/modal/public.js.map | 1 - dist/modules/modal/public.metadata.json | 1 - .../modules/modal/services/modal.service.d.ts | 8 - dist/modules/modal/services/modal.service.js | 65 - .../modal/services/modal.service.js.map | 1 - .../services/modal.service.metadata.json | 1 - .../classes/popup-component-controller.d.ts | 12 - .../classes/popup-component-controller.js | 45 - .../classes/popup-component-controller.js.map | 1 - .../popup-component-controller.metadata.json | 1 - dist/modules/popup/classes/popup-config.d.ts | 32 - dist/modules/popup/classes/popup-config.js | 24 - .../modules/popup/classes/popup-config.js.map | 1 - .../popup/classes/popup-config.metadata.json | 1 - .../popup/classes/popup-controller.d.ts | 32 - .../modules/popup/classes/popup-controller.js | 149 - .../popup/classes/popup-controller.js.map | 1 - .../classes/popup-controller.metadata.json | 1 - .../popup/classes/popup-lifecycle.d.ts | 10 - dist/modules/popup/classes/popup-lifecycle.js | 1 - .../popup/classes/popup-lifecycle.js.map | 1 - .../classes/popup-lifecycle.metadata.json | 1 - .../classes/popup-template-controller.d.ts | 22 - .../classes/popup-template-controller.js | 49 - .../classes/popup-template-controller.js.map | 1 - .../popup-template-controller.metadata.json | 1 - .../modules/popup/components/popup-arrow.d.ts | 7 - dist/modules/popup/components/popup-arrow.js | 44 - .../popup/components/popup-arrow.js.map | 1 - .../components/popup-arrow.metadata.json | 1 - dist/modules/popup/components/popup.d.ts | 28 - dist/modules/popup/components/popup.js | 143 - dist/modules/popup/components/popup.js.map | 1 - .../popup/components/popup.metadata.json | 1 - .../popup/directives/popup.directive.d.ts | 20 - .../popup/directives/popup.directive.js | 139 - .../popup/directives/popup.directive.js.map | 1 - .../directives/popup.directive.metadata.json | 1 - dist/modules/popup/index.d.ts | 10 - dist/modules/popup/index.js | 10 - dist/modules/popup/index.js.map | 1 - dist/modules/popup/index.metadata.json | 1 - dist/modules/popup/popup.module.d.ts | 2 - dist/modules/popup/popup.module.js | 41 - dist/modules/popup/popup.module.js.map | 1 - dist/modules/popup/popup.module.metadata.json | 1 - dist/modules/popup/public.d.ts | 3 - dist/modules/popup/public.js | 4 - dist/modules/popup/public.js.map | 1 - dist/modules/popup/public.metadata.json | 1 - .../modules/popup/services/popup.service.d.ts | 4 - dist/modules/popup/services/popup.service.js | 27 - .../popup/services/popup.service.js.map | 1 - .../services/popup.service.metadata.json | 1 - .../modules/progress/components/progress.d.ts | 16 - dist/modules/progress/components/progress.js | 109 - .../progress/components/progress.js.map | 1 - .../components/progress.metadata.json | 1 - dist/modules/progress/index.d.ts | 2 - dist/modules/progress/index.js | 3 - dist/modules/progress/index.js.map | 1 - dist/modules/progress/index.metadata.json | 1 - dist/modules/progress/progress.module.d.ts | 2 - dist/modules/progress/progress.module.js | 25 - dist/modules/progress/progress.module.js.map | 1 - .../progress/progress.module.metadata.json | 1 - dist/modules/progress/public.d.ts | 1 - dist/modules/progress/public.js | 2 - dist/modules/progress/public.js.map | 1 - dist/modules/progress/public.metadata.json | 1 - dist/modules/public.d.ts | 15 - dist/modules/public.js | 16 - dist/modules/public.js.map | 1 - dist/modules/public.metadata.json | 1 - dist/modules/rating/components/rating.d.ts | 20 - dist/modules/rating/components/rating.js | 93 - dist/modules/rating/components/rating.js.map | 1 - .../rating/components/rating.metadata.json | 1 - dist/modules/rating/index.d.ts | 2 - dist/modules/rating/index.js | 3 - dist/modules/rating/index.js.map | 1 - dist/modules/rating/index.metadata.json | 1 - dist/modules/rating/public.d.ts | 1 - dist/modules/rating/public.js | 2 - dist/modules/rating/public.js.map | 1 - dist/modules/rating/public.metadata.json | 1 - dist/modules/rating/rating.module.d.ts | 2 - dist/modules/rating/rating.module.js | 29 - dist/modules/rating/rating.module.js.map | 1 - .../rating/rating.module.metadata.json | 1 - .../search/components/search-result.d.ts | 14 - .../search/components/search-result.js | 49 - .../search/components/search-result.js.map | 1 - .../components/search-result.metadata.json | 1 - dist/modules/search/components/search.d.ts | 56 - dist/modules/search/components/search.js | 260 - dist/modules/search/components/search.js.map | 1 - .../search/components/search.metadata.json | 1 - dist/modules/search/helpers/lookup-fn.d.ts | 3 - dist/modules/search/helpers/lookup-fn.js | 1 - dist/modules/search/helpers/lookup-fn.js.map | 1 - .../search/helpers/lookup-fn.metadata.json | 1 - dist/modules/search/index.d.ts | 5 - dist/modules/search/index.js | 5 - dist/modules/search/index.js.map | 1 - dist/modules/search/index.metadata.json | 1 - dist/modules/search/public.d.ts | 1 - dist/modules/search/public.js | 2 - dist/modules/search/public.js.map | 1 - dist/modules/search/public.metadata.json | 1 - dist/modules/search/search.module.d.ts | 2 - dist/modules/search/search.module.js | 35 - dist/modules/search/search.module.js.map | 1 - .../search/search.module.metadata.json | 1 - .../search/services/search.service.d.ts | 31 - .../modules/search/services/search.service.js | 211 - .../search/services/search.service.js.map | 1 - .../services/search.service.metadata.json | 1 - dist/modules/select/classes/select-base.d.ts | 75 - dist/modules/select/classes/select-base.js | 414 - .../modules/select/classes/select-base.js.map | 1 - .../select/classes/select-base.metadata.json | 1 - .../select/components/multi-select-label.d.ts | 19 - .../select/components/multi-select-label.js | 82 - .../components/multi-select-label.js.map | 1 - .../multi-select-label.metadata.json | 1 - .../select/components/multi-select.d.ts | 31 - .../modules/select/components/multi-select.js | 225 - .../select/components/multi-select.js.map | 1 - .../components/multi-select.metadata.json | 1 - .../select/components/select-option.d.ts | 16 - .../select/components/select-option.js | 71 - .../select/components/select-option.js.map | 1 - .../components/select-option.metadata.json | 1 - dist/modules/select/components/select.d.ts | 23 - dist/modules/select/components/select.js | 146 - dist/modules/select/components/select.js.map | 1 - .../select/components/select.metadata.json | 1 - .../select/directives/select-search.d.ts | 14 - .../select/directives/select-search.js | 49 - .../select/directives/select-search.js.map | 1 - .../directives/select-search.metadata.json | 1 - dist/modules/select/index.d.ts | 7 - dist/modules/select/index.js | 8 - dist/modules/select/index.js.map | 1 - dist/modules/select/index.metadata.json | 1 - dist/modules/select/public.d.ts | 1 - dist/modules/select/public.js | 2 - dist/modules/select/public.js.map | 1 - dist/modules/select/public.metadata.json | 1 - dist/modules/select/select.module.d.ts | 2 - dist/modules/select/select.module.js | 48 - dist/modules/select/select.module.js.map | 1 - .../select/select.module.metadata.json | 1 - .../sidebar/components/sidebar-container.d.ts | 12 - .../sidebar/components/sidebar-container.js | 35 - .../components/sidebar-container.js.map | 1 - .../sidebar-container.metadata.json | 1 - .../sidebar/components/sidebar-sibling.d.ts | 15 - .../sidebar/components/sidebar-sibling.js | 81 - .../sidebar/components/sidebar-sibling.js.map | 1 - .../components/sidebar-sibling.metadata.json | 1 - dist/modules/sidebar/components/sidebar.d.ts | 19 - dist/modules/sidebar/components/sidebar.js | 109 - .../modules/sidebar/components/sidebar.js.map | 1 - .../sidebar/components/sidebar.metadata.json | 1 - dist/modules/sidebar/index.d.ts | 5 - dist/modules/sidebar/index.js | 6 - dist/modules/sidebar/index.js.map | 1 - dist/modules/sidebar/index.metadata.json | 1 - dist/modules/sidebar/public.d.ts | 1 - dist/modules/sidebar/public.js | 2 - dist/modules/sidebar/public.js.map | 1 - dist/modules/sidebar/public.metadata.json | 1 - .../sidebar/services/sidebar.service.d.ts | 35 - .../sidebar/services/sidebar.service.js | 81 - .../sidebar/services/sidebar.service.js.map | 1 - .../services/sidebar.service.metadata.json | 1 - dist/modules/sidebar/sidebar.module.d.ts | 2 - dist/modules/sidebar/sidebar.module.js | 31 - dist/modules/sidebar/sidebar.module.js.map | 1 - .../sidebar/sidebar.module.metadata.json | 1 - dist/modules/tabs/classes/tab.d.ts | 11 - dist/modules/tabs/classes/tab.js | 38 - dist/modules/tabs/classes/tab.js.map | 1 - dist/modules/tabs/classes/tab.metadata.json | 1 - dist/modules/tabs/components/tabset.d.ts | 17 - dist/modules/tabs/components/tabset.js | 170 - dist/modules/tabs/components/tabset.js.map | 1 - .../tabs/components/tabset.metadata.json | 1 - dist/modules/tabs/directives/tab-content.d.ts | 6 - dist/modules/tabs/directives/tab-content.js | 22 - .../tabs/directives/tab-content.js.map | 1 - .../tabs/directives/tab-content.metadata.json | 1 - dist/modules/tabs/directives/tab-header.d.ts | 16 - dist/modules/tabs/directives/tab-header.js | 97 - .../modules/tabs/directives/tab-header.js.map | 1 - .../tabs/directives/tab-header.metadata.json | 1 - dist/modules/tabs/index.d.ts | 5 - dist/modules/tabs/index.js | 6 - dist/modules/tabs/index.js.map | 1 - dist/modules/tabs/index.metadata.json | 1 - dist/modules/tabs/public.d.ts | 1 - dist/modules/tabs/public.js | 2 - dist/modules/tabs/public.js.map | 1 - dist/modules/tabs/public.metadata.json | 1 - dist/modules/tabs/tab.module.d.ts | 2 - dist/modules/tabs/tab.module.js | 31 - dist/modules/tabs/tab.module.js.map | 1 - dist/modules/tabs/tab.module.metadata.json | 1 - .../classes/transition-controller.d.ts | 29 - .../classes/transition-controller.js | 200 - .../classes/transition-controller.js.map | 1 - .../transition-controller.metadata.json | 1 - .../transition/classes/transition.d.ts | 15 - dist/modules/transition/classes/transition.js | 41 - .../transition/classes/transition.js.map | 1 - .../classes/transition.metadata.json | 1 - .../transition/directives/transition.d.ts | 14 - .../transition/directives/transition.js | 69 - .../transition/directives/transition.js.map | 1 - .../directives/transition.metadata.json | 1 - dist/modules/transition/index.d.ts | 4 - dist/modules/transition/index.js | 5 - dist/modules/transition/index.js.map | 1 - dist/modules/transition/index.metadata.json | 1 - dist/modules/transition/public.d.ts | 1 - dist/modules/transition/public.js | 2 - dist/modules/transition/public.js.map | 1 - dist/modules/transition/public.metadata.json | 1 - .../modules/transition/transition.module.d.ts | 2 - dist/modules/transition/transition.module.js | 24 - .../transition/transition.module.js.map | 1 - .../transition.module.metadata.json | 1 - dist/public.d.ts | 5 - dist/public.js | 6 - dist/public.js.map | 1 - dist/public.metadata.json | 1 - dist/sui.module.d.ts | 2 - dist/sui.module.js | 39 - dist/sui.module.js.map | 1 - dist/sui.module.metadata.json | 1 - 647 files changed, 25496 deletions(-) delete mode 100644 bundles/ng2-semantic-ui.umd.js delete mode 100644 bundles/ng2-semantic-ui.umd.min.js delete mode 100644 dist/behaviors/index.d.ts delete mode 100644 dist/behaviors/index.js delete mode 100644 dist/behaviors/index.js.map delete mode 100644 dist/behaviors/index.metadata.json delete mode 100644 dist/behaviors/localization/index.d.ts delete mode 100644 dist/behaviors/localization/index.js delete mode 100644 dist/behaviors/localization/index.js.map delete mode 100644 dist/behaviors/localization/index.metadata.json delete mode 100644 dist/behaviors/localization/interfaces/datepicker-values.d.ts delete mode 100644 dist/behaviors/localization/interfaces/datepicker-values.js delete mode 100644 dist/behaviors/localization/interfaces/datepicker-values.js.map delete mode 100644 dist/behaviors/localization/interfaces/datepicker-values.metadata.json delete mode 100644 dist/behaviors/localization/interfaces/partial.d.ts delete mode 100644 dist/behaviors/localization/interfaces/partial.js delete mode 100644 dist/behaviors/localization/interfaces/partial.js.map delete mode 100644 dist/behaviors/localization/interfaces/partial.metadata.json delete mode 100644 dist/behaviors/localization/interfaces/search-values.d.ts delete mode 100644 dist/behaviors/localization/interfaces/search-values.js delete mode 100644 dist/behaviors/localization/interfaces/search-values.js.map delete mode 100644 dist/behaviors/localization/interfaces/search-values.metadata.json delete mode 100644 dist/behaviors/localization/interfaces/select-values.d.ts delete mode 100644 dist/behaviors/localization/interfaces/select-values.js delete mode 100644 dist/behaviors/localization/interfaces/select-values.js.map delete mode 100644 dist/behaviors/localization/interfaces/select-values.metadata.json delete mode 100644 dist/behaviors/localization/interfaces/values.d.ts delete mode 100644 dist/behaviors/localization/interfaces/values.js delete mode 100644 dist/behaviors/localization/interfaces/values.js.map delete mode 100644 dist/behaviors/localization/interfaces/values.metadata.json delete mode 100644 dist/behaviors/localization/locales/de.d.ts delete mode 100644 dist/behaviors/localization/locales/de.js delete mode 100644 dist/behaviors/localization/locales/de.js.map delete mode 100644 dist/behaviors/localization/locales/en-AU.d.ts delete mode 100644 dist/behaviors/localization/locales/en-AU.js delete mode 100644 dist/behaviors/localization/locales/en-AU.js.map delete mode 100644 dist/behaviors/localization/locales/en-GB.d.ts delete mode 100644 dist/behaviors/localization/locales/en-GB.js delete mode 100644 dist/behaviors/localization/locales/en-GB.js.map delete mode 100644 dist/behaviors/localization/locales/en-US.d.ts delete mode 100644 dist/behaviors/localization/locales/en-US.js delete mode 100644 dist/behaviors/localization/locales/en-US.js.map delete mode 100644 dist/behaviors/localization/locales/es.d.ts delete mode 100644 dist/behaviors/localization/locales/es.js delete mode 100644 dist/behaviors/localization/locales/es.js.map delete mode 100644 dist/behaviors/localization/locales/fr.d.ts delete mode 100644 dist/behaviors/localization/locales/fr.js delete mode 100644 dist/behaviors/localization/locales/fr.js.map delete mode 100644 dist/behaviors/localization/locales/ge.d.ts delete mode 100644 dist/behaviors/localization/locales/ge.js delete mode 100644 dist/behaviors/localization/locales/ge.js.map delete mode 100644 dist/behaviors/localization/locales/he.d.ts delete mode 100644 dist/behaviors/localization/locales/he.js delete mode 100644 dist/behaviors/localization/locales/he.js.map delete mode 100644 dist/behaviors/localization/locales/index.d.ts delete mode 100644 dist/behaviors/localization/locales/index.js delete mode 100644 dist/behaviors/localization/locales/index.js.map delete mode 100644 dist/behaviors/localization/locales/it.d.ts delete mode 100644 dist/behaviors/localization/locales/it.js delete mode 100644 dist/behaviors/localization/locales/it.js.map delete mode 100644 dist/behaviors/localization/locales/nl.d.ts delete mode 100644 dist/behaviors/localization/locales/nl.js delete mode 100644 dist/behaviors/localization/locales/nl.js.map delete mode 100644 dist/behaviors/localization/locales/pt.d.ts delete mode 100644 dist/behaviors/localization/locales/pt.js delete mode 100644 dist/behaviors/localization/locales/pt.js.map delete mode 100644 dist/behaviors/localization/locales/ru.d.ts delete mode 100644 dist/behaviors/localization/locales/ru.js delete mode 100644 dist/behaviors/localization/locales/ru.js.map delete mode 100644 dist/behaviors/localization/localization.module.d.ts delete mode 100644 dist/behaviors/localization/localization.module.js delete mode 100644 dist/behaviors/localization/localization.module.js.map delete mode 100644 dist/behaviors/localization/localization.module.metadata.json delete mode 100644 dist/behaviors/localization/public.d.ts delete mode 100644 dist/behaviors/localization/public.js delete mode 100644 dist/behaviors/localization/public.js.map delete mode 100644 dist/behaviors/localization/public.metadata.json delete mode 100644 dist/behaviors/localization/services/localization.service.d.ts delete mode 100644 dist/behaviors/localization/services/localization.service.js delete mode 100644 dist/behaviors/localization/services/localization.service.js.map delete mode 100644 dist/behaviors/localization/services/localization.service.metadata.json delete mode 100644 dist/behaviors/public.d.ts delete mode 100644 dist/behaviors/public.js delete mode 100644 dist/behaviors/public.js.map delete mode 100644 dist/behaviors/public.metadata.json delete mode 100644 dist/collections/index.d.ts delete mode 100644 dist/collections/index.js delete mode 100644 dist/collections/index.js.map delete mode 100644 dist/collections/index.metadata.json delete mode 100644 dist/collections/message/components/message.d.ts delete mode 100644 dist/collections/message/components/message.js delete mode 100644 dist/collections/message/components/message.js.map delete mode 100644 dist/collections/message/components/message.metadata.json delete mode 100644 dist/collections/message/index.d.ts delete mode 100644 dist/collections/message/index.js delete mode 100644 dist/collections/message/index.js.map delete mode 100644 dist/collections/message/index.metadata.json delete mode 100644 dist/collections/message/message.module.d.ts delete mode 100644 dist/collections/message/message.module.js delete mode 100644 dist/collections/message/message.module.js.map delete mode 100644 dist/collections/message/message.module.metadata.json delete mode 100644 dist/collections/message/public.d.ts delete mode 100644 dist/collections/message/public.js delete mode 100644 dist/collections/message/public.js.map delete mode 100644 dist/collections/message/public.metadata.json delete mode 100644 dist/collections/pagination/components/pagination.d.ts delete mode 100644 dist/collections/pagination/components/pagination.js delete mode 100644 dist/collections/pagination/components/pagination.js.map delete mode 100644 dist/collections/pagination/components/pagination.metadata.json delete mode 100644 dist/collections/pagination/index.d.ts delete mode 100644 dist/collections/pagination/index.js delete mode 100644 dist/collections/pagination/index.js.map delete mode 100644 dist/collections/pagination/index.metadata.json delete mode 100644 dist/collections/pagination/pagination.module.d.ts delete mode 100644 dist/collections/pagination/pagination.module.js delete mode 100644 dist/collections/pagination/pagination.module.js.map delete mode 100644 dist/collections/pagination/pagination.module.metadata.json delete mode 100644 dist/collections/pagination/public.d.ts delete mode 100644 dist/collections/pagination/public.js delete mode 100644 dist/collections/pagination/public.js.map delete mode 100644 dist/collections/pagination/public.metadata.json delete mode 100644 dist/collections/public.d.ts delete mode 100644 dist/collections/public.js delete mode 100644 dist/collections/public.js.map delete mode 100644 dist/collections/public.metadata.json delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 dist/index.metadata.json delete mode 100644 dist/karma.conf.d.ts delete mode 100644 dist/karma.conf.js delete mode 100644 dist/karma.conf.js.map delete mode 100644 dist/misc/index.d.ts delete mode 100644 dist/misc/index.js delete mode 100644 dist/misc/index.js.map delete mode 100644 dist/misc/index.metadata.json delete mode 100644 dist/misc/public.d.ts delete mode 100644 dist/misc/public.js delete mode 100644 dist/misc/public.js.map delete mode 100644 dist/misc/public.metadata.json delete mode 100644 dist/misc/util/helpers/custom-validator.d.ts delete mode 100644 dist/misc/util/helpers/custom-validator.js delete mode 100644 dist/misc/util/helpers/custom-validator.js.map delete mode 100644 dist/misc/util/helpers/custom-validator.metadata.json delete mode 100644 dist/misc/util/helpers/custom-value-accessor.d.ts delete mode 100644 dist/misc/util/helpers/custom-value-accessor.js delete mode 100644 dist/misc/util/helpers/custom-value-accessor.js.map delete mode 100644 dist/misc/util/helpers/custom-value-accessor.metadata.json delete mode 100644 dist/misc/util/helpers/date.d.ts delete mode 100644 dist/misc/util/helpers/date.js delete mode 100644 dist/misc/util/helpers/date.js.map delete mode 100644 dist/misc/util/helpers/date.metadata.json delete mode 100644 dist/misc/util/helpers/focus-event.d.ts delete mode 100644 dist/misc/util/helpers/focus-event.js delete mode 100644 dist/misc/util/helpers/focus-event.js.map delete mode 100644 dist/misc/util/helpers/focus-event.metadata.json delete mode 100644 dist/misc/util/helpers/util.d.ts delete mode 100644 dist/misc/util/helpers/util.js delete mode 100644 dist/misc/util/helpers/util.js.map delete mode 100644 dist/misc/util/helpers/util.metadata.json delete mode 100644 dist/misc/util/index.d.ts delete mode 100644 dist/misc/util/index.js delete mode 100644 dist/misc/util/index.js.map delete mode 100644 dist/misc/util/index.metadata.json delete mode 100644 dist/misc/util/public.d.ts delete mode 100644 dist/misc/util/public.js delete mode 100644 dist/misc/util/public.js.map delete mode 100644 dist/misc/util/public.metadata.json delete mode 100644 dist/misc/util/services/component-factory.service.d.ts delete mode 100644 dist/misc/util/services/component-factory.service.js delete mode 100644 dist/misc/util/services/component-factory.service.js.map delete mode 100644 dist/misc/util/services/component-factory.service.metadata.json delete mode 100644 dist/misc/util/services/positioning.service.d.ts delete mode 100644 dist/misc/util/services/positioning.service.js delete mode 100644 dist/misc/util/services/positioning.service.js.map delete mode 100644 dist/misc/util/services/positioning.service.metadata.json delete mode 100644 dist/misc/util/util.module.d.ts delete mode 100644 dist/misc/util/util.module.js delete mode 100644 dist/misc/util/util.module.js.map delete mode 100644 dist/misc/util/util.module.metadata.json delete mode 100644 dist/modules/accordion/accordion.module.d.ts delete mode 100644 dist/modules/accordion/accordion.module.js delete mode 100644 dist/modules/accordion/accordion.module.js.map delete mode 100644 dist/modules/accordion/accordion.module.metadata.json delete mode 100644 dist/modules/accordion/components/accordion-panel.d.ts delete mode 100644 dist/modules/accordion/components/accordion-panel.js delete mode 100644 dist/modules/accordion/components/accordion-panel.js.map delete mode 100644 dist/modules/accordion/components/accordion-panel.metadata.json delete mode 100644 dist/modules/accordion/components/accordion.d.ts delete mode 100644 dist/modules/accordion/components/accordion.js delete mode 100644 dist/modules/accordion/components/accordion.js.map delete mode 100644 dist/modules/accordion/components/accordion.metadata.json delete mode 100644 dist/modules/accordion/index.d.ts delete mode 100644 dist/modules/accordion/index.js delete mode 100644 dist/modules/accordion/index.js.map delete mode 100644 dist/modules/accordion/index.metadata.json delete mode 100644 dist/modules/accordion/public.d.ts delete mode 100644 dist/modules/accordion/public.js delete mode 100644 dist/modules/accordion/public.js.map delete mode 100644 dist/modules/accordion/public.metadata.json delete mode 100644 dist/modules/accordion/services/accordion.service.d.ts delete mode 100644 dist/modules/accordion/services/accordion.service.js delete mode 100644 dist/modules/accordion/services/accordion.service.js.map delete mode 100644 dist/modules/accordion/services/accordion.service.metadata.json delete mode 100644 dist/modules/checkbox/checkbox.module.d.ts delete mode 100644 dist/modules/checkbox/checkbox.module.js delete mode 100644 dist/modules/checkbox/checkbox.module.js.map delete mode 100644 dist/modules/checkbox/checkbox.module.metadata.json delete mode 100644 dist/modules/checkbox/components/checkbox.d.ts delete mode 100644 dist/modules/checkbox/components/checkbox.js delete mode 100644 dist/modules/checkbox/components/checkbox.js.map delete mode 100644 dist/modules/checkbox/components/checkbox.metadata.json delete mode 100644 dist/modules/checkbox/components/radio.d.ts delete mode 100644 dist/modules/checkbox/components/radio.js delete mode 100644 dist/modules/checkbox/components/radio.js.map delete mode 100644 dist/modules/checkbox/components/radio.metadata.json delete mode 100644 dist/modules/checkbox/directives/radio-manager.d.ts delete mode 100644 dist/modules/checkbox/directives/radio-manager.js delete mode 100644 dist/modules/checkbox/directives/radio-manager.js.map delete mode 100644 dist/modules/checkbox/directives/radio-manager.metadata.json delete mode 100644 dist/modules/checkbox/index.d.ts delete mode 100644 dist/modules/checkbox/index.js delete mode 100644 dist/modules/checkbox/index.js.map delete mode 100644 dist/modules/checkbox/index.metadata.json delete mode 100644 dist/modules/checkbox/public.d.ts delete mode 100644 dist/modules/checkbox/public.js delete mode 100644 dist/modules/checkbox/public.js.map delete mode 100644 dist/modules/checkbox/public.metadata.json delete mode 100644 dist/modules/collapse/collapse.module.d.ts delete mode 100644 dist/modules/collapse/collapse.module.js delete mode 100644 dist/modules/collapse/collapse.module.js.map delete mode 100644 dist/modules/collapse/collapse.module.metadata.json delete mode 100644 dist/modules/collapse/directives/collapse.d.ts delete mode 100644 dist/modules/collapse/directives/collapse.js delete mode 100644 dist/modules/collapse/directives/collapse.js.map delete mode 100644 dist/modules/collapse/directives/collapse.metadata.json delete mode 100644 dist/modules/collapse/index.d.ts delete mode 100644 dist/modules/collapse/index.js delete mode 100644 dist/modules/collapse/index.js.map delete mode 100644 dist/modules/collapse/index.metadata.json delete mode 100644 dist/modules/collapse/public.d.ts delete mode 100644 dist/modules/collapse/public.js delete mode 100644 dist/modules/collapse/public.js.map delete mode 100644 dist/modules/collapse/public.metadata.json delete mode 100644 dist/modules/datepicker/classes/calendar-config.d.ts delete mode 100644 dist/modules/datepicker/classes/calendar-config.js delete mode 100644 dist/modules/datepicker/classes/calendar-config.js.map delete mode 100644 dist/modules/datepicker/classes/calendar-config.metadata.json delete mode 100644 dist/modules/datepicker/classes/calendar-mappings.d.ts delete mode 100644 dist/modules/datepicker/classes/calendar-mappings.js delete mode 100644 dist/modules/datepicker/classes/calendar-mappings.js.map delete mode 100644 dist/modules/datepicker/classes/calendar-mappings.metadata.json delete mode 100644 dist/modules/datepicker/classes/date-comparer.d.ts delete mode 100644 dist/modules/datepicker/classes/date-comparer.js delete mode 100644 dist/modules/datepicker/classes/date-comparer.js.map delete mode 100644 dist/modules/datepicker/classes/date-comparer.metadata.json delete mode 100644 dist/modules/datepicker/classes/date-parser.d.ts delete mode 100644 dist/modules/datepicker/classes/date-parser.js delete mode 100644 dist/modules/datepicker/classes/date-parser.js.map delete mode 100644 dist/modules/datepicker/classes/date-parser.metadata.json delete mode 100644 dist/modules/datepicker/components/calendar-view-title.d.ts delete mode 100644 dist/modules/datepicker/components/calendar-view-title.js delete mode 100644 dist/modules/datepicker/components/calendar-view-title.js.map delete mode 100644 dist/modules/datepicker/components/calendar-view-title.metadata.json delete mode 100644 dist/modules/datepicker/components/datepicker.d.ts delete mode 100644 dist/modules/datepicker/components/datepicker.js delete mode 100644 dist/modules/datepicker/components/datepicker.js.map delete mode 100644 dist/modules/datepicker/components/datepicker.metadata.json delete mode 100644 dist/modules/datepicker/datepicker.module.d.ts delete mode 100644 dist/modules/datepicker/datepicker.module.js delete mode 100644 dist/modules/datepicker/datepicker.module.js.map delete mode 100644 dist/modules/datepicker/datepicker.module.metadata.json delete mode 100644 dist/modules/datepicker/directives/calendar-item.d.ts delete mode 100644 dist/modules/datepicker/directives/calendar-item.js delete mode 100644 dist/modules/datepicker/directives/calendar-item.js.map delete mode 100644 dist/modules/datepicker/directives/calendar-item.metadata.json delete mode 100644 dist/modules/datepicker/directives/datepicker.directive.d.ts delete mode 100644 dist/modules/datepicker/directives/datepicker.directive.js delete mode 100644 dist/modules/datepicker/directives/datepicker.directive.js.map delete mode 100644 dist/modules/datepicker/directives/datepicker.directive.metadata.json delete mode 100644 dist/modules/datepicker/directives/input.directive.d.ts delete mode 100644 dist/modules/datepicker/directives/input.directive.js delete mode 100644 dist/modules/datepicker/directives/input.directive.js.map delete mode 100644 dist/modules/datepicker/directives/input.directive.metadata.json delete mode 100644 dist/modules/datepicker/helpers/date-fns.d.ts delete mode 100644 dist/modules/datepicker/helpers/date-fns.js delete mode 100644 dist/modules/datepicker/helpers/date-fns.js.map delete mode 100644 dist/modules/datepicker/helpers/date-fns.metadata.json delete mode 100644 dist/modules/datepicker/helpers/is-webview.d.ts delete mode 100644 dist/modules/datepicker/helpers/is-webview.js delete mode 100644 dist/modules/datepicker/helpers/is-webview.js.map delete mode 100644 dist/modules/datepicker/index.d.ts delete mode 100644 dist/modules/datepicker/index.js delete mode 100644 dist/modules/datepicker/index.js.map delete mode 100644 dist/modules/datepicker/index.metadata.json delete mode 100644 dist/modules/datepicker/public.d.ts delete mode 100644 dist/modules/datepicker/public.js delete mode 100644 dist/modules/datepicker/public.js.map delete mode 100644 dist/modules/datepicker/public.metadata.json delete mode 100644 dist/modules/datepicker/services/calendar-range.service.d.ts delete mode 100644 dist/modules/datepicker/services/calendar-range.service.js delete mode 100644 dist/modules/datepicker/services/calendar-range.service.js.map delete mode 100644 dist/modules/datepicker/services/calendar-range.service.metadata.json delete mode 100644 dist/modules/datepicker/services/calendar.service.d.ts delete mode 100644 dist/modules/datepicker/services/calendar.service.js delete mode 100644 dist/modules/datepicker/services/calendar.service.js.map delete mode 100644 dist/modules/datepicker/services/calendar.service.metadata.json delete mode 100644 dist/modules/datepicker/views/calendar-view.d.ts delete mode 100644 dist/modules/datepicker/views/calendar-view.js delete mode 100644 dist/modules/datepicker/views/calendar-view.js.map delete mode 100644 dist/modules/datepicker/views/calendar-view.metadata.json delete mode 100644 dist/modules/datepicker/views/date-view.d.ts delete mode 100644 dist/modules/datepicker/views/date-view.js delete mode 100644 dist/modules/datepicker/views/date-view.js.map delete mode 100644 dist/modules/datepicker/views/date-view.metadata.json delete mode 100644 dist/modules/datepicker/views/hour-view.d.ts delete mode 100644 dist/modules/datepicker/views/hour-view.js delete mode 100644 dist/modules/datepicker/views/hour-view.js.map delete mode 100644 dist/modules/datepicker/views/hour-view.metadata.json delete mode 100644 dist/modules/datepicker/views/minute-view.d.ts delete mode 100644 dist/modules/datepicker/views/minute-view.js delete mode 100644 dist/modules/datepicker/views/minute-view.js.map delete mode 100644 dist/modules/datepicker/views/minute-view.metadata.json delete mode 100644 dist/modules/datepicker/views/month-view.d.ts delete mode 100644 dist/modules/datepicker/views/month-view.js delete mode 100644 dist/modules/datepicker/views/month-view.js.map delete mode 100644 dist/modules/datepicker/views/month-view.metadata.json delete mode 100644 dist/modules/datepicker/views/year-view.d.ts delete mode 100644 dist/modules/datepicker/views/year-view.js delete mode 100644 dist/modules/datepicker/views/year-view.js.map delete mode 100644 dist/modules/datepicker/views/year-view.metadata.json delete mode 100644 dist/modules/dimmer/components/dimmer.d.ts delete mode 100644 dist/modules/dimmer/components/dimmer.js delete mode 100644 dist/modules/dimmer/components/dimmer.js.map delete mode 100644 dist/modules/dimmer/components/dimmer.metadata.json delete mode 100644 dist/modules/dimmer/dimmer.module.d.ts delete mode 100644 dist/modules/dimmer/dimmer.module.js delete mode 100644 dist/modules/dimmer/dimmer.module.js.map delete mode 100644 dist/modules/dimmer/dimmer.module.metadata.json delete mode 100644 dist/modules/dimmer/index.d.ts delete mode 100644 dist/modules/dimmer/index.js delete mode 100644 dist/modules/dimmer/index.js.map delete mode 100644 dist/modules/dimmer/index.metadata.json delete mode 100644 dist/modules/dimmer/public.d.ts delete mode 100644 dist/modules/dimmer/public.js delete mode 100644 dist/modules/dimmer/public.js.map delete mode 100644 dist/modules/dimmer/public.metadata.json delete mode 100644 dist/modules/dropdown/directives/dropdown-menu.d.ts delete mode 100644 dist/modules/dropdown/directives/dropdown-menu.js delete mode 100644 dist/modules/dropdown/directives/dropdown-menu.js.map delete mode 100644 dist/modules/dropdown/directives/dropdown-menu.metadata.json delete mode 100644 dist/modules/dropdown/directives/dropdown.d.ts delete mode 100644 dist/modules/dropdown/directives/dropdown.js delete mode 100644 dist/modules/dropdown/directives/dropdown.js.map delete mode 100644 dist/modules/dropdown/directives/dropdown.metadata.json delete mode 100644 dist/modules/dropdown/dropdown.module.d.ts delete mode 100644 dist/modules/dropdown/dropdown.module.js delete mode 100644 dist/modules/dropdown/dropdown.module.js.map delete mode 100644 dist/modules/dropdown/dropdown.module.metadata.json delete mode 100644 dist/modules/dropdown/index.d.ts delete mode 100644 dist/modules/dropdown/index.js delete mode 100644 dist/modules/dropdown/index.js.map delete mode 100644 dist/modules/dropdown/index.metadata.json delete mode 100644 dist/modules/dropdown/public.d.ts delete mode 100644 dist/modules/dropdown/public.js delete mode 100644 dist/modules/dropdown/public.js.map delete mode 100644 dist/modules/dropdown/public.metadata.json delete mode 100644 dist/modules/dropdown/services/dropdown.service.d.ts delete mode 100644 dist/modules/dropdown/services/dropdown.service.js delete mode 100644 dist/modules/dropdown/services/dropdown.service.js.map delete mode 100644 dist/modules/dropdown/services/dropdown.service.metadata.json delete mode 100644 dist/modules/index.d.ts delete mode 100644 dist/modules/index.js delete mode 100644 dist/modules/index.js.map delete mode 100644 dist/modules/index.metadata.json delete mode 100644 dist/modules/modal/classes/active-modal.d.ts delete mode 100644 dist/modules/modal/classes/active-modal.js delete mode 100644 dist/modules/modal/classes/active-modal.js.map delete mode 100644 dist/modules/modal/classes/active-modal.metadata.json delete mode 100644 dist/modules/modal/classes/modal-config.d.ts delete mode 100644 dist/modules/modal/classes/modal-config.js delete mode 100644 dist/modules/modal/classes/modal-config.js.map delete mode 100644 dist/modules/modal/classes/modal-config.metadata.json delete mode 100644 dist/modules/modal/classes/modal-controls.d.ts delete mode 100644 dist/modules/modal/classes/modal-controls.js delete mode 100644 dist/modules/modal/classes/modal-controls.js.map delete mode 100644 dist/modules/modal/classes/modal-controls.metadata.json delete mode 100644 dist/modules/modal/classes/modal-template.d.ts delete mode 100644 dist/modules/modal/classes/modal-template.js delete mode 100644 dist/modules/modal/classes/modal-template.js.map delete mode 100644 dist/modules/modal/classes/modal-template.metadata.json delete mode 100644 dist/modules/modal/components/modal.d.ts delete mode 100644 dist/modules/modal/components/modal.js delete mode 100644 dist/modules/modal/components/modal.js.map delete mode 100644 dist/modules/modal/components/modal.metadata.json delete mode 100644 dist/modules/modal/index.d.ts delete mode 100644 dist/modules/modal/index.js delete mode 100644 dist/modules/modal/index.js.map delete mode 100644 dist/modules/modal/index.metadata.json delete mode 100644 dist/modules/modal/modal.module.d.ts delete mode 100644 dist/modules/modal/modal.module.js delete mode 100644 dist/modules/modal/modal.module.js.map delete mode 100644 dist/modules/modal/modal.module.metadata.json delete mode 100644 dist/modules/modal/public.d.ts delete mode 100644 dist/modules/modal/public.js delete mode 100644 dist/modules/modal/public.js.map delete mode 100644 dist/modules/modal/public.metadata.json delete mode 100644 dist/modules/modal/services/modal.service.d.ts delete mode 100644 dist/modules/modal/services/modal.service.js delete mode 100644 dist/modules/modal/services/modal.service.js.map delete mode 100644 dist/modules/modal/services/modal.service.metadata.json delete mode 100644 dist/modules/popup/classes/popup-component-controller.d.ts delete mode 100644 dist/modules/popup/classes/popup-component-controller.js delete mode 100644 dist/modules/popup/classes/popup-component-controller.js.map delete mode 100644 dist/modules/popup/classes/popup-component-controller.metadata.json delete mode 100644 dist/modules/popup/classes/popup-config.d.ts delete mode 100644 dist/modules/popup/classes/popup-config.js delete mode 100644 dist/modules/popup/classes/popup-config.js.map delete mode 100644 dist/modules/popup/classes/popup-config.metadata.json delete mode 100644 dist/modules/popup/classes/popup-controller.d.ts delete mode 100644 dist/modules/popup/classes/popup-controller.js delete mode 100644 dist/modules/popup/classes/popup-controller.js.map delete mode 100644 dist/modules/popup/classes/popup-controller.metadata.json delete mode 100644 dist/modules/popup/classes/popup-lifecycle.d.ts delete mode 100644 dist/modules/popup/classes/popup-lifecycle.js delete mode 100644 dist/modules/popup/classes/popup-lifecycle.js.map delete mode 100644 dist/modules/popup/classes/popup-lifecycle.metadata.json delete mode 100644 dist/modules/popup/classes/popup-template-controller.d.ts delete mode 100644 dist/modules/popup/classes/popup-template-controller.js delete mode 100644 dist/modules/popup/classes/popup-template-controller.js.map delete mode 100644 dist/modules/popup/classes/popup-template-controller.metadata.json delete mode 100644 dist/modules/popup/components/popup-arrow.d.ts delete mode 100644 dist/modules/popup/components/popup-arrow.js delete mode 100644 dist/modules/popup/components/popup-arrow.js.map delete mode 100644 dist/modules/popup/components/popup-arrow.metadata.json delete mode 100644 dist/modules/popup/components/popup.d.ts delete mode 100644 dist/modules/popup/components/popup.js delete mode 100644 dist/modules/popup/components/popup.js.map delete mode 100644 dist/modules/popup/components/popup.metadata.json delete mode 100644 dist/modules/popup/directives/popup.directive.d.ts delete mode 100644 dist/modules/popup/directives/popup.directive.js delete mode 100644 dist/modules/popup/directives/popup.directive.js.map delete mode 100644 dist/modules/popup/directives/popup.directive.metadata.json delete mode 100644 dist/modules/popup/index.d.ts delete mode 100644 dist/modules/popup/index.js delete mode 100644 dist/modules/popup/index.js.map delete mode 100644 dist/modules/popup/index.metadata.json delete mode 100644 dist/modules/popup/popup.module.d.ts delete mode 100644 dist/modules/popup/popup.module.js delete mode 100644 dist/modules/popup/popup.module.js.map delete mode 100644 dist/modules/popup/popup.module.metadata.json delete mode 100644 dist/modules/popup/public.d.ts delete mode 100644 dist/modules/popup/public.js delete mode 100644 dist/modules/popup/public.js.map delete mode 100644 dist/modules/popup/public.metadata.json delete mode 100644 dist/modules/popup/services/popup.service.d.ts delete mode 100644 dist/modules/popup/services/popup.service.js delete mode 100644 dist/modules/popup/services/popup.service.js.map delete mode 100644 dist/modules/popup/services/popup.service.metadata.json delete mode 100644 dist/modules/progress/components/progress.d.ts delete mode 100644 dist/modules/progress/components/progress.js delete mode 100644 dist/modules/progress/components/progress.js.map delete mode 100644 dist/modules/progress/components/progress.metadata.json delete mode 100644 dist/modules/progress/index.d.ts delete mode 100644 dist/modules/progress/index.js delete mode 100644 dist/modules/progress/index.js.map delete mode 100644 dist/modules/progress/index.metadata.json delete mode 100644 dist/modules/progress/progress.module.d.ts delete mode 100644 dist/modules/progress/progress.module.js delete mode 100644 dist/modules/progress/progress.module.js.map delete mode 100644 dist/modules/progress/progress.module.metadata.json delete mode 100644 dist/modules/progress/public.d.ts delete mode 100644 dist/modules/progress/public.js delete mode 100644 dist/modules/progress/public.js.map delete mode 100644 dist/modules/progress/public.metadata.json delete mode 100644 dist/modules/public.d.ts delete mode 100644 dist/modules/public.js delete mode 100644 dist/modules/public.js.map delete mode 100644 dist/modules/public.metadata.json delete mode 100644 dist/modules/rating/components/rating.d.ts delete mode 100644 dist/modules/rating/components/rating.js delete mode 100644 dist/modules/rating/components/rating.js.map delete mode 100644 dist/modules/rating/components/rating.metadata.json delete mode 100644 dist/modules/rating/index.d.ts delete mode 100644 dist/modules/rating/index.js delete mode 100644 dist/modules/rating/index.js.map delete mode 100644 dist/modules/rating/index.metadata.json delete mode 100644 dist/modules/rating/public.d.ts delete mode 100644 dist/modules/rating/public.js delete mode 100644 dist/modules/rating/public.js.map delete mode 100644 dist/modules/rating/public.metadata.json delete mode 100644 dist/modules/rating/rating.module.d.ts delete mode 100644 dist/modules/rating/rating.module.js delete mode 100644 dist/modules/rating/rating.module.js.map delete mode 100644 dist/modules/rating/rating.module.metadata.json delete mode 100644 dist/modules/search/components/search-result.d.ts delete mode 100644 dist/modules/search/components/search-result.js delete mode 100644 dist/modules/search/components/search-result.js.map delete mode 100644 dist/modules/search/components/search-result.metadata.json delete mode 100644 dist/modules/search/components/search.d.ts delete mode 100644 dist/modules/search/components/search.js delete mode 100644 dist/modules/search/components/search.js.map delete mode 100644 dist/modules/search/components/search.metadata.json delete mode 100644 dist/modules/search/helpers/lookup-fn.d.ts delete mode 100644 dist/modules/search/helpers/lookup-fn.js delete mode 100644 dist/modules/search/helpers/lookup-fn.js.map delete mode 100644 dist/modules/search/helpers/lookup-fn.metadata.json delete mode 100644 dist/modules/search/index.d.ts delete mode 100644 dist/modules/search/index.js delete mode 100644 dist/modules/search/index.js.map delete mode 100644 dist/modules/search/index.metadata.json delete mode 100644 dist/modules/search/public.d.ts delete mode 100644 dist/modules/search/public.js delete mode 100644 dist/modules/search/public.js.map delete mode 100644 dist/modules/search/public.metadata.json delete mode 100644 dist/modules/search/search.module.d.ts delete mode 100644 dist/modules/search/search.module.js delete mode 100644 dist/modules/search/search.module.js.map delete mode 100644 dist/modules/search/search.module.metadata.json delete mode 100644 dist/modules/search/services/search.service.d.ts delete mode 100644 dist/modules/search/services/search.service.js delete mode 100644 dist/modules/search/services/search.service.js.map delete mode 100644 dist/modules/search/services/search.service.metadata.json delete mode 100644 dist/modules/select/classes/select-base.d.ts delete mode 100644 dist/modules/select/classes/select-base.js delete mode 100644 dist/modules/select/classes/select-base.js.map delete mode 100644 dist/modules/select/classes/select-base.metadata.json delete mode 100644 dist/modules/select/components/multi-select-label.d.ts delete mode 100644 dist/modules/select/components/multi-select-label.js delete mode 100644 dist/modules/select/components/multi-select-label.js.map delete mode 100644 dist/modules/select/components/multi-select-label.metadata.json delete mode 100644 dist/modules/select/components/multi-select.d.ts delete mode 100644 dist/modules/select/components/multi-select.js delete mode 100644 dist/modules/select/components/multi-select.js.map delete mode 100644 dist/modules/select/components/multi-select.metadata.json delete mode 100644 dist/modules/select/components/select-option.d.ts delete mode 100644 dist/modules/select/components/select-option.js delete mode 100644 dist/modules/select/components/select-option.js.map delete mode 100644 dist/modules/select/components/select-option.metadata.json delete mode 100644 dist/modules/select/components/select.d.ts delete mode 100644 dist/modules/select/components/select.js delete mode 100644 dist/modules/select/components/select.js.map delete mode 100644 dist/modules/select/components/select.metadata.json delete mode 100644 dist/modules/select/directives/select-search.d.ts delete mode 100644 dist/modules/select/directives/select-search.js delete mode 100644 dist/modules/select/directives/select-search.js.map delete mode 100644 dist/modules/select/directives/select-search.metadata.json delete mode 100644 dist/modules/select/index.d.ts delete mode 100644 dist/modules/select/index.js delete mode 100644 dist/modules/select/index.js.map delete mode 100644 dist/modules/select/index.metadata.json delete mode 100644 dist/modules/select/public.d.ts delete mode 100644 dist/modules/select/public.js delete mode 100644 dist/modules/select/public.js.map delete mode 100644 dist/modules/select/public.metadata.json delete mode 100644 dist/modules/select/select.module.d.ts delete mode 100644 dist/modules/select/select.module.js delete mode 100644 dist/modules/select/select.module.js.map delete mode 100644 dist/modules/select/select.module.metadata.json delete mode 100644 dist/modules/sidebar/components/sidebar-container.d.ts delete mode 100644 dist/modules/sidebar/components/sidebar-container.js delete mode 100644 dist/modules/sidebar/components/sidebar-container.js.map delete mode 100644 dist/modules/sidebar/components/sidebar-container.metadata.json delete mode 100644 dist/modules/sidebar/components/sidebar-sibling.d.ts delete mode 100644 dist/modules/sidebar/components/sidebar-sibling.js delete mode 100644 dist/modules/sidebar/components/sidebar-sibling.js.map delete mode 100644 dist/modules/sidebar/components/sidebar-sibling.metadata.json delete mode 100644 dist/modules/sidebar/components/sidebar.d.ts delete mode 100644 dist/modules/sidebar/components/sidebar.js delete mode 100644 dist/modules/sidebar/components/sidebar.js.map delete mode 100644 dist/modules/sidebar/components/sidebar.metadata.json delete mode 100644 dist/modules/sidebar/index.d.ts delete mode 100644 dist/modules/sidebar/index.js delete mode 100644 dist/modules/sidebar/index.js.map delete mode 100644 dist/modules/sidebar/index.metadata.json delete mode 100644 dist/modules/sidebar/public.d.ts delete mode 100644 dist/modules/sidebar/public.js delete mode 100644 dist/modules/sidebar/public.js.map delete mode 100644 dist/modules/sidebar/public.metadata.json delete mode 100644 dist/modules/sidebar/services/sidebar.service.d.ts delete mode 100644 dist/modules/sidebar/services/sidebar.service.js delete mode 100644 dist/modules/sidebar/services/sidebar.service.js.map delete mode 100644 dist/modules/sidebar/services/sidebar.service.metadata.json delete mode 100644 dist/modules/sidebar/sidebar.module.d.ts delete mode 100644 dist/modules/sidebar/sidebar.module.js delete mode 100644 dist/modules/sidebar/sidebar.module.js.map delete mode 100644 dist/modules/sidebar/sidebar.module.metadata.json delete mode 100644 dist/modules/tabs/classes/tab.d.ts delete mode 100644 dist/modules/tabs/classes/tab.js delete mode 100644 dist/modules/tabs/classes/tab.js.map delete mode 100644 dist/modules/tabs/classes/tab.metadata.json delete mode 100644 dist/modules/tabs/components/tabset.d.ts delete mode 100644 dist/modules/tabs/components/tabset.js delete mode 100644 dist/modules/tabs/components/tabset.js.map delete mode 100644 dist/modules/tabs/components/tabset.metadata.json delete mode 100644 dist/modules/tabs/directives/tab-content.d.ts delete mode 100644 dist/modules/tabs/directives/tab-content.js delete mode 100644 dist/modules/tabs/directives/tab-content.js.map delete mode 100644 dist/modules/tabs/directives/tab-content.metadata.json delete mode 100644 dist/modules/tabs/directives/tab-header.d.ts delete mode 100644 dist/modules/tabs/directives/tab-header.js delete mode 100644 dist/modules/tabs/directives/tab-header.js.map delete mode 100644 dist/modules/tabs/directives/tab-header.metadata.json delete mode 100644 dist/modules/tabs/index.d.ts delete mode 100644 dist/modules/tabs/index.js delete mode 100644 dist/modules/tabs/index.js.map delete mode 100644 dist/modules/tabs/index.metadata.json delete mode 100644 dist/modules/tabs/public.d.ts delete mode 100644 dist/modules/tabs/public.js delete mode 100644 dist/modules/tabs/public.js.map delete mode 100644 dist/modules/tabs/public.metadata.json delete mode 100644 dist/modules/tabs/tab.module.d.ts delete mode 100644 dist/modules/tabs/tab.module.js delete mode 100644 dist/modules/tabs/tab.module.js.map delete mode 100644 dist/modules/tabs/tab.module.metadata.json delete mode 100644 dist/modules/transition/classes/transition-controller.d.ts delete mode 100644 dist/modules/transition/classes/transition-controller.js delete mode 100644 dist/modules/transition/classes/transition-controller.js.map delete mode 100644 dist/modules/transition/classes/transition-controller.metadata.json delete mode 100644 dist/modules/transition/classes/transition.d.ts delete mode 100644 dist/modules/transition/classes/transition.js delete mode 100644 dist/modules/transition/classes/transition.js.map delete mode 100644 dist/modules/transition/classes/transition.metadata.json delete mode 100644 dist/modules/transition/directives/transition.d.ts delete mode 100644 dist/modules/transition/directives/transition.js delete mode 100644 dist/modules/transition/directives/transition.js.map delete mode 100644 dist/modules/transition/directives/transition.metadata.json delete mode 100644 dist/modules/transition/index.d.ts delete mode 100644 dist/modules/transition/index.js delete mode 100644 dist/modules/transition/index.js.map delete mode 100644 dist/modules/transition/index.metadata.json delete mode 100644 dist/modules/transition/public.d.ts delete mode 100644 dist/modules/transition/public.js delete mode 100644 dist/modules/transition/public.js.map delete mode 100644 dist/modules/transition/public.metadata.json delete mode 100644 dist/modules/transition/transition.module.d.ts delete mode 100644 dist/modules/transition/transition.module.js delete mode 100644 dist/modules/transition/transition.module.js.map delete mode 100644 dist/modules/transition/transition.module.metadata.json delete mode 100644 dist/public.d.ts delete mode 100644 dist/public.js delete mode 100644 dist/public.js.map delete mode 100644 dist/public.metadata.json delete mode 100644 dist/sui.module.d.ts delete mode 100644 dist/sui.module.js delete mode 100644 dist/sui.module.js.map delete mode 100644 dist/sui.module.metadata.json diff --git a/bundles/ng2-semantic-ui.umd.js b/bundles/ng2-semantic-ui.umd.js deleted file mode 100644 index cb649369a..000000000 --- a/bundles/ng2-semantic-ui.umd.js +++ /dev/null @@ -1,14313 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms')) : - typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@angular/forms'], factory) : - (factory((global['ng2-semantic-ui'] = global['ng2-semantic-ui'] || {}),global._angular_core,global._angular_common,global._angular_forms)); -}(this, (function (exports,_angular_core,_angular_common,_angular_forms) { 'use strict'; - -var enGB = { - datepicker: { - months: [ - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - ], - monthsShort: [ - "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - ], - weekdays: [ - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" - ], - weekdaysShort: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - ], - weekdaysNarrow: [ - "S", "M", "T", "W", "T", "F", "S" - ], - timesOfDay: [ - "a.m.", "p.m." - ], - timesOfDayUppercase: [ - "AM", "PM" - ], - timesOfDayLowercase: [ - "am", "pm" - ], - formats: { - time: "h:mm A", - datetime: "D MMMM YYYY h:mm A", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Search...", - noResults: { - header: "No Results", - message: "Your search returned no results." - } - }, - select: { - noResultsMessage: "No results", - single: { - placeholder: "Select one" - }, - multi: { - placeholder: "Select...", - maxSelectedMessage: "Max #{max} selections", - selectedMessage: "#{count} selections" - } - } -}; - -var hasOwn = Object.prototype.hasOwnProperty; -var toStr = Object.prototype.toString; - -var isArray = function isArray(arr) { - if (typeof Array.isArray === 'function') { - return Array.isArray(arr); - } - - return toStr.call(arr) === '[object Array]'; -}; - -var isPlainObject = function isPlainObject(obj) { - if (!obj || toStr.call(obj) !== '[object Object]') { - return false; - } - - var hasOwnConstructor = hasOwn.call(obj, 'constructor'); - var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); - // Not own constructor property must be Object - if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - var key; - for (key in obj) { /**/ } - - return typeof key === 'undefined' || hasOwn.call(obj, key); -}; - -var index = function extend() { - var options, name, src, copy, copyIsArray, clone; - var target = arguments[0]; - var i = 1; - var length = arguments.length; - var deep = false; - - // Handle a deep copy situation - if (typeof target === 'boolean') { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { - target = {}; - } - - for (; i < length; ++i) { - options = arguments[i]; - // Only deal with non-null/undefined values - if (options != null) { - // Extend the base object - for (name in options) { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target !== copy) { - // Recurse if we're merging plain objects or arrays - if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { - if (copyIsArray) { - copyIsArray = false; - clone = src && isArray(src) ? src : []; - } else { - clone = src && isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = extend(deep, clone, copy); - - // Don't bring in undefined values - } else if (typeof copy !== 'undefined') { - target[name] = copy; - } - } - } - } - } - - // Return the modified object - return target; -}; - - - -var $extend = Object.freeze({ - default: index, - __moduleExports: index -}); - -function deepClone(obj) { - return JSON.parse(JSON.stringify(obj)); -} -function deepExtend(target, source) { - // Rollup... - var extend = index || $extend; - return extend(true, target, source); -} -function lang(language) { - return language.toLowerCase().replace("-", ""); -} -var SuiLocalizationService = /** @class */ (function () { - function SuiLocalizationService() { - this.onLanguageUpdate = new _angular_core.EventEmitter(); - this._fallbackValues = enGB; - this._values = {}; - this._language = "en-GB"; - this.load("en-GB", enGB); - } - Object.defineProperty(SuiLocalizationService.prototype, "language", { - get: function () { - return this._language; - }, - enumerable: true, - configurable: true - }); - SuiLocalizationService.prototype.setLanguage = function (language) { - if (lang(this._language) !== lang(language)) { - this._language = language; - this.onLanguageUpdate.emit(); - } - }; - SuiLocalizationService.prototype.get = function (language) { - if (language === void 0) { language = this.language; } - var values = deepClone(this._fallbackValues); - if (!this._values[lang(language)]) { - throw new Error("Locale " + language + " is not loaded"); - } - deepExtend(values, this._values[lang(language)]); - return deepClone(values); - }; - SuiLocalizationService.prototype.override = function (values, overrides) { - return deepExtend(deepClone(values), overrides); - }; - SuiLocalizationService.prototype.load = function (language, values) { - this._values[lang(language)] = deepClone(values); - this.onLanguageUpdate.emit(); - }; - SuiLocalizationService.prototype.patch = function (language, values) { - deepExtend(this._values[lang(language)], values); - }; - SuiLocalizationService.prototype.interpolate = function (value, variables) { - return variables.reduce(function (s, _a) { - var k = _a[0], v = _a[1]; - return s.replace(new RegExp("#{" + k + "}", "g"), v); - }, value); - }; - SuiLocalizationService.decorators = [ - { type: _angular_core.Injectable }, - ]; - /** @nocollapse */ - SuiLocalizationService.ctorParameters = function () { return []; }; - return SuiLocalizationService; -}()); - -var SuiLocalizationModule = /** @class */ (function () { - function SuiLocalizationModule() { - } - SuiLocalizationModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [_angular_common.CommonModule], - providers: [SuiLocalizationService] - },] }, - ]; - /** @nocollapse */ - SuiLocalizationModule.ctorParameters = function () { return []; }; - return SuiLocalizationModule; -}()); - -// Possible directions for a transition. -// Possible directions for a transition. - -// Possible directions for a transition. -(function (TransitionDirection) { - TransitionDirection[TransitionDirection["In"] = 0] = "In"; - TransitionDirection[TransitionDirection["Out"] = 1] = "Out"; - TransitionDirection[TransitionDirection["Either"] = 2] = "Either"; - TransitionDirection[TransitionDirection["Static"] = 3] = "Static"; -})(exports.TransitionDirection || (exports.TransitionDirection = {})); -var Transition = /** @class */ (function () { - function Transition(name, duration, direction, onComplete) { - if (duration === void 0) { duration = 250; } - if (direction === void 0) { direction = exports.TransitionDirection.Either; } - if (onComplete === void 0) { onComplete = function () { }; } - this.type = name; - // We set a minimum duration of 1ms, to give the appearance of an immediate transition - // whilst allowing positioning calculations to happen without a visible flicker. - this.duration = Math.max(duration, 1); - this.direction = direction; - this.classes = this.type.split(" "); - this.onComplete = onComplete; - } - Object.defineProperty(Transition.prototype, "directionClass", { - // Converts TransitionDirection to class name. - get: - // Converts TransitionDirection to class name. - function () { - switch (this.direction) { - case exports.TransitionDirection.In: return "in"; - case exports.TransitionDirection.Out: return "out"; - } - return ""; - }, - enumerable: true, - configurable: true - }); - return Transition; -}()); - -var TransitionController = /** @class */ (function () { - function TransitionController(isInitiallyVisible, display) { - if (isInitiallyVisible === void 0) { isInitiallyVisible = true; } - if (display === void 0) { display = "block"; } - // isInitiallyVisible sets whether the element starts out visible. - this._isVisible = isInitiallyVisible; - this._isHidden = !this._isVisible; - this._display = display; - this._queue = []; - this._isAnimating = false; - } - Object.defineProperty(TransitionController.prototype, "_isReady", { - // Used to delay animations until we have an element to animate. - get: - // Used to delay animations until we have an element to animate. - function () { - return this._renderer != undefined && this._element != undefined && this._changeDetector != undefined; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TransitionController.prototype, "isAnimating", { - get: function () { - return this._isAnimating; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TransitionController.prototype, "isVisible", { - get: function () { - return this._isVisible; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TransitionController.prototype, "isHidden", { - get: function () { - return this._isHidden; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TransitionController.prototype, "_queueFirst", { - // Gets the first transition in the queue. - get: - // Gets the first transition in the queue. - function () { - return this._queue[0]; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TransitionController.prototype, "_queueLast", { - // Gets the last transition in the queue. - get: - // Gets the last transition in the queue. - function () { - return this._queue[this._queue.length - 1]; - }, - enumerable: true, - configurable: true - }); - // Sets the renderer to be used for animating. - // Sets the renderer to be used for animating. - TransitionController.prototype.registerRenderer = - // Sets the renderer to be used for animating. - function (renderer) { - this._renderer = renderer; - this.performTransition(); - }; - // Sets the element to perform the animations on. - // Sets the element to perform the animations on. - TransitionController.prototype.registerElement = - // Sets the element to perform the animations on. - function (element) { - this._element = element; - this.performTransition(); - }; - // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. - // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. - TransitionController.prototype.registerChangeDetector = - // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. - function (changeDetector) { - this._changeDetector = changeDetector; - this.performTransition(); - }; - TransitionController.prototype.animate = function (transition) { - // Test if transition is one of the list that doesn't change the visible state. - // Should these eventually become classes? - var isDirectionless = ["jiggle", "flash", "shake", "pulse", "tada", "bounce"].indexOf(transition.type) !== -1; - if (isDirectionless) { - transition.direction = exports.TransitionDirection.Static; - } - else if (transition.direction == undefined || transition.direction === exports.TransitionDirection.Either) { - // Set the direction to the opposite of the current visible state automatically if not set, or set to either direction. - transition.direction = this._isVisible ? exports.TransitionDirection.Out : exports.TransitionDirection.In; - if (this._queueLast) { - // If there is an transition in the queue already, set the direction to the opposite of the direction of that transition. - if (this._queueLast.direction === exports.TransitionDirection.In) { - transition.direction = exports.TransitionDirection.Out; - } - else if (this._queueLast.direction === exports.TransitionDirection.Out) { - transition.direction = exports.TransitionDirection.In; - } - } - } - // Store the transition in the queue before attempting to perform it. - this._queue.push(transition); - this.performTransition(); - }; - TransitionController.prototype.performTransition = function () { - var _this = this; - if (!this._isReady || this._isAnimating || !this._queueFirst) { - // Don't transition until we are ready, or if we are animating, or if there aren't any transitions in the queue. - return; - } - this._isAnimating = true; - var transition = this._queueFirst; - // Set the Semantic UI classes for transitioning. - transition.classes.forEach(function (c) { return _this._renderer.addClass(_this._element, c); }); - this._renderer.addClass(this._element, "animating"); - this._renderer.addClass(this._element, transition.directionClass); - // Set the Semantic UI styles for transitioning. - this._renderer.setStyle(this._element, "animationDuration", transition.duration + "ms"); - this._renderer.setStyle(this._element, "display", this._display); - if (transition.direction === exports.TransitionDirection.In) { - // Unset hidden if we are transitioning in. - this._isHidden = false; - } - // Wait the length of the animation before calling the complete callback. - this._animationTimeout = window.setTimeout(function () { return _this.finishTransition(transition); }, transition.duration); - }; - // Called when a transition has completed. - // Called when a transition has completed. - TransitionController.prototype.finishTransition = - // Called when a transition has completed. - function (transition) { - var _this = this; - // Unset the Semantic UI classes & styles for transitioning. - transition.classes.forEach(function (c) { return _this._renderer.removeClass(_this._element, c); }); - this._renderer.removeClass(this._element, "animating"); - this._renderer.removeClass(this._element, transition.directionClass); - this._renderer.removeStyle(this._element, "animationDuration"); - this._renderer.removeStyle(this._element, "display"); - if (transition.direction === exports.TransitionDirection.In) { - // If we have just animated in, we are now visible. - this._isVisible = true; - } - else if (transition.direction === exports.TransitionDirection.Out) { - // If we have transitioned out, we should be invisible and hidden. - this._isVisible = false; - this._isHidden = true; - } - if (transition.onComplete) { - // Call the user-defined transition callback. - transition.onComplete(); - } - // Delete the transition from the queue. - this._queue.shift(); - this._isAnimating = false; - this._changeDetector.markForCheck(); - // Immediately attempt to perform another transition. - this.performTransition(); - }; - // Stops the current transition, leaves the rest of the queue intact. - // Stops the current transition, leaves the rest of the queue intact. - TransitionController.prototype.stop = - // Stops the current transition, leaves the rest of the queue intact. - function (transition) { - if (transition === void 0) { transition = this._queueFirst; } - if (!transition || !this._isAnimating) { - return; - } - clearTimeout(this._animationTimeout); - this.finishTransition(transition); - }; - // Stops the current transition, and empties the queue. - // Stops the current transition, and empties the queue. - TransitionController.prototype.stopAll = - // Stops the current transition, and empties the queue. - function () { - this.clearQueue(); - this.stop(); - }; - // Empties the transition queue but carries on with the current transition. - // Empties the transition queue but carries on with the current transition. - TransitionController.prototype.clearQueue = - // Empties the transition queue but carries on with the current transition. - function () { - if (this.isAnimating) { - this._queue = [this._queueFirst]; - return; - } - this._queue = []; - }; - return TransitionController; -}()); - -var SuiTransition = /** @class */ (function () { - function SuiTransition(_renderer, _element, _changeDetector) { - this._renderer = _renderer; - this._element = _element; - this._changeDetector = _changeDetector; - this.transitionClass = true; - } - Object.defineProperty(SuiTransition.prototype, "suiTransition", { - set: function (tC) { - // Set the transition controller (e.g. '
'). - this.setTransitionController(tC); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiTransition.prototype, "isVisible", { - get: function () { - if (this._controller) { - return this._controller.isVisible; - } - return false; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiTransition.prototype, "isHidden", { - get: function () { - if (this._controller) { - return this._controller.isHidden; - } - return false; - }, - enumerable: true, - configurable: true - }); - // Initialises the controller with the injected renderer and elementRef. - // Initialises the controller with the injected renderer and elementRef. - SuiTransition.prototype.setTransitionController = - // Initialises the controller with the injected renderer and elementRef. - function (transitionController) { - this._controller = transitionController; - this._controller.registerRenderer(this._renderer); - this._controller.registerElement(this._element.nativeElement); - this._controller.registerChangeDetector(this._changeDetector); - }; - SuiTransition.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "[suiTransition]", - exportAs: "transition" - },] }, - ]; - /** @nocollapse */ - SuiTransition.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - { type: _angular_core.ChangeDetectorRef, }, - ]; }; - SuiTransition.propDecorators = { - "suiTransition": [{ type: _angular_core.Input },], - "transitionClass": [{ type: _angular_core.HostBinding, args: ["class.transition",] },], - "isVisible": [{ type: _angular_core.HostBinding, args: ["class.visible",] },], - "isHidden": [{ type: _angular_core.HostBinding, args: ["class.hidden",] },], - }; - return SuiTransition; -}()); - -var SuiTransitionModule = /** @class */ (function () { - function SuiTransitionModule() { - } - SuiTransitionModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [_angular_common.CommonModule], - declarations: [ - SuiTransition - ], - exports: [ - SuiTransition - ], - providers: [] - },] }, - ]; - /** @nocollapse */ - SuiTransitionModule.ctorParameters = function () { return []; }; - return SuiTransitionModule; -}()); - -var SuiMessage = /** @class */ (function () { - function SuiMessage() { - this.isDismissable = true; - this.onDismiss = new _angular_core.EventEmitter(); - this.isDismissed = false; - this.transitionController = new TransitionController(); - this.transition = "fade"; - this.transitionDuration = 300; - this.class = ""; - } - SuiMessage.prototype.dismiss = function () { - var _this = this; - this.transitionController.animate(new Transition(this.transition, this.transitionDuration, exports.TransitionDirection.Out, function () { - _this.isDismissed = true; - _this.onDismiss.emit(_this); - })); - }; - SuiMessage.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-message", - template: "\n
\n \n \n
\n", - styles: ["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiMessage.ctorParameters = function () { return []; }; - SuiMessage.propDecorators = { - "isDismissable": [{ type: _angular_core.Input },], - "onDismiss": [{ type: _angular_core.Output, args: ["dismiss",] },], - "transition": [{ type: _angular_core.Input },], - "transitionDuration": [{ type: _angular_core.Input },], - "class": [{ type: _angular_core.Input, args: ["class",] },], - }; - return SuiMessage; -}()); - -var SuiMessageModule = /** @class */ (function () { - function SuiMessageModule() { - } - SuiMessageModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule, - SuiTransitionModule - ], - declarations: [ - SuiMessage - ], - exports: [ - SuiMessage - ] - },] }, - ]; - /** @nocollapse */ - SuiMessageModule.ctorParameters = function () { return []; }; - return SuiMessageModule; -}()); - -var SuiPagination = /** @class */ (function () { - function SuiPagination() { - this._paginationClasses = true; - this.pageChange = new _angular_core.EventEmitter(); - this.pageSize = 10; - this._page = 1; - this._pages = []; - this.pageCount = 1; - this.hasNavigationLinks = true; - this.hasBoundaryLinks = false; - this.canRotate = false; - this.hasEllipses = true; - } - Object.defineProperty(SuiPagination.prototype, "maxSize", { - get: function () { - return this._maxSize; - }, - set: function (value) { - this._maxSize = (value != undefined) ? Math.max(value, 1) : undefined; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPagination.prototype, "collectionSize", { - get: function () { - return this._collectionSize; - }, - set: function (value) { - this._collectionSize = Math.max(value, 0); - this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize)); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPagination.prototype, "hasNavigationLinks", { - get: function () { - var maxSize = this._maxSize || this.pageCount; - return this._hasNavigationLinks || maxSize < this.pageCount; - }, - set: function (value) { - this._hasNavigationLinks = value; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPagination.prototype, "page", { - get: function () { - return this._page; - }, - set: function (value) { - this.setPage(value); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPagination.prototype, "pages", { - get: function () { - return this._pages; - }, - enumerable: true, - configurable: true - }); - // Public methods - // Public methods - SuiPagination.prototype.hasPrevious = - // Public methods - function () { - return this.page > 1; - }; - SuiPagination.prototype.hasNext = function () { - return this.page < this.pageCount; - }; - SuiPagination.prototype.setPage = function (newPage) { - var value = (Number.isInteger(newPage)) ? Math.min(Math.max(newPage, 1), this.pageCount) : 1; - if (value !== this._page) { - this._page = value; - this.pageChange.emit(this._page); - } - }; - // Lifecycle hooks - // Lifecycle hooks - SuiPagination.prototype.ngOnChanges = - // Lifecycle hooks - function () { - this.updatePages(); - }; - // Private methods - // Private methods - SuiPagination.prototype.updatePages = - // Private methods - function () { - this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize)); - var _a = this.applyPagination(), start = _a[0], end = _a[1]; - this._pages = Array(end - start) - .fill(start + 1) - .map(function (s, i) { return s + i; }); - }; - SuiPagination.prototype.applyPagination = function () { - var maxSize = (this.maxSize != undefined) ? Math.min(this.maxSize, this.pageCount) : this.pageCount; - var page = Math.ceil(this.page / maxSize) - 1; - var start = 0; - var end = this.pageCount; - if (this.canRotate) { - var leftOffset = Math.floor(maxSize / 2); - var rightOffset = maxSize % 2 === 0 ? leftOffset - 1 : leftOffset; - if (this.page <= leftOffset) { - end = maxSize; - } - else if (this.pageCount - this.page < leftOffset) { - start = this.pageCount - maxSize; - } - else { - start = this.page - leftOffset - 1; - end = this.page + rightOffset; - } - } - else { - start = page * maxSize; - end = start + maxSize; - } - return [start, Math.min(end, this.pageCount)]; - }; - SuiPagination.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-pagination", - template: "\n\n \n\n\n \n\n\n \n 1\n \n 2\">...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n", - styles: ["\n:host .item {\n transition: none;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiPagination.ctorParameters = function () { return []; }; - SuiPagination.propDecorators = { - "_paginationClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.pagination",] }, { type: _angular_core.HostBinding, args: ["class.menu",] },], - "pageChange": [{ type: _angular_core.Output },], - "maxSize": [{ type: _angular_core.Input },], - "pageSize": [{ type: _angular_core.Input },], - "collectionSize": [{ type: _angular_core.Input },], - "hasNavigationLinks": [{ type: _angular_core.Input },], - "hasBoundaryLinks": [{ type: _angular_core.Input },], - "canRotate": [{ type: _angular_core.Input },], - "hasEllipses": [{ type: _angular_core.Input },], - "page": [{ type: _angular_core.Input },], - }; - return SuiPagination; -}()); - -var SuiPaginationModule = /** @class */ (function () { - function SuiPaginationModule() { - } - SuiPaginationModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [_angular_common.CommonModule], - exports: [SuiPagination], - declarations: [SuiPagination], - providers: [] - },] }, - ]; - /** @nocollapse */ - SuiPaginationModule.ctorParameters = function () { return []; }; - return SuiPaginationModule; -}()); - -var SuiAccordionPanel = /** @class */ (function () { - function SuiAccordionPanel(_changeDetector) { - this._changeDetector = _changeDetector; - this.transitionController = new TransitionController(false); - this._isOpen = false; - this.isOpenChange = new _angular_core.EventEmitter(false); - } - Object.defineProperty(SuiAccordionPanel.prototype, "service", { - set: function (service) { - this._service = service; - this._changeDetector.detectChanges(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiAccordionPanel.prototype, "isOpen", { - get: function () { - return this._isOpen; - }, - set: function (value) { - // Convert to boolean (fixes false != undefined) - var isOpen = !!value; - if (isOpen !== this.isOpen) { - // Only update if the value has changed. - this._isOpen = isOpen; - if (isOpen && this._service) { - // If we are opening this panel, we must close the other ones. - this._service.closeOtherPanels(this); - } - this.isOpenChange.emit(this.isOpen); - // Cancel all current animations, and fade the contents. The direction is automatic. - this.transitionController.stopAll(); - this.transitionController.animate(new Transition(this.transition, this.transitionDuration)); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiAccordionPanel.prototype, "transition", { - get: function () { - if (this._service) { - return this._service.transition; - } - return "fade"; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiAccordionPanel.prototype, "transitionDuration", { - get: function () { - if (this._service) { - // Return the service defined transition duration. - return this._service.transitionDuration; - } - // Revert to instantaneous if the service is not yet loaded. - return 0; - }, - enumerable: true, - configurable: true - }); - SuiAccordionPanel.prototype.toggle = function () { - if (!this.isDisabled) { - this.isOpen = !this.isOpen; - } - }; - SuiAccordionPanel.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-accordion-panel", - exportAs: "suiAccordionPanel", - template: "\n\n
\n \n
\n\n
\n
\n \n
\n
\n", - styles: ["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiAccordionPanel.ctorParameters = function () { return [ - { type: _angular_core.ChangeDetectorRef, }, - ]; }; - SuiAccordionPanel.propDecorators = { - "isDisabled": [{ type: _angular_core.Input },], - "isOpen": [{ type: _angular_core.Input },], - "isOpenChange": [{ type: _angular_core.Output },], - }; - return SuiAccordionPanel; -}()); - -var SuiAccordionService = /** @class */ (function () { - function SuiAccordionService() { - this.closeOthers = true; - this.transition = "fade"; - this.transitionDuration = 350; - this.panels = []; - } - SuiAccordionService.prototype.addPanel = function (panel) { - panel.service = this; - this.panels.push(panel); - }; - SuiAccordionService.prototype.closeOtherPanels = function (panel) { - if (!this.closeOthers) { - return; - } - this.panels.forEach(function (p) { - if (p !== panel) { - p.isOpen = false; - } - }); - }; - return SuiAccordionService; -}()); - -var SuiAccordion = /** @class */ (function () { - function SuiAccordion() { - // Accordion service is unique to each set of panels. - this._service = new SuiAccordionService(); - this.accordionClasses = true; - } - Object.defineProperty(SuiAccordion.prototype, "closeOthers", { - get: function () { - return this._service.closeOthers; - }, - set: function (value) { - this._service.closeOthers = value; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiAccordion.prototype, "transition", { - set: function (transition) { - this._service.transition = transition; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiAccordion.prototype, "transitionDuration", { - set: function (duration) { - this._service.transitionDuration = duration; - }, - enumerable: true, - configurable: true - }); - SuiAccordion.prototype.ngAfterContentInit = function () { - var _this = this; - this.updatePanels(); - // Reconnect panels after they have updated. - this._panels.changes.subscribe(function () { return _this.updatePanels(); }); - }; - SuiAccordion.prototype.updatePanels = function () { - var _this = this; - this._panels.forEach(function (p) { return _this._service.addPanel(p); }); - }; - SuiAccordion.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-accordion", - template: "\n\n", - styles: ["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiAccordion.ctorParameters = function () { return []; }; - SuiAccordion.propDecorators = { - "accordionClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.accordion",] },], - "closeOthers": [{ type: _angular_core.Input },], - "transition": [{ type: _angular_core.Input },], - "transitionDuration": [{ type: _angular_core.Input },], - "_panels": [{ type: _angular_core.ContentChildren, args: [SuiAccordionPanel,] },], - }; - return SuiAccordion; -}()); - -var SuiCollapse = /** @class */ (function () { - function SuiCollapse(_element, _renderer) { - this._element = _element; - this._renderer = _renderer; - this._pristine = true; - // Collapse animation duration is 350ms by default. - this.collapseDuration = 350; - this._isExpanded = false; - this._isCollapsing = false; - } - Object.defineProperty(SuiCollapse.prototype, "_isCollapsed", { - get: - // Set when the collapse is closed, and not animating. - function () { - return !this._isExpanded && !this._isCollapsing; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCollapse.prototype, "suiCollapse", { - get: function () { - return this._isExpanded; - }, - // Sets the state of the collapse, `true` is collapsed. - set: - // Sets the state of the collapse, `true` is collapsed. - function (value) { - if (value) { - this.hide(); - } - else { - this.show(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCollapse.prototype, "_animationDuration", { - get: function () { - return this._pristine ? 0 : this.collapseDuration; - }, - enumerable: true, - configurable: true - }); - SuiCollapse.prototype.hide = function () { - var _this = this; - this._isCollapsing = true; - this._isExpanded = false; - // Forcibly hide the overflow so that content is not visible past the boundaries of its container. - this._renderer.setStyle(this._element.nativeElement, "overflow", "hidden"); - // Animate the host element from its scroll height to 0. - this.animate(this._element.nativeElement.scrollHeight, 0, false, function () { - _this._isCollapsing = false; - }); - }; - SuiCollapse.prototype.show = function () { - var _this = this; - this._isCollapsing = true; - // Animate the host element from its offset height to its scroll height. - this.animate(this._element.nativeElement.offsetHeight, this._element.nativeElement.scrollHeight, true, function () { - // Remove the overflow override to enable user styling once again. - // Remove the overflow override to enable user styling once again. - _this._renderer.removeStyle(_this._element.nativeElement, "overflow"); - _this._isCollapsing = false; - _this._isExpanded = true; - }); - }; - SuiCollapse.prototype.animate = function (startHeight, endHeight, removeOnComplete, callback) { - if (removeOnComplete === void 0) { removeOnComplete = false; } - if (callback === void 0) { callback = function () { }; } - var heightFrames = [ - { - offset: 0, - height: startHeight + "px" - }, - { - offset: 1, - height: endHeight + "px" - } - ]; - if (removeOnComplete) { - heightFrames.push({ - offset: 1, - height: "auto" - }); - } - // Animate the collapse using the web animations API. - // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. - this._element.nativeElement.animate(heightFrames, { - delay: 0, - // Disable animation on 1st collapse / expansion. - duration: this._animationDuration, - iterations: 1, - easing: "ease", - fill: "both" - }); - if (this._pristine) { - // Remove pristine flag when first hit. - this._pristine = false; - } - setTimeout(function () { return callback(); }, this.collapseDuration); - }; - SuiCollapse.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "[suiCollapse]" - },] }, - ]; - /** @nocollapse */ - SuiCollapse.ctorParameters = function () { return [ - { type: _angular_core.ElementRef, }, - { type: _angular_core.Renderer2, }, - ]; }; - SuiCollapse.propDecorators = { - "_isExpanded": [{ type: _angular_core.HostBinding, args: ["class.expanded",] },], - "_isCollapsed": [{ type: _angular_core.HostBinding, args: ["class.collapsed",] },], - "_isCollapsing": [{ type: _angular_core.HostBinding, args: ["class.collapsing",] },], - "suiCollapse": [{ type: _angular_core.Input },], - "collapseDuration": [{ type: _angular_core.Input },], - }; - return SuiCollapse; -}()); - -var SuiCollapseModule = /** @class */ (function () { - function SuiCollapseModule() { - } - SuiCollapseModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule - ], - declarations: [ - SuiCollapse - ], - exports: [ - SuiCollapse - ] - },] }, - ]; - /** @nocollapse */ - SuiCollapseModule.ctorParameters = function () { return []; }; - return SuiCollapseModule; -}()); - -var SuiAccordionModule = /** @class */ (function () { - function SuiAccordionModule() { - } - SuiAccordionModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule, - SuiCollapseModule, - SuiTransitionModule - ], - declarations: [ - SuiAccordion, - SuiAccordionPanel - ], - exports: [ - SuiAccordion, - SuiAccordionPanel - ], - providers: [] - },] }, - ]; - /** @nocollapse */ - SuiAccordionModule.ctorParameters = function () { return []; }; - return SuiAccordionModule; -}()); - -var CustomValidator = /** @class */ (function () { - function CustomValidator(_host) { - this._host = _host; - this.onValidatorChange = function () { }; - } - CustomValidator.prototype.validate = function (c) { - return this._host.validate(c); - }; - CustomValidator.prototype.registerOnValidatorChange = function (fn) { - this.onValidatorChange = fn; - }; - return CustomValidator; -}()); -function customValidatorFactory(type) { - return { - provide: _angular_forms.NG_VALIDATORS, - useExisting: _angular_core.forwardRef(function () { return type; }), - multi: true - }; -} - -var CustomValueAccessor = /** @class */ (function () { - function CustomValueAccessor(_host) { - this._host = _host; - this.onChange = function () { }; - this.onTouched = function () { }; - } - CustomValueAccessor.prototype.writeValue = function (value) { - this._host.writeValue(value); - }; - CustomValueAccessor.prototype.registerOnChange = function (fn) { - this.onChange = fn; - }; - CustomValueAccessor.prototype.registerOnTouched = function (fn) { - this.onTouched = fn; - }; - return CustomValueAccessor; -}()); -function customValueAccessorFactory(type) { - return { - provide: _angular_forms.NG_VALUE_ACCESSOR, - useExisting: _angular_core.forwardRef(function () { return type; }), - multi: true - }; -} - -// Keyboard keycodes. -// Keyboard keycodes. - -// Keyboard keycodes. -(function (KeyCode) { - KeyCode[KeyCode["Left"] = 37] = "Left"; - KeyCode[KeyCode["Up"] = 38] = "Up"; - KeyCode[KeyCode["Right"] = 39] = "Right"; - KeyCode[KeyCode["Down"] = 40] = "Down"; - KeyCode[KeyCode["Escape"] = 27] = "Escape"; - KeyCode[KeyCode["Enter"] = 13] = "Enter"; - KeyCode[KeyCode["Space"] = 32] = "Space"; - KeyCode[KeyCode["Backspace"] = 8] = "Backspace"; -})(exports.KeyCode || (exports.KeyCode = {})); -var HandledEvent = /** @class */ (function () { - function HandledEvent() { - } - return HandledEvent; -}()); -var Util = { - Array: { - range: function (n, offset) { - if (offset === void 0) { offset = 0; } - return Array(n).fill(0).map(function (z, i) { return i + offset; }); - }, - group: function (items, groupLength) { - var mutable = items.slice(0); - var groups = []; - while (mutable.length > 0) { - groups.push(mutable.splice(0, groupLength)); - } - return groups; - }, - groupBy: function (items, field) { - return items.reduce(function (groups, i) { - var fieldValue = i[field].toString(); - groups[fieldValue] = groups[fieldValue] || []; - groups[fieldValue].push(i); - return groups; - }, Object()); - }, - flatten: function (items) { - return items.reduce(function (is, i) { return is.concat(i); }, []); - } - }, - String: { - padLeft: function (str, length, padding) { - var s = str; - while (s.length < length) { - s = padding + s; - } - return s; - } - }, - DOM: { - parseBooleanAttribute: function (attributeValue) { - var value = attributeValue; - if (typeof attributeValue === "string") { - value = true; - } - return value; - } - }, - Object: { - readValue: function (object, path) { - if (!path) { - return object; - } - var recursed; - for (var i = 0, p = path.split("."), len = p.length; i < len; i++) { - recursed = object[p[i]]; - } - return recursed; - } - }, - Math: { - round: function (r, n) { - return Math.round(r / n) * n; - }, - roundUp: function (r, n) { - return Math.ceil(r / n) * n; - }, - roundDown: function (r, n) { - return Math.floor(r / n) * n; - }, - mod: function (r, n) { - var rem = r % n; - if (rem < 0) { - return rem + n; - } - return rem; - } - } -}; - -(function (DatePrecision) { - DatePrecision[DatePrecision["Decade"] = 0] = "Decade"; - DatePrecision[DatePrecision["Year"] = 1] = "Year"; - DatePrecision[DatePrecision["Month"] = 2] = "Month"; - DatePrecision[DatePrecision["Date"] = 3] = "Date"; - DatePrecision[DatePrecision["Hour"] = 4] = "Hour"; - DatePrecision[DatePrecision["Minute"] = 5] = "Minute"; -})(exports.DatePrecision || (exports.DatePrecision = {})); -var DateUtil = { - startOf: function (precision, date, resetAll) { - if (resetAll === void 0) { resetAll = false; } - switch (precision) { - case exports.DatePrecision.Decade: - var start = Math.floor(date.getFullYear() / 10) * 10 + 1; - date.setFullYear(start); - if (!resetAll) { - break; - } - // falls through - case exports.DatePrecision.Year: - date.setMonth(0); - if (!resetAll) { - break; - } - // falls through - case exports.DatePrecision.Month: - date.setDate(1); - if (!resetAll) { - break; - } - // falls through - case exports.DatePrecision.Date: - date.setHours(0); - if (!resetAll) { - break; - } - // falls through - case exports.DatePrecision.Hour: - date.setMinutes(0); - if (!resetAll) { - break; - } - // falls through - case exports.DatePrecision.Minute: - date.setSeconds(0, 0); - } - return date; - }, - endOf: function (precision, date) { - switch (precision) { - case exports.DatePrecision.Year: - date.setMonth(12, 0); - // falls through - case exports.DatePrecision.Month: - date.setMonth(date.getMonth() + 1, 0); - // falls through - case exports.DatePrecision.Date: - date.setHours(23, 59, 59, 999); - break; - case exports.DatePrecision.Hour: - date.setMinutes(59, 59, 999); - break; - case exports.DatePrecision.Minute: - date.setSeconds(59, 999); - break; - } - return date; - }, - equal: function (precision, a, b) { - var equal = true; - switch (precision) { - case exports.DatePrecision.Minute: - equal = equal && a.getMinutes() === b.getMinutes(); - // falls through - case exports.DatePrecision.Hour: - equal = equal && a.getHours() === b.getHours(); - // falls through - case exports.DatePrecision.Date: - equal = equal && a.getDate() === b.getDate(); - // falls through - case exports.DatePrecision.Month: - equal = equal && a.getMonth() === b.getMonth(); - // falls through - case exports.DatePrecision.Year: - equal = equal && a.getFullYear() === b.getFullYear(); - } - return equal; - }, - next: function (precision, date) { - return DateUtil.add(precision, date, 1); - }, - add: function (precision, date, i) { - var year = date.getFullYear(); - var month = date.getMonth(); - var day = date.getDate(); - switch (precision) { - case exports.DatePrecision.Decade: - date.setFullYear(year + i * 10); - if (date.getMonth() !== month) { - date.setDate(0); - } - break; - case exports.DatePrecision.Year: - date.setFullYear(year + i); - if (date.getMonth() !== month) { - date.setDate(0); - } - break; - case exports.DatePrecision.Month: - date.setMonth(month + i); - if (date.getMonth() !== Util.Math.mod(month + i, 12)) { - date.setDate(0); - } - break; - case exports.DatePrecision.Date: - date.setDate(day + i); - break; - case exports.DatePrecision.Hour: - date.setHours(date.getHours() + i); - break; - case exports.DatePrecision.Minute: - date.setMinutes(date.getMinutes() + i); - break; - } - return date; - }, - previous: function (precision, date) { - var year = date.getFullYear(); - var month = date.getMonth(); - var day = date.getDate(); - switch (precision) { - case exports.DatePrecision.Decade: - date.setFullYear(year - 10); - if (date.getMonth() !== month) { - date.setDate(0); - } - break; - case exports.DatePrecision.Year: - date.setFullYear(year - 1); - if (date.getMonth() !== month) { - date.setDate(0); - } - break; - case exports.DatePrecision.Month: - date.setMonth(month - 1); - if (date.getMonth() !== Util.Math.mod(month - 1, 12)) { - date.setDate(0); - } - break; - case exports.DatePrecision.Date: - date.setDate(day - 1); - break; - case exports.DatePrecision.Hour: - var hours = date.getHours(); - date.setHours(hours - 1); - if (date.getHours() !== Util.Math.mod(hours - 1, 24)) { - date.setHours(hours - 2); - } - break; - case exports.DatePrecision.Minute: - var minutes = date.getMinutes(); - date.setMinutes(minutes - 1); - } - return date; - }, - clone: function (date) { - return new Date(date.getTime()); - } -}; - -var SuiComponentFactory = /** @class */ (function () { - function SuiComponentFactory(_applicationRef, _componentFactoryResolver, _injector) { - this._applicationRef = _applicationRef; - this._componentFactoryResolver = _componentFactoryResolver; - this._injector = _injector; - } - SuiComponentFactory.prototype.createComponent = function (type, providers) { - if (providers === void 0) { providers = []; } - // Resolve a factory for creating components of type `type`. - var factory = this._componentFactoryResolver.resolveComponentFactory(type); - // Resolve and create an injector with the specified providers. - var injector = _angular_core.ReflectiveInjector.resolveAndCreate(providers, this._injector); - // Create a component using the previously resolved factory & injector. - var componentRef = factory.create(injector); - return componentRef; - }; - SuiComponentFactory.prototype.createView = function (viewContainer, template, context) { - viewContainer.createEmbeddedView(template, context); - }; - // Inserts the component into the specified view container. - // Inserts the component into the specified view container. - SuiComponentFactory.prototype.attachToView = - // Inserts the component into the specified view container. - function (componentRef, viewContainer) { - viewContainer.insert(componentRef.hostView, 0); - }; - // Inserts the component in the root application node. - // Inserts the component in the root application node. - SuiComponentFactory.prototype.attachToApplication = - // Inserts the component in the root application node. - function (componentRef) { - this._applicationRef.attachView(componentRef.hostView); - }; - // Detaches the component from the root application node. - // Detaches the component from the root application node. - SuiComponentFactory.prototype.detachFromApplication = - // Detaches the component from the root application node. - function (componentRef) { - this._applicationRef.detachView(componentRef.hostView); - }; - // Moves the component to the specified DOM element. - // Moves the component to the specified DOM element. - SuiComponentFactory.prototype.moveToElement = - // Moves the component to the specified DOM element. - function (componentRef, element) { - element.appendChild(componentRef.location.nativeElement); - }; - // Moves the component to the document body. - // Moves the component to the document body. - SuiComponentFactory.prototype.moveToDocumentBody = - // Moves the component to the document body. - function (componentRef) { - this.moveToElement(componentRef, (document.querySelector("body"))); - }; - SuiComponentFactory.prototype.detachFromDocument = function (componentRef) { - var element = componentRef.location.nativeElement; - // We can't use `element.remove()` due to lack of IE11 support. - if (element.parentNode) { - element.parentNode.removeChild(element); - } - }; - SuiComponentFactory.decorators = [ - { type: _angular_core.Injectable }, - ]; - /** @nocollapse */ - SuiComponentFactory.ctorParameters = function () { return [ - { type: _angular_core.ApplicationRef, }, - { type: _angular_core.ComponentFactoryResolver, }, - { type: _angular_core.Injector, }, - ]; }; - return SuiComponentFactory; -}()); - -/**! - * @fileOverview Kickass library to create and place poppers near their reference elements. - * @version 1.14.1 - * @license - * Copyright (c) 2016 Federico Zivolo and contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; -var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; -var timeoutDuration = 0; -for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { - if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { - timeoutDuration = 1; - break; - } -} - -function microtaskDebounce(fn) { - var called = false; - return function () { - if (called) { - return; - } - called = true; - window.Promise.resolve().then(function () { - called = false; - fn(); - }); - }; -} - -function taskDebounce(fn) { - var scheduled = false; - return function () { - if (!scheduled) { - scheduled = true; - setTimeout(function () { - scheduled = false; - fn(); - }, timeoutDuration); - } - }; -} - -var supportsMicroTasks = isBrowser && window.Promise; - -/** -* Create a debounced version of a method, that's asynchronously deferred -* but called in the minimum time possible. -* -* @method -* @memberof Popper.Utils -* @argument {Function} fn -* @returns {Function} -*/ -var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; - -/** - * Check if the given variable is a function - * @method - * @memberof Popper.Utils - * @argument {Any} functionToCheck - variable to check - * @returns {Boolean} answer to: is a function? - */ -function isFunction(functionToCheck) { - var getType = {}; - return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; -} - -/** - * Get CSS computed property of the given element - * @method - * @memberof Popper.Utils - * @argument {Eement} element - * @argument {String} property - */ -function getStyleComputedProperty(element, property) { - if (element.nodeType !== 1) { - return []; - } - // NOTE: 1 DOM access here - var css = getComputedStyle(element, null); - return property ? css[property] : css; -} - -/** - * Returns the parentNode or the host of the element - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @returns {Element} parent - */ -function getParentNode(element) { - if (element.nodeName === 'HTML') { - return element; - } - return element.parentNode || element.host; -} - -/** - * Returns the scrolling parent of the given element - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @returns {Element} scroll parent - */ -function getScrollParent(element) { - // Return body, `getScroll` will take care to get the correct `scrollTop` from it - if (!element) { - return document.body; - } - - switch (element.nodeName) { - case 'HTML': - case 'BODY': - return element.ownerDocument.body; - case '#document': - return element.body; - } - - // Firefox want us to check `-x` and `-y` variations as well - - var _getStyleComputedProp = getStyleComputedProperty(element), - overflow = _getStyleComputedProp.overflow, - overflowX = _getStyleComputedProp.overflowX, - overflowY = _getStyleComputedProp.overflowY; - - if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { - return element; - } - - return getScrollParent(getParentNode(element)); -} - -/** - * Tells if you are running Internet Explorer - * @method - * @memberof Popper.Utils - * @argument {number} version to check - * @returns {Boolean} isIE - */ -var cache = {}; - -var isIE = function () { - var version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all'; - - version = version.toString(); - if (cache.hasOwnProperty(version)) { - return cache[version]; - } - switch (version) { - case '11': - cache[version] = navigator.userAgent.indexOf('Trident') !== -1; - break; - case '10': - cache[version] = navigator.appVersion.indexOf('MSIE 10') !== -1; - break; - case 'all': - cache[version] = navigator.userAgent.indexOf('Trident') !== -1 || navigator.userAgent.indexOf('MSIE') !== -1; - break; - } - - //Set IE - cache.all = cache.all || Object.keys(cache).some(function (key) { - return cache[key]; - }); - return cache[version]; -}; - -/** - * Returns the offset parent of the given element - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @returns {Element} offset parent - */ -function getOffsetParent(element) { - if (!element) { - return document.documentElement; - } - - var noOffsetParent = isIE(10) ? document.body : null; - - // NOTE: 1 DOM access here - var offsetParent = element.offsetParent; - // Skip hidden elements which don't have an offsetParent - while (offsetParent === noOffsetParent && element.nextElementSibling) { - offsetParent = (element = element.nextElementSibling).offsetParent; - } - - var nodeName = offsetParent && offsetParent.nodeName; - - if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { - return element ? element.ownerDocument.documentElement : document.documentElement; - } - - // .offsetParent will return the closest TD or TABLE in case - // no offsetParent is present, I hate this job... - if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { - return getOffsetParent(offsetParent); - } - - return offsetParent; -} - -function isOffsetContainer(element) { - var nodeName = element.nodeName; - - if (nodeName === 'BODY') { - return false; - } - return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; -} - -/** - * Finds the root node (document, shadowDOM root) of the given element - * @method - * @memberof Popper.Utils - * @argument {Element} node - * @returns {Element} root node - */ -function getRoot(node) { - if (node.parentNode !== null) { - return getRoot(node.parentNode); - } - - return node; -} - -/** - * Finds the offset parent common to the two provided nodes - * @method - * @memberof Popper.Utils - * @argument {Element} element1 - * @argument {Element} element2 - * @returns {Element} common offset parent - */ -function findCommonOffsetParent(element1, element2) { - // This check is needed to avoid errors in case one of the elements isn't defined for any reason - if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { - return document.documentElement; - } - - // Here we make sure to give as "start" the element that comes first in the DOM - var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; - var start = order ? element1 : element2; - var end = order ? element2 : element1; - - // Get common ancestor container - var range = document.createRange(); - range.setStart(start, 0); - range.setEnd(end, 0); - var commonAncestorContainer = range.commonAncestorContainer; - - // Both nodes are inside #document - - if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { - if (isOffsetContainer(commonAncestorContainer)) { - return commonAncestorContainer; - } - - return getOffsetParent(commonAncestorContainer); - } - - // one of the nodes is inside shadowDOM, find which one - var element1root = getRoot(element1); - if (element1root.host) { - return findCommonOffsetParent(element1root.host, element2); - } else { - return findCommonOffsetParent(element1, getRoot(element2).host); - } -} - -/** - * Gets the scroll value of the given element in the given side (top and left) - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @argument {String} side `top` or `left` - * @returns {number} amount of scrolled pixels - */ -function getScroll(element) { - var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; - - var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; - var nodeName = element.nodeName; - - if (nodeName === 'BODY' || nodeName === 'HTML') { - var html = element.ownerDocument.documentElement; - var scrollingElement = element.ownerDocument.scrollingElement || html; - return scrollingElement[upperSide]; - } - - return element[upperSide]; -} - -/* - * Sum or subtract the element scroll values (left and top) from a given rect object - * @method - * @memberof Popper.Utils - * @param {Object} rect - Rect object you want to change - * @param {HTMLElement} element - The element from the function reads the scroll values - * @param {Boolean} subtract - set to true if you want to subtract the scroll values - * @return {Object} rect - The modifier rect object - */ -function includeScroll(rect, element) { - var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - var scrollTop = getScroll(element, 'top'); - var scrollLeft = getScroll(element, 'left'); - var modifier = subtract ? -1 : 1; - rect.top += scrollTop * modifier; - rect.bottom += scrollTop * modifier; - rect.left += scrollLeft * modifier; - rect.right += scrollLeft * modifier; - return rect; -} - -/* - * Helper to detect borders of a given element - * @method - * @memberof Popper.Utils - * @param {CSSStyleDeclaration} styles - * Result of `getStyleComputedProperty` on the given element - * @param {String} axis - `x` or `y` - * @return {number} borders - The borders size of the given axis - */ - -function getBordersSize(styles, axis) { - var sideA = axis === 'x' ? 'Left' : 'Top'; - var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; - - return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); -} - -function getSize(axis, body, html, computedStyle) { - return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0); -} - -function getWindowSizes() { - var body = document.body; - var html = document.documentElement; - var computedStyle = isIE(10) && getComputedStyle(html); - - return { - height: getSize('Height', body, html, computedStyle), - width: getSize('Width', body, html, computedStyle) - }; -} - -var classCallCheck = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -}; - -var createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); - - - - - -var defineProperty = function (obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -}; - -var _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; - -/** - * Given element offsets, generate an output similar to getBoundingClientRect - * @method - * @memberof Popper.Utils - * @argument {Object} offsets - * @returns {Object} ClientRect like output - */ -function getClientRect(offsets) { - return _extends({}, offsets, { - right: offsets.left + offsets.width, - bottom: offsets.top + offsets.height - }); -} - -/** - * Get bounding client rect of given element - * @method - * @memberof Popper.Utils - * @param {HTMLElement} element - * @return {Object} client rect - */ -function getBoundingClientRect(element) { - var rect = {}; - - // IE10 10 FIX: Please, don't ask, the element isn't - // considered in DOM in some circumstances... - // This isn't reproducible in IE10 compatibility mode of IE11 - try { - if (isIE(10)) { - rect = element.getBoundingClientRect(); - var scrollTop = getScroll(element, 'top'); - var scrollLeft = getScroll(element, 'left'); - rect.top += scrollTop; - rect.left += scrollLeft; - rect.bottom += scrollTop; - rect.right += scrollLeft; - } else { - rect = element.getBoundingClientRect(); - } - } catch (e) {} - - var result = { - left: rect.left, - top: rect.top, - width: rect.right - rect.left, - height: rect.bottom - rect.top - }; - - // subtract scrollbar size from sizes - var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {}; - var width = sizes.width || element.clientWidth || result.right - result.left; - var height = sizes.height || element.clientHeight || result.bottom - result.top; - - var horizScrollbar = element.offsetWidth - width; - var vertScrollbar = element.offsetHeight - height; - - // if an hypothetical scrollbar is detected, we must be sure it's not a `border` - // we make this check conditional for performance reasons - if (horizScrollbar || vertScrollbar) { - var styles = getStyleComputedProperty(element); - horizScrollbar -= getBordersSize(styles, 'x'); - vertScrollbar -= getBordersSize(styles, 'y'); - - result.width -= horizScrollbar; - result.height -= vertScrollbar; - } - - return getClientRect(result); -} - -function getOffsetRectRelativeToArbitraryNode(children, parent) { - var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - var isIE10 = isIE(10); - var isHTML = parent.nodeName === 'HTML'; - var childrenRect = getBoundingClientRect(children); - var parentRect = getBoundingClientRect(parent); - var scrollParent = getScrollParent(children); - - var styles = getStyleComputedProperty(parent); - var borderTopWidth = parseFloat(styles.borderTopWidth, 10); - var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); - - // In cases where the parent is fixed, we must ignore negative scroll in offset calc - if (fixedPosition && parent.nodeName === 'HTML') { - parentRect.top = Math.max(parentRect.top, 0); - parentRect.left = Math.max(parentRect.left, 0); - } - var offsets = getClientRect({ - top: childrenRect.top - parentRect.top - borderTopWidth, - left: childrenRect.left - parentRect.left - borderLeftWidth, - width: childrenRect.width, - height: childrenRect.height - }); - offsets.marginTop = 0; - offsets.marginLeft = 0; - - // Subtract margins of documentElement in case it's being used as parent - // we do this only on HTML because it's the only element that behaves - // differently when margins are applied to it. The margins are included in - // the box of the documentElement, in the other cases not. - if (!isIE10 && isHTML) { - var marginTop = parseFloat(styles.marginTop, 10); - var marginLeft = parseFloat(styles.marginLeft, 10); - - offsets.top -= borderTopWidth - marginTop; - offsets.bottom -= borderTopWidth - marginTop; - offsets.left -= borderLeftWidth - marginLeft; - offsets.right -= borderLeftWidth - marginLeft; - - // Attach marginTop and marginLeft because in some circumstances we may need them - offsets.marginTop = marginTop; - offsets.marginLeft = marginLeft; - } - - if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { - offsets = includeScroll(offsets, parent); - } - - return offsets; -} - -function getViewportOffsetRectRelativeToArtbitraryNode(element) { - var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - var html = element.ownerDocument.documentElement; - var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); - var width = Math.max(html.clientWidth, window.innerWidth || 0); - var height = Math.max(html.clientHeight, window.innerHeight || 0); - - var scrollTop = !excludeScroll ? getScroll(html) : 0; - var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; - - var offset = { - top: scrollTop - relativeOffset.top + relativeOffset.marginTop, - left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, - width: width, - height: height - }; - - return getClientRect(offset); -} - -/** - * Check if the given element is fixed or is inside a fixed parent - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @argument {Element} customContainer - * @returns {Boolean} answer to "isFixed?" - */ -function isFixed(element) { - var nodeName = element.nodeName; - if (nodeName === 'BODY' || nodeName === 'HTML') { - return false; - } - if (getStyleComputedProperty(element, 'position') === 'fixed') { - return true; - } - return isFixed(getParentNode(element)); -} - -/** - * Finds the first parent of an element that has a transformed property defined - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @returns {Element} first transformed parent or documentElement - */ - -function getFixedPositionOffsetParent(element) { - // This check is needed to avoid errors in case one of the elements isn't defined for any reason - if (!element || !element.parentElement || isIE()) { - return document.documentElement; - } - var el = element.parentElement; - while (el && getStyleComputedProperty(el, 'transform') === 'none') { - el = el.parentElement; - } - return el || document.documentElement; -} - -/** - * Computed the boundaries limits and return them - * @method - * @memberof Popper.Utils - * @param {HTMLElement} popper - * @param {HTMLElement} reference - * @param {number} padding - * @param {HTMLElement} boundariesElement - Element used to define the boundaries - * @param {Boolean} fixedPosition - Is in fixed position mode - * @returns {Object} Coordinates of the boundaries - */ -function getBoundaries(popper, reference, padding, boundariesElement) { - var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; - - // NOTE: 1 DOM access here - - var boundaries = { top: 0, left: 0 }; - var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); - - // Handle viewport case - if (boundariesElement === 'viewport') { - boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); - } else { - // Handle other cases based on DOM element used as boundaries - var boundariesNode = void 0; - if (boundariesElement === 'scrollParent') { - boundariesNode = getScrollParent(getParentNode(reference)); - if (boundariesNode.nodeName === 'BODY') { - boundariesNode = popper.ownerDocument.documentElement; - } - } else if (boundariesElement === 'window') { - boundariesNode = popper.ownerDocument.documentElement; - } else { - boundariesNode = boundariesElement; - } - - var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); - - // In case of HTML, we need a different computation - if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { - var _getWindowSizes = getWindowSizes(), - height = _getWindowSizes.height, - width = _getWindowSizes.width; - - boundaries.top += offsets.top - offsets.marginTop; - boundaries.bottom = height + offsets.top; - boundaries.left += offsets.left - offsets.marginLeft; - boundaries.right = width + offsets.left; - } else { - // for all the other DOM elements, this one is good - boundaries = offsets; - } - } - - // Add paddings - boundaries.left += padding; - boundaries.top += padding; - boundaries.right -= padding; - boundaries.bottom -= padding; - - return boundaries; -} - -function getArea(_ref) { - var width = _ref.width, - height = _ref.height; - - return width * height; -} - -/** - * Utility used to transform the `auto` placement to the placement with more - * available space. - * @method - * @memberof Popper.Utils - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { - var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; - - if (placement.indexOf('auto') === -1) { - return placement; - } - - var boundaries = getBoundaries(popper, reference, padding, boundariesElement); - - var rects = { - top: { - width: boundaries.width, - height: refRect.top - boundaries.top - }, - right: { - width: boundaries.right - refRect.right, - height: boundaries.height - }, - bottom: { - width: boundaries.width, - height: boundaries.bottom - refRect.bottom - }, - left: { - width: refRect.left - boundaries.left, - height: boundaries.height - } - }; - - var sortedAreas = Object.keys(rects).map(function (key) { - return _extends({ - key: key - }, rects[key], { - area: getArea(rects[key]) - }); - }).sort(function (a, b) { - return b.area - a.area; - }); - - var filteredAreas = sortedAreas.filter(function (_ref2) { - var width = _ref2.width, - height = _ref2.height; - return width >= popper.clientWidth && height >= popper.clientHeight; - }); - - var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; - - var variation = placement.split('-')[1]; - - return computedPlacement + (variation ? '-' + variation : ''); -} - -/** - * Get offsets to the reference element - * @method - * @memberof Popper.Utils - * @param {Object} state - * @param {Element} popper - the popper element - * @param {Element} reference - the reference element (the popper will be relative to this) - * @param {Element} fixedPosition - is in fixed position mode - * @returns {Object} An object containing the offsets which will be applied to the popper - */ -function getReferenceOffsets(state, popper, reference) { - var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; - - var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); - return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); -} - -/** - * Get the outer sizes of the given element (offset size + margins) - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @returns {Object} object containing width and height properties - */ -function getOuterSizes(element) { - var styles = getComputedStyle(element); - var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom); - var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight); - var result = { - width: element.offsetWidth + y, - height: element.offsetHeight + x - }; - return result; -} - -/** - * Get the opposite placement of the given one - * @method - * @memberof Popper.Utils - * @argument {String} placement - * @returns {String} flipped placement - */ -function getOppositePlacement(placement) { - var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; - return placement.replace(/left|right|bottom|top/g, function (matched) { - return hash[matched]; - }); -} - -/** - * Get offsets to the popper - * @method - * @memberof Popper.Utils - * @param {Object} position - CSS position the Popper will get applied - * @param {HTMLElement} popper - the popper element - * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) - * @param {String} placement - one of the valid placement options - * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper - */ -function getPopperOffsets(popper, referenceOffsets, placement) { - placement = placement.split('-')[0]; - - // Get popper node sizes - var popperRect = getOuterSizes(popper); - - // Add position, width and height to our offsets object - var popperOffsets = { - width: popperRect.width, - height: popperRect.height - }; - - // depending by the popper placement we have to compute its offsets slightly differently - var isHoriz = ['right', 'left'].indexOf(placement) !== -1; - var mainSide = isHoriz ? 'top' : 'left'; - var secondarySide = isHoriz ? 'left' : 'top'; - var measurement = isHoriz ? 'height' : 'width'; - var secondaryMeasurement = !isHoriz ? 'height' : 'width'; - - popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; - if (placement === secondarySide) { - popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; - } else { - popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; - } - - return popperOffsets; -} - -/** - * Mimics the `find` method of Array - * @method - * @memberof Popper.Utils - * @argument {Array} arr - * @argument prop - * @argument value - * @returns index or -1 - */ -function find(arr, check) { - // use native find if supported - if (Array.prototype.find) { - return arr.find(check); - } - - // use `filter` to obtain the same behavior of `find` - return arr.filter(check)[0]; -} - -/** - * Return the index of the matching object - * @method - * @memberof Popper.Utils - * @argument {Array} arr - * @argument prop - * @argument value - * @returns index or -1 - */ -function findIndex(arr, prop, value) { - // use native findIndex if supported - if (Array.prototype.findIndex) { - return arr.findIndex(function (cur) { - return cur[prop] === value; - }); - } - - // use `find` + `indexOf` if `findIndex` isn't supported - var match = find(arr, function (obj) { - return obj[prop] === value; - }); - return arr.indexOf(match); -} - -/** - * Loop trough the list of modifiers and run them in order, - * each of them will then edit the data object. - * @method - * @memberof Popper.Utils - * @param {dataObject} data - * @param {Array} modifiers - * @param {String} ends - Optional modifier name used as stopper - * @returns {dataObject} - */ -function runModifiers(modifiers, data, ends) { - var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); - - modifiersToRun.forEach(function (modifier) { - if (modifier['function']) { - // eslint-disable-line dot-notation - console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); - } - var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation - if (modifier.enabled && isFunction(fn)) { - // Add properties to offsets to make them a complete clientRect object - // we do this before each modifier to make sure the previous one doesn't - // mess with these values - data.offsets.popper = getClientRect(data.offsets.popper); - data.offsets.reference = getClientRect(data.offsets.reference); - - data = fn(data, modifier); - } - }); - - return data; -} - -/** - * Updates the position of the popper, computing the new offsets and applying - * the new style.
- * Prefer `scheduleUpdate` over `update` because of performance reasons. - * @method - * @memberof Popper - */ -function update() { - // if popper is destroyed, don't perform any further update - if (this.state.isDestroyed) { - return; - } - - var data = { - instance: this, - styles: {}, - arrowStyles: {}, - attributes: {}, - flipped: false, - offsets: {} - }; - - // compute reference element offsets - data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); - - // compute auto placement, store placement inside the data object, - // modifiers will be able to edit `placement` if needed - // and refer to originalPlacement to know the original value - data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); - - // store the computed placement inside `originalPlacement` - data.originalPlacement = data.placement; - - data.positionFixed = this.options.positionFixed; - - // compute the popper offsets - data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); - data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; - - // run the modifiers - data = runModifiers(this.modifiers, data); - - // the first `update` will call `onCreate` callback - // the other ones will call `onUpdate` callback - if (!this.state.isCreated) { - this.state.isCreated = true; - this.options.onCreate(data); - } else { - this.options.onUpdate(data); - } -} - -/** - * Helper used to know if the given modifier is enabled. - * @method - * @memberof Popper.Utils - * @returns {Boolean} - */ -function isModifierEnabled(modifiers, modifierName) { - return modifiers.some(function (_ref) { - var name = _ref.name, - enabled = _ref.enabled; - return enabled && name === modifierName; - }); -} - -/** - * Get the prefixed supported property name - * @method - * @memberof Popper.Utils - * @argument {String} property (camelCase) - * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) - */ -function getSupportedPropertyName(property) { - var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; - var upperProp = property.charAt(0).toUpperCase() + property.slice(1); - - for (var i = 0; i < prefixes.length; i++) { - var prefix = prefixes[i]; - var toCheck = prefix ? '' + prefix + upperProp : property; - if (typeof document.body.style[toCheck] !== 'undefined') { - return toCheck; - } - } - return null; -} - -/** - * Destroy the popper - * @method - * @memberof Popper - */ -function destroy() { - this.state.isDestroyed = true; - - // touch DOM only if `applyStyle` modifier is enabled - if (isModifierEnabled(this.modifiers, 'applyStyle')) { - this.popper.removeAttribute('x-placement'); - this.popper.style.position = ''; - this.popper.style.top = ''; - this.popper.style.left = ''; - this.popper.style.right = ''; - this.popper.style.bottom = ''; - this.popper.style.willChange = ''; - this.popper.style[getSupportedPropertyName('transform')] = ''; - } - - this.disableEventListeners(); - - // remove the popper if user explicity asked for the deletion on destroy - // do not use `remove` because IE11 doesn't support it - if (this.options.removeOnDestroy) { - this.popper.parentNode.removeChild(this.popper); - } - return this; -} - -/** - * Get the window associated with the element - * @argument {Element} element - * @returns {Window} - */ -function getWindow(element) { - var ownerDocument = element.ownerDocument; - return ownerDocument ? ownerDocument.defaultView : window; -} - -function attachToScrollParents(scrollParent, event, callback, scrollParents) { - var isBody = scrollParent.nodeName === 'BODY'; - var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; - target.addEventListener(event, callback, { passive: true }); - - if (!isBody) { - attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); - } - scrollParents.push(target); -} - -/** - * Setup needed event listeners used to update the popper position - * @method - * @memberof Popper.Utils - * @private - */ -function setupEventListeners(reference, options, state, updateBound) { - // Resize event listener on window - state.updateBound = updateBound; - getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); - - // Scroll event listener on scroll parents - var scrollElement = getScrollParent(reference); - attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); - state.scrollElement = scrollElement; - state.eventsEnabled = true; - - return state; -} - -/** - * It will add resize/scroll events and start recalculating - * position of the popper element when they are triggered. - * @method - * @memberof Popper - */ -function enableEventListeners() { - if (!this.state.eventsEnabled) { - this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); - } -} - -/** - * Remove event listeners used to update the popper position - * @method - * @memberof Popper.Utils - * @private - */ -function removeEventListeners(reference, state) { - // Remove resize event listener on window - getWindow(reference).removeEventListener('resize', state.updateBound); - - // Remove scroll event listener on scroll parents - state.scrollParents.forEach(function (target) { - target.removeEventListener('scroll', state.updateBound); - }); - - // Reset state - state.updateBound = null; - state.scrollParents = []; - state.scrollElement = null; - state.eventsEnabled = false; - return state; -} - -/** - * It will remove resize/scroll events and won't recalculate popper position - * when they are triggered. It also won't trigger onUpdate callback anymore, - * unless you call `update` method manually. - * @method - * @memberof Popper - */ -function disableEventListeners() { - if (this.state.eventsEnabled) { - cancelAnimationFrame(this.scheduleUpdate); - this.state = removeEventListeners(this.reference, this.state); - } -} - -/** - * Tells if a given input is a number - * @method - * @memberof Popper.Utils - * @param {*} input to check - * @return {Boolean} - */ -function isNumeric(n) { - return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); -} - -/** - * Set the style to the given popper - * @method - * @memberof Popper.Utils - * @argument {Element} element - Element to apply the style to - * @argument {Object} styles - * Object with a list of properties and values which will be applied to the element - */ -function setStyles(element, styles) { - Object.keys(styles).forEach(function (prop) { - var unit = ''; - // add unit if the value is numeric and is one of the following - if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { - unit = 'px'; - } - element.style[prop] = styles[prop] + unit; - }); -} - -/** - * Set the attributes to the given popper - * @method - * @memberof Popper.Utils - * @argument {Element} element - Element to apply the attributes to - * @argument {Object} styles - * Object with a list of properties and values which will be applied to the element - */ -function setAttributes(element, attributes) { - Object.keys(attributes).forEach(function (prop) { - var value = attributes[prop]; - if (value !== false) { - element.setAttribute(prop, attributes[prop]); - } else { - element.removeAttribute(prop); - } - }); -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by `update` method - * @argument {Object} data.styles - List of style properties - values to apply to popper element - * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The same data object - */ -function applyStyle(data) { - // any property present in `data.styles` will be applied to the popper, - // in this way we can make the 3rd party modifiers add custom styles to it - // Be aware, modifiers could override the properties defined in the previous - // lines of this modifier! - setStyles(data.instance.popper, data.styles); - - // any property present in `data.attributes` will be applied to the popper, - // they will be set as HTML attributes of the element - setAttributes(data.instance.popper, data.attributes); - - // if arrowElement is defined and arrowStyles has some properties - if (data.arrowElement && Object.keys(data.arrowStyles).length) { - setStyles(data.arrowElement, data.arrowStyles); - } - - return data; -} - -/** - * Set the x-placement attribute before everything else because it could be used - * to add margins to the popper margins needs to be calculated to get the - * correct popper offsets. - * @method - * @memberof Popper.modifiers - * @param {HTMLElement} reference - The reference element used to position the popper - * @param {HTMLElement} popper - The HTML element used as popper - * @param {Object} options - Popper.js options - */ -function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { - // compute reference element offsets - var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); - - // compute auto placement, store placement inside the data object, - // modifiers will be able to edit `placement` if needed - // and refer to originalPlacement to know the original value - var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); - - popper.setAttribute('x-placement', placement); - - // Apply `position` to popper before anything else because - // without the position applied we can't guarantee correct computations - setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); - - return options; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by `update` method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function computeStyle(data, options) { - var x = options.x, - y = options.y; - var popper = data.offsets.popper; - - // Remove this legacy support in Popper.js v2 - - var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { - return modifier.name === 'applyStyle'; - }).gpuAcceleration; - if (legacyGpuAccelerationOption !== undefined) { - console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); - } - var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; - - var offsetParent = getOffsetParent(data.instance.popper); - var offsetParentRect = getBoundingClientRect(offsetParent); - - // Styles - var styles = { - position: popper.position - }; - - // floor sides to avoid blurry text - var offsets = { - left: Math.floor(popper.left), - top: Math.floor(popper.top), - bottom: Math.floor(popper.bottom), - right: Math.floor(popper.right) - }; - - var sideA = x === 'bottom' ? 'top' : 'bottom'; - var sideB = y === 'right' ? 'left' : 'right'; - - // if gpuAcceleration is set to `true` and transform is supported, - // we use `translate3d` to apply the position to the popper we - // automatically use the supported prefixed version if needed - var prefixedProperty = getSupportedPropertyName('transform'); - - // now, let's make a step back and look at this code closely (wtf?) - // If the content of the popper grows once it's been positioned, it - // may happen that the popper gets misplaced because of the new content - // overflowing its reference element - // To avoid this problem, we provide two options (x and y), which allow - // the consumer to define the offset origin. - // If we position a popper on top of a reference element, we can set - // `x` to `top` to make the popper grow towards its top instead of - // its bottom. - var left = void 0, - top = void 0; - if (sideA === 'bottom') { - top = -offsetParentRect.height + offsets.bottom; - } else { - top = offsets.top; - } - if (sideB === 'right') { - left = -offsetParentRect.width + offsets.right; - } else { - left = offsets.left; - } - if (gpuAcceleration && prefixedProperty) { - styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; - styles[sideA] = 0; - styles[sideB] = 0; - styles.willChange = 'transform'; - } else { - // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties - var invertTop = sideA === 'bottom' ? -1 : 1; - var invertLeft = sideB === 'right' ? -1 : 1; - styles[sideA] = top * invertTop; - styles[sideB] = left * invertLeft; - styles.willChange = sideA + ', ' + sideB; - } - - // Attributes - var attributes = { - 'x-placement': data.placement - }; - - // Update `data` attributes, styles and arrowStyles - data.attributes = _extends({}, attributes, data.attributes); - data.styles = _extends({}, styles, data.styles); - data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); - - return data; -} - -/** - * Helper used to know if the given modifier depends from another one.
- * It checks if the needed modifier is listed and enabled. - * @method - * @memberof Popper.Utils - * @param {Array} modifiers - list of modifiers - * @param {String} requestingName - name of requesting modifier - * @param {String} requestedName - name of requested modifier - * @returns {Boolean} - */ -function isModifierRequired(modifiers, requestingName, requestedName) { - var requesting = find(modifiers, function (_ref) { - var name = _ref.name; - return name === requestingName; - }); - - var isRequired = !!requesting && modifiers.some(function (modifier) { - return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; - }); - - if (!isRequired) { - var _requesting = '`' + requestingName + '`'; - var requested = '`' + requestedName + '`'; - console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); - } - return isRequired; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function arrow(data, options) { - var _data$offsets$arrow; - - // arrow depends on keepTogether in order to work - if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { - return data; - } - - var arrowElement = options.element; - - // if arrowElement is a string, suppose it's a CSS selector - if (typeof arrowElement === 'string') { - arrowElement = data.instance.popper.querySelector(arrowElement); - - // if arrowElement is not found, don't run the modifier - if (!arrowElement) { - return data; - } - } else { - // if the arrowElement isn't a query selector we must check that the - // provided DOM node is child of its popper node - if (!data.instance.popper.contains(arrowElement)) { - console.warn('WARNING: `arrow.element` must be child of its popper element!'); - return data; - } - } - - var placement = data.placement.split('-')[0]; - var _data$offsets = data.offsets, - popper = _data$offsets.popper, - reference = _data$offsets.reference; - - var isVertical = ['left', 'right'].indexOf(placement) !== -1; - - var len = isVertical ? 'height' : 'width'; - var sideCapitalized = isVertical ? 'Top' : 'Left'; - var side = sideCapitalized.toLowerCase(); - var altSide = isVertical ? 'left' : 'top'; - var opSide = isVertical ? 'bottom' : 'right'; - var arrowElementSize = getOuterSizes(arrowElement)[len]; - - // - // extends keepTogether behavior making sure the popper and its - // reference have enough pixels in conjuction - // - - // top/left side - if (reference[opSide] - arrowElementSize < popper[side]) { - data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); - } - // bottom/right side - if (reference[side] + arrowElementSize > popper[opSide]) { - data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; - } - data.offsets.popper = getClientRect(data.offsets.popper); - - // compute center of the popper - var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; - - // Compute the sideValue using the updated popper offsets - // take popper margin in account because we don't have this info available - var css = getStyleComputedProperty(data.instance.popper); - var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10); - var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10); - var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; - - // prevent arrowElement from being placed not contiguously to its popper - sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); - - data.arrowElement = arrowElement; - data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); - - return data; -} - -/** - * Get the opposite placement variation of the given one - * @method - * @memberof Popper.Utils - * @argument {String} placement variation - * @returns {String} flipped placement variation - */ -function getOppositeVariation(variation) { - if (variation === 'end') { - return 'start'; - } else if (variation === 'start') { - return 'end'; - } - return variation; -} - -/** - * List of accepted placements to use as values of the `placement` option.
- * Valid placements are: - * - `auto` - * - `top` - * - `right` - * - `bottom` - * - `left` - * - * Each placement can have a variation from this list: - * - `-start` - * - `-end` - * - * Variations are interpreted easily if you think of them as the left to right - * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` - * is right.
- * Vertically (`left` and `right`), `start` is top and `end` is bottom. - * - * Some valid examples are: - * - `top-end` (on top of reference, right aligned) - * - `right-start` (on right of reference, top aligned) - * - `bottom` (on bottom, centered) - * - `auto-right` (on the side with more space available, alignment depends by placement) - * - * @static - * @type {Array} - * @enum {String} - * @readonly - * @method placements - * @memberof Popper - */ -var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; - -// Get rid of `auto` `auto-start` and `auto-end` -var validPlacements = placements.slice(3); - -/** - * Given an initial placement, returns all the subsequent placements - * clockwise (or counter-clockwise). - * - * @method - * @memberof Popper.Utils - * @argument {String} placement - A valid placement (it accepts variations) - * @argument {Boolean} counter - Set to true to walk the placements counterclockwise - * @returns {Array} placements including their variations - */ -function clockwise(placement) { - var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - var index = validPlacements.indexOf(placement); - var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); - return counter ? arr.reverse() : arr; -} - -var BEHAVIORS = { - FLIP: 'flip', - CLOCKWISE: 'clockwise', - COUNTERCLOCKWISE: 'counterclockwise' -}; - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function flip(data, options) { - // if `inner` modifier is enabled, we can't use the `flip` modifier - if (isModifierEnabled(data.instance.modifiers, 'inner')) { - return data; - } - - if (data.flipped && data.placement === data.originalPlacement) { - // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides - return data; - } - - var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); - - var placement = data.placement.split('-')[0]; - var placementOpposite = getOppositePlacement(placement); - var variation = data.placement.split('-')[1] || ''; - - var flipOrder = []; - - switch (options.behavior) { - case BEHAVIORS.FLIP: - flipOrder = [placement, placementOpposite]; - break; - case BEHAVIORS.CLOCKWISE: - flipOrder = clockwise(placement); - break; - case BEHAVIORS.COUNTERCLOCKWISE: - flipOrder = clockwise(placement, true); - break; - default: - flipOrder = options.behavior; - } - - flipOrder.forEach(function (step, index) { - if (placement !== step || flipOrder.length === index + 1) { - return data; - } - - placement = data.placement.split('-')[0]; - placementOpposite = getOppositePlacement(placement); - - var popperOffsets = data.offsets.popper; - var refOffsets = data.offsets.reference; - - // using floor because the reference offsets may contain decimals we are not going to consider here - var floor = Math.floor; - var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); - - var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); - var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); - var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); - var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); - - var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; - - // flip the variation if required - var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; - var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); - - if (overlapsRef || overflowsBoundaries || flippedVariation) { - // this boolean to detect any flip loop - data.flipped = true; - - if (overlapsRef || overflowsBoundaries) { - placement = flipOrder[index + 1]; - } - - if (flippedVariation) { - variation = getOppositeVariation(variation); - } - - data.placement = placement + (variation ? '-' + variation : ''); - - // this object contains `position`, we want to preserve it along with - // any additional property we may add in the future - data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); - - data = runModifiers(data.instance.modifiers, data, 'flip'); - } - }); - return data; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function keepTogether(data) { - var _data$offsets = data.offsets, - popper = _data$offsets.popper, - reference = _data$offsets.reference; - - var placement = data.placement.split('-')[0]; - var floor = Math.floor; - var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; - var side = isVertical ? 'right' : 'bottom'; - var opSide = isVertical ? 'left' : 'top'; - var measurement = isVertical ? 'width' : 'height'; - - if (popper[side] < floor(reference[opSide])) { - data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; - } - if (popper[opSide] > floor(reference[side])) { - data.offsets.popper[opSide] = floor(reference[side]); - } - - return data; -} - -/** - * Converts a string containing value + unit into a px value number - * @function - * @memberof {modifiers~offset} - * @private - * @argument {String} str - Value + unit string - * @argument {String} measurement - `height` or `width` - * @argument {Object} popperOffsets - * @argument {Object} referenceOffsets - * @returns {Number|String} - * Value in pixels, or original string if no values were extracted - */ -function toValue(str, measurement, popperOffsets, referenceOffsets) { - // separate value from unit - var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); - var value = +split[1]; - var unit = split[2]; - - // If it's not a number it's an operator, I guess - if (!value) { - return str; - } - - if (unit.indexOf('%') === 0) { - var element = void 0; - switch (unit) { - case '%p': - element = popperOffsets; - break; - case '%': - case '%r': - default: - element = referenceOffsets; - } - - var rect = getClientRect(element); - return rect[measurement] / 100 * value; - } else if (unit === 'vh' || unit === 'vw') { - // if is a vh or vw, we calculate the size based on the viewport - var size = void 0; - if (unit === 'vh') { - size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); - } else { - size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); - } - return size / 100 * value; - } else { - // if is an explicit pixel unit, we get rid of the unit and keep the value - // if is an implicit unit, it's px, and we return just the value - return value; - } -} - -/** - * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. - * @function - * @memberof {modifiers~offset} - * @private - * @argument {String} offset - * @argument {Object} popperOffsets - * @argument {Object} referenceOffsets - * @argument {String} basePlacement - * @returns {Array} a two cells array with x and y offsets in numbers - */ -function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { - var offsets = [0, 0]; - - // Use height if placement is left or right and index is 0 otherwise use width - // in this way the first offset will use an axis and the second one - // will use the other one - var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; - - // Split the offset string to obtain a list of values and operands - // The regex addresses values with the plus or minus sign in front (+10, -20, etc) - var fragments = offset.split(/(\+|\-)/).map(function (frag) { - return frag.trim(); - }); - - // Detect if the offset string contains a pair of values or a single one - // they could be separated by comma or space - var divider = fragments.indexOf(find(fragments, function (frag) { - return frag.search(/,|\s/) !== -1; - })); - - if (fragments[divider] && fragments[divider].indexOf(',') === -1) { - console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); - } - - // If divider is found, we divide the list of values and operands to divide - // them by ofset X and Y. - var splitRegex = /\s*,\s*|\s+/; - var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; - - // Convert the values with units to absolute pixels to allow our computations - ops = ops.map(function (op, index) { - // Most of the units rely on the orientation of the popper - var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; - var mergeWithPrevious = false; - return op - // This aggregates any `+` or `-` sign that aren't considered operators - // e.g.: 10 + +5 => [10, +, +5] - .reduce(function (a, b) { - if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { - a[a.length - 1] = b; - mergeWithPrevious = true; - return a; - } else if (mergeWithPrevious) { - a[a.length - 1] += b; - mergeWithPrevious = false; - return a; - } else { - return a.concat(b); - } - }, []) - // Here we convert the string values into number values (in px) - .map(function (str) { - return toValue(str, measurement, popperOffsets, referenceOffsets); - }); - }); - - // Loop trough the offsets arrays and execute the operations - ops.forEach(function (op, index) { - op.forEach(function (frag, index2) { - if (isNumeric(frag)) { - offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); - } - }); - }); - return offsets; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @argument {Number|String} options.offset=0 - * The offset value as described in the modifier description - * @returns {Object} The data object, properly modified - */ -function offset(data, _ref) { - var offset = _ref.offset; - var placement = data.placement, - _data$offsets = data.offsets, - popper = _data$offsets.popper, - reference = _data$offsets.reference; - - var basePlacement = placement.split('-')[0]; - - var offsets = void 0; - if (isNumeric(+offset)) { - offsets = [+offset, 0]; - } else { - offsets = parseOffset(offset, popper, reference, basePlacement); - } - - if (basePlacement === 'left') { - popper.top += offsets[0]; - popper.left -= offsets[1]; - } else if (basePlacement === 'right') { - popper.top += offsets[0]; - popper.left += offsets[1]; - } else if (basePlacement === 'top') { - popper.left += offsets[0]; - popper.top -= offsets[1]; - } else if (basePlacement === 'bottom') { - popper.left += offsets[0]; - popper.top += offsets[1]; - } - - data.popper = popper; - return data; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by `update` method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function preventOverflow(data, options) { - var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); - - // If offsetParent is the reference element, we really want to - // go one step up and use the next offsetParent as reference to - // avoid to make this modifier completely useless and look like broken - if (data.instance.reference === boundariesElement) { - boundariesElement = getOffsetParent(boundariesElement); - } - - var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); - options.boundaries = boundaries; - - var order = options.priority; - var popper = data.offsets.popper; - - var check = { - primary: function primary(placement) { - var value = popper[placement]; - if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { - value = Math.max(popper[placement], boundaries[placement]); - } - return defineProperty({}, placement, value); - }, - secondary: function secondary(placement) { - var mainSide = placement === 'right' ? 'left' : 'top'; - var value = popper[mainSide]; - if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { - value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); - } - return defineProperty({}, mainSide, value); - } - }; - - order.forEach(function (placement) { - var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; - popper = _extends({}, popper, check[side](placement)); - }); - - data.offsets.popper = popper; - - return data; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by `update` method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function shift(data) { - var placement = data.placement; - var basePlacement = placement.split('-')[0]; - var shiftvariation = placement.split('-')[1]; - - // if shift shiftvariation is specified, run the modifier - if (shiftvariation) { - var _data$offsets = data.offsets, - reference = _data$offsets.reference, - popper = _data$offsets.popper; - - var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; - var side = isVertical ? 'left' : 'top'; - var measurement = isVertical ? 'width' : 'height'; - - var shiftOffsets = { - start: defineProperty({}, side, reference[side]), - end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) - }; - - data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); - } - - return data; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function hide(data) { - if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { - return data; - } - - var refRect = data.offsets.reference; - var bound = find(data.instance.modifiers, function (modifier) { - return modifier.name === 'preventOverflow'; - }).boundaries; - - if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { - // Avoid unnecessary DOM access if visibility hasn't changed - if (data.hide === true) { - return data; - } - - data.hide = true; - data.attributes['x-out-of-boundaries'] = ''; - } else { - // Avoid unnecessary DOM access if visibility hasn't changed - if (data.hide === false) { - return data; - } - - data.hide = false; - data.attributes['x-out-of-boundaries'] = false; - } - - return data; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by `update` method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function inner(data) { - var placement = data.placement; - var basePlacement = placement.split('-')[0]; - var _data$offsets = data.offsets, - popper = _data$offsets.popper, - reference = _data$offsets.reference; - - var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; - - var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; - - popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); - - data.placement = getOppositePlacement(placement); - data.offsets.popper = getClientRect(popper); - - return data; -} - -/** - * Modifier function, each modifier can have a function of this type assigned - * to its `fn` property.
- * These functions will be called on each update, this means that you must - * make sure they are performant enough to avoid performance bottlenecks. - * - * @function ModifierFn - * @argument {dataObject} data - The data object generated by `update` method - * @argument {Object} options - Modifiers configuration and options - * @returns {dataObject} The data object, properly modified - */ - -/** - * Modifiers are plugins used to alter the behavior of your poppers.
- * Popper.js uses a set of 9 modifiers to provide all the basic functionalities - * needed by the library. - * - * Usually you don't want to override the `order`, `fn` and `onLoad` props. - * All the other properties are configurations that could be tweaked. - * @namespace modifiers - */ -var modifiers = { - /** - * Modifier used to shift the popper on the start or end of its reference - * element.
- * It will read the variation of the `placement` property.
- * It can be one either `-end` or `-start`. - * @memberof modifiers - * @inner - */ - shift: { - /** @prop {number} order=100 - Index used to define the order of execution */ - order: 100, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: shift - }, - - /** - * The `offset` modifier can shift your popper on both its axis. - * - * It accepts the following units: - * - `px` or unitless, interpreted as pixels - * - `%` or `%r`, percentage relative to the length of the reference element - * - `%p`, percentage relative to the length of the popper element - * - `vw`, CSS viewport width unit - * - `vh`, CSS viewport height unit - * - * For length is intended the main axis relative to the placement of the popper.
- * This means that if the placement is `top` or `bottom`, the length will be the - * `width`. In case of `left` or `right`, it will be the height. - * - * You can provide a single value (as `Number` or `String`), or a pair of values - * as `String` divided by a comma or one (or more) white spaces.
- * The latter is a deprecated method because it leads to confusion and will be - * removed in v2.
- * Additionally, it accepts additions and subtractions between different units. - * Note that multiplications and divisions aren't supported. - * - * Valid examples are: - * ``` - * 10 - * '10%' - * '10, 10' - * '10%, 10' - * '10 + 10%' - * '10 - 5vh + 3%' - * '-10px + 5vh, 5px - 6%' - * ``` - * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap - * > with their reference element, unfortunately, you will have to disable the `flip` modifier. - * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373) - * - * @memberof modifiers - * @inner - */ - offset: { - /** @prop {number} order=200 - Index used to define the order of execution */ - order: 200, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: offset, - /** @prop {Number|String} offset=0 - * The offset value as described in the modifier description - */ - offset: 0 - }, - - /** - * Modifier used to prevent the popper from being positioned outside the boundary. - * - * An scenario exists where the reference itself is not within the boundaries.
- * We can say it has "escaped the boundaries" — or just "escaped".
- * In this case we need to decide whether the popper should either: - * - * - detach from the reference and remain "trapped" in the boundaries, or - * - if it should ignore the boundary and "escape with its reference" - * - * When `escapeWithReference` is set to`true` and reference is completely - * outside its boundaries, the popper will overflow (or completely leave) - * the boundaries in order to remain attached to the edge of the reference. - * - * @memberof modifiers - * @inner - */ - preventOverflow: { - /** @prop {number} order=300 - Index used to define the order of execution */ - order: 300, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: preventOverflow, - /** - * @prop {Array} [priority=['left','right','top','bottom']] - * Popper will try to prevent overflow following these priorities by default, - * then, it could overflow on the left and on top of the `boundariesElement` - */ - priority: ['left', 'right', 'top', 'bottom'], - /** - * @prop {number} padding=5 - * Amount of pixel used to define a minimum distance between the boundaries - * and the popper this makes sure the popper has always a little padding - * between the edges of its container - */ - padding: 5, - /** - * @prop {String|HTMLElement} boundariesElement='scrollParent' - * Boundaries used by the modifier, can be `scrollParent`, `window`, - * `viewport` or any DOM element. - */ - boundariesElement: 'scrollParent' - }, - - /** - * Modifier used to make sure the reference and its popper stay near eachothers - * without leaving any gap between the two. Expecially useful when the arrow is - * enabled and you want to assure it to point to its reference element. - * It cares only about the first axis, you can still have poppers with margin - * between the popper and its reference element. - * @memberof modifiers - * @inner - */ - keepTogether: { - /** @prop {number} order=400 - Index used to define the order of execution */ - order: 400, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: keepTogether - }, - - /** - * This modifier is used to move the `arrowElement` of the popper to make - * sure it is positioned between the reference element and its popper element. - * It will read the outer size of the `arrowElement` node to detect how many - * pixels of conjuction are needed. - * - * It has no effect if no `arrowElement` is provided. - * @memberof modifiers - * @inner - */ - arrow: { - /** @prop {number} order=500 - Index used to define the order of execution */ - order: 500, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: arrow, - /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ - element: '[x-arrow]' - }, - - /** - * Modifier used to flip the popper's placement when it starts to overlap its - * reference element. - * - * Requires the `preventOverflow` modifier before it in order to work. - * - * **NOTE:** this modifier will interrupt the current update cycle and will - * restart it if it detects the need to flip the placement. - * @memberof modifiers - * @inner - */ - flip: { - /** @prop {number} order=600 - Index used to define the order of execution */ - order: 600, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: flip, - /** - * @prop {String|Array} behavior='flip' - * The behavior used to change the popper's placement. It can be one of - * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid - * placements (with optional variations). - */ - behavior: 'flip', - /** - * @prop {number} padding=5 - * The popper will flip if it hits the edges of the `boundariesElement` - */ - padding: 5, - /** - * @prop {String|HTMLElement} boundariesElement='viewport' - * The element which will define the boundaries of the popper position, - * the popper will never be placed outside of the defined boundaries - * (except if keepTogether is enabled) - */ - boundariesElement: 'viewport' - }, - - /** - * Modifier used to make the popper flow toward the inner of the reference element. - * By default, when this modifier is disabled, the popper will be placed outside - * the reference element. - * @memberof modifiers - * @inner - */ - inner: { - /** @prop {number} order=700 - Index used to define the order of execution */ - order: 700, - /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ - enabled: false, - /** @prop {ModifierFn} */ - fn: inner - }, - - /** - * Modifier used to hide the popper when its reference element is outside of the - * popper boundaries. It will set a `x-out-of-boundaries` attribute which can - * be used to hide with a CSS selector the popper when its reference is - * out of boundaries. - * - * Requires the `preventOverflow` modifier before it in order to work. - * @memberof modifiers - * @inner - */ - hide: { - /** @prop {number} order=800 - Index used to define the order of execution */ - order: 800, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: hide - }, - - /** - * Computes the style that will be applied to the popper element to gets - * properly positioned. - * - * Note that this modifier will not touch the DOM, it just prepares the styles - * so that `applyStyle` modifier can apply it. This separation is useful - * in case you need to replace `applyStyle` with a custom implementation. - * - * This modifier has `850` as `order` value to maintain backward compatibility - * with previous versions of Popper.js. Expect the modifiers ordering method - * to change in future major versions of the library. - * - * @memberof modifiers - * @inner - */ - computeStyle: { - /** @prop {number} order=850 - Index used to define the order of execution */ - order: 850, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: computeStyle, - /** - * @prop {Boolean} gpuAcceleration=true - * If true, it uses the CSS 3d transformation to position the popper. - * Otherwise, it will use the `top` and `left` properties. - */ - gpuAcceleration: true, - /** - * @prop {string} [x='bottom'] - * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. - * Change this if your popper should grow in a direction different from `bottom` - */ - x: 'bottom', - /** - * @prop {string} [x='left'] - * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. - * Change this if your popper should grow in a direction different from `right` - */ - y: 'right' - }, - - /** - * Applies the computed styles to the popper element. - * - * All the DOM manipulations are limited to this modifier. This is useful in case - * you want to integrate Popper.js inside a framework or view library and you - * want to delegate all the DOM manipulations to it. - * - * Note that if you disable this modifier, you must make sure the popper element - * has its position set to `absolute` before Popper.js can do its work! - * - * Just disable this modifier and define you own to achieve the desired effect. - * - * @memberof modifiers - * @inner - */ - applyStyle: { - /** @prop {number} order=900 - Index used to define the order of execution */ - order: 900, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: applyStyle, - /** @prop {Function} */ - onLoad: applyStyleOnLoad, - /** - * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier - * @prop {Boolean} gpuAcceleration=true - * If true, it uses the CSS 3d transformation to position the popper. - * Otherwise, it will use the `top` and `left` properties. - */ - gpuAcceleration: undefined - } -}; - -/** - * The `dataObject` is an object containing all the informations used by Popper.js - * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks. - * @name dataObject - * @property {Object} data.instance The Popper.js instance - * @property {String} data.placement Placement applied to popper - * @property {String} data.originalPlacement Placement originally defined on init - * @property {Boolean} data.flipped True if popper has been flipped by flip modifier - * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper. - * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier - * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`) - * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`) - * @property {Object} data.boundaries Offsets of the popper boundaries - * @property {Object} data.offsets The measurements of popper, reference and arrow elements. - * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values - * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values - * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 - */ - -/** - * Default options provided to Popper.js constructor.
- * These can be overriden using the `options` argument of Popper.js.
- * To override an option, simply pass as 3rd argument an object with the same - * structure of this object, example: - * ``` - * new Popper(ref, pop, { - * modifiers: { - * preventOverflow: { enabled: false } - * } - * }) - * ``` - * @type {Object} - * @static - * @memberof Popper - */ -var Defaults = { - /** - * Popper's placement - * @prop {Popper.placements} placement='bottom' - */ - placement: 'bottom', - - /** - * Set this to true if you want popper to position it self in 'fixed' mode - * @prop {Boolean} positionFixed=false - */ - positionFixed: false, - - /** - * Whether events (resize, scroll) are initially enabled - * @prop {Boolean} eventsEnabled=true - */ - eventsEnabled: true, - - /** - * Set to true if you want to automatically remove the popper when - * you call the `destroy` method. - * @prop {Boolean} removeOnDestroy=false - */ - removeOnDestroy: false, - - /** - * Callback called when the popper is created.
- * By default, is set to no-op.
- * Access Popper.js instance with `data.instance`. - * @prop {onCreate} - */ - onCreate: function onCreate() {}, - - /** - * Callback called when the popper is updated, this callback is not called - * on the initialization/creation of the popper, but only on subsequent - * updates.
- * By default, is set to no-op.
- * Access Popper.js instance with `data.instance`. - * @prop {onUpdate} - */ - onUpdate: function onUpdate() {}, - - /** - * List of modifiers used to modify the offsets before they are applied to the popper. - * They provide most of the functionalities of Popper.js - * @prop {modifiers} - */ - modifiers: modifiers -}; - -/** - * @callback onCreate - * @param {dataObject} data - */ - -/** - * @callback onUpdate - * @param {dataObject} data - */ - -// Utils -// Methods -var Popper = function () { - /** - * Create a new Popper.js instance - * @class Popper - * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper - * @param {HTMLElement} popper - The HTML element used as popper. - * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) - * @return {Object} instance - The generated Popper.js instance - */ - function Popper(reference, popper) { - var _this = this; - - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - classCallCheck(this, Popper); - - this.scheduleUpdate = function () { - return requestAnimationFrame(_this.update); - }; - - // make update() debounced, so that it only runs at most once-per-tick - this.update = debounce(this.update.bind(this)); - - // with {} we create a new object with the options inside it - this.options = _extends({}, Popper.Defaults, options); - - // init state - this.state = { - isDestroyed: false, - isCreated: false, - scrollParents: [] - }; - - // get reference and popper elements (allow jQuery wrappers) - this.reference = reference && reference.jquery ? reference[0] : reference; - this.popper = popper && popper.jquery ? popper[0] : popper; - - // Deep merge modifiers options - this.options.modifiers = {}; - Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { - _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); - }); - - // Refactoring modifiers' list (Object => Array) - this.modifiers = Object.keys(this.options.modifiers).map(function (name) { - return _extends({ - name: name - }, _this.options.modifiers[name]); - }) - // sort the modifiers by order - .sort(function (a, b) { - return a.order - b.order; - }); - - // modifiers have the ability to execute arbitrary code when Popper.js get inited - // such code is executed in the same order of its modifier - // they could add new properties to their options configuration - // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! - this.modifiers.forEach(function (modifierOptions) { - if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { - modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); - } - }); - - // fire the first update to position the popper in the right place - this.update(); - - var eventsEnabled = this.options.eventsEnabled; - if (eventsEnabled) { - // setup event listeners, they will take care of update the position in specific situations - this.enableEventListeners(); - } - - this.state.eventsEnabled = eventsEnabled; - } - - // We can't use class properties because they don't get listed in the - // class prototype and break stuff like Sinon stubs - - - createClass(Popper, [{ - key: 'update', - value: function update$$1() { - return update.call(this); - } - }, { - key: 'destroy', - value: function destroy$$1() { - return destroy.call(this); - } - }, { - key: 'enableEventListeners', - value: function enableEventListeners$$1() { - return enableEventListeners.call(this); - } - }, { - key: 'disableEventListeners', - value: function disableEventListeners$$1() { - return disableEventListeners.call(this); - } - - /** - * Schedule an update, it will run on the next UI update available - * @method scheduleUpdate - * @memberof Popper - */ - - - /** - * Collection of utilities useful when writing custom modifiers. - * Starting from version 1.7, this method is available only if you - * include `popper-utils.js` before `popper.js`. - * - * **DEPRECATION**: This way to access PopperUtils is deprecated - * and will be removed in v2! Use the PopperUtils module directly instead. - * Due to the high instability of the methods contained in Utils, we can't - * guarantee them to follow semver. Use them at your own risk! - * @static - * @private - * @type {Object} - * @deprecated since version 1.8 - * @member Utils - * @memberof Popper - */ - - }]); - return Popper; -}(); - -/** - * The `referenceObject` is an object that provides an interface compatible with Popper.js - * and lets you use it as replacement of a real DOM node.
- * You can use this method to position a popper relatively to a set of coordinates - * in case you don't have a DOM node to use as reference. - * - * ``` - * new Popper(referenceObject, popperNode); - * ``` - * - * NB: This feature isn't supported in Internet Explorer 10 - * @name referenceObject - * @property {Function} data.getBoundingClientRect - * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. - * @property {number} data.clientWidth - * An ES6 getter that will return the width of the virtual reference element. - * @property {number} data.clientHeight - * An ES6 getter that will return the height of the virtual reference element. - */ - - -Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; -Popper.placements = placements; -Popper.Defaults = Defaults; - -var PositioningPlacement = { - Auto: "auto", - TopLeft: "top left", - Top: "top", - TopRight: "top right", - LeftTop: "left top", - Left: "left", - LeftBottom: "left bottom", - BottomLeft: "bottom left", - Bottom: "bottom", - BottomRight: "bottom right", - RightTop: "right top", - Right: "right", - RightBottom: "right bottom" -}; -function placementToPopper(placement) { - if (!placement || placement === PositioningPlacement.Auto) { - return "auto"; - } - // All placements of the format: `direction alignment`, e.g. `top left`. - var _a = placement.split(" "), direction = _a[0], alignment = _a[1]; - // Direction alone covers case of just `top`, `left`, `bottom`, `right`. - var chosenPlacement = [direction]; - // Add `start` / `end` to placement, depending on alignment direction. - switch (alignment) { - case "top": - case "left": - chosenPlacement.push("start"); - break; - case "bottom": - case "right": - chosenPlacement.push("end"); - break; - } - // Join with hyphen to create Popper compatible placement. - return chosenPlacement.join("-"); -} -function popperToPlacement(popper) { - if (!popper || popper === "auto") { - return "auto"; - } - var _a = popper.split("-"), direction = _a[0], alignment = _a[1]; - var chosenPlacement = [direction]; - switch (direction) { - case "top": - case "bottom": - switch (alignment) { - case "start": - chosenPlacement.push("left"); - break; - case "end": - chosenPlacement.push("right"); - break; - } - break; - case "left": - case "right": - switch (alignment) { - case "start": - chosenPlacement.push("top"); - break; - case "end": - chosenPlacement.push("bottom"); - break; - } - break; - } - return chosenPlacement.join(" "); -} -var PositioningService = /** @class */ (function () { - function PositioningService(anchor, subject, placement, arrowSelector) { - var _this = this; - this.anchor = anchor; - this.subject = subject; - this._placement = placement; - var modifiers = { - computeStyle: { - gpuAcceleration: false - }, - preventOverflow: { - escapeWithReference: true, - boundariesElement: document.body - }, - arrow: { - element: arrowSelector - } - }; - if (!arrowSelector) { - delete modifiers.arrow; - } - this._popper = new Popper(anchor.nativeElement, subject.nativeElement, { - placement: placementToPopper(placement), - modifiers: modifiers, - onCreate: function (initial) { return _this._popperState = initial; }, - onUpdate: function (update) { return _this._popperState = update; } - }); - } - Object.defineProperty(PositioningService.prototype, "placement", { - get: function () { - return this._placement; - }, - set: function (placement) { - this._placement = placement; - this._popper.options.placement = placementToPopper(placement); - this.update(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(PositioningService.prototype, "actualPlacement", { - get: function () { - if (!this._popperState) { - return PositioningPlacement.Auto; - } - return popperToPlacement(this._popperState.placement); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(PositioningService.prototype, "state", { - get: function () { - return this._popperState; - }, - enumerable: true, - configurable: true - }); - PositioningService.prototype.update = function () { - this._popper.update(); - }; - PositioningService.prototype.destroy = function () { - this._popper.destroy(); - }; - return PositioningService; -}()); - -var SuiUtilityModule = /** @class */ (function () { - function SuiUtilityModule() { - } - SuiUtilityModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [_angular_common.CommonModule], - providers: [ - SuiComponentFactory - ] - },] }, - ]; - /** @nocollapse */ - SuiUtilityModule.ctorParameters = function () { return []; }; - return SuiUtilityModule; -}()); - -var __extends = (undefined && undefined.__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 __()); - }; -})(); -var SuiCheckbox = /** @class */ (function () { - function SuiCheckbox() { - this.isChecked = false; - this.onCheckChange = new _angular_core.EventEmitter(); - this.onTouched = new _angular_core.EventEmitter(); - this.isDisabled = false; - this.isReadonly = false; - this._checkboxClasses = true; - } - Object.defineProperty(SuiCheckbox.prototype, "checkedAttribute", { - get: function () { - return this.isChecked ? "" : undefined; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCheckbox.prototype, "isDisabledAttribute", { - get: function () { - return this.isDisabled ? "disabled" : undefined; - }, - enumerable: true, - configurable: true - }); - SuiCheckbox.prototype.onMouseDown = function (e) { - e.preventDefault(); - }; - SuiCheckbox.prototype.onClick = function () { - if (!this.isDisabled && !this.isReadonly) { - this.toggle(); - this.focusCheckbox(); - } - }; - SuiCheckbox.prototype.onFocusOut = function () { - this.onTouched.emit(); - }; - SuiCheckbox.prototype.toggle = function () { - this.isChecked = !this.isChecked; - this.onCheckChange.emit(this.isChecked); - }; - SuiCheckbox.prototype.writeValue = function (value) { - this.isChecked = value; - }; - SuiCheckbox.prototype.focusCheckbox = function () { - this._checkboxElement.nativeElement.focus(); - }; - SuiCheckbox.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-checkbox", - exportAs: "suiCheckbox", - template: "\n\n\n" - },] }, - ]; - /** @nocollapse */ - SuiCheckbox.ctorParameters = function () { return []; }; - SuiCheckbox.propDecorators = { - "_checkboxClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.checkbox",] },], - "name": [{ type: _angular_core.Input },], - "isChecked": [{ type: _angular_core.HostBinding, args: ["class.checked",] },], - "onCheckChange": [{ type: _angular_core.Output, args: ["checkChange",] },], - "onTouched": [{ type: _angular_core.Output, args: ["touched",] },], - "isDisabled": [{ type: _angular_core.Input },], - "isReadonly": [{ type: _angular_core.HostBinding, args: ["class.read-only",] }, { type: _angular_core.Input },], - "_checkboxElement": [{ type: _angular_core.ViewChild, args: ["checkbox",] },], - "onMouseDown": [{ type: _angular_core.HostListener, args: ["mousedown", ["$event"],] },], - "onClick": [{ type: _angular_core.HostListener, args: ["click",] },], - "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout",] },], - }; - return SuiCheckbox; -}()); -var SuiCheckboxValueAccessor = /** @class */ (function (_super) { - __extends(SuiCheckboxValueAccessor, _super); - function SuiCheckboxValueAccessor(host) { - return _super.call(this, host) || this; - } - SuiCheckboxValueAccessor.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "sui-checkbox", - host: { - "(checkChange)": "onChange($event)", - "(touched)": "onTouched()" - }, - providers: [customValueAccessorFactory(SuiCheckboxValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiCheckboxValueAccessor.ctorParameters = function () { return [ - { type: SuiCheckbox, }, - ]; }; - return SuiCheckboxValueAccessor; -}(CustomValueAccessor)); - -var __extends$1 = (undefined && undefined.__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 __()); - }; -})(); -var SuiRadio = /** @class */ (function () { - function SuiRadio() { - this._radioClasses = true; - this.isChecked = false; - this.onCurrentValueChange = new _angular_core.EventEmitter(); - this.onTouched = new _angular_core.EventEmitter(); - this.isDisabled = false; - this.isReadonly = false; - this._radioClasses = true; - } - Object.defineProperty(SuiRadio.prototype, "checkedAttribute", { - get: function () { - return this.isChecked ? "" : undefined; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiRadio.prototype, "isDisabledAttribute", { - get: function () { - return this.isDisabled ? "disabled" : undefined; - }, - enumerable: true, - configurable: true - }); - SuiRadio.prototype.onMouseDown = function (e) { - e.preventDefault(); - }; - SuiRadio.prototype.onClick = function () { - if (!this.isDisabled && !this.isReadonly) { - this.currentValue = this.value; - this.onCurrentValueChange.emit(this.currentValue); - this.update(); - this.focusRadio(); - } - }; - SuiRadio.prototype.onFocusOut = function () { - this.onTouched.emit(); - }; - SuiRadio.prototype.update = function () { - this.isChecked = this.currentValue === this.value; - }; - SuiRadio.prototype.writeValue = function (value) { - this.currentValue = value; - this.update(); - }; - SuiRadio.prototype.focusRadio = function () { - this._radioElement.nativeElement.focus(); - }; - SuiRadio.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-radio-button", - template: "\n\n\n" - },] }, - ]; - /** @nocollapse */ - SuiRadio.ctorParameters = function () { return []; }; - SuiRadio.propDecorators = { - "_radioClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.radio",] }, { type: _angular_core.HostBinding, args: ["class.checkbox",] },], - "name": [{ type: _angular_core.Input },], - "value": [{ type: _angular_core.Input },], - "isChecked": [{ type: _angular_core.HostBinding, args: ["class.checked",] },], - "onCurrentValueChange": [{ type: _angular_core.Output, args: ["currentValueChange",] },], - "onTouched": [{ type: _angular_core.Output, args: ["touched",] },], - "isDisabled": [{ type: _angular_core.Input },], - "isReadonly": [{ type: _angular_core.HostBinding, args: ["class.read-only",] }, { type: _angular_core.Input },], - "_radioElement": [{ type: _angular_core.ViewChild, args: ["radio",] },], - "onMouseDown": [{ type: _angular_core.HostListener, args: ["mousedown", ["$event"],] },], - "onClick": [{ type: _angular_core.HostListener, args: ["click",] },], - "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout",] },], - }; - return SuiRadio; -}()); -var SuiRadioValueAccessor = /** @class */ (function (_super) { - __extends$1(SuiRadioValueAccessor, _super); - function SuiRadioValueAccessor(host) { - return _super.call(this, host) || this; - } - SuiRadioValueAccessor.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "sui-radio-button", - host: { - "(currentValueChange)": "onChange($event)", - "(touched)": "onTouched()" - }, - providers: [customValueAccessorFactory(SuiRadioValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiRadioValueAccessor.ctorParameters = function () { return [ - { type: SuiRadio, }, - ]; }; - return SuiRadioValueAccessor; -}(CustomValueAccessor)); - -var SuiRadioManager = /** @class */ (function () { - function SuiRadioManager(element) { - this.element = element; - this.isNested = false; - this._radioSubs = []; - } - SuiRadioManager.prototype.ngAfterContentInit = function () { - var _this = this; - this.updateNesting(); - this._subManagers.changes.subscribe(function () { return _this.updateNesting(); }); - this.updateRadios(); - this._renderedRadios.changes.subscribe(function () { return _this.updateRadios(); }); - }; - SuiRadioManager.prototype.updateNesting = function () { - var _this = this; - this._subManagers - .filter(function (m) { return m !== _this; }) - .forEach(function (m) { return m.isNested = true; }); - }; - SuiRadioManager.prototype.updateRadios = function () { - var _this = this; - this._radioSubs.forEach(function (s) { return s.unsubscribe(); }); - this._radioSubs = []; - var groups = Util.Array.groupBy(this._renderedRadios.toArray(), "name"); - Object - .keys(groups) - .map(function (k) { return groups[k]; }) - .forEach(function (g) { - return g - .forEach(function (r) { - return _this._radioSubs - .push(r.onCurrentValueChange - .subscribe(function (v) { - if (!_this.isNested) { - g.forEach(function (radio) { return radio.writeValue(v); }); - } - })); - }); - }); - }; - SuiRadioManager.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]" - },] }, - ]; - /** @nocollapse */ - SuiRadioManager.ctorParameters = function () { return [ - { type: _angular_core.ElementRef, }, - ]; }; - SuiRadioManager.propDecorators = { - "_subManagers": [{ type: _angular_core.ContentChildren, args: [SuiRadioManager, { descendants: true },] },], - "_renderedRadios": [{ type: _angular_core.ContentChildren, args: [SuiRadio, { descendants: true },] },], - }; - return SuiRadioManager; -}()); - -var SuiCheckboxModule = /** @class */ (function () { - function SuiCheckboxModule() { - } - SuiCheckboxModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule, - _angular_forms.FormsModule - ], - declarations: [ - SuiCheckbox, - SuiCheckboxValueAccessor, - SuiRadio, - SuiRadioValueAccessor, - SuiRadioManager - ], - exports: [ - SuiCheckbox, - SuiCheckboxValueAccessor, - SuiRadio, - SuiRadioValueAccessor, - SuiRadioManager - ] - },] }, - ]; - /** @nocollapse */ - SuiCheckboxModule.ctorParameters = function () { return []; }; - return SuiCheckboxModule; -}()); - -(function (CalendarMode) { - CalendarMode[CalendarMode["DateOnly"] = 0] = "DateOnly"; - CalendarMode[CalendarMode["TimeOnly"] = 1] = "TimeOnly"; - CalendarMode[CalendarMode["Both"] = 2] = "Both"; -})(exports.CalendarMode || (exports.CalendarMode = {})); -var CalendarService = /** @class */ (function () { - function CalendarService(config, localeValues) { - this.localeValues = localeValues; - this.onManualUpdate = function () { }; - this.config = config; - this.currentDate = new Date(); - this.firstDayOfWeek = this.localeValues.firstDayOfWeek; - this.onDateChange = new _angular_core.EventEmitter(); - this.reset(); - } - Object.defineProperty(CalendarService.prototype, "config", { - get: function () { - return this._config; - }, - set: function (config) { - this._config = config; - config.updateBounds(this._selectedDate || this.currentDate); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarService.prototype, "inFinalView", { - get: function () { - return this.currentView === this.config.mappings.finalView; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarService.prototype, "selectedDate", { - get: function () { - return this._selectedDate; - }, - set: function (date) { - if (date) { - this._selectedDate = DateUtil.clone(date); - this.currentDate = DateUtil.clone(date); - } - else { - this._selectedDate = undefined; - } - this.config.updateBounds(this._selectedDate || this.currentDate); - this.onManualUpdate(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarService.prototype, "minDate", { - get: function () { - if (this._minDate && this.config.dateMinBound) { - return this._minDate > this.config.dateMinBound ? this._minDate : this.config.dateMinBound; - } - return this._minDate || this.config.dateMinBound; - }, - set: function (min) { - this._minDate = min; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarService.prototype, "maxDate", { - get: function () { - if (this._maxDate && this.config.dateMaxBound) { - return this._maxDate < this.config.dateMaxBound ? this._maxDate : this.config.dateMaxBound; - } - return this._maxDate || this.config.dateMaxBound; - }, - set: function (max) { - this._maxDate = max; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarService.prototype, "firstDayOfWeek", { - get: function () { - return this._firstDayOfWeek; - }, - set: function (firstDayOfWeek) { - if (firstDayOfWeek != undefined) { - this._firstDayOfWeek = Math.max(0, Math.min(6, firstDayOfWeek)); - } - }, - enumerable: true, - configurable: true - }); - CalendarService.prototype.reset = function () { - this.currentView = this.config.mappings.finalView; - if (!this._selectedDate) { - var current = this.currentDate.getTime(); - if (this._minDate) { - current = Math.max(current, this._minDate.getTime()); - } - if (this._maxDate) { - current = Math.min(current, this._maxDate.getTime()); - } - this.currentDate = new Date(current); - this.config.updateBounds(this.currentDate); - this.currentView = this.config.mappings.initialView; - } - }; - CalendarService.prototype.changeDate = function (date, fromView) { - this.currentDate = date; - if (fromView === this.config.mappings.finalView) { - this.selectedDate = date; - return this.onDateChange.emit(date); - } - this.updateView(this.config.mappings.changed, fromView); - }; - CalendarService.prototype.zoomOut = function (fromView) { - this.updateView(this.config.mappings.zoom, fromView); - }; - CalendarService.prototype.updateView = function (mappings, fromView) { - var mapping = mappings.get(fromView); - if (mapping == undefined) { - throw new Error("Unknown view type."); - } - this.currentView = mapping; - }; - return CalendarService; -}()); - -var CalendarItem = /** @class */ (function () { - function CalendarItem(date) { - this.date = date; - } - return CalendarItem; -}()); -var SuiCalendarItem = /** @class */ (function () { - function SuiCalendarItem(changeDetector) { - this.changeDetector = changeDetector; - this.hasFocus = false; - this.onFocussed = new _angular_core.EventEmitter(); - } - Object.defineProperty(SuiCalendarItem.prototype, "isSelectable", { - get: function () { - return this.item.isSelectable; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCalendarItem.prototype, "isActive", { - get: function () { - return this.item.isActive; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCalendarItem.prototype, "isToday", { - get: function () { - return this.item.isToday; - }, - enumerable: true, - configurable: true - }); - SuiCalendarItem.prototype.onMouseMove = function () { - if (!this.hasFocus) { - this.hasFocus = true; - this.onFocussed.emit(this.hasFocus); - } - }; - SuiCalendarItem.prototype.onMouseLeave = function () { - this.hasFocus = false; - this.onFocussed.emit(this.hasFocus); - }; - SuiCalendarItem.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "[calendarItem]" - },] }, - ]; - /** @nocollapse */ - SuiCalendarItem.ctorParameters = function () { return [ - { type: _angular_core.ChangeDetectorRef, }, - ]; }; - SuiCalendarItem.propDecorators = { - "item": [{ type: _angular_core.Input, args: ["calendarItem",] },], - "isSelectable": [{ type: _angular_core.HostBinding, args: ["class.disabled",] },], - "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], - "isToday": [{ type: _angular_core.HostBinding, args: ["class.today",] },], - "hasFocus": [{ type: _angular_core.HostBinding, args: ["class.focus",] },], - "onMouseMove": [{ type: _angular_core.HostListener, args: ["mousemove",] },], - "onMouseLeave": [{ type: _angular_core.HostListener, args: ["mouseleave",] },], - }; - return SuiCalendarItem; -}()); - -(function (CalendarViewType) { - CalendarViewType[CalendarViewType["Year"] = 0] = "Year"; - CalendarViewType[CalendarViewType["Month"] = 1] = "Month"; - CalendarViewType[CalendarViewType["Date"] = 2] = "Date"; - CalendarViewType[CalendarViewType["Hour"] = 3] = "Hour"; - CalendarViewType[CalendarViewType["Minute"] = 4] = "Minute"; -})(exports.CalendarViewType || (exports.CalendarViewType = {})); -var CalendarView = /** @class */ (function () { - function CalendarView(renderer, viewType, ranges) { - var _this = this; - this._type = viewType; - this.ranges = ranges; - this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); - } - Object.defineProperty(CalendarView.prototype, "service", { - get: function () { - return this._service; - }, - set: function (service) { - var _this = this; - this._service = service; - this.ranges.loadService(service); - this.service.onManualUpdate = function () { - _this.ranges.refresh(); - delete _this._highlightedItem; - _this.autoHighlight(); - }; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarView.prototype, "currentDate", { - get: function () { - return this.service.currentDate; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarView.prototype, "selectedDate", { - get: function () { - return this.service.selectedDate; - }, - enumerable: true, - configurable: true - }); - // Template Methods - // Template Methods - CalendarView.prototype.setDate = - // Template Methods - function (item) { - this.service.changeDate(item.date, this._type); - }; - CalendarView.prototype.zoomOut = function () { - this.service.zoomOut(this._type); - }; - // Keyboard Control - // Keyboard Control - CalendarView.prototype.ngAfterViewInit = - // Keyboard Control - function () { - var _this = this; - this._renderedItems.changes.subscribe(function () { return _this.onRenderedItemsChanged(); }); - this.onRenderedItemsChanged(); - }; - CalendarView.prototype.onRenderedItemsChanged = function () { - var _this = this; - this._renderedItems.forEach(function (i) { - return i.onFocussed.subscribe(function (hasFocus) { - if (hasFocus) { - _this.highlightItem(i.item); - } - }); - }); - this.autoHighlight(); - this.highlightItem(this._highlightedItem); - }; - CalendarView.prototype.autoHighlight = function () { - var _this = this; - var date = this.selectedDate && this.ranges.current.containsDate(this.selectedDate) ? this.selectedDate : this.currentDate; - if (this._highlightedItem && this.ranges.current.containsDate(this._highlightedItem.date)) { - date = this._highlightedItem.date; - } - var initiallyHighlighted = this.ranges.current.items.find(function (i) { return _this.ranges.dateComparer.equal(i.date, date); }); - if (initiallyHighlighted && !initiallyHighlighted.isDisabled) { - this._highlightedItem = initiallyHighlighted; - } - }; - CalendarView.prototype.highlightItem = function (item) { - if (item) { - this._renderedItems.forEach(function (i) { return i.hasFocus = false; }); - var rendered = this._renderedItems.find(function (ri) { return ri.item === item; }); - if (rendered && !rendered.hasFocus) { - rendered.hasFocus = true; - rendered.changeDetector.detectChanges(); - } - this._highlightedItem = item; - } - }; - CalendarView.prototype.onDocumentKeyDown = function (e) { - if (this._highlightedItem && e.keyCode === exports.KeyCode.Enter) { - this.setDate(this._highlightedItem); - return; - } - if (!this._highlightedItem) { - this.autoHighlight(); - } - var index = this.ranges.current.findIndex(this._highlightedItem); - var isMovingForward = true; - var delta = 0; - switch (e.keyCode) { - case exports.KeyCode.Right: - delta += 1; - break; - case exports.KeyCode.Left: - delta -= 1; - isMovingForward = false; - break; - case exports.KeyCode.Down: - delta += this.ranges.columns; - break; - case exports.KeyCode.Up: - delta -= this.ranges.columns; - isMovingForward = false; - break; - default: - return; - } - // Stop these keypresses being captured elsewhere. - e.preventDefault(); - var nextItem = this.ranges.current.items[index + delta]; - if (nextItem && nextItem.isDisabled) { - return; - } - if (nextItem && !nextItem.isOutsideRange) { - return this.highlightItem(nextItem); - } - if (nextItem && nextItem.isOutsideRange) { - if (index + delta >= this.ranges.current.inRange.length) { - isMovingForward = true; - } - } - if (!nextItem) { - var adjustedIndex = this.ranges.current.findIndex(this._highlightedItem); - var nextItems = this.ranges.calc(isMovingForward).inRange; - if (isMovingForward) { - adjustedIndex -= this.ranges.current.inRange.length; - } - else { - adjustedIndex += nextItems.length; - } - nextItem = nextItems[adjustedIndex + delta]; - if (nextItem.isDisabled) { - return; - } - } - this.ranges.move(isMovingForward); - this._highlightedItem = this.ranges.current.find(nextItem); - }; - CalendarView.prototype.ngOnDestroy = function () { - this._documentKeyDownListener(); - }; - CalendarView.propDecorators = { - "_renderedItems": [{ type: _angular_core.ViewChildren, args: [SuiCalendarItem,] },], - "service": [{ type: _angular_core.Input },], - }; - return CalendarView; -}()); - -var __extends$3 = (undefined && undefined.__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 __()); - }; -})(); -var CalendarMappings = /** @class */ (function () { - function CalendarMappings() { - } - return CalendarMappings; -}()); -var DateMappings = /** @class */ (function (_super) { - __extends$3(DateMappings, _super); - function DateMappings() { - var _this = _super.call(this) || this; - _this.initialView = exports.CalendarViewType.Date; - _this.finalView = exports.CalendarViewType.Date; - _this.changed = new Map([ - [exports.CalendarViewType.Year, exports.CalendarViewType.Month], - [exports.CalendarViewType.Month, exports.CalendarViewType.Date], - [exports.CalendarViewType.Date, exports.CalendarViewType.Date] - ]); - _this.zoom = new Map([ - [exports.CalendarViewType.Year, exports.CalendarViewType.Date], - [exports.CalendarViewType.Month, exports.CalendarViewType.Year], - [exports.CalendarViewType.Date, exports.CalendarViewType.Month] - ]); - return _this; - } - return DateMappings; -}(CalendarMappings)); -var TimeMappings = /** @class */ (function (_super) { - __extends$3(TimeMappings, _super); - function TimeMappings() { - var _this = _super.call(this) || this; - _this.initialView = exports.CalendarViewType.Hour; - _this.finalView = exports.CalendarViewType.Minute; - _this.changed = new Map([ - [exports.CalendarViewType.Hour, exports.CalendarViewType.Minute], - [exports.CalendarViewType.Minute, exports.CalendarViewType.Minute] - ]); - _this.zoom = new Map([ - [exports.CalendarViewType.Hour, exports.CalendarViewType.Minute], - [exports.CalendarViewType.Minute, exports.CalendarViewType.Hour] - ]); - return _this; - } - return TimeMappings; -}(CalendarMappings)); -var DatetimeMappings = /** @class */ (function (_super) { - __extends$3(DatetimeMappings, _super); - function DatetimeMappings() { - var _this = _super.call(this) || this; - _this.initialView = exports.CalendarViewType.Date; - _this.finalView = exports.CalendarViewType.Minute; - _this.changed = new Map([ - [exports.CalendarViewType.Year, exports.CalendarViewType.Month], - [exports.CalendarViewType.Month, exports.CalendarViewType.Date], - [exports.CalendarViewType.Date, exports.CalendarViewType.Hour], - [exports.CalendarViewType.Hour, exports.CalendarViewType.Minute], - [exports.CalendarViewType.Minute, exports.CalendarViewType.Minute] - ]); - _this.zoom = new Map([ - [exports.CalendarViewType.Year, exports.CalendarViewType.Date], - [exports.CalendarViewType.Month, exports.CalendarViewType.Year], - [exports.CalendarViewType.Date, exports.CalendarViewType.Month], - [exports.CalendarViewType.Hour, exports.CalendarViewType.Date], - [exports.CalendarViewType.Minute, exports.CalendarViewType.Hour] - ]); - return _this; - } - return DatetimeMappings; -}(CalendarMappings)); -var MonthMappings = /** @class */ (function (_super) { - __extends$3(MonthMappings, _super); - function MonthMappings() { - var _this = _super.call(this) || this; - _this.initialView = exports.CalendarViewType.Month; - _this.finalView = exports.CalendarViewType.Month; - _this.changed = new Map([ - [exports.CalendarViewType.Year, exports.CalendarViewType.Month], - [exports.CalendarViewType.Month, exports.CalendarViewType.Month] - ]); - _this.zoom = new Map([ - [exports.CalendarViewType.Year, exports.CalendarViewType.Month], - [exports.CalendarViewType.Month, exports.CalendarViewType.Year] - ]); - return _this; - } - return MonthMappings; -}(CalendarMappings)); -var YearMappings = /** @class */ (function (_super) { - __extends$3(YearMappings, _super); - function YearMappings() { - var _this = _super.call(this) || this; - _this.initialView = exports.CalendarViewType.Year; - _this.finalView = exports.CalendarViewType.Year; - _this.changed = new Map([ - [exports.CalendarViewType.Year, exports.CalendarViewType.Year] - ]); - _this.zoom = new Map([ - [exports.CalendarViewType.Year, exports.CalendarViewType.Year] - ]); - return _this; - } - return YearMappings; -}(CalendarMappings)); - -var __extends$2 = (undefined && undefined.__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 __()); - }; -})(); -var CalendarConfig = /** @class */ (function () { - function CalendarConfig(mode, precision, mappings, fallback) { - this.mode = mode; - this.precision = precision; - this.mappings = mappings; - this.fallback = fallback; - } - CalendarConfig.prototype.updateBounds = function (providedDate) { - this.dateMinBound = DateUtil.startOf(exports.DatePrecision.Year, new Date(), true); - this.dateMinBound.setFullYear(0); - }; - return CalendarConfig; -}()); -var DateConfigBase = /** @class */ (function (_super) { - __extends$2(DateConfigBase, _super); - function DateConfigBase(precision, mappings, fallback) { - return _super.call(this, exports.CalendarMode.DateOnly, precision, mappings, fallback) || this; - } - return DateConfigBase; -}(CalendarConfig)); -var YearConfig = /** @class */ (function (_super) { - __extends$2(YearConfig, _super); - function YearConfig() { - return _super.call(this, exports.DatePrecision.Year, new YearMappings(), "number") || this; - } - return YearConfig; -}(DateConfigBase)); -var MonthConfig = /** @class */ (function (_super) { - __extends$2(MonthConfig, _super); - function MonthConfig() { - return _super.call(this, exports.DatePrecision.Month, new MonthMappings(), "month") || this; - } - return MonthConfig; -}(DateConfigBase)); -var DateConfig = /** @class */ (function (_super) { - __extends$2(DateConfig, _super); - function DateConfig() { - return _super.call(this, exports.DatePrecision.Date, new DateMappings(), "date") || this; - } - return DateConfig; -}(DateConfigBase)); -var DatetimeConfig = /** @class */ (function (_super) { - __extends$2(DatetimeConfig, _super); - function DatetimeConfig() { - return _super.call(this, exports.CalendarMode.Both, exports.DatePrecision.Minute, new DatetimeMappings(), "datetime-local") || this; - } - return DatetimeConfig; -}(CalendarConfig)); -var TimeConfig = /** @class */ (function (_super) { - __extends$2(TimeConfig, _super); - function TimeConfig() { - return _super.call(this, exports.CalendarMode.TimeOnly, exports.DatePrecision.Minute, new TimeMappings(), "time") || this; - } - TimeConfig.prototype.updateBounds = function (providedDate) { - this.dateMaxBound = DateUtil.endOf(exports.DatePrecision.Date, DateUtil.clone(providedDate)); - this.dateMinBound = DateUtil.previous(exports.DatePrecision.Date, DateUtil.clone(this.dateMaxBound)); - }; - return TimeConfig; -}(CalendarConfig)); - -var DateComparer = /** @class */ (function () { - function DateComparer(precision, isSmallest) { - this._precision = precision; - this._isSmallest = isSmallest; - } - DateComparer.prototype.equal = function (a, b) { - if (this._precision === exports.DatePrecision.Minute) { - return !!b && - DateUtil.equal(exports.DatePrecision.Hour, b, a) && - Util.Math.roundDown(b.getMinutes(), 5) === Util.Math.roundDown(a.getMinutes(), 5); - } - return !!b && DateUtil.equal(this._precision, a, b); - }; - DateComparer.prototype.lessThan = function (a, b) { - if (this._isSmallest) { - return !b || (b >= a); - } - return !b || (DateUtil.endOf(this._precision, DateUtil.clone(b)) >= a); - }; - DateComparer.prototype.greaterThan = function (a, b) { - if (this._isSmallest) { - return !b || (b <= a); - } - return !b || (DateUtil.startOf(this._precision, DateUtil.clone(b)) <= a); - }; - DateComparer.prototype.between = function (date, left, right) { - return this.greaterThan(date, left) && this.lessThan(date, right); - }; - return DateComparer; -}()); - -var MILLISECONDS_IN_HOUR = 3600000; -var MILLISECONDS_IN_MINUTE = 60000; -var DEFAULT_ADDITIONAL_DIGITS = 2; - -var patterns = { - dateTimeDelimeter: /[T ]/, - plainTime: /:/, - - // year tokens - YY: /^(\d{2})$/, - YYY: [ - /^([+-]\d{2})$/, // 0 additional digits - /^([+-]\d{3})$/, // 1 additional digit - /^([+-]\d{4})$/ // 2 additional digits - ], - YYYY: /^(\d{4})/, - YYYYY: [ - /^([+-]\d{4})/, // 0 additional digits - /^([+-]\d{5})/, // 1 additional digit - /^([+-]\d{6})/ // 2 additional digits - ], - - // date tokens - MM: /^-(\d{2})$/, - DDD: /^-?(\d{3})$/, - MMDD: /^-?(\d{2})-?(\d{2})$/, - Www: /^-?W(\d{2})$/, - WwwD: /^-?W(\d{2})-?(\d{1})$/, - - HH: /^(\d{2}([.,]\d*)?)$/, - HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/, - HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/, - - // timezone tokens - timezone: /([Z+-].*)$/, - timezoneZ: /^(Z)$/, - timezoneHH: /^([+-])(\d{2})$/, - timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/ -}; - -/** - * @name toDate - * @category Common Helpers - * @summary Convert the given argument to an instance of Date. - * - * @description - * Convert the given argument to an instance of Date. - * - * If the argument is an instance of Date, the function returns its clone. - * - * If the argument is a number, it is treated as a timestamp. - * - * If an argument is a string, the function tries to parse it. - * Function accepts complete ISO 8601 formats as well as partial implementations. - * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 - * - * If all above fails, the function passes the given argument to Date constructor. - * - * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`. - * All *date-fns* functions will throw `RangeError` if `options.additionalDigits` is not 0, 1, 2 or undefined. - * - * @param {Date|String|Number} argument - the value to convert - * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} - * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format - * @returns {Date} the parsed date in the local time zone - * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 - * - * @example - * // Convert string '2014-02-11T11:30:30' to date: - * var result = toDate('2014-02-11T11:30:30') - * //=> Tue Feb 11 2014 11:30:30 - * - * @example - * // Convert string '+02014101' to date, - * // if the additional number of digits in the extended year format is 1: - * var result = toDate('+02014101', {additionalDigits: 1}) - * //=> Fri Apr 11 2014 00:00:00 - */ -function toDate (argument, dirtyOptions) { - var options = dirtyOptions || {}; - - var additionalDigits = options.additionalDigits === undefined ? DEFAULT_ADDITIONAL_DIGITS : Number(options.additionalDigits); - if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) { - throw new RangeError('additionalDigits must be 0, 1 or 2') - } - - // Clone the date - if (argument instanceof Date) { - // Prevent the date to lose the milliseconds when passed to new Date() in IE10 - return new Date(argument.getTime()) - } else if (typeof argument !== 'string') { - return new Date(argument) - } - - var dateStrings = splitDateString(argument); - - var parseYearResult = parseYear(dateStrings.date, additionalDigits); - var year = parseYearResult.year; - var restDateString = parseYearResult.restDateString; - - var date = parseDate(restDateString, year); - - if (date) { - var timestamp = date.getTime(); - var time = 0; - var offset; - - if (dateStrings.time) { - time = parseTime(dateStrings.time); - } - - if (dateStrings.timezone) { - offset = parseTimezone(dateStrings.timezone); - } else { - // get offset accurate to hour in timezones that change offset - offset = new Date(timestamp + time).getTimezoneOffset(); - offset = new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE).getTimezoneOffset(); - } - - return new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE) - } else { - return new Date(argument) - } -} - -function splitDateString (dateString) { - var dateStrings = {}; - var array = dateString.split(patterns.dateTimeDelimeter); - var timeString; - - if (patterns.plainTime.test(array[0])) { - dateStrings.date = null; - timeString = array[0]; - } else { - dateStrings.date = array[0]; - timeString = array[1]; - } - - if (timeString) { - var token = patterns.timezone.exec(timeString); - if (token) { - dateStrings.time = timeString.replace(token[1], ''); - dateStrings.timezone = token[1]; - } else { - dateStrings.time = timeString; - } - } - - return dateStrings -} - -function parseYear (dateString, additionalDigits) { - var patternYYY = patterns.YYY[additionalDigits]; - var patternYYYYY = patterns.YYYYY[additionalDigits]; - - var token; - - // YYYY or ±YYYYY - token = patterns.YYYY.exec(dateString) || patternYYYYY.exec(dateString); - if (token) { - var yearString = token[1]; - return { - year: parseInt(yearString, 10), - restDateString: dateString.slice(yearString.length) - } - } - - // YY or ±YYY - token = patterns.YY.exec(dateString) || patternYYY.exec(dateString); - if (token) { - var centuryString = token[1]; - return { - year: parseInt(centuryString, 10) * 100, - restDateString: dateString.slice(centuryString.length) - } - } - - // Invalid ISO-formatted year - return { - year: null - } -} - -function parseDate (dateString, year) { - // Invalid ISO-formatted year - if (year === null) { - return null - } - - var token; - var date; - var month; - var week; - - // YYYY - if (dateString.length === 0) { - date = new Date(0); - date.setUTCFullYear(year); - return date - } - - // YYYY-MM - token = patterns.MM.exec(dateString); - if (token) { - date = new Date(0); - month = parseInt(token[1], 10) - 1; - date.setUTCFullYear(year, month); - return date - } - - // YYYY-DDD or YYYYDDD - token = patterns.DDD.exec(dateString); - if (token) { - date = new Date(0); - var dayOfYear = parseInt(token[1], 10); - date.setUTCFullYear(year, 0, dayOfYear); - return date - } - - // YYYY-MM-DD or YYYYMMDD - token = patterns.MMDD.exec(dateString); - if (token) { - date = new Date(0); - month = parseInt(token[1], 10) - 1; - var day = parseInt(token[2], 10); - date.setUTCFullYear(year, month, day); - return date - } - - // YYYY-Www or YYYYWww - token = patterns.Www.exec(dateString); - if (token) { - week = parseInt(token[1], 10) - 1; - return dayOfISOYear(year, week) - } - - // YYYY-Www-D or YYYYWwwD - token = patterns.WwwD.exec(dateString); - if (token) { - week = parseInt(token[1], 10) - 1; - var dayOfWeek = parseInt(token[2], 10) - 1; - return dayOfISOYear(year, week, dayOfWeek) - } - - // Invalid ISO-formatted date - return null -} - -function parseTime (timeString) { - var token; - var hours; - var minutes; - - // hh - token = patterns.HH.exec(timeString); - if (token) { - hours = parseFloat(token[1].replace(',', '.')); - return (hours % 24) * MILLISECONDS_IN_HOUR - } - - // hh:mm or hhmm - token = patterns.HHMM.exec(timeString); - if (token) { - hours = parseInt(token[1], 10); - minutes = parseFloat(token[2].replace(',', '.')); - return (hours % 24) * MILLISECONDS_IN_HOUR + - minutes * MILLISECONDS_IN_MINUTE - } - - // hh:mm:ss or hhmmss - token = patterns.HHMMSS.exec(timeString); - if (token) { - hours = parseInt(token[1], 10); - minutes = parseInt(token[2], 10); - var seconds = parseFloat(token[3].replace(',', '.')); - return (hours % 24) * MILLISECONDS_IN_HOUR + - minutes * MILLISECONDS_IN_MINUTE + - seconds * 1000 - } - - // Invalid ISO-formatted time - return null -} - -function parseTimezone (timezoneString) { - var token; - var absoluteOffset; - - // Z - token = patterns.timezoneZ.exec(timezoneString); - if (token) { - return 0 - } - - // ±hh - token = patterns.timezoneHH.exec(timezoneString); - if (token) { - absoluteOffset = parseInt(token[2], 10) * 60; - return (token[1] === '+') ? -absoluteOffset : absoluteOffset - } - - // ±hh:mm or ±hhmm - token = patterns.timezoneHHMM.exec(timezoneString); - if (token) { - absoluteOffset = parseInt(token[2], 10) * 60 + parseInt(token[3], 10); - return (token[1] === '+') ? -absoluteOffset : absoluteOffset - } - - return 0 -} - -function dayOfISOYear (isoYear, week, day) { - week = week || 0; - day = day || 0; - var date = new Date(0); - date.setUTCFullYear(isoYear, 0, 4); - var fourthOfJanuaryDay = date.getUTCDay() || 7; - var diff = week * 7 + day + 1 - fourthOfJanuaryDay; - date.setUTCDate(date.getUTCDate() + diff); - return date -} - -/** - * @name addMilliseconds - * @category Millisecond Helpers - * @summary Add the specified number of milliseconds to the given date. - * - * @description - * Add the specified number of milliseconds to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of milliseconds to be added - * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} - * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} - * @returns {Date} the new date with the milliseconds added - * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 - * - * @example - * // Add 750 milliseconds to 10 July 2014 12:45:30.000: - * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) - * //=> Thu Jul 10 2014 12:45:30.750 - */ -function addMilliseconds (dirtyDate, dirtyAmount, dirtyOptions) { - var timestamp = toDate(dirtyDate, dirtyOptions).getTime(); - var amount = Number(dirtyAmount); - return new Date(timestamp + amount) -} - -function cloneObject (dirtyObject) { - dirtyObject = dirtyObject || {}; - var object = {}; - - for (var property in dirtyObject) { - if (dirtyObject.hasOwnProperty(property)) { - object[property] = dirtyObject[property]; - } - } - - return object -} - -var MILLISECONDS_IN_MINUTE$2 = 60000; - -/** - * @name addMinutes - * @category Minute Helpers - * @summary Add the specified number of minutes to the given date. - * - * @description - * Add the specified number of minutes to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of minutes to be added - * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} - * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} - * @returns {Date} the new date with the minutes added - * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 - * - * @example - * // Add 30 minutes to 10 July 2014 12:00:00: - * var result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) - * //=> Thu Jul 10 2014 12:30:00 - */ -function addMinutes (dirtyDate, dirtyAmount, dirtyOptions) { - var amount = Number(dirtyAmount); - return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE$2, dirtyOptions) -} - -/** - * @name isValid - * @category Common Helpers - * @summary Is the given date valid? - * - * @description - * Returns false if argument is Invalid Date and true otherwise. - * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} - * Invalid Date is a Date, whose time value is NaN. - * - * Time value of Date: http://es5.github.io/#x15.9.1.1 - * - * @param {Date|String|Number} date - the date to check - * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} - * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} - * @returns {Boolean} the date is valid - * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 - * - * @example - * // For the valid date: - * var result = isValid(new Date(2014, 1, 31)) - * //=> true - * - * @example - * // For the value, convertable into a date: - * var result = isValid('2014-02-31') - * //=> true - * - * @example - * // For the invalid date: - * var result = isValid(new Date('')) - * //=> false - */ -function isValid (dirtyDate, dirtyOptions) { - var date = toDate(dirtyDate, dirtyOptions); - return !isNaN(date) -} - -var formatDistanceLocale = { - lessThanXSeconds: { - one: 'less than a second', - other: 'less than {{count}} seconds' - }, - - xSeconds: { - one: '1 second', - other: '{{count}} seconds' - }, - - halfAMinute: 'half a minute', - - lessThanXMinutes: { - one: 'less than a minute', - other: 'less than {{count}} minutes' - }, - - xMinutes: { - one: '1 minute', - other: '{{count}} minutes' - }, - - aboutXHours: { - one: 'about 1 hour', - other: 'about {{count}} hours' - }, - - xHours: { - one: '1 hour', - other: '{{count}} hours' - }, - - xDays: { - one: '1 day', - other: '{{count}} days' - }, - - aboutXMonths: { - one: 'about 1 month', - other: 'about {{count}} months' - }, - - xMonths: { - one: '1 month', - other: '{{count}} months' - }, - - aboutXYears: { - one: 'about 1 year', - other: 'about {{count}} years' - }, - - xYears: { - one: '1 year', - other: '{{count}} years' - }, - - overXYears: { - one: 'over 1 year', - other: 'over {{count}} years' - }, - - almostXYears: { - one: 'almost 1 year', - other: 'almost {{count}} years' - } -}; - -function formatDistance (token, count, options) { - options = options || {}; - - var result; - if (typeof formatDistanceLocale[token] === 'string') { - result = formatDistanceLocale[token]; - } else if (count === 1) { - result = formatDistanceLocale[token].one; - } else { - result = formatDistanceLocale[token].other.replace('{{count}}', count); - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'in ' + result - } else { - return result + ' ago' - } - } - - return result -} - -var tokensToBeShortedPattern = /MMMM|MM|DD|dddd/g; - -function buildShortLongFormat (format) { - return format.replace(tokensToBeShortedPattern, function (token) { - return token.slice(1) - }) -} - -/** - * @name buildFormatLongFn - * @category Locale Helpers - * @summary Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. - * - * @description - * Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. - * Returns a function which takes one of the following tokens as the argument: - * `'LTS'`, `'LT'`, `'L'`, `'LL'`, `'LLL'`, `'l'`, `'ll'`, `'lll'`, `'llll'` - * and returns a long format string written as `format` token strings. - * See [format]{@link https://date-fns.org/docs/format} - * - * `'l'`, `'ll'`, `'lll'` and `'llll'` formats are built automatically - * by shortening some of the tokens from corresponding unshortened formats - * (e.g., if `LL` is `'MMMM DD YYYY'` then `ll` will be `MMM D YYYY`) - * - * @param {Object} obj - the object with long formats written as `format` token strings - * @param {String} obj.LT - time format: hours and minutes - * @param {String} obj.LTS - time format: hours, minutes and seconds - * @param {String} obj.L - short date format: numeric day, month and year - * @param {String} [obj.l] - short date format: numeric day, month and year (shortened) - * @param {String} obj.LL - long date format: day, month in words, and year - * @param {String} [obj.ll] - long date format: day, month in words, and year (shortened) - * @param {String} obj.LLL - long date and time format - * @param {String} [obj.lll] - long date and time format (shortened) - * @param {String} obj.LLLL - long date, time and weekday format - * @param {String} [obj.llll] - long date, time and weekday format (shortened) - * @returns {Function} `formatLong` property of the locale - * - * @example - * // For `en-US` locale: - * locale.formatLong = buildFormatLongFn({ - * LT: 'h:mm aa', - * LTS: 'h:mm:ss aa', - * L: 'MM/DD/YYYY', - * LL: 'MMMM D YYYY', - * LLL: 'MMMM D YYYY h:mm aa', - * LLLL: 'dddd, MMMM D YYYY h:mm aa' - * }) - */ -function buildFormatLongFn (obj) { - var formatLongLocale = { - LTS: obj.LTS, - LT: obj.LT, - L: obj.L, - LL: obj.LL, - LLL: obj.LLL, - LLLL: obj.LLLL, - l: obj.l || buildShortLongFormat(obj.L), - ll: obj.ll || buildShortLongFormat(obj.LL), - lll: obj.lll || buildShortLongFormat(obj.LLL), - llll: obj.llll || buildShortLongFormat(obj.LLLL) - }; - - return function (token) { - return formatLongLocale[token] - } -} - -var formatLong = buildFormatLongFn({ - LT: 'h:mm aa', - LTS: 'h:mm:ss aa', - L: 'MM/DD/YYYY', - LL: 'MMMM D YYYY', - LLL: 'MMMM D YYYY h:mm aa', - LLLL: 'dddd, MMMM D YYYY h:mm aa' -}); - -var formatRelativeLocale = { - lastWeek: '[last] dddd [at] LT', - yesterday: '[yesterday at] LT', - today: '[today at] LT', - tomorrow: '[tomorrow at] LT', - nextWeek: 'dddd [at] LT', - other: 'L' -}; - -function formatRelative (token, date, baseDate, options) { - return formatRelativeLocale[token] -} - -/** - * @name buildLocalizeFn - * @category Locale Helpers - * @summary Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale. - * - * @description - * Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale - * used by `format` function. - * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). - * - * `localize.weekday` function takes the weekday index as argument (0 - Sunday). - * `localize.month` takes the month index (0 - January). - * `localize.timeOfDay` takes the hours. Use `indexCallback` to convert them to an array index (see example). - * - * @param {Object} values - the object with arrays of values - * @param {String} defaultType - the default type for the localize function - * @param {Function} [indexCallback] - the callback which takes the resulting function argument - * and converts it into value array index - * @returns {Function} the resulting function - * - * @example - * var timeOfDayValues = { - * uppercase: ['AM', 'PM'], - * lowercase: ['am', 'pm'], - * long: ['a.m.', 'p.m.'] - * } - * locale.localize.timeOfDay = buildLocalizeFn(timeOfDayValues, 'long', function (hours) { - * // 0 is a.m. array index, 1 is p.m. array index - * return (hours / 12) >= 1 ? 1 : 0 - * }) - * locale.localize.timeOfDay(16, {type: 'uppercase'}) //=> 'PM' - * locale.localize.timeOfDay(5) //=> 'a.m.' - */ -function buildLocalizeFn$1 (values, defaultType, indexCallback) { - return function (dirtyIndex, dirtyOptions) { - var options = dirtyOptions || {}; - var type = options.type ? String(options.type) : defaultType; - var valuesArray = values[type] || values[defaultType]; - var index = indexCallback ? indexCallback(Number(dirtyIndex)) : Number(dirtyIndex); - return valuesArray[index] - } -} - -/** - * @name buildLocalizeArrayFn - * @category Locale Helpers - * @summary Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. - * - * @description - * Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. - * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). - * - * @param {Object} values - the object with arrays of values - * @param {String} defaultType - the default type for the localize function - * @returns {Function} the resulting function - * - * @example - * var weekdayValues = { - * narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], - * short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - * long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] - * } - * locale.localize.weekdays = buildLocalizeArrayFn(weekdayValues, 'long') - * locale.localize.weekdays({type: 'narrow'}) //=> ['Su', 'Mo', ...] - * locale.localize.weekdays() //=> ['Sunday', 'Monday', ...] - */ -function buildLocalizeArrayFn$1 (values, defaultType) { - return function (dirtyOptions) { - var options = dirtyOptions || {}; - var type = options.type ? String(options.type) : defaultType; - return values[type] || values[defaultType] - } -} - -// Note: in English, the names of days of the week and months are capitalized. -// If you are making a new locale based on this one, check if the same is true for the language you're working on. -// Generally, formatted dates should look like they are in the middle of a sentence, -// e.g. in Spanish language the weekdays and months should be in the lowercase. -var weekdayValues = { - narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], - short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] -}; - -var monthValues = { - short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] -}; - -// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. -// Use the system which is used the most commonly in the locale. -// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: -// -// var timeOfDayValues = { -// any: ['in the night', 'in the morning', 'in the afternoon', 'in the evening'] -// } -// -// And later: -// -// var localize = { -// // The callback takes the hours as the argument and returns the array index -// timeOfDay: buildLocalizeFn(timeOfDayValues, 'any', function (hours) { -// if (hours >= 17) { -// return 3 -// } else if (hours >= 12) { -// return 2 -// } else if (hours >= 4) { -// return 1 -// } else { -// return 0 -// } -// }), -// timesOfDay: buildLocalizeArrayFn(timeOfDayValues, 'any') -// } -var timeOfDayValues = { - uppercase: ['AM', 'PM'], - lowercase: ['am', 'pm'], - long: ['a.m.', 'p.m.'] -}; - -function ordinalNumber (dirtyNumber, dirtyOptions) { - var number = Number(dirtyNumber); - - // If ordinal numbers depend on context, for example, - // if they are different for different grammatical genders, - // use `options.unit`: - // - // var options = dirtyOptions || {} - // var unit = String(options.unit) - // - // where `unit` can be 'month', 'quarter', 'week', 'isoWeek', 'dayOfYear', - // 'dayOfMonth' or 'dayOfWeek' - - var rem100 = number % 100; - if (rem100 > 20 || rem100 < 10) { - switch (rem100 % 10) { - case 1: - return number + 'st' - case 2: - return number + 'nd' - case 3: - return number + 'rd' - } - } - return number + 'th' -} - -var localize = { - ordinalNumber: ordinalNumber, - weekday: buildLocalizeFn$1(weekdayValues, 'long'), - weekdays: buildLocalizeArrayFn$1(weekdayValues, 'long'), - month: buildLocalizeFn$1(monthValues, 'long'), - months: buildLocalizeArrayFn$1(monthValues, 'long'), - timeOfDay: buildLocalizeFn$1(timeOfDayValues, 'long', function (hours) { - return (hours / 12) >= 1 ? 1 : 0 - }), - timesOfDay: buildLocalizeArrayFn$1(timeOfDayValues, 'long') -}; - -/** - * @name buildMatchFn - * @category Locale Helpers - * @summary Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale. - * - * @description - * Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale used by `parse` function. - * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). - * The result of the match function will be passed into corresponding parser function - * (`match.weekday`, `match.month` or `match.timeOfDay` respectively. See `buildParseFn`). - * - * @param {Object} values - the object with RegExps - * @param {String} defaultType - the default type for the match function - * @returns {Function} the resulting function - * - * @example - * var matchWeekdaysPatterns = { - * narrow: /^(su|mo|tu|we|th|fr|sa)/i, - * short: /^(sun|mon|tue|wed|thu|fri|sat)/i, - * long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i - * } - * locale.match.weekdays = buildMatchFn(matchWeekdaysPatterns, 'long') - * locale.match.weekdays('Sunday', {type: 'narrow'}) //=> ['Su', 'Su', ...] - * locale.match.weekdays('Sunday') //=> ['Sunday', 'Sunday', ...] - */ -function buildMatchFn$1 (patterns, defaultType) { - return function (dirtyString, dirtyOptions) { - var options = dirtyOptions || {}; - var type = options.type ? String(options.type) : defaultType; - var pattern = patterns[type] || patterns[defaultType]; - var string = String(dirtyString); - return string.match(pattern) - } -} - -/** - * @name buildParseFn - * @category Locale Helpers - * @summary Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale. - * - * @description - * Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale used by `parse` function. - * The argument of the resulting function is the result of the corresponding match function - * (`match.weekdays`, `match.months` or `match.timesOfDay` respectively. See `buildMatchFn`). - * - * @param {Object} values - the object with arrays of RegExps - * @param {String} defaultType - the default type for the parser function - * @returns {Function} the resulting function - * - * @example - * var parseWeekdayPatterns = { - * any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] - * } - * locale.match.weekday = buildParseFn(matchWeekdaysPatterns, 'long') - * var matchResult = locale.match.weekdays('Friday') - * locale.match.weekday(matchResult) //=> 5 - */ -function buildParseFn$1 (patterns, defaultType) { - return function (matchResult, dirtyOptions) { - var options = dirtyOptions || {}; - var type = options.type ? String(options.type) : defaultType; - var patternsArray = patterns[type] || patterns[defaultType]; - var string = matchResult[1]; - - return patternsArray.findIndex(function (pattern) { - return pattern.test(string) - }) - } -} - -/** - * @name buildMatchPatternFn - * @category Locale Helpers - * @summary Build match function from a single RegExp. - * - * @description - * Build match function from a single RegExp. - * Usually used for building `match.ordinalNumbers` property of the locale. - * - * @param {Object} pattern - the RegExp - * @returns {Function} the resulting function - * - * @example - * locale.match.ordinalNumbers = buildMatchPatternFn(/^(\d+)(th|st|nd|rd)?/i) - * locale.match.ordinalNumbers('3rd') //=> ['3rd', '3', 'rd', ...] - */ -function buildMatchPatternFn (pattern) { - return function (dirtyString) { - var string = String(dirtyString); - return string.match(pattern) - } -} - -/** - * @name parseDecimal - * @category Locale Helpers - * @summary Parses the match result into decimal number. - * - * @description - * Parses the match result into decimal number. - * Uses the string matched with the first set of parentheses of match RegExp. - * - * @param {Array} matchResult - the object returned by matching function - * @returns {Number} the parsed value - * - * @example - * locale.match = { - * ordinalNumbers: (dirtyString) { - * return String(dirtyString).match(/^(\d+)(th|st|nd|rd)?/i) - * }, - * ordinalNumber: parseDecimal - * } - */ -function parseDecimal (matchResult) { - return parseInt(matchResult[1], 10) -} - -var matchOrdinalNumbersPattern = /^(\d+)(th|st|nd|rd)?/i; - -var matchWeekdaysPatterns = { - narrow: /^(su|mo|tu|we|th|fr|sa)/i, - short: /^(sun|mon|tue|wed|thu|fri|sat)/i, - long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i -}; - -var parseWeekdayPatterns = { - any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] -}; - -var matchMonthsPatterns = { - short: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, - long: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i -}; - -var parseMonthPatterns = { - any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i] -}; - -// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. -// Use the system which is used the most commonly in the locale. -// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: -// -// var matchTimesOfDayPatterns = { -// long: /^((in the)? (night|morning|afternoon|evening?))/i -// } -// -// var parseTimeOfDayPatterns = { -// any: [/(night|morning)/i, /(afternoon|evening)/i] -// } -var matchTimesOfDayPatterns = { - short: /^(am|pm)/i, - long: /^([ap]\.?\s?m\.?)/i -}; - -var parseTimeOfDayPatterns = { - any: [/^a/i, /^p/i] -}; - -var match = { - ordinalNumbers: buildMatchPatternFn(matchOrdinalNumbersPattern), - ordinalNumber: parseDecimal, - weekdays: buildMatchFn$1(matchWeekdaysPatterns, 'long'), - weekday: buildParseFn$1(parseWeekdayPatterns, 'any'), - months: buildMatchFn$1(matchMonthsPatterns, 'long'), - month: buildParseFn$1(parseMonthPatterns, 'any'), - timesOfDay: buildMatchFn$1(matchTimesOfDayPatterns, 'long'), - timeOfDay: buildParseFn$1(parseTimeOfDayPatterns, 'any') -}; - -/** - * @type {Locale} - * @category Locales - * @summary English locale (United States). - * @language English - * @iso-639-2 eng - */ -var locale = { - formatDistance: formatDistance, - formatLong: formatLong, - formatRelative: formatRelative, - localize: localize, - match: match, - options: { - weekStartsOn: 0 /* Sunday */, - firstWeekContainsDate: 1 - } -}; - -var MILLISECONDS_IN_DAY$1 = 86400000; - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function getUTCDayOfYear (dirtyDate, dirtyOptions) { - var date = toDate(dirtyDate, dirtyOptions); - var timestamp = date.getTime(); - date.setUTCMonth(0, 1); - date.setUTCHours(0, 0, 0, 0); - var startOfYearTimestamp = date.getTime(); - var difference = timestamp - startOfYearTimestamp; - return Math.floor(difference / MILLISECONDS_IN_DAY$1) + 1 -} - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function startOfUTCISOWeek (dirtyDate, dirtyOptions) { - var weekStartsOn = 1; - - var date = toDate(dirtyDate, dirtyOptions); - var day = date.getUTCDay(); - var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; - - date.setUTCDate(date.getUTCDate() - diff); - date.setUTCHours(0, 0, 0, 0); - return date -} - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function getUTCISOWeekYear (dirtyDate, dirtyOptions) { - var date = toDate(dirtyDate, dirtyOptions); - var year = date.getUTCFullYear(); - - var fourthOfJanuaryOfNextYear = new Date(0); - fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); - fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); - var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear, dirtyOptions); - - var fourthOfJanuaryOfThisYear = new Date(0); - fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); - fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); - var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear, dirtyOptions); - - if (date.getTime() >= startOfNextYear.getTime()) { - return year + 1 - } else if (date.getTime() >= startOfThisYear.getTime()) { - return year - } else { - return year - 1 - } -} - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function startOfUTCISOWeekYear (dirtyDate, dirtyOptions) { - var year = getUTCISOWeekYear(dirtyDate, dirtyOptions); - var fourthOfJanuary = new Date(0); - fourthOfJanuary.setUTCFullYear(year, 0, 4); - fourthOfJanuary.setUTCHours(0, 0, 0, 0); - var date = startOfUTCISOWeek(fourthOfJanuary, dirtyOptions); - return date -} - -var MILLISECONDS_IN_WEEK$2 = 604800000; - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function getUTCISOWeek (dirtyDate, dirtyOptions) { - var date = toDate(dirtyDate, dirtyOptions); - var diff = startOfUTCISOWeek(date, dirtyOptions).getTime() - startOfUTCISOWeekYear(date, dirtyOptions).getTime(); - - // Round the number of days to the nearest integer - // because the number of milliseconds in a week is not constant - // (e.g. it's different in the week of the daylight saving time clock shift) - return Math.round(diff / MILLISECONDS_IN_WEEK$2) + 1 -} - -var formatters = { - // Month: 1, 2, ..., 12 - 'M': function (date) { - return date.getUTCMonth() + 1 - }, - - // Month: 1st, 2nd, ..., 12th - 'Mo': function (date, options) { - var month = date.getUTCMonth() + 1; - return options.locale.localize.ordinalNumber(month, {unit: 'month'}) - }, - - // Month: 01, 02, ..., 12 - 'MM': function (date) { - return addLeadingZeros(date.getUTCMonth() + 1, 2) - }, - - // Month: Jan, Feb, ..., Dec - 'MMM': function (date, options) { - return options.locale.localize.month(date.getUTCMonth(), {type: 'short'}) - }, - - // Month: January, February, ..., December - 'MMMM': function (date, options) { - return options.locale.localize.month(date.getUTCMonth(), {type: 'long'}) - }, - - // Quarter: 1, 2, 3, 4 - 'Q': function (date) { - return Math.ceil((date.getUTCMonth() + 1) / 3) - }, - - // Quarter: 1st, 2nd, 3rd, 4th - 'Qo': function (date, options) { - var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); - return options.locale.localize.ordinalNumber(quarter, {unit: 'quarter'}) - }, - - // Day of month: 1, 2, ..., 31 - 'D': function (date) { - return date.getUTCDate() - }, - - // Day of month: 1st, 2nd, ..., 31st - 'Do': function (date, options) { - return options.locale.localize.ordinalNumber(date.getUTCDate(), {unit: 'dayOfMonth'}) - }, - - // Day of month: 01, 02, ..., 31 - 'DD': function (date) { - return addLeadingZeros(date.getUTCDate(), 2) - }, - - // Day of year: 1, 2, ..., 366 - 'DDD': function (date) { - return getUTCDayOfYear(date) - }, - - // Day of year: 1st, 2nd, ..., 366th - 'DDDo': function (date, options) { - return options.locale.localize.ordinalNumber(getUTCDayOfYear(date), {unit: 'dayOfYear'}) - }, - - // Day of year: 001, 002, ..., 366 - 'DDDD': function (date) { - return addLeadingZeros(getUTCDayOfYear(date), 3) - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date, options) { - return options.locale.localize.weekday(date.getUTCDay(), {type: 'narrow'}) - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date, options) { - return options.locale.localize.weekday(date.getUTCDay(), {type: 'short'}) - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date, options) { - return options.locale.localize.weekday(date.getUTCDay(), {type: 'long'}) - }, - - // Day of week: 0, 1, ..., 6 - 'd': function (date) { - return date.getUTCDay() - }, - - // Day of week: 0th, 1st, 2nd, ..., 6th - 'do': function (date, options) { - return options.locale.localize.ordinalNumber(date.getUTCDay(), {unit: 'dayOfWeek'}) - }, - - // Day of ISO week: 1, 2, ..., 7 - 'E': function (date) { - return date.getUTCDay() || 7 - }, - - // ISO week: 1, 2, ..., 53 - 'W': function (date) { - return getUTCISOWeek(date) - }, - - // ISO week: 1st, 2nd, ..., 53th - 'Wo': function (date, options) { - return options.locale.localize.ordinalNumber(getUTCISOWeek(date), {unit: 'isoWeek'}) - }, - - // ISO week: 01, 02, ..., 53 - 'WW': function (date) { - return addLeadingZeros(getUTCISOWeek(date), 2) - }, - - // Year: 00, 01, ..., 99 - 'YY': function (date) { - return addLeadingZeros(date.getUTCFullYear(), 4).substr(2) - }, - - // Year: 1900, 1901, ..., 2099 - 'YYYY': function (date) { - return addLeadingZeros(date.getUTCFullYear(), 4) - }, - - // ISO week-numbering year: 00, 01, ..., 99 - 'GG': function (date) { - return String(getUTCISOWeekYear(date)).substr(2) - }, - - // ISO week-numbering year: 1900, 1901, ..., 2099 - 'GGGG': function (date) { - return getUTCISOWeekYear(date) - }, - - // Hour: 0, 1, ... 23 - 'H': function (date) { - return date.getUTCHours() - }, - - // Hour: 00, 01, ..., 23 - 'HH': function (date) { - return addLeadingZeros(date.getUTCHours(), 2) - }, - - // Hour: 1, 2, ..., 12 - 'h': function (date) { - var hours = date.getUTCHours(); - if (hours === 0) { - return 12 - } else if (hours > 12) { - return hours % 12 - } else { - return hours - } - }, - - // Hour: 01, 02, ..., 12 - 'hh': function (date) { - return addLeadingZeros(formatters['h'](date), 2) - }, - - // Minute: 0, 1, ..., 59 - 'm': function (date) { - return date.getUTCMinutes() - }, - - // Minute: 00, 01, ..., 59 - 'mm': function (date) { - return addLeadingZeros(date.getUTCMinutes(), 2) - }, - - // Second: 0, 1, ..., 59 - 's': function (date) { - return date.getUTCSeconds() - }, - - // Second: 00, 01, ..., 59 - 'ss': function (date) { - return addLeadingZeros(date.getUTCSeconds(), 2) - }, - - // 1/10 of second: 0, 1, ..., 9 - 'S': function (date) { - return Math.floor(date.getUTCMilliseconds() / 100) - }, - - // 1/100 of second: 00, 01, ..., 99 - 'SS': function (date) { - return addLeadingZeros(Math.floor(date.getUTCMilliseconds() / 10), 2) - }, - - // Millisecond: 000, 001, ..., 999 - 'SSS': function (date) { - return addLeadingZeros(date.getUTCMilliseconds(), 3) - }, - - // Timezone: -01:00, +00:00, ... +12:00 - 'Z': function (date, options) { - var originalDate = options._originalDate || date; - return formatTimezone(originalDate.getTimezoneOffset(), ':') - }, - - // Timezone: -0100, +0000, ... +1200 - 'ZZ': function (date, options) { - var originalDate = options._originalDate || date; - return formatTimezone(originalDate.getTimezoneOffset()) - }, - - // Seconds timestamp: 512969520 - 'X': function (date, options) { - var originalDate = options._originalDate || date; - return Math.floor(originalDate.getTime() / 1000) - }, - - // Milliseconds timestamp: 512969520900 - 'x': function (date, options) { - var originalDate = options._originalDate || date; - return originalDate.getTime() - }, - - // AM, PM - 'A': function (date, options) { - return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'uppercase'}) - }, - - // am, pm - 'a': function (date, options) { - return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'lowercase'}) - }, - - // a.m., p.m. - 'aa': function (date, options) { - return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'long'}) - } -}; - -function formatTimezone (offset, delimeter) { - delimeter = delimeter || ''; - var sign = offset > 0 ? '-' : '+'; - var absOffset = Math.abs(offset); - var hours = Math.floor(absOffset / 60); - var minutes = absOffset % 60; - return sign + addLeadingZeros(hours, 2) + delimeter + addLeadingZeros(minutes, 2) -} - -function addLeadingZeros (number, targetLength) { - var output = Math.abs(number).toString(); - while (output.length < targetLength) { - output = '0' + output; - } - return output -} - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function addUTCMinutes (dirtyDate, dirtyAmount, dirtyOptions) { - var date = toDate(dirtyDate, dirtyOptions); - var amount = Number(dirtyAmount); - date.setUTCMinutes(date.getUTCMinutes() + amount); - return date -} - -var longFormattingTokensRegExp = /(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g; -var defaultFormattingTokensRegExp = /(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g; - -/** - * @name format - * @category Common Helpers - * @summary Format the date. - * - * @description - * Return the formatted date string in the given format. - * - * Accepted tokens: - * | Unit | Token | Result examples | - * |-------------------------|-------|----------------------------------| - * | Month | M | 1, 2, ..., 12 | - * | | Mo | 1st, 2nd, ..., 12th | - * | | MM | 01, 02, ..., 12 | - * | | MMM | Jan, Feb, ..., Dec | - * | | MMMM | January, February, ..., December | - * | Quarter | Q | 1, 2, 3, 4 | - * | | Qo | 1st, 2nd, 3rd, 4th | - * | Day of month | D | 1, 2, ..., 31 | - * | | Do | 1st, 2nd, ..., 31st | - * | | DD | 01, 02, ..., 31 | - * | Day of year | DDD | 1, 2, ..., 366 | - * | | DDDo | 1st, 2nd, ..., 366th | - * | | DDDD | 001, 002, ..., 366 | - * | Day of week | d | 0, 1, ..., 6 | - * | | do | 0th, 1st, ..., 6th | - * | | dd | Su, Mo, ..., Sa | - * | | ddd | Sun, Mon, ..., Sat | - * | | dddd | Sunday, Monday, ..., Saturday | - * | Day of ISO week | E | 1, 2, ..., 7 | - * | ISO week | W | 1, 2, ..., 53 | - * | | Wo | 1st, 2nd, ..., 53rd | - * | | WW | 01, 02, ..., 53 | - * | Year | YY | 00, 01, ..., 99 | - * | | YYYY | 1900, 1901, ..., 2099 | - * | ISO week-numbering year | GG | 00, 01, ..., 99 | - * | | GGGG | 1900, 1901, ..., 2099 | - * | AM/PM | A | AM, PM | - * | | a | am, pm | - * | | aa | a.m., p.m. | - * | Hour | H | 0, 1, ... 23 | - * | | HH | 00, 01, ... 23 | - * | | h | 1, 2, ..., 12 | - * | | hh | 01, 02, ..., 12 | - * | Minute | m | 0, 1, ..., 59 | - * | | mm | 00, 01, ..., 59 | - * | Second | s | 0, 1, ..., 59 | - * | | ss | 00, 01, ..., 59 | - * | 1/10 of second | S | 0, 1, ..., 9 | - * | 1/100 of second | SS | 00, 01, ..., 99 | - * | Millisecond | SSS | 000, 001, ..., 999 | - * | Timezone | Z | -01:00, +00:00, ... +12:00 | - * | | ZZ | -0100, +0000, ..., +1200 | - * | Seconds timestamp | X | 512969520 | - * | Milliseconds timestamp | x | 512969520900 | - * | Long format | LT | 05:30 a.m. | - * | | LTS | 05:30:15 a.m. | - * | | L | 07/02/1995 | - * | | l | 7/2/1995 | - * | | LL | July 2 1995 | - * | | ll | Jul 2 1995 | - * | | LLL | July 2 1995 05:30 a.m. | - * | | lll | Jul 2 1995 05:30 a.m. | - * | | LLLL | Sunday, July 2 1995 05:30 a.m. | - * | | llll | Sun, Jul 2 1995 05:30 a.m. | - * - * The characters wrapped in square brackets are escaped. - * - * The result may vary by locale. - * - * @param {Date|String|Number} date - the original date - * @param {String} format - the string of tokens - * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} - * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @returns {String} the formatted date string - * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 - * @throws {RangeError} `options.locale` must contain `localize` property - * @throws {RangeError} `options.locale` must contain `formatLong` property - * - * @example - * // Represent 11 February 2014 in middle-endian format: - * var result = format( - * new Date(2014, 1, 11), - * 'MM/DD/YYYY' - * ) - * //=> '02/11/2014' - * - * @example - * // Represent 2 July 2014 in Esperanto: - * import { eoLocale } from 'date-fns/locale/eo' - * var result = format( - * new Date(2014, 6, 2), - * 'Do [de] MMMM YYYY', - * {locale: eoLocale} - * ) - * //=> '2-a de julio 2014' - */ -function format (dirtyDate, dirtyFormatStr, dirtyOptions) { - var formatStr = String(dirtyFormatStr); - var options = dirtyOptions || {}; - - var locale$$1 = options.locale || locale; - - if (!locale$$1.localize) { - throw new RangeError('locale must contain localize property') - } - - if (!locale$$1.formatLong) { - throw new RangeError('locale must contain formatLong property') - } - - var localeFormatters = locale$$1.formatters || {}; - var formattingTokensRegExp = locale$$1.formattingTokensRegExp || defaultFormattingTokensRegExp; - var formatLong = locale$$1.formatLong; - - var originalDate = toDate(dirtyDate, options); - - if (!isValid(originalDate, options)) { - return 'Invalid Date' - } - - // Convert the date in system timezone to the same date in UTC+00:00 timezone. - // This ensures that when UTC functions will be implemented, locales will be compatible with them. - // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376 - var timezoneOffset = originalDate.getTimezoneOffset(); - var utcDate = addUTCMinutes(originalDate, -timezoneOffset, options); - - var formatterOptions = cloneObject(options); - formatterOptions.locale = locale$$1; - formatterOptions.formatters = formatters; - - // When UTC functions will be implemented, options._originalDate will likely be a part of public API. - // Right now, please don't use it in locales. If you have to use an original date, - // please restore it from `date`, adding a timezone offset to it. - formatterOptions._originalDate = originalDate; - - var result = formatStr - .replace(longFormattingTokensRegExp, function (substring) { - if (substring[0] === '[') { - return substring - } - - if (substring[0] === '\\') { - return cleanEscapedString(substring) - } - - return formatLong(substring) - }) - .replace(formattingTokensRegExp, function (substring) { - var formatter = localeFormatters[substring] || formatters[substring]; - - if (formatter) { - return formatter(utcDate, formatterOptions) - } else { - return cleanEscapedString(substring) - } - }); - - return result -} - -function cleanEscapedString (input) { - if (input.match(/\[[\s\S]/)) { - return input.replace(/^\[|]$/g, '') - } - return input.replace(/\\/g, '') -} - -/** - * @name subMinutes - * @category Minute Helpers - * @summary Subtract the specified number of minutes from the given date. - * - * @description - * Subtract the specified number of minutes from the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of minutes to be subtracted - * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} - * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} - * @returns {Date} the new date with the mintues subtracted - * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 - * - * @example - * // Subtract 30 minutes from 10 July 2014 12:00:00: - * var result = subMinutes(new Date(2014, 6, 10, 12, 0), 30) - * //=> Thu Jul 10 2014 11:30:00 - */ -function subMinutes (dirtyDate, dirtyAmount, dirtyOptions) { - var amount = Number(dirtyAmount); - return addMinutes(dirtyDate, -amount, dirtyOptions) -} - -var patterns$1 = { - 'M': /^(1[0-2]|0?\d)/, // 0 to 12 - 'D': /^(3[0-1]|[0-2]?\d)/, // 0 to 31 - 'DDD': /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366 - 'W': /^(5[0-3]|[0-4]?\d)/, // 0 to 53 - 'YYYY': /^(\d{1,4})/, // 0 to 9999 - 'H': /^(2[0-3]|[0-1]?\d)/, // 0 to 23 - 'm': /^([0-5]?\d)/, // 0 to 59 - 'Z': /^([+-])(\d{2}):(\d{2})/, - 'ZZ': /^([+-])(\d{2})(\d{2})/, - singleDigit: /^(\d)/, - twoDigits: /^(\d{2})/, - threeDigits: /^(\d{3})/, - fourDigits: /^(\d{4})/, - anyDigits: /^(\d+)/ -}; - -function parseDecimal$1 (matchResult) { - return parseInt(matchResult[1], 10) -} - -var parsers = { - // Year: 00, 01, ..., 99 - 'YY': { - unit: 'twoDigitYear', - match: patterns$1.twoDigits, - parse: function (matchResult) { - return parseDecimal$1(matchResult) - } - }, - - // Year: 1900, 1901, ..., 2099 - 'YYYY': { - unit: 'year', - match: patterns$1.YYYY, - parse: parseDecimal$1 - }, - - // ISO week-numbering year: 00, 01, ..., 99 - 'GG': { - unit: 'isoYear', - match: patterns$1.twoDigits, - parse: function (matchResult) { - return parseDecimal$1(matchResult) + 1900 - } - }, - - // ISO week-numbering year: 1900, 1901, ..., 2099 - 'GGGG': { - unit: 'isoYear', - match: patterns$1.YYYY, - parse: parseDecimal$1 - }, - - // Quarter: 1, 2, 3, 4 - 'Q': { - unit: 'quarter', - match: patterns$1.singleDigit, - parse: parseDecimal$1 - }, - - // Ordinal quarter - 'Qo': { - unit: 'quarter', - match: function (string, options) { - return options.locale.match.ordinalNumbers(string, {unit: 'quarter'}) - }, - parse: function (matchResult, options) { - return options.locale.match.ordinalNumber(matchResult, {unit: 'quarter'}) - } - }, - - // Month: 1, 2, ..., 12 - 'M': { - unit: 'month', - match: patterns$1.M, - parse: function (matchResult) { - return parseDecimal$1(matchResult) - 1 - } - }, - - // Ordinal month - 'Mo': { - unit: 'month', - match: function (string, options) { - return options.locale.match.ordinalNumbers(string, {unit: 'month'}) - }, - parse: function (matchResult, options) { - return options.locale.match.ordinalNumber(matchResult, {unit: 'month'}) - 1 - } - }, - - // Month: 01, 02, ..., 12 - 'MM': { - unit: 'month', - match: patterns$1.twoDigits, - parse: function (matchResult) { - return parseDecimal$1(matchResult) - 1 - } - }, - - // Month: Jan, Feb, ..., Dec - 'MMM': { - unit: 'month', - match: function (string, options) { - return options.locale.match.months(string, {type: 'short'}) - }, - parse: function (matchResult, options) { - return options.locale.match.month(matchResult, {type: 'short'}) - } - }, - - // Month: January, February, ..., December - 'MMMM': { - unit: 'month', - match: function (string, options) { - return options.locale.match.months(string, {type: 'long'}) || - options.locale.match.months(string, {type: 'short'}) - }, - parse: function (matchResult, options) { - var parseResult = options.locale.match.month(matchResult, {type: 'long'}); - - if (parseResult == null) { - parseResult = options.locale.match.month(matchResult, {type: 'short'}); - } - - return parseResult - } - }, - - // ISO week: 1, 2, ..., 53 - 'W': { - unit: 'isoWeek', - match: patterns$1.W, - parse: parseDecimal$1 - }, - - // Ordinal ISO week - 'Wo': { - unit: 'isoWeek', - match: function (string, options) { - return options.locale.match.ordinalNumbers(string, {unit: 'isoWeek'}) - }, - parse: function (matchResult, options) { - return options.locale.match.ordinalNumber(matchResult, {unit: 'isoWeek'}) - } - }, - - // ISO week: 01, 02, ..., 53 - 'WW': { - unit: 'isoWeek', - match: patterns$1.twoDigits, - parse: parseDecimal$1 - }, - - // Day of week: 0, 1, ..., 6 - 'd': { - unit: 'dayOfWeek', - match: patterns$1.singleDigit, - parse: parseDecimal$1 - }, - - // Ordinal day of week - 'do': { - unit: 'dayOfWeek', - match: function (string, options) { - return options.locale.match.ordinalNumbers(string, {unit: 'dayOfWeek'}) - }, - parse: function (matchResult, options) { - return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfWeek'}) - } - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': { - unit: 'dayOfWeek', - match: function (string, options) { - return options.locale.match.weekdays(string, {type: 'narrow'}) - }, - parse: function (matchResult, options) { - return options.locale.match.weekday(matchResult, {type: 'narrow'}) - } - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': { - unit: 'dayOfWeek', - match: function (string, options) { - return options.locale.match.weekdays(string, {type: 'short'}) || - options.locale.match.weekdays(string, {type: 'narrow'}) - }, - parse: function (matchResult, options) { - var parseResult = options.locale.match.weekday(matchResult, {type: 'short'}); - - if (parseResult == null) { - parseResult = options.locale.match.weekday(matchResult, {type: 'narrow'}); - } - - return parseResult - } - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': { - unit: 'dayOfWeek', - match: function (string, options) { - return options.locale.match.weekdays(string, {type: 'long'}) || - options.locale.match.weekdays(string, {type: 'short'}) || - options.locale.match.weekdays(string, {type: 'narrow'}) - }, - parse: function (matchResult, options) { - var parseResult = options.locale.match.weekday(matchResult, {type: 'long'}); - - if (parseResult == null) { - parseResult = options.locale.match.weekday(matchResult, {type: 'short'}); - - if (parseResult == null) { - parseResult = options.locale.match.weekday(matchResult, {type: 'narrow'}); - } - } - - return parseResult - } - }, - - // Day of ISO week: 1, 2, ..., 7 - 'E': { - unit: 'dayOfISOWeek', - match: patterns$1.singleDigit, - parse: function (matchResult) { - return parseDecimal$1(matchResult) - } - }, - - // Day of month: 1, 2, ..., 31 - 'D': { - unit: 'dayOfMonth', - match: patterns$1.D, - parse: parseDecimal$1 - }, - - // Ordinal day of month - 'Do': { - unit: 'dayOfMonth', - match: function (string, options) { - return options.locale.match.ordinalNumbers(string, {unit: 'dayOfMonth'}) - }, - parse: function (matchResult, options) { - return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfMonth'}) - } - }, - - // Day of month: 01, 02, ..., 31 - 'DD': { - unit: 'dayOfMonth', - match: patterns$1.twoDigits, - parse: parseDecimal$1 - }, - - // Day of year: 1, 2, ..., 366 - 'DDD': { - unit: 'dayOfYear', - match: patterns$1.DDD, - parse: parseDecimal$1 - }, - - // Ordinal day of year - 'DDDo': { - unit: 'dayOfYear', - match: function (string, options) { - return options.locale.match.ordinalNumbers(string, {unit: 'dayOfYear'}) - }, - parse: function (matchResult, options) { - return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfYear'}) - } - }, - - // Day of year: 001, 002, ..., 366 - 'DDDD': { - unit: 'dayOfYear', - match: patterns$1.threeDigits, - parse: parseDecimal$1 - }, - - // AM, PM - 'A': { - unit: 'timeOfDay', - match: function (string, options) { - return options.locale.match.timesOfDay(string, {type: 'short'}) - }, - parse: function (matchResult, options) { - return options.locale.match.timeOfDay(matchResult, {type: 'short'}) - } - }, - - // a.m., p.m. - 'aa': { - unit: 'timeOfDay', - match: function (string, options) { - return options.locale.match.timesOfDay(string, {type: 'long'}) || - options.locale.match.timesOfDay(string, {type: 'short'}) - }, - parse: function (matchResult, options) { - var parseResult = options.locale.match.timeOfDay(matchResult, {type: 'long'}); - - if (parseResult == null) { - parseResult = options.locale.match.timeOfDay(matchResult, {type: 'short'}); - } - - return parseResult - } - }, - - // Hour: 0, 1, ... 23 - 'H': { - unit: 'hours', - match: patterns$1.H, - parse: parseDecimal$1 - }, - - // Hour: 00, 01, ..., 23 - 'HH': { - unit: 'hours', - match: patterns$1.twoDigits, - parse: parseDecimal$1 - }, - - // Hour: 1, 2, ..., 12 - 'h': { - unit: 'timeOfDayHours', - match: patterns$1.M, - parse: parseDecimal$1 - }, - - // Hour: 01, 02, ..., 12 - 'hh': { - unit: 'timeOfDayHours', - match: patterns$1.twoDigits, - parse: parseDecimal$1 - }, - - // Minute: 0, 1, ..., 59 - 'm': { - unit: 'minutes', - match: patterns$1.m, - parse: parseDecimal$1 - }, - - // Minute: 00, 01, ..., 59 - 'mm': { - unit: 'minutes', - match: patterns$1.twoDigits, - parse: parseDecimal$1 - }, - - // Second: 0, 1, ..., 59 - 's': { - unit: 'seconds', - match: patterns$1.m, - parse: parseDecimal$1 - }, - - // Second: 00, 01, ..., 59 - 'ss': { - unit: 'seconds', - match: patterns$1.twoDigits, - parse: parseDecimal$1 - }, - - // 1/10 of second: 0, 1, ..., 9 - 'S': { - unit: 'milliseconds', - match: patterns$1.singleDigit, - parse: function (matchResult) { - return parseDecimal$1(matchResult) * 100 - } - }, - - // 1/100 of second: 00, 01, ..., 99 - 'SS': { - unit: 'milliseconds', - match: patterns$1.twoDigits, - parse: function (matchResult) { - return parseDecimal$1(matchResult) * 10 - } - }, - - // Millisecond: 000, 001, ..., 999 - 'SSS': { - unit: 'milliseconds', - match: patterns$1.threeDigits, - parse: parseDecimal$1 - }, - - // Timezone: -01:00, +00:00, ... +12:00 - 'Z': { - unit: 'timezone', - match: patterns$1.Z, - parse: function (matchResult) { - var sign = matchResult[1]; - var hours = parseInt(matchResult[2], 10); - var minutes = parseInt(matchResult[3], 10); - var absoluteOffset = hours * 60 + minutes; - return (sign === '+') ? absoluteOffset : -absoluteOffset - } - }, - - // Timezone: -0100, +0000, ... +1200 - 'ZZ': { - unit: 'timezone', - match: patterns$1.ZZ, - parse: function (matchResult) { - var sign = matchResult[1]; - var hours = parseInt(matchResult[2], 10); - var minutes = parseInt(matchResult[3], 10); - var absoluteOffset = hours * 60 + minutes; - return (sign === '+') ? absoluteOffset : -absoluteOffset - } - }, - - // Seconds timestamp: 512969520 - 'X': { - unit: 'timestamp', - match: patterns$1.anyDigits, - parse: function (matchResult) { - return parseDecimal$1(matchResult) * 1000 - } - }, - - // Milliseconds timestamp: 512969520900 - 'x': { - unit: 'timestamp', - match: patterns$1.anyDigits, - parse: parseDecimal$1 - } -}; - -parsers['a'] = parsers['A']; - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function setUTCDay (dirtyDate, dirtyDay, dirtyOptions) { - var options = dirtyOptions || {}; - var locale = options.locale; - var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; - var defaultWeekStartsOn = localeWeekStartsOn === undefined ? 0 : Number(localeWeekStartsOn); - var weekStartsOn = options.weekStartsOn === undefined ? defaultWeekStartsOn : Number(options.weekStartsOn); - - // Test if weekStartsOn is between 0 and 6 _and_ is not NaN - if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { - throw new RangeError('weekStartsOn must be between 0 and 6 inclusively') - } - - var date = toDate(dirtyDate, dirtyOptions); - var day = Number(dirtyDay); - - var currentDay = date.getUTCDay(); - - var remainder = day % 7; - var dayIndex = (remainder + 7) % 7; - - var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; - - date.setUTCDate(date.getUTCDate() + diff); - return date -} - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function setUTCISODay (dirtyDate, dirtyDay, dirtyOptions) { - var day = Number(dirtyDay); - - if (day % 7 === 0) { - day = day - 7; - } - - var weekStartsOn = 1; - var date = toDate(dirtyDate, dirtyOptions); - var currentDay = date.getUTCDay(); - - var remainder = day % 7; - var dayIndex = (remainder + 7) % 7; - - var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; - - date.setUTCDate(date.getUTCDate() + diff); - return date -} - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function setUTCISOWeek (dirtyDate, dirtyISOWeek, dirtyOptions) { - var date = toDate(dirtyDate, dirtyOptions); - var isoWeek = Number(dirtyISOWeek); - var diff = getUTCISOWeek(date, dirtyOptions) - isoWeek; - date.setUTCDate(date.getUTCDate() - diff * 7); - return date -} - -var MILLISECONDS_IN_DAY$3 = 86400000; - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function setUTCISOWeekYear (dirtyDate, dirtyISOYear, dirtyOptions) { - var date = toDate(dirtyDate, dirtyOptions); - var isoYear = Number(dirtyISOYear); - var dateStartOfYear = startOfUTCISOWeekYear(date, dirtyOptions); - var diff = Math.floor((date.getTime() - dateStartOfYear.getTime()) / MILLISECONDS_IN_DAY$3); - var fourthOfJanuary = new Date(0); - fourthOfJanuary.setUTCFullYear(isoYear, 0, 4); - fourthOfJanuary.setUTCHours(0, 0, 0, 0); - date = startOfUTCISOWeekYear(fourthOfJanuary, dirtyOptions); - date.setUTCDate(date.getUTCDate() + diff); - return date -} - -var MILLISECONDS_IN_MINUTE$7 = 60000; - -function setTimeOfDay (hours, timeOfDay) { - var isAM = timeOfDay === 0; - - if (isAM) { - if (hours === 12) { - return 0 - } - } else { - if (hours !== 12) { - return 12 + hours - } - } - - return hours -} - -var units = { - twoDigitYear: { - priority: 10, - set: function (dateValues, value) { - var century = Math.floor(dateValues.date.getUTCFullYear() / 100); - var year = century * 100 + value; - dateValues.date.setUTCFullYear(year, 0, 1); - dateValues.date.setUTCHours(0, 0, 0, 0); - return dateValues - } - }, - - year: { - priority: 10, - set: function (dateValues, value) { - dateValues.date.setUTCFullYear(value, 0, 1); - dateValues.date.setUTCHours(0, 0, 0, 0); - return dateValues - } - }, - - isoYear: { - priority: 10, - set: function (dateValues, value, options) { - dateValues.date = startOfUTCISOWeekYear(setUTCISOWeekYear(dateValues.date, value, options), options); - return dateValues - } - }, - - quarter: { - priority: 20, - set: function (dateValues, value) { - dateValues.date.setUTCMonth((value - 1) * 3, 1); - dateValues.date.setUTCHours(0, 0, 0, 0); - return dateValues - } - }, - - month: { - priority: 30, - set: function (dateValues, value) { - dateValues.date.setUTCMonth(value, 1); - dateValues.date.setUTCHours(0, 0, 0, 0); - return dateValues - } - }, - - isoWeek: { - priority: 40, - set: function (dateValues, value, options) { - dateValues.date = startOfUTCISOWeek(setUTCISOWeek(dateValues.date, value, options), options); - return dateValues - } - }, - - dayOfWeek: { - priority: 50, - set: function (dateValues, value, options) { - dateValues.date = setUTCDay(dateValues.date, value, options); - dateValues.date.setUTCHours(0, 0, 0, 0); - return dateValues - } - }, - - dayOfISOWeek: { - priority: 50, - set: function (dateValues, value, options) { - dateValues.date = setUTCISODay(dateValues.date, value, options); - dateValues.date.setUTCHours(0, 0, 0, 0); - return dateValues - } - }, - - dayOfMonth: { - priority: 50, - set: function (dateValues, value) { - dateValues.date.setUTCDate(value); - dateValues.date.setUTCHours(0, 0, 0, 0); - return dateValues - } - }, - - dayOfYear: { - priority: 50, - set: function (dateValues, value) { - dateValues.date.setUTCMonth(0, value); - dateValues.date.setUTCHours(0, 0, 0, 0); - return dateValues - } - }, - - timeOfDay: { - priority: 60, - set: function (dateValues, value, options) { - dateValues.timeOfDay = value; - return dateValues - } - }, - - hours: { - priority: 70, - set: function (dateValues, value, options) { - dateValues.date.setUTCHours(value, 0, 0, 0); - return dateValues - } - }, - - timeOfDayHours: { - priority: 70, - set: function (dateValues, value, options) { - var timeOfDay = dateValues.timeOfDay; - if (timeOfDay != null) { - value = setTimeOfDay(value, timeOfDay); - } - dateValues.date.setUTCHours(value, 0, 0, 0); - return dateValues - } - }, - - minutes: { - priority: 80, - set: function (dateValues, value) { - dateValues.date.setUTCMinutes(value, 0, 0); - return dateValues - } - }, - - seconds: { - priority: 90, - set: function (dateValues, value) { - dateValues.date.setUTCSeconds(value, 0); - return dateValues - } - }, - - milliseconds: { - priority: 100, - set: function (dateValues, value) { - dateValues.date.setUTCMilliseconds(value); - return dateValues - } - }, - - timezone: { - priority: 110, - set: function (dateValues, value) { - dateValues.date = new Date(dateValues.date.getTime() - value * MILLISECONDS_IN_MINUTE$7); - return dateValues - } - }, - - timestamp: { - priority: 120, - set: function (dateValues, value) { - dateValues.date = new Date(value); - return dateValues - } - } -}; - -var TIMEZONE_UNIT_PRIORITY = 110; -var MILLISECONDS_IN_MINUTE$6 = 60000; - -var longFormattingTokensRegExp$1 = /(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g; -var defaultParsingTokensRegExp = /(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g; - -/** - * @name parse - * @category Common Helpers - * @summary Parse the date. - * - * @description - * Return the date parsed from string using the given format. - * - * Accepted format tokens: - * | Unit | Priority | Token | Input examples | - * |-------------------------|----------|-------|----------------------------------| - * | Year | 10 | YY | 00, 01, ..., 99 | - * | | | YYYY | 1900, 1901, ..., 2099 | - * | ISO week-numbering year | 10 | GG | 00, 01, ..., 99 | - * | | | GGGG | 1900, 1901, ..., 2099 | - * | Quarter | 20 | Q | 1, 2, 3, 4 | - * | | | Qo | 1st, 2nd, 3rd, 4th | - * | Month | 30 | M | 1, 2, ..., 12 | - * | | | Mo | 1st, 2nd, ..., 12th | - * | | | MM | 01, 02, ..., 12 | - * | | | MMM | Jan, Feb, ..., Dec | - * | | | MMMM | January, February, ..., December | - * | ISO week | 40 | W | 1, 2, ..., 53 | - * | | | Wo | 1st, 2nd, ..., 53rd | - * | | | WW | 01, 02, ..., 53 | - * | Day of week | 50 | d | 0, 1, ..., 6 | - * | | | do | 0th, 1st, ..., 6th | - * | | | dd | Su, Mo, ..., Sa | - * | | | ddd | Sun, Mon, ..., Sat | - * | | | dddd | Sunday, Monday, ..., Saturday | - * | Day of ISO week | 50 | E | 1, 2, ..., 7 | - * | Day of month | 50 | D | 1, 2, ..., 31 | - * | | | Do | 1st, 2nd, ..., 31st | - * | | | DD | 01, 02, ..., 31 | - * | Day of year | 50 | DDD | 1, 2, ..., 366 | - * | | | DDDo | 1st, 2nd, ..., 366th | - * | | | DDDD | 001, 002, ..., 366 | - * | Time of day | 60 | A | AM, PM | - * | | | a | am, pm | - * | | | aa | a.m., p.m. | - * | Hour | 70 | H | 0, 1, ... 23 | - * | | | HH | 00, 01, ... 23 | - * | Time of day hour | 70 | h | 1, 2, ..., 12 | - * | | | hh | 01, 02, ..., 12 | - * | Minute | 80 | m | 0, 1, ..., 59 | - * | | | mm | 00, 01, ..., 59 | - * | Second | 90 | s | 0, 1, ..., 59 | - * | | | ss | 00, 01, ..., 59 | - * | 1/10 of second | 100 | S | 0, 1, ..., 9 | - * | 1/100 of second | 100 | SS | 00, 01, ..., 99 | - * | Millisecond | 100 | SSS | 000, 001, ..., 999 | - * | Timezone | 110 | Z | -01:00, +00:00, ... +12:00 | - * | | | ZZ | -0100, +0000, ..., +1200 | - * | Seconds timestamp | 120 | X | 512969520 | - * | Milliseconds timestamp | 120 | x | 512969520900 | - * - * Values will be assigned to the date in the ascending order of its unit's priority. - * Units of an equal priority overwrite each other in the order of appearance. - * - * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year), - * the values will be taken from 3rd argument `baseDate` which works as a context of parsing. - * - * `baseDate` must be passed for correct work of the function. - * If you're not sure which `baseDate` to supply, create a new instance of Date: - * `parse('02/11/2014', 'MM/DD/YYYY', new Date())` - * In this case parsing will be done in the context of the current date. - * If `baseDate` is `Invalid Date` or a value not convertible to valid `Date`, - * then `Invalid Date` will be returned. - * - * Also, `parse` unfolds long formats like those in [format]{@link https://date-fns.org/docs/format}: - * | Token | Input examples | - * |-------|--------------------------------| - * | LT | 05:30 a.m. | - * | LTS | 05:30:15 a.m. | - * | L | 07/02/1995 | - * | l | 7/2/1995 | - * | LL | July 2 1995 | - * | ll | Jul 2 1995 | - * | LLL | July 2 1995 05:30 a.m. | - * | lll | Jul 2 1995 05:30 a.m. | - * | LLLL | Sunday, July 2 1995 05:30 a.m. | - * | llll | Sun, Jul 2 1995 05:30 a.m. | - * - * The characters wrapped in square brackets in the format string are escaped. - * - * The result may vary by locale. - * - * If `formatString` matches with `dateString` but does not provides tokens, `baseDate` will be returned. - * - * If parsing failed, `Invalid Date` will be returned. - * Invalid Date is a Date, whose time value is NaN. - * Time value of Date: http://es5.github.io/#x15.9.1.1 - * - * @param {String} dateString - the string to parse - * @param {String} formatString - the string of tokens - * @param {Date|String|Number} baseDate - the date to took the missing higher priority values from - * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} - * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Date} the parsed date - * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 - * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 - * @throws {RangeError} `options.locale` must contain `match` property - * @throws {RangeError} `options.locale` must contain `formatLong` property - * - * @example - * // Parse 11 February 2014 from middle-endian format: - * var result = parse( - * '02/11/2014', - * 'MM/DD/YYYY', - * new Date() - * ) - * //=> Tue Feb 11 2014 00:00:00 - * - * @example - * // Parse 28th of February in English locale in the context of 2010 year: - * import eoLocale from 'date-fns/locale/eo' - * var result = parse( - * '28-a de februaro', - * 'Do [de] MMMM', - * new Date(2010, 0, 1) - * {locale: eoLocale} - * ) - * //=> Sun Feb 28 2010 00:00:00 - */ -function parse (dirtyDateString, dirtyFormatString, dirtyBaseDate, dirtyOptions) { - var dateString = String(dirtyDateString); - var options = dirtyOptions || {}; - - var weekStartsOn = options.weekStartsOn === undefined ? 0 : Number(options.weekStartsOn); - - // Test if weekStartsOn is between 0 and 6 _and_ is not NaN - if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { - throw new RangeError('weekStartsOn must be between 0 and 6 inclusively') - } - - var locale$$1 = options.locale || locale; - var localeParsers = locale$$1.parsers || {}; - var localeUnits = locale$$1.units || {}; - - if (!locale$$1.match) { - throw new RangeError('locale must contain match property') - } - - if (!locale$$1.formatLong) { - throw new RangeError('locale must contain formatLong property') - } - - var formatString = String(dirtyFormatString) - .replace(longFormattingTokensRegExp$1, function (substring) { - if (substring[0] === '[') { - return substring - } - - if (substring[0] === '\\') { - return cleanEscapedString$1(substring) - } - - return locale$$1.formatLong(substring) - }); - - if (formatString === '') { - if (dateString === '') { - return toDate(dirtyBaseDate, options) - } else { - return new Date(NaN) - } - } - - var subFnOptions = cloneObject(options); - subFnOptions.locale = locale$$1; - - var tokens = formatString.match(locale$$1.parsingTokensRegExp || defaultParsingTokensRegExp); - var tokensLength = tokens.length; - - // If timezone isn't specified, it will be set to the system timezone - var setters = [{ - priority: TIMEZONE_UNIT_PRIORITY, - set: dateToSystemTimezone, - index: 0 - }]; - - var i; - for (i = 0; i < tokensLength; i++) { - var token = tokens[i]; - var parser = localeParsers[token] || parsers[token]; - if (parser) { - var matchResult; - - if (parser.match instanceof RegExp) { - matchResult = parser.match.exec(dateString); - } else { - matchResult = parser.match(dateString, subFnOptions); - } - - if (!matchResult) { - return new Date(NaN) - } - - var unitName = parser.unit; - var unit = localeUnits[unitName] || units[unitName]; - - setters.push({ - priority: unit.priority, - set: unit.set, - value: parser.parse(matchResult, subFnOptions), - index: setters.length - }); - - var substring = matchResult[0]; - dateString = dateString.slice(substring.length); - } else { - var head = tokens[i].match(/^\[.*]$/) ? tokens[i].replace(/^\[|]$/g, '') : tokens[i]; - if (dateString.indexOf(head) === 0) { - dateString = dateString.slice(head.length); - } else { - return new Date(NaN) - } - } - } - - var uniquePrioritySetters = setters - .map(function (setter) { - return setter.priority - }) - .sort(function (a, b) { - return a - b - }) - .filter(function (priority, index, array) { - return array.indexOf(priority) === index - }) - .map(function (priority) { - return setters - .filter(function (setter) { - return setter.priority === priority - }) - .reverse() - }) - .map(function (setterArray) { - return setterArray[0] - }); - - var date = toDate(dirtyBaseDate, options); - - if (isNaN(date)) { - return new Date(NaN) - } - - // Convert the date in system timezone to the same date in UTC+00:00 timezone. - // This ensures that when UTC functions will be implemented, locales will be compatible with them. - // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37 - var utcDate = subMinutes(date, date.getTimezoneOffset()); - - var dateValues = {date: utcDate}; - - var settersLength = uniquePrioritySetters.length; - for (i = 0; i < settersLength; i++) { - var setter = uniquePrioritySetters[i]; - dateValues = setter.set(dateValues, setter.value, subFnOptions); - } - - return dateValues.date -} - -function dateToSystemTimezone (dateValues) { - var date = dateValues.date; - var time = date.getTime(); - - // Get the system timezone offset at (moment of time - offset) - var offset = date.getTimezoneOffset(); - - // Get the system timezone offset at the exact moment of time - offset = new Date(time + offset * MILLISECONDS_IN_MINUTE$6).getTimezoneOffset(); - - // Convert date in timezone "UTC+00:00" to the system timezone - dateValues.date = new Date(time + offset * MILLISECONDS_IN_MINUTE$6); - - return dateValues -} - -function cleanEscapedString$1 (input) { - if (input.match(/\[[\s\S]/)) { - return input.replace(/^\[|]$/g, '') - } - return input.replace(/\\/g, '') -} - -// This file is generated automatically by `scripts/build/indices.js`. Please, don't change it. - -var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - - -function unwrapExports (x) { - return x && x.__esModule ? x['default'] : x; -} - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; -} - -var index$4 = createCommonjsModule(function (module, exports) { -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = formatDistance; -var formatDistanceLocale = { - lessThanXSeconds: { - one: 'less than a second', - other: 'less than {{count}} seconds' - }, - - xSeconds: { - one: '1 second', - other: '{{count}} seconds' - }, - - halfAMinute: 'half a minute', - - lessThanXMinutes: { - one: 'less than a minute', - other: 'less than {{count}} minutes' - }, - - xMinutes: { - one: '1 minute', - other: '{{count}} minutes' - }, - - aboutXHours: { - one: 'about 1 hour', - other: 'about {{count}} hours' - }, - - xHours: { - one: '1 hour', - other: '{{count}} hours' - }, - - xDays: { - one: '1 day', - other: '{{count}} days' - }, - - aboutXMonths: { - one: 'about 1 month', - other: 'about {{count}} months' - }, - - xMonths: { - one: '1 month', - other: '{{count}} months' - }, - - aboutXYears: { - one: 'about 1 year', - other: 'about {{count}} years' - }, - - xYears: { - one: '1 year', - other: '{{count}} years' - }, - - overXYears: { - one: 'over 1 year', - other: 'over {{count}} years' - }, - - almostXYears: { - one: 'almost 1 year', - other: 'almost {{count}} years' - } -}; - -function formatDistance(token, count, options) { - options = options || {}; - - var result; - if (typeof formatDistanceLocale[token] === 'string') { - result = formatDistanceLocale[token]; - } else if (count === 1) { - result = formatDistanceLocale[token].one; - } else { - result = formatDistanceLocale[token].other.replace('{{count}}', count); - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'in ' + result; - } else { - return result + ' ago'; - } - } - - return result; -} -module.exports = exports['default']; -}); - -var index$8 = createCommonjsModule(function (module, exports) { -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = buildFormatLongFn; -var tokensToBeShortedPattern = /MMMM|MM|DD|dddd/g; - -function buildShortLongFormat(format) { - return format.replace(tokensToBeShortedPattern, function (token) { - return token.slice(1); - }); -} - -/** - * @name buildFormatLongFn - * @category Locale Helpers - * @summary Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. - * - * @description - * Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. - * Returns a function which takes one of the following tokens as the argument: - * `'LTS'`, `'LT'`, `'L'`, `'LL'`, `'LLL'`, `'l'`, `'ll'`, `'lll'`, `'llll'` - * and returns a long format string written as `format` token strings. - * See [format]{@link https://date-fns.org/docs/format} - * - * `'l'`, `'ll'`, `'lll'` and `'llll'` formats are built automatically - * by shortening some of the tokens from corresponding unshortened formats - * (e.g., if `LL` is `'MMMM DD YYYY'` then `ll` will be `MMM D YYYY`) - * - * @param {Object} obj - the object with long formats written as `format` token strings - * @param {String} obj.LT - time format: hours and minutes - * @param {String} obj.LTS - time format: hours, minutes and seconds - * @param {String} obj.L - short date format: numeric day, month and year - * @param {String} [obj.l] - short date format: numeric day, month and year (shortened) - * @param {String} obj.LL - long date format: day, month in words, and year - * @param {String} [obj.ll] - long date format: day, month in words, and year (shortened) - * @param {String} obj.LLL - long date and time format - * @param {String} [obj.lll] - long date and time format (shortened) - * @param {String} obj.LLLL - long date, time and weekday format - * @param {String} [obj.llll] - long date, time and weekday format (shortened) - * @returns {Function} `formatLong` property of the locale - * - * @example - * // For `en-US` locale: - * locale.formatLong = buildFormatLongFn({ - * LT: 'h:mm aa', - * LTS: 'h:mm:ss aa', - * L: 'MM/DD/YYYY', - * LL: 'MMMM D YYYY', - * LLL: 'MMMM D YYYY h:mm aa', - * LLLL: 'dddd, MMMM D YYYY h:mm aa' - * }) - */ -function buildFormatLongFn(obj) { - var formatLongLocale = { - LTS: obj.LTS, - LT: obj.LT, - L: obj.L, - LL: obj.LL, - LLL: obj.LLL, - LLLL: obj.LLLL, - l: obj.l || buildShortLongFormat(obj.L), - ll: obj.ll || buildShortLongFormat(obj.LL), - lll: obj.lll || buildShortLongFormat(obj.LLL), - llll: obj.llll || buildShortLongFormat(obj.LLLL) - }; - - return function (token) { - return formatLongLocale[token]; - }; -} -module.exports = exports["default"]; -}); - -var index$6 = createCommonjsModule(function (module, exports) { -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _index = index$8; - -var _index2 = _interopRequireDefault(_index); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var formatLong = (0, _index2.default)({ - LT: 'h:mm aa', - LTS: 'h:mm:ss aa', - L: 'MM/DD/YYYY', - LL: 'MMMM D YYYY', - LLL: 'MMMM D YYYY h:mm aa', - LLLL: 'dddd, MMMM D YYYY h:mm aa' -}); - -exports.default = formatLong; -module.exports = exports['default']; -}); - -var index$10 = createCommonjsModule(function (module, exports) { -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = formatRelative; -var formatRelativeLocale = { - lastWeek: '[last] dddd [at] LT', - yesterday: '[yesterday at] LT', - today: '[today at] LT', - tomorrow: '[tomorrow at] LT', - nextWeek: 'dddd [at] LT', - other: 'L' -}; - -function formatRelative(token, date, baseDate, options) { - return formatRelativeLocale[token]; -} -module.exports = exports['default']; -}); - -var index$14 = createCommonjsModule(function (module, exports) { -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = buildLocalizeFn; -/** - * @name buildLocalizeFn - * @category Locale Helpers - * @summary Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale. - * - * @description - * Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale - * used by `format` function. - * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). - * - * `localize.weekday` function takes the weekday index as argument (0 - Sunday). - * `localize.month` takes the month index (0 - January). - * `localize.timeOfDay` takes the hours. Use `indexCallback` to convert them to an array index (see example). - * - * @param {Object} values - the object with arrays of values - * @param {String} defaultType - the default type for the localize function - * @param {Function} [indexCallback] - the callback which takes the resulting function argument - * and converts it into value array index - * @returns {Function} the resulting function - * - * @example - * var timeOfDayValues = { - * uppercase: ['AM', 'PM'], - * lowercase: ['am', 'pm'], - * long: ['a.m.', 'p.m.'] - * } - * locale.localize.timeOfDay = buildLocalizeFn(timeOfDayValues, 'long', function (hours) { - * // 0 is a.m. array index, 1 is p.m. array index - * return (hours / 12) >= 1 ? 1 : 0 - * }) - * locale.localize.timeOfDay(16, {type: 'uppercase'}) //=> 'PM' - * locale.localize.timeOfDay(5) //=> 'a.m.' - */ -function buildLocalizeFn(values, defaultType, indexCallback) { - return function (dirtyIndex, dirtyOptions) { - var options = dirtyOptions || {}; - var type = options.type ? String(options.type) : defaultType; - var valuesArray = values[type] || values[defaultType]; - var index = indexCallback ? indexCallback(Number(dirtyIndex)) : Number(dirtyIndex); - return valuesArray[index]; - }; -} -module.exports = exports["default"]; -}); - -var index$16 = createCommonjsModule(function (module, exports) { -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = buildLocalizeArrayFn; -/** - * @name buildLocalizeArrayFn - * @category Locale Helpers - * @summary Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. - * - * @description - * Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. - * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). - * - * @param {Object} values - the object with arrays of values - * @param {String} defaultType - the default type for the localize function - * @returns {Function} the resulting function - * - * @example - * var weekdayValues = { - * narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], - * short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - * long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] - * } - * locale.localize.weekdays = buildLocalizeArrayFn(weekdayValues, 'long') - * locale.localize.weekdays({type: 'narrow'}) //=> ['Su', 'Mo', ...] - * locale.localize.weekdays() //=> ['Sunday', 'Monday', ...] - */ -function buildLocalizeArrayFn(values, defaultType) { - return function (dirtyOptions) { - var options = dirtyOptions || {}; - var type = options.type ? String(options.type) : defaultType; - return values[type] || values[defaultType]; - }; -} -module.exports = exports["default"]; -}); - -var index$12 = createCommonjsModule(function (module, exports) { -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _index = index$14; - -var _index2 = _interopRequireDefault(_index); - -var _index3 = index$16; - -var _index4 = _interopRequireDefault(_index3); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Note: in English, the names of days of the week and months are capitalized. -// If you are making a new locale based on this one, check if the same is true for the language you're working on. -// Generally, formatted dates should look like they are in the middle of a sentence, -// e.g. in Spanish language the weekdays and months should be in the lowercase. -var weekdayValues = { - narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], - short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] -}; - -var monthValues = { - short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] -}; - -// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. -// Use the system which is used the most commonly in the locale. -// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: -// -// var timeOfDayValues = { -// any: ['in the night', 'in the morning', 'in the afternoon', 'in the evening'] -// } -// -// And later: -// -// var localize = { -// // The callback takes the hours as the argument and returns the array index -// timeOfDay: buildLocalizeFn(timeOfDayValues, 'any', function (hours) { -// if (hours >= 17) { -// return 3 -// } else if (hours >= 12) { -// return 2 -// } else if (hours >= 4) { -// return 1 -// } else { -// return 0 -// } -// }), -// timesOfDay: buildLocalizeArrayFn(timeOfDayValues, 'any') -// } -var timeOfDayValues = { - uppercase: ['AM', 'PM'], - lowercase: ['am', 'pm'], - long: ['a.m.', 'p.m.'] -}; - -function ordinalNumber(dirtyNumber, dirtyOptions) { - var number = Number(dirtyNumber); - - // If ordinal numbers depend on context, for example, - // if they are different for different grammatical genders, - // use `options.unit`: - // - // var options = dirtyOptions || {} - // var unit = String(options.unit) - // - // where `unit` can be 'month', 'quarter', 'week', 'isoWeek', 'dayOfYear', - // 'dayOfMonth' or 'dayOfWeek' - - var rem100 = number % 100; - if (rem100 > 20 || rem100 < 10) { - switch (rem100 % 10) { - case 1: - return number + 'st'; - case 2: - return number + 'nd'; - case 3: - return number + 'rd'; - } - } - return number + 'th'; -} - -var localize = { - ordinalNumber: ordinalNumber, - weekday: (0, _index2.default)(weekdayValues, 'long'), - weekdays: (0, _index4.default)(weekdayValues, 'long'), - month: (0, _index2.default)(monthValues, 'long'), - months: (0, _index4.default)(monthValues, 'long'), - timeOfDay: (0, _index2.default)(timeOfDayValues, 'long', function (hours) { - return hours / 12 >= 1 ? 1 : 0; - }), - timesOfDay: (0, _index4.default)(timeOfDayValues, 'long') -}; - -exports.default = localize; -module.exports = exports['default']; -}); - -var index$20 = createCommonjsModule(function (module, exports) { -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = buildMatchFn; -/** - * @name buildMatchFn - * @category Locale Helpers - * @summary Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale. - * - * @description - * Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale used by `parse` function. - * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). - * The result of the match function will be passed into corresponding parser function - * (`match.weekday`, `match.month` or `match.timeOfDay` respectively. See `buildParseFn`). - * - * @param {Object} values - the object with RegExps - * @param {String} defaultType - the default type for the match function - * @returns {Function} the resulting function - * - * @example - * var matchWeekdaysPatterns = { - * narrow: /^(su|mo|tu|we|th|fr|sa)/i, - * short: /^(sun|mon|tue|wed|thu|fri|sat)/i, - * long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i - * } - * locale.match.weekdays = buildMatchFn(matchWeekdaysPatterns, 'long') - * locale.match.weekdays('Sunday', {type: 'narrow'}) //=> ['Su', 'Su', ...] - * locale.match.weekdays('Sunday') //=> ['Sunday', 'Sunday', ...] - */ -function buildMatchFn(patterns, defaultType) { - return function (dirtyString, dirtyOptions) { - var options = dirtyOptions || {}; - var type = options.type ? String(options.type) : defaultType; - var pattern = patterns[type] || patterns[defaultType]; - var string = String(dirtyString); - return string.match(pattern); - }; -} -module.exports = exports["default"]; -}); - -var index$22 = createCommonjsModule(function (module, exports) { -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = buildParseFn; -/** - * @name buildParseFn - * @category Locale Helpers - * @summary Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale. - * - * @description - * Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale used by `parse` function. - * The argument of the resulting function is the result of the corresponding match function - * (`match.weekdays`, `match.months` or `match.timesOfDay` respectively. See `buildMatchFn`). - * - * @param {Object} values - the object with arrays of RegExps - * @param {String} defaultType - the default type for the parser function - * @returns {Function} the resulting function - * - * @example - * var parseWeekdayPatterns = { - * any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] - * } - * locale.match.weekday = buildParseFn(matchWeekdaysPatterns, 'long') - * var matchResult = locale.match.weekdays('Friday') - * locale.match.weekday(matchResult) //=> 5 - */ -function buildParseFn(patterns, defaultType) { - return function (matchResult, dirtyOptions) { - var options = dirtyOptions || {}; - var type = options.type ? String(options.type) : defaultType; - var patternsArray = patterns[type] || patterns[defaultType]; - var string = matchResult[1]; - - return patternsArray.findIndex(function (pattern) { - return pattern.test(string); - }); - }; -} -module.exports = exports["default"]; -}); - -var index$24 = createCommonjsModule(function (module, exports) { -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = buildMatchPatternFn; -/** - * @name buildMatchPatternFn - * @category Locale Helpers - * @summary Build match function from a single RegExp. - * - * @description - * Build match function from a single RegExp. - * Usually used for building `match.ordinalNumbers` property of the locale. - * - * @param {Object} pattern - the RegExp - * @returns {Function} the resulting function - * - * @example - * locale.match.ordinalNumbers = buildMatchPatternFn(/^(\d+)(th|st|nd|rd)?/i) - * locale.match.ordinalNumbers('3rd') //=> ['3rd', '3', 'rd', ...] - */ -function buildMatchPatternFn(pattern) { - return function (dirtyString) { - var string = String(dirtyString); - return string.match(pattern); - }; -} -module.exports = exports["default"]; -}); - -var index$26 = createCommonjsModule(function (module, exports) { -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = parseDecimal; -/** - * @name parseDecimal - * @category Locale Helpers - * @summary Parses the match result into decimal number. - * - * @description - * Parses the match result into decimal number. - * Uses the string matched with the first set of parentheses of match RegExp. - * - * @param {Array} matchResult - the object returned by matching function - * @returns {Number} the parsed value - * - * @example - * locale.match = { - * ordinalNumbers: (dirtyString) { - * return String(dirtyString).match(/^(\d+)(th|st|nd|rd)?/i) - * }, - * ordinalNumber: parseDecimal - * } - */ -function parseDecimal(matchResult) { - return parseInt(matchResult[1], 10); -} -module.exports = exports["default"]; -}); - -var index$18 = createCommonjsModule(function (module, exports) { -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _index = index$20; - -var _index2 = _interopRequireDefault(_index); - -var _index3 = index$22; - -var _index4 = _interopRequireDefault(_index3); - -var _index5 = index$24; - -var _index6 = _interopRequireDefault(_index5); - -var _index7 = index$26; - -var _index8 = _interopRequireDefault(_index7); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var matchOrdinalNumbersPattern = /^(\d+)(th|st|nd|rd)?/i; - -var matchWeekdaysPatterns = { - narrow: /^(su|mo|tu|we|th|fr|sa)/i, - short: /^(sun|mon|tue|wed|thu|fri|sat)/i, - long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i -}; - -var parseWeekdayPatterns = { - any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] -}; - -var matchMonthsPatterns = { - short: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, - long: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i -}; - -var parseMonthPatterns = { - any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i] -}; - -// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. -// Use the system which is used the most commonly in the locale. -// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: -// -// var matchTimesOfDayPatterns = { -// long: /^((in the)? (night|morning|afternoon|evening?))/i -// } -// -// var parseTimeOfDayPatterns = { -// any: [/(night|morning)/i, /(afternoon|evening)/i] -// } -var matchTimesOfDayPatterns = { - short: /^(am|pm)/i, - long: /^([ap]\.?\s?m\.?)/i -}; - -var parseTimeOfDayPatterns = { - any: [/^a/i, /^p/i] -}; - -var match = { - ordinalNumbers: (0, _index6.default)(matchOrdinalNumbersPattern), - ordinalNumber: _index8.default, - weekdays: (0, _index2.default)(matchWeekdaysPatterns, 'long'), - weekday: (0, _index4.default)(parseWeekdayPatterns, 'any'), - months: (0, _index2.default)(matchMonthsPatterns, 'long'), - month: (0, _index4.default)(parseMonthPatterns, 'any'), - timesOfDay: (0, _index2.default)(matchTimesOfDayPatterns, 'long'), - timeOfDay: (0, _index4.default)(parseTimeOfDayPatterns, 'any') -}; - -exports.default = match; -module.exports = exports['default']; -}); - -var index$2 = createCommonjsModule(function (module, exports) { -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _index = index$4; - -var _index2 = _interopRequireDefault(_index); - -var _index3 = index$6; - -var _index4 = _interopRequireDefault(_index3); - -var _index5 = index$10; - -var _index6 = _interopRequireDefault(_index5); - -var _index7 = index$12; - -var _index8 = _interopRequireDefault(_index7); - -var _index9 = index$18; - -var _index10 = _interopRequireDefault(_index9); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @type {Locale} - * @category Locales - * @summary English locale (United States). - * @language English - * @iso-639-2 eng - */ -var locale = { - formatDistance: _index2.default, - formatLong: _index4.default, - formatRelative: _index6.default, - localize: _index8.default, - match: _index10.default, - options: { - weekStartsOn: 0 /* Sunday */ - , firstWeekContainsDate: 1 - } -}; - -exports.default = locale; -module.exports = exports['default']; -}); - -var index$3 = unwrapExports(index$2); - - -var defaultLocale$1 = Object.freeze({ - default: index$3, - __moduleExports: index$2 -}); - -var __assign = (undefined && undefined.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -function buildLocalizeFn(values, defaultType, indexCallback) { - return function (dirtyIndex, _a) { - var type = (_a === void 0 ? { type: defaultType } : _a).type; - var index = indexCallback ? indexCallback(dirtyIndex) : dirtyIndex; - return values[type][index]; - }; -} -function buildLocalizeArrayFn(values, defaultType) { - return function (_a) { - var type = (_a === void 0 ? { type: defaultType } : _a).type; - return values[type]; - }; -} -function buildMatchFn(patterns, defaultType) { - return function (dirtyString, _a) { - var type = (_a === void 0 ? { type: defaultType } : _a).type; - return dirtyString.match("^(" + patterns[type].join("|") + ")"); - }; -} -function buildParseFn(patterns, defaultType) { - return function (_a, _b) { - var result = _a[1]; - var type = (_b === void 0 ? { type: defaultType } : _b).type; - return (patterns[type] || patterns[defaultType]) - .map(function (p) { return new RegExp("^" + p); }) - .findIndex(function (pattern) { return pattern.test(result); }); - }; -} -var DateFnsParser = /** @class */ (function () { - function DateFnsParser(locale) { - this._weekStartsOn = locale.firstDayOfWeek; - var weekdayValues = { - long: locale.weekdays, - short: locale.weekdaysShort, - narrow: locale.weekdaysNarrow - }; - var monthValues = { - long: locale.months, - short: locale.monthsShort - }; - var timeOfDayValues = { - long: locale.timesOfDay, - uppercase: locale.timesOfDayUppercase, - lowercase: locale.timesOfDayLowercase - }; - var timeOfDayMatchValues = { - long: locale.timesOfDay, - short: locale.timesOfDayUppercase.concat(locale.timesOfDayLowercase) - }; - this._locale = defaultLocale$1; - this._locale.localize = __assign({}, this._locale.localize, { - weekday: buildLocalizeFn(weekdayValues, "long"), - weekdays: buildLocalizeArrayFn(weekdayValues, "long"), - month: buildLocalizeFn(monthValues, "long"), - months: buildLocalizeArrayFn(monthValues, "long"), - timeOfDay: buildLocalizeFn(timeOfDayValues, "long", function (hours) { - return hours / 12 >= 1 ? 1 : 0; - }), - timesOfDay: buildLocalizeArrayFn(timeOfDayValues, "long") - }); - this._locale.match = __assign({}, this._locale.match, { - weekdays: buildMatchFn(weekdayValues, "long"), - weekday: buildParseFn(weekdayValues, "long"), - months: buildMatchFn(monthValues, "long"), - month: buildParseFn(monthValues, "long"), - timesOfDay: buildMatchFn(timeOfDayMatchValues, "long"), - timeOfDay: buildParseFn(timeOfDayMatchValues, "long") - }); - } - Object.defineProperty(DateFnsParser.prototype, "_config", { - get: function () { - return { - weekStartsOn: this._weekStartsOn, - locale: this._locale - }; - }, - enumerable: true, - configurable: true - }); - DateFnsParser.prototype.format = function (d, f) { - return format(d, f, this._config); - }; - DateFnsParser.prototype.parse = function (dS, f, bD) { - return parse(dS, f, bD, this._config); - }; - return DateFnsParser; -}()); - -var __extends$4 = (undefined && undefined.__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 __()); - }; -})(); -var DateParser = /** @class */ (function () { - function DateParser(format, locale) { - this._format = format; - this._parser = new DateFnsParser(locale); - } - DateParser.prototype.format = function (date) { - return this._parser.format(date, this._format); - }; - DateParser.prototype.parse = function (dateString, baseDate) { - if (baseDate === void 0) { baseDate = new Date(); } - return this._parser.parse(dateString, this._format, baseDate); - }; - return DateParser; -}()); -var InternalDateParser = /** @class */ (function (_super) { - __extends$4(InternalDateParser, _super); - function InternalDateParser(mode, locale) { - var _this = this; - var internalFormats = { - time: "HH:mm", - datetime: "YYYY-MM-DDTHH:mm", - date: "YYYY-MM-DD", - month: "YYYY-MM", - year: "YYYY" - }; - _this = _super.call(this, internalFormats[mode], locale) || this; - return _this; - } - return InternalDateParser; -}(DateParser)); - -var CalendarRange = /** @class */ (function () { - function CalendarRange(start, dates, items, grouped, comparer) { - this.start = start; - this.dates = dates; - this.items = items; - this.groupedItems = grouped; - this._comparer = comparer; - } - Object.defineProperty(CalendarRange.prototype, "inRange", { - get: function () { - return this.items.filter(function (i) { return !i.isOutsideRange; }); - }, - enumerable: true, - configurable: true - }); - CalendarRange.prototype.find = function (item) { - var _this = this; - return this.items.find(function (i) { return _this._comparer.equal(i.date, item.date); }); - }; - CalendarRange.prototype.findIndex = function (item) { - var _this = this; - if (!item) { - return -1; - } - return this.items.findIndex(function (i) { return _this._comparer.equal(i.date, item.date); }); - }; - CalendarRange.prototype.containsDate = function (date) { - var _this = this; - return !!this.inRange.find(function (i) { return _this._comparer.equal(i.date, date); }); - }; - return CalendarRange; -}()); -var CalendarRangeService = /** @class */ (function () { - function CalendarRangeService(interval, rows, columns) { - this.interval = interval; - this.marginal = interval + 1; - this.rows = rows; - this.columns = columns; - } - Object.defineProperty(CalendarRangeService.prototype, "dateComparer", { - get: function () { - return new DateComparer(this.marginal, this.service.inFinalView); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarRangeService.prototype, "length", { - get: function () { - return this.rows * this.columns; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarRangeService.prototype, "canMoveNext", { - get: function () { - var firstItem = this.next.inRange[0]; - if (firstItem && this.service.maxDate) { - return firstItem.date <= this.service.maxDate; - } - return true; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarRangeService.prototype, "canMovePrevious", { - get: function () { - var lastItem = this.previous.inRange.slice(-1).pop(); - if (lastItem && this.service.minDate) { - return lastItem.date >= this.service.minDate; - } - return true; - }, - enumerable: true, - configurable: true - }); - CalendarRangeService.prototype.loadService = function (service) { - this.service = service; - this.refresh(); - }; - CalendarRangeService.prototype.refresh = function () { - this.current = this.calcRange(this.service.currentDate); - this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate))); - this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate))); - }; - CalendarRangeService.prototype.move = function (forwards) { - if (forwards) { - return this.moveNext(); - } - return this.movePrevious(); - }; - CalendarRangeService.prototype.moveNext = function () { - DateUtil.next(this.interval, this.service.currentDate); - this.previous = this.current; - this.current = this.next; - this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate))); - }; - CalendarRangeService.prototype.movePrevious = function () { - DateUtil.previous(this.interval, this.service.currentDate); - this.next = this.current; - this.current = this.previous; - this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate))); - }; - CalendarRangeService.prototype.calc = function (forwards) { - if (forwards) { - return this.next; - } - return this.previous; - }; - CalendarRangeService.prototype.calcRange = function (startDate) { - var start = this.calcStart(startDate); - if (this.service.inFinalView) { - DateUtil.startOf(this.marginal, start, true); - } - var dates = this.calcDates(start); - var items = this.calcItems(dates, startDate); - return new CalendarRange(start, dates, items, Util.Array.group(items, this.columns), this.dateComparer); - }; - CalendarRangeService.prototype.calcStart = function (date) { - return DateUtil.startOf(this.interval, DateUtil.clone(date)); - }; - CalendarRangeService.prototype.calcDates = function (rangeStart) { - var _this = this; - return Util.Array - .range(this.length) - .map(function (i) { return DateUtil.add(_this.marginal, DateUtil.clone(rangeStart), i); }); - }; - CalendarRangeService.prototype.calcItems = function (dateRange, baseDate) { - var _this = this; - return dateRange.map(function (date) { - var item = new CalendarItem(date); - item.isDisabled = !_this.dateComparer.between(item.date, _this.service.minDate, _this.service.maxDate); - item.isActive = _this.dateComparer.equal(item.date, _this.service.selectedDate); - item.isToday = _this.dateComparer.equal(item.date, new Date()); - item.isSelectable = item.isDisabled; - _this.configureItem(item, baseDate); - return item; - }); - }; - return CalendarRangeService; -}()); - -var SuiCalendarViewTitle = /** @class */ (function () { - function SuiCalendarViewTitle() { - this.onZoomOut = new _angular_core.EventEmitter(); - } - SuiCalendarViewTitle.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-calendar-view-title", - template: "\n\n \n\n\n \n\n\n \n\n", - styles: ["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiCalendarViewTitle.ctorParameters = function () { return []; }; - SuiCalendarViewTitle.propDecorators = { - "ranges": [{ type: _angular_core.Input },], - "onZoomOut": [{ type: _angular_core.Output, args: ["zoomOut",] },], - }; - return SuiCalendarViewTitle; -}()); - -var DatepickerMode = { - Year: "year", - Month: "month", - Date: "date", - Datetime: "datetime", - Time: "time" -}; -var SuiDatepicker = /** @class */ (function () { - function SuiDatepicker(localizationService) { - this.service = new CalendarService(new DatetimeConfig(), localizationService.get().datepicker); - this._calendarClasses = true; - } - SuiDatepicker.prototype.onMouseDown = function (e) { - e.preventDefault(); - }; - SuiDatepicker.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-datepicker", - template: "\n\n \n \n \n \n \n\n", - styles: ["\n:host {\n user-select: none;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiDatepicker.ctorParameters = function () { return [ - { type: SuiLocalizationService, }, - ]; }; - SuiDatepicker.propDecorators = { - "_calendarClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.active",] }, { type: _angular_core.HostBinding, args: ["class.calendar",] },], - "onMouseDown": [{ type: _angular_core.HostListener, args: ["mousedown", ["$event"],] },], - }; - return SuiDatepicker; -}()); - -var PopupTrigger = { - Hover: "hover", - Click: "click", - OutsideClick: "outsideClick", - Focus: "focus", - Manual: "manual" -}; -var PopupConfig = /** @class */ (function () { - function PopupConfig(defaults) { - if (defaults === void 0) { defaults = {}; } - this.placement = PositioningPlacement.TopLeft; - this.trigger = PopupTrigger.Hover; - this.isInverted = false; - this.delay = 0; - this.isBasic = false; - this.transition = "scale"; - this.transitionDuration = 200; - Object.assign(this, defaults); - } - return PopupConfig; -}()); - -var SuiPopup = /** @class */ (function () { - function SuiPopup(elementRef) { - this.elementRef = elementRef; - this.transitionController = new TransitionController(false); - this._isOpen = false; - this.onOpen = new _angular_core.EventEmitter(); - this.onClose = new _angular_core.EventEmitter(); - this._tabindex = 0; - } - Object.defineProperty(SuiPopup.prototype, "isOpen", { - get: function () { - return this._isOpen; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopup.prototype, "anchor", { - set: function (anchor) { - // Whenever the anchor is set (which is when the popup is created), recreate the positioning service with the appropriate options. - this.positioningService = new PositioningService(anchor, this._container.element, this.config.placement, ".dynamic.arrow"); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopup.prototype, "direction", { - // Returns the direction (`top`, `left`, `right`, `bottom`) of the current placement. - get: - // Returns the direction (`top`, `left`, `right`, `bottom`) of the current placement. - function () { - if (this.positioningService) { - return this.positioningService.actualPlacement.split(" ").shift(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopup.prototype, "alignment", { - // Returns the alignment (`top`, `left`, `right`, `bottom`) of the current placement. - get: - // Returns the alignment (`top`, `left`, `right`, `bottom`) of the current placement. - function () { - if (this.positioningService) { - return this.positioningService.actualPlacement.split(" ").pop(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopup.prototype, "dynamicClasses", { - get: function () { - var classes = {}; - if (this.direction) { - classes[this.direction] = true; - } - if (this.alignment) { - classes[this.alignment] = true; - } - if (this.config.isInverted) { - classes.inverted = true; - } - if (this.config.isBasic) { - classes.basic = true; - } - return classes; - }, - enumerable: true, - configurable: true - }); - SuiPopup.prototype.open = function () { - var _this = this; - // Only attempt to open if currently closed. - if (!this.isOpen) { - // Cancel the closing timer. - clearTimeout(this.closingTimeout); - // Cancel all other transitions, and initiate the opening transition. - this.transitionController.stopAll(); - this.transitionController.animate(new Transition(this.config.transition, this.config.transitionDuration, exports.TransitionDirection.In, function () { - // Focus any element with [autofocus] attribute. - var autoFocus = _this.elementRef.nativeElement.querySelector("[autofocus]"); - if (autoFocus) { - // Autofocus after the browser has had time to process other event handlers. - setTimeout(function () { return autoFocus.focus(); }, 10); - // Try to focus again when the modal has opened so that autofocus works in IE11. - setTimeout(function () { return autoFocus.focus(); }, _this.config.transitionDuration); - } - })); - // Refresh the popup position after a brief delay to allow for browser processing time. - this.positioningService.placement = this.config.placement; - setTimeout(function () { return _this.positioningService.update(); }); - // Finally, set the popup to be open. - this._isOpen = true; - this.onOpen.emit(); - } - }; - SuiPopup.prototype.toggle = function () { - if (!this.isOpen) { - return this.open(); - } - return this.close(); - }; - SuiPopup.prototype.close = function () { - var _this = this; - // Only attempt to close if currently open. - if (this.isOpen) { - // Cancel all other transitions, and initiate the closing transition. - this.transitionController.stopAll(); - this.transitionController.animate(new Transition(this.config.transition, this.config.transitionDuration, exports.TransitionDirection.Out)); - // Cancel the closing timer. - clearTimeout(this.closingTimeout); - // Start the closing timer, that fires the `onClose` event after the transition duration number of milliseconds. - this.closingTimeout = window.setTimeout(function () { return _this.onClose.emit(); }, this.config.transitionDuration); - // Finally, set the popup to be closed. - this._isOpen = false; - } - }; - SuiPopup.prototype.onClick = function (event) { - // Makes sense here, as the popup shouldn't be attached to any DOM element. - event.stopPropagation(); - }; - SuiPopup.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-popup", - template: "\n
\n\n \n
{{ config.header }}
\n
{{ config.text }}
\n
\n
\n\n \n
\n", - styles: ["\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor's mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed 'vertically'. */\n.ui.popup[direction=\"top\"],\n.ui.popup[direction=\"bottom\"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed 'horizontally'. */\n.ui.popup[direction=\"left\"],\n.ui.popup[direction=\"right\"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiPopup.ctorParameters = function () { return [ - { type: _angular_core.ElementRef, }, - ]; }; - SuiPopup.propDecorators = { - "_container": [{ type: _angular_core.ViewChild, args: ["container", { read: _angular_core.ViewContainerRef },] },], - "templateSibling": [{ type: _angular_core.ViewChild, args: ["templateSibling", { read: _angular_core.ViewContainerRef },] },], - "_tabindex": [{ type: _angular_core.HostBinding, args: ["attr.tabindex",] },], - "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], - }; - return SuiPopup; -}()); - -var SuiPopupController = /** @class */ (function () { - function SuiPopupController(renderer, _element, _componentFactory, config) { - var _this = this; - this._element = _element; - this._componentFactory = _componentFactory; - // Generate a new SuiPopup component and attach it to the application view. - this._componentRef = this._componentFactory.createComponent(SuiPopup); - // Configure popup with provided config. - this.popup.config = config; - // When the popup is closed (onClose fires on animation complete), - this.popup.onClose.subscribe(function () { return _this.cleanup(); }); - this._documentListener = renderer.listen("document", "click", function (e) { return _this.onDocumentClick(e); }); - } - Object.defineProperty(SuiPopupController.prototype, "popup", { - // Returns generated popup instance. - get: - // Returns generated popup instance. - function () { - // Use non-null assertion as we only access this when a popup exists. - return this._componentRef.instance; - }, - enumerable: true, - configurable: true - }); - SuiPopupController.prototype.configure = function (config) { - if (config) { - Object.assign(this.popup.config, config); - } - }; - SuiPopupController.prototype.openDelayed = function () { - var _this = this; - // Cancel the opening timer. - clearTimeout(this._openingTimeout); - // Start the popup opening after the specified delay interval. - this._openingTimeout = window.setTimeout(function () { return _this.open(); }, this.popup.config.delay); - }; - SuiPopupController.prototype.open = function () { - // Attach the generated component to the current application. - this._componentFactory.attachToApplication(this._componentRef); - // Move the generated element to the body to avoid any positioning issues. - this._componentFactory.moveToDocumentBody(this._componentRef); - // Attach a reference to the anchor element. We do it here because IE11 loves to complain. - this.popup.anchor = this._element; - // Start popup open transition. - this.popup.open(); - // Call lifecyle hook - var lifecycle = this.popupOnOpen; - if (lifecycle) { - lifecycle.call(this); - } - }; - SuiPopupController.prototype.close = function () { - // Cancel the opening timer to stop the popup opening after close has been called. - clearTimeout(this._openingTimeout); - if (this._componentRef) { - // Start popup close transition. - this.popup.close(); - } - // Call lifecyle hook - var lifecycle = this.popupOnClose; - if (lifecycle) { - lifecycle.call(this); - } - }; - SuiPopupController.prototype.toggleDelayed = function () { - // If the popup hasn't been created, or it has but it isn't currently open, open the popup. - if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) { - return this.openDelayed(); - } - // O'wise, close it. - return this.close(); - }; - SuiPopupController.prototype.toggle = function () { - // If the popup hasn't been created, or it has but it isn't currently open, open the popup. - if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) { - return this.open(); - } - // O'wise, close it. - return this.close(); - }; - SuiPopupController.prototype.onMouseEnter = function () { - if (this.popup.config.trigger === PopupTrigger.Hover) { - this.openDelayed(); - } - }; - SuiPopupController.prototype.onMouseLeave = function () { - if (this.popup.config.trigger === PopupTrigger.Hover) { - this.close(); - } - }; - SuiPopupController.prototype.onClick = function () { - if (this.popup.config.trigger === PopupTrigger.Click || - this.popup.config.trigger === PopupTrigger.OutsideClick) { - // Repeated clicks require a toggle, rather than just opening the popup each time. - this.toggleDelayed(); - } - else if (this.popup.config.trigger === PopupTrigger.Focus && - (!this._componentRef || (this._componentRef && !this.popup.isOpen))) { - // Repeated clicks with a focus trigger requires an open (as focus isn't ever lost on repeated click). - this.openDelayed(); - } - }; - SuiPopupController.prototype.onDocumentClick = function (e) { - // If the popup trigger is outside click, - if (this._componentRef && this.popup.config.trigger === PopupTrigger.OutsideClick) { - var target = e.target; - // Close the popup if the click is outside of the popup element. - if (!this._element.nativeElement.contains(target)) { - this.close(); - } - } - }; - SuiPopupController.prototype.onFocusIn = function () { - if (this.popup.config.trigger === PopupTrigger.Focus) { - this.openDelayed(); - } - }; - SuiPopupController.prototype.onFocusOut = function (e) { - if (!this._element.nativeElement.contains(e.relatedTarget) && - !this.popup.elementRef.nativeElement.contains(e.relatedTarget) && - this.popup.config.trigger === PopupTrigger.Focus) { - this.close(); - } - }; - SuiPopupController.prototype.cleanup = function () { - clearTimeout(this._openingTimeout); - if (this._componentRef.instance && this._componentRef.instance.positioningService) { - this._componentRef.instance.positioningService.destroy(); - } - this._componentFactory.detachFromApplication(this._componentRef); - }; - SuiPopupController.prototype.ngOnDestroy = function () { - this.cleanup(); - this._documentListener(); - }; - SuiPopupController.propDecorators = { - "onMouseEnter": [{ type: _angular_core.HostListener, args: ["mouseenter",] },], - "onMouseLeave": [{ type: _angular_core.HostListener, args: ["mouseleave",] },], - "onClick": [{ type: _angular_core.HostListener, args: ["click",] },], - "onFocusIn": [{ type: _angular_core.HostListener, args: ["focusin",] },], - "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout", ["$event"],] },], - }; - return SuiPopupController; -}()); - -var __extends$6 = (undefined && undefined.__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 __()); - }; -})(); -var SuiPopupComponentController = /** @class */ (function (_super) { - __extends$6(SuiPopupComponentController, _super); - function SuiPopupComponentController(renderer, element, componentFactory, _component, config) { - var _this = _super.call(this, renderer, element, componentFactory, config) || this; - _this._component = _component; - return _this; - } - Object.defineProperty(SuiPopupComponentController.prototype, "componentInstance", { - get: function () { - if (this._contentComponentRef) { - return this._contentComponentRef.instance; - } - }, - enumerable: true, - configurable: true - }); - SuiPopupComponentController.prototype.open = function () { - if (!this._contentComponentRef) { - this._contentComponentRef = this._componentFactory.createComponent(this._component); - this._componentFactory.attachToView(this._contentComponentRef, this.popup.templateSibling); - } - _super.prototype.open.call(this); - }; - SuiPopupComponentController.prototype.cleanup = function () { - _super.prototype.cleanup.call(this); - if (this._contentComponentRef) { - this._contentComponentRef.destroy(); - this._contentComponentRef = undefined; - } - }; - return SuiPopupComponentController; -}(SuiPopupController)); - -var __extends$7 = (undefined && undefined.__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 __()); - }; -})(); -var TemplatePopupConfig = /** @class */ (function (_super) { - __extends$7(TemplatePopupConfig, _super); - function TemplatePopupConfig() { - return _super !== null && _super.apply(this, arguments) || this; - } - return TemplatePopupConfig; -}(PopupConfig)); -var SuiPopupTemplateController = /** @class */ (function (_super) { - __extends$7(SuiPopupTemplateController, _super); - function SuiPopupTemplateController(renderer, element, componentFactory, config) { - return _super.call(this, renderer, element, componentFactory, config) || this; - } - SuiPopupTemplateController.prototype.configure = function (config) { - _super.prototype.configure.call(this, config); - if (config) { - this.template = config.template; - this.context = config.context; - } - }; - SuiPopupTemplateController.prototype.open = function () { - // If there is a template, inject it into the view. - if (this.template) { - this.popup.templateSibling.clear(); - this._componentFactory.createView(this.popup.templateSibling, this.template, { - $implicit: this.popup, - context: this.context - }); - } - _super.prototype.open.call(this); - }; - return SuiPopupTemplateController; -}(SuiPopupController)); - -var SuiPopupArrow = /** @class */ (function () { - function SuiPopupArrow() { - } - Object.defineProperty(SuiPopupArrow.prototype, "direction", { - get: function () { - if (this.placement) { - return this.placement.split(" ").shift(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupArrow.prototype, "alignment", { - get: function () { - if (this.placement) { - var alignment = this.placement.split(" ").pop(); - if (alignment === this.direction) { - return "center"; - } - return alignment; - } - }, - enumerable: true, - configurable: true - }); - SuiPopupArrow.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-popup-arrow", - template: "\n
\n
\n", - styles: ["\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction=\"top\"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction=\"left\"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction=\"bottom\"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction=\"right\"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"left\"],\n.static.arrow[direction=\"top\"][alignment=\"left\"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"top\"],\n.static.arrow[direction=\"right\"][alignment=\"top\"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"right\"],\n.static.arrow[direction=\"top\"][alignment=\"right\"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"bottom\"],\n.static.arrow[direction=\"right\"][alignment=\"bottom\"] {\n top: auto;\n bottom: 1em;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiPopupArrow.ctorParameters = function () { return []; }; - SuiPopupArrow.propDecorators = { - "placement": [{ type: _angular_core.Input },], - "inverted": [{ type: _angular_core.HostBinding, args: ["class.inverted",] }, { type: _angular_core.Input },], - }; - return SuiPopupArrow; -}()); - -var __extends$9 = (undefined && undefined.__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 __()); - }; -})(); -var SuiPopupConfig = /** @class */ (function (_super) { - __extends$9(SuiPopupConfig, _super); - function SuiPopupConfig() { - // We use an empty constructor to ensure Angular DI works correctly. - return _super.call(this) || this; - } - SuiPopupConfig.decorators = [ - { type: _angular_core.Injectable }, - ]; - /** @nocollapse */ - SuiPopupConfig.ctorParameters = function () { return []; }; - return SuiPopupConfig; -}(PopupConfig)); - -var __extends$8 = (undefined && undefined.__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 __()); - }; -})(); -var SuiPopupDirective = /** @class */ (function (_super) { - __extends$8(SuiPopupDirective, _super); - function SuiPopupDirective(renderer, element, componentFactory, popupDefaults) { - return _super.call(this, renderer, element, componentFactory, new PopupConfig(popupDefaults)) || this; - } - Object.defineProperty(SuiPopupDirective.prototype, "popupHeader", { - set: function (header) { - this.popup.config.header = header; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupText", { - set: function (text) { - this.popup.config.text = text; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupInverted", { - set: function (inverted) { - this.popup.config.isInverted = Util.DOM.parseBooleanAttribute(inverted); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupBasic", { - set: function (basic) { - this.popup.config.isBasic = Util.DOM.parseBooleanAttribute(basic); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupTransition", { - set: function (transition) { - this.popup.config.transition = transition; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupTransitionDuration", { - set: function (duration) { - this.popup.config.transitionDuration = duration; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupPlacement", { - set: function (placement) { - this.popup.config.placement = placement; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupDelay", { - set: function (delay) { - this.popup.config.delay = delay; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupTrigger", { - get: function () { - return this.popup.config.trigger; - }, - set: function (trigger) { - this.popup.config.trigger = trigger; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupTemplate", { - set: function (template) { - this.template = template; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupTemplateContext", { - set: function (context) { - this.context = context; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupConfig", { - set: function (config) { - this.configure(config); - }, - enumerable: true, - configurable: true - }); - SuiPopupDirective.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "[suiPopup]", - exportAs: "suiPopup" - },] }, - ]; - /** @nocollapse */ - SuiPopupDirective.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - { type: SuiComponentFactory, }, - { type: SuiPopupConfig, }, - ]; }; - SuiPopupDirective.propDecorators = { - "popupHeader": [{ type: _angular_core.Input },], - "popupText": [{ type: _angular_core.Input },], - "popupInverted": [{ type: _angular_core.Input },], - "popupBasic": [{ type: _angular_core.Input },], - "popupTransition": [{ type: _angular_core.Input },], - "popupTransitionDuration": [{ type: _angular_core.Input },], - "popupPlacement": [{ type: _angular_core.Input },], - "popupDelay": [{ type: _angular_core.Input },], - "popupTrigger": [{ type: _angular_core.Input },], - "popupTemplate": [{ type: _angular_core.Input },], - "popupTemplateContext": [{ type: _angular_core.Input },], - "popupConfig": [{ type: _angular_core.Input },], - }; - return SuiPopupDirective; -}(SuiPopupTemplateController)); - -var SuiPopupModule = /** @class */ (function () { - function SuiPopupModule() { - } - SuiPopupModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule, - SuiTransitionModule, - SuiUtilityModule - ], - declarations: [ - SuiPopupDirective, - SuiPopupArrow, - SuiPopup - ], - exports: [ - SuiPopupDirective, - SuiPopup - ], - providers: [ - SuiPopupConfig - ], - entryComponents: [ - SuiPopup - ] - },] }, - ]; - /** @nocollapse */ - SuiPopupModule.ctorParameters = function () { return []; }; - return SuiPopupModule; -}()); - -var __extends$5 = (undefined && undefined.__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 __()); - }; -})(); -var SuiDatepickerDirective = /** @class */ (function (_super) { - __extends$5(SuiDatepickerDirective, _super); - function SuiDatepickerDirective(renderer, element, componentFactory, localizationService) { - var _this = _super.call(this, renderer, element, componentFactory, SuiDatepicker, new PopupConfig({ - trigger: PopupTrigger.Focus, - placement: PositioningPlacement.BottomLeft, - transition: "scale", - transitionDuration: 200 - })) || this; - _this.renderer = renderer; - _this.localizationService = localizationService; - // This ensures the popup is drawn correctly (i.e. no border). - // This ensures the popup is drawn correctly (i.e. no border). - _this.renderer.addClass(_this.popup.elementRef.nativeElement, "ui"); - _this.renderer.addClass(_this.popup.elementRef.nativeElement, "calendar"); - _this.onLocaleUpdate(); - _this.localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); - _this.onSelectedDateChange = new _angular_core.EventEmitter(); - _this.onValidatorChange = new _angular_core.EventEmitter(); - _this.mode = DatepickerMode.Datetime; - return _this; - } - Object.defineProperty(SuiDatepickerDirective.prototype, "selectedDate", { - get: function () { - return this._selectedDate; - }, - set: function (date) { - this._selectedDate = date; - this.onSelectedDateChange.emit(date); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerDirective.prototype, "mode", { - get: function () { - return this._mode; - }, - set: function (mode) { - this._mode = mode || DatepickerMode.Datetime; - switch (this._mode) { - case DatepickerMode.Year: - this.config = new YearConfig(); - break; - case DatepickerMode.Month: - this.config = new MonthConfig(); - break; - case DatepickerMode.Date: - default: - this.config = new DateConfig(); - break; - case DatepickerMode.Datetime: - this.config = new DatetimeConfig(); - break; - case DatepickerMode.Time: - this.config = new TimeConfig(); - break; - } - this.writeValue(this.selectedDate); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerDirective.prototype, "localeValues", { - get: function () { - return this.localizationService.override(this._localeValues, this.localeOverrides); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerDirective.prototype, "placement", { - set: function (placement) { - this.popup.config.placement = placement; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerDirective.prototype, "transition", { - set: function (transition) { - this.popup.config.transition = transition; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerDirective.prototype, "transitionDuration", { - set: function (duration) { - this.popup.config.transitionDuration = duration; - }, - enumerable: true, - configurable: true - }); - SuiDatepickerDirective.prototype.popupOnOpen = function () { - var _this = this; - if (this.componentInstance) { - this.componentInstance.service.config = this.config; - this.componentInstance.service.localeValues = this.localeValues; - this.componentInstance.service.currentDate = this.initialDate || new Date(); - this.componentInstance.service.selectedDate = this.selectedDate; - this.componentInstance.service.maxDate = this.maxDate; - this.componentInstance.service.minDate = this.minDate; - if (this.firstDayOfWeek != undefined) { - this.componentInstance.service.firstDayOfWeek = this.firstDayOfWeek; - } - this.componentInstance.service.reset(); - this.componentInstance.service.onDateChange.subscribe(function (d) { - _this.selectedDate = d; - _this.close(); - }); - } - }; - SuiDatepickerDirective.prototype.ngOnChanges = function (_a) { - var maxDate = _a.maxDate, minDate = _a.minDate, mode = _a.mode; - if (maxDate || minDate || mode) { - this.onValidatorChange.emit(); - } - }; - SuiDatepickerDirective.prototype.onLocaleUpdate = function () { - this._localeValues = this.localizationService.get().datepicker; - }; - SuiDatepickerDirective.prototype.validate = function (c) { - var value = c.value; - if (value != undefined) { - // We post process the min & max date because sometimes this puts the date outside of the allowed range. - if (this.minDate && value < this.minDate) { - return { suiMinDate: { required: this.minDate, actual: value } }; - } - if (this.maxDate && value > this.maxDate) { - return { suiMaxDate: { required: this.maxDate, actual: value } }; - } - } - // Angular expects null - // tslint:disable-next-line:no-null-keyword - return null; - }; - SuiDatepickerDirective.prototype.writeValue = function (value) { - this.selectedDate = value; - if (this.componentInstance) { - this.componentInstance.service.selectedDate = value; - } - }; - SuiDatepickerDirective.prototype.onKeyDown = function (e) { - if (e.keyCode === exports.KeyCode.Escape) { - this.close(); - } - }; - SuiDatepickerDirective.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "[suiDatepicker]", - providers: [customValidatorFactory(SuiDatepickerDirective)] - },] }, - ]; - /** @nocollapse */ - SuiDatepickerDirective.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - { type: SuiComponentFactory, }, - { type: SuiLocalizationService, }, - ]; }; - SuiDatepickerDirective.propDecorators = { - "mode": [{ type: _angular_core.Input, args: ["pickerMode",] },], - "initialDate": [{ type: _angular_core.Input, args: ["pickerInitialDate",] },], - "maxDate": [{ type: _angular_core.Input, args: ["pickerMaxDate",] },], - "minDate": [{ type: _angular_core.Input, args: ["pickerMinDate",] },], - "firstDayOfWeek": [{ type: _angular_core.Input, args: ["pickerFirstDayOfWeek",] },], - "localeOverrides": [{ type: _angular_core.Input, args: ["pickerLocaleOverrides",] },], - "placement": [{ type: _angular_core.Input, args: ["pickerPlacement",] },], - "transition": [{ type: _angular_core.Input, args: ["pickerTransition",] },], - "transitionDuration": [{ type: _angular_core.Input, args: ["pickerTransitionDuration",] },], - "onSelectedDateChange": [{ type: _angular_core.Output, args: ["pickerSelectedDateChange",] },], - "onValidatorChange": [{ type: _angular_core.Output, args: ["pickerValidatorChange",] },], - "onKeyDown": [{ type: _angular_core.HostListener, args: ["keydown", ["$event"],] },], - }; - return SuiDatepickerDirective; -}(SuiPopupComponentController)); -var SuiDatepickerDirectiveValueAccessor = /** @class */ (function (_super) { - __extends$5(SuiDatepickerDirectiveValueAccessor, _super); - function SuiDatepickerDirectiveValueAccessor(host) { - var _this = _super.call(this, host) || this; - _this.host = host; - return _this; - } - SuiDatepickerDirectiveValueAccessor.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "[suiDatepicker]", - host: { "(pickerSelectedDateChange)": "onChange($event)" }, - providers: [customValueAccessorFactory(SuiDatepickerDirectiveValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiDatepickerDirectiveValueAccessor.ctorParameters = function () { return [ - { type: SuiDatepickerDirective, }, - ]; }; - return SuiDatepickerDirectiveValueAccessor; -}(CustomValueAccessor)); -var SuiDatepickerDirectiveValidator = /** @class */ (function (_super) { - __extends$5(SuiDatepickerDirectiveValidator, _super); - function SuiDatepickerDirectiveValidator(host) { - var _this = _super.call(this, host) || this; - _this.host = host; - return _this; - } - SuiDatepickerDirectiveValidator.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "[suiDatepicker]", - host: { "(pickerValidatorChange)": "onValidatorChange()" }, - providers: [customValidatorFactory(SuiDatepickerDirectiveValidator)] - },] }, - ]; - /** @nocollapse */ - SuiDatepickerDirectiveValidator.ctorParameters = function () { return [ - { type: SuiDatepickerDirective, }, - ]; }; - return SuiDatepickerDirectiveValidator; -}(CustomValidator)); - -var bowser = createCommonjsModule(function (module) { -/*! - * Bowser - a browser detector - * https://github.com/ded/bowser - * MIT License | (c) Dustin Diaz 2015 - */ - -!function (root, name, definition) { - if ('object' != 'undefined' && module.exports) module.exports = definition(); - else if (typeof undefined == 'function' && undefined.amd) undefined(name, definition); - else root[name] = definition(); -}(commonjsGlobal, 'bowser', function () { - /** - * See useragents.js for examples of navigator.userAgent - */ - - var t = true; - - function detect(ua) { - - function getFirstMatch(regex) { - var match = ua.match(regex); - return (match && match.length > 1 && match[1]) || ''; - } - - function getSecondMatch(regex) { - var match = ua.match(regex); - return (match && match.length > 1 && match[2]) || ''; - } - - var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase() - , likeAndroid = /like android/i.test(ua) - , android = !likeAndroid && /android/i.test(ua) - , nexusMobile = /nexus\s*[0-6]\s*/i.test(ua) - , nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua) - , chromeos = /CrOS/.test(ua) - , silk = /silk/i.test(ua) - , sailfish = /sailfish/i.test(ua) - , tizen = /tizen/i.test(ua) - , webos = /(web|hpw)os/i.test(ua) - , windowsphone = /windows phone/i.test(ua) - , samsungBrowser = /SamsungBrowser/i.test(ua) - , windows = !windowsphone && /windows/i.test(ua) - , mac = !iosdevice && !silk && /macintosh/i.test(ua) - , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua) - , edgeVersion = getSecondMatch(/edg([ea]|ios)\/(\d+(\.\d+)?)/i) - , versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) - , tablet = /tablet/i.test(ua) && !/tablet pc/i.test(ua) - , mobile = !tablet && /[^-]mobi/i.test(ua) - , xbox = /xbox/i.test(ua) - , result; - - if (/opera/i.test(ua)) { - // an old Opera - result = { - name: 'Opera' - , opera: t - , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) - }; - } else if (/opr\/|opios/i.test(ua)) { - // a new Opera - result = { - name: 'Opera' - , opera: t - , version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier - }; - } - else if (/SamsungBrowser/i.test(ua)) { - result = { - name: 'Samsung Internet for Android' - , samsungBrowser: t - , version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i) - }; - } - else if (/coast/i.test(ua)) { - result = { - name: 'Opera Coast' - , coast: t - , version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) - }; - } - else if (/yabrowser/i.test(ua)) { - result = { - name: 'Yandex Browser' - , yandexbrowser: t - , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) - }; - } - else if (/ucbrowser/i.test(ua)) { - result = { - name: 'UC Browser' - , ucbrowser: t - , version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) - }; - } - else if (/mxios/i.test(ua)) { - result = { - name: 'Maxthon' - , maxthon: t - , version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) - }; - } - else if (/epiphany/i.test(ua)) { - result = { - name: 'Epiphany' - , epiphany: t - , version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) - }; - } - else if (/puffin/i.test(ua)) { - result = { - name: 'Puffin' - , puffin: t - , version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) - }; - } - else if (/sleipnir/i.test(ua)) { - result = { - name: 'Sleipnir' - , sleipnir: t - , version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) - }; - } - else if (/k-meleon/i.test(ua)) { - result = { - name: 'K-Meleon' - , kMeleon: t - , version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) - }; - } - else if (windowsphone) { - result = { - name: 'Windows Phone' - , osname: 'Windows Phone' - , windowsphone: t - }; - if (edgeVersion) { - result.msedge = t; - result.version = edgeVersion; - } - else { - result.msie = t; - result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i); - } - } - else if (/msie|trident/i.test(ua)) { - result = { - name: 'Internet Explorer' - , msie: t - , version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) - }; - } else if (chromeos) { - result = { - name: 'Chrome' - , osname: 'Chrome OS' - , chromeos: t - , chromeBook: t - , chrome: t - , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) - }; - } else if (/edg([ea]|ios)/i.test(ua)) { - result = { - name: 'Microsoft Edge' - , msedge: t - , version: edgeVersion - }; - } - else if (/vivaldi/i.test(ua)) { - result = { - name: 'Vivaldi' - , vivaldi: t - , version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier - }; - } - else if (sailfish) { - result = { - name: 'Sailfish' - , osname: 'Sailfish OS' - , sailfish: t - , version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i) - }; - } - else if (/seamonkey\//i.test(ua)) { - result = { - name: 'SeaMonkey' - , seamonkey: t - , version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i) - }; - } - else if (/firefox|iceweasel|fxios/i.test(ua)) { - result = { - name: 'Firefox' - , firefox: t - , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) - }; - if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { - result.firefoxos = t; - result.osname = 'Firefox OS'; - } - } - else if (silk) { - result = { - name: 'Amazon Silk' - , silk: t - , version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) - }; - } - else if (/phantom/i.test(ua)) { - result = { - name: 'PhantomJS' - , phantom: t - , version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i) - }; - } - else if (/slimerjs/i.test(ua)) { - result = { - name: 'SlimerJS' - , slimer: t - , version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i) - }; - } - else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) { - result = { - name: 'BlackBerry' - , osname: 'BlackBerry OS' - , blackberry: t - , version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i) - }; - } - else if (webos) { - result = { - name: 'WebOS' - , osname: 'WebOS' - , webos: t - , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) - }; - /touchpad\//i.test(ua) && (result.touchpad = t); - } - else if (/bada/i.test(ua)) { - result = { - name: 'Bada' - , osname: 'Bada' - , bada: t - , version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i) - }; - } - else if (tizen) { - result = { - name: 'Tizen' - , osname: 'Tizen' - , tizen: t - , version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier - }; - } - else if (/qupzilla/i.test(ua)) { - result = { - name: 'QupZilla' - , qupzilla: t - , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier - }; - } - else if (/chromium/i.test(ua)) { - result = { - name: 'Chromium' - , chromium: t - , version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier - }; - } - else if (/chrome|crios|crmo/i.test(ua)) { - result = { - name: 'Chrome' - , chrome: t - , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) - }; - } - else if (android) { - result = { - name: 'Android' - , version: versionIdentifier - }; - } - else if (/safari|applewebkit/i.test(ua)) { - result = { - name: 'Safari' - , safari: t - }; - if (versionIdentifier) { - result.version = versionIdentifier; - } - } - else if (iosdevice) { - result = { - name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod' - }; - // WTF: version is not part of user agent in web apps - if (versionIdentifier) { - result.version = versionIdentifier; - } - } - else if(/googlebot/i.test(ua)) { - result = { - name: 'Googlebot' - , googlebot: t - , version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier - }; - } - else { - result = { - name: getFirstMatch(/^(.*)\/(.*) /), - version: getSecondMatch(/^(.*)\/(.*) /) - }; - } - - // set webkit or gecko flag for browsers based on these engines - if (!result.msedge && /(apple)?webkit/i.test(ua)) { - if (/(apple)?webkit\/537\.36/i.test(ua)) { - result.name = result.name || "Blink"; - result.blink = t; - } else { - result.name = result.name || "Webkit"; - result.webkit = t; - } - if (!result.version && versionIdentifier) { - result.version = versionIdentifier; - } - } else if (!result.opera && /gecko\//i.test(ua)) { - result.name = result.name || "Gecko"; - result.gecko = t; - result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i); - } - - // set OS flags for platforms that have multiple browsers - if (!result.windowsphone && (android || result.silk)) { - result.android = t; - result.osname = 'Android'; - } else if (!result.windowsphone && iosdevice) { - result[iosdevice] = t; - result.ios = t; - result.osname = 'iOS'; - } else if (mac) { - result.mac = t; - result.osname = 'macOS'; - } else if (xbox) { - result.xbox = t; - result.osname = 'Xbox'; - } else if (windows) { - result.windows = t; - result.osname = 'Windows'; - } else if (linux) { - result.linux = t; - result.osname = 'Linux'; - } - - function getWindowsVersion (s) { - switch (s) { - case 'NT': return 'NT' - case 'XP': return 'XP' - case 'NT 5.0': return '2000' - case 'NT 5.1': return 'XP' - case 'NT 5.2': return '2003' - case 'NT 6.0': return 'Vista' - case 'NT 6.1': return '7' - case 'NT 6.2': return '8' - case 'NT 6.3': return '8.1' - case 'NT 10.0': return '10' - default: return undefined - } - } - - // OS version extraction - var osVersion = ''; - if (result.windows) { - osVersion = getWindowsVersion(getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i)); - } else if (result.windowsphone) { - osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); - } else if (result.mac) { - osVersion = getFirstMatch(/Mac OS X (\d+([_\.\s]\d+)*)/i); - osVersion = osVersion.replace(/[_\s]/g, '.'); - } else if (iosdevice) { - osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i); - osVersion = osVersion.replace(/[_\s]/g, '.'); - } else if (android) { - osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i); - } else if (result.webos) { - osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); - } else if (result.blackberry) { - osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); - } else if (result.bada) { - osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i); - } else if (result.tizen) { - osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i); - } - if (osVersion) { - result.osversion = osVersion; - } - - // device type extraction - var osMajorVersion = !result.windows && osVersion.split('.')[0]; - if ( - tablet - || nexusTablet - || iosdevice == 'ipad' - || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile))) - || result.silk - ) { - result.tablet = t; - } else if ( - mobile - || iosdevice == 'iphone' - || iosdevice == 'ipod' - || android - || nexusMobile - || result.blackberry - || result.webos - || result.bada - ) { - result.mobile = t; - } - - // Graded Browser Support - // http://developer.yahoo.com/yui/articles/gbs - if (result.msedge || - (result.msie && result.version >= 10) || - (result.yandexbrowser && result.version >= 15) || - (result.vivaldi && result.version >= 1.0) || - (result.chrome && result.version >= 20) || - (result.samsungBrowser && result.version >= 4) || - (result.firefox && result.version >= 20.0) || - (result.safari && result.version >= 6) || - (result.opera && result.version >= 10.0) || - (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || - (result.blackberry && result.version >= 10.1) - || (result.chromium && result.version >= 20) - ) { - result.a = t; - } - else if ((result.msie && result.version < 10) || - (result.chrome && result.version < 20) || - (result.firefox && result.version < 20.0) || - (result.safari && result.version < 6) || - (result.opera && result.version < 10.0) || - (result.ios && result.osversion && result.osversion.split(".")[0] < 6) - || (result.chromium && result.version < 20) - ) { - result.c = t; - } else result.x = t; - - return result - } - - var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : ''); - - bowser.test = function (browserList) { - for (var i = 0; i < browserList.length; ++i) { - var browserItem = browserList[i]; - if (typeof browserItem=== 'string') { - if (browserItem in bowser) { - return true; - } - } - } - return false; - }; - - /** - * Get version precisions count - * - * @example - * getVersionPrecision("1.10.3") // 3 - * - * @param {string} version - * @return {number} - */ - function getVersionPrecision(version) { - return version.split(".").length; - } - - /** - * Array::map polyfill - * - * @param {Array} arr - * @param {Function} iterator - * @return {Array} - */ - function map(arr, iterator) { - var result = [], i; - if (Array.prototype.map) { - return Array.prototype.map.call(arr, iterator); - } - for (i = 0; i < arr.length; i++) { - result.push(iterator(arr[i])); - } - return result; - } - - /** - * Calculate browser version weight - * - * @example - * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 - * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 - * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 - * compareVersions(['1.10.2.1', '1.0800.2']); // -1 - * - * @param {Array} versions versions to compare - * @return {Number} comparison result - */ - function compareVersions(versions) { - // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 - var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); - var chunks = map(versions, function (version) { - var delta = precision - getVersionPrecision(version); - - // 2) "9" -> "9.0" (for precision = 2) - version = version + new Array(delta + 1).join(".0"); - - // 3) "9.0" -> ["000000000"", "000000009"] - return map(version.split("."), function (chunk) { - return new Array(20 - chunk.length).join("0") + chunk; - }).reverse(); - }); - - // iterate in reverse order by reversed chunks array - while (--precision >= 0) { - // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) - if (chunks[0][precision] > chunks[1][precision]) { - return 1; - } - else if (chunks[0][precision] === chunks[1][precision]) { - if (precision === 0) { - // all version chunks are same - return 0; - } - } - else { - return -1; - } - } - } - - /** - * Check if browser is unsupported - * - * @example - * bowser.isUnsupportedBrowser({ - * msie: "10", - * firefox: "23", - * chrome: "29", - * safari: "5.1", - * opera: "16", - * phantom: "534" - * }); - * - * @param {Object} minVersions map of minimal version to browser - * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map - * @param {String} [ua] user agent string - * @return {Boolean} - */ - function isUnsupportedBrowser(minVersions, strictMode, ua) { - var _bowser = bowser; - - // make strictMode param optional with ua param usage - if (typeof strictMode === 'string') { - ua = strictMode; - strictMode = void(0); - } - - if (strictMode === void(0)) { - strictMode = false; - } - if (ua) { - _bowser = detect(ua); - } - - var version = "" + _bowser.version; - for (var browser in minVersions) { - if (minVersions.hasOwnProperty(browser)) { - if (_bowser[browser]) { - if (typeof minVersions[browser] !== 'string') { - throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions)); - } - - // browser version and min supported version. - return compareVersions([version, minVersions[browser]]) < 0; - } - } - } - - return strictMode; // not found - } - - /** - * Check if browser is supported - * - * @param {Object} minVersions map of minimal version to browser - * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map - * @param {String} [ua] user agent string - * @return {Boolean} - */ - function check(minVersions, strictMode, ua) { - return !isUnsupportedBrowser(minVersions, strictMode, ua); - } - - bowser.isUnsupportedBrowser = isUnsupportedBrowser; - bowser.compareVersions = compareVersions; - bowser.check = check; - - /* - * Set our detect method to the main bowser object so we can - * reuse it to test other user agents. - * This is needed to implement future tests. - */ - bowser._detect = detect; - - /* - * Set our detect public method to the main bowser object - * This is needed to implement bowser in server side - */ - bowser.detect = detect; - return bowser -}); -}); - -var bowser_1 = bowser.mobile; -var bowser_2 = bowser.tablet; - -var rules$1 = [ - // if it says it's a webview, let's go with that - 'WebView', - // iOS webview will be the same as safari but missing "Safari" - '(iPhone|iPod|iPad)(?!.*Safari)', - // Android Lollipop and Above: webview will be the same as native but it will contain "wv" - // Android KitKat to lollipop webview will put {version}.0.0.0 - 'Android.*(wv|\.0\.0\.0)', - // old chrome android webview agent - 'Linux; U; Android' -]; - -var rules = rules$1; -var webviewRegExp = new RegExp('(' + rules.join('|') + ')', 'ig'); - -var index$28 = function isWebview(ua) { - return !!ua.match(webviewRegExp) -}; - - - -var isUAWebView = Object.freeze({ - default: index$28, - __moduleExports: index$28 -}); - -var isWebView = index$28 || isUAWebView; -var SuiDatepickerInputDirective = /** @class */ (function () { - function SuiDatepickerInputDirective(datepicker, valueAccessor, element, localizationService) { - var _this = this; - this.datepicker = datepicker; - this.valueAccessor = valueAccessor; - this.element = element; - this.useNativeOnMobile = true; - this.fallbackActive = false; - // Whenever the datepicker value updates, update the input text alongside it. - this.datepicker.onSelectedDateChange.subscribe(function () { - return _this.updateValue(_this.selectedDateString); - }); - localizationService.onLanguageUpdate.subscribe(function () { - return _this.updateValue(_this.selectedDateString); - }); - } - Object.defineProperty(SuiDatepickerInputDirective.prototype, "useNativeOnMobile", { - get: function () { - return this._useNativeOnMobile; - }, - set: function (fallback) { - this._useNativeOnMobile = fallback; - var isOnMobile = bowser_1 || bowser_2 || isWebView(navigator.userAgent); - this.fallbackActive = this.useNativeOnMobile && isOnMobile; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "fallbackActive", { - get: function () { - return this._fallbackActive; - }, - set: function (active) { - this._fallbackActive = active; - // If the fallback is active, then the trigger must be manual so the datepicker never opens. - this.datepicker.popup.config.trigger = this.fallbackActive ? PopupTrigger.Manual : PopupTrigger.Focus; - // Update the input value (this will insert the `T` as required). - this.updateValue(this.selectedDateString); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "parser", { - get: function () { - if (this.fallbackActive) { - return new InternalDateParser(this.datepicker.mode, this.datepicker.localeValues); - } - return new DateParser(this.datepicker.localeValues.formats[this.datepicker.mode], this.datepicker.localeValues); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "selectedDateString", { - get: function () { - if (this.datepicker.selectedDate) { - return this.parser.format(this.datepicker.selectedDate); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "type", { - get: function () { - if (this.fallbackActive) { - return this.datepicker.config.fallback; - } - return "text"; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "max", { - get: function () { - if (this.fallbackActive && this.datepicker.maxDate) { - // Since HTML doesn't use a date object max is somewhat tricky. - // Our Datepicker will always choose the 1st date on the provided precision, - // meaning anything below the maxDate will work, hence endOf. - var max = DateUtil.endOf(this.datepicker.config.precision, DateUtil.clone(this.datepicker.maxDate)); - return this.parser.format(max); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "min", { - get: function () { - if (this.fallbackActive && this.datepicker.minDate) { - // Since HTML doesn't use a date object min is somewhat tricky. - // We use 1 minute before the next date at the configured precision since - // our Datepicker picks the first available date at that precision. - var min = DateUtil.clone(this.datepicker.minDate); - return this.parser.format(min); - } - }, - enumerable: true, - configurable: true - }); - SuiDatepickerInputDirective.prototype.updateValue = function (value) { - // Only update the current value if it is different to what it's being updated to. - // This is so that the editing position isn't changed when manually typing the date. - if (!this._lastUpdateTyped) { - this.datepicker.renderer.setProperty(this.element.nativeElement, "value", value || ""); - } - this._lastUpdateTyped = false; - }; - SuiDatepickerInputDirective.prototype.typeValue = function (value) { - this._lastUpdateTyped = true; - this._currentInputValue = value; - if (!value) { - // Delete the selected date if no date was entered manually. - return this.datepicker.writeValue(undefined); - } - var parsed = this.parser.parse(value, this.datepicker.selectedDate); - if (!isNaN(parsed.getTime()) && value === this.parser.format(parsed)) { - return this.datepicker.writeValue(parsed); - } - return this.datepicker.writeValue(undefined); - }; - SuiDatepickerInputDirective.prototype.onFocusOut = function () { - this.valueAccessor.onTouched(); - }; - SuiDatepickerInputDirective.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "input[suiDatepicker]" - },] }, - ]; - /** @nocollapse */ - SuiDatepickerInputDirective.ctorParameters = function () { return [ - { type: SuiDatepickerDirective, decorators: [{ type: _angular_core.Host },] }, - { type: SuiDatepickerDirectiveValueAccessor, decorators: [{ type: _angular_core.Host },] }, - { type: _angular_core.ElementRef, }, - { type: SuiLocalizationService, }, - ]; }; - SuiDatepickerInputDirective.propDecorators = { - "useNativeOnMobile": [{ type: _angular_core.Input, args: ["pickerUseNativeOnMobile",] },], - "type": [{ type: _angular_core.HostBinding, args: ["attr.type",] },], - "max": [{ type: _angular_core.HostBinding, args: ["attr.max",] },], - "min": [{ type: _angular_core.HostBinding, args: ["attr.min",] },], - "typeValue": [{ type: _angular_core.HostListener, args: ["input", ["$event.target.value"],] },], - "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout",] },], - }; - return SuiDatepickerInputDirective; -}()); - -var __extends$10 = (undefined && undefined.__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 __()); - }; -})(); -var CalendarRangeDateService = /** @class */ (function (_super) { - __extends$10(CalendarRangeDateService, _super); - function CalendarRangeDateService() { - return _super !== null && _super.apply(this, arguments) || this; - } - CalendarRangeDateService.prototype.calcStart = function (start) { - var monthStart = DateUtil.startOf(exports.DatePrecision.Month, DateUtil.clone(start)); - monthStart.setDate((1 - monthStart.getDay() + this.service.firstDayOfWeek - 7) % 7); - return monthStart; - }; - CalendarRangeDateService.prototype.configureItem = function (item, baseDate) { - item.humanReadable = item.date.getDate().toString(); - item.isOutsideRange = item.date.getMonth() !== baseDate.getMonth(); - item.isSelectable = item.isDisabled; - }; - return CalendarRangeDateService; -}(CalendarRangeService)); -var SuiCalendarDateView = /** @class */ (function (_super) { - __extends$10(SuiCalendarDateView, _super); - function SuiCalendarDateView(renderer) { - return _super.call(this, renderer, exports.CalendarViewType.Date, new CalendarRangeDateService(exports.DatePrecision.Month, 6, 7)) || this; - } - Object.defineProperty(SuiCalendarDateView.prototype, "days", { - get: function () { - var _this = this; - var days = this.service.localeValues.weekdaysNarrow; - return days.map(function (d, i) { return days[(i + _this.service.firstDayOfWeek) % days.length]; }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCalendarDateView.prototype, "date", { - get: function () { - return new DateParser(this.service.localeValues.formats.month, this.service.localeValues).format(this.currentDate); - }, - enumerable: true, - configurable: true - }); - SuiCalendarDateView.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-calendar-date-view", - template: "\n\n\n \n \n \n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ day }}
{{ item.humanReadable }}\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiCalendarDateView.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - ]; }; - return SuiCalendarDateView; -}(CalendarView)); - -var __extends$11 = (undefined && undefined.__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 __()); - }; -})(); -var CalendarRangeHourService = /** @class */ (function (_super) { - __extends$11(CalendarRangeHourService, _super); - function CalendarRangeHourService() { - return _super !== null && _super.apply(this, arguments) || this; - } - CalendarRangeHourService.prototype.configureItem = function (item, baseDate) { - // Set minutes and seconds to 0 - var customFormat = this.service.localeValues.formats.time.replace(/[ms]/g, "0"); - item.humanReadable = new DateParser(customFormat, this.service.localeValues).format(item.date); - item.isOutsideRange = false; - }; - return CalendarRangeHourService; -}(CalendarRangeService)); -var SuiCalendarHourView = /** @class */ (function (_super) { - __extends$11(SuiCalendarHourView, _super); - function SuiCalendarHourView(renderer) { - return _super.call(this, renderer, exports.CalendarViewType.Hour, new CalendarRangeHourService(exports.DatePrecision.Date, 6, 4)) || this; - } - Object.defineProperty(SuiCalendarHourView.prototype, "date", { - get: function () { - return new DateParser(this.service.localeValues.formats.date, this.service.localeValues).format(this.currentDate); - }, - enumerable: true, - configurable: true - }); - SuiCalendarHourView.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-calendar-hour-view", - template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiCalendarHourView.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - ]; }; - return SuiCalendarHourView; -}(CalendarView)); - -var __extends$12 = (undefined && undefined.__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 __()); - }; -})(); -var CalendarRangeMinuteService = /** @class */ (function (_super) { - __extends$12(CalendarRangeMinuteService, _super); - function CalendarRangeMinuteService() { - return _super !== null && _super.apply(this, arguments) || this; - } - CalendarRangeMinuteService.prototype.calcStart = function (start) { - return DateUtil.startOf(exports.DatePrecision.Hour, DateUtil.clone(start), true); - }; - CalendarRangeMinuteService.prototype.calcDates = function (start) { - return Util.Array - .range(this.length) - .map(function (i) { return DateUtil.add(exports.DatePrecision.Minute, DateUtil.clone(start), i * 5); }); - }; - CalendarRangeMinuteService.prototype.configureItem = function (item, baseDate) { - item.humanReadable = new DateParser(this.service.localeValues.formats.time, this.service.localeValues).format(item.date); - item.isOutsideRange = false; - }; - return CalendarRangeMinuteService; -}(CalendarRangeService)); -var SuiCalendarMinuteView = /** @class */ (function (_super) { - __extends$12(SuiCalendarMinuteView, _super); - function SuiCalendarMinuteView(renderer) { - return _super.call(this, renderer, exports.CalendarViewType.Minute, new CalendarRangeMinuteService(exports.DatePrecision.Hour, 4, 3)) || this; - } - Object.defineProperty(SuiCalendarMinuteView.prototype, "date", { - get: function () { - if (this.service.config.mode !== exports.CalendarMode.TimeOnly) { - // Set minutes and seconds to 0 - var dateTimeFormat = this.service.localeValues.formats.datetime.replace(/[ms]/g, "0"); - return new DateParser(dateTimeFormat, this.service.localeValues).format(this.currentDate); - } - else { - // Set minutes and seconds to 0 - var timeFormat = this.service.localeValues.formats.time.replace(/[ms]/g, "0"); - return new DateParser(timeFormat, this.service.localeValues).format(this.currentDate); - } - }, - enumerable: true, - configurable: true - }); - SuiCalendarMinuteView.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-calendar-minute-view", - template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiCalendarMinuteView.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - ]; }; - return SuiCalendarMinuteView; -}(CalendarView)); - -var __extends$13 = (undefined && undefined.__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 __()); - }; -})(); -var CalendarRangeMonthService = /** @class */ (function (_super) { - __extends$13(CalendarRangeMonthService, _super); - function CalendarRangeMonthService() { - return _super !== null && _super.apply(this, arguments) || this; - } - CalendarRangeMonthService.prototype.configureItem = function (item, baseDate) { - item.humanReadable = this.service.localeValues.monthsShort[item.date.getMonth()]; - item.isOutsideRange = false; - }; - return CalendarRangeMonthService; -}(CalendarRangeService)); -var SuiCalendarMonthView = /** @class */ (function (_super) { - __extends$13(SuiCalendarMonthView, _super); - function SuiCalendarMonthView(renderer) { - return _super.call(this, renderer, exports.CalendarViewType.Month, new CalendarRangeMonthService(exports.DatePrecision.Year, 4, 3)) || this; - } - Object.defineProperty(SuiCalendarMonthView.prototype, "year", { - get: function () { - return new DateParser(this.service.localeValues.formats.year, this.service.localeValues).format(this.currentDate); - }, - enumerable: true, - configurable: true - }); - SuiCalendarMonthView.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-calendar-month-view", - template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
{{ item.humanReadable }}\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiCalendarMonthView.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - ]; }; - return SuiCalendarMonthView; -}(CalendarView)); - -var __extends$14 = (undefined && undefined.__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 __()); - }; -})(); -var CalendarRangeYearService = /** @class */ (function (_super) { - __extends$14(CalendarRangeYearService, _super); - function CalendarRangeYearService() { - return _super !== null && _super.apply(this, arguments) || this; - } - CalendarRangeYearService.prototype.configureItem = function (item, baseDate) { - item.humanReadable = Util.String.padLeft(item.date.getFullYear().toString(), 4, "0"); - item.isOutsideRange = item.date.getFullYear() >= this.calcStart(baseDate).getFullYear() + 10; - }; - return CalendarRangeYearService; -}(CalendarRangeService)); -var SuiCalendarYearView = /** @class */ (function (_super) { - __extends$14(SuiCalendarYearView, _super); - function SuiCalendarYearView(renderer) { - return _super.call(this, renderer, exports.CalendarViewType.Year, new CalendarRangeYearService(exports.DatePrecision.Decade, 4, 3)) || this; - } - Object.defineProperty(SuiCalendarYearView.prototype, "decadeStart", { - get: function () { - return DateUtil - .startOf(exports.DatePrecision.Decade, DateUtil.clone(this.service.currentDate)) - .getFullYear(); - }, - enumerable: true, - configurable: true - }); - SuiCalendarYearView.prototype.pad = function (year) { - return Util.String.padLeft(year.toString(), 4, "0"); - }; - SuiCalendarYearView.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-calendar-year-view", - template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
{{ item.humanReadable }}\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiCalendarYearView.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - ]; }; - return SuiCalendarYearView; -}(CalendarView)); - -var SuiDatepickerModule = /** @class */ (function () { - function SuiDatepickerModule() { - } - SuiDatepickerModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule, - _angular_forms.FormsModule, - SuiPopupModule, - SuiLocalizationModule, - SuiUtilityModule - ], - declarations: [ - SuiCalendarItem, - SuiCalendarViewTitle, - SuiCalendarYearView, - SuiCalendarMonthView, - SuiCalendarDateView, - SuiCalendarHourView, - SuiCalendarMinuteView, - SuiDatepicker, - SuiDatepickerDirective, - SuiDatepickerDirectiveValueAccessor, - SuiDatepickerDirectiveValidator, - SuiDatepickerInputDirective - ], - exports: [ - SuiDatepickerDirective, - SuiDatepickerDirectiveValueAccessor, - SuiDatepickerDirectiveValidator, - SuiDatepickerInputDirective - ], - entryComponents: [ - SuiDatepicker - ] - },] }, - ]; - /** @nocollapse */ - SuiDatepickerModule.ctorParameters = function () { return []; }; - return SuiDatepickerModule; -}()); - -var __extends$15 = (undefined && undefined.__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 __()); - }; -})(); -var SuiDimmer = /** @class */ (function (_super) { - __extends$15(SuiDimmer, _super); - function SuiDimmer(renderer, element, changeDetector) { - var _this = _super.call(this, renderer, element, changeDetector) || this; - _this._isDimmed = false; - _this.isDimmedChange = new _angular_core.EventEmitter(); - _this.isClickable = true; - _this.wrapContent = true; - _this._dimmerClasses = true; - return _this; - } - Object.defineProperty(SuiDimmer.prototype, "isDimmed", { - get: function () { - return this._isDimmed; - }, - set: function (value) { - var isDimmed = !!value; - if (!this._transitionController) { - // Initialise transition functionality when first setting dimmed, to ensure initial state doesn't transition. - this._transitionController = new TransitionController(isDimmed, "block"); - this.setTransitionController(this._transitionController); - this._isDimmed = isDimmed; - } - else if (this._isDimmed !== isDimmed) { - this._isDimmed = isDimmed; - this._transitionController.stopAll(); - this._transitionController.animate(new Transition("fade", this.transitionDuration, isDimmed ? exports.TransitionDirection.In : exports.TransitionDirection.Out)); - } - }, - enumerable: true, - configurable: true - }); - SuiDimmer.prototype.onClick = function () { - if (this.isClickable) { - this.isDimmed = false; - this.isDimmedChange.emit(this.isDimmed); - } - }; - SuiDimmer.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-dimmer", - template: "\n
\n
\n \n
\n
\n", - styles: ["\n:host.dimmer {\n transition: none;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiDimmer.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - { type: _angular_core.ChangeDetectorRef, }, - ]; }; - SuiDimmer.propDecorators = { - "_dimmerClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.dimmer",] },], - "isDimmed": [{ type: _angular_core.HostBinding, args: ["class.active",] }, { type: _angular_core.Input },], - "isDimmedChange": [{ type: _angular_core.Output },], - "isClickable": [{ type: _angular_core.Input },], - "transition": [{ type: _angular_core.Input },], - "transitionDuration": [{ type: _angular_core.Input },], - "wrapContent": [{ type: _angular_core.Input },], - "onClick": [{ type: _angular_core.HostListener, args: ["click",] },], - }; - return SuiDimmer; -}(SuiTransition)); - -var SuiDimmerModule = /** @class */ (function () { - function SuiDimmerModule() { - } - SuiDimmerModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule, - SuiTransitionModule - ], - declarations: [ - SuiDimmer - ], - exports: [ - SuiDimmer - ] - },] }, - ]; - /** @nocollapse */ - SuiDimmerModule.ctorParameters = function () { return []; }; - return SuiDimmerModule; -}()); - -// Creates essentially a 'string' enum. -var DropdownAutoCloseType = { - ItemClick: "itemClick", - OutsideClick: "outsideClick", - Disabled: "disabled" -}; -var DropdownService = /** @class */ (function () { - function DropdownService(autoCloseMode) { - if (autoCloseMode === void 0) { autoCloseMode = DropdownAutoCloseType.ItemClick; } - this.isOpen = false; - this.isOpenChange = new _angular_core.EventEmitter(); - this.isDisabled = false; - this.autoCloseMode = autoCloseMode; - this.children = []; - } - Object.defineProperty(DropdownService.prototype, "isNested", { - get: function () { - return !!this.parent; - }, - enumerable: true, - configurable: true - }); - DropdownService.prototype.setOpenState = function (isOpen, reflectInParent) { - var _this = this; - if (reflectInParent === void 0) { reflectInParent = false; } - if (this.isOpen !== isOpen && !this.isDisabled) { - // Only update the state if it has changed, and the dropdown isn't disabled. - this.isOpen = !!isOpen; - this.isAnimating = true; - // We must delay the emitting to avoid the 'changed after checked' Angular errors. - this.delay(function () { return _this.isOpenChange.emit(_this.isOpen); }); - if (!this.isOpen) { - // Close the child dropdowns when this one closes. - this.children.forEach(function (c) { return c.setOpenState(_this.isOpen); }); - } - if (this.parent && reflectInParent) { - // Open the parent dropdowns when this one opens. - this.parent.setOpenState(this.isOpen, true); - } - } - else if (this.isOpen !== isOpen && this.isDisabled) { - // If the state has changed, but the dropdown is disabled, re-emit the original isOpen value. - this.delay(function () { return _this.isOpenChange.emit(_this.isOpen); }); - } - }; - DropdownService.prototype.setDisabledState = function (isDisabled) { - if (this.isDisabled !== isDisabled) { - if (!!isDisabled) { - // Close the dropdown as it is now disabled - this.setOpenState(false); - } - this.isDisabled = !!isDisabled; - } - }; - DropdownService.prototype.toggleOpenState = function () { - this.setOpenState(!this.isOpen); - }; - // Registers a dropdown service as a child of this service. - // Registers a dropdown service as a child of this service. - DropdownService.prototype.registerChild = - // Registers a dropdown service as a child of this service. - function (child) { - if (!this.isChildRegistered(child)) { - this.children.push(child); - child.parent = this; - } - }; - // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. - // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. - DropdownService.prototype.isChildRegistered = - // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. - function (child) { - return this === child || !!this.children - .find(function (c) { - return !!c.children - .find(function (cChild) { return cChild.isChildRegistered(child); }); - }); - }; - // Wipes any nested data, so all services can be cleanly reattached. - // Wipes any nested data, so all services can be cleanly reattached. - DropdownService.prototype.clearChildren = - // Wipes any nested data, so all services can be cleanly reattached. - function () { - this.children.forEach(function (c) { - c.parent = undefined; - }); - this.children = []; - }; - // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. - // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. - DropdownService.prototype.delay = - // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. - function (callback) { - setTimeout(function () { return callback(); }); - }; - return DropdownService; -}()); - -// element-closest | CC0-1.0 | github.com/jonathantneal/closest - -(function (ElementProto) { - if (typeof ElementProto.matches !== 'function') { - ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) { - var element = this; - var elements = (element.document || element.ownerDocument).querySelectorAll(selector); - var index = 0; - - while (elements[index] && elements[index] !== element) { - ++index; - } - - return Boolean(elements[index]); - }; - } - - if (typeof ElementProto.closest !== 'function') { - ElementProto.closest = function closest(selector) { - var element = this; - - while (element && element.nodeType === 1) { - if (element.matches(selector)) { - return element; - } - - element = element.parentNode; - } - - return null; - }; - } -})(window.Element.prototype); - -var __extends$16 = (undefined && undefined.__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 __()); - }; -})(); -var SuiDropdownMenuItem = /** @class */ (function () { - function SuiDropdownMenuItem(_renderer, element) { - this._renderer = _renderer; - this.element = element; - this.isSelected = false; - this.selectedClass = "selected"; - } - Object.defineProperty(SuiDropdownMenuItem.prototype, "isDisabled", { - get: function () { - // We must use nativeElement as Angular doesn't have a way of reading class information. - var element = this.element.nativeElement; - return element.classList.contains("disabled"); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdownMenuItem.prototype, "isSelected", { - get: function () { - return this._isSelected; - }, - set: function (value) { - // Renderer is used to enable a dynamic class name. - if (value) { - this._renderer.addClass(this.element.nativeElement, this.selectedClass); - } - else { - this._renderer.removeClass(this.element.nativeElement, this.selectedClass); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdownMenuItem.prototype, "hasChildDropdown", { - get: function () { - return !!this.childDropdownMenu; - }, - enumerable: true, - configurable: true - }); - SuiDropdownMenuItem.prototype.performClick = function () { - // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. - this.element.nativeElement.click(); - }; - SuiDropdownMenuItem.decorators = [ - { type: _angular_core.Directive, args: [{ - // We must attach to every '.item' as Angular doesn't support > selectors. - selector: ".item" - },] }, - ]; - /** @nocollapse */ - SuiDropdownMenuItem.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - ]; }; - SuiDropdownMenuItem.propDecorators = { - "childDropdownMenu": [{ type: _angular_core.ContentChild, args: [_angular_core.forwardRef(function () { return SuiDropdownMenu; }),] },], - }; - return SuiDropdownMenuItem; -}()); -var SuiDropdownMenu = /** @class */ (function (_super) { - __extends$16(SuiDropdownMenu, _super); - function SuiDropdownMenu(renderer, element, changeDetector) { - var _this = _super.call(this, renderer, element, changeDetector) || this; - _this.element = element; - // Initialise transition functionality. - // Initialise transition functionality. - _this._transitionController = new TransitionController(false); - _this.setTransitionController(_this._transitionController); - _this.menuTransition = "slide down"; - _this.menuTransitionDuration = 200; - _this.menuAutoSelectFirst = false; - _this.menuSelectedItemClass = "selected"; - _this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); - return _this; - } - Object.defineProperty(SuiDropdownMenu.prototype, "service", { - get: function () { - return this._service; - }, - set: function (value) { - var _this = this; - this._service = value; - var previousIsOpen = this._service.isOpen; - this._service.isOpenChange.subscribe(function (isOpen) { - if (isOpen !== previousIsOpen) { - // Only run transitions if the open state has changed. - // Only run transitions if the open state has changed. - _this._transitionController.stopAll(); - _this._transitionController.animate(new Transition(_this.menuTransition, _this.menuTransitionDuration, exports.TransitionDirection.Either, function () { return _this._service.isAnimating = false; })); - } - if (!isOpen) { - // Reset the item selections when a nested item is selected to avoid incosistent open states. - if (_this.selectedItems.length > 1) { - _this.resetSelection(); - } - } - previousIsOpen = isOpen; - }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdownMenu.prototype, "items", { - set: function (items) { - this._itemsQueryOverride = items; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdownMenu.prototype, "_itemsQuery", { - get: function () { - return this._itemsQueryOverride || this._itemsQueryInternal; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdownMenu.prototype, "_items", { - // Get the list of items, ignoring those that are disabled. - get: - // Get the list of items, ignoring those that are disabled. - function () { - return this._itemsQuery.filter(function (i) { return !i.isDisabled; }); - }, - enumerable: true, - configurable: true - }); - SuiDropdownMenu.prototype.onClick = function (e) { - if (!e.eventHandled) { - e.eventHandled = true; - if (this._service.autoCloseMode === DropdownAutoCloseType.ItemClick) { - var target = e.target; - if (this.element.nativeElement.contains(target.closest(".item")) && !/input|textarea/i.test(target.tagName)) { - // Once an item is selected, we can close the entire dropdown. - this._service.setOpenState(false, true); - } - } - } - }; - SuiDropdownMenu.prototype.onDocumentKeyDown = function (e) { - // Only the root dropdown (i.e. not nested dropdowns) is responsible for keeping track of the currently selected item. - if (this._service.isOpen && !this._service.isNested) { - // Stop document events like scrolling while open. - var target = e.target; - if (!/input/i.test(target.tagName) && - [exports.KeyCode.Escape, exports.KeyCode.Enter, exports.KeyCode.Up, exports.KeyCode.Down, exports.KeyCode.Left, exports.KeyCode.Right].find(function (kC) { return kC === e.keyCode; })) { - e.preventDefault(); - } - // Gets the top selected item from the stack. - var selected = this.selectedItems.slice(-1)[0]; - // Keeping track of the menu containing the currently selected element allows us to easily determine its siblings. - var selectedContainer = this; - if (this.selectedItems.length >= 2) { - var selectedParent = this.selectedItems.slice(-2)[0]; - selectedContainer = selectedParent.childDropdownMenu; - } - switch (e.keyCode) { - // Escape : close the entire dropdown. - case exports.KeyCode.Escape: { - this._service.setOpenState(false); - break; - } - // Down : select the next item below the current one, or the 1st if none selected. - case exports.KeyCode.Down: - // Up : select the next item above the current one, or the 1st if none selected. - case exports.KeyCode.Up: { - this.selectedItems.pop(); - this.selectedItems.push(selectedContainer.updateSelection(selected, e.keyCode)); - // Prevent default regardless of whether we are in an input, to stop jumping to the start or end of the query string. - e.preventDefault(); - break; - } - // Enter : if the item doesn't contain a nested dropdown, 'click' it. Otherwise, fall through to 'Right' action. - case exports.KeyCode.Enter: { - if (selected && !selected.hasChildDropdown) { - selected.performClick(); - break; - } - } - // falls through - // Right : if the selected item contains a nested dropdown, open the dropdown & select the 1st item. - case exports.KeyCode.Right: { - if (selected && selected.hasChildDropdown) { - selected.childDropdownMenu.service.setOpenState(true); - this.selectedItems.push(selected.childDropdownMenu.updateSelection(selected, e.keyCode)); - } - break; - } - // Left : if the selected item is in a nested dropdown, close it and select the containing item. - case exports.KeyCode.Left: { - if (this.selectedItems.length >= 2) { - this.selectedItems.pop(); - var selectedParent = this.selectedItems.slice(-1)[0]; - selectedParent.childDropdownMenu.service.setOpenState(false); - selectedParent.isSelected = true; - } - break; - } - } - } - }; - SuiDropdownMenu.prototype.resetSelection = function () { - var _this = this; - this.selectedItems = []; - this._items.forEach(function (i) { - i.selectedClass = _this.menuSelectedItemClass; - i.isSelected = false; - }); - if (this.menuAutoSelectFirst && this._items.length > 0) { - // Autoselect 1st item if required & possible. - this._items[0].isSelected = true; - this.scrollToItem(this._items[0]); - this.selectedItems.push(this._itemsQuery.first); - } - }; - // Determines the item to next be selected, based on the keyboard input & the currently selected item. - // Determines the item to next be selected, based on the keyboard input & the currently selected item. - SuiDropdownMenu.prototype.updateSelection = - // Determines the item to next be selected, based on the keyboard input & the currently selected item. - function (selectedItem, keyCode) { - if (selectedItem) { - // Remove the selected status on the previously selected item. - selectedItem.isSelected = false; - } - var selectedIndex = this._items - .findIndex(function (i) { return i === selectedItem; }); - var newSelection; - switch (keyCode) { - case exports.KeyCode.Enter: - case exports.KeyCode.Right: - case exports.KeyCode.Down: - selectedIndex += 1; - break; - case exports.KeyCode.Up: - if (selectedIndex === -1) { - // If none are selected, select the 1st item. Should this be `this.items.last - 1`? - selectedIndex = 0; - break; - } - selectedIndex -= 1; - break; - } - // Select the item at the updated index. The || is to stop us selecting past the start or end of the item list. - newSelection = this._items[selectedIndex] || selectedItem; - if (newSelection) { - // Set the selected status on the newly selected item. - newSelection.isSelected = true; - // Set the current scroll position to the location of the newly selected item. - this.scrollToItem(newSelection); - } - return newSelection; - }; - SuiDropdownMenu.prototype.scrollToItem = function (item) { - var menu = this.element.nativeElement; - var selectedRect = item.element.nativeElement.getBoundingClientRect(); - var menuRect = menu.getBoundingClientRect(); - var scrollAmount = 0; - if (selectedRect.bottom > menuRect.bottom) { - scrollAmount = selectedRect.bottom - menuRect.bottom; - } - if (selectedRect.top < menuRect.top) { - scrollAmount = selectedRect.top - menuRect.top; - } - menu.scrollTop += Math.round(scrollAmount); - }; - SuiDropdownMenu.prototype.ngAfterContentInit = function () { - var _this = this; - this.onItemsChanged(); - this._itemsQuery.changes.subscribe(function () { return _this.onItemsChanged(); }); - }; - SuiDropdownMenu.prototype.onItemsChanged = function () { - // We use `_items` rather than `items` in case one or more have become disabled. - this.resetSelection(); - }; - SuiDropdownMenu.prototype.ngOnDestroy = function () { - this._documentKeyDownListener(); - }; - SuiDropdownMenu.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "[suiDropdownMenu]" - },] }, - ]; - /** @nocollapse */ - SuiDropdownMenu.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - { type: _angular_core.ChangeDetectorRef, }, - ]; }; - SuiDropdownMenu.propDecorators = { - "menuTransition": [{ type: _angular_core.Input },], - "menuTransitionDuration": [{ type: _angular_core.Input },], - "_itemsQueryInternal": [{ type: _angular_core.ContentChildren, args: [SuiDropdownMenuItem,] },], - "menuAutoSelectFirst": [{ type: _angular_core.Input },], - "menuSelectedItemClass": [{ type: _angular_core.Input },], - "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], - }; - return SuiDropdownMenu; -}(SuiTransition)); - -var SuiDropdown = /** @class */ (function () { - function SuiDropdown(_element) { - var _this = this; - this._element = _element; - this.service = new DropdownService(); - this.service.isOpenChange.subscribe(function () { - if (_this.service.isOpen) { - _this._element.nativeElement.focus(); - } - }); - } - Object.defineProperty(SuiDropdown.prototype, "children", { - get: function () { - var _this = this; - // @ContentChildren includes the current element by default. - return this._children.filter(function (c) { return c !== _this; }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "isOpenChange", { - get: function () { - return this.service.isOpenChange; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "isActive", { - get: function () { - // This is to ensure nested dropdowns don't get made bold. - return this.service.isOpen && !this.service.isNested; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "isOpen", { - get: function () { - return this.service.isOpen; - }, - set: function (value) { - // If we are opening the dropdown, we want to always open its parents. - this.service.setOpenState(value, !!value); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "isDisabled", { - get: function () { - return this.service.isDisabled; - }, - set: function (value) { - this.service.setDisabledState(value); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "tabIndex", { - get: function () { - if (this.isDisabled || this.service.isNested) { - // If disabled, remove from tabindex. - return undefined; - } - if (this._tabIndex != undefined) { - // If custom tabindex, default to that. - return this._tabIndex; - } - // Otherwise, return default of 0. - return 0; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "autoClose", { - get: function () { - return this.service.autoCloseMode; - }, - set: function (value) { - this.service.autoCloseMode = value; - }, - enumerable: true, - configurable: true - }); - SuiDropdown.prototype.ngAfterContentInit = function () { - var _this = this; - if (!this._menu) { - throw new Error("You must set [suiDropdownMenu] on the menu element."); - } - this._menu.service = this.service; - this.childrenUpdated(); - this._children.changes - .subscribe(function () { return _this.childrenUpdated(); }); - }; - SuiDropdown.prototype.childrenUpdated = function () { - var _this = this; - // Reregister child dropdowns each time the menu content changes. - this.children - .map(function (c) { return c.service; }) - .forEach(function (s) { return _this.service.registerChild(s); }); - }; - SuiDropdown.prototype.onClick = function (e) { - if (!e.eventHandled) { - e.eventHandled = true; - this.service.toggleOpenState(); - } - }; - SuiDropdown.prototype.onFocusOut = function (e) { - if (!this._element.nativeElement.contains(e.relatedTarget)) { - this.externallyClose(); - } - }; - SuiDropdown.prototype.onKeypress = function (e) { - // Block the keyboard event from being fired on parent dropdowns. - if (!e.eventHandled) { - if (e.keyCode === exports.KeyCode.Enter) { - e.eventHandled = true; - this.service.setOpenState(true); - } - } - }; - SuiDropdown.prototype.externallyClose = function () { - if (this.service.autoCloseMode === DropdownAutoCloseType.ItemClick || - this.service.autoCloseMode === DropdownAutoCloseType.OutsideClick) { - // No need to reflect in parent since they are also bound to document. - this.service.setOpenState(false); - } - }; - SuiDropdown.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "[suiDropdown]" - },] }, - ]; - /** @nocollapse */ - SuiDropdown.ctorParameters = function () { return [ - { type: _angular_core.ElementRef, }, - ]; }; - SuiDropdown.propDecorators = { - "_menu": [{ type: _angular_core.ContentChild, args: [SuiDropdownMenu,] },], - "_children": [{ type: _angular_core.ContentChildren, args: [SuiDropdown, { descendants: true },] },], - "isOpenChange": [{ type: _angular_core.Output },], - "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], - "isOpen": [{ type: _angular_core.Input },], - "isDisabled": [{ type: _angular_core.HostBinding, args: ["class.disabled",] }, { type: _angular_core.Input },], - "_tabIndex": [{ type: _angular_core.Input, args: ["tabindex",] },], - "tabIndex": [{ type: _angular_core.HostBinding, args: ["attr.tabindex",] },], - "autoClose": [{ type: _angular_core.Input },], - "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], - "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout", ["$event"],] },], - "onKeypress": [{ type: _angular_core.HostListener, args: ["keypress", ["$event"],] },], - }; - return SuiDropdown; -}()); - -var SuiDropdownModule = /** @class */ (function () { - function SuiDropdownModule() { - } - SuiDropdownModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule, - SuiTransitionModule - ], - declarations: [ - SuiDropdown, - SuiDropdownMenu, - SuiDropdownMenuItem - ], - exports: [ - SuiDropdown, - SuiDropdownMenu, - SuiDropdownMenuItem - ] - },] }, - ]; - /** @nocollapse */ - SuiDropdownModule.ctorParameters = function () { return []; }; - return SuiDropdownModule; -}()); - -// Helper class to support method chaining when calling `SuiModalService.open(...)`. -var ActiveModal = /** @class */ (function () { - function ActiveModal(instance, componentRef) { - var _this = this; - this._config = instance; - this._componentRef = componentRef; - // Automatically destroy the modal component when it has been dismissed. - this.component.onDismiss.subscribe(function () { return _this._componentRef.destroy(); }); - } - Object.defineProperty(ActiveModal.prototype, "component", { - // Shorthand for direct access to the `SuiModal` instance. - get: - // Shorthand for direct access to the `SuiModal` instance. - function () { - return this._componentRef.instance; - }, - enumerable: true, - configurable: true - }); - // Registers a callback for when `onApprove` is fired. - // Registers a callback for when `onApprove` is fired. - ActiveModal.prototype.onApprove = - // Registers a callback for when `onApprove` is fired. - function (callback) { - this.component.onApprove.subscribe(function (res) { return callback(res); }); - return this; - }; - // Registers a callback for when `onDeny` is fired. - // Registers a callback for when `onDeny` is fired. - ActiveModal.prototype.onDeny = - // Registers a callback for when `onDeny` is fired. - function (callback) { - this.component.onDeny.subscribe(function (res) { return callback(res); }); - return this; - }; - // Fires the approve event of the modal manually. - // Fires the approve event of the modal manually. - ActiveModal.prototype.approve = - // Fires the approve event of the modal manually. - function (result) { - this.component.approve(result); - }; - // Fires the deny event of the modal manually. - // Fires the deny event of the modal manually. - ActiveModal.prototype.deny = - // Fires the deny event of the modal manually. - function (result) { - this.component.deny(result); - }; - // Removes the modal component instantly, without transitions or firing any events. - // Removes the modal component instantly, without transitions or firing any events. - ActiveModal.prototype.destroy = - // Removes the modal component instantly, without transitions or firing any events. - function () { - this._componentRef.destroy(); - }; - return ActiveModal; -}()); - -var __extends$17 = (undefined && undefined.__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 __()); - }; -})(); -var ModalSize = { - Mini: "mini", - Tiny: "tiny", - Small: "small", - Normal: "normal", - Large: "large" -}; -// Stores a basic set of configuration options for a modal. -var ModalConfig = /** @class */ (function () { - function ModalConfig(context, isClosable) { - if (context === void 0) { context = undefined; } - if (isClosable === void 0) { isClosable = true; } - // Initialise with default values. - this.isClosable = isClosable; - this.context = context; - this.size = ModalSize.Normal; - this.isFullScreen = false; - this.isBasic = false; - this.isInverted = false; - this.mustScroll = false; - this.transition = "scale"; - this.transitionDuration = 500; - } - return ModalConfig; -}()); -// Used when creating a modal from a `TemplateRef`. -var TemplateModalConfig = /** @class */ (function (_super) { - __extends$17(TemplateModalConfig, _super); - function TemplateModalConfig(template, context, isClosable) { - if (context === void 0) { context = undefined; } - if (isClosable === void 0) { isClosable = true; } - var _this = _super.call(this, context, isClosable) || this; - _this.template = template; - return _this; - } - return TemplateModalConfig; -}(ModalConfig)); -// Used when creating a modal from an existing component. -var ComponentModalConfig = /** @class */ (function (_super) { - __extends$17(ComponentModalConfig, _super); - function ComponentModalConfig(component, context, isClosable) { - if (context === void 0) { context = undefined; } - if (isClosable === void 0) { isClosable = true; } - var _this = _super.call(this, context, isClosable) || this; - _this.component = component; - return _this; - } - return ComponentModalConfig; -}(ModalConfig)); - -var __extends$18 = (undefined && undefined.__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 __()); - }; -})(); -// Used to pass ability to control a modal to a component. -var ModalControls = /** @class */ (function () { - function ModalControls(approve, deny) { - this.approve = approve; - this.deny = deny; - } - // Use method here rather than arrow variables to make intellisense show they're methods. - // Use method here rather than arrow variables to make intellisense show they're methods. - ModalControls.prototype.approve = - // Use method here rather than arrow variables to make intellisense show they're methods. - function (result) { }; - ModalControls.prototype.deny = function (result) { }; - return ModalControls; -}()); -// Injected into custom modal components, to allow control of the modal, and access to a context object. -var Modal = /** @class */ (function (_super) { - __extends$18(Modal, _super); - function Modal(controls, context) { - var _this = - // Instances of `ModalControls` are only created in the `SuiModal` constructor, - // so we take an initialised instance rather than remaking one each time. - _super.call(this, controls.approve, controls.deny) || this; - _this.context = context; - return _this; - } - return Modal; -}(ModalControls)); - -var __extends$19 = (undefined && undefined.__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 __()); - }; -})(); -// Shorthand for a modal template. Sets up ability to write: `...` -// We use an abstract class as ModalTemplate tends to be used within decorated properties, which means it needs to exist! -var ModalTemplate = /** @class */ (function (_super) { - __extends$19(ModalTemplate, _super); - function ModalTemplate() { - return _super !== null && _super.apply(this, arguments) || this; - } - return ModalTemplate; -}(_angular_core.TemplateRef)); - -var SuiModal = /** @class */ (function () { - function SuiModal(_renderer, _element, _componentFactory) { - var _this = this; - this._renderer = _renderer; - this._element = _element; - this._componentFactory = _componentFactory; - // Initialise with default configuration from `ModalConfig` (to avoid writing defaults twice). - var config = new ModalConfig(); - this.loadConfig(config); - // Event emitters for each of the possible modal outcomes. - this.onApprove = new _angular_core.EventEmitter(); - this.onDeny = new _angular_core.EventEmitter(); - this.onDismiss = new _angular_core.EventEmitter(); - // Initialise controls with actions for the `approve` and `deny` cases. - this.controls = new ModalControls(function (res) { return _this.dismiss(function () { return _this.onApprove.emit(res); }); }, function (res) { return _this.dismiss(function () { return _this.onDeny.emit(res); }); }); - // Internal variable initialisation. - this.dimBackground = false; - this._isClosing = false; - this.transitionController = new TransitionController(false); - } - Object.defineProperty(SuiModal.prototype, "approve", { - get: function () { - return this.controls.approve; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiModal.prototype, "deny", { - get: function () { - return this.controls.deny; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiModal.prototype, "isFullScreen", { - get: - // Value to deny with when closing via `isClosable`. - function () { - return this._isFullScreen; - }, - set: function (fullScreen) { - this._isFullScreen = Util.DOM.parseBooleanAttribute(fullScreen); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiModal.prototype, "mustScroll", { - get: function () { - return this._mustScroll; - }, - set: function (mustScroll) { - this._mustScroll = mustScroll; - // 'Cache' value in _mustAlwaysScroll so that if `true`, _mustScroll isn't ever auto-updated. - this._mustAlwaysScroll = mustScroll; - this.updateScroll(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiModal.prototype, "isInverted", { - get: function () { - return this._isInverted; - }, - set: function (inverted) { - this._isInverted = Util.DOM.parseBooleanAttribute(inverted); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiModal.prototype, "dynamicClasses", { - get: function () { - var classes = {}; - if (this.size) { - classes[this.size] = true; - } - return classes; - }, - enumerable: true, - configurable: true - }); - SuiModal.prototype.ngOnInit = function () { - var _this = this; - // Transition the modal to be visible. - this.transitionController.animate(new Transition(this.transition, this.transitionDuration, exports.TransitionDirection.In)); - setTimeout(function () { return _this.dimBackground = true; }); - }; - SuiModal.prototype.ngAfterViewInit = function () { - var _this = this; - // Move the modal to the document body to ensure correct scrolling. - this._originalContainer = this._element.nativeElement.parentNode; - document.querySelector("body").appendChild(this._element.nativeElement); - // Remove the #templateSibling element from the DOM to fix bottom border styles. - var templateElement = this.templateSibling.element.nativeElement; - if (templateElement.parentNode) { - templateElement.parentNode.removeChild(templateElement); - } - // Update margin offset to center modal correctly on-screen. - var element = this._modalElement.nativeElement; - setTimeout(function () { - _this._renderer.setStyle(element, "margin-top", "-" + element.clientHeight / 2 + "px"); - _this.updateScroll(); - }); - // Focus any element with [autofocus] attribute. - var autoFocus = element.querySelector("[autofocus]"); - if (autoFocus) { - // Autofocus after the browser has had time to process other event handlers. - setTimeout(function () { return autoFocus.focus(); }, 10); - // Try to focus again when the modal has opened so that autofocus works in IE11. - setTimeout(function () { return autoFocus.focus(); }, this.transitionDuration); - } - }; - // Updates the modal with the specified configuration. - // Updates the modal with the specified configuration. - SuiModal.prototype.loadConfig = - // Updates the modal with the specified configuration. - function (config) { - this.isClosable = config.isClosable; - this.closeResult = config.closeResult; - this.size = config.size; - this.isFullScreen = config.isFullScreen; - this.isBasic = config.isBasic; - this.isInverted = config.isInverted; - this.mustScroll = config.mustScroll; - this.transition = config.transition; - this.transitionDuration = config.transitionDuration; - }; - // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. - // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. - SuiModal.prototype.dismiss = - // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. - function (callback) { - var _this = this; - if (callback === void 0) { callback = function () { }; } - // If we aren't currently closing, - if (!this._isClosing) { - this._isClosing = true; - // Transition the modal to be invisible. - this.dimBackground = false; - this.transitionController.stopAll(); - this.transitionController.animate(new Transition(this.transition, this.transitionDuration, exports.TransitionDirection.Out, function () { - // When done, move the modal back to its original location, emit a dismiss event, and fire the callback. - if (_this._originalContainer) { - _this._originalContainer.appendChild(_this._element.nativeElement); - } - _this.onDismiss.emit(); - callback(); - })); - } - }; - // Closes the modal with a 'deny' outcome, using the specified default reason. - // Closes the modal with a 'deny' outcome, using the specified default reason. - SuiModal.prototype.close = - // Closes the modal with a 'deny' outcome, using the specified default reason. - function () { - if (this.isClosable) { - // If we are allowed to close, fire the deny result with the default value. - this.deny(this.closeResult); - } - }; - // Decides whether the modal needs to reposition to allow scrolling. - // Decides whether the modal needs to reposition to allow scrolling. - SuiModal.prototype.updateScroll = - // Decides whether the modal needs to reposition to allow scrolling. - function () { - // Semantic UI modal margin is 3.5rem, which is relative to the global font size, so for compatibility: - var fontSize = parseFloat(window.getComputedStyle(document.documentElement).getPropertyValue("font-size")); - var margin = fontSize * 3.5; - // _mustAlwaysScroll works by stopping _mustScroll from being automatically updated, so it stays `true`. - if (!this._mustAlwaysScroll && this._modalElement) { - var element = this._modalElement.nativeElement; - // The modal must scroll if the window height is smaller than the modal height + both margins. - this._mustScroll = window.innerHeight < element.clientHeight + margin * 2; - } - }; - SuiModal.prototype.onClick = function (e) { - // Makes sense here, as the modal shouldn't be attached to any DOM element. - e.stopPropagation(); - }; - // Document listener is fine here because nobody will enough modals open. - SuiModal.prototype.onDocumentKeyUp = - // Document listener is fine here because nobody will enough modals open. - function (e) { - if (e.keyCode === exports.KeyCode.Escape) { - // Close automatically covers case of `!isClosable`, so check not needed. - this.close(); - } - }; - SuiModal.prototype.onDocumentResize = function () { - this.updateScroll(); - }; - SuiModal.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-modal", - template: "\n\n\n\n \n
\n\n \n \n \n \n \n
\n
\n
\n", - styles: ["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiModal.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - { type: SuiComponentFactory, }, - ]; }; - SuiModal.propDecorators = { - "isClosable": [{ type: _angular_core.Input },], - "closeResult": [{ type: _angular_core.Input },], - "onApprove": [{ type: _angular_core.Output, args: ["approved",] },], - "onDeny": [{ type: _angular_core.Output, args: ["denied",] },], - "onDismiss": [{ type: _angular_core.Output, args: ["dismissed",] },], - "_modalElement": [{ type: _angular_core.ViewChild, args: ["modal",] },], - "size": [{ type: _angular_core.Input },], - "isFullScreen": [{ type: _angular_core.Input },], - "isBasic": [{ type: _angular_core.Input },], - "mustScroll": [{ type: _angular_core.Input },], - "isInverted": [{ type: _angular_core.Input },], - "transition": [{ type: _angular_core.Input },], - "transitionDuration": [{ type: _angular_core.Input },], - "templateSibling": [{ type: _angular_core.ViewChild, args: ["templateSibling", { read: _angular_core.ViewContainerRef },] },], - "onDocumentKeyUp": [{ type: _angular_core.HostListener, args: ["document:keyup", ["$event"],] },], - "onDocumentResize": [{ type: _angular_core.HostListener, args: ["window:resize",] },], - }; - return SuiModal; -}()); - -var SuiModalService = /** @class */ (function () { - function SuiModalService(_componentFactory) { - this._componentFactory = _componentFactory; - } - SuiModalService.prototype.open = function (modal) { - // Generate the modal component to be shown. - var componentRef = this._componentFactory.createComponent(SuiModal); - // Shorthand for the created modal component instance. - var modalComponent = componentRef.instance; - if (modal instanceof TemplateModalConfig) { - // Inject the template into the view. - this._componentFactory.createView(modalComponent.templateSibling, modal.template, { - // `let-context` - $implicit: modal.context, - // `let-modal="modal"` - modal: componentRef.instance.controls - }); - } - else if (modal instanceof ComponentModalConfig) { - // Generate the component to be used as the modal content, - // injecting an instance of `Modal` to be used in the component constructor. - var contentComponentRef = this._componentFactory.createComponent(modal.component, [ - { - provide: Modal, - useValue: new Modal(modalComponent.controls, modal.context) - } - ]); - // Insert the new component into the content of the modal. - this._componentFactory.attachToView(contentComponentRef, modalComponent.templateSibling); - // Shorthand for access to the content component's DOM element. - var contentElement = contentComponentRef.location.nativeElement; - // Move all of the DOM elements inside the component to the main modal element. - // This is done so that CSS classes apply correctly. It does stop any custom styles from working however, - // so other ways may have to be investigated. - while (contentElement.hasChildNodes() && contentElement.parentElement && contentElement.firstChild) { - contentElement.parentElement.appendChild(contentElement.removeChild(contentElement.firstChild)); - } - // Remove the generated component's 'empty shell' from the DOM. - this._componentFactory.detachFromDocument(contentComponentRef); - } - // Attach the new modal component to the application. - // The component will move itself to the document body for correctl styling. - this._componentFactory.attachToApplication(componentRef); - // Initialise the generated modal with the provided config. - modalComponent.loadConfig(modal); - // Return an instance of an `ActiveModal`, so the user can control the new modal. - return new ActiveModal(modal, componentRef); - }; - SuiModalService.decorators = [ - { type: _angular_core.Injectable }, - ]; - /** @nocollapse */ - SuiModalService.ctorParameters = function () { return [ - { type: SuiComponentFactory, }, - ]; }; - return SuiModalService; -}()); - -var SuiModalModule = /** @class */ (function () { - function SuiModalModule() { - } - SuiModalModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule, - SuiDimmerModule, - SuiTransitionModule, - SuiUtilityModule - ], - declarations: [ - SuiModal - ], - exports: [ - SuiModal - ], - providers: [ - SuiModalService - ], - entryComponents: [ - SuiModal - ] - },] }, - ]; - /** @nocollapse */ - SuiModalModule.ctorParameters = function () { return []; }; - return SuiModalModule; -}()); - -var SuiProgress = /** @class */ (function () { - function SuiProgress() { - this._popupClasses = true; - this.value = 0; - this.maximum = 100; - this.precision = 0; - this._overrideSuccess = false; - this.autoSuccess = true; - this.showProgress = true; - this._popupClasses = true; - } - Object.defineProperty(SuiProgress.prototype, "value", { - get: function () { - return this._value; - }, - set: function (value) { - // Convert value from string to number where necessary. - var converted = +value; - if (Number.isNaN(converted)) { - return; - } - this._value = converted; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiProgress.prototype, "maximum", { - get: function () { - return this._maximum; - }, - set: function (value) { - // Convert value from string to number where necessary. - var converted = +value; - if (Number.isNaN(converted)) { - return; - } - this._maximum = converted; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiProgress.prototype, "precision", { - get: function () { - return this._precision; - }, - set: function (value) { - // Convert value from string to number where necessary. - var converted = +value; - if (Number.isNaN(converted)) { - return; - } - this._precision = Math.min(Math.max(converted, 0), 20); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiProgress.prototype, "_reachedMaximum", { - get: function () { - return this._overrideSuccess || ((this.value >= this.maximum) && this.autoSuccess); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiProgress.prototype, "percentage", { - get: function () { - var boundedValue = Math.min(Math.max(this.value, 0), this.maximum); - var percentage = (boundedValue / this.maximum) * 100; - return percentage.toFixed(this.precision); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiProgress.prototype, "classValue", { - set: function (classes) { - if (classes.includes("attached") || classes.includes("tiny")) { - this.showProgress = false; - } - if (classes.includes("success")) { - this._overrideSuccess = true; - } - }, - enumerable: true, - configurable: true - }); - SuiProgress.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-progress", - template: "\n
\n
{{ percentage }}%
\n
\n
\n \n
\n", - styles: ["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiProgress.ctorParameters = function () { return []; }; - SuiProgress.propDecorators = { - "_popupClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.progress",] },], - "autoSuccess": [{ type: _angular_core.Input },], - "showProgress": [{ type: _angular_core.Input },], - "value": [{ type: _angular_core.Input },], - "maximum": [{ type: _angular_core.Input },], - "precision": [{ type: _angular_core.Input },], - "_reachedMaximum": [{ type: _angular_core.HostBinding, args: ["class.success",] },], - "percentage": [{ type: _angular_core.HostBinding, args: ["attr.data-percent",] },], - "classValue": [{ type: _angular_core.Input, args: ["class",] },], - }; - return SuiProgress; -}()); - -var SuiProgressModule = /** @class */ (function () { - function SuiProgressModule() { - } - SuiProgressModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule - ], - declarations: [ - SuiProgress - ], - exports: [ - SuiProgress - ] - },] }, - ]; - /** @nocollapse */ - SuiProgressModule.ctorParameters = function () { return []; }; - return SuiProgressModule; -}()); - -var __extends$20 = (undefined && undefined.__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 __()); - }; -})(); -var SuiRating = /** @class */ (function () { - function SuiRating() { - this.hoveredIndex = -1; - this.value = 0; - this.valueChange = new _angular_core.EventEmitter(); - this.maximum = 5; - this.isReadonly = false; - this._ratingClasses = true; - } - Object.defineProperty(SuiRating.prototype, "maximum", { - get: function () { - return this._maximum; - }, - set: function (value) { - this._maximum = +value; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiRating.prototype, "icons", { - get: function () { - // tslint:disable-next-line:prefer-literal - return new Array(this.maximum); - }, - enumerable: true, - configurable: true - }); - SuiRating.prototype.onClick = function (i) { - if (!this.isReadonly) { - this.value = i + 1; - this.valueChange.emit(this.value); - } - }; - SuiRating.prototype.onMouseover = function (i) { - this.hoveredIndex = i; - }; - SuiRating.prototype.onMouseout = function () { - this.hoveredIndex = -1; - }; - SuiRating.prototype.writeValue = function (value) { - this.value = value; - }; - SuiRating.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-rating", - template: "\n= i && !isReadonly\"\n [class.active]=\"value > i\">\n\n", - styles: ["\n:host.read-only .icon {\n cursor: auto\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiRating.ctorParameters = function () { return []; }; - SuiRating.propDecorators = { - "_ratingClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.rating",] },], - "valueChange": [{ type: _angular_core.Output },], - "maximum": [{ type: _angular_core.Input },], - "isReadonly": [{ type: _angular_core.HostBinding, args: ["class.read-only",] }, { type: _angular_core.Input },], - "onMouseout": [{ type: _angular_core.HostListener, args: ["mouseout",] },], - }; - return SuiRating; -}()); -var SuiRatingValueAccessor = /** @class */ (function (_super) { - __extends$20(SuiRatingValueAccessor, _super); - function SuiRatingValueAccessor(host) { - return _super.call(this, host) || this; - } - SuiRatingValueAccessor.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "sui-rating", - host: { "(valueChange)": "onChange($event)" }, - providers: [customValueAccessorFactory(SuiRatingValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiRatingValueAccessor.ctorParameters = function () { return [ - { type: SuiRating, }, - ]; }; - return SuiRatingValueAccessor; -}(CustomValueAccessor)); - -var SuiRatingModule = /** @class */ (function () { - function SuiRatingModule() { - } - SuiRatingModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_forms.FormsModule, - _angular_common.CommonModule - ], - declarations: [ - SuiRating, - SuiRatingValueAccessor - ], - exports: [ - SuiRating, - SuiRatingValueAccessor - ] - },] }, - ]; - /** @nocollapse */ - SuiRatingModule.ctorParameters = function () { return []; }; - return SuiRatingModule; -}()); - -var SuiSearchResult = /** @class */ (function () { - function SuiSearchResult(componentFactory) { - this.componentFactory = componentFactory; - this._optionClasses = true; - // By default we make this function return an empty string, for the brief moment when it isn't displaying the correct label. - this.formatter = function (value) { return ""; }; - } - Object.defineProperty(SuiSearchResult.prototype, "template", { - get: function () { - return this._template; - }, - set: function (template) { - this._template = template; - if (this.template) { - this.componentFactory.createView(this.templateSibling, this.template, { - $implicit: this.value, - query: this.query - }); - } - }, - enumerable: true, - configurable: true - }); - SuiSearchResult.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-search-result", - template: "\n\n\n" - },] }, - ]; - /** @nocollapse */ - SuiSearchResult.ctorParameters = function () { return [ - { type: SuiComponentFactory, }, - ]; }; - SuiSearchResult.propDecorators = { - "_optionClasses": [{ type: _angular_core.HostBinding, args: ["class.result",] },], - "value": [{ type: _angular_core.Input },], - "query": [{ type: _angular_core.Input },], - "formatter": [{ type: _angular_core.Input },], - "template": [{ type: _angular_core.Input },], - "templateSibling": [{ type: _angular_core.ViewChild, args: ["templateSibling", { read: _angular_core.ViewContainerRef },] },], - }; - return SuiSearchResult; -}()); - -var SearchService = /** @class */ (function () { - function SearchService(allowEmptyQuery) { - if (allowEmptyQuery === void 0) { allowEmptyQuery = false; } - var _this = this; - this._options = []; - this.optionsFilter = function (os, q) { - // Convert the query string to a RegExp. - var regex = _this.toRegex(_this._query); - if (regex instanceof RegExp) { - // Only update the results if the query was valid regex. - // This avoids the results suddenly becoming empty if an invalid regex string is inputted. - return os - .filter(function (o) { - return Util.Object.readValue(o, _this._optionsField) - .toString() - .match(regex); - }); - } - // Don't update since it wasn't a valid regex. - return false; - }; - // Set default values and reset. - this.allowEmptyQuery = allowEmptyQuery; - this._query = ""; - this.resetQueryOnChange = true; - this.searchDelay = 0; - this.reset(); - } - Object.defineProperty(SearchService.prototype, "options", { - get: function () { - return this._options; - }, - set: function (options) { - this._options = options || []; - // We cannot use both local & remote options simultaneously. - this._optionsLookup = undefined; - // Reset entire service with new options. - this.reset(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "optionsLookup", { - get: function () { - return this._optionsLookup; - }, - set: function (lookupFn) { - this._optionsLookup = lookupFn; - // As before, cannot use local & remote options simultaneously. - this._options = []; - this.reset(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "hasItemLookup", { - get: function () { - return !!this.optionsLookup && this.optionsLookup.length === 2; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "optionsField", { - get: function () { - return this._optionsField; - }, - set: function (field) { - this._optionsField = field; - // We need to reset otherwise we would now be showing invalid search results. - this.reset(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "results", { - get: function () { - return this._results; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "query", { - get: function () { - return this._query; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "isSearching", { - get: function () { - return this._isSearching; - }, - enumerable: true, - configurable: true - }); - // Updates the query after the specified search delay. - // Updates the query after the specified search delay. - SearchService.prototype.updateQueryDelayed = - // Updates the query after the specified search delay. - function (query, callback) { - var _this = this; - if (callback === void 0) { callback = function () { }; } - this._query = query; - clearTimeout(this._searchDelayTimeout); - this._searchDelayTimeout = window.setTimeout(function () { - _this.updateQuery(query, callback); - }, this.searchDelay); - }; - // Updates the current search query. - // Updates the current search query. - SearchService.prototype.updateQuery = - // Updates the current search query. - function (query, callback) { - var _this = this; - if (callback === void 0) { callback = function () { }; } - this._query = query; - if (this._query === "" && !this.allowEmptyQuery) { - // Don't update if the new query is empty (and we don't allow empty queries). - // Don't reset so that when animating closed we don't get a judder. - return callback(); - } - if (this._resultsCache.hasOwnProperty(this._query)) { - // If the query is already cached, make use of it. - this._results = this._resultsCache[this._query]; - return callback(); - } - if (this._optionsLookup) { - this._isSearching = true; - // Call the options lookup without a this context. - var queryLookup = this._optionsLookup.call(undefined, this._query); - queryLookup - .then(function (results) { - _this._isSearching = false; - _this.updateResults(results); - return callback(); - }) - .catch(function (error) { - // Unset 'loading' state, and throw the returned error without updating the results. - // Unset 'loading' state, and throw the returned error without updating the results. - _this._isSearching = false; - return callback(error); - }); - return; - } - var filtered = this.optionsFilter.call(undefined, this._options, this._query); - if (filtered) { - this.updateResults(filtered); - } - return callback(); - }; - // Updates & caches the new set of results. - // Updates & caches the new set of results. - SearchService.prototype.updateResults = - // Updates & caches the new set of results. - function (results) { - this._resultsCache[this._query] = results; - this._results = results; - }; - // tslint:disable-next-line:promise-function-async - // tslint:disable-next-line:promise-function-async - SearchService.prototype.initialLookup = - // tslint:disable-next-line:promise-function-async - function (initial) { - if (initial instanceof Array) { - return this._optionsLookup(undefined, initial); - } - return this._optionsLookup(undefined, initial); - }; - // Converts a query string to regex without throwing an error. - // Converts a query string to regex without throwing an error. - SearchService.prototype.toRegex = - // Converts a query string to regex without throwing an error. - function (query) { - try { - return new RegExp(query, "i"); - } - catch (e) { - return query; - } - }; - // Generates HTML for highlighted match text. - // Generates HTML for highlighted match text. - SearchService.prototype.highlightMatches = - // Generates HTML for highlighted match text. - function (text, query) { - var regex = this.toRegex(query); - if (regex instanceof RegExp) { - return text.replace(regex, function (match) { return "" + match + ""; }); - } - return text; - }; - // Resets the search back to a pristine state. - // Resets the search back to a pristine state. - SearchService.prototype.reset = - // Resets the search back to a pristine state. - function () { - this._results = []; - this._resultsCache = {}; - this._isSearching = false; - if (this.resetQueryOnChange || !this.query) { - this.updateQuery(""); - } - else { - this.updateQuery(this.query); - } - }; - return SearchService; -}()); - -var SuiSearch = /** @class */ (function () { - function SuiSearch(_element, renderer, _localizationService) { - var _this = this; - this._element = _element; - this._localizationService = _localizationService; - this.dropdownService = new DropdownService(); - this.searchService = new SearchService(); - this.onLocaleUpdate(); - this._localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); - this._searchClasses = true; - this.hasIcon = true; - this.allowEmptyQuery = false; - this.resetQueryOnChange = true; - this.retainSelectedResult = true; - this.searchDelay = 200; - this.maxResults = 7; - this.onResultSelected = new _angular_core.EventEmitter(); - this.transition = "scale"; - this.transitionDuration = 200; - this._documentClickListener = renderer.listen("document", "click", function (e) { return _this.onDocumentClick(e); }); - } - Object.defineProperty(SuiSearch.prototype, "isActive", { - get: function () { - return this.dropdownService.isOpen; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "resetQueryOnChange", { - set: - // Sets whether the query is reset if options change. - function (resetQueryOnChange) { - this.searchService.resetQueryOnChange = resetQueryOnChange; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "allowEmptyQuery", { - get: function () { - return this._allowEmptyQuery; - }, - set: - // Sets whether the search element display result with empty query. - function (allowEmptyQuery) { - this._allowEmptyQuery = allowEmptyQuery; - this.searchService.allowEmptyQuery = allowEmptyQuery; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "placeholder", { - get: - // Gets & sets the placeholder text displayed inside the text input. - function () { - return this._placeholder || this.localeValues.placeholder; - }, - set: function (placeholder) { - this._placeholder = placeholder; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "localeValues", { - get: function () { - return this._localizationService.override(this._localeValues, this.localeOverrides); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "query", { - get: function () { - return this.searchService.query; - }, - set: function (query) { - var _this = this; - this.selectedResult = undefined; - // Initialise a delayed search. - this.searchService.updateQueryDelayed(query, function () { - // Set the results open state depending on whether a query has been entered. - return - // Set the results open state depending on whether a query has been entered. - _this.dropdownService.setOpenState(_this.searchService.query.length > 0 || _this.allowEmptyQuery); - }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "options", { - set: function (options) { - if (options) { - this.searchService.options = options; - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "optionsFilter", { - set: function (filter) { - if (filter) { - this.searchService.optionsFilter = filter; - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "optionsLookup", { - set: function (lookupFn) { - this.searchService.optionsLookup = lookupFn; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "optionsField", { - set: function (field) { - this.searchService.optionsField = field; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "resultFormatter", { - get: function () { - var _this = this; - if (this._resultFormatter) { - return this._resultFormatter; - } - else if (this.searchService.optionsLookup) { - return function (r) { return _this.readValue(r); }; - } - else { - return function (r, q) { return _this.searchService.highlightMatches(_this.readValue(r), q); }; - } - }, - set: function (formatter) { - this._resultFormatter = formatter; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "searchDelay", { - set: function (delay) { - this.searchService.searchDelay = delay; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "isSearching", { - get: function () { - return this.searchService.isSearching; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "results", { - get: function () { - return this.searchService.results.slice(0, this.maxResults); - }, - enumerable: true, - configurable: true - }); - SuiSearch.prototype.ngAfterViewInit = function () { - this._menu.service = this.dropdownService; - }; - SuiSearch.prototype.onLocaleUpdate = function () { - this._localeValues = this._localizationService.get().search; - }; - // Selects a result. - // Selects a result. - SuiSearch.prototype.select = - // Selects a result. - function (result) { - this.onResultSelected.emit(result); - this.dropdownService.setOpenState(false); - if (this.retainSelectedResult) { - this.selectedResult = result; - this.searchService.updateQuery(this.readValue(result)); - } - else { - this.searchService.updateQuery(""); - } - }; - SuiSearch.prototype.onClick = function (e) { - this.open(); - }; - SuiSearch.prototype.onFocusIn = function () { - if (!this.dropdownService.isAnimating) { - this.open(); - } - }; - SuiSearch.prototype.open = function () { - if (this.searchService.query.length > 0 || this.allowEmptyQuery) { - // Only open on click when there is a query entered. - this.dropdownService.setOpenState(true); - } - }; - SuiSearch.prototype.onFocusOut = function (e) { - if (!this._element.nativeElement.contains(e.relatedTarget)) { - this.dropdownService.setOpenState(false); - } - }; - SuiSearch.prototype.onDocumentClick = function (e) { - if (!this._element.nativeElement.contains(e.target)) { - this.dropdownService.setOpenState(false); - } - }; - // Reads the specified field from an item. - // Reads the specified field from an item. - SuiSearch.prototype.readValue = - // Reads the specified field from an item. - function (object) { - return Util.Object.readValue(object, this.searchService.optionsField); - }; - SuiSearch.prototype.ngOnDestroy = function () { - this._documentClickListener(); - }; - SuiSearch.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-search", - template: "\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n", - styles: ["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiSearch.ctorParameters = function () { return [ - { type: _angular_core.ElementRef, }, - { type: _angular_core.Renderer2, }, - { type: SuiLocalizationService, }, - ]; }; - SuiSearch.propDecorators = { - "_menu": [{ type: _angular_core.ViewChild, args: [SuiDropdownMenu,] },], - "_searchClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.search",] },], - "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], - "hasIcon": [{ type: _angular_core.Input },], - "resetQueryOnChange": [{ type: _angular_core.Input },], - "allowEmptyQuery": [{ type: _angular_core.Input },], - "placeholder": [{ type: _angular_core.Input },], - "options": [{ type: _angular_core.Input },], - "optionsFilter": [{ type: _angular_core.Input },], - "optionsLookup": [{ type: _angular_core.Input },], - "optionsField": [{ type: _angular_core.Input },], - "resultFormatter": [{ type: _angular_core.Input },], - "resultTemplate": [{ type: _angular_core.Input },], - "retainSelectedResult": [{ type: _angular_core.Input },], - "searchDelay": [{ type: _angular_core.Input },], - "isSearching": [{ type: _angular_core.HostBinding, args: ["class.loading",] },], - "maxResults": [{ type: _angular_core.Input },], - "onResultSelected": [{ type: _angular_core.Output, args: ["resultSelected",] },], - "transition": [{ type: _angular_core.Input },], - "transitionDuration": [{ type: _angular_core.Input },], - "onFocusIn": [{ type: _angular_core.HostListener, args: ["focusin",] },], - "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout", ["$event"],] },], - }; - return SuiSearch; -}()); - -var SuiSearchModule = /** @class */ (function () { - function SuiSearchModule() { - } - SuiSearchModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule, - _angular_forms.FormsModule, - SuiDropdownModule, - SuiLocalizationModule, - SuiUtilityModule - ], - declarations: [ - SuiSearch, - SuiSearchResult - ], - exports: [ - SuiSearch - ] - },] }, - ]; - /** @nocollapse */ - SuiSearchModule.ctorParameters = function () { return []; }; - return SuiSearchModule; -}()); - -var __extends$21 = (undefined && undefined.__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 __()); - }; -})(); -var SuiSelectOption = /** @class */ (function (_super) { - __extends$21(SuiSelectOption, _super); - function SuiSelectOption(renderer, element, changeDetector) { - var _this = - // We inherit SuiDropdownMenuItem to automatically gain all keyboard navigation functionality. - // This is not done via adding the .item class because it isn't supported by Angular. - _super.call(this, renderer, element) || this; - _this.changeDetector = changeDetector; - _this._optionClasses = true; - _this.isActive = false; - _this.onSelected = new _angular_core.EventEmitter(); - // By default we make the default text an empty label, for the brief moment when it isn't displaying the correct one. - // By default we make the default text an empty label, for the brief moment when it isn't displaying the correct one. - _this.renderedText = ""; - _this.usesTemplate = false; - return _this; - } - Object.defineProperty(SuiSelectOption.prototype, "formatter", { - set: function (formatter) { - if (!this.usesTemplate) { - this.renderedText = formatter(this.value); - } - else { - this.renderedText = ""; - } - }, - enumerable: true, - configurable: true - }); - SuiSelectOption.prototype.onClick = function (e) { - var _this = this; - e.eventHandled = true; - setTimeout(function () { return _this.onSelected.emit(_this.value); }); - }; - SuiSelectOption.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-select-option", - template: "\n\n\n" - },] }, - ]; - /** @nocollapse */ - SuiSelectOption.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - { type: _angular_core.ChangeDetectorRef, }, - ]; }; - SuiSelectOption.propDecorators = { - "_optionClasses": [{ type: _angular_core.HostBinding, args: ["class.item",] },], - "value": [{ type: _angular_core.Input },], - "onSelected": [{ type: _angular_core.Output },], - "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], - "templateSibling": [{ type: _angular_core.ViewChild, args: ["templateSibling", { read: _angular_core.ViewContainerRef },] },], - "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], - }; - return SuiSelectOption; -}(SuiDropdownMenuItem)); - -var SuiSelectSearch = /** @class */ (function () { - function SuiSelectSearch(_renderer, _element) { - this._renderer = _renderer; - this._element = _element; - this.onQueryUpdated = new _angular_core.EventEmitter(); - this.onQueryKeyDown = new _angular_core.EventEmitter(); - this._searchClass = true; - this._autoComplete = "off"; - } - Object.defineProperty(SuiSelectSearch.prototype, "query", { - set: function (query) { - this._renderer.setProperty(this._element.nativeElement, "value", query); - }, - enumerable: true, - configurable: true - }); - SuiSelectSearch.prototype.updateQuery = function (query) { - this.onQueryUpdated.emit(query); - }; - SuiSelectSearch.prototype.onKeyDown = function (e) { - this.onQueryKeyDown.emit(e); - }; - SuiSelectSearch.prototype.focus = function () { - var _this = this; - // Slightly delay to support in menu search. - this._element.nativeElement.focus(); - setTimeout(function () { return _this._element.nativeElement.focus(); }); - }; - SuiSelectSearch.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "input[suiSelectSearch]" - },] }, - ]; - /** @nocollapse */ - SuiSelectSearch.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - ]; }; - SuiSelectSearch.propDecorators = { - "_searchClass": [{ type: _angular_core.HostBinding, args: ["class.search",] },], - "_autoComplete": [{ type: _angular_core.HostBinding, args: ["attr.autocomplete",] },], - "updateQuery": [{ type: _angular_core.HostListener, args: ["input", ["$event.target.value"],] },], - "onKeyDown": [{ type: _angular_core.HostListener, args: ["keydown", ["$event"],] },], - }; - return SuiSelectSearch; -}()); - -// We use generic type T to specify the type of the options we are working with, -// and U to specify the type of the property of the option used as the value. -var SuiSelectBase = /** @class */ (function () { - function SuiSelectBase(_element, renderer, _localizationService) { - var _this = this; - this._element = _element; - this._localizationService = _localizationService; - this.dropdownService = new DropdownService(); - // We do want an empty query to return all results. - this.searchService = new SearchService(true); - this.isSearchable = false; - this.onLocaleUpdate(); - this._localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); - this._renderedSubscriptions = []; - this.icon = "dropdown"; - this.transition = "slide down"; - this.transitionDuration = 200; - this.onTouched = new _angular_core.EventEmitter(); - this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); - this._selectClasses = true; - } - Object.defineProperty(SuiSelectBase.prototype, "isActive", { - get: function () { - return this.dropdownService.isOpen; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "isVisible", { - get: function () { - return this._menu.isVisible; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "_searchClass", { - get: function () { - return this.isSearchable && !this.isSearchExternal; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "isSearching", { - get: function () { - return this.searchService.isSearching; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "searchInput", { - get: function () { - return this._manualSearch || this._internalSearch; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "tabIndex", { - get: function () { - if (this.isDisabled) { - // If disabled, remove from tabindex. - return -1; - } - if (this.dropdownService.isOpen && this.isSearchExternal) { - // If open & in menu search, remove from tabindex (as input always autofocusses). - return -1; - } - if (this._tabIndex != undefined) { - // If custom tabindex, default to that. - return this._tabIndex; - } - if (this._searchClass) { - // If search input enabled, tab goes to input. - return -1; - } - // Otherwise, return default of 0. - return 0; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "isDisabled", { - get: function () { - return this.dropdownService.isDisabled; - }, - set: function (value) { - this.dropdownService.isDisabled = !!value; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "options", { - set: function (options) { - if (options) { - this.searchService.options = options; - this.optionsUpdateHook(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "optionsFilter", { - set: function (filter) { - if (filter) { - this.searchService.optionsFilter = filter; - this.optionsUpdateHook(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "optionsLookup", { - set: function (lookup) { - if (lookup) { - this.searchService.optionsLookup = lookup; - this.optionsUpdateHook(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "filteredOptions", { - get: function () { - return this.searchService.results; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "availableOptions", { - // Deprecated - get: - // Deprecated - function () { - return this.filteredOptions; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "query", { - get: function () { - return this.isSearchable ? this.searchService.query : undefined; - }, - set: function (query) { - var _this = this; - if (query != undefined) { - this.queryUpdateHook(); - this.updateQuery(query); - // Update the rendered text as query has changed. - this._renderedOptions.forEach(function (ro) { return _this.initialiseRenderedOption(ro); }); - if (this.searchInput) { - this.searchInput.query = query; - } - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "labelField", { - get: function () { - return this.searchService.optionsField; - }, - set: function (field) { - this.searchService.optionsField = field; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "labelGetter", { - get: function () { - var _this = this; - // Helper function to retrieve the label from an item. - return function (obj) { - var label = Util.Object.readValue(obj, _this.labelField); - if (label != undefined) { - return label.toString(); - } - return ""; - }; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "valueGetter", { - get: function () { - var _this = this; - // Helper function to retrieve the value from an item. - return function (obj) { return Util.Object.readValue(obj, _this.valueField); }; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "configuredFormatter", { - get: function () { - var _this = this; - if (this._optionFormatter) { - return function (o) { return _this._optionFormatter(o, _this.isSearchable ? _this.query : undefined); }; - } - else if (this.searchService.optionsLookup) { - return function (o) { return _this.labelGetter(o); }; - } - else { - return function (o) { return _this.searchService.highlightMatches(_this.labelGetter(o), _this.query || ""); }; - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "optionFormatter", { - set: function (formatter) { - this._optionFormatter = formatter; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "localeValues", { - get: function () { - return this._localizationService.override(this._localeValues, this.localeOverrides); - }, - enumerable: true, - configurable: true - }); - SuiSelectBase.prototype.ngAfterContentInit = function () { - var _this = this; - this._menu.service = this.dropdownService; - // We manually specify the menu items to the menu because the @ContentChildren doesn't pick up our dynamically rendered items. - this._menu.items = this._renderedOptions; - if (this._manualSearch) { - this.isSearchable = true; - this.isSearchExternal = true; - } - if (this.searchInput) { - this.searchInput.onQueryUpdated.subscribe(function (q) { return _this.query = q; }); - this.searchInput.onQueryKeyDown.subscribe(function (e) { return _this.onQueryInputKeydown(e); }); - } - // We must call this immediately as changes doesn't fire when you subscribe. - this.onAvailableOptionsRendered(); - this._renderedOptions.changes.subscribe(function () { return _this.onAvailableOptionsRendered(); }); - }; - SuiSelectBase.prototype.onLocaleUpdate = function () { - this._localeValues = this._localizationService.get().select; - }; - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - SuiSelectBase.prototype.optionsUpdateHook = - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - function () { }; - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - SuiSelectBase.prototype.queryUpdateHook = - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - function () { }; - SuiSelectBase.prototype.updateQuery = function (query) { - var _this = this; - // Update the query then open the dropdown, as after keyboard input it should always be open. - this.searchService.updateQuery(query, function () { - return _this.dropdownService.setOpenState(true); - }); - }; - SuiSelectBase.prototype.resetQuery = function (delayed) { - if (delayed === void 0) { delayed = true; } - // The search delay is set to the transition duration to ensure results - // aren't rendered as the select closes as that causes a sudden flash. - if (delayed) { - this.searchService.searchDelay = this._menu.menuTransitionDuration; - this.searchService.updateQueryDelayed(""); - } - else { - this.searchService.updateQuery(""); - } - if (this.searchInput) { - this.searchInput.query = ""; - } - }; - SuiSelectBase.prototype.onAvailableOptionsRendered = function () { - var _this = this; - // Unsubscribe from all previous subscriptions to avoid memory leaks on large selects. - this._renderedSubscriptions.forEach(function (rs) { return rs.unsubscribe(); }); - this._renderedSubscriptions = []; - this._renderedOptions.forEach(function (ro) { - // Slightly delay initialisation to avoid change after checked errors. TODO - look into avoiding this! - setTimeout(function () { return _this.initialiseRenderedOption(ro); }); - _this._renderedSubscriptions.push(ro.onSelected.subscribe(function () { return _this.selectOption(ro.value); })); - }); - // If no options have been provided, autogenerate them from the rendered ones. - if (this.searchService.options.length === 0 && !this.searchService.optionsLookup) { - this.options = this._renderedOptions.map(function (ro) { return ro.value; }); - } - }; - SuiSelectBase.prototype.initialiseRenderedOption = function (option) { - option.usesTemplate = !!this.optionTemplate; - option.formatter = this.configuredFormatter; - if (option.usesTemplate) { - this.drawTemplate(option.templateSibling, option.value); - } - option.changeDetector.markForCheck(); - }; - SuiSelectBase.prototype.findOption = function (options, value) { - var _this = this; - // Tries to find an option in options array - return options.find(function (o) { return value === _this.valueGetter(o); }); - }; - SuiSelectBase.prototype.onCaretClick = function (e) { - if (!e.eventHandled) { - e.eventHandled = true; - if (!this.dropdownService.isAnimating) { - this.dropdownService.setOpenState(!this.dropdownService.isOpen); - this.focus(); - } - } - }; - SuiSelectBase.prototype.onClick = function (e) { - if (!e.eventHandled && !this.dropdownService.isAnimating) { - e.eventHandled = true; - // If the dropdown is searchable, clicking should keep it open, otherwise we toggle the open state. - this.dropdownService.setOpenState(this.isSearchable ? true : !this.dropdownService.isOpen); - // Immediately focus the search input whenever clicking on the select. - this.focus(); - } - }; - SuiSelectBase.prototype.onFocusIn = function () { - if (!this.dropdownService.isOpen && !this.dropdownService.isAnimating) { - this.dropdownService.setOpenState(true); - this.focus(); - } - }; - SuiSelectBase.prototype.onFocusOut = function (e) { - if (!this._element.nativeElement.contains(e.relatedTarget)) { - this.dropdownService.setOpenState(false); - this.onTouched.emit(); - } - }; - SuiSelectBase.prototype.onKeyPress = function (e) { - if (e.keyCode === exports.KeyCode.Enter) { - // Enables support for focussing and opening with the keyboard alone. - // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. - this._element.nativeElement.click(); - } - }; - SuiSelectBase.prototype.onDocumentKeyDown = function (e) { - if (this._element.nativeElement.contains(e.target) && - !this.dropdownService.isOpen && - e.keyCode === exports.KeyCode.Down) { - // Enables support for focussing and opening with the keyboard alone. - // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. - this._element.nativeElement.click(); - e.preventDefault(); - } - }; - SuiSelectBase.prototype.onQueryInputKeydown = function (event) { }; - SuiSelectBase.prototype.focus = function () { - if (this.isSearchable && this.searchInput) { - // Focusses the search input only when searchable. - // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. - this.searchInput.focus(); - } - else { - this._element.nativeElement.focus(); - } - }; - // Helper that draws the provided template beside the provided ViewContainerRef. - // Helper that draws the provided template beside the provided ViewContainerRef. - SuiSelectBase.prototype.drawTemplate = - // Helper that draws the provided template beside the provided ViewContainerRef. - function (siblingRef, value) { - siblingRef.clear(); - // Use of `$implicit` means use of syntax is supported. - siblingRef.createEmbeddedView(this.optionTemplate, { - $implicit: value, - query: this.query - }); - }; - SuiSelectBase.prototype.ngOnDestroy = function () { - this._renderedSubscriptions.forEach(function (s) { return s.unsubscribe(); }); - this._documentKeyDownListener(); - }; - SuiSelectBase.propDecorators = { - "_menu": [{ type: _angular_core.ViewChild, args: [SuiDropdownMenu,] },], - "_renderedOptions": [{ type: _angular_core.ContentChildren, args: [SuiSelectOption, { descendants: true },] },], - "_selectClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.dropdown",] },], - "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], - "isVisible": [{ type: _angular_core.HostBinding, args: ["class.visible",] },], - "isSearchable": [{ type: _angular_core.Input },], - "_searchClass": [{ type: _angular_core.HostBinding, args: ["class.search",] },], - "isSearching": [{ type: _angular_core.HostBinding, args: ["class.loading",] },], - "_internalSearch": [{ type: _angular_core.ViewChild, args: [SuiSelectSearch,] },], - "_manualSearch": [{ type: _angular_core.ContentChild, args: [SuiSelectSearch,] },], - "_tabIndex": [{ type: _angular_core.Input, args: ["tabindex",] },], - "tabIndex": [{ type: _angular_core.HostBinding, args: ["attr.tabindex",] },], - "isDisabled": [{ type: _angular_core.HostBinding, args: ["class.disabled",] }, { type: _angular_core.Input },], - "options": [{ type: _angular_core.Input },], - "optionsFilter": [{ type: _angular_core.Input },], - "optionsLookup": [{ type: _angular_core.Input },], - "labelField": [{ type: _angular_core.Input },], - "valueField": [{ type: _angular_core.Input },], - "optionTemplate": [{ type: _angular_core.Input },], - "optionFormatter": [{ type: _angular_core.Input },], - "icon": [{ type: _angular_core.Input },], - "transition": [{ type: _angular_core.Input },], - "transitionDuration": [{ type: _angular_core.Input },], - "onTouched": [{ type: _angular_core.Output, args: ["touched",] },], - "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], - "onFocusIn": [{ type: _angular_core.HostListener, args: ["focusin",] },], - "onFocusOut": [{ type: _angular_core.HostListener, args: ["focusout", ["$event"],] },], - "onKeyPress": [{ type: _angular_core.HostListener, args: ["keypress", ["$event"],] },], - }; - return SuiSelectBase; -}()); - -var __extends$22 = (undefined && undefined.__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 __()); - }; -})(); -var SuiMultiSelectLabel = /** @class */ (function (_super) { - __extends$22(SuiMultiSelectLabel, _super); - function SuiMultiSelectLabel(renderer, element, changeDetector, componentFactory) { - var _this = _super.call(this, renderer, element, changeDetector) || this; - _this.componentFactory = componentFactory; - // Initialise transition functionality. - // Initialise transition functionality. - _this._transitionController = new TransitionController(false, "inline-block"); - _this.setTransitionController(_this._transitionController); - _this.onDeselected = new _angular_core.EventEmitter(); - _this._labelClasses = true; - _this._transitionController.animate(new Transition("scale", 100, exports.TransitionDirection.In)); - return _this; - } - Object.defineProperty(SuiMultiSelectLabel.prototype, "template", { - get: function () { - return this._template; - }, - set: function (template) { - this._template = template; - if (this.template) { - this.componentFactory.createView(this.templateSibling, this.template, { - $implicit: this.value, - query: this.query - }); - } - }, - enumerable: true, - configurable: true - }); - SuiMultiSelectLabel.prototype.deselectOption = function (e) { - var _this = this; - e.eventHandled = true; - this._transitionController.animate(new Transition("scale", 100, exports.TransitionDirection.Out, function () { - return _this.onDeselected.emit(_this.value); - })); - }; - SuiMultiSelectLabel.prototype.onClick = function (e) { - e.eventHandled = true; - }; - SuiMultiSelectLabel.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-multi-select-label", - template: "\n\n\n\n" - },] }, - ]; - /** @nocollapse */ - SuiMultiSelectLabel.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - { type: _angular_core.ChangeDetectorRef, }, - { type: SuiComponentFactory, }, - ]; }; - SuiMultiSelectLabel.propDecorators = { - "_labelClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.label",] },], - "value": [{ type: _angular_core.Input },], - "query": [{ type: _angular_core.Input },], - "onDeselected": [{ type: _angular_core.Output, args: ["deselected",] },], - "formatter": [{ type: _angular_core.Input },], - "template": [{ type: _angular_core.Input },], - "templateSibling": [{ type: _angular_core.ViewChild, args: ["templateSibling", { read: _angular_core.ViewContainerRef },] },], - "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], - }; - return SuiMultiSelectLabel; -}(SuiTransition)); - -var __extends$23 = (undefined && undefined.__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 __()); - }; -})(); -var SuiMultiSelect = /** @class */ (function (_super) { - __extends$23(SuiMultiSelect, _super); - function SuiMultiSelect(element, renderer, localizationService) { - var _this = _super.call(this, element, renderer, localizationService) || this; - _this.selectedOptions = []; - _this.selectedOptionsChange = new _angular_core.EventEmitter(); - _this.hasLabels = true; - _this._multiSelectClasses = true; - return _this; - } - Object.defineProperty(SuiMultiSelect.prototype, "filteredOptions", { - get: function () { - var _this = this; - if (this.maxSelectedReached) { - // If we have reached the maximum number of selections, then empty the results completely. - return []; - } - var searchResults = this.searchService.results; - if (!this.hasLabels) { - return searchResults; - } - else { - // Returns the search results \ selected options. - return searchResults - .filter(function (r) { return _this.selectedOptions.find(function (o) { return r === o; }) == undefined; }); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "availableOptions", { - get: function () { - return this.filteredOptions; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "hasLabels", { - get: function () { - return this._hasLabels; - }, - set: function (hasLabels) { - this._hasLabels = hasLabels; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "placeholder", { - get: function () { - return this._placeholder || this.localeValues.multi.placeholder; - }, - set: function (placeholder) { - this._placeholder = placeholder; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "maxSelectedReached", { - get: function () { - if (this.maxSelected == undefined) { - // If there is no maximum then we can immediately return. - return false; - } - return this.selectedOptions.length === this.maxSelected; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "maxSelectedMessage", { - get: function () { - return this._localizationService.interpolate(this.localeValues.multi.maxSelectedMessage, [["max", this.maxSelected.toString()]]); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "selectedMessage", { - get: function () { - return this._localizationService.interpolate(this.localeValues.multi.selectedMessage, [["count", this.selectedOptions.length.toString()]]); - }, - enumerable: true, - configurable: true - }); - SuiMultiSelect.prototype.optionsUpdateHook = function () { - var _this = this; - if (!this._writtenOptions && this.selectedOptions.length > 0) { - // We need to check the options still exist. - this.writeValue(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); - } - if (this._writtenOptions && this.searchService.options.length > 0) { - // If there were values written by ngModel before the options had been loaded, this runs to fix it. - this.selectedOptions = this._writtenOptions - .map(function (v) { return _this.findOption(_this.searchService.options, v); }) - .filter(function (v) { return v != undefined; }); - if (this.selectedOptions.length === this._writtenOptions.length) { - this._writtenOptions = undefined; - } - } - }; - SuiMultiSelect.prototype.initialiseRenderedOption = function (option) { - _super.prototype.initialiseRenderedOption.call(this, option); - // Boldens the item so it appears selected in the dropdown. - option.isActive = !this.hasLabels && this.selectedOptions.indexOf(option.value) !== -1; - }; - SuiMultiSelect.prototype.selectOption = function (option) { - var _this = this; - if (this.selectedOptions.indexOf(option) !== -1) { - this.deselectOption(option); - return; - } - this.selectedOptions.push(option); - this.selectedOptionsChange.emit(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); - this.resetQuery(false); - // Automatically refocus the search input for better keyboard accessibility. - this.focus(); - if (!this.hasLabels) { - this.onAvailableOptionsRendered(); - } - }; - SuiMultiSelect.prototype.writeValue = function (values) { - var _this = this; - if (values instanceof Array) { - if (this.searchService.options.length > 0) { - // If the options have already been loaded, we can immediately match the ngModel values to options. - this.selectedOptions = values - .map(function (v) { return _this.findOption(_this.searchService.options, v); }) - .filter(function (v) { return v != undefined; }); - } - if (values.length > 0 && this.selectedOptions.length === 0) { - if (this.valueField && this.searchService.hasItemLookup) { - // If the search service has a selected lookup function, make use of that to load the initial values. - this.searchService - .initialLookup(values) - .then(function (items) { return _this.selectedOptions = items; }); - } - else { - // Otherwise, cache the written value for when options are set. - this._writtenOptions = values; - } - } - if (values.length === 0) { - this.selectedOptions = []; - } - } - else { - this.selectedOptions = []; - } - }; - SuiMultiSelect.prototype.deselectOption = function (option) { - var _this = this; - // Update selected options to the previously selected options \ {option}. - this.selectedOptions = this.selectedOptions.filter(function (so) { return so !== option; }); - this.selectedOptionsChange.emit(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); - // Automatically refocus the search input for better keyboard accessibility. - this.focus(); - if (!this.hasLabels) { - this.onAvailableOptionsRendered(); - } - }; - SuiMultiSelect.prototype.onQueryInputKeydown = function (event) { - if (event.keyCode === exports.KeyCode.Backspace && this.query === "" && this.selectedOptions.length > 0) { - // Deselect the rightmost option when the user presses backspace in the search input. - this.deselectOption(this.selectedOptions[this.selectedOptions.length - 1]); - } - }; - SuiMultiSelect.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-multi-select", - template: "\n\n\n\n\n\n \n\n\n\n\n\n\n
\n \n \n {{ placeholder }}\n \n \n {{ selectedMessage }}\n
\n\n\n
\n\n \n \n
{{ localeValues.noResultsMessage }}
\n
{{ maxSelectedMessage }}
\n
\n
\n", - styles: ["\n:host input.search {\n width: 12em !important;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiMultiSelect.ctorParameters = function () { return [ - { type: _angular_core.ElementRef, }, - { type: _angular_core.Renderer2, }, - { type: SuiLocalizationService, }, - ]; }; - SuiMultiSelect.propDecorators = { - "selectedOptionsChange": [{ type: _angular_core.Output },], - "hasLabels": [{ type: _angular_core.Input },], - "placeholder": [{ type: _angular_core.Input },], - "maxSelected": [{ type: _angular_core.Input },], - "_multiSelectClasses": [{ type: _angular_core.HostBinding, args: ["class.multiple",] },], - }; - return SuiMultiSelect; -}(SuiSelectBase)); -// Value accessor directive for the select to support ngModel. -var SuiMultiSelectValueAccessor = /** @class */ (function (_super) { - __extends$23(SuiMultiSelectValueAccessor, _super); - function SuiMultiSelectValueAccessor(host) { - return _super.call(this, host) || this; - } - SuiMultiSelectValueAccessor.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "sui-multi-select", - host: { - "(selectedOptionsChange)": "onChange($event)", - "(touched)": "onTouched()" - }, - providers: [customValueAccessorFactory(SuiMultiSelectValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiMultiSelectValueAccessor.ctorParameters = function () { return [ - { type: SuiMultiSelect, }, - ]; }; - return SuiMultiSelectValueAccessor; -}(CustomValueAccessor)); - -var __extends$24 = (undefined && undefined.__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 __()); - }; -})(); -var SuiSelect = /** @class */ (function (_super) { - __extends$24(SuiSelect, _super); - function SuiSelect(element, renderer, localizationService) { - var _this = _super.call(this, element, renderer, localizationService) || this; - _this.selectedOptionChange = new _angular_core.EventEmitter(); - return _this; - } - Object.defineProperty(SuiSelect.prototype, "placeholder", { - get: function () { - return this._placeholder || this.localeValues.single.placeholder; - }, - set: function (placeholder) { - this._placeholder = placeholder; - }, - enumerable: true, - configurable: true - }); - SuiSelect.prototype.optionsUpdateHook = function () { - if (!this._writtenOption && this.selectedOption) { - // We need to check the option still exists. - this.writeValue(this.valueGetter(this.selectedOption)); - } - if (this._writtenOption && this.searchService.options.length > 0) { - // If there was an value written by ngModel before the options had been loaded, this runs to fix it. - this.selectedOption = this.findOption(this.searchService.options, this._writtenOption); - if (this.selectedOption) { - this._writtenOption = undefined; - this.drawSelectedOption(); - } - } - }; - SuiSelect.prototype.queryUpdateHook = function () { - // When the query is updated, we just abandon the current selection. - this.selectedOption = undefined; - }; - SuiSelect.prototype.selectOption = function (option) { - // Choose and emit the selected option. - this.selectedOption = option; - this.selectedOptionChange.emit(this.valueGetter(option)); - this.dropdownService.setOpenState(false); - this.resetQuery(); - this.drawSelectedOption(); - // Automatically refocus the search input for better keyboard accessibility. - this.focus(); - }; - SuiSelect.prototype.writeValue = function (value) { - var _this = this; - if (value != undefined) { - if (this.searchService.options.length > 0) { - // If the options have already been loaded, we can immediately match the ngModel value to an option. - this.selectedOption = this.findOption(this.searchService.options, value); - this.drawSelectedOption(); - } - if (this.selectedOption == undefined) { - if (this.valueField && this.searchService.hasItemLookup) { - // If the search service has a selected lookup function, make use of that to load the initial value. - this.searchService - .initialLookup(value) - .then(function (i) { - _this.selectedOption = i; - _this.drawSelectedOption(); - }); - } - else { - // Otherwise, cache the written value for when options are set. - this._writtenOption = value; - } - } - } - else { - this.selectedOption = undefined; - this.drawSelectedOption(); - } - }; - SuiSelect.prototype.initialiseRenderedOption = function (option) { - _super.prototype.initialiseRenderedOption.call(this, option); - // Boldens the item so it appears selected in the dropdown. - option.isActive = option.value === this.selectedOption; - }; - SuiSelect.prototype.drawSelectedOption = function () { - // Updates the active class on the newly selected option. - if (this._renderedOptions) { - this.onAvailableOptionsRendered(); - } - if (this.selectedOption != undefined && this.optionTemplate) { - this.drawTemplate(this._optionTemplateSibling, this.selectedOption); - } - }; - SuiSelect.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-select", - template: "\n\n\n\n\n
{{ placeholder }}
\n\n
\n \n \n
\n\n\n\n
\n\n \n
\n {{ localeValues.noResultsMessage }}\n
\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiSelect.ctorParameters = function () { return [ - { type: _angular_core.ElementRef, }, - { type: _angular_core.Renderer2, }, - { type: SuiLocalizationService, }, - ]; }; - SuiSelect.propDecorators = { - "_optionTemplateSibling": [{ type: _angular_core.ViewChild, args: ["optionTemplateSibling", { read: _angular_core.ViewContainerRef },] },], - "selectedOptionChange": [{ type: _angular_core.Output },], - "placeholder": [{ type: _angular_core.Input },], - }; - return SuiSelect; -}(SuiSelectBase)); -// Value accessor directive for the select to support ngModel. -var SuiSelectValueAccessor = /** @class */ (function (_super) { - __extends$24(SuiSelectValueAccessor, _super); - function SuiSelectValueAccessor(host) { - return _super.call(this, host) || this; - } - SuiSelectValueAccessor.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "sui-select", - host: { - "(selectedOptionChange)": "onChange($event)", - "(touched)": "onTouched()" - }, - providers: [customValueAccessorFactory(SuiSelectValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiSelectValueAccessor.ctorParameters = function () { return [ - { type: SuiSelect, }, - ]; }; - return SuiSelectValueAccessor; -}(CustomValueAccessor)); - -var SuiSelectModule = /** @class */ (function () { - function SuiSelectModule() { - } - SuiSelectModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule, - _angular_forms.FormsModule, - SuiDropdownModule, - SuiUtilityModule, - SuiLocalizationModule - ], - declarations: [ - SuiSelect, - SuiSelectOption, - SuiSelectSearch, - SuiSelectValueAccessor, - SuiMultiSelect, - SuiMultiSelectLabel, - SuiMultiSelectValueAccessor - ], - exports: [ - SuiSelect, - SuiSelectOption, - SuiSelectSearch, - SuiSelectValueAccessor, - SuiMultiSelect, - SuiMultiSelectValueAccessor - ] - },] }, - ]; - /** @nocollapse */ - SuiSelectModule.ctorParameters = function () { return []; }; - return SuiSelectModule; -}()); - -var SidebarTransition = { - Overlay: "overlay", - Push: "push", - ScaleDown: "scale down", - Uncover: "uncover", - SlideAlong: "slide along", - SlideOut: "slide out" -}; -var SidebarDirection = { - Left: "left", - Right: "right", - Top: "top", - Bottom: "bottom" -}; -var SidebarService = /** @class */ (function () { - function SidebarService(isVisible) { - if (isVisible === void 0) { isVisible = false; } - this.isVisible = isVisible; - this.isAnimating = false; - this.wasJustOpened = false; - this.isVisibleChange = new _angular_core.EventEmitter(); - this.widthChange = new _angular_core.EventEmitter(); - this.heightChange = new _angular_core.EventEmitter(); - this.width = 260; - this.height = 0; - this.transition = SidebarTransition.Uncover; - } - Object.defineProperty(SidebarService.prototype, "width", { - get: function () { - if (this.direction === SidebarDirection.Left) { - return this._width; - } - if (this.direction === SidebarDirection.Right) { - return -this._width; - } - return 0; - }, - set: function (width) { - this._width = width; - this.widthChange.emit(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SidebarService.prototype, "height", { - get: function () { - if (this.direction === SidebarDirection.Top) { - return this._height; - } - if (this.direction === SidebarDirection.Bottom) { - return -this._height; - } - return 0; - }, - set: function (height) { - this._height = height; - this.heightChange.emit(); - }, - enumerable: true, - configurable: true - }); - SidebarService.prototype.setVisibleState = function (isVisible) { - var _this = this; - if (this.isVisible !== isVisible) { - this.isVisible = isVisible; - this.isAnimating = true; - this.wasJustOpened = true; - this.isVisibleChange.emit(isVisible); - setTimeout(function () { return _this.wasJustOpened = false; }); - clearTimeout(this._isAnimatingTimeout); - this._isAnimatingTimeout = window.setTimeout(function () { return _this.isAnimating = false; }, 500); - } - }; - SidebarService.prototype.toggleVisibleState = function () { - this.setVisibleState(!this.isVisible); - }; - return SidebarService; -}()); - -var SuiSidebar = /** @class */ (function () { - function SuiSidebar(_renderer, _element) { - var _this = this; - this._renderer = _renderer; - this._element = _element; - this.service = new SidebarService(); - // We set the default here as well to force the classes to update. - this.transition = SidebarTransition.Uncover; - this.direction = SidebarDirection.Left; - setTimeout(function () { return _this.updateDimensions(); }); - this.service.isVisibleChange.subscribe(function () { return _this.updateDimensions(); }); - this._sidebarClasses = true; - } - Object.defineProperty(SuiSidebar.prototype, "transition", { - get: function () { - return this.service.transition; - }, - set: function (transition) { - var _this = this; - this.service.transition.split(" ").forEach(function (c) { return _this.setClass(c, false); }); - this.service.transition = transition; - this.service.transition.split(" ").forEach(function (c) { return _this.setClass(c, true); }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebar.prototype, "direction", { - get: function () { - return this.service.direction; - }, - set: function (direction) { - this.setClass(this.service.direction, false); - this.service.direction = direction; - this.setClass(this.service.direction, true); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebar.prototype, "isVisible", { - get: function () { - return this.service.isVisible; - }, - set: function (isVisible) { - this.service.setVisibleState(isVisible); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebar.prototype, "isVisibleChange", { - get: function () { - return this.service.isVisibleChange; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebar.prototype, "isAnimating", { - get: function () { - return this.service.isAnimating; - }, - enumerable: true, - configurable: true - }); - SuiSidebar.prototype.updateDimensions = function () { - this.service.width = this._element.nativeElement.offsetWidth; - this.service.height = this._element.nativeElement.offsetHeight; - }; - SuiSidebar.prototype.setClass = function (className, isAdd) { - if (isAdd === void 0) { isAdd = true; } - if (isAdd) { - this._renderer.addClass(this._element.nativeElement, className); - } - else { - this._renderer.removeClass(this._element.nativeElement, className); - } - }; - SuiSidebar.prototype.open = function () { - this.service.setVisibleState(true); - }; - SuiSidebar.prototype.close = function () { - this.service.setVisibleState(false); - }; - SuiSidebar.prototype.toggle = function () { - this.service.toggleVisibleState(); - }; - SuiSidebar.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-sidebar", - template: "" - },] }, - ]; - /** @nocollapse */ - SuiSidebar.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - ]; }; - SuiSidebar.propDecorators = { - "_sidebarClasses": [{ type: _angular_core.HostBinding, args: ["class.ui",] }, { type: _angular_core.HostBinding, args: ["class.sidebar",] }, { type: _angular_core.HostBinding, args: ["class.menu",] },], - "transition": [{ type: _angular_core.Input },], - "direction": [{ type: _angular_core.Input },], - "isVisible": [{ type: _angular_core.HostBinding, args: ["class.visible",] }, { type: _angular_core.Input },], - "isVisibleChange": [{ type: _angular_core.Output },], - "isAnimating": [{ type: _angular_core.HostBinding, args: ["class.animating",] },], - }; - return SuiSidebar; -}()); - -var SuiSidebarSibling = /** @class */ (function () { - function SuiSidebarSibling(_renderer, _element) { - this._renderer = _renderer; - this._element = _element; - this.isDimmedWhenVisible = false; - this._siblingClasses = true; - } - Object.defineProperty(SuiSidebarSibling.prototype, "service", { - get: function () { - return this._service; - }, - set: function (service) { - var _this = this; - this._service = service; - setTimeout(function () { return _this.updateTransform(); }); - this._service.isVisibleChange.subscribe(function () { return _this.updateTransform(); }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebarSibling.prototype, "isVisible", { - get: function () { - if (!this.service) { - return false; - } - return this.service.isVisible; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebarSibling.prototype, "isDimmed", { - get: function () { - if (!this.service) { - return false; - } - return this.service.isVisible && this.isDimmedWhenVisible; - }, - enumerable: true, - configurable: true - }); - SuiSidebarSibling.prototype.updateTransform = function () { - this._renderer.removeStyle(this._element.nativeElement, "transform"); - this._renderer.removeStyle(this._element.nativeElement, "-webkit-transform"); - if (this.service.isVisible && - this.service.transition !== SidebarTransition.Overlay && - this.service.transition !== SidebarTransition.ScaleDown) { - var translate = "translate3d(" + this.service.width + "px, " + this.service.height + "px, 0)"; - this._renderer.setStyle(this._element.nativeElement, "transform", translate); - this._renderer.setStyle(this._element.nativeElement, "-webkit-transform", translate); - } - }; - SuiSidebarSibling.prototype.onClick = function (event) { - if (this.service.isVisible && !this.service.wasJustOpened) { - this.service.setVisibleState(false); - } - }; - SuiSidebarSibling.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-sidebar-sibling", - template: "", - styles: ["\n:host {\n display: block;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiSidebarSibling.ctorParameters = function () { return [ - { type: _angular_core.Renderer2, }, - { type: _angular_core.ElementRef, }, - ]; }; - SuiSidebarSibling.propDecorators = { - "isDimmedWhenVisible": [{ type: _angular_core.Input },], - "isVisible": [{ type: _angular_core.HostBinding, args: ["class.visible",] },], - "isDimmed": [{ type: _angular_core.HostBinding, args: ["class.dimmed",] },], - "_siblingClasses": [{ type: _angular_core.HostBinding, args: ["class.pusher",] },], - "onClick": [{ type: _angular_core.HostListener, args: ["click", ["$event"],] },], - }; - return SuiSidebarSibling; -}()); - -var SuiSidebarContainer = /** @class */ (function () { - function SuiSidebarContainer() { - this._containerClasses = true; - } - SuiSidebarContainer.prototype.ngAfterContentInit = function () { - if (!this.sidebar) { - throw new Error("You must include a element within the container."); - } - this.service = this.sidebar.service; - if (!this.sibling) { - throw new Error("You must include a element within the container."); - } - this.sibling.service = this.service; - }; - SuiSidebarContainer.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-sidebar-container", - template: "", - styles: ["\n:host {\n display: block;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiSidebarContainer.ctorParameters = function () { return []; }; - SuiSidebarContainer.propDecorators = { - "_containerClasses": [{ type: _angular_core.HostBinding, args: ["class.pushable",] },], - "sidebar": [{ type: _angular_core.ContentChild, args: [SuiSidebar,] },], - "sibling": [{ type: _angular_core.ContentChild, args: [SuiSidebarSibling,] },], - }; - return SuiSidebarContainer; -}()); - -var SuiSidebarModule = /** @class */ (function () { - function SuiSidebarModule() { - } - SuiSidebarModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule - ], - declarations: [ - SuiSidebar, - SuiSidebarContainer, - SuiSidebarSibling - ], - exports: [ - SuiSidebar, - SuiSidebarContainer, - SuiSidebarSibling - ] - },] }, - ]; - /** @nocollapse */ - SuiSidebarModule.ctorParameters = function () { return []; }; - return SuiSidebarModule; -}()); - -var Tab = /** @class */ (function () { - function Tab(header, content) { - var _this = this; - this.id = header.id; - this.header = header; - this.content = content; - // So that the header and content isActive properties are always in sync. - this.header.isActiveChange - .subscribe(function () { return _this.content.isActive = _this.isActive; }); - } - Object.defineProperty(Tab.prototype, "isActive", { - // Saves accessing .header.isActive every time. - get: - // Saves accessing .header.isActive every time. - function () { - return this.header.isActive; - }, - set: function (active) { - // Use `setActiveState` so as not to fire 'external changes' event. - this.header.setActiveState(active); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Tab.prototype, "isDisabled", { - // Saves accessing .header.isDisabled every time. - get: - // Saves accessing .header.isDisabled every time. - function () { - return this.header.isDisabled; - }, - enumerable: true, - configurable: true - }); - return Tab; -}()); - -var SuiTabHeader = /** @class */ (function () { - function SuiTabHeader() { - this._isActive = false; - this.isActiveChange = new _angular_core.EventEmitter(); - this.isActiveExternalChange = new _angular_core.EventEmitter(); - this.onActivate = new _angular_core.EventEmitter(); - this.onDeactivate = new _angular_core.EventEmitter(); - this.isDisabled = false; - this._headerClasses = true; - } - Object.defineProperty(SuiTabHeader.prototype, "isActive", { - get: function () { - return this._isActive; - }, - set: function (active) { - var _this = this; - var isActive = active; - // Only used by @Input(), runs whenever user input changes `isActive`. - // Run in timeout because `isDisabled` can prohibit user from changing `isActive`. - // so update is delayed to avoid 'changed after checked' error. - setTimeout(function () { - // Only allow change if tab header is not disabled. - isActive = !_this.isDisabled ? active : false; - _this.setActiveState(isActive); - // Fire 'external change' event as user input has occured. - // Fire 'external change' event as user input has occured. - _this.isActiveExternalChange.emit(isActive); - }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiTabHeader.prototype, "isDisabled", { - get: function () { - return this._isDisabled; - }, - set: function (disabled) { - // Only update if value provided is different to current one. - if (this._isDisabled !== disabled) { - this._isDisabled = disabled; - // If now disabled, then tab header must be deactivated. - if (this.isDisabled) { - this.isActive = false; - } - } - }, - enumerable: true, - configurable: true - }); - // Internally update active state. - // Internally update active state. - SuiTabHeader.prototype.setActiveState = - // Internally update active state. - function (active) { - // If (cast) active value has changed: - if (!!this._isActive !== active) { - // Update to the new value. - this._isActive = active; - // Fire the appropriate activation event. - if (active) { - this.onActivate.emit(); - } - else { - this.onDeactivate.emit(); - } - } - // Regardless, emit a change to `isActive`, so [(isActive)] works correctly. - this.isActiveChange.emit(active); - }; - SuiTabHeader.prototype.onClick = function () { - if (!this.isDisabled) { - // Activate the tab when clicked, so long as it isn't disabled. - this.isActive = true; - } - }; - SuiTabHeader.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "[suiTabHeader]" - },] }, - ]; - /** @nocollapse */ - SuiTabHeader.ctorParameters = function () { return []; }; - SuiTabHeader.propDecorators = { - "_headerClasses": [{ type: _angular_core.HostBinding, args: ["class.item",] },], - "id": [{ type: _angular_core.Input, args: ["suiTabHeader",] },], - "isActiveChange": [{ type: _angular_core.Output },], - "onActivate": [{ type: _angular_core.Output, args: ["activate",] },], - "onDeactivate": [{ type: _angular_core.Output, args: ["deactivate",] },], - "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] }, { type: _angular_core.Input },], - "isDisabled": [{ type: _angular_core.HostBinding, args: ["class.disabled",] }, { type: _angular_core.Input },], - "onClick": [{ type: _angular_core.HostListener, args: ["click",] },], - }; - return SuiTabHeader; -}()); - -var SuiTabContent = /** @class */ (function () { - function SuiTabContent() { - this.isActive = false; - this._contentClasses = true; - } - SuiTabContent.decorators = [ - { type: _angular_core.Directive, args: [{ - selector: "[suiTabContent]" - },] }, - ]; - /** @nocollapse */ - SuiTabContent.ctorParameters = function () { return []; }; - SuiTabContent.propDecorators = { - "_contentClasses": [{ type: _angular_core.HostBinding, args: ["class.tab",] },], - "id": [{ type: _angular_core.Input, args: ["suiTabContent",] },], - "isActive": [{ type: _angular_core.HostBinding, args: ["class.active",] },], - }; - return SuiTabContent; -}()); - -var SuiTabset = /** @class */ (function () { - function SuiTabset() { - this.tabs = []; - this._barrierCount = 0; - } - Object.defineProperty(SuiTabset.prototype, "activeTab", { - get: function () { - return this._activeTab; - }, - // When setting a tab as the currently active tab, it automatically gains - // `isActive` status (saves littering `isActive = true` everywhere). - set: - // When setting a tab as the currently active tab, it automatically gains - // `isActive` status (saves littering `isActive = true` everywhere). - function (tab) { - this._activeTab = tab; - tab.isActive = true; - }, - enumerable: true, - configurable: true - }); - SuiTabset.prototype.ngAfterContentInit = function () { - var _this = this; - // Fire `internalComponentsUpdated` when the query lists change. - this._tabHeaders.changes.subscribe(function () { return _this.internalComponentsUpdated(); }); - this._tabContents.changes.subscribe(function () { return _this.internalComponentsUpdated(); }); - // Initially load the tabs. - this.loadTabs(); - }; - // Fires whenever either the tab headers or tab contents query lists update. - // Fires whenever either the tab headers or tab contents query lists update. - SuiTabset.prototype.internalComponentsUpdated = - // Fires whenever either the tab headers or tab contents query lists update. - function () { - // We are using a 'counting barrier of n = 2', i.e. the code within only runs after the method is called twice. - // This is so that both the headers and contents query lists can update before we run code that matches the two up. - this._barrierCount++; - if (this._barrierCount === 2) { - // Reset the barrier so it can be called again. - this._barrierCount = 0; - // Update the tabs. - this.loadTabs(); - } - }; - // Connects tab headers to tab contents, and creates a tab instance for each pairing. - // Connects tab headers to tab contents, and creates a tab instance for each pairing. - SuiTabset.prototype.loadTabs = - // Connects tab headers to tab contents, and creates a tab instance for each pairing. - function () { - var _this = this; - // Remove any tabs that no longer have an associated header. - this.tabs = this.tabs.filter(function (t) { return !!_this._tabHeaders.find(function (tH) { return tH === t.header; }); }); - this._tabHeaders - .filter(function (tH) { return !_this.tabs.find(function (t) { return t.header === tH; }); }) - .forEach(function (tH) { - var content = _this._tabContents.find(function (tC) { return tC.id === tH.id; }); - if (!content) { - // Error if an associated tab content cannot be found for the given header. - throw new Error("A [suiTabHeader] must have a related [suiTabContent]."); - } - // Create a new tab instance for this header & content combo. - var tab = new Tab(tH, content); - // Subscribe to any external changes in the tab header's active state. External changes are triggered by user input. - tab.header.isActiveExternalChange.subscribe(function () { return _this.onHeaderActiveChanged(tab); }); - // Add the new instance to the list of tabs. - // Add the new instance to the list of tabs. - _this.tabs.push(tab); - }); - // Assign each tab an index (which denotes the order they physically appear in). - this._tabHeaders - .forEach(function (tH, i) { - var tab = _this.tabs.find(function (t) { return t.header === tH; }); - if (tab) { - tab.index = i; - } - }); - // Sort the tabs by their index. - this.tabs.sort(function (a, b) { return a.index - b.index; }); - if (!this.activeTab) { - // Check if there are no current existing active tabs. - // If so, we must activate the first available tab. - this.activateFirstTab(); - } - else if (!this.tabs.find(function (t) { return t === _this.activeTab; })) { - // O'wise check if current active tab has been deleted. - // If so, we must find the closest. - // Use `setTimeout` as this causes a 'changed after checked' error o'wise. - setTimeout(function () { return _this.activateClosestTab(_this.activeTab); }); - } - if (this.tabs.length === 0) { - // Error if there aren't any tabs in the tabset. - throw new Error("You cannot have no tabs!"); - } - }; - // Fires whenever a tab header's active state is externally changed. - // Fires whenever a tab header's active state is externally changed. - SuiTabset.prototype.onHeaderActiveChanged = - // Fires whenever a tab header's active state is externally changed. - function (tab) { - // If the tab has become activated, but was not previously the active tab: - if (tab.isActive && this.activeTab !== tab) { - // Deactivate all of the tabs. - this.tabs.filter(function (t) { return t !== tab; }).forEach(function (t) { return t.isActive = false; }); - // Set the currently active tab to this one. - this.activeTab = tab; - } - // If the tab has become deactivated, but was previously the active tab: - if (!tab.isActive && this.activeTab === tab) { - // Activate the closest tab to it. - this.activateClosestTab(tab); - } - }; - // Activate the first tab in the set. - // Activate the first tab in the set. - SuiTabset.prototype.activateFirstTab = - // Activate the first tab in the set. - function () { - this.activeTab = this.tabs[0]; - }; - // Activates the closest available tab to a given one. - // Activates the closest available tab to a given one. - SuiTabset.prototype.activateClosestTab = - // Activates the closest available tab to a given one. - function (tab) { - var nextAvailable; - // When the exited tab's index is higher than all available tabs, - if (tab.index >= this.tabs.length) { - // Activate the last tab. - nextAvailable = this.tabs[this.tabs.length - 1]; - } - // If that didn't work, try the following cases: - if (!nextAvailable) { - if (!this.tabs.find(function (t) { return t === tab; })) { - // When the exited tab no longer exists, - // Replace it with a tab at the same index. - nextAvailable = this.tabs[tab.index]; - } - else { - // Or if the exited tab still exists, - // Go to the tab immediately to the left. - nextAvailable = this.tabs[Math.max(tab.index - 1, 0)]; - } - } - // However, if the chosen tab is disabled, - if (nextAvailable.isDisabled) { - // Activate the closest available tab to it. - return this.activateClosestTab(nextAvailable); - } - this.activeTab = nextAvailable; - }; - SuiTabset.decorators = [ - { type: _angular_core.Component, args: [{ - selector: "sui-tabset", - template: "" - },] }, - ]; - /** @nocollapse */ - SuiTabset.ctorParameters = function () { return []; }; - SuiTabset.propDecorators = { - "_tabHeaders": [{ type: _angular_core.ContentChildren, args: [SuiTabHeader,] },], - "_tabContents": [{ type: _angular_core.ContentChildren, args: [SuiTabContent,] },], - }; - return SuiTabset; -}()); - -var SuiTabsModule = /** @class */ (function () { - function SuiTabsModule() { - } - SuiTabsModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - imports: [ - _angular_common.CommonModule - ], - declarations: [ - SuiTabset, - SuiTabHeader, - SuiTabContent - ], - exports: [ - SuiTabset, - SuiTabHeader, - SuiTabContent - ] - },] }, - ]; - /** @nocollapse */ - SuiTabsModule.ctorParameters = function () { return []; }; - return SuiTabsModule; -}()); - -var SuiModule = /** @class */ (function () { - function SuiModule() { - } - SuiModule.decorators = [ - { type: _angular_core.NgModule, args: [{ - exports: [ - SuiMessageModule, - SuiPaginationModule, - SuiAccordionModule, - SuiCheckboxModule, - SuiCollapseModule, - SuiDatepickerModule, - SuiDimmerModule, - SuiDropdownModule, - SuiModalModule, - SuiPopupModule, - SuiProgressModule, - SuiRatingModule, - SuiSearchModule, - SuiSelectModule, - SuiSidebarModule, - SuiTabsModule, - SuiTransitionModule, - SuiLocalizationModule, - SuiUtilityModule - ] - },] }, - ]; - /** @nocollapse */ - SuiModule.ctorParameters = function () { return []; }; - return SuiModule; -}()); - -exports.SuiLocalizationService = SuiLocalizationService; -exports.SuiLocalizationModule = SuiLocalizationModule; -exports.SuiMessage = SuiMessage; -exports.SuiMessageModule = SuiMessageModule; -exports.SuiPagination = SuiPagination; -exports.SuiPaginationModule = SuiPaginationModule; -exports.SuiAccordionPanel = SuiAccordionPanel; -exports.SuiAccordion = SuiAccordion; -exports.SuiAccordionService = SuiAccordionService; -exports.SuiAccordionModule = SuiAccordionModule; -exports.SuiCheckbox = SuiCheckbox; -exports.SuiCheckboxValueAccessor = SuiCheckboxValueAccessor; -exports.SuiRadio = SuiRadio; -exports.SuiRadioValueAccessor = SuiRadioValueAccessor; -exports.SuiRadioManager = SuiRadioManager; -exports.SuiCheckboxModule = SuiCheckboxModule; -exports.SuiCollapse = SuiCollapse; -exports.SuiCollapseModule = SuiCollapseModule; -exports.CalendarConfig = CalendarConfig; -exports.DateConfigBase = DateConfigBase; -exports.YearConfig = YearConfig; -exports.MonthConfig = MonthConfig; -exports.DateConfig = DateConfig; -exports.DatetimeConfig = DatetimeConfig; -exports.TimeConfig = TimeConfig; -exports.CalendarMappings = CalendarMappings; -exports.DateMappings = DateMappings; -exports.TimeMappings = TimeMappings; -exports.DatetimeMappings = DatetimeMappings; -exports.MonthMappings = MonthMappings; -exports.YearMappings = YearMappings; -exports.DateComparer = DateComparer; -exports.DateParser = DateParser; -exports.InternalDateParser = InternalDateParser; -exports.SuiCalendarViewTitle = SuiCalendarViewTitle; -exports.DatepickerMode = DatepickerMode; -exports.SuiDatepicker = SuiDatepicker; -exports.CalendarItem = CalendarItem; -exports.SuiCalendarItem = SuiCalendarItem; -exports.SuiDatepickerDirective = SuiDatepickerDirective; -exports.SuiDatepickerDirectiveValueAccessor = SuiDatepickerDirectiveValueAccessor; -exports.SuiDatepickerDirectiveValidator = SuiDatepickerDirectiveValidator; -exports.SuiDatepickerInputDirective = SuiDatepickerInputDirective; -exports.DateFnsParser = DateFnsParser; -exports.CalendarRange = CalendarRange; -exports.CalendarRangeService = CalendarRangeService; -exports.CalendarService = CalendarService; -exports.CalendarView = CalendarView; -exports.CalendarRangeDateService = CalendarRangeDateService; -exports.SuiCalendarDateView = SuiCalendarDateView; -exports.CalendarRangeHourService = CalendarRangeHourService; -exports.SuiCalendarHourView = SuiCalendarHourView; -exports.CalendarRangeMinuteService = CalendarRangeMinuteService; -exports.SuiCalendarMinuteView = SuiCalendarMinuteView; -exports.CalendarRangeMonthService = CalendarRangeMonthService; -exports.SuiCalendarMonthView = SuiCalendarMonthView; -exports.CalendarRangeYearService = CalendarRangeYearService; -exports.SuiCalendarYearView = SuiCalendarYearView; -exports.SuiDatepickerModule = SuiDatepickerModule; -exports.SuiDimmer = SuiDimmer; -exports.SuiDimmerModule = SuiDimmerModule; -exports.SuiDropdownMenuItem = SuiDropdownMenuItem; -exports.SuiDropdownMenu = SuiDropdownMenu; -exports.SuiDropdown = SuiDropdown; -exports.DropdownAutoCloseType = DropdownAutoCloseType; -exports.DropdownService = DropdownService; -exports.SuiDropdownModule = SuiDropdownModule; -exports.ActiveModal = ActiveModal; -exports.ModalSize = ModalSize; -exports.ModalConfig = ModalConfig; -exports.TemplateModalConfig = TemplateModalConfig; -exports.ComponentModalConfig = ComponentModalConfig; -exports.ModalControls = ModalControls; -exports.Modal = Modal; -exports.ModalTemplate = ModalTemplate; -exports.SuiModal = SuiModal; -exports.SuiModalService = SuiModalService; -exports.SuiModalModule = SuiModalModule; -exports.SuiPopupComponentController = SuiPopupComponentController; -exports.PopupTrigger = PopupTrigger; -exports.PopupConfig = PopupConfig; -exports.SuiPopupController = SuiPopupController; -exports.TemplatePopupConfig = TemplatePopupConfig; -exports.SuiPopupTemplateController = SuiPopupTemplateController; -exports.SuiPopupArrow = SuiPopupArrow; -exports.SuiPopup = SuiPopup; -exports.SuiPopupDirective = SuiPopupDirective; -exports.SuiPopupConfig = SuiPopupConfig; -exports.SuiPopupModule = SuiPopupModule; -exports.SuiProgress = SuiProgress; -exports.SuiProgressModule = SuiProgressModule; -exports.SuiRating = SuiRating; -exports.SuiRatingValueAccessor = SuiRatingValueAccessor; -exports.SuiRatingModule = SuiRatingModule; -exports.SuiSearchResult = SuiSearchResult; -exports.SuiSearch = SuiSearch; -exports.SearchService = SearchService; -exports.SuiSearchModule = SuiSearchModule; -exports.SuiSelectBase = SuiSelectBase; -exports.SuiMultiSelectLabel = SuiMultiSelectLabel; -exports.SuiMultiSelect = SuiMultiSelect; -exports.SuiMultiSelectValueAccessor = SuiMultiSelectValueAccessor; -exports.SuiSelectOption = SuiSelectOption; -exports.SuiSelect = SuiSelect; -exports.SuiSelectValueAccessor = SuiSelectValueAccessor; -exports.SuiSelectSearch = SuiSelectSearch; -exports.SuiSelectModule = SuiSelectModule; -exports.SuiSidebarContainer = SuiSidebarContainer; -exports.SuiSidebarSibling = SuiSidebarSibling; -exports.SuiSidebar = SuiSidebar; -exports.SidebarTransition = SidebarTransition; -exports.SidebarDirection = SidebarDirection; -exports.SidebarService = SidebarService; -exports.SuiSidebarModule = SuiSidebarModule; -exports.Tab = Tab; -exports.SuiTabset = SuiTabset; -exports.SuiTabContent = SuiTabContent; -exports.SuiTabHeader = SuiTabHeader; -exports.SuiTabsModule = SuiTabsModule; -exports.TransitionController = TransitionController; -exports.Transition = Transition; -exports.SuiTransition = SuiTransition; -exports.SuiTransitionModule = SuiTransitionModule; -exports.CustomValidator = CustomValidator; -exports.customValidatorFactory = customValidatorFactory; -exports.CustomValueAccessor = CustomValueAccessor; -exports.customValueAccessorFactory = customValueAccessorFactory; -exports.DateUtil = DateUtil; -exports.HandledEvent = HandledEvent; -exports.Util = Util; -exports.SuiComponentFactory = SuiComponentFactory; -exports.PositioningPlacement = PositioningPlacement; -exports.PositioningService = PositioningService; -exports.SuiUtilityModule = SuiUtilityModule; -exports.SuiModule = SuiModule; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); diff --git a/bundles/ng2-semantic-ui.umd.min.js b/bundles/ng2-semantic-ui.umd.min.js deleted file mode 100644 index 6d109de83..000000000 --- a/bundles/ng2-semantic-ui.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/forms"],t):t(e["ng2-semantic-ui"]=e["ng2-semantic-ui"]||{},e._angular_core,e._angular_common,e._angular_forms)}(this,function(e,t,n,i){"use strict";function r(e){return JSON.parse(JSON.stringify(e))}function o(e,t){return(dt||ft)(!0,e,t)}function s(e){return e.toLowerCase().replace("-","")}function a(e){return{provide:i.NG_VALIDATORS,useExisting:t.forwardRef(function(){return e}),multi:!0}}function c(e){return{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef(function(){return e}),multi:!0}}function u(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function p(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},Ft))}}function l(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function h(e,t){if(1!==e.nodeType)return[];var n=getComputedStyle(e,null);return t?n[t]:n}function d(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function f(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=h(e),n=t.overflow,i=t.overflowX;return/(auto|scroll|overlay)/.test(n+t.overflowY+i)?e:f(d(e))}function m(e){if(!e)return document.documentElement;for(var t=zt(10)?document.body:null,n=e.offsetParent;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TD","TABLE"].indexOf(n.nodeName)&&"static"===h(n,"position")?m(n):n:e?e.ownerDocument.documentElement:document.documentElement}function g(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||m(e.firstElementChild)===e)}function y(e){return null!==e.parentNode?y(e.parentNode):e}function v(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?e:t,r=n?t:e,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var s=o.commonAncestorContainer;if(e!==s&&t!==s||i.contains(r))return g(s)?s:m(s);var a=y(e);return a.host?v(a.host,t):v(e,y(t).host)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",i=e.nodeName;if("BODY"===i||"HTML"===i){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[n]}return e[n]}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=b(t,"top"),r=b(t,"left"),o=n?-1:1;return e.top+=i*o,e.bottom+=i*o,e.left+=r*o,e.right+=r*o,e}function _(e,t){var n="x"===t?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+i+"Width"],10)}function D(e,t,n,i){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],zt(10)?n["offset"+e]+i["margin"+("Height"===e?"Top":"Left")]+i["margin"+("Height"===e?"Bottom":"Right")]:0)}function O(){var e=document.body,t=document.documentElement,n=zt(10)&&getComputedStyle(t);return{height:D("Height",e,t,n),width:D("Width",e,t,n)}}function C(e){return Kt({},e,{right:e.left+e.width,bottom:e.top+e.height})}function S(e){var t={};try{if(zt(10)){t=e.getBoundingClientRect();var n=b(e,"top"),i=b(e,"left");t.top+=n,t.left+=i,t.bottom+=n,t.right+=i}else t=e.getBoundingClientRect()}catch(e){}var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?O():{},s=o.width||e.clientWidth||r.right-r.left,a=o.height||e.clientHeight||r.bottom-r.top,c=e.offsetWidth-s,u=e.offsetHeight-a;if(c||u){var p=h(e);c-=_(p,"x"),u-=_(p,"y"),r.width-=c,r.height-=u}return C(r)}function M(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=zt(10),r="HTML"===t.nodeName,o=S(e),s=S(t),a=f(e),c=h(t),u=parseFloat(c.borderTopWidth,10),p=parseFloat(c.borderLeftWidth,10);n&&"HTML"===t.nodeName&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var l=C({top:o.top-s.top-u,left:o.left-s.left-p,width:o.width,height:o.height});if(l.marginTop=0,l.marginLeft=0,!i&&r){var d=parseFloat(c.marginTop,10),m=parseFloat(c.marginLeft,10);l.top-=u-d,l.bottom-=u-d,l.left-=p-m,l.right-=p-m,l.marginTop=d,l.marginLeft=m}return(i&&!n?t.contains(a):t===a&&"BODY"!==a.nodeName)&&(l=w(l,t)),l}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,i=M(e,n),r=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),s=t?0:b(n),a=t?0:b(n,"left");return C({top:s-i.top+i.marginTop,left:a-i.left+i.marginLeft,width:r,height:o})}function k(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===h(e,"position")||k(d(e)))}function P(e){if(!e||!e.parentElement||zt())return document.documentElement;for(var t=e.parentElement;t&&"none"===h(t,"transform");)t=t.parentElement;return t||document.documentElement}function x(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},s=r?P(e):v(e,t);if("viewport"===i)o=T(s,r);else{var a=void 0;"scrollParent"===i?(a=f(d(t)),"BODY"===a.nodeName&&(a=e.ownerDocument.documentElement)):a="window"===i?e.ownerDocument.documentElement:i;var c=M(a,s,r);if("HTML"!==a.nodeName||k(s))o=c;else{var u=O(),p=u.height,l=u.width;o.top+=c.top-c.marginTop,o.bottom=p+c.top,o.left+=c.left-c.marginLeft,o.right=l+c.left}}return o.left+=n,o.top+=n,o.right-=n,o.bottom-=n,o}function I(e){return e.width*e.height}function E(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var s=x(n,i,o,r),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},c=Object.keys(a).map(function(e){return Kt({key:e},a[e],{area:I(a[e])})}).sort(function(e,t){return t.area-e.area}),u=c.filter(function(e){var t=e.width,i=e.height;return t>=n.clientWidth&&i>=n.clientHeight}),p=u.length>0?u[0].key:c[0].key,l=e.split("-")[1];return p+(l?"-"+l:"")}function L(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return M(n,i?P(t):v(t,n),i)}function j(e){var t=getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+i,height:e.offsetHeight+n}}function V(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function H(e,t,n){n=n.split("-")[0];var i=j(e),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),s=o?"top":"left",a=o?"left":"top",c=o?"height":"width",u=o?"width":"height";return r[s]=t[s]+t[c]/2-i[c]/2,r[a]=n===a?t[a]-i[u]:t[V(a)],r}function R(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function A(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var i=R(e,function(e){return e[t]===n});return e.indexOf(i)}function F(e,t,n){return(void 0===n?e:e.slice(0,A(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&l(n)&&(t.offsets.popper=C(t.offsets.popper),t.offsets.reference=C(t.offsets.reference),t=n(t,e))}),t}function Y(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=E(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=H(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=F(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function B(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function N(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;is[f]&&(e.offsets.popper[l]+=a[l]+m-s[f]),e.offsets.popper=C(e.offsets.popper);var g=a[l]+a[u]/2-m/2,y=h(e.instance.popper),v=parseFloat(y["margin"+p],10),b=parseFloat(y["border"+p+"Width"],10),w=g-e.offsets.popper[l]-v-b;return w=Math.max(Math.min(s[u]-m,w),0),e.arrowElement=i,e.offsets.arrow=(n={},Qt(n,l,Math.round(w)),Qt(n,d,""),n),e}function re(e){return"end"===e?"start":"start"===e?"end":e}function oe(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Gt.indexOf(e),i=Gt.slice(n+1).concat(Gt.slice(0,n));return t?i.reverse():i}function se(e,t){if(B(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=x(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),i=e.placement.split("-")[0],r=V(i),o=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case Jt.FLIP:s=[i,r];break;case Jt.CLOCKWISE:s=oe(i);break;case Jt.COUNTERCLOCKWISE:s=oe(i,!0);break;default:s=t.behavior}return s.forEach(function(a,c){if(i!==a||s.length===c+1)return e;i=e.placement.split("-")[0],r=V(i);var u=e.offsets.popper,p=e.offsets.reference,l=Math.floor,h="left"===i&&l(u.right)>l(p.left)||"right"===i&&l(u.left)l(p.top)||"bottom"===i&&l(u.top)l(n.right),m=l(u.top)l(n.bottom),y="left"===i&&d||"right"===i&&f||"top"===i&&m||"bottom"===i&&g,v=-1!==["top","bottom"].indexOf(i),b=!!t.flipVariations&&(v&&"start"===o&&d||v&&"end"===o&&f||!v&&"start"===o&&m||!v&&"end"===o&&g);(h||y||b)&&(e.flipped=!0,(h||y)&&(i=s[c+1]),b&&(o=re(o)),e.placement=i+(o?"-"+o:""),e.offsets.popper=Kt({},e.offsets.popper,H(e.instance.popper,e.offsets.reference,e.placement)),e=F(e.instance.modifiers,e,"flip"))}),e}function ae(e){var t=e.offsets,n=t.popper,i=t.reference,r=e.placement.split("-")[0],o=Math.floor,s=-1!==["top","bottom"].indexOf(r),a=s?"right":"bottom",c=s?"left":"top",u=s?"width":"height";return n[a]o(i[a])&&(e.offsets.popper[c]=o(i[a])),e}function ce(e,t,n,i){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+r[1],s=r[2];if(!o)return e;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=i}return C(a)[t]/100*o}if("vh"===s||"vw"===s){return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}function ue(e,t,n,i){var r=[0,0],o=-1!==["right","left"].indexOf(i),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(R(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,u=-1!==a?[s.slice(0,a).concat([s[a].split(c)[0]]),[s[a].split(c)[1]].concat(s.slice(a+1))]:[s];return u=u.map(function(e,i){var r=(1===i?!o:o)?"height":"width",s=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return ce(e,r,t,n)})}),u.forEach(function(e,t){e.forEach(function(n,i){G(n)&&(r[t]+=n*("-"===e[i-1]?-1:1))})}),r}function pe(e,t){var n=t.offset,i=e.placement,r=e.offsets,o=r.popper,s=r.reference,a=i.split("-")[0],c=void 0;return c=G(+n)?[+n,0]:ue(n,o,s,a),"left"===a?(o.top+=c[0],o.left-=c[1]):"right"===a?(o.top+=c[0],o.left+=c[1]):"top"===a?(o.left+=c[0],o.top-=c[1]):"bottom"===a&&(o.left+=c[0],o.top+=c[1]),e.popper=o,e}function le(e,t){var n=t.boundariesElement||m(e.instance.popper);e.instance.reference===n&&(n=m(n));var i=x(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);t.boundaries=i;var r=t.priority,o=e.offsets.popper,s={primary:function(e){var n=o[e];return o[e]i[e]&&!t.escapeWithReference&&(r=Math.min(o[n],i[e]-("right"===e?o.width:o.height))),Qt({},n,r)}};return r.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";o=Kt({},o,s[t](e))}),e.offsets.popper=o,e}function he(e){var t=e.placement,n=t.split("-")[0],i=t.split("-")[1];if(i){var r=e.offsets,o=r.reference,s=r.popper,a=-1!==["bottom","top"].indexOf(n),c=a?"left":"top",u=a?"width":"height",p={start:Qt({},c,o[c]),end:Qt({},c,o[c]+o[u]-s[u])};e.offsets.popper=Kt({},s,p[i])}return e}function de(e){if(!ne(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=R(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right0?"in "+i:i+" ago":i}function Pe(e){return e.replace(Fn,function(e){return e.slice(1)})}function xe(e,t,n,i){return Bn[e]}function Ie(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}function Ee(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}function Le(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}function je(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}function Ve(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}function He(e){return parseInt(e[1],10)}function Re(e,t){var n=ye(e,t),i=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime(),o=i-r;return Math.floor(o/ti)+1}function Ae(e,t){var n=ye(e,t),i=n.getUTCDay(),r=(i<1?7:0)+i-1;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function Fe(e,t){var n=ye(e,t),i=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(i+1,0,4),r.setUTCHours(0,0,0,0);var o=Ae(r,t),s=new Date(0);s.setUTCFullYear(i,0,4),s.setUTCHours(0,0,0,0);var a=Ae(s,t);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Ye(e,t){var n=Fe(e,t),i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),Ae(i,t)}function Be(e,t){var n=ye(e,t),i=Ae(n,t).getTime()-Ye(n,t).getTime();return Math.round(i/ni)+1}function Ne(e,t){t=t||"";var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;return n+Ue(r,2)+t+Ue(o,2)}function Ue(e,t){for(var n=Math.abs(e).toString();n.length=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=ye(e,n),u=Number(t),p=c.getUTCDay(),l=u%7,h=(l+7)%7,d=(h=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=o.locale||ei,c=a.parsers||{},u=a.units||{};if(!a.match)throw new RangeError("locale must contain match property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var p=String(t).replace(hi,function(e){return"["===e[0]?e:"\\"===e[0]?nt(e):a.formatLong(e)});if(""===p)return""===r?ye(n,o):new Date(NaN);var l=Se(o);l.locale=a;var h,d=p.match(a.parsingTokensRegExp||di),f=d.length,m=[{priority:pi,set:tt,index:0}];for(h=0;h\n \n \n\n',styles:["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"]}]}],n.ctorParameters=function(){return[]},n.propDecorators={isDismissable:[{type:t.Input}],onDismiss:[{type:t.Output,args:["dismiss"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],class:[{type:t.Input,args:["class"]}]},n}(),Dt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[_t],exports:[_t]}]}],e.ctorParameters=function(){return[]},e}(),Ot=function(){function e(){this._paginationClasses=!0,this.pageChange=new t.EventEmitter,this.pageSize=10,this._page=1,this._pages=[],this.pageCount=1,this.hasNavigationLinks=!0,this.hasBoundaryLinks=!1,this.canRotate=!1,this.hasEllipses=!0}return Object.defineProperty(e.prototype,"maxSize",{get:function(){return this._maxSize},set:function(e){this._maxSize=void 0!=e?Math.max(e,1):void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collectionSize",{get:function(){return this._collectionSize},set:function(e){this._collectionSize=Math.max(e,0),this.pageCount=Math.max(1,Math.ceil(this._collectionSize/this.pageSize))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNavigationLinks",{get:function(){var e=this._maxSize||this.pageCount;return this._hasNavigationLinks||e1},e.prototype.hasNext=function(){return this.page\n \n\n\n \n\n\n \n 1\n \n ...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n',styles:["\n:host .item {\n transition: none;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_paginationClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.pagination"]},{type:t.HostBinding,args:["class.menu"]}],pageChange:[{type:t.Output}],maxSize:[{type:t.Input}],pageSize:[{type:t.Input}],collectionSize:[{type:t.Input}],hasNavigationLinks:[{type:t.Input}],hasBoundaryLinks:[{type:t.Input}],canRotate:[{type:t.Input}],hasEllipses:[{type:t.Input}],page:[{type:t.Input}]},e}(),Ct=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],exports:[Ot],declarations:[Ot],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),St=function(){function e(e){this._changeDetector=e,this.transitionController=new vt(!1),this._isOpen=!1,this.isOpenChange=new t.EventEmitter(!1)}return Object.defineProperty(e.prototype,"service",{set:function(e){this._service=e,this._changeDetector.detectChanges()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},set:function(e){var t=!!e;t!==this.isOpen&&(this._isOpen=t,t&&this._service&&this._service.closeOtherPanels(this),this.isOpenChange.emit(this.isOpen),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.transition,this.transitionDuration)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{get:function(){return this._service?this._service.transition:"fade"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{get:function(){return this._service?this._service.transitionDuration:0},enumerable:!0,configurable:!0}),e.prototype.toggle=function(){this.isDisabled||(this.isOpen=!this.isOpen)},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion-panel",exportAs:"suiAccordionPanel",template:'\n\x3c!-- Title --\x3e\n
\n \n
\n\x3c!-- Content --\x3e\n
\n
\n \n
\n
\n',styles:["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},e.propDecorators={isDisabled:[{type:t.Input}],isOpen:[{type:t.Input}],isOpenChange:[{type:t.Output}]},e}(),Mt=function(){function e(){this.closeOthers=!0,this.transition="fade",this.transitionDuration=350,this.panels=[]}return e.prototype.addPanel=function(e){e.service=this,this.panels.push(e)},e.prototype.closeOtherPanels=function(e){this.closeOthers&&this.panels.forEach(function(t){t!==e&&(t.isOpen=!1)})},e}(),Tt=function(){function e(){this._service=new Mt,this.accordionClasses=!0}return Object.defineProperty(e.prototype,"closeOthers",{get:function(){return this._service.closeOthers},set:function(e){this._service.closeOthers=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transition",{set:function(e){this._service.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionDuration",{set:function(e){this._service.transitionDuration=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.updatePanels(),this._panels.changes.subscribe(function(){return e.updatePanels()})},e.prototype.updatePanels=function(){var e=this;this._panels.forEach(function(t){return e._service.addPanel(t)})},e.decorators=[{type:t.Component,args:[{selector:"sui-accordion",template:"\n\n",styles:["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={accordionClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.accordion"]}],closeOthers:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],_panels:[{type:t.ContentChildren,args:[St]}]},e}(),kt=function(){function e(e,t){this._element=e,this._renderer=t,this._pristine=!0,this.collapseDuration=350,this._isExpanded=!1,this._isCollapsing=!1}return Object.defineProperty(e.prototype,"_isCollapsed",{get:function(){return!this._isExpanded&&!this._isCollapsing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suiCollapse",{get:function(){return this._isExpanded},set:function(e){e?this.hide():this.show()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_animationDuration",{get:function(){return this._pristine?0:this.collapseDuration},enumerable:!0,configurable:!0}),e.prototype.hide=function(){var e=this;this._isCollapsing=!0,this._isExpanded=!1,this._renderer.setStyle(this._element.nativeElement,"overflow","hidden"),this.animate(this._element.nativeElement.scrollHeight,0,!1,function(){e._isCollapsing=!1})},e.prototype.show=function(){var e=this;this._isCollapsing=!0,this.animate(this._element.nativeElement.offsetHeight,this._element.nativeElement.scrollHeight,!0,function(){e._renderer.removeStyle(e._element.nativeElement,"overflow"),e._isCollapsing=!1,e._isExpanded=!0})},e.prototype.animate=function(e,t,n,i){void 0===n&&(n=!1),void 0===i&&(i=function(){});var r=[{offset:0,height:e+"px"},{offset:1,height:t+"px"}];n&&r.push({offset:1,height:"auto"}),this._element.nativeElement.animate(r,{delay:0,duration:this._animationDuration,iterations:1,easing:"ease",fill:"both"}),this._pristine&&(this._pristine=!1),setTimeout(function(){return i()},this.collapseDuration)},e.decorators=[{type:t.Directive,args:[{selector:"[suiCollapse]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e.propDecorators={_isExpanded:[{type:t.HostBinding,args:["class.expanded"]}],_isCollapsed:[{type:t.HostBinding,args:["class.collapsed"]}],_isCollapsing:[{type:t.HostBinding,args:["class.collapsing"]}],suiCollapse:[{type:t.Input}],collapseDuration:[{type:t.Input}]},e}(),Pt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[kt],exports:[kt]}]}],e.ctorParameters=function(){return[]},e}(),xt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Pt,wt],declarations:[Tt,St],exports:[Tt,St],providers:[]}]}],e.ctorParameters=function(){return[]},e}(),It=function(){function e(e){this._host=e,this.onValidatorChange=function(){}}return e.prototype.validate=function(e){return this._host.validate(e)},e.prototype.registerOnValidatorChange=function(e){this.onValidatorChange=e},e}(),Et=function(){function e(e){this._host=e,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){this._host.writeValue(e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e}();!function(e){e[e.Left=37]="Left",e[e.Up=38]="Up",e[e.Right=39]="Right",e[e.Down=40]="Down",e[e.Escape=27]="Escape",e[e.Enter=13]="Enter",e[e.Space=32]="Space",e[e.Backspace=8]="Backspace"}(e.KeyCode||(e.KeyCode={}));var Lt=function(){function e(){}return e}(),jt={Array:{range:function(e,t){return void 0===t&&(t=0),Array(e).fill(0).map(function(e,n){return n+t})},group:function(e,t){for(var n=e.slice(0),i=[];n.length>0;)i.push(n.splice(0,t));return i},groupBy:function(e,t){return e.reduce(function(e,n){var i=n[t].toString();return e[i]=e[i]||[],e[i].push(n),e},Object())},flatten:function(e){return e.reduce(function(e,t){return e.concat(t)},[])}},String:{padLeft:function(e,t,n){for(var i=e;i.length=0){Ft=1;break}var Bt=Rt&&window.Promise,Nt=Bt?u:p,Ut={},zt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";if(e=e.toString(),Ut.hasOwnProperty(e))return Ut[e];switch(e){case"11":Ut[e]=-1!==navigator.userAgent.indexOf("Trident");break;case"10":Ut[e]=-1!==navigator.appVersion.indexOf("MSIE 10");break;case"all":Ut[e]=-1!==navigator.userAgent.indexOf("Trident")||-1!==navigator.userAgent.indexOf("MSIE")}return Ut.all=Ut.all||Object.keys(Ut).some(function(e){return Ut[e]}),Ut[e]},Wt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},qt=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Wt(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=Nt(this.update.bind(this)),this.options=Kt({},e.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(Kt({},e.Defaults.modifiers,r.modifiers)).forEach(function(t){i.options.modifiers[t]=Kt({},e.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return Kt({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&l(e.onLoad)&&e.onLoad(i.reference,i.popper,i.options,e,i.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return qt(e,[{key:"update",value:function(){return Y.call(this)}},{key:"destroy",value:function(){return U.call(this)}},{key:"enableEventListeners",value:function(){return Q.call(this)}},{key:"disableEventListeners",value:function(){return $.call(this)}}]),e}();en.Utils=("undefined"!=typeof window?window:global).PopperUtils,en.placements=$t,en.Defaults=Xt;var tn={Auto:"auto",TopLeft:"top left",Top:"top",TopRight:"top right",LeftTop:"left top",Left:"left",LeftBottom:"left bottom",BottomLeft:"bottom left",Bottom:"bottom",BottomRight:"bottom right",RightTop:"right top",Right:"right",RightBottom:"right bottom"},nn=function(){function e(e,t,n,i){var r=this;this.anchor=e,this.subject=t,this._placement=n;var o={computeStyle:{gpuAcceleration:!1},preventOverflow:{escapeWithReference:!0,boundariesElement:document.body},arrow:{element:i}};i||delete o.arrow,this._popper=new en(e.nativeElement,t.nativeElement,{placement:me(n),modifiers:o,onCreate:function(e){return r._popperState=e},onUpdate:function(e){return r._popperState=e}})}return Object.defineProperty(e.prototype,"placement",{get:function(){return this._placement},set:function(e){this._placement=e,this._popper.options.placement=me(e),this.update()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"actualPlacement",{get:function(){return this._popperState?ge(this._popperState.placement):tn.Auto},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._popperState},enumerable:!0,configurable:!0}),e.prototype.update=function(){this._popper.update()},e.prototype.destroy=function(){this._popper.destroy()},e}(),rn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],providers:[Ht]}]}],e.ctorParameters=function(){return[]},e}(),on=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),sn=function(){function e(){this.isChecked=!1,this.onCheckChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._checkboxClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.toggle(),this.focusCheckbox())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.toggle=function(){this.isChecked=!this.isChecked,this.onCheckChange.emit(this.isChecked)},e.prototype.writeValue=function(e){this.isChecked=e},e.prototype.focusCheckbox=function(){this._checkboxElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-checkbox",exportAs:"suiCheckbox",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_checkboxClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCheckChange:[{type:t.Output,args:["checkChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_checkboxElement:[{type:t.ViewChild,args:["checkbox"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),an=function(e){function n(t){return e.call(this,t)||this}return on(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-checkbox",host:{"(checkChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:sn}]},n}(Et),cn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),un=function(){function e(){this._radioClasses=!0,this.isChecked=!1,this.onCurrentValueChange=new t.EventEmitter,this.onTouched=new t.EventEmitter,this.isDisabled=!1,this.isReadonly=!1,this._radioClasses=!0}return Object.defineProperty(e.prototype,"checkedAttribute",{get:function(){return this.isChecked?"":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledAttribute",{get:function(){return this.isDisabled?"disabled":void 0},enumerable:!0,configurable:!0}),e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onClick=function(){this.isDisabled||this.isReadonly||(this.currentValue=this.value,this.onCurrentValueChange.emit(this.currentValue),this.update(),this.focusRadio())},e.prototype.onFocusOut=function(){this.onTouched.emit()},e.prototype.update=function(){this.isChecked=this.currentValue===this.value},e.prototype.writeValue=function(e){this.currentValue=e,this.update()},e.prototype.focusRadio=function(){this._radioElement.nativeElement.focus()},e.decorators=[{type:t.Component,args:[{selector:"sui-radio-button",template:'\n\n\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={_radioClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.radio"]},{type:t.HostBinding,args:["class.checkbox"]}],name:[{type:t.Input}],value:[{type:t.Input}],isChecked:[{type:t.HostBinding,args:["class.checked"]}],onCurrentValueChange:[{type:t.Output,args:["currentValueChange"]}],onTouched:[{type:t.Output,args:["touched"]}],isDisabled:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],_radioElement:[{type:t.ViewChild,args:["radio"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusOut:[{type:t.HostListener,args:["focusout"]}]},e}(),pn=function(e){function n(t){return e.call(this,t)||this}return cn(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-radio-button",host:{"(currentValueChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:un}]},n}(Et),ln=function(){function e(e){this.element=e,this.isNested=!1,this._radioSubs=[]}return e.prototype.ngAfterContentInit=function(){var e=this;this.updateNesting(),this._subManagers.changes.subscribe(function(){return e.updateNesting()}),this.updateRadios(),this._renderedRadios.changes.subscribe(function(){return e.updateRadios()})},e.prototype.updateNesting=function(){var e=this;this._subManagers.filter(function(t){return t!==e}).forEach(function(e){return e.isNested=!0})},e.prototype.updateRadios=function(){var e=this;this._radioSubs.forEach(function(e){return e.unsubscribe()}),this._radioSubs=[];var t=jt.Array.groupBy(this._renderedRadios.toArray(),"name");Object.keys(t).map(function(e){return t[e]}).forEach(function(t){return t.forEach(function(n){return e._radioSubs.push(n.onCurrentValueChange.subscribe(function(n){e.isNested||t.forEach(function(e){return e.writeValue(n)})}))})})},e.decorators=[{type:t.Directive,args:[{selector:"form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={_subManagers:[{type:t.ContentChildren,args:[e,{descendants:!0}]}],_renderedRadios:[{type:t.ContentChildren,args:[un,{descendants:!0}]}]},e}(),hn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule],declarations:[sn,an,un,pn,ln],exports:[sn,an,un,pn,ln]}]}],e.ctorParameters=function(){return[]},e}();!function(e){e[e.DateOnly=0]="DateOnly",e[e.TimeOnly=1]="TimeOnly",e[e.Both=2]="Both"}(e.CalendarMode||(e.CalendarMode={}));var dn=function(){function e(e,n){this.localeValues=n,this.onManualUpdate=function(){},this.config=e,this.currentDate=new Date,this.firstDayOfWeek=this.localeValues.firstDayOfWeek,this.onDateChange=new t.EventEmitter,this.reset()}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},set:function(e){this._config=e,e.updateBounds(this._selectedDate||this.currentDate)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inFinalView",{get:function(){return this.currentView===this.config.mappings.finalView},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){e?(this._selectedDate=Vt.clone(e),this.currentDate=Vt.clone(e)):this._selectedDate=void 0,this.config.updateBounds(this._selectedDate||this.currentDate),this.onManualUpdate()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){ -return this._minDate&&this.config.dateMinBound?this._minDate>this.config.dateMinBound?this._minDate:this.config.dateMinBound:this._minDate||this.config.dateMinBound},set:function(e){this._minDate=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate&&this.config.dateMaxBound?this._maxDate=this.ranges.current.inRange.length&&(i=!0),!o){var s=this.ranges.current.findIndex(this._highlightedItem),a=this.ranges.calc(i).inRange;if(i?s-=this.ranges.current.inRange.length:s+=a.length,o=a[s+r],o.isDisabled)return}this.ranges.move(i),this._highlightedItem=this.ranges.current.find(o)}},n.prototype.ngOnDestroy=function(){this._documentKeyDownListener()},n.propDecorators={_renderedItems:[{type:t.ViewChildren,args:[mn]}],service:[{type:t.Input}]},n}(),yn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vn=function(){function e(){}return e}(),bn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Date,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Date]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month]]),n}return yn(n,t),n}(vn),wn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Hour,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),_n=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Date,n.finalView=e.CalendarViewType.Minute,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Date],[e.CalendarViewType.Date,e.CalendarViewType.Hour],[e.CalendarViewType.Hour,e.CalendarViewType.Minute],[e.CalendarViewType.Minute,e.CalendarViewType.Minute]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Date],[e.CalendarViewType.Month,e.CalendarViewType.Year],[e.CalendarViewType.Date,e.CalendarViewType.Month],[e.CalendarViewType.Hour,e.CalendarViewType.Date],[e.CalendarViewType.Minute,e.CalendarViewType.Hour]]),n}return yn(n,t),n}(vn),Dn=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Month,n.finalView=e.CalendarViewType.Month,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Month]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Month],[e.CalendarViewType.Month,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),On=function(t){function n(){var n=t.call(this)||this;return n.initialView=e.CalendarViewType.Year,n.finalView=e.CalendarViewType.Year,n.changed=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n.zoom=new Map([[e.CalendarViewType.Year,e.CalendarViewType.Year]]),n}return yn(n,t),n}(vn),Cn=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sn=function(){function t(e,t,n,i){this.mode=e,this.precision=t,this.mappings=n,this.fallback=i}return t.prototype.updateBounds=function(t){this.dateMinBound=Vt.startOf(e.DatePrecision.Year,new Date,!0),this.dateMinBound.setFullYear(0)},t}(),Mn=function(t){function n(n,i,r){return t.call(this,e.CalendarMode.DateOnly,n,i,r)||this}return Cn(n,t),n}(Sn),Tn=function(t){function n(){return t.call(this,e.DatePrecision.Year,new On,"number")||this}return Cn(n,t),n}(Mn),kn=function(t){function n(){return t.call(this,e.DatePrecision.Month,new Dn,"month")||this}return Cn(n,t),n}(Mn),Pn=function(t){function n(){return t.call(this,e.DatePrecision.Date,new bn,"date")||this}return Cn(n,t),n}(Mn),xn=function(t){function n(){return t.call(this,e.CalendarMode.Both,e.DatePrecision.Minute,new _n,"datetime-local")||this}return Cn(n,t),n}(Sn),In=function(t){function n(){return t.call(this,e.CalendarMode.TimeOnly,e.DatePrecision.Minute,new wn,"time")||this}return Cn(n,t),n.prototype.updateBounds=function(t){this.dateMaxBound=Vt.endOf(e.DatePrecision.Date,Vt.clone(t)),this.dateMinBound=Vt.previous(e.DatePrecision.Date,Vt.clone(this.dateMaxBound))},n}(Sn),En=function(){function t(e,t){this._precision=e,this._isSmallest=t}return t.prototype.equal=function(t,n){return this._precision===e.DatePrecision.Minute?!!n&&Vt.equal(e.DatePrecision.Hour,n,t)&&jt.Math.roundDown(n.getMinutes(),5)===jt.Math.roundDown(t.getMinutes(),5):!!n&&Vt.equal(this._precision,t,n)},t.prototype.lessThan=function(e,t){return this._isSmallest?!t||t>=e:!t||Vt.endOf(this._precision,Vt.clone(t))>=e},t.prototype.greaterThan=function(e,t){return this._isSmallest?!t||t<=e:!t||Vt.startOf(this._precision,Vt.clone(t))<=e},t.prototype.between=function(e,t,n){return this.greaterThan(e,t)&&this.lessThan(e,n)},t}(),Ln=36e5,jn=6e4,Vn=2,Hn={dateTimeDelimeter:/[T ]/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-])(\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/},Rn=6e4,An={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Fn=/MMMM|MM|DD|dddd/g,Yn=function(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||Pe(e.L),ll:e.ll||Pe(e.LL),lll:e.lll||Pe(e.LLL),llll:e.llll||Pe(e.LLLL)};return function(e){return t[e]}}({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"}),Bn={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"},Nn={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Un={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},zn={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},Wn={ordinalNumber:Le,weekday:Ie(Nn,"long"),weekdays:Ee(Nn,"long"),month:Ie(Un,"long"),months:Ee(Un,"long"),timeOfDay:Ie(zn,"long",function(e){return e/12>=1?1:0}),timesOfDay:Ee(zn,"long")},qn=/^(\d+)(th|st|nd|rd)?/i,Qn={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Kn={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$n={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Gn={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Jn={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},Zn={any:[/^a/i,/^p/i]},Xn={ordinalNumbers:function(e){return function(t){return String(t).match(e)}}(qn),ordinalNumber:He,weekdays:je(Qn,"long"),weekday:Ve(Kn,"any"),months:je($n,"long"),month:Ve(Gn,"any"),timesOfDay:je(Jn,"long"),timeOfDay:Ve(Zn,"any")},ei={formatDistance:ke,formatLong:Yn,formatRelative:xe,localize:Wn,match:Xn,options:{weekStartsOn:0,firstWeekContainsDate:1}},ti=864e5,ni=6048e5,ii={M:function(e){return e.getUTCMonth()+1},Mo:function(e,t){var n=e.getUTCMonth()+1;return t.locale.localize.ordinalNumber(n,{unit:"month"})},MM:function(e){return Ue(e.getUTCMonth()+1,2)},MMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"short"})},MMMM:function(e,t){return t.locale.localize.month(e.getUTCMonth(),{type:"long"})},Q:function(e){return Math.ceil((e.getUTCMonth()+1)/3)},Qo:function(e,t){var n=Math.ceil((e.getUTCMonth()+1)/3);return t.locale.localize.ordinalNumber(n,{unit:"quarter"})},D:function(e){return e.getUTCDate()},Do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDate(),{unit:"dayOfMonth"})},DD:function(e){return Ue(e.getUTCDate(),2)},DDD:function(e){return Re(e)},DDDo:function(e,t){return t.locale.localize.ordinalNumber(Re(e),{unit:"dayOfYear"})},DDDD:function(e){return Ue(Re(e),3)},dd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"narrow"})},ddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"short"})},dddd:function(e,t){return t.locale.localize.weekday(e.getUTCDay(),{type:"long"})},d:function(e){return e.getUTCDay()},do:function(e,t){return t.locale.localize.ordinalNumber(e.getUTCDay(),{unit:"dayOfWeek"})},E:function(e){return e.getUTCDay()||7},W:function(e){return Be(e)},Wo:function(e,t){return t.locale.localize.ordinalNumber(Be(e),{unit:"isoWeek"})},WW:function(e){return Ue(Be(e),2)},YY:function(e){return Ue(e.getUTCFullYear(),4).substr(2)},YYYY:function(e){return Ue(e.getUTCFullYear(),4)},GG:function(e){return String(Fe(e)).substr(2)},GGGG:function(e){return Fe(e)},H:function(e){return e.getUTCHours()},HH:function(e){return Ue(e.getUTCHours(),2)},h:function(e){var t=e.getUTCHours();return 0===t?12:t>12?t%12:t},hh:function(e){return Ue(ii.h(e),2)},m:function(e){return e.getUTCMinutes()},mm:function(e){return Ue(e.getUTCMinutes(),2)},s:function(e){return e.getUTCSeconds()},ss:function(e){return Ue(e.getUTCSeconds(),2)},S:function(e){return Math.floor(e.getUTCMilliseconds()/100)},SS:function(e){return Ue(Math.floor(e.getUTCMilliseconds()/10),2)},SSS:function(e){return Ue(e.getUTCMilliseconds(),3)},Z:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset(),":")},ZZ:function(e,t){return Ne((t._originalDate||e).getTimezoneOffset())},X:function(e,t){var n=t._originalDate||e;return Math.floor(n.getTime()/1e3)},x:function(e,t){return(t._originalDate||e).getTime()},A:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"uppercase"})},a:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"lowercase"})},aa:function(e,t){return t.locale.localize.timeOfDay(e.getUTCHours(),{type:"long"})}},ri=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,oi=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,si={M:/^(1[0-2]|0?\d)/,D:/^(3[0-1]|[0-2]?\d)/,DDD:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,W:/^(5[0-3]|[0-4]?\d)/,YYYY:/^(\d{1,4})/,H:/^(2[0-3]|[0-1]?\d)/,m:/^([0-5]?\d)/,Z:/^([+-])(\d{2}):(\d{2})/,ZZ:/^([+-])(\d{2})(\d{2})/,singleDigit:/^(\d)/,twoDigits:/^(\d{2})/,threeDigits:/^(\d{3})/,fourDigits:/^(\d{4})/,anyDigits:/^(\d+)/},ai={YY:{unit:"twoDigitYear",match:si.twoDigits,parse:function(e){return Ke(e)}},YYYY:{unit:"year",match:si.YYYY,parse:Ke},GG:{unit:"isoYear",match:si.twoDigits,parse:function(e){return Ke(e)+1900}},GGGG:{unit:"isoYear",match:si.YYYY,parse:Ke},Q:{unit:"quarter",match:si.singleDigit,parse:Ke},Qo:{unit:"quarter",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"quarter"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"quarter"})}},M:{unit:"month",match:si.M,parse:function(e){return Ke(e)-1}},Mo:{unit:"month",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"month"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"month"})-1}},MM:{unit:"month",match:si.twoDigits,parse:function(e){return Ke(e)-1}},MMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"short"})},parse:function(e,t){return t.locale.match.month(e,{type:"short"})}},MMMM:{unit:"month",match:function(e,t){return t.locale.match.months(e,{type:"long"})||t.locale.match.months(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.month(e,{type:"long"});return null==n&&(n=t.locale.match.month(e,{type:"short"})),n}},W:{unit:"isoWeek",match:si.W,parse:Ke},Wo:{unit:"isoWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"isoWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"isoWeek"})}},WW:{unit:"isoWeek",match:si.twoDigits,parse:Ke},d:{unit:"dayOfWeek",match:si.singleDigit,parse:Ke},do:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfWeek"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfWeek"})}},dd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){return t.locale.match.weekday(e,{type:"narrow"})}},ddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"short"});return null==n&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},dddd:{unit:"dayOfWeek",match:function(e,t){return t.locale.match.weekdays(e,{type:"long"})||t.locale.match.weekdays(e,{type:"short"})||t.locale.match.weekdays(e,{type:"narrow"})},parse:function(e,t){var n=t.locale.match.weekday(e,{type:"long"});return null==n&&null==(n=t.locale.match.weekday(e,{type:"short"}))&&(n=t.locale.match.weekday(e,{type:"narrow"})),n}},E:{unit:"dayOfISOWeek",match:si.singleDigit,parse:function(e){return Ke(e)}},D:{unit:"dayOfMonth",match:si.D,parse:Ke},Do:{unit:"dayOfMonth",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfMonth"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfMonth"})}},DD:{unit:"dayOfMonth",match:si.twoDigits,parse:Ke},DDD:{unit:"dayOfYear",match:si.DDD,parse:Ke},DDDo:{unit:"dayOfYear",match:function(e,t){return t.locale.match.ordinalNumbers(e,{unit:"dayOfYear"})},parse:function(e,t){return t.locale.match.ordinalNumber(e,{unit:"dayOfYear"})}},DDDD:{unit:"dayOfYear",match:si.threeDigits,parse:Ke},A:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){return t.locale.match.timeOfDay(e,{type:"short"})}},aa:{unit:"timeOfDay",match:function(e,t){return t.locale.match.timesOfDay(e,{type:"long"})||t.locale.match.timesOfDay(e,{type:"short"})},parse:function(e,t){var n=t.locale.match.timeOfDay(e,{type:"long"});return null==n&&(n=t.locale.match.timeOfDay(e,{type:"short"})),n}},H:{unit:"hours",match:si.H,parse:Ke},HH:{unit:"hours",match:si.twoDigits,parse:Ke},h:{unit:"timeOfDayHours",match:si.M,parse:Ke},hh:{unit:"timeOfDayHours",match:si.twoDigits,parse:Ke},m:{unit:"minutes",match:si.m,parse:Ke},mm:{unit:"minutes",match:si.twoDigits,parse:Ke},s:{unit:"seconds",match:si.m,parse:Ke},ss:{unit:"seconds",match:si.twoDigits,parse:Ke},S:{unit:"milliseconds",match:si.singleDigit,parse:function(e){return 100*Ke(e)}},SS:{unit:"milliseconds",match:si.twoDigits,parse:function(e){return 10*Ke(e)}},SSS:{unit:"milliseconds",match:si.threeDigits,parse:Ke},Z:{unit:"timezone",match:si.Z,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},ZZ:{unit:"timezone",match:si.ZZ,parse:function(e){var t=e[1],n=parseInt(e[2],10),i=parseInt(e[3],10),r=60*n+i;return"+"===t?r:-r}},X:{unit:"timestamp",match:si.anyDigits,parse:function(e){return 1e3*Ke(e)}},x:{unit:"timestamp",match:si.anyDigits,parse:Ke}};ai.a=ai.A;var ci=864e5,ui={twoDigitYear:{priority:10,set:function(e,t){var n=Math.floor(e.date.getUTCFullYear()/100),i=100*n+t;return e.date.setUTCFullYear(i,0,1),e.date.setUTCHours(0,0,0,0),e}},year:{priority:10,set:function(e,t){return e.date.setUTCFullYear(t,0,1),e.date.setUTCHours(0,0,0,0),e}},isoYear:{priority:10,set:function(e,t,n){return e.date=Ye(Ze(e.date,t,n),n),e}},quarter:{priority:20,set:function(e,t){return e.date.setUTCMonth(3*(t-1),1),e.date.setUTCHours(0,0,0,0),e}},month:{priority:30,set:function(e,t){return e.date.setUTCMonth(t,1),e.date.setUTCHours(0,0,0,0),e}},isoWeek:{priority:40,set:function(e,t,n){return e.date=Ae(Je(e.date,t,n),n),e}},dayOfWeek:{priority:50,set:function(e,t,n){return e.date=$e(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfISOWeek:{priority:50,set:function(e,t,n){return e.date=Ge(e.date,t,n),e.date.setUTCHours(0,0,0,0),e}},dayOfMonth:{priority:50,set:function(e,t){return e.date.setUTCDate(t),e.date.setUTCHours(0,0,0,0),e}},dayOfYear:{priority:50,set:function(e,t){return e.date.setUTCMonth(0,t),e.date.setUTCHours(0,0,0,0),e}},timeOfDay:{priority:60,set:function(e,t,n){return e.timeOfDay=t,e}},hours:{priority:70,set:function(e,t,n){return e.date.setUTCHours(t,0,0,0),e}},timeOfDayHours:{priority:70,set:function(e,t,n){var i=e.timeOfDay;return null!=i&&(t=Xe(t,i)),e.date.setUTCHours(t,0,0,0),e}},minutes:{priority:80,set:function(e,t){return e.date.setUTCMinutes(t,0,0),e}},seconds:{priority:90,set:function(e,t){return e.date.setUTCSeconds(t,0),e}},milliseconds:{priority:100,set:function(e,t){return e.date.setUTCMilliseconds(t),e}},timezone:{priority:110,set:function(e,t){return e.date=new Date(e.date.getTime()-6e4*t),e}},timestamp:{priority:120,set:function(e,t){return e.date=new Date(t),e}}},pi=110,li=6e4,hi=/(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g,di=/(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g,fi="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},mi=it(function(e,t){function n(e,t,n){n=n||{};var r;return r="string"==typeof i[e]?i[e]:1===t?i[e].one:i[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};e.exports=t.default}),gi=it(function(e,t){function n(e){return e.replace(r,function(e){return e.slice(1)})}function i(e){var t={LTS:e.LTS,LT:e.LT,L:e.L,LL:e.LL,LLL:e.LLL,LLLL:e.LLLL,l:e.l||n(e.L),ll:e.ll||n(e.LL),lll:e.lll||n(e.LLL),llll:e.llll||n(e.LLLL)};return function(e){return t[e]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=/MMMM|MM|DD|dddd/g;e.exports=t.default}),yi=it(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=gi,i=function(e){return e&&e.__esModule?e:{default:e}}(n),r=(0,i.default)({LT:"h:mm aa",LTS:"h:mm:ss aa",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm aa",LLLL:"dddd, MMMM D YYYY h:mm aa"});t.default=r,e.exports=t.default}),vi=it(function(e,t){function n(e,t,n,r){return i[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i={lastWeek:"[last] dddd [at] LT",yesterday:"[yesterday at] LT",today:"[today at] LT",tomorrow:"[tomorrow at] LT",nextWeek:"dddd [at] LT",other:"L"};e.exports=t.default}),bi=it(function(e,t){function n(e,t,n){return function(i,r){var o=r||{},s=o.type?String(o.type):t;return(e[s]||e[t])[n?n(Number(i)):Number(i)]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),wi=it(function(e,t){function n(e,t){return function(n){var i=n||{},r=i.type?String(i.type):t;return e[r]||e[t]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),_i=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"}Object.defineProperty(t,"__esModule",{value:!0});var r=bi,o=n(r),s=wi,a=n(s),c={narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},p={uppercase:["AM","PM"],lowercase:["am","pm"],long:["a.m.","p.m."]},l={ordinalNumber:i,weekday:(0,o.default)(c,"long"),weekdays:(0,a.default)(c,"long"),month:(0,o.default)(u,"long"),months:(0,a.default)(u,"long"),timeOfDay:(0,o.default)(p,"long",function(e){return e/12>=1?1:0}),timesOfDay:(0,a.default)(p,"long")};t.default=l,e.exports=t.default}),Di=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t];return String(n).match(s)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Oi=it(function(e,t){function n(e,t){return function(n,i){var r=i||{},o=r.type?String(r.type):t,s=e[o]||e[t],a=n[1];return s.findIndex(function(e){return e.test(a)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Ci=it(function(e,t){function n(e){return function(t){return String(t).match(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Si=it(function(e,t){function n(e){return parseInt(e[1],10)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default}),Mi=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Di,r=n(i),o=Oi,s=n(o),a=Ci,c=n(a),u=Si,p=n(u),l=/^(\d+)(th|st|nd|rd)?/i,h={narrow:/^(su|mo|tu|we|th|fr|sa)/i,short:/^(sun|mon|tue|wed|thu|fri|sat)/i,long:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},d={any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},f={short:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,long:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},m={any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},g={short:/^(am|pm)/i,long:/^([ap]\.?\s?m\.?)/i},y={any:[/^a/i,/^p/i]},v={ordinalNumbers:(0,c.default)(l),ordinalNumber:p.default,weekdays:(0,r.default)(h,"long"),weekday:(0,s.default)(d,"any"),months:(0,r.default)(f,"long"),month:(0,s.default)(m,"any"),timesOfDay:(0,r.default)(g,"long"),timeOfDay:(0,s.default)(y,"any")};t.default=v,e.exports=t.default}),Ti=it(function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=mi,r=n(i),o=yi,s=n(o),a=vi,c=n(a),u=_i,p=n(u),l=Mi,h=n(l),d={formatDistance:r.default,formatLong:s.default,formatRelative:c.default,localize:p.default,match:h.default,options:{weekStartsOn:0,firstWeekContainsDate:1}};t.default=d,e.exports=t.default}),ki=function(e){return e&&e.__esModule?e.default:e}(Ti),Pi=Object.freeze({default:ki,__moduleExports:Ti}),xi=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=1?1:0}),timesOfDay:ot(i,"long")}),this._locale.match=xi({},this._locale.match,{weekdays:st(t,"long"),weekday:at(t,"long"),months:st(n,"long"),month:at(n,"long"),timesOfDay:st(r,"long"),timeOfDay:at(r,"long")})}return Object.defineProperty(e.prototype,"_config",{get:function(){return{weekStartsOn:this._weekStartsOn,locale:this._locale}},enumerable:!0,configurable:!0}),e.prototype.format=function(e,t){return We(e,t,this._config)},e.prototype.parse=function(e,t,n){return et(e,t,n,this._config)},e}(),Ei=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Li=function(){function e(e,t){this._format=e,this._parser=new Ii(t)}return e.prototype.format=function(e){return this._parser.format(e,this._format)},e.prototype.parse=function(e,t){return void 0===t&&(t=new Date),this._parser.parse(e,this._format,t)},e}(),ji=function(e){function t(t,n){var i={time:"HH:mm",datetime:"YYYY-MM-DDTHH:mm",date:"YYYY-MM-DD",month:"YYYY-MM",year:"YYYY"};return e.call(this,i[t],n)||this}return Ei(t,e),t}(Li),Vi=function(){function e(e,t,n,i,r){this.start=e,this.dates=t,this.items=n,this.groupedItems=i,this._comparer=r}return Object.defineProperty(e.prototype,"inRange",{get:function(){return this.items.filter(function(e){return!e.isOutsideRange})},enumerable:!0,configurable:!0}),e.prototype.find=function(e){var t=this;return this.items.find(function(n){return t._comparer.equal(n.date,e.date)})},e.prototype.findIndex=function(e){var t=this -;return e?this.items.findIndex(function(n){return t._comparer.equal(n.date,e.date)}):-1},e.prototype.containsDate=function(e){var t=this;return!!this.inRange.find(function(n){return t._comparer.equal(n.date,e)})},e}(),Hi=function(){function e(e,t,n){this.interval=e,this.marginal=e+1,this.rows=t,this.columns=n}return Object.defineProperty(e.prototype,"dateComparer",{get:function(){return new En(this.marginal,this.service.inFinalView)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.rows*this.columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMoveNext",{get:function(){var e=this.next.inRange[0];return!e||!this.service.maxDate||e.date<=this.service.maxDate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canMovePrevious",{get:function(){var e=this.previous.inRange.slice(-1).pop();return!e||!this.service.minDate||e.date>=this.service.minDate},enumerable:!0,configurable:!0}),e.prototype.loadService=function(e){this.service=e,this.refresh()},e.prototype.refresh=function(){this.current=this.calcRange(this.service.currentDate),this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate))),this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.move=function(e){return e?this.moveNext():this.movePrevious()},e.prototype.moveNext=function(){Vt.next(this.interval,this.service.currentDate),this.previous=this.current,this.current=this.next,this.next=this.calcRange(Vt.next(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.movePrevious=function(){Vt.previous(this.interval,this.service.currentDate),this.next=this.current,this.current=this.previous,this.previous=this.calcRange(Vt.previous(this.interval,Vt.clone(this.service.currentDate)))},e.prototype.calc=function(e){return e?this.next:this.previous},e.prototype.calcRange=function(e){var t=this.calcStart(e);this.service.inFinalView&&Vt.startOf(this.marginal,t,!0);var n=this.calcDates(t),i=this.calcItems(n,e);return new Vi(t,n,i,jt.Array.group(i,this.columns),this.dateComparer)},e.prototype.calcStart=function(e){return Vt.startOf(this.interval,Vt.clone(e))},e.prototype.calcDates=function(e){var t=this;return jt.Array.range(this.length).map(function(n){return Vt.add(t.marginal,Vt.clone(e),n)})},e.prototype.calcItems=function(e,t){var n=this;return e.map(function(e){var i=new fn(e);return i.isDisabled=!n.dateComparer.between(i.date,n.service.minDate,n.service.maxDate),i.isActive=n.dateComparer.equal(i.date,n.service.selectedDate),i.isToday=n.dateComparer.equal(i.date,new Date),i.isSelectable=i.isDisabled,n.configureItem(i,t),i})},e}(),Ri=function(){function e(){this.onZoomOut=new t.EventEmitter}return e.decorators=[{type:t.Component,args:[{selector:"sui-calendar-view-title",template:'\n\n \n\n\n \n\n\n \n\n',styles:["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={ranges:[{type:t.Input}],onZoomOut:[{type:t.Output,args:["zoomOut"]}]},e}(),Ai={Year:"year",Month:"month",Date:"date",Datetime:"datetime",Time:"time"},Fi=function(){function e(e){this.service=new dn(new xn,e.get().datepicker),this._calendarClasses=!0}return e.prototype.onMouseDown=function(e){e.preventDefault()},e.decorators=[{type:t.Component,args:[{selector:"sui-datepicker",template:'\n\n \n \n \n \n \n\n',styles:["\n:host {\n user-select: none;\n}\n"]}]}],e.ctorParameters=function(){return[{type:mt}]},e.propDecorators={_calendarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.active"]},{type:t.HostBinding,args:["class.calendar"]}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}]},e}(),Yi={Hover:"hover",Click:"click",OutsideClick:"outsideClick",Focus:"focus",Manual:"manual"},Bi=function(){function e(e){void 0===e&&(e={}),this.placement=tn.TopLeft,this.trigger=Yi.Hover,this.isInverted=!1,this.delay=0,this.isBasic=!1,this.transition="scale",this.transitionDuration=200,Object.assign(this,e)}return e}(),Ni=function(){function n(e){this.elementRef=e,this.transitionController=new vt(!1),this._isOpen=!1,this.onOpen=new t.EventEmitter,this.onClose=new t.EventEmitter,this._tabindex=0}return Object.defineProperty(n.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"anchor",{set:function(e){this.positioningService=new nn(e,this._container.element,this.config.placement,".dynamic.arrow")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"direction",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"alignment",{get:function(){if(this.positioningService)return this.positioningService.actualPlacement.split(" ").pop()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dynamicClasses",{get:function(){var e={};return this.direction&&(e[this.direction]=!0),this.alignment&&(e[this.alignment]=!0),this.config.isInverted&&(e.inverted=!0),this.config.isBasic&&(e.basic=!0),e},enumerable:!0,configurable:!0}),n.prototype.open=function(){var t=this;this.isOpen||(clearTimeout(this.closingTimeout),this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.In,function(){var e=t.elementRef.nativeElement.querySelector("[autofocus]");e&&(setTimeout(function(){return e.focus()},10),setTimeout(function(){return e.focus()},t.config.transitionDuration))})),this.positioningService.placement=this.config.placement,setTimeout(function(){return t.positioningService.update()}),this._isOpen=!0,this.onOpen.emit())},n.prototype.toggle=function(){return this.isOpen?this.close():this.open()},n.prototype.close=function(){var t=this;this.isOpen&&(this.transitionController.stopAll(),this.transitionController.animate(new yt(this.config.transition,this.config.transitionDuration,e.TransitionDirection.Out)),clearTimeout(this.closingTimeout),this.closingTimeout=window.setTimeout(function(){return t.onClose.emit()},this.config.transitionDuration),this._isOpen=!1)},n.prototype.onClick=function(e){e.stopPropagation()},n.decorators=[{type:t.Component,args:[{selector:"sui-popup",template:'\n\n',styles:['\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor\'s mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed \'vertically\'. */\n.ui.popup[direction="top"],\n.ui.popup[direction="bottom"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed \'horizontally\'. */\n.ui.popup[direction="left"],\n.ui.popup[direction="right"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n']}]}],n.ctorParameters=function(){return[{type:t.ElementRef}]},n.propDecorators={_container:[{type:t.ViewChild,args:["container",{read:t.ViewContainerRef}]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],_tabindex:[{type:t.HostBinding,args:["attr.tabindex"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(),Ui=function(){function e(e,t,n,i){var r=this;this._element=t,this._componentFactory=n,this._componentRef=this._componentFactory.createComponent(Ni),this.popup.config=i,this.popup.onClose.subscribe(function(){return r.cleanup()}),this._documentListener=e.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"popup",{get:function(){return this._componentRef.instance},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){e&&Object.assign(this.popup.config,e)},e.prototype.openDelayed=function(){var e=this;clearTimeout(this._openingTimeout),this._openingTimeout=window.setTimeout(function(){return e.open()},this.popup.config.delay)},e.prototype.open=function(){this._componentFactory.attachToApplication(this._componentRef),this._componentFactory.moveToDocumentBody(this._componentRef),this.popup.anchor=this._element,this.popup.open();var e=this.popupOnOpen;e&&e.call(this)},e.prototype.close=function(){clearTimeout(this._openingTimeout),this._componentRef&&this.popup.close();var e=this.popupOnClose;e&&e.call(this)},e.prototype.toggleDelayed=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.openDelayed():this.close()},e.prototype.toggle=function(){return!this._componentRef||this._componentRef&&!this.popup.isOpen?this.open():this.close()},e.prototype.onMouseEnter=function(){this.popup.config.trigger===Yi.Hover&&this.openDelayed()},e.prototype.onMouseLeave=function(){this.popup.config.trigger===Yi.Hover&&this.close()},e.prototype.onClick=function(){this.popup.config.trigger===Yi.Click||this.popup.config.trigger===Yi.OutsideClick?this.toggleDelayed():this.popup.config.trigger!==Yi.Focus||this._componentRef&&(!this._componentRef||this.popup.isOpen)||this.openDelayed()},e.prototype.onDocumentClick=function(e){if(this._componentRef&&this.popup.config.trigger===Yi.OutsideClick){var t=e.target;this._element.nativeElement.contains(t)||this.close()}},e.prototype.onFocusIn=function(){this.popup.config.trigger===Yi.Focus&&this.openDelayed()},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.popup.elementRef.nativeElement.contains(e.relatedTarget)||this.popup.config.trigger!==Yi.Focus||this.close()},e.prototype.cleanup=function(){clearTimeout(this._openingTimeout),this._componentRef.instance&&this._componentRef.instance.positioningService&&this._componentRef.instance.positioningService.destroy(),this._componentFactory.detachFromApplication(this._componentRef)},e.prototype.ngOnDestroy=function(){this.cleanup(),this._documentListener()},e.propDecorators={onMouseEnter:[{type:t.HostListener,args:["mouseenter"]}],onMouseLeave:[{type:t.HostListener,args:["mouseleave"]}],onClick:[{type:t.HostListener,args:["click"]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wi=function(e){function t(t,n,i,r,o){var s=e.call(this,t,n,i,o)||this;return s._component=r,s}return zi(t,e),Object.defineProperty(t.prototype,"componentInstance",{get:function(){if(this._contentComponentRef)return this._contentComponentRef.instance},enumerable:!0,configurable:!0}),t.prototype.open=function(){this._contentComponentRef||(this._contentComponentRef=this._componentFactory.createComponent(this._component),this._componentFactory.attachToView(this._contentComponentRef,this.popup.templateSibling)),e.prototype.open.call(this)},t.prototype.cleanup=function(){e.prototype.cleanup.call(this),this._contentComponentRef&&(this._contentComponentRef.destroy(),this._contentComponentRef=void 0)},t}(Ui),qi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Qi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return qi(t,e),t}(Bi),Ki=function(e){function t(t,n,i,r){return e.call(this,t,n,i,r)||this}return qi(t,e),t.prototype.configure=function(t){e.prototype.configure.call(this,t),t&&(this.template=t.template,this.context=t.context)},t.prototype.open=function(){this.template&&(this.popup.templateSibling.clear(),this._componentFactory.createView(this.popup.templateSibling,this.template,{$implicit:this.popup,context:this.context})),e.prototype.open.call(this)},t}(Ui),$i=function(){function e(){}return Object.defineProperty(e.prototype,"direction",{get:function(){if(this.placement)return this.placement.split(" ").shift()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){if(this.placement){var e=this.placement.split(" ").pop();return e===this.direction?"center":e}},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-popup-arrow",template:'\n
\n
\n',styles:['\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction="top"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction="left"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction="bottom"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction="right"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction="bottom"][alignment="left"],\n.static.arrow[direction="top"][alignment="left"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction="left"][alignment="top"],\n.static.arrow[direction="right"][alignment="top"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction="bottom"][alignment="right"],\n.static.arrow[direction="top"][alignment="right"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction="left"][alignment="bottom"],\n.static.arrow[direction="right"][alignment="bottom"] {\n top: auto;\n bottom: 1em;\n}\n']}]}],e.ctorParameters=function(){return[]},e.propDecorators={placement:[{type:t.Input}],inverted:[{type:t.HostBinding,args:["class.inverted"]},{type:t.Input}]},e}(),Gi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ji=function(e){function n(){return e.call(this)||this}return Gi(n,e),n.decorators=[{type:t.Injectable}],n.ctorParameters=function(){return[]},n}(Bi),Zi=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xi=function(e){function n(t,n,i,r){return e.call(this,t,n,i,new Bi(r))||this}return Zi(n,e),Object.defineProperty(n.prototype,"popupHeader",{set:function(e){this.popup.config.header=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupText",{set:function(e){this.popup.config.text=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupInverted",{set:function(e){this.popup.config.isInverted=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupBasic",{set:function(e){this.popup.config.isBasic=jt.DOM.parseBooleanAttribute(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTransitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupPlacement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupDelay",{set:function(e){this.popup.config.delay=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTrigger",{get:function(){return this.popup.config.trigger},set:function(e){this.popup.config.trigger=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplate",{set:function(e){this.template=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupTemplateContext",{set:function(e){this.context=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"popupConfig",{set:function(e){this.configure(e)},enumerable:!0,configurable:!0}),n.decorators=[{type:t.Directive,args:[{selector:"[suiPopup]",exportAs:"suiPopup"}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:Ji}]},n.propDecorators={popupHeader:[{type:t.Input}],popupText:[{type:t.Input}],popupInverted:[{type:t.Input}],popupBasic:[{type:t.Input}],popupTransition:[{type:t.Input}],popupTransitionDuration:[{type:t.Input}],popupPlacement:[{type:t.Input}],popupDelay:[{type:t.Input}],popupTrigger:[{type:t.Input}],popupTemplate:[{type:t.Input}],popupTemplateContext:[{type:t.Input}],popupConfig:[{type:t.Input}]},n}(Ki),er=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt,rn],declarations:[Xi,$i,Ni],exports:[Xi,Ni],providers:[Ji],entryComponents:[Ni]}]}],e.ctorParameters=function(){return[]},e}(),tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),nr=function(n){function i(e,i,r,o){var s=n.call(this,e,i,r,Fi,new Bi({trigger:Yi.Focus,placement:tn.BottomLeft,transition:"scale",transitionDuration:200}))||this;return s.renderer=e,s.localizationService=o,s.renderer.addClass(s.popup.elementRef.nativeElement,"ui"),s.renderer.addClass(s.popup.elementRef.nativeElement,"calendar"),s.onLocaleUpdate(),s.localizationService.onLanguageUpdate.subscribe(function(){return s.onLocaleUpdate()}),s.onSelectedDateChange=new t.EventEmitter,s.onValidatorChange=new t.EventEmitter,s.mode=Ai.Datetime,s}return tr(i,n),Object.defineProperty(i.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(e){this._selectedDate=e,this.onSelectedDateChange.emit(e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mode",{get:function(){return this._mode},set:function(e){switch(this._mode=e||Ai.Datetime,this._mode){case Ai.Year:this.config=new Tn;break;case Ai.Month:this.config=new kn;break;case Ai.Date:default:this.config=new Pn;break;case Ai.Datetime:this.config=new xn;break;case Ai.Time:this.config=new In}this.writeValue(this.selectedDate)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localeValues",{get:function(){return this.localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placement",{set:function(e){this.popup.config.placement=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transition",{set:function(e){this.popup.config.transition=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"transitionDuration",{set:function(e){this.popup.config.transitionDuration=e},enumerable:!0,configurable:!0}),i.prototype.popupOnOpen=function(){var e=this;this.componentInstance&&(this.componentInstance.service.config=this.config,this.componentInstance.service.localeValues=this.localeValues,this.componentInstance.service.currentDate=this.initialDate||new Date,this.componentInstance.service.selectedDate=this.selectedDate,this.componentInstance.service.maxDate=this.maxDate,this.componentInstance.service.minDate=this.minDate,void 0!=this.firstDayOfWeek&&(this.componentInstance.service.firstDayOfWeek=this.firstDayOfWeek),this.componentInstance.service.reset(),this.componentInstance.service.onDateChange.subscribe(function(t){e.selectedDate=t,e.close()}))},i.prototype.ngOnChanges=function(e){var t=e.maxDate,n=e.minDate,i=e.mode;(t||n||i)&&this.onValidatorChange.emit()},i.prototype.onLocaleUpdate=function(){this._localeValues=this.localizationService.get().datepicker},i.prototype.validate=function(e){var t=e.value;if(void 0!=t){if(this.minDate&&tthis.maxDate)return{suiMaxDate:{required:this.maxDate,actual:t}}}return null},i.prototype.writeValue=function(e){this.selectedDate=e,this.componentInstance&&(this.componentInstance.service.selectedDate=e)},i.prototype.onKeyDown=function(t){t.keyCode===e.KeyCode.Escape&&this.close()},i.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",providers:[a(i)]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht},{type:mt}]},i.propDecorators={mode:[{type:t.Input,args:["pickerMode"]}],initialDate:[{type:t.Input,args:["pickerInitialDate"]}],maxDate:[{type:t.Input,args:["pickerMaxDate"]}],minDate:[{type:t.Input,args:["pickerMinDate"]}],firstDayOfWeek:[{type:t.Input,args:["pickerFirstDayOfWeek"]}],localeOverrides:[{type:t.Input,args:["pickerLocaleOverrides"]}],placement:[{type:t.Input,args:["pickerPlacement"]}],transition:[{type:t.Input,args:["pickerTransition"]}],transitionDuration:[{type:t.Input,args:["pickerTransitionDuration"]}],onSelectedDateChange:[{type:t.Output,args:["pickerSelectedDateChange"]}],onValidatorChange:[{type:t.Output,args:["pickerValidatorChange"]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},i}(Wi),ir=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerSelectedDateChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(Et),rr=function(e){function n(t){var n=e.call(this,t)||this;return n.host=t,n}return tr(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[suiDatepicker]",host:{"(pickerValidatorChange)":"onValidatorChange()"},providers:[a(n)]}]}],n.ctorParameters=function(){return[{type:nr}]},n}(It),or=it(function(e){!function(t,n,i){e.exports?e.exports=i():t.bowser=i()}(fi,0,function(){function e(e){function t(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}function n(t){var n=e.match(t);return n&&n.length>1&&n[2]||""}var i,r=t(/(ipod|iphone|ipad)/i).toLowerCase(),o=/like android/i.test(e),a=!o&&/android/i.test(e),c=/nexus\s*[0-6]\s*/i.test(e),u=!c&&/nexus\s*[0-9]+/i.test(e),p=/CrOS/.test(e),l=/silk/i.test(e),h=/sailfish/i.test(e),d=/tizen/i.test(e),f=/(web|hpw)os/i.test(e),m=/windows phone/i.test(e),g=(/SamsungBrowser/i.test(e),!m&&/windows/i.test(e)),y=!r&&!l&&/macintosh/i.test(e),v=!a&&!h&&!d&&!f&&/linux/i.test(e),b=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),w=t(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(e)&&!/tablet pc/i.test(e),D=!_&&/[^-]mobi/i.test(e),O=/xbox/i.test(e);/opera/i.test(e)?i={name:"Opera",opera:s,version:w||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?i={name:"Opera",opera:s,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||w}:/SamsungBrowser/i.test(e)?i={name:"Samsung Internet for Android",samsungBrowser:s,version:w||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?i={name:"Opera Coast",coast:s,version:w||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?i={name:"Yandex Browser",yandexbrowser:s,version:w||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?i={name:"UC Browser",ucbrowser:s,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?i={name:"Maxthon",maxthon:s,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?i={name:"Epiphany",epiphany:s,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?i={name:"Puffin",puffin:s,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?i={name:"Sleipnir",sleipnir:s,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?i={name:"K-Meleon",kMeleon:s,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:m?(i={name:"Windows Phone",osname:"Windows Phone",windowsphone:s},b?(i.msedge=s,i.version=b):(i.msie=s,i.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?i={name:"Internet Explorer",msie:s,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:p?i={name:"Chrome",osname:"Chrome OS",chromeos:s,chromeBook:s,chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(e)?i={name:"Microsoft Edge",msedge:s,version:b}:/vivaldi/i.test(e)?i={name:"Vivaldi",vivaldi:s,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||w}:h?i={name:"Sailfish",osname:"Sailfish OS",sailfish:s,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?i={name:"SeaMonkey",seamonkey:s,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(i={name:"Firefox",firefox:s,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(i.firefoxos=s,i.osname="Firefox OS")):l?i={name:"Amazon Silk",silk:s,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?i={name:"PhantomJS",phantom:s,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?i={name:"SlimerJS",slimer:s,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?i={name:"BlackBerry",osname:"BlackBerry OS",blackberry:s,version:w||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:f?(i={name:"WebOS",osname:"WebOS",webos:s,version:w||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(i.touchpad=s)):/bada/i.test(e)?i={name:"Bada",osname:"Bada",bada:s,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:d?i={name:"Tizen",osname:"Tizen",tizen:s,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||w}:/qupzilla/i.test(e)?i={name:"QupZilla",qupzilla:s,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||w}:/chromium/i.test(e)?i={name:"Chromium",chromium:s,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||w}:/chrome|crios|crmo/i.test(e)?i={name:"Chrome",chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:a?i={name:"Android",version:w}:/safari|applewebkit/i.test(e)?(i={name:"Safari",safari:s},w&&(i.version=w)):r?(i={name:"iphone"==r?"iPhone":"ipad"==r?"iPad":"iPod"},w&&(i.version=w)):i=/googlebot/i.test(e)?{name:"Googlebot",googlebot:s,version:t(/googlebot\/(\d+(\.\d+))/i)||w}:{name:t(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!i.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(i.name=i.name||"Blink",i.blink=s):(i.name=i.name||"Webkit",i.webkit=s),!i.version&&w&&(i.version=w)):!i.opera&&/gecko\//i.test(e)&&(i.name=i.name||"Gecko",i.gecko=s,i.version=i.version||t(/gecko\/(\d+(\.\d+)?)/i)),i.windowsphone||!a&&!i.silk?!i.windowsphone&&r?(i[r]=s,i.ios=s,i.osname="iOS"):y?(i.mac=s,i.osname="macOS"):O?(i.xbox=s,i.osname="Xbox"):g?(i.windows=s,i.osname="Windows"):v&&(i.linux=s,i.osname="Linux"):(i.android=s,i.osname="Android");var C="";i.windows?C=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)):i.windowsphone?C=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):i.mac?(C=t(/Mac OS X (\d+([_\.\s]\d+)*)/i),C=C.replace(/[_\s]/g,".")):r?(C=t(/os (\d+([_\s]\d+)*) like mac os x/i),C=C.replace(/[_\s]/g,".")):a?C=t(/android[ \/-](\d+(\.\d+)*)/i):i.webos?C=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):i.blackberry?C=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):i.bada?C=t(/bada\/(\d+(\.\d+)*)/i):i.tizen&&(C=t(/tizen[\/\s](\d+(\.\d+)*)/i)),C&&(i.osversion=C);var S=!i.windows&&C.split(".")[0];return _||u||"ipad"==r||a&&(3==S||S>=4&&!D)||i.silk?i.tablet=s:(D||"iphone"==r||"ipod"==r||a||c||i.blackberry||i.webos||i.bada)&&(i.mobile=s),i.msedge||i.msie&&i.version>=10||i.yandexbrowser&&i.version>=15||i.vivaldi&&i.version>=1||i.chrome&&i.version>=20||i.samsungBrowser&&i.version>=4||i.firefox&&i.version>=20||i.safari&&i.version>=6||i.opera&&i.version>=10||i.ios&&i.osversion&&i.osversion.split(".")[0]>=6||i.blackberry&&i.version>=10.1||i.chromium&&i.version>=20?i.a=s:i.msie&&i.version<10||i.chrome&&i.version<20||i.firefox&&i.version<20||i.safari&&i.version<6||i.opera&&i.version<10||i.ios&&i.osversion&&i.osversion.split(".")[0]<6||i.chromium&&i.version<20?i.c=s:i.x=s,i}function t(e){return e.split(".").length}function n(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n=0;){if(r[0][i]>r[1][i])return 1;if(r[0][i]!==r[1][i])return-1;if(0===i)return 0}}function r(t,n,r){var o=a;"string"==typeof n&&(r=n,n=void 0),void 0===n&&(n=!1),r&&(o=e(r));var s=""+o.version;for(var c in t)if(t.hasOwnProperty(c)&&o[c]){if("string"!=typeof t[c])throw new Error("Browser version in the minVersion map should be a string: "+c+": "+String(t));return i([s,t[c]])<0}return n}function o(e,t,n){return!r(e,t,n)}var s=!0,a=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return a.test=function(e){for(var t=0;t\n\n \n \n \n {{ date }}\n \n \n \n \n {{ day }}\n \n\n\n \n {{ item.humanReadable }}\n \n \n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),vr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),br=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vr(t,e),t.prototype.configureItem=function(e,t){var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");e.humanReadable=new Li(n,this.service.localeValues).format(e.date),e.isOutsideRange=!1},t}(Hi),wr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Hour,new br(e.DatePrecision.Date,6,4))||this}return vr(i,n),Object.defineProperty(i.prototype,"date",{get:function(){return new Li(this.service.localeValues.formats.date,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-hour-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),_r=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Dr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _r(n,t),n.prototype.calcStart=function(t){return Vt.startOf(e.DatePrecision.Hour,Vt.clone(t),!0)},n.prototype.calcDates=function(t){return jt.Array.range(this.length).map(function(n){return Vt.add(e.DatePrecision.Minute,Vt.clone(t),5*n)})},n.prototype.configureItem=function(e,t){e.humanReadable=new Li(this.service.localeValues.formats.time,this.service.localeValues).format(e.date),e.isOutsideRange=!1},n}(Hi),Or=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Minute,new Dr(e.DatePrecision.Hour,4,3))||this}return _r(i,n),Object.defineProperty(i.prototype,"date",{get:function(){if(this.service.config.mode!==e.CalendarMode.TimeOnly){var t=this.service.localeValues.formats.datetime.replace(/[ms]/g,"0");return new Li(t,this.service.localeValues).format(this.currentDate)}var n=this.service.localeValues.formats.time.replace(/[ms]/g,"0");return new Li(n,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-minute-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Cr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Cr(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=this.service.localeValues.monthsShort[e.date.getMonth()],e.isOutsideRange=!1},t}(Hi),Mr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Month,new Sr(e.DatePrecision.Year,4,3))||this}return Cr(i,n),Object.defineProperty(i.prototype,"year",{get:function(){return new Li(this.service.localeValues.formats.year,this.service.localeValues).format(this.currentDate)},enumerable:!0,configurable:!0}),i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-month-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),Tr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Tr(t,e),t.prototype.configureItem=function(e,t){e.humanReadable=jt.String.padLeft(e.date.getFullYear().toString(),4,"0"),e.isOutsideRange=e.date.getFullYear()>=this.calcStart(t).getFullYear()+10},t}(Hi),Pr=function(n){function i(t){return n.call(this,t,e.CalendarViewType.Year,new kr(e.DatePrecision.Decade,4,3))||this}return Tr(i,n),Object.defineProperty(i.prototype,"decadeStart",{get:function(){return Vt.startOf(e.DatePrecision.Decade,Vt.clone(this.service.currentDate)).getFullYear()},enumerable:!0,configurable:!0}),i.prototype.pad=function(e){return jt.String.padLeft(e.toString(),4,"0")},i.decorators=[{type:t.Component,args:[{selector:"sui-calendar-year-view",template:'\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2}]},i}(gn),xr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,er,gt,rn],declarations:[mn,Ri,Pr,Mr,yr,wr,Or,Fi,nr,ir,rr,fr],exports:[nr,ir,rr,fr],entryComponents:[Fi]}]}],e.ctorParameters=function(){return[]},e}(),Ir=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Er=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o._isDimmed=!1,o.isDimmedChange=new t.EventEmitter,o.isClickable=!0,o.wrapContent=!0,o._dimmerClasses=!0,o}return Ir(i,n),Object.defineProperty(i.prototype,"isDimmed",{get:function(){return this._isDimmed},set:function(t){var n=!!t;this._transitionController?this._isDimmed!==n&&(this._isDimmed=n,this._transitionController.stopAll(),this._transitionController.animate(new yt("fade",this.transitionDuration,n?e.TransitionDirection.In:e.TransitionDirection.Out))):(this._transitionController=new vt(n,"block"),this.setTransitionController(this._transitionController),this._isDimmed=n)},enumerable:!0,configurable:!0}),i.prototype.onClick=function(){this.isClickable&&(this.isDimmed=!1,this.isDimmedChange.emit(this.isDimmed))},i.decorators=[{type:t.Component,args:[{selector:"sui-dimmer",template:'\n
\n
\n \n
\n
\n',styles:["\n:host.dimmer {\n transition: none;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},i.propDecorators={_dimmerClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dimmer"]}],isDimmed:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDimmedChange:[{type:t.Output}],isClickable:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],wrapContent:[{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},i}(bt),Lr=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,wt],declarations:[Er],exports:[Er]}]}],e.ctorParameters=function(){return[]},e}(),jr={ItemClick:"itemClick",OutsideClick:"outsideClick",Disabled:"disabled"},Vr=function(){function e(e){void 0===e&&(e=jr.ItemClick),this.isOpen=!1,this.isOpenChange=new t.EventEmitter,this.isDisabled=!1,this.autoCloseMode=e,this.children=[]}return Object.defineProperty(e.prototype,"isNested",{get:function(){return!!this.parent},enumerable:!0,configurable:!0}),e.prototype.setOpenState=function(e,t){var n=this;void 0===t&&(t=!1),this.isOpen===e||this.isDisabled?this.isOpen!==e&&this.isDisabled&&this.delay(function(){return n.isOpenChange.emit(n.isOpen)}):(this.isOpen=!!e,this.isAnimating=!0,this.delay(function(){return n.isOpenChange.emit(n.isOpen)}),this.isOpen||this.children.forEach(function(e){return e.setOpenState(n.isOpen)}),this.parent&&t&&this.parent.setOpenState(this.isOpen,!0))},e.prototype.setDisabledState=function(e){this.isDisabled!==e&&(e&&this.setOpenState(!1),this.isDisabled=!!e)},e.prototype.toggleOpenState=function(){this.setOpenState(!this.isOpen)},e.prototype.registerChild=function(e){this.isChildRegistered(e)||(this.children.push(e),e.parent=this)},e.prototype.isChildRegistered=function(e){return this===e||!!this.children.find(function(t){return!!t.children.find(function(t){return t.isChildRegistered(e)})})},e.prototype.clearChildren=function(){this.children.forEach(function(e){e.parent=void 0}),this.children=[]},e.prototype.delay=function(e){setTimeout(function(){return e()})},e}();!function(e){"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,n=(t.document||t.ownerDocument).querySelectorAll(e),i=0;n[i]&&n[i]!==t;)++i;return Boolean(n[i])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window.Element.prototype);var Hr=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rr=function(){function e(e,t){this._renderer=e,this.element=t,this.isSelected=!1,this.selectedClass="selected"}return Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.element.nativeElement.classList.contains("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},set:function(e){e?this._renderer.addClass(this.element.nativeElement,this.selectedClass):this._renderer.removeClass(this.element.nativeElement,this.selectedClass)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasChildDropdown",{get:function(){return!!this.childDropdownMenu},enumerable:!0,configurable:!0}),e.prototype.performClick=function(){this.element.nativeElement.click()},e.decorators=[{type:t.Directive,args:[{selector:".item"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={childDropdownMenu:[{type:t.ContentChild,args:[t.forwardRef(function(){return Ar})]}]},e}(),Ar=function(n){function i(e,t,i){var r=n.call(this,e,t,i)||this;return r.element=t,r._transitionController=new vt(!1),r.setTransitionController(r._transitionController),r.menuTransition="slide down",r.menuTransitionDuration=200,r.menuAutoSelectFirst=!1,r.menuSelectedItemClass="selected",r._documentKeyDownListener=e.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),r}return Hr(i,n),Object.defineProperty(i.prototype,"service",{get:function(){return this._service},set:function(t){var n=this;this._service=t;var i=this._service.isOpen;this._service.isOpenChange.subscribe(function(t){t!==i&&(n._transitionController.stopAll(),n._transitionController.animate(new yt(n.menuTransition,n.menuTransitionDuration,e.TransitionDirection.Either,function(){return n._service.isAnimating=!1}))),t||n.selectedItems.length>1&&n.resetSelection(),i=t})},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"items",{set:function(e){this._itemsQueryOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_itemsQuery",{get:function(){return this._itemsQueryOverride||this._itemsQueryInternal},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_items",{get:function(){return this._itemsQuery.filter(function(e){return!e.isDisabled})},enumerable:!0,configurable:!0}),i.prototype.onClick=function(e){if(!e.eventHandled&&(e.eventHandled=!0,this._service.autoCloseMode===jr.ItemClick)){var t=e.target;this.element.nativeElement.contains(t.closest(".item"))&&!/input|textarea/i.test(t.tagName)&&this._service.setOpenState(!1,!0)}},i.prototype.onDocumentKeyDown=function(t){if(this._service.isOpen&&!this._service.isNested){!/input/i.test(t.target.tagName)&&[e.KeyCode.Escape,e.KeyCode.Enter,e.KeyCode.Up,e.KeyCode.Down,e.KeyCode.Left,e.KeyCode.Right].find(function(e){return e===t.keyCode})&&t.preventDefault();var n=this.selectedItems.slice(-1)[0],i=this;if(this.selectedItems.length>=2){var r=this.selectedItems.slice(-2)[0];i=r.childDropdownMenu}switch(t.keyCode){case e.KeyCode.Escape:this._service.setOpenState(!1);break;case e.KeyCode.Down:case e.KeyCode.Up:this.selectedItems.pop(),this.selectedItems.push(i.updateSelection(n,t.keyCode)),t.preventDefault();break;case e.KeyCode.Enter:if(n&&!n.hasChildDropdown){n.performClick();break}case e.KeyCode.Right:n&&n.hasChildDropdown&&(n.childDropdownMenu.service.setOpenState(!0),this.selectedItems.push(n.childDropdownMenu.updateSelection(n,t.keyCode)));break;case e.KeyCode.Left:if(this.selectedItems.length>=2){this.selectedItems.pop();var r=this.selectedItems.slice(-1)[0];r.childDropdownMenu.service.setOpenState(!1),r.isSelected=!0}}}},i.prototype.resetSelection=function(){var e=this;this.selectedItems=[],this._items.forEach(function(t){t.selectedClass=e.menuSelectedItemClass,t.isSelected=!1}),this.menuAutoSelectFirst&&this._items.length>0&&(this._items[0].isSelected=!0,this.scrollToItem(this._items[0]),this.selectedItems.push(this._itemsQuery.first))},i.prototype.updateSelection=function(t,n){t&&(t.isSelected=!1);var i,r=this._items.findIndex(function(e){return e===t});switch(n){case e.KeyCode.Enter:case e.KeyCode.Right:case e.KeyCode.Down:r+=1;break;case e.KeyCode.Up:if(-1===r){r=0;break}r-=1}return i=this._items[r]||t,i&&(i.isSelected=!0,this.scrollToItem(i)),i},i.prototype.scrollToItem=function(e){var t=this.element.nativeElement,n=e.element.nativeElement.getBoundingClientRect(),i=t.getBoundingClientRect(),r=0;n.bottom>i.bottom&&(r=n.bottom-i.bottom),n.top\n\n \x3c!-- Modal component, with transition component attached --\x3e\n \n\n',styles:["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"]}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:Ht}]},n.propDecorators={isClosable:[{type:t.Input}],closeResult:[{type:t.Input}],onApprove:[{type:t.Output,args:["approved"]}],onDeny:[{type:t.Output,args:["denied"]}],onDismiss:[{type:t.Output,args:["dismissed"]}],_modalElement:[{type:t.ViewChild,args:["modal"]}],size:[{type:t.Input}],isFullScreen:[{type:t.Input}],isBasic:[{type:t.Input}],mustScroll:[{type:t.Input}],isInverted:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onDocumentKeyUp:[{type:t.HostListener,args:["document:keyup",["$event"]]}],onDocumentResize:[{type:t.HostListener,args:["window:resize"]}]},n}(),Xr=function(){function e(e){this._componentFactory=e}return e.prototype.open=function(e){var t=this._componentFactory.createComponent(Zr),n=t.instance;if(e instanceof Wr)this._componentFactory.createView(n.templateSibling,e.template,{$implicit:e.context,modal:t.instance.controls});else if(e instanceof qr){var i=this._componentFactory.createComponent(e.component,[{provide:$r,useValue:new $r(n.controls,e.context)}]);this._componentFactory.attachToView(i,n.templateSibling);for(var r=i.location.nativeElement;r.hasChildNodes()&&r.parentElement&&r.firstChild;)r.parentElement.appendChild(r.removeChild(r.firstChild));this._componentFactory.detachFromDocument(i)}return this._componentFactory.attachToApplication(t),n.loadConfig(e),new Br(e,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Ht}]},e}(),eo=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,Lr,wt,rn],declarations:[Zr],exports:[Zr],providers:[Xr],entryComponents:[Zr]}]}],e.ctorParameters=function(){return[]},e}(),to=function(){function e(){this._popupClasses=!0,this.value=0,this.maximum=100,this.precision=0,this._overrideSuccess=!1,this.autoSuccess=!0,this.showProgress=!0,this._popupClasses=!0}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){var t=+e;Number.isNaN(t)||(this._value=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){var t=+e;Number.isNaN(t)||(this._maximum=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"precision",{get:function(){return this._precision},set:function(e){var t=+e;Number.isNaN(t)||(this._precision=Math.min(Math.max(t,0),20))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_reachedMaximum",{get:function(){return this._overrideSuccess||this.value>=this.maximum&&this.autoSuccess},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"percentage",{get:function(){return(Math.min(Math.max(this.value,0),this.maximum)/this.maximum*100).toFixed(this.precision)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classValue",{set:function(e){(e.includes("attached")||e.includes("tiny"))&&(this.showProgress=!1),e.includes("success")&&(this._overrideSuccess=!0)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-progress",template:'\n
\n
{{ percentage }}%
\n
\n
\n \n
\n',styles:["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_popupClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.progress"]}],autoSuccess:[{type:t.Input}],showProgress:[{type:t.Input}],value:[{type:t.Input}],maximum:[{type:t.Input}],precision:[{type:t.Input}],_reachedMaximum:[{type:t.HostBinding,args:["class.success"]}],percentage:[{type:t.HostBinding,args:["attr.data-percent"]}],classValue:[{type:t.Input,args:["class"]}]},e}(),no=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[to],exports:[to]}]}],e.ctorParameters=function(){return[]},e}(),io=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ro=function(){function e(){this.hoveredIndex=-1,this.value=0,this.valueChange=new t.EventEmitter,this.maximum=5,this.isReadonly=!1,this._ratingClasses=!0}return Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(e){this._maximum=+e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icons",{get:function(){return new Array(this.maximum)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){this.isReadonly||(this.value=e+1,this.valueChange.emit(this.value))},e.prototype.onMouseover=function(e){this.hoveredIndex=e},e.prototype.onMouseout=function(){this.hoveredIndex=-1},e.prototype.writeValue=function(e){this.value=e},e.decorators=[{type:t.Component,args:[{selector:"sui-rating",template:'\n\n\n',styles:["\n:host.read-only .icon {\n cursor: auto\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_ratingClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.rating"]}],valueChange:[{type:t.Output}],maximum:[{type:t.Input}],isReadonly:[{type:t.HostBinding,args:["class.read-only"]},{type:t.Input}],onMouseout:[{type:t.HostListener,args:["mouseout"]}]},e}(),oo=function(e){function n(t){return e.call(this,t)||this}return io(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-rating",host:{"(valueChange)":"onChange($event)"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:ro}]},n}(Et),so=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[i.FormsModule,n.CommonModule],declarations:[ro,oo],exports:[ro,oo]}]}],e.ctorParameters=function(){return[]},e}(),ao=function(){function e(e){this.componentFactory=e,this._optionClasses=!0,this.formatter=function(e){return""}}return Object.defineProperty(e.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sui-search-result",template:'\n\n\n'}]}],e.ctorParameters=function(){return[{type:Ht}]},e.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.result"]}],value:[{type:t.Input}],query:[{type:t.Input}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}]},e}(),co=function(){function e(e){void 0===e&&(e=!1);var t=this;this._options=[],this.optionsFilter=function(e,n){var i=t.toRegex(t._query);return i instanceof RegExp&&e.filter(function(e){return jt.Object.readValue(e,t._optionsField).toString().match(i)})},this.allowEmptyQuery=e,this._query="",this.resetQueryOnChange=!0,this.searchDelay=0,this.reset()}return Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e||[],this._optionsLookup=void 0,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{get:function(){return this._optionsLookup},set:function(e){this._optionsLookup=e,this._options=[],this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasItemLookup",{get:function(){return!!this.optionsLookup&&2===this.optionsLookup.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{get:function(){return this._optionsField},set:function(e){this._optionsField=e,this.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this._results},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this._isSearching},enumerable:!0,configurable:!0}),e.prototype.updateQueryDelayed=function(e,t){var n=this;void 0===t&&(t=function(){}),this._query=e,clearTimeout(this._searchDelayTimeout),this._searchDelayTimeout=window.setTimeout(function(){n.updateQuery(e,t)},this.searchDelay)},e.prototype.updateQuery=function(e,t){var n=this;if(void 0===t&&(t=function(){}),this._query=e,""===this._query&&!this.allowEmptyQuery)return t();if(this._resultsCache.hasOwnProperty(this._query))return this._results=this._resultsCache[this._query],t();if(this._optionsLookup){this._isSearching=!0;return void this._optionsLookup.call(void 0,this._query).then(function(e){return n._isSearching=!1,n.updateResults(e),t()}).catch(function(e){return n._isSearching=!1,t(e)})}var i=this.optionsFilter.call(void 0,this._options,this._query);return i&&this.updateResults(i),t()},e.prototype.updateResults=function(e){this._resultsCache[this._query]=e,this._results=e},e.prototype.initialLookup=function(e){return Array,this._optionsLookup(void 0,e)},e.prototype.toRegex=function(e){try{return new RegExp(e,"i")}catch(t){return e}},e.prototype.highlightMatches=function(e,t){var n=this.toRegex(t);return n instanceof RegExp?e.replace(n,function(e){return""+e+""}):e},e.prototype.reset=function(){this._results=[],this._resultsCache={},this._isSearching=!1,this.resetQueryOnChange||!this.query?this.updateQuery(""):this.updateQuery(this.query)},e}(),uo=function(){function e(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._searchClasses=!0,this.hasIcon=!0,this.allowEmptyQuery=!1,this.resetQueryOnChange=!0,this.retainSelectedResult=!0,this.searchDelay=200,this.maxResults=7,this.onResultSelected=new t.EventEmitter,this.transition="scale",this.transitionDuration=200,this._documentClickListener=n.listen("document","click",function(e){return r.onDocumentClick(e)})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resetQueryOnChange",{set:function(e){this.searchService.resetQueryOnChange=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowEmptyQuery",{get:function(){return this._allowEmptyQuery},set:function(e){this._allowEmptyQuery=e,this.searchService.allowEmptyQuery=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this.searchService.query},set:function(e){this.selectedResult=void 0,this.searchService.updateQueryDelayed(e,function(){})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{set:function(e){e&&(this.searchService.options=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsLookup",{set:function(e){this.searchService.optionsLookup=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsField",{set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resultFormatter",{get:function(){var e=this;return this._resultFormatter?this._resultFormatter:this.searchService.optionsLookup?function(t){return e.readValue(t)}:function(t,n){return e.searchService.highlightMatches(e.readValue(t),n)}},set:function(e){this._resultFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"searchDelay",{set:function(e){this.searchService.searchDelay=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"results",{get:function(){return this.searchService.results.slice(0,this.maxResults)},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this._menu.service=this.dropdownService},e.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().search},e.prototype.select=function(e){this.onResultSelected.emit(e),this.dropdownService.setOpenState(!1),this.retainSelectedResult?(this.selectedResult=e,this.searchService.updateQuery(this.readValue(e))):this.searchService.updateQuery("")},e.prototype.onClick=function(e){this.open()},e.prototype.onFocusIn=function(){this.dropdownService.isAnimating||this.open()},e.prototype.open=function(){(this.searchService.query.length>0||this.allowEmptyQuery)&&this.dropdownService.setOpenState(!0)},e.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||this.dropdownService.setOpenState(!1)},e.prototype.onDocumentClick=function(e){this._element.nativeElement.contains(e.target)||this.dropdownService.setOpenState(!1)},e.prototype.readValue=function(e){return jt.Object.readValue(e,this.searchService.optionsField)},e.prototype.ngOnDestroy=function(){this._documentClickListener()},e.decorators=[{type:t.Component,args:[{selector:"sui-search",template:'\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n',styles:["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},e.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_searchClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.search"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],hasIcon:[{type:t.Input}],resetQueryOnChange:[{type:t.Input}],allowEmptyQuery:[{type:t.Input}],placeholder:[{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],optionsField:[{type:t.Input}],resultFormatter:[{type:t.Input}],resultTemplate:[{type:t.Input}],retainSelectedResult:[{type:t.Input}],searchDelay:[{type:t.Input}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],maxResults:[{type:t.Input}],onResultSelected:[{type:t.Output,args:["resultSelected"]}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}]},e}(),po=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,gt,rn],declarations:[uo,ao],exports:[uo]}]}],e.ctorParameters=function(){return[]},e}(),lo=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ho=function(e){function n(n,i,r){var o=e.call(this,n,i)||this;return o.changeDetector=r,o._optionClasses=!0,o.isActive=!1,o.onSelected=new t.EventEmitter,o.renderedText="",o.usesTemplate=!1,o}return lo(n,e),Object.defineProperty(n.prototype,"formatter",{set:function(e){this.usesTemplate?this.renderedText="":this.renderedText=e(this.value)},enumerable:!0,configurable:!0}),n.prototype.onClick=function(e){var t=this;e.eventHandled=!0,setTimeout(function(){return t.onSelected.emit(t.value)})},n.decorators=[{type:t.Component,args:[{selector:"sui-select-option",template:'\n\n\n'}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},n.propDecorators={_optionClasses:[{type:t.HostBinding,args:["class.item"]}],value:[{type:t.Input}],onSelected:[{type:t.Output}],isActive:[{type:t.HostBinding,args:["class.active"]}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},n}(Rr),fo=function(){function e(e,n){this._renderer=e,this._element=n,this.onQueryUpdated=new t.EventEmitter,this.onQueryKeyDown=new t.EventEmitter,this._searchClass=!0,this._autoComplete="off"}return Object.defineProperty(e.prototype,"query",{set:function(e){this._renderer.setProperty(this._element.nativeElement,"value",e)},enumerable:!0,configurable:!0}),e.prototype.updateQuery=function(e){this.onQueryUpdated.emit(e)},e.prototype.onKeyDown=function(e){this.onQueryKeyDown.emit(e)},e.prototype.focus=function(){var e=this;this._element.nativeElement.focus(),setTimeout(function(){return e._element.nativeElement.focus()})},e.decorators=[{type:t.Directive,args:[{selector:"input[suiSelectSearch]"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_searchClass:[{type:t.HostBinding,args:["class.search"]}],_autoComplete:[{type:t.HostBinding,args:["attr.autocomplete"]}],updateQuery:[{type:t.HostListener,args:["input",["$event.target.value"]]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}(),mo=function(){function n(e,n,i){var r=this;this._element=e,this._localizationService=i,this.dropdownService=new Vr,this.searchService=new co(!0),this.isSearchable=!1,this.onLocaleUpdate(),this._localizationService.onLanguageUpdate.subscribe(function(){return r.onLocaleUpdate()}),this._renderedSubscriptions=[],this.icon="dropdown",this.transition="slide down",this.transitionDuration=200,this.onTouched=new t.EventEmitter,this._documentKeyDownListener=n.listen("document","keydown",function(e){return r.onDocumentKeyDown(e)}),this._selectClasses=!0}return Object.defineProperty(n.prototype,"isActive",{get:function(){return this.dropdownService.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isVisible",{get:function(){return this._menu.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_searchClass",{get:function(){return this.isSearchable&&!this.isSearchExternal},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isSearching",{get:function(){return this.searchService.isSearching},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"searchInput",{get:function(){return this._manualSearch||this._internalSearch},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tabIndex",{get:function(){return this.isDisabled?-1:this.dropdownService.isOpen&&this.isSearchExternal?-1:void 0!=this._tabIndex?this._tabIndex:this._searchClass?-1:0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isDisabled",{get:function(){return this.dropdownService.isDisabled},set:function(e){this.dropdownService.isDisabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"options",{set:function(e){e&&(this.searchService.options=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsFilter",{set:function(e){e&&(this.searchService.optionsFilter=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionsLookup",{set:function(e){e&&(this.searchService.optionsLookup=e,this.optionsUpdateHook())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"filteredOptions",{get:function(){return this.searchService.results},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"query",{get:function(){return this.isSearchable?this.searchService.query:void 0},set:function(e){var t=this;void 0!=e&&(this.queryUpdateHook(),this.updateQuery(e),this._renderedOptions.forEach(function(e){return t.initialiseRenderedOption(e)}),this.searchInput&&(this.searchInput.query=e))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelField",{get:function(){return this.searchService.optionsField},set:function(e){this.searchService.optionsField=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"labelGetter",{get:function(){var e=this;return function(t){var n=jt.Object.readValue(t,e.labelField);return void 0!=n?n.toString():""}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valueGetter",{get:function(){var e=this;return function(t){return jt.Object.readValue(t,e.valueField)}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"configuredFormatter",{get:function(){var e=this;return this._optionFormatter?function(t){return e._optionFormatter(t,e.isSearchable?e.query:void 0)}:this.searchService.optionsLookup?function(t){return e.labelGetter(t)}:function(t){return e.searchService.highlightMatches(e.labelGetter(t),e.query||"")}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionFormatter",{set:function(e){this._optionFormatter=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"localeValues",{get:function(){return this._localizationService.override(this._localeValues,this.localeOverrides)},enumerable:!0,configurable:!0}),n.prototype.ngAfterContentInit=function(){var e=this;this._menu.service=this.dropdownService,this._menu.items=this._renderedOptions,this._manualSearch&&(this.isSearchable=!0,this.isSearchExternal=!0),this.searchInput&&(this.searchInput.onQueryUpdated.subscribe(function(t){return e.query=t}),this.searchInput.onQueryKeyDown.subscribe(function(t){return e.onQueryInputKeydown(t)})),this.onAvailableOptionsRendered(),this._renderedOptions.changes.subscribe(function(){return e.onAvailableOptionsRendered()})},n.prototype.onLocaleUpdate=function(){this._localeValues=this._localizationService.get().select},n.prototype.optionsUpdateHook=function(){},n.prototype.queryUpdateHook=function(){},n.prototype.updateQuery=function(e){var t=this;this.searchService.updateQuery(e,function(){return t.dropdownService.setOpenState(!0)})},n.prototype.resetQuery=function(e){void 0===e&&(e=!0),e?(this.searchService.searchDelay=this._menu.menuTransitionDuration,this.searchService.updateQueryDelayed("")):this.searchService.updateQuery(""),this.searchInput&&(this.searchInput.query="")},n.prototype.onAvailableOptionsRendered=function(){var e=this;this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._renderedSubscriptions=[],this._renderedOptions.forEach(function(t){setTimeout(function(){return e.initialiseRenderedOption(t)}),e._renderedSubscriptions.push(t.onSelected.subscribe(function(){return e.selectOption(t.value)}))}),0!==this.searchService.options.length||this.searchService.optionsLookup||(this.options=this._renderedOptions.map(function(e){return e.value}))},n.prototype.initialiseRenderedOption=function(e){e.usesTemplate=!!this.optionTemplate,e.formatter=this.configuredFormatter,e.usesTemplate&&this.drawTemplate(e.templateSibling,e.value),e.changeDetector.markForCheck()},n.prototype.findOption=function(e,t){var n=this;return e.find(function(e){return t===n.valueGetter(e)})},n.prototype.onCaretClick=function(e){e.eventHandled||(e.eventHandled=!0,this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!this.dropdownService.isOpen),this.focus()))},n.prototype.onClick=function(e){e.eventHandled||this.dropdownService.isAnimating||(e.eventHandled=!0,this.dropdownService.setOpenState(!!this.isSearchable||!this.dropdownService.isOpen),this.focus())},n.prototype.onFocusIn=function(){this.dropdownService.isOpen||this.dropdownService.isAnimating||(this.dropdownService.setOpenState(!0),this.focus())},n.prototype.onFocusOut=function(e){this._element.nativeElement.contains(e.relatedTarget)||(this.dropdownService.setOpenState(!1),this.onTouched.emit())},n.prototype.onKeyPress=function(t){t.keyCode===e.KeyCode.Enter&&this._element.nativeElement.click()},n.prototype.onDocumentKeyDown=function(t){this._element.nativeElement.contains(t.target)&&!this.dropdownService.isOpen&&t.keyCode===e.KeyCode.Down&&(this._element.nativeElement.click(),t.preventDefault())},n.prototype.onQueryInputKeydown=function(e){},n.prototype.focus=function(){this.isSearchable&&this.searchInput?this.searchInput.focus():this._element.nativeElement.focus()},n.prototype.drawTemplate=function(e,t){e.clear(),e.createEmbeddedView(this.optionTemplate,{$implicit:t,query:this.query})},n.prototype.ngOnDestroy=function(){this._renderedSubscriptions.forEach(function(e){return e.unsubscribe()}),this._documentKeyDownListener()},n.propDecorators={_menu:[{type:t.ViewChild,args:[Ar]}],_renderedOptions:[{type:t.ContentChildren,args:[ho,{descendants:!0}]}],_selectClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.dropdown"]}],isActive:[{type:t.HostBinding,args:["class.active"]}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isSearchable:[{type:t.Input}],_searchClass:[{type:t.HostBinding,args:["class.search"]}],isSearching:[{type:t.HostBinding,args:["class.loading"]}],_internalSearch:[{type:t.ViewChild,args:[fo]}],_manualSearch:[{type:t.ContentChild,args:[fo]}],_tabIndex:[{type:t.Input,args:["tabindex"]}],tabIndex:[{type:t.HostBinding,args:["attr.tabindex"]}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],options:[{type:t.Input}],optionsFilter:[{type:t.Input}],optionsLookup:[{type:t.Input}],labelField:[{type:t.Input}],valueField:[{type:t.Input}],optionTemplate:[{type:t.Input}],optionFormatter:[{type:t.Input}],icon:[{type:t.Input}],transition:[{type:t.Input}],transitionDuration:[{type:t.Input}],onTouched:[{type:t.Output,args:["touched"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}],onFocusIn:[{type:t.HostListener,args:["focusin"]}],onFocusOut:[{type:t.HostListener,args:["focusout",["$event"]]}],onKeyPress:[{type:t.HostListener,args:["keypress",["$event"]]}]},n}(),go=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),yo=function(n){function i(i,r,o,s){var a=n.call(this,i,r,o)||this;return a.componentFactory=s,a._transitionController=new vt(!1,"inline-block"),a.setTransitionController(a._transitionController),a.onDeselected=new t.EventEmitter,a._labelClasses=!0,a._transitionController.animate(new yt("scale",100,e.TransitionDirection.In)),a}return go(i,n),Object.defineProperty(i.prototype,"template",{get:function(){return this._template},set:function(e){this._template=e,this.template&&this.componentFactory.createView(this.templateSibling,this.template,{$implicit:this.value,query:this.query})},enumerable:!0,configurable:!0}),i.prototype.deselectOption=function(t){var n=this;t.eventHandled=!0,this._transitionController.animate(new yt("scale",100,e.TransitionDirection.Out,function(){return n.onDeselected.emit(n.value)}))},i.prototype.onClick=function(e){e.eventHandled=!0},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select-label",template:'\n\n\n\n'}]}],i.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:Ht}]},i.propDecorators={_labelClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.label"]}],value:[{type:t.Input}],query:[{type:t.Input}],onDeselected:[{type:t.Output,args:["deselected"]}],formatter:[{type:t.Input}],template:[{type:t.Input}],templateSibling:[{type:t.ViewChild,args:["templateSibling",{read:t.ViewContainerRef}]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},i}(bt),vo=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bo=function(n){function i(e,i,r){var o=n.call(this,e,i,r)||this;return o.selectedOptions=[],o.selectedOptionsChange=new t.EventEmitter,o.hasLabels=!0,o._multiSelectClasses=!0,o}return vo(i,n),Object.defineProperty(i.prototype,"filteredOptions",{get:function(){var e=this;if(this.maxSelectedReached)return[];var t=this.searchService.results;return this.hasLabels?t.filter(function(t){return void 0==e.selectedOptions.find(function(e){return t===e})}):t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"availableOptions",{get:function(){return this.filteredOptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasLabels",{ -get:function(){return this._hasLabels},set:function(e){this._hasLabels=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.multi.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxSelectedReached",{get:function(){return void 0!=this.maxSelected&&this.selectedOptions.length===this.maxSelected},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxSelectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.maxSelectedMessage,[["max",this.maxSelected.toString()]])},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectedMessage",{get:function(){return this._localizationService.interpolate(this.localeValues.multi.selectedMessage,[["count",this.selectedOptions.length.toString()]])},enumerable:!0,configurable:!0}),i.prototype.optionsUpdateHook=function(){var e=this;!this._writtenOptions&&this.selectedOptions.length>0&&this.writeValue(this.selectedOptions.map(function(t){return e.valueGetter(t)})),this._writtenOptions&&this.searchService.options.length>0&&(this.selectedOptions=this._writtenOptions.map(function(t){return e.findOption(e.searchService.options,t)}).filter(function(e){return void 0!=e}),this.selectedOptions.length===this._writtenOptions.length&&(this._writtenOptions=void 0))},i.prototype.initialiseRenderedOption=function(e){n.prototype.initialiseRenderedOption.call(this,e),e.isActive=!this.hasLabels&&-1!==this.selectedOptions.indexOf(e.value)},i.prototype.selectOption=function(e){var t=this;if(-1!==this.selectedOptions.indexOf(e))return void this.deselectOption(e);this.selectedOptions.push(e),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.resetQuery(!1),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.writeValue=function(e){var t=this;e instanceof Array?(this.searchService.options.length>0&&(this.selectedOptions=e.map(function(e){return t.findOption(t.searchService.options,e)}).filter(function(e){return void 0!=e})),e.length>0&&0===this.selectedOptions.length&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){return t.selectedOptions=e}):this._writtenOptions=e),0===e.length&&(this.selectedOptions=[])):this.selectedOptions=[]},i.prototype.deselectOption=function(e){var t=this;this.selectedOptions=this.selectedOptions.filter(function(t){return t!==e}),this.selectedOptionsChange.emit(this.selectedOptions.map(function(e){return t.valueGetter(e)})),this.focus(),this.hasLabels||this.onAvailableOptionsRendered()},i.prototype.onQueryInputKeydown=function(t){t.keyCode===e.KeyCode.Backspace&&""===this.query&&this.selectedOptions.length>0&&this.deselectOption(this.selectedOptions[this.selectedOptions.length-1])},i.decorators=[{type:t.Component,args:[{selector:"sui-multi-select",template:'\n\x3c!-- Dropdown icon --\x3e\n\n\n\n\x3c!-- Multi-select labels --\x3e\n \n\n\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Helper text --\x3e\n
\n \n \x3c!-- Placeholder text --\x3e\n {{ placeholder }}\n \n \x3c!-- Summary shown when labels are hidden --\x3e\n {{ selectedMessage }}\n
\n\n\x3c!-- Select dropdown menu --\x3e\n\n',styles:["\n:host input.search {\n width: 12em !important;\n}\n"]}]}],i.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},i.propDecorators={selectedOptionsChange:[{type:t.Output}],hasLabels:[{type:t.Input}],placeholder:[{type:t.Input}],maxSelected:[{type:t.Input}],_multiSelectClasses:[{type:t.HostBinding,args:["class.multiple"]}]},i}(mo),wo=function(e){function n(t){return e.call(this,t)||this}return vo(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-multi-select",host:{"(selectedOptionsChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:bo}]},n}(Et),_o=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Do=function(e){function n(n,i,r){var o=e.call(this,n,i,r)||this;return o.selectedOptionChange=new t.EventEmitter,o}return _o(n,e),Object.defineProperty(n.prototype,"placeholder",{get:function(){return this._placeholder||this.localeValues.single.placeholder},set:function(e){this._placeholder=e},enumerable:!0,configurable:!0}),n.prototype.optionsUpdateHook=function(){!this._writtenOption&&this.selectedOption&&this.writeValue(this.valueGetter(this.selectedOption)),this._writtenOption&&this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,this._writtenOption),this.selectedOption&&(this._writtenOption=void 0,this.drawSelectedOption()))},n.prototype.queryUpdateHook=function(){this.selectedOption=void 0},n.prototype.selectOption=function(e){this.selectedOption=e,this.selectedOptionChange.emit(this.valueGetter(e)),this.dropdownService.setOpenState(!1),this.resetQuery(),this.drawSelectedOption(),this.focus()},n.prototype.writeValue=function(e){var t=this;void 0!=e?(this.searchService.options.length>0&&(this.selectedOption=this.findOption(this.searchService.options,e),this.drawSelectedOption()),void 0==this.selectedOption&&(this.valueField&&this.searchService.hasItemLookup?this.searchService.initialLookup(e).then(function(e){t.selectedOption=e,t.drawSelectedOption()}):this._writtenOption=e)):(this.selectedOption=void 0,this.drawSelectedOption())},n.prototype.initialiseRenderedOption=function(t){e.prototype.initialiseRenderedOption.call(this,t),t.isActive=t.value===this.selectedOption},n.prototype.drawSelectedOption=function(){this._renderedOptions&&this.onAvailableOptionsRendered(),void 0!=this.selectedOption&&this.optionTemplate&&this.drawTemplate(this._optionTemplateSibling,this.selectedOption)},n.decorators=[{type:t.Component,args:[{selector:"sui-select",template:'\n\x3c!-- Query input --\x3e\n\n\n\x3c!-- Placeholder text --\x3e\n
{{ placeholder }}
\n\x3c!-- Selected item --\x3e\n
\n \n \n
\n\x3c!-- Dropdown icon --\x3e\n\n\x3c!-- Select dropdown menu --\x3e\n\n'}]}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:mt}]},n.propDecorators={_optionTemplateSibling:[{type:t.ViewChild,args:["optionTemplateSibling",{read:t.ViewContainerRef}]}],selectedOptionChange:[{type:t.Output}],placeholder:[{type:t.Input}]},n}(mo),Oo=function(e){function n(t){return e.call(this,t)||this}return _o(n,e),n.decorators=[{type:t.Directive,args:[{selector:"sui-select",host:{"(selectedOptionChange)":"onChange($event)","(touched)":"onTouched()"},providers:[c(n)]}]}],n.ctorParameters=function(){return[{type:Do}]},n}(Et),Co=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Yr,rn,gt],declarations:[Do,ho,fo,Oo,bo,yo,wo],exports:[Do,ho,fo,Oo,bo,wo]}]}],e.ctorParameters=function(){return[]},e}(),So={Overlay:"overlay",Push:"push",ScaleDown:"scale down",Uncover:"uncover",SlideAlong:"slide along",SlideOut:"slide out"},Mo={Left:"left",Right:"right",Top:"top",Bottom:"bottom"},To=function(){function e(e){void 0===e&&(e=!1),this.isVisible=e,this.isAnimating=!1,this.wasJustOpened=!1,this.isVisibleChange=new t.EventEmitter,this.widthChange=new t.EventEmitter,this.heightChange=new t.EventEmitter,this.width=260,this.height=0,this.transition=So.Uncover}return Object.defineProperty(e.prototype,"width",{get:function(){return this.direction===Mo.Left?this._width:this.direction===Mo.Right?-this._width:0},set:function(e){this._width=e,this.widthChange.emit()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.direction===Mo.Top?this._height:this.direction===Mo.Bottom?-this._height:0},set:function(e){this._height=e,this.heightChange.emit()},enumerable:!0,configurable:!0}),e.prototype.setVisibleState=function(e){var t=this;this.isVisible!==e&&(this.isVisible=e,this.isAnimating=!0,this.wasJustOpened=!0,this.isVisibleChange.emit(e),setTimeout(function(){return t.wasJustOpened=!1}),clearTimeout(this._isAnimatingTimeout),this._isAnimatingTimeout=window.setTimeout(function(){return t.isAnimating=!1},500))},e.prototype.toggleVisibleState=function(){this.setVisibleState(!this.isVisible)},e}(),ko=function(){function e(e,t){var n=this;this._renderer=e,this._element=t,this.service=new To,this.transition=So.Uncover,this.direction=Mo.Left,setTimeout(function(){return n.updateDimensions()}),this.service.isVisibleChange.subscribe(function(){return n.updateDimensions()}),this._sidebarClasses=!0}return Object.defineProperty(e.prototype,"transition",{get:function(){return this.service.transition},set:function(e){var t=this;this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!1)}),this.service.transition=e,this.service.transition.split(" ").forEach(function(e){return t.setClass(e,!0)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"direction",{get:function(){return this.service.direction},set:function(e){this.setClass(this.service.direction,!1),this.service.direction=e,this.setClass(this.service.direction,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.service.isVisible},set:function(e){this.service.setVisibleState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisibleChange",{get:function(){return this.service.isVisibleChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAnimating",{get:function(){return this.service.isAnimating},enumerable:!0,configurable:!0}),e.prototype.updateDimensions=function(){this.service.width=this._element.nativeElement.offsetWidth,this.service.height=this._element.nativeElement.offsetHeight},e.prototype.setClass=function(e,t){void 0===t&&(t=!0),t?this._renderer.addClass(this._element.nativeElement,e):this._renderer.removeClass(this._element.nativeElement,e)},e.prototype.open=function(){this.service.setVisibleState(!0)},e.prototype.close=function(){this.service.setVisibleState(!1)},e.prototype.toggle=function(){this.service.toggleVisibleState()},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar",template:""}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={_sidebarClasses:[{type:t.HostBinding,args:["class.ui"]},{type:t.HostBinding,args:["class.sidebar"]},{type:t.HostBinding,args:["class.menu"]}],transition:[{type:t.Input}],direction:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]},{type:t.Input}],isVisibleChange:[{type:t.Output}],isAnimating:[{type:t.HostBinding,args:["class.animating"]}]},e}(),Po=function(){function e(e,t){this._renderer=e,this._element=t,this.isDimmedWhenVisible=!1,this._siblingClasses=!0}return Object.defineProperty(e.prototype,"service",{get:function(){return this._service},set:function(e){var t=this;this._service=e,setTimeout(function(){return t.updateTransform()}),this._service.isVisibleChange.subscribe(function(){return t.updateTransform()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return!!this.service&&this.service.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDimmed",{get:function(){return!!this.service&&(this.service.isVisible&&this.isDimmedWhenVisible)},enumerable:!0,configurable:!0}),e.prototype.updateTransform=function(){if(this._renderer.removeStyle(this._element.nativeElement,"transform"),this._renderer.removeStyle(this._element.nativeElement,"-webkit-transform"),this.service.isVisible&&this.service.transition!==So.Overlay&&this.service.transition!==So.ScaleDown){var e="translate3d("+this.service.width+"px, "+this.service.height+"px, 0)";this._renderer.setStyle(this._element.nativeElement,"transform",e),this._renderer.setStyle(this._element.nativeElement,"-webkit-transform",e)}},e.prototype.onClick=function(e){this.service.isVisible&&!this.service.wasJustOpened&&this.service.setVisibleState(!1)},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-sibling",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={isDimmedWhenVisible:[{type:t.Input}],isVisible:[{type:t.HostBinding,args:["class.visible"]}],isDimmed:[{type:t.HostBinding,args:["class.dimmed"]}],_siblingClasses:[{type:t.HostBinding,args:["class.pusher"]}],onClick:[{type:t.HostListener,args:["click",["$event"]]}]},e}(),xo=function(){function e(){this._containerClasses=!0}return e.prototype.ngAfterContentInit=function(){if(!this.sidebar)throw new Error("You must include a element within the container.");if(this.service=this.sidebar.service,!this.sibling)throw new Error("You must include a element within the container.");this.sibling.service=this.service},e.decorators=[{type:t.Component,args:[{selector:"sui-sidebar-container",template:"",styles:["\n:host {\n display: block;\n}\n"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={_containerClasses:[{type:t.HostBinding,args:["class.pushable"]}],sidebar:[{type:t.ContentChild,args:[ko]}],sibling:[{type:t.ContentChild,args:[Po]}]},e}(),Io=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[ko,xo,Po],exports:[ko,xo,Po]}]}],e.ctorParameters=function(){return[]},e}(),Eo=function(){function e(e,t){var n=this;this.id=e.id,this.header=e,this.content=t,this.header.isActiveChange.subscribe(function(){return n.content.isActive=n.isActive})}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this.header.isActive},set:function(e){this.header.setActiveState(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.header.isDisabled},enumerable:!0,configurable:!0}),e}(),Lo=function(){function e(){this._isActive=!1,this.isActiveChange=new t.EventEmitter,this.isActiveExternalChange=new t.EventEmitter,this.onActivate=new t.EventEmitter,this.onDeactivate=new t.EventEmitter,this.isDisabled=!1,this._headerClasses=!0}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},set:function(e){var t=this,n=e;setTimeout(function(){n=!t.isDisabled&&e,t.setActiveState(n),t.isActiveExternalChange.emit(n)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(e){this._isDisabled!==e&&(this._isDisabled=e,this.isDisabled&&(this.isActive=!1))},enumerable:!0,configurable:!0}),e.prototype.setActiveState=function(e){!!this._isActive!==e&&(this._isActive=e,e?this.onActivate.emit():this.onDeactivate.emit()),this.isActiveChange.emit(e)},e.prototype.onClick=function(){this.isDisabled||(this.isActive=!0)},e.decorators=[{type:t.Directive,args:[{selector:"[suiTabHeader]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_headerClasses:[{type:t.HostBinding,args:["class.item"]}],id:[{type:t.Input,args:["suiTabHeader"]}],isActiveChange:[{type:t.Output}],onActivate:[{type:t.Output,args:["activate"]}],onDeactivate:[{type:t.Output,args:["deactivate"]}],isActive:[{type:t.HostBinding,args:["class.active"]},{type:t.Input}],isDisabled:[{type:t.HostBinding,args:["class.disabled"]},{type:t.Input}],onClick:[{type:t.HostListener,args:["click"]}]},e}(),jo=function(){function e(){this.isActive=!1,this._contentClasses=!0}return e.decorators=[{type:t.Directive,args:[{selector:"[suiTabContent]"}]}],e.ctorParameters=function(){return[]},e.propDecorators={_contentClasses:[{type:t.HostBinding,args:["class.tab"]}],id:[{type:t.Input,args:["suiTabContent"]}],isActive:[{type:t.HostBinding,args:["class.active"]}]},e}(),Vo=function(){function e(){this.tabs=[],this._barrierCount=0}return Object.defineProperty(e.prototype,"activeTab",{get:function(){return this._activeTab},set:function(e){this._activeTab=e,e.isActive=!0},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this._tabHeaders.changes.subscribe(function(){return e.internalComponentsUpdated()}),this._tabContents.changes.subscribe(function(){return e.internalComponentsUpdated()}),this.loadTabs()},e.prototype.internalComponentsUpdated=function(){2===++this._barrierCount&&(this._barrierCount=0,this.loadTabs())},e.prototype.loadTabs=function(){var e=this;if(this.tabs=this.tabs.filter(function(t){return!!e._tabHeaders.find(function(e){return e===t.header})}),this._tabHeaders.filter(function(t){return!e.tabs.find(function(e){return e.header===t})}).forEach(function(t){var n=e._tabContents.find(function(e){return e.id===t.id});if(!n)throw new Error("A [suiTabHeader] must have a related [suiTabContent].");var i=new Eo(t,n);i.header.isActiveExternalChange.subscribe(function(){return e.onHeaderActiveChanged(i)}),e.tabs.push(i)}),this._tabHeaders.forEach(function(t,n){var i=e.tabs.find(function(e){return e.header===t});i&&(i.index=n)}),this.tabs.sort(function(e,t){return e.index-t.index}),this.activeTab?this.tabs.find(function(t){return t===e.activeTab})||setTimeout(function(){return e.activateClosestTab(e.activeTab)}):this.activateFirstTab(),0===this.tabs.length)throw new Error("You cannot have no tabs!")},e.prototype.onHeaderActiveChanged=function(e){e.isActive&&this.activeTab!==e&&(this.tabs.filter(function(t){return t!==e}).forEach(function(e){return e.isActive=!1}),this.activeTab=e),e.isActive||this.activeTab!==e||this.activateClosestTab(e)},e.prototype.activateFirstTab=function(){this.activeTab=this.tabs[0]},e.prototype.activateClosestTab=function(e){var t;if(e.index>=this.tabs.length&&(t=this.tabs[this.tabs.length-1]),t||(t=this.tabs.find(function(t){return t===e})?this.tabs[Math.max(e.index-1,0)]:this.tabs[e.index]),t.isDisabled)return this.activateClosestTab(t);this.activeTab=t},e.decorators=[{type:t.Component,args:[{selector:"sui-tabset",template:""}]}],e.ctorParameters=function(){return[]},e.propDecorators={_tabHeaders:[{type:t.ContentChildren,args:[Lo]}],_tabContents:[{type:t.ContentChildren,args:[jo]}]},e}(),Ho=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[Vo,Lo,jo],exports:[Vo,Lo,jo]}]}],e.ctorParameters=function(){return[]},e}(),Ro=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{exports:[Dt,Ct,xt,hn,Pt,xr,Lr,Yr,eo,er,no,so,po,Co,Io,Ho,wt,gt,rn]}]}],e.ctorParameters=function(){return[]},e}();e.SuiLocalizationService=mt,e.SuiLocalizationModule=gt,e.SuiMessage=_t,e.SuiMessageModule=Dt,e.SuiPagination=Ot,e.SuiPaginationModule=Ct,e.SuiAccordionPanel=St,e.SuiAccordion=Tt,e.SuiAccordionService=Mt,e.SuiAccordionModule=xt,e.SuiCheckbox=sn,e.SuiCheckboxValueAccessor=an,e.SuiRadio=un,e.SuiRadioValueAccessor=pn,e.SuiRadioManager=ln,e.SuiCheckboxModule=hn,e.SuiCollapse=kt,e.SuiCollapseModule=Pt,e.CalendarConfig=Sn,e.DateConfigBase=Mn,e.YearConfig=Tn,e.MonthConfig=kn,e.DateConfig=Pn,e.DatetimeConfig=xn,e.TimeConfig=In,e.CalendarMappings=vn,e.DateMappings=bn,e.TimeMappings=wn,e.DatetimeMappings=_n,e.MonthMappings=Dn,e.YearMappings=On,e.DateComparer=En,e.DateParser=Li,e.InternalDateParser=ji,e.SuiCalendarViewTitle=Ri,e.DatepickerMode=Ai,e.SuiDatepicker=Fi,e.CalendarItem=fn,e.SuiCalendarItem=mn,e.SuiDatepickerDirective=nr,e.SuiDatepickerDirectiveValueAccessor=ir,e.SuiDatepickerDirectiveValidator=rr,e.SuiDatepickerInputDirective=fr,e.DateFnsParser=Ii,e.CalendarRange=Vi,e.CalendarRangeService=Hi,e.CalendarService=dn,e.CalendarView=gn,e.CalendarRangeDateService=gr,e.SuiCalendarDateView=yr,e.CalendarRangeHourService=br,e.SuiCalendarHourView=wr,e.CalendarRangeMinuteService=Dr,e.SuiCalendarMinuteView=Or,e.CalendarRangeMonthService=Sr,e.SuiCalendarMonthView=Mr,e.CalendarRangeYearService=kr,e.SuiCalendarYearView=Pr,e.SuiDatepickerModule=xr,e.SuiDimmer=Er,e.SuiDimmerModule=Lr,e.SuiDropdownMenuItem=Rr,e.SuiDropdownMenu=Ar,e.SuiDropdown=Fr,e.DropdownAutoCloseType=jr,e.DropdownService=Vr,e.SuiDropdownModule=Yr,e.ActiveModal=Br,e.ModalSize=Ur,e.ModalConfig=zr,e.TemplateModalConfig=Wr,e.ComponentModalConfig=qr,e.ModalControls=Kr,e.Modal=$r,e.ModalTemplate=Jr,e.SuiModal=Zr,e.SuiModalService=Xr,e.SuiModalModule=eo,e.SuiPopupComponentController=Wi,e.PopupTrigger=Yi,e.PopupConfig=Bi,e.SuiPopupController=Ui,e.TemplatePopupConfig=Qi,e.SuiPopupTemplateController=Ki,e.SuiPopupArrow=$i,e.SuiPopup=Ni,e.SuiPopupDirective=Xi,e.SuiPopupConfig=Ji,e.SuiPopupModule=er,e.SuiProgress=to,e.SuiProgressModule=no,e.SuiRating=ro,e.SuiRatingValueAccessor=oo,e.SuiRatingModule=so,e.SuiSearchResult=ao,e.SuiSearch=uo,e.SearchService=co,e.SuiSearchModule=po,e.SuiSelectBase=mo,e.SuiMultiSelectLabel=yo,e.SuiMultiSelect=bo,e.SuiMultiSelectValueAccessor=wo,e.SuiSelectOption=ho,e.SuiSelect=Do,e.SuiSelectValueAccessor=Oo,e.SuiSelectSearch=fo,e.SuiSelectModule=Co,e.SuiSidebarContainer=xo,e.SuiSidebarSibling=Po,e.SuiSidebar=ko,e.SidebarTransition=So,e.SidebarDirection=Mo,e.SidebarService=To,e.SuiSidebarModule=Io,e.Tab=Eo,e.SuiTabset=Vo,e.SuiTabContent=jo,e.SuiTabHeader=Lo,e.SuiTabsModule=Ho,e.TransitionController=vt,e.Transition=yt,e.SuiTransition=bt,e.SuiTransitionModule=wt,e.CustomValidator=It,e.customValidatorFactory=a,e.CustomValueAccessor=Et,e.customValueAccessorFactory=c,e.DateUtil=Vt,e.HandledEvent=Lt,e.Util=jt,e.SuiComponentFactory=Ht,e.PositioningPlacement=tn,e.PositioningService=nn,e.SuiUtilityModule=rn,e.SuiModule=Ro,Object.defineProperty(e,"__esModule",{value:!0})}); diff --git a/dist/behaviors/index.d.ts b/dist/behaviors/index.d.ts deleted file mode 100644 index 51cd25e0c..000000000 --- a/dist/behaviors/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./localization/index"; diff --git a/dist/behaviors/index.js b/dist/behaviors/index.js deleted file mode 100644 index 655700b40..000000000 --- a/dist/behaviors/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./localization/index"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/behaviors/index.js.map b/dist/behaviors/index.js.map deleted file mode 100644 index c6f381923..000000000 --- a/dist/behaviors/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/behaviors/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC","sourcesContent":["export * from \"./localization/index\";\n"]} \ No newline at end of file diff --git a/dist/behaviors/index.metadata.json b/dist/behaviors/index.metadata.json deleted file mode 100644 index 822062a3a..000000000 --- a/dist/behaviors/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./localization/index"}]}] \ No newline at end of file diff --git a/dist/behaviors/localization/index.d.ts b/dist/behaviors/localization/index.d.ts deleted file mode 100644 index 4b94872dd..000000000 --- a/dist/behaviors/localization/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./interfaces/values"; -export * from "./services/localization.service"; -export * from "./localization.module"; diff --git a/dist/behaviors/localization/index.js b/dist/behaviors/localization/index.js deleted file mode 100644 index 3e38ea74a..000000000 --- a/dist/behaviors/localization/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./services/localization.service"; -export * from "./localization.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/index.js.map b/dist/behaviors/localization/index.js.map deleted file mode 100644 index 32c73da4e..000000000 --- a/dist/behaviors/localization/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/behaviors/localization/index.ts"],"names":[],"mappings":"AAEA,cAAc,iCAAiC,CAAC;AAEhD,cAAc,uBAAuB,CAAC","sourcesContent":["// This file exports all of the other interfaces.\nexport * from \"./interfaces/values\";\nexport * from \"./services/localization.service\";\n\nexport * from \"./localization.module\";\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/index.metadata.json b/dist/behaviors/localization/index.metadata.json deleted file mode 100644 index 261e05527..000000000 --- a/dist/behaviors/localization/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./interfaces/values"},{"from":"./services/localization.service"},{"from":"./localization.module"}]}] \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/datepicker-values.d.ts b/dist/behaviors/localization/interfaces/datepicker-values.d.ts deleted file mode 100644 index c35ee60b3..000000000 --- a/dist/behaviors/localization/interfaces/datepicker-values.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export declare type Septuple = [T, T, T, T, T, T, T]; -export declare type Duodecuple = [T, T, T, T, T, T, T, T, T, T, T, T]; -export declare type Pair = [T, T]; -export interface IDatepickerFormatsLocaleValues { - year: string; - month: string; - date: string; - datetime: string; - time: string; -} -export interface IDatepickerLocaleValues { - months: Duodecuple; - monthsShort: Duodecuple; - weekdays: Septuple; - weekdaysShort: Septuple; - weekdaysNarrow: Septuple; - timesOfDay: Pair; - timesOfDayUppercase: Pair; - timesOfDayLowercase: Pair; - firstDayOfWeek: number; - formats: IDatepickerFormatsLocaleValues; -} diff --git a/dist/behaviors/localization/interfaces/datepicker-values.js b/dist/behaviors/localization/interfaces/datepicker-values.js deleted file mode 100644 index b88bffcd8..000000000 --- a/dist/behaviors/localization/interfaces/datepicker-values.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=datepicker-values.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/datepicker-values.js.map b/dist/behaviors/localization/interfaces/datepicker-values.js.map deleted file mode 100644 index 323e9092a..000000000 --- a/dist/behaviors/localization/interfaces/datepicker-values.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"datepicker-values.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/interfaces/datepicker-values.ts"],"names":[],"mappings":"","sourcesContent":["export type Septuple = [T, T, T, T, T, T, T];\nexport type Duodecuple = [T, T, T, T, T, T, T, T, T, T, T, T];\nexport type Pair = [T, T];\n\nexport interface IDatepickerFormatsLocaleValues {\n year:string;\n month:string;\n date:string;\n datetime:string;\n time:string;\n}\n\nexport interface IDatepickerLocaleValues {\n months:Duodecuple;\n monthsShort:Duodecuple;\n weekdays:Septuple;\n weekdaysShort:Septuple;\n weekdaysNarrow:Septuple;\n timesOfDay:Pair;\n timesOfDayUppercase:Pair;\n timesOfDayLowercase:Pair;\n firstDayOfWeek:number;\n formats:IDatepickerFormatsLocaleValues;\n}\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/datepicker-values.metadata.json b/dist/behaviors/localization/interfaces/datepicker-values.metadata.json deleted file mode 100644 index 03b38fd6c..000000000 --- a/dist/behaviors/localization/interfaces/datepicker-values.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"Septuple":{"__symbolic":"interface"},"Duodecuple":{"__symbolic":"interface"},"Pair":{"__symbolic":"interface"},"IDatepickerFormatsLocaleValues":{"__symbolic":"interface"},"IDatepickerLocaleValues":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/partial.d.ts b/dist/behaviors/localization/interfaces/partial.d.ts deleted file mode 100644 index 97f965bf1..000000000 --- a/dist/behaviors/localization/interfaces/partial.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare type RecursivePartial = { - [P in keyof T]?: RecursivePartial; -}; diff --git a/dist/behaviors/localization/interfaces/partial.js b/dist/behaviors/localization/interfaces/partial.js deleted file mode 100644 index 1aae8b3ae..000000000 --- a/dist/behaviors/localization/interfaces/partial.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=partial.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/partial.js.map b/dist/behaviors/localization/interfaces/partial.js.map deleted file mode 100644 index 5a83db7f8..000000000 --- a/dist/behaviors/localization/interfaces/partial.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"partial.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/interfaces/partial.ts"],"names":[],"mappings":"","sourcesContent":["export type RecursivePartial = {\n [P in keyof T]?:RecursivePartial;\n};\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/partial.metadata.json b/dist/behaviors/localization/interfaces/partial.metadata.json deleted file mode 100644 index c5011bf5b..000000000 --- a/dist/behaviors/localization/interfaces/partial.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"RecursivePartial":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/search-values.d.ts b/dist/behaviors/localization/interfaces/search-values.d.ts deleted file mode 100644 index 43e098a60..000000000 --- a/dist/behaviors/localization/interfaces/search-values.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface ISearchLocaleValues { - placeholder: string; - noResults: { - header: string; - message: string; - }; -} diff --git a/dist/behaviors/localization/interfaces/search-values.js b/dist/behaviors/localization/interfaces/search-values.js deleted file mode 100644 index 6052c136e..000000000 --- a/dist/behaviors/localization/interfaces/search-values.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=search-values.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/search-values.js.map b/dist/behaviors/localization/interfaces/search-values.js.map deleted file mode 100644 index 289a342af..000000000 --- a/dist/behaviors/localization/interfaces/search-values.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"search-values.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/interfaces/search-values.ts"],"names":[],"mappings":"","sourcesContent":["export interface ISearchLocaleValues {\n placeholder:string;\n noResults:{\n header:string;\n message:string;\n };\n}\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/search-values.metadata.json b/dist/behaviors/localization/interfaces/search-values.metadata.json deleted file mode 100644 index 79cbd0ba6..000000000 --- a/dist/behaviors/localization/interfaces/search-values.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"ISearchLocaleValues":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/select-values.d.ts b/dist/behaviors/localization/interfaces/select-values.d.ts deleted file mode 100644 index 8d4b50495..000000000 --- a/dist/behaviors/localization/interfaces/select-values.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface ISearchTailoredLocaleValues { - placeholder: string; -} -export interface ISelectLocaleValues { - noResultsMessage: string; - single: ISearchTailoredLocaleValues; - multi: ISearchTailoredLocaleValues & { - maxSelectedMessage: string; - selectedMessage: string; - }; -} diff --git a/dist/behaviors/localization/interfaces/select-values.js b/dist/behaviors/localization/interfaces/select-values.js deleted file mode 100644 index f8551cca2..000000000 --- a/dist/behaviors/localization/interfaces/select-values.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=select-values.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/select-values.js.map b/dist/behaviors/localization/interfaces/select-values.js.map deleted file mode 100644 index c1977130d..000000000 --- a/dist/behaviors/localization/interfaces/select-values.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"select-values.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/interfaces/select-values.ts"],"names":[],"mappings":"","sourcesContent":["export interface ISearchTailoredLocaleValues {\n placeholder:string;\n}\n\nexport interface ISelectLocaleValues {\n noResultsMessage:string;\n single:ISearchTailoredLocaleValues;\n multi:ISearchTailoredLocaleValues & {\n maxSelectedMessage:string; // `max` variable passed\n selectedMessage:string; // `count` variable passed\n };\n}\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/select-values.metadata.json b/dist/behaviors/localization/interfaces/select-values.metadata.json deleted file mode 100644 index e671c583c..000000000 --- a/dist/behaviors/localization/interfaces/select-values.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"ISearchTailoredLocaleValues":{"__symbolic":"interface"},"ISelectLocaleValues":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/values.d.ts b/dist/behaviors/localization/interfaces/values.d.ts deleted file mode 100644 index 55b491d1f..000000000 --- a/dist/behaviors/localization/interfaces/values.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { RecursivePartial } from "./partial"; -import { IDatepickerLocaleValues, IDatepickerFormatsLocaleValues } from "./datepicker-values"; -import { ISearchLocaleValues } from "./search-values"; -import { ISelectLocaleValues, ISearchTailoredLocaleValues } from "./select-values"; -export interface ILocaleValues { - datepicker: IDatepickerLocaleValues; - search: ISearchLocaleValues; - select: ISelectLocaleValues; -} -export declare type IPartialLocaleValues = RecursivePartial; -export { RecursivePartial }; -export { IDatepickerLocaleValues, IDatepickerFormatsLocaleValues }; -export { ISearchLocaleValues }; -export { ISelectLocaleValues, ISearchTailoredLocaleValues }; diff --git a/dist/behaviors/localization/interfaces/values.js b/dist/behaviors/localization/interfaces/values.js deleted file mode 100644 index ea6f618de..000000000 --- a/dist/behaviors/localization/interfaces/values.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=values.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/values.js.map b/dist/behaviors/localization/interfaces/values.js.map deleted file mode 100644 index 3428300e5..000000000 --- a/dist/behaviors/localization/interfaces/values.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/interfaces/values.ts"],"names":[],"mappings":"","sourcesContent":["import { RecursivePartial } from \"./partial\";\nimport { IDatepickerLocaleValues, IDatepickerFormatsLocaleValues } from \"./datepicker-values\";\nimport { ISearchLocaleValues } from \"./search-values\";\nimport { ISelectLocaleValues, ISearchTailoredLocaleValues } from \"./select-values\";\n\nexport interface ILocaleValues {\n datepicker:IDatepickerLocaleValues;\n search:ISearchLocaleValues;\n select:ISelectLocaleValues;\n}\n\nexport type IPartialLocaleValues = RecursivePartial;\n\nexport {RecursivePartial};\n\nexport {IDatepickerLocaleValues, IDatepickerFormatsLocaleValues};\nexport {ISearchLocaleValues};\nexport {ISelectLocaleValues, ISearchTailoredLocaleValues};\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/interfaces/values.metadata.json b/dist/behaviors/localization/interfaces/values.metadata.json deleted file mode 100644 index d895f54a1..000000000 --- a/dist/behaviors/localization/interfaces/values.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"ILocaleValues":{"__symbolic":"interface"},"IPartialLocaleValues":{"__symbolic":"interface"},"RecursivePartial":{"__symbolic":"reference","module":"./partial","name":"RecursivePartial","line":13,"character":8},"IDatepickerLocaleValues":{"__symbolic":"reference","module":"./datepicker-values","name":"IDatepickerLocaleValues","line":15,"character":8},"IDatepickerFormatsLocaleValues":{"__symbolic":"reference","module":"./datepicker-values","name":"IDatepickerFormatsLocaleValues","line":15,"character":33},"ISearchLocaleValues":{"__symbolic":"reference","module":"./search-values","name":"ISearchLocaleValues","line":16,"character":8},"ISelectLocaleValues":{"__symbolic":"reference","module":"./select-values","name":"ISelectLocaleValues","line":17,"character":8},"ISearchTailoredLocaleValues":{"__symbolic":"reference","module":"./select-values","name":"ISearchTailoredLocaleValues","line":17,"character":29}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/locales/de.d.ts b/dist/behaviors/localization/locales/de.d.ts deleted file mode 100644 index 7b3373b2b..000000000 --- a/dist/behaviors/localization/locales/de.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../interfaces/values"; -/** - * locale : German (de) - * author : Ciara Ward : https://github.com/ciaraward - */ -declare const de: IPartialLocaleValues; -export default de; diff --git a/dist/behaviors/localization/locales/de.js b/dist/behaviors/localization/locales/de.js deleted file mode 100644 index e8ab71aa3..000000000 --- a/dist/behaviors/localization/locales/de.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : German (de) - * author : Ciara Ward : https://github.com/ciaraward - */ -var de = { - datepicker: { - months: [ - "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember" - ], - monthsShort: [ - "Jan", "Febr", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez" - ], - weekdays: [ - "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" - ], - weekdaysShort: [ - "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" - ], - weekdaysNarrow: [ - "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" - ], - formats: { - time: "HH:mm", - datetime: "D. MMMM YYYY HH:mm", - date: "D. MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Suchen...", - noResults: { - header: "Keine Ergebnisse", - message: "Ihre Suche ergab keine Ergebnisse." - } - }, - select: { - noResultsMessage: "Keine Ergebnisse", - single: { - placeholder: "Eintrag auswählen..." - }, - multi: { - placeholder: "Einträge auswählen...", - maxSelectedMessage: "Höchstens #{max} Einträge", - selectedMessage: "#{count} Einträge ausgewählt" - } - } -}; -export default de; -//# sourceMappingURL=de.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/de.js.map b/dist/behaviors/localization/locales/de.js.map deleted file mode 100644 index d57b05467..000000000 --- a/dist/behaviors/localization/locales/de.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"de.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/de.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SACxH;QACD,WAAW,EAAE;YACT,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACtF;QACD,QAAQ,EAAE;YACN,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS;SAClF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,cAAc,EAAE;YACZ,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,oBAAoB;YAC9B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,OAAO,EAAE,oCAAoC;SAChD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,kBAAkB;QACpC,MAAM,EAAE;YACJ,WAAW,EAAE,sBAAsB;SACtC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,uBAAuB;YACpC,kBAAkB,EAAE,2BAA2B;YAC/C,eAAe,EAAE,8BAA8B;SAClD;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : German (de)\n * author : Ciara Ward : https://github.com/ciaraward\n */\n\nconst de:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"\n ],\n monthsShort: [\n \"Jan\", \"Febr\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"\n ],\n weekdays: [\n \"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"\n ],\n weekdaysShort: [\n \"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"\n ],\n weekdaysNarrow: [\n \"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D. MMMM YYYY HH:mm\",\n date: \"D. MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Suchen...\",\n noResults: {\n header: \"Keine Ergebnisse\",\n message: \"Ihre Suche ergab keine Ergebnisse.\"\n }\n },\n select: {\n noResultsMessage: \"Keine Ergebnisse\",\n single: {\n placeholder: \"Eintrag auswählen...\"\n },\n multi: {\n placeholder: \"Einträge auswählen...\",\n maxSelectedMessage: \"Höchstens #{max} Einträge\",\n selectedMessage: \"#{count} Einträge ausgewählt\"\n }\n }\n};\n\nexport default de;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-AU.d.ts b/dist/behaviors/localization/locales/en-AU.d.ts deleted file mode 100644 index 00d4e3feb..000000000 --- a/dist/behaviors/localization/locales/en-AU.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../interfaces/values"; -/** - * locale : Australian (en-AU) - * author : Trevor Daniels : https://github.com/trevordaniels - */ -declare const enAU: IPartialLocaleValues; -export default enAU; diff --git a/dist/behaviors/localization/locales/en-AU.js b/dist/behaviors/localization/locales/en-AU.js deleted file mode 100644 index 573b2c8e4..000000000 --- a/dist/behaviors/localization/locales/en-AU.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * locale : Australian (en-AU) - * author : Trevor Daniels : https://github.com/trevordaniels - */ -var enAU = { - datepicker: { - firstDayOfWeek: 0 - } -}; -export default enAU; -//# sourceMappingURL=en-AU.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-AU.js.map b/dist/behaviors/localization/locales/en-AU.js.map deleted file mode 100644 index d4565d579..000000000 --- a/dist/behaviors/localization/locales/en-AU.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"en-AU.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-AU.ts"],"names":[],"mappings":";;;;AAOA,IAAM,IAAI,GAAwB;IAC9B,UAAU,EAAE;QACR,cAAc,EAAE,CAAC;KACpB;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Australian (en-AU)\n * author : Trevor Daniels : https://github.com/trevordaniels\n */\n\nconst enAU:IPartialLocaleValues = {\n datepicker: {\n firstDayOfWeek: 0\n }\n};\n\nexport default enAU;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-GB.d.ts b/dist/behaviors/localization/locales/en-GB.d.ts deleted file mode 100644 index 709846578..000000000 --- a/dist/behaviors/localization/locales/en-GB.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ILocaleValues } from "../interfaces/values"; -declare const enGB: ILocaleValues; -export default enGB; diff --git a/dist/behaviors/localization/locales/en-GB.js b/dist/behaviors/localization/locales/en-GB.js deleted file mode 100644 index e78f0f4e9..000000000 --- a/dist/behaviors/localization/locales/en-GB.js +++ /dev/null @@ -1,56 +0,0 @@ -var enGB = { - datepicker: { - months: [ - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - ], - monthsShort: [ - "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - ], - weekdays: [ - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" - ], - weekdaysShort: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - ], - weekdaysNarrow: [ - "S", "M", "T", "W", "T", "F", "S" - ], - timesOfDay: [ - "a.m.", "p.m." - ], - timesOfDayUppercase: [ - "AM", "PM" - ], - timesOfDayLowercase: [ - "am", "pm" - ], - formats: { - time: "h:mm A", - datetime: "D MMMM YYYY h:mm A", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Search...", - noResults: { - header: "No Results", - message: "Your search returned no results." - } - }, - select: { - noResultsMessage: "No results", - single: { - placeholder: "Select one" - }, - multi: { - placeholder: "Select...", - maxSelectedMessage: "Max #{max} selections", - selectedMessage: "#{count} selections" - } - } -}; -export default enGB; -//# sourceMappingURL=en-GB.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-GB.js.map b/dist/behaviors/localization/locales/en-GB.js.map deleted file mode 100644 index 0dff648ce..000000000 --- a/dist/behaviors/localization/locales/en-GB.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"en-GB.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-GB.ts"],"names":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YAAY;SAC5B;QACD,KAAK,EAAE;YACH,WAAW,EAAE,WAAW;YACxB,kBAAkB,EAAE,uBAAuB;YAC3C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { ILocaleValues } from \"../interfaces/values\";\n\nconst enGB:ILocaleValues = {\n datepicker: {\n months: [\n \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"\n ],\n monthsShort: [\n \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"\n ],\n weekdays: [\n \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"\n ],\n weekdaysShort: [\n \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"\n ],\n weekdaysNarrow: [\n \"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"\n ],\n timesOfDay: [\n \"a.m.\", \"p.m.\"\n ],\n timesOfDayUppercase: [\n \"AM\", \"PM\"\n ],\n timesOfDayLowercase: [\n \"am\", \"pm\"\n ],\n formats: {\n time: \"h:mm A\",\n datetime: \"D MMMM YYYY h:mm A\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Search...\",\n noResults: {\n header: \"No Results\",\n message: \"Your search returned no results.\"\n }\n },\n select: {\n noResultsMessage: \"No results\",\n single: {\n placeholder: \"Select one\"\n },\n multi: {\n placeholder: \"Select...\",\n maxSelectedMessage: \"Max #{max} selections\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default enGB;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-US.d.ts b/dist/behaviors/localization/locales/en-US.d.ts deleted file mode 100644 index f824c67df..000000000 --- a/dist/behaviors/localization/locales/en-US.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IPartialLocaleValues } from "../interfaces/values"; -declare const enUS: IPartialLocaleValues; -export default enUS; diff --git a/dist/behaviors/localization/locales/en-US.js b/dist/behaviors/localization/locales/en-US.js deleted file mode 100644 index 3c00b6edd..000000000 --- a/dist/behaviors/localization/locales/en-US.js +++ /dev/null @@ -1,14 +0,0 @@ -var enUS = { - datepicker: { - firstDayOfWeek: 0, - formats: { - time: "h:mm A", - datetime: "MMMM D, YYYY h:mm A", - date: "MMMM D, YYYY", - month: "MMMM YYYY", - year: "YYYY" - } - } -}; -export default enUS; -//# sourceMappingURL=en-US.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/en-US.js.map b/dist/behaviors/localization/locales/en-US.js.map deleted file mode 100644 index 0c0a0d507..000000000 --- a/dist/behaviors/localization/locales/en-US.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-US.ts"],"names":[],"mappings":"AAEA,IAAM,IAAI,GAAwB;IAC9B,UAAU,EAAE;QACR,cAAc,EAAE,CAAC;QACjB,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,qBAAqB;YAC/B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\nconst enUS:IPartialLocaleValues = {\n datepicker: {\n firstDayOfWeek: 0,\n formats: {\n time: \"h:mm A\",\n datetime: \"MMMM D, YYYY h:mm A\",\n date: \"MMMM D, YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n }\n }\n};\n\nexport default enUS;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/es.d.ts b/dist/behaviors/localization/locales/es.d.ts deleted file mode 100644 index 7415cbf06..000000000 --- a/dist/behaviors/localization/locales/es.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../interfaces/values"; -/** - * locale : Spanish (es) - * author : Facundo Donato : https://github.com/genuinefafa - */ -declare const es: IPartialLocaleValues; -export default es; diff --git a/dist/behaviors/localization/locales/es.js b/dist/behaviors/localization/locales/es.js deleted file mode 100644 index 9916a4d14..000000000 --- a/dist/behaviors/localization/locales/es.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : Spanish (es) - * author : Facundo Donato : https://github.com/genuinefafa - */ -var es = { - datepicker: { - months: [ - "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" - ], - monthsShort: [ - "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic" - ], - weekdays: [ - "Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado" - ], - weekdaysShort: [ - "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb" - ], - weekdaysNarrow: [ - "D", "L", "M", "M", "J", "V", "S" - ], - formats: { - time: "HH:mm", - datetime: "D [de] MMMM [de] YYYY HH:mm", - date: "D [de] MMMM [de] YYYY", - month: "MMMM [de] YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Buscar...", - noResults: { - header: "Sin resultados", - message: "La búsqueda no obtuvo resultados." - } - }, - select: { - noResultsMessage: "Sin resultados", - single: { - placeholder: "Seleccione uno" - }, - multi: { - placeholder: "Seleccione...", - maxSelectedMessage: "Puede elegir hasta #{max}", - selectedMessage: "Seleccionados #{count}" - } - } -}; -export default es; -//# sourceMappingURL=es.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/es.js.map b/dist/behaviors/localization/locales/es.js.map deleted file mode 100644 index c1e823e1a..000000000 --- a/dist/behaviors/localization/locales/es.js.map +++ /dev/null @@ -1 +0,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B,kBAAkB,EAAE,2BAA2B;YAC/C,eAAe,EAAE,wBAAwB;SAC5C;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Spanish (es)\n * author : Facundo Donato : https://github.com/genuinefafa\n */\n\nconst es:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"\n ],\n monthsShort: [\n \"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"\n ],\n weekdays: [\n \"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"\n ],\n weekdaysShort: [\n \"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"\n ],\n weekdaysNarrow: [\n \"D\", \"L\", \"M\", \"M\", \"J\", \"V\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D [de] MMMM [de] YYYY HH:mm\",\n date: \"D [de] MMMM [de] YYYY\",\n month: \"MMMM [de] YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Buscar...\",\n noResults: {\n header: \"Sin resultados\",\n message: \"La búsqueda no obtuvo resultados.\"\n }\n },\n select: {\n noResultsMessage: \"Sin resultados\",\n single: {\n placeholder: \"Seleccione uno\"\n },\n multi: {\n placeholder: \"Seleccione...\",\n maxSelectedMessage: \"Puede elegir hasta #{max}\",\n selectedMessage: \"Seleccionados #{count}\"\n }\n }\n};\n\nexport default es;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/fr.d.ts b/dist/behaviors/localization/locales/fr.d.ts deleted file mode 100644 index e4c69b224..000000000 --- a/dist/behaviors/localization/locales/fr.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../interfaces/values"; -/** - * locale : French (fr) - * author : Ciara Ward : https://github.com/ciaraward - */ -declare const fr: IPartialLocaleValues; -export default fr; diff --git a/dist/behaviors/localization/locales/fr.js b/dist/behaviors/localization/locales/fr.js deleted file mode 100644 index aca0e7c5a..000000000 --- a/dist/behaviors/localization/locales/fr.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : French (fr) - * author : Ciara Ward : https://github.com/ciaraward - */ -var fr = { - datepicker: { - months: [ - "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" - ], - monthsShort: [ - "Janv", "Févr", "Mars", "Avr", "Mai", "Juin", "Juil", "Août", "Sept", "Oct", "Nov", "Déc" - ], - weekdays: [ - "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" - ], - weekdaysShort: [ - "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" - ], - weekdaysNarrow: [ - "Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM YYYY HH:mm", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Cherche...", - noResults: { - header: "Aucun Résultats", - message: "Votre recherche n'a pas donné de résultats." - } - }, - select: { - noResultsMessage: "Aucun résultats", - single: { - placeholder: "Choisissez-en un" - }, - multi: { - placeholder: "Choisissez-en...", - maxSelectedMessage: "Max #{max} sélections", - selectedMessage: "#{count} selections" - } - } -}; -export default fr; -//# sourceMappingURL=fr.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/fr.js.map b/dist/behaviors/localization/locales/fr.js.map deleted file mode 100644 index d7c77ffd4..000000000 --- a/dist/behaviors/localization/locales/fr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fr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;YAC3C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : French (fr)\n * author : Ciara Ward : https://github.com/ciaraward\n */\n\nconst fr:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"\n ],\n monthsShort: [\n \"Janv\", \"Févr\", \"Mars\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Août\", \"Sept\", \"Oct\", \"Nov\", \"Déc\"\n ],\n weekdays: [\n \"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"\n ],\n weekdaysShort: [\n \"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"\n ],\n weekdaysNarrow: [\n \"Di\", \"Lu\", \"Ma\", \"Me\", \"Je\", \"Ve\", \"Sa\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Cherche...\",\n noResults: {\n header: \"Aucun Résultats\",\n message: \"Votre recherche n'a pas donné de résultats.\"\n }\n },\n select: {\n noResultsMessage: \"Aucun résultats\",\n single: {\n placeholder: \"Choisissez-en un\"\n },\n multi: {\n placeholder: \"Choisissez-en...\",\n maxSelectedMessage: \"Max #{max} sélections\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default fr;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/ge.d.ts b/dist/behaviors/localization/locales/ge.d.ts deleted file mode 100644 index c0820006d..000000000 --- a/dist/behaviors/localization/locales/ge.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../interfaces/values"; -/** - * locale : Georgian (ge) - * author : Vaso Gazdeliani : https://github.com/vaso991 - */ -declare const ge: IPartialLocaleValues; -export default ge; diff --git a/dist/behaviors/localization/locales/ge.js b/dist/behaviors/localization/locales/ge.js deleted file mode 100644 index 84c947903..000000000 --- a/dist/behaviors/localization/locales/ge.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * locale : Georgian (ge) - * author : Vaso Gazdeliani : https://github.com/vaso991 - */ -var ge = { - datepicker: { - months: [ - "იანვარი", "თებერვალი", "მარტი", "აპრილი", "მაისი", "ივნისი", - "ივლისი", "აგვისტო", "სექტემბერი", "ოქტომბერი", "ნოემბერი", "დეკემბერი" - ], - monthsShort: [ - "იან", "თებ", "მარ", "აპრ", "მაი", "ივნ", "ივლ", "აგვ", "სექ", "ოქტ", "ნოემ", "დეკ" - ], - weekdays: [ - "კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი" - ], - weekdaysShort: [ - "კვ", "ორ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ" - ], - weekdaysNarrow: [ - "კ", "ორ", "ს", "ოთ", "ხ", "პ", "შ" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM YYYY HH:mm", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "ძებნა...", - noResults: { - header: "მონაცემები არ მოიძებნა", - message: "თქვენმა ძებნამ არ დააბრუნა შედეგი." - } - }, - select: { - noResultsMessage: "მონაცემები არ მოიძებნა", - single: { - placeholder: "აირჩიე" - }, - multi: { - placeholder: "აირჩიე...", - maxSelectedMessage: "მაქსიმუმ #{max}", - selectedMessage: "არჩეულია #{count}" - } - } -}; -export default ge; -//# sourceMappingURL=ge.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/ge.js.map b/dist/behaviors/localization/locales/ge.js.map deleted file mode 100644 index a648c8061..000000000 --- a/dist/behaviors/localization/locales/ge.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ge.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/ge.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ;YAC5D,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW;SAC1E;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK;SACtF;QACD,QAAQ,EAAE;YACN,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ;SACpF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAChD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACtC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE;YACP,MAAM,EAAE,wBAAwB;YAChC,OAAO,EAAE,oCAAoC;SAChD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,wBAAwB;QAC1C,MAAM,EAAE;YACJ,WAAW,EAAE,QAAQ;SACxB;QACD,KAAK,EAAE;YACH,WAAW,EAAE,WAAW;YACxB,kBAAkB,EAAE,iBAAiB;YACrC,eAAe,EAAE,mBAAmB;SACvC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Georgian (ge)\n * author : Vaso Gazdeliani : https://github.com/vaso991\n */\n\nconst ge:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"იანვარი\", \"თებერვალი\", \"მარტი\", \"აპრილი\", \"მაისი\", \"ივნისი\",\n \"ივლისი\", \"აგვისტო\", \"სექტემბერი\", \"ოქტომბერი\", \"ნოემბერი\", \"დეკემბერი\"\n ],\n monthsShort: [\n \"იან\", \"თებ\", \"მარ\", \"აპრ\", \"მაი\", \"ივნ\", \"ივლ\", \"აგვ\", \"სექ\", \"ოქტ\", \"ნოემ\", \"დეკ\"\n ],\n weekdays: [\n \"კვირა\", \"ორშაბათი\", \"სამშაბათი\", \"ოთხშაბათი\", \"ხუთშაბათი\", \"პარასკევი\", \"შაბათი\"\n ],\n weekdaysShort: [\n \"კვ\", \"ორ\", \"სამ\", \"ოთხ\", \"ხუთ\", \"პარ\", \"შაბ\"\n ],\n weekdaysNarrow: [\n \"კ\", \"ორ\", \"ს\", \"ოთ\", \"ხ\", \"პ\", \"შ\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"ძებნა...\",\n noResults: {\n header: \"მონაცემები არ მოიძებნა\",\n message: \"თქვენმა ძებნამ არ დააბრუნა შედეგი.\"\n }\n },\n select: {\n noResultsMessage: \"მონაცემები არ მოიძებნა\",\n single: {\n placeholder: \"აირჩიე\"\n },\n multi: {\n placeholder: \"აირჩიე...\",\n maxSelectedMessage: \"მაქსიმუმ #{max}\",\n selectedMessage: \"არჩეულია #{count}\"\n }\n }\n};\n\nexport default ge;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/he.d.ts b/dist/behaviors/localization/locales/he.d.ts deleted file mode 100644 index 5857c35a4..000000000 --- a/dist/behaviors/localization/locales/he.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../interfaces/values"; -/** - * locale : Hebrew (he) - * author : David limkys : https://github.com/gotenxds - */ -declare const he: IPartialLocaleValues; -export default he; diff --git a/dist/behaviors/localization/locales/he.js b/dist/behaviors/localization/locales/he.js deleted file mode 100644 index 08eda8755..000000000 --- a/dist/behaviors/localization/locales/he.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : Hebrew (he) - * author : David limkys : https://github.com/gotenxds - */ -var he = { - datepicker: { - months: [ - "ינואר", "פבואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר" - ], - monthsShort: [ - "ינו", "פבו", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ" - ], - weekdays: [ - "ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת" - ], - weekdaysShort: [ - "ראש", "שני", "שלי", "רבי", "חמי", "שיש", "שבת" - ], - weekdaysNarrow: [ - "ר", "ש", "ש", "ר", "ח", "ש", "ש" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM YYYY HH:mm", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 0 - }, - search: { - placeholder: "חפש...", - noResults: { - header: "אין תוצאות", - message: "החיפוש שלך לא אחזיר תוצאות." - } - }, - select: { - noResultsMessage: "אין תוצאות", - single: { - placeholder: "בחר אחד" - }, - multi: { - placeholder: "בחר...", - maxSelectedMessage: "מקסימום #{max} אפשרויות", - selectedMessage: "#{count} selections" - } - } -}; -export default he; -//# sourceMappingURL=he.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/he.js.map b/dist/behaviors/localization/locales/he.js.map deleted file mode 100644 index 6bc955dd6..000000000 --- a/dist/behaviors/localization/locales/he.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"he.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/he.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO;SAC5G;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK;SAC3D;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,QAAQ;QACrB,SAAS,EAAE;YACP,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,6BAA6B;SACzC;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,YAAY;QAC9B,MAAM,EAAE;YACJ,WAAW,EAAE,SAAS;SACzB;QACD,KAAK,EAAE;YACH,WAAW,EAAE,QAAQ;YACrB,kBAAkB,EAAE,yBAAyB;YAC7C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Hebrew (he)\n * author : David limkys : https://github.com/gotenxds\n */\n\nconst he:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"ינואר\", \"פבואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"\n ],\n monthsShort: [\n \"ינו\", \"פבו\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"\n ],\n weekdays: [\n \"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"\n ],\n weekdaysShort: [\n \"ראש\", \"שני\", \"שלי\", \"רבי\", \"חמי\", \"שיש\", \"שבת\"\n ],\n weekdaysNarrow: [\n \"ר\", \"ש\", \"ש\", \"ר\", \"ח\", \"ש\", \"ש\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 0\n },\n search: {\n placeholder: \"חפש...\",\n noResults: {\n header: \"אין תוצאות\",\n message: \"החיפוש שלך לא אחזיר תוצאות.\"\n }\n },\n select: {\n noResultsMessage: \"אין תוצאות\",\n single: {\n placeholder: \"בחר אחד\"\n },\n multi: {\n placeholder: \"בחר...\",\n maxSelectedMessage: \"מקסימום #{max} אפשרויות\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default he;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/index.d.ts b/dist/behaviors/localization/locales/index.d.ts deleted file mode 100644 index 7e332a61d..000000000 --- a/dist/behaviors/localization/locales/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { RecursivePartial, ILocaleValues } from "../interfaces/values"; -declare const _default: { - de: RecursivePartial; - enAU: RecursivePartial; - enGB: ILocaleValues; - enUS: RecursivePartial; - es: RecursivePartial; - it: RecursivePartial; - fr: RecursivePartial; - pt: RecursivePartial; - ru: RecursivePartial; - he: RecursivePartial; - ge: RecursivePartial; - nl: RecursivePartial; -}; -export default _default; diff --git a/dist/behaviors/localization/locales/index.js b/dist/behaviors/localization/locales/index.js deleted file mode 100644 index ecf35198a..000000000 --- a/dist/behaviors/localization/locales/index.js +++ /dev/null @@ -1,27 +0,0 @@ -import de from "./de"; -import enAU from "./en-AU"; -import enGB from "./en-GB"; -import enUS from "./en-US"; -import es from "./es"; -import fr from "./fr"; -import pt from "./pt"; -import it from "./it"; -import ru from "./ru"; -import he from "./he"; -import ge from "./ge"; -import nl from "./nl"; -export default { - de: de, - enAU: enAU, - enGB: enGB, - enUS: enUS, - es: es, - it: it, - fr: fr, - pt: pt, - ru: ru, - he: he, - ge: ge, - nl: nl -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/index.js.map b/dist/behaviors/localization/locales/index.js.map deleted file mode 100644 index c19fbd7d6..000000000 --- a/dist/behaviors/localization/locales/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AAGtB,eAAe;IACX,EAAE,IAAA;IACF,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;CACL,CAAC","sourcesContent":["import { RecursivePartial, ILocaleValues } from \"../interfaces/values\";\n\nimport de from \"./de\";\nimport enAU from \"./en-AU\";\nimport enGB from \"./en-GB\";\nimport enUS from \"./en-US\";\nimport es from \"./es\";\nimport fr from \"./fr\";\nimport pt from \"./pt\";\nimport it from \"./it\";\nimport ru from \"./ru\";\nimport he from \"./he\";\nimport ge from \"./ge\";\nimport nl from \"./nl\";\n\n// This file exists for the demo app. Don't use this in real life.\nexport default {\n de,\n enAU,\n enGB,\n enUS,\n es,\n it,\n fr,\n pt,\n ru,\n he,\n ge,\n nl\n};\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/it.d.ts b/dist/behaviors/localization/locales/it.d.ts deleted file mode 100644 index 9f4a18c6e..000000000 --- a/dist/behaviors/localization/locales/it.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../interfaces/values"; -/** - * locale : Italian (it) - * author : Massimo Costa : https://github.com/mcosta74 - */ -declare const it: IPartialLocaleValues; -export default it; diff --git a/dist/behaviors/localization/locales/it.js b/dist/behaviors/localization/locales/it.js deleted file mode 100644 index 7773f624f..000000000 --- a/dist/behaviors/localization/locales/it.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : Italian (it) - * author : Massimo Costa : https://github.com/mcosta74 - */ -var it = { - datepicker: { - months: [ - "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" - ], - monthsShort: [ - "Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic" - ], - weekdays: [ - "Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato" - ], - weekdaysShort: [ - "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" - ], - weekdaysNarrow: [ - "D", "L", "M", "M", "G", "V", "S" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM YYYY HH:mm", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Cerca...", - noResults: { - header: "Nessun risultato", - message: "La tua ricerca non ha trovato risultati." - } - }, - select: { - noResultsMessage: "Nessun risultato", - single: { - placeholder: "Scegli uno" - }, - multi: { - placeholder: "Scegli...", - maxSelectedMessage: "Puoi effettuare fino a #{max} scelte.", - selectedMessage: "#{count} scelte" - } - } -}; -export default it; -//# sourceMappingURL=it.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/it.js.map b/dist/behaviors/localization/locales/it.js.map deleted file mode 100644 index 02d505ecc..000000000 --- a/dist/behaviors/localization/locales/it.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"it.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/it.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SACnI;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ;SAC/E;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,OAAO,EAAE,0CAA0C;SACtD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,kBAAkB;QACpC,MAAM,EAAE;YACJ,WAAW,EAAE,YAAY;SAC5B;QACD,KAAK,EAAE;YACH,WAAW,EAAE,WAAW;YACxB,kBAAkB,EAAE,uCAAuC;YAC3D,eAAe,EAAE,iBAAiB;SACrC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Italian (it)\n * author : Massimo Costa : https://github.com/mcosta74\n */\n\nconst it:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"\n ],\n monthsShort: [\n \"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"\n ],\n weekdays: [\n \"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"\n ],\n weekdaysShort: [\n \"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"\n ],\n weekdaysNarrow: [\n \"D\", \"L\", \"M\", \"M\", \"G\", \"V\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Cerca...\",\n noResults: {\n header: \"Nessun risultato\",\n message: \"La tua ricerca non ha trovato risultati.\"\n }\n },\n select: {\n noResultsMessage: \"Nessun risultato\",\n single: {\n placeholder: \"Scegli uno\"\n },\n multi: {\n placeholder: \"Scegli...\",\n maxSelectedMessage: \"Puoi effettuare fino a #{max} scelte.\",\n selectedMessage: \"#{count} scelte\"\n }\n }\n};\n\nexport default it;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/nl.d.ts b/dist/behaviors/localization/locales/nl.d.ts deleted file mode 100644 index 25ff660ce..000000000 --- a/dist/behaviors/localization/locales/nl.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../interfaces/values"; -/** - * locale : Dutch (nl) - * author : Martijn Melchers : https://github.com/martijnmelchers - */ -declare const nl: IPartialLocaleValues; -export default nl; diff --git a/dist/behaviors/localization/locales/nl.js b/dist/behaviors/localization/locales/nl.js deleted file mode 100644 index 3502ed1a8..000000000 --- a/dist/behaviors/localization/locales/nl.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * locale : Dutch (nl) - * author : Martijn Melchers : https://github.com/martijnmelchers - */ -var nl = { - datepicker: { - months: [ - "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December" - ], - monthsShort: [ - "Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec" - ], - weekdays: [ - "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag" - ], - weekdaysShort: [ - "Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za" - ], - weekdaysNarrow: [ - "Z", "M", "D", "W", "D", "V", "Z" - ], - /* Dutch does not have a translation for am/pm */ - timesOfDay: [ - "a.m.", "p.m." - ], - timesOfDayUppercase: [ - "AM", "PM" - ], - timesOfDayLowercase: [ - "am", "pm" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM YYYY HH:mm", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Zoeken...", - noResults: { - header: "Geen resultaten", - message: "Er zijn geen resultaten gevonden." - } - }, - select: { - noResultsMessage: "Geen resultation", - single: { - placeholder: "Selecteer een" - }, - multi: { - placeholder: "Selecteren...", - maxSelectedMessage: "Max #{max} selecteren", - selectedMessage: "#{count} geselecteerd" - } - } -}; -export default nl; -//# sourceMappingURL=nl.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/nl.js.map b/dist/behaviors/localization/locales/nl.js.map deleted file mode 100644 index 519646049..000000000 --- a/dist/behaviors/localization/locales/nl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nl.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/nl.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS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../interfaces/values\";\n\n/**\n * locale : Dutch (nl)\n * author : Martijn Melchers : https://github.com/martijnmelchers\n */\n\nconst nl:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"\n ],\n monthsShort: [\n \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"\n ],\n weekdays: [\n \"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"\n ],\n weekdaysShort: [\n \"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"\n ],\n weekdaysNarrow: [\n \"Z\", \"M\", \"D\", \"W\", \"D\", \"V\", \"Z\"\n ],\n\t\t/* Dutch does not have a translation for am/pm */\n timesOfDay: [\n \"a.m.\", \"p.m.\"\n ],\n timesOfDayUppercase: [\n \"AM\", \"PM\"\n ],\n timesOfDayLowercase: [\n \"am\", \"pm\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Zoeken...\",\n noResults: {\n header: \"Geen resultaten\",\n message: \"Er zijn geen resultaten gevonden.\"\n }\n },\n select: {\n noResultsMessage: \"Geen resultation\",\n single: {\n placeholder: \"Selecteer een\"\n },\n multi: {\n placeholder: \"Selecteren...\",\n maxSelectedMessage: \"Max #{max} selecteren\",\n selectedMessage: \"#{count} geselecteerd\"\n }\n }\n};\n\nexport default nl;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/pt.d.ts b/dist/behaviors/localization/locales/pt.d.ts deleted file mode 100644 index 83a63f0d9..000000000 --- a/dist/behaviors/localization/locales/pt.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../interfaces/values"; -/** - * locale : Portuguese (pt) - * author : Fernando Niwes : https://github.com/fniwes - */ -declare const pt: IPartialLocaleValues; -export default pt; diff --git a/dist/behaviors/localization/locales/pt.js b/dist/behaviors/localization/locales/pt.js deleted file mode 100644 index e925bfd10..000000000 --- a/dist/behaviors/localization/locales/pt.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : Portuguese (pt) - * author : Fernando Niwes : https://github.com/fniwes - */ -var pt = { - datepicker: { - months: [ - "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro" - ], - monthsShort: [ - "jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez" - ], - weekdays: [ - "Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado" - ], - weekdaysShort: [ - "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" - ], - weekdaysNarrow: [ - "D", "1", "2", "3", "4", "5", "S" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM [de] YYYY HH:mm", - date: "D [de] MMMM [de] YYYY", - month: "MMMM [de] YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Pesquisar...", - noResults: { - header: "Sem resultados", - message: "Sua pesquisa não retornou resultados." - } - }, - select: { - noResultsMessage: "Sem resultados", - single: { - placeholder: "Escolha uma opção" - }, - multi: { - placeholder: "Escolher...", - maxSelectedMessage: "Max #{max} opçãoes", - selectedMessage: "#{count} selections" - } - } -}; -export default pt; -//# sourceMappingURL=pt.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/pt.js.map b/dist/behaviors/localization/locales/pt.js.map deleted file mode 100644 index b43494bfd..000000000 --- a/dist/behaviors/localization/locales/pt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/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J;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Portuguese (pt)\n * author : Fernando Niwes : https://github.com/fniwes\n */\n\nconst pt:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"janeiro\", \"fevereiro\", \"março\", \"abril\", \"maio\", \"junho\", \"julho\", \"agosto\", \"setembro\", \"outubro\", \"novembro\", \"dezembro\"\n ],\n monthsShort: [\n \"jan\", \"fev\", \"mar\", \"abr\", \"mai\", \"jun\", \"jul\", \"ago\", \"set\", \"out\", \"nov\", \"dez\"\n ],\n weekdays: [\n \"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"\n ],\n weekdaysShort: [\n \"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"\n ],\n weekdaysNarrow: [\n \"D\", \"1\", \"2\", \"3\", \"4\", \"5\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM [de] YYYY HH:mm\",\n date: \"D [de] MMMM [de] YYYY\",\n month: \"MMMM [de] YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Pesquisar...\",\n noResults: {\n header: \"Sem resultados\",\n message: \"Sua pesquisa não retornou resultados.\"\n }\n },\n select: {\n noResultsMessage: \"Sem resultados\",\n single: {\n placeholder: \"Escolha uma opção\"\n },\n multi: {\n placeholder: \"Escolher...\",\n maxSelectedMessage: \"Max #{max} opçãoes\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default pt;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/locales/ru.d.ts b/dist/behaviors/localization/locales/ru.d.ts deleted file mode 100644 index 395f86b38..000000000 --- a/dist/behaviors/localization/locales/ru.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../interfaces/values"; -/** - * locale : Russian (ru) - * author : Maksim Moiseikin : https://github.com/maksim-m - */ -declare const ru: IPartialLocaleValues; -export default ru; diff --git a/dist/behaviors/localization/locales/ru.js b/dist/behaviors/localization/locales/ru.js deleted file mode 100644 index c06c2847a..000000000 --- a/dist/behaviors/localization/locales/ru.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : Russian (ru) - * author : Maksim Moiseikin : https://github.com/maksim-m - */ -var ru = { - datepicker: { - months: [ - "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" - ], - monthsShort: [ - "Янв", "Февр", "Март", "Апр", "Май", "Июнь", "Июль", "Авг", "Сент", "Окт", "Ноя", "Дек" - ], - weekdays: [ - "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота" - ], - weekdaysShort: [ - "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" - ], - weekdaysNarrow: [ - "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" - ], - formats: { - time: "HH:mm", - datetime: "DD.MM.YYYY HH:mm", - date: "DD.MM.YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Поиск...", - noResults: { - header: "Нет результатов", - message: "Поиск не дал результатов." - } - }, - select: { - noResultsMessage: "Нет результатов", - single: { - placeholder: "Выберите одно значение" - }, - multi: { - placeholder: "Выберите...", - maxSelectedMessage: "Не более #{max} значений", - selectedMessage: "#{count} selections" - } - } -}; -export default ru; -//# sourceMappingURL=ru.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/locales/ru.js.map b/dist/behaviors/localization/locales/ru.js.map deleted file mode 100644 index 8908bf702..000000000 --- a/dist/behaviors/localization/locales/ru.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ru.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/ru.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,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leValues } from \"../interfaces/values\";\n\n/**\n * locale : Russian (ru)\n * author : Maksim Moiseikin : https://github.com/maksim-m\n */\n\nconst ru:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Май\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Октябрь\", \"Ноябрь\", \"Декабрь\"\n ],\n monthsShort: [\n \"Янв\", \"Февр\", \"Март\", \"Апр\", \"Май\", \"Июнь\", \"Июль\", \"Авг\", \"Сент\", \"Окт\", \"Ноя\", \"Дек\"\n ],\n weekdays: [\n \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"\n ],\n weekdaysShort: [\n \"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"\n ],\n weekdaysNarrow: [\n \"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"DD.MM.YYYY HH:mm\",\n date: \"DD.MM.YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Поиск...\",\n noResults: {\n header: \"Нет результатов\",\n message: \"Поиск не дал результатов.\"\n }\n },\n select: {\n noResultsMessage: \"Нет результатов\",\n single: {\n placeholder: \"Выберите одно значение\"\n },\n multi: {\n placeholder: \"Выберите...\",\n maxSelectedMessage: \"Не более #{max} значений\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default ru;\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/localization.module.d.ts b/dist/behaviors/localization/localization.module.d.ts deleted file mode 100644 index 52e6a5cf5..000000000 --- a/dist/behaviors/localization/localization.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiLocalizationModule { -} diff --git a/dist/behaviors/localization/localization.module.js b/dist/behaviors/localization/localization.module.js deleted file mode 100644 index 9e477cd33..000000000 --- a/dist/behaviors/localization/localization.module.js +++ /dev/null @@ -1,18 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiLocalizationService } from "./services/localization.service"; -var SuiLocalizationModule = /** @class */ (function () { - function SuiLocalizationModule() { - } - SuiLocalizationModule.decorators = [ - { type: NgModule, args: [{ - imports: [CommonModule], - providers: [SuiLocalizationService] - },] }, - ]; - /** @nocollapse */ - SuiLocalizationModule.ctorParameters = function () { return []; }; - return SuiLocalizationModule; -}()); -export { SuiLocalizationModule }; -//# sourceMappingURL=localization.module.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/localization.module.js.map b/dist/behaviors/localization/localization.module.js.map deleted file mode 100644 index 09caf032a..000000000 --- a/dist/behaviors/localization/localization.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"localization.module.js","sourceRoot":"","sources":["../../../src/behaviors/localization/localization.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;;;;;gBAExE,QAAQ,SAAC;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,SAAS,EAAE,CAAC,sBAAsB,CAAC;iBACtC;;;;gCARD;;SASa,qBAAqB","sourcesContent":["\nimport { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiLocalizationService } from \"./services/localization.service\";\n\n@NgModule({\n imports: [CommonModule],\n providers: [SuiLocalizationService]\n})\nexport class SuiLocalizationModule {}\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/localization.module.metadata.json b/dist/behaviors/localization/localization.module.metadata.json deleted file mode 100644 index d7d014dfa..000000000 --- a/dist/behaviors/localization/localization.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiLocalizationModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":14}],"providers":[{"__symbolic":"reference","module":"./services/localization.service","name":"SuiLocalizationService","line":7,"character":16}]}]}]}}}] \ No newline at end of file diff --git a/dist/behaviors/localization/public.d.ts b/dist/behaviors/localization/public.d.ts deleted file mode 100644 index c3de32328..000000000 --- a/dist/behaviors/localization/public.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./interfaces/values"; -export { SuiLocalizationModule, SuiLocalizationService } from "./index"; diff --git a/dist/behaviors/localization/public.js b/dist/behaviors/localization/public.js deleted file mode 100644 index 4a6c6e1c4..000000000 --- a/dist/behaviors/localization/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiLocalizationModule, SuiLocalizationService } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/public.js.map b/dist/behaviors/localization/public.js.map deleted file mode 100644 index 5ecc350ea..000000000 --- a/dist/behaviors/localization/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/behaviors/localization/public.ts"],"names":[],"mappings":"AACA,OAAO,EACH,qBAAqB,EACrB,sBAAsB,EACzB,MAAM,SAAS,CAAC","sourcesContent":["export * from \"./interfaces/values\";\nexport {\n SuiLocalizationModule,\n SuiLocalizationService\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/public.metadata.json b/dist/behaviors/localization/public.metadata.json deleted file mode 100644 index 392a7fb66..000000000 --- a/dist/behaviors/localization/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./interfaces/values"},{"from":"./index","export":["SuiLocalizationModule","SuiLocalizationService"]}]}] \ No newline at end of file diff --git a/dist/behaviors/localization/services/localization.service.d.ts b/dist/behaviors/localization/services/localization.service.d.ts deleted file mode 100644 index dcd47d878..000000000 --- a/dist/behaviors/localization/services/localization.service.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { EventEmitter } from "@angular/core"; -import { ILocaleValues, IPartialLocaleValues, RecursivePartial } from "../interfaces/values"; -export declare class SuiLocalizationService { - private _language; - private _fallbackValues; - private _values; - readonly language: string; - onLanguageUpdate: EventEmitter; - constructor(); - setLanguage(language: string): void; - get(language?: string): ILocaleValues; - override(values: ILocaleValues[T], overrides: RecursivePartial): ILocaleValues[T]; - load(language: string, values: IPartialLocaleValues): void; - patch(language: string, values: IPartialLocaleValues): void; - interpolate(value: string, variables: [string, string][]): string; -} diff --git a/dist/behaviors/localization/services/localization.service.js b/dist/behaviors/localization/services/localization.service.js deleted file mode 100644 index 76fc9aa5e..000000000 --- a/dist/behaviors/localization/services/localization.service.js +++ /dev/null @@ -1,69 +0,0 @@ -import { Injectable, EventEmitter } from "@angular/core"; -import enGB from "../locales/en-GB"; -import * as $extend from "extend"; -function deepClone(obj) { - return JSON.parse(JSON.stringify(obj)); -} -function deepExtend(target, source) { - // Rollup... - var extend = $extend.default || $extend; - return extend(true, target, source); -} -function lang(language) { - return language.toLowerCase().replace("-", ""); -} -var SuiLocalizationService = /** @class */ (function () { - function SuiLocalizationService() { - this.onLanguageUpdate = new EventEmitter(); - this._fallbackValues = enGB; - this._values = {}; - this._language = "en-GB"; - this.load("en-GB", enGB); - } - Object.defineProperty(SuiLocalizationService.prototype, "language", { - get: function () { - return this._language; - }, - enumerable: true, - configurable: true - }); - SuiLocalizationService.prototype.setLanguage = function (language) { - if (lang(this._language) !== lang(language)) { - this._language = language; - this.onLanguageUpdate.emit(); - } - }; - SuiLocalizationService.prototype.get = function (language) { - if (language === void 0) { language = this.language; } - var values = deepClone(this._fallbackValues); - if (!this._values[lang(language)]) { - throw new Error("Locale " + language + " is not loaded"); - } - deepExtend(values, this._values[lang(language)]); - return deepClone(values); - }; - SuiLocalizationService.prototype.override = function (values, overrides) { - return deepExtend(deepClone(values), overrides); - }; - SuiLocalizationService.prototype.load = function (language, values) { - this._values[lang(language)] = deepClone(values); - this.onLanguageUpdate.emit(); - }; - SuiLocalizationService.prototype.patch = function (language, values) { - deepExtend(this._values[lang(language)], values); - }; - SuiLocalizationService.prototype.interpolate = function (value, variables) { - return variables.reduce(function (s, _a) { - var k = _a[0], v = _a[1]; - return s.replace(new RegExp("#{" + k + "}", "g"), v); - }, value); - }; - SuiLocalizationService.decorators = [ - { type: Injectable }, - ]; - /** @nocollapse */ - SuiLocalizationService.ctorParameters = function () { return []; }; - return SuiLocalizationService; -}()); -export { SuiLocalizationService }; -//# sourceMappingURL=localization.service.js.map \ No newline at end of file diff --git a/dist/behaviors/localization/services/localization.service.js.map b/dist/behaviors/localization/services/localization.service.js.map deleted file mode 100644 index e3602a8be..000000000 --- a/dist/behaviors/localization/services/localization.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"localization.service.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/services/localization.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,KAAK,OAAO,MAAM,QAAQ,CAAC;AAElC,mBAAsB,GAAK;IACvB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;CAC1C;AAED,oBAA0B,MAAQ,EAAE,MAAQ;;IAExC,IAAM,MAAM,GAAI,OAAe,CAAC,OAAO,IAAI,OAAO,CAAC;IACnD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED,cAAc,QAAe;IACzB,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;CAClD;;I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AE,MAA2B;QACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;KAChC;IAEM,sCAAK,GAAZ,UAAa,QAAe,EAAE,MAA2B;QACrD,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;KACpD;IAEM,4CAAW,GAAlB,UAAmB,KAAY,EAAE,SAA4B;QACzD,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,EAAM;gBAAL,SAAC,EAAE,SAAC;YAAM,OAAA,CAAC,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,OAAK,CAAC,MAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QAAxC,CAAwC,EAAE,KAAK,CAAC,CAAC;KAC3F;;gBAxDJ,UAAU;;;;iCAvBX;;SAwBa,sBAAsB","sourcesContent":["import { Injectable, EventEmitter } from \"@angular/core\";\nimport { ILocaleValues, IPartialLocaleValues, RecursivePartial } from \"../interfaces/values\";\nimport enGB from \"../locales/en-GB\";\nimport * as $extend from \"extend\";\n\nfunction deepClone(obj:T):T {\n return JSON.parse(JSON.stringify(obj));\n}\n\nfunction deepExtend(target:T, source:U):T & U {\n // Rollup...\n const extend = ($extend as any).default || $extend;\n return extend(true, target, source);\n}\n\nfunction lang(language:string):string {\n return language.toLowerCase().replace(\"-\", \"\");\n}\n\ninterface ILocalizationValuesContainer {\n [name:string]:IPartialLocaleValues;\n}\n\n@Injectable()\nexport class SuiLocalizationService {\n private _language:string;\n\n private _fallbackValues:ILocaleValues;\n private _values:ILocalizationValuesContainer;\n\n public get language():string {\n return this._language;\n }\n\n public onLanguageUpdate:EventEmitter;\n\n constructor() {\n this.onLanguageUpdate = new EventEmitter();\n\n this._fallbackValues = enGB;\n this._values = {};\n this._language = \"en-GB\";\n this.load(\"en-GB\", enGB);\n }\n\n public setLanguage(language:string):void {\n if (lang(this._language) !== lang(language)) {\n this._language = language;\n this.onLanguageUpdate.emit();\n }\n }\n\n public get(language:string = this.language):ILocaleValues {\n const values = deepClone(this._fallbackValues);\n if (!this._values[lang(language)]) {\n throw new Error(`Locale ${language} is not loaded`);\n }\n deepExtend(values, this._values[lang(language)]);\n return deepClone(values);\n }\n\n public override(\n values:ILocaleValues[T],\n overrides:RecursivePartial\n ):ILocaleValues[T] {\n return deepExtend(deepClone(values), overrides);\n }\n\n public load(language:string, values:IPartialLocaleValues):void {\n this._values[lang(language)] = deepClone(values);\n this.onLanguageUpdate.emit();\n }\n\n public patch(language:string, values:IPartialLocaleValues):void {\n deepExtend(this._values[lang(language)], values);\n }\n\n public interpolate(value:string, variables:[string, string][]):string {\n return variables.reduce((s, [k, v]) => s.replace(new RegExp(`#{${k}}`, \"g\"), v), value);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/behaviors/localization/services/localization.service.metadata.json b/dist/behaviors/localization/services/localization.service.metadata.json deleted file mode 100644 index 535d2f5fb..000000000 --- a/dist/behaviors/localization/services/localization.service.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiLocalizationService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":23,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"setLanguage":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"override":[{"__symbolic":"method"}],"load":[{"__symbolic":"method"}],"patch":[{"__symbolic":"method"}],"interpolate":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/behaviors/public.d.ts b/dist/behaviors/public.d.ts deleted file mode 100644 index fd8cf9a43..000000000 --- a/dist/behaviors/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./localization/public"; diff --git a/dist/behaviors/public.js b/dist/behaviors/public.js deleted file mode 100644 index ebd79f4bc..000000000 --- a/dist/behaviors/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./localization/public"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/behaviors/public.js.map b/dist/behaviors/public.js.map deleted file mode 100644 index e94e9bbc9..000000000 --- a/dist/behaviors/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/behaviors/public.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC","sourcesContent":["export * from \"./localization/public\";\n"]} \ No newline at end of file diff --git a/dist/behaviors/public.metadata.json b/dist/behaviors/public.metadata.json deleted file mode 100644 index d2d3fb878..000000000 --- a/dist/behaviors/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./localization/public"}]}] \ No newline at end of file diff --git a/dist/collections/index.d.ts b/dist/collections/index.d.ts deleted file mode 100644 index 6ea9faf05..000000000 --- a/dist/collections/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./message/index"; -export * from "./pagination/index"; diff --git a/dist/collections/index.js b/dist/collections/index.js deleted file mode 100644 index 01971a150..000000000 --- a/dist/collections/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./message/index"; -export * from "./pagination/index"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/collections/index.js.map b/dist/collections/index.js.map deleted file mode 100644 index 94a0942eb..000000000 --- a/dist/collections/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./message/index\";\nexport * from \"./pagination/index\";\n"]} \ No newline at end of file diff --git a/dist/collections/index.metadata.json b/dist/collections/index.metadata.json deleted file mode 100644 index 99ee2e86b..000000000 --- a/dist/collections/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./message/index"},{"from":"./pagination/index"}]}] \ No newline at end of file diff --git a/dist/collections/message/components/message.d.ts b/dist/collections/message/components/message.d.ts deleted file mode 100644 index 76b3bce61..000000000 --- a/dist/collections/message/components/message.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { EventEmitter } from "@angular/core"; -import { TransitionController } from "../../../modules/transition/index"; -export interface IMessage { - dismiss(): void; -} -export declare class SuiMessage implements IMessage { - isDismissable: boolean; - onDismiss: EventEmitter; - isDismissed: boolean; - transitionController: TransitionController; - transition: string; - transitionDuration: number; - class: string; - constructor(); - dismiss(): void; -} diff --git a/dist/collections/message/components/message.js b/dist/collections/message/components/message.js deleted file mode 100644 index 01b4e3de4..000000000 --- a/dist/collections/message/components/message.js +++ /dev/null @@ -1,39 +0,0 @@ -import { Component, Input, Output, EventEmitter } from "@angular/core"; -import { TransitionController, Transition, TransitionDirection } from "../../../modules/transition/index"; -var SuiMessage = /** @class */ (function () { - function SuiMessage() { - this.isDismissable = true; - this.onDismiss = new EventEmitter(); - this.isDismissed = false; - this.transitionController = new TransitionController(); - this.transition = "fade"; - this.transitionDuration = 300; - this.class = ""; - } - SuiMessage.prototype.dismiss = function () { - var _this = this; - this.transitionController.animate(new Transition(this.transition, this.transitionDuration, TransitionDirection.Out, function () { - _this.isDismissed = true; - _this.onDismiss.emit(_this); - })); - }; - SuiMessage.decorators = [ - { type: Component, args: [{ - selector: "sui-message", - template: "\n
\n \n \n
\n", - styles: ["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiMessage.ctorParameters = function () { return []; }; - SuiMessage.propDecorators = { - "isDismissable": [{ type: Input },], - "onDismiss": [{ type: Output, args: ["dismiss",] },], - "transition": [{ type: Input },], - "transitionDuration": [{ type: Input },], - "class": [{ type: Input, args: ["class",] },], - }; - return SuiMessage; -}()); -export { SuiMessage }; -//# sourceMappingURL=message.js.map \ No newline at end of file diff --git a/dist/collections/message/components/message.js.map b/dist/collections/message/components/message.js.map deleted file mode 100644 index 5d47d1766..000000000 --- a/dist/collections/message/components/message.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../src/collections/message/components/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;;IAyCtG;QACI,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAc,CAAC;QAEhD,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAEzB,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACvD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC;QAE9B,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;KACnB;IAEM,4BAAO,GAAd;QAAA,iBAKC;QAJG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,GAAG,EAAE;YAChH,KAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;SAC7B,CAAC,CAAC,CAAC;KACP;;gBArDJ,SAAS,SAAC;oBACP,QAAQ,EAAE,aAAa;oBACvB,QAAQ,EAAE,mOAKb;oBACG,MAAM,EAAE,CAAC,yFAKZ,CAAC;iBACD;;;;;kCAEI,KAAK;8BAGL,MAAM,SAAC,SAAS;+BAOhB,KAAK;uCAGL,KAAK;0BAGL,KAAK,SAAC,OAAO;;qBAvClB;;SAsBa,UAAU","sourcesContent":["import { Component, Input, Output, EventEmitter } from \"@angular/core\";\nimport { TransitionController, Transition, TransitionDirection } from \"../../../modules/transition/index\";\n\nexport interface IMessage {\n dismiss():void;\n}\n\n@Component({\n selector: \"sui-message\",\n template: `\n
\n \n \n
\n`,\n styles: [`\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n`]\n})\nexport class SuiMessage implements IMessage {\n @Input()\n public isDismissable:boolean;\n\n @Output(\"dismiss\")\n public onDismiss:EventEmitter;\n\n public isDismissed:boolean;\n\n public transitionController:TransitionController;\n\n @Input()\n public transition:string;\n\n @Input()\n public transitionDuration:number;\n\n @Input(\"class\")\n public class:string;\n\n constructor() {\n this.isDismissable = true;\n this.onDismiss = new EventEmitter();\n\n this.isDismissed = false;\n\n this.transitionController = new TransitionController();\n this.transition = \"fade\";\n this.transitionDuration = 300;\n\n this.class = \"\";\n }\n\n public dismiss():void {\n this.transitionController.animate(new Transition(this.transition, this.transitionDuration, TransitionDirection.Out, () => {\n this.isDismissed = true;\n this.onDismiss.emit(this);\n }));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/collections/message/components/message.metadata.json b/dist/collections/message/components/message.metadata.json deleted file mode 100644 index 390b2d775..000000000 --- a/dist/collections/message/components/message.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"IMessage":{"__symbolic":"interface"},"SuiMessage":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":7,"character":1},"arguments":[{"selector":"sui-message","template":"\n
\n \n \n
\n","styles":["\n/* Fix for CSS Bug */\n.ui.icon.visible.message {\n display: flex !important;\n}\n"]}]}],"members":{"isDismissable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":5}}]}],"onDismiss":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":26,"character":5},"arguments":["dismiss"]}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":5}}]}],"class":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":5},"arguments":["class"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"dismiss":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/collections/message/index.d.ts b/dist/collections/message/index.d.ts deleted file mode 100644 index dc2eb4437..000000000 --- a/dist/collections/message/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./components/message"; -export * from "./message.module"; diff --git a/dist/collections/message/index.js b/dist/collections/message/index.js deleted file mode 100644 index 90e277c2a..000000000 --- a/dist/collections/message/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./components/message"; -export * from "./message.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/collections/message/index.js.map b/dist/collections/message/index.js.map deleted file mode 100644 index a52e4291d..000000000 --- a/dist/collections/message/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/collections/message/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AAErC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from \"./components/message\";\n\nexport * from \"./message.module\";\n"]} \ No newline at end of file diff --git a/dist/collections/message/index.metadata.json b/dist/collections/message/index.metadata.json deleted file mode 100644 index edd21452c..000000000 --- a/dist/collections/message/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/message"},{"from":"./message.module"}]}] \ No newline at end of file diff --git a/dist/collections/message/message.module.d.ts b/dist/collections/message/message.module.d.ts deleted file mode 100644 index 83dd26826..000000000 --- a/dist/collections/message/message.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiMessageModule { -} diff --git a/dist/collections/message/message.module.js b/dist/collections/message/message.module.js deleted file mode 100644 index 320fac44d..000000000 --- a/dist/collections/message/message.module.js +++ /dev/null @@ -1,27 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiTransitionModule } from "../../modules/transition/index"; -import { SuiMessage } from "./components/message"; -var SuiMessageModule = /** @class */ (function () { - function SuiMessageModule() { - } - SuiMessageModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule, - SuiTransitionModule - ], - declarations: [ - SuiMessage - ], - exports: [ - SuiMessage - ] - },] }, - ]; - /** @nocollapse */ - SuiMessageModule.ctorParameters = function () { return []; }; - return SuiMessageModule; -}()); -export { SuiMessageModule }; -//# sourceMappingURL=message.module.js.map \ No newline at end of file diff --git a/dist/collections/message/message.module.js.map b/dist/collections/message/message.module.js.map deleted file mode 100644 index 17b5a3d62..000000000 --- a/dist/collections/message/message.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.module.js","sourceRoot":"","sources":["../../../src/collections/message/message.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;;;;;gBAEjD,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,mBAAmB;qBACtB;oBACD,YAAY,EAAE;wBACV,UAAU;qBACb;oBACD,OAAO,EAAE;wBACL,UAAU;qBACb;iBACJ;;;;2BAhBD;;SAiBa,gBAAgB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTransitionModule } from \"../../modules/transition/index\";\nimport { SuiMessage } from \"./components/message\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiTransitionModule\n ],\n declarations: [\n SuiMessage\n ],\n exports: [\n SuiMessage\n ]\n})\nexport class SuiMessageModule {}\n"]} \ No newline at end of file diff --git a/dist/collections/message/message.module.metadata.json b/dist/collections/message/message.module.metadata.json deleted file mode 100644 index 2f2ac4a0e..000000000 --- a/dist/collections/message/message.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiMessageModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":7,"character":8},{"__symbolic":"reference","module":"../../modules/transition/index","name":"SuiTransitionModule","line":8,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/message","name":"SuiMessage","line":11,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/message","name":"SuiMessage","line":14,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/collections/message/public.d.ts b/dist/collections/message/public.d.ts deleted file mode 100644 index 6b81037a1..000000000 --- a/dist/collections/message/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiMessageModule, IMessage } from "./index"; diff --git a/dist/collections/message/public.js b/dist/collections/message/public.js deleted file mode 100644 index aa4fef653..000000000 --- a/dist/collections/message/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiMessageModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/collections/message/public.js.map b/dist/collections/message/public.js.map deleted file mode 100644 index fb3925c1b..000000000 --- a/dist/collections/message/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/collections/message/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAEnB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiMessageModule,\n IMessage\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/collections/message/public.metadata.json b/dist/collections/message/public.metadata.json deleted file mode 100644 index c1e7ea4eb..000000000 --- a/dist/collections/message/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiMessageModule","IMessage"]}]}] \ No newline at end of file diff --git a/dist/collections/pagination/components/pagination.d.ts b/dist/collections/pagination/components/pagination.d.ts deleted file mode 100644 index 61ffa7ab5..000000000 --- a/dist/collections/pagination/components/pagination.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { OnChanges, EventEmitter } from "@angular/core"; -export declare class SuiPagination implements OnChanges { - private _paginationClasses; - pageCount: number; - pageChange: EventEmitter; - private _maxSize?; - private _collectionSize; - private _page; - private _pages; - private _hasNavigationLinks; - maxSize: number | undefined; - pageSize: number; - collectionSize: number; - hasNavigationLinks: boolean; - hasBoundaryLinks: boolean; - canRotate: boolean; - hasEllipses: boolean; - page: number; - readonly pages: number[]; - constructor(); - hasPrevious(): boolean; - hasNext(): boolean; - setPage(newPage: number): void; - ngOnChanges(): void; - private updatePages(); - private applyPagination(); -} diff --git a/dist/collections/pagination/components/pagination.js b/dist/collections/pagination/components/pagination.js deleted file mode 100644 index 18a89250a..000000000 --- a/dist/collections/pagination/components/pagination.js +++ /dev/null @@ -1,148 +0,0 @@ -import { Component, Input, Output, EventEmitter, HostBinding } from "@angular/core"; -var SuiPagination = /** @class */ (function () { - function SuiPagination() { - this._paginationClasses = true; - this.pageChange = new EventEmitter(); - this.pageSize = 10; - this._page = 1; - this._pages = []; - this.pageCount = 1; - this.hasNavigationLinks = true; - this.hasBoundaryLinks = false; - this.canRotate = false; - this.hasEllipses = true; - } - Object.defineProperty(SuiPagination.prototype, "maxSize", { - get: function () { - return this._maxSize; - }, - set: function (value) { - this._maxSize = (value != undefined) ? Math.max(value, 1) : undefined; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPagination.prototype, "collectionSize", { - get: function () { - return this._collectionSize; - }, - set: function (value) { - this._collectionSize = Math.max(value, 0); - this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize)); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPagination.prototype, "hasNavigationLinks", { - get: function () { - var maxSize = this._maxSize || this.pageCount; - return this._hasNavigationLinks || maxSize < this.pageCount; - }, - set: function (value) { - this._hasNavigationLinks = value; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPagination.prototype, "page", { - get: function () { - return this._page; - }, - set: function (value) { - this.setPage(value); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPagination.prototype, "pages", { - get: function () { - return this._pages; - }, - enumerable: true, - configurable: true - }); - // Public methods - // Public methods - SuiPagination.prototype.hasPrevious = - // Public methods - function () { - return this.page > 1; - }; - SuiPagination.prototype.hasNext = function () { - return this.page < this.pageCount; - }; - SuiPagination.prototype.setPage = function (newPage) { - var value = (Number.isInteger(newPage)) ? Math.min(Math.max(newPage, 1), this.pageCount) : 1; - if (value !== this._page) { - this._page = value; - this.pageChange.emit(this._page); - } - }; - // Lifecycle hooks - // Lifecycle hooks - SuiPagination.prototype.ngOnChanges = - // Lifecycle hooks - function () { - this.updatePages(); - }; - // Private methods - // Private methods - SuiPagination.prototype.updatePages = - // Private methods - function () { - this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize)); - var _a = this.applyPagination(), start = _a[0], end = _a[1]; - this._pages = Array(end - start) - .fill(start + 1) - .map(function (s, i) { return s + i; }); - }; - SuiPagination.prototype.applyPagination = function () { - var maxSize = (this.maxSize != undefined) ? Math.min(this.maxSize, this.pageCount) : this.pageCount; - var page = Math.ceil(this.page / maxSize) - 1; - var start = 0; - var end = this.pageCount; - if (this.canRotate) { - var leftOffset = Math.floor(maxSize / 2); - var rightOffset = maxSize % 2 === 0 ? leftOffset - 1 : leftOffset; - if (this.page <= leftOffset) { - end = maxSize; - } - else if (this.pageCount - this.page < leftOffset) { - start = this.pageCount - maxSize; - } - else { - start = this.page - leftOffset - 1; - end = this.page + rightOffset; - } - } - else { - start = page * maxSize; - end = start + maxSize; - } - return [start, Math.min(end, this.pageCount)]; - }; - SuiPagination.decorators = [ - { type: Component, args: [{ - selector: "sui-pagination", - template: "\n\n \n\n\n \n\n\n \n 1\n \n 2\">...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n", - styles: ["\n:host .item {\n transition: none;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiPagination.ctorParameters = function () { return []; }; - SuiPagination.propDecorators = { - "_paginationClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.pagination",] }, { type: HostBinding, args: ["class.menu",] },], - "pageChange": [{ type: Output },], - "maxSize": [{ type: Input },], - "pageSize": [{ type: Input },], - "collectionSize": [{ type: Input },], - "hasNavigationLinks": [{ type: Input },], - "hasBoundaryLinks": [{ type: Input },], - "canRotate": [{ type: Input },], - "hasEllipses": [{ type: Input },], - "page": [{ type: Input },], - }; - return SuiPagination; -}()); -export { SuiPagination }; -//# sourceMappingURL=pagination.js.map \ No newline at end of file diff --git a/dist/collections/pagination/components/pagination.js.map b/dist/collections/pagination/components/pagination.js.map deleted file mode 100644 index a3fb1ee02..000000000 --- a/dist/collections/pagination/components/pagination.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../../src/collections/pagination/components/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAa,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;IAiH3F;QACI,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,YAAY,EAAU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G,IAAI,GAAG,OAAO,CAAC;YACvB,GAAG,GAAG,KAAK,GAAG,OAAO,CAAC;SACzB;QAED,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;KACjD;;gBAvLJ,SAAS,SAAC;oBACP,QAAQ,EAAE,gBAAgB;oBAC1B,QAAQ,EAAE,gzCA4Bb;oBACG,MAAM,EAAE,CAAC,6CAIZ,CAAC;iBACD;;;;;uCAGI,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,kBAAkB,cAC9B,WAAW,SAAC,YAAY;+BAMxB,MAAM;4BAUN,KAAK;6BASL,KAAK;mCAGL,KAAK;uCAUL,KAAK;qCAUL,KAAK;8BAGL,KAAK;gCAGL,KAAK;yBAGL,KAAK;;wBApGV;;SAuCa,aAAa","sourcesContent":["import { Component, Input, Output, OnChanges, EventEmitter, HostBinding } from \"@angular/core\";\n\n@Component({\n selector: \"sui-pagination\",\n template: `\n\n \n\n\n \n\n\n \n 1\n \n 2\">...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n`,\n styles: [`\n:host .item {\n transition: none;\n}\n`]\n})\nexport class SuiPagination implements OnChanges {\n\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.pagination\")\n @HostBinding(\"class.menu\")\n private _paginationClasses:boolean;\n\n // Public members\n public pageCount:number;\n\n @Output()\n public pageChange:EventEmitter;\n\n // Private members\n private _maxSize?:number;\n private _collectionSize:number;\n private _page:number;\n private _pages:number[];\n private _hasNavigationLinks:boolean;\n\n @Input()\n public get maxSize():number|undefined {\n return this._maxSize;\n }\n\n public set maxSize(value:number | undefined) {\n this._maxSize = (value != undefined) ? Math.max(value, 1) : undefined;\n }\n\n @Input()\n public pageSize:number;\n\n @Input()\n public get collectionSize():number {\n return this._collectionSize;\n }\n\n public set collectionSize(value:number) {\n this._collectionSize = Math.max(value, 0);\n this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize));\n }\n\n @Input()\n public get hasNavigationLinks():boolean {\n const maxSize = this._maxSize || this.pageCount;\n return this._hasNavigationLinks || maxSize < this.pageCount;\n }\n\n public set hasNavigationLinks(value:boolean) {\n this._hasNavigationLinks = value;\n }\n\n @Input()\n public hasBoundaryLinks:boolean;\n\n @Input()\n public canRotate:boolean;\n\n @Input()\n public hasEllipses:boolean;\n\n @Input()\n public get page():number {\n return this._page;\n }\n\n public set page(value:number) {\n this.setPage(value);\n }\n\n public get pages():number[] {\n return this._pages;\n }\n\n constructor() {\n this._paginationClasses = true;\n this.pageChange = new EventEmitter();\n\n this.pageSize = 10;\n this._page = 1;\n this._pages = [];\n this.pageCount = 1;\n this.hasNavigationLinks = true;\n this.hasBoundaryLinks = false;\n this.canRotate = false;\n this.hasEllipses = true;\n }\n\n // Public methods\n public hasPrevious():boolean {\n return this.page > 1;\n }\n\n public hasNext():boolean {\n return this.page < this.pageCount;\n }\n\n public setPage(newPage:number):void {\n const value:number = (Number.isInteger(newPage)) ? Math.min(Math.max(newPage, 1), this.pageCount) : 1;\n if (value !== this._page) {\n this._page = value;\n this.pageChange.emit(this._page);\n }\n }\n\n // Lifecycle hooks\n public ngOnChanges():void {\n this.updatePages();\n }\n\n // Private methods\n private updatePages():void {\n this.pageCount = Math.max(1, Math.ceil(this._collectionSize / this.pageSize));\n\n const [start, end] = this.applyPagination();\n\n this._pages = Array(end - start)\n .fill(start + 1)\n .map((s, i) => s + i);\n }\n\n private applyPagination():[number, number] {\n const maxSize = (this.maxSize != undefined) ? Math.min(this.maxSize, this.pageCount) : this.pageCount;\n\n const page = Math.ceil(this.page / maxSize) - 1;\n let start = 0;\n let end = this.pageCount;\n\n if (this.canRotate) {\n const leftOffset = Math.floor(maxSize / 2);\n const rightOffset = maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;\n\n if (this.page <= leftOffset) {\n end = maxSize;\n } else if (this.pageCount - this.page < leftOffset) {\n start = this.pageCount - maxSize;\n } else {\n start = this.page - leftOffset - 1;\n end = this.page + rightOffset;\n }\n } else {\n start = page * maxSize;\n end = start + maxSize;\n }\n\n return [start, Math.min(end, this.pageCount)];\n }\n}\n"]} \ No newline at end of file diff --git a/dist/collections/pagination/components/pagination.metadata.json b/dist/collections/pagination/components/pagination.metadata.json deleted file mode 100644 index 8661ff0cf..000000000 --- a/dist/collections/pagination/components/pagination.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiPagination":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"sui-pagination","template":"\n\n \n\n\n \n\n\n \n 1\n \n 2\">...\n\n\n {{ p }}\n\n\n ...\n \n {{ pageCount }}\n \n\n\n \n\n\n \n\n","styles":["\n:host .item {\n transition: none;\n}\n"]}]}],"members":{"_paginationClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":41,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":42,"character":5},"arguments":["class.pagination"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":43,"character":5},"arguments":["class.menu"]}]}],"pageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":49,"character":5}}]}],"maxSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":5}}]}],"pageSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":5}}]}],"collectionSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":71,"character":5}}]}],"hasNavigationLinks":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":81,"character":5}}]}],"hasBoundaryLinks":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":91,"character":5}}]}],"canRotate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":94,"character":5}}]}],"hasEllipses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":97,"character":5}}]}],"page":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":100,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor"}],"hasPrevious":[{"__symbolic":"method"}],"hasNext":[{"__symbolic":"method"}],"setPage":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"updatePages":[{"__symbolic":"method"}],"applyPagination":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/collections/pagination/index.d.ts b/dist/collections/pagination/index.d.ts deleted file mode 100644 index 53656f8ca..000000000 --- a/dist/collections/pagination/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./components/pagination"; -export * from "./pagination.module"; diff --git a/dist/collections/pagination/index.js b/dist/collections/pagination/index.js deleted file mode 100644 index 6bb26c5c5..000000000 --- a/dist/collections/pagination/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./components/pagination"; -export * from "./pagination.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/collections/pagination/index.js.map b/dist/collections/pagination/index.js.map deleted file mode 100644 index 6ad1765ee..000000000 --- a/dist/collections/pagination/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/collections/pagination/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AAExC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./components/pagination\";\n\nexport * from \"./pagination.module\";\n"]} \ No newline at end of file diff --git a/dist/collections/pagination/index.metadata.json b/dist/collections/pagination/index.metadata.json deleted file mode 100644 index ccda0463a..000000000 --- a/dist/collections/pagination/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/pagination"},{"from":"./pagination.module"}]}] \ No newline at end of file diff --git a/dist/collections/pagination/pagination.module.d.ts b/dist/collections/pagination/pagination.module.d.ts deleted file mode 100644 index d5d66e9b1..000000000 --- a/dist/collections/pagination/pagination.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiPaginationModule { -} diff --git a/dist/collections/pagination/pagination.module.js b/dist/collections/pagination/pagination.module.js deleted file mode 100644 index d64e0e8e6..000000000 --- a/dist/collections/pagination/pagination.module.js +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiPagination } from "./components/pagination"; -var SuiPaginationModule = /** @class */ (function () { - function SuiPaginationModule() { - } - SuiPaginationModule.decorators = [ - { type: NgModule, args: [{ - imports: [CommonModule], - exports: [SuiPagination], - declarations: [SuiPagination], - providers: [] - },] }, - ]; - /** @nocollapse */ - SuiPaginationModule.ctorParameters = function () { return []; }; - return SuiPaginationModule; -}()); -export { SuiPaginationModule }; -//# sourceMappingURL=pagination.module.js.map \ No newline at end of file diff --git a/dist/collections/pagination/pagination.module.js.map b/dist/collections/pagination/pagination.module.js.map deleted file mode 100644 index 19b1a310b..000000000 --- a/dist/collections/pagination/pagination.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.module.js","sourceRoot":"","sources":["../../../src/collections/pagination/pagination.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;;;;;gBAEvD,QAAQ,SAAC;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,YAAY,EAAE,CAAC,aAAa,CAAC;oBAC7B,SAAS,EAAE,EAAE;iBAChB;;;;8BAVD;;SAWa,mBAAmB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { SuiPagination } from \"./components/pagination\";\n\n@NgModule({\n imports: [CommonModule],\n exports: [SuiPagination],\n declarations: [SuiPagination],\n providers: []\n})\nexport class SuiPaginationModule { }\n"]} \ No newline at end of file diff --git a/dist/collections/pagination/pagination.module.metadata.json b/dist/collections/pagination/pagination.module.metadata.json deleted file mode 100644 index 56a2ce555..000000000 --- a/dist/collections/pagination/pagination.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiPaginationModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":14}],"exports":[{"__symbolic":"reference","module":"./components/pagination","name":"SuiPagination","line":7,"character":14}],"declarations":[{"__symbolic":"reference","module":"./components/pagination","name":"SuiPagination","line":8,"character":19}],"providers":[]}]}]}}}] \ No newline at end of file diff --git a/dist/collections/pagination/public.d.ts b/dist/collections/pagination/public.d.ts deleted file mode 100644 index be68cb0b4..000000000 --- a/dist/collections/pagination/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiPaginationModule } from "./index"; diff --git a/dist/collections/pagination/public.js b/dist/collections/pagination/public.js deleted file mode 100644 index 8dfdda395..000000000 --- a/dist/collections/pagination/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiPaginationModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/collections/pagination/public.js.map b/dist/collections/pagination/public.js.map deleted file mode 100644 index 59eddc086..000000000 --- a/dist/collections/pagination/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/collections/pagination/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACtB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiPaginationModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/collections/pagination/public.metadata.json b/dist/collections/pagination/public.metadata.json deleted file mode 100644 index 32763abfe..000000000 --- a/dist/collections/pagination/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiPaginationModule"]}]}] \ No newline at end of file diff --git a/dist/collections/public.d.ts b/dist/collections/public.d.ts deleted file mode 100644 index ff35fd1e6..000000000 --- a/dist/collections/public.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./message/public"; -export * from "./pagination/public"; diff --git a/dist/collections/public.js b/dist/collections/public.js deleted file mode 100644 index 75430a00f..000000000 --- a/dist/collections/public.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./message/public"; -export * from "./pagination/public"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/collections/public.js.map b/dist/collections/public.js.map deleted file mode 100644 index 10e8bb7d0..000000000 --- a/dist/collections/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/collections/public.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./message/public\";\nexport * from \"./pagination/public\";\n"]} \ No newline at end of file diff --git a/dist/collections/public.metadata.json b/dist/collections/public.metadata.json deleted file mode 100644 index f028491dd..000000000 --- a/dist/collections/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./message/public"},{"from":"./pagination/public"}]}] \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 2274a9c08..000000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./behaviors/index"; -export * from "./collections/index"; -export * from "./modules/index"; -export * from "./misc/index"; -export * from "./sui.module"; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d12ac7275..000000000 --- a/dist/index.js +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./behaviors/index"; -export * from "./collections/index"; -export * from "./modules/index"; -export * from "./misc/index"; -export * from "./sui.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index 31ce3a474..000000000 --- a/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC","sourcesContent":["export * from \"./behaviors/index\";\nexport * from \"./collections/index\";\nexport * from \"./modules/index\";\n\nexport * from \"./misc/index\";\nexport * from \"./sui.module\";\n"]} \ No newline at end of file diff --git a/dist/index.metadata.json b/dist/index.metadata.json deleted file mode 100644 index 0b566f23b..000000000 --- a/dist/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./behaviors/index"},{"from":"./collections/index"},{"from":"./modules/index"},{"from":"./misc/index"},{"from":"./sui.module"}]}] \ No newline at end of file diff --git a/dist/karma.conf.d.ts b/dist/karma.conf.d.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/dist/karma.conf.js b/dist/karma.conf.js deleted file mode 100644 index 2b8b7fc86..000000000 --- a/dist/karma.conf.js +++ /dev/null @@ -1,36 +0,0 @@ -// Karma configuration file, see link for more information -// https://karma-runner.github.io/0.13/config/configuration-file.html -//tslint:disable -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular/cli'], - plugins: [ - require('karma-jasmine'), - require('karma-phantomjs-launcher'), - require('karma-chrome-launcher'), - require('karma-min-reporter'), - require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), - require('@angular/cli/plugins/karma') - ], - client: { - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - angularCli: { - environment: 'dev' - }, - reporters: ['min'], - coverageIstanbulReporter: { - reports: ['html', 'text-summary'], - fixWebpackSourcePaths: true - }, - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['PhantomJS'], - singleRun: true - }); -}; -//# sourceMappingURL=karma.conf.js.map \ No newline at end of file diff --git a/dist/karma.conf.js.map b/dist/karma.conf.js.map deleted file mode 100644 index 862bdeb9d..000000000 --- a/dist/karma.conf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"karma.conf.js","sourceRoot":"","sources":["../src/karma.conf.ts"],"names":[],"mappings":";;;AAKA,MAAM,CAAC,OAAO,GAAG,UAAC,MAAU;IAC1B,MAAM,CAAC,GAAG,CAAC;QACT,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC;QACvC,OAAO,EAAE;YACP,OAAO,CAAC,eAAe,CAAC;YACxB,OAAO,CAAC,0BAA0B,CAAC;YACnC,OAAO,CAAC,uBAAuB,CAAC;YAChC,OAAO,CAAC,oBAAoB,CAAC;YAC7B,OAAO,CAAC,6BAA6B,CAAC;YACtC,OAAO,CAAC,kCAAkC,CAAC;YAC3C,OAAO,CAAC,4BAA4B,CAAC;SACtC;QACD,MAAM,EAAC;YACL,YAAY,EAAE,KAAK;SACpB;QACD,UAAU,EAAE;YACV,WAAW,EAAE,KAAK;SACnB;QACD,SAAS,EAAE,CAAC,KAAK,CAAC;QAClB,wBAAwB,EAAE;YACxB,OAAO,EAAE,CAAE,MAAM,EAAE,cAAc,CAAE;YACnC,qBAAqB,EAAE,IAAI;SAC5B;QACD,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,CAAC,WAAW,CAAC;QACvB,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;CACJ,CAAA","sourcesContent":["// Karma configuration file, see link for more information\n// https://karma-runner.github.io/0.13/config/configuration-file.html\n\n//tslint:disable\n\nmodule.exports = (config:any) => {\n config.set({\n basePath: '',\n frameworks: ['jasmine', '@angular/cli'],\n plugins: [\n require('karma-jasmine'),\n require('karma-phantomjs-launcher'),\n require('karma-chrome-launcher'),\n require('karma-min-reporter'),\n require('karma-jasmine-html-reporter'),\n require('karma-coverage-istanbul-reporter'),\n require('@angular/cli/plugins/karma')\n ],\n client:{\n clearContext: false // leave Jasmine Spec Runner output visible in browser\n },\n angularCli: {\n environment: 'dev'\n },\n reporters: ['min'],\n coverageIstanbulReporter: {\n reports: [ 'html', 'text-summary' ],\n fixWebpackSourcePaths: true\n },\n port: 9876,\n colors: true,\n logLevel: config.LOG_INFO,\n autoWatch: true,\n browsers: ['PhantomJS'],\n singleRun: true\n });\n}\n"]} \ No newline at end of file diff --git a/dist/misc/index.d.ts b/dist/misc/index.d.ts deleted file mode 100644 index 2dd8370cf..000000000 --- a/dist/misc/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./util/index"; diff --git a/dist/misc/index.js b/dist/misc/index.js deleted file mode 100644 index c03c028d1..000000000 --- a/dist/misc/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./util/index"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/misc/index.js.map b/dist/misc/index.js.map deleted file mode 100644 index 6dc46c29a..000000000 --- a/dist/misc/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/misc/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC","sourcesContent":["export * from \"./util/index\";\n"]} \ No newline at end of file diff --git a/dist/misc/index.metadata.json b/dist/misc/index.metadata.json deleted file mode 100644 index 3ddd5cd98..000000000 --- a/dist/misc/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./util/index"}]}] \ No newline at end of file diff --git a/dist/misc/public.d.ts b/dist/misc/public.d.ts deleted file mode 100644 index 5cce5192f..000000000 --- a/dist/misc/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./util/public"; diff --git a/dist/misc/public.js b/dist/misc/public.js deleted file mode 100644 index f9b299234..000000000 --- a/dist/misc/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./util/public"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/misc/public.js.map b/dist/misc/public.js.map deleted file mode 100644 index f1e93dedb..000000000 --- a/dist/misc/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/misc/public.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC","sourcesContent":["export * from \"./util/public\";\n"]} \ No newline at end of file diff --git a/dist/misc/public.metadata.json b/dist/misc/public.metadata.json deleted file mode 100644 index 895c7107e..000000000 --- a/dist/misc/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./util/public"}]}] \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-validator.d.ts b/dist/misc/util/helpers/custom-validator.d.ts deleted file mode 100644 index 59a9a2fc3..000000000 --- a/dist/misc/util/helpers/custom-validator.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AbstractControl, ValidationErrors, Validator } from "@angular/forms"; -import { InjectionToken, Type } from "@angular/core"; -export interface ICustomValidatorHost { - validate(c: AbstractControl): ValidationErrors | null; -} -export declare class CustomValidator implements Validator { - private _host; - constructor(_host: T); - onValidatorChange: () => void; - validate(c: AbstractControl): ValidationErrors | null; - registerOnValidatorChange(fn: () => void): void; -} -export interface IValidationProvider { - provide: InjectionToken<(Function | Validator)[]>; - useExisting: Type; - multi: boolean; -} -export declare function customValidatorFactory(type: Function): IValidationProvider; diff --git a/dist/misc/util/helpers/custom-validator.js b/dist/misc/util/helpers/custom-validator.js deleted file mode 100644 index c43984c20..000000000 --- a/dist/misc/util/helpers/custom-validator.js +++ /dev/null @@ -1,24 +0,0 @@ -import { NG_VALIDATORS } from "@angular/forms"; -import { forwardRef } from "@angular/core"; -var CustomValidator = /** @class */ (function () { - function CustomValidator(_host) { - this._host = _host; - this.onValidatorChange = function () { }; - } - CustomValidator.prototype.validate = function (c) { - return this._host.validate(c); - }; - CustomValidator.prototype.registerOnValidatorChange = function (fn) { - this.onValidatorChange = fn; - }; - return CustomValidator; -}()); -export { CustomValidator }; -export function customValidatorFactory(type) { - return { - provide: NG_VALIDATORS, - useExisting: forwardRef(function () { return type; }), - multi: true - }; -} -//# sourceMappingURL=custom-validator.js.map \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-validator.js.map b/dist/misc/util/helpers/custom-validator.js.map deleted file mode 100644 index 7b344913c..000000000 --- a/dist/misc/util/helpers/custom-validator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"custom-validator.js","sourceRoot":"","sources":["../../../../src/misc/util/helpers/custom-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgD,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAwB,MAAM,eAAe,CAAC;AAMjE,IAAA;IACI,yBAAoB,KAAO;QAAP,UAAK,GAAL,KAAK,CAAE;iCAEA,eAAQ;KAFJ;IAIxB,kCAAQ,GAAf,UAAgB,CAAiB;QAC7B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;KACjC;IAEM,mDAAyB,GAAhC,UAAiC,EAAa;QAC1C,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;KAC/B;0BAlBL;IAmBC,CAAA;AAZD,2BAYC;AAQD,MAAM,iCAAiC,IAAa;IAChD,MAAM,CAAC;QACH,OAAO,EAAE,aAAa;QACtB,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;QACnC,KAAK,EAAE,IAAI;KACd,CAAC;CACL","sourcesContent":["import { NG_VALIDATORS, AbstractControl, ValidationErrors, Validator } from \"@angular/forms\";\nimport { forwardRef, InjectionToken, Type } from \"@angular/core\";\n\nexport interface ICustomValidatorHost {\n validate(c:AbstractControl):ValidationErrors | null;\n}\n\nexport class CustomValidator implements Validator {\n constructor(private _host:T) {}\n\n public onValidatorChange = () => {};\n\n public validate(c:AbstractControl):ValidationErrors | null {\n return this._host.validate(c);\n }\n\n public registerOnValidatorChange(fn:() => void):void {\n this.onValidatorChange = fn;\n }\n}\n\nexport interface IValidationProvider {\n provide:InjectionToken<(Function | Validator)[]>;\n useExisting:Type;\n multi:boolean;\n}\n\nexport function customValidatorFactory(type:Function):IValidationProvider {\n return {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => type),\n multi: true\n };\n}\n"]} \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-validator.metadata.json b/dist/misc/util/helpers/custom-validator.metadata.json deleted file mode 100644 index ae709776f..000000000 --- a/dist/misc/util/helpers/custom-validator.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"ICustomValidatorHost":{"__symbolic":"interface"},"CustomValidator":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":8,"character":30,"context":{"typeName":"T"}}]}],"validate":[{"__symbolic":"method"}],"registerOnValidatorChange":[{"__symbolic":"method"}]}},"IValidationProvider":{"__symbolic":"interface"},"customValidatorFactory":{"__symbolic":"function","parameters":["type"],"value":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALIDATORS","line":29,"character":17},"useExisting":{"__symbolic":"reference","name":"type"},"multi":true}}}}] \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-value-accessor.d.ts b/dist/misc/util/helpers/custom-value-accessor.d.ts deleted file mode 100644 index 961cafcc7..000000000 --- a/dist/misc/util/helpers/custom-value-accessor.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { ControlValueAccessor } from "@angular/forms"; -import { InjectionToken, Type } from "@angular/core"; -export interface ICustomValueAccessorHost { - writeValue(value: T): void; -} -export declare class CustomValueAccessor> implements ControlValueAccessor { - private _host; - constructor(_host: T); - onChange: () => void; - onTouched: () => void; - writeValue(value: U): void; - registerOnChange(fn: () => void): void; - registerOnTouched(fn: () => void): void; -} -export interface IValueAccessorProvider { - provide: InjectionToken; - useExisting: Type; - multi: boolean; -} -export declare function customValueAccessorFactory(type: Function): IValueAccessorProvider; diff --git a/dist/misc/util/helpers/custom-value-accessor.js b/dist/misc/util/helpers/custom-value-accessor.js deleted file mode 100644 index 38fec4488..000000000 --- a/dist/misc/util/helpers/custom-value-accessor.js +++ /dev/null @@ -1,28 +0,0 @@ -import { NG_VALUE_ACCESSOR } from "@angular/forms"; -import { forwardRef } from "@angular/core"; -var CustomValueAccessor = /** @class */ (function () { - function CustomValueAccessor(_host) { - this._host = _host; - this.onChange = function () { }; - this.onTouched = function () { }; - } - CustomValueAccessor.prototype.writeValue = function (value) { - this._host.writeValue(value); - }; - CustomValueAccessor.prototype.registerOnChange = function (fn) { - this.onChange = fn; - }; - CustomValueAccessor.prototype.registerOnTouched = function (fn) { - this.onTouched = fn; - }; - return CustomValueAccessor; -}()); -export { CustomValueAccessor }; -export function customValueAccessorFactory(type) { - return { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(function () { return type; }), - multi: true - }; -} -//# sourceMappingURL=custom-value-accessor.js.map \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-value-accessor.js.map b/dist/misc/util/helpers/custom-value-accessor.js.map deleted file mode 100644 index f46038eb1..000000000 --- a/dist/misc/util/helpers/custom-value-accessor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"custom-value-accessor.js","sourceRoot":"","sources":["../../../../src/misc/util/helpers/custom-value-accessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAwB,MAAM,eAAe,CAAC;AAMjE,IAAA;IACI,6BAAoB,KAAO;QAAP,UAAK,GAAL,KAAK,CAAE;wBAET,eAAQ;yBACP,eAAQ;KAHI;IAKxB,wCAAU,GAAjB,UAAkB,KAAO;QACrB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;KAChC;IAEM,8CAAgB,GAAvB,UAAwB,EAAa;QACjC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;KACtB;IAEM,+CAAiB,GAAxB,UAAyB,EAAa;QAClC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;KACvB;8BAvBL;IAwBC,CAAA;AAjBD,+BAiBC;AAQD,MAAM,qCAAqC,IAAa;IACpD,MAAM,CAAC;QACH,OAAO,EAAE,iBAAiB;QAC1B,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;QACnC,KAAK,EAAE,IAAI;KACd,CAAC;CACL","sourcesContent":["import { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\nimport { forwardRef, InjectionToken, Type } from \"@angular/core\";\n\nexport interface ICustomValueAccessorHost {\n writeValue(value:T):void;\n}\n\nexport class CustomValueAccessor> implements ControlValueAccessor {\n constructor(private _host:T) {}\n\n public onChange = () => {};\n public onTouched = () => {};\n\n public writeValue(value:U):void {\n this._host.writeValue(value);\n }\n\n public registerOnChange(fn:() => void):void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn:() => void):void {\n this.onTouched = fn;\n }\n}\n\nexport interface IValueAccessorProvider {\n provide:InjectionToken;\n useExisting:Type;\n multi:boolean;\n}\n\nexport function customValueAccessorFactory(type:Function):IValueAccessorProvider {\n return {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => type),\n multi: true\n };\n}\n"]} \ No newline at end of file diff --git a/dist/misc/util/helpers/custom-value-accessor.metadata.json b/dist/misc/util/helpers/custom-value-accessor.metadata.json deleted file mode 100644 index 243cbab65..000000000 --- a/dist/misc/util/helpers/custom-value-accessor.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"ICustomValueAccessorHost":{"__symbolic":"interface"},"CustomValueAccessor":{"__symbolic":"class","arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":8,"character":30,"context":{"typeName":"T"}}]}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}]}},"IValueAccessorProvider":{"__symbolic":"interface"},"customValueAccessorFactory":{"__symbolic":"function","parameters":["type"],"value":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR","line":34,"character":17},"useExisting":{"__symbolic":"reference","name":"type"},"multi":true}}}}] \ No newline at end of file diff --git a/dist/misc/util/helpers/date.d.ts b/dist/misc/util/helpers/date.d.ts deleted file mode 100644 index 2ce4c158f..000000000 --- a/dist/misc/util/helpers/date.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export declare enum DatePrecision { - Decade = 0, - Year = 1, - Month = 2, - Date = 3, - Hour = 4, - Minute = 5, -} -export declare const DateUtil: { - startOf(precision: DatePrecision, date: Date, resetAll?: boolean): Date; - endOf(precision: DatePrecision, date: Date): Date; - equal(precision: DatePrecision, a: Date, b: Date): boolean; - next(precision: DatePrecision, date: Date): Date; - add(precision: DatePrecision, date: Date, i: number): Date; - previous(precision: DatePrecision, date: Date): Date; - clone(date: Date): Date; -}; diff --git a/dist/misc/util/helpers/date.js b/dist/misc/util/helpers/date.js deleted file mode 100644 index 9a7125097..000000000 --- a/dist/misc/util/helpers/date.js +++ /dev/null @@ -1,172 +0,0 @@ -import { Util } from "./util"; -export var DatePrecision; -(function (DatePrecision) { - DatePrecision[DatePrecision["Decade"] = 0] = "Decade"; - DatePrecision[DatePrecision["Year"] = 1] = "Year"; - DatePrecision[DatePrecision["Month"] = 2] = "Month"; - DatePrecision[DatePrecision["Date"] = 3] = "Date"; - DatePrecision[DatePrecision["Hour"] = 4] = "Hour"; - DatePrecision[DatePrecision["Minute"] = 5] = "Minute"; -})(DatePrecision || (DatePrecision = {})); -export var DateUtil = { - startOf: function (precision, date, resetAll) { - if (resetAll === void 0) { resetAll = false; } - switch (precision) { - case DatePrecision.Decade: - var start = Math.floor(date.getFullYear() / 10) * 10 + 1; - date.setFullYear(start); - if (!resetAll) { - break; - } - // falls through - case DatePrecision.Year: - date.setMonth(0); - if (!resetAll) { - break; - } - // falls through - case DatePrecision.Month: - date.setDate(1); - if (!resetAll) { - break; - } - // falls through - case DatePrecision.Date: - date.setHours(0); - if (!resetAll) { - break; - } - // falls through - case DatePrecision.Hour: - date.setMinutes(0); - if (!resetAll) { - break; - } - // falls through - case DatePrecision.Minute: - date.setSeconds(0, 0); - } - return date; - }, - endOf: function (precision, date) { - switch (precision) { - case DatePrecision.Year: - date.setMonth(12, 0); - // falls through - case DatePrecision.Month: - date.setMonth(date.getMonth() + 1, 0); - // falls through - case DatePrecision.Date: - date.setHours(23, 59, 59, 999); - break; - case DatePrecision.Hour: - date.setMinutes(59, 59, 999); - break; - case DatePrecision.Minute: - date.setSeconds(59, 999); - break; - } - return date; - }, - equal: function (precision, a, b) { - var equal = true; - switch (precision) { - case DatePrecision.Minute: - equal = equal && a.getMinutes() === b.getMinutes(); - // falls through - case DatePrecision.Hour: - equal = equal && a.getHours() === b.getHours(); - // falls through - case DatePrecision.Date: - equal = equal && a.getDate() === b.getDate(); - // falls through - case DatePrecision.Month: - equal = equal && a.getMonth() === b.getMonth(); - // falls through - case DatePrecision.Year: - equal = equal && a.getFullYear() === b.getFullYear(); - } - return equal; - }, - next: function (precision, date) { - return DateUtil.add(precision, date, 1); - }, - add: function (precision, date, i) { - var year = date.getFullYear(); - var month = date.getMonth(); - var day = date.getDate(); - switch (precision) { - case DatePrecision.Decade: - date.setFullYear(year + i * 10); - if (date.getMonth() !== month) { - date.setDate(0); - } - break; - case DatePrecision.Year: - date.setFullYear(year + i); - if (date.getMonth() !== month) { - date.setDate(0); - } - break; - case DatePrecision.Month: - date.setMonth(month + i); - if (date.getMonth() !== Util.Math.mod(month + i, 12)) { - date.setDate(0); - } - break; - case DatePrecision.Date: - date.setDate(day + i); - break; - case DatePrecision.Hour: - date.setHours(date.getHours() + i); - break; - case DatePrecision.Minute: - date.setMinutes(date.getMinutes() + i); - break; - } - return date; - }, - previous: function (precision, date) { - var year = date.getFullYear(); - var month = date.getMonth(); - var day = date.getDate(); - switch (precision) { - case DatePrecision.Decade: - date.setFullYear(year - 10); - if (date.getMonth() !== month) { - date.setDate(0); - } - break; - case DatePrecision.Year: - date.setFullYear(year - 1); - if (date.getMonth() !== month) { - date.setDate(0); - } - break; - case DatePrecision.Month: - date.setMonth(month - 1); - if (date.getMonth() !== Util.Math.mod(month - 1, 12)) { - date.setDate(0); - } - break; - case DatePrecision.Date: - date.setDate(day - 1); - break; - case DatePrecision.Hour: - var hours = date.getHours(); - date.setHours(hours - 1); - if (date.getHours() !== Util.Math.mod(hours - 1, 24)) { - date.setHours(hours - 2); - } - break; - case DatePrecision.Minute: - var minutes = date.getMinutes(); - date.setMinutes(minutes - 1); - } - return date; - }, - clone: function (date) { - return new Date(date.getTime()); - } -}; -//# sourceMappingURL=date.js.map \ No newline at end of file diff --git a/dist/misc/util/helpers/date.js.map b/dist/misc/util/helpers/date.js.map deleted file mode 100644 index 65fd3dde9..000000000 --- a/dist/misc/util/helpers/date.js.map +++ /dev/null @@ -1 +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EAAE,CAAC,CAAC,CAAC,CAAC;oBACnD,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;iBAC5B;gBACD,KAAK,CAAC;YACV,KAAK,aAAa,CAAC,MAAM;gBACrB,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClC,IAAI,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;SACpC;QACD,MAAM,CAAC,IAAI,CAAC;KACf;IAED,KAAK,EAAL,UAAM,IAAS;QACX,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;KACnC;CACJ,CAAC","sourcesContent":["import { Util } from \"./util\";\n\nexport enum DatePrecision {\n Decade = 0,\n Year = 1,\n Month = 2,\n Date = 3,\n Hour = 4,\n Minute = 5\n}\n\nexport const DateUtil = {\n startOf(precision:DatePrecision, date:Date, resetAll:boolean = false):Date {\n switch (precision) {\n case DatePrecision.Decade:\n const start = Math.floor(date.getFullYear() / 10) * 10 + 1;\n date.setFullYear(start);\n if (!resetAll) {\n break;\n }\n // falls through\n case DatePrecision.Year:\n date.setMonth(0);\n if (!resetAll) {\n break;\n }\n // falls through\n case DatePrecision.Month:\n date.setDate(1);\n if (!resetAll) {\n break;\n }\n // falls through\n case DatePrecision.Date:\n date.setHours(0);\n if (!resetAll) {\n break;\n }\n // falls through\n case DatePrecision.Hour:\n date.setMinutes(0);\n if (!resetAll) {\n break;\n }\n // falls through\n case DatePrecision.Minute:\n date.setSeconds(0, 0);\n }\n\n return date;\n },\n\n endOf(precision:DatePrecision, date:Date):Date {\n switch (precision) {\n case DatePrecision.Year:\n date.setMonth(12, 0);\n // falls through\n case DatePrecision.Month:\n date.setMonth(date.getMonth() + 1, 0);\n // falls through\n case DatePrecision.Date:\n date.setHours(23, 59, 59, 999);\n break;\n case DatePrecision.Hour:\n date.setMinutes(59, 59, 999);\n break;\n case DatePrecision.Minute:\n date.setSeconds(59, 999);\n break;\n }\n\n return date;\n },\n\n equal(precision:DatePrecision, a:Date, b:Date):boolean {\n let equal = true;\n switch (precision) {\n case DatePrecision.Minute:\n equal = equal && a.getMinutes() === b.getMinutes();\n // falls through\n case DatePrecision.Hour:\n equal = equal && a.getHours() === b.getHours();\n // falls through\n case DatePrecision.Date:\n equal = equal && a.getDate() === b.getDate();\n // falls through\n case DatePrecision.Month:\n equal = equal && a.getMonth() === b.getMonth();\n // falls through\n case DatePrecision.Year:\n equal = equal && a.getFullYear() === b.getFullYear();\n }\n return equal;\n },\n\n next(precision:DatePrecision, date:Date):Date {\n return DateUtil.add(precision, date, 1);\n },\n\n add(precision:DatePrecision, date:Date, i:number):Date {\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n\n switch (precision) {\n case DatePrecision.Decade:\n date.setFullYear(year + i * 10);\n if (date.getMonth() !== month) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Year:\n date.setFullYear(year + i);\n if (date.getMonth() !== month) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Month:\n date.setMonth(month + i);\n if (date.getMonth() !== Util.Math.mod(month + i, 12)) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Date:\n date.setDate(day + i);\n break;\n case DatePrecision.Hour:\n date.setHours(date.getHours() + i);\n break;\n case DatePrecision.Minute:\n date.setMinutes(date.getMinutes() + i);\n break;\n }\n return date;\n },\n\n previous(precision:DatePrecision, date:Date):Date {\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n\n switch (precision) {\n case DatePrecision.Decade:\n date.setFullYear(year - 10);\n if (date.getMonth() !== month) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Year:\n date.setFullYear(year - 1);\n if (date.getMonth() !== month) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Month:\n date.setMonth(month - 1);\n if (date.getMonth() !== Util.Math.mod(month - 1, 12)) {\n date.setDate(0);\n }\n break;\n case DatePrecision.Date:\n date.setDate(day - 1);\n break;\n case DatePrecision.Hour:\n const hours = date.getHours();\n date.setHours(hours - 1);\n if (date.getHours() !== Util.Math.mod(hours - 1, 24)) {\n date.setHours(hours - 2);\n }\n break;\n case DatePrecision.Minute:\n const minutes = date.getMinutes();\n date.setMinutes(minutes - 1);\n }\n return date;\n },\n\n clone(date:Date):Date {\n return new Date(date.getTime());\n }\n};\n"]} \ No newline at end of file diff --git a/dist/misc/util/helpers/date.metadata.json b/dist/misc/util/helpers/date.metadata.json deleted file mode 100644 index ac4da176e..000000000 --- a/dist/misc/util/helpers/date.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"DatePrecision":{"Decade":0,"Year":1,"Month":2,"Date":3,"Hour":4,"Minute":5},"DateUtil":{}}}] \ No newline at end of file diff --git a/dist/misc/util/helpers/focus-event.d.ts b/dist/misc/util/helpers/focus-event.d.ts deleted file mode 100644 index 5b15ad3e8..000000000 --- a/dist/misc/util/helpers/focus-event.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IFocusEvent extends Event { - relatedTarget: EventTarget; -} diff --git a/dist/misc/util/helpers/focus-event.js b/dist/misc/util/helpers/focus-event.js deleted file mode 100644 index 21a63476a..000000000 --- a/dist/misc/util/helpers/focus-event.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=focus-event.js.map \ No newline at end of file diff --git a/dist/misc/util/helpers/focus-event.js.map b/dist/misc/util/helpers/focus-event.js.map deleted file mode 100644 index eb484d7ea..000000000 --- a/dist/misc/util/helpers/focus-event.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"focus-event.js","sourceRoot":"","sources":["../../../../src/misc/util/helpers/focus-event.ts"],"names":[],"mappings":"","sourcesContent":["export interface IFocusEvent extends Event {\n relatedTarget:EventTarget;\n}\n"]} \ No newline at end of file diff --git a/dist/misc/util/helpers/focus-event.metadata.json b/dist/misc/util/helpers/focus-event.metadata.json deleted file mode 100644 index 14dd59630..000000000 --- a/dist/misc/util/helpers/focus-event.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"IFocusEvent":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/misc/util/helpers/util.d.ts b/dist/misc/util/helpers/util.d.ts deleted file mode 100644 index 17f9e2af0..000000000 --- a/dist/misc/util/helpers/util.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -export declare enum KeyCode { - Left = 37, - Up = 38, - Right = 39, - Down = 40, - Escape = 27, - Enter = 13, - Space = 32, - Backspace = 8, -} -export interface ITemplateRefContext { - $implicit: T; -} -export interface IAugmentedElement extends Element { - closest(selector: string): IAugmentedElement; -} -export declare class HandledEvent { - eventHandled: boolean; -} -export interface IDynamicClasses { - [name: string]: true; -} -export declare const Util: { - Array: { - range(n: number, offset?: number): number[]; - group(items: T[], groupLength: number): T[][]; - groupBy(items: T[], field: keyof T): { - [name: string]: T[]; - }; - flatten(items: T[][]): T[]; - }; - String: { - padLeft(str: string, length: number, padding: string): string; - }; - DOM: { - parseBooleanAttribute(attributeValue: boolean): boolean; - }; - Object: { - readValue(object: T, path?: string | undefined): U; - }; - Math: { - round(r: number, n: number): number; - roundUp(r: number, n: number): number; - roundDown(r: number, n: number): number; - mod(r: number, n: number): number; - }; -}; diff --git a/dist/misc/util/helpers/util.js b/dist/misc/util/helpers/util.js deleted file mode 100644 index 1c4e341d8..000000000 --- a/dist/misc/util/helpers/util.js +++ /dev/null @@ -1,96 +0,0 @@ -// Keyboard keycodes. -// Keyboard keycodes. -export var KeyCode; -// Keyboard keycodes. -(function (KeyCode) { - KeyCode[KeyCode["Left"] = 37] = "Left"; - KeyCode[KeyCode["Up"] = 38] = "Up"; - KeyCode[KeyCode["Right"] = 39] = "Right"; - KeyCode[KeyCode["Down"] = 40] = "Down"; - KeyCode[KeyCode["Escape"] = 27] = "Escape"; - KeyCode[KeyCode["Enter"] = 13] = "Enter"; - KeyCode[KeyCode["Space"] = 32] = "Space"; - KeyCode[KeyCode["Backspace"] = 8] = "Backspace"; -})(KeyCode || (KeyCode = {})); -var HandledEvent = /** @class */ (function () { - function HandledEvent() { - } - return HandledEvent; -}()); -export { HandledEvent }; -export var Util = { - Array: { - range: function (n, offset) { - if (offset === void 0) { offset = 0; } - return Array(n).fill(0).map(function (z, i) { return i + offset; }); - }, - group: function (items, groupLength) { - var mutable = items.slice(0); - var groups = []; - while (mutable.length > 0) { - groups.push(mutable.splice(0, groupLength)); - } - return groups; - }, - groupBy: function (items, field) { - return items.reduce(function (groups, i) { - var fieldValue = i[field].toString(); - groups[fieldValue] = groups[fieldValue] || []; - groups[fieldValue].push(i); - return groups; - }, Object()); - }, - flatten: function (items) { - return items.reduce(function (is, i) { return is.concat(i); }, []); - } - }, - String: { - padLeft: function (str, length, padding) { - var s = str; - while (s.length < length) { - s = padding + s; - } - return s; - } - }, - DOM: { - parseBooleanAttribute: function (attributeValue) { - var value = attributeValue; - if (typeof attributeValue === "string") { - value = true; - } - return value; - } - }, - Object: { - readValue: function (object, path) { - if (!path) { - return object; - } - var recursed; - for (var i = 0, p = path.split("."), len = p.length; i < len; i++) { - recursed = object[p[i]]; - } - return recursed; - } - }, - Math: { - round: function (r, n) { - return Math.round(r / n) * n; - }, - roundUp: function (r, n) { - return Math.ceil(r / n) * n; - }, - roundDown: function (r, n) { - return Math.floor(r / n) * n; - }, - mod: function (r, n) { - var rem = r % n; - if (rem < 0) { - return rem + n; - } - return rem; - } - } -}; -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/dist/misc/util/helpers/util.js.map b/dist/misc/util/helpers/util.js.map deleted file mode 100644 index 619c0a9bf..000000000 --- a/dist/misc/util/helpers/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/misc/util/helpers/util.ts"],"names":[],"mappings":"AAAA,qBAAqB;;AACrB,MAAM,CAAN,IAAY,OAWX;;AAXD,WAAY,OAAO;IACf,sCAAS,CAAA;IACT,kCAAO,CAAA;IACP,wCAAU,CA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I,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;SAChC;QACD,OAAO,EAAP,UAAQ,CAAQ,EAAE,CAAQ;YACtB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;SAC/B;QACD,SAAS,EAAT,UAAU,CAAQ,EAAE,CAAQ;YACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;SAChC;QACD,GAAG,EAAH,UAAI,CAAQ,EAAE,CAAQ;YAClB,IAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YAClB,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;gBACV,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC;aAClB;YACD,MAAM,CAAC,GAAG,CAAC;SACd;KACJ;CACJ,CAAC","sourcesContent":["// Keyboard keycodes.\nexport enum KeyCode {\n Left = 37,\n Up = 38,\n Right = 39,\n Down = 40,\n\n Escape = 27,\n Enter = 13,\n\n Space = 32,\n Backspace = 8\n}\n\ninterface IRecursiveObject { [name:string]:IRecursiveObject; }\n\nexport interface ITemplateRefContext { $implicit:T; }\n\nexport interface IAugmentedElement extends Element {\n closest(selector:string):IAugmentedElement;\n}\n\nexport class HandledEvent {\n public eventHandled:boolean;\n}\n\nexport interface IDynamicClasses {\n [name:string]:true;\n}\n\nexport const Util = {\n Array: {\n range(n:number, offset:number = 0):number[] {\n return Array(n).fill(0).map((z, i) => i + offset);\n },\n group(items:T[], groupLength:number):T[][] {\n const mutable = items.slice(0);\n\n const groups:T[][] = [];\n while (mutable.length > 0) {\n groups.push(mutable.splice(0, groupLength));\n }\n return groups;\n },\n groupBy(items:T[], field:keyof T):{ [name:string]:T[] } {\n return items.reduce<{ [name:string]:T[] }>(\n (groups, i) => {\n const fieldValue = i[field].toString();\n groups[fieldValue] = groups[fieldValue] || [];\n groups[fieldValue].push(i);\n return groups;\n },\n Object());\n },\n flatten(items:T[][]):T[] {\n return items.reduce((is, i) => is.concat(i), []);\n }\n },\n\n String: {\n padLeft(str:string, length:number, padding:string):string {\n let s = str;\n while (s.length < length) {\n s = padding + s;\n }\n return s;\n }\n },\n\n DOM: {\n parseBooleanAttribute(attributeValue:boolean):boolean {\n let value = attributeValue;\n if (typeof attributeValue === \"string\") {\n value = true;\n }\n\n return value;\n }\n },\n\n Object: {\n readValue(object:T, path?:string):U {\n if (!path) {\n return object as any as U;\n }\n\n let recursed:IRecursiveObject | undefined;\n\n for (let i = 0, p = path.split(\".\"), len = p.length; i < len; i++) {\n recursed = (object as any as IRecursiveObject)[p[i]];\n }\n\n return recursed as any as U;\n }\n },\n\n Math: {\n round(r:number, n:number):number {\n return Math.round(r / n) * n;\n },\n roundUp(r:number, n:number):number {\n return Math.ceil(r / n) * n;\n },\n roundDown(r:number, n:number):number {\n return Math.floor(r / n) * n;\n },\n mod(r:number, n:number):number {\n const rem = r % n;\n if (rem < 0) {\n return rem + n;\n }\n return rem;\n }\n }\n};\n"]} \ No newline at end of file diff --git a/dist/misc/util/helpers/util.metadata.json b/dist/misc/util/helpers/util.metadata.json deleted file mode 100644 index 371a2d118..000000000 --- a/dist/misc/util/helpers/util.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"KeyCode":{"Left":37,"Up":38,"Right":39,"Down":40,"Escape":27,"Enter":13,"Space":32,"Backspace":8},"ITemplateRefContext":{"__symbolic":"interface"},"IAugmentedElement":{"__symbolic":"interface"},"HandledEvent":{"__symbolic":"class"},"IDynamicClasses":{"__symbolic":"interface"},"Util":{"Array":{},"String":{},"DOM":{},"Object":{},"Math":{}}}}] \ No newline at end of file diff --git a/dist/misc/util/index.d.ts b/dist/misc/util/index.d.ts deleted file mode 100644 index d28c84a76..000000000 --- a/dist/misc/util/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from "./helpers/custom-validator"; -export * from "./helpers/custom-value-accessor"; -export * from "./helpers/date"; -export * from "./helpers/focus-event"; -export * from "./helpers/util"; -export * from "./services/component-factory.service"; -export * from "./services/positioning.service"; -export * from "./util.module"; diff --git a/dist/misc/util/index.js b/dist/misc/util/index.js deleted file mode 100644 index c99993726..000000000 --- a/dist/misc/util/index.js +++ /dev/null @@ -1,8 +0,0 @@ -export * from "./helpers/custom-validator"; -export * from "./helpers/custom-value-accessor"; -export * from "./helpers/date"; -export * from "./helpers/util"; -export * from "./services/component-factory.service"; -export * from "./services/positioning.service"; -export * from "./util.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/misc/util/index.js.map b/dist/misc/util/index.js.map deleted file mode 100644 index cbcdcb19b..000000000 --- a/dist/misc/util/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/misc/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gBAAgB,CAAC;AAE/B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,eAAe,CAAC","sourcesContent":["export * from \"./helpers/custom-validator\";\nexport * from \"./helpers/custom-value-accessor\";\nexport * from \"./helpers/date\";\nexport * from \"./helpers/focus-event\";\nexport * from \"./helpers/util\";\n\nexport * from \"./services/component-factory.service\";\nexport * from \"./services/positioning.service\";\n\nexport * from \"./util.module\";\n"]} \ No newline at end of file diff --git a/dist/misc/util/index.metadata.json b/dist/misc/util/index.metadata.json deleted file mode 100644 index 962866182..000000000 --- a/dist/misc/util/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./helpers/custom-validator"},{"from":"./helpers/custom-value-accessor"},{"from":"./helpers/date"},{"from":"./helpers/focus-event"},{"from":"./helpers/util"},{"from":"./services/component-factory.service"},{"from":"./services/positioning.service"},{"from":"./util.module"}]}] \ No newline at end of file diff --git a/dist/misc/util/public.d.ts b/dist/misc/util/public.d.ts deleted file mode 100644 index 0e210927c..000000000 --- a/dist/misc/util/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiUtilityModule } from "./index"; diff --git a/dist/misc/util/public.js b/dist/misc/util/public.js deleted file mode 100644 index f1b0b9140..000000000 --- a/dist/misc/util/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiUtilityModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/misc/util/public.js.map b/dist/misc/util/public.js.map deleted file mode 100644 index 91687bfc0..000000000 --- a/dist/misc/util/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/misc/util/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EACnB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiUtilityModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/misc/util/public.metadata.json b/dist/misc/util/public.metadata.json deleted file mode 100644 index 3a4a50211..000000000 --- a/dist/misc/util/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiUtilityModule"]}]}] \ No newline at end of file diff --git a/dist/misc/util/services/component-factory.service.d.ts b/dist/misc/util/services/component-factory.service.d.ts deleted file mode 100644 index c7f70eeb7..000000000 --- a/dist/misc/util/services/component-factory.service.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ApplicationRef, ComponentFactoryResolver, Injector, ComponentRef, Provider, Type, ViewContainerRef, TemplateRef } from "@angular/core"; -export interface IImplicitContext { - $implicit?: T; -} -export declare class SuiComponentFactory { - private _applicationRef; - private _componentFactoryResolver; - private _injector; - constructor(_applicationRef: ApplicationRef, _componentFactoryResolver: ComponentFactoryResolver, _injector: Injector); - createComponent(type: Type, providers?: Provider[]): ComponentRef; - createView>(viewContainer: ViewContainerRef, template: TemplateRef, context: U): void; - attachToView(componentRef: ComponentRef, viewContainer: ViewContainerRef): void; - attachToApplication(componentRef: ComponentRef): void; - detachFromApplication(componentRef: ComponentRef): void; - moveToElement(componentRef: ComponentRef, element: Element): void; - moveToDocumentBody(componentRef: ComponentRef): void; - detachFromDocument(componentRef: ComponentRef): void; -} diff --git a/dist/misc/util/services/component-factory.service.js b/dist/misc/util/services/component-factory.service.js deleted file mode 100644 index cc54ec72c..000000000 --- a/dist/misc/util/services/component-factory.service.js +++ /dev/null @@ -1,75 +0,0 @@ -import { Injectable, ApplicationRef, ComponentFactoryResolver, Injector, ReflectiveInjector } from "@angular/core"; -var SuiComponentFactory = /** @class */ (function () { - function SuiComponentFactory(_applicationRef, _componentFactoryResolver, _injector) { - this._applicationRef = _applicationRef; - this._componentFactoryResolver = _componentFactoryResolver; - this._injector = _injector; - } - SuiComponentFactory.prototype.createComponent = function (type, providers) { - if (providers === void 0) { providers = []; } - // Resolve a factory for creating components of type `type`. - var factory = this._componentFactoryResolver.resolveComponentFactory(type); - // Resolve and create an injector with the specified providers. - var injector = ReflectiveInjector.resolveAndCreate(providers, this._injector); - // Create a component using the previously resolved factory & injector. - var componentRef = factory.create(injector); - return componentRef; - }; - SuiComponentFactory.prototype.createView = function (viewContainer, template, context) { - viewContainer.createEmbeddedView(template, context); - }; - // Inserts the component into the specified view container. - // Inserts the component into the specified view container. - SuiComponentFactory.prototype.attachToView = - // Inserts the component into the specified view container. - function (componentRef, viewContainer) { - viewContainer.insert(componentRef.hostView, 0); - }; - // Inserts the component in the root application node. - // Inserts the component in the root application node. - SuiComponentFactory.prototype.attachToApplication = - // Inserts the component in the root application node. - function (componentRef) { - this._applicationRef.attachView(componentRef.hostView); - }; - // Detaches the component from the root application node. - // Detaches the component from the root application node. - SuiComponentFactory.prototype.detachFromApplication = - // Detaches the component from the root application node. - function (componentRef) { - this._applicationRef.detachView(componentRef.hostView); - }; - // Moves the component to the specified DOM element. - // Moves the component to the specified DOM element. - SuiComponentFactory.prototype.moveToElement = - // Moves the component to the specified DOM element. - function (componentRef, element) { - element.appendChild(componentRef.location.nativeElement); - }; - // Moves the component to the document body. - // Moves the component to the document body. - SuiComponentFactory.prototype.moveToDocumentBody = - // Moves the component to the document body. - function (componentRef) { - this.moveToElement(componentRef, (document.querySelector("body"))); - }; - SuiComponentFactory.prototype.detachFromDocument = function (componentRef) { - var element = componentRef.location.nativeElement; - // We can't use `element.remove()` due to lack of IE11 support. - if (element.parentNode) { - element.parentNode.removeChild(element); - } - }; - SuiComponentFactory.decorators = [ - { type: Injectable }, - ]; - /** @nocollapse */ - SuiComponentFactory.ctorParameters = function () { return [ - { type: ApplicationRef, }, - { type: ComponentFactoryResolver, }, - { type: Injector, }, - ]; }; - return SuiComponentFactory; -}()); -export { SuiComponentFactory }; -//# sourceMappingURL=component-factory.service.js.map \ No newline at end of file diff --git a/dist/misc/util/services/component-factory.service.js.map b/dist/misc/util/services/component-factory.service.js.map deleted file mode 100644 index d5e7d8494..000000000 --- a/dist/misc/util/services/component-factory.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"component-factory.service.js","sourceRoot":"","sources":["../../../../src/misc/util/services/component-factory.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EAAE,cAAc,EAAE,wBAAwB,EAAE,QAAQ,EAC9D,kBAAkB,EACrB,MAAM,eAAe,CAAC;;IAQnB,6BAAoB,eAA8B,EAC9B,yBAAkD,EAClD,SAAkB;QAFlB,oBAAe,GAAf,eAAe,CAAe;QAC9B,8BAAyB,GAAzB,yBAAyB,CAAyB;QAClD,cAAS,GAAT,SAAS,CAAS;KAAI;IAEnC,6CAAe,GAAtB,UAA0B,IAAY,EAAE,SAAyB;QAAzB,0BAAA,EAAA,cAAyB;;QAE7D,IAAM,OAAO,GAAG,IAAI,CAAC,yBAAyB,CAAC,uBAAuB,CAAC,IAAe,CAAC,CAAC;;QAGxF,IAAM,QAAQ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,OAAO,CAAC,CAAC;SAC3C;KACJ;;gBAzDJ,UAAU;;;;gBARK,cAAc;gBAAE,wBAAwB;gBAAE,QAAQ;;8BADlE;;SAUa,mBAAmB","sourcesContent":["import {\n Injectable, ApplicationRef, ComponentFactoryResolver, Injector, ComponentRef,\n ReflectiveInjector, Provider, Type, ViewContainerRef, TemplateRef\n} from \"@angular/core\";\n\nexport interface IImplicitContext {\n $implicit?:T;\n}\n\n@Injectable()\nexport class SuiComponentFactory {\n constructor(private _applicationRef:ApplicationRef,\n private _componentFactoryResolver:ComponentFactoryResolver,\n private _injector:Injector) {}\n\n public createComponent(type:Type, providers:Provider[] = []):ComponentRef {\n // Resolve a factory for creating components of type `type`.\n const factory = this._componentFactoryResolver.resolveComponentFactory(type as Type);\n\n // Resolve and create an injector with the specified providers.\n const injector = ReflectiveInjector.resolveAndCreate(\n providers,\n this._injector\n );\n\n // Create a component using the previously resolved factory & injector.\n const componentRef = factory.create(injector);\n\n return componentRef;\n }\n\n public createView>(viewContainer:ViewContainerRef, template:TemplateRef, context:U):void {\n viewContainer.createEmbeddedView(template, context);\n }\n\n // Inserts the component into the specified view container.\n public attachToView(componentRef:ComponentRef, viewContainer:ViewContainerRef):void {\n viewContainer.insert(componentRef.hostView, 0);\n }\n\n // Inserts the component in the root application node.\n public attachToApplication(componentRef:ComponentRef):void {\n this._applicationRef.attachView(componentRef.hostView);\n }\n\n // Detaches the component from the root application node.\n public detachFromApplication(componentRef:ComponentRef):void {\n this._applicationRef.detachView(componentRef.hostView);\n }\n\n // Moves the component to the specified DOM element.\n public moveToElement(componentRef:ComponentRef, element:Element):void {\n element.appendChild(componentRef.location.nativeElement);\n }\n\n // Moves the component to the document body.\n public moveToDocumentBody(componentRef:ComponentRef):void {\n this.moveToElement(componentRef, document.querySelector(\"body\")!);\n }\n\n public detachFromDocument(componentRef:ComponentRef):void {\n const element = componentRef.location.nativeElement as Element;\n // We can't use `element.remove()` due to lack of IE11 support.\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/misc/util/services/component-factory.service.metadata.json b/dist/misc/util/services/component-factory.service.metadata.json deleted file mode 100644 index 6b536dca7..000000000 --- a/dist/misc/util/services/component-factory.service.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"IImplicitContext":{"__symbolic":"interface"},"SuiComponentFactory":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":9,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ApplicationRef","line":11,"character":40},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver","line":12,"character":50},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":13,"character":34}]}],"createComponent":[{"__symbolic":"method"}],"createView":[{"__symbolic":"method"}],"attachToView":[{"__symbolic":"method"}],"attachToApplication":[{"__symbolic":"method"}],"detachFromApplication":[{"__symbolic":"method"}],"moveToElement":[{"__symbolic":"method"}],"moveToDocumentBody":[{"__symbolic":"method"}],"detachFromDocument":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/misc/util/services/positioning.service.d.ts b/dist/misc/util/services/positioning.service.d.ts deleted file mode 100644 index bdf0666e7..000000000 --- a/dist/misc/util/services/positioning.service.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { ElementRef } from "@angular/core"; -import { Data } from "popper.js"; -export declare type PositioningPlacement = "auto" | "top left" | "top" | "top right" | "bottom left" | "bottom" | "bottom right" | "left top" | "left" | "left bottom" | "right top" | "right" | "right bottom"; -export declare const PositioningPlacement: { - Auto: PositioningPlacement; - TopLeft: PositioningPlacement; - Top: PositioningPlacement; - TopRight: PositioningPlacement; - LeftTop: PositioningPlacement; - Left: PositioningPlacement; - LeftBottom: PositioningPlacement; - BottomLeft: PositioningPlacement; - Bottom: PositioningPlacement; - BottomRight: PositioningPlacement; - RightTop: PositioningPlacement; - Right: PositioningPlacement; - RightBottom: PositioningPlacement; -}; -export interface IPositionBoundingBox { - width: number; - height: number; - top: number; - left: number; - bottom: number; - right: number; -} -export declare class PositioningService { - readonly anchor: ElementRef; - readonly subject: ElementRef; - private _popper; - private _popperState; - private _placement; - placement: PositioningPlacement; - readonly actualPlacement: PositioningPlacement; - readonly state: Data; - constructor(anchor: ElementRef, subject: ElementRef, placement: PositioningPlacement, arrowSelector?: string); - update(): void; - destroy(): void; -} diff --git a/dist/misc/util/services/positioning.service.js b/dist/misc/util/services/positioning.service.js deleted file mode 100644 index 41a24871e..000000000 --- a/dist/misc/util/services/positioning.service.js +++ /dev/null @@ -1,137 +0,0 @@ -import Popper from "popper.js"; -export var PositioningPlacement = { - Auto: "auto", - TopLeft: "top left", - Top: "top", - TopRight: "top right", - LeftTop: "left top", - Left: "left", - LeftBottom: "left bottom", - BottomLeft: "bottom left", - Bottom: "bottom", - BottomRight: "bottom right", - RightTop: "right top", - Right: "right", - RightBottom: "right bottom" -}; -function placementToPopper(placement) { - if (!placement || placement === PositioningPlacement.Auto) { - return "auto"; - } - // All placements of the format: `direction alignment`, e.g. `top left`. - var _a = placement.split(" "), direction = _a[0], alignment = _a[1]; - // Direction alone covers case of just `top`, `left`, `bottom`, `right`. - var chosenPlacement = [direction]; - // Add `start` / `end` to placement, depending on alignment direction. - switch (alignment) { - case "top": - case "left": - chosenPlacement.push("start"); - break; - case "bottom": - case "right": - chosenPlacement.push("end"); - break; - } - // Join with hyphen to create Popper compatible placement. - return chosenPlacement.join("-"); -} -function popperToPlacement(popper) { - if (!popper || popper === "auto") { - return "auto"; - } - var _a = popper.split("-"), direction = _a[0], alignment = _a[1]; - var chosenPlacement = [direction]; - switch (direction) { - case "top": - case "bottom": - switch (alignment) { - case "start": - chosenPlacement.push("left"); - break; - case "end": - chosenPlacement.push("right"); - break; - } - break; - case "left": - case "right": - switch (alignment) { - case "start": - chosenPlacement.push("top"); - break; - case "end": - chosenPlacement.push("bottom"); - break; - } - break; - } - return chosenPlacement.join(" "); -} -var PositioningService = /** @class */ (function () { - function PositioningService(anchor, subject, placement, arrowSelector) { - var _this = this; - this.anchor = anchor; - this.subject = subject; - this._placement = placement; - var modifiers = { - computeStyle: { - gpuAcceleration: false - }, - preventOverflow: { - escapeWithReference: true, - boundariesElement: document.body - }, - arrow: { - element: arrowSelector - } - }; - if (!arrowSelector) { - delete modifiers.arrow; - } - this._popper = new Popper(anchor.nativeElement, subject.nativeElement, { - placement: placementToPopper(placement), - modifiers: modifiers, - onCreate: function (initial) { return _this._popperState = initial; }, - onUpdate: function (update) { return _this._popperState = update; } - }); - } - Object.defineProperty(PositioningService.prototype, "placement", { - get: function () { - return this._placement; - }, - set: function (placement) { - this._placement = placement; - this._popper.options.placement = placementToPopper(placement); - this.update(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(PositioningService.prototype, "actualPlacement", { - get: function () { - if (!this._popperState) { - return PositioningPlacement.Auto; - } - return popperToPlacement(this._popperState.placement); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(PositioningService.prototype, "state", { - get: function () { - return this._popperState; - }, - enumerable: true, - configurable: true - }); - PositioningService.prototype.update = function () { - this._popper.update(); - }; - PositioningService.prototype.destroy = function () { - this._popper.destroy(); - }; - return PositioningService; -}()); -export { PositioningService }; -//# sourceMappingURL=positioning.service.js.map \ No newline at end of file diff --git a/dist/misc/util/services/positioning.service.js.map b/dist/misc/util/services/positioning.service.js.map deleted file mode 100644 index ce0c22dbe..000000000 --- a/dist/misc/util/services/positioning.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"positioning.service.js","sourceRoot":"","sources":["../../../../src/misc/util/services/positioning.service.ts"],"names":[],"mappings":"AACA,OAAO,MAAqD,MAAM,WAAW,CAAC;AAmB9E,MAAM,CAAC,IAAM,oBAAoB,GAAG;IAChC,IAAI,EAAE,MAA8B;IACpC,OAAO,EAAE,UAAkC;IAC3C,GAAG,EAAE,KAA6B;IA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AAQ,EAAE,UAAA,OAAO,IAAI,OAAA,KAAI,CAAC,YAAY,GAAG,OAAO,EAA3B,CAA2B;YAChD,QAAQ,EAAE,UAAA,MAAM,IAAI,OAAA,KAAI,CAAC,YAAY,GAAG,MAAM,EAA1B,CAA0B;SACjD,CAAmB,CAAC;KAC5B;IArDD,sBAAW,yCAAS;aAApB;YACI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;SAC1B;aAED,UAAqB,SAA8B;YAC/C,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;YAC5B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;YAC9D,IAAI,CAAC,MAAM,EAAE,CAAC;SACjB;;;OANA;IAQD,sBAAW,+CAAe;aAA1B;YACI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;gBACrB,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC;aACpC;YAED,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;SACzD;;;OAAA;IAED,sBAAW,qCAAK;aAAhB;YACI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;SAC5B;;;OAAA;IAmCM,mCAAM,GAAb;QACI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;KACzB;IAEM,oCAAO,GAAd;QACI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;KAC1B;6BAlLL;IAmLC,CAAA;AAtED,8BAsEC","sourcesContent":["import { ElementRef } from \"@angular/core\";\nimport Popper, { Modifiers, PopperOptions, Placement, Data } from \"popper.js\";\n\ntype PopperModifiers = Modifiers & {\n computeStyle?:{\n gpuAcceleration:boolean;\n };\n};\ntype PopperInstance = Popper & {\n options:PopperOptions & {\n modifiers:PopperModifiers;\n };\n};\n\nexport type PositioningPlacement = \"auto\" |\n \"top left\" | \"top\" | \"top right\" |\n \"bottom left\" | \"bottom\" | \"bottom right\" |\n \"left top\" | \"left\" | \"left bottom\" |\n \"right top\" | \"right\" | \"right bottom\";\n\nexport const PositioningPlacement = {\n Auto: \"auto\" as PositioningPlacement,\n TopLeft: \"top left\" as PositioningPlacement,\n Top: \"top\" as PositioningPlacement,\n TopRight: \"top right\" as PositioningPlacement,\n LeftTop: \"left top\" as PositioningPlacement,\n Left: \"left\" as PositioningPlacement,\n LeftBottom: \"left bottom\" as PositioningPlacement,\n BottomLeft: \"bottom left\" as PositioningPlacement,\n Bottom: \"bottom\" as PositioningPlacement,\n BottomRight: \"bottom right\" as PositioningPlacement,\n RightTop: \"right top\" as PositioningPlacement,\n Right: \"right\" as PositioningPlacement,\n RightBottom: \"right bottom\" as PositioningPlacement\n};\n\nexport interface IPositionBoundingBox {\n width:number;\n height:number;\n top:number;\n left:number;\n bottom:number;\n right:number;\n}\n\nfunction placementToPopper(placement:PositioningPlacement):Placement {\n if (!placement || placement === PositioningPlacement.Auto) {\n return \"auto\";\n }\n\n // All placements of the format: `direction alignment`, e.g. `top left`.\n const [direction, alignment] = placement.split(\" \");\n\n // Direction alone covers case of just `top`, `left`, `bottom`, `right`.\n const chosenPlacement = [direction];\n\n // Add `start` / `end` to placement, depending on alignment direction.\n switch (alignment) {\n case \"top\":\n case \"left\":\n chosenPlacement.push(\"start\");\n break;\n case \"bottom\":\n case \"right\":\n chosenPlacement.push(\"end\");\n break;\n }\n\n // Join with hyphen to create Popper compatible placement.\n return chosenPlacement.join(\"-\") as Placement;\n}\n\nfunction popperToPlacement(popper:string):PositioningPlacement {\n if (!popper || popper === \"auto\") {\n return \"auto\";\n }\n\n const [direction, alignment] = popper.split(\"-\");\n\n const chosenPlacement = [direction];\n\n switch (direction) {\n case \"top\":\n case \"bottom\":\n switch (alignment) {\n case \"start\":\n chosenPlacement.push(\"left\");\n break;\n case \"end\":\n chosenPlacement.push(\"right\");\n break;\n }\n break;\n case \"left\":\n case \"right\":\n switch (alignment) {\n case \"start\":\n chosenPlacement.push(\"top\");\n break;\n case \"end\":\n chosenPlacement.push(\"bottom\");\n break;\n }\n break;\n }\n\n return chosenPlacement.join(\" \") as PositioningPlacement;\n}\n\nexport class PositioningService {\n public readonly anchor:ElementRef;\n public readonly subject:ElementRef;\n\n private _popper:PopperInstance;\n private _popperState:Data;\n private _placement:PositioningPlacement;\n\n public get placement():PositioningPlacement {\n return this._placement;\n }\n\n public set placement(placement:PositioningPlacement) {\n this._placement = placement;\n this._popper.options.placement = placementToPopper(placement);\n this.update();\n }\n\n public get actualPlacement():PositioningPlacement {\n if (!this._popperState) {\n return PositioningPlacement.Auto;\n }\n\n return popperToPlacement(this._popperState.placement);\n }\n\n public get state():Data {\n return this._popperState;\n }\n\n constructor(anchor:ElementRef, subject:ElementRef, placement:PositioningPlacement, arrowSelector?:string) {\n this.anchor = anchor;\n this.subject = subject;\n this._placement = placement;\n\n const modifiers:PopperModifiers = {\n computeStyle: {\n gpuAcceleration: false\n },\n preventOverflow: {\n escapeWithReference: true,\n boundariesElement: document.body\n },\n arrow: {\n element: arrowSelector\n }\n };\n\n if (!arrowSelector) {\n delete modifiers.arrow;\n }\n\n this._popper = new Popper(\n anchor.nativeElement,\n subject.nativeElement,\n {\n placement: placementToPopper(placement),\n modifiers,\n onCreate: initial => this._popperState = initial,\n onUpdate: update => this._popperState = update\n }) as PopperInstance;\n }\n\n public update():void {\n this._popper.update();\n }\n\n public destroy():void {\n this._popper.destroy();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/misc/util/services/positioning.service.metadata.json b/dist/misc/util/services/positioning.service.metadata.json deleted file mode 100644 index d33b88fc9..000000000 --- a/dist/misc/util/services/positioning.service.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"PositioningPlacement":{"Auto":"auto","TopLeft":"top left","Top":"top","TopRight":"top right","LeftTop":"left top","Left":"left","LeftBottom":"left bottom","BottomLeft":"bottom left","Bottom":"bottom","BottomRight":"bottom right","RightTop":"right top","Right":"right","RightBottom":"right bottom"},"IPositionBoundingBox":{"__symbolic":"interface"},"PositioningService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":139,"character":23},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":139,"character":23},{"__symbolic":"error","message":"Could not resolve type","line":139,"character":65,"context":{"typeName":"PositioningPlacement"}},{"__symbolic":"reference","name":"string"}]}],"update":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/misc/util/util.module.d.ts b/dist/misc/util/util.module.d.ts deleted file mode 100644 index e7ba03d96..000000000 --- a/dist/misc/util/util.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiUtilityModule { -} diff --git a/dist/misc/util/util.module.js b/dist/misc/util/util.module.js deleted file mode 100644 index 7b3e6c4b0..000000000 --- a/dist/misc/util/util.module.js +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiComponentFactory } from "./services/component-factory.service"; -var SuiUtilityModule = /** @class */ (function () { - function SuiUtilityModule() { - } - SuiUtilityModule.decorators = [ - { type: NgModule, args: [{ - imports: [CommonModule], - providers: [ - SuiComponentFactory - ] - },] }, - ]; - /** @nocollapse */ - SuiUtilityModule.ctorParameters = function () { return []; }; - return SuiUtilityModule; -}()); -export { SuiUtilityModule }; -//# sourceMappingURL=util.module.js.map \ No newline at end of file diff --git a/dist/misc/util/util.module.js.map b/dist/misc/util/util.module.js.map deleted file mode 100644 index bfee6cd18..000000000 --- a/dist/misc/util/util.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.module.js","sourceRoot":"","sources":["../../../src/misc/util/util.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;;;;;gBAE1E,QAAQ,SAAC;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,SAAS,EAAE;wBACP,mBAAmB;qBACtB;iBACJ;;;;2BATD;;SAUa,gBAAgB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiComponentFactory } from \"./services/component-factory.service\";\n\n@NgModule({\n imports: [CommonModule],\n providers: [\n SuiComponentFactory\n ]\n})\nexport class SuiUtilityModule {}\n"]} \ No newline at end of file diff --git a/dist/misc/util/util.module.metadata.json b/dist/misc/util/util.module.metadata.json deleted file mode 100644 index 1216dabb0..000000000 --- a/dist/misc/util/util.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiUtilityModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":5,"character":14}],"providers":[{"__symbolic":"reference","module":"./services/component-factory.service","name":"SuiComponentFactory","line":7,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/accordion/accordion.module.d.ts b/dist/modules/accordion/accordion.module.d.ts deleted file mode 100644 index 5e71fd672..000000000 --- a/dist/modules/accordion/accordion.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiAccordionModule { -} diff --git a/dist/modules/accordion/accordion.module.js b/dist/modules/accordion/accordion.module.js deleted file mode 100644 index fe6b6fdcd..000000000 --- a/dist/modules/accordion/accordion.module.js +++ /dev/null @@ -1,33 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiCollapseModule } from "../collapse/index"; -import { SuiTransitionModule } from "../transition/index"; -import { SuiAccordion } from "./components/accordion"; -import { SuiAccordionPanel } from "./components/accordion-panel"; -var SuiAccordionModule = /** @class */ (function () { - function SuiAccordionModule() { - } - SuiAccordionModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule, - SuiCollapseModule, - SuiTransitionModule - ], - declarations: [ - SuiAccordion, - SuiAccordionPanel - ], - exports: [ - SuiAccordion, - SuiAccordionPanel - ], - providers: [] - },] }, - ]; - /** @nocollapse */ - SuiAccordionModule.ctorParameters = function () { return []; }; - return SuiAccordionModule; -}()); -export { SuiAccordionModule }; -//# sourceMappingURL=accordion.module.js.map \ No newline at end of file diff --git a/dist/modules/accordion/accordion.module.js.map b/dist/modules/accordion/accordion.module.js.map deleted file mode 100644 index d305526dc..000000000 --- a/dist/modules/accordion/accordion.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accordion.module.js","sourceRoot":"","sources":["../../../src/modules/accordion/accordion.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;;;;;gBAEhE,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,iBAAiB;wBACjB,mBAAmB;qBACtB;oBACD,YAAY,EAAE;wBACV,YAAY;wBACZ,iBAAiB;qBACpB;oBACD,OAAO,EAAE;wBACL,YAAY;wBACZ,iBAAiB;qBACpB;oBACD,SAAS,EAAE,EAAE;iBAChB;;;;6BAtBD;;SAuBa,kBAAkB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiCollapseModule } from \"../collapse/index\";\nimport { SuiTransitionModule } from \"../transition/index\";\nimport { SuiAccordion } from \"./components/accordion\";\nimport { SuiAccordionPanel } from \"./components/accordion-panel\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiCollapseModule,\n SuiTransitionModule\n ],\n declarations: [\n SuiAccordion,\n SuiAccordionPanel\n ],\n exports: [\n SuiAccordion,\n SuiAccordionPanel\n ],\n providers: []\n})\nexport class SuiAccordionModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/accordion.module.metadata.json b/dist/modules/accordion/accordion.module.metadata.json deleted file mode 100644 index 3efa77f7b..000000000 --- a/dist/modules/accordion/accordion.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiAccordionModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":8},{"__symbolic":"reference","module":"../collapse/index","name":"SuiCollapseModule","line":10,"character":8},{"__symbolic":"reference","module":"../transition/index","name":"SuiTransitionModule","line":11,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/accordion","name":"SuiAccordion","line":14,"character":8},{"__symbolic":"reference","module":"./components/accordion-panel","name":"SuiAccordionPanel","line":15,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/accordion","name":"SuiAccordion","line":18,"character":8},{"__symbolic":"reference","module":"./components/accordion-panel","name":"SuiAccordionPanel","line":19,"character":8}],"providers":[]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion-panel.d.ts b/dist/modules/accordion/components/accordion-panel.d.ts deleted file mode 100644 index 5d8d8f98f..000000000 --- a/dist/modules/accordion/components/accordion-panel.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { EventEmitter, ChangeDetectorRef } from "@angular/core"; -import { SuiAccordionService } from "../services/accordion.service"; -import { TransitionController } from "../../transition/index"; -export declare class SuiAccordionPanel { - private _changeDetector; - private _service; - transitionController: TransitionController; - service: SuiAccordionService; - isDisabled: boolean; - private _isOpen; - isOpen: boolean; - readonly transition: string; - readonly transitionDuration: number; - isOpenChange: EventEmitter; - constructor(_changeDetector: ChangeDetectorRef); - toggle(): void; -} diff --git a/dist/modules/accordion/components/accordion-panel.js b/dist/modules/accordion/components/accordion-panel.js deleted file mode 100644 index 6e3b03cb8..000000000 --- a/dist/modules/accordion/components/accordion-panel.js +++ /dev/null @@ -1,88 +0,0 @@ -import { Component, Input, Output, EventEmitter, ChangeDetectorRef } from "@angular/core"; -import { TransitionController, Transition } from "../../transition/index"; -var SuiAccordionPanel = /** @class */ (function () { - function SuiAccordionPanel(_changeDetector) { - this._changeDetector = _changeDetector; - this.transitionController = new TransitionController(false); - this._isOpen = false; - this.isOpenChange = new EventEmitter(false); - } - Object.defineProperty(SuiAccordionPanel.prototype, "service", { - set: function (service) { - this._service = service; - this._changeDetector.detectChanges(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiAccordionPanel.prototype, "isOpen", { - get: function () { - return this._isOpen; - }, - set: function (value) { - // Convert to boolean (fixes false != undefined) - var isOpen = !!value; - if (isOpen !== this.isOpen) { - // Only update if the value has changed. - this._isOpen = isOpen; - if (isOpen && this._service) { - // If we are opening this panel, we must close the other ones. - this._service.closeOtherPanels(this); - } - this.isOpenChange.emit(this.isOpen); - // Cancel all current animations, and fade the contents. The direction is automatic. - this.transitionController.stopAll(); - this.transitionController.animate(new Transition(this.transition, this.transitionDuration)); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiAccordionPanel.prototype, "transition", { - get: function () { - if (this._service) { - return this._service.transition; - } - return "fade"; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiAccordionPanel.prototype, "transitionDuration", { - get: function () { - if (this._service) { - // Return the service defined transition duration. - return this._service.transitionDuration; - } - // Revert to instantaneous if the service is not yet loaded. - return 0; - }, - enumerable: true, - configurable: true - }); - SuiAccordionPanel.prototype.toggle = function () { - if (!this.isDisabled) { - this.isOpen = !this.isOpen; - } - }; - SuiAccordionPanel.decorators = [ - { type: Component, args: [{ - selector: "sui-accordion-panel", - exportAs: "suiAccordionPanel", - template: "\n\n
\n \n
\n\n
\n
\n \n
\n
\n", - styles: ["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiAccordionPanel.ctorParameters = function () { return [ - { type: ChangeDetectorRef, }, - ]; }; - SuiAccordionPanel.propDecorators = { - "isDisabled": [{ type: Input },], - "isOpen": [{ type: Input },], - "isOpenChange": [{ type: Output },], - }; - return SuiAccordionPanel; -}()); -export { SuiAccordionPanel }; -//# sourceMappingURL=accordion-panel.js.map \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion-panel.js.map b/dist/modules/accordion/components/accordion-panel.js.map deleted file mode 100644 index 86ab8b7ef..000000000 --- a/dist/modules/accordion/components/accordion-panel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accordion-panel.js","sourceRoot":"","sources":["../../../../src/modules/accordion/components/accordion-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;IAyFtE,2BAAoB,eAAiC;QAAjC,oBAAe,GAAf,eAAe,CAAkB;QACjD,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAE5D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAU,KAAK,CAAC,CAAC;KACxD;IA5DD,sBAAW,sCAAO;aAAlB,UAAmB,OAA2B;YAC1C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,C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AI,CAAC,MAAM,CAAC;SAC9B;KACJ;;gBAlGJ,SAAS,SAAC;oBACP,QAAQ,EAAE,qBAAqB;oBAC/B,QAAQ,EAAE,mBAAmB;oBAC7B,QAAQ,EAAE,8ZAWb;oBACG,MAAM,EAAE,CAAC,2LAUZ,CAAC;iBACD;;;;gBA9BgD,iBAAiB;;;+BAyC7D,KAAK;2BAKL,KAAK;iCA0CL,MAAM;;4BAxFX;;SA+Ba,iBAAiB","sourcesContent":["import { Component, Input, Output, EventEmitter, ChangeDetectorRef } from \"@angular/core\";\nimport { SuiAccordionService } from \"../services/accordion.service\";\nimport { TransitionController, Transition } from \"../../transition/index\";\n\n@Component({\n selector: \"sui-accordion-panel\",\n exportAs: \"suiAccordionPanel\",\n template: `\n\n
\n \n
\n\n
\n
\n \n
\n
\n`,\n styles: [`\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n`]\n})\nexport class SuiAccordionPanel {\n private _service:SuiAccordionService;\n\n public transitionController:TransitionController;\n\n public set service(service:SuiAccordionService) {\n this._service = service;\n this._changeDetector.detectChanges();\n }\n\n @Input()\n public isDisabled:boolean;\n\n private _isOpen:boolean;\n\n @Input()\n public get isOpen():boolean {\n return this._isOpen;\n }\n\n public set isOpen(value:boolean) {\n // Convert to boolean (fixes false != undefined)\n const isOpen = !!value;\n\n if (isOpen !== this.isOpen) {\n // Only update if the value has changed.\n this._isOpen = isOpen;\n\n if (isOpen && this._service) {\n // If we are opening this panel, we must close the other ones.\n this._service.closeOtherPanels(this);\n }\n this.isOpenChange.emit(this.isOpen);\n\n // Cancel all current animations, and fade the contents. The direction is automatic.\n this.transitionController.stopAll();\n this.transitionController.animate(new Transition(this.transition, this.transitionDuration));\n }\n }\n\n public get transition():string {\n if (this._service) {\n return this._service.transition;\n }\n\n return \"fade\";\n }\n\n public get transitionDuration():number {\n if (this._service) {\n // Return the service defined transition duration.\n return this._service.transitionDuration;\n }\n // Revert to instantaneous if the service is not yet loaded.\n return 0;\n }\n\n @Output()\n public isOpenChange:EventEmitter;\n\n constructor(private _changeDetector:ChangeDetectorRef) {\n this.transitionController = new TransitionController(false);\n\n this._isOpen = false;\n this.isOpenChange = new EventEmitter(false);\n }\n\n public toggle():void {\n if (!this.isDisabled) {\n this.isOpen = !this.isOpen;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion-panel.metadata.json b/dist/modules/accordion/components/accordion-panel.metadata.json deleted file mode 100644 index 5409b82d4..000000000 --- a/dist/modules/accordion/components/accordion-panel.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiAccordionPanel":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"sui-accordion-panel","exportAs":"suiAccordionPanel","template":"\n\n
\n \n
\n\n
\n
\n \n
\n
\n","styles":["\n/* Manual style as Semantic UI relies on > selector */\n.content {\n padding: .5em 0 1em;\n}\n\n/* Another > selector fix */\n:host:first-child .title {\n border-top: none;\n}\n"]}]}],"members":{"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":5}}]}],"isOpen":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":5}}]}],"isOpenChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":88,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":91,"character":40}]}],"toggle":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion.d.ts b/dist/modules/accordion/components/accordion.d.ts deleted file mode 100644 index 7ed82d443..000000000 --- a/dist/modules/accordion/components/accordion.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { QueryList, AfterContentInit } from "@angular/core"; -import { SuiAccordionPanel } from "./accordion-panel"; -import { SuiAccordionService } from "../services/accordion.service"; -export declare class SuiAccordion implements AfterContentInit { - accordionClasses: boolean; - closeOthers: boolean; - transition: string; - transitionDuration: number; - protected _service: SuiAccordionService; - protected _panels: QueryList; - constructor(); - ngAfterContentInit(): void; - updatePanels(): void; -} diff --git a/dist/modules/accordion/components/accordion.js b/dist/modules/accordion/components/accordion.js deleted file mode 100644 index e7b4c79d3..000000000 --- a/dist/modules/accordion/components/accordion.js +++ /dev/null @@ -1,63 +0,0 @@ -import { Component, Input, HostBinding, ContentChildren, QueryList } from "@angular/core"; -import { SuiAccordionPanel } from "./accordion-panel"; -import { SuiAccordionService } from "../services/accordion.service"; -var SuiAccordion = /** @class */ (function () { - function SuiAccordion() { - // Accordion service is unique to each set of panels. - this._service = new SuiAccordionService(); - this.accordionClasses = true; - } - Object.defineProperty(SuiAccordion.prototype, "closeOthers", { - get: function () { - return this._service.closeOthers; - }, - set: function (value) { - this._service.closeOthers = value; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiAccordion.prototype, "transition", { - set: function (transition) { - this._service.transition = transition; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiAccordion.prototype, "transitionDuration", { - set: function (duration) { - this._service.transitionDuration = duration; - }, - enumerable: true, - configurable: true - }); - SuiAccordion.prototype.ngAfterContentInit = function () { - var _this = this; - this.updatePanels(); - // Reconnect panels after they have updated. - this._panels.changes.subscribe(function () { return _this.updatePanels(); }); - }; - SuiAccordion.prototype.updatePanels = function () { - var _this = this; - this._panels.forEach(function (p) { return _this._service.addPanel(p); }); - }; - SuiAccordion.decorators = [ - { type: Component, args: [{ - selector: "sui-accordion", - template: "\n\n", - styles: ["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiAccordion.ctorParameters = function () { return []; }; - SuiAccordion.propDecorators = { - "accordionClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.accordion",] },], - "closeOthers": [{ type: Input },], - "transition": [{ type: Input },], - "transitionDuration": [{ type: Input },], - "_panels": [{ type: ContentChildren, args: [SuiAccordionPanel,] },], - }; - return SuiAccordion; -}()); -export { SuiAccordion }; -//# sourceMappingURL=accordion.js.map \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion.js.map b/dist/modules/accordion/components/accordion.js.map deleted file mode 100644 index 10f6399bd..000000000 --- a/dist/modules/accordion/components/accordion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../../src/modules/accordion/components/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAoB,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;;IAgDhE;;QAEI,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAE1C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;KAChC;0BA5BU,qCAAW;;YAClB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;;aAGrC,UAAuB,KAAa;YAChC,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,KAAK,CAAC;SACrC;;;;0BAGU,oCAAU;uBAAC,UAAiB;YACnC,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC;;;;;0BAI/B,4CAAkB;uBAAC,QAAe;YACzC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,GAAG,QAAQ,CAAC;;;;;IAezC,yCAAkB,GAAzB;QAAA,iBAKC;QAJG,IAAI,CAAC,YAAY,EAAE,CAAC;;QAGpB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,YAAY,EAAE,EAAnB,CAAmB,CAAC,CAAC;KAC7D;IAEM,mCAAY,GAAnB;QAAA,iBAEC;QADG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,KAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAzB,CAAyB,CAAC,CAAC;KACxD;;gBA9DJ,SAAS,SAAC;oBACP,QAAQ,EAAE,eAAe;oBACzB,QAAQ,EAAE,+BAEb;oBACG,MAAM,EAAE,CAAC,gMAUZ,CAAC;iBACD;;;;;qCAEI,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,iBAAiB;gCAG7B,KAAK;+BASL,KAAK;uCAKL,KAAK;4BAOL,eAAe,SAAC,iBAAiB;;uBA/CtC;;SAqBa,YAAY","sourcesContent":["import { Component, Input, HostBinding, ContentChildren, QueryList, AfterContentInit } from \"@angular/core\";\nimport { SuiAccordionPanel } from \"./accordion-panel\";\nimport { SuiAccordionService } from \"../services/accordion.service\";\n\n@Component({\n selector: \"sui-accordion\",\n template: `\n\n`,\n styles: [`\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n`]\n})\nexport class SuiAccordion implements AfterContentInit {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.accordion\")\n public accordionClasses:boolean;\n\n @Input()\n public get closeOthers():boolean {\n return this._service.closeOthers;\n }\n\n public set closeOthers(value:boolean) {\n this._service.closeOthers = value;\n }\n\n @Input()\n public set transition(transition:string) {\n this._service.transition = transition;\n }\n\n @Input()\n public set transitionDuration(duration:number) {\n this._service.transitionDuration = duration;\n }\n\n protected _service:SuiAccordionService;\n\n @ContentChildren(SuiAccordionPanel)\n protected _panels:QueryList;\n\n constructor() {\n // Accordion service is unique to each set of panels.\n this._service = new SuiAccordionService();\n\n this.accordionClasses = true;\n }\n\n public ngAfterContentInit():void {\n this.updatePanels();\n\n // Reconnect panels after they have updated.\n this._panels.changes.subscribe(() => this.updatePanels());\n }\n\n public updatePanels():void {\n this._panels.forEach(p => this._service.addPanel(p));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/components/accordion.metadata.json b/dist/modules/accordion/components/accordion.metadata.json deleted file mode 100644 index be07d8dc8..000000000 --- a/dist/modules/accordion/components/accordion.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiAccordion":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"sui-accordion","template":"\n\n","styles":["\n/* Fix for general styling issues */\n:host {\n display: block;\n}\n\n/* Fix for styled border issue */\n:host.styled sui-accordion-panel:first-child .title {\n border-top: none\n}\n"]}]}],"members":{"accordionClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":22,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":23,"character":5},"arguments":["class.accordion"]}]}],"closeOthers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":5}}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":5}}]}],"_panels":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":47,"character":5},"arguments":[{"__symbolic":"reference","module":"./accordion-panel","name":"SuiAccordionPanel","line":47,"character":21}]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngAfterContentInit":[{"__symbolic":"method"}],"updatePanels":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/accordion/index.d.ts b/dist/modules/accordion/index.d.ts deleted file mode 100644 index 896dfdbf3..000000000 --- a/dist/modules/accordion/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./components/accordion-panel"; -export * from "./components/accordion"; -export * from "./services/accordion.service"; -export * from "./accordion.module"; diff --git a/dist/modules/accordion/index.js b/dist/modules/accordion/index.js deleted file mode 100644 index 734002508..000000000 --- a/dist/modules/accordion/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./components/accordion-panel"; -export * from "./components/accordion"; -export * from "./services/accordion.service"; -export * from "./accordion.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/accordion/index.js.map b/dist/modules/accordion/index.js.map deleted file mode 100644 index 5662209db..000000000 --- a/dist/modules/accordion/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/accordion/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AAEvC,cAAc,8BAA8B,CAAC;AAE7C,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./components/accordion-panel\";\nexport * from \"./components/accordion\";\n\nexport * from \"./services/accordion.service\";\n\nexport * from \"./accordion.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/index.metadata.json b/dist/modules/accordion/index.metadata.json deleted file mode 100644 index aa6b00556..000000000 --- a/dist/modules/accordion/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/accordion-panel"},{"from":"./components/accordion"},{"from":"./services/accordion.service"},{"from":"./accordion.module"}]}] \ No newline at end of file diff --git a/dist/modules/accordion/public.d.ts b/dist/modules/accordion/public.d.ts deleted file mode 100644 index fa2e1c44a..000000000 --- a/dist/modules/accordion/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiAccordionModule } from "./index"; diff --git a/dist/modules/accordion/public.js b/dist/modules/accordion/public.js deleted file mode 100644 index 92bd30f52..000000000 --- a/dist/modules/accordion/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiAccordionModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/accordion/public.js.map b/dist/modules/accordion/public.js.map deleted file mode 100644 index 0c82b149f..000000000 --- a/dist/modules/accordion/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/accordion/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EACrB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiAccordionModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/public.metadata.json b/dist/modules/accordion/public.metadata.json deleted file mode 100644 index 39e93a7b5..000000000 --- a/dist/modules/accordion/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiAccordionModule"]}]}] \ No newline at end of file diff --git a/dist/modules/accordion/services/accordion.service.d.ts b/dist/modules/accordion/services/accordion.service.d.ts deleted file mode 100644 index 3ce70abe1..000000000 --- a/dist/modules/accordion/services/accordion.service.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { SuiAccordionPanel } from "../components/accordion-panel"; -export declare class SuiAccordionService { - closeOthers: boolean; - transition: string; - transitionDuration: number; - panels: SuiAccordionPanel[]; - constructor(); - addPanel(panel: SuiAccordionPanel): void; - closeOtherPanels(panel: SuiAccordionPanel): void; -} diff --git a/dist/modules/accordion/services/accordion.service.js b/dist/modules/accordion/services/accordion.service.js deleted file mode 100644 index a52133bd7..000000000 --- a/dist/modules/accordion/services/accordion.service.js +++ /dev/null @@ -1,25 +0,0 @@ -var SuiAccordionService = /** @class */ (function () { - function SuiAccordionService() { - this.closeOthers = true; - this.transition = "fade"; - this.transitionDuration = 350; - this.panels = []; - } - SuiAccordionService.prototype.addPanel = function (panel) { - panel.service = this; - this.panels.push(panel); - }; - SuiAccordionService.prototype.closeOtherPanels = function (panel) { - if (!this.closeOthers) { - return; - } - this.panels.forEach(function (p) { - if (p !== panel) { - p.isOpen = false; - } - }); - }; - return SuiAccordionService; -}()); -export { SuiAccordionService }; -//# sourceMappingURL=accordion.service.js.map \ No newline at end of file diff --git a/dist/modules/accordion/services/accordion.service.js.map b/dist/modules/accordion/services/accordion.service.js.map deleted file mode 100644 index 2b3d6ae27..000000000 --- a/dist/modules/accordion/services/accordion.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accordion.service.js","sourceRoot":"","sources":["../../../../src/modules/accordion/services/accordion.service.ts"],"names":[],"mappings":"AAEA,IAAA;IAQI;QACI,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAExB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC;QAE9B,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;KACpB;IAEM,sCAAQ,GAAf,UAAgB,KAAuB;QACnC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC3B;IAEM,8CAAgB,GAAvB,UAAwB,KAAuB;QAC3C,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;YACpB,MAAM,CAAC;SACV;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC;YACjB,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;gBACd,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;aACpB;SACJ,CAAC,CAAC;KACN;8BAlCL;IAmCC,CAAA;AAjCD,+BAiCC","sourcesContent":["import { SuiAccordionPanel } from \"../components/accordion-panel\";\n\nexport class SuiAccordionService {\n public closeOthers:boolean;\n\n public transition:string;\n public transitionDuration:number;\n\n public panels:SuiAccordionPanel[];\n\n constructor() {\n this.closeOthers = true;\n\n this.transition = \"fade\";\n this.transitionDuration = 350;\n\n this.panels = [];\n }\n\n public addPanel(panel:SuiAccordionPanel):void {\n panel.service = this;\n this.panels.push(panel);\n }\n\n public closeOtherPanels(panel:SuiAccordionPanel):void {\n if (!this.closeOthers) {\n return;\n }\n\n this.panels.forEach(p => {\n if (p !== panel) {\n p.isOpen = false;\n }\n });\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/accordion/services/accordion.service.metadata.json b/dist/modules/accordion/services/accordion.service.metadata.json deleted file mode 100644 index d973e1e32..000000000 --- a/dist/modules/accordion/services/accordion.service.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiAccordionService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor"}],"addPanel":[{"__symbolic":"method"}],"closeOtherPanels":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/checkbox/checkbox.module.d.ts b/dist/modules/checkbox/checkbox.module.d.ts deleted file mode 100644 index 7dd0fb9d5..000000000 --- a/dist/modules/checkbox/checkbox.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiCheckboxModule { -} diff --git a/dist/modules/checkbox/checkbox.module.js b/dist/modules/checkbox/checkbox.module.js deleted file mode 100644 index 1f2a059bc..000000000 --- a/dist/modules/checkbox/checkbox.module.js +++ /dev/null @@ -1,37 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { FormsModule } from "@angular/forms"; -import { SuiCheckbox, SuiCheckboxValueAccessor } from "./components/checkbox"; -import { SuiRadio, SuiRadioValueAccessor } from "./components/radio"; -import { SuiRadioManager } from "./directives/radio-manager"; -var SuiCheckboxModule = /** @class */ (function () { - function SuiCheckboxModule() { - } - SuiCheckboxModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule, - FormsModule - ], - declarations: [ - SuiCheckbox, - SuiCheckboxValueAccessor, - SuiRadio, - SuiRadioValueAccessor, - SuiRadioManager - ], - exports: [ - SuiCheckbox, - SuiCheckboxValueAccessor, - SuiRadio, - SuiRadioValueAccessor, - SuiRadioManager - ] - },] }, - ]; - /** @nocollapse */ - SuiCheckboxModule.ctorParameters = function () { return []; }; - return SuiCheckboxModule; -}()); -export { SuiCheckboxModule }; -//# sourceMappingURL=checkbox.module.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/checkbox.module.js.map b/dist/modules/checkbox/checkbox.module.js.map deleted file mode 100644 index 5f378b4ff..000000000 --- a/dist/modules/checkbox/checkbox.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checkbox.module.js","sourceRoot":"","sources":["../../../src/modules/checkbox/checkbox.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;;;;;gBAE5D,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;qBACd;oBACD,YAAY,EAAE;wBACV,WAAW;wBACX,wBAAwB;wBACxB,QAAQ;wBACR,qBAAqB;wBACrB,eAAe;qBAClB;oBACD,OAAO,EAAE;wBACL,WAAW;wBACX,wBAAwB;wBACxB,QAAQ;wBACR,qBAAqB;wBACrB,eAAe;qBAClB;iBACJ;;;;4BA1BD;;SA2Ba,iBAAiB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { SuiCheckbox, SuiCheckboxValueAccessor } from \"./components/checkbox\";\nimport { SuiRadio, SuiRadioValueAccessor } from \"./components/radio\";\nimport { SuiRadioManager } from \"./directives/radio-manager\";\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule\n ],\n declarations: [\n SuiCheckbox,\n SuiCheckboxValueAccessor,\n SuiRadio,\n SuiRadioValueAccessor,\n SuiRadioManager\n ],\n exports: [\n SuiCheckbox,\n SuiCheckboxValueAccessor,\n SuiRadio,\n SuiRadioValueAccessor,\n SuiRadioManager\n ]\n})\nexport class SuiCheckboxModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/checkbox.module.metadata.json b/dist/modules/checkbox/checkbox.module.metadata.json deleted file mode 100644 index edcf61967..000000000 --- a/dist/modules/checkbox/checkbox.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiCheckboxModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":10,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/checkbox","name":"SuiCheckbox","line":13,"character":8},{"__symbolic":"reference","module":"./components/checkbox","name":"SuiCheckboxValueAccessor","line":14,"character":8},{"__symbolic":"reference","module":"./components/radio","name":"SuiRadio","line":15,"character":8},{"__symbolic":"reference","module":"./components/radio","name":"SuiRadioValueAccessor","line":16,"character":8},{"__symbolic":"reference","module":"./directives/radio-manager","name":"SuiRadioManager","line":17,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/checkbox","name":"SuiCheckbox","line":20,"character":8},{"__symbolic":"reference","module":"./components/checkbox","name":"SuiCheckboxValueAccessor","line":21,"character":8},{"__symbolic":"reference","module":"./components/radio","name":"SuiRadio","line":22,"character":8},{"__symbolic":"reference","module":"./components/radio","name":"SuiRadioValueAccessor","line":23,"character":8},{"__symbolic":"reference","module":"./directives/radio-manager","name":"SuiRadioManager","line":24,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/checkbox/components/checkbox.d.ts b/dist/modules/checkbox/components/checkbox.d.ts deleted file mode 100644 index 7d5860293..000000000 --- a/dist/modules/checkbox/components/checkbox.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { EventEmitter } from "@angular/core"; -import { ICustomValueAccessorHost, CustomValueAccessor } from "../../../misc/util/index"; -export declare class SuiCheckbox implements ICustomValueAccessorHost { - private _checkboxClasses; - name: string; - isChecked: boolean; - onCheckChange: EventEmitter; - onTouched: EventEmitter; - isDisabled: boolean; - isReadonly: boolean; - readonly checkedAttribute: string | undefined; - readonly isDisabledAttribute: string | undefined; - private _checkboxElement; - constructor(); - onMouseDown(e: MouseEvent): void; - onClick(): void; - onFocusOut(): void; - toggle(): void; - writeValue(value: boolean): void; - private focusCheckbox(); -} -export declare class SuiCheckboxValueAccessor extends CustomValueAccessor { - constructor(host: SuiCheckbox); -} diff --git a/dist/modules/checkbox/components/checkbox.js b/dist/modules/checkbox/components/checkbox.js deleted file mode 100644 index 0e836847e..000000000 --- a/dist/modules/checkbox/components/checkbox.js +++ /dev/null @@ -1,105 +0,0 @@ -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 __()); - }; -})(); -import { Component, Directive, Input, Output, HostListener, HostBinding, EventEmitter, ViewChild, ElementRef } from "@angular/core"; -import { customValueAccessorFactory, CustomValueAccessor } from "../../../misc/util/index"; -var SuiCheckbox = /** @class */ (function () { - function SuiCheckbox() { - this.isChecked = false; - this.onCheckChange = new EventEmitter(); - this.onTouched = new EventEmitter(); - this.isDisabled = false; - this.isReadonly = false; - this._checkboxClasses = true; - } - Object.defineProperty(SuiCheckbox.prototype, "checkedAttribute", { - get: function () { - return this.isChecked ? "" : undefined; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCheckbox.prototype, "isDisabledAttribute", { - get: function () { - return this.isDisabled ? "disabled" : undefined; - }, - enumerable: true, - configurable: true - }); - SuiCheckbox.prototype.onMouseDown = function (e) { - e.preventDefault(); - }; - SuiCheckbox.prototype.onClick = function () { - if (!this.isDisabled && !this.isReadonly) { - this.toggle(); - this.focusCheckbox(); - } - }; - SuiCheckbox.prototype.onFocusOut = function () { - this.onTouched.emit(); - }; - SuiCheckbox.prototype.toggle = function () { - this.isChecked = !this.isChecked; - this.onCheckChange.emit(this.isChecked); - }; - SuiCheckbox.prototype.writeValue = function (value) { - this.isChecked = value; - }; - SuiCheckbox.prototype.focusCheckbox = function () { - this._checkboxElement.nativeElement.focus(); - }; - SuiCheckbox.decorators = [ - { type: Component, args: [{ - selector: "sui-checkbox", - exportAs: "suiCheckbox", - template: "\n\n\n" - },] }, - ]; - /** @nocollapse */ - SuiCheckbox.ctorParameters = function () { return []; }; - SuiCheckbox.propDecorators = { - "_checkboxClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.checkbox",] },], - "name": [{ type: Input },], - "isChecked": [{ type: HostBinding, args: ["class.checked",] },], - "onCheckChange": [{ type: Output, args: ["checkChange",] },], - "onTouched": [{ type: Output, args: ["touched",] },], - "isDisabled": [{ type: Input },], - "isReadonly": [{ type: HostBinding, args: ["class.read-only",] }, { type: Input },], - "_checkboxElement": [{ type: ViewChild, args: ["checkbox",] },], - "onMouseDown": [{ type: HostListener, args: ["mousedown", ["$event"],] },], - "onClick": [{ type: HostListener, args: ["click",] },], - "onFocusOut": [{ type: HostListener, args: ["focusout",] },], - }; - return SuiCheckbox; -}()); -export { SuiCheckbox }; -var SuiCheckboxValueAccessor = /** @class */ (function (_super) { - __extends(SuiCheckboxValueAccessor, _super); - function SuiCheckboxValueAccessor(host) { - return _super.call(this, host) || this; - } - SuiCheckboxValueAccessor.decorators = [ - { type: Directive, args: [{ - selector: "sui-checkbox", - host: { - "(checkChange)": "onChange($event)", - "(touched)": "onTouched()" - }, - providers: [customValueAccessorFactory(SuiCheckboxValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiCheckboxValueAccessor.ctorParameters = function () { return [ - { type: SuiCheckbox, }, - ]; }; - return SuiCheckboxValueAccessor; -}(CustomValueAccessor)); -export { SuiCheckboxValueAccessor }; -//# sourceMappingURL=checkbox.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/components/checkbox.js.map b/dist/modules/checkbox/components/checkbox.js.map deleted file mode 100644 index 05d869985..000000000 --- a/dist/modules/checkbox/components/checkbox.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../../src/modules/checkbox/components/checkbox.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAC9D,YAAY,EAAE,SAAS,EAAE,UAAU,EACtC,MAAM,eAAe,CAAC;AACvB,OAAO,EAA4B,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;;IAqDjH;QACI,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,IAAI,YAAY,EAAW,CAAC;QACjD,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAQ,CAAC;QAE1C,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,IAAI,CA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AAC,iBAAiB,cAC7B,KAAK;qCAWL,SAAS,SAAC,UAAU;gCAcpB,YAAY,SAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;4BAKpC,YAAY,SAAC,OAAO;+BAQpB,YAAY,SAAC,UAAU;;sBAjF5B;;SAsBa,WAAW;;IAsFsB,4CAAyC;IACnF,kCAAY,IAAgB;eACxB,kBAAM,IAAI,CAAC;KACd;;gBAXJ,SAAS,SAAC;oBACP,QAAQ,EAAE,cAAc;oBACxB,IAAI,EAAE;wBACF,eAAe,EAAE,kBAAkB;wBACnC,WAAW,EAAE,aAAa;qBAC7B;oBACD,SAAS,EAAE,CAAC,0BAA0B,CAAC,wBAAwB,CAAC,CAAC;iBACpE;;;;gBArFY,WAAW;;mCAtBxB;EA4G8C,mBAAmB;SAApD,wBAAwB","sourcesContent":["import {\n Component, Directive, Input, Output, HostListener, HostBinding,\n EventEmitter, ViewChild, ElementRef\n} from \"@angular/core\";\nimport { ICustomValueAccessorHost, customValueAccessorFactory, CustomValueAccessor } from \"../../../misc/util/index\";\n\n@Component({\n selector: \"sui-checkbox\",\n exportAs: \"suiCheckbox\",\n template: `\n\n\n`\n})\nexport class SuiCheckbox implements ICustomValueAccessorHost {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.checkbox\")\n private _checkboxClasses:boolean;\n\n @Input()\n public name:string;\n\n @HostBinding(\"class.checked\")\n public isChecked:boolean;\n\n @Output(\"checkChange\")\n public onCheckChange:EventEmitter;\n\n @Output(\"touched\")\n public onTouched:EventEmitter;\n\n @Input()\n public isDisabled:boolean;\n\n @HostBinding(\"class.read-only\")\n @Input()\n public isReadonly:boolean;\n\n public get checkedAttribute():string | undefined {\n return this.isChecked ? \"\" : undefined;\n }\n\n public get isDisabledAttribute():string | undefined {\n return this.isDisabled ? \"disabled\" : undefined;\n }\n\n @ViewChild(\"checkbox\")\n private _checkboxElement:ElementRef;\n\n constructor() {\n this.isChecked = false;\n this.onCheckChange = new EventEmitter();\n this.onTouched = new EventEmitter();\n\n this.isDisabled = false;\n this.isReadonly = false;\n\n this._checkboxClasses = true;\n }\n\n @HostListener(\"mousedown\", [\"$event\"])\n public onMouseDown(e:MouseEvent):void {\n e.preventDefault();\n }\n\n @HostListener(\"click\")\n public onClick():void {\n if (!this.isDisabled && !this.isReadonly) {\n this.toggle();\n this.focusCheckbox();\n }\n }\n\n @HostListener(\"focusout\")\n public onFocusOut():void {\n this.onTouched.emit();\n }\n\n public toggle():void {\n this.isChecked = !this.isChecked;\n this.onCheckChange.emit(this.isChecked);\n }\n\n public writeValue(value:boolean):void {\n this.isChecked = value;\n }\n\n private focusCheckbox():void {\n this._checkboxElement.nativeElement.focus();\n }\n}\n\n@Directive({\n selector: \"sui-checkbox\",\n host: {\n \"(checkChange)\": \"onChange($event)\",\n \"(touched)\": \"onTouched()\"\n },\n providers: [customValueAccessorFactory(SuiCheckboxValueAccessor)]\n})\nexport class SuiCheckboxValueAccessor extends CustomValueAccessor {\n constructor(host:SuiCheckbox) {\n super(host);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/components/checkbox.metadata.json b/dist/modules/checkbox/components/checkbox.metadata.json deleted file mode 100644 index 613ba0059..000000000 --- a/dist/modules/checkbox/components/checkbox.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiCheckbox":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"sui-checkbox","exportAs":"suiCheckbox","template":"\n\n\n"}]}],"members":{"_checkboxClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":23,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":24,"character":5},"arguments":["class.checkbox"]}]}],"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":5}}]}],"isChecked":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":30,"character":5},"arguments":["class.checked"]}]}],"onCheckChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":33,"character":5},"arguments":["checkChange"]}]}],"onTouched":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":36,"character":5},"arguments":["touched"]}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":5}}]}],"isReadonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":42,"character":5},"arguments":["class.read-only"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":5}}]}],"_checkboxElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":54,"character":5},"arguments":["checkbox"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"onMouseDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":68,"character":5},"arguments":["mousedown",["$event"]]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":73,"character":5},"arguments":["click"]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":81,"character":5},"arguments":["focusout"]}]}],"toggle":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"focusCheckbox":[{"__symbolic":"method"}]}},"SuiCheckboxValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":108,"character":46},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":100,"character":1},"arguments":[{"selector":"sui-checkbox","host":{"(checkChange)":"onChange($event)","(touched)":"onTouched()","$quoted$":["(checkChange)","(touched)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":106,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiCheckboxValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiCheckbox"}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/checkbox/components/radio.d.ts b/dist/modules/checkbox/components/radio.d.ts deleted file mode 100644 index 98689925c..000000000 --- a/dist/modules/checkbox/components/radio.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { EventEmitter } from "@angular/core"; -import { ICustomValueAccessorHost, CustomValueAccessor } from "../../../misc/util/index"; -export declare class SuiRadio implements ICustomValueAccessorHost { - private _radioClasses; - name: string; - value: T; - isChecked: boolean; - currentValue: T; - onCurrentValueChange: EventEmitter; - onTouched: EventEmitter; - isDisabled: boolean; - isReadonly: boolean; - private _radioElement; - readonly checkedAttribute: string | undefined; - readonly isDisabledAttribute: string | undefined; - constructor(); - onMouseDown(e: MouseEvent): void; - onClick(): void; - onFocusOut(): void; - update(): void; - writeValue(value: T): void; - private focusRadio(); -} -export declare class SuiRadioValueAccessor extends CustomValueAccessor> { - constructor(host: SuiRadio); -} diff --git a/dist/modules/checkbox/components/radio.js b/dist/modules/checkbox/components/radio.js deleted file mode 100644 index dd078f8d9..000000000 --- a/dist/modules/checkbox/components/radio.js +++ /dev/null @@ -1,108 +0,0 @@ -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 __()); - }; -})(); -import { Component, Directive, Input, Output, HostListener, HostBinding, EventEmitter, ViewChild, ElementRef } from "@angular/core"; -import { customValueAccessorFactory, CustomValueAccessor } from "../../../misc/util/index"; -var SuiRadio = /** @class */ (function () { - function SuiRadio() { - this._radioClasses = true; - this.isChecked = false; - this.onCurrentValueChange = new EventEmitter(); - this.onTouched = new EventEmitter(); - this.isDisabled = false; - this.isReadonly = false; - this._radioClasses = true; - } - Object.defineProperty(SuiRadio.prototype, "checkedAttribute", { - get: function () { - return this.isChecked ? "" : undefined; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiRadio.prototype, "isDisabledAttribute", { - get: function () { - return this.isDisabled ? "disabled" : undefined; - }, - enumerable: true, - configurable: true - }); - SuiRadio.prototype.onMouseDown = function (e) { - e.preventDefault(); - }; - SuiRadio.prototype.onClick = function () { - if (!this.isDisabled && !this.isReadonly) { - this.currentValue = this.value; - this.onCurrentValueChange.emit(this.currentValue); - this.update(); - this.focusRadio(); - } - }; - SuiRadio.prototype.onFocusOut = function () { - this.onTouched.emit(); - }; - SuiRadio.prototype.update = function () { - this.isChecked = this.currentValue === this.value; - }; - SuiRadio.prototype.writeValue = function (value) { - this.currentValue = value; - this.update(); - }; - SuiRadio.prototype.focusRadio = function () { - this._radioElement.nativeElement.focus(); - }; - SuiRadio.decorators = [ - { type: Component, args: [{ - selector: "sui-radio-button", - template: "\n\n\n" - },] }, - ]; - /** @nocollapse */ - SuiRadio.ctorParameters = function () { return []; }; - SuiRadio.propDecorators = { - "_radioClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.radio",] }, { type: HostBinding, args: ["class.checkbox",] },], - "name": [{ type: Input },], - "value": [{ type: Input },], - "isChecked": [{ type: HostBinding, args: ["class.checked",] },], - "onCurrentValueChange": [{ type: Output, args: ["currentValueChange",] },], - "onTouched": [{ type: Output, args: ["touched",] },], - "isDisabled": [{ type: Input },], - "isReadonly": [{ type: HostBinding, args: ["class.read-only",] }, { type: Input },], - "_radioElement": [{ type: ViewChild, args: ["radio",] },], - "onMouseDown": [{ type: HostListener, args: ["mousedown", ["$event"],] },], - "onClick": [{ type: HostListener, args: ["click",] },], - "onFocusOut": [{ type: HostListener, args: ["focusout",] },], - }; - return SuiRadio; -}()); -export { SuiRadio }; -var SuiRadioValueAccessor = /** @class */ (function (_super) { - __extends(SuiRadioValueAccessor, _super); - function SuiRadioValueAccessor(host) { - return _super.call(this, host) || this; - } - SuiRadioValueAccessor.decorators = [ - { type: Directive, args: [{ - selector: "sui-radio-button", - host: { - "(currentValueChange)": "onChange($event)", - "(touched)": "onTouched()" - }, - providers: [customValueAccessorFactory(SuiRadioValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiRadioValueAccessor.ctorParameters = function () { return [ - { type: SuiRadio, }, - ]; }; - return SuiRadioValueAccessor; -}(CustomValueAccessor)); -export { SuiRadioValueAccessor }; -//# sourceMappingURL=radio.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/components/radio.js.map b/dist/modules/checkbox/components/radio.js.map deleted file mode 100644 index c42ea42ea..000000000 --- a/dist/modules/checkbox/components/radio.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/modules/checkbox/components/radio.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAC9D,YAAY,EAAE,SAAS,EAAE,UAAU,EACtC,MAAM,eAAe,CAAC;AACvB,OAAO,EACuB,0BAA0B,EAAE,mBAAmB,EAE5E,MAAM,0BAA0B,CAAC;;IA4D9B;6BArCgC,IAAI;QAsChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,oBAAoB,GAAG,IAAI,YAAY,EAA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,SAAC;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,QAAQ,EAAE,6TAYb;iBACA;;;;;kCAEI,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,aAAa,cACzB,WAAW,SAAC,gBAAgB;yBAG5B,KAAK;0BAGL,KAAK;8BAGL,WAAW,SAAC,eAAe;yCAK3B,MAAM,SAAC,oBAAoB;8BAG3B,MAAM,SAAC,SAAS;+BAGhB,KAAK;+BAGL,WAAW,SAAC,iBAAiB,cAC7B,KAAK;kCAGL,SAAS,SAAC,OAAO;gCAsBjB,YAAY,SAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;4BAKpC,YAAY,SAAC,OAAO;+BAUpB,YAAY,SAAC,UAAU;;mBA7F5B;;SA0Ba,QAAQ;;IA8FyB,yCAAmC;IAC7E,+BAAY,IAAgB;eACxB,kBAAM,IAAI,CAAC;KACd;;gBAXJ,SAAS,SAAC;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE;wBACF,sBAAsB,EAAE,kBAAkB;wBAC1C,WAAW,EAAE,aAAa;qBAC7B;oBACD,SAAS,EAAE,CAAC,0BAA0B,CAAC,qBAAqB,CAAC,CAAC;iBACjE;;;;gBA7FY,QAAQ;;gCA1BrB;EAwH8C,mBAAmB;SAApD,qBAAqB","sourcesContent":["import {\n Component, Directive, Input, Output, HostListener, HostBinding,\n EventEmitter, ViewChild, ElementRef, ContentChildren, AfterContentInit, QueryList\n} from \"@angular/core\";\nimport {\n ICustomValueAccessorHost, customValueAccessorFactory, CustomValueAccessor,\n Util\n} from \"../../../misc/util/index\";\nimport { Subscription } from \"rxjs/Subscription\";\n\n@Component({\n selector: \"sui-radio-button\",\n template: `\n\n\n`\n})\nexport class SuiRadio implements ICustomValueAccessorHost {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.radio\")\n @HostBinding(\"class.checkbox\")\n private _radioClasses:boolean = true;\n\n @Input()\n public name:string;\n\n @Input()\n public value:T;\n\n @HostBinding(\"class.checked\")\n public isChecked:boolean;\n\n public currentValue:T;\n\n @Output(\"currentValueChange\")\n public onCurrentValueChange:EventEmitter;\n\n @Output(\"touched\")\n public onTouched:EventEmitter;\n\n @Input()\n public isDisabled:boolean;\n\n @HostBinding(\"class.read-only\")\n @Input()\n public isReadonly:boolean;\n\n @ViewChild(\"radio\")\n private _radioElement:ElementRef;\n\n public get checkedAttribute():string | undefined {\n return this.isChecked ? \"\" : undefined;\n }\n\n public get isDisabledAttribute():string | undefined {\n return this.isDisabled ? \"disabled\" : undefined;\n }\n\n constructor() {\n this.isChecked = false;\n this.onCurrentValueChange = new EventEmitter();\n this.onTouched = new EventEmitter();\n\n this.isDisabled = false;\n this.isReadonly = false;\n\n this._radioClasses = true;\n }\n\n @HostListener(\"mousedown\", [\"$event\"])\n public onMouseDown(e:MouseEvent):void {\n e.preventDefault();\n }\n\n @HostListener(\"click\")\n public onClick():void {\n if (!this.isDisabled && !this.isReadonly) {\n this.currentValue = this.value;\n this.onCurrentValueChange.emit(this.currentValue);\n this.update();\n this.focusRadio();\n }\n }\n\n @HostListener(\"focusout\")\n public onFocusOut():void {\n this.onTouched.emit();\n }\n\n public update():void {\n this.isChecked = this.currentValue === this.value;\n }\n\n public writeValue(value:T):void {\n this.currentValue = value;\n this.update();\n }\n\n private focusRadio():void {\n this._radioElement.nativeElement.focus();\n }\n}\n\n@Directive({\n selector: \"sui-radio-button\",\n host: {\n \"(currentValueChange)\": \"onChange($event)\",\n \"(touched)\": \"onTouched()\"\n },\n providers: [customValueAccessorFactory(SuiRadioValueAccessor)]\n})\nexport class SuiRadioValueAccessor extends CustomValueAccessor> {\n constructor(host:SuiRadio) {\n super(host);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/components/radio.metadata.json b/dist/modules/checkbox/components/radio.metadata.json deleted file mode 100644 index cfc1a00f0..000000000 --- a/dist/modules/checkbox/components/radio.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiRadio":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":10,"character":1},"arguments":[{"selector":"sui-radio-button","template":"\n\n\n"}]}],"members":{"_radioClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":27,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":28,"character":5},"arguments":["class.radio"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":29,"character":5},"arguments":["class.checkbox"]}]}],"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":5}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":5}}]}],"isChecked":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":38,"character":5},"arguments":["class.checked"]}]}],"onCurrentValueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":43,"character":5},"arguments":["currentValueChange"]}]}],"onTouched":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":46,"character":5},"arguments":["touched"]}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":5}}]}],"isReadonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":52,"character":5},"arguments":["class.read-only"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":53,"character":5}}]}],"_radioElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":56,"character":5},"arguments":["radio"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"onMouseDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":78,"character":5},"arguments":["mousedown",["$event"]]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":83,"character":5},"arguments":["click"]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":93,"character":5},"arguments":["focusout"]}]}],"update":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"focusRadio":[{"__symbolic":"method"}]}},"SuiRadioValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":120,"character":46},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":112,"character":1},"arguments":[{"selector":"sui-radio-button","host":{"(currentValueChange)":"onChange($event)","(touched)":"onTouched()","$quoted$":["(currentValueChange)","(touched)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":118,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiRadioValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiRadio","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":121,"character":30,"context":{"typeName":"T"}}]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/checkbox/directives/radio-manager.d.ts b/dist/modules/checkbox/directives/radio-manager.d.ts deleted file mode 100644 index 3ce014f29..000000000 --- a/dist/modules/checkbox/directives/radio-manager.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AfterContentInit, ElementRef } from "@angular/core"; -export declare class SuiRadioManager implements AfterContentInit { - element: ElementRef; - isNested: boolean; - private _subManagers; - private _renderedRadios; - private _radioSubs; - constructor(element: ElementRef); - ngAfterContentInit(): void; - private updateNesting(); - private updateRadios(); -} diff --git a/dist/modules/checkbox/directives/radio-manager.js b/dist/modules/checkbox/directives/radio-manager.js deleted file mode 100644 index 1c8fe0ef4..000000000 --- a/dist/modules/checkbox/directives/radio-manager.js +++ /dev/null @@ -1,60 +0,0 @@ -import { Directive, ContentChildren, QueryList, ElementRef } from "@angular/core"; -import { SuiRadio } from "../components/radio"; -import { Util } from "../../../misc/util/index"; -var SuiRadioManager = /** @class */ (function () { - function SuiRadioManager(element) { - this.element = element; - this.isNested = false; - this._radioSubs = []; - } - SuiRadioManager.prototype.ngAfterContentInit = function () { - var _this = this; - this.updateNesting(); - this._subManagers.changes.subscribe(function () { return _this.updateNesting(); }); - this.updateRadios(); - this._renderedRadios.changes.subscribe(function () { return _this.updateRadios(); }); - }; - SuiRadioManager.prototype.updateNesting = function () { - var _this = this; - this._subManagers - .filter(function (m) { return m !== _this; }) - .forEach(function (m) { return m.isNested = true; }); - }; - SuiRadioManager.prototype.updateRadios = function () { - var _this = this; - this._radioSubs.forEach(function (s) { return s.unsubscribe(); }); - this._radioSubs = []; - var groups = Util.Array.groupBy(this._renderedRadios.toArray(), "name"); - Object - .keys(groups) - .map(function (k) { return groups[k]; }) - .forEach(function (g) { - return g - .forEach(function (r) { - return _this._radioSubs - .push(r.onCurrentValueChange - .subscribe(function (v) { - if (!_this.isNested) { - g.forEach(function (radio) { return radio.writeValue(v); }); - } - })); - }); - }); - }; - SuiRadioManager.decorators = [ - { type: Directive, args: [{ - selector: "form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]" - },] }, - ]; - /** @nocollapse */ - SuiRadioManager.ctorParameters = function () { return [ - { type: ElementRef, }, - ]; }; - SuiRadioManager.propDecorators = { - "_subManagers": [{ type: ContentChildren, args: [SuiRadioManager, { descendants: true },] },], - "_renderedRadios": [{ type: ContentChildren, args: [SuiRadio, { descendants: true },] },], - }; - return SuiRadioManager; -}()); -export { SuiRadioManager }; -//# sourceMappingURL=radio-manager.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/directives/radio-manager.js.map b/dist/modules/checkbox/directives/radio-manager.js.map deleted file mode 100644 index 67f7fb833..000000000 --- a/dist/modules/checkbox/directives/radio-manager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"radio-manager.js","sourceRoot":"","sources":["../../../../src/modules/checkbox/directives/radio-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;;IAiB5C,yBAAmB,OAAkB;QAAlB,YAAO,GAAP,OAAO,CAAW;QACjC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;KACxB;IAEM,4CAAkB,GAAzB;QAAA,iBAMC;QALG,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,aAAa,EAAE,EAApB,CAAoB,CAAC,CAAC;QAEhE,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,YAAY,EAAE,EAAnB,CAAmB,CAAC,CAAC;KACrE;IAEO,uCAAa,GAArB;QAAA,iBAIC;QAHG,IAAI,CAAC,YAAY;aACZ,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,KAAI,EAAV,CAAU,CAAC;aACvB,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,QAAQ,GAAG,IAAI,EAAjB,CAAiB,CAAC,CAAC;KACxC;IAEO,sCAAY,GAApB;QAAA,iBAgBC;QAfG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,WAAW,EAAE,EAAf,CAAe,CAAC,CAAC;QAC9C,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QAErB,IAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;QAC1E,MAAM;aACD,IAAI,CAAC,MAAM,CAAC;aACZ,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,MAAM,CAAC,CAAC,CAAC,EAAT,CAAS,CAAC;aACnB,OAAO,CAAC,UAAA,CAAC;YAAI,OAAA,CAAC;iBACV,OAAO,CAAC,UAAA,CAAC;gBAAI,OAAA,KAAI,CAAC,UAAU;qBACxB,IAAI,CAAC,CAAC,CAAC,oBAAoB;qBACvB,SAAS,CAAC,UAAC,CAAG;oBACX,EAAE,CAAC,CAAC,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;wBACjB,CAAC,CAAC,OAAO,CAAC,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAnB,CAAmB,CAAC,CAAC;qBAC3C;iBACJ,CAAC,CAAC;YANG,CAMH,CAAC;QAPF,CAOE,CAAC,CAAC;KACzB;;gBAlDJ,SAAS,SAAC;oBACP,QAAQ,EAAE,oDAAoD;iBACjE;;;;gBAPiE,UAAU;;;iCAYvE,eAAe,SAAC,eAAe,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;oCAGtD,eAAe,SAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;0BAfpD;;SAQa,eAAe","sourcesContent":["import { Directive, AfterContentInit, ContentChildren, QueryList, ElementRef } from \"@angular/core\";\nimport { SuiRadio } from \"../components/radio\";\nimport { Subscription } from \"rxjs/Subscription\";\nimport { Util } from \"../../../misc/util/index\";\n\n@Directive({\n selector: \"form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]\"\n})\nexport class SuiRadioManager implements AfterContentInit {\n\n public isNested:boolean;\n\n @ContentChildren(SuiRadioManager, { descendants: true })\n private _subManagers:QueryList>;\n\n @ContentChildren(SuiRadio, { descendants: true })\n private _renderedRadios:QueryList>;\n\n private _radioSubs:Subscription[];\n\n constructor(public element:ElementRef) {\n this.isNested = false;\n this._radioSubs = [];\n }\n\n public ngAfterContentInit():void {\n this.updateNesting();\n this._subManagers.changes.subscribe(() => this.updateNesting());\n\n this.updateRadios();\n this._renderedRadios.changes.subscribe(() => this.updateRadios());\n }\n\n private updateNesting():void {\n this._subManagers\n .filter(m => m !== this)\n .forEach(m => m.isNested = true);\n }\n\n private updateRadios():void {\n this._radioSubs.forEach(s => s.unsubscribe());\n this._radioSubs = [];\n\n const groups = Util.Array.groupBy(this._renderedRadios.toArray(), \"name\");\n Object\n .keys(groups)\n .map(k => groups[k])\n .forEach(g => g\n .forEach(r => this._radioSubs\n .push(r.onCurrentValueChange\n .subscribe((v:T) => {\n if (!this.isNested) {\n g.forEach(radio => radio.writeValue(v));\n }\n }))));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/directives/radio-manager.metadata.json b/dist/modules/checkbox/directives/radio-manager.metadata.json deleted file mode 100644 index 8e19c0c61..000000000 --- a/dist/modules/checkbox/directives/radio-manager.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiRadioManager":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":5,"character":1},"arguments":[{"selector":"form:not([ngForm]):not([[ngForm]]),ngForm,[ngForm]"}]}],"members":{"_subManagers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":12,"character":5},"arguments":[{"__symbolic":"reference","name":"SuiRadioManager"},{"descendants":true}]}]}],"_renderedRadios":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":15,"character":5},"arguments":[{"__symbolic":"reference","module":"../components/radio","name":"SuiRadio","line":15,"character":21},{"descendants":true}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":20,"character":31}]}],"ngAfterContentInit":[{"__symbolic":"method"}],"updateNesting":[{"__symbolic":"method"}],"updateRadios":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/checkbox/index.d.ts b/dist/modules/checkbox/index.d.ts deleted file mode 100644 index d690cc347..000000000 --- a/dist/modules/checkbox/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./components/checkbox"; -export * from "./components/radio"; -export * from "./directives/radio-manager"; -export * from "./checkbox.module"; diff --git a/dist/modules/checkbox/index.js b/dist/modules/checkbox/index.js deleted file mode 100644 index b8481b9e7..000000000 --- a/dist/modules/checkbox/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./components/checkbox"; -export * from "./components/radio"; -export * from "./directives/radio-manager"; -export * from "./checkbox.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/index.js.map b/dist/modules/checkbox/index.js.map deleted file mode 100644 index 7fd19b3e8..000000000 --- a/dist/modules/checkbox/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/checkbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./components/checkbox\";\nexport * from \"./components/radio\";\n\nexport * from \"./directives/radio-manager\";\n\nexport * from \"./checkbox.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/index.metadata.json b/dist/modules/checkbox/index.metadata.json deleted file mode 100644 index 7d90c1adb..000000000 --- a/dist/modules/checkbox/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/checkbox"},{"from":"./components/radio"},{"from":"./directives/radio-manager"},{"from":"./checkbox.module"}]}] \ No newline at end of file diff --git a/dist/modules/checkbox/public.d.ts b/dist/modules/checkbox/public.d.ts deleted file mode 100644 index 67db58523..000000000 --- a/dist/modules/checkbox/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiCheckboxModule } from "./index"; diff --git a/dist/modules/checkbox/public.js b/dist/modules/checkbox/public.js deleted file mode 100644 index 50bc10c8e..000000000 --- a/dist/modules/checkbox/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiCheckboxModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/checkbox/public.js.map b/dist/modules/checkbox/public.js.map deleted file mode 100644 index 34244d890..000000000 --- a/dist/modules/checkbox/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/checkbox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACpB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiCheckboxModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/checkbox/public.metadata.json b/dist/modules/checkbox/public.metadata.json deleted file mode 100644 index c830a6b45..000000000 --- a/dist/modules/checkbox/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiCheckboxModule"]}]}] \ No newline at end of file diff --git a/dist/modules/collapse/collapse.module.d.ts b/dist/modules/collapse/collapse.module.d.ts deleted file mode 100644 index fd6913dea..000000000 --- a/dist/modules/collapse/collapse.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiCollapseModule { -} diff --git a/dist/modules/collapse/collapse.module.js b/dist/modules/collapse/collapse.module.js deleted file mode 100644 index 6aefa990b..000000000 --- a/dist/modules/collapse/collapse.module.js +++ /dev/null @@ -1,25 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiCollapse } from "./directives/collapse"; -var SuiCollapseModule = /** @class */ (function () { - function SuiCollapseModule() { - } - SuiCollapseModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule - ], - declarations: [ - SuiCollapse - ], - exports: [ - SuiCollapse - ] - },] }, - ]; - /** @nocollapse */ - SuiCollapseModule.ctorParameters = function () { return []; }; - return SuiCollapseModule; -}()); -export { SuiCollapseModule }; -//# sourceMappingURL=collapse.module.js.map \ No newline at end of file diff --git a/dist/modules/collapse/collapse.module.js.map b/dist/modules/collapse/collapse.module.js.map deleted file mode 100644 index 52c387758..000000000 --- a/dist/modules/collapse/collapse.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"collapse.module.js","sourceRoot":"","sources":["../../../src/modules/collapse/collapse.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;;;;;gBAEnD,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;qBACf;oBACD,YAAY,EAAE;wBACV,WAAW;qBACd;oBACD,OAAO,EAAE;wBACL,WAAW;qBACd;iBACJ;;;;4BAdD;;SAea,iBAAiB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiCollapse } from \"./directives/collapse\";\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n SuiCollapse\n ],\n exports: [\n SuiCollapse\n ]\n})\nexport class SuiCollapseModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/collapse/collapse.module.metadata.json b/dist/modules/collapse/collapse.module.metadata.json deleted file mode 100644 index b48a2a0ee..000000000 --- a/dist/modules/collapse/collapse.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiCollapseModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":8}],"declarations":[{"__symbolic":"reference","module":"./directives/collapse","name":"SuiCollapse","line":9,"character":8}],"exports":[{"__symbolic":"reference","module":"./directives/collapse","name":"SuiCollapse","line":12,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/collapse/directives/collapse.d.ts b/dist/modules/collapse/directives/collapse.d.ts deleted file mode 100644 index 3ec972eb3..000000000 --- a/dist/modules/collapse/directives/collapse.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ElementRef, Renderer2 } from "@angular/core"; -export declare class SuiCollapse { - private _element; - private _renderer; - private _isExpanded; - private readonly _isCollapsed; - private _isCollapsing; - private _pristine; - suiCollapse: boolean; - collapseDuration: number; - private readonly _animationDuration; - constructor(_element: ElementRef, _renderer: Renderer2); - hide(): void; - show(): void; - private animate(startHeight, endHeight, removeOnComplete?, callback?); -} diff --git a/dist/modules/collapse/directives/collapse.js b/dist/modules/collapse/directives/collapse.js deleted file mode 100644 index eb2fec8a0..000000000 --- a/dist/modules/collapse/directives/collapse.js +++ /dev/null @@ -1,124 +0,0 @@ -import { Directive, ElementRef, Input, HostBinding, Renderer2 } from "@angular/core"; -var SuiCollapse = /** @class */ (function () { - function SuiCollapse(_element, _renderer) { - this._element = _element; - this._renderer = _renderer; - this._pristine = true; - // Collapse animation duration is 350ms by default. - this.collapseDuration = 350; - this._isExpanded = false; - this._isCollapsing = false; - } - Object.defineProperty(SuiCollapse.prototype, "_isCollapsed", { - get: - // Set when the collapse is closed, and not animating. - function () { - return !this._isExpanded && !this._isCollapsing; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCollapse.prototype, "suiCollapse", { - get: function () { - return this._isExpanded; - }, - // Sets the state of the collapse, `true` is collapsed. - set: - // Sets the state of the collapse, `true` is collapsed. - function (value) { - if (value) { - this.hide(); - } - else { - this.show(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCollapse.prototype, "_animationDuration", { - get: function () { - return this._pristine ? 0 : this.collapseDuration; - }, - enumerable: true, - configurable: true - }); - SuiCollapse.prototype.hide = function () { - var _this = this; - this._isCollapsing = true; - this._isExpanded = false; - // Forcibly hide the overflow so that content is not visible past the boundaries of its container. - this._renderer.setStyle(this._element.nativeElement, "overflow", "hidden"); - // Animate the host element from its scroll height to 0. - this.animate(this._element.nativeElement.scrollHeight, 0, false, function () { - _this._isCollapsing = false; - }); - }; - SuiCollapse.prototype.show = function () { - var _this = this; - this._isCollapsing = true; - // Animate the host element from its offset height to its scroll height. - this.animate(this._element.nativeElement.offsetHeight, this._element.nativeElement.scrollHeight, true, function () { - // Remove the overflow override to enable user styling once again. - // Remove the overflow override to enable user styling once again. - _this._renderer.removeStyle(_this._element.nativeElement, "overflow"); - _this._isCollapsing = false; - _this._isExpanded = true; - }); - }; - SuiCollapse.prototype.animate = function (startHeight, endHeight, removeOnComplete, callback) { - if (removeOnComplete === void 0) { removeOnComplete = false; } - if (callback === void 0) { callback = function () { }; } - var heightFrames = [ - { - offset: 0, - height: startHeight + "px" - }, - { - offset: 1, - height: endHeight + "px" - } - ]; - if (removeOnComplete) { - heightFrames.push({ - offset: 1, - height: "auto" - }); - } - // Animate the collapse using the web animations API. - // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. - this._element.nativeElement.animate(heightFrames, { - delay: 0, - // Disable animation on 1st collapse / expansion. - duration: this._animationDuration, - iterations: 1, - easing: "ease", - fill: "both" - }); - if (this._pristine) { - // Remove pristine flag when first hit. - this._pristine = false; - } - setTimeout(function () { return callback(); }, this.collapseDuration); - }; - SuiCollapse.decorators = [ - { type: Directive, args: [{ - selector: "[suiCollapse]" - },] }, - ]; - /** @nocollapse */ - SuiCollapse.ctorParameters = function () { return [ - { type: ElementRef, }, - { type: Renderer2, }, - ]; }; - SuiCollapse.propDecorators = { - "_isExpanded": [{ type: HostBinding, args: ["class.expanded",] },], - "_isCollapsed": [{ type: HostBinding, args: ["class.collapsed",] },], - "_isCollapsing": [{ type: HostBinding, args: ["class.collapsing",] },], - "suiCollapse": [{ type: Input },], - "collapseDuration": [{ type: Input },], - }; - return SuiCollapse; -}()); -export { SuiCollapse }; -//# sourceMappingURL=collapse.js.map \ No newline at end of file diff --git a/dist/modules/collapse/directives/collapse.js.map b/dist/modules/collapse/directives/collapse.js.map deleted file mode 100644 index 321e2238d..000000000 --- a/dist/modules/collapse/directives/collapse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"collapse.js","sourceRoot":"","sources":["../../../../src/modules/collapse/directives/collapse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;IA4CjF,qBAA2B,QAAmB,EAAU,SAAmB;QAAhD,aAAQ,GAAR,QAAQ,CAAW;QAAU,cAAS,GAAT,SAAS,CAAU;QACvE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;;QAGtB,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAC;QAE5B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;KAC9B;0BAxCW,qCAAY;;;;YACpB,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;;;;;0BAWzC,oCAAW;;YAClB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;;QAG5B,uDAAuD;;;QACvD,UAAuB,KAAa;YAChC,EAAE,CAA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CAAA,EAAA,wBAAgC;QAAE,yBAAA,EAAA,0BAA8B;QAClH,IAAM,YAAY,GAAG;YACjB;gBACI,MAAM,EAAE,CAAC;gBACT,MAAM,EAAK,WAAW,OAAI;aAC7B;YACD;gBACI,MAAM,EAAE,CAAC;gBACT,MAAM,EAAK,SAAS,OAAI;aAC3B;SACJ,CAAC;QAEF,EAAE,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;YACnB,YAAY,CAAC,IAAI,CAAC;gBACd,MAAM,EAAE,CAAC;gBACT,MAAM,EAAE,MAAM;aACjB,CAAC,CAAC;SACN;;;QAID,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAC/B,YAAY,EACZ;YACI,KAAK,EAAE,CAAC;;YAER,QAAQ,EAAE,IAAI,CAAC,kBAAkB;YACjC,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,MAAM;SACf,CACJ,CAAC;QAEF,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;;YAEjB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;SAC1B;QAED,UAAU,CAAC,cAAM,OAAA,QAAQ,EAAE,EAAV,CAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;KACvD;;gBArHJ,SAAS,SAAC;oBACP,QAAQ,EAAE,eAAe;iBAC5B;;;;gBAJmB,UAAU;gBAAsB,SAAS;;;gCAOxD,WAAW,SAAC,gBAAgB;iCAI5B,WAAW,SAAC,iBAAiB;kCAM7B,WAAW,SAAC,kBAAkB;gCAM9B,KAAK;qCAcL,KAAK;;sBArCV;;SAKa,WAAW","sourcesContent":["import { Directive, ElementRef, Input, HostBinding, Renderer2 } from \"@angular/core\";\n\n@Directive({\n selector: \"[suiCollapse]\"\n})\nexport class SuiCollapse {\n // Set when the collapse is open, and not animating.\n @HostBinding(\"class.expanded\")\n private _isExpanded:boolean;\n\n // Set when the collapse is closed, and not animating.\n @HostBinding(\"class.collapsed\")\n private get _isCollapsed():boolean {\n return !this._isExpanded && !this._isCollapsing;\n }\n\n // Set when the collapse is animating.\n @HostBinding(\"class.collapsing\")\n private _isCollapsing:boolean;\n\n // Flag that is initially true, to make the 1st animation instantaneous.\n private _pristine:boolean;\n\n @Input()\n public get suiCollapse():boolean {\n return this._isExpanded;\n }\n\n // Sets the state of the collapse, `true` is collapsed.\n public set suiCollapse(value:boolean) {\n if (value) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n @Input()\n public collapseDuration:number;\n\n private get _animationDuration():number {\n return this._pristine ? 0 : this.collapseDuration;\n }\n\n public constructor(private _element:ElementRef, private _renderer:Renderer2) {\n this._pristine = true;\n\n // Collapse animation duration is 350ms by default.\n this.collapseDuration = 350;\n\n this._isExpanded = false;\n this._isCollapsing = false;\n }\n\n public hide():void {\n this._isCollapsing = true;\n this._isExpanded = false;\n\n // Forcibly hide the overflow so that content is not visible past the boundaries of its container.\n this._renderer.setStyle(this._element.nativeElement, \"overflow\", \"hidden\");\n\n // Animate the host element from its scroll height to 0.\n this.animate(this._element.nativeElement.scrollHeight, 0, false, () => {\n this._isCollapsing = false;\n });\n }\n\n public show():void {\n this._isCollapsing = true;\n\n // Animate the host element from its offset height to its scroll height.\n this.animate(this._element.nativeElement.offsetHeight, this._element.nativeElement.scrollHeight, true, () => {\n // Remove the overflow override to enable user styling once again.\n this._renderer.removeStyle(this._element.nativeElement, \"overflow\");\n\n this._isCollapsing = false;\n this._isExpanded = true;\n });\n }\n\n private animate(startHeight:number, endHeight:number, removeOnComplete:boolean = false, callback:() => void = () => {}):void {\n const heightFrames = [\n {\n offset: 0,\n height: `${startHeight}px`\n },\n {\n offset: 1,\n height: `${endHeight}px`\n }\n ];\n\n if (removeOnComplete) {\n heightFrames.push({\n offset: 1,\n height: `auto`\n });\n }\n\n // Animate the collapse using the web animations API.\n // Using directly because Renderer2 doesn't have invokeElementMethod method anymore.\n this._element.nativeElement.animate(\n heightFrames,\n {\n delay: 0,\n // Disable animation on 1st collapse / expansion.\n duration: this._animationDuration,\n iterations: 1,\n easing: \"ease\",\n fill: \"both\"\n }\n );\n\n if (this._pristine) {\n // Remove pristine flag when first hit.\n this._pristine = false;\n }\n\n setTimeout(() => callback(), this.collapseDuration);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/collapse/directives/collapse.metadata.json b/dist/modules/collapse/directives/collapse.metadata.json deleted file mode 100644 index 1f9ef8550..000000000 --- a/dist/modules/collapse/directives/collapse.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiCollapse":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[suiCollapse]"}]}],"members":{"_isExpanded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":7,"character":5},"arguments":["class.expanded"]}]}],"_isCollapsed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":11,"character":5},"arguments":["class.collapsed"]}]}],"_isCollapsing":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":17,"character":5},"arguments":["class.collapsing"]}]}],"suiCollapse":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":5}}]}],"collapseDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":44,"character":40},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":44,"character":70}]}],"hide":[{"__symbolic":"method"}],"show":[{"__symbolic":"method"}],"animate":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/collapse/index.d.ts b/dist/modules/collapse/index.d.ts deleted file mode 100644 index f5801a4da..000000000 --- a/dist/modules/collapse/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./directives/collapse"; -export * from "./collapse.module"; diff --git a/dist/modules/collapse/index.js b/dist/modules/collapse/index.js deleted file mode 100644 index d5ff3f675..000000000 --- a/dist/modules/collapse/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./directives/collapse"; -export * from "./collapse.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/collapse/index.js.map b/dist/modules/collapse/index.js.map deleted file mode 100644 index 742a36bf2..000000000 --- a/dist/modules/collapse/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/collapse/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AAEtC,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./directives/collapse\";\n\nexport * from \"./collapse.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/collapse/index.metadata.json b/dist/modules/collapse/index.metadata.json deleted file mode 100644 index 842632f74..000000000 --- a/dist/modules/collapse/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./directives/collapse"},{"from":"./collapse.module"}]}] \ No newline at end of file diff --git a/dist/modules/collapse/public.d.ts b/dist/modules/collapse/public.d.ts deleted file mode 100644 index dc596fca6..000000000 --- a/dist/modules/collapse/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiCollapseModule } from "./index"; diff --git a/dist/modules/collapse/public.js b/dist/modules/collapse/public.js deleted file mode 100644 index e6f448298..000000000 --- a/dist/modules/collapse/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiCollapseModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/collapse/public.js.map b/dist/modules/collapse/public.js.map deleted file mode 100644 index 27f183dad..000000000 --- a/dist/modules/collapse/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/collapse/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACpB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiCollapseModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/collapse/public.metadata.json b/dist/modules/collapse/public.metadata.json deleted file mode 100644 index cd9c02b24..000000000 --- a/dist/modules/collapse/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiCollapseModule"]}]}] \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-config.d.ts b/dist/modules/datepicker/classes/calendar-config.d.ts deleted file mode 100644 index 8431a0ed3..000000000 --- a/dist/modules/datepicker/classes/calendar-config.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { CalendarMode } from "../services/calendar.service"; -import { CalendarMappings } from "./calendar-mappings"; -import { DatePrecision } from "../../../misc/util/index"; -export declare abstract class CalendarConfig { - mode: CalendarMode; - precision: DatePrecision; - mappings: CalendarMappings; - fallback: string; - dateMinBound?: Date; - dateMaxBound?: Date; - constructor(mode: CalendarMode, precision: DatePrecision, mappings: CalendarMappings, fallback: string); - updateBounds(providedDate: Date): void; -} -export declare class DateConfigBase extends CalendarConfig { - constructor(precision: DatePrecision, mappings: CalendarMappings, fallback: string); -} -export declare class YearConfig extends DateConfigBase { - constructor(); -} -export declare class MonthConfig extends DateConfigBase { - constructor(); -} -export declare class DateConfig extends DateConfigBase { - constructor(); -} -export declare class DatetimeConfig extends CalendarConfig { - constructor(); -} -export declare class TimeConfig extends CalendarConfig { - constructor(); - updateBounds(providedDate: Date): void; -} diff --git a/dist/modules/datepicker/classes/calendar-config.js b/dist/modules/datepicker/classes/calendar-config.js deleted file mode 100644 index 624773738..000000000 --- a/dist/modules/datepicker/classes/calendar-config.js +++ /dev/null @@ -1,80 +0,0 @@ -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 __()); - }; -})(); -import { CalendarMode } from "../services/calendar.service"; -import { DatetimeMappings, DateMappings, TimeMappings, MonthMappings, YearMappings } from "./calendar-mappings"; -import { DatePrecision, DateUtil } from "../../../misc/util/index"; -var CalendarConfig = /** @class */ (function () { - function CalendarConfig(mode, precision, mappings, fallback) { - this.mode = mode; - this.precision = precision; - this.mappings = mappings; - this.fallback = fallback; - } - CalendarConfig.prototype.updateBounds = function (providedDate) { - this.dateMinBound = DateUtil.startOf(DatePrecision.Year, new Date(), true); - this.dateMinBound.setFullYear(0); - }; - return CalendarConfig; -}()); -export { CalendarConfig }; -var DateConfigBase = /** @class */ (function (_super) { - __extends(DateConfigBase, _super); - function DateConfigBase(precision, mappings, fallback) { - return _super.call(this, CalendarMode.DateOnly, precision, mappings, fallback) || this; - } - return DateConfigBase; -}(CalendarConfig)); -export { DateConfigBase }; -var YearConfig = /** @class */ (function (_super) { - __extends(YearConfig, _super); - function YearConfig() { - return _super.call(this, DatePrecision.Year, new YearMappings(), "number") || this; - } - return YearConfig; -}(DateConfigBase)); -export { YearConfig }; -var MonthConfig = /** @class */ (function (_super) { - __extends(MonthConfig, _super); - function MonthConfig() { - return _super.call(this, DatePrecision.Month, new MonthMappings(), "month") || this; - } - return MonthConfig; -}(DateConfigBase)); -export { MonthConfig }; -var DateConfig = /** @class */ (function (_super) { - __extends(DateConfig, _super); - function DateConfig() { - return _super.call(this, DatePrecision.Date, new DateMappings(), "date") || this; - } - return DateConfig; -}(DateConfigBase)); -export { DateConfig }; -var DatetimeConfig = /** @class */ (function (_super) { - __extends(DatetimeConfig, _super); - function DatetimeConfig() { - return _super.call(this, CalendarMode.Both, DatePrecision.Minute, new DatetimeMappings(), "datetime-local") || this; - } - return DatetimeConfig; -}(CalendarConfig)); -export { DatetimeConfig }; -var TimeConfig = /** @class */ (function (_super) { - __extends(TimeConfig, _super); - function TimeConfig() { - return _super.call(this, CalendarMode.TimeOnly, DatePrecision.Minute, new TimeMappings(), "time") || this; - } - TimeConfig.prototype.updateBounds = function (providedDate) { - this.dateMaxBound = DateUtil.endOf(DatePrecision.Date, DateUtil.clone(providedDate)); - this.dateMinBound = DateUtil.previous(DatePrecision.Date, DateUtil.clone(this.dateMaxBound)); - }; - return TimeConfig; -}(CalendarConfig)); -export { TimeConfig }; -//# sourceMappingURL=calendar-config.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-config.js.map b/dist/modules/datepicker/classes/calendar-config.js.map deleted file mode 100644 index 71c9d2952..000000000 --- a/dist/modules/datepicker/classes/calendar-config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calendar-config.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/classes/calendar-config.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAoB,gBAAgB,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClI,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEnE,IAAA;IAUI,wBAAY,IAAiB,EAAE,SAAuB,EAAE,QAAyB,EAAE,QAAe;QAC9F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;KAC5B;IAEM,qCAAY,GAAnB,UAAoB,YAAiB;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,iCAAY,GAAnB,UAAoB,YAAiB;QACjC,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;QACrF,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;KAChG;qBAlFL;EAsEgC,cAAc,EAa7C,CAAA;AAbD,sBAaC","sourcesContent":["import { CalendarMode } from \"../services/calendar.service\";\nimport { CalendarMappings, DatetimeMappings, DateMappings, TimeMappings, MonthMappings, YearMappings } from \"./calendar-mappings\";\nimport { DatePrecision, DateUtil } from \"../../../misc/util/index\";\n\nexport abstract class CalendarConfig {\n public mode:CalendarMode;\n public precision:DatePrecision;\n public mappings:CalendarMappings;\n\n public fallback:string;\n\n public dateMinBound?:Date;\n public dateMaxBound?:Date;\n\n constructor(mode:CalendarMode, precision:DatePrecision, mappings:CalendarMappings, fallback:string) {\n this.mode = mode;\n this.precision = precision;\n this.mappings = mappings;\n this.fallback = fallback;\n }\n\n public updateBounds(providedDate:Date):void {\n this.dateMinBound = DateUtil.startOf(DatePrecision.Year, new Date(), true);\n this.dateMinBound.setFullYear(0);\n }\n}\n\nexport class DateConfigBase extends CalendarConfig {\n constructor(precision:DatePrecision, mappings:CalendarMappings, fallback:string) {\n super(CalendarMode.DateOnly, precision, mappings, fallback);\n }\n}\n\nexport class YearConfig extends DateConfigBase {\n constructor() {\n super(\n DatePrecision.Year,\n new YearMappings(),\n \"number\");\n }\n}\n\nexport class MonthConfig extends DateConfigBase {\n constructor() {\n super(\n DatePrecision.Month,\n new MonthMappings(),\n \"month\");\n }\n}\n\nexport class DateConfig extends DateConfigBase {\n constructor() {\n super(\n DatePrecision.Date,\n new DateMappings(),\n \"date\");\n }\n}\n\nexport class DatetimeConfig extends CalendarConfig {\n constructor() {\n super(\n CalendarMode.Both,\n DatePrecision.Minute,\n new DatetimeMappings(),\n \"datetime-local\");\n }\n}\n\nexport class TimeConfig extends CalendarConfig {\n constructor() {\n super(\n CalendarMode.TimeOnly,\n DatePrecision.Minute,\n new TimeMappings(),\n \"time\");\n }\n\n public updateBounds(providedDate:Date):void {\n this.dateMaxBound = DateUtil.endOf(DatePrecision.Date, DateUtil.clone(providedDate));\n this.dateMinBound = DateUtil.previous(DatePrecision.Date, DateUtil.clone(this.dateMaxBound));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-config.metadata.json b/dist/modules/datepicker/classes/calendar-config.metadata.json deleted file mode 100644 index 66a63fde3..000000000 --- a/dist/modules/datepicker/classes/calendar-config.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"CalendarConfig":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../services/calendar.service","name":"CalendarMode","line":14,"character":21},{"__symbolic":"reference","module":"../../../misc/util/index","name":"DatePrecision","line":14,"character":45},{"__symbolic":"reference","module":"./calendar-mappings","name":"CalendarMappings","line":14,"character":69},{"__symbolic":"reference","name":"string"}]}],"updateBounds":[{"__symbolic":"method"}]}},"DateConfigBase":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarConfig"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../misc/util/index","name":"DatePrecision","line":14,"character":45},{"__symbolic":"reference","module":"./calendar-mappings","name":"CalendarMappings","line":14,"character":69},{"__symbolic":"reference","name":"string"}]}]}},"YearConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"DateConfigBase"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"MonthConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"DateConfigBase"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"DateConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"DateConfigBase"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"DatetimeConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarConfig"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"TimeConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarConfig"},"members":{"__ctor__":[{"__symbolic":"constructor"}],"updateBounds":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-mappings.d.ts b/dist/modules/datepicker/classes/calendar-mappings.d.ts deleted file mode 100644 index dfcafa993..000000000 --- a/dist/modules/datepicker/classes/calendar-mappings.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { CalendarViewType } from "../views/calendar-view"; -export declare type CalendarMapping = Map; -export declare abstract class CalendarMappings { - initialView: CalendarViewType; - finalView: CalendarViewType; - changed: CalendarMapping; - zoom: CalendarMapping; -} -export declare class DateMappings extends CalendarMappings { - constructor(); -} -export declare class TimeMappings extends CalendarMappings { - constructor(); -} -export declare class DatetimeMappings extends CalendarMappings { - constructor(); -} -export declare class MonthMappings extends CalendarMappings { - constructor(); -} -export declare class YearMappings extends CalendarMappings { - constructor(); -} diff --git a/dist/modules/datepicker/classes/calendar-mappings.js b/dist/modules/datepicker/classes/calendar-mappings.js deleted file mode 100644 index cbc9ebfe6..000000000 --- a/dist/modules/datepicker/classes/calendar-mappings.js +++ /dev/null @@ -1,119 +0,0 @@ -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 __()); - }; -})(); -import { CalendarViewType } from "../views/calendar-view"; -var CalendarMappings = /** @class */ (function () { - function CalendarMappings() { - } - return CalendarMappings; -}()); -export { CalendarMappings }; -var DateMappings = /** @class */ (function (_super) { - __extends(DateMappings, _super); - function DateMappings() { - var _this = _super.call(this) || this; - _this.initialView = CalendarViewType.Date; - _this.finalView = CalendarViewType.Date; - _this.changed = new Map([ - [CalendarViewType.Year, CalendarViewType.Month], - [CalendarViewType.Month, CalendarViewType.Date], - [CalendarViewType.Date, CalendarViewType.Date] - ]); - _this.zoom = new Map([ - [CalendarViewType.Year, CalendarViewType.Date], - [CalendarViewType.Month, CalendarViewType.Year], - [CalendarViewType.Date, CalendarViewType.Month] - ]); - return _this; - } - return DateMappings; -}(CalendarMappings)); -export { DateMappings }; -var TimeMappings = /** @class */ (function (_super) { - __extends(TimeMappings, _super); - function TimeMappings() { - var _this = _super.call(this) || this; - _this.initialView = CalendarViewType.Hour; - _this.finalView = CalendarViewType.Minute; - _this.changed = new Map([ - [CalendarViewType.Hour, CalendarViewType.Minute], - [CalendarViewType.Minute, CalendarViewType.Minute] - ]); - _this.zoom = new Map([ - [CalendarViewType.Hour, CalendarViewType.Minute], - [CalendarViewType.Minute, CalendarViewType.Hour] - ]); - return _this; - } - return TimeMappings; -}(CalendarMappings)); -export { TimeMappings }; -var DatetimeMappings = /** @class */ (function (_super) { - __extends(DatetimeMappings, _super); - function DatetimeMappings() { - var _this = _super.call(this) || this; - _this.initialView = CalendarViewType.Date; - _this.finalView = CalendarViewType.Minute; - _this.changed = new Map([ - [CalendarViewType.Year, CalendarViewType.Month], - [CalendarViewType.Month, CalendarViewType.Date], - [CalendarViewType.Date, CalendarViewType.Hour], - [CalendarViewType.Hour, CalendarViewType.Minute], - [CalendarViewType.Minute, CalendarViewType.Minute] - ]); - _this.zoom = new Map([ - [CalendarViewType.Year, CalendarViewType.Date], - [CalendarViewType.Month, CalendarViewType.Year], - [CalendarViewType.Date, CalendarViewType.Month], - [CalendarViewType.Hour, CalendarViewType.Date], - [CalendarViewType.Minute, CalendarViewType.Hour] - ]); - return _this; - } - return DatetimeMappings; -}(CalendarMappings)); -export { DatetimeMappings }; -var MonthMappings = /** @class */ (function (_super) { - __extends(MonthMappings, _super); - function MonthMappings() { - var _this = _super.call(this) || this; - _this.initialView = CalendarViewType.Month; - _this.finalView = CalendarViewType.Month; - _this.changed = new Map([ - [CalendarViewType.Year, CalendarViewType.Month], - [CalendarViewType.Month, CalendarViewType.Month] - ]); - _this.zoom = new Map([ - [CalendarViewType.Year, CalendarViewType.Month], - [CalendarViewType.Month, CalendarViewType.Year] - ]); - return _this; - } - return MonthMappings; -}(CalendarMappings)); -export { MonthMappings }; -var YearMappings = /** @class */ (function (_super) { - __extends(YearMappings, _super); - function YearMappings() { - var _this = _super.call(this) || this; - _this.initialView = CalendarViewType.Year; - _this.finalView = CalendarViewType.Year; - _this.changed = new Map([ - [CalendarViewType.Year, CalendarViewType.Year] - ]); - _this.zoom = new Map([ - [CalendarViewType.Year, CalendarViewType.Year] - ]); - return _this; - } - return YearMappings; -}(CalendarMappings)); -export { YearMappings }; -//# sourceMappingURL=calendar-mappings.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-mappings.js.map b/dist/modules/datepicker/classes/calendar-mappings.js.map deleted file mode 100644 index afe609896..000000000 --- a/dist/modules/datepicker/classes/calendar-mappings.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calendar-mappings.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/classes/calendar-mappings.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI1D,IAAA;;;2BAJA;IASC,CAAA;AALD,4BAKC;AAED,IAAA;IAAkC,gCAAgB;IAC9C;QAAA,YACI,iBAAO,SAgBV;QAdG,KAAI,CAAC,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC;QACzC,KAAI,CAAC,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC;QAEvC,KAAI,CAAC,OAAO,GAAG,IAAI,GAAG,CAAqC;YACvD,CAAC,gBAAgB,CAAC,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AAC,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC;SACnD,CAAC,CAAC;QAEH,KAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAqC;YACpD,CAAC,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC;YAC/C,CAAC,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC;SAClD,CAAC,CAAC;;KACN;wBA5FL;EA4EmC,gBAAgB,EAiBlD,CAAA;AAjBD,yBAiBC;AAED,IAAA;IAAkC,gCAAgB;IAC9C;QAAA,YACI,iBAAO,SAYV;QAVG,KAAI,CAAC,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC;QACzC,KAAI,CAAC,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC;QAEvC,KAAI,CAAC,OAAO,GAAG,IAAI,GAAG,CAAqC;YACvD,CAAC,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;SACjD,CAAC,CAAC;QAEH,KAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAqC;YACpD,CAAC,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;SACjD,CAAC,CAAC;;KACN;uBA7GL;EA+FkC,gBAAgB,EAejD,CAAA;AAfD,wBAeC","sourcesContent":["import { CalendarViewType } from \"../views/calendar-view\";\n\nexport type CalendarMapping = Map;\n\nexport abstract class CalendarMappings {\n public initialView:CalendarViewType;\n public finalView:CalendarViewType;\n public changed:CalendarMapping;\n public zoom:CalendarMapping;\n}\n\nexport class DateMappings extends CalendarMappings {\n constructor() {\n super();\n\n this.initialView = CalendarViewType.Date;\n this.finalView = CalendarViewType.Date;\n\n this.changed = new Map([\n [CalendarViewType.Year, CalendarViewType.Month],\n [CalendarViewType.Month, CalendarViewType.Date],\n [CalendarViewType.Date, CalendarViewType.Date]\n ]);\n\n this.zoom = new Map([\n [CalendarViewType.Year, CalendarViewType.Date],\n [CalendarViewType.Month, CalendarViewType.Year],\n [CalendarViewType.Date, CalendarViewType.Month]\n ]);\n }\n}\n\nexport class TimeMappings extends CalendarMappings {\n constructor() {\n super();\n\n this.initialView = CalendarViewType.Hour;\n this.finalView = CalendarViewType.Minute;\n\n this.changed = new Map([\n [CalendarViewType.Hour, CalendarViewType.Minute],\n [CalendarViewType.Minute, CalendarViewType.Minute]\n ]);\n\n this.zoom = new Map([\n [CalendarViewType.Hour, CalendarViewType.Minute],\n [CalendarViewType.Minute, CalendarViewType.Hour]\n ]);\n }\n}\n\nexport class DatetimeMappings extends CalendarMappings {\n constructor() {\n super();\n\n this.initialView = CalendarViewType.Date;\n this.finalView = CalendarViewType.Minute;\n\n this.changed = new Map([\n [CalendarViewType.Year, CalendarViewType.Month],\n [CalendarViewType.Month, CalendarViewType.Date],\n [CalendarViewType.Date, CalendarViewType.Hour],\n [CalendarViewType.Hour, CalendarViewType.Minute],\n [CalendarViewType.Minute, CalendarViewType.Minute]\n ]);\n\n this.zoom = new Map([\n [CalendarViewType.Year, CalendarViewType.Date],\n [CalendarViewType.Month, CalendarViewType.Year],\n [CalendarViewType.Date, CalendarViewType.Month],\n [CalendarViewType.Hour, CalendarViewType.Date],\n [CalendarViewType.Minute, CalendarViewType.Hour]\n ]);\n }\n}\n\nexport class MonthMappings extends CalendarMappings {\n constructor() {\n super();\n\n this.initialView = CalendarViewType.Month;\n this.finalView = CalendarViewType.Month;\n\n this.changed = new Map([\n [CalendarViewType.Year, CalendarViewType.Month],\n [CalendarViewType.Month, CalendarViewType.Month]\n ]);\n\n this.zoom = new Map([\n [CalendarViewType.Year, CalendarViewType.Month],\n [CalendarViewType.Month, CalendarViewType.Year]\n ]);\n }\n}\n\nexport class YearMappings extends CalendarMappings {\n constructor() {\n super();\n\n this.initialView = CalendarViewType.Year;\n this.finalView = CalendarViewType.Year;\n\n this.changed = new Map([\n [CalendarViewType.Year, CalendarViewType.Year]\n ]);\n\n this.zoom = new Map([\n [CalendarViewType.Year, CalendarViewType.Year]\n ]);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/classes/calendar-mappings.metadata.json b/dist/modules/datepicker/classes/calendar-mappings.metadata.json deleted file mode 100644 index fbc168e28..000000000 --- a/dist/modules/datepicker/classes/calendar-mappings.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"CalendarMapping":{"__symbolic":"interface"},"CalendarMappings":{"__symbolic":"class"},"DateMappings":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarMappings"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"TimeMappings":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarMappings"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"DatetimeMappings":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarMappings"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"MonthMappings":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarMappings"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"YearMappings":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CalendarMappings"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-comparer.d.ts b/dist/modules/datepicker/classes/date-comparer.d.ts deleted file mode 100644 index 7aa75ff27..000000000 --- a/dist/modules/datepicker/classes/date-comparer.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { DatePrecision } from "../../../misc/util/index"; -export declare class DateComparer { - private _precision; - private _isSmallest; - constructor(precision: DatePrecision, isSmallest: boolean); - equal(a: Date, b: Date | undefined): boolean; - lessThan(a: Date, b: Date | undefined): boolean; - greaterThan(a: Date, b: Date | undefined): boolean; - between(date: Date, left: Date | undefined, right: Date | undefined): boolean; -} diff --git a/dist/modules/datepicker/classes/date-comparer.js b/dist/modules/datepicker/classes/date-comparer.js deleted file mode 100644 index 6a5fe0c95..000000000 --- a/dist/modules/datepicker/classes/date-comparer.js +++ /dev/null @@ -1,33 +0,0 @@ -import { DatePrecision, DateUtil, Util } from "../../../misc/util/index"; -var DateComparer = /** @class */ (function () { - function DateComparer(precision, isSmallest) { - this._precision = precision; - this._isSmallest = isSmallest; - } - DateComparer.prototype.equal = function (a, b) { - if (this._precision === DatePrecision.Minute) { - return !!b && - DateUtil.equal(DatePrecision.Hour, b, a) && - Util.Math.roundDown(b.getMinutes(), 5) === Util.Math.roundDown(a.getMinutes(), 5); - } - return !!b && DateUtil.equal(this._precision, a, b); - }; - DateComparer.prototype.lessThan = function (a, b) { - if (this._isSmallest) { - return !b || (b >= a); - } - return !b || (DateUtil.endOf(this._precision, DateUtil.clone(b)) >= a); - }; - DateComparer.prototype.greaterThan = function (a, b) { - if (this._isSmallest) { - return !b || (b <= a); - } - return !b || (DateUtil.startOf(this._precision, DateUtil.clone(b)) <= a); - }; - DateComparer.prototype.between = function (date, left, right) { - return this.greaterThan(date, left) && this.lessThan(date, right); - }; - return DateComparer; -}()); -export { DateComparer }; -//# sourceMappingURL=date-comparer.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-comparer.js.map b/dist/modules/datepicker/classes/date-comparer.js.map deleted file mode 100644 index 444e651ed..000000000 --- a/dist/modules/datepicker/classes/date-comparer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"date-comparer.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/classes/date-comparer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEzE,IAAA;IAII,sBAAY,SAAuB,EAAE,UAAkB;QACnD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;KACjC;IAEM,4BAAK,GAAZ,UAAa,CAAM,EAAE,CAAkB;QACnC,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,KAAK,aAAa,CAAC,MAA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,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KACrE;uBAvCL;IAwCC,CAAA;AAtCD,wBAsCC","sourcesContent":["import { DatePrecision, DateUtil, Util } from \"../../../misc/util/index\";\n\nexport class DateComparer {\n private _precision:DatePrecision;\n private _isSmallest:boolean;\n\n constructor(precision:DatePrecision, isSmallest:boolean) {\n this._precision = precision;\n this._isSmallest = isSmallest;\n }\n\n public equal(a:Date, b:Date | undefined):boolean {\n if (this._precision === DatePrecision.Minute) {\n return !!b &&\n DateUtil.equal(DatePrecision.Hour, b, a) &&\n Util.Math.roundDown(b.getMinutes(), 5) === Util.Math.roundDown(a.getMinutes(), 5);\n }\n\n return !!b && DateUtil.equal(this._precision, a, b);\n }\n\n public lessThan(a:Date, b:Date | undefined):boolean {\n if (this._isSmallest) {\n return !b || (b >= a);\n }\n\n return !b || (DateUtil.endOf(this._precision, DateUtil.clone(b)) >= a);\n }\n\n public greaterThan(a:Date, b:Date | undefined):boolean {\n if (this._isSmallest) {\n return !b || (b <= a);\n }\n\n return !b || (DateUtil.startOf(this._precision, DateUtil.clone(b)) <= a);\n }\n\n public between(date:Date, left:Date | undefined, right:Date | undefined):boolean {\n return this.greaterThan(date, left) && this.lessThan(date, right);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-comparer.metadata.json b/dist/modules/datepicker/classes/date-comparer.metadata.json deleted file mode 100644 index 691ec2618..000000000 --- a/dist/modules/datepicker/classes/date-comparer.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"DateComparer":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../misc/util/index","name":"DatePrecision","line":6,"character":26},{"__symbolic":"reference","name":"boolean"}]}],"equal":[{"__symbolic":"method"}],"lessThan":[{"__symbolic":"method"}],"greaterThan":[{"__symbolic":"method"}],"between":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-parser.d.ts b/dist/modules/datepicker/classes/date-parser.d.ts deleted file mode 100644 index 51904d934..000000000 --- a/dist/modules/datepicker/classes/date-parser.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { DatepickerMode } from "../components/datepicker"; -import { IDatepickerLocaleValues } from "../../../behaviors/localization/index"; -export declare class DateParser { - private _format; - private _parser; - constructor(format: string, locale: IDatepickerLocaleValues); - format(date: Date): string; - parse(dateString: string, baseDate?: Date): Date; -} -export declare class InternalDateParser extends DateParser { - constructor(mode: DatepickerMode, locale: IDatepickerLocaleValues); -} diff --git a/dist/modules/datepicker/classes/date-parser.js b/dist/modules/datepicker/classes/date-parser.js deleted file mode 100644 index 3574b22de..000000000 --- a/dist/modules/datepicker/classes/date-parser.js +++ /dev/null @@ -1,44 +0,0 @@ -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 __()); - }; -})(); -import { DateFnsParser } from "../helpers/date-fns"; -var DateParser = /** @class */ (function () { - function DateParser(format, locale) { - this._format = format; - this._parser = new DateFnsParser(locale); - } - DateParser.prototype.format = function (date) { - return this._parser.format(date, this._format); - }; - DateParser.prototype.parse = function (dateString, baseDate) { - if (baseDate === void 0) { baseDate = new Date(); } - return this._parser.parse(dateString, this._format, baseDate); - }; - return DateParser; -}()); -export { DateParser }; -var InternalDateParser = /** @class */ (function (_super) { - __extends(InternalDateParser, _super); - function InternalDateParser(mode, locale) { - var _this = this; - var internalFormats = { - time: "HH:mm", - datetime: "YYYY-MM-DDTHH:mm", - date: "YYYY-MM-DD", - month: "YYYY-MM", - year: "YYYY" - }; - _this = _super.call(this, internalFormats[mode], locale) || this; - return _this; - } - return InternalDateParser; -}(DateParser)); -export { InternalDateParser }; -//# sourceMappingURL=date-parser.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-parser.js.map b/dist/modules/datepicker/classes/date-parser.js.map deleted file mode 100644 index e44629904..000000000 --- a/dist/modules/datepicker/classes/date-parser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"date-parser.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/classes/date-parser.ts"],"names":[],"mappings":";;;;;;;;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,IAAA;IAII,oBAAY,MAAa,EAAE,MAA8B;QACrD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;KAC5C;IAEM,2BAAM,GAAb,UAAc,IAAS;QACnB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KAClD;IAEM,0BAAK,GAAZ,UAAa,UAAiB,EAAE,QAA0B;QAA1B,yBAAA,EAAA,eAAoB,IAAI,EAAE;QACtD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KACjE;qBAnBL;IAoBC,CAAA;AAhBD,sBAgBC;AAED,IAAA;IAAwC,sCAAU;IAC9C,4BAAY,IAAmB,EAAE,MAA8B;QAA/D,iBAUC;QATG,IAAM,eAAe,GAAkC;YACnD,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,kBAAkB;YAC5B,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,MAAM;SACf,CAAC;QAEF,QAAA,kBAAM,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,SAAC;;KACxC;6BAjCL;EAsBwC,UAAU,EAYjD,CAAA;AAZD,8BAYC","sourcesContent":["import { DatepickerMode } from \"../components/datepicker\";\nimport { DateFnsParser } from \"../helpers/date-fns\";\nimport { IDatepickerLocaleValues, IDatepickerFormatsLocaleValues } from \"../../../behaviors/localization/index\";\n\nexport class DateParser {\n private _format:string;\n private _parser:DateFnsParser;\n\n constructor(format:string, locale:IDatepickerLocaleValues) {\n this._format = format;\n this._parser = new DateFnsParser(locale);\n }\n\n public format(date:Date):string {\n return this._parser.format(date, this._format);\n }\n\n public parse(dateString:string, baseDate:Date = new Date()):Date {\n return this._parser.parse(dateString, this._format, baseDate);\n }\n}\n\nexport class InternalDateParser extends DateParser {\n constructor(mode:DatepickerMode, locale:IDatepickerLocaleValues) {\n const internalFormats:IDatepickerFormatsLocaleValues = {\n time: \"HH:mm\",\n datetime: \"YYYY-MM-DDTHH:mm\",\n date: \"YYYY-MM-DD\",\n month: \"YYYY-MM\",\n year: \"YYYY\"\n };\n\n super(internalFormats[mode], locale);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/classes/date-parser.metadata.json b/dist/modules/datepicker/classes/date-parser.metadata.json deleted file mode 100644 index 1c83b69a8..000000000 --- a/dist/modules/datepicker/classes/date-parser.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"DateParser":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"IDatepickerLocaleValues","line":8,"character":38}]}],"format":[{"__symbolic":"method"}],"parse":[{"__symbolic":"method"}]}},"InternalDateParser":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"DateParser"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../components/datepicker","name":"DatepickerMode","line":23,"character":21},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"IDatepickerLocaleValues","line":8,"character":38}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/components/calendar-view-title.d.ts b/dist/modules/datepicker/components/calendar-view-title.d.ts deleted file mode 100644 index 06015c43c..000000000 --- a/dist/modules/datepicker/components/calendar-view-title.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { EventEmitter } from "@angular/core"; -import { CalendarRangeService } from "../services/calendar-range.service"; -export declare class SuiCalendarViewTitle { - ranges: CalendarRangeService; - onZoomOut: EventEmitter; - constructor(); -} diff --git a/dist/modules/datepicker/components/calendar-view-title.js b/dist/modules/datepicker/components/calendar-view-title.js deleted file mode 100644 index 3f0c620ad..000000000 --- a/dist/modules/datepicker/components/calendar-view-title.js +++ /dev/null @@ -1,23 +0,0 @@ -import { Component, Input, EventEmitter, Output } from "@angular/core"; -import { CalendarRangeService } from "../services/calendar-range.service"; -var SuiCalendarViewTitle = /** @class */ (function () { - function SuiCalendarViewTitle() { - this.onZoomOut = new EventEmitter(); - } - SuiCalendarViewTitle.decorators = [ - { type: Component, args: [{ - selector: "sui-calendar-view-title", - template: "\n\n \n\n\n \n\n\n \n\n", - styles: ["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiCalendarViewTitle.ctorParameters = function () { return []; }; - SuiCalendarViewTitle.propDecorators = { - "ranges": [{ type: Input },], - "onZoomOut": [{ type: Output, args: ["zoomOut",] },], - }; - return SuiCalendarViewTitle; -}()); -export { SuiCalendarViewTitle }; -//# sourceMappingURL=calendar-view-title.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/components/calendar-view-title.js.map b/dist/modules/datepicker/components/calendar-view-title.js.map deleted file mode 100644 index 15b73e5e8..000000000 --- a/dist/modules/datepicker/components/calendar-view-title.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calendar-view-title.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/components/calendar-view-title.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;;IA+BtE;QACI,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAQ,CAAC;KAC7C;;gBA/BJ,SAAS,SAAC;oBACP,QAAQ,EAAE,yBAAyB;oBACnC,QAAQ,EAAE,6ZAUb;oBACG,MAAM,EAAE,CAAC,mGAMZ,CAAC;iBACD;;;;;2BAGI,KAAK;8BAGL,MAAM,SAAC,SAAS;;+BA7BrB;;SAwBa,oBAAoB","sourcesContent":["import { Component, Input, EventEmitter, Output } from \"@angular/core\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\n\n@Component({\n selector: \"sui-calendar-view-title\",\n template: `\n\n \n\n\n \n\n\n \n\n`,\n styles: [`\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n`]\n})\nexport class SuiCalendarViewTitle {\n\n @Input()\n public ranges:CalendarRangeService;\n\n @Output(\"zoomOut\")\n public onZoomOut:EventEmitter;\n\n constructor() {\n this.onZoomOut = new EventEmitter();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/components/calendar-view-title.metadata.json b/dist/modules/datepicker/components/calendar-view-title.metadata.json deleted file mode 100644 index fc549e514..000000000 --- a/dist/modules/datepicker/components/calendar-view-title.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiCalendarViewTitle":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"sui-calendar-view-title","template":"\n\n \n\n\n \n\n\n \n\n","styles":["\n.title.link {\n display: inline-block;\n margin-left: 2rem;\n margin-right: 2rem;\n}\n"]}]}],"members":{"ranges":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":5}}]}],"onZoomOut":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":29,"character":5},"arguments":["zoomOut"]}]}],"__ctor__":[{"__symbolic":"constructor"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/components/datepicker.d.ts b/dist/modules/datepicker/components/datepicker.d.ts deleted file mode 100644 index 9af373d14..000000000 --- a/dist/modules/datepicker/components/datepicker.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { CalendarService } from "./../services/calendar.service"; -import { SuiLocalizationService } from "../../../behaviors/localization/index"; -export declare type DatepickerMode = "year" | "month" | "date" | "datetime" | "time"; -export declare const DatepickerMode: { - Year: "time" | "year" | "month" | "date" | "datetime"; - Month: "time" | "year" | "month" | "date" | "datetime"; - Date: "time" | "year" | "month" | "date" | "datetime"; - Datetime: "time" | "year" | "month" | "date" | "datetime"; - Time: "time" | "year" | "month" | "date" | "datetime"; -}; -export declare class SuiDatepicker { - private _calendarClasses; - service: CalendarService; - constructor(localizationService: SuiLocalizationService); - onMouseDown(e: MouseEvent): void; -} diff --git a/dist/modules/datepicker/components/datepicker.js b/dist/modules/datepicker/components/datepicker.js deleted file mode 100644 index 1d122dbac..000000000 --- a/dist/modules/datepicker/components/datepicker.js +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, HostBinding, HostListener } from "@angular/core"; -import { CalendarService } from "./../services/calendar.service"; -import { DatetimeConfig } from "../classes/calendar-config"; -import { SuiLocalizationService } from "../../../behaviors/localization/index"; -export var DatepickerMode = { - Year: "year", - Month: "month", - Date: "date", - Datetime: "datetime", - Time: "time" -}; -var SuiDatepicker = /** @class */ (function () { - function SuiDatepicker(localizationService) { - this.service = new CalendarService(new DatetimeConfig(), localizationService.get().datepicker); - this._calendarClasses = true; - } - SuiDatepicker.prototype.onMouseDown = function (e) { - e.preventDefault(); - }; - SuiDatepicker.decorators = [ - { type: Component, args: [{ - selector: "sui-datepicker", - template: "\n\n \n \n \n \n \n\n", - styles: ["\n:host {\n user-select: none;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiDatepicker.ctorParameters = function () { return [ - { type: SuiLocalizationService, }, - ]; }; - SuiDatepicker.propDecorators = { - "_calendarClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.active",] }, { type: HostBinding, args: ["class.calendar",] },], - "onMouseDown": [{ type: HostListener, args: ["mousedown", ["$event"],] },], - }; - return SuiDatepicker; -}()); -export { SuiDatepicker }; -//# sourceMappingURL=datepicker.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/components/datepicker.js.map b/dist/modules/datepicker/components/datepicker.js.map deleted file mode 100644 index 231dc1cb4..000000000 --- a/dist/modules/datepicker/components/datepicker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"datepicker.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/components/datepicker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAI/E,MAAM,CAAC,IAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,MAAwB;IAC9B,KAAK,EAAE,OAAyB;IAChC,IAAI,EAAE,MAAwB;IAC9B,QAAQ,EAAE,UAA4B;IACtC,IAAI,EAAE,MAAwB;CACjC,CAAC;;IA2BE,uBAAY,mBAA0C;QAClD,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,cAAc,EAAE,EAAE,mBAAmB,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC;QAE/F,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;KAChC;IAGM,mCAAW,aAAC,CAAY;QAC3B,CAAC,CAAC,cAAc,EAAE,CAAC;;;gBAjC1B,SAAS,SAAC;oBACP,QAAQ,EAAE,gBAAgB;oBAC1B,QAAQ,EAAE,mkBAQb;oBACG,MAAM,EAAE,CAAC,wCAIZ,CAAC;iBACD;;;;gBA5BQ,sBAAsB;;;qCA8B1B,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,cAAc,cAC1B,WAAW,SAAC,gBAAgB;gCAW5B,YAAY,SAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;;wBA9CzC;;SAgCa,aAAa","sourcesContent":["import { Component, HostBinding, HostListener } from \"@angular/core\";\nimport { CalendarService } from \"./../services/calendar.service\";\nimport { DatetimeConfig } from \"../classes/calendar-config\";\nimport { SuiLocalizationService } from \"../../../behaviors/localization/index\";\n\nexport type DatepickerMode = \"year\" | \"month\" | \"date\" | \"datetime\" | \"time\";\n\nexport const DatepickerMode = {\n Year: \"year\" as DatepickerMode,\n Month: \"month\" as DatepickerMode,\n Date: \"date\" as DatepickerMode,\n Datetime: \"datetime\" as DatepickerMode,\n Time: \"time\" as DatepickerMode\n};\n\n@Component({\n selector: \"sui-datepicker\",\n template: `\n\n \n \n \n \n \n\n`,\n styles: [`\n:host {\n user-select: none;\n}\n`]\n})\nexport class SuiDatepicker {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.active\")\n @HostBinding(\"class.calendar\")\n private _calendarClasses:boolean;\n\n public service:CalendarService;\n\n constructor(localizationService:SuiLocalizationService) {\n this.service = new CalendarService(new DatetimeConfig(), localizationService.get().datepicker);\n\n this._calendarClasses = true;\n }\n\n @HostListener(\"mousedown\", [\"$event\"])\n public onMouseDown(e:MouseEvent):void {\n e.preventDefault();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/components/datepicker.metadata.json b/dist/modules/datepicker/components/datepicker.metadata.json deleted file mode 100644 index f5541172a..000000000 --- a/dist/modules/datepicker/components/datepicker.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"DatepickerMode":{"Year":"year","Month":"month","Date":"date","Datetime":"datetime","Time":"time"},"SuiDatepicker":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":15,"character":1},"arguments":[{"selector":"sui-datepicker","template":"\n\n \n \n \n \n \n\n","styles":["\n:host {\n user-select: none;\n}\n"]}]}],"members":{"_calendarClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":33,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":34,"character":5},"arguments":["class.active"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":35,"character":5},"arguments":["class.calendar"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":40,"character":36}]}],"onMouseDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":46,"character":5},"arguments":["mousedown",["$event"]]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/datepicker.module.d.ts b/dist/modules/datepicker/datepicker.module.d.ts deleted file mode 100644 index 548df1ade..000000000 --- a/dist/modules/datepicker/datepicker.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiDatepickerModule { -} diff --git a/dist/modules/datepicker/datepicker.module.js b/dist/modules/datepicker/datepicker.module.js deleted file mode 100644 index 04bcab133..000000000 --- a/dist/modules/datepicker/datepicker.module.js +++ /dev/null @@ -1,59 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { FormsModule } from "@angular/forms"; -import { SuiPopupModule } from "../popup/index"; -import { SuiLocalizationModule } from "../../behaviors/localization/index"; -import { SuiUtilityModule } from "../../misc/util/index"; -import { SuiCalendarViewTitle } from "./components/calendar-view-title"; -import { SuiCalendarYearView } from "./views/year-view"; -import { SuiCalendarMonthView } from "./views/month-view"; -import { SuiCalendarItem } from "./directives/calendar-item"; -import { SuiCalendarDateView } from "./views/date-view"; -import { SuiDatepicker } from "./components/datepicker"; -import { SuiCalendarHourView } from "./views/hour-view"; -import { SuiCalendarMinuteView } from "./views/minute-view"; -import { SuiDatepickerInputDirective } from "./directives/input.directive"; -import { SuiDatepickerDirective, SuiDatepickerDirectiveValueAccessor, SuiDatepickerDirectiveValidator } from "./directives/datepicker.directive"; -var SuiDatepickerModule = /** @class */ (function () { - function SuiDatepickerModule() { - } - SuiDatepickerModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule, - FormsModule, - SuiPopupModule, - SuiLocalizationModule, - SuiUtilityModule - ], - declarations: [ - SuiCalendarItem, - SuiCalendarViewTitle, - SuiCalendarYearView, - SuiCalendarMonthView, - SuiCalendarDateView, - SuiCalendarHourView, - SuiCalendarMinuteView, - SuiDatepicker, - SuiDatepickerDirective, - SuiDatepickerDirectiveValueAccessor, - SuiDatepickerDirectiveValidator, - SuiDatepickerInputDirective - ], - exports: [ - SuiDatepickerDirective, - SuiDatepickerDirectiveValueAccessor, - SuiDatepickerDirectiveValidator, - SuiDatepickerInputDirective - ], - entryComponents: [ - SuiDatepicker - ] - },] }, - ]; - /** @nocollapse */ - SuiDatepickerModule.ctorParameters = function () { return []; }; - return SuiDatepickerModule; -}()); -export { SuiDatepickerModule }; -//# sourceMappingURL=datepicker.module.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/datepicker.module.js.map b/dist/modules/datepicker/datepicker.module.js.map deleted file mode 100644 index e468b952e..000000000 --- a/dist/modules/datepicker/datepicker.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"datepicker.module.js","sourceRoot":"","sources":["../../../src/modules/datepicker/datepicker.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAA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wBACb,aAAa;qBAChB;iBACJ;;;;8BArDD;;SAsDa,mBAAmB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { SuiPopupModule } from \"../popup/index\";\nimport { SuiLocalizationModule } from \"../../behaviors/localization/index\";\nimport { SuiUtilityModule } from \"../../misc/util/index\";\nimport { SuiCalendarViewTitle } from \"./components/calendar-view-title\";\nimport { SuiCalendarYearView } from \"./views/year-view\";\nimport { SuiCalendarMonthView } from \"./views/month-view\";\nimport { SuiCalendarItem } from \"./directives/calendar-item\";\nimport { SuiCalendarDateView } from \"./views/date-view\";\nimport { SuiDatepicker } from \"./components/datepicker\";\nimport { SuiCalendarHourView } from \"./views/hour-view\";\nimport { SuiCalendarMinuteView } from \"./views/minute-view\";\nimport { SuiDatepickerInputDirective } from \"./directives/input.directive\";\nimport {\n SuiDatepickerDirective, SuiDatepickerDirectiveValueAccessor,\n SuiDatepickerDirectiveValidator\n} from \"./directives/datepicker.directive\";\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SuiPopupModule,\n SuiLocalizationModule,\n SuiUtilityModule\n ],\n declarations: [\n SuiCalendarItem,\n\n SuiCalendarViewTitle,\n SuiCalendarYearView,\n SuiCalendarMonthView,\n SuiCalendarDateView,\n SuiCalendarHourView,\n SuiCalendarMinuteView,\n\n SuiDatepicker,\n SuiDatepickerDirective,\n SuiDatepickerDirectiveValueAccessor,\n SuiDatepickerDirectiveValidator,\n SuiDatepickerInputDirective\n ],\n exports: [\n SuiDatepickerDirective,\n SuiDatepickerDirectiveValueAccessor,\n SuiDatepickerDirectiveValidator,\n SuiDatepickerInputDirective\n ],\n entryComponents: [\n SuiDatepicker\n ]\n})\nexport class SuiDatepickerModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/datepicker.module.metadata.json b/dist/modules/datepicker/datepicker.module.metadata.json deleted file mode 100644 index 456c13e2b..000000000 --- a/dist/modules/datepicker/datepicker.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiDatepickerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":20,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":22,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":23,"character":8},{"__symbolic":"reference","module":"../popup/index","name":"SuiPopupModule","line":24,"character":8},{"__symbolic":"reference","module":"../../behaviors/localization/index","name":"SuiLocalizationModule","line":25,"character":8},{"__symbolic":"reference","module":"../../misc/util/index","name":"SuiUtilityModule","line":26,"character":8}],"declarations":[{"__symbolic":"reference","module":"./directives/calendar-item","name":"SuiCalendarItem","line":29,"character":8},{"__symbolic":"reference","module":"./components/calendar-view-title","name":"SuiCalendarViewTitle","line":31,"character":8},{"__symbolic":"reference","module":"./views/year-view","name":"SuiCalendarYearView","line":32,"character":8},{"__symbolic":"reference","module":"./views/month-view","name":"SuiCalendarMonthView","line":33,"character":8},{"__symbolic":"reference","module":"./views/date-view","name":"SuiCalendarDateView","line":34,"character":8},{"__symbolic":"reference","module":"./views/hour-view","name":"SuiCalendarHourView","line":35,"character":8},{"__symbolic":"reference","module":"./views/minute-view","name":"SuiCalendarMinuteView","line":36,"character":8},{"__symbolic":"reference","module":"./components/datepicker","name":"SuiDatepicker","line":38,"character":8},{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirective","line":39,"character":8},{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirectiveValueAccessor","line":40,"character":8},{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirectiveValidator","line":41,"character":8},{"__symbolic":"reference","module":"./directives/input.directive","name":"SuiDatepickerInputDirective","line":42,"character":8}],"exports":[{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirective","line":45,"character":8},{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirectiveValueAccessor","line":46,"character":8},{"__symbolic":"reference","module":"./directives/datepicker.directive","name":"SuiDatepickerDirectiveValidator","line":47,"character":8},{"__symbolic":"reference","module":"./directives/input.directive","name":"SuiDatepickerInputDirective","line":48,"character":8}],"entryComponents":[{"__symbolic":"reference","module":"./components/datepicker","name":"SuiDatepicker","line":51,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/directives/calendar-item.d.ts b/dist/modules/datepicker/directives/calendar-item.d.ts deleted file mode 100644 index 4201c5e64..000000000 --- a/dist/modules/datepicker/directives/calendar-item.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { EventEmitter, ChangeDetectorRef } from "@angular/core"; -export declare class CalendarItem { - date: Date; - humanReadable: string; - isDisabled: boolean; - isActive: boolean; - isOutsideRange: boolean; - isToday: boolean; - isSelectable: boolean; - constructor(date: Date); -} -export declare class SuiCalendarItem { - changeDetector: ChangeDetectorRef; - item: CalendarItem; - readonly isSelectable: boolean; - readonly isActive: boolean; - readonly isToday: boolean; - hasFocus: boolean; - onFocussed: EventEmitter; - constructor(changeDetector: ChangeDetectorRef); - onMouseMove(): void; - onMouseLeave(): void; -} diff --git a/dist/modules/datepicker/directives/calendar-item.js b/dist/modules/datepicker/directives/calendar-item.js deleted file mode 100644 index a2b886b2e..000000000 --- a/dist/modules/datepicker/directives/calendar-item.js +++ /dev/null @@ -1,67 +0,0 @@ -import { Directive, HostBinding, HostListener, Input, EventEmitter, ChangeDetectorRef } from "@angular/core"; -var CalendarItem = /** @class */ (function () { - function CalendarItem(date) { - this.date = date; - } - return CalendarItem; -}()); -export { CalendarItem }; -var SuiCalendarItem = /** @class */ (function () { - function SuiCalendarItem(changeDetector) { - this.changeDetector = changeDetector; - this.hasFocus = false; - this.onFocussed = new EventEmitter(); - } - Object.defineProperty(SuiCalendarItem.prototype, "isSelectable", { - get: function () { - return this.item.isSelectable; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCalendarItem.prototype, "isActive", { - get: function () { - return this.item.isActive; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCalendarItem.prototype, "isToday", { - get: function () { - return this.item.isToday; - }, - enumerable: true, - configurable: true - }); - SuiCalendarItem.prototype.onMouseMove = function () { - if (!this.hasFocus) { - this.hasFocus = true; - this.onFocussed.emit(this.hasFocus); - } - }; - SuiCalendarItem.prototype.onMouseLeave = function () { - this.hasFocus = false; - this.onFocussed.emit(this.hasFocus); - }; - SuiCalendarItem.decorators = [ - { type: Directive, args: [{ - selector: "[calendarItem]" - },] }, - ]; - /** @nocollapse */ - SuiCalendarItem.ctorParameters = function () { return [ - { type: ChangeDetectorRef, }, - ]; }; - SuiCalendarItem.propDecorators = { - "item": [{ type: Input, args: ["calendarItem",] },], - "isSelectable": [{ type: HostBinding, args: ["class.disabled",] },], - "isActive": [{ type: HostBinding, args: ["class.active",] },], - "isToday": [{ type: HostBinding, args: ["class.today",] },], - "hasFocus": [{ type: HostBinding, args: ["class.focus",] },], - "onMouseMove": [{ type: HostListener, args: ["mousemove",] },], - "onMouseLeave": [{ type: HostListener, args: ["mouseleave",] },], - }; - return SuiCalendarItem; -}()); -export { SuiCalendarItem }; -//# sourceMappingURL=calendar-item.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/directives/calendar-item.js.map b/dist/modules/datepicker/directives/calendar-item.js.map deleted file mode 100644 index 281fd1ae1..000000000 --- a/dist/modules/datepicker/directives/calendar-item.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calendar-item.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/directives/calendar-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE7G,IAAA;IASI,sBAAY,IAAS;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;KACpB;uBAdL;IAeC,CAAA;AAZD,wBAYC;;IA6BG,yBAAmB,cAAgC;QAAhC,mBAAc,GAAd,cAAc,CAAkB;QAC/C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,CAAC,UAAU,GAAG,IAAI,YAAY,EAAW,CAAC;KACjD;0BAvBU,yCAAY;;YACnB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;;;;;0BAIvB,qCAAQ;;YACf,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;;;;;0BAInB,oCAAO;;YACd,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;;;;;IAetB,qCAAW;QACd,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACvC;;IAIE,sCAAY;QACf,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;;;gBA5C3C,SAAS,SAAC;oBACP,QAAQ,EAAE,gBAAgB;iBAC7B;;;;gBAlBmE,iBAAiB;;;yBAoBhF,KAAK,SAAC,cAAc;iCAGpB,WAAW,SAAC,gBAAgB;6BAK5B,WAAW,SAAC,cAAc;4BAK1B,WAAW,SAAC,aAAa;6BAKzB,WAAW,SAAC,aAAa;gCAWzB,YAAY,SAAC,WAAW;iCAQxB,YAAY,SAAC,YAAY;;0BA1D9B;;SAoBa,eAAe","sourcesContent":["\nimport { Directive, HostBinding, HostListener, Input, EventEmitter, ChangeDetectorRef } from \"@angular/core\";\n\nexport class CalendarItem {\n public date:Date;\n public humanReadable:string;\n public isDisabled:boolean;\n public isActive:boolean;\n public isOutsideRange:boolean;\n public isToday:boolean;\n public isSelectable:boolean;\n\n constructor(date:Date) {\n this.date = date;\n }\n}\n\n@Directive({\n selector: \"[calendarItem]\"\n})\nexport class SuiCalendarItem {\n @Input(\"calendarItem\")\n public item:CalendarItem;\n\n @HostBinding(\"class.disabled\")\n public get isSelectable():boolean {\n return this.item.isSelectable;\n }\n\n @HostBinding(\"class.active\")\n public get isActive():boolean {\n return this.item.isActive;\n }\n\n @HostBinding(\"class.today\")\n public get isToday():boolean {\n return this.item.isToday;\n }\n\n @HostBinding(\"class.focus\")\n public hasFocus:boolean;\n\n public onFocussed:EventEmitter;\n\n constructor(public changeDetector:ChangeDetectorRef) {\n this.hasFocus = false;\n\n this.onFocussed = new EventEmitter();\n }\n\n @HostListener(\"mousemove\")\n public onMouseMove():void {\n if (!this.hasFocus) {\n this.hasFocus = true;\n this.onFocussed.emit(this.hasFocus);\n }\n }\n\n @HostListener(\"mouseleave\")\n public onMouseLeave():void {\n this.hasFocus = false;\n this.onFocussed.emit(this.hasFocus);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/directives/calendar-item.metadata.json b/dist/modules/datepicker/directives/calendar-item.metadata.json deleted file mode 100644 index 67d271080..000000000 --- a/dist/modules/datepicker/directives/calendar-item.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"CalendarItem":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Date"}]}]}},"SuiCalendarItem":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":17,"character":1},"arguments":[{"selector":"[calendarItem]"}]}],"members":{"item":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":5},"arguments":["calendarItem"]}]}],"isSelectable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":24,"character":5},"arguments":["class.disabled"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":29,"character":5},"arguments":["class.active"]}]}],"isToday":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":34,"character":5},"arguments":["class.today"]}]}],"hasFocus":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":39,"character":5},"arguments":["class.focus"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":44,"character":38}]}],"onMouseMove":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":50,"character":5},"arguments":["mousemove"]}]}],"onMouseLeave":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":58,"character":5},"arguments":["mouseleave"]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/directives/datepicker.directive.d.ts b/dist/modules/datepicker/directives/datepicker.directive.d.ts deleted file mode 100644 index 8106d2a26..000000000 --- a/dist/modules/datepicker/directives/datepicker.directive.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { ElementRef, Renderer2, EventEmitter, OnChanges, SimpleChanges } from "@angular/core"; -import { AbstractControl, ValidationErrors } from "@angular/forms"; -import { ICustomValueAccessorHost, CustomValueAccessor, ICustomValidatorHost, CustomValidator, PositioningPlacement, SuiComponentFactory } from "../../../misc/util/index"; -import { IDatepickerLocaleValues, RecursivePartial, SuiLocalizationService } from "../../../behaviors/localization/index"; -import { SuiPopupComponentController, PopupAfterOpen } from "../../popup/index"; -import { SuiDatepicker, DatepickerMode } from "../components/datepicker"; -import { CalendarConfig } from "../classes/calendar-config"; -export declare class SuiDatepickerDirective extends SuiPopupComponentController implements ICustomValueAccessorHost, ICustomValidatorHost, OnChanges, PopupAfterOpen { - renderer: Renderer2; - localizationService: SuiLocalizationService; - private _selectedDate?; - selectedDate: Date | undefined; - private _mode; - config: CalendarConfig; - mode: DatepickerMode; - initialDate?: Date; - maxDate?: Date; - minDate?: Date; - firstDayOfWeek?: number; - private _localeValues; - localeOverrides: RecursivePartial; - readonly localeValues: IDatepickerLocaleValues; - placement: PositioningPlacement; - transition: string; - transitionDuration: number; - onSelectedDateChange: EventEmitter; - onValidatorChange: EventEmitter; - constructor(renderer: Renderer2, element: ElementRef, componentFactory: SuiComponentFactory, localizationService: SuiLocalizationService); - popupOnOpen(): void; - ngOnChanges({maxDate, minDate, mode}: SimpleChanges): void; - private onLocaleUpdate(); - validate(c: AbstractControl): ValidationErrors | null; - writeValue(value: Date | undefined): void; - onKeyDown(e: KeyboardEvent): void; -} -export declare class SuiDatepickerDirectiveValueAccessor extends CustomValueAccessor { - host: SuiDatepickerDirective; - constructor(host: SuiDatepickerDirective); -} -export declare class SuiDatepickerDirectiveValidator extends CustomValidator { - host: SuiDatepickerDirective; - constructor(host: SuiDatepickerDirective); -} diff --git a/dist/modules/datepicker/directives/datepicker.directive.js b/dist/modules/datepicker/directives/datepicker.directive.js deleted file mode 100644 index 9c3ef7e46..000000000 --- a/dist/modules/datepicker/directives/datepicker.directive.js +++ /dev/null @@ -1,233 +0,0 @@ -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 __()); - }; -})(); -import { Directive, ElementRef, Renderer2, EventEmitter, Output, Input, HostListener } from "@angular/core"; -import { customValueAccessorFactory, CustomValueAccessor, customValidatorFactory, CustomValidator, PositioningPlacement, SuiComponentFactory, KeyCode } from "../../../misc/util/index"; -import { SuiLocalizationService } from "../../../behaviors/localization/index"; -import { SuiPopupComponentController, PopupConfig, PopupTrigger } from "../../popup/index"; -import { SuiDatepicker, DatepickerMode } from "../components/datepicker"; -import { YearConfig, MonthConfig, DatetimeConfig, TimeConfig, DateConfig } from "../classes/calendar-config"; -var SuiDatepickerDirective = /** @class */ (function (_super) { - __extends(SuiDatepickerDirective, _super); - function SuiDatepickerDirective(renderer, element, componentFactory, localizationService) { - var _this = _super.call(this, renderer, element, componentFactory, SuiDatepicker, new PopupConfig({ - trigger: PopupTrigger.Focus, - placement: PositioningPlacement.BottomLeft, - transition: "scale", - transitionDuration: 200 - })) || this; - _this.renderer = renderer; - _this.localizationService = localizationService; - // This ensures the popup is drawn correctly (i.e. no border). - // This ensures the popup is drawn correctly (i.e. no border). - _this.renderer.addClass(_this.popup.elementRef.nativeElement, "ui"); - _this.renderer.addClass(_this.popup.elementRef.nativeElement, "calendar"); - _this.onLocaleUpdate(); - _this.localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); - _this.onSelectedDateChange = new EventEmitter(); - _this.onValidatorChange = new EventEmitter(); - _this.mode = DatepickerMode.Datetime; - return _this; - } - Object.defineProperty(SuiDatepickerDirective.prototype, "selectedDate", { - get: function () { - return this._selectedDate; - }, - set: function (date) { - this._selectedDate = date; - this.onSelectedDateChange.emit(date); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerDirective.prototype, "mode", { - get: function () { - return this._mode; - }, - set: function (mode) { - this._mode = mode || DatepickerMode.Datetime; - switch (this._mode) { - case DatepickerMode.Year: - this.config = new YearConfig(); - break; - case DatepickerMode.Month: - this.config = new MonthConfig(); - break; - case DatepickerMode.Date: - default: - this.config = new DateConfig(); - break; - case DatepickerMode.Datetime: - this.config = new DatetimeConfig(); - break; - case DatepickerMode.Time: - this.config = new TimeConfig(); - break; - } - this.writeValue(this.selectedDate); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerDirective.prototype, "localeValues", { - get: function () { - return this.localizationService.override(this._localeValues, this.localeOverrides); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerDirective.prototype, "placement", { - set: function (placement) { - this.popup.config.placement = placement; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerDirective.prototype, "transition", { - set: function (transition) { - this.popup.config.transition = transition; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerDirective.prototype, "transitionDuration", { - set: function (duration) { - this.popup.config.transitionDuration = duration; - }, - enumerable: true, - configurable: true - }); - SuiDatepickerDirective.prototype.popupOnOpen = function () { - var _this = this; - if (this.componentInstance) { - this.componentInstance.service.config = this.config; - this.componentInstance.service.localeValues = this.localeValues; - this.componentInstance.service.currentDate = this.initialDate || new Date(); - this.componentInstance.service.selectedDate = this.selectedDate; - this.componentInstance.service.maxDate = this.maxDate; - this.componentInstance.service.minDate = this.minDate; - if (this.firstDayOfWeek != undefined) { - this.componentInstance.service.firstDayOfWeek = this.firstDayOfWeek; - } - this.componentInstance.service.reset(); - this.componentInstance.service.onDateChange.subscribe(function (d) { - _this.selectedDate = d; - _this.close(); - }); - } - }; - SuiDatepickerDirective.prototype.ngOnChanges = function (_a) { - var maxDate = _a.maxDate, minDate = _a.minDate, mode = _a.mode; - if (maxDate || minDate || mode) { - this.onValidatorChange.emit(); - } - }; - SuiDatepickerDirective.prototype.onLocaleUpdate = function () { - this._localeValues = this.localizationService.get().datepicker; - }; - SuiDatepickerDirective.prototype.validate = function (c) { - var value = c.value; - if (value != undefined) { - // We post process the min & max date because sometimes this puts the date outside of the allowed range. - if (this.minDate && value < this.minDate) { - return { suiMinDate: { required: this.minDate, actual: value } }; - } - if (this.maxDate && value > this.maxDate) { - return { suiMaxDate: { required: this.maxDate, actual: value } }; - } - } - // Angular expects null - // tslint:disable-next-line:no-null-keyword - return null; - }; - SuiDatepickerDirective.prototype.writeValue = function (value) { - this.selectedDate = value; - if (this.componentInstance) { - this.componentInstance.service.selectedDate = value; - } - }; - SuiDatepickerDirective.prototype.onKeyDown = function (e) { - if (e.keyCode === KeyCode.Escape) { - this.close(); - } - }; - SuiDatepickerDirective.decorators = [ - { type: Directive, args: [{ - selector: "[suiDatepicker]", - providers: [customValidatorFactory(SuiDatepickerDirective)] - },] }, - ]; - /** @nocollapse */ - SuiDatepickerDirective.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - { type: SuiComponentFactory, }, - { type: SuiLocalizationService, }, - ]; }; - SuiDatepickerDirective.propDecorators = { - "mode": [{ type: Input, args: ["pickerMode",] },], - "initialDate": [{ type: Input, args: ["pickerInitialDate",] },], - "maxDate": [{ type: Input, args: ["pickerMaxDate",] },], - "minDate": [{ type: Input, args: ["pickerMinDate",] },], - "firstDayOfWeek": [{ type: Input, args: ["pickerFirstDayOfWeek",] },], - "localeOverrides": [{ type: Input, args: ["pickerLocaleOverrides",] },], - "placement": [{ type: Input, args: ["pickerPlacement",] },], - "transition": [{ type: Input, args: ["pickerTransition",] },], - "transitionDuration": [{ type: Input, args: ["pickerTransitionDuration",] },], - "onSelectedDateChange": [{ type: Output, args: ["pickerSelectedDateChange",] },], - "onValidatorChange": [{ type: Output, args: ["pickerValidatorChange",] },], - "onKeyDown": [{ type: HostListener, args: ["keydown", ["$event"],] },], - }; - return SuiDatepickerDirective; -}(SuiPopupComponentController)); -export { SuiDatepickerDirective }; -var SuiDatepickerDirectiveValueAccessor = /** @class */ (function (_super) { - __extends(SuiDatepickerDirectiveValueAccessor, _super); - function SuiDatepickerDirectiveValueAccessor(host) { - var _this = _super.call(this, host) || this; - _this.host = host; - return _this; - } - SuiDatepickerDirectiveValueAccessor.decorators = [ - { type: Directive, args: [{ - selector: "[suiDatepicker]", - host: { "(pickerSelectedDateChange)": "onChange($event)" }, - providers: [customValueAccessorFactory(SuiDatepickerDirectiveValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiDatepickerDirectiveValueAccessor.ctorParameters = function () { return [ - { type: SuiDatepickerDirective, }, - ]; }; - return SuiDatepickerDirectiveValueAccessor; -}(CustomValueAccessor)); -export { SuiDatepickerDirectiveValueAccessor }; -var SuiDatepickerDirectiveValidator = /** @class */ (function (_super) { - __extends(SuiDatepickerDirectiveValidator, _super); - function SuiDatepickerDirectiveValidator(host) { - var _this = _super.call(this, host) || this; - _this.host = host; - return _this; - } - SuiDatepickerDirectiveValidator.decorators = [ - { type: Directive, args: [{ - selector: "[suiDatepicker]", - host: { "(pickerValidatorChange)": "onValidatorChange()" }, - providers: [customValidatorFactory(SuiDatepickerDirectiveValidator)] - },] }, - ]; - /** @nocollapse */ - SuiDatepickerDirectiveValidator.ctorParameters = function () { return [ - { type: SuiDatepickerDirective, }, - ]; }; - return SuiDatepickerDirectiveValidator; -}(CustomValidator)); -export { SuiDatepickerDirectiveValidator }; -//# sourceMappingURL=datepicker.directive.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/directives/datepicker.directive.js.map b/dist/modules/datepicker/directives/datepicker.directive.js.map deleted file mode 100644 index 1b5c01178..000000000 --- a/dist/modules/datepicker/directives/datepicker.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"datepicker.directive.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/directives/datepicker.directive.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAC7D,YAAY,EACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EACuB,0BAA0B,EAAE,mBAAmB,EACnD,sBAAsB,EAAE,eAAe,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,OAAO,EACpH,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAA6C,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC1H,OAAO,EAAE,2BAA2B,EAAkB,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3G,OAAO,EAAE,aAAa,EAAE,cAAc,EAA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AAC,+BAA+B,CAAC,CAAC;iBACvE;;;;gBAjMY,sBAAsB;;0CAlBnC;EAoNqD,eAAe;SAAvD,+BAA+B","sourcesContent":["import {\n Directive, ElementRef, Renderer2, EventEmitter, Output, Input,\n HostListener, OnChanges, SimpleChanges\n} from \"@angular/core\";\nimport { AbstractControl, ValidationErrors } from \"@angular/forms\";\nimport {\n ICustomValueAccessorHost, customValueAccessorFactory, CustomValueAccessor,\n ICustomValidatorHost, customValidatorFactory, CustomValidator, PositioningPlacement, SuiComponentFactory, KeyCode\n} from \"../../../misc/util/index\";\nimport { IDatepickerLocaleValues, RecursivePartial, SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SuiPopupComponentController, PopupAfterOpen, PopupConfig, PopupTrigger } from \"../../popup/index\";\nimport { SuiDatepicker, DatepickerMode } from \"../components/datepicker\";\nimport { CalendarConfig, YearConfig, MonthConfig, DatetimeConfig, TimeConfig, DateConfig } from \"../classes/calendar-config\";\n\n@Directive({\n selector: \"[suiDatepicker]\",\n providers: [customValidatorFactory(SuiDatepickerDirective)]\n})\nexport class SuiDatepickerDirective\n extends SuiPopupComponentController\n implements ICustomValueAccessorHost, ICustomValidatorHost, OnChanges, PopupAfterOpen {\n\n private _selectedDate?:Date;\n\n public get selectedDate():Date | undefined {\n return this._selectedDate;\n }\n\n public set selectedDate(date:Date | undefined) {\n this._selectedDate = date;\n this.onSelectedDateChange.emit(date);\n }\n\n private _mode:DatepickerMode;\n public config:CalendarConfig;\n\n @Input(\"pickerMode\")\n public get mode():DatepickerMode {\n return this._mode;\n }\n\n public set mode(mode:DatepickerMode) {\n this._mode = mode || DatepickerMode.Datetime;\n switch (this._mode) {\n case DatepickerMode.Year:\n this.config = new YearConfig();\n break;\n case DatepickerMode.Month:\n this.config = new MonthConfig();\n break;\n case DatepickerMode.Date:\n default:\n this.config = new DateConfig();\n break;\n case DatepickerMode.Datetime:\n this.config = new DatetimeConfig();\n break;\n case DatepickerMode.Time:\n this.config = new TimeConfig();\n break;\n }\n this.writeValue(this.selectedDate);\n }\n\n @Input(\"pickerInitialDate\")\n public initialDate?:Date;\n\n @Input(\"pickerMaxDate\")\n public maxDate?:Date;\n\n @Input(\"pickerMinDate\")\n public minDate?:Date;\n\n @Input(\"pickerFirstDayOfWeek\")\n public firstDayOfWeek?:number;\n\n private _localeValues:IDatepickerLocaleValues;\n\n @Input(\"pickerLocaleOverrides\")\n public localeOverrides:RecursivePartial;\n\n public get localeValues():IDatepickerLocaleValues {\n return this.localizationService.override<\"datepicker\">(this._localeValues, this.localeOverrides);\n }\n\n @Input(\"pickerPlacement\")\n public set placement(placement:PositioningPlacement) {\n this.popup.config.placement = placement;\n }\n\n @Input(\"pickerTransition\")\n public set transition(transition:string) {\n this.popup.config.transition = transition;\n }\n\n @Input(\"pickerTransitionDuration\")\n public set transitionDuration(duration:number) {\n this.popup.config.transitionDuration = duration;\n }\n\n @Output(\"pickerSelectedDateChange\")\n public onSelectedDateChange:EventEmitter;\n\n @Output(\"pickerValidatorChange\")\n public onValidatorChange:EventEmitter;\n\n constructor(public renderer:Renderer2,\n element:ElementRef,\n componentFactory:SuiComponentFactory,\n public localizationService:SuiLocalizationService) {\n\n super(renderer, element, componentFactory, SuiDatepicker, new PopupConfig({\n trigger: PopupTrigger.Focus,\n placement: PositioningPlacement.BottomLeft,\n transition: \"scale\",\n transitionDuration: 200\n }));\n\n // This ensures the popup is drawn correctly (i.e. no border).\n this.renderer.addClass(this.popup.elementRef.nativeElement, \"ui\");\n this.renderer.addClass(this.popup.elementRef.nativeElement, \"calendar\");\n\n this.onLocaleUpdate();\n this.localizationService.onLanguageUpdate.subscribe(() => this.onLocaleUpdate());\n\n this.onSelectedDateChange = new EventEmitter();\n this.onValidatorChange = new EventEmitter();\n\n this.mode = DatepickerMode.Datetime;\n }\n\n public popupOnOpen():void {\n if (this.componentInstance) {\n this.componentInstance.service.config = this.config;\n this.componentInstance.service.localeValues = this.localeValues;\n this.componentInstance.service.currentDate = this.initialDate || new Date();\n this.componentInstance.service.selectedDate = this.selectedDate;\n this.componentInstance.service.maxDate = this.maxDate;\n this.componentInstance.service.minDate = this.minDate;\n\n if (this.firstDayOfWeek != undefined) {\n this.componentInstance.service.firstDayOfWeek = this.firstDayOfWeek;\n }\n\n this.componentInstance.service.reset();\n\n this.componentInstance.service.onDateChange.subscribe((d:Date) => {\n this.selectedDate = d;\n this.close();\n });\n }\n }\n\n public ngOnChanges({ maxDate, minDate, mode }:SimpleChanges):void {\n if (maxDate || minDate || mode) {\n this.onValidatorChange.emit();\n }\n }\n\n private onLocaleUpdate():void {\n this._localeValues = this.localizationService.get().datepicker;\n }\n\n public validate(c:AbstractControl):ValidationErrors | null {\n const value = c.value;\n\n if (value != undefined) {\n // We post process the min & max date because sometimes this puts the date outside of the allowed range.\n if (this.minDate && value < this.minDate) {\n return { suiMinDate: { required: this.minDate, actual: value } };\n }\n\n if (this.maxDate && value > this.maxDate) {\n return { suiMaxDate: { required: this.maxDate, actual: value } };\n }\n }\n\n // Angular expects null\n // tslint:disable-next-line:no-null-keyword\n return null;\n }\n\n public writeValue(value:Date | undefined):void {\n this.selectedDate = value;\n\n if (this.componentInstance) {\n this.componentInstance.service.selectedDate = value;\n }\n }\n\n @HostListener(\"keydown\", [\"$event\"])\n public onKeyDown(e:KeyboardEvent):void {\n if (e.keyCode === KeyCode.Escape) {\n this.close();\n }\n }\n}\n\n@Directive({\n selector: \"[suiDatepicker]\",\n host: { \"(pickerSelectedDateChange)\": \"onChange($event)\" },\n providers: [customValueAccessorFactory(SuiDatepickerDirectiveValueAccessor)]\n})\nexport class SuiDatepickerDirectiveValueAccessor extends CustomValueAccessor {\n constructor(public host:SuiDatepickerDirective) { super(host); }\n}\n\n@Directive({\n selector: \"[suiDatepicker]\",\n host: { \"(pickerValidatorChange)\": \"onValidatorChange()\" },\n providers: [customValidatorFactory(SuiDatepickerDirectiveValidator)]\n})\nexport class SuiDatepickerDirectiveValidator extends CustomValidator {\n constructor(public host:SuiDatepickerDirective) { super(host); }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/directives/datepicker.directive.metadata.json b/dist/modules/datepicker/directives/datepicker.directive.metadata.json deleted file mode 100644 index aea918c8b..000000000 --- a/dist/modules/datepicker/directives/datepicker.directive.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiDatepickerDirective":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../popup/index","name":"SuiPopupComponentController","line":19,"character":15},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":14,"character":1},"arguments":[{"selector":"[suiDatepicker]","providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValidatorFactory","line":16,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiDatepickerDirective"}]}]}]}],"members":{"mode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":5},"arguments":["pickerMode"]}]}],"initialDate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5},"arguments":["pickerInitialDate"]}]}],"maxDate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":67,"character":5},"arguments":["pickerMaxDate"]}]}],"minDate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":5},"arguments":["pickerMinDate"]}]}],"firstDayOfWeek":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":5},"arguments":["pickerFirstDayOfWeek"]}]}],"localeOverrides":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":78,"character":5},"arguments":["pickerLocaleOverrides"]}]}],"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":85,"character":5},"arguments":["pickerPlacement"]}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":90,"character":5},"arguments":["pickerTransition"]}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":95,"character":5},"arguments":["pickerTransitionDuration"]}]}],"onSelectedDateChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":100,"character":5},"arguments":["pickerSelectedDateChange"]}]}],"onValidatorChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":103,"character":5},"arguments":["pickerValidatorChange"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":106,"character":32},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":107,"character":24},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":108,"character":33},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":109,"character":43}]}],"popupOnOpen":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"onLocaleUpdate":[{"__symbolic":"method"}],"validate":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"onKeyDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":190,"character":5},"arguments":["keydown",["$event"]]}]}]}},"SuiDatepickerDirectiveValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":203,"character":57},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":198,"character":1},"arguments":[{"selector":"[suiDatepicker]","host":{"(pickerSelectedDateChange)":"onChange($event)","$quoted$":["(pickerSelectedDateChange)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":201,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiDatepickerDirectiveValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiDatepickerDirective"}]}]}},"SuiDatepickerDirectiveValidator":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValidator","line":212,"character":53},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":207,"character":1},"arguments":[{"selector":"[suiDatepicker]","host":{"(pickerValidatorChange)":"onValidatorChange()","$quoted$":["(pickerValidatorChange)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValidatorFactory","line":210,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiDatepickerDirectiveValidator"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiDatepickerDirective"}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/directives/input.directive.d.ts b/dist/modules/datepicker/directives/input.directive.d.ts deleted file mode 100644 index 0b801db88..000000000 --- a/dist/modules/datepicker/directives/input.directive.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ElementRef } from "@angular/core"; -import { SuiLocalizationService } from "../../../behaviors/localization/index"; -import { SuiDatepickerDirective, SuiDatepickerDirectiveValueAccessor } from "./datepicker.directive"; -import { DateParser } from "../classes/date-parser"; -import "../helpers/is-webview"; -export declare class SuiDatepickerInputDirective { - datepicker: SuiDatepickerDirective; - valueAccessor: SuiDatepickerDirectiveValueAccessor; - element: ElementRef; - private _useNativeOnMobile; - useNativeOnMobile: boolean; - private _fallbackActive; - fallbackActive: boolean; - readonly parser: DateParser; - private _currentInputValue; - private _lastUpdateTyped; - readonly selectedDateString: string | undefined; - readonly type: string; - readonly max: string | undefined; - readonly min: string | undefined; - constructor(datepicker: SuiDatepickerDirective, valueAccessor: SuiDatepickerDirectiveValueAccessor, element: ElementRef, localizationService: SuiLocalizationService); - private updateValue(value); - typeValue(value: string | undefined): void; - onFocusOut(): void; -} diff --git a/dist/modules/datepicker/directives/input.directive.js b/dist/modules/datepicker/directives/input.directive.js deleted file mode 100644 index f9839f3fd..000000000 --- a/dist/modules/datepicker/directives/input.directive.js +++ /dev/null @@ -1,155 +0,0 @@ -import { Directive, Host, Input, ElementRef, HostBinding, HostListener } from "@angular/core"; -import { DateUtil } from "../../../misc/util/index"; -import { SuiLocalizationService } from "../../../behaviors/localization/index"; -import { PopupTrigger } from "../../popup/index"; -import { SuiDatepickerDirective, SuiDatepickerDirectiveValueAccessor } from "./datepicker.directive"; -import { InternalDateParser, DateParser } from "../classes/date-parser"; -import * as bowser from "bowser"; -import "../helpers/is-webview"; -import * as isUAWebView from "is-ua-webview"; -var isWebView = isUAWebView["default"] || isUAWebView; -var SuiDatepickerInputDirective = /** @class */ (function () { - function SuiDatepickerInputDirective(datepicker, valueAccessor, element, localizationService) { - var _this = this; - this.datepicker = datepicker; - this.valueAccessor = valueAccessor; - this.element = element; - this.useNativeOnMobile = true; - this.fallbackActive = false; - // Whenever the datepicker value updates, update the input text alongside it. - this.datepicker.onSelectedDateChange.subscribe(function () { - return _this.updateValue(_this.selectedDateString); - }); - localizationService.onLanguageUpdate.subscribe(function () { - return _this.updateValue(_this.selectedDateString); - }); - } - Object.defineProperty(SuiDatepickerInputDirective.prototype, "useNativeOnMobile", { - get: function () { - return this._useNativeOnMobile; - }, - set: function (fallback) { - this._useNativeOnMobile = fallback; - var isOnMobile = bowser.mobile || bowser.tablet || isWebView(navigator.userAgent); - this.fallbackActive = this.useNativeOnMobile && isOnMobile; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "fallbackActive", { - get: function () { - return this._fallbackActive; - }, - set: function (active) { - this._fallbackActive = active; - // If the fallback is active, then the trigger must be manual so the datepicker never opens. - this.datepicker.popup.config.trigger = this.fallbackActive ? PopupTrigger.Manual : PopupTrigger.Focus; - // Update the input value (this will insert the `T` as required). - this.updateValue(this.selectedDateString); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "parser", { - get: function () { - if (this.fallbackActive) { - return new InternalDateParser(this.datepicker.mode, this.datepicker.localeValues); - } - return new DateParser(this.datepicker.localeValues.formats[this.datepicker.mode], this.datepicker.localeValues); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "selectedDateString", { - get: function () { - if (this.datepicker.selectedDate) { - return this.parser.format(this.datepicker.selectedDate); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "type", { - get: function () { - if (this.fallbackActive) { - return this.datepicker.config.fallback; - } - return "text"; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "max", { - get: function () { - if (this.fallbackActive && this.datepicker.maxDate) { - // Since HTML doesn't use a date object max is somewhat tricky. - // Our Datepicker will always choose the 1st date on the provided precision, - // meaning anything below the maxDate will work, hence endOf. - var max = DateUtil.endOf(this.datepicker.config.precision, DateUtil.clone(this.datepicker.maxDate)); - return this.parser.format(max); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDatepickerInputDirective.prototype, "min", { - get: function () { - if (this.fallbackActive && this.datepicker.minDate) { - // Since HTML doesn't use a date object min is somewhat tricky. - // We use 1 minute before the next date at the configured precision since - // our Datepicker picks the first available date at that precision. - var min = DateUtil.clone(this.datepicker.minDate); - return this.parser.format(min); - } - }, - enumerable: true, - configurable: true - }); - SuiDatepickerInputDirective.prototype.updateValue = function (value) { - // Only update the current value if it is different to what it's being updated to. - // This is so that the editing position isn't changed when manually typing the date. - if (!this._lastUpdateTyped) { - this.datepicker.renderer.setProperty(this.element.nativeElement, "value", value || ""); - } - this._lastUpdateTyped = false; - }; - SuiDatepickerInputDirective.prototype.typeValue = function (value) { - this._lastUpdateTyped = true; - this._currentInputValue = value; - if (!value) { - // Delete the selected date if no date was entered manually. - return this.datepicker.writeValue(undefined); - } - var parsed = this.parser.parse(value, this.datepicker.selectedDate); - if (!isNaN(parsed.getTime()) && value === this.parser.format(parsed)) { - return this.datepicker.writeValue(parsed); - } - return this.datepicker.writeValue(undefined); - }; - SuiDatepickerInputDirective.prototype.onFocusOut = function () { - this.valueAccessor.onTouched(); - }; - SuiDatepickerInputDirective.decorators = [ - { type: Directive, args: [{ - selector: "input[suiDatepicker]" - },] }, - ]; - /** @nocollapse */ - SuiDatepickerInputDirective.ctorParameters = function () { return [ - { type: SuiDatepickerDirective, decorators: [{ type: Host },] }, - { type: SuiDatepickerDirectiveValueAccessor, decorators: [{ type: Host },] }, - { type: ElementRef, }, - { type: SuiLocalizationService, }, - ]; }; - SuiDatepickerInputDirective.propDecorators = { - "useNativeOnMobile": [{ type: Input, args: ["pickerUseNativeOnMobile",] },], - "type": [{ type: HostBinding, args: ["attr.type",] },], - "max": [{ type: HostBinding, args: ["attr.max",] },], - "min": [{ type: HostBinding, args: ["attr.min",] },], - "typeValue": [{ type: HostListener, args: ["input", ["$event.target.value"],] },], - "onFocusOut": [{ type: HostListener, args: ["focusout",] },], - }; - return SuiDatepickerInputDirective; -}()); -export { SuiDatepickerInputDirective }; -//# sourceMappingURL=input.directive.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/directives/input.directive.js.map b/dist/modules/datepicker/directives/input.directive.js.map deleted file mode 100644 index 3f5590f77..000000000 --- a/dist/modules/datepicker/directives/input.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"input.directive.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/directives/input.directive.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW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AAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;SAChD;QAED,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QACtE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACnE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;SAC7C;QACD,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;;IAI1C,gDAAU;QACb,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;;;gBAzHtC,SAAS,SAAC;oBACP,QAAQ,EAAE,sBAAsB;iBACnC;;;;gBAVQ,sBAAsB,uBAqFd,IAAI;gBArFY,mCAAmC,uBAsFnD,IAAI;gBA1FY,UAAU;gBAElC,sBAAsB;;;sCAgB1B,KAAK,SAAC,yBAAyB;yBAyC/B,WAAW,SAAC,WAAW;wBAQvB,WAAW,SAAC,UAAU;wBAWtB,WAAW,SAAC,UAAU;8BAoCtB,YAAY,SAAC,OAAO,EAAE,CAAC,qBAAqB,CAAC;+BAiB7C,YAAY,SAAC,UAAU;;sCApI5B;;SAgBa,2BAA2B","sourcesContent":["\nimport { Directive, Host, Input, ElementRef, HostBinding, HostListener } from \"@angular/core\";\nimport { DateUtil, DatePrecision } from \"../../../misc/util/index\";\nimport { SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { PopupTrigger } from \"../../popup/index\";\nimport { SuiDatepickerDirective, SuiDatepickerDirectiveValueAccessor } from \"./datepicker.directive\";\nimport { InternalDateParser, DateParser } from \"../classes/date-parser\";\nimport * as bowser from \"bowser\";\n\nimport \"../helpers/is-webview\";\nimport * as isUAWebView from \"is-ua-webview\";\nconst isWebView = isUAWebView[\"default\"] || isUAWebView;\n\n@Directive({\n selector: \"input[suiDatepicker]\"\n})\nexport class SuiDatepickerInputDirective {\n private _useNativeOnMobile:boolean;\n\n @Input(\"pickerUseNativeOnMobile\")\n public get useNativeOnMobile():boolean {\n return this._useNativeOnMobile;\n }\n\n public set useNativeOnMobile(fallback:boolean) {\n this._useNativeOnMobile = fallback;\n const isOnMobile = bowser.mobile || bowser.tablet || isWebView(navigator.userAgent);\n this.fallbackActive = this.useNativeOnMobile && isOnMobile;\n }\n\n private _fallbackActive:boolean;\n\n public get fallbackActive():boolean {\n return this._fallbackActive;\n }\n\n public set fallbackActive(active:boolean) {\n this._fallbackActive = active;\n // If the fallback is active, then the trigger must be manual so the datepicker never opens.\n this.datepicker.popup.config.trigger = this.fallbackActive ? PopupTrigger.Manual : PopupTrigger.Focus;\n // Update the input value (this will insert the `T` as required).\n this.updateValue(this.selectedDateString);\n }\n\n public get parser():DateParser {\n if (this.fallbackActive) {\n return new InternalDateParser(this.datepicker.mode, this.datepicker.localeValues);\n }\n return new DateParser(this.datepicker.localeValues.formats[this.datepicker.mode], this.datepicker.localeValues);\n }\n\n private _currentInputValue:string | undefined;\n private _lastUpdateTyped:boolean;\n\n public get selectedDateString():string | undefined {\n if (this.datepicker.selectedDate) {\n return this.parser.format(this.datepicker.selectedDate);\n }\n }\n\n @HostBinding(\"attr.type\")\n public get type():string {\n if (this.fallbackActive) {\n return this.datepicker.config.fallback;\n }\n return \"text\";\n }\n\n @HostBinding(\"attr.max\")\n public get max():string | undefined {\n if (this.fallbackActive && this.datepicker.maxDate) {\n // Since HTML doesn't use a date object max is somewhat tricky.\n // Our Datepicker will always choose the 1st date on the provided precision,\n // meaning anything below the maxDate will work, hence endOf.\n const max = DateUtil.endOf(this.datepicker.config.precision, DateUtil.clone(this.datepicker.maxDate));\n return this.parser.format(max);\n }\n }\n\n @HostBinding(\"attr.min\")\n public get min():string | undefined {\n if (this.fallbackActive && this.datepicker.minDate) {\n // Since HTML doesn't use a date object min is somewhat tricky.\n // We use 1 minute before the next date at the configured precision since\n // our Datepicker picks the first available date at that precision.\n const min = DateUtil.clone(this.datepicker.minDate);\n return this.parser.format(min);\n }\n }\n\n constructor(@Host() public datepicker:SuiDatepickerDirective,\n @Host() public valueAccessor:SuiDatepickerDirectiveValueAccessor,\n public element:ElementRef,\n localizationService:SuiLocalizationService) {\n this.useNativeOnMobile = true;\n this.fallbackActive = false;\n\n // Whenever the datepicker value updates, update the input text alongside it.\n this.datepicker.onSelectedDateChange.subscribe(() =>\n this.updateValue(this.selectedDateString));\n\n localizationService.onLanguageUpdate.subscribe(() =>\n this.updateValue(this.selectedDateString));\n }\n\n private updateValue(value:string | undefined):void {\n // Only update the current value if it is different to what it's being updated to.\n // This is so that the editing position isn't changed when manually typing the date.\n if (!this._lastUpdateTyped) {\n this.datepicker.renderer.setProperty(this.element.nativeElement, \"value\", value || \"\");\n }\n\n this._lastUpdateTyped = false;\n }\n\n @HostListener(\"input\", [\"$event.target.value\"])\n public typeValue(value:string | undefined):void {\n this._lastUpdateTyped = true;\n this._currentInputValue = value;\n\n if (!value) {\n // Delete the selected date if no date was entered manually.\n return this.datepicker.writeValue(undefined);\n }\n\n const parsed = this.parser.parse(value, this.datepicker.selectedDate);\n if (!isNaN(parsed.getTime()) && value === this.parser.format(parsed)) {\n return this.datepicker.writeValue(parsed);\n }\n return this.datepicker.writeValue(undefined);\n }\n\n @HostListener(\"focusout\")\n public onFocusOut():void {\n this.valueAccessor.onTouched();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/directives/input.directive.metadata.json b/dist/modules/datepicker/directives/input.directive.metadata.json deleted file mode 100644 index de0f485b9..000000000 --- a/dist/modules/datepicker/directives/input.directive.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiDatepickerInputDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":13,"character":1},"arguments":[{"selector":"input[suiDatepicker]"}]}],"members":{"useNativeOnMobile":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":5},"arguments":["pickerUseNativeOnMobile"]}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":60,"character":5},"arguments":["attr.type"]}]}],"max":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":68,"character":5},"arguments":["attr.max"]}]}],"min":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":79,"character":5},"arguments":["attr.min"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host","line":90,"character":17}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host","line":91,"character":17}}],null,null],"parameters":[{"__symbolic":"reference","module":"./datepicker.directive","name":"SuiDatepickerDirective","line":90,"character":42},{"__symbolic":"reference","module":"./datepicker.directive","name":"SuiDatepickerDirectiveValueAccessor","line":91,"character":45},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":92,"character":31},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":93,"character":36}]}],"updateValue":[{"__symbolic":"method"}],"typeValue":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":115,"character":5},"arguments":["input",["$event.target.value"]]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":132,"character":5},"arguments":["focusout"]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/date-fns.d.ts b/dist/modules/datepicker/helpers/date-fns.d.ts deleted file mode 100644 index f3bcc2e2b..000000000 --- a/dist/modules/datepicker/helpers/date-fns.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { IDatepickerLocaleValues } from "../../../behaviors/localization/index"; -export declare class DateFnsParser { - private _weekStartsOn; - private _locale; - private readonly _config; - constructor(locale: IDatepickerLocaleValues); - format(d: Date, f: string): string; - parse(dS: string, f: string, bD: Date): Date; -} diff --git a/dist/modules/datepicker/helpers/date-fns.js b/dist/modules/datepicker/helpers/date-fns.js deleted file mode 100644 index f480f3fad..000000000 --- a/dist/modules/datepicker/helpers/date-fns.js +++ /dev/null @@ -1,99 +0,0 @@ -var __assign = (this && this.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -import { format, parse } from "date-fns"; -import * as defaultLocale from "date-fns/locale/en-US"; -function buildLocalizeFn(values, defaultType, indexCallback) { - return function (dirtyIndex, _a) { - var type = (_a === void 0 ? { type: defaultType } : _a).type; - var index = indexCallback ? indexCallback(dirtyIndex) : dirtyIndex; - return values[type][index]; - }; -} -function buildLocalizeArrayFn(values, defaultType) { - return function (_a) { - var type = (_a === void 0 ? { type: defaultType } : _a).type; - return values[type]; - }; -} -function buildMatchFn(patterns, defaultType) { - return function (dirtyString, _a) { - var type = (_a === void 0 ? { type: defaultType } : _a).type; - return dirtyString.match("^(" + patterns[type].join("|") + ")"); - }; -} -function buildParseFn(patterns, defaultType) { - return function (_a, _b) { - var result = _a[1]; - var type = (_b === void 0 ? { type: defaultType } : _b).type; - return (patterns[type] || patterns[defaultType]) - .map(function (p) { return new RegExp("^" + p); }) - .findIndex(function (pattern) { return pattern.test(result); }); - }; -} -var DateFnsParser = /** @class */ (function () { - function DateFnsParser(locale) { - this._weekStartsOn = locale.firstDayOfWeek; - var weekdayValues = { - long: locale.weekdays, - short: locale.weekdaysShort, - narrow: locale.weekdaysNarrow - }; - var monthValues = { - long: locale.months, - short: locale.monthsShort - }; - var timeOfDayValues = { - long: locale.timesOfDay, - uppercase: locale.timesOfDayUppercase, - lowercase: locale.timesOfDayLowercase - }; - var timeOfDayMatchValues = { - long: locale.timesOfDay, - short: locale.timesOfDayUppercase.concat(locale.timesOfDayLowercase) - }; - this._locale = defaultLocale; - this._locale.localize = __assign({}, this._locale.localize, { - weekday: buildLocalizeFn(weekdayValues, "long"), - weekdays: buildLocalizeArrayFn(weekdayValues, "long"), - month: buildLocalizeFn(monthValues, "long"), - months: buildLocalizeArrayFn(monthValues, "long"), - timeOfDay: buildLocalizeFn(timeOfDayValues, "long", function (hours) { - return hours / 12 >= 1 ? 1 : 0; - }), - timesOfDay: buildLocalizeArrayFn(timeOfDayValues, "long") - }); - this._locale.match = __assign({}, this._locale.match, { - weekdays: buildMatchFn(weekdayValues, "long"), - weekday: buildParseFn(weekdayValues, "long"), - months: buildMatchFn(monthValues, "long"), - month: buildParseFn(monthValues, "long"), - timesOfDay: buildMatchFn(timeOfDayMatchValues, "long"), - timeOfDay: buildParseFn(timeOfDayMatchValues, "long") - }); - } - Object.defineProperty(DateFnsParser.prototype, "_config", { - get: function () { - return { - weekStartsOn: this._weekStartsOn, - locale: this._locale - }; - }, - enumerable: true, - configurable: true - }); - DateFnsParser.prototype.format = function (d, f) { - return format(d, f, this._config); - }; - DateFnsParser.prototype.parse = function (dS, f, bD) { - return parse(dS, f, bD, this._config); - }; - return DateFnsParser; -}()); -export { DateFnsParser }; -//# sourceMappingURL=date-fns.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/date-fns.js.map b/dist/modules/datepicker/helpers/date-fns.js.map deleted file mode 100644 index ecb110385..000000000 --- a/dist/modules/datepicker/helpers/date-fns.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"date-fns.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/helpers/date-fns.ts"],"names":[],"mappings":";;;;;;;;AACA,OA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,gBACX,IAAI,CAAC,OAAO,CAAC,KAAK,EAClB;YACC,QAAQ,EAAE,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC;YAC7C,OAAO,EAAE,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC;YAC5C,MAAM,EAAE,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC;YACzC,KAAK,EAAE,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC;YACxC,UAAU,EAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC;YACrD,SAAS,EAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC;SACvD,CACJ,CAAC;KACL;IAzDD,sBAAY,kCAAO;aAAnB;YACI,MAAM,CAAC;gBACH,YAAY,EAAE,IAAI,CAAC,aAAa;gBAChC,MAAM,EAAE,IAAI,CAAC,OAAO;aACvB,CAAC;SACL;;;OAAA;IAsDM,8BAAM,GAAb,UAAc,CAAM,EAAE,CAAQ;QAC1B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KACrC;IAEM,6BAAK,GAAZ,UAAa,EAAS,EAAE,CAAQ,EAAE,EAAO;QACrC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KACzC;wBA9HL;IA+HC,CAAA;AAtED,yBAsEC","sourcesContent":["import { IDatepickerLocaleValues } from \"../../../behaviors/localization/index\";\nimport { format, parse } from \"date-fns\";\nimport * as defaultLocale from \"date-fns/locale/en-US\";\n\ninterface IDateFnsLocaleValues { [name:string]:string[]; }\ninterface IDateFnsHelperOptions { type?:string; }\ntype DateFnsHelper = (value:U, options:IDateFnsHelperOptions) => T;\ntype DateFnsWeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\ninterface IDateFnsCustomLocale {\n localize:{\n weekday:DateFnsHelper;\n weekdays:DateFnsHelper;\n month:DateFnsHelper;\n months:DateFnsHelper;\n timeOfDay:DateFnsHelper;\n timesOfDay:DateFnsHelper;\n };\n match:{\n weekdays:DateFnsHelper;\n weekday?:DateFnsHelper;\n months:DateFnsHelper;\n month?:DateFnsHelper;\n timesOfDay:DateFnsHelper;\n timeOfDay?:DateFnsHelper;\n };\n options?:{\n weekStartsOn?:number;\n };\n}\n\nfunction buildLocalizeFn(values:IDateFnsLocaleValues,\n defaultType:string,\n indexCallback?:(oldIndex:number) => number):DateFnsHelper {\n\n return (dirtyIndex:number, { type } = { type: defaultType }) => {\n const index = indexCallback ? indexCallback(dirtyIndex) : dirtyIndex;\n return values[type][index];\n };\n}\n\nfunction buildLocalizeArrayFn(values:IDateFnsLocaleValues, defaultType:string):DateFnsHelper {\n return ({ type } = { type: defaultType }) => values[type];\n}\n\nfunction buildMatchFn(patterns:IDateFnsLocaleValues, defaultType:string):DateFnsHelper {\n return (dirtyString, { type } = { type: defaultType }) =>\n dirtyString.match(`^(${patterns[type].join(\"|\")})`);\n}\n\nfunction buildParseFn(patterns:IDateFnsLocaleValues, defaultType:string):DateFnsHelper {\n return ([, result], { type } = { type: defaultType }) =>\n (patterns[type] || patterns[defaultType])\n .map(p => new RegExp(`^${p}`))\n .findIndex(pattern => pattern.test(result));\n}\n\nexport class DateFnsParser {\n private _weekStartsOn:DateFnsWeekStartsOn;\n private _locale:IDateFnsCustomLocale;\n\n private get _config():any {\n return {\n weekStartsOn: this._weekStartsOn,\n locale: this._locale\n };\n }\n\n constructor(locale:IDatepickerLocaleValues) {\n this._weekStartsOn = locale.firstDayOfWeek as DateFnsWeekStartsOn;\n\n const weekdayValues = {\n long: locale.weekdays,\n short: locale.weekdaysShort,\n narrow: locale.weekdaysNarrow\n };\n\n const monthValues = {\n long: locale.months,\n short: locale.monthsShort\n };\n\n const timeOfDayValues = {\n long: locale.timesOfDay,\n uppercase: locale.timesOfDayUppercase,\n lowercase: locale.timesOfDayLowercase\n };\n\n const timeOfDayMatchValues = {\n long: locale.timesOfDay,\n short: locale.timesOfDayUppercase.concat(locale.timesOfDayLowercase)\n };\n\n this._locale = defaultLocale as any;\n this._locale.localize = {\n ...this._locale.localize,\n ...{\n weekday: buildLocalizeFn(weekdayValues, \"long\"),\n weekdays: buildLocalizeArrayFn(weekdayValues, \"long\"),\n month: buildLocalizeFn(monthValues, \"long\"),\n months: buildLocalizeArrayFn(monthValues, \"long\"),\n timeOfDay: buildLocalizeFn(timeOfDayValues, \"long\", (hours:number) => {\n return hours / 12 >= 1 ? 1 : 0;\n }),\n timesOfDay: buildLocalizeArrayFn(timeOfDayValues, \"long\")\n }\n };\n this._locale.match = {\n ...this._locale.match,\n ...{\n weekdays: buildMatchFn(weekdayValues, \"long\"),\n weekday: buildParseFn(weekdayValues, \"long\"),\n months: buildMatchFn(monthValues, \"long\"),\n month: buildParseFn(monthValues, \"long\"),\n timesOfDay:buildMatchFn(timeOfDayMatchValues, \"long\"),\n timeOfDay:buildParseFn(timeOfDayMatchValues, \"long\")\n }\n };\n }\n\n public format(d:Date, f:string):string {\n return format(d, f, this._config);\n }\n\n public parse(dS:string, f:string, bD:Date):Date {\n return parse(dS, f, bD, this._config);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/date-fns.metadata.json b/dist/modules/datepicker/helpers/date-fns.metadata.json deleted file mode 100644 index 0b666b0b2..000000000 --- a/dist/modules/datepicker/helpers/date-fns.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"DateFnsParser":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"IDatepickerLocaleValues","line":68,"character":23}]}],"format":[{"__symbolic":"method"}],"parse":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/is-webview.d.ts b/dist/modules/datepicker/helpers/is-webview.d.ts deleted file mode 100644 index 62436b41a..000000000 --- a/dist/modules/datepicker/helpers/is-webview.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module "is-ua-webview"; \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/is-webview.js b/dist/modules/datepicker/helpers/is-webview.js deleted file mode 100644 index 7749f6d81..000000000 --- a/dist/modules/datepicker/helpers/is-webview.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=is-webview.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/helpers/is-webview.js.map b/dist/modules/datepicker/helpers/is-webview.js.map deleted file mode 100644 index 57ed4f9d3..000000000 --- a/dist/modules/datepicker/helpers/is-webview.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-webview.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/helpers/is-webview.ts"],"names":[],"mappings":"","sourcesContent":["declare module \"is-ua-webview\";\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/index.d.ts b/dist/modules/datepicker/index.d.ts deleted file mode 100644 index b57534aaa..000000000 --- a/dist/modules/datepicker/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export * from "./classes/calendar-config"; -export * from "./classes/calendar-mappings"; -export * from "./classes/date-comparer"; -export * from "./classes/date-parser"; -export * from "./components/calendar-view-title"; -export * from "./components/datepicker"; -export * from "./directives/calendar-item"; -export * from "./directives/datepicker.directive"; -export * from "./directives/input.directive"; -export * from "./helpers/date-fns"; -export * from "./services/calendar-range.service"; -export * from "./services/calendar.service"; -export * from "./views/calendar-view"; -export * from "./views/date-view"; -export * from "./views/hour-view"; -export * from "./views/minute-view"; -export * from "./views/month-view"; -export * from "./views/year-view"; -export * from "./datepicker.module"; diff --git a/dist/modules/datepicker/index.js b/dist/modules/datepicker/index.js deleted file mode 100644 index 1a6d3068f..000000000 --- a/dist/modules/datepicker/index.js +++ /dev/null @@ -1,20 +0,0 @@ -export * from "./classes/calendar-config"; -export * from "./classes/calendar-mappings"; -export * from "./classes/date-comparer"; -export * from "./classes/date-parser"; -export * from "./components/calendar-view-title"; -export * from "./components/datepicker"; -export * from "./directives/calendar-item"; -export * from "./directives/datepicker.directive"; -export * from "./directives/input.directive"; -export * from "./helpers/date-fns"; -export * from "./services/calendar-range.service"; -export * from "./services/calendar.service"; -export * from "./views/calendar-view"; -export * from "./views/date-view"; -export * from "./views/hour-view"; -export * from "./views/minute-view"; -export * from "./views/month-view"; -export * from "./views/year-view"; -export * from "./datepicker.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/index.js.map b/dist/modules/datepicker/index.js.map deleted file mode 100644 index f046575f8..000000000 --- a/dist/modules/datepicker/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/datepicker/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC;AAExC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAE5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAElC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./classes/calendar-config\";\nexport * from \"./classes/calendar-mappings\";\nexport * from \"./classes/date-comparer\";\nexport * from \"./classes/date-parser\";\n\nexport * from \"./components/calendar-view-title\";\nexport * from \"./components/datepicker\";\n\nexport * from \"./directives/calendar-item\";\nexport * from \"./directives/datepicker.directive\";\nexport * from \"./directives/input.directive\";\n\nexport * from \"./helpers/date-fns\";\n\nexport * from \"./services/calendar-range.service\";\nexport * from \"./services/calendar.service\";\n\nexport * from \"./views/calendar-view\";\nexport * from \"./views/date-view\";\nexport * from \"./views/hour-view\";\nexport * from \"./views/minute-view\";\nexport * from \"./views/month-view\";\nexport * from \"./views/year-view\";\n\nexport * from \"./datepicker.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/index.metadata.json b/dist/modules/datepicker/index.metadata.json deleted file mode 100644 index 52d43d44e..000000000 --- a/dist/modules/datepicker/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/calendar-config"},{"from":"./classes/calendar-mappings"},{"from":"./classes/date-comparer"},{"from":"./classes/date-parser"},{"from":"./components/calendar-view-title"},{"from":"./components/datepicker"},{"from":"./directives/calendar-item"},{"from":"./directives/datepicker.directive"},{"from":"./directives/input.directive"},{"from":"./helpers/date-fns"},{"from":"./services/calendar-range.service"},{"from":"./services/calendar.service"},{"from":"./views/calendar-view"},{"from":"./views/date-view"},{"from":"./views/hour-view"},{"from":"./views/minute-view"},{"from":"./views/month-view"},{"from":"./views/year-view"},{"from":"./datepicker.module"}]}] \ No newline at end of file diff --git a/dist/modules/datepicker/public.d.ts b/dist/modules/datepicker/public.d.ts deleted file mode 100644 index c66907cfb..000000000 --- a/dist/modules/datepicker/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiDatepickerModule, DatepickerMode } from "./index"; diff --git a/dist/modules/datepicker/public.js b/dist/modules/datepicker/public.js deleted file mode 100644 index 966a59c9f..000000000 --- a/dist/modules/datepicker/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiDatepickerModule, DatepickerMode } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/public.js.map b/dist/modules/datepicker/public.js.map deleted file mode 100644 index 96833ac1a..000000000 --- a/dist/modules/datepicker/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/datepicker/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,cAAc,EACjB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiDatepickerModule,\n DatepickerMode\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/public.metadata.json b/dist/modules/datepicker/public.metadata.json deleted file mode 100644 index 782a6dd0c..000000000 --- a/dist/modules/datepicker/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiDatepickerModule","DatepickerMode"]}]}] \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar-range.service.d.ts b/dist/modules/datepicker/services/calendar-range.service.d.ts deleted file mode 100644 index 9cd84b292..000000000 --- a/dist/modules/datepicker/services/calendar-range.service.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { DatePrecision } from "../../../misc/util/index"; -import { CalendarItem } from "../directives/calendar-item"; -import { CalendarService } from "./calendar.service"; -import { DateComparer } from "../classes/date-comparer"; -export declare class CalendarRange { - start: Date; - dates: Date[]; - items: CalendarItem[]; - readonly inRange: CalendarItem[]; - groupedItems: CalendarItem[][]; - private _comparer; - constructor(start: Date, dates: Date[], items: CalendarItem[], grouped: CalendarItem[][], comparer: DateComparer); - find(item: CalendarItem): CalendarItem | undefined; - findIndex(item: CalendarItem | undefined): number; - containsDate(date: Date): boolean; -} -export declare abstract class CalendarRangeService { - previous: CalendarRange; - current: CalendarRange; - next: CalendarRange; - service: CalendarService; - interval: DatePrecision; - marginal: DatePrecision; - rows: number; - columns: number; - readonly dateComparer: DateComparer; - readonly length: number; - readonly canMoveNext: boolean; - readonly canMovePrevious: boolean; - constructor(interval: DatePrecision, rows: number, columns: number); - loadService(service: CalendarService): void; - refresh(): void; - move(forwards: boolean): void; - moveNext(): void; - movePrevious(): void; - calc(forwards: boolean): CalendarRange; - private calcRange(startDate); - protected calcStart(date: Date): Date; - protected calcDates(rangeStart: Date): Date[]; - protected calcItems(dateRange: Date[], baseDate: Date): CalendarItem[]; - protected abstract configureItem(item: CalendarItem, baseDate: Date): void; -} diff --git a/dist/modules/datepicker/services/calendar-range.service.js b/dist/modules/datepicker/services/calendar-range.service.js deleted file mode 100644 index 935bdbc88..000000000 --- a/dist/modules/datepicker/services/calendar-range.service.js +++ /dev/null @@ -1,146 +0,0 @@ -import { DateUtil, Util } from "../../../misc/util/index"; -import { CalendarItem } from "../directives/calendar-item"; -import { DateComparer } from "../classes/date-comparer"; -var CalendarRange = /** @class */ (function () { - function CalendarRange(start, dates, items, grouped, comparer) { - this.start = start; - this.dates = dates; - this.items = items; - this.groupedItems = grouped; - this._comparer = comparer; - } - Object.defineProperty(CalendarRange.prototype, "inRange", { - get: function () { - return this.items.filter(function (i) { return !i.isOutsideRange; }); - }, - enumerable: true, - configurable: true - }); - CalendarRange.prototype.find = function (item) { - var _this = this; - return this.items.find(function (i) { return _this._comparer.equal(i.date, item.date); }); - }; - CalendarRange.prototype.findIndex = function (item) { - var _this = this; - if (!item) { - return -1; - } - return this.items.findIndex(function (i) { return _this._comparer.equal(i.date, item.date); }); - }; - CalendarRange.prototype.containsDate = function (date) { - var _this = this; - return !!this.inRange.find(function (i) { return _this._comparer.equal(i.date, date); }); - }; - return CalendarRange; -}()); -export { CalendarRange }; -var CalendarRangeService = /** @class */ (function () { - function CalendarRangeService(interval, rows, columns) { - this.interval = interval; - this.marginal = interval + 1; - this.rows = rows; - this.columns = columns; - } - Object.defineProperty(CalendarRangeService.prototype, "dateComparer", { - get: function () { - return new DateComparer(this.marginal, this.service.inFinalView); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarRangeService.prototype, "length", { - get: function () { - return this.rows * this.columns; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarRangeService.prototype, "canMoveNext", { - get: function () { - var firstItem = this.next.inRange[0]; - if (firstItem && this.service.maxDate) { - return firstItem.date <= this.service.maxDate; - } - return true; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarRangeService.prototype, "canMovePrevious", { - get: function () { - var lastItem = this.previous.inRange.slice(-1).pop(); - if (lastItem && this.service.minDate) { - return lastItem.date >= this.service.minDate; - } - return true; - }, - enumerable: true, - configurable: true - }); - CalendarRangeService.prototype.loadService = function (service) { - this.service = service; - this.refresh(); - }; - CalendarRangeService.prototype.refresh = function () { - this.current = this.calcRange(this.service.currentDate); - this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate))); - this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate))); - }; - CalendarRangeService.prototype.move = function (forwards) { - if (forwards) { - return this.moveNext(); - } - return this.movePrevious(); - }; - CalendarRangeService.prototype.moveNext = function () { - DateUtil.next(this.interval, this.service.currentDate); - this.previous = this.current; - this.current = this.next; - this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate))); - }; - CalendarRangeService.prototype.movePrevious = function () { - DateUtil.previous(this.interval, this.service.currentDate); - this.next = this.current; - this.current = this.previous; - this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate))); - }; - CalendarRangeService.prototype.calc = function (forwards) { - if (forwards) { - return this.next; - } - return this.previous; - }; - CalendarRangeService.prototype.calcRange = function (startDate) { - var start = this.calcStart(startDate); - if (this.service.inFinalView) { - DateUtil.startOf(this.marginal, start, true); - } - var dates = this.calcDates(start); - var items = this.calcItems(dates, startDate); - return new CalendarRange(start, dates, items, Util.Array.group(items, this.columns), this.dateComparer); - }; - CalendarRangeService.prototype.calcStart = function (date) { - return DateUtil.startOf(this.interval, DateUtil.clone(date)); - }; - CalendarRangeService.prototype.calcDates = function (rangeStart) { - var _this = this; - return Util.Array - .range(this.length) - .map(function (i) { return DateUtil.add(_this.marginal, DateUtil.clone(rangeStart), i); }); - }; - CalendarRangeService.prototype.calcItems = function (dateRange, baseDate) { - var _this = this; - return dateRange.map(function (date) { - var item = new CalendarItem(date); - item.isDisabled = !_this.dateComparer.between(item.date, _this.service.minDate, _this.service.maxDate); - item.isActive = _this.dateComparer.equal(item.date, _this.service.selectedDate); - item.isToday = _this.dateComparer.equal(item.date, new Date()); - item.isSelectable = item.isDisabled; - _this.configureItem(item, baseDate); - return item; - }); - }; - return CalendarRangeService; -}()); -export { CalendarRangeService }; -//# sourceMappingURL=calendar-range.service.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar-range.service.js.map b/dist/modules/datepicker/services/calendar-range.service.js.map deleted file mode 100644 index aaf3bf2dc..000000000 --- a/dist/modules/datepicker/services/calendar-range.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calendar-range.service.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/services/calendar-range.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,IAAA;IAUI,uBAAY,KAAU,EAAE,KAAY,EAAE,KAAoB,EAAE,OAAwB,EAAE,QAAqB;QACvG,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;KAC7B;IAZD,sBAAW,kCAAO;aAAlB;YACI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,cAAc,EAAjB,CAAiB,CAAC,CAAC;SACpD;;;OAAA;IAYM,4BAAI,GAAX,UAAY,IAAiB;QAA7B,iBAEC;QADG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAA,CAAC,IA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AAI,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;YAEpC,IAAI,CAAC,UAAU,GAAG,CAAC,KAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAI,CAAC,OAAO,CAAC,OAAO,EAAE,KAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpG,IAAI,CAAC,QAAQ,GAAG,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAC9E,IAAI,CAAC,OAAO,GAAG,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC9D,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC;YAEpC,KAAI,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAEnC,MAAM,CAAC,IAAI,CAAC;SACf,CAAC,CAAC;KACN;+BA9JL;IAiKC,CAAA;AA1HD,gCA0HC","sourcesContent":["import { DatePrecision, DateUtil, Util } from \"../../../misc/util/index\";\nimport { CalendarItem } from \"../directives/calendar-item\";\nimport { CalendarService } from \"./calendar.service\";\nimport { DateComparer } from \"../classes/date-comparer\";\n\nexport class CalendarRange {\n public start:Date;\n public dates:Date[];\n public items:CalendarItem[];\n public get inRange():CalendarItem[] {\n return this.items.filter(i => !i.isOutsideRange);\n }\n public groupedItems:CalendarItem[][];\n private _comparer:DateComparer;\n\n constructor(start:Date, dates:Date[], items:CalendarItem[], grouped:CalendarItem[][], comparer:DateComparer) {\n this.start = start;\n this.dates = dates;\n this.items = items;\n this.groupedItems = grouped;\n this._comparer = comparer;\n }\n\n public find(item:CalendarItem):CalendarItem | undefined {\n return this.items.find(i => this._comparer.equal(i.date, item.date));\n }\n\n public findIndex(item:CalendarItem | undefined):number {\n if (!item) {\n return -1;\n }\n return this.items.findIndex(i => this._comparer.equal(i.date, item.date));\n }\n\n public containsDate(date:Date):boolean {\n return !!this.inRange.find(i => this._comparer.equal(i.date, date));\n }\n}\n\nexport abstract class CalendarRangeService {\n public previous:CalendarRange;\n public current:CalendarRange;\n public next:CalendarRange;\n\n public service:CalendarService;\n\n public interval:DatePrecision;\n public marginal:DatePrecision;\n public rows:number;\n public columns:number;\n\n public get dateComparer():DateComparer {\n return new DateComparer(this.marginal, this.service.inFinalView);\n }\n\n public get length():number {\n return this.rows * this.columns;\n }\n\n public get canMoveNext():boolean {\n const firstItem = this.next.inRange[0];\n if (firstItem && this.service.maxDate) {\n return firstItem.date <= this.service.maxDate;\n }\n return true;\n }\n\n public get canMovePrevious():boolean {\n const lastItem = this.previous.inRange.slice(-1).pop();\n if (lastItem && this.service.minDate) {\n return lastItem.date >= this.service.minDate;\n }\n return true;\n }\n\n constructor(interval:DatePrecision, rows:number, columns:number) {\n this.interval = interval;\n this.marginal = interval as number + 1;\n this.rows = rows;\n this.columns = columns;\n }\n\n public loadService(service:CalendarService):void {\n this.service = service;\n\n this.refresh();\n }\n\n public refresh():void {\n this.current = this.calcRange(this.service.currentDate);\n\n this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate)));\n this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate)));\n }\n\n public move(forwards:boolean):void {\n if (forwards) {\n return this.moveNext();\n }\n return this.movePrevious();\n }\n\n public moveNext():void {\n DateUtil.next(this.interval, this.service.currentDate);\n this.previous = this.current;\n this.current = this.next;\n this.next = this.calcRange(DateUtil.next(this.interval, DateUtil.clone(this.service.currentDate)));\n }\n\n public movePrevious():void {\n DateUtil.previous(this.interval, this.service.currentDate);\n this.next = this.current;\n this.current = this.previous;\n this.previous = this.calcRange(DateUtil.previous(this.interval, DateUtil.clone(this.service.currentDate)));\n }\n\n public calc(forwards:boolean):CalendarRange {\n if (forwards) {\n return this.next;\n }\n return this.previous;\n }\n\n private calcRange(startDate:Date):CalendarRange {\n const start = this.calcStart(startDate);\n if (this.service.inFinalView) {\n DateUtil.startOf(this.marginal, start, true);\n }\n const dates = this.calcDates(start);\n const items = this.calcItems(dates, startDate);\n\n return new CalendarRange(start, dates, items, Util.Array.group(items, this.columns), this.dateComparer);\n }\n\n protected calcStart(date:Date):Date {\n return DateUtil.startOf(this.interval, DateUtil.clone(date));\n }\n\n protected calcDates(rangeStart:Date):Date[] {\n return Util.Array\n .range(this.length)\n .map(i => DateUtil.add(this.marginal, DateUtil.clone(rangeStart), i));\n\n }\n\n protected calcItems(dateRange:Date[], baseDate:Date):CalendarItem[] {\n return dateRange.map(date => {\n const item = new CalendarItem(date);\n\n item.isDisabled = !this.dateComparer.between(item.date, this.service.minDate, this.service.maxDate);\n item.isActive = this.dateComparer.equal(item.date, this.service.selectedDate);\n item.isToday = this.dateComparer.equal(item.date, new Date());\n item.isSelectable = item.isDisabled;\n\n this.configureItem(item, baseDate);\n\n return item;\n });\n }\n\n protected abstract configureItem(item:CalendarItem, baseDate:Date):void;\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar-range.service.metadata.json b/dist/modules/datepicker/services/calendar-range.service.metadata.json deleted file mode 100644 index 9bfd30398..000000000 --- a/dist/modules/datepicker/services/calendar-range.service.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"CalendarRange":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Date"},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","name":"Date"}]},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"../directives/calendar-item","name":"CalendarItem","line":15,"character":48}]},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"../directives/calendar-item","name":"CalendarItem","line":15,"character":48}]}]},{"__symbolic":"reference","module":"../classes/date-comparer","name":"DateComparer","line":15,"character":99}]}],"find":[{"__symbolic":"method"}],"findIndex":[{"__symbolic":"method"}],"containsDate":[{"__symbolic":"method"}]}},"CalendarRangeService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../misc/util/index","name":"DatePrecision","line":75,"character":25},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"}]}],"loadService":[{"__symbolic":"method"}],"refresh":[{"__symbolic":"method"}],"move":[{"__symbolic":"method"}],"moveNext":[{"__symbolic":"method"}],"movePrevious":[{"__symbolic":"method"}],"calc":[{"__symbolic":"method"}],"calcRange":[{"__symbolic":"method"}],"calcStart":[{"__symbolic":"method"}],"calcDates":[{"__symbolic":"method"}],"calcItems":[{"__symbolic":"method"}],"configureItem":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar.service.d.ts b/dist/modules/datepicker/services/calendar.service.d.ts deleted file mode 100644 index b906217fd..000000000 --- a/dist/modules/datepicker/services/calendar.service.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { EventEmitter } from "@angular/core"; -import { IDatepickerLocaleValues } from "../../../behaviors/localization/index"; -import { CalendarViewType } from "../views/calendar-view"; -import { CalendarConfig } from "../classes/calendar-config"; -export declare enum CalendarMode { - DateOnly = 0, - TimeOnly = 1, - Both = 2, -} -export declare class CalendarService { - localeValues: IDatepickerLocaleValues; - private _config; - config: CalendarConfig; - currentView: CalendarViewType; - readonly inFinalView: boolean; - currentDate: Date; - private _selectedDate?; - selectedDate: Date | undefined; - private _minDate?; - private _maxDate?; - minDate: Date | undefined; - maxDate: Date | undefined; - private _firstDayOfWeek; - firstDayOfWeek: number; - onDateChange: EventEmitter; - constructor(config: CalendarConfig, localeValues: IDatepickerLocaleValues); - onManualUpdate: () => void; - reset(): void; - changeDate(date: Date, fromView: CalendarViewType): void; - zoomOut(fromView: CalendarViewType): void; - private updateView(mappings, fromView); -} diff --git a/dist/modules/datepicker/services/calendar.service.js b/dist/modules/datepicker/services/calendar.service.js deleted file mode 100644 index 9c4060358..000000000 --- a/dist/modules/datepicker/services/calendar.service.js +++ /dev/null @@ -1,129 +0,0 @@ -import { EventEmitter } from "@angular/core"; -import { DateUtil } from "../../../misc/util/index"; -export var CalendarMode; -(function (CalendarMode) { - CalendarMode[CalendarMode["DateOnly"] = 0] = "DateOnly"; - CalendarMode[CalendarMode["TimeOnly"] = 1] = "TimeOnly"; - CalendarMode[CalendarMode["Both"] = 2] = "Both"; -})(CalendarMode || (CalendarMode = {})); -var CalendarService = /** @class */ (function () { - function CalendarService(config, localeValues) { - this.localeValues = localeValues; - this.onManualUpdate = function () { }; - this.config = config; - this.currentDate = new Date(); - this.firstDayOfWeek = this.localeValues.firstDayOfWeek; - this.onDateChange = new EventEmitter(); - this.reset(); - } - Object.defineProperty(CalendarService.prototype, "config", { - get: function () { - return this._config; - }, - set: function (config) { - this._config = config; - config.updateBounds(this._selectedDate || this.currentDate); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarService.prototype, "inFinalView", { - get: function () { - return this.currentView === this.config.mappings.finalView; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarService.prototype, "selectedDate", { - get: function () { - return this._selectedDate; - }, - set: function (date) { - if (date) { - this._selectedDate = DateUtil.clone(date); - this.currentDate = DateUtil.clone(date); - } - else { - this._selectedDate = undefined; - } - this.config.updateBounds(this._selectedDate || this.currentDate); - this.onManualUpdate(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarService.prototype, "minDate", { - get: function () { - if (this._minDate && this.config.dateMinBound) { - return this._minDate > this.config.dateMinBound ? this._minDate : this.config.dateMinBound; - } - return this._minDate || this.config.dateMinBound; - }, - set: function (min) { - this._minDate = min; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarService.prototype, "maxDate", { - get: function () { - if (this._maxDate && this.config.dateMaxBound) { - return this._maxDate < this.config.dateMaxBound ? this._maxDate : this.config.dateMaxBound; - } - return this._maxDate || this.config.dateMaxBound; - }, - set: function (max) { - this._maxDate = max; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarService.prototype, "firstDayOfWeek", { - get: function () { - return this._firstDayOfWeek; - }, - set: function (firstDayOfWeek) { - if (firstDayOfWeek != undefined) { - this._firstDayOfWeek = Math.max(0, Math.min(6, firstDayOfWeek)); - } - }, - enumerable: true, - configurable: true - }); - CalendarService.prototype.reset = function () { - this.currentView = this.config.mappings.finalView; - if (!this._selectedDate) { - var current = this.currentDate.getTime(); - if (this._minDate) { - current = Math.max(current, this._minDate.getTime()); - } - if (this._maxDate) { - current = Math.min(current, this._maxDate.getTime()); - } - this.currentDate = new Date(current); - this.config.updateBounds(this.currentDate); - this.currentView = this.config.mappings.initialView; - } - }; - CalendarService.prototype.changeDate = function (date, fromView) { - this.currentDate = date; - if (fromView === this.config.mappings.finalView) { - this.selectedDate = date; - return this.onDateChange.emit(date); - } - this.updateView(this.config.mappings.changed, fromView); - }; - CalendarService.prototype.zoomOut = function (fromView) { - this.updateView(this.config.mappings.zoom, fromView); - }; - CalendarService.prototype.updateView = function (mappings, fromView) { - var mapping = mappings.get(fromView); - if (mapping == undefined) { - throw new Error("Unknown view type."); - } - this.currentView = mapping; - }; - return CalendarService; -}()); -export { CalendarService }; -//# sourceMappingURL=calendar.service.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar.service.js.map b/dist/modules/datepicker/services/calendar.service.js.map deleted file mode 100644 index 294a94f09..000000000 --- a/dist/modules/datepicker/services/calendar.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calendar.service.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/services/calendar.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIpD,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,uDAAY,CAAA;IACZ,uDAA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CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KAC3D;IAEM,iCAAO,GAAd,UAAe,QAAyB;QACpC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACxD;IAEO,oCAAU,GAAlB,UAAmB,QAAgD,EAAE,QAAyB;QAC1F,IAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvC,EAAE,CAAC,CAAC,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;SACzC;QACD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;KAC9B;0BA9IL;IA+IC,CAAA;AAnID,2BAmIC","sourcesContent":["import { EventEmitter } from \"@angular/core\";\nimport { IDatepickerLocaleValues } from \"../../../behaviors/localization/index\";\nimport { DateUtil } from \"../../../misc/util/index\";\nimport { CalendarViewType } from \"../views/calendar-view\";\nimport { CalendarConfig } from \"../classes/calendar-config\";\n\nexport enum CalendarMode {\n DateOnly = 0,\n TimeOnly = 1,\n Both = 2\n}\n\nexport class CalendarService {\n private _config:CalendarConfig;\n\n public get config():CalendarConfig {\n return this._config;\n }\n\n public set config(config:CalendarConfig) {\n this._config = config;\n config.updateBounds(this._selectedDate || this.currentDate);\n }\n\n public currentView:CalendarViewType;\n public get inFinalView():boolean {\n return this.currentView === this.config.mappings.finalView;\n }\n\n public currentDate:Date;\n private _selectedDate?:Date;\n\n public get selectedDate():Date | undefined {\n return this._selectedDate;\n }\n\n public set selectedDate(date:Date | undefined) {\n if (date) {\n this._selectedDate = DateUtil.clone(date);\n this.currentDate = DateUtil.clone(date);\n } else {\n this._selectedDate = undefined;\n }\n\n this.config.updateBounds(this._selectedDate || this.currentDate);\n this.onManualUpdate();\n }\n\n private _minDate?:Date;\n private _maxDate?:Date;\n\n public get minDate():Date | undefined {\n if (this._minDate && this.config.dateMinBound) {\n return this._minDate > this.config.dateMinBound ? this._minDate : this.config.dateMinBound;\n }\n return this._minDate || this.config.dateMinBound;\n }\n\n public set minDate(min:Date | undefined) {\n this._minDate = min;\n }\n\n public get maxDate():Date | undefined {\n if (this._maxDate && this.config.dateMaxBound) {\n return this._maxDate < this.config.dateMaxBound ? this._maxDate : this.config.dateMaxBound;\n }\n return this._maxDate || this.config.dateMaxBound;\n }\n\n public set maxDate(max:Date | undefined) {\n this._maxDate = max;\n }\n\n private _firstDayOfWeek:number;\n\n public get firstDayOfWeek():number {\n return this._firstDayOfWeek;\n }\n\n public set firstDayOfWeek(firstDayOfWeek:number) {\n if (firstDayOfWeek != undefined) {\n this._firstDayOfWeek = Math.max(0, Math.min(6, firstDayOfWeek));\n }\n }\n\n public onDateChange:EventEmitter;\n\n constructor(config:CalendarConfig, public localeValues:IDatepickerLocaleValues) {\n this.config = config;\n\n this.currentDate = new Date();\n\n this.firstDayOfWeek = this.localeValues.firstDayOfWeek;\n\n this.onDateChange = new EventEmitter();\n\n this.reset();\n }\n\n public onManualUpdate:() => void = () => {};\n\n public reset():void {\n this.currentView = this.config.mappings.finalView;\n\n if (!this._selectedDate) {\n let current = this.currentDate.getTime();\n if (this._minDate) {\n current = Math.max(current, this._minDate.getTime());\n }\n if (this._maxDate) {\n current = Math.min(current, this._maxDate.getTime());\n }\n\n this.currentDate = new Date(current);\n this.config.updateBounds(this.currentDate);\n\n this.currentView = this.config.mappings.initialView;\n }\n }\n\n public changeDate(date:Date, fromView:CalendarViewType):void {\n this.currentDate = date;\n\n if (fromView === this.config.mappings.finalView) {\n this.selectedDate = date;\n\n return this.onDateChange.emit(date);\n }\n\n this.updateView(this.config.mappings.changed, fromView);\n }\n\n public zoomOut(fromView:CalendarViewType):void {\n this.updateView(this.config.mappings.zoom, fromView);\n }\n\n private updateView(mappings:Map, fromView:CalendarViewType):void {\n const mapping = mappings.get(fromView);\n if (mapping == undefined) {\n throw new Error(\"Unknown view type.\");\n }\n this.currentView = mapping;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/services/calendar.service.metadata.json b/dist/modules/datepicker/services/calendar.service.metadata.json deleted file mode 100644 index df55e6c8b..000000000 --- a/dist/modules/datepicker/services/calendar.service.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"CalendarMode":{"DateOnly":0,"TimeOnly":1,"Both":2},"CalendarService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../classes/calendar-config","name":"CalendarConfig","line":87,"character":23},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"IDatepickerLocaleValues","line":87,"character":59}]}],"reset":[{"__symbolic":"method"}],"changeDate":[{"__symbolic":"method"}],"zoomOut":[{"__symbolic":"method"}],"updateView":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/calendar-view.d.ts b/dist/modules/datepicker/views/calendar-view.d.ts deleted file mode 100644 index 0b5bbe7fb..000000000 --- a/dist/modules/datepicker/views/calendar-view.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { AfterViewInit, Renderer2, OnDestroy } from "@angular/core"; -import { CalendarItem } from "../directives/calendar-item"; -import { CalendarService } from "../services/calendar.service"; -import { CalendarRangeService } from "../services/calendar-range.service"; -export declare enum CalendarViewType { - Year = 0, - Month = 1, - Date = 2, - Hour = 3, - Minute = 4, -} -export declare type CalendarViewResult = [Date, CalendarViewType]; -export declare abstract class CalendarView implements AfterViewInit, OnDestroy { - private _type; - private _service; - private _renderedItems; - private _highlightedItem?; - service: CalendarService; - ranges: CalendarRangeService; - readonly currentDate: Date; - readonly selectedDate: Date | undefined; - private _documentKeyDownListener; - constructor(renderer: Renderer2, viewType: CalendarViewType, ranges: CalendarRangeService); - setDate(item: CalendarItem): void; - zoomOut(): void; - ngAfterViewInit(): void; - private onRenderedItemsChanged(); - private autoHighlight(); - private highlightItem(item); - private onDocumentKeyDown(e); - ngOnDestroy(): void; -} diff --git a/dist/modules/datepicker/views/calendar-view.js b/dist/modules/datepicker/views/calendar-view.js deleted file mode 100644 index d2f69e374..000000000 --- a/dist/modules/datepicker/views/calendar-view.js +++ /dev/null @@ -1,174 +0,0 @@ -import { Input, QueryList, ViewChildren } from "@angular/core"; -import { KeyCode } from "../../../misc/util/index"; -import { SuiCalendarItem } from "../directives/calendar-item"; -import { CalendarService } from "../services/calendar.service"; -export var CalendarViewType; -(function (CalendarViewType) { - CalendarViewType[CalendarViewType["Year"] = 0] = "Year"; - CalendarViewType[CalendarViewType["Month"] = 1] = "Month"; - CalendarViewType[CalendarViewType["Date"] = 2] = "Date"; - CalendarViewType[CalendarViewType["Hour"] = 3] = "Hour"; - CalendarViewType[CalendarViewType["Minute"] = 4] = "Minute"; -})(CalendarViewType || (CalendarViewType = {})); -var CalendarView = /** @class */ (function () { - function CalendarView(renderer, viewType, ranges) { - var _this = this; - this._type = viewType; - this.ranges = ranges; - this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); - } - Object.defineProperty(CalendarView.prototype, "service", { - get: function () { - return this._service; - }, - set: function (service) { - var _this = this; - this._service = service; - this.ranges.loadService(service); - this.service.onManualUpdate = function () { - _this.ranges.refresh(); - delete _this._highlightedItem; - _this.autoHighlight(); - }; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarView.prototype, "currentDate", { - get: function () { - return this.service.currentDate; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CalendarView.prototype, "selectedDate", { - get: function () { - return this.service.selectedDate; - }, - enumerable: true, - configurable: true - }); - // Template Methods - // Template Methods - CalendarView.prototype.setDate = - // Template Methods - function (item) { - this.service.changeDate(item.date, this._type); - }; - CalendarView.prototype.zoomOut = function () { - this.service.zoomOut(this._type); - }; - // Keyboard Control - // Keyboard Control - CalendarView.prototype.ngAfterViewInit = - // Keyboard Control - function () { - var _this = this; - this._renderedItems.changes.subscribe(function () { return _this.onRenderedItemsChanged(); }); - this.onRenderedItemsChanged(); - }; - CalendarView.prototype.onRenderedItemsChanged = function () { - var _this = this; - this._renderedItems.forEach(function (i) { - return i.onFocussed.subscribe(function (hasFocus) { - if (hasFocus) { - _this.highlightItem(i.item); - } - }); - }); - this.autoHighlight(); - this.highlightItem(this._highlightedItem); - }; - CalendarView.prototype.autoHighlight = function () { - var _this = this; - var date = this.selectedDate && this.ranges.current.containsDate(this.selectedDate) ? this.selectedDate : this.currentDate; - if (this._highlightedItem && this.ranges.current.containsDate(this._highlightedItem.date)) { - date = this._highlightedItem.date; - } - var initiallyHighlighted = this.ranges.current.items.find(function (i) { return _this.ranges.dateComparer.equal(i.date, date); }); - if (initiallyHighlighted && !initiallyHighlighted.isDisabled) { - this._highlightedItem = initiallyHighlighted; - } - }; - CalendarView.prototype.highlightItem = function (item) { - if (item) { - this._renderedItems.forEach(function (i) { return i.hasFocus = false; }); - var rendered = this._renderedItems.find(function (ri) { return ri.item === item; }); - if (rendered && !rendered.hasFocus) { - rendered.hasFocus = true; - rendered.changeDetector.detectChanges(); - } - this._highlightedItem = item; - } - }; - CalendarView.prototype.onDocumentKeyDown = function (e) { - if (this._highlightedItem && e.keyCode === KeyCode.Enter) { - this.setDate(this._highlightedItem); - return; - } - if (!this._highlightedItem) { - this.autoHighlight(); - } - var index = this.ranges.current.findIndex(this._highlightedItem); - var isMovingForward = true; - var delta = 0; - switch (e.keyCode) { - case KeyCode.Right: - delta += 1; - break; - case KeyCode.Left: - delta -= 1; - isMovingForward = false; - break; - case KeyCode.Down: - delta += this.ranges.columns; - break; - case KeyCode.Up: - delta -= this.ranges.columns; - isMovingForward = false; - break; - default: - return; - } - // Stop these keypresses being captured elsewhere. - e.preventDefault(); - var nextItem = this.ranges.current.items[index + delta]; - if (nextItem && nextItem.isDisabled) { - return; - } - if (nextItem && !nextItem.isOutsideRange) { - return this.highlightItem(nextItem); - } - if (nextItem && nextItem.isOutsideRange) { - if (index + delta >= this.ranges.current.inRange.length) { - isMovingForward = true; - } - } - if (!nextItem) { - var adjustedIndex = this.ranges.current.findIndex(this._highlightedItem); - var nextItems = this.ranges.calc(isMovingForward).inRange; - if (isMovingForward) { - adjustedIndex -= this.ranges.current.inRange.length; - } - else { - adjustedIndex += nextItems.length; - } - nextItem = nextItems[adjustedIndex + delta]; - if (nextItem.isDisabled) { - return; - } - } - this.ranges.move(isMovingForward); - this._highlightedItem = this.ranges.current.find(nextItem); - }; - CalendarView.prototype.ngOnDestroy = function () { - this._documentKeyDownListener(); - }; - CalendarView.propDecorators = { - "_renderedItems": [{ type: ViewChildren, args: [SuiCalendarItem,] },], - "service": [{ type: Input },], - }; - return CalendarView; -}()); -export { CalendarView }; -//# sourceMappingURL=calendar-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/calendar-view.js.map b/dist/modules/datepicker/views/calendar-view.js.map deleted file mode 100644 index f8c38d4d1..000000000 --- a/dist/modules/datepicker/views/calendar-view.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calendar-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/calendar-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAqD,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAgB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IACxB,uDAAQ,CAAA;IACR,yDAAS,CAAA;IACT,uDAAQ,CAAA;IACR,uDAAQ,CAAA;IACR,2DAAU,CAAA;GALF,gBAAgB,KAAhB,gBAAgB,QAM3B;;IAwCG,sBAAY,QAAkB,EAAE,QAAyB,EAAE,MAA2B;QAAtF,iBAKC;QAJG,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;QACtB,IAAI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,eAAe,CAAC,CAAC,OAAO,CAAC;YAE5D,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;gBAClB,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;aACvD;YAAC,IAAI,CAAC,CAAC;gBACJ,aAAa,IAAI,SAAS,CAAC,MAAM,CAAC;aACrC;YAED,QAAQ,GAAG,SAAS,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;YAE5C,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;gBACtB,MAAM,CAAC;aACV;SACJ;QAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAClC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KAC9D;IAEM,kCAAW,GAAlB;QACI,IAAI,CAAC,wBAAwB,EAAE,CAAC;KACnC;;mCA1KA,YAAY,SAAC,eAAe;4BAI5B,KAAK;;uBAvBV;;SAesB,YAAY","sourcesContent":["import { Input, QueryList, ViewChildren, AfterViewInit, HostListener, Renderer2, OnDestroy } from \"@angular/core\";\nimport { KeyCode } from \"../../../misc/util/index\";\nimport { CalendarItem, SuiCalendarItem } from \"../directives/calendar-item\";\nimport { CalendarService } from \"../services/calendar.service\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\n\nexport enum CalendarViewType {\n Year = 0,\n Month = 1,\n Date = 2,\n Hour = 3,\n Minute = 4\n}\nexport type CalendarViewResult = [Date, CalendarViewType];\n\nexport abstract class CalendarView implements AfterViewInit, OnDestroy {\n private _type:CalendarViewType;\n private _service:CalendarService;\n\n @ViewChildren(SuiCalendarItem)\n private _renderedItems:QueryList;\n private _highlightedItem?:CalendarItem;\n\n @Input()\n public set service(service:CalendarService) {\n this._service = service;\n this.ranges.loadService(service);\n\n this.service.onManualUpdate = () => {\n this.ranges.refresh();\n\n delete this._highlightedItem;\n this.autoHighlight();\n };\n }\n\n public get service():CalendarService {\n return this._service;\n }\n\n public ranges:CalendarRangeService;\n\n public get currentDate():Date {\n return this.service.currentDate;\n }\n\n public get selectedDate():Date | undefined {\n return this.service.selectedDate;\n }\n\n private _documentKeyDownListener:() => void;\n\n constructor(renderer:Renderer2, viewType:CalendarViewType, ranges:CalendarRangeService) {\n this._type = viewType;\n this.ranges = ranges;\n\n this._documentKeyDownListener = renderer.listen(\"document\", \"keydown\", (e:KeyboardEvent) => this.onDocumentKeyDown(e));\n }\n\n // Template Methods\n\n public setDate(item:CalendarItem):void {\n this.service.changeDate(item.date, this._type);\n }\n\n public zoomOut():void {\n this.service.zoomOut(this._type);\n }\n\n // Keyboard Control\n\n public ngAfterViewInit():void {\n this._renderedItems.changes.subscribe(() => this.onRenderedItemsChanged());\n this.onRenderedItemsChanged();\n }\n\n private onRenderedItemsChanged():void {\n this._renderedItems.forEach(i =>\n i.onFocussed.subscribe((hasFocus:boolean) => {\n if (hasFocus) {\n this.highlightItem(i.item);\n }\n }));\n\n this.autoHighlight();\n this.highlightItem(this._highlightedItem);\n }\n\n private autoHighlight():void {\n let date = this.selectedDate && this.ranges.current.containsDate(this.selectedDate) ? this.selectedDate : this.currentDate;\n if (this._highlightedItem && this.ranges.current.containsDate(this._highlightedItem.date)) {\n date = this._highlightedItem.date;\n }\n\n const initiallyHighlighted = this.ranges.current.items.find(i => this.ranges.dateComparer.equal(i.date, date));\n if (initiallyHighlighted && !initiallyHighlighted.isDisabled) {\n this._highlightedItem = initiallyHighlighted;\n }\n }\n\n private highlightItem(item:CalendarItem | undefined):void {\n if (item) {\n this._renderedItems.forEach(i => i.hasFocus = false);\n const rendered = this._renderedItems.find(ri => ri.item === item);\n if (rendered && !rendered.hasFocus) {\n rendered.hasFocus = true;\n rendered.changeDetector.detectChanges();\n }\n\n this._highlightedItem = item;\n }\n }\n\n private onDocumentKeyDown(e:KeyboardEvent):void {\n if (this._highlightedItem && e.keyCode === KeyCode.Enter) {\n this.setDate(this._highlightedItem);\n return;\n }\n\n if (!this._highlightedItem) {\n this.autoHighlight();\n }\n\n const index = this.ranges.current.findIndex(this._highlightedItem);\n let isMovingForward = true;\n let delta = 0;\n\n switch (e.keyCode) {\n case KeyCode.Right:\n delta += 1;\n break;\n case KeyCode.Left:\n delta -= 1;\n isMovingForward = false;\n break;\n case KeyCode.Down:\n delta += this.ranges.columns;\n break;\n case KeyCode.Up:\n delta -= this.ranges.columns;\n isMovingForward = false;\n break;\n default:\n return;\n }\n\n // Stop these keypresses being captured elsewhere.\n e.preventDefault();\n\n let nextItem = this.ranges.current.items[index + delta];\n\n if (nextItem && nextItem.isDisabled) {\n return;\n }\n\n if (nextItem && !nextItem.isOutsideRange) {\n return this.highlightItem(nextItem);\n }\n\n if (nextItem && nextItem.isOutsideRange) {\n if (index + delta >= this.ranges.current.inRange.length) {\n isMovingForward = true;\n }\n }\n\n if (!nextItem) {\n let adjustedIndex = this.ranges.current.findIndex(this._highlightedItem);\n\n const nextItems = this.ranges.calc(isMovingForward).inRange;\n\n if (isMovingForward) {\n adjustedIndex -= this.ranges.current.inRange.length;\n } else {\n adjustedIndex += nextItems.length;\n }\n\n nextItem = nextItems[adjustedIndex + delta];\n\n if (nextItem.isDisabled) {\n return;\n }\n }\n\n this.ranges.move(isMovingForward);\n this._highlightedItem = this.ranges.current.find(nextItem);\n }\n\n public ngOnDestroy():void {\n this._documentKeyDownListener();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/calendar-view.metadata.json b/dist/modules/datepicker/views/calendar-view.metadata.json deleted file mode 100644 index 423899f2d..000000000 --- a/dist/modules/datepicker/views/calendar-view.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"CalendarViewType":{"Year":0,"Month":1,"Date":2,"Hour":3,"Minute":4},"CalendarViewResult":{"__symbolic":"interface"},"CalendarView":{"__symbolic":"class","members":{"_renderedItems":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChildren","line":19,"character":5},"arguments":[{"__symbolic":"reference","module":"../directives/calendar-item","name":"SuiCalendarItem","line":19,"character":18}]}]}],"service":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":52,"character":25},{"__symbolic":"error","message":"Could not resolve type","line":52,"character":45,"context":{"typeName":"CalendarViewType"}},{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":52,"character":70}]}],"setDate":[{"__symbolic":"method"}],"zoomOut":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"onRenderedItemsChanged":[{"__symbolic":"method"}],"autoHighlight":[{"__symbolic":"method"}],"highlightItem":[{"__symbolic":"method"}],"onDocumentKeyDown":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/date-view.d.ts b/dist/modules/datepicker/views/date-view.d.ts deleted file mode 100644 index 78c261e58..000000000 --- a/dist/modules/datepicker/views/date-view.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Renderer2 } from "@angular/core"; -import { CalendarItem } from "../directives/calendar-item"; -import { CalendarView } from "./calendar-view"; -import { CalendarRangeService } from "../services/calendar-range.service"; -export declare class CalendarRangeDateService extends CalendarRangeService { - calcStart(start: Date): Date; - configureItem(item: CalendarItem, baseDate: Date): void; -} -export declare class SuiCalendarDateView extends CalendarView { - readonly days: string[]; - readonly date: string; - constructor(renderer: Renderer2); -} diff --git a/dist/modules/datepicker/views/date-view.js b/dist/modules/datepicker/views/date-view.js deleted file mode 100644 index 4afe31d6b..000000000 --- a/dist/modules/datepicker/views/date-view.js +++ /dev/null @@ -1,68 +0,0 @@ -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 __()); - }; -})(); -import { Component, Renderer2 } from "@angular/core"; -import { DateUtil, DatePrecision } from "../../../misc/util/index"; -import { CalendarView, CalendarViewType } from "./calendar-view"; -import { CalendarRangeService } from "../services/calendar-range.service"; -import { DateParser } from "../classes/date-parser"; -var CalendarRangeDateService = /** @class */ (function (_super) { - __extends(CalendarRangeDateService, _super); - function CalendarRangeDateService() { - return _super !== null && _super.apply(this, arguments) || this; - } - CalendarRangeDateService.prototype.calcStart = function (start) { - var monthStart = DateUtil.startOf(DatePrecision.Month, DateUtil.clone(start)); - monthStart.setDate((1 - monthStart.getDay() + this.service.firstDayOfWeek - 7) % 7); - return monthStart; - }; - CalendarRangeDateService.prototype.configureItem = function (item, baseDate) { - item.humanReadable = item.date.getDate().toString(); - item.isOutsideRange = item.date.getMonth() !== baseDate.getMonth(); - item.isSelectable = item.isDisabled; - }; - return CalendarRangeDateService; -}(CalendarRangeService)); -export { CalendarRangeDateService }; -var SuiCalendarDateView = /** @class */ (function (_super) { - __extends(SuiCalendarDateView, _super); - function SuiCalendarDateView(renderer) { - return _super.call(this, renderer, CalendarViewType.Date, new CalendarRangeDateService(DatePrecision.Month, 6, 7)) || this; - } - Object.defineProperty(SuiCalendarDateView.prototype, "days", { - get: function () { - var _this = this; - var days = this.service.localeValues.weekdaysNarrow; - return days.map(function (d, i) { return days[(i + _this.service.firstDayOfWeek) % days.length]; }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiCalendarDateView.prototype, "date", { - get: function () { - return new DateParser(this.service.localeValues.formats.month, this.service.localeValues).format(this.currentDate); - }, - enumerable: true, - configurable: true - }); - SuiCalendarDateView.decorators = [ - { type: Component, args: [{ - selector: "sui-calendar-date-view", - template: "\n\n\n \n \n \n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ day }}
{{ item.humanReadable }}\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiCalendarDateView.ctorParameters = function () { return [ - { type: Renderer2, }, - ]; }; - return SuiCalendarDateView; -}(CalendarView)); -export { SuiCalendarDateView }; -//# sourceMappingURL=date-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/date-view.js.map b/dist/modules/datepicker/views/date-view.js.map deleted file mode 100644 index e9eeac9de..000000000 --- a/dist/modules/datepicker/views/date-view.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"date-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/date-view.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,IAAA;IAA8C,4CAAoB;;;;IACvD,4CAAS,GAAhB,UAAiB,KAAU;QACvB,IAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAChF,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACpF,MAAM,CAAC,UAAU,CAAC;KACrB;IAEM,gDAAa,GAApB,UAAqB,IAAiB,EAAE,QAAa;QACjD,IAAI,CAAC,aAA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endarItem } from \"../directives/calendar-item\";\nimport { CalendarView, CalendarViewType } from \"./calendar-view\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\nimport { DateParser } from \"../classes/date-parser\";\n\nexport class CalendarRangeDateService extends CalendarRangeService {\n public calcStart(start:Date):Date {\n const monthStart = DateUtil.startOf(DatePrecision.Month, DateUtil.clone(start));\n monthStart.setDate((1 - monthStart.getDay() + this.service.firstDayOfWeek - 7) % 7);\n return monthStart;\n }\n\n public configureItem(item:CalendarItem, baseDate:Date):void {\n item.humanReadable = item.date.getDate().toString();\n item.isOutsideRange = item.date.getMonth() !== baseDate.getMonth();\n item.isSelectable = item.isDisabled;\n }\n}\n\n@Component({\n selector: \"sui-calendar-date-view\",\n template: `\n\n\n \n \n \n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ day }}
{{ item.humanReadable }}\n
\n`\n})\nexport class SuiCalendarDateView extends CalendarView {\n public get days():string[] {\n const days = this.service.localeValues.weekdaysNarrow;\n return days.map((d, i) => days[(i + this.service.firstDayOfWeek) % days.length]);\n }\n\n public get date():string {\n return new DateParser(this.service.localeValues.formats.month, this.service.localeValues).format(this.currentDate);\n }\n\n constructor(renderer:Renderer2) {\n super(renderer, CalendarViewType.Date, new CalendarRangeDateService(DatePrecision.Month, 6, 7));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/date-view.metadata.json b/dist/modules/datepicker/views/date-view.metadata.json deleted file mode 100644 index d6224dbdd..000000000 --- a/dist/modules/datepicker/views/date-view.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"CalendarRangeDateService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":7,"character":46},"members":{"calcStart":[{"__symbolic":"method"}],"configureItem":[{"__symbolic":"method"}]}},"SuiCalendarDateView":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./calendar-view","name":"CalendarView","line":49,"character":41},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":21,"character":1},"arguments":[{"selector":"sui-calendar-date-view","template":"\n\n\n \n \n \n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ day }}
{{ item.humanReadable }}\n
\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":59,"character":25}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/hour-view.d.ts b/dist/modules/datepicker/views/hour-view.d.ts deleted file mode 100644 index 87a69b302..000000000 --- a/dist/modules/datepicker/views/hour-view.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Renderer2 } from "@angular/core"; -import { CalendarView } from "./calendar-view"; -import { CalendarItem } from "../directives/calendar-item"; -import { CalendarRangeService } from "../services/calendar-range.service"; -export declare class CalendarRangeHourService extends CalendarRangeService { - configureItem(item: CalendarItem, baseDate: Date): void; -} -export declare class SuiCalendarHourView extends CalendarView { - readonly date: string; - constructor(renderer: Renderer2); -} diff --git a/dist/modules/datepicker/views/hour-view.js b/dist/modules/datepicker/views/hour-view.js deleted file mode 100644 index 7b78ca3f2..000000000 --- a/dist/modules/datepicker/views/hour-view.js +++ /dev/null @@ -1,55 +0,0 @@ -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 __()); - }; -})(); -import { Component, Renderer2 } from "@angular/core"; -import { DatePrecision } from "../../../misc/util/index"; -import { CalendarView, CalendarViewType } from "./calendar-view"; -import { CalendarRangeService } from "../services/calendar-range.service"; -import { DateParser } from "../classes/date-parser"; -var CalendarRangeHourService = /** @class */ (function (_super) { - __extends(CalendarRangeHourService, _super); - function CalendarRangeHourService() { - return _super !== null && _super.apply(this, arguments) || this; - } - CalendarRangeHourService.prototype.configureItem = function (item, baseDate) { - // Set minutes and seconds to 0 - var customFormat = this.service.localeValues.formats.time.replace(/[ms]/g, "0"); - item.humanReadable = new DateParser(customFormat, this.service.localeValues).format(item.date); - item.isOutsideRange = false; - }; - return CalendarRangeHourService; -}(CalendarRangeService)); -export { CalendarRangeHourService }; -var SuiCalendarHourView = /** @class */ (function (_super) { - __extends(SuiCalendarHourView, _super); - function SuiCalendarHourView(renderer) { - return _super.call(this, renderer, CalendarViewType.Hour, new CalendarRangeHourService(DatePrecision.Date, 6, 4)) || this; - } - Object.defineProperty(SuiCalendarHourView.prototype, "date", { - get: function () { - return new DateParser(this.service.localeValues.formats.date, this.service.localeValues).format(this.currentDate); - }, - enumerable: true, - configurable: true - }); - SuiCalendarHourView.decorators = [ - { type: Component, args: [{ - selector: "sui-calendar-hour-view", - template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiCalendarHourView.ctorParameters = function () { return [ - { type: Renderer2, }, - ]; }; - return SuiCalendarHourView; -}(CalendarView)); -export { SuiCalendarHourView }; -//# sourceMappingURL=hour-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/hour-view.js.map b/dist/modules/datepicker/views/hour-view.js.map deleted file mode 100644 index bb55b9f71..000000000 --- a/dist/modules/datepicker/views/hour-view.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hour-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/hour-view.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,IAAA;IAA8C,4CAAoB;;;;IACvD,gDAAa,GAApB,UAAqB,IAAiB,EAAE,QAAa;;QAEjD,IAAM,YAAY,GAAU,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACzF,IAAI,CAAC,aAAa,GAAG,IAAI,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/F,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;KAC/B;mCAbL;EAO8C,oBAAoB,EAOjE,CAAA;AAPD,oCAOC;;IA2BwC,uCAAY;IAMjD,6BAAY,QAAkB;eAC1B,kBAAM,QAAQ,EAAE,gBAAgB,CAAC,IAAI,EAAE,IAAI,wBAAwB,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACjG;IAND,sBAAW,qCAAI;aAAf;YACI,MAAM,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACrH;;;OAAA;;gBA7BJ,SAAS,SAAC;oBACP,QAAQ,EAAE,wBAAwB;oBAClC,QAAQ,EAAE,goBAqBb;iBACA;;;;gBAxCmB,SAAS;;8BAA7B;EAyCyC,YAAY;SAAxC,mBAAmB","sourcesContent":["import { Component, Renderer2 } from \"@angular/core\";\nimport { DatePrecision } from \"../../../misc/util/index\";\nimport { CalendarView, CalendarViewType } from \"./calendar-view\";\nimport { CalendarItem } from \"../directives/calendar-item\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\nimport { DateParser } from \"../classes/date-parser\";\n\nexport class CalendarRangeHourService extends CalendarRangeService {\n public configureItem(item:CalendarItem, baseDate:Date):void {\n // Set minutes and seconds to 0\n const customFormat:string = this.service.localeValues.formats.time.replace(/[ms]/g, \"0\");\n item.humanReadable = new DateParser(customFormat, this.service.localeValues).format(item.date);\n item.isOutsideRange = false;\n }\n}\n\n@Component({\n selector: \"sui-calendar-hour-view\",\n template: `\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n`\n})\nexport class SuiCalendarHourView extends CalendarView {\n\n public get date():string {\n return new DateParser(this.service.localeValues.formats.date, this.service.localeValues).format(this.currentDate);\n }\n\n constructor(renderer:Renderer2) {\n super(renderer, CalendarViewType.Hour, new CalendarRangeHourService(DatePrecision.Date, 6, 4));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/hour-view.metadata.json b/dist/modules/datepicker/views/hour-view.metadata.json deleted file mode 100644 index f4636df12..000000000 --- a/dist/modules/datepicker/views/hour-view.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"CalendarRangeHourService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":7,"character":46},"members":{"configureItem":[{"__symbolic":"method"}]}},"SuiCalendarHourView":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./calendar-view","name":"CalendarView","line":41,"character":41},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":16,"character":1},"arguments":[{"selector":"sui-calendar-hour-view","template":"\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":47,"character":25}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/minute-view.d.ts b/dist/modules/datepicker/views/minute-view.d.ts deleted file mode 100644 index f2c01405c..000000000 --- a/dist/modules/datepicker/views/minute-view.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Renderer2 } from "@angular/core"; -import { CalendarView } from "./calendar-view"; -import { CalendarItem } from "../directives/calendar-item"; -import { CalendarRangeService } from "../services/calendar-range.service"; -export declare class CalendarRangeMinuteService extends CalendarRangeService { - calcStart(start: Date): Date; - calcDates(start: Date): Date[]; - configureItem(item: CalendarItem, baseDate: Date): void; -} -export declare class SuiCalendarMinuteView extends CalendarView { - readonly date: string; - constructor(renderer: Renderer2); -} diff --git a/dist/modules/datepicker/views/minute-view.js b/dist/modules/datepicker/views/minute-view.js deleted file mode 100644 index 17b495f35..000000000 --- a/dist/modules/datepicker/views/minute-view.js +++ /dev/null @@ -1,71 +0,0 @@ -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 __()); - }; -})(); -import { Component, Renderer2 } from "@angular/core"; -import { Util, DateUtil, DatePrecision } from "../../../misc/util/index"; -import { CalendarView, CalendarViewType } from "./calendar-view"; -import { CalendarMode } from "../services/calendar.service"; -import { CalendarRangeService } from "../services/calendar-range.service"; -import { DateParser } from "../classes/date-parser"; -var CalendarRangeMinuteService = /** @class */ (function (_super) { - __extends(CalendarRangeMinuteService, _super); - function CalendarRangeMinuteService() { - return _super !== null && _super.apply(this, arguments) || this; - } - CalendarRangeMinuteService.prototype.calcStart = function (start) { - return DateUtil.startOf(DatePrecision.Hour, DateUtil.clone(start), true); - }; - CalendarRangeMinuteService.prototype.calcDates = function (start) { - return Util.Array - .range(this.length) - .map(function (i) { return DateUtil.add(DatePrecision.Minute, DateUtil.clone(start), i * 5); }); - }; - CalendarRangeMinuteService.prototype.configureItem = function (item, baseDate) { - item.humanReadable = new DateParser(this.service.localeValues.formats.time, this.service.localeValues).format(item.date); - item.isOutsideRange = false; - }; - return CalendarRangeMinuteService; -}(CalendarRangeService)); -export { CalendarRangeMinuteService }; -var SuiCalendarMinuteView = /** @class */ (function (_super) { - __extends(SuiCalendarMinuteView, _super); - function SuiCalendarMinuteView(renderer) { - return _super.call(this, renderer, CalendarViewType.Minute, new CalendarRangeMinuteService(DatePrecision.Hour, 4, 3)) || this; - } - Object.defineProperty(SuiCalendarMinuteView.prototype, "date", { - get: function () { - if (this.service.config.mode !== CalendarMode.TimeOnly) { - // Set minutes and seconds to 0 - var dateTimeFormat = this.service.localeValues.formats.datetime.replace(/[ms]/g, "0"); - return new DateParser(dateTimeFormat, this.service.localeValues).format(this.currentDate); - } - else { - // Set minutes and seconds to 0 - var timeFormat = this.service.localeValues.formats.time.replace(/[ms]/g, "0"); - return new DateParser(timeFormat, this.service.localeValues).format(this.currentDate); - } - }, - enumerable: true, - configurable: true - }); - SuiCalendarMinuteView.decorators = [ - { type: Component, args: [{ - selector: "sui-calendar-minute-view", - template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiCalendarMinuteView.ctorParameters = function () { return [ - { type: Renderer2, }, - ]; }; - return SuiCalendarMinuteView; -}(CalendarView)); -export { SuiCalendarMinuteView }; -//# sourceMappingURL=minute-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/minute-view.js.map b/dist/modules/datepicker/views/minute-view.js.map deleted file mode 100644 index fe813e5e3..000000000 --- a/dist/modules/datepicker/views/minute-view.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"minute-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/minute-view.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,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Q,EAAE,gBAAgB,CAAC,MAAM,EAAE,IAAI,0BAA0B,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACrG;IAdD,sBAAW,uCAAI;aAAf;YACI,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;;gBAErD,IAAM,cAAc,GAAU,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC/F,MAAM,CAAC,IAAI,UAAU,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aAC7F;YAAC,IAAI,CAAC,CAAC;;gBAEJ,IAAM,UAAU,GAAU,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBACvF,MAAM,CAAC,IAAI,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aACzF;SACJ;;;OAAA;;gBApCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,0BAA0B;oBACpC,QAAQ,EAAE,gmBAqBb;iBACA;;;;gBAjDmB,SAAS;;gCAA7B;EAkD2C,YAAY;SAA1C,qBAAqB","sourcesContent":["import { Component, Renderer2 } from \"@angular/core\";\nimport { Util, DateUtil, DatePrecision } from \"../../../misc/util/index\";\nimport { CalendarView, CalendarViewType } from \"./calendar-view\";\nimport { CalendarItem } from \"../directives/calendar-item\";\nimport { CalendarMode } from \"../services/calendar.service\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\nimport { DateParser } from \"../classes/date-parser\";\n\nexport class CalendarRangeMinuteService extends CalendarRangeService {\n public calcStart(start:Date):Date {\n return DateUtil.startOf(DatePrecision.Hour, DateUtil.clone(start), true);\n }\n\n public calcDates(start:Date):Date[] {\n return Util.Array\n .range(this.length)\n .map(i => DateUtil.add(DatePrecision.Minute, DateUtil.clone(start), i * 5));\n }\n\n public configureItem(item:CalendarItem, baseDate:Date):void {\n item.humanReadable = new DateParser(this.service.localeValues.formats.time, this.service.localeValues).format(item.date);\n item.isOutsideRange = false;\n }\n}\n\n@Component({\n selector: \"sui-calendar-minute-view\",\n template: `\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n`\n})\nexport class SuiCalendarMinuteView extends CalendarView {\n public get date():string {\n if (this.service.config.mode !== CalendarMode.TimeOnly) {\n // Set minutes and seconds to 0\n const dateTimeFormat:string = this.service.localeValues.formats.datetime.replace(/[ms]/g, \"0\");\n return new DateParser(dateTimeFormat, this.service.localeValues).format(this.currentDate);\n } else {\n // Set minutes and seconds to 0\n const timeFormat:string = this.service.localeValues.formats.time.replace(/[ms]/g, \"0\");\n return new DateParser(timeFormat, this.service.localeValues).format(this.currentDate);\n }\n }\n\n constructor(renderer:Renderer2) {\n super(renderer, CalendarViewType.Minute, new CalendarRangeMinuteService(DatePrecision.Hour, 4, 3));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/minute-view.metadata.json b/dist/modules/datepicker/views/minute-view.metadata.json deleted file mode 100644 index 610f39373..000000000 --- a/dist/modules/datepicker/views/minute-view.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"CalendarRangeMinuteService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":8,"character":48},"members":{"calcStart":[{"__symbolic":"method"}],"calcDates":[{"__symbolic":"method"}],"configureItem":[{"__symbolic":"method"}]}},"SuiCalendarMinuteView":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./calendar-view","name":"CalendarView","line":50,"character":43},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":25,"character":1},"arguments":[{"selector":"sui-calendar-minute-view","template":"\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ date }}\n \n
{{ item.humanReadable }}\n
\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":63,"character":25}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/month-view.d.ts b/dist/modules/datepicker/views/month-view.d.ts deleted file mode 100644 index 20150fb62..000000000 --- a/dist/modules/datepicker/views/month-view.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Renderer2 } from "@angular/core"; -import { CalendarView } from "./calendar-view"; -import { CalendarItem } from "../directives/calendar-item"; -import { CalendarRangeService } from "../services/calendar-range.service"; -export declare class CalendarRangeMonthService extends CalendarRangeService { - configureItem(item: CalendarItem, baseDate: Date): void; -} -export declare class SuiCalendarMonthView extends CalendarView { - readonly year: string; - constructor(renderer: Renderer2); -} diff --git a/dist/modules/datepicker/views/month-view.js b/dist/modules/datepicker/views/month-view.js deleted file mode 100644 index 4320e0818..000000000 --- a/dist/modules/datepicker/views/month-view.js +++ /dev/null @@ -1,53 +0,0 @@ -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 __()); - }; -})(); -import { Component, Renderer2 } from "@angular/core"; -import { DatePrecision } from "../../../misc/util/index"; -import { CalendarView, CalendarViewType } from "./calendar-view"; -import { CalendarRangeService } from "../services/calendar-range.service"; -import { DateParser } from "../classes/date-parser"; -var CalendarRangeMonthService = /** @class */ (function (_super) { - __extends(CalendarRangeMonthService, _super); - function CalendarRangeMonthService() { - return _super !== null && _super.apply(this, arguments) || this; - } - CalendarRangeMonthService.prototype.configureItem = function (item, baseDate) { - item.humanReadable = this.service.localeValues.monthsShort[item.date.getMonth()]; - item.isOutsideRange = false; - }; - return CalendarRangeMonthService; -}(CalendarRangeService)); -export { CalendarRangeMonthService }; -var SuiCalendarMonthView = /** @class */ (function (_super) { - __extends(SuiCalendarMonthView, _super); - function SuiCalendarMonthView(renderer) { - return _super.call(this, renderer, CalendarViewType.Month, new CalendarRangeMonthService(DatePrecision.Year, 4, 3)) || this; - } - Object.defineProperty(SuiCalendarMonthView.prototype, "year", { - get: function () { - return new DateParser(this.service.localeValues.formats.year, this.service.localeValues).format(this.currentDate); - }, - enumerable: true, - configurable: true - }); - SuiCalendarMonthView.decorators = [ - { type: Component, args: [{ - selector: "sui-calendar-month-view", - template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
{{ item.humanReadable }}\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiCalendarMonthView.ctorParameters = function () { return [ - { type: Renderer2, }, - ]; }; - return SuiCalendarMonthView; -}(CalendarView)); -export { SuiCalendarMonthView }; -//# sourceMappingURL=month-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/month-view.js.map b/dist/modules/datepicker/views/month-view.js.map deleted file mode 100644 index 592ca7099..000000000 --- a/dist/modules/datepicker/views/month-view.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"month-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/month-view.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,IAAA;IAA+C,6CAAoB;;;;IACxD,iDAAa,GAApB,UAAqB,IAAiB,EAAE,QAAa;QACjD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;KAC/B;oCAXL;EAO+C,oBAAoB,EAKlE,CAAA;AALD,qCAKC;;IA2ByC,wCAAY;IAKlD,8BAAY,QAAkB;eAC1B,kBAAM,QAAQ,EAAE,gBAAgB,CAAC,KAAK,EAAE,IAAI,yBAAyB,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACnG;IAND,sBAAW,sCAAI;aAAf;YACI,MAAM,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACrH;;;OAAA;;gBA5BJ,SAAS,SAAC;oBACP,QAAQ,EAAE,yBAAyB;oBACnC,QAAQ,EAAE,+lBAqBb;iBACA;;;;gBAtCmB,SAAS;;+BAA7B;EAuC0C,YAAY;SAAzC,oBAAoB","sourcesContent":["import { Component, Renderer2 } from \"@angular/core\";\nimport { DatePrecision } from \"../../../misc/util/index\";\nimport { CalendarView, CalendarViewType } from \"./calendar-view\";\nimport { CalendarItem } from \"../directives/calendar-item\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\nimport { DateParser } from \"../classes/date-parser\";\n\nexport class CalendarRangeMonthService extends CalendarRangeService {\n public configureItem(item:CalendarItem, baseDate:Date):void {\n item.humanReadable = this.service.localeValues.monthsShort[item.date.getMonth()];\n item.isOutsideRange = false;\n }\n}\n\n@Component({\n selector: \"sui-calendar-month-view\",\n template: `\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
{{ item.humanReadable }}\n
\n`\n})\nexport class SuiCalendarMonthView extends CalendarView {\n public get year():string {\n return new DateParser(this.service.localeValues.formats.year, this.service.localeValues).format(this.currentDate);\n }\n\n constructor(renderer:Renderer2) {\n super(renderer, CalendarViewType.Month, new CalendarRangeMonthService(DatePrecision.Year, 4, 3));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/month-view.metadata.json b/dist/modules/datepicker/views/month-view.metadata.json deleted file mode 100644 index 28e950593..000000000 --- a/dist/modules/datepicker/views/month-view.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"CalendarRangeMonthService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":7,"character":47},"members":{"configureItem":[{"__symbolic":"method"}]}},"SuiCalendarMonthView":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./calendar-view","name":"CalendarView","line":39,"character":42},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"selector":"sui-calendar-month-view","template":"\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ year }}\n \n
{{ item.humanReadable }}\n
\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":44,"character":25}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/datepicker/views/year-view.d.ts b/dist/modules/datepicker/views/year-view.d.ts deleted file mode 100644 index c743c7e4f..000000000 --- a/dist/modules/datepicker/views/year-view.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Renderer2 } from "@angular/core"; -import { CalendarView } from "./calendar-view"; -import { CalendarItem } from "../directives/calendar-item"; -import { CalendarRangeService } from "../services/calendar-range.service"; -export declare class CalendarRangeYearService extends CalendarRangeService { - configureItem(item: CalendarItem, baseDate: Date): void; -} -export declare class SuiCalendarYearView extends CalendarView { - readonly decadeStart: number; - constructor(renderer: Renderer2); - pad(year: number): string; -} diff --git a/dist/modules/datepicker/views/year-view.js b/dist/modules/datepicker/views/year-view.js deleted file mode 100644 index 6d15a5fff..000000000 --- a/dist/modules/datepicker/views/year-view.js +++ /dev/null @@ -1,57 +0,0 @@ -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 __()); - }; -})(); -import { Component, Renderer2 } from "@angular/core"; -import { Util, DateUtil, DatePrecision } from "../../../misc/util/index"; -import { CalendarView, CalendarViewType } from "./calendar-view"; -import { CalendarRangeService } from "../services/calendar-range.service"; -var CalendarRangeYearService = /** @class */ (function (_super) { - __extends(CalendarRangeYearService, _super); - function CalendarRangeYearService() { - return _super !== null && _super.apply(this, arguments) || this; - } - CalendarRangeYearService.prototype.configureItem = function (item, baseDate) { - item.humanReadable = Util.String.padLeft(item.date.getFullYear().toString(), 4, "0"); - item.isOutsideRange = item.date.getFullYear() >= this.calcStart(baseDate).getFullYear() + 10; - }; - return CalendarRangeYearService; -}(CalendarRangeService)); -export { CalendarRangeYearService }; -var SuiCalendarYearView = /** @class */ (function (_super) { - __extends(SuiCalendarYearView, _super); - function SuiCalendarYearView(renderer) { - return _super.call(this, renderer, CalendarViewType.Year, new CalendarRangeYearService(DatePrecision.Decade, 4, 3)) || this; - } - Object.defineProperty(SuiCalendarYearView.prototype, "decadeStart", { - get: function () { - return DateUtil - .startOf(DatePrecision.Decade, DateUtil.clone(this.service.currentDate)) - .getFullYear(); - }, - enumerable: true, - configurable: true - }); - SuiCalendarYearView.prototype.pad = function (year) { - return Util.String.padLeft(year.toString(), 4, "0"); - }; - SuiCalendarYearView.decorators = [ - { type: Component, args: [{ - selector: "sui-calendar-year-view", - template: "\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
{{ item.humanReadable }}\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiCalendarYearView.ctorParameters = function () { return [ - { type: Renderer2, }, - ]; }; - return SuiCalendarYearView; -}(CalendarView)); -export { SuiCalendarYearView }; -//# sourceMappingURL=year-view.js.map \ No newline at end of file diff --git a/dist/modules/datepicker/views/year-view.js.map b/dist/modules/datepicker/views/year-view.js.map deleted file mode 100644 index 1ca8f5a9a..000000000 --- a/dist/modules/datepicker/views/year-view.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"year-view.js","sourceRoot":"","sources":["../../../../src/modules/datepicker/views/year-view.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,IAAA;IAA8C,4CAAoB;;;;IACvD,gDAAa,GAApB,UAAqB,IAAiB,EAAE,QAAa;QACjD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACrF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC;KAChG;mCAVL;EAM8C,oBAAoB,EAKjE,CAAA;AALD,oCAKC;;IA2BwC,uCAAY;IAOjD,6BAAY,QAAkB;eAC1B,kBAAM,QAAQ,EAAE,gBAAgB,CAAC,IAAI,EAAE,IAAI,wBAAwB,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACnG;IARD,sBAAW,4CAAW;aAAtB;YACI,MAAM,CAAC,QAAQ;iBACV,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;iBACvE,WAAW,EAAE,CAAC;SACtB;;;OAAA;IAMM,iCAAG,GAAV,UAAW,IAAW;QAClB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;KACvD;;gBAtCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,wBAAwB;oBAClC,QAAQ,EAAE,woBAqBb;iBACA;;;;gBArCmB,SAAS;;8BAA7B;EAsCyC,YAAY;SAAxC,mBAAmB","sourcesContent":["import { Component, Renderer2 } from \"@angular/core\";\nimport { Util, DateUtil, DatePrecision } from \"../../../misc/util/index\";\nimport { CalendarView, CalendarViewType } from \"./calendar-view\";\nimport { CalendarItem } from \"../directives/calendar-item\";\nimport { CalendarRangeService } from \"../services/calendar-range.service\";\n\nexport class CalendarRangeYearService extends CalendarRangeService {\n public configureItem(item:CalendarItem, baseDate:Date):void {\n item.humanReadable = Util.String.padLeft(item.date.getFullYear().toString(), 4, \"0\");\n item.isOutsideRange = item.date.getFullYear() >= this.calcStart(baseDate).getFullYear() + 10;\n }\n}\n\n@Component({\n selector: \"sui-calendar-year-view\",\n template: `\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
{{ item.humanReadable }}\n
\n`\n})\nexport class SuiCalendarYearView extends CalendarView {\n public get decadeStart():number {\n return DateUtil\n .startOf(DatePrecision.Decade, DateUtil.clone(this.service.currentDate))\n .getFullYear();\n }\n\n constructor(renderer:Renderer2) {\n super(renderer, CalendarViewType.Year, new CalendarRangeYearService(DatePrecision.Decade, 4, 3));\n }\n\n public pad(year:number):string {\n return Util.String.padLeft(year.toString(), 4, \"0\");\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/datepicker/views/year-view.metadata.json b/dist/modules/datepicker/views/year-view.metadata.json deleted file mode 100644 index 1c5334af8..000000000 --- a/dist/modules/datepicker/views/year-view.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"CalendarRangeYearService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../services/calendar-range.service","name":"CalendarRangeService","line":6,"character":46},"members":{"configureItem":[{"__symbolic":"method"}]}},"SuiCalendarYearView":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./calendar-view","name":"CalendarView","line":38,"character":41},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":13,"character":1},"arguments":[{"selector":"sui-calendar-year-view","template":"\n\n\n \n \n \n\n\n \n \n \n\n
\n \n {{ pad(decadeStart) }} - {{ pad(decadeStart + 10) }}\n \n
{{ item.humanReadable }}\n
\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":45,"character":25}]}],"pad":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/dimmer/components/dimmer.d.ts b/dist/modules/dimmer/components/dimmer.d.ts deleted file mode 100644 index dd645f35c..000000000 --- a/dist/modules/dimmer/components/dimmer.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { EventEmitter, Renderer2, ElementRef, ChangeDetectorRef } from "@angular/core"; -import { SuiTransition } from "../../transition/index"; -export declare class SuiDimmer extends SuiTransition { - private _dimmerClasses; - private _transitionController; - private _isDimmed; - isDimmed: boolean; - isDimmedChange: EventEmitter; - isClickable: boolean; - transition: string; - transitionDuration: number; - wrapContent: boolean; - constructor(renderer: Renderer2, element: ElementRef, changeDetector: ChangeDetectorRef); - private onClick(); -} diff --git a/dist/modules/dimmer/components/dimmer.js b/dist/modules/dimmer/components/dimmer.js deleted file mode 100644 index f5e4b1344..000000000 --- a/dist/modules/dimmer/components/dimmer.js +++ /dev/null @@ -1,77 +0,0 @@ -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 __()); - }; -})(); -import { Component, Input, Output, HostBinding, HostListener, EventEmitter, Renderer2, ElementRef, ChangeDetectorRef } from "@angular/core"; -import { TransitionController, SuiTransition, TransitionDirection, Transition } from "../../transition/index"; -var SuiDimmer = /** @class */ (function (_super) { - __extends(SuiDimmer, _super); - function SuiDimmer(renderer, element, changeDetector) { - var _this = _super.call(this, renderer, element, changeDetector) || this; - _this._isDimmed = false; - _this.isDimmedChange = new EventEmitter(); - _this.isClickable = true; - _this.wrapContent = true; - _this._dimmerClasses = true; - return _this; - } - Object.defineProperty(SuiDimmer.prototype, "isDimmed", { - get: function () { - return this._isDimmed; - }, - set: function (value) { - var isDimmed = !!value; - if (!this._transitionController) { - // Initialise transition functionality when first setting dimmed, to ensure initial state doesn't transition. - this._transitionController = new TransitionController(isDimmed, "block"); - this.setTransitionController(this._transitionController); - this._isDimmed = isDimmed; - } - else if (this._isDimmed !== isDimmed) { - this._isDimmed = isDimmed; - this._transitionController.stopAll(); - this._transitionController.animate(new Transition("fade", this.transitionDuration, isDimmed ? TransitionDirection.In : TransitionDirection.Out)); - } - }, - enumerable: true, - configurable: true - }); - SuiDimmer.prototype.onClick = function () { - if (this.isClickable) { - this.isDimmed = false; - this.isDimmedChange.emit(this.isDimmed); - } - }; - SuiDimmer.decorators = [ - { type: Component, args: [{ - selector: "sui-dimmer", - template: "\n
\n
\n \n
\n
\n", - styles: ["\n:host.dimmer {\n transition: none;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiDimmer.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - { type: ChangeDetectorRef, }, - ]; }; - SuiDimmer.propDecorators = { - "_dimmerClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.dimmer",] },], - "isDimmed": [{ type: HostBinding, args: ["class.active",] }, { type: Input },], - "isDimmedChange": [{ type: Output },], - "isClickable": [{ type: Input },], - "transition": [{ type: Input },], - "transitionDuration": [{ type: Input },], - "wrapContent": [{ type: Input },], - "onClick": [{ type: HostListener, args: ["click",] },], - }; - return SuiDimmer; -}(SuiTransition)); -export { SuiDimmer }; -//# sourceMappingURL=dimmer.js.map \ No newline at end of file diff --git a/dist/modules/dimmer/components/dimmer.js.map b/dist/modules/dimmer/components/dimmer.js.map deleted file mode 100644 index 66b2ba3bb..000000000 --- a/dist/modules/dimmer/components/dimmer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dimmer.js","sourceRoot":"","sources":["../../../../src/modules/dimmer/components/dimmer.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAC5E,UAAU,EAAE,iBAAiB,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;IAiB/E,6BAAa;IAmDxC,mBAAY,QAAkB,EAAE,OAAkB,EAAE,cAAgC;QAApF,YACI,kBAAM,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,SAS3C;QAPG,KAAI,CAAC,SAAS,GA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SAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,4IAMb;oBACG,MAAM,EAAE,CAAC,8CAIZ,CAAC;iBACD;;;;gBAnBsE,SAAS;gBAC5E,UAAU;gBAAE,iBAAiB;;;mCAoB5B,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,cAAc;6BAO1B,WAAW,SAAC,cAAc,cAC1B,KAAK;mCAyBL,MAAM;gCAGN,KAAK;+BAGL,KAAK;uCAGL,KAAK;gCAIL,KAAK;4BAeL,YAAY,SAAC,OAAO;;oBApFzB;EAqB+B,aAAa;SAA/B,SAAS","sourcesContent":["import {\n Component, Input, Output, HostBinding, HostListener, EventEmitter, Renderer2,\n ElementRef, ChangeDetectorRef\n} from \"@angular/core\";\nimport { TransitionController, SuiTransition, TransitionDirection, Transition } from \"../../transition/index\";\n\n@Component({\n selector: \"sui-dimmer\",\n template: `\n
\n
\n \n
\n
\n`,\n styles: [`\n:host.dimmer {\n transition: none;\n}\n`]\n})\nexport class SuiDimmer extends SuiTransition {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.dimmer\")\n private _dimmerClasses:boolean;\n\n private _transitionController:TransitionController;\n\n private _isDimmed:boolean;\n\n @HostBinding(\"class.active\")\n @Input()\n public get isDimmed():boolean {\n return this._isDimmed;\n }\n\n public set isDimmed(value:boolean) {\n const isDimmed = !!value;\n\n if (!this._transitionController) {\n // Initialise transition functionality when first setting dimmed, to ensure initial state doesn't transition.\n this._transitionController = new TransitionController(isDimmed, \"block\");\n\n this.setTransitionController(this._transitionController);\n\n this._isDimmed = isDimmed;\n } else if (this._isDimmed !== isDimmed) {\n\n this._isDimmed = isDimmed;\n\n this._transitionController.stopAll();\n this._transitionController.animate(\n new Transition(\"fade\", this.transitionDuration, isDimmed ? TransitionDirection.In : TransitionDirection.Out));\n }\n }\n\n @Output()\n public isDimmedChange:EventEmitter;\n\n @Input()\n public isClickable:boolean;\n\n @Input()\n public transition:string;\n\n @Input()\n public transitionDuration:number;\n\n /* Internal for now */\n @Input()\n public wrapContent:boolean;\n\n constructor(renderer:Renderer2, element:ElementRef, changeDetector:ChangeDetectorRef) {\n super(renderer, element, changeDetector);\n\n this._isDimmed = false;\n this.isDimmedChange = new EventEmitter();\n this.isClickable = true;\n\n this.wrapContent = true;\n\n this._dimmerClasses = true;\n }\n\n @HostListener(\"click\")\n private onClick():void {\n if (this.isClickable) {\n this.isDimmed = false;\n this.isDimmedChange.emit(this.isDimmed);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/dimmer/components/dimmer.metadata.json b/dist/modules/dimmer/components/dimmer.metadata.json deleted file mode 100644 index 5221ad019..000000000 --- a/dist/modules/dimmer/components/dimmer.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiDimmer":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../transition/index","name":"SuiTransition","line":21,"character":31},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"sui-dimmer","template":"\n
\n
\n \n
\n
\n","styles":["\n:host.dimmer {\n transition: none;\n}\n"]}]}],"members":{"_dimmerClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":22,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":23,"character":5},"arguments":["class.dimmer"]}]}],"isDimmed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":30,"character":5},"arguments":["class.active"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":5}}]}],"isDimmedChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":56,"character":5}}]}],"isClickable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":5}}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":62,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":65,"character":5}}]}],"wrapContent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":69,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":72,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":72,"character":44},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":72,"character":71}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":84,"character":5},"arguments":["click"]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/dimmer/dimmer.module.d.ts b/dist/modules/dimmer/dimmer.module.d.ts deleted file mode 100644 index 492275b11..000000000 --- a/dist/modules/dimmer/dimmer.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiDimmerModule { -} diff --git a/dist/modules/dimmer/dimmer.module.js b/dist/modules/dimmer/dimmer.module.js deleted file mode 100644 index 01384d2ac..000000000 --- a/dist/modules/dimmer/dimmer.module.js +++ /dev/null @@ -1,27 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiTransitionModule } from "../transition/index"; -import { SuiDimmer } from "./components/dimmer"; -var SuiDimmerModule = /** @class */ (function () { - function SuiDimmerModule() { - } - SuiDimmerModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule, - SuiTransitionModule - ], - declarations: [ - SuiDimmer - ], - exports: [ - SuiDimmer - ] - },] }, - ]; - /** @nocollapse */ - SuiDimmerModule.ctorParameters = function () { return []; }; - return SuiDimmerModule; -}()); -export { SuiDimmerModule }; -//# sourceMappingURL=dimmer.module.js.map \ No newline at end of file diff --git a/dist/modules/dimmer/dimmer.module.js.map b/dist/modules/dimmer/dimmer.module.js.map deleted file mode 100644 index 345a06bfd..000000000 --- a/dist/modules/dimmer/dimmer.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dimmer.module.js","sourceRoot":"","sources":["../../../src/modules/dimmer/dimmer.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;;;;;gBAE/C,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,mBAAmB;qBACtB;oBACD,YAAY,EAAE;wBACV,SAAS;qBACZ;oBACD,OAAO,EAAE;wBACL,SAAS;qBACZ;iBACJ;;;;0BAhBD;;SAiBa,eAAe","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTransitionModule } from \"../transition/index\";\nimport { SuiDimmer } from \"./components/dimmer\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiTransitionModule\n ],\n declarations: [\n SuiDimmer\n ],\n exports: [\n SuiDimmer\n ]\n})\nexport class SuiDimmerModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/dimmer/dimmer.module.metadata.json b/dist/modules/dimmer/dimmer.module.metadata.json deleted file mode 100644 index 41df51f23..000000000 --- a/dist/modules/dimmer/dimmer.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiDimmerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":7,"character":8},{"__symbolic":"reference","module":"../transition/index","name":"SuiTransitionModule","line":8,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/dimmer","name":"SuiDimmer","line":11,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/dimmer","name":"SuiDimmer","line":14,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/dimmer/index.d.ts b/dist/modules/dimmer/index.d.ts deleted file mode 100644 index b445fad21..000000000 --- a/dist/modules/dimmer/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./components/dimmer"; -export * from "./dimmer.module"; diff --git a/dist/modules/dimmer/index.js b/dist/modules/dimmer/index.js deleted file mode 100644 index 5082bf6f0..000000000 --- a/dist/modules/dimmer/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./components/dimmer"; -export * from "./dimmer.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/dimmer/index.js.map b/dist/modules/dimmer/index.js.map deleted file mode 100644 index 122796c1c..000000000 --- a/dist/modules/dimmer/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/dimmer/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AAEpC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./components/dimmer\";\n\nexport * from \"./dimmer.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/dimmer/index.metadata.json b/dist/modules/dimmer/index.metadata.json deleted file mode 100644 index 556c4a5ec..000000000 --- a/dist/modules/dimmer/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/dimmer"},{"from":"./dimmer.module"}]}] \ No newline at end of file diff --git a/dist/modules/dimmer/public.d.ts b/dist/modules/dimmer/public.d.ts deleted file mode 100644 index 7893f514a..000000000 --- a/dist/modules/dimmer/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiDimmerModule } from "./index"; diff --git a/dist/modules/dimmer/public.js b/dist/modules/dimmer/public.js deleted file mode 100644 index 1a4a66510..000000000 --- a/dist/modules/dimmer/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiDimmerModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/dimmer/public.js.map b/dist/modules/dimmer/public.js.map deleted file mode 100644 index 373025ee7..000000000 --- a/dist/modules/dimmer/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/dimmer/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EAClB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiDimmerModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/dimmer/public.metadata.json b/dist/modules/dimmer/public.metadata.json deleted file mode 100644 index 738af32a6..000000000 --- a/dist/modules/dimmer/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiDimmerModule"]}]}] \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown-menu.d.ts b/dist/modules/dropdown/directives/dropdown-menu.d.ts deleted file mode 100644 index 7f0281632..000000000 --- a/dist/modules/dropdown/directives/dropdown-menu.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Renderer2, ElementRef, AfterContentInit, QueryList, ChangeDetectorRef, OnDestroy } from "@angular/core"; -import { SuiTransition } from "../../transition/index"; -import { HandledEvent, KeyCode } from "../../../misc/util/index"; -import { DropdownService } from "../services/dropdown.service"; -import "element-closest"; -export declare class SuiDropdownMenuItem { - private _renderer; - element: ElementRef; - readonly isDisabled: boolean; - private _isSelected; - isSelected: boolean; - selectedClass: string; - childDropdownMenu: SuiDropdownMenu; - readonly hasChildDropdown: boolean; - constructor(_renderer: Renderer2, element: ElementRef); - performClick(): void; -} -export declare class SuiDropdownMenu extends SuiTransition implements AfterContentInit, OnDestroy { - element: ElementRef; - private _service; - private _transitionController; - menuTransition: string; - menuTransitionDuration: number; - service: DropdownService; - private _itemsQueryInternal; - private _itemsQueryOverride; - items: QueryList; - private readonly _itemsQuery; - private readonly _items; - selectedItems: SuiDropdownMenuItem[]; - menuAutoSelectFirst: boolean; - menuSelectedItemClass: string; - private _documentKeyDownListener; - constructor(renderer: Renderer2, element: ElementRef, changeDetector: ChangeDetectorRef); - onClick(e: HandledEvent & MouseEvent): void; - onDocumentKeyDown(e: KeyboardEvent): void; - resetSelection(): void; - updateSelection(selectedItem: SuiDropdownMenuItem, keyCode: KeyCode): SuiDropdownMenuItem; - scrollToItem(item: SuiDropdownMenuItem): void; - ngAfterContentInit(): void; - private onItemsChanged(); - ngOnDestroy(): void; -} diff --git a/dist/modules/dropdown/directives/dropdown-menu.js b/dist/modules/dropdown/directives/dropdown-menu.js deleted file mode 100644 index ee8824151..000000000 --- a/dist/modules/dropdown/directives/dropdown-menu.js +++ /dev/null @@ -1,315 +0,0 @@ -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 __()); - }; -})(); -import { Directive, ContentChild, forwardRef, Renderer2, ElementRef, ContentChildren, QueryList, Input, HostListener, ChangeDetectorRef } from "@angular/core"; -import { Transition, SuiTransition, TransitionController, TransitionDirection } from "../../transition/index"; -import { KeyCode } from "../../../misc/util/index"; -import { DropdownAutoCloseType } from "../services/dropdown.service"; -import "element-closest"; -var SuiDropdownMenuItem = /** @class */ (function () { - function SuiDropdownMenuItem(_renderer, element) { - this._renderer = _renderer; - this.element = element; - this.isSelected = false; - this.selectedClass = "selected"; - } - Object.defineProperty(SuiDropdownMenuItem.prototype, "isDisabled", { - get: function () { - // We must use nativeElement as Angular doesn't have a way of reading class information. - var element = this.element.nativeElement; - return element.classList.contains("disabled"); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdownMenuItem.prototype, "isSelected", { - get: function () { - return this._isSelected; - }, - set: function (value) { - // Renderer is used to enable a dynamic class name. - if (value) { - this._renderer.addClass(this.element.nativeElement, this.selectedClass); - } - else { - this._renderer.removeClass(this.element.nativeElement, this.selectedClass); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdownMenuItem.prototype, "hasChildDropdown", { - get: function () { - return !!this.childDropdownMenu; - }, - enumerable: true, - configurable: true - }); - SuiDropdownMenuItem.prototype.performClick = function () { - // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. - this.element.nativeElement.click(); - }; - SuiDropdownMenuItem.decorators = [ - { type: Directive, args: [{ - // We must attach to every '.item' as Angular doesn't support > selectors. - selector: ".item" - },] }, - ]; - /** @nocollapse */ - SuiDropdownMenuItem.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - ]; }; - SuiDropdownMenuItem.propDecorators = { - "childDropdownMenu": [{ type: ContentChild, args: [forwardRef(function () { return SuiDropdownMenu; }),] },], - }; - return SuiDropdownMenuItem; -}()); -export { SuiDropdownMenuItem }; -var SuiDropdownMenu = /** @class */ (function (_super) { - __extends(SuiDropdownMenu, _super); - function SuiDropdownMenu(renderer, element, changeDetector) { - var _this = _super.call(this, renderer, element, changeDetector) || this; - _this.element = element; - // Initialise transition functionality. - // Initialise transition functionality. - _this._transitionController = new TransitionController(false); - _this.setTransitionController(_this._transitionController); - _this.menuTransition = "slide down"; - _this.menuTransitionDuration = 200; - _this.menuAutoSelectFirst = false; - _this.menuSelectedItemClass = "selected"; - _this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); - return _this; - } - Object.defineProperty(SuiDropdownMenu.prototype, "service", { - get: function () { - return this._service; - }, - set: function (value) { - var _this = this; - this._service = value; - var previousIsOpen = this._service.isOpen; - this._service.isOpenChange.subscribe(function (isOpen) { - if (isOpen !== previousIsOpen) { - // Only run transitions if the open state has changed. - // Only run transitions if the open state has changed. - _this._transitionController.stopAll(); - _this._transitionController.animate(new Transition(_this.menuTransition, _this.menuTransitionDuration, TransitionDirection.Either, function () { return _this._service.isAnimating = false; })); - } - if (!isOpen) { - // Reset the item selections when a nested item is selected to avoid incosistent open states. - if (_this.selectedItems.length > 1) { - _this.resetSelection(); - } - } - previousIsOpen = isOpen; - }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdownMenu.prototype, "items", { - set: function (items) { - this._itemsQueryOverride = items; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdownMenu.prototype, "_itemsQuery", { - get: function () { - return this._itemsQueryOverride || this._itemsQueryInternal; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdownMenu.prototype, "_items", { - // Get the list of items, ignoring those that are disabled. - get: - // Get the list of items, ignoring those that are disabled. - function () { - return this._itemsQuery.filter(function (i) { return !i.isDisabled; }); - }, - enumerable: true, - configurable: true - }); - SuiDropdownMenu.prototype.onClick = function (e) { - if (!e.eventHandled) { - e.eventHandled = true; - if (this._service.autoCloseMode === DropdownAutoCloseType.ItemClick) { - var target = e.target; - if (this.element.nativeElement.contains(target.closest(".item")) && !/input|textarea/i.test(target.tagName)) { - // Once an item is selected, we can close the entire dropdown. - this._service.setOpenState(false, true); - } - } - } - }; - SuiDropdownMenu.prototype.onDocumentKeyDown = function (e) { - // Only the root dropdown (i.e. not nested dropdowns) is responsible for keeping track of the currently selected item. - if (this._service.isOpen && !this._service.isNested) { - // Stop document events like scrolling while open. - var target = e.target; - if (!/input/i.test(target.tagName) && - [KeyCode.Escape, KeyCode.Enter, KeyCode.Up, KeyCode.Down, KeyCode.Left, KeyCode.Right].find(function (kC) { return kC === e.keyCode; })) { - e.preventDefault(); - } - // Gets the top selected item from the stack. - var selected = this.selectedItems.slice(-1)[0]; - // Keeping track of the menu containing the currently selected element allows us to easily determine its siblings. - var selectedContainer = this; - if (this.selectedItems.length >= 2) { - var selectedParent = this.selectedItems.slice(-2)[0]; - selectedContainer = selectedParent.childDropdownMenu; - } - switch (e.keyCode) { - // Escape : close the entire dropdown. - case KeyCode.Escape: { - this._service.setOpenState(false); - break; - } - // Down : select the next item below the current one, or the 1st if none selected. - case KeyCode.Down: - // Up : select the next item above the current one, or the 1st if none selected. - case KeyCode.Up: { - this.selectedItems.pop(); - this.selectedItems.push(selectedContainer.updateSelection(selected, e.keyCode)); - // Prevent default regardless of whether we are in an input, to stop jumping to the start or end of the query string. - e.preventDefault(); - break; - } - // Enter : if the item doesn't contain a nested dropdown, 'click' it. Otherwise, fall through to 'Right' action. - case KeyCode.Enter: { - if (selected && !selected.hasChildDropdown) { - selected.performClick(); - break; - } - } - // falls through - // Right : if the selected item contains a nested dropdown, open the dropdown & select the 1st item. - case KeyCode.Right: { - if (selected && selected.hasChildDropdown) { - selected.childDropdownMenu.service.setOpenState(true); - this.selectedItems.push(selected.childDropdownMenu.updateSelection(selected, e.keyCode)); - } - break; - } - // Left : if the selected item is in a nested dropdown, close it and select the containing item. - case KeyCode.Left: { - if (this.selectedItems.length >= 2) { - this.selectedItems.pop(); - var selectedParent = this.selectedItems.slice(-1)[0]; - selectedParent.childDropdownMenu.service.setOpenState(false); - selectedParent.isSelected = true; - } - break; - } - } - } - }; - SuiDropdownMenu.prototype.resetSelection = function () { - var _this = this; - this.selectedItems = []; - this._items.forEach(function (i) { - i.selectedClass = _this.menuSelectedItemClass; - i.isSelected = false; - }); - if (this.menuAutoSelectFirst && this._items.length > 0) { - // Autoselect 1st item if required & possible. - this._items[0].isSelected = true; - this.scrollToItem(this._items[0]); - this.selectedItems.push(this._itemsQuery.first); - } - }; - // Determines the item to next be selected, based on the keyboard input & the currently selected item. - // Determines the item to next be selected, based on the keyboard input & the currently selected item. - SuiDropdownMenu.prototype.updateSelection = - // Determines the item to next be selected, based on the keyboard input & the currently selected item. - function (selectedItem, keyCode) { - if (selectedItem) { - // Remove the selected status on the previously selected item. - selectedItem.isSelected = false; - } - var selectedIndex = this._items - .findIndex(function (i) { return i === selectedItem; }); - var newSelection; - switch (keyCode) { - case KeyCode.Enter: - case KeyCode.Right: - case KeyCode.Down: - selectedIndex += 1; - break; - case KeyCode.Up: - if (selectedIndex === -1) { - // If none are selected, select the 1st item. Should this be `this.items.last - 1`? - selectedIndex = 0; - break; - } - selectedIndex -= 1; - break; - } - // Select the item at the updated index. The || is to stop us selecting past the start or end of the item list. - newSelection = this._items[selectedIndex] || selectedItem; - if (newSelection) { - // Set the selected status on the newly selected item. - newSelection.isSelected = true; - // Set the current scroll position to the location of the newly selected item. - this.scrollToItem(newSelection); - } - return newSelection; - }; - SuiDropdownMenu.prototype.scrollToItem = function (item) { - var menu = this.element.nativeElement; - var selectedRect = item.element.nativeElement.getBoundingClientRect(); - var menuRect = menu.getBoundingClientRect(); - var scrollAmount = 0; - if (selectedRect.bottom > menuRect.bottom) { - scrollAmount = selectedRect.bottom - menuRect.bottom; - } - if (selectedRect.top < menuRect.top) { - scrollAmount = selectedRect.top - menuRect.top; - } - menu.scrollTop += Math.round(scrollAmount); - }; - SuiDropdownMenu.prototype.ngAfterContentInit = function () { - var _this = this; - this.onItemsChanged(); - this._itemsQuery.changes.subscribe(function () { return _this.onItemsChanged(); }); - }; - SuiDropdownMenu.prototype.onItemsChanged = function () { - // We use `_items` rather than `items` in case one or more have become disabled. - this.resetSelection(); - }; - SuiDropdownMenu.prototype.ngOnDestroy = function () { - this._documentKeyDownListener(); - }; - SuiDropdownMenu.decorators = [ - { type: Directive, args: [{ - selector: "[suiDropdownMenu]" - },] }, - ]; - /** @nocollapse */ - SuiDropdownMenu.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - { type: ChangeDetectorRef, }, - ]; }; - SuiDropdownMenu.propDecorators = { - "menuTransition": [{ type: Input },], - "menuTransitionDuration": [{ type: Input },], - "_itemsQueryInternal": [{ type: ContentChildren, args: [SuiDropdownMenuItem,] },], - "menuAutoSelectFirst": [{ type: Input },], - "menuSelectedItemClass": [{ type: Input },], - "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], - }; - return SuiDropdownMenu; -}(SuiTransition)); -export { SuiDropdownMenu }; -//# sourceMappingURL=dropdown-menu.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown-menu.js.map b/dist/modules/dropdown/directives/dropdown-menu.js.map deleted file mode 100644 index 31b7f868f..000000000 --- a/dist/modules/dropdown/directives/dropdown-menu.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../../src/modules/dropdown/directives/dropdown-menu.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAC1D,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,iBAAiB,EACrE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC9G,OAAO,EAAmC,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAmB,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAEtF,OAAO,iBAAiB,CAAC;;IAsCrB,6BAAoB,SAAmB,EAAS,OAAkB;QAA9C,cAAS,GAAT,SAAS,CAAU;QAAS,YAAO,GAAP,OAAO,CAAW;QAC9D,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC;KACnC;IAnCD,sBAAW,2CAAU;aAArB;;YAEI,IAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,aAAwB,CAAC;YACtD,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ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ener, ChangeDetectorRef, OnDestroy\n} from \"@angular/core\";\nimport { Transition, SuiTransition, TransitionController, TransitionDirection } from \"../../transition/index\";\nimport { HandledEvent, IAugmentedElement, KeyCode } from \"../../../misc/util/index\";\nimport { DropdownService, DropdownAutoCloseType } from \"../services/dropdown.service\";\n// Polyfill for IE\nimport \"element-closest\";\n\n@Directive({\n // We must attach to every '.item' as Angular doesn't support > selectors.\n selector: \".item\"\n})\nexport class SuiDropdownMenuItem {\n public get isDisabled():boolean {\n // We must use nativeElement as Angular doesn't have a way of reading class information.\n const element = this.element.nativeElement as Element;\n return element.classList.contains(\"disabled\");\n }\n\n private _isSelected:boolean;\n\n public get isSelected():boolean {\n return this._isSelected;\n }\n\n public set isSelected(value:boolean) {\n // Renderer is used to enable a dynamic class name.\n if (value) {\n this._renderer.addClass(this.element.nativeElement, this.selectedClass);\n } else {\n this._renderer.removeClass(this.element.nativeElement, this.selectedClass);\n }\n }\n\n // Stores the class name used for a 'selected' item.\n public selectedClass:string;\n\n @ContentChild(forwardRef(() => SuiDropdownMenu))\n public childDropdownMenu:SuiDropdownMenu;\n\n public get hasChildDropdown():boolean {\n return !!this.childDropdownMenu;\n }\n\n constructor(private _renderer:Renderer2, public element:ElementRef) {\n this.isSelected = false;\n\n this.selectedClass = \"selected\";\n }\n\n public performClick():void {\n // Using directly because Renderer2 doesn't have invokeElementMethod method anymore.\n this.element.nativeElement.click();\n }\n}\n\n@Directive({\n selector: \"[suiDropdownMenu]\"\n})\nexport class SuiDropdownMenu extends SuiTransition implements AfterContentInit, OnDestroy {\n private _service:DropdownService;\n private _transitionController:TransitionController;\n\n @Input()\n public menuTransition:string;\n\n @Input()\n public menuTransitionDuration:number;\n\n public get service():DropdownService {\n return this._service;\n }\n\n public set service(value:DropdownService) {\n this._service = value;\n\n let previousIsOpen = this._service.isOpen;\n this._service.isOpenChange.subscribe((isOpen:boolean) => {\n if (isOpen !== previousIsOpen) {\n // Only run transitions if the open state has changed.\n this._transitionController.stopAll();\n this._transitionController.animate(\n new Transition(\n this.menuTransition,\n this.menuTransitionDuration,\n TransitionDirection.Either,\n () => this._service.isAnimating = false));\n }\n\n if (!isOpen) {\n // Reset the item selections when a nested item is selected to avoid incosistent open states.\n if (this.selectedItems.length > 1) {\n this.resetSelection();\n }\n }\n\n previousIsOpen = isOpen;\n });\n }\n\n @ContentChildren(SuiDropdownMenuItem)\n private _itemsQueryInternal:QueryList;\n\n private _itemsQueryOverride:QueryList;\n\n public set items(items:QueryList) {\n this._itemsQueryOverride = items;\n }\n\n private get _itemsQuery():QueryList {\n return this._itemsQueryOverride || this._itemsQueryInternal;\n }\n\n // Get the list of items, ignoring those that are disabled.\n private get _items():SuiDropdownMenuItem[] {\n return this._itemsQuery.filter(i => !i.isDisabled);\n }\n\n // Stack that keeps track of the currently selected item.\n // Selected items lower in the stack are necessarily the parent of the item one higher.\n public selectedItems:SuiDropdownMenuItem[];\n\n // Sets whether or not to automatically select the 1st item when the dropdown is opened.\n @Input()\n public menuAutoSelectFirst:boolean;\n\n @Input()\n public menuSelectedItemClass:string;\n\n private _documentKeyDownListener:() => void;\n\n constructor(renderer:Renderer2, public element:ElementRef, changeDetector:ChangeDetectorRef) {\n super(renderer, element, changeDetector);\n\n // Initialise transition functionality.\n this._transitionController = new TransitionController(false);\n this.setTransitionController(this._transitionController);\n\n this.menuTransition = \"slide down\";\n this.menuTransitionDuration = 200;\n\n this.menuAutoSelectFirst = false;\n this.menuSelectedItemClass = \"selected\";\n\n this._documentKeyDownListener = renderer.listen(\"document\", \"keydown\", (e:KeyboardEvent) => this.onDocumentKeyDown(e));\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(e:HandledEvent & MouseEvent):void {\n if (!e.eventHandled) {\n e.eventHandled = true;\n\n if (this._service.autoCloseMode === DropdownAutoCloseType.ItemClick) {\n const target = e.target as IAugmentedElement;\n if (this.element.nativeElement.contains(target.closest(\".item\")) && !/input|textarea/i.test(target.tagName)) {\n // Once an item is selected, we can close the entire dropdown.\n this._service.setOpenState(false, true);\n }\n }\n }\n }\n\n public onDocumentKeyDown(e:KeyboardEvent):void {\n // Only the root dropdown (i.e. not nested dropdowns) is responsible for keeping track of the currently selected item.\n if (this._service.isOpen && !this._service.isNested) {\n // Stop document events like scrolling while open.\n const target = e.target as Element;\n if (!/input/i.test(target.tagName) &&\n [KeyCode.Escape, KeyCode.Enter, KeyCode.Up, KeyCode.Down, KeyCode.Left, KeyCode.Right].find(kC => kC === e.keyCode)) {\n e.preventDefault();\n }\n\n // Gets the top selected item from the stack.\n const [selected] = this.selectedItems.slice(-1);\n // Keeping track of the menu containing the currently selected element allows us to easily determine its siblings.\n let selectedContainer:SuiDropdownMenu = this;\n if (this.selectedItems.length >= 2) {\n const [selectedParent] = this.selectedItems.slice(-2);\n selectedContainer = selectedParent.childDropdownMenu;\n }\n\n switch (e.keyCode) {\n // Escape : close the entire dropdown.\n case KeyCode.Escape: {\n this._service.setOpenState(false);\n break;\n }\n // Down : select the next item below the current one, or the 1st if none selected.\n case KeyCode.Down:\n // Up : select the next item above the current one, or the 1st if none selected.\n case KeyCode.Up: {\n this.selectedItems.pop();\n this.selectedItems.push(selectedContainer.updateSelection(selected, e.keyCode));\n // Prevent default regardless of whether we are in an input, to stop jumping to the start or end of the query string.\n e.preventDefault();\n break;\n }\n // Enter : if the item doesn't contain a nested dropdown, 'click' it. Otherwise, fall through to 'Right' action.\n case KeyCode.Enter: {\n if (selected && !selected.hasChildDropdown) {\n selected.performClick();\n break;\n }\n }\n // falls through\n // Right : if the selected item contains a nested dropdown, open the dropdown & select the 1st item.\n case KeyCode.Right: {\n if (selected && selected.hasChildDropdown) {\n selected.childDropdownMenu.service.setOpenState(true);\n\n this.selectedItems.push(selected.childDropdownMenu.updateSelection(selected, e.keyCode));\n }\n break;\n }\n // Left : if the selected item is in a nested dropdown, close it and select the containing item.\n case KeyCode.Left: {\n if (this.selectedItems.length >= 2) {\n this.selectedItems.pop();\n const [selectedParent] = this.selectedItems.slice(-1);\n\n selectedParent.childDropdownMenu.service.setOpenState(false);\n selectedParent.isSelected = true;\n }\n break;\n }\n }\n }\n }\n\n public resetSelection():void {\n this.selectedItems = [];\n this._items.forEach(i => {\n i.selectedClass = this.menuSelectedItemClass;\n i.isSelected = false;\n });\n\n if (this.menuAutoSelectFirst && this._items.length > 0) {\n // Autoselect 1st item if required & possible.\n this._items[0].isSelected = true;\n this.scrollToItem(this._items[0]);\n this.selectedItems.push(this._itemsQuery.first);\n }\n }\n\n // Determines the item to next be selected, based on the keyboard input & the currently selected item.\n public updateSelection(selectedItem:SuiDropdownMenuItem, keyCode:KeyCode):SuiDropdownMenuItem {\n if (selectedItem) {\n // Remove the selected status on the previously selected item.\n selectedItem.isSelected = false;\n }\n\n let selectedIndex = this._items\n .findIndex(i => i === selectedItem);\n\n let newSelection:SuiDropdownMenuItem;\n\n switch (keyCode) {\n case KeyCode.Enter:\n case KeyCode.Right:\n case KeyCode.Down:\n selectedIndex += 1;\n break;\n case KeyCode.Up:\n if (selectedIndex === -1) {\n // If none are selected, select the 1st item. Should this be `this.items.last - 1`?\n selectedIndex = 0;\n break;\n }\n\n selectedIndex -= 1;\n break;\n }\n\n // Select the item at the updated index. The || is to stop us selecting past the start or end of the item list.\n newSelection = this._items[selectedIndex] || selectedItem;\n\n if (newSelection) {\n // Set the selected status on the newly selected item.\n newSelection.isSelected = true;\n\n // Set the current scroll position to the location of the newly selected item.\n this.scrollToItem(newSelection);\n }\n\n return newSelection;\n }\n\n public scrollToItem(item:SuiDropdownMenuItem):void {\n const menu:Element = this.element.nativeElement;\n const selectedRect:ClientRect = item.element.nativeElement.getBoundingClientRect();\n\n const menuRect = menu.getBoundingClientRect();\n\n let scrollAmount = 0;\n\n if (selectedRect.bottom > menuRect.bottom) {\n scrollAmount = selectedRect.bottom - menuRect.bottom;\n }\n\n if (selectedRect.top < menuRect.top) {\n scrollAmount = selectedRect.top - menuRect.top;\n }\n\n menu.scrollTop += Math.round(scrollAmount);\n }\n\n public ngAfterContentInit():void {\n this.onItemsChanged();\n this._itemsQuery.changes.subscribe(() => this.onItemsChanged());\n }\n\n private onItemsChanged():void {\n // We use `_items` rather than `items` in case one or more have become disabled.\n this.resetSelection();\n }\n\n public ngOnDestroy():void {\n this._documentKeyDownListener();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown-menu.metadata.json b/dist/modules/dropdown/directives/dropdown-menu.metadata.json deleted file mode 100644 index 641e72ae7..000000000 --- a/dist/modules/dropdown/directives/dropdown-menu.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiDropdownMenuItem":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":10,"character":1},"arguments":[{"selector":".item"}]}],"members":{"childDropdownMenu":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":39,"character":5},"arguments":[{"__symbolic":"reference","name":"SuiDropdownMenu"}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":46,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":46,"character":60}]}],"performClick":[{"__symbolic":"method"}]}},"SuiDropdownMenu":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../transition/index","name":"SuiTransition","line":61,"character":37},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":58,"character":1},"arguments":[{"selector":"[suiDropdownMenu]"}]}],"members":{"menuTransition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":65,"character":5}}]}],"menuTransitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":5}}]}],"_itemsQueryInternal":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":102,"character":5},"arguments":[{"__symbolic":"reference","name":"SuiDropdownMenuItem"}]}]}],"menuAutoSelectFirst":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":125,"character":5}}]}],"menuSelectedItemClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":128,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":46,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":46,"character":60},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":133,"character":78}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":149,"character":5},"arguments":["click",["$event"]]}]}],"onDocumentKeyDown":[{"__symbolic":"method"}],"resetSelection":[{"__symbolic":"method"}],"updateSelection":[{"__symbolic":"method"}],"scrollToItem":[{"__symbolic":"method"}],"ngAfterContentInit":[{"__symbolic":"method"}],"onItemsChanged":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown.d.ts b/dist/modules/dropdown/directives/dropdown.d.ts deleted file mode 100644 index e192706e5..000000000 --- a/dist/modules/dropdown/directives/dropdown.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { EventEmitter, AfterContentInit, ElementRef } from "@angular/core"; -import { HandledEvent } from "../../../misc/util/index"; -import { DropdownService, DropdownAutoCloseType } from "../services/dropdown.service"; -export declare class SuiDropdown implements AfterContentInit { - private _element; - service: DropdownService; - private _menu; - private _children; - readonly children: SuiDropdown[]; - readonly isOpenChange: EventEmitter; - readonly isActive: boolean; - isOpen: boolean; - isDisabled: boolean; - private _tabIndex?; - readonly tabIndex: number | undefined; - autoClose: DropdownAutoCloseType; - constructor(_element: ElementRef); - ngAfterContentInit(): void; - private childrenUpdated(); - onClick(e: HandledEvent): void; - private onFocusOut(e); - onKeypress(e: HandledEvent & KeyboardEvent): void; - private externallyClose(); -} diff --git a/dist/modules/dropdown/directives/dropdown.js b/dist/modules/dropdown/directives/dropdown.js deleted file mode 100644 index 059583d6a..000000000 --- a/dist/modules/dropdown/directives/dropdown.js +++ /dev/null @@ -1,157 +0,0 @@ -import { Directive, Input, HostBinding, EventEmitter, Output, ContentChild, ElementRef, HostListener, QueryList, ContentChildren } from "@angular/core"; -import { HandledEvent, KeyCode } from "../../../misc/util/index"; -import { DropdownService, DropdownAutoCloseType } from "../services/dropdown.service"; -import { SuiDropdownMenu } from "./dropdown-menu"; -var SuiDropdown = /** @class */ (function () { - function SuiDropdown(_element) { - var _this = this; - this._element = _element; - this.service = new DropdownService(); - this.service.isOpenChange.subscribe(function () { - if (_this.service.isOpen) { - _this._element.nativeElement.focus(); - } - }); - } - Object.defineProperty(SuiDropdown.prototype, "children", { - get: function () { - var _this = this; - // @ContentChildren includes the current element by default. - return this._children.filter(function (c) { return c !== _this; }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "isOpenChange", { - get: function () { - return this.service.isOpenChange; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "isActive", { - get: function () { - // This is to ensure nested dropdowns don't get made bold. - return this.service.isOpen && !this.service.isNested; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "isOpen", { - get: function () { - return this.service.isOpen; - }, - set: function (value) { - // If we are opening the dropdown, we want to always open its parents. - this.service.setOpenState(value, !!value); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "isDisabled", { - get: function () { - return this.service.isDisabled; - }, - set: function (value) { - this.service.setDisabledState(value); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "tabIndex", { - get: function () { - if (this.isDisabled || this.service.isNested) { - // If disabled, remove from tabindex. - return undefined; - } - if (this._tabIndex != undefined) { - // If custom tabindex, default to that. - return this._tabIndex; - } - // Otherwise, return default of 0. - return 0; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiDropdown.prototype, "autoClose", { - get: function () { - return this.service.autoCloseMode; - }, - set: function (value) { - this.service.autoCloseMode = value; - }, - enumerable: true, - configurable: true - }); - SuiDropdown.prototype.ngAfterContentInit = function () { - var _this = this; - if (!this._menu) { - throw new Error("You must set [suiDropdownMenu] on the menu element."); - } - this._menu.service = this.service; - this.childrenUpdated(); - this._children.changes - .subscribe(function () { return _this.childrenUpdated(); }); - }; - SuiDropdown.prototype.childrenUpdated = function () { - var _this = this; - // Reregister child dropdowns each time the menu content changes. - this.children - .map(function (c) { return c.service; }) - .forEach(function (s) { return _this.service.registerChild(s); }); - }; - SuiDropdown.prototype.onClick = function (e) { - if (!e.eventHandled) { - e.eventHandled = true; - this.service.toggleOpenState(); - } - }; - SuiDropdown.prototype.onFocusOut = function (e) { - if (!this._element.nativeElement.contains(e.relatedTarget)) { - this.externallyClose(); - } - }; - SuiDropdown.prototype.onKeypress = function (e) { - // Block the keyboard event from being fired on parent dropdowns. - if (!e.eventHandled) { - if (e.keyCode === KeyCode.Enter) { - e.eventHandled = true; - this.service.setOpenState(true); - } - } - }; - SuiDropdown.prototype.externallyClose = function () { - if (this.service.autoCloseMode === DropdownAutoCloseType.ItemClick || - this.service.autoCloseMode === DropdownAutoCloseType.OutsideClick) { - // No need to reflect in parent since they are also bound to document. - this.service.setOpenState(false); - } - }; - SuiDropdown.decorators = [ - { type: Directive, args: [{ - selector: "[suiDropdown]" - },] }, - ]; - /** @nocollapse */ - SuiDropdown.ctorParameters = function () { return [ - { type: ElementRef, }, - ]; }; - SuiDropdown.propDecorators = { - "_menu": [{ type: ContentChild, args: [SuiDropdownMenu,] },], - "_children": [{ type: ContentChildren, args: [SuiDropdown, { descendants: true },] },], - "isOpenChange": [{ type: Output },], - "isActive": [{ type: HostBinding, args: ["class.active",] },], - "isOpen": [{ type: Input },], - "isDisabled": [{ type: HostBinding, args: ["class.disabled",] }, { type: Input },], - "_tabIndex": [{ type: Input, args: ["tabindex",] },], - "tabIndex": [{ type: HostBinding, args: ["attr.tabindex",] },], - "autoClose": [{ type: Input },], - "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], - "onFocusOut": [{ type: HostListener, args: ["focusout", ["$event"],] },], - "onKeypress": [{ type: HostListener, args: ["keypress", ["$event"],] },], - }; - return SuiDropdown; -}()); -export { SuiDropdown }; -//# sourceMappingURL=dropdown.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown.js.map b/dist/modules/dropdown/directives/dropdown.js.map deleted file mode 100644 index 903ef5f39..000000000 --- a/dist/modules/dropdown/directives/dropdown.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../../src/modules/dropdown/directives/dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAoB,YAAY,EACnF,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EACvD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,OAAO,EAAe,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;;IA4E9C,qBAAoB,QAAmB;QAAvC,iBAOC;QAPmB,aAAQ,GAAR,QAAQ,CAAW;QACnC,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC;YAChC,EAAE,CAAC,CAAC,KAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;gBACtB,KAAI,CAAC,QAAQ,C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9B,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC;gBAEtB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;aACnC;SACJ;;IAGG,qCAAe,GAAvB;QACI,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,KAAK,qBAAqB,CAAC,SAAS;YAC1D,IAAI,CAAC,OAAO,CAAC,aAAa,KAAK,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC;;YAExE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;SACpC;KACJ;;gBAxIJ,SAAS,SAAC;oBACP,QAAQ,EAAE,eAAe;iBAC5B;;;;gBARG,UAAU;;;0BAYT,YAAY,SAAC,eAAe;8BAG5B,eAAe,SAAC,WAAW,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;iCAQlD,MAAM;6BAKN,WAAW,SAAC,cAAc;2BAM1B,KAAK;+BAUL,WAAW,SAAC,gBAAgB,cAC5B,KAAK;8BASL,KAAK,SAAC,UAAU;6BAGhB,WAAW,SAAC,eAAe;8BAc3B,KAAK;4BAoCL,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;+BAShC,YAAY,SAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;+BAOnC,YAAY,SAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;sBA7HxC;;SAWa,WAAW","sourcesContent":["import {\n Directive, Input, HostBinding, EventEmitter, Output, AfterContentInit, ContentChild,\n ElementRef, HostListener, QueryList, ContentChildren\n} from \"@angular/core\";\nimport { HandledEvent, KeyCode, IFocusEvent } from \"../../../misc/util/index\";\nimport { DropdownService, DropdownAutoCloseType } from \"../services/dropdown.service\";\nimport { SuiDropdownMenu } from \"./dropdown-menu\";\n\n@Directive({\n selector: \"[suiDropdown]\"\n})\nexport class SuiDropdown implements AfterContentInit {\n public service:DropdownService;\n\n @ContentChild(SuiDropdownMenu)\n private _menu:SuiDropdownMenu;\n\n @ContentChildren(SuiDropdown, { descendants: true })\n private _children:QueryList;\n\n public get children():SuiDropdown[] {\n // @ContentChildren includes the current element by default.\n return this._children.filter(c => c !== this);\n }\n\n @Output()\n public get isOpenChange():EventEmitter {\n return this.service.isOpenChange;\n }\n\n @HostBinding(\"class.active\")\n public get isActive():boolean {\n // This is to ensure nested dropdowns don't get made bold.\n return this.service.isOpen && !this.service.isNested;\n }\n\n @Input()\n public get isOpen():boolean {\n return this.service.isOpen;\n }\n\n public set isOpen(value:boolean) {\n // If we are opening the dropdown, we want to always open its parents.\n this.service.setOpenState(value, !!value);\n }\n\n @HostBinding(\"class.disabled\")\n @Input()\n public get isDisabled():boolean {\n return this.service.isDisabled;\n }\n\n public set isDisabled(value:boolean) {\n this.service.setDisabledState(value);\n }\n\n @Input(\"tabindex\")\n private _tabIndex?:number;\n\n @HostBinding(\"attr.tabindex\")\n public get tabIndex():number | undefined {\n if (this.isDisabled || this.service.isNested) {\n // If disabled, remove from tabindex.\n return undefined;\n }\n if (this._tabIndex != undefined) {\n // If custom tabindex, default to that.\n return this._tabIndex;\n }\n // Otherwise, return default of 0.\n return 0;\n }\n\n @Input()\n public get autoClose():DropdownAutoCloseType {\n return this.service.autoCloseMode;\n }\n\n public set autoClose(value:DropdownAutoCloseType) {\n this.service.autoCloseMode = value;\n }\n\n constructor(private _element:ElementRef) {\n this.service = new DropdownService();\n this.service.isOpenChange.subscribe(() => {\n if (this.service.isOpen) {\n this._element.nativeElement.focus();\n }\n });\n }\n\n public ngAfterContentInit():void {\n if (!this._menu) {\n throw new Error(\"You must set [suiDropdownMenu] on the menu element.\");\n }\n this._menu.service = this.service;\n\n this.childrenUpdated();\n this._children.changes\n .subscribe(() => this.childrenUpdated());\n }\n\n private childrenUpdated():void {\n // Reregister child dropdowns each time the menu content changes.\n this.children\n .map(c => c.service)\n .forEach(s => this.service.registerChild(s));\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(e:HandledEvent):void {\n if (!e.eventHandled) {\n e.eventHandled = true;\n\n this.service.toggleOpenState();\n }\n }\n\n @HostListener(\"focusout\", [\"$event\"])\n private onFocusOut(e:IFocusEvent):void {\n if (!this._element.nativeElement.contains(e.relatedTarget)) {\n this.externallyClose();\n }\n }\n\n @HostListener(\"keypress\", [\"$event\"])\n public onKeypress(e:HandledEvent & KeyboardEvent):void {\n // Block the keyboard event from being fired on parent dropdowns.\n if (!e.eventHandled) {\n\n if (e.keyCode === KeyCode.Enter) {\n e.eventHandled = true;\n\n this.service.setOpenState(true);\n }\n }\n }\n\n private externallyClose():void {\n if (this.service.autoCloseMode === DropdownAutoCloseType.ItemClick ||\n this.service.autoCloseMode === DropdownAutoCloseType.OutsideClick) {\n // No need to reflect in parent since they are also bound to document.\n this.service.setOpenState(false);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/directives/dropdown.metadata.json b/dist/modules/dropdown/directives/dropdown.metadata.json deleted file mode 100644 index 10fccbf4e..000000000 --- a/dist/modules/dropdown/directives/dropdown.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiDropdown":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":8,"character":1},"arguments":[{"selector":"[suiDropdown]"}]}],"members":{"_menu":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":14,"character":5},"arguments":[{"__symbolic":"reference","module":"./dropdown-menu","name":"SuiDropdownMenu","line":14,"character":18}]}]}],"_children":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":17,"character":5},"arguments":[{"__symbolic":"reference","name":"SuiDropdown"},{"descendants":true}]}]}],"isOpenChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":25,"character":5}}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":30,"character":5},"arguments":["class.active"]}]}],"isOpen":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":5}}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":46,"character":5},"arguments":["class.disabled"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":5}}]}],"_tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":56,"character":5},"arguments":["tabindex"]}]}],"tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":59,"character":5},"arguments":["attr.tabindex"]}]}],"autoClose":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":82,"character":33}]}],"ngAfterContentInit":[{"__symbolic":"method"}],"childrenUpdated":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":109,"character":5},"arguments":["click",["$event"]]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":118,"character":5},"arguments":["focusout",["$event"]]}]}],"onKeypress":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":125,"character":5},"arguments":["keypress",["$event"]]}]}],"externallyClose":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/dropdown/dropdown.module.d.ts b/dist/modules/dropdown/dropdown.module.d.ts deleted file mode 100644 index 5f1d02c44..000000000 --- a/dist/modules/dropdown/dropdown.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiDropdownModule { -} diff --git a/dist/modules/dropdown/dropdown.module.js b/dist/modules/dropdown/dropdown.module.js deleted file mode 100644 index e3c2fcb09..000000000 --- a/dist/modules/dropdown/dropdown.module.js +++ /dev/null @@ -1,32 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiTransitionModule } from "../transition/index"; -import { SuiDropdown } from "./directives/dropdown"; -import { SuiDropdownMenu, SuiDropdownMenuItem } from "./directives/dropdown-menu"; -var SuiDropdownModule = /** @class */ (function () { - function SuiDropdownModule() { - } - SuiDropdownModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule, - SuiTransitionModule - ], - declarations: [ - SuiDropdown, - SuiDropdownMenu, - SuiDropdownMenuItem - ], - exports: [ - SuiDropdown, - SuiDropdownMenu, - SuiDropdownMenuItem - ] - },] }, - ]; - /** @nocollapse */ - SuiDropdownModule.ctorParameters = function () { return []; }; - return SuiDropdownModule; -}()); -export { SuiDropdownModule }; -//# sourceMappingURL=dropdown.module.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/dropdown.module.js.map b/dist/modules/dropdown/dropdown.module.js.map deleted file mode 100644 index 99513d61d..000000000 --- a/dist/modules/dropdown/dropdown.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dropdown.module.js","sourceRoot":"","sources":["../../../src/modules/dropdown/dropdown.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;;;;;gBAEjF,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,mBAAmB;qBACtB;oBACD,YAAY,EAAE;wBACV,WAAW;wBACX,eAAe;wBACf,mBAAmB;qBACtB;oBACD,OAAO,EAAE;wBACL,WAAW;wBACX,eAAe;wBACf,mBAAmB;qBACtB;iBACJ;;;;4BArBD;;SAsBa,iBAAiB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTransitionModule } from \"../transition/index\";\nimport { SuiDropdown } from \"./directives/dropdown\";\nimport { SuiDropdownMenu, SuiDropdownMenuItem } from \"./directives/dropdown-menu\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiTransitionModule\n ],\n declarations: [\n SuiDropdown,\n SuiDropdownMenu,\n SuiDropdownMenuItem\n ],\n exports: [\n SuiDropdown,\n SuiDropdownMenu,\n SuiDropdownMenuItem\n ]\n})\nexport class SuiDropdownModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/dropdown.module.metadata.json b/dist/modules/dropdown/dropdown.module.metadata.json deleted file mode 100644 index aa1969740..000000000 --- a/dist/modules/dropdown/dropdown.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiDropdownModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":8},{"__symbolic":"reference","module":"../transition/index","name":"SuiTransitionModule","line":9,"character":8}],"declarations":[{"__symbolic":"reference","module":"./directives/dropdown","name":"SuiDropdown","line":12,"character":8},{"__symbolic":"reference","module":"./directives/dropdown-menu","name":"SuiDropdownMenu","line":13,"character":8},{"__symbolic":"reference","module":"./directives/dropdown-menu","name":"SuiDropdownMenuItem","line":14,"character":8}],"exports":[{"__symbolic":"reference","module":"./directives/dropdown","name":"SuiDropdown","line":17,"character":8},{"__symbolic":"reference","module":"./directives/dropdown-menu","name":"SuiDropdownMenu","line":18,"character":8},{"__symbolic":"reference","module":"./directives/dropdown-menu","name":"SuiDropdownMenuItem","line":19,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/dropdown/index.d.ts b/dist/modules/dropdown/index.d.ts deleted file mode 100644 index 1f5a3dac0..000000000 --- a/dist/modules/dropdown/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./directives/dropdown-menu"; -export * from "./directives/dropdown"; -export * from "./services/dropdown.service"; -export * from "./dropdown.module"; diff --git a/dist/modules/dropdown/index.js b/dist/modules/dropdown/index.js deleted file mode 100644 index 1e99740fb..000000000 --- a/dist/modules/dropdown/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./directives/dropdown-menu"; -export * from "./directives/dropdown"; -export * from "./services/dropdown.service"; -export * from "./dropdown.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/index.js.map b/dist/modules/dropdown/index.js.map deleted file mode 100644 index 69b0b0a73..000000000 --- a/dist/modules/dropdown/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/dropdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AAEtC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./directives/dropdown-menu\";\nexport * from \"./directives/dropdown\";\n\nexport * from \"./services/dropdown.service\";\n\nexport * from \"./dropdown.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/index.metadata.json b/dist/modules/dropdown/index.metadata.json deleted file mode 100644 index f6781a9e4..000000000 --- a/dist/modules/dropdown/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./directives/dropdown-menu"},{"from":"./directives/dropdown"},{"from":"./services/dropdown.service"},{"from":"./dropdown.module"}]}] \ No newline at end of file diff --git a/dist/modules/dropdown/public.d.ts b/dist/modules/dropdown/public.d.ts deleted file mode 100644 index 9c71a37b2..000000000 --- a/dist/modules/dropdown/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiDropdownModule, DropdownAutoCloseType } from "./index"; diff --git a/dist/modules/dropdown/public.js b/dist/modules/dropdown/public.js deleted file mode 100644 index 9c76ef77e..000000000 --- a/dist/modules/dropdown/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiDropdownModule, DropdownAutoCloseType } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/public.js.map b/dist/modules/dropdown/public.js.map deleted file mode 100644 index 36ff1a80f..000000000 --- a/dist/modules/dropdown/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/dropdown/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,qBAAqB,EACxB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiDropdownModule,\n DropdownAutoCloseType\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/public.metadata.json b/dist/modules/dropdown/public.metadata.json deleted file mode 100644 index 8de249cb2..000000000 --- a/dist/modules/dropdown/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiDropdownModule","DropdownAutoCloseType"]}]}] \ No newline at end of file diff --git a/dist/modules/dropdown/services/dropdown.service.d.ts b/dist/modules/dropdown/services/dropdown.service.d.ts deleted file mode 100644 index 24444ed3f..000000000 --- a/dist/modules/dropdown/services/dropdown.service.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { EventEmitter } from "@angular/core"; -export declare type DropdownAutoCloseType = "itemClick" | "outsideClick" | "disabled"; -export declare const DropdownAutoCloseType: { - ItemClick: DropdownAutoCloseType; - OutsideClick: DropdownAutoCloseType; - Disabled: DropdownAutoCloseType; -}; -export declare class DropdownService { - isOpen: boolean; - isAnimating: boolean; - isOpenChange: EventEmitter; - isDisabled: boolean; - autoCloseMode: DropdownAutoCloseType; - parent?: DropdownService; - children: DropdownService[]; - readonly isNested: boolean; - constructor(autoCloseMode?: DropdownAutoCloseType); - setOpenState(isOpen: boolean, reflectInParent?: boolean): void; - setDisabledState(isDisabled: boolean): void; - toggleOpenState(): void; - registerChild(child: DropdownService): void; - isChildRegistered(child: DropdownService): boolean; - clearChildren(): void; - private delay(callback); -} diff --git a/dist/modules/dropdown/services/dropdown.service.js b/dist/modules/dropdown/services/dropdown.service.js deleted file mode 100644 index b08d24fd2..000000000 --- a/dist/modules/dropdown/services/dropdown.service.js +++ /dev/null @@ -1,100 +0,0 @@ -import { EventEmitter } from "@angular/core"; -// Creates essentially a 'string' enum. -export var DropdownAutoCloseType = { - ItemClick: "itemClick", - OutsideClick: "outsideClick", - Disabled: "disabled" -}; -var DropdownService = /** @class */ (function () { - function DropdownService(autoCloseMode) { - if (autoCloseMode === void 0) { autoCloseMode = DropdownAutoCloseType.ItemClick; } - this.isOpen = false; - this.isOpenChange = new EventEmitter(); - this.isDisabled = false; - this.autoCloseMode = autoCloseMode; - this.children = []; - } - Object.defineProperty(DropdownService.prototype, "isNested", { - get: function () { - return !!this.parent; - }, - enumerable: true, - configurable: true - }); - DropdownService.prototype.setOpenState = function (isOpen, reflectInParent) { - var _this = this; - if (reflectInParent === void 0) { reflectInParent = false; } - if (this.isOpen !== isOpen && !this.isDisabled) { - // Only update the state if it has changed, and the dropdown isn't disabled. - this.isOpen = !!isOpen; - this.isAnimating = true; - // We must delay the emitting to avoid the 'changed after checked' Angular errors. - this.delay(function () { return _this.isOpenChange.emit(_this.isOpen); }); - if (!this.isOpen) { - // Close the child dropdowns when this one closes. - this.children.forEach(function (c) { return c.setOpenState(_this.isOpen); }); - } - if (this.parent && reflectInParent) { - // Open the parent dropdowns when this one opens. - this.parent.setOpenState(this.isOpen, true); - } - } - else if (this.isOpen !== isOpen && this.isDisabled) { - // If the state has changed, but the dropdown is disabled, re-emit the original isOpen value. - this.delay(function () { return _this.isOpenChange.emit(_this.isOpen); }); - } - }; - DropdownService.prototype.setDisabledState = function (isDisabled) { - if (this.isDisabled !== isDisabled) { - if (!!isDisabled) { - // Close the dropdown as it is now disabled - this.setOpenState(false); - } - this.isDisabled = !!isDisabled; - } - }; - DropdownService.prototype.toggleOpenState = function () { - this.setOpenState(!this.isOpen); - }; - // Registers a dropdown service as a child of this service. - // Registers a dropdown service as a child of this service. - DropdownService.prototype.registerChild = - // Registers a dropdown service as a child of this service. - function (child) { - if (!this.isChildRegistered(child)) { - this.children.push(child); - child.parent = this; - } - }; - // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. - // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. - DropdownService.prototype.isChildRegistered = - // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child. - function (child) { - return this === child || !!this.children - .find(function (c) { - return !!c.children - .find(function (cChild) { return cChild.isChildRegistered(child); }); - }); - }; - // Wipes any nested data, so all services can be cleanly reattached. - // Wipes any nested data, so all services can be cleanly reattached. - DropdownService.prototype.clearChildren = - // Wipes any nested data, so all services can be cleanly reattached. - function () { - this.children.forEach(function (c) { - c.parent = undefined; - }); - this.children = []; - }; - // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. - // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. - DropdownService.prototype.delay = - // Method for delaying an event into the next tick, to avoid Angular "changed after checked" error. - function (callback) { - setTimeout(function () { return callback(); }); - }; - return DropdownService; -}()); -export { DropdownService }; -//# sourceMappingURL=dropdown.service.js.map \ No newline at end of file diff --git a/dist/modules/dropdown/services/dropdown.service.js.map b/dist/modules/dropdown/services/dropdown.service.js.map deleted file mode 100644 index 14581213a..000000000 --- a/dist/modules/dropdown/services/dropdown.service.js.map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MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ;aACnC,IAAI,CAAC,UAAA,CAAC;YAAI,OAAA,CAAC,CAAC,CAAC,CAAC,QAAQ;iBAClB,IAAI,CAAC,UAAA,MAAM,IAAI,OAAA,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAA/B,CAA+B,CAAC;QADzC,CACyC,CAAC,CAAC;KAC7D;IAED,oEAAoE;;IAC7D,uCAAa;;IAApB;QACI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,CAAC;YACnB,CAAC,CAAC,MAAM,GAAG,SAAS,CAAC;SACxB,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;KACtB;IAED,mGAAmG;;IAC3F,+BAAK;;IAAb,UAAc,QAAmB;QAC7B,UAAU,CAAC,cAAM,OAAA,QAAQ,EAAE,EAAV,CAAU,CAAC,CAAC;KAChC;0BA3GL;IA4GC,CAAA;AAjGD,2BAiGC","sourcesContent":["import { EventEmitter } from \"@angular/core\";\n\nexport type DropdownAutoCloseType = \"itemClick\" | \"outsideClick\" | \"disabled\";\n\n// Creates essentially a 'string' enum.\nexport const DropdownAutoCloseType = {\n ItemClick: \"itemClick\" as DropdownAutoCloseType,\n OutsideClick: \"outsideClick\" as DropdownAutoCloseType,\n Disabled: \"disabled\" as DropdownAutoCloseType\n};\n\nexport class DropdownService {\n // Open state of the dropdown\n public isOpen:boolean;\n // Animating state of the dropdown.\n public isAnimating:boolean;\n // Emitter for when dropdown open state changes.\n public isOpenChange:EventEmitter;\n\n public isDisabled:boolean;\n\n // Sets the \"autoclose\" mode of the dropdown - i.e. what user action causes it to autoclose.\n public autoCloseMode:DropdownAutoCloseType;\n\n // Keep track of the containing dropdown so we can open it as necessary.\n public parent?:DropdownService;\n // Also keep track of dropdowns nested in this one so we can close them as necessary.\n public children:DropdownService[];\n public get isNested():boolean {\n return !!this.parent;\n }\n\n constructor(autoCloseMode:DropdownAutoCloseType = DropdownAutoCloseType.ItemClick) {\n this.isOpen = false;\n this.isOpenChange = new EventEmitter();\n\n this.isDisabled = false;\n\n this.autoCloseMode = autoCloseMode;\n\n this.children = [];\n }\n\n public setOpenState(isOpen:boolean, reflectInParent:boolean = false):void {\n if (this.isOpen !== isOpen && !this.isDisabled) {\n // Only update the state if it has changed, and the dropdown isn't disabled.\n this.isOpen = !!isOpen;\n this.isAnimating = true;\n // We must delay the emitting to avoid the 'changed after checked' Angular errors.\n this.delay(() => this.isOpenChange.emit(this.isOpen));\n\n if (!this.isOpen) {\n // Close the child dropdowns when this one closes.\n this.children.forEach(c => c.setOpenState(this.isOpen));\n }\n\n if (this.parent && reflectInParent) {\n // Open the parent dropdowns when this one opens.\n this.parent.setOpenState(this.isOpen, true);\n }\n } else if (this.isOpen !== isOpen && this.isDisabled) {\n // If the state has changed, but the dropdown is disabled, re-emit the original isOpen value.\n this.delay(() => this.isOpenChange.emit(this.isOpen));\n }\n }\n\n public setDisabledState(isDisabled:boolean):void {\n if (this.isDisabled !== isDisabled) {\n if (!!isDisabled) {\n // Close the dropdown as it is now disabled\n this.setOpenState(false);\n }\n\n this.isDisabled = !!isDisabled;\n }\n }\n\n public toggleOpenState():void {\n this.setOpenState(!this.isOpen);\n }\n\n // Registers a dropdown service as a child of this service.\n public registerChild(child:DropdownService):void {\n if (!this.isChildRegistered(child)) {\n this.children.push(child);\n child.parent = this;\n }\n }\n\n // Recursive method to check if the provided dropdown is already registered as a child, or is a descendant of a child.\n public isChildRegistered(child:DropdownService):boolean {\n return this === child || !!this.children\n .find(c => !!c.children\n .find(cChild => cChild.isChildRegistered(child)));\n }\n\n // Wipes any nested data, so all services can be cleanly reattached.\n public clearChildren():void {\n this.children.forEach(c => {\n c.parent = undefined;\n });\n this.children = [];\n }\n\n // Method for delaying an event into the next tick, to avoid Angular \"changed after checked\" error.\n private delay(callback:() => void):void {\n setTimeout(() => callback());\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/dropdown/services/dropdown.service.metadata.json b/dist/modules/dropdown/services/dropdown.service.metadata.json deleted file mode 100644 index e1684c318..000000000 --- a/dist/modules/dropdown/services/dropdown.service.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"DropdownAutoCloseType":{"ItemClick":"itemClick","OutsideClick":"outsideClick","Disabled":"disabled"},"DropdownService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":32,"character":30,"context":{"typeName":"DropdownAutoCloseType"}}]}],"setOpenState":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}],"toggleOpenState":[{"__symbolic":"method"}],"registerChild":[{"__symbolic":"method"}],"isChildRegistered":[{"__symbolic":"method"}],"clearChildren":[{"__symbolic":"method"}],"delay":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/index.d.ts b/dist/modules/index.d.ts deleted file mode 100644 index 7758999cc..000000000 --- a/dist/modules/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export * from "./accordion/index"; -export * from "./checkbox/index"; -export * from "./collapse/index"; -export * from "./datepicker/index"; -export * from "./dimmer/index"; -export * from "./dropdown/index"; -export * from "./modal/index"; -export * from "./popup/index"; -export * from "./progress/index"; -export * from "./rating/index"; -export * from "./search/index"; -export * from "./select/index"; -export * from "./sidebar/index"; -export * from "./tabs/index"; -export * from "./transition/index"; diff --git a/dist/modules/index.js b/dist/modules/index.js deleted file mode 100644 index 70b61dbf5..000000000 --- a/dist/modules/index.js +++ /dev/null @@ -1,16 +0,0 @@ -export * from "./accordion/index"; -export * from "./checkbox/index"; -export * from "./collapse/index"; -export * from "./datepicker/index"; -export * from "./dimmer/index"; -export * from "./dropdown/index"; -export * from "./modal/index"; -export * from "./popup/index"; -export * from "./progress/index"; -export * from "./rating/index"; -export * from "./search/index"; -export * from "./select/index"; -export * from "./sidebar/index"; -export * from "./tabs/index"; -export * from "./transition/index"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/index.js.map b/dist/modules/index.js.map deleted file mode 100644 index 5ab82fc72..000000000 --- a/dist/modules/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./accordion/index\";\nexport * from \"./checkbox/index\";\nexport * from \"./collapse/index\";\nexport * from \"./datepicker/index\";\nexport * from \"./dimmer/index\";\nexport * from \"./dropdown/index\";\nexport * from \"./modal/index\";\nexport * from \"./popup/index\";\nexport * from \"./progress/index\";\nexport * from \"./rating/index\";\nexport * from \"./search/index\";\nexport * from \"./select/index\";\nexport * from \"./sidebar/index\";\nexport * from \"./tabs/index\";\nexport * from \"./transition/index\";\n"]} \ No newline at end of file diff --git a/dist/modules/index.metadata.json b/dist/modules/index.metadata.json deleted file mode 100644 index 3ee50e222..000000000 --- a/dist/modules/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./accordion/index"},{"from":"./checkbox/index"},{"from":"./collapse/index"},{"from":"./datepicker/index"},{"from":"./dimmer/index"},{"from":"./dropdown/index"},{"from":"./modal/index"},{"from":"./popup/index"},{"from":"./progress/index"},{"from":"./rating/index"},{"from":"./search/index"},{"from":"./select/index"},{"from":"./sidebar/index"},{"from":"./tabs/index"},{"from":"./transition/index"}]}] \ No newline at end of file diff --git a/dist/modules/modal/classes/active-modal.d.ts b/dist/modules/modal/classes/active-modal.d.ts deleted file mode 100644 index 326edf8a6..000000000 --- a/dist/modules/modal/classes/active-modal.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ComponentRef } from "@angular/core"; -import { ModalConfig } from "./modal-config"; -import { SuiModal } from "../components/modal"; -export declare class ActiveModal { - private _config; - private _componentRef; - readonly component: SuiModal; - constructor(instance: ModalConfig, componentRef: ComponentRef>); - onApprove(callback: (result: U) => void): ActiveModal; - onDeny(callback: (result: V) => void): ActiveModal; - approve(result: U): void; - deny(result: V): void; - destroy(): void; -} diff --git a/dist/modules/modal/classes/active-modal.js b/dist/modules/modal/classes/active-modal.js deleted file mode 100644 index deba96369..000000000 --- a/dist/modules/modal/classes/active-modal.js +++ /dev/null @@ -1,63 +0,0 @@ -// Helper class to support method chaining when calling `SuiModalService.open(...)`. -var -// Helper class to support method chaining when calling `SuiModalService.open(...)`. -ActiveModal = /** @class */ (function () { - function ActiveModal(instance, componentRef) { - var _this = this; - this._config = instance; - this._componentRef = componentRef; - // Automatically destroy the modal component when it has been dismissed. - this.component.onDismiss.subscribe(function () { return _this._componentRef.destroy(); }); - } - Object.defineProperty(ActiveModal.prototype, "component", { - // Shorthand for direct access to the `SuiModal` instance. - get: - // Shorthand for direct access to the `SuiModal` instance. - function () { - return this._componentRef.instance; - }, - enumerable: true, - configurable: true - }); - // Registers a callback for when `onApprove` is fired. - // Registers a callback for when `onApprove` is fired. - ActiveModal.prototype.onApprove = - // Registers a callback for when `onApprove` is fired. - function (callback) { - this.component.onApprove.subscribe(function (res) { return callback(res); }); - return this; - }; - // Registers a callback for when `onDeny` is fired. - // Registers a callback for when `onDeny` is fired. - ActiveModal.prototype.onDeny = - // Registers a callback for when `onDeny` is fired. - function (callback) { - this.component.onDeny.subscribe(function (res) { return callback(res); }); - return this; - }; - // Fires the approve event of the modal manually. - // Fires the approve event of the modal manually. - ActiveModal.prototype.approve = - // Fires the approve event of the modal manually. - function (result) { - this.component.approve(result); - }; - // Fires the deny event of the modal manually. - // Fires the deny event of the modal manually. - ActiveModal.prototype.deny = - // Fires the deny event of the modal manually. - function (result) { - this.component.deny(result); - }; - // Removes the modal component instantly, without transitions or firing any events. - // Removes the modal component instantly, without transitions or firing any events. - ActiveModal.prototype.destroy = - // Removes the modal component instantly, without transitions or firing any events. - function () { - this._componentRef.destroy(); - }; - return ActiveModal; -}()); -// Helper class to support method chaining when calling `SuiModalService.open(...)`. -export { ActiveModal }; -//# sourceMappingURL=active-modal.js.map \ No newline at end of file diff --git a/dist/modules/modal/classes/active-modal.js.map b/dist/modules/modal/classes/active-modal.js.map deleted file mode 100644 index 7b76dd994..000000000 --- a/dist/modules/modal/classes/active-modal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"active-modal.js","sourceRoot":"","sources":["../../../../src/modules/modal/classes/active-modal.ts"],"names":[],"mappings":";AAKA;;AAAA;IASI,qBAAY,QAA6B,EAAE,YAAyC;QAApF,iBAMC;QALG,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;;QAGlC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,aAAa,CAAC,OAAO,EAAE,EAA5B,CAA4B,CAAC,CAAC;KAC1E;IAVD,sBAAW,kCAAS;QADpB,0DAA0D;;;QAC1D;YACI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;SACtC;;;OAAA;IAUD,sDAAsD;;IAC/C,+BAAS;;IAAhB,UAAiB,QAA2B;QACxC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,UAAC,GAAK,IAAK,OAAA,QAAQ,CAAC,GAAG,CAAC,EAAb,CAAa,CAAC,CAAC;QAC7D,MAAM,CAAC,IAAI,CAAC;KACf;IAED,mDAAmD;;IAC5C,4BAAM;;IAAb,UAAc,QAA2B;QACrC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,UAAC,GAAK,IAAK,OAAA,QAAQ,CAAC,GAAG,CAAC,EAAb,CAAa,CAAC,CAAC;QAC1D,MAAM,CAAC,IAAI,CAAC;KACf;IAED,iDAAiD;;IAC1C,6BAAO;;IAAd,UAAe,MAAQ;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;KAClC;IAED,8CAA8C;;IACvC,0BAAI;;IAAX,UAAY,MAAQ;QAChB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC/B;IAED,mFAAmF;;IAC5E,6BAAO;;IAAd;QACI,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;KAChC;sBA/CL;IAgDC,CAAA;;AA3CD,uBA2CC","sourcesContent":["import { ComponentRef } from \"@angular/core\";\nimport { ModalConfig } from \"./modal-config\";\nimport { SuiModal } from \"../components/modal\";\n\n// Helper class to support method chaining when calling `SuiModalService.open(...)`.\nexport class ActiveModal {\n private _config:ModalConfig;\n private _componentRef:ComponentRef>;\n\n // Shorthand for direct access to the `SuiModal` instance.\n public get component():SuiModal {\n return this._componentRef.instance;\n }\n\n constructor(instance:ModalConfig, componentRef:ComponentRef>) {\n this._config = instance;\n this._componentRef = componentRef;\n\n // Automatically destroy the modal component when it has been dismissed.\n this.component.onDismiss.subscribe(() => this._componentRef.destroy());\n }\n\n // Registers a callback for when `onApprove` is fired.\n public onApprove(callback:(result:U) => void):ActiveModal {\n this.component.onApprove.subscribe((res:U) => callback(res));\n return this;\n }\n\n // Registers a callback for when `onDeny` is fired.\n public onDeny(callback:(result:V) => void):ActiveModal {\n this.component.onDeny.subscribe((res:V) => callback(res));\n return this;\n }\n\n // Fires the approve event of the modal manually.\n public approve(result:U):void {\n this.component.approve(result);\n }\n\n // Fires the deny event of the modal manually.\n public deny(result:V):void {\n this.component.deny(result);\n }\n\n // Removes the modal component instantly, without transitions or firing any events.\n public destroy():void {\n this._componentRef.destroy();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/classes/active-modal.metadata.json b/dist/modules/modal/classes/active-modal.metadata.json deleted file mode 100644 index 760d96eff..000000000 --- a/dist/modules/modal/classes/active-modal.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"ActiveModal":{"__symbolic":"class","arity":3,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./modal-config","name":"ModalConfig","line":14,"character":25,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":14,"character":37,"context":{"typeName":"T"}},{"__symbolic":"error","message":"Could not resolve type","line":14,"character":40,"context":{"typeName":"U"}},{"__symbolic":"error","message":"Could not resolve type","line":14,"character":43,"context":{"typeName":"V"}}]},{"__symbolic":"reference","module":"@angular/core","name":"ComponentRef","line":14,"character":60,"arguments":[{"__symbolic":"reference","module":"../components/modal","name":"SuiModal","line":14,"character":73,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":14,"character":82,"context":{"typeName":"U"}},{"__symbolic":"error","message":"Could not resolve type","line":14,"character":85,"context":{"typeName":"V"}}]}]}]}],"onApprove":[{"__symbolic":"method"}],"onDeny":[{"__symbolic":"method"}],"approve":[{"__symbolic":"method"}],"deny":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-config.d.ts b/dist/modules/modal/classes/modal-config.d.ts deleted file mode 100644 index ecd371919..000000000 --- a/dist/modules/modal/classes/modal-config.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Type } from "@angular/core"; -import { ModalTemplate } from "./modal-template"; -export declare type ModalSize = "mini" | "tiny" | "small" | "normal" | "large"; -export declare const ModalSize: { - Mini: ModalSize; - Tiny: ModalSize; - Small: ModalSize; - Normal: ModalSize; - Large: ModalSize; -}; -export declare class ModalConfig { - isClosable: boolean; - closeResult: V; - context?: T; - size: ModalSize; - isFullScreen: boolean; - isBasic: boolean; - isInverted: boolean; - mustScroll: boolean; - transition: string; - transitionDuration: number; - constructor(context?: T | undefined, isClosable?: boolean); -} -export declare class TemplateModalConfig extends ModalConfig { - template: ModalTemplate; - constructor(template: ModalTemplate, context?: T | undefined, isClosable?: boolean); -} -export declare class ComponentModalConfig extends ModalConfig { - component: Type; - constructor(component: Type, context?: T | undefined, isClosable?: boolean); -} diff --git a/dist/modules/modal/classes/modal-config.js b/dist/modules/modal/classes/modal-config.js deleted file mode 100644 index 23b0e7989..000000000 --- a/dist/modules/modal/classes/modal-config.js +++ /dev/null @@ -1,72 +0,0 @@ -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 __()); - }; -})(); -export var ModalSize = { - Mini: "mini", - Tiny: "tiny", - Small: "small", - Normal: "normal", - Large: "large" -}; -// Stores a basic set of configuration options for a modal. -var -// Stores a basic set of configuration options for a modal. -ModalConfig = /** @class */ (function () { - function ModalConfig(context, isClosable) { - if (context === void 0) { context = undefined; } - if (isClosable === void 0) { isClosable = true; } - // Initialise with default values. - this.isClosable = isClosable; - this.context = context; - this.size = ModalSize.Normal; - this.isFullScreen = false; - this.isBasic = false; - this.isInverted = false; - this.mustScroll = false; - this.transition = "scale"; - this.transitionDuration = 500; - } - return ModalConfig; -}()); -// Stores a basic set of configuration options for a modal. -export { ModalConfig }; -// Used when creating a modal from a `TemplateRef`. -var -// Used when creating a modal from a `TemplateRef`. -TemplateModalConfig = /** @class */ (function (_super) { - __extends(TemplateModalConfig, _super); - function TemplateModalConfig(template, context, isClosable) { - if (context === void 0) { context = undefined; } - if (isClosable === void 0) { isClosable = true; } - var _this = _super.call(this, context, isClosable) || this; - _this.template = template; - return _this; - } - return TemplateModalConfig; -}(ModalConfig)); -// Used when creating a modal from a `TemplateRef`. -export { TemplateModalConfig }; -// Used when creating a modal from an existing component. -var -// Used when creating a modal from an existing component. -ComponentModalConfig = /** @class */ (function (_super) { - __extends(ComponentModalConfig, _super); - function ComponentModalConfig(component, context, isClosable) { - if (context === void 0) { context = undefined; } - if (isClosable === void 0) { isClosable = true; } - var _this = _super.call(this, context, isClosable) || this; - _this.component = component; - return _this; - } - return ComponentModalConfig; -}(ModalConfig)); -// Used when creating a modal from an existing component. -export { ComponentModalConfig }; -//# sourceMappingURL=modal-config.js.map \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-config.js.map b/dist/modules/modal/classes/modal-config.js.map deleted file mode 100644 index 051da9e98..000000000 --- a/dist/modules/modal/classes/modal-config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modal-config.js","sourceRoot":"","sources":["../../../../src/modules/modal/classes/modal-config.ts"],"names":[],"mappings":";;;;;;;;;;AAKA,MAAM,CAAC,IAAM,SAAS,GAAG;IACrB,IAAI,EAAE,MAAmB;IACzB,IAAI,EAAE,MAAmB;IACzB,KAAK,EAAE,OAAoB;IAC3B,MAAM,EAAE,QAAqB;IAC7B,KAAK,EAAE,OAAoB;CAC9B,CAAC;;AAGF;;AAAA;IA0BI,qBAAY,OAAiC,EAAE,UAAyB;QAA5D,wBAAA,EAAA,mBAAiC;QAAE,2BAAA,EAAA,iBAAyB;;QAEpE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;QAC1B,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC;KACjC;sBAtDL;IAuDC,CAAA;;AAzCD,uBAyCC;;AAGD;;AAAA;IAA0E,uCAAoB;IAG1F,6BAAY,QAA+B,EAAE,OAAiC,EAAE,UAAyB;QAA5D,wBAAA,EAAA,mBAAiC;QAAE,2BAAA,EAAA,iBAAyB;QAAzG,YACI,kBAAM,OAAO,EAAE,UAAU,CAAC,SAG7B;QADG,KAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;;KAC5B;8BAjEL;EA0D0E,WAAW,EAQpF,CAAA;;AARD,+BAQC;;AAGD;;AAAA;IAA2E,wCAAoB;IAG3F,8BAAY,SAAmB,EAAE,OAAiC,EAAE,UAAyB;QAA5D,wBAAA,EAAA,mBAAiC;QAAE,2BAAA,EAAA,iBAAyB;QAA7F,YACI,kBAAM,OAAO,EAAE,UAAU,CAAC,SAG7B;QADG,KAAI,CAAC,SAAS,GAAG,SAAS,CAAC;;KAC9B;+BA5EL;EAqE2E,WAAW,EAQrF,CAAA;;AARD,gCAQC","sourcesContent":["import { Type } from \"@angular/core\";\nimport { ModalTemplate } from \"./modal-template\";\n\nexport type ModalSize = \"mini\" | \"tiny\" | \"small\" | \"normal\" | \"large\";\n\nexport const ModalSize = {\n Mini: \"mini\" as ModalSize,\n Tiny: \"tiny\" as ModalSize,\n Small: \"small\" as ModalSize,\n Normal: \"normal\" as ModalSize,\n Large: \"large\" as ModalSize\n};\n\n// Stores a basic set of configuration options for a modal.\nexport class ModalConfig {\n // Determines whether the modal can be closed with a close button, clicking outside, or the escape key.\n public isClosable:boolean;\n // Value to deny with when closing via `isClosable`.\n public closeResult:V;\n\n // Data to pass to the modal instance when opened.\n public context?:T;\n\n // Size used to display the modal.\n public size:ModalSize;\n // Whether the modal takes up the full width of the screen.\n public isFullScreen:boolean;\n // Whether or not the modal has basic styles applied.\n public isBasic:boolean;\n // Whether the modal shows against a light background.\n public isInverted:boolean;\n\n // Whether or not the modal should always display a scrollbar.\n public mustScroll:boolean;\n\n // Transition to display modal with.\n public transition:string;\n // Duration of the modal & dimmer transitions.\n public transitionDuration:number;\n\n constructor(context:T | undefined = undefined, isClosable:boolean = true) {\n // Initialise with default values.\n this.isClosable = isClosable;\n this.context = context;\n\n this.size = ModalSize.Normal;\n this.isFullScreen = false;\n this.isBasic = false;\n this.isInverted = false;\n\n this.mustScroll = false;\n\n this.transition = \"scale\";\n this.transitionDuration = 500;\n }\n}\n\n// Used when creating a modal from a `TemplateRef`.\nexport class TemplateModalConfig extends ModalConfig {\n public template:ModalTemplate;\n\n constructor(template:ModalTemplate, context:T | undefined = undefined, isClosable:boolean = true) {\n super(context, isClosable);\n\n this.template = template;\n }\n}\n\n// Used when creating a modal from an existing component.\nexport class ComponentModalConfig extends ModalConfig {\n public component:Type;\n\n constructor(component:Type, context:T | undefined = undefined, isClosable:boolean = true) {\n super(context, isClosable);\n\n this.component = component;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-config.metadata.json b/dist/modules/modal/classes/modal-config.metadata.json deleted file mode 100644 index 43e86d9bd..000000000 --- a/dist/modules/modal/classes/modal-config.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"ModalSize":{"Mini":"mini","Tiny":"tiny","Small":"small","Normal":"normal","Large":"large"},"ModalConfig":{"__symbolic":"class","arity":3,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":40,"character":24,"context":{"typeName":"T"}},{"__symbolic":"reference","name":"boolean"}]}]}},"TemplateModalConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ModalConfig"},"arity":3,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./modal-template","name":"ModalTemplate","line":61,"character":25,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":61,"character":39,"context":{"typeName":"T"}},{"__symbolic":"error","message":"Could not resolve type","line":61,"character":42,"context":{"typeName":"U"}},{"__symbolic":"error","message":"Could not resolve type","line":61,"character":45,"context":{"typeName":"V"}}]},{"__symbolic":"error","message":"Could not resolve type","line":61,"character":57,"context":{"typeName":"T"}},{"__symbolic":"reference","name":"boolean"}]}]}},"ComponentModalConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ModalConfig"},"arity":3,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Type","line":72,"character":26,"arguments":[{"__symbolic":"reference","name":"any"}]},{"__symbolic":"error","message":"Could not resolve type","line":72,"character":45,"context":{"typeName":"T"}},{"__symbolic":"reference","name":"boolean"}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-controls.d.ts b/dist/modules/modal/classes/modal-controls.d.ts deleted file mode 100644 index 7d83ae197..000000000 --- a/dist/modules/modal/classes/modal-controls.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare type ModalResult = (result: T) => void; -export declare class ModalControls { - constructor(approve: ModalResult, deny: ModalResult); - approve(result: T): void; - deny(result: U): void; -} -export declare class Modal extends ModalControls { - context: T; - constructor(controls: ModalControls, context: T); -} diff --git a/dist/modules/modal/classes/modal-controls.js b/dist/modules/modal/classes/modal-controls.js deleted file mode 100644 index c934d8723..000000000 --- a/dist/modules/modal/classes/modal-controls.js +++ /dev/null @@ -1,46 +0,0 @@ -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 __()); - }; -})(); -// Used to pass ability to control a modal to a component. -var -// Used to pass ability to control a modal to a component. -ModalControls = /** @class */ (function () { - function ModalControls(approve, deny) { - this.approve = approve; - this.deny = deny; - } - // Use method here rather than arrow variables to make intellisense show they're methods. - // Use method here rather than arrow variables to make intellisense show they're methods. - ModalControls.prototype.approve = - // Use method here rather than arrow variables to make intellisense show they're methods. - function (result) { }; - ModalControls.prototype.deny = function (result) { }; - return ModalControls; -}()); -// Used to pass ability to control a modal to a component. -export { ModalControls }; -// Injected into custom modal components, to allow control of the modal, and access to a context object. -var -// Injected into custom modal components, to allow control of the modal, and access to a context object. -Modal = /** @class */ (function (_super) { - __extends(Modal, _super); - function Modal(controls, context) { - var _this = - // Instances of `ModalControls` are only created in the `SuiModal` constructor, - // so we take an initialised instance rather than remaking one each time. - _super.call(this, controls.approve, controls.deny) || this; - _this.context = context; - return _this; - } - return Modal; -}(ModalControls)); -// Injected into custom modal components, to allow control of the modal, and access to a context object. -export { Modal }; -//# sourceMappingURL=modal-controls.js.map \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-controls.js.map b/dist/modules/modal/classes/modal-controls.js.map deleted file mode 100644 index 7490f7c26..000000000 --- a/dist/modules/modal/classes/modal-controls.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modal-controls.js","sourceRoot":"","sources":["../../../../src/modules/modal/classes/modal-controls.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA;;AAAA;IACI,uBAAY,OAAsB,EAAE,IAAmB;QACnD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;KACpB;IAED,yFAAyF;;IAClF,+BAAO;;IAAd,UAAe,MAAQ,KAAS;IACzB,4BAAI,GAAX,UAAY,MAAQ,KAAS;wBAZjC;IAaC,CAAA;;AATD,yBASC;;AAGD;;AAAA;IAA4D,yBAAmB;IAG3E,eAAY,QAA4B,EAAE,OAAS;QAAnD;QACI,+EAA+E;QAC/E,yEAAyE;QACzE,kBAAM,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,SAGzC;QADG,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;KAC1B;gBAzBL;EAgB4D,aAAa,EAUxE,CAAA;;AAVD,iBAUC","sourcesContent":["// Shorthand to avoid writing arrow types everywhere.\nexport type ModalResult = (result:T) => void;\n\n// Used to pass ability to control a modal to a component.\nexport class ModalControls {\n constructor(approve:ModalResult, deny:ModalResult) {\n this.approve = approve;\n this.deny = deny;\n }\n\n // Use method here rather than arrow variables to make intellisense show they're methods.\n public approve(result:T):void {}\n public deny(result:U):void {}\n}\n\n// Injected into custom modal components, to allow control of the modal, and access to a context object.\nexport class Modal extends ModalControls {\n public context:T;\n\n constructor(controls:ModalControls, context:T) {\n // Instances of `ModalControls` are only created in the `SuiModal` constructor,\n // so we take an initialised instance rather than remaking one each time.\n super(controls.approve, controls.deny);\n\n this.context = context;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-controls.metadata.json b/dist/modules/modal/classes/modal-controls.metadata.json deleted file mode 100644 index 9b8da18ac..000000000 --- a/dist/modules/modal/classes/modal-controls.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"ModalResult":{"__symbolic":"interface"},"ModalControls":{"__symbolic":"class","arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":5,"character":24,"context":{"typeName":"ModalResult"}},{"__symbolic":"error","message":"Could not resolve type","line":5,"character":45,"context":{"typeName":"ModalResult"}}]}],"approve":[{"__symbolic":"method"}],"deny":[{"__symbolic":"method"}]}},"Modal":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ModalControls"},"arity":3,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ModalControls","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":19,"character":39,"context":{"typeName":"U"}},{"__symbolic":"error","message":"Could not resolve type","line":19,"character":42,"context":{"typeName":"V"}}]},{"__symbolic":"error","message":"Could not resolve type","line":19,"character":54,"context":{"typeName":"T"}}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-template.d.ts b/dist/modules/modal/classes/modal-template.d.ts deleted file mode 100644 index a97e54f0b..000000000 --- a/dist/modules/modal/classes/modal-template.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { TemplateRef } from "@angular/core"; -import { ModalControls } from "./modal-controls"; -export declare abstract class ModalTemplate extends TemplateRef<{ - $implicit: T; - modal: ModalControls; -}> { -} diff --git a/dist/modules/modal/classes/modal-template.js b/dist/modules/modal/classes/modal-template.js deleted file mode 100644 index 18caa0a96..000000000 --- a/dist/modules/modal/classes/modal-template.js +++ /dev/null @@ -1,27 +0,0 @@ -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 __()); - }; -})(); -import { TemplateRef } from "@angular/core"; -// Shorthand for a modal template. Sets up ability to write: `...` -// We use an abstract class as ModalTemplate tends to be used within decorated properties, which means it needs to exist! -var -// Shorthand for a modal template. Sets up ability to write: `...` -// We use an abstract class as ModalTemplate tends to be used within decorated properties, which means it needs to exist! -ModalTemplate = /** @class */ (function (_super) { - __extends(ModalTemplate, _super); - function ModalTemplate() { - return _super !== null && _super.apply(this, arguments) || this; - } - return ModalTemplate; -}(TemplateRef)); -// Shorthand for a modal template. Sets up ability to write: `...` -// We use an abstract class as ModalTemplate tends to be used within decorated properties, which means it needs to exist! -export { ModalTemplate }; -//# sourceMappingURL=modal-template.js.map \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-template.js.map b/dist/modules/modal/classes/modal-template.js.map deleted file mode 100644 index 9b4e2500d..000000000 --- a/dist/modules/modal/classes/modal-template.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modal-template.js","sourceRoot":"","sources":["../../../../src/modules/modal/classes/modal-template.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;;AAK5C;;;AAAA;IAAqD,iCAAuD;;;;wBAL5G;EAKqD,WAAW,EAA+C,CAAA;;;AAA/G,yBAA+G","sourcesContent":["import { TemplateRef } from \"@angular/core\";\nimport { ModalControls } from \"./modal-controls\";\n\n// Shorthand for a modal template. Sets up ability to write: `...`\n// We use an abstract class as ModalTemplate tends to be used within decorated properties, which means it needs to exist!\nexport abstract class ModalTemplate extends TemplateRef<{ $implicit:T; modal:ModalControls }> {}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/classes/modal-template.metadata.json b/dist/modules/modal/classes/modal-template.metadata.json deleted file mode 100644 index a9059b174..000000000 --- a/dist/modules/modal/classes/modal-template.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"ModalTemplate":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","line":5,"character":53},"arity":3}}}] \ No newline at end of file diff --git a/dist/modules/modal/components/modal.d.ts b/dist/modules/modal/components/modal.d.ts deleted file mode 100644 index 4c18a93f4..000000000 --- a/dist/modules/modal/components/modal.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { OnInit, ElementRef, Renderer2, EventEmitter, ViewContainerRef, AfterViewInit } from "@angular/core"; -import { IDynamicClasses, SuiComponentFactory } from "../../../misc/util/index"; -import { TransitionController } from "../../transition/index"; -import { ModalControls, ModalResult } from "../classes/modal-controls"; -import { ModalConfig, ModalSize } from "../classes/modal-config"; -export declare class SuiModal implements OnInit, AfterViewInit { - private _renderer; - private _element; - private _componentFactory; - isClosable: boolean; - closeResult: U; - controls: ModalControls; - readonly approve: ModalResult; - readonly deny: ModalResult; - onApprove: EventEmitter; - onDeny: EventEmitter; - onDismiss: EventEmitter; - private _modalElement; - size: ModalSize; - private _isFullScreen; - isFullScreen: boolean; - isBasic: boolean; - private _mustScroll; - private _mustAlwaysScroll; - mustScroll: boolean; - private _isInverted; - isInverted: boolean; - transitionController: TransitionController; - transition: string; - transitionDuration: number; - dimBackground: boolean; - private _isClosing; - templateSibling: ViewContainerRef; - private _originalContainer?; - readonly dynamicClasses: IDynamicClasses; - constructor(_renderer: Renderer2, _element: ElementRef, _componentFactory: SuiComponentFactory); - ngOnInit(): void; - ngAfterViewInit(): void; - loadConfig(config: ModalConfig): void; - private dismiss(callback?); - close(): void; - private updateScroll(); - onClick(e: MouseEvent): void; - onDocumentKeyUp(e: KeyboardEvent): void; - onDocumentResize(): void; -} diff --git a/dist/modules/modal/components/modal.js b/dist/modules/modal/components/modal.js deleted file mode 100644 index ef3645f95..000000000 --- a/dist/modules/modal/components/modal.js +++ /dev/null @@ -1,230 +0,0 @@ -import { Component, Input, ViewChild, ElementRef, Renderer2, EventEmitter, Output, HostListener, ViewContainerRef } from "@angular/core"; -import { Util, KeyCode, SuiComponentFactory } from "../../../misc/util/index"; -import { TransitionController, Transition, TransitionDirection } from "../../transition/index"; -import { ModalControls } from "../classes/modal-controls"; -import { ModalConfig, ModalSize } from "../classes/modal-config"; -var SuiModal = /** @class */ (function () { - function SuiModal(_renderer, _element, _componentFactory) { - var _this = this; - this._renderer = _renderer; - this._element = _element; - this._componentFactory = _componentFactory; - // Initialise with default configuration from `ModalConfig` (to avoid writing defaults twice). - var config = new ModalConfig(); - this.loadConfig(config); - // Event emitters for each of the possible modal outcomes. - this.onApprove = new EventEmitter(); - this.onDeny = new EventEmitter(); - this.onDismiss = new EventEmitter(); - // Initialise controls with actions for the `approve` and `deny` cases. - this.controls = new ModalControls(function (res) { return _this.dismiss(function () { return _this.onApprove.emit(res); }); }, function (res) { return _this.dismiss(function () { return _this.onDeny.emit(res); }); }); - // Internal variable initialisation. - this.dimBackground = false; - this._isClosing = false; - this.transitionController = new TransitionController(false); - } - Object.defineProperty(SuiModal.prototype, "approve", { - get: function () { - return this.controls.approve; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiModal.prototype, "deny", { - get: function () { - return this.controls.deny; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiModal.prototype, "isFullScreen", { - get: - // Value to deny with when closing via `isClosable`. - function () { - return this._isFullScreen; - }, - set: function (fullScreen) { - this._isFullScreen = Util.DOM.parseBooleanAttribute(fullScreen); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiModal.prototype, "mustScroll", { - get: function () { - return this._mustScroll; - }, - set: function (mustScroll) { - this._mustScroll = mustScroll; - // 'Cache' value in _mustAlwaysScroll so that if `true`, _mustScroll isn't ever auto-updated. - this._mustAlwaysScroll = mustScroll; - this.updateScroll(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiModal.prototype, "isInverted", { - get: function () { - return this._isInverted; - }, - set: function (inverted) { - this._isInverted = Util.DOM.parseBooleanAttribute(inverted); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiModal.prototype, "dynamicClasses", { - get: function () { - var classes = {}; - if (this.size) { - classes[this.size] = true; - } - return classes; - }, - enumerable: true, - configurable: true - }); - SuiModal.prototype.ngOnInit = function () { - var _this = this; - // Transition the modal to be visible. - this.transitionController.animate(new Transition(this.transition, this.transitionDuration, TransitionDirection.In)); - setTimeout(function () { return _this.dimBackground = true; }); - }; - SuiModal.prototype.ngAfterViewInit = function () { - var _this = this; - // Move the modal to the document body to ensure correct scrolling. - this._originalContainer = this._element.nativeElement.parentNode; - document.querySelector("body").appendChild(this._element.nativeElement); - // Remove the #templateSibling element from the DOM to fix bottom border styles. - var templateElement = this.templateSibling.element.nativeElement; - if (templateElement.parentNode) { - templateElement.parentNode.removeChild(templateElement); - } - // Update margin offset to center modal correctly on-screen. - var element = this._modalElement.nativeElement; - setTimeout(function () { - _this._renderer.setStyle(element, "margin-top", "-" + element.clientHeight / 2 + "px"); - _this.updateScroll(); - }); - // Focus any element with [autofocus] attribute. - var autoFocus = element.querySelector("[autofocus]"); - if (autoFocus) { - // Autofocus after the browser has had time to process other event handlers. - setTimeout(function () { return autoFocus.focus(); }, 10); - // Try to focus again when the modal has opened so that autofocus works in IE11. - setTimeout(function () { return autoFocus.focus(); }, this.transitionDuration); - } - }; - // Updates the modal with the specified configuration. - // Updates the modal with the specified configuration. - SuiModal.prototype.loadConfig = - // Updates the modal with the specified configuration. - function (config) { - this.isClosable = config.isClosable; - this.closeResult = config.closeResult; - this.size = config.size; - this.isFullScreen = config.isFullScreen; - this.isBasic = config.isBasic; - this.isInverted = config.isInverted; - this.mustScroll = config.mustScroll; - this.transition = config.transition; - this.transitionDuration = config.transitionDuration; - }; - // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. - // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. - SuiModal.prototype.dismiss = - // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning. - function (callback) { - var _this = this; - if (callback === void 0) { callback = function () { }; } - // If we aren't currently closing, - if (!this._isClosing) { - this._isClosing = true; - // Transition the modal to be invisible. - this.dimBackground = false; - this.transitionController.stopAll(); - this.transitionController.animate(new Transition(this.transition, this.transitionDuration, TransitionDirection.Out, function () { - // When done, move the modal back to its original location, emit a dismiss event, and fire the callback. - if (_this._originalContainer) { - _this._originalContainer.appendChild(_this._element.nativeElement); - } - _this.onDismiss.emit(); - callback(); - })); - } - }; - // Closes the modal with a 'deny' outcome, using the specified default reason. - // Closes the modal with a 'deny' outcome, using the specified default reason. - SuiModal.prototype.close = - // Closes the modal with a 'deny' outcome, using the specified default reason. - function () { - if (this.isClosable) { - // If we are allowed to close, fire the deny result with the default value. - this.deny(this.closeResult); - } - }; - // Decides whether the modal needs to reposition to allow scrolling. - // Decides whether the modal needs to reposition to allow scrolling. - SuiModal.prototype.updateScroll = - // Decides whether the modal needs to reposition to allow scrolling. - function () { - // Semantic UI modal margin is 3.5rem, which is relative to the global font size, so for compatibility: - var fontSize = parseFloat(window.getComputedStyle(document.documentElement).getPropertyValue("font-size")); - var margin = fontSize * 3.5; - // _mustAlwaysScroll works by stopping _mustScroll from being automatically updated, so it stays `true`. - if (!this._mustAlwaysScroll && this._modalElement) { - var element = this._modalElement.nativeElement; - // The modal must scroll if the window height is smaller than the modal height + both margins. - this._mustScroll = window.innerHeight < element.clientHeight + margin * 2; - } - }; - SuiModal.prototype.onClick = function (e) { - // Makes sense here, as the modal shouldn't be attached to any DOM element. - e.stopPropagation(); - }; - // Document listener is fine here because nobody will enough modals open. - SuiModal.prototype.onDocumentKeyUp = - // Document listener is fine here because nobody will enough modals open. - function (e) { - if (e.keyCode === KeyCode.Escape) { - // Close automatically covers case of `!isClosable`, so check not needed. - this.close(); - } - }; - SuiModal.prototype.onDocumentResize = function () { - this.updateScroll(); - }; - SuiModal.decorators = [ - { type: Component, args: [{ - selector: "sui-modal", - template: "\n\n\n\n \n
\n\n \n \n \n \n \n
\n
\n
\n", - styles: ["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiModal.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - { type: SuiComponentFactory, }, - ]; }; - SuiModal.propDecorators = { - "isClosable": [{ type: Input },], - "closeResult": [{ type: Input },], - "onApprove": [{ type: Output, args: ["approved",] },], - "onDeny": [{ type: Output, args: ["denied",] },], - "onDismiss": [{ type: Output, args: ["dismissed",] },], - "_modalElement": [{ type: ViewChild, args: ["modal",] },], - "size": [{ type: Input },], - "isFullScreen": [{ type: Input },], - "isBasic": [{ type: Input },], - "mustScroll": [{ type: Input },], - "isInverted": [{ type: Input },], - "transition": [{ type: Input },], - "transitionDuration": [{ type: Input },], - "templateSibling": [{ type: ViewChild, args: ["templateSibling", { read: ViewContainerRef },] },], - "onDocumentKeyUp": [{ type: HostListener, args: ["document:keyup", ["$event"],] },], - "onDocumentResize": [{ type: HostListener, args: ["window:resize",] },], - }; - return SuiModal; -}()); -export { SuiModal }; -//# sourceMappingURL=modal.js.map \ No newline at end of file diff --git a/dist/modules/modal/components/modal.js.map b/dist/modules/modal/components/modal.js.map deleted file mode 100644 index cb69ce0cf..000000000 --- a/dist/modules/modal/components/modal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../../src/modules/modal/components/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,KAAK,EAAU,SAAS,EAAE,UAAU,EAAE,SAAS,EAC1D,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EACvD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAmB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAe,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;;IAoK7D,kBAAoB,SAAmB,EAAU,QAAmB,EAAU,iBAAqC;QAAnH,iBAmBC;QAnBmB,cAAS,GAAT,SAAS,CAAU;QAAU,aAAQ,GAAR,QAAQ,CAAW;QAAU,sBAAiB,GAAjB,iBAAiB,CAAoB;;QAE/G,IAAM,MAAM,GAAG,IAAI,WAAW,EAAmB,CAAC;QAClD,IAAI,CAAC,UAAU,CAAC,MAAM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SAC7E;KACJ;IAEM,0BAAO,GAAd,UAAe,CAAY;;QAEvB,CAAC,CAAC,eAAe,EAAE,CAAC;KACvB;;IAIM,kCAAe;;cAAC,CAAe;QAClC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;;YAE/B,IAAI,CAAC,KAAK,EAAE,CAAC;SAChB;;IAIE,mCAAgB;QACnB,IAAI,CAAC,YAAY,EAAE,CAAC;;;gBApS3B,SAAS,SAAC;oBACP,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE,qqCA8Bb;oBACG,MAAM,EAAE,CAAC,qPAYZ,CAAC;iBACD;;;;gBAtDoD,SAAS;gBAArB,UAAU;gBAGV,mBAAmB;;;+BAqDvD,KAAK;gCAIL,KAAK;8BAgBL,MAAM,SAAC,UAAU;2BAIjB,MAAM,SAAC,QAAQ;8BAIf,MAAM,SAAC,WAAW;kCAGlB,SAAS,SAAC,OAAO;yBAIjB,KAAK;iCAOL,KAAK;4BAUL,KAAK;+BAQL,KAAK;+BAeL,KAAK;+BAYL,KAAK;uCAIL,KAAK;oCASL,SAAS,SAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;oCAsIvD,YAAY,SAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;qCAQzC,YAAY,SAAC,eAAe;;mBA3SjC;;SAwDa,QAAQ","sourcesContent":["import {\n Component, Input, OnInit, ViewChild, ElementRef, Renderer2,\n EventEmitter, Output, HostListener, ViewContainerRef, AfterViewInit\n} from \"@angular/core\";\nimport { Util, IDynamicClasses, KeyCode, SuiComponentFactory } from \"../../../misc/util/index\";\nimport { TransitionController, Transition, TransitionDirection } from \"../../transition/index\";\nimport { ModalControls, ModalResult } from \"../classes/modal-controls\";\nimport { ModalConfig, ModalSize } from \"../classes/modal-config\";\n\n@Component({\n selector: \"sui-modal\",\n template: `\n\n\n\n \n
\n\n \n \n \n \n \n
\n
\n
\n`,\n styles: [`\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n`]\n})\nexport class SuiModal implements OnInit, AfterViewInit {\n @Input()\n // Determines whether the modal can be closed with a close button, clicking outside, or the escape key.\n public isClosable:boolean;\n\n @Input()\n // Value to deny with when closing via `isClosable`.\n public closeResult:U;\n\n // Separate class for the `approve` and `deny` methods to support passing into components.\n public controls:ModalControls;\n\n public get approve():ModalResult {\n return this.controls.approve;\n }\n\n public get deny():ModalResult {\n return this.controls.deny;\n }\n\n // Fires when the modal closes, after `approve` has been called.\n @Output(\"approved\")\n public onApprove:EventEmitter;\n\n // Fires when the modal closes, after `deny` has been called.\n @Output(\"denied\")\n public onDeny:EventEmitter;\n\n // Fires when the modal closes.\n @Output(\"dismissed\")\n public onDismiss:EventEmitter;\n\n @ViewChild(\"modal\")\n private _modalElement:ElementRef;\n\n // Size used to display the modal.\n @Input()\n public size:ModalSize;\n\n // Whether the modal takes up the full width of the screen.\n private _isFullScreen:boolean;\n\n // Value to deny with when closing via `isClosable`.\n @Input()\n public get isFullScreen():boolean {\n return this._isFullScreen;\n }\n\n public set isFullScreen(fullScreen:boolean) {\n this._isFullScreen = Util.DOM.parseBooleanAttribute(fullScreen);\n }\n\n // Whether or not the modal has basic styles applied.\n @Input()\n public isBasic:boolean;\n\n // Whether the modal currently is displaying a scrollbar.\n private _mustScroll:boolean;\n // Whether or not the modal should always display a scrollbar.\n private _mustAlwaysScroll:boolean;\n\n @Input()\n public get mustScroll():boolean {\n return this._mustScroll;\n }\n\n public set mustScroll(mustScroll:boolean) {\n this._mustScroll = mustScroll;\n // 'Cache' value in _mustAlwaysScroll so that if `true`, _mustScroll isn't ever auto-updated.\n this._mustAlwaysScroll = mustScroll;\n this.updateScroll();\n }\n\n // Whether the modal shows against a light background.\n private _isInverted:boolean;\n\n @Input()\n public get isInverted():boolean {\n return this._isInverted;\n }\n\n public set isInverted(inverted:boolean) {\n this._isInverted = Util.DOM.parseBooleanAttribute(inverted);\n }\n\n public transitionController:TransitionController;\n\n // Transition to display modal with.\n @Input()\n public transition:string;\n\n // Duration of the modal & dimmer transitions.\n @Input()\n public transitionDuration:number;\n\n // Whether or not the backround dimmer is active.\n public dimBackground:boolean;\n // True after `approve` or `deny` has been called.\n private _isClosing:boolean;\n\n // `ViewContainerRef` for the element the template gets injected as a sibling of.\n @ViewChild(\"templateSibling\", { read: ViewContainerRef })\n public templateSibling:ViewContainerRef;\n\n // Parent element of modal before relocation to document body.\n private _originalContainer?:Element;\n\n public get dynamicClasses():IDynamicClasses {\n const classes:IDynamicClasses = {};\n if (this.size) {\n classes[this.size] = true;\n }\n return classes;\n }\n\n constructor(private _renderer:Renderer2, private _element:ElementRef, private _componentFactory:SuiComponentFactory) {\n // Initialise with default configuration from `ModalConfig` (to avoid writing defaults twice).\n const config = new ModalConfig();\n this.loadConfig(config);\n\n // Event emitters for each of the possible modal outcomes.\n this.onApprove = new EventEmitter();\n this.onDeny = new EventEmitter();\n this.onDismiss = new EventEmitter();\n\n // Initialise controls with actions for the `approve` and `deny` cases.\n this.controls = new ModalControls(\n res => this.dismiss(() => this.onApprove.emit(res)),\n res => this.dismiss(() => this.onDeny.emit(res)));\n\n // Internal variable initialisation.\n this.dimBackground = false;\n this._isClosing = false;\n this.transitionController = new TransitionController(false);\n }\n\n public ngOnInit():void {\n // Transition the modal to be visible.\n this.transitionController.animate(new Transition(this.transition, this.transitionDuration, TransitionDirection.In));\n setTimeout(() => this.dimBackground = true);\n }\n\n public ngAfterViewInit():void {\n // Move the modal to the document body to ensure correct scrolling.\n this._originalContainer = this._element.nativeElement.parentNode;\n document.querySelector(\"body\")!.appendChild(this._element.nativeElement);\n // Remove the #templateSibling element from the DOM to fix bottom border styles.\n const templateElement = this.templateSibling.element.nativeElement as Element;\n if (templateElement.parentNode) {\n templateElement.parentNode.removeChild(templateElement);\n }\n\n // Update margin offset to center modal correctly on-screen.\n const element = this._modalElement.nativeElement as Element;\n setTimeout(() => {\n this._renderer.setStyle(element, \"margin-top\", `-${element.clientHeight / 2}px`);\n this.updateScroll();\n });\n\n // Focus any element with [autofocus] attribute.\n const autoFocus = element.querySelector(\"[autofocus]\") as HTMLElement | null;\n if (autoFocus) {\n // Autofocus after the browser has had time to process other event handlers.\n setTimeout(() => autoFocus.focus(), 10);\n // Try to focus again when the modal has opened so that autofocus works in IE11.\n setTimeout(() => autoFocus.focus(), this.transitionDuration);\n }\n }\n\n // Updates the modal with the specified configuration.\n public loadConfig(config:ModalConfig):void {\n this.isClosable = config.isClosable;\n this.closeResult = config.closeResult;\n\n this.size = config.size;\n this.isFullScreen = config.isFullScreen;\n this.isBasic = config.isBasic;\n this.isInverted = config.isInverted;\n\n this.mustScroll = config.mustScroll;\n\n this.transition = config.transition;\n this.transitionDuration = config.transitionDuration;\n }\n\n // Dismisses the modal with a transition, firing the callback after the modal has finished transitioning.\n private dismiss(callback:() => void = () => {}):void {\n // If we aren't currently closing,\n if (!this._isClosing) {\n this._isClosing = true;\n\n // Transition the modal to be invisible.\n this.dimBackground = false;\n this.transitionController.stopAll();\n this.transitionController.animate(\n new Transition(this.transition, this.transitionDuration, TransitionDirection.Out, () => {\n // When done, move the modal back to its original location, emit a dismiss event, and fire the callback.\n if (this._originalContainer) {\n this._originalContainer.appendChild(this._element.nativeElement);\n }\n this.onDismiss.emit();\n callback();\n }));\n }\n }\n\n // Closes the modal with a 'deny' outcome, using the specified default reason.\n public close():void {\n if (this.isClosable) {\n // If we are allowed to close, fire the deny result with the default value.\n this.deny(this.closeResult);\n }\n }\n\n // Decides whether the modal needs to reposition to allow scrolling.\n private updateScroll():void {\n // Semantic UI modal margin is 3.5rem, which is relative to the global font size, so for compatibility:\n const fontSize = parseFloat(window.getComputedStyle(document.documentElement).getPropertyValue(\"font-size\"));\n const margin = fontSize * 3.5;\n\n // _mustAlwaysScroll works by stopping _mustScroll from being automatically updated, so it stays `true`.\n if (!this._mustAlwaysScroll && this._modalElement) {\n const element = this._modalElement.nativeElement as Element;\n\n // The modal must scroll if the window height is smaller than the modal height + both margins.\n this._mustScroll = window.innerHeight < element.clientHeight + margin * 2;\n }\n }\n\n public onClick(e:MouseEvent):void {\n // Makes sense here, as the modal shouldn't be attached to any DOM element.\n e.stopPropagation();\n }\n\n // Document listener is fine here because nobody will enough modals open.\n @HostListener(\"document:keyup\", [\"$event\"])\n public onDocumentKeyUp(e:KeyboardEvent):void {\n if (e.keyCode === KeyCode.Escape) {\n // Close automatically covers case of `!isClosable`, so check not needed.\n this.close();\n }\n }\n\n @HostListener(\"window:resize\")\n public onDocumentResize():void {\n this.updateScroll();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/components/modal.metadata.json b/dist/modules/modal/components/modal.metadata.json deleted file mode 100644 index 4e9bd9fc6..000000000 --- a/dist/modules/modal/components/modal.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiModal":{"__symbolic":"class","arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":9,"character":1},"arguments":[{"selector":"sui-modal","template":"\n\n\n\n \n
\n\n \n \n \n \n \n
\n
\n
\n","styles":["\n.ui.dimmer {\n overflow-y: auto;\n}\n\n/* avoid .scrolling as Semantic UI adds unwanted styles. */\n.scroll {\n position: absolute !important;\n margin-top: 3.5rem !important;\n margin-bottom: 3.5rem !important;\n top: 0;\n}\n"]}]}],"members":{"isClosable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":57,"character":5}}]}],"closeResult":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":61,"character":5}}]}],"onApprove":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":77,"character":5},"arguments":["approved"]}]}],"onDeny":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":81,"character":5},"arguments":["denied"]}]}],"onDismiss":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":85,"character":5},"arguments":["dismissed"]}]}],"_modalElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":88,"character":5},"arguments":["modal"]}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":92,"character":5}}]}],"isFullScreen":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":99,"character":5}}]}],"isBasic":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":109,"character":5}}]}],"mustScroll":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":117,"character":5}}]}],"isInverted":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":132,"character":5}}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":144,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":148,"character":5}}]}],"templateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":157,"character":5},"arguments":["templateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":157,"character":42}}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":171,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":171,"character":62},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":171,"character":100}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"loadConfig":[{"__symbolic":"method"}],"dismiss":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"updateScroll":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method"}],"onDocumentKeyUp":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":291,"character":5},"arguments":["document:keyup",["$event"]]}]}],"onDocumentResize":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":299,"character":5},"arguments":["window:resize"]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/modal/index.d.ts b/dist/modules/modal/index.d.ts deleted file mode 100644 index 7fb60fe55..000000000 --- a/dist/modules/modal/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from "./classes/active-modal"; -export * from "./classes/modal-config"; -export * from "./classes/modal-controls"; -export * from "./classes/modal-template"; -export * from "./components/modal"; -export * from "./services/modal.service"; -export * from "./modal.module"; diff --git a/dist/modules/modal/index.js b/dist/modules/modal/index.js deleted file mode 100644 index 5c6f95bf6..000000000 --- a/dist/modules/modal/index.js +++ /dev/null @@ -1,8 +0,0 @@ -export * from "./classes/active-modal"; -export * from "./classes/modal-config"; -export * from "./classes/modal-controls"; -export * from "./classes/modal-template"; -export * from "./components/modal"; -export * from "./services/modal.service"; -export * from "./modal.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/modal/index.js.map b/dist/modules/modal/index.js.map deleted file mode 100644 index 6a5ab2536..000000000 --- a/dist/modules/modal/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/modal/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,gBAAgB,CAAC","sourcesContent":["export * from \"./classes/active-modal\";\nexport * from \"./classes/modal-config\";\nexport * from \"./classes/modal-controls\";\nexport * from \"./classes/modal-template\";\n\nexport * from \"./components/modal\";\n\nexport * from \"./services/modal.service\";\n\nexport * from \"./modal.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/modal/index.metadata.json b/dist/modules/modal/index.metadata.json deleted file mode 100644 index b79ad135e..000000000 --- a/dist/modules/modal/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/active-modal"},{"from":"./classes/modal-config"},{"from":"./classes/modal-controls"},{"from":"./classes/modal-template"},{"from":"./components/modal"},{"from":"./services/modal.service"},{"from":"./modal.module"}]}] \ No newline at end of file diff --git a/dist/modules/modal/modal.module.d.ts b/dist/modules/modal/modal.module.d.ts deleted file mode 100644 index e91373acc..000000000 --- a/dist/modules/modal/modal.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiModalModule { -} diff --git a/dist/modules/modal/modal.module.js b/dist/modules/modal/modal.module.js deleted file mode 100644 index 52c3bdb0a..000000000 --- a/dist/modules/modal/modal.module.js +++ /dev/null @@ -1,38 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiDimmerModule } from "../dimmer/index"; -import { SuiTransitionModule } from "../transition/index"; -import { SuiUtilityModule } from "../../misc/util/index"; -import { SuiModalService } from "./services/modal.service"; -import { SuiModal } from "./components/modal"; -var SuiModalModule = /** @class */ (function () { - function SuiModalModule() { - } - SuiModalModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule, - SuiDimmerModule, - SuiTransitionModule, - SuiUtilityModule - ], - declarations: [ - SuiModal - ], - exports: [ - SuiModal - ], - providers: [ - SuiModalService - ], - entryComponents: [ - SuiModal - ] - },] }, - ]; - /** @nocollapse */ - SuiModalModule.ctorParameters = function () { return []; }; - return SuiModalModule; -}()); -export { SuiModalModule }; -//# sourceMappingURL=modal.module.js.map \ No newline at end of file diff --git a/dist/modules/modal/modal.module.js.map b/dist/modules/modal/modal.module.js.map deleted file mode 100644 index 1c0b06951..000000000 --- a/dist/modules/modal/modal.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modal.module.js","sourceRoot":"","sources":["../../../src/modules/modal/modal.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;;;;;gBAE7C,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,eAAe;wBACf,mBAAmB;wBACnB,gBAAgB;qBACnB;oBACD,YAAY,EAAE;wBACV,QAAQ;qBACX;oBACD,OAAO,EAAE;wBACL,QAAQ;qBACX;oBACD,SAAS,EAAE;wBACP,eAAe;qBAClB;oBACD,eAAe,EAAE;wBACb,QAAQ;qBACX;iBACJ;;;;yBA3BD;;SA4Ba,cAAc","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiDimmerModule } from \"../dimmer/index\";\nimport { SuiTransitionModule } from \"../transition/index\";\nimport { SuiUtilityModule } from \"../../misc/util/index\";\nimport { SuiModalService } from \"./services/modal.service\";\nimport { SuiModal } from \"./components/modal\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiDimmerModule,\n SuiTransitionModule,\n SuiUtilityModule\n ],\n declarations: [\n SuiModal\n ],\n exports: [\n SuiModal\n ],\n providers: [\n SuiModalService\n ],\n entryComponents: [\n SuiModal\n ]\n})\nexport class SuiModalModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/modal.module.metadata.json b/dist/modules/modal/modal.module.metadata.json deleted file mode 100644 index e3e4cd35c..000000000 --- a/dist/modules/modal/modal.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiModalModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":8,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":10,"character":8},{"__symbolic":"reference","module":"../dimmer/index","name":"SuiDimmerModule","line":11,"character":8},{"__symbolic":"reference","module":"../transition/index","name":"SuiTransitionModule","line":12,"character":8},{"__symbolic":"reference","module":"../../misc/util/index","name":"SuiUtilityModule","line":13,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/modal","name":"SuiModal","line":16,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/modal","name":"SuiModal","line":19,"character":8}],"providers":[{"__symbolic":"reference","module":"./services/modal.service","name":"SuiModalService","line":22,"character":8}],"entryComponents":[{"__symbolic":"reference","module":"./components/modal","name":"SuiModal","line":25,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/modal/public.d.ts b/dist/modules/modal/public.d.ts deleted file mode 100644 index 0777eab8e..000000000 --- a/dist/modules/modal/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiModalModule, SuiModalService, Modal as SuiModal, ModalResult, ModalControls, ActiveModal as SuiActiveModal, ModalConfig, TemplateModalConfig, ComponentModalConfig, ModalTemplate, ModalSize } from "./index"; diff --git a/dist/modules/modal/public.js b/dist/modules/modal/public.js deleted file mode 100644 index 68adc35b3..000000000 --- a/dist/modules/modal/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiModalModule, SuiModalService, Modal as SuiModal, ModalControls, ActiveModal as SuiActiveModal, ModalConfig, TemplateModalConfig, ComponentModalConfig, ModalTemplate, ModalSize } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/modal/public.js.map b/dist/modules/modal/public.js.map deleted file mode 100644 index e106ac2cb..000000000 --- a/dist/modules/modal/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/modal/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EACd,eAAe,EACf,KAAK,IAAI,QAAQ,EAEjB,aAAa,EACb,WAAW,IAAI,cAAc,EAC7B,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACZ,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiModalModule,\n SuiModalService,\n Modal as SuiModal,\n ModalResult,\n ModalControls,\n ActiveModal as SuiActiveModal,\n ModalConfig,\n TemplateModalConfig,\n ComponentModalConfig,\n ModalTemplate,\n ModalSize\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/modal/public.metadata.json b/dist/modules/modal/public.metadata.json deleted file mode 100644 index 8c81fbf20..000000000 --- a/dist/modules/modal/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiModalModule","SuiModalService",{"name":"Modal","as":"SuiModal"},"ModalResult","ModalControls",{"name":"ActiveModal","as":"SuiActiveModal"},"ModalConfig","TemplateModalConfig","ComponentModalConfig","ModalTemplate","ModalSize"]}]}] \ No newline at end of file diff --git a/dist/modules/modal/services/modal.service.d.ts b/dist/modules/modal/services/modal.service.d.ts deleted file mode 100644 index 535e51488..000000000 --- a/dist/modules/modal/services/modal.service.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { SuiComponentFactory } from "../../../misc/util/index"; -import { ModalConfig } from "../classes/modal-config"; -import { ActiveModal } from "../classes/active-modal"; -export declare class SuiModalService { - private _componentFactory; - constructor(_componentFactory: SuiComponentFactory); - open(modal: ModalConfig): ActiveModal; -} diff --git a/dist/modules/modal/services/modal.service.js b/dist/modules/modal/services/modal.service.js deleted file mode 100644 index 0cc9e45d7..000000000 --- a/dist/modules/modal/services/modal.service.js +++ /dev/null @@ -1,65 +0,0 @@ -import { Injectable } from "@angular/core"; -import { SuiComponentFactory } from "../../../misc/util/index"; -import { TemplateModalConfig, ComponentModalConfig } from "../classes/modal-config"; -import { SuiModal } from "../components/modal"; -import { Modal } from "../classes/modal-controls"; -import { ActiveModal } from "../classes/active-modal"; -var SuiModalService = /** @class */ (function () { - function SuiModalService(_componentFactory) { - this._componentFactory = _componentFactory; - } - SuiModalService.prototype.open = function (modal) { - // Generate the modal component to be shown. - var componentRef = this._componentFactory.createComponent(SuiModal); - // Shorthand for the created modal component instance. - var modalComponent = componentRef.instance; - if (modal instanceof TemplateModalConfig) { - // Inject the template into the view. - this._componentFactory.createView(modalComponent.templateSibling, modal.template, { - // `let-context` - $implicit: modal.context, - // `let-modal="modal"` - modal: componentRef.instance.controls - }); - } - else if (modal instanceof ComponentModalConfig) { - // Generate the component to be used as the modal content, - // injecting an instance of `Modal` to be used in the component constructor. - var contentComponentRef = this._componentFactory.createComponent(modal.component, [ - { - provide: Modal, - useValue: new Modal(modalComponent.controls, modal.context) - } - ]); - // Insert the new component into the content of the modal. - this._componentFactory.attachToView(contentComponentRef, modalComponent.templateSibling); - // Shorthand for access to the content component's DOM element. - var contentElement = contentComponentRef.location.nativeElement; - // Move all of the DOM elements inside the component to the main modal element. - // This is done so that CSS classes apply correctly. It does stop any custom styles from working however, - // so other ways may have to be investigated. - while (contentElement.hasChildNodes() && contentElement.parentElement && contentElement.firstChild) { - contentElement.parentElement.appendChild(contentElement.removeChild(contentElement.firstChild)); - } - // Remove the generated component's 'empty shell' from the DOM. - this._componentFactory.detachFromDocument(contentComponentRef); - } - // Attach the new modal component to the application. - // The component will move itself to the document body for correctl styling. - this._componentFactory.attachToApplication(componentRef); - // Initialise the generated modal with the provided config. - modalComponent.loadConfig(modal); - // Return an instance of an `ActiveModal`, so the user can control the new modal. - return new ActiveModal(modal, componentRef); - }; - SuiModalService.decorators = [ - { type: Injectable }, - ]; - /** @nocollapse */ - SuiModalService.ctorParameters = function () { return [ - { type: SuiComponentFactory, }, - ]; }; - return SuiModalService; -}()); -export { SuiModalService }; -//# sourceMappingURL=modal.service.js.map \ No newline at end of file diff --git a/dist/modules/modal/services/modal.service.js.map b/dist/modules/modal/services/modal.service.js.map deleted file mode 100644 index d8f6e9d74..000000000 --- a/dist/modules/modal/services/modal.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modal.service.js","sourceRoot":"","sources":["../../../../src/modules/modal/services/modal.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAe,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;;IAIlD,yBAAoB,iBAAqC;QAArC,sBAAiB,GAAjB,iBAAiB,CAAoB;KAAI;IAEtD,8BAAI,GAAX,UAAqB,KAA0B;;QAE3C,IAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAiB,QAAQ,CAAC,CAAC;;QAGtF,IAAM,cAAc,GAAG,YAAY,CAAC,QAAQ,CAAC;QAE7C,EAAE,CAAC,CAAC,KAAK,YAAY,mBAAmB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","sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { SuiComponentFactory } from \"../../../misc/util/index\";\nimport { ModalConfig, TemplateModalConfig, ComponentModalConfig } from \"../classes/modal-config\";\nimport { SuiModal } from \"../components/modal\";\nimport { Modal } from \"../classes/modal-controls\";\nimport { ActiveModal } from \"../classes/active-modal\";\n\n@Injectable()\nexport class SuiModalService {\n constructor(private _componentFactory:SuiComponentFactory) {}\n\n public open(modal:ModalConfig):ActiveModal {\n // Generate the modal component to be shown.\n const componentRef = this._componentFactory.createComponent>(SuiModal);\n\n // Shorthand for the created modal component instance.\n const modalComponent = componentRef.instance;\n\n if (modal instanceof TemplateModalConfig) {\n // Inject the template into the view.\n this._componentFactory.createView(modalComponent.templateSibling, modal.template, {\n // `let-context`\n $implicit: modal.context,\n // `let-modal=\"modal\"`\n modal: componentRef.instance.controls\n });\n } else if (modal instanceof ComponentModalConfig) {\n // Generate the component to be used as the modal content,\n // injecting an instance of `Modal` to be used in the component constructor.\n const contentComponentRef = this._componentFactory.createComponent(\n modal.component,\n [\n {\n provide: Modal,\n useValue: new Modal(modalComponent.controls, modal.context)\n }\n ]\n );\n\n // Insert the new component into the content of the modal.\n this._componentFactory.attachToView(contentComponentRef, modalComponent.templateSibling);\n\n // Shorthand for access to the content component's DOM element.\n const contentElement = contentComponentRef.location.nativeElement as Element;\n\n // Move all of the DOM elements inside the component to the main modal element.\n // This is done so that CSS classes apply correctly. It does stop any custom styles from working however,\n // so other ways may have to be investigated.\n while (contentElement.hasChildNodes() && contentElement.parentElement && contentElement.firstChild) {\n contentElement.parentElement.appendChild(contentElement.removeChild(contentElement.firstChild));\n }\n // Remove the generated component's 'empty shell' from the DOM.\n this._componentFactory.detachFromDocument(contentComponentRef);\n }\n\n // Attach the new modal component to the application.\n // The component will move itself to the document body for correctl styling.\n this._componentFactory.attachToApplication(componentRef);\n\n // Initialise the generated modal with the provided config.\n modalComponent.loadConfig(modal);\n\n // Return an instance of an `ActiveModal`, so the user can control the new modal.\n return new ActiveModal(modal, componentRef);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/modal/services/modal.service.metadata.json b/dist/modules/modal/services/modal.service.metadata.json deleted file mode 100644 index 9ca6676c0..000000000 --- a/dist/modules/modal/services/modal.service.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiModalService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":7,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":9,"character":42}]}],"open":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-component-controller.d.ts b/dist/modules/popup/classes/popup-component-controller.d.ts deleted file mode 100644 index 940a0bd3a..000000000 --- a/dist/modules/popup/classes/popup-component-controller.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ElementRef, Type, Renderer2 } from "@angular/core"; -import { SuiComponentFactory } from "../../../misc/util/index"; -import { SuiPopupController } from "./popup-controller"; -import { PopupConfig } from "./popup-config"; -export declare class SuiPopupComponentController extends SuiPopupController { - private _component; - private _contentComponentRef?; - readonly componentInstance: T | undefined; - constructor(renderer: Renderer2, element: ElementRef, componentFactory: SuiComponentFactory, _component: Type, config: PopupConfig); - open(): void; - protected cleanup(): void; -} diff --git a/dist/modules/popup/classes/popup-component-controller.js b/dist/modules/popup/classes/popup-component-controller.js deleted file mode 100644 index 76327e848..000000000 --- a/dist/modules/popup/classes/popup-component-controller.js +++ /dev/null @@ -1,45 +0,0 @@ -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 __()); - }; -})(); -import { SuiPopupController } from "./popup-controller"; -var SuiPopupComponentController = /** @class */ (function (_super) { - __extends(SuiPopupComponentController, _super); - function SuiPopupComponentController(renderer, element, componentFactory, _component, config) { - var _this = _super.call(this, renderer, element, componentFactory, config) || this; - _this._component = _component; - return _this; - } - Object.defineProperty(SuiPopupComponentController.prototype, "componentInstance", { - get: function () { - if (this._contentComponentRef) { - return this._contentComponentRef.instance; - } - }, - enumerable: true, - configurable: true - }); - SuiPopupComponentController.prototype.open = function () { - if (!this._contentComponentRef) { - this._contentComponentRef = this._componentFactory.createComponent(this._component); - this._componentFactory.attachToView(this._contentComponentRef, this.popup.templateSibling); - } - _super.prototype.open.call(this); - }; - SuiPopupComponentController.prototype.cleanup = function () { - _super.prototype.cleanup.call(this); - if (this._contentComponentRef) { - this._contentComponentRef.destroy(); - this._contentComponentRef = undefined; - } - }; - return SuiPopupComponentController; -}(SuiPopupController)); -export { SuiPopupComponentController }; -//# sourceMappingURL=popup-component-controller.js.map \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-component-controller.js.map b/dist/modules/popup/classes/popup-component-controller.js.map deleted file mode 100644 index 462769fef..000000000 --- a/dist/modules/popup/classes/popup-component-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"popup-component-controller.js","sourceRoot":"","sources":["../../../../src/modules/popup/classes/popup-component-controller.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,IAAA;IAAoD,+CAAkB;IAUlE,qCAAY,QAAkB,EAClB,OAAkB,EAClB,gBAAoC,EAC5B,UAAkB,EAC1B,MAAkB;QAJ9B,YAMI,kBAAM,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC,SACrD;QAJmB,gBAAU,GAAV,UAAU,CAAQ;;KAIrC;IAbD,sBAAW,0DAAiB;aAA5B;YACI,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;gBAC5B,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC;aAC7C;SACJ;;;OAAA;IAWM,0CAAI,GAAX;QACI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;YAC7B,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,UAAqB,CAAC,CAAC;YAC/F,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;SAC9F;QAED,iBAAM,IAAI,WAAE,CAAC;KAChB;IAES,6CAAO,GAAjB;QACI,iBAAM,OAAO,WAAE,CAAC;QAEhB,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;YAC5B,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC;YACpC,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;SACzC;KACJ;sCAxCL;EAKoD,kBAAkB,EAoCrE,CAAA;AApCD,uCAoCC","sourcesContent":["import { ComponentRef, ElementRef, Type, Renderer2, OnDestroy } from \"@angular/core\";\nimport { SuiComponentFactory } from \"../../../misc/util/index\";\nimport { SuiPopupController } from \"./popup-controller\";\nimport { PopupConfig } from \"./popup-config\";\n\nexport class SuiPopupComponentController extends SuiPopupController {\n // Stores reference to generated content component.\n private _contentComponentRef?:ComponentRef;\n\n public get componentInstance():T | undefined {\n if (this._contentComponentRef) {\n return this._contentComponentRef.instance;\n }\n }\n\n constructor(renderer:Renderer2,\n element:ElementRef,\n componentFactory:SuiComponentFactory,\n private _component:Type,\n config:PopupConfig) {\n\n super(renderer, element, componentFactory, config);\n }\n\n public open():void {\n if (!this._contentComponentRef) {\n this._contentComponentRef = this._componentFactory.createComponent(this._component as Type);\n this._componentFactory.attachToView(this._contentComponentRef, this.popup.templateSibling);\n }\n\n super.open();\n }\n\n protected cleanup():void {\n super.cleanup();\n\n if (this._contentComponentRef) {\n this._contentComponentRef.destroy();\n this._contentComponentRef = undefined;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-component-controller.metadata.json b/dist/modules/popup/classes/popup-component-controller.metadata.json deleted file mode 100644 index c787c0d1a..000000000 --- a/dist/modules/popup/classes/popup-component-controller.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiPopupComponentController":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./popup-controller","name":"SuiPopupController","line":5,"character":52},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":15,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":16,"character":24},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":17,"character":33},{"__symbolic":"reference","module":"@angular/core","name":"Type","line":18,"character":35,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":18,"character":40,"context":{"typeName":"T"}}]},{"__symbolic":"reference","module":"./popup-config","name":"PopupConfig","line":19,"character":23}]}],"open":[{"__symbolic":"method"}],"cleanup":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-config.d.ts b/dist/modules/popup/classes/popup-config.d.ts deleted file mode 100644 index 9c471c590..000000000 --- a/dist/modules/popup/classes/popup-config.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { PositioningPlacement } from "../../../misc/util/index"; -export declare type PopupTrigger = "hover" | "click" | "outsideClick" | "focus" | "manual"; -export declare const PopupTrigger: { - Hover: PopupTrigger; - Click: PopupTrigger; - OutsideClick: PopupTrigger; - Focus: PopupTrigger; - Manual: PopupTrigger; -}; -export interface IPopupConfig { - header?: string; - text?: string; - placement?: PositioningPlacement; - trigger?: PopupTrigger; - isInverted?: boolean; - delay?: number; - isBasic?: boolean; - transition?: string; - transitionDuration?: number; -} -export declare class PopupConfig implements IPopupConfig { - header?: string; - text?: string; - placement: PositioningPlacement; - trigger: PopupTrigger; - isInverted: boolean; - delay: number; - isBasic: boolean; - transition: string; - transitionDuration: number; - constructor(defaults?: IPopupConfig); -} diff --git a/dist/modules/popup/classes/popup-config.js b/dist/modules/popup/classes/popup-config.js deleted file mode 100644 index dd546d26b..000000000 --- a/dist/modules/popup/classes/popup-config.js +++ /dev/null @@ -1,24 +0,0 @@ -import { PositioningPlacement } from "../../../misc/util/index"; -export var PopupTrigger = { - Hover: "hover", - Click: "click", - OutsideClick: "outsideClick", - Focus: "focus", - Manual: "manual" -}; -var PopupConfig = /** @class */ (function () { - function PopupConfig(defaults) { - if (defaults === void 0) { defaults = {}; } - this.placement = PositioningPlacement.TopLeft; - this.trigger = PopupTrigger.Hover; - this.isInverted = false; - this.delay = 0; - this.isBasic = false; - this.transition = "scale"; - this.transitionDuration = 200; - Object.assign(this, defaults); - } - return PopupConfig; -}()); -export { PopupConfig }; -//# sourceMappingURL=popup-config.js.map \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-config.js.map b/dist/modules/popup/classes/popup-config.js.map deleted file mode 100644 index 3eb53b4bb..000000000 --- a/dist/modules/popup/classes/popup-config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"popup-config.js","sourceRoot":"","sources":["../../../../src/modules/popup/classes/popup-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAKrF,MAAM,CAAC,IAAM,YAAY,GAAG;IACxB,KAAK,EAAE,OAAuB;IAC9B,KAAK,EAAE,OAAuB;IAC9B,YAAY,EAAE,cAA8B;IAC5C,KAAK,EAAE,OAAuB;IAC9B,MAAM,EAAE,QAAwB;CACnC,CAAC;AAcF,IAAA;IAWI,qBAAY,QAA0B;QAA1B,yBAAA,EAAA,aAA0B;QAClC,IAAI,CAAC,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;QAC1B,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC;QAE9B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACjC;sBA/CL;IAgDC,CAAA;AAtBD,uBAsBC","sourcesContent":["import { TemplateRef } from \"@angular/core\";\nimport { ITemplateRefContext, PositioningPlacement } from \"../../../misc/util/index\";\nimport { IPopup } from \"./popup-controller\";\n\nexport type PopupTrigger = \"hover\" | \"click\" | \"outsideClick\" | \"focus\" | \"manual\";\n\nexport const PopupTrigger = {\n Hover: \"hover\" as PopupTrigger,\n Click: \"click\" as PopupTrigger,\n OutsideClick: \"outsideClick\" as PopupTrigger,\n Focus: \"focus\" as PopupTrigger,\n Manual: \"manual\" as PopupTrigger\n};\n\nexport interface IPopupConfig {\n header?:string;\n text?:string;\n placement?:PositioningPlacement;\n trigger?:PopupTrigger;\n isInverted?:boolean;\n delay?:number;\n isBasic?:boolean;\n transition?:string;\n transitionDuration?:number;\n}\n\nexport class PopupConfig implements IPopupConfig {\n public header?:string;\n public text?:string;\n public placement:PositioningPlacement;\n public trigger:PopupTrigger;\n public isInverted:boolean;\n public delay:number;\n public isBasic:boolean;\n public transition:string;\n public transitionDuration:number;\n\n constructor(defaults:IPopupConfig = {}) {\n this.placement = PositioningPlacement.TopLeft;\n this.trigger = PopupTrigger.Hover;\n this.isInverted = false;\n this.delay = 0;\n this.isBasic = false;\n this.transition = \"scale\";\n this.transitionDuration = 200;\n\n Object.assign(this, defaults);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-config.metadata.json b/dist/modules/popup/classes/popup-config.metadata.json deleted file mode 100644 index e50cfb0b6..000000000 --- a/dist/modules/popup/classes/popup-config.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"PopupTrigger":{"Hover":"hover","Click":"click","OutsideClick":"outsideClick","Focus":"focus","Manual":"manual"},"IPopupConfig":{"__symbolic":"interface"},"PopupConfig":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-controller.d.ts b/dist/modules/popup/classes/popup-controller.d.ts deleted file mode 100644 index 5ba43c7c5..000000000 --- a/dist/modules/popup/classes/popup-controller.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { ElementRef, OnDestroy, Renderer2 } from "@angular/core"; -import { SuiComponentFactory } from "../../../misc/util/index"; -import { PopupConfig, IPopupConfig } from "./popup-config"; -import { SuiPopup } from "../components/popup"; -export interface IPopup { - open(): void; - close(): void; - toggle(): void; -} -export declare abstract class SuiPopupController implements IPopup, OnDestroy { - protected _element: ElementRef; - protected _componentFactory: SuiComponentFactory; - private _componentRef; - readonly popup: SuiPopup; - private _openingTimeout; - private _documentListener; - constructor(renderer: Renderer2, _element: ElementRef, _componentFactory: SuiComponentFactory, config: PopupConfig); - configure(config?: IPopupConfig): void; - openDelayed(): void; - open(): void; - close(): void; - toggleDelayed(): void; - toggle(): void; - private onMouseEnter(); - private onMouseLeave(); - private onClick(); - onDocumentClick(e: MouseEvent): void; - private onFocusIn(); - private onFocusOut(e); - protected cleanup(): void; - ngOnDestroy(): void; -} diff --git a/dist/modules/popup/classes/popup-controller.js b/dist/modules/popup/classes/popup-controller.js deleted file mode 100644 index 367f9119b..000000000 --- a/dist/modules/popup/classes/popup-controller.js +++ /dev/null @@ -1,149 +0,0 @@ -import { HostListener } from "@angular/core"; -import { PopupTrigger } from "./popup-config"; -import { SuiPopup } from "../components/popup"; -var SuiPopupController = /** @class */ (function () { - function SuiPopupController(renderer, _element, _componentFactory, config) { - var _this = this; - this._element = _element; - this._componentFactory = _componentFactory; - // Generate a new SuiPopup component and attach it to the application view. - this._componentRef = this._componentFactory.createComponent(SuiPopup); - // Configure popup with provided config. - this.popup.config = config; - // When the popup is closed (onClose fires on animation complete), - this.popup.onClose.subscribe(function () { return _this.cleanup(); }); - this._documentListener = renderer.listen("document", "click", function (e) { return _this.onDocumentClick(e); }); - } - Object.defineProperty(SuiPopupController.prototype, "popup", { - // Returns generated popup instance. - get: - // Returns generated popup instance. - function () { - // Use non-null assertion as we only access this when a popup exists. - return this._componentRef.instance; - }, - enumerable: true, - configurable: true - }); - SuiPopupController.prototype.configure = function (config) { - if (config) { - Object.assign(this.popup.config, config); - } - }; - SuiPopupController.prototype.openDelayed = function () { - var _this = this; - // Cancel the opening timer. - clearTimeout(this._openingTimeout); - // Start the popup opening after the specified delay interval. - this._openingTimeout = window.setTimeout(function () { return _this.open(); }, this.popup.config.delay); - }; - SuiPopupController.prototype.open = function () { - // Attach the generated component to the current application. - this._componentFactory.attachToApplication(this._componentRef); - // Move the generated element to the body to avoid any positioning issues. - this._componentFactory.moveToDocumentBody(this._componentRef); - // Attach a reference to the anchor element. We do it here because IE11 loves to complain. - this.popup.anchor = this._element; - // Start popup open transition. - this.popup.open(); - // Call lifecyle hook - var lifecycle = this.popupOnOpen; - if (lifecycle) { - lifecycle.call(this); - } - }; - SuiPopupController.prototype.close = function () { - // Cancel the opening timer to stop the popup opening after close has been called. - clearTimeout(this._openingTimeout); - if (this._componentRef) { - // Start popup close transition. - this.popup.close(); - } - // Call lifecyle hook - var lifecycle = this.popupOnClose; - if (lifecycle) { - lifecycle.call(this); - } - }; - SuiPopupController.prototype.toggleDelayed = function () { - // If the popup hasn't been created, or it has but it isn't currently open, open the popup. - if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) { - return this.openDelayed(); - } - // O'wise, close it. - return this.close(); - }; - SuiPopupController.prototype.toggle = function () { - // If the popup hasn't been created, or it has but it isn't currently open, open the popup. - if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) { - return this.open(); - } - // O'wise, close it. - return this.close(); - }; - SuiPopupController.prototype.onMouseEnter = function () { - if (this.popup.config.trigger === PopupTrigger.Hover) { - this.openDelayed(); - } - }; - SuiPopupController.prototype.onMouseLeave = function () { - if (this.popup.config.trigger === PopupTrigger.Hover) { - this.close(); - } - }; - SuiPopupController.prototype.onClick = function () { - if (this.popup.config.trigger === PopupTrigger.Click || - this.popup.config.trigger === PopupTrigger.OutsideClick) { - // Repeated clicks require a toggle, rather than just opening the popup each time. - this.toggleDelayed(); - } - else if (this.popup.config.trigger === PopupTrigger.Focus && - (!this._componentRef || (this._componentRef && !this.popup.isOpen))) { - // Repeated clicks with a focus trigger requires an open (as focus isn't ever lost on repeated click). - this.openDelayed(); - } - }; - SuiPopupController.prototype.onDocumentClick = function (e) { - // If the popup trigger is outside click, - if (this._componentRef && this.popup.config.trigger === PopupTrigger.OutsideClick) { - var target = e.target; - // Close the popup if the click is outside of the popup element. - if (!this._element.nativeElement.contains(target)) { - this.close(); - } - } - }; - SuiPopupController.prototype.onFocusIn = function () { - if (this.popup.config.trigger === PopupTrigger.Focus) { - this.openDelayed(); - } - }; - SuiPopupController.prototype.onFocusOut = function (e) { - if (!this._element.nativeElement.contains(e.relatedTarget) && - !this.popup.elementRef.nativeElement.contains(e.relatedTarget) && - this.popup.config.trigger === PopupTrigger.Focus) { - this.close(); - } - }; - SuiPopupController.prototype.cleanup = function () { - clearTimeout(this._openingTimeout); - if (this._componentRef.instance && this._componentRef.instance.positioningService) { - this._componentRef.instance.positioningService.destroy(); - } - this._componentFactory.detachFromApplication(this._componentRef); - }; - SuiPopupController.prototype.ngOnDestroy = function () { - this.cleanup(); - this._documentListener(); - }; - SuiPopupController.propDecorators = { - "onMouseEnter": [{ type: HostListener, args: ["mouseenter",] },], - "onMouseLeave": [{ type: HostListener, args: ["mouseleave",] },], - "onClick": [{ type: HostListener, args: ["click",] },], - "onFocusIn": [{ type: HostListener, args: ["focusin",] },], - "onFocusOut": [{ type: HostListener, args: ["focusout", ["$event"],] },], - }; - return SuiPopupController; -}()); -export { SuiPopupController }; -//# sourceMappingURL=popup-controller.js.map \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-controller.js.map b/dist/modules/popup/classes/popup-controller.js.map deleted file mode 100644 index bdca88f42..000000000 --- a/dist/modules/popup/classes/popup-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"popup-controller.js","sourceRoot":"","sources":["../../../../src/modules/popup/classes/popup-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAwB,MAAM,eAAe,CAAC;AAE7F,OAAO,EAAe,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;;IAyB3C,4BAAY,QAAkB,EACR,QAAmB,EACnB,iBAAqC,EAC/C,MAAkB;QAH9B,iBAeC;QAdqB,aAAQ,GAAR,QAAQ,CAAW;QACnB,sBAAiB,GAAjB,iBAAiB,CAAoB;;QAIvD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;;QAGtE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;;QAG3B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,OAAO,EAAE,EAAd,CAAc,CAAC,CAAC;QAEnD,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,UAAC,CAAY,IAAK,OAAA,KAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAvB,CAAuB,CAAC,CAAC;KAC5G;IA1BD,sBAAW,qCAAK;QADhB,oCAAoC;;;QACpC;;YAEI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;S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I,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;YAChF,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC;SAC5D;QAED,IAAI,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KACpE;IAEM,wCAAW,GAAlB;QACI,IAAI,CAAC,OAAO,EAAE,CAAC;QAEf,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC5B;;iCAtEA,YAAY,SAAC,YAAY;iCAOzB,YAAY,SAAC,YAAY;4BAOzB,YAAY,SAAC,OAAO;8BAyBpB,YAAY,SAAC,SAAS;+BAOtB,YAAY,SAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;6BAjKxC;;SAYsB,kBAAkB","sourcesContent":["import { ComponentRef, ElementRef, HostListener, OnDestroy, Renderer2 } from \"@angular/core\";\nimport { SuiComponentFactory } from \"../../../misc/util/index\";\nimport { PopupConfig, PopupTrigger, IPopupConfig } from \"./popup-config\";\nimport { SuiPopup } from \"../components/popup\";\nimport { IPopupLifecycle } from \"./popup-lifecycle\";\n\nexport interface IPopup {\n open():void;\n close():void;\n toggle():void;\n}\n\nexport abstract class SuiPopupController implements IPopup, OnDestroy {\n // Stores reference to generated popup component.\n private _componentRef:ComponentRef;\n\n // Returns generated popup instance.\n public get popup():SuiPopup {\n // Use non-null assertion as we only access this when a popup exists.\n return this._componentRef.instance;\n }\n\n // `setTimeout` timer pointer for delayed popup open.\n private _openingTimeout:number;\n\n // Function to remove the document click handler.\n private _documentListener:() => void;\n\n constructor(renderer:Renderer2,\n protected _element:ElementRef,\n protected _componentFactory:SuiComponentFactory,\n config:PopupConfig) {\n\n // Generate a new SuiPopup component and attach it to the application view.\n this._componentRef = this._componentFactory.createComponent(SuiPopup);\n\n // Configure popup with provided config.\n this.popup.config = config;\n\n // When the popup is closed (onClose fires on animation complete),\n this.popup.onClose.subscribe(() => this.cleanup());\n\n this._documentListener = renderer.listen(\"document\", \"click\", (e:MouseEvent) => this.onDocumentClick(e));\n }\n\n public configure(config?:IPopupConfig):void {\n if (config) {\n Object.assign(this.popup.config, config);\n }\n }\n\n public openDelayed():void {\n // Cancel the opening timer.\n clearTimeout(this._openingTimeout);\n\n // Start the popup opening after the specified delay interval.\n this._openingTimeout = window.setTimeout(() => this.open(), this.popup.config.delay);\n }\n\n public open():void {\n // Attach the generated component to the current application.\n this._componentFactory.attachToApplication(this._componentRef);\n\n // Move the generated element to the body to avoid any positioning issues.\n this._componentFactory.moveToDocumentBody(this._componentRef);\n\n // Attach a reference to the anchor element. We do it here because IE11 loves to complain.\n this.popup.anchor = this._element;\n\n // Start popup open transition.\n this.popup.open();\n\n // Call lifecyle hook\n const lifecycle = (this as IPopupLifecycle).popupOnOpen;\n if (lifecycle) {\n lifecycle.call(this);\n }\n }\n\n public close():void {\n // Cancel the opening timer to stop the popup opening after close has been called.\n clearTimeout(this._openingTimeout);\n\n if (this._componentRef) {\n // Start popup close transition.\n this.popup.close();\n }\n\n // Call lifecyle hook\n const lifecycle = (this as IPopupLifecycle).popupOnClose;\n if (lifecycle) {\n lifecycle.call(this);\n }\n }\n\n public toggleDelayed():void {\n // If the popup hasn't been created, or it has but it isn't currently open, open the popup.\n if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) {\n return this.openDelayed();\n }\n\n // O'wise, close it.\n return this.close();\n }\n\n public toggle():void {\n // If the popup hasn't been created, or it has but it isn't currently open, open the popup.\n if (!this._componentRef || (this._componentRef && !this.popup.isOpen)) {\n return this.open();\n }\n\n // O'wise, close it.\n return this.close();\n }\n\n @HostListener(\"mouseenter\")\n private onMouseEnter():void {\n if (this.popup.config.trigger === PopupTrigger.Hover) {\n this.openDelayed();\n }\n }\n\n @HostListener(\"mouseleave\")\n private onMouseLeave():void {\n if (this.popup.config.trigger === PopupTrigger.Hover) {\n this.close();\n }\n }\n\n @HostListener(\"click\")\n private onClick():void {\n if (this.popup.config.trigger === PopupTrigger.Click ||\n this.popup.config.trigger === PopupTrigger.OutsideClick) {\n\n // Repeated clicks require a toggle, rather than just opening the popup each time.\n this.toggleDelayed();\n } else if (this.popup.config.trigger === PopupTrigger.Focus &&\n (!this._componentRef || (this._componentRef && !this.popup.isOpen))) {\n // Repeated clicks with a focus trigger requires an open (as focus isn't ever lost on repeated click).\n this.openDelayed();\n }\n }\n\n public onDocumentClick(e:MouseEvent):void {\n // If the popup trigger is outside click,\n if (this._componentRef && this.popup.config.trigger === PopupTrigger.OutsideClick) {\n const target = e.target as Element;\n // Close the popup if the click is outside of the popup element.\n if (!(this._element.nativeElement as Element).contains(target)) {\n this.close();\n }\n }\n }\n\n @HostListener(\"focusin\")\n private onFocusIn():void {\n if (this.popup.config.trigger === PopupTrigger.Focus) {\n this.openDelayed();\n }\n }\n\n @HostListener(\"focusout\", [\"$event\"])\n private onFocusOut(e:any):void {\n if (!this._element.nativeElement.contains(e.relatedTarget) &&\n !this.popup.elementRef.nativeElement.contains(e.relatedTarget) &&\n this.popup.config.trigger === PopupTrigger.Focus) {\n\n this.close();\n }\n }\n\n protected cleanup():void {\n clearTimeout(this._openingTimeout);\n\n if (this._componentRef.instance && this._componentRef.instance.positioningService) {\n this._componentRef.instance.positioningService.destroy();\n }\n\n this._componentFactory.detachFromApplication(this._componentRef);\n }\n\n public ngOnDestroy():void {\n this.cleanup();\n\n this._documentListener();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-controller.metadata.json b/dist/modules/popup/classes/popup-controller.metadata.json deleted file mode 100644 index 9a828c227..000000000 --- a/dist/modules/popup/classes/popup-controller.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"IPopup":{"__symbolic":"interface"},"SuiPopupController":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":28,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":29,"character":35},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":30,"character":44},{"__symbolic":"reference","module":"./popup-config","name":"PopupConfig","line":31,"character":23}]}],"configure":[{"__symbolic":"method"}],"openDelayed":[{"__symbolic":"method"}],"open":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"toggleDelayed":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"onMouseEnter":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":115,"character":5},"arguments":["mouseenter"]}]}],"onMouseLeave":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":122,"character":5},"arguments":["mouseleave"]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":129,"character":5},"arguments":["click"]}]}],"onDocumentClick":[{"__symbolic":"method"}],"onFocusIn":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":154,"character":5},"arguments":["focusin"]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":161,"character":5},"arguments":["focusout",["$event"]]}]}],"cleanup":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-lifecycle.d.ts b/dist/modules/popup/classes/popup-lifecycle.d.ts deleted file mode 100644 index bffa28df2..000000000 --- a/dist/modules/popup/classes/popup-lifecycle.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface PopupAfterOpen { - popupOnOpen(): void; -} -export interface PopupAfterClose { - popupOnClose(): void; -} -export interface IPopupLifecycle { - popupOnOpen?(): void; - popupOnClose?(): void; -} diff --git a/dist/modules/popup/classes/popup-lifecycle.js b/dist/modules/popup/classes/popup-lifecycle.js deleted file mode 100644 index f6aaf6815..000000000 --- a/dist/modules/popup/classes/popup-lifecycle.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=popup-lifecycle.js.map \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-lifecycle.js.map b/dist/modules/popup/classes/popup-lifecycle.js.map deleted file mode 100644 index 56ee220ee..000000000 --- a/dist/modules/popup/classes/popup-lifecycle.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"popup-lifecycle.js","sourceRoot":"","sources":["../../../../src/modules/popup/classes/popup-lifecycle.ts"],"names":[],"mappings":"","sourcesContent":["// tslint:disable-next-line:ext-variable-name\nexport interface PopupAfterOpen {\n popupOnOpen():void;\n}\n\n// tslint:disable-next-line:ext-variable-name\nexport interface PopupAfterClose {\n popupOnClose():void;\n}\n\nexport interface IPopupLifecycle {\n popupOnOpen?():void;\n popupOnClose?():void;\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-lifecycle.metadata.json b/dist/modules/popup/classes/popup-lifecycle.metadata.json deleted file mode 100644 index 09a84c47d..000000000 --- a/dist/modules/popup/classes/popup-lifecycle.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"PopupAfterOpen":{"__symbolic":"interface"},"PopupAfterClose":{"__symbolic":"interface"},"IPopupLifecycle":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-template-controller.d.ts b/dist/modules/popup/classes/popup-template-controller.d.ts deleted file mode 100644 index de608a964..000000000 --- a/dist/modules/popup/classes/popup-template-controller.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { TemplateRef, Renderer2, ElementRef } from "@angular/core"; -import { SuiPopupController, IPopup } from "./popup-controller"; -import { SuiComponentFactory, IImplicitContext } from "../../../misc/util"; -import { PopupConfig, IPopupConfig } from "./popup-config"; -export interface ITemplatePopupContext extends IImplicitContext { - context?: T; -} -export interface ITemplatePopupConfig extends IPopupConfig { - template?: TemplateRef>; - context?: T; -} -export declare class TemplatePopupConfig extends PopupConfig { - template?: TemplateRef>; - context?: T; -} -export declare class SuiPopupTemplateController extends SuiPopupController { - template?: TemplateRef>; - context?: T; - constructor(renderer: Renderer2, element: ElementRef, componentFactory: SuiComponentFactory, config: PopupConfig); - configure(config?: ITemplatePopupConfig): void; - open(): void; -} diff --git a/dist/modules/popup/classes/popup-template-controller.js b/dist/modules/popup/classes/popup-template-controller.js deleted file mode 100644 index eea1ddb93..000000000 --- a/dist/modules/popup/classes/popup-template-controller.js +++ /dev/null @@ -1,49 +0,0 @@ -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 __()); - }; -})(); -import { TemplateRef } from "@angular/core"; -import { SuiPopupController } from "./popup-controller"; -import { PopupConfig } from "./popup-config"; -var templateRef = TemplateRef; -var TemplatePopupConfig = /** @class */ (function (_super) { - __extends(TemplatePopupConfig, _super); - function TemplatePopupConfig() { - return _super !== null && _super.apply(this, arguments) || this; - } - return TemplatePopupConfig; -}(PopupConfig)); -export { TemplatePopupConfig }; -var SuiPopupTemplateController = /** @class */ (function (_super) { - __extends(SuiPopupTemplateController, _super); - function SuiPopupTemplateController(renderer, element, componentFactory, config) { - return _super.call(this, renderer, element, componentFactory, config) || this; - } - SuiPopupTemplateController.prototype.configure = function (config) { - _super.prototype.configure.call(this, config); - if (config) { - this.template = config.template; - this.context = config.context; - } - }; - SuiPopupTemplateController.prototype.open = function () { - // If there is a template, inject it into the view. - if (this.template) { - this.popup.templateSibling.clear(); - this._componentFactory.createView(this.popup.templateSibling, this.template, { - $implicit: this.popup, - context: this.context - }); - } - _super.prototype.open.call(this); - }; - return SuiPopupTemplateController; -}(SuiPopupController)); -export { SuiPopupTemplateController }; -//# sourceMappingURL=popup-template-controller.js.map \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-template-controller.js.map b/dist/modules/popup/classes/popup-template-controller.js.map deleted file mode 100644 index 07f5246c4..000000000 --- a/dist/modules/popup/classes/popup-template-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"popup-template-controller.js","sourceRoot":"","sources":["../../../../src/modules/popup/classes/popup-template-controller.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAU,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAE3D,IAAM,WAAW,GAAG,WAAW,CAAC;AAWhC,IAAA;IAA4C,uCAAW;;;;8BAhBvD;EAgB4C,WAAW,EAGtD,CAAA;AAHD,+BAGC;AAED,IAAA;IAAmD,8CAAkB;IAIjE,oCAAY,QAAkB,EAClB,OAAkB,EAClB,gBAAoC,EACpC,MAAkB;eAE1B,kBAAM,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC;KACrD;IAEM,8CAAS,GAAhB,UAAiB,MAA+B;QAC5C,iBAAM,SAAS,YAAC,MAAM,CAAC,CAAC;QAExB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACT,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;YAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;SACjC;KACJ;IAEM,yCAAI,GAAX;;QAEI,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAChB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;YAEnC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,CAAC,QAAQ,EAAE;gBACzE,SAAS,EAAE,IAAI,CAAC,KAAK;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;aACxB,CAAC,CAAC;SACN;QAED,iBAAM,IAAI,WAAE,CAAC;KAChB;qCAtDL;EAqBmD,kBAAkB,EAkCpE,CAAA;AAlCD,sCAkCC","sourcesContent":["import { TemplateRef, Renderer2, ElementRef } from \"@angular/core\";\nimport { SuiPopupController, IPopup } from \"./popup-controller\";\nimport { ITemplateRefContext, SuiComponentFactory, IImplicitContext } from \"../../../misc/util\";\nimport { PopupConfig, IPopupConfig } from \"./popup-config\";\n\nconst templateRef = TemplateRef;\n\nexport interface ITemplatePopupContext extends IImplicitContext {\n context?:T;\n}\n\nexport interface ITemplatePopupConfig extends IPopupConfig {\n template?:TemplateRef>;\n context?:T;\n}\n\nexport class TemplatePopupConfig extends PopupConfig {\n public template?:TemplateRef>;\n public context?:T;\n}\n\nexport class SuiPopupTemplateController extends SuiPopupController {\n public template?:TemplateRef>;\n public context?:T;\n\n constructor(renderer:Renderer2,\n element:ElementRef,\n componentFactory:SuiComponentFactory,\n config:PopupConfig) {\n\n super(renderer, element, componentFactory, config);\n }\n\n public configure(config?:ITemplatePopupConfig):void {\n super.configure(config);\n\n if (config) {\n this.template = config.template;\n this.context = config.context;\n }\n }\n\n public open():void {\n // If there is a template, inject it into the view.\n if (this.template) {\n this.popup.templateSibling.clear();\n\n this._componentFactory.createView(this.popup.templateSibling, this.template, {\n $implicit: this.popup,\n context: this.context\n });\n }\n\n super.open();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/classes/popup-template-controller.metadata.json b/dist/modules/popup/classes/popup-template-controller.metadata.json deleted file mode 100644 index 65df6165f..000000000 --- a/dist/modules/popup/classes/popup-template-controller.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"ITemplatePopupContext":{"__symbolic":"interface"},"ITemplatePopupConfig":{"__symbolic":"interface"},"TemplatePopupConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./popup-config","name":"PopupConfig","line":16,"character":44},"arity":1},"SuiPopupTemplateController":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./popup-controller","name":"SuiPopupController","line":21,"character":51},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":25,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":26,"character":24},{"__symbolic":"reference","module":"../../../misc/util","name":"SuiComponentFactory","line":27,"character":33},{"__symbolic":"reference","module":"./popup-config","name":"PopupConfig","line":28,"character":23}]}],"configure":[{"__symbolic":"method"}],"open":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/components/popup-arrow.d.ts b/dist/modules/popup/components/popup-arrow.d.ts deleted file mode 100644 index cb4ad6d6f..000000000 --- a/dist/modules/popup/components/popup-arrow.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { PositioningPlacement } from "../../../misc/util/index"; -export declare class SuiPopupArrow { - placement: PositioningPlacement; - inverted: boolean; - readonly direction: string | undefined; - readonly alignment: string | undefined; -} diff --git a/dist/modules/popup/components/popup-arrow.js b/dist/modules/popup/components/popup-arrow.js deleted file mode 100644 index fcab5a75e..000000000 --- a/dist/modules/popup/components/popup-arrow.js +++ /dev/null @@ -1,44 +0,0 @@ -import { Component, Input, HostBinding } from "@angular/core"; -import { PositioningPlacement } from "../../../misc/util/index"; -var SuiPopupArrow = /** @class */ (function () { - function SuiPopupArrow() { - } - Object.defineProperty(SuiPopupArrow.prototype, "direction", { - get: function () { - if (this.placement) { - return this.placement.split(" ").shift(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupArrow.prototype, "alignment", { - get: function () { - if (this.placement) { - var alignment = this.placement.split(" ").pop(); - if (alignment === this.direction) { - return "center"; - } - return alignment; - } - }, - enumerable: true, - configurable: true - }); - SuiPopupArrow.decorators = [ - { type: Component, args: [{ - selector: "sui-popup-arrow", - template: "\n
\n
\n", - styles: ["\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction=\"top\"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction=\"left\"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction=\"bottom\"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction=\"right\"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"left\"],\n.static.arrow[direction=\"top\"][alignment=\"left\"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"top\"],\n.static.arrow[direction=\"right\"][alignment=\"top\"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"right\"],\n.static.arrow[direction=\"top\"][alignment=\"right\"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"bottom\"],\n.static.arrow[direction=\"right\"][alignment=\"bottom\"] {\n top: auto;\n bottom: 1em;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiPopupArrow.ctorParameters = function () { return []; }; - SuiPopupArrow.propDecorators = { - "placement": [{ type: Input },], - "inverted": [{ type: HostBinding, args: ["class.inverted",] }, { type: Input },], - }; - return SuiPopupArrow; -}()); -export { SuiPopupArrow }; -//# sourceMappingURL=popup-arrow.js.map \ No newline at end of file diff --git a/dist/modules/popup/components/popup-arrow.js.map b/dist/modules/popup/components/popup-arrow.js.map deleted file mode 100644 index 470833871..000000000 --- a/dist/modules/popup/components/popup-arrow.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"popup-arrow.js","sourceRoot":"","sources":["../../../../src/modules/popup/components/popup-arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;;;;IA6E5D,sBAAW,oCAAS;aAApB;YACI,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;aAC5C;SACJ;;;OAAA;IAED,sBAAW,oCAAS;aAApB;YACI,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;gBACjB,IAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;gBAClD,EAAE,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;oBAC/B,MAAM,CAAC,QAAQ,CAAC;iBACnB;gBACD,MAAM,CAAC,SAAS,CAAC;aACpB;SACJ;;;OAAA;;gBAzFJ,SAAS,SAAC;oBACP,QAAQ,EAAE,iBAAiB;oBAC3B,QAAQ,EAAE,0OAGb;oBACG,MAAM,EAAE,CAAC,2yCA2DZ,CAAC;iBACD;;;;;8BAEI,KAAK;6BAGL,WAAW,SAAC,gBAAgB,cAC5B,KAAK;;wBA3EV;;SAsEa,aAAa","sourcesContent":["import { Component, Input, HostBinding } from \"@angular/core\";\nimport { PositioningPlacement } from \"../../../misc/util/index\";\n\n@Component({\n selector: \"sui-popup-arrow\",\n template: `\n
\n
\n`,\n styles: [`\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction=\"top\"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction=\"left\"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction=\"bottom\"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction=\"right\"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"left\"],\n.static.arrow[direction=\"top\"][alignment=\"left\"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"top\"],\n.static.arrow[direction=\"right\"][alignment=\"top\"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"right\"],\n.static.arrow[direction=\"top\"][alignment=\"right\"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"bottom\"],\n.static.arrow[direction=\"right\"][alignment=\"bottom\"] {\n top: auto;\n bottom: 1em;\n}\n`]\n})\nexport class SuiPopupArrow {\n @Input()\n public placement:PositioningPlacement;\n\n @HostBinding(\"class.inverted\")\n @Input()\n public inverted:boolean;\n\n public get direction():string | undefined {\n if (this.placement) {\n return this.placement.split(\" \").shift();\n }\n }\n\n public get alignment():string | undefined {\n if (this.placement) {\n const alignment = this.placement.split(\" \").pop();\n if (alignment === this.direction) {\n return \"center\";\n }\n return alignment;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/components/popup-arrow.metadata.json b/dist/modules/popup/components/popup-arrow.metadata.json deleted file mode 100644 index 5768450ae..000000000 --- a/dist/modules/popup/components/popup-arrow.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiPopupArrow":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"sui-popup-arrow","template":"\n
\n
\n","styles":["\n.arrow {\n position: absolute;\n width: 0.71428571em;\n height: 0.71428571em;\n background: #ffffff;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n z-index: 2;\n}\n\n:host.inverted .arrow {\n background: #1b1c1d;\n}\n\n.arrow[direction=\"top\"] {\n bottom: -0.30714286em;\n box-shadow: 1px 1px 0 0 #bababc;\n}\n\n.arrow[direction=\"left\"] {\n right: -0.30714286em;\n box-shadow: 1px -1px 1px 0 #bababc;\n}\n\n.arrow[direction=\"bottom\"] {\n top: -0.30714286em;\n box-shadow: -1px -1px 0 0 #bababc;\n}\n\n.arrow[direction=\"right\"] {\n left: -0.30714286em;\n box-shadow: -1px 1px 1px 0 #bababc;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"left\"],\n.static.arrow[direction=\"top\"][alignment=\"left\"] {\n left: 1em;\n right: auto;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"top\"],\n.static.arrow[direction=\"right\"][alignment=\"top\"] {\n top: 1em;\n bottom: auto;\n}\n\n.static.arrow[direction=\"bottom\"][alignment=\"right\"],\n.static.arrow[direction=\"top\"][alignment=\"right\"] {\n left: auto;\n right: 1em;\n}\n\n.static.arrow[direction=\"left\"][alignment=\"bottom\"],\n.static.arrow[direction=\"right\"][alignment=\"bottom\"] {\n top: auto;\n bottom: 1em;\n}\n"]}]}],"members":{"placement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":71,"character":5}}]}],"inverted":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":74,"character":5},"arguments":["class.inverted"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":75,"character":5}}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/components/popup.d.ts b/dist/modules/popup/components/popup.d.ts deleted file mode 100644 index 06b5972a4..000000000 --- a/dist/modules/popup/components/popup.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { ViewContainerRef, ElementRef, EventEmitter } from "@angular/core"; -import { PositioningService, IDynamicClasses } from "../../../misc/util/index"; -import { TransitionController } from "../../transition/index"; -import { IPopup } from "../classes/popup-controller"; -import { TemplatePopupConfig } from "../classes/popup-template-controller"; -export declare class SuiPopup implements IPopup { - elementRef: ElementRef; - config: TemplatePopupConfig; - transitionController: TransitionController; - positioningService: PositioningService; - private _isOpen; - closingTimeout: number; - onOpen: EventEmitter; - onClose: EventEmitter; - readonly isOpen: boolean; - private _container; - anchor: ElementRef; - readonly direction: string | undefined; - readonly alignment: string | undefined; - readonly dynamicClasses: IDynamicClasses; - templateSibling: ViewContainerRef; - private _tabindex; - constructor(elementRef: ElementRef); - open(): void; - toggle(): void; - close(): void; - onClick(event: MouseEvent): void; -} diff --git a/dist/modules/popup/components/popup.js b/dist/modules/popup/components/popup.js deleted file mode 100644 index d3639ccd2..000000000 --- a/dist/modules/popup/components/popup.js +++ /dev/null @@ -1,143 +0,0 @@ -import { Component, ViewChild, ViewContainerRef, ElementRef, EventEmitter, HostListener, HostBinding } from "@angular/core"; -import { PositioningService } from "../../../misc/util/index"; -import { TransitionController, TransitionDirection, Transition } from "../../transition/index"; -var SuiPopup = /** @class */ (function () { - function SuiPopup(elementRef) { - this.elementRef = elementRef; - this.transitionController = new TransitionController(false); - this._isOpen = false; - this.onOpen = new EventEmitter(); - this.onClose = new EventEmitter(); - this._tabindex = 0; - } - Object.defineProperty(SuiPopup.prototype, "isOpen", { - get: function () { - return this._isOpen; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopup.prototype, "anchor", { - set: function (anchor) { - // Whenever the anchor is set (which is when the popup is created), recreate the positioning service with the appropriate options. - this.positioningService = new PositioningService(anchor, this._container.element, this.config.placement, ".dynamic.arrow"); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopup.prototype, "direction", { - // Returns the direction (`top`, `left`, `right`, `bottom`) of the current placement. - get: - // Returns the direction (`top`, `left`, `right`, `bottom`) of the current placement. - function () { - if (this.positioningService) { - return this.positioningService.actualPlacement.split(" ").shift(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopup.prototype, "alignment", { - // Returns the alignment (`top`, `left`, `right`, `bottom`) of the current placement. - get: - // Returns the alignment (`top`, `left`, `right`, `bottom`) of the current placement. - function () { - if (this.positioningService) { - return this.positioningService.actualPlacement.split(" ").pop(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopup.prototype, "dynamicClasses", { - get: function () { - var classes = {}; - if (this.direction) { - classes[this.direction] = true; - } - if (this.alignment) { - classes[this.alignment] = true; - } - if (this.config.isInverted) { - classes.inverted = true; - } - if (this.config.isBasic) { - classes.basic = true; - } - return classes; - }, - enumerable: true, - configurable: true - }); - SuiPopup.prototype.open = function () { - var _this = this; - // Only attempt to open if currently closed. - if (!this.isOpen) { - // Cancel the closing timer. - clearTimeout(this.closingTimeout); - // Cancel all other transitions, and initiate the opening transition. - this.transitionController.stopAll(); - this.transitionController.animate(new Transition(this.config.transition, this.config.transitionDuration, TransitionDirection.In, function () { - // Focus any element with [autofocus] attribute. - var autoFocus = _this.elementRef.nativeElement.querySelector("[autofocus]"); - if (autoFocus) { - // Autofocus after the browser has had time to process other event handlers. - setTimeout(function () { return autoFocus.focus(); }, 10); - // Try to focus again when the modal has opened so that autofocus works in IE11. - setTimeout(function () { return autoFocus.focus(); }, _this.config.transitionDuration); - } - })); - // Refresh the popup position after a brief delay to allow for browser processing time. - this.positioningService.placement = this.config.placement; - setTimeout(function () { return _this.positioningService.update(); }); - // Finally, set the popup to be open. - this._isOpen = true; - this.onOpen.emit(); - } - }; - SuiPopup.prototype.toggle = function () { - if (!this.isOpen) { - return this.open(); - } - return this.close(); - }; - SuiPopup.prototype.close = function () { - var _this = this; - // Only attempt to close if currently open. - if (this.isOpen) { - // Cancel all other transitions, and initiate the closing transition. - this.transitionController.stopAll(); - this.transitionController.animate(new Transition(this.config.transition, this.config.transitionDuration, TransitionDirection.Out)); - // Cancel the closing timer. - clearTimeout(this.closingTimeout); - // Start the closing timer, that fires the `onClose` event after the transition duration number of milliseconds. - this.closingTimeout = window.setTimeout(function () { return _this.onClose.emit(); }, this.config.transitionDuration); - // Finally, set the popup to be closed. - this._isOpen = false; - } - }; - SuiPopup.prototype.onClick = function (event) { - // Makes sense here, as the popup shouldn't be attached to any DOM element. - event.stopPropagation(); - }; - SuiPopup.decorators = [ - { type: Component, args: [{ - selector: "sui-popup", - template: "\n
\n\n \n
{{ config.header }}
\n
{{ config.text }}
\n
\n
\n\n \n
\n", - styles: ["\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor's mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed 'vertically'. */\n.ui.popup[direction=\"top\"],\n.ui.popup[direction=\"bottom\"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed 'horizontally'. */\n.ui.popup[direction=\"left\"],\n.ui.popup[direction=\"right\"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiPopup.ctorParameters = function () { return [ - { type: ElementRef, }, - ]; }; - SuiPopup.propDecorators = { - "_container": [{ type: ViewChild, args: ["container", { read: ViewContainerRef },] },], - "templateSibling": [{ type: ViewChild, args: ["templateSibling", { read: ViewContainerRef },] },], - "_tabindex": [{ type: HostBinding, args: ["attr.tabindex",] },], - "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], - }; - return SuiPopup; -}()); -export { SuiPopup }; -//# sourceMappingURL=popup.js.map \ No newline at end of file diff --git a/dist/modules/popup/components/popup.js.map b/dist/modules/popup/components/popup.js.map deleted file mode 100644 index a494a5792..000000000 --- a/dist/modules/popup/components/popup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"popup.js","sourceRoot":"","sources":["../../../../src/modules/popup/components/popup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAE,kBAAkB,EAAmB,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;IA6H3F,kBAAmB,UAAqB;QAArB,eAAU,GAAV,UAAU,CAAW;QACpC,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAE5D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QAErB,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,EAAQ,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,YAAY,EAAQ,CAAC;QAExC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;KACtB;IA5DD,sBAAW,4BAAM;aAAjB;YACI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;SACvB;;;OAAA;IAMD,sBAAW,4BAAM;aAAjB,UAAkB,MAAiB;;YAE/B,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;SAC9H;;;OAAA;IAGD,sBAAW,+BAAS;QADpB,qFAAqF;;;QACrF;YACI,EAAE,CAAC,CAAC,IAAI,CAAC,kBAA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AAE,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC;;YAGrG,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;;YAElC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,cAAM,OAAA,KAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAnB,CAAmB,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;;YAGnG,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;SACxB;KACJ;IAGM,0BAAO,aAAC,KAAgB;;QAE3B,KAAK,CAAC,eAAe,EAAE,CAAC;;;gBA/L/B,SAAS,SAAC;oBACP,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE,0oBAiBb;oBACG,MAAM,EAAE,CAAC,42BA+BZ,CAAC;iBACD;;;;gBA1DgD,UAAU;;;+BAiFtD,SAAS,SAAC,WAAW,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;oCAwCjD,SAAS,SAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;8BAGvD,WAAW,SAAC,eAAe;4BAsE3B,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;mBAlMrC;;SA2Da,QAAQ","sourcesContent":["import { Component, ViewChild, ViewContainerRef, ElementRef, EventEmitter, HostListener, HostBinding } from \"@angular/core\";\nimport { PositioningService, IDynamicClasses } from \"../../../misc/util/index\";\nimport { TransitionController, TransitionDirection, Transition } from \"../../transition/index\";\nimport { IPopup } from \"../classes/popup-controller\";\nimport { TemplatePopupConfig } from \"../classes/popup-template-controller\";\n\n@Component({\n selector: \"sui-popup\",\n template: `\n
\n\n \n
{{ config.header }}
\n
{{ config.text }}
\n
\n
\n\n \n
\n`,\n styles: [`\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor's mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed 'vertically'. */\n.ui.popup[direction=\"top\"],\n.ui.popup[direction=\"bottom\"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed 'horizontally'. */\n.ui.popup[direction=\"left\"],\n.ui.popup[direction=\"right\"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n`]\n})\nexport class SuiPopup implements IPopup {\n // Config settings for this popup.\n public config:TemplatePopupConfig;\n\n public transitionController:TransitionController;\n public positioningService:PositioningService;\n\n // Keeps track of whether the popup is open internally.\n private _isOpen:boolean;\n // `setTimeout` timer pointer for cancelling popup close.\n public closingTimeout:number;\n\n // Fires when the popup opens (and the animation is completed).\n public onOpen:EventEmitter;\n // Fires when the popup closes (and the animation is completed).\n public onClose:EventEmitter;\n\n public get isOpen():boolean {\n return this._isOpen;\n }\n\n // `ElementRef` for the positioning subject.\n @ViewChild(\"container\", { read: ViewContainerRef })\n private _container:ViewContainerRef;\n\n public set anchor(anchor:ElementRef) {\n // Whenever the anchor is set (which is when the popup is created), recreate the positioning service with the appropriate options.\n this.positioningService = new PositioningService(anchor, this._container.element, this.config.placement, \".dynamic.arrow\");\n }\n\n // Returns the direction (`top`, `left`, `right`, `bottom`) of the current placement.\n public get direction():string | undefined {\n if (this.positioningService) {\n return this.positioningService.actualPlacement.split(\" \").shift();\n }\n }\n\n // Returns the alignment (`top`, `left`, `right`, `bottom`) of the current placement.\n public get alignment():string | undefined {\n if (this.positioningService) {\n return this.positioningService.actualPlacement.split(\" \").pop();\n }\n }\n\n public get dynamicClasses():IDynamicClasses {\n const classes:IDynamicClasses = {};\n if (this.direction) {\n classes[this.direction] = true;\n }\n if (this.alignment) {\n classes[this.alignment] = true;\n }\n if (this.config.isInverted) {\n classes.inverted = true;\n }\n if (this.config.isBasic) {\n classes.basic = true;\n }\n return classes;\n }\n\n // `ViewContainerRef` for the element the template gets injected as a sibling of.\n @ViewChild(\"templateSibling\", { read: ViewContainerRef })\n public templateSibling:ViewContainerRef;\n\n @HostBinding(\"attr.tabindex\")\n private _tabindex:number;\n\n constructor(public elementRef:ElementRef) {\n this.transitionController = new TransitionController(false);\n\n this._isOpen = false;\n\n this.onOpen = new EventEmitter();\n this.onClose = new EventEmitter();\n\n this._tabindex = 0;\n }\n\n public open():void {\n // Only attempt to open if currently closed.\n if (!this.isOpen) {\n // Cancel the closing timer.\n clearTimeout(this.closingTimeout);\n\n // Cancel all other transitions, and initiate the opening transition.\n this.transitionController.stopAll();\n this.transitionController.animate(\n new Transition(this.config.transition, this.config.transitionDuration, TransitionDirection.In, () => {\n // Focus any element with [autofocus] attribute.\n const autoFocus = this.elementRef.nativeElement.querySelector(\"[autofocus]\") as HTMLElement | null;\n if (autoFocus) {\n // Autofocus after the browser has had time to process other event handlers.\n setTimeout(() => autoFocus.focus(), 10);\n // Try to focus again when the modal has opened so that autofocus works in IE11.\n setTimeout(() => autoFocus.focus(), this.config.transitionDuration);\n }\n }));\n\n // Refresh the popup position after a brief delay to allow for browser processing time.\n this.positioningService.placement = this.config.placement;\n setTimeout(() => this.positioningService.update());\n\n // Finally, set the popup to be open.\n this._isOpen = true;\n this.onOpen.emit();\n }\n }\n\n public toggle():void {\n if (!this.isOpen) {\n return this.open();\n }\n\n return this.close();\n }\n\n public close():void {\n // Only attempt to close if currently open.\n if (this.isOpen) {\n // Cancel all other transitions, and initiate the closing transition.\n this.transitionController.stopAll();\n this.transitionController.animate(\n new Transition(this.config.transition, this.config.transitionDuration, TransitionDirection.Out));\n\n // Cancel the closing timer.\n clearTimeout(this.closingTimeout);\n // Start the closing timer, that fires the `onClose` event after the transition duration number of milliseconds.\n this.closingTimeout = window.setTimeout(() => this.onClose.emit(), this.config.transitionDuration);\n\n // Finally, set the popup to be closed.\n this._isOpen = false;\n }\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(event:MouseEvent):void {\n // Makes sense here, as the popup shouldn't be attached to any DOM element.\n event.stopPropagation();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/components/popup.metadata.json b/dist/modules/popup/components/popup.metadata.json deleted file mode 100644 index 659aa0c15..000000000 --- a/dist/modules/popup/components/popup.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiPopup":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"sui-popup","template":"\n
\n\n \n
{{ config.header }}
\n
{{ config.text }}
\n
\n
\n\n \n
\n","styles":["\n.ui.popup {\n /* Autofit popup to the contents. */\n right: auto;\n}\n\n.ui.animating.popup {\n /* When the popup is animating, it may not initially be in the correct position.\n This fires a mouse event, causing the anchor's mouseleave to fire - making the popup flicker.\n Setting pointer-events to none while animating fixes this bug. */\n pointer-events: none;\n}\n\n.ui.popup::before {\n /* Hide the Semantic UI CSS arrow. */\n display: none;\n}\n\n/* Offset popup by 0.75em above and below when placed 'vertically'. */\n.ui.popup[direction=\"top\"],\n.ui.popup[direction=\"bottom\"] {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n\n/* Offset popup by 0.75em either side when placed 'horizontally'. */\n.ui.popup[direction=\"left\"],\n.ui.popup[direction=\"right\"] {\n margin-left: 0.75em;\n margin-right: 0.75em;\n}\n"]}]}],"members":{"_container":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":81,"character":5},"arguments":["container",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":81,"character":36}}]}]}],"templateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":121,"character":5},"arguments":["templateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":121,"character":42}}]}]}],"_tabindex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":124,"character":5},"arguments":["attr.tabindex"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":127,"character":34}]}],"open":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":194,"character":5},"arguments":["click",["$event"]]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/directives/popup.directive.d.ts b/dist/modules/popup/directives/popup.directive.d.ts deleted file mode 100644 index d2615e178..000000000 --- a/dist/modules/popup/directives/popup.directive.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { ElementRef, TemplateRef, Renderer2 } from "@angular/core"; -import { PositioningPlacement, SuiComponentFactory } from "../../../misc/util/index"; -import { PopupTrigger } from "../classes/popup-config"; -import { SuiPopupConfig } from "../services/popup.service"; -import { SuiPopupTemplateController, ITemplatePopupContext, ITemplatePopupConfig } from "../classes/popup-template-controller"; -export declare class SuiPopupDirective extends SuiPopupTemplateController { - popupHeader: string; - popupText: string; - popupInverted: boolean; - popupBasic: boolean; - popupTransition: string; - popupTransitionDuration: number; - popupPlacement: PositioningPlacement; - popupDelay: number; - popupTrigger: PopupTrigger; - popupTemplate: TemplateRef> | undefined; - popupTemplateContext: T | undefined; - popupConfig: ITemplatePopupConfig | undefined; - constructor(renderer: Renderer2, element: ElementRef, componentFactory: SuiComponentFactory, popupDefaults: SuiPopupConfig); -} diff --git a/dist/modules/popup/directives/popup.directive.js b/dist/modules/popup/directives/popup.directive.js deleted file mode 100644 index 22fde1996..000000000 --- a/dist/modules/popup/directives/popup.directive.js +++ /dev/null @@ -1,139 +0,0 @@ -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 __()); - }; -})(); -import { Directive, Input, ElementRef, TemplateRef, Renderer2 } from "@angular/core"; -import { Util, PositioningPlacement, SuiComponentFactory } from "../../../misc/util/index"; -import { PopupConfig, PopupTrigger } from "../classes/popup-config"; -import { SuiPopupConfig } from "../services/popup.service"; -import { SuiPopupTemplateController } from "../classes/popup-template-controller"; -var templateRef = TemplateRef; -var SuiPopupDirective = /** @class */ (function (_super) { - __extends(SuiPopupDirective, _super); - function SuiPopupDirective(renderer, element, componentFactory, popupDefaults) { - return _super.call(this, renderer, element, componentFactory, new PopupConfig(popupDefaults)) || this; - } - Object.defineProperty(SuiPopupDirective.prototype, "popupHeader", { - set: function (header) { - this.popup.config.header = header; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupText", { - set: function (text) { - this.popup.config.text = text; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupInverted", { - set: function (inverted) { - this.popup.config.isInverted = Util.DOM.parseBooleanAttribute(inverted); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupBasic", { - set: function (basic) { - this.popup.config.isBasic = Util.DOM.parseBooleanAttribute(basic); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupTransition", { - set: function (transition) { - this.popup.config.transition = transition; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupTransitionDuration", { - set: function (duration) { - this.popup.config.transitionDuration = duration; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupPlacement", { - set: function (placement) { - this.popup.config.placement = placement; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupDelay", { - set: function (delay) { - this.popup.config.delay = delay; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupTrigger", { - get: function () { - return this.popup.config.trigger; - }, - set: function (trigger) { - this.popup.config.trigger = trigger; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupTemplate", { - set: function (template) { - this.template = template; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupTemplateContext", { - set: function (context) { - this.context = context; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiPopupDirective.prototype, "popupConfig", { - set: function (config) { - this.configure(config); - }, - enumerable: true, - configurable: true - }); - SuiPopupDirective.decorators = [ - { type: Directive, args: [{ - selector: "[suiPopup]", - exportAs: "suiPopup" - },] }, - ]; - /** @nocollapse */ - SuiPopupDirective.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - { type: SuiComponentFactory, }, - { type: SuiPopupConfig, }, - ]; }; - SuiPopupDirective.propDecorators = { - "popupHeader": [{ type: Input },], - "popupText": [{ type: Input },], - "popupInverted": [{ type: Input },], - "popupBasic": [{ type: Input },], - "popupTransition": [{ type: Input },], - "popupTransitionDuration": [{ type: Input },], - "popupPlacement": [{ type: Input },], - "popupDelay": [{ type: Input },], - "popupTrigger": [{ type: Input },], - "popupTemplate": [{ type: Input },], - "popupTemplateContext": [{ type: Input },], - "popupConfig": [{ type: Input },], - }; - return SuiPopupDirective; -}(SuiPopupTemplateController)); -export { SuiPopupDirective }; -//# sourceMappingURL=popup.directive.js.map \ No newline at end of file diff --git a/dist/modules/popup/directives/popup.directive.js.map b/dist/modules/popup/directives/popup.directive.js.map deleted file mode 100644 index 0b288a9f2..000000000 --- a/dist/modules/popup/directives/popup.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"popup.directive.js","source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uB;uBAAC,QAAe;YAC9C,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,GAAG,QAAQ,CAAC;;;;;0BAIzC,6CAAc;uBAAC,SAA8B;YACpD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;;;;;0BAIjC,yCAAU;uBAAC,KAAY;YAC9B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;;;;;0BAIzB,2CAAY;;YACnB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;;aAGrC,UAAwB,OAAoB;YACxC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;SACvC;;;;0BAGU,4CAAa;uBAAC,QAA0D;YAC/E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;;;;;0BAIlB,mDAAoB;uBAAC,OAAqB;YACjD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;;;;0BAIhB,0CAAW;uBAAC,MAA0C;YAC7D,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;;;;;;gBAlE9B,SAAS,SAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,UAAU;iBACvB;;;;gBAbmD,SAAS;gBAAlC,UAAU;gBACqB,mBAAmB;gBAGpE,cAAc;;;gCAWlB,KAAK;8BAKL,KAAK;kCAKL,KAAK;+BAKL,KAAK;oCAKL,KAAK;4CAKL,KAAK;mCAKL,KAAK;+BAKL,KAAK;iCAKL,KAAK;kCASL,KAAK;yCAKL,KAAK;gCAKL,KAAK;;4BA1EV;EAc0C,0BAA0B;SAAvD,iBAAiB","sourcesContent":["import { Directive, Input, ElementRef, TemplateRef, Renderer2 } from \"@angular/core\";\nimport { ITemplateRefContext, Util, PositioningPlacement, SuiComponentFactory } from \"../../../misc/util/index\";\nimport { SuiPopup } from \"../components/popup\";\nimport { PopupConfig, PopupTrigger } from \"../classes/popup-config\";\nimport { SuiPopupConfig } from \"../services/popup.service\";\nimport { SuiPopupController } from \"../classes/popup-controller\";\nimport { SuiPopupTemplateController, ITemplatePopupContext, ITemplatePopupConfig } from \"../classes/popup-template-controller\";\n\nconst templateRef = TemplateRef;\n\n@Directive({\n selector: \"[suiPopup]\",\n exportAs: \"suiPopup\"\n})\nexport class SuiPopupDirective extends SuiPopupTemplateController {\n @Input()\n public set popupHeader(header:string) {\n this.popup.config.header = header;\n }\n\n @Input()\n public set popupText(text:string) {\n this.popup.config.text = text;\n }\n\n @Input()\n public set popupInverted(inverted:boolean) {\n this.popup.config.isInverted = Util.DOM.parseBooleanAttribute(inverted);\n }\n\n @Input()\n public set popupBasic(basic:boolean) {\n this.popup.config.isBasic = Util.DOM.parseBooleanAttribute(basic);\n }\n\n @Input()\n public set popupTransition(transition:string) {\n this.popup.config.transition = transition;\n }\n\n @Input()\n public set popupTransitionDuration(duration:number) {\n this.popup.config.transitionDuration = duration;\n }\n\n @Input()\n public set popupPlacement(placement:PositioningPlacement) {\n this.popup.config.placement = placement;\n }\n\n @Input()\n public set popupDelay(delay:number) {\n this.popup.config.delay = delay;\n }\n\n @Input()\n public get popupTrigger():PopupTrigger {\n return this.popup.config.trigger;\n }\n\n public set popupTrigger(trigger:PopupTrigger) {\n this.popup.config.trigger = trigger;\n }\n\n @Input()\n public set popupTemplate(template:TemplateRef> | undefined) {\n this.template = template;\n }\n\n @Input()\n public set popupTemplateContext(context:T | undefined) {\n this.context = context;\n }\n\n @Input()\n public set popupConfig(config:ITemplatePopupConfig | undefined) {\n this.configure(config);\n }\n\n constructor(renderer:Renderer2,\n element:ElementRef,\n componentFactory:SuiComponentFactory,\n popupDefaults:SuiPopupConfig) {\n\n super(renderer, element, componentFactory, new PopupConfig(popupDefaults));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/directives/popup.directive.metadata.json b/dist/modules/popup/directives/popup.directive.metadata.json deleted file mode 100644 index ec3e547a3..000000000 --- a/dist/modules/popup/directives/popup.directive.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiPopupDirective":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../classes/popup-template-controller","name":"SuiPopupTemplateController","line":14,"character":42},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":10,"character":1},"arguments":[{"selector":"[suiPopup]","exportAs":"suiPopup"}]}],"members":{"popupHeader":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":5}}]}],"popupText":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":5}}]}],"popupInverted":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":5}}]}],"popupBasic":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":5}}]}],"popupTransition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":5}}]}],"popupTransitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":5}}]}],"popupPlacement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":5}}]}],"popupDelay":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":5}}]}],"popupTrigger":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":5}}]}],"popupTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5}}]}],"popupTemplateContext":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":69,"character":5}}]}],"popupConfig":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":74,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":79,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":80,"character":24},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":81,"character":33},{"__symbolic":"reference","module":"../services/popup.service","name":"SuiPopupConfig","line":82,"character":30}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/popup/index.d.ts b/dist/modules/popup/index.d.ts deleted file mode 100644 index 5893ad9bf..000000000 --- a/dist/modules/popup/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from "./classes/popup-component-controller"; -export * from "./classes/popup-config"; -export * from "./classes/popup-controller"; -export * from "./classes/popup-lifecycle"; -export * from "./classes/popup-template-controller"; -export * from "./components/popup-arrow"; -export * from "./components/popup"; -export * from "./directives/popup.directive"; -export * from "./services/popup.service"; -export * from "./popup.module"; diff --git a/dist/modules/popup/index.js b/dist/modules/popup/index.js deleted file mode 100644 index ee9b35353..000000000 --- a/dist/modules/popup/index.js +++ /dev/null @@ -1,10 +0,0 @@ -export * from "./classes/popup-component-controller"; -export * from "./classes/popup-config"; -export * from "./classes/popup-controller"; -export * from "./classes/popup-template-controller"; -export * from "./components/popup-arrow"; -export * from "./components/popup"; -export * from "./directives/popup.directive"; -export * from "./services/popup.service"; -export * from "./popup.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/popup/index.js.map b/dist/modules/popup/index.js.map deleted file mode 100644 index 58ca4c03a..000000000 --- a/dist/modules/popup/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/popup/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,qCAAqC,CAAC;AAEpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,8BAA8B,CAAC;AAE7C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,gBAAgB,CAAC","sourcesContent":["export * from \"./classes/popup-component-controller\";\nexport * from \"./classes/popup-config\";\nexport * from \"./classes/popup-controller\";\nexport * from \"./classes/popup-lifecycle\";\nexport * from \"./classes/popup-template-controller\";\n\nexport * from \"./components/popup-arrow\";\nexport * from \"./components/popup\";\n\nexport * from \"./directives/popup.directive\";\n\nexport * from \"./services/popup.service\";\n\nexport * from \"./popup.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/popup/index.metadata.json b/dist/modules/popup/index.metadata.json deleted file mode 100644 index 7258f3de4..000000000 --- a/dist/modules/popup/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/popup-component-controller"},{"from":"./classes/popup-config"},{"from":"./classes/popup-controller"},{"from":"./classes/popup-lifecycle"},{"from":"./classes/popup-template-controller"},{"from":"./components/popup-arrow"},{"from":"./components/popup"},{"from":"./directives/popup.directive"},{"from":"./services/popup.service"},{"from":"./popup.module"}]}] \ No newline at end of file diff --git a/dist/modules/popup/popup.module.d.ts b/dist/modules/popup/popup.module.d.ts deleted file mode 100644 index f615ae043..000000000 --- a/dist/modules/popup/popup.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiPopupModule { -} diff --git a/dist/modules/popup/popup.module.js b/dist/modules/popup/popup.module.js deleted file mode 100644 index 2d250ff66..000000000 --- a/dist/modules/popup/popup.module.js +++ /dev/null @@ -1,41 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiTransitionModule } from "../transition/index"; -import { SuiUtilityModule } from "../../misc/util/index"; -import { SuiPopupDirective } from "./directives/popup.directive"; -import { SuiPopupArrow } from "./components/popup-arrow"; -import { SuiPopup } from "./components/popup"; -import { SuiPopupConfig } from "./services/popup.service"; -var SuiPopupModule = /** @class */ (function () { - function SuiPopupModule() { - } - SuiPopupModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule, - SuiTransitionModule, - SuiUtilityModule - ], - declarations: [ - SuiPopupDirective, - SuiPopupArrow, - SuiPopup - ], - exports: [ - SuiPopupDirective, - SuiPopup - ], - providers: [ - SuiPopupConfig - ], - entryComponents: [ - SuiPopup - ] - },] }, - ]; - /** @nocollapse */ - SuiPopupModule.ctorParameters = function () { return []; }; - return SuiPopupModule; -}()); -export { SuiPopupModule }; -//# sourceMappingURL=popup.module.js.map \ No newline at end of file diff --git a/dist/modules/popup/popup.module.js.map b/dist/modules/popup/popup.module.js.map deleted file mode 100644 index 599fd637f..000000000 --- a/dist/modules/popup/popup.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"popup.module.js","sourceRoot":"","sources":["../../../src/modules/popup/popup.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;;;;;gBAEzD,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,mBAAmB;wBACnB,gBAAgB;qBACnB;oBACD,YAAY,EAAE;wBACV,iBAAiB;wBACjB,aAAa;wBACb,QAAQ;qBACX;oBACD,OAAO,EAAE;wBACL,iBAAiB;wBACjB,QAAQ;qBACX;oBACD,SAAS,EAAE;wBACP,cAAc;qBACjB;oBACD,eAAe,EAAE;wBACb,QAAQ;qBACX;iBACJ;;;;yBA9BD;;SAgCa,cAAc","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTransitionModule } from \"../transition/index\";\nimport { SuiUtilityModule } from \"../../misc/util/index\";\nimport { SuiPopupDirective } from \"./directives/popup.directive\";\nimport { SuiPopupArrow } from \"./components/popup-arrow\";\nimport { SuiPopup } from \"./components/popup\";\nimport { SuiPopupConfig } from \"./services/popup.service\";\n\n@NgModule({\n imports: [\n CommonModule,\n SuiTransitionModule,\n SuiUtilityModule\n ],\n declarations: [\n SuiPopupDirective,\n SuiPopupArrow,\n SuiPopup\n ],\n exports: [\n SuiPopupDirective,\n SuiPopup\n ],\n providers: [\n SuiPopupConfig\n ],\n entryComponents: [\n SuiPopup\n ]\n})\n\nexport class SuiPopupModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/popup.module.metadata.json b/dist/modules/popup/popup.module.metadata.json deleted file mode 100644 index d11b4b68f..000000000 --- a/dist/modules/popup/popup.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiPopupModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":9,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":11,"character":8},{"__symbolic":"reference","module":"../transition/index","name":"SuiTransitionModule","line":12,"character":8},{"__symbolic":"reference","module":"../../misc/util/index","name":"SuiUtilityModule","line":13,"character":8}],"declarations":[{"__symbolic":"reference","module":"./directives/popup.directive","name":"SuiPopupDirective","line":16,"character":8},{"__symbolic":"reference","module":"./components/popup-arrow","name":"SuiPopupArrow","line":17,"character":8},{"__symbolic":"reference","module":"./components/popup","name":"SuiPopup","line":18,"character":8}],"exports":[{"__symbolic":"reference","module":"./directives/popup.directive","name":"SuiPopupDirective","line":21,"character":8},{"__symbolic":"reference","module":"./components/popup","name":"SuiPopup","line":22,"character":8}],"providers":[{"__symbolic":"reference","module":"./services/popup.service","name":"SuiPopupConfig","line":25,"character":8}],"entryComponents":[{"__symbolic":"reference","module":"./components/popup","name":"SuiPopup","line":28,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/popup/public.d.ts b/dist/modules/popup/public.d.ts deleted file mode 100644 index 8fb4df92b..000000000 --- a/dist/modules/popup/public.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { SuiPopupModule, IPopup, SuiPopupConfig, IPopupConfig, ITemplatePopupConfig, ITemplatePopupContext, PopupTrigger } from "./index"; -import { PositioningPlacement } from "../../misc/util/index"; -export { PositioningPlacement as PopupPlacement }; diff --git a/dist/modules/popup/public.js b/dist/modules/popup/public.js deleted file mode 100644 index 9e03d8f83..000000000 --- a/dist/modules/popup/public.js +++ /dev/null @@ -1,4 +0,0 @@ -export { SuiPopupModule, SuiPopupConfig, PopupTrigger } from "./index"; -import { PositioningPlacement } from "../../misc/util/index"; -export { PositioningPlacement as PopupPlacement }; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/popup/public.js.map b/dist/modules/popup/public.js.map deleted file mode 100644 index 93a646b58..000000000 --- a/dist/modules/popup/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/popup/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EAEd,cAAc,EAId,YAAY,EACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,IAAI,cAAc,EAAE,CAAC","sourcesContent":["export {\n SuiPopupModule,\n IPopup,\n SuiPopupConfig,\n IPopupConfig,\n ITemplatePopupConfig,\n ITemplatePopupContext,\n PopupTrigger\n} from \"./index\";\n\nimport { PositioningPlacement } from \"../../misc/util/index\";\nexport { PositioningPlacement as PopupPlacement };\n"]} \ No newline at end of file diff --git a/dist/modules/popup/public.metadata.json b/dist/modules/popup/public.metadata.json deleted file mode 100644 index ef59a4181..000000000 --- a/dist/modules/popup/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"PopupPlacement":{"__symbolic":"reference","module":"../../misc/util/index","name":"PositioningPlacement","line":11,"character":9}},"exports":[{"from":"./index","export":["SuiPopupModule","IPopup","SuiPopupConfig","IPopupConfig","ITemplatePopupConfig","ITemplatePopupContext","PopupTrigger"]}]}] \ No newline at end of file diff --git a/dist/modules/popup/services/popup.service.d.ts b/dist/modules/popup/services/popup.service.d.ts deleted file mode 100644 index 1f8e5b4f6..000000000 --- a/dist/modules/popup/services/popup.service.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { PopupConfig } from "../classes/popup-config"; -export declare class SuiPopupConfig extends PopupConfig { - constructor(); -} diff --git a/dist/modules/popup/services/popup.service.js b/dist/modules/popup/services/popup.service.js deleted file mode 100644 index f351e5591..000000000 --- a/dist/modules/popup/services/popup.service.js +++ /dev/null @@ -1,27 +0,0 @@ -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 __()); - }; -})(); -import { Injectable } from "@angular/core"; -import { PopupConfig } from "../classes/popup-config"; -var SuiPopupConfig = /** @class */ (function (_super) { - __extends(SuiPopupConfig, _super); - function SuiPopupConfig() { - // We use an empty constructor to ensure Angular DI works correctly. - return _super.call(this) || this; - } - SuiPopupConfig.decorators = [ - { type: Injectable }, - ]; - /** @nocollapse */ - SuiPopupConfig.ctorParameters = function () { return []; }; - return SuiPopupConfig; -}(PopupConfig)); -export { SuiPopupConfig }; -//# sourceMappingURL=popup.service.js.map \ No newline at end of file diff --git a/dist/modules/popup/services/popup.service.js.map b/dist/modules/popup/services/popup.service.js.map deleted file mode 100644 index 04766ef0f..000000000 --- a/dist/modules/popup/services/popup.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"popup.service.js","sourceRoot":"","sources":["../../../../src/modules/popup/services/popup.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;;IAGlB,kCAAW;IAC3C;QACI,oEAAoE;eACpE,iBAAO;KACV;;gBALJ,UAAU;;;;yBAHX;EAIoC,WAAW;SAAlC,cAAc","sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { PopupConfig } from \"../classes/popup-config\";\n\n@Injectable()\nexport class SuiPopupConfig extends PopupConfig {\n constructor() {\n // We use an empty constructor to ensure Angular DI works correctly.\n super();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/popup/services/popup.service.metadata.json b/dist/modules/popup/services/popup.service.metadata.json deleted file mode 100644 index 0024b3dc1..000000000 --- a/dist/modules/popup/services/popup.service.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiPopupConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../classes/popup-config","name":"PopupConfig","line":4,"character":36},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":3,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}]}}}}] \ No newline at end of file diff --git a/dist/modules/progress/components/progress.d.ts b/dist/modules/progress/components/progress.d.ts deleted file mode 100644 index 0ffc4c085..000000000 --- a/dist/modules/progress/components/progress.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export declare class SuiProgress { - private _popupClasses; - private _value; - private _maximum; - private _precision; - private _overrideSuccess; - autoSuccess: boolean; - showProgress: boolean; - value: number; - maximum: number; - precision: number; - private readonly _reachedMaximum; - readonly percentage: string; - classValue: string; - constructor(); -} diff --git a/dist/modules/progress/components/progress.js b/dist/modules/progress/components/progress.js deleted file mode 100644 index 90cc65f7e..000000000 --- a/dist/modules/progress/components/progress.js +++ /dev/null @@ -1,109 +0,0 @@ -import { Component, Input, HostBinding } from "@angular/core"; -var SuiProgress = /** @class */ (function () { - function SuiProgress() { - this._popupClasses = true; - this.value = 0; - this.maximum = 100; - this.precision = 0; - this._overrideSuccess = false; - this.autoSuccess = true; - this.showProgress = true; - this._popupClasses = true; - } - Object.defineProperty(SuiProgress.prototype, "value", { - get: function () { - return this._value; - }, - set: function (value) { - // Convert value from string to number where necessary. - var converted = +value; - if (Number.isNaN(converted)) { - return; - } - this._value = converted; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiProgress.prototype, "maximum", { - get: function () { - return this._maximum; - }, - set: function (value) { - // Convert value from string to number where necessary. - var converted = +value; - if (Number.isNaN(converted)) { - return; - } - this._maximum = converted; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiProgress.prototype, "precision", { - get: function () { - return this._precision; - }, - set: function (value) { - // Convert value from string to number where necessary. - var converted = +value; - if (Number.isNaN(converted)) { - return; - } - this._precision = Math.min(Math.max(converted, 0), 20); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiProgress.prototype, "_reachedMaximum", { - get: function () { - return this._overrideSuccess || ((this.value >= this.maximum) && this.autoSuccess); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiProgress.prototype, "percentage", { - get: function () { - var boundedValue = Math.min(Math.max(this.value, 0), this.maximum); - var percentage = (boundedValue / this.maximum) * 100; - return percentage.toFixed(this.precision); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiProgress.prototype, "classValue", { - set: function (classes) { - if (classes.includes("attached") || classes.includes("tiny")) { - this.showProgress = false; - } - if (classes.includes("success")) { - this._overrideSuccess = true; - } - }, - enumerable: true, - configurable: true - }); - SuiProgress.decorators = [ - { type: Component, args: [{ - selector: "sui-progress", - template: "\n
\n
{{ percentage }}%
\n
\n
\n \n
\n", - styles: ["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiProgress.ctorParameters = function () { return []; }; - SuiProgress.propDecorators = { - "_popupClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.progress",] },], - "autoSuccess": [{ type: Input },], - "showProgress": [{ type: Input },], - "value": [{ type: Input },], - "maximum": [{ type: Input },], - "precision": [{ type: Input },], - "_reachedMaximum": [{ type: HostBinding, args: ["class.success",] },], - "percentage": [{ type: HostBinding, args: ["attr.data-percent",] },], - "classValue": [{ type: Input, args: ["class",] },], - }; - return SuiProgress; -}()); -export { SuiProgress }; -//# sourceMappingURL=progress.js.map \ No newline at end of file diff --git a/dist/modules/progress/components/progress.js.map b/dist/modules/progress/components/progress.js.map deleted file mode 100644 index 8f553cb76..000000000 --- a/dist/modules/progress/components/progress.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../../src/modules/progress/components/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;IA4G1D;6BAtFgC,IAAI;QAuFhC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QAEnB,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,IAA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AAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAErE,IAAM,UAAU,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC;YAEvD,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;;;;;0BAInC,mCAAU;uBAAC,OAAc;YAChC,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC3D,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;aAC7B;YACD,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;gBAC9B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;aAChC;;;;;;gBAvGR,SAAS,SAAC;oBACP,QAAQ,EAAE,cAAc;oBACxB,QAAQ,EAAE,0MAOb;oBACG,MAAM,EAAE,CAAC,4EAKZ,CAAC;iBACD;;;;;kCAEI,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,gBAAgB;gCAS5B,KAAK;iCAGL,KAAK;0BAGL,KAAK;4BAgBL,KAAK;8BAgBL,KAAK;oCAgBL,WAAW,SAAC,eAAe;+BAK3B,WAAW,SAAC,mBAAmB;+BAS/B,KAAK,SAAC,OAAO;;sBAlGlB;;SAmBa,WAAW","sourcesContent":["import { Component, Input, HostBinding } from \"@angular/core\";\n\n@Component({\n selector: \"sui-progress\",\n template: `\n
\n
{{ percentage }}%
\n
\n
\n \n
\n`,\n styles: [`\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n`]\n})\nexport class SuiProgress {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.progress\")\n private _popupClasses:boolean = true;\n\n private _value:number;\n private _maximum:number;\n private _precision:number;\n\n private _overrideSuccess:boolean;\n\n @Input()\n public autoSuccess:boolean;\n\n @Input()\n public showProgress:boolean;\n\n @Input()\n public get value():number {\n return this._value;\n }\n\n public set value(value:number) {\n // Convert value from string to number where necessary.\n const converted = +value;\n\n if (Number.isNaN(converted)) {\n return;\n }\n\n this._value = converted;\n }\n\n @Input()\n public get maximum():number {\n return this._maximum;\n }\n\n public set maximum(value:number) {\n // Convert value from string to number where necessary.\n const converted = +value;\n\n if (Number.isNaN(converted)) {\n return;\n }\n\n this._maximum = converted;\n }\n\n @Input()\n public get precision():number {\n return this._precision;\n }\n\n public set precision(value:number) {\n // Convert value from string to number where necessary.\n const converted = +value;\n\n if (Number.isNaN(converted)) {\n return;\n }\n\n this._precision = Math.min(Math.max(converted, 0), 20);\n }\n\n @HostBinding(\"class.success\")\n private get _reachedMaximum():boolean {\n return this._overrideSuccess || ((this.value >= this.maximum) && this.autoSuccess);\n }\n\n @HostBinding(\"attr.data-percent\")\n public get percentage():string {\n const boundedValue = Math.min(Math.max(this.value, 0), this.maximum);\n\n const percentage = (boundedValue / this.maximum) * 100;\n\n return percentage.toFixed(this.precision);\n }\n\n @Input(\"class\")\n public set classValue(classes:string) {\n if (classes.includes(\"attached\") || classes.includes(\"tiny\")) {\n this.showProgress = false;\n }\n if (classes.includes(\"success\")) {\n this._overrideSuccess = true;\n }\n }\n\n constructor() {\n this.value = 0;\n this.maximum = 100;\n this.precision = 0;\n\n this._overrideSuccess = false;\n this.autoSuccess = true;\n this.showProgress = true;\n\n this._popupClasses = true;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/progress/components/progress.metadata.json b/dist/modules/progress/components/progress.metadata.json deleted file mode 100644 index 59cfcbaf9..000000000 --- a/dist/modules/progress/components/progress.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiProgress":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"sui-progress","template":"\n
\n
{{ percentage }}%
\n
\n
\n \n
\n","styles":["\n.bar {\n transition-duration: 300ms !important;\n z-index: 1;\n}\n"]}]}],"members":{"_popupClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":20,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":21,"character":5},"arguments":["class.progress"]}]}],"autoSuccess":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":5}}]}],"showProgress":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":5}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":5}}]}],"maximum":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":52,"character":5}}]}],"precision":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":5}}]}],"_reachedMaximum":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":84,"character":5},"arguments":["class.success"]}]}],"percentage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":89,"character":5},"arguments":["attr.data-percent"]}]}],"classValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":98,"character":5},"arguments":["class"]}]}],"__ctor__":[{"__symbolic":"constructor"}]}}}}] \ No newline at end of file diff --git a/dist/modules/progress/index.d.ts b/dist/modules/progress/index.d.ts deleted file mode 100644 index bf07723f0..000000000 --- a/dist/modules/progress/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./components/progress"; -export * from "./progress.module"; diff --git a/dist/modules/progress/index.js b/dist/modules/progress/index.js deleted file mode 100644 index 88ba5e50f..000000000 --- a/dist/modules/progress/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./components/progress"; -export * from "./progress.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/progress/index.js.map b/dist/modules/progress/index.js.map deleted file mode 100644 index 5c719bac7..000000000 --- a/dist/modules/progress/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/progress/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AAEtC,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./components/progress\";\n\nexport * from \"./progress.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/progress/index.metadata.json b/dist/modules/progress/index.metadata.json deleted file mode 100644 index 5303500af..000000000 --- a/dist/modules/progress/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/progress"},{"from":"./progress.module"}]}] \ No newline at end of file diff --git a/dist/modules/progress/progress.module.d.ts b/dist/modules/progress/progress.module.d.ts deleted file mode 100644 index 589de550a..000000000 --- a/dist/modules/progress/progress.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiProgressModule { -} diff --git a/dist/modules/progress/progress.module.js b/dist/modules/progress/progress.module.js deleted file mode 100644 index b0ef1d925..000000000 --- a/dist/modules/progress/progress.module.js +++ /dev/null @@ -1,25 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiProgress } from "./components/progress"; -var SuiProgressModule = /** @class */ (function () { - function SuiProgressModule() { - } - SuiProgressModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule - ], - declarations: [ - SuiProgress - ], - exports: [ - SuiProgress - ] - },] }, - ]; - /** @nocollapse */ - SuiProgressModule.ctorParameters = function () { return []; }; - return SuiProgressModule; -}()); -export { SuiProgressModule }; -//# sourceMappingURL=progress.module.js.map \ No newline at end of file diff --git a/dist/modules/progress/progress.module.js.map b/dist/modules/progress/progress.module.js.map deleted file mode 100644 index 1003650e9..000000000 --- a/dist/modules/progress/progress.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"progress.module.js","sourceRoot":"","sources":["../../../src/modules/progress/progress.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;;;;;gBAEnD,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;qBACf;oBACD,YAAY,EAAE;wBACV,WAAW;qBACd;oBACD,OAAO,EAAE;wBACL,WAAW;qBACd;iBACJ;;;;4BAdD;;SAea,iBAAiB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiProgress } from \"./components/progress\";\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n SuiProgress\n ],\n exports: [\n SuiProgress\n ]\n})\nexport class SuiProgressModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/progress/progress.module.metadata.json b/dist/modules/progress/progress.module.metadata.json deleted file mode 100644 index 004cfa651..000000000 --- a/dist/modules/progress/progress.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiProgressModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/progress","name":"SuiProgress","line":9,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/progress","name":"SuiProgress","line":12,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/progress/public.d.ts b/dist/modules/progress/public.d.ts deleted file mode 100644 index c15945dfe..000000000 --- a/dist/modules/progress/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiProgressModule } from "./index"; diff --git a/dist/modules/progress/public.js b/dist/modules/progress/public.js deleted file mode 100644 index 0b073b696..000000000 --- a/dist/modules/progress/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiProgressModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/progress/public.js.map b/dist/modules/progress/public.js.map deleted file mode 100644 index b9bbc7fa9..000000000 --- a/dist/modules/progress/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/progress/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACpB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiProgressModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/progress/public.metadata.json b/dist/modules/progress/public.metadata.json deleted file mode 100644 index 4b677bbc0..000000000 --- a/dist/modules/progress/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiProgressModule"]}]}] \ No newline at end of file diff --git a/dist/modules/public.d.ts b/dist/modules/public.d.ts deleted file mode 100644 index 0630b7934..000000000 --- a/dist/modules/public.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export * from "./accordion/public"; -export * from "./checkbox/public"; -export * from "./collapse/public"; -export * from "./datepicker/public"; -export * from "./dimmer/public"; -export * from "./dropdown/public"; -export * from "./modal/public"; -export * from "./popup/public"; -export * from "./progress/public"; -export * from "./rating/public"; -export * from "./search/public"; -export * from "./select/public"; -export * from "./sidebar/public"; -export * from "./tabs/public"; -export * from "./transition/public"; diff --git a/dist/modules/public.js b/dist/modules/public.js deleted file mode 100644 index ed455fb44..000000000 --- a/dist/modules/public.js +++ /dev/null @@ -1,16 +0,0 @@ -export * from "./accordion/public"; -export * from "./checkbox/public"; -export * from "./collapse/public"; -export * from "./datepicker/public"; -export * from "./dimmer/public"; -export * from "./dropdown/public"; -export * from "./modal/public"; -export * from "./popup/public"; -export * from "./progress/public"; -export * from "./rating/public"; -export * from "./search/public"; -export * from "./select/public"; -export * from "./sidebar/public"; -export * from "./tabs/public"; -export * from "./transition/public"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/public.js.map b/dist/modules/public.js.map deleted file mode 100644 index e53826b50..000000000 --- a/dist/modules/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/modules/public.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./accordion/public\";\nexport * from \"./checkbox/public\";\nexport * from \"./collapse/public\";\nexport * from \"./datepicker/public\";\nexport * from \"./dimmer/public\";\nexport * from \"./dropdown/public\";\nexport * from \"./modal/public\";\nexport * from \"./popup/public\";\nexport * from \"./progress/public\";\nexport * from \"./rating/public\";\nexport * from \"./search/public\";\nexport * from \"./select/public\";\nexport * from \"./sidebar/public\";\nexport * from \"./tabs/public\";\nexport * from \"./transition/public\";\n"]} \ No newline at end of file diff --git a/dist/modules/public.metadata.json b/dist/modules/public.metadata.json deleted file mode 100644 index 623899ee0..000000000 --- a/dist/modules/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./accordion/public"},{"from":"./checkbox/public"},{"from":"./collapse/public"},{"from":"./datepicker/public"},{"from":"./dimmer/public"},{"from":"./dropdown/public"},{"from":"./modal/public"},{"from":"./popup/public"},{"from":"./progress/public"},{"from":"./rating/public"},{"from":"./search/public"},{"from":"./select/public"},{"from":"./sidebar/public"},{"from":"./tabs/public"},{"from":"./transition/public"}]}] \ No newline at end of file diff --git a/dist/modules/rating/components/rating.d.ts b/dist/modules/rating/components/rating.d.ts deleted file mode 100644 index 4322955d0..000000000 --- a/dist/modules/rating/components/rating.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { EventEmitter } from "@angular/core"; -import { ICustomValueAccessorHost, CustomValueAccessor } from "../../../misc/util/index"; -export declare class SuiRating implements ICustomValueAccessorHost { - private _ratingClasses; - value: number; - valueChange: EventEmitter; - private _maximum; - maximum: number; - isReadonly: boolean; - readonly icons: undefined[]; - hoveredIndex: number; - constructor(); - onClick(i: number): void; - onMouseover(i: number): void; - onMouseout(): void; - writeValue(value: number): void; -} -export declare class SuiRatingValueAccessor extends CustomValueAccessor { - constructor(host: SuiRating); -} diff --git a/dist/modules/rating/components/rating.js b/dist/modules/rating/components/rating.js deleted file mode 100644 index ca075580a..000000000 --- a/dist/modules/rating/components/rating.js +++ /dev/null @@ -1,93 +0,0 @@ -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 __()); - }; -})(); -import { Component, Directive, Input, Output, EventEmitter, HostBinding, HostListener } from "@angular/core"; -import { customValueAccessorFactory, CustomValueAccessor } from "../../../misc/util/index"; -var SuiRating = /** @class */ (function () { - function SuiRating() { - this.hoveredIndex = -1; - this.value = 0; - this.valueChange = new EventEmitter(); - this.maximum = 5; - this.isReadonly = false; - this._ratingClasses = true; - } - Object.defineProperty(SuiRating.prototype, "maximum", { - get: function () { - return this._maximum; - }, - set: function (value) { - this._maximum = +value; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiRating.prototype, "icons", { - get: function () { - // tslint:disable-next-line:prefer-literal - return new Array(this.maximum); - }, - enumerable: true, - configurable: true - }); - SuiRating.prototype.onClick = function (i) { - if (!this.isReadonly) { - this.value = i + 1; - this.valueChange.emit(this.value); - } - }; - SuiRating.prototype.onMouseover = function (i) { - this.hoveredIndex = i; - }; - SuiRating.prototype.onMouseout = function () { - this.hoveredIndex = -1; - }; - SuiRating.prototype.writeValue = function (value) { - this.value = value; - }; - SuiRating.decorators = [ - { type: Component, args: [{ - selector: "sui-rating", - template: "\n= i && !isReadonly\"\n [class.active]=\"value > i\">\n\n", - styles: ["\n:host.read-only .icon {\n cursor: auto\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiRating.ctorParameters = function () { return []; }; - SuiRating.propDecorators = { - "_ratingClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.rating",] },], - "valueChange": [{ type: Output },], - "maximum": [{ type: Input },], - "isReadonly": [{ type: HostBinding, args: ["class.read-only",] }, { type: Input },], - "onMouseout": [{ type: HostListener, args: ["mouseout",] },], - }; - return SuiRating; -}()); -export { SuiRating }; -var SuiRatingValueAccessor = /** @class */ (function (_super) { - __extends(SuiRatingValueAccessor, _super); - function SuiRatingValueAccessor(host) { - return _super.call(this, host) || this; - } - SuiRatingValueAccessor.decorators = [ - { type: Directive, args: [{ - selector: "sui-rating", - host: { "(valueChange)": "onChange($event)" }, - providers: [customValueAccessorFactory(SuiRatingValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiRatingValueAccessor.ctorParameters = function () { return [ - { type: SuiRating, }, - ]; }; - return SuiRatingValueAccessor; -}(CustomValueAccessor)); -export { SuiRatingValueAccessor }; -//# sourceMappingURL=rating.js.map \ No newline at end of file diff --git a/dist/modules/rating/components/rating.js.map b/dist/modules/rating/components/rating.js.map deleted file mode 100644 index f0092526c..000000000 --- a/dist/modules/rating/components/rating.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rating.js","sourceRoot":"","sources":["../../../../src/modules/rating/components/rating.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAA4B,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;;IAmDjH;4BAF6B,CAAC,CAAC;QAG3B,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,IAAI,YAAY,EAAU,CAAC;QAE9C,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;KAC9B;0BA3BU,8BAAO;;YACd,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;;aAGzB,UAAmB,KAAY;YAC3B,IAAI,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC;SAC1B;;;;IAMD,sBAAW,4BAAK;aAAhB;;YAEI,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAClC;;;OAAA;IAcM,2BAAO,GAAd,UAAe,CAAQ;QACnB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;YACnB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACrC;KACJ;IAEM,+BAAW,GAAlB,UAAmB,CAAQ;QACvB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;KACzB;IAGM,8BAAU;QACb,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;;IAGpB,8BAAU,GAAjB,UAAkB,KAAY;QAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;KACtB;;gBA7EJ,SAAS,SAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,uOAQb;oBACG,MAAM,EAAE,CAAC,kDAIZ,CAAC;iBACD;;;;;mCAEI,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,cAAc;gCAK1B,MAAM;4BAKN,KAAK;+BASL,WAAW,SAAC,iBAAiB,cAC7B,KAAK;+BA+BL,YAAY,SAAC,UAAU;;oBAzE5B;;SAoBa,SAAS;;IAoEsB,0CAAsC;IAC9E,gCAAY,IAAc;eACtB,kBAAM,IAAI,CAAC;KACd;;gBARJ,SAAS,SAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,EAAE,eAAe,EAAE,kBAAkB,EAAE;oBAC7C,SAAS,EAAE,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,CAAC;iBAClE;;;;gBAnEY,SAAS;;iCApBtB;EAwF4C,mBAAmB;SAAlD,sBAAsB","sourcesContent":["import { Component, Directive, Input, Output, EventEmitter, HostBinding, HostListener } from \"@angular/core\";\nimport { ICustomValueAccessorHost, customValueAccessorFactory, CustomValueAccessor } from \"../../../misc/util/index\";\n\n@Component({\n selector: \"sui-rating\",\n template: `\n= i && !isReadonly\"\n [class.active]=\"value > i\">\n\n`,\n styles: [`\n:host.read-only .icon {\n cursor: auto\n}\n`]\n})\nexport class SuiRating implements ICustomValueAccessorHost {\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.rating\")\n private _ratingClasses:boolean;\n\n public value:number;\n\n @Output()\n public valueChange:EventEmitter;\n\n private _maximum:number;\n\n @Input()\n public get maximum():number {\n return this._maximum;\n }\n\n public set maximum(value:number) {\n this._maximum = +value;\n }\n\n @HostBinding(\"class.read-only\")\n @Input()\n public isReadonly:boolean;\n\n public get icons():undefined[] {\n // tslint:disable-next-line:prefer-literal\n return new Array(this.maximum);\n }\n\n public hoveredIndex:number = -1;\n\n constructor() {\n this.value = 0;\n this.valueChange = new EventEmitter();\n\n this.maximum = 5;\n this.isReadonly = false;\n\n this._ratingClasses = true;\n }\n\n public onClick(i:number):void {\n if (!this.isReadonly) {\n this.value = i + 1;\n this.valueChange.emit(this.value);\n }\n }\n\n public onMouseover(i:number):void {\n this.hoveredIndex = i;\n }\n\n @HostListener(\"mouseout\")\n public onMouseout():void {\n this.hoveredIndex = -1;\n }\n\n public writeValue(value:number):void {\n this.value = value;\n }\n}\n\n@Directive({\n selector: \"sui-rating\",\n host: { \"(valueChange)\": \"onChange($event)\" },\n providers: [customValueAccessorFactory(SuiRatingValueAccessor)]\n})\nexport class SuiRatingValueAccessor extends CustomValueAccessor {\n constructor(host:SuiRating) {\n super(host);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/rating/components/rating.metadata.json b/dist/modules/rating/components/rating.metadata.json deleted file mode 100644 index e8259410a..000000000 --- a/dist/modules/rating/components/rating.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiRating":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"sui-rating","template":"\n= i && !isReadonly\"\n [class.active]=\"value > i\">\n\n","styles":["\n:host.read-only .icon {\n cursor: auto\n}\n"]}]}],"members":{"_ratingClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":21,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":22,"character":5},"arguments":["class.rating"]}]}],"valueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":27,"character":5}}]}],"maximum":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":5}}]}],"isReadonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":41,"character":5},"arguments":["class.read-only"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor"}],"onClick":[{"__symbolic":"method"}],"onMouseover":[{"__symbolic":"method"}],"onMouseout":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":73,"character":5},"arguments":["mouseout"]}]}],"writeValue":[{"__symbolic":"method"}]}},"SuiRatingValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":88,"character":44},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":83,"character":1},"arguments":[{"selector":"sui-rating","host":{"(valueChange)":"onChange($event)","$quoted$":["(valueChange)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":86,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiRatingValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiRating"}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/rating/index.d.ts b/dist/modules/rating/index.d.ts deleted file mode 100644 index fb9752189..000000000 --- a/dist/modules/rating/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./components/rating"; -export * from "./rating.module"; diff --git a/dist/modules/rating/index.js b/dist/modules/rating/index.js deleted file mode 100644 index 9ed835b3e..000000000 --- a/dist/modules/rating/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./components/rating"; -export * from "./rating.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/rating/index.js.map b/dist/modules/rating/index.js.map deleted file mode 100644 index de36d171e..000000000 --- a/dist/modules/rating/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/rating/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AAEpC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./components/rating\";\n\nexport * from \"./rating.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/rating/index.metadata.json b/dist/modules/rating/index.metadata.json deleted file mode 100644 index 9e753e76d..000000000 --- a/dist/modules/rating/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/rating"},{"from":"./rating.module"}]}] \ No newline at end of file diff --git a/dist/modules/rating/public.d.ts b/dist/modules/rating/public.d.ts deleted file mode 100644 index 4cc3e4b9c..000000000 --- a/dist/modules/rating/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiRatingModule } from "./index"; diff --git a/dist/modules/rating/public.js b/dist/modules/rating/public.js deleted file mode 100644 index ba155b150..000000000 --- a/dist/modules/rating/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiRatingModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/rating/public.js.map b/dist/modules/rating/public.js.map deleted file mode 100644 index 0fa7af970..000000000 --- a/dist/modules/rating/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/rating/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EAClB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiRatingModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/rating/public.metadata.json b/dist/modules/rating/public.metadata.json deleted file mode 100644 index e1c41f32b..000000000 --- a/dist/modules/rating/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiRatingModule"]}]}] \ No newline at end of file diff --git a/dist/modules/rating/rating.module.d.ts b/dist/modules/rating/rating.module.d.ts deleted file mode 100644 index d3331e33c..000000000 --- a/dist/modules/rating/rating.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiRatingModule { -} diff --git a/dist/modules/rating/rating.module.js b/dist/modules/rating/rating.module.js deleted file mode 100644 index 4c290172b..000000000 --- a/dist/modules/rating/rating.module.js +++ /dev/null @@ -1,29 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { FormsModule } from "@angular/forms"; -import { SuiRating, SuiRatingValueAccessor } from "./components/rating"; -var SuiRatingModule = /** @class */ (function () { - function SuiRatingModule() { - } - SuiRatingModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - FormsModule, - CommonModule - ], - declarations: [ - SuiRating, - SuiRatingValueAccessor - ], - exports: [ - SuiRating, - SuiRatingValueAccessor - ] - },] }, - ]; - /** @nocollapse */ - SuiRatingModule.ctorParameters = function () { return []; }; - return SuiRatingModule; -}()); -export { SuiRatingModule }; -//# sourceMappingURL=rating.module.js.map \ No newline at end of file diff --git a/dist/modules/rating/rating.module.js.map b/dist/modules/rating/rating.module.js.map deleted file mode 100644 index 5cdc2b54f..000000000 --- a/dist/modules/rating/rating.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rating.module.js","sourceRoot":"","sources":["../../../src/modules/rating/rating.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;;;;;gBAEvE,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,WAAW;wBACX,YAAY;qBACf;oBACD,YAAY,EAAE;wBACV,SAAS;wBACT,sBAAsB;qBACzB;oBACD,OAAO,EAAE;wBACL,SAAS;wBACT,sBAAsB;qBACzB;iBACJ;;;;0BAlBD;;SAmBa,eAAe","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { SuiRating, SuiRatingValueAccessor } from \"./components/rating\";\n\n@NgModule({\n imports: [\n FormsModule,\n CommonModule\n ],\n declarations: [\n SuiRating,\n SuiRatingValueAccessor\n ],\n exports: [\n SuiRating,\n SuiRatingValueAccessor\n ]\n})\nexport class SuiRatingModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/rating/rating.module.metadata.json b/dist/modules/rating/rating.module.metadata.json deleted file mode 100644 index ee6030e1a..000000000 --- a/dist/modules/rating/rating.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiRatingModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":7,"character":8},{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/rating","name":"SuiRating","line":11,"character":8},{"__symbolic":"reference","module":"./components/rating","name":"SuiRatingValueAccessor","line":12,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/rating","name":"SuiRating","line":15,"character":8},{"__symbolic":"reference","module":"./components/rating","name":"SuiRatingValueAccessor","line":16,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/search/components/search-result.d.ts b/dist/modules/search/components/search-result.d.ts deleted file mode 100644 index 29e8d3af2..000000000 --- a/dist/modules/search/components/search-result.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ViewContainerRef, TemplateRef } from "@angular/core"; -import { SuiComponentFactory } from "../../../misc/util/index"; -import { IResultContext } from "./search"; -export declare class SuiSearchResult { - componentFactory: SuiComponentFactory; - private _optionClasses; - value: T; - query: string; - formatter: (obj: T, query: string) => string; - private _template?; - template: TemplateRef> | undefined; - templateSibling: ViewContainerRef; - constructor(componentFactory: SuiComponentFactory); -} diff --git a/dist/modules/search/components/search-result.js b/dist/modules/search/components/search-result.js deleted file mode 100644 index 54d19d43c..000000000 --- a/dist/modules/search/components/search-result.js +++ /dev/null @@ -1,49 +0,0 @@ -import { Component, ViewChild, ViewContainerRef, HostBinding, Input, TemplateRef } from "@angular/core"; -import { SuiComponentFactory } from "../../../misc/util/index"; -// See https://github.com/Microsoft/TypeScript/issues/13449. -var templateRef = TemplateRef; -var SuiSearchResult = /** @class */ (function () { - function SuiSearchResult(componentFactory) { - this.componentFactory = componentFactory; - this._optionClasses = true; - // By default we make this function return an empty string, for the brief moment when it isn't displaying the correct label. - this.formatter = function (value) { return ""; }; - } - Object.defineProperty(SuiSearchResult.prototype, "template", { - get: function () { - return this._template; - }, - set: function (template) { - this._template = template; - if (this.template) { - this.componentFactory.createView(this.templateSibling, this.template, { - $implicit: this.value, - query: this.query - }); - } - }, - enumerable: true, - configurable: true - }); - SuiSearchResult.decorators = [ - { type: Component, args: [{ - selector: "sui-search-result", - template: "\n\n\n" - },] }, - ]; - /** @nocollapse */ - SuiSearchResult.ctorParameters = function () { return [ - { type: SuiComponentFactory, }, - ]; }; - SuiSearchResult.propDecorators = { - "_optionClasses": [{ type: HostBinding, args: ["class.result",] },], - "value": [{ type: Input },], - "query": [{ type: Input },], - "formatter": [{ type: Input },], - "template": [{ type: Input },], - "templateSibling": [{ type: ViewChild, args: ["templateSibling", { read: ViewContainerRef },] },], - }; - return SuiSearchResult; -}()); -export { SuiSearchResult }; -//# sourceMappingURL=search-result.js.map \ No newline at end of file diff --git a/dist/modules/search/components/search-result.js.map b/dist/modules/search/components/search-result.js.map deleted file mode 100644 index 6ba99227e..000000000 --- a/dist/modules/search/components/search-result.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"search-result.js","sourceRoot":"","sources":["../../../../src/modules/search/components/search-result.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAyB,WAAW,EAC1E,KAAK,EAAE,WAAW,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAuB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;;AAIpF,IAAM,WAAW,GAAG,WAAW,CAAC;;IA6C5B,yBAAmB,gBAAoC;QAApC,qBAAgB,GAAhB,gBAAgB,CAAoB;QACnD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;;QAG3B,IAAI,CAAC,SAAS,GAAG,UAAA,KAAK,IAAI,OAAA,EAAE,EAAF,CAAE,CAAC;KAChC;0BAvBU,qCAAQ;;YACf,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;;aAG1B,UAAoB,QAAmD;YACnE,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1B,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAChB,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,QAAQ,EAAE;oBAClE,SAAS,EAAE,IAAI,CAAC,KAAK;oBACrB,KAAK,EAAE,IAAI,CAAC,KAAK;iBACpB,CAAC,CAAC;aACN;SACJ;;;;;gBArCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,mBAAmB;oBAC7B,QAAQ,EAAE,+GAGb;iBACA;;;;gBAZ6B,mBAAmB;;;mCAe5C,WAAW,SAAC,cAAc;0BAG1B,KAAK;0BAGL,KAAK;8BAIL,KAAK;6BAKL,KAAK;oCAgBL,SAAS,SAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;;0BAlD5D;;SAiBa,eAAe","sourcesContent":["import {\n Component, ViewChild, ViewContainerRef, Renderer2, ElementRef, HostBinding,\n Input, TemplateRef\n} from \"@angular/core\";\nimport { ITemplateRefContext, SuiComponentFactory } from \"../../../misc/util/index\";\nimport { IResultContext } from \"./search\";\n\n// See https://github.com/Microsoft/TypeScript/issues/13449.\nconst templateRef = TemplateRef;\n\n@Component({\n selector: \"sui-search-result\",\n template: `\n\n\n`\n})\nexport class SuiSearchResult {\n // Sets the Semantic UI classes on the host element.\n @HostBinding(\"class.result\")\n private _optionClasses:boolean;\n\n @Input()\n public value:T;\n\n @Input()\n public query:string;\n\n // Returns the label from a given value.\n @Input()\n public formatter:(obj:T, query:string) => string;\n\n private _template?:TemplateRef>;\n\n @Input()\n public get template():TemplateRef> | undefined {\n return this._template;\n }\n\n public set template(template:TemplateRef> | undefined) {\n this._template = template;\n if (this.template) {\n this.componentFactory.createView(this.templateSibling, this.template, {\n $implicit: this.value,\n query: this.query\n });\n }\n }\n\n // Placeholder to draw template beside.\n @ViewChild(\"templateSibling\", { read: ViewContainerRef })\n public templateSibling:ViewContainerRef;\n\n constructor(public componentFactory:SuiComponentFactory) {\n this._optionClasses = true;\n\n // By default we make this function return an empty string, for the brief moment when it isn't displaying the correct label.\n this.formatter = value => \"\";\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/search/components/search-result.metadata.json b/dist/modules/search/components/search-result.metadata.json deleted file mode 100644 index da7ec6bae..000000000 --- a/dist/modules/search/components/search-result.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiSearchResult":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":10,"character":1},"arguments":[{"selector":"sui-search-result","template":"\n\n\n"}]}],"members":{"_optionClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":19,"character":5},"arguments":["class.result"]}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":22,"character":5}}]}],"query":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":5}}]}],"formatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":5}}]}],"template":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":5}}]}],"templateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":50,"character":5},"arguments":["templateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":50,"character":42}}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":53,"character":40}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/search/components/search.d.ts b/dist/modules/search/components/search.d.ts deleted file mode 100644 index cca0478a3..000000000 --- a/dist/modules/search/components/search.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { AfterViewInit, EventEmitter, ElementRef, TemplateRef, Renderer2, OnDestroy } from "@angular/core"; -import { ITemplateRefContext } from "../../../misc/util/index"; -import { DropdownService } from "../../dropdown/index"; -import { ISearchLocaleValues, RecursivePartial, SuiLocalizationService } from "../../../behaviors/localization/index"; -import { SearchService } from "../services/search.service"; -import { LookupFn, FilterFn } from "../helpers/lookup-fn"; -export interface IResultContext extends ITemplateRefContext { - query: string; -} -export declare class SuiSearch implements AfterViewInit, OnDestroy { - private _element; - private _localizationService; - dropdownService: DropdownService; - searchService: SearchService; - private _menu; - private _searchClasses; - readonly isActive: boolean; - hasIcon: boolean; - resetQueryOnChange: boolean; - allowEmptyQuery: boolean; - private _allowEmptyQuery; - private _placeholder; - placeholder: string; - private _localeValues; - localeOverrides: RecursivePartial; - readonly localeValues: ISearchLocaleValues; - query: string; - options: T[] | undefined; - optionsFilter: FilterFn | undefined; - optionsLookup: LookupFn | undefined; - optionsField: string | undefined; - private _resultFormatter?; - resultFormatter: (result: T, query: string) => string; - resultTemplate: TemplateRef>; - retainSelectedResult: boolean; - searchDelay: number; - readonly isSearching: boolean; - maxResults: number; - readonly results: T[]; - selectedResult?: T; - onResultSelected: EventEmitter; - transition: string; - transitionDuration: number; - private _documentClickListener; - constructor(_element: ElementRef, renderer: Renderer2, _localizationService: SuiLocalizationService); - ngAfterViewInit(): void; - private onLocaleUpdate(); - select(result: T): void; - onClick(e: MouseEvent): void; - private onFocusIn(); - private open(); - private onFocusOut(e); - onDocumentClick(e: MouseEvent): void; - readValue(object: T): string; - ngOnDestroy(): void; -} diff --git a/dist/modules/search/components/search.js b/dist/modules/search/components/search.js deleted file mode 100644 index 18c68430f..000000000 --- a/dist/modules/search/components/search.js +++ /dev/null @@ -1,260 +0,0 @@ -import { Component, ViewChild, HostBinding, Input, HostListener, EventEmitter, Output, ElementRef, TemplateRef, Renderer2 } from "@angular/core"; -import { Util } from "../../../misc/util/index"; -import { DropdownService, SuiDropdownMenu } from "../../dropdown/index"; -import { SuiLocalizationService } from "../../../behaviors/localization/index"; -import { SearchService } from "../services/search.service"; -var SuiSearch = /** @class */ (function () { - function SuiSearch(_element, renderer, _localizationService) { - var _this = this; - this._element = _element; - this._localizationService = _localizationService; - this.dropdownService = new DropdownService(); - this.searchService = new SearchService(); - this.onLocaleUpdate(); - this._localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); - this._searchClasses = true; - this.hasIcon = true; - this.allowEmptyQuery = false; - this.resetQueryOnChange = true; - this.retainSelectedResult = true; - this.searchDelay = 200; - this.maxResults = 7; - this.onResultSelected = new EventEmitter(); - this.transition = "scale"; - this.transitionDuration = 200; - this._documentClickListener = renderer.listen("document", "click", function (e) { return _this.onDocumentClick(e); }); - } - Object.defineProperty(SuiSearch.prototype, "isActive", { - get: function () { - return this.dropdownService.isOpen; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "resetQueryOnChange", { - set: - // Sets whether the query is reset if options change. - function (resetQueryOnChange) { - this.searchService.resetQueryOnChange = resetQueryOnChange; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "allowEmptyQuery", { - get: function () { - return this._allowEmptyQuery; - }, - set: - // Sets whether the search element display result with empty query. - function (allowEmptyQuery) { - this._allowEmptyQuery = allowEmptyQuery; - this.searchService.allowEmptyQuery = allowEmptyQuery; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "placeholder", { - get: - // Gets & sets the placeholder text displayed inside the text input. - function () { - return this._placeholder || this.localeValues.placeholder; - }, - set: function (placeholder) { - this._placeholder = placeholder; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "localeValues", { - get: function () { - return this._localizationService.override(this._localeValues, this.localeOverrides); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "query", { - get: function () { - return this.searchService.query; - }, - set: function (query) { - var _this = this; - this.selectedResult = undefined; - // Initialise a delayed search. - this.searchService.updateQueryDelayed(query, function () { - // Set the results open state depending on whether a query has been entered. - return - // Set the results open state depending on whether a query has been entered. - _this.dropdownService.setOpenState(_this.searchService.query.length > 0 || _this.allowEmptyQuery); - }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "options", { - set: function (options) { - if (options) { - this.searchService.options = options; - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "optionsFilter", { - set: function (filter) { - if (filter) { - this.searchService.optionsFilter = filter; - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "optionsLookup", { - set: function (lookupFn) { - this.searchService.optionsLookup = lookupFn; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "optionsField", { - set: function (field) { - this.searchService.optionsField = field; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "resultFormatter", { - get: function () { - var _this = this; - if (this._resultFormatter) { - return this._resultFormatter; - } - else if (this.searchService.optionsLookup) { - return function (r) { return _this.readValue(r); }; - } - else { - return function (r, q) { return _this.searchService.highlightMatches(_this.readValue(r), q); }; - } - }, - set: function (formatter) { - this._resultFormatter = formatter; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "searchDelay", { - set: function (delay) { - this.searchService.searchDelay = delay; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "isSearching", { - get: function () { - return this.searchService.isSearching; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSearch.prototype, "results", { - get: function () { - return this.searchService.results.slice(0, this.maxResults); - }, - enumerable: true, - configurable: true - }); - SuiSearch.prototype.ngAfterViewInit = function () { - this._menu.service = this.dropdownService; - }; - SuiSearch.prototype.onLocaleUpdate = function () { - this._localeValues = this._localizationService.get().search; - }; - // Selects a result. - // Selects a result. - SuiSearch.prototype.select = - // Selects a result. - function (result) { - this.onResultSelected.emit(result); - this.dropdownService.setOpenState(false); - if (this.retainSelectedResult) { - this.selectedResult = result; - this.searchService.updateQuery(this.readValue(result)); - } - else { - this.searchService.updateQuery(""); - } - }; - SuiSearch.prototype.onClick = function (e) { - this.open(); - }; - SuiSearch.prototype.onFocusIn = function () { - if (!this.dropdownService.isAnimating) { - this.open(); - } - }; - SuiSearch.prototype.open = function () { - if (this.searchService.query.length > 0 || this.allowEmptyQuery) { - // Only open on click when there is a query entered. - this.dropdownService.setOpenState(true); - } - }; - SuiSearch.prototype.onFocusOut = function (e) { - if (!this._element.nativeElement.contains(e.relatedTarget)) { - this.dropdownService.setOpenState(false); - } - }; - SuiSearch.prototype.onDocumentClick = function (e) { - if (!this._element.nativeElement.contains(e.target)) { - this.dropdownService.setOpenState(false); - } - }; - // Reads the specified field from an item. - // Reads the specified field from an item. - SuiSearch.prototype.readValue = - // Reads the specified field from an item. - function (object) { - return Util.Object.readValue(object, this.searchService.optionsField); - }; - SuiSearch.prototype.ngOnDestroy = function () { - this._documentClickListener(); - }; - SuiSearch.decorators = [ - { type: Component, args: [{ - selector: "sui-search", - template: "\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n", - styles: ["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiSearch.ctorParameters = function () { return [ - { type: ElementRef, }, - { type: Renderer2, }, - { type: SuiLocalizationService, }, - ]; }; - SuiSearch.propDecorators = { - "_menu": [{ type: ViewChild, args: [SuiDropdownMenu,] },], - "_searchClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.search",] },], - "isActive": [{ type: HostBinding, args: ["class.active",] },], - "hasIcon": [{ type: Input },], - "resetQueryOnChange": [{ type: Input },], - "allowEmptyQuery": [{ type: Input },], - "placeholder": [{ type: Input },], - "options": [{ type: Input },], - "optionsFilter": [{ type: Input },], - "optionsLookup": [{ type: Input },], - "optionsField": [{ type: Input },], - "resultFormatter": [{ type: Input },], - "resultTemplate": [{ type: Input },], - "retainSelectedResult": [{ type: Input },], - "searchDelay": [{ type: Input },], - "isSearching": [{ type: HostBinding, args: ["class.loading",] },], - "maxResults": [{ type: Input },], - "onResultSelected": [{ type: Output, args: ["resultSelected",] },], - "transition": [{ type: Input },], - "transitionDuration": [{ type: Input },], - "onFocusIn": [{ type: HostListener, args: ["focusin",] },], - "onFocusOut": [{ type: HostListener, args: ["focusout", ["$event"],] },], - }; - return SuiSearch; -}()); -export { SuiSearch }; -//# sourceMappingURL=search.js.map \ No newline at end of file diff --git a/dist/modules/search/components/search.js.map b/dist/modules/search/components/search.js.map deleted file mode 100644 index d8c013d9d..000000000 --- a/dist/modules/search/components/search.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../src/modules/search/components/search.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAiB,YAAY,EACrE,YAAY,EAAE,MAAM,EAAa,UAAU,EAAE,WAAW,EAAE,SAAS,EACtE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAoC,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAyC,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;;IAoMvD,mBAAoB,QAAmB,EAAE,QAAkB,EAAU,oBAA2C;QAAhH,iBAqBC;QArBmB,aAAQ,GAAR,QAAQ,CAAW;QAA8B,yBAAoB,GAApB,oBAAoB,CAAuB;QAC5G,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;QAC7C,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,EAAQ,CAAC;QAE/C,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,cAAc,EAAE,EAArB,CAAqB,CAAC,CAAC;QAElF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;Q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aL,KAAK;4BA6BL,KAAK;kCAOL,KAAK;kCAOL,KAAK;iCAKL,KAAK;oCAiBL,KAAK;mCAKL,KAAK;yCAGL,KAAK;gCAGL,KAAK;gCAKL,WAAW,SAAC,eAAe;+BAK3B,KAAK;qCAWL,MAAM,SAAC,gBAAgB;+BAGvB,KAAK;uCAGL,KAAK;8BAqDL,YAAY,SAAC,SAAS;+BActB,YAAY,SAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;oBAzQxC;;SAqDa,SAAS","sourcesContent":["import {\n Component, ViewChild, HostBinding, Input, AfterViewInit, HostListener,\n EventEmitter, Output, Directive, ElementRef, TemplateRef, Renderer2, OnDestroy\n} from \"@angular/core\";\nimport { Util, ITemplateRefContext, IFocusEvent } from \"../../../misc/util/index\";\nimport { DropdownService, SuiDropdownMenu } from \"../../dropdown/index\";\nimport { ISearchLocaleValues, RecursivePartial, SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SearchService } from \"../services/search.service\";\nimport { LookupFn, FilterFn } from \"../helpers/lookup-fn\";\n\nexport interface IResultContext extends ITemplateRefContext {\n query:string;\n}\n\n@Component({\n selector: \"sui-search\",\n template: `\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n`,\n styles: [`\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n`]\n})\nexport class SuiSearch implements AfterViewInit, OnDestroy {\n public dropdownService:DropdownService;\n public searchService:SearchService;\n\n @ViewChild(SuiDropdownMenu)\n private _menu:SuiDropdownMenu;\n\n // Sets the Semantic UI classes on the host element.\n // Doing it on the host enables use in menus etc.\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.search\")\n private _searchClasses:boolean;\n\n @HostBinding(\"class.active\")\n public get isActive():boolean {\n return this.dropdownService.isOpen;\n }\n\n // Sets whether the search element has a visible search icon.\n @Input()\n public hasIcon:boolean;\n\n // Sets whether the query is reset if options change.\n @Input()\n public set resetQueryOnChange(resetQueryOnChange:boolean) {\n this.searchService.resetQueryOnChange = resetQueryOnChange;\n }\n\n // Sets whether the search element display result with empty query.\n @Input()\n public set allowEmptyQuery(allowEmptyQuery:boolean) {\n this._allowEmptyQuery = allowEmptyQuery;\n this.searchService.allowEmptyQuery = allowEmptyQuery;\n }\n public get allowEmptyQuery():boolean {\n return this._allowEmptyQuery;\n }\n\n private _allowEmptyQuery:boolean;\n private _placeholder:string;\n\n // Gets & sets the placeholder text displayed inside the text input.\n @Input()\n public get placeholder():string {\n return this._placeholder || this.localeValues.placeholder;\n }\n\n public set placeholder(placeholder:string) {\n this._placeholder = placeholder;\n }\n\n private _localeValues:ISearchLocaleValues;\n\n public localeOverrides:RecursivePartial;\n\n public get localeValues():ISearchLocaleValues {\n return this._localizationService.override<\"search\">(this._localeValues, this.localeOverrides);\n }\n\n public get query():string {\n return this.searchService.query;\n }\n\n public set query(query:string) {\n this.selectedResult = undefined;\n // Initialise a delayed search.\n this.searchService.updateQueryDelayed(query, () =>\n // Set the results open state depending on whether a query has been entered.\n this.dropdownService.setOpenState(this.searchService.query.length > 0 || this.allowEmptyQuery));\n }\n\n @Input()\n public set options(options:T[] | undefined) {\n if (options) {\n this.searchService.options = options;\n }\n }\n\n @Input()\n public set optionsFilter(filter:FilterFn | undefined) {\n if (filter) {\n this.searchService.optionsFilter = filter;\n }\n }\n\n @Input()\n public set optionsLookup(lookupFn:LookupFn | undefined) {\n this.searchService.optionsLookup = lookupFn;\n }\n\n @Input()\n public set optionsField(field:string | undefined) {\n this.searchService.optionsField = field;\n }\n\n private _resultFormatter?:(r:T, q:string) => string;\n\n public get resultFormatter():(result:T, query:string) => string {\n if (this._resultFormatter) {\n return this._resultFormatter;\n } else if (this.searchService.optionsLookup) {\n return r => this.readValue(r);\n } else {\n return (r, q) => this.searchService.highlightMatches(this.readValue(r), q);\n }\n }\n\n @Input()\n public set resultFormatter(formatter:(result:T, query:string) => string) {\n this._resultFormatter = formatter;\n }\n\n @Input()\n public resultTemplate:TemplateRef>;\n\n @Input()\n public retainSelectedResult:boolean;\n\n @Input()\n public set searchDelay(delay:number) {\n this.searchService.searchDelay = delay;\n }\n\n @HostBinding(\"class.loading\")\n public get isSearching():boolean {\n return this.searchService.isSearching;\n }\n\n @Input()\n public maxResults:number;\n\n public get results():T[] {\n return this.searchService.results.slice(0, this.maxResults);\n }\n\n // Stores the currently selected result.\n public selectedResult?:T;\n\n // Emits whenever a new result is selected.\n @Output(\"resultSelected\")\n public onResultSelected:EventEmitter;\n\n @Input()\n public transition:string;\n\n @Input()\n public transitionDuration:number;\n\n private _documentClickListener:() => void;\n\n constructor(private _element:ElementRef, renderer:Renderer2, private _localizationService:SuiLocalizationService) {\n this.dropdownService = new DropdownService();\n this.searchService = new SearchService();\n\n this.onLocaleUpdate();\n this._localizationService.onLanguageUpdate.subscribe(() => this.onLocaleUpdate());\n\n this._searchClasses = true;\n this.hasIcon = true;\n this.allowEmptyQuery = false;\n this.resetQueryOnChange = true;\n this.retainSelectedResult = true;\n this.searchDelay = 200;\n this.maxResults = 7;\n\n this.onResultSelected = new EventEmitter();\n\n this.transition = \"scale\";\n this.transitionDuration = 200;\n\n this._documentClickListener = renderer.listen(\"document\", \"click\", (e:MouseEvent) => this.onDocumentClick(e));\n }\n\n public ngAfterViewInit():void {\n this._menu.service = this.dropdownService;\n }\n\n private onLocaleUpdate():void {\n this._localeValues = this._localizationService.get().search;\n }\n\n // Selects a result.\n public select(result:T):void {\n this.onResultSelected.emit(result);\n this.dropdownService.setOpenState(false);\n\n if (this.retainSelectedResult) {\n this.selectedResult = result;\n this.searchService.updateQuery(this.readValue(result));\n } else {\n this.searchService.updateQuery(\"\");\n }\n }\n\n public onClick(e:MouseEvent):void {\n this.open();\n }\n\n @HostListener(\"focusin\")\n private onFocusIn():void {\n if (!this.dropdownService.isAnimating) {\n this.open();\n }\n }\n\n private open():void {\n if (this.searchService.query.length > 0 || this.allowEmptyQuery) {\n // Only open on click when there is a query entered.\n this.dropdownService.setOpenState(true);\n }\n }\n\n @HostListener(\"focusout\", [\"$event\"])\n private onFocusOut(e:IFocusEvent):void {\n if (!this._element.nativeElement.contains(e.relatedTarget)) {\n this.dropdownService.setOpenState(false);\n }\n }\n\n public onDocumentClick(e:MouseEvent):void {\n if (!this._element.nativeElement.contains(e.target)) {\n this.dropdownService.setOpenState(false);\n }\n }\n\n // Reads the specified field from an item.\n public readValue(object:T):string {\n return Util.Object.readValue(object, this.searchService.optionsField);\n }\n\n public ngOnDestroy():void {\n this._documentClickListener();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/search/components/search.metadata.json b/dist/modules/search/components/search.metadata.json deleted file mode 100644 index 2880e7866..000000000 --- a/dist/modules/search/components/search.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"IResultContext":{"__symbolic":"interface"},"SuiSearch":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"selector":"sui-search","template":"\n
\n \n \n
\n
\n\n \n\n
\n
{{ localeValues.noResults.header }}
\n
{{ localeValues.noResults.message }}
\n
\n
\n","styles":["\n/* Ensures results div has margin. */\n:host {\n display: inline-block;\n}\n\n/* Fixes positioning when results are pushed above the search. */\n.results {\n margin-bottom: .5em;\n}\n"]}]}],"members":{"_menu":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":57,"character":5},"arguments":[{"__symbolic":"reference","module":"../../dropdown/index","name":"SuiDropdownMenu","line":57,"character":15}]}]}],"_searchClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":62,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":63,"character":5},"arguments":["class.search"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":66,"character":5},"arguments":["class.active"]}]}],"hasIcon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":72,"character":5}}]}],"resetQueryOnChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":76,"character":5}}]}],"allowEmptyQuery":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":82,"character":5}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":95,"character":5}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":124,"character":5}}]}],"optionsFilter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":131,"character":5}}]}],"optionsLookup":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":138,"character":5}}]}],"optionsField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":143,"character":5}}]}],"resultFormatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":160,"character":5}}]}],"resultTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":165,"character":5}}]}],"retainSelectedResult":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":168,"character":5}}]}],"searchDelay":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":171,"character":5}}]}],"isSearching":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":176,"character":5},"arguments":["class.loading"]}]}],"maxResults":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":181,"character":5}}]}],"onResultSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":192,"character":5},"arguments":["resultSelected"]}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":195,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":198,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":203,"character":33},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":203,"character":54},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":203,"character":94}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"onLocaleUpdate":[{"__symbolic":"method"}],"select":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method"}],"onFocusIn":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":251,"character":5},"arguments":["focusin"]}]}],"open":[{"__symbolic":"method"}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":265,"character":5},"arguments":["focusout",["$event"]]}]}],"onDocumentClick":[{"__symbolic":"method"}],"readValue":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/search/helpers/lookup-fn.d.ts b/dist/modules/search/helpers/lookup-fn.d.ts deleted file mode 100644 index 5797d7aae..000000000 --- a/dist/modules/search/helpers/lookup-fn.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare type LookupFnResult = Promise; -export declare type LookupFn = (query: string | undefined, initial?: U | U[]) => LookupFnResult | LookupFnResult; -export declare type FilterFn = (options: T[], query: string) => T[] | false; diff --git a/dist/modules/search/helpers/lookup-fn.js b/dist/modules/search/helpers/lookup-fn.js deleted file mode 100644 index 81fe19cf7..000000000 --- a/dist/modules/search/helpers/lookup-fn.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=lookup-fn.js.map \ No newline at end of file diff --git a/dist/modules/search/helpers/lookup-fn.js.map b/dist/modules/search/helpers/lookup-fn.js.map deleted file mode 100644 index 9f26fefe6..000000000 --- a/dist/modules/search/helpers/lookup-fn.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lookup-fn.js","sourceRoot":"","sources":["../../../../src/modules/search/helpers/lookup-fn.ts"],"names":[],"mappings":"","sourcesContent":["// Define useful types to avoid any.\nexport type LookupFnResult = Promise;\nexport type LookupFn = (query:string | undefined, initial?:U | U[]) => LookupFnResult | LookupFnResult;\nexport type FilterFn = (options:T[], query:string) => T[] | false;\n"]} \ No newline at end of file diff --git a/dist/modules/search/helpers/lookup-fn.metadata.json b/dist/modules/search/helpers/lookup-fn.metadata.json deleted file mode 100644 index 00621eb4b..000000000 --- a/dist/modules/search/helpers/lookup-fn.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"LookupFnResult":{"__symbolic":"interface"},"LookupFn":{"__symbolic":"interface"},"FilterFn":{"__symbolic":"interface"}}}] \ No newline at end of file diff --git a/dist/modules/search/index.d.ts b/dist/modules/search/index.d.ts deleted file mode 100644 index 53546db8c..000000000 --- a/dist/modules/search/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./components/search-result"; -export * from "./components/search"; -export * from "./helpers/lookup-fn"; -export * from "./services/search.service"; -export * from "./search.module"; diff --git a/dist/modules/search/index.js b/dist/modules/search/index.js deleted file mode 100644 index efcdc7ef9..000000000 --- a/dist/modules/search/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./components/search-result"; -export * from "./components/search"; -export * from "./services/search.service"; -export * from "./search.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/search/index.js.map b/dist/modules/search/index.js.map deleted file mode 100644 index 194bf22c2..000000000 --- a/dist/modules/search/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/search/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AAIpC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./components/search-result\";\nexport * from \"./components/search\";\n\nexport * from \"./helpers/lookup-fn\";\n\nexport * from \"./services/search.service\";\n\nexport * from \"./search.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/search/index.metadata.json b/dist/modules/search/index.metadata.json deleted file mode 100644 index b1ada1a3e..000000000 --- a/dist/modules/search/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/search-result"},{"from":"./components/search"},{"from":"./helpers/lookup-fn"},{"from":"./services/search.service"},{"from":"./search.module"}]}] \ No newline at end of file diff --git a/dist/modules/search/public.d.ts b/dist/modules/search/public.d.ts deleted file mode 100644 index 1b29b07f9..000000000 --- a/dist/modules/search/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiSearchModule, SearchService, LookupFn, FilterFn, IResultContext } from "./index"; diff --git a/dist/modules/search/public.js b/dist/modules/search/public.js deleted file mode 100644 index 8b44e072d..000000000 --- a/dist/modules/search/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiSearchModule, SearchService } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/search/public.js.map b/dist/modules/search/public.js.map deleted file mode 100644 index 44b21e336..000000000 --- a/dist/modules/search/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/search/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,aAAa,EAIhB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiSearchModule,\n SearchService,\n LookupFn,\n FilterFn,\n IResultContext\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/search/public.metadata.json b/dist/modules/search/public.metadata.json deleted file mode 100644 index 4d7c184ee..000000000 --- a/dist/modules/search/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiSearchModule","SearchService","LookupFn","FilterFn","IResultContext"]}]}] \ No newline at end of file diff --git a/dist/modules/search/search.module.d.ts b/dist/modules/search/search.module.d.ts deleted file mode 100644 index 4c0258f11..000000000 --- a/dist/modules/search/search.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiSearchModule { -} diff --git a/dist/modules/search/search.module.js b/dist/modules/search/search.module.js deleted file mode 100644 index 9c4c3dbba..000000000 --- a/dist/modules/search/search.module.js +++ /dev/null @@ -1,35 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { FormsModule } from "@angular/forms"; -import { SuiDropdownModule } from "../dropdown/index"; -import { SuiLocalizationModule } from "../../behaviors/localization/index"; -import { SuiUtilityModule } from "../../misc/util/index"; -import { SuiSearch } from "./components/search"; -import { SuiSearchResult } from "./components/search-result"; -var SuiSearchModule = /** @class */ (function () { - function SuiSearchModule() { - } - SuiSearchModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule, - FormsModule, - SuiDropdownModule, - SuiLocalizationModule, - SuiUtilityModule - ], - declarations: [ - SuiSearch, - SuiSearchResult - ], - exports: [ - SuiSearch - ] - },] }, - ]; - /** @nocollapse */ - SuiSearchModule.ctorParameters = function () { return []; }; - return SuiSearchModule; -}()); -export { SuiSearchModule }; -//# sourceMappingURL=search.module.js.map \ No newline at end of file diff --git a/dist/modules/search/search.module.js.map b/dist/modules/search/search.module.js.map deleted file mode 100644 index 71b55d278..000000000 --- a/dist/modules/search/search.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"search.module.js","sourceRoot":"","sources":["../../../src/modules/search/search.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;;;;;gBAE5D,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,iBAAiB;wBACjB,qBAAqB;wBACrB,gBAAgB;qBACnB;oBACD,YAAY,EAAE;wBACV,SAAS;wBACT,eAAe;qBAClB;oBACD,OAAO,EAAE;wBACL,SAAS;qBACZ;iBACJ;;;;0BAxBD;;SAyBa,eAAe","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { SuiDropdownModule } from \"../dropdown/index\";\nimport { SuiLocalizationModule } from \"../../behaviors/localization/index\";\nimport { SuiUtilityModule } from \"../../misc/util/index\";\nimport { SuiSearch } from \"./components/search\";\nimport { SuiSearchResult } from \"./components/search-result\";\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SuiDropdownModule,\n SuiLocalizationModule,\n SuiUtilityModule\n ],\n declarations: [\n SuiSearch,\n SuiSearchResult\n ],\n exports: [\n SuiSearch\n ]\n})\nexport class SuiSearchModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/search/search.module.metadata.json b/dist/modules/search/search.module.metadata.json deleted file mode 100644 index 489c208a3..000000000 --- a/dist/modules/search/search.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiSearchModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":9,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":11,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":12,"character":8},{"__symbolic":"reference","module":"../dropdown/index","name":"SuiDropdownModule","line":13,"character":8},{"__symbolic":"reference","module":"../../behaviors/localization/index","name":"SuiLocalizationModule","line":14,"character":8},{"__symbolic":"reference","module":"../../misc/util/index","name":"SuiUtilityModule","line":15,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/search","name":"SuiSearch","line":18,"character":8},{"__symbolic":"reference","module":"./components/search-result","name":"SuiSearchResult","line":19,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/search","name":"SuiSearch","line":22,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/search/services/search.service.d.ts b/dist/modules/search/services/search.service.d.ts deleted file mode 100644 index c6a99be28..000000000 --- a/dist/modules/search/services/search.service.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { LookupFn, LookupFnResult, FilterFn } from "../helpers/lookup-fn"; -export declare class SearchService { - private _options; - private _optionsLookup?; - private _optionsField?; - optionsFilter: FilterFn; - options: T[]; - optionsLookup: LookupFn | undefined; - readonly hasItemLookup: boolean; - optionsField: string | undefined; - private _results; - private _resultsCache; - readonly results: T[]; - private _query; - resetQueryOnChange: boolean; - allowEmptyQuery: boolean; - searchDelay: number; - private _searchDelayTimeout; - private _isSearching; - readonly query: string; - readonly isSearching: boolean; - constructor(allowEmptyQuery?: boolean); - updateQueryDelayed(query: string, callback?: (err?: Error) => void): void; - updateQuery(query: string, callback?: (err?: Error) => void): void; - private updateResults(results); - initialLookup(initial: U): LookupFnResult; - initialLookup(initial: U[]): LookupFnResult; - private toRegex(query); - highlightMatches(text: string, query: string): string; - private reset(); -} diff --git a/dist/modules/search/services/search.service.js b/dist/modules/search/services/search.service.js deleted file mode 100644 index 070edfc69..000000000 --- a/dist/modules/search/services/search.service.js +++ /dev/null @@ -1,211 +0,0 @@ -import { Util } from "../../../misc/util/index"; -var SearchService = /** @class */ (function () { - function SearchService(allowEmptyQuery) { - if (allowEmptyQuery === void 0) { allowEmptyQuery = false; } - var _this = this; - this._options = []; - this.optionsFilter = function (os, q) { - // Convert the query string to a RegExp. - var regex = _this.toRegex(_this._query); - if (regex instanceof RegExp) { - // Only update the results if the query was valid regex. - // This avoids the results suddenly becoming empty if an invalid regex string is inputted. - return os - .filter(function (o) { - return Util.Object.readValue(o, _this._optionsField) - .toString() - .match(regex); - }); - } - // Don't update since it wasn't a valid regex. - return false; - }; - // Set default values and reset. - this.allowEmptyQuery = allowEmptyQuery; - this._query = ""; - this.resetQueryOnChange = true; - this.searchDelay = 0; - this.reset(); - } - Object.defineProperty(SearchService.prototype, "options", { - get: function () { - return this._options; - }, - set: function (options) { - this._options = options || []; - // We cannot use both local & remote options simultaneously. - this._optionsLookup = undefined; - // Reset entire service with new options. - this.reset(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "optionsLookup", { - get: function () { - return this._optionsLookup; - }, - set: function (lookupFn) { - this._optionsLookup = lookupFn; - // As before, cannot use local & remote options simultaneously. - this._options = []; - this.reset(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "hasItemLookup", { - get: function () { - return !!this.optionsLookup && this.optionsLookup.length === 2; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "optionsField", { - get: function () { - return this._optionsField; - }, - set: function (field) { - this._optionsField = field; - // We need to reset otherwise we would now be showing invalid search results. - this.reset(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "results", { - get: function () { - return this._results; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "query", { - get: function () { - return this._query; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SearchService.prototype, "isSearching", { - get: function () { - return this._isSearching; - }, - enumerable: true, - configurable: true - }); - // Updates the query after the specified search delay. - // Updates the query after the specified search delay. - SearchService.prototype.updateQueryDelayed = - // Updates the query after the specified search delay. - function (query, callback) { - var _this = this; - if (callback === void 0) { callback = function () { }; } - this._query = query; - clearTimeout(this._searchDelayTimeout); - this._searchDelayTimeout = window.setTimeout(function () { - _this.updateQuery(query, callback); - }, this.searchDelay); - }; - // Updates the current search query. - // Updates the current search query. - SearchService.prototype.updateQuery = - // Updates the current search query. - function (query, callback) { - var _this = this; - if (callback === void 0) { callback = function () { }; } - this._query = query; - if (this._query === "" && !this.allowEmptyQuery) { - // Don't update if the new query is empty (and we don't allow empty queries). - // Don't reset so that when animating closed we don't get a judder. - return callback(); - } - if (this._resultsCache.hasOwnProperty(this._query)) { - // If the query is already cached, make use of it. - this._results = this._resultsCache[this._query]; - return callback(); - } - if (this._optionsLookup) { - this._isSearching = true; - // Call the options lookup without a this context. - var queryLookup = this._optionsLookup.call(undefined, this._query); - queryLookup - .then(function (results) { - _this._isSearching = false; - _this.updateResults(results); - return callback(); - }) - .catch(function (error) { - // Unset 'loading' state, and throw the returned error without updating the results. - // Unset 'loading' state, and throw the returned error without updating the results. - _this._isSearching = false; - return callback(error); - }); - return; - } - var filtered = this.optionsFilter.call(undefined, this._options, this._query); - if (filtered) { - this.updateResults(filtered); - } - return callback(); - }; - // Updates & caches the new set of results. - // Updates & caches the new set of results. - SearchService.prototype.updateResults = - // Updates & caches the new set of results. - function (results) { - this._resultsCache[this._query] = results; - this._results = results; - }; - // tslint:disable-next-line:promise-function-async - // tslint:disable-next-line:promise-function-async - SearchService.prototype.initialLookup = - // tslint:disable-next-line:promise-function-async - function (initial) { - if (initial instanceof Array) { - return this._optionsLookup(undefined, initial); - } - return this._optionsLookup(undefined, initial); - }; - // Converts a query string to regex without throwing an error. - // Converts a query string to regex without throwing an error. - SearchService.prototype.toRegex = - // Converts a query string to regex without throwing an error. - function (query) { - try { - return new RegExp(query, "i"); - } - catch (e) { - return query; - } - }; - // Generates HTML for highlighted match text. - // Generates HTML for highlighted match text. - SearchService.prototype.highlightMatches = - // Generates HTML for highlighted match text. - function (text, query) { - var regex = this.toRegex(query); - if (regex instanceof RegExp) { - return text.replace(regex, function (match) { return "" + match + ""; }); - } - return text; - }; - // Resets the search back to a pristine state. - // Resets the search back to a pristine state. - SearchService.prototype.reset = - // Resets the search back to a pristine state. - function () { - this._results = []; - this._resultsCache = {}; - this._isSearching = false; - if (this.resetQueryOnChange || !this.query) { - this.updateQuery(""); - } - else { - this.updateQuery(this.query); - } - }; - return SearchService; -}()); -export { SearchService }; -//# sourceMappingURL=search.service.js.map \ No newline at end of file diff --git a/dist/modules/search/services/search.service.js.map b/dist/modules/search/services/search.service.js.map deleted file mode 100644 index e07ce4f20..000000000 --- a/dist/modules/search/services/search.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"search.service.js","sourceRoot":"","sources":["../../../../src/modules/search/services/search.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKhD,IAAA;IA4EI,uBAAY,eAA+B;QAA/B,gCAAA,EAAA,uBAA+B;QAA3C,iBA0BC;QAzBG,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,UAAC,EAAE,EAAE,CAAC;;YAEvB,IAAM,KAAK,GAAG,KAAI,CAAC,OAAO,CAAC,KAAI,CAAC,MAAM,CAAC,CAAC;YAExC,EAAE,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EAAE,OAAO,CAAwB,CAAC;SAC/F;QACD,MAAM,CAAE,IAAI,CAAC,cAAiC,CAAC,SAAS,EAAE,OAAO,CAAsB,CAAC;KAC3F;IAED,8DAA8D;;IACtD,+BAAO;;IAAf,UAAgB,KAAY;QACxB,IAAI,CAAC;YACD,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;SACjC;QAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACT,MAAM,CAAC,KAAK,CAAC;SAChB;KACJ;IAED,6CAA6C;;IACtC,wCAAgB;;IAAvB,UAAwB,IAAW,EAAE,KAAY;QAC7C,IAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClC,EAAE,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC,CAAC,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,QAAM,KAAK,SAAM,EAAjB,CAAiB,CAAC,CAAC;SAC1D;QACD,MAAM,CAAC,IAAI,CAAC;KACf;IAED,8CAA8C;;IACtC,6BAAK;;IAAb;QACI,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACzC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;SACxB;QAAC,IAAI,CAAC,CAAC;YACJ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAChC;KACJ;wBAtNL;IAuNC,CAAA;AAlND,yBAkNC","sourcesContent":["import { Util } from \"../../../misc/util/index\";\nimport { LookupFn, LookupFnResult, FilterFn } from \"../helpers/lookup-fn\";\n\ninterface ICachedArray { [query:string]:T[]; }\n\nexport class SearchService {\n // Stores the available options.\n private _options:T[];\n // Converts a query string into an array of options. Must be a function returning a promise.\n private _optionsLookup?:LookupFn;\n // Field that options are searched & displayed on.\n private _optionsField?:string;\n // Filters a list of options.\n public optionsFilter:FilterFn;\n\n public get options():T[] {\n return this._options;\n }\n\n public set options(options:T[]) {\n this._options = options || [];\n // We cannot use both local & remote options simultaneously.\n this._optionsLookup = undefined;\n // Reset entire service with new options.\n this.reset();\n }\n\n public get optionsLookup():LookupFn | undefined {\n return this._optionsLookup;\n }\n\n public set optionsLookup(lookupFn:LookupFn | undefined) {\n this._optionsLookup = lookupFn;\n // As before, cannot use local & remote options simultaneously.\n this._options = [];\n this.reset();\n }\n\n public get hasItemLookup():boolean {\n return !!this.optionsLookup && this.optionsLookup.length === 2;\n }\n\n public get optionsField():string | undefined {\n return this._optionsField;\n }\n\n public set optionsField(field:string | undefined) {\n this._optionsField = field;\n // We need to reset otherwise we would now be showing invalid search results.\n this.reset();\n }\n\n // Stores the results of the query.\n private _results:T[];\n // Cache of results, indexed by query.\n private _resultsCache:ICachedArray;\n\n public get results():T[] {\n return this._results;\n }\n\n private _query:string;\n // Allows the query to be empty when the options change.\n public resetQueryOnChange:boolean;\n // Allows the empty query to produce results.\n public allowEmptyQuery:boolean;\n // How long to delay the search for when using updateQueryDelayed. Stored in ms.\n public searchDelay:number;\n // Stores the search timeout handle so we can cancel it.\n private _searchDelayTimeout:number;\n // Provides 'loading' functionality.\n private _isSearching:boolean;\n\n public get query():string {\n return this._query;\n }\n\n public get isSearching():boolean {\n return this._isSearching;\n }\n\n constructor(allowEmptyQuery:boolean = false) {\n this._options = [];\n this.optionsFilter = (os, q) => {\n // Convert the query string to a RegExp.\n const regex = this.toRegex(this._query);\n\n if (regex instanceof RegExp) {\n // Only update the results if the query was valid regex.\n // This avoids the results suddenly becoming empty if an invalid regex string is inputted.\n return os\n // Filter on the options with a string match on the field we are testing.\n .filter(o => Util.Object.readValue(o, this._optionsField)\n .toString()\n .match(regex));\n }\n\n // Don't update since it wasn't a valid regex.\n return false;\n };\n\n // Set default values and reset.\n this.allowEmptyQuery = allowEmptyQuery;\n this._query = \"\";\n this.resetQueryOnChange = true;\n this.searchDelay = 0;\n this.reset();\n }\n\n // Updates the query after the specified search delay.\n public updateQueryDelayed(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n clearTimeout(this._searchDelayTimeout);\n this._searchDelayTimeout = window.setTimeout(\n () => {\n this.updateQuery(query, callback);\n },\n this.searchDelay\n );\n }\n\n // Updates the current search query.\n public updateQuery(query:string, callback:(err?:Error) => void = () => {}):void {\n this._query = query;\n\n if (this._query === \"\" && !this.allowEmptyQuery) {\n // Don't update if the new query is empty (and we don't allow empty queries).\n // Don't reset so that when animating closed we don't get a judder.\n return callback();\n }\n\n if (this._resultsCache.hasOwnProperty(this._query)) {\n // If the query is already cached, make use of it.\n this._results = this._resultsCache[this._query];\n\n return callback();\n }\n\n if (this._optionsLookup) {\n this._isSearching = true;\n\n // Call the options lookup without a this context.\n const queryLookup = this._optionsLookup.call(undefined, this._query) as LookupFnResult;\n\n queryLookup\n .then(results => {\n this._isSearching = false;\n\n this.updateResults(results);\n return callback();\n })\n .catch(error => {\n // Unset 'loading' state, and throw the returned error without updating the results.\n this._isSearching = false;\n return callback(error);\n });\n\n return;\n }\n\n const filtered = this.optionsFilter.call(undefined, this._options, this._query);\n if (filtered) {\n this.updateResults(filtered);\n }\n return callback();\n }\n\n // Updates & caches the new set of results.\n private updateResults(results:T[]):void {\n this._resultsCache[this._query] = results;\n this._results = results;\n }\n\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U[]):LookupFnResult;\n // tslint:disable-next-line:promise-function-async\n public initialLookup(initial:U | U[]):LookupFnResult | LookupFnResult {\n if (initial instanceof Array) {\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n return (this._optionsLookup as LookupFn)(undefined, initial) as LookupFnResult;\n }\n\n // Converts a query string to regex without throwing an error.\n private toRegex(query:string):RegExp | string {\n try {\n return new RegExp(query, \"i\");\n } catch (e) {\n return query;\n }\n }\n\n // Generates HTML for highlighted match text.\n public highlightMatches(text:string, query:string):string {\n const regex = this.toRegex(query);\n if (regex instanceof RegExp) {\n return text.replace(regex, match => `${match}`);\n }\n return text;\n }\n\n // Resets the search back to a pristine state.\n private reset():void {\n this._results = [];\n this._resultsCache = {};\n this._isSearching = false;\n if (this.resetQueryOnChange || !this.query) {\n this.updateQuery(\"\");\n } else {\n this.updateQuery(this.query);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/search/services/search.service.metadata.json b/dist/modules/search/services/search.service.metadata.json deleted file mode 100644 index 2914007c0..000000000 --- a/dist/modules/search/services/search.service.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SearchService":{"__symbolic":"class","arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"boolean"}]}],"updateQueryDelayed":[{"__symbolic":"method"}],"updateQuery":[{"__symbolic":"method"}],"updateResults":[{"__symbolic":"method"}],"initialLookup":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"toRegex":[{"__symbolic":"method"}],"highlightMatches":[{"__symbolic":"method"}],"reset":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/classes/select-base.d.ts b/dist/modules/select/classes/select-base.d.ts deleted file mode 100644 index 0a66b1a33..000000000 --- a/dist/modules/select/classes/select-base.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { ElementRef, QueryList, AfterContentInit, TemplateRef, ViewContainerRef, EventEmitter, OnDestroy, Renderer2 } from "@angular/core"; -import { DropdownService, SuiDropdownMenu } from "../../dropdown/index"; -import { SearchService, LookupFn, FilterFn } from "../../search/index"; -import { ITemplateRefContext, HandledEvent } from "../../../misc/util/index"; -import { ISelectLocaleValues, RecursivePartial, SuiLocalizationService } from "../../../behaviors/localization/index"; -import { SuiSelectOption } from "../components/select-option"; -import { SuiSelectSearch } from "../directives/select-search"; -export interface IOptionContext extends ITemplateRefContext { - query?: string; -} -export declare abstract class SuiSelectBase implements AfterContentInit, OnDestroy { - private _element; - protected _localizationService: SuiLocalizationService; - dropdownService: DropdownService; - searchService: SearchService; - protected _menu: SuiDropdownMenu; - protected _renderedOptions: QueryList>; - private _renderedSubscriptions; - private _selectClasses; - readonly isActive: boolean; - readonly isVisible: boolean; - isSearchable: boolean; - isSearchExternal: boolean; - private readonly _searchClass; - readonly isSearching: boolean; - private _internalSearch?; - private _manualSearch?; - readonly searchInput: SuiSelectSearch | undefined; - private _tabIndex?; - readonly tabIndex: number; - isDisabled: boolean; - options: T[]; - optionsFilter: FilterFn | undefined; - optionsLookup: LookupFn | undefined; - readonly filteredOptions: T[]; - readonly availableOptions: T[]; - query: string | undefined; - labelField: string | undefined; - readonly labelGetter: (obj: T) => string; - valueField: string; - readonly valueGetter: (obj: T) => U; - optionTemplate: TemplateRef>; - private _optionFormatter?; - readonly configuredFormatter: (option: T) => string; - optionFormatter: ((option: T, query?: string) => string) | undefined; - private _localeValues; - localeOverrides: RecursivePartial; - readonly localeValues: ISelectLocaleValues; - icon: string; - transition: string; - transitionDuration: number; - onTouched: EventEmitter; - private _documentKeyDownListener; - constructor(_element: ElementRef, renderer: Renderer2, _localizationService: SuiLocalizationService); - ngAfterContentInit(): void; - private onLocaleUpdate(); - protected optionsUpdateHook(): void; - protected queryUpdateHook(): void; - protected updateQuery(query: string): void; - protected resetQuery(delayed?: boolean): void; - protected onAvailableOptionsRendered(): void; - protected initialiseRenderedOption(option: SuiSelectOption): void; - abstract selectOption(option: T): void; - protected findOption(options: T[], value: U): T | undefined; - onCaretClick(e: HandledEvent): void; - onClick(e: HandledEvent): void; - private onFocusIn(); - private onFocusOut(e); - onKeyPress(e: KeyboardEvent): void; - onDocumentKeyDown(e: KeyboardEvent): void; - onQueryInputKeydown(event: KeyboardEvent): void; - protected focus(): void; - protected drawTemplate(siblingRef: ViewContainerRef, value: T): void; - ngOnDestroy(): void; -} diff --git a/dist/modules/select/classes/select-base.js b/dist/modules/select/classes/select-base.js deleted file mode 100644 index 9a1435a65..000000000 --- a/dist/modules/select/classes/select-base.js +++ /dev/null @@ -1,414 +0,0 @@ -import { ViewChild, HostBinding, HostListener, Input, ContentChildren, QueryList, TemplateRef, ContentChild, EventEmitter, Output } from "@angular/core"; -import { DropdownService, SuiDropdownMenu } from "../../dropdown/index"; -import { SearchService } from "../../search/index"; -import { Util, HandledEvent, KeyCode } from "../../../misc/util/index"; -import { SuiSelectOption } from "../components/select-option"; -import { SuiSelectSearch } from "../directives/select-search"; -// We use generic type T to specify the type of the options we are working with, -// and U to specify the type of the property of the option used as the value. -var SuiSelectBase = /** @class */ (function () { - function SuiSelectBase(_element, renderer, _localizationService) { - var _this = this; - this._element = _element; - this._localizationService = _localizationService; - this.dropdownService = new DropdownService(); - // We do want an empty query to return all results. - this.searchService = new SearchService(true); - this.isSearchable = false; - this.onLocaleUpdate(); - this._localizationService.onLanguageUpdate.subscribe(function () { return _this.onLocaleUpdate(); }); - this._renderedSubscriptions = []; - this.icon = "dropdown"; - this.transition = "slide down"; - this.transitionDuration = 200; - this.onTouched = new EventEmitter(); - this._documentKeyDownListener = renderer.listen("document", "keydown", function (e) { return _this.onDocumentKeyDown(e); }); - this._selectClasses = true; - } - Object.defineProperty(SuiSelectBase.prototype, "isActive", { - get: function () { - return this.dropdownService.isOpen; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "isVisible", { - get: function () { - return this._menu.isVisible; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "_searchClass", { - get: function () { - return this.isSearchable && !this.isSearchExternal; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "isSearching", { - get: function () { - return this.searchService.isSearching; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "searchInput", { - get: function () { - return this._manualSearch || this._internalSearch; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "tabIndex", { - get: function () { - if (this.isDisabled) { - // If disabled, remove from tabindex. - return -1; - } - if (this.dropdownService.isOpen && this.isSearchExternal) { - // If open & in menu search, remove from tabindex (as input always autofocusses). - return -1; - } - if (this._tabIndex != undefined) { - // If custom tabindex, default to that. - return this._tabIndex; - } - if (this._searchClass) { - // If search input enabled, tab goes to input. - return -1; - } - // Otherwise, return default of 0. - return 0; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "isDisabled", { - get: function () { - return this.dropdownService.isDisabled; - }, - set: function (value) { - this.dropdownService.isDisabled = !!value; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "options", { - set: function (options) { - if (options) { - this.searchService.options = options; - this.optionsUpdateHook(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "optionsFilter", { - set: function (filter) { - if (filter) { - this.searchService.optionsFilter = filter; - this.optionsUpdateHook(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "optionsLookup", { - set: function (lookup) { - if (lookup) { - this.searchService.optionsLookup = lookup; - this.optionsUpdateHook(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "filteredOptions", { - get: function () { - return this.searchService.results; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "availableOptions", { - // Deprecated - get: - // Deprecated - function () { - return this.filteredOptions; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "query", { - get: function () { - return this.isSearchable ? this.searchService.query : undefined; - }, - set: function (query) { - var _this = this; - if (query != undefined) { - this.queryUpdateHook(); - this.updateQuery(query); - // Update the rendered text as query has changed. - this._renderedOptions.forEach(function (ro) { return _this.initialiseRenderedOption(ro); }); - if (this.searchInput) { - this.searchInput.query = query; - } - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "labelField", { - get: function () { - return this.searchService.optionsField; - }, - set: function (field) { - this.searchService.optionsField = field; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "labelGetter", { - get: function () { - var _this = this; - // Helper function to retrieve the label from an item. - return function (obj) { - var label = Util.Object.readValue(obj, _this.labelField); - if (label != undefined) { - return label.toString(); - } - return ""; - }; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "valueGetter", { - get: function () { - var _this = this; - // Helper function to retrieve the value from an item. - return function (obj) { return Util.Object.readValue(obj, _this.valueField); }; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "configuredFormatter", { - get: function () { - var _this = this; - if (this._optionFormatter) { - return function (o) { return _this._optionFormatter(o, _this.isSearchable ? _this.query : undefined); }; - } - else if (this.searchService.optionsLookup) { - return function (o) { return _this.labelGetter(o); }; - } - else { - return function (o) { return _this.searchService.highlightMatches(_this.labelGetter(o), _this.query || ""); }; - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "optionFormatter", { - set: function (formatter) { - this._optionFormatter = formatter; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSelectBase.prototype, "localeValues", { - get: function () { - return this._localizationService.override(this._localeValues, this.localeOverrides); - }, - enumerable: true, - configurable: true - }); - SuiSelectBase.prototype.ngAfterContentInit = function () { - var _this = this; - this._menu.service = this.dropdownService; - // We manually specify the menu items to the menu because the @ContentChildren doesn't pick up our dynamically rendered items. - this._menu.items = this._renderedOptions; - if (this._manualSearch) { - this.isSearchable = true; - this.isSearchExternal = true; - } - if (this.searchInput) { - this.searchInput.onQueryUpdated.subscribe(function (q) { return _this.query = q; }); - this.searchInput.onQueryKeyDown.subscribe(function (e) { return _this.onQueryInputKeydown(e); }); - } - // We must call this immediately as changes doesn't fire when you subscribe. - this.onAvailableOptionsRendered(); - this._renderedOptions.changes.subscribe(function () { return _this.onAvailableOptionsRendered(); }); - }; - SuiSelectBase.prototype.onLocaleUpdate = function () { - this._localeValues = this._localizationService.get().select; - }; - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - SuiSelectBase.prototype.optionsUpdateHook = - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - function () { }; - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - SuiSelectBase.prototype.queryUpdateHook = - // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass. - function () { }; - SuiSelectBase.prototype.updateQuery = function (query) { - var _this = this; - // Update the query then open the dropdown, as after keyboard input it should always be open. - this.searchService.updateQuery(query, function () { - return _this.dropdownService.setOpenState(true); - }); - }; - SuiSelectBase.prototype.resetQuery = function (delayed) { - if (delayed === void 0) { delayed = true; } - // The search delay is set to the transition duration to ensure results - // aren't rendered as the select closes as that causes a sudden flash. - if (delayed) { - this.searchService.searchDelay = this._menu.menuTransitionDuration; - this.searchService.updateQueryDelayed(""); - } - else { - this.searchService.updateQuery(""); - } - if (this.searchInput) { - this.searchInput.query = ""; - } - }; - SuiSelectBase.prototype.onAvailableOptionsRendered = function () { - var _this = this; - // Unsubscribe from all previous subscriptions to avoid memory leaks on large selects. - this._renderedSubscriptions.forEach(function (rs) { return rs.unsubscribe(); }); - this._renderedSubscriptions = []; - this._renderedOptions.forEach(function (ro) { - // Slightly delay initialisation to avoid change after checked errors. TODO - look into avoiding this! - setTimeout(function () { return _this.initialiseRenderedOption(ro); }); - _this._renderedSubscriptions.push(ro.onSelected.subscribe(function () { return _this.selectOption(ro.value); })); - }); - // If no options have been provided, autogenerate them from the rendered ones. - if (this.searchService.options.length === 0 && !this.searchService.optionsLookup) { - this.options = this._renderedOptions.map(function (ro) { return ro.value; }); - } - }; - SuiSelectBase.prototype.initialiseRenderedOption = function (option) { - option.usesTemplate = !!this.optionTemplate; - option.formatter = this.configuredFormatter; - if (option.usesTemplate) { - this.drawTemplate(option.templateSibling, option.value); - } - option.changeDetector.markForCheck(); - }; - SuiSelectBase.prototype.findOption = function (options, value) { - var _this = this; - // Tries to find an option in options array - return options.find(function (o) { return value === _this.valueGetter(o); }); - }; - SuiSelectBase.prototype.onCaretClick = function (e) { - if (!e.eventHandled) { - e.eventHandled = true; - if (!this.dropdownService.isAnimating) { - this.dropdownService.setOpenState(!this.dropdownService.isOpen); - this.focus(); - } - } - }; - SuiSelectBase.prototype.onClick = function (e) { - if (!e.eventHandled && !this.dropdownService.isAnimating) { - e.eventHandled = true; - // If the dropdown is searchable, clicking should keep it open, otherwise we toggle the open state. - this.dropdownService.setOpenState(this.isSearchable ? true : !this.dropdownService.isOpen); - // Immediately focus the search input whenever clicking on the select. - this.focus(); - } - }; - SuiSelectBase.prototype.onFocusIn = function () { - if (!this.dropdownService.isOpen && !this.dropdownService.isAnimating) { - this.dropdownService.setOpenState(true); - this.focus(); - } - }; - SuiSelectBase.prototype.onFocusOut = function (e) { - if (!this._element.nativeElement.contains(e.relatedTarget)) { - this.dropdownService.setOpenState(false); - this.onTouched.emit(); - } - }; - SuiSelectBase.prototype.onKeyPress = function (e) { - if (e.keyCode === KeyCode.Enter) { - // Enables support for focussing and opening with the keyboard alone. - // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. - this._element.nativeElement.click(); - } - }; - SuiSelectBase.prototype.onDocumentKeyDown = function (e) { - if (this._element.nativeElement.contains(e.target) && - !this.dropdownService.isOpen && - e.keyCode === KeyCode.Down) { - // Enables support for focussing and opening with the keyboard alone. - // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. - this._element.nativeElement.click(); - e.preventDefault(); - } - }; - SuiSelectBase.prototype.onQueryInputKeydown = function (event) { }; - SuiSelectBase.prototype.focus = function () { - if (this.isSearchable && this.searchInput) { - // Focusses the search input only when searchable. - // Using directly because Renderer2 doesn't have invokeElementMethod method anymore. - this.searchInput.focus(); - } - else { - this._element.nativeElement.focus(); - } - }; - // Helper that draws the provided template beside the provided ViewContainerRef. - // Helper that draws the provided template beside the provided ViewContainerRef. - SuiSelectBase.prototype.drawTemplate = - // Helper that draws the provided template beside the provided ViewContainerRef. - function (siblingRef, value) { - siblingRef.clear(); - // Use of `$implicit` means use of syntax is supported. - siblingRef.createEmbeddedView(this.optionTemplate, { - $implicit: value, - query: this.query - }); - }; - SuiSelectBase.prototype.ngOnDestroy = function () { - this._renderedSubscriptions.forEach(function (s) { return s.unsubscribe(); }); - this._documentKeyDownListener(); - }; - SuiSelectBase.propDecorators = { - "_menu": [{ type: ViewChild, args: [SuiDropdownMenu,] },], - "_renderedOptions": [{ type: ContentChildren, args: [SuiSelectOption, { descendants: true },] },], - "_selectClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.dropdown",] },], - "isActive": [{ type: HostBinding, args: ["class.active",] },], - "isVisible": [{ type: HostBinding, args: ["class.visible",] },], - "isSearchable": [{ type: Input },], - "_searchClass": [{ type: HostBinding, args: ["class.search",] },], - "isSearching": [{ type: HostBinding, args: ["class.loading",] },], - "_internalSearch": [{ type: ViewChild, args: [SuiSelectSearch,] },], - "_manualSearch": [{ type: ContentChild, args: [SuiSelectSearch,] },], - "_tabIndex": [{ type: Input, args: ["tabindex",] },], - "tabIndex": [{ type: HostBinding, args: ["attr.tabindex",] },], - "isDisabled": [{ type: HostBinding, args: ["class.disabled",] }, { type: Input },], - "options": [{ type: Input },], - "optionsFilter": [{ type: Input },], - "optionsLookup": [{ type: Input },], - "labelField": [{ type: Input },], - "valueField": [{ type: Input },], - "optionTemplate": [{ type: Input },], - "optionFormatter": [{ type: Input },], - "icon": [{ type: Input },], - "transition": [{ type: Input },], - "transitionDuration": [{ type: Input },], - "onTouched": [{ type: Output, args: ["touched",] },], - "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], - "onFocusIn": [{ type: HostListener, args: ["focusin",] },], - "onFocusOut": [{ type: HostListener, args: ["focusout", ["$event"],] },], - "onKeyPress": [{ type: HostListener, args: ["keypress", ["$event"],] },], - }; - return SuiSelectBase; -}()); -export { SuiSelectBase }; -//# sourceMappingURL=select-base.js.map \ No newline at end of file diff --git a/dist/modules/select/classes/select-base.js.map b/dist/modules/select/classes/select-base.js.map deleted file mode 100644 index 645654002..000000000 --- a/dist/modules/select/classes/select-base.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"select-base.js","sourceRoot":"","sources":["../../../../src/modules/select/classes/select-base.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAAE,WAAW,EAAc,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,SAAS,EACjE,WAAW,EAAoB,YAAY,EAAE,YAAY,EAAE,MAAM,EACtF,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAsB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAuB,YAAY,EAAE,OAAO,EAAe,MAAM,0BAA0B,CAAC;AAEzG,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;;;;IA2N1D,uBAAoB,QAAmB,EAAE,QAAkB,EAAY,oBAA2C;QAAlH,iBAmBC;QAnBmB,aAAQ,GAAR,QAAQ,CAAW;QAAgC,yBAAoB,GAApB,oBAAoB,CAAuB;QAC9G,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;;QAE7C,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAO,IAAI,CAAC,CAAC;QAEnD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1B,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,oBAA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ent":["import {\n ViewChild, HostBinding, ElementRef, HostListener, Input, ContentChildren, QueryList,\n AfterContentInit, TemplateRef, ViewContainerRef, ContentChild, EventEmitter, Output, OnDestroy, Renderer2\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs/Subscription\";\nimport { DropdownService, SuiDropdownMenu } from \"../../dropdown/index\";\nimport { SearchService, LookupFn, FilterFn } from \"../../search/index\";\nimport { Util, ITemplateRefContext, HandledEvent, KeyCode, IFocusEvent } from \"../../../misc/util/index\";\nimport { ISelectLocaleValues, RecursivePartial, SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SuiSelectOption } from \"../components/select-option\";\nimport { SuiSelectSearch } from \"../directives/select-search\";\n\nexport interface IOptionContext extends ITemplateRefContext {\n query?:string;\n}\n\n// We use generic type T to specify the type of the options we are working with,\n// and U to specify the type of the property of the option used as the value.\nexport abstract class SuiSelectBase implements AfterContentInit, OnDestroy {\n public dropdownService:DropdownService;\n public searchService:SearchService;\n\n @ViewChild(SuiDropdownMenu)\n protected _menu:SuiDropdownMenu;\n\n // Keep track of all of the rendered select options. (Rendered by the user using *ngFor).\n @ContentChildren(SuiSelectOption, { descendants: true })\n protected _renderedOptions:QueryList>;\n\n // Keep track of all of the subscriptions to the selected events on the rendered options.\n private _renderedSubscriptions:Subscription[];\n\n // Sets the Semantic UI classes on the host element.\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.dropdown\")\n private _selectClasses:boolean;\n\n @HostBinding(\"class.active\")\n public get isActive():boolean {\n return this.dropdownService.isOpen;\n }\n\n @HostBinding(\"class.visible\")\n public get isVisible():boolean {\n return this._menu.isVisible;\n }\n\n @Input()\n public isSearchable:boolean;\n\n public isSearchExternal:boolean;\n\n @HostBinding(\"class.search\")\n private get _searchClass():boolean {\n return this.isSearchable && !this.isSearchExternal;\n }\n\n @HostBinding(\"class.loading\")\n public get isSearching():boolean {\n return this.searchService.isSearching;\n }\n\n @ViewChild(SuiSelectSearch)\n private _internalSearch?:SuiSelectSearch;\n\n @ContentChild(SuiSelectSearch)\n private _manualSearch?:SuiSelectSearch;\n\n public get searchInput():SuiSelectSearch | undefined {\n return this._manualSearch || this._internalSearch;\n }\n\n @Input(\"tabindex\")\n private _tabIndex?:number;\n\n @HostBinding(\"attr.tabindex\")\n public get tabIndex():number {\n if (this.isDisabled) {\n // If disabled, remove from tabindex.\n return -1;\n }\n if (this.dropdownService.isOpen && this.isSearchExternal) {\n // If open & in menu search, remove from tabindex (as input always autofocusses).\n return -1;\n }\n if (this._tabIndex != undefined) {\n // If custom tabindex, default to that.\n return this._tabIndex;\n }\n if (this._searchClass) {\n // If search input enabled, tab goes to input.\n return -1;\n }\n // Otherwise, return default of 0.\n return 0;\n }\n\n @HostBinding(\"class.disabled\")\n @Input()\n public get isDisabled():boolean {\n return this.dropdownService.isDisabled;\n }\n\n public set isDisabled(value:boolean) {\n this.dropdownService.isDisabled = !!value;\n }\n\n @Input()\n public set options(options:T[]) {\n if (options) {\n this.searchService.options = options;\n\n this.optionsUpdateHook();\n }\n }\n\n @Input()\n public set optionsFilter(filter:FilterFn | undefined) {\n if (filter) {\n this.searchService.optionsFilter = filter;\n\n this.optionsUpdateHook();\n }\n }\n\n @Input()\n public set optionsLookup(lookup:LookupFn | undefined) {\n if (lookup) {\n this.searchService.optionsLookup = lookup;\n\n this.optionsUpdateHook();\n }\n }\n\n public get filteredOptions():T[] {\n return this.searchService.results;\n }\n\n // Deprecated\n public get availableOptions():T[] {\n return this.filteredOptions;\n }\n\n public get query():string | undefined {\n return this.isSearchable ? this.searchService.query : undefined;\n }\n\n public set query(query:string | undefined) {\n if (query != undefined) {\n this.queryUpdateHook();\n this.updateQuery(query);\n // Update the rendered text as query has changed.\n this._renderedOptions.forEach(ro => this.initialiseRenderedOption(ro));\n\n if (this.searchInput) {\n this.searchInput.query = query;\n }\n }\n }\n\n @Input()\n public get labelField():string | undefined {\n return this.searchService.optionsField;\n }\n\n public set labelField(field:string | undefined) {\n this.searchService.optionsField = field;\n }\n\n public get labelGetter():(obj:T) => string {\n // Helper function to retrieve the label from an item.\n return (obj:T) => {\n const label = Util.Object.readValue(obj, this.labelField);\n if (label != undefined) {\n return label.toString();\n }\n return \"\";\n };\n }\n\n @Input()\n public valueField:string;\n\n public get valueGetter():(obj:T) => U {\n // Helper function to retrieve the value from an item.\n return (obj:T) => Util.Object.readValue(obj, this.valueField);\n }\n\n @Input()\n public optionTemplate:TemplateRef>;\n\n private _optionFormatter?:(o:T, q?:string) => string;\n\n public get configuredFormatter():(option:T) => string {\n if (this._optionFormatter) {\n return o => this._optionFormatter!(o, this.isSearchable ? this.query : undefined);\n } else if (this.searchService.optionsLookup) {\n return o => this.labelGetter(o);\n } else {\n return o => this.searchService.highlightMatches(this.labelGetter(o), this.query || \"\");\n }\n }\n\n @Input()\n public set optionFormatter(formatter:((option:T, query?:string) => string) | undefined) {\n this._optionFormatter = formatter;\n }\n\n private _localeValues:ISelectLocaleValues;\n public localeOverrides:RecursivePartial;\n\n public get localeValues():ISelectLocaleValues {\n return this._localizationService.override<\"select\">(this._localeValues, this.localeOverrides);\n }\n\n @Input()\n public icon:string;\n\n @Input()\n public transition:string;\n\n @Input()\n public transitionDuration:number;\n\n @Output(\"touched\")\n public onTouched:EventEmitter;\n\n private _documentKeyDownListener:() => void;\n\n constructor(private _element:ElementRef, renderer:Renderer2, protected _localizationService:SuiLocalizationService) {\n this.dropdownService = new DropdownService();\n // We do want an empty query to return all results.\n this.searchService = new SearchService(true);\n\n this.isSearchable = false;\n\n this.onLocaleUpdate();\n this._localizationService.onLanguageUpdate.subscribe(() => this.onLocaleUpdate());\n this._renderedSubscriptions = [];\n\n this.icon = \"dropdown\";\n this.transition = \"slide down\";\n this.transitionDuration = 200;\n\n this.onTouched = new EventEmitter();\n this._documentKeyDownListener = renderer.listen(\"document\", \"keydown\", (e:KeyboardEvent) => this.onDocumentKeyDown(e));\n\n this._selectClasses = true;\n }\n\n public ngAfterContentInit():void {\n this._menu.service = this.dropdownService;\n // We manually specify the menu items to the menu because the @ContentChildren doesn't pick up our dynamically rendered items.\n this._menu.items = this._renderedOptions;\n\n if (this._manualSearch) {\n this.isSearchable = true;\n this.isSearchExternal = true;\n }\n\n if (this.searchInput) {\n this.searchInput.onQueryUpdated.subscribe((q:string) => this.query = q);\n this.searchInput.onQueryKeyDown.subscribe((e:KeyboardEvent) => this.onQueryInputKeydown(e));\n }\n\n // We must call this immediately as changes doesn't fire when you subscribe.\n this.onAvailableOptionsRendered();\n this._renderedOptions.changes.subscribe(() => this.onAvailableOptionsRendered());\n }\n\n private onLocaleUpdate():void {\n this._localeValues = this._localizationService.get().select;\n }\n\n // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass.\n protected optionsUpdateHook():void {}\n\n // Hook is here since Typescript doesn't yet support overriding getters & setters while still calling the superclass.\n protected queryUpdateHook():void {}\n\n protected updateQuery(query:string):void {\n // Update the query then open the dropdown, as after keyboard input it should always be open.\n this.searchService.updateQuery(query, () =>\n this.dropdownService.setOpenState(true));\n }\n\n protected resetQuery(delayed:boolean = true):void {\n // The search delay is set to the transition duration to ensure results\n // aren't rendered as the select closes as that causes a sudden flash.\n if (delayed) {\n this.searchService.searchDelay = this._menu.menuTransitionDuration;\n this.searchService.updateQueryDelayed(\"\");\n } else {\n this.searchService.updateQuery(\"\");\n }\n\n if (this.searchInput) {\n this.searchInput.query = \"\";\n }\n }\n\n protected onAvailableOptionsRendered():void {\n // Unsubscribe from all previous subscriptions to avoid memory leaks on large selects.\n this._renderedSubscriptions.forEach(rs => rs.unsubscribe());\n this._renderedSubscriptions = [];\n\n this._renderedOptions.forEach(ro => {\n // Slightly delay initialisation to avoid change after checked errors. TODO - look into avoiding this!\n setTimeout(() => this.initialiseRenderedOption(ro));\n\n this._renderedSubscriptions.push(ro.onSelected.subscribe(() => this.selectOption(ro.value)));\n });\n\n // If no options have been provided, autogenerate them from the rendered ones.\n if (this.searchService.options.length === 0 && !this.searchService.optionsLookup) {\n this.options = this._renderedOptions.map(ro => ro.value);\n }\n }\n\n protected initialiseRenderedOption(option:SuiSelectOption):void {\n option.usesTemplate = !!this.optionTemplate;\n option.formatter = this.configuredFormatter;\n\n if (option.usesTemplate) {\n this.drawTemplate(option.templateSibling, option.value);\n }\n\n option.changeDetector.markForCheck();\n }\n\n public abstract selectOption(option:T):void;\n\n protected findOption(options:T[], value:U):T | undefined {\n // Tries to find an option in options array\n return options.find(o => value === this.valueGetter(o));\n }\n\n public onCaretClick(e:HandledEvent):void {\n if (!e.eventHandled) {\n e.eventHandled = true;\n\n if (!this.dropdownService.isAnimating) {\n this.dropdownService.setOpenState(!this.dropdownService.isOpen);\n\n this.focus();\n }\n }\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(e:HandledEvent):void {\n if (!e.eventHandled && !this.dropdownService.isAnimating) {\n e.eventHandled = true;\n\n // If the dropdown is searchable, clicking should keep it open, otherwise we toggle the open state.\n this.dropdownService.setOpenState(this.isSearchable ? true : !this.dropdownService.isOpen);\n\n // Immediately focus the search input whenever clicking on the select.\n this.focus();\n }\n }\n\n @HostListener(\"focusin\")\n private onFocusIn():void {\n if (!this.dropdownService.isOpen && !this.dropdownService.isAnimating) {\n this.dropdownService.setOpenState(true);\n\n this.focus();\n }\n }\n\n @HostListener(\"focusout\", [\"$event\"])\n private onFocusOut(e:IFocusEvent):void {\n if (!this._element.nativeElement.contains(e.relatedTarget)) {\n this.dropdownService.setOpenState(false);\n this.onTouched.emit();\n }\n }\n\n @HostListener(\"keypress\", [\"$event\"])\n public onKeyPress(e:KeyboardEvent):void {\n if (e.keyCode === KeyCode.Enter) {\n // Enables support for focussing and opening with the keyboard alone.\n // Using directly because Renderer2 doesn't have invokeElementMethod method anymore.\n this._element.nativeElement.click();\n }\n }\n\n public onDocumentKeyDown(e:KeyboardEvent):void {\n if (this._element.nativeElement.contains(e.target) &&\n !this.dropdownService.isOpen &&\n e.keyCode === KeyCode.Down) {\n\n // Enables support for focussing and opening with the keyboard alone.\n // Using directly because Renderer2 doesn't have invokeElementMethod method anymore.\n this._element.nativeElement.click();\n\n e.preventDefault();\n }\n }\n\n public onQueryInputKeydown(event:KeyboardEvent):void {}\n\n protected focus():void {\n if (this.isSearchable && this.searchInput) {\n // Focusses the search input only when searchable.\n // Using directly because Renderer2 doesn't have invokeElementMethod method anymore.\n this.searchInput.focus();\n } else {\n this._element.nativeElement.focus();\n }\n }\n\n // Helper that draws the provided template beside the provided ViewContainerRef.\n protected drawTemplate(siblingRef:ViewContainerRef, value:T):void {\n siblingRef.clear();\n // Use of `$implicit` means use of syntax is supported.\n siblingRef.createEmbeddedView(this.optionTemplate, {\n $implicit: value,\n query: this.query\n });\n }\n\n public ngOnDestroy():void {\n this._renderedSubscriptions.forEach(s => s.unsubscribe());\n this._documentKeyDownListener();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/classes/select-base.metadata.json b/dist/modules/select/classes/select-base.metadata.json deleted file mode 100644 index c094a5ffc..000000000 --- a/dist/modules/select/classes/select-base.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"IOptionContext":{"__symbolic":"interface"},"SuiSelectBase":{"__symbolic":"class","arity":2,"members":{"_menu":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":22,"character":5},"arguments":[{"__symbolic":"reference","module":"../../dropdown/index","name":"SuiDropdownMenu","line":22,"character":15}]}]}],"_renderedOptions":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":26,"character":5},"arguments":[{"__symbolic":"reference","module":"../components/select-option","name":"SuiSelectOption","line":26,"character":21},{"descendants":true}]}]}],"_selectClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":33,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":34,"character":5},"arguments":["class.dropdown"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":37,"character":5},"arguments":["class.active"]}]}],"isVisible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":42,"character":5},"arguments":["class.visible"]}]}],"isSearchable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":5}}]}],"_searchClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":52,"character":5},"arguments":["class.search"]}]}],"isSearching":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":57,"character":5},"arguments":["class.loading"]}]}],"_internalSearch":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":62,"character":5},"arguments":[{"__symbolic":"reference","module":"../directives/select-search","name":"SuiSelectSearch","line":62,"character":15}]}]}],"_manualSearch":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":65,"character":5},"arguments":[{"__symbolic":"reference","module":"../directives/select-search","name":"SuiSelectSearch","line":65,"character":18}]}]}],"_tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":72,"character":5},"arguments":["tabindex"]}]}],"tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":75,"character":5},"arguments":["attr.tabindex"]}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":97,"character":5},"arguments":["class.disabled"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":98,"character":5}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":107,"character":5}}]}],"optionsFilter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":116,"character":5}}]}],"optionsLookup":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":125,"character":5}}]}],"labelField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":160,"character":5}}]}],"valueField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":180,"character":5}}]}],"optionTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":188,"character":5}}]}],"optionFormatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":203,"character":5}}]}],"icon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":215,"character":5}}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":218,"character":5}}]}],"transitionDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":221,"character":5}}]}],"onTouched":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":224,"character":5},"arguments":["touched"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":229,"character":33},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":229,"character":54},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":229,"character":96}]}],"ngAfterContentInit":[{"__symbolic":"method"}],"onLocaleUpdate":[{"__symbolic":"method"}],"optionsUpdateHook":[{"__symbolic":"method"}],"queryUpdateHook":[{"__symbolic":"method"}],"updateQuery":[{"__symbolic":"method"}],"resetQuery":[{"__symbolic":"method"}],"onAvailableOptionsRendered":[{"__symbolic":"method"}],"initialiseRenderedOption":[{"__symbolic":"method"}],"selectOption":[{"__symbolic":"method"}],"findOption":[{"__symbolic":"method"}],"onCaretClick":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":349,"character":5},"arguments":["click",["$event"]]}]}],"onFocusIn":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":362,"character":5},"arguments":["focusin"]}]}],"onFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":371,"character":5},"arguments":["focusout",["$event"]]}]}],"onKeyPress":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":379,"character":5},"arguments":["keypress",["$event"]]}]}],"onDocumentKeyDown":[{"__symbolic":"method"}],"onQueryInputKeydown":[{"__symbolic":"method"}],"focus":[{"__symbolic":"method"}],"drawTemplate":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/components/multi-select-label.d.ts b/dist/modules/select/components/multi-select-label.d.ts deleted file mode 100644 index d8d86303e..000000000 --- a/dist/modules/select/components/multi-select-label.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { EventEmitter, ViewContainerRef, Renderer2, ElementRef, ChangeDetectorRef, TemplateRef } from "@angular/core"; -import { SuiTransition } from "../../transition/index"; -import { HandledEvent, SuiComponentFactory } from "../../../misc/util/index"; -import { IOptionContext } from "../classes/select-base"; -export declare class SuiMultiSelectLabel extends SuiTransition { - componentFactory: SuiComponentFactory; - private _labelClasses; - private _transitionController; - value: T; - query?: string; - onDeselected: EventEmitter; - formatter: (obj: T) => string; - private _template?; - template: TemplateRef> | undefined; - templateSibling: ViewContainerRef; - constructor(renderer: Renderer2, element: ElementRef, changeDetector: ChangeDetectorRef, componentFactory: SuiComponentFactory); - deselectOption(e: HandledEvent): void; - onClick(e: HandledEvent): void; -} diff --git a/dist/modules/select/components/multi-select-label.js b/dist/modules/select/components/multi-select-label.js deleted file mode 100644 index e94e63d7a..000000000 --- a/dist/modules/select/components/multi-select-label.js +++ /dev/null @@ -1,82 +0,0 @@ -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 __()); - }; -})(); -import { Component, Input, HostBinding, HostListener, EventEmitter, ViewContainerRef, ViewChild, Renderer2, ElementRef, Output, ChangeDetectorRef, TemplateRef } from "@angular/core"; -import { SuiTransition, TransitionController, Transition, TransitionDirection } from "../../transition/index"; -import { HandledEvent, SuiComponentFactory } from "../../../misc/util/index"; -// See https://github.com/Microsoft/TypeScript/issues/13449. -var templateRef = TemplateRef; -var SuiMultiSelectLabel = /** @class */ (function (_super) { - __extends(SuiMultiSelectLabel, _super); - function SuiMultiSelectLabel(renderer, element, changeDetector, componentFactory) { - var _this = _super.call(this, renderer, element, changeDetector) || this; - _this.componentFactory = componentFactory; - // Initialise transition functionality. - // Initialise transition functionality. - _this._transitionController = new TransitionController(false, "inline-block"); - _this.setTransitionController(_this._transitionController); - _this.onDeselected = new EventEmitter(); - _this._labelClasses = true; - _this._transitionController.animate(new Transition("scale", 100, TransitionDirection.In)); - return _this; - } - Object.defineProperty(SuiMultiSelectLabel.prototype, "template", { - get: function () { - return this._template; - }, - set: function (template) { - this._template = template; - if (this.template) { - this.componentFactory.createView(this.templateSibling, this.template, { - $implicit: this.value, - query: this.query - }); - } - }, - enumerable: true, - configurable: true - }); - SuiMultiSelectLabel.prototype.deselectOption = function (e) { - var _this = this; - e.eventHandled = true; - this._transitionController.animate(new Transition("scale", 100, TransitionDirection.Out, function () { - return _this.onDeselected.emit(_this.value); - })); - }; - SuiMultiSelectLabel.prototype.onClick = function (e) { - e.eventHandled = true; - }; - SuiMultiSelectLabel.decorators = [ - { type: Component, args: [{ - selector: "sui-multi-select-label", - template: "\n\n\n\n" - },] }, - ]; - /** @nocollapse */ - SuiMultiSelectLabel.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - { type: ChangeDetectorRef, }, - { type: SuiComponentFactory, }, - ]; }; - SuiMultiSelectLabel.propDecorators = { - "_labelClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.label",] },], - "value": [{ type: Input },], - "query": [{ type: Input },], - "onDeselected": [{ type: Output, args: ["deselected",] },], - "formatter": [{ type: Input },], - "template": [{ type: Input },], - "templateSibling": [{ type: ViewChild, args: ["templateSibling", { read: ViewContainerRef },] },], - "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], - }; - return SuiMultiSelectLabel; -}(SuiTransition)); -export { SuiMultiSelectLabel }; -//# sourceMappingURL=multi-select-label.js.map \ No newline at end of file diff --git a/dist/modules/select/components/multi-select-label.js.map b/dist/modules/select/components/multi-select-label.js.map deleted file mode 100644 index 017482be3..000000000 --- a/dist/modules/select/components/multi-select-label.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"multi-select-label.js","sourceRoot":"","sources":["../../../../src/modules/select/components/multi-select-label.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAC3E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K;iBACpB,CAAC,CAAC;aACN;SACJ;;;;IAwBM,4CAAc,GAArB,UAAsB,CAAc;QAApC,iBAMC;QALG,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC;QAEtB,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAC9B,IAAI,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,mBAAmB,CAAC,GAAG,EAAE;YAClD,OAAA,KAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAI,CAAC,KAAK,CAAC;QAAlC,CAAkC,CAAC,CAAC,CAAC;KAChD;IAGM,qCAAO,aAAC,CAAc;QACzB,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC;;;gBA9E7B,SAAS,SAAC;oBACP,QAAQ,EAAE,wBAAwB;oBAClC,QAAQ,EAAE,0KAIb;iBACA;;;;gBAhBc,SAAS;gBAAE,UAAU;gBAAU,iBAAiB;gBAGxC,mBAAmB;;;kCAiBrC,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,aAAa;0BAKzB,KAAK;0BAGL,KAAK;iCAGL,MAAM,SAAC,YAAY;8BAGnB,KAAK;6BAKL,KAAK;oCAgBL,SAAS,SAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;4BA6BvD,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;8BAvFrC;EAmB4C,aAAa;SAA5C,mBAAmB","sourcesContent":["import {\n Component, Input, HostBinding, HostListener, EventEmitter, ViewContainerRef,\n ViewChild, Renderer2, ElementRef, Output, ChangeDetectorRef, TemplateRef\n} from \"@angular/core\";\nimport { SuiTransition, TransitionController, Transition, TransitionDirection } from \"../../transition/index\";\nimport { HandledEvent, SuiComponentFactory } from \"../../../misc/util/index\";\nimport { IOptionContext } from \"../classes/select-base\";\n\n// See https://github.com/Microsoft/TypeScript/issues/13449.\nconst templateRef = TemplateRef;\n\n@Component({\n selector: \"sui-multi-select-label\",\n template: `\n\n\n\n`\n})\nexport class SuiMultiSelectLabel extends SuiTransition {\n // Sets the Semantic UI classes on the host element.\n // Doing it on the host enables use in menus etc.\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.label\")\n private _labelClasses:boolean;\n\n private _transitionController:TransitionController;\n\n @Input()\n public value:T;\n\n @Input()\n public query?:string;\n\n @Output(\"deselected\")\n public onDeselected:EventEmitter;\n\n @Input()\n public formatter:(obj:T) => string;\n\n private _template?:TemplateRef>;\n\n @Input()\n public get template():TemplateRef> | undefined {\n return this._template;\n }\n\n public set template(template:TemplateRef> | undefined) {\n this._template = template;\n if (this.template) {\n this.componentFactory.createView(this.templateSibling, this.template, {\n $implicit: this.value,\n query: this.query\n });\n }\n }\n\n // Placeholder to draw template beside.\n @ViewChild(\"templateSibling\", { read: ViewContainerRef })\n public templateSibling:ViewContainerRef;\n\n constructor(renderer:Renderer2,\n element:ElementRef,\n changeDetector:ChangeDetectorRef,\n public componentFactory:SuiComponentFactory) {\n\n super(renderer, element, changeDetector);\n\n // Initialise transition functionality.\n this._transitionController = new TransitionController(false, \"inline-block\");\n this.setTransitionController(this._transitionController);\n\n this.onDeselected = new EventEmitter();\n\n this._labelClasses = true;\n\n this._transitionController.animate(new Transition(\"scale\", 100, TransitionDirection.In));\n }\n\n public deselectOption(e:HandledEvent):void {\n e.eventHandled = true;\n\n this._transitionController.animate(\n new Transition(\"scale\", 100, TransitionDirection.Out, () =>\n this.onDeselected.emit(this.value)));\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(e:HandledEvent):void {\n e.eventHandled = true;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/components/multi-select-label.metadata.json b/dist/modules/select/components/multi-select-label.metadata.json deleted file mode 100644 index 281eb00f4..000000000 --- a/dist/modules/select/components/multi-select-label.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiMultiSelectLabel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../transition/index","name":"SuiTransition","line":19,"character":44},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":11,"character":1},"arguments":[{"selector":"sui-multi-select-label","template":"\n\n\n\n"}]}],"members":{"_labelClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":22,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":23,"character":5},"arguments":["class.label"]}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":28,"character":5}}]}],"query":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":5}}]}],"onDeselected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":34,"character":5},"arguments":["deselected"]}]}],"formatter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":5}}]}],"template":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":5}}]}],"templateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":58,"character":5},"arguments":["templateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":58,"character":42}}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":61,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":62,"character":24},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":63,"character":31},{"__symbolic":"reference","module":"../../../misc/util/index","name":"SuiComponentFactory","line":64,"character":40}]}],"deselectOption":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":87,"character":5},"arguments":["click",["$event"]]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/components/multi-select.d.ts b/dist/modules/select/components/multi-select.d.ts deleted file mode 100644 index aac8976a7..000000000 --- a/dist/modules/select/components/multi-select.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ElementRef, EventEmitter, Renderer2 } from "@angular/core"; -import { ICustomValueAccessorHost, CustomValueAccessor } from "../../../misc/util/index"; -import { SuiLocalizationService } from "../../../behaviors/localization/index"; -import { SuiSelectBase } from "../classes/select-base"; -import { SuiSelectOption } from "./select-option"; -export declare class SuiMultiSelect extends SuiSelectBase implements ICustomValueAccessorHost { - selectedOptions: T[]; - private _writtenOptions?; - selectedOptionsChange: EventEmitter; - readonly filteredOptions: T[]; - readonly availableOptions: T[]; - private _hasLabels; - hasLabels: boolean; - private _placeholder; - placeholder: string; - maxSelected: number; - readonly maxSelectedReached: boolean; - readonly maxSelectedMessage: string; - readonly selectedMessage: string; - private _multiSelectClasses; - constructor(element: ElementRef, renderer: Renderer2, localizationService: SuiLocalizationService); - protected optionsUpdateHook(): void; - protected initialiseRenderedOption(option: SuiSelectOption): void; - selectOption(option: T): void; - writeValue(values: U[]): void; - deselectOption(option: T): void; - onQueryInputKeydown(event: KeyboardEvent): void; -} -export declare class SuiMultiSelectValueAccessor extends CustomValueAccessor> { - constructor(host: SuiMultiSelect); -} diff --git a/dist/modules/select/components/multi-select.js b/dist/modules/select/components/multi-select.js deleted file mode 100644 index 4123e2714..000000000 --- a/dist/modules/select/components/multi-select.js +++ /dev/null @@ -1,225 +0,0 @@ -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 __()); - }; -})(); -import { Component, HostBinding, ElementRef, EventEmitter, Output, Input, Directive, Renderer2 } from "@angular/core"; -import { KeyCode, customValueAccessorFactory, CustomValueAccessor } from "../../../misc/util/index"; -import { SuiLocalizationService } from "../../../behaviors/localization/index"; -import { SuiSelectBase } from "../classes/select-base"; -var SuiMultiSelect = /** @class */ (function (_super) { - __extends(SuiMultiSelect, _super); - function SuiMultiSelect(element, renderer, localizationService) { - var _this = _super.call(this, element, renderer, localizationService) || this; - _this.selectedOptions = []; - _this.selectedOptionsChange = new EventEmitter(); - _this.hasLabels = true; - _this._multiSelectClasses = true; - return _this; - } - Object.defineProperty(SuiMultiSelect.prototype, "filteredOptions", { - get: function () { - var _this = this; - if (this.maxSelectedReached) { - // If we have reached the maximum number of selections, then empty the results completely. - return []; - } - var searchResults = this.searchService.results; - if (!this.hasLabels) { - return searchResults; - } - else { - // Returns the search results \ selected options. - return searchResults - .filter(function (r) { return _this.selectedOptions.find(function (o) { return r === o; }) == undefined; }); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "availableOptions", { - get: function () { - return this.filteredOptions; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "hasLabels", { - get: function () { - return this._hasLabels; - }, - set: function (hasLabels) { - this._hasLabels = hasLabels; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "placeholder", { - get: function () { - return this._placeholder || this.localeValues.multi.placeholder; - }, - set: function (placeholder) { - this._placeholder = placeholder; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "maxSelectedReached", { - get: function () { - if (this.maxSelected == undefined) { - // If there is no maximum then we can immediately return. - return false; - } - return this.selectedOptions.length === this.maxSelected; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "maxSelectedMessage", { - get: function () { - return this._localizationService.interpolate(this.localeValues.multi.maxSelectedMessage, [["max", this.maxSelected.toString()]]); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiMultiSelect.prototype, "selectedMessage", { - get: function () { - return this._localizationService.interpolate(this.localeValues.multi.selectedMessage, [["count", this.selectedOptions.length.toString()]]); - }, - enumerable: true, - configurable: true - }); - SuiMultiSelect.prototype.optionsUpdateHook = function () { - var _this = this; - if (!this._writtenOptions && this.selectedOptions.length > 0) { - // We need to check the options still exist. - this.writeValue(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); - } - if (this._writtenOptions && this.searchService.options.length > 0) { - // If there were values written by ngModel before the options had been loaded, this runs to fix it. - this.selectedOptions = this._writtenOptions - .map(function (v) { return _this.findOption(_this.searchService.options, v); }) - .filter(function (v) { return v != undefined; }); - if (this.selectedOptions.length === this._writtenOptions.length) { - this._writtenOptions = undefined; - } - } - }; - SuiMultiSelect.prototype.initialiseRenderedOption = function (option) { - _super.prototype.initialiseRenderedOption.call(this, option); - // Boldens the item so it appears selected in the dropdown. - option.isActive = !this.hasLabels && this.selectedOptions.indexOf(option.value) !== -1; - }; - SuiMultiSelect.prototype.selectOption = function (option) { - var _this = this; - if (this.selectedOptions.indexOf(option) !== -1) { - this.deselectOption(option); - return; - } - this.selectedOptions.push(option); - this.selectedOptionsChange.emit(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); - this.resetQuery(false); - // Automatically refocus the search input for better keyboard accessibility. - this.focus(); - if (!this.hasLabels) { - this.onAvailableOptionsRendered(); - } - }; - SuiMultiSelect.prototype.writeValue = function (values) { - var _this = this; - if (values instanceof Array) { - if (this.searchService.options.length > 0) { - // If the options have already been loaded, we can immediately match the ngModel values to options. - this.selectedOptions = values - .map(function (v) { return _this.findOption(_this.searchService.options, v); }) - .filter(function (v) { return v != undefined; }); - } - if (values.length > 0 && this.selectedOptions.length === 0) { - if (this.valueField && this.searchService.hasItemLookup) { - // If the search service has a selected lookup function, make use of that to load the initial values. - this.searchService - .initialLookup(values) - .then(function (items) { return _this.selectedOptions = items; }); - } - else { - // Otherwise, cache the written value for when options are set. - this._writtenOptions = values; - } - } - if (values.length === 0) { - this.selectedOptions = []; - } - } - else { - this.selectedOptions = []; - } - }; - SuiMultiSelect.prototype.deselectOption = function (option) { - var _this = this; - // Update selected options to the previously selected options \ {option}. - this.selectedOptions = this.selectedOptions.filter(function (so) { return so !== option; }); - this.selectedOptionsChange.emit(this.selectedOptions.map(function (o) { return _this.valueGetter(o); })); - // Automatically refocus the search input for better keyboard accessibility. - this.focus(); - if (!this.hasLabels) { - this.onAvailableOptionsRendered(); - } - }; - SuiMultiSelect.prototype.onQueryInputKeydown = function (event) { - if (event.keyCode === KeyCode.Backspace && this.query === "" && this.selectedOptions.length > 0) { - // Deselect the rightmost option when the user presses backspace in the search input. - this.deselectOption(this.selectedOptions[this.selectedOptions.length - 1]); - } - }; - SuiMultiSelect.decorators = [ - { type: Component, args: [{ - selector: "sui-multi-select", - template: "\n\n\n\n\n\n \n\n\n\n\n\n\n
\n \n \n {{ placeholder }}\n \n \n {{ selectedMessage }}\n
\n\n\n
\n\n \n \n
{{ localeValues.noResultsMessage }}
\n
{{ maxSelectedMessage }}
\n
\n
\n", - styles: ["\n:host input.search {\n width: 12em !important;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiMultiSelect.ctorParameters = function () { return [ - { type: ElementRef, }, - { type: Renderer2, }, - { type: SuiLocalizationService, }, - ]; }; - SuiMultiSelect.propDecorators = { - "selectedOptionsChange": [{ type: Output },], - "hasLabels": [{ type: Input },], - "placeholder": [{ type: Input },], - "maxSelected": [{ type: Input },], - "_multiSelectClasses": [{ type: HostBinding, args: ["class.multiple",] },], - }; - return SuiMultiSelect; -}(SuiSelectBase)); -export { SuiMultiSelect }; -// Value accessor directive for the select to support ngModel. -var SuiMultiSelectValueAccessor = /** @class */ (function (_super) { - __extends(SuiMultiSelectValueAccessor, _super); - function SuiMultiSelectValueAccessor(host) { - return _super.call(this, host) || this; - } - SuiMultiSelectValueAccessor.decorators = [ - { type: Directive, args: [{ - selector: "sui-multi-select", - host: { - "(selectedOptionsChange)": "onChange($event)", - "(touched)": "onTouched()" - }, - providers: [customValueAccessorFactory(SuiMultiSelectValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiMultiSelectValueAccessor.ctorParameters = function () { return [ - { type: SuiMultiSelect, }, - ]; }; - return SuiMultiSelectValueAccessor; -}(CustomValueAccessor)); -export { SuiMultiSelectValueAccessor }; -//# sourceMappingURL=multi-select.js.map \ No newline at end of file diff --git a/dist/modules/select/components/multi-select.js.map b/dist/modules/select/components/multi-select.js.map deleted file mode 100644 index 63b7ebf97..000000000 --- a/dist/modules/select/components/multi-select.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"multi-select.js","sourceRoot":"","sources":["../../../../src/modules/select/components/multi-select.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtH,OAAO,EAA4B,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC9H,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;;IAwDb,kCAAmB;IA6EzD,wBAAY,OAAkB,EAAE,QAAkB,EAAE,mBAA0C;QAA9F,YACI,kBAAM,OAAO,EAAE,QAAQ,EAAE,mBAAmB,CAAC,SAOhD;QALG,KAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,KAAI,CAAC,qBAAqB,GAAG,IAAI,YAAY,EAAO,CAAC;QAErD,KAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,KAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;;KACnC;IA7ED,sBAAW,2CAAe;aAA1B;YAAA,iBAeC;YAdG,EAAE,CAAC,C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;QAEb,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;YAClB,IAAI,CAAC,0BAA0B,EAAE,CAAC;SACrC;KACJ;IAEM,4CAAmB,GAA1B,UAA2B,KAAmB;QAC1C,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,EAAE,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;;YAE9F,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;SAC9E;KACJ;;gBAtOJ,SAAS,SAAC;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,QAAQ,EAAE,slDA4Cb;oBACG,MAAM,EAAE,CAAC,0DAIZ,CAAC;iBACD;;;;gBA1DgC,UAAU;gBAA0C,SAAS;gBAErF,sBAAsB;;;0CA8D1B,MAAM;8BA0BN,KAAK;gCAWL,KAAK;gCASL,KAAK;wCAuBL,WAAW,SAAC,gBAAgB;;yBArIjC;EA2D0C,aAAa;SAA1C,cAAc;;;IA6L4B,+CAA8C;IACjG,qCAAY,IAAyB;eACjC,kBAAM,IAAI,CAAC;KACd;;gBAXJ,SAAS,SAAC;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE;wBACF,yBAAyB,EAAE,kBAAkB;wBAC7C,WAAW,EAAE,aAAa;qBAC7B;oBACD,SAAS,EAAE,CAAC,0BAA0B,CAAC,2BAA2B,CAAC,CAAC;iBACvE;;;;gBA5LY,cAAc;;sCA3D3B;EAwPuD,mBAAmB;SAA7D,2BAA2B","sourcesContent":["import { Component, HostBinding, ElementRef, EventEmitter, Output, Input, Directive, Renderer2 } from \"@angular/core\";\nimport { ICustomValueAccessorHost, KeyCode, customValueAccessorFactory, CustomValueAccessor } from \"../../../misc/util/index\";\nimport { SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SuiSelectBase } from \"../classes/select-base\";\nimport { SuiSelectOption } from \"./select-option\";\n\n@Component({\n selector: \"sui-multi-select\",\n template: `\n\n\n\n\n\n \n\n\n\n\n\n\n
\n \n \n {{ placeholder }}\n \n \n {{ selectedMessage }}\n
\n\n\n
\n\n \n \n
{{ localeValues.noResultsMessage }}
\n
{{ maxSelectedMessage }}
\n
\n
\n`,\n styles: [`\n:host input.search {\n width: 12em !important;\n}\n`]\n})\nexport class SuiMultiSelect extends SuiSelectBase implements ICustomValueAccessorHost {\n public selectedOptions:T[];\n // Stores the values written by ngModel before it can be matched to an option from `options`.\n private _writtenOptions?:U[];\n\n @Output()\n public selectedOptionsChange:EventEmitter;\n\n public get filteredOptions():T[] {\n if (this.maxSelectedReached) {\n // If we have reached the maximum number of selections, then empty the results completely.\n return [];\n }\n\n const searchResults:T[] = this.searchService.results;\n\n if (!this.hasLabels) {\n return searchResults;\n } else {\n // Returns the search results \\ selected options.\n return searchResults\n .filter(r => this.selectedOptions.find(o => r === o) == undefined);\n }\n }\n\n public get availableOptions():T[] {\n return this.filteredOptions;\n }\n\n private _hasLabels:boolean;\n\n @Input()\n public get hasLabels():boolean {\n return this._hasLabels;\n }\n\n public set hasLabels(hasLabels:boolean) {\n this._hasLabels = hasLabels;\n }\n\n private _placeholder:string;\n\n @Input()\n public get placeholder():string {\n return this._placeholder || this.localeValues.multi.placeholder;\n }\n\n public set placeholder(placeholder:string) {\n this._placeholder = placeholder;\n }\n\n @Input()\n public maxSelected:number;\n\n public get maxSelectedReached():boolean {\n if (this.maxSelected == undefined) {\n // If there is no maximum then we can immediately return.\n return false;\n }\n return this.selectedOptions.length === this.maxSelected;\n }\n\n public get maxSelectedMessage():string {\n return this._localizationService.interpolate(\n this.localeValues.multi.maxSelectedMessage,\n [[\"max\", this.maxSelected.toString()]]);\n }\n\n public get selectedMessage():string {\n return this._localizationService.interpolate(\n this.localeValues.multi.selectedMessage,\n [[\"count\", this.selectedOptions.length.toString()]]);\n }\n\n @HostBinding(\"class.multiple\")\n private _multiSelectClasses:boolean;\n\n constructor(element:ElementRef, renderer:Renderer2, localizationService:SuiLocalizationService) {\n super(element, renderer, localizationService);\n\n this.selectedOptions = [];\n this.selectedOptionsChange = new EventEmitter();\n\n this.hasLabels = true;\n this._multiSelectClasses = true;\n }\n\n protected optionsUpdateHook():void {\n if (!this._writtenOptions && this.selectedOptions.length > 0) {\n // We need to check the options still exist.\n this.writeValue(this.selectedOptions.map(o => this.valueGetter(o)));\n }\n\n if (this._writtenOptions && this.searchService.options.length > 0) {\n // If there were values written by ngModel before the options had been loaded, this runs to fix it.\n this.selectedOptions = this._writtenOptions\n // non-null assertion added here because Typescript doesn't recognise the non-null filter.\n .map(v => this.findOption(this.searchService.options, v)!)\n .filter(v => v != undefined);\n\n if (this.selectedOptions.length === this._writtenOptions.length) {\n this._writtenOptions = undefined;\n }\n }\n }\n\n protected initialiseRenderedOption(option:SuiSelectOption):void {\n super.initialiseRenderedOption(option);\n\n // Boldens the item so it appears selected in the dropdown.\n option.isActive = !this.hasLabels && this.selectedOptions.indexOf(option.value) !== -1;\n }\n\n public selectOption(option:T):void {\n if (this.selectedOptions.indexOf(option) !== -1) {\n this.deselectOption(option);\n return;\n }\n this.selectedOptions.push(option);\n this.selectedOptionsChange.emit(this.selectedOptions.map(o => this.valueGetter(o)));\n\n this.resetQuery(false);\n\n // Automatically refocus the search input for better keyboard accessibility.\n this.focus();\n\n if (!this.hasLabels) {\n this.onAvailableOptionsRendered();\n }\n }\n\n public writeValue(values:U[]):void {\n if (values instanceof Array) {\n if (this.searchService.options.length > 0) {\n // If the options have already been loaded, we can immediately match the ngModel values to options.\n this.selectedOptions = values\n // non-null assertion added here because Typescript doesn't recognise the non-null filter.\n .map(v => this.findOption(this.searchService.options, v)!)\n .filter(v => v != undefined);\n }\n if (values.length > 0 && this.selectedOptions.length === 0) {\n if (this.valueField && this.searchService.hasItemLookup) {\n // If the search service has a selected lookup function, make use of that to load the initial values.\n this.searchService\n .initialLookup(values)\n .then(items => this.selectedOptions = items);\n } else {\n // Otherwise, cache the written value for when options are set.\n this._writtenOptions = values;\n }\n }\n if (values.length === 0) {\n this.selectedOptions = [];\n }\n } else {\n this.selectedOptions = [];\n }\n }\n\n public deselectOption(option:T):void {\n // Update selected options to the previously selected options \\ {option}.\n this.selectedOptions = this.selectedOptions.filter(so => so !== option);\n this.selectedOptionsChange.emit(this.selectedOptions.map(o => this.valueGetter(o)));\n\n // Automatically refocus the search input for better keyboard accessibility.\n this.focus();\n\n if (!this.hasLabels) {\n this.onAvailableOptionsRendered();\n }\n }\n\n public onQueryInputKeydown(event:KeyboardEvent):void {\n if (event.keyCode === KeyCode.Backspace && this.query === \"\" && this.selectedOptions.length > 0) {\n // Deselect the rightmost option when the user presses backspace in the search input.\n this.deselectOption(this.selectedOptions[this.selectedOptions.length - 1]);\n }\n }\n}\n\n// Value accessor directive for the select to support ngModel.\n@Directive({\n selector: \"sui-multi-select\",\n host: {\n \"(selectedOptionsChange)\": \"onChange($event)\",\n \"(touched)\": \"onTouched()\"\n },\n providers: [customValueAccessorFactory(SuiMultiSelectValueAccessor)]\n})\nexport class SuiMultiSelectValueAccessor extends CustomValueAccessor> {\n constructor(host:SuiMultiSelect) {\n super(host);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/components/multi-select.metadata.json b/dist/modules/select/components/multi-select.metadata.json deleted file mode 100644 index 4c1b04217..000000000 --- a/dist/modules/select/components/multi-select.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiMultiSelect":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../classes/select-base","name":"SuiSelectBase","line":59,"character":42},"arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"sui-multi-select","template":"\n\n\n\n\n\n \n\n\n\n\n\n\n
\n \n \n {{ placeholder }}\n \n \n {{ selectedMessage }}\n
\n\n\n
\n\n \n \n
{{ localeValues.noResultsMessage }}
\n
{{ maxSelectedMessage }}
\n
\n
\n","styles":["\n:host input.search {\n width: 12em !important;\n}\n"]}]}],"members":{"selectedOptionsChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":64,"character":5}}]}],"hasLabels":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":90,"character":5}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":101,"character":5}}]}],"maxSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":110,"character":5}}]}],"_multiSelectClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":133,"character":5},"arguments":["class.multiple"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":136,"character":24},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":136,"character":45},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":136,"character":76}]}],"optionsUpdateHook":[{"__symbolic":"method"}],"initialiseRenderedOption":[{"__symbolic":"method"}],"selectOption":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"deselectOption":[{"__symbolic":"method"}],"onQueryInputKeydown":[{"__symbolic":"method"}]}},"SuiMultiSelectValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":248,"character":55},"arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":240,"character":1},"arguments":[{"selector":"sui-multi-select","host":{"(selectedOptionsChange)":"onChange($event)","(touched)":"onTouched()","$quoted$":["(selectedOptionsChange)","(touched)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":246,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiMultiSelectValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiMultiSelect","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":249,"character":36,"context":{"typeName":"T"}},{"__symbolic":"error","message":"Could not resolve type","line":249,"character":39,"context":{"typeName":"U"}}]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/components/select-option.d.ts b/dist/modules/select/components/select-option.d.ts deleted file mode 100644 index 3484760d6..000000000 --- a/dist/modules/select/components/select-option.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { EventEmitter, ViewContainerRef, Renderer2, ElementRef, ChangeDetectorRef } from "@angular/core"; -import { SuiDropdownMenuItem } from "../../dropdown/index"; -import { HandledEvent } from "../../../misc/util/index"; -export declare class SuiSelectOption extends SuiDropdownMenuItem { - changeDetector: ChangeDetectorRef; - private _optionClasses; - value: T; - onSelected: EventEmitter; - isActive: boolean; - renderedText?: string; - formatter: (obj: T) => string; - usesTemplate: boolean; - templateSibling: ViewContainerRef; - constructor(renderer: Renderer2, element: ElementRef, changeDetector: ChangeDetectorRef); - onClick(e: HandledEvent): void; -} diff --git a/dist/modules/select/components/select-option.js b/dist/modules/select/components/select-option.js deleted file mode 100644 index a5fb98c03..000000000 --- a/dist/modules/select/components/select-option.js +++ /dev/null @@ -1,71 +0,0 @@ -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 __()); - }; -})(); -import { Component, Input, HostBinding, HostListener, EventEmitter, ViewContainerRef, ViewChild, Renderer2, ElementRef, Output, ChangeDetectorRef } from "@angular/core"; -import { SuiDropdownMenuItem } from "../../dropdown/index"; -import { HandledEvent } from "../../../misc/util/index"; -var SuiSelectOption = /** @class */ (function (_super) { - __extends(SuiSelectOption, _super); - function SuiSelectOption(renderer, element, changeDetector) { - var _this = - // We inherit SuiDropdownMenuItem to automatically gain all keyboard navigation functionality. - // This is not done via adding the .item class because it isn't supported by Angular. - _super.call(this, renderer, element) || this; - _this.changeDetector = changeDetector; - _this._optionClasses = true; - _this.isActive = false; - _this.onSelected = new EventEmitter(); - // By default we make the default text an empty label, for the brief moment when it isn't displaying the correct one. - // By default we make the default text an empty label, for the brief moment when it isn't displaying the correct one. - _this.renderedText = ""; - _this.usesTemplate = false; - return _this; - } - Object.defineProperty(SuiSelectOption.prototype, "formatter", { - set: function (formatter) { - if (!this.usesTemplate) { - this.renderedText = formatter(this.value); - } - else { - this.renderedText = ""; - } - }, - enumerable: true, - configurable: true - }); - SuiSelectOption.prototype.onClick = function (e) { - var _this = this; - e.eventHandled = true; - setTimeout(function () { return _this.onSelected.emit(_this.value); }); - }; - SuiSelectOption.decorators = [ - { type: Component, args: [{ - selector: "sui-select-option", - template: "\n\n\n" - },] }, - ]; - /** @nocollapse */ - SuiSelectOption.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - { type: ChangeDetectorRef, }, - ]; }; - SuiSelectOption.propDecorators = { - "_optionClasses": [{ type: HostBinding, args: ["class.item",] },], - "value": [{ type: Input },], - "onSelected": [{ type: Output },], - "isActive": [{ type: HostBinding, args: ["class.active",] },], - "templateSibling": [{ type: ViewChild, args: ["templateSibling", { read: ViewContainerRef },] },], - "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], - }; - return SuiSelectOption; -}(SuiDropdownMenuItem)); -export { SuiSelectOption }; -//# sourceMappingURL=select-option.js.map \ No newline at end of file diff --git a/dist/modules/select/components/select-option.js.map b/dist/modules/select/components/select-option.js.map deleted file mode 100644 index 666b858cb..000000000 --- a/dist/modules/select/components/select-option.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"select-option.js","sourceRoot":"","sources":["../../../../src/modules/select/components/select-option.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAC3E,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAC9D,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;;IAShB,mCAAmB;IA+BvD,yBAAY,QAAkB,EAAE,OAAkB,EAAS,cAAgC;QAA3F;QACI,8FAA8F;QAC9F,qFAAqF;QACrF,kBAAM,QAAQ,EAAE,OAAO,CAAC,SAU3B;QAb0D,oBAAc,GAAd,cAAc,CAAkB;QAKvF,KAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,KAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,KAAI,CAAC,UAAU,GAAG,IAAI,YAAY,EAAK,CAAC;;QAGxC,AADA,qHAAqH;QACrH,KAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QAEvB,KAAI,CAAC,YAAY,GAAG,KAAK,CAAC;;KAC7B;IA3BD,sBAAW,sCAAS;aAApB,UAAqB,SAA2B;YAC5C,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;gBACrB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aAC7C;YAAC,IAAI,CAAC,CAAC;gBACJ,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;aAC1B;SACJ;;;OAAA;IAwBM,iCAAO,aAAC,CAAc;;QACzB,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC;QAEtB,UAAU,CAAC,cAAM,OAAA,KAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAI,CAAC,KAAK,CAAC,EAAhC,CAAgC,CAAC,CAAC;;;gBAzD1D,SAAS,SAAC;oBACP,QAAQ,EAAE,mBAAmB;oBAC7B,QAAQ,EAAE,gFAGb;iBACA;;;;gBAXc,SAAS;gBAAE,UAAU;gBAAU,iBAAiB;;;mCAc1D,WAAW,SAAC,YAAY;0BAGxB,KAAK;+BAIL,MAAM;6BAGN,WAAW,SAAC,cAAc;oCAgB1B,SAAS,SAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;4BAkBvD,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;0BA5DrC;EAcwC,mBAAmB;SAA9C,eAAe","sourcesContent":["import {\n Component, Input, HostBinding, HostListener, EventEmitter, ViewContainerRef,\n ViewChild, Renderer2, ElementRef, Output, ChangeDetectorRef\n} from \"@angular/core\";\nimport { SuiDropdownMenuItem } from \"../../dropdown/index\";\nimport { HandledEvent } from \"../../../misc/util/index\";\n\n@Component({\n selector: \"sui-select-option\",\n template: `\n\n\n`\n})\nexport class SuiSelectOption extends SuiDropdownMenuItem {\n // Sets the Semantic UI classes on the host element.\n @HostBinding(\"class.item\")\n private _optionClasses:boolean;\n\n @Input()\n public value:T;\n\n // Fires when the option is selected, whether by clicking or by keyboard.\n @Output()\n public onSelected:EventEmitter;\n\n @HostBinding(\"class.active\")\n public isActive:boolean;\n\n public renderedText?:string;\n\n public set formatter(formatter:(obj:T) => string) {\n if (!this.usesTemplate) {\n this.renderedText = formatter(this.value);\n } else {\n this.renderedText = \"\";\n }\n }\n\n public usesTemplate:boolean;\n\n // Placeholder to draw template beside.\n @ViewChild(\"templateSibling\", { read: ViewContainerRef })\n public templateSibling:ViewContainerRef;\n\n constructor(renderer:Renderer2, element:ElementRef, public changeDetector:ChangeDetectorRef) {\n // We inherit SuiDropdownMenuItem to automatically gain all keyboard navigation functionality.\n // This is not done via adding the .item class because it isn't supported by Angular.\n super(renderer, element);\n\n this._optionClasses = true;\n this.isActive = false;\n this.onSelected = new EventEmitter();\n\n // By default we make the default text an empty label, for the brief moment when it isn't displaying the correct one.\n this.renderedText = \"\";\n\n this.usesTemplate = false;\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(e:HandledEvent):void {\n e.eventHandled = true;\n\n setTimeout(() => this.onSelected.emit(this.value));\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/components/select-option.metadata.json b/dist/modules/select/components/select-option.metadata.json deleted file mode 100644 index 1ddc44694..000000000 --- a/dist/modules/select/components/select-option.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiSelectOption":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../dropdown/index","name":"SuiDropdownMenuItem","line":14,"character":40},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":7,"character":1},"arguments":[{"selector":"sui-select-option","template":"\n\n\n"}]}],"members":{"_optionClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":16,"character":5},"arguments":["class.item"]}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":5}}]}],"onSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":23,"character":5}}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":26,"character":5},"arguments":["class.active"]}]}],"templateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":42,"character":5},"arguments":["templateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":42,"character":42}}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":45,"character":25},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":45,"character":44},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":45,"character":78}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":60,"character":5},"arguments":["click",["$event"]]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/components/select.d.ts b/dist/modules/select/components/select.d.ts deleted file mode 100644 index 5f4335586..000000000 --- a/dist/modules/select/components/select.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { EventEmitter, ElementRef, Renderer2 } from "@angular/core"; -import { ICustomValueAccessorHost, CustomValueAccessor } from "../../../misc/util/index"; -import { SuiLocalizationService } from "../../../behaviors/localization/index"; -import { SuiSelectBase } from "../classes/select-base"; -import { SuiSelectOption } from "./select-option"; -export declare class SuiSelect extends SuiSelectBase implements ICustomValueAccessorHost { - selectedOption?: T; - private _writtenOption?; - private _optionTemplateSibling; - selectedOptionChange: EventEmitter; - private _placeholder; - placeholder: string; - constructor(element: ElementRef, renderer: Renderer2, localizationService: SuiLocalizationService); - protected optionsUpdateHook(): void; - protected queryUpdateHook(): void; - selectOption(option: T): void; - writeValue(value: U): void; - protected initialiseRenderedOption(option: SuiSelectOption): void; - private drawSelectedOption(); -} -export declare class SuiSelectValueAccessor extends CustomValueAccessor> { - constructor(host: SuiSelect); -} diff --git a/dist/modules/select/components/select.js b/dist/modules/select/components/select.js deleted file mode 100644 index 63841840e..000000000 --- a/dist/modules/select/components/select.js +++ /dev/null @@ -1,146 +0,0 @@ -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 __()); - }; -})(); -import { Component, ViewContainerRef, ViewChild, Output, EventEmitter, ElementRef, Directive, Input, Renderer2 } from "@angular/core"; -import { customValueAccessorFactory, CustomValueAccessor } from "../../../misc/util/index"; -import { SuiLocalizationService } from "../../../behaviors/localization/index"; -import { SuiSelectBase } from "../classes/select-base"; -var SuiSelect = /** @class */ (function (_super) { - __extends(SuiSelect, _super); - function SuiSelect(element, renderer, localizationService) { - var _this = _super.call(this, element, renderer, localizationService) || this; - _this.selectedOptionChange = new EventEmitter(); - return _this; - } - Object.defineProperty(SuiSelect.prototype, "placeholder", { - get: function () { - return this._placeholder || this.localeValues.single.placeholder; - }, - set: function (placeholder) { - this._placeholder = placeholder; - }, - enumerable: true, - configurable: true - }); - SuiSelect.prototype.optionsUpdateHook = function () { - if (!this._writtenOption && this.selectedOption) { - // We need to check the option still exists. - this.writeValue(this.valueGetter(this.selectedOption)); - } - if (this._writtenOption && this.searchService.options.length > 0) { - // If there was an value written by ngModel before the options had been loaded, this runs to fix it. - this.selectedOption = this.findOption(this.searchService.options, this._writtenOption); - if (this.selectedOption) { - this._writtenOption = undefined; - this.drawSelectedOption(); - } - } - }; - SuiSelect.prototype.queryUpdateHook = function () { - // When the query is updated, we just abandon the current selection. - this.selectedOption = undefined; - }; - SuiSelect.prototype.selectOption = function (option) { - // Choose and emit the selected option. - this.selectedOption = option; - this.selectedOptionChange.emit(this.valueGetter(option)); - this.dropdownService.setOpenState(false); - this.resetQuery(); - this.drawSelectedOption(); - // Automatically refocus the search input for better keyboard accessibility. - this.focus(); - }; - SuiSelect.prototype.writeValue = function (value) { - var _this = this; - if (value != undefined) { - if (this.searchService.options.length > 0) { - // If the options have already been loaded, we can immediately match the ngModel value to an option. - this.selectedOption = this.findOption(this.searchService.options, value); - this.drawSelectedOption(); - } - if (this.selectedOption == undefined) { - if (this.valueField && this.searchService.hasItemLookup) { - // If the search service has a selected lookup function, make use of that to load the initial value. - this.searchService - .initialLookup(value) - .then(function (i) { - _this.selectedOption = i; - _this.drawSelectedOption(); - }); - } - else { - // Otherwise, cache the written value for when options are set. - this._writtenOption = value; - } - } - } - else { - this.selectedOption = undefined; - this.drawSelectedOption(); - } - }; - SuiSelect.prototype.initialiseRenderedOption = function (option) { - _super.prototype.initialiseRenderedOption.call(this, option); - // Boldens the item so it appears selected in the dropdown. - option.isActive = option.value === this.selectedOption; - }; - SuiSelect.prototype.drawSelectedOption = function () { - // Updates the active class on the newly selected option. - if (this._renderedOptions) { - this.onAvailableOptionsRendered(); - } - if (this.selectedOption != undefined && this.optionTemplate) { - this.drawTemplate(this._optionTemplateSibling, this.selectedOption); - } - }; - SuiSelect.decorators = [ - { type: Component, args: [{ - selector: "sui-select", - template: "\n\n\n\n\n
{{ placeholder }}
\n\n
\n \n \n
\n\n\n\n
\n\n \n
\n {{ localeValues.noResultsMessage }}\n
\n
\n" - },] }, - ]; - /** @nocollapse */ - SuiSelect.ctorParameters = function () { return [ - { type: ElementRef, }, - { type: Renderer2, }, - { type: SuiLocalizationService, }, - ]; }; - SuiSelect.propDecorators = { - "_optionTemplateSibling": [{ type: ViewChild, args: ["optionTemplateSibling", { read: ViewContainerRef },] },], - "selectedOptionChange": [{ type: Output },], - "placeholder": [{ type: Input },], - }; - return SuiSelect; -}(SuiSelectBase)); -export { SuiSelect }; -// Value accessor directive for the select to support ngModel. -var SuiSelectValueAccessor = /** @class */ (function (_super) { - __extends(SuiSelectValueAccessor, _super); - function SuiSelectValueAccessor(host) { - return _super.call(this, host) || this; - } - SuiSelectValueAccessor.decorators = [ - { type: Directive, args: [{ - selector: "sui-select", - host: { - "(selectedOptionChange)": "onChange($event)", - "(touched)": "onTouched()" - }, - providers: [customValueAccessorFactory(SuiSelectValueAccessor)] - },] }, - ]; - /** @nocollapse */ - SuiSelectValueAccessor.ctorParameters = function () { return [ - { type: SuiSelect, }, - ]; }; - return SuiSelectValueAccessor; -}(CustomValueAccessor)); -export { SuiSelectValueAccessor }; -//# sourceMappingURL=select.js.map \ No newline at end of file diff --git a/dist/modules/select/components/select.js.map b/dist/modules/select/components/select.js.map deleted file mode 100644 index 4388630e5..000000000 --- a/dist/modules/select/components/select.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/modules/select/components/select.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtI,OAAO,EAA4B,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACrH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;;IAkClB,6BAAmB;IAsBpD,mBAAY,OAAkB,EAAE,QAAkB,EAAE,mBAA0C;QAA9F,YACI,kBAAM,OAAO,EAAE,QAAQ,EAAE,mBAAmB,CAAC,SAGhD;QADG,KAAI,CAAC,oBAAoB,GAAG,IAAI,YAAY,EAAK,CAAC;;KACrD;0BAZU,kCAAW;;YAClB,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC;;aAGrE,UAAuB,WAAkB;YACrC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;SACnC;;;;IAQS,qCAAiB,GAA3B;QACI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;;YAE9C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;SAC1D;QAED,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,IAAI,IAAI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a;SAArC,SAAS;;;IAwH4B,0CAAuC;IACrF,gCAAY,IAAoB;eAC5B,kBAAM,IAAI,CAAC;KACd;;gBAXJ,SAAS,SAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE;wBACF,wBAAwB,EAAE,kBAAkB;wBAC5C,WAAW,EAAE,aAAa;qBAC7B;oBACD,SAAS,EAAE,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,CAAC;iBAClE;;;;gBAvHY,SAAS;;iCArCtB;EA6JkD,mBAAmB;SAAxD,sBAAsB","sourcesContent":["import { Component, ViewContainerRef, ViewChild, Output, EventEmitter, ElementRef, Directive, Input, Renderer2 } from \"@angular/core\";\nimport { ICustomValueAccessorHost, customValueAccessorFactory, CustomValueAccessor } from \"../../../misc/util/index\";\nimport { SuiLocalizationService } from \"../../../behaviors/localization/index\";\nimport { SuiSelectBase } from \"../classes/select-base\";\nimport { SuiSelectOption } from \"./select-option\";\n\n@Component({\n selector: \"sui-select\",\n template: `\n\n\n\n\n
{{ placeholder }}
\n\n
\n \n \n
\n\n\n\n
\n\n \n
\n {{ localeValues.noResultsMessage }}\n
\n
\n`\n})\nexport class SuiSelect extends SuiSelectBase implements ICustomValueAccessorHost {\n public selectedOption?:T;\n // Stores the value written by ngModel before it can be matched to an option from `options`.\n private _writtenOption?:U;\n\n @ViewChild(\"optionTemplateSibling\", { read: ViewContainerRef })\n private _optionTemplateSibling:ViewContainerRef;\n\n @Output()\n public selectedOptionChange:EventEmitter;\n\n private _placeholder:string;\n\n @Input()\n public get placeholder():string {\n return this._placeholder || this.localeValues.single.placeholder;\n }\n\n public set placeholder(placeholder:string) {\n this._placeholder = placeholder;\n }\n\n constructor(element:ElementRef, renderer:Renderer2, localizationService:SuiLocalizationService) {\n super(element, renderer, localizationService);\n\n this.selectedOptionChange = new EventEmitter();\n }\n\n protected optionsUpdateHook():void {\n if (!this._writtenOption && this.selectedOption) {\n // We need to check the option still exists.\n this.writeValue(this.valueGetter(this.selectedOption));\n }\n\n if (this._writtenOption && this.searchService.options.length > 0) {\n // If there was an value written by ngModel before the options had been loaded, this runs to fix it.\n this.selectedOption = this.findOption(this.searchService.options, this._writtenOption);\n if (this.selectedOption) {\n this._writtenOption = undefined;\n this.drawSelectedOption();\n }\n }\n }\n\n protected queryUpdateHook():void {\n // When the query is updated, we just abandon the current selection.\n this.selectedOption = undefined;\n }\n\n public selectOption(option:T):void {\n // Choose and emit the selected option.\n this.selectedOption = option;\n this.selectedOptionChange.emit(this.valueGetter(option));\n\n this.dropdownService.setOpenState(false);\n\n this.resetQuery();\n\n this.drawSelectedOption();\n\n // Automatically refocus the search input for better keyboard accessibility.\n this.focus();\n }\n\n public writeValue(value:U):void {\n if (value != undefined) {\n if (this.searchService.options.length > 0) {\n // If the options have already been loaded, we can immediately match the ngModel value to an option.\n this.selectedOption = this.findOption(this.searchService.options, value);\n\n this.drawSelectedOption();\n }\n if (this.selectedOption == undefined) {\n if (this.valueField && this.searchService.hasItemLookup) {\n // If the search service has a selected lookup function, make use of that to load the initial value.\n this.searchService\n .initialLookup(value)\n .then(i => {\n this.selectedOption = i;\n this.drawSelectedOption();\n });\n } else {\n // Otherwise, cache the written value for when options are set.\n this._writtenOption = value;\n }\n }\n } else {\n this.selectedOption = undefined;\n this.drawSelectedOption();\n }\n }\n\n protected initialiseRenderedOption(option:SuiSelectOption):void {\n super.initialiseRenderedOption(option);\n\n // Boldens the item so it appears selected in the dropdown.\n option.isActive = option.value === this.selectedOption;\n }\n\n private drawSelectedOption():void {\n // Updates the active class on the newly selected option.\n if (this._renderedOptions) {\n this.onAvailableOptionsRendered();\n }\n\n if (this.selectedOption != undefined && this.optionTemplate) {\n this.drawTemplate(this._optionTemplateSibling, this.selectedOption);\n }\n }\n}\n\n// Value accessor directive for the select to support ngModel.\n@Directive({\n selector: \"sui-select\",\n host: {\n \"(selectedOptionChange)\": \"onChange($event)\",\n \"(touched)\": \"onTouched()\"\n },\n providers: [customValueAccessorFactory(SuiSelectValueAccessor)]\n})\nexport class SuiSelectValueAccessor extends CustomValueAccessor> {\n constructor(host:SuiSelect) {\n super(host);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/components/select.metadata.json b/dist/modules/select/components/select.metadata.json deleted file mode 100644 index 01e5b392f..000000000 --- a/dist/modules/select/components/select.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiSelect":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../classes/select-base","name":"SuiSelectBase","line":37,"character":37},"arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"sui-select","template":"\n\n\n\n\n
{{ placeholder }}
\n\n
\n \n \n
\n\n\n\n
\n\n \n
\n {{ localeValues.noResultsMessage }}\n
\n
\n"}]}],"members":{"_optionTemplateSibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":42,"character":5},"arguments":["optionTemplateSibling",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":42,"character":48}}]}]}],"selectedOptionChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":45,"character":5}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":59,"character":24},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":59,"character":45},{"__symbolic":"reference","module":"../../../behaviors/localization/index","name":"SuiLocalizationService","line":59,"character":76}]}],"optionsUpdateHook":[{"__symbolic":"method"}],"queryUpdateHook":[{"__symbolic":"method"}],"selectOption":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"initialiseRenderedOption":[{"__symbolic":"method"}],"drawSelectedOption":[{"__symbolic":"method"}]}},"SuiSelectValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../misc/util/index","name":"CustomValueAccessor","line":157,"character":50},"arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":149,"character":1},"arguments":[{"selector":"sui-select","host":{"(selectedOptionChange)":"onChange($event)","(touched)":"onTouched()","$quoted$":["(selectedOptionChange)","(touched)"]},"providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"../../../misc/util/index","name":"customValueAccessorFactory","line":155,"character":16},"arguments":[{"__symbolic":"reference","name":"SuiSelectValueAccessor"}]}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"SuiSelect","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":158,"character":31,"context":{"typeName":"T"}},{"__symbolic":"error","message":"Could not resolve type","line":158,"character":34,"context":{"typeName":"U"}}]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/directives/select-search.d.ts b/dist/modules/select/directives/select-search.d.ts deleted file mode 100644 index 4b14d86a8..000000000 --- a/dist/modules/select/directives/select-search.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { EventEmitter, Renderer2, ElementRef } from "@angular/core"; -export declare class SuiSelectSearch { - private _renderer; - private _element; - private _searchClass; - private _autoComplete; - query: string; - onQueryUpdated: EventEmitter; - onQueryKeyDown: EventEmitter; - constructor(_renderer: Renderer2, _element: ElementRef); - private updateQuery(query); - private onKeyDown(e); - focus(): void; -} diff --git a/dist/modules/select/directives/select-search.js b/dist/modules/select/directives/select-search.js deleted file mode 100644 index 213aad2dd..000000000 --- a/dist/modules/select/directives/select-search.js +++ /dev/null @@ -1,49 +0,0 @@ -import { Directive, EventEmitter, Renderer2, ElementRef, HostListener, HostBinding } from "@angular/core"; -var SuiSelectSearch = /** @class */ (function () { - function SuiSelectSearch(_renderer, _element) { - this._renderer = _renderer; - this._element = _element; - this.onQueryUpdated = new EventEmitter(); - this.onQueryKeyDown = new EventEmitter(); - this._searchClass = true; - this._autoComplete = "off"; - } - Object.defineProperty(SuiSelectSearch.prototype, "query", { - set: function (query) { - this._renderer.setProperty(this._element.nativeElement, "value", query); - }, - enumerable: true, - configurable: true - }); - SuiSelectSearch.prototype.updateQuery = function (query) { - this.onQueryUpdated.emit(query); - }; - SuiSelectSearch.prototype.onKeyDown = function (e) { - this.onQueryKeyDown.emit(e); - }; - SuiSelectSearch.prototype.focus = function () { - var _this = this; - // Slightly delay to support in menu search. - this._element.nativeElement.focus(); - setTimeout(function () { return _this._element.nativeElement.focus(); }); - }; - SuiSelectSearch.decorators = [ - { type: Directive, args: [{ - selector: "input[suiSelectSearch]" - },] }, - ]; - /** @nocollapse */ - SuiSelectSearch.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - ]; }; - SuiSelectSearch.propDecorators = { - "_searchClass": [{ type: HostBinding, args: ["class.search",] },], - "_autoComplete": [{ type: HostBinding, args: ["attr.autocomplete",] },], - "updateQuery": [{ type: HostListener, args: ["input", ["$event.target.value"],] },], - "onKeyDown": [{ type: HostListener, args: ["keydown", ["$event"],] },], - }; - return SuiSelectSearch; -}()); -export { SuiSelectSearch }; -//# sourceMappingURL=select-search.js.map \ No newline at end of file diff --git a/dist/modules/select/directives/select-search.js.map b/dist/modules/select/directives/select-search.js.map deleted file mode 100644 index 911ad0064..000000000 --- a/dist/modules/select/directives/select-search.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"select-search.js","sourceRoot":"","sources":["../../../../src/modules/select/directives/select-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;IAmB7G,yBAAoB,SAAmB,EAAU,QAAmB;QAAhD,cAAS,GAAT,SAAS,CAAU;QAAU,aAAQ,GAAR,QAAQ,CAAW;QAChE,IAAI,CAAC,cAAc,GAAG,IAAI,YAAY,EAAU,CAAC;QACjD,IAAI,CAAC,cAAc,GAAG,IAAI,YAAY,EAAiB,CAAC;QAExD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;KAC9B;IAbD,sBAAW,kCAAK;aAAhB,UAAiB,KAAY;YACzB,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;SAC3E;;;OAAA;IAcO,qCAAW,aAAC,KAAY;QAC5B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;;IAI5B,mCAAS,aAAC,CAAe;QAC7B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;IAGzB,+BAAK,GAAZ;QAAA,iBAIC;;QAFG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QACpC,UAAU,CAAC,cAAM,OAAA,KAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,EAAnC,CAAmC,CAAC,CAAC;KACzD;;gBAvCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,wBAAwB;iBACrC;;;;gBAJwC,SAAS;gBAAE,UAAU;;;iCAMzD,WAAW,SAAC,cAAc;kCAG1B,WAAW,SAAC,mBAAmB;gCAkB/B,YAAY,SAAC,OAAO,EAAE,CAAC,qBAAqB,CAAC;8BAK7C,YAAY,SAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;;0BAhCvC;;SAKa,eAAe","sourcesContent":["import { Directive, Input, EventEmitter, Renderer2, ElementRef, HostListener, HostBinding } from \"@angular/core\";\n\n@Directive({\n selector: \"input[suiSelectSearch]\"\n})\nexport class SuiSelectSearch {\n @HostBinding(\"class.search\")\n private _searchClass:boolean;\n\n @HostBinding(\"attr.autocomplete\")\n private _autoComplete:string;\n\n public set query(query:string) {\n this._renderer.setProperty(this._element.nativeElement, \"value\", query);\n }\n\n public onQueryUpdated:EventEmitter;\n public onQueryKeyDown:EventEmitter;\n\n constructor(private _renderer:Renderer2, private _element:ElementRef) {\n this.onQueryUpdated = new EventEmitter();\n this.onQueryKeyDown = new EventEmitter();\n\n this._searchClass = true;\n this._autoComplete = \"off\";\n }\n\n @HostListener(\"input\", [\"$event.target.value\"])\n private updateQuery(query:string):void {\n this.onQueryUpdated.emit(query);\n }\n\n @HostListener(\"keydown\", [\"$event\"])\n private onKeyDown(e:KeyboardEvent):void {\n this.onQueryKeyDown.emit(e);\n }\n\n public focus():void {\n // Slightly delay to support in menu search.\n this._element.nativeElement.focus();\n setTimeout(() => this._element.nativeElement.focus());\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/select/directives/select-search.metadata.json b/dist/modules/select/directives/select-search.metadata.json deleted file mode 100644 index b1cd41e69..000000000 --- a/dist/modules/select/directives/select-search.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiSelectSearch":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"input[suiSelectSearch]"}]}],"members":{"_searchClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":6,"character":5},"arguments":["class.search"]}]}],"_autoComplete":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":9,"character":5},"arguments":["attr.autocomplete"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":19,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":19,"character":62}]}],"updateQuery":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":27,"character":5},"arguments":["input",["$event.target.value"]]}]}],"onKeyDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":32,"character":5},"arguments":["keydown",["$event"]]}]}],"focus":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/select/index.d.ts b/dist/modules/select/index.d.ts deleted file mode 100644 index e3880daec..000000000 --- a/dist/modules/select/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from "./classes/select-base"; -export * from "./components/multi-select-label"; -export * from "./components/multi-select"; -export * from "./components/select-option"; -export * from "./components/select"; -export * from "./directives/select-search"; -export * from "./select.module"; diff --git a/dist/modules/select/index.js b/dist/modules/select/index.js deleted file mode 100644 index ebd9f7ac4..000000000 --- a/dist/modules/select/index.js +++ /dev/null @@ -1,8 +0,0 @@ -export * from "./classes/select-base"; -export * from "./components/multi-select-label"; -export * from "./components/multi-select"; -export * from "./components/select-option"; -export * from "./components/select"; -export * from "./directives/select-search"; -export * from "./select.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/select/index.js.map b/dist/modules/select/index.js.map deleted file mode 100644 index 758f592fd..000000000 --- a/dist/modules/select/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/select/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AAEtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AAEpC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./classes/select-base\";\n\nexport * from \"./components/multi-select-label\";\nexport * from \"./components/multi-select\";\nexport * from \"./components/select-option\";\nexport * from \"./components/select\";\n\nexport * from \"./directives/select-search\";\n\nexport * from \"./select.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/select/index.metadata.json b/dist/modules/select/index.metadata.json deleted file mode 100644 index c5652f5a2..000000000 --- a/dist/modules/select/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/select-base"},{"from":"./components/multi-select-label"},{"from":"./components/multi-select"},{"from":"./components/select-option"},{"from":"./components/select"},{"from":"./directives/select-search"},{"from":"./select.module"}]}] \ No newline at end of file diff --git a/dist/modules/select/public.d.ts b/dist/modules/select/public.d.ts deleted file mode 100644 index 33dfd1bcf..000000000 --- a/dist/modules/select/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiSelectModule, IOptionContext } from "./index"; diff --git a/dist/modules/select/public.js b/dist/modules/select/public.js deleted file mode 100644 index ace7cd339..000000000 --- a/dist/modules/select/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiSelectModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/select/public.js.map b/dist/modules/select/public.js.map deleted file mode 100644 index 75eee67fc..000000000 --- a/dist/modules/select/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/select/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EAElB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiSelectModule,\n IOptionContext\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/select/public.metadata.json b/dist/modules/select/public.metadata.json deleted file mode 100644 index d328957b7..000000000 --- a/dist/modules/select/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiSelectModule","IOptionContext"]}]}] \ No newline at end of file diff --git a/dist/modules/select/select.module.d.ts b/dist/modules/select/select.module.d.ts deleted file mode 100644 index cab394b8e..000000000 --- a/dist/modules/select/select.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiSelectModule { -} diff --git a/dist/modules/select/select.module.js b/dist/modules/select/select.module.js deleted file mode 100644 index 57a2ab2ed..000000000 --- a/dist/modules/select/select.module.js +++ /dev/null @@ -1,48 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { FormsModule } from "@angular/forms"; -import { SuiDropdownModule } from "../dropdown/index"; -import { SuiUtilityModule } from "../../misc/util/index"; -import { SuiLocalizationModule } from "../../behaviors/localization/index"; -import { SuiSelect, SuiSelectValueAccessor } from "./components/select"; -import { SuiSelectOption } from "./components/select-option"; -import { SuiSelectSearch } from "./directives/select-search"; -import { SuiMultiSelect, SuiMultiSelectValueAccessor } from "./components/multi-select"; -import { SuiMultiSelectLabel } from "./components/multi-select-label"; -var SuiSelectModule = /** @class */ (function () { - function SuiSelectModule() { - } - SuiSelectModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule, - FormsModule, - SuiDropdownModule, - SuiUtilityModule, - SuiLocalizationModule - ], - declarations: [ - SuiSelect, - SuiSelectOption, - SuiSelectSearch, - SuiSelectValueAccessor, - SuiMultiSelect, - SuiMultiSelectLabel, - SuiMultiSelectValueAccessor - ], - exports: [ - SuiSelect, - SuiSelectOption, - SuiSelectSearch, - SuiSelectValueAccessor, - SuiMultiSelect, - SuiMultiSelectValueAccessor - ] - },] }, - ]; - /** @nocollapse */ - SuiSelectModule.ctorParameters = function () { return []; }; - return SuiSelectModule; -}()); -export { SuiSelectModule }; -//# sourceMappingURL=select.module.js.map \ No newline at end of file diff --git a/dist/modules/select/select.module.js.map b/dist/modules/select/select.module.js.map deleted file mode 100644 index e273ab442..000000000 --- a/dist/modules/select/select.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"select.module.js","sourceRoot":"","sources":["../../../src/modules/select/select.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;;;;;gBAErE,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,iBAAiB;wBACjB,gBAAgB;wBAChB,qBAAqB;qBACxB;oBACD,YAAY,EAAE;wBACV,SAAS;wBACT,eAAe;wBACf,eAAe;wBACf,sBAAsB;wBACtB,cAAc;wBACd,mBAAmB;wBACnB,2BAA2B;qBAC9B;oBACD,OAAO,EAAE;wBACL,SAAS;wBACT,eAAe;wBACf,eAAe;wBACf,sBAAsB;wBACtB,cAAc;wBACd,2BAA2B;qBAC9B;iBACJ;;;;0BArCD;;SAsCa,eAAe","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { SuiDropdownModule } from \"../dropdown/index\";\nimport { SuiUtilityModule } from \"../../misc/util/index\";\nimport { SuiLocalizationModule } from \"../../behaviors/localization/index\";\nimport { SuiSelect, SuiSelectValueAccessor } from \"./components/select\";\nimport { SuiSelectOption } from \"./components/select-option\";\nimport { SuiSelectSearch } from \"./directives/select-search\";\nimport { SuiMultiSelect, SuiMultiSelectValueAccessor } from \"./components/multi-select\";\nimport { SuiMultiSelectLabel } from \"./components/multi-select-label\";\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SuiDropdownModule,\n SuiUtilityModule,\n SuiLocalizationModule\n ],\n declarations: [\n SuiSelect,\n SuiSelectOption,\n SuiSelectSearch,\n SuiSelectValueAccessor,\n SuiMultiSelect,\n SuiMultiSelectLabel,\n SuiMultiSelectValueAccessor\n ],\n exports: [\n SuiSelect,\n SuiSelectOption,\n SuiSelectSearch,\n SuiSelectValueAccessor,\n SuiMultiSelect,\n SuiMultiSelectValueAccessor\n ]\n})\nexport class SuiSelectModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/select/select.module.metadata.json b/dist/modules/select/select.module.metadata.json deleted file mode 100644 index dce964d96..000000000 --- a/dist/modules/select/select.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiSelectModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":12,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":14,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":15,"character":8},{"__symbolic":"reference","module":"../dropdown/index","name":"SuiDropdownModule","line":16,"character":8},{"__symbolic":"reference","module":"../../misc/util/index","name":"SuiUtilityModule","line":17,"character":8},{"__symbolic":"reference","module":"../../behaviors/localization/index","name":"SuiLocalizationModule","line":18,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/select","name":"SuiSelect","line":21,"character":8},{"__symbolic":"reference","module":"./components/select-option","name":"SuiSelectOption","line":22,"character":8},{"__symbolic":"reference","module":"./directives/select-search","name":"SuiSelectSearch","line":23,"character":8},{"__symbolic":"reference","module":"./components/select","name":"SuiSelectValueAccessor","line":24,"character":8},{"__symbolic":"reference","module":"./components/multi-select","name":"SuiMultiSelect","line":25,"character":8},{"__symbolic":"reference","module":"./components/multi-select-label","name":"SuiMultiSelectLabel","line":26,"character":8},{"__symbolic":"reference","module":"./components/multi-select","name":"SuiMultiSelectValueAccessor","line":27,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/select","name":"SuiSelect","line":30,"character":8},{"__symbolic":"reference","module":"./components/select-option","name":"SuiSelectOption","line":31,"character":8},{"__symbolic":"reference","module":"./directives/select-search","name":"SuiSelectSearch","line":32,"character":8},{"__symbolic":"reference","module":"./components/select","name":"SuiSelectValueAccessor","line":33,"character":8},{"__symbolic":"reference","module":"./components/multi-select","name":"SuiMultiSelect","line":34,"character":8},{"__symbolic":"reference","module":"./components/multi-select","name":"SuiMultiSelectValueAccessor","line":35,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-container.d.ts b/dist/modules/sidebar/components/sidebar-container.d.ts deleted file mode 100644 index 9528a22eb..000000000 --- a/dist/modules/sidebar/components/sidebar-container.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AfterContentInit } from "@angular/core"; -import { SidebarService } from "../services/sidebar.service"; -import { SuiSidebar } from "./sidebar"; -import { SuiSidebarSibling } from "./sidebar-sibling"; -export declare class SuiSidebarContainer implements AfterContentInit { - service: SidebarService; - private _containerClasses; - sidebar: SuiSidebar; - sibling: SuiSidebarSibling; - constructor(); - ngAfterContentInit(): void; -} diff --git a/dist/modules/sidebar/components/sidebar-container.js b/dist/modules/sidebar/components/sidebar-container.js deleted file mode 100644 index 6128d4881..000000000 --- a/dist/modules/sidebar/components/sidebar-container.js +++ /dev/null @@ -1,35 +0,0 @@ -import { Component, HostBinding, ContentChild } from "@angular/core"; -import { SuiSidebar } from "./sidebar"; -import { SuiSidebarSibling } from "./sidebar-sibling"; -var SuiSidebarContainer = /** @class */ (function () { - function SuiSidebarContainer() { - this._containerClasses = true; - } - SuiSidebarContainer.prototype.ngAfterContentInit = function () { - if (!this.sidebar) { - throw new Error("You must include a element within the container."); - } - this.service = this.sidebar.service; - if (!this.sibling) { - throw new Error("You must include a element within the container."); - } - this.sibling.service = this.service; - }; - SuiSidebarContainer.decorators = [ - { type: Component, args: [{ - selector: "sui-sidebar-container", - template: "", - styles: ["\n:host {\n display: block;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiSidebarContainer.ctorParameters = function () { return []; }; - SuiSidebarContainer.propDecorators = { - "_containerClasses": [{ type: HostBinding, args: ["class.pushable",] },], - "sidebar": [{ type: ContentChild, args: [SuiSidebar,] },], - "sibling": [{ type: ContentChild, args: [SuiSidebarSibling,] },], - }; - return SuiSidebarContainer; -}()); -export { SuiSidebarContainer }; -//# sourceMappingURL=sidebar-container.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-container.js.map b/dist/modules/sidebar/components/sidebar-container.js.map deleted file mode 100644 index 58f616202..000000000 --- a/dist/modules/sidebar/components/sidebar-container.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sidebar-container.js","sourceRoot":"","sources":["../../../../src/modules/sidebar/components/sidebar-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;;IAuBlD;QACI,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;KACjC;IAEM,gDAAkB,GAAzB;QACI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;SACrF;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QAEpC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;SAC7F;QACD,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;KACvC;;gBAnCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE,2BAA2B;oBACrC,MAAM,EAAE,CAAC,qCAIZ,CAAC;iBACD;;;;;sCAII,WAAW,SAAC,gBAAgB;4BAG5B,YAAY,SAAC,UAAU;4BAGvB,YAAY,SAAC,iBAAiB;;8BAvBnC;;SAca,mBAAmB","sourcesContent":["import { Component, AfterContentInit, HostBinding, ContentChild } from \"@angular/core\";\nimport { SidebarService } from \"../services/sidebar.service\";\nimport { SuiSidebar } from \"./sidebar\";\nimport { SuiSidebarSibling } from \"./sidebar-sibling\";\n\n@Component({\n selector: \"sui-sidebar-container\",\n template: ``,\n styles: [`\n:host {\n display: block;\n}\n`]\n})\nexport class SuiSidebarContainer implements AfterContentInit {\n public service:SidebarService;\n\n @HostBinding(\"class.pushable\")\n private _containerClasses:boolean;\n\n @ContentChild(SuiSidebar)\n public sidebar:SuiSidebar;\n\n @ContentChild(SuiSidebarSibling)\n public sibling:SuiSidebarSibling;\n\n constructor() {\n this._containerClasses = true;\n }\n\n public ngAfterContentInit():void {\n if (!this.sidebar) {\n throw new Error(\"You must include a element within the container.\");\n }\n this.service = this.sidebar.service;\n\n if (!this.sibling) {\n throw new Error(\"You must include a element within the container.\");\n }\n this.sibling.service = this.service;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-container.metadata.json b/dist/modules/sidebar/components/sidebar-container.metadata.json deleted file mode 100644 index 8efa95d69..000000000 --- a/dist/modules/sidebar/components/sidebar-container.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiSidebarContainer":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"sui-sidebar-container","template":"","styles":["\n:host {\n display: block;\n}\n"]}]}],"members":{"_containerClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":17,"character":5},"arguments":["class.pushable"]}]}],"sidebar":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":20,"character":5},"arguments":[{"__symbolic":"reference","module":"./sidebar","name":"SuiSidebar","line":20,"character":18}]}]}],"sibling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":23,"character":5},"arguments":[{"__symbolic":"reference","module":"./sidebar-sibling","name":"SuiSidebarSibling","line":23,"character":18}]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngAfterContentInit":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-sibling.d.ts b/dist/modules/sidebar/components/sidebar-sibling.d.ts deleted file mode 100644 index fc4e5fb72..000000000 --- a/dist/modules/sidebar/components/sidebar-sibling.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ElementRef, Renderer2 } from "@angular/core"; -import { SidebarService } from "../services/sidebar.service"; -export declare class SuiSidebarSibling { - private _renderer; - private _element; - private _service; - service: SidebarService; - isDimmedWhenVisible: boolean; - readonly isVisible: boolean; - readonly isDimmed: boolean; - private _siblingClasses; - constructor(_renderer: Renderer2, _element: ElementRef); - private updateTransform(); - onClick(event: MouseEvent): void; -} diff --git a/dist/modules/sidebar/components/sidebar-sibling.js b/dist/modules/sidebar/components/sidebar-sibling.js deleted file mode 100644 index 953a27664..000000000 --- a/dist/modules/sidebar/components/sidebar-sibling.js +++ /dev/null @@ -1,81 +0,0 @@ -import { Component, Input, HostBinding, HostListener, ElementRef, Renderer2 } from "@angular/core"; -import { SidebarTransition } from "../services/sidebar.service"; -var SuiSidebarSibling = /** @class */ (function () { - function SuiSidebarSibling(_renderer, _element) { - this._renderer = _renderer; - this._element = _element; - this.isDimmedWhenVisible = false; - this._siblingClasses = true; - } - Object.defineProperty(SuiSidebarSibling.prototype, "service", { - get: function () { - return this._service; - }, - set: function (service) { - var _this = this; - this._service = service; - setTimeout(function () { return _this.updateTransform(); }); - this._service.isVisibleChange.subscribe(function () { return _this.updateTransform(); }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebarSibling.prototype, "isVisible", { - get: function () { - if (!this.service) { - return false; - } - return this.service.isVisible; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebarSibling.prototype, "isDimmed", { - get: function () { - if (!this.service) { - return false; - } - return this.service.isVisible && this.isDimmedWhenVisible; - }, - enumerable: true, - configurable: true - }); - SuiSidebarSibling.prototype.updateTransform = function () { - this._renderer.removeStyle(this._element.nativeElement, "transform"); - this._renderer.removeStyle(this._element.nativeElement, "-webkit-transform"); - if (this.service.isVisible && - this.service.transition !== SidebarTransition.Overlay && - this.service.transition !== SidebarTransition.ScaleDown) { - var translate = "translate3d(" + this.service.width + "px, " + this.service.height + "px, 0)"; - this._renderer.setStyle(this._element.nativeElement, "transform", translate); - this._renderer.setStyle(this._element.nativeElement, "-webkit-transform", translate); - } - }; - SuiSidebarSibling.prototype.onClick = function (event) { - if (this.service.isVisible && !this.service.wasJustOpened) { - this.service.setVisibleState(false); - } - }; - SuiSidebarSibling.decorators = [ - { type: Component, args: [{ - selector: "sui-sidebar-sibling", - template: "", - styles: ["\n:host {\n display: block;\n}\n"] - },] }, - ]; - /** @nocollapse */ - SuiSidebarSibling.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - ]; }; - SuiSidebarSibling.propDecorators = { - "isDimmedWhenVisible": [{ type: Input },], - "isVisible": [{ type: HostBinding, args: ["class.visible",] },], - "isDimmed": [{ type: HostBinding, args: ["class.dimmed",] },], - "_siblingClasses": [{ type: HostBinding, args: ["class.pusher",] },], - "onClick": [{ type: HostListener, args: ["click", ["$event"],] },], - }; - return SuiSidebarSibling; -}()); -export { SuiSidebarSibling }; -//# sourceMappingURL=sidebar-sibling.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-sibling.js.map b/dist/modules/sidebar/components/sidebar-sibling.js.map deleted file mode 100644 index 312df5c62..000000000 --- a/dist/modules/sidebar/components/sidebar-sibling.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sidebar-sibling.js","sourceRoot":"","sources":["../../../../src/modules/sidebar/components/sidebar-sibling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAkB,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;;IA+C5E,2BAAoB,SAAmB,EAAU,QAAmB;QAAhD,cAAS,GAAT,SAAS,CAAU;QAAU,aAAQ,GAAR,QAAQ,CAAW;QAChE,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;QAEjC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;KAC/B;IArCD,sBAAW,sCAAO;aAAlB;YACI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;SACxB;aAED,UAAmB,OAAsB;YAAzC,iBAKC;YAJG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAExB,UAAU,CAAC,cAAM,OAAA,KAAI,CAAC,eAAe,EAAE,EAAtB,CAAsB,CAAC,CAAC;YACzC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,eAAe,EAAE,EAAtB,CAAsB,CAAC,CAAC;SACzE;;;OAPA;0BAaU,wCAAS;;YAChB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;gBAChB,MAAM,CAAC,KAAK,CAAC;aAChB;YACD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;;;;;0BAIvB,uCAAQ;;YACf,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;gBAChB,MAAM,CAAC,KAAK,CAAC;aAChB;YACD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L,WAAW,SAAC,eAAe;6BAQ3B,WAAW,SAAC,cAAc;oCAQ1B,WAAW,SAAC,cAAc;4BAuB1B,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;4BApErC;;SAYa,iBAAiB","sourcesContent":["import { Component, Input, HostBinding, HostListener, ElementRef, Renderer2 } from \"@angular/core\";\nimport { SidebarService, SidebarTransition } from \"../services/sidebar.service\";\n\n@Component({\n selector: \"sui-sidebar-sibling\",\n template: ``,\n styles: [`\n:host {\n display: block;\n}\n`]\n})\nexport class SuiSidebarSibling {\n private _service:SidebarService;\n\n public get service():SidebarService {\n return this._service;\n }\n\n public set service(service:SidebarService) {\n this._service = service;\n\n setTimeout(() => this.updateTransform());\n this._service.isVisibleChange.subscribe(() => this.updateTransform());\n }\n\n @Input()\n public isDimmedWhenVisible:boolean;\n\n @HostBinding(\"class.visible\")\n public get isVisible():boolean {\n if (!this.service) {\n return false;\n }\n return this.service.isVisible;\n }\n\n @HostBinding(\"class.dimmed\")\n public get isDimmed():boolean {\n if (!this.service) {\n return false;\n }\n return this.service.isVisible && this.isDimmedWhenVisible;\n }\n\n @HostBinding(\"class.pusher\")\n private _siblingClasses:boolean;\n\n constructor(private _renderer:Renderer2, private _element:ElementRef) {\n this.isDimmedWhenVisible = false;\n\n this._siblingClasses = true;\n }\n\n private updateTransform():void {\n this._renderer.removeStyle(this._element.nativeElement, \"transform\");\n this._renderer.removeStyle(this._element.nativeElement, \"-webkit-transform\");\n\n if (this.service.isVisible &&\n this.service.transition !== SidebarTransition.Overlay &&\n this.service.transition !== SidebarTransition.ScaleDown) {\n\n const translate = `translate3d(${this.service.width}px, ${this.service.height}px, 0)`;\n this._renderer.setStyle(this._element.nativeElement, \"transform\", translate);\n this._renderer.setStyle(this._element.nativeElement, \"-webkit-transform\", translate);\n }\n }\n\n @HostListener(\"click\", [\"$event\"])\n public onClick(event:MouseEvent):void {\n if (this.service.isVisible && !this.service.wasJustOpened) {\n this.service.setVisibleState(false);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar-sibling.metadata.json b/dist/modules/sidebar/components/sidebar-sibling.metadata.json deleted file mode 100644 index 0fd54ee6e..000000000 --- a/dist/modules/sidebar/components/sidebar-sibling.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiSidebarSibling":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"sui-sidebar-sibling","template":"","styles":["\n:host {\n display: block;\n}\n"]}]}],"members":{"isDimmedWhenVisible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":5}}]}],"isVisible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":29,"character":5},"arguments":["class.visible"]}]}],"isDimmed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":37,"character":5},"arguments":["class.dimmed"]}]}],"_siblingClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":45,"character":5},"arguments":["class.pusher"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":48,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":48,"character":62}]}],"updateTransform":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":68,"character":5},"arguments":["click",["$event"]]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar.d.ts b/dist/modules/sidebar/components/sidebar.d.ts deleted file mode 100644 index c24246c2d..000000000 --- a/dist/modules/sidebar/components/sidebar.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Renderer2, ElementRef, EventEmitter } from "@angular/core"; -import { SidebarService, SidebarTransition, SidebarDirection } from "../services/sidebar.service"; -export declare class SuiSidebar { - private _renderer; - private _element; - service: SidebarService; - private _sidebarClasses; - transition: SidebarTransition; - direction: SidebarDirection; - isVisible: boolean; - readonly isVisibleChange: EventEmitter; - readonly isAnimating: boolean; - constructor(_renderer: Renderer2, _element: ElementRef); - private updateDimensions(); - private setClass(className, isAdd?); - open(): void; - close(): void; - toggle(): void; -} diff --git a/dist/modules/sidebar/components/sidebar.js b/dist/modules/sidebar/components/sidebar.js deleted file mode 100644 index be00fd0de..000000000 --- a/dist/modules/sidebar/components/sidebar.js +++ /dev/null @@ -1,109 +0,0 @@ -import { Component, HostBinding, Input, Output, Renderer2, ElementRef, EventEmitter } from "@angular/core"; -import { SidebarService, SidebarTransition, SidebarDirection } from "../services/sidebar.service"; -var SuiSidebar = /** @class */ (function () { - function SuiSidebar(_renderer, _element) { - var _this = this; - this._renderer = _renderer; - this._element = _element; - this.service = new SidebarService(); - // We set the default here as well to force the classes to update. - this.transition = SidebarTransition.Uncover; - this.direction = SidebarDirection.Left; - setTimeout(function () { return _this.updateDimensions(); }); - this.service.isVisibleChange.subscribe(function () { return _this.updateDimensions(); }); - this._sidebarClasses = true; - } - Object.defineProperty(SuiSidebar.prototype, "transition", { - get: function () { - return this.service.transition; - }, - set: function (transition) { - var _this = this; - this.service.transition.split(" ").forEach(function (c) { return _this.setClass(c, false); }); - this.service.transition = transition; - this.service.transition.split(" ").forEach(function (c) { return _this.setClass(c, true); }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebar.prototype, "direction", { - get: function () { - return this.service.direction; - }, - set: function (direction) { - this.setClass(this.service.direction, false); - this.service.direction = direction; - this.setClass(this.service.direction, true); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebar.prototype, "isVisible", { - get: function () { - return this.service.isVisible; - }, - set: function (isVisible) { - this.service.setVisibleState(isVisible); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebar.prototype, "isVisibleChange", { - get: function () { - return this.service.isVisibleChange; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiSidebar.prototype, "isAnimating", { - get: function () { - return this.service.isAnimating; - }, - enumerable: true, - configurable: true - }); - SuiSidebar.prototype.updateDimensions = function () { - this.service.width = this._element.nativeElement.offsetWidth; - this.service.height = this._element.nativeElement.offsetHeight; - }; - SuiSidebar.prototype.setClass = function (className, isAdd) { - if (isAdd === void 0) { isAdd = true; } - if (isAdd) { - this._renderer.addClass(this._element.nativeElement, className); - } - else { - this._renderer.removeClass(this._element.nativeElement, className); - } - }; - SuiSidebar.prototype.open = function () { - this.service.setVisibleState(true); - }; - SuiSidebar.prototype.close = function () { - this.service.setVisibleState(false); - }; - SuiSidebar.prototype.toggle = function () { - this.service.toggleVisibleState(); - }; - SuiSidebar.decorators = [ - { type: Component, args: [{ - selector: "sui-sidebar", - template: "" - },] }, - ]; - /** @nocollapse */ - SuiSidebar.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - ]; }; - SuiSidebar.propDecorators = { - "_sidebarClasses": [{ type: HostBinding, args: ["class.ui",] }, { type: HostBinding, args: ["class.sidebar",] }, { type: HostBinding, args: ["class.menu",] },], - "transition": [{ type: Input },], - "direction": [{ type: Input },], - "isVisible": [{ type: HostBinding, args: ["class.visible",] }, { type: Input },], - "isVisibleChange": [{ type: Output },], - "isAnimating": [{ type: HostBinding, args: ["class.animating",] },], - }; - return SuiSidebar; -}()); -export { SuiSidebar }; -//# sourceMappingURL=sidebar.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar.js.map b/dist/modules/sidebar/components/sidebar.js.map deleted file mode 100644 index 06b639be3..000000000 --- a/dist/modules/sidebar/components/sidebar.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../../../../src/modules/sidebar/components/sidebar.ts"],"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,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;SACtE;KACJ;IAEM,yBAAI,GAAX;QACI,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;KACtC;IAEM,0BAAK,GAAZ;QACI,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;KACvC;IAEM,2BAAM,GAAb;QACI,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;KACrC;;gBA7FJ,SAAS,SAAC;oBACP,QAAQ,EAAE,aAAa;oBACvB,QAAQ,EAAE,2BAA2B;iBACxC;;;;gBAN+C,SAAS;gBAAE,UAAU;;;oCAUhE,WAAW,SAAC,UAAU,cACtB,WAAW,SAAC,eAAe,cAC3B,WAAW,SAAC,YAAY;+BAGxB,KAAK;8BAaL,KAAK;8BAaL,WAAW,SAAC,eAAe,cAC3B,KAAK;oCASL,MAAM;gCAKN,WAAW,SAAC,iBAAiB;;qBAxDlC;;SAOa,UAAU","sourcesContent":["import { Component, HostBinding, Input, Output, Renderer2, ElementRef, EventEmitter } from \"@angular/core\";\nimport { SidebarService, SidebarTransition, SidebarDirection } from \"../services/sidebar.service\";\n\n@Component({\n selector: \"sui-sidebar\",\n template: ``\n})\nexport class SuiSidebar {\n public service:SidebarService;\n\n @HostBinding(\"class.ui\")\n @HostBinding(\"class.sidebar\")\n @HostBinding(\"class.menu\")\n private _sidebarClasses:boolean;\n\n @Input()\n public get transition():SidebarTransition {\n return this.service.transition;\n }\n\n public set transition(transition:SidebarTransition) {\n this.service.transition.split(\" \").forEach(c => this.setClass(c, false));\n\n this.service.transition = transition;\n\n this.service.transition.split(\" \").forEach(c => this.setClass(c, true));\n }\n\n @Input()\n public get direction():SidebarDirection {\n return this.service.direction;\n }\n\n public set direction(direction:SidebarDirection) {\n this.setClass(this.service.direction, false);\n\n this.service.direction = direction;\n\n this.setClass(this.service.direction, true);\n }\n\n @HostBinding(\"class.visible\")\n @Input()\n public get isVisible():boolean {\n return this.service.isVisible;\n }\n\n public set isVisible(isVisible:boolean) {\n this.service.setVisibleState(isVisible);\n }\n\n @Output()\n public get isVisibleChange():EventEmitter {\n return this.service.isVisibleChange;\n }\n\n @HostBinding(\"class.animating\")\n public get isAnimating():boolean {\n return this.service.isAnimating;\n }\n\n constructor(private _renderer:Renderer2, private _element:ElementRef) {\n this.service = new SidebarService();\n // We set the default here as well to force the classes to update.\n this.transition = SidebarTransition.Uncover;\n this.direction = SidebarDirection.Left;\n\n setTimeout(() => this.updateDimensions());\n this.service.isVisibleChange.subscribe(() => this.updateDimensions());\n\n this._sidebarClasses = true;\n }\n\n private updateDimensions():void {\n this.service.width = this._element.nativeElement.offsetWidth;\n this.service.height = this._element.nativeElement.offsetHeight;\n }\n\n private setClass(className:string, isAdd:boolean = true):void {\n if (isAdd) {\n this._renderer.addClass(this._element.nativeElement, className);\n } else {\n this._renderer.removeClass(this._element.nativeElement, className);\n }\n }\n\n public open():void {\n this.service.setVisibleState(true);\n }\n\n public close():void {\n this.service.setVisibleState(false);\n }\n\n public toggle():void {\n this.service.toggleVisibleState();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/components/sidebar.metadata.json b/dist/modules/sidebar/components/sidebar.metadata.json deleted file mode 100644 index 5181c288a..000000000 --- a/dist/modules/sidebar/components/sidebar.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiSidebar":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"sui-sidebar","template":""}]}],"members":{"_sidebarClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":10,"character":5},"arguments":["class.ui"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":11,"character":5},"arguments":["class.sidebar"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":12,"character":5},"arguments":["class.menu"]}]}],"transition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":5}}]}],"direction":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":28,"character":5}}]}],"isVisible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":41,"character":5},"arguments":["class.visible"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":5}}]}],"isVisibleChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":51,"character":5}}]}],"isAnimating":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":56,"character":5},"arguments":["class.animating"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":61,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":61,"character":62}]}],"updateDimensions":[{"__symbolic":"method"}],"setClass":[{"__symbolic":"method"}],"open":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/sidebar/index.d.ts b/dist/modules/sidebar/index.d.ts deleted file mode 100644 index c3e2caf54..000000000 --- a/dist/modules/sidebar/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./components/sidebar-container"; -export * from "./components/sidebar-sibling"; -export * from "./components/sidebar"; -export * from "./services/sidebar.service"; -export * from "./sidebar.module"; diff --git a/dist/modules/sidebar/index.js b/dist/modules/sidebar/index.js deleted file mode 100644 index 7fbeb6ffe..000000000 --- a/dist/modules/sidebar/index.js +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./components/sidebar-container"; -export * from "./components/sidebar-sibling"; -export * from "./components/sidebar"; -export * from "./services/sidebar.service"; -export * from "./sidebar.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/index.js.map b/dist/modules/sidebar/index.js.map deleted file mode 100644 index e1db05de4..000000000 --- a/dist/modules/sidebar/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/sidebar/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AAErC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,kBAAkB,CAAC","sourcesContent":["export * from \"./components/sidebar-container\";\nexport * from \"./components/sidebar-sibling\";\nexport * from \"./components/sidebar\";\n\nexport * from \"./services/sidebar.service\";\n\nexport * from \"./sidebar.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/index.metadata.json b/dist/modules/sidebar/index.metadata.json deleted file mode 100644 index 4353a3862..000000000 --- a/dist/modules/sidebar/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components/sidebar-container"},{"from":"./components/sidebar-sibling"},{"from":"./components/sidebar"},{"from":"./services/sidebar.service"},{"from":"./sidebar.module"}]}] \ No newline at end of file diff --git a/dist/modules/sidebar/public.d.ts b/dist/modules/sidebar/public.d.ts deleted file mode 100644 index 2c63a8929..000000000 --- a/dist/modules/sidebar/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiSidebarModule, SidebarDirection, SidebarTransition } from "./index"; diff --git a/dist/modules/sidebar/public.js b/dist/modules/sidebar/public.js deleted file mode 100644 index 06726fe2e..000000000 --- a/dist/modules/sidebar/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiSidebarModule, SidebarDirection, SidebarTransition } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/public.js.map b/dist/modules/sidebar/public.js.map deleted file mode 100644 index 0c90c37b5..000000000 --- a/dist/modules/sidebar/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/sidebar/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACpB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiSidebarModule,\n SidebarDirection,\n SidebarTransition\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/public.metadata.json b/dist/modules/sidebar/public.metadata.json deleted file mode 100644 index 378d6a6c0..000000000 --- a/dist/modules/sidebar/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiSidebarModule","SidebarDirection","SidebarTransition"]}]}] \ No newline at end of file diff --git a/dist/modules/sidebar/services/sidebar.service.d.ts b/dist/modules/sidebar/services/sidebar.service.d.ts deleted file mode 100644 index 924f12c1a..000000000 --- a/dist/modules/sidebar/services/sidebar.service.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { EventEmitter } from "@angular/core"; -export declare type SidebarTransition = "overlay" | "push" | "scale down" | "uncover" | "slide along" | "slide out"; -export declare const SidebarTransition: { - Overlay: SidebarTransition; - Push: SidebarTransition; - ScaleDown: SidebarTransition; - Uncover: SidebarTransition; - SlideAlong: SidebarTransition; - SlideOut: SidebarTransition; -}; -export declare type SidebarDirection = "left" | "right" | "top" | "bottom"; -export declare const SidebarDirection: { - Left: "left" | "right" | "top" | "bottom"; - Right: "left" | "right" | "top" | "bottom"; - Top: "left" | "right" | "top" | "bottom"; - Bottom: "left" | "right" | "top" | "bottom"; -}; -export declare class SidebarService { - isVisible: boolean; - isAnimating: boolean; - wasJustOpened: boolean; - direction: SidebarDirection; - private _width; - private _height; - width: number; - height: number; - isVisibleChange: EventEmitter; - widthChange: EventEmitter; - heightChange: EventEmitter; - private _isAnimatingTimeout; - transition: SidebarTransition; - constructor(isVisible?: boolean); - setVisibleState(isVisible: boolean): void; - toggleVisibleState(): void; -} diff --git a/dist/modules/sidebar/services/sidebar.service.js b/dist/modules/sidebar/services/sidebar.service.js deleted file mode 100644 index 879f749e7..000000000 --- a/dist/modules/sidebar/services/sidebar.service.js +++ /dev/null @@ -1,81 +0,0 @@ -import { EventEmitter } from "@angular/core"; -export var SidebarTransition = { - Overlay: "overlay", - Push: "push", - ScaleDown: "scale down", - Uncover: "uncover", - SlideAlong: "slide along", - SlideOut: "slide out" -}; -export var SidebarDirection = { - Left: "left", - Right: "right", - Top: "top", - Bottom: "bottom" -}; -var SidebarService = /** @class */ (function () { - function SidebarService(isVisible) { - if (isVisible === void 0) { isVisible = false; } - this.isVisible = isVisible; - this.isAnimating = false; - this.wasJustOpened = false; - this.isVisibleChange = new EventEmitter(); - this.widthChange = new EventEmitter(); - this.heightChange = new EventEmitter(); - this.width = 260; - this.height = 0; - this.transition = SidebarTransition.Uncover; - } - Object.defineProperty(SidebarService.prototype, "width", { - get: function () { - if (this.direction === SidebarDirection.Left) { - return this._width; - } - if (this.direction === SidebarDirection.Right) { - return -this._width; - } - return 0; - }, - set: function (width) { - this._width = width; - this.widthChange.emit(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SidebarService.prototype, "height", { - get: function () { - if (this.direction === SidebarDirection.Top) { - return this._height; - } - if (this.direction === SidebarDirection.Bottom) { - return -this._height; - } - return 0; - }, - set: function (height) { - this._height = height; - this.heightChange.emit(); - }, - enumerable: true, - configurable: true - }); - SidebarService.prototype.setVisibleState = function (isVisible) { - var _this = this; - if (this.isVisible !== isVisible) { - this.isVisible = isVisible; - this.isAnimating = true; - this.wasJustOpened = true; - this.isVisibleChange.emit(isVisible); - setTimeout(function () { return _this.wasJustOpened = false; }); - clearTimeout(this._isAnimatingTimeout); - this._isAnimatingTimeout = window.setTimeout(function () { return _this.isAnimating = false; }, 500); - } - }; - SidebarService.prototype.toggleVisibleState = function () { - this.setVisibleState(!this.isVisible); - }; - return SidebarService; -}()); -export { SidebarService }; -//# sourceMappingURL=sidebar.service.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/services/sidebar.service.js.map b/dist/modules/sidebar/services/sidebar.service.js.map deleted file mode 100644 index 292c3b2dc..000000000 --- a/dist/modules/sidebar/services/sidebar.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sidebar.service.js","sourceRoot":"","sources":["../../../../src/modules/sidebar/services/sidebar.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAI7C,MAAM,CAAC,IAAM,iBAAiB,GAAG;IAC7B,OAAO,EAAE,SAA8B;IACvC,IAAI,EAAE,MAA2B;IACjC,SAAS,EAAE,YAAiC;IAC5C,OAAO,EAAE,SAA8B;IACvC,UAAU,EAAE,aAAkC;IAC9C,QAAQ,EAAE,WAAgC;CAC7C,CAAC;AAIF,MAAM,CAAC,IAAM,gBAAgB,GAAG;IAC5B,IAAI,EAAE,MAA0B;IAChC,KAAK,EAAE,OAA2B;IAClC,GAAG,EAAE,KAAyB;IAC9B,MAAM,EAAE,QAA4B;CACvC,CAAC;AAEF,IAAA;IAgDI,wBAAY,SAAyB;QAAzB,0BAAA,EAAA,iBAAyB;QACjC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAE3B,IAAI,CAAC,eAAe,GAAG,IAAI,YAAY,EAAW,CAAC;QACnD,IAAI,CAAC,WAAW,GAAG,IAAI,YAAY,EAAQ,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,EAAQ,CAAC;QAE7C,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAEhB,IAAI,CAAC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B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAErC,UAAU,CAAC,cAAM,OAAA,KAAI,CAAC,aAAa,GAAG,KAAK,EAA1B,CAA0B,CAAC,CAAC;YAC7C,YAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACvC,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,UAAU,CAAC,cAAM,OAAA,KAAI,CAAC,WAAW,GAAG,KAAK,EAAxB,CAAwB,EAAE,GAAG,CAAC,CAAC;SACrF;KACJ;IAEM,2CAAkB,GAAzB;QACI,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACzC;yBArGL;IAsGC,CAAA;AAhFD,0BAgFC","sourcesContent":["import { EventEmitter } from \"@angular/core\";\n\nexport type SidebarTransition = \"overlay\" | \"push\" | \"scale down\" | \"uncover\" | \"slide along\" | \"slide out\";\n\nexport const SidebarTransition = {\n Overlay: \"overlay\" as SidebarTransition,\n Push: \"push\" as SidebarTransition,\n ScaleDown: \"scale down\" as SidebarTransition,\n Uncover: \"uncover\" as SidebarTransition,\n SlideAlong: \"slide along\" as SidebarTransition,\n SlideOut: \"slide out\" as SidebarTransition\n};\n\nexport type SidebarDirection = \"left\" | \"right\" | \"top\" | \"bottom\";\n\nexport const SidebarDirection = {\n Left: \"left\" as SidebarDirection,\n Right: \"right\" as SidebarDirection,\n Top: \"top\" as SidebarDirection,\n Bottom: \"bottom\" as SidebarDirection\n};\n\nexport class SidebarService {\n public isVisible:boolean;\n public isAnimating:boolean;\n public wasJustOpened:boolean;\n\n public direction:SidebarDirection;\n\n private _width:number;\n private _height:number;\n\n public get width():number {\n if (this.direction === SidebarDirection.Left) {\n return this._width;\n }\n if (this.direction === SidebarDirection.Right) {\n return -this._width;\n }\n return 0;\n }\n\n public set width(width:number) {\n this._width = width;\n this.widthChange.emit();\n }\n\n public get height():number {\n if (this.direction === SidebarDirection.Top) {\n return this._height;\n }\n if (this.direction === SidebarDirection.Bottom) {\n return -this._height;\n }\n return 0;\n }\n\n public set height(height:number) {\n this._height = height;\n this.heightChange.emit();\n }\n\n public isVisibleChange:EventEmitter;\n public widthChange:EventEmitter;\n public heightChange:EventEmitter;\n\n private _isAnimatingTimeout:number;\n\n public transition:SidebarTransition;\n\n constructor(isVisible:boolean = false) {\n this.isVisible = isVisible;\n this.isAnimating = false;\n this.wasJustOpened = false;\n\n this.isVisibleChange = new EventEmitter();\n this.widthChange = new EventEmitter();\n this.heightChange = new EventEmitter();\n\n this.width = 260;\n this.height = 0;\n\n this.transition = SidebarTransition.Uncover;\n }\n\n public setVisibleState(isVisible:boolean):void {\n if (this.isVisible !== isVisible) {\n this.isVisible = isVisible;\n this.isAnimating = true;\n this.wasJustOpened = true;\n\n this.isVisibleChange.emit(isVisible);\n\n setTimeout(() => this.wasJustOpened = false);\n clearTimeout(this._isAnimatingTimeout);\n this._isAnimatingTimeout = window.setTimeout(() => this.isAnimating = false, 500);\n }\n }\n\n public toggleVisibleState():void {\n this.setVisibleState(!this.isVisible);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/services/sidebar.service.metadata.json b/dist/modules/sidebar/services/sidebar.service.metadata.json deleted file mode 100644 index 0b9badc31..000000000 --- a/dist/modules/sidebar/services/sidebar.service.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SidebarTransition":{"Overlay":"overlay","Push":"push","ScaleDown":"scale down","Uncover":"uncover","SlideAlong":"slide along","SlideOut":"slide out"},"SidebarDirection":{"Left":"left","Right":"right","Top":"top","Bottom":"bottom"},"SidebarService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"boolean"}]}],"setVisibleState":[{"__symbolic":"method"}],"toggleVisibleState":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/sidebar/sidebar.module.d.ts b/dist/modules/sidebar/sidebar.module.d.ts deleted file mode 100644 index e5fe163b4..000000000 --- a/dist/modules/sidebar/sidebar.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiSidebarModule { -} diff --git a/dist/modules/sidebar/sidebar.module.js b/dist/modules/sidebar/sidebar.module.js deleted file mode 100644 index b93ec8730..000000000 --- a/dist/modules/sidebar/sidebar.module.js +++ /dev/null @@ -1,31 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiSidebar } from "./components/sidebar"; -import { SuiSidebarContainer } from "./components/sidebar-container"; -import { SuiSidebarSibling } from "./components/sidebar-sibling"; -var SuiSidebarModule = /** @class */ (function () { - function SuiSidebarModule() { - } - SuiSidebarModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule - ], - declarations: [ - SuiSidebar, - SuiSidebarContainer, - SuiSidebarSibling - ], - exports: [ - SuiSidebar, - SuiSidebarContainer, - SuiSidebarSibling - ] - },] }, - ]; - /** @nocollapse */ - SuiSidebarModule.ctorParameters = function () { return []; }; - return SuiSidebarModule; -}()); -export { SuiSidebarModule }; -//# sourceMappingURL=sidebar.module.js.map \ No newline at end of file diff --git a/dist/modules/sidebar/sidebar.module.js.map b/dist/modules/sidebar/sidebar.module.js.map deleted file mode 100644 index fa6175436..000000000 --- a/dist/modules/sidebar/sidebar.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sidebar.module.js","sourceRoot":"","sources":["../../../src/modules/sidebar/sidebar.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;;;;;gBAEhE,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;qBACf;oBACD,YAAY,EAAE;wBACV,UAAU;wBACV,mBAAmB;wBACnB,iBAAiB;qBACpB;oBACD,OAAO,EAAE;wBACL,UAAU;wBACV,mBAAmB;wBACnB,iBAAiB;qBACpB;iBACJ;;;;2BApBD;;SAqBa,gBAAgB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiSidebar } from \"./components/sidebar\";\nimport { SuiSidebarContainer } from \"./components/sidebar-container\";\nimport { SuiSidebarSibling } from \"./components/sidebar-sibling\";\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n SuiSidebar,\n SuiSidebarContainer,\n SuiSidebarSibling\n ],\n exports: [\n SuiSidebar,\n SuiSidebarContainer,\n SuiSidebarSibling\n ]\n})\nexport class SuiSidebarModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/sidebar/sidebar.module.metadata.json b/dist/modules/sidebar/sidebar.module.metadata.json deleted file mode 100644 index f0f6644af..000000000 --- a/dist/modules/sidebar/sidebar.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiSidebarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/sidebar","name":"SuiSidebar","line":11,"character":8},{"__symbolic":"reference","module":"./components/sidebar-container","name":"SuiSidebarContainer","line":12,"character":8},{"__symbolic":"reference","module":"./components/sidebar-sibling","name":"SuiSidebarSibling","line":13,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/sidebar","name":"SuiSidebar","line":16,"character":8},{"__symbolic":"reference","module":"./components/sidebar-container","name":"SuiSidebarContainer","line":17,"character":8},{"__symbolic":"reference","module":"./components/sidebar-sibling","name":"SuiSidebarSibling","line":18,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/tabs/classes/tab.d.ts b/dist/modules/tabs/classes/tab.d.ts deleted file mode 100644 index ceb6e815a..000000000 --- a/dist/modules/tabs/classes/tab.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { SuiTabHeader } from "../directives/tab-header"; -import { SuiTabContent } from "../directives/tab-content"; -export declare class Tab { - id: string; - header: SuiTabHeader; - content: SuiTabContent; - index: number; - constructor(header: SuiTabHeader, content: SuiTabContent); - isActive: boolean; - readonly isDisabled: boolean; -} diff --git a/dist/modules/tabs/classes/tab.js b/dist/modules/tabs/classes/tab.js deleted file mode 100644 index f1e6d1c3f..000000000 --- a/dist/modules/tabs/classes/tab.js +++ /dev/null @@ -1,38 +0,0 @@ -var Tab = /** @class */ (function () { - function Tab(header, content) { - var _this = this; - this.id = header.id; - this.header = header; - this.content = content; - // So that the header and content isActive properties are always in sync. - this.header.isActiveChange - .subscribe(function () { return _this.content.isActive = _this.isActive; }); - } - Object.defineProperty(Tab.prototype, "isActive", { - // Saves accessing .header.isActive every time. - get: - // Saves accessing .header.isActive every time. - function () { - return this.header.isActive; - }, - set: function (active) { - // Use `setActiveState` so as not to fire 'external changes' event. - this.header.setActiveState(active); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Tab.prototype, "isDisabled", { - // Saves accessing .header.isDisabled every time. - get: - // Saves accessing .header.isDisabled every time. - function () { - return this.header.isDisabled; - }, - enumerable: true, - configurable: true - }); - return Tab; -}()); -export { Tab }; -//# sourceMappingURL=tab.js.map \ No newline at end of file diff --git a/dist/modules/tabs/classes/tab.js.map b/dist/modules/tabs/classes/tab.js.map deleted file mode 100644 index 6c496e839..000000000 --- a/dist/modules/tabs/classes/tab.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tab.js","sourceRoot":"","sources":["../../../../src/modules/tabs/classes/tab.ts"],"names":[],"mappings":"AAGA,IAAA;IAMI,aAAY,MAAmB,EAAE,OAAqB;QAAtD,iBAQC;QAPG,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;QAGvB,IAAI,CAAC,MAAM,CAAC,cAAc;aACrB,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,KAAI,CAAC,QAAQ,EAArC,CAAqC,CAAC,CAAC;KAC/D;IAGD,sBAAW,yBAAQ;QADnB,+CAA+C;;;QAC/C;YACI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;SAC/B;aAED,UAAoB,MAAc;;YAE9B,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;SACtC;;;OALA;IAQD,sBAAW,2BAAU;QADrB,iDAAiD;;;QACjD;YACI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;SACjC;;;OAAA;cAhCL;IAiCC,CAAA;AA9BD,eA8BC","sourcesContent":["import { SuiTabHeader } from \"../directives/tab-header\";\nimport { SuiTabContent } from \"../directives/tab-content\";\n\nexport class Tab {\n public id:string;\n public header:SuiTabHeader;\n public content:SuiTabContent;\n public index:number;\n\n constructor(header:SuiTabHeader, content:SuiTabContent) {\n this.id = header.id;\n this.header = header;\n this.content = content;\n\n // So that the header and content isActive properties are always in sync.\n this.header.isActiveChange\n .subscribe(() => this.content.isActive = this.isActive);\n }\n\n // Saves accessing .header.isActive every time.\n public get isActive():boolean {\n return this.header.isActive;\n }\n\n public set isActive(active:boolean) {\n // Use `setActiveState` so as not to fire 'external changes' event.\n this.header.setActiveState(active);\n }\n\n // Saves accessing .header.isDisabled every time.\n public get isDisabled():boolean {\n return this.header.isDisabled;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/classes/tab.metadata.json b/dist/modules/tabs/classes/tab.metadata.json deleted file mode 100644 index 9c19e4315..000000000 --- a/dist/modules/tabs/classes/tab.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"Tab":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../directives/tab-header","name":"SuiTabHeader","line":9,"character":23},{"__symbolic":"reference","module":"../directives/tab-content","name":"SuiTabContent","line":9,"character":45}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/tabs/components/tabset.d.ts b/dist/modules/tabs/components/tabset.d.ts deleted file mode 100644 index ccc7783a8..000000000 --- a/dist/modules/tabs/components/tabset.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AfterContentInit } from "@angular/core"; -import { Tab } from "../classes/tab"; -export declare class SuiTabset implements AfterContentInit { - private _tabHeaders; - private _tabContents; - tabs: Tab[]; - private _activeTab; - activeTab: Tab; - private _barrierCount; - constructor(); - ngAfterContentInit(): void; - private internalComponentsUpdated(); - private loadTabs(); - private onHeaderActiveChanged(tab); - activateFirstTab(): void; - activateClosestTab(tab: Tab): void; -} diff --git a/dist/modules/tabs/components/tabset.js b/dist/modules/tabs/components/tabset.js deleted file mode 100644 index ed478501a..000000000 --- a/dist/modules/tabs/components/tabset.js +++ /dev/null @@ -1,170 +0,0 @@ -import { Component, ContentChildren, QueryList } from "@angular/core"; -import { SuiTabHeader } from "../directives/tab-header"; -import { SuiTabContent } from "../directives/tab-content"; -import { Tab } from "../classes/tab"; -var SuiTabset = /** @class */ (function () { - function SuiTabset() { - this.tabs = []; - this._barrierCount = 0; - } - Object.defineProperty(SuiTabset.prototype, "activeTab", { - get: function () { - return this._activeTab; - }, - // When setting a tab as the currently active tab, it automatically gains - // `isActive` status (saves littering `isActive = true` everywhere). - set: - // When setting a tab as the currently active tab, it automatically gains - // `isActive` status (saves littering `isActive = true` everywhere). - function (tab) { - this._activeTab = tab; - tab.isActive = true; - }, - enumerable: true, - configurable: true - }); - SuiTabset.prototype.ngAfterContentInit = function () { - var _this = this; - // Fire `internalComponentsUpdated` when the query lists change. - this._tabHeaders.changes.subscribe(function () { return _this.internalComponentsUpdated(); }); - this._tabContents.changes.subscribe(function () { return _this.internalComponentsUpdated(); }); - // Initially load the tabs. - this.loadTabs(); - }; - // Fires whenever either the tab headers or tab contents query lists update. - // Fires whenever either the tab headers or tab contents query lists update. - SuiTabset.prototype.internalComponentsUpdated = - // Fires whenever either the tab headers or tab contents query lists update. - function () { - // We are using a 'counting barrier of n = 2', i.e. the code within only runs after the method is called twice. - // This is so that both the headers and contents query lists can update before we run code that matches the two up. - this._barrierCount++; - if (this._barrierCount === 2) { - // Reset the barrier so it can be called again. - this._barrierCount = 0; - // Update the tabs. - this.loadTabs(); - } - }; - // Connects tab headers to tab contents, and creates a tab instance for each pairing. - // Connects tab headers to tab contents, and creates a tab instance for each pairing. - SuiTabset.prototype.loadTabs = - // Connects tab headers to tab contents, and creates a tab instance for each pairing. - function () { - var _this = this; - // Remove any tabs that no longer have an associated header. - this.tabs = this.tabs.filter(function (t) { return !!_this._tabHeaders.find(function (tH) { return tH === t.header; }); }); - this._tabHeaders - .filter(function (tH) { return !_this.tabs.find(function (t) { return t.header === tH; }); }) - .forEach(function (tH) { - var content = _this._tabContents.find(function (tC) { return tC.id === tH.id; }); - if (!content) { - // Error if an associated tab content cannot be found for the given header. - throw new Error("A [suiTabHeader] must have a related [suiTabContent]."); - } - // Create a new tab instance for this header & content combo. - var tab = new Tab(tH, content); - // Subscribe to any external changes in the tab header's active state. External changes are triggered by user input. - tab.header.isActiveExternalChange.subscribe(function () { return _this.onHeaderActiveChanged(tab); }); - // Add the new instance to the list of tabs. - // Add the new instance to the list of tabs. - _this.tabs.push(tab); - }); - // Assign each tab an index (which denotes the order they physically appear in). - this._tabHeaders - .forEach(function (tH, i) { - var tab = _this.tabs.find(function (t) { return t.header === tH; }); - if (tab) { - tab.index = i; - } - }); - // Sort the tabs by their index. - this.tabs.sort(function (a, b) { return a.index - b.index; }); - if (!this.activeTab) { - // Check if there are no current existing active tabs. - // If so, we must activate the first available tab. - this.activateFirstTab(); - } - else if (!this.tabs.find(function (t) { return t === _this.activeTab; })) { - // O'wise check if current active tab has been deleted. - // If so, we must find the closest. - // Use `setTimeout` as this causes a 'changed after checked' error o'wise. - setTimeout(function () { return _this.activateClosestTab(_this.activeTab); }); - } - if (this.tabs.length === 0) { - // Error if there aren't any tabs in the tabset. - throw new Error("You cannot have no tabs!"); - } - }; - // Fires whenever a tab header's active state is externally changed. - // Fires whenever a tab header's active state is externally changed. - SuiTabset.prototype.onHeaderActiveChanged = - // Fires whenever a tab header's active state is externally changed. - function (tab) { - // If the tab has become activated, but was not previously the active tab: - if (tab.isActive && this.activeTab !== tab) { - // Deactivate all of the tabs. - this.tabs.filter(function (t) { return t !== tab; }).forEach(function (t) { return t.isActive = false; }); - // Set the currently active tab to this one. - this.activeTab = tab; - } - // If the tab has become deactivated, but was previously the active tab: - if (!tab.isActive && this.activeTab === tab) { - // Activate the closest tab to it. - this.activateClosestTab(tab); - } - }; - // Activate the first tab in the set. - // Activate the first tab in the set. - SuiTabset.prototype.activateFirstTab = - // Activate the first tab in the set. - function () { - this.activeTab = this.tabs[0]; - }; - // Activates the closest available tab to a given one. - // Activates the closest available tab to a given one. - SuiTabset.prototype.activateClosestTab = - // Activates the closest available tab to a given one. - function (tab) { - var nextAvailable; - // When the exited tab's index is higher than all available tabs, - if (tab.index >= this.tabs.length) { - // Activate the last tab. - nextAvailable = this.tabs[this.tabs.length - 1]; - } - // If that didn't work, try the following cases: - if (!nextAvailable) { - if (!this.tabs.find(function (t) { return t === tab; })) { - // When the exited tab no longer exists, - // Replace it with a tab at the same index. - nextAvailable = this.tabs[tab.index]; - } - else { - // Or if the exited tab still exists, - // Go to the tab immediately to the left. - nextAvailable = this.tabs[Math.max(tab.index - 1, 0)]; - } - } - // However, if the chosen tab is disabled, - if (nextAvailable.isDisabled) { - // Activate the closest available tab to it. - return this.activateClosestTab(nextAvailable); - } - this.activeTab = nextAvailable; - }; - SuiTabset.decorators = [ - { type: Component, args: [{ - selector: "sui-tabset", - template: "" - },] }, - ]; - /** @nocollapse */ - SuiTabset.ctorParameters = function () { return []; }; - SuiTabset.propDecorators = { - "_tabHeaders": [{ type: ContentChildren, args: [SuiTabHeader,] },], - "_tabContents": [{ type: ContentChildren, args: [SuiTabContent,] },], - }; - return SuiTabset; -}()); -export { SuiTabset }; -//# sourceMappingURL=tabset.js.map \ No newline at end of file diff --git a/dist/modules/tabs/components/tabset.js.map b/dist/modules/tabs/components/tabset.js.map deleted file mode 100644 index 1df2dc9ae..000000000 --- a/dist/modules/tabs/components/tabset.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tabset.js","sourceRoot":"","sources":["../../../../src/modules/tabs/components/tabset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAoB,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;;IAiCjC;QACI,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;KAC1B;IAjBD,sBAAW,gCAAS;aAApB;YACI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;SAC1B;QAED,yEAAyE;QACzE,oEAAoE;;;;QACpE,UAAqB,GAAO;YACxB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;YACtB,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC;SACvB;;;OAPA;IAiBM,sCAAkB,GAAzB;QAAA,iBAOC;;QALG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,yBAAyB,EAAE,EAAhC,CAAgC,CAAC,CAAC;QAC3E,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAA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C;aACxC;YAAC,IAAI,CAAC,CAAC;;;gBAEJ,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;aACzD;SACJ;;QAGD,EAAE,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;;YAE3B,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;SACjD;QAED,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;KAClC;;gBArKJ,SAAS,SAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,2BAA2B;iBACxC;;;;;gCAEI,eAAe,SAAC,YAAY;iCAG5B,eAAe,SAAC,aAAa;;oBAblC;;SASa,SAAS","sourcesContent":["import { Component, ContentChildren, QueryList, AfterContentInit } from \"@angular/core\";\nimport { SuiTabHeader } from \"../directives/tab-header\";\nimport { SuiTabContent } from \"../directives/tab-content\";\nimport { Tab } from \"../classes/tab\";\n\n@Component({\n selector: \"sui-tabset\",\n template: ``\n})\nexport class SuiTabset implements AfterContentInit {\n @ContentChildren(SuiTabHeader)\n private _tabHeaders:QueryList;\n\n @ContentChildren(SuiTabContent)\n private _tabContents:QueryList;\n\n // List of all tabs in the tabset.\n public tabs:Tab[];\n\n // Keeps track of the currently active tab.\n private _activeTab:Tab;\n\n public get activeTab():Tab {\n return this._activeTab;\n }\n\n // When setting a tab as the currently active tab, it automatically gains\n // `isActive` status (saves littering `isActive = true` everywhere).\n public set activeTab(tab:Tab) {\n this._activeTab = tab;\n tab.isActive = true;\n }\n\n // Keeps track of the number of times `internalComponentsUpdated` is called.\n private _barrierCount:number;\n\n constructor() {\n this.tabs = [];\n this._barrierCount = 0;\n }\n\n public ngAfterContentInit():void {\n // Fire `internalComponentsUpdated` when the query lists change.\n this._tabHeaders.changes.subscribe(() => this.internalComponentsUpdated());\n this._tabContents.changes.subscribe(() => this.internalComponentsUpdated());\n\n // Initially load the tabs.\n this.loadTabs();\n }\n\n // Fires whenever either the tab headers or tab contents query lists update.\n private internalComponentsUpdated():void {\n // We are using a 'counting barrier of n = 2', i.e. the code within only runs after the method is called twice.\n // This is so that both the headers and contents query lists can update before we run code that matches the two up.\n this._barrierCount++;\n\n if (this._barrierCount === 2) {\n // Reset the barrier so it can be called again.\n this._barrierCount = 0;\n\n // Update the tabs.\n this.loadTabs();\n }\n }\n\n // Connects tab headers to tab contents, and creates a tab instance for each pairing.\n private loadTabs():void {\n // Remove any tabs that no longer have an associated header.\n this.tabs = this.tabs.filter(t => !!this._tabHeaders.find(tH => tH === t.header));\n\n this._tabHeaders\n // Filter out the loaded headers with attached tab instances.\n .filter(tH => !this.tabs.find(t => t.header === tH))\n .forEach(tH => {\n const content = this._tabContents.find(tC => tC.id === tH.id);\n\n if (!content) {\n // Error if an associated tab content cannot be found for the given header.\n throw new Error(\"A [suiTabHeader] must have a related [suiTabContent].\");\n }\n\n // Create a new tab instance for this header & content combo.\n const tab = new Tab(tH, content);\n\n // Subscribe to any external changes in the tab header's active state. External changes are triggered by user input.\n tab.header.isActiveExternalChange.subscribe(() => this.onHeaderActiveChanged(tab));\n\n // Add the new instance to the list of tabs.\n this.tabs.push(tab);\n });\n\n // Assign each tab an index (which denotes the order they physically appear in).\n this._tabHeaders\n .forEach((tH, i) => {\n const tab = this.tabs.find(t => t.header === tH);\n if (tab) {\n tab.index = i;\n }\n });\n\n // Sort the tabs by their index.\n this.tabs.sort((a, b) => a.index - b.index);\n\n\n if (!this.activeTab) { // Check if there are no current existing active tabs.\n // If so, we must activate the first available tab.\n this.activateFirstTab();\n } else if (!this.tabs.find(t => t === this.activeTab)) { // O'wise check if current active tab has been deleted.\n // If so, we must find the closest.\n // Use `setTimeout` as this causes a 'changed after checked' error o'wise.\n setTimeout(() => this.activateClosestTab(this.activeTab));\n }\n\n if (this.tabs.length === 0) {\n // Error if there aren't any tabs in the tabset.\n throw new Error(\"You cannot have no tabs!\");\n }\n }\n\n // Fires whenever a tab header's active state is externally changed.\n private onHeaderActiveChanged(tab:Tab):void {\n // If the tab has become activated, but was not previously the active tab:\n if (tab.isActive && this.activeTab !== tab) {\n // Deactivate all of the tabs.\n this.tabs.filter(t => t !== tab).forEach(t => t.isActive = false);\n\n // Set the currently active tab to this one.\n this.activeTab = tab;\n }\n\n // If the tab has become deactivated, but was previously the active tab:\n if (!tab.isActive && this.activeTab === tab) {\n // Activate the closest tab to it.\n this.activateClosestTab(tab);\n }\n }\n\n // Activate the first tab in the set.\n public activateFirstTab():void {\n this.activeTab = this.tabs[0];\n }\n\n // Activates the closest available tab to a given one.\n public activateClosestTab(tab:Tab):void {\n let nextAvailable:Tab | undefined;\n\n // When the exited tab's index is higher than all available tabs,\n if (tab.index >= this.tabs.length) {\n // Activate the last tab.\n nextAvailable = this.tabs[this.tabs.length - 1];\n }\n\n // If that didn't work, try the following cases:\n if (!nextAvailable) {\n if (!this.tabs.find(t => t === tab)) { // When the exited tab no longer exists,\n // Replace it with a tab at the same index.\n nextAvailable = this.tabs[tab.index];\n } else { // Or if the exited tab still exists,\n // Go to the tab immediately to the left.\n nextAvailable = this.tabs[Math.max(tab.index - 1, 0)];\n }\n }\n\n // However, if the chosen tab is disabled,\n if (nextAvailable.isDisabled) {\n // Activate the closest available tab to it.\n return this.activateClosestTab(nextAvailable);\n }\n\n this.activeTab = nextAvailable;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/components/tabset.metadata.json b/dist/modules/tabs/components/tabset.metadata.json deleted file mode 100644 index 0eac6359d..000000000 --- a/dist/modules/tabs/components/tabset.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiTabset":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"sui-tabset","template":""}]}],"members":{"_tabHeaders":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":10,"character":5},"arguments":[{"__symbolic":"reference","module":"../directives/tab-header","name":"SuiTabHeader","line":10,"character":21}]}]}],"_tabContents":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":13,"character":5},"arguments":[{"__symbolic":"reference","module":"../directives/tab-content","name":"SuiTabContent","line":13,"character":21}]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngAfterContentInit":[{"__symbolic":"method"}],"internalComponentsUpdated":[{"__symbolic":"method"}],"loadTabs":[{"__symbolic":"method"}],"onHeaderActiveChanged":[{"__symbolic":"method"}],"activateFirstTab":[{"__symbolic":"method"}],"activateClosestTab":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-content.d.ts b/dist/modules/tabs/directives/tab-content.d.ts deleted file mode 100644 index 9071c8847..000000000 --- a/dist/modules/tabs/directives/tab-content.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare class SuiTabContent { - private _contentClasses; - id: string; - isActive: boolean; - constructor(); -} diff --git a/dist/modules/tabs/directives/tab-content.js b/dist/modules/tabs/directives/tab-content.js deleted file mode 100644 index 70e482784..000000000 --- a/dist/modules/tabs/directives/tab-content.js +++ /dev/null @@ -1,22 +0,0 @@ -import { HostBinding, Directive, Input } from "@angular/core"; -var SuiTabContent = /** @class */ (function () { - function SuiTabContent() { - this.isActive = false; - this._contentClasses = true; - } - SuiTabContent.decorators = [ - { type: Directive, args: [{ - selector: "[suiTabContent]" - },] }, - ]; - /** @nocollapse */ - SuiTabContent.ctorParameters = function () { return []; }; - SuiTabContent.propDecorators = { - "_contentClasses": [{ type: HostBinding, args: ["class.tab",] },], - "id": [{ type: Input, args: ["suiTabContent",] },], - "isActive": [{ type: HostBinding, args: ["class.active",] },], - }; - return SuiTabContent; -}()); -export { SuiTabContent }; -//# sourceMappingURL=tab-content.js.map \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-content.js.map b/dist/modules/tabs/directives/tab-content.js.map deleted file mode 100644 index 55c193c88..000000000 --- a/dist/modules/tabs/directives/tab-content.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tab-content.js","sourceRoot":"","sources":["../../../../src/modules/tabs/directives/tab-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;IAe1D;QACI,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;KAC/B;;gBAjBJ,SAAS,SAAC;oBACP,QAAQ,EAAE,iBAAiB;iBAC9B;;;;;oCAEI,WAAW,SAAC,WAAW;uBAGvB,KAAK,SAAC,eAAe;6BAGrB,WAAW,SAAC,cAAc;;wBAZ/B;;SAKa,aAAa","sourcesContent":["import { HostBinding, Directive, Input } from \"@angular/core\";\n\n@Directive({\n selector: \"[suiTabContent]\"\n})\nexport class SuiTabContent {\n @HostBinding(\"class.tab\")\n private _contentClasses:boolean;\n\n @Input(\"suiTabContent\")\n public id:string;\n\n @HostBinding(\"class.active\")\n public isActive:boolean;\n\n constructor() {\n this.isActive = false;\n\n this._contentClasses = true;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-content.metadata.json b/dist/modules/tabs/directives/tab-content.metadata.json deleted file mode 100644 index 84186728a..000000000 --- a/dist/modules/tabs/directives/tab-content.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiTabContent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[suiTabContent]"}]}],"members":{"_contentClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":6,"character":5},"arguments":["class.tab"]}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":5},"arguments":["suiTabContent"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":12,"character":5},"arguments":["class.active"]}]}],"__ctor__":[{"__symbolic":"constructor"}]}}}}] \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-header.d.ts b/dist/modules/tabs/directives/tab-header.d.ts deleted file mode 100644 index b9943a1b5..000000000 --- a/dist/modules/tabs/directives/tab-header.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { EventEmitter } from "@angular/core"; -export declare class SuiTabHeader { - private _headerClasses; - id: string; - private _isActive; - isActiveChange: EventEmitter; - isActiveExternalChange: EventEmitter; - onActivate: EventEmitter; - onDeactivate: EventEmitter; - isActive: boolean; - private _isDisabled; - isDisabled: boolean; - constructor(); - setActiveState(active: boolean): void; - private onClick(); -} diff --git a/dist/modules/tabs/directives/tab-header.js b/dist/modules/tabs/directives/tab-header.js deleted file mode 100644 index 5626759bb..000000000 --- a/dist/modules/tabs/directives/tab-header.js +++ /dev/null @@ -1,97 +0,0 @@ -import { HostBinding, Input, Directive, EventEmitter, HostListener, Output } from "@angular/core"; -var SuiTabHeader = /** @class */ (function () { - function SuiTabHeader() { - this._isActive = false; - this.isActiveChange = new EventEmitter(); - this.isActiveExternalChange = new EventEmitter(); - this.onActivate = new EventEmitter(); - this.onDeactivate = new EventEmitter(); - this.isDisabled = false; - this._headerClasses = true; - } - Object.defineProperty(SuiTabHeader.prototype, "isActive", { - get: function () { - return this._isActive; - }, - set: function (active) { - var _this = this; - var isActive = active; - // Only used by @Input(), runs whenever user input changes `isActive`. - // Run in timeout because `isDisabled` can prohibit user from changing `isActive`. - // so update is delayed to avoid 'changed after checked' error. - setTimeout(function () { - // Only allow change if tab header is not disabled. - isActive = !_this.isDisabled ? active : false; - _this.setActiveState(isActive); - // Fire 'external change' event as user input has occured. - // Fire 'external change' event as user input has occured. - _this.isActiveExternalChange.emit(isActive); - }); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiTabHeader.prototype, "isDisabled", { - get: function () { - return this._isDisabled; - }, - set: function (disabled) { - // Only update if value provided is different to current one. - if (this._isDisabled !== disabled) { - this._isDisabled = disabled; - // If now disabled, then tab header must be deactivated. - if (this.isDisabled) { - this.isActive = false; - } - } - }, - enumerable: true, - configurable: true - }); - // Internally update active state. - // Internally update active state. - SuiTabHeader.prototype.setActiveState = - // Internally update active state. - function (active) { - // If (cast) active value has changed: - if (!!this._isActive !== active) { - // Update to the new value. - this._isActive = active; - // Fire the appropriate activation event. - if (active) { - this.onActivate.emit(); - } - else { - this.onDeactivate.emit(); - } - } - // Regardless, emit a change to `isActive`, so [(isActive)] works correctly. - this.isActiveChange.emit(active); - }; - SuiTabHeader.prototype.onClick = function () { - if (!this.isDisabled) { - // Activate the tab when clicked, so long as it isn't disabled. - this.isActive = true; - } - }; - SuiTabHeader.decorators = [ - { type: Directive, args: [{ - selector: "[suiTabHeader]" - },] }, - ]; - /** @nocollapse */ - SuiTabHeader.ctorParameters = function () { return []; }; - SuiTabHeader.propDecorators = { - "_headerClasses": [{ type: HostBinding, args: ["class.item",] },], - "id": [{ type: Input, args: ["suiTabHeader",] },], - "isActiveChange": [{ type: Output },], - "onActivate": [{ type: Output, args: ["activate",] },], - "onDeactivate": [{ type: Output, args: ["deactivate",] },], - "isActive": [{ type: HostBinding, args: ["class.active",] }, { type: Input },], - "isDisabled": [{ type: HostBinding, args: ["class.disabled",] }, { type: Input },], - "onClick": [{ type: HostListener, args: ["click",] },], - }; - return SuiTabHeader; -}()); -export { SuiTabHeader }; -//# sourceMappingURL=tab-header.js.map \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-header.js.map b/dist/modules/tabs/directives/tab-header.js.map deleted file mode 100644 index ce6c9d9df..000000000 --- a/dist/modules/tabs/directives/tab-header.js.map +++ /dev/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AC,UAAU,CAAC,CAAC,CAAC;oBAClB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;iBACzB;aACJ;SACJ;;;;IAeD,kCAAkC;;IAC3B,qCAAc;;IAArB,UAAsB,MAAc;;QAEhC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC;;YAE9B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;;YAGxB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;gBACT,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;aAC1B;YAAC,IAAI,CAAC,CAAC;gBACJ,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;aAC5B;SACJ;;QAGD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KACpC;IAGO,8BAAO;QACX,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;;YAEnB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;SACxB;;;gBA1GR,SAAS,SAAC;oBACP,QAAQ,EAAE,gBAAgB;iBAC7B;;;;;mCAEI,WAAW,SAAC,YAAY;uBAGxB,KAAK,SAAC,cAAc;mCAOpB,MAAM;+BAON,MAAM,SAAC,UAAU;iCAIjB,MAAM,SAAC,YAAY;6BAGnB,WAAW,SAAC,cAAc,cAC1B,KAAK;+BAsBL,WAAW,SAAC,gBAAgB,cAC5B,KAAK;4BAiDL,YAAY,SAAC,OAAO;;uBAvGzB;;SAKa,YAAY","sourcesContent":["import { HostBinding, Input, Directive, EventEmitter, HostListener, Output } from \"@angular/core\";\n\n@Directive({\n selector: \"[suiTabHeader]\"\n})\nexport class SuiTabHeader {\n @HostBinding(\"class.item\")\n private _headerClasses:boolean;\n\n @Input(\"suiTabHeader\")\n public id:string;\n\n // Internally keeps track of whether the header is active.\n private _isActive:boolean;\n\n // Enables use of [(isActive)] so state can be set using booleans.\n @Output()\n public isActiveChange:EventEmitter;\n\n // Fires only when `isActive` changes due to user input.\n public isActiveExternalChange:EventEmitter;\n\n // Fires whenever a tab is activated having previously been deactivated.\n @Output(\"activate\")\n public onActivate:EventEmitter;\n\n // Fires whenever a tab is deactivated having previously been activated.\n @Output(\"deactivate\")\n public onDeactivate:EventEmitter;\n\n @HostBinding(\"class.active\")\n @Input()\n public get isActive():boolean {\n return this._isActive;\n }\n\n public set isActive(active:boolean) {\n let isActive = active;\n // Only used by @Input(), runs whenever user input changes `isActive`.\n // Run in timeout because `isDisabled` can prohibit user from changing `isActive`.\n // so update is delayed to avoid 'changed after checked' error.\n setTimeout(() => {\n // Only allow change if tab header is not disabled.\n isActive = !this.isDisabled ? active : false;\n this.setActiveState(isActive);\n\n // Fire 'external change' event as user input has occured.\n this.isActiveExternalChange.emit(isActive);\n });\n }\n\n private _isDisabled:boolean;\n\n @HostBinding(\"class.disabled\")\n @Input()\n public get isDisabled():boolean {\n return this._isDisabled;\n }\n\n public set isDisabled(disabled:boolean) {\n // Only update if value provided is different to current one.\n if (this._isDisabled !== disabled) {\n this._isDisabled = disabled;\n\n // If now disabled, then tab header must be deactivated.\n if (this.isDisabled) {\n this.isActive = false;\n }\n }\n }\n\n constructor() {\n this._isActive = false;\n this.isActiveChange = new EventEmitter();\n this.isActiveExternalChange = new EventEmitter();\n\n this.onActivate = new EventEmitter();\n this.onDeactivate = new EventEmitter();\n\n this.isDisabled = false;\n\n this._headerClasses = true;\n }\n\n // Internally update active state.\n public setActiveState(active:boolean):void {\n // If (cast) active value has changed:\n if (!!this._isActive !== active) {\n // Update to the new value.\n this._isActive = active;\n\n // Fire the appropriate activation event.\n if (active) {\n this.onActivate.emit();\n } else {\n this.onDeactivate.emit();\n }\n }\n\n // Regardless, emit a change to `isActive`, so [(isActive)] works correctly.\n this.isActiveChange.emit(active);\n }\n\n @HostListener(\"click\")\n private onClick():void {\n if (!this.isDisabled) {\n // Activate the tab when clicked, so long as it isn't disabled.\n this.isActive = true;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/directives/tab-header.metadata.json b/dist/modules/tabs/directives/tab-header.metadata.json deleted file mode 100644 index 2f2cf30d8..000000000 --- a/dist/modules/tabs/directives/tab-header.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiTabHeader":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[suiTabHeader]"}]}],"members":{"_headerClasses":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":6,"character":5},"arguments":["class.item"]}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":5},"arguments":["suiTabHeader"]}]}],"isActiveChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":16,"character":5}}]}],"onActivate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":23,"character":5},"arguments":["activate"]}]}],"onDeactivate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":27,"character":5},"arguments":["deactivate"]}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":30,"character":5},"arguments":["class.active"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":5}}]}],"isDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":53,"character":5},"arguments":["class.disabled"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":54,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor"}],"setActiveState":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":103,"character":5},"arguments":["click"]}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/tabs/index.d.ts b/dist/modules/tabs/index.d.ts deleted file mode 100644 index 49e44a0f9..000000000 --- a/dist/modules/tabs/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./classes/tab"; -export * from "./components/tabset"; -export * from "./directives/tab-content"; -export * from "./directives/tab-header"; -export * from "./tab.module"; diff --git a/dist/modules/tabs/index.js b/dist/modules/tabs/index.js deleted file mode 100644 index b684fd921..000000000 --- a/dist/modules/tabs/index.js +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./classes/tab"; -export * from "./components/tabset"; -export * from "./directives/tab-content"; -export * from "./directives/tab-header"; -export * from "./tab.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/tabs/index.js.map b/dist/modules/tabs/index.js.map deleted file mode 100644 index bef18f76d..000000000 --- a/dist/modules/tabs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/tabs/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAE9B,cAAc,qBAAqB,CAAC;AAEpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AAExC,cAAc,cAAc,CAAC","sourcesContent":["export * from \"./classes/tab\";\n\nexport * from \"./components/tabset\";\n\nexport * from \"./directives/tab-content\";\nexport * from \"./directives/tab-header\";\n\nexport * from \"./tab.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/index.metadata.json b/dist/modules/tabs/index.metadata.json deleted file mode 100644 index 9922efcdc..000000000 --- a/dist/modules/tabs/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/tab"},{"from":"./components/tabset"},{"from":"./directives/tab-content"},{"from":"./directives/tab-header"},{"from":"./tab.module"}]}] \ No newline at end of file diff --git a/dist/modules/tabs/public.d.ts b/dist/modules/tabs/public.d.ts deleted file mode 100644 index 9cdba2925..000000000 --- a/dist/modules/tabs/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiTabsModule } from "./index"; diff --git a/dist/modules/tabs/public.js b/dist/modules/tabs/public.js deleted file mode 100644 index aa5d3195b..000000000 --- a/dist/modules/tabs/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiTabsModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/tabs/public.js.map b/dist/modules/tabs/public.js.map deleted file mode 100644 index d1ef321f1..000000000 --- a/dist/modules/tabs/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/tabs/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAChB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiTabsModule\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/public.metadata.json b/dist/modules/tabs/public.metadata.json deleted file mode 100644 index d87797ecf..000000000 --- a/dist/modules/tabs/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiTabsModule"]}]}] \ No newline at end of file diff --git a/dist/modules/tabs/tab.module.d.ts b/dist/modules/tabs/tab.module.d.ts deleted file mode 100644 index 2fd5fedba..000000000 --- a/dist/modules/tabs/tab.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiTabsModule { -} diff --git a/dist/modules/tabs/tab.module.js b/dist/modules/tabs/tab.module.js deleted file mode 100644 index 2513ab579..000000000 --- a/dist/modules/tabs/tab.module.js +++ /dev/null @@ -1,31 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiTabset } from "./components/tabset"; -import { SuiTabHeader } from "./directives/tab-header"; -import { SuiTabContent } from "./directives/tab-content"; -var SuiTabsModule = /** @class */ (function () { - function SuiTabsModule() { - } - SuiTabsModule.decorators = [ - { type: NgModule, args: [{ - imports: [ - CommonModule - ], - declarations: [ - SuiTabset, - SuiTabHeader, - SuiTabContent - ], - exports: [ - SuiTabset, - SuiTabHeader, - SuiTabContent - ] - },] }, - ]; - /** @nocollapse */ - SuiTabsModule.ctorParameters = function () { return []; }; - return SuiTabsModule; -}()); -export { SuiTabsModule }; -//# sourceMappingURL=tab.module.js.map \ No newline at end of file diff --git a/dist/modules/tabs/tab.module.js.map b/dist/modules/tabs/tab.module.js.map deleted file mode 100644 index 7635d8a63..000000000 --- a/dist/modules/tabs/tab.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tab.module.js","sourceRoot":"","sources":["../../../src/modules/tabs/tab.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;;;;;gBAExD,QAAQ,SAAC;oBACN,OAAO,EAAE;wBACL,YAAY;qBACf;oBACD,YAAY,EAAE;wBACV,SAAS;wBACT,YAAY;wBACZ,aAAa;qBAChB;oBACD,OAAO,EAAE;wBACL,SAAS;wBACT,YAAY;wBACZ,aAAa;qBAChB;iBACJ;;;;wBApBD;;SAqBa,aAAa","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTabset } from \"./components/tabset\";\nimport { SuiTabHeader } from \"./directives/tab-header\";\nimport { SuiTabContent } from \"./directives/tab-content\";\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n SuiTabset,\n SuiTabHeader,\n SuiTabContent\n ],\n exports: [\n SuiTabset,\n SuiTabHeader,\n SuiTabContent\n ]\n})\nexport class SuiTabsModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/tabs/tab.module.metadata.json b/dist/modules/tabs/tab.module.metadata.json deleted file mode 100644 index fc089e291..000000000 --- a/dist/modules/tabs/tab.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiTabsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":8}],"declarations":[{"__symbolic":"reference","module":"./components/tabset","name":"SuiTabset","line":11,"character":8},{"__symbolic":"reference","module":"./directives/tab-header","name":"SuiTabHeader","line":12,"character":8},{"__symbolic":"reference","module":"./directives/tab-content","name":"SuiTabContent","line":13,"character":8}],"exports":[{"__symbolic":"reference","module":"./components/tabset","name":"SuiTabset","line":16,"character":8},{"__symbolic":"reference","module":"./directives/tab-header","name":"SuiTabHeader","line":17,"character":8},{"__symbolic":"reference","module":"./directives/tab-content","name":"SuiTabContent","line":18,"character":8}]}]}]}}}] \ No newline at end of file diff --git a/dist/modules/transition/classes/transition-controller.d.ts b/dist/modules/transition/classes/transition-controller.d.ts deleted file mode 100644 index 15a3cd2b3..000000000 --- a/dist/modules/transition/classes/transition-controller.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Renderer2, ElementRef, ChangeDetectorRef } from "@angular/core"; -import { Transition } from "./transition"; -export declare class TransitionController { - private _renderer; - private _element; - private _changeDetector; - private readonly _isReady; - private _display; - private _queue; - private _isAnimating; - readonly isAnimating: boolean; - private _isVisible; - readonly isVisible: boolean; - private _isHidden; - readonly isHidden: boolean; - private readonly _queueFirst; - private readonly _queueLast; - private _animationTimeout; - constructor(isInitiallyVisible?: boolean, display?: string); - registerRenderer(renderer: Renderer2): void; - registerElement(element: ElementRef): void; - registerChangeDetector(changeDetector: ChangeDetectorRef): void; - animate(transition: Transition): void; - private performTransition(); - private finishTransition(transition); - stop(transition?: Transition): void; - stopAll(): void; - clearQueue(): void; -} diff --git a/dist/modules/transition/classes/transition-controller.js b/dist/modules/transition/classes/transition-controller.js deleted file mode 100644 index 7881c201c..000000000 --- a/dist/modules/transition/classes/transition-controller.js +++ /dev/null @@ -1,200 +0,0 @@ -import { TransitionDirection } from "./transition"; -var TransitionController = /** @class */ (function () { - function TransitionController(isInitiallyVisible, display) { - if (isInitiallyVisible === void 0) { isInitiallyVisible = true; } - if (display === void 0) { display = "block"; } - // isInitiallyVisible sets whether the element starts out visible. - this._isVisible = isInitiallyVisible; - this._isHidden = !this._isVisible; - this._display = display; - this._queue = []; - this._isAnimating = false; - } - Object.defineProperty(TransitionController.prototype, "_isReady", { - // Used to delay animations until we have an element to animate. - get: - // Used to delay animations until we have an element to animate. - function () { - return this._renderer != undefined && this._element != undefined && this._changeDetector != undefined; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TransitionController.prototype, "isAnimating", { - get: function () { - return this._isAnimating; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TransitionController.prototype, "isVisible", { - get: function () { - return this._isVisible; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TransitionController.prototype, "isHidden", { - get: function () { - return this._isHidden; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TransitionController.prototype, "_queueFirst", { - // Gets the first transition in the queue. - get: - // Gets the first transition in the queue. - function () { - return this._queue[0]; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TransitionController.prototype, "_queueLast", { - // Gets the last transition in the queue. - get: - // Gets the last transition in the queue. - function () { - return this._queue[this._queue.length - 1]; - }, - enumerable: true, - configurable: true - }); - // Sets the renderer to be used for animating. - // Sets the renderer to be used for animating. - TransitionController.prototype.registerRenderer = - // Sets the renderer to be used for animating. - function (renderer) { - this._renderer = renderer; - this.performTransition(); - }; - // Sets the element to perform the animations on. - // Sets the element to perform the animations on. - TransitionController.prototype.registerElement = - // Sets the element to perform the animations on. - function (element) { - this._element = element; - this.performTransition(); - }; - // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. - // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. - TransitionController.prototype.registerChangeDetector = - // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush. - function (changeDetector) { - this._changeDetector = changeDetector; - this.performTransition(); - }; - TransitionController.prototype.animate = function (transition) { - // Test if transition is one of the list that doesn't change the visible state. - // Should these eventually become classes? - var isDirectionless = ["jiggle", "flash", "shake", "pulse", "tada", "bounce"].indexOf(transition.type) !== -1; - if (isDirectionless) { - transition.direction = TransitionDirection.Static; - } - else if (transition.direction == undefined || transition.direction === TransitionDirection.Either) { - // Set the direction to the opposite of the current visible state automatically if not set, or set to either direction. - transition.direction = this._isVisible ? TransitionDirection.Out : TransitionDirection.In; - if (this._queueLast) { - // If there is an transition in the queue already, set the direction to the opposite of the direction of that transition. - if (this._queueLast.direction === TransitionDirection.In) { - transition.direction = TransitionDirection.Out; - } - else if (this._queueLast.direction === TransitionDirection.Out) { - transition.direction = TransitionDirection.In; - } - } - } - // Store the transition in the queue before attempting to perform it. - this._queue.push(transition); - this.performTransition(); - }; - TransitionController.prototype.performTransition = function () { - var _this = this; - if (!this._isReady || this._isAnimating || !this._queueFirst) { - // Don't transition until we are ready, or if we are animating, or if there aren't any transitions in the queue. - return; - } - this._isAnimating = true; - var transition = this._queueFirst; - // Set the Semantic UI classes for transitioning. - transition.classes.forEach(function (c) { return _this._renderer.addClass(_this._element, c); }); - this._renderer.addClass(this._element, "animating"); - this._renderer.addClass(this._element, transition.directionClass); - // Set the Semantic UI styles for transitioning. - this._renderer.setStyle(this._element, "animationDuration", transition.duration + "ms"); - this._renderer.setStyle(this._element, "display", this._display); - if (transition.direction === TransitionDirection.In) { - // Unset hidden if we are transitioning in. - this._isHidden = false; - } - // Wait the length of the animation before calling the complete callback. - this._animationTimeout = window.setTimeout(function () { return _this.finishTransition(transition); }, transition.duration); - }; - // Called when a transition has completed. - // Called when a transition has completed. - TransitionController.prototype.finishTransition = - // Called when a transition has completed. - function (transition) { - var _this = this; - // Unset the Semantic UI classes & styles for transitioning. - transition.classes.forEach(function (c) { return _this._renderer.removeClass(_this._element, c); }); - this._renderer.removeClass(this._element, "animating"); - this._renderer.removeClass(this._element, transition.directionClass); - this._renderer.removeStyle(this._element, "animationDuration"); - this._renderer.removeStyle(this._element, "display"); - if (transition.direction === TransitionDirection.In) { - // If we have just animated in, we are now visible. - this._isVisible = true; - } - else if (transition.direction === TransitionDirection.Out) { - // If we have transitioned out, we should be invisible and hidden. - this._isVisible = false; - this._isHidden = true; - } - if (transition.onComplete) { - // Call the user-defined transition callback. - transition.onComplete(); - } - // Delete the transition from the queue. - this._queue.shift(); - this._isAnimating = false; - this._changeDetector.markForCheck(); - // Immediately attempt to perform another transition. - this.performTransition(); - }; - // Stops the current transition, leaves the rest of the queue intact. - // Stops the current transition, leaves the rest of the queue intact. - TransitionController.prototype.stop = - // Stops the current transition, leaves the rest of the queue intact. - function (transition) { - if (transition === void 0) { transition = this._queueFirst; } - if (!transition || !this._isAnimating) { - return; - } - clearTimeout(this._animationTimeout); - this.finishTransition(transition); - }; - // Stops the current transition, and empties the queue. - // Stops the current transition, and empties the queue. - TransitionController.prototype.stopAll = - // Stops the current transition, and empties the queue. - function () { - this.clearQueue(); - this.stop(); - }; - // Empties the transition queue but carries on with the current transition. - // Empties the transition queue but carries on with the current transition. - TransitionController.prototype.clearQueue = - // Empties the transition queue but carries on with the current transition. - function () { - if (this.isAnimating) { - this._queue = [this._queueFirst]; - return; - } - this._queue = []; - }; - return TransitionController; -}()); -export { TransitionController }; -//# sourceMappingURL=transition-controller.js.map \ No newline at end of file diff --git a/dist/modules/transition/classes/transition-controller.js.map b/dist/modules/transition/classes/transition-controller.js.map deleted file mode 100644 index 86981b0ef..000000000 --- a/dist/modules/transition/classes/transition-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transition-controller.js","sourceRoot":"","sources":["../../../../src/modules/transition/classes/transition-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE/D,IAAA;IAmDI,8BAAY,kBAAiC,EAAE,OAAwB;QAA3D,mCAAA,EAAA,yBAAiC;QAAE,wBAAA,EAAA,iBAAwB;;QAEnE,IAAI,CAAC,UAAU,GAAG,kBAAkB,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;QAElC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAEjB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;KAC7B;IApDD,sBAAY,0CAAQ;QADpB,gEAAgE;;;QAChE;YACI,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,SAAS,IAAI,IAAI,CAAC,QAAQ,IAAI,SAAS,IAAI,IAAI,CAAC,eAAe,IAAI,SAAS,CAAC;SACzG;;;OAAA;IAUD,sBAAW,6CAAW;aAAtB;YACI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;SAC5B;;;OAAA;IAKD,sBAAW,2CAAS;aAApB;YACI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;SAC1B;;;OAAA;IAKD,sBAAW,0CAAQ;aAAnB;YACI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;SACzB;;;OAAA;IAGD,sBAAY,6CAAW;QADvB,0CAA0C;;;QAC1C;YACI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACzB;;;OAAA;IAGD,sBAAY,4CAAU;QADtB,yCAAyC;;;QACzC;YACI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SAC9C;;;O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AExB,UAAU,CAAC,UAAU,EAAE,CAAC;SAC3B;;QAGD,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1B,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC;;QAGpC,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC5B;IAED,qEAAqE;;IAC9D,mCAAI;;IAAX,UAAY,UAAwC;QAAxC,2BAAA,EAAA,aAAwB,IAAI,CAAC,WAAW;QAChD,EAAE,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;YACpC,MAAM,CAAC;SACV;QAED,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACrC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;KACrC;IAED,uDAAuD;;IAChD,sCAAO;;IAAd;QACI,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,EAAE,CAAC;KACf;IAED,2EAA2E;;IACpE,yCAAU;;IAAjB;QACI,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACjC,MAAM,CAAC;SACV;QACD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;KACpB;+BAjML;IAkMC,CAAA;AA/LD,gCA+LC","sourcesContent":["import { Renderer2, ElementRef, ChangeDetectorRef } from \"@angular/core\";\nimport { Transition, TransitionDirection } from \"./transition\";\n\nexport class TransitionController {\n private _renderer:Renderer2;\n\n private _element:ElementRef;\n\n private _changeDetector:ChangeDetectorRef;\n\n // Used to delay animations until we have an element to animate.\n private get _isReady():boolean {\n return this._renderer != undefined && this._element != undefined && this._changeDetector != undefined;\n }\n\n // Sets the 'display' style when visible.\n private _display:string;\n\n // Stores queued transitions.\n private _queue:Transition[];\n\n private _isAnimating:boolean;\n\n public get isAnimating():boolean {\n return this._isAnimating;\n }\n\n // Set when the element is visible, and while it is transitioning out.\n private _isVisible:boolean;\n\n public get isVisible():boolean {\n return this._isVisible;\n }\n\n // Set when the element is hidden, and not while it is transitioning.\n private _isHidden:boolean;\n\n public get isHidden():boolean {\n return this._isHidden;\n }\n\n // Gets the first transition in the queue.\n private get _queueFirst():Transition {\n return this._queue[0];\n }\n\n // Gets the last transition in the queue.\n private get _queueLast():Transition {\n return this._queue[this._queue.length - 1];\n }\n\n // Stores the setTimeout pointer for cancelling the animation callback.\n private _animationTimeout:number;\n\n constructor(isInitiallyVisible:boolean = true, display:string = \"block\") {\n // isInitiallyVisible sets whether the element starts out visible.\n this._isVisible = isInitiallyVisible;\n this._isHidden = !this._isVisible;\n\n this._display = display;\n this._queue = [];\n\n this._isAnimating = false;\n }\n\n // Sets the renderer to be used for animating.\n public registerRenderer(renderer:Renderer2):void {\n this._renderer = renderer;\n this.performTransition();\n }\n\n // Sets the element to perform the animations on.\n public registerElement(element:ElementRef):void {\n this._element = element;\n this.performTransition();\n }\n\n // Sets the change detector to detect changes when using ChangeDetectionStrategy.OnPush.\n public registerChangeDetector(changeDetector:ChangeDetectorRef):void {\n this._changeDetector = changeDetector;\n this.performTransition();\n }\n\n public animate(transition:Transition):void {\n // Test if transition is one of the list that doesn't change the visible state.\n // Should these eventually become classes?\n const isDirectionless = [\"jiggle\", \"flash\", \"shake\", \"pulse\", \"tada\", \"bounce\"].indexOf(transition.type) !== -1;\n if (isDirectionless) {\n transition.direction = TransitionDirection.Static;\n } else if (transition.direction == undefined || transition.direction === TransitionDirection.Either) {\n // Set the direction to the opposite of the current visible state automatically if not set, or set to either direction.\n transition.direction = this._isVisible ? TransitionDirection.Out : TransitionDirection.In;\n if (this._queueLast) {\n // If there is an transition in the queue already, set the direction to the opposite of the direction of that transition.\n if (this._queueLast.direction === TransitionDirection.In) {\n transition.direction = TransitionDirection.Out;\n } else if (this._queueLast.direction === TransitionDirection.Out) {\n transition.direction = TransitionDirection.In;\n }\n }\n }\n\n // Store the transition in the queue before attempting to perform it.\n this._queue.push(transition);\n\n this.performTransition();\n }\n\n private performTransition():void {\n if (!this._isReady || this._isAnimating || !this._queueFirst) {\n // Don't transition until we are ready, or if we are animating, or if there aren't any transitions in the queue.\n return;\n }\n\n this._isAnimating = true;\n\n const transition = this._queueFirst;\n\n // Set the Semantic UI classes for transitioning.\n transition.classes.forEach(c => this._renderer.addClass(this._element, c));\n this._renderer.addClass(this._element, `animating`);\n this._renderer.addClass(this._element, transition.directionClass);\n\n // Set the Semantic UI styles for transitioning.\n this._renderer.setStyle(this._element, `animationDuration`, `${transition.duration}ms`);\n this._renderer.setStyle(this._element, `display`, this._display);\n\n if (transition.direction === TransitionDirection.In) {\n // Unset hidden if we are transitioning in.\n this._isHidden = false;\n }\n\n // Wait the length of the animation before calling the complete callback.\n this._animationTimeout = window.setTimeout(() => this.finishTransition(transition), transition.duration);\n }\n\n // Called when a transition has completed.\n private finishTransition(transition:Transition):void {\n // Unset the Semantic UI classes & styles for transitioning.\n transition.classes.forEach(c => this._renderer.removeClass(this._element, c));\n this._renderer.removeClass(this._element, `animating`);\n this._renderer.removeClass(this._element, transition.directionClass);\n\n this._renderer.removeStyle(this._element, `animationDuration`);\n this._renderer.removeStyle(this._element, `display`);\n\n if (transition.direction === TransitionDirection.In) {\n // If we have just animated in, we are now visible.\n this._isVisible = true;\n } else if (transition.direction === TransitionDirection.Out) {\n // If we have transitioned out, we should be invisible and hidden.\n this._isVisible = false;\n this._isHidden = true;\n }\n\n if (transition.onComplete) {\n // Call the user-defined transition callback.\n transition.onComplete();\n }\n\n // Delete the transition from the queue.\n this._queue.shift();\n this._isAnimating = false;\n\n this._changeDetector.markForCheck();\n\n // Immediately attempt to perform another transition.\n this.performTransition();\n }\n\n // Stops the current transition, leaves the rest of the queue intact.\n public stop(transition:Transition = this._queueFirst):void {\n if (!transition || !this._isAnimating) {\n return;\n }\n\n clearTimeout(this._animationTimeout);\n this.finishTransition(transition);\n }\n\n // Stops the current transition, and empties the queue.\n public stopAll():void {\n this.clearQueue();\n this.stop();\n }\n\n // Empties the transition queue but carries on with the current transition.\n public clearQueue():void {\n if (this.isAnimating) {\n this._queue = [this._queueFirst];\n return;\n }\n this._queue = [];\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/transition/classes/transition-controller.metadata.json b/dist/modules/transition/classes/transition-controller.metadata.json deleted file mode 100644 index dc140c21b..000000000 --- a/dist/modules/transition/classes/transition-controller.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"TransitionController":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"boolean"},{"__symbolic":"reference","name":"string"}]}],"registerRenderer":[{"__symbolic":"method"}],"registerElement":[{"__symbolic":"method"}],"registerChangeDetector":[{"__symbolic":"method"}],"animate":[{"__symbolic":"method"}],"performTransition":[{"__symbolic":"method"}],"finishTransition":[{"__symbolic":"method"}],"stop":[{"__symbolic":"method"}],"stopAll":[{"__symbolic":"method"}],"clearQueue":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/transition/classes/transition.d.ts b/dist/modules/transition/classes/transition.d.ts deleted file mode 100644 index f929d622c..000000000 --- a/dist/modules/transition/classes/transition.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export declare enum TransitionDirection { - In = 0, - Out = 1, - Either = 2, - Static = 3, -} -export declare class Transition { - readonly type: string; - readonly duration: number; - direction: TransitionDirection; - readonly directionClass: string; - readonly classes: string[]; - onComplete: () => void; - constructor(name: string, duration?: number, direction?: TransitionDirection, onComplete?: (() => void)); -} diff --git a/dist/modules/transition/classes/transition.js b/dist/modules/transition/classes/transition.js deleted file mode 100644 index 34962f6b3..000000000 --- a/dist/modules/transition/classes/transition.js +++ /dev/null @@ -1,41 +0,0 @@ -// Possible directions for a transition. -// Possible directions for a transition. -export var TransitionDirection; -// Possible directions for a transition. -(function (TransitionDirection) { - TransitionDirection[TransitionDirection["In"] = 0] = "In"; - TransitionDirection[TransitionDirection["Out"] = 1] = "Out"; - TransitionDirection[TransitionDirection["Either"] = 2] = "Either"; - TransitionDirection[TransitionDirection["Static"] = 3] = "Static"; -})(TransitionDirection || (TransitionDirection = {})); -var Transition = /** @class */ (function () { - function Transition(name, duration, direction, onComplete) { - if (duration === void 0) { duration = 250; } - if (direction === void 0) { direction = TransitionDirection.Either; } - if (onComplete === void 0) { onComplete = function () { }; } - this.type = name; - // We set a minimum duration of 1ms, to give the appearance of an immediate transition - // whilst allowing positioning calculations to happen without a visible flicker. - this.duration = Math.max(duration, 1); - this.direction = direction; - this.classes = this.type.split(" "); - this.onComplete = onComplete; - } - Object.defineProperty(Transition.prototype, "directionClass", { - // Converts TransitionDirection to class name. - get: - // Converts TransitionDirection to class name. - function () { - switch (this.direction) { - case TransitionDirection.In: return "in"; - case TransitionDirection.Out: return "out"; - } - return ""; - }, - enumerable: true, - configurable: true - }); - return Transition; -}()); -export { Transition }; -//# sourceMappingURL=transition.js.map \ No newline at end of file diff --git a/dist/modules/transition/classes/transition.js.map b/dist/modules/transition/classes/transition.js.map deleted file mode 100644 index 0dd0fecf4..000000000 --- a/dist/modules/transition/classes/transition.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transition.js","sourceRoot":"","sources":["../../../../src/modules/transition/classes/transition.ts"],"names":[],"mappings":"AAAA,wCAAwC;;AACxC,MAAM,CAAN,IAAY,mBAKX;;AALD,WAAY,mBAAmB;IAC3B,yDAAE,CAAA;IACF,2DAAG,CAAA;IACH,iEAAM,CAAA;IACN,iEAAM,CAAA;GAJE,mBAAmB,KAAnB,mBAAmB,QAK9B;AAED,IAAA;IAsBI,oBAAY,IAAW,EACX,QAAqB,EACrB,SAA0D,EAC1D,UAAkC;QAFlC,yBAAA,EAAA,cAAqB;QACrB,0BAAA,EAAA,YAAgC,mBAAmB,CAAC,MAAM;QAC1D,2BAAA,EAAA,4BAAkC;QAE1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;;;QAIjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAEtC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;KAChC;IA5BD,sBAAW,sCAAc;QADzB,8CAA8C;;;QAC9C;YACI,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;gBACrB,KAAK,mBAAmB,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC;gBACzC,KAAK,mBAAmB,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC;aAC9C;YAED,MAAM,CAAC,EAAE,CAAC;SACb;;;OAAA;qBAvBL;IA6CC,CAAA;AArCD,sBAqCC","sourcesContent":["// Possible directions for a transition.\nexport enum TransitionDirection {\n In,\n Out,\n Either,\n Static\n}\n\nexport class Transition {\n public readonly type:string;\n\n public readonly duration:number;\n\n public direction:TransitionDirection;\n\n // Converts TransitionDirection to class name.\n public get directionClass():string {\n switch (this.direction) {\n case TransitionDirection.In: return \"in\";\n case TransitionDirection.Out: return \"out\";\n }\n\n return \"\";\n }\n\n // Stores the individual classes for the transition, e.g. \"fade out\" -> [\"fade\", \"out\"].\n public readonly classes:string[];\n\n public onComplete:() => void;\n\n constructor(name:string,\n duration:number = 250,\n direction:TransitionDirection = TransitionDirection.Either,\n onComplete:(() => void) = () => {}) {\n\n this.type = name;\n\n // We set a minimum duration of 1ms, to give the appearance of an immediate transition\n // whilst allowing positioning calculations to happen without a visible flicker.\n this.duration = Math.max(duration, 1);\n\n this.direction = direction;\n this.classes = this.type.split(\" \");\n this.onComplete = onComplete;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/transition/classes/transition.metadata.json b/dist/modules/transition/classes/transition.metadata.json deleted file mode 100644 index aa97bd2ab..000000000 --- a/dist/modules/transition/classes/transition.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"TransitionDirection":{"In":0,"Out":1,"Either":2,"Static":3},"Transition":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"number"},{"__symbolic":"error","message":"Could not resolve type","line":32,"character":26,"context":{"typeName":"TransitionDirection"}},{"__symbolic":"error","message":"Expression form not supported","line":33,"character":27}]}]}}}}] \ No newline at end of file diff --git a/dist/modules/transition/directives/transition.d.ts b/dist/modules/transition/directives/transition.d.ts deleted file mode 100644 index a6a1b3e3f..000000000 --- a/dist/modules/transition/directives/transition.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Renderer2, ElementRef, ChangeDetectorRef } from "@angular/core"; -import { TransitionController } from "../classes/transition-controller"; -export declare class SuiTransition { - private _renderer; - private _element; - private _changeDetector; - private _controller; - suiTransition: TransitionController; - transitionClass: boolean; - readonly isVisible: boolean; - readonly isHidden: boolean; - constructor(_renderer: Renderer2, _element: ElementRef, _changeDetector: ChangeDetectorRef); - setTransitionController(transitionController: TransitionController): void; -} diff --git a/dist/modules/transition/directives/transition.js b/dist/modules/transition/directives/transition.js deleted file mode 100644 index b98758b2a..000000000 --- a/dist/modules/transition/directives/transition.js +++ /dev/null @@ -1,69 +0,0 @@ -import { Renderer2, ElementRef, Directive, Input, HostBinding, ChangeDetectorRef } from "@angular/core"; -import { TransitionController } from "../classes/transition-controller"; -var SuiTransition = /** @class */ (function () { - function SuiTransition(_renderer, _element, _changeDetector) { - this._renderer = _renderer; - this._element = _element; - this._changeDetector = _changeDetector; - this.transitionClass = true; - } - Object.defineProperty(SuiTransition.prototype, "suiTransition", { - set: function (tC) { - // Set the transition controller (e.g. '
'). - this.setTransitionController(tC); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiTransition.prototype, "isVisible", { - get: function () { - if (this._controller) { - return this._controller.isVisible; - } - return false; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(SuiTransition.prototype, "isHidden", { - get: function () { - if (this._controller) { - return this._controller.isHidden; - } - return false; - }, - enumerable: true, - configurable: true - }); - // Initialises the controller with the injected renderer and elementRef. - // Initialises the controller with the injected renderer and elementRef. - SuiTransition.prototype.setTransitionController = - // Initialises the controller with the injected renderer and elementRef. - function (transitionController) { - this._controller = transitionController; - this._controller.registerRenderer(this._renderer); - this._controller.registerElement(this._element.nativeElement); - this._controller.registerChangeDetector(this._changeDetector); - }; - SuiTransition.decorators = [ - { type: Directive, args: [{ - selector: "[suiTransition]", - exportAs: "transition" - },] }, - ]; - /** @nocollapse */ - SuiTransition.ctorParameters = function () { return [ - { type: Renderer2, }, - { type: ElementRef, }, - { type: ChangeDetectorRef, }, - ]; }; - SuiTransition.propDecorators = { - "suiTransition": [{ type: Input },], - "transitionClass": [{ type: HostBinding, args: ["class.transition",] },], - "isVisible": [{ type: HostBinding, args: ["class.visible",] },], - "isHidden": [{ type: HostBinding, args: ["class.hidden",] },], - }; - return SuiTransition; -}()); -export { SuiTransition }; -//# sourceMappingURL=transition.js.map \ No newline at end of file diff --git a/dist/modules/transition/directives/transition.js.map b/dist/modules/transition/directives/transition.js.map deleted file mode 100644 index ec72c86b2..000000000 --- a/dist/modules/transition/directives/transition.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transition.js","sourceRoot":"","sources":["../../../../src/modules/transition/directives/transition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACxG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;;IAmCpE,uBAAoB,SAAmB,EAAU,QAAmB,EAAU,eAAiC;QAA3F,cAAS,GAAT,SAAS,CAAU;QAAU,aAAQ,GAAR,QAAQ,CAAW;QAAU,oBAAe,GAAf,eAAe,CAAkB;+BAlB9E,IAAI;KAkB8E;0BAxBxG,wCAAa;uBAAC,EAAuB;;YAE5C,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;;;;;0BAO1B,oCAAS;;YAChB,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;gBACnB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;aACrC;YACD,MAAM,CAAC,KAAK,CAAC;;;;;0BAIN,mCAAQ;;YACf,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;gBACnB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;aACpC;YACD,MAAM,CAAC,KAAK,CAAC;;;;;IAKjB,wEAAwE;;IACjE,+CAAuB;;IAA9B,UAA+B,oBAAyC;QACpE,IAAI,CAAC,WAAW,GAAG,oBAAoB,CAAC;QACxC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAC9D,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACjE;;gBAzCJ,SAAS,SAAC;oBACP,QAAQ,EAAE,iBAAiB;oBAC3B,QAAQ,EAAE,YAAY;iBACzB;;;;gBANQ,SAAS;gBAAE,UAAU;gBAAiC,iBAAiB;;;kCAW3E,KAAK;oCAML,WAAW,SAAC,kBAAkB;8BAG9B,WAAW,SAAC,eAAe;6BAQ3B,WAAW,SAAC,cAAc;;wBA5B/B;;SAOa,aAAa","sourcesContent":["import { Renderer2, ElementRef, Directive, Input, HostBinding, ChangeDetectorRef } from \"@angular/core\";\nimport { TransitionController } from \"../classes/transition-controller\";\n\n@Directive({\n selector: \"[suiTransition]\",\n exportAs: \"transition\"\n})\nexport class SuiTransition {\n // Each transition must have a controller associated that dispatches the transitions.\n private _controller:TransitionController;\n\n @Input()\n public set suiTransition(tC:TransitionController) {\n // Set the transition controller (e.g. '
').\n this.setTransitionController(tC);\n }\n\n @HostBinding(\"class.transition\")\n public transitionClass:boolean = true;\n\n @HostBinding(\"class.visible\")\n public get isVisible():boolean {\n if (this._controller) {\n return this._controller.isVisible;\n }\n return false;\n }\n\n @HostBinding(\"class.hidden\")\n public get isHidden():boolean {\n if (this._controller) {\n return this._controller.isHidden;\n }\n return false;\n }\n\n constructor(private _renderer:Renderer2, private _element:ElementRef, private _changeDetector:ChangeDetectorRef) {}\n\n // Initialises the controller with the injected renderer and elementRef.\n public setTransitionController(transitionController:TransitionController):void {\n this._controller = transitionController;\n this._controller.registerRenderer(this._renderer);\n this._controller.registerElement(this._element.nativeElement);\n this._controller.registerChangeDetector(this._changeDetector);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/modules/transition/directives/transition.metadata.json b/dist/modules/transition/directives/transition.metadata.json deleted file mode 100644 index fadfa961a..000000000 --- a/dist/modules/transition/directives/transition.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiTransition":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":3,"character":1},"arguments":[{"selector":"[suiTransition]","exportAs":"transition"}]}],"members":{"suiTransition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":5}}]}],"transitionClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":17,"character":5},"arguments":["class.transition"]}]}],"isVisible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":20,"character":5},"arguments":["class.visible"]}]}],"isHidden":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":28,"character":5},"arguments":["class.hidden"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":36,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":36,"character":62},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":36,"character":98}]}],"setTransitionController":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/dist/modules/transition/index.d.ts b/dist/modules/transition/index.d.ts deleted file mode 100644 index 564d46c40..000000000 --- a/dist/modules/transition/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./classes/transition-controller"; -export * from "./classes/transition"; -export * from "./directives/transition"; -export * from "./transition.module"; diff --git a/dist/modules/transition/index.js b/dist/modules/transition/index.js deleted file mode 100644 index 3c6709cac..000000000 --- a/dist/modules/transition/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./classes/transition-controller"; -export * from "./classes/transition"; -export * from "./directives/transition"; -export * from "./transition.module"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/transition/index.js.map b/dist/modules/transition/index.js.map deleted file mode 100644 index 2f6f147c2..000000000 --- a/dist/modules/transition/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/transition/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC;AAErC,cAAc,yBAAyB,CAAC;AAExC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./classes/transition-controller\";\nexport * from \"./classes/transition\";\n\nexport * from \"./directives/transition\";\n\nexport * from \"./transition.module\";\n"]} \ No newline at end of file diff --git a/dist/modules/transition/index.metadata.json b/dist/modules/transition/index.metadata.json deleted file mode 100644 index 8fda5c2cb..000000000 --- a/dist/modules/transition/index.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./classes/transition-controller"},{"from":"./classes/transition"},{"from":"./directives/transition"},{"from":"./transition.module"}]}] \ No newline at end of file diff --git a/dist/modules/transition/public.d.ts b/dist/modules/transition/public.d.ts deleted file mode 100644 index dbdee865f..000000000 --- a/dist/modules/transition/public.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SuiTransitionModule, SuiTransition, Transition, TransitionDirection, TransitionController } from "./index"; diff --git a/dist/modules/transition/public.js b/dist/modules/transition/public.js deleted file mode 100644 index 70da82a4c..000000000 --- a/dist/modules/transition/public.js +++ /dev/null @@ -1,2 +0,0 @@ -export { SuiTransitionModule, SuiTransition, Transition, TransitionDirection, TransitionController } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/modules/transition/public.js.map b/dist/modules/transition/public.js.map deleted file mode 100644 index 37f73de4f..000000000 --- a/dist/modules/transition/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/modules/transition/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACvB,MAAM,SAAS,CAAC","sourcesContent":["export {\n SuiTransitionModule,\n SuiTransition,\n Transition,\n TransitionDirection,\n TransitionController\n} from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/modules/transition/public.metadata.json b/dist/modules/transition/public.metadata.json deleted file mode 100644 index 6ab6c1133..000000000 --- a/dist/modules/transition/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./index","export":["SuiTransitionModule","SuiTransition","Transition","TransitionDirection","TransitionController"]}]}] \ No newline at end of file diff --git a/dist/modules/transition/transition.module.d.ts b/dist/modules/transition/transition.module.d.ts deleted file mode 100644 index e58b2743b..000000000 --- a/dist/modules/transition/transition.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiTransitionModule { -} diff --git a/dist/modules/transition/transition.module.js b/dist/modules/transition/transition.module.js deleted file mode 100644 index d4d96919f..000000000 --- a/dist/modules/transition/transition.module.js +++ /dev/null @@ -1,24 +0,0 @@ -import { NgModule } from "@angular/core"; -import { CommonModule } from "@angular/common"; -import { SuiTransition } from "./directives/transition"; -var SuiTransitionModule = /** @class */ (function () { - function SuiTransitionModule() { - } - SuiTransitionModule.decorators = [ - { type: NgModule, args: [{ - imports: [CommonModule], - declarations: [ - SuiTransition - ], - exports: [ - SuiTransition - ], - providers: [] - },] }, - ]; - /** @nocollapse */ - SuiTransitionModule.ctorParameters = function () { return []; }; - return SuiTransitionModule; -}()); -export { SuiTransitionModule }; -//# sourceMappingURL=transition.module.js.map \ No newline at end of file diff --git a/dist/modules/transition/transition.module.js.map b/dist/modules/transition/transition.module.js.map deleted file mode 100644 index da40bc625..000000000 --- a/dist/modules/transition/transition.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transition.module.js","sourceRoot":"","sources":["../../../src/modules/transition/transition.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;;;;;gBAEvD,QAAQ,SAAC;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE;wBACV,aAAa;qBAChB;oBACD,OAAO,EAAE;wBACL,aAAa;qBAChB;oBACD,SAAS,EAAE,EAAE;iBAChB;;;;8BAbD;;SAca,mBAAmB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { SuiTransition } from \"./directives/transition\";\n\n@NgModule({\n imports: [CommonModule],\n declarations: [\n SuiTransition\n ],\n exports: [\n SuiTransition\n ],\n providers: []\n})\nexport class SuiTransitionModule {}\n"]} \ No newline at end of file diff --git a/dist/modules/transition/transition.module.metadata.json b/dist/modules/transition/transition.module.metadata.json deleted file mode 100644 index eda687d63..000000000 --- a/dist/modules/transition/transition.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiTransitionModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":5,"character":14}],"declarations":[{"__symbolic":"reference","module":"./directives/transition","name":"SuiTransition","line":7,"character":8}],"exports":[{"__symbolic":"reference","module":"./directives/transition","name":"SuiTransition","line":10,"character":8}],"providers":[]}]}]}}}] \ No newline at end of file diff --git a/dist/public.d.ts b/dist/public.d.ts deleted file mode 100644 index e829d9267..000000000 --- a/dist/public.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./behaviors/public"; -export * from "./collections/public"; -export * from "./modules/public"; -export * from "./misc/public"; -export { SuiModule } from "./index"; diff --git a/dist/public.js b/dist/public.js deleted file mode 100644 index f1815b7e9..000000000 --- a/dist/public.js +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./behaviors/public"; -export * from "./collections/public"; -export * from "./modules/public"; -export * from "./misc/public"; -export { SuiModule } from "./index"; -//# sourceMappingURL=public.js.map \ No newline at end of file diff --git a/dist/public.js.map b/dist/public.js.map deleted file mode 100644 index d13fee553..000000000 --- a/dist/public.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"public.js","sourceRoot":"","sources":["../src/public.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export * from \"./behaviors/public\";\nexport * from \"./collections/public\";\nexport * from \"./modules/public\";\n\nexport * from \"./misc/public\";\nexport { SuiModule } from \"./index\";\n"]} \ No newline at end of file diff --git a/dist/public.metadata.json b/dist/public.metadata.json deleted file mode 100644 index ab9538389..000000000 --- a/dist/public.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./behaviors/public"},{"from":"./collections/public"},{"from":"./modules/public"},{"from":"./misc/public"},{"from":"./index","export":["SuiModule"]}]}] \ No newline at end of file diff --git a/dist/sui.module.d.ts b/dist/sui.module.d.ts deleted file mode 100644 index c9191ff6d..000000000 --- a/dist/sui.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class SuiModule { -} diff --git a/dist/sui.module.js b/dist/sui.module.js deleted file mode 100644 index 22b57f711..000000000 --- a/dist/sui.module.js +++ /dev/null @@ -1,39 +0,0 @@ -import { NgModule } from "@angular/core"; -import { SuiMessageModule, SuiPaginationModule } from "./collections"; -import { SuiAccordionModule, SuiCheckboxModule, SuiCollapseModule, SuiDatepickerModule, SuiDimmerModule, SuiDropdownModule, SuiModalModule, SuiPopupModule, SuiProgressModule, SuiRatingModule, SuiSearchModule, SuiSidebarModule, SuiTabsModule, SuiSelectModule, SuiTransitionModule } from "./modules"; -import { SuiLocalizationModule } from "./behaviors"; -import { SuiUtilityModule } from "./misc"; -var SuiModule = /** @class */ (function () { - function SuiModule() { - } - SuiModule.decorators = [ - { type: NgModule, args: [{ - exports: [ - SuiMessageModule, - SuiPaginationModule, - SuiAccordionModule, - SuiCheckboxModule, - SuiCollapseModule, - SuiDatepickerModule, - SuiDimmerModule, - SuiDropdownModule, - SuiModalModule, - SuiPopupModule, - SuiProgressModule, - SuiRatingModule, - SuiSearchModule, - SuiSelectModule, - SuiSidebarModule, - SuiTabsModule, - SuiTransitionModule, - SuiLocalizationModule, - SuiUtilityModule - ] - },] }, - ]; - /** @nocollapse */ - SuiModule.ctorParameters = function () { return []; }; - return SuiModule; -}()); -export { SuiModule }; -//# sourceMappingURL=sui.module.js.map \ No newline at end of file diff --git a/dist/sui.module.js.map b/dist/sui.module.js.map deleted file mode 100644 index efcbfc6e4..000000000 --- a/dist/sui.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sui.module.js","sourceRoot":"","sources":["../src/sui.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACtB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACH,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,mBAAmB,EACtB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACH,qBAAqB,EACxB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACH,gBAAgB,EACnB,MAAM,QAAQ,CAAC;;;;;gBAEf,QAAQ,SAAC;oBACN,OAAO,EAAE;wBAEL,gBAAgB;wBAChB,mBAAmB;wBAGnB,kBAAkB;wBAClB,iBAAiB;wBACjB,iBAAiB;wBACjB,mBAAmB;wBACnB,eAAe;wBACf,iBAAiB;wBACjB,cAAc;wBACd,cAAc;wBACd,iBAAiB;wBACjB,eAAe;wBACf,eAAe;wBACf,eAAe;wBACf,gBAAgB;wBAChB,aAAa;wBACb,mBAAmB;wBAGnB,qBAAqB;wBAGrB,gBAAgB;qBACnB;iBACJ;;;;oBAlED;;SAmEa,SAAS","sourcesContent":["import { NgModule } from \"@angular/core\";\n\n// Collections\nimport {\n SuiMessageModule,\n SuiPaginationModule\n} from \"./collections\";\n\n// Modules\nimport {\n SuiAccordionModule,\n SuiCheckboxModule,\n SuiCollapseModule,\n SuiDatepickerModule,\n SuiDimmerModule,\n SuiDropdownModule,\n SuiModalModule,\n SuiPopupModule,\n SuiProgressModule,\n SuiRatingModule,\n SuiSearchModule,\n SuiSidebarModule,\n SuiTabsModule,\n SuiSelectModule,\n SuiTransitionModule\n} from \"./modules\";\n\n// Behaviors\nimport {\n SuiLocalizationModule\n} from \"./behaviors\";\n\n// Misc\nimport {\n SuiUtilityModule\n} from \"./misc\";\n\n@NgModule({\n exports: [\n // Collections\n SuiMessageModule,\n SuiPaginationModule,\n\n // Modules\n SuiAccordionModule,\n SuiCheckboxModule,\n SuiCollapseModule,\n SuiDatepickerModule,\n SuiDimmerModule,\n SuiDropdownModule,\n SuiModalModule,\n SuiPopupModule,\n SuiProgressModule,\n SuiRatingModule,\n SuiSearchModule,\n SuiSelectModule,\n SuiSidebarModule,\n SuiTabsModule,\n SuiTransitionModule,\n\n // Behaviors\n SuiLocalizationModule,\n\n // Misc\n SuiUtilityModule\n ]\n})\nexport class SuiModule {}\n"]} \ No newline at end of file diff --git a/dist/sui.module.metadata.json b/dist/sui.module.metadata.json deleted file mode 100644 index 61fa97650..000000000 --- a/dist/sui.module.metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"__symbolic":"module","version":4,"metadata":{"SuiModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":37,"character":1},"arguments":[{"exports":[{"__symbolic":"reference","module":"./collections","name":"SuiMessageModule","line":40,"character":8},{"__symbolic":"reference","module":"./collections","name":"SuiPaginationModule","line":41,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiAccordionModule","line":44,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiCheckboxModule","line":45,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiCollapseModule","line":46,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiDatepickerModule","line":47,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiDimmerModule","line":48,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiDropdownModule","line":49,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiModalModule","line":50,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiPopupModule","line":51,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiProgressModule","line":52,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiRatingModule","line":53,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiSearchModule","line":54,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiSelectModule","line":55,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiSidebarModule","line":56,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiTabsModule","line":57,"character":8},{"__symbolic":"reference","module":"./modules","name":"SuiTransitionModule","line":58,"character":8},{"__symbolic":"reference","module":"./behaviors","name":"SuiLocalizationModule","line":61,"character":8},{"__symbolic":"reference","module":"./misc","name":"SuiUtilityModule","line":64,"character":8}]}]}]}}}] \ No newline at end of file From 5dbb800661edfb8837163e345113f76fd08caa8b Mon Sep 17 00:00:00 2001 From: Benjamin Coenen Date: Wed, 21 Mar 2018 08:56:07 +0100 Subject: [PATCH 9/9] feat(search): add allowEmptyQuery and resetQueryOnChange on search Signed-off-by: Benjamin Coenen --- .gitignore | 2 +- .../app/pages/modules/search/search.page.ts | 6 ++ locales/de.d.ts | 7 --- locales/de.js | 51 ---------------- locales/de.js.map | 1 - locales/en-AU.d.ts | 7 --- locales/en-AU.js | 11 ---- locales/en-AU.js.map | 1 - locales/en-GB.d.ts | 3 - locales/en-GB.js | 56 ----------------- locales/en-GB.js.map | 1 - locales/en-US.d.ts | 3 - locales/en-US.js | 14 ----- locales/en-US.js.map | 1 - locales/es.d.ts | 7 --- locales/es.js | 51 ---------------- locales/es.js.map | 1 - locales/fr.d.ts | 7 --- locales/fr.js | 51 ---------------- locales/fr.js.map | 1 - locales/ge.d.ts | 7 --- locales/ge.js | 52 ---------------- locales/ge.js.map | 1 - locales/he.d.ts | 7 --- locales/he.js | 51 ---------------- locales/he.js.map | 1 - locales/index.d.ts | 16 ----- locales/index.js | 27 -------- locales/index.js.map | 1 - locales/it.d.ts | 7 --- locales/it.js | 51 ---------------- locales/it.js.map | 1 - locales/nl.d.ts | 7 --- locales/nl.js | 61 ------------------- locales/nl.js.map | 1 - locales/pt.d.ts | 7 --- locales/pt.js | 51 ---------------- locales/pt.js.map | 1 - locales/ru.d.ts | 7 --- locales/ru.js | 51 ---------------- locales/ru.js.map | 1 - 41 files changed, 7 insertions(+), 684 deletions(-) delete mode 100644 locales/de.d.ts delete mode 100644 locales/de.js delete mode 100644 locales/de.js.map delete mode 100644 locales/en-AU.d.ts delete mode 100644 locales/en-AU.js delete mode 100644 locales/en-AU.js.map delete mode 100644 locales/en-GB.d.ts delete mode 100644 locales/en-GB.js delete mode 100644 locales/en-GB.js.map delete mode 100644 locales/en-US.d.ts delete mode 100644 locales/en-US.js delete mode 100644 locales/en-US.js.map delete mode 100644 locales/es.d.ts delete mode 100644 locales/es.js delete mode 100644 locales/es.js.map delete mode 100644 locales/fr.d.ts delete mode 100644 locales/fr.js delete mode 100644 locales/fr.js.map delete mode 100644 locales/ge.d.ts delete mode 100644 locales/ge.js delete mode 100644 locales/ge.js.map delete mode 100644 locales/he.d.ts delete mode 100644 locales/he.js delete mode 100644 locales/he.js.map delete mode 100644 locales/index.d.ts delete mode 100644 locales/index.js delete mode 100644 locales/index.js.map delete mode 100644 locales/it.d.ts delete mode 100644 locales/it.js delete mode 100644 locales/it.js.map delete mode 100644 locales/nl.d.ts delete mode 100644 locales/nl.js delete mode 100644 locales/nl.js.map delete mode 100644 locales/pt.d.ts delete mode 100644 locales/pt.js delete mode 100644 locales/pt.js.map delete mode 100644 locales/ru.d.ts delete mode 100644 locales/ru.js delete mode 100644 locales/ru.js.map diff --git a/.gitignore b/.gitignore index 8a6276391..67158654a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. # compiled output +/dist /tmp ## ngc logs @@ -43,5 +44,4 @@ Thumbs.db # output files demo/dist -dist bundles diff --git a/demo/src/app/pages/modules/search/search.page.ts b/demo/src/app/pages/modules/search/search.page.ts index 3a00edfdf..bb475505e 100644 --- a/demo/src/app/pages/modules/search/search.page.ts +++ b/demo/src/app/pages/modules/search/search.page.ts @@ -65,6 +65,12 @@ export class SearchPage { description: "Sets whether the search element display result with empty query.", defaultValue: "false" }, + { + name: "resetQueryOnChange", + type: "boolean", + description: "Sets whether the query is reset if options change.", + defaultValue: "true" + }, { name: "options", type: "T[]", diff --git a/locales/de.d.ts b/locales/de.d.ts deleted file mode 100644 index 591ccb4da..000000000 --- a/locales/de.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../dist"; -/** - * locale : German (de) - * author : Ciara Ward : https://github.com/ciaraward - */ -declare const de: IPartialLocaleValues; -export default de; diff --git a/locales/de.js b/locales/de.js deleted file mode 100644 index e8ab71aa3..000000000 --- a/locales/de.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : German (de) - * author : Ciara Ward : https://github.com/ciaraward - */ -var de = { - datepicker: { - months: [ - "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember" - ], - monthsShort: [ - "Jan", "Febr", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez" - ], - weekdays: [ - "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" - ], - weekdaysShort: [ - "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" - ], - weekdaysNarrow: [ - "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" - ], - formats: { - time: "HH:mm", - datetime: "D. MMMM YYYY HH:mm", - date: "D. MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Suchen...", - noResults: { - header: "Keine Ergebnisse", - message: "Ihre Suche ergab keine Ergebnisse." - } - }, - select: { - noResultsMessage: "Keine Ergebnisse", - single: { - placeholder: "Eintrag auswählen..." - }, - multi: { - placeholder: "Einträge auswählen...", - maxSelectedMessage: "Höchstens #{max} Einträge", - selectedMessage: "#{count} Einträge ausgewählt" - } - } -}; -export default de; -//# sourceMappingURL=de.js.map \ No newline at end of file diff --git a/locales/de.js.map b/locales/de.js.map deleted file mode 100644 index d57b05467..000000000 --- a/locales/de.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"de.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/de.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SACxH;QACD,WAAW,EAAE;YACT,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACtF;QACD,QAAQ,EAAE;YACN,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS;SAClF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,cAAc,EAAE;YACZ,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,oBAAoB;YAC9B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,OAAO,EAAE,oCAAoC;SAChD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,kBAAkB;QACpC,MAAM,EAAE;YACJ,WAAW,EAAE,sBAAsB;SACtC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,uBAAuB;YACpC,kBAAkB,EAAE,2BAA2B;YAC/C,eAAe,EAAE,8BAA8B;SAClD;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : German (de)\n * author : Ciara Ward : https://github.com/ciaraward\n */\n\nconst de:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"\n ],\n monthsShort: [\n \"Jan\", \"Febr\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"\n ],\n weekdays: [\n \"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"\n ],\n weekdaysShort: [\n \"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"\n ],\n weekdaysNarrow: [\n \"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D. MMMM YYYY HH:mm\",\n date: \"D. MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Suchen...\",\n noResults: {\n header: \"Keine Ergebnisse\",\n message: \"Ihre Suche ergab keine Ergebnisse.\"\n }\n },\n select: {\n noResultsMessage: \"Keine Ergebnisse\",\n single: {\n placeholder: \"Eintrag auswählen...\"\n },\n multi: {\n placeholder: \"Einträge auswählen...\",\n maxSelectedMessage: \"Höchstens #{max} Einträge\",\n selectedMessage: \"#{count} Einträge ausgewählt\"\n }\n }\n};\n\nexport default de;\n"]} \ No newline at end of file diff --git a/locales/en-AU.d.ts b/locales/en-AU.d.ts deleted file mode 100644 index c12e3c047..000000000 --- a/locales/en-AU.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../dist"; -/** - * locale : Australian (en-AU) - * author : Trevor Daniels : https://github.com/trevordaniels - */ -declare const enAU: IPartialLocaleValues; -export default enAU; diff --git a/locales/en-AU.js b/locales/en-AU.js deleted file mode 100644 index 573b2c8e4..000000000 --- a/locales/en-AU.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * locale : Australian (en-AU) - * author : Trevor Daniels : https://github.com/trevordaniels - */ -var enAU = { - datepicker: { - firstDayOfWeek: 0 - } -}; -export default enAU; -//# sourceMappingURL=en-AU.js.map \ No newline at end of file diff --git a/locales/en-AU.js.map b/locales/en-AU.js.map deleted file mode 100644 index d4565d579..000000000 --- a/locales/en-AU.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"en-AU.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-AU.ts"],"names":[],"mappings":";;;;AAOA,IAAM,IAAI,GAAwB;IAC9B,UAAU,EAAE;QACR,cAAc,EAAE,CAAC;KACpB;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Australian (en-AU)\n * author : Trevor Daniels : https://github.com/trevordaniels\n */\n\nconst enAU:IPartialLocaleValues = {\n datepicker: {\n firstDayOfWeek: 0\n }\n};\n\nexport default enAU;\n"]} \ No newline at end of file diff --git a/locales/en-GB.d.ts b/locales/en-GB.d.ts deleted file mode 100644 index 498f120c9..000000000 --- a/locales/en-GB.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ILocaleValues } from "../dist"; -declare const enGB: ILocaleValues; -export default enGB; diff --git a/locales/en-GB.js b/locales/en-GB.js deleted file mode 100644 index e78f0f4e9..000000000 --- a/locales/en-GB.js +++ /dev/null @@ -1,56 +0,0 @@ -var enGB = { - datepicker: { - months: [ - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - ], - monthsShort: [ - "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - ], - weekdays: [ - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" - ], - weekdaysShort: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - ], - weekdaysNarrow: [ - "S", "M", "T", "W", "T", "F", "S" - ], - timesOfDay: [ - "a.m.", "p.m." - ], - timesOfDayUppercase: [ - "AM", "PM" - ], - timesOfDayLowercase: [ - "am", "pm" - ], - formats: { - time: "h:mm A", - datetime: "D MMMM YYYY h:mm A", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Search...", - noResults: { - header: "No Results", - message: "Your search returned no results." - } - }, - select: { - noResultsMessage: "No results", - single: { - placeholder: "Select one" - }, - multi: { - placeholder: "Select...", - maxSelectedMessage: "Max #{max} selections", - selectedMessage: "#{count} selections" - } - } -}; -export default enGB; -//# sourceMappingURL=en-GB.js.map \ No newline at end of file diff --git a/locales/en-GB.js.map b/locales/en-GB.js.map deleted file mode 100644 index 0dff648ce..000000000 --- a/locales/en-GB.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"en-GB.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-GB.ts"],"names":[],"mappings":"AAEA,IAAM,IAAI,GAAiB;IACvB,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAA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ues = {\n datepicker: {\n months: [\n \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"\n ],\n monthsShort: [\n \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"\n ],\n weekdays: [\n \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"\n ],\n weekdaysShort: [\n \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"\n ],\n weekdaysNarrow: [\n \"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"\n ],\n timesOfDay: [\n \"a.m.\", \"p.m.\"\n ],\n timesOfDayUppercase: [\n \"AM\", \"PM\"\n ],\n timesOfDayLowercase: [\n \"am\", \"pm\"\n ],\n formats: {\n time: \"h:mm A\",\n datetime: \"D MMMM YYYY h:mm A\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Search...\",\n noResults: {\n header: \"No Results\",\n message: \"Your search returned no results.\"\n }\n },\n select: {\n noResultsMessage: \"No results\",\n single: {\n placeholder: \"Select one\"\n },\n multi: {\n placeholder: \"Select...\",\n maxSelectedMessage: \"Max #{max} selections\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default enGB;\n"]} \ No newline at end of file diff --git a/locales/en-US.d.ts b/locales/en-US.d.ts deleted file mode 100644 index 71757c935..000000000 --- a/locales/en-US.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IPartialLocaleValues } from "../dist"; -declare const enUS: IPartialLocaleValues; -export default enUS; diff --git a/locales/en-US.js b/locales/en-US.js deleted file mode 100644 index 3c00b6edd..000000000 --- a/locales/en-US.js +++ /dev/null @@ -1,14 +0,0 @@ -var enUS = { - datepicker: { - firstDayOfWeek: 0, - formats: { - time: "h:mm A", - datetime: "MMMM D, YYYY h:mm A", - date: "MMMM D, YYYY", - month: "MMMM YYYY", - year: "YYYY" - } - } -}; -export default enUS; -//# sourceMappingURL=en-US.js.map \ No newline at end of file diff --git a/locales/en-US.js.map b/locales/en-US.js.map deleted file mode 100644 index 0c0a0d507..000000000 --- a/locales/en-US.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/en-US.ts"],"names":[],"mappings":"AAEA,IAAM,IAAI,GAAwB;IAC9B,UAAU,EAAE;QACR,cAAc,EAAE,CAAC;QACjB,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,qBAAqB;YAC/B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\nconst enUS:IPartialLocaleValues = {\n datepicker: {\n firstDayOfWeek: 0,\n formats: {\n time: \"h:mm A\",\n datetime: \"MMMM D, YYYY h:mm A\",\n date: \"MMMM D, YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n }\n }\n};\n\nexport default enUS;\n"]} \ No newline at end of file diff --git a/locales/es.d.ts b/locales/es.d.ts deleted file mode 100644 index 26dbd33c6..000000000 --- a/locales/es.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../dist"; -/** - * locale : Spanish (es) - * author : Facundo Donato : https://github.com/genuinefafa - */ -declare const es: IPartialLocaleValues; -export default es; diff --git a/locales/es.js b/locales/es.js deleted file mode 100644 index 9916a4d14..000000000 --- a/locales/es.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : Spanish (es) - * author : Facundo Donato : https://github.com/genuinefafa - */ -var es = { - datepicker: { - months: [ - "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" - ], - monthsShort: [ - "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic" - ], - weekdays: [ - "Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado" - ], - weekdaysShort: [ - "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb" - ], - weekdaysNarrow: [ - "D", "L", "M", "M", "J", "V", "S" - ], - formats: { - time: "HH:mm", - datetime: "D [de] MMMM [de] YYYY HH:mm", - date: "D [de] MMMM [de] YYYY", - month: "MMMM [de] YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Buscar...", - noResults: { - header: "Sin resultados", - message: "La búsqueda no obtuvo resultados." - } - }, - select: { - noResultsMessage: "Sin resultados", - single: { - placeholder: "Seleccione uno" - }, - multi: { - placeholder: "Seleccione...", - maxSelectedMessage: "Puede elegir hasta #{max}", - selectedMessage: "Seleccionados #{count}" - } - } -}; -export default es; -//# sourceMappingURL=es.js.map \ No newline at end of file diff --git a/locales/es.js.map b/locales/es.js.map deleted file mode 100644 index c1e823e1a..000000000 --- a/locales/es.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"es.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/es.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW;SAC9H;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;SAC3E;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,6BAA6B;YACvC,IAAI,EAAE,uBAAuB;YAC7B,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE;YACP,MAAM,EAAE,gBAAgB;YACxB,OAAO,EAAE,mCAAmC;SAC/C;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,gBAAgB;QAClC,MAAM,EAAE;YACJ,WAAW,EAAE,gBAAgB;SAChC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,eAAe;YAC5B,kBAAkB,EAAE,2BAA2B;YAC/C,eAAe,EAAE,wBAAwB;SAC5C;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Spanish (es)\n * author : Facundo Donato : https://github.com/genuinefafa\n */\n\nconst es:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"\n ],\n monthsShort: [\n \"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"\n ],\n weekdays: [\n \"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"\n ],\n weekdaysShort: [\n \"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"\n ],\n weekdaysNarrow: [\n \"D\", \"L\", \"M\", \"M\", \"J\", \"V\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D [de] MMMM [de] YYYY HH:mm\",\n date: \"D [de] MMMM [de] YYYY\",\n month: \"MMMM [de] YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Buscar...\",\n noResults: {\n header: \"Sin resultados\",\n message: \"La búsqueda no obtuvo resultados.\"\n }\n },\n select: {\n noResultsMessage: \"Sin resultados\",\n single: {\n placeholder: \"Seleccione uno\"\n },\n multi: {\n placeholder: \"Seleccione...\",\n maxSelectedMessage: \"Puede elegir hasta #{max}\",\n selectedMessage: \"Seleccionados #{count}\"\n }\n }\n};\n\nexport default es;\n"]} \ No newline at end of file diff --git a/locales/fr.d.ts b/locales/fr.d.ts deleted file mode 100644 index 21c08462f..000000000 --- a/locales/fr.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../dist"; -/** - * locale : French (fr) - * author : Ciara Ward : https://github.com/ciaraward - */ -declare const fr: IPartialLocaleValues; -export default fr; diff --git a/locales/fr.js b/locales/fr.js deleted file mode 100644 index aca0e7c5a..000000000 --- a/locales/fr.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : French (fr) - * author : Ciara Ward : https://github.com/ciaraward - */ -var fr = { - datepicker: { - months: [ - "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" - ], - monthsShort: [ - "Janv", "Févr", "Mars", "Avr", "Mai", "Juin", "Juil", "Août", "Sept", "Oct", "Nov", "Déc" - ], - weekdays: [ - "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" - ], - weekdaysShort: [ - "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" - ], - weekdaysNarrow: [ - "Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM YYYY HH:mm", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Cherche...", - noResults: { - header: "Aucun Résultats", - message: "Votre recherche n'a pas donné de résultats." - } - }, - select: { - noResultsMessage: "Aucun résultats", - single: { - placeholder: "Choisissez-en un" - }, - multi: { - placeholder: "Choisissez-en...", - maxSelectedMessage: "Max #{max} sélections", - selectedMessage: "#{count} selections" - } - } -}; -export default fr; -//# sourceMappingURL=fr.js.map \ No newline at end of file diff --git a/locales/fr.js.map b/locales/fr.js.map deleted file mode 100644 index d7c77ffd4..000000000 --- a/locales/fr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/fr.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SAC1H;QACD,WAAW,EAAE;YACT,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAC5F;QACD,QAAQ,EAAE;YACN,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ;SAC1E;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,YAAY;QACzB,SAAS,EAAE;YACP,MAAM,EAAE,iBAAiB;YACzB,OAAO,EAAE,6CAA6C;SACzD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,iBAAiB;QACnC,MAAM,EAAE;YACJ,WAAW,EAAE,kBAAkB;SAClC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,kBAAkB;YAC/B,kBAAkB,EAAE,uBAAuB;YAC3C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : French (fr)\n * author : Ciara Ward : https://github.com/ciaraward\n */\n\nconst fr:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"\n ],\n monthsShort: [\n \"Janv\", \"Févr\", \"Mars\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Août\", \"Sept\", \"Oct\", \"Nov\", \"Déc\"\n ],\n weekdays: [\n \"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"\n ],\n weekdaysShort: [\n \"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"\n ],\n weekdaysNarrow: [\n \"Di\", \"Lu\", \"Ma\", \"Me\", \"Je\", \"Ve\", \"Sa\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Cherche...\",\n noResults: {\n header: \"Aucun Résultats\",\n message: \"Votre recherche n'a pas donné de résultats.\"\n }\n },\n select: {\n noResultsMessage: \"Aucun résultats\",\n single: {\n placeholder: \"Choisissez-en un\"\n },\n multi: {\n placeholder: \"Choisissez-en...\",\n maxSelectedMessage: \"Max #{max} sélections\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default fr;\n"]} \ No newline at end of file diff --git a/locales/ge.d.ts b/locales/ge.d.ts deleted file mode 100644 index f01ce2b9f..000000000 --- a/locales/ge.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../dist"; -/** - * locale : Georgian (ge) - * author : Vaso Gazdeliani : https://github.com/vaso991 - */ -declare const ge: IPartialLocaleValues; -export default ge; diff --git a/locales/ge.js b/locales/ge.js deleted file mode 100644 index 84c947903..000000000 --- a/locales/ge.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * locale : Georgian (ge) - * author : Vaso Gazdeliani : https://github.com/vaso991 - */ -var ge = { - datepicker: { - months: [ - "იანვარი", "თებერვალი", "მარტი", "აპრილი", "მაისი", "ივნისი", - "ივლისი", "აგვისტო", "სექტემბერი", "ოქტომბერი", "ნოემბერი", "დეკემბერი" - ], - monthsShort: [ - "იან", "თებ", "მარ", "აპრ", "მაი", "ივნ", "ივლ", "აგვ", "სექ", "ოქტ", "ნოემ", "დეკ" - ], - weekdays: [ - "კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი" - ], - weekdaysShort: [ - "კვ", "ორ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ" - ], - weekdaysNarrow: [ - "კ", "ორ", "ს", "ოთ", "ხ", "პ", "შ" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM YYYY HH:mm", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "ძებნა...", - noResults: { - header: "მონაცემები არ მოიძებნა", - message: "თქვენმა ძებნამ არ დააბრუნა შედეგი." - } - }, - select: { - noResultsMessage: "მონაცემები არ მოიძებნა", - single: { - placeholder: "აირჩიე" - }, - multi: { - placeholder: "აირჩიე...", - maxSelectedMessage: "მაქსიმუმ #{max}", - selectedMessage: "არჩეულია #{count}" - } - } -}; -export default ge; -//# sourceMappingURL=ge.js.map \ No newline at end of file diff --git a/locales/ge.js.map b/locales/ge.js.map deleted file mode 100644 index a648c8061..000000000 --- a/locales/ge.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ge.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/ge.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ;YAC5D,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW;SAC1E;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK;SACtF;QACD,QAAQ,EAAE;YACN,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ;SACpF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAChD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACtC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE;YACP,MAAM,EAAE,wBAAwB;YAChC,OAAO,EAAE,oCAAoC;SAChD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,wBAAwB;QAC1C,MAAM,EAAE;YACJ,WAAW,EAAE,QAAQ;SACxB;QACD,KAAK,EAAE;YACH,WAAW,EAAE,WAAW;YACxB,kBAAkB,EAAE,iBAAiB;YACrC,eAAe,EAAE,mBAAmB;SACvC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Georgian (ge)\n * author : Vaso Gazdeliani : https://github.com/vaso991\n */\n\nconst ge:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"იანვარი\", \"თებერვალი\", \"მარტი\", \"აპრილი\", \"მაისი\", \"ივნისი\",\n \"ივლისი\", \"აგვისტო\", \"სექტემბერი\", \"ოქტომბერი\", \"ნოემბერი\", \"დეკემბერი\"\n ],\n monthsShort: [\n \"იან\", \"თებ\", \"მარ\", \"აპრ\", \"მაი\", \"ივნ\", \"ივლ\", \"აგვ\", \"სექ\", \"ოქტ\", \"ნოემ\", \"დეკ\"\n ],\n weekdays: [\n \"კვირა\", \"ორშაბათი\", \"სამშაბათი\", \"ოთხშაბათი\", \"ხუთშაბათი\", \"პარასკევი\", \"შაბათი\"\n ],\n weekdaysShort: [\n \"კვ\", \"ორ\", \"სამ\", \"ოთხ\", \"ხუთ\", \"პარ\", \"შაბ\"\n ],\n weekdaysNarrow: [\n \"კ\", \"ორ\", \"ს\", \"ოთ\", \"ხ\", \"პ\", \"შ\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"ძებნა...\",\n noResults: {\n header: \"მონაცემები არ მოიძებნა\",\n message: \"თქვენმა ძებნამ არ დააბრუნა შედეგი.\"\n }\n },\n select: {\n noResultsMessage: \"მონაცემები არ მოიძებნა\",\n single: {\n placeholder: \"აირჩიე\"\n },\n multi: {\n placeholder: \"აირჩიე...\",\n maxSelectedMessage: \"მაქსიმუმ #{max}\",\n selectedMessage: \"არჩეულია #{count}\"\n }\n }\n};\n\nexport default ge;\n"]} \ No newline at end of file diff --git a/locales/he.d.ts b/locales/he.d.ts deleted file mode 100644 index 2718957ce..000000000 --- a/locales/he.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../dist"; -/** - * locale : Hebrew (he) - * author : David limkys : https://github.com/gotenxds - */ -declare const he: IPartialLocaleValues; -export default he; diff --git a/locales/he.js b/locales/he.js deleted file mode 100644 index 08eda8755..000000000 --- a/locales/he.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : Hebrew (he) - * author : David limkys : https://github.com/gotenxds - */ -var he = { - datepicker: { - months: [ - "ינואר", "פבואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר" - ], - monthsShort: [ - "ינו", "פבו", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ" - ], - weekdays: [ - "ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת" - ], - weekdaysShort: [ - "ראש", "שני", "שלי", "רבי", "חמי", "שיש", "שבת" - ], - weekdaysNarrow: [ - "ר", "ש", "ש", "ר", "ח", "ש", "ש" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM YYYY HH:mm", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 0 - }, - search: { - placeholder: "חפש...", - noResults: { - header: "אין תוצאות", - message: "החיפוש שלך לא אחזיר תוצאות." - } - }, - select: { - noResultsMessage: "אין תוצאות", - single: { - placeholder: "בחר אחד" - }, - multi: { - placeholder: "בחר...", - maxSelectedMessage: "מקסימום #{max} אפשרויות", - selectedMessage: "#{count} selections" - } - } -}; -export default he; -//# sourceMappingURL=he.js.map \ No newline at end of file diff --git a/locales/he.js.map b/locales/he.js.map deleted file mode 100644 index 6bc955dd6..000000000 --- a/locales/he.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"he.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/he.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO;SAC5G;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK;SAC3D;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,QAAQ;QACrB,SAAS,EAAE;YACP,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,6BAA6B;SACzC;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,YAAY;QAC9B,MAAM,EAAE;YACJ,WAAW,EAAE,SAAS;SACzB;QACD,KAAK,EAAE;YACH,WAAW,EAAE,QAAQ;YACrB,kBAAkB,EAAE,yBAAyB;YAC7C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Hebrew (he)\n * author : David limkys : https://github.com/gotenxds\n */\n\nconst he:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"ינואר\", \"פבואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"\n ],\n monthsShort: [\n \"ינו\", \"פבו\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"\n ],\n weekdays: [\n \"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"\n ],\n weekdaysShort: [\n \"ראש\", \"שני\", \"שלי\", \"רבי\", \"חמי\", \"שיש\", \"שבת\"\n ],\n weekdaysNarrow: [\n \"ר\", \"ש\", \"ש\", \"ר\", \"ח\", \"ש\", \"ש\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 0\n },\n search: {\n placeholder: \"חפש...\",\n noResults: {\n header: \"אין תוצאות\",\n message: \"החיפוש שלך לא אחזיר תוצאות.\"\n }\n },\n select: {\n noResultsMessage: \"אין תוצאות\",\n single: {\n placeholder: \"בחר אחד\"\n },\n multi: {\n placeholder: \"בחר...\",\n maxSelectedMessage: \"מקסימום #{max} אפשרויות\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default he;\n"]} \ No newline at end of file diff --git a/locales/index.d.ts b/locales/index.d.ts deleted file mode 100644 index 4d375a215..000000000 --- a/locales/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { RecursivePartial, ILocaleValues } from "../dist"; -declare const _default: { - de: RecursivePartial; - enAU: RecursivePartial; - enGB: ILocaleValues; - enUS: RecursivePartial; - es: RecursivePartial; - it: RecursivePartial; - fr: RecursivePartial; - pt: RecursivePartial; - ru: RecursivePartial; - he: RecursivePartial; - ge: RecursivePartial; - nl: RecursivePartial; -}; -export default _default; diff --git a/locales/index.js b/locales/index.js deleted file mode 100644 index ecf35198a..000000000 --- a/locales/index.js +++ /dev/null @@ -1,27 +0,0 @@ -import de from "./de"; -import enAU from "./en-AU"; -import enGB from "./en-GB"; -import enUS from "./en-US"; -import es from "./es"; -import fr from "./fr"; -import pt from "./pt"; -import it from "./it"; -import ru from "./ru"; -import he from "./he"; -import ge from "./ge"; -import nl from "./nl"; -export default { - de: de, - enAU: enAU, - enGB: enGB, - enUS: enUS, - es: es, - it: it, - fr: fr, - pt: pt, - ru: ru, - he: he, - ge: ge, - nl: nl -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/locales/index.js.map b/locales/index.js.map deleted file mode 100644 index c19fbd7d6..000000000 --- a/locales/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,MAAM,CAAC;AAGtB,eAAe;IACX,EAAE,IAAA;IACF,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;CACL,CAAC","sourcesContent":["import { RecursivePartial, ILocaleValues } from \"../interfaces/values\";\n\nimport de from \"./de\";\nimport enAU from \"./en-AU\";\nimport enGB from \"./en-GB\";\nimport enUS from \"./en-US\";\nimport es from \"./es\";\nimport fr from \"./fr\";\nimport pt from \"./pt\";\nimport it from \"./it\";\nimport ru from \"./ru\";\nimport he from \"./he\";\nimport ge from \"./ge\";\nimport nl from \"./nl\";\n\n// This file exists for the demo app. Don't use this in real life.\nexport default {\n de,\n enAU,\n enGB,\n enUS,\n es,\n it,\n fr,\n pt,\n ru,\n he,\n ge,\n nl\n};\n"]} \ No newline at end of file diff --git a/locales/it.d.ts b/locales/it.d.ts deleted file mode 100644 index 9078717e8..000000000 --- a/locales/it.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../dist"; -/** - * locale : Italian (it) - * author : Massimo Costa : https://github.com/mcosta74 - */ -declare const it: IPartialLocaleValues; -export default it; diff --git a/locales/it.js b/locales/it.js deleted file mode 100644 index 7773f624f..000000000 --- a/locales/it.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : Italian (it) - * author : Massimo Costa : https://github.com/mcosta74 - */ -var it = { - datepicker: { - months: [ - "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" - ], - monthsShort: [ - "Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic" - ], - weekdays: [ - "Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato" - ], - weekdaysShort: [ - "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" - ], - weekdaysNarrow: [ - "D", "L", "M", "M", "G", "V", "S" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM YYYY HH:mm", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Cerca...", - noResults: { - header: "Nessun risultato", - message: "La tua ricerca non ha trovato risultati." - } - }, - select: { - noResultsMessage: "Nessun risultato", - single: { - placeholder: "Scegli uno" - }, - multi: { - placeholder: "Scegli...", - maxSelectedMessage: "Puoi effettuare fino a #{max} scelte.", - selectedMessage: "#{count} scelte" - } - } -}; -export default it; -//# sourceMappingURL=it.js.map \ No newline at end of file diff --git a/locales/it.js.map b/locales/it.js.map deleted file mode 100644 index 02d505ecc..000000000 --- a/locales/it.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"it.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/it.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;SACnI;QACD,WAAW,EAAE;YACT,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SACrF;QACD,QAAQ,EAAE;YACN,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ;SAC/E;QACD,aAAa,EAAE;YACX,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAClD;QACD,cAAc,EAAE;YACZ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SACpC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,OAAO,EAAE,0CAA0C;SACtD;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,kBAAkB;QACpC,MAAM,EAAE;YACJ,WAAW,EAAE,YAAY;SAC5B;QACD,KAAK,EAAE;YACH,WAAW,EAAE,WAAW;YACxB,kBAAkB,EAAE,uCAAuC;YAC3D,eAAe,EAAE,iBAAiB;SACrC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Italian (it)\n * author : Massimo Costa : https://github.com/mcosta74\n */\n\nconst it:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"\n ],\n monthsShort: [\n \"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"\n ],\n weekdays: [\n \"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"\n ],\n weekdaysShort: [\n \"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"\n ],\n weekdaysNarrow: [\n \"D\", \"L\", \"M\", \"M\", \"G\", \"V\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Cerca...\",\n noResults: {\n header: \"Nessun risultato\",\n message: \"La tua ricerca non ha trovato risultati.\"\n }\n },\n select: {\n noResultsMessage: \"Nessun risultato\",\n single: {\n placeholder: \"Scegli uno\"\n },\n multi: {\n placeholder: \"Scegli...\",\n maxSelectedMessage: \"Puoi effettuare fino a #{max} scelte.\",\n selectedMessage: \"#{count} scelte\"\n }\n }\n};\n\nexport default it;\n"]} \ No newline at end of file diff --git a/locales/nl.d.ts b/locales/nl.d.ts deleted file mode 100644 index 603ed0105..000000000 --- a/locales/nl.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../dist"; -/** - * locale : Dutch (nl) - * author : Martijn Melchers : https://github.com/martijnmelchers - */ -declare const nl: IPartialLocaleValues; -export default nl; diff --git a/locales/nl.js b/locales/nl.js deleted file mode 100644 index 3502ed1a8..000000000 --- a/locales/nl.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * locale : Dutch (nl) - * author : Martijn Melchers : https://github.com/martijnmelchers - */ -var nl = { - datepicker: { - months: [ - "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December" - ], - monthsShort: [ - "Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec" - ], - weekdays: [ - "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag" - ], - weekdaysShort: [ - "Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za" - ], - weekdaysNarrow: [ - "Z", "M", "D", "W", "D", "V", "Z" - ], - /* Dutch does not have a translation for am/pm */ - timesOfDay: [ - "a.m.", "p.m." - ], - timesOfDayUppercase: [ - "AM", "PM" - ], - timesOfDayLowercase: [ - "am", "pm" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM YYYY HH:mm", - date: "D MMMM YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Zoeken...", - noResults: { - header: "Geen resultaten", - message: "Er zijn geen resultaten gevonden." - } - }, - select: { - noResultsMessage: "Geen resultation", - single: { - placeholder: "Selecteer een" - }, - multi: { - placeholder: "Selecteren...", - maxSelectedMessage: "Max #{max} selecteren", - selectedMessage: "#{count} geselecteerd" - } - } -}; -export default nl; -//# sourceMappingURL=nl.js.map \ No newline at end of file diff --git a/locales/nl.js.map b/locales/nl.js.map deleted file mode 100644 index 519646049..000000000 --- a/locales/nl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nl.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/nl.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAA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esContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Dutch (nl)\n * author : Martijn Melchers : https://github.com/martijnmelchers\n */\n\nconst nl:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"\n ],\n monthsShort: [\n \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"\n ],\n weekdays: [\n \"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"\n ],\n weekdaysShort: [\n \"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"\n ],\n weekdaysNarrow: [\n \"Z\", \"M\", \"D\", \"W\", \"D\", \"V\", \"Z\"\n ],\n\t\t/* Dutch does not have a translation for am/pm */\n timesOfDay: [\n \"a.m.\", \"p.m.\"\n ],\n timesOfDayUppercase: [\n \"AM\", \"PM\"\n ],\n timesOfDayLowercase: [\n \"am\", \"pm\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM YYYY HH:mm\",\n date: \"D MMMM YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Zoeken...\",\n noResults: {\n header: \"Geen resultaten\",\n message: \"Er zijn geen resultaten gevonden.\"\n }\n },\n select: {\n noResultsMessage: \"Geen resultation\",\n single: {\n placeholder: \"Selecteer een\"\n },\n multi: {\n placeholder: \"Selecteren...\",\n maxSelectedMessage: \"Max #{max} selecteren\",\n selectedMessage: \"#{count} geselecteerd\"\n }\n }\n};\n\nexport default nl;\n"]} \ No newline at end of file diff --git a/locales/pt.d.ts b/locales/pt.d.ts deleted file mode 100644 index 1b03f334c..000000000 --- a/locales/pt.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../dist"; -/** - * locale : Portuguese (pt) - * author : Fernando Niwes : https://github.com/fniwes - */ -declare const pt: IPartialLocaleValues; -export default pt; diff --git a/locales/pt.js b/locales/pt.js deleted file mode 100644 index e925bfd10..000000000 --- a/locales/pt.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : Portuguese (pt) - * author : Fernando Niwes : https://github.com/fniwes - */ -var pt = { - datepicker: { - months: [ - "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro" - ], - monthsShort: [ - "jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez" - ], - weekdays: [ - "Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado" - ], - weekdaysShort: [ - "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" - ], - weekdaysNarrow: [ - "D", "1", "2", "3", "4", "5", "S" - ], - formats: { - time: "HH:mm", - datetime: "D MMMM [de] YYYY HH:mm", - date: "D [de] MMMM [de] YYYY", - month: "MMMM [de] YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Pesquisar...", - noResults: { - header: "Sem resultados", - message: "Sua pesquisa não retornou resultados." - } - }, - select: { - noResultsMessage: "Sem resultados", - single: { - placeholder: "Escolha uma opção" - }, - multi: { - placeholder: "Escolher...", - maxSelectedMessage: "Max #{max} opçãoes", - selectedMessage: "#{count} selections" - } - } -}; -export default pt; -//# sourceMappingURL=pt.js.map \ No newline at end of file diff --git a/locales/pt.js.map b/locales/pt.js.map deleted file mode 100644 index b43494bfd..000000000 --- a/locales/pt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/pt.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,SAAS,E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(pt)\n * author : Fernando Niwes : https://github.com/fniwes\n */\n\nconst pt:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"janeiro\", \"fevereiro\", \"março\", \"abril\", \"maio\", \"junho\", \"julho\", \"agosto\", \"setembro\", \"outubro\", \"novembro\", \"dezembro\"\n ],\n monthsShort: [\n \"jan\", \"fev\", \"mar\", \"abr\", \"mai\", \"jun\", \"jul\", \"ago\", \"set\", \"out\", \"nov\", \"dez\"\n ],\n weekdays: [\n \"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"\n ],\n weekdaysShort: [\n \"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"\n ],\n weekdaysNarrow: [\n \"D\", \"1\", \"2\", \"3\", \"4\", \"5\", \"S\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"D MMMM [de] YYYY HH:mm\",\n date: \"D [de] MMMM [de] YYYY\",\n month: \"MMMM [de] YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Pesquisar...\",\n noResults: {\n header: \"Sem resultados\",\n message: \"Sua pesquisa não retornou resultados.\"\n }\n },\n select: {\n noResultsMessage: \"Sem resultados\",\n single: {\n placeholder: \"Escolha uma opção\"\n },\n multi: {\n placeholder: \"Escolher...\",\n maxSelectedMessage: \"Max #{max} opçãoes\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default pt;\n"]} \ No newline at end of file diff --git a/locales/ru.d.ts b/locales/ru.d.ts deleted file mode 100644 index 806fd4177..000000000 --- a/locales/ru.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPartialLocaleValues } from "../dist"; -/** - * locale : Russian (ru) - * author : Maksim Moiseikin : https://github.com/maksim-m - */ -declare const ru: IPartialLocaleValues; -export default ru; diff --git a/locales/ru.js b/locales/ru.js deleted file mode 100644 index c06c2847a..000000000 --- a/locales/ru.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * locale : Russian (ru) - * author : Maksim Moiseikin : https://github.com/maksim-m - */ -var ru = { - datepicker: { - months: [ - "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" - ], - monthsShort: [ - "Янв", "Февр", "Март", "Апр", "Май", "Июнь", "Июль", "Авг", "Сент", "Окт", "Ноя", "Дек" - ], - weekdays: [ - "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота" - ], - weekdaysShort: [ - "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" - ], - weekdaysNarrow: [ - "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" - ], - formats: { - time: "HH:mm", - datetime: "DD.MM.YYYY HH:mm", - date: "DD.MM.YYYY", - month: "MMMM YYYY", - year: "YYYY" - }, - firstDayOfWeek: 1 - }, - search: { - placeholder: "Поиск...", - noResults: { - header: "Нет результатов", - message: "Поиск не дал результатов." - } - }, - select: { - noResultsMessage: "Нет результатов", - single: { - placeholder: "Выберите одно значение" - }, - multi: { - placeholder: "Выберите...", - maxSelectedMessage: "Не более #{max} значений", - selectedMessage: "#{count} selections" - } - } -}; -export default ru; -//# sourceMappingURL=ru.js.map \ No newline at end of file diff --git a/locales/ru.js.map b/locales/ru.js.map deleted file mode 100644 index 8908bf702..000000000 --- a/locales/ru.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ru.js","sourceRoot":"","sources":["../../../../src/behaviors/localization/locales/ru.ts"],"names":[],"mappings":";;;;AAOA,IAAM,EAAE,GAAwB;IAC5B,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS;SACrH;QACD,WAAW,EAAE;YACT,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;SAC1F;QACD,QAAQ,EAAE;YACN,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;SACpF;QACD,aAAa,EAAE;YACX,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,cAAc,EAAE;YACZ,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;SAC3C;QACD,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,kBAAkB;YAC5B,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,MAAM;SACf;QACD,cAAc,EAAE,CAAC;KACpB;IACD,MAAM,EAAE;QACJ,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE;YACP,MAAM,EAAE,iBAAiB;YACzB,OAAO,EAAE,2BAA2B;SACvC;KACJ;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,iBAAiB;QACnC,MAAM,EAAE;YACJ,WAAW,EAAE,wBAAwB;SACxC;QACD,KAAK,EAAE;YACH,WAAW,EAAE,aAAa;YAC1B,kBAAkB,EAAE,0BAA0B;YAC9C,eAAe,EAAE,qBAAqB;SACzC;KACJ;CACJ,CAAC;AAEF,eAAe,EAAE,CAAC","sourcesContent":["import { IPartialLocaleValues } from \"../interfaces/values\";\n\n/**\n * locale : Russian (ru)\n * author : Maksim Moiseikin : https://github.com/maksim-m\n */\n\nconst ru:IPartialLocaleValues = {\n datepicker: {\n months: [\n \"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Май\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Октябрь\", \"Ноябрь\", \"Декабрь\"\n ],\n monthsShort: [\n \"Янв\", \"Февр\", \"Март\", \"Апр\", \"Май\", \"Июнь\", \"Июль\", \"Авг\", \"Сент\", \"Окт\", \"Ноя\", \"Дек\"\n ],\n weekdays: [\n \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"\n ],\n weekdaysShort: [\n \"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"\n ],\n weekdaysNarrow: [\n \"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"\n ],\n formats: {\n time: \"HH:mm\",\n datetime: \"DD.MM.YYYY HH:mm\",\n date: \"DD.MM.YYYY\",\n month: \"MMMM YYYY\",\n year: \"YYYY\"\n },\n firstDayOfWeek: 1\n },\n search: {\n placeholder: \"Поиск...\",\n noResults: {\n header: \"Нет результатов\",\n message: \"Поиск не дал результатов.\"\n }\n },\n select: {\n noResultsMessage: \"Нет результатов\",\n single: {\n placeholder: \"Выберите одно значение\"\n },\n multi: {\n placeholder: \"Выберите...\",\n maxSelectedMessage: \"Не более #{max} значений\",\n selectedMessage: \"#{count} selections\"\n }\n }\n};\n\nexport default ru;\n"]} \ No newline at end of file