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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-switch.mjs","sources":["../../../src/switch/switch.component.ts","../../../src/switch/switch.component.html","../../../src/switch/switch.module.ts","../../../src/switch/ngx-tethys-switch.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n OnInit,\n Output,\n ViewChild,\n inject\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TabIndexDisabledControlValueAccessorMixin } from 'ngx-tethys/core';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\n/**\n * 开关组件\n * @name thy-switch\n * @order 10\n */\n@Component({\n selector: 'thy-switch',\n templateUrl: './switch.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ThySwitch),\n multi: true\n }\n ],\n imports: [NgClass],\n host: {\n class: 'thy-switch',\n '[class.thy-switch-xs]': 'size === \"xs\"',\n '[class.thy-switch-sm]': 'size === \"sm\"'\n }\n})\nexport class ThySwitch extends TabIndexDisabledControlValueAccessorMixin implements OnInit, ControlValueAccessor {\n cdr = inject(ChangeDetectorRef);\n\n public model: boolean;\n\n public type?: string = 'primary';\n\n public size?: string = '';\n\n public disabled?: boolean = false;\n\n public loading: boolean = false;\n\n public classNames: string[];\n\n public typeArray: string[] = ['primary', 'info', 'warning', 'danger'];\n\n public sizeArray: string[] = ['', 'sm', 'xs'];\n\n public loadingCircle: {\n viewBox?: string;\n cx?: number;\n cy?: number;\n r?: number;\n dasharray?: string;\n } = {};\n\n private initialized = false;\n\n private loadingInitialized = false;\n\n private isDisabledFirstChange = true;\n\n @ViewChild('switch', { static: true }) switchElementRef: ElementRef;\n\n /**\n * 类型,目前分为: 'primary' |'info' | 'warning' | 'danger'\n */\n @Input()\n set thyType(value: string) {\n if (!this.typeArray.includes(value)) {\n value = 'primary';\n }\n this.type = value;\n if (this.initialized) {\n this.setClassNames();\n }\n }\n\n /**\n * 大小\n * @type xs | sm | md\n * @default md\n */\n @Input()\n set thySize(value: string) {\n if (!this.sizeArray.includes(value)) {\n value = '';\n }\n this.size = value;\n if (this.initialized) {\n this.setClassNames();\n }\n\n if (this.loadingInitialized) {\n this.setLoadingCircle();\n }\n }\n\n /**\n * 是否属于禁用状态\n */\n @Input({ transform: coerceBooleanProperty })\n override set thyDisabled(value: boolean) {\n this.disabled = value;\n this.setClassNames();\n }\n override get thyDisabled(): boolean {\n return this.disabled;\n }\n\n /**\n * 是否加载中\n */\n @Input({ transform: coerceBooleanProperty }) set thyLoading(value: boolean) {\n this.loading = value;\n if (this.initialized) {\n this.setClassNames();\n }\n\n if (this.loading && !this.loadingInitialized) {\n this.setLoadingCircle();\n this.loadingInitialized = true;\n }\n }\n\n /**\n * 数据变化的回调事件,即将被弃用,请使用 ngModelChange\n * @deprecated\n */\n @Output() thyChange: EventEmitter<Event> = new EventEmitter<Event>();\n\n constructor() {\n super();\n }\n\n ngOnInit() {\n this.setClassNames();\n this.initialized = true;\n }\n\n public onModelChange: Function = () => {};\n\n public onModelTouched: Function = () => {};\n\n writeValue(value: boolean) {\n this.model = value;\n this.cdr.markForCheck();\n // this.setClassNames();\n }\n\n registerOnChange(fn: Function): void {\n this.onModelChange = fn;\n }\n\n registerOnTouched(fn: Function): void {\n this.onModelTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = (this.isDisabledFirstChange && this.thyDisabled) || isDisabled;\n this.isDisabledFirstChange = false;\n this.setClassNames();\n }\n\n toggle(event: Event) {\n this.model = !this.model;\n this.onModelChange(this.model);\n this.onModelTouched();\n this.thyChange.emit(event);\n }\n\n setClassNames() {\n this.classNames = [`thy-switch-${this.type}`];\n if (this.size) {\n this.classNames.push(`thy-switch-${this.size}`);\n }\n if (this.disabled || this.loading) {\n this.classNames.push(`thy-switch-disabled`);\n if (this.model) {\n this.classNames.push(`thy-switch-disabled-true`);\n }\n }\n this.cdr.markForCheck();\n }\n\n setLoadingCircle() {\n const svgSize = {\n ['xs']: 12,\n ['sm']: 16,\n ['']: 20\n };\n\n const circleSize = svgSize[this.size];\n const centerPoint = circleSize / 2;\n const r = circleSize / 4;\n\n this.loadingCircle = {\n viewBox: `0 0 ${circleSize} ${circleSize}`,\n cx: centerPoint,\n cy: centerPoint,\n r: r,\n dasharray: `${2 * Math.PI * r * 0.75} ${2 * Math.PI * r * 0.25}`\n };\n this.cdr.markForCheck();\n }\n}\n","<label #switch class=\"thy-switch\" [ngClass]=\"classNames\">\n <input\n type=\"checkbox\"\n [attr.tabindex]=\"-1\"\n [disabled]=\"disabled || loading\"\n class=\"thy-switch-input\"\n [checked]=\"model\"\n (change)=\"toggle($event)\" />\n <span class=\"thy-switch-label\" [attr.tabindex]=\"tabIndex\"></span>\n <span class=\"thy-switch-handle\">\n @if (loading) {\n <svg [attr.viewBox]=\"loadingCircle?.viewBox\" [class.mb-1]=\"size === 'xs'\">\n <circle\n class=\"thy-switch-loading\"\n [style.transform-origin]=\"loadingCircle?.cx + 'px ' + loadingCircle?.cy + 'px'\"\n [attr.cx]=\"loadingCircle?.cx\"\n [attr.cy]=\"loadingCircle?.cy\"\n [attr.r]=\"loadingCircle?.r\"\n [attr.stroke]=\"model ? 'rgba(102,152,255,1)' : 'rgba(202,202,202,1)'\"\n stroke-width=\"1\"\n [attr.stroke-dasharray]=\"loadingCircle?.dasharray\"\n fill=\"white\" />\n </svg>\n }\n </span>\n</label>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ThySwitch } from './switch.component';\n\n@NgModule({\n imports: [CommonModule, ThySwitch],\n exports: [ThySwitch]\n})\nexport class ThySwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAkBA;;;;AAIG;AAmBG,MAAO,SAAU,SAAQ,yCAAyC,CAAA;AAmCpE;;AAEG;IACH,IACI,OAAO,CAAC,KAAa,EAAA;QACrB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACjC,KAAK,GAAG,SAAS;;AAErB,QAAA,IAAI,CAAC,IAAI,GAAG,KAAK;AACjB,QAAA,IAAI,IAAI,CAAC,WAAW,EAAE;YAClB,IAAI,CAAC,aAAa,EAAE;;;AAI5B;;;;AAIG;IACH,IACI,OAAO,CAAC,KAAa,EAAA;QACrB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACjC,KAAK,GAAG,EAAE;;AAEd,QAAA,IAAI,CAAC,IAAI,GAAG,KAAK;AACjB,QAAA,IAAI,IAAI,CAAC,WAAW,EAAE;YAClB,IAAI,CAAC,aAAa,EAAE;;AAGxB,QAAA,IAAI,IAAI,CAAC,kBAAkB,EAAE;YACzB,IAAI,CAAC,gBAAgB,EAAE;;;AAI/B;;AAEG;IACH,IACa,WAAW,CAAC,KAAc,EAAA;AACnC,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;QACrB,IAAI,CAAC,aAAa,EAAE;;AAExB,IAAA,IAAa,WAAW,GAAA;QACpB,OAAO,IAAI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../../../src/switch/switch.module.ts","../../../src/switch/ngx-tethys-switch.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n forwardRef,\n inject,\n viewChild,\n input,\n computed,\n signal,\n output,\n effect\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TabIndexDisabledControlValueAccessorMixin } from 'ngx-tethys/core';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\nconst supportedTypes: string[] = ['primary', 'info', 'warning', 'danger'];\n\nconst supportedSizes: string[] = ['', 'sm', 'xs'];\n\n/**\n * 开关组件\n * @name thy-switch\n * @order 10\n */\n@Component({\n selector: 'thy-switch',\n templateUrl: './switch.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ThySwitch), multi: true }],\n imports: [NgClass],\n host: { class: 'thy-switch', '[class.thy-switch-xs]': 'size() === \"xs\"', '[class.thy-switch-sm]': 'size() === \"sm\"' }\n})\nexport class ThySwitch extends TabIndexDisabledControlValueAccessorMixin implements ControlValueAccessor {\n /**\n * 类型,目前分为: 'primary' |'info' | 'warning' | 'danger'\n */\n readonly thyType = input<string>('primary');\n\n /**\n * 大小\n * @type xs | sm | md\n * @default md\n */\n readonly thySize = input<string>('');\n\n /**\n * 是否属于禁用状态\n */\n readonly inputDisabled = input(false, { transform: coerceBooleanProperty, alias: `thyDisabled` });\n\n /**\n * 是否加载中\n */\n readonly thyLoading = input(false, { transform: coerceBooleanProperty });\n\n /**\n * 数据变化的回调事件,即将被弃用,请使用 ngModelChange\n * @deprecated\n */\n thyChange = output<Event>();\n\n model = signal<boolean>(false);\n\n disabled = signal(false);\n\n get thyDisabled() {\n return this.disabled() as boolean;\n }\n\n readonly type = computed(() => {\n if (!supportedTypes.includes(this.thyType())) {\n return 'primary';\n } else {\n return this.thyType();\n }\n });\n\n readonly size = computed(() => {\n if (!supportedSizes.includes(this.thySize())) {\n return '';\n } else {\n return this.thySize();\n }\n });\n\n readonly classNames = computed(() => {\n const classList = [`thy-switch-${this.type()}`];\n if (this.size()) {\n classList.push(`thy-switch-${this.size()}`);\n }\n if (this.disabled() || this.thyLoading()) {\n classList.push(`thy-switch-disabled`);\n if (this.model()) {\n classList.push(`thy-switch-disabled-true`);\n }\n }\n return classList;\n });\n\n readonly loadingCircle = computed(() => {\n const svgSize: Record<string, number> = { xs: 12, sm: 16 };\n const circleSize = svgSize[this.size()] ?? 20;\n const centerPoint = circleSize / 2;\n const r = circleSize / 4;\n return {\n viewBox: `0 0 ${circleSize} ${circleSize}`,\n cx: centerPoint,\n cy: centerPoint,\n r: r,\n dasharray: `${2 * Math.PI * r * 0.75} ${2 * Math.PI * r * 0.25}`\n };\n });\n\n onModelChange: Function = () => {};\n\n onModelTouched: Function = () => {};\n\n readonly switchElementRef = viewChild<string, ElementRef<HTMLElement>>('switch', { read: ElementRef<HTMLElement> });\n\n private cdr = inject(ChangeDetectorRef);\n\n constructor() {\n super();\n\n effect(() => {\n this.disabled.set(this.inputDisabled());\n });\n }\n\n writeValue(value: boolean) {\n this.model.set(value);\n this.cdr.markForCheck();\n }\n\n registerOnChange(fn: Function): void {\n this.onModelChange = fn;\n }\n\n registerOnTouched(fn: Function): void {\n this.onModelTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n\n toggle(event: Event) {\n this.model.set(!this.model());\n this.onModelChange(this.model());\n this.onModelTouched();\n this.thyChange?.emit(event);\n }\n}\n","<label #switch class=\"thy-switch\" [ngClass]=\"classNames()\">\n <input\n type=\"checkbox\"\n [attr.tabindex]=\"-1\"\n [disabled]=\"disabled() || thyLoading()\"\n class=\"thy-switch-input\"\n [checked]=\"model()\"\n (change)=\"toggle($event)\" />\n <span class=\"thy-switch-label\" [attr.tabindex]=\"tabIndex\"></span>\n <span class=\"thy-switch-handle\">\n @if (thyLoading()) {\n @let circleConfig = loadingCircle();\n <svg [attr.viewBox]=\"circleConfig?.viewBox\" [class.mb-1]=\"size() === 'xs'\">\n <circle\n class=\"thy-switch-loading\"\n [style.transform-origin]=\"circleConfig?.cx + 'px ' + circleConfig?.cy + 'px'\"\n [attr.cx]=\"circleConfig?.cx\"\n [attr.cy]=\"circleConfig?.cy\"\n [attr.r]=\"circleConfig?.r\"\n [attr.stroke]=\"model() ? 'rgba(102,152,255,1)' : 'rgba(202,202,202,1)'\"\n stroke-width=\"1\"\n [attr.stroke-dasharray]=\"circleConfig?.dasharray\"\n fill=\"white\" />\n </svg>\n }\n </span>\n</label>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ThySwitch } from './switch.component';\n\n@NgModule({\n imports: [CommonModule, ThySwitch],\n exports: [ThySwitch]\n})\nexport class ThySwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAmBA,MAAM,cAAc,GAAa,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;AAEzE,MAAM,cAAc,GAAa,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC;AAEjD;;;;AAIG;AASG,MAAO,SAAU,SAAQ,yCAAyC,CAAA;AAiCpE,IAAA,IAAI,WAAW,GAAA;AACX,QAAA,OAAO,IAAI,CAAC,QAAQ,EAAa;;AAuDrC,IAAA,WAAA,GAAA;AACI,QAAA,KAAK,EAAE;AAzFX;;AAEG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAS,SAAS,CAAC;AAE3C;;;;AAIG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAS,EAAE,CAAC;AAEpC;;AAEG;AACM,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,KAAK,EAAE,CAAa,WAAA,CAAA,EAAE,CAAC;A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AC,EAAA,OAAA,EACzF,CAAC,OAAO,CAAC,QACZ,EAAE,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,EAAA,QAAA,EAAA,miCAAA,EAAA;;;ME1B5G,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAf,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,eAAe,EAHd,OAAA,EAAA,CAAA,YAAY,EAAE,SAAS,aACvB,SAAS,CAAA,EAAA,CAAA,CAAA;AAEV,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,eAAe,YAHd,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGb,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;oBAClC,OAAO,EAAE,CAAC,SAAS;AACtB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -1200,7 +1200,7 @@ class ThyTable {
|
|
|
1200
1200
|
useExisting: ThyTable
|
|
1201
1201
|
},
|
|
1202
1202
|
UpdateHostClassService
|
|
1203
|
-
], queries: [{ propertyName: "emptyTemplate", first: true, predicate: ["empty"], descendants: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "listOfColumnComponents", predicate: ThyTableColumnComponent }], viewQueries: [{ propertyName: "tableElementRef", first: true, predicate: ["table"], descendants: true, static: true }, { propertyName: "rows", predicate: ["rows"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"thy-table-body\"\n cdkScrollable\n [ngClass]=\"{\n 'thy-table-fixed': hasFixed,\n 'thy-table-bordered-theme': theme === 'bordered' && hasFixed,\n 'thy-table-body-empty': loadingDone && model?.length === 0 && groups?.length === 0\n }\">\n <table\n #table\n class=\"table\"\n [ngClass]=\"[className]\"\n [class.table-fixed]=\"thyLayoutFixed\"\n [class.table-draggable]=\"draggable\"\n [class.table-group]=\"mode === 'group'\"\n [ngStyle]=\"{ 'min-width': thyMinWidth }\">\n <colgroup>\n @for (column of columns; track $index) {\n <col [width]=\"column.width\" [ngStyle]=\"{ minWidth: hasFixed ? column.width : column.minWidth }\" />\n }\n </colgroup>\n\n @if (!thyHeadless) {\n <thead>\n <tr>\n @for (column of columns; track $index) {\n <th\n [ngClass]=\"column.headerClassName\"\n [class.thy-table-column-sortable]=\"column.sortable\"\n [class.thy-table-fixed-column-left]=\"column.fixed === fixedDirection.left\"\n [class.thy-table-fixed-column-right]=\"column.fixed === fixedDirection.right\"\n [ngStyle]=\"{ left: column.left + 'px', right: column.right + 'px' }\"\n (click)=\"onColumnHeaderClick($event, column)\">\n @if (!column.headerTemplateRef) {\n <span>{{ column.title }}</span>\n }\n @if (column.headerTemplateRef) {\n <ng-template [ngTemplateOutlet]=\"column.headerTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: column }\"></ng-template>\n }\n @if (column.sortable) {\n <thy-icon [ngClass]=\"['thy-table-column-sortable-icon', 'px-1', column.sortDirection]\" thyIconName=\"sort-vertical-tt\">\n </thy-icon>\n }\n </th>\n }\n </tr>\n </thead>\n }\n\n @if (loadingDone) {\n <tbody\n thyDragDrop\n cdkDropList\n [cdkDropListDisabled]=\"!draggable\"\n [cdkDropListSortPredicate]=\"dropListEnterPredicate\"\n (cdkDropListDropped)=\"onDragDropped($event)\">\n <!-- group -->\n @if (mode === 'group') {\n @for (group of groups; track group.id) {\n <tr\n class=\"thy-table-group\"\n (click)=\"expandGroup(group)\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"group\"\n [cdkDragDisabled]=\"group | tableRowDragDisabled: thyDragDisabledPredicate\"\n (cdkDragStarted)=\"onDragGroupStarted($event)\"\n (cdkDragEnded)=\"onDragGroupEnd($event)\">\n <td [attr.colspan]=\"columns.length\">\n <div class=\"thy-table-group-container\">\n @if (draggable && !(group | tableRowDragDisabled: thyDragDisabledPredicate)) {\n <thy-icon class=\"table-draggable-icon\" thyIconName=\"drag\"></thy-icon>\n }\n <thy-icon class=\"expand-icon\" [thyIconName]=\"group.expand ? 'angle-down' : 'angle-right'\"></thy-icon>\n @if (groupTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.origin, group: group.origin }\"></ng-template>\n }\n </div>\n </td>\n </tr>\n @if (group.children?.length && group.expand) {\n @for (row of group.children; track $index; let i = $index) {\n <ng-template\n [ngTemplateOutlet]=\"trTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: 0\n }\"></ng-template>\n }\n }\n }\n }\n <!-- list\u6A21\u5F0F\u4E0B\u6CA1\u6709\u76F4\u63A5\u4F7F\u7528item\u6A21\u677F\uFF0C\u662F\u56E0\u4E3A\u4F7F\u7528\u4E86\u6A21\u677F\u5F71\u54CD\u4E86Angular\u7684\u4F9D\u8D56\u6811\uFF0C\u5BFC\u81F4CdkDragDrop\u6392\u5E8F\u5931\u6548\uFF0C\u76EE\u524D\u8FD9\u6837\u4FEE\u6539\u53EF\u4EE5\u6682\u65F6\u89E3\u51B3\u7EBF\u4E0A\u4E0D\u80FD\u6392\u5E8F\u7684\u95EE\u9898\uFF0CTree\u6A21\u5F0F\u7684\u6392\u5E8F\u6682\u65F6\u4E0D\u652F\u6301 -->\n @if (mode === 'list') {\n @for (row of model; track $index; let i = $index) {\n <tr\n #rows\n class=\"thy-sortable-item\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"row | tableRowDragDisabled: thyDragDisabledPredicate\"\n (cdkDragStarted)=\"onDragStarted($event)\"\n [ngClass]=\"renderRowClassName(row, i)\"\n (click)=\"onRowClick($event, row)\"\n (thyContextMenu)=\"onRowContextMenu($event, row)\">\n <ng-template\n [ngTemplateOutlet]=\"tdsTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: 0\n }\"></ng-template>\n </tr>\n }\n }\n @if (mode === 'tree') {\n @for (row of model; track trackByFn(i, row); let i = $index) {\n <ng-template [ngTemplateOutlet]=\"trTemplate\" [ngTemplateOutletContext]=\"{ row: row, index: i, level: 0 }\"></ng-template>\n }\n }\n <ng-template #trTemplate let-row=\"row\" let-i=\"index\" let-level=\"level\">\n <tr\n #rows\n class=\"thy-sortable-item\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"row\"\n (cdkDragStarted)=\"onDragStarted($event)\"\n [cdkDragDisabled]=\"row | tableRowDragDisabled: thyDragDisabledPredicate\"\n [ngClass]=\"renderRowClassName(row, i)\"\n (click)=\"onRowClick($event, row)\"\n (thyContextMenu)=\"onRowContextMenu($event, row)\">\n <ng-template\n [ngTemplateOutlet]=\"tdsTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: level + 1\n }\"></ng-template>\n </tr>\n @if (mode === 'tree' && isExpanded(row)) {\n @for (child of row[thyChildrenKey]; track trackByFn(j, child); let j = $index) {\n <ng-template\n [ngTemplateOutlet]=\"trTemplate\"\n [ngTemplateOutletContext]=\"{ row: child, index: j, level: level + 1 }\"></ng-template>\n }\n }\n </ng-template>\n <ng-template #tdsTemplate let-row=\"row\" let-i=\"index\" let-level=\"level\">\n @for (column of columns; track $index; let j = $index) {\n <td\n [ngClass]=\"column.className\"\n [class.thy-operation-links]=\"!!column.operational\"\n [class.thy-table-column-secondary]=\"!!column.secondary\"\n [class.thy-table-checkbox-column]=\"column.type === customType.checkbox\"\n [class.thy-table-fixed-column-left]=\"column.fixed === fixedDirection.left\"\n [class.thy-table-fixed-column-right]=\"column.fixed === fixedDirection.right\"\n [ngStyle]=\"\n mode === 'tree' && column.expand\n ? tdIndentComputed(level, column)\n : { left: column.left + 'px', right: column.right + 'px' }\n \">\n @if (j === 0 && draggable && !(row | tableRowDragDisabled: thyDragDisabledPredicate)) {\n <thy-icon class=\"table-draggable-icon\" thyIconName=\"drag\"></thy-icon>\n }\n <!--template-->\n @if (isTemplateRef(column.cellTemplateRef)) {\n @if (mode === 'tree' && column.expand) {\n <thy-icon\n class=\"tree-expand-icon cursor-pointer\"\n [thyIconName]=\"isExpanded(row) ? 'angle-down' : 'angle-right'\"\n [style.visibility]=\"showExpand(row) ? 'visible' : 'hidden'\"\n [style.left.px]=\"iconIndentComputed(level)\"></thy-icon>\n }\n <ng-template [ngTemplateOutlet]=\"column.cellTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: row }\"></ng-template>\n }\n <!--not template-->\n @if (!isTemplateRef(column.cellTemplateRef)) {\n <!-- default -->\n @if (column.model && !column.type) {\n @if (mode === 'tree' && column.expand) {\n <thy-icon\n class=\"tree-expand-icon cursor-pointer\"\n [thyIconName]=\"isExpanded(row) ? 'angle-down' : 'angle-right'\"\n [style.visibility]=\"showExpand(row) ? 'visible' : 'hidden'\"\n [style.marginLeft.px]=\"iconIndentComputed(level)\"></thy-icon>\n }\n @if (getModelValue(row, column.model) | isValidModelValue) {\n {{ getModelValue(row, column.model) }}\n } @else {\n @if (column.defaultText) {\n <div class=\"text-desc\">\n {{ column.defaultText }}\n </div>\n }\n }\n <ng-template #default>\n @if (column.defaultText) {\n <div class=\"text-desc\">\n {{ column.defaultText }}\n </div>\n }\n </ng-template>\n }\n <!-- index -->\n @if (column.type === customType.index) {\n {{ i + 1 }}\n }\n <!-- checkbox -->\n @if (column.type === customType.checkbox) {\n <input\n type=\"checkbox\"\n [(ngModel)]=\"row[column.key]\"\n (ngModelChange)=\"onCheckboxChange(row, column)\"\n (click)=\"onStopPropagation($event)\"\n [disabled]=\"column.disabled\" />\n }\n <!-- radio -->\n @if (column.type === customType.radio) {\n <input\n type=\"radio\"\n [(ngModel)]=\"selectedRadioRow\"\n [value]=\"row\"\n [disabled]=\"column.disabled\"\n (click)=\"onStopPropagation($event)\"\n (change)=\"onRadioSelectChange($event, row)\" />\n }\n <!-- switch -->\n @if (column.type === customType.switch) {\n <thy-switch\n [(ngModel)]=\"row[column.key]\"\n (ngModelChange)=\"onModelChange(row, column)\"\n [disabled]=\"column.disabled\"\n (thyChange)=\"onSwitchChange($event, row, column)\"></thy-switch>\n }\n }\n </td>\n }\n </ng-template>\n </tbody>\n }\n </table>\n\n @if (loadingDone && model.length === 0 && groups.length === 0) {\n <div class=\"thy-table-empty clear-hover\">\n @if (emptyTemplate) {\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n } @else {\n <thy-empty\n [thyMessage]=\"emptyOptions.message\"\n [thyTranslationKey]=\"emptyOptions.translationKey\"\n [thyTranslationValues]=\"emptyOptions.translationValues\"\n [thyEntityName]=\"emptyOptions.entityName\"\n [thyEntityNameTranslateKey]=\"emptyOptions.entityNameTranslateKey\"\n [thyIconName]=\"emptyOptions.iconName\"\n [thySize]=\"emptyOptions.size\"\n [thyMarginTop]=\"emptyOptions.marginTop\"\n [thyTopAuto]=\"emptyOptions.topAuto\"\n [thyContainer]=\"emptyOptions.container\"></thy-empty>\n }\n </div>\n }\n\n @if (!loadingDone) {\n <thy-table-skeleton\n [thyRowCount]=\"6\"\n [thyHeadless]=\"true\"\n [thyTheme]=\"theme\"\n [thySize]=\"size\"\n [thyMinWidth]=\"thyMinWidth\"\n [thyColumns]=\"skeletonColumns\">\n </thy-table-skeleton>\n }\n\n @if (pagination.total > pagination.size) {\n <div class=\"thy-table-footer\" [class.thy-table-footer-has-padding]=\"theme === 'default'\">\n <thy-pagination\n [thyPageIndex]=\"pagination.index\"\n [thyTotal]=\"pagination.total\"\n [thyPageSize]=\"pagination.size\"\n [thyPageSizeOptions]=\"pagination.sizeOptions\"\n [thyShowSizeChanger]=\"showSizeChanger\"\n [thyShowTotal]=\"showTotal\"\n (thyPageChanged)=\"onPageChange($event)\"\n (thyPageIndexChange)=\"onPageIndexChange($event)\"\n (thyPageSizeChanged)=\"onPageSizeChange($event)\"></thy-pagination>\n </div>\n }\n</div>\n\n<ng-template>\n <ng-content></ng-content>\n</ng-template>\n", dependencies: [{ kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: ThyDragDropDirective, selector: "[thyDragDrop]" }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: ThyContextMenuDirective, selector: "[thyContextMenu]", outputs: ["thyContextMenu"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThySwitch, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled", "thyLoading"], outputs: ["thyChange"] }, { kind: "component", type: ThyEmpty, selector: "thy-empty", inputs: ["thyMessage", "thyTranslationKey", "thyTranslationValues", "thyEntityName", "thyEntityNameTranslateKey", "thyIconName", "thySize", "thyMarginTop", "thyTopAuto", "thyContainer", "thyImageUrl", "thyImageLoading", "thyImageFetchPriority", "thyDescription"] }, { kind: "component", type: ThyTableSkeleton, selector: "thy-table-skeleton", inputs: ["thyBorderRadius", "thyRowHeight", "thyAnimated", "thyAnimatedInterval", "thyPrimaryColor", "thySecondaryColor", "thyRowCount", "thyHeadless", "thyTheme", "thySize", "thyMinWidth", "thyColumns"] }, { kind: "component", type: ThyPagination, selector: "thy-pagination", inputs: ["thyPageIndex", "thyPageSize", "thyTotal", "thyCustomPages", "thyDisabled", "thyShowQuickJumper", "thyShowTotalPageCount", "thySize", "thyMaxCount", "thyMarginalCount", "thyRangeCount", "thyShowSizeChanger", "thyPageSizeOptions", "thyHideOnSinglePage", "thyUnit", "thyShowTotal"], outputs: ["thyPageIndexChange", "thyPageChanged", "thyPageSizeChanged"] }, { kind: "pipe", type: TableIsValidModelValuePipe, name: "isValidModelValue" }, { kind: "pipe", type: TableRowDragDisabledPipe, name: "tableRowDragDisabled" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1203
|
+
], queries: [{ propertyName: "emptyTemplate", first: true, predicate: ["empty"], descendants: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "listOfColumnComponents", predicate: ThyTableColumnComponent }], viewQueries: [{ propertyName: "tableElementRef", first: true, predicate: ["table"], descendants: true, static: true }, { propertyName: "rows", predicate: ["rows"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"thy-table-body\"\n cdkScrollable\n [ngClass]=\"{\n 'thy-table-fixed': hasFixed,\n 'thy-table-bordered-theme': theme === 'bordered' && hasFixed,\n 'thy-table-body-empty': loadingDone && model?.length === 0 && groups?.length === 0\n }\">\n <table\n #table\n class=\"table\"\n [ngClass]=\"[className]\"\n [class.table-fixed]=\"thyLayoutFixed\"\n [class.table-draggable]=\"draggable\"\n [class.table-group]=\"mode === 'group'\"\n [ngStyle]=\"{ 'min-width': thyMinWidth }\">\n <colgroup>\n @for (column of columns; track $index) {\n <col [width]=\"column.width\" [ngStyle]=\"{ minWidth: hasFixed ? column.width : column.minWidth }\" />\n }\n </colgroup>\n\n @if (!thyHeadless) {\n <thead>\n <tr>\n @for (column of columns; track $index) {\n <th\n [ngClass]=\"column.headerClassName\"\n [class.thy-table-column-sortable]=\"column.sortable\"\n [class.thy-table-fixed-column-left]=\"column.fixed === fixedDirection.left\"\n [class.thy-table-fixed-column-right]=\"column.fixed === fixedDirection.right\"\n [ngStyle]=\"{ left: column.left + 'px', right: column.right + 'px' }\"\n (click)=\"onColumnHeaderClick($event, column)\">\n @if (!column.headerTemplateRef) {\n <span>{{ column.title }}</span>\n }\n @if (column.headerTemplateRef) {\n <ng-template [ngTemplateOutlet]=\"column.headerTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: column }\"></ng-template>\n }\n @if (column.sortable) {\n <thy-icon [ngClass]=\"['thy-table-column-sortable-icon', 'px-1', column.sortDirection]\" thyIconName=\"sort-vertical-tt\">\n </thy-icon>\n }\n </th>\n }\n </tr>\n </thead>\n }\n\n @if (loadingDone) {\n <tbody\n thyDragDrop\n cdkDropList\n [cdkDropListDisabled]=\"!draggable\"\n [cdkDropListSortPredicate]=\"dropListEnterPredicate\"\n (cdkDropListDropped)=\"onDragDropped($event)\">\n <!-- group -->\n @if (mode === 'group') {\n @for (group of groups; track group.id) {\n <tr\n class=\"thy-table-group\"\n (click)=\"expandGroup(group)\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"group\"\n [cdkDragDisabled]=\"group | tableRowDragDisabled: thyDragDisabledPredicate\"\n (cdkDragStarted)=\"onDragGroupStarted($event)\"\n (cdkDragEnded)=\"onDragGroupEnd($event)\">\n <td [attr.colspan]=\"columns.length\">\n <div class=\"thy-table-group-container\">\n @if (draggable && !(group | tableRowDragDisabled: thyDragDisabledPredicate)) {\n <thy-icon class=\"table-draggable-icon\" thyIconName=\"drag\"></thy-icon>\n }\n <thy-icon class=\"expand-icon\" [thyIconName]=\"group.expand ? 'angle-down' : 'angle-right'\"></thy-icon>\n @if (groupTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.origin, group: group.origin }\"></ng-template>\n }\n </div>\n </td>\n </tr>\n @if (group.children?.length && group.expand) {\n @for (row of group.children; track $index; let i = $index) {\n <ng-template\n [ngTemplateOutlet]=\"trTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: 0\n }\"></ng-template>\n }\n }\n }\n }\n <!-- list\u6A21\u5F0F\u4E0B\u6CA1\u6709\u76F4\u63A5\u4F7F\u7528item\u6A21\u677F\uFF0C\u662F\u56E0\u4E3A\u4F7F\u7528\u4E86\u6A21\u677F\u5F71\u54CD\u4E86Angular\u7684\u4F9D\u8D56\u6811\uFF0C\u5BFC\u81F4CdkDragDrop\u6392\u5E8F\u5931\u6548\uFF0C\u76EE\u524D\u8FD9\u6837\u4FEE\u6539\u53EF\u4EE5\u6682\u65F6\u89E3\u51B3\u7EBF\u4E0A\u4E0D\u80FD\u6392\u5E8F\u7684\u95EE\u9898\uFF0CTree\u6A21\u5F0F\u7684\u6392\u5E8F\u6682\u65F6\u4E0D\u652F\u6301 -->\n @if (mode === 'list') {\n @for (row of model; track $index; let i = $index) {\n <tr\n #rows\n class=\"thy-sortable-item\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"row | tableRowDragDisabled: thyDragDisabledPredicate\"\n (cdkDragStarted)=\"onDragStarted($event)\"\n [ngClass]=\"renderRowClassName(row, i)\"\n (click)=\"onRowClick($event, row)\"\n (thyContextMenu)=\"onRowContextMenu($event, row)\">\n <ng-template\n [ngTemplateOutlet]=\"tdsTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: 0\n }\"></ng-template>\n </tr>\n }\n }\n @if (mode === 'tree') {\n @for (row of model; track trackByFn(i, row); let i = $index) {\n <ng-template [ngTemplateOutlet]=\"trTemplate\" [ngTemplateOutletContext]=\"{ row: row, index: i, level: 0 }\"></ng-template>\n }\n }\n <ng-template #trTemplate let-row=\"row\" let-i=\"index\" let-level=\"level\">\n <tr\n #rows\n class=\"thy-sortable-item\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"row\"\n (cdkDragStarted)=\"onDragStarted($event)\"\n [cdkDragDisabled]=\"row | tableRowDragDisabled: thyDragDisabledPredicate\"\n [ngClass]=\"renderRowClassName(row, i)\"\n (click)=\"onRowClick($event, row)\"\n (thyContextMenu)=\"onRowContextMenu($event, row)\">\n <ng-template\n [ngTemplateOutlet]=\"tdsTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: level + 1\n }\"></ng-template>\n </tr>\n @if (mode === 'tree' && isExpanded(row)) {\n @for (child of row[thyChildrenKey]; track trackByFn(j, child); let j = $index) {\n <ng-template\n [ngTemplateOutlet]=\"trTemplate\"\n [ngTemplateOutletContext]=\"{ row: child, index: j, level: level + 1 }\"></ng-template>\n }\n }\n </ng-template>\n <ng-template #tdsTemplate let-row=\"row\" let-i=\"index\" let-level=\"level\">\n @for (column of columns; track $index; let j = $index) {\n <td\n [ngClass]=\"column.className\"\n [class.thy-operation-links]=\"!!column.operational\"\n [class.thy-table-column-secondary]=\"!!column.secondary\"\n [class.thy-table-checkbox-column]=\"column.type === customType.checkbox\"\n [class.thy-table-fixed-column-left]=\"column.fixed === fixedDirection.left\"\n [class.thy-table-fixed-column-right]=\"column.fixed === fixedDirection.right\"\n [ngStyle]=\"\n mode === 'tree' && column.expand\n ? tdIndentComputed(level, column)\n : { left: column.left + 'px', right: column.right + 'px' }\n \">\n @if (j === 0 && draggable && !(row | tableRowDragDisabled: thyDragDisabledPredicate)) {\n <thy-icon class=\"table-draggable-icon\" thyIconName=\"drag\"></thy-icon>\n }\n <!--template-->\n @if (isTemplateRef(column.cellTemplateRef)) {\n @if (mode === 'tree' && column.expand) {\n <thy-icon\n class=\"tree-expand-icon cursor-pointer\"\n [thyIconName]=\"isExpanded(row) ? 'angle-down' : 'angle-right'\"\n [style.visibility]=\"showExpand(row) ? 'visible' : 'hidden'\"\n [style.left.px]=\"iconIndentComputed(level)\"></thy-icon>\n }\n <ng-template [ngTemplateOutlet]=\"column.cellTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: row }\"></ng-template>\n }\n <!--not template-->\n @if (!isTemplateRef(column.cellTemplateRef)) {\n <!-- default -->\n @if (column.model && !column.type) {\n @if (mode === 'tree' && column.expand) {\n <thy-icon\n class=\"tree-expand-icon cursor-pointer\"\n [thyIconName]=\"isExpanded(row) ? 'angle-down' : 'angle-right'\"\n [style.visibility]=\"showExpand(row) ? 'visible' : 'hidden'\"\n [style.marginLeft.px]=\"iconIndentComputed(level)\"></thy-icon>\n }\n @if (getModelValue(row, column.model) | isValidModelValue) {\n {{ getModelValue(row, column.model) }}\n } @else {\n @if (column.defaultText) {\n <div class=\"text-desc\">\n {{ column.defaultText }}\n </div>\n }\n }\n <ng-template #default>\n @if (column.defaultText) {\n <div class=\"text-desc\">\n {{ column.defaultText }}\n </div>\n }\n </ng-template>\n }\n <!-- index -->\n @if (column.type === customType.index) {\n {{ i + 1 }}\n }\n <!-- checkbox -->\n @if (column.type === customType.checkbox) {\n <input\n type=\"checkbox\"\n [(ngModel)]=\"row[column.key]\"\n (ngModelChange)=\"onCheckboxChange(row, column)\"\n (click)=\"onStopPropagation($event)\"\n [disabled]=\"column.disabled\" />\n }\n <!-- radio -->\n @if (column.type === customType.radio) {\n <input\n type=\"radio\"\n [(ngModel)]=\"selectedRadioRow\"\n [value]=\"row\"\n [disabled]=\"column.disabled\"\n (click)=\"onStopPropagation($event)\"\n (change)=\"onRadioSelectChange($event, row)\" />\n }\n <!-- switch -->\n @if (column.type === customType.switch) {\n <thy-switch\n [(ngModel)]=\"row[column.key]\"\n (ngModelChange)=\"onModelChange(row, column)\"\n [disabled]=\"column.disabled\"\n (thyChange)=\"onSwitchChange($event, row, column)\"></thy-switch>\n }\n }\n </td>\n }\n </ng-template>\n </tbody>\n }\n </table>\n\n @if (loadingDone && model.length === 0 && groups.length === 0) {\n <div class=\"thy-table-empty clear-hover\">\n @if (emptyTemplate) {\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n } @else {\n <thy-empty\n [thyMessage]=\"emptyOptions.message\"\n [thyTranslationKey]=\"emptyOptions.translationKey\"\n [thyTranslationValues]=\"emptyOptions.translationValues\"\n [thyEntityName]=\"emptyOptions.entityName\"\n [thyEntityNameTranslateKey]=\"emptyOptions.entityNameTranslateKey\"\n [thyIconName]=\"emptyOptions.iconName\"\n [thySize]=\"emptyOptions.size\"\n [thyMarginTop]=\"emptyOptions.marginTop\"\n [thyTopAuto]=\"emptyOptions.topAuto\"\n [thyContainer]=\"emptyOptions.container\"></thy-empty>\n }\n </div>\n }\n\n @if (!loadingDone) {\n <thy-table-skeleton\n [thyRowCount]=\"6\"\n [thyHeadless]=\"true\"\n [thyTheme]=\"theme\"\n [thySize]=\"size\"\n [thyMinWidth]=\"thyMinWidth\"\n [thyColumns]=\"skeletonColumns\">\n </thy-table-skeleton>\n }\n\n @if (pagination.total > pagination.size) {\n <div class=\"thy-table-footer\" [class.thy-table-footer-has-padding]=\"theme === 'default'\">\n <thy-pagination\n [thyPageIndex]=\"pagination.index\"\n [thyTotal]=\"pagination.total\"\n [thyPageSize]=\"pagination.size\"\n [thyPageSizeOptions]=\"pagination.sizeOptions\"\n [thyShowSizeChanger]=\"showSizeChanger\"\n [thyShowTotal]=\"showTotal\"\n (thyPageChanged)=\"onPageChange($event)\"\n (thyPageIndexChange)=\"onPageIndexChange($event)\"\n (thyPageSizeChanged)=\"onPageSizeChange($event)\"></thy-pagination>\n </div>\n }\n</div>\n\n<ng-template>\n <ng-content></ng-content>\n</ng-template>\n", dependencies: [{ kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: ThyDragDropDirective, selector: "[thyDragDrop]" }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: ThyContextMenuDirective, selector: "[thyContextMenu]", outputs: ["thyContextMenu"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThySwitch, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled", "thyLoading"], outputs: ["thyChange"] }, { kind: "component", type: ThyEmpty, selector: "thy-empty", inputs: ["thyMessage", "thyTranslationKey", "thyTranslationValues", "thyEntityName", "thyEntityNameTranslateKey", "thyIconName", "thySize", "thyMarginTop", "thyTopAuto", "thyContainer", "thyImageUrl", "thyImageLoading", "thyImageFetchPriority", "thyDescription"] }, { kind: "component", type: ThyTableSkeleton, selector: "thy-table-skeleton", inputs: ["thyBorderRadius", "thyRowHeight", "thyAnimated", "thyAnimatedInterval", "thyPrimaryColor", "thySecondaryColor", "thyRowCount", "thyHeadless", "thyTheme", "thySize", "thyMinWidth", "thyColumns"] }, { kind: "component", type: ThyPagination, selector: "thy-pagination", inputs: ["thyPageIndex", "thyPageSize", "thyTotal", "thyCustomPages", "thyDisabled", "thyShowQuickJumper", "thyShowTotalPageCount", "thySize", "thyMaxCount", "thyMarginalCount", "thyRangeCount", "thyShowSizeChanger", "thyPageSizeOptions", "thyHideOnSinglePage", "thyUnit", "thyShowTotal", "selectedPageSize"], outputs: ["thyPageIndexChange", "thyPageChanged", "thyPageSizeChanged", "selectedPageSizeChange"] }, { kind: "pipe", type: TableIsValidModelValuePipe, name: "isValidModelValue" }, { kind: "pipe", type: TableRowDragDisabledPipe, name: "tableRowDragDisabled" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1204
1204
|
}
|
|
1205
1205
|
__decorate([
|
|
1206
1206
|
InputCssPixel(),
|