Skip to content

Commit

Permalink
chore: use ts-essentials
Browse files Browse the repository at this point in the history
  • Loading branch information
fengtianze committed Jan 18, 2024
1 parent 47b2791 commit 6ca3f00
Show file tree
Hide file tree
Showing 103 changed files with 136 additions and 115 deletions.
5 changes: 5 additions & 0 deletions .changeset/beige-bananas-grin-233.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@alauda/ui': minor
---

- [BREAKING CHANGE] refactor: remove unnecessary exports
2 changes: 1 addition & 1 deletion src/anchor/anchor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
tap,
} from 'rxjs';

import { buildBem, isTemplateRef, last } from '../utils';
import { buildBem, isTemplateRef, last } from '../internal/utils';

import { AnchorDirectiveChild } from './anchor.directive';
import { AnchorItem, AnchorTreeItem } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/anchor/anchor.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from '@angular/core';
import { Subject, fromEvent, merge, startWith, takeUntil } from 'rxjs';

import { observeResizeOn } from '../utils';
import { observeResizeOn } from '../internal/utils';

import { AnchorComponent } from './anchor.component';

Expand Down
2 changes: 1 addition & 1 deletion src/anchor/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { last } from '../utils';
import { last } from '../internal/utils';

import { AnchorItem, AnchorTreeItem } from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/autocomplete/autocomplete.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
withLatestFrom,
} from 'rxjs';

import { publishRef } from '../utils';
import { publishRef } from '../internal/utils';

import { AutocompletePlaceholderComponent } from './autocomplete-placeholder.component';
import { AutoCompleteDirective } from './autocomplete.directive';
Expand Down
2 changes: 1 addition & 1 deletion src/autocomplete/autocomplete.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import {
distinctUntilChanged,
} from 'rxjs';

import { scrollIntoView } from '../internal/utils';
import { BaseTooltip, TooltipTrigger, TooltipType } from '../tooltip';
import { AnimationType } from '../tooltip/animations';
import { scrollIntoView } from '../utils';

import { AutocompleteComponent } from './autocomplete.component';
import { AutoCompleteContext, SuggestionFilterFn } from './autocomplete.types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@angular/core';
import { Observable, combineLatest, of, map, startWith, switchMap } from 'rxjs';

import { publishRef } from '../../utils';
import { publishRef } from '../../internal/utils';
import { SuggestionComponent } from '../suggestion/suggestion.component';

