From 70df9d2f70186e8624341c1d6a5d4406215a43be Mon Sep 17 00:00:00 2001 From: Maple13 Date: Wed, 31 Jul 2024 16:36:16 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feat(grid):=20support=20progress=20edi?= =?UTF-8?q?tor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - support hover pop-up editing component --- package.json | 2 +- .../abstract-cell-editor.component.ts | 2 +- .../progress/progress-editor.component.scss | 21 +++++ .../progress/progress-editor.component.ts | 59 ++++++++++++++ .../rating/rating-editor.component.ts | 5 +- .../text/text-editor.component.ts | 11 +-- packages/grid/src/components/index.ts | 8 +- packages/grid/src/constants/editor.ts | 23 +++--- packages/grid/src/constants/grid.ts | 11 +-- packages/grid/src/core/constants/field.ts | 8 +- packages/grid/src/core/types/core.ts | 4 +- packages/grid/src/grid.component.html | 20 ++++- packages/grid/src/grid.component.ts | 52 +++++++------ packages/grid/src/services/event.service.ts | 35 +++++++-- packages/grid/src/styles/styles.scss | 1 + src/app/app.component.ts | 78 ++++++++++++------- src/app/app.config.ts | 17 +++- src/tsconfig.json | 8 ++ tsconfig.json | 3 +- 19 files changed, 265 insertions(+), 103 deletions(-) create mode 100644 packages/grid/src/components/cell-editors/progress/progress-editor.component.scss create mode 100644 packages/grid/src/components/cell-editors/progress/progress-editor.component.ts create mode 100644 src/tsconfig.json diff --git a/package.json b/package.json index ee261a44..9a7e3793 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@tethys/icons": "^1.4.62", "date-fns": "^3.6.0", "immer": "^10.0.3", - "ngx-tethys": "^17.0.8", + "ngx-tethys": "^17.0.14", "npm": "^10.8.1", "rxjs": "~7.8.0", "tslib": "^2.6.3", diff --git a/packages/grid/src/components/cell-editors/abstract-cell-editor.component.ts b/packages/grid/src/components/cell-editors/abstract-cell-editor.component.ts index 6803ad72..4a4e9456 100644 --- a/packages/grid/src/components/cell-editors/abstract-cell-editor.component.ts +++ b/packages/grid/src/components/cell-editors/abstract-cell-editor.component.ts @@ -32,6 +32,6 @@ export abstract class AbstractEditCellEditor + {{ modelValue }}{{ config?.suffix || '%' }} + `, + standalone: true, + changeDetection: ChangeDetectionStrategy.OnPush, + imports: [FormsModule, ThySlider], + host: { + class: 'progress-editor' + } +}) +export class ProgressEditorComponent extends AbstractEditCellEditor implements OnInit { + config: Partial = { + max: 100, + min: 0, + step: 1, + progressType: 'success', + suffix: '%', + size: 'md' + }; + + @HostListener('mousedown', ['$event']) + mousedownHandler(event: Event) { + event.preventDefault(); + } + + constructor() { + super(); + console.log('ProgressEditorComponent'); + } + + updateValue(value: number) { + this.updateFieldValue(); + } +} diff --git a/packages/grid/src/components/cell-editors/rating/rating-editor.component.ts b/packages/grid/src/components/cell-editors/rating/rating-editor.component.ts index bbe40654..37bf3914 100644 --- a/packages/grid/src/components/cell-editors/rating/rating-editor.component.ts +++ b/packages/grid/src/components/cell-editors/rating/rating-editor.component.ts @@ -1,15 +1,14 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { AbstractEditCellEditor } from '../abstract-cell-editor.component'; import { ThyRate } from 'ngx-tethys/rate'; -import { ThyTooltipModule } from 'ngx-tethys/tooltip'; +import { AbstractEditCellEditor } from '../abstract-cell-editor.component'; @Component({ selector: 'rating-cell-editor', template: ` `, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, - imports: [FormsModule, ThyRate, ThyTooltipModule] + imports: [FormsModule, ThyRate] }) export class RatingCellEditorComponent extends AbstractEditCellEditor { updateValue() { diff --git a/packages/grid/src/components/cell-editors/text/text-editor.component.ts b/packages/grid/src/components/cell-editors/text/text-editor.component.ts index c981343e..b452c38a 100644 --- a/packages/grid/src/components/cell-editors/text/text-editor.component.ts +++ b/packages/grid/src/components/cell-editors/text/text-editor.component.ts @@ -7,14 +7,9 @@ import { AbstractEditCellEditor } from '../abstract-cell-editor.component'; @Component({ selector: 'text-cell-editor', - template: ` `, + template: ` + + `, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIf, FormsModule, ThyAutofocusDirective, ThyInputDirective, ThyEnterDirective] diff --git a/packages/grid/src/components/index.ts b/packages/grid/src/components/index.ts index 3cba1bcf..74bfbf8a 100644 --- a/packages/grid/src/components/index.ts +++ b/packages/grid/src/components/index.ts @@ -1 +1,7 @@ -export * from './field-property-editor/field-property-editor.component' \ No newline at end of file +export * from './cell-editors/date-time/date-time-editor.component'; +export * from './cell-editors/link/number-editor.component'; +export * from './cell-editors/number/number-editor.component'; +export * from './cell-editors/progress/progress-editor.component'; +export * from './cell-editors/rating/rating-editor.component'; +export * from './cell-editors/text/text-editor.component'; +export * from './field-property-editor/field-property-editor.component'; diff --git a/packages/grid/src/constants/editor.ts b/packages/grid/src/constants/editor.ts index 7d035506..d85a2c32 100644 --- a/packages/grid/src/constants/editor.ts +++ b/packages/grid/src/constants/editor.ts @@ -1,16 +1,21 @@ -import { AITableFieldType } from '../core'; -import { TextCellEditorComponent } from '../components/cell-editors/text/text-editor.component'; -import { NumberCellEditorComponent } from '../components/cell-editors/number/number-editor.component'; -import { DateTimeCellEditorComponent } from '../components/cell-editors/date-time/date-time-editor.component'; -import { RatingCellEditorComponent } from '../components/cell-editors/rating/rating-editor.component'; -import { LinkCellEditorComponent } from '../components/cell-editors/link/number-editor.component'; +import { + DateTimeCellEditorComponent, + LinkCellEditorComponent, + ProgressEditorComponent, + RatingCellEditorComponent, + TextCellEditorComponent +} from '../components'; import { SelectCellEditorComponent } from '../components/cell-editors/select/select-editor.component'; +import { AITableFieldType } from '../core'; -export const GRID_CELL_EDITOR_MAP: Partial> = { +export const GRID_CELL_EDITOR_MAP: Record = { [AITableFieldType.text]: TextCellEditorComponent, + [AITableFieldType.richText]: TextCellEditorComponent, [AITableFieldType.select]: SelectCellEditorComponent, - [AITableFieldType.number]: NumberCellEditorComponent, + [AITableFieldType.number]: null, + [AITableFieldType.member]: null, [AITableFieldType.date]: DateTimeCellEditorComponent, [AITableFieldType.rate]: RatingCellEditorComponent, - [AITableFieldType.link]: LinkCellEditorComponent + [AITableFieldType.link]: LinkCellEditorComponent, + [AITableFieldType.progress]: ProgressEditorComponent }; diff --git a/packages/grid/src/constants/grid.ts b/packages/grid/src/constants/grid.ts index caeb3db1..f550ab57 100644 --- a/packages/grid/src/constants/grid.ts +++ b/packages/grid/src/constants/grid.ts @@ -1,15 +1,12 @@ -import { AITable, AITableFieldType } from '../core'; +import { AITableFieldType } from '../core'; export const DEFAULT_COLUMN_WIDTH = 200; export const MIN_COLUMN_WIDTH = 80; -export const DBL_CLICK_EDIT_TYPE = [ - AITableFieldType.text, - AITableFieldType.number, - AITableFieldType.select, - AITableFieldType.date -]; +export const DBL_CLICK_EDIT_TYPE = [AITableFieldType.text, AITableFieldType.number, AITableFieldType.select, AITableFieldType.date]; + +export const MOUSEOVER_EDIT_TYPE = [AITableFieldType.progress]; export const RowHeight = { Short: 32, diff --git a/packages/grid/src/core/constants/field.ts b/packages/grid/src/core/constants/field.ts index e24d8049..eaf475f3 100644 --- a/packages/grid/src/core/constants/field.ts +++ b/packages/grid/src/core/constants/field.ts @@ -1,5 +1,5 @@ -import { AITableFieldInfo, AITableFieldType } from '../types'; import { helpers } from 'ngx-tethys/util'; +import { AITableFieldInfo, AITableFieldType } from '../types'; export const BasicFields = [ { @@ -37,6 +37,12 @@ export const BasicFields = [ name: '链接', icon: 'link-insert', width: 300 + }, + { + type: AITableFieldType.progress, + name: '进度', + icon: 'progress', + width: 200 } ]; diff --git a/packages/grid/src/core/types/core.ts b/packages/grid/src/core/types/core.ts index d59f3f90..0c177b43 100644 --- a/packages/grid/src/core/types/core.ts +++ b/packages/grid/src/core/types/core.ts @@ -1,7 +1,7 @@ import { WritableSignal } from '@angular/core'; -import { AITableAction } from './action'; -import { AITableSelection } from '../../types'; import { Id } from 'ngx-tethys/types'; +import { AITableSelection } from '../../types'; +import { AITableAction } from './action'; export enum AITableFieldType { text = 'text', // 包含多行文本 diff --git a/packages/grid/src/grid.component.html b/packages/grid/src/grid.component.html index ad80a2fd..e6b8e146 100644 --- a/packages/grid/src/grid.component.html +++ b/packages/grid/src/grid.component.html @@ -47,6 +47,7 @@ @for (field of gridData().fields; track $index) {
@switch (field.type) { @case (AITableFieldType.select) { @@ -73,13 +73,25 @@ @case (AITableFieldType.link) { {{ record.values[field.id]?.text }} + {{ record.values[field.id]?.text }} + + } + @case (AITableFieldType.progress) { + + {{ record.values[field.id] }}{{ record.values[field.id]?.config?.suffix || '%' }} + } @default { {{ record.values[field.id] }} diff --git a/packages/grid/src/grid.component.ts b/packages/grid/src/grid.component.ts index a5cdc4b3..9f54fabd 100644 --- a/packages/grid/src/grid.component.ts +++ b/packages/grid/src/grid.component.ts @@ -1,39 +1,40 @@ -import { ChangeDetectionStrategy, Component, computed, ElementRef, input, model, NgZone, OnInit, output, signal } from '@angular/core'; import { CommonModule, NgClass, NgComponentOutlet, NgForOf } from '@angular/common'; -import { SelectOptionPipe } from './pipes/grid'; -import { ThyTag } from 'ngx-tethys/tag'; -import { ThyPopoverModule } from 'ngx-tethys/popover'; +import { ChangeDetectionStrategy, Component, computed, ElementRef, input, model, NgZone, OnInit, output, signal } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { buildGridData } from './utils'; -import { AIFieldConfig, AITableFieldMenuItem, AITableRowHeight } from './types'; +import { FormsModule } from '@angular/forms'; +import { ThyAction } from 'ngx-tethys/action'; +import { ThyCheckboxModule } from 'ngx-tethys/checkbox'; +import { ThyDatePickerFormatPipe } from 'ngx-tethys/date-picker'; +import { ThyDropdownDirective, ThyDropdownMenuComponent } from 'ngx-tethys/dropdown'; +import { ThyFlexibleText } from 'ngx-tethys/flexible-text'; +import { ThyIcon } from 'ngx-tethys/icon'; +import { ThyPopoverModule } from 'ngx-tethys/popover'; +import { ThyProgress } from 'ngx-tethys/progress'; +import { ThyRate } from 'ngx-tethys/rate'; +import { ThyStopPropagationDirective } from 'ngx-tethys/shared'; +import { ThyTag } from 'ngx-tethys/tag'; +import { ProgressEditorComponent } from './components'; +import { FieldMenu } from './components/field-menu/field-menu.component'; +import { AITableFieldPropertyEditor } from './components/field-property-editor/field-property-editor.component'; +import { DefaultFieldMenus } from './constants'; import { Actions, - createAITable, - getDefaultRecord, + AIPlugin, AITable, AITableChangeOptions, AITableFields, AITableFieldType, AITableRecords, + createAITable, createDefaultField, - AIPlugin + getDefaultRecord } from './core'; -import { ThyIcon } from 'ngx-tethys/icon'; +import { SelectOptionPipe } from './pipes/grid'; import { AITableGridEventService } from './services/event.service'; -import { AITableFieldPropertyEditor } from './components/field-property-editor/field-property-editor.component'; -import { ThyDatePickerFormatPipe } from 'ngx-tethys/date-picker'; -import { ThyRate } from 'ngx-tethys/rate'; -import { FormsModule } from '@angular/forms'; -import { ThyFlexibleText } from 'ngx-tethys/flexible-text'; -import { ThyTooltipModule, ThyTooltipService } from 'ngx-tethys/tooltip'; -import { ThyCheckboxModule } from 'ngx-tethys/checkbox'; -import { ThyStopPropagationDirective } from 'ngx-tethys/shared'; -import { FieldMenu } from './components/field-menu/field-menu.component'; -import { ThyAction } from 'ngx-tethys/action'; -import { ThyDropdownDirective, ThyDropdownMenuComponent } from 'ngx-tethys/dropdown'; -import { DefaultFieldMenus } from './constants'; import { AI_TABLE_GRID_FIELD_SERVICE_MAP, AITableGridFieldService } from './services/field.service'; import { AITableGridSelectionService } from './services/selection.servive'; +import { AIFieldConfig, AITableFieldMenuItem, AITableRowHeight } from './types'; +import { buildGridData } from './utils'; @Component({ selector: 'ai-table-grid', @@ -54,18 +55,19 @@ import { AITableGridSelectionService } from './services/selection.servive'; ThyPopoverModule, ThyIcon, ThyRate, + ThyProgress, AITableFieldPropertyEditor, ThyDatePickerFormatPipe, - ThyTooltipModule, ThyFlexibleText, ThyStopPropagationDirective, FieldMenu, ThyAction, ThyDropdownDirective, ThyDropdownMenuComponent, - ThyCheckboxModule + ThyCheckboxModule, + ProgressEditorComponent ], - providers: [ThyTooltipService, AITableGridEventService, AITableGridFieldService, AITableGridSelectionService] + providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService] }) export class AITableGrid implements OnInit { aiRecords = model.required(); diff --git a/packages/grid/src/services/event.service.ts b/packages/grid/src/services/event.service.ts index 489fdf16..fa17e929 100644 --- a/packages/grid/src/services/event.service.ts +++ b/packages/grid/src/services/event.service.ts @@ -1,12 +1,12 @@ import { Injectable, Signal } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { fromEvent, Subject } from 'rxjs'; -import { DBL_CLICK_EDIT_TYPE } from '../constants'; -import { getRecordOrField } from '../utils'; -import { AITable, AITableField, AITableFieldType, AITableRecord } from '../core'; +import { ThyPopover, ThyPopoverRef } from 'ngx-tethys/popover'; +import { debounceTime, fromEvent, Subject } from 'rxjs'; +import { DBL_CLICK_EDIT_TYPE, MOUSEOVER_EDIT_TYPE } from '../constants'; import { GRID_CELL_EDITOR_MAP } from '../constants/editor'; -import { ThyPopover } from 'ngx-tethys/popover'; +import { AITable, AITableField, AITableFieldType, AITableRecord } from '../core'; import { AITableGridCellRenderSchema } from '../types'; +import { getRecordOrField } from '../utils'; @Injectable() export class AITableGridEventService { @@ -32,6 +32,12 @@ export class AITableGridEventService { this.dblClick(event as MouseEvent); }); + fromEvent(element, 'mouseover') + .pipe(debounceTime(100), this.takeUntilDestroyed) + .subscribe((event) => { + this.mouseoverHandle(event as MouseEvent); + }); + fromEvent(element, 'mousedown') .pipe(this.takeUntilDestroyed) .subscribe((event) => { @@ -41,7 +47,7 @@ export class AITableGridEventService { private dblClick(event: MouseEvent) { const cellDom = (event.target as HTMLElement).closest('.grid-cell') as HTMLElement; - const type = cellDom && cellDom.getAttribute('type')! as AITableFieldType; + const type = cellDom && (cellDom.getAttribute('type')! as AITableFieldType); if (type && DBL_CLICK_EDIT_TYPE.includes(type)) { this.openEdit(cellDom); } @@ -61,7 +67,7 @@ export class AITableGridEventService { const field = getRecordOrField(this.aiTable.fields, fieldId) as Signal; const record = getRecordOrField(this.aiTable.records, recordId) as Signal; const component = this.getEditorComponent(field().type); - this.thyPopover.open(component, { + const ref = this.thyPopover.open(component, { origin: cellDom, originPosition: { x: x - 1, @@ -85,5 +91,20 @@ export class AITableGridEventService { manualClosure: true, animationDisabled: true }); + return ref; + } + + mouseoverRef!: ThyPopoverRef; + + private mouseoverHandle(event: MouseEvent) { + if (this.mouseoverRef) { + this.mouseoverRef?.close(); + } + + const cellDom = (event.target as HTMLElement).closest('.grid-cell') as HTMLElement; + const type = cellDom && (cellDom.getAttribute('type')! as AITableFieldType); + if (type && MOUSEOVER_EDIT_TYPE.includes(type)) { + this.mouseoverRef = this.openEdit(cellDom); + } } } diff --git a/packages/grid/src/styles/styles.scss b/packages/grid/src/styles/styles.scss index d0bd77dc..c1966084 100644 --- a/packages/grid/src/styles/styles.scss +++ b/packages/grid/src/styles/styles.scss @@ -2,6 +2,7 @@ @use 'ngx-tethys/styles/index.scss'; @use 'ngx-tethys/styles/variables.scss'; @use '../components/cell-editors/cell-editor.scss'; +@use '../components/cell-editors/progress/progress-editor.component.scss'; .ai-table-grid { display: table; diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7916e894..5895382a 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,37 +1,47 @@ -import { AfterViewInit, Component, OnDestroy, computed, OnInit, Signal, signal, WritableSignal, isDevMode } from '@angular/core'; -import { DomSanitizer } from '@angular/platform-browser'; -import { RouterOutlet } from '@angular/router'; import { + Actions, + AIFieldConfig, + AITable, + AITableField, AITableFields, AITableFieldType, AITableGrid, AITableRecords, - AITableField, - AITable, - AIFieldConfig, - EditFieldPropertyItem, DividerMenuItem, - RemoveFieldItem, - Actions + EditFieldPropertyItem, + RemoveFieldItem } from '@ai-table/grid'; +import { + AfterViewInit, + ChangeDetectionStrategy, + Component, + computed, + isDevMode, + OnDestroy, + OnInit, + Signal, + signal, + WritableSignal +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { DomSanitizer } from '@angular/platform-browser'; +import { RouterOutlet } from '@angular/router'; +import { ThyAction } from 'ngx-tethys/action'; import { ThyIconRegistry } from 'ngx-tethys/icon'; -import { ThyPopover, ThyPopoverModule } from 'ngx-tethys/popover'; -import { FieldPropertyEditor } from './component/field-property-editor/field-property-editor.component'; -import { withCustomApply } from './plugins/custom-action.plugin'; -import { ThyOption } from 'ngx-tethys/shared'; +import { ThyPopover } from 'ngx-tethys/popover'; import { ThySelect } from 'ngx-tethys/select'; -import { FormsModule } from '@angular/forms'; -import { NgFor } from '@angular/common'; -import { CustomActions } from './action'; -import { AITableView, AIViewTable, RowHeight } from './types/view'; +import { ThyOption } from 'ngx-tethys/shared'; import { WebsocketProvider } from 'y-websocket'; -import { connectProvider } from './share/provider'; -import { SharedType, getSharedType } from './share/shared'; -import { YjsAITable } from './share/yjs-table'; -import applyActionOps from './share/apply-to-yjs'; +import { CustomActions } from './action'; +import { FieldPropertyEditor } from './component/field-property-editor/field-property-editor.component'; +import { withCustomApply } from './plugins/custom-action.plugin'; import { applyYjsEvents } from './share/apply-to-table'; +import applyActionOps from './share/apply-to-yjs'; +import { connectProvider } from './share/provider'; +import { getSharedType, SharedType } from './share/shared'; import { translateSharedTypeToTable } from './share/utils/translate-to-table'; -import { ThyAction } from 'ngx-tethys/action'; +import { YjsAITable } from './share/yjs-table'; +import { AITableView, AIViewTable, RowHeight } from './types/view'; const LOCAL_STORAGE_KEY = 'ai-table-data'; @@ -46,7 +56,8 @@ const initValue = { url: 'https://www.baidu.com', text: '百度链接' }, - 'column-4': 3 + 'column-4': 3, + 'column-5': 10 } }, { @@ -55,7 +66,8 @@ const initValue = { 'column-1': '文本 2-1', 'column-2': '2', 'column-3': {}, - 'column-4': 1 + 'column-4': 1, + 'column-5': 20 } }, { @@ -64,7 +76,8 @@ const initValue = { 'column-1': '文本 3-1', 'column-2': '3', 'column-3': {}, - 'column-4': 1 + 'column-4': 1, + 'column-5': 50 } } ], @@ -105,6 +118,11 @@ const initValue = { id: 'column-4', name: '评分', type: AITableFieldType.rate + }, + { + id: 'column-5', + name: '进度', + type: AITableFieldType.progress } ] }; @@ -114,12 +132,12 @@ const initValue = { // for (let index = 0; index < 5; index++) { // initValue.fields.push({ // id: `column-${index}`, -// name: "文本", +// name: '文本', // type: AITableFieldType.text, // }); // } // initValue.records = []; -// for (let index = 0; index < 40 * 3 * 2*30; index++) { +// for (let index = 0; index < 40 * 3 * 2 * 30; index++) { // const value: any = {}; // initValue.fields.forEach((column, columnIndex) => { // value[`${column.id}`] = `text-${index}-${columnIndex}`; @@ -134,9 +152,10 @@ const initValue = { @Component({ selector: 'app-root', standalone: true, - imports: [RouterOutlet, AITableGrid, ThyPopoverModule, FieldPropertyEditor, ThySelect, FormsModule, NgFor, ThyOption, ThyAction], + imports: [RouterOutlet, AITableGrid, FieldPropertyEditor, ThySelect, FormsModule, ThyOption, ThyAction], templateUrl: './app.component.html', - styleUrl: './app.component.scss' + styleUrl: './app.component.scss', + changeDetection: ChangeDetectionStrategy.OnPush }) export class AppComponent implements OnInit, AfterViewInit, OnDestroy { records!: WritableSignal; @@ -166,6 +185,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy { text: 'tall' } ]; + sharedType!: SharedType | null; provider!: WebsocketProvider | null; diff --git a/src/app/app.config.ts b/src/app/app.config.ts index bb114ba9..207267aa 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -1,9 +1,18 @@ -import { ApplicationConfig, inject, provideZoneChangeDetection } from '@angular/core'; -import { provideRouter } from '@angular/router'; +import { provideHttpClient } from '@angular/common/http'; +import { ApplicationConfig, importProvidersFrom, provideZoneChangeDetection } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { BrowserModule } from '@angular/platform-browser'; import { provideAnimations } from '@angular/platform-browser/animations'; +import { provideRouter } from '@angular/router'; +import { ThyTooltipModule } from 'ngx-tethys/tooltip'; import { routes } from './app.routes'; -import { provideHttpClient } from '@angular/common/http'; export const appConfig: ApplicationConfig = { - providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideHttpClient(), provideAnimations(), provideRouter(routes)] + providers: [ + importProvidersFrom(BrowserModule, FormsModule, ThyTooltipModule), + provideZoneChangeDetection({ eventCoalescing: true }), + provideHttpClient(), + provideAnimations(), + provideRouter(routes) + ] }; diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 00000000..07d43ce9 --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/app", + "types": [] + }, + "exclude": ["**/*.spec.ts"] +} diff --git a/tsconfig.json b/tsconfig.json index deeceb08..9425457b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,8 @@ "useDefineForClassFields": false, "lib": ["ES2022", "dom"], "paths": { - "@ai-table/grid": ["./dist/grid"] + "@ai-table/grid": ["./packages/grid/src/public-api"], + "@ai-table/grid/*": ["./packages/grid/src/*"] } }, "angularCompilerOptions": {