UI: Rename decorators file and added coercion to module map

This commit is contained in:
Vladyslav_Prykhodko 2023-05-04 17:46:43 +03:00
parent 86743b907a
commit f438c51b12
18 changed files with 42 additions and 14 deletions

View File

@ -93,6 +93,10 @@ import * as NospacePipe from '@shared/pipe/nospace.pipe';
import * as SelectableColumnsPipe from '@shared/pipe/selectable-columns.pipe'; import * as SelectableColumnsPipe from '@shared/pipe/selectable-columns.pipe';
import * as KeyboardShortcutPipe from '@shared/pipe/keyboard-shortcut.pipe'; import * as KeyboardShortcutPipe from '@shared/pipe/keyboard-shortcut.pipe';
import * as coercion from '@shared/decorators/coercion';
import * as enumerable from '@shared/decorators/enumerable';
import * as TbInject from '@shared/decorators/tb-inject';
import * as FooterComponent from '@shared/components/footer.component'; import * as FooterComponent from '@shared/components/footer.component';
import * as LogoComponent from '@shared/components/logo.component'; import * as LogoComponent from '@shared/components/logo.component';
import * as FooterFabButtonsComponent from '@shared/components/footer-fab-buttons.component'; import * as FooterFabButtonsComponent from '@shared/components/footer-fab-buttons.component';
@ -384,6 +388,10 @@ class ModulesMap implements IModulesMap {
'@shared/pipe/selectable-columns.pipe': SelectableColumnsPipe, '@shared/pipe/selectable-columns.pipe': SelectableColumnsPipe,
'@shared/pipe/keyboard-shortcut.pipe': KeyboardShortcutPipe, '@shared/pipe/keyboard-shortcut.pipe': KeyboardShortcutPipe,
'@shared/decorators/coercion': coercion,
'@shared/decorators/enumerable': enumerable,
'@shared/decorators/tb-inject': TbInject,
'@shared/components/footer.component': FooterComponent, '@shared/components/footer.component': FooterComponent,
'@shared/components/logo.component': LogoComponent, '@shared/components/logo.component': LogoComponent,
'@shared/components/footer-fab-buttons.component': FooterFabButtonsComponent, '@shared/components/footer-fab-buttons.component': FooterFabButtonsComponent,

View File

@ -30,7 +30,7 @@ import {
} from '@angular/core'; } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { AlarmFilterConfig } from '@shared/models/query/query.models'; import { AlarmFilterConfig } from '@shared/models/query/query.models';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'; import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
import { TemplatePortal } from '@angular/cdk/portal'; import { TemplatePortal } from '@angular/cdk/portal';
import { import {

View File

@ -30,7 +30,7 @@ import {
ViewContainerRef ViewContainerRef
} from '@angular/core'; } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'; import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
import { TemplatePortal } from '@angular/cdk/portal'; import { TemplatePortal } from '@angular/cdk/portal';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';

View File

@ -37,7 +37,7 @@ import { MatStepper } from '@angular/material/stepper';
import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle';
import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout'; import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout';
import { MediaBreakpoints } from '@shared/models/constants'; import { MediaBreakpoints } from '@shared/models/constants';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
export interface ToggleHeaderOption { export interface ToggleHeaderOption {
name: string; name: string;

View File

@ -32,7 +32,7 @@ import { AppState } from '@app/core/core.state';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { NonConfirmedNotificationEscalation } from '@shared/models/notification.models'; import { NonConfirmedNotificationEscalation } from '@shared/models/notification.models';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
@Component({ @Component({
selector: 'tb-escalations-component', selector: 'tb-escalations-component',

View File

@ -19,7 +19,7 @@ import { ClipboardService } from 'ngx-clipboard';
import { TooltipPosition } from '@angular/material/tooltip'; import { TooltipPosition } from '@angular/material/tooltip';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { ThemePalette } from '@angular/material/core'; import { ThemePalette } from '@angular/material/core';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
@Component({ @Component({
selector: 'tb-copy-button', selector: 'tb-copy-button',

View File

@ -39,7 +39,7 @@ import { EntityService } from '@core/http/entity.service';
import { getCurrentAuthUser } from '@core/auth/auth.selectors'; import { getCurrentAuthUser } from '@core/auth/auth.selectors';
import { Authority } from '@shared/models/authority.enum'; import { Authority } from '@shared/models/authority.enum';
import { isEqual } from '@core/utils'; import { isEqual } from '@core/utils';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
@Component({ @Component({
selector: 'tb-entity-autocomplete', selector: 'tb-entity-autocomplete',

View File

@ -27,7 +27,7 @@ import { MatAutocomplete } from '@angular/material/autocomplete';
import { MatChipGrid } from '@angular/material/chips'; import { MatChipGrid } from '@angular/material/chips';
import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { SubscriptSizing } from '@angular/material/form-field'; import { SubscriptSizing } from '@angular/material/form-field';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
interface EntityTypeInfo { interface EntityTypeInfo {
name: string; name: string;

View File

@ -39,7 +39,7 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { SHARED_MODULE_TOKEN } from '@shared/components/tokens'; import { SHARED_MODULE_TOKEN } from '@shared/components/tokens';
import { deepClone, guid, isDefinedAndNotNull } from '@core/utils'; import { deepClone, guid, isDefinedAndNotNull } from '@core/utils';
import { Observable, of, ReplaySubject } from 'rxjs'; import { Observable, of, ReplaySubject } from 'rxjs';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
let defaultMarkdownStyle; let defaultMarkdownStyle;

View File

@ -29,7 +29,7 @@ import { alarmSeverityTranslations } from '@shared/models/alarm.models';
import tinycolor from 'tinycolor2'; import tinycolor from 'tinycolor2';
import { StateObject } from '@core/api/widget-api.models'; import { StateObject } from '@core/api/widget-api.models';
import { objToBase64URI } from '@core/utils'; import { objToBase64URI } from '@core/utils';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
@Component({ @Component({
selector: 'tb-notification', selector: 'tb-notification',

View File

@ -40,7 +40,7 @@ import {
} from '@home/pages/notification/template/template-notification-dialog.component'; } from '@home/pages/notification/template/template-notification-dialog.component';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { MatButton } from '@angular/material/button'; import { MatButton } from '@angular/material/button';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
@Component({ @Component({
selector: 'tb-template-autocomplete', selector: 'tb-template-autocomplete',

View File

@ -58,7 +58,7 @@ import {
import { distinctUntilChanged, take, takeUntil } from 'rxjs/operators'; import { distinctUntilChanged, take, takeUntil } from 'rxjs/operators';
import { isNotEmptyStr, onParentScrollOrWindowResize } from '@core/utils'; import { isNotEmptyStr, onParentScrollOrWindowResize } from '@core/utils';
import { animate, AnimationBuilder, AnimationMetadata, style } from '@angular/animations'; import { animate, AnimationBuilder, AnimationMetadata, style } from '@angular/animations';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
export type TbPopoverTrigger = 'click' | 'focus' | 'hover' | null; export type TbPopoverTrigger = 'click' | 'focus' | 'hover' | null;

View File

@ -19,7 +19,7 @@ import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, Valida
import { MatChipInputEvent } from '@angular/material/chips'; import { MatChipInputEvent } from '@angular/material/chips';
import { COMMA, ENTER, SEMICOLON } from '@angular/cdk/keycodes'; import { COMMA, ENTER, SEMICOLON } from '@angular/cdk/keycodes';
import { FloatLabelType, MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field'; import { FloatLabelType, MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
@Component({ @Component({
selector: 'tb-string-items-list', selector: 'tb-string-items-list',

View File

@ -19,7 +19,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { TimeInterval, TimeService } from '@core/services/time.service'; import { TimeInterval, TimeService } from '@core/services/time.service';
import { coerceNumberProperty } from '@angular/cdk/coercion'; import { coerceNumberProperty } from '@angular/cdk/coercion';
import { SubscriptSizing } from '@angular/material/form-field'; import { SubscriptSizing } from '@angular/material/form-field';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
@Component({ @Component({
selector: 'tb-timeinterval', selector: 'tb-timeinterval',

View File

@ -53,7 +53,7 @@ import { deepClone, isDefinedAndNotNull } from '@core/utils';
import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'; import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
import { ComponentPortal } from '@angular/cdk/portal'; import { ComponentPortal } from '@angular/cdk/portal';
import { coerceBoolean } from '@shared/decorators/coerce-boolean'; import { coerceBoolean } from '@shared/decorators/coercion';
// @dynamic // @dynamic
@Component({ @Component({

View File

@ -0,0 +1,19 @@
///
/// Copyright © 2016-2023 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export * from './coercion';
export * from './enumerable';
export * from './tb-inject';

View File

@ -15,6 +15,7 @@
/// ///
export * from './components/public-api'; export * from './components/public-api';
export * from './decorators/public-api';
export * from './models/public-api'; export * from './models/public-api';
export * from './pipe/public-api'; export * from './pipe/public-api';
export * from './shared.module'; export * from './shared.module';