ngx-tethys 19.0.16 → 19.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -11
- package/README.md +0 -1
- package/action/action.component.d.ts +14 -23
- package/action/actions.component.d.ts +5 -7
- package/affix/affix.component.d.ts +9 -13
- 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-group.component.d.ts +5 -12
- package/button/button-icon.component.d.ts +14 -27
- package/button/button.component.d.ts +17 -26
- 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-active.directive.d.ts +4 -5
- package/dropdown/dropdown-menu-item.directive.d.ts +7 -14
- package/dropdown/dropdown-menu.component.d.ts +6 -12
- package/dropdown/dropdown-submenu.component.d.ts +2 -4
- package/dropdown/dropdown.directive.d.ts +14 -24
- package/empty/empty.component.d.ts +21 -27
- package/fesm2022/ngx-tethys-action.mjs +63 -101
- package/fesm2022/ngx-tethys-action.mjs.map +1 -1
- package/fesm2022/ngx-tethys-affix.mjs +40 -41
- 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-button.mjs +225 -322
- package/fesm2022/ngx-tethys-button.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 +83 -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-dropdown.mjs +155 -203
- package/fesm2022/ngx-tethys-dropdown.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-flexible-text.mjs +67 -86
- package/fesm2022/ngx-tethys-flexible-text.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 +161 -158
- 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-icon.mjs +44 -59
- package/fesm2022/ngx-tethys-icon.mjs.map +1 -1
- package/fesm2022/ngx-tethys-image.mjs +40 -36
- package/fesm2022/ngx-tethys-image.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 +194 -246
- package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs +99 -113
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +60 -76
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-rate.mjs +115 -157
- package/fesm2022/ngx-tethys-rate.mjs.map +1 -1
- package/fesm2022/ngx-tethys-resizable.mjs +111 -157
- package/fesm2022/ngx-tethys-resizable.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-segment.mjs +84 -103
- package/fesm2022/ngx-tethys-segment.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-slide.mjs +37 -56
- package/fesm2022/ngx-tethys-slide.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 +25 -51
- 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-strength.mjs +52 -66
- package/fesm2022/ngx-tethys-strength.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-transfer.mjs +98 -119
- package/fesm2022/ngx-tethys-transfer.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree-select.mjs +2 -4
- package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree.mjs +281 -401
- package/fesm2022/ngx-tethys-tree.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 +93 -132
- package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
- package/fesm2022/ngx-tethys-util.mjs.map +1 -1
- package/fesm2022/ngx-tethys-vote.mjs +53 -99
- package/fesm2022/ngx-tethys-vote.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/flexible-text/flexible-text.component.d.ts +9 -15
- 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 +13 -20
- 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 +11 -14
- package/icon/icon.component.d.ts +10 -17
- package/image/image.directive.d.ts +10 -12
- package/image/image.token.d.ts +5 -5
- 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 +35 -26
- package/progress/progress-strip.component.d.ts +10 -14
- package/progress/progress.component.d.ts +16 -26
- package/property/examples/single/single.component.scss +6 -0
- package/property/properties.component.d.ts +6 -15
- package/property/property-item.component.d.ts +22 -34
- 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 +13 -16
- package/radio/radio.component.d.ts +2 -2
- package/radio/radio.token.d.ts +2 -2
- package/rate/rate-item.component.d.ts +8 -10
- package/rate/rate.component.d.ts +20 -30
- package/resizable/resizable.directive.d.ts +18 -36
- package/resizable/resize-handle.component.d.ts +6 -6
- package/resizable/resize-handles.component.d.ts +5 -8
- 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 +9 -14
- package/segment/segment.component.d.ts +11 -14
- package/segment/segment.token.d.ts +4 -3
- 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 -5
- package/slide/slide-header/slide-header.component.d.ts +6 -9
- package/slider/slider.component.d.ts +17 -24
- package/space/space.component.d.ts +10 -16
- 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/strength/strength.component.d.ts +8 -13
- 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/transfer/transfer-list.component.d.ts +15 -15
- package/transfer/transfer.component.d.ts +20 -23
- package/tree/tree-abstract.d.ts +5 -5
- package/tree/tree-node.component.d.ts +24 -46
- package/tree/tree.class.d.ts +4 -4
- package/tree/tree.component.d.ts +47 -74
- package/tree/tree.service.d.ts +3 -4
- package/tree-select/tree-select.component.d.ts +10 -9
- 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 +13 -32
- package/watermark/watermark.directive.d.ts +7 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, numberAttribute, ChangeDetectionStrategy, Component, InjectionToken, inject, viewChild, TemplateRef, output, contentChildren, signal, computed, effect, untracked, HostListener, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
4
4
|
import { ThyIcon } from 'ngx-tethys/icon';
|
|
5
5
|
import { coerceBooleanProperty } from 'ngx-tethys/util';
|
|
@@ -11,34 +11,19 @@ import { coerceBooleanProperty } from 'ngx-tethys/util';
|
|
|
11
11
|
*/
|
|
12
12
|
class ThyStepHeader {
|
|
13
13
|
constructor() {
|
|
14
|
-
this.
|
|
14
|
+
this.label = input();
|
|
15
|
+
this.icon = input();
|
|
16
|
+
this.index = input(undefined, { transform: numberAttribute });
|
|
17
|
+
this.selected = input(false, { transform: coerceBooleanProperty });
|
|
18
|
+
this.active = input(false, { transform: coerceBooleanProperty });
|
|
15
19
|
}
|
|
16
20
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStepHeader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
17
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
21
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyStepHeader, isStandalone: true, selector: "thy-step-header", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "thy-stepper-header" }, ngImport: i0, template: "<div class=\"thy-step-number\">\n <span>{{ index() + 1 }}</span>\n</div>\n<thy-icon class=\"thy-step-icon\" [thyIconName]=\"icon() || 'check-circle'\"></thy-icon>\n<div class=\"thy-step-label\">{{ label() }}</div>\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
18
22
|
}
|
|
19
23
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStepHeader, decorators: [{
|
|
20
24
|
type: Component,
|
|
21
|
-
args: [{ selector: 'thy-step-header', imports: [ThyIcon], template: "<div class=\"thy-step-number\">\n <span>{{ index + 1 }}</span>\n</div>\n<thy-icon class=\"thy-step-icon\" [thyIconName]=\"icon || 'check-circle'\"></thy-icon>\n<div class=\"thy-step-label\">{{ label }}</div>\n" }]
|
|
22
|
-
}]
|
|
23
|
-
type: Input
|
|
24
|
-
}], icon: [{
|
|
25
|
-
type: Input
|
|
26
|
-
}], index: [{
|
|
27
|
-
type: Input,
|
|
28
|
-
args: [{ transform: numberAttribute }]
|
|
29
|
-
}], selected: [{
|
|
30
|
-
type: HostBinding,
|
|
31
|
-
args: ['class.thy-stepper-header-selected']
|
|
32
|
-
}, {
|
|
33
|
-
type: Input,
|
|
34
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
35
|
-
}], active: [{
|
|
36
|
-
type: Input,
|
|
37
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
38
|
-
}], thyStepHeader: [{
|
|
39
|
-
type: HostBinding,
|
|
40
|
-
args: ['class.thy-stepper-header']
|
|
41
|
-
}] } });
|
|
25
|
+
args: [{ selector: 'thy-step-header', imports: [ThyIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'thy-stepper-header' }, template: "<div class=\"thy-step-number\">\n <span>{{ index() + 1 }}</span>\n</div>\n<thy-icon class=\"thy-step-icon\" [thyIconName]=\"icon() || 'check-circle'\"></thy-icon>\n<div class=\"thy-step-label\">{{ label() }}</div>\n" }]
|
|
26
|
+
}] });
|
|
42
27
|
|
|
43
28
|
const THY_STEPPER_COMPONENT = new InjectionToken('THY_STEPPER_COMPONENT');
|
|
44
29
|
/**
|
|
@@ -49,26 +34,28 @@ const THY_STEPPER_COMPONENT = new InjectionToken('THY_STEPPER_COMPONENT');
|
|
|
49
34
|
class ThyStep {
|
|
50
35
|
constructor() {
|
|
51
36
|
this.stepper = inject(THY_STEPPER_COMPONENT, { optional: true });
|
|
37
|
+
this.content = viewChild(TemplateRef);
|
|
38
|
+
this.label = input();
|
|
39
|
+
/**
|
|
40
|
+
* 步骤条中每个步骤的label文本
|
|
41
|
+
*/
|
|
42
|
+
this.thyLabel = input();
|
|
43
|
+
/**
|
|
44
|
+
* 步骤条中每个步骤完成的图标
|
|
45
|
+
* @default check-circle
|
|
46
|
+
*/
|
|
47
|
+
this.thyIcon = input();
|
|
52
48
|
}
|
|
53
49
|
select() {
|
|
54
|
-
this.stepper.
|
|
50
|
+
this.stepper.updateSelected(this);
|
|
55
51
|
}
|
|
56
52
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStep, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
57
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
53
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: ThyStep, isStandalone: true, selector: "thy-step", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, thyLabel: { classPropertyName: "thyLabel", publicName: "thyLabel", isSignal: true, isRequired: false, transformFunction: null }, thyIcon: { classPropertyName: "thyIcon", publicName: "thyIcon", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template><ng-content></ng-content></ng-template>\n" }); }
|
|
58
54
|
}
|
|
59
55
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStep, decorators: [{
|
|
60
56
|
type: Component,
|
|
61
57
|
args: [{ selector: 'thy-step', template: "<ng-template><ng-content></ng-content></ng-template>\n" }]
|
|
62
|
-
}]
|
|
63
|
-
type: ViewChild,
|
|
64
|
-
args: [TemplateRef, { static: true }]
|
|
65
|
-
}], label: [{
|
|
66
|
-
type: Input
|
|
67
|
-
}], thyLabel: [{
|
|
68
|
-
type: Input
|
|
69
|
-
}], thyIcon: [{
|
|
70
|
-
type: Input
|
|
71
|
-
}] } });
|
|
58
|
+
}] });
|
|
72
59
|
|
|
73
60
|
/**
|
|
74
61
|
* 步骤条组件
|
|
@@ -77,97 +64,77 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
77
64
|
*/
|
|
78
65
|
class ThyStepper {
|
|
79
66
|
constructor() {
|
|
67
|
+
/**
|
|
68
|
+
* 当前处于激活状态的步骤 index
|
|
69
|
+
*/
|
|
70
|
+
this.thySelectedIndex = input(0, { transform: numberAttribute });
|
|
71
|
+
/**
|
|
72
|
+
* 当前处于激活状态的步骤实例
|
|
73
|
+
*/
|
|
74
|
+
this.thySelected = input();
|
|
80
75
|
/**
|
|
81
76
|
* 步骤条导航是否展示,默认展示
|
|
82
77
|
*/
|
|
83
|
-
this.thyShowStepHeader = true;
|
|
84
|
-
this.
|
|
85
|
-
this.
|
|
86
|
-
this.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
78
|
+
this.thyShowStepHeader = input(true, { transform: coerceBooleanProperty });
|
|
79
|
+
this.selectionChange = output();
|
|
80
|
+
this.steps = contentChildren(ThyStep);
|
|
81
|
+
this.selectedIndex = signal(0);
|
|
82
|
+
this.selected = computed(() => this.steps()?.[this.selectedIndex()]);
|
|
83
|
+
effect(() => {
|
|
84
|
+
const newIndex = this.thySelectedIndex();
|
|
85
|
+
if (newIndex) {
|
|
86
|
+
untracked(() => {
|
|
87
|
+
this.updateSelectedIndex(newIndex);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
effect(() => {
|
|
92
|
+
const selected = this.thySelected();
|
|
93
|
+
if (selected) {
|
|
94
|
+
untracked(() => {
|
|
95
|
+
const index = this.steps()?.indexOf(selected);
|
|
96
|
+
if (index > -1) {
|
|
97
|
+
this.updateSelectedIndex(index);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
});
|
|
103
102
|
}
|
|
104
|
-
|
|
105
|
-
if (this.steps) {
|
|
106
|
-
|
|
103
|
+
updateSelectedIndex(newIndex) {
|
|
104
|
+
if (!this.steps()?.[newIndex]) {
|
|
105
|
+
return;
|
|
107
106
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
get selectedIndex() {
|
|
113
|
-
return this._selectedIndex;
|
|
114
|
-
}
|
|
115
|
-
_updateSelectedItemIndex(newIndex) {
|
|
116
|
-
const stepsArray = this.steps.toArray();
|
|
107
|
+
const previouslySelectedIndex = this.selectedIndex();
|
|
108
|
+
const previouslySelectedStep = this.steps() ? this.steps()[previouslySelectedIndex] : null;
|
|
109
|
+
this.selectedIndex.set(newIndex);
|
|
117
110
|
this.selectionChange.emit({
|
|
118
111
|
selectedIndex: newIndex,
|
|
119
|
-
previouslySelectedIndex:
|
|
120
|
-
selectedStep:
|
|
121
|
-
previouslySelectedStep:
|
|
112
|
+
previouslySelectedIndex: previouslySelectedIndex,
|
|
113
|
+
selectedStep: this.selected(),
|
|
114
|
+
previouslySelectedStep: previouslySelectedStep
|
|
122
115
|
});
|
|
123
|
-
|
|
116
|
+
}
|
|
117
|
+
updateSelected(step) {
|
|
118
|
+
const index = this.steps().indexOf(step);
|
|
119
|
+
this.updateSelectedIndex(index);
|
|
124
120
|
}
|
|
125
121
|
to(index) {
|
|
126
|
-
this.
|
|
122
|
+
this.updateSelectedIndex(Math.min(index, this.steps().length - 1));
|
|
127
123
|
}
|
|
128
124
|
next() {
|
|
129
|
-
this.
|
|
125
|
+
this.updateSelectedIndex(Math.min(this.selectedIndex() + 1, this.steps().length - 1));
|
|
130
126
|
}
|
|
131
127
|
/** Selects and focuses the previous step in list. */
|
|
132
128
|
previous() {
|
|
133
|
-
this.
|
|
129
|
+
this.updateSelectedIndex(Math.max(this.selectedIndex() - 1, 0));
|
|
134
130
|
}
|
|
135
131
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStepper, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
136
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyStepper, isStandalone: true, selector: "thy-stepper", inputs: { thySelectedIndex:
|
|
137
|
-
{
|
|
138
|
-
provide: THY_STEPPER_COMPONENT,
|
|
139
|
-
useExisting: ThyStepper
|
|
140
|
-
}
|
|
141
|
-
], queries: [{ propertyName: "steps", predicate: ThyStep }], viewQueries: [{ propertyName: "stepHeaders", predicate: ThyStepHeader, descendants: true }], ngImport: i0, template: "@if (thyShowStepHeader) {\n <div class=\"thy-stepper-header-container\">\n @for (step of steps; track $index; let i = $index; let isLast = $last) {\n <thy-step-header\n [index]=\"i\"\n [label]=\"step.thyLabel || step.label\"\n [icon]=\"step.thyIcon\"\n [selected]=\"selectedIndex === i\"\n [class.thy-stepper-header-active]=\"i <= selectedIndex\"\n [active]=\"i <= selectedIndex\">\n </thy-step-header>\n @if (!isLast) {\n <div class=\"thy-stepper-line\" [class.thy-stepper-line-active]=\"i < selectedIndex\"></div>\n }\n }\n </div>\n}\n\n<div class=\"thy-stepper-content-container\">\n <ng-container [ngTemplateOutlet]=\"selected?.content\"></ng-container>\n</div>\n", dependencies: [{ kind: "component", type: ThyStepHeader, selector: "thy-step-header", inputs: ["label", "icon", "index", "selected", "active"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
132
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyStepper, isStandalone: true, selector: "thy-stepper", inputs: { thySelectedIndex: { classPropertyName: "thySelectedIndex", publicName: "thySelectedIndex", isSignal: true, isRequired: false, transformFunction: null }, thySelected: { classPropertyName: "thySelected", publicName: "thySelected", isSignal: true, isRequired: false, transformFunction: null }, thyShowStepHeader: { classPropertyName: "thyShowStepHeader", publicName: "thyShowStepHeader", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange" }, host: { classAttribute: "thy-stepper" }, providers: [{ provide: THY_STEPPER_COMPONENT, useExisting: ThyStepper }], queries: [{ propertyName: "steps", predicate: ThyStep, isSignal: true }], ngImport: i0, template: "@if (thyShowStepHeader()) {\n <div class=\"thy-stepper-header-container\">\n @for (step of steps(); track $index; let i = $index; let isLast = $last) {\n <thy-step-header\n [index]=\"i\"\n [label]=\"step.thyLabel() || step.label()\"\n [icon]=\"step.thyIcon()\"\n [selected]=\"selectedIndex() === i\"\n [class.thy-stepper-header-active]=\"i <= selectedIndex()\"\n [active]=\"i <= selectedIndex()\">\n </thy-step-header>\n @if (!isLast) {\n <div class=\"thy-stepper-line\" [class.thy-stepper-line-active]=\"i < selectedIndex()\"></div>\n }\n }\n </div>\n}\n\n<div class=\"thy-stepper-content-container\">\n <ng-container [ngTemplateOutlet]=\"selected()?.content()\"></ng-container>\n</div>\n\n ", dependencies: [{ kind: "component", type: ThyStepHeader, selector: "thy-step-header", inputs: ["label", "icon", "index", "selected", "active"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
142
133
|
}
|
|
143
134
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStepper, decorators: [{
|
|
144
135
|
type: Component,
|
|
145
|
-
args: [{ selector: 'thy-stepper', providers: [
|
|
146
|
-
|
|
147
|
-
provide: THY_STEPPER_COMPONENT,
|
|
148
|
-
useExisting: ThyStepper
|
|
149
|
-
}
|
|
150
|
-
], imports: [ThyStepHeader, NgTemplateOutlet], template: "@if (thyShowStepHeader) {\n <div class=\"thy-stepper-header-container\">\n @for (step of steps; track $index; let i = $index; let isLast = $last) {\n <thy-step-header\n [index]=\"i\"\n [label]=\"step.thyLabel || step.label\"\n [icon]=\"step.thyIcon\"\n [selected]=\"selectedIndex === i\"\n [class.thy-stepper-header-active]=\"i <= selectedIndex\"\n [active]=\"i <= selectedIndex\">\n </thy-step-header>\n @if (!isLast) {\n <div class=\"thy-stepper-line\" [class.thy-stepper-line-active]=\"i < selectedIndex\"></div>\n }\n }\n </div>\n}\n\n<div class=\"thy-stepper-content-container\">\n <ng-container [ngTemplateOutlet]=\"selected?.content\"></ng-container>\n</div>\n" }]
|
|
151
|
-
}], propDecorators: { thySelectedIndex: [{
|
|
152
|
-
type: Input,
|
|
153
|
-
args: [{ transform: numberAttribute }]
|
|
154
|
-
}], thySelected: [{
|
|
155
|
-
type: Input
|
|
156
|
-
}], thyShowStepHeader: [{
|
|
157
|
-
type: Input,
|
|
158
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
159
|
-
}], selectionChange: [{
|
|
160
|
-
type: Output
|
|
161
|
-
}], stepHeaders: [{
|
|
162
|
-
type: ViewChildren,
|
|
163
|
-
args: [ThyStepHeader]
|
|
164
|
-
}], steps: [{
|
|
165
|
-
type: ContentChildren,
|
|
166
|
-
args: [ThyStep]
|
|
167
|
-
}], thyStepper: [{
|
|
168
|
-
type: HostBinding,
|
|
169
|
-
args: ['class.thy-stepper']
|
|
170
|
-
}] } });
|
|
136
|
+
args: [{ selector: 'thy-stepper', providers: [{ provide: THY_STEPPER_COMPONENT, useExisting: ThyStepper }], imports: [ThyStepHeader, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'thy-stepper' }, template: "@if (thyShowStepHeader()) {\n <div class=\"thy-stepper-header-container\">\n @for (step of steps(); track $index; let i = $index; let isLast = $last) {\n <thy-step-header\n [index]=\"i\"\n [label]=\"step.thyLabel() || step.label()\"\n [icon]=\"step.thyIcon()\"\n [selected]=\"selectedIndex() === i\"\n [class.thy-stepper-header-active]=\"i <= selectedIndex()\"\n [active]=\"i <= selectedIndex()\">\n </thy-step-header>\n @if (!isLast) {\n <div class=\"thy-stepper-line\" [class.thy-stepper-line-active]=\"i < selectedIndex()\"></div>\n }\n }\n </div>\n}\n\n<div class=\"thy-stepper-content-container\">\n <ng-container [ngTemplateOutlet]=\"selected()?.content()\"></ng-container>\n</div>\n\n " }]
|
|
137
|
+
}], ctorParameters: () => [] });
|
|
171
138
|
|
|
172
139
|
/**
|
|
173
140
|
* 在步进工作流中移动到下一个步骤的按钮
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-stepper.mjs","sources":["../../../src/stepper/step-header.component.ts","../../../src/stepper/step-header.component.html","../../../src/stepper/step.component.ts","../../../src/stepper/step.component.html","../../../src/stepper/stepper.component.ts","../../../src/stepper/stepper.component.html","../../../src/stepper/stepper-button.directive.ts","../../../src/stepper/stepper.module.ts","../../../src/stepper/ngx-tethys-stepper.ts"],"sourcesContent":["import { ThyIcon } from 'ngx-tethys/icon';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\nimport { Component, HostBinding, Input, numberAttribute } from '@angular/core';\n\n/**\n * 步骤条头部组件\n * @name thy-step-header\n * @order 25\n */\n@Component({\n selector: 'thy-step-header',\n templateUrl: './step-header.component.html',\n imports: [ThyIcon]\n})\nexport class ThyStepHeader {\n @Input() label: string;\n\n @Input() icon: string;\n\n @Input({ transform: numberAttribute }) index: number;\n\n @HostBinding('class.thy-stepper-header-selected')\n @Input({ transform: coerceBooleanProperty })\n selected: boolean;\n\n @Input({ transform: coerceBooleanProperty }) active: boolean;\n\n @HostBinding('class.thy-stepper-header') thyStepHeader = true;\n}\n","<div class=\"thy-step-number\">\n <span>{{ index + 1 }}</span>\n</div>\n<thy-icon class=\"thy-step-icon\" [thyIconName]=\"icon || 'check-circle'\"></thy-icon>\n<div class=\"thy-step-label\">{{ label }}</div>\n","import { Component, InjectionToken, Input, TemplateRef, ViewChild, inject } from '@angular/core';\n\nexport interface IThyStepperComponent {\n selected: ThyStep;\n}\n\nexport const THY_STEPPER_COMPONENT = new InjectionToken<IThyStepperComponent>('THY_STEPPER_COMPONENT');\n\n/**\n * 步骤项组件\n * @name thy-step\n * @order 20\n */\n@Component({\n selector: 'thy-step',\n templateUrl: './step.component.html'\n})\nexport class ThyStep {\n stepper = inject(THY_STEPPER_COMPONENT, { optional: true })!;\n\n @ViewChild(TemplateRef, { static: true }) content: TemplateRef<any>;\n\n @Input() label: string;\n\n /**\n * 步骤条中每个步骤的label文本\n */\n @Input() thyLabel: string;\n\n /**\n * 步骤条中每个步骤完成的图标\n * @default check-circle\n */\n @Input() thyIcon: string;\n\n select() {\n this.stepper.selected = this;\n }\n}\n","<ng-template><ng-content></ng-content></ng-template>\n","import {\n Component,\n ViewChildren,\n ContentChildren,\n QueryList,\n HostBinding,\n Input,\n Output,\n EventEmitter,\n numberAttribute\n} from '@angular/core';\nimport { ThyStep, IThyStepperComponent, THY_STEPPER_COMPONENT } from './step.component';\nimport { ThyStepHeader } from './step-header.component';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\n/**\n * 步骤条组件\n * @name thy-stepper\n * @order 10\n */\n@Component({\n selector: 'thy-stepper',\n templateUrl: 'stepper.component.html',\n providers: [\n {\n provide: THY_STEPPER_COMPONENT,\n useExisting: ThyStepper\n }\n ],\n imports: [ThyStepHeader, NgTemplateOutlet]\n})\nexport class ThyStepper implements IThyStepperComponent {\n /**\n * 当前处于激活状态的步骤index\n * @default 0\n */\n @Input({ transform: numberAttribute })\n set thySelectedIndex(value: number) {\n this.selectedIndex = value;\n }\n\n @Input()\n set thySelected(value: ThyStep) {\n this.selected = value;\n }\n\n /**\n * 步骤条导航是否展示,默认展示\n */\n @Input({ transform: coerceBooleanProperty }) thyShowStepHeader = true;\n\n private _selectedIndex = 0;\n\n public set selected(step: ThyStep) {\n this.selectedIndex = this.steps ? this.steps.toArray().indexOf(step) : -1;\n }\n\n public get selected() {\n return this.steps ? this.steps.toArray()[this.selectedIndex] : null;\n }\n\n set selectedIndex(index: number) {\n if (this.steps) {\n this._updateSelectedItemIndex(index);\n } else {\n this._selectedIndex = index;\n }\n }\n\n get selectedIndex() {\n return this._selectedIndex;\n }\n\n @Output() selectionChange: EventEmitter<any> = new EventEmitter<any>();\n\n @ViewChildren(ThyStepHeader) stepHeaders: QueryList<ThyStepHeader>;\n\n @ContentChildren(ThyStep) steps: QueryList<ThyStep>;\n\n @HostBinding('class.thy-stepper') thyStepper = true;\n\n private _updateSelectedItemIndex(newIndex: number): void {\n const stepsArray = this.steps.toArray();\n this.selectionChange.emit({\n selectedIndex: newIndex,\n previouslySelectedIndex: this._selectedIndex,\n selectedStep: stepsArray[newIndex],\n previouslySelectedStep: stepsArray[this._selectedIndex]\n });\n this._selectedIndex = newIndex;\n }\n\n to(index: number): void {\n this.selectedIndex = Math.min(index, this.steps.length - 1);\n }\n\n next(): void {\n this.selectedIndex = Math.min(this._selectedIndex + 1, this.steps.length - 1);\n }\n\n /** Selects and focuses the previous step in list. */\n previous(): void {\n this.selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n}\n","@if (thyShowStepHeader) {\n <div class=\"thy-stepper-header-container\">\n @for (step of steps; track $index; let i = $index; let isLast = $last) {\n <thy-step-header\n [index]=\"i\"\n [label]=\"step.thyLabel || step.label\"\n [icon]=\"step.thyIcon\"\n [selected]=\"selectedIndex === i\"\n [class.thy-stepper-header-active]=\"i <= selectedIndex\"\n [active]=\"i <= selectedIndex\">\n </thy-step-header>\n @if (!isLast) {\n <div class=\"thy-stepper-line\" [class.thy-stepper-line-active]=\"i < selectedIndex\"></div>\n }\n }\n </div>\n}\n\n<div class=\"thy-stepper-content-container\">\n <ng-container [ngTemplateOutlet]=\"selected?.content\"></ng-container>\n</div>\n","import { Directive, HostListener, inject } from '@angular/core';\nimport { ThyStepper } from './stepper.component';\n\n/**\n * 在步进工作流中移动到下一个步骤的按钮\n * @description.en-us Button that moves to the next step in a stepper workflow.\n * @name thyStepperNext\n * @order 40\n */\n@Directive({\n selector: '[thyStepperNext]'\n})\nexport class ThyStepperNextDirective {\n private stepper = inject(ThyStepper);\n\n @HostListener('click', ['$event'])\n click($event: any) {\n this.stepper.next();\n }\n}\n\n/**\n * 在步进工作流中移动到上一个步骤的按钮\n * @description.en-us Button that moves to the previous step in a stepper workflow.\n * @name thyStepperPrevious\n * @order 30\n */\n@Directive({\n selector: '[thyStepperPrevious]'\n})\nexport class ThyStepperPreviousDirective {\n private stepper = inject(ThyStepper);\n\n @HostListener('click', ['$event'])\n click($event: any) {\n this.stepper.previous();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ThyStepHeader } from './step-header.component';\nimport { ThyStep } from './step.component';\nimport { ThyStepper } from './stepper.component';\nimport { ThyStepperNextDirective, ThyStepperPreviousDirective } from './stepper-button.directive';\n\n@NgModule({\n imports: [CommonModule, ThyStepHeader, ThyStepper, ThyStep, ThyStepperNextDirective, ThyStepperPreviousDirective],\n exports: [ThyStepper, ThyStep, ThyStepHeader, ThyStepperNextDirective, ThyStepperPreviousDirective],\n providers: []\n})\nexport class ThyStepperModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAKA;;;;AAIG;MAMU,aAAa,CAAA;AAL1B,IAAA,WAAA,GAAA;QAkB6C,IAAa,CAAA,aAAA,GAAG,IAAI;AAChE;8GAdY,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,OAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAKF,eAAe,CAGf,EAAA,QAAA,EAAA,CAAA,UAAA,EAAA,UAAA,EAAA,qBA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BAA2B,CAAA,EAAA,CAAA,CAAA;AAGzF,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,gBAAgB,EAJf,OAAA,EAAA,CAAA,YAAY,EAAE,aAAa,EAAE,UAAU,CAAA,EAAA,CAAA,CAAA;;2FAIxC,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,CAAC;oBACjH,OAAO,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,2BAA2B,CAAC;AACnG,oBAAA,SAAS,EAAE;AACd,iBAAA;;;ACXD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-tethys-stepper.mjs","sources":["../../../src/stepper/step-header.component.ts","../../../src/stepper/step-header.component.html","../../../src/stepper/step.component.ts","../../../src/stepper/step.component.html","../../../src/stepper/stepper.component.ts","../../../src/stepper/stepper.component.html","../../../src/stepper/stepper-button.directive.ts","../../../src/stepper/stepper.module.ts","../../../src/stepper/ngx-tethys-stepper.ts"],"sourcesContent":["import { ThyIcon } from 'ngx-tethys/icon';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\nimport { Component, HostBinding, Input, numberAttribute, input, ChangeDetectionStrategy } from '@angular/core';\n\n/**\n * 步骤条头部组件\n * @name thy-step-header\n * @order 25\n */\n@Component({\n selector: 'thy-step-header',\n templateUrl: './step-header.component.html',\n imports: [ThyIcon],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'thy-stepper-header' }\n})\nexport class ThyStepHeader {\n readonly label = input<string>();\n\n readonly icon = input<string>();\n\n readonly index = input<number, unknown>(undefined, { transform: numberAttribute });\n\n readonly selected = input(false, { transform: coerceBooleanProperty });\n\n readonly active = input(false, { transform: coerceBooleanProperty });\n}\n","<div class=\"thy-step-number\">\n <span>{{ index() + 1 }}</span>\n</div>\n<thy-icon class=\"thy-step-icon\" [thyIconName]=\"icon() || 'check-circle'\"></thy-icon>\n<div class=\"thy-step-label\">{{ label() }}</div>\n","import { Component, InjectionToken, TemplateRef, ViewChild, inject, input, WritableSignal, viewChild } from '@angular/core';\n\nexport interface IThyStepperComponent {\n updateSelected(step: ThyStep): void;\n}\n\nexport const THY_STEPPER_COMPONENT = new InjectionToken<IThyStepperComponent>('THY_STEPPER_COMPONENT');\n\n/**\n * 步骤项组件\n * @name thy-step\n * @order 20\n */\n@Component({ selector: 'thy-step', templateUrl: './step.component.html' })\nexport class ThyStep {\n stepper = inject(THY_STEPPER_COMPONENT, { optional: true })!;\n\n readonly content = viewChild<TemplateRef<any>>(TemplateRef);\n\n readonly label = input<string>();\n\n /**\n * 步骤条中每个步骤的label文本\n */\n readonly thyLabel = input<string>();\n\n /**\n * 步骤条中每个步骤完成的图标\n * @default check-circle\n */\n readonly thyIcon = input<string>();\n\n select() {\n this.stepper.updateSelected(this);\n }\n}\n","<ng-template><ng-content></ng-content></ng-template>\n","import {\n Component,\n numberAttribute,\n viewChildren,\n output,\n contentChildren,\n input,\n computed,\n effect,\n ChangeDetectionStrategy,\n signal,\n untracked\n} from '@angular/core';\nimport { ThyStep, IThyStepperComponent, THY_STEPPER_COMPONENT } from './step.component';\nimport { ThyStepHeader } from './step-header.component';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\n/**\n * 步骤条组件\n * @name thy-stepper\n * @order 10\n */\n@Component({\n selector: 'thy-stepper',\n templateUrl: 'stepper.component.html',\n providers: [{ provide: THY_STEPPER_COMPONENT, useExisting: ThyStepper }],\n imports: [ThyStepHeader, NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'thy-stepper' }\n})\nexport class ThyStepper implements IThyStepperComponent {\n /**\n * 当前处于激活状态的步骤 index\n */\n readonly thySelectedIndex = input<number, unknown>(0, { transform: numberAttribute });\n\n /**\n * 当前处于激活状态的步骤实例\n */\n readonly thySelected = input<ThyStep>();\n\n /**\n * 步骤条导航是否展示,默认展示\n */\n readonly thyShowStepHeader = input(true, { transform: coerceBooleanProperty });\n\n readonly selectionChange = output<any>();\n\n readonly steps = contentChildren(ThyStep);\n\n protected selectedIndex = signal(0);\n\n protected readonly selected = computed(() => this.steps()?.[this.selectedIndex()]);\n\n constructor() {\n effect(() => {\n const newIndex = this.thySelectedIndex();\n if (newIndex) {\n untracked(() => {\n this.updateSelectedIndex(newIndex);\n });\n }\n });\n\n effect(() => {\n const selected = this.thySelected();\n if (selected) {\n untracked(() => {\n const index = this.steps()?.indexOf(selected);\n if (index > -1) {\n this.updateSelectedIndex(index);\n }\n });\n }\n });\n }\n\n private updateSelectedIndex(newIndex: number): void {\n if (!this.steps()?.[newIndex]) {\n return;\n }\n const previouslySelectedIndex = this.selectedIndex();\n const previouslySelectedStep = this.steps() ? this.steps()[previouslySelectedIndex] : null;\n this.selectedIndex.set(newIndex);\n this.selectionChange.emit({\n selectedIndex: newIndex,\n previouslySelectedIndex: previouslySelectedIndex,\n selectedStep: this.selected(),\n previouslySelectedStep: previouslySelectedStep\n });\n }\n\n updateSelected(step: ThyStep): void {\n const index = this.steps().indexOf(step);\n this.updateSelectedIndex(index);\n }\n\n to(index: number): void {\n this.updateSelectedIndex(Math.min(index, this.steps().length - 1));\n }\n\n next(): void {\n this.updateSelectedIndex(Math.min(this.selectedIndex() + 1, this.steps().length - 1));\n }\n\n /** Selects and focuses the previous step in list. */\n previous(): void {\n this.updateSelectedIndex(Math.max(this.selectedIndex() - 1, 0));\n }\n}\n","@if (thyShowStepHeader()) {\n <div class=\"thy-stepper-header-container\">\n @for (step of steps(); track $index; let i = $index; let isLast = $last) {\n <thy-step-header\n [index]=\"i\"\n [label]=\"step.thyLabel() || step.label()\"\n [icon]=\"step.thyIcon()\"\n [selected]=\"selectedIndex() === i\"\n [class.thy-stepper-header-active]=\"i <= selectedIndex()\"\n [active]=\"i <= selectedIndex()\">\n </thy-step-header>\n @if (!isLast) {\n <div class=\"thy-stepper-line\" [class.thy-stepper-line-active]=\"i < selectedIndex()\"></div>\n }\n }\n </div>\n}\n\n<div class=\"thy-stepper-content-container\">\n <ng-container [ngTemplateOutlet]=\"selected()?.content()\"></ng-container>\n</div>\n\n ","import { Directive, HostListener, inject } from '@angular/core';\nimport { ThyStepper } from './stepper.component';\n\n/**\n * 在步进工作流中移动到下一个步骤的按钮\n * @description.en-us Button that moves to the next step in a stepper workflow.\n * @name thyStepperNext\n * @order 40\n */\n@Directive({\n selector: '[thyStepperNext]'\n})\nexport class ThyStepperNextDirective {\n private stepper = inject(ThyStepper);\n\n @HostListener('click', ['$event'])\n click($event: any) {\n this.stepper.next();\n }\n}\n\n/**\n * 在步进工作流中移动到上一个步骤的按钮\n * @description.en-us Button that moves to the previous step in a stepper workflow.\n * @name thyStepperPrevious\n * @order 30\n */\n@Directive({\n selector: '[thyStepperPrevious]'\n})\nexport class ThyStepperPreviousDirective {\n private stepper = inject(ThyStepper);\n\n @HostListener('click', ['$event'])\n click($event: any) {\n this.stepper.previous();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ThyStepHeader } from './step-header.component';\nimport { ThyStep } from './step.component';\nimport { ThyStepper } from './stepper.component';\nimport { ThyStepperNextDirective, ThyStepperPreviousDirective } from './stepper-button.directive';\n\n@NgModule({\n imports: [CommonModule, ThyStepHeader, ThyStepper, ThyStep, ThyStepperNextDirective, ThyStepperPreviousDirective],\n exports: [ThyStepper, ThyStep, ThyStepHeader, ThyStepperNextDirective, ThyStepperPreviousDirective],\n providers: []\n})\nexport class ThyStepperModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";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,EAAE,2BAA2B,CAAA,EAAA,CAAA,CAAA;AAGzF,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,gBAAgB,EAJf,OAAA,EAAA,CAAA,YAAY,EAAE,aAAa,EAAE,UAAU,CAAA,EAAA,CAAA,CAAA;;2FAIxC,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,CAAC;oBACjH,OAAO,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,2BAA2B,CAAC;AACnG,oBAAA,SAAS,EAAE;AACd,iBAAA;;;ACXD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
2
|
+
import { inject, computed, input, forwardRef, HostBinding, Component, NgModule } from '@angular/core';
|
|
3
3
|
import { ThyTranslate } from 'ngx-tethys/core';
|
|
4
4
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
5
|
import { injectLocale } from 'ngx-tethys/i18n';
|
|
@@ -21,61 +21,57 @@ class ThyStrength {
|
|
|
21
21
|
this.translate = inject(ThyTranslate);
|
|
22
22
|
this.styleClass = true;
|
|
23
23
|
this.locale = injectLocale('strength');
|
|
24
|
-
this.strengthMap = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
this.strengthMap = computed(() => {
|
|
25
|
+
return {
|
|
26
|
+
[ThyStrengthEnum.highest]: {
|
|
27
|
+
level: 'highest',
|
|
28
|
+
text: this.highestKey()
|
|
29
|
+
},
|
|
30
|
+
[ThyStrengthEnum.high]: {
|
|
31
|
+
level: 'high',
|
|
32
|
+
text: this.highKey()
|
|
33
|
+
},
|
|
34
|
+
[ThyStrengthEnum.average]: {
|
|
35
|
+
level: 'average',
|
|
36
|
+
text: this.averageKey()
|
|
37
|
+
},
|
|
38
|
+
[ThyStrengthEnum.low]: {
|
|
39
|
+
level: 'low',
|
|
40
|
+
text: this.lowKey()
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* 组件标题,描述程度所指类型
|
|
46
|
+
*/
|
|
47
|
+
this.titleKey = input('', { transform: (value) => this.translate.instant(value) || '' });
|
|
48
|
+
/**
|
|
49
|
+
* 程度最高值文本
|
|
50
|
+
*/
|
|
51
|
+
this.highestKey = input(this.locale().highest, {
|
|
52
|
+
transform: (value) => this.translate.instant(value) || this.locale().highest
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* 程度为高值时展示的文本
|
|
56
|
+
*/
|
|
57
|
+
this.highKey = input(this.locale().high, {
|
|
58
|
+
transform: (value) => this.translate.instant(value) || this.locale().high
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* 程度为中值时展示的文本
|
|
62
|
+
*/
|
|
63
|
+
this.averageKey = input(this.locale().medium, {
|
|
64
|
+
transform: (value) => this.translate.instant(value) || this.locale().medium
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* 程度为低值时展示的文本
|
|
68
|
+
*/
|
|
69
|
+
this.lowKey = input(this.locale().low, {
|
|
70
|
+
transform: (value) => this.translate.instant(value) || this.locale().low
|
|
71
|
+
});
|
|
42
72
|
this._onChange = Function.prototype;
|
|
43
73
|
this._onTouched = Function.prototype;
|
|
44
74
|
}
|
|
45
|
-
/**
|
|
46
|
-
* 组件标题,描述程度所指类型
|
|
47
|
-
*/
|
|
48
|
-
set titleKey(value) {
|
|
49
|
-
this.strengthTitle = this.translate.instant(value);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* 程度最高值文本
|
|
53
|
-
* @default 最高
|
|
54
|
-
*/
|
|
55
|
-
set highestKey(value) {
|
|
56
|
-
this.strengthMap[ThyStrengthEnum.highest].text = this.translate.instant(value);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* 程度为高值时展示的文本
|
|
60
|
-
* @default 高
|
|
61
|
-
*/
|
|
62
|
-
set highKey(value) {
|
|
63
|
-
this.strengthMap[ThyStrengthEnum.high].text = this.translate.instant(value);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* 程度为中值时展示的文本
|
|
67
|
-
* @default 中
|
|
68
|
-
*/
|
|
69
|
-
set averageKey(value) {
|
|
70
|
-
this.strengthMap[ThyStrengthEnum.average].text = this.translate.instant(value);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* 程度为低值时展示的文本
|
|
74
|
-
* @default 低
|
|
75
|
-
*/
|
|
76
|
-
set lowKey(value) {
|
|
77
|
-
this.strengthMap[ThyStrengthEnum.low].text = this.translate.instant(value);
|
|
78
|
-
}
|
|
79
75
|
ngOnInit() { }
|
|
80
76
|
writeValue(value) {
|
|
81
77
|
this.strength = value;
|
|
@@ -89,13 +85,13 @@ class ThyStrength {
|
|
|
89
85
|
this._onTouched = fn;
|
|
90
86
|
}
|
|
91
87
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStrength, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
92
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
88
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyStrength, isStandalone: true, selector: "thy-strength", inputs: { titleKey: { classPropertyName: "titleKey", publicName: "titleKey", isSignal: true, isRequired: false, transformFunction: null }, highestKey: { classPropertyName: "highestKey", publicName: "highestKey", isSignal: true, isRequired: false, transformFunction: null }, highKey: { classPropertyName: "highKey", publicName: "highKey", isSignal: true, isRequired: false, transformFunction: null }, averageKey: { classPropertyName: "averageKey", publicName: "averageKey", isSignal: true, isRequired: false, transformFunction: null }, lowKey: { classPropertyName: "lowKey", publicName: "lowKey", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.password-strength-container": "this.styleClass" } }, providers: [
|
|
93
89
|
{
|
|
94
90
|
provide: NG_VALUE_ACCESSOR,
|
|
95
91
|
useExisting: forwardRef(() => ThyStrength),
|
|
96
92
|
multi: true
|
|
97
93
|
}
|
|
98
|
-
], ngImport: i0, template: "<div>\n {{
|
|
94
|
+
], ngImport: i0, template: "<div>\n {{ titleKey() }} <span class=\"strength-text strength-text-{{ strengthMap()[strength]?.level }}\">{{ strengthMap()[strength]?.text }}</span>\n</div>\n<div class=\"strength-level strength-level-{{ strengthMap()[strength]?.level }}\">\n <span></span>\n</div>\n" }); }
|
|
99
95
|
}
|
|
100
96
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStrength, decorators: [{
|
|
101
97
|
type: Component,
|
|
@@ -105,20 +101,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
105
101
|
useExisting: forwardRef(() => ThyStrength),
|
|
106
102
|
multi: true
|
|
107
103
|
}
|
|
108
|
-
], template: "<div>\n {{
|
|
104
|
+
], template: "<div>\n {{ titleKey() }} <span class=\"strength-text strength-text-{{ strengthMap()[strength]?.level }}\">{{ strengthMap()[strength]?.text }}</span>\n</div>\n<div class=\"strength-level strength-level-{{ strengthMap()[strength]?.level }}\">\n <span></span>\n</div>\n" }]
|
|
109
105
|
}], propDecorators: { styleClass: [{
|
|
110
106
|
type: HostBinding,
|
|
111
107
|
args: ['class.password-strength-container']
|
|
112
|
-
}], titleKey: [{
|
|
113
|
-
type: Input
|
|
114
|
-
}], highestKey: [{
|
|
115
|
-
type: Input
|
|
116
|
-
}], highKey: [{
|
|
117
|
-
type: Input
|
|
118
|
-
}], averageKey: [{
|
|
119
|
-
type: Input
|
|
120
|
-
}], lowKey: [{
|
|
121
|
-
type: Input
|
|
122
108
|
}] } });
|
|
123
109
|
|
|
124
110
|
class ThyStrengthModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-strength.mjs","sources":["../../../src/strength/strength.component.ts","../../../src/strength/strength.component.html","../../../src/strength/strength.module.ts","../../../src/strength/ngx-tethys-strength.ts"],"sourcesContent":["import { ThyTranslate } from 'ngx-tethys/core';\n\nimport { Component, forwardRef, HostBinding,
|
|
1
|
+
{"version":3,"file":"ngx-tethys-strength.mjs","sources":["../../../src/strength/strength.component.ts","../../../src/strength/strength.component.html","../../../src/strength/strength.module.ts","../../../src/strength/ngx-tethys-strength.ts"],"sourcesContent":["import { ThyTranslate } from 'ngx-tethys/core';\n\nimport { Component, computed, forwardRef, HostBinding, inject, input, OnInit, Signal } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { injectLocale, ThyStrengthLocale } from 'ngx-tethys/i18n';\n\nenum ThyStrengthEnum {\n highest = 4,\n high = 3,\n average = 2,\n low = 1\n}\n\n/**\n * 程度展示组件\n * @name thy-strength\n * @order 10\n */\n@Component({\n selector: 'thy-strength',\n templateUrl: 'strength.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ThyStrength),\n multi: true\n }\n ]\n})\nexport class ThyStrength implements OnInit, ControlValueAccessor {\n translate = inject(ThyTranslate);\n\n @HostBinding('class.password-strength-container') styleClass = true;\n\n strength: ThyStrengthEnum;\n\n locale: Signal<ThyStrengthLocale> = injectLocale('strength');\n\n readonly strengthMap = computed(() => {\n return {\n [ThyStrengthEnum.highest]: {\n level: 'highest',\n text: this.highestKey()\n },\n [ThyStrengthEnum.high]: {\n level: 'high',\n text: this.highKey()\n },\n [ThyStrengthEnum.average]: {\n level: 'average',\n text: this.averageKey()\n },\n [ThyStrengthEnum.low]: {\n level: 'low',\n text: this.lowKey()\n }\n };\n });\n\n /**\n * 组件标题,描述程度所指类型\n */\n readonly titleKey = input<string, string>('', { transform: (value: string) => this.translate.instant(value) || '' });\n\n /**\n * 程度最高值文本\n */\n readonly highestKey = input<string, string>(this.locale().highest, {\n transform: (value: string) => this.translate.instant(value) || this.locale().highest\n });\n\n /**\n * 程度为高值时展示的文本\n */\n readonly highKey = input<string, string>(this.locale().high, {\n transform: (value: string) => this.translate.instant(value) || this.locale().high\n });\n\n /**\n * 程度为中值时展示的文本\n */\n readonly averageKey = input<string, string>(this.locale().medium, {\n transform: (value: string) => this.translate.instant(value) || this.locale().medium\n });\n\n /**\n * 程度为低值时展示的文本\n */\n readonly lowKey = input<string, string>(this.locale().low, {\n transform: (value: string) => this.translate.instant(value) || this.locale().low\n });\n\n private _onChange = Function.prototype;\n\n private _onTouched = Function.prototype;\n\n ngOnInit() {}\n\n writeValue(value: ThyStrengthEnum) {\n this.strength = value;\n this._onChange(value);\n this._onTouched();\n }\n\n registerOnChange(fn: (value: any) => any): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: () => any): void {\n this._onTouched = fn;\n }\n}\n","<div>\n {{ titleKey() }} <span class=\"strength-text strength-text-{{ strengthMap()[strength]?.level }}\">{{ strengthMap()[strength]?.text }}</span>\n</div>\n<div class=\"strength-level strength-level-{{ strengthMap()[strength]?.level }}\">\n <span></span>\n</div>\n","import { NgModule } from '@angular/core';\nimport { ThyStrength } from './strength.component';\n\n@NgModule({\n imports: [ThyStrength],\n exports: [ThyStrength],\n providers: []\n})\nexport class ThyStrengthModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"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