@Component({
Expand Down
7 changes: 6 additions & 1 deletion src/autocomplete/suggestion/suggestion.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ import {
tap,
} from 'rxjs';

import { Bem, buildBem, coerceAttrBoolean, publishRef } from '../../utils';
import {
Bem,
buildBem,
coerceAttrBoolean,
publishRef,
} from '../../internal/utils';
import { AutocompleteComponent } from '../autocomplete.component';

@Component({
Expand Down
2 changes: 1 addition & 1 deletion src/button/button.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, DebugElement } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

import { ComponentSize } from '../types';
import { ComponentSize } from '../internal/types';

import { ButtonComponent } from './button.component';
import { ButtonType } from './button.types';
Expand Down
2 changes: 1 addition & 1 deletion src/button/button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@angular/core';

import { IconComponent } from '../icon/icon.component';
import { ComponentSize } from '../types';
import { ComponentSize } from '../internal/types';

import { ButtonType } from './button.types';

Expand Down
2 changes: 1 addition & 1 deletion src/button/button.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ValueOf } from '../types';
import { ValueOf } from '../internal/types';

export const ButtonType = {
Default: 'default',
Expand Down
2 changes: 1 addition & 1 deletion src/date-picker/calendar/header/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import dayjs, { ConfigType, Dayjs } from 'dayjs';
import { ButtonComponent } from '../../../button/button.component';
import { I18nPipe } from '../../../i18n/i18n.pipe';
import { IconComponent } from '../../../icon/icon.component';
import { buildBem } from '../../../utils';
import { buildBem } from '../../../internal/utils';
import {
CalendarHeaderRange,
DateNavRange,
Expand Down
2 changes: 1 addition & 1 deletion src/date-picker/calendar/panel/picker-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import isBetween from 'dayjs/plugin/isBetween';

import { ButtonComponent } from '../../../button/button.component';
import { I18nPipe } from '../../../i18n/i18n.pipe';
import { buildBem } from '../../../utils';
import { buildBem } from '../../../internal/utils';
import { DateNavRange } from '../../date-picker.type';
import {
DAY,
Expand Down
2 changes: 1 addition & 1 deletion src/date-picker/calendar/range-picker-panel/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import dayjs, { Dayjs } from 'dayjs';

import { CommonFormControl } from '../../../form/common-form';
import { I18nPipe } from '../../../i18n/i18n.pipe';
import { buildBem } from '../../../internal/utils';
import { TimePickerComponent } from '../../../time-picker/component';
import { TimePickerModel } from '../../../time-picker/time-picker.type';
import { buildBem } from '../../../utils';
import { DateNavRange, DisabledTimeFn, Side } from '../../date-picker.type';
import { DatePickerType, MONTH, YEAR } from '../constant';
import { CalendarFooterComponent } from '../footer/component';
Expand Down
2 changes: 1 addition & 1 deletion src/date-picker/date-picker/date-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
import dayjs, { ConfigType, Dayjs } from 'dayjs';

import { CommonFormControl } from '../../form/common-form';
import { ComponentSize } from '../../internal/types';
import { TooltipDirective } from '../../tooltip/tooltip.directive';
import { ComponentSize } from '../../types';
import { DatePickerType } from '../calendar/constant';
import { DatePickerPanelComponent } from '../calendar/date-picker-panel/component';
import { DateNavRange, DisabledTimeFn } from '../date-picker.type';
Expand Down
2 changes: 1 addition & 1 deletion src/date-picker/range-picker/range-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
import dayjs, { ConfigType, Dayjs } from 'dayjs';

import { CommonFormControl } from '../../form';
import { ComponentSize } from '../../internal/types';
import { TooltipDirective } from '../../tooltip/tooltip.directive';
import { ComponentSize } from '../../types';
import { DateRangePickerPanelComponent } from '../calendar/range-picker-panel/component';
import { DisabledDateFn, DisabledTimeFn } from '../date-picker.type';
import { DatePickerTriggerComponent } from '../trigger/trigger.component';
Expand Down
4 changes: 2 additions & 2 deletions src/date-picker/trigger/trigger.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { Dayjs } from 'dayjs';
import { I18nPipe } from '../../i18n/i18n.pipe';
import { IconComponent } from '../../icon/icon.component';
import { InputComponent } from '../../input/input.component';
import { ComponentSize } from '../../types';
import { buildBem } from '../../utils';
import { ComponentSize } from '../../internal/types';
import { buildBem } from '../../internal/utils';

const bem = buildBem('aui-date-picker-trigger');

Expand Down
2 changes: 1 addition & 1 deletion src/dialog/confirm-dialog/confirm-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { firstValueFrom, Observable } from 'rxjs';

import { ButtonComponent } from '../../button/button.component';
import { IconComponent } from '../../icon/icon.component';
import { Bem, buildBem, isString, isTemplateRef } from '../../utils';
import { Bem, buildBem, isString, isTemplateRef } from '../../internal/utils';
import { DialogRef } from '../dialog-ref';
import {
BeforeAction,
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/dialog-animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@angular/animations';

import { AnimationDuration } from '../core/animation/animation-consts';
import { getAnimationQueryMetadatas } from '../utils/animations';
import { getAnimationQueryMetadatas } from '../internal/utils/animations';

export const ZOOM_CLASS_NAME_MAP = {
enter: 'aui-zoom-enter',
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/dialog-content/dialog-content.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ViewEncapsulation,
} from '@angular/core';

import { Bem, buildBem } from '../../utils';
import { Bem, buildBem } from '../../internal/utils';

@Component({
selector: 'aui-dialog-content',
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/dialog-content/dialog-footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ViewEncapsulation,
} from '@angular/core';

import { Bem, buildBem } from '../../utils';
import { Bem, buildBem } from '../../internal/utils';

@Component({
selector: 'aui-dialog-footer',
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/dialog-content/dialog-header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@angular/core';

import { IconComponent } from '../../icon/icon.component';
import { Bem, buildBem } from '../../utils';
import { Bem, buildBem } from '../../internal/utils';
import { DialogRef } from '../dialog-ref';
import { DialogService } from '../dialog.service';
import { getClosestDialog } from '../utils';
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { debounceTime, filter, fromEvent } from 'rxjs';

import { Bem, buildBem, getElementOffset } from '../utils';
import { Bem, buildBem, getElementOffset } from '../internal/utils';

import {
dialogAnimations,
Expand Down
2 changes: 1 addition & 1 deletion src/drawer/component/internal/internal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { BehaviorSubject, Subject } from 'rxjs';

import { TimingFunction } from '../../../core/animation/animation-consts';
import { IconComponent } from '../../../icon/icon.component';
import { handlePixel, isTemplateRef } from '../../../utils';
import { handlePixel, isTemplateRef } from '../../../internal/utils';
import { DrawerOptions, DrawerSize } from '../../types';

export const DATA = new InjectionToken('drawer-data');
Expand Down
2 changes: 1 addition & 1 deletion src/drawer/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentType } from '@angular/cdk/portal';
import { TemplateRef } from '@angular/core';

import { ValueOf } from '../types';
import { ValueOf } from '../internal/types';

export const DrawerSize = {
Small: 'small',
Expand Down
4 changes: 2 additions & 2 deletions src/dropdown/dropdown-button/dropdown-button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { Observable, map, startWith } from 'rxjs';
import { ButtonType } from '../../button';
import { ButtonComponent } from '../../button/button.component';
import { IconComponent } from '../../icon/icon.component';
import { ComponentSize } from '../../types';
import { Bem, buildBem, coerceAttrBoolean } from '../../utils';
import { ComponentSize } from '../../internal/types';
import { Bem, buildBem, coerceAttrBoolean } from '../../internal/utils';
import { DropdownDirective } from '../dropdown.directive';
import { MenuItemComponent } from '../menu-item/menu-item.component';

Expand Down
2 changes: 1 addition & 1 deletion src/dropdown/dropdown.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ValueOf } from '../types';
import { ValueOf } from '../internal/types';

export const MenuItemType = {
Default: 'default',
Expand Down
2 changes: 1 addition & 1 deletion src/dropdown/menu-item/menu-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ViewEncapsulation,
} from '@angular/core';

import { Bem, buildBem } from '../../utils';
import { Bem, buildBem } from '../../internal/utils';
import { MenuItemType } from '../dropdown.types';

@Component({
Expand Down
4 changes: 2 additions & 2 deletions src/dropdown/menu/menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
ViewEncapsulation,
} from '@angular/core';

import { ComponentSize } from '../../types';
import { Bem, buildBem } from '../../utils';
import { ComponentSize } from '../../internal/types';
import { Bem, buildBem } from '../../internal/utils';

@Component({
selector: 'aui-menu',
Expand Down
4 changes: 2 additions & 2 deletions src/dropdown/submenu/submenu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
} from '@angular/core';

import { IconComponent } from '../../icon/icon.component';
import { ComponentSize } from '../../internal/types';
import { Bem, buildBem } from '../../internal/utils';
import { TooltipTrigger } from '../../tooltip';
import { TooltipActiveDirective } from '../../tooltip/tooltip-active.directive';
import { TooltipDirective } from '../../tooltip/tooltip.directive';
import { ComponentSize } from '../../types';
import { Bem, buildBem } from '../../utils';
import { MenuComponent } from '../menu/menu.component';
import { MenuItemComponent } from '../menu-item/menu-item.component';

Expand Down
2 changes: 1 addition & 1 deletion src/form/common-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { ControlValueAccessor } from '@angular/forms';
import { ReplaySubject } from 'rxjs';

import { coerceAttrBoolean } from '../utils';
import { coerceAttrBoolean } from '../internal/utils';

/**
* form control 内部不保持 value 属性,当不使用 ngModel 时可以通过 [(value)] 实现双向绑定;
Expand Down
2 changes: 1 addition & 1 deletion src/form/form-item/form-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
takeUntil,
} from 'rxjs';

import { Bem, buildBem, publishRef } from '../../utils';
import { Bem, buildBem, publishRef } from '../../internal/utils';
import { FormDirective } from '../form.directive';
import { FormItemWidth, LabelPosition } from '../form.types';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/form/form.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ValueOf } from '../types';
import { ValueOf } from '../internal/types';

export const LabelPosition = {
Top: 'top',
Expand Down
2 changes: 1 addition & 1 deletion src/form/helper-directives.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Directive, Input } from '@angular/core';

import { coerceAttrBoolean } from '../utils';
import { coerceAttrBoolean } from '../internal/utils';

@Directive({
selector: 'label[auiFormItemLabel]',
Expand Down
2 changes: 1 addition & 1 deletion src/icon/icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
ViewEncapsulation,
} from '@angular/core';

import { Bem, buildBem, handlePixel } from '../internal/utils';
import { ThemePickerPipe } from '../theme/theme.pipe';
import { Bem, buildBem, handlePixel } from '../utils';

import { IconRegisterService } from './icon-register.service';

Expand Down
24 changes: 13 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ export * from './i18n';
export * from './icon';
export * from './inline-alert';
export * from './input';
export { ComponentSize } from './internal/types';
export {
AttrBoolean,
Bem,
buildBem,
coerceAttrBoolean,
coerceString,
getCompatibleStylesRenderer,
handlePixel,
isTemplateRef,
observeMutationOn,
observeResizeOn,
} from './internal/utils';
export * from './message';
export * from './notification';
export * from './paginator';
Expand All @@ -34,14 +47,3 @@ export * from './theme';
export * from './time-picker';
export * from './tooltip';
export * from './tree-select';
export { ComponentSize } from './types';
export {
AttrBoolean,
coerceAttrBoolean,
coerceString,
getCompatibleStylesRenderer,
handlePixel,
isTemplateRef,
observeMutationOn,
observeResizeOn,
} from './utils';
2 changes: 1 addition & 1 deletion src/inline-alert/inline-alert.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@angular/core';

import { IconComponent } from '../icon/icon.component';
import { Bem, buildBem } from '../utils';
import { Bem, buildBem } from '../internal/utils';

import { InlineAlertTitleDirective } from './helper-directives';
import { InlineAlertType } from './inline-alert.types';
Expand Down
2 changes: 1 addition & 1 deletion src/inline-alert/inline-alert.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ValueOf } from '../types';
import { ValueOf } from '../internal/types';

export const InlineAlertType = {
Primary: 'primary',
Expand Down
2 changes: 1 addition & 1 deletion src/input/input-group/input-group.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

import { IconComponent } from '../../icon';
import { ComponentSize } from '../../types';
import { ComponentSize } from '../../internal/types';
import { InputComponent } from '../input.component';

import { INPUT_GROUP_MODULE } from './input-group.component';
Expand Down
2 changes: 1 addition & 1 deletion src/input/input-group/input-group.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@angular/core';
import { Observable } from 'rxjs';

import { Bem, buildBem, watchContentExist } from '../../utils';
import { Bem, buildBem, watchContentExist } from '../../internal/utils';
import {
InputAddonAfterDirective,
InputAddonBeforeDirective,
Expand Down
2 changes: 1 addition & 1 deletion src/input/input.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, DebugElement } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

import { ComponentSize } from '../types';
import { ComponentSize } from '../internal/types';

import { InputComponent } from './input.component';

Expand Down
Loading

0 comments on commit 6ca3f00

Please sign in to comment.