ng-primitives 0.48.0 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/visually-hidden/visually-hidden-state.d.ts +1 -36
- package/accordion/accordion/accordion-state.d.ts +1 -12
- package/accordion/accordion-content/accordion-content.d.ts +1 -12
- package/accordion/accordion-item/accordion-item-state.d.ts +1 -12
- package/avatar/avatar/avatar-state.d.ts +1 -5
- package/avatar/avatar-image/avatar-image.d.ts +1 -36
- package/button/button/button-state.d.ts +1 -6
- package/checkbox/checkbox/checkbox-state.d.ts +1 -12
- package/combobox/combobox/combobox-state.d.ts +1 -44
- package/combobox/combobox-button/combobox-button.d.ts +1 -44
- package/combobox/combobox-dropdown/combobox-dropdown.d.ts +1 -44
- package/combobox/combobox-input/combobox-input.d.ts +1 -45
- package/combobox/combobox-option/combobox-option.d.ts +1 -44
- package/dialog/dialog/dialog-state.d.ts +1 -17
- package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
- package/fesm2022/ng-primitives-accordion.mjs +8 -6
- package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/ng-primitives-button.mjs.map +1 -1
- package/fesm2022/ng-primitives-checkbox.mjs +3 -2
- package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
- package/fesm2022/ng-primitives-form-field.mjs +2 -2
- package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-input.mjs +8 -2
- package/fesm2022/ng-primitives-input.mjs.map +1 -1
- package/fesm2022/ng-primitives-listbox.mjs +12 -7
- package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-meter.mjs.map +1 -1
- package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/ng-primitives-radio.mjs +18 -7
- package/fesm2022/ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/ng-primitives-search.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +8 -2
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-slider.mjs +8 -2
- package/fesm2022/ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/ng-primitives-state.mjs +53 -7
- package/fesm2022/ng-primitives-state.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +11 -4
- package/fesm2022/ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/ng-primitives-textarea.mjs +11 -2
- package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle-group.mjs +19 -7
- package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle.mjs +3 -2
- package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/file-upload/file-dropzone/file-dropzone-state.d.ts +1 -16
- package/file-upload/file-upload/file-upload-state.d.ts +1 -21
- package/focus-trap/focus-trap/focus-trap-state.d.ts +1 -28
- package/form-field/description/description.d.ts +1 -25
- package/form-field/error/error.d.ts +1 -25
- package/form-field/form-control/form-control-state.d.ts +1 -5
- package/form-field/form-control/form-control.d.ts +2 -2
- package/form-field/form-field/form-field-state.d.ts +1 -25
- package/form-field/label/label.d.ts +1 -25
- package/input/input/input-state.d.ts +1 -14
- package/input/input/input.d.ts +5 -1
- package/listbox/listbox/listbox-state.d.ts +1 -25
- package/menu/menu-trigger/menu-trigger-state.d.ts +1 -22
- package/menu/submenu-trigger/submenu-trigger-state.d.ts +1 -20
- package/meter/meter/meter-state.d.ts +1 -9
- package/meter/meter-indicator/meter-indicator.d.ts +1 -9
- package/meter/meter-label/meter-label.d.ts +1 -9
- package/package.json +16 -16
- package/pagination/pagination/pagination-state.d.ts +1 -10
- package/pagination/pagination-button/pagination-button.d.ts +1 -10
- package/pagination/pagination-first/pagination-first.d.ts +1 -10
- package/pagination/pagination-next/pagination-next.d.ts +1 -10
- package/pagination/pagination-previous/pagination-previous.d.ts +1 -10
- package/progress/progress/progress-state.d.ts +1 -12
- package/progress/progress-indicator/progress-indicator.d.ts +1 -12
- package/progress/progress-label/progress-label.d.ts +1 -12
- package/progress/progress-track/progress-track.d.ts +1 -12
- package/progress/progress-value/progress-value.d.ts +1 -12
- package/radio/radio-group/radio-group.d.ts +5 -1
- package/radio/radio-item/radio-item.d.ts +5 -3
- package/roving-focus/roving-focus-group/roving-focus-group-state.d.ts +1 -19
- package/search/search/search-state.d.ts +1 -9
- package/search/search-clear/search-clear.d.ts +1 -9
- package/select/select/select-state.d.ts +1 -4
- package/select/select/select.d.ts +5 -1
- package/slider/slider/slider-state.d.ts +1 -12
- package/slider/slider/slider.d.ts +5 -1
- package/slider/slider-range/slider-range.d.ts +1 -12
- package/slider/slider-thumb/slider-thumb.d.ts +1 -12
- package/slider/slider-track/slider-track.d.ts +1 -12
- package/switch/switch/switch-state.d.ts +1 -10
- package/switch/switch/switch.d.ts +5 -1
- package/switch/switch-thumb/switch-thumb.d.ts +1 -10
- package/tabs/tab-button/tab-button.d.ts +1 -36
- package/tabs/tab-list/tab-list.d.ts +1 -33
- package/tabs/tab-panel/tab-panel.d.ts +1 -33
- package/tabs/tabset/tabset-state.d.ts +1 -33
- package/textarea/textarea/textarea-state.d.ts +1 -4
- package/textarea/textarea/textarea.d.ts +5 -1
- package/toggle/toggle/toggle-state.d.ts +1 -10
- package/toggle-group/config/toggle-group-config.d.ts +5 -0
- package/toggle-group/toggle-group/toggle-group-state.d.ts +1 -32
- package/toggle-group/toggle-group/toggle-group.d.ts +6 -1
- package/toggle-group/toggle-group-item/toggle-group-item-state.d.ts +1 -22
- package/toolbar/toolbar/toolbar-state.d.ts +1 -23
- package/tooltip/tooltip-trigger/tooltip-trigger-state.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-toggle.mjs","sources":["../../../../packages/ng-primitives/toggle/src/toggle/toggle-state.ts","../../../../packages/ng-primitives/toggle/src/toggle/toggle.ts","../../../../packages/ng-primitives/toggle/src/ng-primitives-toggle.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpToggle } from './toggle';\n\n/**\n * The state token for the Toggle primitive.\n */\nexport const NgpToggleStateToken = createStateToken<NgpToggle>('Toggle');\n\n/**\n * Provides the Toggle state.\n */\nexport const provideToggleState = createStateProvider(NgpToggleStateToken);\n\n/**\n * Injects the Toggle state.\n */\nexport const injectToggleState = createStateInjector(NgpToggleStateToken);\n\n/**\n * The Toggle state registration function.\n */\nexport const toggleState = createState(NgpToggleStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n HostListener,\n booleanAttribute,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { provideToggleState, toggleState } from './toggle-state';\n\n/**\n * Apply the `ngpToggle` directive to an element to manage the toggle state. This must be applied to a `button` element.\n */\n@Directive({\n selector: '[ngpToggle]',\n exportAs: 'ngpToggle',\n providers: [provideToggleState()],\n host: {\n '[attr.type]': 'isButton ? \"button\" : null',\n '[attr.aria-pressed]': 'state.selected()',\n '[attr.data-selected]': 'state.selected() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpToggle {\n /**\n * Access the element.\n */\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Whether the toggle is selected.\n * @default false\n */\n readonly selected = input<boolean, BooleanInput>(false, {\n alias: 'ngpToggleSelected',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the selected state changes.\n */\n readonly selectedChange = output<boolean>({\n alias: 'ngpToggleSelectedChange',\n });\n\n /**\n * Whether the toggle is disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpToggleDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Determine if the element is a button.\n */\n protected isButton = this.element.nativeElement.tagName === 'BUTTON';\n\n /**\n * The state for the toggle primitive.\n * @internal\n */\n protected readonly state = toggleState<NgpToggle>(this);\n\n /**\n * Toggle the selected state.\n */\n @HostListener('click')\n toggle(): void {\n if (this.state.disabled()) {\n return;\n }\n\n this.state.selected
|
|
1
|
+
{"version":3,"file":"ng-primitives-toggle.mjs","sources":["../../../../packages/ng-primitives/toggle/src/toggle/toggle-state.ts","../../../../packages/ng-primitives/toggle/src/toggle/toggle.ts","../../../../packages/ng-primitives/toggle/src/ng-primitives-toggle.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpToggle } from './toggle';\n\n/**\n * The state token for the Toggle primitive.\n */\nexport const NgpToggleStateToken = createStateToken<NgpToggle>('Toggle');\n\n/**\n * Provides the Toggle state.\n */\nexport const provideToggleState = createStateProvider(NgpToggleStateToken);\n\n/**\n * Injects the Toggle state.\n */\nexport const injectToggleState = createStateInjector<NgpToggle>(NgpToggleStateToken);\n\n/**\n * The Toggle state registration function.\n */\nexport const toggleState = createState(NgpToggleStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n HostListener,\n booleanAttribute,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { provideToggleState, toggleState } from './toggle-state';\n\n/**\n * Apply the `ngpToggle` directive to an element to manage the toggle state. This must be applied to a `button` element.\n */\n@Directive({\n selector: '[ngpToggle]',\n exportAs: 'ngpToggle',\n providers: [provideToggleState()],\n host: {\n '[attr.type]': 'isButton ? \"button\" : null',\n '[attr.aria-pressed]': 'state.selected()',\n '[attr.data-selected]': 'state.selected() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpToggle {\n /**\n * Access the element.\n */\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Whether the toggle is selected.\n * @default false\n */\n readonly selected = input<boolean, BooleanInput>(false, {\n alias: 'ngpToggleSelected',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the selected state changes.\n */\n readonly selectedChange = output<boolean>({\n alias: 'ngpToggleSelectedChange',\n });\n\n /**\n * Whether the toggle is disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpToggleDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Determine if the element is a button.\n */\n protected isButton = this.element.nativeElement.tagName === 'BUTTON';\n\n /**\n * The state for the toggle primitive.\n * @internal\n */\n protected readonly state = toggleState<NgpToggle>(this);\n\n /**\n * Toggle the selected state.\n */\n @HostListener('click')\n toggle(): void {\n if (this.state.disabled()) {\n return;\n }\n\n const isSelected = !this.state.selected();\n\n this.state.selected.set(isSelected);\n this.selectedChange.emit(isSelected);\n }\n\n /**\n * If the element is not a button or a link the space key should toggle the selected state.\n */\n @HostListener('keydown.space', ['$event'])\n protected onKeyDown(event: KeyboardEvent): void {\n if (!this.isButton && this.element.nativeElement.tagName !== 'A') {\n event.preventDefault();\n this.toggle();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAQA;;AAEG;AACI,MAAM,mBAAmB,GAAG,gBAAgB,CAAY,QAAQ,CAAC;AAExE;;AAEG;MACU,kBAAkB,GAAG,mBAAmB,CAAC,mBAAmB;AAEzE;;AAEG;MACU,iBAAi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,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,SAAS,EAAE,CAAC,kBAAkB,EAAE,CAAC;AACjC,oBAAA,IAAI,EAAE;AACJ,wBAAA,aAAa,EAAE,4BAA4B;AAC3C,wBAAA,qBAAqB,EAAE,kBAAkB;AACzC,wBAAA,sBAAsB,EAAE,8BAA8B;AACtD,wBAAA,sBAAsB,EAAE,8BAA8B;AACvD,qBAAA;AACF,iBAAA;8BA+CC,MAAM,EAAA,CAAA;sBADL,YAAY;uBAAC,OAAO;gBAgBX,SAAS,EAAA,CAAA;sBADlB,YAAY;uBAAC,eAAe,EAAE,CAAC,QAAQ,CAAC;;;ACtF3C;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-toolbar.mjs","sources":["../../../../packages/ng-primitives/toolbar/src/toolbar/toolbar-state.ts","../../../../packages/ng-primitives/toolbar/src/toolbar/toolbar.ts","../../../../packages/ng-primitives/toolbar/src/ng-primitives-toolbar.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpToolbar } from './toolbar';\n\n/**\n * The state token for the Toolbar primitive.\n */\nexport const NgpToolbarStateToken = createStateToken<NgpToolbar>('Toolbar');\n\n/**\n * Provides the Toolbar state.\n */\nexport const provideToolbarState = createStateProvider(NgpToolbarStateToken);\n\n/**\n * Injects the Toolbar state.\n */\nexport const injectToolbarState = createStateInjector(NgpToolbarStateToken);\n\n/**\n * The Toolbar state registration function.\n */\nexport const toolbarState = createState(NgpToolbarStateToken);\n","import { Directive, input } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { syncState } from 'ng-primitives/internal';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { provideToolbarState, toolbarState } from './toolbar-state';\n\n@Directive({\n selector: '[ngpToolbar]',\n exportAs: 'ngpToolbar',\n providers: [provideToolbarState()],\n hostDirectives: [NgpRovingFocusGroup],\n host: {\n role: 'toolbar',\n '[attr.aria-orientation]': 'state.orientation()',\n '[attr.data-orientation]': 'state.orientation()',\n },\n})\nexport class NgpToolbar {\n /**\n * Access the roving focus group state.\n */\n private readonly rovingFocusGroup = injectRovingFocusGroupState();\n\n /**\n * The orientation of the toolbar.\n */\n readonly orientation = input<NgpOrientation>('horizontal', {\n alias: 'ngpToolbarOrientation',\n });\n\n /**\n * The toolbar state.\n */\n protected readonly state = toolbarState<NgpToolbar>(this);\n\n constructor() {\n syncState(this.state.orientation, this.rovingFocusGroup().orientation);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAQA;;AAEG;AACI,MAAM,oBAAoB,GAAG,gBAAgB,CAAa,SAAS,CAAC;AAE3E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAC,oBAAoB;AAE3E;;AAEG;MACU,kBAAkB,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ng-primitives-toolbar.mjs","sources":["../../../../packages/ng-primitives/toolbar/src/toolbar/toolbar-state.ts","../../../../packages/ng-primitives/toolbar/src/toolbar/toolbar.ts","../../../../packages/ng-primitives/toolbar/src/ng-primitives-toolbar.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpToolbar } from './toolbar';\n\n/**\n * The state token for the Toolbar primitive.\n */\nexport const NgpToolbarStateToken = createStateToken<NgpToolbar>('Toolbar');\n\n/**\n * Provides the Toolbar state.\n */\nexport const provideToolbarState = createStateProvider(NgpToolbarStateToken);\n\n/**\n * Injects the Toolbar state.\n */\nexport const injectToolbarState = createStateInjector<NgpToolbar>(NgpToolbarStateToken);\n\n/**\n * The Toolbar state registration function.\n */\nexport const toolbarState = createState(NgpToolbarStateToken);\n","import { Directive, input } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { syncState } from 'ng-primitives/internal';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { provideToolbarState, toolbarState } from './toolbar-state';\n\n@Directive({\n selector: '[ngpToolbar]',\n exportAs: 'ngpToolbar',\n providers: [provideToolbarState()],\n hostDirectives: [NgpRovingFocusGroup],\n host: {\n role: 'toolbar',\n '[attr.aria-orientation]': 'state.orientation()',\n '[attr.data-orientation]': 'state.orientation()',\n },\n})\nexport class NgpToolbar {\n /**\n * Access the roving focus group state.\n */\n private readonly rovingFocusGroup = injectRovingFocusGroupState();\n\n /**\n * The orientation of the toolbar.\n */\n readonly orientation = input<NgpOrientation>('horizontal', {\n alias: 'ngpToolbarOrientation',\n });\n\n /**\n * The toolbar state.\n */\n protected readonly state = toolbarState<NgpToolbar>(this);\n\n constructor() {\n syncState(this.state.orientation, this.rovingFocusGroup().orientation);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAQA;;AAEG;AACI,MAAM,oBAAoB,GAAG,gBAAgB,CAAa,SAAS,CAAC;AAE3E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAC,oBAAoB;AAE3E;;AAEG;MACU,kBAAkB,GAAG,mBAAmB,CAAa,oBAAoB;AAEtF;;AAEG;AACI,MAAM,YAAY,GAAG,WAAW,CAAC,oBAAoB,CAAC;;MCThD,UAAU,CAAA;AAkBrB,IAAA,WAAA,GAAA;AAjBA;;AAEG;QACc,IAAgB,CAAA,gBAAA,GAAG,2BAA2B,EAAE;AAEjE;;AAEG;AACM,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAiB,YAAY,EAAE;AACzD,YAAA,KAAK,EAAE,uBAAuB;AAC/B,SAAA,CAAC;AAEF;;AAEG;AACgB,QAAA,IAAA,CAAA,KAAK,GAAG,YAAY,CAAa,IAAI,CAAC;AAGvD,QAAA,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC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qB;AACjD,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container in to which the tooltip should be attached.\n * @default document.body\n */\n container: HTMLElement | null;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 0,\n flip: true,\n container: null,\n};\n\nexport const NgpTooltipConfigToken = new InjectionToken<NgpTooltipConfig>('NgpTooltipConfigToken');\n\n/**\n * Provide the default Tooltip configuration\n * @param config The Tooltip configuration\n * @returns The provider\n */\nexport function provideTooltipConfig(config: Partial<NgpTooltipConfig>): Provider[] {\n return [\n {\n provide: NgpTooltipConfigToken,\n useValue: { ...defaultTooltipConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tooltip configuration\n * @returns The global Tooltip configuration\n */\nexport function injectTooltipConfig(): NgpTooltipConfig {\n return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;\n}\n","import { Signal } from '@angular/core';\nimport {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n State,\n} from 'ng-primitives/state';\nimport type { NgpTooltipTrigger } from './tooltip-trigger';\n\n/**\n * The state token for the TooltipTrigger primitive.\n */\nexport const NgpTooltipTriggerStateToken =\n createStateToken<NgpTooltipTrigger<unknown>>('TooltipTrigger');\n\n/**\n * Provides the TooltipTrigger state.\n */\nexport const provideTooltipTriggerState = createStateProvider(NgpTooltipTriggerStateToken);\n\n/**\n * Injects the TooltipTrigger state.\n */\nexport const injectTooltipTriggerState = createStateInjector(NgpTooltipTriggerStateToken) as <\n T,\n>() => Signal<State<NgpTooltipTrigger<T>>>;\n\n/**\n * The TooltipTrigger state registration function.\n */\nexport const tooltipTriggerState = createState(NgpTooltipTriggerStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport { provideTooltipTriggerState, tooltipTriggerState } from './tooltip-trigger-state';\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState()],\n host: {\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '(mouseenter)': 'show()',\n '(mouseleave)': 'hide()',\n '(focus)': 'show()',\n '(blur)': 'hide()',\n },\n})\nexport class NgpTooltipTrigger<T = null> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpTooltipTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpTooltipTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 0\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpTooltipTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the tooltip should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * The overlay that manages the tooltip\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the tooltip.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Store the state of the tooltip.\n * @internal\n */\n readonly state = tooltipTriggerState<NgpTooltipTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Show the tooltip.\n */\n show(): void {\n // If the trigger is disabled, do not show the tooltip\n if (this.state.disabled() || this.open()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n this.overlay()?.show();\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n // If the trigger is disabled, do nothing\n if (this.state.disabled()) {\n return;\n }\n\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the tooltip\n */\n private createOverlay(): void {\n const tooltip = this.state.tooltip();\n\n if (!tooltip) {\n throw new Error('Tooltip must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: tooltip,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n context: this.state.context(),\n container: this.state.container(),\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n showDelay: this.state.showDelay(),\n hideDelay: this.state.hideDelay(),\n closeOnEscape: true,\n closeOnOutsideClick: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n // Create the overlay instance\n this.overlay.set(createOverlay(config));\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectOverlay } from 'ng-primitives/portal';\n\n/**\n * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpTooltip]',\n exportAs: 'ngpTooltip',\n host: {\n role: 'tooltip',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-tooltip-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-tooltip-transform-origin]': 'overlay.transformOrigin()',\n },\n})\nexport class NgpTooltip {\n /**\n * Access the overlay.\n */\n protected readonly overlay = injectOverlay();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAyCO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,IAAI;CAChB;AAEM,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAAmB,uBAAuB,CAAC;AAElG;;;;AAIG;AACG,SAAU,oBAAoB,CAAC,MAAiC,EAAA;IACpE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,EAAE;AACjD,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,oBAAoB;AAClF;;AC9DA;;AAEG;AACI,MAAM,2BAA2B,GACtC,gBAAgB,CAA6B,gBAAgB,CAAC;AAEhE;;AAEG;MACU,0BAA0B,GAAG,mBAAmB,CAAC,2BAA2B;AAEzF;;AAEG;MACU,yBAAyB,GAAG,mBAAmB,CAAC,2BAA2B;AAIxF;;AAEG;AACI,MAAM,mBAAmB,GAAG,WAAW,CAAC,2BAA2B,CAAC;;ACP3E;;AAEG;MAcU,iBAAiB,CAAA;AAb9B,IAAA,WAAA,GAAA;AAcE;;AAEG;AACc,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,EAAC,UAAuB,EAAC;AAE1D;;AAEG;AACc,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAE5C;;AAEG;AACc,QAAA,IA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,sCAAA,EAAA,2BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAXtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,iBAAiB,EAAE,sBAAsB;AACzC,wBAAA,gBAAgB,EAAE,sBAAsB;AACxC,wBAAA,wCAAwC,EAAE,wBAAwB;AAClE,wBAAA,wCAAwC,EAAE,2BAA2B;AACtE,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container in to which the tooltip should be attached.\n * @default document.body\n */\n container: HTMLElement | null;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 0,\n flip: true,\n container: null,\n};\n\nexport const NgpTooltipConfigToken = new InjectionToken<NgpTooltipConfig>('NgpTooltipConfigToken');\n\n/**\n * Provide the default Tooltip configuration\n * @param config The Tooltip configuration\n * @returns The provider\n */\nexport function provideTooltipConfig(config: Partial<NgpTooltipConfig>): Provider[] {\n return [\n {\n provide: NgpTooltipConfigToken,\n useValue: { ...defaultTooltipConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tooltip configuration\n * @returns The global Tooltip configuration\n */\nexport function injectTooltipConfig(): NgpTooltipConfig {\n return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;\n}\n","import { Signal } from '@angular/core';\nimport {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n State,\n} from 'ng-primitives/state';\nimport type { NgpTooltipTrigger } from './tooltip-trigger';\n\n/**\n * The state token for the TooltipTrigger primitive.\n */\nexport const NgpTooltipTriggerStateToken =\n createStateToken<NgpTooltipTrigger<unknown>>('TooltipTrigger');\n\n/**\n * Provides the TooltipTrigger state.\n */\nexport const provideTooltipTriggerState = createStateProvider(NgpTooltipTriggerStateToken);\n\n/**\n * Injects the TooltipTrigger state.\n */\nexport const injectTooltipTriggerState = createStateInjector<NgpTooltipTrigger<unknown>>(\n NgpTooltipTriggerStateToken,\n);\n\n/**\n * The TooltipTrigger state registration function.\n */\nexport const tooltipTriggerState = createState(NgpTooltipTriggerStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport { provideTooltipTriggerState, tooltipTriggerState } from './tooltip-trigger-state';\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState()],\n host: {\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '(mouseenter)': 'show()',\n '(mouseleave)': 'hide()',\n '(focus)': 'show()',\n '(blur)': 'hide()',\n },\n})\nexport class NgpTooltipTrigger<T = null> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpTooltipTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpTooltipTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 0\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpTooltipTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the tooltip should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * The overlay that manages the tooltip\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the tooltip.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Store the state of the tooltip.\n * @internal\n */\n readonly state = tooltipTriggerState<NgpTooltipTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Show the tooltip.\n */\n show(): void {\n // If the trigger is disabled, do not show the tooltip\n if (this.state.disabled() || this.open()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n this.overlay()?.show();\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n // If the trigger is disabled, do nothing\n if (this.state.disabled()) {\n return;\n }\n\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the tooltip\n */\n private createOverlay(): void {\n const tooltip = this.state.tooltip();\n\n if (!tooltip) {\n throw new Error('Tooltip must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: tooltip,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n context: this.state.context(),\n container: this.state.container(),\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n showDelay: this.state.showDelay(),\n hideDelay: this.state.hideDelay(),\n closeOnEscape: true,\n closeOnOutsideClick: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n // Create the overlay instance\n this.overlay.set(createOverlay(config));\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectOverlay } from 'ng-primitives/portal';\n\n/**\n * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpTooltip]',\n exportAs: 'ngpTooltip',\n host: {\n role: 'tooltip',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-tooltip-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-tooltip-transform-origin]': 'overlay.transformOrigin()',\n },\n})\nexport class NgpTooltip {\n /**\n * Access the overlay.\n */\n protected readonly overlay = injectOverlay();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAyCO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,IAAI;CAChB;AAEM,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAAmB,uBAAuB,CAAC;AAElG;;;;AAIG;AACG,SAAU,oBAAoB,CAAC,MAAiC,EAAA;IACpE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,EAAE;AACjD,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,oBAAoB;AAClF;;AC9DA;;AAEG;AACI,MAAM,2BAA2B,GACtC,gBAAgB,CAA6B,gBAAgB,CAA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AA;AAXvB,IAAA,WAAA,GAAA;AAYE;;AAEG;QACgB,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE;AAC7C;+GALY,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,SAAA,EAAA,EAAA,UAAA,EAAA,EAAA,eAAA,EAAA,sBAAA,EAAA,cAAA,EAAA,sBAAA,EAAA,sCAAA,EAAA,wBAAA,EAAA,sCAAA,EAAA,2BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAXtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,iBAAiB,EAAE,sBAAsB;AACzC,wBAAA,gBAAgB,EAAE,sBAAsB;AACxC,wBAAA,wCAAwC,EAAE,wBAAwB;AAClE,wBAAA,wCAAwC,EAAE,2BAA2B;AACtE,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;;;;"}
|
|
@@ -10,22 +10,7 @@ export declare const provideFileDropzoneState: (options?: import("ng-primitives/
|
|
|
10
10
|
/**
|
|
11
11
|
* Injects the FileDropzone state.
|
|
12
12
|
*/
|
|
13
|
-
export declare const injectFileDropzoneState: <U =
|
|
14
|
-
readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
|
|
15
|
-
readonly fileTypes: import("@angular/core").InputSignalWithTransform<string[] | undefined, string | string[]>;
|
|
16
|
-
readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
17
|
-
readonly directory: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
18
|
-
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
19
|
-
readonly selected: import("@angular/core").OutputEmitterRef<FileList | null>;
|
|
20
|
-
readonly rejected: import("@angular/core").OutputEmitterRef<void>;
|
|
21
|
-
readonly dragOver: import("@angular/core").OutputEmitterRef<boolean>;
|
|
22
|
-
readonly isDragOver: import("@angular/core").WritableSignal<boolean>;
|
|
23
|
-
readonly state: import("ng-primitives/state").CreatedState<NgpFileDropzone>;
|
|
24
|
-
onDragEnter: (event: DragEvent) => void;
|
|
25
|
-
onDragOver: (event: DragEvent) => void;
|
|
26
|
-
onDragLeave: (event: DragEvent) => void;
|
|
27
|
-
onDrop: (event: DragEvent) => void;
|
|
28
|
-
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
13
|
+
export declare const injectFileDropzoneState: <U = NgpFileDropzone>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
29
14
|
/**
|
|
30
15
|
* The FileDropzone state registration function.
|
|
31
16
|
*/
|
|
@@ -10,27 +10,7 @@ export declare const provideFileUploadState: (options?: import("ng-primitives/st
|
|
|
10
10
|
/**
|
|
11
11
|
* Injects the FileUpload state.
|
|
12
12
|
*/
|
|
13
|
-
export declare const injectFileUploadState: <U =
|
|
14
|
-
readonly document: Document;
|
|
15
|
-
readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
|
|
16
|
-
readonly fileTypes: import("@angular/core").InputSignalWithTransform<string[] | undefined, string | string[]>;
|
|
17
|
-
readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
18
|
-
readonly directory: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
19
|
-
readonly dragAndDrop: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
20
|
-
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
21
|
-
readonly selected: import("@angular/core").OutputEmitterRef<FileList | null>;
|
|
22
|
-
readonly canceled: import("@angular/core").OutputEmitterRef<void>;
|
|
23
|
-
readonly rejected: import("@angular/core").OutputEmitterRef<void>;
|
|
24
|
-
readonly dragOver: import("@angular/core").OutputEmitterRef<boolean>;
|
|
25
|
-
readonly isDragOver: import("@angular/core").WritableSignal<boolean>;
|
|
26
|
-
input: HTMLInputElement;
|
|
27
|
-
readonly state: import("ng-primitives/state").CreatedState<NgpFileUpload>;
|
|
28
|
-
showFileDialog: () => void;
|
|
29
|
-
onDragEnter: (event: DragEvent) => void;
|
|
30
|
-
onDragOver: (event: DragEvent) => void;
|
|
31
|
-
onDragLeave: (event: DragEvent) => void;
|
|
32
|
-
onDrop: (event: DragEvent) => void;
|
|
33
|
-
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
13
|
+
export declare const injectFileUploadState: <U = NgpFileUpload>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
34
14
|
/**
|
|
35
15
|
* The FileUpload state registration function.
|
|
36
16
|
*/
|
|
@@ -10,34 +10,7 @@ export declare const provideFocusTrapState: (options?: import("ng-primitives/sta
|
|
|
10
10
|
/**
|
|
11
11
|
* Injects the FocusTrap state.
|
|
12
12
|
*/
|
|
13
|
-
export declare const injectFocusTrapState: <U =
|
|
14
|
-
readonly overlay: import("ng-primitives/portal").NgpOverlay<any> | null;
|
|
15
|
-
readonly focusTrap: {
|
|
16
|
-
active: boolean;
|
|
17
|
-
activate(): void;
|
|
18
|
-
deactivate(): void;
|
|
19
|
-
};
|
|
20
|
-
readonly injector: import("@angular/core").Injector;
|
|
21
|
-
readonly focusMonitor: import("@angular/cdk/focus-monitor.d-CvvJeQRc").e;
|
|
22
|
-
readonly interactivityChecker: import("@angular/cdk/a11y-module.d-DBHGyKoh").I;
|
|
23
|
-
readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
|
|
24
|
-
readonly ngZone: import("@angular/core").NgZone;
|
|
25
|
-
mutationObserver: MutationObserver | null;
|
|
26
|
-
lastFocusedElement: HTMLElement | null;
|
|
27
|
-
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
28
|
-
readonly state: import("ng-primitives/state").CreatedState<NgpFocusTrap>;
|
|
29
|
-
ngOnInit: () => void;
|
|
30
|
-
ngOnDestroy: () => void;
|
|
31
|
-
handleFocusIn: (event: FocusEvent) => void;
|
|
32
|
-
handleFocusOut: (event: FocusEvent) => void;
|
|
33
|
-
handleMutations: (mutations: MutationRecord[]) => void;
|
|
34
|
-
handleKeyDown: (event: KeyboardEvent) => void;
|
|
35
|
-
getTabbableEdges: (container: HTMLElement) => readonly [HTMLElement | null, HTMLElement | null];
|
|
36
|
-
getTabbableCandidates: (container: HTMLElement) => HTMLElement[];
|
|
37
|
-
findVisible: (elements: HTMLElement[]) => HTMLElement | null;
|
|
38
|
-
focus: (element: HTMLElement | null) => void;
|
|
39
|
-
focusFirst: () => void;
|
|
40
|
-
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
13
|
+
export declare const injectFocusTrapState: <U = NgpFocusTrap>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
41
14
|
/**
|
|
42
15
|
* The FocusTrap state registration function.
|
|
43
16
|
*/
|
|
@@ -10,31 +10,7 @@ export declare class NgpDescription {
|
|
|
10
10
|
/**
|
|
11
11
|
* Access the form field that the description is associated with.
|
|
12
12
|
*/
|
|
13
|
-
protected readonly formField: import("@angular/core").Signal<import("ng-primitives/state").State<
|
|
14
|
-
readonly labels: import("@angular/core").WritableSignal<string[]>;
|
|
15
|
-
readonly descriptions: import("@angular/core").WritableSignal<string[]>;
|
|
16
|
-
readonly formControl: import("@angular/core").WritableSignal<string | null>;
|
|
17
|
-
readonly ngControl: import("@angular/core").Signal<import("@angular/forms").NgControl | undefined>;
|
|
18
|
-
readonly errors: import("@angular/core").WritableSignal<string[]>;
|
|
19
|
-
readonly pristine: import("@angular/core").WritableSignal<boolean | null>;
|
|
20
|
-
readonly touched: import("@angular/core").WritableSignal<boolean | null>;
|
|
21
|
-
readonly dirty: import("@angular/core").WritableSignal<boolean | null>;
|
|
22
|
-
readonly valid: import("@angular/core").WritableSignal<boolean | null>;
|
|
23
|
-
readonly invalid: import("@angular/core").WritableSignal<boolean | null>;
|
|
24
|
-
readonly pending: import("@angular/core").WritableSignal<boolean | null>;
|
|
25
|
-
readonly disabled: import("@angular/core").WritableSignal<boolean | null>;
|
|
26
|
-
subscription?: import("rxjs").Subscription | undefined;
|
|
27
|
-
readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/form-field").NgpFormField>;
|
|
28
|
-
ngOnDestroy: () => void;
|
|
29
|
-
setupSubscriptions: (control: import("@angular/forms").NgControl | null | undefined) => void;
|
|
30
|
-
updateStatus: () => void;
|
|
31
|
-
setFormControl: (id: string) => void;
|
|
32
|
-
addLabel: (label: string) => void;
|
|
33
|
-
addDescription: (description: string) => void;
|
|
34
|
-
removeFormControl: () => void;
|
|
35
|
-
removeLabel: (label: string) => void;
|
|
36
|
-
removeDescription: (description: string) => void;
|
|
37
|
-
}>>;
|
|
13
|
+
protected readonly formField: import("@angular/core").Signal<import("ng-primitives/state").State<import("ng-primitives/form-field").NgpFormField>>;
|
|
38
14
|
constructor();
|
|
39
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpDescription, never>;
|
|
40
16
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpDescription, "[ngpDescription]", ["ngpDescription"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -7,31 +7,7 @@ export declare class NgpError implements OnChanges, OnDestroy {
|
|
|
7
7
|
/**
|
|
8
8
|
* Access the form field that the description is associated with.
|
|
9
9
|
*/
|
|
10
|
-
protected readonly formField: import("@angular/core").Signal<import("ng-primitives/state").State<
|
|
11
|
-
readonly labels: import("@angular/core").WritableSignal<string[]>;
|
|
12
|
-
readonly descriptions: import("@angular/core").WritableSignal<string[]>;
|
|
13
|
-
readonly formControl: import("@angular/core").WritableSignal<string | null>;
|
|
14
|
-
readonly ngControl: import("@angular/core").Signal<import("@angular/forms").NgControl | undefined>;
|
|
15
|
-
readonly errors: import("@angular/core").WritableSignal<string[]>;
|
|
16
|
-
readonly pristine: import("@angular/core").WritableSignal<boolean | null>;
|
|
17
|
-
readonly touched: import("@angular/core").WritableSignal<boolean | null>;
|
|
18
|
-
readonly dirty: import("@angular/core").WritableSignal<boolean | null>;
|
|
19
|
-
readonly valid: import("@angular/core").WritableSignal<boolean | null>;
|
|
20
|
-
readonly invalid: import("@angular/core").WritableSignal<boolean | null>;
|
|
21
|
-
readonly pending: import("@angular/core").WritableSignal<boolean | null>;
|
|
22
|
-
readonly disabled: import("@angular/core").WritableSignal<boolean | null>;
|
|
23
|
-
subscription?: import("rxjs").Subscription | undefined;
|
|
24
|
-
readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/form-field").NgpFormField>;
|
|
25
|
-
ngOnDestroy: () => void;
|
|
26
|
-
setupSubscriptions: (control: import("@angular/forms").NgControl | null | undefined) => void;
|
|
27
|
-
updateStatus: () => void;
|
|
28
|
-
setFormControl: (id: string) => void;
|
|
29
|
-
addLabel: (label: string) => void;
|
|
30
|
-
addDescription: (description: string) => void;
|
|
31
|
-
removeFormControl: () => void;
|
|
32
|
-
removeLabel: (label: string) => void;
|
|
33
|
-
removeDescription: (description: string) => void;
|
|
34
|
-
}>>;
|
|
10
|
+
protected readonly formField: import("@angular/core").Signal<import("ng-primitives/state").State<import("ng-primitives/form-field").NgpFormField>>;
|
|
35
11
|
/**
|
|
36
12
|
* The id of the error message. If not provided, a unique id will be generated.
|
|
37
13
|
*/
|
|
@@ -10,11 +10,7 @@ export declare const provideFormControlState: (options?: import("ng-primitives/s
|
|
|
10
10
|
/**
|
|
11
11
|
* Injects the FormControl state.
|
|
12
12
|
*/
|
|
13
|
-
export declare const injectFormControlState: <U =
|
|
14
|
-
readonly id: import("@angular/core").InputSignal<string>;
|
|
15
|
-
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
16
|
-
readonly state: import("ng-primitives/state").CreatedState<NgpFormControl>;
|
|
17
|
-
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
13
|
+
export declare const injectFormControlState: <U = NgpFormControl>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
18
14
|
/**
|
|
19
15
|
* The FormControl state registration function.
|
|
20
16
|
*/
|
|
@@ -24,8 +24,8 @@ export declare class NgpFormControl {
|
|
|
24
24
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpFormControl, "[ngpFormControl]", ["ngpFormControl"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpFormControlDisabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
25
25
|
}
|
|
26
26
|
interface FormControlState {
|
|
27
|
-
id
|
|
27
|
+
id: Signal<string>;
|
|
28
28
|
disabled?: Signal<boolean>;
|
|
29
29
|
}
|
|
30
|
-
export declare function setupFormControl({ id, disabled
|
|
30
|
+
export declare function setupFormControl({ id, disabled }: FormControlState): void;
|
|
31
31
|
export {};
|
|
@@ -10,31 +10,7 @@ export declare const provideFormFieldState: (options?: import("ng-primitives/sta
|
|
|
10
10
|
/**
|
|
11
11
|
* Injects the FormField state.
|
|
12
12
|
*/
|
|
13
|
-
export declare const injectFormFieldState: <U =
|
|
14
|
-
readonly labels: import("@angular/core").WritableSignal<string[]>;
|
|
15
|
-
readonly descriptions: import("@angular/core").WritableSignal<string[]>;
|
|
16
|
-
readonly formControl: import("@angular/core").WritableSignal<string | null>;
|
|
17
|
-
readonly ngControl: import("@angular/core").Signal<import("@angular/forms").NgControl | undefined>;
|
|
18
|
-
readonly errors: import("@angular/core").WritableSignal<string[]>;
|
|
19
|
-
readonly pristine: import("@angular/core").WritableSignal<boolean | null>;
|
|
20
|
-
readonly touched: import("@angular/core").WritableSignal<boolean | null>;
|
|
21
|
-
readonly dirty: import("@angular/core").WritableSignal<boolean | null>;
|
|
22
|
-
readonly valid: import("@angular/core").WritableSignal<boolean | null>;
|
|
23
|
-
readonly invalid: import("@angular/core").WritableSignal<boolean | null>;
|
|
24
|
-
readonly pending: import("@angular/core").WritableSignal<boolean | null>;
|
|
25
|
-
readonly disabled: import("@angular/core").WritableSignal<boolean | null>;
|
|
26
|
-
subscription?: import("rxjs").Subscription | undefined;
|
|
27
|
-
readonly state: import("ng-primitives/state").CreatedState<NgpFormField>;
|
|
28
|
-
ngOnDestroy: () => void;
|
|
29
|
-
setupSubscriptions: (control: import("@angular/forms").NgControl | null | undefined) => void;
|
|
30
|
-
updateStatus: () => void;
|
|
31
|
-
setFormControl: (id: string) => void;
|
|
32
|
-
addLabel: (label: string) => void;
|
|
33
|
-
addDescription: (description: string) => void;
|
|
34
|
-
removeFormControl: () => void;
|
|
35
|
-
removeLabel: (label: string) => void;
|
|
36
|
-
removeDescription: (description: string) => void;
|
|
37
|
-
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
13
|
+
export declare const injectFormFieldState: <U = NgpFormField>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
38
14
|
/**
|
|
39
15
|
* The FormField state registration function.
|
|
40
16
|
*/
|
|
@@ -10,31 +10,7 @@ export declare class NgpLabel {
|
|
|
10
10
|
/**
|
|
11
11
|
* Access the form field that the label is associated with.
|
|
12
12
|
*/
|
|
13
|
-
protected readonly formField: import("@angular/core").Signal<import("ng-primitives/state").State<
|
|
14
|
-
readonly labels: import("@angular/core").WritableSignal<string[]>;
|
|
15
|
-
readonly descriptions: import("@angular/core").WritableSignal<string[]>;
|
|
16
|
-
readonly formControl: import("@angular/core").WritableSignal<string | null>;
|
|
17
|
-
readonly ngControl: import("@angular/core").Signal<import("@angular/forms").NgControl | undefined>;
|
|
18
|
-
readonly errors: import("@angular/core").WritableSignal<string[]>;
|
|
19
|
-
readonly pristine: import("@angular/core").WritableSignal<boolean | null>;
|
|
20
|
-
readonly touched: import("@angular/core").WritableSignal<boolean | null>;
|
|
21
|
-
readonly dirty: import("@angular/core").WritableSignal<boolean | null>;
|
|
22
|
-
readonly valid: import("@angular/core").WritableSignal<boolean | null>;
|
|
23
|
-
readonly invalid: import("@angular/core").WritableSignal<boolean | null>;
|
|
24
|
-
readonly pending: import("@angular/core").WritableSignal<boolean | null>;
|
|
25
|
-
readonly disabled: import("@angular/core").WritableSignal<boolean | null>;
|
|
26
|
-
subscription?: import("rxjs").Subscription | undefined;
|
|
27
|
-
readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/form-field").NgpFormField>;
|
|
28
|
-
ngOnDestroy: () => void;
|
|
29
|
-
setupSubscriptions: (control: import("@angular/forms").NgControl | null | undefined) => void;
|
|
30
|
-
updateStatus: () => void;
|
|
31
|
-
setFormControl: (id: string) => void;
|
|
32
|
-
addLabel: (label: string) => void;
|
|
33
|
-
addDescription: (description: string) => void;
|
|
34
|
-
removeFormControl: () => void;
|
|
35
|
-
removeLabel: (label: string) => void;
|
|
36
|
-
removeDescription: (description: string) => void;
|
|
37
|
-
}>>;
|
|
13
|
+
protected readonly formField: import("@angular/core").Signal<import("ng-primitives/state").State<import("ng-primitives/form-field").NgpFormField>>;
|
|
38
14
|
/**
|
|
39
15
|
* Derive the for attribute value if the label is an HTML label element.
|
|
40
16
|
*/
|
|
@@ -10,20 +10,7 @@ export declare const provideInputState: (options?: import("ng-primitives/state")
|
|
|
10
10
|
/**
|
|
11
11
|
* Injects the Input state.
|
|
12
12
|
*/
|
|
13
|
-
export declare const injectInputState: <U =
|
|
14
|
-
readonly searchState: import("@angular/core").Signal<import("ng-primitives/state").State<{
|
|
15
|
-
readonly destroyRef: import("@angular/core").DestroyRef;
|
|
16
|
-
readonly input: import("@angular/core").WritableSignal<HTMLInputElement | null>;
|
|
17
|
-
readonly value: import("@angular/core").WritableSignal<string>;
|
|
18
|
-
readonly empty: import("@angular/core").Signal<boolean>;
|
|
19
|
-
readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/search").NgpSearch>;
|
|
20
|
-
clear: () => void;
|
|
21
|
-
registerInput: (input: HTMLInputElement) => void;
|
|
22
|
-
}>>;
|
|
23
|
-
readonly elementRef: import("@angular/core").ElementRef<HTMLInputElement>;
|
|
24
|
-
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
25
|
-
readonly state: import("ng-primitives/state").CreatedState<NgpInput>;
|
|
26
|
-
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
13
|
+
export declare const injectInputState: <U = NgpInput>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
27
14
|
/**
|
|
28
15
|
* The Input state registration function.
|
|
29
16
|
*/
|
package/input/input/input.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import { BooleanInput } from '@angular/cdk/coercion';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import * as i1 from "ng-primitives/autofill";
|
|
4
4
|
export declare class NgpInput {
|
|
5
|
+
/**
|
|
6
|
+
* The id of the input.
|
|
7
|
+
*/
|
|
8
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
|
5
9
|
/**
|
|
6
10
|
* The input may be used within a search field, if so we need to register it.
|
|
7
11
|
*/
|
|
@@ -20,5 +24,5 @@ export declare class NgpInput {
|
|
|
20
24
|
protected readonly state: import("ng-primitives/state").CreatedState<NgpInput>;
|
|
21
25
|
constructor();
|
|
22
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpInput, never>;
|
|
23
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpInput, "input[ngpInput]", ["ngpInput"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.NgpAutofill; inputs: {}; outputs: {}; }]>;
|
|
27
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpInput, "input[ngpInput]", ["ngpInput"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.NgpAutofill; inputs: {}; outputs: {}; }]>;
|
|
24
28
|
}
|
|
@@ -10,31 +10,7 @@ export declare const provideListboxState: (options?: import("ng-primitives/state
|
|
|
10
10
|
/**
|
|
11
11
|
* Injects the Listbox state.
|
|
12
12
|
*/
|
|
13
|
-
export declare const injectListboxState: <U =
|
|
14
|
-
readonly injector: import("@angular/core").Injector;
|
|
15
|
-
readonly destroyRef: import("@angular/core").DestroyRef;
|
|
16
|
-
readonly popoverTrigger: import("@angular/core").Signal<import("ng-primitives/state").State<import("ng-primitives/popover").NgpPopoverTrigger<unknown>>>;
|
|
17
|
-
readonly id: import("@angular/core").InputSignal<string>;
|
|
18
|
-
readonly mode: import("@angular/core").InputSignal<import("ng-primitives/common").NgpSelectionMode>;
|
|
19
|
-
readonly value: import("@angular/core").InputSignal<unknown[]>;
|
|
20
|
-
readonly valueChange: import("@angular/core").OutputEmitterRef<unknown[]>;
|
|
21
|
-
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
22
|
-
readonly compareWith: import("@angular/core").InputSignal<(a: unknown, b: unknown) => boolean>;
|
|
23
|
-
readonly tabindex: import("@angular/core").Signal<-1 | 0>;
|
|
24
|
-
readonly options: import("@angular/core").WritableSignal<import("ng-primitives/listbox").NgpListboxOption<unknown>[]>;
|
|
25
|
-
readonly keyManager: import("@angular/cdk/activedescendant-key-manager.d-Bjic5obv").A<import("ng-primitives/listbox").NgpListboxOption<unknown>>;
|
|
26
|
-
readonly activeDescendant: import("@angular/core").WritableSignal<string | undefined>;
|
|
27
|
-
readonly isFocused: import("@angular/core").WritableSignal<boolean>;
|
|
28
|
-
readonly state: import("ng-primitives/state").CreatedState<NgpListbox<unknown>>;
|
|
29
|
-
ngAfterContentInit: () => void;
|
|
30
|
-
updateActiveItem: () => void;
|
|
31
|
-
onKeydown: (event: KeyboardEvent) => void;
|
|
32
|
-
selectOption: (value: unknown, origin: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
|
|
33
|
-
isSelected: (value: unknown) => boolean;
|
|
34
|
-
activateOption: (value: unknown) => void;
|
|
35
|
-
addOption: (option: import("ng-primitives/listbox").NgpListboxOption<unknown>) => void;
|
|
36
|
-
removeOption: (option: import("ng-primitives/listbox").NgpListboxOption<unknown>) => void;
|
|
37
|
-
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U> | undefined>;
|
|
13
|
+
export declare const injectListboxState: <U = NgpListbox<unknown>>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U> | undefined>;
|
|
38
14
|
/**
|
|
39
15
|
* The Listbox state registration function.
|
|
40
16
|
*/
|
|
@@ -10,28 +10,7 @@ export declare const provideMenuTriggerState: (options?: import("ng-primitives/s
|
|
|
10
10
|
/**
|
|
11
11
|
* Injects the MenuTrigger state.
|
|
12
12
|
*/
|
|
13
|
-
export declare const injectMenuTriggerState: <U =
|
|
14
|
-
readonly trigger: import("@angular/core").ElementRef<HTMLElement>;
|
|
15
|
-
readonly injector: import("@angular/core").Injector;
|
|
16
|
-
readonly viewContainerRef: import("@angular/core").ViewContainerRef;
|
|
17
|
-
readonly config: import("ng-primitives/menu").NgpMenuConfig;
|
|
18
|
-
readonly menu: import("@angular/core").InputSignal<import("ng-primitives/portal").NgpOverlayContent<unknown> | undefined>;
|
|
19
|
-
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
20
|
-
readonly placement: import("@angular/core").InputSignal<import("@floating-ui/dom").Placement>;
|
|
21
|
-
readonly offset: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
22
|
-
readonly flip: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
23
|
-
readonly container: import("@angular/core").InputSignal<HTMLElement | null>;
|
|
24
|
-
readonly scrollBehavior: import("@angular/core").InputSignal<"reposition" | "block">;
|
|
25
|
-
readonly context: import("@angular/core").InputSignal<unknown>;
|
|
26
|
-
readonly overlay: import("@angular/core").WritableSignal<import("ng-primitives/portal").NgpOverlay<unknown> | null>;
|
|
27
|
-
readonly open: import("@angular/core").Signal<boolean>;
|
|
28
|
-
readonly state: import("ng-primitives/state").CreatedState<NgpMenuTrigger<unknown>>;
|
|
29
|
-
ngOnDestroy: () => void;
|
|
30
|
-
toggle: (event: MouseEvent) => void;
|
|
31
|
-
show: () => void;
|
|
32
|
-
hide: (origin?: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
|
|
33
|
-
createOverlay: () => void;
|
|
34
|
-
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
13
|
+
export declare const injectMenuTriggerState: <U = NgpMenuTrigger<unknown>>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
35
14
|
/**
|
|
36
15
|
* The MenuTrigger state registration function.
|
|
37
16
|
*/
|
|
@@ -10,26 +10,7 @@ export declare const provideSubmenuTriggerState: (options?: import("ng-primitive
|
|
|
10
10
|
/**
|
|
11
11
|
* Injects the SubmenuTrigger state.
|
|
12
12
|
*/
|
|
13
|
-
export declare const injectSubmenuTriggerState: <U =
|
|
14
|
-
readonly trigger: import("@angular/core").ElementRef<HTMLElement>;
|
|
15
|
-
readonly injector: import("@angular/core").Injector;
|
|
16
|
-
readonly viewContainerRef: import("@angular/core").ViewContainerRef;
|
|
17
|
-
readonly parentMenu: import("ng-primitives/menu").NgpMenu | null;
|
|
18
|
-
readonly menu: import("@angular/core").InputSignal<import("ng-primitives/portal").NgpOverlayContent<unknown> | undefined>;
|
|
19
|
-
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
20
|
-
readonly placement: import("@angular/core").InputSignal<import("@floating-ui/dom").Placement>;
|
|
21
|
-
readonly offset: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
22
|
-
readonly flip: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
23
|
-
readonly overlay: import("@angular/core").WritableSignal<import("ng-primitives/portal").NgpOverlay<unknown> | null>;
|
|
24
|
-
readonly open: import("@angular/core").Signal<boolean>;
|
|
25
|
-
readonly state: import("ng-primitives/state").CreatedState<NgpSubmenuTrigger<unknown>>;
|
|
26
|
-
toggle: (event: MouseEvent) => void;
|
|
27
|
-
show: () => void;
|
|
28
|
-
hide: (origin?: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
|
|
29
|
-
createOverlay: () => void;
|
|
30
|
-
showSubmenuOnArrow: (event: KeyboardEvent) => void;
|
|
31
|
-
showSubmenuOnHover: (event: PointerEvent) => void;
|
|
32
|
-
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
13
|
+
export declare const injectSubmenuTriggerState: <U = NgpSubmenuTrigger<unknown>>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
33
14
|
/**
|
|
34
15
|
* The SubmenuTrigger state registration function.
|
|
35
16
|
*/
|
|
@@ -10,15 +10,7 @@ export declare const provideMeterState: (options?: import("ng-primitives/state")
|
|
|
10
10
|
/**
|
|
11
11
|
* Injects the Meter state.
|
|
12
12
|
*/
|
|
13
|
-
export declare const injectMeterState: <U =
|
|
14
|
-
readonly value: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
15
|
-
readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
16
|
-
readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
17
|
-
readonly valueLabel: import("@angular/core").InputSignal<import("./meter").NgpMeterValueTextFn>;
|
|
18
|
-
readonly label: import("@angular/core").WritableSignal<import("ng-primitives/meter").NgpMeterLabel | null>;
|
|
19
|
-
readonly percentage: import("@angular/core").Signal<number>;
|
|
20
|
-
readonly state: import("ng-primitives/state").CreatedState<NgpMeter>;
|
|
21
|
-
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
13
|
+
export declare const injectMeterState: <U = NgpMeter>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
22
14
|
/**
|
|
23
15
|
* The Meter state registration function.
|
|
24
16
|
*/
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class NgpMeterIndicator {
|
|
3
3
|
/** Access the meter */
|
|
4
|
-
protected readonly meter: import("@angular/core").Signal<import("ng-primitives/state").State<
|
|
5
|
-
readonly value: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
6
|
-
readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
7
|
-
readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
8
|
-
readonly valueLabel: import("@angular/core").InputSignal<import("../meter/meter").NgpMeterValueTextFn>;
|
|
9
|
-
readonly label: import("@angular/core").WritableSignal<import("ng-primitives/meter").NgpMeterLabel | null>;
|
|
10
|
-
readonly percentage: import("@angular/core").Signal<number>;
|
|
11
|
-
readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/meter").NgpMeter>;
|
|
12
|
-
}>>;
|
|
4
|
+
protected readonly meter: import("@angular/core").Signal<import("ng-primitives/state").State<import("ng-primitives/meter").NgpMeter>>;
|
|
13
5
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpMeterIndicator, never>;
|
|
14
6
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpMeterIndicator, "[ngpMeterIndicator]", ["ngpMeterIndicator"], {}, {}, never, never, true, never>;
|
|
15
7
|
}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class NgpMeterLabel {
|
|
3
3
|
/** Access the meter */
|
|
4
|
-
protected readonly meter: import("@angular/core").Signal<import("ng-primitives/state").State<
|
|
5
|
-
readonly value: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
6
|
-
readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
7
|
-
readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
8
|
-
readonly valueLabel: import("@angular/core").InputSignal<import("../meter/meter").NgpMeterValueTextFn>;
|
|
9
|
-
readonly label: import("@angular/core").WritableSignal<NgpMeterLabel | null>;
|
|
10
|
-
readonly percentage: import("@angular/core").Signal<number>;
|
|
11
|
-
readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/meter").NgpMeter>;
|
|
12
|
-
}>>;
|
|
4
|
+
protected readonly meter: import("@angular/core").Signal<import("ng-primitives/state").State<import("ng-primitives/meter").NgpMeter>>;
|
|
13
5
|
/** The id of the meter label */
|
|
14
6
|
readonly id: import("@angular/core").InputSignal<string>;
|
|
15
7
|
constructor();
|