From 093d29172cbb502a02faa787e98088767a538bec Mon Sep 17 00:00:00 2001 From: Wendell Date: Mon, 8 Apr 2019 15:44:23 +0800 Subject: [PATCH] build: add secondary entries close #700 fix: fix imports in components and specs fix: circular import of tree and tree-select fix(module:menu,dropdown): fix circular import fix(module:*): fix imports build: fix build build: fix primary important docs: fix doc site build fix: build build: add css secondary entries docs: update doc fix: imports in tests fix: fix updatehostservice in submenu component docs: change docs on gettings started docs: specify version fix: fix styles and update docs docs: update docs fix: fix tooltip and patch files build: fix primary entry --- CONTRIBUTING.md | 1 - components/affix/affix.spec.ts | 2 +- components/affix/doc/index.en-US.md | 8 + components/affix/doc/index.zh-CN.md | 8 + components/affix/nz-affix.component.ts | 13 +- components/affix/nz-affix.module.ts | 2 +- components/affix/package.json | 7 + components/affix/style/entry.less | 1 + components/alert/doc/index.en-US.md | 8 + components/alert/doc/index.zh-CN.md | 8 + components/alert/nz-alert.component.ts | 4 +- components/alert/nz-alert.module.ts | 4 +- components/alert/package.json | 7 + components/alert/style/entry.less | 1 + components/anchor/anchor.spec.ts | 2 +- components/anchor/doc/index.en-US.md | 8 + components/anchor/doc/index.zh-CN.md | 8 + components/anchor/nz-anchor.component.ts | 5 +- components/anchor/nz-anchor.module.ts | 4 +- components/anchor/package.json | 7 + components/anchor/style/entry.less | 2 + components/auto-complete/doc/index.en-US.md | 8 + components/auto-complete/doc/index.zh-CN.md | 8 + .../nz-autocomplete-option.component.ts | 3 +- .../nz-autocomplete.component.ts | 6 +- .../auto-complete/nz-autocomplete.module.ts | 3 +- .../auto-complete/nz-autocomplete.spec.ts | 2 +- components/auto-complete/package.json | 7 + components/auto-complete/style/entry.less | 4 + components/avatar/doc/index.en-US.md | 8 + components/avatar/doc/index.zh-CN.md | 8 + components/avatar/nz-avatar.component.ts | 3 +- components/avatar/nz-avatar.module.ts | 2 +- components/avatar/package.json | 7 + components/avatar/style/entry.less | 1 + components/back-top/back-top.spec.ts | 2 +- components/back-top/doc/index.en-US.md | 8 + components/back-top/doc/index.zh-CN.md | 8 + components/back-top/nz-back-top.component.ts | 5 +- components/back-top/nz-back-top.module.ts | 2 +- components/back-top/package.json | 7 + components/back-top/style/entry.less | 1 + components/badge/doc/index.en-US.md | 8 + components/badge/doc/index.zh-CN.md | 8 + components/badge/nz-badge.component.ts | 4 +- components/badge/nz-badge.module.ts | 3 +- components/badge/nz-badge.spec.ts | 2 +- components/badge/package.json | 7 + components/badge/style/entry.less | 1 + components/breadcrumb/doc/index.en-US.md | 8 + components/breadcrumb/doc/index.zh-CN.md | 8 + components/breadcrumb/nz-breadcrumb.module.ts | 2 +- components/breadcrumb/nz-breadcrumb.spec.ts | 2 +- components/breadcrumb/package.json | 7 + components/breadcrumb/style/entry.less | 1 + components/button/doc/index.en-US.md | 8 + components/button/doc/index.zh-CN.md | 8 + .../button/nz-button-group.component.ts | 4 +- components/button/nz-button.component.ts | 20 +- components/button/nz-button.module.ts | 5 +- components/button/package.json | 7 + components/button/style/entry.less | 1 + components/calendar/doc/index.en-US.md | 8 + components/calendar/doc/index.zh-CN.md | 8 + .../calendar/nz-calendar-header.component.ts | 3 +- components/calendar/nz-calendar.component.ts | 5 +- components/calendar/nz-calendar.module.ts | 8 +- components/calendar/package.json | 7 + components/calendar/public-api.ts | 4 +- components/calendar/style/entry.less | 4 + components/card/doc/index.en-US.md | 8 + components/card/doc/index.zh-CN.md | 10 + components/card/nz-card.component.ts | 2 +- components/card/nz-card.module.ts | 2 +- components/card/package.json | 7 + components/card/style/entry.less | 4 + components/carousel/doc/index.en-US.md | 8 + components/carousel/doc/index.zh-CN.md | 8 + .../carousel/nz-carousel-content.directive.ts | 2 +- components/carousel/nz-carousel.component.ts | 4 +- components/carousel/nz-carousel.spec.ts | 2 +- components/carousel/package.json | 7 + components/carousel/style/entry.less | 1 + components/cascader/doc/index.en-US.md | 8 + components/cascader/doc/index.zh-CN.md | 8 + .../cascader/nz-cascader-definitions.ts | 1 - .../cascader/nz-cascader-li.component.ts | 1 + components/cascader/nz-cascader.component.ts | 16 +- components/cascader/nz-cascader.module.ts | 10 +- components/cascader/nz-cascader.service.ts | 3 +- components/cascader/nz-cascader.spec.ts | 2 +- components/cascader/package.json | 7 + components/cascader/public-api.ts | 1 + components/cascader/style/entry.less | 4 + components/cascader/types.ts | 35 --- components/checkbox/doc/index.en-US.md | 8 + components/checkbox/doc/index.zh-CN.md | 8 + .../checkbox/nz-checkbox-group.component.ts | 3 +- components/checkbox/nz-checkbox.component.ts | 5 +- components/checkbox/package.json | 7 + components/checkbox/style/entry.less | 1 + components/collapse/doc/index.en-US.md | 8 + components/collapse/doc/index.zh-CN.md | 8 + .../collapse/nz-collapse-panel.component.ts | 4 +- components/collapse/nz-collapse.component.ts | 4 +- components/collapse/nz-collapse.module.ts | 4 +- components/collapse/package.json | 7 + components/collapse/style/entry.less | 1 + components/comment/doc/index.en-US.md | 8 + components/comment/doc/index.zh-CN.md | 8 + components/comment/nz-comment.component.ts | 1 + components/comment/nz-comment.module.ts | 4 +- components/comment/package.json | 7 + components/comment/style/entry.less | 1 + components/core/addon/index.ts | 1 + components/core/addon/public-api.ts | 3 + .../{animation.ts => animation-consts.ts} | 0 components/core/animation/collapse.ts | 2 +- components/core/animation/fade.ts | 2 +- components/core/animation/help.ts | 2 +- components/core/animation/index.ts | 1 + components/core/animation/move.ts | 2 +- components/core/animation/public-api.ts | 8 + components/core/animation/slide.ts | 2 +- components/core/animation/zoom.ts | 2 +- components/core/dropdown/index.ts | 1 + .../dropdown/nz-dropdown-service.resolver.ts | 5 + .../core/dropdown/nz-menu-base.service.ts | 38 +++ components/core/dropdown/public-api.ts | 2 + components/core/index.ts | 1 + components/core/logger/index.ts | 1 + .../core/{util => }/logger/logger.module.ts | 0 .../core/{util => }/logger/logger.service.ts | 0 components/core/logger/public-api.ts | 7 + components/core/overlay/index.ts | 1 + components/core/overlay/public-api.ts | 3 + components/core/package.json | 7 + components/core/polyfill/index.ts | 1 + components/core/polyfill/public-api.ts | 1 + components/core/public-api.ts | 15 ++ components/core/scroll/index.ts | 1 + components/core/scroll/public-api.ts | 1 + components/core/services/index.ts | 1 + components/core/services/public-api.ts | 2 + .../services/update-host-class.service.ts | 8 +- components/core/style/index.less | 143 ---------- components/core/testing/public-api.ts | 8 - components/core/tree/index.ts | 1 + .../tree/nz-tree-base-node.ts} | 4 +- .../tree/nz-tree-base-util.ts} | 2 +- .../tree/nz-tree-base.definitions.ts} | 7 +- .../{ => core}/tree/nz-tree-base.service.ts | 10 +- .../core/tree/nz-tree-service.resolver.ts | 5 + components/core/tree/public-api.ts | 4 + components/core/types/index.ts | 1 + components/core/types/public-api.ts | 6 + components/core/util/logger/index.ts | 2 - components/core/util/public-api.ts | 5 + .../date-picker/abstract-picker.component.ts | 12 +- .../date-picker/date-picker.component.spec.ts | 7 +- .../date-picker/date-picker.component.ts | 5 +- components/date-picker/date-picker.module.ts | 5 +- .../date-range-picker.component.ts | 9 +- components/date-picker/doc/index.en-US.md | 8 + components/date-picker/doc/index.zh-CN.md | 8 + .../date-picker/header-picker.component.ts | 10 +- .../lib/calendar/calendar-footer.component.ts | 6 +- .../lib/calendar/calendar-header.component.ts | 6 +- .../lib/calendar/calendar-input.component.ts | 6 +- .../lib/calendar/ok-button.component.ts | 2 +- .../calendar/time-picker-button.component.ts | 2 +- .../lib/calendar/today-button.component.ts | 6 +- .../date-picker/lib/candy-date/candy-date.ts | 2 +- .../date-picker/lib/candy-date/index.ts | 1 - .../lib/date/date-table.component.ts | 10 +- .../lib/decade/decade-panel.component.ts | 4 +- .../lib/lib-packer-supplements.spec.ts | 2 +- .../date-picker/lib/lib-packer.module.ts | 4 +- .../lib/month/month-panel.component.ts | 4 +- .../lib/month/month-table.component.ts | 4 +- .../lib/popups/date-range-popup.component.ts | 6 +- .../lib/popups/inner-popup.component.ts | 6 +- components/date-picker/lib/util.spec.ts | 2 +- components/date-picker/lib/util.ts | 2 +- .../lib/year/year-panel.component.ts | 5 +- .../month-picker.component.spec.ts | 8 +- .../date-picker/month-picker.component.ts | 5 +- components/date-picker/package.json | 7 + components/date-picker/picker.component.ts | 7 +- components/date-picker/public-api.ts | 2 +- .../range-picker.component.spec.ts | 6 +- .../date-picker/range-picker.component.ts | 5 +- components/date-picker/standard-types.ts | 2 +- components/date-picker/style/entry.less | 6 + .../date-picker/week-picker.component.spec.ts | 2 +- .../date-picker/week-picker.component.ts | 5 +- .../date-picker/year-picker.component.spec.ts | 6 +- .../date-picker/year-picker.component.ts | 5 +- components/divider/doc/index.en-US.md | 8 +- components/divider/doc/index.zh-CN.md | 8 + components/divider/nz-divider.component.ts | 3 +- components/divider/nz-divider.module.ts | 2 +- components/divider/package.json | 7 + components/divider/style/entry.less | 1 + components/drawer/doc/index.en-US.md | 8 + components/drawer/doc/index.zh-CN.md | 8 + components/drawer/nz-drawer.component.ts | 2 +- components/drawer/nz-drawer.module.ts | 5 +- components/drawer/package.json | 7 + components/drawer/style/entry.less | 1 + components/dropdown/doc/index.en-US.md | 8 + components/dropdown/doc/index.zh-CN.md | 7 + .../dropdown/nz-dropdown-button.component.ts | 17 +- .../dropdown/nz-dropdown-context.component.ts | 4 +- components/dropdown/nz-dropdown.component.ts | 33 ++- components/dropdown/nz-dropdown.module.ts | 9 +- components/dropdown/nz-dropdown.spec.ts | 2 +- .../dropdown/nz-menu-dropdown.service.ts | 5 +- components/dropdown/package.json | 7 + components/dropdown/public-api.ts | 2 + components/dropdown/style/entry.less | 3 + components/empty/doc/index.en-US.md | 8 + components/empty/doc/index.zh-CN.md | 8 + components/empty/nz-empty.component.ts | 3 +- components/empty/nz-empty.module.ts | 6 +- components/empty/package.json | 7 + components/empty/style/entry.less | 1 + components/form/doc/index.en-US.md | 8 + components/form/doc/index.zh-CN.md | 8 + components/form/nz-form-control.component.ts | 9 +- components/form/nz-form-explain.component.ts | 2 +- components/form/nz-form-item.component.ts | 7 +- components/form/nz-form-label.component.ts | 8 +- components/form/nz-form.directive.ts | 2 +- components/form/nz-form.module.ts | 9 +- components/form/package.json | 7 + components/form/style/entry.less | 3 + components/grid/doc/index.en-US.md | 8 + components/grid/doc/index.zh-CN.md | 8 + components/grid/nz-col.directive.ts | 4 +- components/grid/nz-row.directive.ts | 4 +- components/grid/package.json | 7 + components/grid/style/entry.less | 1 + components/i18n/date-config.ts | 2 - components/i18n/nz-i18n.module.ts | 2 +- components/i18n/nz-i18n.service.ts | 3 +- components/i18n/package.json | 7 + components/i18n/public-api.ts | 4 +- components/icon/doc/index.en-US.md | 8 + components/icon/doc/index.zh-CN.md | 8 + components/icon/nz-icon.directive.ts | 2 +- components/icon/package.json | 7 + components/icon/page/index.ts | 3 +- components/icon/style/entry.less | 1 + components/icon/style/index.less | 4 + components/input-number/doc/index.en-US.md | 8 + components/input-number/doc/index.zh-CN.md | 8 + .../input-number/nz-input-number.component.ts | 4 +- .../input-number/nz-input-number.module.ts | 3 +- .../input-number/nz-input-number.spec.ts | 2 +- components/input-number/package.json | 7 + components/input-number/style/entry.less | 1 + components/input/doc/index.en-US.md | 8 + components/input/doc/index.zh-CN.md | 8 + components/input/nz-autosize.spec.ts | 2 +- components/input/nz-input-group.component.ts | 4 +- components/input/nz-input.directive.ts | 3 +- components/input/nz-input.module.ts | 4 +- components/input/package.json | 7 + components/input/public-api.ts | 1 + components/input/style/entry.less | 3 + components/layout/doc/index.en-US.md | 8 + components/layout/doc/index.zh-CN.md | 8 + components/layout/nz-layout.module.ts | 3 +- components/layout/nz-sider.component.ts | 4 +- components/layout/package.json | 7 + components/layout/style/entry.less | 1 + components/list/doc/index.en-US.md | 8 + components/list/doc/index.zh-CN.md | 8 + components/list/nz-list.component.ts | 4 +- components/list/nz-list.module.ts | 10 +- components/list/package.json | 7 + components/list/style/entry.less | 5 + components/mention/doc/index.en-US.md | 8 + components/mention/doc/index.zh-CN.md | 8 + components/mention/nz-mention.component.ts | 5 +- components/mention/nz-mention.module.ts | 2 +- components/mention/nz-mention.spec.ts | 2 +- components/mention/package.json | 7 + components/mention/style/entry.less | 1 + components/menu/doc/index.en-US.md | 8 + components/menu/doc/index.zh-CN.md | 8 + components/menu/nz-menu-item.directive.ts | 9 +- components/menu/nz-menu-menu.service.ts | 7 - components/menu/nz-menu.directive.ts | 30 ++- components/menu/nz-menu.module.ts | 16 +- components/menu/nz-menu.resolver.ts | 10 + components/menu/nz-menu.service.ts | 37 +-- components/menu/nz-menu.spec.ts | 2 +- components/menu/nz-submenu.component.ts | 24 +- components/menu/nz-submenu.service.ts | 4 +- components/menu/package.json | 7 + components/menu/public-api.ts | 3 + components/menu/style/entry.less | 4 + components/message/doc/index.en-US.md | 8 + components/message/doc/index.zh-CN.md | 8 + .../message/nz-message-container.component.ts | 2 +- components/message/nz-message.component.ts | 4 +- components/message/nz-message.module.ts | 4 +- components/message/nz-message.spec.ts | 2 +- components/message/package.json | 7 + components/message/style/entry.less | 1 + components/modal/doc/index.en-US.md | 8 + components/modal/doc/index.zh-CN.md | 8 + components/modal/nz-modal.component.ts | 6 +- components/modal/nz-modal.module.ts | 9 +- components/modal/nz-modal.service.ts | 3 +- components/modal/nz-modal.spec.ts | 14 +- components/modal/package.json | 7 + components/modal/public-api.ts | 2 + components/modal/style/entry.less | 3 + components/ng-package.json | 9 +- components/ng-zorro-antd.module.ts | 248 +++++++++--------- components/notification/doc/index.en-US.md | 8 + components/notification/doc/index.zh-CN.md | 8 + .../notification/nz-notification-config.ts | 2 +- .../nz-notification-container.component.ts | 4 +- .../notification/nz-notification.component.ts | 4 +- .../nz-notification.definitions.ts | 2 +- .../notification/nz-notification.module.ts | 2 +- .../notification/nz-notification.service.ts | 2 +- .../notification/nz-notification.spec.ts | 2 +- components/notification/package.json | 7 + components/notification/style/entry.less | 1 + components/page-header/doc/index.en-US.md | 8 + components/page-header/doc/index.zh-CN.md | 8 + .../page-header/nz-page-header.module.ts | 8 +- components/page-header/package.json | 7 + components/page-header/style/entry.less | 4 + components/pagination/doc/index.en-US.md | 8 + components/pagination/doc/index.zh-CN.md | 8 + .../pagination/nz-pagination.component.ts | 6 +- components/pagination/nz-pagination.module.ts | 6 +- components/pagination/package.json | 7 + components/pagination/style/entry.less | 3 + components/popconfirm/doc/index.en-US.md | 8 + components/popconfirm/doc/index.zh-CN.md | 8 + .../popconfirm/nz-popconfirm.component.ts | 7 +- .../popconfirm/nz-popconfirm.directive.ts | 6 +- components/popconfirm/nz-popconfirm.module.ts | 14 +- components/popconfirm/nz-popconfirm.spec.ts | 2 +- components/popconfirm/package.json | 7 + components/popconfirm/style/entry.less | 4 + components/popover/doc/index.en-US.md | 8 + components/popover/doc/index.zh-CN.md | 8 + components/popover/nz-popover.component.ts | 6 +- components/popover/nz-popover.directive.ts | 5 +- components/popover/nz-popover.module.ts | 7 +- components/popover/nz-popover.spec.ts | 2 +- components/popover/package.json | 7 + components/popover/style/entry.less | 3 + components/progress/doc/index.en-US.md | 8 + components/progress/doc/index.zh-CN.md | 8 + components/progress/nz-progress.component.ts | 3 +- components/progress/nz-progress.module.ts | 2 +- components/progress/package.json | 7 + components/progress/style/entry.less | 1 + components/radio/doc/index.en-US.md | 8 + components/radio/doc/index.zh-CN.md | 8 + components/radio/nz-radio-group.component.ts | 6 +- components/radio/nz-radio.component.ts | 3 +- components/radio/package.json | 7 + components/radio/style/entry.less | 1 + components/rate/doc/index.en-US.md | 8 + components/rate/doc/index.zh-CN.md | 8 + components/rate/nz-rate-item.component.ts | 2 +- components/rate/nz-rate.component.ts | 3 +- components/rate/nz-rate.module.ts | 4 +- components/rate/nz-rate.spec.ts | 2 +- components/rate/package.json | 7 + components/rate/public-api.ts | 1 + components/rate/style/entry.less | 3 + components/select/doc/index.en-US.md | 8 + components/select/doc/index.zh-CN.md | 8 + components/select/nz-option-container.spec.ts | 4 +- components/select/nz-option-li.component.ts | 4 +- components/select/nz-option-li.spec.ts | 4 +- components/select/nz-option.component.ts | 2 +- .../select/nz-select-top-control.component.ts | 5 +- .../select/nz-select-top-control.spec.ts | 4 +- components/select/nz-select.component.spec.ts | 2 +- components/select/nz-select.component.ts | 15 +- components/select/nz-select.module.ts | 12 +- components/select/nz-select.service.ts | 4 +- components/select/package.json | 7 + components/select/public-api.ts | 5 + components/select/style/entry.less | 3 + components/skeleton/doc/index.en-US.md | 8 + components/skeleton/doc/index.zh-CN.md | 8 + components/skeleton/nz-skeleton.component.ts | 2 +- components/skeleton/package.json | 7 + components/skeleton/style/entry.less | 1 + components/slider/doc/index.en-US.md | 8 + components/slider/doc/index.zh-CN.md | 8 + .../slider/nz-slider-handle.component.ts | 5 +- .../slider/nz-slider-marks.component.ts | 2 +- components/slider/nz-slider-step.component.ts | 2 +- .../slider/nz-slider-track.component.ts | 2 +- components/slider/nz-slider.component.ts | 16 +- components/slider/nz-slider.module.ts | 2 +- components/slider/nz-slider.spec.ts | 2 +- components/slider/package.json | 7 + components/slider/style/entry.less | 3 + components/spin/doc/index.en-US.md | 8 + components/spin/doc/index.zh-CN.md | 8 + components/spin/nz-spin.component.ts | 3 +- components/spin/package.json | 7 + components/spin/style/entry.less | 1 + components/statistic/doc/index.en-US.md | 8 + components/statistic/doc/index.zh-CN.md | 8 + components/statistic/nz-statistic.module.ts | 2 +- components/statistic/nz-time-range.pipe.ts | 2 +- components/statistic/package.json | 7 + components/statistic/public-api.ts | 2 + components/statistic/style/entry.less | 1 + components/steps/doc/index.en-US.md | 8 + components/steps/doc/index.zh-CN.md | 8 + components/steps/nz-step.component.ts | 2 +- components/steps/nz-steps.component.ts | 4 +- components/steps/nz-steps.module.ts | 4 +- components/steps/package.json | 7 + components/steps/style/entry.less | 1 + components/switch/doc/index.en-US.md | 8 + components/switch/doc/index.zh-CN.md | 8 + components/switch/nz-switch.component.ts | 3 +- components/switch/nz-switch.module.ts | 6 +- components/switch/nz-switch.spec.ts | 2 +- components/switch/package.json | 7 + components/switch/style/entry.less | 1 + components/table/doc/index.en-US.md | 8 + components/table/doc/index.zh-CN.md | 8 + components/table/nz-table.component.ts | 8 +- components/table/nz-table.module.ts | 21 +- components/table/nz-tbody.spec.ts | 2 +- components/table/nz-td.component.ts | 4 +- components/table/nz-td.spec.ts | 6 +- components/table/nz-th.component.ts | 9 +- components/table/nz-thead.component.ts | 5 +- components/table/nz-thead.spec.ts | 2 +- components/table/nz-tr.directive.ts | 2 +- components/table/nz-tr.spec.ts | 2 +- components/table/package.json | 7 + components/table/public-api.ts | 1 + components/table/style/entry.less | 10 + components/table/style/patch.less | 144 ++++++++++ components/tabs/doc/index.en-US.md | 8 + components/tabs/doc/index.zh-CN.md | 8 + components/tabs/nz-tab-label.directive.ts | 2 +- components/tabs/nz-tab.component.ts | 2 +- components/tabs/nz-tabs-ink-bar.directive.ts | 2 +- components/tabs/nz-tabs-nav.component.ts | 2 +- components/tabs/nz-tabs-nav.spec.ts | 2 +- components/tabs/nz-tabs.module.ts | 4 +- components/tabs/nz-tabs.spec.ts | 2 +- components/tabs/nz-tabset.component.ts | 4 +- components/tabs/package.json | 7 + components/tabs/public-api.ts | 1 + components/tabs/style/entry.less | 1 + components/tag/doc/index.en-US.md | 8 + components/tag/doc/index.zh-CN.md | 10 + components/tag/nz-tag.component.ts | 5 +- components/tag/nz-tag.module.ts | 2 +- components/tag/package.json | 7 + components/tag/style/entry.less | 1 + components/time-picker/doc/index.en-US.md | 8 + components/time-picker/doc/index.zh-CN.md | 8 + .../nz-time-picker-panel.component.ts | 5 +- .../time-picker/nz-time-picker.component.ts | 6 +- .../time-picker/nz-time-picker.module.ts | 8 +- .../nz-time-value-accessor.directive.spec.ts | 2 +- .../nz-time-value-accessor.directive.ts | 3 +- components/time-picker/package.json | 7 + components/time-picker/public-api.ts | 2 + components/time-picker/style/entry.less | 1 + components/time-picker/time-holder.ts | 2 +- components/timeline/doc/index.en-US.md | 8 + components/timeline/doc/index.zh-CN.md | 8 + components/timeline/nz-timeline.component.ts | 3 +- components/timeline/nz-timeline.module.ts | 4 +- components/timeline/package.json | 7 + components/timeline/style/entry.less | 1 + components/tooltip/doc/index.en-US.md | 8 + components/tooltip/doc/index.zh-CN.md | 8 + components/tooltip/nz-tooltip.component.ts | 15 +- components/tooltip/nz-tooltip.directive.ts | 3 +- components/tooltip/nz-tooltip.module.ts | 5 +- components/tooltip/nz-tooltip.spec.ts | 2 +- components/tooltip/package.json | 7 + components/tooltip/style/entry.less | 1 + components/transfer/doc/index.en-US.md | 8 + components/transfer/doc/index.zh-CN.md | 8 + .../transfer/nz-transfer-list.component.ts | 2 +- components/transfer/nz-transfer.component.ts | 4 +- components/transfer/nz-transfer.module.ts | 12 +- components/transfer/package.json | 7 + components/transfer/style/entry.less | 6 + components/tree-select/doc/index.en-US.md | 8 + components/tree-select/doc/index.zh-CN.md | 8 + .../tree-select/nz-tree-select.component.ts | 32 ++- .../tree-select/nz-tree-select.module.ts | 11 +- .../tree-select/nz-tree-select.service.ts | 3 +- components/tree-select/nz-tree-select.spec.ts | 11 +- components/tree-select/package.json | 7 + components/tree-select/public-api.ts | 1 + components/tree-select/style/entry.less | 5 + components/tree/doc/index.en-US.md | 8 + components/tree/doc/index.zh-CN.md | 8 + components/tree/nz-tree-node.component.ts | 15 +- components/tree/nz-tree.component.ts | 27 +- components/tree/nz-tree.module.ts | 7 +- components/tree/nz-tree.service.ts | 2 +- components/tree/nz-tree.spec.ts | 36 +-- components/tree/package.json | 7 + components/tree/public-api.ts | 4 - components/tree/style/entry.less | 1 + components/tsconfig.json | 12 +- components/upload/doc/index.en-US.md | 8 + components/upload/doc/index.zh-CN.md | 8 + components/upload/interface.ts | 3 +- components/upload/nz-upload-btn.component.ts | 2 +- components/upload/nz-upload-list.component.ts | 2 +- components/upload/nz-upload.component.ts | 4 +- components/upload/nz-upload.module.ts | 8 +- components/upload/package.json | 7 + components/upload/style/entry.less | 4 + docs/getting-started.en-US.md | 62 +++++ docs/getting-started.zh-CN.md | 60 +++++ package.json | 2 +- scripts/build/compile-styles.js | 88 +++++++ scripts/build/generate-less.js | 41 --- scripts/build/replace-publish.sh | 3 +- scripts/site/_site/tsconfig.app.json | 1 + 542 files changed, 2803 insertions(+), 1020 deletions(-) create mode 100644 components/affix/package.json create mode 100644 components/affix/style/entry.less create mode 100644 components/alert/package.json create mode 100644 components/alert/style/entry.less create mode 100644 components/anchor/package.json create mode 100644 components/anchor/style/entry.less create mode 100644 components/auto-complete/package.json create mode 100644 components/auto-complete/style/entry.less create mode 100644 components/avatar/package.json create mode 100644 components/avatar/style/entry.less create mode 100644 components/back-top/package.json create mode 100644 components/back-top/style/entry.less create mode 100644 components/badge/package.json create mode 100644 components/badge/style/entry.less create mode 100644 components/breadcrumb/package.json create mode 100644 components/breadcrumb/style/entry.less create mode 100644 components/button/package.json create mode 100644 components/button/style/entry.less create mode 100644 components/calendar/package.json create mode 100644 components/calendar/style/entry.less create mode 100644 components/card/package.json create mode 100644 components/card/style/entry.less create mode 100644 components/carousel/package.json create mode 100644 components/carousel/style/entry.less create mode 100644 components/cascader/package.json create mode 100644 components/cascader/style/entry.less delete mode 100644 components/cascader/types.ts create mode 100644 components/checkbox/package.json create mode 100644 components/checkbox/style/entry.less create mode 100644 components/collapse/package.json create mode 100644 components/collapse/style/entry.less create mode 100644 components/comment/package.json create mode 100644 components/comment/style/entry.less create mode 100644 components/core/addon/index.ts create mode 100644 components/core/addon/public-api.ts rename components/core/animation/{animation.ts => animation-consts.ts} (100%) create mode 100644 components/core/animation/index.ts create mode 100644 components/core/animation/public-api.ts create mode 100644 components/core/dropdown/index.ts create mode 100644 components/core/dropdown/nz-dropdown-service.resolver.ts create mode 100644 components/core/dropdown/nz-menu-base.service.ts create mode 100644 components/core/dropdown/public-api.ts create mode 100644 components/core/index.ts create mode 100644 components/core/logger/index.ts rename components/core/{util => }/logger/logger.module.ts (100%) rename components/core/{util => }/logger/logger.service.ts (100%) create mode 100644 components/core/logger/public-api.ts create mode 100644 components/core/overlay/index.ts create mode 100644 components/core/overlay/public-api.ts create mode 100644 components/core/package.json create mode 100644 components/core/polyfill/index.ts create mode 100644 components/core/polyfill/public-api.ts create mode 100644 components/core/public-api.ts create mode 100644 components/core/scroll/index.ts create mode 100644 components/core/scroll/public-api.ts create mode 100644 components/core/services/index.ts create mode 100644 components/core/services/public-api.ts create mode 100644 components/core/tree/index.ts rename components/{tree/nz-tree-node.ts => core/tree/nz-tree-base-node.ts} (98%) rename components/{tree/nz-tree-util.ts => core/tree/nz-tree-base-util.ts} (86%) rename components/{tree/interface.ts => core/tree/nz-tree-base.definitions.ts} (73%) rename components/{ => core}/tree/nz-tree-base.service.ts (98%) create mode 100644 components/core/tree/nz-tree-service.resolver.ts create mode 100644 components/core/tree/public-api.ts create mode 100644 components/core/types/index.ts create mode 100644 components/core/types/public-api.ts delete mode 100644 components/core/util/logger/index.ts delete mode 100644 components/date-picker/lib/candy-date/index.ts create mode 100644 components/date-picker/package.json create mode 100644 components/date-picker/style/entry.less create mode 100644 components/divider/package.json create mode 100644 components/divider/style/entry.less create mode 100644 components/drawer/package.json create mode 100644 components/drawer/style/entry.less create mode 100644 components/dropdown/package.json create mode 100644 components/dropdown/style/entry.less create mode 100644 components/empty/package.json create mode 100644 components/empty/style/entry.less create mode 100644 components/form/package.json create mode 100644 components/form/style/entry.less create mode 100644 components/grid/package.json create mode 100644 components/grid/style/entry.less create mode 100644 components/i18n/package.json create mode 100644 components/icon/package.json create mode 100644 components/icon/style/entry.less create mode 100644 components/icon/style/index.less create mode 100644 components/input-number/package.json create mode 100644 components/input-number/style/entry.less create mode 100644 components/input/package.json create mode 100644 components/input/style/entry.less create mode 100644 components/layout/package.json create mode 100644 components/layout/style/entry.less create mode 100644 components/list/package.json create mode 100644 components/list/style/entry.less create mode 100644 components/mention/package.json create mode 100644 components/mention/style/entry.less delete mode 100644 components/menu/nz-menu-menu.service.ts create mode 100644 components/menu/nz-menu.resolver.ts create mode 100644 components/menu/package.json create mode 100644 components/menu/style/entry.less create mode 100644 components/message/package.json create mode 100644 components/message/style/entry.less create mode 100644 components/modal/package.json create mode 100644 components/modal/style/entry.less create mode 100644 components/notification/package.json create mode 100644 components/notification/style/entry.less create mode 100644 components/page-header/package.json create mode 100644 components/page-header/style/entry.less create mode 100644 components/pagination/package.json create mode 100644 components/pagination/style/entry.less create mode 100644 components/popconfirm/package.json create mode 100644 components/popconfirm/style/entry.less create mode 100644 components/popover/package.json create mode 100644 components/popover/style/entry.less create mode 100644 components/progress/package.json create mode 100644 components/progress/style/entry.less create mode 100644 components/radio/package.json create mode 100644 components/radio/style/entry.less create mode 100644 components/rate/package.json create mode 100644 components/rate/style/entry.less create mode 100644 components/select/package.json create mode 100644 components/select/style/entry.less create mode 100644 components/skeleton/package.json create mode 100644 components/skeleton/style/entry.less create mode 100644 components/slider/package.json create mode 100644 components/slider/style/entry.less create mode 100644 components/spin/package.json create mode 100644 components/spin/style/entry.less create mode 100644 components/statistic/package.json create mode 100644 components/statistic/style/entry.less create mode 100644 components/steps/package.json create mode 100644 components/steps/style/entry.less create mode 100644 components/switch/package.json create mode 100644 components/switch/style/entry.less create mode 100644 components/table/package.json create mode 100644 components/table/style/entry.less create mode 100644 components/table/style/patch.less create mode 100644 components/tabs/package.json create mode 100644 components/tabs/style/entry.less create mode 100644 components/tag/package.json create mode 100644 components/tag/style/entry.less create mode 100644 components/time-picker/package.json create mode 100644 components/time-picker/style/entry.less create mode 100644 components/timeline/package.json create mode 100644 components/timeline/style/entry.less create mode 100644 components/tooltip/package.json create mode 100644 components/tooltip/style/entry.less create mode 100644 components/transfer/package.json create mode 100644 components/transfer/style/entry.less create mode 100644 components/tree-select/package.json create mode 100644 components/tree-select/style/entry.less create mode 100644 components/tree/package.json create mode 100644 components/tree/style/entry.less create mode 100644 components/upload/package.json create mode 100644 components/upload/style/entry.less create mode 100644 scripts/build/compile-styles.js delete mode 100644 scripts/build/generate-less.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c5813269a36..67b5b613c55 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -172,7 +172,6 @@ Samples: (even more [samples](https://github.com/NG-ZORRO/ng-zorro-antd/commits/ ``` docs(changelog): update change log to beta.5 ``` -``` fix(release): need to depend on latest rxjs and zone.js The version in our package.json gets copied to the one we publish, and users need the latest of these. diff --git a/components/affix/affix.spec.ts b/components/affix/affix.spec.ts index 5492c4fecea..a9b36174f07 100644 --- a/components/affix/affix.spec.ts +++ b/components/affix/affix.spec.ts @@ -2,7 +2,7 @@ import { Component, DebugElement, ViewChild } from '@angular/core'; import { discardPeriodicTasks, fakeAsync, tick, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { NzScrollService } from '../core/scroll/nz-scroll.service'; +import { NzScrollService } from 'ng-zorro-antd/core'; import { NzAffixComponent } from './nz-affix.component'; import { NzAffixModule } from './nz-affix.module'; diff --git a/components/affix/doc/index.en-US.md b/components/affix/doc/index.en-US.md index 50389e39912..d354fe654d9 100755 --- a/components/affix/doc/index.en-US.md +++ b/components/affix/doc/index.en-US.md @@ -14,6 +14,14 @@ Please note that Affix should not cover other content on the page, especially wh ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzAffixModule } from 'ng-zorro-antd'; +``` + ### nz-affix | Property | Description | Type | Default | diff --git a/components/affix/doc/index.zh-CN.md b/components/affix/doc/index.zh-CN.md index 5107600e330..088c863c668 100755 --- a/components/affix/doc/index.zh-CN.md +++ b/components/affix/doc/index.zh-CN.md @@ -15,6 +15,14 @@ title: Affix ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzAffixModule } from 'ng-zorro-antd'; +``` + ### nz-affix | 成员 | 说明 | 类型 | 默认值 | diff --git a/components/affix/nz-affix.component.ts b/components/affix/nz-affix.component.ts index fb61a41ba0e..e73d12a198b 100644 --- a/components/affix/nz-affix.component.ts +++ b/components/affix/nz-affix.component.ts @@ -12,12 +12,13 @@ import { ViewChild, ViewEncapsulation } from '@angular/core'; - -import { NzScrollService } from '../core/scroll/nz-scroll.service'; -import { NGStyleInterface } from '../core/types/ng-class'; -import { shallowEqual } from '../core/util/check'; -import { toNumber } from '../core/util/convert'; -import { throttleByAnimationFrameDecorator } from '../core/util/throttleByAnimationFrame'; +import { + shallowEqual, + throttleByAnimationFrameDecorator, + toNumber, + NzScrollService, + NGStyleInterface +} from 'ng-zorro-antd/core'; @Component({ selector: 'nz-affix', diff --git a/components/affix/nz-affix.module.ts b/components/affix/nz-affix.module.ts index feeb36d565f..1611543f3f9 100644 --- a/components/affix/nz-affix.module.ts +++ b/components/affix/nz-affix.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { SCROLL_SERVICE_PROVIDER } from '../core/scroll/nz-scroll.service'; +import { SCROLL_SERVICE_PROVIDER } from 'ng-zorro-antd/core'; import { NzAffixComponent } from './nz-affix.component'; diff --git a/components/affix/package.json b/components/affix/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/affix/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/affix/style/entry.less b/components/affix/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/affix/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/alert/doc/index.en-US.md b/components/alert/doc/index.en-US.md index 3de30fc904b..70bf320f247 100644 --- a/components/alert/doc/index.en-US.md +++ b/components/alert/doc/index.en-US.md @@ -13,6 +13,14 @@ Alert component for feedback. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzAlertModule } from 'ng-zorro-antd'; +``` + ### nz-alert | Property | Description | Type | Default | diff --git a/components/alert/doc/index.zh-CN.md b/components/alert/doc/index.zh-CN.md index d5b90cd9e9f..5bdb36c3b41 100644 --- a/components/alert/doc/index.zh-CN.md +++ b/components/alert/doc/index.zh-CN.md @@ -14,6 +14,14 @@ title: Alert ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzAlertModule } from 'ng-zorro-antd'; +``` + ### nz-alert | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/alert/nz-alert.component.ts b/components/alert/nz-alert.component.ts index d1ed33ced67..c264c95d01a 100644 --- a/components/alert/nz-alert.component.ts +++ b/components/alert/nz-alert.component.ts @@ -9,9 +9,7 @@ import { TemplateRef, ViewEncapsulation } from '@angular/core'; -import { slideAlertMotion } from '../core/animation/slide'; -import { NgClassType } from '../core/types/ng-class'; -import { InputBoolean } from '../core/util/convert'; +import { slideAlertMotion, InputBoolean, NgClassType } from 'ng-zorro-antd/core'; @Component({ selector: 'nz-alert', diff --git a/components/alert/nz-alert.module.ts b/components/alert/nz-alert.module.ts index 8643895fdf8..16a59d6ef0f 100644 --- a/components/alert/nz-alert.module.ts +++ b/components/alert/nz-alert.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzAlertComponent } from './nz-alert.component'; diff --git a/components/alert/package.json b/components/alert/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/alert/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/alert/style/entry.less b/components/alert/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/alert/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/anchor/anchor.spec.ts b/components/anchor/anchor.spec.ts index 5981a9e00aa..fef0d6ca446 100644 --- a/components/anchor/anchor.spec.ts +++ b/components/anchor/anchor.spec.ts @@ -4,7 +4,7 @@ import { Component, DebugElement, ViewChild } from '@angular/core'; import { By } from '@angular/platform-browser'; import { NzAnchorModule } from './nz-anchor.module'; import { NzAnchorComponent } from './nz-anchor.component'; -import { NzScrollService } from '../core/scroll/nz-scroll.service'; +import { NzScrollService } from 'ng-zorro-antd/core'; const throttleTime = 51; diff --git a/components/anchor/doc/index.en-US.md b/components/anchor/doc/index.en-US.md index f5d20181faf..f935f1eda03 100755 --- a/components/anchor/doc/index.en-US.md +++ b/components/anchor/doc/index.en-US.md @@ -12,6 +12,14 @@ For displaying anchor hyperlinks on page and jumping between them. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzAnchorModule } from 'ng-zorro-antd'; +``` + ### nz-anchor | Property | Description | Type | Default | diff --git a/components/anchor/doc/index.zh-CN.md b/components/anchor/doc/index.zh-CN.md index dfea238fbc2..4deb462dc38 100755 --- a/components/anchor/doc/index.zh-CN.md +++ b/components/anchor/doc/index.zh-CN.md @@ -13,6 +13,14 @@ title: Anchor ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzAnchorModule } from 'ng-zorro-antd'; +``` + ### nz-anchor | 成员 | 说明 | 类型 | 默认值 | diff --git a/components/anchor/nz-anchor.component.ts b/components/anchor/nz-anchor.component.ts index dc3d6fe32e4..a8676b2dd06 100644 --- a/components/anchor/nz-anchor.component.ts +++ b/components/anchor/nz-anchor.component.ts @@ -15,9 +15,8 @@ import { } from '@angular/core'; import { fromEvent, Subscription } from 'rxjs'; import { distinctUntilChanged, throttleTime } from 'rxjs/operators'; -import { NzScrollService } from '../core/scroll/nz-scroll.service'; -import { NGStyleInterface } from '../core/types/ng-class'; -import { toNumber, InputBoolean, InputNumber } from '../core/util/convert'; + +import { toNumber, InputBoolean, InputNumber, NzScrollService, NGStyleInterface } from 'ng-zorro-antd/core'; import { NzAnchorLinkComponent } from './nz-anchor-link.component'; diff --git a/components/anchor/nz-anchor.module.ts b/components/anchor/nz-anchor.module.ts index 8fdc029047e..00a66350ef6 100644 --- a/components/anchor/nz-anchor.module.ts +++ b/components/anchor/nz-anchor.module.ts @@ -1,8 +1,8 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAffixModule } from '../affix/nz-affix.module'; -import { SCROLL_SERVICE_PROVIDER } from '../core/scroll/nz-scroll.service'; +import { NzAffixModule } from 'ng-zorro-antd/affix'; +import { SCROLL_SERVICE_PROVIDER } from 'ng-zorro-antd/core'; import { NzAnchorLinkComponent } from './nz-anchor-link.component'; import { NzAnchorComponent } from './nz-anchor.component'; diff --git a/components/anchor/package.json b/components/anchor/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/anchor/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/anchor/style/entry.less b/components/anchor/style/entry.less new file mode 100644 index 00000000000..42b7ca01612 --- /dev/null +++ b/components/anchor/style/entry.less @@ -0,0 +1,2 @@ +@import './index.less'; +@import '../../affix/style/index.less'; diff --git a/components/auto-complete/doc/index.en-US.md b/components/auto-complete/doc/index.en-US.md index b8b7bcc1bb6..e12fcc93ac3 100644 --- a/components/auto-complete/doc/index.en-US.md +++ b/components/auto-complete/doc/index.en-US.md @@ -26,6 +26,14 @@ When there is a need for autocomplete functionality. ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzAutocompleteModule } from 'ng-zorro-antd'; +``` + ### [nzAutocomplete] | Property | Description | Type | Default | diff --git a/components/auto-complete/doc/index.zh-CN.md b/components/auto-complete/doc/index.zh-CN.md index 36b43d14098..cc36ffe5702 100644 --- a/components/auto-complete/doc/index.zh-CN.md +++ b/components/auto-complete/doc/index.zh-CN.md @@ -27,6 +27,14 @@ subtitle: 自动完成 ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzAutocompleteModule } from 'ng-zorro-antd'; +``` + ### [nzAutocomplete] | 属性 | 说明 | 类型 | 默认值 | diff --git a/components/auto-complete/nz-autocomplete-option.component.ts b/components/auto-complete/nz-autocomplete-option.component.ts index 1ae8f5d45f0..432d14bce71 100644 --- a/components/auto-complete/nz-autocomplete-option.component.ts +++ b/components/auto-complete/nz-autocomplete-option.component.ts @@ -9,8 +9,7 @@ import { ViewEncapsulation } from '@angular/core'; -import { InputBoolean } from '../core/util/convert'; -import { scrollIntoView } from '../core/util/scroll-into-view-if-needed'; +import { scrollIntoView, InputBoolean } from 'ng-zorro-antd/core'; export class NzOptionSelectionChange { constructor(public source: NzAutocompleteOptionComponent, public isUserInput: boolean = false) {} diff --git a/components/auto-complete/nz-autocomplete.component.ts b/components/auto-complete/nz-autocomplete.component.ts index ef5ce12c066..5b678017b9e 100644 --- a/components/auto-complete/nz-autocomplete.component.ts +++ b/components/auto-complete/nz-autocomplete.component.ts @@ -21,10 +21,8 @@ import { import { defer, merge, Observable, Subscription } from 'rxjs'; import { filter, switchMap, take } from 'rxjs/operators'; -import { slideMotion } from '../core/animation/slide'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { NzDropDownPosition } from '../core/types/drop-down-position'; -import { InputBoolean } from '../core/util/convert'; +import { slideMotion, InputBoolean, NzDropDownPosition, NzNoAnimationDirective } from 'ng-zorro-antd/core'; + import { NzAutocompleteOptionComponent, NzOptionSelectionChange } from './nz-autocomplete-option.component'; export interface AutocompleteDataSourceItem { diff --git a/components/auto-complete/nz-autocomplete.module.ts b/components/auto-complete/nz-autocomplete.module.ts index 4657c7105c1..71c7e4d7ce4 100644 --- a/components/auto-complete/nz-autocomplete.module.ts +++ b/components/auto-complete/nz-autocomplete.module.ts @@ -3,8 +3,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; +import { NzAddOnModule, NzNoAnimationModule } from 'ng-zorro-antd/core'; import { NzAutocompleteOptgroupComponent } from './nz-autocomplete-optgroup.component'; import { NzAutocompleteOptionComponent } from './nz-autocomplete-option.component'; diff --git a/components/auto-complete/nz-autocomplete.spec.ts b/components/auto-complete/nz-autocomplete.spec.ts index 181b1148584..288999dc113 100644 --- a/components/auto-complete/nz-autocomplete.spec.ts +++ b/components/auto-complete/nz-autocomplete.spec.ts @@ -15,7 +15,7 @@ import { dispatchKeyboardEvent, typeInElement, MockNgZone -} from '../core/testing'; +} from 'ng-zorro-antd/core'; import { NzAutocompleteComponent, diff --git a/components/auto-complete/package.json b/components/auto-complete/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/auto-complete/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/auto-complete/style/entry.less b/components/auto-complete/style/entry.less new file mode 100644 index 00000000000..b4722f2bff3 --- /dev/null +++ b/components/auto-complete/style/entry.less @@ -0,0 +1,4 @@ +@import './index.less'; +// style dependencies +@import '../../select/style/index.less'; +@import '../../input/style/index.less'; diff --git a/components/avatar/doc/index.en-US.md b/components/avatar/doc/index.en-US.md index 0c6b953dcc0..6bd7b1e9f07 100644 --- a/components/avatar/doc/index.en-US.md +++ b/components/avatar/doc/index.en-US.md @@ -8,6 +8,14 @@ Avatars can be used to represent people or objects. It supports images, `Icon`s, ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzAvatarModule } from 'ng-zorro-antd'; +``` + ### nz-avatar | Property | Description | Type | Default | diff --git a/components/avatar/doc/index.zh-CN.md b/components/avatar/doc/index.zh-CN.md index 8b8406e9a4f..89231f639ff 100644 --- a/components/avatar/doc/index.zh-CN.md +++ b/components/avatar/doc/index.zh-CN.md @@ -9,6 +9,14 @@ title: Avatar ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzAvatarModule } from 'ng-zorro-antd'; +``` + ### nz-avatar | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/avatar/nz-avatar.component.ts b/components/avatar/nz-avatar.component.ts index 632dbf9d8b9..4520983e65c 100644 --- a/components/avatar/nz-avatar.component.ts +++ b/components/avatar/nz-avatar.component.ts @@ -11,8 +11,7 @@ import { ViewEncapsulation } from '@angular/core'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { NzSizeLDSType, NzSizeMap } from '../core/types/size'; +import { NzSizeLDSType, NzSizeMap, NzUpdateHostClassService } from 'ng-zorro-antd/core'; export type NzAvatarShape = 'square' | 'circle'; export type NzAvatarSize = NzSizeLDSType | number; diff --git a/components/avatar/nz-avatar.module.ts b/components/avatar/nz-avatar.module.ts index e65eff83609..4c60738bb90 100644 --- a/components/avatar/nz-avatar.module.ts +++ b/components/avatar/nz-avatar.module.ts @@ -1,6 +1,6 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzAvatarComponent } from './nz-avatar.component'; diff --git a/components/avatar/package.json b/components/avatar/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/avatar/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/avatar/style/entry.less b/components/avatar/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/avatar/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/back-top/back-top.spec.ts b/components/back-top/back-top.spec.ts index 6a30a456fcc..f662a10e068 100644 --- a/components/back-top/back-top.spec.ts +++ b/components/back-top/back-top.spec.ts @@ -3,7 +3,7 @@ import { fakeAsync, tick, ComponentFixture, TestBed } from '@angular/core/testin import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { NzScrollService } from '../core/scroll/nz-scroll.service'; +import { NzScrollService } from 'ng-zorro-antd/core'; import { NzBackTopComponent } from './nz-back-top.component'; import { NzBackTopModule } from './nz-back-top.module'; diff --git a/components/back-top/doc/index.en-US.md b/components/back-top/doc/index.en-US.md index f990c584fba..4987c06cd84 100644 --- a/components/back-top/doc/index.en-US.md +++ b/components/back-top/doc/index.en-US.md @@ -13,6 +13,14 @@ title: BackTop ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzBackTopModule } from 'ng-zorro-antd'; +``` + ### nz-back-top > The distance to the bottom is set to `50px` by default, which is overridable. diff --git a/components/back-top/doc/index.zh-CN.md b/components/back-top/doc/index.zh-CN.md index 472a90a0b03..839a537e00b 100644 --- a/components/back-top/doc/index.zh-CN.md +++ b/components/back-top/doc/index.zh-CN.md @@ -14,6 +14,14 @@ title: BackTop ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzBackTopModule } from 'ng-zorro-antd'; +``` + ### nz-back-top > 有默认样式,距离底部 `50px`,可覆盖。 diff --git a/components/back-top/nz-back-top.component.ts b/components/back-top/nz-back-top.component.ts index 8cc1438675b..9cda814161e 100644 --- a/components/back-top/nz-back-top.component.ts +++ b/components/back-top/nz-back-top.component.ts @@ -13,12 +13,9 @@ import { ViewEncapsulation } from '@angular/core'; +import { fadeMotion, toNumber, NzScrollService } from 'ng-zorro-antd/core'; import { fromEvent, Subscription } from 'rxjs'; import { distinctUntilChanged, throttleTime } from 'rxjs/operators'; -import { fadeMotion } from '../core/animation/fade'; - -import { NzScrollService } from '../core/scroll/nz-scroll.service'; -import { toNumber } from '../core/util/convert'; @Component({ selector: 'nz-back-top', diff --git a/components/back-top/nz-back-top.module.ts b/components/back-top/nz-back-top.module.ts index fab86d2e555..b25b52e607d 100644 --- a/components/back-top/nz-back-top.module.ts +++ b/components/back-top/nz-back-top.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { SCROLL_SERVICE_PROVIDER } from '../core/scroll/nz-scroll.service'; +import { SCROLL_SERVICE_PROVIDER } from 'ng-zorro-antd/core'; import { NzBackTopComponent } from './nz-back-top.component'; diff --git a/components/back-top/package.json b/components/back-top/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/back-top/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/back-top/style/entry.less b/components/back-top/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/back-top/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/badge/doc/index.en-US.md b/components/badge/doc/index.en-US.md index 19197431dad..ef86528fb16 100644 --- a/components/badge/doc/index.en-US.md +++ b/components/badge/doc/index.en-US.md @@ -22,6 +22,14 @@ Badge normally appears in proximity to notifications or user avatars with eye-ca ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzBadgeModule } from 'ng-zorro-antd'; +``` + ### nz-badge | Property | Description | Type | Default | diff --git a/components/badge/doc/index.zh-CN.md b/components/badge/doc/index.zh-CN.md index 8ec94dda089..ec7d7a4a743 100644 --- a/components/badge/doc/index.zh-CN.md +++ b/components/badge/doc/index.zh-CN.md @@ -23,6 +23,14 @@ title: Badge ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzBadgeModule } from 'ng-zorro-antd'; +``` + ### nz-badge | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/badge/nz-badge.component.ts b/components/badge/nz-badge.component.ts index 774bfcd9f65..c69d8d8aa26 100644 --- a/components/badge/nz-badge.component.ts +++ b/components/badge/nz-badge.component.ts @@ -12,9 +12,7 @@ import { ViewChild, ViewEncapsulation } from '@angular/core'; -import { zoomBadgeMotion } from '../core/animation/zoom'; -import { isEmpty } from '../core/util/check'; -import { InputBoolean } from '../core/util/convert'; +import { isEmpty, zoomBadgeMotion, InputBoolean } from 'ng-zorro-antd/core'; export type NzBadgeStatusType = 'success' | 'processing' | 'default' | 'error' | 'warning'; diff --git a/components/badge/nz-badge.module.ts b/components/badge/nz-badge.module.ts index 09a4d014603..196ceab635d 100644 --- a/components/badge/nz-badge.module.ts +++ b/components/badge/nz-badge.module.ts @@ -1,7 +1,8 @@ import { ObserversModule } from '@angular/cdk/observers'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; + +import { NzAddOnModule } from 'ng-zorro-antd/core'; import { NzBadgeComponent } from './nz-badge.component'; diff --git a/components/badge/nz-badge.spec.ts b/components/badge/nz-badge.spec.ts index e60903bac77..c7a256993a4 100644 --- a/components/badge/nz-badge.spec.ts +++ b/components/badge/nz-badge.spec.ts @@ -3,7 +3,7 @@ import { fakeAsync, tick, ComponentFixture, TestBed } from '@angular/core/testin import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { NGStyleInterface } from '../core/types/ng-class'; +import { NGStyleInterface } from 'ng-zorro-antd/core'; import { NzBadgeComponent } from './nz-badge.component'; import { NzBadgeModule } from './nz-badge.module'; diff --git a/components/badge/package.json b/components/badge/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/badge/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/badge/style/entry.less b/components/badge/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/badge/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/breadcrumb/doc/index.en-US.md b/components/breadcrumb/doc/index.en-US.md index 66736b76798..c569e4bae38 100755 --- a/components/breadcrumb/doc/index.en-US.md +++ b/components/breadcrumb/doc/index.en-US.md @@ -15,6 +15,14 @@ A breadcrumb displays the current location within a hierarchy. It allows going b ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzBreadCrumbModule } from 'ng-zorro-antd'; +``` + ### nz-breadcrumb | Property | Description | Type | Default | diff --git a/components/breadcrumb/doc/index.zh-CN.md b/components/breadcrumb/doc/index.zh-CN.md index 55ecf8e3157..4bac3433252 100755 --- a/components/breadcrumb/doc/index.zh-CN.md +++ b/components/breadcrumb/doc/index.zh-CN.md @@ -15,6 +15,14 @@ title: Breadcrumb ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzBreadCrumbModule } from 'ng-zorro-antd'; +``` + ### nz-breadcrumb | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/breadcrumb/nz-breadcrumb.module.ts b/components/breadcrumb/nz-breadcrumb.module.ts index f0847c5d716..b675de66c4b 100644 --- a/components/breadcrumb/nz-breadcrumb.module.ts +++ b/components/breadcrumb/nz-breadcrumb.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; import { NzBreadCrumbItemComponent } from './nz-breadcrumb-item.component'; import { NzBreadCrumbComponent } from './nz-breadcrumb.component'; diff --git a/components/breadcrumb/nz-breadcrumb.spec.ts b/components/breadcrumb/nz-breadcrumb.spec.ts index 6f26b28d106..bed4bb779e0 100644 --- a/components/breadcrumb/nz-breadcrumb.spec.ts +++ b/components/breadcrumb/nz-breadcrumb.spec.ts @@ -5,7 +5,7 @@ import { By } from '@angular/platform-browser'; import { Router, Routes } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { dispatchMouseEvent } from '../core/testing'; +import { dispatchMouseEvent } from 'ng-zorro-antd/core'; import { NzIconTestModule } from '../icon/nz-icon-test.module'; import { NzDemoBreadcrumbBasicComponent } from './demo/basic'; diff --git a/components/breadcrumb/package.json b/components/breadcrumb/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/breadcrumb/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/breadcrumb/style/entry.less b/components/breadcrumb/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/breadcrumb/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/button/doc/index.en-US.md b/components/button/doc/index.en-US.md index 4f210edce63..d37ab14467b 100644 --- a/components/button/doc/index.en-US.md +++ b/components/button/doc/index.en-US.md @@ -12,6 +12,14 @@ A button means an operation (or a series of operations). Clicking a button will ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzButtonModule } from 'ng-zorro-antd'; +``` + ### [nz-button] To get a customized button, just set `nzType`/`nzShape`/`nzSize`/`nzLoading`/`disabled`. diff --git a/components/button/doc/index.zh-CN.md b/components/button/doc/index.zh-CN.md index a089cab622d..a142c0eb0d2 100644 --- a/components/button/doc/index.zh-CN.md +++ b/components/button/doc/index.zh-CN.md @@ -13,6 +13,14 @@ subtitle: 按钮 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzButtonModule } from 'ng-zorro-antd'; +``` + ### [nz-button] 通过设置 Button 的属性来产生不同的按钮样式,推荐顺序为:`nzType` -> `nzShape` -> `nzSize` -> `nzLoading` -> `disabled` diff --git a/components/button/nz-button-group.component.ts b/components/button/nz-button-group.component.ts index 81a97691639..f675368d452 100644 --- a/components/button/nz-button-group.component.ts +++ b/components/button/nz-button-group.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, ElementRef, Input, OnInit, ViewEncapsulation } from '@angular/core'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { NzSizeLDSType } from '../core/types/size'; + +import { NzSizeLDSType, NzUpdateHostClassService } from 'ng-zorro-antd/core'; @Component({ selector: 'nz-button-group', diff --git a/components/button/nz-button.component.ts b/components/button/nz-button.component.ts index 31d36556b26..5bbd4d62746 100644 --- a/components/button/nz-button.component.ts +++ b/components/button/nz-button.component.ts @@ -21,13 +21,19 @@ import { } from '@angular/core'; import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { NzSizeLDSType, NzSizeMap } from '../core/types/size'; -import { isEmpty } from '../core/util/check'; -import { InputBoolean } from '../core/util/convert'; -import { findFirstNotEmptyNode, findLastNotEmptyNode } from '../core/util/dom'; -import { NzWaveConfig, NzWaveDirective, NZ_WAVE_GLOBAL_CONFIG } from '../core/wave/nz-wave.directive'; -import { NzIconDirective } from '../icon/nz-icon.directive'; +import { + findFirstNotEmptyNode, + findLastNotEmptyNode, + isEmpty, + InputBoolean, + NzSizeLDSType, + NzSizeMap, + NzUpdateHostClassService, + NzWaveConfig, + NzWaveDirective, + NZ_WAVE_GLOBAL_CONFIG +} from 'ng-zorro-antd/core'; +import { NzIconDirective } from 'ng-zorro-antd/icon'; export type NzButtonType = 'primary' | 'dashed' | 'danger' | 'default'; export type NzButtonShape = 'circle' | 'round' | null; diff --git a/components/button/nz-button.module.ts b/components/button/nz-button.module.ts index fb1c664831b..93d47ca182d 100644 --- a/components/button/nz-button.module.ts +++ b/components/button/nz-button.module.ts @@ -1,8 +1,9 @@ import { ObserversModule } from '@angular/cdk/observers'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzWaveModule } from '../core/wave/nz-wave.module'; -import { NzIconModule } from '../icon/nz-icon.module'; + +import { NzWaveModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzButtonGroupComponent } from './nz-button-group.component'; import { NzButtonComponent } from './nz-button.component'; diff --git a/components/button/package.json b/components/button/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/button/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/button/style/entry.less b/components/button/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/button/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/calendar/doc/index.en-US.md b/components/calendar/doc/index.en-US.md index 3060abcacaa..55655a3a039 100644 --- a/components/calendar/doc/index.en-US.md +++ b/components/calendar/doc/index.en-US.md @@ -36,6 +36,14 @@ registerLocaleData(en); {{ date | date:'d'}} ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzCalendarModule } from 'ng-zorro-antd'; +``` + ### nz-calendar | Property | Description | Type | Default | diff --git a/components/calendar/doc/index.zh-CN.md b/components/calendar/doc/index.zh-CN.md index af571cd0c43..e5ad11e1a75 100644 --- a/components/calendar/doc/index.zh-CN.md +++ b/components/calendar/doc/index.zh-CN.md @@ -37,6 +37,14 @@ registerLocaleData(zh); {{ date | date:'d'}} ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzCalendarModule } from 'ng-zorro-antd'; +``` + ### nz-calendar | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/calendar/nz-calendar-header.component.ts b/components/calendar/nz-calendar-header.component.ts index c023954d9e9..372d2565f6e 100644 --- a/components/calendar/nz-calendar-header.component.ts +++ b/components/calendar/nz-calendar-header.component.ts @@ -8,8 +8,7 @@ import { ViewEncapsulation } from '@angular/core'; import setMonth from 'date-fns/set_month'; -import { DateHelperService } from '../i18n/date-helper.service'; -import { NzI18nService as I18n } from '../i18n/nz-i18n.service'; +import { DateHelperService, NzI18nService as I18n } from 'ng-zorro-antd/i18n'; @Component({ encapsulation: ViewEncapsulation.None, diff --git a/components/calendar/nz-calendar.component.ts b/components/calendar/nz-calendar.component.ts index 005644ccca8..7f947c28c1a 100644 --- a/components/calendar/nz-calendar.component.ts +++ b/components/calendar/nz-calendar.component.ts @@ -29,8 +29,9 @@ import setYear from 'date-fns/set_year'; import startOfMonth from 'date-fns/start_of_month'; import startOfWeek from 'date-fns/start_of_week'; import startOfYear from 'date-fns/start_of_year'; -import { DateHelperService } from '../i18n/date-helper.service'; -import { NzI18nService } from '../i18n/nz-i18n.service'; + +import { DateHelperService, NzI18nService } from 'ng-zorro-antd/i18n'; + import { NzDateCellDirective as DateCell, NzDateFullCellDirective as DateFullCell, diff --git a/components/calendar/nz-calendar.module.ts b/components/calendar/nz-calendar.module.ts index 08182017cd0..a03fb59c727 100644 --- a/components/calendar/nz-calendar.module.ts +++ b/components/calendar/nz-calendar.module.ts @@ -1,9 +1,11 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzI18nModule } from '../i18n/nz-i18n.module'; -import { NzRadioModule } from '../radio/nz-radio.module'; -import { NzSelectModule } from '../select/nz-select.module'; + +import { NzI18nModule } from 'ng-zorro-antd/i18n'; +import { NzRadioModule } from 'ng-zorro-antd/radio'; +import { NzSelectModule } from 'ng-zorro-antd/select'; + import { NzDateCellDirective, NzDateFullCellDirective, diff --git a/components/calendar/package.json b/components/calendar/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/calendar/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/calendar/public-api.ts b/components/calendar/public-api.ts index b440d5f9449..b0587fc7082 100644 --- a/components/calendar/public-api.ts +++ b/components/calendar/public-api.ts @@ -1,2 +1,4 @@ -export * from './nz-calendar.component'; export * from './nz-calendar.module'; +export * from './nz-calendar.component'; +export * from './nz-calendar-cells'; +export * from './nz-calendar-header.component'; diff --git a/components/calendar/style/entry.less b/components/calendar/style/entry.less new file mode 100644 index 00000000000..18d749c7146 --- /dev/null +++ b/components/calendar/style/entry.less @@ -0,0 +1,4 @@ +@import './index.less'; +// style dependencies +@import '../../select/style/index.less'; +@import '../../radio/style/index.less'; diff --git a/components/card/doc/index.en-US.md b/components/card/doc/index.en-US.md index 866571f6461..598182e0b74 100644 --- a/components/card/doc/index.en-US.md +++ b/components/card/doc/index.en-US.md @@ -17,6 +17,14 @@ A card can be used to display content related to a single subject. The content c 卡片内容 ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzCardModule } from 'ng-zorro-antd'; +``` + ### nz-card | Property | Description | Type | Default | diff --git a/components/card/doc/index.zh-CN.md b/components/card/doc/index.zh-CN.md index 968ce633094..0f997084389 100644 --- a/components/card/doc/index.zh-CN.md +++ b/components/card/doc/index.zh-CN.md @@ -18,6 +18,16 @@ cols: 1 卡片内容 ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +```ts +import { NzCardModule } from 'ng-zorro-antd'; +``` +``` + ### nz-card | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/card/nz-card.component.ts b/components/card/nz-card.component.ts index 8e215606acd..7f81eac2d1b 100755 --- a/components/card/nz-card.component.ts +++ b/components/card/nz-card.component.ts @@ -8,7 +8,7 @@ import { TemplateRef, ViewEncapsulation } from '@angular/core'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean } from 'ng-zorro-antd/core'; import { NzCardTabComponent } from './nz-card-tab.component'; @Component({ diff --git a/components/card/nz-card.module.ts b/components/card/nz-card.module.ts index b2ad7ef7529..d20e6b48e50 100644 --- a/components/card/nz-card.module.ts +++ b/components/card/nz-card.module.ts @@ -1,6 +1,6 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; import { NzCardGridDirective } from './nz-card-grid.directive'; import { NzCardLoadingComponent } from './nz-card-loading.component'; diff --git a/components/card/package.json b/components/card/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/card/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/card/style/entry.less b/components/card/style/entry.less new file mode 100644 index 00000000000..8929c6bd8f0 --- /dev/null +++ b/components/card/style/entry.less @@ -0,0 +1,4 @@ +@import './index.less'; +// style dependencies +@import '../../tabs/style/index.less'; +@import '../../grid/style/index.less'; \ No newline at end of file diff --git a/components/carousel/doc/index.en-US.md b/components/carousel/doc/index.en-US.md index 265223a1f9a..97882498287 100644 --- a/components/carousel/doc/index.en-US.md +++ b/components/carousel/doc/index.en-US.md @@ -14,6 +14,14 @@ A carousel component. Scales with its container. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzCarouselModule } from 'ng-zorro-antd'; +``` + ### nz-carousel | Property | Description | Type | Default | diff --git a/components/carousel/doc/index.zh-CN.md b/components/carousel/doc/index.zh-CN.md index a7625480f49..c029203e6b0 100644 --- a/components/carousel/doc/index.zh-CN.md +++ b/components/carousel/doc/index.zh-CN.md @@ -15,6 +15,14 @@ subtitle: 走马灯 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzCarouselModule } from 'ng-zorro-antd'; +``` + ### nz-carousel | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/carousel/nz-carousel-content.directive.ts b/components/carousel/nz-carousel-content.directive.ts index 9c191c3cd7e..84c0c28d812 100755 --- a/components/carousel/nz-carousel-content.directive.ts +++ b/components/carousel/nz-carousel-content.directive.ts @@ -1,6 +1,6 @@ import { Directive, ElementRef, OnInit, Renderer2 } from '@angular/core'; -import { isNotNil } from '../core/util/check'; +import { isNotNil } from 'ng-zorro-antd/core'; @Directive({ selector: '[nz-carousel-content]' diff --git a/components/carousel/nz-carousel.component.ts b/components/carousel/nz-carousel.component.ts index 0e358cfb1ef..b959581d20e 100755 --- a/components/carousel/nz-carousel.component.ts +++ b/components/carousel/nz-carousel.component.ts @@ -22,7 +22,9 @@ import { } from '@angular/core'; import { fromEvent, Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { InputBoolean, InputNumber } from '../core/util/convert'; + +import { InputBoolean, InputNumber } from 'ng-zorro-antd/core'; + import { NzCarouselContentDirective } from './nz-carousel-content.directive'; export type NzCarouselEffects = 'fade' | 'scrollx'; diff --git a/components/carousel/nz-carousel.spec.ts b/components/carousel/nz-carousel.spec.ts index e0c522b8f4b..0fbf17f9559 100644 --- a/components/carousel/nz-carousel.spec.ts +++ b/components/carousel/nz-carousel.spec.ts @@ -3,7 +3,7 @@ import { Component, DebugElement, ViewChild } from '@angular/core'; import { fakeAsync, tick, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { dispatchKeyboardEvent } from '../core/testing'; +import { dispatchKeyboardEvent } from 'ng-zorro-antd/core'; import { NzCarouselContentDirective } from './nz-carousel-content.directive'; import { NzCarouselComponent } from './nz-carousel.component'; diff --git a/components/carousel/package.json b/components/carousel/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/carousel/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/carousel/style/entry.less b/components/carousel/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/carousel/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/cascader/doc/index.en-US.md b/components/cascader/doc/index.en-US.md index 6381cf57a04..5544eb02ddc 100755 --- a/components/cascader/doc/index.en-US.md +++ b/components/cascader/doc/index.en-US.md @@ -18,6 +18,14 @@ Cascade selection box. ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzCascaderModule } from 'ng-zorro-antd'; +``` + ### nz-cascader | Property | Description | Type | Default | diff --git a/components/cascader/doc/index.zh-CN.md b/components/cascader/doc/index.zh-CN.md index 0ad7b836624..fa3093ccfa7 100755 --- a/components/cascader/doc/index.zh-CN.md +++ b/components/cascader/doc/index.zh-CN.md @@ -19,6 +19,14 @@ subtitle: 级联选择 ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzCascaderModule } from 'ng-zorro-antd'; +``` + ### nz-cascader | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/cascader/nz-cascader-definitions.ts b/components/cascader/nz-cascader-definitions.ts index 7a9f9b3c92f..39b22f54f3c 100644 --- a/components/cascader/nz-cascader-definitions.ts +++ b/components/cascader/nz-cascader-definitions.ts @@ -3,7 +3,6 @@ export type NzCascaderTriggerType = 'click' | 'hover'; export type NzCascaderSize = 'small' | 'large' | 'default'; export type NzCascaderFilter = (searchValue: string, path: CascaderOption[]) => boolean; - export type NzCascaderSorter = (a: CascaderOption[], b: CascaderOption[], inputValue: string) => number; export interface CascaderOption { diff --git a/components/cascader/nz-cascader-li.component.ts b/components/cascader/nz-cascader-li.component.ts index 65cf8f8049f..da3ac59605f 100644 --- a/components/cascader/nz-cascader-li.component.ts +++ b/components/cascader/nz-cascader-li.component.ts @@ -8,6 +8,7 @@ import { ViewEncapsulation } from '@angular/core'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; + import { CascaderOption } from './nz-cascader-definitions'; @Component({ diff --git a/components/cascader/nz-cascader.component.ts b/components/cascader/nz-cascader.component.ts index e4d5f2e048b..4b6d861d8dc 100644 --- a/components/cascader/nz-cascader.component.ts +++ b/components/cascader/nz-cascader.component.ts @@ -25,12 +25,14 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { slideMotion } from '../core/animation/slide'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { DEFAULT_CASCADER_POSITIONS } from '../core/overlay/overlay-position'; -import { NgClassType } from '../core/types/ng-class'; -import { toArray } from '../core/util/array'; -import { InputBoolean } from '../core/util/convert'; +import { + slideMotion, + toArray, + DEFAULT_DROPDOWN_POSITIONS, + InputBoolean, + NgClassType, + NzNoAnimationDirective +} from 'ng-zorro-antd/core'; import { CascaderOption, @@ -135,7 +137,7 @@ export class NzCascaderComponent implements NzCascaderComponentAsSource, OnInit, labelRenderContext = {}; onChange = Function.prototype; onTouched = Function.prototype; - positions: ConnectionPositionPair[] = [...DEFAULT_CASCADER_POSITIONS]; + positions: ConnectionPositionPair[] = [...DEFAULT_DROPDOWN_POSITIONS]; dropdownWidthStyle: string; isFocused = false; diff --git a/components/cascader/nz-cascader.module.ts b/components/cascader/nz-cascader.module.ts index 70c3be1e3bb..906e3497ebd 100644 --- a/components/cascader/nz-cascader.module.ts +++ b/components/cascader/nz-cascader.module.ts @@ -3,11 +3,11 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; -import { NzOverlayModule } from '../core/overlay/nz-overlay.module'; -import { NzEmptyModule } from '../empty/nz-empty.module'; -import { NzIconModule } from '../icon/nz-icon.module'; -import { NzInputModule } from '../input/nz-input.module'; +import { NzNoAnimationModule, NzOverlayModule } from 'ng-zorro-antd/core'; +import { NzEmptyModule } from 'ng-zorro-antd/empty'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzInputModule } from 'ng-zorro-antd/input'; + import { NzCascaderOptionComponent } from './nz-cascader-li.component'; import { NzCascaderComponent } from './nz-cascader.component'; diff --git a/components/cascader/nz-cascader.service.ts b/components/cascader/nz-cascader.service.ts index ed69af75be3..c596bcd9212 100644 --- a/components/cascader/nz-cascader.service.ts +++ b/components/cascader/nz-cascader.service.ts @@ -1,6 +1,7 @@ import { Injectable, OnDestroy } from '@angular/core'; import { BehaviorSubject, Subject } from 'rxjs'; -import { arraysEqual } from '../core/util/array'; + +import { arraysEqual } from 'ng-zorro-antd/core'; import { isShowSearchObject, diff --git a/components/cascader/nz-cascader.spec.ts b/components/cascader/nz-cascader.spec.ts index 43e12b67d2e..5f568dcffcb 100644 --- a/components/cascader/nz-cascader.spec.ts +++ b/components/cascader/nz-cascader.spec.ts @@ -11,7 +11,7 @@ import { dispatchEvent, dispatchKeyboardEvent, dispatchMouseEvent -} from '../core/testing'; +} from 'ng-zorro-antd/core'; import { CascaderOption, NzShowSearchOptions } from './nz-cascader-definitions'; import { NzCascaderComponent } from './nz-cascader.component'; diff --git a/components/cascader/package.json b/components/cascader/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/cascader/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/cascader/public-api.ts b/components/cascader/public-api.ts index 6b2f9364592..b8626b593e2 100644 --- a/components/cascader/public-api.ts +++ b/components/cascader/public-api.ts @@ -3,3 +3,4 @@ export * from './nz-cascader-utils'; export * from './nz-cascader.component'; export * from './nz-cascader.module'; export * from './nz-cascader.service'; +export * from './nz-cascader-li.component'; diff --git a/components/cascader/style/entry.less b/components/cascader/style/entry.less new file mode 100644 index 00000000000..03f5202ce9b --- /dev/null +++ b/components/cascader/style/entry.less @@ -0,0 +1,4 @@ +@import './index.less'; +// style dependencies +@import '../../empty/style/index.less'; +@import '../../input/style/index.less'; diff --git a/components/cascader/types.ts b/components/cascader/types.ts deleted file mode 100644 index 51ee4a620ec..00000000000 --- a/components/cascader/types.ts +++ /dev/null @@ -1,35 +0,0 @@ -export type NzCascaderExpandTrigger = 'click' | 'hover'; - -export type NzCascaderTriggerType = 'click' | 'hover'; - -export type NzCascaderSize = 'small' | 'large' | 'default'; - -export interface CascaderOption { - value?: any; // tslint:disable-line:no-any - label?: string; - title?: string; - disabled?: boolean; - loading?: boolean; - isLeaf?: boolean; - parent?: CascaderOption; - children?: CascaderOption[]; - - [key: string]: any; // tslint:disable-line:no-any -} - -export interface CascaderSearchOption extends CascaderOption { - path: CascaderOption[]; -} - -export type NzCascaderSorterFunction = (a: CascaderOption[], b: CascaderOption[], inputValue: string) => number; - -export type NzCascaderFilterFunction = (inputValue: string, p: CascaderOption[]) => boolean; - -export interface NzShowSearchOptions { - filter?: NzCascaderFilterFunction; - sorter?: NzCascaderSorterFunction; -} - -export const isNzShowSearchOptions = (option: boolean | NzShowSearchOptions): option is NzShowSearchOptions => { - return option instanceof Object; -}; diff --git a/components/checkbox/doc/index.en-US.md b/components/checkbox/doc/index.en-US.md index e1678ea7a71..0916191f638 100755 --- a/components/checkbox/doc/index.en-US.md +++ b/components/checkbox/doc/index.en-US.md @@ -13,6 +13,14 @@ Checkbox. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzCheckboxModule } from 'ng-zorro-antd'; +``` + ### [nz-checkbox] | Property | Description | Type | Default | diff --git a/components/checkbox/doc/index.zh-CN.md b/components/checkbox/doc/index.zh-CN.md index 780f0713a0d..482478c6d84 100755 --- a/components/checkbox/doc/index.zh-CN.md +++ b/components/checkbox/doc/index.zh-CN.md @@ -14,6 +14,14 @@ title: Checkbox ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzCheckboxModule } from 'ng-zorro-antd'; +``` + ### [nz-checkbox] | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/checkbox/nz-checkbox-group.component.ts b/components/checkbox/nz-checkbox-group.component.ts index 64d85184feb..ed2496a1703 100644 --- a/components/checkbox/nz-checkbox-group.component.ts +++ b/components/checkbox/nz-checkbox-group.component.ts @@ -10,7 +10,8 @@ import { ViewEncapsulation } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { InputBoolean } from '../core/util/convert'; + +import { InputBoolean } from 'ng-zorro-antd/core'; export interface NzCheckBoxOptionInterface { label: string; diff --git a/components/checkbox/nz-checkbox.component.ts b/components/checkbox/nz-checkbox.component.ts index 0302f8b8479..28b80ad5f8b 100644 --- a/components/checkbox/nz-checkbox.component.ts +++ b/components/checkbox/nz-checkbox.component.ts @@ -19,8 +19,9 @@ import { ViewEncapsulation } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { isEmpty } from '../core/util/check'; -import { InputBoolean } from '../core/util/convert'; + +import { isEmpty, InputBoolean } from 'ng-zorro-antd/core'; + import { NzCheckboxWrapperComponent } from './nz-checkbox-wrapper.component'; @Component({ diff --git a/components/checkbox/package.json b/components/checkbox/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/checkbox/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/checkbox/style/entry.less b/components/checkbox/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/checkbox/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/collapse/doc/index.en-US.md b/components/collapse/doc/index.en-US.md index 70fca8a1509..6ba3bdc3ae0 100755 --- a/components/collapse/doc/index.en-US.md +++ b/components/collapse/doc/index.en-US.md @@ -14,6 +14,14 @@ A content area which can be collapsed and expanded. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzCollapseModule } from 'ng-zorro-antd'; +``` + ### nz-collapse | Property | Description | Type | Default | diff --git a/components/collapse/doc/index.zh-CN.md b/components/collapse/doc/index.zh-CN.md index 08879ef838f..e41abaad541 100755 --- a/components/collapse/doc/index.zh-CN.md +++ b/components/collapse/doc/index.zh-CN.md @@ -15,6 +15,14 @@ cols: 1 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzCollapseModule } from 'ng-zorro-antd'; +``` + ### nz-collapse | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/collapse/nz-collapse-panel.component.ts b/components/collapse/nz-collapse-panel.component.ts index 126591adb9e..8b4f044cdcb 100644 --- a/components/collapse/nz-collapse-panel.component.ts +++ b/components/collapse/nz-collapse-panel.component.ts @@ -14,9 +14,9 @@ import { TemplateRef, ViewEncapsulation } from '@angular/core'; -import { collapseMotion } from '../core/animation/collapse'; -import { InputBoolean } from '../core/util/convert'; +import { collapseMotion, InputBoolean } from 'ng-zorro-antd/core'; + import { NzCollapseComponent } from './nz-collapse.component'; @Component({ diff --git a/components/collapse/nz-collapse.component.ts b/components/collapse/nz-collapse.component.ts index d032c14217a..e29faa0bb26 100644 --- a/components/collapse/nz-collapse.component.ts +++ b/components/collapse/nz-collapse.component.ts @@ -1,5 +1,7 @@ import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core'; -import { InputBoolean } from '../core/util/convert'; + +import { InputBoolean } from 'ng-zorro-antd/core'; + import { NzCollapsePanelComponent } from './nz-collapse-panel.component'; @Component({ diff --git a/components/collapse/nz-collapse.module.ts b/components/collapse/nz-collapse.module.ts index 2363082bbfc..a37a591810f 100644 --- a/components/collapse/nz-collapse.module.ts +++ b/components/collapse/nz-collapse.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzCollapsePanelComponent } from './nz-collapse-panel.component'; import { NzCollapseComponent } from './nz-collapse.component'; diff --git a/components/collapse/package.json b/components/collapse/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/collapse/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/collapse/style/entry.less b/components/collapse/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/collapse/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/comment/doc/index.en-US.md b/components/comment/doc/index.en-US.md index fe735326c94..575dfb3155e 100644 --- a/components/comment/doc/index.en-US.md +++ b/components/comment/doc/index.en-US.md @@ -18,6 +18,14 @@ Comments can be used to enable discussions on an entity such as a page, blog pos | [nzAuthor] | The element to display as the comment author | `string|TemplateRef` | - | | [nzDatetime] | A datetime element containing the time to be displayed | `string|TemplateRef` | - | +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzCommentModule } from 'ng-zorro-antd'; +``` + ### Comment sections | Element | Description | | ----- | ----------- | diff --git a/components/comment/doc/index.zh-CN.md b/components/comment/doc/index.zh-CN.md index dc78a4ae904..a59c288aa52 100644 --- a/components/comment/doc/index.zh-CN.md +++ b/components/comment/doc/index.zh-CN.md @@ -19,6 +19,14 @@ cols: 1 | [nzAuthor] | 显示评论的作者 | `string|TemplateRef` | - | | [nzDatetime] | 展示时间描述 | `string|TemplateRef` | - | +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzCommentModule } from 'ng-zorro-antd'; +``` + ### 评论组成部分 | 元素 | 说明 | | ----- | ----------- | diff --git a/components/comment/nz-comment.component.ts b/components/comment/nz-comment.component.ts index 0832f7662f5..d3e0d863c58 100644 --- a/components/comment/nz-comment.component.ts +++ b/components/comment/nz-comment.component.ts @@ -7,6 +7,7 @@ import { TemplateRef, ViewEncapsulation } from '@angular/core'; + import { NzCommentActionComponent as CommentAction } from './nz-comment-cells'; @Component({ diff --git a/components/comment/nz-comment.module.ts b/components/comment/nz-comment.module.ts index b084b41287d..956871a24a0 100644 --- a/components/comment/nz-comment.module.ts +++ b/components/comment/nz-comment.module.ts @@ -1,6 +1,8 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; + +import { NzAddOnModule } from 'ng-zorro-antd/core'; + import { NzCommentActionComponent, NzCommentActionHostDirective, diff --git a/components/comment/package.json b/components/comment/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/comment/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/comment/style/entry.less b/components/comment/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/comment/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/core/addon/index.ts b/components/core/addon/index.ts new file mode 100644 index 00000000000..7e1a213e3ea --- /dev/null +++ b/components/core/addon/index.ts @@ -0,0 +1 @@ +export * from './public-api'; diff --git a/components/core/addon/public-api.ts b/components/core/addon/public-api.ts new file mode 100644 index 00000000000..19d7d9a5bbc --- /dev/null +++ b/components/core/addon/public-api.ts @@ -0,0 +1,3 @@ +export { NzAddOnModule } from './addon.module'; +export { NzClassListAddDirective } from './classlist_add'; +export { NzStringTemplateOutletDirective } from './string_template_outlet'; diff --git a/components/core/animation/animation.ts b/components/core/animation/animation-consts.ts similarity index 100% rename from components/core/animation/animation.ts rename to components/core/animation/animation-consts.ts diff --git a/components/core/animation/collapse.ts b/components/core/animation/collapse.ts index bb463907ec7..c089a2d721e 100644 --- a/components/core/animation/collapse.ts +++ b/components/core/animation/collapse.ts @@ -1,5 +1,5 @@ import { animate, state, style, transition, trigger, AnimationTriggerMetadata } from '@angular/animations'; -import { AnimationCurves } from './animation'; +import { AnimationCurves } from './animation-consts'; export const collapseMotion: AnimationTriggerMetadata = trigger('collapseMotion', [ state('expanded', style({ height: '*' })), diff --git a/components/core/animation/fade.ts b/components/core/animation/fade.ts index b2fea79fa81..de775ea5320 100644 --- a/components/core/animation/fade.ts +++ b/components/core/animation/fade.ts @@ -1,5 +1,5 @@ import { animate, style, transition, trigger, AnimationTriggerMetadata } from '@angular/animations'; -import { AnimationDuration } from './animation'; +import { AnimationDuration } from './animation-consts'; export const fadeMotion: AnimationTriggerMetadata = trigger('fadeMotion', [ transition(':enter', [style({ opacity: 0 }), animate(`${AnimationDuration.BASE}`, style({ opacity: 1 }))]), diff --git a/components/core/animation/help.ts b/components/core/animation/help.ts index d7a2627f088..23023aeeab9 100644 --- a/components/core/animation/help.ts +++ b/components/core/animation/help.ts @@ -1,5 +1,5 @@ import { animate, style, transition, trigger, AnimationTriggerMetadata } from '@angular/animations'; -import { AnimationCurves, AnimationDuration } from './animation'; +import { AnimationCurves, AnimationDuration } from './animation-consts'; export const helpMotion: AnimationTriggerMetadata = trigger('helpMotion', [ transition(':enter', [ diff --git a/components/core/animation/index.ts b/components/core/animation/index.ts new file mode 100644 index 00000000000..7e1a213e3ea --- /dev/null +++ b/components/core/animation/index.ts @@ -0,0 +1 @@ +export * from './public-api'; diff --git a/components/core/animation/move.ts b/components/core/animation/move.ts index c397d9ae3ae..55b817e830b 100644 --- a/components/core/animation/move.ts +++ b/components/core/animation/move.ts @@ -1,5 +1,5 @@ import { animate, style, transition, trigger, AnimationTriggerMetadata } from '@angular/animations'; -import { AnimationDuration } from './animation'; +import { AnimationDuration } from './animation-consts'; export const moveUpMotion: AnimationTriggerMetadata = trigger('moveUpMotion', [ transition('* => enter', [ diff --git a/components/core/animation/public-api.ts b/components/core/animation/public-api.ts new file mode 100644 index 00000000000..7b855aca03a --- /dev/null +++ b/components/core/animation/public-api.ts @@ -0,0 +1,8 @@ +export * from './animation-consts'; +export * from './collapse'; +export * from './fade'; +export * from './help'; +export * from './move'; +export * from './notification'; +export * from './slide'; +export * from './zoom'; diff --git a/components/core/animation/slide.ts b/components/core/animation/slide.ts index d739f005577..5de030d7401 100755 --- a/components/core/animation/slide.ts +++ b/components/core/animation/slide.ts @@ -1,5 +1,5 @@ import { animate, state, style, transition, trigger, AnimationTriggerMetadata } from '@angular/animations'; -import { AnimationCurves, AnimationDuration } from './animation'; +import { AnimationCurves, AnimationDuration } from './animation-consts'; const ANIMATION_TRANSITION_IN = `${AnimationDuration.BASE} ${AnimationCurves.EASE_OUT_QUINT}`; const ANIMATION_TRANSITION_OUT = `${AnimationDuration.BASE} ${AnimationCurves.EASE_IN_QUINT}`; diff --git a/components/core/animation/zoom.ts b/components/core/animation/zoom.ts index b825193afdd..46a1802debb 100644 --- a/components/core/animation/zoom.ts +++ b/components/core/animation/zoom.ts @@ -1,5 +1,5 @@ import { animate, style, transition, trigger, AnimationTriggerMetadata } from '@angular/animations'; -import { AnimationCurves, AnimationDuration } from './animation'; +import { AnimationCurves, AnimationDuration } from './animation-consts'; export const zoomMotion: AnimationTriggerMetadata = trigger('zoomMotion', [ transition(':enter', [ diff --git a/components/core/dropdown/index.ts b/components/core/dropdown/index.ts new file mode 100644 index 00000000000..7e1a213e3ea --- /dev/null +++ b/components/core/dropdown/index.ts @@ -0,0 +1 @@ +export * from './public-api'; diff --git a/components/core/dropdown/nz-dropdown-service.resolver.ts b/components/core/dropdown/nz-dropdown-service.resolver.ts new file mode 100644 index 00000000000..b546704de82 --- /dev/null +++ b/components/core/dropdown/nz-dropdown-service.resolver.ts @@ -0,0 +1,5 @@ +import { InjectionToken } from '@angular/core'; + +import { NzMenuBaseService } from './nz-menu-base.service'; + +export const NzDropdownHigherOrderServiceToken = new InjectionToken('NzTreeHigherOrder'); diff --git a/components/core/dropdown/nz-menu-base.service.ts b/components/core/dropdown/nz-menu-base.service.ts new file mode 100644 index 00000000000..e4cd93e1a04 --- /dev/null +++ b/components/core/dropdown/nz-menu-base.service.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { merge, BehaviorSubject, Subject } from 'rxjs'; + +import { NzDirectionVHIType } from '../types'; + +@Injectable() +export class NzMenuBaseService { + isInDropDown: boolean; + menuItemClick$ = new Subject(); // tslint:disable-line no-any + theme$ = new Subject(); + mode$ = new BehaviorSubject('vertical'); + inlineIndent$ = new BehaviorSubject(24); + check$ = merge(this.theme$, this.mode$, this.inlineIndent$); + theme: 'light' | 'dark' = 'light'; + mode: NzDirectionVHIType = 'vertical'; + inlineIndent = 24; + menuOpen$ = new BehaviorSubject(false); + + // tslint:disable-next-line no-any + onMenuItemClick(menu: any): void { + this.menuItemClick$.next(menu); + } + + setMode(mode: NzDirectionVHIType): void { + this.mode = mode; + this.mode$.next(mode); + } + + setTheme(theme: 'light' | 'dark'): void { + this.theme = theme; + this.theme$.next(theme); + } + + setInlineIndent(indent: number): void { + this.inlineIndent = indent; + this.inlineIndent$.next(indent); + } +} diff --git a/components/core/dropdown/public-api.ts b/components/core/dropdown/public-api.ts new file mode 100644 index 00000000000..0e8e4b473e0 --- /dev/null +++ b/components/core/dropdown/public-api.ts @@ -0,0 +1,2 @@ +export * from './nz-menu-base.service'; +export * from './nz-dropdown-service.resolver'; diff --git a/components/core/index.ts b/components/core/index.ts new file mode 100644 index 00000000000..7e1a213e3ea --- /dev/null +++ b/components/core/index.ts @@ -0,0 +1 @@ +export * from './public-api'; diff --git a/components/core/logger/index.ts b/components/core/logger/index.ts new file mode 100644 index 00000000000..7e1a213e3ea --- /dev/null +++ b/components/core/logger/index.ts @@ -0,0 +1 @@ +export * from './public-api'; diff --git a/components/core/util/logger/logger.module.ts b/components/core/logger/logger.module.ts similarity index 100% rename from components/core/util/logger/logger.module.ts rename to components/core/logger/logger.module.ts diff --git a/components/core/util/logger/logger.service.ts b/components/core/logger/logger.service.ts similarity index 100% rename from components/core/util/logger/logger.service.ts rename to components/core/logger/logger.service.ts diff --git a/components/core/logger/public-api.ts b/components/core/logger/public-api.ts new file mode 100644 index 00000000000..0c62539ae68 --- /dev/null +++ b/components/core/logger/public-api.ts @@ -0,0 +1,7 @@ +export { LoggerModule } from './logger.module'; +export { + LoggerService, + NZ_LOGGER_STATE, + LOGGER_SERVICE_PROVIDER, + LOGGER_SERVICE_PROVIDER_FACTORY +} from './logger.service'; diff --git a/components/core/overlay/index.ts b/components/core/overlay/index.ts new file mode 100644 index 00000000000..7e1a213e3ea --- /dev/null +++ b/components/core/overlay/index.ts @@ -0,0 +1 @@ +export * from './public-api'; diff --git a/components/core/overlay/public-api.ts b/components/core/overlay/public-api.ts new file mode 100644 index 00000000000..52e89225603 --- /dev/null +++ b/components/core/overlay/public-api.ts @@ -0,0 +1,3 @@ +export * from './nz-connected-overlay'; +export * from './nz-overlay.module'; +export * from './overlay-position'; diff --git a/components/core/package.json b/components/core/package.json new file mode 100644 index 00000000000..54c27fb98f1 --- /dev/null +++ b/components/core/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "./public-api.ts" + } + } +} diff --git a/components/core/polyfill/index.ts b/components/core/polyfill/index.ts new file mode 100644 index 00000000000..7e1a213e3ea --- /dev/null +++ b/components/core/polyfill/index.ts @@ -0,0 +1 @@ +export * from './public-api'; diff --git a/components/core/polyfill/public-api.ts b/components/core/polyfill/public-api.ts new file mode 100644 index 00000000000..858ba1134e3 --- /dev/null +++ b/components/core/polyfill/public-api.ts @@ -0,0 +1 @@ +export * from './request-animation'; diff --git a/components/core/public-api.ts b/components/core/public-api.ts new file mode 100644 index 00000000000..0937d77591d --- /dev/null +++ b/components/core/public-api.ts @@ -0,0 +1,15 @@ +export * from './addon/public-api'; +export * from './animation/public-api'; +export * from './no-animation/public-api'; +export * from './overlay/public-api'; +export * from './overlay/public-api'; +export * from './polyfill/public-api'; +export * from './scroll/public-api'; +export * from './services/public-api'; +export * from './testing/public-api'; +export * from './tree/public-api'; +export * from './types/public-api'; +export * from './util/public-api'; +export * from './wave/public-api'; +export * from './dropdown/public-api'; +export * from './logger/public-api'; diff --git a/components/core/scroll/index.ts b/components/core/scroll/index.ts new file mode 100644 index 00000000000..7e1a213e3ea --- /dev/null +++ b/components/core/scroll/index.ts @@ -0,0 +1 @@ +export * from './public-api'; diff --git a/components/core/scroll/public-api.ts b/components/core/scroll/public-api.ts new file mode 100644 index 00000000000..e78c3b45183 --- /dev/null +++ b/components/core/scroll/public-api.ts @@ -0,0 +1 @@ +export * from './nz-scroll.service'; diff --git a/components/core/services/index.ts b/components/core/services/index.ts new file mode 100644 index 00000000000..7e1a213e3ea --- /dev/null +++ b/components/core/services/index.ts @@ -0,0 +1 @@ +export * from './public-api'; diff --git a/components/core/services/public-api.ts b/components/core/services/public-api.ts new file mode 100644 index 00000000000..e046b94ca97 --- /dev/null +++ b/components/core/services/public-api.ts @@ -0,0 +1,2 @@ +export * from './nz-measure-scrollbar.service'; +export * from './update-host-class.service'; diff --git a/components/core/services/update-host-class.service.ts b/components/core/services/update-host-class.service.ts index 2244e966835..84e6d89a0f6 100644 --- a/components/core/services/update-host-class.service.ts +++ b/components/core/services/update-host-class.service.ts @@ -13,7 +13,7 @@ export class NzUpdateHostClassService { this.addClass(el, this.classMap, this.renderer); } - private removeClass(el: HTMLElement, classMap: object, renderer: Renderer2): void { + private removeClass(el: HTMLElement, classMap: NgClassInterface, renderer: Renderer2): void { for (const i in classMap) { if (classMap.hasOwnProperty(i)) { renderer.removeClass(el, i); @@ -23,10 +23,8 @@ export class NzUpdateHostClassService { private addClass(el: HTMLElement, classMap: NgClassInterface, renderer: Renderer2): void { for (const i in classMap) { - if (classMap.hasOwnProperty(i)) { - if (classMap[i]) { - renderer.addClass(el, i); - } + if (classMap.hasOwnProperty(i) && classMap[i]) { + renderer.addClass(el, i); } } } diff --git a/components/core/style/index.less b/components/core/style/index.less index 374e212d28c..a1252cd8360 100644 --- a/components/core/style/index.less +++ b/components/core/style/index.less @@ -67,149 +67,6 @@ } -@table-prefix-cls: ~'@{ant-prefix}-table'; -@table-td-cls: ~'@{table-prefix-cls}-td'; -@table-th-cls: ~'@{table-prefix-cls}-th'; -@table-th-left-cls: ~'@{table-th-cls}-left'; -@table-th-right-cls: ~'@{table-th-cls}-right'; -@table-td-left-cls: ~'@{table-td-cls}-left'; -@table-td-right-cls: ~'@{table-td-cls}-right'; - -.box-shadow-left() { - .@{table-th-right-cls}-sticky, - .@{table-td-right-cls}-sticky { - box-shadow: -6px 0 6px 0px rgba(0, 0, 0, .05); - } -} - -.box-shadow-right() { - .@{table-th-left-cls}-sticky, - .@{table-td-left-cls}-sticky { - box-shadow: 6px 0 6px 0px rgba(0, 0, 0, .05); - } -} - -.border-left() { - .@{table-th-right-cls}-sticky, - .@{table-td-right-cls}-sticky { - border-right: @border-width-base @border-style-base @border-color-split; - } -} - -.border-right() { - .@{table-th-left-cls}-sticky, - .@{table-td-left-cls}-sticky { - border-left: @border-width-base @border-style-base @border-color-split; - } -} - -.@{table-prefix-cls}-scroll-position-middle, -.@{table-prefix-cls}-scroll-position-left { - .@{table-td-right-cls}-sticky + .@{table-td-right-cls}-sticky { - box-shadow: none; - } - - .@{table-th-right-cls}-sticky + .@{table-th-right-cls}-sticky { - box-shadow: none; - } -} - - -.@{table-th-left-cls}-sticky, -.@{table-th-right-cls}-sticky, -.@{table-td-right-cls}-sticky, -.@{table-td-left-cls}-sticky { - position: sticky !important; - z-index: 1; -} - -.@{table-td-left-cls}-sticky, -.@{table-td-right-cls}-sticky { - background: @component-background; -} - -.@{table-prefix-cls}-tbody { - & > tr { - &:hover { - & > td { - &.@{table-td-left-cls}-sticky { - background: @table-row-hover-bg; - } - - &.@{table-td-right-cls}-sticky { - background: @table-row-hover-bg; - } - } - } - } -} - -.@{table-prefix-cls}-thead > tr > th .@{table-prefix-cls}-column-sorters > nz-dropdown { - position: static !important; -} - -.@{table-prefix-cls}-scroll-position-middle { - .box-shadow-right; - .box-shadow-left; -} - -.@{table-prefix-cls}-scroll-position-left { - .box-shadow-left; -} - -.@{table-prefix-cls}-scroll-position-right { - .box-shadow-right; -} - -.@{table-prefix-cls}-bordered { - &.@{table-prefix-cls}-scroll-position-middle { - .border-right; - .border-left; - } - - &.@{table-prefix-cls}-scroll-position-left { - .border-left; - } - - &.@{table-prefix-cls}-scroll-position-right { - .border-right; - } -} - - -.@{table-prefix-cls}-middle { - > .@{table-prefix-cls}-content { - > .@{table-prefix-cls}-scroll > .@{table-prefix-cls}-body > .cdk-virtual-scroll-content-wrapper > table { - > .@{table-prefix-cls}-thead > tr > th, - > .@{table-prefix-cls}-tbody > tr > td { - padding: @table-padding-vertical-md @table-padding-horizontal-md; - } - } - } -} - -.@{table-prefix-cls}-small { - > .@{table-prefix-cls}-content { - > .@{table-prefix-cls}-scroll > .@{table-prefix-cls}-header > table, - > .@{table-prefix-cls}-scroll > .@{table-prefix-cls}-body > table, - > .@{table-prefix-cls}-scroll > .@{table-prefix-cls}-body > .cdk-virtual-scroll-content-wrapper > table { - border: 0; - - > .@{table-prefix-cls}-thead > tr > th { - &.@{table-th-left-cls}-sticky, - &.@{table-th-right-cls}-sticky { - background: @component-background; - } - } - - > .@{table-prefix-cls}-thead > tr > th, - > .@{table-prefix-cls}-tbody > tr > td { - padding: @table-padding-vertical-sm @table-padding-horizontal-sm; - } - } - } -} - // hack tree css .ant-tree { &.ant-tree-show-line { diff --git a/components/core/testing/public-api.ts b/components/core/testing/public-api.ts index 7922e59e492..846a6e237b6 100644 --- a/components/core/testing/public-api.ts +++ b/components/core/testing/public-api.ts @@ -1,11 +1,3 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - export * from './dispatch-events'; export * from './event-objects'; export * from './type-in-element'; diff --git a/components/core/tree/index.ts b/components/core/tree/index.ts new file mode 100644 index 00000000000..7e1a213e3ea --- /dev/null +++ b/components/core/tree/index.ts @@ -0,0 +1 @@ +export * from './public-api'; diff --git a/components/tree/nz-tree-node.ts b/components/core/tree/nz-tree-base-node.ts similarity index 98% rename from components/tree/nz-tree-node.ts rename to components/core/tree/nz-tree-base-node.ts index dd3e4b195ac..e7e2f6202a5 100644 --- a/components/tree/nz-tree-node.ts +++ b/components/core/tree/nz-tree-base-node.ts @@ -1,5 +1,5 @@ +import { NzTreeNodeBaseComponent } from './nz-tree-base.definitions'; import { NzTreeBaseService } from './nz-tree-base.service'; -import { NzTreeNodeComponent } from './nz-tree-node.component'; export interface NzTreeNodeOptions { title: string; @@ -43,7 +43,7 @@ export class NzTreeNode { isMatched: boolean; service: NzTreeBaseService | null; - component: NzTreeNodeComponent; + component: NzTreeNodeBaseComponent; get treeService(): NzTreeBaseService | null { return this.service || (this.parentNode && this.parentNode.treeService); diff --git a/components/tree/nz-tree-util.ts b/components/core/tree/nz-tree-base-util.ts similarity index 86% rename from components/tree/nz-tree-util.ts rename to components/core/tree/nz-tree-base-util.ts index b24c978027b..57804e297bf 100644 --- a/components/tree/nz-tree-util.ts +++ b/components/core/tree/nz-tree-base-util.ts @@ -1,4 +1,4 @@ -import { NzTreeNode } from './nz-tree-node'; +import { NzTreeNode } from './nz-tree-base-node'; export function isCheckDisabled(node: NzTreeNode): boolean { const { isDisabled, isDisableCheckbox } = node; diff --git a/components/tree/interface.ts b/components/core/tree/nz-tree-base.definitions.ts similarity index 73% rename from components/tree/interface.ts rename to components/core/tree/nz-tree-base.definitions.ts index a4902c618ef..54a5b8a29c8 100644 --- a/components/tree/interface.ts +++ b/components/core/tree/nz-tree-base.definitions.ts @@ -1,4 +1,4 @@ -import { NzTreeNode } from './nz-tree-node'; +import { NzTreeNode } from './nz-tree-base-node'; export interface NzFormatEmitEvent { eventName: string; @@ -17,3 +17,8 @@ export interface NzFormatBeforeDropEvent { node: NzTreeNode; pos: number; } + +export interface NzTreeNodeBaseComponent { + setClassMap(): void; + markForCheck(): void; +} diff --git a/components/tree/nz-tree-base.service.ts b/components/core/tree/nz-tree-base.service.ts similarity index 98% rename from components/tree/nz-tree-base.service.ts rename to components/core/tree/nz-tree-base.service.ts index c2e2eea94c9..854b462f8c9 100644 --- a/components/tree/nz-tree-base.service.ts +++ b/components/core/tree/nz-tree-base.service.ts @@ -1,9 +1,11 @@ import { Injectable, OnDestroy } from '@angular/core'; import { Observable, Subject } from 'rxjs'; -import { isNotNil } from '../core/util/check'; -import { NzFormatEmitEvent } from './interface'; -import { NzTreeNode } from './nz-tree-node'; -import { isCheckDisabled, isInArray } from './nz-tree-util'; + +import { isNotNil } from '../util'; + +import { NzTreeNode } from './nz-tree-base-node'; +import { isCheckDisabled, isInArray } from './nz-tree-base-util'; +import { NzFormatEmitEvent } from './nz-tree-base.definitions'; @Injectable() export class NzTreeBaseService implements OnDestroy { diff --git a/components/core/tree/nz-tree-service.resolver.ts b/components/core/tree/nz-tree-service.resolver.ts new file mode 100644 index 00000000000..be65407d4e1 --- /dev/null +++ b/components/core/tree/nz-tree-service.resolver.ts @@ -0,0 +1,5 @@ +import { InjectionToken } from '@angular/core'; + +import { NzTreeBaseService } from './nz-tree-base.service'; + +export const NzTreeHigherOrderServiceToken = new InjectionToken('NzTreeHigherOrder'); diff --git a/components/core/tree/public-api.ts b/components/core/tree/public-api.ts new file mode 100644 index 00000000000..8dee94e3ab8 --- /dev/null +++ b/components/core/tree/public-api.ts @@ -0,0 +1,4 @@ +export * from './nz-tree-base-node'; +export * from './nz-tree-base.definitions'; +export * from './nz-tree-base.service'; +export * from './nz-tree-service.resolver'; diff --git a/components/core/types/index.ts b/components/core/types/index.ts new file mode 100644 index 00000000000..7e1a213e3ea --- /dev/null +++ b/components/core/types/index.ts @@ -0,0 +1 @@ +export * from './public-api'; diff --git a/components/core/types/public-api.ts b/components/core/types/public-api.ts new file mode 100644 index 00000000000..9a01832e7ef --- /dev/null +++ b/components/core/types/public-api.ts @@ -0,0 +1,6 @@ +export * from './common-wrap'; +export * from './direction'; +export * from './drop-down-position'; +export * from './indexable'; +export * from './ng-class'; +export * from './size'; diff --git a/components/core/util/logger/index.ts b/components/core/util/logger/index.ts deleted file mode 100644 index a354094041d..00000000000 --- a/components/core/util/logger/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { LoggerModule } from './logger.module'; -export { LoggerService, NZ_LOGGER_STATE } from './logger.service'; diff --git a/components/core/util/public-api.ts b/components/core/util/public-api.ts index 505099c70e3..c5dfe3d5643 100644 --- a/components/core/util/public-api.ts +++ b/components/core/util/public-api.ts @@ -1,7 +1,12 @@ +export * from './array'; export * from './check'; export * from './convert'; +export * from './dom'; export * from './getMentions'; export * from './string'; +export * from './is-promise'; +export * from './number'; +export * from './scroll-into-view-if-needed'; export * from './textarea-caret-position'; export * from './throttleByAnimationFrame'; export * from './time'; diff --git a/components/date-picker/abstract-picker.component.ts b/components/date-picker/abstract-picker.component.ts index 2cb87f20e96..5331e00b82c 100644 --- a/components/date-picker/abstract-picker.component.ts +++ b/components/date-picker/abstract-picker.component.ts @@ -10,15 +10,13 @@ import { ViewChild } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; - import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { InputBoolean } from '../core/util/convert'; -import { DateHelperService } from '../i18n/date-helper.service'; -import { NzDatePickerI18nInterface } from '../i18n/nz-i18n.interface'; -import { NzI18nService } from '../i18n/nz-i18n.service'; -import { CandyDate } from './lib/candy-date'; + +import { InputBoolean, NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { DateHelperService, NzDatePickerI18nInterface, NzI18nService } from 'ng-zorro-antd/i18n'; + +import { CandyDate } from './lib/candy-date/candy-date'; import { NzPickerComponent } from './picker.component'; const POPUP_STYLE_PATCH = { position: 'relative' }; // Aim to override antd's style to support overlay's position strategy (position:absolute will cause it not working beacuse the overlay can't get the height/width of it's content) diff --git a/components/date-picker/date-picker.component.spec.ts b/components/date-picker/date-picker.component.spec.ts index a7c25550c51..4cc79f21c7c 100644 --- a/components/date-picker/date-picker.component.spec.ts +++ b/components/date-picker/date-picker.component.spec.ts @@ -9,11 +9,10 @@ import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import isSameDay from 'date-fns/is_same_day'; -import { dispatchKeyboardEvent, dispatchMouseEvent } from '../core/testing'; -import { NGStyleInterface } from '../core/types/ng-class'; +import { dispatchKeyboardEvent, dispatchMouseEvent, NGStyleInterface } from 'ng-zorro-antd/core'; import en_US from '../i18n/languages/en_US'; -import { NzI18nModule } from '../i18n/nz-i18n.module'; -import { NzI18nService } from '../i18n/nz-i18n.service'; + +import { NzI18nModule, NzI18nService } from 'ng-zorro-antd/i18n'; import { NzDatePickerModule } from './date-picker.module'; registerLocaleData(zh); diff --git a/components/date-picker/date-picker.component.ts b/components/date-picker/date-picker.component.ts index a3708cb01ff..64f566101ea 100644 --- a/components/date-picker/date-picker.component.ts +++ b/components/date-picker/date-picker.component.ts @@ -11,9 +11,8 @@ import { } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { DateHelperService } from '../i18n/date-helper.service'; -import { NzI18nService } from '../i18n/nz-i18n.service'; +import { NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { DateHelperService, NzI18nService } from 'ng-zorro-antd/i18n'; import { DateRangePickerComponent } from './date-range-picker.component'; diff --git a/components/date-picker/date-picker.module.ts b/components/date-picker/date-picker.module.ts index 8a2d2db2718..9d69ead3536 100644 --- a/components/date-picker/date-picker.module.ts +++ b/components/date-picker/date-picker.module.ts @@ -2,9 +2,8 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; -import { NzOverlayModule } from '../core/overlay/nz-overlay.module'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzNoAnimationModule, NzOverlayModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { LibPackerModule } from './lib/lib-packer.module'; diff --git a/components/date-picker/date-range-picker.component.ts b/components/date-picker/date-range-picker.component.ts index 78fd6764be9..1ebb4cf9f23 100644 --- a/components/date-picker/date-range-picker.component.ts +++ b/components/date-picker/date-range-picker.component.ts @@ -10,14 +10,11 @@ import { TemplateRef } from '@angular/core'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { FunctionProp } from '../core/types/common-wrap'; -import { toBoolean, valueFunctionProp, InputBoolean } from '../core/util/convert'; -import { NzI18nService } from '../i18n/nz-i18n.service'; -import { CandyDate } from './lib/candy-date'; +import { toBoolean, valueFunctionProp, FunctionProp, InputBoolean, NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { DateHelperService, NzI18nService } from 'ng-zorro-antd/i18n'; -import { DateHelperService } from '../i18n/date-helper.service'; import { AbstractPickerComponent, CompatibleDate } from './abstract-picker.component'; +import { CandyDate } from './lib/candy-date/candy-date'; import { DisabledTimeFn, PanelMode, PresetRanges } from './standard-types'; @Component({ diff --git a/components/date-picker/doc/index.en-US.md b/components/date-picker/doc/index.en-US.md index 844c1d17200..5e687c36ec3 100644 --- a/components/date-picker/doc/index.en-US.md +++ b/components/date-picker/doc/index.en-US.md @@ -30,6 +30,14 @@ There are four kinds of picker: **Note:** All input and output date objects are [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), you can manpulate it with [date-fns](https://date-fns.org/). +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzDatePickerModule } from 'ng-zorro-antd'; +``` + ### Common API The following APIs are shared by nz-date-picker, nz-month-picker, nz-range-picker, nz-week-picker. diff --git a/components/date-picker/doc/index.zh-CN.md b/components/date-picker/doc/index.zh-CN.md index 317f0901e04..710bd52d377 100644 --- a/components/date-picker/doc/index.zh-CN.md +++ b/components/date-picker/doc/index.zh-CN.md @@ -30,6 +30,14 @@ registerLocaleData(zh); **注意:** 所有输入输出日期对象均为 [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date),你可以通过 [date-fns](https://date-fns.org/) 工具库获得你需要的数据。 +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzDatePickerModule } from 'ng-zorro-antd'; +``` + ### 共同的 API 以下 API 为 nz-date-picker、nz-month-picker、nz-range-picker, nz-week-picker 共享的 API。 diff --git a/components/date-picker/header-picker.component.ts b/components/date-picker/header-picker.component.ts index 030d53770a3..dc7ce7b1f16 100644 --- a/components/date-picker/header-picker.component.ts +++ b/components/date-picker/header-picker.component.ts @@ -1,12 +1,10 @@ import { ChangeDetectorRef, Component, Input, OnChanges, OnInit, SimpleChanges, TemplateRef } from '@angular/core'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { FunctionProp } from '../core/types/common-wrap'; -import { valueFunctionProp } from '../core/util/convert'; -import { DateHelperService } from '../i18n/date-helper.service'; -import { NzI18nService } from '../i18n/nz-i18n.service'; +import { valueFunctionProp, FunctionProp, NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { DateHelperService, NzI18nService } from 'ng-zorro-antd/i18n'; + import { AbstractPickerComponent } from './abstract-picker.component'; -import { CandyDate } from './lib/candy-date'; +import { CandyDate } from './lib/candy-date/candy-date'; import { PanelMode } from './standard-types'; /** diff --git a/components/date-picker/lib/calendar/calendar-footer.component.ts b/components/date-picker/lib/calendar/calendar-footer.component.ts index fa4cfead1d1..048763f229a 100644 --- a/components/date-picker/lib/calendar/calendar-footer.component.ts +++ b/components/date-picker/lib/calendar/calendar-footer.component.ts @@ -8,9 +8,9 @@ import { ViewEncapsulation } from '@angular/core'; -import { isNonEmptyString, isTemplateRef } from '../../../core/util/check'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; -import { CandyDate } from '../candy-date'; +import { isNonEmptyString, isTemplateRef } from 'ng-zorro-antd/core'; +import { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n'; +import { CandyDate } from '../candy-date/candy-date'; @Component({ encapsulation: ViewEncapsulation.None, diff --git a/components/date-picker/lib/calendar/calendar-header.component.ts b/components/date-picker/lib/calendar/calendar-header.component.ts index 3e380a5093a..69828ef675a 100644 --- a/components/date-picker/lib/calendar/calendar-header.component.ts +++ b/components/date-picker/lib/calendar/calendar-header.component.ts @@ -10,10 +10,10 @@ import { ViewEncapsulation } from '@angular/core'; -import { DateHelperByDatePipe, DateHelperService } from '../../../i18n/date-helper.service'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; +import { DateHelperByDatePipe, DateHelperService, NzCalendarI18nInterface } from 'ng-zorro-antd/i18n'; + import { PanelMode } from '../../standard-types'; -import { CandyDate } from '../candy-date'; +import { CandyDate } from '../candy-date/candy-date'; @Component({ encapsulation: ViewEncapsulation.None, diff --git a/components/date-picker/lib/calendar/calendar-input.component.ts b/components/date-picker/lib/calendar/calendar-input.component.ts index a5d7e32b583..768a64999cd 100644 --- a/components/date-picker/lib/calendar/calendar-input.component.ts +++ b/components/date-picker/lib/calendar/calendar-input.component.ts @@ -8,9 +8,9 @@ import { ViewEncapsulation } from '@angular/core'; -import { DateHelperService } from '../../../i18n/date-helper.service'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; -import { CandyDate } from '../candy-date'; +import { DateHelperService } from 'ng-zorro-antd/i18n'; +import { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n'; +import { CandyDate } from '../candy-date/candy-date'; @Component({ encapsulation: ViewEncapsulation.None, diff --git a/components/date-picker/lib/calendar/ok-button.component.ts b/components/date-picker/lib/calendar/ok-button.component.ts index c9e919af00f..9c7127ecac5 100644 --- a/components/date-picker/lib/calendar/ok-button.component.ts +++ b/components/date-picker/lib/calendar/ok-button.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; +import { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n'; @Component({ encapsulation: ViewEncapsulation.None, diff --git a/components/date-picker/lib/calendar/time-picker-button.component.ts b/components/date-picker/lib/calendar/time-picker-button.component.ts index dfd76354900..7879575f5b2 100644 --- a/components/date-picker/lib/calendar/time-picker-button.component.ts +++ b/components/date-picker/lib/calendar/time-picker-button.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; +import { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n'; @Component({ encapsulation: ViewEncapsulation.None, diff --git a/components/date-picker/lib/calendar/today-button.component.ts b/components/date-picker/lib/calendar/today-button.component.ts index b76c65f080b..38502f52ea2 100644 --- a/components/date-picker/lib/calendar/today-button.component.ts +++ b/components/date-picker/lib/calendar/today-button.component.ts @@ -10,9 +10,9 @@ import { ViewEncapsulation } from '@angular/core'; -import { DateHelperByDatePipe, DateHelperService } from '../../../i18n/date-helper.service'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; -import { CandyDate } from '../candy-date'; +import { DateHelperByDatePipe, DateHelperService } from 'ng-zorro-antd/i18n'; +import { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n'; +import { CandyDate } from '../candy-date/candy-date'; @Component({ encapsulation: ViewEncapsulation.None, diff --git a/components/date-picker/lib/candy-date/candy-date.ts b/components/date-picker/lib/candy-date/candy-date.ts index 1f14a0ab36e..c9df4411bd1 100644 --- a/components/date-picker/lib/candy-date/candy-date.ts +++ b/components/date-picker/lib/candy-date/candy-date.ts @@ -3,7 +3,7 @@ import addYears from 'date-fns/add_years'; import endOfMonth from 'date-fns/end_of_month'; import setDay from 'date-fns/set_day'; import setMonth from 'date-fns/set_month'; -import { IndexableObject } from '../../../core/types/indexable'; +import { IndexableObject } from 'ng-zorro-antd/core'; /** * Wrapping kind APIs for date operating and unify diff --git a/components/date-picker/lib/candy-date/index.ts b/components/date-picker/lib/candy-date/index.ts deleted file mode 100644 index 6ee45b65a5c..00000000000 --- a/components/date-picker/lib/candy-date/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './candy-date'; diff --git a/components/date-picker/lib/date/date-table.component.ts b/components/date-picker/lib/date/date-table.component.ts index ac638c7bd30..f2a9f8c8a58 100644 --- a/components/date-picker/lib/date/date-table.component.ts +++ b/components/date-picker/lib/date/date-table.component.ts @@ -12,13 +12,9 @@ import { ViewEncapsulation } from '@angular/core'; -import { FunctionProp } from '../../../core/types/common-wrap'; -import { isNonEmptyString, isTemplateRef } from '../../../core/util/check'; -import { valueFunctionProp } from '../../../core/util/convert'; -import { DateHelperByDatePipe, DateHelperService } from '../../../i18n/date-helper.service'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; -import { NzI18nService } from '../../../i18n/nz-i18n.service'; -import { CandyDate } from '../candy-date'; +import { isNonEmptyString, isTemplateRef, valueFunctionProp, FunctionProp } from 'ng-zorro-antd/core'; +import { DateHelperByDatePipe, DateHelperService, NzCalendarI18nInterface, NzI18nService } from 'ng-zorro-antd/i18n'; +import { CandyDate } from '../candy-date/candy-date'; const DATE_ROW_NUM = 6; const DATE_COL_NUM = 7; diff --git a/components/date-picker/lib/decade/decade-panel.component.ts b/components/date-picker/lib/decade/decade-panel.component.ts index 4571c72b377..3dd31223ce4 100644 --- a/components/date-picker/lib/decade/decade-panel.component.ts +++ b/components/date-picker/lib/decade/decade-panel.component.ts @@ -9,8 +9,8 @@ import { ViewEncapsulation } from '@angular/core'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; -import { CandyDate } from '../candy-date'; +import { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n'; +import { CandyDate } from '../candy-date/candy-date'; const MAX_ROW = 4; const MAX_COL = 3; diff --git a/components/date-picker/lib/lib-packer-supplements.spec.ts b/components/date-picker/lib/lib-packer-supplements.spec.ts index 0270435cfa1..b5bdb603c9d 100644 --- a/components/date-picker/lib/lib-packer-supplements.spec.ts +++ b/components/date-picker/lib/lib-packer-supplements.spec.ts @@ -8,7 +8,7 @@ import { NzI18nService } from '../../i18n/nz-i18n.service'; import { AbstractPickerComponent } from '../abstract-picker.component'; import { CalendarHeaderComponent } from './calendar/calendar-header.component'; import { TodayButtonComponent } from './calendar/today-button.component'; -import { CandyDate } from './candy-date'; +import { CandyDate } from './candy-date/candy-date'; import { DateTableComponent } from './date/date-table.component'; import { LibPackerModule } from './lib-packer.module'; import { MonthTableComponent } from './month/month-table.component'; diff --git a/components/date-picker/lib/lib-packer.module.ts b/components/date-picker/lib/lib-packer.module.ts index 1ee74ae3911..a61c9fd3b9e 100644 --- a/components/date-picker/lib/lib-packer.module.ts +++ b/components/date-picker/lib/lib-packer.module.ts @@ -6,8 +6,8 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzI18nModule } from '../../i18n/nz-i18n.module'; -import { NzTimePickerModule } from '../../time-picker/nz-time-picker.module'; +import { NzI18nModule } from 'ng-zorro-antd/i18n'; +import { NzTimePickerModule } from 'ng-zorro-antd/time-picker'; import { CalendarFooterComponent } from './calendar/calendar-footer.component'; import { CalendarHeaderComponent } from './calendar/calendar-header.component'; diff --git a/components/date-picker/lib/month/month-panel.component.ts b/components/date-picker/lib/month/month-panel.component.ts index 65d0d8345b1..a4a1f3fccfc 100644 --- a/components/date-picker/lib/month/month-panel.component.ts +++ b/components/date-picker/lib/month/month-panel.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; -import { CandyDate } from '../candy-date'; +import { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n'; +import { CandyDate } from '../candy-date/candy-date'; @Component({ encapsulation: ViewEncapsulation.None, diff --git a/components/date-picker/lib/month/month-table.component.ts b/components/date-picker/lib/month/month-table.component.ts index d6f3f884d0f..0c1ed661360 100644 --- a/components/date-picker/lib/month/month-table.component.ts +++ b/components/date-picker/lib/month/month-table.component.ts @@ -10,8 +10,8 @@ import { ViewEncapsulation } from '@angular/core'; -import { DateHelperService } from '../../../i18n/date-helper.service'; -import { CandyDate } from '../candy-date'; +import { DateHelperService } from 'ng-zorro-antd/i18n'; +import { CandyDate } from '../candy-date/candy-date'; const MAX_ROW = 4; const MAX_COL = 3; diff --git a/components/date-picker/lib/popups/date-range-popup.component.ts b/components/date-picker/lib/popups/date-range-popup.component.ts index 8556f7fb703..d3f5625f869 100644 --- a/components/date-picker/lib/popups/date-range-popup.component.ts +++ b/components/date-picker/lib/popups/date-range-popup.component.ts @@ -11,8 +11,8 @@ import { ViewEncapsulation } from '@angular/core'; -import { FunctionProp } from '../../../core/types/common-wrap'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; +import { FunctionProp } from 'ng-zorro-antd/core'; +import { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n'; import { DisabledDateFn, DisabledTimeConfig, @@ -22,7 +22,7 @@ import { PresetRanges, SupportTimeOptions } from '../../standard-types'; -import { CandyDate } from '../candy-date'; +import { CandyDate } from '../candy-date/candy-date'; import { getTimeConfig, isAllowedDate } from '../util'; @Component({ diff --git a/components/date-picker/lib/popups/inner-popup.component.ts b/components/date-picker/lib/popups/inner-popup.component.ts index 623ec5ab791..46a7f70624e 100644 --- a/components/date-picker/lib/popups/inner-popup.component.ts +++ b/components/date-picker/lib/popups/inner-popup.component.ts @@ -11,10 +11,10 @@ import { ViewEncapsulation } from '@angular/core'; -import { FunctionProp } from '../../../core/types/common-wrap'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; +import { FunctionProp } from 'ng-zorro-antd/core'; +import { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n'; import { DisabledDateFn, PanelMode } from '../../standard-types'; -import { CandyDate } from '../candy-date'; +import { CandyDate } from '../candy-date/candy-date'; @Component({ encapsulation: ViewEncapsulation.None, diff --git a/components/date-picker/lib/util.spec.ts b/components/date-picker/lib/util.spec.ts index 02fae575bf6..2b9ae465f00 100644 --- a/components/date-picker/lib/util.spec.ts +++ b/components/date-picker/lib/util.spec.ts @@ -1,4 +1,4 @@ -import { CandyDate } from './candy-date'; +import { CandyDate } from './candy-date/candy-date'; import { isAllowedDate } from './util'; describe('util.ts coverage supplements', () => { diff --git a/components/date-picker/lib/util.ts b/components/date-picker/lib/util.ts index 7ba1c6c6f8c..2f0cb0101c0 100644 --- a/components/date-picker/lib/util.ts +++ b/components/date-picker/lib/util.ts @@ -1,5 +1,5 @@ import { DisabledDateFn, DisabledTimeConfig, DisabledTimeFn } from '../standard-types'; -import { CandyDate } from './candy-date'; +import { CandyDate } from './candy-date/candy-date'; const defaultDisabledTime: DisabledTimeConfig = { nzDisabledHours(): number[] { diff --git a/components/date-picker/lib/year/year-panel.component.ts b/components/date-picker/lib/year/year-panel.component.ts index e014c90a9df..7af4e4faef7 100644 --- a/components/date-picker/lib/year/year-panel.component.ts +++ b/components/date-picker/lib/year/year-panel.component.ts @@ -9,8 +9,9 @@ import { ViewEncapsulation } from '@angular/core'; -import { NzCalendarI18nInterface } from '../../../i18n/nz-i18n.interface'; -import { CandyDate } from '../candy-date'; +import { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n'; + +import { CandyDate } from '../candy-date/candy-date'; const MAX_ROW = 4; const MAX_COL = 3; diff --git a/components/date-picker/month-picker.component.spec.ts b/components/date-picker/month-picker.component.spec.ts index e6256d12917..524fc11e3c0 100644 --- a/components/date-picker/month-picker.component.spec.ts +++ b/components/date-picker/month-picker.component.spec.ts @@ -6,11 +6,11 @@ import { fakeAsync, flush, inject, tick, ComponentFixture, TestBed } from '@angu import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; - import isBefore from 'date-fns/is_before'; -import { dispatchMouseEvent } from '../core/testing'; -import { NGStyleInterface } from '../core/types/ng-class'; -import { NzInputModule } from '../input/nz-input.module'; + +import { dispatchMouseEvent, NGStyleInterface } from 'ng-zorro-antd/core'; +import { NzInputModule } from 'ng-zorro-antd/input'; + import { NzDatePickerModule } from './date-picker.module'; registerLocaleData(zh); diff --git a/components/date-picker/month-picker.component.ts b/components/date-picker/month-picker.component.ts index caaa109211b..f62988ff235 100644 --- a/components/date-picker/month-picker.component.ts +++ b/components/date-picker/month-picker.component.ts @@ -12,10 +12,9 @@ import { } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { NzI18nService } from '../i18n/nz-i18n.service'; +import { NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { DateHelperService, NzI18nService } from 'ng-zorro-antd/i18n'; -import { DateHelperService } from '../i18n/date-helper.service'; import { HeaderPickerComponent, SupportHeaderPanel } from './header-picker.component'; @Component({ diff --git a/components/date-picker/package.json b/components/date-picker/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/date-picker/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/date-picker/picker.component.ts b/components/date-picker/picker.component.ts index ec51a49aa9a..d0b7dfd96be 100644 --- a/components/date-picker/picker.component.ts +++ b/components/date-picker/picker.component.ts @@ -18,9 +18,10 @@ import { ViewEncapsulation } from '@angular/core'; -import { slideMotion } from '../core/animation/slide'; -import { DateHelperService } from '../i18n/date-helper.service'; -import { CandyDate } from './lib/candy-date'; +import { slideMotion } from 'ng-zorro-antd/core'; +import { DateHelperService } from 'ng-zorro-antd/i18n'; + +import { CandyDate } from './lib/candy-date/candy-date'; @Component({ encapsulation: ViewEncapsulation.None, diff --git a/components/date-picker/public-api.ts b/components/date-picker/public-api.ts index b2172ccb67a..67d2c308771 100644 --- a/components/date-picker/public-api.ts +++ b/components/date-picker/public-api.ts @@ -1,4 +1,4 @@ -export { CandyDate } from './lib/candy-date'; +export { CandyDate } from './lib/candy-date/candy-date'; export { PickerResult, PickerResultSingle, PickerResultRange, PresetRanges, PanelMode } from './standard-types'; export { NzDatePickerModule } from './date-picker.module'; diff --git a/components/date-picker/range-picker.component.spec.ts b/components/date-picker/range-picker.component.spec.ts index 29ae3d2e136..5d802228d1b 100644 --- a/components/date-picker/range-picker.component.spec.ts +++ b/components/date-picker/range-picker.component.spec.ts @@ -9,10 +9,10 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import differenceInDays from 'date-fns/difference_in_days'; import isSameDay from 'date-fns/is_same_day'; -import { dispatchMouseEvent } from '../core/testing'; -import { NGStyleInterface } from '../core/types/ng-class'; +import { dispatchMouseEvent, NGStyleInterface } from 'ng-zorro-antd/core'; + import { NzDatePickerModule } from './date-picker.module'; -import { CandyDate } from './lib/candy-date'; +import { CandyDate } from './lib/candy-date/candy-date'; registerLocaleData(zh); diff --git a/components/date-picker/range-picker.component.ts b/components/date-picker/range-picker.component.ts index e5d89371b5d..3e52e8d4852 100644 --- a/components/date-picker/range-picker.component.ts +++ b/components/date-picker/range-picker.component.ts @@ -11,10 +11,9 @@ import { } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { NzI18nService } from '../i18n/nz-i18n.service'; +import { NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { DateHelperService, NzI18nService } from 'ng-zorro-antd/i18n'; -import { DateHelperService } from '../i18n/date-helper.service'; import { DateRangePickerComponent } from './date-range-picker.component'; @Component({ diff --git a/components/date-picker/standard-types.ts b/components/date-picker/standard-types.ts index 9b2e0d7e811..de14fe47c93 100644 --- a/components/date-picker/standard-types.ts +++ b/components/date-picker/standard-types.ts @@ -1,6 +1,6 @@ import { TemplateRef } from '@angular/core'; -import { CandyDate } from './lib/candy-date'; +import { CandyDate } from './lib/candy-date/candy-date'; // The common result data format (the range-picker's props can be result as array) export interface PickerResultSingle { diff --git a/components/date-picker/style/entry.less b/components/date-picker/style/entry.less new file mode 100644 index 00000000000..f1e0d591676 --- /dev/null +++ b/components/date-picker/style/entry.less @@ -0,0 +1,6 @@ +@import './index.less'; +// style dependencies +// deps-lint-skip: input +@import '../../input/style/index.less'; +@import '../../time-picker/style/index.less'; +@import '../../tag/style/index.less'; diff --git a/components/date-picker/week-picker.component.spec.ts b/components/date-picker/week-picker.component.spec.ts index 2602fb17a82..d3019437c03 100644 --- a/components/date-picker/week-picker.component.spec.ts +++ b/components/date-picker/week-picker.component.spec.ts @@ -4,7 +4,7 @@ import { fakeAsync, inject, tick, ComponentFixture, TestBed } from '@angular/cor import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { dispatchMouseEvent } from '../core/testing'; +import { dispatchMouseEvent } from 'ng-zorro-antd/core'; import { NzDatePickerModule } from './date-picker.module'; describe('NzWeekPickerComponent', () => { diff --git a/components/date-picker/week-picker.component.ts b/components/date-picker/week-picker.component.ts index b1958337e33..2f2fb8f8031 100644 --- a/components/date-picker/week-picker.component.ts +++ b/components/date-picker/week-picker.component.ts @@ -11,10 +11,9 @@ import { } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { NzI18nService } from '../i18n/nz-i18n.service'; +import { NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { DateHelperService, NzI18nService } from 'ng-zorro-antd/i18n'; -import { DateHelperService } from '../i18n/date-helper.service'; import { DateRangePickerComponent } from './date-range-picker.component'; @Component({ diff --git a/components/date-picker/year-picker.component.spec.ts b/components/date-picker/year-picker.component.spec.ts index 18545546b7b..3dbf7cea34d 100644 --- a/components/date-picker/year-picker.component.spec.ts +++ b/components/date-picker/year-picker.component.spec.ts @@ -5,9 +5,9 @@ import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { dispatchMouseEvent } from '../core/testing'; -import { NGStyleInterface } from '../core/types/ng-class'; -import { NzInputModule } from '../input/nz-input.module'; +import { dispatchMouseEvent, NGStyleInterface } from 'ng-zorro-antd/core'; +import { NzInputModule } from 'ng-zorro-antd/input'; + import { NzDatePickerModule } from './date-picker.module'; describe('NzYearPickerComponent', () => { diff --git a/components/date-picker/year-picker.component.ts b/components/date-picker/year-picker.component.ts index 9502e0fe0bd..b60eb0418cd 100644 --- a/components/date-picker/year-picker.component.ts +++ b/components/date-picker/year-picker.component.ts @@ -12,10 +12,9 @@ import { } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { NzI18nService } from '../i18n/nz-i18n.service'; +import { NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { DateHelperService, NzI18nService } from 'ng-zorro-antd/i18n'; -import { DateHelperService } from '../i18n/date-helper.service'; import { HeaderPickerComponent, SupportHeaderPanel } from './header-picker.component'; @Component({ diff --git a/components/divider/doc/index.en-US.md b/components/divider/doc/index.en-US.md index 6cbf33b5ad9..f2ee8684691 100644 --- a/components/divider/doc/index.en-US.md +++ b/components/divider/doc/index.en-US.md @@ -13,7 +13,13 @@ A divider line separates different content. ## API -### Divider +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzDividerModule } from 'ng-zorro-antd'; +``` ### nz-divider diff --git a/components/divider/doc/index.zh-CN.md b/components/divider/doc/index.zh-CN.md index 4ad36dc855e..4d03ee416cd 100644 --- a/components/divider/doc/index.zh-CN.md +++ b/components/divider/doc/index.zh-CN.md @@ -14,6 +14,14 @@ subtitle: 分割线 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzDividerModule } from 'ng-zorro-antd'; +``` + ### nz-divider | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/divider/nz-divider.component.ts b/components/divider/nz-divider.component.ts index 182ab4c54e5..3626c66920f 100644 --- a/components/divider/nz-divider.component.ts +++ b/components/divider/nz-divider.component.ts @@ -9,8 +9,7 @@ import { ViewEncapsulation } from '@angular/core'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { InputBoolean } from '../core/util'; +import { InputBoolean, NzUpdateHostClassService } from 'ng-zorro-antd/core'; @Component({ selector: 'nz-divider', diff --git a/components/divider/nz-divider.module.ts b/components/divider/nz-divider.module.ts index 4464a9af825..38274b555b7 100644 --- a/components/divider/nz-divider.module.ts +++ b/components/divider/nz-divider.module.ts @@ -1,6 +1,6 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; import { NzDividerComponent } from './nz-divider.component'; @NgModule({ diff --git a/components/divider/package.json b/components/divider/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/divider/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/divider/style/entry.less b/components/divider/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/divider/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/drawer/doc/index.en-US.md b/components/drawer/doc/index.en-US.md index 822656cf93e..1332db79426 100755 --- a/components/drawer/doc/index.en-US.md +++ b/components/drawer/doc/index.en-US.md @@ -15,6 +15,14 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzDrawerModule } from 'ng-zorro-antd'; +``` + ### nz-drawer | Props | Description | Type | Default | diff --git a/components/drawer/doc/index.zh-CN.md b/components/drawer/doc/index.zh-CN.md index 338b1cbd839..38a88829cf5 100755 --- a/components/drawer/doc/index.zh-CN.md +++ b/components/drawer/doc/index.zh-CN.md @@ -16,6 +16,14 @@ title: Drawer ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzDrawerModule } from 'ng-zorro-antd'; +``` + ### nz-drawer | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/drawer/nz-drawer.component.ts b/components/drawer/nz-drawer.component.ts index c383e47d440..3f4f91874bc 100644 --- a/components/drawer/nz-drawer.component.ts +++ b/components/drawer/nz-drawer.component.ts @@ -27,7 +27,7 @@ import { CdkPortalOutlet, ComponentPortal, PortalInjector, TemplatePortal } from import { Observable, Subject } from 'rxjs'; -import { toCssPixel, InputBoolean } from '../core/util/convert'; +import { toCssPixel, InputBoolean } from 'ng-zorro-antd/core'; import { NzDrawerOptions, NzDrawerPlacement } from './nz-drawer-options'; import { NzDrawerRef } from './nz-drawer-ref'; diff --git a/components/drawer/nz-drawer.module.ts b/components/drawer/nz-drawer.module.ts index 844ab0082df..922bc129845 100644 --- a/components/drawer/nz-drawer.module.ts +++ b/components/drawer/nz-drawer.module.ts @@ -2,10 +2,9 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { PortalModule } from '@angular/cdk/portal'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzIconModule } from '../icon/nz-icon.module'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; +import { NzAddOnModule, NzNoAnimationModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzDrawerComponent } from './nz-drawer.component'; import { NzDrawerService } from './nz-drawer.service'; diff --git a/components/drawer/package.json b/components/drawer/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/drawer/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/drawer/style/entry.less b/components/drawer/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/drawer/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/dropdown/doc/index.en-US.md b/components/dropdown/doc/index.en-US.md index c47d1639217..bb930a56485 100755 --- a/components/dropdown/doc/index.en-US.md +++ b/components/dropdown/doc/index.en-US.md @@ -12,6 +12,14 @@ If there are too many operations to display, you can wrap them in a `Dropdown`. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzDropDownModule } from 'ng-zorro-antd'; +``` + ### nz-dropdown > You should add `[nz-dropdown]` to the element that trigger dropdown diff --git a/components/dropdown/doc/index.zh-CN.md b/components/dropdown/doc/index.zh-CN.md index 6b90222090a..5e73b7cbcb5 100755 --- a/components/dropdown/doc/index.zh-CN.md +++ b/components/dropdown/doc/index.zh-CN.md @@ -13,6 +13,13 @@ title: Dropdown ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzDropDownModule } from 'ng-zorro-antd'; +``` ### nz-dropdown diff --git a/components/dropdown/nz-dropdown-button.component.ts b/components/dropdown/nz-dropdown-button.component.ts index 381af5485fb..edc433b9dd6 100644 --- a/components/dropdown/nz-dropdown-button.component.ts +++ b/components/dropdown/nz-dropdown-button.component.ts @@ -5,18 +5,20 @@ import { Component, EventEmitter, Host, + Injector, Input, OnChanges, OnDestroy, Optional, Output, + Self, ViewChild, ViewEncapsulation } from '@angular/core'; -import { slideMotion } from '../core/animation/slide'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { NzDropDownComponent } from './nz-dropdown.component'; +import { slideMotion, NzDropdownHigherOrderServiceToken, NzNoAnimationDirective } from 'ng-zorro-antd/core'; + +import { menuServiceFactory, NzDropDownComponent } from './nz-dropdown.component'; import { NzDropDownDirective } from './nz-dropdown.directive'; import { NzMenuDropdownService } from './nz-menu-dropdown.service'; @@ -26,7 +28,14 @@ import { NzMenuDropdownService } from './nz-menu-dropdown.service'; animations: [slideMotion], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, - providers: [NzMenuDropdownService], + providers: [ + NzMenuDropdownService, + { + provide: NzDropdownHigherOrderServiceToken, + useFactory: menuServiceFactory, + deps: [[new Self(), Injector]] + } + ], templateUrl: './nz-dropdown-button.component.html', styles: [ ` diff --git a/components/dropdown/nz-dropdown-context.component.ts b/components/dropdown/nz-dropdown-context.component.ts index 938516c8c7e..8090bbfe1d4 100644 --- a/components/dropdown/nz-dropdown-context.component.ts +++ b/components/dropdown/nz-dropdown-context.component.ts @@ -9,7 +9,9 @@ import { } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { slideMotion } from '../core/animation/slide'; + +import { slideMotion } from 'ng-zorro-antd/core'; + import { NzDropdownService } from './nz-dropdown.service'; import { NzMenuDropdownService } from './nz-menu-dropdown.service'; diff --git a/components/dropdown/nz-dropdown.component.ts b/components/dropdown/nz-dropdown.component.ts index 4c1e3276835..af8e3c77640 100644 --- a/components/dropdown/nz-dropdown.component.ts +++ b/components/dropdown/nz-dropdown.component.ts @@ -7,31 +7,52 @@ import { ContentChild, EventEmitter, Host, + Injector, Input, OnChanges, OnDestroy, Optional, Output, + Self, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core'; + import { combineLatest, merge, EMPTY, Observable, Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged, map, mapTo, takeUntil } from 'rxjs/operators'; -import { slideMotion } from '../core/animation/slide'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { DEFAULT_DROPDOWN_POSITIONS, POSITION_MAP } from '../core/overlay/overlay-position'; -import { InputBoolean } from '../core/util/convert'; -import { NzMenuDirective } from '../menu/nz-menu.directive'; + +import { + slideMotion, + DEFAULT_DROPDOWN_POSITIONS, + InputBoolean, + NzDropdownHigherOrderServiceToken, + NzMenuBaseService, + NzNoAnimationDirective, + POSITION_MAP +} from 'ng-zorro-antd/core'; +import { NzMenuDirective } from 'ng-zorro-antd/menu'; + import { NzDropDownDirective } from './nz-dropdown.directive'; import { NzMenuDropdownService } from './nz-menu-dropdown.service'; export type NzPlacement = 'bottomLeft' | 'bottomCenter' | 'bottomRight' | 'topLeft' | 'topCenter' | 'topRight'; +export function menuServiceFactory(injector: Injector): NzMenuBaseService { + return injector.get(NzMenuDropdownService); +} + @Component({ selector: 'nz-dropdown', preserveWhitespaces: false, - providers: [NzMenuDropdownService], + providers: [ + NzMenuDropdownService, + { + provide: NzDropdownHigherOrderServiceToken, + useFactory: menuServiceFactory, + deps: [[new Self(), Injector]] + } + ], animations: [slideMotion], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/components/dropdown/nz-dropdown.module.ts b/components/dropdown/nz-dropdown.module.ts index f50ac6a4d24..d8bced91d20 100644 --- a/components/dropdown/nz-dropdown.module.ts +++ b/components/dropdown/nz-dropdown.module.ts @@ -3,12 +3,11 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; +import { NzButtonModule } from 'ng-zorro-antd/button'; +import { NzNoAnimationModule, NzOverlayModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzMenuModule } from 'ng-zorro-antd/menu'; -import { NzButtonModule } from '../button/nz-button.module'; -import { NzOverlayModule } from '../core/overlay/nz-overlay.module'; -import { NzIconModule } from '../icon/nz-icon.module'; -import { NzMenuModule } from '../menu/nz-menu.module'; import { NzDropDownADirective } from './nz-dropdown-a.directive'; import { NzDropDownButtonComponent } from './nz-dropdown-button.component'; import { NzDropdownContextComponent } from './nz-dropdown-context.component'; diff --git a/components/dropdown/nz-dropdown.spec.ts b/components/dropdown/nz-dropdown.spec.ts index 251479aeb64..6459ba27796 100644 --- a/components/dropdown/nz-dropdown.spec.ts +++ b/components/dropdown/nz-dropdown.spec.ts @@ -7,7 +7,7 @@ import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Subject } from 'rxjs'; -import { createMouseEvent, dispatchFakeEvent } from '../core/testing'; +import { createMouseEvent, dispatchFakeEvent } from 'ng-zorro-antd/core'; import { NzIconTestModule } from '../icon/nz-icon-test.module'; import { NzMenuModule } from '../menu/nz-menu.module'; import { NzSubMenuComponent } from '../menu/nz-submenu.component'; diff --git a/components/dropdown/nz-menu-dropdown.service.ts b/components/dropdown/nz-menu-dropdown.service.ts index 97395dddbac..83710e3a279 100644 --- a/components/dropdown/nz-menu-dropdown.service.ts +++ b/components/dropdown/nz-menu-dropdown.service.ts @@ -1,7 +1,8 @@ import { Injectable } from '@angular/core'; -import { NzMenuService } from '../menu/nz-menu.service'; + +import { NzMenuBaseService } from 'ng-zorro-antd/core'; @Injectable() -export class NzMenuDropdownService extends NzMenuService { +export class NzMenuDropdownService extends NzMenuBaseService { isInDropDown = true; } diff --git a/components/dropdown/package.json b/components/dropdown/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/dropdown/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/dropdown/public-api.ts b/components/dropdown/public-api.ts index 60a3b14f0ce..6c74e745e1d 100644 --- a/components/dropdown/public-api.ts +++ b/components/dropdown/public-api.ts @@ -4,3 +4,5 @@ export * from './nz-dropdown.directive'; export * from './nz-dropdown.service'; export * from './nz-dropdown-button.component'; export * from './nz-dropdown.module'; +export * from './nz-menu-dropdown.service'; +export * from './nz-dropdown-a.directive'; diff --git a/components/dropdown/style/entry.less b/components/dropdown/style/entry.less new file mode 100644 index 00000000000..8d6c97e9eb9 --- /dev/null +++ b/components/dropdown/style/entry.less @@ -0,0 +1,3 @@ +@import './index.less'; +// style dependencies +@import '../../button/style/index.less'; diff --git a/components/empty/doc/index.en-US.md b/components/empty/doc/index.en-US.md index 4bc3febadd6..56a3e1d72fc 100644 --- a/components/empty/doc/index.en-US.md +++ b/components/empty/doc/index.en-US.md @@ -13,6 +13,14 @@ When there is no data provided, display for friendly tips. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzEmptyModule } from 'ng-zorro-antd'; +``` + ### nz-empty | Property | Description | Type | Default | diff --git a/components/empty/doc/index.zh-CN.md b/components/empty/doc/index.zh-CN.md index 6e3085f3c76..d023b05fe90 100644 --- a/components/empty/doc/index.zh-CN.md +++ b/components/empty/doc/index.zh-CN.md @@ -14,6 +14,14 @@ cols: 1 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzEmptyModule } from 'ng-zorro-antd'; +``` + ### nz-empty | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/empty/nz-empty.component.ts b/components/empty/nz-empty.component.ts index 37bf52ca09e..79a7d66b871 100644 --- a/components/empty/nz-empty.component.ts +++ b/components/empty/nz-empty.component.ts @@ -13,7 +13,8 @@ import { import { DomSanitizer } from '@angular/platform-browser'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { NzI18nService } from '../i18n/nz-i18n.service'; + +import { NzI18nService } from 'ng-zorro-antd/i18n'; import { emptyImage } from './nz-empty-config'; diff --git a/components/empty/nz-empty.module.ts b/components/empty/nz-empty.module.ts index fa05eee8113..662024e8ab8 100644 --- a/components/empty/nz-empty.module.ts +++ b/components/empty/nz-empty.module.ts @@ -1,8 +1,10 @@ import { PortalModule } from '@angular/cdk/portal'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzI18nModule } from '../i18n/nz-i18n.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; + +import { NzI18nModule } from 'ng-zorro-antd/i18n'; + import { NzEmbedEmptyComponent } from './nz-embed-empty.component'; import { NzEmptyComponent } from './nz-empty.component'; diff --git a/components/empty/package.json b/components/empty/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/empty/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/empty/style/entry.less b/components/empty/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/empty/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/form/doc/index.en-US.md b/components/form/doc/index.en-US.md index f86dd42fabf..e82ef50f2f2 100644 --- a/components/form/doc/index.en-US.md +++ b/components/form/doc/index.en-US.md @@ -45,6 +45,14 @@ A form consists of one or more form fields whose type includes input, textarea, ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzFormModule } from 'ng-zorro-antd'; +``` + ### nz-form diff --git a/components/form/doc/index.zh-CN.md b/components/form/doc/index.zh-CN.md index e7ed40fee26..8098e1d16e6 100644 --- a/components/form/doc/index.zh-CN.md +++ b/components/form/doc/index.zh-CN.md @@ -44,6 +44,14 @@ title: Form ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzFormModule } from 'ng-zorro-antd'; +``` + ### nz-form | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/form/nz-form-control.component.ts b/components/form/nz-form-control.component.ts index 5987e733268..47f5c77e714 100644 --- a/components/form/nz-form-control.component.ts +++ b/components/form/nz-form-control.component.ts @@ -17,11 +17,10 @@ import { import { FormControl, FormControlName, NgControl } from '@angular/forms'; import { Subscription } from 'rxjs'; import { startWith } from 'rxjs/operators'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { NgClassType } from '../core/types/ng-class'; -import { toBoolean } from '../core/util/convert'; -import { NzColDirective } from '../grid/nz-col.directive'; -import { NzRowDirective } from '../grid/nz-row.directive'; + +import { toBoolean, NgClassType, NzUpdateHostClassService } from 'ng-zorro-antd/core'; +import { NzColDirective, NzRowDirective } from 'ng-zorro-antd/grid'; + import { NzFormItemComponent } from './nz-form-item.component'; @Component({ diff --git a/components/form/nz-form-explain.component.ts b/components/form/nz-form-explain.component.ts index fe65352cb00..cbd0bc8d9b2 100644 --- a/components/form/nz-form-explain.component.ts +++ b/components/form/nz-form-explain.component.ts @@ -1,5 +1,5 @@ import { ChangeDetectionStrategy, Component, ElementRef, Renderer2, ViewEncapsulation } from '@angular/core'; -import { helpMotion } from '../core/animation/help'; +import { helpMotion } from 'ng-zorro-antd/core'; @Component({ selector: 'nz-form-explain', diff --git a/components/form/nz-form-item.component.ts b/components/form/nz-form-item.component.ts index 80294cce2dc..a7c24ea7c58 100644 --- a/components/form/nz-form-item.component.ts +++ b/components/form/nz-form-item.component.ts @@ -15,9 +15,10 @@ import { ViewEncapsulation } from '@angular/core'; import { takeUntil } from 'rxjs/operators'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { toBoolean } from '../core/util/convert'; -import { NzRowDirective } from '../grid/nz-row.directive'; + +import { toBoolean, NzUpdateHostClassService } from 'ng-zorro-antd/core'; +import { NzRowDirective } from 'ng-zorro-antd/grid'; + import { NzFormExplainComponent } from './nz-form-explain.component'; /** should add nz-row directive to host, track https://github.com/angular/angular/issues/8785 **/ diff --git a/components/form/nz-form-label.component.ts b/components/form/nz-form-label.component.ts index f5e4d7d24f6..992c57a9201 100644 --- a/components/form/nz-form-label.component.ts +++ b/components/form/nz-form-label.component.ts @@ -10,10 +10,10 @@ import { Renderer2, ViewEncapsulation } from '@angular/core'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { InputBoolean } from '../core/util/convert'; -import { NzColDirective } from '../grid/nz-col.directive'; -import { NzRowDirective } from '../grid/nz-row.directive'; + +import { InputBoolean, NzUpdateHostClassService } from 'ng-zorro-antd/core'; +import { NzColDirective, NzRowDirective } from 'ng-zorro-antd/grid'; + import { NzFormItemComponent } from './nz-form-item.component'; @Component({ diff --git a/components/form/nz-form.directive.ts b/components/form/nz-form.directive.ts index d09a924b9eb..9603aac545e 100644 --- a/components/form/nz-form.directive.ts +++ b/components/form/nz-form.directive.ts @@ -1,5 +1,5 @@ import { Directive, ElementRef, Input, OnChanges, OnInit, Renderer2 } from '@angular/core'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; +import { NzUpdateHostClassService } from 'ng-zorro-antd/core'; @Directive({ selector: '[nz-form]', diff --git a/components/form/nz-form.module.ts b/components/form/nz-form.module.ts index 8720fdc6471..b060e576190 100644 --- a/components/form/nz-form.module.ts +++ b/components/form/nz-form.module.ts @@ -1,10 +1,11 @@ +import { LayoutModule } from '@angular/cdk/layout'; +import { PlatformModule } from '@angular/cdk/platform'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { LayoutModule } from '@angular/cdk/layout'; -import { PlatformModule } from '@angular/cdk/platform'; -import { NzGridModule } from '../grid/nz-grid.module'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzGridModule } from 'ng-zorro-antd/grid'; +import { NzIconModule } from 'ng-zorro-antd/icon'; + import { NzFormControlComponent } from './nz-form-control.component'; import { NzFormExplainComponent } from './nz-form-explain.component'; import { NzFormExtraComponent } from './nz-form-extra.component'; diff --git a/components/form/package.json b/components/form/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/form/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/form/style/entry.less b/components/form/style/entry.less new file mode 100644 index 00000000000..116a9e08e68 --- /dev/null +++ b/components/form/style/entry.less @@ -0,0 +1,3 @@ +@import './index.less'; +// style dependencies +@import '../../grid/style/index.less'; diff --git a/components/grid/doc/index.en-US.md b/components/grid/doc/index.en-US.md index b76b6a0a9ab..5e3a57135e5 100755 --- a/components/grid/doc/index.en-US.md +++ b/components/grid/doc/index.en-US.md @@ -81,6 +81,14 @@ Flex layout uses a 24 grid layout to define the width of each "box", but does no ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzGridModule } from 'ng-zorro-antd'; +``` + ### [nz-row] | Property | Description | Type | Default | diff --git a/components/grid/doc/index.zh-CN.md b/components/grid/doc/index.zh-CN.md index 2882b0d1797..a0a2270476a 100755 --- a/components/grid/doc/index.zh-CN.md +++ b/components/grid/doc/index.zh-CN.md @@ -80,6 +80,14 @@ Flex 布局是基于 24 栅格来定义每一个『盒子』的宽度,但排 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzGridModule } from 'ng-zorro-antd'; +``` + ### [nz-row] | 成员 | 说明 | 类型 | 默认值 | diff --git a/components/grid/nz-col.directive.ts b/components/grid/nz-col.directive.ts index a85fd08aa39..d1fb3e9a257 100644 --- a/components/grid/nz-col.directive.ts +++ b/components/grid/nz-col.directive.ts @@ -13,9 +13,7 @@ import { import { Subject } from 'rxjs'; import { startWith, takeUntil } from 'rxjs/operators'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { NgClassInterface } from '../core/types/ng-class'; -import { isNotNil } from '../core/util/check'; +import { isNotNil, NgClassInterface, NzUpdateHostClassService } from 'ng-zorro-antd/core'; import { NzRowDirective } from './nz-row.directive'; diff --git a/components/grid/nz-row.directive.ts b/components/grid/nz-row.directive.ts index da8f3a1392e..aee58a55be5 100644 --- a/components/grid/nz-row.directive.ts +++ b/components/grid/nz-row.directive.ts @@ -15,8 +15,8 @@ import { MediaMatcher } from '@angular/cdk/layout'; import { Platform } from '@angular/cdk/platform'; import { fromEvent, Subject } from 'rxjs'; import { auditTime, takeUntil } from 'rxjs/operators'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { IndexableObject } from '../core/types/indexable'; + +import { IndexableObject, NzUpdateHostClassService } from 'ng-zorro-antd/core'; export type NzJustify = 'start' | 'end' | 'center' | 'space-around' | 'space-between'; export type NzAlign = 'top' | 'middle' | 'bottom'; diff --git a/components/grid/package.json b/components/grid/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/grid/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/grid/style/entry.less b/components/grid/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/grid/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/i18n/date-config.ts b/components/i18n/date-config.ts index 36dee32ef09..aaac9167211 100644 --- a/components/i18n/date-config.ts +++ b/components/i18n/date-config.ts @@ -10,8 +10,6 @@ export function mergeDateConfig(config: NzDateConfig): NzDateConfig { return { ...NZ_DATE_CONFIG_DEFAULT, ...config }; } -//////////// - export interface NzDateConfig { /** Customize the first day of a week */ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6; diff --git a/components/i18n/nz-i18n.module.ts b/components/i18n/nz-i18n.module.ts index 3484256fa46..a2b62bbdf38 100644 --- a/components/i18n/nz-i18n.module.ts +++ b/components/i18n/nz-i18n.module.ts @@ -1,7 +1,7 @@ import { DatePipe } from '@angular/common'; import { NgModule } from '@angular/core'; -import { LoggerModule } from '../core/util/logger/logger.module'; +import { LoggerModule } from 'ng-zorro-antd/core'; import { NzI18nPipe } from './nz-i18n.pipe'; import { NZ_DATE_LOCALE, NZ_I18N } from './nz-i18n.token'; diff --git a/components/i18n/nz-i18n.service.ts b/components/i18n/nz-i18n.service.ts index 2f2c795b669..6981bb8bec2 100644 --- a/components/i18n/nz-i18n.service.ts +++ b/components/i18n/nz-i18n.service.ts @@ -1,6 +1,7 @@ import { Inject, Injectable } from '@angular/core'; import { BehaviorSubject, Observable } from 'rxjs'; -import { IndexableObject } from '../core/types/indexable'; + +import { IndexableObject } from 'ng-zorro-antd/core'; import zh_CN from './languages/zh_CN'; import { DateLocale, NzI18nInterface } from './nz-i18n.interface'; diff --git a/components/i18n/package.json b/components/i18n/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/i18n/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/i18n/public-api.ts b/components/i18n/public-api.ts index e7f0fcc885e..e9b108fc809 100644 --- a/components/i18n/public-api.ts +++ b/components/i18n/public-api.ts @@ -1,10 +1,10 @@ export { NzI18nModule } from './nz-i18n.module'; export { NzI18nService } from './nz-i18n.service'; export { NZ_DATE_CONFIG, NzDateConfig } from './date-config'; -export { DateHelperService } from './date-helper.service'; - export * from './nz-i18n.interface'; export * from './nz-i18n.token'; +export * from './date-helper.service'; +export * from './nz-i18n.pipe'; export { default as ar_EG } from './languages/ar_EG'; export { default as bg_BG } from './languages/bg_BG'; diff --git a/components/icon/doc/index.en-US.md b/components/icon/doc/index.en-US.md index a4972d156d9..a27459d3c91 100755 --- a/components/icon/doc/index.en-US.md +++ b/components/icon/doc/index.en-US.md @@ -20,6 +20,14 @@ We are still adding two-tone icons right now, syncing to [antd](https://ant.desi ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzIconModule } from 'ng-zorro-antd'; +``` + ### [nz-icon] | Property | Description | Type | Default | diff --git a/components/icon/doc/index.zh-CN.md b/components/icon/doc/index.zh-CN.md index 8250cb540aa..64da1d24429 100755 --- a/components/icon/doc/index.zh-CN.md +++ b/components/icon/doc/index.zh-CN.md @@ -21,6 +21,14 @@ hasPageDemo: true ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzIconModule } from 'ng-zorro-antd'; +``` + ### [nz-icon] | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/icon/nz-icon.directive.ts b/components/icon/nz-icon.directive.ts index a9400a07fc2..b02d8e724b6 100644 --- a/components/icon/nz-icon.directive.ts +++ b/components/icon/nz-icon.directive.ts @@ -10,7 +10,7 @@ import { SimpleChanges } from '@angular/core'; import { IconDirective, ThemeType } from '@ant-design/icons-angular'; -import { InputBoolean } from '../core/util'; +import { InputBoolean } from 'ng-zorro-antd/core'; import { NzIconService } from './nz-icon.service'; const iconTypeRE = /^anticon\-\w/; diff --git a/components/icon/package.json b/components/icon/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/icon/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/icon/page/index.ts b/components/icon/page/index.ts index b882782d1fc..dfec56b01f1 100644 --- a/components/icon/page/index.ts +++ b/components/icon/page/index.ts @@ -2,7 +2,8 @@ import { DOCUMENT } from '@angular/common'; import { Component, Inject, OnInit } from '@angular/core'; import { manifest } from '@ant-design/icons-angular'; import { AccountBookFill } from '@ant-design/icons-angular/icons'; -import { NzIconService } from 'ng-zorro-antd'; + +import { NzIconService } from 'ng-zorro-antd/icon'; const categories: { [key: string]: string[] } = { direction: [ diff --git a/components/icon/style/entry.less b/components/icon/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/icon/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/icon/style/index.less b/components/icon/style/index.less new file mode 100644 index 00000000000..373c41968cd --- /dev/null +++ b/components/icon/style/index.less @@ -0,0 +1,4 @@ +@import '../../style/themes/default'; +@import '../../style/mixins/index'; + +@icon-prefix-cls: ~'@{ant-prefix}-icon'; diff --git a/components/input-number/doc/index.en-US.md b/components/input-number/doc/index.en-US.md index 62b223304a0..2fbd2509ba2 100755 --- a/components/input-number/doc/index.en-US.md +++ b/components/input-number/doc/index.en-US.md @@ -14,6 +14,14 @@ When a numeric value needs to be provided. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzInputNumberModule } from 'ng-zorro-antd'; +``` + ### nz-input-number | property | description | type | default | diff --git a/components/input-number/doc/index.zh-CN.md b/components/input-number/doc/index.zh-CN.md index 75db9372f1f..31fe0cca777 100755 --- a/components/input-number/doc/index.zh-CN.md +++ b/components/input-number/doc/index.zh-CN.md @@ -17,6 +17,14 @@ title: InputNumber 属性如下 +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzInputNumberModule } from 'ng-zorro-antd'; +``` + ### nz-input-number | 成员 | 说明 | 类型 | 默认值 | diff --git a/components/input-number/nz-input-number.component.ts b/components/input-number/nz-input-number.component.ts index 8d2e761c86a..e49072a190d 100644 --- a/components/input-number/nz-input-number.component.ts +++ b/components/input-number/nz-input-number.component.ts @@ -19,10 +19,8 @@ import { ViewEncapsulation } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { NzSizeLDSType } from '../core/types/size'; -import { isNotNil } from '../core/util/check'; -import { InputBoolean } from '../core/util/convert'; +import { isNotNil, InputBoolean, NzSizeLDSType } from 'ng-zorro-antd/core'; @Component({ selector: 'nz-input-number', diff --git a/components/input-number/nz-input-number.module.ts b/components/input-number/nz-input-number.module.ts index 216e5b656b2..cc0af3866fd 100644 --- a/components/input-number/nz-input-number.module.ts +++ b/components/input-number/nz-input-number.module.ts @@ -1,7 +1,8 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzIconModule } from '../icon/nz-icon.module'; + +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzInputNumberComponent } from './nz-input-number.component'; diff --git a/components/input-number/nz-input-number.spec.ts b/components/input-number/nz-input-number.spec.ts index a4eb5668c5f..9a0abb6640c 100644 --- a/components/input-number/nz-input-number.spec.ts +++ b/components/input-number/nz-input-number.spec.ts @@ -3,7 +3,7 @@ import { fakeAsync, flush, tick, ComponentFixture, TestBed } from '@angular/core import { FormsModule, FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { dispatchEvent, dispatchFakeEvent } from '../core/testing'; +import { dispatchEvent, dispatchFakeEvent } from 'ng-zorro-antd/core'; import { NzInputNumberComponent } from './nz-input-number.component'; import { NzInputNumberModule } from './nz-input-number.module'; diff --git a/components/input-number/package.json b/components/input-number/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/input-number/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/input-number/style/entry.less b/components/input-number/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/input-number/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/input/doc/index.en-US.md b/components/input/doc/index.en-US.md index 8e1d6d7c42c..e3bdd11bae8 100755 --- a/components/input/doc/index.en-US.md +++ b/components/input/doc/index.en-US.md @@ -14,6 +14,14 @@ Keyboard and mouse can be used for providing or changing data. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzInputModule } from 'ng-zorro-antd'; +``` + ### [nz-input] All props of input supported by [w3c standards](https://www.w3schools.com/tags/tag_input.asp) and Angular can used in `nz-input`. diff --git a/components/input/doc/index.zh-CN.md b/components/input/doc/index.zh-CN.md index 45a9c407c09..5f700fca547 100755 --- a/components/input/doc/index.zh-CN.md +++ b/components/input/doc/index.zh-CN.md @@ -14,6 +14,14 @@ title: Input ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzInputModule } from 'ng-zorro-antd'; +``` + ### [nz-input] nz-input 可以使用所有的W3C标准下的所有 [使用方式](https://www.w3schools.com/tags/tag_input.asp) 和 Angular对 input 的全部额外功能支持。 diff --git a/components/input/nz-autosize.spec.ts b/components/input/nz-autosize.spec.ts index dfea91ed308..01cd07e37a8 100644 --- a/components/input/nz-autosize.spec.ts +++ b/components/input/nz-autosize.spec.ts @@ -2,7 +2,7 @@ import { Component, ViewEncapsulation } from '@angular/core'; import { async, fakeAsync, flush, tick, ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { dispatchFakeEvent } from '../core/testing'; +import { dispatchFakeEvent } from 'ng-zorro-antd/core'; import { NzAutosizeDirective } from './nz-autosize.directive'; import { NzInputModule } from './nz-input.module'; diff --git a/components/input/nz-input-group.component.ts b/components/input/nz-input-group.component.ts index c07fae71152..47e557cd8ec 100644 --- a/components/input/nz-input-group.component.ts +++ b/components/input/nz-input-group.component.ts @@ -8,9 +8,7 @@ import { TemplateRef, ViewEncapsulation } from '@angular/core'; -import { NgClassType } from '../core/types/ng-class'; -import { NzSizeLDSType } from '../core/types/size'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean, NgClassType, NzSizeLDSType } from 'ng-zorro-antd/core'; import { NzInputDirective } from './nz-input.directive'; @Component({ diff --git a/components/input/nz-input.directive.ts b/components/input/nz-input.directive.ts index 27bc1dc1522..07f63132ed1 100644 --- a/components/input/nz-input.directive.ts +++ b/components/input/nz-input.directive.ts @@ -1,7 +1,6 @@ import { Directive, ElementRef, Input, Optional, Renderer2, Self } from '@angular/core'; import { NgControl } from '@angular/forms'; -import { NzSizeLDSType } from '../core/types/size'; -import { toBoolean } from '../core/util/convert'; +import { toBoolean, NzSizeLDSType } from 'ng-zorro-antd/core'; @Directive({ selector: '[nz-input]', diff --git a/components/input/nz-input.module.ts b/components/input/nz-input.module.ts index fd5a8bb4a7d..269973739ac 100644 --- a/components/input/nz-input.module.ts +++ b/components/input/nz-input.module.ts @@ -1,9 +1,9 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzAddOnModule } from '../core/addon/addon.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { PlatformModule } from '@angular/cdk/platform'; import { NzAutosizeDirective } from './nz-autosize.directive'; diff --git a/components/input/package.json b/components/input/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/input/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/input/public-api.ts b/components/input/public-api.ts index 48d3cefc594..8d9299bf82f 100644 --- a/components/input/public-api.ts +++ b/components/input/public-api.ts @@ -2,3 +2,4 @@ export * from './nz-input-group.component'; export * from './nz-input.module'; export * from './nz-input-group.component'; export * from './nz-input.directive'; +export * from './nz-autosize.directive'; diff --git a/components/input/style/entry.less b/components/input/style/entry.less new file mode 100644 index 00000000000..8d6c97e9eb9 --- /dev/null +++ b/components/input/style/entry.less @@ -0,0 +1,3 @@ +@import './index.less'; +// style dependencies +@import '../../button/style/index.less'; diff --git a/components/layout/doc/index.en-US.md b/components/layout/doc/index.en-US.md index 23dc560d73c..b6a38b5956b 100755 --- a/components/layout/doc/index.en-US.md +++ b/components/layout/doc/index.en-US.md @@ -69,6 +69,14 @@ The first level navigation is inclined left near a logo, and the secondary menu ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzLayoutModule } from 'ng-zorro-antd'; +``` + ### nz-sider The sidebar. diff --git a/components/layout/doc/index.zh-CN.md b/components/layout/doc/index.zh-CN.md index 47983a5b27b..615df093986 100755 --- a/components/layout/doc/index.zh-CN.md +++ b/components/layout/doc/index.zh-CN.md @@ -70,6 +70,14 @@ title: Layout ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzLayoutModule } from 'ng-zorro-antd'; +``` + ### nz-sider 侧边栏。 diff --git a/components/layout/nz-layout.module.ts b/components/layout/nz-layout.module.ts index 2b00dcc2a70..f64e9eff17d 100644 --- a/components/layout/nz-layout.module.ts +++ b/components/layout/nz-layout.module.ts @@ -2,7 +2,8 @@ import { LayoutModule } from '@angular/cdk/layout'; import { PlatformModule } from '@angular/cdk/platform'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzIconModule } from '../icon/nz-icon.module'; + +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzContentComponent } from './nz-content.component'; import { NzFooterComponent } from './nz-footer.component'; diff --git a/components/layout/nz-sider.component.ts b/components/layout/nz-sider.component.ts index 7f4f06b88ba..9c7529d4e6f 100644 --- a/components/layout/nz-sider.component.ts +++ b/components/layout/nz-sider.component.ts @@ -22,7 +22,9 @@ import { MediaMatcher } from '@angular/cdk/layout'; import { Platform } from '@angular/cdk/platform'; import { fromEvent, Subject } from 'rxjs'; import { auditTime, takeUntil } from 'rxjs/operators'; -import { InputBoolean } from '../core/util/convert'; + +import { InputBoolean } from 'ng-zorro-antd/core'; + import { NzLayoutComponent } from './nz-layout.component'; export type NzBreakPoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; diff --git a/components/layout/package.json b/components/layout/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/layout/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/layout/style/entry.less b/components/layout/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/layout/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/list/doc/index.en-US.md b/components/list/doc/index.en-US.md index b0e693710dd..1ebe26657f1 100644 --- a/components/list/doc/index.en-US.md +++ b/components/list/doc/index.en-US.md @@ -13,6 +13,14 @@ A list can be used to display content related to a single subject. The content c ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzListModule } from 'ng-zorro-antd'; +``` + ### nz-list | Property | Description | Type | Default diff --git a/components/list/doc/index.zh-CN.md b/components/list/doc/index.zh-CN.md index 5c38b962a8d..34968614412 100644 --- a/components/list/doc/index.zh-CN.md +++ b/components/list/doc/index.zh-CN.md @@ -14,6 +14,14 @@ cols: 1 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzListModule } from 'ng-zorro-antd'; +``` + ### nz-list | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/list/nz-list.component.ts b/components/list/nz-list.component.ts index 848cb41dc48..7bc593443f0 100644 --- a/components/list/nz-list.component.ts +++ b/components/list/nz-list.component.ts @@ -9,9 +9,7 @@ import { ViewEncapsulation } from '@angular/core'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { NzSizeLDSType } from '../core/types/size'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean, NzSizeLDSType, NzUpdateHostClassService } from 'ng-zorro-antd/core'; import { NzListGrid } from './interface'; diff --git a/components/list/nz-list.module.ts b/components/list/nz-list.module.ts index d81584191b1..f64ffc28524 100644 --- a/components/list/nz-list.module.ts +++ b/components/list/nz-list.module.ts @@ -1,11 +1,11 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAvatarModule } from '../avatar/nz-avatar.module'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzEmptyModule } from '../empty/nz-empty.module'; -import { NzGridModule } from '../grid/nz-grid.module'; -import { NzSpinModule } from '../spin/nz-spin.module'; +import { NzAvatarModule } from 'ng-zorro-antd/avatar'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; +import { NzEmptyModule } from 'ng-zorro-antd/empty'; +import { NzGridModule } from 'ng-zorro-antd/grid'; +import { NzSpinModule } from 'ng-zorro-antd/spin'; import { NzListItemMetaComponent } from './nz-list-item-meta.component'; import { NzListItemComponent } from './nz-list-item.component'; diff --git a/components/list/package.json b/components/list/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/list/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/list/style/entry.less b/components/list/style/entry.less new file mode 100644 index 00000000000..7b9c9a53bff --- /dev/null +++ b/components/list/style/entry.less @@ -0,0 +1,5 @@ +@import './index.less'; +@import '../../empty/style/index.less'; +@import '../../spin/style/index.less'; +@import '../../pagination/style/index.less'; +@import '../../grid/style/index.less'; diff --git a/components/mention/doc/index.en-US.md b/components/mention/doc/index.en-US.md index 37c7f440e14..02200197b9e 100644 --- a/components/mention/doc/index.en-US.md +++ b/components/mention/doc/index.en-US.md @@ -22,6 +22,14 @@ When need to mention someone or something. ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzMentionModule } from 'ng-zorro-antd'; +``` + ### nz-mention | Property | Description | Type | Default | diff --git a/components/mention/doc/index.zh-CN.md b/components/mention/doc/index.zh-CN.md index 4d8729d4c50..62984cfc37f 100644 --- a/components/mention/doc/index.zh-CN.md +++ b/components/mention/doc/index.zh-CN.md @@ -23,6 +23,14 @@ title: Mention ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzMentionModule } from 'ng-zorro-antd'; +``` + ### nz-mention | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/mention/nz-mention.component.ts b/components/mention/nz-mention.component.ts index c08294bdb09..b5dc004a502 100644 --- a/components/mention/nz-mention.component.ts +++ b/components/mention/nz-mention.component.ts @@ -30,10 +30,7 @@ import { } from '@angular/core'; import { fromEvent, merge, Subscription } from 'rxjs'; -import { DEFAULT_MENTION_POSITIONS } from '../core/overlay/overlay-position'; -import { InputBoolean } from '../core/util'; -import { getMentions } from '../core/util/getMentions'; -import { getCaretCoordinates } from '../core/util/textarea-caret-position'; +import { getCaretCoordinates, getMentions, DEFAULT_MENTION_POSITIONS, InputBoolean } from 'ng-zorro-antd/core'; import { NzMentionSuggestionDirective } from './nz-mention-suggestions'; import { NzMentionTriggerDirective } from './nz-mention-trigger'; diff --git a/components/mention/nz-mention.module.ts b/components/mention/nz-mention.module.ts index aee52e501f2..df71d286775 100644 --- a/components/mention/nz-mention.module.ts +++ b/components/mention/nz-mention.module.ts @@ -2,7 +2,7 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzMentionSuggestionDirective } from './nz-mention-suggestions'; import { NzMentionTriggerDirective } from './nz-mention-trigger'; import { NzMentionComponent } from './nz-mention.component'; diff --git a/components/mention/nz-mention.spec.ts b/components/mention/nz-mention.spec.ts index 53c20922322..1c5b1adc9a3 100644 --- a/components/mention/nz-mention.spec.ts +++ b/components/mention/nz-mention.spec.ts @@ -15,7 +15,7 @@ import { dispatchKeyboardEvent, typeInElement, MockNgZone -} from '../core/testing'; +} from 'ng-zorro-antd/core'; import { NzIconTestModule } from '../icon/nz-icon-test.module'; import { NzInputModule } from '../input'; diff --git a/components/mention/package.json b/components/mention/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/mention/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/mention/style/entry.less b/components/mention/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/mention/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/menu/doc/index.en-US.md b/components/menu/doc/index.en-US.md index 8c88e1da3f9..7b2448a0281 100755 --- a/components/menu/doc/index.en-US.md +++ b/components/menu/doc/index.en-US.md @@ -27,6 +27,14 @@ More layouts with navigation: [layout](/components/layout/en). ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzMenuModule } from 'ng-zorro-antd'; +``` + ### [nz-menu] | Param | Description | Type | Default value | diff --git a/components/menu/doc/index.zh-CN.md b/components/menu/doc/index.zh-CN.md index ae77e28a5ee..e558fb38ac6 100755 --- a/components/menu/doc/index.zh-CN.md +++ b/components/menu/doc/index.zh-CN.md @@ -28,6 +28,14 @@ subtitle: 导航菜单 ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzMenuModule } from 'ng-zorro-antd'; +``` + ### [nz-menu] | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/menu/nz-menu-item.directive.ts b/components/menu/nz-menu-item.directive.ts index a325639cb0d..f6c978c1d94 100644 --- a/components/menu/nz-menu-item.directive.ts +++ b/components/menu/nz-menu-item.directive.ts @@ -9,13 +9,12 @@ import { Renderer2, SimpleChanges } from '@angular/core'; + import { merge, EMPTY, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { isNotNil } from '../core/util'; -import { InputBoolean } from '../core/util/convert'; -import { NzMenuService } from './nz-menu.service'; +import { isNotNil, InputBoolean, NzMenuBaseService, NzUpdateHostClassService } from 'ng-zorro-antd/core'; + import { NzSubmenuService } from './nz-submenu.service'; @Directive({ @@ -64,7 +63,7 @@ export class NzMenuItemDirective implements OnInit, OnChanges, OnDestroy { constructor( private nzUpdateHostClassService: NzUpdateHostClassService, - private nzMenuService: NzMenuService, + private nzMenuService: NzMenuBaseService, @Optional() private nzSubmenuService: NzSubmenuService, private renderer: Renderer2, private elementRef: ElementRef diff --git a/components/menu/nz-menu-menu.service.ts b/components/menu/nz-menu-menu.service.ts deleted file mode 100644 index 42024d3bc0f..00000000000 --- a/components/menu/nz-menu-menu.service.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Injectable } from '@angular/core'; -import { NzMenuService } from './nz-menu.service'; - -@Injectable() -export class NzMenuMenuService extends NzMenuService { - isInDropDown = false; -} diff --git a/components/menu/nz-menu.directive.ts b/components/menu/nz-menu.directive.ts index 4cedadad1b7..410876e9221 100644 --- a/components/menu/nz-menu.directive.ts +++ b/components/menu/nz-menu.directive.ts @@ -14,30 +14,32 @@ import { SimpleChanges, SkipSelf } from '@angular/core'; + import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { NzDirectionVHIType } from '../core/types/direction'; -import { InputBoolean } from '../core/util/convert'; -import { NzMenuDropdownService } from '../dropdown/nz-menu-dropdown.service'; + +import { + InputBoolean, + NzDirectionVHIType, + NzDropdownHigherOrderServiceToken, + NzMenuBaseService, + NzUpdateHostClassService +} from 'ng-zorro-antd/core'; + import { NzMenuItemDirective } from './nz-menu-item.directive'; -import { NzMenuMenuService } from './nz-menu-menu.service'; +import { NzMenuServiceFactory } from './nz-menu.resolver'; import { NzMenuService } from './nz-menu.service'; import { NzSubMenuComponent } from './nz-submenu.component'; -export function NzMenuFactory(dropService: NzMenuDropdownService, menuService: NzMenuMenuService): NzMenuService { - return dropService ? dropService : menuService; -} - @Directive({ selector: '[nz-menu]', providers: [ NzUpdateHostClassService, - NzMenuMenuService, + NzMenuService, { - provide: NzMenuService, - useFactory: NzMenuFactory, - deps: [[new SkipSelf(), new Optional(), NzMenuDropdownService], NzMenuMenuService] + provide: NzMenuBaseService, + useFactory: NzMenuServiceFactory, + deps: [[new SkipSelf(), new Optional(), NzDropdownHigherOrderServiceToken], NzMenuService] } ] }) @@ -85,7 +87,7 @@ export class NzMenuDirective implements AfterContentInit, OnInit, OnChanges, OnD constructor( public elementRef: ElementRef, - private nzMenuService: NzMenuService, + private nzMenuService: NzMenuBaseService, private nzUpdateHostClassService: NzUpdateHostClassService ) {} diff --git a/components/menu/nz-menu.module.ts b/components/menu/nz-menu.module.ts index 363dad81965..8b170e309aa 100644 --- a/components/menu/nz-menu.module.ts +++ b/components/menu/nz-menu.module.ts @@ -3,15 +3,15 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; +import { NzButtonModule } from 'ng-zorro-antd/button'; +import { NzNoAnimationModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; -import { NzButtonModule } from '../button/nz-button.module'; -import { NzIconModule } from '../icon/nz-icon.module'; -import { NzMenuDividerDirective } from '../menu/nz-menu-divider.directive'; -import { NzMenuGroupComponent } from '../menu/nz-menu-group.component'; -import { NzMenuItemDirective } from '../menu/nz-menu-item.directive'; -import { NzMenuDirective } from '../menu/nz-menu.directive'; -import { NzSubMenuComponent } from '../menu/nz-submenu.component'; +import { NzMenuDividerDirective } from './nz-menu-divider.directive'; +import { NzMenuGroupComponent } from './nz-menu-group.component'; +import { NzMenuItemDirective } from './nz-menu-item.directive'; +import { NzMenuDirective } from './nz-menu.directive'; +import { NzSubMenuComponent } from './nz-submenu.component'; @NgModule({ imports: [CommonModule, FormsModule, NzButtonModule, OverlayModule, NzIconModule, NzNoAnimationModule], diff --git a/components/menu/nz-menu.resolver.ts b/components/menu/nz-menu.resolver.ts new file mode 100644 index 00000000000..a5438552cc1 --- /dev/null +++ b/components/menu/nz-menu.resolver.ts @@ -0,0 +1,10 @@ +import { NzMenuBaseService } from 'ng-zorro-antd/core'; + +import { NzMenuService } from './nz-menu.service'; + +export function NzMenuServiceFactory( + higherOrderService: NzMenuBaseService, + menuService: NzMenuService +): NzMenuBaseService { + return higherOrderService ? higherOrderService : menuService; +} diff --git a/components/menu/nz-menu.service.ts b/components/menu/nz-menu.service.ts index c5cd4ecae18..c6c17ad55bc 100644 --- a/components/menu/nz-menu.service.ts +++ b/components/menu/nz-menu.service.ts @@ -1,37 +1,8 @@ import { Injectable } from '@angular/core'; -import { merge, BehaviorSubject, Subject } from 'rxjs'; -import { NzDirectionVHIType } from '../core/types/direction'; -import { NzMenuItemDirective } from './nz-menu-item.directive'; -@Injectable() -export class NzMenuService { - isInDropDown: boolean; - menuItemClick$ = new Subject(); - theme$ = new Subject(); - mode$ = new BehaviorSubject('vertical'); - inlineIndent$ = new BehaviorSubject(24); - check$ = merge(this.theme$, this.mode$, this.inlineIndent$); - theme: 'light' | 'dark' = 'light'; - mode: NzDirectionVHIType = 'vertical'; - inlineIndent = 24; - menuOpen$ = new BehaviorSubject(false); - - onMenuItemClick(menu: NzMenuItemDirective): void { - this.menuItemClick$.next(menu); - } - - setMode(mode: NzDirectionVHIType): void { - this.mode = mode; - this.mode$.next(mode); - } +import { NzMenuBaseService } from 'ng-zorro-antd/core'; - setTheme(theme: 'light' | 'dark'): void { - this.theme = theme; - this.theme$.next(theme); - } - - setInlineIndent(indent: number): void { - this.inlineIndent = indent; - this.inlineIndent$.next(indent); - } +@Injectable() +export class NzMenuService extends NzMenuBaseService { + isInDropDown = false; } diff --git a/components/menu/nz-menu.spec.ts b/components/menu/nz-menu.spec.ts index 8c81697160d..dcaae62cbc8 100644 --- a/components/menu/nz-menu.spec.ts +++ b/components/menu/nz-menu.spec.ts @@ -15,7 +15,7 @@ import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Subject } from 'rxjs'; -import { dispatchFakeEvent } from '../core/testing'; +import { dispatchFakeEvent } from 'ng-zorro-antd/core'; import { NzIconTestModule } from '../icon/nz-icon-test.module'; import { NzDemoMenuHorizontalComponent } from './demo/horizontal'; diff --git a/components/menu/nz-submenu.component.ts b/components/menu/nz-submenu.component.ts index b37e2b24399..78b969de5d2 100644 --- a/components/menu/nz-submenu.component.ts +++ b/components/menu/nz-submenu.component.ts @@ -22,15 +22,21 @@ import { import { combineLatest, merge, Subject } from 'rxjs'; import { flatMap, map, startWith, takeUntil } from 'rxjs/operators'; -import { collapseMotion } from '../core/animation/collapse'; -import { slideMotion } from '../core/animation/slide'; -import { zoomBigMotion } from '../core/animation/zoom'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { getPlacementName, DEFAULT_SUBMENU_POSITIONS, POSITION_MAP } from '../core/overlay/overlay-position'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { InputBoolean } from '../core/util/convert'; + +import { + collapseMotion, + getPlacementName, + slideMotion, + zoomBigMotion, + DEFAULT_SUBMENU_POSITIONS, + InputBoolean, + NzMenuBaseService, + NzNoAnimationDirective, + NzUpdateHostClassService, + POSITION_MAP +} from 'ng-zorro-antd/core'; + import { NzMenuItemDirective } from './nz-menu-item.directive'; -import { NzMenuService } from './nz-menu.service'; import { NzSubmenuService } from './nz-submenu.service'; @Component({ @@ -124,7 +130,7 @@ export class NzSubMenuComponent implements OnInit, OnDestroy, AfterContentInit, constructor( private elementRef: ElementRef, - public nzMenuService: NzMenuService, + public nzMenuService: NzMenuBaseService, private cdr: ChangeDetectorRef, public nzSubmenuService: NzSubmenuService, private nzUpdateHostClassService: NzUpdateHostClassService, diff --git a/components/menu/nz-submenu.service.ts b/components/menu/nz-submenu.service.ts index 91c67ad276a..f305f50388d 100644 --- a/components/menu/nz-submenu.service.ts +++ b/components/menu/nz-submenu.service.ts @@ -1,7 +1,9 @@ import { Injectable, Optional, SkipSelf } from '@angular/core'; import { combineLatest, BehaviorSubject, Subject } from 'rxjs'; import { auditTime, distinctUntilChanged, map, tap } from 'rxjs/operators'; -import { NzDirectionVHIType } from '../core/types/direction'; + +import { NzDirectionVHIType } from 'ng-zorro-antd/core'; + import { NzMenuService } from './nz-menu.service'; @Injectable() diff --git a/components/menu/package.json b/components/menu/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/menu/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/menu/public-api.ts b/components/menu/public-api.ts index 85b4f0c8a9e..227f87fd632 100644 --- a/components/menu/public-api.ts +++ b/components/menu/public-api.ts @@ -4,3 +4,6 @@ export * from './nz-menu-divider.directive'; export * from './nz-menu-item.directive'; export * from './nz-submenu.component'; export * from './nz-menu.module'; +export * from './nz-menu.service'; +export * from './nz-submenu.service'; +export * from './nz-menu.resolver'; diff --git a/components/menu/style/entry.less b/components/menu/style/entry.less new file mode 100644 index 00000000000..e6293155214 --- /dev/null +++ b/components/menu/style/entry.less @@ -0,0 +1,4 @@ +@import './index.less'; +// style dependencies +// deps-lint-skip: layout +@import '../../tooltip/style/index.less'; diff --git a/components/message/doc/index.en-US.md b/components/message/doc/index.en-US.md index 73d86014cb8..e444fd22463 100644 --- a/components/message/doc/index.en-US.md +++ b/components/message/doc/index.en-US.md @@ -29,6 +29,14 @@ The default global configuration is: ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzMessageModule } from 'ng-zorro-antd'; +``` + ### NzMessageService This components provides some service methods, with usage and arguments as following: diff --git a/components/message/doc/index.zh-CN.md b/components/message/doc/index.zh-CN.md index c1122c49ef7..c6f93011436 100644 --- a/components/message/doc/index.zh-CN.md +++ b/components/message/doc/index.zh-CN.md @@ -30,6 +30,14 @@ title: Message ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzMessageModule } from 'ng-zorro-antd'; +``` + ### NzMessageService 组件提供了一些服务方法,使用方式和参数如下: diff --git a/components/message/nz-message-container.component.ts b/components/message/nz-message-container.component.ts index 11d9003dbec..2f4e6ec2514 100644 --- a/components/message/nz-message-container.component.ts +++ b/components/message/nz-message-container.component.ts @@ -8,7 +8,7 @@ import { } from '@angular/core'; import { Subject } from 'rxjs'; -import { toCssPixel } from '../core/util'; +import { toCssPixel } from 'ng-zorro-antd/core'; import { NzMessageConfig, NZ_MESSAGE_CONFIG, NZ_MESSAGE_DEFAULT_CONFIG } from './nz-message-config'; import { NzMessageDataFilled, NzMessageDataOptions } from './nz-message.definitions'; diff --git a/components/message/nz-message.component.ts b/components/message/nz-message.component.ts index 42cc03d4ab7..c560d32c081 100644 --- a/components/message/nz-message.component.ts +++ b/components/message/nz-message.component.ts @@ -7,7 +7,9 @@ import { OnInit, ViewEncapsulation } from '@angular/core'; -import { moveUpMotion } from '../core/animation/move'; + +import { moveUpMotion } from 'ng-zorro-antd/core'; + import { NzMessageContainerComponent } from './nz-message-container.component'; import { NzMessageDataFilled, NzMessageDataOptions } from './nz-message.definitions'; diff --git a/components/message/nz-message.module.ts b/components/message/nz-message.module.ts index cbaf4dc77f8..19de246f96b 100644 --- a/components/message/nz-message.module.ts +++ b/components/message/nz-message.module.ts @@ -1,8 +1,8 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NZ_MESSAGE_DEFAULT_CONFIG_PROVIDER } from './nz-message-config'; import { NzMessageContainerComponent } from './nz-message-container.component'; diff --git a/components/message/nz-message.spec.ts b/components/message/nz-message.spec.ts index 831de8dda70..41307964716 100644 --- a/components/message/nz-message.spec.ts +++ b/components/message/nz-message.spec.ts @@ -3,7 +3,7 @@ import { Component, TemplateRef, ViewChild } from '@angular/core'; import { fakeAsync, inject, tick, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { dispatchMouseEvent } from '../core/testing'; +import { dispatchMouseEvent } from 'ng-zorro-antd/core'; import { NZ_MESSAGE_CONFIG } from './nz-message-config'; import { NzMessageModule } from './nz-message.module'; diff --git a/components/message/package.json b/components/message/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/message/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/message/style/entry.less b/components/message/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/message/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/modal/doc/index.en-US.md b/components/modal/doc/index.en-US.md index 909afd5ad06..b5237d218d7 100644 --- a/components/modal/doc/index.en-US.md +++ b/components/modal/doc/index.en-US.md @@ -18,6 +18,14 @@ It is recommended to use the `Component` way to pop up the Modal, so that the co ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzModalModule } from 'ng-zorro-antd'; +``` + ### NzModalService The dialog is currently divided into 2 modes, `normal mode` and `confirm box mode` (ie the `Confirm` dialog, which is called by calling `confirm/info/success/error/warning`). The degree of API support for the two modes is slightly different. diff --git a/components/modal/doc/index.zh-CN.md b/components/modal/doc/index.zh-CN.md index d16cde4f425..1d776df0f8c 100644 --- a/components/modal/doc/index.zh-CN.md +++ b/components/modal/doc/index.zh-CN.md @@ -19,6 +19,14 @@ title: Modal ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzModalModule } from 'ng-zorro-antd'; +``` + ### NzModalService 对话框当前分为2种模式,`普通模式` 和 `确认框模式`(即`Confirm`对话框,通过调用`confirm/info/success/error/warning`弹出),两种模式对API的支持程度稍有不同。 diff --git a/components/modal/nz-modal.component.ts b/components/modal/nz-modal.component.ts index 6ec2a25805d..e7f9d20a8d9 100644 --- a/components/modal/nz-modal.component.ts +++ b/components/modal/nz-modal.component.ts @@ -29,9 +29,9 @@ import { import { fromEvent, Observable, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { InputBoolean } from '../core/util/convert'; -import { isPromise } from '../core/util/is-promise'; -import { NzI18nService } from '../i18n/nz-i18n.service'; +import { isPromise, InputBoolean } from 'ng-zorro-antd/core'; +import { NzI18nService } from 'ng-zorro-antd/i18n'; + import ModalUtil from './modal-util'; import { NzModalConfig, NZ_MODAL_CONFIG, NZ_MODAL_DEFAULT_CONFIG } from './nz-modal-config'; import { NzModalControlService } from './nz-modal-control.service'; diff --git a/components/modal/nz-modal.module.ts b/components/modal/nz-modal.module.ts index 8f0030edb0a..3524d8d612f 100644 --- a/components/modal/nz-modal.module.ts +++ b/components/modal/nz-modal.module.ts @@ -2,11 +2,10 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzButtonModule } from '../button/nz-button.module'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; -import { LoggerModule } from '../core/util/logger/logger.module'; -import { NzI18nModule } from '../i18n/nz-i18n.module'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzButtonModule } from 'ng-zorro-antd/button'; +import { LoggerModule, NzNoAnimationModule } from 'ng-zorro-antd/core'; +import { NzI18nModule } from 'ng-zorro-antd/i18n'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { CssUnitPipe } from './css-unit.pipe'; import { NzModalControlService } from './nz-modal-control.service'; diff --git a/components/modal/nz-modal.service.ts b/components/modal/nz-modal.service.ts index 3f3896fd90c..f649f552f5b 100644 --- a/components/modal/nz-modal.service.ts +++ b/components/modal/nz-modal.service.ts @@ -2,9 +2,8 @@ import { Overlay, OverlayRef } from '@angular/cdk/overlay'; import { ComponentPortal } from '@angular/cdk/portal'; import { ComponentRef, Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { IndexableObject } from '../core/types/indexable'; -import { LoggerService } from '../core/util/logger/logger.service'; +import { IndexableObject, LoggerService } from 'ng-zorro-antd/core'; import { NzModalControlService } from './nz-modal-control.service'; import { NzModalRef } from './nz-modal-ref.class'; diff --git a/components/modal/nz-modal.spec.ts b/components/modal/nz-modal.spec.ts index ffbb10e5707..6d34c9db489 100644 --- a/components/modal/nz-modal.spec.ts +++ b/components/modal/nz-modal.spec.ts @@ -1,21 +1,19 @@ /* TODO: Sort out and rewrite for more standardized */ +import { ESCAPE } from '@angular/cdk/keycodes'; +import { OverlayContainer } from '@angular/cdk/overlay'; import { Component, ElementRef, EventEmitter, Input } from '@angular/core'; import { async, fakeAsync, flush, inject, tick, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { OverlayContainer } from '@angular/cdk/overlay'; -import { NzButtonComponent } from '../button/nz-button.component'; -import { NzButtonModule } from '../button/nz-button.module'; -import { NzMeasureScrollbarService } from '../core/services/nz-measure-scrollbar.service'; - -import { ESCAPE } from '@angular/cdk/keycodes'; -import { dispatchKeyboardEvent } from '../core/testing'; +import { NzButtonComponent, NzButtonModule } from 'ng-zorro-antd/button'; +import { dispatchKeyboardEvent, NzMeasureScrollbarService } from 'ng-zorro-antd/core'; +import { NzI18nService } from 'ng-zorro-antd/i18n'; import en_US from '../i18n/languages/en_US'; -import { NzI18nService } from '../i18n/nz-i18n.service'; import { NzIconTestModule } from '../icon/nz-icon-test.module'; + import { CssUnitPipe } from './css-unit.pipe'; import { NzModalControlService } from './nz-modal-control.service'; import { NzModalRef } from './nz-modal-ref.class'; diff --git a/components/modal/package.json b/components/modal/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/modal/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/modal/public-api.ts b/components/modal/public-api.ts index b7166d02206..2c6f83740cd 100644 --- a/components/modal/public-api.ts +++ b/components/modal/public-api.ts @@ -3,4 +3,6 @@ export { NzModalRef } from './nz-modal-ref.class'; export { NzModalModule } from './nz-modal.module'; export { NzModalService } from './nz-modal.service'; export { NZ_MODAL_CONFIG, NzModalConfig } from './nz-modal-config'; +export { NzModalControlService } from './nz-modal-control.service'; +export { CssUnitPipe } from './css-unit.pipe'; export * from './nz-modal.type'; diff --git a/components/modal/style/entry.less b/components/modal/style/entry.less new file mode 100644 index 00000000000..8d6c97e9eb9 --- /dev/null +++ b/components/modal/style/entry.less @@ -0,0 +1,3 @@ +@import './index.less'; +// style dependencies +@import '../../button/style/index.less'; diff --git a/components/ng-package.json b/components/ng-package.json index 6f4bff77cdc..3e2eeeca2cd 100644 --- a/components/ng-package.json +++ b/components/ng-package.json @@ -3,12 +3,7 @@ "dest": "../publish", "deleteDestPath": true, "lib": { - "entryFile": "ng-zorro-antd.module.ts" + "entryFile": "./ng-zorro-antd.module.ts" }, - "whitelistedNonPeerDependencies": [ - "tslib", - "angular", - "date-fns", - "@ant-design/icons-angular" - ] + "whitelistedNonPeerDependencies": ["tslib", "angular", "date-fns", "@ant-design/icons-angular"] } diff --git a/components/ng-zorro-antd.module.ts b/components/ng-zorro-antd.module.ts index d461c9709f6..b3cc7666fdb 100644 --- a/components/ng-zorro-antd.module.ts +++ b/components/ng-zorro-antd.module.ts @@ -1,130 +1,132 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; -import { NzAffixModule } from './affix/nz-affix.module'; -import { NzAlertModule } from './alert/nz-alert.module'; -import { NzAnchorModule } from './anchor/nz-anchor.module'; -import { NzAutocompleteModule } from './auto-complete/nz-autocomplete.module'; -import { NzAvatarModule } from './avatar/nz-avatar.module'; -import { NzBackTopModule } from './back-top/nz-back-top.module'; -import { NzBadgeModule } from './badge/nz-badge.module'; -import { NzBreadCrumbModule } from './breadcrumb/nz-breadcrumb.module'; -import { NzButtonModule } from './button/nz-button.module'; -import { NzCalendarModule } from './calendar/nz-calendar.module'; -import { NzCardModule } from './card/nz-card.module'; -import { NzCarouselModule } from './carousel/nz-carousel.module'; -import { NzCascaderModule } from './cascader/nz-cascader.module'; -import { NzCheckboxModule } from './checkbox/nz-checkbox.module'; -import { NzCollapseModule } from './collapse/nz-collapse.module'; -import { NzCommentModule } from './comment/nz-comment.module'; -import { NzNoAnimationModule } from './core/no-animation/nz-no-animation.module'; -import { NzWaveModule } from './core/wave/nz-wave.module'; -import { NzDatePickerModule } from './date-picker/date-picker.module'; -import { NzDividerModule } from './divider/nz-divider.module'; -import { NzDrawerModule } from './drawer/nz-drawer.module'; -import { NzDropDownModule } from './dropdown/nz-dropdown.module'; -import { NzEmptyModule } from './empty/nz-empty.module'; -import { NzFormModule } from './form/nz-form.module'; -import { NzGridModule } from './grid/nz-grid.module'; -import { NzI18nModule } from './i18n/nz-i18n.module'; -import { NzIconModule } from './icon/nz-icon.module'; -import { NzInputNumberModule } from './input-number/nz-input-number.module'; -import { NzInputModule } from './input/nz-input.module'; -import { NzLayoutModule } from './layout/nz-layout.module'; -import { NzListModule } from './list/nz-list.module'; -import { NzMentionModule } from './mention/nz-mention.module'; -import { NzMenuModule } from './menu/nz-menu.module'; -import { NzMessageModule } from './message/nz-message.module'; -import { NzModalModule } from './modal/nz-modal.module'; -import { NzNotificationModule } from './notification/nz-notification.module'; -import { NzPageHeaderModule } from './page-header/nz-page-header.module'; -import { NzPaginationModule } from './pagination/nz-pagination.module'; -import { NzPopconfirmModule } from './popconfirm/nz-popconfirm.module'; -import { NzPopoverModule } from './popover/nz-popover.module'; -import { NzProgressModule } from './progress/nz-progress.module'; -import { NzRadioModule } from './radio/nz-radio.module'; -import { NzRateModule } from './rate/nz-rate.module'; -import { NzSelectModule } from './select/nz-select.module'; -import { NzSkeletonModule } from './skeleton/nz-skeleton.module'; -import { NzSliderModule } from './slider/nz-slider.module'; -import { NzSpinModule } from './spin/nz-spin.module'; -import { NzStatisticModule } from './statistic/nz-statistic.module'; -import { NzStepsModule } from './steps/nz-steps.module'; -import { NzSwitchModule } from './switch/nz-switch.module'; -import { NzTableModule } from './table/nz-table.module'; -import { NzTabsModule } from './tabs/nz-tabs.module'; -import { NzTagModule } from './tag/nz-tag.module'; -import { NzTimePickerModule } from './time-picker/nz-time-picker.module'; -import { NzTimelineModule } from './timeline/nz-timeline.module'; -import { NzToolTipModule } from './tooltip/nz-tooltip.module'; -import { NzTransferModule } from './transfer/nz-transfer.module'; -import { NzTreeSelectModule } from './tree-select/nz-tree-select.module'; -import { NzTreeModule } from './tree/nz-tree.module'; -import { NzUploadModule } from './upload/nz-upload.module'; +import { NzAffixModule } from 'ng-zorro-antd/affix'; +import { NzAlertModule } from 'ng-zorro-antd/alert'; +import { NzAnchorModule } from 'ng-zorro-antd/anchor'; +import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete'; +import { NzAvatarModule } from 'ng-zorro-antd/avatar'; +import { NzBackTopModule } from 'ng-zorro-antd/back-top'; +import { NzBadgeModule } from 'ng-zorro-antd/badge'; +import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb'; +import { NzButtonModule } from 'ng-zorro-antd/button'; +import { NzCalendarModule } from 'ng-zorro-antd/calendar'; +import { NzCardModule } from 'ng-zorro-antd/card'; +import { NzCarouselModule } from 'ng-zorro-antd/carousel'; +import { NzCascaderModule } from 'ng-zorro-antd/cascader'; +import { NzCheckboxModule } from 'ng-zorro-antd/checkbox'; +import { NzCollapseModule } from 'ng-zorro-antd/collapse'; +import { NzCommentModule } from 'ng-zorro-antd/comment'; +import { NzNoAnimationModule, NzWaveModule } from 'ng-zorro-antd/core'; +import { NzDatePickerModule } from 'ng-zorro-antd/date-picker'; +import { NzDividerModule } from 'ng-zorro-antd/divider'; +import { NzDrawerModule } from 'ng-zorro-antd/drawer'; +import { NzDropDownModule } from 'ng-zorro-antd/dropdown'; +import { NzEmptyModule } from 'ng-zorro-antd/empty'; +import { NzFormModule } from 'ng-zorro-antd/form'; +import { NzGridModule } from 'ng-zorro-antd/grid'; +import { NzI18nModule } from 'ng-zorro-antd/i18n'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzInputModule } from 'ng-zorro-antd/input'; +import { NzInputNumberModule } from 'ng-zorro-antd/input-number'; +import { NzLayoutModule } from 'ng-zorro-antd/layout'; +import { NzListModule } from 'ng-zorro-antd/list'; +import { NzMentionModule } from 'ng-zorro-antd/mention'; +import { NzMenuModule } from 'ng-zorro-antd/menu'; +import { NzMessageModule } from 'ng-zorro-antd/message'; +import { NzModalModule } from 'ng-zorro-antd/modal'; +import { NzNotificationModule } from 'ng-zorro-antd/notification'; +import { NzPageHeaderModule } from 'ng-zorro-antd/page-header'; +import { NzPaginationModule } from 'ng-zorro-antd/pagination'; +import { NzPopconfirmModule } from 'ng-zorro-antd/popconfirm'; +import { NzPopoverModule } from 'ng-zorro-antd/popover'; +import { NzProgressModule } from 'ng-zorro-antd/progress'; +import { NzRadioModule } from 'ng-zorro-antd/radio'; +import { NzRateModule } from 'ng-zorro-antd/rate'; +import { NzSelectModule } from 'ng-zorro-antd/select'; +import { NzSkeletonModule } from 'ng-zorro-antd/skeleton'; +import { NzSliderModule } from 'ng-zorro-antd/slider'; +import { NzSpinModule } from 'ng-zorro-antd/spin'; +import { NzStatisticModule } from 'ng-zorro-antd/statistic'; +import { NzStepsModule } from 'ng-zorro-antd/steps'; +import { NzSwitchModule } from 'ng-zorro-antd/switch'; +import { NzTableModule } from 'ng-zorro-antd/table'; +import { NzTabsModule } from 'ng-zorro-antd/tabs'; +import { NzTagModule } from 'ng-zorro-antd/tag'; +import { NzTimePickerModule } from 'ng-zorro-antd/time-picker'; +import { NzTimelineModule } from 'ng-zorro-antd/timeline'; +import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; +import { NzTransferModule } from 'ng-zorro-antd/transfer'; +import { NzTreeModule } from 'ng-zorro-antd/tree'; +import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select'; +import { NzUploadModule } from 'ng-zorro-antd/upload'; + +export * from 'ng-zorro-antd/affix'; +export * from 'ng-zorro-antd/alert'; +export * from 'ng-zorro-antd/anchor'; +export * from 'ng-zorro-antd/auto-complete'; +export * from 'ng-zorro-antd/avatar'; +export * from 'ng-zorro-antd/back-top'; +export * from 'ng-zorro-antd/badge'; +export * from 'ng-zorro-antd/breadcrumb'; +export * from 'ng-zorro-antd/button'; +export * from 'ng-zorro-antd/calendar'; +export * from 'ng-zorro-antd/card'; +export * from 'ng-zorro-antd/carousel'; +export * from 'ng-zorro-antd/cascader'; +export * from 'ng-zorro-antd/checkbox'; +export * from 'ng-zorro-antd/collapse'; +export * from 'ng-zorro-antd/comment'; +export * from 'ng-zorro-antd/core/logger'; +export * from 'ng-zorro-antd/core/no-animation'; +export * from 'ng-zorro-antd/core/tree'; +export * from 'ng-zorro-antd/core/util'; +export * from 'ng-zorro-antd/core/wave'; +export * from 'ng-zorro-antd/date-picker'; +export * from 'ng-zorro-antd/divider'; +export * from 'ng-zorro-antd/drawer'; +export * from 'ng-zorro-antd/drawer'; +export * from 'ng-zorro-antd/dropdown'; +export * from 'ng-zorro-antd/empty'; +export * from 'ng-zorro-antd/form'; +export * from 'ng-zorro-antd/grid'; +export * from 'ng-zorro-antd/i18n'; +export * from 'ng-zorro-antd/icon'; +export * from 'ng-zorro-antd/input-number'; +export * from 'ng-zorro-antd/input'; +export * from 'ng-zorro-antd/layout'; +export * from 'ng-zorro-antd/list'; +export * from 'ng-zorro-antd/mention'; +export * from 'ng-zorro-antd/menu'; +export * from 'ng-zorro-antd/message'; +export * from 'ng-zorro-antd/modal'; +export * from 'ng-zorro-antd/notification'; +export * from 'ng-zorro-antd/page-header'; +export * from 'ng-zorro-antd/pagination'; +export * from 'ng-zorro-antd/popconfirm'; +export * from 'ng-zorro-antd/popover'; +export * from 'ng-zorro-antd/progress'; +export * from 'ng-zorro-antd/radio'; +export * from 'ng-zorro-antd/rate'; +export * from 'ng-zorro-antd/select'; +export * from 'ng-zorro-antd/skeleton'; +export * from 'ng-zorro-antd/slider'; +export * from 'ng-zorro-antd/spin'; +export * from 'ng-zorro-antd/statistic'; +export * from 'ng-zorro-antd/steps'; +export * from 'ng-zorro-antd/switch'; +export * from 'ng-zorro-antd/table'; +export * from 'ng-zorro-antd/tabs'; +export * from 'ng-zorro-antd/tag'; +export * from 'ng-zorro-antd/time-picker'; +export * from 'ng-zorro-antd/time-picker'; +export * from 'ng-zorro-antd/timeline'; +export * from 'ng-zorro-antd/tooltip'; +export * from 'ng-zorro-antd/transfer'; +export * from 'ng-zorro-antd/tree-select'; +export * from 'ng-zorro-antd/tree'; +export * from 'ng-zorro-antd/upload'; -export * from './affix'; -export * from './alert'; -export * from './anchor'; -export * from './avatar'; -export * from './back-top'; -export * from './badge'; -export * from './breadcrumb'; -export * from './button'; -export * from './calendar'; -export * from './card'; -export * from './carousel'; -export * from './checkbox'; -export * from './collapse'; -export * from './comment'; -export * from './date-picker'; -export * from './divider'; -export * from './drawer'; -export * from './dropdown'; -export * from './drawer'; -export * from './empty'; -export * from './form'; -export * from './grid'; -export * from './i18n'; -export * from './icon'; -export * from './input'; -export * from './input-number'; -export * from './layout'; -export * from './list'; -export * from './mention'; -export * from './menu'; -export * from './page-header'; -export * from './pagination'; -export * from './progress'; -export * from './radio'; -export * from './rate'; -export * from './select'; -export * from './spin'; -export * from './statistic'; -export * from './steps'; -export * from './switch'; -export * from './table'; -export * from './tabs'; -export * from './timeline'; -export * from './transfer'; -export * from './upload'; -export * from './tag'; -export * from './auto-complete'; -export * from './message'; -export * from './time-picker'; -export * from './tooltip'; -export * from './skeleton'; -export * from './slider'; -export * from './popover'; -export * from './notification'; -export * from './popconfirm'; -export * from './modal'; -export * from './cascader'; -export * from './tree'; -export * from './tree-select'; -export * from './time-picker'; export * from './version'; -export * from './core/wave'; -export * from './core/util'; -export * from './core/no-animation'; @NgModule({ exports: [ diff --git a/components/notification/doc/index.en-US.md b/components/notification/doc/index.en-US.md index 9638ee1f4b4..8480a4bf7c7 100644 --- a/components/notification/doc/index.en-US.md +++ b/components/notification/doc/index.en-US.md @@ -37,6 +37,14 @@ The default global configuration is: ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzNotificationModule } from 'ng-zorro-antd'; +``` + ### NzNotificationService The component provides a number of service methods using the following methods and parameters: diff --git a/components/notification/doc/index.zh-CN.md b/components/notification/doc/index.zh-CN.md index a56fbc3d2e0..95108a25aed 100644 --- a/components/notification/doc/index.zh-CN.md +++ b/components/notification/doc/index.zh-CN.md @@ -36,6 +36,14 @@ subtitle: 通知提醒框 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzNotificationModule } from 'ng-zorro-antd'; +``` + ### NzNotificationService 组件提供了一些服务方法,使用方式和参数如下: diff --git a/components/notification/nz-notification-config.ts b/components/notification/nz-notification-config.ts index 45917f63ea2..c2e8fff37a5 100644 --- a/components/notification/nz-notification-config.ts +++ b/components/notification/nz-notification-config.ts @@ -1,6 +1,6 @@ import { InjectionToken } from '@angular/core'; -import { NzMessageConfig } from '../message/nz-message-config'; +import { NzMessageConfig } from 'ng-zorro-antd/message'; export interface NzNotificationConfig extends NzMessageConfig { nzTop?: string | number; diff --git a/components/notification/nz-notification-container.component.ts b/components/notification/nz-notification-container.component.ts index 15c30cef08a..b972e579b0a 100644 --- a/components/notification/nz-notification-container.component.ts +++ b/components/notification/nz-notification-container.component.ts @@ -8,8 +8,8 @@ import { } from '@angular/core'; import { Subject } from 'rxjs'; -import { toCssPixel } from '../core/util'; -import { NzMessageContainerComponent } from '../message/nz-message-container.component'; +import { toCssPixel } from 'ng-zorro-antd/core'; +import { NzMessageContainerComponent } from 'ng-zorro-antd/message'; import { NzNotificationConfig, NZ_NOTIFICATION_CONFIG, NZ_NOTIFICATION_DEFAULT_CONFIG } from './nz-notification-config'; import { NzNotificationDataFilled, NzNotificationDataOptions } from './nz-notification.definitions'; diff --git a/components/notification/nz-notification.component.ts b/components/notification/nz-notification.component.ts index 50ef9c5404d..1021a93cfd2 100644 --- a/components/notification/nz-notification.component.ts +++ b/components/notification/nz-notification.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectorRef, Component, Input, ViewEncapsulation } from '@angular/core'; -import { notificationMotion } from '../core/animation/notification'; -import { NzMessageComponent } from '../message/nz-message.component'; +import { notificationMotion } from 'ng-zorro-antd/core'; +import { NzMessageComponent } from 'ng-zorro-antd/message'; import { NzNotificationContainerComponent } from './nz-notification-container.component'; import { NzNotificationDataFilled } from './nz-notification.definitions'; diff --git a/components/notification/nz-notification.definitions.ts b/components/notification/nz-notification.definitions.ts index 89a5a949d08..9fd7a611a25 100644 --- a/components/notification/nz-notification.definitions.ts +++ b/components/notification/nz-notification.definitions.ts @@ -1,7 +1,7 @@ import { TemplateRef } from '@angular/core'; import { Subject } from 'rxjs'; -import { NzMessageData, NzMessageDataOptions } from '../message/nz-message.definitions'; +import { NzMessageData, NzMessageDataOptions } from 'ng-zorro-antd/message'; export interface NzNotificationData extends NzMessageData { template?: TemplateRef<{}>; diff --git a/components/notification/nz-notification.module.ts b/components/notification/nz-notification.module.ts index a3eb01e7347..42107ded2ec 100644 --- a/components/notification/nz-notification.module.ts +++ b/components/notification/nz-notification.module.ts @@ -1,7 +1,7 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NZ_NOTIFICATION_DEFAULT_CONFIG_PROVIDER } from './nz-notification-config'; import { NzNotificationContainerComponent } from './nz-notification-container.component'; diff --git a/components/notification/nz-notification.service.ts b/components/notification/nz-notification.service.ts index a133a5ebc88..704d584a729 100644 --- a/components/notification/nz-notification.service.ts +++ b/components/notification/nz-notification.service.ts @@ -1,7 +1,7 @@ import { Overlay } from '@angular/cdk/overlay'; import { ApplicationRef, ComponentFactoryResolver, Injectable, Injector, TemplateRef } from '@angular/core'; -import { NzMessageBaseService } from '../message/nz-message.service'; +import { NzMessageBaseService } from 'ng-zorro-antd/message'; import { NzNotificationConfig } from './nz-notification-config'; import { NzNotificationContainerComponent } from './nz-notification-container.component'; diff --git a/components/notification/nz-notification.spec.ts b/components/notification/nz-notification.spec.ts index c442b4879e6..36c18d71114 100644 --- a/components/notification/nz-notification.spec.ts +++ b/components/notification/nz-notification.spec.ts @@ -3,7 +3,7 @@ import { Component, TemplateRef, ViewChild } from '@angular/core'; import { fakeAsync, inject, tick, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { dispatchMouseEvent } from '../core/testing'; +import { dispatchMouseEvent } from 'ng-zorro-antd/core'; import { NZ_NOTIFICATION_CONFIG } from './nz-notification-config'; import { NzNotificationModule } from './nz-notification.module'; diff --git a/components/notification/package.json b/components/notification/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/notification/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/notification/style/entry.less b/components/notification/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/notification/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/page-header/doc/index.en-US.md b/components/page-header/doc/index.en-US.md index 1d6d13f0f66..ad747e8125a 100644 --- a/components/page-header/doc/index.en-US.md +++ b/components/page-header/doc/index.en-US.md @@ -17,6 +17,14 @@ Use when you need the user to quickly understand what the current page is and wh ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzPageHeaderModule } from 'ng-zorro-antd'; +``` + ### nz-page-header | Param | Description | Type | Default value | | ----- | ----------- | ---- | ------------- | diff --git a/components/page-header/doc/index.zh-CN.md b/components/page-header/doc/index.zh-CN.md index 14d7538f479..4b9ee87de9d 100644 --- a/components/page-header/doc/index.zh-CN.md +++ b/components/page-header/doc/index.zh-CN.md @@ -18,6 +18,14 @@ subtitle: 页头 ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzPageHeaderModule } from 'ng-zorro-antd'; +``` + ### nz-page-header | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | diff --git a/components/page-header/nz-page-header.module.ts b/components/page-header/nz-page-header.module.ts index 2aaf9849418..b398d8c2b64 100644 --- a/components/page-header/nz-page-header.module.ts +++ b/components/page-header/nz-page-header.module.ts @@ -1,8 +1,10 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzDividerModule } from '../divider/nz-divider.module'; -import { NzIconModule } from '../icon/nz-icon.module'; + +import { NzAddOnModule } from 'ng-zorro-antd/core'; +import { NzDividerModule } from 'ng-zorro-antd/divider'; +import { NzIconModule } from 'ng-zorro-antd/icon'; + import { NzPageHeaderBreadcrumbDirective, NzPageHeaderContentDirective, diff --git a/components/page-header/package.json b/components/page-header/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/page-header/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/page-header/style/entry.less b/components/page-header/style/entry.less new file mode 100644 index 00000000000..a7bbd72d9da --- /dev/null +++ b/components/page-header/style/entry.less @@ -0,0 +1,4 @@ +@import './index.less'; +// style dependencies +@import '../../divider/style/index.less'; +@import '../../breadcrumb/style/index.less'; diff --git a/components/pagination/doc/index.en-US.md b/components/pagination/doc/index.en-US.md index bc6c0feba1f..3e670929474 100755 --- a/components/pagination/doc/index.en-US.md +++ b/components/pagination/doc/index.en-US.md @@ -18,6 +18,14 @@ A long list can be divided into several pages by `Pagination`, and only one page ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzPaginationModule } from 'ng-zorro-antd'; +``` + ### nz-pagination | Property | Description | Type | Default | diff --git a/components/pagination/doc/index.zh-CN.md b/components/pagination/doc/index.zh-CN.md index e95bb803ea1..e8463c33bfe 100755 --- a/components/pagination/doc/index.zh-CN.md +++ b/components/pagination/doc/index.zh-CN.md @@ -19,6 +19,14 @@ cols: 1 ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzPaginationModule } from 'ng-zorro-antd'; +``` + ### nz-pagination | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/pagination/nz-pagination.component.ts b/components/pagination/nz-pagination.component.ts index 58e83ff7bc2..e05ffe4c833 100644 --- a/components/pagination/nz-pagination.component.ts +++ b/components/pagination/nz-pagination.component.ts @@ -15,9 +15,9 @@ import { } from '@angular/core'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { isInteger } from '../core/util/check'; -import { toNumber, InputBoolean, InputNumber } from '../core/util/convert'; -import { NzI18nService } from '../i18n/nz-i18n.service'; + +import { isInteger, toNumber, InputBoolean, InputNumber } from 'ng-zorro-antd/core'; +import { NzI18nService } from 'ng-zorro-antd/i18n'; @Component({ selector: 'nz-pagination', diff --git a/components/pagination/nz-pagination.module.ts b/components/pagination/nz-pagination.module.ts index 81483bbcc7b..60f37c29f08 100644 --- a/components/pagination/nz-pagination.module.ts +++ b/components/pagination/nz-pagination.module.ts @@ -2,9 +2,9 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzI18nModule } from '../i18n/nz-i18n.module'; -import { NzIconModule } from '../icon/nz-icon.module'; -import { NzSelectModule } from '../select/nz-select.module'; +import { NzI18nModule } from 'ng-zorro-antd/i18n'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzSelectModule } from 'ng-zorro-antd/select'; import { NzPaginationComponent } from './nz-pagination.component'; diff --git a/components/pagination/package.json b/components/pagination/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/pagination/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/pagination/style/entry.less b/components/pagination/style/entry.less new file mode 100644 index 00000000000..d9e2fe34e62 --- /dev/null +++ b/components/pagination/style/entry.less @@ -0,0 +1,3 @@ +@import './index.less'; +// style dependencies +@import '../../select/style/index.less'; diff --git a/components/popconfirm/doc/index.en-US.md b/components/popconfirm/doc/index.en-US.md index 9c0f447c8db..935027122c6 100644 --- a/components/popconfirm/doc/index.en-US.md +++ b/components/popconfirm/doc/index.en-US.md @@ -14,6 +14,14 @@ The difference with the `confirm` modal dialog is that it's more lightweight tha ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzPopconfirmModule } from 'ng-zorro-antd'; +``` + ### [nz-popconfirm] | Param | Description | Type | Default value | diff --git a/components/popconfirm/doc/index.zh-CN.md b/components/popconfirm/doc/index.zh-CN.md index 1ce6679854d..2741b2a3ffb 100644 --- a/components/popconfirm/doc/index.zh-CN.md +++ b/components/popconfirm/doc/index.zh-CN.md @@ -15,6 +15,14 @@ title: Popconfirm ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzPopconfirmModule } from 'ng-zorro-antd'; +``` + ### [nz-popconfirm] | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/popconfirm/nz-popconfirm.component.ts b/components/popconfirm/nz-popconfirm.component.ts index 7fdbc300060..8e50616465e 100644 --- a/components/popconfirm/nz-popconfirm.component.ts +++ b/components/popconfirm/nz-popconfirm.component.ts @@ -10,10 +10,9 @@ import { TemplateRef, ViewEncapsulation } from '@angular/core'; -import { zoomBigMotion } from '../core/animation/zoom'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { InputBoolean } from '../core/util/convert'; -import { NzToolTipComponent } from '../tooltip/nz-tooltip.component'; + +import { zoomBigMotion, InputBoolean, NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { NzToolTipComponent } from 'ng-zorro-antd/tooltip'; @Component({ changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/components/popconfirm/nz-popconfirm.directive.ts b/components/popconfirm/nz-popconfirm.directive.ts index a8397ef52ee..ae74262a15e 100644 --- a/components/popconfirm/nz-popconfirm.directive.ts +++ b/components/popconfirm/nz-popconfirm.directive.ts @@ -16,9 +16,9 @@ import { import { distinctUntilChanged } from 'rxjs/operators'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { InputBoolean } from '../core/util/convert'; -import { NzTooltipDirective } from '../tooltip/nz-tooltip.directive'; +import { InputBoolean, NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { NzTooltipDirective } from 'ng-zorro-antd/tooltip'; + import { NzPopconfirmComponent } from './nz-popconfirm.component'; @Directive({ diff --git a/components/popconfirm/nz-popconfirm.module.ts b/components/popconfirm/nz-popconfirm.module.ts index 3541e8fa05d..bf8b9135952 100644 --- a/components/popconfirm/nz-popconfirm.module.ts +++ b/components/popconfirm/nz-popconfirm.module.ts @@ -2,12 +2,11 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzButtonModule } from '../button/nz-button.module'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; -import { NzOverlayModule } from '../core/overlay/nz-overlay.module'; -import { NzI18nModule } from '../i18n/nz-i18n.module'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzButtonModule } from 'ng-zorro-antd/button'; +import { NzAddOnModule, NzNoAnimationModule, NzOverlayModule } from 'ng-zorro-antd/core'; +import { NzI18nModule } from 'ng-zorro-antd/i18n'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; import { NzPopconfirmComponent } from './nz-popconfirm.component'; import { NzPopconfirmDirective } from './nz-popconfirm.directive'; @@ -23,7 +22,8 @@ import { NzPopconfirmDirective } from './nz-popconfirm.directive'; NzIconModule, NzAddOnModule, NzOverlayModule, - NzNoAnimationModule + NzNoAnimationModule, + NzToolTipModule ], entryComponents: [NzPopconfirmComponent] }) diff --git a/components/popconfirm/nz-popconfirm.spec.ts b/components/popconfirm/nz-popconfirm.spec.ts index d5348c4c1d5..b4a08921c11 100644 --- a/components/popconfirm/nz-popconfirm.spec.ts +++ b/components/popconfirm/nz-popconfirm.spec.ts @@ -3,7 +3,7 @@ import { Component, ElementRef, ViewChild } from '@angular/core'; import { fakeAsync, inject, tick, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { dispatchMouseEvent } from '../core/testing'; +import { dispatchMouseEvent } from 'ng-zorro-antd/core'; import { NzIconTestModule } from '../icon/nz-icon-test.module'; import { NzToolTipModule } from '../tooltip/nz-tooltip.module'; import { NzPopconfirmModule } from './nz-popconfirm.module'; diff --git a/components/popconfirm/package.json b/components/popconfirm/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/popconfirm/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/popconfirm/style/entry.less b/components/popconfirm/style/entry.less new file mode 100644 index 00000000000..9bed7670618 --- /dev/null +++ b/components/popconfirm/style/entry.less @@ -0,0 +1,4 @@ +// style dependencies +// deps-lint-skip: tooltip, popover +@import '../../popover/style/index.less'; +@import '../../button/style/index.less'; diff --git a/components/popover/doc/index.en-US.md b/components/popover/doc/index.en-US.md index ccc20e76660..b147430015c 100644 --- a/components/popover/doc/index.en-US.md +++ b/components/popover/doc/index.en-US.md @@ -14,6 +14,14 @@ Comparing with `Tooltip`, besides information `Popover` card can also provide ac ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzPopoverModule } from 'ng-zorro-antd'; +``` + ### [nz-popover] | Param | Description | Type | Default value | diff --git a/components/popover/doc/index.zh-CN.md b/components/popover/doc/index.zh-CN.md index 8ad023fdc43..da9b22ba6e4 100644 --- a/components/popover/doc/index.zh-CN.md +++ b/components/popover/doc/index.zh-CN.md @@ -15,6 +15,14 @@ title: Popover ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzPopoverModule } from 'ng-zorro-antd'; +``` + ### [nz-popover] | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/popover/nz-popover.component.ts b/components/popover/nz-popover.component.ts index a988c740eab..f3b8ee30236 100644 --- a/components/popover/nz-popover.component.ts +++ b/components/popover/nz-popover.component.ts @@ -10,10 +10,8 @@ import { ViewEncapsulation } from '@angular/core'; -import { zoomBigMotion } from '../core/animation/zoom'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { isNotNil } from '../core/util'; -import { NzToolTipComponent } from '../tooltip/nz-tooltip.component'; +import { isNotNil, zoomBigMotion, NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { NzToolTipComponent } from 'ng-zorro-antd/tooltip'; @Component({ selector: 'nz-popover', diff --git a/components/popover/nz-popover.directive.ts b/components/popover/nz-popover.directive.ts index 851b028c2c5..6f0f743a820 100644 --- a/components/popover/nz-popover.directive.ts +++ b/components/popover/nz-popover.directive.ts @@ -9,8 +9,9 @@ import { ViewContainerRef } from '@angular/core'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { NzTooltipDirective } from '../tooltip/nz-tooltip.directive'; +import { NzNoAnimationDirective } from 'ng-zorro-antd/core'; +import { NzTooltipDirective } from 'ng-zorro-antd/tooltip'; + import { NzPopoverComponent } from './nz-popover.component'; @Directive({ diff --git a/components/popover/nz-popover.module.ts b/components/popover/nz-popover.module.ts index b493b52438d..3fdedd1759f 100644 --- a/components/popover/nz-popover.module.ts +++ b/components/popover/nz-popover.module.ts @@ -2,9 +2,8 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; -import { NzOverlayModule } from '../core/overlay/nz-overlay.module'; +import { NzAddOnModule, NzNoAnimationModule, NzOverlayModule } from 'ng-zorro-antd/core'; +import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; import { NzPopoverComponent } from './nz-popover.component'; import { NzPopoverDirective } from './nz-popover.directive'; @@ -13,6 +12,6 @@ import { NzPopoverDirective } from './nz-popover.directive'; entryComponents: [NzPopoverComponent], exports: [NzPopoverDirective, NzPopoverComponent], declarations: [NzPopoverDirective, NzPopoverComponent], - imports: [CommonModule, OverlayModule, NzAddOnModule, NzOverlayModule, NzNoAnimationModule] + imports: [CommonModule, OverlayModule, NzAddOnModule, NzOverlayModule, NzNoAnimationModule, NzToolTipModule] }) export class NzPopoverModule {} diff --git a/components/popover/nz-popover.spec.ts b/components/popover/nz-popover.spec.ts index 3d7d702edc2..4de25058367 100644 --- a/components/popover/nz-popover.spec.ts +++ b/components/popover/nz-popover.spec.ts @@ -3,7 +3,7 @@ import { Component, ElementRef, ViewChild } from '@angular/core'; import { fakeAsync, inject, tick, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { dispatchMouseEvent } from '../core/testing'; +import { dispatchMouseEvent } from 'ng-zorro-antd/core'; import { NzIconTestModule } from '../icon/nz-icon-test.module'; import { NzToolTipModule } from '../tooltip/nz-tooltip.module'; import { NzPopoverDirective } from './nz-popover.directive'; diff --git a/components/popover/package.json b/components/popover/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/popover/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/popover/style/entry.less b/components/popover/style/entry.less new file mode 100644 index 00000000000..0afc1757c01 --- /dev/null +++ b/components/popover/style/entry.less @@ -0,0 +1,3 @@ +@import './index.less'; +// style dependencies +// deps-lint-skip: tooltip diff --git a/components/progress/doc/index.en-US.md b/components/progress/doc/index.en-US.md index a2d8761db39..3376c129db1 100644 --- a/components/progress/doc/index.en-US.md +++ b/components/progress/doc/index.en-US.md @@ -15,6 +15,14 @@ If it will take a long time to complete an operation, you can use `Progress` to ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzProgressModule } from 'ng-zorro-antd'; +``` + ### nz-progress | Property | Description | Type | Default | diff --git a/components/progress/doc/index.zh-CN.md b/components/progress/doc/index.zh-CN.md index c6c858be8f1..bd4b532522a 100644 --- a/components/progress/doc/index.zh-CN.md +++ b/components/progress/doc/index.zh-CN.md @@ -16,6 +16,14 @@ title: Progress ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzProgressModule } from 'ng-zorro-antd'; +``` + ### nz-progress | 属性 | 说明 | 类型 | 默认值 | diff --git a/components/progress/nz-progress.component.ts b/components/progress/nz-progress.component.ts index 6e8de043d3c..2c928f89bbb 100644 --- a/components/progress/nz-progress.component.ts +++ b/components/progress/nz-progress.component.ts @@ -8,8 +8,7 @@ import { ViewEncapsulation } from '@angular/core'; -import { InputNumber } from '../core/util'; -import { isNotNil } from '../core/util/check'; +import { isNotNil, InputNumber } from 'ng-zorro-antd/core'; export type NzProgressGapPositionType = 'top' | 'bottom' | 'left' | 'right'; export type NzProgressStatusType = 'success' | 'exception' | 'active' | 'normal'; diff --git a/components/progress/nz-progress.module.ts b/components/progress/nz-progress.module.ts index 747bb99801a..c303b7436bb 100644 --- a/components/progress/nz-progress.module.ts +++ b/components/progress/nz-progress.module.ts @@ -1,6 +1,6 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzProgressComponent } from './nz-progress.component'; diff --git a/components/progress/package.json b/components/progress/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/progress/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/progress/style/entry.less b/components/progress/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/progress/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/radio/doc/index.en-US.md b/components/radio/doc/index.en-US.md index a825f3104b5..b733c458bad 100644 --- a/components/radio/doc/index.en-US.md +++ b/components/radio/doc/index.en-US.md @@ -13,6 +13,14 @@ Radio. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzRadioModule } from 'ng-zorro-antd'; +``` + ### [nz-radio] | [nz-radio-button] | Property | Description | Type | Default | diff --git a/components/radio/doc/index.zh-CN.md b/components/radio/doc/index.zh-CN.md index b8130ddcd5f..56daf2e4faf 100644 --- a/components/radio/doc/index.zh-CN.md +++ b/components/radio/doc/index.zh-CN.md @@ -14,6 +14,14 @@ title: Radio ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzRadioModule } from 'ng-zorro-antd'; +``` + ### [nz-radio] | [nz-radio-button] | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/radio/nz-radio-group.component.ts b/components/radio/nz-radio-group.component.ts index 11c9cc2eb1d..f00b320de44 100644 --- a/components/radio/nz-radio-group.component.ts +++ b/components/radio/nz-radio-group.component.ts @@ -17,9 +17,9 @@ import { import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { merge, Subject, Subscription } from 'rxjs'; import { startWith, takeUntil } from 'rxjs/operators'; -import { NzSizeLDSType } from '../core/types/size'; -import { isNotNil } from '../core/util/check'; -import { InputBoolean } from '../core/util/convert'; + +import { isNotNil, InputBoolean, NzSizeLDSType } from 'ng-zorro-antd/core'; + import { NzRadioComponent } from './nz-radio.component'; export type NzRadioButtonStyle = 'outline' | 'solid'; diff --git a/components/radio/nz-radio.component.ts b/components/radio/nz-radio.component.ts index 042293ff3f3..37f9486501b 100644 --- a/components/radio/nz-radio.component.ts +++ b/components/radio/nz-radio.component.ts @@ -16,7 +16,8 @@ import { } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { Subject } from 'rxjs'; -import { InputBoolean } from '../core/util/convert'; + +import { InputBoolean } from 'ng-zorro-antd/core'; @Component({ selector: '[nz-radio]', diff --git a/components/radio/package.json b/components/radio/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/radio/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/radio/style/entry.less b/components/radio/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/radio/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/rate/doc/index.en-US.md b/components/rate/doc/index.en-US.md index 4087c162b87..5b98a5a976f 100644 --- a/components/rate/doc/index.en-US.md +++ b/components/rate/doc/index.en-US.md @@ -13,6 +13,14 @@ Rate component. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzRateModule } from 'ng-zorro-antd'; +``` + ### nz-rate | Property | Description | type | Default | diff --git a/components/rate/doc/index.zh-CN.md b/components/rate/doc/index.zh-CN.md index 0f7415c92b6..196b6677c46 100644 --- a/components/rate/doc/index.zh-CN.md +++ b/components/rate/doc/index.zh-CN.md @@ -14,6 +14,14 @@ title: Rate ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzRateModule } from 'ng-zorro-antd'; +``` + ### nz-rate | 属性 | 说明 | 类型 | 默认值 | diff --git a/components/rate/nz-rate-item.component.ts b/components/rate/nz-rate-item.component.ts index 4cac960900c..aa674131bc0 100644 --- a/components/rate/nz-rate-item.component.ts +++ b/components/rate/nz-rate-item.component.ts @@ -7,7 +7,7 @@ import { TemplateRef, ViewEncapsulation } from '@angular/core'; -import { InputBoolean } from '../core/util'; +import { InputBoolean } from 'ng-zorro-antd/core'; @Component({ changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/components/rate/nz-rate.component.ts b/components/rate/nz-rate.component.ts index 3e22735eb7b..d5c14bc4d7f 100644 --- a/components/rate/nz-rate.component.ts +++ b/components/rate/nz-rate.component.ts @@ -18,9 +18,8 @@ import { ViewEncapsulation } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { NgClassType } from '../core/types/ng-class'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean, NgClassType } from 'ng-zorro-antd/core'; @Component({ changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/components/rate/nz-rate.module.ts b/components/rate/nz-rate.module.ts index 2baa329061f..3e812333682 100644 --- a/components/rate/nz-rate.module.ts +++ b/components/rate/nz-rate.module.ts @@ -1,8 +1,8 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzIconModule } from '../icon/nz-icon.module'; -import { NzToolTipModule } from '../tooltip/nz-tooltip.module'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; import { NzRateItemComponent } from './nz-rate-item.component'; import { NzRateComponent } from './nz-rate.component'; diff --git a/components/rate/nz-rate.spec.ts b/components/rate/nz-rate.spec.ts index 2912e885d98..1c20581d103 100644 --- a/components/rate/nz-rate.spec.ts +++ b/components/rate/nz-rate.spec.ts @@ -3,7 +3,7 @@ import { fakeAsync, flush, ComponentFixture, TestBed } from '@angular/core/testi import { FormsModule, FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { dispatchFakeEvent, dispatchKeyboardEvent } from '../core/testing'; +import { dispatchFakeEvent, dispatchKeyboardEvent } from 'ng-zorro-antd/core'; import { LEFT_ARROW, RIGHT_ARROW } from '@angular/cdk/keycodes'; import { NzRateComponent } from './nz-rate.component'; diff --git a/components/rate/package.json b/components/rate/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/rate/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/rate/public-api.ts b/components/rate/public-api.ts index 386d63ae333..07747b904f9 100644 --- a/components/rate/public-api.ts +++ b/components/rate/public-api.ts @@ -1,2 +1,3 @@ export * from './nz-rate.component'; export * from './nz-rate.module'; +export * from './nz-rate-item.component'; diff --git a/components/rate/style/entry.less b/components/rate/style/entry.less new file mode 100644 index 00000000000..fca13534209 --- /dev/null +++ b/components/rate/style/entry.less @@ -0,0 +1,3 @@ +@import './index.less'; +// style dependencies +@import '../../tooltip/style/index.less'; diff --git a/components/select/doc/index.en-US.md b/components/select/doc/index.en-US.md index 10aab11feda..425e12ab26c 100644 --- a/components/select/doc/index.en-US.md +++ b/components/select/doc/index.en-US.md @@ -19,6 +19,14 @@ Select component to select value from options. ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzSelectModule } from 'ng-zorro-antd'; +``` + ### nz-select | Property | Description | Type | Default | diff --git a/components/select/doc/index.zh-CN.md b/components/select/doc/index.zh-CN.md index c9524546ced..85a6edc8fb2 100644 --- a/components/select/doc/index.zh-CN.md +++ b/components/select/doc/index.zh-CN.md @@ -20,6 +20,14 @@ title: Select ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzSelectModule } from 'ng-zorro-antd'; +``` + ### nz-select | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/select/nz-option-container.spec.ts b/components/select/nz-option-container.spec.ts index aad883430ec..176a47b9d53 100644 --- a/components/select/nz-option-container.spec.ts +++ b/components/select/nz-option-container.spec.ts @@ -3,7 +3,9 @@ import { fakeAsync, tick, ComponentFixture, TestBed } from '@angular/core/testin import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ReplaySubject, Subject } from 'rxjs'; -import { dispatchFakeEvent } from '../core/testing'; + +import { dispatchFakeEvent } from 'ng-zorro-antd/core'; + import { NzOptionContainerComponent } from './nz-option-container.component'; import { NzOptionGroupComponent } from './nz-option-group.component'; import { NzOptionComponent } from './nz-option.component'; diff --git a/components/select/nz-option-li.component.ts b/components/select/nz-option-li.component.ts index 9461608b152..f55e24747c8 100644 --- a/components/select/nz-option-li.component.ts +++ b/components/select/nz-option-li.component.ts @@ -12,7 +12,9 @@ import { } from '@angular/core'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { isNotNil } from '../core/util/check'; + +import { isNotNil } from 'ng-zorro-antd/core'; + import { NzOptionComponent } from './nz-option.component'; import { NzSelectService } from './nz-select.service'; diff --git a/components/select/nz-option-li.spec.ts b/components/select/nz-option-li.spec.ts index f10b9aa06c7..f7f3d4aff1a 100644 --- a/components/select/nz-option-li.spec.ts +++ b/components/select/nz-option-li.spec.ts @@ -2,7 +2,9 @@ import { Component, DebugElement } from '@angular/core'; import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { ReplaySubject, Subject } from 'rxjs'; -import { dispatchFakeEvent } from '../core/testing'; + +import { dispatchFakeEvent } from 'ng-zorro-antd/core'; + import { NzOptionLiComponent } from './nz-option-li.component'; import { NzOptionComponent } from './nz-option.component'; import { NzSelectService } from './nz-select.service'; diff --git a/components/select/nz-option.component.ts b/components/select/nz-option.component.ts index d3b7d0997d2..b2ab8cd17af 100644 --- a/components/select/nz-option.component.ts +++ b/components/select/nz-option.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, Input, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean } from 'ng-zorro-antd/core'; @Component({ selector: 'nz-option', diff --git a/components/select/nz-select-top-control.component.ts b/components/select/nz-select-top-control.component.ts index da71c1a13b5..408c5faa3e0 100644 --- a/components/select/nz-select-top-control.component.ts +++ b/components/select/nz-select-top-control.component.ts @@ -15,8 +15,9 @@ import { } from '@angular/core'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { zoomMotion } from '../core/animation/zoom'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; + +import { zoomMotion, NzNoAnimationDirective } from 'ng-zorro-antd/core'; + import { NzOptionComponent } from './nz-option.component'; import { NzSelectService } from './nz-select.service'; diff --git a/components/select/nz-select-top-control.spec.ts b/components/select/nz-select-top-control.spec.ts index 5957cb5d36d..ecb2e0b3d71 100644 --- a/components/select/nz-select-top-control.spec.ts +++ b/components/select/nz-select-top-control.spec.ts @@ -3,7 +3,9 @@ import { fakeAsync, flush, ComponentFixture, TestBed } from '@angular/core/testi import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Subject } from 'rxjs'; -import { dispatchFakeEvent } from '../core/testing'; + +import { dispatchFakeEvent } from 'ng-zorro-antd/core'; + import { createListOfOption } from './nz-option-container.spec'; import { NzSelectTopControlComponent } from './nz-select-top-control.component'; import { NzSelectModule } from './nz-select.module'; diff --git a/components/select/nz-select.component.spec.ts b/components/select/nz-select.component.spec.ts index 554fb321805..2bd536b8efa 100644 --- a/components/select/nz-select.component.spec.ts +++ b/components/select/nz-select.component.spec.ts @@ -4,7 +4,7 @@ import { async, fakeAsync, flush, inject, tick, ComponentFixture, TestBed } from import { FormsModule, FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { dispatchKeyboardEvent } from '../core/testing'; +import { dispatchKeyboardEvent } from 'ng-zorro-antd/core'; import { NzOptionComponent } from './nz-option.component'; import { OverlayContainer } from '@angular/cdk/overlay'; diff --git a/components/select/nz-select.component.ts b/components/select/nz-select.component.ts index fa134c83924..eebfb63a15d 100644 --- a/components/select/nz-select.component.ts +++ b/components/select/nz-select.component.ts @@ -25,11 +25,16 @@ import { import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { merge, EMPTY, Subject } from 'rxjs'; import { flatMap, startWith, takeUntil } from 'rxjs/operators'; -import { slideMotion } from '../core/animation/slide'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { NzSizeLDSType } from '../core/types/size'; -import { isNotNil } from '../core/util/check'; -import { toBoolean, InputBoolean } from '../core/util/convert'; + +import { + isNotNil, + slideMotion, + toBoolean, + InputBoolean, + NzNoAnimationDirective, + NzSizeLDSType +} from 'ng-zorro-antd/core'; + import { NzOptionGroupComponent } from './nz-option-group.component'; import { NzOptionComponent } from './nz-option.component'; import { TFilterOption } from './nz-option.pipe'; diff --git a/components/select/nz-select.module.ts b/components/select/nz-select.module.ts index 8fa81aeb794..7361a3197f1 100644 --- a/components/select/nz-select.module.ts +++ b/components/select/nz-select.module.ts @@ -2,12 +2,12 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; -import { NzOverlayModule } from '../core/overlay/nz-overlay.module'; -import { NzEmptyModule } from '../empty/nz-empty.module'; -import { NzI18nModule } from '../i18n/nz-i18n.module'; -import { NzIconModule } from '../icon/nz-icon.module'; + +import { NzAddOnModule, NzNoAnimationModule, NzOverlayModule } from 'ng-zorro-antd/core'; +import { NzEmptyModule } from 'ng-zorro-antd/empty'; +import { NzI18nModule } from 'ng-zorro-antd/i18n'; +import { NzIconModule } from 'ng-zorro-antd/icon'; + import { NzOptionContainerComponent } from './nz-option-container.component'; import { NzOptionGroupComponent } from './nz-option-group.component'; import { NzOptionLiComponent } from './nz-option-li.component'; diff --git a/components/select/nz-select.service.ts b/components/select/nz-select.service.ts index 7365cffa275..f12811e08ec 100644 --- a/components/select/nz-select.service.ts +++ b/components/select/nz-select.service.ts @@ -2,7 +2,9 @@ import { BACKSPACE, DOWN_ARROW, ENTER, SPACE, TAB, UP_ARROW } from '@angular/cdk import { Injectable } from '@angular/core'; import { combineLatest, merge, BehaviorSubject, ReplaySubject, Subject } from 'rxjs'; import { distinctUntilChanged, filter, map, share, skip, tap } from 'rxjs/operators'; -import { isNil, isNotNil } from '../core/util'; + +import { isNil, isNotNil } from 'ng-zorro-antd/core'; + import { NzOptionGroupComponent } from './nz-option-group.component'; import { NzOptionComponent } from './nz-option.component'; import { defaultFilterOption, NzFilterOptionPipe, TFilterOption } from './nz-option.pipe'; diff --git a/components/select/package.json b/components/select/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/select/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/select/public-api.ts b/components/select/public-api.ts index 0488f4267c7..a71bf2ce17e 100644 --- a/components/select/public-api.ts +++ b/components/select/public-api.ts @@ -3,3 +3,8 @@ export * from './nz-option-container.component'; export * from './nz-option.component'; export * from './nz-select.component'; export * from './nz-select.module'; +export * from './nz-option-li.component'; +export * from './nz-option.pipe'; +export * from './nz-select-top-control.component'; +export * from './nz-select-unselectable.directive'; +export * from './nz-select.service'; diff --git a/components/select/style/entry.less b/components/select/style/entry.less new file mode 100644 index 00000000000..517e66a923a --- /dev/null +++ b/components/select/style/entry.less @@ -0,0 +1,3 @@ +@import './index.less'; +// style dependencies +@import '../../empty/style/index.less'; diff --git a/components/skeleton/doc/index.en-US.md b/components/skeleton/doc/index.en-US.md index df9f4993832..92e4c772582 100644 --- a/components/skeleton/doc/index.en-US.md +++ b/components/skeleton/doc/index.en-US.md @@ -14,6 +14,14 @@ Provide a placeholder at the place which need waiting for loading. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzSkeletonModule } from 'ng-zorro-antd'; +``` + ### nz-skeleton | Property | Description | Type | Default | diff --git a/components/skeleton/doc/index.zh-CN.md b/components/skeleton/doc/index.zh-CN.md index f0107358bbe..acdce3f755c 100644 --- a/components/skeleton/doc/index.zh-CN.md +++ b/components/skeleton/doc/index.zh-CN.md @@ -16,6 +16,14 @@ cols: 1 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzSkeletonModule } from 'ng-zorro-antd'; +``` + ### nz-skeleton | 属性 | 说明 | 类型 | 默认值 | diff --git a/components/skeleton/nz-skeleton.component.ts b/components/skeleton/nz-skeleton.component.ts index 49d4d3fe4f7..5e46000e0c1 100644 --- a/components/skeleton/nz-skeleton.component.ts +++ b/components/skeleton/nz-skeleton.component.ts @@ -11,7 +11,7 @@ import { ViewEncapsulation } from '@angular/core'; -import { toCssPixel } from '../core/util'; +import { toCssPixel } from 'ng-zorro-antd/core'; import { AvatarShape, AvatarSize, NzSkeletonAvatar, NzSkeletonParagraph, NzSkeletonTitle } from './nz-skeleton.type'; @Component({ diff --git a/components/skeleton/package.json b/components/skeleton/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/skeleton/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/skeleton/style/entry.less b/components/skeleton/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/skeleton/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/slider/doc/index.en-US.md b/components/slider/doc/index.en-US.md index e24f2c21641..c5f7760c9bb 100644 --- a/components/slider/doc/index.en-US.md +++ b/components/slider/doc/index.en-US.md @@ -12,6 +12,14 @@ To input a value in a range. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzSliderModule } from 'ng-zorro-antd'; +``` + ### nz-slider | Property | Description | Type | Default | diff --git a/components/slider/doc/index.zh-CN.md b/components/slider/doc/index.zh-CN.md index 770082cc834..53a684376bf 100644 --- a/components/slider/doc/index.zh-CN.md +++ b/components/slider/doc/index.zh-CN.md @@ -13,6 +13,14 @@ title: Slider ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzSliderModule } from 'ng-zorro-antd'; +``` + ### nz-slider | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/slider/nz-slider-handle.component.ts b/components/slider/nz-slider-handle.component.ts index e062f82769b..d638a080c4b 100644 --- a/components/slider/nz-slider-handle.component.ts +++ b/components/slider/nz-slider-handle.component.ts @@ -10,10 +10,9 @@ import { ViewEncapsulation } from '@angular/core'; import { Subscription } from 'rxjs'; -import { NGStyleInterface } from '../core/types/ng-class'; -import { InputBoolean } from '../core/util/convert'; -import { NzToolTipComponent } from '../tooltip/nz-tooltip.component'; +import { InputBoolean, NGStyleInterface } from 'ng-zorro-antd/core'; +import { NzToolTipComponent } from 'ng-zorro-antd/tooltip'; import { SliderShowTooltip } from './nz-slider-definitions'; import { NzSliderComponent } from './nz-slider.component'; diff --git a/components/slider/nz-slider-marks.component.ts b/components/slider/nz-slider-marks.component.ts index a09a8aa031c..0e879c0b52e 100644 --- a/components/slider/nz-slider-marks.component.ts +++ b/components/slider/nz-slider-marks.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean } from 'ng-zorro-antd/core'; import { isConfigAObject, DisplayedMark, ExtendedMark, Mark } from './nz-slider-definitions'; diff --git a/components/slider/nz-slider-step.component.ts b/components/slider/nz-slider-step.component.ts index 001d7703d41..11972bc1f2a 100644 --- a/components/slider/nz-slider-step.component.ts +++ b/components/slider/nz-slider-step.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean } from 'ng-zorro-antd/core'; import { DisplayedStep, ExtendedMark } from './nz-slider-definitions'; diff --git a/components/slider/nz-slider-track.component.ts b/components/slider/nz-slider-track.component.ts index 232796bad99..f2cfa86c466 100644 --- a/components/slider/nz-slider-track.component.ts +++ b/components/slider/nz-slider-track.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core'; -import { InputBoolean, InputNumber } from '../core/util/convert'; +import { InputBoolean, InputNumber } from 'ng-zorro-antd/core'; export interface NzSliderTrackStyle { bottom?: string | null; diff --git a/components/slider/nz-slider.component.ts b/components/slider/nz-slider.component.ts index 69e567b8382..0ada3543f1a 100644 --- a/components/slider/nz-slider.component.ts +++ b/components/slider/nz-slider.component.ts @@ -18,11 +18,17 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { fromEvent, merge, Observable, Subscription } from 'rxjs'; import { distinctUntilChanged, filter, map, pluck, takeUntil, tap } from 'rxjs/operators'; -import { InputBoolean } from '../core/util/convert'; -import { getElementOffset, silentEvent, MouseTouchObserverConfig } from '../core/util/dom'; - -import { arraysEqual, shallowCopyArray } from '../core/util/array'; -import { ensureNumberInRange, getPercent, getPrecision } from '../core/util/number'; +import { + arraysEqual, + ensureNumberInRange, + getElementOffset, + getPercent, + getPrecision, + shallowCopyArray, + silentEvent, + InputBoolean, + MouseTouchObserverConfig +} from 'ng-zorro-antd/core'; import { isValueARange, diff --git a/components/slider/nz-slider.module.ts b/components/slider/nz-slider.module.ts index a7e167b3810..64ca87e7cc3 100644 --- a/components/slider/nz-slider.module.ts +++ b/components/slider/nz-slider.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzToolTipModule } from '../tooltip/nz-tooltip.module'; +import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; import { NzSliderHandleComponent } from './nz-slider-handle.component'; import { NzSliderMarksComponent } from './nz-slider-marks.component'; diff --git a/components/slider/nz-slider.spec.ts b/components/slider/nz-slider.spec.ts index 80f1e8ecc55..b09070de709 100644 --- a/components/slider/nz-slider.spec.ts +++ b/components/slider/nz-slider.spec.ts @@ -5,7 +5,7 @@ import { AbstractControl, FormsModule, FormBuilder, FormGroup, ReactiveFormsModu import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { dispatchMouseEvent } from '../core/testing'; +import { dispatchMouseEvent } from 'ng-zorro-antd/core'; import { SliderShowTooltip } from './nz-slider-definitions'; import { NzSliderComponent } from './nz-slider.component'; import { NzSliderModule } from './nz-slider.module'; diff --git a/components/slider/package.json b/components/slider/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/slider/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/slider/style/entry.less b/components/slider/style/entry.less new file mode 100644 index 00000000000..fca13534209 --- /dev/null +++ b/components/slider/style/entry.less @@ -0,0 +1,3 @@ +@import './index.less'; +// style dependencies +@import '../../tooltip/style/index.less'; diff --git a/components/spin/doc/index.en-US.md b/components/spin/doc/index.en-US.md index afeab7a8b29..67c3fd76cf4 100644 --- a/components/spin/doc/index.en-US.md +++ b/components/spin/doc/index.en-US.md @@ -12,6 +12,14 @@ When part of the page is waiting for asynchronous data or during a rendering pro ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzSpinModule } from 'ng-zorro-antd'; +``` + ### nz-spin | Property | Description | Type | Default Value | diff --git a/components/spin/doc/index.zh-CN.md b/components/spin/doc/index.zh-CN.md index 82411527349..a8dffa143cd 100644 --- a/components/spin/doc/index.zh-CN.md +++ b/components/spin/doc/index.zh-CN.md @@ -13,6 +13,14 @@ subtitle: 加载中 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzSpinModule } from 'ng-zorro-antd'; +``` + ### nz-spin | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/spin/nz-spin.component.ts b/components/spin/nz-spin.component.ts index d24d2931e07..03137d0715c 100644 --- a/components/spin/nz-spin.component.ts +++ b/components/spin/nz-spin.component.ts @@ -12,9 +12,8 @@ import { } from '@angular/core'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { NzSizeLDSType } from '../core/types/size'; -import { InputBoolean, InputNumber } from '../core/util/convert'; +import { InputBoolean, InputNumber, NzSizeLDSType } from 'ng-zorro-antd/core'; @Component({ selector: 'nz-spin', diff --git a/components/spin/package.json b/components/spin/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/spin/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/spin/style/entry.less b/components/spin/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/spin/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/statistic/doc/index.en-US.md b/components/statistic/doc/index.en-US.md index b90e46cee2a..254bd92501d 100644 --- a/components/statistic/doc/index.en-US.md +++ b/components/statistic/doc/index.en-US.md @@ -13,6 +13,14 @@ Display statistic number. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzStatisticModule } from 'ng-zorro-antd'; +``` + ### nz-statistic | Property | Description | Type | Default | diff --git a/components/statistic/doc/index.zh-CN.md b/components/statistic/doc/index.zh-CN.md index 5a5bc0791f5..38c93b09ef1 100644 --- a/components/statistic/doc/index.zh-CN.md +++ b/components/statistic/doc/index.zh-CN.md @@ -14,6 +14,14 @@ type: Data Display ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzStatisticModule } from 'ng-zorro-antd'; +``` + ### nz-statistic | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/statistic/nz-statistic.module.ts b/components/statistic/nz-statistic.module.ts index 687841af8dd..98a5245b257 100644 --- a/components/statistic/nz-statistic.module.ts +++ b/components/statistic/nz-statistic.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; import { NzCountdownComponent } from './nz-countdown.component'; import { NzStatisticNumberComponent } from './nz-statistic-number.component'; import { NzStatisticComponent } from './nz-statistic.component'; diff --git a/components/statistic/nz-time-range.pipe.ts b/components/statistic/nz-time-range.pipe.ts index aca1c1c2a7f..4d493d734b1 100644 --- a/components/statistic/nz-time-range.pipe.ts +++ b/components/statistic/nz-time-range.pipe.ts @@ -1,5 +1,5 @@ import { Pipe, PipeTransform } from '@angular/core'; -import { padStart, timeUnits } from '../core/util'; +import { padStart, timeUnits } from 'ng-zorro-antd/core'; @Pipe({ name: 'nzTimeRange', diff --git a/components/statistic/package.json b/components/statistic/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/statistic/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/statistic/public-api.ts b/components/statistic/public-api.ts index a8402dfb125..15ae2831036 100644 --- a/components/statistic/public-api.ts +++ b/components/statistic/public-api.ts @@ -1,3 +1,5 @@ export * from './nz-countdown.component'; export * from './nz-statistic.component'; export * from './nz-statistic.module'; +export * from './nz-statistic-number.component'; +export * from './nz-time-range.pipe'; diff --git a/components/statistic/style/entry.less b/components/statistic/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/statistic/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/steps/doc/index.en-US.md b/components/steps/doc/index.en-US.md index d1584cb02da..ffece312edb 100755 --- a/components/steps/doc/index.en-US.md +++ b/components/steps/doc/index.en-US.md @@ -21,6 +21,14 @@ When the task is complicated or has a certain sequence in the series of subtasks ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzStepsModule } from 'ng-zorro-antd'; +``` + ### nz-steps The whole of the step bar. diff --git a/components/steps/doc/index.zh-CN.md b/components/steps/doc/index.zh-CN.md index b2324b2e78c..6b4e6709050 100755 --- a/components/steps/doc/index.zh-CN.md +++ b/components/steps/doc/index.zh-CN.md @@ -22,6 +22,14 @@ title: Steps ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzStepsModule } from 'ng-zorro-antd'; +``` + ### nz-steps 整体步骤条。 diff --git a/components/steps/nz-step.component.ts b/components/steps/nz-step.component.ts index 2101de68005..10fee5c6daf 100644 --- a/components/steps/nz-step.component.ts +++ b/components/steps/nz-step.component.ts @@ -10,7 +10,7 @@ import { ViewEncapsulation } from '@angular/core'; -import { NgClassType } from '../core/types/ng-class'; +import { NgClassType } from 'ng-zorro-antd/core'; @Component({ changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/components/steps/nz-steps.component.ts b/components/steps/nz-steps.component.ts index 44af336e36c..6a012ca31e2 100644 --- a/components/steps/nz-steps.component.ts +++ b/components/steps/nz-steps.component.ts @@ -15,9 +15,7 @@ import { import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { NgClassType } from '../core/types/ng-class'; -import { NzSizeDSType } from '../core/types/size'; -import { toBoolean } from '../core/util/convert'; +import { toBoolean, NgClassType, NzSizeDSType } from 'ng-zorro-antd/core'; import { NzStepComponent } from './nz-step.component'; diff --git a/components/steps/nz-steps.module.ts b/components/steps/nz-steps.module.ts index 1a01d1cff1d..553b11b7635 100644 --- a/components/steps/nz-steps.module.ts +++ b/components/steps/nz-steps.module.ts @@ -1,8 +1,8 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzStepComponent } from './nz-step.component'; import { NzStepsComponent } from './nz-steps.component'; diff --git a/components/steps/package.json b/components/steps/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/steps/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/steps/style/entry.less b/components/steps/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/steps/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/switch/doc/index.en-US.md b/components/switch/doc/index.en-US.md index 185ad274b2a..37a3fe3ac1b 100755 --- a/components/switch/doc/index.en-US.md +++ b/components/switch/doc/index.en-US.md @@ -13,6 +13,14 @@ Switching Selector. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzSwitchModule } from 'ng-zorro-antd'; +``` + ### nz-switch | Property | Description | Type | Default | diff --git a/components/switch/doc/index.zh-CN.md b/components/switch/doc/index.zh-CN.md index 0a264cb96a5..6251944f5c7 100755 --- a/components/switch/doc/index.zh-CN.md +++ b/components/switch/doc/index.zh-CN.md @@ -14,6 +14,14 @@ title: Switch ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzSwitchModule } from 'ng-zorro-antd'; +``` + ### nz-switch | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/switch/nz-switch.component.ts b/components/switch/nz-switch.component.ts index a3539c272e8..8e6b7527ca1 100644 --- a/components/switch/nz-switch.component.ts +++ b/components/switch/nz-switch.component.ts @@ -13,9 +13,8 @@ import { ViewEncapsulation } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { NzSizeDSType } from '../core/types/size'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean, NzSizeDSType } from 'ng-zorro-antd/core'; @Component({ selector: 'nz-switch', diff --git a/components/switch/nz-switch.module.ts b/components/switch/nz-switch.module.ts index 95ce1f9b8b2..abc789cc926 100644 --- a/components/switch/nz-switch.module.ts +++ b/components/switch/nz-switch.module.ts @@ -1,8 +1,8 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzWaveModule } from '../core/wave/nz-wave.module'; -import { NzIconModule } from '../icon/nz-icon.module'; + +import { NzAddOnModule, NzWaveModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzSwitchComponent } from './nz-switch.component'; diff --git a/components/switch/nz-switch.spec.ts b/components/switch/nz-switch.spec.ts index 14c8a901048..b57eb249c2b 100644 --- a/components/switch/nz-switch.spec.ts +++ b/components/switch/nz-switch.spec.ts @@ -4,7 +4,7 @@ import { fakeAsync, flush, ComponentFixture, TestBed } from '@angular/core/testi import { FormsModule, FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { dispatchKeyboardEvent } from '../core/testing'; +import { dispatchKeyboardEvent } from 'ng-zorro-antd/core'; import { NzIconTestModule } from '../icon/nz-icon-test.module'; import { NzSwitchComponent } from './nz-switch.component'; diff --git a/components/switch/package.json b/components/switch/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/switch/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/switch/style/entry.less b/components/switch/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/switch/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/table/doc/index.en-US.md b/components/table/doc/index.en-US.md index 16636f6339f..ad461c59f20 100644 --- a/components/table/doc/index.en-US.md +++ b/components/table/doc/index.en-US.md @@ -55,6 +55,14 @@ The data passed to `[nzData]` will be export with [Template Context](https://ang ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzTableModule } from 'ng-zorro-antd'; +``` + ### nz-table | Property | Description | Type | Default | diff --git a/components/table/doc/index.zh-CN.md b/components/table/doc/index.zh-CN.md index 9943325efd6..baac7db7e8b 100644 --- a/components/table/doc/index.zh-CN.md +++ b/components/table/doc/index.zh-CN.md @@ -56,6 +56,14 @@ Table 组件同时具备了易用性和高度可定制性 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzTableModule } from 'ng-zorro-antd'; +``` + ### nz-table | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/table/nz-table.component.ts b/components/table/nz-table.component.ts index 83e11beb8b6..4ceaf5f9581 100644 --- a/components/table/nz-table.component.ts +++ b/components/table/nz-table.component.ts @@ -24,10 +24,10 @@ import { } from '@angular/core'; import { fromEvent, merge, EMPTY, Subject } from 'rxjs'; import { flatMap, startWith, takeUntil } from 'rxjs/operators'; -import { NzMeasureScrollbarService } from '../core/services/nz-measure-scrollbar.service'; -import { NzSizeMDSType } from '../core/types/size'; -import { InputBoolean, InputNumber } from '../core/util/convert'; -import { NzI18nService } from '../i18n/nz-i18n.service'; + +import { InputBoolean, InputNumber, NzMeasureScrollbarService, NzSizeMDSType } from 'ng-zorro-antd/core'; +import { NzI18nService } from 'ng-zorro-antd/i18n'; + import { NzThComponent } from './nz-th.component'; import { NzTheadComponent } from './nz-thead.component'; import { NzVirtualScrollDirective } from './nz-virtual-scroll.directive'; diff --git a/components/table/nz-table.module.ts b/components/table/nz-table.module.ts index ef03709c979..a1a28237def 100644 --- a/components/table/nz-table.module.ts +++ b/components/table/nz-table.module.ts @@ -2,16 +2,17 @@ import { ScrollingModule } from '@angular/cdk/scrolling'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzCheckboxModule } from '../checkbox/nz-checkbox.module'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzDropDownModule } from '../dropdown/nz-dropdown.module'; -import { NzEmptyModule } from '../empty/nz-empty.module'; -import { NzI18nModule } from '../i18n/nz-i18n.module'; -import { NzIconModule } from '../icon/nz-icon.module'; -import { NzMenuModule } from '../menu/nz-menu.module'; -import { NzPaginationModule } from '../pagination/nz-pagination.module'; -import { NzRadioModule } from '../radio/nz-radio.module'; -import { NzSpinModule } from '../spin/nz-spin.module'; + +import { NzCheckboxModule } from 'ng-zorro-antd/checkbox'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; +import { NzDropDownModule } from 'ng-zorro-antd/dropdown'; +import { NzEmptyModule } from 'ng-zorro-antd/empty'; +import { NzI18nModule } from 'ng-zorro-antd/i18n'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzMenuModule } from 'ng-zorro-antd/menu'; +import { NzPaginationModule } from 'ng-zorro-antd/pagination'; +import { NzRadioModule } from 'ng-zorro-antd/radio'; +import { NzSpinModule } from 'ng-zorro-antd/spin'; import { NzTableComponent } from './nz-table.component'; import { NzTbodyDirective } from './nz-tbody.directive'; diff --git a/components/table/nz-tbody.spec.ts b/components/table/nz-tbody.spec.ts index 47d4486b788..79a8b745663 100644 --- a/components/table/nz-tbody.spec.ts +++ b/components/table/nz-tbody.spec.ts @@ -1,7 +1,7 @@ import { Component, DebugElement } from '@angular/core'; import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { NzMeasureScrollbarService } from '../core/services/nz-measure-scrollbar.service'; +import { NzMeasureScrollbarService } from 'ng-zorro-antd/core'; import { NzTableModule } from './nz-table.module'; import { NzTbodyDirective } from './nz-tbody.directive'; diff --git a/components/table/nz-td.component.ts b/components/table/nz-td.component.ts index cae8f23f3cf..1b44431f838 100644 --- a/components/table/nz-td.component.ts +++ b/components/table/nz-td.component.ts @@ -9,10 +9,8 @@ import { SimpleChanges, ViewEncapsulation } from '@angular/core'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { isNotNil } from '../core/util/check'; -import { InputBoolean } from '../core/util/convert'; +import { isNotNil, InputBoolean, NzUpdateHostClassService } from 'ng-zorro-antd/core'; @Component({ // tslint:disable-next-line:component-selector diff --git a/components/table/nz-td.spec.ts b/components/table/nz-td.spec.ts index 30bb599e3cc..d619ed013ea 100644 --- a/components/table/nz-td.spec.ts +++ b/components/table/nz-td.spec.ts @@ -2,8 +2,10 @@ import { Component, DebugElement } from '@angular/core'; import { fakeAsync, flush, ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { NzCheckboxModule } from '../checkbox'; -import { createFakeEvent } from '../core/testing'; + +import { NzCheckboxModule } from 'ng-zorro-antd/checkbox'; +import { createFakeEvent } from 'ng-zorro-antd/core'; + import { NzTdComponent } from './nz-td.component'; describe('nz-td', () => { diff --git a/components/table/nz-th.component.ts b/components/table/nz-th.component.ts index cb3a77b3d82..90fc7427b1f 100644 --- a/components/table/nz-th.component.ts +++ b/components/table/nz-th.component.ts @@ -14,11 +14,10 @@ import { } from '@angular/core'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { isNotNil } from '../core/util/check'; -import { InputBoolean } from '../core/util/convert'; -import { NzDropDownComponent } from '../dropdown/nz-dropdown.component'; -import { NzI18nInterface } from '../i18n/nz-i18n.interface'; -import { NzI18nService } from '../i18n/nz-i18n.service'; + +import { isNotNil, InputBoolean } from 'ng-zorro-antd/core'; +import { NzDropDownComponent } from 'ng-zorro-antd/dropdown'; +import { NzI18nInterface, NzI18nService } from 'ng-zorro-antd/i18n'; /* tslint:disable-next-line:no-any */ export type NzThFilterType = Array<{ text: string; value: any; byDefault?: boolean }>; diff --git a/components/table/nz-thead.component.ts b/components/table/nz-thead.component.ts index 3b0faeb1922..d9ef71b047b 100644 --- a/components/table/nz-thead.component.ts +++ b/components/table/nz-thead.component.ts @@ -17,10 +17,11 @@ import { ViewChild, ViewEncapsulation } from '@angular/core'; - import { merge, Subject } from 'rxjs'; import { flatMap, startWith, takeUntil } from 'rxjs/operators'; -import { InputBoolean } from '../core/util/convert'; + +import { InputBoolean } from 'ng-zorro-antd/core'; + import { NzTableComponent } from './nz-table.component'; import { NzThComponent } from './nz-th.component'; diff --git a/components/table/nz-thead.spec.ts b/components/table/nz-thead.spec.ts index 614a63e52cd..0109e24aee5 100644 --- a/components/table/nz-thead.spec.ts +++ b/components/table/nz-thead.spec.ts @@ -1,7 +1,7 @@ import { Component, DebugElement } from '@angular/core'; import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { NzMeasureScrollbarService } from '../core/services/nz-measure-scrollbar.service'; +import { NzMeasureScrollbarService } from 'ng-zorro-antd/core'; import { NzIconTestModule } from '../icon/nz-icon-test.module'; import { NzTableComponent } from './nz-table.component'; import { NzTableModule } from './nz-table.module'; diff --git a/components/table/nz-tr.directive.ts b/components/table/nz-tr.directive.ts index 06d43cab44c..11b0c5eddd9 100644 --- a/components/table/nz-tr.directive.ts +++ b/components/table/nz-tr.directive.ts @@ -1,5 +1,5 @@ import { Directive, ElementRef, Host, Input, Optional, Renderer2 } from '@angular/core'; -import { toBoolean } from '../core/util/convert'; +import { toBoolean } from 'ng-zorro-antd/core'; import { NzTableComponent } from './nz-table.component'; @Directive({ diff --git a/components/table/nz-tr.spec.ts b/components/table/nz-tr.spec.ts index 425c2ac6c3e..1c12ef291d3 100644 --- a/components/table/nz-tr.spec.ts +++ b/components/table/nz-tr.spec.ts @@ -1,7 +1,7 @@ import { Component, DebugElement } from '@angular/core'; import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { NzMeasureScrollbarService } from '../core/services/nz-measure-scrollbar.service'; +import { NzMeasureScrollbarService } from 'ng-zorro-antd/core'; import { NzTableModule } from './nz-table.module'; import { NzTrDirective } from './nz-tr.directive'; diff --git a/components/table/package.json b/components/table/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/table/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/table/public-api.ts b/components/table/public-api.ts index 39bda9bb7f4..1c0f96a8f0e 100644 --- a/components/table/public-api.ts +++ b/components/table/public-api.ts @@ -5,3 +5,4 @@ export * from './nz-td.component'; export * from './nz-th.component'; export * from './nz-thead.component'; export * from './nz-tr.directive'; +export * from './nz-virtual-scroll.directive'; diff --git a/components/table/style/entry.less b/components/table/style/entry.less new file mode 100644 index 00000000000..d89fc8c6485 --- /dev/null +++ b/components/table/style/entry.less @@ -0,0 +1,10 @@ +@import './index.less'; +@import './patch.less'; +// style dependencies +// deps-lint-skip: menu +@import '../../empty/style/index.less'; +@import '../../radio/style/index.less'; +@import '../../checkbox/style/index.less'; +@import '../../dropdown/style/index.less'; +@import '../../spin/style/index.less'; +@import '../../pagination/style/index.less'; diff --git a/components/table/style/patch.less b/components/table/style/patch.less new file mode 100644 index 00000000000..3f22f699412 --- /dev/null +++ b/components/table/style/patch.less @@ -0,0 +1,144 @@ +@import "./size"; + +@table-prefix-cls: ~'@{ant-prefix}-table'; +@table-td-cls: ~'@{table-prefix-cls}-td'; +@table-th-cls: ~'@{table-prefix-cls}-th'; +@table-th-left-cls: ~'@{table-th-cls}-left'; +@table-th-right-cls: ~'@{table-th-cls}-right'; +@table-td-left-cls: ~'@{table-td-cls}-left'; +@table-td-right-cls: ~'@{table-td-cls}-right'; + +.box-shadow-left() { + .@{table-th-right-cls}-sticky, + .@{table-td-right-cls}-sticky { + box-shadow: -6px 0 6px 0px rgba(0, 0, 0, .05); + } +} + +.box-shadow-right() { + .@{table-th-left-cls}-sticky, + .@{table-td-left-cls}-sticky { + box-shadow: 6px 0 6px 0px rgba(0, 0, 0, .05); + } +} + +.border-left() { + .@{table-th-right-cls}-sticky, + .@{table-td-right-cls}-sticky { + border-right: @border-width-base @border-style-base @border-color-split; + } +} + +.border-right() { + .@{table-th-left-cls}-sticky, + .@{table-td-left-cls}-sticky { + border-left: @border-width-base @border-style-base @border-color-split; + } +} + +.@{table-prefix-cls}-scroll-position-middle, +.@{table-prefix-cls}-scroll-position-left { + .@{table-td-right-cls}-sticky + .@{table-td-right-cls}-sticky { + box-shadow: none; + } + + .@{table-th-right-cls}-sticky + .@{table-th-right-cls}-sticky { + box-shadow: none; + } +} + + +.@{table-th-left-cls}-sticky, +.@{table-th-right-cls}-sticky, +.@{table-td-right-cls}-sticky, +.@{table-td-left-cls}-sticky { + position: sticky !important; + z-index: 1; +} + +.@{table-td-left-cls}-sticky, +.@{table-td-right-cls}-sticky { + background: @component-background; +} + +.@{table-prefix-cls}-tbody { + & > tr { + &:hover { + & > td { + &.@{table-td-left-cls}-sticky { + background: @table-row-hover-bg; + } + + &.@{table-td-right-cls}-sticky { + background: @table-row-hover-bg; + } + } + } + } +} + +.@{table-prefix-cls}-thead > tr > th .@{table-prefix-cls}-column-sorters > nz-dropdown { + position: static !important; +} + +.@{table-prefix-cls}-scroll-position-middle { + .box-shadow-right; + .box-shadow-left; +} + +.@{table-prefix-cls}-scroll-position-left { + .box-shadow-left; +} + +.@{table-prefix-cls}-scroll-position-right { + .box-shadow-right; +} + +.@{table-prefix-cls}-bordered { + &.@{table-prefix-cls}-scroll-position-middle { + .border-right; + .border-left; + } + + &.@{table-prefix-cls}-scroll-position-left { + .border-left; + } + + &.@{table-prefix-cls}-scroll-position-right { + .border-right; + } +} + + +.@{table-prefix-cls}-middle { + > .@{table-prefix-cls}-content { + > .@{table-prefix-cls}-scroll > .@{table-prefix-cls}-body > .cdk-virtual-scroll-content-wrapper > table { + > .@{table-prefix-cls}-thead > tr > th, + > .@{table-prefix-cls}-tbody > tr > td { + padding: @table-padding-vertical-md @table-padding-horizontal-md; + } + } + } +} + +.@{table-prefix-cls}-small { + > .@{table-prefix-cls}-content { + > .@{table-prefix-cls}-scroll > .@{table-prefix-cls}-header > table, + > .@{table-prefix-cls}-scroll > .@{table-prefix-cls}-body > table, + > .@{table-prefix-cls}-scroll > .@{table-prefix-cls}-body > .cdk-virtual-scroll-content-wrapper > table { + border: 0; + + > .@{table-prefix-cls}-thead > tr > th { + &.@{table-th-left-cls}-sticky, + &.@{table-th-right-cls}-sticky { + background: @component-background; + } + } + + > .@{table-prefix-cls}-thead > tr > th, + > .@{table-prefix-cls}-tbody > tr > td { + padding: @table-padding-vertical-sm @table-padding-horizontal-sm; + } + } + } +} diff --git a/components/tabs/doc/index.en-US.md b/components/tabs/doc/index.en-US.md index 2f1bea4ee00..0a59cd0de7d 100644 --- a/components/tabs/doc/index.en-US.md +++ b/components/tabs/doc/index.en-US.md @@ -17,6 +17,14 @@ Ant Design has 3 types of Tabs for different situations. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzTabsModule } from 'ng-zorro-antd'; +``` + ### nz-tabset | Property | Description | Type | Default | diff --git a/components/tabs/doc/index.zh-CN.md b/components/tabs/doc/index.zh-CN.md index 6a2f3cee188..e1d28cba1b4 100644 --- a/components/tabs/doc/index.zh-CN.md +++ b/components/tabs/doc/index.zh-CN.md @@ -20,6 +20,14 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzTabsModule } from 'ng-zorro-antd'; +``` + ### nz-tabset | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/tabs/nz-tab-label.directive.ts b/components/tabs/nz-tab-label.directive.ts index 6030553e292..64c3737341b 100644 --- a/components/tabs/nz-tab-label.directive.ts +++ b/components/tabs/nz-tab-label.directive.ts @@ -1,6 +1,6 @@ import { Directive, ElementRef, Input, Renderer2 } from '@angular/core'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean } from 'ng-zorro-antd/core'; @Directive({ selector: '[nz-tab-label]', diff --git a/components/tabs/nz-tab.component.ts b/components/tabs/nz-tab.component.ts index 92cac2add07..62d80a9c6b6 100644 --- a/components/tabs/nz-tab.component.ts +++ b/components/tabs/nz-tab.component.ts @@ -16,7 +16,7 @@ import { } from '@angular/core'; import { Subject } from 'rxjs'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean } from 'ng-zorro-antd/core'; import { NzTabDirective } from './nz-tab.directive'; @Component({ diff --git a/components/tabs/nz-tabs-ink-bar.directive.ts b/components/tabs/nz-tabs-ink-bar.directive.ts index e1a74696960..3f6f29d0a85 100755 --- a/components/tabs/nz-tabs-ink-bar.directive.ts +++ b/components/tabs/nz-tabs-ink-bar.directive.ts @@ -1,6 +1,6 @@ import { Directive, ElementRef, Input, NgZone, Renderer2 } from '@angular/core'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean } from 'ng-zorro-antd/core'; import { NzTabPositionMode } from './nz-tabset.component'; diff --git a/components/tabs/nz-tabs-nav.component.ts b/components/tabs/nz-tabs-nav.component.ts index 51989382e2e..c152929b5f2 100644 --- a/components/tabs/nz-tabs-nav.component.ts +++ b/components/tabs/nz-tabs-nav.component.ts @@ -22,7 +22,7 @@ import { import { fromEvent, merge, of as observableOf, Subscription } from 'rxjs'; import { auditTime, startWith } from 'rxjs/operators'; -import { InputBoolean } from '../core/util/convert'; +import { InputBoolean } from 'ng-zorro-antd/core'; import { NzTabLabelDirective } from './nz-tab-label.directive'; import { NzTabsInkBarDirective } from './nz-tabs-ink-bar.directive'; diff --git a/components/tabs/nz-tabs-nav.spec.ts b/components/tabs/nz-tabs-nav.spec.ts index e9300e0d8b2..22f65933db0 100644 --- a/components/tabs/nz-tabs-nav.spec.ts +++ b/components/tabs/nz-tabs-nav.spec.ts @@ -7,7 +7,7 @@ import { async, discardPeriodicTasks, fakeAsync, tick, ComponentFixture, TestBed import { By } from '@angular/platform-browser'; import { Subject } from 'rxjs'; -import { dispatchFakeEvent } from '../core/testing'; +import { dispatchFakeEvent } from 'ng-zorro-antd/core'; import { NzTabsNavComponent } from './nz-tabs-nav.component'; import { NzTabsModule } from './nz-tabs.module'; diff --git a/components/tabs/nz-tabs.module.ts b/components/tabs/nz-tabs.module.ts index f42f4a93df6..0f4ce85cec2 100644 --- a/components/tabs/nz-tabs.module.ts +++ b/components/tabs/nz-tabs.module.ts @@ -1,8 +1,8 @@ import { ObserversModule } from '@angular/cdk/observers'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzTabBodyComponent } from './nz-tab-body.component'; import { NzTabLabelDirective } from './nz-tab-label.directive'; diff --git a/components/tabs/nz-tabs.spec.ts b/components/tabs/nz-tabs.spec.ts index 6a815e7330d..370711972d5 100644 --- a/components/tabs/nz-tabs.spec.ts +++ b/components/tabs/nz-tabs.spec.ts @@ -1,7 +1,7 @@ import { Component, DebugElement, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core'; import { fakeAsync, tick, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { NGStyleInterface } from '../core/types/ng-class'; +import { NGStyleInterface } from 'ng-zorro-antd/core'; import { NzTabsModule } from './nz-tabs.module'; import { NzAnimatedInterface, NzTabSetComponent } from './nz-tabset.component'; diff --git a/components/tabs/nz-tabset.component.ts b/components/tabs/nz-tabset.component.ts index fa4d0bcb023..267e7183e84 100644 --- a/components/tabs/nz-tabset.component.ts +++ b/components/tabs/nz-tabset.component.ts @@ -24,9 +24,7 @@ import { } from '@angular/core'; import { merge, Subscription } from 'rxjs'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { NzSizeLDSType } from '../core/types/size'; -import { toNumber } from '../core/util/convert'; +import { toNumber, NzSizeLDSType, NzUpdateHostClassService } from 'ng-zorro-antd/core'; import { NzTabComponent } from './nz-tab.component'; import { NzTabsNavComponent } from './nz-tabs-nav.component'; diff --git a/components/tabs/package.json b/components/tabs/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/tabs/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/tabs/public-api.ts b/components/tabs/public-api.ts index 2627f1c2182..339215addd2 100644 --- a/components/tabs/public-api.ts +++ b/components/tabs/public-api.ts @@ -5,3 +5,4 @@ export * from './nz-tabs-ink-bar.directive'; export * from './nz-tabs.module'; export * from './nz-tabs-nav.component'; export * from './nz-tabset.component'; +export * from './nz-tab.directive'; diff --git a/components/tabs/style/entry.less b/components/tabs/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/tabs/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/tag/doc/index.en-US.md b/components/tag/doc/index.en-US.md index c148b290256..7856a92515f 100644 --- a/components/tag/doc/index.en-US.md +++ b/components/tag/doc/index.en-US.md @@ -14,6 +14,14 @@ Tag for categorizing or markup. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzTagModule } from 'ng-zorro-antd'; +``` + ### Tag | Property | Description | Type | Default | diff --git a/components/tag/doc/index.zh-CN.md b/components/tag/doc/index.zh-CN.md index 343010bb899..69de28a5882 100644 --- a/components/tag/doc/index.zh-CN.md +++ b/components/tag/doc/index.zh-CN.md @@ -14,6 +14,16 @@ title: Tag ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +```ts +import { NzTagModule } from 'ng-zorro-antd'; +``` +``` + ### nz-tag | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/tag/nz-tag.component.ts b/components/tag/nz-tag.component.ts index 066eea40b63..71d6a4c40be 100644 --- a/components/tag/nz-tag.component.ts +++ b/components/tag/nz-tag.component.ts @@ -11,9 +11,8 @@ import { Renderer2, ViewEncapsulation } from '@angular/core'; -import { fadeMotion } from '../core/animation/fade'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; -import { InputBoolean } from '../core/util/convert'; + +import { fadeMotion, InputBoolean, NzUpdateHostClassService } from 'ng-zorro-antd/core'; @Component({ selector: 'nz-tag', diff --git a/components/tag/nz-tag.module.ts b/components/tag/nz-tag.module.ts index 3a83a506ac1..fa1ff2ecaa0 100644 --- a/components/tag/nz-tag.module.ts +++ b/components/tag/nz-tag.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzTagComponent } from './nz-tag.component'; diff --git a/components/tag/package.json b/components/tag/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/tag/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/tag/style/entry.less b/components/tag/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/tag/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/time-picker/doc/index.en-US.md b/components/time-picker/doc/index.en-US.md index d50b34d305f..9b022b10929 100644 --- a/components/time-picker/doc/index.en-US.md +++ b/components/time-picker/doc/index.en-US.md @@ -16,6 +16,14 @@ By clicking the input box, you can select a time from a popup panel. ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzTimePickerModule } from 'ng-zorro-antd'; +``` + ### nz-time-picker | Property | Description | Type | Default | diff --git a/components/time-picker/doc/index.zh-CN.md b/components/time-picker/doc/index.zh-CN.md index ee398e4f421..6fe9fa83288 100644 --- a/components/time-picker/doc/index.zh-CN.md +++ b/components/time-picker/doc/index.zh-CN.md @@ -17,6 +17,14 @@ title: TimePicker ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzTimePickerModule } from 'ng-zorro-antd'; +``` + ### nz-time-picker | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/time-picker/nz-time-picker-panel.component.ts b/components/time-picker/nz-time-picker-panel.component.ts index 6e3c38040b8..a8a3ac99642 100644 --- a/components/time-picker/nz-time-picker-panel.component.ts +++ b/components/time-picker/nz-time-picker-panel.component.ts @@ -16,9 +16,8 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { reqAnimFrame } from '../core/polyfill/request-animation'; -import { NzUpdateHostClassService as UpdateCls } from '../core/services/update-host-class.service'; -import { isNotNil } from '../core/util/check'; +import { isNotNil, reqAnimFrame, NzUpdateHostClassService as UpdateCls } from 'ng-zorro-antd/core'; + import { NzTimeValueAccessorDirective } from './nz-time-value-accessor.directive'; import { TimeHolder } from './time-holder'; diff --git a/components/time-picker/nz-time-picker.component.ts b/components/time-picker/nz-time-picker.component.ts index 1eb785b68ec..b323b042774 100644 --- a/components/time-picker/nz-time-picker.component.ts +++ b/components/time-picker/nz-time-picker.component.ts @@ -15,10 +15,8 @@ import { ViewEncapsulation } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { slideMotion } from '../core/animation/slide'; -import { NzUpdateHostClassService as UpdateCls } from '../core/services/update-host-class.service'; -import { isNotNil } from '../core/util/check'; -import { toBoolean } from '../core/util/convert'; + +import { isNotNil, slideMotion, toBoolean, NzUpdateHostClassService as UpdateCls } from 'ng-zorro-antd/core'; @Component({ encapsulation: ViewEncapsulation.None, diff --git a/components/time-picker/nz-time-picker.module.ts b/components/time-picker/nz-time-picker.module.ts index dd77b869a16..47a05d26298 100644 --- a/components/time-picker/nz-time-picker.module.ts +++ b/components/time-picker/nz-time-picker.module.ts @@ -2,9 +2,11 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzOverlayModule } from '../core/overlay/nz-overlay.module'; -import { NzI18nModule } from '../i18n/nz-i18n.module'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzOverlayModule } from 'ng-zorro-antd/core'; + +import { NzI18nModule } from 'ng-zorro-antd/i18n'; +import { NzIconModule } from 'ng-zorro-antd/icon'; + import { NzTimePickerPanelComponent } from './nz-time-picker-panel.component'; import { NzTimePickerComponent } from './nz-time-picker.component'; import { NzTimeValueAccessorDirective } from './nz-time-value-accessor.directive'; diff --git a/components/time-picker/nz-time-value-accessor.directive.spec.ts b/components/time-picker/nz-time-value-accessor.directive.spec.ts index 8e6869d17f1..45d4940b728 100644 --- a/components/time-picker/nz-time-value-accessor.directive.spec.ts +++ b/components/time-picker/nz-time-value-accessor.directive.spec.ts @@ -5,7 +5,7 @@ import { async, fakeAsync, flush, ComponentFixture, TestBed } from '@angular/cor import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { dispatchFakeEvent } from '../core/testing'; +import { dispatchFakeEvent } from 'ng-zorro-antd/core'; import { NzI18nModule } from '../i18n/nz-i18n.module'; import { NzTimeValueAccessorDirective } from './nz-time-value-accessor.directive'; diff --git a/components/time-picker/nz-time-value-accessor.directive.ts b/components/time-picker/nz-time-value-accessor.directive.ts index a7b3d22d2a3..33a72b5cb35 100644 --- a/components/time-picker/nz-time-value-accessor.directive.ts +++ b/components/time-picker/nz-time-value-accessor.directive.ts @@ -1,6 +1,7 @@ import { Directive, ElementRef, HostListener, Input } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { DateHelperService } from '../i18n/date-helper.service'; + +import { DateHelperService } from 'ng-zorro-antd/i18n'; @Directive({ selector: 'input[nzTime]', diff --git a/components/time-picker/package.json b/components/time-picker/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/time-picker/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/time-picker/public-api.ts b/components/time-picker/public-api.ts index f6da319587a..33b5a175c8c 100644 --- a/components/time-picker/public-api.ts +++ b/components/time-picker/public-api.ts @@ -1,2 +1,4 @@ export * from './nz-time-picker.component'; export * from './nz-time-picker.module'; +export * from './nz-time-picker-panel.component'; +export * from './nz-time-value-accessor.directive'; diff --git a/components/time-picker/style/entry.less b/components/time-picker/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/time-picker/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/time-picker/time-holder.ts b/components/time-picker/time-holder.ts index 031ad43a470..1fad7acad69 100644 --- a/components/time-picker/time-holder.ts +++ b/components/time-picker/time-holder.ts @@ -1,6 +1,6 @@ import { Observable, Subject } from 'rxjs'; -import { isNotNil } from '../core/util/check'; +import { isNotNil } from 'ng-zorro-antd/core'; export class TimeHolder { private _seconds: number | undefined = undefined; diff --git a/components/timeline/doc/index.en-US.md b/components/timeline/doc/index.en-US.md index 46a479d0825..cd2962db47c 100644 --- a/components/timeline/doc/index.en-US.md +++ b/components/timeline/doc/index.en-US.md @@ -22,6 +22,14 @@ Vertical display timeline. ``` +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzTimelineModule } from 'ng-zorro-antd'; +``` + ### nz-timeline Timeline diff --git a/components/timeline/doc/index.zh-CN.md b/components/timeline/doc/index.zh-CN.md index 0071773035f..cf2833745cc 100644 --- a/components/timeline/doc/index.zh-CN.md +++ b/components/timeline/doc/index.zh-CN.md @@ -23,6 +23,14 @@ title: Timeline ``` +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzTimelineModule } from 'ng-zorro-antd'; +``` + ### nz-timeline 时间轴。 diff --git a/components/timeline/nz-timeline.component.ts b/components/timeline/nz-timeline.component.ts index db361d65deb..79d7b53dd9f 100644 --- a/components/timeline/nz-timeline.component.ts +++ b/components/timeline/nz-timeline.component.ts @@ -18,7 +18,8 @@ import { import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { reverseChildNodes } from '../core/util/dom'; +import { reverseChildNodes } from 'ng-zorro-antd/core'; + import { NzTimelineItemComponent } from './nz-timeline-item.component'; export type NzTimelineMode = 'left' | 'alternate' | 'right'; diff --git a/components/timeline/nz-timeline.module.ts b/components/timeline/nz-timeline.module.ts index ccce08dfdca..1edc6c9ff34 100644 --- a/components/timeline/nz-timeline.module.ts +++ b/components/timeline/nz-timeline.module.ts @@ -1,8 +1,8 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzIconModule } from '../icon/nz-icon.module'; +import { NzAddOnModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzTimelineItemComponent } from './nz-timeline-item.component'; import { NzTimelineComponent } from './nz-timeline.component'; diff --git a/components/timeline/package.json b/components/timeline/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/timeline/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/timeline/style/entry.less b/components/timeline/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/timeline/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/tooltip/doc/index.en-US.md b/components/tooltip/doc/index.en-US.md index df6de8e8849..bed6a82259d 100644 --- a/components/tooltip/doc/index.en-US.md +++ b/components/tooltip/doc/index.en-US.md @@ -13,6 +13,14 @@ A simple text popup tip. ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzTooltipModule } from 'ng-zorro-antd'; +``` + ### nz-tooltip | Property | Description | Type | Default | diff --git a/components/tooltip/doc/index.zh-CN.md b/components/tooltip/doc/index.zh-CN.md index 007a2d089cb..7a2a92b0129 100644 --- a/components/tooltip/doc/index.zh-CN.md +++ b/components/tooltip/doc/index.zh-CN.md @@ -15,6 +15,14 @@ title: Tooltip ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzTooltipModule } from 'ng-zorro-antd'; +``` + ### nz-tooltip | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/tooltip/nz-tooltip.component.ts b/components/tooltip/nz-tooltip.component.ts index 93019fdf77f..419740be964 100644 --- a/components/tooltip/nz-tooltip.component.ts +++ b/components/tooltip/nz-tooltip.component.ts @@ -21,11 +21,16 @@ import { ViewEncapsulation } from '@angular/core'; import { BehaviorSubject, Observable } from 'rxjs'; -import { zoomBigMotion } from '../core/animation/zoom'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { getPlacementName, DEFAULT_TOOLTIP_POSITIONS, POSITION_MAP } from '../core/overlay/overlay-position'; -import { isNotNil } from '../core/util/check'; -import { toBoolean } from '../core/util/convert'; + +import { + getPlacementName, + isNotNil, + toBoolean, + zoomBigMotion, + DEFAULT_TOOLTIP_POSITIONS, + NzNoAnimationDirective, + POSITION_MAP +} from 'ng-zorro-antd/core'; @Component({ selector: 'nz-tooltip', diff --git a/components/tooltip/nz-tooltip.directive.ts b/components/tooltip/nz-tooltip.directive.ts index 2956987e85a..8bb8b0cfa34 100644 --- a/components/tooltip/nz-tooltip.directive.ts +++ b/components/tooltip/nz-tooltip.directive.ts @@ -21,8 +21,7 @@ import { import { Subscription } from 'rxjs'; import { distinctUntilChanged } from 'rxjs/operators'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { isNotNil } from '../core/util/check'; +import { isNotNil, NzNoAnimationDirective } from 'ng-zorro-antd/core'; import { NzToolTipComponent } from './nz-tooltip.component'; diff --git a/components/tooltip/nz-tooltip.module.ts b/components/tooltip/nz-tooltip.module.ts index 3ac85051d14..a60979095d4 100644 --- a/components/tooltip/nz-tooltip.module.ts +++ b/components/tooltip/nz-tooltip.module.ts @@ -2,9 +2,8 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; -import { NzOverlayModule } from '../core/overlay/nz-overlay.module'; +import { NzAddOnModule, NzNoAnimationModule, NzOverlayModule } from 'ng-zorro-antd/core'; + // NOTE: the `t` is not uppercase in directive. Change this would however introduce break change. import { NzToolTipComponent } from './nz-tooltip.component'; import { NzTooltipDirective } from './nz-tooltip.directive'; diff --git a/components/tooltip/nz-tooltip.spec.ts b/components/tooltip/nz-tooltip.spec.ts index ae55ead4581..0da77826690 100644 --- a/components/tooltip/nz-tooltip.spec.ts +++ b/components/tooltip/nz-tooltip.spec.ts @@ -3,7 +3,7 @@ import { Component, ElementRef, ViewChild } from '@angular/core'; import { fakeAsync, inject, tick, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { dispatchMouseEvent } from '../core/testing'; +import { dispatchMouseEvent } from 'ng-zorro-antd/core'; import { NzIconTestModule } from '../icon/nz-icon-test.module'; import { NzTooltipDirective } from './nz-tooltip.directive'; diff --git a/components/tooltip/package.json b/components/tooltip/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/tooltip/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/tooltip/style/entry.less b/components/tooltip/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/tooltip/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/transfer/doc/index.en-US.md b/components/transfer/doc/index.en-US.md index 850188d5b1e..30ed483075b 100644 --- a/components/transfer/doc/index.en-US.md +++ b/components/transfer/doc/index.en-US.md @@ -15,6 +15,14 @@ One or more elements can be selected from either column, one click on the proper ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzTransferModule } from 'ng-zorro-antd'; +``` + ### nz-transfer | Property | Description | Type | Default | diff --git a/components/transfer/doc/index.zh-CN.md b/components/transfer/doc/index.zh-CN.md index a60b60bf5a6..3d888856ba8 100644 --- a/components/transfer/doc/index.zh-CN.md +++ b/components/transfer/doc/index.zh-CN.md @@ -17,6 +17,14 @@ title: Transfer ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzTransferModule } from 'ng-zorro-antd'; +``` + ### nz-transfer | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/transfer/nz-transfer-list.component.ts b/components/transfer/nz-transfer-list.component.ts index 39a250e062f..65a8f230ff2 100644 --- a/components/transfer/nz-transfer-list.component.ts +++ b/components/transfer/nz-transfer-list.component.ts @@ -13,7 +13,7 @@ import { ViewEncapsulation } from '@angular/core'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; +import { NzUpdateHostClassService } from 'ng-zorro-antd/core'; import { TransferItem } from './interface'; diff --git a/components/transfer/nz-transfer.component.ts b/components/transfer/nz-transfer.component.ts index 214516d5e7b..1a4d5d3d8f2 100644 --- a/components/transfer/nz-transfer.component.ts +++ b/components/transfer/nz-transfer.component.ts @@ -20,8 +20,8 @@ import { import { of, Observable, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { InputBoolean } from '../core/util/convert'; -import { NzI18nService } from '../i18n/nz-i18n.service'; +import { InputBoolean } from 'ng-zorro-antd/core'; +import { NzI18nService } from 'ng-zorro-antd/i18n'; import { TransferCanMove, TransferChange, TransferItem, TransferSearchChange, TransferSelectChange } from './interface'; import { NzTransferListComponent } from './nz-transfer-list.component'; diff --git a/components/transfer/nz-transfer.module.ts b/components/transfer/nz-transfer.module.ts index 7314d176431..0675e3adb79 100644 --- a/components/transfer/nz-transfer.module.ts +++ b/components/transfer/nz-transfer.module.ts @@ -2,13 +2,13 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzButtonModule } from '../button/nz-button.module'; -import { NzCheckboxModule } from '../checkbox/nz-checkbox.module'; -import { NzI18nModule } from '../i18n/nz-i18n.module'; -import { NzIconModule } from '../icon/nz-icon.module'; -import { NzInputModule } from '../input/nz-input.module'; +import { NzButtonModule } from 'ng-zorro-antd/button'; +import { NzCheckboxModule } from 'ng-zorro-antd/checkbox'; +import { NzEmptyModule } from 'ng-zorro-antd/empty'; +import { NzI18nModule } from 'ng-zorro-antd/i18n'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzInputModule } from 'ng-zorro-antd/input'; -import { NzEmptyModule } from '../empty/nz-empty.module'; import { NzTransferListComponent } from './nz-transfer-list.component'; import { NzTransferSearchComponent } from './nz-transfer-search.component'; import { NzTransferComponent } from './nz-transfer.component'; diff --git a/components/transfer/package.json b/components/transfer/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/transfer/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/transfer/style/entry.less b/components/transfer/style/entry.less new file mode 100644 index 00000000000..0b877e65da3 --- /dev/null +++ b/components/transfer/style/entry.less @@ -0,0 +1,6 @@ +@import './index.less'; +// style dependencies +@import '../../empty/style/index.less'; +@import '../../checkbox/style/index.less'; +@import '../../button/style/index.less'; +@import '../../input/style/index.less'; diff --git a/components/tree-select/doc/index.en-US.md b/components/tree-select/doc/index.en-US.md index 8520c95ba36..b1ad166b5fb 100755 --- a/components/tree-select/doc/index.en-US.md +++ b/components/tree-select/doc/index.en-US.md @@ -13,6 +13,14 @@ Any data whose entries are defined in a hierarchical manner is fit to use this c ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzTreeSelectModule } from 'ng-zorro-antd'; +``` + ### nz-tree-select | Property | Description | Type | Default | diff --git a/components/tree-select/doc/index.zh-CN.md b/components/tree-select/doc/index.zh-CN.md index dc0c3c280e4..beb04d9abb5 100755 --- a/components/tree-select/doc/index.zh-CN.md +++ b/components/tree-select/doc/index.zh-CN.md @@ -13,6 +13,14 @@ title: TreeSelect ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzTreeSelectModule } from 'ng-zorro-antd'; +``` + ### nz-tree-select | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/tree-select/nz-tree-select.component.ts b/components/tree-select/nz-tree-select.component.ts index c4d6a6f9867..26f84de5d03 100644 --- a/components/tree-select/nz-tree-select.component.ts +++ b/components/tree-select/nz-tree-select.component.ts @@ -7,6 +7,7 @@ import { ElementRef, EventEmitter, Host, + Injector, Input, OnChanges, OnDestroy, @@ -14,6 +15,7 @@ import { Optional, Output, Renderer2, + Self, SimpleChanges, TemplateRef, ViewChild @@ -23,22 +25,36 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { merge, of as observableOf, Subscription } from 'rxjs'; import { filter, tap } from 'rxjs/operators'; -import { slideMotion } from '../core/animation/slide'; -import { zoomMotion } from '../core/animation/zoom'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { NzSizeLDSType } from '../core/types/size'; -import { InputBoolean } from '../core/util/convert'; -import { NzFormatEmitEvent } from '../tree/interface'; -import { NzTreeNode, NzTreeNodeOptions } from '../tree/nz-tree-node'; -import { NzTreeComponent } from '../tree/nz-tree.component'; +import { + slideMotion, + zoomMotion, + InputBoolean, + NzFormatEmitEvent, + NzNoAnimationDirective, + NzSizeLDSType, + NzTreeBaseService, + NzTreeHigherOrderServiceToken, + NzTreeNode, + NzTreeNodeOptions +} from 'ng-zorro-antd/core'; +import { NzTreeComponent } from 'ng-zorro-antd/tree'; import { NzTreeSelectService } from './nz-tree-select.service'; +export function higherOrderServiceFactory(injector: Injector): NzTreeBaseService { + return injector.get(NzTreeSelectService); +} + @Component({ selector: 'nz-tree-select', animations: [slideMotion, zoomMotion], templateUrl: './nz-tree-select.component.html', providers: [ NzTreeSelectService, + { + provide: NzTreeHigherOrderServiceToken, + useFactory: higherOrderServiceFactory, + deps: [[new Self(), Injector]] + }, { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NzTreeSelectComponent), diff --git a/components/tree-select/nz-tree-select.module.ts b/components/tree-select/nz-tree-select.module.ts index 96f22617c6e..340e425bc0e 100644 --- a/components/tree-select/nz-tree-select.module.ts +++ b/components/tree-select/nz-tree-select.module.ts @@ -2,11 +2,12 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; -import { NzOverlayModule } from '../core/overlay/nz-overlay.module'; -import { NzEmptyModule } from '../empty/nz-empty.module'; -import { NzIconModule } from '../icon/nz-icon.module'; -import { NzTreeModule } from '../tree/nz-tree.module'; + +import { NzNoAnimationModule, NzOverlayModule } from 'ng-zorro-antd/core'; +import { NzEmptyModule } from 'ng-zorro-antd/empty'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzTreeModule } from 'ng-zorro-antd/tree'; + import { NzTreeSelectComponent } from './nz-tree-select.component'; @NgModule({ diff --git a/components/tree-select/nz-tree-select.service.ts b/components/tree-select/nz-tree-select.service.ts index 772d7e76b64..e4153219cb4 100644 --- a/components/tree-select/nz-tree-select.service.ts +++ b/components/tree-select/nz-tree-select.service.ts @@ -1,5 +1,6 @@ import { Injectable } from '@angular/core'; -import { NzTreeBaseService } from '../tree/nz-tree-base.service'; + +import { NzTreeBaseService } from 'ng-zorro-antd/core'; @Injectable() export class NzTreeSelectService extends NzTreeBaseService {} diff --git a/components/tree-select/nz-tree-select.spec.ts b/components/tree-select/nz-tree-select.spec.ts index 89de0404913..5c201e0b793 100644 --- a/components/tree-select/nz-tree-select.spec.ts +++ b/components/tree-select/nz-tree-select.spec.ts @@ -5,8 +5,15 @@ import { async, fakeAsync, flush, inject, tick, ComponentFixture, TestBed } from import { FormsModule, FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { createKeyboardEvent, dispatchFakeEvent, dispatchMouseEvent, typeInElement } from '../core/testing'; -import { NzTreeNode } from '../tree'; + +import { + createKeyboardEvent, + dispatchFakeEvent, + dispatchMouseEvent, + typeInElement, + NzTreeNode +} from 'ng-zorro-antd/core'; + import { NzTreeSelectComponent } from './nz-tree-select.component'; import { NzTreeSelectModule } from './nz-tree-select.module'; diff --git a/components/tree-select/package.json b/components/tree-select/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/tree-select/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/tree-select/public-api.ts b/components/tree-select/public-api.ts index 9f298c0c6ae..23cc1d5d88a 100644 --- a/components/tree-select/public-api.ts +++ b/components/tree-select/public-api.ts @@ -1,2 +1,3 @@ export * from './nz-tree-select.component'; export * from './nz-tree-select.module'; +export * from './nz-tree-select.service'; diff --git a/components/tree-select/style/entry.less b/components/tree-select/style/entry.less new file mode 100644 index 00000000000..5942500ceef --- /dev/null +++ b/components/tree-select/style/entry.less @@ -0,0 +1,5 @@ +@import './index.less'; +// style dependencies +// deps-lint-skip: select +@import '../../select/style/index.less'; +@import '../../empty/style/index.less'; diff --git a/components/tree/doc/index.en-US.md b/components/tree/doc/index.en-US.md index ed83f42fc57..5dcd7c3789f 100644 --- a/components/tree/doc/index.en-US.md +++ b/components/tree/doc/index.en-US.md @@ -10,6 +10,14 @@ Almost anything can be represented in a tree structure. Examples include directo ## API +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzTreeModule } from 'ng-zorro-antd'; +``` + ### nz-tree | Property | Description | Type | Default | diff --git a/components/tree/doc/index.zh-CN.md b/components/tree/doc/index.zh-CN.md index d99d3d8ade8..0eefa710df9 100644 --- a/components/tree/doc/index.zh-CN.md +++ b/components/tree/doc/index.zh-CN.md @@ -11,6 +11,14 @@ subtitle: 树形控件 ## API +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzTreeModule } from 'ng-zorro-antd'; +``` + ### nz-tree | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/tree/nz-tree-node.component.ts b/components/tree/nz-tree-node.component.ts index 71c7000dc5f..e9b6a60d394 100644 --- a/components/tree/nz-tree-node.component.ts +++ b/components/tree/nz-tree-node.component.ts @@ -17,12 +17,15 @@ import { } from '@angular/core'; import { fromEvent, Observable, Subject } from 'rxjs'; import { filter, takeUntil } from 'rxjs/operators'; -import { collapseMotion } from '../core/animation/collapse'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { InputBoolean } from '../core/util/convert'; -import { NzFormatBeforeDropEvent } from '../tree/interface'; -import { NzTreeBaseService } from './nz-tree-base.service'; -import { NzTreeNode } from './nz-tree-node'; + +import { + collapseMotion, + InputBoolean, + NzFormatBeforeDropEvent, + NzNoAnimationDirective, + NzTreeBaseService, + NzTreeNode +} from 'ng-zorro-antd/core'; @Component({ selector: 'nz-tree-node', diff --git a/components/tree/nz-tree.component.ts b/components/tree/nz-tree.component.ts index 351dd79f49d..457f5a81279 100644 --- a/components/tree/nz-tree.component.ts +++ b/components/tree/nz-tree.component.ts @@ -19,20 +19,26 @@ import { import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { Observable, ReplaySubject, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive'; -import { isNotNil } from '../core/util/check'; -import { toBoolean, InputBoolean } from '../core/util/convert'; -import { NzTreeSelectService } from '../tree-select/nz-tree-select.service'; -import { NzFormatBeforeDropEvent, NzFormatEmitEvent } from '../tree/interface'; -import { NzTreeBaseService } from './nz-tree-base.service'; -import { NzTreeNode } from './nz-tree-node'; + +import { + isNotNil, + toBoolean, + InputBoolean, + NzFormatBeforeDropEvent, + NzFormatEmitEvent, + NzNoAnimationDirective, + NzTreeBaseService, + NzTreeHigherOrderServiceToken, + NzTreeNode +} from 'ng-zorro-antd/core'; + import { NzTreeService } from './nz-tree.service'; export function NzTreeServiceFactory( - treeSelectService: NzTreeSelectService, + higherOrderService: NzTreeBaseService, treeService: NzTreeService ): NzTreeBaseService { - return treeSelectService ? treeSelectService : treeService; + return higherOrderService ? higherOrderService : treeService; } @Component({ @@ -44,7 +50,7 @@ export function NzTreeServiceFactory( { provide: NzTreeBaseService, useFactory: NzTreeServiceFactory, - deps: [[new SkipSelf(), new Optional(), NzTreeSelectService], NzTreeService] + deps: [[new SkipSelf(), new Optional(), NzTreeHigherOrderServiceToken], NzTreeService] }, { provide: NG_VALUE_ACCESSOR, @@ -66,6 +72,7 @@ export class NzTreeComponent implements OnInit, OnDestroy, ControlValueAccessor, @Input() @InputBoolean() nzSelectMode = false; @Input() @InputBoolean() nzCheckStrictly = false; @Input() @InputBoolean() nzBlockNode = false; + /** * @deprecated use * nzExpandAll instead diff --git a/components/tree/nz-tree.module.ts b/components/tree/nz-tree.module.ts index 91cceb5970b..812536d97fa 100644 --- a/components/tree/nz-tree.module.ts +++ b/components/tree/nz-tree.module.ts @@ -1,8 +1,9 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NzAddOnModule } from '../core/addon/addon.module'; -import { NzNoAnimationModule } from '../core/no-animation/nz-no-animation.module'; -import { NzIconModule } from '../icon/nz-icon.module'; + +import { NzAddOnModule, NzNoAnimationModule } from 'ng-zorro-antd/core'; +import { NzIconModule } from 'ng-zorro-antd/icon'; + import { NzTreeNodeComponent } from './nz-tree-node.component'; import { NzTreeComponent } from './nz-tree.component'; diff --git a/components/tree/nz-tree.service.ts b/components/tree/nz-tree.service.ts index ffd7addf992..5896f345120 100644 --- a/components/tree/nz-tree.service.ts +++ b/components/tree/nz-tree.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { NzTreeBaseService } from './nz-tree-base.service'; +import { NzTreeBaseService } from 'ng-zorro-antd/core'; @Injectable() export class NzTreeService extends NzTreeBaseService {} diff --git a/components/tree/nz-tree.spec.ts b/components/tree/nz-tree.spec.ts index c9d856d3548..46f5c8b15c4 100644 --- a/components/tree/nz-tree.spec.ts +++ b/components/tree/nz-tree.spec.ts @@ -5,11 +5,16 @@ import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of, Observable } from 'rxjs'; -import { dispatchMouseEvent, dispatchTouchEvent } from '../core/testing'; +import { + dispatchMouseEvent, + dispatchTouchEvent, + NzTreeBaseService, + NzTreeNode, + NzTreeNodeOptions +} from 'ng-zorro-antd/core'; + import { NzIconTestModule } from '../icon/nz-icon-test.module'; -import { NzTreeBaseService } from './nz-tree-base.service'; -import { NzTreeNode, NzTreeNodeOptions } from './nz-tree-node'; import { NzTreeComponent } from './nz-tree.component'; import { NzTreeModule } from './nz-tree.module'; @@ -654,12 +659,12 @@ describe('nz-tree', () => { [nzExpandAll]="expandAll" [nzExpandedIcon]="expandedIcon" [nzAsyncData]="asyncData" - (nzSearchValueChange)="nzEvent($event)" - (nzClick)="nzEvent($event)" - (nzDblClick)="nzEvent($event)" - (nzContextMenu)="nzEvent($event)" - (nzExpandChange)="nzEvent($event)" - (nzCheckBoxChange)="nzEvent($event)" + (nzSearchValueChange)="nzEvent()" + (nzClick)="nzEvent()" + (nzDblClick)="nzEvent()" + (nzContextMenu)="nzEvent()" + (nzExpandChange)="nzEvent()" + (nzCheckBoxChange)="nzEvent()" > ` @@ -739,12 +744,12 @@ export class NzTestTreeBasicControlledComponent { [nzData]="nodes" nzDraggable="true" [nzBeforeDrop]="beforeDrop" - (nzOnDragStart)="onDragStart($event)" - (nzOnDragEnter)="onDragEnter($event)" - (nzOnDragLeave)="onDragLeave($event)" - (nzOnDragOver)="onDragOver($event)" - (nzOnDrop)="onDrop($event)" - (nzOnDragEnd)="onDragEnd($event)" + (nzOnDragStart)="onDragStart()" + (nzOnDragEnter)="onDragEnter()" + (nzOnDragLeave)="onDragLeave()" + (nzOnDragOver)="onDragOver()" + (nzOnDrop)="onDrop()" + (nzOnDragEnd)="onDragEnd()" > ` @@ -852,7 +857,6 @@ export class NzTestTreeOlderComponent implements OnInit { selectedKeys = ['10001', '100011']; multiple = true; expandDefault = false; - showExpand = true; searchValue = ''; modelNodes: NzTreeNode[]; diff --git a/components/tree/package.json b/components/tree/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/tree/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/tree/public-api.ts b/components/tree/public-api.ts index fa31d728fe4..c28823312c2 100644 --- a/components/tree/public-api.ts +++ b/components/tree/public-api.ts @@ -1,8 +1,4 @@ -export * from './interface'; export * from './nz-tree.module'; export * from './nz-tree.component'; export * from './nz-tree-node.component'; -export * from './nz-tree-node'; -export * from './nz-tree-base.service'; export * from './nz-tree.service'; -export * from './nz-tree-util'; diff --git a/components/tree/style/entry.less b/components/tree/style/entry.less new file mode 100644 index 00000000000..06547c43acd --- /dev/null +++ b/components/tree/style/entry.less @@ -0,0 +1 @@ +@import './index.less'; diff --git a/components/tsconfig.json b/components/tsconfig.json index e8eb3e4f3fb..7f6c6cddebc 100644 --- a/components/tsconfig.json +++ b/components/tsconfig.json @@ -1,6 +1,8 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "baseUrl": "./", + "rootDir": "./", "target": "es5", "module": "es2015", "sourceMap": false, @@ -9,11 +11,13 @@ "experimentalDecorators": true, "declaration": true, "outDir": "../release", - "lib": ["es2015", "dom"] + "lib": ["es2015", "dom"], + "paths": { + "ng-zorro-antd": ["./ng-zorro-antd.module"], + "ng-zorro-antd/*": ["./*"] + } }, - "files": [ - "./ng-zorro-antd.module.ts" - ], + "files": ["./ng-zorro-antd.module.ts"], "angularCompilerOptions": { "skipTemplateCodegen": true } diff --git a/components/upload/doc/index.en-US.md b/components/upload/doc/index.en-US.md index 362e9533249..1e190771d0c 100644 --- a/components/upload/doc/index.en-US.md +++ b/components/upload/doc/index.en-US.md @@ -18,6 +18,14 @@ Uploading is the process of publishing information (web pages, text, pictures, v > You can consult [jQuery-File-Upload](https://github.com/blueimp/jQuery-File-Upload/wiki) about how to implement server side upload interface. +### Secondary Entry Point + +[Note](/docs/getting-started/en#secondary-entry-points). + +```ts +import { NzUploadModule } from 'ng-zorro-antd'; +``` + ### nz-upload | Property | Description | Type | Default | diff --git a/components/upload/doc/index.zh-CN.md b/components/upload/doc/index.zh-CN.md index 885753294e2..4e22c8667b8 100644 --- a/components/upload/doc/index.zh-CN.md +++ b/components/upload/doc/index.zh-CN.md @@ -19,6 +19,14 @@ title: Upload > 服务端上传接口实现可以参考 [jQuery-File-Upload](https://github.com/blueimp/jQuery-File-Upload/wiki)。 +### 二级入口 + +[说明](/docs/getting-started/zh#二级入口)。 + +```ts +import { NzUploadModule } from 'ng-zorro-antd'; +``` + ### nz-upload | 参数 | 说明 | 类型 | 默认值 | diff --git a/components/upload/interface.ts b/components/upload/interface.ts index 7c5ae54e524..37eaf27fdc1 100644 --- a/components/upload/interface.ts +++ b/components/upload/interface.ts @@ -1,6 +1,7 @@ // tslint:disable:no-any prefer-method-signature import { Observable, Subscription } from 'rxjs'; -import { IndexableObject } from '../core/types/indexable'; + +import { IndexableObject } from 'ng-zorro-antd/core'; /** 状态 */ export type UploadFileStatus = 'error' | 'success' | 'done' | 'uploading' | 'removed'; diff --git a/components/upload/nz-upload-btn.component.ts b/components/upload/nz-upload-btn.component.ts index 1978e90e9d5..0099370ba9c 100644 --- a/components/upload/nz-upload-btn.component.ts +++ b/components/upload/nz-upload-btn.component.ts @@ -15,7 +15,7 @@ import { import { of, Observable, Subscription } from 'rxjs'; import { switchMap } from 'rxjs/operators'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; +import { NzUpdateHostClassService } from 'ng-zorro-antd/core'; import { UploadFile, UploadXHRArgs, ZipButtonOptions } from './interface'; diff --git a/components/upload/nz-upload-list.component.ts b/components/upload/nz-upload-list.component.ts index 73aedee5276..a587a3a5059 100644 --- a/components/upload/nz-upload-list.component.ts +++ b/components/upload/nz-upload-list.component.ts @@ -9,7 +9,7 @@ import { ViewEncapsulation } from '@angular/core'; -import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; +import { NzUpdateHostClassService } from 'ng-zorro-antd/core'; import { ShowUploadListInterface, UploadFile, UploadListType } from './interface'; diff --git a/components/upload/nz-upload.component.ts b/components/upload/nz-upload.component.ts index 8dbb6ffff65..0707e81a78d 100644 --- a/components/upload/nz-upload.component.ts +++ b/components/upload/nz-upload.component.ts @@ -16,8 +16,8 @@ import { import { of, Observable, Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { toBoolean, InputBoolean, InputNumber } from '../core/util/convert'; -import { NzI18nService } from '../i18n/nz-i18n.service'; +import { toBoolean, InputBoolean, InputNumber } from 'ng-zorro-antd/core'; +import { NzI18nService } from 'ng-zorro-antd/i18n'; import { ShowUploadListInterface, diff --git a/components/upload/nz-upload.module.ts b/components/upload/nz-upload.module.ts index cb0078f63aa..be82245cd6b 100644 --- a/components/upload/nz-upload.module.ts +++ b/components/upload/nz-upload.module.ts @@ -2,11 +2,11 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NzI18nModule } from '../i18n/nz-i18n.module'; -import { NzIconModule } from '../icon/nz-icon.module'; -import { NzToolTipModule } from '../tooltip/nz-tooltip.module'; +import { NzI18nModule } from 'ng-zorro-antd/i18n'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzProgressModule } from 'ng-zorro-antd/progress'; +import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; -import { NzProgressModule } from './../progress/nz-progress.module'; import { NzUploadBtnComponent } from './nz-upload-btn.component'; import { NzUploadListComponent } from './nz-upload-list.component'; import { NzUploadComponent } from './nz-upload.component'; diff --git a/components/upload/package.json b/components/upload/package.json new file mode 100644 index 00000000000..ded1e7a9fdf --- /dev/null +++ b/components/upload/package.json @@ -0,0 +1,7 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "public-api.ts" + } + } +} diff --git a/components/upload/style/entry.less b/components/upload/style/entry.less new file mode 100644 index 00000000000..a67a294db5f --- /dev/null +++ b/components/upload/style/entry.less @@ -0,0 +1,4 @@ +@import './index.less'; +// style dependencies +@import '../../progress/style/index.less'; +@import '../../tooltip/style/index.less'; diff --git a/docs/getting-started.en-US.md b/docs/getting-started.en-US.md index 0704a2f47dd..ea61e6d7771 100755 --- a/docs/getting-started.en-US.md +++ b/docs/getting-started.en-US.md @@ -138,3 +138,65 @@ You can get more info about how to customize styles at [customize theme](/docs/c ## Customization * [Customize Theme](/docs/customize-theme/en) * [Local Iconfont](/docs/customize-theme/en) + +## Secondary Entry Points + +From version 7.3.0, you can import a component's module and style files to use that component. For example, if you only want to use the `Button` component, you can import `NzButtonModule` instead of `NgZorroAntdModule`, and `Button`'s style file instead of `ng-zorro-antd.css`. + +In your modules: + +```diff +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + ++ import { NzButtonModule } from 'ng-zorro-antd'; +- import { NgZorroAntdModule } from 'ng-zorro-antd'; + +@NgModule({ + declarations: [ + OnlyButtonComponent + ], + imports: [ + CommonModule, ++ NzButtonModule, +- NgZorroAntdModule + ] +}) +export class OnlyButtonModule { } +``` + +In style.css: + +```diff +- @import "~ng-zorro-antd/ng-zorro-antd.css"; + ++ @import "~ng-zorro-antd/style/index.min.css"; /* Import basic styles */ ++ @import "~ng-zorro-antd/button/style/index.min.css"; /* Import styles of the component */ + +/* If you use less,you should import entry.less for each component */ +/* If you want to import several components, you are highly recommended to use less instead of CSS. */ +/* @import "~ng-zorro-antd/button/style/entry.less" */ +``` + +If you want to import several components, it is recommended to use less instead of CSS. In styles.less: + +```less +@import "~ng-zorro-antd/style/index.less"; /* Import basic styles */ +@import "~ng-zorro-antd/button/style/entry.less"; /* Import styles of the component */ +``` + +> Importing CSS files of several components may result in code redundancy because style files of components have dependency relationships like TypeScript files. + +### A comparison of secondary entry points and primary entry point + +| Primary Entry Point | Secondary Entry Points | +| --- | --- | +| Just import NgZorroAntdModule no matter what component you want to use | Import styles and modules of components you want | +| Larger package size | Smaller package size | +| ng-zorro-antd would be bundled into main.js | It may be bundled into lazy loading module according to your usage | + +Secondary entry points is recommended if you: + +* Only use a small part of the components of ng-zorro-antd (You can use a shared module to wrap those components). +* Use ng-zorro-antd along with others component kits and get error because of conflicts. +* Do care about package size diff --git a/docs/getting-started.zh-CN.md b/docs/getting-started.zh-CN.md index 85211631a98..a2807a90c13 100755 --- a/docs/getting-started.zh-CN.md +++ b/docs/getting-started.zh-CN.md @@ -144,3 +144,63 @@ export class AppModule { } * [自定义主题](/docs/customize-theme/zh) * [使用本地字体](/docs/customize-theme/zh) + +## 二级入口 + +从 7.3.0 版本起,你可以引入子 module 和单独打包的 CSS/less 文件来单独使用某个组件。 + +例如,你只想使用 Button 组件,那么你就可以引入 `NzButtonModule` 而不是 `NgZorroAntdModule`,在 `style.css` 里导入组件对应的样式文件而不是全部的样式文件。 + +在 module 文件里: + +```diff +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + ++ import { NzButtonModule } from 'ng-zorro-antd/button'; +- import { NgZorroAntdModule } from 'ng-zorro-antd'; + +@NgModule({ + declarations: [ + OnlyButtonComponent + ], + imports: [ + CommonModule, ++ NzButtonModule, +- NgZorroAntdModule + ] +}) +export class OnlyButtonModule { } +``` + +在 style.css 文件里: + +```diff +- @import "~ng-zorro-antd/ng-zorro-antd.css"; + ++ @import "~ng-zorro-antd/style/index.min.css"; /* 引入基本样式 */ ++ @import "~ng-zorro-antd/button/style/index.min.css"; /* 引入组件样式 */ +``` + +另:如果你想单独引入多个组件,我们建议使用 less,在你的 style.less 里导入各个组件的 entry.less 文件: + +```less +@import "~ng-zorro-antd/style/index.less"; /* 引入基本样式 */ +@import "~ng-zorro-antd/button/style/entry.less"; /* 引入组件样式 */ +``` + +> 由于组件之间的样式也存在依赖关系,单独引入多个组件可能导致 CSS 的冗余。 + +### 比较二级入口引用和传统的一级入口引用方式 + +| 一级入口 | 二级入口 | +| --- | --- | +| 不管要使用何种组件只需要导入 NgZorroAntdModule 和全部样式 | 按照你想用的组件导入 module 和样式文件 | +| 打包体积较大 | 打包体积较小 | +| ng-zorro-antd 的组件会被打包到 main.js 文件中 | 按照实际引用情况,可能被打包到懒加载 module 中 | + +如果你符合或遇到了如下情形,推荐你使用二级入口: + +* 你的项目中仅仅用到了少数几个组件(你可以使用 ShareModule 来包装你需要用到的组件) +* 你的项目同时使用了 ng-zorro-antd 和别的组件,而且你遇到了冲突 +* 你对 package size 特别在意 diff --git a/package.json b/package.json index d4ffd5efde0..494955ba3f6 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "lint": "tslint -c tslint.json 'components/*/*.ts'", "migration-styles": "node ./scripts/build/migration-styles.js", "ng": "ng", - "postgenerate": "node ./scripts/build/generate-less.js && cp README.md publish/README.md && npm run migration-styles && npm run schematic:generate", + "postgenerate": "node scripts/build/compile-styles.js && cp README.md publish/README.md && npm run migration-styles && npm run schematic:generate", "pre-release": "npm run site:init && bash ./scripts/build/replace-publish.sh && npm run generate && npm run build-site && npm run build-iframe && npm run helper", "release": "node ./scripts/publish/publish.js", "schematic:build": "node ./scripts/schematics/set-theme.js && node ./scripts/schematics/set-version.js && npm run schematic:tsc && node ./scripts/schematics/copy-resources", diff --git a/scripts/build/compile-styles.js b/scripts/build/compile-styles.js new file mode 100644 index 00000000000..1b2a81631f4 --- /dev/null +++ b/scripts/build/compile-styles.js @@ -0,0 +1,88 @@ +const fs = require('fs-extra'); +const path = require('path'); +const less = require('less'); +const LessPluginCleanCSS = require('less-plugin-clean-css'); +const NpmImportPlugin = require('less-plugin-npm-import'); + +function compileLess(content, savePath, min, sub, rootPath) { + return new Promise((resolve, reject) => { + const plugins = []; + const lessOptions = { plugins: plugins, javascriptEnabled: true }; + + if (min) { + plugins.push(new LessPluginCleanCSS({ advanced: true })); + } + + if (sub) { + lessOptions.paths = [path.dirname(rootPath)]; + lessOptions.filename = rootPath; + plugins.push( + new NpmImportPlugin({ + prefix: '~' + }) + ); + } + + return less + .render(content, lessOptions) + .then(({ css }) => { + fs.writeFileSync(savePath, css); + resolve(); + }) + .catch(err => reject(err)); + }); +} + +const sourcePath = path.resolve(__dirname, '../../components'); +const targetPath = path.resolve(__dirname, '../../publish'); +const componentFolders = fs.readdirSync(targetPath); + +// Export each component's style in `component.less` and copy it to the target dir. +let componentsLessContent = ''; + +componentFolders.forEach(dir => { + if (fs.existsSync(`${sourcePath}/${dir}/style/index.less`)) { + // Copy style files for each component. + componentsLessContent += `@import "./${path.posix.join(dir, 'style', 'index.less')}";\n`; + fs.copySync(`${sourcePath}/${dir}/style`, `${targetPath}/${dir}/style`); + + // Compile less files to CSS and delete the `entry.less` file. + const buildFilePath = `${sourcePath}/${dir}/style/entry.less`; + if (fs.existsSync(buildFilePath)) { + compileLess( + fs.readFileSync(buildFilePath, { encoding: 'utf8' }), + path.join(targetPath, dir, 'style', `index.css`), + false, + true, + buildFilePath + ).catch(e => console.log(e)); + compileLess( + fs.readFileSync(buildFilePath, { encoding: 'utf8' }), + path.join(targetPath, dir, 'style', `index.min.css`), + true, + true, + buildFilePath + ).catch(e => console.log(e)); + } + } +}); + +// Copy concentrated less files. +fs.copySync(path.resolve(sourcePath, 'style'), path.resolve(targetPath, 'style')); +fs.writeFileSync(`${targetPath}/components.less`, componentsLessContent); +fs.writeFileSync(`${targetPath}/ng-zorro-antd.less`, fs.readFileSync(`${sourcePath}/ng-zorro-antd.less`)); + +// Compile concentrated less file to CSS file. +const lessContent = `@import "${path.posix.join(targetPath, 'ng-zorro-antd.less')}";`; +compileLess(lessContent, path.join(targetPath, 'ng-zorro-antd.css'), false); +compileLess(lessContent, path.join(targetPath, 'ng-zorro-antd.min.css'), true); + +// Compile css file that doesn't have component-specific styles. +const cssIndexPath = path.join(sourcePath, 'style', 'index.less'); +const cssIndex = fs.readFileSync(cssIndexPath, { encoding: 'utf8' }) + `@import '../core/style/index.less';\n`; // Compile patch. +compileLess(cssIndex, path.join(targetPath, 'style', 'index.css'), false, true, cssIndexPath).catch(e => + console.log(e) +); +compileLess(cssIndex, path.join(targetPath, 'style', 'index.min.css'), true, true, cssIndexPath).catch(e => + console.log(e) +); diff --git a/scripts/build/generate-less.js b/scripts/build/generate-less.js deleted file mode 100644 index 14909df649a..00000000000 --- a/scripts/build/generate-less.js +++ /dev/null @@ -1,41 +0,0 @@ -const fs = require('fs-extra'); -const path = require('path'); -const less = require('less'); -const LessPluginCleanCSS = require('less-plugin-clean-css'); - -function compileLess(content, savePath, min) { - return new Promise((resolve, reject) => { - const plugins = []; - if (min) { - const cleanCSSPlugin = new LessPluginCleanCSS({advanced: true}); - plugins.push(cleanCSSPlugin); - } - return less.render - .call(less, content, {plugins: plugins, javascriptEnabled: true}) - .then(({css}) => { - fs.writeFileSync(savePath, css); - resolve(); - }) - .catch(err => reject(err)); - }); -} - -const sourcePath = path.resolve(__dirname, '../../components'); -const targetPath = path.resolve(__dirname, '../../publish'); - -const targetFolder = fs.readdirSync(targetPath); -let componentsLessContent = ''; -targetFolder.forEach(dir => { - if (fs.existsSync(`${sourcePath}/${dir}/style/index.less`)) { - componentsLessContent += `@import "./${path.posix.join(dir, 'style', 'index.less')}";\n`; - fs.copySync(`${sourcePath}/${dir}/style`, `${targetPath}/${dir}/style`); - } - } -); -fs.copySync(path.resolve(sourcePath, 'style'), path.resolve(targetPath, 'style')); -fs.writeFileSync(`${targetPath}/components.less`, componentsLessContent); -fs.writeFileSync(`${targetPath}/ng-zorro-antd.less`, fs.readFileSync(`${sourcePath}/ng-zorro-antd.less`)); - -const lessContent = `@import "${path.posix.join(targetPath, 'ng-zorro-antd.less')}";`; -compileLess(lessContent, path.join(targetPath, 'ng-zorro-antd.css'), false); -compileLess(lessContent, path.join(targetPath, 'ng-zorro-antd.min.css'), true); diff --git a/scripts/build/replace-publish.sh b/scripts/build/replace-publish.sh index 1804792ed17..54ed94726c5 100755 --- a/scripts/build/replace-publish.sh +++ b/scripts/build/replace-publish.sh @@ -1,2 +1,3 @@ -sed 's/components\/ng-zorro-antd.module.ts/publish/g' site/tsconfig.app.json > site/tsconfig.app.json_back +sed 's/components\/ng-zorro-antd.module.ts/publish/g +s/components/publish/g' site/tsconfig.app.json > site/tsconfig.app.json_back mv site/tsconfig.app.json_back site/tsconfig.app.json diff --git a/scripts/site/_site/tsconfig.app.json b/scripts/site/_site/tsconfig.app.json index ddf8789156a..1b10bef25c8 100644 --- a/scripts/site/_site/tsconfig.app.json +++ b/scripts/site/_site/tsconfig.app.json @@ -7,6 +7,7 @@ "types": [], "paths": { "ng-zorro-antd": [ "../components/ng-zorro-antd.module.ts" ], + "ng-zorro-antd/*": [ "../components/*" ], "ngx-color/sketch": [ "../node_modules/ngx-color/sketch" ] } },