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