ng-primitives 0.41.0 → 0.43.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.
Files changed (112) hide show
  1. package/checkbox/checkbox/checkbox.d.ts +1 -2
  2. package/dialog/dialog-trigger/dialog-trigger.d.ts +0 -4
  3. package/fesm2022/ng-primitives-a11y.mjs +3 -3
  4. package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
  5. package/fesm2022/ng-primitives-accordion.mjs +12 -12
  6. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  7. package/fesm2022/ng-primitives-autofill.mjs +3 -3
  8. package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
  9. package/fesm2022/ng-primitives-avatar.mjs +9 -9
  10. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  11. package/fesm2022/ng-primitives-button.mjs +3 -3
  12. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  13. package/fesm2022/ng-primitives-checkbox.mjs +5 -7
  14. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  15. package/fesm2022/ng-primitives-common.mjs +3 -3
  16. package/fesm2022/ng-primitives-common.mjs.map +1 -1
  17. package/fesm2022/ng-primitives-date-picker.mjs +27 -27
  18. package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
  19. package/fesm2022/ng-primitives-dialog.mjs +19 -23
  20. package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
  21. package/fesm2022/ng-primitives-file-upload.mjs +6 -6
  22. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  23. package/fesm2022/ng-primitives-focus-trap.mjs +3 -3
  24. package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
  25. package/fesm2022/ng-primitives-form-field.mjs +77 -54
  26. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  27. package/fesm2022/ng-primitives-input.mjs +7 -8
  28. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  29. package/fesm2022/ng-primitives-interactions.mjs +15 -15
  30. package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
  31. package/fesm2022/ng-primitives-internal.mjs +12 -12
  32. package/fesm2022/ng-primitives-internal.mjs.map +1 -1
  33. package/fesm2022/ng-primitives-listbox.mjs +12 -12
  34. package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
  35. package/fesm2022/ng-primitives-menu.mjs +12 -12
  36. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  37. package/fesm2022/ng-primitives-meter.mjs +15 -15
  38. package/fesm2022/ng-primitives-meter.mjs.map +1 -1
  39. package/fesm2022/ng-primitives-pagination.mjs +18 -18
  40. package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
  41. package/fesm2022/ng-primitives-popover.mjs +6 -6
  42. package/fesm2022/ng-primitives-popover.mjs.map +1 -1
  43. package/fesm2022/ng-primitives-progress.mjs +15 -15
  44. package/fesm2022/ng-primitives-progress.mjs.map +1 -1
  45. package/fesm2022/ng-primitives-radio.mjs +12 -14
  46. package/fesm2022/ng-primitives-radio.mjs.map +1 -1
  47. package/fesm2022/ng-primitives-resize.mjs +10 -3
  48. package/fesm2022/ng-primitives-resize.mjs.map +1 -1
  49. package/fesm2022/ng-primitives-roving-focus.mjs +6 -6
  50. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  51. package/fesm2022/ng-primitives-search.mjs +6 -6
  52. package/fesm2022/ng-primitives-search.mjs.map +1 -1
  53. package/fesm2022/ng-primitives-select.mjs +5 -7
  54. package/fesm2022/ng-primitives-select.mjs.map +1 -1
  55. package/fesm2022/ng-primitives-separator.mjs +3 -3
  56. package/fesm2022/ng-primitives-separator.mjs.map +1 -1
  57. package/fesm2022/ng-primitives-slider.mjs +14 -16
  58. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  59. package/fesm2022/ng-primitives-switch.mjs +6 -6
  60. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  61. package/fesm2022/ng-primitives-tabs.mjs +14 -13
  62. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  63. package/fesm2022/ng-primitives-textarea.mjs +5 -7
  64. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  65. package/fesm2022/ng-primitives-toast.mjs +3 -3
  66. package/fesm2022/ng-primitives-toast.mjs.map +1 -1
  67. package/fesm2022/ng-primitives-toggle-group.mjs +6 -6
  68. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  69. package/fesm2022/ng-primitives-toggle.mjs +3 -3
  70. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  71. package/fesm2022/ng-primitives-toolbar.mjs +3 -3
  72. package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
  73. package/fesm2022/ng-primitives-tooltip.mjs +6 -6
  74. package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
  75. package/focus-trap/focus-trap/focus-trap-state.d.ts +2 -2
  76. package/form-field/form-control/form-control-state.d.ts +1 -38
  77. package/form-field/form-control/form-control.d.ts +7 -36
  78. package/form-field/index.d.ts +2 -2
  79. package/input/input/input.d.ts +2 -3
  80. package/listbox/listbox/listbox-state.d.ts +2 -2
  81. package/meter/meter/meter-state.d.ts +3 -3
  82. package/meter/meter-indicator/meter-indicator.d.ts +3 -3
  83. package/meter/meter-label/meter-label.d.ts +3 -3
  84. package/package.json +5 -5
  85. package/pagination/pagination/pagination-state.d.ts +2 -2
  86. package/pagination/pagination-first/pagination-first.d.ts +2 -2
  87. package/pagination/pagination-next/pagination-next.d.ts +2 -2
  88. package/pagination/pagination-previous/pagination-previous.d.ts +2 -2
  89. package/progress/progress/progress-state.d.ts +3 -3
  90. package/progress/progress-indicator/progress-indicator.d.ts +3 -3
  91. package/progress/progress-label/progress-label.d.ts +3 -3
  92. package/progress/progress-track/progress-track.d.ts +3 -3
  93. package/progress/progress-value/progress-value.d.ts +3 -3
  94. package/radio/radio-group/radio-group.d.ts +1 -2
  95. package/roving-focus/roving-focus-group/roving-focus-group-state.d.ts +6 -6
  96. package/schematics/ng-generate/schema.d.ts +2 -1
  97. package/schematics/ng-generate/schema.json +1 -0
  98. package/schematics/ng-generate/templates/popover/popover-trigger.__fileSuffix@dasherize__.ts.template +39 -0
  99. package/schematics/ng-generate/templates/popover/popover.__fileSuffix@dasherize__.ts.template +59 -0
  100. package/select/select/select.d.ts +1 -2
  101. package/slider/slider/slider-state.d.ts +4 -4
  102. package/slider/slider/slider.d.ts +1 -2
  103. package/slider/slider-range/slider-range.d.ts +4 -4
  104. package/slider/slider-thumb/slider-thumb.d.ts +4 -4
  105. package/slider/slider-track/slider-track.d.ts +4 -4
  106. package/tabs/tab-button/tab-button.d.ts +9 -12
  107. package/tabs/tab-list/tab-list.d.ts +6 -6
  108. package/tabs/tab-panel/tab-panel.d.ts +6 -6
  109. package/tabs/tabset/tabset-state.d.ts +6 -6
  110. package/textarea/textarea/textarea.d.ts +1 -2
  111. package/toggle-group/toggle-group/toggle-group-state.d.ts +6 -6
  112. package/toolbar/toolbar/toolbar-state.d.ts +6 -6
@@ -116,10 +116,10 @@ class NgpTabButton {
116
116
  this.select();
117
117
  }
118
118
  }
