@bravobit/bb-foundation 0.14.3 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -47
- package/auth/bravobit-bb-foundation-auth.d.ts +5 -5
- package/auth/lib/auth.interceptor.d.ts +21 -21
- package/auth/lib/auth.module.d.ts +15 -15
- package/auth/lib/auth.service.d.ts +59 -59
- package/auth/lib/auth.session.d.ts +34 -34
- package/auth/lib/directives/authenticated.directive.d.ts +14 -14
- package/auth/lib/directives/permission.directive.d.ts +24 -24
- package/auth/lib/directives/role.directive.d.ts +16 -16
- package/auth/lib/guards/anonymous.guard.d.ts +11 -11
- package/auth/lib/guards/authenticated.guard.d.ts +11 -11
- package/auth/lib/helpers/jwt.helper.d.ts +8 -8
- package/auth/lib/helpers/mapper.helper.d.ts +23 -23
- package/auth/lib/interfaces/config.interface.d.ts +12 -12
- package/auth/lib/interfaces/mapper.interface.d.ts +19 -19
- package/auth/lib/interfaces/provider.interface.d.ts +16 -16
- package/auth/lib/interfaces/token.interface.d.ts +11 -11
- package/auth/lib/permissions.service.d.ts +14 -14
- package/auth/lib/providers/email.provider.d.ts +15 -15
- package/auth/lib/providers/verify.provider.d.ts +13 -13
- package/auth/lib/tokens/use-authorization.token.d.ts +2 -2
- package/auth/public_api.d.ts +18 -18
- package/bravobit-bb-foundation.d.ts +5 -5
- package/bundles/bravobit-bb-foundation-auth.umd.js +1400 -1402
- package/bundles/bravobit-bb-foundation-auth.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-collections.umd.js +868 -0
- package/bundles/bravobit-bb-foundation-collections.umd.js.map +1 -0
- package/bundles/bravobit-bb-foundation-dashboard.umd.js +817 -819
- package/bundles/bravobit-bb-foundation-dashboard.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-dialog.umd.js +649 -651
- package/bundles/bravobit-bb-foundation-dialog.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-elements.umd.js +2651 -2653
- package/bundles/bravobit-bb-foundation-elements.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-http.umd.js +488 -490
- package/bundles/bravobit-bb-foundation-http.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-localize.umd.js +1208 -1210
- package/bundles/bravobit-bb-foundation-localize.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-notifications.umd.js +743 -745
- package/bundles/bravobit-bb-foundation-notifications.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-recaptcha.umd.js +640 -642
- package/bundles/bravobit-bb-foundation-recaptcha.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-rxjs.umd.js +13 -13
- package/bundles/bravobit-bb-foundation-rxjs.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-storage.umd.js +756 -758
- package/bundles/bravobit-bb-foundation-storage.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation-table.umd.js +993 -995
- package/bundles/bravobit-bb-foundation-table.umd.js.map +1 -1
- package/bundles/bravobit-bb-foundation.umd.js +1332 -1334
- package/bundles/bravobit-bb-foundation.umd.js.map +1 -1
- package/collections/bravobit-bb-foundation-collections.d.ts +5 -0
- package/collections/lib/collection.d.ts +43 -0
- package/collections/lib/collections.module.d.ts +10 -0
- package/collections/lib/components/collections-pager/collections-pager.component.d.ts +34 -0
- package/collections/lib/components/collections-viewer/collections-viewer.component.d.ts +12 -0
- package/collections/lib/components/collections.directive.d.ts +17 -0
- package/collections/lib/interfaces/collection.interface.d.ts +26 -0
- package/collections/lib/providers/api-collection.provider.d.ts +15 -0
- package/collections/lib/providers/collection.provider.d.ts +6 -0
- package/collections/lib/providers/local-collection.provider.d.ts +8 -0
- package/collections/package.json +10 -0
- package/collections/public_api.d.ts +9 -0
- package/dashboard/bravobit-bb-foundation-dashboard.d.ts +5 -5
- package/dashboard/lib/dashboard/dashboard.component.d.ts +19 -19
- package/dashboard/lib/dashboard-header/dashboard-header.component.d.ts +11 -11
- package/dashboard/lib/dashboard-menu/dashboard-menu.component.d.ts +9 -9
- package/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.d.ts +11 -11
- package/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.d.ts +21 -21
- package/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.d.ts +27 -27
- package/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.d.ts +16 -16
- package/dashboard/lib/dashboard.module.d.ts +16 -16
- package/dashboard/public_api.d.ts +8 -8
- package/dialog/bravobit-bb-foundation-dialog.d.ts +5 -5
- package/dialog/lib/dialog-actions/dialog-actions.component.d.ts +5 -5
- package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +16 -16
- package/dialog/lib/dialog-container/dialog-container.component.d.ts +24 -24
- package/dialog/lib/dialog-header/dialog-header.component.d.ts +9 -9
- package/dialog/lib/dialog-link/dialog-link.component.d.ts +5 -5
- package/dialog/lib/dialog-modal/dialog-modal.component.d.ts +12 -12
- package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +22 -22
- package/dialog/lib/dialog.injector.d.ts +8 -8
- package/dialog/lib/dialog.insertion.d.ts +8 -8
- package/dialog/lib/dialog.interfaces.d.ts +3 -3
- package/dialog/lib/dialog.module.d.ts +19 -19
- package/dialog/lib/dialog.ref.d.ts +8 -8
- package/dialog/lib/dialog.service.d.ts +19 -19
- package/dialog/public_api.d.ts +9 -9
- package/elements/bravobit-bb-foundation-elements.d.ts +5 -5
- package/elements/lib/avatar/avatar.component.d.ts +25 -25
- package/elements/lib/button/button.component.d.ts +23 -23
- package/elements/lib/checkbox/checkbox.component.d.ts +27 -27
- package/elements/lib/date-picker/date-picker.component.d.ts +69 -69
- package/elements/lib/directives/addon.directive.d.ts +9 -9
- package/elements/lib/directives/autosize.directive.d.ts +18 -18
- package/elements/lib/directives/focus-trap.directive.d.ts +17 -17
- package/elements/lib/directives/focus.directive.d.ts +14 -14
- package/elements/lib/directives/form-submit.directive.d.ts +17 -17
- package/elements/lib/directives/input.directive.d.ts +38 -38
- package/elements/lib/directives/template.directive.d.ts +10 -10
- package/elements/lib/dropdown/dropdown.component.d.ts +21 -21
- package/elements/lib/elements.interfaces.d.ts +25 -25
- package/elements/lib/elements.module.d.ts +116 -116
- package/elements/lib/file-picker/file-picker.component.d.ts +49 -49
- package/elements/lib/form-control/form-control.component.d.ts +21 -21
- package/elements/lib/form-error/form-error.component.d.ts +29 -29
- package/elements/lib/form-group/form-group.component.d.ts +10 -10
- package/elements/lib/icon/icon.component.d.ts +22 -22
- package/elements/lib/image-picker/image-picker.component.d.ts +38 -38
- package/elements/lib/pipes/file-image.pipe.d.ts +13 -13
- package/elements/lib/pipes/file-size.pipe.d.ts +8 -8
- package/elements/lib/pipes/relative-time.pipe.d.ts +19 -19
- package/elements/lib/spinner/spinner.component.d.ts +12 -12
- package/elements/lib/tag/tag.component.d.ts +7 -7
- package/elements/public_api.d.ts +25 -25
- package/esm2015/auth/bravobit-bb-foundation-auth.js +4 -4
- package/esm2015/auth/lib/auth.interceptor.js +95 -95
- package/esm2015/auth/lib/auth.module.js +54 -54
- package/esm2015/auth/lib/auth.service.js +299 -299
- package/esm2015/auth/lib/auth.session.js +136 -136
- package/esm2015/auth/lib/directives/authenticated.directive.js +32 -32
- package/esm2015/auth/lib/directives/permission.directive.js +81 -81
- package/esm2015/auth/lib/directives/role.directive.js +38 -38
- package/esm2015/auth/lib/guards/anonymous.guard.js +35 -35
- package/esm2015/auth/lib/guards/authenticated.guard.js +36 -36
- package/esm2015/auth/lib/helpers/jwt.helper.js +69 -69
- package/esm2015/auth/lib/helpers/mapper.helper.js +35 -35
- package/esm2015/auth/lib/interfaces/config.interface.js +3 -3
- package/esm2015/auth/lib/interfaces/mapper.interface.js +2 -2
- package/esm2015/auth/lib/interfaces/provider.interface.js +2 -2
- package/esm2015/auth/lib/interfaces/token.interface.js +2 -2
- package/esm2015/auth/lib/permissions.service.js +58 -58
- package/esm2015/auth/lib/providers/email.provider.js +26 -26
- package/esm2015/auth/lib/providers/verify.provider.js +20 -20
- package/esm2015/auth/lib/tokens/use-authorization.token.js +3 -3
- package/esm2015/auth/public_api.js +19 -19
- package/esm2015/bravobit-bb-foundation.js +4 -4
- package/esm2015/collections/bravobit-bb-foundation-collections.js +5 -0
- package/esm2015/collections/lib/collection.js +104 -0
- package/esm2015/collections/lib/collections.module.js +54 -0
- package/esm2015/collections/lib/components/collections-pager/collections-pager.component.js +136 -0
- package/esm2015/collections/lib/components/collections-viewer/collections-viewer.component.js +39 -0
- package/esm2015/collections/lib/components/collections.directive.js +43 -0
- package/esm2015/collections/lib/interfaces/collection.interface.js +2 -0
- package/esm2015/collections/lib/providers/api-collection.provider.js +69 -0
- package/esm2015/collections/lib/providers/collection.provider.js +14 -0
- package/esm2015/collections/lib/providers/local-collection.provider.js +16 -0
- package/esm2015/collections/public_api.js +10 -0
- package/esm2015/dashboard/bravobit-bb-foundation-dashboard.js +4 -4
- package/esm2015/dashboard/lib/dashboard/dashboard.component.js +64 -64
- package/esm2015/dashboard/lib/dashboard-header/dashboard-header.component.js +41 -41
- package/esm2015/dashboard/lib/dashboard-menu/dashboard-menu.component.js +39 -39
- package/esm2015/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.js +38 -38
- package/esm2015/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.js +83 -83
- package/esm2015/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.js +110 -110
- package/esm2015/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.js +71 -71
- package/esm2015/dashboard/lib/dashboard.module.js +47 -47
- package/esm2015/dashboard/public_api.js +9 -9
- package/esm2015/dialog/bravobit-bb-foundation-dialog.js +4 -4
- package/esm2015/dialog/lib/dialog-actions/dialog-actions.component.js +20 -20
- package/esm2015/dialog/lib/dialog-confirm/dialog-confirm.component.js +45 -45
- package/esm2015/dialog/lib/dialog-container/dialog-container.component.js +162 -162
- package/esm2015/dialog/lib/dialog-header/dialog-header.component.js +33 -33
- package/esm2015/dialog/lib/dialog-link/dialog-link.component.js +19 -19
- package/esm2015/dialog/lib/dialog-modal/dialog-modal.component.js +54 -54
- package/esm2015/dialog/lib/dialog-overlay/dialog-overlay.component.js +143 -143
- package/esm2015/dialog/lib/dialog.injector.js +18 -18
- package/esm2015/dialog/lib/dialog.insertion.js +16 -16
- package/esm2015/dialog/lib/dialog.interfaces.js +3 -3
- package/esm2015/dialog/lib/dialog.module.js +74 -74
- package/esm2015/dialog/lib/dialog.ref.js +22 -22
- package/esm2015/dialog/lib/dialog.service.js +77 -77
- package/esm2015/dialog/public_api.js +10 -10
- package/esm2015/elements/bravobit-bb-foundation-elements.js +4 -4
- package/esm2015/elements/lib/avatar/avatar.component.js +151 -151
- package/esm2015/elements/lib/button/button.component.js +79 -79
- package/esm2015/elements/lib/checkbox/checkbox.component.js +83 -83
- package/esm2015/elements/lib/date-picker/date-picker.component.js +322 -322
- package/esm2015/elements/lib/directives/addon.directive.js +29 -29
- package/esm2015/elements/lib/directives/autosize.directive.js +74 -74
- package/esm2015/elements/lib/directives/focus-trap.directive.js +77 -77
- package/esm2015/elements/lib/directives/focus.directive.js +39 -39
- package/esm2015/elements/lib/directives/form-submit.directive.js +53 -53
- package/esm2015/elements/lib/directives/input.directive.js +139 -139
- package/esm2015/elements/lib/directives/template.directive.js +28 -28
- package/esm2015/elements/lib/dropdown/dropdown.component.js +111 -111
- package/esm2015/elements/lib/elements.interfaces.js +4 -4
- package/esm2015/elements/lib/elements.module.js +177 -177
- package/esm2015/elements/lib/file-picker/file-picker.component.js +247 -247
- package/esm2015/elements/lib/form-control/form-control.component.js +58 -58
- package/esm2015/elements/lib/form-error/form-error.component.js +116 -116
- package/esm2015/elements/lib/form-group/form-group.component.js +27 -27
- package/esm2015/elements/lib/icon/icon.component.js +110 -110
- package/esm2015/elements/lib/image-picker/image-picker.component.js +119 -119
- package/esm2015/elements/lib/pipes/file-image.pipe.js +45 -45
- package/esm2015/elements/lib/pipes/file-size.pipe.js +28 -28
- package/esm2015/elements/lib/pipes/relative-time.pipe.js +96 -96
- package/esm2015/elements/lib/spinner/spinner.component.js +34 -34
- package/esm2015/elements/lib/tag/tag.component.js +26 -26
- package/esm2015/elements/public_api.js +26 -26
- package/esm2015/http/bravobit-bb-foundation-http.js +4 -4
- package/esm2015/http/lib/classes/http.config.js +31 -31
- package/esm2015/http/lib/classes/http.error.js +21 -21
- package/esm2015/http/lib/http.interfaces.js +2 -2
- package/esm2015/http/lib/http.module.js +43 -43
- package/esm2015/http/lib/interceptors/base-url.interceptor.js +52 -52
- package/esm2015/http/lib/interceptors/error.interceptor.js +33 -33
- package/esm2015/http/public_api.js +7 -7
- package/esm2015/lib/core/coercions/boolean-coercion.js +4 -4
- package/esm2015/lib/core/miscellaneous/regex.js +5 -5
- package/esm2015/lib/core/miscellaneous/validator.js +86 -86
- package/esm2015/lib/core/mixins/can-disable.js +16 -16
- package/esm2015/lib/core/mixins/can-hide-errors.js +16 -16
- package/esm2015/lib/core/mixins/can-load.js +16 -16
- package/esm2015/lib/core/mixins/constructor.js +2 -2
- package/esm2015/lib/core/mixins/has-error.js +16 -16
- package/esm2015/lib/core/mixins/is-focused.js +16 -16
- package/esm2015/lib/core/mixins/is-grouped.js +16 -16
- package/esm2015/lib/core/mixins/is-readonly.js +16 -16
- package/esm2015/lib/core/mixins/is-required.js +16 -16
- package/esm2015/lib/core/services/clipboard.service.js +72 -72
- package/esm2015/lib/core/services/exif.service.js +168 -168
- package/esm2015/lib/core/services/file-loader.service.js +90 -90
- package/esm2015/lib/core/services/image-converter.service.js +130 -130
- package/esm2015/lib/core/services/languages.service.js +74 -74
- package/esm2015/lib/core/services/network.service.js +56 -56
- package/esm2015/lib/core/services/patch.service.js +65 -65
- package/esm2015/lib/core/services/platform.service.js +42 -42
- package/esm2015/lib/core/tokens/accept-language.token.js +3 -3
- package/esm2015/lib/core/tokens/base-url.token.js +3 -3
- package/esm2015/lib/core/tokens/cookie.token.js +3 -3
- package/esm2015/lib/core/tokens/location.token.js +6 -6
- package/esm2015/lib/core/tokens/navigator.token.js +6 -6
- package/esm2015/lib/core/tokens/window.token.js +12 -12
- package/esm2015/localize/bravobit-bb-foundation-localize.js +4 -4
- package/esm2015/localize/lib/functions/date.function.js +18 -18
- package/esm2015/localize/lib/functions/lowercase.function.js +13 -13
- package/esm2015/localize/lib/functions/uppercase.function.js +13 -13
- package/esm2015/localize/lib/handlers/missing.handler.js +17 -17
- package/esm2015/localize/lib/interfaces/config.interfaces.js +10 -10
- package/esm2015/localize/lib/interfaces/dictionary.interfaces.js +8 -8
- package/esm2015/localize/lib/interfaces/functions.interfaces.js +8 -8
- package/esm2015/localize/lib/interfaces/handlers.interfaces.js +2 -2
- package/esm2015/localize/lib/interfaces/options.interfaces.js +6 -6
- package/esm2015/localize/lib/localizations/dutch.localization.js +53 -53
- package/esm2015/localize/lib/localizations/english.localization.js +53 -53
- package/esm2015/localize/lib/localize.dictionary.js +137 -137
- package/esm2015/localize/lib/localize.module.js +69 -69
- package/esm2015/localize/lib/localize.pipe.js +49 -49
- package/esm2015/localize/lib/localize.service.js +282 -282
- package/esm2015/localize/lib/views/localize-string/localize-string.component.js +99 -99
- package/esm2015/localize/lib/views/localize-template-or-string.directive.js +28 -28
- package/esm2015/localize/lib/views/localize-template.directive.js +21 -21
- package/esm2015/localize/public_api.js +18 -18
- package/esm2015/notifications/bravobit-bb-foundation-notifications.js +4 -4
- package/esm2015/notifications/lib/notifications-item/notifications-item.component.js +108 -108
- package/esm2015/notifications/lib/notifications-list/notifications-list.component.js +56 -56
- package/esm2015/notifications/lib/notifications.animations.js +28 -28
- package/esm2015/notifications/lib/notifications.injector.js +18 -18
- package/esm2015/notifications/lib/notifications.interfaces.js +20 -20
- package/esm2015/notifications/lib/notifications.module.js +31 -31
- package/esm2015/notifications/lib/notifications.service.js +145 -145
- package/esm2015/notifications/public_api.js +4 -4
- package/esm2015/public_api.js +30 -30
- package/esm2015/recaptcha/bravobit-bb-foundation-recaptcha.js +4 -4
- package/esm2015/recaptcha/lib/recaptcha/recaptcha.component.js +199 -199
- package/esm2015/recaptcha/lib/recaptcha-loader.service.js +93 -93
- package/esm2015/recaptcha/lib/recaptcha.interface.js +3 -3
- package/esm2015/recaptcha/lib/recaptcha.module.js +27 -27
- package/esm2015/recaptcha/public_api.js +5 -5
- package/esm2015/rxjs/bravobit-bb-foundation-rxjs.js +4 -4
- package/esm2015/rxjs/lib/operators/combine-latest-map.operator.js +7 -7
- package/esm2015/rxjs/lib/operators/filter-nil.operator.js +5 -5
- package/esm2015/rxjs/public_api.js +3 -3
- package/esm2015/storage/bravobit-bb-foundation-storage.js +4 -4
- package/esm2015/storage/lib/interfaces/attributes.interface.js +2 -2
- package/esm2015/storage/lib/interfaces/memory.interface.js +2 -2
- package/esm2015/storage/lib/interfaces/strategy.interface.js +2 -2
- package/esm2015/storage/lib/storage.service.js +111 -111
- package/esm2015/storage/lib/strategies/cookie-storage.strategy.js +143 -143
- package/esm2015/storage/lib/strategies/memory-storage.strategy.js +56 -56
- package/esm2015/storage/lib/strategies/polyfill-storage.strategy.js +102 -102
- package/esm2015/storage/public_api.js +8 -8
- package/esm2015/table/bravobit-bb-foundation-table.js +4 -4
- package/esm2015/table/lib/components/table/table.component.js +183 -183
- package/esm2015/table/lib/components/table-cell/table-cell.component.js +19 -19
- package/esm2015/table/lib/components/table-header-cell/table-header-cell.component.js +141 -141
- package/esm2015/table/lib/components/table-pager/table-pager.component.js +146 -146
- package/esm2015/table/lib/data/datasource.data.js +32 -32
- package/esm2015/table/lib/data/generic.data.js +73 -73
- package/esm2015/table/lib/interfaces/datasource.interface.js +2 -2
- package/esm2015/table/lib/interfaces/table.interfaces.js +2 -2
- package/esm2015/table/lib/table.module.js +39 -39
- package/esm2015/table/public_api.js +10 -10
- package/fesm2015/bravobit-bb-foundation-auth.js +915 -915
- package/fesm2015/bravobit-bb-foundation-auth.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-collections.js +463 -0
- package/fesm2015/bravobit-bb-foundation-collections.js.map +1 -0
- package/fesm2015/bravobit-bb-foundation-dashboard.js +434 -434
- package/fesm2015/bravobit-bb-foundation-dashboard.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-dialog.js +603 -603
- package/fesm2015/bravobit-bb-foundation-dialog.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-elements.js +2076 -2076
- package/fesm2015/bravobit-bb-foundation-elements.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-http.js +154 -154
- package/fesm2015/bravobit-bb-foundation-http.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-localize.js +796 -796
- package/fesm2015/bravobit-bb-foundation-localize.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-notifications.js +364 -364
- package/fesm2015/bravobit-bb-foundation-notifications.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-recaptcha.js +297 -297
- package/fesm2015/bravobit-bb-foundation-recaptcha.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-rxjs.js +7 -7
- package/fesm2015/bravobit-bb-foundation-rxjs.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-storage.js +399 -399
- package/fesm2015/bravobit-bb-foundation-storage.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation-table.js +578 -578
- package/fesm2015/bravobit-bb-foundation-table.js.map +1 -1
- package/fesm2015/bravobit-bb-foundation.js +851 -851
- package/fesm2015/bravobit-bb-foundation.js.map +1 -1
- package/http/bravobit-bb-foundation-http.d.ts +5 -5
- package/http/lib/classes/http.config.d.ts +9 -9
- package/http/lib/classes/http.error.d.ts +7 -7
- package/http/lib/http.interfaces.d.ts +12 -12
- package/http/lib/http.module.d.ts +15 -15
- package/http/lib/interceptors/base-url.interceptor.d.ts +15 -15
- package/http/lib/interceptors/error.interceptor.d.ts +11 -11
- package/http/public_api.d.ts +6 -6
- package/lib/core/coercions/boolean-coercion.d.ts +1 -1
- package/lib/core/miscellaneous/regex.d.ts +4 -4
- package/lib/core/miscellaneous/validator.d.ts +13 -13
- package/lib/core/mixins/can-disable.d.ts +6 -6
- package/lib/core/mixins/can-hide-errors.d.ts +6 -6
- package/lib/core/mixins/can-load.d.ts +6 -6
- package/lib/core/mixins/constructor.d.ts +1 -1
- package/lib/core/mixins/has-error.d.ts +6 -6
- package/lib/core/mixins/is-focused.d.ts +6 -6
- package/lib/core/mixins/is-grouped.d.ts +6 -6
- package/lib/core/mixins/is-readonly.d.ts +6 -6
- package/lib/core/mixins/is-required.d.ts +6 -6
- package/lib/core/services/clipboard.service.d.ts +18 -18
- package/lib/core/services/exif.service.d.ts +15 -15
- package/lib/core/services/file-loader.service.d.ts +13 -13
- package/lib/core/services/image-converter.service.d.ts +21 -21
- package/lib/core/services/languages.service.d.ts +16 -16
- package/lib/core/services/network.service.d.ts +14 -14
- package/lib/core/services/patch.service.d.ts +16 -16
- package/lib/core/services/platform.service.d.ts +18 -18
- package/lib/core/tokens/accept-language.token.d.ts +2 -2
- package/lib/core/tokens/base-url.token.d.ts +2 -2
- package/lib/core/tokens/cookie.token.d.ts +2 -2
- package/lib/core/tokens/location.token.d.ts +2 -2
- package/lib/core/tokens/navigator.token.d.ts +2 -2
- package/lib/core/tokens/window.token.d.ts +2 -2
- package/localize/bravobit-bb-foundation-localize.d.ts +5 -5
- package/localize/lib/functions/date.function.d.ts +5 -5
- package/localize/lib/functions/lowercase.function.d.ts +5 -5
- package/localize/lib/functions/uppercase.function.d.ts +5 -5
- package/localize/lib/handlers/missing.handler.d.ts +6 -6
- package/localize/lib/interfaces/config.interfaces.d.ts +8 -8
- package/localize/lib/interfaces/dictionary.interfaces.d.ts +12 -12
- package/localize/lib/interfaces/functions.interfaces.d.ts +9 -9
- package/localize/lib/interfaces/handlers.interfaces.d.ts +6 -6
- package/localize/lib/interfaces/options.interfaces.d.ts +10 -10
- package/localize/lib/localizations/dutch.localization.d.ts +51 -51
- package/localize/lib/localizations/english.localization.d.ts +51 -51
- package/localize/lib/localize.dictionary.d.ts +24 -24
- package/localize/lib/localize.module.d.ts +18 -18
- package/localize/lib/localize.pipe.d.ts +12 -12
- package/localize/lib/localize.service.d.ts +51 -51
- package/localize/lib/views/localize-string/localize-string.component.d.ts +23 -23
- package/localize/lib/views/localize-template-or-string.directive.d.ts +10 -10
- package/localize/lib/views/localize-template.directive.d.ts +9 -9
- package/localize/public_api.d.ts +17 -17
- package/notifications/bravobit-bb-foundation-notifications.d.ts +5 -5
- package/notifications/lib/notifications-item/notifications-item.component.d.ts +34 -34
- package/notifications/lib/notifications-list/notifications-list.component.d.ts +16 -16
- package/notifications/lib/notifications.animations.d.ts +1 -1
- package/notifications/lib/notifications.injector.d.ts +8 -8
- package/notifications/lib/notifications.interfaces.d.ts +49 -49
- package/notifications/lib/notifications.module.d.ts +13 -13
- package/notifications/lib/notifications.service.d.ts +34 -34
- package/notifications/public_api.d.ts +3 -3
- package/package.json +5 -5
- package/public_api.d.ts +26 -26
- package/recaptcha/bravobit-bb-foundation-recaptcha.d.ts +5 -5
- package/recaptcha/lib/recaptcha/recaptcha.component.d.ts +47 -47
- package/recaptcha/lib/recaptcha-loader.service.d.ts +22 -22
- package/recaptcha/lib/recaptcha.interface.d.ts +14 -14
- package/recaptcha/lib/recaptcha.module.d.ts +10 -16
- package/recaptcha/public_api.d.ts +4 -4
- package/rxjs/bravobit-bb-foundation-rxjs.d.ts +5 -5
- package/rxjs/lib/operators/combine-latest-map.operator.d.ts +8 -8
- package/rxjs/lib/operators/filter-nil.operator.d.ts +1 -1
- package/rxjs/public_api.d.ts +2 -2
- package/storage/bravobit-bb-foundation-storage.d.ts +5 -5
- package/storage/lib/interfaces/attributes.interface.d.ts +13 -13
- package/storage/lib/interfaces/memory.interface.d.ts +7 -7
- package/storage/lib/interfaces/strategy.interface.d.ts +17 -17
- package/storage/lib/storage.service.d.ts +26 -26
- package/storage/lib/strategies/cookie-storage.strategy.d.ts +20 -20
- package/storage/lib/strategies/memory-storage.strategy.d.ts +11 -11
- package/storage/lib/strategies/polyfill-storage.strategy.d.ts +15 -15
- package/storage/public_api.d.ts +7 -7
- package/table/bravobit-bb-foundation-table.d.ts +5 -5
- package/table/lib/components/table/table.component.d.ts +48 -48
- package/table/lib/components/table-cell/table-cell.component.d.ts +5 -5
- package/table/lib/components/table-header-cell/table-header-cell.component.d.ts +29 -29
- package/table/lib/components/table-pager/table-pager.component.d.ts +41 -41
- package/table/lib/data/datasource.data.d.ts +14 -14
- package/table/lib/data/generic.data.d.ts +23 -23
- package/table/lib/interfaces/datasource.interface.d.ts +17 -17
- package/table/lib/interfaces/table.interfaces.d.ts +1 -1
- package/table/lib/table.module.d.ts +14 -14
- package/table/public_api.d.ts +9 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators'), require('@angular/core'), require('@angular/forms'), require('@bravobit/bb-foundation/elements'), require('@bravobit/bb-foundation'), require('@angular/common'), require('@bravobit/bb-foundation/localize')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@bravobit/bb-foundation/table', ['exports', 'rxjs', 'rxjs/operators', '@angular/core', '@angular/forms', '@bravobit/bb-foundation/elements', '@bravobit/bb-foundation', '@angular/common', '@bravobit/bb-foundation/localize'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.bravobit = global.bravobit || {}, global.bravobit[
|
|
5
|
-
}(this, (function (exports, rxjs, operators, i0, i4, i1, bbFoundation, i3, i5) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.bravobit = global.bravobit || {}, global.bravobit["bb-foundation"] = global.bravobit["bb-foundation"] || {}, global.bravobit["bb-foundation"].table = {}), global.rxjs, global.rxjs.operators, global.ng.core, global.ng.forms, global.bravobit["bb-foundation"].elements, global.bravobit["bb-foundation"], global.ng.common, global.bravobit["bb-foundation"].localize));
|
|
5
|
+
})(this, (function (exports, rxjs, operators, i0, i4, i1, bbFoundation, i3, i5) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -13,14 +13,12 @@
|
|
|
13
13
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
14
|
Object.defineProperty(n, k, d.get ? d : {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () {
|
|
17
|
-
return e[k];
|
|
18
|
-
}
|
|
16
|
+
get: function () { return e[k]; }
|
|
19
17
|
});
|
|
20
18
|
}
|
|
21
19
|
});
|
|
22
20
|
}
|
|
23
|
-
n[
|
|
21
|
+
n["default"] = e;
|
|
24
22
|
return Object.freeze(n);
|
|
25
23
|
}
|
|
26
24
|
|
|
@@ -30,1010 +28,1010 @@
|
|
|
30
28
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
31
29
|
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
32
30
|
|
|
33
|
-
var DataSourceRequest = /** @class */ (function () {
|
|
34
|
-
function DataSourceRequest() {
|
|
35
|
-
// Data.
|
|
36
|
-
this._request$ = new rxjs.BehaviorSubject(null);
|
|
37
|
-
this._loading$ = new rxjs.BehaviorSubject(true);
|
|
38
|
-
}
|
|
39
|
-
Object.defineProperty(DataSourceRequest.prototype, "loading", {
|
|
40
|
-
get: function () {
|
|
41
|
-
return this._loading$.asObservable();
|
|
42
|
-
},
|
|
43
|
-
enumerable: false,
|
|
44
|
-
configurable: true
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(DataSourceRequest.prototype, "when", {
|
|
47
|
-
get: function () {
|
|
48
|
-
return this._request$.pipe(operators.filter(function (data) { return !!data; }));
|
|
49
|
-
},
|
|
50
|
-
enumerable: false,
|
|
51
|
-
configurable: true
|
|
52
|
-
});
|
|
53
|
-
DataSourceRequest.prototype.startLoading = function () {
|
|
54
|
-
this._loading$.next(true);
|
|
55
|
-
};
|
|
56
|
-
DataSourceRequest.prototype.stopLoading = function () {
|
|
57
|
-
this._loading$.next(false);
|
|
58
|
-
};
|
|
59
|
-
DataSourceRequest.prototype.update = function (params) {
|
|
60
|
-
if (params === void 0) { params = {}; }
|
|
61
|
-
var currentValue = this._request$.getValue();
|
|
62
|
-
// Set the page number to 1 if the query or page size was changed.
|
|
63
|
-
if (currentValue && params && ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.query) !== (params === null || params === void 0 ? void 0 : params.query) || (currentValue === null || currentValue === void 0 ? void 0 : currentValue.pageSize) !== (params === null || params === void 0 ? void 0 : params.pageSize))) {
|
|
64
|
-
params.pageNumber = 1;
|
|
65
|
-
}
|
|
66
|
-
this._request$.next(Object.assign(Object.assign({}, currentValue), params));
|
|
67
|
-
};
|
|
68
|
-
return DataSourceRequest;
|
|
69
|
-
}());
|
|
70
|
-
var DataSource = /** @class */ (function () {
|
|
71
|
-
function DataSource() {
|
|
72
|
-
}
|
|
73
|
-
return DataSource;
|
|
31
|
+
var DataSourceRequest = /** @class */ (function () {
|
|
32
|
+
function DataSourceRequest() {
|
|
33
|
+
// Data.
|
|
34
|
+
this._request$ = new rxjs.BehaviorSubject(null);
|
|
35
|
+
this._loading$ = new rxjs.BehaviorSubject(true);
|
|
36
|
+
}
|
|
37
|
+
Object.defineProperty(DataSourceRequest.prototype, "loading", {
|
|
38
|
+
get: function () {
|
|
39
|
+
return this._loading$.asObservable();
|
|
40
|
+
},
|
|
41
|
+
enumerable: false,
|
|
42
|
+
configurable: true
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(DataSourceRequest.prototype, "when", {
|
|
45
|
+
get: function () {
|
|
46
|
+
return this._request$.pipe(operators.filter(function (data) { return !!data; }));
|
|
47
|
+
},
|
|
48
|
+
enumerable: false,
|
|
49
|
+
configurable: true
|
|
50
|
+
});
|
|
51
|
+
DataSourceRequest.prototype.startLoading = function () {
|
|
52
|
+
this._loading$.next(true);
|
|
53
|
+
};
|
|
54
|
+
DataSourceRequest.prototype.stopLoading = function () {
|
|
55
|
+
this._loading$.next(false);
|
|
56
|
+
};
|
|
57
|
+
DataSourceRequest.prototype.update = function (params) {
|
|
58
|
+
if (params === void 0) { params = {}; }
|
|
59
|
+
var currentValue = this._request$.getValue();
|
|
60
|
+
// Set the page number to 1 if the query or page size was changed.
|
|
61
|
+
if (currentValue && params && ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.query) !== (params === null || params === void 0 ? void 0 : params.query) || (currentValue === null || currentValue === void 0 ? void 0 : currentValue.pageSize) !== (params === null || params === void 0 ? void 0 : params.pageSize))) {
|
|
62
|
+
params.pageNumber = 1;
|
|
63
|
+
}
|
|
64
|
+
this._request$.next(Object.assign(Object.assign({}, currentValue), params));
|
|
65
|
+
};
|
|
66
|
+
return DataSourceRequest;
|
|
67
|
+
}());
|
|
68
|
+
var DataSource = /** @class */ (function () {
|
|
69
|
+
function DataSource() {
|
|
70
|
+
}
|
|
71
|
+
return DataSource;
|
|
74
72
|
}());
|
|
75
73
|
|
|
76
|
-
/*! *****************************************************************************
|
|
77
|
-
Copyright (c) Microsoft Corporation.
|
|
78
|
-
|
|
79
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
80
|
-
purpose with or without fee is hereby granted.
|
|
81
|
-
|
|
82
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
83
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
84
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
85
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
86
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
87
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
88
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
89
|
-
***************************************************************************** */
|
|
90
|
-
/* global Reflect, Promise */
|
|
91
|
-
var extendStatics = function (d, b) {
|
|
92
|
-
extendStatics = Object.setPrototypeOf ||
|
|
93
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
94
|
-
function (d, b) { for (var p in b)
|
|
95
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
96
|
-
d[p] = b[p]; };
|
|
97
|
-
return extendStatics(d, b);
|
|
98
|
-
};
|
|
99
|
-
function __extends(d, b) {
|
|
100
|
-
if (typeof b !== "function" && b !== null)
|
|
101
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
102
|
-
extendStatics(d, b);
|
|
103
|
-
function __() { this.constructor = d; }
|
|
104
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
105
|
-
}
|
|
106
|
-
var __assign = function () {
|
|
107
|
-
__assign = Object.assign || function __assign(t) {
|
|
108
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
109
|
-
s = arguments[i];
|
|
110
|
-
for (var p in s)
|
|
111
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
112
|
-
t[p] = s[p];
|
|
113
|
-
}
|
|
114
|
-
return t;
|
|
115
|
-
};
|
|
116
|
-
return __assign.apply(this, arguments);
|
|
117
|
-
};
|
|
118
|
-
function __rest(s, e) {
|
|
119
|
-
var t = {};
|
|
120
|
-
for (var p in s)
|
|
121
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
122
|
-
t[p] = s[p];
|
|
123
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
124
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
125
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
126
|
-
t[p[i]] = s[p[i]];
|
|
127
|
-
}
|
|
128
|
-
return t;
|
|
129
|
-
}
|
|
130
|
-
function __decorate(decorators, target, key, desc) {
|
|
131
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
132
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
133
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
134
|
-
else
|
|
135
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
136
|
-
if (d = decorators[i])
|
|
137
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
138
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
139
|
-
}
|
|
140
|
-
function __param(paramIndex, decorator) {
|
|
141
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
142
|
-
}
|
|
143
|
-
function __metadata(metadataKey, metadataValue) {
|
|
144
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
145
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
146
|
-
}
|
|
147
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
148
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
149
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
150
|
-
function fulfilled(value) { try {
|
|
151
|
-
step(generator.next(value));
|
|
152
|
-
}
|
|
153
|
-
catch (e) {
|
|
154
|
-
reject(e);
|
|
155
|
-
} }
|
|
156
|
-
function rejected(value) { try {
|
|
157
|
-
step(generator["throw"](value));
|
|
158
|
-
}
|
|
159
|
-
catch (e) {
|
|
160
|
-
reject(e);
|
|
161
|
-
} }
|
|
162
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
163
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
function __generator(thisArg, body) {
|
|
167
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
168
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
169
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
170
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
171
|
-
function step(op) {
|
|
172
|
-
if (f)
|
|
173
|
-
throw new TypeError("Generator is already executing.");
|
|
174
|
-
while (_)
|
|
175
|
-
try {
|
|
176
|
-
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)
|
|
177
|
-
return t;
|
|
178
|
-
if (y = 0, t)
|
|
179
|
-
op = [op[0] & 2, t.value];
|
|
180
|
-
switch (op[0]) {
|
|
181
|
-
case 0:
|
|
182
|
-
case 1:
|
|
183
|
-
t = op;
|
|
184
|
-
break;
|
|
185
|
-
case 4:
|
|
186
|
-
_.label++;
|
|
187
|
-
return { value: op[1], done: false };
|
|
188
|
-
case 5:
|
|
189
|
-
_.label++;
|
|
190
|
-
y = op[1];
|
|
191
|
-
op = [0];
|
|
192
|
-
continue;
|
|
193
|
-
case 7:
|
|
194
|
-
op = _.ops.pop();
|
|
195
|
-
_.trys.pop();
|
|
196
|
-
continue;
|
|
197
|
-
default:
|
|
198
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
199
|
-
_ = 0;
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
203
|
-
_.label = op[1];
|
|
204
|
-
break;
|
|
205
|
-
}
|
|
206
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
207
|
-
_.label = t[1];
|
|
208
|
-
t = op;
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
if (t && _.label < t[2]) {
|
|
212
|
-
_.label = t[2];
|
|
213
|
-
_.ops.push(op);
|
|
214
|
-
break;
|
|
215
|
-
}
|
|
216
|
-
if (t[2])
|
|
217
|
-
_.ops.pop();
|
|
218
|
-
_.trys.pop();
|
|
219
|
-
continue;
|
|
220
|
-
}
|
|
221
|
-
op = body.call(thisArg, _);
|
|
222
|
-
}
|
|
223
|
-
catch (e) {
|
|
224
|
-
op = [6, e];
|
|
225
|
-
y = 0;
|
|
226
|
-
}
|
|
227
|
-
finally {
|
|
228
|
-
f = t = 0;
|
|
229
|
-
}
|
|
230
|
-
if (op[0] & 5)
|
|
231
|
-
throw op[1];
|
|
232
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
236
|
-
if (k2 === undefined)
|
|
237
|
-
k2 = k;
|
|
238
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
239
|
-
}) : (function (o, m, k, k2) {
|
|
240
|
-
if (k2 === undefined)
|
|
241
|
-
k2 = k;
|
|
242
|
-
o[k2] = m[k];
|
|
243
|
-
});
|
|
244
|
-
function __exportStar(m, o) {
|
|
245
|
-
for (var p in m)
|
|
246
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
247
|
-
__createBinding(o, m, p);
|
|
248
|
-
}
|
|
249
|
-
function __values(o) {
|
|
250
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
251
|
-
if (m)
|
|
252
|
-
return m.call(o);
|
|
253
|
-
if (o && typeof o.length === "number")
|
|
254
|
-
return {
|
|
255
|
-
next: function () {
|
|
256
|
-
if (o && i >= o.length)
|
|
257
|
-
o = void 0;
|
|
258
|
-
return { value: o && o[i++], done: !o };
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
262
|
-
}
|
|
263
|
-
function __read(o, n) {
|
|
264
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
265
|
-
if (!m)
|
|
266
|
-
return o;
|
|
267
|
-
var i = m.call(o), r, ar = [], e;
|
|
268
|
-
try {
|
|
269
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
270
|
-
ar.push(r.value);
|
|
271
|
-
}
|
|
272
|
-
catch (error) {
|
|
273
|
-
e = { error: error };
|
|
274
|
-
}
|
|
275
|
-
finally {
|
|
276
|
-
try {
|
|
277
|
-
if (r && !r.done && (m = i["return"]))
|
|
278
|
-
m.call(i);
|
|
279
|
-
}
|
|
280
|
-
finally {
|
|
281
|
-
if (e)
|
|
282
|
-
throw e.error;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
return ar;
|
|
286
|
-
}
|
|
287
|
-
/** @deprecated */
|
|
288
|
-
function __spread() {
|
|
289
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
290
|
-
ar = ar.concat(__read(arguments[i]));
|
|
291
|
-
return ar;
|
|
292
|
-
}
|
|
293
|
-
/** @deprecated */
|
|
294
|
-
function __spreadArrays() {
|
|
295
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
296
|
-
s += arguments[i].length;
|
|
297
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
298
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
299
|
-
r[k] = a[j];
|
|
300
|
-
return r;
|
|
301
|
-
}
|
|
302
|
-
function __spreadArray(to, from, pack) {
|
|
303
|
-
if (pack || arguments.length === 2)
|
|
304
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
305
|
-
if (ar || !(i in from)) {
|
|
306
|
-
if (!ar)
|
|
307
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
308
|
-
ar[i] = from[i];
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
return to.concat(ar || from);
|
|
312
|
-
}
|
|
313
|
-
function __await(v) {
|
|
314
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
315
|
-
}
|
|
316
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
317
|
-
if (!Symbol.asyncIterator)
|
|
318
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
319
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
320
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
321
|
-
function verb(n) { if (g[n])
|
|
322
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
323
|
-
function resume(n, v) { try {
|
|
324
|
-
step(g[n](v));
|
|
325
|
-
}
|
|
326
|
-
catch (e) {
|
|
327
|
-
settle(q[0][3], e);
|
|
328
|
-
} }
|
|
329
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
330
|
-
function fulfill(value) { resume("next", value); }
|
|
331
|
-
function reject(value) { resume("throw", value); }
|
|
332
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
333
|
-
resume(q[0][0], q[0][1]); }
|
|
334
|
-
}
|
|
335
|
-
function __asyncDelegator(o) {
|
|
336
|
-
var i, p;
|
|
337
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
338
|
-
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; }
|
|
339
|
-
}
|
|
340
|
-
function __asyncValues(o) {
|
|
341
|
-
if (!Symbol.asyncIterator)
|
|
342
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
343
|
-
var m = o[Symbol.asyncIterator], i;
|
|
344
|
-
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);
|
|
345
|
-
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); }); }; }
|
|
346
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
347
|
-
}
|
|
348
|
-
function __makeTemplateObject(cooked, raw) {
|
|
349
|
-
if (Object.defineProperty) {
|
|
350
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
351
|
-
}
|
|
352
|
-
else {
|
|
353
|
-
cooked.raw = raw;
|
|
354
|
-
}
|
|
355
|
-
return cooked;
|
|
356
|
-
}
|
|
357
|
-
;
|
|
358
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
359
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
360
|
-
}) : function (o, v) {
|
|
361
|
-
o["default"] = v;
|
|
362
|
-
};
|
|
363
|
-
function __importStar(mod) {
|
|
364
|
-
if (mod && mod.__esModule)
|
|
365
|
-
return mod;
|
|
366
|
-
var result = {};
|
|
367
|
-
if (mod != null)
|
|
368
|
-
for (var k in mod)
|
|
369
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
370
|
-
__createBinding(result, mod, k);
|
|
371
|
-
__setModuleDefault(result, mod);
|
|
372
|
-
return result;
|
|
373
|
-
}
|
|
374
|
-
function __importDefault(mod) {
|
|
375
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
376
|
-
}
|
|
377
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
378
|
-
if (kind === "a" && !f)
|
|
379
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
380
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
381
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
382
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
383
|
-
}
|
|
384
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
385
|
-
if (kind === "m")
|
|
386
|
-
throw new TypeError("Private method is not writable");
|
|
387
|
-
if (kind === "a" && !f)
|
|
388
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
389
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
390
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
391
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
74
|
+
/*! *****************************************************************************
|
|
75
|
+
Copyright (c) Microsoft Corporation.
|
|
76
|
+
|
|
77
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
78
|
+
purpose with or without fee is hereby granted.
|
|
79
|
+
|
|
80
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
81
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
82
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
83
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
84
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
85
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
86
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
87
|
+
***************************************************************************** */
|
|
88
|
+
/* global Reflect, Promise */
|
|
89
|
+
var extendStatics = function (d, b) {
|
|
90
|
+
extendStatics = Object.setPrototypeOf ||
|
|
91
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
92
|
+
function (d, b) { for (var p in b)
|
|
93
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
94
|
+
d[p] = b[p]; };
|
|
95
|
+
return extendStatics(d, b);
|
|
96
|
+
};
|
|
97
|
+
function __extends(d, b) {
|
|
98
|
+
if (typeof b !== "function" && b !== null)
|
|
99
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
100
|
+
extendStatics(d, b);
|
|
101
|
+
function __() { this.constructor = d; }
|
|
102
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
103
|
+
}
|
|
104
|
+
var __assign = function () {
|
|
105
|
+
__assign = Object.assign || function __assign(t) {
|
|
106
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
107
|
+
s = arguments[i];
|
|
108
|
+
for (var p in s)
|
|
109
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
110
|
+
t[p] = s[p];
|
|
111
|
+
}
|
|
112
|
+
return t;
|
|
113
|
+
};
|
|
114
|
+
return __assign.apply(this, arguments);
|
|
115
|
+
};
|
|
116
|
+
function __rest(s, e) {
|
|
117
|
+
var t = {};
|
|
118
|
+
for (var p in s)
|
|
119
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
120
|
+
t[p] = s[p];
|
|
121
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
122
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
123
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
124
|
+
t[p[i]] = s[p[i]];
|
|
125
|
+
}
|
|
126
|
+
return t;
|
|
127
|
+
}
|
|
128
|
+
function __decorate(decorators, target, key, desc) {
|
|
129
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
130
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
131
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
132
|
+
else
|
|
133
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
134
|
+
if (d = decorators[i])
|
|
135
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
136
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
137
|
+
}
|
|
138
|
+
function __param(paramIndex, decorator) {
|
|
139
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
140
|
+
}
|
|
141
|
+
function __metadata(metadataKey, metadataValue) {
|
|
142
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
143
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
144
|
+
}
|
|
145
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
146
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
147
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
148
|
+
function fulfilled(value) { try {
|
|
149
|
+
step(generator.next(value));
|
|
150
|
+
}
|
|
151
|
+
catch (e) {
|
|
152
|
+
reject(e);
|
|
153
|
+
} }
|
|
154
|
+
function rejected(value) { try {
|
|
155
|
+
step(generator["throw"](value));
|
|
156
|
+
}
|
|
157
|
+
catch (e) {
|
|
158
|
+
reject(e);
|
|
159
|
+
} }
|
|
160
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
161
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function __generator(thisArg, body) {
|
|
165
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
166
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
167
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
168
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
169
|
+
function step(op) {
|
|
170
|
+
if (f)
|
|
171
|
+
throw new TypeError("Generator is already executing.");
|
|
172
|
+
while (_)
|
|
173
|
+
try {
|
|
174
|
+
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)
|
|
175
|
+
return t;
|
|
176
|
+
if (y = 0, t)
|
|
177
|
+
op = [op[0] & 2, t.value];
|
|
178
|
+
switch (op[0]) {
|
|
179
|
+
case 0:
|
|
180
|
+
case 1:
|
|
181
|
+
t = op;
|
|
182
|
+
break;
|
|
183
|
+
case 4:
|
|
184
|
+
_.label++;
|
|
185
|
+
return { value: op[1], done: false };
|
|
186
|
+
case 5:
|
|
187
|
+
_.label++;
|
|
188
|
+
y = op[1];
|
|
189
|
+
op = [0];
|
|
190
|
+
continue;
|
|
191
|
+
case 7:
|
|
192
|
+
op = _.ops.pop();
|
|
193
|
+
_.trys.pop();
|
|
194
|
+
continue;
|
|
195
|
+
default:
|
|
196
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
197
|
+
_ = 0;
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
201
|
+
_.label = op[1];
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
205
|
+
_.label = t[1];
|
|
206
|
+
t = op;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
if (t && _.label < t[2]) {
|
|
210
|
+
_.label = t[2];
|
|
211
|
+
_.ops.push(op);
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
if (t[2])
|
|
215
|
+
_.ops.pop();
|
|
216
|
+
_.trys.pop();
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
op = body.call(thisArg, _);
|
|
220
|
+
}
|
|
221
|
+
catch (e) {
|
|
222
|
+
op = [6, e];
|
|
223
|
+
y = 0;
|
|
224
|
+
}
|
|
225
|
+
finally {
|
|
226
|
+
f = t = 0;
|
|
227
|
+
}
|
|
228
|
+
if (op[0] & 5)
|
|
229
|
+
throw op[1];
|
|
230
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
234
|
+
if (k2 === undefined)
|
|
235
|
+
k2 = k;
|
|
236
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
237
|
+
}) : (function (o, m, k, k2) {
|
|
238
|
+
if (k2 === undefined)
|
|
239
|
+
k2 = k;
|
|
240
|
+
o[k2] = m[k];
|
|
241
|
+
});
|
|
242
|
+
function __exportStar(m, o) {
|
|
243
|
+
for (var p in m)
|
|
244
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
245
|
+
__createBinding(o, m, p);
|
|
246
|
+
}
|
|
247
|
+
function __values(o) {
|
|
248
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
249
|
+
if (m)
|
|
250
|
+
return m.call(o);
|
|
251
|
+
if (o && typeof o.length === "number")
|
|
252
|
+
return {
|
|
253
|
+
next: function () {
|
|
254
|
+
if (o && i >= o.length)
|
|
255
|
+
o = void 0;
|
|
256
|
+
return { value: o && o[i++], done: !o };
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
260
|
+
}
|
|
261
|
+
function __read(o, n) {
|
|
262
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
263
|
+
if (!m)
|
|
264
|
+
return o;
|
|
265
|
+
var i = m.call(o), r, ar = [], e;
|
|
266
|
+
try {
|
|
267
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
268
|
+
ar.push(r.value);
|
|
269
|
+
}
|
|
270
|
+
catch (error) {
|
|
271
|
+
e = { error: error };
|
|
272
|
+
}
|
|
273
|
+
finally {
|
|
274
|
+
try {
|
|
275
|
+
if (r && !r.done && (m = i["return"]))
|
|
276
|
+
m.call(i);
|
|
277
|
+
}
|
|
278
|
+
finally {
|
|
279
|
+
if (e)
|
|
280
|
+
throw e.error;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return ar;
|
|
284
|
+
}
|
|
285
|
+
/** @deprecated */
|
|
286
|
+
function __spread() {
|
|
287
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
288
|
+
ar = ar.concat(__read(arguments[i]));
|
|
289
|
+
return ar;
|
|
290
|
+
}
|
|
291
|
+
/** @deprecated */
|
|
292
|
+
function __spreadArrays() {
|
|
293
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
294
|
+
s += arguments[i].length;
|
|
295
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
296
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
297
|
+
r[k] = a[j];
|
|
298
|
+
return r;
|
|
299
|
+
}
|
|
300
|
+
function __spreadArray(to, from, pack) {
|
|
301
|
+
if (pack || arguments.length === 2)
|
|
302
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
303
|
+
if (ar || !(i in from)) {
|
|
304
|
+
if (!ar)
|
|
305
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
306
|
+
ar[i] = from[i];
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
310
|
+
}
|
|
311
|
+
function __await(v) {
|
|
312
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
313
|
+
}
|
|
314
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
315
|
+
if (!Symbol.asyncIterator)
|
|
316
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
317
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
318
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
319
|
+
function verb(n) { if (g[n])
|
|
320
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
321
|
+
function resume(n, v) { try {
|
|
322
|
+
step(g[n](v));
|
|
323
|
+
}
|
|
324
|
+
catch (e) {
|
|
325
|
+
settle(q[0][3], e);
|
|
326
|
+
} }
|
|
327
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
328
|
+
function fulfill(value) { resume("next", value); }
|
|
329
|
+
function reject(value) { resume("throw", value); }
|
|
330
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
331
|
+
resume(q[0][0], q[0][1]); }
|
|
332
|
+
}
|
|
333
|
+
function __asyncDelegator(o) {
|
|
334
|
+
var i, p;
|
|
335
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
336
|
+
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; }
|
|
337
|
+
}
|
|
338
|
+
function __asyncValues(o) {
|
|
339
|
+
if (!Symbol.asyncIterator)
|
|
340
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
341
|
+
var m = o[Symbol.asyncIterator], i;
|
|
342
|
+
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);
|
|
343
|
+
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); }); }; }
|
|
344
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
345
|
+
}
|
|
346
|
+
function __makeTemplateObject(cooked, raw) {
|
|
347
|
+
if (Object.defineProperty) {
|
|
348
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
cooked.raw = raw;
|
|
352
|
+
}
|
|
353
|
+
return cooked;
|
|
354
|
+
}
|
|
355
|
+
;
|
|
356
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
357
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
358
|
+
}) : function (o, v) {
|
|
359
|
+
o["default"] = v;
|
|
360
|
+
};
|
|
361
|
+
function __importStar(mod) {
|
|
362
|
+
if (mod && mod.__esModule)
|
|
363
|
+
return mod;
|
|
364
|
+
var result = {};
|
|
365
|
+
if (mod != null)
|
|
366
|
+
for (var k in mod)
|
|
367
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
368
|
+
__createBinding(result, mod, k);
|
|
369
|
+
__setModuleDefault(result, mod);
|
|
370
|
+
return result;
|
|
371
|
+
}
|
|
372
|
+
function __importDefault(mod) {
|
|
373
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
374
|
+
}
|
|
375
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
376
|
+
if (kind === "a" && !f)
|
|
377
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
378
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
379
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
380
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
381
|
+
}
|
|
382
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
383
|
+
if (kind === "m")
|
|
384
|
+
throw new TypeError("Private method is not writable");
|
|
385
|
+
if (kind === "a" && !f)
|
|
386
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
387
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
388
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
389
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
392
390
|
}
|
|
393
391
|
|
|
394
|
-
var GenericDataSource = /** @class */ (function (_super) {
|
|
395
|
-
__extends(GenericDataSource, _super);
|
|
396
|
-
function GenericDataSource(httpClient, endpoint) {
|
|
397
|
-
var _this = _super.call(this) || this;
|
|
398
|
-
// Data.
|
|
399
|
-
_this._items$ = new rxjs.BehaviorSubject([]);
|
|
400
|
-
_this._fn = function (data) { return data; };
|
|
401
|
-
_this.formatResponse = function (data) {
|
|
402
|
-
return {
|
|
403
|
-
pageSize: data === null || data === void 0 ? void 0 : data['page_size'],
|
|
404
|
-
pageNumber: data === null || data === void 0 ? void 0 : data['page_number'],
|
|
405
|
-
totalPages: data === null || data === void 0 ? void 0 : data['total_pages'],
|
|
406
|
-
totalEntries: data === null || data === void 0 ? void 0 : data['total_entries'],
|
|
407
|
-
data: data === null || data === void 0 ? void 0 : data['data']
|
|
408
|
-
};
|
|
409
|
-
};
|
|
410
|
-
_this.formatParams = function (data) {
|
|
411
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
412
|
-
var params = {};
|
|
413
|
-
params['page'] = "" + ((_a = data === null || data === void 0 ? void 0 : data.pageNumber) !== null && _a !== void 0 ? _a : 1);
|
|
414
|
-
params['page_size'] = "" + ((_b = data === null || data === void 0 ? void 0 : data.pageSize) !== null && _b !== void 0 ? _b : 25);
|
|
415
|
-
var sort = ((_c = data === null || data === void 0 ? void 0 : data.sort) !== null && _c !== void 0 ? _c : [])
|
|
416
|
-
.map(function (_h) {
|
|
417
|
-
var name = _h.name;
|
|
418
|
-
return name;
|
|
419
|
-
})
|
|
420
|
-
.filter(function (name) { return !!name; })
|
|
421
|
-
.join(',');
|
|
422
|
-
var sortDirection = ((_d = data === null || data === void 0 ? void 0 : data.sort) !== null && _d !== void 0 ? _d : [])
|
|
423
|
-
.map(function (_h) {
|
|
424
|
-
var direction = _h.direction;
|
|
425
|
-
return direction;
|
|
426
|
-
})
|
|
427
|
-
.filter(function (direction) { return !!direction; })
|
|
428
|
-
.join(',');
|
|
429
|
-
if ((sort === null || sort === void 0 ? void 0 : sort.length) > 0 && (sortDirection === null || sortDirection === void 0 ? void 0 : sortDirection.length) > 0) {
|
|
430
|
-
params['sort'] = sort;
|
|
431
|
-
params['sort_direction'] = sortDirection;
|
|
432
|
-
}
|
|
433
|
-
if ((data === null || data === void 0 ? void 0 : data.query) && ((_e = data === null || data === void 0 ? void 0 : data.query) === null || _e === void 0 ? void 0 : _e.length) > 0 && (data === null || data === void 0 ? void 0 : data.queryFields) && ((_f = data === null || data === void 0 ? void 0 : data.queryFields) === null || _f === void 0 ? void 0 : _f.length) > 0) {
|
|
434
|
-
params['query'] = data === null || data === void 0 ? void 0 : data.query;
|
|
435
|
-
params['query_fields'] = (_g = data === null || data === void 0 ? void 0 : data.queryFields) === null || _g === void 0 ? void 0 : _g.join(',');
|
|
436
|
-
}
|
|
437
|
-
return params;
|
|
438
|
-
};
|
|
439
|
-
_this._httpClient = httpClient;
|
|
440
|
-
_this._endpoint$ = typeof endpoint === 'string'
|
|
441
|
-
? rxjs.of(endpoint)
|
|
442
|
-
: endpoint;
|
|
443
|
-
return _this;
|
|
444
|
-
}
|
|
445
|
-
GenericDataSource.prototype.append = function (item) {
|
|
446
|
-
var currentValue = this._items$.getValue();
|
|
447
|
-
var newValue = __spreadArray(__spreadArray([], __read(currentValue)), [item]);
|
|
448
|
-
this._items$.next(newValue);
|
|
449
|
-
return this;
|
|
450
|
-
};
|
|
451
|
-
GenericDataSource.prototype.data = function (fn) {
|
|
452
|
-
this._fn = fn;
|
|
453
|
-
return this;
|
|
454
|
-
};
|
|
455
|
-
GenericDataSource.prototype.handle = function (request) {
|
|
456
|
-
var _this = this;
|
|
457
|
-
var extraParams$ = this._items$.pipe(operators.switchMap(function (items) { return (items === null || items === void 0 ? void 0 : items.length) <= 0 ? rxjs.of([]) : rxjs.combineLatest(items); }), operators.map(function (items) { return items.reduce(function (previous, current) { return (Object.assign(Object.assign({}, previous), (current !== null && current !== void 0 ? current : {}))); }, {}); }));
|
|
458
|
-
return rxjs.combineLatest([request.when, this._endpoint$, extraParams$]).pipe(operators.switchMap(function (_h) {
|
|
459
|
-
var _j = __read(_h, 3), params = _j[0], endpoint = _j[1], extraParams = _j[2];
|
|
460
|
-
// Start the loading.
|
|
461
|
-
request.startLoading();
|
|
462
|
-
var formattedParams = _this.formatParams(params);
|
|
463
|
-
var combinedParams = Object.assign(Object.assign({}, formattedParams), extraParams);
|
|
464
|
-
return _this._httpClient.get(endpoint, {
|
|
465
|
-
params: combinedParams
|
|
466
|
-
}).pipe(operators.map(function (data) { return _this.formatResponse(data); }), operators.map(function (result) {
|
|
467
|
-
var _a;
|
|
468
|
-
return (Object.assign(Object.assign({}, result), { data: _this._fn((_a = result === null || result === void 0 ? void 0 : result.data) !== null && _a !== void 0 ? _a : []) }));
|
|
469
|
-
}));
|
|
470
|
-
}), operators.share());
|
|
471
|
-
};
|
|
472
|
-
return GenericDataSource;
|
|
392
|
+
var GenericDataSource = /** @class */ (function (_super) {
|
|
393
|
+
__extends(GenericDataSource, _super);
|
|
394
|
+
function GenericDataSource(httpClient, endpoint) {
|
|
395
|
+
var _this = _super.call(this) || this;
|
|
396
|
+
// Data.
|
|
397
|
+
_this._items$ = new rxjs.BehaviorSubject([]);
|
|
398
|
+
_this._fn = function (data) { return data; };
|
|
399
|
+
_this.formatResponse = function (data) {
|
|
400
|
+
return {
|
|
401
|
+
pageSize: data === null || data === void 0 ? void 0 : data['page_size'],
|
|
402
|
+
pageNumber: data === null || data === void 0 ? void 0 : data['page_number'],
|
|
403
|
+
totalPages: data === null || data === void 0 ? void 0 : data['total_pages'],
|
|
404
|
+
totalEntries: data === null || data === void 0 ? void 0 : data['total_entries'],
|
|
405
|
+
data: data === null || data === void 0 ? void 0 : data['data']
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
_this.formatParams = function (data) {
|
|
409
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
410
|
+
var params = {};
|
|
411
|
+
params['page'] = "" + ((_a = data === null || data === void 0 ? void 0 : data.pageNumber) !== null && _a !== void 0 ? _a : 1);
|
|
412
|
+
params['page_size'] = "" + ((_b = data === null || data === void 0 ? void 0 : data.pageSize) !== null && _b !== void 0 ? _b : 25);
|
|
413
|
+
var sort = ((_c = data === null || data === void 0 ? void 0 : data.sort) !== null && _c !== void 0 ? _c : [])
|
|
414
|
+
.map(function (_h) {
|
|
415
|
+
var name = _h.name;
|
|
416
|
+
return name;
|
|
417
|
+
})
|
|
418
|
+
.filter(function (name) { return !!name; })
|
|
419
|
+
.join(',');
|
|
420
|
+
var sortDirection = ((_d = data === null || data === void 0 ? void 0 : data.sort) !== null && _d !== void 0 ? _d : [])
|
|
421
|
+
.map(function (_h) {
|
|
422
|
+
var direction = _h.direction;
|
|
423
|
+
return direction;
|
|
424
|
+
})
|
|
425
|
+
.filter(function (direction) { return !!direction; })
|
|
426
|
+
.join(',');
|
|
427
|
+
if ((sort === null || sort === void 0 ? void 0 : sort.length) > 0 && (sortDirection === null || sortDirection === void 0 ? void 0 : sortDirection.length) > 0) {
|
|
428
|
+
params['sort'] = sort;
|
|
429
|
+
params['sort_direction'] = sortDirection;
|
|
430
|
+
}
|
|
431
|
+
if ((data === null || data === void 0 ? void 0 : data.query) && ((_e = data === null || data === void 0 ? void 0 : data.query) === null || _e === void 0 ? void 0 : _e.length) > 0 && (data === null || data === void 0 ? void 0 : data.queryFields) && ((_f = data === null || data === void 0 ? void 0 : data.queryFields) === null || _f === void 0 ? void 0 : _f.length) > 0) {
|
|
432
|
+
params['query'] = data === null || data === void 0 ? void 0 : data.query;
|
|
433
|
+
params['query_fields'] = (_g = data === null || data === void 0 ? void 0 : data.queryFields) === null || _g === void 0 ? void 0 : _g.join(',');
|
|
434
|
+
}
|
|
435
|
+
return params;
|
|
436
|
+
};
|
|
437
|
+
_this._httpClient = httpClient;
|
|
438
|
+
_this._endpoint$ = typeof endpoint === 'string'
|
|
439
|
+
? rxjs.of(endpoint)
|
|
440
|
+
: endpoint;
|
|
441
|
+
return _this;
|
|
442
|
+
}
|
|
443
|
+
GenericDataSource.prototype.append = function (item) {
|
|
444
|
+
var currentValue = this._items$.getValue();
|
|
445
|
+
var newValue = __spreadArray(__spreadArray([], __read(currentValue)), [item]);
|
|
446
|
+
this._items$.next(newValue);
|
|
447
|
+
return this;
|
|
448
|
+
};
|
|
449
|
+
GenericDataSource.prototype.data = function (fn) {
|
|
450
|
+
this._fn = fn;
|
|
451
|
+
return this;
|
|
452
|
+
};
|
|
453
|
+
GenericDataSource.prototype.handle = function (request) {
|
|
454
|
+
var _this = this;
|
|
455
|
+
var extraParams$ = this._items$.pipe(operators.switchMap(function (items) { return (items === null || items === void 0 ? void 0 : items.length) <= 0 ? rxjs.of([]) : rxjs.combineLatest(items); }), operators.map(function (items) { return items.reduce(function (previous, current) { return (Object.assign(Object.assign({}, previous), (current !== null && current !== void 0 ? current : {}))); }, {}); }));
|
|
456
|
+
return rxjs.combineLatest([request.when, this._endpoint$, extraParams$]).pipe(operators.switchMap(function (_h) {
|
|
457
|
+
var _j = __read(_h, 3), params = _j[0], endpoint = _j[1], extraParams = _j[2];
|
|
458
|
+
// Start the loading.
|
|
459
|
+
request.startLoading();
|
|
460
|
+
var formattedParams = _this.formatParams(params);
|
|
461
|
+
var combinedParams = Object.assign(Object.assign({}, formattedParams), extraParams);
|
|
462
|
+
return _this._httpClient.get(endpoint, {
|
|
463
|
+
params: combinedParams
|
|
464
|
+
}).pipe(operators.map(function (data) { return _this.formatResponse(data); }), operators.map(function (result) {
|
|
465
|
+
var _a;
|
|
466
|
+
return (Object.assign(Object.assign({}, result), { data: _this._fn((_a = result === null || result === void 0 ? void 0 : result.data) !== null && _a !== void 0 ? _a : []) }));
|
|
467
|
+
}));
|
|
468
|
+
}), operators.share());
|
|
469
|
+
};
|
|
470
|
+
return GenericDataSource;
|
|
473
471
|
}(DataSource));
|
|
474
472
|
|
|
475
|
-
var BbTablePagerBase = /** @class */ (function () {
|
|
476
|
-
function BbTablePagerBase() {
|
|
477
|
-
}
|
|
478
|
-
return BbTablePagerBase;
|
|
479
|
-
}());
|
|
480
|
-
var BbTablePagerMixinBase = bbFoundation.mixinDisabled(BbTablePagerBase);
|
|
481
|
-
var BbTablePager = /** @class */ (function (_super) {
|
|
482
|
-
__extends(BbTablePager, _super);
|
|
483
|
-
function BbTablePager() {
|
|
484
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
485
|
-
// Inputs.
|
|
486
|
-
_this.amountOfButtons = 5;
|
|
487
|
-
_this.showArrowButtons = true;
|
|
488
|
-
// Methods.
|
|
489
|
-
_this.onChange = function () { return ({}); };
|
|
490
|
-
_this.onTouched = function () { return ({}); };
|
|
491
|
-
_this.trackByIndex = function (_, item) { return item.page; };
|
|
492
|
-
// Data.
|
|
493
|
-
_this._totalPages$ = new rxjs.BehaviorSubject(1);
|
|
494
|
-
_this._pageNumber$ = new rxjs.BehaviorSubject(1);
|
|
495
|
-
return _this;
|
|
496
|
-
}
|
|
497
|
-
BbTablePager.prototype.ngOnInit = function () {
|
|
498
|
-
var _this = this;
|
|
499
|
-
// Validate the previous button is disabled.
|
|
500
|
-
this.isPreviousDisabled$ = this._pageNumber$.pipe(operators.map(function (pageNumber) { return pageNumber === 1; }));
|
|
501
|
-
// Validate the next button is disabled.
|
|
502
|
-
this.isNextDisabled$ = rxjs.combineLatest([this._pageNumber$, this._totalPages$]).pipe(operators.map(function (_a) {
|
|
503
|
-
var _b = __read(_a, 2), pageNumber = _b[0], totalPages = _b[1];
|
|
504
|
-
return pageNumber === totalPages;
|
|
505
|
-
}));
|
|
506
|
-
// Create the list with page numbers.
|
|
507
|
-
this.list$ = rxjs.combineLatest([this._pageNumber$, this._totalPages$]).pipe(operators.map(function (_a) {
|
|
508
|
-
var _b = __read(_a, 2), pageNumber = _b[0], totalPages = _b[1];
|
|
509
|
-
return _this.filterActivePages(pageNumber, totalPages);
|
|
510
|
-
}), operators.share());
|
|
511
|
-
};
|
|
512
|
-
Object.defineProperty(BbTablePager.prototype, "pageNumber", {
|
|
513
|
-
get: function () {
|
|
514
|
-
return this._pageNumber$.getValue();
|
|
515
|
-
},
|
|
516
|
-
set: function (newValue) {
|
|
517
|
-
this.update(newValue);
|
|
518
|
-
},
|
|
519
|
-
enumerable: false,
|
|
520
|
-
configurable: true
|
|
521
|
-
});
|
|
522
|
-
Object.defineProperty(BbTablePager.prototype, "totalPages", {
|
|
523
|
-
get: function () {
|
|
524
|
-
return this._totalPages$.getValue();
|
|
525
|
-
},
|
|
526
|
-
set: function (newValue) {
|
|
527
|
-
var newTotalPages = Math.max(1, newValue);
|
|
528
|
-
this._totalPages$.next(newTotalPages);
|
|
529
|
-
},
|
|
530
|
-
enumerable: false,
|
|
531
|
-
configurable: true
|
|
532
|
-
});
|
|
533
|
-
BbTablePager.prototype.registerOnChange = function (fn) {
|
|
534
|
-
this.onChange = fn;
|
|
535
|
-
};
|
|
536
|
-
BbTablePager.prototype.registerOnTouched = function (fn) {
|
|
537
|
-
this.onTouched = fn;
|
|
538
|
-
};
|
|
539
|
-
BbTablePager.prototype.setDisabledState = function (isDisabled) {
|
|
540
|
-
this.disabled = isDisabled;
|
|
541
|
-
};
|
|
542
|
-
BbTablePager.prototype.writeValue = function (newValue) {
|
|
543
|
-
this.update(newValue, false);
|
|
544
|
-
};
|
|
545
|
-
BbTablePager.prototype.goToPrevious = function () {
|
|
546
|
-
var newValue = this._pageNumber$.getValue() - 1;
|
|
547
|
-
return this.update(newValue);
|
|
548
|
-
};
|
|
549
|
-
BbTablePager.prototype.goToNext = function () {
|
|
550
|
-
var newValue = this._pageNumber$.getValue() + 1;
|
|
551
|
-
return this.update(newValue);
|
|
552
|
-
};
|
|
553
|
-
BbTablePager.prototype.goToIndex = function (index) {
|
|
554
|
-
return this.update(index);
|
|
555
|
-
};
|
|
556
|
-
BbTablePager.prototype.update = function (pageNumber, notify) {
|
|
557
|
-
if (notify === void 0) { notify = true; }
|
|
558
|
-
// You can only update when not disabled.
|
|
559
|
-
if (this.disabled) {
|
|
560
|
-
return;
|
|
561
|
-
}
|
|
562
|
-
// Calculate the new value.
|
|
563
|
-
var newValue = Math.min(this.totalPages, Math.max(1, pageNumber));
|
|
564
|
-
// Don't do anything if the page number is the same.
|
|
565
|
-
if (this._pageNumber$.getValue() === newValue) {
|
|
566
|
-
return;
|
|
567
|
-
}
|
|
568
|
-
// Push the new value.
|
|
569
|
-
this._pageNumber$.next(newValue);
|
|
570
|
-
if (notify) {
|
|
571
|
-
return this.onChange(pageNumber);
|
|
572
|
-
}
|
|
573
|
-
};
|
|
574
|
-
BbTablePager.prototype.calculatePages = function (pageNumber) {
|
|
575
|
-
var min = 1;
|
|
576
|
-
var max = this.totalPages;
|
|
577
|
-
var amount = Math.max(1, this.amountOfButtons);
|
|
578
|
-
var data = Array(amount)
|
|
579
|
-
.fill(0)
|
|
580
|
-
.map(function (_, index) { return pageNumber + (index - 1); });
|
|
581
|
-
// Validate if the minimum value less than
|
|
582
|
-
// the first value.
|
|
583
|
-
if (data[0] < min) {
|
|
584
|
-
return data.map(function (item) { return item + 1; });
|
|
585
|
-
}
|
|
586
|
-
// Calculate the difference with the max
|
|
587
|
-
// if this value is higher than 0 we should minus it.
|
|
588
|
-
var lastValueInArray = data[data.length - 1];
|
|
589
|
-
var differenceWithMax = lastValueInArray - max;
|
|
590
|
-
if (differenceWithMax > 0) {
|
|
591
|
-
return data.map(function (item) { return item - differenceWithMax; });
|
|
592
|
-
}
|
|
593
|
-
// Just return the default data.
|
|
594
|
-
return data;
|
|
595
|
-
};
|
|
596
|
-
BbTablePager.prototype.filterActivePages = function (pageNumber, totalPages) {
|
|
597
|
-
return this.calculatePages(pageNumber)
|
|
598
|
-
.filter(function (page) { return page > 0 && page <= totalPages; })
|
|
599
|
-
.map(function (page) { return ({ page: page, active: pageNumber === page }); });
|
|
600
|
-
};
|
|
601
|
-
return BbTablePager;
|
|
602
|
-
}(BbTablePagerMixinBase));
|
|
603
|
-
BbTablePager.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
604
|
-
BbTablePager.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.
|
|
605
|
-
{ provide: i4.NG_VALUE_ACCESSOR, useExisting: i0.forwardRef(function () { return BbTablePager; }), multi: true }
|
|
606
|
-
], usesInheritance: true, ngImport: i0__namespace, template: "<ul class=\"bb-pager-list\">\
|
|
607
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
608
|
-
type: i0.Component,
|
|
609
|
-
args: [{
|
|
610
|
-
selector: 'bb-table-pager',
|
|
611
|
-
templateUrl: './table-pager.component.html',
|
|
612
|
-
styleUrls: ['./table-pager.component.scss'],
|
|
613
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
614
|
-
host: {
|
|
615
|
-
'class': 'bb-table-pager',
|
|
616
|
-
'[class.disabled]': 'disabled'
|
|
617
|
-
},
|
|
618
|
-
inputs: ['disabled'],
|
|
619
|
-
encapsulation: i0.ViewEncapsulation.None,
|
|
620
|
-
preserveWhitespaces: false,
|
|
621
|
-
providers: [
|
|
622
|
-
{ provide: i4.NG_VALUE_ACCESSOR, useExisting: i0.forwardRef(function () { return BbTablePager; }), multi: true }
|
|
623
|
-
]
|
|
624
|
-
}]
|
|
625
|
-
}], propDecorators: { amountOfButtons: [{
|
|
626
|
-
type: i0.Input
|
|
627
|
-
}], showArrowButtons: [{
|
|
628
|
-
type: i0.Input
|
|
629
|
-
}], pageNumber: [{
|
|
630
|
-
type: i0.Input
|
|
631
|
-
}], totalPages: [{
|
|
632
|
-
type: i0.Input
|
|
473
|
+
var BbTablePagerBase = /** @class */ (function () {
|
|
474
|
+
function BbTablePagerBase() {
|
|
475
|
+
}
|
|
476
|
+
return BbTablePagerBase;
|
|
477
|
+
}());
|
|
478
|
+
var BbTablePagerMixinBase = bbFoundation.mixinDisabled(BbTablePagerBase);
|
|
479
|
+
var BbTablePager = /** @class */ (function (_super) {
|
|
480
|
+
__extends(BbTablePager, _super);
|
|
481
|
+
function BbTablePager() {
|
|
482
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
483
|
+
// Inputs.
|
|
484
|
+
_this.amountOfButtons = 5;
|
|
485
|
+
_this.showArrowButtons = true;
|
|
486
|
+
// Methods.
|
|
487
|
+
_this.onChange = function () { return ({}); };
|
|
488
|
+
_this.onTouched = function () { return ({}); };
|
|
489
|
+
_this.trackByIndex = function (_, item) { return item.page; };
|
|
490
|
+
// Data.
|
|
491
|
+
_this._totalPages$ = new rxjs.BehaviorSubject(1);
|
|
492
|
+
_this._pageNumber$ = new rxjs.BehaviorSubject(1);
|
|
493
|
+
return _this;
|
|
494
|
+
}
|
|
495
|
+
BbTablePager.prototype.ngOnInit = function () {
|
|
496
|
+
var _this = this;
|
|
497
|
+
// Validate the previous button is disabled.
|
|
498
|
+
this.isPreviousDisabled$ = this._pageNumber$.pipe(operators.map(function (pageNumber) { return pageNumber === 1; }));
|
|
499
|
+
// Validate the next button is disabled.
|
|
500
|
+
this.isNextDisabled$ = rxjs.combineLatest([this._pageNumber$, this._totalPages$]).pipe(operators.map(function (_a) {
|
|
501
|
+
var _b = __read(_a, 2), pageNumber = _b[0], totalPages = _b[1];
|
|
502
|
+
return pageNumber === totalPages;
|
|
503
|
+
}));
|
|
504
|
+
// Create the list with page numbers.
|
|
505
|
+
this.list$ = rxjs.combineLatest([this._pageNumber$, this._totalPages$]).pipe(operators.map(function (_a) {
|
|
506
|
+
var _b = __read(_a, 2), pageNumber = _b[0], totalPages = _b[1];
|
|
507
|
+
return _this.filterActivePages(pageNumber, totalPages);
|
|
508
|
+
}), operators.share());
|
|
509
|
+
};
|
|
510
|
+
Object.defineProperty(BbTablePager.prototype, "pageNumber", {
|
|
511
|
+
get: function () {
|
|
512
|
+
return this._pageNumber$.getValue();
|
|
513
|
+
},
|
|
514
|
+
set: function (newValue) {
|
|
515
|
+
this.update(newValue);
|
|
516
|
+
},
|
|
517
|
+
enumerable: false,
|
|
518
|
+
configurable: true
|
|
519
|
+
});
|
|
520
|
+
Object.defineProperty(BbTablePager.prototype, "totalPages", {
|
|
521
|
+
get: function () {
|
|
522
|
+
return this._totalPages$.getValue();
|
|
523
|
+
},
|
|
524
|
+
set: function (newValue) {
|
|
525
|
+
var newTotalPages = Math.max(1, newValue);
|
|
526
|
+
this._totalPages$.next(newTotalPages);
|
|
527
|
+
},
|
|
528
|
+
enumerable: false,
|
|
529
|
+
configurable: true
|
|
530
|
+
});
|
|
531
|
+
BbTablePager.prototype.registerOnChange = function (fn) {
|
|
532
|
+
this.onChange = fn;
|
|
533
|
+
};
|
|
534
|
+
BbTablePager.prototype.registerOnTouched = function (fn) {
|
|
535
|
+
this.onTouched = fn;
|
|
536
|
+
};
|
|
537
|
+
BbTablePager.prototype.setDisabledState = function (isDisabled) {
|
|
538
|
+
this.disabled = isDisabled;
|
|
539
|
+
};
|
|
540
|
+
BbTablePager.prototype.writeValue = function (newValue) {
|
|
541
|
+
this.update(newValue, false);
|
|
542
|
+
};
|
|
543
|
+
BbTablePager.prototype.goToPrevious = function () {
|
|
544
|
+
var newValue = this._pageNumber$.getValue() - 1;
|
|
545
|
+
return this.update(newValue);
|
|
546
|
+
};
|
|
547
|
+
BbTablePager.prototype.goToNext = function () {
|
|
548
|
+
var newValue = this._pageNumber$.getValue() + 1;
|
|
549
|
+
return this.update(newValue);
|
|
550
|
+
};
|
|
551
|
+
BbTablePager.prototype.goToIndex = function (index) {
|
|
552
|
+
return this.update(index);
|
|
553
|
+
};
|
|
554
|
+
BbTablePager.prototype.update = function (pageNumber, notify) {
|
|
555
|
+
if (notify === void 0) { notify = true; }
|
|
556
|
+
// You can only update when not disabled.
|
|
557
|
+
if (this.disabled) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
// Calculate the new value.
|
|
561
|
+
var newValue = Math.min(this.totalPages, Math.max(1, pageNumber));
|
|
562
|
+
// Don't do anything if the page number is the same.
|
|
563
|
+
if (this._pageNumber$.getValue() === newValue) {
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
// Push the new value.
|
|
567
|
+
this._pageNumber$.next(newValue);
|
|
568
|
+
if (notify) {
|
|
569
|
+
return this.onChange(pageNumber);
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
BbTablePager.prototype.calculatePages = function (pageNumber) {
|
|
573
|
+
var min = 1;
|
|
574
|
+
var max = this.totalPages;
|
|
575
|
+
var amount = Math.max(1, this.amountOfButtons);
|
|
576
|
+
var data = Array(amount)
|
|
577
|
+
.fill(0)
|
|
578
|
+
.map(function (_, index) { return pageNumber + (index - 1); });
|
|
579
|
+
// Validate if the minimum value less than
|
|
580
|
+
// the first value.
|
|
581
|
+
if (data[0] < min) {
|
|
582
|
+
return data.map(function (item) { return item + 1; });
|
|
583
|
+
}
|
|
584
|
+
// Calculate the difference with the max
|
|
585
|
+
// if this value is higher than 0 we should minus it.
|
|
586
|
+
var lastValueInArray = data[data.length - 1];
|
|
587
|
+
var differenceWithMax = lastValueInArray - max;
|
|
588
|
+
if (differenceWithMax > 0) {
|
|
589
|
+
return data.map(function (item) { return item - differenceWithMax; });
|
|
590
|
+
}
|
|
591
|
+
// Just return the default data.
|
|
592
|
+
return data;
|
|
593
|
+
};
|
|
594
|
+
BbTablePager.prototype.filterActivePages = function (pageNumber, totalPages) {
|
|
595
|
+
return this.calculatePages(pageNumber)
|
|
596
|
+
.filter(function (page) { return page > 0 && page <= totalPages; })
|
|
597
|
+
.map(function (page) { return ({ page: page, active: pageNumber === page }); });
|
|
598
|
+
};
|
|
599
|
+
return BbTablePager;
|
|
600
|
+
}(BbTablePagerMixinBase));
|
|
601
|
+
BbTablePager.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbTablePager, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
602
|
+
BbTablePager.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.10", type: BbTablePager, selector: "bb-table-pager", inputs: { disabled: "disabled", amountOfButtons: "amountOfButtons", showArrowButtons: "showArrowButtons", pageNumber: "pageNumber", totalPages: "totalPages" }, host: { properties: { "class.disabled": "disabled" }, classAttribute: "bb-table-pager" }, providers: [
|
|
603
|
+
{ provide: i4.NG_VALUE_ACCESSOR, useExisting: i0.forwardRef(function () { return BbTablePager; }), multi: true }
|
|
604
|
+
], usesInheritance: true, ngImport: i0__namespace, template: "<ul class=\"bb-pager-list\">\n <!-- The previous page arrow button. -->\n <li *ngIf=\"showArrowButtons\"\n class=\"bb-pager-list-item\"\n title=\"Previous page\">\n <button [disabled]=\"isPreviousDisabled$ | async\"\n (click)=\"goToPrevious()\"\n class=\"bb-pager-list-button\"\n type=\"button\">\n <bb-icon src=\"material:keyboard_arrow_left\"></bb-icon>\n </button>\n </li>\n\n <!-- The list of number buttons to navigate through the list. -->\n <ng-container *ngIf=\"list$ | async as list\">\n <li *ngFor=\"let item of list; trackBy: trackByIndex\"\n [title]=\"'Page ' + item?.page\"\n class=\"bb-pager-list-item\">\n <button (click)=\"goToIndex(item?.page)\"\n [class.active]=\"item?.active\"\n class=\"bb-pager-list-button\"\n type=\"button\">\n {{ item?.page }}\n </button>\n </li>\n </ng-container>\n\n <!-- The next page arrow button. -->\n <li *ngIf=\"showArrowButtons\"\n class=\"bb-pager-list-item\"\n title=\"Next page\">\n <button [disabled]=\"isNextDisabled$ | async\"\n (click)=\"goToNext()\"\n class=\"bb-pager-list-button\"\n type=\"button\">\n <bb-icon src=\"material:keyboard_arrow_right\"></bb-icon>\n </button>\n </li>\n</ul>\n", styles: [".bb-table-pager{flex:1;display:flex;align-items:center;justify-content:flex-end}.bb-table-pager.disabled{opacity:.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.bb-pager-list{display:flex}.bb-pager-list-item{margin-left:8px}.bb-pager-list-button{padding:0;color:#3d464d;line-height:1;min-width:32px;font-size:16px;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-weight:500;min-height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:4px;align-items:center;display:inline-flex;justify-content:center;border:1px solid #b6bbc1;transition-duration:.2s;background-color:transparent;transition-timing-function:cubic-bezier(0,0,.2,1);transition-property:color,border-color,opacity,background-color;box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a}.bb-pager-list-button:hover,.bb-pager-list-button:focus{background-color:#0000000a}.bb-pager-list-button.active,.bb-pager-list-button.active:hover{color:#2196f3;cursor:default;border-color:#2196f3;background-color:transparent}.bb-pager-list-button:disabled{opacity:.35;cursor:default;pointer-events:none}\n"], components: [{ type: i1__namespace.BbIcon, selector: "bb-icon", inputs: ["alt", "size", "src", "ariaHidden"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i3__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
605
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbTablePager, decorators: [{
|
|
606
|
+
type: i0.Component,
|
|
607
|
+
args: [{
|
|
608
|
+
selector: 'bb-table-pager',
|
|
609
|
+
templateUrl: './table-pager.component.html',
|
|
610
|
+
styleUrls: ['./table-pager.component.scss'],
|
|
611
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
612
|
+
host: {
|
|
613
|
+
'class': 'bb-table-pager',
|
|
614
|
+
'[class.disabled]': 'disabled'
|
|
615
|
+
},
|
|
616
|
+
inputs: ['disabled'],
|
|
617
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
618
|
+
preserveWhitespaces: false,
|
|
619
|
+
providers: [
|
|
620
|
+
{ provide: i4.NG_VALUE_ACCESSOR, useExisting: i0.forwardRef(function () { return BbTablePager; }), multi: true }
|
|
621
|
+
]
|
|
622
|
+
}]
|
|
623
|
+
}], propDecorators: { amountOfButtons: [{
|
|
624
|
+
type: i0.Input
|
|
625
|
+
}], showArrowButtons: [{
|
|
626
|
+
type: i0.Input
|
|
627
|
+
}], pageNumber: [{
|
|
628
|
+
type: i0.Input
|
|
629
|
+
}], totalPages: [{
|
|
630
|
+
type: i0.Input
|
|
633
631
|
}] } });
|
|
634
632
|
|
|
635
|
-
var BbTableColumnDef = /** @class */ (function () {
|
|
636
|
-
function BbTableColumnDef() {
|
|
637
|
-
}
|
|
638
|
-
return BbTableColumnDef;
|
|
639
|
-
}());
|
|
640
|
-
BbTableColumnDef.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
641
|
-
BbTableColumnDef.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.
|
|
642
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
643
|
-
type: i0.Directive,
|
|
644
|
-
args: [{
|
|
645
|
-
selector: '[bbTableColumnDef]'
|
|
646
|
-
}]
|
|
647
|
-
}] });
|
|
648
|
-
var BbTable = /** @class */ (function () {
|
|
649
|
-
function BbTable() {
|
|
650
|
-
var _this = this;
|
|
651
|
-
// Inputs.
|
|
652
|
-
this.identifier = null;
|
|
653
|
-
this.queryFields = [];
|
|
654
|
-
this.sortingStrategy = 'single';
|
|
655
|
-
this.header = true;
|
|
656
|
-
this.footer = true;
|
|
657
|
-
// Sizes.
|
|
658
|
-
this._sizes = [25, 50, 75, 100];
|
|
659
|
-
// Optimizations.
|
|
660
|
-
this.trackByFn = function (index, item) { return _this.identifier ? item[_this.identifier] : index; };
|
|
661
|
-
this.trackByValue = function (_, item) { return item; };
|
|
662
|
-
this.queryControl = new i4.FormControl('');
|
|
663
|
-
}
|
|
664
|
-
Object.defineProperty(BbTable.prototype, "sizes", {
|
|
665
|
-
get: function () {
|
|
666
|
-
return this._sizes;
|
|
667
|
-
},
|
|
668
|
-
set: function (newValue) {
|
|
669
|
-
this.updateSizes(newValue);
|
|
670
|
-
},
|
|
671
|
-
enumerable: false,
|
|
672
|
-
configurable: true
|
|
673
|
-
});
|
|
674
|
-
BbTable.prototype.ngOnInit = function () {
|
|
675
|
-
this.composeForm();
|
|
676
|
-
this.watchDataChanges();
|
|
677
|
-
};
|
|
678
|
-
BbTable.prototype.ngOnDestroy = function () {
|
|
679
|
-
var _a;
|
|
680
|
-
(_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
681
|
-
};
|
|
682
|
-
Object.defineProperty(BbTable.prototype, "sortControl", {
|
|
683
|
-
get: function () {
|
|
684
|
-
var _a;
|
|
685
|
-
return (_a = this.form) === null || _a === void 0 ? void 0 : _a.get('sort');
|
|
686
|
-
},
|
|
687
|
-
enumerable: false,
|
|
688
|
-
configurable: true
|
|
689
|
-
});
|
|
690
|
-
Object.defineProperty(BbTable.prototype, "pageNumberControl", {
|
|
691
|
-
get: function () {
|
|
692
|
-
var _a;
|
|
693
|
-
return (_a = this.form) === null || _a === void 0 ? void 0 : _a.get('pageNumber');
|
|
694
|
-
},
|
|
695
|
-
enumerable: false,
|
|
696
|
-
configurable: true
|
|
697
|
-
});
|
|
698
|
-
Object.defineProperty(BbTable.prototype, "pageSizeControl", {
|
|
699
|
-
get: function () {
|
|
700
|
-
var _a;
|
|
701
|
-
return (_a = this.form) === null || _a === void 0 ? void 0 : _a.get('pageSize');
|
|
702
|
-
},
|
|
703
|
-
enumerable: false,
|
|
704
|
-
configurable: true
|
|
705
|
-
});
|
|
706
|
-
BbTable.prototype.refresh = function () {
|
|
707
|
-
return this.request.update();
|
|
708
|
-
};
|
|
709
|
-
BbTable.prototype.updateSizes = function (newValue) {
|
|
710
|
-
// Validate the sizes has at least one value.
|
|
711
|
-
if (newValue.length <= 0) {
|
|
712
|
-
throw new Error('Cannot set an empty array as the sizes.');
|
|
713
|
-
}
|
|
714
|
-
// Set the new size.
|
|
715
|
-
this._sizes = newValue;
|
|
716
|
-
// Validate that the form exists already.
|
|
717
|
-
if (!this.form) {
|
|
718
|
-
return;
|
|
719
|
-
}
|
|
720
|
-
// Check if the current selected value is
|
|
721
|
-
// in the new sizes array.
|
|
722
|
-
var pageSizeControl = this.form.get('pageSize');
|
|
723
|
-
if (this._sizes.includes(pageSizeControl.value)) {
|
|
724
|
-
return;
|
|
725
|
-
}
|
|
726
|
-
// Set the first value in the array as
|
|
727
|
-
// the new value.
|
|
728
|
-
var firstValue = this._sizes[0];
|
|
729
|
-
pageSizeControl.setValue(firstValue);
|
|
730
|
-
};
|
|
731
|
-
BbTable.prototype.composeForm = function () {
|
|
732
|
-
// Setup the form.
|
|
733
|
-
this.form = new i4.FormGroup({
|
|
734
|
-
pageSize: new i4.FormControl(this._sizes[0]),
|
|
735
|
-
pageNumber: new i4.FormControl(1),
|
|
736
|
-
sort: new i4.FormGroup({})
|
|
737
|
-
});
|
|
738
|
-
};
|
|
739
|
-
BbTable.prototype.watchDataChanges = function () {
|
|
740
|
-
var _this = this;
|
|
741
|
-
// Create a new request.
|
|
742
|
-
this.request = new DataSourceRequest();
|
|
743
|
-
this.isLoading$ = this.request.loading;
|
|
744
|
-
if (!this.dataSource) {
|
|
745
|
-
this.data$ = rxjs.of({ state: 'error_datasource' }).pipe(operators.tap(function () { return _this.request.stopLoading(); }));
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
// Pass the request to the data source.
|
|
749
|
-
this.data$ = this.dataSource.handle(this.request).pipe(operators.tap(function () { return _this.request.stopLoading(); }), operators.map(function (result) {
|
|
750
|
-
var count = (result && result.data && result.data.length) || 0;
|
|
751
|
-
if (count <= 0) {
|
|
752
|
-
return { state: 'empty', result: result };
|
|
753
|
-
}
|
|
754
|
-
return { state: 'success', result: result };
|
|
755
|
-
}), operators.catchError(function (error) {
|
|
756
|
-
var _a, _b;
|
|
757
|
-
_this.request.stopLoading();
|
|
758
|
-
var statusCode = (_a = error === null || error === void 0 ? void 0 : error.status) !== null && _a !== void 0 ? _a : null;
|
|
759
|
-
var states = {
|
|
760
|
-
0: 'error_down',
|
|
761
|
-
401: 'error_unauthorized',
|
|
762
|
-
403: 'error_forbidden',
|
|
763
|
-
404: 'error_not_found',
|
|
764
|
-
500: 'error_server'
|
|
765
|
-
};
|
|
766
|
-
return rxjs.of({ state: (_b = states === null || states === void 0 ? void 0 : states[statusCode]) !== null && _b !== void 0 ? _b : 'error_unknown', statusCode: statusCode });
|
|
767
|
-
}));
|
|
768
|
-
// Subscribe to the data changes.
|
|
769
|
-
this.subscribeToChanges();
|
|
770
|
-
};
|
|
771
|
-
BbTable.prototype.subscribeToChanges = function () {
|
|
772
|
-
var _this = this;
|
|
773
|
-
var form$ = this.getFormChanges();
|
|
774
|
-
var query$ = this.getQueryChanges();
|
|
775
|
-
this._subscription = rxjs.combineLatest([form$, query$]).subscribe(function (_c) {
|
|
776
|
-
var _d = __read(_c, 2), form = _d[0], query = _d[1];
|
|
777
|
-
var pageNumber = form.pageNumber, pageSize = form.pageSize;
|
|
778
|
-
var sort = Object.keys(form.sort)
|
|
779
|
-
.map(function (name) { return ({ name: name, direction: form.sort[name] }); })
|
|
780
|
-
.filter(function (item) { return ['asc', 'desc'].includes(item.direction); });
|
|
781
|
-
_this.request.startLoading();
|
|
782
|
-
return _this.request.update({
|
|
783
|
-
sort: sort,
|
|
784
|
-
query: query,
|
|
785
|
-
pageSize: pageSize,
|
|
786
|
-
pageNumber: pageNumber,
|
|
787
|
-
queryFields: _this.queryFields
|
|
788
|
-
});
|
|
789
|
-
});
|
|
790
|
-
};
|
|
791
|
-
BbTable.prototype.getQueryChanges = function () {
|
|
792
|
-
return this.queryControl.valueChanges.pipe(operators.debounceTime(400), operators.distinctUntilChanged(), operators.startWith(this.queryControl.value));
|
|
793
|
-
};
|
|
794
|
-
BbTable.prototype.getFormChanges = function () {
|
|
795
|
-
return this.form.valueChanges.pipe(operators.startWith(this.form.value));
|
|
796
|
-
};
|
|
797
|
-
return BbTable;
|
|
798
|
-
}());
|
|
799
|
-
BbTable.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
800
|
-
BbTable.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.1", type: BbTable, selector: "bb-table", inputs: { identifier: "identifier", dataSource: "dataSource", queryFields: "queryFields", sortingStrategy: "sortingStrategy", header: "header", footer: "footer", sizes: "sizes" }, host: { classAttribute: "bb-table" }, queries: [{ propertyName: "tableColumnTemplates", predicate: BbTableColumnDef, read: i0.TemplateRef }], ngImport: i0__namespace, template: "<!--\r\n This is the header of the table. It can be a user\r\n defined custom header or just the default header.\r\n-->\r\n\r\n<header *ngIf=\"(header === true ? headerTemplate : header) as template\"\r\n class=\"bb-table-top-actions\">\r\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\r\n</header>\r\n\r\n<!--\r\n This is the table that contains the\r\n rows and columns.\r\n-->\r\n\r\n<div class=\"bb-table-wrapper\">\r\n <div *ngIf=\"isLoading$ | async\"\r\n class=\"bb-table-progress\">\r\n <div class=\"bb-table-indeterminate\"></div>\r\n </div>\r\n <table class=\"bb-table-container\">\r\n <thead>\r\n <tr>\r\n <ng-content select=\"bb-table-header-cell\"></ng-content>\r\n </tr>\r\n </thead>\r\n <tbody *ngIf=\"data$ | async as data; else isLoadingTemplate\"\r\n [ngSwitch]=\"data?.state\">\r\n <ng-container *ngSwitchCase=\"'success'\">\r\n <tr *ngFor=\"let item of data?.result?.data; trackBy: trackByFn\">\r\n <ng-container *ngFor=\"let template of tableColumnTemplates\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </tr>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'empty'\">\r\n <ng-container\r\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'error_datasource'\">\r\n <ng-container\r\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'error_not_found'\">\r\n <ng-container\r\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'error_server'\">\r\n <ng-container\r\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'error_down'\">\r\n <ng-container\r\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchDefault>\r\n <ng-container\r\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n</div>\r\n\r\n<footer *ngIf=\"(footer === true ? footerTemplate : footer) as template\"\r\n class=\"bb-table-bottom-actions\">\r\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\r\n</footer>\r\n\r\n<ng-template #isLoadingTemplate>\r\n <tr>\r\n <td [attr.colspan]=\"tableColumnTemplates?.length\"\r\n class=\"bb-table-template\">\r\n <div class=\"bb-table-template-content\">\r\n {{ 'tables.loading' | bbLocalize }}\r\n </div>\r\n </td>\r\n </tr>\r\n</ng-template>\r\n\r\n<!--\r\n This is the template that will be used when the user has not\r\n supplied a custom header template.\r\n-->\r\n\r\n<ng-template #headerTemplate>\r\n <ng-content></ng-content>\r\n <bb-form-control>\r\n <input [formControl]=\"queryControl\"\r\n [placeholder]=\"'tables.search' | bbLocalize\"\r\n bbInput\r\n autocomplete=\"off\">\r\n <bb-icon *ngIf=\"queryControl?.value?.length <= 0; else closeButtonTemplate\"\r\n bbSuffix\r\n src=\"material:search\">\r\n </bb-icon>\r\n </bb-form-control>\r\n</ng-template>\r\n\r\n<!--\r\n This is the template that will be used when the user has not\r\n supplied a custom footer template.\r\n-->\r\n\r\n<ng-template #footerTemplate>\r\n <bb-form-control *ngIf=\"sizes?.length > 1\">\r\n <select [formControl]=\"pageSizeControl\"\r\n bbInput\r\n title=\"Sizes\">\r\n <option *ngFor=\"let item of sizes; trackBy: trackByValue\"\r\n [ngValue]=\"item\">\r\n {{ item }} / {{ 'tables.page' | bbLocalize }}\r\n </option>\r\n </select>\r\n </bb-form-control>\r\n\r\n <bb-table-pager [totalPages]=\"(data$ | async)?.result?.totalPages\"\r\n [formControl]=\"pageNumberControl\">\r\n </bb-table-pager>\r\n</ng-template>\r\n\r\n<!--\r\n This the template that will be used when the user\r\n has filled in some data in the query control.\r\n-->\r\n\r\n<ng-template #closeButtonTemplate>\r\n <button bbSuffix\r\n (click)=\"queryControl?.patchValue('')\"\r\n type=\"button\"\r\n class=\"bb-table-progress-close-query\">\r\n <bb-icon src=\"material:close\"></bb-icon>\r\n </button>\r\n</ng-template>\r\n\r\n<ng-template #errorTemplate let-state=\"state\" let-status=\"statusCode\">\r\n <tr>\r\n <td [attr.colspan]=\"tableColumnTemplates?.length\"\r\n class=\"bb-table-template\">\r\n <div class=\"bb-table-template-content\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"64\" height=\"41\">\r\n <g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(0 1)\">\r\n <ellipse cx=\"32\" cy=\"33\" fill=\"#F5F5F5\" rx=\"32\" ry=\"7\"></ellipse>\r\n <g fill-rule=\"nonzero\" stroke=\"#D9D9D9\">\r\n <path\r\n d=\"M55 12.7605604L44.8543047 1.25739633C44.3674414.47382661 43.6558789 0 42.9067617 0H21.0932383c-.7491172 0-1.4606797.47395025-1.947543 1.25739633L9 12.7605604V22h46v-9.2394396z\"></path>\r\n <path fill=\"#FAFAFA\"\r\n d=\"M41.6132813 15.9315c0-1.6056489.9936718-2.931266 2.2264179-2.9315H55v18.1371277C55 33.2589574 53.6793867 35 52.0504297 35H11.94957031C10.32052344 35 9 33.2588404 9 31.1371277V13h11.1603008c1.2327461 0 2.226418 1.3228085 2.226418 2.9284574v.0211809c0 1.6056489 1.0049921 2.9015426 2.2377382 2.9015426h14.751086c1.2327461 0 2.2377383-1.3078298 2.2377383-2.9134788V15.9315z\"></path>\r\n </g>\r\n </g>\r\n </svg>\r\n <span *ngIf=\"state as stateLabel\">{{ ('tables.' + stateLabel) | bbLocalize }}</span>\r\n <span *ngIf=\"status as statusCode\"\r\n class=\"bb-table-template-content-code\">(HTTP {{ statusCode }})</span>\r\n </div>\r\n </td>\r\n </tr>\r\n</ng-template>\r\n", styles: [".bb-table{width:100%;display:block;box-shadow:0 6px 6px -6px rgba(0,0,0,.1)}.bb-table.plain{box-shadow:none}.bb-table.plain>.bb-table-wrapper{border-top-left-radius:0;border-top-right-radius:0}.bb-table-wrapper{overflow-x:auto;position:relative;background-color:#fff;border-top-left-radius:4px;border-top-right-radius:4px}.bb-table-container{width:100%}.bb-table-container td{border-bottom:1px solid #d8d8d8}.bb-table-top-actions{display:flex;flex-wrap:wrap;flex-direction:column;padding:20px 20px 10px;background-color:#fff;justify-content:flex-end;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #d8d8d8}.bb-table-top-actions>*{margin-left:0;margin-bottom:10px}.bb-table-top-actions+.bb-table-wrapper{border-radius:0}.bb-table-bottom-actions{height:60px;display:flex;padding:0 20px;overflow-x:auto;align-items:center;background-color:#fff;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.bb-table-template{background-color:#f5f5f5;border:none;border-bottom:1px solid #d8d8d8}.bb-table-template-content{padding:20px;display:flex;color:#3d464d;font-size:14px;line-height:1.2;font-weight:400;min-height:140px;text-align:center;align-items:center;flex-direction:column;justify-content:center}.bb-table-template-content>svg{margin-bottom:12px}.bb-table-template-content-code{opacity:.5;margin-top:5px;display:inline-block}.bb-table-progress{top:0;left:0;right:0;opacity:0;width:100%;height:4px;display:block;overflow:hidden;position:absolute;background-color:rgba(47,64,139,.3);-webkit-animation:fadeIn .25s cubic-bezier(0,0,.2,1) .1s forwards;animation:fadeIn .25s cubic-bezier(0,0,.2,1) .1s forwards}.bb-table-progress .bb-table-indeterminate{background-color:#2f408b}.bb-table-progress .bb-table-indeterminate:before{top:0;left:0;bottom:0;content:\"\";position:absolute;will-change:left,right;background-color:inherit;-webkit-animation:indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite;animation:indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite}.bb-table-progress .bb-table-indeterminate:after{top:0;left:0;bottom:0;content:\"\";position:absolute;-webkit-animation-delay:1.15s;animation-delay:1.15s;will-change:left,right;background-color:inherit;-webkit-animation:indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite;animation:indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite}.bb-table-progress-close-query{padding:0;border:none;border-radius:4px;background-color:transparent;transition:background-color .25s cubic-bezier(0,0,.2,1)}.bb-table-progress-close-query:hover{background-color:rgba(0,0,0,.08)}.bb-table-progress-close-query:focus{background-color:rgba(0,0,0,.12)}.bb-table-progress-close-query:active{background-color:rgba(0,0,0,.16)}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@-webkit-keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}@keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}@media only screen and (min-width:768px){.bb-table-top-actions{flex-direction:row}.bb-table-top-actions>:not(:first-child){margin-left:10px;margin-bottom:10px}}"], components: [{ type: i1__namespace.BbFormControl, selector: "bb-form-control", inputs: ["grouped", "hideErrors", "label", "hint"] }, { type: i1__namespace.BbIcon, selector: "bb-icon", inputs: ["alt", "size", "src", "ariaHidden"] }, { type: BbTablePager, selector: "bb-table-pager", inputs: ["disabled", "amountOfButtons", "showArrowButtons", "pageNumber", "totalPages"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace.BbInput, selector: "input[bbInput], textarea[bbInput]", inputs: ["readonly"] }, { type: i4__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1__namespace.BbSuffix, selector: "[bbSuffix]" }, { type: i1__namespace.BbSelect, selector: "select[bbInput]", inputs: ["disabled", "required"] }, { type: i4__namespace.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i4__namespace.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i4__namespace.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }], pipes: { "async": i3__namespace.AsyncPipe, "bbLocalize": i5__namespace.BbLocalize }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
801
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
802
|
-
type: i0.Component,
|
|
803
|
-
args: [{
|
|
804
|
-
selector: 'bb-table',
|
|
805
|
-
templateUrl: './table.component.html',
|
|
806
|
-
styleUrls: ['./table.component.scss'],
|
|
807
|
-
host: { 'class': 'bb-table' },
|
|
808
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
809
|
-
encapsulation: i0.ViewEncapsulation.None,
|
|
810
|
-
preserveWhitespaces: false
|
|
811
|
-
}]
|
|
812
|
-
}], propDecorators: { tableColumnTemplates: [{
|
|
813
|
-
type: i0.ContentChildren,
|
|
814
|
-
args: [BbTableColumnDef, { read: i0.TemplateRef }]
|
|
815
|
-
}], identifier: [{
|
|
816
|
-
type: i0.Input
|
|
817
|
-
}], dataSource: [{
|
|
818
|
-
type: i0.Input
|
|
819
|
-
}], queryFields: [{
|
|
820
|
-
type: i0.Input
|
|
821
|
-
}], sortingStrategy: [{
|
|
822
|
-
type: i0.Input
|
|
823
|
-
}], header: [{
|
|
824
|
-
type: i0.Input
|
|
825
|
-
}], footer: [{
|
|
826
|
-
type: i0.Input
|
|
827
|
-
}], sizes: [{
|
|
828
|
-
type: i0.Input
|
|
633
|
+
var BbTableColumnDef = /** @class */ (function () {
|
|
634
|
+
function BbTableColumnDef() {
|
|
635
|
+
}
|
|
636
|
+
return BbTableColumnDef;
|
|
637
|
+
}());
|
|
638
|
+
BbTableColumnDef.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbTableColumnDef, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
639
|
+
BbTableColumnDef.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: BbTableColumnDef, selector: "[bbTableColumnDef]", ngImport: i0__namespace });
|
|
640
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbTableColumnDef, decorators: [{
|
|
641
|
+
type: i0.Directive,
|
|
642
|
+
args: [{
|
|
643
|
+
selector: '[bbTableColumnDef]'
|
|
644
|
+
}]
|
|
645
|
+
}] });
|
|
646
|
+
var BbTable = /** @class */ (function () {
|
|
647
|
+
function BbTable() {
|
|
648
|
+
var _this = this;
|
|
649
|
+
// Inputs.
|
|
650
|
+
this.identifier = null;
|
|
651
|
+
this.queryFields = [];
|
|
652
|
+
this.sortingStrategy = 'single';
|
|
653
|
+
this.header = true;
|
|
654
|
+
this.footer = true;
|
|
655
|
+
// Sizes.
|
|
656
|
+
this._sizes = [25, 50, 75, 100];
|
|
657
|
+
// Optimizations.
|
|
658
|
+
this.trackByFn = function (index, item) { return _this.identifier ? item[_this.identifier] : index; };
|
|
659
|
+
this.trackByValue = function (_, item) { return item; };
|
|
660
|
+
this.queryControl = new i4.FormControl('');
|
|
661
|
+
}
|
|
662
|
+
Object.defineProperty(BbTable.prototype, "sizes", {
|
|
663
|
+
get: function () {
|
|
664
|
+
return this._sizes;
|
|
665
|
+
},
|
|
666
|
+
set: function (newValue) {
|
|
667
|
+
this.updateSizes(newValue);
|
|
668
|
+
},
|
|
669
|
+
enumerable: false,
|
|
670
|
+
configurable: true
|
|
671
|
+
});
|
|
672
|
+
BbTable.prototype.ngOnInit = function () {
|
|
673
|
+
this.composeForm();
|
|
674
|
+
this.watchDataChanges();
|
|
675
|
+
};
|
|
676
|
+
BbTable.prototype.ngOnDestroy = function () {
|
|
677
|
+
var _a;
|
|
678
|
+
(_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
679
|
+
};
|
|
680
|
+
Object.defineProperty(BbTable.prototype, "sortControl", {
|
|
681
|
+
get: function () {
|
|
682
|
+
var _a;
|
|
683
|
+
return (_a = this.form) === null || _a === void 0 ? void 0 : _a.get('sort');
|
|
684
|
+
},
|
|
685
|
+
enumerable: false,
|
|
686
|
+
configurable: true
|
|
687
|
+
});
|
|
688
|
+
Object.defineProperty(BbTable.prototype, "pageNumberControl", {
|
|
689
|
+
get: function () {
|
|
690
|
+
var _a;
|
|
691
|
+
return (_a = this.form) === null || _a === void 0 ? void 0 : _a.get('pageNumber');
|
|
692
|
+
},
|
|
693
|
+
enumerable: false,
|
|
694
|
+
configurable: true
|
|
695
|
+
});
|
|
696
|
+
Object.defineProperty(BbTable.prototype, "pageSizeControl", {
|
|
697
|
+
get: function () {
|
|
698
|
+
var _a;
|
|
699
|
+
return (_a = this.form) === null || _a === void 0 ? void 0 : _a.get('pageSize');
|
|
700
|
+
},
|
|
701
|
+
enumerable: false,
|
|
702
|
+
configurable: true
|
|
703
|
+
});
|
|
704
|
+
BbTable.prototype.refresh = function () {
|
|
705
|
+
return this.request.update();
|
|
706
|
+
};
|
|
707
|
+
BbTable.prototype.updateSizes = function (newValue) {
|
|
708
|
+
// Validate the sizes has at least one value.
|
|
709
|
+
if (newValue.length <= 0) {
|
|
710
|
+
throw new Error('Cannot set an empty array as the sizes.');
|
|
711
|
+
}
|
|
712
|
+
// Set the new size.
|
|
713
|
+
this._sizes = newValue;
|
|
714
|
+
// Validate that the form exists already.
|
|
715
|
+
if (!this.form) {
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
// Check if the current selected value is
|
|
719
|
+
// in the new sizes array.
|
|
720
|
+
var pageSizeControl = this.form.get('pageSize');
|
|
721
|
+
if (this._sizes.includes(pageSizeControl.value)) {
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
// Set the first value in the array as
|
|
725
|
+
// the new value.
|
|
726
|
+
var firstValue = this._sizes[0];
|
|
727
|
+
pageSizeControl.setValue(firstValue);
|
|
728
|
+
};
|
|
729
|
+
BbTable.prototype.composeForm = function () {
|
|
730
|
+
// Setup the form.
|
|
731
|
+
this.form = new i4.FormGroup({
|
|
732
|
+
pageSize: new i4.FormControl(this._sizes[0]),
|
|
733
|
+
pageNumber: new i4.FormControl(1),
|
|
734
|
+
sort: new i4.FormGroup({})
|
|
735
|
+
});
|
|
736
|
+
};
|
|
737
|
+
BbTable.prototype.watchDataChanges = function () {
|
|
738
|
+
var _this = this;
|
|
739
|
+
// Create a new request.
|
|
740
|
+
this.request = new DataSourceRequest();
|
|
741
|
+
this.isLoading$ = this.request.loading;
|
|
742
|
+
if (!this.dataSource) {
|
|
743
|
+
this.data$ = rxjs.of({ state: 'error_datasource' }).pipe(operators.tap(function () { return _this.request.stopLoading(); }));
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
// Pass the request to the data source.
|
|
747
|
+
this.data$ = this.dataSource.handle(this.request).pipe(operators.tap(function () { return _this.request.stopLoading(); }), operators.map(function (result) {
|
|
748
|
+
var count = (result && result.data && result.data.length) || 0;
|
|
749
|
+
if (count <= 0) {
|
|
750
|
+
return { state: 'empty', result: result };
|
|
751
|
+
}
|
|
752
|
+
return { state: 'success', result: result };
|
|
753
|
+
}), operators.catchError(function (error) {
|
|
754
|
+
var _a, _b;
|
|
755
|
+
_this.request.stopLoading();
|
|
756
|
+
var statusCode = (_a = error === null || error === void 0 ? void 0 : error.status) !== null && _a !== void 0 ? _a : null;
|
|
757
|
+
var states = {
|
|
758
|
+
0: 'error_down',
|
|
759
|
+
401: 'error_unauthorized',
|
|
760
|
+
403: 'error_forbidden',
|
|
761
|
+
404: 'error_not_found',
|
|
762
|
+
500: 'error_server'
|
|
763
|
+
};
|
|
764
|
+
return rxjs.of({ state: (_b = states === null || states === void 0 ? void 0 : states[statusCode]) !== null && _b !== void 0 ? _b : 'error_unknown', statusCode: statusCode });
|
|
765
|
+
}));
|
|
766
|
+
// Subscribe to the data changes.
|
|
767
|
+
this.subscribeToChanges();
|
|
768
|
+
};
|
|
769
|
+
BbTable.prototype.subscribeToChanges = function () {
|
|
770
|
+
var _this = this;
|
|
771
|
+
var form$ = this.getFormChanges();
|
|
772
|
+
var query$ = this.getQueryChanges();
|
|
773
|
+
this._subscription = rxjs.combineLatest([form$, query$]).subscribe(function (_c) {
|
|
774
|
+
var _d = __read(_c, 2), form = _d[0], query = _d[1];
|
|
775
|
+
var pageNumber = form.pageNumber, pageSize = form.pageSize;
|
|
776
|
+
var sort = Object.keys(form.sort)
|
|
777
|
+
.map(function (name) { return ({ name: name, direction: form.sort[name] }); })
|
|
778
|
+
.filter(function (item) { return ['asc', 'desc'].includes(item.direction); });
|
|
779
|
+
_this.request.startLoading();
|
|
780
|
+
return _this.request.update({
|
|
781
|
+
sort: sort,
|
|
782
|
+
query: query,
|
|
783
|
+
pageSize: pageSize,
|
|
784
|
+
pageNumber: pageNumber,
|
|
785
|
+
queryFields: _this.queryFields
|
|
786
|
+
});
|
|
787
|
+
});
|
|
788
|
+
};
|
|
789
|
+
BbTable.prototype.getQueryChanges = function () {
|
|
790
|
+
return this.queryControl.valueChanges.pipe(operators.debounceTime(400), operators.distinctUntilChanged(), operators.startWith(this.queryControl.value));
|
|
791
|
+
};
|
|
792
|
+
BbTable.prototype.getFormChanges = function () {
|
|
793
|
+
return this.form.valueChanges.pipe(operators.startWith(this.form.value));
|
|
794
|
+
};
|
|
795
|
+
return BbTable;
|
|
796
|
+
}());
|
|
797
|
+
BbTable.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbTable, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
798
|
+
BbTable.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.10", type: BbTable, selector: "bb-table", inputs: { identifier: "identifier", dataSource: "dataSource", queryFields: "queryFields", sortingStrategy: "sortingStrategy", header: "header", footer: "footer", sizes: "sizes" }, host: { classAttribute: "bb-table" }, queries: [{ propertyName: "tableColumnTemplates", predicate: BbTableColumnDef, read: i0.TemplateRef }], ngImport: i0__namespace, template: "<!--\n This is the header of the table. It can be a user\n defined custom header or just the default header.\n-->\n\n<header *ngIf=\"(header === true ? headerTemplate : header) as template\"\n class=\"bb-table-top-actions\">\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n</header>\n\n<!--\n This is the table that contains the\n rows and columns.\n-->\n\n<div class=\"bb-table-wrapper\">\n <div *ngIf=\"isLoading$ | async\"\n class=\"bb-table-progress\">\n <div class=\"bb-table-indeterminate\"></div>\n </div>\n <table class=\"bb-table-container\">\n <thead>\n <tr>\n <ng-content select=\"bb-table-header-cell\"></ng-content>\n </tr>\n </thead>\n <tbody *ngIf=\"data$ | async as data; else isLoadingTemplate\"\n [ngSwitch]=\"data?.state\">\n <ng-container *ngSwitchCase=\"'success'\">\n <tr *ngFor=\"let item of data?.result?.data; trackBy: trackByFn\">\n <ng-container *ngFor=\"let template of tableColumnTemplates\">\n <ng-container *ngTemplateOutlet=\"template; context: {item: item}\"></ng-container>\n </ng-container>\n </tr>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'empty'\">\n <ng-container\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'error_datasource'\">\n <ng-container\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'error_not_found'\">\n <ng-container\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'error_server'\">\n <ng-container\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'error_down'\">\n <ng-container\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-container\n *ngTemplateOutlet=\"errorTemplate; context: data\"></ng-container>\n </ng-container>\n </tbody>\n </table>\n</div>\n\n<footer *ngIf=\"(footer === true ? footerTemplate : footer) as template\"\n class=\"bb-table-bottom-actions\">\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n</footer>\n\n<ng-template #isLoadingTemplate>\n <tr>\n <td [attr.colspan]=\"tableColumnTemplates?.length\"\n class=\"bb-table-template\">\n <div class=\"bb-table-template-content\">\n {{ 'tables.loading' | bbLocalize }}\n </div>\n </td>\n </tr>\n</ng-template>\n\n<!--\n This is the template that will be used when the user has not\n supplied a custom header template.\n-->\n\n<ng-template #headerTemplate>\n <ng-content></ng-content>\n <bb-form-control>\n <input [formControl]=\"queryControl\"\n [placeholder]=\"'tables.search' | bbLocalize\"\n bbInput\n autocomplete=\"off\">\n <bb-icon *ngIf=\"queryControl?.value?.length <= 0; else closeButtonTemplate\"\n bbSuffix\n src=\"material:search\">\n </bb-icon>\n </bb-form-control>\n</ng-template>\n\n<!--\n This is the template that will be used when the user has not\n supplied a custom footer template.\n-->\n\n<ng-template #footerTemplate>\n <bb-form-control *ngIf=\"sizes?.length > 1\">\n <select [formControl]=\"pageSizeControl\"\n bbInput\n title=\"Sizes\">\n <option *ngFor=\"let item of sizes; trackBy: trackByValue\"\n [ngValue]=\"item\">\n {{ item }} / {{ 'tables.page' | bbLocalize }}\n </option>\n </select>\n </bb-form-control>\n\n <bb-table-pager [totalPages]=\"(data$ | async)?.result?.totalPages\"\n [formControl]=\"pageNumberControl\">\n </bb-table-pager>\n</ng-template>\n\n<!--\n This the template that will be used when the user\n has filled in some data in the query control.\n-->\n\n<ng-template #closeButtonTemplate>\n <button bbSuffix\n (click)=\"queryControl?.patchValue('')\"\n type=\"button\"\n class=\"bb-table-progress-close-query\">\n <bb-icon src=\"material:close\"></bb-icon>\n </button>\n</ng-template>\n\n<ng-template #errorTemplate let-state=\"state\" let-status=\"statusCode\">\n <tr>\n <td [attr.colspan]=\"tableColumnTemplates?.length\"\n class=\"bb-table-template\">\n <div class=\"bb-table-template-content\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"64\" height=\"41\">\n <g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(0 1)\">\n <ellipse cx=\"32\" cy=\"33\" fill=\"#F5F5F5\" rx=\"32\" ry=\"7\"></ellipse>\n <g fill-rule=\"nonzero\" stroke=\"#D9D9D9\">\n <path\n d=\"M55 12.7605604L44.8543047 1.25739633C44.3674414.47382661 43.6558789 0 42.9067617 0H21.0932383c-.7491172 0-1.4606797.47395025-1.947543 1.25739633L9 12.7605604V22h46v-9.2394396z\"></path>\n <path fill=\"#FAFAFA\"\n d=\"M41.6132813 15.9315c0-1.6056489.9936718-2.931266 2.2264179-2.9315H55v18.1371277C55 33.2589574 53.6793867 35 52.0504297 35H11.94957031C10.32052344 35 9 33.2588404 9 31.1371277V13h11.1603008c1.2327461 0 2.226418 1.3228085 2.226418 2.9284574v.0211809c0 1.6056489 1.0049921 2.9015426 2.2377382 2.9015426h14.751086c1.2327461 0 2.2377383-1.3078298 2.2377383-2.9134788V15.9315z\"></path>\n </g>\n </g>\n </svg>\n <span *ngIf=\"state as stateLabel\">{{ ('tables.' + stateLabel) | bbLocalize }}</span>\n <span *ngIf=\"status as statusCode\"\n class=\"bb-table-template-content-code\">(HTTP {{ statusCode }})</span>\n </div>\n </td>\n </tr>\n</ng-template>\n", styles: [".bb-table{width:100%;display:block;box-shadow:0 6px 6px -6px #0000001a}.bb-table.plain{box-shadow:none}.bb-table.plain>.bb-table-wrapper{border-top-left-radius:0;border-top-right-radius:0}.bb-table-wrapper{overflow-x:auto;position:relative;background-color:#fff;border-top-left-radius:4px;border-top-right-radius:4px}.bb-table-container{width:100%}.bb-table-container td{border-bottom:1px solid #d8d8d8}.bb-table-top-actions{display:flex;flex-wrap:wrap;flex-direction:column;padding:20px 20px 10px;background-color:#fff;justify-content:flex-end;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #d8d8d8}.bb-table-top-actions>*{margin-left:0;margin-bottom:10px}.bb-table-top-actions+.bb-table-wrapper{border-radius:0}.bb-table-bottom-actions{height:60px;display:flex;padding:0 20px;overflow-x:auto;align-items:center;background-color:#fff;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.bb-table-template{border:none;background-color:#f5f5f5;border-bottom:1px solid #d8d8d8}.bb-table-template-content{padding:20px;display:flex;color:#3d464d;font-size:14px;line-height:1.2;font-weight:400;min-height:140px;text-align:center;align-items:center;flex-direction:column;justify-content:center}.bb-table-template-content>svg{margin-bottom:12px}.bb-table-template-content-code{opacity:.5;margin-top:5px;display:inline-block}.bb-table-progress{top:0;left:0;right:0;opacity:0;width:100%;height:4px;display:block;overflow:hidden;position:absolute;background-color:#2f408b4d;-webkit-animation:fadeIn .25s cubic-bezier(0,0,.2,1) .1s forwards;animation:fadeIn .25s cubic-bezier(0,0,.2,1) .1s forwards}.bb-table-progress .bb-table-indeterminate{background-color:#2f408b}.bb-table-progress .bb-table-indeterminate:before{top:0;left:0;bottom:0;content:\"\";position:absolute;will-change:left,right;background-color:inherit;-webkit-animation:indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite;animation:indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite}.bb-table-progress .bb-table-indeterminate:after{top:0;left:0;bottom:0;content:\"\";position:absolute;-webkit-animation-delay:1.15s;animation-delay:1.15s;will-change:left,right;background-color:inherit;-webkit-animation:indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite;animation:indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite}.bb-table-progress-close-query{padding:0;border:none;border-radius:4px;background-color:transparent;transition:background-color .25s cubic-bezier(0,0,.2,1)}.bb-table-progress-close-query:hover{background-color:#00000014}.bb-table-progress-close-query:focus{background-color:#0000001f}.bb-table-progress-close-query:active{background-color:#00000029}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@-webkit-keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}@keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}@media only screen and (min-width: 768px){.bb-table-top-actions{flex-direction:row}.bb-table-top-actions>*:not(:first-child){margin-left:10px;margin-bottom:10px}}\n"], components: [{ type: i1__namespace.BbFormControl, selector: "bb-form-control", inputs: ["grouped", "hideErrors", "label", "hint"] }, { type: i1__namespace.BbIcon, selector: "bb-icon", inputs: ["alt", "size", "src", "ariaHidden"] }, { type: BbTablePager, selector: "bb-table-pager", inputs: ["disabled", "amountOfButtons", "showArrowButtons", "pageNumber", "totalPages"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace.BbInput, selector: "input[bbInput], textarea[bbInput]", inputs: ["readonly"] }, { type: i4__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1__namespace.BbSuffix, selector: "[bbSuffix]" }, { type: i1__namespace.BbSelect, selector: "select[bbInput]", inputs: ["disabled", "required"] }, { type: i4__namespace.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i4__namespace.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i4__namespace.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }], pipes: { "async": i3__namespace.AsyncPipe, "bbLocalize": i5__namespace.BbLocalize }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
799
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbTable, decorators: [{
|
|
800
|
+
type: i0.Component,
|
|
801
|
+
args: [{
|
|
802
|
+
selector: 'bb-table',
|
|
803
|
+
templateUrl: './table.component.html',
|
|
804
|
+
styleUrls: ['./table.component.scss'],
|
|
805
|
+
host: { 'class': 'bb-table' },
|
|
806
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
807
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
808
|
+
preserveWhitespaces: false
|
|
809
|
+
}]
|
|
810
|
+
}], propDecorators: { tableColumnTemplates: [{
|
|
811
|
+
type: i0.ContentChildren,
|
|
812
|
+
args: [BbTableColumnDef, { read: i0.TemplateRef }]
|
|
813
|
+
}], identifier: [{
|
|
814
|
+
type: i0.Input
|
|
815
|
+
}], dataSource: [{
|
|
816
|
+
type: i0.Input
|
|
817
|
+
}], queryFields: [{
|
|
818
|
+
type: i0.Input
|
|
819
|
+
}], sortingStrategy: [{
|
|
820
|
+
type: i0.Input
|
|
821
|
+
}], header: [{
|
|
822
|
+
type: i0.Input
|
|
823
|
+
}], footer: [{
|
|
824
|
+
type: i0.Input
|
|
825
|
+
}], sizes: [{
|
|
826
|
+
type: i0.Input
|
|
829
827
|
}] } });
|
|
830
828
|
|
|
831
|
-
var BbTableCell = /** @class */ (function () {
|
|
832
|
-
function BbTableCell() {
|
|
833
|
-
}
|
|
834
|
-
return BbTableCell;
|
|
835
|
-
}());
|
|
836
|
-
BbTableCell.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
837
|
-
BbTableCell.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.
|
|
838
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
839
|
-
type: i0.Component,
|
|
840
|
-
args: [{
|
|
841
|
-
selector: 'bb-table-cell',
|
|
842
|
-
templateUrl: './table-cell.component.html',
|
|
843
|
-
styleUrls: ['./table-cell.component.scss'],
|
|
844
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
845
|
-
host: { 'class': 'bb-table-cell' },
|
|
846
|
-
encapsulation: i0.ViewEncapsulation.None,
|
|
847
|
-
preserveWhitespaces: false
|
|
848
|
-
}]
|
|
829
|
+
var BbTableCell = /** @class */ (function () {
|
|
830
|
+
function BbTableCell() {
|
|
831
|
+
}
|
|
832
|
+
return BbTableCell;
|
|
833
|
+
}());
|
|
834
|
+
BbTableCell.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbTableCell, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
835
|
+
BbTableCell.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.10", type: BbTableCell, selector: "bb-table-cell", host: { classAttribute: "bb-table-cell" }, ngImport: i0__namespace, template: "<div>\n <ng-content></ng-content>\n</div>", styles: [".bb-table-cell{color:#848f99;font-size:14px;text-align:left;line-height:1.2;font-weight:400;padding:12px 20px;display:table-cell;word-wrap:break-word;vertical-align:middle;background-color:#f5f5f5;border-bottom:1px solid #d8d8d8}.bb-table-cell:not(:last-child){border-right:1px solid #d8d8d8}.bb-table-cell.fit{width:1%;white-space:nowrap}.bb-table-cell.left{text-align:left}.bb-table-cell.center{text-align:center}.bb-table-cell.right{text-align:right}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
836
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbTableCell, decorators: [{
|
|
837
|
+
type: i0.Component,
|
|
838
|
+
args: [{
|
|
839
|
+
selector: 'bb-table-cell',
|
|
840
|
+
templateUrl: './table-cell.component.html',
|
|
841
|
+
styleUrls: ['./table-cell.component.scss'],
|
|
842
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
843
|
+
host: { 'class': 'bb-table-cell' },
|
|
844
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
845
|
+
preserveWhitespaces: false
|
|
846
|
+
}]
|
|
849
847
|
}] });
|
|
850
848
|
|
|
851
|
-
var BbTableHeaderCellBase = /** @class */ (function () {
|
|
852
|
-
function BbTableHeaderCellBase() {
|
|
853
|
-
}
|
|
854
|
-
return BbTableHeaderCellBase;
|
|
855
|
-
}());
|
|
856
|
-
var BbTableHeaderCellMixinBase = bbFoundation.mixinDisabled(BbTableHeaderCellBase);
|
|
857
|
-
var BbTableHeaderCell = /** @class */ (function (_super) {
|
|
858
|
-
__extends(BbTableHeaderCell, _super);
|
|
859
|
-
function BbTableHeaderCell(_table, _name) {
|
|
860
|
-
var _this = _super.call(this) || this;
|
|
861
|
-
_this._table = _table;
|
|
862
|
-
_this._name = _name;
|
|
863
|
-
// Constants.
|
|
864
|
-
_this._sortDirections = ['none', 'asc', 'desc'];
|
|
865
|
-
_this._control = new i4.FormControl(_this._sortDirections[0]);
|
|
866
|
-
_this.logWarning = function (message) {
|
|
867
|
-
console && console.warn && console.warn(message);
|
|
868
|
-
};
|
|
869
|
-
return _this;
|
|
870
|
-
}
|
|
871
|
-
Object.defineProperty(BbTableHeaderCell.prototype, "sort", {
|
|
872
|
-
get: function () {
|
|
873
|
-
return this._control.value;
|
|
874
|
-
},
|
|
875
|
-
// Sort.
|
|
876
|
-
set: function (value) {
|
|
877
|
-
// Check if the new value is a valid value.
|
|
878
|
-
if (!this._sortDirections.includes(value)) {
|
|
879
|
-
return;
|
|
880
|
-
}
|
|
881
|
-
// Set the value.
|
|
882
|
-
this._control.setValue(value);
|
|
883
|
-
},
|
|
884
|
-
enumerable: false,
|
|
885
|
-
configurable: true
|
|
886
|
-
});
|
|
887
|
-
BbTableHeaderCell.prototype.ngOnInit = function () {
|
|
888
|
-
var _a, _b;
|
|
889
|
-
// Validate that the name and table are set.
|
|
890
|
-
if (!this._table || !this._name) {
|
|
891
|
-
return;
|
|
892
|
-
}
|
|
893
|
-
// Check if the control already exists in the table.
|
|
894
|
-
if ((_a = this._table.sortControl) === null || _a === void 0 ? void 0 : _a.contains(this._name)) {
|
|
895
|
-
this.disabled = true;
|
|
896
|
-
return this.logWarning("BbTableHeaderCell: The name \"" + this._name + "\" is not unique in the table; Control was not registered.");
|
|
897
|
-
}
|
|
898
|
-
// Register the header cell with the table.
|
|
899
|
-
(_b = this._table.sortControl) === null || _b === void 0 ? void 0 : _b.addControl(this._name, this._control);
|
|
900
|
-
// Get all the value changes.
|
|
901
|
-
this.valueChanges$ = this._control.valueChanges.pipe(operators.startWith(this._control.value));
|
|
902
|
-
};
|
|
903
|
-
BbTableHeaderCell.prototype.ngOnDestroy = function () {
|
|
904
|
-
var _a, _b, _c, _d;
|
|
905
|
-
// Validate that the name and table are set.
|
|
906
|
-
if (!this._table || !this._name) {
|
|
907
|
-
return;
|
|
908
|
-
}
|
|
909
|
-
// Un-register the header cell with the table.
|
|
910
|
-
if ((_b = (_a = this._table) === null || _a === void 0 ? void 0 : _a.sortControl) === null || _b === void 0 ? void 0 : _b.contains(this._name)) {
|
|
911
|
-
(_d = (_c = this._table) === null || _c === void 0 ? void 0 : _c.sortControl) === null || _d === void 0 ? void 0 : _d.removeControl(this._name);
|
|
912
|
-
}
|
|
913
|
-
};
|
|
914
|
-
Object.defineProperty(BbTableHeaderCell.prototype, "isDisabled", {
|
|
915
|
-
get: function () {
|
|
916
|
-
return this.disabled || !this._name;
|
|
917
|
-
},
|
|
918
|
-
enumerable: false,
|
|
919
|
-
configurable: true
|
|
920
|
-
});
|
|
921
|
-
BbTableHeaderCell.prototype.onClick = function () {
|
|
922
|
-
var _this = this;
|
|
923
|
-
// Check if the header cell is disabled.
|
|
924
|
-
if (this.isDisabled) {
|
|
925
|
-
return;
|
|
926
|
-
}
|
|
927
|
-
// Find the index of the current sort and
|
|
928
|
-
// create the new index.
|
|
929
|
-
var index = this._sortDirections.findIndex(function (item) { return item === _this._control.value; });
|
|
930
|
-
var newIndex = (index + 1) % this._sortDirections.length;
|
|
931
|
-
var newSort = this._sortDirections[newIndex];
|
|
932
|
-
// Set the new sort.
|
|
933
|
-
return this.updateTableAndHeaderCell(newSort);
|
|
934
|
-
};
|
|
935
|
-
BbTableHeaderCell.prototype.updateTableAndHeaderCell = function (value) {
|
|
936
|
-
// Check if the new value is a valid value.
|
|
937
|
-
if (!this._sortDirections.includes(value)) {
|
|
938
|
-
return;
|
|
939
|
-
}
|
|
940
|
-
// Validate the table exists.
|
|
941
|
-
if (!this._table) {
|
|
942
|
-
return this._control.setValue(value);
|
|
943
|
-
}
|
|
944
|
-
// Handle the single sorting strategy.
|
|
945
|
-
if (this._table.sortingStrategy === 'single') {
|
|
946
|
-
return this.handleSingleSortingStrategy(value);
|
|
947
|
-
}
|
|
948
|
-
// Default case when no other strategy
|
|
949
|
-
// is used.
|
|
950
|
-
return this._control.setValue(value);
|
|
951
|
-
};
|
|
952
|
-
BbTableHeaderCell.prototype.handleSingleSortingStrategy = function (value) {
|
|
953
|
-
var _this = this;
|
|
954
|
-
var _a, _b;
|
|
955
|
-
// Get the sort control.
|
|
956
|
-
var control = this._table.sortControl;
|
|
957
|
-
// Set each value to false since we only want to
|
|
958
|
-
// sort on one property at a time with this strategy.
|
|
959
|
-
var newValue = Object.keys(control.controls).reduce(function (previous, current) {
|
|
960
|
-
previous[current] = current === _this._name ? value : 'none';
|
|
961
|
-
return previous;
|
|
962
|
-
}, {});
|
|
963
|
-
// Patch the entire sort value.
|
|
964
|
-
(_b = (_a = this._table) === null || _a === void 0 ? void 0 : _a.sortControl) === null || _b === void 0 ? void 0 : _b.patchValue(newValue);
|
|
965
|
-
};
|
|
966
|
-
return BbTableHeaderCell;
|
|
967
|
-
}(BbTableHeaderCellMixinBase));
|
|
968
|
-
BbTableHeaderCell.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
969
|
-
BbTableHeaderCell.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.
|
|
970
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
971
|
-
type: i0.Component,
|
|
972
|
-
args: [{
|
|
973
|
-
selector: 'bb-table-header-cell',
|
|
974
|
-
templateUrl: './table-header-cell.component.html',
|
|
975
|
-
styleUrls: ['./table-header-cell.component.scss'],
|
|
976
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
977
|
-
host: {
|
|
978
|
-
'class': 'bb-table-header-cell',
|
|
979
|
-
'[class.disabled]': 'isDisabled'
|
|
980
|
-
},
|
|
981
|
-
inputs: ['disabled'],
|
|
982
|
-
encapsulation: i0.ViewEncapsulation.None,
|
|
983
|
-
preserveWhitespaces: false
|
|
984
|
-
}]
|
|
985
|
-
}], ctorParameters: function () {
|
|
986
|
-
return [{ type: BbTable, decorators: [{
|
|
987
|
-
type: i0.Optional
|
|
988
|
-
}, {
|
|
989
|
-
type: i0.Host
|
|
990
|
-
}] }, { type: undefined, decorators: [{
|
|
991
|
-
type: i0.Optional
|
|
992
|
-
}, {
|
|
993
|
-
type: i0.Attribute,
|
|
994
|
-
args: ['name']
|
|
995
|
-
}] }];
|
|
996
|
-
}, propDecorators: { sort: [{
|
|
997
|
-
type: i0.Input
|
|
998
|
-
}], onClick: [{
|
|
999
|
-
type: i0.HostListener,
|
|
1000
|
-
args: ['click']
|
|
849
|
+
var BbTableHeaderCellBase = /** @class */ (function () {
|
|
850
|
+
function BbTableHeaderCellBase() {
|
|
851
|
+
}
|
|
852
|
+
return BbTableHeaderCellBase;
|
|
853
|
+
}());
|
|
854
|
+
var BbTableHeaderCellMixinBase = bbFoundation.mixinDisabled(BbTableHeaderCellBase);
|
|
855
|
+
var BbTableHeaderCell = /** @class */ (function (_super) {
|
|
856
|
+
__extends(BbTableHeaderCell, _super);
|
|
857
|
+
function BbTableHeaderCell(_table, _name) {
|
|
858
|
+
var _this = _super.call(this) || this;
|
|
859
|
+
_this._table = _table;
|
|
860
|
+
_this._name = _name;
|
|
861
|
+
// Constants.
|
|
862
|
+
_this._sortDirections = ['none', 'asc', 'desc'];
|
|
863
|
+
_this._control = new i4.FormControl(_this._sortDirections[0]);
|
|
864
|
+
_this.logWarning = function (message) {
|
|
865
|
+
console && console.warn && console.warn(message);
|
|
866
|
+
};
|
|
867
|
+
return _this;
|
|
868
|
+
}
|
|
869
|
+
Object.defineProperty(BbTableHeaderCell.prototype, "sort", {
|
|
870
|
+
get: function () {
|
|
871
|
+
return this._control.value;
|
|
872
|
+
},
|
|
873
|
+
// Sort.
|
|
874
|
+
set: function (value) {
|
|
875
|
+
// Check if the new value is a valid value.
|
|
876
|
+
if (!this._sortDirections.includes(value)) {
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
// Set the value.
|
|
880
|
+
this._control.setValue(value);
|
|
881
|
+
},
|
|
882
|
+
enumerable: false,
|
|
883
|
+
configurable: true
|
|
884
|
+
});
|
|
885
|
+
BbTableHeaderCell.prototype.ngOnInit = function () {
|
|
886
|
+
var _a, _b;
|
|
887
|
+
// Validate that the name and table are set.
|
|
888
|
+
if (!this._table || !this._name) {
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
// Check if the control already exists in the table.
|
|
892
|
+
if ((_a = this._table.sortControl) === null || _a === void 0 ? void 0 : _a.contains(this._name)) {
|
|
893
|
+
this.disabled = true;
|
|
894
|
+
return this.logWarning("BbTableHeaderCell: The name \"" + this._name + "\" is not unique in the table; Control was not registered.");
|
|
895
|
+
}
|
|
896
|
+
// Register the header cell with the table.
|
|
897
|
+
(_b = this._table.sortControl) === null || _b === void 0 ? void 0 : _b.addControl(this._name, this._control);
|
|
898
|
+
// Get all the value changes.
|
|
899
|
+
this.valueChanges$ = this._control.valueChanges.pipe(operators.startWith(this._control.value));
|
|
900
|
+
};
|
|
901
|
+
BbTableHeaderCell.prototype.ngOnDestroy = function () {
|
|
902
|
+
var _a, _b, _c, _d;
|
|
903
|
+
// Validate that the name and table are set.
|
|
904
|
+
if (!this._table || !this._name) {
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
// Un-register the header cell with the table.
|
|
908
|
+
if ((_b = (_a = this._table) === null || _a === void 0 ? void 0 : _a.sortControl) === null || _b === void 0 ? void 0 : _b.contains(this._name)) {
|
|
909
|
+
(_d = (_c = this._table) === null || _c === void 0 ? void 0 : _c.sortControl) === null || _d === void 0 ? void 0 : _d.removeControl(this._name);
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
Object.defineProperty(BbTableHeaderCell.prototype, "isDisabled", {
|
|
913
|
+
get: function () {
|
|
914
|
+
return this.disabled || !this._name;
|
|
915
|
+
},
|
|
916
|
+
enumerable: false,
|
|
917
|
+
configurable: true
|
|
918
|
+
});
|
|
919
|
+
BbTableHeaderCell.prototype.onClick = function () {
|
|
920
|
+
var _this = this;
|
|
921
|
+
// Check if the header cell is disabled.
|
|
922
|
+
if (this.isDisabled) {
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
// Find the index of the current sort and
|
|
926
|
+
// create the new index.
|
|
927
|
+
var index = this._sortDirections.findIndex(function (item) { return item === _this._control.value; });
|
|
928
|
+
var newIndex = (index + 1) % this._sortDirections.length;
|
|
929
|
+
var newSort = this._sortDirections[newIndex];
|
|
930
|
+
// Set the new sort.
|
|
931
|
+
return this.updateTableAndHeaderCell(newSort);
|
|
932
|
+
};
|
|
933
|
+
BbTableHeaderCell.prototype.updateTableAndHeaderCell = function (value) {
|
|
934
|
+
// Check if the new value is a valid value.
|
|
935
|
+
if (!this._sortDirections.includes(value)) {
|
|
936
|
+
return;
|
|
937
|
+
}
|
|
938
|
+
// Validate the table exists.
|
|
939
|
+
if (!this._table) {
|
|
940
|
+
return this._control.setValue(value);
|
|
941
|
+
}
|
|
942
|
+
// Handle the single sorting strategy.
|
|
943
|
+
if (this._table.sortingStrategy === 'single') {
|
|
944
|
+
return this.handleSingleSortingStrategy(value);
|
|
945
|
+
}
|
|
946
|
+
// Default case when no other strategy
|
|
947
|
+
// is used.
|
|
948
|
+
return this._control.setValue(value);
|
|
949
|
+
};
|
|
950
|
+
BbTableHeaderCell.prototype.handleSingleSortingStrategy = function (value) {
|
|
951
|
+
var _this = this;
|
|
952
|
+
var _a, _b;
|
|
953
|
+
// Get the sort control.
|
|
954
|
+
var control = this._table.sortControl;
|
|
955
|
+
// Set each value to false since we only want to
|
|
956
|
+
// sort on one property at a time with this strategy.
|
|
957
|
+
var newValue = Object.keys(control.controls).reduce(function (previous, current) {
|
|
958
|
+
previous[current] = current === _this._name ? value : 'none';
|
|
959
|
+
return previous;
|
|
960
|
+
}, {});
|
|
961
|
+
// Patch the entire sort value.
|
|
962
|
+
(_b = (_a = this._table) === null || _a === void 0 ? void 0 : _a.sortControl) === null || _b === void 0 ? void 0 : _b.patchValue(newValue);
|
|
963
|
+
};
|
|
964
|
+
return BbTableHeaderCell;
|
|
965
|
+
}(BbTableHeaderCellMixinBase));
|
|
966
|
+
BbTableHeaderCell.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbTableHeaderCell, deps: [{ token: BbTable, host: true, optional: true }, { token: 'name', attribute: true, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
967
|
+
BbTableHeaderCell.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.10", type: BbTableHeaderCell, selector: "bb-table-header-cell", inputs: { disabled: "disabled", sort: "sort" }, host: { listeners: { "click": "onClick()" }, properties: { "class.disabled": "isDisabled" }, classAttribute: "bb-table-header-cell" }, usesInheritance: true, ngImport: i0__namespace, template: "<!-- The content. -->\n<ng-content></ng-content>\n\n<!-- The indicator for the sort direction. -->\n<ng-container *ngIf=\"valueChanges$ | async as value\">\n <button *ngIf=\"!isDisabled\"\n [class.asc]=\"value === 'asc'\"\n [class.desc]=\"value === 'desc'\"\n class=\"bb-table-header-cell-toggle\"\n type=\"button\"></button>\n</ng-container>\n", styles: [".bb-table-header-cell{height:50px;color:#212529;cursor:pointer;font-size:16px;font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:10px 20px;position:relative;display:table-cell;vertical-align:middle;border-bottom:1px solid #d8d8d8}.bb-table-header-cell:active>.bb-table-header-cell-toggle{background-color:#00000014}.bb-table-header-cell:not(.disabled){padding-right:52px}.bb-table-header-cell.fit{width:1%;white-space:nowrap}.bb-table-header-cell.left{text-align:left}.bb-table-header-cell.center{text-align:center}.bb-table-header-cell.right{text-align:right}.bb-table-header-cell.disabled{cursor:default;pointer-events:none}.bb-table-header-cell-toggle{top:50%;right:14px;width:22px;border:none;height:22px;margin-left:auto;position:absolute;border-radius:4px;transform:translateY(-50%);background-position:center;background-repeat:no-repeat;background-color:transparent;transition:background-color .2s cubic-bezier(0,0,.2,1);background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 9 15\" width=\"9\" height=\"15\"%3E%3Cpath fill=\"%23dcdcdc\" d=\"M4.5 0L0 7h9z\"%3E%3C/path%3E%3Cpath fill=\"%23dcdcdc\" d=\"M4.5 15L9 8H0z\"%3E%3C/path%3E%3C/svg%3E')}.bb-table-header-cell-toggle.desc{background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 9 15\" width=\"9\" height=\"15\"%3E%3Cpath fill=\"%23dcdcdc\" d=\"M4.5 0L0 7h9z\"%3E%3C/path%3E%3Cpath fill=\"black\" d=\"M4.5 15L9 8H0z\"%3E%3C/path%3E%3C/svg%3E')}.bb-table-header-cell-toggle.asc{background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 9 15\" width=\"9\" height=\"15\"%3E%3Cpath fill=\"black\" d=\"M4.5 0L0 7h9z\"%3E%3C/path%3E%3Cpath fill=\"%23dcdcdc\" d=\"M4.5 15L9 8H0z\"%3E%3C/path%3E%3C/svg%3E')}\n"], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
968
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbTableHeaderCell, decorators: [{
|
|
969
|
+
type: i0.Component,
|
|
970
|
+
args: [{
|
|
971
|
+
selector: 'bb-table-header-cell',
|
|
972
|
+
templateUrl: './table-header-cell.component.html',
|
|
973
|
+
styleUrls: ['./table-header-cell.component.scss'],
|
|
974
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
975
|
+
host: {
|
|
976
|
+
'class': 'bb-table-header-cell',
|
|
977
|
+
'[class.disabled]': 'isDisabled'
|
|
978
|
+
},
|
|
979
|
+
inputs: ['disabled'],
|
|
980
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
981
|
+
preserveWhitespaces: false
|
|
982
|
+
}]
|
|
983
|
+
}], ctorParameters: function () {
|
|
984
|
+
return [{ type: BbTable, decorators: [{
|
|
985
|
+
type: i0.Optional
|
|
986
|
+
}, {
|
|
987
|
+
type: i0.Host
|
|
988
|
+
}] }, { type: undefined, decorators: [{
|
|
989
|
+
type: i0.Optional
|
|
990
|
+
}, {
|
|
991
|
+
type: i0.Attribute,
|
|
992
|
+
args: ['name']
|
|
993
|
+
}] }];
|
|
994
|
+
}, propDecorators: { sort: [{
|
|
995
|
+
type: i0.Input
|
|
996
|
+
}], onClick: [{
|
|
997
|
+
type: i0.HostListener,
|
|
998
|
+
args: ['click']
|
|
1001
999
|
}] } });
|
|
1002
1000
|
|
|
1003
|
-
var DECLARATIONS_EXPORTS = [
|
|
1004
|
-
BbTable,
|
|
1005
|
-
BbTableColumnDef,
|
|
1006
|
-
BbTableHeaderCell,
|
|
1007
|
-
BbTableCell,
|
|
1008
|
-
BbTablePager
|
|
1009
|
-
];
|
|
1010
|
-
var TableModule = /** @class */ (function () {
|
|
1011
|
-
function TableModule() {
|
|
1012
|
-
}
|
|
1013
|
-
return TableModule;
|
|
1014
|
-
}());
|
|
1015
|
-
TableModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.
|
|
1016
|
-
TableModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.
|
|
1017
|
-
BbTableColumnDef,
|
|
1018
|
-
BbTableHeaderCell,
|
|
1019
|
-
BbTableCell,
|
|
1020
|
-
BbTablePager], imports: [i3.CommonModule, i4.ReactiveFormsModule, i1.ElementsModule, i5.LocalizeModule], exports: [BbTable,
|
|
1021
|
-
BbTableColumnDef,
|
|
1022
|
-
BbTableHeaderCell,
|
|
1023
|
-
BbTableCell,
|
|
1024
|
-
BbTablePager] });
|
|
1025
|
-
TableModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.
|
|
1026
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.
|
|
1027
|
-
type: i0.NgModule,
|
|
1028
|
-
args: [{
|
|
1029
|
-
imports: [i3.CommonModule, i4.ReactiveFormsModule, i1.ElementsModule, i5.LocalizeModule],
|
|
1030
|
-
declarations: __spreadArray([], __read(DECLARATIONS_EXPORTS)),
|
|
1031
|
-
exports: __spreadArray([], __read(DECLARATIONS_EXPORTS))
|
|
1032
|
-
}]
|
|
1001
|
+
var DECLARATIONS_EXPORTS = [
|
|
1002
|
+
BbTable,
|
|
1003
|
+
BbTableColumnDef,
|
|
1004
|
+
BbTableHeaderCell,
|
|
1005
|
+
BbTableCell,
|
|
1006
|
+
BbTablePager
|
|
1007
|
+
];
|
|
1008
|
+
var TableModule = /** @class */ (function () {
|
|
1009
|
+
function TableModule() {
|
|
1010
|
+
}
|
|
1011
|
+
return TableModule;
|
|
1012
|
+
}());
|
|
1013
|
+
TableModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: TableModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1014
|
+
TableModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: TableModule, declarations: [BbTable,
|
|
1015
|
+
BbTableColumnDef,
|
|
1016
|
+
BbTableHeaderCell,
|
|
1017
|
+
BbTableCell,
|
|
1018
|
+
BbTablePager], imports: [i3.CommonModule, i4.ReactiveFormsModule, i1.ElementsModule, i5.LocalizeModule], exports: [BbTable,
|
|
1019
|
+
BbTableColumnDef,
|
|
1020
|
+
BbTableHeaderCell,
|
|
1021
|
+
BbTableCell,
|
|
1022
|
+
BbTablePager] });
|
|
1023
|
+
TableModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: TableModule, imports: [[i3.CommonModule, i4.ReactiveFormsModule, i1.ElementsModule, i5.LocalizeModule]] });
|
|
1024
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: TableModule, decorators: [{
|
|
1025
|
+
type: i0.NgModule,
|
|
1026
|
+
args: [{
|
|
1027
|
+
imports: [i3.CommonModule, i4.ReactiveFormsModule, i1.ElementsModule, i5.LocalizeModule],
|
|
1028
|
+
declarations: __spreadArray([], __read(DECLARATIONS_EXPORTS)),
|
|
1029
|
+
exports: __spreadArray([], __read(DECLARATIONS_EXPORTS))
|
|
1030
|
+
}]
|
|
1033
1031
|
}] });
|
|
1034
1032
|
|
|
1035
|
-
/**
|
|
1036
|
-
* Generated bundle index. Do not edit.
|
|
1033
|
+
/**
|
|
1034
|
+
* Generated bundle index. Do not edit.
|
|
1037
1035
|
*/
|
|
1038
1036
|
|
|
1039
1037
|
exports.BbTable = BbTable;
|
|
@@ -1048,5 +1046,5 @@
|
|
|
1048
1046
|
|
|
1049
1047
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1050
1048
|
|
|
1051
|
-
}))
|
|
1049
|
+
}));
|
|
1052
1050
|
//# sourceMappingURL=bravobit-bb-foundation-table.umd.js.map
|