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,6 +1,6 @@
|
|
|
1
1
|
import { isString, isNumber } from 'ngx-tethys/util';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { numberAttribute,
|
|
3
|
+
import { input, numberAttribute, computed, effect, ViewEncapsulation, Component, InjectionToken, inject, viewChildren, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
4
4
|
import { useHostRenderer } from '@tethys/cdk/dom';
|
|
5
5
|
import { NgClass, NgStyle, NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
6
6
|
import { ThyTooltipDirective, ThyTooltipModule } from 'ngx-tethys/tooltip';
|
|
@@ -9,131 +9,114 @@ import { ThyTooltipDirective, ThyTooltipModule } from 'ngx-tethys/tooltip';
|
|
|
9
9
|
* @private
|
|
10
10
|
*/
|
|
11
11
|
class ThyProgressCircle {
|
|
12
|
-
set thyType(type) {
|
|
13
|
-
this.hostRenderer.updateClass(type ? [`progress-circle-${type}`] : []);
|
|
14
|
-
}
|
|
15
|
-
set thySize(size) {
|
|
16
|
-
if (size) {
|
|
17
|
-
if (isString(size)) {
|
|
18
|
-
this.progressSize = `progress-circle-inner-${size}`;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
this.width = size;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
12
|
get strokeWidth() {
|
|
26
|
-
return this.thyStrokeWidth || 6;
|
|
13
|
+
return this.thyStrokeWidth() || 6;
|
|
27
14
|
}
|
|
28
15
|
constructor() {
|
|
29
16
|
this.hostRenderer = useHostRenderer();
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
transition: 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s',
|
|
100
|
-
strokeDasharray: `${((item.value || 0) / 100) * (len - gapDegree)}px ${len}px`,
|
|
101
|
-
strokeDashoffset: `-${gapDegree / 2}px`
|
|
102
|
-
}
|
|
17
|
+
this.thyType = input(undefined);
|
|
18
|
+
this.thySize = input(undefined);
|
|
19
|
+
this.thyValue = input(undefined);
|
|
20
|
+
this.thyMax = input(undefined, { transform: numberAttribute });
|
|
21
|
+
this.thyTips = input(undefined);
|
|
22
|
+
this.thyShape = input('strip');
|
|
23
|
+
this.thyGapDegree = input(undefined, { transform: numberAttribute });
|
|
24
|
+
this.thyGapPosition = input('top');
|
|
25
|
+
this.thyStrokeWidth = input(undefined, { transform: numberAttribute });
|
|
26
|
+
this.progressSize = computed(() => {
|
|
27
|
+
const size = this.thySize();
|
|
28
|
+
if (size && isString(size)) {
|
|
29
|
+
return `progress-circle-inner-${size}`;
|
|
30
|
+
}
|
|
31
|
+
return '';
|
|
32
|
+
});
|
|
33
|
+
this.width = computed(() => {
|
|
34
|
+
const size = this.thySize();
|
|
35
|
+
if (size && isNumber(size)) {
|
|
36
|
+
return size;
|
|
37
|
+
}
|
|
38
|
+
return 112;
|
|
39
|
+
});
|
|
40
|
+
this.circle = computed(() => {
|
|
41
|
+
let values = [];
|
|
42
|
+
const thyValue = this.thyValue();
|
|
43
|
+
if (Array.isArray(thyValue)) {
|
|
44
|
+
let totalValue = 0;
|
|
45
|
+
values = thyValue.map((item, index) => {
|
|
46
|
+
totalValue += item.value;
|
|
47
|
+
const currentValue = +((totalValue / this.thyMax()) * 100).toFixed(2);
|
|
48
|
+
return { ...item, value: currentValue };
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
values = [{ value: thyValue }];
|
|
53
|
+
}
|
|
54
|
+
const radius = 50 - this.strokeWidth / 2;
|
|
55
|
+
const gapPosition = this.thyGapPosition() || 'top';
|
|
56
|
+
const len = Math.PI * 2 * radius;
|
|
57
|
+
const gapDegree = this.thyGapDegree() || 0;
|
|
58
|
+
let beginPositionX = 0;
|
|
59
|
+
let beginPositionY = -radius;
|
|
60
|
+
let endPositionX = 0;
|
|
61
|
+
let endPositionY = radius * -2;
|
|
62
|
+
switch (gapPosition) {
|
|
63
|
+
case 'left':
|
|
64
|
+
beginPositionX = -radius;
|
|
65
|
+
beginPositionY = 0;
|
|
66
|
+
endPositionX = radius * 2;
|
|
67
|
+
endPositionY = 0;
|
|
68
|
+
break;
|
|
69
|
+
case 'right':
|
|
70
|
+
beginPositionX = radius;
|
|
71
|
+
beginPositionY = 0;
|
|
72
|
+
endPositionX = radius * -2;
|
|
73
|
+
endPositionY = 0;
|
|
74
|
+
break;
|
|
75
|
+
case 'bottom':
|
|
76
|
+
beginPositionY = radius;
|
|
77
|
+
endPositionY = radius * 2;
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
}
|
|
81
|
+
const pathString = `M 50,50 m ${beginPositionX},${beginPositionY} a ${radius},${radius} 0 1 1 ${endPositionX},${-endPositionY} a ${radius},${radius} 0 1 1 ${-endPositionX},${endPositionY}`;
|
|
82
|
+
const trailPathStyle = {
|
|
83
|
+
strokeDasharray: `${len - gapDegree}px ${len}px`,
|
|
84
|
+
strokeDashoffset: `-${gapDegree / 2}px`,
|
|
85
|
+
transition: 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s'
|
|
103
86
|
};
|
|
104
|
-
|
|
105
|
-
|
|
87
|
+
const progressCirclePath = values
|
|
88
|
+
.map((item, index) => {
|
|
89
|
+
return {
|
|
90
|
+
stroke: '',
|
|
91
|
+
value: +item.value,
|
|
92
|
+
className: item.type ? `progress-circle-path-${item.type}` : null,
|
|
93
|
+
strokePathStyle: {
|
|
94
|
+
stroke: item?.color ? item?.color : null,
|
|
95
|
+
transition: 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s',
|
|
96
|
+
strokeDasharray: `${((item.value || 0) / 100) * (len - gapDegree)}px ${len}px`,
|
|
97
|
+
strokeDashoffset: `-${gapDegree / 2}px`
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
})
|
|
101
|
+
.reverse();
|
|
102
|
+
return { pathString, trailPathStyle, progressCirclePath };
|
|
103
|
+
});
|
|
104
|
+
effect(() => {
|
|
105
|
+
const type = this.thyType();
|
|
106
|
+
this.hostRenderer.updateClass(type ? [`progress-circle-${type}`] : []);
|
|
107
|
+
});
|
|
106
108
|
}
|
|
109
|
+
ngOnInit() { }
|
|
110
|
+
ngOnChanges(changes) { }
|
|
107
111
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyProgressCircle, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
108
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyProgressCircle, isStandalone: true, selector: "thy-progress-circle", inputs: { thyType: "thyType", thySize: "thySize", thyValue: "thyValue", thyMax:
|
|
112
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyProgressCircle, isStandalone: true, selector: "thy-progress-circle", inputs: { thyType: { classPropertyName: "thyType", publicName: "thyType", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyValue: { classPropertyName: "thyValue", publicName: "thyValue", isSignal: true, isRequired: false, transformFunction: null }, thyMax: { classPropertyName: "thyMax", publicName: "thyMax", isSignal: true, isRequired: false, transformFunction: null }, thyTips: { classPropertyName: "thyTips", publicName: "thyTips", isSignal: true, isRequired: false, transformFunction: null }, thyShape: { classPropertyName: "thyShape", publicName: "thyShape", isSignal: true, isRequired: false, transformFunction: null }, thyGapDegree: { classPropertyName: "thyGapDegree", publicName: "thyGapDegree", isSignal: true, isRequired: false, transformFunction: null }, thyGapPosition: { classPropertyName: "thyGapPosition", publicName: "thyGapPosition", isSignal: true, isRequired: false, transformFunction: null }, thyStrokeWidth: { classPropertyName: "thyStrokeWidth", publicName: "thyStrokeWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "progress-circle" }, usesOnChanges: true, ngImport: i0, template: "@let tips = thyTips();\n@let circleAttr = circle();\n<div\n [thyTooltip]=\"tips\"\n [thyTooltipDisabled]=\"!tips\"\n [style.width.px]=\"width()\"\n [style.height.px]=\"width()\"\n [ngClass]=\"progressSize()\"\n class=\"progress-circle-inner\">\n <svg class=\"progress-circle-svg\" viewBox=\"0 0 100 100\">\n <path\n class=\"progress-circle-trail\"\n fill-opacity=\"0\"\n [attr.d]=\"circleAttr.pathString\"\n [ngStyle]=\"circleAttr.trailPathStyle\"\n [attr.stroke-width]=\"strokeWidth\"></path>\n @for (p of circleAttr.progressCirclePath; track $index) {\n <path\n class=\"progress-circle-path\"\n [ngClass]=\"p.className\"\n fill-opacity=\"0\"\n [attr.d]=\"circleAttr.pathString\"\n [attr.stroke-linecap]=\"'round'\"\n [attr.stroke]=\"p.stroke\"\n [attr.stroke-width]=\"p.value ? strokeWidth : 0\"\n [ngStyle]=\"p.strokePathStyle\"></path>\n }\n </svg>\n <span class=\"progress-circle-content\">\n <ng-content></ng-content>\n </span>\n</div>\n", dependencies: [{ kind: "directive", type: ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
109
113
|
}
|
|
110
114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyProgressCircle, decorators: [{
|
|
111
115
|
type: Component,
|
|
112
116
|
args: [{ selector: 'thy-progress-circle', encapsulation: ViewEncapsulation.None, host: {
|
|
113
117
|
class: 'progress-circle'
|
|
114
|
-
}, imports: [ThyTooltipDirective, NgClass, NgStyle], template: "<div\n [thyTooltip]=\"
|
|
115
|
-
}], ctorParameters: () => []
|
|
116
|
-
type: Input
|
|
117
|
-
}], thySize: [{
|
|
118
|
-
type: Input
|
|
119
|
-
}], thyValue: [{
|
|
120
|
-
type: Input
|
|
121
|
-
}], thyMax: [{
|
|
122
|
-
type: Input,
|
|
123
|
-
args: [{ transform: numberAttribute }]
|
|
124
|
-
}], thyTips: [{
|
|
125
|
-
type: Input
|
|
126
|
-
}], thyShape: [{
|
|
127
|
-
type: Input
|
|
128
|
-
}], thyGapDegree: [{
|
|
129
|
-
type: Input,
|
|
130
|
-
args: [{ transform: numberAttribute }]
|
|
131
|
-
}], thyGapPosition: [{
|
|
132
|
-
type: Input
|
|
133
|
-
}], thyStrokeWidth: [{
|
|
134
|
-
type: Input,
|
|
135
|
-
args: [{ transform: numberAttribute }]
|
|
136
|
-
}] } });
|
|
118
|
+
}, imports: [ThyTooltipDirective, NgClass, NgStyle], template: "@let tips = thyTips();\n@let circleAttr = circle();\n<div\n [thyTooltip]=\"tips\"\n [thyTooltipDisabled]=\"!tips\"\n [style.width.px]=\"width()\"\n [style.height.px]=\"width()\"\n [ngClass]=\"progressSize()\"\n class=\"progress-circle-inner\">\n <svg class=\"progress-circle-svg\" viewBox=\"0 0 100 100\">\n <path\n class=\"progress-circle-trail\"\n fill-opacity=\"0\"\n [attr.d]=\"circleAttr.pathString\"\n [ngStyle]=\"circleAttr.trailPathStyle\"\n [attr.stroke-width]=\"strokeWidth\"></path>\n @for (p of circleAttr.progressCirclePath; track $index) {\n <path\n class=\"progress-circle-path\"\n [ngClass]=\"p.className\"\n fill-opacity=\"0\"\n [attr.d]=\"circleAttr.pathString\"\n [attr.stroke-linecap]=\"'round'\"\n [attr.stroke]=\"p.stroke\"\n [attr.stroke-width]=\"p.value ? strokeWidth : 0\"\n [ngStyle]=\"p.strokePathStyle\"></path>\n }\n </svg>\n <span class=\"progress-circle-content\">\n <ng-content></ng-content>\n </span>\n</div>\n" }]
|
|
119
|
+
}], ctorParameters: () => [] });
|
|
137
120
|
|
|
138
121
|
const THY_PROGRESS_COMPONENT = new InjectionToken('THY_PROGRESS_COMPONENT');
|
|
139
122
|
/**
|
|
@@ -143,137 +126,134 @@ class ThyProgressStrip {
|
|
|
143
126
|
constructor() {
|
|
144
127
|
this.progress = inject(THY_PROGRESS_COMPONENT);
|
|
145
128
|
this.hostRenderer = useHostRenderer();
|
|
146
|
-
this.
|
|
147
|
-
this.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
this.percent = +((this.value / this.progress.max) * 100).toFixed(2);
|
|
129
|
+
this.thyTips = input(undefined);
|
|
130
|
+
this.thyType = input();
|
|
131
|
+
this.thyValue = input(0, {
|
|
132
|
+
transform: numberAttribute
|
|
133
|
+
});
|
|
134
|
+
this.thyColor = input();
|
|
135
|
+
this.percent = computed(() => {
|
|
136
|
+
const value = this.thyValue();
|
|
137
|
+
if (!value && value !== 0) {
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
return +((value / this.progress.max()) * 100).toFixed(2);
|
|
141
|
+
});
|
|
142
|
+
effect(() => {
|
|
143
|
+
const type = this.thyType();
|
|
144
|
+
this.hostRenderer.updateClass(type ? [`progress-bar-${type}`] : []);
|
|
145
|
+
});
|
|
164
146
|
}
|
|
165
147
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyProgressStrip, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
166
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
148
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyProgressStrip, isStandalone: true, selector: "thy-progress-bar", inputs: { thyTips: { classPropertyName: "thyTips", publicName: "thyTips", isSignal: true, isRequired: false, transformFunction: null }, thyType: { classPropertyName: "thyType", publicName: "thyType", isSignal: true, isRequired: false, transformFunction: null }, thyValue: { classPropertyName: "thyValue", publicName: "thyValue", isSignal: true, isRequired: false, transformFunction: null }, thyColor: { classPropertyName: "thyColor", publicName: "thyColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.width.%": "percent()" }, classAttribute: "progress-bar" }, ngImport: i0, template: "<div class=\"progress-bar-inner\" [ngStyle]=\"{ 'background-color': thyColor() }\">\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
167
149
|
}
|
|
168
150
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyProgressStrip, decorators: [{
|
|
169
151
|
type: Component,
|
|
170
|
-
args: [{ selector: 'thy-progress-bar', encapsulation: ViewEncapsulation.None, imports: [NgStyle],
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
type: HostBinding,
|
|
176
|
-
args: ['style.width.%']
|
|
177
|
-
}], thyTips: [{
|
|
178
|
-
type: Input
|
|
179
|
-
}], thyType: [{
|
|
180
|
-
type: Input
|
|
181
|
-
}], thyValue: [{
|
|
182
|
-
type: Input,
|
|
183
|
-
args: [{ transform: numberAttribute }]
|
|
184
|
-
}], thyColor: [{
|
|
185
|
-
type: Input
|
|
186
|
-
}] } });
|
|
152
|
+
args: [{ selector: 'thy-progress-bar', encapsulation: ViewEncapsulation.None, imports: [NgStyle], host: {
|
|
153
|
+
class: 'progress-bar',
|
|
154
|
+
'[style.width.%]': 'percent()'
|
|
155
|
+
}, template: "<div class=\"progress-bar-inner\" [ngStyle]=\"{ 'background-color': thyColor() }\">\n <ng-content></ng-content>\n</div>\n" }]
|
|
156
|
+
}], ctorParameters: () => [] });
|
|
187
157
|
|
|
188
158
|
/**
|
|
189
159
|
* 进度条组件
|
|
190
160
|
* @name thy-progress
|
|
191
161
|
*/
|
|
192
162
|
class ThyProgress {
|
|
193
|
-
set barsQueryList(value) {
|
|
194
|
-
this.bars = value.toArray();
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* 进度条大小
|
|
198
|
-
* @type xs | sm | md
|
|
199
|
-
* @default md
|
|
200
|
-
*/
|
|
201
|
-
set thySize(size) {
|
|
202
|
-
this.size = size;
|
|
203
|
-
this.hostRenderer.updateClass(size ? [`progress-${size}`] : []);
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* 进度值,传入数字时显示百分比 = value / max * 100,当传入数组时显示多个 bar,stacked 模式的进度条
|
|
207
|
-
* @type number | ThyProgressStackedValue[]
|
|
208
|
-
*/
|
|
209
|
-
set thyValue(value) {
|
|
210
|
-
// 自动求和计算 max
|
|
211
|
-
if (Array.isArray(value)) {
|
|
212
|
-
this.isStacked = true;
|
|
213
|
-
this.value = [...value].filter(item => item.value !== 0);
|
|
214
|
-
this.barsTotalValue = this.value.reduce((total, item) => {
|
|
215
|
-
return total + item.value;
|
|
216
|
-
}, 0);
|
|
217
|
-
this.calculateMax();
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
this.value = value;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* 最大值,主要计算百分比进度的分母使用,当 thyValue 传入数组时,自动累加数组中的 value 之和为 max
|
|
225
|
-
*/
|
|
226
|
-
set thyMax(max) {
|
|
227
|
-
this.settedMax = max;
|
|
228
|
-
this.calculateMax();
|
|
229
|
-
}
|
|
230
163
|
constructor() {
|
|
231
|
-
this.bars = [];
|
|
232
164
|
this.hostRenderer = useHostRenderer();
|
|
233
|
-
this.
|
|
234
|
-
|
|
165
|
+
this.barsTotalValue = computed(() => {
|
|
166
|
+
const value = this.thyValue();
|
|
167
|
+
if (Array.isArray(value)) {
|
|
168
|
+
return value.reduce((total, item) => {
|
|
169
|
+
return total + item.value;
|
|
170
|
+
}, 0);
|
|
171
|
+
}
|
|
172
|
+
return undefined;
|
|
173
|
+
});
|
|
174
|
+
this.max = computed(() => {
|
|
175
|
+
const setMax = this.thyMax();
|
|
176
|
+
const barsTotalValue = this.barsTotalValue();
|
|
177
|
+
let result = 100;
|
|
178
|
+
if (isNumber(setMax) && setMax > 0) {
|
|
179
|
+
result = setMax;
|
|
180
|
+
}
|
|
181
|
+
else if (isNumber(barsTotalValue)) {
|
|
182
|
+
result = barsTotalValue;
|
|
183
|
+
}
|
|
184
|
+
if (result < barsTotalValue) {
|
|
185
|
+
result = barsTotalValue;
|
|
186
|
+
}
|
|
187
|
+
return result;
|
|
188
|
+
});
|
|
189
|
+
this.isStacked = computed(() => {
|
|
190
|
+
return Array.isArray(this.thyValue());
|
|
191
|
+
});
|
|
192
|
+
this.bars = viewChildren(ThyProgressStrip);
|
|
235
193
|
/**
|
|
236
194
|
* 进度条类型: `primary` | `success` | `info` | `warning` | `danger`
|
|
237
195
|
*/
|
|
238
|
-
this.thyType = 'primary';
|
|
196
|
+
this.thyType = input('primary');
|
|
197
|
+
/**
|
|
198
|
+
* 进度条大小
|
|
199
|
+
* @type xs | sm | md
|
|
200
|
+
* @default md
|
|
201
|
+
*/
|
|
202
|
+
this.thySize = input('md');
|
|
203
|
+
/**
|
|
204
|
+
* 进度值,传入数字时显示百分比 = value / max * 100,当传入数组时显示多个 bar,stacked 模式的进度条
|
|
205
|
+
* @type number | ThyProgressStackedValue[]
|
|
206
|
+
*/
|
|
207
|
+
this.thyValue = input(undefined, {
|
|
208
|
+
transform: (value) => {
|
|
209
|
+
if (Array.isArray(value)) {
|
|
210
|
+
return [...value].filter(item => item.value !== 0);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
return value;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
/**
|
|
218
|
+
* 最大值,主要计算百分比进度的分母使用,当 thyValue 传入数组时,自动累加数组中的 value 之和为 max
|
|
219
|
+
*/
|
|
220
|
+
this.thyMax = input(undefined, { transform: numberAttribute });
|
|
221
|
+
/**
|
|
222
|
+
* 鼠标移入进度条时显示的提示文案或者模板
|
|
223
|
+
*/
|
|
224
|
+
this.thyTips = input(undefined);
|
|
239
225
|
/**
|
|
240
226
|
* 进度形状
|
|
241
227
|
* @type strip | circle
|
|
242
228
|
*/
|
|
243
|
-
this.thyShape = 'strip';
|
|
229
|
+
this.thyShape = input('strip');
|
|
244
230
|
/**
|
|
245
231
|
* 圆形进度条缺口角度,可取值 0 ~ 360
|
|
246
232
|
*/
|
|
247
|
-
this.thyGapDegree = undefined;
|
|
233
|
+
this.thyGapDegree = input(undefined, { transform: numberAttribute });
|
|
248
234
|
/**
|
|
249
235
|
* 圆形进度条缺口位置
|
|
250
236
|
* @type top | bottom | left | right
|
|
251
237
|
*/
|
|
252
|
-
this.thyGapPosition = 'top';
|
|
238
|
+
this.thyGapPosition = input('top');
|
|
239
|
+
/**
|
|
240
|
+
* 圆形进度条线的宽度
|
|
241
|
+
*/
|
|
242
|
+
this.thyStrokeWidth = input(undefined, { transform: numberAttribute });
|
|
243
|
+
effect(() => {
|
|
244
|
+
const size = this.thySize();
|
|
245
|
+
this.hostRenderer.updateClass(size ? [`progress-${size}`] : []);
|
|
246
|
+
});
|
|
253
247
|
}
|
|
254
248
|
ngOnInit() { }
|
|
255
249
|
ngOnChanges(changes) { }
|
|
256
|
-
calculateMax() {
|
|
257
|
-
if (isNumber(this.settedMax) && this.settedMax > 0) {
|
|
258
|
-
this.max = this.settedMax;
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
this.max = this.barsTotalValue;
|
|
262
|
-
}
|
|
263
|
-
if (this.max < this.barsTotalValue) {
|
|
264
|
-
this.max = this.barsTotalValue;
|
|
265
|
-
}
|
|
266
|
-
this.bars.forEach(bar => {
|
|
267
|
-
bar.recalculatePercentage();
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
250
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyProgress, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
271
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyProgress, isStandalone: true, selector: "thy-progress", inputs: { thyType: "thyType", thySize: "thySize", thyValue: "thyValue", thyMax:
|
|
251
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyProgress, isStandalone: true, selector: "thy-progress", inputs: { thyType: { classPropertyName: "thyType", publicName: "thyType", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyValue: { classPropertyName: "thyValue", publicName: "thyValue", isSignal: true, isRequired: false, transformFunction: null }, thyMax: { classPropertyName: "thyMax", publicName: "thyMax", isSignal: true, isRequired: false, transformFunction: null }, thyTips: { classPropertyName: "thyTips", publicName: "thyTips", isSignal: true, isRequired: false, transformFunction: null }, thyShape: { classPropertyName: "thyShape", publicName: "thyShape", isSignal: true, isRequired: false, transformFunction: null }, thyGapDegree: { classPropertyName: "thyGapDegree", publicName: "thyGapDegree", isSignal: true, isRequired: false, transformFunction: null }, thyGapPosition: { classPropertyName: "thyGapPosition", publicName: "thyGapPosition", isSignal: true, isRequired: false, transformFunction: null }, thyStrokeWidth: { classPropertyName: "thyStrokeWidth", publicName: "thyStrokeWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-progress-strip": "thyShape() === 'strip'", "class.thy-progress-circle": "thyShape() === 'circle'", "class.progress-stacked": "isStacked()", "attr.max": "max()" }, classAttribute: "thy-progress progress" }, providers: [
|
|
272
252
|
{
|
|
273
253
|
provide: THY_PROGRESS_COMPONENT,
|
|
274
254
|
useExisting: ThyProgress
|
|
275
255
|
}
|
|
276
|
-
], viewQueries: [{ propertyName: "
|
|
256
|
+
], viewQueries: [{ propertyName: "bars", predicate: ThyProgressStrip, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container>\n @if (thyShape()=== 'strip') {\n <div class=\"thy-progress-strip-outer\">\n @if (isStacked()) {\n @for (item of thyValue(); track $index) {\n <thy-progress-bar\n [thyType]=\"item.type\"\n [ngClass]=\"{ 'cursor-pointer': item.tips || thyTips()}\"\n [thyTooltip]=\"item.tips || thyTips()\"\n [thyTooltipTemplateContext]=\"item\"\n [thyTooltipDisabled]=\"!thyTips() && !item.tips\"\n [thyColor]=\"item.color\"\n [thyValue]=\"item.value\"\n >{{ item.label }}\n </thy-progress-bar>\n }\n } @else {\n @let value = thyValue();\n @if (value) {\n <thy-progress-bar\n [thyType]=\"thyType()\"\n [ngClass]=\"{ 'cursor-pointer': thyTips()}\"\n [thyTooltip]=\"thyTips()\"\n [thyTooltipTemplateContext]=\"value\"\n [thyTooltipDisabled]=\"!thyTips()\"\n [thyValue]=\"value\">\n </thy-progress-bar>\n }\n }\n </div>\n @if (thyShape()=== 'strip') {\n <div class=\"thy-progress-strip-text\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template>\n </div>\n }\n } @else {\n @let value = thyValue();\n <thy-progress-circle\n [thyType]=\"thyType()\"\n [thyTooltip]=\"thyTips()\"\n [thyTooltipDisabled]=\"!thyTips()\"\n [thyTooltipTemplateContext]=\"value\"\n [thyValue]=\"value\"\n [thySize]=\"thySize()\"\n [thyMax]=\"max()\"\n [thyGapDegree]=\"thyGapDegree()\"\n [thyGapPosition]=\"thyGapPosition()\"\n [thyStrokeWidth]=\"thyStrokeWidth()\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template\n ></thy-progress-circle>\n }\n</ng-container>\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n", dependencies: [{ kind: "component", type: ThyProgressStrip, selector: "thy-progress-bar", inputs: ["thyTips", "thyType", "thyValue", "thyColor"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyProgressCircle, selector: "thy-progress-circle", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips", "thyShape", "thyGapDegree", "thyGapPosition", "thyStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
277
257
|
}
|
|
278
258
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyProgress, decorators: [{
|
|
279
259
|
type: Component,
|
|
@@ -284,40 +264,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
284
264
|
}
|
|
285
265
|
], host: {
|
|
286
266
|
class: `thy-progress progress`,
|
|
287
|
-
'[class.thy-progress-strip]': `thyShape === 'strip'`,
|
|
288
|
-
'[class.thy-progress-circle]': `thyShape === 'circle'
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}], isStacked: [{
|
|
294
|
-
type: HostBinding,
|
|
295
|
-
args: [`class.progress-stacked`]
|
|
296
|
-
}], barsQueryList: [{
|
|
297
|
-
type: ViewChildren,
|
|
298
|
-
args: [ThyProgressStrip]
|
|
299
|
-
}], thyType: [{
|
|
300
|
-
type: Input
|
|
301
|
-
}], thySize: [{
|
|
302
|
-
type: Input
|
|
303
|
-
}], thyValue: [{
|
|
304
|
-
type: Input
|
|
305
|
-
}], thyMax: [{
|
|
306
|
-
type: Input,
|
|
307
|
-
args: [{ transform: numberAttribute }]
|
|
308
|
-
}], thyTips: [{
|
|
309
|
-
type: Input
|
|
310
|
-
}], thyShape: [{
|
|
311
|
-
type: Input
|
|
312
|
-
}], thyGapDegree: [{
|
|
313
|
-
type: Input,
|
|
314
|
-
args: [{ transform: numberAttribute }]
|
|
315
|
-
}], thyGapPosition: [{
|
|
316
|
-
type: Input
|
|
317
|
-
}], thyStrokeWidth: [{
|
|
318
|
-
type: Input,
|
|
319
|
-
args: [{ transform: numberAttribute }]
|
|
320
|
-
}] } });
|
|
267
|
+
'[class.thy-progress-strip]': `thyShape() === 'strip'`,
|
|
268
|
+
'[class.thy-progress-circle]': `thyShape() === 'circle'`,
|
|
269
|
+
'[class.progress-stacked]': 'isStacked()',
|
|
270
|
+
'[attr.max]': 'max()'
|
|
271
|
+
}, imports: [ThyProgressStrip, NgClass, ThyTooltipDirective, NgTemplateOutlet, ThyProgressCircle], template: "<ng-container>\n @if (thyShape()=== 'strip') {\n <div class=\"thy-progress-strip-outer\">\n @if (isStacked()) {\n @for (item of thyValue(); track $index) {\n <thy-progress-bar\n [thyType]=\"item.type\"\n [ngClass]=\"{ 'cursor-pointer': item.tips || thyTips()}\"\n [thyTooltip]=\"item.tips || thyTips()\"\n [thyTooltipTemplateContext]=\"item\"\n [thyTooltipDisabled]=\"!thyTips() && !item.tips\"\n [thyColor]=\"item.color\"\n [thyValue]=\"item.value\"\n >{{ item.label }}\n </thy-progress-bar>\n }\n } @else {\n @let value = thyValue();\n @if (value) {\n <thy-progress-bar\n [thyType]=\"thyType()\"\n [ngClass]=\"{ 'cursor-pointer': thyTips()}\"\n [thyTooltip]=\"thyTips()\"\n [thyTooltipTemplateContext]=\"value\"\n [thyTooltipDisabled]=\"!thyTips()\"\n [thyValue]=\"value\">\n </thy-progress-bar>\n }\n }\n </div>\n @if (thyShape()=== 'strip') {\n <div class=\"thy-progress-strip-text\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template>\n </div>\n }\n } @else {\n @let value = thyValue();\n <thy-progress-circle\n [thyType]=\"thyType()\"\n [thyTooltip]=\"thyTips()\"\n [thyTooltipDisabled]=\"!thyTips()\"\n [thyTooltipTemplateContext]=\"value\"\n [thyValue]=\"value\"\n [thySize]=\"thySize()\"\n [thyMax]=\"max()\"\n [thyGapDegree]=\"thyGapDegree()\"\n [thyGapPosition]=\"thyGapPosition()\"\n [thyStrokeWidth]=\"thyStrokeWidth()\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template\n ></thy-progress-circle>\n }\n</ng-container>\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n" }]
|
|
272
|
+
}], ctorParameters: () => [] });
|
|
321
273
|
|
|
322
274
|
class ThyProgressModule {
|
|
323
275
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyProgressModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|