@delon/abc 12.4.2 → 13.0.0-beta.1
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/abc.d.ts +1 -0
- package/auto-focus/auto-focus.directive.d.ts +7 -2
- package/auto-focus/auto-focus.module.d.ts +5 -0
- package/auto-focus/autoFocus.d.ts +1 -0
- package/auto-focus/package.json +5 -6
- package/avatar-list/avatar-list-item.component.d.ts +7 -4
- package/avatar-list/avatar-list.component.d.ts +4 -1
- package/avatar-list/avatar-list.module.d.ts +9 -0
- package/avatar-list/avatarList.d.ts +1 -0
- package/avatar-list/package.json +5 -6
- package/avatar-list/style/index.less +6 -0
- package/count-down/count-down.component.d.ts +4 -1
- package/count-down/count-down.d.ts +1 -0
- package/count-down/count-down.module.d.ts +7 -0
- package/count-down/package.json +5 -6
- package/date-picker/date-picker.module.d.ts +9 -0
- package/date-picker/datePicker.d.ts +1 -1
- package/date-picker/package.json +5 -6
- package/date-picker/public_api.d.ts +1 -0
- package/date-picker/range-shortcut.component.d.ts +3 -0
- package/date-picker/range.directive.d.ts +3 -0
- package/down-file/down-file.directive.d.ts +5 -2
- package/down-file/down-file.module.d.ts +7 -0
- package/down-file/downFile.d.ts +1 -0
- package/down-file/package.json +5 -6
- package/ellipsis/ellipsis.component.d.ts +5 -2
- package/ellipsis/ellipsis.d.ts +1 -0
- package/ellipsis/ellipsis.module.d.ts +8 -0
- package/ellipsis/package.json +5 -6
- package/ellipsis/style/index.less +4 -0
- package/error-collect/error-collect.component.d.ts +3 -0
- package/error-collect/error-collect.module.d.ts +7 -0
- package/error-collect/errorCollect.d.ts +1 -0
- package/error-collect/package.json +5 -6
- package/error-collect/style/index.less +1 -0
- package/{esm2015/abc.js → esm2020/abc.mjs} +0 -0
- package/esm2020/auto-focus/auto-focus.directive.mjs +48 -0
- package/esm2020/auto-focus/auto-focus.module.mjs +17 -0
- package/{esm2015/auto-focus/autoFocus.js → esm2020/auto-focus/autoFocus.mjs} +0 -0
- package/{esm2015/auto-focus/index.js → esm2020/auto-focus/index.mjs} +0 -0
- package/esm2020/avatar-list/avatar-list-item.component.mjs +26 -0
- package/esm2020/avatar-list/avatar-list.component.mjs +89 -0
- package/esm2020/avatar-list/avatar-list.module.mjs +22 -0
- package/{esm2015/avatar-list/avatarList.js → esm2020/avatar-list/avatarList.mjs} +0 -0
- package/{esm2015/avatar-list/public_api.js → esm2020/avatar-list/public_api.mjs} +0 -0
- package/esm2020/count-down/count-down.component.mjs +45 -0
- package/{esm2015/count-down/count-down.js → esm2020/count-down/count-down.mjs} +0 -0
- package/esm2020/count-down/count-down.module.mjs +20 -0
- package/{esm2015/count-down/public_api.js → esm2020/count-down/public_api.mjs} +0 -0
- package/esm2020/date-picker/date-picker.module.mjs +22 -0
- package/esm2020/date-picker/datePicker.mjs +5 -0
- package/{esm2015/date-picker/public_api.js → esm2020/date-picker/public_api.mjs} +2 -1
- package/esm2020/date-picker/range-shortcut.component.mjs +40 -0
- package/esm2020/date-picker/range.directive.mjs +174 -0
- package/esm2020/down-file/down-file.directive.mjs +114 -0
- package/esm2020/down-file/down-file.module.mjs +20 -0
- package/{esm2015/down-file/downFile.js → esm2020/down-file/downFile.mjs} +0 -0
- package/{esm2015/down-file/public_api.js → esm2020/down-file/public_api.mjs} +0 -0
- package/esm2020/ellipsis/ellipsis.component.mjs +229 -0
- package/{esm2015/ellipsis/ellipsis.js → esm2020/ellipsis/ellipsis.mjs} +0 -0
- package/esm2020/ellipsis/ellipsis.module.mjs +21 -0
- package/{esm2015/ellipsis/public_api.js → esm2020/ellipsis/public_api.mjs} +0 -0
- package/esm2020/error-collect/error-collect.component.mjs +118 -0
- package/esm2020/error-collect/error-collect.module.mjs +20 -0
- package/{esm2015/error-collect/errorCollect.js → esm2020/error-collect/errorCollect.mjs} +0 -0
- package/{esm2015/error-collect/public_api.js → esm2020/error-collect/public_api.mjs} +0 -0
- package/esm2020/exception/exception.component.mjs +105 -0
- package/{esm2015/exception/exception.js → esm2020/exception/exception.mjs} +0 -0
- package/esm2020/exception/exception.module.mjs +23 -0
- package/{esm2015/exception/public_api.js → esm2020/exception/public_api.mjs} +0 -0
- package/esm2020/footer-toolbar/footer-toolbar.component.mjs +44 -0
- package/esm2020/footer-toolbar/footer-toolbar.module.mjs +21 -0
- package/{esm2015/footer-toolbar/footerToolbar.js → esm2020/footer-toolbar/footerToolbar.mjs} +0 -0
- package/{esm2015/footer-toolbar/public_api.js → esm2020/footer-toolbar/public_api.mjs} +0 -0
- package/esm2020/full-content/full-content-toggle.directive.mjs +24 -0
- package/esm2020/full-content/full-content.component.mjs +138 -0
- package/esm2020/full-content/full-content.module.mjs +20 -0
- package/esm2020/full-content/full-content.service.mjs +23 -0
- package/{esm2015/full-content/fullContent.js → esm2020/full-content/fullContent.mjs} +0 -0
- package/{esm2015/full-content/public_api.js → esm2020/full-content/public_api.mjs} +0 -0
- package/esm2020/global-footer/global-footer-item.component.mjs +30 -0
- package/esm2020/global-footer/global-footer.component.mjs +73 -0
- package/esm2020/global-footer/global-footer.module.mjs +21 -0
- package/{esm2015/global-footer/global-footer.types.js → esm2020/global-footer/global-footer.types.mjs} +0 -0
- package/{esm2015/global-footer/globalFooter.js → esm2020/global-footer/globalFooter.mjs} +0 -0
- package/{esm2015/global-footer/public_api.js → esm2020/global-footer/public_api.mjs} +0 -0
- package/esm2020/image/image.directive.mjs +146 -0
- package/{esm2015/image/image.js → esm2020/image/image.mjs} +0 -0
- package/esm2020/image/image.module.mjs +20 -0
- package/{esm2015/image/public_api.js → esm2020/image/public_api.mjs} +0 -0
- package/{esm2015/let/index.js → esm2020/let/index.mjs} +0 -0
- package/esm2020/let/let.directive.mjs +36 -0
- package/{esm2015/let/let.js → esm2020/let/let.mjs} +0 -0
- package/esm2020/let/let.module.mjs +17 -0
- package/esm2020/loading/loading.component.mjs +26 -0
- package/{esm2015/loading/loading.js → esm2020/loading/loading.mjs} +0 -0
- package/esm2020/loading/loading.module.mjs +24 -0
- package/esm2020/loading/loading.service.mjs +88 -0
- package/{esm2015/loading/loading.types.js → esm2020/loading/loading.types.mjs} +0 -0
- package/{esm2015/loading/public_api.js → esm2020/loading/public_api.mjs} +0 -0
- package/{esm2015/lodop/lodop.js → esm2020/lodop/lodop.mjs} +0 -0
- package/esm2020/lodop/lodop.module.mjs +12 -0
- package/esm2020/lodop/lodop.service.mjs +222 -0
- package/esm2020/lodop/lodop.types.mjs +2 -0
- package/{esm2015/lodop/public_api.js → esm2020/lodop/public_api.mjs} +0 -0
- package/esm2020/media/media.component.mjs +106 -0
- package/{esm2015/media/media.js → esm2020/media/media.mjs} +0 -0
- package/esm2020/media/media.module.mjs +19 -0
- package/esm2020/media/media.service.mjs +46 -0
- package/{esm2015/media/plyr.types.js → esm2020/media/plyr.types.mjs} +0 -0
- package/{esm2015/media/public_api.js → esm2020/media/public_api.mjs} +0 -0
- package/esm2020/notice-icon/notice-icon-tab.component.mjs +34 -0
- package/esm2020/notice-icon/notice-icon.component.mjs +80 -0
- package/esm2020/notice-icon/notice-icon.module.mjs +60 -0
- package/{esm2015/notice-icon/notice-icon.types.js → esm2020/notice-icon/notice-icon.types.mjs} +0 -0
- package/{esm2015/notice-icon/noticeIcon.js → esm2020/notice-icon/noticeIcon.mjs} +0 -0
- package/{esm2015/notice-icon/public_api.js → esm2020/notice-icon/public_api.mjs} +0 -0
- package/esm2020/onboarding/onboarding.component.mjs +134 -0
- package/{esm2015/onboarding/onboarding.js → esm2020/onboarding/onboarding.mjs} +0 -0
- package/esm2020/onboarding/onboarding.module.mjs +25 -0
- package/esm2020/onboarding/onboarding.service.mjs +185 -0
- package/{esm2015/onboarding/onboarding.types.js → esm2020/onboarding/onboarding.types.mjs} +0 -0
- package/{esm2015/onboarding/public_api.js → esm2020/onboarding/public_api.mjs} +0 -0
- package/esm2020/page-header/page-header.component.mjs +247 -0
- package/esm2020/page-header/page-header.module.mjs +24 -0
- package/{esm2015/page-header/pageHeader.js → esm2020/page-header/pageHeader.mjs} +0 -0
- package/{esm2015/page-header/public_api.js → esm2020/page-header/public_api.mjs} +0 -0
- package/esm2020/pdf/pdf.component.mjs +460 -0
- package/{esm2015/pdf/pdf.config.js → esm2020/pdf/pdf.config.mjs} +2 -2
- package/{esm2015/pdf/pdf.js → esm2020/pdf/pdf.mjs} +0 -0
- package/esm2020/pdf/pdf.module.mjs +20 -0
- package/{esm2015/pdf/pdf.types.js → esm2020/pdf/pdf.types.mjs} +0 -0
- package/{esm2015/pdf/public_api.js → esm2020/pdf/public_api.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/{esm2015/qr/public_api.js → esm2020/qr/public_api.mjs} +0 -0
- package/esm2020/qr/qr.component.mjs +136 -0
- package/{esm2015/qr/qr.config.js → esm2020/qr/qr.config.mjs} +2 -2
- package/{esm2015/qr/qr.js → esm2020/qr/qr.mjs} +0 -0
- package/esm2020/qr/qr.module.mjs +19 -0
- package/{esm2015/qr/qr.types.js → esm2020/qr/qr.types.mjs} +0 -0
- package/{esm2015/quick-menu/public_api.js → esm2020/quick-menu/public_api.mjs} +0 -0
- package/esm2020/quick-menu/quick-menu.component.mjs +89 -0
- package/esm2020/quick-menu/quick-menu.module.mjs +21 -0
- package/{esm2015/quick-menu/quickMenu.js → esm2020/quick-menu/quickMenu.mjs} +0 -0
- package/{esm2015/result/public_api.js → esm2020/result/public_api.mjs} +0 -0
- package/esm2020/result/result.component.mjs +61 -0
- package/{esm2015/result/result.js → esm2020/result/result.mjs} +0 -0
- package/esm2020/result/result.module.mjs +21 -0
- package/{esm2015/reuse-tab/lifecycle_hooks.js → esm2020/reuse-tab/lifecycle_hooks.mjs} +0 -0
- package/{esm2015/reuse-tab/public_api.js → esm2020/reuse-tab/public_api.mjs} +0 -0
- package/esm2020/reuse-tab/reuse-tab-context-menu.component.mjs +76 -0
- package/esm2020/reuse-tab/reuse-tab-context.component.mjs +33 -0
- package/esm2020/reuse-tab/reuse-tab-context.directive.mjs +35 -0
- package/esm2020/reuse-tab/reuse-tab-context.service.mjs +55 -0
- package/esm2020/reuse-tab/reuse-tab.component.mjs +318 -0
- package/{esm2015/reuse-tab/reuse-tab.interfaces.js → esm2020/reuse-tab/reuse-tab.interfaces.mjs} +0 -0
- package/esm2020/reuse-tab/reuse-tab.module.mjs +29 -0
- package/esm2020/reuse-tab/reuse-tab.service.mjs +533 -0
- package/{esm2015/reuse-tab/reuse-tab.strategy.js → esm2020/reuse-tab/reuse-tab.strategy.mjs} +0 -0
- package/{esm2015/reuse-tab/reuseTab.js → esm2020/reuse-tab/reuseTab.mjs} +0 -0
- package/{esm2015/se/edit.js → esm2020/se/edit.mjs} +0 -0
- package/esm2020/se/public_api.mjs +5 -0
- package/esm2020/se/se-container.component.mjs +173 -0
- package/esm2020/se/se.component.mjs +233 -0
- package/esm2020/se/se.module.mjs +23 -0
- package/{esm2015/se/se.types.js → esm2020/se/se.types.mjs} +0 -0
- package/{esm2015/sg/grid.js → esm2020/sg/grid.mjs} +0 -0
- package/{esm2015/sg/public_api.js → esm2020/sg/public_api.mjs} +0 -0
- package/esm2020/sg/sg-container.component.mjs +52 -0
- package/esm2020/sg/sg.component.mjs +67 -0
- package/esm2020/sg/sg.module.mjs +20 -0
- package/{esm2015/st/public_api.js → esm2020/st/public_api.mjs} +0 -0
- package/esm2020/st/st-column-source.mjs +470 -0
- package/esm2020/st/st-data-source.mjs +448 -0
- package/esm2020/st/st-export.mjs +89 -0
- package/esm2020/st/st-filter.component.mjs +262 -0
- package/esm2020/st/st-row.directive.mjs +45 -0
- package/esm2020/st/st-widget-host.directive.mjs +31 -0
- package/esm2020/st/st-widget.mjs +26 -0
- package/esm2020/st/st.component.mjs +969 -0
- package/{esm2015/st/st.config.js → esm2020/st/st.config.mjs} +0 -0
- package/esm2020/st/st.interfaces.mjs +2 -0
- package/esm2020/st/st.module.mjs +98 -0
- package/{esm2015/st/st.types.js → esm2020/st/st.types.mjs} +0 -0
- package/esm2020/st/table.mjs +5 -0
- package/esm2020/sv/public_api.mjs +5 -0
- package/esm2020/sv/sv-container.component.mjs +125 -0
- package/esm2020/sv/sv-value.component.mjs +44 -0
- package/esm2020/sv/sv.component.mjs +113 -0
- package/esm2020/sv/sv.module.mjs +25 -0
- package/{esm2015/sv/view.js → esm2020/sv/view.mjs} +0 -0
- package/{esm2015/tag-select/public_api.js → esm2020/tag-select/public_api.mjs} +0 -0
- package/esm2020/tag-select/tag-select.component.mjs +64 -0
- package/esm2020/tag-select/tag-select.module.mjs +21 -0
- package/{esm2015/tag-select/tagSelect.js → esm2020/tag-select/tagSelect.mjs} +0 -0
- package/{esm2015/xlsx/public_api.js → esm2020/xlsx/public_api.mjs} +0 -0
- package/esm2020/xlsx/xlsx.directive.mjs +27 -0
- package/{esm2015/xlsx/xlsx.js → esm2020/xlsx/xlsx.mjs} +0 -0
- package/esm2020/xlsx/xlsx.module.mjs +19 -0
- package/esm2020/xlsx/xlsx.service.mjs +128 -0
- package/{esm2015/xlsx/xlsx.types.js → esm2020/xlsx/xlsx.types.mjs} +0 -0
- package/{esm2015/zip/public_api.js → esm2020/zip/public_api.mjs} +0 -0
- package/{esm2015/zip/zip.js → esm2020/zip/zip.mjs} +0 -0
- package/esm2020/zip/zip.module.mjs +15 -0
- package/esm2020/zip/zip.service.mjs +114 -0
- package/{esm2015/zip/zip.types.js → esm2020/zip/zip.types.mjs} +0 -0
- package/exception/exception.component.d.ts +3 -0
- package/exception/exception.d.ts +1 -0
- package/exception/exception.module.d.ts +10 -0
- package/exception/package.json +5 -6
- package/exception/style/index.less +9 -0
- package/fesm2015/{abc.js → abc.mjs} +1 -1
- package/fesm2015/abc.mjs.map +1 -0
- package/fesm2015/autoFocus.mjs +69 -0
- package/fesm2015/autoFocus.mjs.map +1 -0
- package/fesm2015/avatarList.mjs +140 -0
- package/fesm2015/avatarList.mjs.map +1 -0
- package/fesm2015/count-down.mjs +69 -0
- package/fesm2015/count-down.mjs.map +1 -0
- package/fesm2015/{datePicker.js → datePicker.mjs} +63 -40
- package/fesm2015/datePicker.mjs.map +1 -0
- package/fesm2015/downFile.mjs +141 -0
- package/fesm2015/downFile.mjs.map +1 -0
- package/fesm2015/edit.mjs +443 -0
- package/fesm2015/edit.mjs.map +1 -0
- package/fesm2015/ellipsis.mjs +255 -0
- package/fesm2015/ellipsis.mjs.map +1 -0
- package/fesm2015/errorCollect.mjs +144 -0
- package/fesm2015/errorCollect.mjs.map +1 -0
- package/fesm2015/exception.mjs +135 -0
- package/fesm2015/exception.mjs.map +1 -0
- package/fesm2015/footerToolbar.mjs +70 -0
- package/fesm2015/footerToolbar.mjs.map +1 -0
- package/fesm2015/fullContent.mjs +202 -0
- package/fesm2015/fullContent.mjs.map +1 -0
- package/fesm2015/globalFooter.mjs +127 -0
- package/fesm2015/globalFooter.mjs.map +1 -0
- package/fesm2015/grid.mjs +139 -0
- package/fesm2015/grid.mjs.map +1 -0
- package/fesm2015/image.mjs +165 -0
- package/fesm2015/image.mjs.map +1 -0
- package/fesm2015/let.mjs +59 -0
- package/fesm2015/let.mjs.map +1 -0
- package/fesm2015/loading.mjs +140 -0
- package/fesm2015/loading.mjs.map +1 -0
- package/fesm2015/{lodop.js → lodop.mjs} +15 -15
- package/fesm2015/lodop.mjs.map +1 -0
- package/fesm2015/media.mjs +170 -0
- package/fesm2015/media.mjs.map +1 -0
- package/fesm2015/noticeIcon.mjs +173 -0
- package/fesm2015/noticeIcon.mjs.map +1 -0
- package/fesm2015/onboarding.mjs +335 -0
- package/fesm2015/onboarding.mjs.map +1 -0
- package/fesm2015/pageHeader.mjs +277 -0
- package/fesm2015/pageHeader.mjs.map +1 -0
- package/fesm2015/{pdf.js → pdf.mjs} +81 -54
- package/fesm2015/pdf.mjs.map +1 -0
- package/fesm2015/qr.mjs +171 -0
- package/fesm2015/qr.mjs.map +1 -0
- package/fesm2015/quickMenu.mjs +114 -0
- package/fesm2015/quickMenu.mjs.map +1 -0
- package/fesm2015/result.mjs +89 -0
- package/fesm2015/result.mjs.map +1 -0
- package/fesm2015/{reuseTab.js → reuseTab.mjs} +183 -160
- package/fesm2015/reuseTab.mjs.map +1 -0
- package/fesm2015/{table.js → table.mjs} +597 -483
- package/fesm2015/table.mjs.map +1 -0
- package/fesm2015/tagSelect.mjs +92 -0
- package/fesm2015/tagSelect.mjs.map +1 -0
- package/fesm2015/view.mjs +302 -0
- package/fesm2015/view.mjs.map +1 -0
- package/fesm2015/{xlsx.js → xlsx.mjs} +42 -42
- package/fesm2015/xlsx.mjs.map +1 -0
- package/fesm2015/{zip.js → zip.mjs} +35 -32
- package/fesm2015/zip.mjs.map +1 -0
- package/fesm2020/abc.mjs +7 -0
- package/fesm2020/abc.mjs.map +1 -0
- package/fesm2020/autoFocus.mjs +69 -0
- package/fesm2020/autoFocus.mjs.map +1 -0
- package/fesm2020/avatarList.mjs +137 -0
- package/fesm2020/avatarList.mjs.map +1 -0
- package/fesm2020/count-down.mjs +69 -0
- package/fesm2020/count-down.mjs.map +1 -0
- package/fesm2020/datePicker.mjs +236 -0
- package/fesm2020/datePicker.mjs.map +1 -0
- package/fesm2020/downFile.mjs +138 -0
- package/fesm2020/downFile.mjs.map +1 -0
- package/fesm2020/edit.mjs +436 -0
- package/fesm2020/edit.mjs.map +1 -0
- package/fesm2020/ellipsis.mjs +253 -0
- package/fesm2020/ellipsis.mjs.map +1 -0
- package/fesm2020/errorCollect.mjs +141 -0
- package/fesm2020/errorCollect.mjs.map +1 -0
- package/fesm2020/exception.mjs +132 -0
- package/fesm2020/exception.mjs.map +1 -0
- package/fesm2020/footerToolbar.mjs +68 -0
- package/fesm2020/footerToolbar.mjs.map +1 -0
- package/fesm2020/fullContent.mjs +199 -0
- package/fesm2020/fullContent.mjs.map +1 -0
- package/fesm2020/globalFooter.mjs +124 -0
- package/fesm2020/globalFooter.mjs.map +1 -0
- package/fesm2020/grid.mjs +137 -0
- package/fesm2020/grid.mjs.map +1 -0
- package/fesm2020/image.mjs +170 -0
- package/fesm2020/image.mjs.map +1 -0
- package/fesm2020/let.mjs +57 -0
- package/fesm2020/let.mjs.map +1 -0
- package/fesm2020/loading.mjs +138 -0
- package/fesm2020/loading.mjs.map +1 -0
- package/fesm2020/lodop.mjs +239 -0
- package/fesm2020/lodop.mjs.map +1 -0
- package/fesm2020/media.mjs +172 -0
- package/fesm2020/media.mjs.map +1 -0
- package/fesm2020/noticeIcon.mjs +173 -0
- package/fesm2020/noticeIcon.mjs.map +1 -0
- package/fesm2020/onboarding.mjs +343 -0
- package/fesm2020/onboarding.mjs.map +1 -0
- package/fesm2020/pageHeader.mjs +274 -0
- package/fesm2020/pageHeader.mjs.map +1 -0
- package/fesm2020/pdf.mjs +506 -0
- package/fesm2020/pdf.mjs.map +1 -0
- package/fesm2020/qr.mjs +171 -0
- package/fesm2020/qr.mjs.map +1 -0
- package/fesm2020/quickMenu.mjs +114 -0
- package/fesm2020/quickMenu.mjs.map +1 -0
- package/fesm2020/result.mjs +86 -0
- package/fesm2020/result.mjs.map +1 -0
- package/fesm2020/reuseTab.mjs +1106 -0
- package/fesm2020/reuseTab.mjs.map +1 -0
- package/fesm2020/table.mjs +2469 -0
- package/fesm2020/table.mjs.map +1 -0
- package/fesm2020/tagSelect.mjs +89 -0
- package/fesm2020/tagSelect.mjs.map +1 -0
- package/fesm2020/view.mjs +298 -0
- package/fesm2020/view.mjs.map +1 -0
- package/fesm2020/xlsx.mjs +175 -0
- package/fesm2020/xlsx.mjs.map +1 -0
- package/fesm2020/zip.mjs +134 -0
- package/fesm2020/zip.mjs.map +1 -0
- package/footer-toolbar/footer-toolbar.component.d.ts +4 -1
- package/footer-toolbar/footer-toolbar.module.d.ts +8 -0
- package/footer-toolbar/footerToolbar.d.ts +1 -0
- package/footer-toolbar/package.json +5 -6
- package/footer-toolbar/style/index.less +1 -0
- package/full-content/full-content-toggle.directive.d.ts +3 -0
- package/full-content/full-content.component.d.ts +6 -3
- package/full-content/full-content.module.d.ts +7 -0
- package/full-content/full-content.service.d.ts +3 -0
- package/full-content/fullContent.d.ts +1 -0
- package/full-content/package.json +5 -6
- package/full-content/style/index.less +1 -0
- package/global-footer/global-footer-item.component.d.ts +5 -2
- package/global-footer/global-footer.component.d.ts +3 -0
- package/global-footer/global-footer.module.d.ts +8 -0
- package/global-footer/globalFooter.d.ts +1 -0
- package/global-footer/package.json +5 -6
- package/global-footer/style/index.less +5 -0
- package/image/image.d.ts +1 -0
- package/image/image.directive.d.ts +4 -1
- package/image/image.module.d.ts +7 -0
- package/image/package.json +5 -6
- package/let/let.d.ts +1 -0
- package/let/let.directive.d.ts +3 -0
- package/let/let.module.d.ts +5 -0
- package/let/package.json +5 -6
- package/loading/loading.component.d.ts +3 -0
- package/loading/loading.d.ts +1 -0
- package/loading/loading.module.d.ts +10 -0
- package/loading/loading.service.d.ts +4 -1
- package/loading/package.json +5 -6
- package/loading/style/index.less +3 -0
- package/lodop/lodop.d.ts +1 -0
- package/lodop/lodop.module.d.ts +4 -0
- package/lodop/lodop.service.d.ts +3 -0
- package/lodop/lodop.types.d.ts +4 -0
- package/lodop/package.json +5 -6
- package/media/media.component.d.ts +4 -1
- package/media/media.d.ts +1 -0
- package/media/media.module.d.ts +6 -0
- package/media/media.service.d.ts +3 -0
- package/media/package.json +5 -6
- package/notice-icon/notice-icon-tab.component.d.ts +3 -0
- package/notice-icon/notice-icon.component.d.ts +4 -1
- package/notice-icon/notice-icon.module.d.ts +16 -0
- package/notice-icon/noticeIcon.d.ts +1 -0
- package/notice-icon/package.json +5 -6
- package/notice-icon/style/index.less +17 -0
- package/onboarding/onboarding.component.d.ts +4 -1
- package/onboarding/onboarding.d.ts +1 -0
- package/onboarding/onboarding.module.d.ts +11 -0
- package/onboarding/onboarding.service.d.ts +3 -0
- package/onboarding/package.json +5 -6
- package/onboarding/style/index.less +6 -0
- package/package.json +274 -14
- package/page-header/package.json +5 -6
- package/page-header/page-header.component.d.ts +4 -1
- package/page-header/page-header.module.d.ts +11 -0
- package/page-header/pageHeader.d.ts +1 -0
- package/page-header/style/index.less +10 -0
- package/page-header/style/rtl.less +3 -0
- package/pdf/package.json +5 -6
- package/pdf/pdf.component.d.ts +5 -2
- package/pdf/pdf.d.ts +1 -0
- package/pdf/pdf.module.d.ts +7 -0
- package/qr/package.json +5 -6
- package/qr/qr.component.d.ts +13 -10
- package/qr/qr.d.ts +1 -0
- package/qr/qr.module.d.ts +6 -0
- package/quick-menu/package.json +5 -6
- package/quick-menu/quick-menu.component.d.ts +6 -3
- package/quick-menu/quick-menu.module.d.ts +8 -0
- package/quick-menu/quickMenu.d.ts +1 -0
- package/quick-menu/style/index.less +2 -0
- package/result/package.json +5 -6
- package/result/result.component.d.ts +6 -3
- package/result/result.d.ts +1 -0
- package/result/result.module.d.ts +8 -0
- package/result/style/index.less +7 -0
- package/reuse-tab/package.json +5 -6
- package/reuse-tab/reuse-tab-context-menu.component.d.ts +3 -0
- package/reuse-tab/reuse-tab-context.component.d.ts +4 -1
- package/reuse-tab/reuse-tab-context.directive.d.ts +3 -0
- package/reuse-tab/reuse-tab-context.service.d.ts +4 -1
- package/reuse-tab/reuse-tab.component.d.ts +13 -10
- package/reuse-tab/reuse-tab.module.d.ts +15 -0
- package/reuse-tab/reuse-tab.service.d.ts +7 -4
- package/reuse-tab/reuseTab.d.ts +1 -0
- package/reuse-tab/style/index.less +4 -0
- package/se/edit.d.ts +1 -0
- package/se/package.json +5 -6
- package/se/public_api.d.ts +0 -1
- package/se/se-container.component.d.ts +18 -4
- package/se/se.component.d.ts +13 -8
- package/se/se.module.d.ts +10 -0
- package/se/style/index.less +2 -0
- package/sg/grid.d.ts +1 -0
- package/sg/package.json +5 -6
- package/sg/sg-container.component.d.ts +4 -1
- package/sg/sg.component.d.ts +4 -1
- package/sg/sg.module.d.ts +7 -0
- package/st/package.json +5 -6
- package/st/st-column-source.d.ts +4 -1
- package/st/st-data-source.d.ts +3 -0
- package/st/st-export.d.ts +3 -0
- package/st/st-filter.component.d.ts +3 -0
- package/st/st-row.directive.d.ts +7 -2
- package/st/st-widget-host.directive.d.ts +5 -3
- package/st/st-widget.d.ts +3 -0
- package/st/st.component.d.ts +38 -11
- package/st/st.interfaces.d.ts +2 -2
- package/st/st.module.d.ts +27 -0
- package/st/style/index.less +8 -0
- package/st/table.d.ts +1 -3
- package/sv/package.json +5 -6
- package/sv/public_api.d.ts +0 -1
- package/sv/style/index.less +8 -0
- package/sv/sv-container.component.d.ts +16 -3
- package/sv/sv-value.component.d.ts +3 -0
- package/sv/sv.component.d.ts +13 -10
- package/sv/sv.module.d.ts +12 -0
- package/sv/view.d.ts +1 -0
- package/tag-select/package.json +5 -6
- package/tag-select/style/index.less +4 -0
- package/tag-select/style/rtl.less +3 -0
- package/tag-select/tag-select.component.d.ts +3 -0
- package/tag-select/tag-select.module.d.ts +8 -0
- package/tag-select/tagSelect.d.ts +1 -0
- package/xlsx/package.json +5 -6
- package/xlsx/xlsx.d.ts +1 -0
- package/xlsx/xlsx.directive.d.ts +3 -0
- package/xlsx/xlsx.module.d.ts +6 -0
- package/xlsx/xlsx.service.d.ts +3 -0
- package/zip/package.json +5 -6
- package/zip/zip.d.ts +1 -0
- package/zip/zip.module.d.ts +5 -0
- package/zip/zip.service.d.ts +3 -0
- package/abc.metadata.json +0 -1
- package/auto-focus/autoFocus.metadata.json +0 -1
- package/avatar-list/avatarList.metadata.json +0 -1
- package/bundles/abc.umd.js +0 -19
- package/bundles/abc.umd.js.map +0 -1
- package/bundles/autoFocus.umd.js +0 -394
- package/bundles/autoFocus.umd.js.map +0 -1
- package/bundles/avatarList.umd.js +0 -465
- package/bundles/avatarList.umd.js.map +0 -1
- package/bundles/count-down.umd.js +0 -75
- package/bundles/count-down.umd.js.map +0 -1
- package/bundles/datePicker.umd.js +0 -552
- package/bundles/datePicker.umd.js.map +0 -1
- package/bundles/downFile.umd.js +0 -474
- package/bundles/downFile.umd.js.map +0 -1
- package/bundles/edit.umd.js +0 -776
- package/bundles/edit.umd.js.map +0 -1
- package/bundles/ellipsis.umd.js +0 -578
- package/bundles/ellipsis.umd.js.map +0 -1
- package/bundles/errorCollect.umd.js +0 -461
- package/bundles/errorCollect.umd.js.map +0 -1
- package/bundles/exception.umd.js +0 -150
- package/bundles/exception.umd.js.map +0 -1
- package/bundles/footerToolbar.umd.js +0 -401
- package/bundles/footerToolbar.umd.js.map +0 -1
- package/bundles/fullContent.umd.js +0 -550
- package/bundles/fullContent.umd.js.map +0 -1
- package/bundles/globalFooter.umd.js +0 -455
- package/bundles/globalFooter.umd.js.map +0 -1
- package/bundles/grid.umd.js +0 -470
- package/bundles/grid.umd.js.map +0 -1
- package/bundles/image.umd.js +0 -482
- package/bundles/image.umd.js.map +0 -1
- package/bundles/let.umd.js +0 -76
- package/bundles/let.umd.js.map +0 -1
- package/bundles/loading.umd.js +0 -181
- package/bundles/loading.umd.js.map +0 -1
- package/bundles/lodop.umd.js +0 -605
- package/bundles/lodop.umd.js.map +0 -1
- package/bundles/media.umd.js +0 -536
- package/bundles/media.umd.js.map +0 -1
- package/bundles/noticeIcon.umd.js +0 -468
- package/bundles/noticeIcon.umd.js.map +0 -1
- package/bundles/onboarding.umd.js +0 -370
- package/bundles/onboarding.umd.js.map +0 -1
- package/bundles/pageHeader.umd.js +0 -570
- package/bundles/pageHeader.umd.js.map +0 -1
- package/bundles/pdf.umd.js +0 -863
- package/bundles/pdf.umd.js.map +0 -1
- package/bundles/qr.umd.js +0 -491
- package/bundles/qr.umd.js.map +0 -1
- package/bundles/quickMenu.umd.js +0 -442
- package/bundles/quickMenu.umd.js.map +0 -1
- package/bundles/result.umd.js +0 -100
- package/bundles/result.umd.js.map +0 -1
- package/bundles/reuseTab.umd.js +0 -1522
- package/bundles/reuseTab.umd.js.map +0 -1
- package/bundles/table.umd.js +0 -2590
- package/bundles/table.umd.js.map +0 -1
- package/bundles/tagSelect.umd.js +0 -419
- package/bundles/tagSelect.umd.js.map +0 -1
- package/bundles/view.umd.js +0 -592
- package/bundles/view.umd.js.map +0 -1
- package/bundles/xlsx.umd.js +0 -529
- package/bundles/xlsx.umd.js.map +0 -1
- package/bundles/zip.umd.js +0 -482
- package/bundles/zip.umd.js.map +0 -1
- package/count-down/count-down.metadata.json +0 -1
- package/date-picker/datePicker.metadata.json +0 -1
- package/down-file/downFile.metadata.json +0 -1
- package/ellipsis/ellipsis.metadata.json +0 -1
- package/error-collect/errorCollect.metadata.json +0 -1
- package/esm2015/auto-focus/auto-focus.directive.js +0 -42
- package/esm2015/auto-focus/auto-focus.module.js +0 -12
- package/esm2015/avatar-list/avatar-list-item.component.js +0 -20
- package/esm2015/avatar-list/avatar-list.component.js +0 -89
- package/esm2015/avatar-list/avatar-list.module.js +0 -17
- package/esm2015/count-down/count-down.component.js +0 -36
- package/esm2015/count-down/count-down.module.js +0 -15
- package/esm2015/date-picker/date-picker.module.js +0 -17
- package/esm2015/date-picker/datePicker.js +0 -6
- package/esm2015/date-picker/range-shortcut.component.js +0 -26
- package/esm2015/date-picker/range.directive.js +0 -171
- package/esm2015/down-file/down-file.directive.js +0 -103
- package/esm2015/down-file/down-file.module.js +0 -15
- package/esm2015/ellipsis/ellipsis.component.js +0 -224
- package/esm2015/ellipsis/ellipsis.module.js +0 -16
- package/esm2015/error-collect/error-collect.component.js +0 -112
- package/esm2015/error-collect/error-collect.module.js +0 -15
- package/esm2015/exception/exception.component.js +0 -103
- package/esm2015/exception/exception.module.js +0 -18
- package/esm2015/footer-toolbar/footer-toolbar.component.js +0 -46
- package/esm2015/footer-toolbar/footer-toolbar.module.js +0 -16
- package/esm2015/full-content/full-content-toggle.directive.js +0 -23
- package/esm2015/full-content/full-content.component.js +0 -135
- package/esm2015/full-content/full-content.module.js +0 -15
- package/esm2015/full-content/full-content.service.js +0 -21
- package/esm2015/global-footer/global-footer-item.component.js +0 -24
- package/esm2015/global-footer/global-footer.component.js +0 -77
- package/esm2015/global-footer/global-footer.module.js +0 -16
- package/esm2015/image/image.directive.js +0 -133
- package/esm2015/image/image.module.js +0 -15
- package/esm2015/let/let.directive.js +0 -31
- package/esm2015/let/let.module.js +0 -12
- package/esm2015/loading/loading.component.js +0 -26
- package/esm2015/loading/loading.module.js +0 -19
- package/esm2015/loading/loading.service.js +0 -92
- package/esm2015/lodop/lodop.module.js +0 -7
- package/esm2015/lodop/lodop.service.js +0 -219
- package/esm2015/lodop/lodop.types.js +0 -2
- package/esm2015/media/media.component.js +0 -104
- package/esm2015/media/media.module.js +0 -14
- package/esm2015/media/media.service.js +0 -53
- package/esm2015/notice-icon/notice-icon-tab.component.js +0 -30
- package/esm2015/notice-icon/notice-icon.component.js +0 -74
- package/esm2015/notice-icon/notice-icon.module.js +0 -35
- package/esm2015/onboarding/onboarding.component.js +0 -130
- package/esm2015/onboarding/onboarding.module.js +0 -20
- package/esm2015/onboarding/onboarding.service.js +0 -178
- package/esm2015/page-header/page-header.component.js +0 -216
- package/esm2015/page-header/page-header.module.js +0 -19
- package/esm2015/pdf/pdf.component.js +0 -433
- package/esm2015/pdf/pdf.module.js +0 -15
- package/esm2015/qr/qr.component.js +0 -128
- package/esm2015/qr/qr.module.js +0 -14
- package/esm2015/quick-menu/quick-menu.component.js +0 -90
- package/esm2015/quick-menu/quick-menu.module.js +0 -16
- package/esm2015/result/result.component.js +0 -62
- package/esm2015/result/result.module.js +0 -16
- package/esm2015/reuse-tab/reuse-tab-context-menu.component.js +0 -74
- package/esm2015/reuse-tab/reuse-tab-context.component.js +0 -32
- package/esm2015/reuse-tab/reuse-tab-context.directive.js +0 -33
- package/esm2015/reuse-tab/reuse-tab-context.service.js +0 -53
- package/esm2015/reuse-tab/reuse-tab.component.js +0 -300
- package/esm2015/reuse-tab/reuse-tab.module.js +0 -24
- package/esm2015/reuse-tab/reuse-tab.service.js +0 -534
- package/esm2015/se/public_api.js +0 -6
- package/esm2015/se/se-container.component.js +0 -115
- package/esm2015/se/se-title.component.js +0 -40
- package/esm2015/se/se.component.js +0 -214
- package/esm2015/se/se.module.js +0 -19
- package/esm2015/sg/sg-container.component.js +0 -49
- package/esm2015/sg/sg.component.js +0 -65
- package/esm2015/sg/sg.module.js +0 -15
- package/esm2015/st/st-column-source.js +0 -428
- package/esm2015/st/st-data-source.js +0 -429
- package/esm2015/st/st-export.js +0 -90
- package/esm2015/st/st-filter.component.js +0 -149
- package/esm2015/st/st-row.directive.js +0 -40
- package/esm2015/st/st-td.component.js +0 -232
- package/esm2015/st/st-widget-host.directive.js +0 -34
- package/esm2015/st/st-widget.js +0 -24
- package/esm2015/st/st.component.js +0 -788
- package/esm2015/st/st.interfaces.js +0 -2
- package/esm2015/st/st.module.js +0 -56
- package/esm2015/st/table.js +0 -8
- package/esm2015/sv/public_api.js +0 -6
- package/esm2015/sv/sv-container.component.js +0 -63
- package/esm2015/sv/sv-title.component.js +0 -40
- package/esm2015/sv/sv-value.component.js +0 -32
- package/esm2015/sv/sv.component.js +0 -105
- package/esm2015/sv/sv.module.js +0 -21
- package/esm2015/tag-select/tag-select.component.js +0 -70
- package/esm2015/tag-select/tag-select.module.js +0 -16
- package/esm2015/xlsx/xlsx.directive.js +0 -26
- package/esm2015/xlsx/xlsx.module.js +0 -14
- package/esm2015/xlsx/xlsx.service.js +0 -129
- package/esm2015/zip/zip.module.js +0 -10
- package/esm2015/zip/zip.service.js +0 -115
- package/exception/exception.metadata.json +0 -1
- package/fesm2015/abc.js.map +0 -1
- package/fesm2015/autoFocus.js +0 -59
- package/fesm2015/autoFocus.js.map +0 -1
- package/fesm2015/avatarList.js +0 -128
- package/fesm2015/avatarList.js.map +0 -1
- package/fesm2015/count-down.js +0 -56
- package/fesm2015/count-down.js.map +0 -1
- package/fesm2015/datePicker.js.map +0 -1
- package/fesm2015/downFile.js +0 -122
- package/fesm2015/downFile.js.map +0 -1
- package/fesm2015/edit.js +0 -396
- package/fesm2015/edit.js.map +0 -1
- package/fesm2015/ellipsis.js +0 -244
- package/fesm2015/ellipsis.js.map +0 -1
- package/fesm2015/errorCollect.js +0 -131
- package/fesm2015/errorCollect.js.map +0 -1
- package/fesm2015/exception.js +0 -125
- package/fesm2015/exception.js.map +0 -1
- package/fesm2015/footerToolbar.js +0 -66
- package/fesm2015/footerToolbar.js.map +0 -1
- package/fesm2015/fullContent.js +0 -191
- package/fesm2015/fullContent.js.map +0 -1
- package/fesm2015/globalFooter.js +0 -118
- package/fesm2015/globalFooter.js.map +0 -1
- package/fesm2015/grid.js +0 -129
- package/fesm2015/grid.js.map +0 -1
- package/fesm2015/image.js +0 -152
- package/fesm2015/image.js.map +0 -1
- package/fesm2015/let.js +0 -48
- package/fesm2015/let.js.map +0 -1
- package/fesm2015/loading.js +0 -138
- package/fesm2015/loading.js.map +0 -1
- package/fesm2015/lodop.js.map +0 -1
- package/fesm2015/media.js +0 -174
- package/fesm2015/media.js.map +0 -1
- package/fesm2015/noticeIcon.js +0 -141
- package/fesm2015/noticeIcon.js.map +0 -1
- package/fesm2015/onboarding.js +0 -328
- package/fesm2015/onboarding.js.map +0 -1
- package/fesm2015/pageHeader.js +0 -239
- package/fesm2015/pageHeader.js.map +0 -1
- package/fesm2015/pdf.js.map +0 -1
- package/fesm2015/qr.js +0 -159
- package/fesm2015/qr.js.map +0 -1
- package/fesm2015/quickMenu.js +0 -111
- package/fesm2015/quickMenu.js.map +0 -1
- package/fesm2015/result.js +0 -83
- package/fesm2015/result.js.map +0 -1
- package/fesm2015/reuseTab.js.map +0 -1
- package/fesm2015/table.js.map +0 -1
- package/fesm2015/tagSelect.js +0 -90
- package/fesm2015/tagSelect.js.map +0 -1
- package/fesm2015/view.js +0 -256
- package/fesm2015/view.js.map +0 -1
- package/fesm2015/xlsx.js.map +0 -1
- package/fesm2015/zip.js.map +0 -1
- package/footer-toolbar/footerToolbar.metadata.json +0 -1
- package/full-content/fullContent.metadata.json +0 -1
- package/global-footer/globalFooter.metadata.json +0 -1
- package/image/image.metadata.json +0 -1
- package/let/let.metadata.json +0 -1
- package/loading/loading.metadata.json +0 -1
- package/lodop/lodop.metadata.json +0 -1
- package/media/media.metadata.json +0 -1
- package/notice-icon/noticeIcon.metadata.json +0 -1
- package/onboarding/onboarding.metadata.json +0 -1
- package/page-header/pageHeader.metadata.json +0 -1
- package/pdf/pdf.metadata.json +0 -1
- package/qr/qr.metadata.json +0 -1
- package/quick-menu/quickMenu.metadata.json +0 -1
- package/result/result.metadata.json +0 -1
- package/reuse-tab/reuseTab.metadata.json +0 -1
- package/se/edit.metadata.json +0 -1
- package/se/se-title.component.d.ts +0 -10
- package/sg/grid.metadata.json +0 -1
- package/st/st-td.component.d.ts +0 -27
- package/st/table.metadata.json +0 -1
- package/sv/sv-title.component.d.ts +0 -10
- package/sv/view.metadata.json +0 -1
- package/tag-select/tagSelect.metadata.json +0 -1
- package/xlsx/xlsx.metadata.json +0 -1
- package/zip/zip.metadata.json +0 -1
package/bundles/reuseTab.umd.js
DELETED
|
@@ -1,1522 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license ng-alain(cipchk@qq.com) v12.4.2
|
|
3
|
-
* (c) 2020 cipchk https://ng-alain.com/
|
|
4
|
-
* License: MIT
|
|
5
|
-
*/
|
|
6
|
-
(function (global, factory) {
|
|
7
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@delon/theme'), require('rxjs'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/cdk/platform'), require('@angular/common'), require('@angular/router'), require('rxjs/operators'), require('@delon/util/decorator'), require('@delon/util/browser'), require('ng-zorro-antd/icon'), require('ng-zorro-antd/menu'), require('ng-zorro-antd/tabs')) :
|
|
8
|
-
typeof define === 'function' && define.amd ? define('@delon/abc/reuse-tab', ['exports', '@angular/core', '@delon/theme', 'rxjs', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/cdk/platform', '@angular/common', '@angular/router', 'rxjs/operators', '@delon/util/decorator', '@delon/util/browser', 'ng-zorro-antd/icon', 'ng-zorro-antd/menu', 'ng-zorro-antd/tabs'], factory) :
|
|
9
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.delon = global.delon || {}, global.delon.abc = global.delon.abc || {}, global.delon.abc["reuse-tab"] = {}), global.ng.core, global.delon.theme, global.rxjs, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.cdk.platform, global.ng.common, global.ng.router, global.rxjs.operators, global.decorator, global.browser, global["ng-zorro-antd/icon"], global["ng-zorro-antd/menu"], global["ng-zorro-antd/tabs"]));
|
|
10
|
-
})(this, (function (exports, i0, i1, rxjs, overlay, portal, platform, common, router, operators, decorator, browser, icon, menu, tabs) { 'use strict';
|
|
11
|
-
|
|
12
|
-
function _interopNamespace(e) {
|
|
13
|
-
if (e && e.__esModule) return e;
|
|
14
|
-
var n = Object.create(null);
|
|
15
|
-
if (e) {
|
|
16
|
-
Object.keys(e).forEach(function (k) {
|
|
17
|
-
if (k !== 'default') {
|
|
18
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () { return e[k]; }
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
n["default"] = e;
|
|
27
|
-
return Object.freeze(n);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
31
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
32
|
-
|
|
33
|
-
var ReuseTabContextMenuComponent = /** @class */ (function () {
|
|
34
|
-
function ReuseTabContextMenuComponent(i18nSrv) {
|
|
35
|
-
this.i18nSrv = i18nSrv;
|
|
36
|
-
this.close = new i0.EventEmitter();
|
|
37
|
-
}
|
|
38
|
-
Object.defineProperty(ReuseTabContextMenuComponent.prototype, "i18n", {
|
|
39
|
-
get: function () {
|
|
40
|
-
return this._i18n;
|
|
41
|
-
},
|
|
42
|
-
set: function (value) {
|
|
43
|
-
this._i18n = Object.assign(Object.assign({}, this.i18nSrv.getData('reuseTab')), value);
|
|
44
|
-
},
|
|
45
|
-
enumerable: false,
|
|
46
|
-
configurable: true
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(ReuseTabContextMenuComponent.prototype, "includeNonCloseable", {
|
|
49
|
-
get: function () {
|
|
50
|
-
return this.event.ctrlKey;
|
|
51
|
-
},
|
|
52
|
-
enumerable: false,
|
|
53
|
-
configurable: true
|
|
54
|
-
});
|
|
55
|
-
ReuseTabContextMenuComponent.prototype.notify = function (type) {
|
|
56
|
-
this.close.next({
|
|
57
|
-
type: type,
|
|
58
|
-
item: this.item,
|
|
59
|
-
includeNonCloseable: this.includeNonCloseable
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
ReuseTabContextMenuComponent.prototype.ngOnInit = function () {
|
|
63
|
-
if (this.includeNonCloseable)
|
|
64
|
-
this.item.closable = true;
|
|
65
|
-
};
|
|
66
|
-
ReuseTabContextMenuComponent.prototype.click = function (e, type, custom) {
|
|
67
|
-
e.preventDefault();
|
|
68
|
-
e.stopPropagation();
|
|
69
|
-
if (type === 'close' && !this.item.closable)
|
|
70
|
-
return;
|
|
71
|
-
if (type === 'closeRight' && this.item.last)
|
|
72
|
-
return;
|
|
73
|
-
if (custom) {
|
|
74
|
-
if (this.isDisabled(custom))
|
|
75
|
-
return;
|
|
76
|
-
custom.fn(this.item, custom);
|
|
77
|
-
}
|
|
78
|
-
this.notify(type);
|
|
79
|
-
};
|
|
80
|
-
ReuseTabContextMenuComponent.prototype.isDisabled = function (custom) {
|
|
81
|
-
return custom.disabled ? custom.disabled(this.item) : false;
|
|
82
|
-
};
|
|
83
|
-
ReuseTabContextMenuComponent.prototype.closeMenu = function (event) {
|
|
84
|
-
if (event.type === 'click' && event.button === 2)
|
|
85
|
-
return;
|
|
86
|
-
this.notify(null);
|
|
87
|
-
};
|
|
88
|
-
return ReuseTabContextMenuComponent;
|
|
89
|
-
}());
|
|
90
|
-
ReuseTabContextMenuComponent.decorators = [
|
|
91
|
-
{ type: i0.Component, args: [{
|
|
92
|
-
selector: 'reuse-tab-context-menu',
|
|
93
|
-
template: "<ul nz-menu>\n <li\n *ngIf=\"item.active\"\n nz-menu-item\n (click)=\"click($event, 'refresh')\"\n data-type=\"refresh\"\n [innerHTML]=\"i18n.refresh\"\n ></li>\n <li\n nz-menu-item\n (click)=\"click($event, 'close')\"\n data-type=\"close\"\n [nzDisabled]=\"!item.closable\"\n [innerHTML]=\"i18n.close\"\n ></li>\n <li nz-menu-item (click)=\"click($event, 'closeOther')\" data-type=\"closeOther\" [innerHTML]=\"i18n.closeOther\"></li>\n <li\n nz-menu-item\n (click)=\"click($event, 'closeRight')\"\n data-type=\"closeRight\"\n [nzDisabled]=\"item.last\"\n [innerHTML]=\"i18n.closeRight\"\n ></li>\n <ng-container *ngIf=\"customContextMenu!.length > 0\">\n <li nz-menu-divider></li>\n <li\n *ngFor=\"let i of customContextMenu\"\n nz-menu-item\n [attr.data-type]=\"i.id\"\n [nzDisabled]=\"isDisabled(i)\"\n (click)=\"click($event, 'custom', i)\"\n [innerHTML]=\"i.title\"\n ></li>\n </ng-container>\n</ul>\n",
|
|
94
|
-
host: {
|
|
95
|
-
'(document:click)': 'closeMenu($event)',
|
|
96
|
-
'(document:contextmenu)': 'closeMenu($event)'
|
|
97
|
-
},
|
|
98
|
-
preserveWhitespaces: false,
|
|
99
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
100
|
-
encapsulation: i0.ViewEncapsulation.None
|
|
101
|
-
},] }
|
|
102
|
-
];
|
|
103
|
-
ReuseTabContextMenuComponent.ctorParameters = function () { return [
|
|
104
|
-
{ type: i1.DelonLocaleService }
|
|
105
|
-
]; };
|
|
106
|
-
ReuseTabContextMenuComponent.propDecorators = {
|
|
107
|
-
i18n: [{ type: i0.Input }],
|
|
108
|
-
item: [{ type: i0.Input }],
|
|
109
|
-
event: [{ type: i0.Input }],
|
|
110
|
-
customContextMenu: [{ type: i0.Input }],
|
|
111
|
-
close: [{ type: i0.Output }]
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var ReuseTabContextService = /** @class */ (function () {
|
|
115
|
-
function ReuseTabContextService(overlay) {
|
|
116
|
-
this.overlay = overlay;
|
|
117
|
-
this.show = new rxjs.Subject();
|
|
118
|
-
this.close = new rxjs.Subject();
|
|
119
|
-
}
|
|
120
|
-
ReuseTabContextService.prototype.remove = function () {
|
|
121
|
-
if (!this.ref)
|
|
122
|
-
return;
|
|
123
|
-
this.ref.detach();
|
|
124
|
-
this.ref.dispose();
|
|
125
|
-
this.ref = null;
|
|
126
|
-
};
|
|
127
|
-
ReuseTabContextService.prototype.open = function (context) {
|
|
128
|
-
var _this = this;
|
|
129
|
-
this.remove();
|
|
130
|
-
var event = context.event, item = context.item, customContextMenu = context.customContextMenu;
|
|
131
|
-
var x = event.x, y = event.y;
|
|
132
|
-
var positions = [
|
|
133
|
-
new overlay.ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }),
|
|
134
|
-
new overlay.ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' })
|
|
135
|
-
];
|
|
136
|
-
var positionStrategy = this.overlay.position().flexibleConnectedTo({ x: x, y: y }).withPositions(positions);
|
|
137
|
-
this.ref = this.overlay.create({
|
|
138
|
-
positionStrategy: positionStrategy,
|
|
139
|
-
panelClass: 'reuse-tab__cm',
|
|
140
|
-
scrollStrategy: this.overlay.scrollStrategies.close()
|
|
141
|
-
});
|
|
142
|
-
var comp = this.ref.attach(new portal.ComponentPortal(ReuseTabContextMenuComponent));
|
|
143
|
-
var instance = comp.instance;
|
|
144
|
-
instance.i18n = this.i18n;
|
|
145
|
-
instance.item = Object.assign({}, item);
|
|
146
|
-
instance.customContextMenu = customContextMenu;
|
|
147
|
-
instance.event = event;
|
|
148
|
-
var sub$ = new rxjs.Subscription();
|
|
149
|
-
sub$.add(instance.close.subscribe(function (res) {
|
|
150
|
-
_this.close.next(res);
|
|
151
|
-
_this.remove();
|
|
152
|
-
}));
|
|
153
|
-
comp.onDestroy(function () { return sub$.unsubscribe(); });
|
|
154
|
-
};
|
|
155
|
-
return ReuseTabContextService;
|
|
156
|
-
}());
|
|
157
|
-
ReuseTabContextService.decorators = [
|
|
158
|
-
{ type: i0.Injectable }
|
|
159
|
-
];
|
|
160
|
-
ReuseTabContextService.ctorParameters = function () { return [
|
|
161
|
-
{ type: overlay.Overlay }
|
|
162
|
-
]; };
|
|
163
|
-
|
|
164
|
-
var ReuseTabContextComponent = /** @class */ (function () {
|
|
165
|
-
function ReuseTabContextComponent(srv) {
|
|
166
|
-
var _this = this;
|
|
167
|
-
this.srv = srv;
|
|
168
|
-
this.sub$ = new rxjs.Subscription();
|
|
169
|
-
this.change = new i0.EventEmitter();
|
|
170
|
-
this.sub$.add(srv.show.subscribe(function (context) { return _this.srv.open(context); }));
|
|
171
|
-
this.sub$.add(srv.close.subscribe(function (res) { return _this.change.emit(res); }));
|
|
172
|
-
}
|
|
173
|
-
Object.defineProperty(ReuseTabContextComponent.prototype, "i18n", {
|
|
174
|
-
set: function (value) {
|
|
175
|
-
this.srv.i18n = value;
|
|
176
|
-
},
|
|
177
|
-
enumerable: false,
|
|
178
|
-
configurable: true
|
|
179
|
-
});
|
|
180
|
-
ReuseTabContextComponent.prototype.ngOnDestroy = function () {
|
|
181
|
-
this.sub$.unsubscribe();
|
|
182
|
-
};
|
|
183
|
-
return ReuseTabContextComponent;
|
|
184
|
-
}());
|
|
185
|
-
ReuseTabContextComponent.decorators = [
|
|
186
|
-
{ type: i0.Component, args: [{
|
|
187
|
-
selector: 'reuse-tab-context',
|
|
188
|
-
template: ""
|
|
189
|
-
},] }
|
|
190
|
-
];
|
|
191
|
-
ReuseTabContextComponent.ctorParameters = function () { return [
|
|
192
|
-
{ type: ReuseTabContextService }
|
|
193
|
-
]; };
|
|
194
|
-
ReuseTabContextComponent.propDecorators = {
|
|
195
|
-
i18n: [{ type: i0.Input }],
|
|
196
|
-
change: [{ type: i0.Output }]
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
var ReuseTabContextDirective = /** @class */ (function () {
|
|
200
|
-
function ReuseTabContextDirective(srv) {
|
|
201
|
-
this.srv = srv;
|
|
202
|
-
}
|
|
203
|
-
ReuseTabContextDirective.prototype._onContextMenu = function (event) {
|
|
204
|
-
this.srv.show.next({
|
|
205
|
-
event: event,
|
|
206
|
-
item: this.item,
|
|
207
|
-
customContextMenu: this.customContextMenu
|
|
208
|
-
});
|
|
209
|
-
event.preventDefault();
|
|
210
|
-
event.stopPropagation();
|
|
211
|
-
};
|
|
212
|
-
return ReuseTabContextDirective;
|
|
213
|
-
}());
|
|
214
|
-
ReuseTabContextDirective.decorators = [
|
|
215
|
-
{ type: i0.Directive, args: [{
|
|
216
|
-
selector: '[reuse-tab-context-menu]',
|
|
217
|
-
exportAs: 'reuseTabContextMenu',
|
|
218
|
-
host: {
|
|
219
|
-
'(contextmenu)': '_onContextMenu($event)'
|
|
220
|
-
}
|
|
221
|
-
},] }
|
|
222
|
-
];
|
|
223
|
-
ReuseTabContextDirective.ctorParameters = function () { return [
|
|
224
|
-
{ type: ReuseTabContextService }
|
|
225
|
-
]; };
|
|
226
|
-
ReuseTabContextDirective.propDecorators = {
|
|
227
|
-
item: [{ type: i0.Input, args: ['reuse-tab-context-menu',] }],
|
|
228
|
-
customContextMenu: [{ type: i0.Input }]
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
/*! *****************************************************************************
|
|
232
|
-
Copyright (c) Microsoft Corporation.
|
|
233
|
-
|
|
234
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
235
|
-
purpose with or without fee is hereby granted.
|
|
236
|
-
|
|
237
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
238
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
239
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
240
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
241
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
242
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
243
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
244
|
-
***************************************************************************** */
|
|
245
|
-
/* global Reflect, Promise */
|
|
246
|
-
var extendStatics = function (d, b) {
|
|
247
|
-
extendStatics = Object.setPrototypeOf ||
|
|
248
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
249
|
-
function (d, b) { for (var p in b)
|
|
250
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
251
|
-
d[p] = b[p]; };
|
|
252
|
-
return extendStatics(d, b);
|
|
253
|
-
};
|
|
254
|
-
function __extends(d, b) {
|
|
255
|
-
if (typeof b !== "function" && b !== null)
|
|
256
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
257
|
-
extendStatics(d, b);
|
|
258
|
-
function __() { this.constructor = d; }
|
|
259
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
260
|
-
}
|
|
261
|
-
var __assign = function () {
|
|
262
|
-
__assign = Object.assign || function __assign(t) {
|
|
263
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
264
|
-
s = arguments[i];
|
|
265
|
-
for (var p in s)
|
|
266
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
267
|
-
t[p] = s[p];
|
|
268
|
-
}
|
|
269
|
-
return t;
|
|
270
|
-
};
|
|
271
|
-
return __assign.apply(this, arguments);
|
|
272
|
-
};
|
|
273
|
-
function __rest(s, e) {
|
|
274
|
-
var t = {};
|
|
275
|
-
for (var p in s)
|
|
276
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
277
|
-
t[p] = s[p];
|
|
278
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
279
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
280
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
281
|
-
t[p[i]] = s[p[i]];
|
|
282
|
-
}
|
|
283
|
-
return t;
|
|
284
|
-
}
|
|
285
|
-
function __decorate(decorators, target, key, desc) {
|
|
286
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
287
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
288
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
289
|
-
else
|
|
290
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
291
|
-
if (d = decorators[i])
|
|
292
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
293
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
294
|
-
}
|
|
295
|
-
function __param(paramIndex, decorator) {
|
|
296
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
297
|
-
}
|
|
298
|
-
function __metadata(metadataKey, metadataValue) {
|
|
299
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
300
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
301
|
-
}
|
|
302
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
303
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
304
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
305
|
-
function fulfilled(value) { try {
|
|
306
|
-
step(generator.next(value));
|
|
307
|
-
}
|
|
308
|
-
catch (e) {
|
|
309
|
-
reject(e);
|
|
310
|
-
} }
|
|
311
|
-
function rejected(value) { try {
|
|
312
|
-
step(generator["throw"](value));
|
|
313
|
-
}
|
|
314
|
-
catch (e) {
|
|
315
|
-
reject(e);
|
|
316
|
-
} }
|
|
317
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
318
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
function __generator(thisArg, body) {
|
|
322
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
323
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
324
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
325
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
326
|
-
function step(op) {
|
|
327
|
-
if (f)
|
|
328
|
-
throw new TypeError("Generator is already executing.");
|
|
329
|
-
while (_)
|
|
330
|
-
try {
|
|
331
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
332
|
-
return t;
|
|
333
|
-
if (y = 0, t)
|
|
334
|
-
op = [op[0] & 2, t.value];
|
|
335
|
-
switch (op[0]) {
|
|
336
|
-
case 0:
|
|
337
|
-
case 1:
|
|
338
|
-
t = op;
|
|
339
|
-
break;
|
|
340
|
-
case 4:
|
|
341
|
-
_.label++;
|
|
342
|
-
return { value: op[1], done: false };
|
|
343
|
-
case 5:
|
|
344
|
-
_.label++;
|
|
345
|
-
y = op[1];
|
|
346
|
-
op = [0];
|
|
347
|
-
continue;
|
|
348
|
-
case 7:
|
|
349
|
-
op = _.ops.pop();
|
|
350
|
-
_.trys.pop();
|
|
351
|
-
continue;
|
|
352
|
-
default:
|
|
353
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
354
|
-
_ = 0;
|
|
355
|
-
continue;
|
|
356
|
-
}
|
|
357
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
358
|
-
_.label = op[1];
|
|
359
|
-
break;
|
|
360
|
-
}
|
|
361
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
362
|
-
_.label = t[1];
|
|
363
|
-
t = op;
|
|
364
|
-
break;
|
|
365
|
-
}
|
|
366
|
-
if (t && _.label < t[2]) {
|
|
367
|
-
_.label = t[2];
|
|
368
|
-
_.ops.push(op);
|
|
369
|
-
break;
|
|
370
|
-
}
|
|
371
|
-
if (t[2])
|
|
372
|
-
_.ops.pop();
|
|
373
|
-
_.trys.pop();
|
|
374
|
-
continue;
|
|
375
|
-
}
|
|
376
|
-
op = body.call(thisArg, _);
|
|
377
|
-
}
|
|
378
|
-
catch (e) {
|
|
379
|
-
op = [6, e];
|
|
380
|
-
y = 0;
|
|
381
|
-
}
|
|
382
|
-
finally {
|
|
383
|
-
f = t = 0;
|
|
384
|
-
}
|
|
385
|
-
if (op[0] & 5)
|
|
386
|
-
throw op[1];
|
|
387
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
391
|
-
if (k2 === undefined)
|
|
392
|
-
k2 = k;
|
|
393
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
394
|
-
}) : (function (o, m, k, k2) {
|
|
395
|
-
if (k2 === undefined)
|
|
396
|
-
k2 = k;
|
|
397
|
-
o[k2] = m[k];
|
|
398
|
-
});
|
|
399
|
-
function __exportStar(m, o) {
|
|
400
|
-
for (var p in m)
|
|
401
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
402
|
-
__createBinding(o, m, p);
|
|
403
|
-
}
|
|
404
|
-
function __values(o) {
|
|
405
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
406
|
-
if (m)
|
|
407
|
-
return m.call(o);
|
|
408
|
-
if (o && typeof o.length === "number")
|
|
409
|
-
return {
|
|
410
|
-
next: function () {
|
|
411
|
-
if (o && i >= o.length)
|
|
412
|
-
o = void 0;
|
|
413
|
-
return { value: o && o[i++], done: !o };
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
417
|
-
}
|
|
418
|
-
function __read(o, n) {
|
|
419
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
420
|
-
if (!m)
|
|
421
|
-
return o;
|
|
422
|
-
var i = m.call(o), r, ar = [], e;
|
|
423
|
-
try {
|
|
424
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
425
|
-
ar.push(r.value);
|
|
426
|
-
}
|
|
427
|
-
catch (error) {
|
|
428
|
-
e = { error: error };
|
|
429
|
-
}
|
|
430
|
-
finally {
|
|
431
|
-
try {
|
|
432
|
-
if (r && !r.done && (m = i["return"]))
|
|
433
|
-
m.call(i);
|
|
434
|
-
}
|
|
435
|
-
finally {
|
|
436
|
-
if (e)
|
|
437
|
-
throw e.error;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
return ar;
|
|
441
|
-
}
|
|
442
|
-
/** @deprecated */
|
|
443
|
-
function __spread() {
|
|
444
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
445
|
-
ar = ar.concat(__read(arguments[i]));
|
|
446
|
-
return ar;
|
|
447
|
-
}
|
|
448
|
-
/** @deprecated */
|
|
449
|
-
function __spreadArrays() {
|
|
450
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
451
|
-
s += arguments[i].length;
|
|
452
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
453
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
454
|
-
r[k] = a[j];
|
|
455
|
-
return r;
|
|
456
|
-
}
|
|
457
|
-
function __spreadArray(to, from, pack) {
|
|
458
|
-
if (pack || arguments.length === 2)
|
|
459
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
460
|
-
if (ar || !(i in from)) {
|
|
461
|
-
if (!ar)
|
|
462
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
463
|
-
ar[i] = from[i];
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
467
|
-
}
|
|
468
|
-
function __await(v) {
|
|
469
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
470
|
-
}
|
|
471
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
472
|
-
if (!Symbol.asyncIterator)
|
|
473
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
474
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
475
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
476
|
-
function verb(n) { if (g[n])
|
|
477
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
478
|
-
function resume(n, v) { try {
|
|
479
|
-
step(g[n](v));
|
|
480
|
-
}
|
|
481
|
-
catch (e) {
|
|
482
|
-
settle(q[0][3], e);
|
|
483
|
-
} }
|
|
484
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
485
|
-
function fulfill(value) { resume("next", value); }
|
|
486
|
-
function reject(value) { resume("throw", value); }
|
|
487
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
488
|
-
resume(q[0][0], q[0][1]); }
|
|
489
|
-
}
|
|
490
|
-
function __asyncDelegator(o) {
|
|
491
|
-
var i, p;
|
|
492
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
493
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
494
|
-
}
|
|
495
|
-
function __asyncValues(o) {
|
|
496
|
-
if (!Symbol.asyncIterator)
|
|
497
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
498
|
-
var m = o[Symbol.asyncIterator], i;
|
|
499
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
500
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
501
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
502
|
-
}
|
|
503
|
-
function __makeTemplateObject(cooked, raw) {
|
|
504
|
-
if (Object.defineProperty) {
|
|
505
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
506
|
-
}
|
|
507
|
-
else {
|
|
508
|
-
cooked.raw = raw;
|
|
509
|
-
}
|
|
510
|
-
return cooked;
|
|
511
|
-
}
|
|
512
|
-
;
|
|
513
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
514
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
515
|
-
}) : function (o, v) {
|
|
516
|
-
o["default"] = v;
|
|
517
|
-
};
|
|
518
|
-
function __importStar(mod) {
|
|
519
|
-
if (mod && mod.__esModule)
|
|
520
|
-
return mod;
|
|
521
|
-
var result = {};
|
|
522
|
-
if (mod != null)
|
|
523
|
-
for (var k in mod)
|
|
524
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
525
|
-
__createBinding(result, mod, k);
|
|
526
|
-
__setModuleDefault(result, mod);
|
|
527
|
-
return result;
|
|
528
|
-
}
|
|
529
|
-
function __importDefault(mod) {
|
|
530
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
531
|
-
}
|
|
532
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
533
|
-
if (kind === "a" && !f)
|
|
534
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
535
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
536
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
537
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
538
|
-
}
|
|
539
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
540
|
-
if (kind === "m")
|
|
541
|
-
throw new TypeError("Private method is not writable");
|
|
542
|
-
if (kind === "a" && !f)
|
|
543
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
544
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
545
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
546
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* 复用匹配模式
|
|
551
|
-
*/
|
|
552
|
-
exports.ReuseTabMatchMode = void 0;
|
|
553
|
-
(function (ReuseTabMatchMode) {
|
|
554
|
-
/**
|
|
555
|
-
* (推荐)按菜单 `Menu` 配置
|
|
556
|
-
*
|
|
557
|
-
* 可复用:
|
|
558
|
-
* - `{ text:'Dashboard' }`
|
|
559
|
-
* - `{ text:'Dashboard', reuse: true }`
|
|
560
|
-
*
|
|
561
|
-
* 不可复用:
|
|
562
|
-
* - `{ text:'Dashboard', reuse: false }`
|
|
563
|
-
*/
|
|
564
|
-
ReuseTabMatchMode[ReuseTabMatchMode["Menu"] = 0] = "Menu";
|
|
565
|
-
/**
|
|
566
|
-
* 按菜单 `Menu` 强制配置
|
|
567
|
-
*
|
|
568
|
-
* 可复用:
|
|
569
|
-
* - `{ text:'Dashboard', reuse: true }`
|
|
570
|
-
*
|
|
571
|
-
* 不可复用:
|
|
572
|
-
* - `{ text:'Dashboard' }`
|
|
573
|
-
* - `{ text:'Dashboard', reuse: false }`
|
|
574
|
-
*/
|
|
575
|
-
ReuseTabMatchMode[ReuseTabMatchMode["MenuForce"] = 1] = "MenuForce";
|
|
576
|
-
/**
|
|
577
|
-
* 对所有路由有效,可以配合 `excludes` 过滤无须复用路由
|
|
578
|
-
*/
|
|
579
|
-
ReuseTabMatchMode[ReuseTabMatchMode["URL"] = 2] = "URL";
|
|
580
|
-
})(exports.ReuseTabMatchMode || (exports.ReuseTabMatchMode = {}));
|
|
581
|
-
|
|
582
|
-
var ReuseTabService = /** @class */ (function () {
|
|
583
|
-
// #endregion
|
|
584
|
-
function ReuseTabService(injector, menuService) {
|
|
585
|
-
this.injector = injector;
|
|
586
|
-
this.menuService = menuService;
|
|
587
|
-
this._inited = false;
|
|
588
|
-
this._max = 10;
|
|
589
|
-
this._keepingScroll = false;
|
|
590
|
-
this._cachedChange = new rxjs.BehaviorSubject(null);
|
|
591
|
-
this._cached = [];
|
|
592
|
-
this._titleCached = {};
|
|
593
|
-
this._closableCached = {};
|
|
594
|
-
this.positionBuffer = {};
|
|
595
|
-
this.debug = false;
|
|
596
|
-
this.routeParamMatchMode = 'strict';
|
|
597
|
-
this.mode = exports.ReuseTabMatchMode.Menu;
|
|
598
|
-
/** 排除规则,限 `mode=URL` */
|
|
599
|
-
this.excludes = [];
|
|
600
|
-
}
|
|
601
|
-
Object.defineProperty(ReuseTabService.prototype, "snapshot", {
|
|
602
|
-
get: function () {
|
|
603
|
-
return this.injector.get(router.ActivatedRoute).snapshot;
|
|
604
|
-
},
|
|
605
|
-
enumerable: false,
|
|
606
|
-
configurable: true
|
|
607
|
-
});
|
|
608
|
-
Object.defineProperty(ReuseTabService.prototype, "inited", {
|
|
609
|
-
// #region public
|
|
610
|
-
/**
|
|
611
|
-
* Get init status
|
|
612
|
-
*
|
|
613
|
-
* 是否已经初始化完成
|
|
614
|
-
*/
|
|
615
|
-
get: function () {
|
|
616
|
-
return this._inited;
|
|
617
|
-
},
|
|
618
|
-
enumerable: false,
|
|
619
|
-
configurable: true
|
|
620
|
-
});
|
|
621
|
-
Object.defineProperty(ReuseTabService.prototype, "curUrl", {
|
|
622
|
-
/**
|
|
623
|
-
* Current routing address
|
|
624
|
-
*
|
|
625
|
-
* 当前路由地址
|
|
626
|
-
*/
|
|
627
|
-
get: function () {
|
|
628
|
-
return this.getUrl(this.snapshot);
|
|
629
|
-
},
|
|
630
|
-
enumerable: false,
|
|
631
|
-
configurable: true
|
|
632
|
-
});
|
|
633
|
-
Object.defineProperty(ReuseTabService.prototype, "max", {
|
|
634
|
-
/**
|
|
635
|
-
* 允许最多复用多少个页面,取值范围 `2-100`,值发生变更时会强制关闭且忽略可关闭条件
|
|
636
|
-
*/
|
|
637
|
-
set: function (value) {
|
|
638
|
-
this._max = Math.min(Math.max(value, 2), 100);
|
|
639
|
-
for (var i = this._cached.length; i > this._max; i--) {
|
|
640
|
-
this._cached.pop();
|
|
641
|
-
}
|
|
642
|
-
},
|
|
643
|
-
enumerable: false,
|
|
644
|
-
configurable: true
|
|
645
|
-
});
|
|
646
|
-
Object.defineProperty(ReuseTabService.prototype, "keepingScroll", {
|
|
647
|
-
get: function () {
|
|
648
|
-
return this._keepingScroll;
|
|
649
|
-
},
|
|
650
|
-
set: function (value) {
|
|
651
|
-
this._keepingScroll = value;
|
|
652
|
-
this.initScroll();
|
|
653
|
-
},
|
|
654
|
-
enumerable: false,
|
|
655
|
-
configurable: true
|
|
656
|
-
});
|
|
657
|
-
Object.defineProperty(ReuseTabService.prototype, "items", {
|
|
658
|
-
/** 获取已缓存的路由 */
|
|
659
|
-
get: function () {
|
|
660
|
-
return this._cached;
|
|
661
|
-
},
|
|
662
|
-
enumerable: false,
|
|
663
|
-
configurable: true
|
|
664
|
-
});
|
|
665
|
-
Object.defineProperty(ReuseTabService.prototype, "count", {
|
|
666
|
-
/** 获取当前缓存的路由总数 */
|
|
667
|
-
get: function () {
|
|
668
|
-
return this._cached.length;
|
|
669
|
-
},
|
|
670
|
-
enumerable: false,
|
|
671
|
-
configurable: true
|
|
672
|
-
});
|
|
673
|
-
Object.defineProperty(ReuseTabService.prototype, "change", {
|
|
674
|
-
/** 订阅缓存变更通知 */
|
|
675
|
-
get: function () {
|
|
676
|
-
return this._cachedChange.asObservable(); // .pipe(filter(w => w !== null));
|
|
677
|
-
},
|
|
678
|
-
enumerable: false,
|
|
679
|
-
configurable: true
|
|
680
|
-
});
|
|
681
|
-
Object.defineProperty(ReuseTabService.prototype, "title", {
|
|
682
|
-
/** 自定义当前标题 */
|
|
683
|
-
set: function (value) {
|
|
684
|
-
var url = this.curUrl;
|
|
685
|
-
if (typeof value === 'string')
|
|
686
|
-
value = { text: value };
|
|
687
|
-
this._titleCached[url] = value;
|
|
688
|
-
this.di('update current tag title: ', value);
|
|
689
|
-
this._cachedChange.next({
|
|
690
|
-
active: 'title',
|
|
691
|
-
url: url,
|
|
692
|
-
title: value,
|
|
693
|
-
list: this._cached
|
|
694
|
-
});
|
|
695
|
-
},
|
|
696
|
-
enumerable: false,
|
|
697
|
-
configurable: true
|
|
698
|
-
});
|
|
699
|
-
/** 获取指定路径缓存所在位置,`-1` 表示无缓存 */
|
|
700
|
-
ReuseTabService.prototype.index = function (url) {
|
|
701
|
-
return this._cached.findIndex(function (w) { return w.url === url; });
|
|
702
|
-
};
|
|
703
|
-
/** 获取指定路径缓存是否存在 */
|
|
704
|
-
ReuseTabService.prototype.exists = function (url) {
|
|
705
|
-
return this.index(url) !== -1;
|
|
706
|
-
};
|
|
707
|
-
/** 获取指定路径缓存 */
|
|
708
|
-
ReuseTabService.prototype.get = function (url) {
|
|
709
|
-
return url ? this._cached.find(function (w) { return w.url === url; }) || null : null;
|
|
710
|
-
};
|
|
711
|
-
ReuseTabService.prototype.remove = function (url, includeNonCloseable) {
|
|
712
|
-
var idx = typeof url === 'string' ? this.index(url) : url;
|
|
713
|
-
var item = idx !== -1 ? this._cached[idx] : null;
|
|
714
|
-
if (!item || (!includeNonCloseable && !item.closable))
|
|
715
|
-
return false;
|
|
716
|
-
this.destroy(item._handle);
|
|
717
|
-
this._cached.splice(idx, 1);
|
|
718
|
-
delete this._titleCached[url];
|
|
719
|
-
return true;
|
|
720
|
-
};
|
|
721
|
-
/**
|
|
722
|
-
* 根据URL移除标签
|
|
723
|
-
*
|
|
724
|
-
* @param [includeNonCloseable=false] 是否强制包含不可关闭
|
|
725
|
-
*/
|
|
726
|
-
ReuseTabService.prototype.close = function (url, includeNonCloseable) {
|
|
727
|
-
if (includeNonCloseable === void 0) { includeNonCloseable = false; }
|
|
728
|
-
this.removeUrlBuffer = url;
|
|
729
|
-
this.remove(url, includeNonCloseable);
|
|
730
|
-
this._cachedChange.next({ active: 'close', url: url, list: this._cached });
|
|
731
|
-
this.di('close tag', url);
|
|
732
|
-
return true;
|
|
733
|
-
};
|
|
734
|
-
/**
|
|
735
|
-
* 清除右边
|
|
736
|
-
*
|
|
737
|
-
* @param [includeNonCloseable=false] 是否强制包含不可关闭
|
|
738
|
-
*/
|
|
739
|
-
ReuseTabService.prototype.closeRight = function (url, includeNonCloseable) {
|
|
740
|
-
if (includeNonCloseable === void 0) { includeNonCloseable = false; }
|
|
741
|
-
var start = this.index(url);
|
|
742
|
-
for (var i = this.count - 1; i > start; i--) {
|
|
743
|
-
this.remove(i, includeNonCloseable);
|
|
744
|
-
}
|
|
745
|
-
this.removeUrlBuffer = null;
|
|
746
|
-
this._cachedChange.next({ active: 'closeRight', url: url, list: this._cached });
|
|
747
|
-
this.di('close right tages', url);
|
|
748
|
-
return true;
|
|
749
|
-
};
|
|
750
|
-
/**
|
|
751
|
-
* 清除所有缓存
|
|
752
|
-
*
|
|
753
|
-
* @param [includeNonCloseable=false] 是否强制包含不可关闭
|
|
754
|
-
*/
|
|
755
|
-
ReuseTabService.prototype.clear = function (includeNonCloseable) {
|
|
756
|
-
var _this = this;
|
|
757
|
-
if (includeNonCloseable === void 0) { includeNonCloseable = false; }
|
|
758
|
-
this._cached.forEach(function (w) {
|
|
759
|
-
if (!includeNonCloseable && w.closable)
|
|
760
|
-
_this.destroy(w._handle);
|
|
761
|
-
});
|
|
762
|
-
this._cached = this._cached.filter(function (w) { return !includeNonCloseable && !w.closable; });
|
|
763
|
-
this.removeUrlBuffer = null;
|
|
764
|
-
this._cachedChange.next({ active: 'clear', list: this._cached });
|
|
765
|
-
this.di('clear all catch');
|
|
766
|
-
};
|
|
767
|
-
/**
|
|
768
|
-
* 移动缓存数据
|
|
769
|
-
*
|
|
770
|
-
* @param url 要移动的URL地址
|
|
771
|
-
* @param position 新位置,下标从 `0` 开始
|
|
772
|
-
*
|
|
773
|
-
* @example
|
|
774
|
-
* ```
|
|
775
|
-
* // source
|
|
776
|
-
* [ '/a/1', '/a/2', '/a/3', '/a/4', '/a/5' ]
|
|
777
|
-
* move('/a/1', 2);
|
|
778
|
-
* // output
|
|
779
|
-
* [ '/a/2', '/a/3', '/a/1', '/a/4', '/a/5' ]
|
|
780
|
-
* move('/a/1', -1);
|
|
781
|
-
* // output
|
|
782
|
-
* [ '/a/2', '/a/3', '/a/4', '/a/5', '/a/1' ]
|
|
783
|
-
* ```
|
|
784
|
-
*/
|
|
785
|
-
ReuseTabService.prototype.move = function (url, position) {
|
|
786
|
-
var start = this._cached.findIndex(function (w) { return w.url === url; });
|
|
787
|
-
if (start === -1)
|
|
788
|
-
return;
|
|
789
|
-
var data = this._cached.slice();
|
|
790
|
-
data.splice(position < 0 ? data.length + position : position, 0, data.splice(start, 1)[0]);
|
|
791
|
-
this._cached = data;
|
|
792
|
-
this._cachedChange.next({
|
|
793
|
-
active: 'move',
|
|
794
|
-
url: url,
|
|
795
|
-
position: position,
|
|
796
|
-
list: this._cached
|
|
797
|
-
});
|
|
798
|
-
};
|
|
799
|
-
/**
|
|
800
|
-
* 强制关闭当前路由(包含不可关闭状态),并重新导航至 `newUrl` 路由
|
|
801
|
-
*/
|
|
802
|
-
ReuseTabService.prototype.replace = function (newUrl) {
|
|
803
|
-
var url = this.curUrl;
|
|
804
|
-
if (this.exists(url)) {
|
|
805
|
-
this.close(url, true);
|
|
806
|
-
}
|
|
807
|
-
else {
|
|
808
|
-
this.removeUrlBuffer = url;
|
|
809
|
-
}
|
|
810
|
-
this.injector.get(router.Router).navigateByUrl(newUrl);
|
|
811
|
-
};
|
|
812
|
-
/**
|
|
813
|
-
* 获取标题,顺序如下:
|
|
814
|
-
*
|
|
815
|
-
* 1. 组件内使用 `ReuseTabService.title = 'new title'` 重新指定文本
|
|
816
|
-
* 2. 路由配置中 data 属性中包含 titleI18n > title
|
|
817
|
-
* 3. 菜单数据中 text 属性
|
|
818
|
-
*
|
|
819
|
-
* @param url 指定URL
|
|
820
|
-
* @param route 指定路由快照
|
|
821
|
-
*/
|
|
822
|
-
ReuseTabService.prototype.getTitle = function (url, route) {
|
|
823
|
-
if (this._titleCached[url]) {
|
|
824
|
-
return this._titleCached[url];
|
|
825
|
-
}
|
|
826
|
-
if (route && route.data && (route.data.titleI18n || route.data.title)) {
|
|
827
|
-
return {
|
|
828
|
-
text: route.data.title,
|
|
829
|
-
i18n: route.data.titleI18n
|
|
830
|
-
};
|
|
831
|
-
}
|
|
832
|
-
var menu = this.getMenu(url);
|
|
833
|
-
return menu ? { text: menu.text, i18n: menu.i18n } : { text: url };
|
|
834
|
-
};
|
|
835
|
-
/**
|
|
836
|
-
* 清除标题缓存
|
|
837
|
-
*/
|
|
838
|
-
ReuseTabService.prototype.clearTitleCached = function () {
|
|
839
|
-
this._titleCached = {};
|
|
840
|
-
};
|
|
841
|
-
Object.defineProperty(ReuseTabService.prototype, "closable", {
|
|
842
|
-
/** 自定义当前 `closable` 状态 */
|
|
843
|
-
set: function (value) {
|
|
844
|
-
var url = this.curUrl;
|
|
845
|
-
this._closableCached[url] = value;
|
|
846
|
-
this.di('update current tag closable: ', value);
|
|
847
|
-
this._cachedChange.next({
|
|
848
|
-
active: 'closable',
|
|
849
|
-
closable: value,
|
|
850
|
-
list: this._cached
|
|
851
|
-
});
|
|
852
|
-
},
|
|
853
|
-
enumerable: false,
|
|
854
|
-
configurable: true
|
|
855
|
-
});
|
|
856
|
-
/**
|
|
857
|
-
* 获取 `closable` 状态,顺序如下:
|
|
858
|
-
*
|
|
859
|
-
* 1. 组件内使用 `ReuseTabService.closable = true` 重新指定 `closable` 状态
|
|
860
|
-
* 2. 路由配置中 data 属性中包含 `reuseClosable`
|
|
861
|
-
* 3. 菜单数据中 `reuseClosable` 属性
|
|
862
|
-
*
|
|
863
|
-
* @param url 指定URL
|
|
864
|
-
* @param route 指定路由快照
|
|
865
|
-
*/
|
|
866
|
-
ReuseTabService.prototype.getClosable = function (url, route) {
|
|
867
|
-
if (typeof this._closableCached[url] !== 'undefined')
|
|
868
|
-
return this._closableCached[url];
|
|
869
|
-
if (route && route.data && typeof route.data.reuseClosable === 'boolean')
|
|
870
|
-
return route.data.reuseClosable;
|
|
871
|
-
var menu = this.mode !== exports.ReuseTabMatchMode.URL ? this.getMenu(url) : null;
|
|
872
|
-
if (menu && typeof menu.reuseClosable === 'boolean')
|
|
873
|
-
return menu.reuseClosable;
|
|
874
|
-
return true;
|
|
875
|
-
};
|
|
876
|
-
/**
|
|
877
|
-
* 清空 `closable` 缓存
|
|
878
|
-
*/
|
|
879
|
-
ReuseTabService.prototype.clearClosableCached = function () {
|
|
880
|
-
this._closableCached = {};
|
|
881
|
-
};
|
|
882
|
-
ReuseTabService.prototype.getTruthRoute = function (route) {
|
|
883
|
-
var next = route;
|
|
884
|
-
while (next.firstChild)
|
|
885
|
-
next = next.firstChild;
|
|
886
|
-
return next;
|
|
887
|
-
};
|
|
888
|
-
/**
|
|
889
|
-
* 根据快照获取URL地址
|
|
890
|
-
*/
|
|
891
|
-
ReuseTabService.prototype.getUrl = function (route) {
|
|
892
|
-
var next = this.getTruthRoute(route);
|
|
893
|
-
var segments = [];
|
|
894
|
-
while (next) {
|
|
895
|
-
segments.push(next.url.join('/'));
|
|
896
|
-
next = next.parent;
|
|
897
|
-
}
|
|
898
|
-
var url = "/" + segments
|
|
899
|
-
.filter(function (i) { return i; })
|
|
900
|
-
.reverse()
|
|
901
|
-
.join('/');
|
|
902
|
-
return url;
|
|
903
|
-
};
|
|
904
|
-
/**
|
|
905
|
-
* 检查快照是否允许被复用
|
|
906
|
-
*/
|
|
907
|
-
ReuseTabService.prototype.can = function (route) {
|
|
908
|
-
var url = this.getUrl(route);
|
|
909
|
-
if (url === this.removeUrlBuffer)
|
|
910
|
-
return false;
|
|
911
|
-
if (route.data && typeof route.data.reuse === 'boolean')
|
|
912
|
-
return route.data.reuse;
|
|
913
|
-
if (this.mode !== exports.ReuseTabMatchMode.URL) {
|
|
914
|
-
var menu = this.getMenu(url);
|
|
915
|
-
if (!menu)
|
|
916
|
-
return false;
|
|
917
|
-
if (this.mode === exports.ReuseTabMatchMode.Menu) {
|
|
918
|
-
if (menu.reuse === false)
|
|
919
|
-
return false;
|
|
920
|
-
}
|
|
921
|
-
else {
|
|
922
|
-
if (!menu.reuse || menu.reuse !== true)
|
|
923
|
-
return false;
|
|
924
|
-
}
|
|
925
|
-
return true;
|
|
926
|
-
}
|
|
927
|
-
return !this.isExclude(url);
|
|
928
|
-
};
|
|
929
|
-
ReuseTabService.prototype.isExclude = function (url) {
|
|
930
|
-
return this.excludes.findIndex(function (r) { return r.test(url); }) !== -1;
|
|
931
|
-
};
|
|
932
|
-
/**
|
|
933
|
-
* 刷新,触发一个 refresh 类型事件
|
|
934
|
-
*/
|
|
935
|
-
ReuseTabService.prototype.refresh = function (data) {
|
|
936
|
-
this._cachedChange.next({ active: 'refresh', data: data });
|
|
937
|
-
};
|
|
938
|
-
// #endregion
|
|
939
|
-
// #region privates
|
|
940
|
-
ReuseTabService.prototype.destroy = function (_handle) {
|
|
941
|
-
if (_handle && _handle.componentRef && _handle.componentRef.destroy)
|
|
942
|
-
_handle.componentRef.destroy();
|
|
943
|
-
};
|
|
944
|
-
ReuseTabService.prototype.di = function () {
|
|
945
|
-
var args = [];
|
|
946
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
947
|
-
args[_i] = arguments[_i];
|
|
948
|
-
}
|
|
949
|
-
if (!this.debug)
|
|
950
|
-
return;
|
|
951
|
-
console.warn.apply(console, __spreadArray([], __read(args)));
|
|
952
|
-
};
|
|
953
|
-
ReuseTabService.prototype.init = function () {
|
|
954
|
-
this.initScroll();
|
|
955
|
-
this._inited = true;
|
|
956
|
-
};
|
|
957
|
-
ReuseTabService.prototype.getMenu = function (url) {
|
|
958
|
-
var menus = this.menuService.getPathByUrl(url);
|
|
959
|
-
if (!menus || menus.length === 0)
|
|
960
|
-
return null;
|
|
961
|
-
return menus.pop();
|
|
962
|
-
};
|
|
963
|
-
ReuseTabService.prototype.runHook = function (method, comp, type) {
|
|
964
|
-
if (type === void 0) { type = 'init'; }
|
|
965
|
-
if (typeof comp === 'number') {
|
|
966
|
-
var item = this._cached[comp];
|
|
967
|
-
comp = item._handle.componentRef;
|
|
968
|
-
}
|
|
969
|
-
var compThis = comp.instance;
|
|
970
|
-
if (comp == null || !compThis) {
|
|
971
|
-
return;
|
|
972
|
-
}
|
|
973
|
-
var fn = compThis[method];
|
|
974
|
-
if (typeof fn !== 'function') {
|
|
975
|
-
return;
|
|
976
|
-
}
|
|
977
|
-
if (method === '_onReuseInit') {
|
|
978
|
-
fn.call(compThis, type);
|
|
979
|
-
}
|
|
980
|
-
else {
|
|
981
|
-
fn.call(compThis);
|
|
982
|
-
}
|
|
983
|
-
};
|
|
984
|
-
ReuseTabService.prototype.hasInValidRoute = function (route) {
|
|
985
|
-
return !route.routeConfig || !!route.routeConfig.loadChildren || !!route.routeConfig.children;
|
|
986
|
-
};
|
|
987
|
-
/**
|
|
988
|
-
* 决定是否允许路由复用,若 `true` 会触发 `store`
|
|
989
|
-
*/
|
|
990
|
-
ReuseTabService.prototype.shouldDetach = function (route) {
|
|
991
|
-
if (this.hasInValidRoute(route))
|
|
992
|
-
return false;
|
|
993
|
-
this.di('#shouldDetach', this.can(route), this.getUrl(route));
|
|
994
|
-
return this.can(route);
|
|
995
|
-
};
|
|
996
|
-
/**
|
|
997
|
-
* 存储
|
|
998
|
-
*/
|
|
999
|
-
ReuseTabService.prototype.store = function (_snapshot, _handle) {
|
|
1000
|
-
var _this = this;
|
|
1001
|
-
var _a;
|
|
1002
|
-
var url = this.getUrl(_snapshot);
|
|
1003
|
-
var idx = this.index(url);
|
|
1004
|
-
var isAdd = idx === -1;
|
|
1005
|
-
var item = {
|
|
1006
|
-
title: this.getTitle(url, _snapshot),
|
|
1007
|
-
closable: this.getClosable(url, _snapshot),
|
|
1008
|
-
position: this.getKeepingScroll(url, _snapshot) ? this.positionBuffer[url] : null,
|
|
1009
|
-
url: url,
|
|
1010
|
-
_snapshot: _snapshot,
|
|
1011
|
-
_handle: _handle
|
|
1012
|
-
};
|
|
1013
|
-
if (isAdd) {
|
|
1014
|
-
if (this.count >= this._max) {
|
|
1015
|
-
// Get the oldest closable location
|
|
1016
|
-
var closeIdx = this._cached.findIndex(function (w) { return w.closable; });
|
|
1017
|
-
if (closeIdx !== -1)
|
|
1018
|
-
this.remove(closeIdx, false);
|
|
1019
|
-
}
|
|
1020
|
-
this._cached.push(item);
|
|
1021
|
-
}
|
|
1022
|
-
else {
|
|
1023
|
-
// Current handler is null when activate routes
|
|
1024
|
-
// For better reliability, we need to wait for the component to be attached before call _onReuseInit
|
|
1025
|
-
var cahcedComponentRef_1 = (_a = this._cached[idx]._handle) === null || _a === void 0 ? void 0 : _a.componentRef;
|
|
1026
|
-
if (_handle == null && cahcedComponentRef_1 != null) {
|
|
1027
|
-
rxjs.timer(100).subscribe(function () { return _this.runHook('_onReuseInit', cahcedComponentRef_1); });
|
|
1028
|
-
}
|
|
1029
|
-
this._cached[idx] = item;
|
|
1030
|
-
}
|
|
1031
|
-
this.removeUrlBuffer = null;
|
|
1032
|
-
this.di('#store', isAdd ? '[new]' : '[override]', url);
|
|
1033
|
-
if (_handle && _handle.componentRef) {
|
|
1034
|
-
this.runHook('_onReuseDestroy', _handle.componentRef);
|
|
1035
|
-
}
|
|
1036
|
-
if (!isAdd) {
|
|
1037
|
-
this._cachedChange.next({ active: 'override', item: item, list: this._cached });
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
/**
|
|
1041
|
-
* 决定是否允许应用缓存数据
|
|
1042
|
-
*/
|
|
1043
|
-
ReuseTabService.prototype.shouldAttach = function (route) {
|
|
1044
|
-
if (this.hasInValidRoute(route))
|
|
1045
|
-
return false;
|
|
1046
|
-
var url = this.getUrl(route);
|
|
1047
|
-
var data = this.get(url);
|
|
1048
|
-
var ret = !!(data && data._handle);
|
|
1049
|
-
this.di('#shouldAttach', ret, url);
|
|
1050
|
-
if (!ret) {
|
|
1051
|
-
this._cachedChange.next({ active: 'add', url: url, list: this._cached });
|
|
1052
|
-
}
|
|
1053
|
-
return ret;
|
|
1054
|
-
};
|
|
1055
|
-
/**
|
|
1056
|
-
* 提取复用数据
|
|
1057
|
-
*/
|
|
1058
|
-
ReuseTabService.prototype.retrieve = function (route) {
|
|
1059
|
-
if (this.hasInValidRoute(route))
|
|
1060
|
-
return null;
|
|
1061
|
-
var url = this.getUrl(route);
|
|
1062
|
-
var data = this.get(url);
|
|
1063
|
-
var ret = (data && data._handle) || null;
|
|
1064
|
-
this.di('#retrieve', url, ret);
|
|
1065
|
-
return ret;
|
|
1066
|
-
};
|
|
1067
|
-
/**
|
|
1068
|
-
* 决定是否应该进行复用路由处理
|
|
1069
|
-
*/
|
|
1070
|
-
ReuseTabService.prototype.shouldReuseRoute = function (future, curr) {
|
|
1071
|
-
var ret = future.routeConfig === curr.routeConfig;
|
|
1072
|
-
if (!ret)
|
|
1073
|
-
return false;
|
|
1074
|
-
var path = ((future.routeConfig && future.routeConfig.path) || '');
|
|
1075
|
-
if (path.length > 0 && ~path.indexOf(':')) {
|
|
1076
|
-
if (this.routeParamMatchMode === 'strict') {
|
|
1077
|
-
ret = this.getUrl(future) === this.getUrl(curr);
|
|
1078
|
-
}
|
|
1079
|
-
else {
|
|
1080
|
-
ret = path === ((curr.routeConfig && curr.routeConfig.path) || '');
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
this.di('=====================');
|
|
1084
|
-
this.di('#shouldReuseRoute', ret, this.getUrl(curr) + "=>" + this.getUrl(future), future, curr);
|
|
1085
|
-
return ret;
|
|
1086
|
-
};
|
|
1087
|
-
// #region scroll
|
|
1088
|
-
/**
|
|
1089
|
-
* 获取 `keepingScroll` 状态,顺序如下:
|
|
1090
|
-
*
|
|
1091
|
-
* 1. 路由配置中 data 属性中包含 `keepingScroll`
|
|
1092
|
-
* 2. 菜单数据中 `keepingScroll` 属性
|
|
1093
|
-
* 3. 组件 `keepingScroll` 值
|
|
1094
|
-
*/
|
|
1095
|
-
ReuseTabService.prototype.getKeepingScroll = function (url, route) {
|
|
1096
|
-
if (route && route.data && typeof route.data.keepingScroll === 'boolean')
|
|
1097
|
-
return route.data.keepingScroll;
|
|
1098
|
-
var menu = this.mode !== exports.ReuseTabMatchMode.URL ? this.getMenu(url) : null;
|
|
1099
|
-
if (menu && typeof menu.keepingScroll === 'boolean')
|
|
1100
|
-
return menu.keepingScroll;
|
|
1101
|
-
return this.keepingScroll;
|
|
1102
|
-
};
|
|
1103
|
-
Object.defineProperty(ReuseTabService.prototype, "isDisabledInRouter", {
|
|
1104
|
-
get: function () {
|
|
1105
|
-
var routerConfig = this.injector.get(router.ROUTER_CONFIGURATION, {});
|
|
1106
|
-
return routerConfig.scrollPositionRestoration === 'disabled';
|
|
1107
|
-
},
|
|
1108
|
-
enumerable: false,
|
|
1109
|
-
configurable: true
|
|
1110
|
-
});
|
|
1111
|
-
Object.defineProperty(ReuseTabService.prototype, "ss", {
|
|
1112
|
-
get: function () {
|
|
1113
|
-
return this.injector.get(browser.ScrollService);
|
|
1114
|
-
},
|
|
1115
|
-
enumerable: false,
|
|
1116
|
-
configurable: true
|
|
1117
|
-
});
|
|
1118
|
-
ReuseTabService.prototype.initScroll = function () {
|
|
1119
|
-
var _this = this;
|
|
1120
|
-
if (this._router$) {
|
|
1121
|
-
this._router$.unsubscribe();
|
|
1122
|
-
}
|
|
1123
|
-
this._router$ = this.injector.get(router.Router).events.subscribe(function (e) {
|
|
1124
|
-
if (e instanceof router.NavigationStart) {
|
|
1125
|
-
var url = _this.curUrl;
|
|
1126
|
-
if (_this.getKeepingScroll(url, _this.getTruthRoute(_this.snapshot))) {
|
|
1127
|
-
_this.positionBuffer[url] = _this.ss.getScrollPosition(_this.keepingScrollContainer);
|
|
1128
|
-
}
|
|
1129
|
-
else {
|
|
1130
|
-
delete _this.positionBuffer[url];
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
else if (e instanceof router.NavigationEnd) {
|
|
1134
|
-
var url = _this.curUrl;
|
|
1135
|
-
var item_1 = _this.get(url);
|
|
1136
|
-
if (item_1 && item_1.position && _this.getKeepingScroll(url, _this.getTruthRoute(_this.snapshot))) {
|
|
1137
|
-
if (_this.isDisabledInRouter) {
|
|
1138
|
-
_this.ss.scrollToPosition(_this.keepingScrollContainer, item_1.position);
|
|
1139
|
-
}
|
|
1140
|
-
else {
|
|
1141
|
-
setTimeout(function () { return _this.ss.scrollToPosition(_this.keepingScrollContainer, item_1.position); }, 1);
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
});
|
|
1146
|
-
};
|
|
1147
|
-
// #endregion
|
|
1148
|
-
ReuseTabService.prototype.ngOnDestroy = function () {
|
|
1149
|
-
var _b = this, _cachedChange = _b._cachedChange, _router$ = _b._router$;
|
|
1150
|
-
this.clear();
|
|
1151
|
-
this._cached = [];
|
|
1152
|
-
_cachedChange.complete();
|
|
1153
|
-
if (_router$) {
|
|
1154
|
-
_router$.unsubscribe();
|
|
1155
|
-
}
|
|
1156
|
-
};
|
|
1157
|
-
return ReuseTabService;
|
|
1158
|
-
}());
|
|
1159
|
-
ReuseTabService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ReuseTabService_Factory() { return new ReuseTabService(i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(i1__namespace.MenuService)); }, token: ReuseTabService, providedIn: "root" });
|
|
1160
|
-
ReuseTabService.decorators = [
|
|
1161
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
1162
|
-
];
|
|
1163
|
-
ReuseTabService.ctorParameters = function () { return [
|
|
1164
|
-
{ type: i0.Injector },
|
|
1165
|
-
{ type: i1.MenuService }
|
|
1166
|
-
]; };
|
|
1167
|
-
|
|
1168
|
-
var ReuseTabComponent = /** @class */ (function () {
|
|
1169
|
-
// #endregion
|
|
1170
|
-
function ReuseTabComponent(srv, cdr, router, route, i18nSrv, doc, platform) {
|
|
1171
|
-
this.srv = srv;
|
|
1172
|
-
this.cdr = cdr;
|
|
1173
|
-
this.router = router;
|
|
1174
|
-
this.route = route;
|
|
1175
|
-
this.i18nSrv = i18nSrv;
|
|
1176
|
-
this.doc = doc;
|
|
1177
|
-
this.platform = platform;
|
|
1178
|
-
this.destroy$ = new rxjs.Subject();
|
|
1179
|
-
this.updatePos$ = new rxjs.Subject();
|
|
1180
|
-
this.list = [];
|
|
1181
|
-
this.pos = 0;
|
|
1182
|
-
// #region fields
|
|
1183
|
-
this.mode = exports.ReuseTabMatchMode.Menu;
|
|
1184
|
-
this.debug = false;
|
|
1185
|
-
this.allowClose = true;
|
|
1186
|
-
this.keepingScroll = false;
|
|
1187
|
-
this.customContextMenu = [];
|
|
1188
|
-
this.tabType = 'line';
|
|
1189
|
-
this.routeParamMatchMode = 'strict';
|
|
1190
|
-
this.disabled = false;
|
|
1191
|
-
this.change = new i0.EventEmitter();
|
|
1192
|
-
this.close = new i0.EventEmitter();
|
|
1193
|
-
}
|
|
1194
|
-
Object.defineProperty(ReuseTabComponent.prototype, "keepingScrollContainer", {
|
|
1195
|
-
set: function (value) {
|
|
1196
|
-
this._keepingScrollContainer = typeof value === 'string' ? this.doc.querySelector(value) : value;
|
|
1197
|
-
},
|
|
1198
|
-
enumerable: false,
|
|
1199
|
-
configurable: true
|
|
1200
|
-
});
|
|
1201
|
-
ReuseTabComponent.prototype.genTit = function (title) {
|
|
1202
|
-
return title.i18n && this.i18nSrv ? this.i18nSrv.fanyi(title.i18n) : title.text;
|
|
1203
|
-
};
|
|
1204
|
-
Object.defineProperty(ReuseTabComponent.prototype, "curUrl", {
|
|
1205
|
-
get: function () {
|
|
1206
|
-
return this.srv.getUrl(this.route.snapshot);
|
|
1207
|
-
},
|
|
1208
|
-
enumerable: false,
|
|
1209
|
-
configurable: true
|
|
1210
|
-
});
|
|
1211
|
-
ReuseTabComponent.prototype.genCurItem = function () {
|
|
1212
|
-
var url = this.curUrl;
|
|
1213
|
-
var snapshotTrue = this.srv.getTruthRoute(this.route.snapshot);
|
|
1214
|
-
return {
|
|
1215
|
-
url: url,
|
|
1216
|
-
title: this.genTit(this.srv.getTitle(url, snapshotTrue)),
|
|
1217
|
-
closable: this.allowClose && this.srv.count > 0 && this.srv.getClosable(url, snapshotTrue),
|
|
1218
|
-
active: false,
|
|
1219
|
-
last: false,
|
|
1220
|
-
index: 0
|
|
1221
|
-
};
|
|
1222
|
-
};
|
|
1223
|
-
ReuseTabComponent.prototype.genList = function (notify) {
|
|
1224
|
-
var _this = this;
|
|
1225
|
-
var ls = this.srv.items.map(function (item, index) { return ({
|
|
1226
|
-
url: item.url,
|
|
1227
|
-
title: _this.genTit(item.title),
|
|
1228
|
-
closable: _this.allowClose && item.closable && _this.srv.count > 0,
|
|
1229
|
-
index: index,
|
|
1230
|
-
active: false,
|
|
1231
|
-
last: false
|
|
1232
|
-
}); });
|
|
1233
|
-
var url = this.curUrl;
|
|
1234
|
-
var addCurrent = ls.findIndex(function (w) { return w.url === url; }) === -1;
|
|
1235
|
-
if (notify && notify.active === 'close' && notify.url === url) {
|
|
1236
|
-
addCurrent = false;
|
|
1237
|
-
var toPos = 0;
|
|
1238
|
-
var curItem = this.list.find(function (w) { return w.url === url; });
|
|
1239
|
-
if (curItem.index === ls.length) {
|
|
1240
|
-
// When closed is last
|
|
1241
|
-
toPos = ls.length - 1;
|
|
1242
|
-
}
|
|
1243
|
-
else if (curItem.index < ls.length) {
|
|
1244
|
-
// Should be actived next tab when closed is middle
|
|
1245
|
-
toPos = Math.max(0, curItem.index);
|
|
1246
|
-
}
|
|
1247
|
-
this.router.navigateByUrl(ls[toPos].url);
|
|
1248
|
-
}
|
|
1249
|
-
if (addCurrent) {
|
|
1250
|
-
ls.splice(this.pos + 1, 0, this.genCurItem());
|
|
1251
|
-
}
|
|
1252
|
-
ls.forEach(function (item, index) { return (item.index = index); });
|
|
1253
|
-
if (ls.length === 1) {
|
|
1254
|
-
ls[0].closable = false;
|
|
1255
|
-
}
|
|
1256
|
-
this.list = ls;
|
|
1257
|
-
this.cdr.detectChanges();
|
|
1258
|
-
this.updatePos$.next();
|
|
1259
|
-
};
|
|
1260
|
-
ReuseTabComponent.prototype.updateTitle = function (res) {
|
|
1261
|
-
var item = this.list.find(function (w) { return w.url === res.url; });
|
|
1262
|
-
if (!item)
|
|
1263
|
-
return;
|
|
1264
|
-
item.title = this.genTit(res.title);
|
|
1265
|
-
this.cdr.detectChanges();
|
|
1266
|
-
};
|
|
1267
|
-
ReuseTabComponent.prototype.refresh = function (item) {
|
|
1268
|
-
this.srv.runHook('_onReuseInit', this.pos === item.index ? this.srv.componentRef : item.index, 'refresh');
|
|
1269
|
-
};
|
|
1270
|
-
// #region UI
|
|
1271
|
-
ReuseTabComponent.prototype.contextMenuChange = function (res) {
|
|
1272
|
-
var _this = this;
|
|
1273
|
-
var fn = null;
|
|
1274
|
-
switch (res.type) {
|
|
1275
|
-
case 'refresh':
|
|
1276
|
-
this.refresh(res.item);
|
|
1277
|
-
break;
|
|
1278
|
-
case 'close':
|
|
1279
|
-
this._close(null, res.item.index, res.includeNonCloseable);
|
|
1280
|
-
break;
|
|
1281
|
-
case 'closeRight':
|
|
1282
|
-
fn = function () {
|
|
1283
|
-
_this.srv.closeRight(res.item.url, res.includeNonCloseable);
|
|
1284
|
-
_this.close.emit(null);
|
|
1285
|
-
};
|
|
1286
|
-
break;
|
|
1287
|
-
case 'closeOther':
|
|
1288
|
-
fn = function () {
|
|
1289
|
-
_this.srv.clear(res.includeNonCloseable);
|
|
1290
|
-
_this.close.emit(null);
|
|
1291
|
-
};
|
|
1292
|
-
break;
|
|
1293
|
-
}
|
|
1294
|
-
if (!fn) {
|
|
1295
|
-
return;
|
|
1296
|
-
}
|
|
1297
|
-
if (!res.item.active && res.item.index <= this.list.find(function (w) { return w.active; }).index) {
|
|
1298
|
-
this._to(res.item.index, fn);
|
|
1299
|
-
}
|
|
1300
|
-
else {
|
|
1301
|
-
fn();
|
|
1302
|
-
}
|
|
1303
|
-
};
|
|
1304
|
-
ReuseTabComponent.prototype._to = function (index, cb) {
|
|
1305
|
-
var _this = this;
|
|
1306
|
-
index = Math.max(0, Math.min(index, this.list.length - 1));
|
|
1307
|
-
var item = this.list[index];
|
|
1308
|
-
this.router.navigateByUrl(item.url).then(function (res) {
|
|
1309
|
-
if (!res)
|
|
1310
|
-
return;
|
|
1311
|
-
_this.item = item;
|
|
1312
|
-
_this.change.emit(item);
|
|
1313
|
-
if (cb) {
|
|
1314
|
-
cb();
|
|
1315
|
-
}
|
|
1316
|
-
});
|
|
1317
|
-
};
|
|
1318
|
-
ReuseTabComponent.prototype._close = function (e, idx, includeNonCloseable) {
|
|
1319
|
-
if (e != null) {
|
|
1320
|
-
e.preventDefault();
|
|
1321
|
-
e.stopPropagation();
|
|
1322
|
-
}
|
|
1323
|
-
var item = this.list[idx];
|
|
1324
|
-
this.srv.close(item.url, includeNonCloseable);
|
|
1325
|
-
this.close.emit(item);
|
|
1326
|
-
this.cdr.detectChanges();
|
|
1327
|
-
return false;
|
|
1328
|
-
};
|
|
1329
|
-
ReuseTabComponent.prototype.activate = function (instance) {
|
|
1330
|
-
this.srv.componentRef = { instance: instance };
|
|
1331
|
-
};
|
|
1332
|
-
// #endregion
|
|
1333
|
-
ReuseTabComponent.prototype.ngOnInit = function () {
|
|
1334
|
-
var _this = this;
|
|
1335
|
-
if (!this.platform.isBrowser) {
|
|
1336
|
-
return;
|
|
1337
|
-
}
|
|
1338
|
-
this.updatePos$.pipe(operators.takeUntil(this.destroy$), operators.debounceTime(50)).subscribe(function () {
|
|
1339
|
-
var url = _this.srv.getUrl(_this.route.snapshot);
|
|
1340
|
-
var ls = _this.list.filter(function (w) { return w.url === url || !_this.srv.isExclude(w.url); });
|
|
1341
|
-
if (ls.length === 0) {
|
|
1342
|
-
return;
|
|
1343
|
-
}
|
|
1344
|
-
var last = ls[ls.length - 1];
|
|
1345
|
-
var item = ls.find(function (w) { return w.url === url; });
|
|
1346
|
-
last.last = true;
|
|
1347
|
-
var pos = item == null ? last.index : item.index;
|
|
1348
|
-
ls.forEach(function (i, idx) { return (i.active = pos === idx); });
|
|
1349
|
-
_this.pos = pos;
|
|
1350
|
-
// TODO: 目前无法知道为什么 `pos` 无法通过 `nzSelectedIndex` 生效,因此强制使用组件实例的方式来修改,这种方式是安全的
|
|
1351
|
-
// https://github.com/ng-alain/ng-alain/issues/1736
|
|
1352
|
-
_this.tabset.nzSelectedIndex = pos;
|
|
1353
|
-
_this.list = ls;
|
|
1354
|
-
_this.cdr.detectChanges();
|
|
1355
|
-
});
|
|
1356
|
-
this.srv.change.pipe(operators.takeUntil(this.destroy$)).subscribe(function (res) {
|
|
1357
|
-
var _a;
|
|
1358
|
-
switch (res === null || res === void 0 ? void 0 : res.active) {
|
|
1359
|
-
case 'title':
|
|
1360
|
-
_this.updateTitle(res);
|
|
1361
|
-
return;
|
|
1362
|
-
case 'override':
|
|
1363
|
-
if (((_a = res === null || res === void 0 ? void 0 : res.list) === null || _a === void 0 ? void 0 : _a.length) === _this.list.length) {
|
|
1364
|
-
_this.updatePos$.next();
|
|
1365
|
-
return;
|
|
1366
|
-
}
|
|
1367
|
-
break;
|
|
1368
|
-
}
|
|
1369
|
-
_this.genList(res);
|
|
1370
|
-
});
|
|
1371
|
-
this.i18nSrv.change
|
|
1372
|
-
.pipe(operators.filter(function () { return _this.srv.inited; }), operators.takeUntil(this.destroy$), operators.debounceTime(100))
|
|
1373
|
-
.subscribe(function () { return _this.genList({ active: 'title' }); });
|
|
1374
|
-
this.srv.init();
|
|
1375
|
-
};
|
|
1376
|
-
ReuseTabComponent.prototype.ngOnChanges = function (changes) {
|
|
1377
|
-
if (!this.platform.isBrowser) {
|
|
1378
|
-
return;
|
|
1379
|
-
}
|
|
1380
|
-
if (changes.max)
|
|
1381
|
-
this.srv.max = this.max;
|
|
1382
|
-
if (changes.excludes)
|
|
1383
|
-
this.srv.excludes = this.excludes;
|
|
1384
|
-
if (changes.mode)
|
|
1385
|
-
this.srv.mode = this.mode;
|
|
1386
|
-
if (changes.routeParamMatchMode)
|
|
1387
|
-
this.srv.routeParamMatchMode = this.routeParamMatchMode;
|
|
1388
|
-
if (changes.keepingScroll) {
|
|
1389
|
-
this.srv.keepingScroll = this.keepingScroll;
|
|
1390
|
-
this.srv.keepingScrollContainer = this._keepingScrollContainer;
|
|
1391
|
-
}
|
|
1392
|
-
this.srv.debug = this.debug;
|
|
1393
|
-
this.cdr.detectChanges();
|
|
1394
|
-
};
|
|
1395
|
-
ReuseTabComponent.prototype.ngOnDestroy = function () {
|
|
1396
|
-
var unsubscribe$ = this.destroy$;
|
|
1397
|
-
unsubscribe$.next();
|
|
1398
|
-
unsubscribe$.complete();
|
|
1399
|
-
};
|
|
1400
|
-
return ReuseTabComponent;
|
|
1401
|
-
}());
|
|
1402
|
-
ReuseTabComponent.decorators = [
|
|
1403
|
-
{ type: i0.Component, args: [{
|
|
1404
|
-
selector: 'reuse-tab, [reuse-tab]',
|
|
1405
|
-
exportAs: 'reuseTab',
|
|
1406
|
-
template: "<nz-tabset\n #tabset\n [nzSelectedIndex]=\"pos\"\n [nzAnimated]=\"false\"\n [nzType]=\"tabType\"\n [nzTabBarExtraContent]=\"tabBarExtraContent\"\n [nzTabBarGutter]=\"tabBarGutter\"\n [nzTabBarStyle]=\"tabBarStyle\"\n>\n <nz-tab *ngFor=\"let i of list; let index = index\" [nzTitle]=\"titleTemplate\" (nzClick)=\"_to(index)\">\n <ng-template #titleTemplate>\n <div\n [reuse-tab-context-menu]=\"i\"\n [customContextMenu]=\"customContextMenu\"\n class=\"reuse-tab__name\"\n [attr.title]=\"i.title\"\n >\n <span [class.reuse-tab__name-width]=\"tabMaxWidth\" [style.max-width.px]=\"tabMaxWidth\">\n <ng-container\n *ngIf=\"titleRender; else defaultTitle\"\n [ngTemplateOutlet]=\"titleRender\"\n [ngTemplateOutletContext]=\"{ $implicit: i }\"\n ></ng-container>\n <ng-template #defaultTitle>{{ i.title }}</ng-template>\n </span>\n </div>\n <i *ngIf=\"i.closable\" nz-icon nzType=\"close\" class=\"reuse-tab__op\" (click)=\"_close($event, index, false)\"></i>\n </ng-template>\n </nz-tab>\n</nz-tabset>\n<reuse-tab-context [i18n]=\"i18n\" (change)=\"contextMenuChange($event)\"></reuse-tab-context>\n",
|
|
1407
|
-
host: {
|
|
1408
|
-
'[class.reuse-tab]': 'true',
|
|
1409
|
-
'[class.reuse-tab__line]': "tabType === 'line'",
|
|
1410
|
-
'[class.reuse-tab__card]': "tabType === 'card'",
|
|
1411
|
-
'[class.reuse-tab__disabled]': "disabled"
|
|
1412
|
-
},
|
|
1413
|
-
providers: [ReuseTabContextService],
|
|
1414
|
-
preserveWhitespaces: false,
|
|
1415
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1416
|
-
encapsulation: i0.ViewEncapsulation.None
|
|
1417
|
-
},] }
|
|
1418
|
-
];
|
|
1419
|
-
ReuseTabComponent.ctorParameters = function () { return [
|
|
1420
|
-
{ type: ReuseTabService },
|
|
1421
|
-
{ type: i0.ChangeDetectorRef },
|
|
1422
|
-
{ type: router.Router },
|
|
1423
|
-
{ type: router.ActivatedRoute },
|
|
1424
|
-
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [i1.ALAIN_I18N_TOKEN,] }] },
|
|
1425
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] },
|
|
1426
|
-
{ type: platform.Platform }
|
|
1427
|
-
]; };
|
|
1428
|
-
ReuseTabComponent.propDecorators = {
|
|
1429
|
-
tabset: [{ type: i0.ViewChild, args: ['tabset',] }],
|
|
1430
|
-
mode: [{ type: i0.Input }],
|
|
1431
|
-
i18n: [{ type: i0.Input }],
|
|
1432
|
-
debug: [{ type: i0.Input }],
|
|
1433
|
-
max: [{ type: i0.Input }],
|
|
1434
|
-
tabMaxWidth: [{ type: i0.Input }],
|
|
1435
|
-
excludes: [{ type: i0.Input }],
|
|
1436
|
-
allowClose: [{ type: i0.Input }],
|
|
1437
|
-
keepingScroll: [{ type: i0.Input }],
|
|
1438
|
-
keepingScrollContainer: [{ type: i0.Input }],
|
|
1439
|
-
customContextMenu: [{ type: i0.Input }],
|
|
1440
|
-
tabBarExtraContent: [{ type: i0.Input }],
|
|
1441
|
-
tabBarGutter: [{ type: i0.Input }],
|
|
1442
|
-
tabBarStyle: [{ type: i0.Input }],
|
|
1443
|
-
tabType: [{ type: i0.Input }],
|
|
1444
|
-
routeParamMatchMode: [{ type: i0.Input }],
|
|
1445
|
-
disabled: [{ type: i0.Input }],
|
|
1446
|
-
titleRender: [{ type: i0.Input }],
|
|
1447
|
-
change: [{ type: i0.Output }],
|
|
1448
|
-
close: [{ type: i0.Output }]
|
|
1449
|
-
};
|
|
1450
|
-
__decorate([
|
|
1451
|
-
decorator.InputBoolean()
|
|
1452
|
-
], ReuseTabComponent.prototype, "debug", void 0);
|
|
1453
|
-
__decorate([
|
|
1454
|
-
decorator.InputNumber()
|
|
1455
|
-
], ReuseTabComponent.prototype, "max", void 0);
|
|
1456
|
-
__decorate([
|
|
1457
|
-
decorator.InputNumber()
|
|
1458
|
-
], ReuseTabComponent.prototype, "tabMaxWidth", void 0);
|
|
1459
|
-
__decorate([
|
|
1460
|
-
decorator.InputBoolean()
|
|
1461
|
-
], ReuseTabComponent.prototype, "allowClose", void 0);
|
|
1462
|
-
__decorate([
|
|
1463
|
-
decorator.InputBoolean()
|
|
1464
|
-
], ReuseTabComponent.prototype, "keepingScroll", void 0);
|
|
1465
|
-
__decorate([
|
|
1466
|
-
decorator.InputBoolean()
|
|
1467
|
-
], ReuseTabComponent.prototype, "disabled", void 0);
|
|
1468
|
-
|
|
1469
|
-
var ReuseTabStrategy = /** @class */ (function () {
|
|
1470
|
-
function ReuseTabStrategy(srv) {
|
|
1471
|
-
this.srv = srv;
|
|
1472
|
-
}
|
|
1473
|
-
ReuseTabStrategy.prototype.shouldDetach = function (route) {
|
|
1474
|
-
return this.srv.shouldDetach(route);
|
|
1475
|
-
};
|
|
1476
|
-
ReuseTabStrategy.prototype.store = function (route, handle) {
|
|
1477
|
-
this.srv.store(route, handle);
|
|
1478
|
-
};
|
|
1479
|
-
ReuseTabStrategy.prototype.shouldAttach = function (route) {
|
|
1480
|
-
return this.srv.shouldAttach(route);
|
|
1481
|
-
};
|
|
1482
|
-
ReuseTabStrategy.prototype.retrieve = function (route) {
|
|
1483
|
-
return this.srv.retrieve(route);
|
|
1484
|
-
};
|
|
1485
|
-
ReuseTabStrategy.prototype.shouldReuseRoute = function (future, curr) {
|
|
1486
|
-
return this.srv.shouldReuseRoute(future, curr);
|
|
1487
|
-
};
|
|
1488
|
-
return ReuseTabStrategy;
|
|
1489
|
-
}());
|
|
1490
|
-
|
|
1491
|
-
var COMPONENTS = [ReuseTabComponent];
|
|
1492
|
-
var NOEXPORTS = [ReuseTabContextMenuComponent, ReuseTabContextComponent, ReuseTabContextDirective];
|
|
1493
|
-
var ReuseTabModule = /** @class */ (function () {
|
|
1494
|
-
function ReuseTabModule() {
|
|
1495
|
-
}
|
|
1496
|
-
return ReuseTabModule;
|
|
1497
|
-
}());
|
|
1498
|
-
ReuseTabModule.decorators = [
|
|
1499
|
-
{ type: i0.NgModule, args: [{
|
|
1500
|
-
imports: [common.CommonModule, router.RouterModule, i1.DelonLocaleModule, menu.NzMenuModule, tabs.NzTabsModule, icon.NzIconModule, overlay.OverlayModule],
|
|
1501
|
-
declarations: __spreadArray(__spreadArray([], __read(COMPONENTS)), __read(NOEXPORTS)),
|
|
1502
|
-
exports: COMPONENTS
|
|
1503
|
-
},] }
|
|
1504
|
-
];
|
|
1505
|
-
|
|
1506
|
-
/**
|
|
1507
|
-
* Generated bundle index. Do not edit.
|
|
1508
|
-
*/
|
|
1509
|
-
|
|
1510
|
-
exports.ReuseTabComponent = ReuseTabComponent;
|
|
1511
|
-
exports.ReuseTabContextComponent = ReuseTabContextComponent;
|
|
1512
|
-
exports.ReuseTabContextDirective = ReuseTabContextDirective;
|
|
1513
|
-
exports.ReuseTabContextMenuComponent = ReuseTabContextMenuComponent;
|
|
1514
|
-
exports.ReuseTabContextService = ReuseTabContextService;
|
|
1515
|
-
exports.ReuseTabModule = ReuseTabModule;
|
|
1516
|
-
exports.ReuseTabService = ReuseTabService;
|
|
1517
|
-
exports.ReuseTabStrategy = ReuseTabStrategy;
|
|
1518
|
-
|
|
1519
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1520
|
-
|
|
1521
|
-
}));
|
|
1522
|
-
//# sourceMappingURL=reuseTab.umd.js.map
|