UNPKG

flowbite-angular

Version:

<div align="center"> <h1>:construction: flowbite-angular (unreleased) :construction:</h1> <p> <a href="https://flowbite.com"> <img alt="Flowbite - Tailwind CSS components" width="350" src="https://flowbite.s3.amazonaws.com/github/logo-github

1 lines 4.57 kB
{"version":3,"file":"flowbite-angular.mjs","sources":["../../../../libs/flowbite-angular/common/type-definitions/flowbite.boolean.ts","../../../../libs/flowbite-angular/common/flowbite.theme.service.ts","../../../../libs/flowbite-angular/common/base-component.directive.ts","../../../../libs/flowbite-angular/common/flowbite-angular.ts"],"sourcesContent":["/**\n * Base definition of boolean used in flowbite-angular.\n */\nexport interface FlowbiteBoolean {\n enabled: string;\n disabled: string;\n}\n\n/**\n * This function cast a boolean to the internal flowbute-angular boolean type.\n *\n * @param value The input to be cast.\n * @returns enabled if value is true ; disabled if value is false.\n */\nexport function booleanToFlowbiteBoolean(value: boolean): keyof FlowbiteBoolean {\n return value ? 'enabled' : 'disabled';\n}\n","import type { FlowbiteClass } from './type-definitions';\n\n/**\n * Provide an abstract class used in theming system of flowbite-angular.\n */\nexport abstract class FlowbiteThemeService<TProperties> {\n /**\n * This function prepare the component's classes, based on properties, used in the template of the component.\n *\n * @param properties Properties of the component being styled.\n */\n public abstract getClasses(properties: TProperties): FlowbiteClass;\n}\n","import type { FlowbiteClass } from './type-definitions/flowbite.class';\n\nimport { generateId, Guid } from 'flowbite-angular/utils';\n\nimport type { OnInit } from '@angular/core';\nimport { afterNextRender, computed, Directive, inject, Injector, signal } from '@angular/core';\n\n/**\n * Base abstract component.\n * Every flowbite-angular components has to extends on this one.\n */\n@Directive({\n standalone: true,\n host: {\n '[class]': 'this.contentClasses().rootClass',\n '[attr.flowbite-id]': 'this.flowbiteId()',\n },\n})\nexport abstract class BaseComponent<TClass extends FlowbiteClass> implements OnInit {\n /**\n * `Injector` instance injected to be used as an injector context where there is no default one.\n *\n * @example\n * ```\n * public ngOnInit(): void {\n * afterNextRender(\n * () => {},\n * { injector: this.injector }\n * );\n * }\n * ```\n */\n public readonly injector = inject(Injector);\n\n /**\n * Auto generated GUID for each flowbite-angular component\n *\n * Its default value is 00000000-0000-0000-0000-000000000000, and is set to a random GUID inside the `afterNextRender` hook\n */\n public readonly flowbiteId = signal<Guid>(new Guid(Guid.empty));\n\n /**\n * Computed signal storing the component classes used in its template\n */\n public contentClasses = computed<TClass>(() => this.fetchClass());\n\n /**\n * Initialize component.\n *\n * A call to verify and init function is done. Then a new Guid is set in the `afterNextRender` hook.\n */\n public ngOnInit(): void {\n this.init();\n\n afterNextRender(\n () => {\n this.flowbiteId.set(generateId());\n },\n { injector: this.injector }\n );\n }\n\n /**\n * Function loaded during `OnInit` lifecycle hook. It initialize requirments for the component.\n */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n public init(): void {}\n\n /**\n * Function to load component's classes\n */\n public abstract fetchClass(): TClass;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAQA;;;;;AAKG;AACG,SAAU,wBAAwB,CAAC,KAAc,EAAA;IACrD,OAAO,KAAK,GAAG,SAAS,GAAG,UAAU;AACvC;;ACdA;;AAEG;MACmB,oBAAoB,CAAA;AAOzC;;ACLD;;;AAGG;MAQmB,aAAa,CAAA;AAPnC,IAAA,WAAA,GAAA;AAQE;;;;;;;;;;;;AAYG;AACa,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAE3C;;;;AAIG;QACa,IAAU,CAAA,UAAA,GAAG,MAAM,CAAO,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE/D;;AAEG;QACI,IAAc,CAAA,cAAA,GAAG,QAAQ,CAAS,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;AA4BlE;AA1BC;;;;AAIG;IACI,QAAQ,GAAA;QACb,IAAI,CAAC,IAAI,EAAE;QAEX,eAAe,CACb,MAAK;YACH,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,CA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