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 { isThemeColor } from 'ngx-tethys/core';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, ElementRef, Renderer2,
|
|
3
|
+
import { inject, ElementRef, Renderer2, input, effect, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
|
|
6
6
|
const COMPONENT_CLASS_NAME = 'thy-dot';
|
|
@@ -17,68 +17,53 @@ class ThyDot {
|
|
|
17
17
|
constructor() {
|
|
18
18
|
this.el = inject(ElementRef);
|
|
19
19
|
this.renderer = inject(Renderer2);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/**
|
|
21
|
+
* 颜色,可选值为:`primary` `success` `info` `warning` `danger` `default` `light`和自定义颜色,如`#2cccda` `red` `rgb(153, 153, 153)`
|
|
22
|
+
* @type ThyThemeColor | string
|
|
23
|
+
*/
|
|
24
|
+
this.thyColor = input(DEFAULT_COLOR_NAME, {
|
|
25
|
+
transform: (value) => value || DEFAULT_COLOR_NAME
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* 大小
|
|
29
|
+
* @type xs | sm | md | lg | xlg
|
|
30
|
+
*/
|
|
31
|
+
this.thySize = input(DEFAULT_SIZE_NAME, {
|
|
32
|
+
transform: (value) => value || DEFAULT_SIZE_NAME
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* 主题
|
|
36
|
+
* @type outline(线框) | fill(填充)
|
|
37
|
+
*/
|
|
38
|
+
this.thyTheme = input(DEFAULT_THEME_NAME, {
|
|
39
|
+
transform: (value) => value || DEFAULT_THEME_NAME
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* 形状
|
|
43
|
+
* @type circle(圆形) | square(方形)
|
|
44
|
+
*/
|
|
45
|
+
this.thyShape = input(DEFAULT_SHAPE_NAME, {
|
|
46
|
+
transform: (value) => value || DEFAULT_SHAPE_NAME
|
|
47
|
+
});
|
|
24
48
|
this.nativeElement = this.el.nativeElement;
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* 颜色,可选值为:`primary` `success` `info` `warning` `danger` `default` `light`和自定义颜色,如`#2cccda` `red` `rgb(153, 153, 153)`
|
|
29
|
-
* @type ThyThemeColor | string
|
|
30
|
-
* @default primary
|
|
31
|
-
*/
|
|
32
|
-
set thyColor(value) {
|
|
33
|
-
if (value) {
|
|
34
|
-
this.color = value;
|
|
49
|
+
effect(() => {
|
|
35
50
|
this.updateColorStyle();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* 大小
|
|
40
|
-
* @type xs | sm | md | lg | xlg
|
|
41
|
-
* @default sm
|
|
42
|
-
*/
|
|
43
|
-
set thySize(value) {
|
|
44
|
-
if (value) {
|
|
45
|
-
this.size = value;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 主题
|
|
50
|
-
* @type outline(线框) | fill(填充)
|
|
51
|
-
* @default fill
|
|
52
|
-
*/
|
|
53
|
-
set thyTheme(value) {
|
|
54
|
-
if (value) {
|
|
55
|
-
this.theme = value;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* 形状
|
|
60
|
-
* @type circle(圆形) | square(方形)
|
|
61
|
-
* @default circle
|
|
62
|
-
*/
|
|
63
|
-
set thyShape(value) {
|
|
64
|
-
if (value) {
|
|
65
|
-
this.shape = value;
|
|
66
|
-
}
|
|
51
|
+
});
|
|
67
52
|
}
|
|
68
53
|
updateColorStyle() {
|
|
69
54
|
Array.from(this.nativeElement.classList)
|
|
70
55
|
.filter(it => /^dot-color-[\w]+$/.test(it))
|
|
71
56
|
.forEach(it => this.renderer.removeClass(this.nativeElement, it));
|
|
72
|
-
if (isThemeColor(this.
|
|
57
|
+
if (isThemeColor(this.thyColor())) {
|
|
73
58
|
this.renderer.setStyle(this.nativeElement, 'borderColor', 'none');
|
|
74
|
-
this.renderer.addClass(this.nativeElement, `dot-color-${this.
|
|
59
|
+
this.renderer.addClass(this.nativeElement, `dot-color-${this.thyColor()}`);
|
|
75
60
|
}
|
|
76
61
|
else {
|
|
77
|
-
this.renderer.setStyle(this.nativeElement, 'borderColor', this.
|
|
62
|
+
this.renderer.setStyle(this.nativeElement, 'borderColor', this.thyColor());
|
|
78
63
|
}
|
|
79
64
|
}
|
|
80
65
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDot, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
81
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
66
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyDot, isStandalone: true, selector: "thy-dot,[thy-dot],[thyDot]", inputs: { thyColor: { classPropertyName: "thyColor", publicName: "thyColor", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyTheme: { classPropertyName: "thyTheme", publicName: "thyTheme", isSignal: true, isRequired: false, transformFunction: null }, thyShape: { classPropertyName: "thyShape", publicName: "thyShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.dot-theme-fill": "thyTheme() === \"fill\"", "class.dot-theme-outline": "thyTheme() === \"outline\"", "class.dot-shape-square": "thyShape() === \"square\"", "class.dot-shape-circle": "thyShape() === \"circle\"", "class.dot-size-md": "thySize() === \"md\"", "class.dot-size-sm": "thySize() === \"sm\"", "class.dot-size-xs": "thySize() === \"xs\"", "class.dot-size-lg": "thySize() === \"lg\"", "class.dot-size-xlg": "thySize() === \"xlg\"" }, classAttribute: "thy-dot" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
82
67
|
}
|
|
83
68
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDot, decorators: [{
|
|
84
69
|
type: Component,
|
|
@@ -89,26 +74,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
89
74
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
90
75
|
host: {
|
|
91
76
|
class: 'thy-dot',
|
|
92
|
-
'[class.dot-theme-fill]': '
|
|
93
|
-
'[class.dot-theme-outline]': '
|
|
94
|
-
'[class.dot-shape-square]': '
|
|
95
|
-
'[class.dot-shape-circle]': '
|
|
96
|
-
'[class.dot-size-md]': '
|
|
97
|
-
'[class.dot-size-sm]': '
|
|
98
|
-
'[class.dot-size-xs]': '
|
|
99
|
-
'[class.dot-size-lg]': '
|
|
100
|
-
'[class.dot-size-xlg]': '
|
|
77
|
+
'[class.dot-theme-fill]': 'thyTheme() === "fill"',
|
|
78
|
+
'[class.dot-theme-outline]': 'thyTheme() === "outline"',
|
|
79
|
+
'[class.dot-shape-square]': 'thyShape() === "square"',
|
|
80
|
+
'[class.dot-shape-circle]': 'thyShape() === "circle"',
|
|
81
|
+
'[class.dot-size-md]': 'thySize() === "md"',
|
|
82
|
+
'[class.dot-size-sm]': 'thySize() === "sm"',
|
|
83
|
+
'[class.dot-size-xs]': 'thySize() === "xs"',
|
|
84
|
+
'[class.dot-size-lg]': 'thySize() === "lg"',
|
|
85
|
+
'[class.dot-size-xlg]': 'thySize() === "xlg"'
|
|
101
86
|
}
|
|
102
87
|
}]
|
|
103
|
-
}], ctorParameters: () => []
|
|
104
|
-
type: Input
|
|
105
|
-
}], thySize: [{
|
|
106
|
-
type: Input
|
|
107
|
-
}], thyTheme: [{
|
|
108
|
-
type: Input
|
|
109
|
-
}], thyShape: [{
|
|
110
|
-
type: Input
|
|
111
|
-
}] } });
|
|
88
|
+
}], ctorParameters: () => [] });
|
|
112
89
|
|
|
113
90
|
class ThyDotModule {
|
|
114
91
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDotModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-dot.mjs","sources":["../../../src/dot/dot.component.ts","../../../src/dot/dot.module.ts","../../../src/dot/ngx-tethys-dot.ts"],"sourcesContent":["import { isThemeColor, ThyThemeColor } from 'ngx-tethys/core';\n\nimport { ChangeDetectionStrategy, Component, ElementRef,
|
|
1
|
+
{"version":3,"file":"ngx-tethys-dot.mjs","sources":["../../../src/dot/dot.component.ts","../../../src/dot/dot.module.ts","../../../src/dot/ngx-tethys-dot.ts"],"sourcesContent":["import { isThemeColor, ThyThemeColor } from 'ngx-tethys/core';\n\nimport { ChangeDetectionStrategy, Component, ElementRef, Renderer2, ViewEncapsulation, effect, inject, input } from '@angular/core';\n\nexport type ThyColorType = ThyThemeColor | string;\nexport type ThySizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xlg';\nexport type ThyThemeType = 'outline' | 'fill';\nexport type ThyShapeType = 'square' | 'circle';\n\nexport const COMPONENT_CLASS_NAME = 'thy-dot';\n\nexport const DEFAULT_COLOR_NAME = 'primary';\nexport const DEFAULT_SIZE_NAME = 'sm';\nexport const DEFAULT_THEME_NAME = 'fill';\nexport const DEFAULT_SHAPE_NAME = 'circle';\n\n/**\n * 显示一个点的组件\n * @name thy-dot,[thy-dot],[thyDot]\n * @order 10\n */\n@Component({\n selector: 'thy-dot,[thy-dot],[thyDot]',\n template: '',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-dot',\n '[class.dot-theme-fill]': 'thyTheme() === \"fill\"',\n '[class.dot-theme-outline]': 'thyTheme() === \"outline\"',\n '[class.dot-shape-square]': 'thyShape() === \"square\"',\n '[class.dot-shape-circle]': 'thyShape() === \"circle\"',\n '[class.dot-size-md]': 'thySize() === \"md\"',\n '[class.dot-size-sm]': 'thySize() === \"sm\"',\n '[class.dot-size-xs]': 'thySize() === \"xs\"',\n '[class.dot-size-lg]': 'thySize() === \"lg\"',\n '[class.dot-size-xlg]': 'thySize() === \"xlg\"'\n }\n})\nexport class ThyDot {\n private el = inject(ElementRef);\n private renderer = inject(Renderer2);\n private nativeElement: HTMLElement;\n\n constructor() {\n this.nativeElement = this.el.nativeElement;\n\n effect(() => {\n this.updateColorStyle();\n });\n }\n\n /**\n * 颜色,可选值为:`primary` `success` `info` `warning` `danger` `default` `light`和自定义颜色,如`#2cccda` `red` `rgb(153, 153, 153)`\n * @type ThyThemeColor | string\n */\n readonly thyColor = input<ThyColorType, ThyColorType>(DEFAULT_COLOR_NAME, {\n transform: (value: ThyColorType) => value || DEFAULT_COLOR_NAME\n });\n\n /**\n * 大小\n * @type xs | sm | md | lg | xlg\n */\n readonly thySize = input<ThySizeType, ThySizeType>(DEFAULT_SIZE_NAME, {\n transform: (value: ThySizeType) => value || DEFAULT_SIZE_NAME\n });\n\n /**\n * 主题\n * @type outline(线框) | fill(填充)\n */\n readonly thyTheme = input<ThyThemeType, ThyThemeType>(DEFAULT_THEME_NAME, {\n transform: (value: ThyThemeType) => value || DEFAULT_THEME_NAME\n });\n\n /**\n * 形状\n * @type circle(圆形) | square(方形)\n */\n readonly thyShape = input<ThyShapeType, ThyShapeType>(DEFAULT_SHAPE_NAME, {\n transform: (value: ThyShapeType) => value || DEFAULT_SHAPE_NAME\n });\n\n updateColorStyle() {\n Array.from(this.nativeElement.classList)\n .filter(it => /^dot-color-[\\w]+$/.test(it))\n .forEach(it => this.renderer.removeClass(this.nativeElement, it));\n\n if (isThemeColor(this.thyColor())) {\n this.renderer.setStyle(this.nativeElement, 'borderColor', 'none');\n this.renderer.addClass(this.nativeElement, `dot-color-${this.thyColor()}`);\n } else {\n this.renderer.setStyle(this.nativeElement, 'borderColor', this.thyColor());\n }\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThyDot } from './dot.component';\n\n@NgModule({\n imports: [CommonModule, ThyDot],\n exports: [ThyDot]\n})\nexport class ThyDotModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -2,12 +2,12 @@ import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
|
|
|
2
2
|
import { ThySharedModule } from 'ngx-tethys/shared';
|
|
3
3
|
import { NgClass, NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { Injectable, inject, ElementRef, NgZone,
|
|
6
|
-
import { ThyTranslate } from 'ngx-tethys/core';
|
|
5
|
+
import { Injectable, inject, ElementRef, NgZone, input, contentChild, computed, effect, Component, NgModule } from '@angular/core';
|
|
7
6
|
import { useHostRenderer } from '@tethys/cdk/dom';
|
|
7
|
+
import { ThyTranslate } from 'ngx-tethys/core';
|
|
8
8
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
9
|
-
import { coerceBooleanProperty } from 'ngx-tethys/util';
|
|
10
9
|
import { injectLocale } from 'ngx-tethys/i18n';
|
|
10
|
+
import { coerceBooleanProperty } from 'ngx-tethys/util';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @deprecated
|
|
@@ -266,51 +266,109 @@ class ThyEmpty {
|
|
|
266
266
|
this.ngZone = inject(NgZone);
|
|
267
267
|
this.sanitizer = inject(DomSanitizer);
|
|
268
268
|
this.locale = injectLocale('empty');
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
/**
|
|
270
|
+
* 显示文本提示信息。同时传入 thyMessage,thyTranslationKey,thyEntityName,thyEntityNameTranslateKey 时优先级最高
|
|
271
|
+
* @default 暂无数据
|
|
272
|
+
*/
|
|
273
|
+
this.thyMessage = input();
|
|
274
|
+
/**
|
|
275
|
+
* 已废弃。显示文本提示信息多语言 Key。同时传入 thyTranslationKey,thyEntityName,thyEntityNameTranslateKey 时优先级最高
|
|
276
|
+
* @deprecated
|
|
277
|
+
*/
|
|
278
|
+
this.thyTranslationKey = input();
|
|
279
|
+
/**
|
|
280
|
+
* 已废弃。显示文本提示信息多语言 Key 的 Values。传入 thyTranslationKey 后,传入这个才会生效
|
|
281
|
+
* @deprecated
|
|
282
|
+
*/
|
|
283
|
+
this.thyTranslationValues = input();
|
|
284
|
+
/**
|
|
285
|
+
* 已废弃。显示默认提示信息,替换默认提示信息的目标对象,比如:没有 {thyEntityName}。同时传入 thyEntityName,thyEntityNameTranslateKey 时优先级较高
|
|
286
|
+
* @deprecated
|
|
287
|
+
*/
|
|
288
|
+
this.thyEntityName = input();
|
|
289
|
+
/**
|
|
290
|
+
* 已废弃。thyEntityName 的多语言 Key。thyMessage,thyTranslationKey,thyEntityName 均未传入时才会生效
|
|
291
|
+
* @deprecated
|
|
292
|
+
*/
|
|
293
|
+
this.thyEntityNameTranslateKey = input();
|
|
294
|
+
/**
|
|
295
|
+
* 提示图标名
|
|
296
|
+
*/
|
|
297
|
+
this.thyIconName = input();
|
|
298
|
+
/**
|
|
299
|
+
* 大小
|
|
300
|
+
* @type sm | md | lg
|
|
301
|
+
* @default md
|
|
302
|
+
*/
|
|
303
|
+
this.thySize = input('md');
|
|
304
|
+
/**
|
|
305
|
+
* 距上距离
|
|
306
|
+
*/
|
|
307
|
+
this.thyMarginTop = input();
|
|
308
|
+
/**
|
|
309
|
+
* 是否自动根据父容器计算高度,垂直居中
|
|
310
|
+
* @default false
|
|
311
|
+
*/
|
|
312
|
+
this.thyTopAuto = input(false, { transform: coerceBooleanProperty });
|
|
313
|
+
/**
|
|
314
|
+
* 自动计算高度垂直居中(即 thyTopAuto 为 true)时,支持传入自定义父容器
|
|
315
|
+
*/
|
|
316
|
+
this.thyContainer = input();
|
|
317
|
+
/**
|
|
318
|
+
* 提示图片链接
|
|
319
|
+
*/
|
|
320
|
+
this.thyImageUrl = input();
|
|
321
|
+
this.thyImageLoading = input();
|
|
322
|
+
this.thyImageFetchPriority = input();
|
|
323
|
+
/**
|
|
324
|
+
* 显示文本描述
|
|
325
|
+
*/
|
|
326
|
+
this.thyDescription = input();
|
|
271
327
|
this.hostRenderer = useHostRenderer();
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
328
|
+
/**
|
|
329
|
+
* 除提示图片,文本外的其他信息传入模板
|
|
330
|
+
* @type TemplateRef
|
|
331
|
+
*/
|
|
332
|
+
this.extraTemplateRef = contentChild('extra');
|
|
333
|
+
this.presetSvg = computed(() => {
|
|
334
|
+
let presetSvg = this.thyIconName() ? PRESET_SVG[this.thyIconName()] : PRESET_SVG.default;
|
|
335
|
+
return presetSvg ? this.sanitizer.bypassSecurityTrustHtml(presetSvg) : '';
|
|
336
|
+
});
|
|
337
|
+
this.displayText = computed(() => {
|
|
338
|
+
if (this.thyMessage()) {
|
|
339
|
+
return this.thyMessage();
|
|
340
|
+
}
|
|
341
|
+
else if (this.thyTranslationKey()) {
|
|
342
|
+
return this.thyTranslate.instant(this.thyTranslationKey(), this.thyTranslationValues());
|
|
343
|
+
}
|
|
344
|
+
else if (this.thyEntityName()) {
|
|
345
|
+
return this.thyTranslate.instant(this.thyEmptyConfig.noResultWithTargetTranslateKey, {
|
|
346
|
+
target: this.thyEntityName()
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
else if (this.thyEntityNameTranslateKey()) {
|
|
350
|
+
return this.thyTranslate.instant(this.thyEmptyConfig.noResultWithTargetTranslateKey, {
|
|
351
|
+
target: this.thyTranslate.instant(this.thyEntityNameTranslateKey())
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
else if (this.thyTranslate.instant(this.thyEmptyConfig.noResultTranslateKey) !== 'common.tips.NO_RESULT') {
|
|
355
|
+
return this.thyTranslate.instant(this.thyEmptyConfig.noResultTranslateKey);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
return this.locale().noDataText;
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
effect(() => {
|
|
281
362
|
this.updateClass();
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
get displayText() {
|
|
285
|
-
if (this.thyMessage) {
|
|
286
|
-
return this.thyMessage;
|
|
287
|
-
}
|
|
288
|
-
else if (this.thyTranslationKey) {
|
|
289
|
-
return this.thyTranslate.instant(this.thyTranslationKey, this.thyTranslationValues);
|
|
290
|
-
}
|
|
291
|
-
else if (this.thyEntityName) {
|
|
292
|
-
return this.thyTranslate.instant(this.thyEmptyConfig.noResultWithTargetTranslateKey, {
|
|
293
|
-
target: this.thyEntityName
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
else if (this.thyEntityNameTranslateKey) {
|
|
297
|
-
return this.thyTranslate.instant(this.thyEmptyConfig.noResultWithTargetTranslateKey, {
|
|
298
|
-
target: this.thyTranslate.instant(this.thyEntityNameTranslateKey)
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
else if (this.thyTranslate.instant(this.thyEmptyConfig.noResultTranslateKey) !== 'common.tips.NO_RESULT') {
|
|
302
|
-
return this.thyTranslate.instant(this.thyEmptyConfig.noResultTranslateKey);
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
return this.locale().noDataText;
|
|
306
|
-
}
|
|
363
|
+
});
|
|
307
364
|
}
|
|
308
365
|
_calculatePosition() {
|
|
309
|
-
const sizeOptions = sizeMap[this.thySize || 'md'];
|
|
366
|
+
const sizeOptions = sizeMap[this.thySize() || 'md'];
|
|
310
367
|
let marginTop = null;
|
|
311
|
-
if (this.thyTopAuto) {
|
|
368
|
+
if (this.thyTopAuto()) {
|
|
312
369
|
// 选择参考父容器居中
|
|
313
|
-
const
|
|
370
|
+
const thyContainer = this.thyContainer();
|
|
371
|
+
const containerElement = thyContainer ? thyContainer.nativeElement : this.elementRef.nativeElement.parentElement;
|
|
314
372
|
// containerElement.height;
|
|
315
373
|
let emptyStateHeight = this.elementRef.nativeElement.offsetHeight;
|
|
316
374
|
// 高度没有自动计算出来使用默认值
|
|
@@ -324,8 +382,9 @@ class ThyEmpty {
|
|
|
324
382
|
}
|
|
325
383
|
}
|
|
326
384
|
else {
|
|
327
|
-
|
|
328
|
-
|
|
385
|
+
const thyMarginTop = this.thyMarginTop();
|
|
386
|
+
if (thyMarginTop) {
|
|
387
|
+
marginTop = thyMarginTop;
|
|
329
388
|
}
|
|
330
389
|
else {
|
|
331
390
|
marginTop = 0; // sizeOptions.defaultMarginTop;
|
|
@@ -335,13 +394,8 @@ class ThyEmpty {
|
|
|
335
394
|
this.hostRenderer.setStyle('marginTop', marginTop + 'px');
|
|
336
395
|
}
|
|
337
396
|
}
|
|
338
|
-
ngOnInit() {
|
|
339
|
-
this.updateClass();
|
|
340
|
-
this._initialized = true;
|
|
341
|
-
this.setPresetSvg(this.thyIconName);
|
|
342
|
-
}
|
|
343
397
|
updateClass() {
|
|
344
|
-
const classList = sizeClassMap[this.
|
|
398
|
+
const classList = sizeClassMap[this.thySize() || 'md'];
|
|
345
399
|
if (classList) {
|
|
346
400
|
this.hostRenderer.updateClass(classList);
|
|
347
401
|
}
|
|
@@ -353,55 +407,13 @@ class ThyEmpty {
|
|
|
353
407
|
}, 50);
|
|
354
408
|
});
|
|
355
409
|
}
|
|
356
|
-
ngOnChanges(changes) {
|
|
357
|
-
if (changes.thyIconName && changes.thyIconName.currentValue && !changes.thyIconName.firstChange) {
|
|
358
|
-
this.setPresetSvg(changes.thyIconName.currentValue);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
setPresetSvg(icon) {
|
|
362
|
-
this.presetSvg = '';
|
|
363
|
-
let presetSvg = icon ? PRESET_SVG[icon] : PRESET_SVG.default;
|
|
364
|
-
this.presetSvg = presetSvg ? this.sanitizer.bypassSecurityTrustHtml(presetSvg) : '';
|
|
365
|
-
}
|
|
366
410
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyEmpty, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
367
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyEmpty, isStandalone: true, selector: "thy-empty", inputs: { thyMessage: "thyMessage", thyTranslationKey: "thyTranslationKey", thyTranslationValues: "thyTranslationValues", thyEntityName: "thyEntityName", thyEntityNameTranslateKey: "thyEntityNameTranslateKey", thyIconName: "thyIconName", thySize: "thySize", thyMarginTop: "thyMarginTop", thyTopAuto:
|
|
411
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyEmpty, isStandalone: true, selector: "thy-empty", inputs: { thyMessage: { classPropertyName: "thyMessage", publicName: "thyMessage", isSignal: true, isRequired: false, transformFunction: null }, thyTranslationKey: { classPropertyName: "thyTranslationKey", publicName: "thyTranslationKey", isSignal: true, isRequired: false, transformFunction: null }, thyTranslationValues: { classPropertyName: "thyTranslationValues", publicName: "thyTranslationValues", isSignal: true, isRequired: false, transformFunction: null }, thyEntityName: { classPropertyName: "thyEntityName", publicName: "thyEntityName", isSignal: true, isRequired: false, transformFunction: null }, thyEntityNameTranslateKey: { classPropertyName: "thyEntityNameTranslateKey", publicName: "thyEntityNameTranslateKey", isSignal: true, isRequired: false, transformFunction: null }, thyIconName: { classPropertyName: "thyIconName", publicName: "thyIconName", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyMarginTop: { classPropertyName: "thyMarginTop", publicName: "thyMarginTop", isSignal: true, isRequired: false, transformFunction: null }, thyTopAuto: { classPropertyName: "thyTopAuto", publicName: "thyTopAuto", isSignal: true, isRequired: false, transformFunction: null }, thyContainer: { classPropertyName: "thyContainer", publicName: "thyContainer", isSignal: true, isRequired: false, transformFunction: null }, thyImageUrl: { classPropertyName: "thyImageUrl", publicName: "thyImageUrl", isSignal: true, isRequired: false, transformFunction: null }, thyImageLoading: { classPropertyName: "thyImageLoading", publicName: "thyImageLoading", isSignal: true, isRequired: false, transformFunction: null }, thyImageFetchPriority: { classPropertyName: "thyImageFetchPriority", publicName: "thyImageFetchPriority", isSignal: true, isRequired: false, transformFunction: null }, thyDescription: { classPropertyName: "thyDescription", publicName: "thyDescription", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "extraTemplateRef", first: true, predicate: ["extra"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"thy-empty-icon\">\n @if (thyImageUrl()) {\n <img\n [src]=\"thyImageUrl()\"\n [attr.loading]=\"thyImageLoading()\"\n [attr.fetchpriority]=\"thyImageFetchPriority()\"\n class=\"empty-img\"\n />\n } @else {\n @if (presetSvg()) {\n <div [innerHTML]=\"presetSvg()\"></div>\n } @else {\n @if (thyIconName()) {\n <thy-icon class=\"empty-icon\" [thyIconName]=\"thyIconName()\"></thy-icon>\n }\n }\n }\n</div>\n\n<div [ngClass]=\"{ 'thy-empty-text': !thyDescription(), 'thy-empty-text-with-extra': thyDescription() }\">\n {{ displayText() }}\n</div>\n\n@if (thyDescription()) {\n <div class=\"thy-empty-description\">\n {{ thyDescription() }}\n </div>\n}\n\n@if (extraTemplateRef()) {\n <div class=\"thy-empty-extra\">\n <ng-template [ngTemplateOutlet]=\"extraTemplateRef()\"></ng-template>\n </div>\n}\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
368
412
|
}
|
|
369
413
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyEmpty, decorators: [{
|
|
370
414
|
type: Component,
|
|
371
|
-
args: [{ selector: 'thy-empty', imports: [ThyIcon, NgClass, NgTemplateOutlet], template: "<div class=\"thy-empty-icon\">\n @if (thyImageUrl) {\n <img\n [src]=\"thyImageUrl\"\n [attr.loading]=\"thyImageLoading\"\n [attr.fetchpriority]=\"thyImageFetchPriority\"\n class=\"empty-img\"\n />\n } @else {\n @if (presetSvg) {\n <div [innerHTML]=\"presetSvg\"></div>\n } @else {\n @if (thyIconName) {\n <thy-icon class=\"empty-icon\" [thyIconName]=\"thyIconName\"></thy-icon>\n }\n }\n }\n</div>\n\n<div [ngClass]=\"{ 'thy-empty-text': !thyDescription, 'thy-empty-text-with-extra': thyDescription }\">\n {{ displayText }}\n</div>\n\n@if (thyDescription) {\n <div class=\"thy-empty-description\">\n {{ thyDescription }}\n </div>\n}\n\n@if (extraTemplateRef) {\n <div class=\"thy-empty-extra\">\n <ng-template [ngTemplateOutlet]=\"extraTemplateRef\"></ng-template>\n </div>\n}\n" }]
|
|
372
|
-
}],
|
|
373
|
-
type: Input
|
|
374
|
-
}], thyTranslationKey: [{
|
|
375
|
-
type: Input
|
|
376
|
-
}], thyTranslationValues: [{
|
|
377
|
-
type: Input
|
|
378
|
-
}], thyEntityName: [{
|
|
379
|
-
type: Input
|
|
380
|
-
}], thyEntityNameTranslateKey: [{
|
|
381
|
-
type: Input
|
|
382
|
-
}], thyIconName: [{
|
|
383
|
-
type: Input
|
|
384
|
-
}], thySize: [{
|
|
385
|
-
type: Input
|
|
386
|
-
}], thyMarginTop: [{
|
|
387
|
-
type: Input
|
|
388
|
-
}], thyTopAuto: [{
|
|
389
|
-
type: Input,
|
|
390
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
391
|
-
}], thyContainer: [{
|
|
392
|
-
type: Input
|
|
393
|
-
}], thyImageUrl: [{
|
|
394
|
-
type: Input
|
|
395
|
-
}], thyImageLoading: [{
|
|
396
|
-
type: Input
|
|
397
|
-
}], thyImageFetchPriority: [{
|
|
398
|
-
type: Input
|
|
399
|
-
}], thyDescription: [{
|
|
400
|
-
type: Input
|
|
401
|
-
}], extraTemplateRef: [{
|
|
402
|
-
type: ContentChild,
|
|
403
|
-
args: ['extra']
|
|
404
|
-
}] } });
|
|
415
|
+
args: [{ selector: 'thy-empty', imports: [ThyIcon, NgClass, NgTemplateOutlet], template: "<div class=\"thy-empty-icon\">\n @if (thyImageUrl()) {\n <img\n [src]=\"thyImageUrl()\"\n [attr.loading]=\"thyImageLoading()\"\n [attr.fetchpriority]=\"thyImageFetchPriority()\"\n class=\"empty-img\"\n />\n } @else {\n @if (presetSvg()) {\n <div [innerHTML]=\"presetSvg()\"></div>\n } @else {\n @if (thyIconName()) {\n <thy-icon class=\"empty-icon\" [thyIconName]=\"thyIconName()\"></thy-icon>\n }\n }\n }\n</div>\n\n<div [ngClass]=\"{ 'thy-empty-text': !thyDescription(), 'thy-empty-text-with-extra': thyDescription() }\">\n {{ displayText() }}\n</div>\n\n@if (thyDescription()) {\n <div class=\"thy-empty-description\">\n {{ thyDescription() }}\n </div>\n}\n\n@if (extraTemplateRef()) {\n <div class=\"thy-empty-extra\">\n <ng-template [ngTemplateOutlet]=\"extraTemplateRef()\"></ng-template>\n </div>\n}\n" }]
|
|
416
|
+
}], ctorParameters: () => [] });
|
|
405
417
|
|
|
406
418
|
class ThyEmptyModule {
|
|
407
419
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyEmptyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|