@theseam/ui-common 0.2.12 → 0.2.16
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/assets/vendor/intl-tel-input/js/utils.js +255 -254
- package/bundles/theseam-ui-common-asset-reader.umd.js +7 -9
- package/bundles/theseam-ui-common-asset-reader.umd.js.map +1 -1
- package/bundles/theseam-ui-common-breadcrumbs.umd.js +6 -8
- package/bundles/theseam-ui-common-breadcrumbs.umd.js.map +1 -1
- package/bundles/theseam-ui-common-buttons.umd.js +5 -5
- package/bundles/theseam-ui-common-buttons.umd.js.map +1 -1
- package/bundles/theseam-ui-common-card.umd.js +6 -6
- package/bundles/theseam-ui-common-card.umd.js.map +1 -1
- package/bundles/theseam-ui-common-checkbox.umd.js +4 -4
- package/bundles/theseam-ui-common-checkbox.umd.js.map +1 -1
- package/bundles/theseam-ui-common-confirm-dialog.umd.js +4 -4
- package/bundles/theseam-ui-common-confirm-dialog.umd.js.map +1 -1
- package/bundles/theseam-ui-common-core.umd.js +4 -4
- package/bundles/theseam-ui-common-core.umd.js.map +1 -1
- package/bundles/theseam-ui-common-data-exporter.umd.js +5 -5
- package/bundles/theseam-ui-common-data-filters.umd.js +9 -6
- package/bundles/theseam-ui-common-data-filters.umd.js.map +1 -1
- package/bundles/theseam-ui-common-datatable-dynamic.umd.js +7 -7
- package/bundles/theseam-ui-common-datatable-dynamic.umd.js.map +1 -1
- package/bundles/theseam-ui-common-datatable.umd.js +1308 -378
- package/bundles/theseam-ui-common-datatable.umd.js.map +1 -1
- package/bundles/theseam-ui-common-dynamic-component-loader.umd.js +5 -7
- package/bundles/theseam-ui-common-dynamic-component-loader.umd.js.map +1 -1
- package/bundles/theseam-ui-common-dynamic.umd.js +7 -9
- package/bundles/theseam-ui-common-dynamic.umd.js.map +1 -1
- package/bundles/theseam-ui-common-footer-bar.umd.js +3 -3
- package/bundles/theseam-ui-common-form-field-error.umd.js +5 -5
- package/bundles/theseam-ui-common-form-field-error.umd.js.map +1 -1
- package/bundles/theseam-ui-common-form-field.umd.js +5 -5
- package/bundles/theseam-ui-common-form-field.umd.js.map +1 -1
- package/bundles/theseam-ui-common-framework.umd.js +27 -29
- package/bundles/theseam-ui-common-framework.umd.js.map +1 -1
- package/bundles/theseam-ui-common-graphql.umd.js +958 -8
- package/bundles/theseam-ui-common-graphql.umd.js.map +1 -1
- package/bundles/theseam-ui-common-icon.umd.js +5 -5
- package/bundles/theseam-ui-common-icon.umd.js.map +1 -1
- package/bundles/theseam-ui-common-layout.umd.js +5 -7
- package/bundles/theseam-ui-common-layout.umd.js.map +1 -1
- package/bundles/theseam-ui-common-loading.umd.js +4 -4
- package/bundles/theseam-ui-common-menu.umd.js +5 -5
- package/bundles/theseam-ui-common-menu.umd.js.map +1 -1
- package/bundles/theseam-ui-common-modal.umd.js +6 -6
- package/bundles/theseam-ui-common-modal.umd.js.map +1 -1
- package/bundles/theseam-ui-common-models.umd.js +3 -3
- package/bundles/theseam-ui-common-popover.umd.js +4 -4
- package/bundles/theseam-ui-common-progress.umd.js +5 -5
- package/bundles/theseam-ui-common-progress.umd.js.map +1 -1
- package/bundles/theseam-ui-common-scrollbar.umd.js +7 -9
- package/bundles/theseam-ui-common-scrollbar.umd.js.map +1 -1
- package/bundles/theseam-ui-common-services.umd.js +6 -8
- package/bundles/theseam-ui-common-services.umd.js.map +1 -1
- package/bundles/theseam-ui-common-shared.umd.js +4 -4
- package/bundles/theseam-ui-common-shared.umd.js.map +1 -1
- package/bundles/theseam-ui-common-storage.umd.js +5 -7
- package/bundles/theseam-ui-common-storage.umd.js.map +1 -1
- package/bundles/theseam-ui-common-story-helpers.umd.js +4 -4
- package/bundles/theseam-ui-common-story-helpers.umd.js.map +1 -1
- package/bundles/theseam-ui-common-tabbed.umd.js +5 -5
- package/bundles/theseam-ui-common-tabbed.umd.js.map +1 -1
- package/bundles/theseam-ui-common-table-cell-type.umd.js +5 -7
- package/bundles/theseam-ui-common-table-cell-type.umd.js.map +1 -1
- package/bundles/theseam-ui-common-table-cell-types.umd.js +16 -16
- package/bundles/theseam-ui-common-table-cell-types.umd.js.map +1 -1
- package/bundles/theseam-ui-common-table.umd.js +5 -5
- package/bundles/theseam-ui-common-table.umd.js.map +1 -1
- package/bundles/theseam-ui-common-tel-input.umd.js +6 -6
- package/bundles/theseam-ui-common-tel-input.umd.js.map +1 -1
- package/bundles/theseam-ui-common-testing.umd.js +568 -0
- package/bundles/theseam-ui-common-testing.umd.js.map +1 -0
- package/bundles/theseam-ui-common-tiled-select.umd.js +56 -39
- package/bundles/theseam-ui-common-tiled-select.umd.js.map +1 -1
- package/bundles/theseam-ui-common-toggle-edit.umd.js +8 -10
- package/bundles/theseam-ui-common-toggle-edit.umd.js.map +1 -1
- package/bundles/theseam-ui-common-toggle-group.umd.js +4 -4
- package/bundles/theseam-ui-common-toggle-group.umd.js.map +1 -1
- package/bundles/theseam-ui-common-unsaved-changes-dialog.umd.js +5 -7
- package/bundles/theseam-ui-common-unsaved-changes-dialog.umd.js.map +1 -1
- package/bundles/theseam-ui-common-utils.umd.js +174 -81
- package/bundles/theseam-ui-common-utils.umd.js.map +1 -1
- package/bundles/theseam-ui-common-validators.umd.js +3 -3
- package/bundles/theseam-ui-common-viewers.umd.js +6 -8
- package/bundles/theseam-ui-common-viewers.umd.js.map +1 -1
- package/bundles/theseam-ui-common-widget.umd.js +18 -20
- package/bundles/theseam-ui-common-widget.umd.js.map +1 -1
- package/bundles/theseam-ui-common.umd.js +2 -2
- package/buttons/theseam-ui-common-buttons.metadata.json +1 -1
- package/card/theseam-ui-common-card.metadata.json +1 -1
- package/data-filters/data-filter.d.ts +10 -6
- package/data-filters/theseam-ui-common-data-filters.metadata.json +1 -1
- package/datatable/datatable/datatable.component.d.ts +46 -32
- package/datatable/datatable-column/datatable-column.component.d.ts +26 -25
- package/datatable/datatable-column-preferences/datatable-column-preferences.component.d.ts +6 -5
- package/datatable/datatable-column-preferences-button/datatable-column-preferences-button.component.d.ts +7 -1
- package/datatable/datatable-menu-bar/datatable-menu-bar.component.d.ts +1 -1
- package/datatable/directives/datatable-filter.directive.d.ts +1 -1
- package/datatable/models/columns-alteration.d.ts +61 -0
- package/datatable/models/columns-alterations/hide-column.columns-alteration.d.ts +15 -0
- package/datatable/models/columns-alterations/order.columns-alteration.d.ts +20 -0
- package/datatable/models/columns-alterations/sort.columns-alteration.d.ts +14 -0
- package/datatable/models/columns-alterations/width.columns-alteration.d.ts +16 -0
- package/datatable/models/datatable-accessor.d.ts +5 -3
- package/datatable/models/internal-column-props.d.ts +7 -0
- package/datatable/models/page-info.d.ts +12 -0
- package/datatable/models/preferences-accessor.d.ts +1 -1
- package/datatable/models/preferences.d.ts +11 -3
- package/datatable/models/sort-item.d.ts +2 -1
- package/datatable/services/columns-alterations-manager.service.d.ts +39 -0
- package/datatable/services/columns-manager.service.d.ts +55 -0
- package/datatable/services/datatable-preferences.service.d.ts +10 -7
- package/datatable/theseam-ui-common-datatable.d.ts +2 -0
- package/datatable/theseam-ui-common-datatable.metadata.json +1 -1
- package/datatable/tokens/datatable-preferences-accessor.d.ts +2 -2
- package/datatable/utils/create-action-menu-column.d.ts +3 -0
- package/datatable/utils/create-checkbox-column.d.ts +3 -0
- package/datatable/utils/get-column-prop.d.ts +5 -0
- package/datatable/utils/map-columns-alterations-states.d.ts +2 -0
- package/datatable/utils/remove-unused-diffs.d.ts +7 -0
- package/datatable/utils/set-column-defaults.d.ts +2 -0
- package/datatable/utils/translate-templates.d.ts +2 -0
- package/datatable/utils/with-stored-column-info.d.ts +2 -2
- package/datatable-dynamic/theseam-ui-common-datatable-dynamic.metadata.json +1 -1
- package/esm2015/buttons/progress-circle-button/progress-circle-button.component.js +1 -1
- package/esm2015/card/card-action/card-action.component.js +1 -1
- package/esm2015/card/card-body/card-body.component.js +1 -1
- package/esm2015/data-filters/data-filter.js +5 -2
- package/esm2015/data-filters/filters/data-filter-search/data-filter-search.component.js +1 -1
- package/esm2015/data-filters/filters/data-filter-text/data-filter-text.component.js +1 -1
- package/esm2015/datatable/datatable/datatable.component.js +195 -211
- package/esm2015/datatable/datatable-action-menu/datatable-action-menu.component.js +1 -1
- package/esm2015/datatable/datatable-column/datatable-column.component.js +1 -1
- package/esm2015/datatable/datatable-column-preferences/datatable-column-preferences.component.js +36 -19
- package/esm2015/datatable/datatable-column-preferences-button/datatable-column-preferences-button.component.js +38 -4
- package/esm2015/datatable/datatable-export-button/datatable-export-button.component.js +9 -6
- package/esm2015/datatable/datatable-menu-bar/datatable-menu-bar.component.js +1 -1
- package/esm2015/datatable/datatable-menu-bar-column-center/datatable-menu-bar-column-center.component.js +1 -1
- package/esm2015/datatable/datatable-menu-bar-column-left/datatable-menu-bar-column-left.component.js +1 -1
- package/esm2015/datatable/datatable-menu-bar-column-right/datatable-menu-bar-column-right.component.js +1 -1
- package/esm2015/datatable/datatable-menu-bar-row/datatable-menu-bar-row.component.js +1 -1
- package/esm2015/datatable/models/columns-alteration.js +38 -0
- package/esm2015/datatable/models/columns-alterations/hide-column.columns-alteration.js +38 -0
- package/esm2015/datatable/models/columns-alterations/order.columns-alteration.js +81 -0
- package/esm2015/datatable/models/columns-alterations/sort.columns-alteration.js +33 -0
- package/esm2015/datatable/models/columns-alterations/width.columns-alteration.js +41 -0
- package/esm2015/datatable/models/datatable-accessor.js +1 -1
- package/esm2015/datatable/models/internal-column-props.js +15 -0
- package/esm2015/datatable/models/page-info.js +1 -1
- package/esm2015/datatable/models/preferences-accessor.js +1 -1
- package/esm2015/datatable/models/preferences.js +6 -2
- package/esm2015/datatable/models/sort-item.js +1 -1
- package/esm2015/datatable/services/columns-alterations-manager.service.js +134 -0
- package/esm2015/datatable/services/columns-manager.service.js +257 -0
- package/esm2015/datatable/services/datatable-preferences.service.js +78 -32
- package/esm2015/datatable/theseam-ui-common-datatable.js +3 -1
- package/esm2015/datatable/tokens/datatable-preferences-accessor.js +2 -2
- package/esm2015/datatable/utils/create-action-menu-column.js +18 -0
- package/esm2015/datatable/utils/create-checkbox-column.js +15 -0
- package/esm2015/datatable/utils/get-column-prop.js +9 -0
- package/esm2015/datatable/utils/map-columns-alterations-states.js +39 -0
- package/esm2015/datatable/utils/remove-unused-diffs.js +9 -0
- package/esm2015/datatable/utils/set-column-defaults.js +10 -0
- package/esm2015/datatable/utils/translate-templates.js +12 -0
- package/esm2015/datatable/utils/with-stored-column-info.js +1 -1
- package/esm2015/datatable-dynamic/datatable-dynamic-action-menu/datatable-dynamic-action-menu.component.js +1 -1
- package/esm2015/datatable-dynamic/datatable-dynamic-filter-container/datatable-dynamic-filter-container.component.js +1 -1
- package/esm2015/datatable-dynamic/datatable-dynamic.component.js +1 -1
- package/esm2015/form-field/form-field.component.js +1 -1
- package/esm2015/form-field-error/form-field-error/form-field-error.component.js +1 -1
- package/esm2015/framework/base-layout/base-layout.component.js +1 -1
- package/esm2015/framework/dashboard/dashboard-widgets/dashboard-widgets.component.js +1 -1
- package/esm2015/framework/dynamic-router/hierarchy-router-outlet/hierarchy-router-outlet.component.js +1 -1
- package/esm2015/framework/schema-form-controls/schema-form-input/schema-form-input.component.js +1 -1
- package/esm2015/framework/schema-form-controls/schema-form-number/schema-form-number.component.js +1 -1
- package/esm2015/framework/schema-form-controls/schema-form-select/schema-form-select.component.js +1 -1
- package/esm2015/framework/schema-form-controls/schema-form-submit-split/schema-form-submit-split.component.js +1 -1
- package/esm2015/framework/side-nav/side-nav-item/side-nav-item.component.js +1 -1
- package/esm2015/framework/side-nav/side-nav-toggle/side-nav-toggle.component.js +1 -1
- package/esm2015/framework/side-nav/side-nav.component.js +1 -1
- package/esm2015/framework/top-bar/top-bar-menu-button/top-bar-menu-button.component.js +1 -1
- package/esm2015/framework/top-bar/top-bar-title/top-bar-title.component.js +1 -1
- package/esm2015/framework/top-bar/top-bar.component.js +1 -1
- package/esm2015/graphql/datatable/create-page-info-observable.js +38 -0
- package/esm2015/graphql/datatable/datatable-graphql-query-ref.js +236 -0
- package/esm2015/graphql/datatable/datatable-graphql.service.js +35 -0
- package/esm2015/graphql/datatable/datatable-helpers.js +170 -0
- package/esm2015/graphql/datatable/get-page-info.js +11 -0
- package/esm2015/graphql/datatable/index.js +7 -0
- package/esm2015/graphql/datatable/map-filter-states.js +64 -0
- package/esm2015/graphql/datatable/map-page-info.js +14 -0
- package/esm2015/graphql/datatable/mapper-context.js +2 -0
- package/esm2015/graphql/models/gql-datatable-accessor.js +2 -0
- package/esm2015/graphql/models/index.js +2 -1
- package/esm2015/graphql/models/query-processing-config.js +1 -1
- package/esm2015/graphql/public-api.js +2 -1
- package/esm2015/graphql/utils/parse-hints.js +3 -3
- package/esm2015/icon/icon/icon.component.js +1 -1
- package/esm2015/loading/loading/loading.component.js +1 -1
- package/esm2015/menu/menu.component.js +1 -1
- package/esm2015/modal/modal-body/modal-body.component.js +1 -1
- package/esm2015/modal/modal-container/modal-container.component.js +1 -1
- package/esm2015/popover/popover/popover.component.js +1 -1
- package/esm2015/progress/progress-circle/progress-circle.component.js +1 -1
- package/esm2015/tabbed/tabbed.component.js +1 -1
- package/esm2015/table/table/table.component.js +1 -1
- package/esm2015/table-cell-types/table-cell-type-icon/table-cell-type-icon.component.js +1 -1
- package/esm2015/table-cell-types/table-cell-type-progress-circle/table-cell-type-progress-circle.component.js +1 -1
- package/esm2015/tel-input/tel-input/tel-input.component.js +1 -1
- package/esm2015/testing/current-tick-time.js +16 -0
- package/esm2015/testing/fake-toastr.js +29 -0
- package/esm2015/testing/get-harness.js +16 -0
- package/esm2015/testing/public-api.js +7 -0
- package/esm2015/testing/render-story.js +12 -0
- package/esm2015/testing/story-expect.js +39 -0
- package/esm2015/testing/theseam-ui-common-testing.js +5 -0
- package/esm2015/testing/tick-helper.js +74 -0
- package/esm2015/tiled-select/components/tiled-select/tiled-select.component.js +25 -17
- package/esm2015/tiled-select/components/tiled-select-tile/tiled-select-tile.component.js +5 -2
- package/esm2015/tiled-select/components/tiled-select-tile-icon/tiled-select-tile-icon.component.js +1 -1
- package/esm2015/tiled-select/public-api.js +2 -1
- package/esm2015/tiled-select/tiled-select.models.js +1 -1
- package/esm2015/tiled-select/tiled-select.module.js +4 -4
- package/esm2015/toggle-edit/toggle-edit-actions-container/toggle-edit-actions-container.component.js +1 -1
- package/esm2015/toggle-edit/toggle-edit.component.js +1 -1
- package/esm2015/utils/array-move.js +62 -0
- package/esm2015/utils/public-api.js +2 -1
- package/esm2015/utils/router/is-empty-url-route.js +1 -1
- package/esm2015/utils/subscriber-count.js +31 -4
- package/esm2015/widget/widget/widget.component.js +1 -1
- package/esm2015/widget/widget-content-components/widget-button-group/widget-button-group.component.js +1 -1
- package/esm2015/widget/widget-content-components/widget-content-header/widget-content-header.component.js +1 -1
- package/esm2015/widget/widget-content-components/widget-empty-label/widget-empty-label.component.js +1 -1
- package/esm2015/widget/widget-content-components/widget-footer-link/widget-footer-link.component.js +1 -1
- package/esm2015/widget/widget-content-components/widget-footer-text/widget-footer-text.component.js +1 -1
- package/esm2015/widget/widget-content-components/widget-header-badge/widget-header-badge.component.js +1 -1
- package/esm2015/widget/widget-content-components/widget-tile/widget-tile-footer-item/widget-tile-footer-item.component.js +1 -1
- package/esm2015/widget/widget-content-components/widget-tile/widget-tile-group/widget-tile-group.component.js +1 -1
- package/esm2015/widget/widget-content-components/widget-tile/widget-tile.component.js +1 -1
- package/esm2015/widget/widget-content-components/widget-tile-list/widget-tile-list.component.js +1 -1
- package/esm2015/widget/widget-footer/widget-footer.component.js +1 -1
- package/fesm2015/theseam-ui-common-buttons.js +1 -1
- package/fesm2015/theseam-ui-common-card.js +2 -2
- package/fesm2015/theseam-ui-common-data-filters.js +6 -3
- package/fesm2015/theseam-ui-common-data-filters.js.map +1 -1
- package/fesm2015/theseam-ui-common-datatable-dynamic.js +3 -3
- package/fesm2015/theseam-ui-common-datatable.js +1100 -319
- package/fesm2015/theseam-ui-common-datatable.js.map +1 -1
- package/fesm2015/theseam-ui-common-form-field-error.js +1 -1
- package/fesm2015/theseam-ui-common-form-field.js +1 -1
- package/fesm2015/theseam-ui-common-framework.js +13 -13
- package/fesm2015/theseam-ui-common-graphql.js +555 -5
- package/fesm2015/theseam-ui-common-graphql.js.map +1 -1
- package/fesm2015/theseam-ui-common-icon.js +1 -1
- package/fesm2015/theseam-ui-common-loading.js +1 -1
- package/fesm2015/theseam-ui-common-menu.js +1 -1
- package/fesm2015/theseam-ui-common-modal.js +2 -2
- package/fesm2015/theseam-ui-common-popover.js +1 -1
- package/fesm2015/theseam-ui-common-progress.js +1 -1
- package/fesm2015/theseam-ui-common-tabbed.js +1 -1
- package/fesm2015/theseam-ui-common-table-cell-types.js +2 -2
- package/fesm2015/theseam-ui-common-table.js +1 -1
- package/fesm2015/theseam-ui-common-tel-input.js +1 -1
- package/fesm2015/theseam-ui-common-testing.js +191 -0
- package/fesm2015/theseam-ui-common-testing.js.map +1 -0
- package/fesm2015/theseam-ui-common-tiled-select.js +34 -21
- package/fesm2015/theseam-ui-common-tiled-select.js.map +1 -1
- package/fesm2015/theseam-ui-common-toggle-edit.js +2 -2
- package/fesm2015/theseam-ui-common-utils.js +92 -4
- package/fesm2015/theseam-ui-common-utils.js.map +1 -1
- package/fesm2015/theseam-ui-common-widget.js +12 -12
- package/form-field/theseam-ui-common-form-field.metadata.json +1 -1
- package/form-field-error/theseam-ui-common-form-field-error.metadata.json +1 -1
- package/framework/theseam-ui-common-framework.metadata.json +1 -1
- package/graphql/datatable/create-page-info-observable.d.ts +4 -0
- package/graphql/datatable/datatable-graphql-query-ref.d.ts +65 -0
- package/graphql/datatable/datatable-graphql.service.d.ts +26 -0
- package/graphql/datatable/datatable-helpers.d.ts +12 -0
- package/graphql/datatable/get-page-info.d.ts +4 -0
- package/graphql/datatable/index.d.ts +6 -0
- package/graphql/datatable/map-filter-states.d.ts +18 -0
- package/graphql/datatable/map-page-info.d.ts +11 -0
- package/graphql/datatable/mapper-context.d.ts +6 -0
- package/graphql/models/gql-datatable-accessor.d.ts +9 -0
- package/graphql/models/index.d.ts +1 -0
- package/graphql/models/query-processing-config.d.ts +4 -0
- package/graphql/public-api.d.ts +1 -0
- package/graphql/theseam-ui-common-graphql.metadata.json +1 -1
- package/icon/theseam-ui-common-icon.metadata.json +1 -1
- package/loading/theseam-ui-common-loading.metadata.json +1 -1
- package/menu/theseam-ui-common-menu.metadata.json +1 -1
- package/modal/theseam-ui-common-modal.metadata.json +1 -1
- package/package.json +1 -1
- package/popover/theseam-ui-common-popover.metadata.json +1 -1
- package/progress/theseam-ui-common-progress.metadata.json +1 -1
- package/styles/vendor/ngx-datatable/_ngx-datatable.scss +54 -52
- package/tabbed/theseam-ui-common-tabbed.metadata.json +1 -1
- package/table/theseam-ui-common-table.metadata.json +1 -1
- package/table-cell-types/theseam-ui-common-table-cell-types.metadata.json +1 -1
- package/tel-input/theseam-ui-common-tel-input.metadata.json +1 -1
- package/testing/current-tick-time.d.ts +13 -0
- package/testing/fake-toastr.d.ts +30 -0
- package/testing/get-harness.d.ts +7 -0
- package/testing/package.json +11 -0
- package/testing/public-api.d.ts +6 -0
- package/testing/render-story.d.ts +2 -0
- package/testing/story-expect.d.ts +5 -0
- package/{test-helpers/theseam-ui-common-test-helpers.d.ts → testing/theseam-ui-common-testing.d.ts} +0 -0
- package/testing/theseam-ui-common-testing.metadata.json +1 -0
- package/{test-helpers → testing}/tick-helper.d.ts +0 -0
- package/tiled-select/components/tiled-select/tiled-select.component.d.ts +7 -3
- package/tiled-select/components/tiled-select-tile/tiled-select-tile.component.d.ts +1 -0
- package/tiled-select/theseam-ui-common-tiled-select.metadata.json +1 -1
- package/tiled-select/tiled-select.models.d.ts +3 -1
- package/toggle-edit/theseam-ui-common-toggle-edit.metadata.json +1 -1
- package/utils/array-move.d.ts +49 -0
- package/utils/public-api.d.ts +1 -0
- package/utils/subscriber-count.d.ts +13 -1
- package/utils/theseam-ui-common-utils.metadata.json +1 -1
- package/widget/theseam-ui-common-widget.metadata.json +1 -1
- package/bundles/theseam-ui-common-test-helpers.umd.js +0 -94
- package/bundles/theseam-ui-common-test-helpers.umd.js.map +0 -1
- package/esm2015/test-helpers/public-api.js +0 -2
- package/esm2015/test-helpers/theseam-ui-common-test-helpers.js +0 -5
- package/esm2015/test-helpers/tick-helper.js +0 -74
- package/fesm2015/theseam-ui-common-test-helpers.js +0 -81
- package/fesm2015/theseam-ui-common-test-helpers.js.map +0 -1
- package/test-helpers/package.json +0 -11
- package/test-helpers/public-api.d.ts +0 -1
- package/test-helpers/theseam-ui-common-test-helpers.metadata.json +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@theseam/ui-common/unsaved-changes-dialog', ['exports', '@angular/core'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.theseam = global.theseam || {}, global.theseam[
|
|
5
|
-
}(this, (function (exports, i0) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.theseam = global.theseam || {}, global.theseam["ui-common"] = global.theseam["ui-common"] || {}, global.theseam["ui-common"]["unsaved-changes-dialog"] = {}), global.ng.core));
|
|
5
|
+
})(this, (function (exports, i0) { '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
|
|
|
@@ -132,5 +130,5 @@
|
|
|
132
130
|
|
|
133
131
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
134
132
|
|
|
135
|
-
}))
|
|
133
|
+
}));
|
|
136
134
|
//# sourceMappingURL=theseam-ui-common-unsaved-changes-dialog.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theseam-ui-common-unsaved-changes-dialog.umd.js","sources":["../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.component.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.module.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.guard.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-can-deactivate.ts","../../../projects/ui-common/unsaved-changes-dialog/theseam-ui-common-unsaved-changes-dialog.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core'\n\n// TODO: Decide if this component should be implemented or just use the native\n// browser dialog for in-app routing also.\n\n@Component({\n selector: 'seam-unsaved-changes-dialog',\n template: `\n <p>\n unsaved-changes-dialog works!\n </p>\n `,\n styles: []\n})\nexport class UnsavedChangesDialogComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n","import { NgModule } from '@angular/core'\n\nimport { UnsavedChangesDialogComponent } from './unsaved-changes-dialog.component'\n\n@NgModule({\n declarations: [UnsavedChangesDialogComponent],\n imports: [],\n exports: [UnsavedChangesDialogComponent]\n})\nexport class TheSeamUnsavedChangesDialogModule { }\n","import { Injectable, isDevMode } from '@angular/core'\nimport { CanDeactivate } from '@angular/router'\n\nimport { UnsavedChangesCanDeactivate } from './unsaved-changes-can-deactivate'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UnsavedChangesDialogGuard implements CanDeactivate<UnsavedChangesCanDeactivate> {\n\n /**\n * NOTE: Must be synchronous for now to allow `window:beforeunload` event support.\n */\n canDeactivate(component: UnsavedChangesCanDeactivate): boolean {\n if (isDevMode()) {\n if (!component.unsavedChangesCanDeactivate) {\n console.warn('Route Component with [UnsavedChangesDialogGuard] guard must extend [UnsavedChangesCanDeactivate] class.')\n }\n\n const w = window as any\n // Avoid redirect prevention in Storybook\n if (w && w.__STORYBOOK_CLIENT_API__) {\n return true\n }\n }\n\n if (!component.unsavedChangesCanDeactivate()) {\n if (confirm('You have unsaved changes! If you leave, your changes will be lost.')) {\n return true\n } else {\n return false\n }\n }\n return true\n }\n\n}\n","import { Directive, HostListener, isDevMode } from '@angular/core'\n\n@Directive()\n// tslint:disable-next-line: directive-class-suffix\nexport abstract class UnsavedChangesCanDeactivate {\n\n abstract unsavedChangesCanDeactivate(): boolean\n\n @HostListener('window:beforeunload', ['$event'])\n __unloadNotification($event: any) {\n if (isDevMode()) {\n if (!this.unsavedChangesCanDeactivate) {\n console.warn('Route Component with [UnsavedChangesDialogGuard] guard must extend [UnsavedChangesCanDeactivate] class.')\n }\n\n const w = window as any\n // Avoid redirect prevention in Storybook\n if (w && w.__STORYBOOK_CLIENT_API__) {\n return true\n }\n }\n\n if (!this.unsavedChangesCanDeactivate()) {\n // $event.returnValue = true\n $event.returnValue = 'You have unsaved changes! If you leave, your changes will be lost.'\n }\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Component","NgModule","isDevMode","Injectable","Directive","HostListener"],"mappings":"
|
|
1
|
+
{"version":3,"file":"theseam-ui-common-unsaved-changes-dialog.umd.js","sources":["../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.component.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.module.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.guard.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-can-deactivate.ts","../../../projects/ui-common/unsaved-changes-dialog/theseam-ui-common-unsaved-changes-dialog.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core'\n\n// TODO: Decide if this component should be implemented or just use the native\n// browser dialog for in-app routing also.\n\n@Component({\n selector: 'seam-unsaved-changes-dialog',\n template: `\n <p>\n unsaved-changes-dialog works!\n </p>\n `,\n styles: []\n})\nexport class UnsavedChangesDialogComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n","import { NgModule } from '@angular/core'\n\nimport { UnsavedChangesDialogComponent } from './unsaved-changes-dialog.component'\n\n@NgModule({\n declarations: [UnsavedChangesDialogComponent],\n imports: [],\n exports: [UnsavedChangesDialogComponent]\n})\nexport class TheSeamUnsavedChangesDialogModule { }\n","import { Injectable, isDevMode } from '@angular/core'\nimport { CanDeactivate } from '@angular/router'\n\nimport { UnsavedChangesCanDeactivate } from './unsaved-changes-can-deactivate'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UnsavedChangesDialogGuard implements CanDeactivate<UnsavedChangesCanDeactivate> {\n\n /**\n * NOTE: Must be synchronous for now to allow `window:beforeunload` event support.\n */\n canDeactivate(component: UnsavedChangesCanDeactivate): boolean {\n if (isDevMode()) {\n if (!component.unsavedChangesCanDeactivate) {\n console.warn('Route Component with [UnsavedChangesDialogGuard] guard must extend [UnsavedChangesCanDeactivate] class.')\n }\n\n const w = window as any\n // Avoid redirect prevention in Storybook\n if (w && w.__STORYBOOK_CLIENT_API__) {\n return true\n }\n }\n\n if (!component.unsavedChangesCanDeactivate()) {\n if (confirm('You have unsaved changes! If you leave, your changes will be lost.')) {\n return true\n } else {\n return false\n }\n }\n return true\n }\n\n}\n","import { Directive, HostListener, isDevMode } from '@angular/core'\n\n@Directive()\n// tslint:disable-next-line: directive-class-suffix\nexport abstract class UnsavedChangesCanDeactivate {\n\n abstract unsavedChangesCanDeactivate(): boolean\n\n @HostListener('window:beforeunload', ['$event'])\n __unloadNotification($event: any) {\n if (isDevMode()) {\n if (!this.unsavedChangesCanDeactivate) {\n console.warn('Route Component with [UnsavedChangesDialogGuard] guard must extend [UnsavedChangesCanDeactivate] class.')\n }\n\n const w = window as any\n // Avoid redirect prevention in Storybook\n if (w && w.__STORYBOOK_CLIENT_API__) {\n return true\n }\n }\n\n if (!this.unsavedChangesCanDeactivate()) {\n // $event.returnValue = true\n $event.returnValue = 'You have unsaved changes! If you leave, your changes will be lost.'\n }\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Component","NgModule","isDevMode","Injectable","Directive","HostListener"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;;MAaE;OAAiB;MAEjB,gDAAQ,GAAR;OACC;;;;cAdFA,YAAS,SAAC;kBACT,QAAQ,EAAE,6BAA6B;kBACvC,QAAQ,EAAE,8DAIT;eAEF;;;;;MCJD;;;;;cALCC,WAAQ,SAAC;kBACR,YAAY,EAAE,CAAC,6BAA6B,CAAC;kBAC7C,OAAO,EAAE,EAAE;kBACX,OAAO,EAAE,CAAC,6BAA6B,CAAC;eACzC;;;;MCAD;;;;;MAKE,iDAAa,GAAb,UAAc,SAAsC;UAClD,IAAIC,YAAS,EAAE,EAAE;cACf,IAAI,CAAC,SAAS,CAAC,2BAA2B,EAAE;kBAC1C,OAAO,CAAC,IAAI,CAAC,yGAAyG,CAAC,CAAA;eACxH;cAED,IAAM,CAAC,GAAG,MAAa,CAAA;;cAEvB,IAAI,CAAC,IAAI,CAAC,CAAC,wBAAwB,EAAE;kBACnC,OAAO,IAAI,CAAA;eACZ;WACF;UAED,IAAI,CAAC,SAAS,CAAC,2BAA2B,EAAE,EAAE;cAC5C,IAAI,OAAO,CAAC,oEAAoE,CAAC,EAAE;kBACjF,OAAO,IAAI,CAAA;eACZ;mBAAM;kBACL,OAAO,KAAK,CAAA;eACb;WACF;UACD,OAAO,IAAI,CAAA;OACZ;;;;;cA7BFC,aAAU,SAAC;kBACV,UAAU,EAAE,MAAM;eACnB;;;ECJD;;MACA;;MAKI,0DAAoB,GAApB,UAAqB,MAAW;UAC9B,IAAID,YAAS,EAAE,EAAE;cACf,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE;kBACrC,OAAO,CAAC,IAAI,CAAC,yGAAyG,CAAC,CAAA;eACxH;cAED,IAAM,CAAC,GAAG,MAAa,CAAA;;cAEvB,IAAI,CAAC,IAAI,CAAC,CAAC,wBAAwB,EAAE;kBACnC,OAAO,IAAI,CAAA;eACZ;WACF;UAED,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE;;cAEvC,MAAM,CAAC,WAAW,GAAG,oEAAoE,CAAA;WAC1F;OACF;;;;cAxBJE,YAAS;;;qCAMLC,eAAY,SAAC,qBAAqB,EAAE,CAAC,QAAQ,CAAC;;;ECRnD;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs/operators'), require('rxjs'), require('@marklb/file-type')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@theseam/ui-common/utils', ['exports', 'rxjs/operators', 'rxjs', '@marklb/file-type'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.theseam = global.theseam || {}, global.theseam[
|
|
5
|
-
}(this, (function (exports, operators, rxjs, fileType) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.theseam = global.theseam || {}, global.theseam["ui-common"] = global.theseam["ui-common"] || {}, global.theseam["ui-common"].utils = {}), global.rxjs.operators, global.rxjs, global.fileType));
|
|
5
|
+
})(this, (function (exports, operators, rxjs, fileType) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -315,78 +315,6 @@
|
|
|
315
315
|
return activatedRoute.snapshot.url.length === 0;
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
function calcPercentage(total, n) {
|
|
319
|
-
return total && total > 0 ? (n / total) * 100 : 0;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Polyfil for `Element.toggleAttribute`
|
|
324
|
-
*
|
|
325
|
-
* Toggles a value without a value. Useful for attributes, such as `disabled`,
|
|
326
|
-
* `readonly`, and `hidden`, that only needs to exist on the `Element` without
|
|
327
|
-
* requiring a value.
|
|
328
|
-
*
|
|
329
|
-
* Most browsers natively support this feature, but IE, which we still try to
|
|
330
|
-
* support for at least the main parts of the app, has "Unknown" support of this
|
|
331
|
-
* feature. Until IE support is dropped this polyfil should be used to toggle an
|
|
332
|
-
* attribute.
|
|
333
|
-
*
|
|
334
|
-
* Source:
|
|
335
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute#Polyfill
|
|
336
|
-
*/
|
|
337
|
-
function toggleAttribute(element, name, force) {
|
|
338
|
-
if (force !== void 0) {
|
|
339
|
-
force = !!force;
|
|
340
|
-
}
|
|
341
|
-
if (element.getAttribute(name) !== null) {
|
|
342
|
-
if (force) {
|
|
343
|
-
return true;
|
|
344
|
-
}
|
|
345
|
-
element.removeAttribute(name);
|
|
346
|
-
return false;
|
|
347
|
-
}
|
|
348
|
-
else {
|
|
349
|
-
if (force === false) {
|
|
350
|
-
return false;
|
|
351
|
-
}
|
|
352
|
-
element.setAttribute(name, '');
|
|
353
|
-
return true;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
var phoneNumberMask = ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/];
|
|
358
|
-
|
|
359
|
-
function isNullOrUndefined(value) {
|
|
360
|
-
return value === undefined || value === null;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
function loadStyle(content) {
|
|
364
|
-
return new Promise(function (resolve, reject) {
|
|
365
|
-
var s = document.createElement('style');
|
|
366
|
-
s.onload = function () { return resolve(s); };
|
|
367
|
-
s.onerror = function (e) {
|
|
368
|
-
document.head.removeChild(s);
|
|
369
|
-
reject(e);
|
|
370
|
-
};
|
|
371
|
-
s.innerHTML = content;
|
|
372
|
-
document.head.appendChild(s);
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
function loadStyleSheet(path) {
|
|
377
|
-
return new Promise(function (resolve, reject) {
|
|
378
|
-
var s = document.createElement('link');
|
|
379
|
-
s.onload = function () { return resolve(s); };
|
|
380
|
-
s.onerror = function (e) {
|
|
381
|
-
document.head.removeChild(s);
|
|
382
|
-
reject(e);
|
|
383
|
-
};
|
|
384
|
-
s.rel = 'stylesheet';
|
|
385
|
-
s.href = path;
|
|
386
|
-
document.head.appendChild(s);
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
|
|
390
318
|
/*! *****************************************************************************
|
|
391
319
|
Copyright (c) Microsoft Corporation.
|
|
392
320
|
|
|
@@ -622,7 +550,7 @@
|
|
|
622
550
|
ar[i] = from[i];
|
|
623
551
|
}
|
|
624
552
|
}
|
|
625
|
-
return to.concat(ar || from);
|
|
553
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
626
554
|
}
|
|
627
555
|
function __await(v) {
|
|
628
556
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -705,6 +633,140 @@
|
|
|
705
633
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
706
634
|
}
|
|
707
635
|
|
|
636
|
+
// Based on source: https://github.com/sindresorhus/array-move/blob/main/index.js
|
|
637
|
+
/**
|
|
638
|
+
Moves the item to the new position in the input array. Useful for huge arrays
|
|
639
|
+
where absolute performance is needed.
|
|
640
|
+
|
|
641
|
+
@param array - The array to modify.
|
|
642
|
+
@param fromIndex - The index of item to move. If negative, it will begin that
|
|
643
|
+
many elements from the end.
|
|
644
|
+
@param toIndex - The index of where to move the item. If negative, it will
|
|
645
|
+
begin that many elements from the end.
|
|
646
|
+
@example
|
|
647
|
+
```
|
|
648
|
+
import { arrayMoveMutable } from '@theseam/ui-common/utils';
|
|
649
|
+
|
|
650
|
+
const input = ['a', 'b', 'c'];
|
|
651
|
+
arrayMoveMutable(input, 1, 2);
|
|
652
|
+
console.log(input);
|
|
653
|
+
//=> ['a', 'c', 'b']
|
|
654
|
+
```
|
|
655
|
+
*/
|
|
656
|
+
function arrayMoveMutable(array, fromIndex, toIndex) {
|
|
657
|
+
var startIndex = fromIndex < 0 ? array.length + fromIndex : fromIndex;
|
|
658
|
+
if (startIndex >= 0 && startIndex < array.length) {
|
|
659
|
+
var endIndex = toIndex < 0 ? array.length + toIndex : toIndex;
|
|
660
|
+
var _a = __read(array.splice(fromIndex, 1), 1), item = _a[0];
|
|
661
|
+
array.splice(endIndex, 0, item);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
Clones the given `array`, moves the item to a new position in the new array,
|
|
666
|
+
and then returns the new array. The given `array` is not mutated.
|
|
667
|
+
|
|
668
|
+
@param array - The array with the item to move.
|
|
669
|
+
@param fromIndex - The index of item to move. If negative, it will begin that
|
|
670
|
+
many elements from the end.
|
|
671
|
+
@param toIndex - The index of where to move the item. If negative, it will
|
|
672
|
+
begin that many elements from the end.
|
|
673
|
+
@returns A new array with the item moved to the new position.
|
|
674
|
+
@example
|
|
675
|
+
```
|
|
676
|
+
import { arrayMoveImmutable } from '@theseam/ui-common/utils';
|
|
677
|
+
|
|
678
|
+
const input = ['a', 'b', 'c'];
|
|
679
|
+
const array1 = arrayMoveImmutable(input, 1, 2);
|
|
680
|
+
console.log(array1);
|
|
681
|
+
//=> ['a', 'c', 'b']
|
|
682
|
+
|
|
683
|
+
const array2 = arrayMoveImmutable(input, -1, 0);
|
|
684
|
+
console.log(array2);
|
|
685
|
+
//=> ['c', 'a', 'b']
|
|
686
|
+
|
|
687
|
+
const array3 = arrayMoveImmutable(input, -2, -3);
|
|
688
|
+
console.log(array3);
|
|
689
|
+
//=> ['b', 'a', 'c']
|
|
690
|
+
```
|
|
691
|
+
*/
|
|
692
|
+
function arrayMoveImmutable(array, fromIndex, toIndex) {
|
|
693
|
+
var newArray = __spreadArray([], __read(array));
|
|
694
|
+
arrayMoveMutable(newArray, fromIndex, toIndex);
|
|
695
|
+
return newArray;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
function calcPercentage(total, n) {
|
|
699
|
+
return total && total > 0 ? (n / total) * 100 : 0;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Polyfil for `Element.toggleAttribute`
|
|
704
|
+
*
|
|
705
|
+
* Toggles a value without a value. Useful for attributes, such as `disabled`,
|
|
706
|
+
* `readonly`, and `hidden`, that only needs to exist on the `Element` without
|
|
707
|
+
* requiring a value.
|
|
708
|
+
*
|
|
709
|
+
* Most browsers natively support this feature, but IE, which we still try to
|
|
710
|
+
* support for at least the main parts of the app, has "Unknown" support of this
|
|
711
|
+
* feature. Until IE support is dropped this polyfil should be used to toggle an
|
|
712
|
+
* attribute.
|
|
713
|
+
*
|
|
714
|
+
* Source:
|
|
715
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute#Polyfill
|
|
716
|
+
*/
|
|
717
|
+
function toggleAttribute(element, name, force) {
|
|
718
|
+
if (force !== void 0) {
|
|
719
|
+
force = !!force;
|
|
720
|
+
}
|
|
721
|
+
if (element.getAttribute(name) !== null) {
|
|
722
|
+
if (force) {
|
|
723
|
+
return true;
|
|
724
|
+
}
|
|
725
|
+
element.removeAttribute(name);
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
if (force === false) {
|
|
730
|
+
return false;
|
|
731
|
+
}
|
|
732
|
+
element.setAttribute(name, '');
|
|
733
|
+
return true;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
var phoneNumberMask = ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/];
|
|
738
|
+
|
|
739
|
+
function isNullOrUndefined(value) {
|
|
740
|
+
return value === undefined || value === null;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
function loadStyle(content) {
|
|
744
|
+
return new Promise(function (resolve, reject) {
|
|
745
|
+
var s = document.createElement('style');
|
|
746
|
+
s.onload = function () { return resolve(s); };
|
|
747
|
+
s.onerror = function (e) {
|
|
748
|
+
document.head.removeChild(s);
|
|
749
|
+
reject(e);
|
|
750
|
+
};
|
|
751
|
+
s.innerHTML = content;
|
|
752
|
+
document.head.appendChild(s);
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
function loadStyleSheet(path) {
|
|
757
|
+
return new Promise(function (resolve, reject) {
|
|
758
|
+
var s = document.createElement('link');
|
|
759
|
+
s.onload = function () { return resolve(s); };
|
|
760
|
+
s.onerror = function (e) {
|
|
761
|
+
document.head.removeChild(s);
|
|
762
|
+
reject(e);
|
|
763
|
+
};
|
|
764
|
+
s.rel = 'stylesheet';
|
|
765
|
+
s.href = path;
|
|
766
|
+
document.head.appendChild(s);
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
|
|
708
770
|
/** Returns object without property */
|
|
709
771
|
function withoutProperty(obj, propName) {
|
|
710
772
|
var _a = obj, _b = propName, _ = _a[_b], without = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
@@ -782,7 +844,7 @@
|
|
|
782
844
|
return __awaiter(this, void 0, void 0, function () {
|
|
783
845
|
var fType, mime, blob;
|
|
784
846
|
return __generator(this, function (_a) {
|
|
785
|
-
fType = fileType__default[
|
|
847
|
+
fType = fileType__default["default"](fileBuffer);
|
|
786
848
|
mime = (fType) ? fType.mime : defaultMime;
|
|
787
849
|
blob = new Blob([fileBuffer], { type: mime });
|
|
788
850
|
return [2 /*return*/, blob];
|
|
@@ -810,7 +872,7 @@
|
|
|
810
872
|
var _fileBuffer, fType, ext, mime, blob, fileData;
|
|
811
873
|
return __generator(this, function (_a) {
|
|
812
874
|
_fileBuffer = Buffer.from(fileBuffer);
|
|
813
|
-
fType = fileType__default[
|
|
875
|
+
fType = fileType__default["default"](_fileBuffer);
|
|
814
876
|
ext = fType && fType.ext || undefined;
|
|
815
877
|
mime = fType ? fType.mime : defaultMime;
|
|
816
878
|
blob = new Blob([_fileBuffer], { type: mime });
|
|
@@ -1104,19 +1166,46 @@
|
|
|
1104
1166
|
/**
|
|
1105
1167
|
* This is just for helping debug observables that aren't being unsubscribed
|
|
1106
1168
|
* from correctly.
|
|
1169
|
+
*
|
|
1170
|
+
* If description is 'foo' then you can check the how many observers are
|
|
1171
|
+
* subscribed with the expression `__subscriberCounts['foo']`. In a debugger you
|
|
1172
|
+
* can add the expression to the "Watch" expressions or in Chrome Devtools
|
|
1173
|
+
* Console you can add it to the live expressions(Add live expressions by
|
|
1174
|
+
* clicking the eye the the left of the Console filter input).
|
|
1107
1175
|
*/
|
|
1108
|
-
function subscriberCount(sourceObservable, description) {
|
|
1176
|
+
function subscriberCount(sourceObservable, description, countChangedFn) {
|
|
1177
|
+
if (countChangedFn === void 0) { countChangedFn = logOnChange; }
|
|
1109
1178
|
var counter = 0;
|
|
1110
1179
|
return new rxjs.Observable(function (subscriber) {
|
|
1111
1180
|
var subscription = sourceObservable.subscribe(subscriber);
|
|
1112
1181
|
counter++;
|
|
1113
|
-
|
|
1182
|
+
if (countChangedFn !== undefined && countChangedFn !== null) {
|
|
1183
|
+
countChangedFn(description, counter, 'subscribed');
|
|
1184
|
+
}
|
|
1185
|
+
setGlobalSubscriberCount(description, counter);
|
|
1114
1186
|
return function () {
|
|
1115
1187
|
subscription.unsubscribe();
|
|
1116
1188
|
counter--;
|
|
1117
|
-
|
|
1189
|
+
if (countChangedFn !== undefined && countChangedFn !== null) {
|
|
1190
|
+
countChangedFn(description, counter, 'unsubscribed');
|
|
1191
|
+
}
|
|
1192
|
+
setGlobalSubscriberCount(description, counter);
|
|
1118
1193
|
};
|
|
1119
1194
|
});
|
|
1195
|
+
}
|
|
1196
|
+
var logOnChange = function (description, count, reason) {
|
|
1197
|
+
console.log(description + " subscriptions: " + count + " [" + reason + "]");
|
|
1198
|
+
};
|
|
1199
|
+
var ɵ0 = logOnChange;
|
|
1200
|
+
function getGlobalSubscriberCounts() {
|
|
1201
|
+
var w = window;
|
|
1202
|
+
if (w.__subscriberCounts === undefined || w.__subscriberCounts === null) {
|
|
1203
|
+
w.__subscriberCounts = {};
|
|
1204
|
+
}
|
|
1205
|
+
return w.__subscriberCounts;
|
|
1206
|
+
}
|
|
1207
|
+
function setGlobalSubscriberCount(description, count) {
|
|
1208
|
+
getGlobalSubscriberCounts()[description] = count;
|
|
1120
1209
|
}
|
|
1121
1210
|
|
|
1122
1211
|
function observeQueryList(queryList, emitCurrentValue) {
|
|
@@ -1190,6 +1279,8 @@
|
|
|
1190
1279
|
exports.PollingTickerOptions = PollingTickerOptions;
|
|
1191
1280
|
exports.Refreshable = Refreshable;
|
|
1192
1281
|
exports.activatedRoutesWithDataProperty = activatedRoutesWithDataProperty;
|
|
1282
|
+
exports.arrayMoveImmutable = arrayMoveImmutable;
|
|
1283
|
+
exports.arrayMoveMutable = arrayMoveMutable;
|
|
1193
1284
|
exports.calcPercentage = calcPercentage;
|
|
1194
1285
|
exports.createPadding = createPadding;
|
|
1195
1286
|
exports.deleteProperties = deleteProperties;
|
|
@@ -1230,6 +1321,7 @@
|
|
|
1230
1321
|
exports.readFileAsync = readFileAsync;
|
|
1231
1322
|
exports.routeSnapshotPathFull = routeSnapshotPathFull;
|
|
1232
1323
|
exports.routeSnapshotPathRelative = routeSnapshotPathRelative;
|
|
1324
|
+
exports.subscriberCount = subscriberCount;
|
|
1233
1325
|
exports.tapFirst = tapFirst;
|
|
1234
1326
|
exports.toggleAttribute = toggleAttribute;
|
|
1235
1327
|
exports.waitOnConditionAsync = waitOnConditionAsync;
|
|
@@ -1238,8 +1330,9 @@
|
|
|
1238
1330
|
exports.withoutProperties = withoutProperties;
|
|
1239
1331
|
exports.withoutProperty = withoutProperty;
|
|
1240
1332
|
exports.wrapIntoObservable = wrapIntoObservable;
|
|
1333
|
+
exports["ɵ0"] = ɵ0;
|
|
1241
1334
|
|
|
1242
1335
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1243
1336
|
|
|
1244
|
-
}))
|
|
1337
|
+
}));
|
|
1245
1338
|
//# sourceMappingURL=theseam-ui-common-utils.umd.js.map
|