@covalent/core 3.1.0 → 3.1.2-beta.6
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/breadcrumbs/covalent-core-breadcrumbs.metadata.json +1 -1
- package/breadcrumbs/package.json +1 -3
- package/bundles/covalent-core-breadcrumbs.umd.js +131 -167
- package/bundles/covalent-core-breadcrumbs.umd.js.map +1 -1
- package/bundles/covalent-core-breadcrumbs.umd.min.js +1 -1
- package/bundles/covalent-core-breadcrumbs.umd.min.js.map +1 -1
- package/bundles/covalent-core-chips.umd.js +533 -708
- package/bundles/covalent-core-chips.umd.js.map +1 -1
- package/bundles/covalent-core-chips.umd.min.js +12 -12
- package/bundles/covalent-core-chips.umd.min.js.map +1 -1
- package/bundles/covalent-core-common.umd.js +566 -571
- package/bundles/covalent-core-common.umd.js.map +1 -1
- package/bundles/covalent-core-common.umd.min.js +13 -12
- package/bundles/covalent-core-common.umd.min.js.map +1 -1
- package/bundles/covalent-core-data-table.umd.js +727 -1038
- package/bundles/covalent-core-data-table.umd.js.map +1 -1
- package/bundles/covalent-core-data-table.umd.min.js +12 -12
- package/bundles/covalent-core-data-table.umd.min.js.map +1 -1
- package/bundles/covalent-core-dialogs.umd.js +515 -592
- package/bundles/covalent-core-dialogs.umd.js.map +1 -1
- package/bundles/covalent-core-dialogs.umd.min.js +1 -15
- package/bundles/covalent-core-dialogs.umd.min.js.map +1 -1
- package/bundles/covalent-core-dynamic-menu.umd.js +73 -62
- package/bundles/covalent-core-dynamic-menu.umd.js.map +1 -1
- package/bundles/covalent-core-dynamic-menu.umd.min.js +1 -1
- package/bundles/covalent-core-dynamic-menu.umd.min.js.map +1 -1
- package/bundles/covalent-core-expansion-panel.umd.js +465 -449
- package/bundles/covalent-core-expansion-panel.umd.js.map +1 -1
- package/bundles/covalent-core-expansion-panel.umd.min.js +12 -12
- package/bundles/covalent-core-expansion-panel.umd.min.js.map +1 -1
- package/bundles/covalent-core-file.umd.js +533 -598
- package/bundles/covalent-core-file.umd.js.map +1 -1
- package/bundles/covalent-core-file.umd.min.js +13 -12
- package/bundles/covalent-core-file.umd.min.js.map +1 -1
- package/bundles/covalent-core-json-formatter.umd.js +101 -152
- package/bundles/covalent-core-json-formatter.umd.js.map +1 -1
- package/bundles/covalent-core-json-formatter.umd.min.js +1 -1
- package/bundles/covalent-core-json-formatter.umd.min.js.map +1 -1
- package/bundles/covalent-core-layout.umd.js +845 -883
- package/bundles/covalent-core-layout.umd.js.map +1 -1
- package/bundles/covalent-core-layout.umd.min.js +13 -12
- package/bundles/covalent-core-layout.umd.min.js.map +1 -1
- package/bundles/covalent-core-loading.umd.js +481 -723
- package/bundles/covalent-core-loading.umd.js.map +1 -1
- package/bundles/covalent-core-loading.umd.min.js +12 -12
- package/bundles/covalent-core-loading.umd.min.js.map +1 -1
- package/bundles/covalent-core-media.umd.js +395 -375
- package/bundles/covalent-core-media.umd.js.map +1 -1
- package/bundles/covalent-core-media.umd.min.js +12 -12
- package/bundles/covalent-core-media.umd.min.js.map +1 -1
- package/bundles/covalent-core-menu.umd.js +37 -17
- package/bundles/covalent-core-menu.umd.js.map +1 -1
- package/bundles/covalent-core-menu.umd.min.js +1 -1
- package/bundles/covalent-core-menu.umd.min.js.map +1 -1
- package/bundles/covalent-core-message.umd.js +96 -152
- package/bundles/covalent-core-message.umd.js.map +1 -1
- package/bundles/covalent-core-message.umd.min.js +1 -1
- package/bundles/covalent-core-message.umd.min.js.map +1 -1
- package/bundles/covalent-core-nav-links.umd.js +63 -75
- package/bundles/covalent-core-nav-links.umd.js.map +1 -1
- package/bundles/covalent-core-nav-links.umd.min.js +1 -1
- package/bundles/covalent-core-nav-links.umd.min.js.map +1 -1
- package/bundles/covalent-core-notifications.umd.js +77 -101
- package/bundles/covalent-core-notifications.umd.js.map +1 -1
- package/bundles/covalent-core-notifications.umd.min.js +1 -1
- package/bundles/covalent-core-notifications.umd.min.js.map +1 -1
- package/bundles/covalent-core-paging.umd.js +89 -166
- package/bundles/covalent-core-paging.umd.js.map +1 -1
- package/bundles/covalent-core-paging.umd.min.js +1 -1
- package/bundles/covalent-core-paging.umd.min.js.map +1 -1
- package/bundles/covalent-core-search.umd.js +469 -418
- package/bundles/covalent-core-search.umd.js.map +1 -1
- package/bundles/covalent-core-search.umd.min.js +12 -12
- package/bundles/covalent-core-search.umd.min.js.map +1 -1
- package/bundles/covalent-core-sidesheet.umd.js +72 -52
- package/bundles/covalent-core-sidesheet.umd.js.map +1 -1
- package/bundles/covalent-core-sidesheet.umd.min.js +1 -1
- package/bundles/covalent-core-sidesheet.umd.min.js.map +1 -1
- package/bundles/covalent-core-steps.umd.js +663 -822
- package/bundles/covalent-core-steps.umd.js.map +1 -1
- package/bundles/covalent-core-steps.umd.min.js +12 -12
- package/bundles/covalent-core-steps.umd.min.js.map +1 -1
- package/bundles/covalent-core-tab-select.umd.js +446 -385
- package/bundles/covalent-core-tab-select.umd.js.map +1 -1
- package/bundles/covalent-core-tab-select.umd.min.js +12 -12
- package/bundles/covalent-core-tab-select.umd.min.js.map +1 -1
- package/bundles/covalent-core-user-profile.umd.js +65 -48
- package/bundles/covalent-core-user-profile.umd.js.map +1 -1
- package/bundles/covalent-core-user-profile.umd.min.js +1 -1
- package/bundles/covalent-core-user-profile.umd.min.js.map +1 -1
- package/bundles/covalent-core-virtual-scroll.umd.js +412 -356
- package/bundles/covalent-core-virtual-scroll.umd.js.map +1 -1
- package/bundles/covalent-core-virtual-scroll.umd.min.js +12 -12
- package/bundles/covalent-core-virtual-scroll.umd.min.js.map +1 -1
- package/bundles/covalent-core.umd.js +0 -8
- package/bundles/covalent-core.umd.js.map +1 -1
- package/chips/covalent-core-chips.metadata.json +1 -1
- package/chips/package.json +1 -3
- package/common/_common-theme.scss +11 -0
- package/common/package.json +1 -3
- package/data-table/covalent-core-data-table.metadata.json +1 -1
- package/data-table/package.json +1 -3
- package/dialogs/_dialog-theme.scss +6 -0
- package/dialogs/covalent-core-dialogs.metadata.json +1 -1
- package/dialogs/package.json +1 -3
- package/dialogs/window-dialog/window-dialog.component.scss +4 -0
- package/dynamic-menu/covalent-core-dynamic-menu.metadata.json +1 -1
- package/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.scss +0 -4
- package/dynamic-menu/package.json +1 -3
- package/esm2015/breadcrumbs/breadcrumb/breadcrumb.component.js +4 -3
- package/esm2015/breadcrumbs/breadcrumbs.component.js +3 -2
- package/esm2015/breadcrumbs/breadcrumbs.module.js +3 -2
- package/esm2015/breadcrumbs/covalent-core-breadcrumbs.js +3 -2
- package/esm2015/breadcrumbs/index.js +3 -2
- package/esm2015/breadcrumbs/public-api.js +3 -2
- package/esm2015/chips/chips.component.js +4 -3
- package/esm2015/chips/chips.module.js +3 -2
- package/esm2015/chips/covalent-core-chips.js +3 -2
- package/esm2015/chips/index.js +3 -2
- package/esm2015/chips/public-api.js +3 -2
- package/esm2015/common/animations/bounce/bounce.animation.js +3 -2
- package/esm2015/common/animations/collapse/collapse.animation.js +3 -2
- package/esm2015/common/animations/common/interfaces.js +3 -2
- package/esm2015/common/animations/fade/fadeInOut.animation.js +3 -2
- package/esm2015/common/animations/flash/flash.animation.js +3 -2
- package/esm2015/common/animations/headshake/headshake.animation.js +3 -2
- package/esm2015/common/animations/jello/jello.animation.js +3 -2
- package/esm2015/common/animations/pulse/pulse.animation.js +3 -2
- package/esm2015/common/animations/rotate/rotate.animation.js +3 -2
- package/esm2015/common/behaviors/control-value-accesor.mixin.js +3 -2
- package/esm2015/common/behaviors/disable-ripple.mixin.js +3 -2
- package/esm2015/common/behaviors/disabled.mixin.js +3 -2
- package/esm2015/common/common.module.js +3 -2
- package/esm2015/common/covalent-core-common.js +3 -2
- package/esm2015/common/directives/fullscreen/fullscreen.directive.js +3 -2
- package/esm2015/common/forms/auto-trim/auto-trim.directive.js +3 -2
- package/esm2015/common/forms/validators/validators.js +3 -2
- package/esm2015/common/functions/clipboard.js +3 -2
- package/esm2015/common/functions/convert.js +3 -2
- package/esm2015/common/functions/download.js +3 -2
- package/esm2015/common/functions/file.js +3 -2
- package/esm2015/common/index.js +3 -2
- package/esm2015/common/pipes/bytes/bytes.pipe.js +3 -2
- package/esm2015/common/pipes/decimal-bytes/decimal-bytes.pipe.js +3 -2
- package/esm2015/common/pipes/digits/digits.pipe.js +3 -2
- package/esm2015/common/pipes/time-ago/time-ago.pipe.js +3 -2
- package/esm2015/common/pipes/time-difference/time-difference.pipe.js +3 -2
- package/esm2015/common/pipes/time-until/time-until.pipe.js +3 -2
- package/esm2015/common/pipes/truncate/truncate.pipe.js +3 -2
- package/esm2015/common/public-api.js +3 -2
- package/esm2015/common/services/icon.service.js +3 -2
- package/esm2015/common/services/router-path.service.js +3 -2
- package/esm2015/covalent-core.js +3 -2
- package/esm2015/data-table/covalent-core-data-table.js +3 -2
- package/esm2015/data-table/data-table-cell/data-table-cell.component.js +4 -3
- package/esm2015/data-table/data-table-column/data-table-column.component.js +4 -3
- package/esm2015/data-table/data-table-row/data-table-row.component.js +3 -2
- package/esm2015/data-table/data-table-table/data-table-table.component.js +4 -3
- package/esm2015/data-table/data-table.component.js +6 -5
- package/esm2015/data-table/data-table.module.js +3 -2
- package/esm2015/data-table/directives/data-table-template.directive.js +3 -2
- package/esm2015/data-table/index.js +3 -2
- package/esm2015/data-table/public-api.js +3 -2
- package/esm2015/data-table/services/data-table.service.js +3 -2
- package/esm2015/dialogs/alert-dialog/alert-dialog.component.js +3 -2
- package/esm2015/dialogs/confirm-dialog/confirm-dialog.component.js +3 -2
- package/esm2015/dialogs/covalent-core-dialogs.js +3 -2
- package/esm2015/dialogs/dialog.component.js +4 -3
- package/esm2015/dialogs/dialogs.module.js +3 -2
- package/esm2015/dialogs/index.js +3 -2
- package/esm2015/dialogs/prompt-dialog/prompt-dialog.component.js +4 -3
- package/esm2015/dialogs/public-api.js +3 -2
- package/esm2015/dialogs/resizable-draggable-dialog/resizable-draggable-dialog.js +14 -13
- package/esm2015/dialogs/services/dialog.service.js +3 -2
- package/esm2015/dialogs/window-dialog/window-dialog.component.js +4 -3
- package/esm2015/dynamic-menu/covalent-core-dynamic-menu.js +3 -2
- package/esm2015/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.js +5 -4
- package/esm2015/dynamic-menu/dynamic-menu-item/dynamic-menu-link/dynamic-menu-link.component.js +4 -3
- package/esm2015/dynamic-menu/dynamic-menu.component.js +3 -2
- package/esm2015/dynamic-menu/dynamic-menu.module.js +3 -2
- package/esm2015/dynamic-menu/index.js +3 -2
- package/esm2015/dynamic-menu/public_api.js +3 -2
- package/esm2015/expansion-panel/covalent-core-expansion-panel.js +3 -2
- package/esm2015/expansion-panel/expansion-panel-group.component.js +3 -2
- package/esm2015/expansion-panel/expansion-panel.component.js +4 -3
- package/esm2015/expansion-panel/expansion-panel.module.js +3 -2
- package/esm2015/expansion-panel/index.js +3 -2
- package/esm2015/expansion-panel/public-api.js +3 -2
- package/esm2015/file/covalent-core-file.js +3 -2
- package/esm2015/file/directives/file-drop.directive.js +3 -2
- package/esm2015/file/directives/file-select.directive.js +3 -2
- package/esm2015/file/file-input/file-input.component.js +3 -2
- package/esm2015/file/file-upload/file-upload.component.js +4 -3
- package/esm2015/file/file.module.js +3 -2
- package/esm2015/file/index.js +3 -2
- package/esm2015/file/public-api.js +3 -2
- package/esm2015/file/services/file.service.js +3 -2
- package/esm2015/index.js +4 -2
- package/esm2015/json-formatter/covalent-core-json-formatter.js +3 -2
- package/esm2015/json-formatter/index.js +3 -2
- package/esm2015/json-formatter/json-formatter.component.js +4 -3
- package/esm2015/json-formatter/json-formatter.module.js +3 -2
- package/esm2015/json-formatter/public-api.js +3 -2
- package/esm2015/layout/covalent-core-layout.js +4 -3
- package/esm2015/layout/index.js +4 -3
- package/esm2015/layout/layout-card-over/layout-card-over.component.js +4 -3
- package/esm2015/layout/layout-footer/layout-footer.component.js +3 -2
- package/esm2015/layout/layout-manage-list/layout-manage-list.component.js +4 -3
- package/esm2015/layout/layout-manage-list/layout-manage-list.directives.js +7 -6
- package/esm2015/layout/layout-nav/layout-nav.component.js +4 -3
- package/esm2015/layout/layout-nav-list/layout-nav-list.component.js +4 -3
- package/esm2015/layout/layout-nav-list/layout-nav-list.directives.js +7 -6
- package/esm2015/layout/layout-toggle.class.js +22 -12
- package/esm2015/layout/layout.component.js +4 -3
- package/esm2015/layout/layout.directives.js +7 -6
- package/esm2015/layout/layout.module.js +3 -2
- package/esm2015/layout/navigation-drawer/navigation-drawer.component.js +4 -3
- package/esm2015/layout/public-api.js +4 -3
- package/esm2015/loading/covalent-core-loading.js +3 -2
- package/esm2015/loading/directives/loading.directive.js +3 -2
- package/esm2015/loading/index.js +3 -2
- package/esm2015/loading/loading.component.js +13 -12
- package/esm2015/loading/loading.module.js +3 -2
- package/esm2015/loading/public-api.js +3 -2
- package/esm2015/loading/services/loading.factory.js +3 -2
- package/esm2015/loading/services/loading.service.js +3 -2
- package/esm2015/media/covalent-core-media.js +3 -2
- package/esm2015/media/directives/media-toggle.directive.js +3 -2
- package/esm2015/media/index.js +3 -2
- package/esm2015/media/media.module.js +3 -2
- package/esm2015/media/public-api.js +3 -2
- package/esm2015/media/services/media.service.js +3 -2
- package/esm2015/menu/covalent-core-menu.js +3 -2
- package/esm2015/menu/index.js +3 -2
- package/esm2015/menu/menu.component.js +4 -3
- package/esm2015/menu/menu.module.js +3 -2
- package/esm2015/menu/public-api.js +3 -2
- package/esm2015/message/covalent-core-message.js +3 -2
- package/esm2015/message/index.js +3 -2
- package/esm2015/message/message.component.js +4 -3
- package/esm2015/message/message.module.js +3 -2
- package/esm2015/message/public-api.js +3 -2
- package/esm2015/nav-links/covalent-core-nav-links.js +3 -2
- package/esm2015/nav-links/index.js +3 -2
- package/esm2015/nav-links/nav-links.component.js +3 -2
- package/esm2015/nav-links/nav-links.module.js +3 -2
- package/esm2015/nav-links/public-api.js +3 -2
- package/esm2015/notifications/covalent-core-notifications.js +3 -2
- package/esm2015/notifications/index.js +3 -2
- package/esm2015/notifications/notification-count.component.js +10 -9
- package/esm2015/notifications/notifications.module.js +3 -2
- package/esm2015/notifications/public-api.js +3 -2
- package/esm2015/paging/covalent-core-paging.js +3 -2
- package/esm2015/paging/index.js +3 -2
- package/esm2015/paging/paging-bar.component.js +4 -3
- package/esm2015/paging/paging.module.js +3 -2
- package/esm2015/paging/public-api.js +3 -2
- package/esm2015/search/covalent-core-search.js +3 -2
- package/esm2015/search/index.js +3 -2
- package/esm2015/search/public-api.js +3 -2
- package/esm2015/search/search-box/search-box.component.js +4 -3
- package/esm2015/search/search-input/search-input.component.js +4 -3
- package/esm2015/search/search.module.js +3 -2
- package/esm2015/sidesheet/covalent-core-sidesheet.js +3 -2
- package/esm2015/sidesheet/index.js +3 -2
- package/esm2015/sidesheet/public-api.js +3 -2
- package/esm2015/sidesheet/sidesheet.component.js +4 -3
- package/esm2015/sidesheet/sidesheet.module.js +3 -2
- package/esm2015/steps/covalent-core-steps.js +3 -2
- package/esm2015/steps/index.js +3 -2
- package/esm2015/steps/nav/nav-step-link/nav-step-link.component.js +4 -3
- package/esm2015/steps/nav/nav-steps-horizontal/nav-steps-horizontal.component.js +4 -3
- package/esm2015/steps/nav/nav-steps-vertical/nav-steps-vertical.component.js +4 -3
- package/esm2015/steps/public-api.js +3 -2
- package/esm2015/steps/step-body/step-body.component.js +4 -3
- package/esm2015/steps/step-header/step-header.component.js +4 -3
- package/esm2015/steps/step.component.js +6 -5
- package/esm2015/steps/steps.component.js +6 -5
- package/esm2015/steps/steps.module.js +3 -2
- package/esm2015/tab-select/covalent-core-tab-select.js +3 -2
- package/esm2015/tab-select/index.js +3 -2
- package/esm2015/tab-select/public-api.js +3 -2
- package/esm2015/tab-select/tab-option.component.js +3 -2
- package/esm2015/tab-select/tab-select.component.js +3 -2
- package/esm2015/tab-select/tab-select.module.js +3 -2
- package/esm2015/user-profile/covalent-core-user-profile.js +3 -2
- package/esm2015/user-profile/index.js +3 -2
- package/esm2015/user-profile/public_api.js +3 -2
- package/esm2015/user-profile/user-profile-menu/user-profile-menu.component.js +4 -3
- package/esm2015/user-profile/user-profile.component.js +3 -2
- package/esm2015/user-profile/user-profile.module.js +3 -2
- package/esm2015/virtual-scroll/covalent-core-virtual-scroll.js +3 -2
- package/esm2015/virtual-scroll/index.js +3 -2
- package/esm2015/virtual-scroll/public-api.js +3 -2
- package/esm2015/virtual-scroll/virtual-scroll-container.component.js +4 -3
- package/esm2015/virtual-scroll/virtual-scroll-row.directive.js +3 -2
- package/esm2015/virtual-scroll/virtual-scroll.module.js +3 -2
- package/expansion-panel/covalent-core-expansion-panel.metadata.json +1 -1
- package/expansion-panel/package.json +1 -3
- package/fesm2015/covalent-core-breadcrumbs.js +13 -7
- package/fesm2015/covalent-core-breadcrumbs.js.map +1 -1
- package/fesm2015/covalent-core-chips.js +11 -6
- package/fesm2015/covalent-core-chips.js.map +1 -1
- package/fesm2015/covalent-core-common.js +62 -31
- package/fesm2015/covalent-core-common.js.map +1 -1
- package/fesm2015/covalent-core-data-table.js +28 -17
- package/fesm2015/covalent-core-data-table.js.map +1 -1
- package/fesm2015/covalent-core-dialogs.js +36 -25
- package/fesm2015/covalent-core-dialogs.js.map +1 -1
- package/fesm2015/covalent-core-dynamic-menu.js +17 -10
- package/fesm2015/covalent-core-dynamic-menu.js.map +1 -1
- package/fesm2015/covalent-core-expansion-panel.js +13 -7
- package/fesm2015/covalent-core-expansion-panel.js.map +1 -1
- package/fesm2015/covalent-core-file.js +19 -10
- package/fesm2015/covalent-core-file.js.map +1 -1
- package/fesm2015/covalent-core-json-formatter.js +11 -6
- package/fesm2015/covalent-core-json-formatter.js.map +1 -1
- package/fesm2015/covalent-core-layout.js +65 -41
- package/fesm2015/covalent-core-layout.js.map +1 -1
- package/fesm2015/covalent-core-loading.js +26 -18
- package/fesm2015/covalent-core-loading.js.map +1 -1
- package/fesm2015/covalent-core-media.js +12 -6
- package/fesm2015/covalent-core-media.js.map +1 -1
- package/fesm2015/covalent-core-menu.js +11 -6
- package/fesm2015/covalent-core-menu.js.map +1 -1
- package/fesm2015/covalent-core-message.js +11 -6
- package/fesm2015/covalent-core-message.js.map +1 -1
- package/fesm2015/covalent-core-nav-links.js +10 -5
- package/fesm2015/covalent-core-nav-links.js.map +1 -1
- package/fesm2015/covalent-core-notifications.js +17 -12
- package/fesm2015/covalent-core-notifications.js.map +1 -1
- package/fesm2015/covalent-core-paging.js +11 -6
- package/fesm2015/covalent-core-paging.js.map +1 -1
- package/fesm2015/covalent-core-search.js +14 -8
- package/fesm2015/covalent-core-search.js.map +1 -1
- package/fesm2015/covalent-core-sidesheet.js +11 -6
- package/fesm2015/covalent-core-sidesheet.js.map +1 -1
- package/fesm2015/covalent-core-steps.js +33 -22
- package/fesm2015/covalent-core-steps.js.map +1 -1
- package/fesm2015/covalent-core-tab-select.js +12 -6
- package/fesm2015/covalent-core-tab-select.js.map +1 -1
- package/fesm2015/covalent-core-user-profile.js +13 -7
- package/fesm2015/covalent-core-user-profile.js.map +1 -1
- package/fesm2015/covalent-core-virtual-scroll.js +13 -7
- package/fesm2015/covalent-core-virtual-scroll.js.map +1 -1
- package/fesm2015/covalent-core.js +4 -2
- package/fesm2015/covalent-core.js.map +1 -1
- package/file/covalent-core-file.metadata.json +1 -1
- package/file/package.json +1 -3
- package/json-formatter/covalent-core-json-formatter.metadata.json +1 -1
- package/json-formatter/package.json +1 -3
- package/layout/covalent-core-layout.metadata.json +1 -1
- package/layout/layout-manage-list/layout-manage-list.directives.d.ts +4 -4
- package/layout/layout-nav-list/layout-nav-list.directives.d.ts +4 -4
- package/layout/layout-toggle.class.d.ts +1 -1
- package/layout/layout.directives.d.ts +4 -4
- package/layout/package.json +1 -3
- package/loading/covalent-core-loading.metadata.json +1 -1
- package/loading/package.json +1 -3
- package/media/package.json +1 -3
- package/menu/covalent-core-menu.metadata.json +1 -1
- package/menu/package.json +1 -3
- package/message/covalent-core-message.metadata.json +1 -1
- package/message/package.json +1 -3
- package/nav-links/package.json +1 -3
- package/notifications/covalent-core-notifications.metadata.json +1 -1
- package/notifications/package.json +1 -3
- package/package.json +12 -12
- package/paging/covalent-core-paging.metadata.json +1 -1
- package/paging/package.json +1 -3
- package/schematics/components.js +1 -0
- package/schematics/components.js.map +1 -1
- package/schematics/ng-add/files/theme.scss +1 -1
- package/schematics/ng-add/index.js +4 -6
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-update/index.js +1 -0
- package/schematics/ng-update/index.js.map +1 -1
- package/schematics/ng-update/target-version.js +1 -0
- package/schematics/ng-update/target-version.js.map +1 -1
- package/schematics/version-names.js +1 -0
- package/schematics/version-names.js.map +1 -1
- package/search/covalent-core-search.metadata.json +1 -1
- package/search/package.json +1 -3
- package/sidesheet/covalent-core-sidesheet.metadata.json +1 -1
- package/sidesheet/package.json +1 -3
- package/steps/covalent-core-steps.metadata.json +1 -1
- package/steps/package.json +1 -3
- package/tab-select/covalent-core-tab-select.metadata.json +1 -1
- package/tab-select/package.json +1 -3
- package/theming/prebuilt/blue-grey-deep-orange.css +193 -28
- package/theming/prebuilt/blue-grey-deep-orange.css.map +1 -1
- package/theming/prebuilt/blue-orange.css +193 -28
- package/theming/prebuilt/blue-orange.css.map +1 -1
- package/theming/prebuilt/indigo-pink.css +193 -28
- package/theming/prebuilt/indigo-pink.css.map +1 -1
- package/theming/prebuilt/orange-light-blue.css +193 -28
- package/theming/prebuilt/orange-light-blue.css.map +1 -1
- package/theming/prebuilt/teal-orange.css +193 -28
- package/theming/prebuilt/teal-orange.css.map +1 -1
- package/user-profile/covalent-core-user-profile.metadata.json +1 -1
- package/user-profile/package.json +1 -3
- package/virtual-scroll/covalent-core-virtual-scroll.metadata.json +1 -1
- package/virtual-scroll/package.json +1 -3
- package/esm5/breadcrumbs/breadcrumb/breadcrumb.component.js +0 -216
- package/esm5/breadcrumbs/breadcrumbs.component.js +0 -286
- package/esm5/breadcrumbs/breadcrumbs.module.js +0 -23
- package/esm5/breadcrumbs/covalent-core-breadcrumbs.js +0 -9
- package/esm5/breadcrumbs/index.js +0 -6
- package/esm5/breadcrumbs/public-api.js +0 -8
- package/esm5/chips/chips.component.js +0 -1453
- package/esm5/chips/chips.module.js +0 -26
- package/esm5/chips/covalent-core-chips.js +0 -9
- package/esm5/chips/index.js +0 -6
- package/esm5/chips/public-api.js +0 -7
- package/esm5/common/animations/bounce/bounce.animation.js +0 -75
- package/esm5/common/animations/collapse/collapse.animation.js +0 -66
- package/esm5/common/animations/common/interfaces.js +0 -17
- package/esm5/common/animations/fade/fadeInOut.animation.js +0 -52
- package/esm5/common/animations/flash/flash.animation.js +0 -39
- package/esm5/common/animations/headshake/headshake.animation.js +0 -40
- package/esm5/common/animations/jello/jello.animation.js +0 -43
- package/esm5/common/animations/pulse/pulse.animation.js +0 -37
- package/esm5/common/animations/rotate/rotate.animation.js +0 -40
- package/esm5/common/behaviors/control-value-accesor.mixin.js +0 -127
- package/esm5/common/behaviors/disable-ripple.mixin.js +0 -75
- package/esm5/common/behaviors/disabled.mixin.js +0 -75
- package/esm5/common/common.module.js +0 -57
- package/esm5/common/covalent-core-common.js +0 -11
- package/esm5/common/directives/fullscreen/fullscreen.directive.js +0 -228
- package/esm5/common/forms/auto-trim/auto-trim.directive.js +0 -52
- package/esm5/common/forms/validators/validators.js +0 -73
- package/esm5/common/functions/clipboard.js +0 -29
- package/esm5/common/functions/convert.js +0 -120
- package/esm5/common/functions/download.js +0 -93
- package/esm5/common/functions/file.js +0 -28
- package/esm5/common/index.js +0 -6
- package/esm5/common/pipes/bytes/bytes.pipe.js +0 -54
- package/esm5/common/pipes/decimal-bytes/decimal-bytes.pipe.js +0 -54
- package/esm5/common/pipes/digits/digits.pipe.js +0 -72
- package/esm5/common/pipes/time-ago/time-ago.pipe.js +0 -89
- package/esm5/common/pipes/time-difference/time-difference.pipe.js +0 -74
- package/esm5/common/pipes/time-until/time-until.pipe.js +0 -89
- package/esm5/common/pipes/truncate/truncate.pipe.js +0 -42
- package/esm5/common/public-api.js +0 -43
- package/esm5/common/services/icon.service.js +0 -1118
- package/esm5/common/services/router-path.service.js +0 -69
- package/esm5/covalent-core.js +0 -9
- package/esm5/data-table/covalent-core-data-table.js +0 -9
- package/esm5/data-table/data-table-cell/data-table-cell.component.js +0 -98
- package/esm5/data-table/data-table-column/data-table-column.component.js +0 -257
- package/esm5/data-table/data-table-row/data-table-row.component.js +0 -145
- package/esm5/data-table/data-table-table/data-table-table.component.js +0 -40
- package/esm5/data-table/data-table.component.js +0 -2079
- package/esm5/data-table/data-table.module.js +0 -42
- package/esm5/data-table/directives/data-table-template.directive.js +0 -31
- package/esm5/data-table/index.js +0 -6
- package/esm5/data-table/public-api.js +0 -13
- package/esm5/data-table/services/data-table.service.js +0 -184
- package/esm5/dialogs/alert-dialog/alert-dialog.component.js +0 -48
- package/esm5/dialogs/confirm-dialog/confirm-dialog.component.js +0 -63
- package/esm5/dialogs/covalent-core-dialogs.js +0 -10
- package/esm5/dialogs/dialog.component.js +0 -76
- package/esm5/dialogs/dialogs.module.js +0 -60
- package/esm5/dialogs/index.js +0 -6
- package/esm5/dialogs/prompt-dialog/prompt-dialog.component.js +0 -100
- package/esm5/dialogs/public-api.js +0 -12
- package/esm5/dialogs/resizable-draggable-dialog/resizable-draggable-dialog.js +0 -356
- package/esm5/dialogs/services/dialog.service.js +0 -441
- package/esm5/dialogs/window-dialog/window-dialog.component.js +0 -60
- package/esm5/dynamic-menu/covalent-core-dynamic-menu.js +0 -10
- package/esm5/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.js +0 -45
- package/esm5/dynamic-menu/dynamic-menu-item/dynamic-menu-link/dynamic-menu-link.component.js +0 -39
- package/esm5/dynamic-menu/dynamic-menu.component.js +0 -94
- package/esm5/dynamic-menu/dynamic-menu.module.js +0 -29
- package/esm5/dynamic-menu/index.js +0 -6
- package/esm5/dynamic-menu/public_api.js +0 -8
- package/esm5/expansion-panel/covalent-core-expansion-panel.js +0 -9
- package/esm5/expansion-panel/expansion-panel-group.component.js +0 -251
- package/esm5/expansion-panel/expansion-panel.component.js +0 -344
- package/esm5/expansion-panel/expansion-panel.module.js +0 -34
- package/esm5/expansion-panel/index.js +0 -6
- package/esm5/expansion-panel/public-api.js +0 -8
- package/esm5/file/covalent-core-file.js +0 -9
- package/esm5/file/directives/file-drop.directive.js +0 -276
- package/esm5/file/directives/file-select.directive.js +0 -124
- package/esm5/file/file-input/file-input.component.js +0 -225
- package/esm5/file/file-upload/file-upload.component.js +0 -284
- package/esm5/file/file.module.js +0 -38
- package/esm5/file/index.js +0 -6
- package/esm5/file/public-api.js +0 -11
- package/esm5/file/services/file.service.js +0 -137
- package/esm5/index.js +0 -5
- package/esm5/json-formatter/covalent-core-json-formatter.js +0 -9
- package/esm5/json-formatter/index.js +0 -6
- package/esm5/json-formatter/json-formatter.component.js +0 -433
- package/esm5/json-formatter/json-formatter.module.js +0 -23
- package/esm5/json-formatter/public-api.js +0 -7
- package/esm5/layout/covalent-core-layout.js +0 -9
- package/esm5/layout/index.js +0 -6
- package/esm5/layout/layout-card-over/layout-card-over.component.js +0 -72
- package/esm5/layout/layout-footer/layout-footer.component.js +0 -77
- package/esm5/layout/layout-manage-list/layout-manage-list.component.js +0 -175
- package/esm5/layout/layout-manage-list/layout-manage-list.directives.js +0 -147
- package/esm5/layout/layout-nav/layout-nav.component.js +0 -108
- package/esm5/layout/layout-nav-list/layout-nav-list.component.js +0 -257
- package/esm5/layout/layout-nav-list/layout-nav-list.directives.js +0 -147
- package/esm5/layout/layout-toggle.class.js +0 -214
- package/esm5/layout/layout.component.js +0 -175
- package/esm5/layout/layout.directives.js +0 -144
- package/esm5/layout/layout.module.js +0 -67
- package/esm5/layout/navigation-drawer/navigation-drawer.component.js +0 -364
- package/esm5/layout/public-api.js +0 -17
- package/esm5/loading/covalent-core-loading.js +0 -9
- package/esm5/loading/directives/loading.directive.js +0 -304
- package/esm5/loading/index.js +0 -6
- package/esm5/loading/loading.component.js +0 -367
- package/esm5/loading/loading.module.js +0 -33
- package/esm5/loading/public-api.js +0 -10
- package/esm5/loading/services/loading.factory.js +0 -378
- package/esm5/loading/services/loading.service.js +0 -494
- package/esm5/media/covalent-core-media.js +0 -9
- package/esm5/media/directives/media-toggle.directive.js +0 -261
- package/esm5/media/index.js +0 -6
- package/esm5/media/media.module.js +0 -23
- package/esm5/media/public-api.js +0 -8
- package/esm5/media/services/media.service.js +0 -229
- package/esm5/menu/covalent-core-menu.js +0 -9
- package/esm5/menu/index.js +0 -6
- package/esm5/menu/menu.component.js +0 -19
- package/esm5/menu/menu.module.js +0 -25
- package/esm5/menu/public-api.js +0 -7
- package/esm5/message/covalent-core-message.js +0 -9
- package/esm5/message/index.js +0 -6
- package/esm5/message/message.component.js +0 -402
- package/esm5/message/message.module.js +0 -24
- package/esm5/message/public-api.js +0 -7
- package/esm5/nav-links/covalent-core-nav-links.js +0 -9
- package/esm5/nav-links/index.js +0 -6
- package/esm5/nav-links/nav-links.component.js +0 -171
- package/esm5/nav-links/nav-links.module.js +0 -40
- package/esm5/nav-links/public-api.js +0 -7
- package/esm5/notifications/covalent-core-notifications.js +0 -9
- package/esm5/notifications/index.js +0 -6
- package/esm5/notifications/notification-count.component.js +0 -268
- package/esm5/notifications/notifications.module.js +0 -23
- package/esm5/notifications/public-api.js +0 -7
- package/esm5/paging/covalent-core-paging.js +0 -9
- package/esm5/paging/index.js +0 -6
- package/esm5/paging/paging-bar.component.js +0 -542
- package/esm5/paging/paging.module.js +0 -23
- package/esm5/paging/public-api.js +0 -7
- package/esm5/search/covalent-core-search.js +0 -9
- package/esm5/search/index.js +0 -6
- package/esm5/search/public-api.js +0 -8
- package/esm5/search/search-box/search-box.component.js +0 -298
- package/esm5/search/search-input/search-input.component.js +0 -297
- package/esm5/search/search.module.js +0 -26
- package/esm5/sidesheet/covalent-core-sidesheet.js +0 -9
- package/esm5/sidesheet/index.js +0 -6
- package/esm5/sidesheet/public-api.js +0 -7
- package/esm5/sidesheet/sidesheet.component.js +0 -89
- package/esm5/sidesheet/sidesheet.module.js +0 -30
- package/esm5/steps/covalent-core-steps.js +0 -9
- package/esm5/steps/index.js +0 -6
- package/esm5/steps/nav/nav-step-link/nav-step-link.component.js +0 -165
- package/esm5/steps/nav/nav-steps-horizontal/nav-steps-horizontal.component.js +0 -464
- package/esm5/steps/nav/nav-steps-vertical/nav-steps-vertical.component.js +0 -143
- package/esm5/steps/public-api.js +0 -13
- package/esm5/steps/step-body/step-body.component.js +0 -103
- package/esm5/steps/step-header/step-header.component.js +0 -101
- package/esm5/steps/step.component.js +0 -399
- package/esm5/steps/steps.component.js +0 -313
- package/esm5/steps/steps.module.js +0 -47
- package/esm5/tab-select/covalent-core-tab-select.js +0 -9
- package/esm5/tab-select/index.js +0 -6
- package/esm5/tab-select/public-api.js +0 -8
- package/esm5/tab-select/tab-option.component.js +0 -86
- package/esm5/tab-select/tab-select.component.js +0 -344
- package/esm5/tab-select/tab-select.module.js +0 -34
- package/esm5/user-profile/covalent-core-user-profile.js +0 -9
- package/esm5/user-profile/index.js +0 -6
- package/esm5/user-profile/public_api.js +0 -8
- package/esm5/user-profile/user-profile-menu/user-profile-menu.component.js +0 -42
- package/esm5/user-profile/user-profile.component.js +0 -29
- package/esm5/user-profile/user-profile.module.js +0 -36
- package/esm5/virtual-scroll/covalent-core-virtual-scroll.js +0 -9
- package/esm5/virtual-scroll/index.js +0 -6
- package/esm5/virtual-scroll/public-api.js +0 -8
- package/esm5/virtual-scroll/virtual-scroll-container.component.js +0 -468
- package/esm5/virtual-scroll/virtual-scroll-row.directive.js +0 -24
- package/esm5/virtual-scroll/virtual-scroll.module.js +0 -24
- package/fesm5/covalent-core-breadcrumbs.js +0 -535
- package/fesm5/covalent-core-breadcrumbs.js.map +0 -1
- package/fesm5/covalent-core-chips.js +0 -1484
- package/fesm5/covalent-core-chips.js.map +0 -1
- package/fesm5/covalent-core-common.js +0 -2961
- package/fesm5/covalent-core-common.js.map +0 -1
- package/fesm5/covalent-core-data-table.js +0 -2863
- package/fesm5/covalent-core-data-table.js.map +0 -1
- package/fesm5/covalent-core-dialogs.js +0 -1189
- package/fesm5/covalent-core-dialogs.js.map +0 -1
- package/fesm5/covalent-core-dynamic-menu.js +0 -214
- package/fesm5/covalent-core-dynamic-menu.js.map +0 -1
- package/fesm5/covalent-core-expansion-panel.js +0 -631
- package/fesm5/covalent-core-expansion-panel.js.map +0 -1
- package/fesm5/covalent-core-file.js +0 -1068
- package/fesm5/covalent-core-file.js.map +0 -1
- package/fesm5/covalent-core-json-formatter.js +0 -470
- package/fesm5/covalent-core-json-formatter.js.map +0 -1
- package/fesm5/covalent-core-layout.js +0 -1906
- package/fesm5/covalent-core-layout.js.map +0 -1
- package/fesm5/covalent-core-loading.js +0 -1562
- package/fesm5/covalent-core-loading.js.map +0 -1
- package/fesm5/covalent-core-media.js +0 -522
- package/fesm5/covalent-core-media.js.map +0 -1
- package/fesm5/covalent-core-menu.js +0 -58
- package/fesm5/covalent-core-menu.js.map +0 -1
- package/fesm5/covalent-core-message.js +0 -439
- package/fesm5/covalent-core-message.js.map +0 -1
- package/fesm5/covalent-core-nav-links.js +0 -224
- package/fesm5/covalent-core-nav-links.js.map +0 -1
- package/fesm5/covalent-core-notifications.js +0 -303
- package/fesm5/covalent-core-notifications.js.map +0 -1
- package/fesm5/covalent-core-paging.js +0 -579
- package/fesm5/covalent-core-paging.js.map +0 -1
- package/fesm5/covalent-core-search.js +0 -623
- package/fesm5/covalent-core-search.js.map +0 -1
- package/fesm5/covalent-core-sidesheet.js +0 -129
- package/fesm5/covalent-core-sidesheet.js.map +0 -1
- package/fesm5/covalent-core-steps.js +0 -1704
- package/fesm5/covalent-core-steps.js.map +0 -1
- package/fesm5/covalent-core-tab-select.js +0 -467
- package/fesm5/covalent-core-tab-select.js.map +0 -1
- package/fesm5/covalent-core-user-profile.js +0 -118
- package/fesm5/covalent-core-user-profile.js.map +0 -1
- package/fesm5/covalent-core-virtual-scroll.js +0 -526
- package/fesm5/covalent-core-virtual-scroll.js.map +0 -1
- package/fesm5/covalent-core.js +0 -10
- package/fesm5/covalent-core.js.map +0 -1
@@ -1,14 +1,19 @@
|
|
1
1
|
(function (global, factory) {
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/material/tooltip'), require('@angular/material/icon'), require('@angular/cdk/bidi'), require('@covalent/core/common')) :
|
3
3
|
typeof define === 'function' && define.amd ? define('@covalent/core/json-formatter', ['exports', '@angular/core', '@angular/common', '@angular/material/tooltip', '@angular/material/icon', '@angular/cdk/bidi', '@covalent/core/common'], factory) :
|
4
|
-
(global = global || self, factory((global.covalent = global.covalent || {}, global.covalent.core = global.covalent.core || {}, global.covalent.core['json-formatter'] = {}), global.ng.core, global.ng.common, global.ng.material.tooltip, global.ng.material.icon, global.ng.cdk.bidi, global.covalent.core.common));
|
5
|
-
}(this, (function (exports, core, common, tooltip, icon, bidi, common
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.covalent = global.covalent || {}, global.covalent.core = global.covalent.core || {}, global.covalent.core['json-formatter'] = {}), global.ng.core, global.ng.common, global.ng.material.tooltip, global.ng.material.icon, global.ng.cdk.bidi, global.covalent.core.common));
|
5
|
+
}(this, (function (exports, core, common$1, tooltip, icon, bidi, common) { 'use strict';
|
6
6
|
|
7
7
|
/**
|
8
8
|
* @fileoverview added by tsickle
|
9
|
-
*
|
9
|
+
* Generated from: json-formatter.component.ts
|
10
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
10
11
|
*/
|
11
12
|
var TdJsonFormatterComponent = /** @class */ (function () {
|
13
|
+
/**
|
14
|
+
* @param {?} _changeDetectorRef
|
15
|
+
* @param {?} _dir
|
16
|
+
*/
|
12
17
|
function TdJsonFormatterComponent(_changeDetectorRef, _dir) {
|
13
18
|
this._changeDetectorRef = _changeDetectorRef;
|
14
19
|
this._dir = _dir;
|
@@ -16,183 +21,140 @@
|
|
16
21
|
this._levelsOpen = 0;
|
17
22
|
}
|
18
23
|
Object.defineProperty(TdJsonFormatterComponent.prototype, "levelsOpen", {
|
19
|
-
|
24
|
+
/**
|
20
25
|
* @return {?}
|
21
26
|
*/
|
22
|
-
function () {
|
27
|
+
get: function () {
|
23
28
|
return this._levelsOpen;
|
24
29
|
},
|
25
30
|
/**
|
26
|
-
* levelsOpen?: number
|
27
|
-
* Levels opened by default when JS object is formatted and rendered.
|
28
|
-
*/
|
29
|
-
set: /**
|
30
31
|
* levelsOpen?: number
|
31
32
|
* Levels opened by default when JS object is formatted and rendered.
|
32
33
|
* @param {?} levelsOpen
|
33
34
|
* @return {?}
|
34
35
|
*/
|
35
|
-
function (levelsOpen) {
|
36
|
+
set: function (levelsOpen) {
|
36
37
|
if (!Number.isInteger(levelsOpen)) {
|
37
38
|
throw new Error('[levelsOpen] needs to be an integer.');
|
38
39
|
}
|
39
40
|
this._levelsOpen = levelsOpen;
|
40
41
|
this._open = levelsOpen > 0;
|
41
42
|
},
|
42
|
-
enumerable:
|
43
|
+
enumerable: false,
|
43
44
|
configurable: true
|
44
45
|
});
|
45
46
|
Object.defineProperty(TdJsonFormatterComponent.prototype, "open", {
|
46
|
-
|
47
|
+
/**
|
47
48
|
* @return {?}
|
48
49
|
*/
|
49
|
-
function () {
|
50
|
+
get: function () {
|
50
51
|
return this._open;
|
51
52
|
},
|
52
|
-
enumerable:
|
53
|
+
enumerable: false,
|
53
54
|
configurable: true
|
54
55
|
});
|
55
56
|
Object.defineProperty(TdJsonFormatterComponent.prototype, "key", {
|
56
|
-
|
57
|
+
/**
|
57
58
|
* @return {?}
|
58
59
|
*/
|
59
|
-
function () {
|
60
|
+
get: function () {
|
60
61
|
/** @type {?} */
|
61
62
|
var elipsis = this._key && this._key.length > TdJsonFormatterComponent.KEY_MAX_LENGTH ? '…' : '';
|
62
63
|
return this._key ? this._key.substring(0, TdJsonFormatterComponent.KEY_MAX_LENGTH) + elipsis : this._key;
|
63
64
|
},
|
64
65
|
/**
|
65
|
-
* key?: string
|
66
|
-
* Tag to be displayed next to formatted object.
|
67
|
-
*/
|
68
|
-
set: /**
|
69
66
|
* key?: string
|
70
67
|
* Tag to be displayed next to formatted object.
|
71
68
|
* @param {?} key
|
72
69
|
* @return {?}
|
73
70
|
*/
|
74
|
-
function (key) {
|
71
|
+
set: function (key) {
|
75
72
|
this._key = key;
|
76
73
|
},
|
77
|
-
enumerable:
|
74
|
+
enumerable: false,
|
78
75
|
configurable: true
|
79
76
|
});
|
80
77
|
Object.defineProperty(TdJsonFormatterComponent.prototype, "data", {
|
81
|
-
|
78
|
+
/**
|
82
79
|
* @return {?}
|
83
80
|
*/
|
84
|
-
function () {
|
81
|
+
get: function () {
|
85
82
|
return this._data;
|
86
83
|
},
|
87
84
|
/**
|
88
|
-
* data: any
|
89
|
-
* JS object to be formatted.
|
90
|
-
*/
|
91
|
-
set: /**
|
92
85
|
* data: any
|
93
86
|
* JS object to be formatted.
|
94
87
|
* @param {?} data
|
95
88
|
* @return {?}
|
96
89
|
*/
|
97
|
-
function (data) {
|
90
|
+
set: function (data) {
|
98
91
|
this._data = data;
|
99
92
|
this.parseChildren();
|
100
93
|
},
|
101
|
-
enumerable:
|
94
|
+
enumerable: false,
|
102
95
|
configurable: true
|
103
96
|
});
|
104
97
|
Object.defineProperty(TdJsonFormatterComponent.prototype, "children", {
|
105
|
-
|
98
|
+
/**
|
106
99
|
* @return {?}
|
107
100
|
*/
|
108
|
-
function () {
|
101
|
+
get: function () {
|
109
102
|
return this._children;
|
110
103
|
},
|
111
|
-
enumerable:
|
104
|
+
enumerable: false,
|
112
105
|
configurable: true
|
113
106
|
});
|
114
107
|
Object.defineProperty(TdJsonFormatterComponent.prototype, "isRTL", {
|
115
|
-
|
108
|
+
/**
|
116
109
|
* @return {?}
|
117
110
|
*/
|
118
|
-
function () {
|
111
|
+
get: function () {
|
119
112
|
if (this._dir) {
|
120
113
|
return this._dir.dir === 'rtl';
|
121
114
|
}
|
122
115
|
return false;
|
123
116
|
},
|
124
|
-
enumerable:
|
117
|
+
enumerable: false,
|
125
118
|
configurable: true
|
126
119
|
});
|
127
120
|
/**
|
128
|
-
* Refreshes json-formatter and rerenders [data]
|
129
|
-
*/
|
130
|
-
/**
|
131
|
-
* Refreshes json-formatter and rerenders [data]
|
132
|
-
* @return {?}
|
133
|
-
*/
|
134
|
-
TdJsonFormatterComponent.prototype.refresh = /**
|
135
121
|
* Refreshes json-formatter and rerenders [data]
|
136
122
|
* @return {?}
|
137
123
|
*/
|
138
|
-
function () {
|
124
|
+
TdJsonFormatterComponent.prototype.refresh = function () {
|
139
125
|
this._changeDetectorRef.markForCheck();
|
140
126
|
};
|
141
127
|
/**
|
142
|
-
* Toggles collapse/expanded state of component.
|
143
|
-
*/
|
144
|
-
/**
|
145
|
-
* Toggles collapse/expanded state of component.
|
146
|
-
* @return {?}
|
147
|
-
*/
|
148
|
-
TdJsonFormatterComponent.prototype.toggle = /**
|
149
128
|
* Toggles collapse/expanded state of component.
|
150
129
|
* @return {?}
|
151
130
|
*/
|
152
|
-
function () {
|
131
|
+
TdJsonFormatterComponent.prototype.toggle = function () {
|
153
132
|
this._open = !this._open;
|
154
133
|
};
|
155
134
|
/**
|
156
135
|
* @return {?}
|
157
136
|
*/
|
158
|
-
TdJsonFormatterComponent.prototype.isObject =
|
159
|
-
* @return {?}
|
160
|
-
*/
|
161
|
-
function () {
|
137
|
+
TdJsonFormatterComponent.prototype.isObject = function () {
|
162
138
|
return this.getType(this._data) === 'object';
|
163
139
|
};
|
164
140
|
/**
|
165
141
|
* @return {?}
|
166
142
|
*/
|
167
|
-
TdJsonFormatterComponent.prototype.isArray =
|
168
|
-
* @return {?}
|
169
|
-
*/
|
170
|
-
function () {
|
143
|
+
TdJsonFormatterComponent.prototype.isArray = function () {
|
171
144
|
return Array.isArray(this._data);
|
172
145
|
};
|
173
146
|
/**
|
174
147
|
* @return {?}
|
175
148
|
*/
|
176
|
-
TdJsonFormatterComponent.prototype.hasChildren =
|
177
|
-
* @return {?}
|
178
|
-
*/
|
179
|
-
function () {
|
149
|
+
TdJsonFormatterComponent.prototype.hasChildren = function () {
|
180
150
|
return this._children && this._children.length > 0;
|
181
151
|
};
|
182
152
|
/**
|
183
|
-
* Gets parsed value depending on value type.
|
184
|
-
*/
|
185
|
-
/**
|
186
|
-
* Gets parsed value depending on value type.
|
187
|
-
* @param {?} value
|
188
|
-
* @return {?}
|
189
|
-
*/
|
190
|
-
TdJsonFormatterComponent.prototype.getValue = /**
|
191
153
|
* Gets parsed value depending on value type.
|
192
154
|
* @param {?} value
|
193
155
|
* @return {?}
|
194
156
|
*/
|
195
|
-
function (value) {
|
157
|
+
TdJsonFormatterComponent.prototype.getValue = function (value) {
|
196
158
|
/** @type {?} */
|
197
159
|
var type = this.getType(value);
|
198
160
|
if (type === 'undefined' || type === 'null') {
|
@@ -217,22 +179,12 @@
|
|
217
179
|
return value;
|
218
180
|
};
|
219
181
|
/**
|
220
|
-
* Gets type of object.
|
221
|
-
* returns 'null' if object is null and 'date' if value is object and can be parsed to a date.
|
222
|
-
*/
|
223
|
-
/**
|
224
|
-
* Gets type of object.
|
225
|
-
* returns 'null' if object is null and 'date' if value is object and can be parsed to a date.
|
226
|
-
* @param {?} object
|
227
|
-
* @return {?}
|
228
|
-
*/
|
229
|
-
TdJsonFormatterComponent.prototype.getType = /**
|
230
182
|
* Gets type of object.
|
231
183
|
* returns 'null' if object is null and 'date' if value is object and can be parsed to a date.
|
232
184
|
* @param {?} object
|
233
185
|
* @return {?}
|
234
186
|
*/
|
235
|
-
function (object) {
|
187
|
+
TdJsonFormatterComponent.prototype.getType = function (object) {
|
236
188
|
if (typeof object === 'object') {
|
237
189
|
if (!object) {
|
238
190
|
return 'null';
|
@@ -249,20 +201,11 @@
|
|
249
201
|
return typeof object;
|
250
202
|
};
|
251
203
|
/**
|
252
|
-
* Generates string representation depending if its an object or function.
|
253
|
-
* see: http://stackoverflow.com/a/332429
|
254
|
-
*/
|
255
|
-
/**
|
256
|
-
* Generates string representation depending if its an object or function.
|
257
|
-
* see: http://stackoverflow.com/a/332429
|
258
|
-
* @return {?}
|
259
|
-
*/
|
260
|
-
TdJsonFormatterComponent.prototype.getObjectName = /**
|
261
204
|
* Generates string representation depending if its an object or function.
|
262
205
|
* see: http://stackoverflow.com/a/332429
|
263
206
|
* @return {?}
|
264
207
|
*/
|
265
|
-
function () {
|
208
|
+
TdJsonFormatterComponent.prototype.getObjectName = function () {
|
266
209
|
/** @type {?} */
|
267
210
|
var object = this._data;
|
268
211
|
if (this.isObject() && !object.constructor) {
|
@@ -280,17 +223,10 @@
|
|
280
223
|
}
|
281
224
|
};
|
282
225
|
/**
|
283
|
-
* Creates preview of nodes children to render in tooltip depending if its an array or an object.
|
284
|
-
*/
|
285
|
-
/**
|
286
|
-
* Creates preview of nodes children to render in tooltip depending if its an array or an object.
|
287
|
-
* @return {?}
|
288
|
-
*/
|
289
|
-
TdJsonFormatterComponent.prototype.getPreview = /**
|
290
226
|
* Creates preview of nodes children to render in tooltip depending if its an array or an object.
|
291
227
|
* @return {?}
|
292
228
|
*/
|
293
|
-
function () {
|
229
|
+
TdJsonFormatterComponent.prototype.getPreview = function () {
|
294
230
|
var _this = this;
|
295
231
|
/** @type {?} */
|
296
232
|
var previewData;
|
@@ -301,11 +237,10 @@
|
|
301
237
|
if (this.isArray()) {
|
302
238
|
/** @type {?} */
|
303
239
|
var previewArray = this._data.slice(0, TdJsonFormatterComponent.PREVIEW_LIMIT);
|
304
|
-
previewData = previewArray.map((/**
|
240
|
+
previewData = previewArray.map(( /**
|
305
241
|
* @param {?} obj
|
306
242
|
* @return {?}
|
307
|
-
*/
|
308
|
-
function (obj) {
|
243
|
+
*/function (obj) {
|
309
244
|
return _this.getValue(obj);
|
310
245
|
}));
|
311
246
|
startChar = '[';
|
@@ -314,11 +249,10 @@
|
|
314
249
|
else {
|
315
250
|
/** @type {?} */
|
316
251
|
var previewKeys = this._children.slice(0, TdJsonFormatterComponent.PREVIEW_LIMIT);
|
317
|
-
previewData = previewKeys.map((/**
|
252
|
+
previewData = previewKeys.map(( /**
|
318
253
|
* @param {?} key
|
319
254
|
* @return {?}
|
320
|
-
*/
|
321
|
-
function (key) {
|
255
|
+
*/function (key) {
|
322
256
|
return key + ': ' + _this.getValue(_this._data[key]);
|
323
257
|
}));
|
324
258
|
}
|
@@ -335,48 +269,44 @@
|
|
335
269
|
* @private
|
336
270
|
* @return {?}
|
337
271
|
*/
|
338
|
-
TdJsonFormatterComponent.prototype.parseChildren =
|
339
|
-
* @private
|
340
|
-
* @return {?}
|
341
|
-
*/
|
342
|
-
function () {
|
272
|
+
TdJsonFormatterComponent.prototype.parseChildren = function () {
|
343
273
|
if (this.isObject()) {
|
344
274
|
this._children = Object.keys(this._data);
|
345
275
|
}
|
346
276
|
};
|
347
|
-
/**
|
348
|
-
* Max length for property names. Any names bigger than this get trunctated.
|
349
|
-
*/
|
350
|
-
TdJsonFormatterComponent.KEY_MAX_LENGTH = 30;
|
351
|
-
/**
|
352
|
-
* Max length for preview string. Any names bigger than this get trunctated.
|
353
|
-
*/
|
354
|
-
TdJsonFormatterComponent.PREVIEW_STRING_MAX_LENGTH = 80;
|
355
|
-
/**
|
356
|
-
* Max tooltip preview elements.
|
357
|
-
*/
|
358
|
-
TdJsonFormatterComponent.PREVIEW_LIMIT = 5;
|
359
|
-
TdJsonFormatterComponent.decorators = [
|
360
|
-
{ type: core.Component, args: [{
|
361
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
362
|
-
selector: 'td-json-formatter',
|
363
|
-
template: "<div class=\"td-json-formatter-wrapper\">\n <a\n class=\"td-key\"\n [class.td-key-node]=\"hasChildren()\"\n [class.td-key-leaf]=\"!hasChildren()\"\n [tabIndex]=\"isObject() ? 0 : -1\"\n (keydown.enter)=\"toggle()\"\n (click)=\"toggle()\"\n >\n <mat-icon class=\"td-node-icon\" *ngIf=\"hasChildren()\">\n {{ open ? 'keyboard_arrow_down' : isRTL ? 'keyboard_arrow_left' : 'keyboard_arrow_right' }}\n </mat-icon>\n <span *ngIf=\"key\" class=\"key\">{{ key }}:</span>\n <span class=\"value\">\n <span [class.td-empty]=\"!hasChildren()\" *ngIf=\"isObject()\" [matTooltip]=\"getPreview()\" matTooltipPosition=\"after\">\n <span class=\"td-object-name\">{{ getObjectName() }}</span>\n <span class=\"td-array-length\" *ngIf=\"isArray()\">[{{ data.length }}]</span>\n </span>\n <span *ngIf=\"!isObject()\" [class]=\"getType(data)\">{{ getValue(data) }}</span>\n </span>\n </a>\n <div class=\"td-object-children\" [@tdCollapse]=\"!(hasChildren() && open)\">\n <ng-template let-key ngFor [ngForOf]=\"children\">\n <td-json-formatter [key]=\"key\" [data]=\"data[key]\" [levelsOpen]=\"levelsOpen - 1\"></td-json-formatter>\n </ng-template>\n </div>\n</div>\n",
|
364
|
-
animations: [common$1.tdCollapseAnimation],
|
365
|
-
styles: [":host{display:block}.td-json-formatter-wrapper{padding-top:2px;padding-bottom:2px}.td-json-formatter-wrapper .td-key{box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:start;align-items:flex-start;-ms-flex-line-pack:center;align-content:center;max-width:100%;-ms-flex-pack:start;justify-content:flex-start}.td-json-formatter-wrapper .td-key.td-key-node:hover{cursor:pointer}.td-json-formatter-wrapper .td-object-children.ng-animating{overflow:hidden}.td-json-formatter-wrapper .td-object-children .td-key,.td-json-formatter-wrapper .td-object-children .td-object-children{padding-left:24px}::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-key,::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-object-children{padding-right:24px;padding-left:0}.td-json-formatter-wrapper .td-object-children .td-key.td-key-leaf,.td-json-formatter-wrapper .td-object-children .td-object-children.td-key-leaf{padding-left:48px}::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-key.td-key-leaf,::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-object-children.td-key-leaf{padding-right:48px;padding-left:0}.td-json-formatter-wrapper .value{margin-left:5px}::ng-deep [dir=rtl] .td-json-formatter-wrapper .value{padding-right:5px;padding-left:0}.td-json-formatter-wrapper .value .td-empty{opacity:.5;text-decoration:line-through}.td-json-formatter-wrapper .value .date,.td-json-formatter-wrapper .value .string{word-break:break-word}"]
|
366
|
-
}] }
|
367
|
-
];
|
368
|
-
/** @nocollapse */
|
369
|
-
TdJsonFormatterComponent.ctorParameters = function () { return [
|
370
|
-
{ type: core.ChangeDetectorRef },
|
371
|
-
{ type: bidi.Dir, decorators: [{ type: core.Optional }] }
|
372
|
-
]; };
|
373
|
-
TdJsonFormatterComponent.propDecorators = {
|
374
|
-
levelsOpen: [{ type: core.Input, args: ['levelsOpen',] }],
|
375
|
-
key: [{ type: core.Input, args: ['key',] }],
|
376
|
-
data: [{ type: core.Input, args: ['data',] }]
|
377
|
-
};
|
378
277
|
return TdJsonFormatterComponent;
|
379
278
|
}());
|
279
|
+
/**
|
280
|
+
* Max length for property names. Any names bigger than this get trunctated.
|
281
|
+
*/
|
282
|
+
TdJsonFormatterComponent.KEY_MAX_LENGTH = 30;
|
283
|
+
/**
|
284
|
+
* Max length for preview string. Any names bigger than this get trunctated.
|
285
|
+
*/
|
286
|
+
TdJsonFormatterComponent.PREVIEW_STRING_MAX_LENGTH = 80;
|
287
|
+
/**
|
288
|
+
* Max tooltip preview elements.
|
289
|
+
*/
|
290
|
+
TdJsonFormatterComponent.PREVIEW_LIMIT = 5;
|
291
|
+
TdJsonFormatterComponent.decorators = [
|
292
|
+
{ type: core.Component, args: [{
|
293
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
294
|
+
selector: 'td-json-formatter',
|
295
|
+
template: "<div class=\"td-json-formatter-wrapper\">\n <a\n class=\"td-key\"\n [class.td-key-node]=\"hasChildren()\"\n [class.td-key-leaf]=\"!hasChildren()\"\n [tabIndex]=\"isObject() ? 0 : -1\"\n (keydown.enter)=\"toggle()\"\n (click)=\"toggle()\"\n >\n <mat-icon class=\"td-node-icon\" *ngIf=\"hasChildren()\">\n {{ open ? 'keyboard_arrow_down' : isRTL ? 'keyboard_arrow_left' : 'keyboard_arrow_right' }}\n </mat-icon>\n <span *ngIf=\"key\" class=\"key\">{{ key }}:</span>\n <span class=\"value\">\n <span [class.td-empty]=\"!hasChildren()\" *ngIf=\"isObject()\" [matTooltip]=\"getPreview()\" matTooltipPosition=\"after\">\n <span class=\"td-object-name\">{{ getObjectName() }}</span>\n <span class=\"td-array-length\" *ngIf=\"isArray()\">[{{ data.length }}]</span>\n </span>\n <span *ngIf=\"!isObject()\" [class]=\"getType(data)\">{{ getValue(data) }}</span>\n </span>\n </a>\n <div class=\"td-object-children\" [@tdCollapse]=\"!(hasChildren() && open)\">\n <ng-template let-key ngFor [ngForOf]=\"children\">\n <td-json-formatter [key]=\"key\" [data]=\"data[key]\" [levelsOpen]=\"levelsOpen - 1\"></td-json-formatter>\n </ng-template>\n </div>\n</div>\n",
|
296
|
+
animations: [common.tdCollapseAnimation],
|
297
|
+
styles: [":host{display:block}.td-json-formatter-wrapper{padding-bottom:2px;padding-top:2px}.td-json-formatter-wrapper .td-key{-ms-flex-align:start;-ms-flex-direction:row;-ms-flex-line-pack:center;-ms-flex-pack:start;align-content:center;align-items:flex-start;box-sizing:border-box;display:-ms-flexbox;display:flex;flex-direction:row;justify-content:flex-start;max-width:100%}.td-json-formatter-wrapper .td-key.td-key-node:hover{cursor:pointer}.td-json-formatter-wrapper .td-object-children.ng-animating{overflow:hidden}.td-json-formatter-wrapper .td-object-children .td-key,.td-json-formatter-wrapper .td-object-children .td-object-children{padding-left:24px}::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-key,::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-object-children{padding-left:0;padding-right:24px}.td-json-formatter-wrapper .td-object-children .td-key.td-key-leaf,.td-json-formatter-wrapper .td-object-children .td-object-children.td-key-leaf{padding-left:48px}::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-key.td-key-leaf,::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-object-children.td-key-leaf{padding-left:0;padding-right:48px}.td-json-formatter-wrapper .value{margin-left:5px}::ng-deep [dir=rtl] .td-json-formatter-wrapper .value{padding-left:0;padding-right:5px}.td-json-formatter-wrapper .value .td-empty{opacity:.5;text-decoration:line-through}.td-json-formatter-wrapper .value .date,.td-json-formatter-wrapper .value .string{word-break:break-word}"]
|
298
|
+
}] }
|
299
|
+
];
|
300
|
+
/** @nocollapse */
|
301
|
+
TdJsonFormatterComponent.ctorParameters = function () { return [
|
302
|
+
{ type: core.ChangeDetectorRef },
|
303
|
+
{ type: bidi.Dir, decorators: [{ type: core.Optional }] }
|
304
|
+
]; };
|
305
|
+
TdJsonFormatterComponent.propDecorators = {
|
306
|
+
levelsOpen: [{ type: core.Input, args: ['levelsOpen',] }],
|
307
|
+
key: [{ type: core.Input, args: ['key',] }],
|
308
|
+
data: [{ type: core.Input, args: ['data',] }]
|
309
|
+
};
|
380
310
|
if (false) {
|
381
311
|
/**
|
382
312
|
* Max length for property names. Any names bigger than this get trunctated.
|
@@ -435,20 +365,39 @@
|
|
435
365
|
|
436
366
|
/**
|
437
367
|
* @fileoverview added by tsickle
|
438
|
-
*
|
368
|
+
* Generated from: json-formatter.module.ts
|
369
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
439
370
|
*/
|
440
371
|
var CovalentJsonFormatterModule = /** @class */ (function () {
|
441
372
|
function CovalentJsonFormatterModule() {
|
442
373
|
}
|
443
|
-
CovalentJsonFormatterModule.decorators = [
|
444
|
-
{ type: core.NgModule, args: [{
|
445
|
-
imports: [common.CommonModule, tooltip.MatTooltipModule, icon.MatIconModule],
|
446
|
-
declarations: [TdJsonFormatterComponent],
|
447
|
-
exports: [TdJsonFormatterComponent],
|
448
|
-
},] }
|
449
|
-
];
|
450
374
|
return CovalentJsonFormatterModule;
|
451
375
|
}());
|
376
|
+
CovalentJsonFormatterModule.decorators = [
|
377
|
+
{ type: core.NgModule, args: [{
|
378
|
+
imports: [common$1.CommonModule, tooltip.MatTooltipModule, icon.MatIconModule],
|
379
|
+
declarations: [TdJsonFormatterComponent],
|
380
|
+
exports: [TdJsonFormatterComponent],
|
381
|
+
},] }
|
382
|
+
];
|
383
|
+
|
384
|
+
/**
|
385
|
+
* @fileoverview added by tsickle
|
386
|
+
* Generated from: public-api.ts
|
387
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
388
|
+
*/
|
389
|
+
|
390
|
+
/**
|
391
|
+
* @fileoverview added by tsickle
|
392
|
+
* Generated from: index.ts
|
393
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
394
|
+
*/
|
395
|
+
|
396
|
+
/**
|
397
|
+
* @fileoverview added by tsickle
|
398
|
+
* Generated from: covalent-core-json-formatter.ts
|
399
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
400
|
+
*/
|
452
401
|
|
453
402
|
exports.CovalentJsonFormatterModule = CovalentJsonFormatterModule;
|
454
403
|
exports.TdJsonFormatterComponent = TdJsonFormatterComponent;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"covalent-core-json-formatter.umd.js","sources":["ng://@covalent/core/json-formatter/json-formatter.component.ts","ng://@covalent/core/json-formatter/json-formatter.module.ts"],"sourcesContent":["import { Component, Input, ChangeDetectionStrategy, ChangeDetectorRef, Optional } from '@angular/core';\nimport { Dir } from '@angular/cdk/bidi';\nimport { tdCollapseAnimation } from '@covalent/core/common';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'td-json-formatter',\n styleUrls: ['./json-formatter.component.scss'],\n templateUrl: './json-formatter.component.html',\n animations: [tdCollapseAnimation],\n})\nexport class TdJsonFormatterComponent {\n /**\n * Max length for property names. Any names bigger than this get trunctated.\n */\n private static KEY_MAX_LENGTH: number = 30;\n\n /**\n * Max length for preview string. Any names bigger than this get trunctated.\n */\n private static PREVIEW_STRING_MAX_LENGTH: number = 80;\n\n /**\n * Max tooltip preview elements.\n */\n private static PREVIEW_LIMIT: number = 5;\n\n private _key: string;\n private _data: any;\n private _children: string[];\n private _open: boolean = false;\n private _levelsOpen: number = 0;\n\n /**\n * levelsOpen?: number\n * Levels opened by default when JS object is formatted and rendered.\n */\n @Input('levelsOpen')\n set levelsOpen(levelsOpen: number) {\n if (!Number.isInteger(levelsOpen)) {\n throw new Error('[levelsOpen] needs to be an integer.');\n }\n this._levelsOpen = levelsOpen;\n this._open = levelsOpen > 0;\n }\n get levelsOpen(): number {\n return this._levelsOpen;\n }\n\n get open(): boolean {\n return this._open;\n }\n\n /**\n * key?: string\n * Tag to be displayed next to formatted object.\n */\n @Input('key')\n set key(key: string) {\n this._key = key;\n }\n get key(): string {\n const elipsis: string = this._key && this._key.length > TdJsonFormatterComponent.KEY_MAX_LENGTH ? 'â¦' : '';\n return this._key ? this._key.substring(0, TdJsonFormatterComponent.KEY_MAX_LENGTH) + elipsis : this._key;\n }\n\n /**\n * data: any\n * JS object to be formatted.\n */\n @Input('data')\n set data(data: any) {\n this._data = data;\n this.parseChildren();\n }\n get data(): any {\n return this._data;\n }\n\n get children(): string[] {\n return this._children;\n }\n\n get isRTL(): boolean {\n if (this._dir) {\n return this._dir.dir === 'rtl';\n }\n return false;\n }\n\n constructor(private _changeDetectorRef: ChangeDetectorRef, @Optional() private _dir: Dir) {}\n\n /**\n * Refreshes json-formatter and rerenders [data]\n */\n refresh(): void {\n this._changeDetectorRef.markForCheck();\n }\n\n /**\n * Toggles collapse/expanded state of component.\n */\n toggle(): void {\n this._open = !this._open;\n }\n\n isObject(): boolean {\n return this.getType(this._data) === 'object';\n }\n\n isArray(): boolean {\n return Array.isArray(this._data);\n }\n\n hasChildren(): boolean {\n return this._children && this._children.length > 0;\n }\n\n /**\n * Gets parsed value depending on value type.\n */\n getValue(value: any): string {\n const type: string = this.getType(value);\n if (type === 'undefined' || type === 'null') {\n return type;\n } else if (type === 'date') {\n value = new Date(value).toString();\n } else if (type === 'string') {\n value = '\"' + value + '\"';\n } else if (type === 'function') {\n // Remove content of the function\n return (\n value\n .toString()\n .replace(/[\\r\\n]/g, '')\n .replace(/\\{.*\\}/, '') + '{â¦}'\n );\n } else if (Array.isArray(value)) {\n return this.getObjectName() + ' [' + value.length + ']';\n }\n return value;\n }\n\n /**\n * Gets type of object.\n * returns 'null' if object is null and 'date' if value is object and can be parsed to a date.\n */\n getType(object: any): string {\n if (typeof object === 'object') {\n if (!object) {\n return 'null';\n }\n if (Array.isArray(object)) {\n return 'object';\n }\n const date: Date = new Date(object);\n if (Object.prototype.toString.call(date) === '[object Date]' && !Number.isNaN(date.getTime())) {\n return 'date';\n }\n }\n return typeof object;\n }\n\n /**\n * Generates string representation depending if its an object or function.\n * see: http://stackoverflow.com/a/332429\n */\n getObjectName(): string {\n const object: any = this._data;\n if (this.isObject() && !object.constructor) {\n return 'Object';\n }\n const funcNameRegex: RegExp = /function (.{1,})\\(/;\n const results: RegExpExecArray = funcNameRegex.exec(object.constructor.toString());\n if (results && results.length > 1) {\n return results[1];\n } else {\n return '';\n }\n }\n\n /**\n * Creates preview of nodes children to render in tooltip depending if its an array or an object.\n */\n getPreview(): string {\n let previewData: string[];\n let startChar: string = '{ ';\n let endChar: string = ' }';\n if (this.isArray()) {\n const previewArray: any[] = this._data.slice(0, TdJsonFormatterComponent.PREVIEW_LIMIT);\n previewData = previewArray.map((obj: any) => {\n return this.getValue(obj);\n });\n startChar = '[';\n endChar = ']';\n } else {\n const previewKeys: string[] = this._children.slice(0, TdJsonFormatterComponent.PREVIEW_LIMIT);\n previewData = previewKeys.map((key: string) => {\n return key + ': ' + this.getValue(this._data[key]);\n });\n }\n const previewString: string = previewData.join(', ');\n const ellipsis: string =\n previewData.length >= TdJsonFormatterComponent.PREVIEW_LIMIT ||\n previewString.length > TdJsonFormatterComponent.PREVIEW_STRING_MAX_LENGTH\n ? 'â¦'\n : '';\n return (\n startChar + previewString.substring(0, TdJsonFormatterComponent.PREVIEW_STRING_MAX_LENGTH) + ellipsis + endChar\n );\n }\n\n private parseChildren(): void {\n if (this.isObject()) {\n this._children = Object.keys(this._data);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { TdJsonFormatterComponent } from './json-formatter.component';\n\n@NgModule({\n imports: [CommonModule, MatTooltipModule, MatIconModule],\n declarations: [TdJsonFormatterComponent],\n exports: [TdJsonFormatterComponent],\n})\nexport class CovalentJsonFormatterModule {}\n"],"names":["Component","ChangeDetectionStrategy","tdCollapseAnimation","ChangeDetectorRef","Dir","Optional","Input","NgModule","CommonModule","MatTooltipModule","MatIconModule"],"mappings":";;;;;;;;;;;QA0FE,kCAAoB,kBAAqC,EAAsB,IAAS;YAApE,uBAAkB,GAAlB,kBAAkB,CAAmB;YAAsB,SAAI,GAAJ,IAAI,CAAK;YA5DhF,UAAK,GAAY,KAAK,CAAC;YACvB,gBAAW,GAAW,CAAC,CAAC;SA2D4D;QArD5F,sBACI,gDAAU;;;;YAOd;gBACE,OAAO,IAAI,CAAC,WAAW,CAAC;aACzB;;;;;;;;;;;YAVD,UACe,UAAkB;gBAC/B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE;oBACjC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;iBACzD;gBACD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;gBAC9B,IAAI,CAAC,KAAK,GAAG,UAAU,GAAG,CAAC,CAAC;aAC7B;;;WAAA;QAKD,sBAAI,0CAAI;;;;YAAR;gBACE,OAAO,IAAI,CAAC,KAAK,CAAC;aACnB;;;WAAA;QAMD,sBACI,yCAAG;;;;YAGP;;oBACQ,OAAO,GA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QA2DpB,sDAA6C;;;;;QAAE,wCAA6B;;;;;;;;QClF1F;SAK2C;;oBAL1CC,aAAQ,SAAC;wBACR,OAAO,EAAE,CAACC,mBAAY,EAAEC,wBAAgB,EAAEC,kBAAa,CAAC;wBACxD,YAAY,EAAE,CAAC,wBAAwB,CAAC;wBACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;qBACpC;;QACyC,kCAAC;KAL3C;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"covalent-core-json-formatter.umd.js","sources":["../../../../src/platform/core/json-formatter/json-formatter.component.ts","../../../../src/platform/core/json-formatter/json-formatter.module.ts"],"sourcesContent":["import { Component, Input, ChangeDetectionStrategy, ChangeDetectorRef, Optional } from '@angular/core';\nimport { Dir } from '@angular/cdk/bidi';\nimport { tdCollapseAnimation } from '@covalent/core/common';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'td-json-formatter',\n styleUrls: ['./json-formatter.component.scss'],\n templateUrl: './json-formatter.component.html',\n animations: [tdCollapseAnimation],\n})\nexport class TdJsonFormatterComponent {\n /**\n * Max length for property names. Any names bigger than this get trunctated.\n */\n private static KEY_MAX_LENGTH: number = 30;\n\n /**\n * Max length for preview string. Any names bigger than this get trunctated.\n */\n private static PREVIEW_STRING_MAX_LENGTH: number = 80;\n\n /**\n * Max tooltip preview elements.\n */\n private static PREVIEW_LIMIT: number = 5;\n\n private _key: string;\n private _data: any;\n private _children: string[];\n private _open: boolean = false;\n private _levelsOpen: number = 0;\n\n /**\n * levelsOpen?: number\n * Levels opened by default when JS object is formatted and rendered.\n */\n @Input('levelsOpen')\n set levelsOpen(levelsOpen: number) {\n if (!Number.isInteger(levelsOpen)) {\n throw new Error('[levelsOpen] needs to be an integer.');\n }\n this._levelsOpen = levelsOpen;\n this._open = levelsOpen > 0;\n }\n get levelsOpen(): number {\n return this._levelsOpen;\n }\n\n get open(): boolean {\n return this._open;\n }\n\n /**\n * key?: string\n * Tag to be displayed next to formatted object.\n */\n @Input('key')\n set key(key: string) {\n this._key = key;\n }\n get key(): string {\n const elipsis: string = this._key && this._key.length > TdJsonFormatterComponent.KEY_MAX_LENGTH ? '…' : '';\n return this._key ? this._key.substring(0, TdJsonFormatterComponent.KEY_MAX_LENGTH) + elipsis : this._key;\n }\n\n /**\n * data: any\n * JS object to be formatted.\n */\n @Input('data')\n set data(data: any) {\n this._data = data;\n this.parseChildren();\n }\n get data(): any {\n return this._data;\n }\n\n get children(): string[] {\n return this._children;\n }\n\n get isRTL(): boolean {\n if (this._dir) {\n return this._dir.dir === 'rtl';\n }\n return false;\n }\n\n constructor(private _changeDetectorRef: ChangeDetectorRef, @Optional() private _dir: Dir) {}\n\n /**\n * Refreshes json-formatter and rerenders [data]\n */\n refresh(): void {\n this._changeDetectorRef.markForCheck();\n }\n\n /**\n * Toggles collapse/expanded state of component.\n */\n toggle(): void {\n this._open = !this._open;\n }\n\n isObject(): boolean {\n return this.getType(this._data) === 'object';\n }\n\n isArray(): boolean {\n return Array.isArray(this._data);\n }\n\n hasChildren(): boolean {\n return this._children && this._children.length > 0;\n }\n\n /**\n * Gets parsed value depending on value type.\n */\n getValue(value: any): string {\n const type: string = this.getType(value);\n if (type === 'undefined' || type === 'null') {\n return type;\n } else if (type === 'date') {\n value = new Date(value).toString();\n } else if (type === 'string') {\n value = '\"' + value + '\"';\n } else if (type === 'function') {\n // Remove content of the function\n return (\n value\n .toString()\n .replace(/[\\r\\n]/g, '')\n .replace(/\\{.*\\}/, '') + '{…}'\n );\n } else if (Array.isArray(value)) {\n return this.getObjectName() + ' [' + value.length + ']';\n }\n return value;\n }\n\n /**\n * Gets type of object.\n * returns 'null' if object is null and 'date' if value is object and can be parsed to a date.\n */\n getType(object: any): string {\n if (typeof object === 'object') {\n if (!object) {\n return 'null';\n }\n if (Array.isArray(object)) {\n return 'object';\n }\n const date: Date = new Date(object);\n if (Object.prototype.toString.call(date) === '[object Date]' && !Number.isNaN(date.getTime())) {\n return 'date';\n }\n }\n return typeof object;\n }\n\n /**\n * Generates string representation depending if its an object or function.\n * see: http://stackoverflow.com/a/332429\n */\n getObjectName(): string {\n const object: any = this._data;\n if (this.isObject() && !object.constructor) {\n return 'Object';\n }\n const funcNameRegex: RegExp = /function (.{1,})\\(/;\n const results: RegExpExecArray = funcNameRegex.exec(object.constructor.toString());\n if (results && results.length > 1) {\n return results[1];\n } else {\n return '';\n }\n }\n\n /**\n * Creates preview of nodes children to render in tooltip depending if its an array or an object.\n */\n getPreview(): string {\n let previewData: string[];\n let startChar: string = '{ ';\n let endChar: string = ' }';\n if (this.isArray()) {\n const previewArray: any[] = this._data.slice(0, TdJsonFormatterComponent.PREVIEW_LIMIT);\n previewData = previewArray.map((obj: any) => {\n return this.getValue(obj);\n });\n startChar = '[';\n endChar = ']';\n } else {\n const previewKeys: string[] = this._children.slice(0, TdJsonFormatterComponent.PREVIEW_LIMIT);\n previewData = previewKeys.map((key: string) => {\n return key + ': ' + this.getValue(this._data[key]);\n });\n }\n const previewString: string = previewData.join(', ');\n const ellipsis: string =\n previewData.length >= TdJsonFormatterComponent.PREVIEW_LIMIT ||\n previewString.length > TdJsonFormatterComponent.PREVIEW_STRING_MAX_LENGTH\n ? '…'\n : '';\n return (\n startChar + previewString.substring(0, TdJsonFormatterComponent.PREVIEW_STRING_MAX_LENGTH) + ellipsis + endChar\n );\n }\n\n private parseChildren(): void {\n if (this.isObject()) {\n this._children = Object.keys(this._data);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { TdJsonFormatterComponent } from './json-formatter.component';\n\n@NgModule({\n imports: [CommonModule, MatTooltipModule, MatIconModule],\n declarations: [TdJsonFormatterComponent],\n exports: [TdJsonFormatterComponent],\n})\nexport class CovalentJsonFormatterModule {}\n"],"names":["Component","ChangeDetectionStrategy","tdCollapseAnimation","ChangeDetectorRef","Dir","Optional","Input","NgModule","Comm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CAAC;aAC1C;SACF;;;;;;IAzMc,uCAAc,GAAW,EAAE,CAAC;;;;IAK5B,kDAAyB,GAAW,EAAE,CAAC;;;;IAKvC,sCAAa,GAAW,CAAC,CAAC;;gBArB1CA,cAAS,SAAC;oBACT,eAAe,EAAEC,4BAAuB,CAAC,MAAM;oBAC/C,QAAQ,EAAE,mBAAmB;oBAE7B,wtCAA8C;oBAC9C,UAAU,EAAE,CAACC,0BAAmB,CAAC;;iBAClC;;;;gBAVmDC,sBAAiB;gBAC5DC,QAAG,uBAyFkDC,aAAQ;;;6BArDnEC,UAAK,SAAC,YAAY;sBAoBlBA,UAAK,SAAC,KAAK;uBAaXA,UAAK,SAAC,MAAM;;;;;;;;QAvDb,wCAA2C;;;;;;QAK3C,mDAAsD;;;;;;QAKtD,uCAAyC;;;;;QAEzC,wCAAqB;;;;;QACrB,yCAAmB;;;;;QACnB,6CAA4B;;;;;QAC5B,yCAA+B;;;;;QAC/B,+CAAgC;;;;;QA2DpB,sDAA6C;;;;;QAAE,wCAA6B;;;;;;;;;QC7E1F;;;;;gBALCC,aAAQ,SAAC;oBACR,OAAO,EAAE,CAACC,qBAAY,EAAEC,wBAAgB,EAAEC,kBAAa,CAAC;oBACxD,YAAY,EAAE,CAAC,wBAAwB,CAAC;oBACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;iBACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/material/tooltip"),require("@angular/material/icon"),require("@angular/cdk/bidi"),require("@covalent/core/common")):"function"==typeof define&&define.amd?define("@covalent/core/json-formatter",["exports","@angular/core","@angular/common","@angular/material/tooltip","@angular/material/icon","@angular/cdk/bidi","@covalent/core/common"],t):t(((e=e||self).covalent=e.covalent||{},e.covalent.core=e.covalent.core||{},e.covalent.core["json-formatter"]={}),e.ng.core,e.ng.common,e.ng.material.tooltip,e.ng.material.icon,e.ng.cdk.bidi,e.covalent.core.common)}(this,(function(e,t,r,n,o,a,i){"use strict";var d=function(){function e(e,t){this._changeDetectorRef=e,this._dir=t,this._open=!1,this._levelsOpen=0}return Object.defineProperty(e.prototype,"levelsOpen",{get:function(){return this._levelsOpen},set:function(e){if(!Number.isInteger(e))throw new Error("[levelsOpen] needs to be an integer.");this._levelsOpen=e,this._open=e>0},enumerable:!
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/material/tooltip"),require("@angular/material/icon"),require("@angular/cdk/bidi"),require("@covalent/core/common")):"function"==typeof define&&define.amd?define("@covalent/core/json-formatter",["exports","@angular/core","@angular/common","@angular/material/tooltip","@angular/material/icon","@angular/cdk/bidi","@covalent/core/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).covalent=e.covalent||{},e.covalent.core=e.covalent.core||{},e.covalent.core["json-formatter"]={}),e.ng.core,e.ng.common,e.ng.material.tooltip,e.ng.material.icon,e.ng.cdk.bidi,e.covalent.core.common)}(this,(function(e,t,r,n,o,a,i){"use strict";var d=function(){function e(e,t){this._changeDetectorRef=e,this._dir=t,this._open=!1,this._levelsOpen=0}return Object.defineProperty(e.prototype,"levelsOpen",{get:function(){return this._levelsOpen},set:function(e){if(!Number.isInteger(e))throw new Error("[levelsOpen] needs to be an integer.");this._levelsOpen=e,this._open=e>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"open",{get:function(){return this._open},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){var t=this._key&&this._key.length>e.KEY_MAX_LENGTH?"…":"";return this._key?this._key.substring(0,e.KEY_MAX_LENGTH)+t:this._key},set:function(e){this._key=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e,this.parseChildren()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRTL",{get:function(){return!!this._dir&&"rtl"===this._dir.dir},enumerable:!1,configurable:!0}),e.prototype.refresh=function(){this._changeDetectorRef.markForCheck()},e.prototype.toggle=function(){this._open=!this._open},e.prototype.isObject=function(){return"object"===this.getType(this._data)},e.prototype.isArray=function(){return Array.isArray(this._data)},e.prototype.hasChildren=function(){return this._children&&this._children.length>0},e.prototype.getValue=function(e){var t=this.getType(e);if("undefined"===t||"null"===t)return t;if("date"===t)e=new Date(e).toString();else if("string"===t)e='"'+e+'"';else{if("function"===t)return e.toString().replace(/[\r\n]/g,"").replace(/\{.*\}/,"")+"{…}";if(Array.isArray(e))return this.getObjectName()+" ["+e.length+"]"}return e},e.prototype.getType=function(e){if("object"==typeof e){if(!e)return"null";if(Array.isArray(e))return"object";var t=new Date(e);if("[object Date]"===Object.prototype.toString.call(t)&&!Number.isNaN(t.getTime()))return"date"}return typeof e},e.prototype.getObjectName=function(){var e=this._data;if(this.isObject()&&!e.constructor)return"Object";var t=/function (.{1,})\(/.exec(e.constructor.toString());return t&&t.length>1?t[1]:""},e.prototype.getPreview=function(){var t,r=this,n="{ ",o=" }";this.isArray()?(t=this._data.slice(0,e.PREVIEW_LIMIT).map((function(e){return r.getValue(e)})),n="[",o="]"):t=this._children.slice(0,e.PREVIEW_LIMIT).map((function(e){return e+": "+r.getValue(r._data[e])}));var a=t.join(", "),i=t.length>=e.PREVIEW_LIMIT||a.length>e.PREVIEW_STRING_MAX_LENGTH?"…":"";return n+a.substring(0,e.PREVIEW_STRING_MAX_LENGTH)+i+o},e.prototype.parseChildren=function(){this.isObject()&&(this._children=Object.keys(this._data))},e}();d.KEY_MAX_LENGTH=30,d.PREVIEW_STRING_MAX_LENGTH=80,d.PREVIEW_LIMIT=5,d.decorators=[{type:t.Component,args:[{changeDetection:t.ChangeDetectionStrategy.OnPush,selector:"td-json-formatter",template:'<div class="td-json-formatter-wrapper">\n <a\n class="td-key"\n [class.td-key-node]="hasChildren()"\n [class.td-key-leaf]="!hasChildren()"\n [tabIndex]="isObject() ? 0 : -1"\n (keydown.enter)="toggle()"\n (click)="toggle()"\n >\n <mat-icon class="td-node-icon" *ngIf="hasChildren()">\n {{ open ? \'keyboard_arrow_down\' : isRTL ? \'keyboard_arrow_left\' : \'keyboard_arrow_right\' }}\n </mat-icon>\n <span *ngIf="key" class="key">{{ key }}:</span>\n <span class="value">\n <span [class.td-empty]="!hasChildren()" *ngIf="isObject()" [matTooltip]="getPreview()" matTooltipPosition="after">\n <span class="td-object-name">{{ getObjectName() }}</span>\n <span class="td-array-length" *ngIf="isArray()">[{{ data.length }}]</span>\n </span>\n <span *ngIf="!isObject()" [class]="getType(data)">{{ getValue(data) }}</span>\n </span>\n </a>\n <div class="td-object-children" [@tdCollapse]="!(hasChildren() && open)">\n <ng-template let-key ngFor [ngForOf]="children">\n <td-json-formatter [key]="key" [data]="data[key]" [levelsOpen]="levelsOpen - 1"></td-json-formatter>\n </ng-template>\n </div>\n</div>\n',animations:[i.tdCollapseAnimation],styles:[":host{display:block}.td-json-formatter-wrapper{padding-bottom:2px;padding-top:2px}.td-json-formatter-wrapper .td-key{-ms-flex-align:start;-ms-flex-direction:row;-ms-flex-line-pack:center;-ms-flex-pack:start;align-content:center;align-items:flex-start;box-sizing:border-box;display:-ms-flexbox;display:flex;flex-direction:row;justify-content:flex-start;max-width:100%}.td-json-formatter-wrapper .td-key.td-key-node:hover{cursor:pointer}.td-json-formatter-wrapper .td-object-children.ng-animating{overflow:hidden}.td-json-formatter-wrapper .td-object-children .td-key,.td-json-formatter-wrapper .td-object-children .td-object-children{padding-left:24px}::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-key,::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-object-children{padding-left:0;padding-right:24px}.td-json-formatter-wrapper .td-object-children .td-key.td-key-leaf,.td-json-formatter-wrapper .td-object-children .td-object-children.td-key-leaf{padding-left:48px}::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-key.td-key-leaf,::ng-deep [dir=rtl] .td-json-formatter-wrapper .td-object-children .td-object-children.td-key-leaf{padding-left:0;padding-right:48px}.td-json-formatter-wrapper .value{margin-left:5px}::ng-deep [dir=rtl] .td-json-formatter-wrapper .value{padding-left:0;padding-right:5px}.td-json-formatter-wrapper .value .td-empty{opacity:.5;text-decoration:line-through}.td-json-formatter-wrapper .value .date,.td-json-formatter-wrapper .value .string{word-break:break-word}"]}]}],d.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:a.Dir,decorators:[{type:t.Optional}]}]},d.propDecorators={levelsOpen:[{type:t.Input,args:["levelsOpen"]}],key:[{type:t.Input,args:["key"]}],data:[{type:t.Input,args:["data"]}]};var l=function(){};l.decorators=[{type:t.NgModule,args:[{imports:[r.CommonModule,n.MatTooltipModule,o.MatIconModule],declarations:[d],exports:[d]}]}],e.CovalentJsonFormatterModule=l,e.TdJsonFormatterComponent=d,Object.defineProperty(e,"__esModule",{value:!0})}));
|
2
2
|
//# sourceMappingURL=covalent-core-json-formatter.umd.min.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["ng://@covalent/core/json-formatter/json-formatter.component.ts","ng://@covalent/core/json-formatter/json-formatter.module.ts"],"names":["TdJsonFormatterComponent","_changeDetectorRef","_dir","this","_open","_levelsOpen","Object","defineProperty","prototype","levelsOpen","Number","isInteger","Error","elipsis","_key","length","KEY_MAX_LENGTH","substring","key","_data","data","parseChildren","_children","dir","refresh","markForCheck","toggle","isObject","getType","isArray","Array","hasChildren","getValue","value","type","Date","toString","replace","getObjectName","object","date","call","isNaN","getTime","constructor","results","exec","getPreview","previewData","_this","startChar","endChar","slice","PREVIEW_LIMIT","map","obj","previewString","join","ellipsis","PREVIEW_STRING_MAX_LENGTH","keys","Component","args","changeDetection","ChangeDetectionStrategy","OnPush","selector","template","animations","tdCollapseAnimation","ChangeDetectorRef","Dir","decorators","Optional","Input","CovalentJsonFormatterModule","Ng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,MAAM,EAAGpD,EAAyBqD,eACrDC,KAAG,SAAEpC,GAC7B,OAAOA,EAAM,KAAO+B,EAAKjB,SAASiB,EAAK9B,MAAMD,WAG3CsC,EAAwBR,EAAYS,KAAK,MACzCC,EACJV,EAAYjC,QAAUf,EAAyBqD,eAC/CG,EAAczC,OAASf,EAAyB2D,0BAC5C,IACA,GACN,OACET,EAAYM,EAAcvC,UAAU,EAAGjB,EAAyB2D,2BAA6BD,EAAWP,GAIpGnD,EAAAQ,UAAAa,cAAR,WACMlB,KAAKwB,aACPxB,KAAKmB,UAAYhB,OAAOsD,KAAKzD,KAAKgB,SAvMvBnB,EAAAgB,eAAyB,GAKzBhB,EAAA2D,0BAAoC,GAKpC3D,EAAAqD,cAAwB,sBArBxCQ,EAAAA,UAASC,KAAA,CAAC,CACTC,gBAAiBC,EAAAA,wBAAwBC,OACzCC,SAAU,oBAEVC,SAAA,+pCACAC,WAAY,CAACC,EAAAA,kmDATqCC,EAAAA,yBAC3CC,EAAAA,IAAGC,WAAA,CAAA,CAAAtC,KAyFkDuC,EAAAA,kDArD3DC,EAAAA,MAAKZ,KAAA,CAAC,2BAoBNY,EAAAA,MAAKZ,KAAA,CAAC,qBAaNY,EAAAA,MAAKZ,KAAA,CAAC,WAmJT9D,sBCjNA,SAAA2E,KAK0C,2BALzCC,EAAAA,SAAQd,KAAA,CAAC,CACRe,QAAS,CAACC,EAAAA,aAAcC,EAAAA,iBAAkBC,EAAAA,eAC1CC,aAAc,CAACjF,GACfkF,QAAS,CAAClF,OAE8B2E","sourcesContent":["import { Component, Input, ChangeDetectionStrategy, ChangeDetectorRef, Optional } from '@angular/core';\nimport { Dir } from '@angular/cdk/bidi';\nimport { tdCollapseAnimation } from '@covalent/core/common';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'td-json-formatter',\n styleUrls: ['./json-formatter.component.scss'],\n templateUrl: './json-formatter.component.html',\n animations: [tdCollapseAnimation],\n})\nexport class TdJsonFormatterComponent {\n /**\n * Max length for property names. Any names bigger than this get trunctated.\n */\n private static KEY_MAX_LENGTH: number = 30;\n\n /**\n * Max length for preview string. Any names bigger than this get trunctated.\n */\n private static PREVIEW_STRING_MAX_LENGTH: number = 80;\n\n /**\n * Max tooltip preview elements.\n */\n private static PREVIEW_LIMIT: number = 5;\n\n private _key: string;\n private _data: any;\n private _children: string[];\n private _open: boolean = false;\n private _levelsOpen: number = 0;\n\n /**\n * levelsOpen?: number\n * Levels opened by default when JS object is formatted and rendered.\n */\n @Input('levelsOpen')\n set levelsOpen(levelsOpen: number) {\n if (!Number.isInteger(levelsOpen)) {\n throw new Error('[levelsOpen] needs to be an integer.');\n }\n this._levelsOpen = levelsOpen;\n this._open = levelsOpen > 0;\n }\n get levelsOpen(): number {\n return this._levelsOpen;\n }\n\n get open(): boolean {\n return this._open;\n }\n\n /**\n * key?: string\n * Tag to be displayed next to formatted object.\n */\n @Input('key')\n set key(key: string) {\n this._key = key;\n }\n get key(): string {\n const elipsis: string = this._key && this._key.length > TdJsonFormatterComponent.KEY_MAX_LENGTH ? 'â¦' : '';\n return this._key ? this._key.substring(0, TdJsonFormatterComponent.KEY_MAX_LENGTH) + elipsis : this._key;\n }\n\n /**\n * data: any\n * JS object to be formatted.\n */\n @Input('data')\n set data(data: any) {\n this._data = data;\n this.parseChildren();\n }\n get data(): any {\n return this._data;\n }\n\n get children(): string[] {\n return this._children;\n }\n\n get isRTL(): boolean {\n if (this._dir) {\n return this._dir.dir === 'rtl';\n }\n return false;\n }\n\n constructor(private _changeDetectorRef: ChangeDetectorRef, @Optional() private _dir: Dir) {}\n\n /**\n * Refreshes json-formatter and rerenders [data]\n */\n refresh(): void {\n this._changeDetectorRef.markForCheck();\n }\n\n /**\n * Toggles collapse/expanded state of component.\n */\n toggle(): void {\n this._open = !this._open;\n }\n\n isObject(): boolean {\n return this.getType(this._data) === 'object';\n }\n\n isArray(): boolean {\n return Array.isArray(this._data);\n }\n\n hasChildren(): boolean {\n return this._children && this._children.length > 0;\n }\n\n /**\n * Gets parsed value depending on value type.\n */\n getValue(value: any): string {\n const type: string = this.getType(value);\n if (type === 'undefined' || type === 'null') {\n return type;\n } else if (type === 'date') {\n value = new Date(value).toString();\n } else if (type === 'string') {\n value = '\"' + value + '\"';\n } else if (type === 'function') {\n // Remove content of the function\n return (\n value\n .toString()\n .replace(/[\\r\\n]/g, '')\n .replace(/\\{.*\\}/, '') + '{â¦}'\n );\n } else if (Array.isArray(value)) {\n return this.getObjectName() + ' [' + value.length + ']';\n }\n return value;\n }\n\n /**\n * Gets type of object.\n * returns 'null' if object is null and 'date' if value is object and can be parsed to a date.\n */\n getType(object: any): string {\n if (typeof object === 'object') {\n if (!object) {\n return 'null';\n }\n if (Array.isArray(object)) {\n return 'object';\n }\n const date: Date = new Date(object);\n if (Object.prototype.toString.call(date) === '[object Date]' && !Number.isNaN(date.getTime())) {\n return 'date';\n }\n }\n return typeof object;\n }\n\n /**\n * Generates string representation depending if its an object or function.\n * see: http://stackoverflow.com/a/332429\n */\n getObjectName(): string {\n const object: any = this._data;\n if (this.isObject() && !object.constructor) {\n return 'Object';\n }\n const funcNameRegex: RegExp = /function (.{1,})\\(/;\n const results: RegExpExecArray = funcNameRegex.exec(object.constructor.toString());\n if (results && results.length > 1) {\n return results[1];\n } else {\n return '';\n }\n }\n\n /**\n * Creates preview of nodes children to render in tooltip depending if its an array or an object.\n */\n getPreview(): string {\n let previewData: string[];\n let startChar: string = '{ ';\n let endChar: string = ' }';\n if (this.isArray()) {\n const previewArray: any[] = this._data.slice(0, TdJsonFormatterComponent.PREVIEW_LIMIT);\n previewData = previewArray.map((obj: any) => {\n return this.getValue(obj);\n });\n startChar = '[';\n endChar = ']';\n } else {\n const previewKeys: string[] = this._children.slice(0, TdJsonFormatterComponent.PREVIEW_LIMIT);\n previewData = previewKeys.map((key: string) => {\n return key + ': ' + this.getValue(this._data[key]);\n });\n }\n const previewString: string = previewData.join(', ');\n const ellipsis: string =\n previewData.length >= TdJsonFormatterComponent.PREVIEW_LIMIT ||\n previewString.length > TdJsonFormatterComponent.PREVIEW_STRING_MAX_LENGTH\n ? 'â¦'\n : '';\n return (\n startChar + previewString.substring(0, TdJsonFormatterComponent.PREVIEW_STRING_MAX_LENGTH) + ellipsis + endChar\n );\n }\n\n private parseChildren(): void {\n if (this.isObject()) {\n this._children = Object.keys(this._data);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { TdJsonFormatterComponent } from './json-formatter.component';\n\n@NgModule({\n imports: [CommonModule, MatTooltipModule, MatIconModule],\n declarations: [TdJsonFormatterComponent],\n exports: [TdJsonFormatterComponent],\n})\nexport class CovalentJsonFormatterModule {}\n"]}
|
1
|
+
{"version":3,"sources":["../../../../src/platform/core/json-formatter/json-formatter.component.ts","../../../../src/platform/core/json-formatter/json-formatter.module.ts"],"names":["TdJsonFormatterComponent","_changeDetectorRef","_dir","this","_open","_levelsOpen","Object","defineProperty","prototype","levelsOpen","Number","isInteger","Error","elipsis","_key","length","KEY_MAX_LENGTH","substring","key","_data","data","parseChildren","_children","dir","refresh","markForCheck","toggle","isObject","getType","isArray","Array","hasChildren","getValue","value","type","Date","toString","replace","getObjectName","object","date","call","isNaN","getTime","constructor","results","exec","getPreview","previewData","_this","startChar","endChar","slice","PREVIEW_LIMIT","map","obj","previewString","join","ellipsis","PREVIEW_STRING_MAX_LENGTH","keys","Component","args","changeDetection","ChangeDetectionStrategy","OnPush","selector","template","animations","tdCollapseAnimation","ChangeDetectorRef","Dir","decorators","Optional","Input","NgModule","imports","CommonModule","MatTooltipModule","MatIconModule","declarations","exports"],"mappings":"oyBA0FE,SAAAA,EAAoBC,EAA2DC,GAA3DC,KAAAF,mBAAAA,EAA2DE,KAAAD,KAAAA,EA5DvEC,KAAAC,OAAiB,EACjBD,KAAAE,YAAsB,SAM9BC,OAAAC,eACIP,EAAAQ,UAAA,a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GACN,OACET,EAAYM,EAAcvC,UAAU,EAAGjB,EAAyB2D,2BAA6BD,EAAWP,GAIpGnD,EAAAQ,UAAAa,cAAA,WACFlB,KAAKwB,aACPxB,KAAKmB,UAAYhB,OAAOsD,KAAKzD,KAAKgB,cAvMvBnB,EAAAgB,eAAyB,GAKzBhB,EAAA2D,0BAAoC,GAKpC3D,EAAAqD,cAAwB,sBArBxCQ,EAAAA,UAASC,KAAA,CAAC,CACTC,gBAAiBC,EAAAA,wBAAwBC,OACzCC,SAAU,oBAEVC,SAAA,+pCACAC,WAAY,CAACC,EAAAA,kmDATqCC,EAAAA,yBAC3CC,EAAAA,IAAGC,WAAA,CAAA,CAAAtC,KAyFkDuC,EAAAA,kDArD3DC,EAAAA,MAAKZ,KAAA,CAAC,2BAoBNY,EAAAA,MAAKZ,KAAA,CAAC,qBAaNY,EAAAA,MAAKZ,KAAA,CAAC,iBCzDT,iCALCa,EAAAA,SAAQb,KAAA,CAAC,CACRc,QAAS,CAACC,EAAAA,aAAcC,EAAAA,iBAAkBC,EAAAA,eAC1CC,aAAc,CAAChF,GACfiF,QAAS,CAACjF","sourcesContent":["import { Component, Input, ChangeDetectionStrategy, ChangeDetectorRef, Optional } from '@angular/core';\nimport { Dir } from '@angular/cdk/bidi';\nimport { tdCollapseAnimation } from '@covalent/core/common';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'td-json-formatter',\n styleUrls: ['./json-formatter.component.scss'],\n templateUrl: './json-formatter.component.html',\n animations: [tdCollapseAnimation],\n})\nexport class TdJsonFormatterComponent {\n /**\n * Max length for property names. Any names bigger than this get trunctated.\n */\n private static KEY_MAX_LENGTH: number = 30;\n\n /**\n * Max length for preview string. Any names bigger than this get trunctated.\n */\n private static PREVIEW_STRING_MAX_LENGTH: number = 80;\n\n /**\n * Max tooltip preview elements.\n */\n private static PREVIEW_LIMIT: number = 5;\n\n private _key: string;\n private _data: any;\n private _children: string[];\n private _open: boolean = false;\n private _levelsOpen: number = 0;\n\n /**\n * levelsOpen?: number\n * Levels opened by default when JS object is formatted and rendered.\n */\n @Input('levelsOpen')\n set levelsOpen(levelsOpen: number) {\n if (!Number.isInteger(levelsOpen)) {\n throw new Error('[levelsOpen] needs to be an integer.');\n }\n this._levelsOpen = levelsOpen;\n this._open = levelsOpen > 0;\n }\n get levelsOpen(): number {\n return this._levelsOpen;\n }\n\n get open(): boolean {\n return this._open;\n }\n\n /**\n * key?: string\n * Tag to be displayed next to formatted object.\n */\n @Input('key')\n set key(key: string) {\n this._key = key;\n }\n get key(): string {\n const elipsis: string = this._key && this._key.length > TdJsonFormatterComponent.KEY_MAX_LENGTH ? '…' : '';\n return this._key ? this._key.substring(0, TdJsonFormatterComponent.KEY_MAX_LENGTH) + elipsis : this._key;\n }\n\n /**\n * data: any\n * JS object to be formatted.\n */\n @Input('data')\n set data(data: any) {\n this._data = data;\n this.parseChildren();\n }\n get data(): any {\n return this._data;\n }\n\n get children(): string[] {\n return this._children;\n }\n\n get isRTL(): boolean {\n if (this._dir) {\n return this._dir.dir === 'rtl';\n }\n return false;\n }\n\n constructor(private _changeDetectorRef: ChangeDetectorRef, @Optional() private _dir: Dir) {}\n\n /**\n * Refreshes json-formatter and rerenders [data]\n */\n refresh(): void {\n this._changeDetectorRef.markForCheck();\n }\n\n /**\n * Toggles collapse/expanded state of component.\n */\n toggle(): void {\n this._open = !this._open;\n }\n\n isObject(): boolean {\n return this.getType(this._data) === 'object';\n }\n\n isArray(): boolean {\n return Array.isArray(this._data);\n }\n\n hasChildren(): boolean {\n return this._children && this._children.length > 0;\n }\n\n /**\n * Gets parsed value depending on value type.\n */\n getValue(value: any): string {\n const type: string = this.getType(value);\n if (type === 'undefined' || type === 'null') {\n return type;\n } else if (type === 'date') {\n value = new Date(value).toString();\n } else if (type === 'string') {\n value = '\"' + value + '\"';\n } else if (type === 'function') {\n // Remove content of the function\n return (\n value\n .toString()\n .replace(/[\\r\\n]/g, '')\n .replace(/\\{.*\\}/, '') + '{…}'\n );\n } else if (Array.isArray(value)) {\n return this.getObjectName() + ' [' + value.length + ']';\n }\n return value;\n }\n\n /**\n * Gets type of object.\n * returns 'null' if object is null and 'date' if value is object and can be parsed to a date.\n */\n getType(object: any): string {\n if (typeof object === 'object') {\n if (!object) {\n return 'null';\n }\n if (Array.isArray(object)) {\n return 'object';\n }\n const date: Date = new Date(object);\n if (Object.prototype.toString.call(date) === '[object Date]' && !Number.isNaN(date.getTime())) {\n return 'date';\n }\n }\n return typeof object;\n }\n\n /**\n * Generates string representation depending if its an object or function.\n * see: http://stackoverflow.com/a/332429\n */\n getObjectName(): string {\n const object: any = this._data;\n if (this.isObject() && !object.constructor) {\n return 'Object';\n }\n const funcNameRegex: RegExp = /function (.{1,})\\(/;\n const results: RegExpExecArray = funcNameRegex.exec(object.constructor.toString());\n if (results && results.length > 1) {\n return results[1];\n } else {\n return '';\n }\n }\n\n /**\n * Creates preview of nodes children to render in tooltip depending if its an array or an object.\n */\n getPreview(): string {\n let previewData: string[];\n let startChar: string = '{ ';\n let endChar: string = ' }';\n if (this.isArray()) {\n const previewArray: any[] = this._data.slice(0, TdJsonFormatterComponent.PREVIEW_LIMIT);\n previewData = previewArray.map((obj: any) => {\n return this.getValue(obj);\n });\n startChar = '[';\n endChar = ']';\n } else {\n const previewKeys: string[] = this._children.slice(0, TdJsonFormatterComponent.PREVIEW_LIMIT);\n previewData = previewKeys.map((key: string) => {\n return key + ': ' + this.getValue(this._data[key]);\n });\n }\n const previewString: string = previewData.join(', ');\n const ellipsis: string =\n previewData.length >= TdJsonFormatterComponent.PREVIEW_LIMIT ||\n previewString.length > TdJsonFormatterComponent.PREVIEW_STRING_MAX_LENGTH\n ? '…'\n : '';\n return (\n startChar + previewString.substring(0, TdJsonFormatterComponent.PREVIEW_STRING_MAX_LENGTH) + ellipsis + endChar\n );\n }\n\n private parseChildren(): void {\n if (this.isObject()) {\n this._children = Object.keys(this._data);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { TdJsonFormatterComponent } from './json-formatter.component';\n\n@NgModule({\n imports: [CommonModule, MatTooltipModule, MatIconModule],\n declarations: [TdJsonFormatterComponent],\n exports: [TdJsonFormatterComponent],\n})\nexport class CovalentJsonFormatterModule {}\n"]}
|