119
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTabButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
120
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpTabButton, isStandalone: true, selector: "[ngpTabButton]", inputs: { value: { classPropertyName: "value", publicName: "ngpTabButtonValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpTabButtonDisabled", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tab" }, listeners: { "click": "select()", "focus": "activateOnFocus()" }, properties: { "attr.id": "buttonId()", "attr.aria-controls": "ariaControls()", "attr.data-active": "active() ? \"\" : null", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-orientation": "state().orientation()" } }, exportAs: ["ngpTabButton"], hostDirectives: [{ directive: i1.NgpRovingFocusItem }], ngImport: i0 }); }
119
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTabButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
120
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpTabButton, isStandalone: true, selector: "[ngpTabButton]", inputs: { value: { classPropertyName: "value", publicName: "ngpTabButtonValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpTabButtonDisabled", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tab" }, listeners: { "click": "select()", "focus": "activateOnFocus()" }, properties: { "attr.id": "buttonId()", "attr.aria-controls": "ariaControls()", "attr.data-active": "active() ? \"\" : null", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-orientation": "state().orientation()" } }, exportAs: ["ngpTabButton"], hostDirectives: [{ directive: i1.NgpRovingFocusItem }], ngImport: i0 }); }
121
121
  }
122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTabButton, decorators: [{
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTabButton, decorators: [{
123
123
  type: Directive,
124
124
  args: [{
125
125
  selector: '[ngpTabButton]',
@@ -152,10 +152,10 @@ class NgpTabList {
152
152
  */
153
153
  this.state = injectTabsetState();
154
154
  }
155
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTabList, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
156
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: NgpTabList, isStandalone: true, selector: "[ngpTabList]", host: { attributes: { "role": "tablist" }, properties: { "attr.aria-orientation": "state().orientation()", "attr.data-orientation": "state().orientation()" } }, exportAs: ["ngpTabList"], ngImport: i0 }); }
155
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTabList, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
156
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpTabList, isStandalone: true, selector: "[ngpTabList]", host: { attributes: { "role": "tablist" }, properties: { "attr.aria-orientation": "state().orientation()", "attr.data-orientation": "state().orientation()" } }, exportAs: ["ngpTabList"], ngImport: i0 }); }
157
157
  }
158
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTabList, decorators: [{
158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTabList, decorators: [{
159
159
  type: Directive,
160
160
  args: [{
161
161
  selector: '[ngpTabList]',
@@ -219,10 +219,10 @@ class NgpTabPanel {
219
219
  ngOnDestroy() {
220
220
  this.state().unregisterTab(this);
221
221
  }
222
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTabPanel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
223
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpTabPanel, isStandalone: true, selector: "[ngpTabPanel]", inputs: { value: { classPropertyName: "value", publicName: "ngpTabPanelValue", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tabpanel", "tabIndex": "0" }, properties: { "id": "panelId()", "attr.aria-labelledby": "labelledBy()", "attr.data-active": "active() ? \"\" : null", "attr.data-orientation": "state().orientation()" } }, providers: [{ provide: NgpTabPanelToken, useExisting: NgpTabPanel }], exportAs: ["ngpTabPanel"], ngImport: i0 }); }
222
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTabPanel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
223
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpTabPanel, isStandalone: true, selector: "[ngpTabPanel]", inputs: { value: { classPropertyName: "value", publicName: "ngpTabPanelValue", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tabpanel", "tabIndex": "0" }, properties: { "id": "panelId()", "attr.aria-labelledby": "labelledBy()", "attr.data-active": "active() ? \"\" : null", "attr.data-orientation": "state().orientation()" } }, providers: [{ provide: NgpTabPanelToken, useExisting: NgpTabPanel }], exportAs: ["ngpTabPanel"], ngImport: i0 }); }
224
224
  }
225
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTabPanel, decorators: [{
225
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTabPanel, decorators: [{
226
226
  type: Directive,
227
227
  args: [{
228
228
  selector: '[ngpTabPanel]',
@@ -293,8 +293,9 @@ class NgpTabset {
293
293
  */
294
294
  this.selectedTab = computed(() => {
295
295
  const panels = this.panels();
296
+ // if there are no tabs then return the selected value
296
297
  // if there is a value set and a tab with that value exists, return the value
297
- if (panels.some(panel => panel.value() === this.state.value())) {
298
+ if (panels.length === 0 || panels.some(panel => panel.value() === this.state.value())) {
298
299
  return this.state.value();
299
300
  }
300
301
  // otherwise return the first tab
@@ -332,10 +333,10 @@ class NgpTabset {
332
333
  unregisterTab(tab) {
333
334
  this.panels.update(panels => panels.filter(panel => panel !== tab));
334
335
  }
335
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTabset, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
336
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpTabset, isStandalone: true, selector: "[ngpTabset]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpTabsetValue", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "ngpTabsetOrientation", isSignal: true, isRequired: false, transformFunction: null }, activateOnFocus: { classPropertyName: "activateOnFocus", publicName: "ngpTabsetActivateOnFocus", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpTabsetValueChange" }, host: { properties: { "attr.id": "state.id()", "attr.data-orientation": "state.orientation()" } }, providers: [provideTabsetState()], exportAs: ["ngpTabset"], hostDirectives: [{ directive: i1.NgpRovingFocusGroup }], ngImport: i0 }); }
336
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTabset, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
337
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpTabset, isStandalone: true, selector: "[ngpTabset]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpTabsetValue", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "ngpTabsetOrientation", isSignal: true, isRequired: false, transformFunction: null }, activateOnFocus: { classPropertyName: "activateOnFocus", publicName: "ngpTabsetActivateOnFocus", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpTabsetValueChange" }, host: { properties: { "attr.id": "state.id()", "attr.data-orientation": "state.orientation()" } }, providers: [provideTabsetState()], exportAs: ["ngpTabset"], hostDirectives: [{ directive: i1.NgpRovingFocusGroup }], ngImport: i0 }); }
337
338
  }
338
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTabset, decorators: [{
339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTabset, decorators: [{
339
340
  type: Directive,
340
341
  args: [{
341
342
  selector: '[ngpTabset]',
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-tabs.mjs","sources":["../../../../packages/ng-primitives/tabs/src/config/tabs-config.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset-state.ts","../../../../packages/ng-primitives/tabs/src/tab-button/tab-button.ts","../../../../packages/ng-primitives/tabs/src/tab-list/tab-list.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel-token.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset.ts","../../../../packages/ng-primitives/tabs/src/ng-primitives-tabs.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\n\nexport interface NgpTabsConfig {\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n orientation: NgpOrientation;\n\n /**\n * Whether tabs should activate on focus\n * @default true\n */\n activateOnFocus: boolean;\n\n /**\n * Whether focus should wrap within the tab list when using the keyboard.\n * @default true\n */\n wrap: boolean;\n}\n\nexport const defaultTabsConfig: NgpTabsConfig = {\n orientation: 'horizontal',\n activateOnFocus: true,\n wrap: true,\n};\n\nexport const NgpTabsConfigToken = new InjectionToken<NgpTabsConfig>('NgpTabsConfigToken');\n\n/**\n * Provide the default Tabs configuration\n * @param config The Tabs configuration\n * @returns The provider\n */\nexport function provideTabsConfig(config: Partial<NgpTabsConfig>): Provider[] {\n return [\n {\n provide: NgpTabsConfigToken,\n useValue: { ...defaultTabsConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tabs configuration\n * @returns The global Tabs configuration\n */\nexport function injectTabsConfig(): NgpTabsConfig {\n return inject(NgpTabsConfigToken, { optional: true }) ?? defaultTabsConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpTabset } from './tabset';\n\n/**\n * The state token for the Tabset primitive.\n */\nexport const NgpTabsetStateToken = createStateToken<NgpTabset>('Tabset');\n\n/**\n * Provides the Tabset state.\n */\nexport const provideTabsetState = createStateProvider(NgpTabsetStateToken);\n\n/**\n * Injects the Tabset state.\n */\nexport const injectTabsetState = createStateInjector(NgpTabsetStateToken);\n\n/**\n * The Tabset state registration function.\n */\nexport const tabsetState = createState(NgpTabsetStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, HostListener, OnInit, booleanAttribute, computed, input } from '@angular/core';\nimport { setupInteractions } from 'ng-primitives/internal';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * Apply the `ngpTabButton` directive to an element within a tab list to represent a tab button. This directive should be applied to a button element.\n */\n@Directive({\n selector: '[ngpTabButton]',\n exportAs: 'ngpTabButton',\n host: {\n role: 'tab',\n '[attr.id]': 'buttonId()',\n '[attr.aria-controls]': 'ariaControls()',\n '[attr.data-active]': 'active() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-orientation]': 'state().orientation()',\n },\n hostDirectives: [NgpRovingFocusItem],\n})\nexport class NgpTabButton implements OnInit {\n /**\n * Access the tabset state\n */\n protected readonly state = injectTabsetState();\n\n /**\n * The value of the tab this trigger controls\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabButtonValue' });\n\n /**\n * Whether the tab is disabled\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTabButtonDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Determine the id of the tab button\n * @internal\n */\n readonly id = input<string>();\n\n /**\n * Determine a unique id for the tab button if not provided\n * @internal\n */\n readonly buttonId = computed(() => this.id() ?? `${this.state().id()}-button-${this.value()}`);\n\n /**\n * Determine the aria-controls of the tab button\n * @internal\n */\n readonly ariaControls = computed(() => `${this.state().id()}-panel-${this.value()}`);\n\n /**\n * Whether the tab is active\n */\n readonly active = computed(() => this.state().selectedTab() === this.value());\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled: this.disabled,\n });\n }\n\n ngOnInit(): void {\n if (this.value() === undefined) {\n throw new Error('ngpTabButton: value is required');\n }\n }\n\n /**\n * Select the tab this trigger controls\n */\n @HostListener('click')\n select(): void {\n this.state().select(this.value()!);\n }\n\n /**\n * On focus select the tab this trigger controls if activateOnFocus is true\n */\n @HostListener('focus')\n protected activateOnFocus(): void {\n if (this.state().activateOnFocus()) {\n this.select();\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * Apply the `ngpTabList` directive to an element that represents the list of tab buttons.\n */\n@Directive({\n selector: '[ngpTabList]',\n exportAs: 'ngpTabList',\n host: {\n role: 'tablist',\n '[attr.aria-orientation]': 'state().orientation()',\n '[attr.data-orientation]': 'state().orientation()',\n },\n})\nexport class NgpTabList {\n /**\n * Access the tabset state\n */\n protected readonly state = injectTabsetState();\n}\n","import { InjectionToken, inject } from '@angular/core';\nimport type { NgpTabPanel } from './tab-panel';\n\nexport const NgpTabPanelToken = new InjectionToken<NgpTabPanel>('NgpTabPanelToken');\n\n/**\n * Inject the TabPanel directive instance\n * @returns The TabPanel directive instance\n */\nexport function injectTabPanel(): NgpTabPanel {\n return inject(NgpTabPanelToken);\n}\n","import { Directive, OnDestroy, OnInit, computed, input } from '@angular/core';\nimport { injectTabsetState } from '../tabset/tabset-state';\nimport { NgpTabPanelToken } from './tab-panel-token';\n\n/**\n * Apply the `ngpTabPanel` directive to an element that represents the content of a tab.\n */\n@Directive({\n selector: '[ngpTabPanel]',\n exportAs: 'ngpTabPanel',\n providers: [{ provide: NgpTabPanelToken, useExisting: NgpTabPanel }],\n host: {\n role: 'tabpanel',\n tabIndex: '0',\n '[id]': 'panelId()',\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.data-active]': 'active() ? \"\" : null',\n '[attr.data-orientation]': 'state().orientation()',\n },\n})\nexport class NgpTabPanel implements OnInit, OnDestroy {\n /**\n * Access the tabset\n */\n protected readonly state = injectTabsetState();\n\n /**\n * The value of the tab\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabPanelValue' });\n\n /**\n * Determine the id of the tab panel\n * @internal\n */\n readonly id = input<string>();\n\n /**\n * Determine a unique id for the tab panel if not provided\n * @internal\n */\n protected readonly panelId = computed(\n () => this.id() ?? `${this.state().id()}-panel-${this.value()}`,\n );\n\n /**\n * Determine the aria-labelledby of the tab panel\n * @internal\n */\n protected readonly labelledBy = computed(() => `${this.state().id()}-button-${this.value()}`);\n\n /**\n * Whether the tab is active\n */\n protected readonly active = computed(() => this.state().selectedTab() === this.value());\n\n ngOnInit(): void {\n this.state().registerTab(this);\n\n if (this.value() === undefined) {\n throw new Error('ngpTabPanel: value is required');\n }\n }\n\n ngOnDestroy(): void {\n this.state().unregisterTab(this);\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, output, signal } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { syncState } from 'ng-primitives/internal';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectTabsConfig } from '../config/tabs-config';\nimport type { NgpTabPanel } from '../tab-panel/tab-panel';\nimport { provideTabsetState, tabsetState } from './tabset-state';\n\n/**\n * Apply the `ngpTabset` directive to an element to manage the tabs.\n */\n@Directive({\n selector: '[ngpTabset]',\n exportAs: 'ngpTabset',\n providers: [provideTabsetState()],\n hostDirectives: [NgpRovingFocusGroup],\n host: {\n '[attr.id]': 'state.id()',\n '[attr.data-orientation]': 'state.orientation()',\n },\n})\nexport class NgpTabset {\n /**\n * Access the global tabset configuration\n */\n private readonly config = injectTabsConfig();\n\n /**\n * Access the roving focus group state\n */\n private readonly rovingFocusGroupState = injectRovingFocusGroupState();\n\n /**\n * Define the id for the tabset\n */\n readonly id = input<string>(uniqueId('ngp-tabset'));\n\n /**\n * Define the active tab\n */\n readonly value = input<string>(undefined, {\n alias: 'ngpTabsetValue',\n });\n\n /**\n * Emit the value of the selected tab when it changes\n */\n readonly valueChange = output<string | undefined>({\n alias: 'ngpTabsetValueChange',\n });\n\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpTabsetOrientation',\n });\n\n /**\n * Whether tabs should activate on focus\n */\n readonly activateOnFocus = input<boolean, BooleanInput>(this.config.activateOnFocus, {\n alias: 'ngpTabsetActivateOnFocus',\n transform: booleanAttribute,\n });\n\n /**\n * Access the tabs within the tabset\n * @internal\n */\n readonly panels = signal<NgpTabPanel[]>([]);\n\n /**\n * @internal\n * Get the id of the selected tab\n */\n readonly selectedTab = computed(() => {\n const panels = this.panels();\n\n // if there is a value set and a tab with that value exists, return the value\n if (panels.some(panel => panel.value() === this.state.value())) {\n return this.state.value();\n }\n\n // otherwise return the first tab\n return panels[0]?.value();\n });\n\n /**\n * The state of the tabset\n */\n protected readonly state = tabsetState<NgpTabset>(this);\n\n constructor() {\n syncState(this.state.orientation, this.rovingFocusGroupState().orientation);\n }\n\n /**\n * Select a tab by its value\n * @param value The value of the tab to select\n */\n select(value: string): void {\n // if the value is already selected, do nothing\n if (this.state.value() === value) {\n return;\n }\n\n this.state.value.set(value);\n this.valueChange.emit(value);\n }\n\n /**\n * @internal\n * Register a tab with the tabset\n */\n registerTab(tab: NgpTabPanel): void {\n this.panels.update(panels => [...panels, tab]);\n }\n\n /**\n * @internal\n * Unregister a tab with the tabset\n */\n unregisterTab(tab: NgpTabPanel): void {\n this.panels.update(panels => panels.filter(panel => panel !== tab));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAuBO,MAAM,iBAAiB,GAAkB;AAC9C,IAAA,WAAW,EAAE,YAAY;AACzB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,IAAI,EAAE,IAAI;CACX;AAEM,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,CAAC;AAEzF;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,MAA8B,EAAA;IAC9D,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,kBAAkB;AAC3B,YAAA,QAAQ,EAAE,EAAE,GAAG,iBAAiB,EAAE,GAAG,MAAM,EAAE;AAC9C,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,iBAAiB;AAC5E;;AC3CA;;AAEG;AACI,MAAM,mBAAmB,GAAG,gBAAgB,CAAY,QAAQ,CAAC;AAExE;;AAEG;MACU,kBAAkB,GAAG,mBAAmB,CAAC,mBAAmB;AAEzE;;AAEG;MACU,iBAAiB,GAAG,mBAAmB,CAAC,mBAAmB;AAExE;;AAEG;AACI,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC;;ACpB3D;;AAEG;MAcU,YAAY,CAAA;AA2CvB,IAAA,WAAA,GAAA;AA1CA;;AAEG;QACgB,IAAK,CAAA,KAAA,GAAG,iBAAiB,EAAE;AAE9C;;AAEG;QACM,IAAK,CAAA,KAAA,GAAG,KAAK,CAAS,SAAS,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;AAEzE;;;AAGG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,sBAAs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;AACjD,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-tabs.mjs","sources":["../../../../packages/ng-primitives/tabs/src/config/tabs-config.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset-state.ts","../../../../packages/ng-primitives/tabs/src/tab-button/tab-button.ts","../../../../packages/ng-primitives/tabs/src/tab-list/tab-list.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel-token.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset.ts","../../../../packages/ng-primitives/tabs/src/ng-primitives-tabs.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\n\nexport interface NgpTabsConfig {\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n orientation: NgpOrientation;\n\n /**\n * Whether tabs should activate on focus\n * @default true\n */\n activateOnFocus: boolean;\n\n /**\n * Whether focus should wrap within the tab list when using the keyboard.\n * @default true\n */\n wrap: boolean;\n}\n\nexport const defaultTabsConfig: NgpTabsConfig = {\n orientation: 'horizontal',\n activateOnFocus: true,\n wrap: true,\n};\n\nexport const NgpTabsConfigToken = new InjectionToken<NgpTabsConfig>('NgpTabsConfigToken');\n\n/**\n * Provide the default Tabs configuration\n * @param config The Tabs configuration\n * @returns The provider\n */\nexport function provideTabsConfig(config: Partial<NgpTabsConfig>): Provider[] {\n return [\n {\n provide: NgpTabsConfigToken,\n useValue: { ...defaultTabsConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tabs configuration\n * @returns The global Tabs configuration\n */\nexport function injectTabsConfig(): NgpTabsConfig {\n return inject(NgpTabsConfigToken, { optional: true }) ?? defaultTabsConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpTabset } from './tabset';\n\n/**\n * The state token for the Tabset primitive.\n */\nexport const NgpTabsetStateToken = createStateToken<NgpTabset>('Tabset');\n\n/**\n * Provides the Tabset state.\n */\nexport const provideTabsetState = createStateProvider(NgpTabsetStateToken);\n\n/**\n * Injects the Tabset state.\n */\nexport const injectTabsetState = createStateInjector(NgpTabsetStateToken);\n\n/**\n * The Tabset state registration function.\n */\nexport const tabsetState = createState(NgpTabsetStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, HostListener, OnInit, booleanAttribute, computed, input } from '@angular/core';\nimport { setupInteractions } from 'ng-primitives/internal';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * Apply the `ngpTabButton` directive to an element within a tab list to represent a tab button. This directive should be applied to a button element.\n */\n@Directive({\n selector: '[ngpTabButton]',\n exportAs: 'ngpTabButton',\n host: {\n role: 'tab',\n '[attr.id]': 'buttonId()',\n '[attr.aria-controls]': 'ariaControls()',\n '[attr.data-active]': 'active() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-orientation]': 'state().orientation()',\n },\n hostDirectives: [NgpRovingFocusItem],\n})\nexport class NgpTabButton implements OnInit {\n /**\n * Access the tabset state\n */\n protected readonly state = injectTabsetState();\n\n /**\n * The value of the tab this trigger controls\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabButtonValue' });\n\n /**\n * Whether the tab is disabled\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTabButtonDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Determine the id of the tab button\n * @internal\n */\n readonly id = input<string>();\n\n /**\n * Determine a unique id for the tab button if not provided\n * @internal\n */\n readonly buttonId = computed(() => this.id() ?? `${this.state().id()}-button-${this.value()}`);\n\n /**\n * Determine the aria-controls of the tab button\n * @internal\n */\n readonly ariaControls = computed(() => `${this.state().id()}-panel-${this.value()}`);\n\n /**\n * Whether the tab is active\n */\n readonly active = computed(() => this.state().selectedTab() === this.value());\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled: this.disabled,\n });\n }\n\n ngOnInit(): void {\n if (this.value() === undefined) {\n throw new Error('ngpTabButton: value is required');\n }\n }\n\n /**\n * Select the tab this trigger controls\n */\n @HostListener('click')\n select(): void {\n this.state().select(this.value()!);\n }\n\n /**\n * On focus select the tab this trigger controls if activateOnFocus is true\n */\n @HostListener('focus')\n protected activateOnFocus(): void {\n if (this.state().activateOnFocus()) {\n this.select();\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * Apply the `ngpTabList` directive to an element that represents the list of tab buttons.\n */\n@Directive({\n selector: '[ngpTabList]',\n exportAs: 'ngpTabList',\n host: {\n role: 'tablist',\n '[attr.aria-orientation]': 'state().orientation()',\n '[attr.data-orientation]': 'state().orientation()',\n },\n})\nexport class NgpTabList {\n /**\n * Access the tabset state\n */\n protected readonly state = injectTabsetState();\n}\n","import { InjectionToken, inject } from '@angular/core';\nimport type { NgpTabPanel } from './tab-panel';\n\nexport const NgpTabPanelToken = new InjectionToken<NgpTabPanel>('NgpTabPanelToken');\n\n/**\n * Inject the TabPanel directive instance\n * @returns The TabPanel directive instance\n */\nexport function injectTabPanel(): NgpTabPanel {\n return inject(NgpTabPanelToken);\n}\n","import { Directive, OnDestroy, OnInit, computed, input } from '@angular/core';\nimport { injectTabsetState } from '../tabset/tabset-state';\nimport { NgpTabPanelToken } from './tab-panel-token';\n\n/**\n * Apply the `ngpTabPanel` directive to an element that represents the content of a tab.\n */\n@Directive({\n selector: '[ngpTabPanel]',\n exportAs: 'ngpTabPanel',\n providers: [{ provide: NgpTabPanelToken, useExisting: NgpTabPanel }],\n host: {\n role: 'tabpanel',\n tabIndex: '0',\n '[id]': 'panelId()',\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.data-active]': 'active() ? \"\" : null',\n '[attr.data-orientation]': 'state().orientation()',\n },\n})\nexport class NgpTabPanel implements OnInit, OnDestroy {\n /**\n * Access the tabset\n */\n protected readonly state = injectTabsetState();\n\n /**\n * The value of the tab\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabPanelValue' });\n\n /**\n * Determine the id of the tab panel\n * @internal\n */\n readonly id = input<string>();\n\n /**\n * Determine a unique id for the tab panel if not provided\n * @internal\n */\n protected readonly panelId = computed(\n () => this.id() ?? `${this.state().id()}-panel-${this.value()}`,\n );\n\n /**\n * Determine the aria-labelledby of the tab panel\n * @internal\n */\n protected readonly labelledBy = computed(() => `${this.state().id()}-button-${this.value()}`);\n\n /**\n * Whether the tab is active\n */\n protected readonly active = computed(() => this.state().selectedTab() === this.value());\n\n ngOnInit(): void {\n this.state().registerTab(this);\n\n if (this.value() === undefined) {\n throw new Error('ngpTabPanel: value is required');\n }\n }\n\n ngOnDestroy(): void {\n this.state().unregisterTab(this);\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, output, signal } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { syncState } from 'ng-primitives/internal';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectTabsConfig } from '../config/tabs-config';\nimport type { NgpTabPanel } from '../tab-panel/tab-panel';\nimport { provideTabsetState, tabsetState } from './tabset-state';\n\n/**\n * Apply the `ngpTabset` directive to an element to manage the tabs.\n */\n@Directive({\n selector: '[ngpTabset]',\n exportAs: 'ngpTabset',\n providers: [provideTabsetState()],\n hostDirectives: [NgpRovingFocusGroup],\n host: {\n '[attr.id]': 'state.id()',\n '[attr.data-orientation]': 'state.orientation()',\n },\n})\nexport class NgpTabset {\n /**\n * Access the global tabset configuration\n */\n private readonly config = injectTabsConfig();\n\n /**\n * Access the roving focus group state\n */\n private readonly rovingFocusGroupState = injectRovingFocusGroupState();\n\n /**\n * Define the id for the tabset\n */\n readonly id = input<string>(uniqueId('ngp-tabset'));\n\n /**\n * Define the active tab\n */\n readonly value = input<string>(undefined, {\n alias: 'ngpTabsetValue',\n });\n\n /**\n * Emit the value of the selected tab when it changes\n */\n readonly valueChange = output<string | undefined>({\n alias: 'ngpTabsetValueChange',\n });\n\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpTabsetOrientation',\n });\n\n /**\n * Whether tabs should activate on focus\n */\n readonly activateOnFocus = input<boolean, BooleanInput>(this.config.activateOnFocus, {\n alias: 'ngpTabsetActivateOnFocus',\n transform: booleanAttribute,\n });\n\n /**\n * Access the tabs within the tabset\n * @internal\n */\n readonly panels = signal<NgpTabPanel[]>([]);\n\n /**\n * @internal\n * Get the id of the selected tab\n */\n readonly selectedTab = computed(() => {\n const panels = this.panels();\n\n // if there are no tabs then return the selected value\n // if there is a value set and a tab with that value exists, return the value\n if (panels.length === 0 || panels.some(panel => panel.value() === this.state.value())) {\n return this.state.value();\n }\n\n // otherwise return the first tab\n return panels[0]?.value();\n });\n\n /**\n * The state of the tabset\n */\n protected readonly state = tabsetState<NgpTabset>(this);\n\n constructor() {\n syncState(this.state.orientation, this.rovingFocusGroupState().orientation);\n }\n\n /**\n * Select a tab by its value\n * @param value The value of the tab to select\n */\n select(value: string): void {\n // if the value is already selected, do nothing\n if (this.state.value() === value) {\n return;\n }\n\n this.state.value.set(value);\n this.valueChange.emit(value);\n }\n\n /**\n * @internal\n * Register a tab with the tabset\n */\n registerTab(tab: NgpTabPanel): void {\n this.panels.update(panels => [...panels, tab]);\n }\n\n /**\n * @internal\n * Unregister a tab with the tabset\n */\n unregisterTab(tab: NgpTabPanel): void {\n this.panels.update(panels => panels.filter(panel => panel !== tab));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAuBO,MAAM,iBAAiB,GAAkB;AAC9C,IAAA,WAAW,EAAE,YAAY;AACzB,IAAA,eAAe,EAAE,IAAI;AAC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A,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,sBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,eAAA,EAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,0BAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,WAAA,EAAA,sBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,uBAAA,EAAA,qBAAA,EAAA,EAAA,EAAA,SAAA,EAAA,CAAC,kBAAkB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAOtB,SAAS,EAAA,UAAA,EAAA,CAAA;kBAVrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,SAAS,EAAE,CAAC,kBAAkB,EAAE,CAAC;oBACjC,cAAc,EAAE,CAAC,mBAAmB,CAAC;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,WAAW,EAAE,YAAY;AACzB,wBAAA,yBAAyB,EAAE,qBAAqB;AACjD,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
@@ -1,7 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { input, booleanAttribute, Directive } from '@angular/core';
3
- import * as i1 from 'ng-primitives/form-field';
4
- import { syncFormControl, NgpFormControl } from 'ng-primitives/form-field';
3
+ import { setupFormControl } from 'ng-primitives/form-field';
5
4
  import { setupInteractions } from 'ng-primitives/internal';
6
5
  import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
7
6
 
@@ -40,18 +39,17 @@ class NgpTextarea {
40
39
  focus: true,
41
40
  disabled: this.state.disabled,
42
41
  });
43
- syncFormControl({ disabled: this.state.disabled });
42
+ setupFormControl({ disabled: this.state.disabled });
44
43
  }
45
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTextarea, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
46
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpTextarea, isStandalone: true, selector: "[ngpTextarea]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideTextareaState()], exportAs: ["ngpTextarea"], hostDirectives: [{ directive: i1.NgpFormControl }], ngImport: i0 }); }
44
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTextarea, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
45
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpTextarea, isStandalone: true, selector: "[ngpTextarea]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideTextareaState()], exportAs: ["ngpTextarea"], ngImport: i0 }); }
47
46
  }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTextarea, decorators: [{
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTextarea, decorators: [{
49
48
  type: Directive,
50
49
  args: [{
51
50
  selector: '[ngpTextarea]',
52
51
  exportAs: 'ngpTextarea',
53
52
  providers: [provideTextareaState()],
54
- hostDirectives: [NgpFormControl],
55
53
  }]
56
54
  }], ctorParameters: () => [] });
57
55
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-textarea.mjs","sources":["../../../../packages/ng-primitives/textarea/src/textarea/textarea-state.ts","../../../../packages/ng-primitives/textarea/src/textarea/textarea.ts","../../../../packages/ng-primitives/textarea/src/ng-primitives-textarea.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpTextarea } from './textarea';\n\n/**\n * The state token for the Textarea primitive.\n */\nexport const NgpTextareaStateToken = createStateToken<NgpTextarea>('Textarea');\n\n/**\n * Provides the Textarea state.\n */\nexport const provideTextareaState = createStateProvider(NgpTextareaStateToken);\n\n/**\n * Injects the Textarea state.\n */\nexport const injectTextareaState = createStateInjector(NgpTextareaStateToken);\n\n/**\n * The Textarea state registration function.\n */\nexport const textareaState = createState(NgpTextareaStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { NgpFormControl, syncFormControl } from 'ng-primitives/form-field';\nimport { setupInteractions } from 'ng-primitives/internal';\nimport { provideTextareaState, textareaState } from './textarea-state';\n\n@Directive({\n selector: '[ngpTextarea]',\n exportAs: 'ngpTextarea',\n providers: [provideTextareaState()],\n hostDirectives: [NgpFormControl],\n})\nexport class NgpTextarea {\n /**\n * Whether the element is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /**\n * The state of the textarea.\n */\n protected readonly state = textareaState<NgpTextarea>(this);\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n focus: true,\n disabled: this.state.disabled,\n });\n syncFormControl({ disabled: this.state.disabled });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,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EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,cAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAGxB,WAAW,EAAA,UAAA,EAAA,CAAA;kBANvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,SAAS,EAAE,CAAC,oBAAoB,EAAE,CAAC;oBACnC,cAAc,EAAE,CAAC,cAAc,CAAC;AACjC,iBAAA;;;ACXD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-textarea.mjs","sources":["../../../../packages/ng-primitives/textarea/src/textarea/textarea-state.ts","../../../../packages/ng-primitives/textarea/src/textarea/textarea.ts","../../../../packages/ng-primitives/textarea/src/ng-primitives-textarea.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpTextarea } from './textarea';\n\n/**\n * The state token for the Textarea primitive.\n */\nexport const NgpTextareaStateToken = createStateToken<NgpTextarea>('Textarea');\n\n/**\n * Provides the Textarea state.\n */\nexport const provideTextareaState = createStateProvider(NgpTextareaStateToken);\n\n/**\n * Injects the Textarea state.\n */\nexport const injectTextareaState = createStateInjector(NgpTextareaStateToken);\n\n/**\n * The Textarea state registration function.\n */\nexport const textareaState = createState(NgpTextareaStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { setupInteractions } from 'ng-primitives/internal';\nimport { provideTextareaState, textareaState } from './textarea-state';\n\n@Directive({\n selector: '[ngpTextarea]',\n exportAs: 'ngpTextarea',\n providers: [provideTextareaState()],\n})\nexport class NgpTextarea {\n /**\n * Whether the element is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /**\n * The state of the textarea.\n */\n protected readonly state = textareaState<NgpTextarea>(this);\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n focus: true,\n disabled: this.state.disabled,\n });\n setupFormControl({ disabled: this.state.disabled });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,qBAAqB;AAE7E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAC,qBAAqB;AAE5E;;AAEG;AACI,MAAM,aAAa,GAAG,WAAW,CAAC,qBAAqB,CAAC;;MCflD,WAAW,CAAA;AAatB,IAAA,WAAA,GAAA;AAZA;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC;AAEF;;AAEG;AACgB,QAAA,IAAA,CAAA,KAAK,GAAG,aAAa,CAAc,IAAI,CAAC;AAGzD,QAAA,iBAAiB,CAAC;AAChB,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ;AAC9B,SAAA,CAAC;QACF,gBAAgB,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;;+GApB1C,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAX,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,WAAW,EAFX,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,SAAA,EAAA,CAAC,oBAAoB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAExB,WAAW,EAAA,UAAA,EAAA,CAAA;kBALvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,SAAS,EAAE,CAAC,oBAAoB,EAAE,CAAC;AACpC,iBAAA;;;ACVD;;AAEG;;;;"}
@@ -222,10 +222,10 @@ class NgpToast {
222
222
  }
223
223
  }
224
224
  }
225
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpToast, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
226
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpToast, isStandalone: true, selector: "[ngpToast]", inputs: { duration: { classPropertyName: "duration", publicName: "ngpToastDuration", isSignal: true, isRequired: false, transformFunction: null }, gravity: { classPropertyName: "gravity", publicName: "ngpToastGravity", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "ngpToastPosition", isSignal: true, isRequired: false, transformFunction: null }, stopOnHover: { classPropertyName: "stopOnHover", publicName: "ngpToastStopOnHover", isSignal: true, isRequired: false, transformFunction: null }, ariaLive: { classPropertyName: "ariaLive", publicName: "ngpToastAriaLive", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ngpToast"], ngImport: i0 }); }
225
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToast, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
226
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpToast, isStandalone: true, selector: "[ngpToast]", inputs: { duration: { classPropertyName: "duration", publicName: "ngpToastDuration", isSignal: true, isRequired: false, transformFunction: null }, gravity: { classPropertyName: "gravity", publicName: "ngpToastGravity", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "ngpToastPosition", isSignal: true, isRequired: false, transformFunction: null }, stopOnHover: { classPropertyName: "stopOnHover", publicName: "ngpToastStopOnHover", isSignal: true, isRequired: false, transformFunction: null }, ariaLive: { classPropertyName: "ariaLive", publicName: "ngpToastAriaLive", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ngpToast"], ngImport: i0 }); }
227
227
  }
228
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpToast, decorators: [{
228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToast, decorators: [{
229
229
  type: Directive,
230
230
  args: [{
231
231
  selector: '[ngpToast]',
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-toast.mjs","sources":["../../../../packages/ng-primitives/toast/src/config/toast-config.ts","../../../../packages/ng-primitives/toast/src/toast/toast-ref.ts","../../../../packages/ng-primitives/toast/src/toast/toast.ts","../../../../packages/ng-primitives/toast/src/ng-primitives-toast.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpToastGravity, NgpToastPosition } from '../toast/toast-ref';\n\nexport interface NgpToastConfig {\n /**\n * The duration of each toast.\n */\n duration: number;\n\n /**\n * The gravity of each toast.\n */\n gravity: NgpToastGravity;\n\n /**\n * The position of each toast.\n */\n position: NgpToastPosition;\n\n /**\n * Whether we should stop on hover.\n */\n stopOnHover: boolean;\n\n /**\n * The aria live setting.\n */\n ariaLive: string;\n\n /**\n * The gap between each toast.\n */\n gap: number;\n}\n\nexport const defaultToastConfig: NgpToastConfig = {\n gap: 16,\n duration: 3000,\n gravity: 'top',\n position: 'end',\n stopOnHover: true,\n ariaLive: 'polite',\n};\n\nexport const NgpToastConfigToken = new InjectionToken<NgpToastConfig>('NgpToastConfigToken');\n\n/**\n * Provide the default Toast configuration\n * @param config The Toast configuration\n * @returns The provider\n */\nexport function provideToastConfig(config: Partial<NgpToastConfig>): Provider[] {\n return [\n {\n provide: NgpToastConfigToken,\n useValue: { ...defaultToastConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Toast configuration\n * @returns The global Toast configuration\n */\nexport function injectToastConfig(): NgpToastConfig {\n return inject(NgpToastConfigToken, { optional: true }) ?? defaultToastConfig;\n}\n","export type NgpToastPosition = 'start' | 'center' | 'end';\nexport type NgpToastGravity = 'top' | 'bottom';\n\nexport class NgpToastRef {\n /** Store the current timeout */\n private timeoutId: number | null = null;\n\n /** Get the toast height */\n get height(): number {\n return this.toastElement.offsetHeight;\n }\n\n constructor(\n /** Store the toast element */\n private readonly toastElement: HTMLElement,\n /** Store the duration */\n private readonly duration: number,\n /** The position of the toast */\n public readonly position: NgpToastPosition,\n /** The gravity of the toast */\n public readonly gravity: NgpToastGravity,\n /** Whether we should stop on focus */\n private readonly stopOnHover: boolean,\n /** The aria live setting */\n private readonly ariaLive: string,\n private readonly onDismiss: () => void,\n ) {\n this.toastElement.setAttribute('data-toast', 'visible');\n\n this.setPosition(position);\n this.setGravity(gravity);\n this.setAriaLive(ariaLive);\n this.setupTimeouts();\n this.setupListeners();\n }\n\n dismiss(): void {\n // determine if there is a transition on the element\n const transitionDuration = parseFloat(getComputedStyle(this.toastElement).transitionDuration);\n\n // if there is no transition, dismiss immediately\n if (transitionDuration === 0) {\n this.removeElement();\n return;\n }\n\n // wait for the transition to end\n this.toastElement.addEventListener('transitionend', () => this.removeElement());\n\n this.toastElement.setAttribute('data-toast', 'hidden');\n }\n\n private removeElement(): void {\n this.toastElement.parentNode?.removeChild(this.toastElement);\n this.onDismiss();\n }\n\n /** Setup duration timeouts */\n private setupTimeouts(): void {\n // if the duration is 0 skip\n if (this.duration === 0) {\n return;\n }\n\n this.timeoutId = window.setTimeout(() => this.dismiss(), this.duration);\n }\n\n private setupListeners(): void {\n if (!this.stopOnHover) {\n return;\n }\n\n // setup event listeners if we should stop on focus\n this.toastElement.addEventListener('mouseover', () => {\n window.clearTimeout(this.timeoutId!);\n this.timeoutId = null;\n });\n\n this.toastElement.addEventListener('mouseleave', () => this.setupTimeouts());\n }\n\n /** Set the position attribute */\n private setPosition(position: NgpToastPosition): void {\n this.toastElement.setAttribute('data-position', position);\n }\n\n /** Set the gravity attribute */\n private setGravity(gravity: NgpToastGravity): void {\n this.toastElement.setAttribute('data-gravity', gravity);\n }\n\n /** Set the aria live attribute */\n private setAriaLive(ariaLive: string): void {\n this.toastElement.setAttribute('aria-live', ariaLive);\n }\n\n /**\n * @internal\n */\n setInset(property: 'top' | 'bottom', value: string): void {\n this.toastElement.style[property] = value;\n }\n}\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { DomPortalOutlet, TemplatePortal } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n booleanAttribute,\n Directive,\n inject,\n Injector,\n input,\n numberAttribute,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToastGravity, NgpToastPosition, NgpToastRef } from './toast-ref';\n\nexport interface NgpToastContext {\n dismiss: () => void;\n}\n\n@Directive({\n selector: '[ngpToast]',\n exportAs: 'ngpToast',\n})\nexport class NgpToast {\n private readonly config = injectToastConfig();\n\n /** Access the ng-template */\n private readonly template = inject<TemplateRef<NgpToastContext>>(TemplateRef);\n\n /** Access the view container */\n private readonly viewContainer = inject(ViewContainerRef);\n\n /** Access the injector */\n private readonly injector = inject(Injector);\n\n /** Access the document */\n private readonly document = inject(DOCUMENT);\n\n /**\n * The duration the toast will display for before it is automatically dismissed in milliseconds.\n * @default 3000\n */\n readonly duration = input<number, NumberInput>(this.config.duration, {\n alias: 'ngpToastDuration',\n transform: numberAttribute,\n });\n\n /**\n * The direction the toast will appear from.\n * @default 'top'\n */\n readonly gravity = input<NgpToastGravity>(this.config.gravity, {\n alias: 'ngpToastGravity',\n });\n\n /**\n * The position the toast will on the horizontal axis.\n * @default 'end'\n */\n readonly position = input<NgpToastPosition>(this.config.position, {\n alias: 'ngpToastPosition',\n });\n\n /**\n * Whether the automatic dismissal of the toast should be paused when the user hovers over it.\n * @default true\n */\n readonly stopOnHover = input<boolean, BooleanInput>(this.config.stopOnHover, {\n alias: 'ngpToastStopOnHover',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the toast should be announced to assistive technologies.\n * @default 'polite'\n */\n readonly ariaLive = input(this.config.ariaLive, {\n alias: 'ngpToastAriaLive',\n });\n\n /** Store the list of toasts */\n private static toasts: NgpToastRef[] = [];\n\n /** Show the toast. */\n show(): void {\n this.createToast();\n this.reposition();\n }\n\n /** Build the toast */\n private createToast(): void {\n const portal = new TemplatePortal<NgpToastContext>(\n this.template,\n this.viewContainer,\n {\n dismiss: () => toastRef.dismiss(),\n },\n this.injector,\n );\n\n const domOutlet = new DomPortalOutlet(\n this.document.body,\n undefined,\n undefined,\n Injector.create({\n parent: this.injector,\n providers: [],\n }),\n );\n\n const viewRef = domOutlet.attach(portal);\n viewRef.detectChanges();\n\n const toastElement = viewRef.rootNodes[0];\n\n const toastRef = new NgpToastRef(\n toastElement,\n this.duration(),\n this.position(),\n this.gravity(),\n this.stopOnHover(),\n this.ariaLive(),\n () => {\n NgpToast.toasts = NgpToast.toasts.filter(t => t !== toastRef);\n this.reposition();\n },\n );\n\n NgpToast.toasts = [...NgpToast.toasts, toastRef];\n }\n\n /** Position the toast on the DOM */\n private reposition(): void {\n const topStartOffsetSize = {\n top: this.config.gap,\n bottom: this.config.gap,\n };\n\n const topEndOffsetSize = {\n top: this.config.gap,\n bottom: this.config.gap,\n };\n\n let position: 'top' | 'bottom';\n\n // update the position of the toasts\n for (const toast of NgpToast.toasts) {\n // Getting the applied gravity\n position = toast.gravity;\n\n const height = toast.height;\n\n if (toast.position === 'start') {\n toast.setInset(position, `${topStartOffsetSize[position]}px`);\n topStartOffsetSize[position] += height + this.config.gap;\n } else {\n toast.setInset(position, `${topEndOffsetSize[position]}px`);\n topEndOffsetSize[position] += height + this.config.gap;\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAmCO,MAAM,kBAAkB,GAAmB;AAChD,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,QAAQ,EAAE,QAAQ;CACnB;AAEM,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAAiB,qBAAqB,CAAC;AAE5F;;;;AAIG;AACG,SAAU,kBAAkB,CAAC,MAA+B,EAAA;IAChE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,mBAAmB;AAC5B,YAAA,QAAQ,EAAE,EAAE,GAAG,kBAAkB,EAAE,GAAG,MAAM,EAAE;AAC/C,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,iBAAiB,GAAA;AAC/B,IAAA,OAAO,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,kBAAkB;AAC9E;;MC/Da,WAAW,CAAA;;AAKtB,IAAA,IAAI,MAAM,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY;;AAGvC,IAAA,WAAA;;IAEmB,YAAyB;;IAEzB,QAAgB;;IAEjB,QAA0B;;IAE1B,OAAwB;;IAEvB,WAAoB;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AA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAJpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACrB,iBAAA;;;ACvBD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-toast.mjs","sources":["../../../../packages/ng-primitives/toast/src/config/toast-config.ts","../../../../packages/ng-primitives/toast/src/toast/toast-ref.ts","../../../../packages/ng-primitives/toast/src/toast/toast.ts","../../../../packages/ng-primitives/toast/src/ng-primitives-toast.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpToastGravity, NgpToastPosition } from '../toast/toast-ref';\n\nexport interface NgpToastConfig {\n /**\n * The duration of each toast.\n */\n duration: number;\n\n /**\n * The gravity of each toast.\n */\n gravity: NgpToastGravity;\n\n /**\n * The position of each toast.\n */\n position: NgpToastPosition;\n\n /**\n * Whether we should stop on hover.\n */\n stopOnHover: boolean;\n\n /**\n * The aria live setting.\n */\n ariaLive: string;\n\n /**\n * The gap between each toast.\n */\n gap: number;\n}\n\nexport const defaultToastConfig: NgpToastConfig = {\n gap: 16,\n duration: 3000,\n gravity: 'top',\n position: 'end',\n stopOnHover: true,\n ariaLive: 'polite',\n};\n\nexport const NgpToastConfigToken = new InjectionToken<NgpToastConfig>('NgpToastConfigToken');\n\n/**\n * Provide the default Toast configuration\n * @param config The Toast configuration\n * @returns The provider\n */\nexport function provideToastConfig(config: Partial<NgpToastConfig>): Provider[] {\n return [\n {\n provide: NgpToastConfigToken,\n useValue: { ...defaultToastConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Toast configuration\n * @returns The global Toast configuration\n */\nexport function injectToastConfig(): NgpToastConfig {\n return inject(NgpToastConfigToken, { optional: true }) ?? defaultToastConfig;\n}\n","export type NgpToastPosition = 'start' | 'center' | 'end';\nexport type NgpToastGravity = 'top' | 'bottom';\n\nexport class NgpToastRef {\n /** Store the current timeout */\n private timeoutId: number | null = null;\n\n /** Get the toast height */\n get height(): number {\n return this.toastElement.offsetHeight;\n }\n\n constructor(\n /** Store the toast element */\n private readonly toastElement: HTMLElement,\n /** Store the duration */\n private readonly duration: number,\n /** The position of the toast */\n public readonly position: NgpToastPosition,\n /** The gravity of the toast */\n public readonly gravity: NgpToastGravity,\n /** Whether we should stop on focus */\n private readonly stopOnHover: boolean,\n /** The aria live setting */\n private readonly ariaLive: string,\n private readonly onDismiss: () => void,\n ) {\n this.toastElement.setAttribute('data-toast', 'visible');\n\n this.setPosition(position);\n this.setGravity(gravity);\n this.setAriaLive(ariaLive);\n this.setupTimeouts();\n this.setupListeners();\n }\n\n dismiss(): void {\n // determine if there is a transition on the element\n const transitionDuration = parseFloat(getComputedStyle(this.toastElement).transitionDuration);\n\n // if there is no transition, dismiss immediately\n if (transitionDuration === 0) {\n this.removeElement();\n return;\n }\n\n // wait for the transition to end\n this.toastElement.addEventListener('transitionend', () => this.removeElement());\n\n this.toastElement.setAttribute('data-toast', 'hidden');\n }\n\n private removeElement(): void {\n this.toastElement.parentNode?.removeChild(this.toastElement);\n this.onDismiss();\n }\n\n /** Setup duration timeouts */\n private setupTimeouts(): void {\n // if the duration is 0 skip\n if (this.duration === 0) {\n return;\n }\n\n this.timeoutId = window.setTimeout(() => this.dismiss(), this.duration);\n }\n\n private setupListeners(): void {\n if (!this.stopOnHover) {\n return;\n }\n\n // setup event listeners if we should stop on focus\n this.toastElement.addEventListener('mouseover', () => {\n window.clearTimeout(this.timeoutId!);\n this.timeoutId = null;\n });\n\n this.toastElement.addEventListener('mouseleave', () => this.setupTimeouts());\n }\n\n /** Set the position attribute */\n private setPosition(position: NgpToastPosition): void {\n this.toastElement.setAttribute('data-position', position);\n }\n\n /** Set the gravity attribute */\n private setGravity(gravity: NgpToastGravity): void {\n this.toastElement.setAttribute('data-gravity', gravity);\n }\n\n /** Set the aria live attribute */\n private setAriaLive(ariaLive: string): void {\n this.toastElement.setAttribute('aria-live', ariaLive);\n }\n\n /**\n * @internal\n */\n setInset(property: 'top' | 'bottom', value: string): void {\n this.toastElement.style[property] = value;\n }\n}\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { DomPortalOutlet, TemplatePortal } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n booleanAttribute,\n Directive,\n inject,\n Injector,\n input,\n numberAttribute,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToastGravity, NgpToastPosition, NgpToastRef } from './toast-ref';\n\nexport interface NgpToastContext {\n dismiss: () => void;\n}\n\n@Directive({\n selector: '[ngpToast]',\n exportAs: 'ngpToast',\n})\nexport class NgpToast {\n private readonly config = injectToastConfig();\n\n /** Access the ng-template */\n private readonly template = inject<TemplateRef<NgpToastContext>>(TemplateRef);\n\n /** Access the view container */\n private readonly viewContainer = inject(ViewContainerRef);\n\n /** Access the injector */\n private readonly injector = inject(Injector);\n\n /** Access the document */\n private readonly document = inject(DOCUMENT);\n\n /**\n * The duration the toast will display for before it is automatically dismissed in milliseconds.\n * @default 3000\n */\n readonly duration = input<number, NumberInput>(this.config.duration, {\n alias: 'ngpToastDuration',\n transform: numberAttribute,\n });\n\n /**\n * The direction the toast will appear from.\n * @default 'top'\n */\n readonly gravity = input<NgpToastGravity>(this.config.gravity, {\n alias: 'ngpToastGravity',\n });\n\n /**\n * The position the toast will on the horizontal axis.\n * @default 'end'\n */\n readonly position = input<NgpToastPosition>(this.config.position, {\n alias: 'ngpToastPosition',\n });\n\n /**\n * Whether the automatic dismissal of the toast should be paused when the user hovers over it.\n * @default true\n */\n readonly stopOnHover = input<boolean, BooleanInput>(this.config.stopOnHover, {\n alias: 'ngpToastStopOnHover',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the toast should be announced to assistive technologies.\n * @default 'polite'\n */\n readonly ariaLive = input(this.config.ariaLive, {\n alias: 'ngpToastAriaLive',\n });\n\n /** Store the list of toasts */\n private static toasts: NgpToastRef[] = [];\n\n /** Show the toast. */\n show(): void {\n this.createToast();\n this.reposition();\n }\n\n /** Build the toast */\n private createToast(): void {\n const portal = new TemplatePortal<NgpToastContext>(\n this.template,\n this.viewContainer,\n {\n dismiss: () => toastRef.dismiss(),\n },\n this.injector,\n );\n\n const domOutlet = new DomPortalOutlet(\n this.document.body,\n undefined,\n undefined,\n Injector.create({\n parent: this.injector,\n providers: [],\n }),\n );\n\n const viewRef = domOutlet.attach(portal);\n viewRef.detectChanges();\n\n const toastElement = viewRef.rootNodes[0];\n\n const toastRef = new NgpToastRef(\n toastElement,\n this.duration(),\n this.position(),\n this.gravity(),\n this.stopOnHover(),\n this.ariaLive(),\n () => {\n NgpToast.toasts = NgpToast.toasts.filter(t => t !== toastRef);\n this.reposition();\n },\n );\n\n NgpToast.toasts = [...NgpToast.toasts, toastRef];\n }\n\n /** Position the toast on the DOM */\n private reposition(): void {\n const topStartOffsetSize = {\n top: this.config.gap,\n bottom: this.config.gap,\n };\n\n const topEndOffsetSize = {\n top: this.config.gap,\n bottom: this.config.gap,\n };\n\n let position: 'top' | 'bottom';\n\n // update the position of the toasts\n for (const toast of NgpToast.toasts) {\n // Getting the applied gravity\n position = toast.gravity;\n\n const height = toast.height;\n\n if (toast.position === 'start') {\n toast.setInset(position, `${topStartOffsetSize[position]}px`);\n topStartOffsetSize[position] += height + this.config.gap;\n } else {\n toast.setInset(position, `${topEndOffsetSize[position]}px`);\n topEndOffsetSize[position] += height + this.config.gap;\n }\n }\n }\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AC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACrB,iBAAA;;;ACvBD;;AAEG;;;;"}
@@ -108,10 +108,10 @@ class NgpToggleGroupItem {
108
108
  }
109
109
  this.toggleGroup().toggle(this.state.value());
110
110
  }
111
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpToggleGroupItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
112
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpToggleGroupItem, isStandalone: true, selector: "[ngpToggleGroupItem]", inputs: { value: { classPropertyName: "value", publicName: "ngpToggleGroupItemValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpToggleGroupItemDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "radio" }, listeners: { "click": "toggle()" }, properties: { "attr.aria-checked": "selected()", "attr.data-selected": "selected() ? \"\" : null", "attr.aria-disabled": "state.disabled()", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideToggleGroupItemState()], exportAs: ["ngpToggleGroupItem"], hostDirectives: [{ directive: i1.NgpRovingFocusItem, inputs: ["ngpRovingFocusItemDisabled", "ngpToggleGroupItemDisabled"] }], ngImport: i0 }); }
111
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToggleGroupItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
112
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpToggleGroupItem, isStandalone: true, selector: "[ngpToggleGroupItem]", inputs: { value: { classPropertyName: "value", publicName: "ngpToggleGroupItemValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpToggleGroupItemDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "radio" }, listeners: { "click": "toggle()" }, properties: { "attr.aria-checked": "selected()", "attr.data-selected": "selected() ? \"\" : null", "attr.aria-disabled": "state.disabled()", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideToggleGroupItemState()], exportAs: ["ngpToggleGroupItem"], hostDirectives: [{ directive: i1.NgpRovingFocusItem, inputs: ["ngpRovingFocusItemDisabled", "ngpToggleGroupItemDisabled"] }], ngImport: i0 }); }
113
113
  }
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpToggleGroupItem, decorators: [{
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToggleGroupItem, decorators: [{
115
115
  type: Directive,
116
116
  args: [{
117
117
  selector: '[ngpToggleGroupItem]',
@@ -221,10 +221,10 @@ class NgpToggleGroup {
221
221
  this.select(value);
222
222
  }
223
223
  }
224
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpToggleGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
225
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpToggleGroup, isStandalone: true, selector: "[ngpToggleGroup]", inputs: { orientation: { classPropertyName: "orientation", publicName: "ngpToggleGroupOrientation", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "ngpToggleGroupType", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpToggleGroupValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpToggleGroupDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpToggleGroupValueChange" }, host: { attributes: { "role": "group" }, properties: { "attr.data-orientation": "state.orientation()", "attr.data-type": "state.type()", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideToggleGroupState()], exportAs: ["ngpToggleGroup"], hostDirectives: [{ directive: i1.NgpRovingFocusGroup }], ngImport: i0 }); }
224
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToggleGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
225
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpToggleGroup, isStandalone: true, selector: "[ngpToggleGroup]", inputs: { orientation: { classPropertyName: "orientation", publicName: "ngpToggleGroupOrientation", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "ngpToggleGroupType", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpToggleGroupValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpToggleGroupDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpToggleGroupValueChange" }, host: { attributes: { "role": "group" }, properties: { "attr.data-orientation": "state.orientation()", "attr.data-type": "state.type()", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideToggleGroupState()], exportAs: ["ngpToggleGroup"], hostDirectives: [{ directive: i1.NgpRovingFocusGroup }], ngImport: i0 }); }
226
226
  }
227
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpToggleGroup, decorators: [{
227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToggleGroup, decorators: [{
228
228
  type: Directive,
229
229
  args: [{
230
230
  selector: '[ngpToggleGroup]',
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-toggle-group.mjs","sources":["../../../../packages/ng-primitives/toggle-group/src/config/toggle-group-config.ts","../../../../packages/ng-primitives/toggle-group/src/toggle-group/toggle-group-state.ts","../../../../packages/ng-primitives/toggle-group/src/toggle-group-item/toggle-group-item-state.ts","../../../../packages/ng-primitives/toggle-group/src/toggle-group-item/toggle-group-item.ts","../../../../packages/ng-primitives/toggle-group/src/toggle-group/toggle-group.ts","../../../../packages/ng-primitives/toggle-group/src/ng-primitives-toggle-group.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\n\nexport interface NgpToggleGroupConfig {\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n orientation: NgpOrientation;\n\n /**\n * The type of the toggle group, whether only one item can be selected or multiple.\n * @default 'single'\n */\n type: 'single' | 'multiple';\n}\n\nexport const defaultToggleGroupConfig: NgpToggleGroupConfig = {\n orientation: 'horizontal',\n type: 'single',\n};\n\nexport const NgpToggleGroupConfigToken = new InjectionToken<NgpToggleGroupConfig>(\n 'NgpToggleGroupConfigToken',\n);\n\n/**\n * Provide the default ToggleGroup configuration\n * @param config The ToggleGroup configuration\n * @returns The provider\n */\nexport function provideToggleGroupConfig(config: Partial<NgpToggleGroupConfig>): Provider[] {\n return [\n {\n provide: NgpToggleGroupConfigToken,\n useValue: { ...defaultToggleGroupConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the ToggleGroup configuration\n * @returns The global ToggleGroup configuration\n */\nexport function injectToggleGroupConfig(): NgpToggleGroupConfig {\n return inject(NgpToggleGroupConfigToken, { optional: true }) ?? defaultToggleGroupConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpToggleGroup } from './toggle-group';\n\n/**\n * The state token for the ToggleGroup primitive.\n */\nexport const NgpToggleGroupStateToken = createStateToken<NgpToggleGroup>('ToggleGroup');\n\n/**\n * Provides the ToggleGroup state.\n */\nexport const provideToggleGroupState = createStateProvider(NgpToggleGroupStateToken);\n\n/**\n * Injects the ToggleGroup state.\n */\nexport const injectToggleGroupState = createStateInjector(NgpToggleGroupStateToken);\n\n/**\n * The ToggleGroup state registration function.\n */\nexport const toggleGroupState = createState(NgpToggleGroupStateToken);\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpToggleGroupItem } from './toggle-group-item';\n\n/**\n * The state token for the ToggleGroupItem primitive.\n */\nexport const NgpToggleGroupItemStateToken = createStateToken<NgpToggleGroupItem>('ToggleGroupItem');\n\n/**\n * Provides the ToggleGroupItem state.\n */\nexport const provideToggleGroupItemState = createStateProvider(NgpToggleGroupItemStateToken);\n\n/**\n * Injects the ToggleGroupItem state.\n */\nexport const injectToggleGroupItemState = createStateInjector(NgpToggleGroupItemStateToken);\n\n/**\n * The ToggleGroupItem state registration function.\n */\nexport const toggleGroupItemState = createState(NgpToggleGroupItemStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, OnInit } from '@angular/core';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectToggleGroupState } from '../toggle-group/toggle-group-state';\nimport { provideToggleGroupItemState, toggleGroupItemState } from './toggle-group-item-state';\n\n@Directive({\n selector: '[ngpToggleGroupItem]',\n exportAs: 'ngpToggleGroupItem',\n providers: [provideToggleGroupItemState()],\n hostDirectives: [\n {\n directive: NgpRovingFocusItem,\n inputs: ['ngpRovingFocusItemDisabled: ngpToggleGroupItemDisabled'],\n },\n ],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'selected()',\n '[attr.data-selected]': 'selected() ? \"\" : null',\n '[attr.aria-disabled]': 'state.disabled()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '(click)': 'toggle()',\n },\n})\nexport class NgpToggleGroupItem implements OnInit {\n /**\n * Access the group that the item belongs to.\n */\n private readonly toggleGroup = injectToggleGroupState();\n\n /**\n * The value of the item.\n */\n readonly value = input<string>(undefined, {\n alias: 'ngpToggleGroupItemValue',\n });\n\n /**\n * Whether the item is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpToggleGroupItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the item is selected.\n */\n protected readonly selected = computed(() => this.toggleGroup().isSelected(this.state.value()!));\n\n /**\n * The state of the item.\n */\n protected readonly state = toggleGroupItemState<NgpToggleGroupItem>(this);\n\n ngOnInit(): void {\n // we can't use a required input for value as it is used in a computed property before the input is set\n if (this.state.value() === undefined) {\n throw new Error('The value input is required for the toggle group item.');\n }\n }\n\n /**\n * Toggle the item.\n */\n protected toggle(): void {\n if (this.state.disabled()) {\n return;\n }\n\n this.toggleGroup().toggle(this.state.value()!);\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { syncState } from 'ng-primitives/internal';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { injectToggleGroupConfig } from '../config/toggle-group-config';\nimport { provideToggleGroupState, toggleGroupState } from './toggle-group-state';\n\n@Directive({\n selector: '[ngpToggleGroup]',\n exportAs: 'ngpToggleGroup',\n providers: [provideToggleGroupState()],\n hostDirectives: [NgpRovingFocusGroup],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'state.orientation()',\n '[attr.data-type]': 'state.type()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpToggleGroup {\n /**\n * Access the roving focus group state.\n */\n private readonly rovingFocusGroupState = injectRovingFocusGroupState();\n\n /**\n * Access the global toggle group configuration.\n */\n private readonly config = injectToggleGroupConfig();\n\n /**\n * The orientation of the toggle group.\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpToggleGroupOrientation',\n });\n\n /**\n * The type of the toggle group, whether only one item can be selected or multiple.\n */\n readonly type = input<'single' | 'multiple'>(this.config.type, { alias: 'ngpToggleGroupType' });\n\n /**\n * The selected value(s) of the toggle group.\n */\n readonly value = input<string[]>([], { alias: 'ngpToggleGroupValue' });\n\n /**\n * Emits when the value of the toggle group changes.\n */\n readonly valueChange = output<string[]>({ alias: 'ngpToggleGroupValueChange' });\n\n /**\n * Whether the toggle group is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpToggleGroupDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The state of the toggle group.\n */\n protected readonly state = toggleGroupState<NgpToggleGroup>(this);\n\n constructor() {\n // the roving focus group defaults to vertical orientation whereas\n // the default for the toggle group may be different if provided via global config\n syncState(this.state.orientation, this.rovingFocusGroupState().orientation);\n }\n\n /**\n * Select a value in the toggle group.\n */\n private select(value: string): void {\n if (this.state.disabled()) {\n return;\n }\n\n if (this.state.type() === 'single') {\n this.state.value.set([value]);\n } else {\n this.state.value.set([...this.state.value(), value]);\n }\n\n this.valueChange.emit(this.state.value());\n }\n\n /**\n * De-select a value in the toggle group.\n */\n private deselect(value: string): void {\n if (this.state.disabled()) {\n return;\n }\n\n this.state.value.set(this.state.value().filter(v => v !== value));\n this.valueChange.emit(this.state.value());\n }\n\n /**\n * Check if a value is selected in the toggle group.\n * @internal\n */\n isSelected(value: string): boolean {\n return this.state.value()?.includes(value) ?? false;\n }\n\n /**\n * Toggle a value in the toggle group.\n * @internal\n */\n toggle(value: string): void {\n if (this.isSelected(value)) {\n this.deselect(value);\n } else {\n this.select(value);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAiBO,MAAM,wBAAwB,GAAyB;AAC5D,IAAA,WAAW,EAAE,YAAY;AACzB,IAAA,IAAI,EAAE,QAAQ;CACf;AAEM,MAAM,yBAAyB,GAAG,IAAI,cAAc,CACzD,2BAA2B,CAC5B;AAED;;;;AAIG;AACG,SAAU,wBAAwB,CAAC,MAAqC,EAAA;IAC5E,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,yBAAyB;AAClC,YAAA,QAAQ,EAAE,EAAE,GAAG,wBAAwB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ng-primitives-toggle-group.mjs","sources":["../../../../packages/ng-primitives/toggle-group/src/config/toggle-group-config.ts","../../../../packages/ng-primitives/toggle-group/src/toggle-group/toggle-group-state.ts","../../../../packages/ng-primitives/toggle-group/src/toggle-group-item/toggle-group-item-state.ts","../../../../packages/ng-primitives/toggle-group/src/toggle-group-item/toggle-group-item.ts","../../../../packages/ng-primitives/toggle-group/src/toggle-group/toggle-group.ts","../../../../packages/ng-primitives/toggle-group/src/ng-primitives-toggle-group.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\n\nexport interface NgpToggleGroupConfig {\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n orientation: NgpOrientation;\n\n /**\n * The type of the toggle group, whether only one item can be selected or multiple.\n * @default 'single'\n */\n type: 'single' | 'multiple';\n}\n\nexport const defaultToggleGroupConfig: NgpToggleGroupConfig = {\n orientation: 'horizontal',\n type: 'single',\n};\n\nexport const NgpToggleGroupConfigToken = new InjectionToken<NgpToggleGroupConfig>(\n 'NgpToggleGroupConfigToken',\n);\n\n/**\n * Provide the default ToggleGroup configuration\n * @param config The ToggleGroup configuration\n * @returns The provider\n */\nexport function provideToggleGroupConfig(config: Partial<NgpToggleGroupConfig>): Provider[] {\n return [\n {\n provide: NgpToggleGroupConfigToken,\n useValue: { ...defaultToggleGroupConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the ToggleGroup configuration\n * @returns The global ToggleGroup configuration\n */\nexport function injectToggleGroupConfig(): NgpToggleGroupConfig {\n return inject(NgpToggleGroupConfigToken, { optional: true }) ?? defaultToggleGroupConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpToggleGroup } from './toggle-group';\n\n/**\n * The state token for the ToggleGroup primitive.\n */\nexport const NgpToggleGroupStateToken = createStateToken<NgpToggleGroup>('ToggleGroup');\n\n/**\n * Provides the ToggleGroup state.\n */\nexport const provideToggleGroupState = createStateProvider(NgpToggleGroupStateToken);\n\n/**\n * Injects the ToggleGroup state.\n */\nexport const injectToggleGroupState = createStateInjector(NgpToggleGroupStateToken);\n\n/**\n * The ToggleGroup state registration function.\n */\nexport const toggleGroupState = createState(NgpToggleGroupStateToken);\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpToggleGroupItem } from './toggle-group-item';\n\n/**\n * The state token for the ToggleGroupItem primitive.\n */\nexport const NgpToggleGroupItemStateToken = createStateToken<NgpToggleGroupItem>('ToggleGroupItem');\n\n/**\n * Provides the ToggleGroupItem state.\n */\nexport const provideToggleGroupItemState = createStateProvider(NgpToggleGroupItemStateToken);\n\n/**\n * Injects the ToggleGroupItem state.\n */\nexport const injectToggleGroupItemState = createStateInjector(NgpToggleGroupItemStateToken);\n\n/**\n * The ToggleGroupItem state registration function.\n */\nexport const toggleGroupItemState = createState(NgpToggleGroupItemStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, OnInit } from '@angular/core';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectToggleGroupState } from '../toggle-group/toggle-group-state';\nimport { provideToggleGroupItemState, toggleGroupItemState } from './toggle-group-item-state';\n\n@Directive({\n selector: '[ngpToggleGroupItem]',\n exportAs: 'ngpToggleGroupItem',\n providers: [provideToggleGroupItemState()],\n hostDirectives: [\n {\n directive: NgpRovingFocusItem,\n inputs: ['ngpRovingFocusItemDisabled: ngpToggleGroupItemDisabled'],\n },\n ],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'selected()',\n '[attr.data-selected]': 'selected() ? \"\" : null',\n '[attr.aria-disabled]': 'state.disabled()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '(click)': 'toggle()',\n },\n})\nexport class NgpToggleGroupItem implements OnInit {\n /**\n * Access the group that the item belongs to.\n */\n private readonly toggleGroup = injectToggleGroupState();\n\n /**\n * The value of the item.\n */\n readonly value = input<string>(undefined, {\n alias: 'ngpToggleGroupItemValue',\n });\n\n /**\n * Whether the item is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpToggleGroupItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the item is selected.\n */\n protected readonly selected = computed(() => this.toggleGroup().isSelected(this.state.value()!));\n\n /**\n * The state of the item.\n */\n protected readonly state = toggleGroupItemState<NgpToggleGroupItem>(this);\n\n ngOnInit(): void {\n // we can't use a required input for value as it is used in a computed property before the input is set\n if (this.state.value() === undefined) {\n throw new Error('The value input is required for the toggle group item.');\n }\n }\n\n /**\n * Toggle the item.\n */\n protected toggle(): void {\n if (this.state.disabled()) {\n return;\n }\n\n this.toggleGroup().toggle(this.state.value()!);\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { syncState } from 'ng-primitives/internal';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { injectToggleGroupConfig } from '../config/toggle-group-config';\nimport { provideToggleGroupState, toggleGroupState } from './toggle-group-state';\n\n@Directive({\n selector: '[ngpToggleGroup]',\n exportAs: 'ngpToggleGroup',\n providers: [provideToggleGroupState()],\n hostDirectives: [NgpRovingFocusGroup],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'state.orientation()',\n '[attr.data-type]': 'state.type()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpToggleGroup {\n /**\n * Access the roving focus group state.\n */\n private readonly rovingFocusGroupState = injectRovingFocusGroupState();\n\n /**\n * Access the global toggle group configuration.\n */\n private readonly config = injectToggleGroupConfig();\n\n /**\n * The orientation of the toggle group.\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpToggleGroupOrientation',\n });\n\n /**\n * The type of the toggle group, whether only one item can be selected or multiple.\n */\n readonly type = input<'single' | 'multiple'>(this.config.type, { alias: 'ngpToggleGroupType' });\n\n /**\n * The selected value(s) of the toggle group.\n */\n readonly value = input<string[]>([], { alias: 'ngpToggleGroupValue' });\n\n /**\n * Emits when the value of the toggle group changes.\n */\n readonly valueChange = output<string[]>({ alias: 'ngpToggleGroupValueChange' });\n\n /**\n * Whether the toggle group is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpToggleGroupDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The state of the toggle group.\n */\n protected readonly state = toggleGroupState<NgpToggleGroup>(this);\n\n constructor() {\n // the roving focus group defaults to vertical orientation whereas\n // the default for the toggle group may be different if provided via global config\n syncState(this.state.orientation, this.rovingFocusGroupState().orientation);\n }\n\n /**\n * Select a value in the toggle group.\n */\n private select(value: string): void {\n if (this.state.disabled()) {\n return;\n }\n\n if (this.state.type() === 'single') {\n this.state.value.set([value]);\n } else {\n this.state.value.set([...this.state.value(), value]);\n }\n\n this.valueChange.emit(this.state.value());\n }\n\n /**\n * De-select a value in the toggle group.\n */\n private deselect(value: string): void {\n if (this.state.disabled()) {\n return;\n }\n\n this.state.value.set(this.state.value().filter(v => v !== value));\n this.valueChange.emit(this.state.value());\n }\n\n /**\n * Check if a value is selected in the toggle group.\n * @internal\n */\n isSelected(value: string): boolean {\n return this.state.value()?.includes(value) ?? false;\n }\n\n /**\n * Toggle a value in the toggle group.\n * @internal\n */\n toggle(value: string): void {\n if (this.isSelected(value)) {\n this.deselect(value);\n } else {\n this.select(value);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAiBO,MAAM,wBAAwB,GAAyB;AAC5D,IAAA,WAAW,EAAE,YAAY;AACzB,IAAA,IAAI,EAAE,QAAQ;CACf;AAEM,MAAM,yBAAyB,GAAG,IAAI,cAAc,CACzD,2BAA2B,CAC5B;AAED;;;;AAIG;AACG,SAAU,wBAAwB,CAAC,MA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,cAAc;AAClC,wBAAA,sBAAsB,EAAE,8BAA8B;AACvD,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
@@ -79,10 +79,10 @@ class NgpToggle {
79
79
  this.toggle();
80
80
  }
81
81
  }
82
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpToggle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
83
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpToggle, isStandalone: true, selector: "[ngpToggle]", inputs: { selected: { classPropertyName: "selected", publicName: "ngpToggleSelected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpToggleDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "ngpToggleSelectedChange" }, host: { listeners: { "click": "toggle()", "keydown.space": "onKeyDown($event)" }, properties: { "attr.type": "isButton ? \"button\" : null", "attr.aria-pressed": "state.selected()", "attr.data-selected": "state.selected() ? \"\" : null", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideToggleState()], exportAs: ["ngpToggle"], ngImport: i0 }); }
82
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToggle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
83
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpToggle, isStandalone: true, selector: "[ngpToggle]", inputs: { selected: { classPropertyName: "selected", publicName: "ngpToggleSelected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpToggleDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "ngpToggleSelectedChange" }, host: { listeners: { "click": "toggle()", "keydown.space": "onKeyDown($event)" }, properties: { "attr.type": "isButton ? \"button\" : null", "attr.aria-pressed": "state.selected()", "attr.data-selected": "state.selected() ? \"\" : null", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideToggleState()], exportAs: ["ngpToggle"], ngImport: i0 }); }
84
84
  }
85
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpToggle, decorators: [{
85
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToggle, decorators: [{
86
86
  type: Directive,
87
87
  args: [{
88
88
  selector: '[ngpToggle]',
@@ -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.set(!this.state.selected());\n this.selectedChange.emit(this.state.selected());\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,iBAAiB,GAAG,mBAAmB,CAAC,mBAAmB;AAExE;;AAEG;AACI,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC;;ACd3D;;AAEG;MAYU,SAAS,CAAA;AAXtB,IAAA,WAAA,GAAA;AAYE;;AAEG;AACc,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAA0B,UAAU,C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BAAsB,EAAE,8BAA8B;AACtD,wBAAA,sBAAsB,EAAE,8BAA8B;AACvD,qBAAA;AACF,iBAAA;8BA+CC,MAAM,EAAA,CAAA;sBADL,YAAY;uBAAC,OAAO;gBAcX,SAAS,EAAA,CAAA;sBADlB,YAAY;uBAAC,eAAe,EAAE,CAAC,QAAQ,CAAC;;;ACpF3C;;AAEG;;;;"}
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.set(!this.state.selected());\n this.selectedChange.emit(this.state.selected());\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,iBAAiB,GAAG,mBAAmB,CAAC,mBAAmB;AAExE;;AAEG;AACI,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC;;ACd3D;;AAEG;MAYU,SAAS,CAAA;AAXtB,IAAA,WAAA,GAAA;AAYE;;AAEG;AACc,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAA0B,UAAU,CAAC;AAEtE;;;AAGG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,mBAAmB;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,YAAY;uBAAC,OAAO;gBAcX,SAAS,EAAA,CAAA;sBADlB,YAAY;uBAAC,eAAe,EAAE,CAAC,QAAQ,CAAC;;;ACpF3C;;AAEG;;;;"}
@@ -40,10 +40,10 @@ class NgpToolbar {
40
40
  this.state = toolbarState(this);
41
41
  syncState(this.state.orientation, this.rovingFocusGroup().orientation);
42
42
  }
43
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpToolbar, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
44
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpToolbar, isStandalone: true, selector: "[ngpToolbar]", inputs: { orientation: { classPropertyName: "orientation", publicName: "ngpToolbarOrientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "toolbar" }, properties: { "attr.aria-orientation": "state.orientation()", "attr.data-orientation": "state.orientation()" } }, providers: [provideToolbarState()], exportAs: ["ngpToolbar"], hostDirectives: [{ directive: i1.NgpRovingFocusGroup }], ngImport: i0 }); }
43
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToolbar, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
44
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpToolbar, isStandalone: true, selector: "[ngpToolbar]", inputs: { orientation: { classPropertyName: "orientation", publicName: "ngpToolbarOrientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "toolbar" }, properties: { "attr.aria-orientation": "state.orientation()", "attr.data-orientation": "state.orientation()" } }, providers: [provideToolbarState()], exportAs: ["ngpToolbar"], hostDirectives: [{ directive: i1.NgpRovingFocusGroup }], ngImport: i0 }); }
45
45
  }
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpToolbar, decorators: [{
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpToolbar, decorators: [{
47
47
  type: Directive,
48
48
  args: [{
49
49
  selector: '[ngpToolbar]',
@@ -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,CAAC,oBAAoB;AAE1E;;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,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC,WAAW,CAAC;;8GAnB7D,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAV,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,EARV,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,SAAA,EAAA,EAAA,UAAA,EAAA,EAAA,uBAAA,EAAA,qBAAA,EAAA,uBAAA,EAAA,qBAAA,EAAA,EAAA,EAAA,SAAA,EAAA,CAAC,mBAAmB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAQvB,UAAU,EAAA,UAAA,EAAA,CAAA;kBAXtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,SAAS,EAAE,CAAC,mBAAmB,EAAE,CAAC;oBAClC,cAAc,EAAE,CAAC,mBAAmB,CAAC;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,yBAAyB,EAAE,qBAAqB;AAChD,wBAAA,yBAAyB,EAAE,qBAAqB;AACjD,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;;;;"}
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,CAAC,oBAAoB;AAE1E;;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/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