@covalent/core 4.0.0-beta.4 → 4.1.0-develop.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/breadcrumbs/README.md +21 -17
- package/breadcrumbs/breadcrumb/breadcrumb.component.d.ts +3 -1
- package/breadcrumbs/breadcrumbs.component.d.ts +3 -4
- package/breadcrumbs/covalent-core-breadcrumbs.d.ts +1 -1
- package/breadcrumbs/{public-api.d.ts → public_api.d.ts} +0 -0
- package/common/README.md +3 -0
- package/common/_common-theme.scss +1 -1
- package/common/behaviors/disable-ripple.mixin.d.ts +1 -1
- package/common/behaviors/disabled.mixin.d.ts +1 -1
- package/common/covalent-core-common.d.ts +1 -1
- package/common/material-icons.css +1 -111
- package/common/material-icons.css.map +1 -1
- package/common/pipes/truncate/truncate.pipe.d.ts +1 -1
- package/common/platform.css +1 -16819
- package/common/platform.css.map +1 -1
- package/common/{public-api.d.ts → public_api.d.ts} +0 -0
- package/common/styles/_elevation.scss +7 -2
- package/common/styles/_typography-functions.scss +10 -2
- package/common/styles/_variables.scss +2 -1
- package/common/styles/core/_button.scss +35 -5
- package/common/styles/core/_card.scss +11 -6
- package/common/styles/core/_whiteframe.scss +16 -8
- package/common/styles/font/README.md +4 -2
- package/covalent-core.d.ts +1 -1
- package/dialogs/README.md +38 -30
- package/dialogs/alert-dialog/alert-dialog.component.d.ts +3 -3
- package/dialogs/confirm-dialog/confirm-dialog.component.d.ts +2 -2
- package/dialogs/covalent-core-dialogs.d.ts +1 -1
- package/dialogs/dialog.component.d.ts +4 -4
- package/dialogs/dialogs.module.d.ts +1 -1
- package/dialogs/prompt-dialog/prompt-dialog.component.d.ts +7 -6
- package/dialogs/{public-api.d.ts → public_api.d.ts} +0 -0
- package/dialogs/src/README.md +223 -0
- package/dialogs/window-dialog/window-dialog.component.d.ts +5 -5
- package/dynamic-menu/README.md +6 -6
- package/dynamic-menu/covalent-core-dynamic-menu.d.ts +1 -1
- package/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.d.ts +1 -1
- package/dynamic-menu/dynamic-menu-item/dynamic-menu-link/dynamic-menu-link.component.d.ts +1 -1
- package/dynamic-menu/dynamic-menu.component.d.ts +1 -22
- package/dynamic-menu/dynamic-menu.menu.d.ts +22 -0
- package/dynamic-menu/public_api.d.ts +1 -0
- package/esm2020/breadcrumbs/breadcrumb/breadcrumb.component.mjs +21 -37
- package/esm2020/breadcrumbs/breadcrumbs.component.mjs +25 -34
- package/esm2020/breadcrumbs/breadcrumbs.module.mjs +12 -13
- package/esm2020/breadcrumbs/covalent-core-breadcrumbs.mjs +2 -2
- package/esm2020/breadcrumbs/public_api.mjs +4 -0
- package/esm2020/common/animations/bounce/bounce.animation.mjs +1 -1
- package/esm2020/common/animations/collapse/collapse.animation.mjs +1 -1
- package/esm2020/common/animations/common/interfaces.mjs +1 -1
- package/esm2020/common/animations/fade/fadeInOut.animation.mjs +1 -1
- package/esm2020/common/animations/flash/flash.animation.mjs +1 -1
- package/esm2020/common/animations/headshake/headshake.animation.mjs +17 -5
- package/esm2020/common/animations/jello/jello.animation.mjs +29 -8
- package/esm2020/common/animations/pulse/pulse.animation.mjs +1 -1
- package/esm2020/common/animations/rotate/rotate.animation.mjs +7 -2
- package/esm2020/common/behaviors/control-value-accesor.mixin.mjs +4 -2
- package/esm2020/common/behaviors/disable-ripple.mixin.mjs +1 -1
- package/esm2020/common/behaviors/disabled.mixin.mjs +1 -1
- package/esm2020/common/common.module.mjs +14 -15
- package/esm2020/common/covalent-core-common.mjs +2 -2
- package/esm2020/common/directives/fullscreen/fullscreen.directive.mjs +41 -41
- package/esm2020/common/forms/auto-trim/auto-trim.directive.mjs +19 -19
- package/esm2020/common/forms/validators/validators.mjs +6 -6
- package/esm2020/common/functions/clipboard.mjs +1 -1
- package/esm2020/common/functions/convert.mjs +1 -1
- package/esm2020/common/functions/download.mjs +1 -1
- package/esm2020/common/functions/file.mjs +1 -1
- package/esm2020/common/pipes/bytes/bytes.pipe.mjs +21 -11
- package/esm2020/common/pipes/decimal-bytes/decimal-bytes.pipe.mjs +21 -11
- package/esm2020/common/pipes/digits/digits.pipe.mjs +13 -13
- package/esm2020/common/pipes/time-ago/time-ago.pipe.mjs +9 -9
- package/esm2020/common/pipes/time-difference/time-difference.pipe.mjs +9 -9
- package/esm2020/common/pipes/time-until/time-until.pipe.mjs +9 -9
- package/esm2020/common/pipes/truncate/truncate.pipe.mjs +10 -10
- package/esm2020/common/public_api.mjs +39 -0
- package/esm2020/common/services/icon.service.mjs +6 -6
- package/esm2020/common/services/router-path.service.mjs +6 -6
- package/esm2020/covalent-core.mjs +2 -2
- package/esm2020/dialogs/alert-dialog/alert-dialog.component.mjs +9 -40
- package/esm2020/dialogs/confirm-dialog/confirm-dialog.component.mjs +9 -49
- package/esm2020/dialogs/covalent-core-dialogs.mjs +2 -2
- package/esm2020/dialogs/dialog.component.mjs +35 -76
- package/esm2020/dialogs/dialogs.module.mjs +39 -36
- package/esm2020/dialogs/prompt-dialog/prompt-dialog.component.mjs +24 -79
- package/esm2020/dialogs/public_api.mjs +9 -0
- package/esm2020/dialogs/resizable-draggable-dialog/resizable-draggable-dialog.mjs +27 -10
- package/esm2020/dialogs/services/dialog.service.mjs +16 -13
- package/esm2020/dialogs/window-dialog/window-dialog.component.mjs +24 -55
- package/esm2020/dynamic-menu/covalent-core-dynamic-menu.mjs +2 -2
- package/esm2020/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.mjs +19 -136
- package/esm2020/dynamic-menu/dynamic-menu-item/dynamic-menu-link/dynamic-menu-link.component.mjs +14 -103
- package/esm2020/dynamic-menu/dynamic-menu.component.mjs +18 -101
- package/esm2020/dynamic-menu/dynamic-menu.menu.mjs +2 -0
- package/esm2020/dynamic-menu/dynamic-menu.module.mjs +44 -19
- package/esm2020/dynamic-menu/public_api.mjs +2 -1
- package/esm2020/file/covalent-core-file.mjs +2 -2
- package/esm2020/file/directives/file-drop.directive.mjs +62 -67
- package/esm2020/file/directives/file-select.directive.mjs +32 -31
- package/esm2020/file/file-input/file-input.component.mjs +41 -68
- package/esm2020/file/file-upload/file-upload.component.mjs +76 -112
- package/esm2020/file/file.module.mjs +32 -17
- package/esm2020/file/public_api.mjs +7 -0
- package/esm2020/file/services/file.service.mjs +13 -11
- package/esm2020/json-formatter/collapse.animation.mjs +51 -0
- package/esm2020/json-formatter/covalent-core-json-formatter.mjs +2 -2
- package/esm2020/json-formatter/json-formatter.component.mjs +38 -123
- package/esm2020/json-formatter/json-formatter.module.mjs +12 -13
- package/esm2020/json-formatter/public_api.mjs +3 -0
- package/esm2020/layout/covalent-core-layout.mjs +2 -2
- package/esm2020/layout/layout-card-over/layout-card-over.component.mjs +17 -64
- package/esm2020/layout/layout-footer/layout-footer.component.mjs +9 -14
- package/esm2020/layout/layout-manage-list/layout-manage-list.component.mjs +22 -51
- package/esm2020/layout/layout-manage-list/layout-manage-list.directives.mjs +47 -53
- package/esm2020/layout/layout-nav/layout-nav.component.mjs +22 -84
- package/esm2020/layout/layout-nav-list/layout-nav-list.component.mjs +37 -124
- package/esm2020/layout/layout-nav-list/layout-nav-list.directives.mjs +47 -53
- package/esm2020/layout/layout-toggle.class.mjs +12 -15
- package/esm2020/layout/layout.component.mjs +22 -43
- package/esm2020/layout/layout.directives.mjs +48 -50
- package/esm2020/layout/layout.module.mjs +34 -35
- package/esm2020/layout/navigation-drawer/navigation-drawer.component.mjs +56 -201
- package/esm2020/layout/public_api.mjs +13 -0
- package/esm2020/menu/covalent-core-menu.mjs +2 -2
- package/esm2020/menu/menu.component.mjs +7 -18
- package/esm2020/menu/menu.module.mjs +12 -13
- package/esm2020/menu/public_api.mjs +3 -0
- package/esm2020/message/collapse.animation.mjs +51 -0
- package/esm2020/message/covalent-core-message.mjs +2 -2
- package/esm2020/message/message.component.mjs +44 -102
- package/esm2020/message/message.module.mjs +19 -15
- package/esm2020/message/public_api.mjs +3 -0
- package/esm2020/public_api.mjs +2 -0
- package/esm2020/search/covalent-core-search.mjs +2 -2
- package/esm2020/search/public_api.mjs +4 -0
- package/esm2020/search/search-box/search-box.component.mjs +97 -123
- package/esm2020/search/search-input/search-input.component.mjs +116 -153
- package/esm2020/search/search.module.mjs +28 -13
- package/esm2020/side-sheet/covalent-core-side-sheet.mjs +2 -2
- package/esm2020/side-sheet/public_api.mjs +6 -0
- package/esm2020/side-sheet/side-sheet-container.mjs +89 -57
- package/esm2020/side-sheet/side-sheet-ref.mjs +2 -2
- package/esm2020/side-sheet/side-sheet.animation.mjs +2 -2
- package/esm2020/side-sheet/side-sheet.config.mjs +1 -1
- package/esm2020/side-sheet/side-sheet.content-directives.mjs +109 -86
- package/esm2020/side-sheet/side-sheet.mjs +44 -31
- package/esm2020/side-sheet/side-sheet.module.mjs +37 -38
- package/esm2020/user-profile/covalent-core-user-profile.mjs +2 -2
- package/esm2020/user-profile/public_api.mjs +1 -1
- package/esm2020/user-profile/user-profile-menu/user-profile-menu.component.mjs +13 -64
- package/esm2020/user-profile/user-profile.component.mjs +13 -35
- package/esm2020/user-profile/user-profile.module.mjs +32 -14
- package/fesm2015/covalent-core-breadcrumbs.mjs +40 -85
- package/fesm2015/covalent-core-breadcrumbs.mjs.map +1 -1
- package/fesm2015/covalent-core-common.mjs +170 -140
- package/fesm2015/covalent-core-common.mjs.map +1 -1
- package/fesm2015/covalent-core-dialogs.mjs +133 -363
- package/fesm2015/covalent-core-dialogs.mjs.map +1 -1
- package/fesm2015/covalent-core-dynamic-menu.mjs +73 -425
- package/fesm2015/covalent-core-dynamic-menu.mjs.map +1 -1
- package/fesm2015/covalent-core-file.mjs +174 -261
- package/fesm2015/covalent-core-file.mjs.map +1 -1
- package/fesm2015/covalent-core-json-formatter.mjs +93 -148
- package/fesm2015/covalent-core-json-formatter.mjs.map +1 -1
- package/fesm2015/covalent-core-layout.mjs +194 -747
- package/fesm2015/covalent-core-layout.mjs.map +1 -1
- package/fesm2015/covalent-core-menu.mjs +10 -28
- package/fesm2015/covalent-core-menu.mjs.map +1 -1
- package/fesm2015/covalent-core-message.mjs +79 -104
- package/fesm2015/covalent-core-message.mjs.map +1 -1
- package/fesm2015/covalent-core-search.mjs +147 -227
- package/fesm2015/covalent-core-search.mjs.map +1 -1
- package/fesm2015/covalent-core-side-sheet.mjs +202 -173
- package/fesm2015/covalent-core-side-sheet.mjs.map +1 -1
- package/fesm2015/covalent-core-user-profile.mjs +38 -114
- package/fesm2015/covalent-core-user-profile.mjs.map +1 -1
- package/fesm2015/covalent-core.mjs.map +1 -1
- package/fesm2020/covalent-core-breadcrumbs.mjs +54 -80
- package/fesm2020/covalent-core-breadcrumbs.mjs.map +1 -1
- package/fesm2020/covalent-core-common.mjs +224 -165
- package/fesm2020/covalent-core-common.mjs.map +1 -1
- package/fesm2020/covalent-core-dialogs.mjs +168 -343
- package/fesm2020/covalent-core-dialogs.mjs.map +1 -1
- package/fesm2020/covalent-core-dynamic-menu.mjs +89 -354
- package/fesm2020/covalent-core-dynamic-menu.mjs.map +1 -1
- package/fesm2020/covalent-core-file.mjs +245 -292
- package/fesm2020/covalent-core-file.mjs.map +1 -1
- package/fesm2020/covalent-core-json-formatter.mjs +97 -133
- package/fesm2020/covalent-core-json-formatter.mjs.map +1 -1
- package/fesm2020/covalent-core-layout.mjs +353 -767
- package/fesm2020/covalent-core-layout.mjs.map +1 -1
- package/fesm2020/covalent-core-menu.mjs +17 -29
- package/fesm2020/covalent-core-menu.mjs.map +1 -1
- package/fesm2020/covalent-core-message.mjs +110 -114
- package/fesm2020/covalent-core-message.mjs.map +1 -1
- package/fesm2020/covalent-core-search.mjs +233 -281
- package/fesm2020/covalent-core-search.mjs.map +1 -1
- package/fesm2020/covalent-core-side-sheet.mjs +267 -200
- package/fesm2020/covalent-core-side-sheet.mjs.map +1 -1
- package/fesm2020/covalent-core-user-profile.mjs +54 -109
- package/fesm2020/covalent-core-user-profile.mjs.map +1 -1
- package/fesm2020/covalent-core.mjs.map +1 -1
- package/file/_file-theme.scss +2 -1
- package/file/covalent-core-file.d.ts +1 -1
- package/file/directives/file-drop.directive.d.ts +13 -20
- package/file/directives/file-select.directive.d.ts +2 -2
- package/file/file-input/file-input.component.d.ts +7 -7
- package/file/file-upload/file-upload.component.d.ts +16 -9
- package/file/{public-api.d.ts → public_api.d.ts} +0 -0
- package/file/{file-input → src/file-input}/README.md +46 -37
- package/file/{file-upload → src/file-upload}/README.md +36 -27
- package/json-formatter/README.md +8 -8
- package/json-formatter/collapse.animation.d.ts +24 -0
- package/json-formatter/covalent-core-json-formatter.d.ts +1 -1
- package/json-formatter/json-formatter.component.d.ts +4 -4
- package/json-formatter/{public-api.d.ts → public_api.d.ts} +0 -0
- package/layout/README.md +48 -50
- package/layout/covalent-core-layout.d.ts +1 -1
- package/layout/layout-card-over/layout-card-over.component.d.ts +3 -3
- package/layout/layout-footer/layout-footer.component.d.ts +3 -3
- package/layout/layout-manage-list/layout-manage-list.component.d.ts +4 -4
- package/layout/layout-manage-list/layout-manage-list.directives.d.ts +5 -5
- package/layout/layout-nav/layout-nav.component.d.ts +5 -5
- package/layout/layout-nav-list/layout-nav-list.component.d.ts +9 -9
- package/layout/layout-nav-list/layout-nav-list.directives.d.ts +5 -5
- package/layout/layout-toggle.class.d.ts +1 -1
- package/layout/layout.component.d.ts +4 -4
- package/layout/layout.directives.d.ts +2 -2
- package/layout/navigation-drawer/navigation-drawer.component.d.ts +12 -12
- package/layout/{public-api.d.ts → public_api.d.ts} +0 -0
- package/layout/{layout-card-over → src/layout-card-over}/README.md +19 -17
- package/layout/{layout-manage-list → src/layout-manage-list}/README.md +24 -28
- package/layout/src/layout-nav/README.md +50 -0
- package/layout/{layout-nav-list → src/layout-nav-list}/README.md +44 -40
- package/menu/covalent-core-menu.d.ts +1 -1
- package/menu/{public-api.d.ts → public_api.d.ts} +0 -0
- package/message/README.md +26 -18
- package/message/collapse.animation.d.ts +24 -0
- package/message/covalent-core-message.d.ts +1 -1
- package/message/message.component.d.ts +4 -4
- package/message/{public-api.d.ts → public_api.d.ts} +0 -0
- package/package.json +36 -55
- package/{index.d.ts → public_api.d.ts} +0 -0
- package/search/README.md +74 -73
- package/search/covalent-core-search.d.ts +1 -1
- package/search/{public-api.d.ts → public_api.d.ts} +0 -0
- package/search/search-box/search-box.component.d.ts +10 -6
- package/search/search-input/search-input.component.d.ts +10 -6
- package/search/src/search-box/README.md +73 -0
- package/search/src/search-input/README.md +74 -0
- package/side-sheet/README.md +3 -5
- package/side-sheet/{side-sheet.theme.scss → _side-sheet.theme.scss} +0 -0
- package/side-sheet/covalent-core-side-sheet.d.ts +1 -1
- package/side-sheet/{public-api.d.ts → public_api.d.ts} +0 -0
- package/side-sheet/side-sheet-container.d.ts +18 -7
- package/side-sheet/side-sheet.content-directives.d.ts +22 -16
- package/side-sheet/side-sheet.d.ts +2 -2
- package/side-sheet/side-sheet.module.d.ts +1 -1
- package/theming/prebuilt/blue-grey-deep-orange.css +1 -2815
- package/theming/prebuilt/blue-grey-deep-orange.css.map +1 -1
- package/theming/prebuilt/blue-orange.css +1 -2815
- package/theming/prebuilt/blue-orange.css.map +1 -1
- package/theming/prebuilt/indigo-pink.css +1 -2815
- package/theming/prebuilt/indigo-pink.css.map +1 -1
- package/theming/prebuilt/orange-light-blue.css +1 -2815
- package/theming/prebuilt/orange-light-blue.css.map +1 -1
- package/theming/prebuilt/teal-orange.css +1 -2815
- package/theming/prebuilt/teal-orange.css.map +1 -1
- package/user-profile/README.md +5 -5
- package/user-profile/covalent-core-user-profile.d.ts +1 -1
- package/user-profile/user-profile-menu/user-profile-menu.component.d.ts +2 -2
- package/user-profile/user-profile.component.d.ts +2 -2
- package/breadcrumbs/breadcrumb/breadcrumb.component.scss +0 -25
- package/breadcrumbs/breadcrumbs.component.scss +0 -8
- package/breadcrumbs/index.d.ts +0 -1
- package/common/index.d.ts +0 -1
- package/common/material-icons.scss +0 -3
- package/common/platform.scss +0 -7
- package/dialogs/alert-dialog/alert-dialog.component.scss +0 -3
- package/dialogs/confirm-dialog/confirm-dialog.component.scss +0 -3
- package/dialogs/dialog.component.scss +0 -49
- package/dialogs/index.d.ts +0 -1
- package/dialogs/prompt-dialog/prompt-dialog.component.scss +0 -16
- package/dialogs/window-dialog/window-dialog.component.scss +0 -31
- package/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.scss +0 -7
- package/dynamic-menu/dynamic-menu-item/dynamic-menu-link/dynamic-menu-link.component.scss +0 -13
- package/dynamic-menu/dynamic-menu.component.scss +0 -0
- package/dynamic-menu/index.d.ts +0 -1
- package/esm2020/breadcrumbs/index.mjs +0 -2
- package/esm2020/breadcrumbs/public-api.mjs +0 -4
- package/esm2020/common/index.mjs +0 -2
- package/esm2020/common/public-api.mjs +0 -39
- package/esm2020/dialogs/index.mjs +0 -2
- package/esm2020/dialogs/public-api.mjs +0 -9
- package/esm2020/dynamic-menu/index.mjs +0 -2
- package/esm2020/file/index.mjs +0 -2
- package/esm2020/file/public-api.mjs +0 -7
- package/esm2020/index.mjs +0 -2
- package/esm2020/json-formatter/index.mjs +0 -2
- package/esm2020/json-formatter/public-api.mjs +0 -3
- package/esm2020/layout/index.mjs +0 -2
- package/esm2020/layout/public-api.mjs +0 -13
- package/esm2020/menu/index.mjs +0 -2
- package/esm2020/menu/public-api.mjs +0 -3
- package/esm2020/message/index.mjs +0 -2
- package/esm2020/message/public-api.mjs +0 -3
- package/esm2020/search/index.mjs +0 -2
- package/esm2020/search/public-api.mjs +0 -4
- package/esm2020/side-sheet/index.mjs +0 -2
- package/esm2020/side-sheet/public-api.mjs +0 -6
- package/esm2020/user-profile/index.mjs +0 -2
- package/file/file-input/file-input.component.scss +0 -22
- package/file/file-upload/file-upload.component.scss +0 -34
- package/file/index.d.ts +0 -1
- package/json-formatter/index.d.ts +0 -1
- package/json-formatter/json-formatter.component.scss +0 -74
- package/layout/index.d.ts +0 -1
- package/layout/layout-card-over/layout-card-over.component.scss +0 -45
- package/layout/layout-footer/layout-footer.component.scss +0 -4
- package/layout/layout-manage-list/layout-manage-list.component.scss +0 -82
- package/layout/layout-nav/README.md +0 -46
- package/layout/layout-nav/layout-nav.component.scss +0 -54
- package/layout/layout-nav-list/layout-nav-list.component.scss +0 -115
- package/layout/layout.component.scss +0 -16
- package/layout/navigation-drawer/navigation-drawer.component.scss +0 -81
- package/menu/index.d.ts +0 -1
- package/menu/menu.component.scss +0 -51
- package/message/index.d.ts +0 -1
- package/message/message.component.scss +0 -32
- package/schematics/README.md +0 -66
- package/schematics/ng-add/files/theme.scss +0 -64
- package/search/index.d.ts +0 -1
- package/search/search-box/README.md +0 -62
- package/search/search-box/search-box.component.scss +0 -37
- package/search/search-input/README.md +0 -65
- package/search/search-input/search-input.component.scss +0 -75
- package/side-sheet/index.d.ts +0 -1
- package/side-sheet/side-sheet.scss +0 -68
- package/theming/prebuilt/blue-grey-deep-orange.scss +0 -20
- package/theming/prebuilt/blue-orange.scss +0 -20
- package/theming/prebuilt/indigo-pink.scss +0 -20
- package/theming/prebuilt/orange-light-blue.scss +0 -20
- package/theming/prebuilt/teal-orange.scss +0 -20
- package/user-profile/index.d.ts +0 -1
- package/user-profile/user-profile-menu/user-profile-menu.component.scss +0 -41
@@ -1,18 +1,18 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { EventEmitter, Directive, Optional, Host, Input, Output, HostBinding, HostListener, forwardRef, Component, ChangeDetectionStrategy, ViewChild, ContentChild, Injectable, NgModule } from '@angular/core';
|
3
|
-
import * as
|
3
|
+
import * as i4 from '@angular/common';
|
4
4
|
import { CommonModule } from '@angular/common';
|
5
5
|
import * as i1 from '@angular/forms';
|
6
6
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
7
|
-
import * as
|
7
|
+
import * as i6 from '@angular/cdk/portal';
|
8
8
|
import { TemplatePortalDirective, PortalModule } from '@angular/cdk/portal';
|
9
|
-
import * as
|
9
|
+
import * as i3 from '@angular/material/icon';
|
10
10
|
import { MatIconModule } from '@angular/material/icon';
|
11
11
|
import * as i1$1 from '@angular/material/button';
|
12
12
|
import { MatButtonModule } from '@angular/material/button';
|
13
13
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
14
|
-
import {
|
15
|
-
import * as i1$
|
14
|
+
import { mixinControlValueAccessor, mixinDisabled } from '@covalent/core/common';
|
15
|
+
import * as i1$2 from '@angular/common/http';
|
16
16
|
import { HttpRequest, HttpHeaders, HttpParams, HttpEventType } from '@angular/common/http';
|
17
17
|
import { Subject } from 'rxjs';
|
18
18
|
import { tap } from 'rxjs/operators';
|
@@ -51,52 +51,52 @@ class TdFileSelectDirective {
|
|
51
51
|
onChange(event) {
|
52
52
|
if (event.target instanceof HTMLInputElement) {
|
53
53
|
const fileInputEl = event.target;
|
54
|
-
const files = fileInputEl.files;
|
54
|
+
const files = fileInputEl.files || new FileList();
|
55
55
|
if (files.length) {
|
56
|
-
const value = this._multiple
|
57
|
-
|
56
|
+
const value = this._multiple
|
57
|
+
? files.length > 1
|
58
|
+
? files
|
59
|
+
: files[0]
|
60
|
+
: files[0];
|
61
|
+
this.model
|
62
|
+
? this.model.update.emit(value)
|
63
|
+
: this.fileSelect.emit(value);
|
58
64
|
}
|
59
65
|
}
|
60
66
|
}
|
61
67
|
}
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
type:
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
type:
|
75
|
-
}, {
|
76
|
-
type:
|
77
|
-
}]
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
args: ['attr.multiple']
|
85
|
-
}], onChange: [{
|
86
|
-
type: HostListener,
|
87
|
-
args: ['change', ['$event']]
|
88
|
-
}] }); })();
|
68
|
+
TdFileSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileSelectDirective, deps: [{ token: i1.NgModel, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
69
|
+
TdFileSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.2", type: TdFileSelectDirective, selector: "[tdFileSelect]", inputs: { multiple: "multiple" }, outputs: { fileSelect: "fileSelect" }, host: { listeners: { "change": "onChange($event)" }, properties: { "attr.multiple": "this.multipleBinding" } }, ngImport: i0 });
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileSelectDirective, decorators: [{
|
71
|
+
type: Directive,
|
72
|
+
args: [{
|
73
|
+
selector: '[tdFileSelect]',
|
74
|
+
}]
|
75
|
+
}], ctorParameters: function () { return [{ type: i1.NgModel, decorators: [{
|
76
|
+
type: Optional
|
77
|
+
}, {
|
78
|
+
type: Host
|
79
|
+
}] }]; }, propDecorators: { multiple: [{
|
80
|
+
type: Input
|
81
|
+
}], fileSelect: [{
|
82
|
+
type: Output
|
83
|
+
}], multipleBinding: [{
|
84
|
+
type: HostBinding,
|
85
|
+
args: ['attr.multiple']
|
86
|
+
}], onChange: [{
|
87
|
+
type: HostListener,
|
88
|
+
args: ['change', ['$event']]
|
89
|
+
}] } });
|
89
90
|
|
90
91
|
class TdFileDropBase {
|
91
92
|
}
|
92
|
-
|
93
|
-
|
94
|
-
class TdFileDropDirective extends _TdFileDropMixinBase {
|
95
|
-
constructor(_renderer, _element) {
|
96
|
-
super();
|
93
|
+
class TdFileDropDirective {
|
94
|
+
constructor(_renderer, _element, _ngZone) {
|
97
95
|
this._renderer = _renderer;
|
98
96
|
this._element = _element;
|
97
|
+
this._ngZone = _ngZone;
|
99
98
|
this._multiple = false;
|
99
|
+
this.disabled = false;
|
100
100
|
/**
|
101
101
|
* fileDrop?: function
|
102
102
|
* Event emitted when a file or files are dropped in host element after being validated.
|
@@ -124,6 +124,28 @@ class TdFileDropDirective extends _TdFileDropMixinBase {
|
|
124
124
|
get disabledBinding() {
|
125
125
|
return this.disabled ? '' : undefined;
|
126
126
|
}
|
127
|
+
ngOnInit() {
|
128
|
+
this._ngZone.runOutsideAngular(() => {
|
129
|
+
// Listens to 'dragenter' host event to add animation class 'drop-zone' which can be overriden in host.
|
130
|
+
// Stops event propagation and default action from browser for 'dragenter' event.
|
131
|
+
this._dragenterListener = this._renderer.listen(this._element.nativeElement, 'dragenter', (event) => {
|
132
|
+
if (!this.disabled) {
|
133
|
+
this._renderer.addClass(this._element.nativeElement, 'drop-zone');
|
134
|
+
}
|
135
|
+
this._stopEvent(event);
|
136
|
+
});
|
137
|
+
// Listens to 'dragleave' host event to remove animation class 'drop-zone'.
|
138
|
+
// Stops event propagation and default action from browser for 'dragleave' event.
|
139
|
+
this._dragleaveListener = this._renderer.listen(this._element.nativeElement, 'dragleave', (event) => {
|
140
|
+
this._renderer.removeClass(this._element.nativeElement, 'drop-zone');
|
141
|
+
this._stopEvent(event);
|
142
|
+
});
|
143
|
+
});
|
144
|
+
}
|
145
|
+
ngOnDestroy() {
|
146
|
+
this._dragenterListener?.();
|
147
|
+
this._dragleaveListener?.();
|
148
|
+
}
|
127
149
|
/**
|
128
150
|
* Listens to 'drop' host event to get validated transfer items.
|
129
151
|
* Emits the 'fileDrop' event with a [FileList] or [File] depending if 'multiple' attr exists in host.
|
@@ -131,10 +153,14 @@ class TdFileDropDirective extends _TdFileDropMixinBase {
|
|
131
153
|
*/
|
132
154
|
onDrop(event) {
|
133
155
|
if (!this.disabled) {
|
134
|
-
const transfer = event.dataTransfer;
|
156
|
+
const transfer = event.dataTransfer ?? new DataTransfer();
|
135
157
|
const files = transfer.files;
|
136
158
|
if (files.length) {
|
137
|
-
const value = this._multiple
|
159
|
+
const value = this._multiple
|
160
|
+
? files.length > 1
|
161
|
+
? files
|
162
|
+
: files[0]
|
163
|
+
: files[0];
|
138
164
|
this.fileDrop.emit(value);
|
139
165
|
}
|
140
166
|
}
|
@@ -147,10 +173,12 @@ class TdFileDropDirective extends _TdFileDropMixinBase {
|
|
147
173
|
* Stops event propagation and default action from browser for 'dragover' event.
|
148
174
|
*/
|
149
175
|
onDragOver(event) {
|
150
|
-
const transfer = event.dataTransfer;
|
176
|
+
const transfer = event.dataTransfer || new DataTransfer();
|
151
177
|
transfer.dropEffect = this._typeCheck(transfer.types);
|
152
178
|
if (this.disabled ||
|
153
|
-
(!this._multiple &&
|
179
|
+
(!this._multiple &&
|
180
|
+
((transfer.items && transfer.items.length > 1) ||
|
181
|
+
transfer.mozItemCount > 1))) {
|
154
182
|
transfer.dropEffect = 'none';
|
155
183
|
}
|
156
184
|
else {
|
@@ -158,24 +186,6 @@ class TdFileDropDirective extends _TdFileDropMixinBase {
|
|
158
186
|
}
|
159
187
|
this._stopEvent(event);
|
160
188
|
}
|
161
|
-
/**
|
162
|
-
* Listens to 'dragenter' host event to add animation class 'drop-zone' which can be overriden in host.
|
163
|
-
* Stops event propagation and default action from browser for 'dragenter' event.
|
164
|
-
*/
|
165
|
-
onDragEnter(event) {
|
166
|
-
if (!this.disabled) {
|
167
|
-
this._renderer.addClass(this._element.nativeElement, 'drop-zone');
|
168
|
-
}
|
169
|
-
this._stopEvent(event);
|
170
|
-
}
|
171
|
-
/**
|
172
|
-
* Listens to 'dragleave' host event to remove animation class 'drop-zone'.
|
173
|
-
* Stops event propagation and default action from browser for 'dragleave' event.
|
174
|
-
*/
|
175
|
-
onDragLeave(event) {
|
176
|
-
this._renderer.removeClass(this._element.nativeElement, 'drop-zone');
|
177
|
-
this._stopEvent(event);
|
178
|
-
}
|
179
189
|
/**
|
180
190
|
* Validates if the transfer item types are 'Files'.
|
181
191
|
*/
|
@@ -193,64 +203,49 @@ class TdFileDropDirective extends _TdFileDropMixinBase {
|
|
193
203
|
event.stopPropagation();
|
194
204
|
}
|
195
205
|
}
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
}]
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
type: HostListener,
|
221
|
-
args: ['drop', ['$event']]
|
222
|
-
}], onDragOver: [{
|
223
|
-
type: HostListener,
|
224
|
-
args: ['dragover', ['$event']]
|
225
|
-
}], onDragEnter: [{
|
226
|
-
type: HostListener,
|
227
|
-
args: ['dragenter', ['$event']]
|
228
|
-
}], onDragLeave: [{
|
229
|
-
type: HostListener,
|
230
|
-
args: ['dragleave', ['$event']]
|
231
|
-
}] }); })();
|
206
|
+
TdFileDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileDropDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
207
|
+
TdFileDropDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.2", type: TdFileDropDirective, selector: "[tdFileDrop]", inputs: { multiple: "multiple", disabled: "disabled" }, outputs: { fileDrop: "fileDrop" }, host: { listeners: { "drop": "onDrop($event)", "dragover": "onDragOver($event)" }, properties: { "attr.multiple": "this.multipleBinding", "attr.disabled": "this.disabledBinding" } }, ngImport: i0 });
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileDropDirective, decorators: [{
|
209
|
+
type: Directive,
|
210
|
+
args: [{ selector: '[tdFileDrop]' }]
|
211
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { multiple: [{
|
212
|
+
type: Input
|
213
|
+
}], disabled: [{
|
214
|
+
type: Input
|
215
|
+
}], fileDrop: [{
|
216
|
+
type: Output
|
217
|
+
}], multipleBinding: [{
|
218
|
+
type: HostBinding,
|
219
|
+
args: ['attr.multiple']
|
220
|
+
}], disabledBinding: [{
|
221
|
+
type: HostBinding,
|
222
|
+
args: ['attr.disabled']
|
223
|
+
}], onDrop: [{
|
224
|
+
type: HostListener,
|
225
|
+
args: ['drop', ['$event']]
|
226
|
+
}], onDragOver: [{
|
227
|
+
type: HostListener,
|
228
|
+
args: ['dragover', ['$event']]
|
229
|
+
}] } });
|
232
230
|
|
233
|
-
const _c0$1 = ["fileInput"];
|
234
|
-
const _c1 = ["*"];
|
235
231
|
class TdFileInputLabelDirective extends TemplatePortalDirective {
|
236
232
|
constructor(templateRef, viewContainerRef) {
|
237
233
|
super(templateRef, viewContainerRef);
|
238
234
|
}
|
239
235
|
}
|
240
|
-
|
241
|
-
|
242
|
-
(
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
236
|
+
TdFileInputLabelDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileInputLabelDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
237
|
+
TdFileInputLabelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.2", type: TdFileInputLabelDirective, selector: "[tdFileInputLabel]ng-template", usesInheritance: true, ngImport: i0 });
|
238
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileInputLabelDirective, decorators: [{
|
239
|
+
type: Directive,
|
240
|
+
args: [{
|
241
|
+
selector: '[tdFileInputLabel]ng-template',
|
242
|
+
}]
|
243
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
|
248
244
|
class TdFileInputBase {
|
249
245
|
constructor(_changeDetectorRef) {
|
250
246
|
this._changeDetectorRef = _changeDetectorRef;
|
251
247
|
}
|
252
248
|
}
|
253
|
-
/* tslint:disable-next-line */
|
254
249
|
const _TdFileInputMixinBase = mixinControlValueAccessor(mixinDisabled(TdFileInputBase));
|
255
250
|
class TdFileInputComponent extends _TdFileInputMixinBase {
|
256
251
|
constructor(_renderer, _changeDetectorRef) {
|
@@ -262,7 +257,7 @@ class TdFileInputComponent extends _TdFileInputMixinBase {
|
|
262
257
|
* Event emitted a file is selected
|
263
258
|
* Emits a [File | FileList] object.
|
264
259
|
*/
|
265
|
-
this.
|
260
|
+
this.selectFile = new EventEmitter();
|
266
261
|
}
|
267
262
|
get inputElement() {
|
268
263
|
return this._inputElement.nativeElement;
|
@@ -282,7 +277,7 @@ class TdFileInputComponent extends _TdFileInputMixinBase {
|
|
282
277
|
*/
|
283
278
|
handleSelect(files) {
|
284
279
|
this.writeValue(files);
|
285
|
-
this.
|
280
|
+
this.selectFile.emit(files);
|
286
281
|
}
|
287
282
|
/**
|
288
283
|
* Used to clear the selected files from the [TdFileInputComponent].
|
@@ -304,107 +299,47 @@ class TdFileInputComponent extends _TdFileInputMixinBase {
|
|
304
299
|
this.disabled = isDisabled;
|
305
300
|
}
|
306
301
|
}
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
i0.ɵɵattribute("accept", ctx.accept);
|
337
|
-
} }, directives: [i1$1.MatButton, TdFileDropDirective, TdFileSelectDirective], styles: ["[_nghost-%COMP%] .td-file-input[_ngcontent-%COMP%]{padding-left:8px;padding-right:8px}[_nghost-%COMP%] input.td-file-input-hidden[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .drop-zone[_ngcontent-%COMP%]{border-radius:3px}[_nghost-%COMP%] .drop-zone[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{pointer-events:none}"], changeDetection: 0 });
|
338
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdFileInputComponent, [{
|
339
|
-
type: Component,
|
340
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
341
|
-
{
|
342
|
-
provide: NG_VALUE_ACCESSOR,
|
343
|
-
useExisting: forwardRef((() => TdFileInputComponent)),
|
344
|
-
multi: true,
|
345
|
-
},
|
346
|
-
], selector: 'td-file-input', inputs: ['disabled', 'value'], template: "<div>\n <button\n mat-raised-button\n class=\"td-file-input\"\n type=\"button\"\n [color]=\"color\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n (keyup.enter)=\"fileInput.click()\"\n (click)=\"fileInput.click()\"\n (fileDrop)=\"handleSelect($event)\"\n tdFileDrop\n >\n <ng-content></ng-content>\n </button>\n <input\n #fileInput\n class=\"td-file-input-hidden\"\n type=\"file\"\n [attr.accept]=\"accept\"\n (fileSelect)=\"handleSelect($event)\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n tdFileSelect\n />\n</div>\n", styles: [":host .td-file-input{padding-left:8px;padding-right:8px}:host input.td-file-input-hidden{display:none}:host .drop-zone{border-radius:3px}:host .drop-zone *{pointer-events:none}\n"] }]
|
347
|
-
}], function () { return [{ type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, { _inputElement: [{
|
348
|
-
type: ViewChild,
|
349
|
-
args: ['fileInput', { static: true }]
|
350
|
-
}], color: [{
|
351
|
-
type: Input
|
352
|
-
}], multiple: [{
|
353
|
-
type: Input,
|
354
|
-
args: ['multiple']
|
355
|
-
}], accept: [{
|
356
|
-
type: Input
|
357
|
-
}], select: [{
|
358
|
-
type: Output
|
359
|
-
}] }); })();
|
302
|
+
TdFileInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileInputComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
303
|
+
TdFileInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TdFileInputComponent, selector: "td-file-input", inputs: { disabled: "disabled", value: "value", color: "color", multiple: "multiple", accept: "accept" }, outputs: { selectFile: "selectFile" }, providers: [
|
304
|
+
{
|
305
|
+
provide: NG_VALUE_ACCESSOR,
|
306
|
+
useExisting: forwardRef(() => TdFileInputComponent),
|
307
|
+
multi: true,
|
308
|
+
},
|
309
|
+
], viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["fileInput"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<button\n mat-raised-button\n class=\"td-file-input\"\n type=\"button\"\n [color]=\"color\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n (keyup.enter)=\"fileInput.click()\"\n (click)=\"fileInput.click()\"\n (fileDrop)=\"handleSelect($event)\"\n tdFileDrop\n>\n <ng-content></ng-content>\n</button>\n<input\n #fileInput\n class=\"td-file-input-hidden\"\n type=\"file\"\n [attr.accept]=\"accept\"\n (fileSelect)=\"handleSelect($event)\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n tdFileSelect\n/>\n", styles: [":host .td-file-input{padding-left:8px;padding-right:8px}:host input.td-file-input-hidden{display:none}:host .drop-zone{border-radius:3px}:host .drop-zone *{pointer-events:none}\n"], components: [{ type: i1$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: TdFileDropDirective, selector: "[tdFileDrop]", inputs: ["multiple", "disabled"], outputs: ["fileDrop"] }, { type: TdFileSelectDirective, selector: "[tdFileSelect]", inputs: ["multiple"], outputs: ["fileSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
310
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileInputComponent, decorators: [{
|
311
|
+
type: Component,
|
312
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
313
|
+
{
|
314
|
+
provide: NG_VALUE_ACCESSOR,
|
315
|
+
useExisting: forwardRef(() => TdFileInputComponent),
|
316
|
+
multi: true,
|
317
|
+
},
|
318
|
+
], selector: 'td-file-input', inputs: ['disabled', 'value'], template: "<button\n mat-raised-button\n class=\"td-file-input\"\n type=\"button\"\n [color]=\"color\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n (keyup.enter)=\"fileInput.click()\"\n (click)=\"fileInput.click()\"\n (fileDrop)=\"handleSelect($event)\"\n tdFileDrop\n>\n <ng-content></ng-content>\n</button>\n<input\n #fileInput\n class=\"td-file-input-hidden\"\n type=\"file\"\n [attr.accept]=\"accept\"\n (fileSelect)=\"handleSelect($event)\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n tdFileSelect\n/>\n", styles: [":host .td-file-input{padding-left:8px;padding-right:8px}:host input.td-file-input-hidden{display:none}:host .drop-zone{border-radius:3px}:host .drop-zone *{pointer-events:none}\n"] }]
|
319
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { _inputElement: [{
|
320
|
+
type: ViewChild,
|
321
|
+
args: ['fileInput', { static: true }]
|
322
|
+
}], color: [{
|
323
|
+
type: Input
|
324
|
+
}], multiple: [{
|
325
|
+
type: Input
|
326
|
+
}], accept: [{
|
327
|
+
type: Input
|
328
|
+
}], selectFile: [{
|
329
|
+
type: Output
|
330
|
+
}] } });
|
360
331
|
|
361
|
-
function TdFileUploadComponent_td_file_input_0_ng_template_1_Template(rf, ctx) { }
|
362
|
-
function TdFileUploadComponent_td_file_input_0_Template(rf, ctx) { if (rf & 1) {
|
363
|
-
const _r4 = i0.ɵɵgetCurrentView();
|
364
|
-
i0.ɵɵelementStart(0, "td-file-input", 2);
|
365
|
-
i0.ɵɵlistener("ngModelChange", function TdFileUploadComponent_td_file_input_0_Template_td_file_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r3 = i0.ɵɵnextContext(); return ctx_r3.value = $event; })("select", function TdFileUploadComponent_td_file_input_0_Template_td_file_input_select_0_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r5 = i0.ɵɵnextContext(); return ctx_r5.handleSelect($event); });
|
366
|
-
i0.ɵɵtemplate(1, TdFileUploadComponent_td_file_input_0_ng_template_1_Template, 0, 0, "ng-template", 3);
|
367
|
-
i0.ɵɵelementEnd();
|
368
|
-
} if (rf & 2) {
|
369
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
370
|
-
i0.ɵɵproperty("ngModel", ctx_r0.value)("multiple", ctx_r0.multiple)("disabled", ctx_r0.disabled)("accept", ctx_r0.accept)("color", ctx_r0.defaultColor);
|
371
|
-
i0.ɵɵadvance(1);
|
372
|
-
i0.ɵɵproperty("cdkPortalOutlet", ctx_r0.inputLabel)("ngIf", true);
|
373
|
-
} }
|
374
|
-
function TdFileUploadComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
375
|
-
const _r8 = i0.ɵɵgetCurrentView();
|
376
|
-
i0.ɵɵelementStart(0, "div");
|
377
|
-
i0.ɵɵelementStart(1, "button", 4, 5);
|
378
|
-
i0.ɵɵlistener("keyup.delete", function TdFileUploadComponent_div_1_Template_button_keyup_delete_1_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return ctx_r7._cancel(); })("keyup.backspace", function TdFileUploadComponent_div_1_Template_button_keyup_backspace_1_listener() { i0.ɵɵrestoreView(_r8); const ctx_r9 = i0.ɵɵnextContext(); return ctx_r9._cancel(); })("keyup.escape", function TdFileUploadComponent_div_1_Template_button_keyup_escape_1_listener() { i0.ɵɵrestoreView(_r8); const ctx_r10 = i0.ɵɵnextContext(); return ctx_r10._cancel(); })("click", function TdFileUploadComponent_div_1_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r8); const ctx_r11 = i0.ɵɵnextContext(); return ctx_r11.uploadPressed(); });
|
379
|
-
i0.ɵɵprojection(3);
|
380
|
-
i0.ɵɵelementEnd();
|
381
|
-
i0.ɵɵelementStart(4, "button", 6);
|
382
|
-
i0.ɵɵlistener("click", function TdFileUploadComponent_div_1_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r8); const ctx_r12 = i0.ɵɵnextContext(); return ctx_r12._cancel(); });
|
383
|
-
i0.ɵɵelementStart(5, "mat-icon");
|
384
|
-
i0.ɵɵtext(6, "cancel");
|
385
|
-
i0.ɵɵelementEnd();
|
386
|
-
i0.ɵɵelementEnd();
|
387
|
-
i0.ɵɵelementEnd();
|
388
|
-
} if (rf & 2) {
|
389
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
390
|
-
i0.ɵɵadvance(1);
|
391
|
-
i0.ɵɵproperty("color", ctx_r1.activeColor);
|
392
|
-
i0.ɵɵadvance(3);
|
393
|
-
i0.ɵɵproperty("color", ctx_r1.cancelColor);
|
394
|
-
} }
|
395
|
-
const _c0 = ["*"];
|
396
332
|
class TdFileUploadBase {
|
397
333
|
constructor(_changeDetectorRef) {
|
398
334
|
this._changeDetectorRef = _changeDetectorRef;
|
399
335
|
}
|
400
336
|
}
|
401
|
-
|
402
|
-
const _TdFileUploadMixinBase = mixinControlValueAccessor(mixinDisabled(TdFileUploadBase));
|
403
|
-
class TdFileUploadComponent extends _TdFileUploadMixinBase {
|
337
|
+
class TdFileUploadComponent {
|
404
338
|
constructor(_changeDetectorRef) {
|
405
|
-
|
339
|
+
this._changeDetectorRef = _changeDetectorRef;
|
406
340
|
this._multiple = false;
|
407
341
|
this._required = false;
|
342
|
+
this._disabled = false;
|
408
343
|
/**
|
409
344
|
* defaultColor?: 'accent' | 'primary' | 'warn'
|
410
345
|
* Sets browse button color. Uses same color palette accepted as [MatButton] and defaults to 'primary'.
|
@@ -425,7 +360,7 @@ class TdFileUploadComponent extends _TdFileUploadMixinBase {
|
|
425
360
|
* Event emitted when a file is selected.
|
426
361
|
* Emits a [File | FileList] object.
|
427
362
|
*/
|
428
|
-
this.
|
363
|
+
this.selectFile = new EventEmitter();
|
429
364
|
/**
|
430
365
|
* upload?: function
|
431
366
|
* Event emitted when upload button is clicked.
|
@@ -459,6 +394,23 @@ class TdFileUploadComponent extends _TdFileUploadMixinBase {
|
|
459
394
|
get required() {
|
460
395
|
return this._required;
|
461
396
|
}
|
397
|
+
set disabled(disabled) {
|
398
|
+
this._disabled = disabled;
|
399
|
+
this.onDisabledChange(disabled);
|
400
|
+
}
|
401
|
+
get disabled() {
|
402
|
+
return this._disabled;
|
403
|
+
}
|
404
|
+
writeValue(value) {
|
405
|
+
this.value = value;
|
406
|
+
this._changeDetectorRef.markForCheck();
|
407
|
+
}
|
408
|
+
registerOnChange() {
|
409
|
+
//
|
410
|
+
}
|
411
|
+
registerOnTouched() {
|
412
|
+
//
|
413
|
+
}
|
462
414
|
/**
|
463
415
|
* Method executed when upload button is clicked.
|
464
416
|
*/
|
@@ -472,7 +424,7 @@ class TdFileUploadComponent extends _TdFileUploadMixinBase {
|
|
472
424
|
*/
|
473
425
|
handleSelect(value) {
|
474
426
|
this.value = value;
|
475
|
-
this.
|
427
|
+
this.selectFile.emit(value);
|
476
428
|
}
|
477
429
|
/**
|
478
430
|
* Methods executed when cancel button is clicked.
|
@@ -493,68 +445,52 @@ class TdFileUploadComponent extends _TdFileUploadMixinBase {
|
|
493
445
|
}
|
494
446
|
}
|
495
447
|
}
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
]
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
type: Input
|
543
|
-
}], multiple: [{
|
544
|
-
type: Input,
|
545
|
-
args: ['multiple']
|
546
|
-
}], required: [{
|
547
|
-
type: Input,
|
548
|
-
args: ['required']
|
549
|
-
}], accept: [{
|
550
|
-
type: Input
|
551
|
-
}], select: [{
|
552
|
-
type: Output
|
553
|
-
}], upload: [{
|
554
|
-
type: Output
|
555
|
-
}], cancel: [{
|
556
|
-
type: Output
|
557
|
-
}] }); })();
|
448
|
+
TdFileUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileUploadComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
449
|
+
TdFileUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TdFileUploadComponent, selector: "td-file-upload", inputs: { defaultColor: "defaultColor", activeColor: "activeColor", cancelColor: "cancelColor", multiple: "multiple", required: "required", accept: "accept", disabled: "disabled", value: "value" }, outputs: { selectFile: "selectFile", upload: "upload", cancel: "cancel" }, providers: [
|
450
|
+
{
|
451
|
+
provide: NG_VALUE_ACCESSOR,
|
452
|
+
useExisting: forwardRef(() => TdFileUploadComponent),
|
453
|
+
multi: true,
|
454
|
+
},
|
455
|
+
], queries: [{ propertyName: "inputLabel", first: true, predicate: TdFileInputLabelDirective, descendants: true }], viewQueries: [{ propertyName: "fileInput", first: true, predicate: TdFileInputComponent, descendants: true }], ngImport: i0, template: "<td-file-input\n *ngIf=\"!value\"\n [(ngModel)]=\"value\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n [accept]=\"accept\"\n [color]=\"defaultColor\"\n (selectFile)=\"(handleSelect)\"\n>\n <ng-template [cdkPortalOutlet]=\"inputLabel\" [ngIf]=\"true\"></ng-template>\n</td-file-input>\n<div *ngIf=\"value\">\n <button\n #fileUpload\n class=\"td-file-upload\"\n mat-raised-button\n type=\"button\"\n [color]=\"activeColor\"\n (keyup.delete)=\"_cancel()\"\n (keyup.backspace)=\"_cancel()\"\n (keyup.escape)=\"_cancel()\"\n (click)=\"uploadPressed()\"\n >\n <ng-content></ng-content>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n class=\"td-file-upload-cancel\"\n [color]=\"cancelColor\"\n (click)=\"_cancel()\"\n >\n <mat-icon>cancel</mat-icon>\n </button>\n</div>\n", styles: [".td-file-upload{padding-left:8px;padding-right:8px}.td-file-upload-cancel{height:24px;width:24px;position:relative;top:24px;left:-12px}::ng-deep [dir=rtl] .td-file-upload-cancel{right:-12px;left:0}.td-file-upload-cancel mat-icon{border-radius:12px;vertical-align:baseline}.drop-zone{border-radius:3px}.drop-zone *{pointer-events:none}\n"], components: [{ type: TdFileInputComponent, selector: "td-file-input", inputs: ["disabled", "value", "color", "multiple", "accept"], outputs: ["selectFile"] }, { type: i1$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileUploadComponent, decorators: [{
|
457
|
+
type: Component,
|
458
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
459
|
+
{
|
460
|
+
provide: NG_VALUE_ACCESSOR,
|
461
|
+
useExisting: forwardRef(() => TdFileUploadComponent),
|
462
|
+
multi: true,
|
463
|
+
},
|
464
|
+
], selector: 'td-file-upload', template: "<td-file-input\n *ngIf=\"!value\"\n [(ngModel)]=\"value\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n [accept]=\"accept\"\n [color]=\"defaultColor\"\n (selectFile)=\"(handleSelect)\"\n>\n <ng-template [cdkPortalOutlet]=\"inputLabel\" [ngIf]=\"true\"></ng-template>\n</td-file-input>\n<div *ngIf=\"value\">\n <button\n #fileUpload\n class=\"td-file-upload\"\n mat-raised-button\n type=\"button\"\n [color]=\"activeColor\"\n (keyup.delete)=\"_cancel()\"\n (keyup.backspace)=\"_cancel()\"\n (keyup.escape)=\"_cancel()\"\n (click)=\"uploadPressed()\"\n >\n <ng-content></ng-content>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n class=\"td-file-upload-cancel\"\n [color]=\"cancelColor\"\n (click)=\"_cancel()\"\n >\n <mat-icon>cancel</mat-icon>\n </button>\n</div>\n", styles: [".td-file-upload{padding-left:8px;padding-right:8px}.td-file-upload-cancel{height:24px;width:24px;position:relative;top:24px;left:-12px}::ng-deep [dir=rtl] .td-file-upload-cancel{right:-12px;left:0}.td-file-upload-cancel mat-icon{border-radius:12px;vertical-align:baseline}.drop-zone{border-radius:3px}.drop-zone *{pointer-events:none}\n"] }]
|
465
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { fileInput: [{
|
466
|
+
type: ViewChild,
|
467
|
+
args: [TdFileInputComponent]
|
468
|
+
}], inputLabel: [{
|
469
|
+
type: ContentChild,
|
470
|
+
args: [TdFileInputLabelDirective]
|
471
|
+
}], defaultColor: [{
|
472
|
+
type: Input
|
473
|
+
}], activeColor: [{
|
474
|
+
type: Input
|
475
|
+
}], cancelColor: [{
|
476
|
+
type: Input
|
477
|
+
}], multiple: [{
|
478
|
+
type: Input
|
479
|
+
}], required: [{
|
480
|
+
type: Input
|
481
|
+
}], accept: [{
|
482
|
+
type: Input
|
483
|
+
}], disabled: [{
|
484
|
+
type: Input
|
485
|
+
}], value: [{
|
486
|
+
type: Input
|
487
|
+
}], selectFile: [{
|
488
|
+
type: Output
|
489
|
+
}], upload: [{
|
490
|
+
type: Output
|
491
|
+
}], cancel: [{
|
492
|
+
type: Output
|
493
|
+
}] } });
|
558
494
|
|
559
495
|
class TdFileService {
|
560
496
|
/**
|
@@ -586,7 +522,9 @@ class TdFileService {
|
|
586
522
|
headers: new HttpHeaders(headers || {}),
|
587
523
|
params: new HttpParams({ fromObject: params || {} }),
|
588
524
|
});
|
589
|
-
return this._http
|
525
|
+
return this._http
|
526
|
+
.request(req)
|
527
|
+
.pipe(tap((event) => this.handleEvent(event)));
|
590
528
|
}
|
591
529
|
handleEvent(event) {
|
592
530
|
switch (event.type) {
|
@@ -594,7 +532,7 @@ class TdFileService {
|
|
594
532
|
this._progressSubject.next(0);
|
595
533
|
break;
|
596
534
|
case HttpEventType.UploadProgress:
|
597
|
-
this._progressSubject.next(Math.round((100 * event.loaded) / event.total));
|
535
|
+
this._progressSubject.next(Math.round((100 * event.loaded) / (event.total ?? 0)));
|
598
536
|
break;
|
599
537
|
case HttpEventType.Response:
|
600
538
|
this._progressSubject.next(100);
|
@@ -604,13 +542,13 @@ class TdFileService {
|
|
604
542
|
}
|
605
543
|
}
|
606
544
|
}
|
607
|
-
|
608
|
-
|
609
|
-
(
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
545
|
+
TdFileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileService, deps: [{ token: i1$2.HttpClient, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
546
|
+
TdFileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileService });
|
547
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdFileService, decorators: [{
|
548
|
+
type: Injectable
|
549
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient, decorators: [{
|
550
|
+
type: Optional
|
551
|
+
}] }]; } });
|
614
552
|
|
615
553
|
const TD_FILE = [
|
616
554
|
TdFileSelectDirective,
|
@@ -621,31 +559,46 @@ const TD_FILE = [
|
|
621
559
|
];
|
622
560
|
class CovalentFileModule {
|
623
561
|
}
|
624
|
-
|
625
|
-
|
626
|
-
/** @nocollapse */ /** @nocollapse */ CovalentFileModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [TdFileService], imports: [[FormsModule, CommonModule, MatIconModule, MatButtonModule, PortalModule]] });
|
627
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CovalentFileModule, [{
|
628
|
-
type: NgModule,
|
629
|
-
args: [{
|
630
|
-
imports: [FormsModule, CommonModule, MatIconModule, MatButtonModule, PortalModule],
|
631
|
-
declarations: [TD_FILE],
|
632
|
-
exports: [TD_FILE],
|
633
|
-
providers: [TdFileService],
|
634
|
-
}]
|
635
|
-
}], null, null); })();
|
636
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CovalentFileModule, { declarations: [TdFileSelectDirective,
|
562
|
+
CovalentFileModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentFileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
563
|
+
CovalentFileModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentFileModule, declarations: [TdFileSelectDirective,
|
637
564
|
TdFileDropDirective,
|
638
565
|
TdFileUploadComponent,
|
639
566
|
TdFileInputComponent,
|
640
|
-
TdFileInputLabelDirective], imports: [FormsModule,
|
567
|
+
TdFileInputLabelDirective], imports: [FormsModule,
|
568
|
+
CommonModule,
|
569
|
+
MatIconModule,
|
570
|
+
MatButtonModule,
|
571
|
+
PortalModule], exports: [TdFileSelectDirective,
|
641
572
|
TdFileDropDirective,
|
642
573
|
TdFileUploadComponent,
|
643
574
|
TdFileInputComponent,
|
644
|
-
TdFileInputLabelDirective] });
|
575
|
+
TdFileInputLabelDirective] });
|
576
|
+
CovalentFileModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentFileModule, providers: [TdFileService], imports: [[
|
577
|
+
FormsModule,
|
578
|
+
CommonModule,
|
579
|
+
MatIconModule,
|
580
|
+
MatButtonModule,
|
581
|
+
PortalModule,
|
582
|
+
]] });
|
583
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentFileModule, decorators: [{
|
584
|
+
type: NgModule,
|
585
|
+
args: [{
|
586
|
+
imports: [
|
587
|
+
FormsModule,
|
588
|
+
CommonModule,
|
589
|
+
MatIconModule,
|
590
|
+
MatButtonModule,
|
591
|
+
PortalModule,
|
592
|
+
],
|
593
|
+
declarations: [TD_FILE],
|
594
|
+
exports: [TD_FILE],
|
595
|
+
providers: [TdFileService],
|
596
|
+
}]
|
597
|
+
}] });
|
645
598
|
|
646
599
|
/**
|
647
600
|
* Generated bundle index. Do not edit.
|
648
601
|
*/
|
649
602
|
|
650
|
-
export { CovalentFileModule, TdFileDropBase, TdFileDropDirective, TdFileInputBase, TdFileInputComponent, TdFileInputLabelDirective, TdFileSelectDirective, TdFileService, TdFileUploadBase, TdFileUploadComponent,
|
603
|
+
export { CovalentFileModule, TdFileDropBase, TdFileDropDirective, TdFileInputBase, TdFileInputComponent, TdFileInputLabelDirective, TdFileSelectDirective, TdFileService, TdFileUploadBase, TdFileUploadComponent, _TdFileInputMixinBase };
|
651
604
|
//# sourceMappingURL=covalent-core-file.mjs.map
|