@delon/abc 12.4.1 → 13.0.0
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/{autoFocus.d.ts → auto-focus.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/package.json +6 -7
- 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.d.ts +5 -0
- package/avatar-list/avatar-list.module.d.ts +9 -0
- package/avatar-list/package.json +6 -7
- 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.d.ts +5 -0
- package/date-picker/date-picker.module.d.ts +9 -0
- package/date-picker/package.json +6 -7
- 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.d.ts +5 -0
- package/down-file/down-file.directive.d.ts +5 -2
- package/down-file/down-file.module.d.ts +7 -0
- package/down-file/package.json +6 -7
- 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.d.ts +5 -0
- package/error-collect/error-collect.module.d.ts +7 -0
- package/error-collect/package.json +6 -7
- 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.mjs +5 -0
- package/esm2020/auto-focus/auto-focus.module.mjs +17 -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.mjs +5 -0
- package/esm2020/avatar-list/avatar-list.module.mjs +22 -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.mjs +5 -0
- package/esm2020/date-picker/date-picker.module.mjs +22 -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.mjs +5 -0
- package/esm2020/down-file/down-file.module.mjs +20 -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.mjs +5 -0
- package/esm2020/error-collect/error-collect.module.mjs +20 -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.mjs +5 -0
- package/esm2020/footer-toolbar/footer-toolbar.module.mjs +21 -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.mjs +5 -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/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.mjs +5 -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/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.mjs +5 -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/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.mjs +5 -0
- package/esm2020/page-header/page-header.module.mjs +24 -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.mjs +5 -0
- package/esm2020/quick-menu/quick-menu.module.mjs +21 -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.mjs +5 -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/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.mjs +5 -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/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.mjs +5 -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.mjs +5 -0
- package/esm2020/st/st.module.mjs +98 -0
- package/{esm2015/st/st.types.js → esm2020/st/st.types.mjs} +0 -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.mjs +5 -0
- package/esm2020/sv/sv.module.mjs +25 -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.mjs +5 -0
- package/esm2020/tag-select/tag-select.module.mjs +21 -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/auto-focus.mjs +69 -0
- package/fesm2015/auto-focus.mjs.map +1 -0
- package/fesm2015/avatar-list.mjs +140 -0
- package/fesm2015/avatar-list.mjs.map +1 -0
- package/fesm2015/count-down.mjs +69 -0
- package/fesm2015/count-down.mjs.map +1 -0
- package/fesm2015/{datePicker.js → date-picker.mjs} +63 -40
- package/fesm2015/date-picker.mjs.map +1 -0
- package/fesm2015/down-file.mjs +141 -0
- package/fesm2015/down-file.mjs.map +1 -0
- package/fesm2015/ellipsis.mjs +255 -0
- package/fesm2015/ellipsis.mjs.map +1 -0
- package/fesm2015/error-collect.mjs +144 -0
- package/fesm2015/error-collect.mjs.map +1 -0
- package/fesm2015/exception.mjs +135 -0
- package/fesm2015/exception.mjs.map +1 -0
- package/fesm2015/footer-toolbar.mjs +70 -0
- package/fesm2015/footer-toolbar.mjs.map +1 -0
- package/fesm2015/full-content.mjs +202 -0
- package/fesm2015/full-content.mjs.map +1 -0
- package/fesm2015/global-footer.mjs +127 -0
- package/fesm2015/global-footer.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/notice-icon.mjs +173 -0
- package/fesm2015/notice-icon.mjs.map +1 -0
- package/fesm2015/onboarding.mjs +335 -0
- package/fesm2015/onboarding.mjs.map +1 -0
- package/fesm2015/page-header.mjs +277 -0
- package/fesm2015/page-header.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/quick-menu.mjs +114 -0
- package/fesm2015/quick-menu.mjs.map +1 -0
- package/fesm2015/result.mjs +89 -0
- package/fesm2015/result.mjs.map +1 -0
- package/fesm2015/{reuseTab.js → reuse-tab.mjs} +183 -160
- package/fesm2015/reuse-tab.mjs.map +1 -0
- package/fesm2015/se.mjs +443 -0
- package/fesm2015/se.mjs.map +1 -0
- package/fesm2015/sg.mjs +139 -0
- package/fesm2015/sg.mjs.map +1 -0
- package/fesm2015/{table.js → st.mjs} +610 -492
- package/fesm2015/st.mjs.map +1 -0
- package/fesm2015/sv.mjs +302 -0
- package/fesm2015/sv.mjs.map +1 -0
- package/fesm2015/tag-select.mjs +92 -0
- package/fesm2015/tag-select.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/auto-focus.mjs +69 -0
- package/fesm2020/auto-focus.mjs.map +1 -0
- package/fesm2020/avatar-list.mjs +137 -0
- package/fesm2020/avatar-list.mjs.map +1 -0
- package/fesm2020/count-down.mjs +69 -0
- package/fesm2020/count-down.mjs.map +1 -0
- package/fesm2020/date-picker.mjs +236 -0
- package/fesm2020/date-picker.mjs.map +1 -0
- package/fesm2020/down-file.mjs +138 -0
- package/fesm2020/down-file.mjs.map +1 -0
- package/fesm2020/ellipsis.mjs +253 -0
- package/fesm2020/ellipsis.mjs.map +1 -0
- package/fesm2020/error-collect.mjs +141 -0
- package/fesm2020/error-collect.mjs.map +1 -0
- package/fesm2020/exception.mjs +132 -0
- package/fesm2020/exception.mjs.map +1 -0
- package/fesm2020/footer-toolbar.mjs +68 -0
- package/fesm2020/footer-toolbar.mjs.map +1 -0
- package/fesm2020/full-content.mjs +199 -0
- package/fesm2020/full-content.mjs.map +1 -0
- package/fesm2020/global-footer.mjs +124 -0
- package/fesm2020/global-footer.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/notice-icon.mjs +173 -0
- package/fesm2020/notice-icon.mjs.map +1 -0
- package/fesm2020/onboarding.mjs +343 -0
- package/fesm2020/onboarding.mjs.map +1 -0
- package/fesm2020/page-header.mjs +274 -0
- package/fesm2020/page-header.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/quick-menu.mjs +114 -0
- package/fesm2020/quick-menu.mjs.map +1 -0
- package/fesm2020/result.mjs +86 -0
- package/fesm2020/result.mjs.map +1 -0
- package/fesm2020/reuse-tab.mjs +1106 -0
- package/fesm2020/reuse-tab.mjs.map +1 -0
- package/fesm2020/se.mjs +436 -0
- package/fesm2020/se.mjs.map +1 -0
- package/fesm2020/sg.mjs +137 -0
- package/fesm2020/sg.mjs.map +1 -0
- package/fesm2020/st.mjs +2469 -0
- package/fesm2020/st.mjs.map +1 -0
- package/fesm2020/sv.mjs +298 -0
- package/fesm2020/sv.mjs.map +1 -0
- package/fesm2020/tag-select.mjs +89 -0
- package/fesm2020/tag-select.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.d.ts +5 -0
- package/footer-toolbar/footer-toolbar.module.d.ts +8 -0
- package/footer-toolbar/package.json +6 -7
- 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.d.ts +5 -0
- package/full-content/full-content.module.d.ts +7 -0
- package/full-content/full-content.service.d.ts +3 -0
- package/full-content/package.json +6 -7
- 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.d.ts +5 -0
- package/global-footer/global-footer.module.d.ts +8 -0
- package/global-footer/package.json +6 -7
- 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.d.ts +5 -0
- package/notice-icon/notice-icon.module.d.ts +16 -0
- package/notice-icon/package.json +6 -7
- 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/schema.json +1 -1
- package/onboarding/style/index.less +6 -0
- package/package.json +274 -14
- package/page-header/package.json +6 -7
- package/page-header/page-header.component.d.ts +4 -1
- package/page-header/page-header.d.ts +5 -0
- package/page-header/page-header.module.d.ts +11 -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 +6 -7
- package/quick-menu/quick-menu.component.d.ts +6 -3
- package/quick-menu/quick-menu.d.ts +5 -0
- package/quick-menu/quick-menu.module.d.ts +8 -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 +6 -7
- 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.d.ts +5 -0
- package/reuse-tab/reuse-tab.module.d.ts +15 -0
- package/reuse-tab/reuse-tab.service.d.ts +7 -4
- package/reuse-tab/style/index.less +4 -0
- package/se/package.json +6 -7
- 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/{footer-toolbar/footerToolbar.d.ts → se/se.d.ts} +1 -0
- package/se/se.module.d.ts +10 -0
- package/se/style/index.less +2 -0
- package/sg/package.json +6 -7
- package/sg/sg-container.component.d.ts +4 -1
- package/sg/sg.component.d.ts +4 -1
- package/{error-collect/errorCollect.d.ts → sg/sg.d.ts} +1 -0
- package/sg/sg.module.d.ts +7 -0
- package/st/package.json +6 -7
- 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 +40 -12
- package/{down-file/downFile.d.ts → st/st.d.ts} +1 -0
- package/st/st.interfaces.d.ts +2 -2
- package/st/st.module.d.ts +27 -0
- package/st/style/index.less +8 -0
- package/sv/package.json +6 -7
- 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/{avatar-list/avatarList.d.ts → sv/sv.d.ts} +1 -0
- package/sv/sv.module.d.ts +12 -0
- package/tag-select/package.json +6 -7
- 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.d.ts +5 -0
- package/tag-select/tag-select.module.d.ts +8 -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 -2586
- 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.d.ts +0 -5
- 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/auto-focus/autoFocus.js +0 -5
- 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/avatar-list/avatarList.js +0 -5
- 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/down-file/downFile.js +0 -5
- 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/error-collect/errorCollect.js +0 -5
- 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/footer-toolbar/footerToolbar.js +0 -5
- 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/full-content/fullContent.js +0 -5
- 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/global-footer/globalFooter.js +0 -5
- 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/notice-icon/noticeIcon.js +0 -5
- 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/page-header/pageHeader.js +0 -5
- 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/quick-menu/quickMenu.js +0 -5
- 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/reuse-tab/reuseTab.js +0 -5
- package/esm2015/se/edit.js +0 -5
- 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/grid.js +0 -5
- 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/index.js +0 -2
- 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 -784
- 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/sv/view.js +0 -5
- package/esm2015/tag-select/tag-select.component.js +0 -70
- package/esm2015/tag-select/tag-select.module.js +0 -16
- package/esm2015/tag-select/tagSelect.js +0 -5
- 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.d.ts +0 -4
- package/full-content/fullContent.metadata.json +0 -1
- package/global-footer/globalFooter.d.ts +0 -4
- 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.d.ts +0 -4
- package/notice-icon/noticeIcon.metadata.json +0 -1
- package/onboarding/onboarding.metadata.json +0 -1
- package/page-header/pageHeader.d.ts +0 -4
- 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.d.ts +0 -4
- package/quick-menu/quickMenu.metadata.json +0 -1
- package/result/result.metadata.json +0 -1
- package/reuse-tab/reuseTab.d.ts +0 -4
- package/reuse-tab/reuseTab.metadata.json +0 -1
- package/se/edit.d.ts +0 -4
- package/se/edit.metadata.json +0 -1
- package/se/se-title.component.d.ts +0 -10
- package/sg/grid.d.ts +0 -4
- package/sg/grid.metadata.json +0 -1
- package/st/index.d.ts +0 -1
- package/st/st-td.component.d.ts +0 -27
- package/st/table.d.ts +0 -7
- package/st/table.metadata.json +0 -1
- package/sv/sv-title.component.d.ts +0 -10
- package/sv/view.d.ts +0 -4
- package/sv/view.metadata.json +0 -1
- package/tag-select/tagSelect.d.ts +0 -4
- package/tag-select/tagSelect.metadata.json +0 -1
- package/xlsx/xlsx.metadata.json +0 -1
- package/zip/zip.metadata.json +0 -1
|
@@ -0,0 +1,1106 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, Injectable, Directive, Optional, Inject, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@delon/theme';
|
|
4
|
+
import { ALAIN_I18N_TOKEN, DelonLocaleModule } from '@delon/theme';
|
|
5
|
+
import * as i2 from 'ng-zorro-antd/menu';
|
|
6
|
+
import { NzMenuModule } from 'ng-zorro-antd/menu';
|
|
7
|
+
import * as i6 from '@angular/common';
|
|
8
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
9
|
+
import { Subject, Subscription, BehaviorSubject, timer } from 'rxjs';
|
|
10
|
+
import * as i1$1 from '@angular/cdk/overlay';
|
|
11
|
+
import { ConnectionPositionPair, OverlayModule } from '@angular/cdk/overlay';
|
|
12
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
13
|
+
import { __decorate } from 'tslib';
|
|
14
|
+
import { takeUntil, filter, debounceTime } from 'rxjs/operators';
|
|
15
|
+
import { InputBoolean, InputNumber } from '@delon/util/decorator';
|
|
16
|
+
import * as i2$1 from '@angular/router';
|
|
17
|
+
import { ActivatedRoute, Router, ROUTER_CONFIGURATION, NavigationStart, NavigationEnd, RouterModule } from '@angular/router';
|
|
18
|
+
import { ScrollService } from '@delon/util/browser';
|
|
19
|
+
import * as i3 from '@angular/cdk/platform';
|
|
20
|
+
import * as i4 from 'ng-zorro-antd/tabs';
|
|
21
|
+
import { NzTabsModule } from 'ng-zorro-antd/tabs';
|
|
22
|
+
import * as i8 from 'ng-zorro-antd/icon';
|
|
23
|
+
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
24
|
+
|
|
25
|
+
class ReuseTabContextMenuComponent {
|
|
26
|
+
constructor(i18nSrv) {
|
|
27
|
+
this.i18nSrv = i18nSrv;
|
|
28
|
+
this.close = new EventEmitter();
|
|
29
|
+
}
|
|
30
|
+
set i18n(value) {
|
|
31
|
+
this._i18n = {
|
|
32
|
+
...this.i18nSrv.getData('reuseTab'),
|
|
33
|
+
...value
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
get i18n() {
|
|
37
|
+
return this._i18n;
|
|
38
|
+
}
|
|
39
|
+
get includeNonCloseable() {
|
|
40
|
+
return this.event.ctrlKey;
|
|
41
|
+
}
|
|
42
|
+
notify(type) {
|
|
43
|
+
this.close.next({
|
|
44
|
+
type,
|
|
45
|
+
item: this.item,
|
|
46
|
+
includeNonCloseable: this.includeNonCloseable
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
ngOnInit() {
|
|
50
|
+
if (this.includeNonCloseable)
|
|
51
|
+
this.item.closable = true;
|
|
52
|
+
}
|
|
53
|
+
click(e, type, custom) {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
if (type === 'close' && !this.item.closable)
|
|
57
|
+
return;
|
|
58
|
+
if (type === 'closeRight' && this.item.last)
|
|
59
|
+
return;
|
|
60
|
+
if (custom) {
|
|
61
|
+
if (this.isDisabled(custom))
|
|
62
|
+
return;
|
|
63
|
+
custom.fn(this.item, custom);
|
|
64
|
+
}
|
|
65
|
+
this.notify(type);
|
|
66
|
+
}
|
|
67
|
+
isDisabled(custom) {
|
|
68
|
+
return custom.disabled ? custom.disabled(this.item) : false;
|
|
69
|
+
}
|
|
70
|
+
closeMenu(event) {
|
|
71
|
+
if (event.type === 'click' && event.button === 2)
|
|
72
|
+
return;
|
|
73
|
+
this.notify(null);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
ReuseTabContextMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabContextMenuComponent, deps: [{ token: i1.DelonLocaleService }], target: i0.ɵɵFactoryTarget.Component });
|
|
77
|
+
ReuseTabContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ReuseTabContextMenuComponent, selector: "reuse-tab-context-menu", inputs: { i18n: "i18n", item: "item", event: "event", customContextMenu: "customContextMenu" }, outputs: { close: "close" }, host: { listeners: { "document:click": "closeMenu($event)", "document:contextmenu": "closeMenu($event)" } }, ngImport: i0, 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", directives: [{ type: i2.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { type: i2.NzMenuDividerDirective, selector: "[nz-menu-divider]", exportAs: ["nzMenuDivider"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabContextMenuComponent, decorators: [{
|
|
79
|
+
type: Component,
|
|
80
|
+
args: [{ selector: 'reuse-tab-context-menu', host: {
|
|
81
|
+
'(document:click)': 'closeMenu($event)',
|
|
82
|
+
'(document:contextmenu)': 'closeMenu($event)'
|
|
83
|
+
}, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, 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" }]
|
|
84
|
+
}], ctorParameters: function () { return [{ type: i1.DelonLocaleService }]; }, propDecorators: { i18n: [{
|
|
85
|
+
type: Input
|
|
86
|
+
}], item: [{
|
|
87
|
+
type: Input
|
|
88
|
+
}], event: [{
|
|
89
|
+
type: Input
|
|
90
|
+
}], customContextMenu: [{
|
|
91
|
+
type: Input
|
|
92
|
+
}], close: [{
|
|
93
|
+
type: Output
|
|
94
|
+
}] } });
|
|
95
|
+
|
|
96
|
+
class ReuseTabContextService {
|
|
97
|
+
constructor(overlay) {
|
|
98
|
+
this.overlay = overlay;
|
|
99
|
+
this.ref = null;
|
|
100
|
+
this.show = new Subject();
|
|
101
|
+
this.close = new Subject();
|
|
102
|
+
}
|
|
103
|
+
remove() {
|
|
104
|
+
if (!this.ref)
|
|
105
|
+
return;
|
|
106
|
+
this.ref.detach();
|
|
107
|
+
this.ref.dispose();
|
|
108
|
+
this.ref = null;
|
|
109
|
+
}
|
|
110
|
+
open(context) {
|
|
111
|
+
this.remove();
|
|
112
|
+
const { event, item, customContextMenu } = context;
|
|
113
|
+
const { x, y } = event;
|
|
114
|
+
const positions = [
|
|
115
|
+
new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }),
|
|
116
|
+
new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' })
|
|
117
|
+
];
|
|
118
|
+
const positionStrategy = this.overlay.position().flexibleConnectedTo({ x, y }).withPositions(positions);
|
|
119
|
+
this.ref = this.overlay.create({
|
|
120
|
+
positionStrategy,
|
|
121
|
+
panelClass: 'reuse-tab__cm',
|
|
122
|
+
scrollStrategy: this.overlay.scrollStrategies.close()
|
|
123
|
+
});
|
|
124
|
+
const comp = this.ref.attach(new ComponentPortal(ReuseTabContextMenuComponent));
|
|
125
|
+
const instance = comp.instance;
|
|
126
|
+
instance.i18n = this.i18n;
|
|
127
|
+
instance.item = { ...item };
|
|
128
|
+
instance.customContextMenu = customContextMenu;
|
|
129
|
+
instance.event = event;
|
|
130
|
+
const sub$ = new Subscription();
|
|
131
|
+
sub$.add(instance.close.subscribe((res) => {
|
|
132
|
+
this.close.next(res);
|
|
133
|
+
this.remove();
|
|
134
|
+
}));
|
|
135
|
+
comp.onDestroy(() => sub$.unsubscribe());
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
ReuseTabContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabContextService, deps: [{ token: i1$1.Overlay }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
139
|
+
ReuseTabContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabContextService });
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabContextService, decorators: [{
|
|
141
|
+
type: Injectable
|
|
142
|
+
}], ctorParameters: function () { return [{ type: i1$1.Overlay }]; } });
|
|
143
|
+
|
|
144
|
+
class ReuseTabContextComponent {
|
|
145
|
+
constructor(srv) {
|
|
146
|
+
this.srv = srv;
|
|
147
|
+
this.sub$ = new Subscription();
|
|
148
|
+
this.change = new EventEmitter();
|
|
149
|
+
this.sub$.add(srv.show.subscribe(context => this.srv.open(context)));
|
|
150
|
+
this.sub$.add(srv.close.subscribe(res => this.change.emit(res)));
|
|
151
|
+
}
|
|
152
|
+
set i18n(value) {
|
|
153
|
+
this.srv.i18n = value;
|
|
154
|
+
}
|
|
155
|
+
ngOnDestroy() {
|
|
156
|
+
this.sub$.unsubscribe();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
ReuseTabContextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabContextComponent, deps: [{ token: ReuseTabContextService }], target: i0.ɵɵFactoryTarget.Component });
|
|
160
|
+
ReuseTabContextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ReuseTabContextComponent, selector: "reuse-tab-context", inputs: { i18n: "i18n" }, outputs: { change: "change" }, ngImport: i0, template: ``, isInline: true });
|
|
161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabContextComponent, decorators: [{
|
|
162
|
+
type: Component,
|
|
163
|
+
args: [{
|
|
164
|
+
selector: 'reuse-tab-context',
|
|
165
|
+
template: ``
|
|
166
|
+
}]
|
|
167
|
+
}], ctorParameters: function () { return [{ type: ReuseTabContextService }]; }, propDecorators: { i18n: [{
|
|
168
|
+
type: Input
|
|
169
|
+
}], change: [{
|
|
170
|
+
type: Output
|
|
171
|
+
}] } });
|
|
172
|
+
|
|
173
|
+
class ReuseTabContextDirective {
|
|
174
|
+
constructor(srv) {
|
|
175
|
+
this.srv = srv;
|
|
176
|
+
}
|
|
177
|
+
_onContextMenu(event) {
|
|
178
|
+
this.srv.show.next({
|
|
179
|
+
event,
|
|
180
|
+
item: this.item,
|
|
181
|
+
customContextMenu: this.customContextMenu
|
|
182
|
+
});
|
|
183
|
+
event.preventDefault();
|
|
184
|
+
event.stopPropagation();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
ReuseTabContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabContextDirective, deps: [{ token: ReuseTabContextService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
188
|
+
ReuseTabContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: ReuseTabContextDirective, selector: "[reuse-tab-context-menu]", inputs: { item: ["reuse-tab-context-menu", "item"], customContextMenu: "customContextMenu" }, host: { listeners: { "contextmenu": "_onContextMenu($event)" } }, exportAs: ["reuseTabContextMenu"], ngImport: i0 });
|
|
189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabContextDirective, decorators: [{
|
|
190
|
+
type: Directive,
|
|
191
|
+
args: [{
|
|
192
|
+
selector: '[reuse-tab-context-menu]',
|
|
193
|
+
exportAs: 'reuseTabContextMenu',
|
|
194
|
+
host: {
|
|
195
|
+
'(contextmenu)': '_onContextMenu($event)'
|
|
196
|
+
}
|
|
197
|
+
}]
|
|
198
|
+
}], ctorParameters: function () { return [{ type: ReuseTabContextService }]; }, propDecorators: { item: [{
|
|
199
|
+
type: Input,
|
|
200
|
+
args: ['reuse-tab-context-menu']
|
|
201
|
+
}], customContextMenu: [{
|
|
202
|
+
type: Input
|
|
203
|
+
}] } });
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* 复用匹配模式
|
|
207
|
+
*/
|
|
208
|
+
var ReuseTabMatchMode;
|
|
209
|
+
(function (ReuseTabMatchMode) {
|
|
210
|
+
/**
|
|
211
|
+
* (推荐)按菜单 `Menu` 配置
|
|
212
|
+
*
|
|
213
|
+
* 可复用:
|
|
214
|
+
* - `{ text:'Dashboard' }`
|
|
215
|
+
* - `{ text:'Dashboard', reuse: true }`
|
|
216
|
+
*
|
|
217
|
+
* 不可复用:
|
|
218
|
+
* - `{ text:'Dashboard', reuse: false }`
|
|
219
|
+
*/
|
|
220
|
+
ReuseTabMatchMode[ReuseTabMatchMode["Menu"] = 0] = "Menu";
|
|
221
|
+
/**
|
|
222
|
+
* 按菜单 `Menu` 强制配置
|
|
223
|
+
*
|
|
224
|
+
* 可复用:
|
|
225
|
+
* - `{ text:'Dashboard', reuse: true }`
|
|
226
|
+
*
|
|
227
|
+
* 不可复用:
|
|
228
|
+
* - `{ text:'Dashboard' }`
|
|
229
|
+
* - `{ text:'Dashboard', reuse: false }`
|
|
230
|
+
*/
|
|
231
|
+
ReuseTabMatchMode[ReuseTabMatchMode["MenuForce"] = 1] = "MenuForce";
|
|
232
|
+
/**
|
|
233
|
+
* 对所有路由有效,可以配合 `excludes` 过滤无须复用路由
|
|
234
|
+
*/
|
|
235
|
+
ReuseTabMatchMode[ReuseTabMatchMode["URL"] = 2] = "URL";
|
|
236
|
+
})(ReuseTabMatchMode || (ReuseTabMatchMode = {}));
|
|
237
|
+
|
|
238
|
+
class ReuseTabService {
|
|
239
|
+
// #endregion
|
|
240
|
+
constructor(injector, menuService) {
|
|
241
|
+
this.injector = injector;
|
|
242
|
+
this.menuService = menuService;
|
|
243
|
+
this._inited = false;
|
|
244
|
+
this._max = 10;
|
|
245
|
+
this._keepingScroll = false;
|
|
246
|
+
this._cachedChange = new BehaviorSubject(null);
|
|
247
|
+
this._cached = [];
|
|
248
|
+
this._titleCached = {};
|
|
249
|
+
this._closableCached = {};
|
|
250
|
+
this.removeUrlBuffer = null;
|
|
251
|
+
this.positionBuffer = {};
|
|
252
|
+
this.debug = false;
|
|
253
|
+
this.routeParamMatchMode = 'strict';
|
|
254
|
+
this.mode = ReuseTabMatchMode.Menu;
|
|
255
|
+
/** 排除规则,限 `mode=URL` */
|
|
256
|
+
this.excludes = [];
|
|
257
|
+
}
|
|
258
|
+
get snapshot() {
|
|
259
|
+
return this.injector.get(ActivatedRoute).snapshot;
|
|
260
|
+
}
|
|
261
|
+
// #region public
|
|
262
|
+
/**
|
|
263
|
+
* Get init status
|
|
264
|
+
*
|
|
265
|
+
* 是否已经初始化完成
|
|
266
|
+
*/
|
|
267
|
+
get inited() {
|
|
268
|
+
return this._inited;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Current routing address
|
|
272
|
+
*
|
|
273
|
+
* 当前路由地址
|
|
274
|
+
*/
|
|
275
|
+
get curUrl() {
|
|
276
|
+
return this.getUrl(this.snapshot);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* 允许最多复用多少个页面,取值范围 `2-100`,值发生变更时会强制关闭且忽略可关闭条件
|
|
280
|
+
*/
|
|
281
|
+
set max(value) {
|
|
282
|
+
this._max = Math.min(Math.max(value, 2), 100);
|
|
283
|
+
for (let i = this._cached.length; i > this._max; i--) {
|
|
284
|
+
this._cached.pop();
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
set keepingScroll(value) {
|
|
288
|
+
this._keepingScroll = value;
|
|
289
|
+
this.initScroll();
|
|
290
|
+
}
|
|
291
|
+
get keepingScroll() {
|
|
292
|
+
return this._keepingScroll;
|
|
293
|
+
}
|
|
294
|
+
/** 获取已缓存的路由 */
|
|
295
|
+
get items() {
|
|
296
|
+
return this._cached;
|
|
297
|
+
}
|
|
298
|
+
/** 获取当前缓存的路由总数 */
|
|
299
|
+
get count() {
|
|
300
|
+
return this._cached.length;
|
|
301
|
+
}
|
|
302
|
+
/** 订阅缓存变更通知 */
|
|
303
|
+
get change() {
|
|
304
|
+
return this._cachedChange.asObservable(); // .pipe(filter(w => w !== null));
|
|
305
|
+
}
|
|
306
|
+
/** 自定义当前标题 */
|
|
307
|
+
set title(value) {
|
|
308
|
+
const url = this.curUrl;
|
|
309
|
+
if (typeof value === 'string')
|
|
310
|
+
value = { text: value };
|
|
311
|
+
this._titleCached[url] = value;
|
|
312
|
+
this.di('update current tag title: ', value);
|
|
313
|
+
this._cachedChange.next({
|
|
314
|
+
active: 'title',
|
|
315
|
+
url,
|
|
316
|
+
title: value,
|
|
317
|
+
list: this._cached
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
/** 获取指定路径缓存所在位置,`-1` 表示无缓存 */
|
|
321
|
+
index(url) {
|
|
322
|
+
return this._cached.findIndex(w => w.url === url);
|
|
323
|
+
}
|
|
324
|
+
/** 获取指定路径缓存是否存在 */
|
|
325
|
+
exists(url) {
|
|
326
|
+
return this.index(url) !== -1;
|
|
327
|
+
}
|
|
328
|
+
/** 获取指定路径缓存 */
|
|
329
|
+
get(url) {
|
|
330
|
+
return url ? this._cached.find(w => w.url === url) || null : null;
|
|
331
|
+
}
|
|
332
|
+
remove(url, includeNonCloseable) {
|
|
333
|
+
const idx = typeof url === 'string' ? this.index(url) : url;
|
|
334
|
+
const item = idx !== -1 ? this._cached[idx] : null;
|
|
335
|
+
if (!item || (!includeNonCloseable && !item.closable))
|
|
336
|
+
return false;
|
|
337
|
+
this.destroy(item._handle);
|
|
338
|
+
this._cached.splice(idx, 1);
|
|
339
|
+
delete this._titleCached[url];
|
|
340
|
+
return true;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* 根据URL移除标签
|
|
344
|
+
*
|
|
345
|
+
* @param [includeNonCloseable=false] 是否强制包含不可关闭
|
|
346
|
+
*/
|
|
347
|
+
close(url, includeNonCloseable = false) {
|
|
348
|
+
this.removeUrlBuffer = url;
|
|
349
|
+
this.remove(url, includeNonCloseable);
|
|
350
|
+
this._cachedChange.next({ active: 'close', url, list: this._cached });
|
|
351
|
+
this.di('close tag', url);
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* 清除右边
|
|
356
|
+
*
|
|
357
|
+
* @param [includeNonCloseable=false] 是否强制包含不可关闭
|
|
358
|
+
*/
|
|
359
|
+
closeRight(url, includeNonCloseable = false) {
|
|
360
|
+
const start = this.index(url);
|
|
361
|
+
for (let i = this.count - 1; i > start; i--) {
|
|
362
|
+
this.remove(i, includeNonCloseable);
|
|
363
|
+
}
|
|
364
|
+
this.removeUrlBuffer = null;
|
|
365
|
+
this._cachedChange.next({ active: 'closeRight', url, list: this._cached });
|
|
366
|
+
this.di('close right tages', url);
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* 清除所有缓存
|
|
371
|
+
*
|
|
372
|
+
* @param [includeNonCloseable=false] 是否强制包含不可关闭
|
|
373
|
+
*/
|
|
374
|
+
clear(includeNonCloseable = false) {
|
|
375
|
+
this._cached.forEach(w => {
|
|
376
|
+
if (!includeNonCloseable && w.closable)
|
|
377
|
+
this.destroy(w._handle);
|
|
378
|
+
});
|
|
379
|
+
this._cached = this._cached.filter(w => !includeNonCloseable && !w.closable);
|
|
380
|
+
this.removeUrlBuffer = null;
|
|
381
|
+
this._cachedChange.next({ active: 'clear', list: this._cached });
|
|
382
|
+
this.di('clear all catch');
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* 移动缓存数据
|
|
386
|
+
*
|
|
387
|
+
* @param url 要移动的URL地址
|
|
388
|
+
* @param position 新位置,下标从 `0` 开始
|
|
389
|
+
*
|
|
390
|
+
* @example
|
|
391
|
+
* ```
|
|
392
|
+
* // source
|
|
393
|
+
* [ '/a/1', '/a/2', '/a/3', '/a/4', '/a/5' ]
|
|
394
|
+
* move('/a/1', 2);
|
|
395
|
+
* // output
|
|
396
|
+
* [ '/a/2', '/a/3', '/a/1', '/a/4', '/a/5' ]
|
|
397
|
+
* move('/a/1', -1);
|
|
398
|
+
* // output
|
|
399
|
+
* [ '/a/2', '/a/3', '/a/4', '/a/5', '/a/1' ]
|
|
400
|
+
* ```
|
|
401
|
+
*/
|
|
402
|
+
move(url, position) {
|
|
403
|
+
const start = this._cached.findIndex(w => w.url === url);
|
|
404
|
+
if (start === -1)
|
|
405
|
+
return;
|
|
406
|
+
const data = this._cached.slice();
|
|
407
|
+
data.splice(position < 0 ? data.length + position : position, 0, data.splice(start, 1)[0]);
|
|
408
|
+
this._cached = data;
|
|
409
|
+
this._cachedChange.next({
|
|
410
|
+
active: 'move',
|
|
411
|
+
url,
|
|
412
|
+
position,
|
|
413
|
+
list: this._cached
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* 强制关闭当前路由(包含不可关闭状态),并重新导航至 `newUrl` 路由
|
|
418
|
+
*/
|
|
419
|
+
replace(newUrl) {
|
|
420
|
+
const url = this.curUrl;
|
|
421
|
+
if (this.exists(url)) {
|
|
422
|
+
this.close(url, true);
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
this.removeUrlBuffer = url;
|
|
426
|
+
}
|
|
427
|
+
this.injector.get(Router).navigateByUrl(newUrl);
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* 获取标题,顺序如下:
|
|
431
|
+
*
|
|
432
|
+
* 1. 组件内使用 `ReuseTabService.title = 'new title'` 重新指定文本
|
|
433
|
+
* 2. 路由配置中 data 属性中包含 titleI18n > title
|
|
434
|
+
* 3. 菜单数据中 text 属性
|
|
435
|
+
*
|
|
436
|
+
* @param url 指定URL
|
|
437
|
+
* @param route 指定路由快照
|
|
438
|
+
*/
|
|
439
|
+
getTitle(url, route) {
|
|
440
|
+
if (this._titleCached[url]) {
|
|
441
|
+
return this._titleCached[url];
|
|
442
|
+
}
|
|
443
|
+
if (route && route.data && (route.data.titleI18n || route.data.title)) {
|
|
444
|
+
return {
|
|
445
|
+
text: route.data.title,
|
|
446
|
+
i18n: route.data.titleI18n
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
const menu = this.getMenu(url);
|
|
450
|
+
return menu ? { text: menu.text, i18n: menu.i18n } : { text: url };
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* 清除标题缓存
|
|
454
|
+
*/
|
|
455
|
+
clearTitleCached() {
|
|
456
|
+
this._titleCached = {};
|
|
457
|
+
}
|
|
458
|
+
/** 自定义当前 `closable` 状态 */
|
|
459
|
+
set closable(value) {
|
|
460
|
+
const url = this.curUrl;
|
|
461
|
+
this._closableCached[url] = value;
|
|
462
|
+
this.di('update current tag closable: ', value);
|
|
463
|
+
this._cachedChange.next({
|
|
464
|
+
active: 'closable',
|
|
465
|
+
closable: value,
|
|
466
|
+
list: this._cached
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* 获取 `closable` 状态,顺序如下:
|
|
471
|
+
*
|
|
472
|
+
* 1. 组件内使用 `ReuseTabService.closable = true` 重新指定 `closable` 状态
|
|
473
|
+
* 2. 路由配置中 data 属性中包含 `reuseClosable`
|
|
474
|
+
* 3. 菜单数据中 `reuseClosable` 属性
|
|
475
|
+
*
|
|
476
|
+
* @param url 指定URL
|
|
477
|
+
* @param route 指定路由快照
|
|
478
|
+
*/
|
|
479
|
+
getClosable(url, route) {
|
|
480
|
+
if (typeof this._closableCached[url] !== 'undefined')
|
|
481
|
+
return this._closableCached[url];
|
|
482
|
+
if (route && route.data && typeof route.data.reuseClosable === 'boolean')
|
|
483
|
+
return route.data.reuseClosable;
|
|
484
|
+
const menu = this.mode !== ReuseTabMatchMode.URL ? this.getMenu(url) : null;
|
|
485
|
+
if (menu && typeof menu.reuseClosable === 'boolean')
|
|
486
|
+
return menu.reuseClosable;
|
|
487
|
+
return true;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* 清空 `closable` 缓存
|
|
491
|
+
*/
|
|
492
|
+
clearClosableCached() {
|
|
493
|
+
this._closableCached = {};
|
|
494
|
+
}
|
|
495
|
+
getTruthRoute(route) {
|
|
496
|
+
let next = route;
|
|
497
|
+
while (next.firstChild)
|
|
498
|
+
next = next.firstChild;
|
|
499
|
+
return next;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* 根据快照获取URL地址
|
|
503
|
+
*/
|
|
504
|
+
getUrl(route) {
|
|
505
|
+
let next = this.getTruthRoute(route);
|
|
506
|
+
const segments = [];
|
|
507
|
+
while (next) {
|
|
508
|
+
segments.push(next.url.join('/'));
|
|
509
|
+
next = next.parent;
|
|
510
|
+
}
|
|
511
|
+
const url = `/${segments
|
|
512
|
+
.filter(i => i)
|
|
513
|
+
.reverse()
|
|
514
|
+
.join('/')}`;
|
|
515
|
+
return url;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* 检查快照是否允许被复用
|
|
519
|
+
*/
|
|
520
|
+
can(route) {
|
|
521
|
+
const url = this.getUrl(route);
|
|
522
|
+
if (url === this.removeUrlBuffer)
|
|
523
|
+
return false;
|
|
524
|
+
if (route.data && typeof route.data.reuse === 'boolean')
|
|
525
|
+
return route.data.reuse;
|
|
526
|
+
if (this.mode !== ReuseTabMatchMode.URL) {
|
|
527
|
+
const menu = this.getMenu(url);
|
|
528
|
+
if (!menu)
|
|
529
|
+
return false;
|
|
530
|
+
if (this.mode === ReuseTabMatchMode.Menu) {
|
|
531
|
+
if (menu.reuse === false)
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
if (!menu.reuse || menu.reuse !== true)
|
|
536
|
+
return false;
|
|
537
|
+
}
|
|
538
|
+
return true;
|
|
539
|
+
}
|
|
540
|
+
return !this.isExclude(url);
|
|
541
|
+
}
|
|
542
|
+
isExclude(url) {
|
|
543
|
+
return this.excludes.findIndex(r => r.test(url)) !== -1;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* 刷新,触发一个 refresh 类型事件
|
|
547
|
+
*/
|
|
548
|
+
refresh(data) {
|
|
549
|
+
this._cachedChange.next({ active: 'refresh', data });
|
|
550
|
+
}
|
|
551
|
+
// #endregion
|
|
552
|
+
// #region privates
|
|
553
|
+
destroy(_handle) {
|
|
554
|
+
if (_handle && _handle.componentRef && _handle.componentRef.destroy)
|
|
555
|
+
_handle.componentRef.destroy();
|
|
556
|
+
}
|
|
557
|
+
di(...args) {
|
|
558
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
559
|
+
if (!this.debug)
|
|
560
|
+
return;
|
|
561
|
+
console.warn(...args);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
init() {
|
|
565
|
+
this.initScroll();
|
|
566
|
+
this._inited = true;
|
|
567
|
+
}
|
|
568
|
+
getMenu(url) {
|
|
569
|
+
const menus = this.menuService.getPathByUrl(url);
|
|
570
|
+
if (!menus || menus.length === 0)
|
|
571
|
+
return null;
|
|
572
|
+
return menus.pop();
|
|
573
|
+
}
|
|
574
|
+
runHook(method, comp, type = 'init') {
|
|
575
|
+
if (typeof comp === 'number') {
|
|
576
|
+
const item = this._cached[comp];
|
|
577
|
+
comp = item._handle.componentRef;
|
|
578
|
+
}
|
|
579
|
+
if (comp == null || !comp.instance) {
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
const compThis = comp.instance;
|
|
583
|
+
const fn = compThis[method];
|
|
584
|
+
if (typeof fn !== 'function') {
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
if (method === '_onReuseInit') {
|
|
588
|
+
fn.call(compThis, type);
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
fn.call(compThis);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
hasInValidRoute(route) {
|
|
595
|
+
return !route.routeConfig || !!route.routeConfig.loadChildren || !!route.routeConfig.children;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* 决定是否允许路由复用,若 `true` 会触发 `store`
|
|
599
|
+
*/
|
|
600
|
+
shouldDetach(route) {
|
|
601
|
+
if (this.hasInValidRoute(route))
|
|
602
|
+
return false;
|
|
603
|
+
this.di('#shouldDetach', this.can(route), this.getUrl(route));
|
|
604
|
+
return this.can(route);
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* 存储
|
|
608
|
+
*/
|
|
609
|
+
store(_snapshot, _handle) {
|
|
610
|
+
const url = this.getUrl(_snapshot);
|
|
611
|
+
const idx = this.index(url);
|
|
612
|
+
const isAdd = idx === -1;
|
|
613
|
+
const item = {
|
|
614
|
+
title: this.getTitle(url, _snapshot),
|
|
615
|
+
closable: this.getClosable(url, _snapshot),
|
|
616
|
+
position: this.getKeepingScroll(url, _snapshot) ? this.positionBuffer[url] : null,
|
|
617
|
+
url,
|
|
618
|
+
_snapshot,
|
|
619
|
+
_handle
|
|
620
|
+
};
|
|
621
|
+
if (isAdd) {
|
|
622
|
+
if (this.count >= this._max) {
|
|
623
|
+
// Get the oldest closable location
|
|
624
|
+
const closeIdx = this._cached.findIndex(w => w.closable);
|
|
625
|
+
if (closeIdx !== -1)
|
|
626
|
+
this.remove(closeIdx, false);
|
|
627
|
+
}
|
|
628
|
+
this._cached.push(item);
|
|
629
|
+
}
|
|
630
|
+
else {
|
|
631
|
+
// Current handler is null when activate routes
|
|
632
|
+
// For better reliability, we need to wait for the component to be attached before call _onReuseInit
|
|
633
|
+
const cahcedComponentRef = this._cached[idx]._handle?.componentRef;
|
|
634
|
+
if (_handle == null && cahcedComponentRef != null) {
|
|
635
|
+
timer(100).subscribe(() => this.runHook('_onReuseInit', cahcedComponentRef));
|
|
636
|
+
}
|
|
637
|
+
this._cached[idx] = item;
|
|
638
|
+
}
|
|
639
|
+
this.removeUrlBuffer = null;
|
|
640
|
+
this.di('#store', isAdd ? '[new]' : '[override]', url);
|
|
641
|
+
if (_handle && _handle.componentRef) {
|
|
642
|
+
this.runHook('_onReuseDestroy', _handle.componentRef);
|
|
643
|
+
}
|
|
644
|
+
if (!isAdd) {
|
|
645
|
+
this._cachedChange.next({ active: 'override', item, list: this._cached });
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* 决定是否允许应用缓存数据
|
|
650
|
+
*/
|
|
651
|
+
shouldAttach(route) {
|
|
652
|
+
if (this.hasInValidRoute(route))
|
|
653
|
+
return false;
|
|
654
|
+
const url = this.getUrl(route);
|
|
655
|
+
const data = this.get(url);
|
|
656
|
+
const ret = !!(data && data._handle);
|
|
657
|
+
this.di('#shouldAttach', ret, url);
|
|
658
|
+
if (!ret) {
|
|
659
|
+
this._cachedChange.next({ active: 'add', url, list: this._cached });
|
|
660
|
+
}
|
|
661
|
+
return ret;
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* 提取复用数据
|
|
665
|
+
*/
|
|
666
|
+
retrieve(route) {
|
|
667
|
+
if (this.hasInValidRoute(route))
|
|
668
|
+
return null;
|
|
669
|
+
const url = this.getUrl(route);
|
|
670
|
+
const data = this.get(url);
|
|
671
|
+
const ret = (data && data._handle) || null;
|
|
672
|
+
this.di('#retrieve', url, ret);
|
|
673
|
+
return ret;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* 决定是否应该进行复用路由处理
|
|
677
|
+
*/
|
|
678
|
+
shouldReuseRoute(future, curr) {
|
|
679
|
+
let ret = future.routeConfig === curr.routeConfig;
|
|
680
|
+
if (!ret)
|
|
681
|
+
return false;
|
|
682
|
+
const path = ((future.routeConfig && future.routeConfig.path) || '');
|
|
683
|
+
if (path.length > 0 && ~path.indexOf(':')) {
|
|
684
|
+
if (this.routeParamMatchMode === 'strict') {
|
|
685
|
+
ret = this.getUrl(future) === this.getUrl(curr);
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
ret = path === ((curr.routeConfig && curr.routeConfig.path) || '');
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
this.di('=====================');
|
|
692
|
+
this.di('#shouldReuseRoute', ret, `${this.getUrl(curr)}=>${this.getUrl(future)}`, future, curr);
|
|
693
|
+
return ret;
|
|
694
|
+
}
|
|
695
|
+
// #region scroll
|
|
696
|
+
/**
|
|
697
|
+
* 获取 `keepingScroll` 状态,顺序如下:
|
|
698
|
+
*
|
|
699
|
+
* 1. 路由配置中 data 属性中包含 `keepingScroll`
|
|
700
|
+
* 2. 菜单数据中 `keepingScroll` 属性
|
|
701
|
+
* 3. 组件 `keepingScroll` 值
|
|
702
|
+
*/
|
|
703
|
+
getKeepingScroll(url, route) {
|
|
704
|
+
if (route && route.data && typeof route.data.keepingScroll === 'boolean')
|
|
705
|
+
return route.data.keepingScroll;
|
|
706
|
+
const menu = this.mode !== ReuseTabMatchMode.URL ? this.getMenu(url) : null;
|
|
707
|
+
if (menu && typeof menu.keepingScroll === 'boolean')
|
|
708
|
+
return menu.keepingScroll;
|
|
709
|
+
return this.keepingScroll;
|
|
710
|
+
}
|
|
711
|
+
get isDisabledInRouter() {
|
|
712
|
+
const routerConfig = this.injector.get(ROUTER_CONFIGURATION, {});
|
|
713
|
+
return routerConfig.scrollPositionRestoration === 'disabled';
|
|
714
|
+
}
|
|
715
|
+
get ss() {
|
|
716
|
+
return this.injector.get(ScrollService);
|
|
717
|
+
}
|
|
718
|
+
initScroll() {
|
|
719
|
+
if (this._router$) {
|
|
720
|
+
this._router$.unsubscribe();
|
|
721
|
+
}
|
|
722
|
+
this._router$ = this.injector.get(Router).events.subscribe(e => {
|
|
723
|
+
if (e instanceof NavigationStart) {
|
|
724
|
+
const url = this.curUrl;
|
|
725
|
+
if (this.getKeepingScroll(url, this.getTruthRoute(this.snapshot))) {
|
|
726
|
+
this.positionBuffer[url] = this.ss.getScrollPosition(this.keepingScrollContainer);
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
delete this.positionBuffer[url];
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
else if (e instanceof NavigationEnd) {
|
|
733
|
+
const url = this.curUrl;
|
|
734
|
+
const item = this.get(url);
|
|
735
|
+
if (item && item.position && this.getKeepingScroll(url, this.getTruthRoute(this.snapshot))) {
|
|
736
|
+
if (this.isDisabledInRouter) {
|
|
737
|
+
this.ss.scrollToPosition(this.keepingScrollContainer, item.position);
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
setTimeout(() => this.ss.scrollToPosition(this.keepingScrollContainer, item.position), 1);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
// #endregion
|
|
747
|
+
ngOnDestroy() {
|
|
748
|
+
const { _cachedChange, _router$ } = this;
|
|
749
|
+
this.clear();
|
|
750
|
+
this._cached = [];
|
|
751
|
+
_cachedChange.complete();
|
|
752
|
+
if (_router$) {
|
|
753
|
+
_router$.unsubscribe();
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
ReuseTabService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabService, deps: [{ token: i0.Injector }, { token: i1.MenuService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
758
|
+
ReuseTabService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabService, providedIn: 'root' });
|
|
759
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabService, decorators: [{
|
|
760
|
+
type: Injectable,
|
|
761
|
+
args: [{ providedIn: 'root' }]
|
|
762
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.MenuService }]; } });
|
|
763
|
+
|
|
764
|
+
class ReuseTabComponent {
|
|
765
|
+
// #endregion
|
|
766
|
+
constructor(srv, cdr, router, route, i18nSrv, doc, platform) {
|
|
767
|
+
this.srv = srv;
|
|
768
|
+
this.cdr = cdr;
|
|
769
|
+
this.router = router;
|
|
770
|
+
this.route = route;
|
|
771
|
+
this.i18nSrv = i18nSrv;
|
|
772
|
+
this.doc = doc;
|
|
773
|
+
this.platform = platform;
|
|
774
|
+
this.destroy$ = new Subject();
|
|
775
|
+
this.list = [];
|
|
776
|
+
this.pos = 0;
|
|
777
|
+
// #region fields
|
|
778
|
+
this.mode = ReuseTabMatchMode.Menu;
|
|
779
|
+
this.debug = false;
|
|
780
|
+
this.allowClose = true;
|
|
781
|
+
this.keepingScroll = false;
|
|
782
|
+
this.customContextMenu = [];
|
|
783
|
+
this.tabBarStyle = null;
|
|
784
|
+
this.tabType = 'line';
|
|
785
|
+
this.routeParamMatchMode = 'strict';
|
|
786
|
+
this.disabled = false;
|
|
787
|
+
this.change = new EventEmitter();
|
|
788
|
+
this.close = new EventEmitter();
|
|
789
|
+
}
|
|
790
|
+
set keepingScrollContainer(value) {
|
|
791
|
+
this._keepingScrollContainer = typeof value === 'string' ? this.doc.querySelector(value) : value;
|
|
792
|
+
}
|
|
793
|
+
genTit(title) {
|
|
794
|
+
return title.i18n && this.i18nSrv ? this.i18nSrv.fanyi(title.i18n) : title.text;
|
|
795
|
+
}
|
|
796
|
+
get curUrl() {
|
|
797
|
+
return this.srv.getUrl(this.route.snapshot);
|
|
798
|
+
}
|
|
799
|
+
genCurItem() {
|
|
800
|
+
const url = this.curUrl;
|
|
801
|
+
const snapshotTrue = this.srv.getTruthRoute(this.route.snapshot);
|
|
802
|
+
return {
|
|
803
|
+
url,
|
|
804
|
+
title: this.genTit(this.srv.getTitle(url, snapshotTrue)),
|
|
805
|
+
closable: this.allowClose && this.srv.count > 0 && this.srv.getClosable(url, snapshotTrue),
|
|
806
|
+
active: false,
|
|
807
|
+
last: false,
|
|
808
|
+
index: 0
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
genList(notify) {
|
|
812
|
+
const ls = this.srv.items.map((item, index) => ({
|
|
813
|
+
url: item.url,
|
|
814
|
+
title: this.genTit(item.title),
|
|
815
|
+
closable: this.allowClose && item.closable && this.srv.count > 0,
|
|
816
|
+
index,
|
|
817
|
+
active: false,
|
|
818
|
+
last: false
|
|
819
|
+
}));
|
|
820
|
+
// debugger;
|
|
821
|
+
const url = this.curUrl;
|
|
822
|
+
let addCurrent = ls.findIndex(w => w.url === url) === -1;
|
|
823
|
+
if (notify && notify.active === 'close' && notify.url === url) {
|
|
824
|
+
addCurrent = false;
|
|
825
|
+
let toPos = 0;
|
|
826
|
+
const curItem = this.list.find(w => w.url === url);
|
|
827
|
+
if (curItem.index === ls.length) {
|
|
828
|
+
// When closed is last
|
|
829
|
+
toPos = ls.length - 1;
|
|
830
|
+
}
|
|
831
|
+
else if (curItem.index < ls.length) {
|
|
832
|
+
// Should be actived next tab when closed is middle
|
|
833
|
+
toPos = Math.max(0, curItem.index);
|
|
834
|
+
}
|
|
835
|
+
this.router.navigateByUrl(ls[toPos].url);
|
|
836
|
+
}
|
|
837
|
+
if (addCurrent) {
|
|
838
|
+
ls.splice(this.pos + 1, 0, this.genCurItem());
|
|
839
|
+
}
|
|
840
|
+
ls.forEach((item, index) => (item.index = index));
|
|
841
|
+
if (ls.length === 1) {
|
|
842
|
+
ls[0].closable = false;
|
|
843
|
+
}
|
|
844
|
+
this.list = ls;
|
|
845
|
+
this.cdr.detectChanges();
|
|
846
|
+
this.updatePos();
|
|
847
|
+
}
|
|
848
|
+
updateTitle(res) {
|
|
849
|
+
const item = this.list.find(w => w.url === res.url);
|
|
850
|
+
if (!item)
|
|
851
|
+
return;
|
|
852
|
+
item.title = this.genTit(res.title);
|
|
853
|
+
this.cdr.detectChanges();
|
|
854
|
+
}
|
|
855
|
+
refresh(item) {
|
|
856
|
+
this.srv.runHook('_onReuseInit', this.pos === item.index ? this.srv.componentRef : item.index, 'refresh');
|
|
857
|
+
}
|
|
858
|
+
// #region UI
|
|
859
|
+
contextMenuChange(res) {
|
|
860
|
+
let fn = null;
|
|
861
|
+
switch (res.type) {
|
|
862
|
+
case 'refresh':
|
|
863
|
+
this.refresh(res.item);
|
|
864
|
+
break;
|
|
865
|
+
case 'close':
|
|
866
|
+
this._close(null, res.item.index, res.includeNonCloseable);
|
|
867
|
+
break;
|
|
868
|
+
case 'closeRight':
|
|
869
|
+
fn = () => {
|
|
870
|
+
this.srv.closeRight(res.item.url, res.includeNonCloseable);
|
|
871
|
+
this.close.emit(null);
|
|
872
|
+
};
|
|
873
|
+
break;
|
|
874
|
+
case 'closeOther':
|
|
875
|
+
fn = () => {
|
|
876
|
+
this.srv.clear(res.includeNonCloseable);
|
|
877
|
+
this.close.emit(null);
|
|
878
|
+
};
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
if (!fn) {
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
if (!res.item.active && res.item.index <= this.list.find(w => w.active).index) {
|
|
885
|
+
this._to(res.item.index, fn);
|
|
886
|
+
}
|
|
887
|
+
else {
|
|
888
|
+
fn();
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
_to(index, cb) {
|
|
892
|
+
index = Math.max(0, Math.min(index, this.list.length - 1));
|
|
893
|
+
const item = this.list[index];
|
|
894
|
+
this.router.navigateByUrl(item.url).then(res => {
|
|
895
|
+
if (!res)
|
|
896
|
+
return;
|
|
897
|
+
this.item = item;
|
|
898
|
+
this.change.emit(item);
|
|
899
|
+
if (cb) {
|
|
900
|
+
cb();
|
|
901
|
+
}
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
_close(e, idx, includeNonCloseable) {
|
|
905
|
+
if (e != null) {
|
|
906
|
+
e.preventDefault();
|
|
907
|
+
e.stopPropagation();
|
|
908
|
+
}
|
|
909
|
+
const item = this.list[idx];
|
|
910
|
+
this.srv.close(item.url, includeNonCloseable);
|
|
911
|
+
this.close.emit(item);
|
|
912
|
+
this.cdr.detectChanges();
|
|
913
|
+
return false;
|
|
914
|
+
}
|
|
915
|
+
activate(instance) {
|
|
916
|
+
this.srv.componentRef = { instance };
|
|
917
|
+
}
|
|
918
|
+
updatePos() {
|
|
919
|
+
const url = this.srv.getUrl(this.route.snapshot);
|
|
920
|
+
const ls = this.list.filter(w => w.url === url || !this.srv.isExclude(w.url));
|
|
921
|
+
if (ls.length === 0) {
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
const last = ls[ls.length - 1];
|
|
925
|
+
const item = ls.find(w => w.url === url);
|
|
926
|
+
last.last = true;
|
|
927
|
+
const pos = item == null ? last.index : item.index;
|
|
928
|
+
ls.forEach((i, idx) => (i.active = pos === idx));
|
|
929
|
+
this.pos = pos;
|
|
930
|
+
// TODO: 目前无法知道为什么 `pos` 无法通过 `nzSelectedIndex` 生效,因此强制使用组件实例的方式来修改,这种方式是安全的
|
|
931
|
+
// https://github.com/ng-alain/ng-alain/issues/1736
|
|
932
|
+
this.tabset.nzSelectedIndex = pos;
|
|
933
|
+
this.list = ls;
|
|
934
|
+
this.cdr.detectChanges();
|
|
935
|
+
}
|
|
936
|
+
// #endregion
|
|
937
|
+
ngOnInit() {
|
|
938
|
+
if (!this.platform.isBrowser) {
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
this.srv.change.pipe(takeUntil(this.destroy$)).subscribe(res => {
|
|
942
|
+
switch (res?.active) {
|
|
943
|
+
case 'title':
|
|
944
|
+
this.updateTitle(res);
|
|
945
|
+
return;
|
|
946
|
+
case 'override':
|
|
947
|
+
if (res?.list?.length === this.list.length) {
|
|
948
|
+
this.updatePos();
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
break;
|
|
952
|
+
}
|
|
953
|
+
this.genList(res);
|
|
954
|
+
});
|
|
955
|
+
this.i18nSrv.change
|
|
956
|
+
.pipe(filter(() => this.srv.inited), takeUntil(this.destroy$), debounceTime(100))
|
|
957
|
+
.subscribe(() => this.genList({ active: 'title' }));
|
|
958
|
+
this.srv.init();
|
|
959
|
+
}
|
|
960
|
+
ngOnChanges(changes) {
|
|
961
|
+
if (!this.platform.isBrowser) {
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
if (changes.max)
|
|
965
|
+
this.srv.max = this.max;
|
|
966
|
+
if (changes.excludes)
|
|
967
|
+
this.srv.excludes = this.excludes;
|
|
968
|
+
if (changes.mode)
|
|
969
|
+
this.srv.mode = this.mode;
|
|
970
|
+
if (changes.routeParamMatchMode)
|
|
971
|
+
this.srv.routeParamMatchMode = this.routeParamMatchMode;
|
|
972
|
+
if (changes.keepingScroll) {
|
|
973
|
+
this.srv.keepingScroll = this.keepingScroll;
|
|
974
|
+
this.srv.keepingScrollContainer = this._keepingScrollContainer;
|
|
975
|
+
}
|
|
976
|
+
this.srv.debug = this.debug;
|
|
977
|
+
this.cdr.detectChanges();
|
|
978
|
+
}
|
|
979
|
+
ngOnDestroy() {
|
|
980
|
+
const { destroy$ } = this;
|
|
981
|
+
destroy$.next();
|
|
982
|
+
destroy$.complete();
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
ReuseTabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabComponent, deps: [{ token: ReuseTabService }, { token: i0.ChangeDetectorRef }, { token: i2$1.Router }, { token: i2$1.ActivatedRoute }, { token: ALAIN_I18N_TOKEN, optional: true }, { token: DOCUMENT }, { token: i3.Platform }], target: i0.ɵɵFactoryTarget.Component });
|
|
986
|
+
ReuseTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ReuseTabComponent, selector: "reuse-tab, [reuse-tab]", inputs: { mode: "mode", i18n: "i18n", debug: "debug", max: "max", tabMaxWidth: "tabMaxWidth", excludes: "excludes", allowClose: "allowClose", keepingScroll: "keepingScroll", keepingScrollContainer: "keepingScrollContainer", customContextMenu: "customContextMenu", tabBarExtraContent: "tabBarExtraContent", tabBarGutter: "tabBarGutter", tabBarStyle: "tabBarStyle", tabType: "tabType", routeParamMatchMode: "routeParamMatchMode", disabled: "disabled", titleRender: "titleRender" }, outputs: { change: "change", close: "close" }, host: { properties: { "class.reuse-tab": "true", "class.reuse-tab__line": "tabType === 'line'", "class.reuse-tab__card": "tabType === 'card'", "class.reuse-tab__disabled": "disabled" } }, providers: [ReuseTabContextService], viewQueries: [{ propertyName: "tabset", first: true, predicate: ["tabset"], descendants: true }], exportAs: ["reuseTab"], usesOnChanges: true, ngImport: i0, 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", components: [{ type: i4.NzTabSetComponent, selector: "nz-tabset", inputs: ["nzSelectedIndex", "nzTabPosition", "nzTabBarExtraContent", "nzCanDeactivate", "nzAddIcon", "nzTabBarStyle", "nzType", "nzSize", "nzAnimated", "nzTabBarGutter", "nzHideAdd", "nzCentered", "nzHideAll", "nzLinkRouter", "nzLinkExact"], outputs: ["nzSelectChange", "nzSelectedIndexChange", "nzTabListScroll", "nzClose", "nzAdd"], exportAs: ["nzTabset"] }, { type: i4.NzTabComponent, selector: "nz-tab", inputs: ["nzTitle", "nzClosable", "nzCloseIcon", "nzDisabled", "nzForceRender"], outputs: ["nzSelect", "nzDeselect", "nzClick", "nzContextmenu"], exportAs: ["nzTab"] }, { type: ReuseTabContextComponent, selector: "reuse-tab-context", inputs: ["i18n"], outputs: ["change"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: ReuseTabContextDirective, selector: "[reuse-tab-context-menu]", inputs: ["reuse-tab-context-menu", "customContextMenu"], exportAs: ["reuseTabContextMenu"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
987
|
+
__decorate([
|
|
988
|
+
InputBoolean()
|
|
989
|
+
], ReuseTabComponent.prototype, "debug", void 0);
|
|
990
|
+
__decorate([
|
|
991
|
+
InputNumber()
|
|
992
|
+
], ReuseTabComponent.prototype, "max", void 0);
|
|
993
|
+
__decorate([
|
|
994
|
+
InputNumber()
|
|
995
|
+
], ReuseTabComponent.prototype, "tabMaxWidth", void 0);
|
|
996
|
+
__decorate([
|
|
997
|
+
InputBoolean()
|
|
998
|
+
], ReuseTabComponent.prototype, "allowClose", void 0);
|
|
999
|
+
__decorate([
|
|
1000
|
+
InputBoolean()
|
|
1001
|
+
], ReuseTabComponent.prototype, "keepingScroll", void 0);
|
|
1002
|
+
__decorate([
|
|
1003
|
+
InputBoolean()
|
|
1004
|
+
], ReuseTabComponent.prototype, "disabled", void 0);
|
|
1005
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabComponent, decorators: [{
|
|
1006
|
+
type: Component,
|
|
1007
|
+
args: [{ selector: 'reuse-tab, [reuse-tab]', exportAs: 'reuseTab', host: {
|
|
1008
|
+
'[class.reuse-tab]': 'true',
|
|
1009
|
+
'[class.reuse-tab__line]': `tabType === 'line'`,
|
|
1010
|
+
'[class.reuse-tab__card]': `tabType === 'card'`,
|
|
1011
|
+
'[class.reuse-tab__disabled]': `disabled`
|
|
1012
|
+
}, providers: [ReuseTabContextService], preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, 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" }]
|
|
1013
|
+
}], ctorParameters: function () { return [{ type: ReuseTabService }, { type: i0.ChangeDetectorRef }, { type: i2$1.Router }, { type: i2$1.ActivatedRoute }, { type: undefined, decorators: [{
|
|
1014
|
+
type: Optional
|
|
1015
|
+
}, {
|
|
1016
|
+
type: Inject,
|
|
1017
|
+
args: [ALAIN_I18N_TOKEN]
|
|
1018
|
+
}] }, { type: undefined, decorators: [{
|
|
1019
|
+
type: Inject,
|
|
1020
|
+
args: [DOCUMENT]
|
|
1021
|
+
}] }, { type: i3.Platform }]; }, propDecorators: { tabset: [{
|
|
1022
|
+
type: ViewChild,
|
|
1023
|
+
args: ['tabset']
|
|
1024
|
+
}], mode: [{
|
|
1025
|
+
type: Input
|
|
1026
|
+
}], i18n: [{
|
|
1027
|
+
type: Input
|
|
1028
|
+
}], debug: [{
|
|
1029
|
+
type: Input
|
|
1030
|
+
}], max: [{
|
|
1031
|
+
type: Input
|
|
1032
|
+
}], tabMaxWidth: [{
|
|
1033
|
+
type: Input
|
|
1034
|
+
}], excludes: [{
|
|
1035
|
+
type: Input
|
|
1036
|
+
}], allowClose: [{
|
|
1037
|
+
type: Input
|
|
1038
|
+
}], keepingScroll: [{
|
|
1039
|
+
type: Input
|
|
1040
|
+
}], keepingScrollContainer: [{
|
|
1041
|
+
type: Input
|
|
1042
|
+
}], customContextMenu: [{
|
|
1043
|
+
type: Input
|
|
1044
|
+
}], tabBarExtraContent: [{
|
|
1045
|
+
type: Input
|
|
1046
|
+
}], tabBarGutter: [{
|
|
1047
|
+
type: Input
|
|
1048
|
+
}], tabBarStyle: [{
|
|
1049
|
+
type: Input
|
|
1050
|
+
}], tabType: [{
|
|
1051
|
+
type: Input
|
|
1052
|
+
}], routeParamMatchMode: [{
|
|
1053
|
+
type: Input
|
|
1054
|
+
}], disabled: [{
|
|
1055
|
+
type: Input
|
|
1056
|
+
}], titleRender: [{
|
|
1057
|
+
type: Input
|
|
1058
|
+
}], change: [{
|
|
1059
|
+
type: Output
|
|
1060
|
+
}], close: [{
|
|
1061
|
+
type: Output
|
|
1062
|
+
}] } });
|
|
1063
|
+
|
|
1064
|
+
class ReuseTabStrategy {
|
|
1065
|
+
constructor(srv) {
|
|
1066
|
+
this.srv = srv;
|
|
1067
|
+
}
|
|
1068
|
+
shouldDetach(route) {
|
|
1069
|
+
return this.srv.shouldDetach(route);
|
|
1070
|
+
}
|
|
1071
|
+
store(route, handle) {
|
|
1072
|
+
this.srv.store(route, handle);
|
|
1073
|
+
}
|
|
1074
|
+
shouldAttach(route) {
|
|
1075
|
+
return this.srv.shouldAttach(route);
|
|
1076
|
+
}
|
|
1077
|
+
retrieve(route) {
|
|
1078
|
+
return this.srv.retrieve(route);
|
|
1079
|
+
}
|
|
1080
|
+
shouldReuseRoute(future, curr) {
|
|
1081
|
+
return this.srv.shouldReuseRoute(future, curr);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
const COMPONENTS = [ReuseTabComponent];
|
|
1086
|
+
const NOEXPORTS = [ReuseTabContextMenuComponent, ReuseTabContextComponent, ReuseTabContextDirective];
|
|
1087
|
+
class ReuseTabModule {
|
|
1088
|
+
}
|
|
1089
|
+
ReuseTabModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1090
|
+
ReuseTabModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabModule, declarations: [ReuseTabComponent, ReuseTabContextMenuComponent, ReuseTabContextComponent, ReuseTabContextDirective], imports: [CommonModule, RouterModule, DelonLocaleModule, NzMenuModule, NzTabsModule, NzIconModule, OverlayModule], exports: [ReuseTabComponent] });
|
|
1091
|
+
ReuseTabModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabModule, imports: [[CommonModule, RouterModule, DelonLocaleModule, NzMenuModule, NzTabsModule, NzIconModule, OverlayModule]] });
|
|
1092
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ReuseTabModule, decorators: [{
|
|
1093
|
+
type: NgModule,
|
|
1094
|
+
args: [{
|
|
1095
|
+
imports: [CommonModule, RouterModule, DelonLocaleModule, NzMenuModule, NzTabsModule, NzIconModule, OverlayModule],
|
|
1096
|
+
declarations: [...COMPONENTS, ...NOEXPORTS],
|
|
1097
|
+
exports: COMPONENTS
|
|
1098
|
+
}]
|
|
1099
|
+
}] });
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* Generated bundle index. Do not edit.
|
|
1103
|
+
*/
|
|
1104
|
+
|
|
1105
|
+
export { ReuseTabComponent, ReuseTabContextComponent, ReuseTabContextDirective, ReuseTabContextMenuComponent, ReuseTabContextService, ReuseTabMatchMode, ReuseTabModule, ReuseTabService, ReuseTabStrategy };
|
|
1106
|
+
//# sourceMappingURL=reuse-tab.mjs.map
|