diff --git a/projects/addon-charts/components/line-chart/line-chart.component.ts b/projects/addon-charts/components/line-chart/line-chart.component.ts index 0068ef03fca3..f93e039bb8d5 100644 --- a/projects/addon-charts/components/line-chart/line-chart.component.ts +++ b/projects/addon-charts/components/line-chart/line-chart.component.ts @@ -9,7 +9,7 @@ import { NgZone, ViewChildren, } from '@angular/core'; -import type {TuiLineChartHintContext} from '@taiga-ui/addon-charts/interfaces'; +import type {TuiLineChartHintContext} from '@taiga-ui/addon-charts/types'; import {tuiDraw} from '@taiga-ui/addon-charts/utils'; import type {TuiStringHandler} from '@taiga-ui/cdk'; import { diff --git a/projects/addon-charts/index.ts b/projects/addon-charts/index.ts index f9bb8c030db5..565866ee0f2e 100644 --- a/projects/addon-charts/index.ts +++ b/projects/addon-charts/index.ts @@ -1,4 +1,3 @@ export * from '@taiga-ui/addon-charts/components'; export * from '@taiga-ui/addon-charts/constants'; -export * from '@taiga-ui/addon-charts/interfaces'; export * from '@taiga-ui/addon-charts/types'; diff --git a/projects/addon-charts/interfaces/index.ts b/projects/addon-charts/interfaces/index.ts deleted file mode 100644 index 74d0eea6d01d..000000000000 --- a/projects/addon-charts/interfaces/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './line-chart-hint-context'; diff --git a/projects/addon-charts/interfaces/ng-package.json b/projects/addon-charts/interfaces/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-charts/interfaces/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-charts/types/index.ts b/projects/addon-charts/types/index.ts index 16b1266373dd..eef26cad22ce 100644 --- a/projects/addon-charts/types/index.ts +++ b/projects/addon-charts/types/index.ts @@ -1,2 +1,3 @@ +export * from './line-chart-hint-context'; export * from './line-handler'; export * from './line-type'; diff --git a/projects/addon-charts/interfaces/line-chart-hint-context.ts b/projects/addon-charts/types/line-chart-hint-context.ts similarity index 100% rename from projects/addon-charts/interfaces/line-chart-hint-context.ts rename to projects/addon-charts/types/line-chart-hint-context.ts diff --git a/projects/addon-commerce/components/input-card-grouped/input-card-grouped.component.ts b/projects/addon-commerce/components/input-card-grouped/input-card-grouped.component.ts index 8db0c345d1bd..8a28cd16f5c1 100644 --- a/projects/addon-commerce/components/input-card-grouped/input-card-grouped.component.ts +++ b/projects/addon-commerce/components/input-card-grouped/input-card-grouped.component.ts @@ -19,9 +19,8 @@ import {maskitoDateOptionsGenerator} from '@maskito/kit'; import {ResizeObserverModule} from '@ng-web-apis/resize-observer'; import {AbstractTuiInputCard} from '@taiga-ui/addon-commerce/components/input-card'; import {TUI_CARD_MASK} from '@taiga-ui/addon-commerce/constants'; -import type {TuiCard} from '@taiga-ui/addon-commerce/interfaces'; import {TuiFormatCardPipe} from '@taiga-ui/addon-commerce/pipes'; -import type {TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types'; +import type {TuiCard, TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types'; import type {TuiFocusableElementAccessor} from '@taiga-ui/cdk'; import { TUI_DIGIT_REGEXP, diff --git a/projects/addon-commerce/enums/index.ts b/projects/addon-commerce/enums/index.ts deleted file mode 100644 index 3cd57b55226f..000000000000 --- a/projects/addon-commerce/enums/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './currency'; -export * from './currency-code'; diff --git a/projects/addon-commerce/enums/ng-package.json b/projects/addon-commerce/enums/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-commerce/enums/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-commerce/index.ts b/projects/addon-commerce/index.ts index fc1af313b12d..8ca8acd4934f 100644 --- a/projects/addon-commerce/index.ts +++ b/projects/addon-commerce/index.ts @@ -1,7 +1,5 @@ export * from '@taiga-ui/addon-commerce/components'; export * from '@taiga-ui/addon-commerce/constants'; -export * from '@taiga-ui/addon-commerce/enums'; -export * from '@taiga-ui/addon-commerce/interfaces'; export * from '@taiga-ui/addon-commerce/pipes'; export * from '@taiga-ui/addon-commerce/tokens'; export * from '@taiga-ui/addon-commerce/types'; diff --git a/projects/addon-commerce/interfaces/index.ts b/projects/addon-commerce/interfaces/index.ts deleted file mode 100644 index cb5809fedb2d..000000000000 --- a/projects/addon-commerce/interfaces/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './card'; diff --git a/projects/addon-commerce/interfaces/ng-package.json b/projects/addon-commerce/interfaces/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-commerce/interfaces/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-commerce/interfaces/card.ts b/projects/addon-commerce/types/card.ts similarity index 100% rename from projects/addon-commerce/interfaces/card.ts rename to projects/addon-commerce/types/card.ts diff --git a/projects/addon-commerce/enums/currency-code.ts b/projects/addon-commerce/types/currency-code.ts similarity index 99% rename from projects/addon-commerce/enums/currency-code.ts rename to projects/addon-commerce/types/currency-code.ts index 75b4e4162a3a..51155e7ea0a4 100644 --- a/projects/addon-commerce/enums/currency-code.ts +++ b/projects/addon-commerce/types/currency-code.ts @@ -1,3 +1,4 @@ +// cspell:disable /** * **Active ISO 4217 numeric currency codes** * diff --git a/projects/addon-commerce/types/currency-variants.ts b/projects/addon-commerce/types/currency-variants.ts index fc046f962958..7382648d1de8 100644 --- a/projects/addon-commerce/types/currency-variants.ts +++ b/projects/addon-commerce/types/currency-variants.ts @@ -1,4 +1,5 @@ -import type {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums'; +import type {TuiCurrency} from './currency'; +import type {TuiCurrencyCode} from './currency-code'; export type TuiCurrencyAutocompletion = | keyof Record diff --git a/projects/addon-commerce/enums/currency.ts b/projects/addon-commerce/types/currency.ts similarity index 100% rename from projects/addon-commerce/enums/currency.ts rename to projects/addon-commerce/types/currency.ts diff --git a/projects/addon-commerce/types/index.ts b/projects/addon-commerce/types/index.ts index ed9ffe911648..257294c67953 100644 --- a/projects/addon-commerce/types/index.ts +++ b/projects/addon-commerce/types/index.ts @@ -1,4 +1,7 @@ +export * from './card'; export * from './code-length'; +export * from './currency'; +export * from './currency-code'; export * from './currency-variants'; export * from './money-sign'; export * from './payment-system'; diff --git a/projects/addon-commerce/utils/get-code-by-currency.ts b/projects/addon-commerce/utils/get-code-by-currency.ts index 3a9e345e7f69..a7210909091e 100644 --- a/projects/addon-commerce/utils/get-code-by-currency.ts +++ b/projects/addon-commerce/utils/get-code-by-currency.ts @@ -1,5 +1,5 @@ // cspell:disable -import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums'; +import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/types'; export const TUI_CODE_DICTIONARY: Record = { [TuiCurrency.Ruble]: TuiCurrencyCode.Ruble, diff --git a/projects/addon-commerce/utils/get-currency-by-code.ts b/projects/addon-commerce/utils/get-currency-by-code.ts index ca458bbc969a..3fc069ca99ea 100644 --- a/projects/addon-commerce/utils/get-currency-by-code.ts +++ b/projects/addon-commerce/utils/get-currency-by-code.ts @@ -1,5 +1,5 @@ // cspell:disable -import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums'; +import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/types'; export const TUI_CURRENCY_DICTIONARY: Record = { [TuiCurrencyCode.Ruble]: TuiCurrency.Ruble, diff --git a/projects/addon-commerce/utils/get-currency-symbol.ts b/projects/addon-commerce/utils/get-currency-symbol.ts index 349b78d9dd11..2ce5ac6980b4 100644 --- a/projects/addon-commerce/utils/get-currency-symbol.ts +++ b/projects/addon-commerce/utils/get-currency-symbol.ts @@ -1,5 +1,5 @@ -import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums'; import type {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types'; +import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/types'; export function tuiGetCurrencySymbol(currency: TuiCurrencyVariants): string | null { switch (currency) { diff --git a/projects/addon-doc/components/code/index.ts b/projects/addon-doc/components/code/index.ts index 278c8a544354..b46eca98e68b 100644 --- a/projects/addon-doc/components/code/index.ts +++ b/projects/addon-doc/components/code/index.ts @@ -7,8 +7,8 @@ import { inject, Input, } from '@angular/core'; -import type {TuiRawLoaderContent} from '@taiga-ui/addon-doc/interfaces'; import {TUI_DOC_EXAMPLE_MARKDOWN_CODE_PROCESSOR} from '@taiga-ui/addon-doc/tokens'; +import type {TuiRawLoaderContent} from '@taiga-ui/addon-doc/types'; import {tuiRawLoad} from '@taiga-ui/addon-doc/utils'; import type {TuiHandler} from '@taiga-ui/cdk'; import {TuiButtonDirective} from '@taiga-ui/core'; diff --git a/projects/addon-doc/components/demo/index.ts b/projects/addon-doc/components/demo/index.ts index 93a7aab1af2a..47272e784a15 100644 --- a/projects/addon-doc/components/demo/index.ts +++ b/projects/addon-doc/components/demo/index.ts @@ -15,9 +15,9 @@ import type {AbstractControl} from '@angular/forms'; import {FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms'; import type {Params, UrlTree} from '@angular/router'; import {UrlSerializer} from '@angular/router'; -import type {TuiDemoParams} from '@taiga-ui/addon-doc/interfaces'; import {TuiThemeDarkService} from '@taiga-ui/addon-doc/services'; import {TUI_DOC_DEMO_TEXTS, TUI_DOC_URL_STATE_HANDLER} from '@taiga-ui/addon-doc/tokens'; +import type {TuiDemoParams} from '@taiga-ui/addon-doc/types'; import {tuiCoerceValueIsTrue} from '@taiga-ui/addon-doc/utils'; import { tuiClamp, diff --git a/projects/addon-doc/components/example/example.component.ts b/projects/addon-doc/components/example/example.component.ts index c28c66ad5e2e..4773cfe1e49c 100644 --- a/projects/addon-doc/components/example/example.component.ts +++ b/projects/addon-doc/components/example/example.component.ts @@ -9,13 +9,13 @@ import { } from '@angular/core'; import {RouterLink} from '@angular/router'; import {LOCATION} from '@ng-web-apis/common'; -import type {TuiDocExample} from '@taiga-ui/addon-doc/interfaces'; import { TUI_DOC_CODE_ACTIONS, TUI_DOC_CODE_EDITOR, TUI_DOC_EXAMPLE_CONTENT_PROCESSOR, TUI_DOC_EXAMPLE_TEXTS, } from '@taiga-ui/addon-doc/tokens'; +import type {TuiDocExample} from '@taiga-ui/addon-doc/types'; import {tuiRawLoadRecord} from '@taiga-ui/addon-doc/utils'; import type {TuiContext} from '@taiga-ui/cdk'; import {TUI_IS_E2E, TuiItemDirective, TuiMapperPipe} from '@taiga-ui/cdk'; diff --git a/projects/addon-doc/components/example/example.options.ts b/projects/addon-doc/components/example/example.options.ts index 9eb0d775bfed..87e6eefb6b1c 100644 --- a/projects/addon-doc/components/example/example.options.ts +++ b/projects/addon-doc/components/example/example.options.ts @@ -1,5 +1,5 @@ import type {Provider} from '@angular/core'; -import {TUI_EXAMPLE_PRIMARY_FILE_NAME} from '@taiga-ui/addon-doc/interfaces'; +import {TUI_EXAMPLE_PRIMARY_FILE_NAME} from '@taiga-ui/addon-doc/types'; import type {TuiBooleanHandler} from '@taiga-ui/cdk'; import {tuiCreateToken, tuiProvideOptions} from '@taiga-ui/cdk'; import type {PolymorpheusContent} from '@tinkoff/ng-polymorpheus'; diff --git a/projects/addon-doc/components/internal/source-code/source-code.component.ts b/projects/addon-doc/components/internal/source-code/source-code.component.ts index 5d15508b5a59..339199a1ccd5 100644 --- a/projects/addon-doc/components/internal/source-code/source-code.component.ts +++ b/projects/addon-doc/components/internal/source-code/source-code.component.ts @@ -1,10 +1,10 @@ import {ChangeDetectionStrategy, Component, inject, Input} from '@angular/core'; -import type {TuiDocSourceCodePathOptions} from '@taiga-ui/addon-doc/interfaces'; import { TUI_DOC_ICONS, TUI_DOC_SOURCE_CODE, TUI_DOC_SOURCE_CODE_TEXT, } from '@taiga-ui/addon-doc/tokens'; +import type {TuiDocSourceCodePathOptions} from '@taiga-ui/addon-doc/types'; import {tuiPure} from '@taiga-ui/cdk'; import {TuiButtonDirective} from '@taiga-ui/core'; import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus'; diff --git a/projects/addon-doc/components/navigation/navigation.component.ts b/projects/addon-doc/components/navigation/navigation.component.ts index cf057631b1d6..17a867df676a 100644 --- a/projects/addon-doc/components/navigation/navigation.component.ts +++ b/projects/addon-doc/components/navigation/navigation.component.ts @@ -17,13 +17,12 @@ import { Scroll, } from '@angular/router'; import {TuiScrollIntoViewLinkDirective} from '@taiga-ui/addon-doc/directives'; -import type {TuiDocPage} from '@taiga-ui/addon-doc/interfaces'; import { TUI_DOC_ICONS, TUI_DOC_PAGE_LOADED, TUI_DOC_SEARCH_TEXT, } from '@taiga-ui/addon-doc/tokens'; -import type {TuiDocPages} from '@taiga-ui/addon-doc/types'; +import type {TuiDocPage, TuiDocPages} from '@taiga-ui/addon-doc/types'; import {tuiTransliterateKeyboardLayout} from '@taiga-ui/addon-doc/utils'; import {TuiSidebarDirective} from '@taiga-ui/addon-mobile'; import { diff --git a/projects/addon-doc/index.ts b/projects/addon-doc/index.ts index c46e3b20b40b..10135b07b112 100644 --- a/projects/addon-doc/index.ts +++ b/projects/addon-doc/index.ts @@ -1,7 +1,6 @@ export * from './addon-doc.module'; export * from '@taiga-ui/addon-doc/components'; export * from '@taiga-ui/addon-doc/directives'; -export * from '@taiga-ui/addon-doc/interfaces'; export * from '@taiga-ui/addon-doc/pipes'; export * from '@taiga-ui/addon-doc/services'; export * from '@taiga-ui/addon-doc/tokens'; diff --git a/projects/addon-doc/interfaces/index.ts b/projects/addon-doc/interfaces/index.ts deleted file mode 100644 index 2b6d33f33e70..000000000000 --- a/projects/addon-doc/interfaces/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './code-editor'; -export * from './demo-params'; -export * from './page'; -export * from './source-code-path-options'; diff --git a/projects/addon-doc/interfaces/ng-package.json b/projects/addon-doc/interfaces/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-doc/interfaces/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-doc/pipes/markdown/markdown.pipe.ts b/projects/addon-doc/pipes/markdown/markdown.pipe.ts index 8ad40eab233a..e1c37f6eb271 100644 --- a/projects/addon-doc/pipes/markdown/markdown.pipe.ts +++ b/projects/addon-doc/pipes/markdown/markdown.pipe.ts @@ -1,7 +1,7 @@ import type {PipeTransform} from '@angular/core'; import {inject, Pipe, SecurityContext} from '@angular/core'; import {DomSanitizer} from '@angular/platform-browser'; -import type {TuiRawLoaderContent} from '@taiga-ui/addon-doc/interfaces'; +import type {TuiRawLoaderContent} from '@taiga-ui/addon-doc/types'; import {tuiRawLoad} from '@taiga-ui/addon-doc/utils'; import type {TuiSafeHtml, TuiStringHandler} from '@taiga-ui/cdk'; import {TUI_SANITIZER} from '@taiga-ui/core'; diff --git a/projects/addon-doc/tokens/code-editor.ts b/projects/addon-doc/tokens/code-editor.ts index 7afecca1e782..e1235d654dda 100644 --- a/projects/addon-doc/tokens/code-editor.ts +++ b/projects/addon-doc/tokens/code-editor.ts @@ -1,5 +1,5 @@ import {InjectionToken} from '@angular/core'; -import type {TuiCodeEditor} from '@taiga-ui/addon-doc/interfaces'; +import type {TuiCodeEditor} from '@taiga-ui/addon-doc/types'; /** * Service for opening online IDE e.g. Stackblitz diff --git a/projects/addon-doc/tokens/pages.ts b/projects/addon-doc/tokens/pages.ts index 0e607106d5e3..cb18a3f42eb1 100644 --- a/projects/addon-doc/tokens/pages.ts +++ b/projects/addon-doc/tokens/pages.ts @@ -1,7 +1,6 @@ import type {InjectionToken} from '@angular/core'; import {inject} from '@angular/core'; -import type {TuiDocPage} from '@taiga-ui/addon-doc/interfaces'; -import type {TuiDocPages} from '@taiga-ui/addon-doc/types'; +import type {TuiDocPage, TuiDocPages} from '@taiga-ui/addon-doc/types'; import {tuiToFlatMapPages} from '@taiga-ui/addon-doc/utils'; import {tuiCreateToken, tuiCreateTokenFromFactory} from '@taiga-ui/cdk'; diff --git a/projects/addon-doc/tokens/source-code.ts b/projects/addon-doc/tokens/source-code.ts index 3d75acee7d48..43956521515d 100644 --- a/projects/addon-doc/tokens/source-code.ts +++ b/projects/addon-doc/tokens/source-code.ts @@ -1,4 +1,4 @@ -import type {TuiDocSourceCodePathOptions} from '@taiga-ui/addon-doc/interfaces'; +import type {TuiDocSourceCodePathOptions} from '@taiga-ui/addon-doc/types'; import {tuiCreateToken} from '@taiga-ui/cdk'; import type {PolymorpheusContent} from '@tinkoff/ng-polymorpheus'; diff --git a/projects/addon-doc/interfaces/code-editor.ts b/projects/addon-doc/types/code-editor.ts similarity index 100% rename from projects/addon-doc/interfaces/code-editor.ts rename to projects/addon-doc/types/code-editor.ts diff --git a/projects/addon-doc/interfaces/demo-params.ts b/projects/addon-doc/types/demo-params.ts similarity index 100% rename from projects/addon-doc/interfaces/demo-params.ts rename to projects/addon-doc/types/demo-params.ts diff --git a/projects/addon-doc/types/index.ts b/projects/addon-doc/types/index.ts index 23c7929acacb..2b6d33f33e70 100644 --- a/projects/addon-doc/types/index.ts +++ b/projects/addon-doc/types/index.ts @@ -1 +1,4 @@ -export * from './pages'; +export * from './code-editor'; +export * from './demo-params'; +export * from './page'; +export * from './source-code-path-options'; diff --git a/projects/addon-doc/interfaces/page.ts b/projects/addon-doc/types/page.ts similarity index 93% rename from projects/addon-doc/interfaces/page.ts rename to projects/addon-doc/types/page.ts index 696f4e7e6ef9..62690315384d 100644 --- a/projects/addon-doc/interfaces/page.ts +++ b/projects/addon-doc/types/page.ts @@ -1,5 +1,7 @@ import type {PolymorpheusContent} from '@tinkoff/ng-polymorpheus'; +export type TuiDocPages = ReadonlyArray; + export interface TuiDocPageBase { readonly section?: string; readonly title: string; diff --git a/projects/addon-doc/types/pages.ts b/projects/addon-doc/types/pages.ts deleted file mode 100644 index 26f094b3373d..000000000000 --- a/projects/addon-doc/types/pages.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type {TuiDocPage, TuiDocPageGroup} from '@taiga-ui/addon-doc/interfaces'; - -export type TuiDocPages = ReadonlyArray; diff --git a/projects/addon-doc/interfaces/source-code-path-options.ts b/projects/addon-doc/types/source-code-path-options.ts similarity index 100% rename from projects/addon-doc/interfaces/source-code-path-options.ts rename to projects/addon-doc/types/source-code-path-options.ts diff --git a/projects/addon-doc/utils/is-page-group.ts b/projects/addon-doc/utils/is-page-group.ts index e4cda5d0e7ab..a16346b88e86 100644 --- a/projects/addon-doc/utils/is-page-group.ts +++ b/projects/addon-doc/utils/is-page-group.ts @@ -1,4 +1,4 @@ -import type {TuiDocPage, TuiDocPageGroup} from '@taiga-ui/addon-doc/interfaces'; +import type {TuiDocPage, TuiDocPageGroup} from '@taiga-ui/addon-doc/types'; export function tuiIsPageGroup( page: TuiDocPage | TuiDocPageGroup, diff --git a/projects/addon-doc/utils/raw-load-record.ts b/projects/addon-doc/utils/raw-load-record.ts index fe6eca7e183f..5375d2360461 100644 --- a/projects/addon-doc/utils/raw-load-record.ts +++ b/projects/addon-doc/utils/raw-load-record.ts @@ -1,4 +1,4 @@ -import type {TuiDocExample} from '@taiga-ui/addon-doc/interfaces'; +import type {TuiDocExample} from '@taiga-ui/addon-doc/types'; import {tuiRawLoad} from './raw-load'; diff --git a/projects/addon-doc/utils/raw-load.ts b/projects/addon-doc/utils/raw-load.ts index 62febdc23e77..7bb861d07d15 100644 --- a/projects/addon-doc/utils/raw-load.ts +++ b/projects/addon-doc/utils/raw-load.ts @@ -1,4 +1,4 @@ -import type {TuiRawLoaderContent} from '@taiga-ui/addon-doc/interfaces'; +import type {TuiRawLoaderContent} from '@taiga-ui/addon-doc/types'; export async function tuiRawLoad(content: TuiRawLoaderContent): Promise { return content instanceof Promise ? (await content).default : content; diff --git a/projects/addon-doc/utils/sort-pages.ts b/projects/addon-doc/utils/sort-pages.ts index 9adfa8e0bac0..005f6b5b44c8 100644 --- a/projects/addon-doc/utils/sort-pages.ts +++ b/projects/addon-doc/utils/sort-pages.ts @@ -1,4 +1,4 @@ -import type {TuiDocPage, TuiDocPageGroup} from '@taiga-ui/addon-doc/interfaces'; +import type {TuiDocPage, TuiDocPageGroup} from '@taiga-ui/addon-doc/types'; import {tuiIsPageGroup} from './is-page-group'; diff --git a/projects/addon-doc/utils/to-flat-map-pages.ts b/projects/addon-doc/utils/to-flat-map-pages.ts index da146ac53c0c..0d94788ef75f 100644 --- a/projects/addon-doc/utils/to-flat-map-pages.ts +++ b/projects/addon-doc/utils/to-flat-map-pages.ts @@ -1,6 +1,5 @@ /// -import type {TuiDocPage} from '@taiga-ui/addon-doc/interfaces'; -import type {TuiDocPages} from '@taiga-ui/addon-doc/types'; +import type {TuiDocPage, TuiDocPages} from '@taiga-ui/addon-doc/types'; function assertTitle(page: TuiDocPage, map: Map): void { if (map.has(page.title) && map.get(page.title)?.route !== page.route) { diff --git a/projects/addon-mobile/components/mobile-calendar-dialog/mobile-calendar-dialog.component.ts b/projects/addon-mobile/components/mobile-calendar-dialog/mobile-calendar-dialog.component.ts index 31c91d5116d5..ac94c6589af0 100644 --- a/projects/addon-mobile/components/mobile-calendar-dialog/mobile-calendar-dialog.component.ts +++ b/projects/addon-mobile/components/mobile-calendar-dialog/mobile-calendar-dialog.component.ts @@ -3,9 +3,16 @@ import {TuiMobileCalendarComponent} from '@taiga-ui/addon-mobile/components/mobi import type {TuiBooleanHandler, TuiDay, TuiDayRange} from '@taiga-ui/cdk'; import {TUI_FALSE_HANDLER, TUI_FIRST_DAY, TUI_LAST_DAY} from '@taiga-ui/cdk'; import type {TuiDialogContext} from '@taiga-ui/core'; -import type {TuiMobileCalendarData} from '@taiga-ui/kit'; import {POLYMORPHEUS_CONTEXT} from '@tinkoff/ng-polymorpheus'; +export interface TuiMobileCalendarData { + disabledItemHandler?: TuiBooleanHandler; + max?: TuiDay | null; + min?: TuiDay | null; + multi?: boolean; + single?: boolean; +} + /** * @deprecated in favor of dropdown * TODO: remove before 4.0 diff --git a/projects/addon-mobile/const/index.ts b/projects/addon-mobile/const/index.ts deleted file mode 100644 index 4a9197c8b6fb..000000000000 --- a/projects/addon-mobile/const/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './mobile-alert-options'; diff --git a/projects/addon-mobile/const/mobile-alert-options.ts b/projects/addon-mobile/const/mobile-alert-options.ts deleted file mode 100644 index 798a8042a041..000000000000 --- a/projects/addon-mobile/const/mobile-alert-options.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type {TuiDialogOptions} from '@taiga-ui/core'; - -const MOBILE_ALERT_OPTIONS: TuiMobileAlertOptions = { - size: 'fullscreen', - closeable: false, -}; - -export type TuiMobileAlertOptions = Omit< - TuiDialogOptions, - 'appearance' | 'data' | 'dismissible' | 'header' | 'label' | 'required' ->; - -export type TuiIosAlertOptions = Omit< - TuiDialogOptions, - 'appearance' | 'data' | 'header' | 'label' | 'required' ->; - -export const TUI_IOS_ALERT_OPTIONS: TuiIosAlertOptions = { - dismissible: false, - ...MOBILE_ALERT_OPTIONS, -}; - -export type TuiAndroidAlertOptions = TuiIosAlertOptions; - -export const TUI_ANDROID_ALERT_OPTIONS: TuiAndroidAlertOptions = { - dismissible: true, - ...MOBILE_ALERT_OPTIONS, -}; diff --git a/projects/addon-mobile/const/ng-package.json b/projects/addon-mobile/const/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-mobile/const/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-mobile/index.ts b/projects/addon-mobile/index.ts index 189b4e1c0c45..4f0af1480b2d 100644 --- a/projects/addon-mobile/index.ts +++ b/projects/addon-mobile/index.ts @@ -1,7 +1,5 @@ export * from '@taiga-ui/addon-mobile/components'; -export * from '@taiga-ui/addon-mobile/const'; export * from '@taiga-ui/addon-mobile/directives'; -export * from '@taiga-ui/addon-mobile/interfaces'; export * from '@taiga-ui/addon-mobile/services'; export * from '@taiga-ui/addon-mobile/types'; export * from '@taiga-ui/addon-mobile/utils'; diff --git a/projects/addon-mobile/interfaces/index.ts b/projects/addon-mobile/interfaces/index.ts deleted file mode 100644 index e0a8ae8dc44e..000000000000 --- a/projects/addon-mobile/interfaces/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './mobile-alert-data'; diff --git a/projects/addon-mobile/interfaces/mobile-alert-data.ts b/projects/addon-mobile/interfaces/mobile-alert-data.ts deleted file mode 100644 index 837bbb23de02..000000000000 --- a/projects/addon-mobile/interfaces/mobile-alert-data.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type {PolymorpheusContent} from '@tinkoff/ng-polymorpheus'; - -export interface TuiMobileAlertData { - readonly confirmText?: string; - readonly content: PolymorpheusContent; - readonly heading?: string; -} diff --git a/projects/addon-mobile/interfaces/ng-package.json b/projects/addon-mobile/interfaces/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-mobile/interfaces/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-table/components/table/directives/row.directive.ts b/projects/addon-table/components/table/directives/row.directive.ts index 2f24a743a8d2..c2088273b145 100644 --- a/projects/addon-table/components/table/directives/row.directive.ts +++ b/projects/addon-table/components/table/directives/row.directive.ts @@ -1,5 +1,5 @@ import {Directive, inject, Input, TemplateRef} from '@angular/core'; -import type {TuiRowContext} from '@taiga-ui/addon-table/interfaces'; +import type {TuiRowContext} from '@taiga-ui/addon-table/types'; /** * @deprecated use `*ngFor` + `tuiTableSort`-pipe instead. diff --git a/projects/addon-table/interfaces/index.ts b/projects/addon-table/interfaces/index.ts deleted file mode 100644 index 6ff9a191420b..000000000000 --- a/projects/addon-table/interfaces/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './row-context'; diff --git a/projects/addon-table/interfaces/ng-package.json b/projects/addon-table/interfaces/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-table/interfaces/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-table/types/index.ts b/projects/addon-table/types/index.ts index 0c908bf58f75..fb781c2c4444 100644 --- a/projects/addon-table/types/index.ts +++ b/projects/addon-table/types/index.ts @@ -1 +1,2 @@ export * from './comparator'; +export * from './row-context'; diff --git a/projects/addon-table/interfaces/row-context.ts b/projects/addon-table/types/row-context.ts similarity index 100% rename from projects/addon-table/interfaces/row-context.ts rename to projects/addon-table/types/row-context.ts diff --git a/projects/addon-tablebars/classes/table-bar.ts b/projects/addon-tablebars/classes/table-bar.ts index fc035b655d93..ad89dfd89ea0 100644 --- a/projects/addon-tablebars/classes/table-bar.ts +++ b/projects/addon-tablebars/classes/table-bar.ts @@ -1,7 +1,12 @@ import type {PolymorpheusContent} from '@tinkoff/ng-polymorpheus'; import type {Observer} from 'rxjs'; -import type {TuiTableBarOptions} from '../interfaces/table-bar-options'; +export interface TuiTableBarOptions { + readonly adaptive?: boolean; + readonly hasCloseButton?: boolean; + // TODO: rename before 4.0 + readonly mode?: 'onDark' | 'onLight'; +} export class TuiTableBar { public readonly adaptive: boolean; diff --git a/projects/addon-tablebars/index.ts b/projects/addon-tablebars/index.ts index 1bd25f6b6d78..8c51a58c3c0d 100644 --- a/projects/addon-tablebars/index.ts +++ b/projects/addon-tablebars/index.ts @@ -1,4 +1,3 @@ export * from './classes/table-bar'; export * from './components/table-bars-host/table-bars-host.component'; -export * from './interfaces/table-bar-options'; export * from './services/table-bars.service'; diff --git a/projects/addon-tablebars/interfaces/table-bar-options.ts b/projects/addon-tablebars/interfaces/table-bar-options.ts deleted file mode 100644 index 8317d2cb062e..000000000000 --- a/projects/addon-tablebars/interfaces/table-bar-options.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface TuiTableBarOptions { - readonly adaptive?: boolean; - readonly hasCloseButton?: boolean; - // TODO: rename before 4.0 - readonly mode?: 'onDark' | 'onLight'; -} diff --git a/projects/addon-tablebars/services/table-bars.service.ts b/projects/addon-tablebars/services/table-bars.service.ts index 1999342eb629..69c2f8a21f3e 100644 --- a/projects/addon-tablebars/services/table-bars.service.ts +++ b/projects/addon-tablebars/services/table-bars.service.ts @@ -3,8 +3,8 @@ import {Injectable} from '@angular/core'; import type {PolymorpheusContent} from '@tinkoff/ng-polymorpheus'; import {Observable, ReplaySubject} from 'rxjs'; +import type {TuiTableBarOptions} from '../classes/table-bar'; import {TuiTableBar} from '../classes/table-bar'; -import type {TuiTableBarOptions} from '../interfaces/table-bar-options'; const NO_HOST = 'Table bars are disabled, enable support by adding TuiTableBarsHostModule to your main app module ' + diff --git a/projects/demo/src/modules/components/abstract/control.ts b/projects/demo/src/modules/components/abstract/control.ts index 99883e37bcb7..9a278c31348f 100644 --- a/projects/demo/src/modules/components/abstract/control.ts +++ b/projects/demo/src/modules/components/abstract/control.ts @@ -86,10 +86,6 @@ export abstract class AbstractExampleTuiControl public filler = ''; - public minHeight: number | null = null; - - public maxHeight: number | null = null; - public readonly iconLeftVariants = ['', 'tuiIconMailLarge', 'tuiIconPieChartLarge']; public iconLeft = this.iconLeftVariants[0]; diff --git a/projects/demo/src/modules/components/calendar-month/index.html b/projects/demo/src/modules/components/calendar-month/index.html index 3d04e9a71d73..1f0e4a6ba520 100644 --- a/projects/demo/src/modules/components/calendar-month/index.html +++ b/projects/demo/src/modules/components/calendar-month/index.html @@ -28,7 +28,9 @@ @@ -64,6 +66,22 @@ > Minimal month + + Maximum length + + + Minimum length + diff --git a/projects/demo/src/modules/components/input-month-range/examples/3/index.html b/projects/demo/src/modules/components/input-month-range/examples/3/index.html index ed560bacda64..6628db76cb1a 100644 --- a/projects/demo/src/modules/components/input-month-range/examples/3/index.html +++ b/projects/demo/src/modules/components/input-month-range/examples/3/index.html @@ -1,14 +1,8 @@ -

- A sample with - disabledItemHandler - when selecting a left value of range changes available right value: a range no more than one month -

-
Choose a range of months diff --git a/projects/demo/src/modules/components/input-month-range/examples/3/index.ts b/projects/demo/src/modules/components/input-month-range/examples/3/index.ts index 982ca7c65f2c..4ad4d1462e84 100644 --- a/projects/demo/src/modules/components/input-month-range/examples/3/index.ts +++ b/projects/demo/src/modules/components/input-month-range/examples/3/index.ts @@ -2,9 +2,7 @@ import {Component} from '@angular/core'; import {FormControl, FormGroup} from '@angular/forms'; import {changeDetection} from '@demo/emulate/change-detection'; import {encapsulation} from '@demo/emulate/encapsulation'; -import type {TuiMonth} from '@taiga-ui/cdk'; -import {TuiMonthRange} from '@taiga-ui/cdk'; -import type {TuiBooleanHandlerWithContext, TuiMonthContext} from '@taiga-ui/kit'; +import type {TuiMonthRange} from '@taiga-ui/cdk'; @Component({ selector: 'tui-input-month-range-example-3', @@ -16,14 +14,4 @@ export class TuiInputMonthRangeExample3 { protected readonly testForm = new FormGroup({ testValue: new FormControl(null), }); - - protected readonly disabledItemHandler: TuiBooleanHandlerWithContext< - TuiMonth, - TuiMonthContext - > = (item: TuiMonth, context?: TuiMonthContext) => - !!context && - !!context.value && - context.value instanceof TuiMonthRange && - !!context.value.isSingleMonth && - item.month < context.value.from.month + 2; } diff --git a/projects/demo/src/modules/components/input-month-range/input-month-range.component.ts b/projects/demo/src/modules/components/input-month-range/input-month-range.component.ts index 67dac4174199..42fc36e222bf 100644 --- a/projects/demo/src/modules/components/input-month-range/input-month-range.component.ts +++ b/projects/demo/src/modules/components/input-month-range/input-month-range.component.ts @@ -2,7 +2,7 @@ import {Component} from '@angular/core'; import {FormControl, Validators} from '@angular/forms'; import {changeDetection} from '@demo/emulate/change-detection'; import type {TuiDocExample} from '@taiga-ui/addon-doc'; -import type {TuiMonthRange} from '@taiga-ui/cdk'; +import type {TuiBooleanHandler, TuiMonthRange} from '@taiga-ui/cdk'; import { TUI_FALSE_HANDLER, TUI_FIRST_DAY, @@ -11,7 +11,6 @@ import { TuiMonth, tuiProvide, } from '@taiga-ui/cdk'; -import type {TuiBooleanHandlerWithContext, TuiMonthContext} from '@taiga-ui/kit'; import {AbstractExampleTuiControl} from '../abstract/control'; import {ABSTRACT_PROPS_ACCESSOR} from '../abstract/inherited-documentation/abstract-props-accessor'; @@ -24,6 +23,7 @@ import {ABSTRACT_PROPS_ACCESSOR} from '../abstract/inherited-documentation/abstr }) export class ExampleTuiInputMonthRangeComponent extends AbstractExampleTuiControl { public override cleaner = false; + public override maxLength = 0; public control = new FormControl(null, Validators.required); @@ -62,9 +62,10 @@ export class ExampleTuiInputMonthRangeComponent extends AbstractExampleTuiContro protected min = this.minVariants[0]; protected max = this.maxVariants[0]; + protected minLength = 0; protected readonly disabledItemHandlerVariants: ReadonlyArray< - TuiBooleanHandlerWithContext + TuiBooleanHandler > = [TUI_FALSE_HANDLER, ({month}) => month % 3 === 0]; protected disabledItemHandler = this.disabledItemHandlerVariants[0]; diff --git a/projects/demo/src/modules/components/input-month-range/input-month-range.template.html b/projects/demo/src/modules/components/input-month-range/input-month-range.template.html index ea25d5f9c127..24e5c29ff2b4 100644 --- a/projects/demo/src/modules/components/input-month-range/input-month-range.template.html +++ b/projects/demo/src/modules/components/input-month-range/input-month-range.template.html @@ -31,7 +31,7 @@ @@ -46,7 +46,9 @@ [focusable]="focusable" [formControl]="control" [max]="max" + [maxLength]="maxLength" [min]="min" + [minLength]="minLength" [pseudoActive]="pseudoPressed" [pseudoFocus]="pseudoFocused" [pseudoHover]="pseudoHovered" @@ -78,7 +80,7 @@ @@ -104,6 +106,22 @@ > Maximum date + + Maximum length + + + Minimum length + diff --git a/projects/kit/components/calendar-month/calendar-month.component.ts b/projects/kit/components/calendar-month/calendar-month.component.ts index 25e030acb56b..570bdb26c676 100644 --- a/projects/kit/components/calendar-month/calendar-month.component.ts +++ b/projects/kit/components/calendar-month/calendar-month.component.ts @@ -19,9 +19,7 @@ import { tuiPure, } from '@taiga-ui/cdk'; import type {TuiRangeState, TuiWithOptionalMinMax} from '@taiga-ui/core'; -import type {TuiMonthContext} from '@taiga-ui/kit/interfaces'; import {TUI_CALENDAR_MONTHS} from '@taiga-ui/kit/tokens'; -import type {TuiBooleanHandlerWithContext} from '@taiga-ui/kit/types'; const TODAY = TuiDay.currentLocal(); @@ -39,8 +37,13 @@ export class TuiCalendarMonthComponent implements TuiWithOptionalMinMax = - TUI_FALSE_HANDLER; + public disabledItemHandler: TuiBooleanHandler = TUI_FALSE_HANDLER; + + @Input() + public minLength: number | null = null; + + @Input() + public maxLength: number | null = null; @Input() public min: TuiMonth | null = TUI_FIRST_DAY; @@ -162,6 +165,8 @@ export class TuiCalendarMonthComponent implements TuiWithOptionalMinMax, + disabledItemHandler: TuiBooleanHandler, value: TuiMonth | TuiMonthRange | null, min: TuiMonth, max: TuiMonth, + minLength: number | null, + maxLength: number | null, ): TuiBooleanHandler { - return item => - item.monthBefore(min) || - item.monthAfter(max) || - disabledItemHandler(item, {value}); + return item => { + const delta = + value instanceof TuiMonthRange && value.isSingleMonth + ? Math.abs( + item.year * 12 + + item.month - + value.from.year * 12 - + value.from.month, + ) + : 0; + + const tooLong = delta && maxLength && delta > maxLength; + const tooShort = delta && minLength && delta < minLength; + + return ( + tooLong || + tooShort || + item.monthBefore(min) || + item.monthAfter(max) || + disabledItemHandler(item) + ); + }; } private updateHoveredItem(month: TuiMonth | null): void { diff --git a/projects/kit/components/input-month-range/input-month-range.component.ts b/projects/kit/components/input-month-range/input-month-range.component.ts index 7308f7d135cb..772da32d5673 100644 --- a/projects/kit/components/input-month-range/input-month-range.component.ts +++ b/projects/kit/components/input-month-range/input-month-range.component.ts @@ -6,7 +6,12 @@ import { Input, ViewChild, } from '@angular/core'; -import type {TuiFocusableElementAccessor, TuiMonth, TuiYear} from '@taiga-ui/cdk'; +import type { + TuiBooleanHandler, + TuiFocusableElementAccessor, + TuiMonth, + TuiYear, +} from '@taiga-ui/cdk'; import { AbstractTuiNullableControl, CHAR_EN_DASH, @@ -23,11 +28,9 @@ import { TuiMonthPipe, TuiPrimitiveTextfieldComponent, } from '@taiga-ui/core'; -import type {TuiMonthContext} from '@taiga-ui/kit/interfaces'; import {TUI_MONTH_FORMATTER_PROVIDER} from '@taiga-ui/kit/providers'; import type {TuiInputDateOptions} from '@taiga-ui/kit/tokens'; import {TUI_INPUT_DATE_OPTIONS, TUI_MONTH_FORMATTER} from '@taiga-ui/kit/tokens'; -import type {TuiBooleanHandlerWithContext} from '@taiga-ui/kit/types'; @Component({ selector: 'tui-input-month-range', @@ -58,8 +61,13 @@ export class TuiInputMonthRangeComponent public max: TuiMonth = this.options.max; @Input() - public disabledItemHandler: TuiBooleanHandlerWithContext = - TUI_FALSE_HANDLER; + public disabledItemHandler: TuiBooleanHandler = TUI_FALSE_HANDLER; + + @Input() + public minLength: number | null = null; + + @Input() + public maxLength: number | null = null; @Input() public defaultActiveYear: TuiYear = TuiDay.currentLocal(); diff --git a/projects/kit/components/input-month-range/input-month-range.template.html b/projects/kit/components/input-month-range/input-month-range.template.html index 9208e8b8e61f..db9642b203fd 100644 --- a/projects/kit/components/input-month-range/input-month-range.template.html +++ b/projects/kit/components/input-month-range/input-month-range.template.html @@ -34,7 +34,9 @@ ; - max?: TuiDay | null; - min?: TuiDay | null; - multi?: boolean; - single?: boolean; -} diff --git a/projects/kit/interfaces/month-context.ts b/projects/kit/interfaces/month-context.ts deleted file mode 100644 index 32fc5e157636..000000000000 --- a/projects/kit/interfaces/month-context.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type {TuiMonth, TuiMonthRange} from '@taiga-ui/cdk'; - -export interface TuiMonthContext { - value: TuiMonth | TuiMonthRange | null; -} diff --git a/projects/kit/interfaces/ng-package.json b/projects/kit/interfaces/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/kit/interfaces/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/kit/types/handler-with-context.ts b/projects/kit/types/handler-with-context.ts deleted file mode 100644 index 33203ffa8afb..000000000000 --- a/projects/kit/types/handler-with-context.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type TuiHandlerWithContext< - I, - O, - C extends Record = Record, -> = (item: I, context?: C) => O; - -export type TuiBooleanHandlerWithContext< - I, - C extends Record = Record, -> = TuiHandlerWithContext; diff --git a/projects/kit/types/index.ts b/projects/kit/types/index.ts index d3955118ed1d..b90adc80a70b 100644 --- a/projects/kit/types/index.ts +++ b/projects/kit/types/index.ts @@ -1,5 +1,4 @@ export * from './dropdown-position'; -export * from './handler-with-context'; export * from './key-steps'; export * from './status'; export * from './step-state';