ngx-tethys 19.0.13 → 19.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -2
- package/action/action.component.d.ts +12 -20
- package/action/actions.component.d.ts +5 -7
- package/affix/affix.component.d.ts +7 -10
- package/alert/alert.component.d.ts +1 -1
- package/anchor/anchor-link.component.d.ts +8 -8
- package/anchor/anchor.component.d.ts +15 -21
- package/arrow-switcher/arrow-switcher.component.d.ts +15 -22
- package/autocomplete/autocomplete.component.d.ts +10 -17
- package/autocomplete/autocomplete.trigger.directive.d.ts +10 -18
- package/avatar/avatar-list/avatar-list.component.d.ts +8 -14
- package/avatar/avatar.component.d.ts +25 -39
- package/back-top/back-top.component.d.ts +9 -12
- package/badge/badge.component.d.ts +19 -59
- package/breadcrumb/breadcrumb.component.d.ts +15 -20
- package/button/button-icon.component.d.ts +3 -2
- package/button/button.component.d.ts +3 -2
- package/calendar/calendar-header.component.d.ts +9 -8
- package/calendar/calendar.component.d.ts +16 -16
- package/card/card.component.d.ts +5 -11
- package/card/content.component.d.ts +3 -8
- package/card/header.component.d.ts +7 -8
- package/carousel/carousel.component.d.ts +22 -27
- package/cascader/cascader-li.component.d.ts +13 -21
- package/cascader/cascader-search-option.component.d.ts +8 -16
- package/cascader/cascader.component.d.ts +58 -80
- package/checkbox/checkbox.component.d.ts +2 -5
- package/collapse/collapse-item.component.d.ts +12 -19
- package/collapse/collapse.component.d.ts +6 -12
- package/collapse/collapse.token.d.ts +3 -3
- package/color-picker/color-picker-custom-panel.component.d.ts +5 -5
- package/color-picker/color-picker-panel.component.d.ts +7 -11
- package/color-picker/color-picker.component.d.ts +19 -35
- package/color-picker/parts/alpha/alpha.component.d.ts +8 -8
- package/color-picker/parts/hue/hue.component.d.ts +6 -6
- package/color-picker/parts/indicator/indicator.component.d.ts +4 -3
- package/color-picker/parts/inputs/inputs.component.d.ts +9 -9
- package/color-picker/parts/saturation/saturation.component.d.ts +9 -9
- package/comment/comment.component.d.ts +4 -5
- package/copy/copy.directive.d.ts +8 -9
- package/date-picker/abstract-picker.component.d.ts +8 -7
- package/date-picker/lib/calendar/calendar-footer.component.d.ts +2 -1
- package/date-picker/lib/popups/inner-popup.component.d.ts +2 -1
- package/date-picker/picker.component.d.ts +2 -1
- package/date-range/date-range.component.d.ts +2 -2
- package/dialog/body/dialog-body.component.d.ts +2 -6
- package/dialog/confirm/confirm.component.d.ts +2 -2
- package/dialog/footer/dialog-footer.component.d.ts +6 -9
- package/dialog/header/dialog-header.component.d.ts +9 -11
- package/divider/divider.component.d.ts +12 -16
- package/dot/dot.component.d.ts +5 -13
- package/drag-drop/drag-handle.directive.d.ts +2 -1
- package/drag-drop/drag.directive.d.ts +2 -1
- package/drag-drop/drop-container.directive.d.ts +2 -1
- package/dropdown/dropdown-menu-item.directive.d.ts +3 -2
- package/dropdown/dropdown-menu.component.d.ts +2 -1
- package/dropdown/dropdown.directive.d.ts +2 -1
- package/empty/empty.component.d.ts +21 -27
- package/fesm2022/ngx-tethys-action.mjs +54 -91
- package/fesm2022/ngx-tethys-action.mjs.map +1 -1
- package/fesm2022/ngx-tethys-affix.mjs +29 -26
- package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
- package/fesm2022/ngx-tethys-anchor.mjs +91 -118
- package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
- package/fesm2022/ngx-tethys-arrow-switcher.mjs +51 -77
- package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
- package/fesm2022/ngx-tethys-autocomplete.mjs +69 -103
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-avatar.mjs +117 -162
- package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-back-top.mjs +33 -46
- package/fesm2022/ngx-tethys-back-top.mjs.map +1 -1
- package/fesm2022/ngx-tethys-badge.mjs +104 -208
- package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
- package/fesm2022/ngx-tethys-breadcrumb.mjs +66 -70
- package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
- package/fesm2022/ngx-tethys-calendar.mjs +85 -87
- package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-card.mjs +72 -77
- package/fesm2022/ngx-tethys-card.mjs.map +1 -1
- package/fesm2022/ngx-tethys-carousel.mjs +82 -99
- package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
- package/fesm2022/ngx-tethys-cascader.mjs +313 -468
- package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
- package/fesm2022/ngx-tethys-checkbox.mjs +10 -17
- package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-tethys-collapse.mjs +66 -71
- package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
- package/fesm2022/ngx-tethys-color-picker.mjs +187 -246
- package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-comment.mjs +16 -10
- package/fesm2022/ngx-tethys-comment.mjs.map +1 -1
- package/fesm2022/ngx-tethys-copy.mjs +25 -28
- package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dialog.mjs +81 -82
- package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
- package/fesm2022/ngx-tethys-divider.mjs +49 -58
- package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dot.mjs +45 -68
- package/fesm2022/ngx-tethys-dot.mjs.map +1 -1
- package/fesm2022/ngx-tethys-empty.mjs +107 -95
- package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
- package/fesm2022/ngx-tethys-form.mjs +161 -200
- package/fesm2022/ngx-tethys-form.mjs.map +1 -1
- package/fesm2022/ngx-tethys-fullscreen.mjs +21 -23
- package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
- package/fesm2022/ngx-tethys-grid.mjs +160 -152
- package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
- package/fesm2022/ngx-tethys-i18n.mjs +25 -25
- package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input-number.mjs +101 -114
- package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input.mjs +268 -271
- package/fesm2022/ngx-tethys-input.mjs.map +1 -1
- package/fesm2022/ngx-tethys-list.mjs +1 -1
- package/fesm2022/ngx-tethys-list.mjs.map +1 -1
- package/fesm2022/ngx-tethys-loading.mjs +17 -35
- package/fesm2022/ngx-tethys-loading.mjs.map +1 -1
- package/fesm2022/ngx-tethys-mention.mjs +52 -74
- package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
- package/fesm2022/ngx-tethys-menu.mjs +106 -179
- package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
- package/fesm2022/ngx-tethys-nav.mjs +169 -201
- package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
- package/fesm2022/ngx-tethys-pagination.mjs +230 -294
- package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
- package/fesm2022/ngx-tethys-popover.mjs +67 -70
- package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
- package/fesm2022/ngx-tethys-progress.mjs +196 -244
- package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs +102 -105
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +34 -38
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-result.mjs +46 -28
- package/fesm2022/ngx-tethys-result.mjs.map +1 -1
- package/fesm2022/ngx-tethys-skeleton.mjs +339 -342
- package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slider.mjs +75 -108
- package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-space.mjs +26 -46
- package/fesm2022/ngx-tethys-space.mjs.map +1 -1
- package/fesm2022/ngx-tethys-statistic.mjs +114 -151
- package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
- package/fesm2022/ngx-tethys-stepper.mjs +74 -107
- package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
- package/fesm2022/ngx-tethys-switch.mjs +80 -140
- package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
- package/fesm2022/ngx-tethys-table.mjs +1 -1
- package/fesm2022/ngx-tethys-table.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tabs.mjs +69 -87
- package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tag.mjs +42 -64
- package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
- package/fesm2022/ngx-tethys-timeline.mjs +104 -129
- package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
- package/fesm2022/ngx-tethys-typography.mjs +36 -33
- package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
- package/fesm2022/ngx-tethys-upload.mjs +91 -130
- package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
- package/fesm2022/ngx-tethys-util.mjs.map +1 -1
- package/fesm2022/ngx-tethys-watermark.mjs +36 -40
- package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/form/form-group-error/form-group-error.component.d.ts +2 -3
- package/form/form-group-label.directive.d.ts +2 -1
- package/form/form-group.component.d.ts +17 -24
- package/form/form-submit.directive.d.ts +2 -2
- package/form/form.directive.d.ts +6 -8
- package/form/from-group-footer/form-group-footer.component.d.ts +2 -2
- package/form/validator/confirm-validator.directive.d.ts +2 -2
- package/form/validator/unique-validator.directive.d.ts +2 -2
- package/fullscreen/fullscreen.component.d.ts +7 -7
- package/grid/flex.d.ts +14 -19
- package/grid/thy-col.directive.d.ts +6 -9
- package/grid/thy-grid-item.component.d.ts +3 -4
- package/grid/thy-grid.component.d.ts +11 -12
- package/grid/thy-row.directive.d.ts +12 -12
- package/icon/icon.component.d.ts +3 -2
- package/image/image.directive.d.ts +3 -2
- package/input/input-count.component.d.ts +4 -5
- package/input/input-group.component.d.ts +20 -20
- package/input/input-search.component.d.ts +15 -20
- package/input/input.component.d.ts +20 -21
- package/input/input.directive.d.ts +4 -6
- package/input-number/input-number.component.d.ts +21 -29
- package/layout/header.component.d.ts +4 -9
- package/layout/sidebar-header.component.d.ts +2 -1
- package/layout/sidebar.component.d.ts +8 -7
- package/list/list.component.d.ts +2 -1
- package/list/selection/selection-list.d.ts +4 -3
- package/loading/loading.component.d.ts +4 -10
- package/mention/mention.directive.d.ts +6 -7
- package/mention/suggestions/suggestions.component.d.ts +8 -9
- package/menu/group/menu-group.component.d.ts +16 -33
- package/menu/item/action/menu-item-action.component.d.ts +7 -8
- package/menu/item/icon/menu-item-icon.component.d.ts +2 -2
- package/menu/item/menu-item.component.d.ts +4 -4
- package/menu/item/name/menu-item-name.component.d.ts +2 -3
- package/menu/menu.component.d.ts +3 -7
- package/nav/icon-nav/icon-nav-link.directive.d.ts +3 -7
- package/nav/icon-nav/icon-nav.component.d.ts +3 -8
- package/nav/nav-ink-bar.directive.d.ts +4 -6
- package/nav/nav-item.directive.d.ts +7 -10
- package/nav/nav.component.d.ts +20 -48
- package/package.json +1 -1
- package/pagination/pagination.component.d.ts +48 -109
- package/popover/header/popover-header.component.d.ts +7 -6
- package/popover/popover.directive.d.ts +11 -18
- package/progress/progress-circle.component.d.ts +32 -21
- package/progress/progress-strip.component.d.ts +10 -14
- package/progress/progress.component.d.ts +15 -23
- package/property/examples/single/single.component.scss +6 -0
- package/property/properties.component.d.ts +6 -13
- package/property/property-item.component.d.ts +21 -26
- package/property/styles/properties.scss +124 -52
- package/property-operation/property-operation.component.d.ts +6 -5
- package/radio/button/radio-button.component.d.ts +2 -2
- package/radio/group/radio-group.component.d.ts +8 -7
- package/radio/radio.component.d.ts +2 -2
- package/radio/radio.token.d.ts +2 -2
- package/rate/rate-item.component.d.ts +2 -1
- package/rate/rate.component.d.ts +4 -3
- package/resizable/resizable.directive.d.ts +4 -9
- package/resizable/resize-handle.component.d.ts +2 -1
- package/resizable/resize-handles.component.d.ts +2 -1
- package/result/result.component.d.ts +9 -10
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/segment/segment-item.component.d.ts +2 -1
- package/segment/segment.component.d.ts +2 -1
- package/select/custom-select/custom-select.component.d.ts +11 -10
- package/select/native-select/native-select.component.d.ts +2 -1
- package/shared/base-form-check.component.d.ts +3 -2
- package/shared/directives/thy-autofocus.directive.d.ts +3 -2
- package/shared/directives/thy-scroll.directive.d.ts +2 -1
- package/shared/directives/thy-show.d.ts +2 -1
- package/shared/option/group/option-group.component.d.ts +2 -1
- package/shared/option/list-option/list-option.component.d.ts +2 -7
- package/shared/option/option.component.d.ts +2 -1
- package/shared/select/select-control/select-control.component.d.ts +7 -6
- package/skeleton/skeleton-circle.component.d.ts +16 -19
- package/skeleton/skeleton-rectangle.component.d.ts +20 -23
- package/skeleton/skeleton.component.d.ts +5 -6
- package/skeleton/stylized/bullet-list.component.d.ts +11 -13
- package/skeleton/stylized/list.component.d.ts +10 -12
- package/skeleton/stylized/paragraph.component.d.ts +12 -14
- package/slide/slide-body/slide-body-section.component.d.ts +2 -1
- package/slider/slider.component.d.ts +17 -24
- package/space/space.component.d.ts +8 -8
- package/statistic/statistic.component.d.ts +35 -40
- package/stepper/step-header.component.d.ts +6 -10
- package/stepper/step.component.d.ts +6 -6
- package/stepper/stepper.component.d.ts +15 -20
- package/switch/switch.component.d.ts +24 -35
- package/table/table-column.component.d.ts +6 -5
- package/table/table-skeleton.component.d.ts +3 -10
- package/table/table.component.d.ts +11 -10
- package/tabs/tab-content.component.d.ts +4 -4
- package/tabs/tab.component.d.ts +4 -5
- package/tabs/tabs.component.d.ts +13 -15
- package/tag/tag.component.d.ts +10 -16
- package/time-picker/time-picker-panel.component.d.ts +3 -2
- package/time-picker/time-picker.component.d.ts +6 -5
- package/timeline/timeline-item.component.d.ts +9 -13
- package/timeline/timeline.component.d.ts +13 -17
- package/tooltip/tooltip.directive.d.ts +3 -2
- package/tree/tree-node.component.d.ts +6 -15
- package/tree/tree.component.d.ts +8 -7
- package/tree-select/tree-select.component.d.ts +8 -7
- package/typography/bg-color.directive.d.ts +3 -3
- package/typography/text/text.component.d.ts +2 -2
- package/typography/text-color.directive.d.ts +3 -3
- package/upload/file-drop.directive.d.ts +9 -11
- package/upload/file-select-base.d.ts +6 -10
- package/upload/file-select.component.d.ts +10 -20
- package/util/helpers/helpers.d.ts +2 -1
- package/vote/vote.component.d.ts +4 -3
- package/watermark/watermark.directive.d.ts +7 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Renderer2, ElementRef, ChangeDetectionStrategy, Component,
|
|
2
|
+
import { inject, Renderer2, ElementRef, ChangeDetectionStrategy, Component, input, computed, numberAttribute, contentChild, NgModule } from '@angular/core';
|
|
3
3
|
import { NgClass, NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
4
4
|
import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
|
|
5
5
|
import { ThyDropdownDirective, ThyDropdownMenuItemDirective, ThyDropdownMenuComponent, ThyDropdownModule } from 'ngx-tethys/dropdown';
|
|
@@ -60,74 +60,86 @@ const ELLIPSIS_ITEM = { _id: THY_BREADCRUMB_ITEM_ELLIPSIS_ID };
|
|
|
60
60
|
*/
|
|
61
61
|
class ThyBreadcrumb {
|
|
62
62
|
constructor() {
|
|
63
|
-
|
|
63
|
+
/**
|
|
64
|
+
* 面包屑的前缀 展示图标,如 folder-fill
|
|
65
|
+
*/
|
|
66
|
+
this.thyIcon = input();
|
|
67
|
+
this.iconClasses = computed(() => {
|
|
68
|
+
const icon = this.thyIcon();
|
|
69
|
+
if (icon && icon.includes('wtf')) {
|
|
70
|
+
const classes = icon.split(' ');
|
|
71
|
+
if (classes.length === 1) {
|
|
72
|
+
classes.unshift('wtf');
|
|
73
|
+
}
|
|
74
|
+
return classes;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
this.svgIconName = computed(() => {
|
|
81
|
+
const icon = this.thyIcon();
|
|
82
|
+
if (icon && !icon.includes('wtf')) {
|
|
83
|
+
return icon;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* 面包屑的分隔符,不传值默认为 ">"
|
|
91
|
+
* @type slash | backslash | vertical-line
|
|
92
|
+
*/
|
|
93
|
+
this.thySeparator = input();
|
|
94
|
+
/**
|
|
95
|
+
* 面包屑的每一项数据
|
|
96
|
+
*/
|
|
97
|
+
this.items = input(undefined, { alias: 'thyItems' });
|
|
64
98
|
/**
|
|
65
99
|
* 最大显示数量,超出此数量后,面包屑会被省略, 0 表示不省略(仅当传入 thyItems 时有效)
|
|
66
100
|
*/
|
|
67
|
-
this.thyMaxCount = 4;
|
|
101
|
+
this.thyMaxCount = input(4, { transform: numberAttribute });
|
|
68
102
|
/**
|
|
69
103
|
* 是否可点击弹出已被省略的面包屑项(仅当传入 thyItems 时有效)
|
|
70
104
|
*/
|
|
71
|
-
this.thyExpandable = true;
|
|
105
|
+
this.thyExpandable = input(true, { transform: coerceBooleanProperty });
|
|
106
|
+
/**
|
|
107
|
+
* 面包屑的每一项模板(仅当传入 thyItems 时有效)
|
|
108
|
+
*/
|
|
109
|
+
this.itemTemplate = contentChild('item');
|
|
72
110
|
this.ellipsisItemId = THY_BREADCRUMB_ITEM_ELLIPSIS_ID;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this.resetItems();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
setIcon(icon) {
|
|
89
|
-
if (icon) {
|
|
90
|
-
if (icon.includes('wtf')) {
|
|
91
|
-
const classes = icon.split(' ');
|
|
92
|
-
if (classes.length === 1) {
|
|
93
|
-
classes.unshift('wtf');
|
|
94
|
-
}
|
|
95
|
-
this.iconClasses = classes;
|
|
111
|
+
this.processedItems = computed(() => {
|
|
112
|
+
const items = this.items();
|
|
113
|
+
if (!items?.length) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const thyMaxCount = this.thyMaxCount();
|
|
117
|
+
if (thyMaxCount && items.length > thyMaxCount) {
|
|
118
|
+
const ellipsisIndex = items.length - thyMaxCount + 2;
|
|
119
|
+
return {
|
|
120
|
+
ellipsisItems: items.slice(1, ellipsisIndex),
|
|
121
|
+
showItems: [items[0], ELLIPSIS_ITEM, ...items.slice(ellipsisIndex)]
|
|
122
|
+
};
|
|
96
123
|
}
|
|
97
124
|
else {
|
|
98
|
-
|
|
125
|
+
return {
|
|
126
|
+
ellipsisItems: [],
|
|
127
|
+
showItems: [...items]
|
|
128
|
+
};
|
|
99
129
|
}
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
this.iconClasses = null;
|
|
103
|
-
this.svgIconName = null;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
resetItems() {
|
|
107
|
-
if (!this.items?.length) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
if (this.thyMaxCount && this.items.length > this.thyMaxCount) {
|
|
111
|
-
const ellipsisIndex = this.items.length - this.thyMaxCount + 2;
|
|
112
|
-
this.ellipsisItems = this.items.slice(1, ellipsisIndex);
|
|
113
|
-
this.showItems = [this.items[0], ELLIPSIS_ITEM, ...this.items.slice(ellipsisIndex)];
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
this.showItems = [...this.items];
|
|
117
|
-
this.ellipsisItems = [];
|
|
118
|
-
}
|
|
130
|
+
});
|
|
119
131
|
}
|
|
120
132
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyBreadcrumb, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
121
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyBreadcrumb, isStandalone: true, selector: "thy-breadcrumb", inputs: { thyIcon: "thyIcon", thySeparator: "thySeparator",
|
|
133
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyBreadcrumb, isStandalone: true, selector: "thy-breadcrumb", inputs: { thyIcon: { classPropertyName: "thyIcon", publicName: "thyIcon", isSignal: true, isRequired: false, transformFunction: null }, thySeparator: { classPropertyName: "thySeparator", publicName: "thySeparator", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "thyItems", isSignal: true, isRequired: false, transformFunction: null }, thyMaxCount: { classPropertyName: "thyMaxCount", publicName: "thyMaxCount", isSignal: true, isRequired: false, transformFunction: null }, thyExpandable: { classPropertyName: "thyExpandable", publicName: "thyExpandable", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-breadcrumb-separator": "!!thySeparator()", "class.thy-breadcrumb-separator-slash": "thySeparator() === \"slash\"", "class.thy-breadcrumb-separator-backslash": "thySeparator() === \"backslash\"", "class.thy-breadcrumb-separator-vertical-line": "thySeparator() === \"vertical-line\"" }, classAttribute: "thy-breadcrumb" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, isSignal: true }], exportAs: ["ThyBreadcrumb"], ngImport: i0, template: "@if (svgIconName() || iconClasses()) {\n <div class=\"thy-breadcrumb-icon\">\n @if (svgIconName()) {\n <thy-icon [thyIconName]=\"svgIconName()\"></thy-icon>\n } @else {\n <i [ngClass]=\"iconClasses()\"></i>\n }\n </div>\n}\n\n@for (item of processedItems()?.showItems; track $index) {\n <thy-breadcrumb-item class=\"thy-breadcrumb-item-ellipsis\">\n @if (item?._id !== ellipsisItemId) {\n <ng-container *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-container>\n } @else {\n <a\n thyAction\n href=\"javascript:;\"\n thyActionIcon=\"more\"\n thyActiveClass=\"active\"\n [class.disabled]=\"!thyExpandable()\"\n class=\"ellipsis-action ml-n1 mr-n1\"\n [thyDropdown]=\"ellipsisList\"></a>\n }\n </thy-breadcrumb-item>\n}\n\n<ng-template #ellipsisList>\n <thy-dropdown-menu thyImmediateRender>\n @for (item of processedItems()?.ellipsisItems; track $index) {\n <a thyDropdownMenuItem href=\"javascript:;\">\n <ng-template *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-template>\n </a>\n }\n </thy-dropdown-menu>\n</ng-template>\n\n<ng-template #itemContentTpl let-item>\n @if (itemTemplate()) {\n <ng-template *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-template>\n } @else {\n @if (item?.icon) {\n <thy-icon [thyIconName]=\"item.icon\" class=\"mr-2\"></thy-icon>\n }\n @if (item?.name) {\n <span>{{ item.name }}</span>\n }\n }\n</ng-template>\n\n<ng-content></ng-content>\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ThyBreadcrumbItem, selector: "thy-breadcrumb-item,[thyBreadcrumbItem]", exportAs: ["ThyBreadcrumbItem"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyAction, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "directive", type: ThyDropdownDirective, selector: "[thyDropdown]", inputs: ["thyDropdownMenu", "thyDropdown", "thyTrigger", "thyShowDelay", "thyHideDelay", "thyActiveClass", "thyPopoverOptions", "thyPlacement", "thyMenuInsideClosable", "thyPanelClass"], outputs: ["thyActiveChange"] }, { kind: "directive", type: ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "component", type: ThyDropdownMenuComponent, selector: "thy-dropdown-menu", inputs: ["thyWidth", "thyImmediateRender"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
122
134
|
}
|
|
123
135
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyBreadcrumb, decorators: [{
|
|
124
136
|
type: Component,
|
|
125
137
|
args: [{ selector: 'thy-breadcrumb', exportAs: 'ThyBreadcrumb', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
126
138
|
class: 'thy-breadcrumb',
|
|
127
|
-
'[class.thy-breadcrumb-separator]': '!!thySeparator',
|
|
128
|
-
'[class.thy-breadcrumb-separator-slash]': 'thySeparator === "slash"',
|
|
129
|
-
'[class.thy-breadcrumb-separator-backslash]': 'thySeparator === "backslash"',
|
|
130
|
-
'[class.thy-breadcrumb-separator-vertical-line]': 'thySeparator === "vertical-line"'
|
|
139
|
+
'[class.thy-breadcrumb-separator]': '!!thySeparator()',
|
|
140
|
+
'[class.thy-breadcrumb-separator-slash]': 'thySeparator() === "slash"',
|
|
141
|
+
'[class.thy-breadcrumb-separator-backslash]': 'thySeparator() === "backslash"',
|
|
142
|
+
'[class.thy-breadcrumb-separator-vertical-line]': 'thySeparator() === "vertical-line"'
|
|
131
143
|
}, imports: [
|
|
132
144
|
ThyIcon,
|
|
133
145
|
NgClass,
|
|
@@ -138,24 +150,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
138
150
|
ThyDropdownMenuItemDirective,
|
|
139
151
|
ThyDropdownMenuComponent,
|
|
140
152
|
ThyIcon
|
|
141
|
-
], template: "@if (svgIconName || iconClasses) {\n <div class=\"thy-breadcrumb-icon\">\n @if (svgIconName) {\n <thy-icon [thyIconName]=\"svgIconName\"></thy-icon>\n } @else {\n <i [ngClass]=\"iconClasses\"></i>\n }\n </div>\n}\n\n@for (item of showItems; track $index) {\n <thy-breadcrumb-item class=\"thy-breadcrumb-item-ellipsis\">\n @if (item?._id !== ellipsisItemId) {\n <ng-container *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-container>\n } @else {\n <a\n thyAction\n href=\"javascript:;\"\n thyActionIcon=\"more\"\n thyActiveClass=\"active\"\n [class.disabled]=\"!thyExpandable\"\n class=\"ellipsis-action ml-n1 mr-n1\"\n [thyDropdown]=\"ellipsisList\"></a>\n }\n </thy-breadcrumb-item>\n}\n\n<ng-template #ellipsisList>\n <thy-dropdown-menu thyImmediateRender>\n @for (item of ellipsisItems; track $index) {\n <a thyDropdownMenuItem href=\"javascript:;\">\n <ng-template *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-template>\n </a>\n }\n </thy-dropdown-menu>\n</ng-template>\n\n<ng-template #itemContentTpl let-item>\n @if (itemTemplate) {\n <ng-template *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-template>\n } @else {\n @if (item?.icon) {\n <thy-icon [thyIconName]=\"item.icon\" class=\"mr-2\"></thy-icon>\n }\n @if (item?.name) {\n <span>{{ item.name }}</span>\n }\n }\n</ng-template>\n\n<ng-content></ng-content>\n" }]
|
|
142
|
-
}]
|
|
143
|
-
type: Input
|
|
144
|
-
}], thySeparator: [{
|
|
145
|
-
type: Input
|
|
146
|
-
}], items: [{
|
|
147
|
-
type: Input,
|
|
148
|
-
args: [{ alias: 'thyItems' }]
|
|
149
|
-
}], thyMaxCount: [{
|
|
150
|
-
type: Input,
|
|
151
|
-
args: [{ transform: numberAttribute }]
|
|
152
|
-
}], thyExpandable: [{
|
|
153
|
-
type: Input,
|
|
154
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
155
|
-
}], itemTemplate: [{
|
|
156
|
-
type: ContentChild,
|
|
157
|
-
args: ['item']
|
|
158
|
-
}] } });
|
|
153
|
+
], template: "@if (svgIconName() || iconClasses()) {\n <div class=\"thy-breadcrumb-icon\">\n @if (svgIconName()) {\n <thy-icon [thyIconName]=\"svgIconName()\"></thy-icon>\n } @else {\n <i [ngClass]=\"iconClasses()\"></i>\n }\n </div>\n}\n\n@for (item of processedItems()?.showItems; track $index) {\n <thy-breadcrumb-item class=\"thy-breadcrumb-item-ellipsis\">\n @if (item?._id !== ellipsisItemId) {\n <ng-container *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-container>\n } @else {\n <a\n thyAction\n href=\"javascript:;\"\n thyActionIcon=\"more\"\n thyActiveClass=\"active\"\n [class.disabled]=\"!thyExpandable()\"\n class=\"ellipsis-action ml-n1 mr-n1\"\n [thyDropdown]=\"ellipsisList\"></a>\n }\n </thy-breadcrumb-item>\n}\n\n<ng-template #ellipsisList>\n <thy-dropdown-menu thyImmediateRender>\n @for (item of processedItems()?.ellipsisItems; track $index) {\n <a thyDropdownMenuItem href=\"javascript:;\">\n <ng-template *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-template>\n </a>\n }\n </thy-dropdown-menu>\n</ng-template>\n\n<ng-template #itemContentTpl let-item>\n @if (itemTemplate()) {\n <ng-template *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-template>\n } @else {\n @if (item?.icon) {\n <thy-icon [thyIconName]=\"item.icon\" class=\"mr-2\"></thy-icon>\n }\n @if (item?.name) {\n <span>{{ item.name }}</span>\n }\n }\n</ng-template>\n\n<ng-content></ng-content>\n" }]
|
|
154
|
+
}] });
|
|
159
155
|
|
|
160
156
|
class ThyBreadcrumbModule {
|
|
161
157
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyBreadcrumbModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-breadcrumb.mjs","sources":["../../../src/breadcrumb/breadcrumb-item.component.ts","../../../src/breadcrumb/breadcrumb.component.ts","../../../src/breadcrumb/breadcrumb.component.html","../../../src/breadcrumb/module.ts","../../../src/breadcrumb/ngx-tethys-breadcrumb.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, AfterViewInit, ElementRef, Renderer2, inject } from '@angular/core';\nimport { ThyIcon } from 'ngx-tethys/icon';\n\n/**\n * 面包屑 Item 组件\n * @name thy-breadcrumb-item,[thyBreadcrumbItem]\n * @order 20\n */\n@Component({\n selector: 'thy-breadcrumb-item,[thyBreadcrumbItem]',\n template: '<ng-content></ng-content><thy-icon class=\"separator-icon\" thyIconName=\"angle-right\"></thy-icon>',\n exportAs: 'ThyBreadcrumbItem',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-breadcrumb-item'\n },\n imports: [ThyIcon]\n})\nexport class ThyBreadcrumbItem implements AfterViewInit {\n private renderer = inject(Renderer2);\n private elementRef = inject(ElementRef);\n\n ngAfterViewInit() {\n this.wrapSpanForText(this.elementRef.nativeElement.childNodes);\n const link: HTMLElement = this.elementRef.nativeElement.querySelector('a');\n if (link && link.childNodes) {\n this.wrapSpanForText(link.childNodes);\n }\n }\n\n private wrapSpanForText(nodes: NodeList): void {\n nodes.forEach(node => {\n if (node.nodeName === '#text') {\n const span = this.renderer.createElement('span');\n const parent = this.renderer.parentNode(node);\n this.renderer.addClass(span, 'thy-wrap-span');\n this.renderer.insertBefore(parent, span, node);\n this.renderer.appendChild(span, node);\n }\n });\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n Input,\n ContentChild,\n TemplateRef,\n numberAttribute,\n OnChanges,\n SimpleChanges,\n OnInit,\n ChangeDetectorRef,\n inject\n} from '@angular/core';\nimport { ThyIcon } from 'ngx-tethys/icon';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { ThyBreadcrumbItem } from './breadcrumb-item.component';\nimport { SafeAny } from 'ngx-tethys/types';\nimport {\n ThyDropdownDirective,\n ThyDropdownMenuComponent,\n ThyDropdownMenuItemDirective,\n ThyDropdownMenuItemNameDirective\n} from 'ngx-tethys/dropdown';\nimport { ThyAction } from 'ngx-tethys/action';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\nconst THY_BREADCRUMB_ITEM_ELLIPSIS_ID = 'THY_BREADCRUMB_ITEM_ELLIPSIS_ID';\n\nconst ELLIPSIS_ITEM = { _id: THY_BREADCRUMB_ITEM_ELLIPSIS_ID };\n\n/**\n * 面包屑组件\n * @name thy-breadcrumb\n * @order 10\n */\n@Component({\n selector: 'thy-breadcrumb',\n templateUrl: './breadcrumb.component.html',\n exportAs: 'ThyBreadcrumb',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-breadcrumb',\n '[class.thy-breadcrumb-separator]': '!!thySeparator',\n '[class.thy-breadcrumb-separator-slash]': 'thySeparator === \"slash\"',\n '[class.thy-breadcrumb-separator-backslash]': 'thySeparator === \"backslash\"',\n '[class.thy-breadcrumb-separator-vertical-line]': 'thySeparator === \"vertical-line\"'\n },\n imports: [\n ThyIcon,\n NgClass,\n ThyBreadcrumbItem,\n NgTemplateOutlet,\n ThyAction,\n ThyDropdownDirective,\n ThyDropdownMenuItemDirective,\n ThyDropdownMenuComponent,\n ThyIcon\n ]\n})\nexport class ThyBreadcrumb implements OnInit, OnChanges {\n private cdr = inject(ChangeDetectorRef);\n\n iconClasses: string[];\n svgIconName: string;\n\n /**\n * 面包屑的前缀 展示图标,如 folder-fill\n */\n @Input()\n set thyIcon(icon: string) {\n this.setIcon(icon);\n }\n\n /**\n * 面包屑的分隔符,不传值默认为 \">\"\n * @type slash | backslash | vertical-line\n */\n @Input() thySeparator: 'slash' | 'backslash' | 'vertical-line';\n\n /**\n * 面包屑的每一项数据\n */\n @Input({ alias: 'thyItems' }) items: SafeAny[];\n\n /**\n * 最大显示数量,超出此数量后,面包屑会被省略, 0 表示不省略(仅当传入 thyItems 时有效)\n */\n @Input({ transform: numberAttribute }) thyMaxCount = 4;\n\n /**\n * 是否可点击弹出已被省略的面包屑项(仅当传入 thyItems 时有效)\n */\n @Input({ transform: coerceBooleanProperty }) thyExpandable = true;\n\n /**\n * 面包屑的每一项模板(仅当传入 thyItems 时有效)\n */\n @ContentChild('item') itemTemplate: TemplateRef<SafeAny>;\n\n public ellipsisItemId = THY_BREADCRUMB_ITEM_ELLIPSIS_ID;\n\n public ellipsisItems: SafeAny[];\n\n public showItems: SafeAny[];\n\n ngOnInit() {\n this.resetItems();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if ((changes.items && !changes.items.firstChange) || (changes.thyMaxCount && !changes.thyMaxCount.firstChange)) {\n this.resetItems();\n }\n }\n\n private setIcon(icon: string) {\n if (icon) {\n if (icon.includes('wtf')) {\n const classes = icon.split(' ');\n if (classes.length === 1) {\n classes.unshift('wtf');\n }\n this.iconClasses = classes;\n } else {\n this.svgIconName = icon;\n }\n } else {\n this.iconClasses = null;\n this.svgIconName = null;\n }\n }\n\n private resetItems() {\n if (!this.items?.length) {\n return;\n }\n if (this.thyMaxCount && this.items.length > this.thyMaxCount) {\n const ellipsisIndex = this.items.length - this.thyMaxCount + 2;\n this.ellipsisItems = this.items.slice(1, ellipsisIndex);\n this.showItems = [this.items[0], ELLIPSIS_ITEM, ...this.items.slice(ellipsisIndex)];\n } else {\n this.showItems = [...this.items];\n this.ellipsisItems = [];\n }\n }\n}\n","@if (svgIconName || iconClasses) {\n <div class=\"thy-breadcrumb-icon\">\n @if (svgIconName) {\n <thy-icon [thyIconName]=\"svgIconName\"></thy-icon>\n } @else {\n <i [ngClass]=\"iconClasses\"></i>\n }\n </div>\n}\n\n@for (item of showItems; track $index) {\n <thy-breadcrumb-item class=\"thy-breadcrumb-item-ellipsis\">\n @if (item?._id !== ellipsisItemId) {\n <ng-container *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-container>\n } @else {\n <a\n thyAction\n href=\"javascript:;\"\n thyActionIcon=\"more\"\n thyActiveClass=\"active\"\n [class.disabled]=\"!thyExpandable\"\n class=\"ellipsis-action ml-n1 mr-n1\"\n [thyDropdown]=\"ellipsisList\"></a>\n }\n </thy-breadcrumb-item>\n}\n\n<ng-template #ellipsisList>\n <thy-dropdown-menu thyImmediateRender>\n @for (item of ellipsisItems; track $index) {\n <a thyDropdownMenuItem href=\"javascript:;\">\n <ng-template *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-template>\n </a>\n }\n </thy-dropdown-menu>\n</ng-template>\n\n<ng-template #itemContentTpl let-item>\n @if (itemTemplate) {\n <ng-template *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-template>\n } @else {\n @if (item?.icon) {\n <thy-icon [thyIconName]=\"item.icon\" class=\"mr-2\"></thy-icon>\n }\n @if (item?.name) {\n <span>{{ item.name }}</span>\n }\n }\n</ng-template>\n\n<ng-content></ng-content>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ThyBreadcrumb } from './breadcrumb.component';\nimport { ThyBreadcrumbItem } from './breadcrumb-item.component';\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThyActionModule } from 'ngx-tethys/action';\nimport { ThyDropdownModule } from 'ngx-tethys/dropdown';\n\n@NgModule({\n imports: [CommonModule, ThyIconModule, ThyBreadcrumb, ThyBreadcrumbItem, ThyActionModule, ThyDropdownModule],\n exports: [ThyBreadcrumb, ThyBreadcrumbItem]\n})\nexport class ThyBreadcrumbModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGA;;;;AAIG;MAWU,iBAAiB,CAAA;AAV9B,IAAA,WAAA,GAAA;AAWY,QAAA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;uBAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE;gBAKrB,YAAY,EAAA,CAAA;sBAAjC,YAAY;uBAAC,MAAM;;;MErFX,mBAAmB,CAAA;8GAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EAHlB,OAAA,EAAA,CAAA,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,CACjG,EAAA,OAAA,EAAA,CAAA,aAAa,EAAE,iBAAiB,CAAA,EAAA,CAAA,CAAA;+GAEjC,mBAAmB,EAAA,OAAA,EAAA,CAHlB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,CAAA,EAAA,CAAA,CAAA;;2FAGlG,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,CAAC;AAC5G,oBAAA,OAAO,EAAE,CAAC,aAAa,EAAE,iBAAiB;AAC7C,iBAAA;;;ACXD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-tethys-breadcrumb.mjs","sources":["../../../src/breadcrumb/breadcrumb-item.component.ts","../../../src/breadcrumb/breadcrumb.component.ts","../../../src/breadcrumb/breadcrumb.component.html","../../../src/breadcrumb/module.ts","../../../src/breadcrumb/ngx-tethys-breadcrumb.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, AfterViewInit, ElementRef, Renderer2, inject } from '@angular/core';\nimport { ThyIcon } from 'ngx-tethys/icon';\n\n/**\n * 面包屑 Item 组件\n * @name thy-breadcrumb-item,[thyBreadcrumbItem]\n * @order 20\n */\n@Component({\n selector: 'thy-breadcrumb-item,[thyBreadcrumbItem]',\n template: '<ng-content></ng-content><thy-icon class=\"separator-icon\" thyIconName=\"angle-right\"></thy-icon>',\n exportAs: 'ThyBreadcrumbItem',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-breadcrumb-item'\n },\n imports: [ThyIcon]\n})\nexport class ThyBreadcrumbItem implements AfterViewInit {\n private renderer = inject(Renderer2);\n private elementRef = inject(ElementRef);\n\n ngAfterViewInit() {\n this.wrapSpanForText(this.elementRef.nativeElement.childNodes);\n const link: HTMLElement = this.elementRef.nativeElement.querySelector('a');\n if (link && link.childNodes) {\n this.wrapSpanForText(link.childNodes);\n }\n }\n\n private wrapSpanForText(nodes: NodeList): void {\n nodes.forEach(node => {\n if (node.nodeName === '#text') {\n const span = this.renderer.createElement('span');\n const parent = this.renderer.parentNode(node);\n this.renderer.addClass(span, 'thy-wrap-span');\n this.renderer.insertBefore(parent, span, node);\n this.renderer.appendChild(span, node);\n }\n });\n }\n}\n","import { Component, ChangeDetectionStrategy, TemplateRef, numberAttribute, input, contentChild, Signal, computed } from '@angular/core';\nimport { ThyIcon } from 'ngx-tethys/icon';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { ThyBreadcrumbItem } from './breadcrumb-item.component';\nimport { SafeAny } from 'ngx-tethys/types';\nimport { ThyDropdownDirective, ThyDropdownMenuComponent, ThyDropdownMenuItemDirective } from 'ngx-tethys/dropdown';\nimport { ThyAction } from 'ngx-tethys/action';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\nconst THY_BREADCRUMB_ITEM_ELLIPSIS_ID = 'THY_BREADCRUMB_ITEM_ELLIPSIS_ID';\n\nconst ELLIPSIS_ITEM = { _id: THY_BREADCRUMB_ITEM_ELLIPSIS_ID };\n\n/**\n * 面包屑组件\n * @name thy-breadcrumb\n * @order 10\n */\n@Component({\n selector: 'thy-breadcrumb',\n templateUrl: './breadcrumb.component.html',\n exportAs: 'ThyBreadcrumb',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-breadcrumb',\n '[class.thy-breadcrumb-separator]': '!!thySeparator()',\n '[class.thy-breadcrumb-separator-slash]': 'thySeparator() === \"slash\"',\n '[class.thy-breadcrumb-separator-backslash]': 'thySeparator() === \"backslash\"',\n '[class.thy-breadcrumb-separator-vertical-line]': 'thySeparator() === \"vertical-line\"'\n },\n imports: [\n ThyIcon,\n NgClass,\n ThyBreadcrumbItem,\n NgTemplateOutlet,\n ThyAction,\n ThyDropdownDirective,\n ThyDropdownMenuItemDirective,\n ThyDropdownMenuComponent,\n ThyIcon\n ]\n})\nexport class ThyBreadcrumb {\n /**\n * 面包屑的前缀 展示图标,如 folder-fill\n */\n readonly thyIcon = input<string>();\n\n iconClasses: Signal<string[]> = computed(() => {\n const icon = this.thyIcon();\n if (icon && icon.includes('wtf')) {\n const classes = icon.split(' ');\n if (classes.length === 1) {\n classes.unshift('wtf');\n }\n return classes;\n } else {\n return null;\n }\n });\n\n svgIconName: Signal<string> = computed(() => {\n const icon = this.thyIcon();\n if (icon && !icon.includes('wtf')) {\n return icon;\n } else {\n return null;\n }\n });\n\n /**\n * 面包屑的分隔符,不传值默认为 \">\"\n * @type slash | backslash | vertical-line\n */\n readonly thySeparator = input<'slash' | 'backslash' | 'vertical-line'>();\n\n /**\n * 面包屑的每一项数据\n */\n readonly items = input<SafeAny[]>(undefined, { alias: 'thyItems' });\n\n /**\n * 最大显示数量,超出此数量后,面包屑会被省略, 0 表示不省略(仅当传入 thyItems 时有效)\n */\n readonly thyMaxCount = input(4, { transform: numberAttribute });\n\n /**\n * 是否可点击弹出已被省略的面包屑项(仅当传入 thyItems 时有效)\n */\n readonly thyExpandable = input(true, { transform: coerceBooleanProperty });\n\n /**\n * 面包屑的每一项模板(仅当传入 thyItems 时有效)\n */\n readonly itemTemplate = contentChild<TemplateRef<SafeAny>>('item');\n\n public ellipsisItemId = THY_BREADCRUMB_ITEM_ELLIPSIS_ID;\n\n public readonly processedItems: Signal<{\n ellipsisItems: SafeAny[];\n showItems: SafeAny[];\n }> = computed(() => {\n const items = this.items();\n if (!items?.length) {\n return;\n }\n const thyMaxCount = this.thyMaxCount();\n if (thyMaxCount && items.length > thyMaxCount) {\n const ellipsisIndex = items.length - thyMaxCount + 2;\n return {\n ellipsisItems: items.slice(1, ellipsisIndex),\n showItems: [items[0], ELLIPSIS_ITEM, ...items.slice(ellipsisIndex)]\n };\n } else {\n return {\n ellipsisItems: [],\n showItems: [...items]\n };\n }\n });\n}\n","@if (svgIconName() || iconClasses()) {\n <div class=\"thy-breadcrumb-icon\">\n @if (svgIconName()) {\n <thy-icon [thyIconName]=\"svgIconName()\"></thy-icon>\n } @else {\n <i [ngClass]=\"iconClasses()\"></i>\n }\n </div>\n}\n\n@for (item of processedItems()?.showItems; track $index) {\n <thy-breadcrumb-item class=\"thy-breadcrumb-item-ellipsis\">\n @if (item?._id !== ellipsisItemId) {\n <ng-container *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-container>\n } @else {\n <a\n thyAction\n href=\"javascript:;\"\n thyActionIcon=\"more\"\n thyActiveClass=\"active\"\n [class.disabled]=\"!thyExpandable()\"\n class=\"ellipsis-action ml-n1 mr-n1\"\n [thyDropdown]=\"ellipsisList\"></a>\n }\n </thy-breadcrumb-item>\n}\n\n<ng-template #ellipsisList>\n <thy-dropdown-menu thyImmediateRender>\n @for (item of processedItems()?.ellipsisItems; track $index) {\n <a thyDropdownMenuItem href=\"javascript:;\">\n <ng-template *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-template>\n </a>\n }\n </thy-dropdown-menu>\n</ng-template>\n\n<ng-template #itemContentTpl let-item>\n @if (itemTemplate()) {\n <ng-template *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-template>\n } @else {\n @if (item?.icon) {\n <thy-icon [thyIconName]=\"item.icon\" class=\"mr-2\"></thy-icon>\n }\n @if (item?.name) {\n <span>{{ item.name }}</span>\n }\n }\n</ng-template>\n\n<ng-content></ng-content>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ThyBreadcrumb } from './breadcrumb.component';\nimport { ThyBreadcrumbItem } from './breadcrumb-item.component';\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThyActionModule } from 'ngx-tethys/action';\nimport { ThyDropdownModule } from 'ngx-tethys/dropdown';\n\n@NgModule({\n imports: [CommonModule, ThyIconModule, ThyBreadcrumb, ThyBreadcrumbItem, ThyActionModule, ThyDropdownModule],\n exports: [ThyBreadcrumb, ThyBreadcrumbItem]\n})\nexport class ThyBreadcrumbModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGA;;;;AAIG;MAWU,iBAAiB,CAAA;AAV9B,IAAA,WAAA,GAAA;AAWY,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAqB1C;IAnBG,eAAe,GAAA;QACX,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC;AAC9D,QAAA,MAAM,IAAI,GAAgB,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC;AAC1E,QAAA,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,YAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC;;;AAIrC,IAAA,eAAe,CAAC,KAAe,EAAA;AACnC,QAAA,KAAK,CAAC,OAAO,CAAC,IAAI,IAAG;AACjB,YAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,OAAO,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E,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,CAAC;AAC5G,oBAAA,OAAO,EAAE,CAAC,aAAa,EAAE,iBAAiB;AAC7C,iBAAA;;;ACXD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectorRef,
|
|
2
|
+
import { inject, ChangeDetectorRef, input, output, effect, HostBinding, Component, Directive, contentChild, TemplateRef, computed, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet, JsonPipe, CommonModule } from '@angular/common';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
@@ -24,18 +24,26 @@ class ThyCalendarHeader {
|
|
|
24
24
|
this.dateHelper = inject(DateHelperService);
|
|
25
25
|
this.locale = injectLocale('calendar');
|
|
26
26
|
this.className = true;
|
|
27
|
+
/**
|
|
28
|
+
* 当前选中日期
|
|
29
|
+
*/
|
|
30
|
+
this.currentDate = input();
|
|
31
|
+
/**
|
|
32
|
+
* 自定义渲染右侧操作项
|
|
33
|
+
*/
|
|
34
|
+
this.operationRender = input();
|
|
27
35
|
/**
|
|
28
36
|
* 日期选择范围(年)发生变化的回调
|
|
29
37
|
*/
|
|
30
|
-
this.yearChange =
|
|
38
|
+
this.yearChange = output();
|
|
31
39
|
/**
|
|
32
40
|
* 日期选择范围(月)发生变化的回调
|
|
33
41
|
*/
|
|
34
|
-
this.monthChange =
|
|
42
|
+
this.monthChange = output();
|
|
35
43
|
/**
|
|
36
44
|
* 日期选择范围(日期)发生变化的回调
|
|
37
45
|
*/
|
|
38
|
-
this.dateRangeChange =
|
|
46
|
+
this.dateRangeChange = output();
|
|
39
47
|
this.pickerFormat = this.locale().yearMonthFormat;
|
|
40
48
|
this.dateRanges = [
|
|
41
49
|
{
|
|
@@ -49,12 +57,9 @@ class ThyCalendarHeader {
|
|
|
49
57
|
}
|
|
50
58
|
}
|
|
51
59
|
];
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
*/
|
|
56
|
-
set currentDate(value) {
|
|
57
|
-
this.setDate(value);
|
|
60
|
+
effect(() => {
|
|
61
|
+
this.setDate();
|
|
62
|
+
});
|
|
58
63
|
}
|
|
59
64
|
ngOnInit() { }
|
|
60
65
|
onChangeMonth(month) {
|
|
@@ -77,10 +82,11 @@ class ThyCalendarHeader {
|
|
|
77
82
|
this.onChangeRange(this.date);
|
|
78
83
|
this.cdr.detectChanges();
|
|
79
84
|
}
|
|
80
|
-
setDate(
|
|
81
|
-
this.
|
|
85
|
+
setDate() {
|
|
86
|
+
const currentDate = this.currentDate();
|
|
87
|
+
this.isCurrentDate(currentDate);
|
|
82
88
|
if (this.isCurrent) {
|
|
83
|
-
this._currentDate =
|
|
89
|
+
this._currentDate = currentDate;
|
|
84
90
|
const dateRange = {
|
|
85
91
|
...this.dateRanges[0],
|
|
86
92
|
key: 'exception',
|
|
@@ -100,24 +106,14 @@ class ThyCalendarHeader {
|
|
|
100
106
|
currentDate.getMonth() !== getMonth(new TinyDate().getTime()) || currentDate.getYear() !== getYear(new TinyDate().getTime());
|
|
101
107
|
}
|
|
102
108
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyCalendarHeader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
103
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyCalendarHeader, isStandalone: true, selector: "thy-calendar-header", inputs: { currentDate: "currentDate", operationRender: "operationRender" }, outputs: { yearChange: "yearChange", monthChange: "monthChange", dateRangeChange: "dateRangeChange" }, host: { properties: { "class.thy-calendar-full-header-container": "this.className" } }, ngImport: i0, template: "<div class=\"thy-calendar-full-header-left\">\n <thy-date-range\n class=\"select-date-range\"\n [ngModel]=\"date\"\n [thyHiddenMenu]=\"true\"\n [thyCustomKey]=\"'exception'\"\n [thyPickerFormat]=\"pickerFormat\"\n (ngModelChange)=\"onChangeRange($event)\"></thy-date-range>\n @if (isCurrent) {\n <button thyButton=\"outline-default-square\" thySize=\"md\" (click)=\"backToday()\">{{ locale().today }}</button>\n }\n</div>\n<div class=\"thy-calendar-full-header-right\">\n <ng-container *ngTemplateOutlet=\"$any(operationRender); context: { $implicit: operationRender }\">\n <span>{{ operationRender | json }}</span>\n </ng-container>\n</div>\n", dependencies: [{ kind: "component", type: ThyDateRange, selector: "thy-date-range", inputs: ["thyOptionalDateRanges", "thyHiddenMenu", "thyDisabledSwitch", "thyCustomTextValue", "thyMinDate", "thyMaxDate", "thyCustomKey", "thyPickerFormat", "thyDisabledDate", "thySeparator"], outputs: ["thyOnCalendarChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThyButton, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thyBlock"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: JsonPipe, name: "json" }] }); }
|
|
109
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyCalendarHeader, isStandalone: true, selector: "thy-calendar-header", inputs: { currentDate: { classPropertyName: "currentDate", publicName: "currentDate", isSignal: true, isRequired: false, transformFunction: null }, operationRender: { classPropertyName: "operationRender", publicName: "operationRender", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { yearChange: "yearChange", monthChange: "monthChange", dateRangeChange: "dateRangeChange" }, host: { properties: { "class.thy-calendar-full-header-container": "this.className" } }, ngImport: i0, template: "<div class=\"thy-calendar-full-header-left\">\n <thy-date-range\n class=\"select-date-range\"\n [ngModel]=\"date\"\n [thyHiddenMenu]=\"true\"\n [thyCustomKey]=\"'exception'\"\n [thyPickerFormat]=\"pickerFormat\"\n (ngModelChange)=\"onChangeRange($event)\"></thy-date-range>\n @if (isCurrent) {\n <button thyButton=\"outline-default-square\" thySize=\"md\" (click)=\"backToday()\">{{ locale().today }}</button>\n }\n</div>\n<div class=\"thy-calendar-full-header-right\">\n <ng-container *ngTemplateOutlet=\"$any(operationRender()); context: { $implicit: operationRender() }\">\n <span>{{ operationRender() | json }}</span>\n </ng-container>\n</div>\n", dependencies: [{ kind: "component", type: ThyDateRange, selector: "thy-date-range", inputs: ["thyOptionalDateRanges", "thyHiddenMenu", "thyDisabledSwitch", "thyCustomTextValue", "thyMinDate", "thyMaxDate", "thyCustomKey", "thyPickerFormat", "thyDisabledDate", "thySeparator"], outputs: ["thyOnCalendarChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThyButton, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thyBlock"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: JsonPipe, name: "json" }] }); }
|
|
104
110
|
}
|
|
105
111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyCalendarHeader, decorators: [{
|
|
106
112
|
type: Component,
|
|
107
|
-
args: [{ selector: 'thy-calendar-header', imports: [ThyDateRange, FormsModule, ThyButton, NgTemplateOutlet, JsonPipe], template: "<div class=\"thy-calendar-full-header-left\">\n <thy-date-range\n class=\"select-date-range\"\n [ngModel]=\"date\"\n [thyHiddenMenu]=\"true\"\n [thyCustomKey]=\"'exception'\"\n [thyPickerFormat]=\"pickerFormat\"\n (ngModelChange)=\"onChangeRange($event)\"></thy-date-range>\n @if (isCurrent) {\n <button thyButton=\"outline-default-square\" thySize=\"md\" (click)=\"backToday()\">{{ locale().today }}</button>\n }\n</div>\n<div class=\"thy-calendar-full-header-right\">\n <ng-container *ngTemplateOutlet=\"$any(operationRender); context: { $implicit: operationRender }\">\n <span>{{ operationRender | json }}</span>\n </ng-container>\n</div>\n" }]
|
|
108
|
-
}], propDecorators: { className: [{
|
|
113
|
+
args: [{ selector: 'thy-calendar-header', imports: [ThyDateRange, FormsModule, ThyButton, NgTemplateOutlet, JsonPipe], template: "<div class=\"thy-calendar-full-header-left\">\n <thy-date-range\n class=\"select-date-range\"\n [ngModel]=\"date\"\n [thyHiddenMenu]=\"true\"\n [thyCustomKey]=\"'exception'\"\n [thyPickerFormat]=\"pickerFormat\"\n (ngModelChange)=\"onChangeRange($event)\"></thy-date-range>\n @if (isCurrent) {\n <button thyButton=\"outline-default-square\" thySize=\"md\" (click)=\"backToday()\">{{ locale().today }}</button>\n }\n</div>\n<div class=\"thy-calendar-full-header-right\">\n <ng-container *ngTemplateOutlet=\"$any(operationRender()); context: { $implicit: operationRender() }\">\n <span>{{ operationRender() | json }}</span>\n </ng-container>\n</div>\n" }]
|
|
114
|
+
}], ctorParameters: () => [], propDecorators: { className: [{
|
|
109
115
|
type: HostBinding,
|
|
110
116
|
args: ['class.thy-calendar-full-header-container']
|
|
111
|
-
}], currentDate: [{
|
|
112
|
-
type: Input
|
|
113
|
-
}], operationRender: [{
|
|
114
|
-
type: Input
|
|
115
|
-
}], yearChange: [{
|
|
116
|
-
type: Output
|
|
117
|
-
}], monthChange: [{
|
|
118
|
-
type: Output
|
|
119
|
-
}], dateRangeChange: [{
|
|
120
|
-
type: Output
|
|
121
117
|
}] } });
|
|
122
118
|
|
|
123
119
|
/**
|
|
@@ -157,38 +153,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
157
153
|
* @order 10
|
|
158
154
|
*/
|
|
159
155
|
class ThyCalendar {
|
|
160
|
-
constructor() {
|
|
161
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
162
|
-
this.className = true;
|
|
163
|
-
this.className1 = true;
|
|
164
|
-
/**
|
|
165
|
-
* 展示模式
|
|
166
|
-
* @type month | year
|
|
167
|
-
*/
|
|
168
|
-
this.thyMode = 'month';
|
|
169
|
-
/**
|
|
170
|
-
* 日期选择变化的回调
|
|
171
|
-
*/
|
|
172
|
-
this.thySelectChange = new EventEmitter();
|
|
173
|
-
/**
|
|
174
|
-
* 日期选择变化的回调
|
|
175
|
-
*/
|
|
176
|
-
this.thyValueChange = new EventEmitter();
|
|
177
|
-
/**
|
|
178
|
-
* 日期选择范围变化的回调
|
|
179
|
-
*/
|
|
180
|
-
this.thyDateRangeChange = new EventEmitter();
|
|
181
|
-
this.currentDate = new TinyDate();
|
|
182
|
-
this.prefixCls = 'thy-calendar-full';
|
|
183
|
-
this.onChangeFn = () => { };
|
|
184
|
-
this.onTouchFn = () => { };
|
|
185
|
-
}
|
|
186
|
-
get dateCell() {
|
|
187
|
-
return (this.thyDateCell || this.thyDateCellChild);
|
|
188
|
-
}
|
|
189
|
-
get headerOperation() {
|
|
190
|
-
return (this.thyCalendarHeaderOperation || this.thyCalendarHeaderOperationChild);
|
|
191
|
-
}
|
|
192
156
|
ngOnInit() { }
|
|
193
157
|
onYearSelect(year) {
|
|
194
158
|
const date = this.currentDate.setYear(year);
|
|
@@ -225,45 +189,79 @@ class ThyCalendar {
|
|
|
225
189
|
this.thyValueChange.emit(date.nativeDate);
|
|
226
190
|
}
|
|
227
191
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
192
|
+
constructor() {
|
|
193
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
194
|
+
this.className = true;
|
|
195
|
+
this.className1 = true;
|
|
196
|
+
/**
|
|
197
|
+
* 展示模式
|
|
198
|
+
* @type month | year
|
|
199
|
+
*/
|
|
200
|
+
this.thyMode = input('month');
|
|
201
|
+
/**
|
|
202
|
+
* (可双向绑定)展示日期,默认为当前日期
|
|
203
|
+
*/
|
|
204
|
+
this.thyValue = input();
|
|
205
|
+
/**
|
|
206
|
+
* 不可选择的日期
|
|
207
|
+
*/
|
|
208
|
+
this.thyDisabledDate = input();
|
|
209
|
+
/**
|
|
210
|
+
* 日期选择变化的回调
|
|
211
|
+
*/
|
|
212
|
+
this.thySelectChange = output();
|
|
213
|
+
/**
|
|
214
|
+
* 日期选择变化的回调
|
|
215
|
+
*/
|
|
216
|
+
this.thyValueChange = output();
|
|
217
|
+
/**
|
|
218
|
+
* 日期选择范围变化的回调
|
|
219
|
+
*/
|
|
220
|
+
this.thyDateRangeChange = output();
|
|
221
|
+
/**
|
|
222
|
+
* (可作为内容)自定义渲染日期单元格,模板内容会被追加到单元格
|
|
223
|
+
*/
|
|
224
|
+
this.thyDateCell = input();
|
|
225
|
+
/**
|
|
226
|
+
* 追加到单元格的自定义模板
|
|
227
|
+
*/
|
|
228
|
+
this.thyDateCellChild = contentChild(ThyDateCellDirective, { read: TemplateRef });
|
|
229
|
+
this.dateCell = computed(() => {
|
|
230
|
+
return (this.thyDateCell() || this.thyDateCellChild());
|
|
231
|
+
});
|
|
232
|
+
/**
|
|
233
|
+
* (可作为内容)自定义渲染右上角操作项
|
|
234
|
+
*/
|
|
235
|
+
this.thyCalendarHeaderOperation = input();
|
|
236
|
+
/**
|
|
237
|
+
* 右上角操作项的自定义模板
|
|
238
|
+
*/
|
|
239
|
+
this.thyCalendarHeaderOperationChild = contentChild(ThyCalendarHeaderOperationDirective, { read: TemplateRef });
|
|
240
|
+
this.headerOperation = computed(() => {
|
|
241
|
+
return (this.thyCalendarHeaderOperation() || this.thyCalendarHeaderOperationChild());
|
|
242
|
+
});
|
|
243
|
+
this.currentDate = new TinyDate();
|
|
244
|
+
this.prefixCls = 'thy-calendar-full';
|
|
245
|
+
this.onChangeFn = () => { };
|
|
246
|
+
this.onTouchFn = () => { };
|
|
247
|
+
effect(() => {
|
|
248
|
+
if (this.thyValue()) {
|
|
249
|
+
this.updateDate(new TinyDate(this.thyValue()), false);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
232
252
|
}
|
|
233
253
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
234
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyCalendar, isStandalone: true, selector: "thy-calendar", inputs: { thyMode: "thyMode", thyValue: "thyValue", thyDisabledDate: "thyDisabledDate", thyDateCell: "thyDateCell", thyCalendarHeaderOperation: "thyCalendarHeaderOperation" }, outputs: { thySelectChange: "thySelectChange", thyValueChange: "thyValueChange", thyDateRangeChange: "thyDateRangeChange" }, host: { properties: { "class.thy-calendar-container": "this.className", "class.thy-calendar-full": "this.className1" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ThyCalendar), multi: true }], queries: [{ propertyName: "thyDateCellChild", first: true, predicate: ThyDateCellDirective, descendants: true, read: TemplateRef }, { propertyName: "thyCalendarHeaderOperationChild", first: true, predicate: ThyCalendarHeaderOperationDirective, descendants: true, read: TemplateRef
|
|
254
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyCalendar, isStandalone: true, selector: "thy-calendar", inputs: { thyMode: { classPropertyName: "thyMode", publicName: "thyMode", isSignal: true, isRequired: false, transformFunction: null }, thyValue: { classPropertyName: "thyValue", publicName: "thyValue", isSignal: true, isRequired: false, transformFunction: null }, thyDisabledDate: { classPropertyName: "thyDisabledDate", publicName: "thyDisabledDate", isSignal: true, isRequired: false, transformFunction: null }, thyDateCell: { classPropertyName: "thyDateCell", publicName: "thyDateCell", isSignal: true, isRequired: false, transformFunction: null }, thyCalendarHeaderOperation: { classPropertyName: "thyCalendarHeaderOperation", publicName: "thyCalendarHeaderOperation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thySelectChange: "thySelectChange", thyValueChange: "thyValueChange", thyDateRangeChange: "thyDateRangeChange" }, host: { properties: { "class.thy-calendar-container": "this.className", "class.thy-calendar-full": "this.className1" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ThyCalendar), multi: true }], queries: [{ propertyName: "thyDateCellChild", first: true, predicate: ThyDateCellDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "thyCalendarHeaderOperationChild", first: true, predicate: ThyCalendarHeaderOperationDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<thy-calendar-header\n [operationRender]=\"headerOperation()\"\n (monthChange)=\"onMonthSelect($event)\"\n (yearChange)=\"onYearSelect($event)\"\n (dateRangeChange)=\"onDateRangeSelect($event)\"\n [currentDate]=\"currentDate\"></thy-calendar-header>\n\n<div class=\"thy-calendar-panel\">\n <div class=\"thy-calendar-{{ thyMode() === 'month' ? 'date' : 'month' }}-panel\">\n <div class=\"thy-calendar-body\">\n @if (thyMode() === 'month') {\n <date-table\n [prefixCls]=\"prefixCls\"\n [value]=\"currentDate\"\n [activeDate]=\"currentDate\"\n [selectedValue]=\"currentDate\"\n [cellRender]=\"dateCell()\"\n [disabledDate]=\"thyDisabledDate()\"\n (valueChange)=\"onDateSelect($event)\"></date-table>\n } @else {\n <month-table [value]=\"currentDate\" [disabledDate]=\"thyDisabledDate()\" (valueChange)=\"onDateSelect($event)\"></month-table>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ThyCalendarHeader, selector: "thy-calendar-header", inputs: ["currentDate", "operationRender"], outputs: ["yearChange", "monthChange", "dateRangeChange"] }, { kind: "component", type: DateTable, selector: "date-table", outputs: ["dayHover"], exportAs: ["dateTable"] }, { kind: "component", type: MonthTable, selector: "month-table", exportAs: ["monthTable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
235
255
|
}
|
|
236
256
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyCalendar, decorators: [{
|
|
237
257
|
type: Component,
|
|
238
|
-
args: [{ selector: 'thy-calendar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ThyCalendar), multi: true }], imports: [ThyCalendarHeader, DateTable, MonthTable], template: "<thy-calendar-header\n [operationRender]=\"headerOperation\"\n (monthChange)=\"onMonthSelect($event)\"\n (yearChange)=\"onYearSelect($event)\"\n (dateRangeChange)=\"onDateRangeSelect($event)\"\n [currentDate]=\"currentDate\"
|
|
239
|
-
}], propDecorators: { className: [{
|
|
258
|
+
args: [{ selector: 'thy-calendar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ThyCalendar), multi: true }], imports: [ThyCalendarHeader, DateTable, MonthTable], template: "<thy-calendar-header\n [operationRender]=\"headerOperation()\"\n (monthChange)=\"onMonthSelect($event)\"\n (yearChange)=\"onYearSelect($event)\"\n (dateRangeChange)=\"onDateRangeSelect($event)\"\n [currentDate]=\"currentDate\"></thy-calendar-header>\n\n<div class=\"thy-calendar-panel\">\n <div class=\"thy-calendar-{{ thyMode() === 'month' ? 'date' : 'month' }}-panel\">\n <div class=\"thy-calendar-body\">\n @if (thyMode() === 'month') {\n <date-table\n [prefixCls]=\"prefixCls\"\n [value]=\"currentDate\"\n [activeDate]=\"currentDate\"\n [selectedValue]=\"currentDate\"\n [cellRender]=\"dateCell()\"\n [disabledDate]=\"thyDisabledDate()\"\n (valueChange)=\"onDateSelect($event)\"></date-table>\n } @else {\n <month-table [value]=\"currentDate\" [disabledDate]=\"thyDisabledDate()\" (valueChange)=\"onDateSelect($event)\"></month-table>\n }\n </div>\n </div>\n</div>\n" }]
|
|
259
|
+
}], ctorParameters: () => [], propDecorators: { className: [{
|
|
240
260
|
type: HostBinding,
|
|
241
261
|
args: ['class.thy-calendar-container']
|
|
242
262
|
}], className1: [{
|
|
243
263
|
type: HostBinding,
|
|
244
264
|
args: ['class.thy-calendar-full']
|
|
245
|
-
}], thyMode: [{
|
|
246
|
-
type: Input
|
|
247
|
-
}], thyValue: [{
|
|
248
|
-
type: Input
|
|
249
|
-
}], thyDisabledDate: [{
|
|
250
|
-
type: Input
|
|
251
|
-
}], thySelectChange: [{
|
|
252
|
-
type: Output
|
|
253
|
-
}], thyValueChange: [{
|
|
254
|
-
type: Output
|
|
255
|
-
}], thyDateRangeChange: [{
|
|
256
|
-
type: Output
|
|
257
|
-
}], thyDateCell: [{
|
|
258
|
-
type: Input
|
|
259
|
-
}], thyDateCellChild: [{
|
|
260
|
-
type: ContentChild,
|
|
261
|
-
args: [ThyDateCellDirective, { read: TemplateRef }]
|
|
262
|
-
}], thyCalendarHeaderOperation: [{
|
|
263
|
-
type: Input
|
|
264
|
-
}], thyCalendarHeaderOperationChild: [{
|
|
265
|
-
type: ContentChild,
|
|
266
|
-
args: [ThyCalendarHeaderOperationDirective, { read: TemplateRef }]
|
|
267
265
|
}] } });
|
|
268
266
|
|
|
269
267
|
class ThyCalendarModule {
|