UNPKG

@nebular/theme

Version:
1,475 lines (1,437 loc) 578 kB
import * as i0 from '@angular/core'; import { InjectionToken, ModuleWithProviders, OnChanges, OnInit, ElementRef, Renderer2, EventEmitter, Type, SimpleChanges, ViewContainerRef, AfterContentChecked, AfterViewInit, ChangeDetectorRef, NgZone, QueryList, TemplateRef, ComponentRef, Injector, EmbeddedViewRef, DestroyableInjector, OnDestroy, DoCheck, PipeTransform, AfterContentInit, SimpleChange, Provider, IterableDiffers, AfterViewChecked } from '@angular/core'; import * as rxjs from 'rxjs'; import { Observable, Subject, Subscription, ReplaySubject, BehaviorSubject } from 'rxjs'; import * as i4 from '@angular/common'; import { TranslationWidth, DatePipe, Location, NgClass } from '@angular/common'; import * as i2 from '@angular/forms'; import { ControlValueAccessor, Validator, ValidatorFn, ValidationErrors } from '@angular/forms'; import * as i3 from '@angular/router'; import { Router, Params, QueryParamsHandling, RouterLink, RouterLinkActive, ActivatedRoute } from '@angular/router'; import * as _nebular_theme from '@nebular/theme'; import { DomSanitizer, SafeHtml, SafeStyle } from '@angular/platform-browser'; import * as i1 from '@angular/cdk/overlay'; import { ViewportRuler, ScrollStrategyOptions, ScrollDispatcher, BlockScrollStrategy, Overlay, OverlayConfig, OverlayRef, OverlayPositionBuilder, OverlayContainer, FlexibleConnectedPositionStrategy, PositionStrategy, ConnectedPosition, ComponentType, ConnectedOverlayPositionChange, ConnectionPositionPair, ScrollStrategy, GlobalPositionStrategy, CdkScrollable } from '@angular/cdk/overlay'; import * as i2$1 from '@angular/cdk/portal'; import { CdkPortalOutlet, ComponentPortal, TemplatePortal, CdkPortal, Portal } from '@angular/cdk/portal'; import { Platform } from '@angular/cdk/platform'; import { FocusMonitor, FocusTrap, InteractivityChecker, FocusTrapFactory, FocusableOption, FocusKeyManager, Highlightable, ActiveDescendantKeyManager, ListKeyManager } from '@angular/cdk/a11y'; import { Directionality, BidiModule } from '@angular/cdk/bidi'; import { CdkCellDef, CdkHeaderCellDef, CdkFooterCellDef, CdkColumnDef, CdkHeaderCell, CdkFooterCell, CdkCell, DataSource, DataRowOutlet, HeaderRowOutlet, FooterRowOutlet, NoDataRowOutlet, CdkCellOutlet, CdkHeaderRowDef, CdkFooterRowDef, CdkRowDef, CdkHeaderRow, CdkFooterRow, CdkRow, CdkTable, RenderRow, RowContext, StickyPositioningListener, CdkTableModule } from '@angular/cdk/table'; import * as _angular_cdk_collections from '@angular/cdk/collections'; import { _ViewRepeater, CollectionViewer, ListRange } from '@angular/cdk/collections'; /** * Media breakpoint type * * Where `name` - breakpoint name alias (e.g. xs, sm, md, etc), and width - min breakpoint width */ interface NbMediaBreakpoint { name: string; width: number; } declare const DEFAULT_MEDIA_BREAKPOINTS: { name: string; width: number; }[]; /** * Manages media breakpoints * * Provides access to available media breakpoints to convert window width to a configured breakpoint, * e.g. 200px - *xs* breakpoint */ declare class NbMediaBreakpointsService { private breakpoints; private breakpointsMap; constructor(breakpoints: any); /** * Returns a configured breakpoint by width * @param width number * @returns {Z|{name: string, width: number}} */ getByWidth(width: number): NbMediaBreakpoint; /** * Returns a configured breakpoint by name * @param name string * @returns NbMediaBreakpoint */ getByName(name: string): NbMediaBreakpoint; /** * Returns a list of configured breakpoints for the theme * @returns NbMediaBreakpoint[] */ getBreakpoints(): NbMediaBreakpoint[]; /** * Returns a map of configured breakpoints for the theme * @returns {[p: string]: number} */ getBreakpointsMap(): { [breakpoint: string]: number; }; static ɵfac: i0.ɵɵFactoryDeclaration<NbMediaBreakpointsService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NbMediaBreakpointsService>; } interface NbJSThemeOptions { name: string; base?: string; variables?: NbJSThemeVariable; } interface NbJSThemeVariable { [key: string]: string | string[] | NbJSThemeVariable; } /** * @license * Copyright Akveo. All Rights Reserved. * Licensed under the MIT License. See License.txt in the project root for license information. */ interface NbThemeOptions { name: string; } declare const NB_THEME_OPTIONS: InjectionToken<NbThemeOptions>; declare const NB_MEDIA_BREAKPOINTS: InjectionToken<NbMediaBreakpoint[]>; declare const NB_BUILT_IN_JS_THEMES: InjectionToken<NbJSThemeOptions[]>; declare const NB_JS_THEMES: InjectionToken<NbJSThemeOptions[]>; /** * We're providing browser apis with tokens to improve testing capabilities. * */ declare const NB_WINDOW: InjectionToken<Window>; declare const NB_DOCUMENT: InjectionToken<Document>; /** * Layout direction. * */ declare enum NbLayoutDirection { LTR = "ltr", RTL = "rtl" } /** * Layout direction setting injection token. * */ declare const NB_LAYOUT_DIRECTION: InjectionToken<NbLayoutDirection>; /** * Layout Direction Service. * Allows to set or get layout direction and listen to its changes */ declare class NbLayoutDirectionService { private direction; private $directionChange; constructor(direction?: NbLayoutDirection); /** * Returns true if layout direction set to left to right. * @returns boolean. * */ isLtr(): boolean; /** * Returns true if layout direction set to right to left. * @returns boolean. * */ isRtl(): boolean; /** * Returns current layout direction. * @returns NbLayoutDirection. * */ getDirection(): NbLayoutDirection; /** * Sets layout direction * @param {NbLayoutDirection} direction */ setDirection(direction: NbLayoutDirection): void; /** * Triggered when direction was changed. * @returns Observable<NbLayoutDirection>. */ onDirectionChange(): Observable<NbLayoutDirection>; static ɵfac: i0.ɵɵFactoryDeclaration<NbLayoutDirectionService, [{ optional: true; }]>; static ɵprov: i0.ɵɵInjectableDeclaration<NbLayoutDirectionService>; } /** * @license * Copyright Akveo. All Rights Reserved. * Licensed under the MIT License. See License.txt in the project root for license information. */ declare function windowFactory(platformId: Object): Window | undefined; declare class NbThemeModule { /** * Main Theme Module * * @param nbThemeOptions {NbThemeOptions} Main theme options * @param nbJSThemes {NbJSThemeOptions[]} List of JS Themes, will be merged with default themes * @param nbMediaBreakpoints {NbMediaBreakpoint} Available media breakpoints * @param layoutDirection {NbLayoutDirection} Layout direction * * @returns {ModuleWithProviders} */ static forRoot(nbThemeOptions?: NbThemeOptions, nbJSThemes?: NbJSThemeOptions[], nbMediaBreakpoints?: NbMediaBreakpoint[], layoutDirection?: NbLayoutDirection): ModuleWithProviders<NbThemeModule>; static ɵfac: i0.ɵɵFactoryDeclaration<NbThemeModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<NbThemeModule, never, [typeof i4.CommonModule], never>; static ɵinj: i0.ɵɵInjectorDeclaration<NbThemeModule>; } declare const BUILT_IN_THEMES: NbJSThemeOptions[]; /** * Js Themes registry - provides access to the JS themes' variables. * Usually shouldn't be used directly, but through the NbThemeService class methods (getJsTheme). */ declare class NbJSThemesRegistry { private themes; constructor(builtInThemes: NbJSThemeOptions[], newThemes?: NbJSThemeOptions[]); /** * Registers a new JS theme * @param config any * @param themeName string * @param baseTheme string */ register(config: any, themeName: string, baseTheme: string): void; /** * Checks whether the theme is registered * @param themeName * @returns boolean */ has(themeName: string): boolean; /** * Return a theme * @param themeName * @returns NbJSThemeOptions */ get(themeName: string): NbJSThemeOptions; private combineByNames; private isObject; private mergeDeep; static ɵfac: i0.ɵɵFactoryDeclaration<NbJSThemesRegistry, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NbJSThemesRegistry>; } /** * Main Nebular service. Includes various helper methods. */ declare class NbThemeService { protected options: any; private breakpointService; private jsThemesRegistry; currentTheme: string; private themeChanges$; private appendLayoutClass$; private removeLayoutClass$; private changeWindowWidth$; constructor(options: any, breakpointService: NbMediaBreakpointsService, jsThemesRegistry: NbJSThemesRegistry); /** * Change current application theme * @param {string} name */ changeTheme(name: string): void; changeWindowWidth(width: number): void; /** * Returns a theme object with variables (color/paddings/etc) on a theme change. * Once subscribed - returns current theme. * * @returns {Observable<NbJSThemeOptions>} */ getJsTheme(): Observable<NbJSThemeOptions>; /** * Triggers media query breakpoint change * Returns a pair where the first item is previous media breakpoint and the second item is current breakpoit. * ```ts * [{ name: 'xs', width: 0 }, { name: 'md', width: 768 }] // change from `xs` to `md` * ``` * @returns {Observable<[NbMediaBreakpoint, NbMediaBreakpoint]>} */ onMediaQueryChange(): Observable<NbMediaBreakpoint[]>; /** * Triggered when current theme is changed * @returns {Observable<any>} */ onThemeChange(): Observable<any>; /** * Append a class to nb-layout * @param {string} className */ appendLayoutClass(className: string): void; /** * Triggered when a new class is added to nb-layout through `appendLayoutClass` method * @returns {Observable<any>} */ onAppendLayoutClass(): Observable<any>; /** * Removes a class from nb-layout * @param {string} className */ removeLayoutClass(className: string): void; /** * Triggered when a class is removed from nb-layout through `removeLayoutClass` method * @returns {Observable<any>} */ onRemoveLayoutClass(): Observable<any>; static ɵfac: i0.ɵɵFactoryDeclaration<NbThemeService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NbThemeService>; } /** * Service to control the global page spinner. */ declare class NbSpinnerService { private document; private loaders; private selector; constructor(document: any); /** * Appends new loader to the list of loader to be completed before * spinner will be hidden * @param method Promise<any> */ registerLoader(method: Promise<any>): void; /** * Clears the list of loader */ clear(): void; /** * Start the loader process, show spinnder and execute loaders */ load(): void; private executeAll; private showSpinner; private hideSpinner; private getSpinnerElement; static ɵfac: i0.ɵɵFactoryDeclaration<NbSpinnerService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NbSpinnerService>; } declare class NbColorHelper { static shade(color: any, weight: any): string; static tint(color: any, weight: any): string; static mix(color1: any, color2: any, weight: any): string; static hexToRgbA(hex: any, alpha: any): string; } /** * Scroll position type */ interface NbScrollPosition { /** * x - left * @type {number} */ x: number; /** * y - top * @type {number} */ y: number; } /** * Layout scroll service. Provides information about current scroll position, * as well as methods to update position of the scroll. * * The reason we added this service is that in Nebular there are two scroll modes: * - the default mode when scroll is on body * - and the `withScroll` mode, when scroll is removed from the body and moved to an element inside of the * `nb-layout` component */ declare class NbLayoutScrollService { private scrollPositionReq$; private manualScroll$; private scroll$; private scrollable$; /** * Returns scroll position * * @returns {Observable<NbScrollPosition>} */ getPosition(): Observable<NbScrollPosition>; /** * Sets scroll position * * @param {number} x * @param {number} y */ scrollTo(x?: number, y?: number): void; /** * Returns a stream of scroll events * * @returns {Observable<any>} */ onScroll(): Observable<any>; /** * @private * @returns Observable<NbScrollPosition>. */ onManualScroll(): Observable<NbScrollPosition>; /** * @private * @returns {Subject<any>} */ onGetPosition(): Subject<any>; onScrollableChange(): Observable<boolean>; /** * @private * @param {any} event */ fireScrollChange(event: any): void; scrollable(scrollable: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration<NbLayoutScrollService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NbLayoutScrollService>; } /** * Layout dimensions type */ interface NbLayoutDimensions { /** * clientWidth * @type {number} */ clientWidth: number; /** * clientHeight * @type {number} */ clientHeight: number; /** * scrollWidth * @type {number} */ scrollWidth: number; /** * scrollHeight * @type {number} */ scrollHeight: number; } /** * Simple helper service to return Layout dimensions * Depending of current Layout scroll mode (default or `withScroll` when scroll is moved to an element * inside of the layout) corresponding dimensions will be returns - of `documentElement` in first case and * `.scrollable-container` in the second. */ declare class NbLayoutRulerService { private contentDimensionsReq$; /** * Content dimensions * @returns {Observable<NbLayoutDimensions>} */ getDimensions(): Observable<NbLayoutDimensions>; /** * @private * @returns {Subject<any>} */ onGetDimensions(): Subject<any>; static ɵfac: i0.ɵɵFactoryDeclaration<NbLayoutRulerService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NbLayoutRulerService>; } type NbComponentStatus = 'basic' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'control'; type NbComponentOrCustomStatus = NbComponentStatus | string; declare class NbStatusService { readonly coreStatuses: NbComponentStatus[]; isCoreStatus(status: NbComponentOrCustomStatus): boolean; isCustomStatus(status: NbComponentOrCustomStatus): boolean; getStatusClass(status: NbComponentOrCustomStatus): string | undefined; protected isValidStatusString(status: NbComponentOrCustomStatus): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<NbStatusService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NbStatusService>; } declare const CORPORATE_THEME: NbJSThemeOptions; declare const COSMIC_THEME: NbJSThemeOptions; declare const DEFAULT_THEME: NbJSThemeOptions; declare const DARK_THEME: NbJSThemeOptions; type NbComponentSize = 'tiny' | 'small' | 'medium' | 'large' | 'giant'; type NbComponentShape = 'rectangle' | 'semi-round' | 'round'; /** * Component intended to be used within the `<nb-card>` component. * It adds styles for a preset header section. * * @styles * * card-header-text-color: * card-header-text-font-family: * card-header-text-font-size: * card-header-text-font-weight: * card-header-text-line-height: * card-header-basic-background-color: * card-header-basic-text-color: * card-header-primary-background-color: * card-header-primary-text-color: * card-header-info-background-color: * card-header-info-text-color: * card-header-success-background-color: * card-header-success-text-color: * card-header-warning-background-color: * card-header-warning-text-color: * card-header-danger-background-color: * card-header-danger-text-color: * card-header-control-background-color: * card-header-control-text-color: */ declare class NbCardHeaderComponent { static ɵfac: i0.ɵɵFactoryDeclaration<NbCardHeaderComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NbCardHeaderComponent, "nb-card-header", never, {}, {}, never, ["*"], false, never>; } /** * Component intended to be used within the `<nb-card>` component. * Adds styles for a preset body section. */ declare class NbCardBodyComponent { static ɵfac: i0.ɵɵFactoryDeclaration<NbCardBodyComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NbCardBodyComponent, "nb-card-body", never, {}, {}, never, ["*"], false, never>; } /** * Component intended to be used within the `<nb-card>` component. * Adds styles for a preset footer section. */ declare class NbCardFooterComponent { static ɵfac: i0.ɵɵFactoryDeclaration<NbCardFooterComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NbCardFooterComponent, "nb-card-footer", never, {}, {}, never, ["*"], false, never>; } /** * Basic content container component. * * Basic card example: * @stacked-example(Showcase, card/card-showcase.component) * * Basic card configuration: * * ```html * <nb-card> * <nb-card-body> * Card * </nb-card-body> * </nb-card> * ``` * * ### Installation * * Import `NbCardModule` to your feature module. * ```ts * @NgModule({ * imports: [ * // ... * NbCardModule, * ], * }) * export class PageModule { } * ``` * ### Usage * * Card with header and footer: * @stacked-example(With Header & Footer, card/card-full.component) * * Most of the time main card content goes to `nb-card-body`, * so it is styled and aligned in accordance with the header and footer. * In case you need a higher level of control, you can pass contend directly to `nb-card`, * so `nb-card-body` styling will not be applied. * * Consider an example with `nb-list` component: * @stacked-example(Card with list, card/card-without-body.component) * * Colored cards could be simply configured by providing a `status` property: * @stacked-example(Colored Card, card/card-colors.component) * * It is also possible to assign an `accent` property for a slight card highlight * as well as combine it with `status`: * @stacked-example(Accent Card, card/card-accents.component) * * Cards of smaller sizes could be combined and put on the same row with a bigger card so they have the same heights. * @stacked-example(Card sizes combinations, card/card-sizes-combinations.component) * * @additional-example(Multiple Sizes, card/card-sizes.component) * * @styles * * card-background-color: * card-text-color: * card-text-font-family: * card-text-font-size: * card-text-font-weight: * card-text-line-height: * card-border-width: * card-border-style: * card-border-color: * card-border-radius: * card-padding: * card-shadow: * card-divider-color: * card-divider-style: * card-divider-width: * card-height-tiny: * card-height-small: * card-height-medium: * card-height-large: * card-height-giant: * card-margin-bottom: * card-scrollbar-color: * card-scrollbar-background-color: * card-scrollbar-width: */ declare class NbCardComponent { protected statusService: NbStatusService; /** * Card size, available sizes: * tiny, small, medium, large, giant */ get size(): '' | NbComponentSize; set size(value: '' | NbComponentSize); _size: '' | NbComponentSize; /** * Card status: * `basic`, `primary`, `info`, `success`, `warning`, `danger`, `control` */ status: '' | NbComponentOrCustomStatus; /** * Card accent (color of the top border): * `basic`, `primary`, `info`, `success`, `warning`, `danger`, `control` */ accent: '' | NbComponentStatus; get tiny(): boolean; get small(): boolean; get medium(): boolean; get large(): boolean; get giant(): boolean; get primary(): boolean; get info(): boolean; get success(): boolean; get warning(): boolean; get danger(): boolean; get basic(): boolean; get control(): boolean; get hasAccent(): "" | NbComponentStatus; get primaryAccent(): boolean; get infoAccent(): boolean; get successAccent(): boolean; get warningAccent(): boolean; get dangerAccent(): boolean; get basicAccent(): boolean; get controlAccent(): boolean; get additionalClasses(): string[]; constructor(statusService: NbStatusService); static ɵfac: i0.ɵɵFactoryDeclaration<NbCardComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NbCardComponent, "nb-card", never, { "size": { "alias": "size"; "required": false; }; "status": { "alias": "status"; "required": false; }; "accent": { "alias": "accent"; "required": false; }; }, {}, never, ["nb-card-header", "nb-card-body", "*", "nb-card-footer"], false, never>; } /** * * Reveal card example: * @stacked-example(My example, reveal-card/reveal-card-showcase.component) * * As a content Reveal card accepts two instances of `nb-card` - for front and back sides. * * Basic reveal card configuration: * * ```html * <nb-reveal-card> * <nb-card-front> * <nb-card> * <nb-card-body> * Front * </nb-card-body> * </nb-card> * </nb-card-front> * <nb-card-back> * <nb-card> * <nb-card-body> * Back * </nb-card-body> * </nb-card> * </nb-card-back> * </nb-reveal-card> * ``` * * ### Installation * * Import `NbCardModule` to your feature module. * ```ts * @NgModule({ * imports: [ * // ... * NbCardModule, * ], * }) * export class PageModule { } * ``` * ### Usage * * Reveal Card with header and footer: * @stacked-example(With Header & Footer, reveal-card/reveal-card-full.component) * * Colored reveal-cards could be simply configured by providing a `status` property: * @stacked-example(Colored Card, reveal-card/reveal-card-colors.component) * * It is also possible to assign an `accent` property for a slight card highlight * as well as combine it with `status`: * @stacked-example(Accent Card, reveal-card/reveal-card-accents.component) * * @additional-example(Multiple Sizes, reveal-card/reveal-card-sizes.component) */ declare class NbRevealCardComponent { /** * Reveal state * @type boolean */ revealed: boolean; /** * Show/hide toggle button to be able to control toggle from your code * @type {boolean} */ showToggleButton: boolean; toggle(): void; static ɵfac: i0.ɵɵFactoryDeclaration<NbRevealCardComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NbRevealCardComponent, "nb-reveal-card", never, { "revealed": { "alias": "revealed"; "required": false; }; "showToggleButton": { "alias": "showToggleButton"; "required": false; }; }, {}, never, ["nb-card-front", "nb-card-back"], false, never>; } /** * * Flip card example: * @stacked-example(Showcase, flip-card/flip-card-showcase.component) * * As a content Flip card accepts two instances of `nb-card` - for front and back sides. * * Basic flip card configuration: * * ```html * <nb-flip-card> * <nb-card-front> * <nb-card> * <nb-card-body> * Front * </nb-card-body> * </nb-card> * </nb-card-front> * <nb-card-back> * <nb-card> * <nb-card-body> * Back * </nb-card-body> * </nb-card> * </nb-card-back> * </nb-flip-card> * ``` * * ### Installation * * Import `NbCardModule` to your feature module. * ```ts * @NgModule({ * imports: [ * // ... * NbCardModule, * ], * }) * export class PageModule { } * ``` * ### Usage * * Flip Card with header and footer: * @stacked-example(With Header & Footer, flip-card/flip-card-full.component.ts) * * Colored flip-cards could be simply configured by providing a `status` property: * @stacked-example(Colored Card, flip-card/flip-card-colors.component) * * It is also possible to assign an `accent` property for a slight card highlight * as well as combine it with `status`: * @stacked-example(Accent Card, flip-card/flip-card-accents.component) * * @additional-example(Multiple Sizes, flip-card/flip-card-sizes.component) * */ declare class NbFlipCardComponent { /** * Flip state * @type boolean */ flipped: boolean; /** * Show/hide toggle button to be able to control toggle from your code * @type {boolean} */ showToggleButton: boolean; toggle(): void; static ɵfac: i0.ɵɵFactoryDeclaration<NbFlipCardComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NbFlipCardComponent, "nb-flip-card", never, { "flipped": { "alias": "flipped"; "required": false; }; "showToggleButton": { "alias": "showToggleButton"; "required": false; }; }, {}, never, ["nb-card-front", "nb-card-back"], false, never>; } /** * Component intended to be used within the `<nb-flip-card>` and `<nb-reveal-card>` components. * * Use it as a container for the front card. */ declare class NbCardFrontComponent { static ɵfac: i0.ɵɵFactoryDeclaration<NbCardFrontComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NbCardFrontComponent, "nb-card-front", never, {}, {}, never, ["nb-card"], false, never>; } /** * Component intended to be used within the `<nb-flip-card>` and `<nb-reveal-card>` components. * * Use it as a container for the back card. */ declare class NbCardBackComponent { static ɵfac: i0.ɵɵFactoryDeclaration<NbCardBackComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NbCardBackComponent, "nb-card-back", never, {}, {}, never, ["nb-card"], false, never>; } declare class NbSharedModule { static ɵfac: i0.ɵɵFactoryDeclaration<NbSharedModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<NbSharedModule, never, never, [typeof i4.CommonModule, typeof i2.FormsModule, typeof i3.RouterModule]>; static ɵinj: i0.ɵɵInjectorDeclaration<NbSharedModule>; } interface NbIconOptions { [name: string]: any; } interface NbIcon { getClasses(options?: NbIconOptions): string[]; getContent(options?: NbIconOptions): string; } declare class NbFontIcon implements NbIcon { protected name: any; protected content: any; protected params: NbFontIconPackParams; constructor(name: any, content: any, params?: NbFontIconPackParams); getClasses(options?: NbIconOptions): string[]; getContent(options?: NbIconOptions): string; } declare class NbSvgIcon implements NbIcon { protected name: any; protected content: any; protected params: NbIconPackParams; constructor(name: any, content: any, params?: NbIconPackParams); getClasses(options?: NbIconOptions): string[]; getContent(options?: NbIconOptions): string; } interface NbIcons { [key: string]: NbIcon | string; } declare enum NbIconPackType { SVG = "svg", FONT = "font" } interface NbIconPackParams { packClass?: string; [name: string]: any; } interface NbFontIconPackParams extends NbIconPackParams { iconClassPrefix?: string; } interface NbIconPack { name: string; type: NbIconPackType; icons: Map<string, NbIcon | string>; params: NbIconPackParams; } declare class NbIconDefinition { name: string; type: string; pack: string; icon: NbIcon; } /** * This service allows to register multiple icon packs to use them later within `<nb-icon></nb-icon>` component. */ declare class NbIconLibraries { protected packs: Map<string, NbIconPack>; protected defaultPack: NbIconPack; /** * Registers new Svg icon pack * @param {string} name * @param {NbIcon} icons * @param {NbIconPackParams} params */ registerSvgPack(name: string, icons: NbIcons, params?: NbIconPackParams): void; /** * Registers new font pack * @param {string} name * @param {NbIconPackParams} params */ registerFontPack(name: string, params?: NbFontIconPackParams): void; /** * Returns pack by name * @param {string} name */ getPack(name: string): NbIconPack; /** * Sets pack as a default * @param {string} name */ setDefaultPack(name: string): void; /** * Returns Svg icon * @param {string} name * @param {string} pack * * @returns NbIconDefinition */ getSvgIcon(name: string, pack?: string): NbIconDefinition | null; /** * Returns Font icon * @param {string} name * @param {string} pack * * @returns NbIconDefinition */ getFontIcon(name: string, pack?: string): NbIconDefinition; /** * Returns an icon * @param {string} name * @param {string} pack * * @returns NbIconDefinition */ getIcon(name: string, pack?: string): NbIconDefinition | null; protected createSvgIcon(name: string, content: NbIcon | string, params: NbIconPackParams): NbSvgIcon; protected createFontIcon(name: string, content: NbIcon | string, params: NbFontIconPackParams): NbFontIcon; protected getPackOrThrow(name: string): NbIconPack; protected getDefaultPackOrThrow(): NbIconPack; protected getIconFromPack(name: string, pack: NbIconPack): NbIcon | string | null; static ɵfac: i0.ɵɵFactoryDeclaration<NbIconLibraries, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NbIconLibraries>; } interface NbIconConfig { icon: string; pack?: string; status?: NbComponentOrCustomStatus; options?: { [name: string]: any; }; } /** * Icon component. Allows to render both `svg` and `font` icons. * Starting from Nebular 4.0 uses [Eva Icons](https://akveo.github.io/eva-icons/) pack by default. * * Basic icon example: * @stacked-example(Showcase, icon/icon-showcase.component) * * Icon configuration: * * ```html * <nb-icon icon="star"></nb-icon> * ``` * ### Installation * * By default Nebular comes without any pre-installed icon pack. * Starting with Nebular 4.0.0 we ship separate package called `@nebular/eva-icons` * which integrates SVG [Eva Icons](https://akveo.github.io/eva-icons/) pack to Nebular. To add it to your * project run: * ```sh * npm i eva-icons @nebular/eva-icons * ``` * This command will install Eva Icons pack. Then register `NbEvaIconsModule` into your app module: * ```ts * import { NbEvaIconsModule } from '@nebular/eva-icons'; * * @NgModule({ * imports: [ * // ... * NbEvaIconsModule, * ], * }) * export class AppModule { } * ``` * Last thing, import `NbIconModule` to your feature module where you need to show an icon: * ```ts * import { NbIconModule } from '@nebular/theme'; * * @NgModule({ * imports: [ * // ... * NbIconModule, * ], * }) * export class PageModule { } * ``` * ### Usage * * Icon can be colored using `status` input: * ```html * <nb-icon icon="star" status="warning"></nb-icon> * ``` * * Colored icons: * @stacked-example(Colored Icons, icon/icon-colors.component) * * In case you need to specify an icon from a specific icon pack, this could be done using `pack` input property: * ```html * <nb-icon icon="star" pack="font-awesome"></nb-icon> * ``` * Additional icon settings (if available by the icon pack) could be passed using `options` input: * * ```html * <nb-icon icon="star" [options]="{ animation: { type: 'zoom' } }"></nb-icon> * ``` * * @styles * * icon-font-size: * icon-line-height: * icon-width: * icon-height: * icon-svg-vertical-align: * icon-basic-color: * icon-primary-color: * icon-info-color: * icon-success-color: * icon-warning-color: * icon-danger-color: * icon-control-color: */ declare class NbIconComponent implements NbIconConfig, OnChanges, OnInit { protected sanitizer: DomSanitizer; protected iconLibrary: NbIconLibraries; protected el: ElementRef; protected renderer: Renderer2; protected statusService: NbStatusService; protected iconDef: any; protected prevClasses: any[]; html: SafeHtml; get primary(): boolean; get info(): boolean; get success(): boolean; get warning(): boolean; get danger(): boolean; get basic(): boolean; get control(): boolean; get additionalClasses(): string[]; /** * Icon name * @param {string} status */ icon: string; /** * Icon pack name * @param {string} status */ pack: string; /** * Additional icon settings * @param {[name: string]: any} */ options: { [name: string]: any; }; /** * Icon status (adds specific styles): * `basic`, `primary`, `info`, `success`, `warning`, `danger`, `control` */ status?: NbComponentOrCustomStatus; /** * Sets all icon configurable properties via config object. * If passed value is a string set icon name. * @docs-private */ get config(): string | NbIconConfig; set config(value: string | NbIconConfig); protected _config: string | NbIconConfig; constructor(sanitizer: DomSanitizer, iconLibrary: NbIconLibraries, el: ElementRef, renderer: Renderer2, statusService: NbStatusService); ngOnInit(): void; ngOnChanges(): void; renderIcon(name: string, pack?: string, options?: { [name: string]: any; }): _nebular_theme.NbIconDefinition; protected clearIcon(): void; protected assignClasses(classes: string[]): void; static ɵfac: i0.ɵɵFactoryDeclaration<NbIconComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NbIconComponent, "nb-icon", never, { "icon": { "alias": "icon"; "required": false; }; "pack": { "alias": "pack"; "required": false; }; "options": { "alias": "options"; "required": false; }; "status": { "alias": "status"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, {}, never, never, false, never>; } declare class NbIconModule { private iconsLibrary; private essentialsPackName; constructor(iconsLibrary: NbIconLibraries); static ɵfac: i0.ɵɵFactoryDeclaration<NbIconModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<NbIconModule, [typeof NbIconComponent], [typeof i4.CommonModule], [typeof NbIconComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<NbIconModule>; } declare class NbCardModule { static ɵfac: i0.ɵɵFactoryDeclaration<NbCardModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<NbCardModule, [typeof NbCardComponent, typeof NbCardBodyComponent, typeof NbCardFooterComponent, typeof NbCardHeaderComponent, typeof NbRevealCardComponent, typeof NbFlipCardComponent, typeof NbCardFrontComponent, typeof NbCardBackComponent], [typeof NbSharedModule, typeof NbIconModule], [typeof NbCardComponent, typeof NbCardBodyComponent, typeof NbCardFooterComponent, typeof NbCardHeaderComponent, typeof NbRevealCardComponent, typeof NbFlipCardComponent, typeof NbCardFrontComponent, typeof NbCardBackComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<NbCardModule>; } /** * @license * Copyright Akveo. All Rights Reserved. * Licensed under the MIT License. See License.txt in the project root for license information. */ interface NbCalendarDay { name: string; isHoliday: boolean; } type NbCalendarViewModeValues = 'year' | 'month' | 'date'; declare enum NbCalendarViewMode { YEAR = "year", MONTH = "month", DATE = "date" } type NbCalendarSizeValues = 'medium' | 'large'; declare enum NbCalendarSize { MEDIUM = "medium", LARGE = "large" } interface NbCalendarCell<D, T> { date: D; select: EventEmitter<D>; selectedValue?: T; visibleDate?: D; min?: D; max?: D; filter?: (D: any) => boolean; size?: NbCalendarSize; } /** * @license * Copyright Akveo. All Rights Reserved. * Licensed under the MIT License. See License.txt in the project root for license information. */ type NbNullableInput = string | null | undefined; type NbBooleanInput = boolean | NbNullableInput; /** * @license * Copyright Akveo. All Rights Reserved. * Licensed under the MIT License. See License.txt in the project root for license information. */ /** * Calendar component provides a capability to choose a date. * * ```html * <nb-calendar [(date)]="date"></nb-calendar> * <nb-calendar [date]="date" (dateChange)="handleDateChange($event)"></nb-calendar> * ``` * * Basic usage example * @stacked-example(Showcase, calendar/calendar-showcase.component) * * ### Installation * * Import `NbCalendarModule` to your feature module. * ```ts * @NgModule({ * imports: [ * // ... * NbCalendarModule, * ], * }) * export class PageModule { } * ``` * ### Usage * * If you want to select ranges you can use `NbCalendarRangeComponent`. * * ```html * <nb-calendar-range [(range)]="range"></nb-calendar-range> * <nb-calendar-range [range]="range" (rangeChange)="handleRangeChange($event)"></nb-calendar-range> * ``` * * In order to use it, you have to import `NbCalendarRangeModule`. * @stacked-example(Range, calendar/calendar-range-showcase.component) * * The calendar component is supplied with a calendar navigation that contains navigate buttons. * If you do not want to use it you can hide calendar navigation using `showNavigation` property. * @stacked-example(Without navigation, calendar/calendar-without-navigation.component) * * As you can see in the basic usage example calendar contains previous and next month days * which can be disabled using `boundingMonth` property. * @stacked-example(Bounding months, calendar/calendar-bounding-month.component) * * You can define starting view of the calendar by setting `startView` property. * Available values: year, month and date. * @stacked-example(Start view, calendar/calendar-start-view.component) * * You can use a larger version of the calendar by defining size property. * Available values: medium(which is default) and large. * @stacked-example(Size, calendar/calendar-size.component) * * Calendar supports min and max dates which disables values out of min-max range. * @stacked-example(Borders, calendar/calendar-min-max.component) * * Also, you can define custom filter property that should be predicate which receives * date and returns false if this date has to be disabled. In this example, we provide the filter * which disables weekdays. * @stacked-example(Filter, calendar/calendar-filter.component) * * Week numbers column could be enabled via `showWeekNumber` binding: * @stacked-example(Week number, calendar/calendar-week-number.component) * * If you need create custom cells you can easily provide custom components for * calendar. For examples if you want to show any average price under each date you can * just provide custom `dayCellComponent`. Custom cells for month and year can be provided * the same way, check API reference. * @stacked-example(Custom day cell, calendar/calendar-custom-day-cell-showcase.component) * * @styles * * calendar-width: * calendar-background-color: * calendar-border-color: * calendar-border-style: * calendar-border-width: * calendar-border-radius: * calendar-text-color: * calendar-text-font-family: * calendar-text-font-size: * calendar-text-font-weight: * calendar-text-line-height: * calendar-picker-padding-top: * calendar-picker-padding-bottom: * calendar-picker-padding-start: * calendar-picker-padding-end: * calendar-navigation-text-color: * calendar-navigation-text-font-family: * calendar-navigation-title-text-font-size: * calendar-navigation-title-text-font-weight: * calendar-navigation-title-text-line-height: * calendar-navigation-padding: * calendar-cell-inactive-text-color: * calendar-cell-disabled-text-color: * calendar-cell-hover-background-color: * calendar-cell-hover-border-color: * calendar-cell-hover-text-color: * calendar-cell-hover-text-font-size: * calendar-cell-hover-text-font-weight: * calendar-cell-hover-text-line-height: * calendar-cell-active-background-color: * calendar-cell-active-border-color: * calendar-cell-active-text-color: * calendar-cell-active-text-font-size: * calendar-cell-active-text-font-weight: * calendar-cell-active-text-line-height: * calendar-cell-today-background-color: * calendar-cell-today-border-color: * calendar-cell-today-text-color: * calendar-cell-today-text-font-size: * calendar-cell-today-text-font-weight: * calendar-cell-today-text-line-height: * calendar-cell-today-hover-background-color: * calendar-cell-today-hover-border-color: * calendar-cell-today-active-background-color: * calendar-cell-today-active-border-color: * calendar-cell-today-disabled-border-color: * calendar-cell-today-selected-background-color: * calendar-cell-today-selected-border-color: * calendar-cell-today-selected-text-color: * calendar-cell-today-selected-hover-background-color: * calendar-cell-today-selected-hover-border-color: * calendar-cell-today-selected-active-background-color: * calendar-cell-today-selected-active-border-color: * calendar-cell-today-in-range-background-color: * calendar-cell-today-in-range-border-color: * calendar-cell-today-in-range-text-color: * calendar-cell-today-in-range-hover-background-color: * calendar-cell-today-in-range-hover-border-color: * calendar-cell-today-in-range-active-background-color: * calendar-cell-today-in-range-active-border-color: * calendar-cell-selected-background-color: * calendar-cell-selected-border-color: * calendar-cell-selected-text-color: * calendar-cell-selected-text-font-size: * calendar-cell-selected-text-font-weight: * calendar-cell-selected-text-line-height: * calendar-cell-selected-hover-background-color: * calendar-cell-selected-hover-border-color: * calendar-cell-selected-active-background-color: * calendar-cell-selected-active-border-color: * calendar-day-cell-width: * calendar-day-cell-height: * calendar-month-cell-width: * calendar-month-cell-height: * calendar-year-cell-width: * calendar-year-cell-height: * calendar-weekday-background: * calendar-weekday-divider-color: * calendar-weekday-divider-width: * calendar-weekday-text-color: * calendar-weekday-text-font-size: * calendar-weekday-text-font-weight: * calendar-weekday-text-line-height: * calendar-weekday-holiday-text-color: * calendar-weekday-height: * calendar-weekday-width: * calendar-weeknumber-background: * calendar-weeknumber-divider-color: * calendar-weeknumber-divider-width: * calendar-weeknumber-text-color: * calendar-weeknumber-text-font-size: * calendar-weeknumber-text-font-weight: * calendar-weeknumber-text-line-height: * calendar-weeknumber-height: * calendar-weeknumber-width: * calendar-large-width: * calendar-day-cell-large-width: * calendar-day-cell-large-height: * calendar-weekday-large-height: * calendar-weekday-large-width: * calendar-weeknumber-large-height: * calendar-weeknumber-large-width: * calendar-month-cell-large-width: * calendar-month-cell-large-height: * calendar-year-cell-large-width: * calendar-year-cell-large-height: * */ declare class NbCalendarComponent<D> { /** * Defines if we should render previous and next months * in the current month view. * */ boundingMonth: boolean; /** * Defines starting view for calendar. * */ startView: NbCalendarViewMode; static ngAcceptInputType_startView: NbCalendarViewModeValues; /** * Minimum available date for selection. * */ min: D; /** * Maximum available date for selection. * */ max: D; /** * Predicate that decides which cells will be disabled. * */ filter: (D: any) => boolean; /** * Custom day cell component. Have to implement `NbCalendarCell` interface. * */ dayCellComponent: Type<NbCalendarCell<D, D>>; /** * Custom month cell component. Have to implement `NbCalendarCell` interface. * */ monthCellComponent: Type<NbCalendarCell<D, D>>; /** * Custom year cell component. Have to implement `NbCalendarCell` interface. * */ yearCellComponent: Type<NbCalendarCell<D, D>>; /** * Size of the calendar and entire components. * Can be 'medium' which is default or 'large'. * */ size: NbCalendarSize; static ngAcceptInputType_size: NbCalendarSizeValues; visibleDate: D; /** * Determines should we show calendars navigation or not. * */ showNavigation: boolean; /** * Date which will be rendered as selected. * */ date: D; /** * Determines should we show week numbers column. * False by default. * */ get showWeekNumber(): boolean; set showWeekNumber(value: boolean); protected _showWeekNumber: boolean; static ngAcceptInputType_showWeekNumber: NbBooleanInput; /** * Sets symbol used as a header for week numbers column * */ weekNumberSymbol: string; /** * Sets first day of the week, it can be 1 if week starts from monday and 0 if from sunday and so on. * `undefined` means that default locale setting will be used. * */ firstDayOfWeek: number | undefined; /** * Emits date when selected. * */ dateChange: EventEmitter<D>; static ɵfac: i0.ɵɵFactoryDeclaration<NbCalendarComponent<any>, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NbCalendarComponent<any>, "nb-calendar", never, { "boundingMonth": { "alias": "boundingMonth"; "required": false; }; "startView": { "alias": "startView"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; "dayCellComponent": { "alias": "dayCellComponent"; "required": false; }; "monthCellComponent": { "alias": "monthCellComponent"; "required": false; }; "yearCellComponent": { "alias": "yearCellComponent"; "required": false; }; "size": { "alias": "size"; "required": false; }; "visibleDate": { "alias": "visibleDate"; "required": false; }; "showNavigation": { "alias": "showNavigation"; "required": false; }; "date": { "alias": "date"; "required": false; }; "showWeekNumber": { "alias": "showWeekNumber"; "required": false; }; "weekNumberSymbol": { "alias": "weekNumberSymbol"; "required": false; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; }; }, { "dateChange": "dateChange"; }, never, never, false, never>; } declare const enum NbDayPeriod { AM = "AM",// before midday, 0 - 11 in 24-hour format. PM = "PM" } declare abstract class NbDateService<D> { readonly DAYS_IN_WEEK: number; /** * Number of hours in AM/PM day periods. **/ readonly HOURS_IN_DAY_PERIOD = 12; protected locale: string; setLocale(locale: any): void; /** * Checks if the date is between the start date and the end date. * */ isBetween(date: D, start: D, end: D): boolean; /** * Checks is two dates have the same day. * */ isSameDaySafe(date1: D, date2: D): boolean; /** * Checks is two dates have the same month. * */ isSameMonthSafe(date1: D, date2: D): boolean; /** * Checks is two dates have the same year. * */ isSameYearSafe(date1: D, date2: D): boolean; /** * Returns date with selected hour * */ abstract setHours(date: D, hour: number): D; /** * Returns date with selected minute * */ abstract setMinutes(date: D, minute: number): D; /** * Returns date with selected second * */ abstract setSeconds(date: D, second: number): D; /** * Returns date with selected milliseconds * */ abstract setMilliseconds(date: D, second: number): D; /** * Returns true if date string is valid date string according to the provided format. * */ abstract isValidDateString(date: string, format: string): boolean; /** * Returns true if time string is valid time string according to the provided format. * */ abstract isValidTimeString(date: string, format: string): boolean; /** * Returns today date. * */ abstract today(): D; /** * Gets the time format based on locale * */ abstract getLocaleTimeFormat(): string; /** * Gets the date of the month component of the given date. */ abstract getDate(date: D): number; /** * Gets the hour component of the given date. */ abstract getHours(date: D): number; /** * Gets the minute component of the given date. */ abstract getMinutes(date: D): number; /** * Gets the second component of the given date. */ abstract getSeconds(date: D): number; /** * Gets the second component of the given date. */ abstract getMilliseconds(date: D): number; /** * Gets the month component of the given date. * */ abstract getMonth(date: D): number; /** * Gets the year component of the given date. * */ abstract getYear(date: D): number; /** * Returns day of the week of the given date. */ abstract getDayOfWeek(date: D): number; /** * Returns first day of the week, it can be 1 if week starts from monday * and 0 if from sunday and so on. * */ abstract getFirstDayOfWeek(): number; /** * Returns localized month name by date and style. * */ abstract getMonthName(date: D, style?: TranslationWidth): string; /** * Returns localized month name by month index and style. * */ abstract getMonthNameByIndex(month: number, style?: TranslationWidth): string; /** * Returns localized days names. * */ abstract getDayOfWeekNames(style?: TranslationWidth): string[]; /** * Parses the date string according to the passed format. * */ abstract parse(date: string, format: string): D; /** * Transforms the da