@bravobit/bb-foundation 0.15.4 → 0.16.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/auth/lib/auth.interceptor.d.ts +1 -1
- package/auth/lib/auth.service.d.ts +1 -1
- package/auth/package.json +5 -5
- package/collections/package.json +5 -5
- package/controls/bravobit-bb-foundation-controls.d.ts +5 -0
- package/controls/lib/checkbox/checkbox.component.d.ts +27 -0
- package/controls/lib/checkbox/checkbox.module.d.ts +9 -0
- package/controls/lib/controls.module.d.ts +7 -0
- package/controls/package.json +10 -0
- package/controls/public_api.d.ts +3 -0
- package/dashboard/package.json +5 -5
- package/dialog/package.json +5 -5
- package/elements/package.json +5 -5
- package/{esm2015/auth/bravobit-bb-foundation-auth.js → esm2020/auth/bravobit-bb-foundation-auth.mjs} +0 -0
- package/esm2020/auth/lib/auth.interceptor.mjs +94 -0
- package/{esm2015/auth/lib/auth.module.js → esm2020/auth/lib/auth.module.mjs} +5 -5
- package/esm2020/auth/lib/auth.service.mjs +276 -0
- package/esm2020/auth/lib/auth.session.mjs +131 -0
- package/{esm2015/auth/lib/directives/authenticated.directive.js → esm2020/auth/lib/directives/authenticated.directive.mjs} +5 -6
- package/esm2020/auth/lib/directives/permission.directive.mjs +80 -0
- package/esm2020/auth/lib/directives/role.directive.mjs +37 -0
- package/esm2020/auth/lib/guards/anonymous.guard.mjs +34 -0
- package/esm2020/auth/lib/guards/authenticated.guard.mjs +35 -0
- package/{esm2015/auth/lib/helpers/jwt.helper.js → esm2020/auth/lib/helpers/jwt.helper.mjs} +3 -3
- package/{esm2015/auth/lib/helpers/mapper.helper.js → esm2020/auth/lib/helpers/mapper.helper.mjs} +4 -4
- package/{esm2015/auth/lib/interfaces/config.interface.js → esm2020/auth/lib/interfaces/config.interface.mjs} +0 -0
- package/{esm2015/auth/lib/interfaces/mapper.interface.js → esm2020/auth/lib/interfaces/mapper.interface.mjs} +0 -0
- package/{esm2015/auth/lib/interfaces/provider.interface.js → esm2020/auth/lib/interfaces/provider.interface.mjs} +0 -0
- package/{esm2015/auth/lib/interfaces/token.interface.js → esm2020/auth/lib/interfaces/token.interface.mjs} +0 -0
- package/esm2020/auth/lib/permissions.service.mjs +56 -0
- package/esm2020/auth/lib/providers/email.provider.mjs +25 -0
- package/esm2020/auth/lib/providers/verify.provider.mjs +19 -0
- package/{esm2015/auth/lib/tokens/use-authorization.token.js → esm2020/auth/lib/tokens/use-authorization.token.mjs} +0 -0
- package/{esm2015/auth/public_api.js → esm2020/auth/public_api.mjs} +0 -0
- package/{esm2015/bravobit-bb-foundation.js → esm2020/bravobit-bb-foundation.mjs} +0 -0
- package/{esm2015/collections/bravobit-bb-foundation-collections.js → esm2020/collections/bravobit-bb-foundation-collections.mjs} +0 -0
- package/esm2020/collections/lib/collection.mjs +98 -0
- package/{esm2015/collections/lib/collections.module.js → esm2020/collections/lib/collections.module.mjs} +5 -5
- package/esm2020/collections/lib/components/collections-pager/collections-pager.component.mjs +123 -0
- package/esm2020/collections/lib/components/collections-viewer/collections-viewer.component.mjs +31 -0
- package/{esm2015/collections/lib/components/collections.directive.js → esm2020/collections/lib/components/collections.directive.mjs} +13 -13
- package/{esm2015/collections/lib/interfaces/collection.interface.js → esm2020/collections/lib/interfaces/collection.interface.mjs} +0 -0
- package/esm2020/collections/lib/providers/api-collection.provider.mjs +68 -0
- package/esm2020/collections/lib/providers/collection.provider.mjs +13 -0
- package/{esm2015/collections/lib/providers/local-collection.provider.js → esm2020/collections/lib/providers/local-collection.provider.mjs} +0 -0
- package/{esm2015/collections/public_api.js → esm2020/collections/public_api.mjs} +0 -0
- package/esm2020/controls/bravobit-bb-foundation-controls.mjs +5 -0
- package/esm2020/controls/lib/checkbox/checkbox.component.mjs +86 -0
- package/esm2020/controls/lib/checkbox/checkbox.module.mjs +19 -0
- package/esm2020/controls/lib/controls.module.mjs +16 -0
- package/esm2020/controls/public_api.mjs +4 -0
- package/{esm2015/dashboard/bravobit-bb-foundation-dashboard.js → esm2020/dashboard/bravobit-bb-foundation-dashboard.mjs} +0 -0
- package/esm2020/dashboard/lib/dashboard/dashboard.component.mjs +56 -0
- package/esm2020/dashboard/lib/dashboard-header/dashboard-header.component.mjs +30 -0
- package/esm2020/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +31 -0
- package/esm2020/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +29 -0
- package/esm2020/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +75 -0
- package/esm2020/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +99 -0
- package/esm2020/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +62 -0
- package/{esm2015/dashboard/lib/dashboard.module.js → esm2020/dashboard/lib/dashboard.module.mjs} +5 -5
- package/{esm2015/dashboard/public_api.js → esm2020/dashboard/public_api.mjs} +0 -0
- package/{esm2015/dialog/bravobit-bb-foundation-dialog.js → esm2020/dialog/bravobit-bb-foundation-dialog.mjs} +0 -0
- package/esm2020/dialog/lib/dialog-actions/dialog-actions.component.mjs +12 -0
- package/esm2020/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +37 -0
- package/{esm2015/dialog/lib/dialog-container/dialog-container.component.js → esm2020/dialog/lib/dialog-container/dialog-container.component.mjs} +6 -15
- package/esm2020/dialog/lib/dialog-header/dialog-header.component.mjs +25 -0
- package/esm2020/dialog/lib/dialog-link/dialog-link.component.mjs +11 -0
- package/esm2020/dialog/lib/dialog-modal/dialog-modal.component.mjs +46 -0
- package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +134 -0
- package/{esm2015/dialog/lib/dialog.injector.js → esm2020/dialog/lib/dialog.injector.mjs} +0 -0
- package/{esm2015/dialog/lib/dialog.insertion.js → esm2020/dialog/lib/dialog.insertion.mjs} +4 -4
- package/{esm2015/dialog/lib/dialog.interfaces.js → esm2020/dialog/lib/dialog.interfaces.mjs} +0 -0
- package/{esm2015/dialog/lib/dialog.module.js → esm2020/dialog/lib/dialog.module.mjs} +5 -9
- package/{esm2015/dialog/lib/dialog.ref.js → esm2020/dialog/lib/dialog.ref.mjs} +0 -0
- package/{esm2015/dialog/lib/dialog.service.js → esm2020/dialog/lib/dialog.service.mjs} +5 -5
- package/{esm2015/dialog/public_api.js → esm2020/dialog/public_api.mjs} +0 -0
- package/{esm2015/elements/bravobit-bb-foundation-elements.js → esm2020/elements/bravobit-bb-foundation-elements.mjs} +0 -0
- package/esm2020/elements/lib/avatar/avatar.component.mjs +142 -0
- package/esm2020/elements/lib/button/button.component.mjs +61 -0
- package/esm2020/elements/lib/checkbox/checkbox.component.mjs +73 -0
- package/esm2020/elements/lib/date-picker/date-picker.component.mjs +304 -0
- package/{esm2015/elements/lib/directives/addon.directive.js → esm2020/elements/lib/directives/addon.directive.mjs} +7 -7
- package/esm2020/elements/lib/directives/autosize.directive.mjs +72 -0
- package/{esm2015/elements/lib/directives/focus-trap.directive.js → esm2020/elements/lib/directives/focus-trap.directive.mjs} +4 -4
- package/{esm2015/elements/lib/directives/focus.directive.js → esm2020/elements/lib/directives/focus.directive.mjs} +4 -4
- package/esm2020/elements/lib/directives/form-submit.directive.mjs +50 -0
- package/esm2020/elements/lib/directives/input.directive.mjs +136 -0
- package/{esm2015/elements/lib/directives/template.directive.js → esm2020/elements/lib/directives/template.directive.mjs} +4 -4
- package/esm2020/elements/lib/dropdown/dropdown.component.mjs +100 -0
- package/{esm2015/elements/lib/elements.interfaces.js → esm2020/elements/lib/elements.interfaces.mjs} +0 -0
- package/{esm2015/elements/lib/elements.module.js → esm2020/elements/lib/elements.module.mjs} +5 -5
- package/esm2020/elements/lib/file-picker/file-picker.component.mjs +236 -0
- package/esm2020/elements/lib/form-control/form-control.component.mjs +49 -0
- package/esm2020/elements/lib/form-error/form-error.component.mjs +108 -0
- package/esm2020/elements/lib/form-group/form-group.component.mjs +18 -0
- package/esm2020/elements/lib/icon/icon.component.mjs +102 -0
- package/esm2020/elements/lib/image-picker/image-picker.component.mjs +106 -0
- package/esm2020/elements/lib/pipes/file-image.pipe.mjs +42 -0
- package/{esm2015/elements/lib/pipes/file-size.pipe.js → esm2020/elements/lib/pipes/file-size.pipe.mjs} +4 -4
- package/esm2020/elements/lib/pipes/relative-time.pipe.mjs +94 -0
- package/esm2020/elements/lib/spinner/spinner.component.mjs +25 -0
- package/esm2020/elements/lib/tag/tag.component.mjs +18 -0
- package/{esm2015/elements/public_api.js → esm2020/elements/public_api.mjs} +0 -0
- package/{esm2015/http/bravobit-bb-foundation-http.js → esm2020/http/bravobit-bb-foundation-http.mjs} +0 -0
- package/esm2020/http/lib/classes/http.config.mjs +29 -0
- package/esm2020/http/lib/classes/http.error.mjs +20 -0
- package/{esm2015/http/lib/http.interfaces.js → esm2020/http/lib/http.interfaces.mjs} +0 -0
- package/{esm2015/http/lib/http.module.js → esm2020/http/lib/http.module.mjs} +5 -5
- package/esm2020/http/lib/interceptors/base-url.interceptor.mjs +50 -0
- package/esm2020/http/lib/interceptors/error.interceptor.mjs +32 -0
- package/{esm2015/http/public_api.js → esm2020/http/public_api.mjs} +0 -0
- package/{esm2015/lib/core/coercions/boolean-coercion.js → esm2020/lib/core/coercions/boolean-coercion.mjs} +0 -0
- package/{esm2015/lib/core/miscellaneous/regex.js → esm2020/lib/core/miscellaneous/regex.mjs} +0 -0
- package/esm2020/lib/core/miscellaneous/validator.mjs +85 -0
- package/{esm2015/lib/core/mixins/can-disable.js → esm2020/lib/core/mixins/can-disable.mjs} +0 -0
- package/{esm2015/lib/core/mixins/can-hide-errors.js → esm2020/lib/core/mixins/can-hide-errors.mjs} +0 -0
- package/{esm2015/lib/core/mixins/can-load.js → esm2020/lib/core/mixins/can-load.mjs} +0 -0
- package/{esm2015/lib/core/mixins/constructor.js → esm2020/lib/core/mixins/constructor.mjs} +0 -0
- package/{esm2015/lib/core/mixins/has-error.js → esm2020/lib/core/mixins/has-error.mjs} +0 -0
- package/{esm2015/lib/core/mixins/is-focused.js → esm2020/lib/core/mixins/is-focused.mjs} +0 -0
- package/{esm2015/lib/core/mixins/is-grouped.js → esm2020/lib/core/mixins/is-grouped.mjs} +0 -0
- package/{esm2015/lib/core/mixins/is-readonly.js → esm2020/lib/core/mixins/is-readonly.mjs} +0 -0
- package/{esm2015/lib/core/mixins/is-required.js → esm2020/lib/core/mixins/is-required.mjs} +0 -0
- package/esm2020/lib/core/services/clipboard.service.mjs +70 -0
- package/esm2020/lib/core/services/exif.service.mjs +163 -0
- package/esm2020/lib/core/services/file-loader.service.mjs +87 -0
- package/esm2020/lib/core/services/image-converter.service.mjs +123 -0
- package/{esm2015/lib/core/services/languages.service.js → esm2020/lib/core/services/languages.service.mjs} +4 -4
- package/{esm2015/lib/core/services/network.service.js → esm2020/lib/core/services/network.service.mjs} +5 -6
- package/esm2020/lib/core/services/patch.service.mjs +63 -0
- package/{esm2015/lib/core/services/platform.service.js → esm2020/lib/core/services/platform.service.mjs} +5 -5
- package/{esm2015/lib/core/tokens/accept-language.token.js → esm2020/lib/core/tokens/accept-language.token.mjs} +0 -0
- package/{esm2015/lib/core/tokens/base-url.token.js → esm2020/lib/core/tokens/base-url.token.mjs} +0 -0
- package/{esm2015/lib/core/tokens/cookie.token.js → esm2020/lib/core/tokens/cookie.token.mjs} +0 -0
- package/{esm2015/lib/core/tokens/location.token.js → esm2020/lib/core/tokens/location.token.mjs} +0 -0
- package/{esm2015/lib/core/tokens/navigator.token.js → esm2020/lib/core/tokens/navigator.token.mjs} +0 -0
- package/{esm2015/lib/core/tokens/window.token.js → esm2020/lib/core/tokens/window.token.mjs} +0 -0
- package/{esm2015/localize/bravobit-bb-foundation-localize.js → esm2020/localize/bravobit-bb-foundation-localize.mjs} +0 -0
- package/{esm2015/localize/lib/functions/date.function.js → esm2020/localize/lib/functions/date.function.mjs} +0 -0
- package/{esm2015/localize/lib/functions/lowercase.function.js → esm2020/localize/lib/functions/lowercase.function.mjs} +0 -0
- package/{esm2015/localize/lib/functions/uppercase.function.js → esm2020/localize/lib/functions/uppercase.function.mjs} +0 -0
- package/{esm2015/localize/lib/handlers/missing.handler.js → esm2020/localize/lib/handlers/missing.handler.mjs} +0 -0
- package/{esm2015/localize/lib/interfaces/config.interfaces.js → esm2020/localize/lib/interfaces/config.interfaces.mjs} +0 -0
- package/{esm2015/localize/lib/interfaces/dictionary.interfaces.js → esm2020/localize/lib/interfaces/dictionary.interfaces.mjs} +0 -0
- package/{esm2015/localize/lib/interfaces/functions.interfaces.js → esm2020/localize/lib/interfaces/functions.interfaces.mjs} +0 -0
- package/{esm2015/localize/lib/interfaces/handlers.interfaces.js → esm2020/localize/lib/interfaces/handlers.interfaces.mjs} +0 -0
- package/{esm2015/localize/lib/interfaces/options.interfaces.js → esm2020/localize/lib/interfaces/options.interfaces.mjs} +0 -0
- package/{esm2015/localize/lib/localizations/dutch.localization.js → esm2020/localize/lib/localizations/dutch.localization.mjs} +0 -0
- package/{esm2015/localize/lib/localizations/english.localization.js → esm2020/localize/lib/localizations/english.localization.mjs} +0 -0
- package/esm2020/localize/lib/localize.dictionary.mjs +135 -0
- package/{esm2015/localize/lib/localize.module.js → esm2020/localize/lib/localize.module.mjs} +5 -5
- package/{esm2015/localize/lib/localize.pipe.js → esm2020/localize/lib/localize.pipe.mjs} +5 -5
- package/esm2020/localize/lib/localize.service.mjs +277 -0
- package/esm2020/localize/lib/views/localize-string/localize-string.component.mjs +88 -0
- package/{esm2015/localize/lib/views/localize-template-or-string.directive.js → esm2020/localize/lib/views/localize-template-or-string.directive.mjs} +4 -4
- package/{esm2015/localize/lib/views/localize-template.directive.js → esm2020/localize/lib/views/localize-template.directive.mjs} +4 -4
- package/{esm2015/localize/public_api.js → esm2020/localize/public_api.mjs} +0 -0
- package/{esm2015/notifications/bravobit-bb-foundation-notifications.js → esm2020/notifications/bravobit-bb-foundation-notifications.mjs} +0 -0
- package/esm2020/notifications/lib/notifications-item/notifications-item.component.mjs +100 -0
- package/esm2020/notifications/lib/notifications-list/notifications-list.component.mjs +47 -0
- package/{esm2015/notifications/lib/notifications.animations.js → esm2020/notifications/lib/notifications.animations.mjs} +0 -0
- package/{esm2015/notifications/lib/notifications.injector.js → esm2020/notifications/lib/notifications.injector.mjs} +0 -0
- package/{esm2015/notifications/lib/notifications.interfaces.js → esm2020/notifications/lib/notifications.interfaces.mjs} +0 -0
- package/{esm2015/notifications/lib/notifications.module.js → esm2020/notifications/lib/notifications.module.mjs} +6 -7
- package/{esm2015/notifications/lib/notifications.service.js → esm2020/notifications/lib/notifications.service.mjs} +5 -5
- package/{esm2015/notifications/public_api.js → esm2020/notifications/public_api.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/{esm2015/recaptcha/bravobit-bb-foundation-recaptcha.js → esm2020/recaptcha/bravobit-bb-foundation-recaptcha.mjs} +0 -0
- package/esm2020/recaptcha/lib/recaptcha/recaptcha.component.mjs +185 -0
- package/esm2020/recaptcha/lib/recaptcha-loader.service.mjs +90 -0
- package/{esm2015/recaptcha/lib/recaptcha.interface.js → esm2020/recaptcha/lib/recaptcha.interface.mjs} +0 -0
- package/{esm2015/recaptcha/lib/recaptcha.module.js → esm2020/recaptcha/lib/recaptcha.module.mjs} +5 -5
- package/{esm2015/recaptcha/public_api.js → esm2020/recaptcha/public_api.mjs} +0 -0
- package/{esm2015/rxjs/bravobit-bb-foundation-rxjs.js → esm2020/rxjs/bravobit-bb-foundation-rxjs.mjs} +0 -0
- package/esm2020/rxjs/lib/operators/combine-latest-map.operator.mjs +10 -0
- package/{esm2015/rxjs/lib/operators/filter-nil.operator.js → esm2020/rxjs/lib/operators/filter-nil.operator.mjs} +0 -0
- package/{esm2015/rxjs/public_api.js → esm2020/rxjs/public_api.mjs} +0 -0
- package/{esm2015/storage/bravobit-bb-foundation-storage.js → esm2020/storage/bravobit-bb-foundation-storage.mjs} +0 -0
- package/{esm2015/storage/lib/interfaces/attributes.interface.js → esm2020/storage/lib/interfaces/attributes.interface.mjs} +0 -0
- package/{esm2015/storage/lib/interfaces/memory.interface.js → esm2020/storage/lib/interfaces/memory.interface.mjs} +0 -0
- package/{esm2015/storage/lib/interfaces/strategy.interface.js → esm2020/storage/lib/interfaces/strategy.interface.mjs} +0 -0
- package/esm2020/storage/lib/storage.service.mjs +109 -0
- package/esm2020/storage/lib/strategies/cookie-storage.strategy.mjs +142 -0
- package/{esm2015/storage/lib/strategies/memory-storage.strategy.js → esm2020/storage/lib/strategies/memory-storage.strategy.mjs} +2 -2
- package/esm2020/storage/lib/strategies/polyfill-storage.strategy.mjs +102 -0
- package/{esm2015/storage/public_api.js → esm2020/storage/public_api.mjs} +0 -0
- package/{esm2015/table/bravobit-bb-foundation-table.js → esm2020/table/bravobit-bb-foundation-table.mjs} +0 -0
- package/esm2020/table/lib/components/table/table.component.mjs +191 -0
- package/esm2020/table/lib/components/table-cell/table-cell.component.mjs +11 -0
- package/esm2020/table/lib/components/table-header-cell/table-header-cell.component.mjs +131 -0
- package/esm2020/table/lib/components/table-pager/table-pager.component.mjs +136 -0
- package/esm2020/table/lib/data/datasource.data.mjs +32 -0
- package/esm2020/table/lib/data/generic.data.mjs +72 -0
- package/{esm2015/table/lib/interfaces/datasource.interface.js → esm2020/table/lib/interfaces/datasource.interface.mjs} +0 -0
- package/{esm2015/table/lib/interfaces/table.interfaces.js → esm2020/table/lib/interfaces/table.interfaces.mjs} +0 -0
- package/{esm2015/table/lib/table.module.js → esm2020/table/lib/table.module.mjs} +5 -5
- package/{esm2015/table/public_api.js → esm2020/table/public_api.mjs} +0 -0
- package/fesm2015/{bravobit-bb-foundation-auth.js → bravobit-bb-foundation-auth.mjs} +79 -68
- package/fesm2015/bravobit-bb-foundation-auth.mjs.map +1 -0
- package/fesm2015/{bravobit-bb-foundation-collections.js → bravobit-bb-foundation-collections.mjs} +33 -47
- package/fesm2015/bravobit-bb-foundation-collections.mjs.map +1 -0
- package/fesm2015/bravobit-bb-foundation-controls.mjs +123 -0
- package/fesm2015/bravobit-bb-foundation-controls.mjs.map +1 -0
- package/fesm2015/bravobit-bb-foundation-dashboard.mjs +416 -0
- package/fesm2015/bravobit-bb-foundation-dashboard.mjs.map +1 -0
- package/fesm2015/{bravobit-bb-foundation-dialog.js → bravobit-bb-foundation-dialog.mjs} +45 -106
- package/fesm2015/bravobit-bb-foundation-dialog.mjs.map +1 -0
- package/fesm2015/{bravobit-bb-foundation-elements.js → bravobit-bb-foundation-elements.mjs} +193 -302
- package/fesm2015/bravobit-bb-foundation-elements.mjs.map +1 -0
- package/fesm2015/{bravobit-bb-foundation-http.js → bravobit-bb-foundation-http.mjs} +18 -16
- package/fesm2015/bravobit-bb-foundation-http.mjs.map +1 -0
- package/fesm2015/{bravobit-bb-foundation-localize.js → bravobit-bb-foundation-localize.mjs} +63 -69
- package/fesm2015/bravobit-bb-foundation-localize.mjs.map +1 -0
- package/fesm2015/bravobit-bb-foundation-notifications.mjs +377 -0
- package/fesm2015/bravobit-bb-foundation-notifications.mjs.map +1 -0
- package/fesm2015/{bravobit-bb-foundation-recaptcha.js → bravobit-bb-foundation-recaptcha.mjs} +40 -47
- package/fesm2015/bravobit-bb-foundation-recaptcha.mjs.map +1 -0
- package/fesm2015/{bravobit-bb-foundation-rxjs.js → bravobit-bb-foundation-rxjs.mjs} +1 -1
- package/fesm2015/bravobit-bb-foundation-rxjs.mjs.map +1 -0
- package/fesm2015/{bravobit-bb-foundation-storage.js → bravobit-bb-foundation-storage.mjs} +12 -10
- package/fesm2015/bravobit-bb-foundation-storage.mjs.map +1 -0
- package/fesm2015/bravobit-bb-foundation-table.mjs +603 -0
- package/fesm2015/bravobit-bb-foundation-table.mjs.map +1 -0
- package/fesm2015/{bravobit-bb-foundation.js → bravobit-bb-foundation.mjs} +74 -64
- package/fesm2015/bravobit-bb-foundation.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-auth.mjs +928 -0
- package/fesm2020/bravobit-bb-foundation-auth.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-collections.mjs +434 -0
- package/fesm2020/bravobit-bb-foundation-collections.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-controls.mjs +121 -0
- package/fesm2020/bravobit-bb-foundation-controls.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-dashboard.mjs +404 -0
- package/fesm2020/bravobit-bb-foundation-dashboard.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-dialog.mjs +584 -0
- package/fesm2020/bravobit-bb-foundation-dialog.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-elements.mjs +1993 -0
- package/fesm2020/bravobit-bb-foundation-elements.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-http.mjs +168 -0
- package/fesm2020/bravobit-bb-foundation-http.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-localize.mjs +832 -0
- package/fesm2020/bravobit-bb-foundation-localize.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-notifications.mjs +375 -0
- package/fesm2020/bravobit-bb-foundation-notifications.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-recaptcha.mjs +300 -0
- package/fesm2020/bravobit-bb-foundation-recaptcha.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-rxjs.mjs +21 -0
- package/fesm2020/bravobit-bb-foundation-rxjs.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-storage.mjs +413 -0
- package/fesm2020/bravobit-bb-foundation-storage.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation-table.mjs +592 -0
- package/fesm2020/bravobit-bb-foundation-table.mjs.map +1 -0
- package/fesm2020/bravobit-bb-foundation.mjs +895 -0
- package/fesm2020/bravobit-bb-foundation.mjs.map +1 -0
- package/http/package.json +5 -5
- package/localize/package.json +5 -5
- package/notifications/package.json +5 -5
- package/package.json +125 -8
- package/recaptcha/package.json +5 -5
- package/rxjs/package.json +5 -5
- package/storage/package.json +5 -5
- package/table/lib/components/table/table.component.d.ts +3 -0
- package/table/package.json +5 -5
- package/bundles/bravobit-bb-foundation-auth.umd.js +0 -1483
- package/bundles/bravobit-bb-foundation-auth.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation-collections.umd.js +0 -868
- package/bundles/bravobit-bb-foundation-collections.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation-dashboard.umd.js +0 -876
- package/bundles/bravobit-bb-foundation-dashboard.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation-dialog.umd.js +0 -716
- package/bundles/bravobit-bb-foundation-dialog.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation-elements.umd.js +0 -2768
- package/bundles/bravobit-bb-foundation-elements.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation-http.umd.js +0 -535
- package/bundles/bravobit-bb-foundation-http.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation-localize.umd.js +0 -1292
- package/bundles/bravobit-bb-foundation-localize.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation-notifications.umd.js +0 -794
- package/bundles/bravobit-bb-foundation-notifications.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation-recaptcha.umd.js +0 -683
- package/bundles/bravobit-bb-foundation-recaptcha.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation-rxjs.umd.js +0 -29
- package/bundles/bravobit-bb-foundation-rxjs.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation-storage.umd.js +0 -799
- package/bundles/bravobit-bb-foundation-storage.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation-table.umd.js +0 -1070
- package/bundles/bravobit-bb-foundation-table.umd.js.map +0 -1
- package/bundles/bravobit-bb-foundation.umd.js +0 -1440
- package/bundles/bravobit-bb-foundation.umd.js.map +0 -1
- package/esm2015/auth/lib/auth.interceptor.js +0 -95
- package/esm2015/auth/lib/auth.service.js +0 -299
- package/esm2015/auth/lib/auth.session.js +0 -136
- package/esm2015/auth/lib/directives/permission.directive.js +0 -81
- package/esm2015/auth/lib/directives/role.directive.js +0 -38
- package/esm2015/auth/lib/guards/anonymous.guard.js +0 -35
- package/esm2015/auth/lib/guards/authenticated.guard.js +0 -36
- package/esm2015/auth/lib/permissions.service.js +0 -58
- package/esm2015/auth/lib/providers/email.provider.js +0 -26
- package/esm2015/auth/lib/providers/verify.provider.js +0 -20
- package/esm2015/collections/lib/collection.js +0 -104
- package/esm2015/collections/lib/components/collections-pager/collections-pager.component.js +0 -136
- package/esm2015/collections/lib/components/collections-viewer/collections-viewer.component.js +0 -39
- package/esm2015/collections/lib/providers/api-collection.provider.js +0 -69
- package/esm2015/collections/lib/providers/collection.provider.js +0 -14
- package/esm2015/dashboard/lib/dashboard/dashboard.component.js +0 -64
- package/esm2015/dashboard/lib/dashboard-header/dashboard-header.component.js +0 -41
- package/esm2015/dashboard/lib/dashboard-menu/dashboard-menu.component.js +0 -39
- package/esm2015/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.js +0 -38
- package/esm2015/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.js +0 -83
- package/esm2015/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.js +0 -110
- package/esm2015/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.js +0 -71
- package/esm2015/dialog/lib/dialog-actions/dialog-actions.component.js +0 -20
- package/esm2015/dialog/lib/dialog-confirm/dialog-confirm.component.js +0 -45
- package/esm2015/dialog/lib/dialog-header/dialog-header.component.js +0 -33
- package/esm2015/dialog/lib/dialog-link/dialog-link.component.js +0 -19
- package/esm2015/dialog/lib/dialog-modal/dialog-modal.component.js +0 -54
- package/esm2015/dialog/lib/dialog-overlay/dialog-overlay.component.js +0 -143
- package/esm2015/elements/lib/avatar/avatar.component.js +0 -151
- package/esm2015/elements/lib/button/button.component.js +0 -79
- package/esm2015/elements/lib/checkbox/checkbox.component.js +0 -83
- package/esm2015/elements/lib/date-picker/date-picker.component.js +0 -322
- package/esm2015/elements/lib/directives/autosize.directive.js +0 -74
- package/esm2015/elements/lib/directives/form-submit.directive.js +0 -53
- package/esm2015/elements/lib/directives/input.directive.js +0 -139
- package/esm2015/elements/lib/dropdown/dropdown.component.js +0 -111
- package/esm2015/elements/lib/file-picker/file-picker.component.js +0 -247
- package/esm2015/elements/lib/form-control/form-control.component.js +0 -58
- package/esm2015/elements/lib/form-error/form-error.component.js +0 -116
- package/esm2015/elements/lib/form-group/form-group.component.js +0 -27
- package/esm2015/elements/lib/icon/icon.component.js +0 -110
- package/esm2015/elements/lib/image-picker/image-picker.component.js +0 -119
- package/esm2015/elements/lib/pipes/file-image.pipe.js +0 -45
- package/esm2015/elements/lib/pipes/relative-time.pipe.js +0 -96
- package/esm2015/elements/lib/spinner/spinner.component.js +0 -34
- package/esm2015/elements/lib/tag/tag.component.js +0 -26
- package/esm2015/http/lib/classes/http.config.js +0 -31
- package/esm2015/http/lib/classes/http.error.js +0 -21
- package/esm2015/http/lib/interceptors/base-url.interceptor.js +0 -52
- package/esm2015/http/lib/interceptors/error.interceptor.js +0 -33
- package/esm2015/lib/core/miscellaneous/validator.js +0 -86
- package/esm2015/lib/core/services/clipboard.service.js +0 -72
- package/esm2015/lib/core/services/exif.service.js +0 -168
- package/esm2015/lib/core/services/file-loader.service.js +0 -90
- package/esm2015/lib/core/services/image-converter.service.js +0 -130
- package/esm2015/lib/core/services/patch.service.js +0 -65
- package/esm2015/localize/lib/localize.dictionary.js +0 -137
- package/esm2015/localize/lib/localize.service.js +0 -282
- package/esm2015/localize/lib/views/localize-string/localize-string.component.js +0 -99
- package/esm2015/notifications/lib/notifications-item/notifications-item.component.js +0 -108
- package/esm2015/notifications/lib/notifications-list/notifications-list.component.js +0 -56
- package/esm2015/recaptcha/lib/recaptcha/recaptcha.component.js +0 -199
- package/esm2015/recaptcha/lib/recaptcha-loader.service.js +0 -93
- package/esm2015/rxjs/lib/operators/combine-latest-map.operator.js +0 -7
- package/esm2015/storage/lib/storage.service.js +0 -111
- package/esm2015/storage/lib/strategies/cookie-storage.strategy.js +0 -143
- package/esm2015/storage/lib/strategies/polyfill-storage.strategy.js +0 -102
- package/esm2015/table/lib/components/table/table.component.js +0 -196
- package/esm2015/table/lib/components/table-cell/table-cell.component.js +0 -19
- package/esm2015/table/lib/components/table-header-cell/table-header-cell.component.js +0 -141
- package/esm2015/table/lib/components/table-pager/table-pager.component.js +0 -146
- package/esm2015/table/lib/data/datasource.data.js +0 -32
- package/esm2015/table/lib/data/generic.data.js +0 -73
- package/fesm2015/bravobit-bb-foundation-auth.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation-collections.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation-dashboard.js +0 -468
- package/fesm2015/bravobit-bb-foundation-dashboard.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation-dialog.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation-elements.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation-http.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation-localize.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation-notifications.js +0 -393
- package/fesm2015/bravobit-bb-foundation-notifications.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation-recaptcha.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation-rxjs.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation-storage.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation-table.js +0 -626
- package/fesm2015/bravobit-bb-foundation-table.js.map +0 -1
- package/fesm2015/bravobit-bb-foundation.js.map +0 -1
|
@@ -1,1440 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs/operators'), require('rxjs')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@bravobit/bb-foundation', ['exports', '@angular/core', '@angular/common', 'rxjs/operators', 'rxjs'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.bravobit = global.bravobit || {}, global.bravobit["bb-foundation"] = {}), global.ng.core, global.ng.common, global.rxjs.operators, global.rxjs));
|
|
5
|
-
})(this, (function (exports, i0, common, operators, rxjs) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function _interopNamespace(e) {
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
9
|
-
var n = Object.create(null);
|
|
10
|
-
if (e) {
|
|
11
|
-
Object.keys(e).forEach(function (k) {
|
|
12
|
-
if (k !== 'default') {
|
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return e[k]; }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
n["default"] = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
|
-
|
|
27
|
-
var hasV8BreakIterator;
|
|
28
|
-
try {
|
|
29
|
-
hasV8BreakIterator = (typeof Intl !== 'undefined' && Intl.v8BreakIterator);
|
|
30
|
-
}
|
|
31
|
-
catch (_a) {
|
|
32
|
-
hasV8BreakIterator = false;
|
|
33
|
-
}
|
|
34
|
-
var Platform = /** @class */ (function () {
|
|
35
|
-
function Platform(_platformId) {
|
|
36
|
-
this._platformId = _platformId;
|
|
37
|
-
// Browser check.
|
|
38
|
-
this.isBrowser = this._platformId
|
|
39
|
-
? common.isPlatformBrowser(this._platformId)
|
|
40
|
-
: typeof document === 'object' && !!document;
|
|
41
|
-
// Is checks.
|
|
42
|
-
this.isEdge = this.isBrowser && /(edge)/i.test(navigator.userAgent);
|
|
43
|
-
this.isTrident = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
|
|
44
|
-
this.isBlink = this.isBrowser && (!!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.isEdge && !this.isTrident);
|
|
45
|
-
this.isWebkit = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.isBlink && !this.isEdge && !this.isTrident;
|
|
46
|
-
this.isChrome = this.isBrowser && /Google Inc./.test(navigator.vendor);
|
|
47
|
-
this.isFirefox = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
|
|
48
|
-
this.isSafari = this.isBrowser && /safari/i.test(navigator.userAgent) && this.isWebkit;
|
|
49
|
-
this.isAndroid = this.isBrowser && /android/i.test(navigator.userAgent) && !this.isTrident;
|
|
50
|
-
this.isIos = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
|
|
51
|
-
this.isDesktop = this.isBrowser && !(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/.test(navigator.userAgent));
|
|
52
|
-
}
|
|
53
|
-
return Platform;
|
|
54
|
-
}());
|
|
55
|
-
Platform.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Platform, deps: [{ token: i0.PLATFORM_ID }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
56
|
-
Platform.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Platform, providedIn: 'root' });
|
|
57
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Platform, decorators: [{
|
|
58
|
-
type: i0.Injectable,
|
|
59
|
-
args: [{
|
|
60
|
-
providedIn: 'root'
|
|
61
|
-
}]
|
|
62
|
-
}], ctorParameters: function () {
|
|
63
|
-
return [{ type: Object, decorators: [{
|
|
64
|
-
type: i0.Inject,
|
|
65
|
-
args: [i0.PLATFORM_ID]
|
|
66
|
-
}] }];
|
|
67
|
-
} });
|
|
68
|
-
|
|
69
|
-
/*! *****************************************************************************
|
|
70
|
-
Copyright (c) Microsoft Corporation.
|
|
71
|
-
|
|
72
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
73
|
-
purpose with or without fee is hereby granted.
|
|
74
|
-
|
|
75
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
76
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
77
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
78
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
79
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
80
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
81
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
82
|
-
***************************************************************************** */
|
|
83
|
-
/* global Reflect, Promise */
|
|
84
|
-
var extendStatics = function (d, b) {
|
|
85
|
-
extendStatics = Object.setPrototypeOf ||
|
|
86
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
87
|
-
function (d, b) { for (var p in b)
|
|
88
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
89
|
-
d[p] = b[p]; };
|
|
90
|
-
return extendStatics(d, b);
|
|
91
|
-
};
|
|
92
|
-
function __extends(d, b) {
|
|
93
|
-
if (typeof b !== "function" && b !== null)
|
|
94
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
95
|
-
extendStatics(d, b);
|
|
96
|
-
function __() { this.constructor = d; }
|
|
97
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
98
|
-
}
|
|
99
|
-
var __assign = function () {
|
|
100
|
-
__assign = Object.assign || function __assign(t) {
|
|
101
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
102
|
-
s = arguments[i];
|
|
103
|
-
for (var p in s)
|
|
104
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
105
|
-
t[p] = s[p];
|
|
106
|
-
}
|
|
107
|
-
return t;
|
|
108
|
-
};
|
|
109
|
-
return __assign.apply(this, arguments);
|
|
110
|
-
};
|
|
111
|
-
function __rest(s, e) {
|
|
112
|
-
var t = {};
|
|
113
|
-
for (var p in s)
|
|
114
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
115
|
-
t[p] = s[p];
|
|
116
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
117
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
118
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
119
|
-
t[p[i]] = s[p[i]];
|
|
120
|
-
}
|
|
121
|
-
return t;
|
|
122
|
-
}
|
|
123
|
-
function __decorate(decorators, target, key, desc) {
|
|
124
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
125
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
126
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
127
|
-
else
|
|
128
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
129
|
-
if (d = decorators[i])
|
|
130
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
131
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
132
|
-
}
|
|
133
|
-
function __param(paramIndex, decorator) {
|
|
134
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
135
|
-
}
|
|
136
|
-
function __metadata(metadataKey, metadataValue) {
|
|
137
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
138
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
139
|
-
}
|
|
140
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
141
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
142
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
143
|
-
function fulfilled(value) { try {
|
|
144
|
-
step(generator.next(value));
|
|
145
|
-
}
|
|
146
|
-
catch (e) {
|
|
147
|
-
reject(e);
|
|
148
|
-
} }
|
|
149
|
-
function rejected(value) { try {
|
|
150
|
-
step(generator["throw"](value));
|
|
151
|
-
}
|
|
152
|
-
catch (e) {
|
|
153
|
-
reject(e);
|
|
154
|
-
} }
|
|
155
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
156
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
function __generator(thisArg, body) {
|
|
160
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
161
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
162
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
163
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
164
|
-
function step(op) {
|
|
165
|
-
if (f)
|
|
166
|
-
throw new TypeError("Generator is already executing.");
|
|
167
|
-
while (_)
|
|
168
|
-
try {
|
|
169
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
170
|
-
return t;
|
|
171
|
-
if (y = 0, t)
|
|
172
|
-
op = [op[0] & 2, t.value];
|
|
173
|
-
switch (op[0]) {
|
|
174
|
-
case 0:
|
|
175
|
-
case 1:
|
|
176
|
-
t = op;
|
|
177
|
-
break;
|
|
178
|
-
case 4:
|
|
179
|
-
_.label++;
|
|
180
|
-
return { value: op[1], done: false };
|
|
181
|
-
case 5:
|
|
182
|
-
_.label++;
|
|
183
|
-
y = op[1];
|
|
184
|
-
op = [0];
|
|
185
|
-
continue;
|
|
186
|
-
case 7:
|
|
187
|
-
op = _.ops.pop();
|
|
188
|
-
_.trys.pop();
|
|
189
|
-
continue;
|
|
190
|
-
default:
|
|
191
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
192
|
-
_ = 0;
|
|
193
|
-
continue;
|
|
194
|
-
}
|
|
195
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
196
|
-
_.label = op[1];
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
200
|
-
_.label = t[1];
|
|
201
|
-
t = op;
|
|
202
|
-
break;
|
|
203
|
-
}
|
|
204
|
-
if (t && _.label < t[2]) {
|
|
205
|
-
_.label = t[2];
|
|
206
|
-
_.ops.push(op);
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
if (t[2])
|
|
210
|
-
_.ops.pop();
|
|
211
|
-
_.trys.pop();
|
|
212
|
-
continue;
|
|
213
|
-
}
|
|
214
|
-
op = body.call(thisArg, _);
|
|
215
|
-
}
|
|
216
|
-
catch (e) {
|
|
217
|
-
op = [6, e];
|
|
218
|
-
y = 0;
|
|
219
|
-
}
|
|
220
|
-
finally {
|
|
221
|
-
f = t = 0;
|
|
222
|
-
}
|
|
223
|
-
if (op[0] & 5)
|
|
224
|
-
throw op[1];
|
|
225
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
229
|
-
if (k2 === undefined)
|
|
230
|
-
k2 = k;
|
|
231
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
232
|
-
}) : (function (o, m, k, k2) {
|
|
233
|
-
if (k2 === undefined)
|
|
234
|
-
k2 = k;
|
|
235
|
-
o[k2] = m[k];
|
|
236
|
-
});
|
|
237
|
-
function __exportStar(m, o) {
|
|
238
|
-
for (var p in m)
|
|
239
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
240
|
-
__createBinding(o, m, p);
|
|
241
|
-
}
|
|
242
|
-
function __values(o) {
|
|
243
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
244
|
-
if (m)
|
|
245
|
-
return m.call(o);
|
|
246
|
-
if (o && typeof o.length === "number")
|
|
247
|
-
return {
|
|
248
|
-
next: function () {
|
|
249
|
-
if (o && i >= o.length)
|
|
250
|
-
o = void 0;
|
|
251
|
-
return { value: o && o[i++], done: !o };
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
255
|
-
}
|
|
256
|
-
function __read(o, n) {
|
|
257
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
258
|
-
if (!m)
|
|
259
|
-
return o;
|
|
260
|
-
var i = m.call(o), r, ar = [], e;
|
|
261
|
-
try {
|
|
262
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
263
|
-
ar.push(r.value);
|
|
264
|
-
}
|
|
265
|
-
catch (error) {
|
|
266
|
-
e = { error: error };
|
|
267
|
-
}
|
|
268
|
-
finally {
|
|
269
|
-
try {
|
|
270
|
-
if (r && !r.done && (m = i["return"]))
|
|
271
|
-
m.call(i);
|
|
272
|
-
}
|
|
273
|
-
finally {
|
|
274
|
-
if (e)
|
|
275
|
-
throw e.error;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
return ar;
|
|
279
|
-
}
|
|
280
|
-
/** @deprecated */
|
|
281
|
-
function __spread() {
|
|
282
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
283
|
-
ar = ar.concat(__read(arguments[i]));
|
|
284
|
-
return ar;
|
|
285
|
-
}
|
|
286
|
-
/** @deprecated */
|
|
287
|
-
function __spreadArrays() {
|
|
288
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
289
|
-
s += arguments[i].length;
|
|
290
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
291
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
292
|
-
r[k] = a[j];
|
|
293
|
-
return r;
|
|
294
|
-
}
|
|
295
|
-
function __spreadArray(to, from, pack) {
|
|
296
|
-
if (pack || arguments.length === 2)
|
|
297
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
298
|
-
if (ar || !(i in from)) {
|
|
299
|
-
if (!ar)
|
|
300
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
301
|
-
ar[i] = from[i];
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
305
|
-
}
|
|
306
|
-
function __await(v) {
|
|
307
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
308
|
-
}
|
|
309
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
310
|
-
if (!Symbol.asyncIterator)
|
|
311
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
312
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
313
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
314
|
-
function verb(n) { if (g[n])
|
|
315
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
316
|
-
function resume(n, v) { try {
|
|
317
|
-
step(g[n](v));
|
|
318
|
-
}
|
|
319
|
-
catch (e) {
|
|
320
|
-
settle(q[0][3], e);
|
|
321
|
-
} }
|
|
322
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
323
|
-
function fulfill(value) { resume("next", value); }
|
|
324
|
-
function reject(value) { resume("throw", value); }
|
|
325
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
326
|
-
resume(q[0][0], q[0][1]); }
|
|
327
|
-
}
|
|
328
|
-
function __asyncDelegator(o) {
|
|
329
|
-
var i, p;
|
|
330
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
331
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
332
|
-
}
|
|
333
|
-
function __asyncValues(o) {
|
|
334
|
-
if (!Symbol.asyncIterator)
|
|
335
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
336
|
-
var m = o[Symbol.asyncIterator], i;
|
|
337
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
338
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
339
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
340
|
-
}
|
|
341
|
-
function __makeTemplateObject(cooked, raw) {
|
|
342
|
-
if (Object.defineProperty) {
|
|
343
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
344
|
-
}
|
|
345
|
-
else {
|
|
346
|
-
cooked.raw = raw;
|
|
347
|
-
}
|
|
348
|
-
return cooked;
|
|
349
|
-
}
|
|
350
|
-
;
|
|
351
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
352
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
353
|
-
}) : function (o, v) {
|
|
354
|
-
o["default"] = v;
|
|
355
|
-
};
|
|
356
|
-
function __importStar(mod) {
|
|
357
|
-
if (mod && mod.__esModule)
|
|
358
|
-
return mod;
|
|
359
|
-
var result = {};
|
|
360
|
-
if (mod != null)
|
|
361
|
-
for (var k in mod)
|
|
362
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
363
|
-
__createBinding(result, mod, k);
|
|
364
|
-
__setModuleDefault(result, mod);
|
|
365
|
-
return result;
|
|
366
|
-
}
|
|
367
|
-
function __importDefault(mod) {
|
|
368
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
369
|
-
}
|
|
370
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
371
|
-
if (kind === "a" && !f)
|
|
372
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
373
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
374
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
375
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
376
|
-
}
|
|
377
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
378
|
-
if (kind === "m")
|
|
379
|
-
throw new TypeError("Private method is not writable");
|
|
380
|
-
if (kind === "a" && !f)
|
|
381
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
382
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
383
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
384
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
var FileLoader = /** @class */ (function () {
|
|
388
|
-
function FileLoader() {
|
|
389
|
-
this.isFile = function (input) {
|
|
390
|
-
return 'File' in window && input instanceof File;
|
|
391
|
-
};
|
|
392
|
-
this.isBlob = function (input) {
|
|
393
|
-
return 'Blob' in window && input instanceof Blob;
|
|
394
|
-
};
|
|
395
|
-
this.blobToFile = function (blob, fileName) {
|
|
396
|
-
var anyBlob = blob;
|
|
397
|
-
anyBlob.lastModifiedDate = new Date();
|
|
398
|
-
anyBlob.name = fileName;
|
|
399
|
-
return anyBlob;
|
|
400
|
-
};
|
|
401
|
-
}
|
|
402
|
-
FileLoader.prototype.fromDataUrl = function (value, name) {
|
|
403
|
-
if (name === void 0) { name = 'file'; }
|
|
404
|
-
if (!value) {
|
|
405
|
-
return null;
|
|
406
|
-
}
|
|
407
|
-
try {
|
|
408
|
-
// Convert base64 to raw binary data held in a string.
|
|
409
|
-
var byteString = window.atob(value.split(',')[1]);
|
|
410
|
-
// Separate out the mime component.
|
|
411
|
-
var mimeString = value
|
|
412
|
-
.split(',')[0]
|
|
413
|
-
.split(':')[1]
|
|
414
|
-
.split(';')[0];
|
|
415
|
-
// Write the bytes of the string to an ArrayBuffer.
|
|
416
|
-
var arrayBuffer = new ArrayBuffer(byteString.length);
|
|
417
|
-
var uint8Array = new Uint8Array(arrayBuffer);
|
|
418
|
-
for (var index = 0; index < byteString.length; index++) {
|
|
419
|
-
uint8Array[index] = byteString.charCodeAt(index);
|
|
420
|
-
}
|
|
421
|
-
var dataView = new DataView(arrayBuffer);
|
|
422
|
-
var blob = new Blob([dataView.buffer], { type: mimeString });
|
|
423
|
-
return this.createFile(blob, name);
|
|
424
|
-
}
|
|
425
|
-
catch (_a) {
|
|
426
|
-
return null;
|
|
427
|
-
}
|
|
428
|
-
};
|
|
429
|
-
FileLoader.prototype.asDataUrl = function (file) {
|
|
430
|
-
return this.read(file, 'dataurl');
|
|
431
|
-
};
|
|
432
|
-
FileLoader.prototype.asArrayBuffer = function (file) {
|
|
433
|
-
return this.read(file, 'arraybuffer');
|
|
434
|
-
};
|
|
435
|
-
FileLoader.prototype.read = function (file, type) {
|
|
436
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
437
|
-
var _this = this;
|
|
438
|
-
return __generator(this, function (_b) {
|
|
439
|
-
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
440
|
-
var isFileLike = _this.isFile(file) || _this.isBlob(file);
|
|
441
|
-
if (!file || !isFileLike) {
|
|
442
|
-
return reject('Invalid file');
|
|
443
|
-
}
|
|
444
|
-
var reader = new FileReader();
|
|
445
|
-
reader.onerror = function () { return reject('Error file read'); };
|
|
446
|
-
reader.onabort = function () { return reject('Abort file read'); };
|
|
447
|
-
reader.onload = function () {
|
|
448
|
-
var result = reader.result;
|
|
449
|
-
return resolve(result);
|
|
450
|
-
};
|
|
451
|
-
if (type === 'dataurl') {
|
|
452
|
-
reader.readAsDataURL(file);
|
|
453
|
-
}
|
|
454
|
-
else if (type === 'arraybuffer') {
|
|
455
|
-
reader.readAsArrayBuffer(file);
|
|
456
|
-
}
|
|
457
|
-
})];
|
|
458
|
-
});
|
|
459
|
-
});
|
|
460
|
-
};
|
|
461
|
-
FileLoader.prototype.createFile = function (blob, name) {
|
|
462
|
-
if (!navigator.msSaveBlob) {
|
|
463
|
-
return new File([blob], name, { lastModified: Date.now(), type: blob === null || blob === void 0 ? void 0 : blob.type });
|
|
464
|
-
}
|
|
465
|
-
var blobFile = new Blob([blob], { type: blob === null || blob === void 0 ? void 0 : blob.type });
|
|
466
|
-
return this.blobToFile(blobFile, name);
|
|
467
|
-
};
|
|
468
|
-
return FileLoader;
|
|
469
|
-
}());
|
|
470
|
-
FileLoader.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: FileLoader, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
471
|
-
FileLoader.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: FileLoader, providedIn: 'root' });
|
|
472
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: FileLoader, decorators: [{
|
|
473
|
-
type: i0.Injectable,
|
|
474
|
-
args: [{
|
|
475
|
-
providedIn: 'root'
|
|
476
|
-
}]
|
|
477
|
-
}] });
|
|
478
|
-
|
|
479
|
-
var Exif = /** @class */ (function () {
|
|
480
|
-
function Exif(_platform, _fileLoader) {
|
|
481
|
-
this._platform = _platform;
|
|
482
|
-
this._fileLoader = _fileLoader;
|
|
483
|
-
this.transformImage = function (image, type, orientation, quality) {
|
|
484
|
-
if (quality === void 0) { quality = 100; }
|
|
485
|
-
// Create the canvas and context.
|
|
486
|
-
var canvas = document.createElement('canvas');
|
|
487
|
-
var context = canvas.getContext('2d');
|
|
488
|
-
// Validate the context exists.
|
|
489
|
-
if (!context) {
|
|
490
|
-
return null;
|
|
491
|
-
}
|
|
492
|
-
// Set the canvas size based on the image.
|
|
493
|
-
var width = image.width, height = image.height;
|
|
494
|
-
canvas.width = width;
|
|
495
|
-
canvas.height = height;
|
|
496
|
-
// Validate the orientation is correct
|
|
497
|
-
// else flip the canvas sizes.
|
|
498
|
-
if (4 < orientation && orientation < 9) {
|
|
499
|
-
canvas.width = height;
|
|
500
|
-
canvas.height = width;
|
|
501
|
-
}
|
|
502
|
-
// Transform the context based on the orientation.
|
|
503
|
-
switch (orientation) {
|
|
504
|
-
case 2:
|
|
505
|
-
context.transform(-1, 0, 0, 1, width, 0);
|
|
506
|
-
break;
|
|
507
|
-
case 3:
|
|
508
|
-
context.transform(-1, 0, 0, -1, width, height);
|
|
509
|
-
break;
|
|
510
|
-
case 4:
|
|
511
|
-
context.transform(1, 0, 0, -1, 0, height);
|
|
512
|
-
break;
|
|
513
|
-
case 5:
|
|
514
|
-
context.transform(0, 1, 1, 0, 0, 0);
|
|
515
|
-
break;
|
|
516
|
-
case 6:
|
|
517
|
-
context.transform(0, 1, -1, 0, height, 0);
|
|
518
|
-
break;
|
|
519
|
-
case 7:
|
|
520
|
-
context.transform(0, -1, -1, 0, height, width);
|
|
521
|
-
break;
|
|
522
|
-
case 8:
|
|
523
|
-
context.transform(0, -1, 1, 0, 0, width);
|
|
524
|
-
break;
|
|
525
|
-
default:
|
|
526
|
-
break;
|
|
527
|
-
}
|
|
528
|
-
// Draw the image on the context and return the data URL.
|
|
529
|
-
context.drawImage(image, 0, 0, width, height);
|
|
530
|
-
return canvas.toDataURL(type, quality / 100);
|
|
531
|
-
};
|
|
532
|
-
this.getSupportedCanvasType = function (fileType) {
|
|
533
|
-
switch (fileType) {
|
|
534
|
-
case 'image/jpeg':
|
|
535
|
-
case 'image/jpg':
|
|
536
|
-
return 'image/jpeg';
|
|
537
|
-
case 'image/x-windows-bmp':
|
|
538
|
-
case 'image/bmp':
|
|
539
|
-
return 'image/bmp';
|
|
540
|
-
default:
|
|
541
|
-
return 'image/png';
|
|
542
|
-
}
|
|
543
|
-
};
|
|
544
|
-
this.getOrientation = function (buffer) {
|
|
545
|
-
// Create a new data view.
|
|
546
|
-
var view = new DataView(buffer);
|
|
547
|
-
if (view.getUint16(0, false) !== 0xFFD8) {
|
|
548
|
-
return -2;
|
|
549
|
-
}
|
|
550
|
-
var length = view.byteLength;
|
|
551
|
-
var offset = 2;
|
|
552
|
-
while (offset < length) {
|
|
553
|
-
if (view.getUint16(offset + 2, false) <= 8) {
|
|
554
|
-
return -1;
|
|
555
|
-
}
|
|
556
|
-
var marker = view.getUint16(offset, false);
|
|
557
|
-
offset += 2;
|
|
558
|
-
if (marker === 0xFFE1) {
|
|
559
|
-
if (view.getUint32(offset += 2, false) !== 0x45786966) {
|
|
560
|
-
return -1;
|
|
561
|
-
}
|
|
562
|
-
var little = view.getUint16(offset += 6, false) === 0x4949;
|
|
563
|
-
offset += view.getUint32(offset + 4, little);
|
|
564
|
-
var tags = view.getUint16(offset, little);
|
|
565
|
-
offset += 2;
|
|
566
|
-
for (var index = 0; index < tags; index++) {
|
|
567
|
-
if (view.getUint16(offset + index * 12, little) === 0x0112) {
|
|
568
|
-
return view.getUint16(offset + index * 12 + 8, little);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
else if ((marker & 0xFF00) !== 0xFF00) {
|
|
573
|
-
break;
|
|
574
|
-
}
|
|
575
|
-
else {
|
|
576
|
-
offset += view.getUint16(offset, false);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
return -1;
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
Exif.prototype.strip = function (file, quality) {
|
|
583
|
-
if (quality === void 0) { quality = 100; }
|
|
584
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
585
|
-
var arrayBuffer, dataUrl, imageElement, orientation, canvasType, imageUrl, _a_1;
|
|
586
|
-
return __generator(this, function (_b) {
|
|
587
|
-
switch (_b.label) {
|
|
588
|
-
case 0:
|
|
589
|
-
// Validate we are on a browser.
|
|
590
|
-
if (!this._platform.isBrowser) {
|
|
591
|
-
return [2 /*return*/, file];
|
|
592
|
-
}
|
|
593
|
-
// Validate the file exists and is
|
|
594
|
-
// an instance of a File object.
|
|
595
|
-
if (!file || !(file instanceof File)) {
|
|
596
|
-
return [2 /*return*/, file];
|
|
597
|
-
}
|
|
598
|
-
// Only jpeg images need correction.
|
|
599
|
-
if (!['image/jpeg'].includes(file.type)) {
|
|
600
|
-
return [2 /*return*/, file];
|
|
601
|
-
}
|
|
602
|
-
_b.label = 1;
|
|
603
|
-
case 1:
|
|
604
|
-
_b.trys.push([1, 5, , 6]);
|
|
605
|
-
return [4 /*yield*/, this._fileLoader.asArrayBuffer(file)];
|
|
606
|
-
case 2:
|
|
607
|
-
arrayBuffer = _b.sent();
|
|
608
|
-
return [4 /*yield*/, this._fileLoader.asDataUrl(file)];
|
|
609
|
-
case 3:
|
|
610
|
-
dataUrl = _b.sent();
|
|
611
|
-
return [4 /*yield*/, this.createImageElement(dataUrl)];
|
|
612
|
-
case 4:
|
|
613
|
-
imageElement = _b.sent();
|
|
614
|
-
orientation = this.getOrientation(arrayBuffer);
|
|
615
|
-
canvasType = this.getSupportedCanvasType(file.type);
|
|
616
|
-
imageUrl = this.transformImage(imageElement, canvasType, orientation, quality);
|
|
617
|
-
// Validate the image url exists.
|
|
618
|
-
if (!imageUrl) {
|
|
619
|
-
return [2 /*return*/, file];
|
|
620
|
-
}
|
|
621
|
-
// Transform the image url to a file.
|
|
622
|
-
return [2 /*return*/, this._fileLoader.fromDataUrl(imageUrl, file.name)];
|
|
623
|
-
case 5:
|
|
624
|
-
_a_1 = _b.sent();
|
|
625
|
-
// When something goes wrong we
|
|
626
|
-
// just return the default file.
|
|
627
|
-
return [2 /*return*/, file];
|
|
628
|
-
case 6: return [2 /*return*/];
|
|
629
|
-
}
|
|
630
|
-
});
|
|
631
|
-
});
|
|
632
|
-
};
|
|
633
|
-
Exif.prototype.createImageElement = function (dataUrl) {
|
|
634
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
635
|
-
return __generator(this, function (_b) {
|
|
636
|
-
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
637
|
-
var image = new Image();
|
|
638
|
-
image.src = dataUrl;
|
|
639
|
-
image.onerror = function () { return reject('Error image create'); };
|
|
640
|
-
image.onabort = function () { return reject('Abort image create'); };
|
|
641
|
-
image.onload = function () { return resolve(image); };
|
|
642
|
-
})];
|
|
643
|
-
});
|
|
644
|
-
});
|
|
645
|
-
};
|
|
646
|
-
return Exif;
|
|
647
|
-
}());
|
|
648
|
-
Exif.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Exif, deps: [{ token: Platform }, { token: FileLoader }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
649
|
-
Exif.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Exif, providedIn: 'root' });
|
|
650
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Exif, decorators: [{
|
|
651
|
-
type: i0.Injectable,
|
|
652
|
-
args: [{
|
|
653
|
-
providedIn: 'root'
|
|
654
|
-
}]
|
|
655
|
-
}], ctorParameters: function () { return [{ type: Platform }, { type: FileLoader }]; } });
|
|
656
|
-
|
|
657
|
-
var ImageConverter = /** @class */ (function () {
|
|
658
|
-
function ImageConverter(_exif, _platform, _fileLoader) {
|
|
659
|
-
this._exif = _exif;
|
|
660
|
-
this._platform = _platform;
|
|
661
|
-
this._fileLoader = _fileLoader;
|
|
662
|
-
// Data.
|
|
663
|
-
this._types = ['image/png', 'image/jpeg'];
|
|
664
|
-
this.calculateOffsetAndDimensions = function (image, canvasWidth, canvasHeight) {
|
|
665
|
-
var originalWidth = image.width;
|
|
666
|
-
var originalHeight = image.height;
|
|
667
|
-
var widthRatio = canvasWidth / originalWidth;
|
|
668
|
-
var heightRatio = canvasHeight / originalHeight;
|
|
669
|
-
var width;
|
|
670
|
-
var height;
|
|
671
|
-
if (originalWidth > originalHeight) {
|
|
672
|
-
height = originalHeight * heightRatio;
|
|
673
|
-
width = (originalWidth / originalHeight) * height;
|
|
674
|
-
}
|
|
675
|
-
else {
|
|
676
|
-
width = originalWidth * widthRatio;
|
|
677
|
-
height = (originalHeight / originalWidth) * width;
|
|
678
|
-
}
|
|
679
|
-
var xOffset = 0;
|
|
680
|
-
var yOffset = 0;
|
|
681
|
-
if (canvasHeight === height) {
|
|
682
|
-
xOffset = -((width - canvasWidth) / 2);
|
|
683
|
-
}
|
|
684
|
-
else if (canvasWidth === width) {
|
|
685
|
-
yOffset = -((height - canvasHeight) / 2);
|
|
686
|
-
}
|
|
687
|
-
return { xOffset: xOffset, yOffset: yOffset, width: width, height: height };
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
ImageConverter.prototype.toDataUri = function (contents, options) {
|
|
691
|
-
if (options === void 0) { options = null; }
|
|
692
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
693
|
-
var image, canvasWidth, canvasHeight, canvas, context, _b, width, height, xOffset, yOffset;
|
|
694
|
-
return __generator(this, function (_c) {
|
|
695
|
-
switch (_c.label) {
|
|
696
|
-
case 0:
|
|
697
|
-
// Check if the current platform is a browser.
|
|
698
|
-
if (!this._platform.isBrowser) {
|
|
699
|
-
return [2 /*return*/, null];
|
|
700
|
-
}
|
|
701
|
-
return [4 /*yield*/, this.getImage(contents)];
|
|
702
|
-
case 1:
|
|
703
|
-
image = _c.sent();
|
|
704
|
-
canvasWidth = (options === null || options === void 0 ? void 0 : options.width) || (image === null || image === void 0 ? void 0 : image.width);
|
|
705
|
-
canvasHeight = (options === null || options === void 0 ? void 0 : options.height) || (image === null || image === void 0 ? void 0 : image.height);
|
|
706
|
-
canvas = document.createElement('canvas');
|
|
707
|
-
context = canvas.getContext('2d');
|
|
708
|
-
// Validate the context exists.
|
|
709
|
-
if (!context) {
|
|
710
|
-
return [2 /*return*/, null];
|
|
711
|
-
}
|
|
712
|
-
// Set the width and height.
|
|
713
|
-
canvas.width = canvasWidth;
|
|
714
|
-
canvas.height = canvasHeight;
|
|
715
|
-
// When the canvas sizes are 0 we have failed.
|
|
716
|
-
if ((canvas === null || canvas === void 0 ? void 0 : canvas.width) === 0 && (canvas === null || canvas === void 0 ? void 0 : canvas.height) === 0) {
|
|
717
|
-
return [2 /*return*/, null];
|
|
718
|
-
}
|
|
719
|
-
// Check if dimensions where supplied, else create the image.
|
|
720
|
-
if (!options) {
|
|
721
|
-
// Draw the image.
|
|
722
|
-
context.drawImage(image, 0, 0);
|
|
723
|
-
// Convert the canvas to a data url.
|
|
724
|
-
return [2 /*return*/, canvas.toDataURL(this._types[0])];
|
|
725
|
-
}
|
|
726
|
-
_b = this.calculateOffsetAndDimensions(image, canvasWidth, canvasHeight), width = _b.width, height = _b.height, xOffset = _b.xOffset, yOffset = _b.yOffset;
|
|
727
|
-
// Draw the image.
|
|
728
|
-
context.drawImage(image, 0, 0, image.width, image.height, xOffset, yOffset, width, height);
|
|
729
|
-
// Convert the canvas to a data url.
|
|
730
|
-
return [2 /*return*/, canvas.toDataURL(this._types[0])];
|
|
731
|
-
}
|
|
732
|
-
});
|
|
733
|
-
});
|
|
734
|
-
};
|
|
735
|
-
ImageConverter.prototype.fileToImage = function (file, types) {
|
|
736
|
-
if (types === void 0) { types = this._types; }
|
|
737
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
738
|
-
var stripped, _a_1, dataUri;
|
|
739
|
-
return __generator(this, function (_b) {
|
|
740
|
-
switch (_b.label) {
|
|
741
|
-
case 0:
|
|
742
|
-
// Check if the file matches an image.
|
|
743
|
-
if (!types.includes(file.type)) {
|
|
744
|
-
throw new Error('The selected file does not meet the required format.');
|
|
745
|
-
}
|
|
746
|
-
stripped = null;
|
|
747
|
-
_b.label = 1;
|
|
748
|
-
case 1:
|
|
749
|
-
_b.trys.push([1, 3, , 4]);
|
|
750
|
-
return [4 /*yield*/, this._exif.strip(file, 90)];
|
|
751
|
-
case 2:
|
|
752
|
-
stripped = _b.sent();
|
|
753
|
-
return [3 /*break*/, 4];
|
|
754
|
-
case 3:
|
|
755
|
-
_a_1 = _b.sent();
|
|
756
|
-
return [3 /*break*/, 4];
|
|
757
|
-
case 4: return [4 /*yield*/, this._fileLoader.asDataUrl(stripped !== null && stripped !== void 0 ? stripped : file)];
|
|
758
|
-
case 5:
|
|
759
|
-
dataUri = _b.sent();
|
|
760
|
-
return [4 /*yield*/, this.stringToImage(dataUri)];
|
|
761
|
-
case 6:
|
|
762
|
-
// Convert the data URI to a image element.
|
|
763
|
-
return [2 /*return*/, _b.sent()];
|
|
764
|
-
}
|
|
765
|
-
});
|
|
766
|
-
});
|
|
767
|
-
};
|
|
768
|
-
ImageConverter.prototype.stringToImage = function (src) {
|
|
769
|
-
return new Promise(function (resolve, reject) {
|
|
770
|
-
var image = new Image();
|
|
771
|
-
image.src = src;
|
|
772
|
-
image.onload = function () { return resolve(image); };
|
|
773
|
-
image.onerror = function (error) { return reject(error); };
|
|
774
|
-
});
|
|
775
|
-
};
|
|
776
|
-
ImageConverter.prototype.getImage = function (contents) {
|
|
777
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
778
|
-
return __generator(this, function (_b) {
|
|
779
|
-
// If the contents is already an HTML image element just return it.
|
|
780
|
-
if (contents instanceof HTMLImageElement) {
|
|
781
|
-
return [2 /*return*/, contents];
|
|
782
|
-
}
|
|
783
|
-
// If the contents is a file convert it to an HTML image element.
|
|
784
|
-
if (contents instanceof File) {
|
|
785
|
-
return [2 /*return*/, this.fileToImage(contents)];
|
|
786
|
-
}
|
|
787
|
-
// If the contents is a string convert it to an HTML image element.
|
|
788
|
-
return [2 /*return*/, this.stringToImage(contents)];
|
|
789
|
-
});
|
|
790
|
-
});
|
|
791
|
-
};
|
|
792
|
-
return ImageConverter;
|
|
793
|
-
}());
|
|
794
|
-
ImageConverter.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: ImageConverter, deps: [{ token: Exif }, { token: Platform }, { token: FileLoader }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
795
|
-
ImageConverter.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: ImageConverter, providedIn: 'root' });
|
|
796
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: ImageConverter, decorators: [{
|
|
797
|
-
type: i0.Injectable,
|
|
798
|
-
args: [{
|
|
799
|
-
providedIn: 'root'
|
|
800
|
-
}]
|
|
801
|
-
}], ctorParameters: function () { return [{ type: Exif }, { type: Platform }, { type: FileLoader }]; } });
|
|
802
|
-
|
|
803
|
-
var ACCEPT_LANGUAGE = new i0.InjectionToken('AcceptLanguage');
|
|
804
|
-
|
|
805
|
-
var Languages = /** @class */ (function () {
|
|
806
|
-
function Languages(_acceptLanguage) {
|
|
807
|
-
var _this = this;
|
|
808
|
-
this._acceptLanguage = _acceptLanguage;
|
|
809
|
-
// Data.
|
|
810
|
-
this._data = [];
|
|
811
|
-
this.getLanguages = function () {
|
|
812
|
-
// If defined we must be in a server environment.
|
|
813
|
-
if (_this._acceptLanguage) {
|
|
814
|
-
return _this._acceptLanguage;
|
|
815
|
-
}
|
|
816
|
-
// Try to get the languages from the navigator.
|
|
817
|
-
if (typeof navigator !== 'object') {
|
|
818
|
-
return null;
|
|
819
|
-
}
|
|
820
|
-
var t = 'anguage';
|
|
821
|
-
var n = navigator;
|
|
822
|
-
var f = n['l' + t + 's'];
|
|
823
|
-
var data = f && f.length ? f : (t = n['l' + t] ||
|
|
824
|
-
n['browserL' + t] ||
|
|
825
|
-
n['userL' + t]) ? [t] : t;
|
|
826
|
-
return typeof data === 'string'
|
|
827
|
-
? data
|
|
828
|
-
: data.join(';');
|
|
829
|
-
};
|
|
830
|
-
this._data = this.initialize();
|
|
831
|
-
}
|
|
832
|
-
Object.defineProperty(Languages.prototype, "all", {
|
|
833
|
-
get: function () {
|
|
834
|
-
return this._data;
|
|
835
|
-
},
|
|
836
|
-
enumerable: false,
|
|
837
|
-
configurable: true
|
|
838
|
-
});
|
|
839
|
-
Languages.prototype.initialize = function () {
|
|
840
|
-
// Get the languages.
|
|
841
|
-
var data = this.getLanguages();
|
|
842
|
-
// Parse all languages by using a regex.
|
|
843
|
-
var strings = (data || '')
|
|
844
|
-
.match(/((([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?)*/g);
|
|
845
|
-
// Get the content by parsing the strings.
|
|
846
|
-
var content = strings.map(function (item) {
|
|
847
|
-
if (!item) {
|
|
848
|
-
return null;
|
|
849
|
-
}
|
|
850
|
-
var bits = item.split(';');
|
|
851
|
-
var ietf = bits[0].split('-');
|
|
852
|
-
var hasScript = ietf.length === 3;
|
|
853
|
-
return {
|
|
854
|
-
code: ietf[0],
|
|
855
|
-
script: hasScript ? ietf[1] : null,
|
|
856
|
-
region: hasScript ? ietf[2] : ietf[1],
|
|
857
|
-
quality: bits[1] ? parseFloat(bits[1].split('=')[1]) : 1.0
|
|
858
|
-
};
|
|
859
|
-
});
|
|
860
|
-
// Filter out all the empty items
|
|
861
|
-
// and sort them by the quality.
|
|
862
|
-
return content
|
|
863
|
-
.filter(function (item) { return !!item; })
|
|
864
|
-
.sort(function (a, b) { return b.quality - a.quality; });
|
|
865
|
-
};
|
|
866
|
-
return Languages;
|
|
867
|
-
}());
|
|
868
|
-
Languages.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Languages, deps: [{ token: ACCEPT_LANGUAGE, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
869
|
-
Languages.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Languages, providedIn: 'root' });
|
|
870
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Languages, decorators: [{
|
|
871
|
-
type: i0.Injectable,
|
|
872
|
-
args: [{
|
|
873
|
-
providedIn: 'root'
|
|
874
|
-
}]
|
|
875
|
-
}], ctorParameters: function () {
|
|
876
|
-
return [{ type: undefined, decorators: [{
|
|
877
|
-
type: i0.Optional
|
|
878
|
-
}, {
|
|
879
|
-
type: i0.Inject,
|
|
880
|
-
args: [ACCEPT_LANGUAGE]
|
|
881
|
-
}] }];
|
|
882
|
-
} });
|
|
883
|
-
|
|
884
|
-
var WINDOW = new i0.InjectionToken('An abstraction over global window object', {
|
|
885
|
-
factory: function () {
|
|
886
|
-
var defaultView = i0.inject(common.DOCUMENT).defaultView;
|
|
887
|
-
if (!defaultView) {
|
|
888
|
-
throw new Error('Window is not available');
|
|
889
|
-
}
|
|
890
|
-
return defaultView;
|
|
891
|
-
}
|
|
892
|
-
});
|
|
893
|
-
|
|
894
|
-
var NAVIGATOR = new i0.InjectionToken('An abstraction over window.navigator object', {
|
|
895
|
-
factory: function () { return i0.inject(WINDOW).navigator; }
|
|
896
|
-
});
|
|
897
|
-
|
|
898
|
-
var Network = /** @class */ (function () {
|
|
899
|
-
function Network(_platform, _window, _navigator) {
|
|
900
|
-
this._platform = _platform;
|
|
901
|
-
this._window = _window;
|
|
902
|
-
this._navigator = _navigator;
|
|
903
|
-
// Data.
|
|
904
|
-
this._online$ = rxjs.of(true);
|
|
905
|
-
this.getOnlineObservable();
|
|
906
|
-
}
|
|
907
|
-
Network.prototype.online = function () {
|
|
908
|
-
return this._online$;
|
|
909
|
-
};
|
|
910
|
-
Network.prototype.getOnlineObservable = function () {
|
|
911
|
-
var _this = this;
|
|
912
|
-
// Validate we are on a browser.
|
|
913
|
-
if (!this._platform.isBrowser) {
|
|
914
|
-
return;
|
|
915
|
-
}
|
|
916
|
-
// Get all the events from the window.
|
|
917
|
-
var online$ = rxjs.fromEvent(this._window, 'online').pipe(operators.mapTo(true));
|
|
918
|
-
var offline$ = rxjs.fromEvent(this._window, 'offline').pipe(operators.mapTo(false));
|
|
919
|
-
var now$ = new rxjs.Observable(function (subscriber) {
|
|
920
|
-
var _a;
|
|
921
|
-
subscriber.next((_a = _this._navigator) === null || _a === void 0 ? void 0 : _a.onLine);
|
|
922
|
-
subscriber.complete();
|
|
923
|
-
});
|
|
924
|
-
// Merge all event so we get notified when
|
|
925
|
-
// a user is online/offline.
|
|
926
|
-
this._online$ = rxjs.merge(now$, online$, offline$).pipe(operators.map(function (value) { return value; }), operators.distinctUntilChanged(), operators.shareReplay(1));
|
|
927
|
-
};
|
|
928
|
-
return Network;
|
|
929
|
-
}());
|
|
930
|
-
Network.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Network, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: NAVIGATOR, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
931
|
-
Network.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Network, providedIn: 'root' });
|
|
932
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Network, decorators: [{
|
|
933
|
-
type: i0.Injectable,
|
|
934
|
-
args: [{
|
|
935
|
-
providedIn: 'root'
|
|
936
|
-
}]
|
|
937
|
-
}], ctorParameters: function () {
|
|
938
|
-
return [{ type: Platform }, { type: undefined, decorators: [{
|
|
939
|
-
type: i0.Optional
|
|
940
|
-
}, {
|
|
941
|
-
type: i0.Inject,
|
|
942
|
-
args: [WINDOW]
|
|
943
|
-
}] }, { type: undefined, decorators: [{
|
|
944
|
-
type: i0.Optional
|
|
945
|
-
}, {
|
|
946
|
-
type: i0.Inject,
|
|
947
|
-
args: [NAVIGATOR]
|
|
948
|
-
}] }];
|
|
949
|
-
} });
|
|
950
|
-
|
|
951
|
-
var Patch = /** @class */ (function () {
|
|
952
|
-
function Patch(_platform, _window, _document) {
|
|
953
|
-
this._platform = _platform;
|
|
954
|
-
this._window = _window;
|
|
955
|
-
this._document = _document;
|
|
956
|
-
this._hasPatchedMobileVerticalHeight = false;
|
|
957
|
-
// Subscriptions.
|
|
958
|
-
this._subscription = new rxjs.Subscription();
|
|
959
|
-
}
|
|
960
|
-
Patch.prototype.mobileVerticalHeight = function () {
|
|
961
|
-
// Check if the user has already patched
|
|
962
|
-
// the mobile vertical height.
|
|
963
|
-
if (this._hasPatchedMobileVerticalHeight) {
|
|
964
|
-
return;
|
|
965
|
-
}
|
|
966
|
-
this.periodicallySetDocumentVerticalProperty();
|
|
967
|
-
this._hasPatchedMobileVerticalHeight = true;
|
|
968
|
-
};
|
|
969
|
-
Patch.prototype.ngOnDestroy = function () {
|
|
970
|
-
var _a;
|
|
971
|
-
(_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
972
|
-
};
|
|
973
|
-
Patch.prototype.periodicallySetDocumentVerticalProperty = function () {
|
|
974
|
-
var _this = this;
|
|
975
|
-
// Validate we are using a browser.
|
|
976
|
-
if (!this._platform.isBrowser) {
|
|
977
|
-
return;
|
|
978
|
-
}
|
|
979
|
-
// Listen to a debounced window resize event.
|
|
980
|
-
var resize$ = rxjs.fromEvent(this._window, 'resize').pipe(operators.debounceTime(25), operators.startWith(0));
|
|
981
|
-
// Subscribe to the resize observable.
|
|
982
|
-
var subscription = resize$.subscribe(function () {
|
|
983
|
-
var _a, _b, _c, _d;
|
|
984
|
-
var verticalHeight = ((_a = _this._window) === null || _a === void 0 ? void 0 : _a.innerHeight) * 0.01;
|
|
985
|
-
(_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");
|
|
986
|
-
});
|
|
987
|
-
// Save the subscription so we can destroy it later.
|
|
988
|
-
this._subscription.add(subscription);
|
|
989
|
-
};
|
|
990
|
-
return Patch;
|
|
991
|
-
}());
|
|
992
|
-
Patch.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Patch, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: common.DOCUMENT, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
993
|
-
Patch.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Patch, providedIn: 'root' });
|
|
994
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Patch, decorators: [{
|
|
995
|
-
type: i0.Injectable,
|
|
996
|
-
args: [{
|
|
997
|
-
providedIn: 'root'
|
|
998
|
-
}]
|
|
999
|
-
}], ctorParameters: function () {
|
|
1000
|
-
return [{ type: Platform }, { type: undefined, decorators: [{
|
|
1001
|
-
type: i0.Optional
|
|
1002
|
-
}, {
|
|
1003
|
-
type: i0.Inject,
|
|
1004
|
-
args: [WINDOW]
|
|
1005
|
-
}] }, { type: undefined, decorators: [{
|
|
1006
|
-
type: i0.Optional
|
|
1007
|
-
}, {
|
|
1008
|
-
type: i0.Inject,
|
|
1009
|
-
args: [common.DOCUMENT]
|
|
1010
|
-
}] }];
|
|
1011
|
-
} });
|
|
1012
|
-
|
|
1013
|
-
var Clipboard = /** @class */ (function () {
|
|
1014
|
-
function Clipboard(_document) {
|
|
1015
|
-
this._document = _document;
|
|
1016
|
-
}
|
|
1017
|
-
Clipboard.prototype.copy = function (text) {
|
|
1018
|
-
var pendingCopy = this.beginCopy(text);
|
|
1019
|
-
var successful = pendingCopy.copy();
|
|
1020
|
-
pendingCopy.destroy();
|
|
1021
|
-
return successful;
|
|
1022
|
-
};
|
|
1023
|
-
Clipboard.prototype.beginCopy = function (text) {
|
|
1024
|
-
return new ClipboardCopy(text, this._document);
|
|
1025
|
-
};
|
|
1026
|
-
return Clipboard;
|
|
1027
|
-
}());
|
|
1028
|
-
Clipboard.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Clipboard, deps: [{ token: common.DOCUMENT, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1029
|
-
Clipboard.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Clipboard, providedIn: 'root' });
|
|
1030
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0__namespace, type: Clipboard, decorators: [{
|
|
1031
|
-
type: i0.Injectable,
|
|
1032
|
-
args: [{
|
|
1033
|
-
providedIn: 'root'
|
|
1034
|
-
}]
|
|
1035
|
-
}], ctorParameters: function () {
|
|
1036
|
-
return [{ type: undefined, decorators: [{
|
|
1037
|
-
type: i0.Optional
|
|
1038
|
-
}, {
|
|
1039
|
-
type: i0.Inject,
|
|
1040
|
-
args: [common.DOCUMENT]
|
|
1041
|
-
}] }];
|
|
1042
|
-
} });
|
|
1043
|
-
var ClipboardCopy = /** @class */ (function () {
|
|
1044
|
-
function ClipboardCopy(_text, _document) {
|
|
1045
|
-
this._text = _text;
|
|
1046
|
-
this._document = _document;
|
|
1047
|
-
this.initialize();
|
|
1048
|
-
}
|
|
1049
|
-
ClipboardCopy.prototype.copy = function () {
|
|
1050
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1051
|
-
var textarea = this._textarea;
|
|
1052
|
-
var successful = false;
|
|
1053
|
-
try {
|
|
1054
|
-
var currentFocus = this._document.activeElement;
|
|
1055
|
-
(_a = textarea === null || textarea === void 0 ? void 0 : textarea.select) === null || _a === void 0 ? void 0 : _a.call(textarea);
|
|
1056
|
-
(_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);
|
|
1057
|
-
successful = (_e = (_d = this._document) === null || _d === void 0 ? void 0 : _d.execCommand) === null || _e === void 0 ? void 0 : _e.call(_d, 'copy');
|
|
1058
|
-
(_f = currentFocus === null || currentFocus === void 0 ? void 0 : currentFocus.focus) === null || _f === void 0 ? void 0 : _f.call(currentFocus);
|
|
1059
|
-
}
|
|
1060
|
-
catch (_g) {
|
|
1061
|
-
// Do nothing.
|
|
1062
|
-
}
|
|
1063
|
-
return successful;
|
|
1064
|
-
};
|
|
1065
|
-
ClipboardCopy.prototype.destroy = function () {
|
|
1066
|
-
var _a, _b, _c;
|
|
1067
|
-
(_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);
|
|
1068
|
-
this._textarea = undefined;
|
|
1069
|
-
};
|
|
1070
|
-
ClipboardCopy.prototype.initialize = function () {
|
|
1071
|
-
var textarea = this._textarea = this._document.createElement('textarea');
|
|
1072
|
-
var styles = textarea.style;
|
|
1073
|
-
// Hide the element for display and accessibility. Set a fixed position so the page layout
|
|
1074
|
-
// isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea
|
|
1075
|
-
// for a split second and if it's off-screen, some browsers will attempt to scroll it into view.
|
|
1076
|
-
styles.position = 'fixed';
|
|
1077
|
-
styles.top = styles.opacity = '0';
|
|
1078
|
-
styles.left = '-999em';
|
|
1079
|
-
textarea.setAttribute('aria-hidden', 'true');
|
|
1080
|
-
textarea.value = this._text;
|
|
1081
|
-
this._document.body.appendChild(textarea);
|
|
1082
|
-
};
|
|
1083
|
-
return ClipboardCopy;
|
|
1084
|
-
}());
|
|
1085
|
-
|
|
1086
|
-
function coerceBooleanProperty(value) {
|
|
1087
|
-
return value != null && "" + value !== 'false';
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
function mixinDisabled(base) {
|
|
1091
|
-
return /** @class */ (function (_super) {
|
|
1092
|
-
__extends(class_1, _super);
|
|
1093
|
-
function class_1() {
|
|
1094
|
-
var args = [];
|
|
1095
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1096
|
-
args[_i] = arguments[_i];
|
|
1097
|
-
}
|
|
1098
|
-
var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
|
|
1099
|
-
_this._disable = false;
|
|
1100
|
-
return _this;
|
|
1101
|
-
}
|
|
1102
|
-
Object.defineProperty(class_1.prototype, "disabled", {
|
|
1103
|
-
get: function () {
|
|
1104
|
-
return this._disable;
|
|
1105
|
-
},
|
|
1106
|
-
set: function (value) {
|
|
1107
|
-
this._disable = coerceBooleanProperty(value);
|
|
1108
|
-
},
|
|
1109
|
-
enumerable: false,
|
|
1110
|
-
configurable: true
|
|
1111
|
-
});
|
|
1112
|
-
return class_1;
|
|
1113
|
-
}(base));
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
function mixinLoad(base) {
|
|
1117
|
-
return /** @class */ (function (_super) {
|
|
1118
|
-
__extends(class_1, _super);
|
|
1119
|
-
function class_1() {
|
|
1120
|
-
var args = [];
|
|
1121
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1122
|
-
args[_i] = arguments[_i];
|
|
1123
|
-
}
|
|
1124
|
-
var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
|
|
1125
|
-
_this._loading = false;
|
|
1126
|
-
return _this;
|
|
1127
|
-
}
|
|
1128
|
-
Object.defineProperty(class_1.prototype, "loading", {
|
|
1129
|
-
get: function () {
|
|
1130
|
-
return this._loading;
|
|
1131
|
-
},
|
|
1132
|
-
set: function (value) {
|
|
1133
|
-
this._loading = coerceBooleanProperty(value);
|
|
1134
|
-
},
|
|
1135
|
-
enumerable: false,
|
|
1136
|
-
configurable: true
|
|
1137
|
-
});
|
|
1138
|
-
return class_1;
|
|
1139
|
-
}(base));
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
function mixinError(base) {
|
|
1143
|
-
return /** @class */ (function (_super) {
|
|
1144
|
-
__extends(class_1, _super);
|
|
1145
|
-
function class_1() {
|
|
1146
|
-
var args = [];
|
|
1147
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1148
|
-
args[_i] = arguments[_i];
|
|
1149
|
-
}
|
|
1150
|
-
var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
|
|
1151
|
-
_this._error = false;
|
|
1152
|
-
return _this;
|
|
1153
|
-
}
|
|
1154
|
-
Object.defineProperty(class_1.prototype, "error", {
|
|
1155
|
-
get: function () {
|
|
1156
|
-
return this._error;
|
|
1157
|
-
},
|
|
1158
|
-
set: function (value) {
|
|
1159
|
-
this._error = coerceBooleanProperty(value);
|
|
1160
|
-
},
|
|
1161
|
-
enumerable: false,
|
|
1162
|
-
configurable: true
|
|
1163
|
-
});
|
|
1164
|
-
return class_1;
|
|
1165
|
-
}(base));
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
function mixinHideErrors(base) {
|
|
1169
|
-
return /** @class */ (function (_super) {
|
|
1170
|
-
__extends(class_1, _super);
|
|
1171
|
-
function class_1() {
|
|
1172
|
-
var args = [];
|
|
1173
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1174
|
-
args[_i] = arguments[_i];
|
|
1175
|
-
}
|
|
1176
|
-
var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
|
|
1177
|
-
_this._hideErrors = false;
|
|
1178
|
-
return _this;
|
|
1179
|
-
}
|
|
1180
|
-
Object.defineProperty(class_1.prototype, "hideErrors", {
|
|
1181
|
-
get: function () {
|
|
1182
|
-
return this._hideErrors;
|
|
1183
|
-
},
|
|
1184
|
-
set: function (value) {
|
|
1185
|
-
this._hideErrors = coerceBooleanProperty(value);
|
|
1186
|
-
},
|
|
1187
|
-
enumerable: false,
|
|
1188
|
-
configurable: true
|
|
1189
|
-
});
|
|
1190
|
-
return class_1;
|
|
1191
|
-
}(base));
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
function mixinFocused(base) {
|
|
1195
|
-
return /** @class */ (function (_super) {
|
|
1196
|
-
__extends(class_1, _super);
|
|
1197
|
-
function class_1() {
|
|
1198
|
-
var args = [];
|
|
1199
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1200
|
-
args[_i] = arguments[_i];
|
|
1201
|
-
}
|
|
1202
|
-
var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
|
|
1203
|
-
_this._focused = false;
|
|
1204
|
-
return _this;
|
|
1205
|
-
}
|
|
1206
|
-
Object.defineProperty(class_1.prototype, "focused", {
|
|
1207
|
-
get: function () {
|
|
1208
|
-
return this._focused;
|
|
1209
|
-
},
|
|
1210
|
-
set: function (value) {
|
|
1211
|
-
this._focused = coerceBooleanProperty(value);
|
|
1212
|
-
},
|
|
1213
|
-
enumerable: false,
|
|
1214
|
-
configurable: true
|
|
1215
|
-
});
|
|
1216
|
-
return class_1;
|
|
1217
|
-
}(base));
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
function mixinGrouped(base) {
|
|
1221
|
-
return /** @class */ (function (_super) {
|
|
1222
|
-
__extends(class_1, _super);
|
|
1223
|
-
function class_1() {
|
|
1224
|
-
var args = [];
|
|
1225
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1226
|
-
args[_i] = arguments[_i];
|
|
1227
|
-
}
|
|
1228
|
-
var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
|
|
1229
|
-
_this._grouped = false;
|
|
1230
|
-
return _this;
|
|
1231
|
-
}
|
|
1232
|
-
Object.defineProperty(class_1.prototype, "grouped", {
|
|
1233
|
-
get: function () {
|
|
1234
|
-
return this._grouped;
|
|
1235
|
-
},
|
|
1236
|
-
set: function (value) {
|
|
1237
|
-
this._grouped = coerceBooleanProperty(value);
|
|
1238
|
-
},
|
|
1239
|
-
enumerable: false,
|
|
1240
|
-
configurable: true
|
|
1241
|
-
});
|
|
1242
|
-
return class_1;
|
|
1243
|
-
}(base));
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
function mixinReadonly(base) {
|
|
1247
|
-
return /** @class */ (function (_super) {
|
|
1248
|
-
__extends(class_1, _super);
|
|
1249
|
-
function class_1() {
|
|
1250
|
-
var args = [];
|
|
1251
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1252
|
-
args[_i] = arguments[_i];
|
|
1253
|
-
}
|
|
1254
|
-
var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
|
|
1255
|
-
_this._readonly = false;
|
|
1256
|
-
return _this;
|
|
1257
|
-
}
|
|
1258
|
-
Object.defineProperty(class_1.prototype, "readonly", {
|
|
1259
|
-
get: function () {
|
|
1260
|
-
return this._readonly;
|
|
1261
|
-
},
|
|
1262
|
-
set: function (value) {
|
|
1263
|
-
this._readonly = coerceBooleanProperty(value);
|
|
1264
|
-
},
|
|
1265
|
-
enumerable: false,
|
|
1266
|
-
configurable: true
|
|
1267
|
-
});
|
|
1268
|
-
return class_1;
|
|
1269
|
-
}(base));
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
function mixinRequired(base) {
|
|
1273
|
-
return /** @class */ (function (_super) {
|
|
1274
|
-
__extends(class_1, _super);
|
|
1275
|
-
function class_1() {
|
|
1276
|
-
var args = [];
|
|
1277
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1278
|
-
args[_i] = arguments[_i];
|
|
1279
|
-
}
|
|
1280
|
-
var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
|
|
1281
|
-
_this._required = false;
|
|
1282
|
-
return _this;
|
|
1283
|
-
}
|
|
1284
|
-
Object.defineProperty(class_1.prototype, "required", {
|
|
1285
|
-
get: function () {
|
|
1286
|
-
return this._required;
|
|
1287
|
-
},
|
|
1288
|
-
set: function (value) {
|
|
1289
|
-
this._required = coerceBooleanProperty(value);
|
|
1290
|
-
},
|
|
1291
|
-
enumerable: false,
|
|
1292
|
-
configurable: true
|
|
1293
|
-
});
|
|
1294
|
-
return class_1;
|
|
1295
|
-
}(base));
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
var BASE_URL = new i0.InjectionToken('BaseUrl');
|
|
1299
|
-
|
|
1300
|
-
var COOKIE = new i0.InjectionToken('Cookie');
|
|
1301
|
-
|
|
1302
|
-
var LOCATION = new i0.InjectionToken('An abstraction over window.location object', {
|
|
1303
|
-
factory: function () { return i0.inject(WINDOW).location; }
|
|
1304
|
-
});
|
|
1305
|
-
|
|
1306
|
-
var BbRegex = {
|
|
1307
|
-
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,}))$/,
|
|
1308
|
-
fullNumber: /^\d*[1-9]\d*$/
|
|
1309
|
-
};
|
|
1310
|
-
|
|
1311
|
-
var BbValidator = /** @class */ (function () {
|
|
1312
|
-
function BbValidator() {
|
|
1313
|
-
}
|
|
1314
|
-
BbValidator.email = function (control) {
|
|
1315
|
-
if (isEmptyInputValue(control.value)) {
|
|
1316
|
-
return null;
|
|
1317
|
-
}
|
|
1318
|
-
return BbRegex.email.test(control.value) ? null : { email: true };
|
|
1319
|
-
};
|
|
1320
|
-
BbValidator.fullNumber = function (control) {
|
|
1321
|
-
if (isEmptyInputValue(control.value)) {
|
|
1322
|
-
return null;
|
|
1323
|
-
}
|
|
1324
|
-
return BbRegex.fullNumber.test(control.value) ? null : { fullNumber: true };
|
|
1325
|
-
};
|
|
1326
|
-
BbValidator.maxFileSize = function (bytes) {
|
|
1327
|
-
var validator = function (control) {
|
|
1328
|
-
var value = control.value;
|
|
1329
|
-
// Validate if the value is a file.
|
|
1330
|
-
if (!(value instanceof File)) {
|
|
1331
|
-
return null;
|
|
1332
|
-
}
|
|
1333
|
-
if (value.size <= bytes) {
|
|
1334
|
-
return null;
|
|
1335
|
-
}
|
|
1336
|
-
var maxSize = '0 Bytes';
|
|
1337
|
-
if (bytes !== 0) {
|
|
1338
|
-
var k = 1024;
|
|
1339
|
-
var dm = 2;
|
|
1340
|
-
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
1341
|
-
var index = Math.floor(Math.log(bytes) / Math.log(k));
|
|
1342
|
-
maxSize = parseFloat((bytes / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
|
|
1343
|
-
}
|
|
1344
|
-
return { maxFileSize: { maxSize: maxSize } };
|
|
1345
|
-
};
|
|
1346
|
-
return validator;
|
|
1347
|
-
};
|
|
1348
|
-
BbValidator.confirm = function (fieldName, error) {
|
|
1349
|
-
if (error === void 0) { error = 'confirm'; }
|
|
1350
|
-
var validator = function (control) {
|
|
1351
|
-
var _b;
|
|
1352
|
-
var _a;
|
|
1353
|
-
if (isEmptyInputValue(control.value)) {
|
|
1354
|
-
return null;
|
|
1355
|
-
}
|
|
1356
|
-
var field = (_a = control === null || control === void 0 ? void 0 : control.parent) === null || _a === void 0 ? void 0 : _a.get(fieldName);
|
|
1357
|
-
return (control === null || control === void 0 ? void 0 : control.value) === (field === null || field === void 0 ? void 0 : field.value)
|
|
1358
|
-
? null
|
|
1359
|
-
: (_b = {}, _b[error] = true, _b);
|
|
1360
|
-
};
|
|
1361
|
-
return validator;
|
|
1362
|
-
};
|
|
1363
|
-
BbValidator.maxDate = function (date, error) {
|
|
1364
|
-
if (error === void 0) { error = 'maxDate'; }
|
|
1365
|
-
var formattedDate = date.toString() !== 'Invalid Date'
|
|
1366
|
-
? common.formatDate(date, 'yyyy-MM-dd', 'en-US')
|
|
1367
|
-
: null;
|
|
1368
|
-
var validator = function (control) {
|
|
1369
|
-
var _b;
|
|
1370
|
-
if (isEmptyInputValue(control.value)) {
|
|
1371
|
-
return null;
|
|
1372
|
-
}
|
|
1373
|
-
var controlDate = new Date(control.value);
|
|
1374
|
-
return controlDate.getTime() > date.getTime()
|
|
1375
|
-
? (_b = {}, _b[error] = { date: formattedDate }, _b) : null;
|
|
1376
|
-
};
|
|
1377
|
-
return validator;
|
|
1378
|
-
};
|
|
1379
|
-
BbValidator.minDate = function (date, error) {
|
|
1380
|
-
if (error === void 0) { error = 'minDate'; }
|
|
1381
|
-
var formattedDate = date.toString() !== 'Invalid Date'
|
|
1382
|
-
? common.formatDate(date, 'yyyy-MM-dd', 'en-US')
|
|
1383
|
-
: null;
|
|
1384
|
-
var validator = function (control) {
|
|
1385
|
-
var _b;
|
|
1386
|
-
if (isEmptyInputValue(control.value)) {
|
|
1387
|
-
return null;
|
|
1388
|
-
}
|
|
1389
|
-
var controlDate = new Date(control.value);
|
|
1390
|
-
return controlDate.getTime() < date.getTime()
|
|
1391
|
-
? (_b = {}, _b[error] = { date: formattedDate }, _b) : null;
|
|
1392
|
-
};
|
|
1393
|
-
return validator;
|
|
1394
|
-
};
|
|
1395
|
-
return BbValidator;
|
|
1396
|
-
}());
|
|
1397
|
-
function isEmptyInputValue(value) {
|
|
1398
|
-
// We don't check for string here so it also works with arrays.
|
|
1399
|
-
return value == null || value.length === 0;
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
/*
|
|
1403
|
-
* Public API Surface of bb-foundation
|
|
1404
|
-
*/
|
|
1405
|
-
|
|
1406
|
-
/**
|
|
1407
|
-
* Generated bundle index. Do not edit.
|
|
1408
|
-
*/
|
|
1409
|
-
|
|
1410
|
-
exports.ACCEPT_LANGUAGE = ACCEPT_LANGUAGE;
|
|
1411
|
-
exports.BASE_URL = BASE_URL;
|
|
1412
|
-
exports.BbRegex = BbRegex;
|
|
1413
|
-
exports.BbValidator = BbValidator;
|
|
1414
|
-
exports.COOKIE = COOKIE;
|
|
1415
|
-
exports.Clipboard = Clipboard;
|
|
1416
|
-
exports.ClipboardCopy = ClipboardCopy;
|
|
1417
|
-
exports.Exif = Exif;
|
|
1418
|
-
exports.FileLoader = FileLoader;
|
|
1419
|
-
exports.ImageConverter = ImageConverter;
|
|
1420
|
-
exports.LOCATION = LOCATION;
|
|
1421
|
-
exports.Languages = Languages;
|
|
1422
|
-
exports.NAVIGATOR = NAVIGATOR;
|
|
1423
|
-
exports.Network = Network;
|
|
1424
|
-
exports.Patch = Patch;
|
|
1425
|
-
exports.Platform = Platform;
|
|
1426
|
-
exports.WINDOW = WINDOW;
|
|
1427
|
-
exports.coerceBooleanProperty = coerceBooleanProperty;
|
|
1428
|
-
exports.mixinDisabled = mixinDisabled;
|
|
1429
|
-
exports.mixinError = mixinError;
|
|
1430
|
-
exports.mixinFocused = mixinFocused;
|
|
1431
|
-
exports.mixinGrouped = mixinGrouped;
|
|
1432
|
-
exports.mixinHideErrors = mixinHideErrors;
|
|
1433
|
-
exports.mixinLoad = mixinLoad;
|
|
1434
|
-
exports.mixinReadonly = mixinReadonly;
|
|
1435
|
-
exports.mixinRequired = mixinRequired;
|
|
1436
|
-
|
|
1437
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1438
|
-
|
|
1439
|
-
}));
|
|
1440
|
-
//# sourceMappingURL=bravobit-bb-foundation.umd.js.map
|