-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from arturovt/feat/config-lib
feat: add `@ngneat/helipopper/config`
- Loading branch information
Showing
16 changed files
with
143 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json", | ||
"lib": { | ||
"entryFile": "src/public-api.ts" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...cts/ngneat/helipopper/src/lib/defaults.ts → .../ngneat/helipopper/config/src/defaults.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { inject } from '@angular/core'; | ||
|
||
import { TIPPY_REF, type TippyInstance } from './tippy.types'; | ||
|
||
export function injectTippyRef(): TippyInstance { | ||
const instance = inject(TIPPY_REF, { optional: true }); | ||
|
||
if (instance) { | ||
return instance; | ||
} | ||
|
||
throw new Error('tp is not provided in the current context or on one of its ancestors'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { makeEnvironmentProviders, type Provider } from '@angular/core'; | ||
|
||
import { | ||
TIPPY_CONFIG, | ||
TIPPY_LOADER, | ||
type TippyLoader, | ||
type TippyConfig, | ||
} from './tippy.types'; | ||
|
||
export function provideTippyLoader(loader: TippyLoader) { | ||
return makeEnvironmentProviders([{ provide: TIPPY_LOADER, useValue: loader }]); | ||
} | ||
|
||
export function provideTippyConfig(config: TippyConfig): Provider { | ||
return { provide: TIPPY_CONFIG, useValue: config }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export { tooltipVariation, popperVariation, withContextMenuVariation } from './defaults'; | ||
export { | ||
CreateOptions, | ||
TippyInstance, | ||
TippyProps, | ||
ExtendedTippyProps, | ||
TippyElement, | ||
ExtendedTippyInstance, | ||
TippyConfig, | ||
TippyLoader, | ||
TIPPY_LOADER, | ||
TIPPY_REF, | ||
TIPPY_CONFIG, | ||
} from './tippy.types'; | ||
export { provideTippyLoader, provideTippyConfig } from './providers'; | ||
export { injectTippyRef } from './inject-tippy'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
export { TippyDirective } from './lib/tippy.directive'; | ||
export { tooltipVariation, popperVariation, withContextMenuVariation } from './lib/defaults'; | ||
export { TippyService } from './lib/tippy.service'; | ||
export { inView, overflowChanges } from './lib/utils'; | ||
export { ExtendedTippyInstance, TippyInstance, TIPPY_REF, TippyConfig, TIPPY_CONFIG } from './lib/tippy.types'; | ||
export { provideTippyConfig, injectTippyRef } from './lib/providers'; | ||
|
||
export { | ||
ExtendedTippyInstance, | ||
TippyInstance, | ||
TIPPY_REF, | ||
TippyConfig, | ||
TIPPY_CONFIG, | ||
tooltipVariation, | ||
popperVariation, | ||
withContextMenuVariation, | ||
provideTippyConfig, | ||
injectTippyRef, | ||
} from '@ngneat/helipopper/config'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters