@bravobit/bb-foundation 0.14.2 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -47
- package/auth/bravobit-bb-foundation-auth.d.ts +5 -5
- package/auth/lib/auth.interceptor.d.ts +21 -21
- package/auth/lib/auth.module.d.ts +15 -15
- package/auth/lib/auth.service.d.ts +59 -59
- package/auth/lib/auth.session.d.ts +34 -34
- package/auth/lib/directives/authenticated.directive.d.ts +14 -14
- package/auth/lib/directives/permission.directive.d.ts +24 -24
- package/auth/lib/directives/role.directive.d.ts +16 -16
- package/auth/lib/guards/anonymous.guard.d.ts +11 -11
- package/auth/lib/guards/authenticated.guard.d.ts +11 -11
- package/auth/lib/helpers/jwt.helper.d.ts +8 -8
- package/auth/lib/helpers/mapper.helper.d.ts +23 -23
- package/auth/lib/interfaces/config.interface.d.ts +12 -12
- package/auth/lib/interfaces/mapper.interface.d.ts +19 -19
- package/auth/lib/interfaces/provider.interface.d.ts +16 -16
- package/auth/lib/interfaces/token.interface.d.ts +11 -11
- package/auth/lib/permissions.service.d.ts +14 -14
- package/auth/lib/providers/email.provider.d.ts +15 -15
- package/auth/lib/providers/verify.provider.d.ts +13 -13
- package/auth/lib/tokens/use-authorization.token.d.ts +2 -2
- package/auth/public_api.d.ts +18 -18
- package/bravobit-bb-foundation.d.ts +5 -5
- package/bundles/bravobit-bb-foundation-auth.umd.js +1400 -1402
- package/bundles/bravobit-bb-foundation-auth.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-collections.umd.js +851 -0
- package/bundles/bravobit-bb-foundation-collections.umd.js.map +1 -0
- package/bundles/bravobit-bb-foundation-dashboard.umd.js +817 -819
- package/bundles/bravobit-bb-foundation-dashboard.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-dialog.umd.js +649 -651
- package/bundles/bravobit-bb-foundation-dialog.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-elements.umd.js +2651 -2653
- package/bundles/bravobit-bb-foundation-elements.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-http.umd.js +488 -490
- package/bundles/bravobit-bb-foundation-http.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-localize.umd.js +1208 -1210
- package/bundles/bravobit-bb-foundation-localize.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-notifications.umd.js +743 -745
- package/bundles/bravobit-bb-foundation-notifications.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-recaptcha.umd.js +640 -642
- package/bundles/bravobit-bb-foundation-recaptcha.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-rxjs.umd.js +13 -13
- package/bundles/bravobit-bb-foundation-rxjs.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-storage.umd.js +756 -758
- package/bundles/bravobit-bb-foundation-storage.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-table.umd.js +993 -995
- package/bundles/bravobit-bb-foundation-table.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation.umd.js +1336 -1263
- package/bundles/bravobit-bb-foundation.umd.js.map +1 -1
- package/collections/bravobit-bb-foundation-collections.d.ts +5 -0
- package/collections/lib/collection.d.ts +40 -0
- package/collections/lib/collections.module.d.ts +10 -0
- package/collections/lib/components/collections-pager/collections-pager.component.d.ts +34 -0
- package/collections/lib/components/collections-viewer/collections-viewer.component.d.ts +12 -0
- package/collections/lib/components/collections.directive.d.ts +17 -0
- package/collections/lib/interfaces/collection.interface.d.ts +26 -0
- package/collections/lib/providers/api-collection.provider.d.ts +15 -0
- package/collections/lib/providers/collection.provider.d.ts +6 -0
- package/collections/lib/providers/local-collection.provider.d.ts +8 -0
- package/collections/package.json +10 -0
- package/collections/public_api.d.ts +9 -0
- package/dashboard/bravobit-bb-foundation-dashboard.d.ts +5 -5
- package/dashboard/lib/dashboard/dashboard.component.d.ts +19 -19
- package/dashboard/lib/dashboard-header/dashboard-header.component.d.ts +11 -11
- package/dashboard/lib/dashboard-menu/dashboard-menu.component.d.ts +9 -9
- package/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.d.ts +11 -11
- package/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.d.ts +21 -21
- package/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.d.ts +27 -27
- package/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.d.ts +16 -16
- package/dashboard/lib/dashboard.module.d.ts +16 -16
- package/dashboard/public_api.d.ts +8 -8
- package/dialog/bravobit-bb-foundation-dialog.d.ts +5 -5
- package/dialog/lib/dialog-actions/dialog-actions.component.d.ts +5 -5
- package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +16 -16
- package/dialog/lib/dialog-container/dialog-container.component.d.ts +24 -24
- package/dialog/lib/dialog-header/dialog-header.component.d.ts +9 -9
- package/dialog/lib/dialog-link/dialog-link.component.d.ts +5 -5
- package/dialog/lib/dialog-modal/dialog-modal.component.d.ts +12 -12
- package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +22 -22
- package/dialog/lib/dialog.injector.d.ts +8 -8
- package/dialog/lib/dialog.insertion.d.ts +8 -8
- package/dialog/lib/dialog.interfaces.d.ts +3 -3
- package/dialog/lib/dialog.module.d.ts +19 -19
- package/dialog/lib/dialog.ref.d.ts +8 -8
- package/dialog/lib/dialog.service.d.ts +19 -19
- package/dialog/public_api.d.ts +9 -9
- package/elements/bravobit-bb-foundation-elements.d.ts +5 -5
- package/elements/lib/avatar/avatar.component.d.ts +25 -25
- package/elements/lib/button/button.component.d.ts +23 -23
- package/elements/lib/checkbox/checkbox.component.d.ts +27 -27
- package/elements/lib/date-picker/date-picker.component.d.ts +69 -69
- package/elements/lib/directives/addon.directive.d.ts +9 -9
- package/elements/lib/directives/autosize.directive.d.ts +18 -18
- package/elements/lib/directives/focus-trap.directive.d.ts +17 -17
- package/elements/lib/directives/focus.directive.d.ts +14 -14
- package/elements/lib/directives/form-submit.directive.d.ts +17 -17
- package/elements/lib/directives/input.directive.d.ts +38 -38
- package/elements/lib/directives/template.directive.d.ts +10 -10
- package/elements/lib/dropdown/dropdown.component.d.ts +21 -21
- package/elements/lib/elements.interfaces.d.ts +25 -25
- package/elements/lib/elements.module.d.ts +116 -116
- package/elements/lib/file-picker/file-picker.component.d.ts +49 -49
- package/elements/lib/form-control/form-control.component.d.ts +21 -21
- package/elements/lib/form-error/form-error.component.d.ts +29 -29
- package/elements/lib/form-group/form-group.component.d.ts +10 -10
- package/elements/lib/icon/icon.component.d.ts +22 -22
- package/elements/lib/image-picker/image-picker.component.d.ts +38 -38
- package/elements/lib/pipes/file-image.pipe.d.ts +13 -13
- package/elements/lib/pipes/file-size.pipe.d.ts +8 -8
- package/elements/lib/pipes/relative-time.pipe.d.ts +19 -19
- package/elements/lib/spinner/spinner.component.d.ts +12 -12
- package/elements/lib/tag/tag.component.d.ts +7 -7
- package/elements/public_api.d.ts +25 -25
- package/esm2015/auth/bravobit-bb-foundation-auth.js +4 -4
- package/esm2015/auth/lib/auth.interceptor.js +95 -95
- package/esm2015/auth/lib/auth.module.js +54 -54
- package/esm2015/auth/lib/auth.service.js +299 -299
- package/esm2015/auth/lib/auth.session.js +136 -136
- package/esm2015/auth/lib/directives/authenticated.directive.js +32 -32
- package/esm2015/auth/lib/directives/permission.directive.js +81 -81
- package/esm2015/auth/lib/directives/role.directive.js +38 -38
- package/esm2015/auth/lib/guards/anonymous.guard.js +35 -35
- package/esm2015/auth/lib/guards/authenticated.guard.js +36 -36
- package/esm2015/auth/lib/helpers/jwt.helper.js +69 -69
- package/esm2015/auth/lib/helpers/mapper.helper.js +35 -35
- package/esm2015/auth/lib/interfaces/config.interface.js +3 -3
- package/esm2015/auth/lib/interfaces/mapper.interface.js +2 -2
- package/esm2015/auth/lib/interfaces/provider.interface.js +2 -2
- package/esm2015/auth/lib/interfaces/token.interface.js +2 -2
- package/esm2015/auth/lib/permissions.service.js +58 -58
- package/esm2015/auth/lib/providers/email.provider.js +26 -26
- package/esm2015/auth/lib/providers/verify.provider.js +20 -20
- package/esm2015/auth/lib/tokens/use-authorization.token.js +3 -3
- package/esm2015/auth/public_api.js +19 -19
- package/esm2015/bravobit-bb-foundation.js +4 -4
- package/esm2015/collections/bravobit-bb-foundation-collections.js +5 -0
- package/esm2015/collections/lib/collection.js +88 -0
- package/esm2015/collections/lib/collections.module.js +54 -0
- package/esm2015/collections/lib/components/collections-pager/collections-pager.component.js +136 -0
- package/esm2015/collections/lib/components/collections-viewer/collections-viewer.component.js +39 -0
- package/esm2015/collections/lib/components/collections.directive.js +43 -0
- package/esm2015/collections/lib/interfaces/collection.interface.js +2 -0
- package/esm2015/collections/lib/providers/api-collection.provider.js +69 -0
- package/esm2015/collections/lib/providers/collection.provider.js +14 -0
- package/esm2015/collections/lib/providers/local-collection.provider.js +16 -0
- package/esm2015/collections/public_api.js +10 -0
- package/esm2015/dashboard/bravobit-bb-foundation-dashboard.js +4 -4
- package/esm2015/dashboard/lib/dashboard/dashboard.component.js +64 -64
- package/esm2015/dashboard/lib/dashboard-header/dashboard-header.component.js +41 -41
- package/esm2015/dashboard/lib/dashboard-menu/dashboard-menu.component.js +39 -39
- package/esm2015/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.js +38 -38
- package/esm2015/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.js +83 -83
- package/esm2015/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.js +110 -110
- package/esm2015/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.js +71 -71
- package/esm2015/dashboard/lib/dashboard.module.js +47 -47
- package/esm2015/dashboard/public_api.js +9 -9
- package/esm2015/dialog/bravobit-bb-foundation-dialog.js +4 -4
- package/esm2015/dialog/lib/dialog-actions/dialog-actions.component.js +20 -20
- package/esm2015/dialog/lib/dialog-confirm/dialog-confirm.component.js +45 -45
- package/esm2015/dialog/lib/dialog-container/dialog-container.component.js +162 -162
- package/esm2015/dialog/lib/dialog-header/dialog-header.component.js +33 -33
- package/esm2015/dialog/lib/dialog-link/dialog-link.component.js +19 -19
- package/esm2015/dialog/lib/dialog-modal/dialog-modal.component.js +54 -54
- package/esm2015/dialog/lib/dialog-overlay/dialog-overlay.component.js +143 -143
- package/esm2015/dialog/lib/dialog.injector.js +18 -18
- package/esm2015/dialog/lib/dialog.insertion.js +16 -16
- package/esm2015/dialog/lib/dialog.interfaces.js +3 -3
- package/esm2015/dialog/lib/dialog.module.js +74 -74
- package/esm2015/dialog/lib/dialog.ref.js +22 -22
- package/esm2015/dialog/lib/dialog.service.js +77 -77
- package/esm2015/dialog/public_api.js +10 -10
- package/esm2015/elements/bravobit-bb-foundation-elements.js +4 -4
- package/esm2015/elements/lib/avatar/avatar.component.js +151 -151
- package/esm2015/elements/lib/button/button.component.js +79 -79
- package/esm2015/elements/lib/checkbox/checkbox.component.js +83 -83
- package/esm2015/elements/lib/date-picker/date-picker.component.js +322 -322
- package/esm2015/elements/lib/directives/addon.directive.js +29 -29
- package/esm2015/elements/lib/directives/autosize.directive.js +74 -74
- package/esm2015/elements/lib/directives/focus-trap.directive.js +77 -77
- package/esm2015/elements/lib/directives/focus.directive.js +39 -39
- package/esm2015/elements/lib/directives/form-submit.directive.js +53 -53
- package/esm2015/elements/lib/directives/input.directive.js +139 -139
- package/esm2015/elements/lib/directives/template.directive.js +28 -28
- package/esm2015/elements/lib/dropdown/dropdown.component.js +111 -111
- package/esm2015/elements/lib/elements.interfaces.js +4 -4
- package/esm2015/elements/lib/elements.module.js +177 -177
- package/esm2015/elements/lib/file-picker/file-picker.component.js +247 -247
- package/esm2015/elements/lib/form-control/form-control.component.js +58 -58
- package/esm2015/elements/lib/form-error/form-error.component.js +116 -116
- package/esm2015/elements/lib/form-group/form-group.component.js +27 -27
- package/esm2015/elements/lib/icon/icon.component.js +110 -110
- package/esm2015/elements/lib/image-picker/image-picker.component.js +119 -119
- package/esm2015/elements/lib/pipes/file-image.pipe.js +45 -45
- package/esm2015/elements/lib/pipes/file-size.pipe.js +28 -28
- package/esm2015/elements/lib/pipes/relative-time.pipe.js +96 -96
- package/esm2015/elements/lib/spinner/spinner.component.js +34 -34
- package/esm2015/elements/lib/tag/tag.component.js +26 -26
- package/esm2015/elements/public_api.js +26 -26
- package/esm2015/http/bravobit-bb-foundation-http.js +4 -4
- package/esm2015/http/lib/classes/http.config.js +31 -31
- package/esm2015/http/lib/classes/http.error.js +21 -21
- package/esm2015/http/lib/http.interfaces.js +2 -2
- package/esm2015/http/lib/http.module.js +43 -43
- package/esm2015/http/lib/interceptors/base-url.interceptor.js +52 -52
- package/esm2015/http/lib/interceptors/error.interceptor.js +33 -33
- package/esm2015/http/public_api.js +7 -7
- package/esm2015/lib/core/coercions/boolean-coercion.js +4 -4
- package/esm2015/lib/core/miscellaneous/regex.js +5 -5
- package/esm2015/lib/core/miscellaneous/validator.js +86 -86
- package/esm2015/lib/core/mixins/can-disable.js +16 -16
- package/esm2015/lib/core/mixins/can-hide-errors.js +16 -16
- package/esm2015/lib/core/mixins/can-load.js +16 -16
- package/esm2015/lib/core/mixins/constructor.js +2 -2
- package/esm2015/lib/core/mixins/has-error.js +16 -16
- package/esm2015/lib/core/mixins/is-focused.js +16 -16
- package/esm2015/lib/core/mixins/is-grouped.js +16 -16
- package/esm2015/lib/core/mixins/is-readonly.js +16 -16
- package/esm2015/lib/core/mixins/is-required.js +16 -16
- package/esm2015/lib/core/services/clipboard.service.js +72 -0
- package/esm2015/lib/core/services/exif.service.js +168 -168
- package/esm2015/lib/core/services/file-loader.service.js +90 -90
- package/esm2015/lib/core/services/image-converter.service.js +130 -130
- package/esm2015/lib/core/services/languages.service.js +74 -74
- package/esm2015/lib/core/services/network.service.js +56 -56
- package/esm2015/lib/core/services/patch.service.js +65 -65
- package/esm2015/lib/core/services/platform.service.js +42 -42
- package/esm2015/lib/core/tokens/accept-language.token.js +3 -3
- package/esm2015/lib/core/tokens/base-url.token.js +3 -3
- package/esm2015/lib/core/tokens/cookie.token.js +3 -3
- package/esm2015/lib/core/tokens/location.token.js +6 -6
- package/esm2015/lib/core/tokens/navigator.token.js +6 -6
- package/esm2015/lib/core/tokens/window.token.js +12 -12
- package/esm2015/localize/bravobit-bb-foundation-localize.js +4 -4
- package/esm2015/localize/lib/functions/date.function.js +18 -18
- package/esm2015/localize/lib/functions/lowercase.function.js +13 -13
- package/esm2015/localize/lib/functions/uppercase.function.js +13 -13
- package/esm2015/localize/lib/handlers/missing.handler.js +17 -17
- package/esm2015/localize/lib/interfaces/config.interfaces.js +10 -10
- package/esm2015/localize/lib/interfaces/dictionary.interfaces.js +8 -8
- package/esm2015/localize/lib/interfaces/functions.interfaces.js +8 -8
- package/esm2015/localize/lib/interfaces/handlers.interfaces.js +2 -2
- package/esm2015/localize/lib/interfaces/options.interfaces.js +6 -6
- package/esm2015/localize/lib/localizations/dutch.localization.js +53 -53
- package/esm2015/localize/lib/localizations/english.localization.js +53 -53
- package/esm2015/localize/lib/localize.dictionary.js +137 -137
- package/esm2015/localize/lib/localize.module.js +69 -69
- package/esm2015/localize/lib/localize.pipe.js +49 -49
- package/esm2015/localize/lib/localize.service.js +282 -282
- package/esm2015/localize/lib/views/localize-string/localize-string.component.js +99 -99
- package/esm2015/localize/lib/views/localize-template-or-string.directive.js +28 -28
- package/esm2015/localize/lib/views/localize-template.directive.js +21 -21
- package/esm2015/localize/public_api.js +18 -18
- package/esm2015/notifications/bravobit-bb-foundation-notifications.js +4 -4
- package/esm2015/notifications/lib/notifications-item/notifications-item.component.js +108 -108
- package/esm2015/notifications/lib/notifications-list/notifications-list.component.js +56 -56
- package/esm2015/notifications/lib/notifications.animations.js +28 -28
- package/esm2015/notifications/lib/notifications.injector.js +18 -18
- package/esm2015/notifications/lib/notifications.interfaces.js +20 -20
- package/esm2015/notifications/lib/notifications.module.js +31 -31
- package/esm2015/notifications/lib/notifications.service.js +145 -145
- package/esm2015/notifications/public_api.js +4 -4
- package/esm2015/public_api.js +30 -29
- package/esm2015/recaptcha/bravobit-bb-foundation-recaptcha.js +4 -4
- package/esm2015/recaptcha/lib/recaptcha/recaptcha.component.js +199 -199
- package/esm2015/recaptcha/lib/recaptcha-loader.service.js +93 -93
- package/esm2015/recaptcha/lib/recaptcha.interface.js +3 -3
- package/esm2015/recaptcha/lib/recaptcha.module.js +27 -27
- package/esm2015/recaptcha/public_api.js +5 -5
- package/esm2015/rxjs/bravobit-bb-foundation-rxjs.js +4 -4
- package/esm2015/rxjs/lib/operators/combine-latest-map.operator.js +7 -7
- package/esm2015/rxjs/lib/operators/filter-nil.operator.js +5 -5
- package/esm2015/rxjs/public_api.js +3 -3
- package/esm2015/storage/bravobit-bb-foundation-storage.js +4 -4
- package/esm2015/storage/lib/interfaces/attributes.interface.js +2 -2
- package/esm2015/storage/lib/interfaces/memory.interface.js +2 -2
- package/esm2015/storage/lib/interfaces/strategy.interface.js +2 -2
- package/esm2015/storage/lib/storage.service.js +111 -111
- package/esm2015/storage/lib/strategies/cookie-storage.strategy.js +143 -143
- package/esm2015/storage/lib/strategies/memory-storage.strategy.js +56 -56
- package/esm2015/storage/lib/strategies/polyfill-storage.strategy.js +102 -102
- package/esm2015/storage/public_api.js +8 -8
- package/esm2015/table/bravobit-bb-foundation-table.js +4 -4
- package/esm2015/table/lib/components/table/table.component.js +183 -183
- package/esm2015/table/lib/components/table-cell/table-cell.component.js +19 -19
- package/esm2015/table/lib/components/table-header-cell/table-header-cell.component.js +141 -141
- package/esm2015/table/lib/components/table-pager/table-pager.component.js +146 -146
- package/esm2015/table/lib/data/datasource.data.js +32 -32
- package/esm2015/table/lib/data/generic.data.js +73 -73
- package/esm2015/table/lib/interfaces/datasource.interface.js +2 -2
- package/esm2015/table/lib/interfaces/table.interfaces.js +2 -2
- package/esm2015/table/lib/table.module.js +39 -39
- package/esm2015/table/public_api.js +10 -10
- package/fesm2015/bravobit-bb-foundation-auth.js +915 -915
- package/fesm2015/bravobit-bb-foundation-auth.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-collections.js +447 -0
- package/fesm2015/bravobit-bb-foundation-collections.js.map +1 -0
- package/fesm2015/bravobit-bb-foundation-dashboard.js +434 -434
- package/fesm2015/bravobit-bb-foundation-dashboard.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-dialog.js +603 -603
- package/fesm2015/bravobit-bb-foundation-dialog.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-elements.js +2076 -2076
- package/fesm2015/bravobit-bb-foundation-elements.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-http.js +154 -154
- package/fesm2015/bravobit-bb-foundation-http.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-localize.js +796 -796
- package/fesm2015/bravobit-bb-foundation-localize.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-notifications.js +364 -364
- package/fesm2015/bravobit-bb-foundation-notifications.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-recaptcha.js +297 -297
- package/fesm2015/bravobit-bb-foundation-recaptcha.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-rxjs.js +7 -7
- package/fesm2015/bravobit-bb-foundation-rxjs.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-storage.js +399 -399
- package/fesm2015/bravobit-bb-foundation-storage.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-table.js +578 -578
- package/fesm2015/bravobit-bb-foundation-table.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation.js +854 -785
- package/fesm2015/bravobit-bb-foundation.js.map +1 -1
- package/http/bravobit-bb-foundation-http.d.ts +5 -5
- package/http/lib/classes/http.config.d.ts +9 -9
- package/http/lib/classes/http.error.d.ts +7 -7
- package/http/lib/http.interfaces.d.ts +12 -12
- package/http/lib/http.module.d.ts +15 -15
- package/http/lib/interceptors/base-url.interceptor.d.ts +15 -15
- package/http/lib/interceptors/error.interceptor.d.ts +11 -11
- package/http/public_api.d.ts +6 -6
- package/lib/core/coercions/boolean-coercion.d.ts +1 -1
- package/lib/core/miscellaneous/regex.d.ts +4 -4
- package/lib/core/miscellaneous/validator.d.ts +13 -13
- package/lib/core/mixins/can-disable.d.ts +6 -6
- package/lib/core/mixins/can-hide-errors.d.ts +6 -6
- package/lib/core/mixins/can-load.d.ts +6 -6
- package/lib/core/mixins/constructor.d.ts +1 -1
- package/lib/core/mixins/has-error.d.ts +6 -6
- package/lib/core/mixins/is-focused.d.ts +6 -6
- package/lib/core/mixins/is-grouped.d.ts +6 -6
- package/lib/core/mixins/is-readonly.d.ts +6 -6
- package/lib/core/mixins/is-required.d.ts +6 -6
- package/lib/core/services/clipboard.service.d.ts +18 -0
- package/lib/core/services/exif.service.d.ts +15 -15
- package/lib/core/services/file-loader.service.d.ts +13 -13
- package/lib/core/services/image-converter.service.d.ts +21 -21
- package/lib/core/services/languages.service.d.ts +16 -16
- package/lib/core/services/network.service.d.ts +14 -14
- package/lib/core/services/patch.service.d.ts +16 -16
- package/lib/core/services/platform.service.d.ts +18 -18
- package/lib/core/tokens/accept-language.token.d.ts +2 -2
- package/lib/core/tokens/base-url.token.d.ts +2 -2
- package/lib/core/tokens/cookie.token.d.ts +2 -2
- package/lib/core/tokens/location.token.d.ts +2 -2
- package/lib/core/tokens/navigator.token.d.ts +2 -2
- package/lib/core/tokens/window.token.d.ts +2 -2
- package/localize/bravobit-bb-foundation-localize.d.ts +5 -5
- package/localize/lib/functions/date.function.d.ts +5 -5
- package/localize/lib/functions/lowercase.function.d.ts +5 -5
- package/localize/lib/functions/uppercase.function.d.ts +5 -5
- package/localize/lib/handlers/missing.handler.d.ts +6 -6
- package/localize/lib/interfaces/config.interfaces.d.ts +8 -8
- package/localize/lib/interfaces/dictionary.interfaces.d.ts +12 -12
- package/localize/lib/interfaces/functions.interfaces.d.ts +9 -9
- package/localize/lib/interfaces/handlers.interfaces.d.ts +6 -6
- package/localize/lib/interfaces/options.interfaces.d.ts +10 -10
- package/localize/lib/localizations/dutch.localization.d.ts +51 -51
- package/localize/lib/localizations/english.localization.d.ts +51 -51
- package/localize/lib/localize.dictionary.d.ts +24 -24
- package/localize/lib/localize.module.d.ts +18 -18
- package/localize/lib/localize.pipe.d.ts +12 -12
- package/localize/lib/localize.service.d.ts +51 -51
- package/localize/lib/views/localize-string/localize-string.component.d.ts +23 -23
- package/localize/lib/views/localize-template-or-string.directive.d.ts +10 -10
- package/localize/lib/views/localize-template.directive.d.ts +9 -9
- package/localize/public_api.d.ts +17 -17
- package/notifications/bravobit-bb-foundation-notifications.d.ts +5 -5
- package/notifications/lib/notifications-item/notifications-item.component.d.ts +34 -34
- package/notifications/lib/notifications-list/notifications-list.component.d.ts +16 -16
- package/notifications/lib/notifications.animations.d.ts +1 -1
- package/notifications/lib/notifications.injector.d.ts +8 -8
- package/notifications/lib/notifications.interfaces.d.ts +49 -49
- package/notifications/lib/notifications.module.d.ts +13 -13
- package/notifications/lib/notifications.service.d.ts +34 -34
- package/notifications/public_api.d.ts +3 -3
- package/package.json +5 -5
- package/public_api.d.ts +26 -25
- package/recaptcha/bravobit-bb-foundation-recaptcha.d.ts +5 -5
- package/recaptcha/lib/recaptcha/recaptcha.component.d.ts +47 -47
- package/recaptcha/lib/recaptcha-loader.service.d.ts +22 -22
- package/recaptcha/lib/recaptcha.interface.d.ts +14 -14
- package/recaptcha/lib/recaptcha.module.d.ts +10 -10
- package/recaptcha/public_api.d.ts +4 -4
- package/rxjs/bravobit-bb-foundation-rxjs.d.ts +5 -5
- package/rxjs/lib/operators/combine-latest-map.operator.d.ts +8 -8
- package/rxjs/lib/operators/filter-nil.operator.d.ts +1 -1
- package/rxjs/public_api.d.ts +2 -2
- package/storage/bravobit-bb-foundation-storage.d.ts +5 -5
- package/storage/lib/interfaces/attributes.interface.d.ts +13 -13
- package/storage/lib/interfaces/memory.interface.d.ts +7 -7
- package/storage/lib/interfaces/strategy.interface.d.ts +17 -17
- package/storage/lib/storage.service.d.ts +26 -26
- package/storage/lib/strategies/cookie-storage.strategy.d.ts +20 -20
- package/storage/lib/strategies/memory-storage.strategy.d.ts +11 -11
- package/storage/lib/strategies/polyfill-storage.strategy.d.ts +15 -15
- package/storage/public_api.d.ts +7 -7
- package/table/bravobit-bb-foundation-table.d.ts +5 -5
- package/table/lib/components/table/table.component.d.ts +48 -48
- package/table/lib/components/table-cell/table-cell.component.d.ts +5 -5
- package/table/lib/components/table-header-cell/table-header-cell.component.d.ts +29 -29
- package/table/lib/components/table-pager/table-pager.component.d.ts +41 -41
- package/table/lib/data/datasource.data.d.ts +14 -14
- package/table/lib/data/generic.data.d.ts +23 -23
- package/table/lib/interfaces/datasource.interface.d.ts +17 -17
- package/table/lib/interfaces/table.interfaces.d.ts +1 -1
- package/table/lib/table.module.d.ts +14 -14
- package/table/public_api.d.ts +9 -9
|
@@ -5,841 +5,910 @@ import { __awaiter } from 'tslib';
|
|
|
5
5
|
import { mapTo, map, distinctUntilChanged, shareReplay, debounceTime, startWith } from 'rxjs/operators';
|
|
6
6
|
import { of, fromEvent, Observable, merge, Subscription } from 'rxjs';
|
|
7
7
|
|
|
8
|
-
let hasV8BreakIterator;
|
|
9
|
-
try {
|
|
10
|
-
hasV8BreakIterator = (typeof Intl !== 'undefined' && Intl.v8BreakIterator);
|
|
11
|
-
}
|
|
12
|
-
catch (_a) {
|
|
13
|
-
hasV8BreakIterator = false;
|
|
14
|
-
}
|
|
15
|
-
class Platform {
|
|
16
|
-
constructor(_platformId) {
|
|
17
|
-
this._platformId = _platformId;
|
|
18
|
-
// Browser check.
|
|
19
|
-
this.isBrowser = this._platformId
|
|
20
|
-
? isPlatformBrowser(this._platformId)
|
|
21
|
-
: typeof document === 'object' && !!document;
|
|
22
|
-
// Is checks.
|
|
23
|
-
this.isEdge = this.isBrowser && /(edge)/i.test(navigator.userAgent);
|
|
24
|
-
this.isTrident = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
|
|
25
|
-
this.isBlink = this.isBrowser && (!!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.isEdge && !this.isTrident);
|
|
26
|
-
this.isWebkit = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.isBlink && !this.isEdge && !this.isTrident;
|
|
27
|
-
this.isChrome = this.isBrowser && /Google Inc./.test(navigator.vendor);
|
|
28
|
-
this.isFirefox = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
|
|
29
|
-
this.isSafari = this.isBrowser && /safari/i.test(navigator.userAgent) && this.isWebkit;
|
|
30
|
-
this.isAndroid = this.isBrowser && /android/i.test(navigator.userAgent) && !this.isTrident;
|
|
31
|
-
this.isIos = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
|
|
32
|
-
this.isDesktop = this.isBrowser && !(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/.test(navigator.userAgent));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
Platform.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
36
|
-
Platform.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
38
|
-
type: Injectable,
|
|
39
|
-
args: [{
|
|
40
|
-
providedIn: 'root'
|
|
41
|
-
}]
|
|
42
|
-
}], ctorParameters: function () { return [{ type: Object, decorators: [{
|
|
43
|
-
type: Inject,
|
|
44
|
-
args: [PLATFORM_ID]
|
|
8
|
+
let hasV8BreakIterator;
|
|
9
|
+
try {
|
|
10
|
+
hasV8BreakIterator = (typeof Intl !== 'undefined' && Intl.v8BreakIterator);
|
|
11
|
+
}
|
|
12
|
+
catch (_a) {
|
|
13
|
+
hasV8BreakIterator = false;
|
|
14
|
+
}
|
|
15
|
+
class Platform {
|
|
16
|
+
constructor(_platformId) {
|
|
17
|
+
this._platformId = _platformId;
|
|
18
|
+
// Browser check.
|
|
19
|
+
this.isBrowser = this._platformId
|
|
20
|
+
? isPlatformBrowser(this._platformId)
|
|
21
|
+
: typeof document === 'object' && !!document;
|
|
22
|
+
// Is checks.
|
|
23
|
+
this.isEdge = this.isBrowser && /(edge)/i.test(navigator.userAgent);
|
|
24
|
+
this.isTrident = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
|
|
25
|
+
this.isBlink = this.isBrowser && (!!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.isEdge && !this.isTrident);
|
|
26
|
+
this.isWebkit = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.isBlink && !this.isEdge && !this.isTrident;
|
|
27
|
+
this.isChrome = this.isBrowser && /Google Inc./.test(navigator.vendor);
|
|
28
|
+
this.isFirefox = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
|
|
29
|
+
this.isSafari = this.isBrowser && /safari/i.test(navigator.userAgent) && this.isWebkit;
|
|
30
|
+
this.isAndroid = this.isBrowser && /android/i.test(navigator.userAgent) && !this.isTrident;
|
|
31
|
+
this.isIos = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
|
|
32
|
+
this.isDesktop = this.isBrowser && !(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/.test(navigator.userAgent));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
Platform.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Platform, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
36
|
+
Platform.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Platform, providedIn: 'root' });
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Platform, decorators: [{
|
|
38
|
+
type: Injectable,
|
|
39
|
+
args: [{
|
|
40
|
+
providedIn: 'root'
|
|
41
|
+
}]
|
|
42
|
+
}], ctorParameters: function () { return [{ type: Object, decorators: [{
|
|
43
|
+
type: Inject,
|
|
44
|
+
args: [PLATFORM_ID]
|
|
45
45
|
}] }]; } });
|
|
46
46
|
|
|
47
|
-
class FileLoader {
|
|
48
|
-
constructor() {
|
|
49
|
-
this.isFile = (input) => {
|
|
50
|
-
return 'File' in window && input instanceof File;
|
|
51
|
-
};
|
|
52
|
-
this.isBlob = (input) => {
|
|
53
|
-
return 'Blob' in window && input instanceof Blob;
|
|
54
|
-
};
|
|
55
|
-
this.blobToFile = (blob, fileName) => {
|
|
56
|
-
const anyBlob = blob;
|
|
57
|
-
anyBlob.lastModifiedDate = new Date();
|
|
58
|
-
anyBlob.name = fileName;
|
|
59
|
-
return anyBlob;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
fromDataUrl(value, name = 'file') {
|
|
63
|
-
if (!value) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
try {
|
|
67
|
-
// Convert base64 to raw binary data held in a string.
|
|
68
|
-
const byteString = window.atob(value.split(',')[1]);
|
|
69
|
-
// Separate out the mime component.
|
|
70
|
-
const mimeString = value
|
|
71
|
-
.split(',')[0]
|
|
72
|
-
.split(':')[1]
|
|
73
|
-
.split(';')[0];
|
|
74
|
-
// Write the bytes of the string to an ArrayBuffer.
|
|
75
|
-
const arrayBuffer = new ArrayBuffer(byteString.length);
|
|
76
|
-
const uint8Array = new Uint8Array(arrayBuffer);
|
|
77
|
-
for (let index = 0; index < byteString.length; index++) {
|
|
78
|
-
uint8Array[index] = byteString.charCodeAt(index);
|
|
79
|
-
}
|
|
80
|
-
const dataView = new DataView(arrayBuffer);
|
|
81
|
-
const blob = new Blob([dataView.buffer], { type: mimeString });
|
|
82
|
-
return this.createFile(blob, name);
|
|
83
|
-
}
|
|
84
|
-
catch (_a) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
asDataUrl(file) {
|
|
89
|
-
return this.read(file, 'dataurl');
|
|
90
|
-
}
|
|
91
|
-
asArrayBuffer(file) {
|
|
92
|
-
return this.read(file, 'arraybuffer');
|
|
93
|
-
}
|
|
94
|
-
read(file, type) {
|
|
95
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
return new Promise((resolve, reject) => {
|
|
97
|
-
const isFileLike = this.isFile(file) || this.isBlob(file);
|
|
98
|
-
if (!file || !isFileLike) {
|
|
99
|
-
return reject('Invalid file');
|
|
100
|
-
}
|
|
101
|
-
const reader = new FileReader();
|
|
102
|
-
reader.onerror = () => reject('Error file read');
|
|
103
|
-
reader.onabort = () => reject('Abort file read');
|
|
104
|
-
reader.onload = () => {
|
|
105
|
-
const result = reader.result;
|
|
106
|
-
return resolve(result);
|
|
107
|
-
};
|
|
108
|
-
if (type === 'dataurl') {
|
|
109
|
-
reader.readAsDataURL(file);
|
|
110
|
-
}
|
|
111
|
-
else if (type === 'arraybuffer') {
|
|
112
|
-
reader.readAsArrayBuffer(file);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
createFile(blob, name) {
|
|
118
|
-
if (!navigator.msSaveBlob) {
|
|
119
|
-
return new File([blob], name, { lastModified: Date.now(), type: blob === null || blob === void 0 ? void 0 : blob.type });
|
|
120
|
-
}
|
|
121
|
-
const blobFile = new Blob([blob], { type: blob === null || blob === void 0 ? void 0 : blob.type });
|
|
122
|
-
return this.blobToFile(blobFile, name);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
FileLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
126
|
-
FileLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.
|
|
127
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
128
|
-
type: Injectable,
|
|
129
|
-
args: [{
|
|
130
|
-
providedIn: 'root'
|
|
131
|
-
}]
|
|
47
|
+
class FileLoader {
|
|
48
|
+
constructor() {
|
|
49
|
+
this.isFile = (input) => {
|
|
50
|
+
return 'File' in window && input instanceof File;
|
|
51
|
+
};
|
|
52
|
+
this.isBlob = (input) => {
|
|
53
|
+
return 'Blob' in window && input instanceof Blob;
|
|
54
|
+
};
|
|
55
|
+
this.blobToFile = (blob, fileName) => {
|
|
56
|
+
const anyBlob = blob;
|
|
57
|
+
anyBlob.lastModifiedDate = new Date();
|
|
58
|
+
anyBlob.name = fileName;
|
|
59
|
+
return anyBlob;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
fromDataUrl(value, name = 'file') {
|
|
63
|
+
if (!value) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
// Convert base64 to raw binary data held in a string.
|
|
68
|
+
const byteString = window.atob(value.split(',')[1]);
|
|
69
|
+
// Separate out the mime component.
|
|
70
|
+
const mimeString = value
|
|
71
|
+
.split(',')[0]
|
|
72
|
+
.split(':')[1]
|
|
73
|
+
.split(';')[0];
|
|
74
|
+
// Write the bytes of the string to an ArrayBuffer.
|
|
75
|
+
const arrayBuffer = new ArrayBuffer(byteString.length);
|
|
76
|
+
const uint8Array = new Uint8Array(arrayBuffer);
|
|
77
|
+
for (let index = 0; index < byteString.length; index++) {
|
|
78
|
+
uint8Array[index] = byteString.charCodeAt(index);
|
|
79
|
+
}
|
|
80
|
+
const dataView = new DataView(arrayBuffer);
|
|
81
|
+
const blob = new Blob([dataView.buffer], { type: mimeString });
|
|
82
|
+
return this.createFile(blob, name);
|
|
83
|
+
}
|
|
84
|
+
catch (_a) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
asDataUrl(file) {
|
|
89
|
+
return this.read(file, 'dataurl');
|
|
90
|
+
}
|
|
91
|
+
asArrayBuffer(file) {
|
|
92
|
+
return this.read(file, 'arraybuffer');
|
|
93
|
+
}
|
|
94
|
+
read(file, type) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
return new Promise((resolve, reject) => {
|
|
97
|
+
const isFileLike = this.isFile(file) || this.isBlob(file);
|
|
98
|
+
if (!file || !isFileLike) {
|
|
99
|
+
return reject('Invalid file');
|
|
100
|
+
}
|
|
101
|
+
const reader = new FileReader();
|
|
102
|
+
reader.onerror = () => reject('Error file read');
|
|
103
|
+
reader.onabort = () => reject('Abort file read');
|
|
104
|
+
reader.onload = () => {
|
|
105
|
+
const result = reader.result;
|
|
106
|
+
return resolve(result);
|
|
107
|
+
};
|
|
108
|
+
if (type === 'dataurl') {
|
|
109
|
+
reader.readAsDataURL(file);
|
|
110
|
+
}
|
|
111
|
+
else if (type === 'arraybuffer') {
|
|
112
|
+
reader.readAsArrayBuffer(file);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
createFile(blob, name) {
|
|
118
|
+
if (!navigator.msSaveBlob) {
|
|
119
|
+
return new File([blob], name, { lastModified: Date.now(), type: blob === null || blob === void 0 ? void 0 : blob.type });
|
|
120
|
+
}
|
|
121
|
+
const blobFile = new Blob([blob], { type: blob === null || blob === void 0 ? void 0 : blob.type });
|
|
122
|
+
return this.blobToFile(blobFile, name);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
FileLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: FileLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
126
|
+
FileLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: FileLoader, providedIn: 'root' });
|
|
127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: FileLoader, decorators: [{
|
|
128
|
+
type: Injectable,
|
|
129
|
+
args: [{
|
|
130
|
+
providedIn: 'root'
|
|
131
|
+
}]
|
|
132
132
|
}] });
|
|
133
133
|
|
|
134
|
-
class Exif {
|
|
135
|
-
constructor(_platform, _fileLoader) {
|
|
136
|
-
this._platform = _platform;
|
|
137
|
-
this._fileLoader = _fileLoader;
|
|
138
|
-
this.transformImage = (image, type, orientation, quality = 100) => {
|
|
139
|
-
// Create the canvas and context.
|
|
140
|
-
const canvas = document.createElement('canvas');
|
|
141
|
-
const context = canvas.getContext('2d');
|
|
142
|
-
// Validate the context exists.
|
|
143
|
-
if (!context) {
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
// Set the canvas size based on the image.
|
|
147
|
-
const { width, height } = image;
|
|
148
|
-
canvas.width = width;
|
|
149
|
-
canvas.height = height;
|
|
150
|
-
// Validate the orientation is correct
|
|
151
|
-
// else flip the canvas sizes.
|
|
152
|
-
if (4 < orientation && orientation < 9) {
|
|
153
|
-
canvas.width = height;
|
|
154
|
-
canvas.height = width;
|
|
155
|
-
}
|
|
156
|
-
// Transform the context based on the orientation.
|
|
157
|
-
switch (orientation) {
|
|
158
|
-
case 2:
|
|
159
|
-
context.transform(-1, 0, 0, 1, width, 0);
|
|
160
|
-
break;
|
|
161
|
-
case 3:
|
|
162
|
-
context.transform(-1, 0, 0, -1, width, height);
|
|
163
|
-
break;
|
|
164
|
-
case 4:
|
|
165
|
-
context.transform(1, 0, 0, -1, 0, height);
|
|
166
|
-
break;
|
|
167
|
-
case 5:
|
|
168
|
-
context.transform(0, 1, 1, 0, 0, 0);
|
|
169
|
-
break;
|
|
170
|
-
case 6:
|
|
171
|
-
context.transform(0, 1, -1, 0, height, 0);
|
|
172
|
-
break;
|
|
173
|
-
case 7:
|
|
174
|
-
context.transform(0, -1, -1, 0, height, width);
|
|
175
|
-
break;
|
|
176
|
-
case 8:
|
|
177
|
-
context.transform(0, -1, 1, 0, 0, width);
|
|
178
|
-
break;
|
|
179
|
-
default:
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
// Draw the image on the context and return the data URL.
|
|
183
|
-
context.drawImage(image, 0, 0, width, height);
|
|
184
|
-
return canvas.toDataURL(type, quality / 100);
|
|
185
|
-
};
|
|
186
|
-
this.getSupportedCanvasType = (fileType) => {
|
|
187
|
-
switch (fileType) {
|
|
188
|
-
case 'image/jpeg':
|
|
189
|
-
case 'image/jpg':
|
|
190
|
-
return 'image/jpeg';
|
|
191
|
-
case 'image/x-windows-bmp':
|
|
192
|
-
case 'image/bmp':
|
|
193
|
-
return 'image/bmp';
|
|
194
|
-
default:
|
|
195
|
-
return 'image/png';
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
this.getOrientation = (buffer) => {
|
|
199
|
-
// Create a new data view.
|
|
200
|
-
const view = new DataView(buffer);
|
|
201
|
-
if (view.getUint16(0, false) !== 0xFFD8) {
|
|
202
|
-
return -2;
|
|
203
|
-
}
|
|
204
|
-
const length = view.byteLength;
|
|
205
|
-
let offset = 2;
|
|
206
|
-
while (offset < length) {
|
|
207
|
-
if (view.getUint16(offset + 2, false) <= 8) {
|
|
208
|
-
return -1;
|
|
209
|
-
}
|
|
210
|
-
const marker = view.getUint16(offset, false);
|
|
211
|
-
offset += 2;
|
|
212
|
-
if (marker === 0xFFE1) {
|
|
213
|
-
if (view.getUint32(offset += 2, false) !== 0x45786966) {
|
|
214
|
-
return -1;
|
|
215
|
-
}
|
|
216
|
-
const little = view.getUint16(offset += 6, false) === 0x4949;
|
|
217
|
-
offset += view.getUint32(offset + 4, little);
|
|
218
|
-
const tags = view.getUint16(offset, little);
|
|
219
|
-
offset += 2;
|
|
220
|
-
for (let index = 0; index < tags; index++) {
|
|
221
|
-
if (view.getUint16(offset + index * 12, little) === 0x0112) {
|
|
222
|
-
return view.getUint16(offset + index * 12 + 8, little);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
else if ((marker & 0xFF00) !== 0xFF00) {
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
offset += view.getUint16(offset, false);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
return -1;
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
strip(file, quality = 100) {
|
|
237
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
238
|
-
// Validate we are on a browser.
|
|
239
|
-
if (!this._platform.isBrowser) {
|
|
240
|
-
return file;
|
|
241
|
-
}
|
|
242
|
-
// Validate the file exists and is
|
|
243
|
-
// an instance of a File object.
|
|
244
|
-
if (!file || !(file instanceof File)) {
|
|
245
|
-
return file;
|
|
246
|
-
}
|
|
247
|
-
// Only jpeg images need correction.
|
|
248
|
-
if (!['image/jpeg'].includes(file.type)) {
|
|
249
|
-
return file;
|
|
250
|
-
}
|
|
251
|
-
try {
|
|
252
|
-
// Read the file as an array buffer and data url.
|
|
253
|
-
const arrayBuffer = yield this._fileLoader.asArrayBuffer(file);
|
|
254
|
-
const dataUrl = yield this._fileLoader.asDataUrl(file);
|
|
255
|
-
// Create an image element.
|
|
256
|
-
const imageElement = yield this.createImageElement(dataUrl);
|
|
257
|
-
// Get the orientation by using the buffer.
|
|
258
|
-
const orientation = this.getOrientation(arrayBuffer);
|
|
259
|
-
// Transform the image to remove the orientation.
|
|
260
|
-
const canvasType = this.getSupportedCanvasType(file.type);
|
|
261
|
-
const imageUrl = this.transformImage(imageElement, canvasType, orientation, quality);
|
|
262
|
-
// Validate the image url exists.
|
|
263
|
-
if (!imageUrl) {
|
|
264
|
-
return file;
|
|
265
|
-
}
|
|
266
|
-
// Transform the image url to a file.
|
|
267
|
-
return this._fileLoader.fromDataUrl(imageUrl, file.name);
|
|
268
|
-
}
|
|
269
|
-
catch (_a) {
|
|
270
|
-
// When something goes wrong we
|
|
271
|
-
// just return the default file.
|
|
272
|
-
return file;
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
createImageElement(dataUrl) {
|
|
277
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
-
return new Promise((resolve, reject) => {
|
|
279
|
-
const image = new Image();
|
|
280
|
-
image.src = dataUrl;
|
|
281
|
-
image.onerror = () => reject('Error image create');
|
|
282
|
-
image.onabort = () => reject('Abort image create');
|
|
283
|
-
image.onload = () => resolve(image);
|
|
284
|
-
});
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
Exif.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
289
|
-
Exif.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.
|
|
290
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
291
|
-
type: Injectable,
|
|
292
|
-
args: [{
|
|
293
|
-
providedIn: 'root'
|
|
294
|
-
}]
|
|
134
|
+
class Exif {
|
|
135
|
+
constructor(_platform, _fileLoader) {
|
|
136
|
+
this._platform = _platform;
|
|
137
|
+
this._fileLoader = _fileLoader;
|
|
138
|
+
this.transformImage = (image, type, orientation, quality = 100) => {
|
|
139
|
+
// Create the canvas and context.
|
|
140
|
+
const canvas = document.createElement('canvas');
|
|
141
|
+
const context = canvas.getContext('2d');
|
|
142
|
+
// Validate the context exists.
|
|
143
|
+
if (!context) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
// Set the canvas size based on the image.
|
|
147
|
+
const { width, height } = image;
|
|
148
|
+
canvas.width = width;
|
|
149
|
+
canvas.height = height;
|
|
150
|
+
// Validate the orientation is correct
|
|
151
|
+
// else flip the canvas sizes.
|
|
152
|
+
if (4 < orientation && orientation < 9) {
|
|
153
|
+
canvas.width = height;
|
|
154
|
+
canvas.height = width;
|
|
155
|
+
}
|
|
156
|
+
// Transform the context based on the orientation.
|
|
157
|
+
switch (orientation) {
|
|
158
|
+
case 2:
|
|
159
|
+
context.transform(-1, 0, 0, 1, width, 0);
|
|
160
|
+
break;
|
|
161
|
+
case 3:
|
|
162
|
+
context.transform(-1, 0, 0, -1, width, height);
|
|
163
|
+
break;
|
|
164
|
+
case 4:
|
|
165
|
+
context.transform(1, 0, 0, -1, 0, height);
|
|
166
|
+
break;
|
|
167
|
+
case 5:
|
|
168
|
+
context.transform(0, 1, 1, 0, 0, 0);
|
|
169
|
+
break;
|
|
170
|
+
case 6:
|
|
171
|
+
context.transform(0, 1, -1, 0, height, 0);
|
|
172
|
+
break;
|
|
173
|
+
case 7:
|
|
174
|
+
context.transform(0, -1, -1, 0, height, width);
|
|
175
|
+
break;
|
|
176
|
+
case 8:
|
|
177
|
+
context.transform(0, -1, 1, 0, 0, width);
|
|
178
|
+
break;
|
|
179
|
+
default:
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
// Draw the image on the context and return the data URL.
|
|
183
|
+
context.drawImage(image, 0, 0, width, height);
|
|
184
|
+
return canvas.toDataURL(type, quality / 100);
|
|
185
|
+
};
|
|
186
|
+
this.getSupportedCanvasType = (fileType) => {
|
|
187
|
+
switch (fileType) {
|
|
188
|
+
case 'image/jpeg':
|
|
189
|
+
case 'image/jpg':
|
|
190
|
+
return 'image/jpeg';
|
|
191
|
+
case 'image/x-windows-bmp':
|
|
192
|
+
case 'image/bmp':
|
|
193
|
+
return 'image/bmp';
|
|
194
|
+
default:
|
|
195
|
+
return 'image/png';
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
this.getOrientation = (buffer) => {
|
|
199
|
+
// Create a new data view.
|
|
200
|
+
const view = new DataView(buffer);
|
|
201
|
+
if (view.getUint16(0, false) !== 0xFFD8) {
|
|
202
|
+
return -2;
|
|
203
|
+
}
|
|
204
|
+
const length = view.byteLength;
|
|
205
|
+
let offset = 2;
|
|
206
|
+
while (offset < length) {
|
|
207
|
+
if (view.getUint16(offset + 2, false) <= 8) {
|
|
208
|
+
return -1;
|
|
209
|
+
}
|
|
210
|
+
const marker = view.getUint16(offset, false);
|
|
211
|
+
offset += 2;
|
|
212
|
+
if (marker === 0xFFE1) {
|
|
213
|
+
if (view.getUint32(offset += 2, false) !== 0x45786966) {
|
|
214
|
+
return -1;
|
|
215
|
+
}
|
|
216
|
+
const little = view.getUint16(offset += 6, false) === 0x4949;
|
|
217
|
+
offset += view.getUint32(offset + 4, little);
|
|
218
|
+
const tags = view.getUint16(offset, little);
|
|
219
|
+
offset += 2;
|
|
220
|
+
for (let index = 0; index < tags; index++) {
|
|
221
|
+
if (view.getUint16(offset + index * 12, little) === 0x0112) {
|
|
222
|
+
return view.getUint16(offset + index * 12 + 8, little);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
else if ((marker & 0xFF00) !== 0xFF00) {
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
offset += view.getUint16(offset, false);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return -1;
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
strip(file, quality = 100) {
|
|
237
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
238
|
+
// Validate we are on a browser.
|
|
239
|
+
if (!this._platform.isBrowser) {
|
|
240
|
+
return file;
|
|
241
|
+
}
|
|
242
|
+
// Validate the file exists and is
|
|
243
|
+
// an instance of a File object.
|
|
244
|
+
if (!file || !(file instanceof File)) {
|
|
245
|
+
return file;
|
|
246
|
+
}
|
|
247
|
+
// Only jpeg images need correction.
|
|
248
|
+
if (!['image/jpeg'].includes(file.type)) {
|
|
249
|
+
return file;
|
|
250
|
+
}
|
|
251
|
+
try {
|
|
252
|
+
// Read the file as an array buffer and data url.
|
|
253
|
+
const arrayBuffer = yield this._fileLoader.asArrayBuffer(file);
|
|
254
|
+
const dataUrl = yield this._fileLoader.asDataUrl(file);
|
|
255
|
+
// Create an image element.
|
|
256
|
+
const imageElement = yield this.createImageElement(dataUrl);
|
|
257
|
+
// Get the orientation by using the buffer.
|
|
258
|
+
const orientation = this.getOrientation(arrayBuffer);
|
|
259
|
+
// Transform the image to remove the orientation.
|
|
260
|
+
const canvasType = this.getSupportedCanvasType(file.type);
|
|
261
|
+
const imageUrl = this.transformImage(imageElement, canvasType, orientation, quality);
|
|
262
|
+
// Validate the image url exists.
|
|
263
|
+
if (!imageUrl) {
|
|
264
|
+
return file;
|
|
265
|
+
}
|
|
266
|
+
// Transform the image url to a file.
|
|
267
|
+
return this._fileLoader.fromDataUrl(imageUrl, file.name);
|
|
268
|
+
}
|
|
269
|
+
catch (_a) {
|
|
270
|
+
// When something goes wrong we
|
|
271
|
+
// just return the default file.
|
|
272
|
+
return file;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
createImageElement(dataUrl) {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
return new Promise((resolve, reject) => {
|
|
279
|
+
const image = new Image();
|
|
280
|
+
image.src = dataUrl;
|
|
281
|
+
image.onerror = () => reject('Error image create');
|
|
282
|
+
image.onabort = () => reject('Abort image create');
|
|
283
|
+
image.onload = () => resolve(image);
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
Exif.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Exif, deps: [{ token: Platform }, { token: FileLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
289
|
+
Exif.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Exif, providedIn: 'root' });
|
|
290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Exif, decorators: [{
|
|
291
|
+
type: Injectable,
|
|
292
|
+
args: [{
|
|
293
|
+
providedIn: 'root'
|
|
294
|
+
}]
|
|
295
295
|
}], ctorParameters: function () { return [{ type: Platform }, { type: FileLoader }]; } });
|
|
296
296
|
|
|
297
|
-
class ImageConverter {
|
|
298
|
-
constructor(_exif, _platform, _fileLoader) {
|
|
299
|
-
this._exif = _exif;
|
|
300
|
-
this._platform = _platform;
|
|
301
|
-
this._fileLoader = _fileLoader;
|
|
302
|
-
// Data.
|
|
303
|
-
this._types = ['image/png', 'image/jpeg'];
|
|
304
|
-
this.calculateOffsetAndDimensions = (image, canvasWidth, canvasHeight) => {
|
|
305
|
-
const originalWidth = image.width;
|
|
306
|
-
const originalHeight = image.height;
|
|
307
|
-
const widthRatio = canvasWidth / originalWidth;
|
|
308
|
-
const heightRatio = canvasHeight / originalHeight;
|
|
309
|
-
let width;
|
|
310
|
-
let height;
|
|
311
|
-
if (originalWidth > originalHeight) {
|
|
312
|
-
height = originalHeight * heightRatio;
|
|
313
|
-
width = (originalWidth / originalHeight) * height;
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
width = originalWidth * widthRatio;
|
|
317
|
-
height = (originalHeight / originalWidth) * width;
|
|
318
|
-
}
|
|
319
|
-
let xOffset = 0;
|
|
320
|
-
let yOffset = 0;
|
|
321
|
-
if (canvasHeight === height) {
|
|
322
|
-
xOffset = -((width - canvasWidth) / 2);
|
|
323
|
-
}
|
|
324
|
-
else if (canvasWidth === width) {
|
|
325
|
-
yOffset = -((height - canvasHeight) / 2);
|
|
326
|
-
}
|
|
327
|
-
return { xOffset, yOffset, width, height };
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
toDataUri(contents, options = null) {
|
|
331
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
332
|
-
// Check if the current platform is a browser.
|
|
333
|
-
if (!this._platform.isBrowser) {
|
|
334
|
-
return null;
|
|
335
|
-
}
|
|
336
|
-
// Get the image.
|
|
337
|
-
const image = yield this.getImage(contents);
|
|
338
|
-
// Get the canvas width and height.
|
|
339
|
-
const canvasWidth = (options === null || options === void 0 ? void 0 : options.width) || (image === null || image === void 0 ? void 0 : image.width);
|
|
340
|
-
const canvasHeight = (options === null || options === void 0 ? void 0 : options.height) || (image === null || image === void 0 ? void 0 : image.height);
|
|
341
|
-
// Get the canvas and context.
|
|
342
|
-
const canvas = document.createElement('canvas');
|
|
343
|
-
const context = canvas.getContext('2d');
|
|
344
|
-
// Validate the context exists.
|
|
345
|
-
if (!context) {
|
|
346
|
-
return null;
|
|
347
|
-
}
|
|
348
|
-
// Set the width and height.
|
|
349
|
-
canvas.width = canvasWidth;
|
|
350
|
-
canvas.height = canvasHeight;
|
|
351
|
-
// When the canvas sizes are 0 we have failed.
|
|
352
|
-
if ((canvas === null || canvas === void 0 ? void 0 : canvas.width) === 0 && (canvas === null || canvas === void 0 ? void 0 : canvas.height) === 0) {
|
|
353
|
-
return null;
|
|
354
|
-
}
|
|
355
|
-
// Check if dimensions where supplied, else create the image.
|
|
356
|
-
if (!options) {
|
|
357
|
-
// Draw the image.
|
|
358
|
-
context.drawImage(image, 0, 0);
|
|
359
|
-
// Convert the canvas to a data url.
|
|
360
|
-
return canvas.toDataURL(this._types[0]);
|
|
361
|
-
}
|
|
362
|
-
// Get the dimensions and offsets.
|
|
363
|
-
const { width, height, xOffset, yOffset } = this.calculateOffsetAndDimensions(image, canvasWidth, canvasHeight);
|
|
364
|
-
// Draw the image.
|
|
365
|
-
context.drawImage(image, 0, 0, image.width, image.height, xOffset, yOffset, width, height);
|
|
366
|
-
// Convert the canvas to a data url.
|
|
367
|
-
return canvas.toDataURL(this._types[0]);
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
fileToImage(file, types = this._types) {
|
|
371
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
372
|
-
// Check if the file matches an image.
|
|
373
|
-
if (!types.includes(file.type)) {
|
|
374
|
-
throw new Error('The selected file does not meet the required format.');
|
|
375
|
-
}
|
|
376
|
-
let stripped = null;
|
|
377
|
-
try {
|
|
378
|
-
stripped = yield this._exif.strip(file, 90);
|
|
379
|
-
}
|
|
380
|
-
catch (_a) {
|
|
381
|
-
// Do nothing.
|
|
382
|
-
}
|
|
383
|
-
// Ge the data uri.
|
|
384
|
-
const dataUri = yield this._fileLoader.asDataUrl(stripped !== null && stripped !== void 0 ? stripped : file);
|
|
385
|
-
// Convert the data URI to a image element.
|
|
386
|
-
return yield this.stringToImage(dataUri);
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
stringToImage(src) {
|
|
390
|
-
return new Promise((resolve, reject) => {
|
|
391
|
-
const image = new Image();
|
|
392
|
-
image.src = src;
|
|
393
|
-
image.onload = () => resolve(image);
|
|
394
|
-
image.onerror = error => reject(error);
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
getImage(contents) {
|
|
398
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
399
|
-
// If the contents is already an HTML image element just return it.
|
|
400
|
-
if (contents instanceof HTMLImageElement) {
|
|
401
|
-
return contents;
|
|
402
|
-
}
|
|
403
|
-
// If the contents is a file convert it to an HTML image element.
|
|
404
|
-
if (contents instanceof File) {
|
|
405
|
-
return this.fileToImage(contents);
|
|
406
|
-
}
|
|
407
|
-
// If the contents is a string convert it to an HTML image element.
|
|
408
|
-
return this.stringToImage(contents);
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
ImageConverter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
413
|
-
ImageConverter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.
|
|
414
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
415
|
-
type: Injectable,
|
|
416
|
-
args: [{
|
|
417
|
-
providedIn: 'root'
|
|
418
|
-
}]
|
|
297
|
+
class ImageConverter {
|
|
298
|
+
constructor(_exif, _platform, _fileLoader) {
|
|
299
|
+
this._exif = _exif;
|
|
300
|
+
this._platform = _platform;
|
|
301
|
+
this._fileLoader = _fileLoader;
|
|
302
|
+
// Data.
|
|
303
|
+
this._types = ['image/png', 'image/jpeg'];
|
|
304
|
+
this.calculateOffsetAndDimensions = (image, canvasWidth, canvasHeight) => {
|
|
305
|
+
const originalWidth = image.width;
|
|
306
|
+
const originalHeight = image.height;
|
|
307
|
+
const widthRatio = canvasWidth / originalWidth;
|
|
308
|
+
const heightRatio = canvasHeight / originalHeight;
|
|
309
|
+
let width;
|
|
310
|
+
let height;
|
|
311
|
+
if (originalWidth > originalHeight) {
|
|
312
|
+
height = originalHeight * heightRatio;
|
|
313
|
+
width = (originalWidth / originalHeight) * height;
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
width = originalWidth * widthRatio;
|
|
317
|
+
height = (originalHeight / originalWidth) * width;
|
|
318
|
+
}
|
|
319
|
+
let xOffset = 0;
|
|
320
|
+
let yOffset = 0;
|
|
321
|
+
if (canvasHeight === height) {
|
|
322
|
+
xOffset = -((width - canvasWidth) / 2);
|
|
323
|
+
}
|
|
324
|
+
else if (canvasWidth === width) {
|
|
325
|
+
yOffset = -((height - canvasHeight) / 2);
|
|
326
|
+
}
|
|
327
|
+
return { xOffset, yOffset, width, height };
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
toDataUri(contents, options = null) {
|
|
331
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
332
|
+
// Check if the current platform is a browser.
|
|
333
|
+
if (!this._platform.isBrowser) {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
// Get the image.
|
|
337
|
+
const image = yield this.getImage(contents);
|
|
338
|
+
// Get the canvas width and height.
|
|
339
|
+
const canvasWidth = (options === null || options === void 0 ? void 0 : options.width) || (image === null || image === void 0 ? void 0 : image.width);
|
|
340
|
+
const canvasHeight = (options === null || options === void 0 ? void 0 : options.height) || (image === null || image === void 0 ? void 0 : image.height);
|
|
341
|
+
// Get the canvas and context.
|
|
342
|
+
const canvas = document.createElement('canvas');
|
|
343
|
+
const context = canvas.getContext('2d');
|
|
344
|
+
// Validate the context exists.
|
|
345
|
+
if (!context) {
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
348
|
+
// Set the width and height.
|
|
349
|
+
canvas.width = canvasWidth;
|
|
350
|
+
canvas.height = canvasHeight;
|
|
351
|
+
// When the canvas sizes are 0 we have failed.
|
|
352
|
+
if ((canvas === null || canvas === void 0 ? void 0 : canvas.width) === 0 && (canvas === null || canvas === void 0 ? void 0 : canvas.height) === 0) {
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
// Check if dimensions where supplied, else create the image.
|
|
356
|
+
if (!options) {
|
|
357
|
+
// Draw the image.
|
|
358
|
+
context.drawImage(image, 0, 0);
|
|
359
|
+
// Convert the canvas to a data url.
|
|
360
|
+
return canvas.toDataURL(this._types[0]);
|
|
361
|
+
}
|
|
362
|
+
// Get the dimensions and offsets.
|
|
363
|
+
const { width, height, xOffset, yOffset } = this.calculateOffsetAndDimensions(image, canvasWidth, canvasHeight);
|
|
364
|
+
// Draw the image.
|
|
365
|
+
context.drawImage(image, 0, 0, image.width, image.height, xOffset, yOffset, width, height);
|
|
366
|
+
// Convert the canvas to a data url.
|
|
367
|
+
return canvas.toDataURL(this._types[0]);
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
fileToImage(file, types = this._types) {
|
|
371
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
372
|
+
// Check if the file matches an image.
|
|
373
|
+
if (!types.includes(file.type)) {
|
|
374
|
+
throw new Error('The selected file does not meet the required format.');
|
|
375
|
+
}
|
|
376
|
+
let stripped = null;
|
|
377
|
+
try {
|
|
378
|
+
stripped = yield this._exif.strip(file, 90);
|
|
379
|
+
}
|
|
380
|
+
catch (_a) {
|
|
381
|
+
// Do nothing.
|
|
382
|
+
}
|
|
383
|
+
// Ge the data uri.
|
|
384
|
+
const dataUri = yield this._fileLoader.asDataUrl(stripped !== null && stripped !== void 0 ? stripped : file);
|
|
385
|
+
// Convert the data URI to a image element.
|
|
386
|
+
return yield this.stringToImage(dataUri);
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
stringToImage(src) {
|
|
390
|
+
return new Promise((resolve, reject) => {
|
|
391
|
+
const image = new Image();
|
|
392
|
+
image.src = src;
|
|
393
|
+
image.onload = () => resolve(image);
|
|
394
|
+
image.onerror = error => reject(error);
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
getImage(contents) {
|
|
398
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
399
|
+
// If the contents is already an HTML image element just return it.
|
|
400
|
+
if (contents instanceof HTMLImageElement) {
|
|
401
|
+
return contents;
|
|
402
|
+
}
|
|
403
|
+
// If the contents is a file convert it to an HTML image element.
|
|
404
|
+
if (contents instanceof File) {
|
|
405
|
+
return this.fileToImage(contents);
|
|
406
|
+
}
|
|
407
|
+
// If the contents is a string convert it to an HTML image element.
|
|
408
|
+
return this.stringToImage(contents);
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
ImageConverter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: ImageConverter, deps: [{ token: Exif }, { token: Platform }, { token: FileLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
413
|
+
ImageConverter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: ImageConverter, providedIn: 'root' });
|
|
414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: ImageConverter, decorators: [{
|
|
415
|
+
type: Injectable,
|
|
416
|
+
args: [{
|
|
417
|
+
providedIn: 'root'
|
|
418
|
+
}]
|
|
419
419
|
}], ctorParameters: function () { return [{ type: Exif }, { type: Platform }, { type: FileLoader }]; } });
|
|
420
420
|
|
|
421
421
|
const ACCEPT_LANGUAGE = new InjectionToken('AcceptLanguage');
|
|
422
422
|
|
|
423
|
-
class Languages {
|
|
424
|
-
constructor(_acceptLanguage) {
|
|
425
|
-
this._acceptLanguage = _acceptLanguage;
|
|
426
|
-
// Data.
|
|
427
|
-
this._data = [];
|
|
428
|
-
this.getLanguages = () => {
|
|
429
|
-
// If defined we must be in a server environment.
|
|
430
|
-
if (this._acceptLanguage) {
|
|
431
|
-
return this._acceptLanguage;
|
|
432
|
-
}
|
|
433
|
-
// Try to get the languages from the navigator.
|
|
434
|
-
if (typeof navigator !== 'object') {
|
|
435
|
-
return null;
|
|
436
|
-
}
|
|
437
|
-
let t = 'anguage';
|
|
438
|
-
let n = navigator;
|
|
439
|
-
let f = n['l' + t + 's'];
|
|
440
|
-
const data = f && f.length ? f : (t = n['l' + t] ||
|
|
441
|
-
n['browserL' + t] ||
|
|
442
|
-
n['userL' + t]) ? [t] : t;
|
|
443
|
-
return typeof data === 'string'
|
|
444
|
-
? data
|
|
445
|
-
: data.join(';');
|
|
446
|
-
};
|
|
447
|
-
this._data = this.initialize();
|
|
448
|
-
}
|
|
449
|
-
get all() {
|
|
450
|
-
return this._data;
|
|
451
|
-
}
|
|
452
|
-
initialize() {
|
|
453
|
-
// Get the languages.
|
|
454
|
-
const data = this.getLanguages();
|
|
455
|
-
// Parse all languages by using a regex.
|
|
456
|
-
const strings = (data || '')
|
|
457
|
-
.match(/((([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?)*/g);
|
|
458
|
-
// Get the content by parsing the strings.
|
|
459
|
-
const content = strings.map(item => {
|
|
460
|
-
if (!item) {
|
|
461
|
-
return null;
|
|
462
|
-
}
|
|
463
|
-
const bits = item.split(';');
|
|
464
|
-
const ietf = bits[0].split('-');
|
|
465
|
-
const hasScript = ietf.length === 3;
|
|
466
|
-
return {
|
|
467
|
-
code: ietf[0],
|
|
468
|
-
script: hasScript ? ietf[1] : null,
|
|
469
|
-
region: hasScript ? ietf[2] : ietf[1],
|
|
470
|
-
quality: bits[1] ? parseFloat(bits[1].split('=')[1]) : 1.0
|
|
471
|
-
};
|
|
472
|
-
});
|
|
473
|
-
// Filter out all the empty items
|
|
474
|
-
// and sort them by the quality.
|
|
475
|
-
return content
|
|
476
|
-
.filter(item => !!item)
|
|
477
|
-
.sort((a, b) => b.quality - a.quality);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
Languages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
481
|
-
Languages.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.
|
|
482
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
483
|
-
type: Injectable,
|
|
484
|
-
args: [{
|
|
485
|
-
providedIn: 'root'
|
|
486
|
-
}]
|
|
487
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
488
|
-
type: Optional
|
|
489
|
-
}, {
|
|
490
|
-
type: Inject,
|
|
491
|
-
args: [ACCEPT_LANGUAGE]
|
|
423
|
+
class Languages {
|
|
424
|
+
constructor(_acceptLanguage) {
|
|
425
|
+
this._acceptLanguage = _acceptLanguage;
|
|
426
|
+
// Data.
|
|
427
|
+
this._data = [];
|
|
428
|
+
this.getLanguages = () => {
|
|
429
|
+
// If defined we must be in a server environment.
|
|
430
|
+
if (this._acceptLanguage) {
|
|
431
|
+
return this._acceptLanguage;
|
|
432
|
+
}
|
|
433
|
+
// Try to get the languages from the navigator.
|
|
434
|
+
if (typeof navigator !== 'object') {
|
|
435
|
+
return null;
|
|
436
|
+
}
|
|
437
|
+
let t = 'anguage';
|
|
438
|
+
let n = navigator;
|
|
439
|
+
let f = n['l' + t + 's'];
|
|
440
|
+
const data = f && f.length ? f : (t = n['l' + t] ||
|
|
441
|
+
n['browserL' + t] ||
|
|
442
|
+
n['userL' + t]) ? [t] : t;
|
|
443
|
+
return typeof data === 'string'
|
|
444
|
+
? data
|
|
445
|
+
: data.join(';');
|
|
446
|
+
};
|
|
447
|
+
this._data = this.initialize();
|
|
448
|
+
}
|
|
449
|
+
get all() {
|
|
450
|
+
return this._data;
|
|
451
|
+
}
|
|
452
|
+
initialize() {
|
|
453
|
+
// Get the languages.
|
|
454
|
+
const data = this.getLanguages();
|
|
455
|
+
// Parse all languages by using a regex.
|
|
456
|
+
const strings = (data || '')
|
|
457
|
+
.match(/((([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?)*/g);
|
|
458
|
+
// Get the content by parsing the strings.
|
|
459
|
+
const content = strings.map(item => {
|
|
460
|
+
if (!item) {
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
const bits = item.split(';');
|
|
464
|
+
const ietf = bits[0].split('-');
|
|
465
|
+
const hasScript = ietf.length === 3;
|
|
466
|
+
return {
|
|
467
|
+
code: ietf[0],
|
|
468
|
+
script: hasScript ? ietf[1] : null,
|
|
469
|
+
region: hasScript ? ietf[2] : ietf[1],
|
|
470
|
+
quality: bits[1] ? parseFloat(bits[1].split('=')[1]) : 1.0
|
|
471
|
+
};
|
|
472
|
+
});
|
|
473
|
+
// Filter out all the empty items
|
|
474
|
+
// and sort them by the quality.
|
|
475
|
+
return content
|
|
476
|
+
.filter(item => !!item)
|
|
477
|
+
.sort((a, b) => b.quality - a.quality);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
Languages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Languages, deps: [{ token: ACCEPT_LANGUAGE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
481
|
+
Languages.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Languages, providedIn: 'root' });
|
|
482
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Languages, decorators: [{
|
|
483
|
+
type: Injectable,
|
|
484
|
+
args: [{
|
|
485
|
+
providedIn: 'root'
|
|
486
|
+
}]
|
|
487
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
488
|
+
type: Optional
|
|
489
|
+
}, {
|
|
490
|
+
type: Inject,
|
|
491
|
+
args: [ACCEPT_LANGUAGE]
|
|
492
492
|
}] }]; } });
|
|
493
493
|
|
|
494
|
-
const WINDOW = new InjectionToken('An abstraction over global window object', {
|
|
495
|
-
factory: () => {
|
|
496
|
-
const { defaultView } = inject(DOCUMENT);
|
|
497
|
-
if (!defaultView) {
|
|
498
|
-
throw new Error('Window is not available');
|
|
499
|
-
}
|
|
500
|
-
return defaultView;
|
|
501
|
-
}
|
|
494
|
+
const WINDOW = new InjectionToken('An abstraction over global window object', {
|
|
495
|
+
factory: () => {
|
|
496
|
+
const { defaultView } = inject(DOCUMENT);
|
|
497
|
+
if (!defaultView) {
|
|
498
|
+
throw new Error('Window is not available');
|
|
499
|
+
}
|
|
500
|
+
return defaultView;
|
|
501
|
+
}
|
|
502
502
|
});
|
|
503
503
|
|
|
504
|
-
const NAVIGATOR = new InjectionToken('An abstraction over window.navigator object', {
|
|
505
|
-
factory: () => inject(WINDOW).navigator
|
|
504
|
+
const NAVIGATOR = new InjectionToken('An abstraction over window.navigator object', {
|
|
505
|
+
factory: () => inject(WINDOW).navigator
|
|
506
506
|
});
|
|
507
507
|
|
|
508
|
-
class Network {
|
|
509
|
-
constructor(_platform, _window, _navigator) {
|
|
510
|
-
this._platform = _platform;
|
|
511
|
-
this._window = _window;
|
|
512
|
-
this._navigator = _navigator;
|
|
513
|
-
// Data.
|
|
514
|
-
this._online$ = of(true);
|
|
515
|
-
this.getOnlineObservable();
|
|
516
|
-
}
|
|
517
|
-
online() {
|
|
518
|
-
return this._online$;
|
|
519
|
-
}
|
|
520
|
-
getOnlineObservable() {
|
|
521
|
-
// Validate we are on a browser.
|
|
522
|
-
if (!this._platform.isBrowser) {
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
|
-
// Get all the events from the window.
|
|
526
|
-
const online$ = fromEvent(this._window, 'online').pipe(mapTo(true));
|
|
527
|
-
const offline$ = fromEvent(this._window, 'offline').pipe(mapTo(false));
|
|
528
|
-
const now$ = new Observable(subscriber => {
|
|
529
|
-
var _a;
|
|
530
|
-
subscriber.next((_a = this._navigator) === null || _a === void 0 ? void 0 : _a.onLine);
|
|
531
|
-
subscriber.complete();
|
|
532
|
-
});
|
|
533
|
-
// Merge all event so we get notified when
|
|
534
|
-
// a user is online/offline.
|
|
535
|
-
this._online$ = merge(now$, online$, offline$).pipe(map(value => value), distinctUntilChanged(), shareReplay(1));
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
Network.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
539
|
-
Network.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.
|
|
540
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
541
|
-
type: Injectable,
|
|
542
|
-
args: [{
|
|
543
|
-
providedIn: 'root'
|
|
544
|
-
}]
|
|
545
|
-
}], ctorParameters: function () { return [{ type: Platform }, { type: undefined, decorators: [{
|
|
546
|
-
type: Optional
|
|
547
|
-
}, {
|
|
548
|
-
type: Inject,
|
|
549
|
-
args: [WINDOW]
|
|
550
|
-
}] }, { type: undefined, decorators: [{
|
|
551
|
-
type: Optional
|
|
552
|
-
}, {
|
|
553
|
-
type: Inject,
|
|
554
|
-
args: [NAVIGATOR]
|
|
508
|
+
class Network {
|
|
509
|
+
constructor(_platform, _window, _navigator) {
|
|
510
|
+
this._platform = _platform;
|
|
511
|
+
this._window = _window;
|
|
512
|
+
this._navigator = _navigator;
|
|
513
|
+
// Data.
|
|
514
|
+
this._online$ = of(true);
|
|
515
|
+
this.getOnlineObservable();
|
|
516
|
+
}
|
|
517
|
+
online() {
|
|
518
|
+
return this._online$;
|
|
519
|
+
}
|
|
520
|
+
getOnlineObservable() {
|
|
521
|
+
// Validate we are on a browser.
|
|
522
|
+
if (!this._platform.isBrowser) {
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
// Get all the events from the window.
|
|
526
|
+
const online$ = fromEvent(this._window, 'online').pipe(mapTo(true));
|
|
527
|
+
const offline$ = fromEvent(this._window, 'offline').pipe(mapTo(false));
|
|
528
|
+
const now$ = new Observable(subscriber => {
|
|
529
|
+
var _a;
|
|
530
|
+
subscriber.next((_a = this._navigator) === null || _a === void 0 ? void 0 : _a.onLine);
|
|
531
|
+
subscriber.complete();
|
|
532
|
+
});
|
|
533
|
+
// Merge all event so we get notified when
|
|
534
|
+
// a user is online/offline.
|
|
535
|
+
this._online$ = merge(now$, online$, offline$).pipe(map(value => value), distinctUntilChanged(), shareReplay(1));
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
Network.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Network, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: NAVIGATOR, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
539
|
+
Network.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Network, providedIn: 'root' });
|
|
540
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Network, decorators: [{
|
|
541
|
+
type: Injectable,
|
|
542
|
+
args: [{
|
|
543
|
+
providedIn: 'root'
|
|
544
|
+
}]
|
|
545
|
+
}], ctorParameters: function () { return [{ type: Platform }, { type: undefined, decorators: [{
|
|
546
|
+
type: Optional
|
|
547
|
+
}, {
|
|
548
|
+
type: Inject,
|
|
549
|
+
args: [WINDOW]
|
|
550
|
+
}] }, { type: undefined, decorators: [{
|
|
551
|
+
type: Optional
|
|
552
|
+
}, {
|
|
553
|
+
type: Inject,
|
|
554
|
+
args: [NAVIGATOR]
|
|
555
555
|
}] }]; } });
|
|
556
556
|
|
|
557
|
-
class Patch {
|
|
558
|
-
constructor(_platform, _window, _document) {
|
|
559
|
-
this._platform = _platform;
|
|
560
|
-
this._window = _window;
|
|
561
|
-
this._document = _document;
|
|
562
|
-
this._hasPatchedMobileVerticalHeight = false;
|
|
563
|
-
// Subscriptions.
|
|
564
|
-
this._subscription = new Subscription();
|
|
565
|
-
}
|
|
566
|
-
mobileVerticalHeight() {
|
|
567
|
-
// Check if the user has already patched
|
|
568
|
-
// the mobile vertical height.
|
|
569
|
-
if (this._hasPatchedMobileVerticalHeight) {
|
|
570
|
-
return;
|
|
571
|
-
}
|
|
572
|
-
this.periodicallySetDocumentVerticalProperty();
|
|
573
|
-
this._hasPatchedMobileVerticalHeight = true;
|
|
574
|
-
}
|
|
575
|
-
ngOnDestroy() {
|
|
576
|
-
var _a;
|
|
577
|
-
(_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
578
|
-
}
|
|
579
|
-
periodicallySetDocumentVerticalProperty() {
|
|
580
|
-
// Validate we are using a browser.
|
|
581
|
-
if (!this._platform.isBrowser) {
|
|
582
|
-
return;
|
|
583
|
-
}
|
|
584
|
-
// Listen to a debounced window resize event.
|
|
585
|
-
const resize$ = fromEvent(this._window, 'resize').pipe(debounceTime(25), startWith(0));
|
|
586
|
-
// Subscribe to the resize observable.
|
|
587
|
-
const subscription = resize$.subscribe(() => {
|
|
588
|
-
var _a, _b, _c, _d;
|
|
589
|
-
const verticalHeight = ((_a = this._window) === null || _a === void 0 ? void 0 : _a.innerHeight) * 0.01;
|
|
590
|
-
(_d = (_c = (_b = this._document) === null || _b === void 0 ? void 0 : _b.documentElement) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.setProperty('--vh', `${verticalHeight}px`);
|
|
591
|
-
});
|
|
592
|
-
// Save the subscription so we can destroy it later.
|
|
593
|
-
this._subscription.add(subscription);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
Patch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
597
|
-
Patch.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.
|
|
598
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
599
|
-
type: Injectable,
|
|
600
|
-
args: [{
|
|
601
|
-
providedIn: 'root'
|
|
602
|
-
}]
|
|
603
|
-
}], ctorParameters: function () { return [{ type: Platform }, { type: undefined, decorators: [{
|
|
604
|
-
type: Optional
|
|
605
|
-
}, {
|
|
606
|
-
type: Inject,
|
|
607
|
-
args: [WINDOW]
|
|
608
|
-
}] }, { type: undefined, decorators: [{
|
|
609
|
-
type: Optional
|
|
610
|
-
}, {
|
|
611
|
-
type: Inject,
|
|
612
|
-
args: [DOCUMENT]
|
|
557
|
+
class Patch {
|
|
558
|
+
constructor(_platform, _window, _document) {
|
|
559
|
+
this._platform = _platform;
|
|
560
|
+
this._window = _window;
|
|
561
|
+
this._document = _document;
|
|
562
|
+
this._hasPatchedMobileVerticalHeight = false;
|
|
563
|
+
// Subscriptions.
|
|
564
|
+
this._subscription = new Subscription();
|
|
565
|
+
}
|
|
566
|
+
mobileVerticalHeight() {
|
|
567
|
+
// Check if the user has already patched
|
|
568
|
+
// the mobile vertical height.
|
|
569
|
+
if (this._hasPatchedMobileVerticalHeight) {
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
this.periodicallySetDocumentVerticalProperty();
|
|
573
|
+
this._hasPatchedMobileVerticalHeight = true;
|
|
574
|
+
}
|
|
575
|
+
ngOnDestroy() {
|
|
576
|
+
var _a;
|
|
577
|
+
(_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
578
|
+
}
|
|
579
|
+
periodicallySetDocumentVerticalProperty() {
|
|
580
|
+
// Validate we are using a browser.
|
|
581
|
+
if (!this._platform.isBrowser) {
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
// Listen to a debounced window resize event.
|
|
585
|
+
const resize$ = fromEvent(this._window, 'resize').pipe(debounceTime(25), startWith(0));
|
|
586
|
+
// Subscribe to the resize observable.
|
|
587
|
+
const subscription = resize$.subscribe(() => {
|
|
588
|
+
var _a, _b, _c, _d;
|
|
589
|
+
const verticalHeight = ((_a = this._window) === null || _a === void 0 ? void 0 : _a.innerHeight) * 0.01;
|
|
590
|
+
(_d = (_c = (_b = this._document) === null || _b === void 0 ? void 0 : _b.documentElement) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.setProperty('--vh', `${verticalHeight}px`);
|
|
591
|
+
});
|
|
592
|
+
// Save the subscription so we can destroy it later.
|
|
593
|
+
this._subscription.add(subscription);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
Patch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Patch, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
597
|
+
Patch.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Patch, providedIn: 'root' });
|
|
598
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Patch, decorators: [{
|
|
599
|
+
type: Injectable,
|
|
600
|
+
args: [{
|
|
601
|
+
providedIn: 'root'
|
|
602
|
+
}]
|
|
603
|
+
}], ctorParameters: function () { return [{ type: Platform }, { type: undefined, decorators: [{
|
|
604
|
+
type: Optional
|
|
605
|
+
}, {
|
|
606
|
+
type: Inject,
|
|
607
|
+
args: [WINDOW]
|
|
608
|
+
}] }, { type: undefined, decorators: [{
|
|
609
|
+
type: Optional
|
|
610
|
+
}, {
|
|
611
|
+
type: Inject,
|
|
612
|
+
args: [DOCUMENT]
|
|
613
613
|
}] }]; } });
|
|
614
614
|
|
|
615
|
-
|
|
616
|
-
|
|
615
|
+
class Clipboard {
|
|
616
|
+
constructor(_document) {
|
|
617
|
+
this._document = _document;
|
|
618
|
+
}
|
|
619
|
+
copy(text) {
|
|
620
|
+
const pendingCopy = this.beginCopy(text);
|
|
621
|
+
const successful = pendingCopy.copy();
|
|
622
|
+
pendingCopy.destroy();
|
|
623
|
+
return successful;
|
|
624
|
+
}
|
|
625
|
+
beginCopy(text) {
|
|
626
|
+
return new ClipboardCopy(text, this._document);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
Clipboard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Clipboard, deps: [{ token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
630
|
+
Clipboard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Clipboard, providedIn: 'root' });
|
|
631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Clipboard, decorators: [{
|
|
632
|
+
type: Injectable,
|
|
633
|
+
args: [{
|
|
634
|
+
providedIn: 'root'
|
|
635
|
+
}]
|
|
636
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
637
|
+
type: Optional
|
|
638
|
+
}, {
|
|
639
|
+
type: Inject,
|
|
640
|
+
args: [DOCUMENT]
|
|
641
|
+
}] }]; } });
|
|
642
|
+
class ClipboardCopy {
|
|
643
|
+
constructor(_text, _document) {
|
|
644
|
+
this._text = _text;
|
|
645
|
+
this._document = _document;
|
|
646
|
+
this.initialize();
|
|
647
|
+
}
|
|
648
|
+
copy() {
|
|
649
|
+
var _a, _b, _c, _d, _e, _f;
|
|
650
|
+
const textarea = this._textarea;
|
|
651
|
+
let successful = false;
|
|
652
|
+
try {
|
|
653
|
+
const currentFocus = this._document.activeElement;
|
|
654
|
+
(_a = textarea === null || textarea === void 0 ? void 0 : textarea.select) === null || _a === void 0 ? void 0 : _a.call(textarea);
|
|
655
|
+
(_b = textarea === null || textarea === void 0 ? void 0 : textarea.setSelectionRange) === null || _b === void 0 ? void 0 : _b.call(textarea, 0, (_c = textarea === null || textarea === void 0 ? void 0 : textarea.value) === null || _c === void 0 ? void 0 : _c.length);
|
|
656
|
+
successful = (_e = (_d = this._document) === null || _d === void 0 ? void 0 : _d.execCommand) === null || _e === void 0 ? void 0 : _e.call(_d, 'copy');
|
|
657
|
+
(_f = currentFocus === null || currentFocus === void 0 ? void 0 : currentFocus.focus) === null || _f === void 0 ? void 0 : _f.call(currentFocus);
|
|
658
|
+
}
|
|
659
|
+
catch (_g) {
|
|
660
|
+
// Do nothing.
|
|
661
|
+
}
|
|
662
|
+
return successful;
|
|
663
|
+
}
|
|
664
|
+
destroy() {
|
|
665
|
+
var _a, _b, _c;
|
|
666
|
+
(_c = (_b = (_a = this._textarea) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild) === null || _c === void 0 ? void 0 : _c.call(_b, this._textarea);
|
|
667
|
+
this._textarea = undefined;
|
|
668
|
+
}
|
|
669
|
+
initialize() {
|
|
670
|
+
const textarea = this._textarea = this._document.createElement('textarea');
|
|
671
|
+
const styles = textarea.style;
|
|
672
|
+
// Hide the element for display and accessibility. Set a fixed position so the page layout
|
|
673
|
+
// isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea
|
|
674
|
+
// for a split second and if it's off-screen, some browsers will attempt to scroll it into view.
|
|
675
|
+
styles.position = 'fixed';
|
|
676
|
+
styles.top = styles.opacity = '0';
|
|
677
|
+
styles.left = '-999em';
|
|
678
|
+
textarea.setAttribute('aria-hidden', 'true');
|
|
679
|
+
textarea.value = this._text;
|
|
680
|
+
this._document.body.appendChild(textarea);
|
|
681
|
+
}
|
|
617
682
|
}
|
|
618
683
|
|
|
619
|
-
function
|
|
620
|
-
return
|
|
621
|
-
constructor(...args) {
|
|
622
|
-
super(...args);
|
|
623
|
-
this._disable = false;
|
|
624
|
-
}
|
|
625
|
-
get disabled() {
|
|
626
|
-
return this._disable;
|
|
627
|
-
}
|
|
628
|
-
set disabled(value) {
|
|
629
|
-
this._disable = coerceBooleanProperty(value);
|
|
630
|
-
}
|
|
631
|
-
};
|
|
684
|
+
function coerceBooleanProperty(value) {
|
|
685
|
+
return value != null && `${value}` !== 'false';
|
|
632
686
|
}
|
|
633
687
|
|
|
634
|
-
function
|
|
635
|
-
return class extends base {
|
|
636
|
-
constructor(...args) {
|
|
637
|
-
super(...args);
|
|
638
|
-
this.
|
|
639
|
-
}
|
|
640
|
-
get
|
|
641
|
-
return this.
|
|
642
|
-
}
|
|
643
|
-
set
|
|
644
|
-
this.
|
|
645
|
-
}
|
|
646
|
-
};
|
|
688
|
+
function mixinDisabled(base) {
|
|
689
|
+
return class extends base {
|
|
690
|
+
constructor(...args) {
|
|
691
|
+
super(...args);
|
|
692
|
+
this._disable = false;
|
|
693
|
+
}
|
|
694
|
+
get disabled() {
|
|
695
|
+
return this._disable;
|
|
696
|
+
}
|
|
697
|
+
set disabled(value) {
|
|
698
|
+
this._disable = coerceBooleanProperty(value);
|
|
699
|
+
}
|
|
700
|
+
};
|
|
647
701
|
}
|
|
648
702
|
|
|
649
|
-
function
|
|
650
|
-
return class extends base {
|
|
651
|
-
constructor(...args) {
|
|
652
|
-
super(...args);
|
|
653
|
-
this.
|
|
654
|
-
}
|
|
655
|
-
get
|
|
656
|
-
return this.
|
|
657
|
-
}
|
|
658
|
-
set
|
|
659
|
-
this.
|
|
660
|
-
}
|
|
661
|
-
};
|
|
703
|
+
function mixinLoad(base) {
|
|
704
|
+
return class extends base {
|
|
705
|
+
constructor(...args) {
|
|
706
|
+
super(...args);
|
|
707
|
+
this._loading = false;
|
|
708
|
+
}
|
|
709
|
+
get loading() {
|
|
710
|
+
return this._loading;
|
|
711
|
+
}
|
|
712
|
+
set loading(value) {
|
|
713
|
+
this._loading = coerceBooleanProperty(value);
|
|
714
|
+
}
|
|
715
|
+
};
|
|
662
716
|
}
|
|
663
717
|
|
|
664
|
-
function
|
|
665
|
-
return class extends base {
|
|
666
|
-
constructor(...args) {
|
|
667
|
-
super(...args);
|
|
668
|
-
this.
|
|
669
|
-
}
|
|
670
|
-
get
|
|
671
|
-
return this.
|
|
672
|
-
}
|
|
673
|
-
set
|
|
674
|
-
this.
|
|
675
|
-
}
|
|
676
|
-
};
|
|
718
|
+
function mixinError(base) {
|
|
719
|
+
return class extends base {
|
|
720
|
+
constructor(...args) {
|
|
721
|
+
super(...args);
|
|
722
|
+
this._error = false;
|
|
723
|
+
}
|
|
724
|
+
get error() {
|
|
725
|
+
return this._error;
|
|
726
|
+
}
|
|
727
|
+
set error(value) {
|
|
728
|
+
this._error = coerceBooleanProperty(value);
|
|
729
|
+
}
|
|
730
|
+
};
|
|
677
731
|
}
|
|
678
732
|
|
|
679
|
-
function
|
|
680
|
-
return class extends base {
|
|
681
|
-
constructor(...args) {
|
|
682
|
-
super(...args);
|
|
683
|
-
this.
|
|
684
|
-
}
|
|
685
|
-
get
|
|
686
|
-
return this.
|
|
687
|
-
}
|
|
688
|
-
set
|
|
689
|
-
this.
|
|
690
|
-
}
|
|
691
|
-
};
|
|
733
|
+
function mixinHideErrors(base) {
|
|
734
|
+
return class extends base {
|
|
735
|
+
constructor(...args) {
|
|
736
|
+
super(...args);
|
|
737
|
+
this._hideErrors = false;
|
|
738
|
+
}
|
|
739
|
+
get hideErrors() {
|
|
740
|
+
return this._hideErrors;
|
|
741
|
+
}
|
|
742
|
+
set hideErrors(value) {
|
|
743
|
+
this._hideErrors = coerceBooleanProperty(value);
|
|
744
|
+
}
|
|
745
|
+
};
|
|
692
746
|
}
|
|
693
747
|
|
|
694
|
-
function
|
|
695
|
-
return class extends base {
|
|
696
|
-
constructor(...args) {
|
|
697
|
-
super(...args);
|
|
698
|
-
this.
|
|
699
|
-
}
|
|
700
|
-
get
|
|
701
|
-
return this.
|
|
702
|
-
}
|
|
703
|
-
set
|
|
704
|
-
this.
|
|
705
|
-
}
|
|
706
|
-
};
|
|
748
|
+
function mixinFocused(base) {
|
|
749
|
+
return class extends base {
|
|
750
|
+
constructor(...args) {
|
|
751
|
+
super(...args);
|
|
752
|
+
this._focused = false;
|
|
753
|
+
}
|
|
754
|
+
get focused() {
|
|
755
|
+
return this._focused;
|
|
756
|
+
}
|
|
757
|
+
set focused(value) {
|
|
758
|
+
this._focused = coerceBooleanProperty(value);
|
|
759
|
+
}
|
|
760
|
+
};
|
|
707
761
|
}
|
|
708
762
|
|
|
709
|
-
function
|
|
710
|
-
return class extends base {
|
|
711
|
-
constructor(...args) {
|
|
712
|
-
super(...args);
|
|
713
|
-
this.
|
|
714
|
-
}
|
|
715
|
-
get
|
|
716
|
-
return this.
|
|
717
|
-
}
|
|
718
|
-
set
|
|
719
|
-
this.
|
|
720
|
-
}
|
|
721
|
-
};
|
|
763
|
+
function mixinGrouped(base) {
|
|
764
|
+
return class extends base {
|
|
765
|
+
constructor(...args) {
|
|
766
|
+
super(...args);
|
|
767
|
+
this._grouped = false;
|
|
768
|
+
}
|
|
769
|
+
get grouped() {
|
|
770
|
+
return this._grouped;
|
|
771
|
+
}
|
|
772
|
+
set grouped(value) {
|
|
773
|
+
this._grouped = coerceBooleanProperty(value);
|
|
774
|
+
}
|
|
775
|
+
};
|
|
722
776
|
}
|
|
723
777
|
|
|
724
|
-
function
|
|
725
|
-
return class extends base {
|
|
726
|
-
constructor(...args) {
|
|
727
|
-
super(...args);
|
|
728
|
-
this.
|
|
729
|
-
}
|
|
730
|
-
get
|
|
731
|
-
return this.
|
|
732
|
-
}
|
|
733
|
-
set
|
|
734
|
-
this.
|
|
735
|
-
}
|
|
736
|
-
};
|
|
778
|
+
function mixinReadonly(base) {
|
|
779
|
+
return class extends base {
|
|
780
|
+
constructor(...args) {
|
|
781
|
+
super(...args);
|
|
782
|
+
this._readonly = false;
|
|
783
|
+
}
|
|
784
|
+
get readonly() {
|
|
785
|
+
return this._readonly;
|
|
786
|
+
}
|
|
787
|
+
set readonly(value) {
|
|
788
|
+
this._readonly = coerceBooleanProperty(value);
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
function mixinRequired(base) {
|
|
794
|
+
return class extends base {
|
|
795
|
+
constructor(...args) {
|
|
796
|
+
super(...args);
|
|
797
|
+
this._required = false;
|
|
798
|
+
}
|
|
799
|
+
get required() {
|
|
800
|
+
return this._required;
|
|
801
|
+
}
|
|
802
|
+
set required(value) {
|
|
803
|
+
this._required = coerceBooleanProperty(value);
|
|
804
|
+
}
|
|
805
|
+
};
|
|
737
806
|
}
|
|
738
807
|
|
|
739
808
|
const BASE_URL = new InjectionToken('BaseUrl');
|
|
740
809
|
|
|
741
810
|
const COOKIE = new InjectionToken('Cookie');
|
|
742
811
|
|
|
743
|
-
const LOCATION = new InjectionToken('An abstraction over window.location object', {
|
|
744
|
-
factory: () => inject(WINDOW).location
|
|
812
|
+
const LOCATION = new InjectionToken('An abstraction over window.location object', {
|
|
813
|
+
factory: () => inject(WINDOW).location
|
|
745
814
|
});
|
|
746
815
|
|
|
747
|
-
const BbRegex = {
|
|
748
|
-
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
749
|
-
fullNumber: /^\d*[1-9]\d*$/
|
|
816
|
+
const BbRegex = {
|
|
817
|
+
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
818
|
+
fullNumber: /^\d*[1-9]\d*$/
|
|
750
819
|
};
|
|
751
820
|
|
|
752
|
-
class BbValidator {
|
|
753
|
-
static email(control) {
|
|
754
|
-
if (isEmptyInputValue(control.value)) {
|
|
755
|
-
return null;
|
|
756
|
-
}
|
|
757
|
-
return BbRegex.email.test(control.value) ? null : { email: true };
|
|
758
|
-
}
|
|
759
|
-
static fullNumber(control) {
|
|
760
|
-
if (isEmptyInputValue(control.value)) {
|
|
761
|
-
return null;
|
|
762
|
-
}
|
|
763
|
-
return BbRegex.fullNumber.test(control.value) ? null : { fullNumber: true };
|
|
764
|
-
}
|
|
765
|
-
static maxFileSize(bytes) {
|
|
766
|
-
const validator = (control) => {
|
|
767
|
-
const value = control.value;
|
|
768
|
-
// Validate if the value is a file.
|
|
769
|
-
if (!(value instanceof File)) {
|
|
770
|
-
return null;
|
|
771
|
-
}
|
|
772
|
-
if (value.size <= bytes) {
|
|
773
|
-
return null;
|
|
774
|
-
}
|
|
775
|
-
let maxSize = '0 Bytes';
|
|
776
|
-
if (bytes !== 0) {
|
|
777
|
-
const k = 1024;
|
|
778
|
-
const dm = 2;
|
|
779
|
-
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
780
|
-
const index = Math.floor(Math.log(bytes) / Math.log(k));
|
|
781
|
-
maxSize = parseFloat((bytes / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
|
|
782
|
-
}
|
|
783
|
-
return { maxFileSize: { maxSize } };
|
|
784
|
-
};
|
|
785
|
-
return validator;
|
|
786
|
-
}
|
|
787
|
-
static confirm(fieldName, error = 'confirm') {
|
|
788
|
-
const validator = (control) => {
|
|
789
|
-
var _a;
|
|
790
|
-
if (isEmptyInputValue(control.value)) {
|
|
791
|
-
return null;
|
|
792
|
-
}
|
|
793
|
-
const field = (_a = control === null || control === void 0 ? void 0 : control.parent) === null || _a === void 0 ? void 0 : _a.get(fieldName);
|
|
794
|
-
return (control === null || control === void 0 ? void 0 : control.value) === (field === null || field === void 0 ? void 0 : field.value)
|
|
795
|
-
? null
|
|
796
|
-
: { [error]: true };
|
|
797
|
-
};
|
|
798
|
-
return validator;
|
|
799
|
-
}
|
|
800
|
-
static maxDate(date, error = 'maxDate') {
|
|
801
|
-
const formattedDate = date.toString() !== 'Invalid Date'
|
|
802
|
-
? formatDate(date, 'yyyy-MM-dd', 'en-US')
|
|
803
|
-
: null;
|
|
804
|
-
const validator = (control) => {
|
|
805
|
-
if (isEmptyInputValue(control.value)) {
|
|
806
|
-
return null;
|
|
807
|
-
}
|
|
808
|
-
const controlDate = new Date(control.value);
|
|
809
|
-
return controlDate.getTime() > date.getTime()
|
|
810
|
-
? { [error]: { date: formattedDate } }
|
|
811
|
-
: null;
|
|
812
|
-
};
|
|
813
|
-
return validator;
|
|
814
|
-
}
|
|
815
|
-
static minDate(date, error = 'minDate') {
|
|
816
|
-
const formattedDate = date.toString() !== 'Invalid Date'
|
|
817
|
-
? formatDate(date, 'yyyy-MM-dd', 'en-US')
|
|
818
|
-
: null;
|
|
819
|
-
const validator = (control) => {
|
|
820
|
-
if (isEmptyInputValue(control.value)) {
|
|
821
|
-
return null;
|
|
822
|
-
}
|
|
823
|
-
const controlDate = new Date(control.value);
|
|
824
|
-
return controlDate.getTime() < date.getTime()
|
|
825
|
-
? { [error]: { date: formattedDate } }
|
|
826
|
-
: null;
|
|
827
|
-
};
|
|
828
|
-
return validator;
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
function isEmptyInputValue(value) {
|
|
832
|
-
// We don't check for string here so it also works with arrays.
|
|
833
|
-
return value == null || value.length === 0;
|
|
821
|
+
class BbValidator {
|
|
822
|
+
static email(control) {
|
|
823
|
+
if (isEmptyInputValue(control.value)) {
|
|
824
|
+
return null;
|
|
825
|
+
}
|
|
826
|
+
return BbRegex.email.test(control.value) ? null : { email: true };
|
|
827
|
+
}
|
|
828
|
+
static fullNumber(control) {
|
|
829
|
+
if (isEmptyInputValue(control.value)) {
|
|
830
|
+
return null;
|
|
831
|
+
}
|
|
832
|
+
return BbRegex.fullNumber.test(control.value) ? null : { fullNumber: true };
|
|
833
|
+
}
|
|
834
|
+
static maxFileSize(bytes) {
|
|
835
|
+
const validator = (control) => {
|
|
836
|
+
const value = control.value;
|
|
837
|
+
// Validate if the value is a file.
|
|
838
|
+
if (!(value instanceof File)) {
|
|
839
|
+
return null;
|
|
840
|
+
}
|
|
841
|
+
if (value.size <= bytes) {
|
|
842
|
+
return null;
|
|
843
|
+
}
|
|
844
|
+
let maxSize = '0 Bytes';
|
|
845
|
+
if (bytes !== 0) {
|
|
846
|
+
const k = 1024;
|
|
847
|
+
const dm = 2;
|
|
848
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
849
|
+
const index = Math.floor(Math.log(bytes) / Math.log(k));
|
|
850
|
+
maxSize = parseFloat((bytes / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
|
|
851
|
+
}
|
|
852
|
+
return { maxFileSize: { maxSize } };
|
|
853
|
+
};
|
|
854
|
+
return validator;
|
|
855
|
+
}
|
|
856
|
+
static confirm(fieldName, error = 'confirm') {
|
|
857
|
+
const validator = (control) => {
|
|
858
|
+
var _a;
|
|
859
|
+
if (isEmptyInputValue(control.value)) {
|
|
860
|
+
return null;
|
|
861
|
+
}
|
|
862
|
+
const field = (_a = control === null || control === void 0 ? void 0 : control.parent) === null || _a === void 0 ? void 0 : _a.get(fieldName);
|
|
863
|
+
return (control === null || control === void 0 ? void 0 : control.value) === (field === null || field === void 0 ? void 0 : field.value)
|
|
864
|
+
? null
|
|
865
|
+
: { [error]: true };
|
|
866
|
+
};
|
|
867
|
+
return validator;
|
|
868
|
+
}
|
|
869
|
+
static maxDate(date, error = 'maxDate') {
|
|
870
|
+
const formattedDate = date.toString() !== 'Invalid Date'
|
|
871
|
+
? formatDate(date, 'yyyy-MM-dd', 'en-US')
|
|
872
|
+
: null;
|
|
873
|
+
const validator = (control) => {
|
|
874
|
+
if (isEmptyInputValue(control.value)) {
|
|
875
|
+
return null;
|
|
876
|
+
}
|
|
877
|
+
const controlDate = new Date(control.value);
|
|
878
|
+
return controlDate.getTime() > date.getTime()
|
|
879
|
+
? { [error]: { date: formattedDate } }
|
|
880
|
+
: null;
|
|
881
|
+
};
|
|
882
|
+
return validator;
|
|
883
|
+
}
|
|
884
|
+
static minDate(date, error = 'minDate') {
|
|
885
|
+
const formattedDate = date.toString() !== 'Invalid Date'
|
|
886
|
+
? formatDate(date, 'yyyy-MM-dd', 'en-US')
|
|
887
|
+
: null;
|
|
888
|
+
const validator = (control) => {
|
|
889
|
+
if (isEmptyInputValue(control.value)) {
|
|
890
|
+
return null;
|
|
891
|
+
}
|
|
892
|
+
const controlDate = new Date(control.value);
|
|
893
|
+
return controlDate.getTime() < date.getTime()
|
|
894
|
+
? { [error]: { date: formattedDate } }
|
|
895
|
+
: null;
|
|
896
|
+
};
|
|
897
|
+
return validator;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
function isEmptyInputValue(value) {
|
|
901
|
+
// We don't check for string here so it also works with arrays.
|
|
902
|
+
return value == null || value.length === 0;
|
|
834
903
|
}
|
|
835
904
|
|
|
836
|
-
/*
|
|
837
|
-
* Public API Surface of bb-foundation
|
|
905
|
+
/*
|
|
906
|
+
* Public API Surface of bb-foundation
|
|
838
907
|
*/
|
|
839
908
|
|
|
840
|
-
/**
|
|
841
|
-
* Generated bundle index. Do not edit.
|
|
909
|
+
/**
|
|
910
|
+
* Generated bundle index. Do not edit.
|
|
842
911
|
*/
|
|
843
912
|
|
|
844
|
-
export { ACCEPT_LANGUAGE, BASE_URL, BbRegex, BbValidator, COOKIE, Exif, FileLoader, ImageConverter, LOCATION, Languages, NAVIGATOR, Network, Patch, Platform, WINDOW, coerceBooleanProperty, mixinDisabled, mixinError, mixinFocused, mixinGrouped, mixinHideErrors, mixinLoad, mixinReadonly, mixinRequired };
|
|
913
|
+
export { ACCEPT_LANGUAGE, BASE_URL, BbRegex, BbValidator, COOKIE, Clipboard, ClipboardCopy, Exif, FileLoader, ImageConverter, LOCATION, Languages, NAVIGATOR, Network, Patch, Platform, WINDOW, coerceBooleanProperty, mixinDisabled, mixinError, mixinFocused, mixinGrouped, mixinHideErrors, mixinLoad, mixinReadonly, mixinRequired };
|
|
845
914
|
//# sourceMappingURL=bravobit-bb-foundation.js.map
|