ngx-semantic 2.0.7-beta.2 → 2.1.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 (107) hide show
  1. package/README.md +18 -18
  2. package/fesm2022/ngx-semantic-collections-breadcrumb.mjs +13 -13
  3. package/fesm2022/ngx-semantic-collections-breadcrumb.mjs.map +1 -1
  4. package/fesm2022/ngx-semantic-collections-form.mjs +16 -16
  5. package/fesm2022/ngx-semantic-collections-form.mjs.map +1 -1
  6. package/fesm2022/ngx-semantic-collections-grid.mjs +109 -27
  7. package/fesm2022/ngx-semantic-collections-grid.mjs.map +1 -1
  8. package/fesm2022/ngx-semantic-collections-menu.mjs +33 -18
  9. package/fesm2022/ngx-semantic-collections-menu.mjs.map +1 -1
  10. package/fesm2022/ngx-semantic-collections-message.mjs +16 -16
  11. package/fesm2022/ngx-semantic-collections-message.mjs.map +1 -1
  12. package/fesm2022/ngx-semantic-collections-table.mjs +55 -20
  13. package/fesm2022/ngx-semantic-collections-table.mjs.map +1 -1
  14. package/fesm2022/ngx-semantic-core-base.mjs +3 -3
  15. package/fesm2022/ngx-semantic-core-base.mjs.map +1 -1
  16. package/fesm2022/ngx-semantic-elements-button.mjs +10 -10
  17. package/fesm2022/ngx-semantic-elements-button.mjs.map +1 -1
  18. package/fesm2022/ngx-semantic-elements-container.mjs +7 -7
  19. package/fesm2022/ngx-semantic-elements-container.mjs.map +1 -1
  20. package/fesm2022/ngx-semantic-elements-divider.mjs +14 -14
  21. package/fesm2022/ngx-semantic-elements-divider.mjs.map +1 -1
  22. package/fesm2022/ngx-semantic-elements-flag.mjs +7 -7
  23. package/fesm2022/ngx-semantic-elements-flag.mjs.map +1 -1
  24. package/fesm2022/ngx-semantic-elements-header.mjs +10 -10
  25. package/fesm2022/ngx-semantic-elements-header.mjs.map +1 -1
  26. package/fesm2022/ngx-semantic-elements-icon.mjs +10 -10
  27. package/fesm2022/ngx-semantic-elements-icon.mjs.map +1 -1
  28. package/fesm2022/ngx-semantic-elements-image.mjs +10 -10
  29. package/fesm2022/ngx-semantic-elements-image.mjs.map +1 -1
  30. package/fesm2022/ngx-semantic-elements-input.mjs +7 -7
  31. package/fesm2022/ngx-semantic-elements-input.mjs.map +1 -1
  32. package/fesm2022/ngx-semantic-elements-label.mjs +10 -10
  33. package/fesm2022/ngx-semantic-elements-label.mjs.map +1 -1
  34. package/fesm2022/ngx-semantic-elements-list.mjs +10 -10
  35. package/fesm2022/ngx-semantic-elements-list.mjs.map +1 -1
  36. package/fesm2022/ngx-semantic-elements-loader.mjs +7 -7
  37. package/fesm2022/ngx-semantic-elements-loader.mjs.map +1 -1
  38. package/fesm2022/ngx-semantic-elements-placeholder.mjs +19 -19
  39. package/fesm2022/ngx-semantic-elements-placeholder.mjs.map +1 -1
  40. package/fesm2022/ngx-semantic-elements-rail.mjs +7 -7
  41. package/fesm2022/ngx-semantic-elements-rail.mjs.map +1 -1
  42. package/fesm2022/ngx-semantic-elements-reveal.mjs +10 -10
  43. package/fesm2022/ngx-semantic-elements-reveal.mjs.map +1 -1
  44. package/fesm2022/ngx-semantic-elements-segment.mjs +13 -13
  45. package/fesm2022/ngx-semantic-elements-segment.mjs.map +1 -1
  46. package/fesm2022/ngx-semantic-elements-steps.mjs +19 -19
  47. package/fesm2022/ngx-semantic-elements-steps.mjs.map +1 -1
  48. package/fesm2022/ngx-semantic-modules-accordion.mjs +10 -10
  49. package/fesm2022/ngx-semantic-modules-accordion.mjs.map +1 -1
  50. package/fesm2022/ngx-semantic-modules-checkbox.mjs +7 -7
  51. package/fesm2022/ngx-semantic-modules-checkbox.mjs.map +1 -1
  52. package/fesm2022/ngx-semantic-modules-dimmer.mjs +19 -17
  53. package/fesm2022/ngx-semantic-modules-dimmer.mjs.map +1 -1
  54. package/fesm2022/ngx-semantic-modules-dropdown.mjs +19 -19
  55. package/fesm2022/ngx-semantic-modules-dropdown.mjs.map +1 -1
  56. package/fesm2022/ngx-semantic-modules-embed.mjs +10 -10
  57. package/fesm2022/ngx-semantic-modules-embed.mjs.map +1 -1
  58. package/fesm2022/ngx-semantic-modules-modal.mjs +16 -16
  59. package/fesm2022/ngx-semantic-modules-modal.mjs.map +1 -1
  60. package/fesm2022/ngx-semantic-modules-popup.mjs +10 -10
  61. package/fesm2022/ngx-semantic-modules-popup.mjs.map +1 -1
  62. package/fesm2022/ngx-semantic-modules-progress.mjs +7 -7
  63. package/fesm2022/ngx-semantic-modules-progress.mjs.map +1 -1
  64. package/fesm2022/ngx-semantic-modules-rating.mjs +7 -7
  65. package/fesm2022/ngx-semantic-modules-rating.mjs.map +1 -1
  66. package/fesm2022/ngx-semantic-modules-search.mjs +7 -7
  67. package/fesm2022/ngx-semantic-modules-search.mjs.map +1 -1
  68. package/fesm2022/ngx-semantic-modules-select.mjs +13 -13
  69. package/fesm2022/ngx-semantic-modules-select.mjs.map +1 -1
  70. package/fesm2022/ngx-semantic-modules-shape.mjs +43 -39
  71. package/fesm2022/ngx-semantic-modules-shape.mjs.map +1 -1
  72. package/fesm2022/ngx-semantic-modules-sidebar.mjs +121 -29
  73. package/fesm2022/ngx-semantic-modules-sidebar.mjs.map +1 -1
  74. package/fesm2022/ngx-semantic-modules-sticky.mjs +20 -9
  75. package/fesm2022/ngx-semantic-modules-sticky.mjs.map +1 -1
  76. package/fesm2022/ngx-semantic-modules-tabs.mjs +11 -11
  77. package/fesm2022/ngx-semantic-modules-tabs.mjs.map +1 -1
  78. package/fesm2022/ngx-semantic-modules-transition.mjs +11 -7
  79. package/fesm2022/ngx-semantic-modules-transition.mjs.map +1 -1
  80. package/fesm2022/ngx-semantic-modules-visibility.mjs +525 -0
  81. package/fesm2022/ngx-semantic-modules-visibility.mjs.map +1 -0
  82. package/fesm2022/ngx-semantic-views-advertisement.mjs +7 -7
  83. package/fesm2022/ngx-semantic-views-advertisement.mjs.map +1 -1
  84. package/fesm2022/ngx-semantic-views-card.mjs +28 -28
  85. package/fesm2022/ngx-semantic-views-card.mjs.map +1 -1
  86. package/fesm2022/ngx-semantic-views-comment.mjs +31 -31
  87. package/fesm2022/ngx-semantic-views-comment.mjs.map +1 -1
  88. package/fesm2022/ngx-semantic-views-feed.mjs +28 -28
  89. package/fesm2022/ngx-semantic-views-feed.mjs.map +1 -1
  90. package/fesm2022/ngx-semantic-views-items.mjs +28 -28
  91. package/fesm2022/ngx-semantic-views-items.mjs.map +1 -1
  92. package/fesm2022/ngx-semantic-views-statistics.mjs +16 -16
  93. package/fesm2022/ngx-semantic-views-statistics.mjs.map +1 -1
  94. package/fesm2022/ngx-semantic.mjs +15 -9
  95. package/fesm2022/ngx-semantic.mjs.map +1 -1
  96. package/modules/visibility/package.json +4 -0
  97. package/package.json +5 -1
  98. package/types/ngx-semantic-collections-grid.d.ts +44 -12
  99. package/types/ngx-semantic-collections-menu.d.ts +7 -3
  100. package/types/ngx-semantic-collections-table.d.ts +14 -6
  101. package/types/ngx-semantic-core-enums.d.ts +1 -1
  102. package/types/ngx-semantic-elements-divider.d.ts +3 -1
  103. package/types/ngx-semantic-modules-dimmer.d.ts +1 -1
  104. package/types/ngx-semantic-modules-shape.d.ts +4 -3
  105. package/types/ngx-semantic-modules-sidebar.d.ts +33 -6
  106. package/types/ngx-semantic-modules-visibility.d.ts +124 -0
  107. package/types/ngx-semantic.d.ts +2 -1
@@ -1,6 +1,6 @@
1
+ import { __decorate } from 'tslib';
1
2
  import * as i0 from '@angular/core';
2
3
  import { EventEmitter, Injectable, inject, HostBinding, Input, Output, ViewEncapsulation, Component, HostListener, ContentChild, NgModule } from '@angular/core';
3
- import { __decorate } from 'tslib';
4
4
  import { ClassUtils, InputBoolean } from 'ngx-semantic/core/util';
5
5
  import { CommonModule } from '@angular/common';
6
6
 
@@ -11,26 +11,39 @@ class SuiSidebarService {
11
11
  constructor() {
12
12
  this.pusherClicked = new EventEmitter();
13
13
  this.visibilityChanged = new EventEmitter();
14
+ this._isVisible = false;
15
+ }
16
+ /** The last visibility reported by the sidebar sharing this service. */
17
+ get isVisible() {
18
+ return this._isVisible;
14
19
  }
15
20
  notifyPusherClicked() {
16
21
  this.pusherClicked.emit();
17
22
  }
18
23
  changeVisibility(isVisible) {
24
+ this._isVisible = isVisible;
19
25
  this.visibilityChanged.emit(isVisible);
20
26
  }
21
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
22
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarService }); }
27
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
28
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarService }); }
23
29
  }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarService, decorators: [{
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarService, decorators: [{
25
31
  type: Injectable
26
32
  }] });
27
33
 
34
+ /** Matches the Semantic UI sidebar transition duration. */
35
+ const SIDEBAR_ANIMATION_DURATION = 500;
28
36
  class SuiSidebarComponent {
29
37
  get visible() {
30
38
  return this._visible;
31
39
  }
32
40
  set visible(isVisible) {
33
- this._visible = isVisible;
41
+ const value = !!isVisible;
42
+ // only animate changes made after the initial binding, so the sidebar does not flash on load
43
+ if (this.initialised && value !== this._visible) {
44
+ this.startAnimating();
45
+ }
46
+ this._visible = value;
34
47
  this.visibleChange.emit(this._visible);
35
48
  this.sidebarService.changeVisibility(this._visible);
36
49
  }
@@ -42,8 +55,9 @@ class SuiSidebarComponent {
42
55
  ClassUtils.getPropClass(this.suiInverted, 'inverted'),
43
56
  'sidebar',
44
57
  this.suiSidebarAnimation,
58
+ ClassUtils.getPropClass(this.animating, 'animating'),
45
59
  ClassUtils.getPropClass(this.visible, 'visible')
46
- ].join(' ');
60
+ ].join(' ').replace(/\s\s+/g, ' ').trim();
47
61
  }
48
62
  constructor() {
49
63
  this.sidebarService = inject(SuiSidebarService);
@@ -51,30 +65,70 @@ class SuiSidebarComponent {
51
65
  this.suiSidebarWidth = null;
52
66
  this.suiSidebarAnimation = null;
53
67
  this.suiInverted = false;
68
+ /** Whether clicking the pusher hides a sidebar whose visibility is two-way bound. */
69
+ this.suiClosable = true;
54
70
  this.visibleChange = new EventEmitter();
71
+ this.animating = false;
55
72
  this._visible = true;
56
- const sidebarService = this.sidebarService;
57
- sidebarService.pusherClicked
73
+ this.animationTimer = null;
74
+ this.initialised = false;
75
+ this.sidebarService.changeVisibility(this._visible);
76
+ this.subscription = this.sidebarService.pusherClicked
58
77
  .subscribe(() => {
59
- // only close sidebar on pusher when the visibility is dynamic
60
- if (this.visibleChange.observers.length > 0) {
78
+ // only close the sidebar from the pusher when its visibility is bound, i.e. [(visible)]
79
+ if (this.suiClosable && this.visibleChange.observed) {
61
80
  this.visible = false;
62
81
  }
63
82
  });
64
83
  }
65
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
66
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.7", type: SuiSidebarComponent, isStandalone: true, selector: "sui-sidebar, [sui-sidebar]", inputs: { suiSidebarPosition: "suiSidebarPosition", suiSidebarWidth: "suiSidebarWidth", suiSidebarAnimation: "suiSidebarAnimation", suiInverted: "suiInverted", visible: "visible" }, outputs: { visibleChange: "visibleChange" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
84
+ ngOnInit() {
85
+ this.initialised = true;
86
+ }
87
+ ngOnDestroy() {
88
+ this.subscription.unsubscribe();
89
+ if (this.animationTimer) {
90
+ clearTimeout(this.animationTimer);
91
+ }
92
+ }
93
+ /** Mirrors `sidebar('toggle')`. */
94
+ toggle() {
95
+ this.visible = !this.visible;
96
+ }
97
+ /** Mirrors `sidebar('show')`. */
98
+ show() {
99
+ this.visible = true;
100
+ }
101
+ /** Mirrors `sidebar('hide')`. */
102
+ hide() {
103
+ this.visible = false;
104
+ }
105
+ startAnimating() {
106
+ this.animating = true;
107
+ if (this.animationTimer) {
108
+ clearTimeout(this.animationTimer);
109
+ }
110
+ this.animationTimer = setTimeout(() => {
111
+ this.animating = false;
112
+ this.animationTimer = null;
113
+ }, SIDEBAR_ANIMATION_DURATION);
114
+ }
115
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
116
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.23", type: SuiSidebarComponent, isStandalone: true, selector: "sui-sidebar, [sui-sidebar]", inputs: { suiSidebarPosition: "suiSidebarPosition", suiSidebarWidth: "suiSidebarWidth", suiSidebarAnimation: "suiSidebarAnimation", suiInverted: "suiInverted", suiClosable: "suiClosable", visible: "visible" }, outputs: { visibleChange: "visibleChange" }, host: { properties: { "class": "this.classes" } }, exportAs: ["suiSidebar"], ngImport: i0, template: `
67
117
  <ng-content></ng-content>
68
118
  `, isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
69
119
  }
70
120
  __decorate([
71
121
  InputBoolean()
72
122
  ], SuiSidebarComponent.prototype, "suiInverted", void 0);
73
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarComponent, decorators: [{
123
+ __decorate([
124
+ InputBoolean()
125
+ ], SuiSidebarComponent.prototype, "suiClosable", void 0);
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarComponent, decorators: [{
74
127
  type: Component,
75
128
  args: [{
76
129
  standalone: true,
77
130
  selector: 'sui-sidebar, [sui-sidebar]',
131
+ exportAs: 'suiSidebar',
78
132
  encapsulation: ViewEncapsulation.None,
79
133
  template: `
80
134
  <ng-content></ng-content>
@@ -88,6 +142,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
88
142
  type: Input
89
143
  }], suiInverted: [{
90
144
  type: Input
145
+ }], suiClosable: [{
146
+ type: Input
91
147
  }], visibleChange: [{
92
148
  type: Output
93
149
  }], visible: [{
@@ -102,38 +158,46 @@ class SuiSidebarPusherComponent {
102
158
  this.sidebarService = inject(SuiSidebarService);
103
159
  this.suiDimmable = false;
104
160
  this.isSidebarOpen = false;
161
+ this.subscription = null;
105
162
  }
106
163
  get classes() {
107
164
  return [
108
165
  ClassUtils.getPropClass(this.isSidebarOpen && this.suiDimmable, 'dimmed'),
109
166
  'pusher'
110
- ].join(' ');
167
+ ].join(' ').trim();
111
168
  }
112
169
  ngOnInit() {
113
- this.sidebarService.visibilityChanged
170
+ this.isSidebarOpen = this.isSidebarOpen || this.sidebarService.isVisible;
171
+ this.subscription = this.sidebarService.visibilityChanged
114
172
  .subscribe((isVisible) => {
115
173
  this.isSidebarOpen = isVisible;
116
174
  });
117
175
  }
176
+ ngOnDestroy() {
177
+ this.subscription?.unsubscribe();
178
+ }
118
179
  onClick() {
119
180
  if (this.isSidebarOpen) {
120
181
  this.sidebarService.notifyPusherClicked();
121
182
  }
122
183
  }
123
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarPusherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
124
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.7", type: SuiSidebarPusherComponent, isStandalone: true, selector: "sui-sidebar-pusher", inputs: { suiDimmable: "suiDimmable" }, host: { listeners: { "click": "onClick()" }, properties: { "class": "this.classes" } }, ngImport: i0, template: `
184
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarPusherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
185
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.23", type: SuiSidebarPusherComponent, isStandalone: true, selector: "sui-sidebar-pusher", inputs: { suiDimmable: "suiDimmable" }, host: { listeners: { "click": "onClick()" }, properties: { "class": "this.classes" }, styleAttribute: "display: block" }, ngImport: i0, template: `
125
186
  <ng-content></ng-content>
126
187
  `, isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
127
188
  }
128
189
  __decorate([
129
190
  InputBoolean()
130
191
  ], SuiSidebarPusherComponent.prototype, "suiDimmable", void 0);
131
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarPusherComponent, decorators: [{
192
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarPusherComponent, decorators: [{
132
193
  type: Component,
133
194
  args: [{
134
195
  standalone: true,
135
196
  selector: 'sui-sidebar-pusher',
136
197
  encapsulation: ViewEncapsulation.None,
198
+ host: {
199
+ style: 'display: block'
200
+ },
137
201
  template: `
138
202
  <ng-content></ng-content>
139
203
  `
@@ -148,10 +212,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
148
212
  args: ['click']
149
213
  }] } });
150
214
 
151
- /**
152
- * Created by bolorundurowb on 1/1/2021
153
- */
154
215
  class SuiSidebarContainerComponent {
216
+ constructor() {
217
+ this.sidebarService = inject(SuiSidebarService);
218
+ /**
219
+ * Makes the container the sidebar's context (Semantic UI `pushable`). The sidebar and dimmer are then
220
+ * positioned inside the container rather than the viewport. Always applied when the pusher is dimmable,
221
+ * since Semantic UI only renders the dimmer inside a pushable context.
222
+ */
223
+ this.suiPushable = false;
224
+ this.subscription = null;
225
+ }
226
+ get isPushable() {
227
+ return this.suiPushable || !!this.suiPusher?.suiDimmable;
228
+ }
155
229
  ngAfterContentInit() {
156
230
  if (!this.suiSidebar) {
157
231
  throw new Error('You must include a <sui-sidebar> element within the container.');
@@ -159,22 +233,35 @@ class SuiSidebarContainerComponent {
159
233
  if (!this.suiPusher) {
160
234
  throw new Error('You must include a <sui-sidebar-pusher> element within the container.');
161
235
  }
162
- this.suiSidebar.visibleChange
236
+ // the sidebar reports its initial visibility before the pusher exists, so sync it once here
237
+ this.suiPusher.isSidebarOpen = this.suiSidebar.visible;
238
+ this.subscription = this.sidebarService.visibilityChanged
163
239
  .subscribe((isVisible) => {
164
240
  this.suiPusher.isSidebarOpen = isVisible;
165
241
  });
166
242
  }
167
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
168
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.7", type: SuiSidebarContainerComponent, isStandalone: true, selector: "sui-sidebar-container", queries: [{ propertyName: "suiSidebar", first: true, predicate: SuiSidebarComponent, descendants: true }, { propertyName: "suiPusher", first: true, predicate: SuiSidebarPusherComponent, descendants: true }], ngImport: i0, template: `
243
+ ngOnDestroy() {
244
+ this.subscription?.unsubscribe();
245
+ }
246
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
247
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.23", type: SuiSidebarContainerComponent, isStandalone: true, selector: "sui-sidebar-container", inputs: { suiPushable: "suiPushable" }, host: { properties: { "class.pushable": "this.isPushable" }, styleAttribute: "display: block" }, providers: [SuiSidebarService], queries: [{ propertyName: "suiSidebar", first: true, predicate: SuiSidebarComponent, descendants: true }, { propertyName: "suiPusher", first: true, predicate: SuiSidebarPusherComponent, descendants: true }], ngImport: i0, template: `
169
248
  <ng-content></ng-content>
170
249
  `, isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
171
250
  }
172
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarContainerComponent, decorators: [{
251
+ __decorate([
252
+ InputBoolean()
253
+ ], SuiSidebarContainerComponent.prototype, "suiPushable", void 0);
254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarContainerComponent, decorators: [{
173
255
  type: Component,
174
256
  args: [{
175
257
  standalone: true,
176
258
  selector: 'sui-sidebar-container',
177
259
  encapsulation: ViewEncapsulation.None,
260
+ // each container gets its own service so multiple sidebars on a page do not affect one another
261
+ providers: [SuiSidebarService],
262
+ host: {
263
+ style: 'display: block'
264
+ },
178
265
  template: `
179
266
  <ng-content></ng-content>
180
267
  `
@@ -185,24 +272,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
185
272
  }], suiPusher: [{
186
273
  type: ContentChild,
187
274
  args: [SuiSidebarPusherComponent]
275
+ }], suiPushable: [{
276
+ type: Input
277
+ }], isPushable: [{
278
+ type: HostBinding,
279
+ args: ['class.pushable']
188
280
  }] } });
189
281
 
190
282
  /**
191
283
  * Created by bolorundurowb on 12/30/2020
192
284
  */
193
285
  class SuiSidebarModule {
194
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
195
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarModule, imports: [CommonModule,
286
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
287
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarModule, imports: [CommonModule,
196
288
  SuiSidebarComponent,
197
289
  SuiSidebarPusherComponent,
198
290
  SuiSidebarContainerComponent], exports: [SuiSidebarComponent,
199
291
  SuiSidebarPusherComponent,
200
292
  SuiSidebarContainerComponent] }); }
201
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarModule, providers: [
293
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarModule, providers: [
202
294
  SuiSidebarService
203
295
  ], imports: [CommonModule] }); }
204
296
  }
205
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiSidebarModule, decorators: [{
297
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiSidebarModule, decorators: [{
206
298
  type: NgModule,
207
299
  args: [{
208
300
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-semantic-modules-sidebar.mjs","sources":["../../src/modules/sidebar/sidebar.service.ts","../../src/modules/sidebar/sidebar.component.ts","../../src/modules/sidebar/sidebar-pusher.component.ts","../../src/modules/sidebar/sidebar-container.component.ts","../../src/modules/sidebar/sidebar.module.ts","../../src/modules/sidebar/public-api.ts","../../src/modules/sidebar/ngx-semantic-modules-sidebar.ts"],"sourcesContent":["/**\n * Created by bolorundurowb on 1/1/2021\n */\n\nimport { EventEmitter, Injectable } from '@angular/core';\n\n@Injectable()\nexport class SuiSidebarService {\n public pusherClicked = new EventEmitter<void>();\n public visibilityChanged = new EventEmitter<boolean>();\n\n public notifyPusherClicked(): void {\n this.pusherClicked.emit();\n }\n\n public changeVisibility(isVisible: boolean): void {\n this.visibilityChanged.emit(isVisible);\n }\n}\n","/**\n * Created by bolorundurowb on 12/30/2020\n */\n\nimport { Component, EventEmitter, HostBinding, Input, Output, ViewEncapsulation, inject } from '@angular/core';\nimport { ClassUtils, InputBoolean } from 'ngx-semantic/core/util';\nimport { SuiSidebarService } from './sidebar.service';\n\nexport type SuiSidebarPosition = 'top' | 'bottom' | 'left' | 'right';\nexport type SuiSidebarWidth = 'thin' | 'very thin' | 'wide' | 'very wide' | null;\nexport type SuiSidebarAnimation = 'overlay' | 'push' | 'scale down' | 'uncover' | 'slide along' | 'slide out' | null;\n\n@Component({\n standalone: true,\n selector: 'sui-sidebar, [sui-sidebar]',\n encapsulation: ViewEncapsulation.None,\n template: `\n <ng-content></ng-content>\n `\n})\nexport class SuiSidebarComponent {\n private sidebarService = inject(SuiSidebarService);\n\n @Input() public suiSidebarPosition: SuiSidebarPosition = 'left';\n @Input() public suiSidebarWidth: SuiSidebarWidth = null;\n @Input() public suiSidebarAnimation: SuiSidebarAnimation = null;\n @Input() @InputBoolean() public suiInverted = false;\n @Output() public visibleChange = new EventEmitter<boolean>();\n\n private _visible = true;\n\n @Input()\n get visible(): boolean {\n return this._visible;\n }\n\n set visible(isVisible) {\n this._visible = isVisible;\n this.visibleChange.emit(this._visible);\n this.sidebarService.changeVisibility(this._visible);\n }\n\n @HostBinding('class')\n get classes(): string {\n return [\n 'ui',\n this.suiSidebarPosition,\n this.suiSidebarWidth,\n ClassUtils.getPropClass(this.suiInverted, 'inverted'),\n 'sidebar',\n this.suiSidebarAnimation,\n ClassUtils.getPropClass(this.visible, 'visible')\n ].join(' ');\n }\n\n constructor() {\n const sidebarService = this.sidebarService;\n\n sidebarService.pusherClicked\n .subscribe(() => {\n // only close sidebar on pusher when the visibility is dynamic\n if (this.visibleChange.observers.length > 0) {\n this.visible = false;\n }\n });\n }\n}\n","/**\n * Created by bolorundurowb on 12/30/2020\n */\n\nimport { Component, HostBinding, HostListener, Input, OnInit, ViewEncapsulation, inject } from '@angular/core';\nimport { ClassUtils, InputBoolean } from 'ngx-semantic/core/util';\nimport { SuiSidebarService } from './sidebar.service';\n\n@Component({\n standalone: true,\n selector: 'sui-sidebar-pusher',\n encapsulation: ViewEncapsulation.None,\n template: `\n <ng-content></ng-content>\n `\n})\nexport class SuiSidebarPusherComponent implements OnInit {\n private sidebarService = inject(SuiSidebarService);\n\n @Input() @InputBoolean() public suiDimmable = false;\n public isSidebarOpen = false;\n\n @HostBinding('class')\n get classes(): string {\n return [\n ClassUtils.getPropClass(this.isSidebarOpen && this.suiDimmable, 'dimmed'),\n 'pusher'\n ].join(' ');\n }\n\n public ngOnInit(): void {\n this.sidebarService.visibilityChanged\n .subscribe((isVisible) => {\n this.isSidebarOpen = isVisible;\n });\n }\n\n @HostListener('click')\n public onClick(): void {\n if (this.isSidebarOpen) {\n this.sidebarService.notifyPusherClicked();\n }\n }\n}\n","/**\n * Created by bolorundurowb on 1/1/2021\n */\n\nimport { AfterContentInit, Component, ContentChild, ViewEncapsulation } from '@angular/core';\nimport { SuiSidebarComponent } from './sidebar.component';\nimport { SuiSidebarPusherComponent } from './sidebar-pusher.component';\n\n@Component({\n standalone: true,\n selector: 'sui-sidebar-container',\n encapsulation: ViewEncapsulation.None,\n template: `\n <ng-content></ng-content>\n `\n})\nexport class SuiSidebarContainerComponent implements AfterContentInit {\n @ContentChild(SuiSidebarComponent) public suiSidebar!: SuiSidebarComponent;\n @ContentChild(SuiSidebarPusherComponent) public suiPusher!: SuiSidebarPusherComponent;\n\n public ngAfterContentInit(): void {\n if (!this.suiSidebar) {\n throw new Error('You must include a <sui-sidebar> element within the container.');\n }\n\n if (!this.suiPusher) {\n throw new Error('You must include a <sui-sidebar-pusher> element within the container.');\n }\n\n this.suiSidebar.visibleChange\n .subscribe((isVisible) => {\n this.suiPusher.isSidebarOpen = isVisible;\n });\n }\n}\n","/**\n * Created by bolorundurowb on 12/30/2020\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SuiSidebarContainerComponent } from './sidebar-container.component';\nimport { SuiSidebarPusherComponent } from './sidebar-pusher.component';\nimport { SuiSidebarComponent } from './sidebar.component';\nimport { SuiSidebarService } from './sidebar.service';\n\n@NgModule({\n imports: [\n CommonModule,\n SuiSidebarComponent,\n SuiSidebarPusherComponent,\n SuiSidebarContainerComponent\n ],\n exports: [\n SuiSidebarComponent,\n SuiSidebarPusherComponent,\n SuiSidebarContainerComponent\n ],\n providers: [\n SuiSidebarService\n ]\n})\nexport class SuiSidebarModule {\n}\n","/**\n * Created by bolorundurowb on 12/30/2020\n */\n\nexport * from './sidebar-container.component';\nexport * from './sidebar-pusher.component';\nexport * from './sidebar.component';\nexport * from './sidebar.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;;AAEG;MAKU,iBAAiB,CAAA;AAD9B,IAAA,WAAA,GAAA;AAES,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAQ;AACxC,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,YAAY,EAAW;AASvD,IAAA;IAPQ,mBAAmB,GAAA;AACxB,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE;IAC3B;AAEO,IAAA,gBAAgB,CAAC,SAAkB,EAAA;AACxC,QAAA,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC;IACxC;8GAVW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAjB,iBAAiB,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B;;;MCcY,mBAAmB,CAAA;AAW9B,IAAA,IACI,OAAO,GAAA;QACT,OAAO,IAAI,CAAC,QAAQ;IACtB;IAEA,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kBAhB5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,yBAAyB;wBACzB;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,mBAAmB;wBACnB,yBAAyB;wBACzB;AACD,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT;AACD;AACF,iBAAA;;;AC1BD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-semantic-modules-sidebar.mjs","sources":["../../src/modules/sidebar/sidebar.service.ts","../../src/modules/sidebar/sidebar.component.ts","../../src/modules/sidebar/sidebar-pusher.component.ts","../../src/modules/sidebar/sidebar-container.component.ts","../../src/modules/sidebar/sidebar.module.ts","../../src/modules/sidebar/public-api.ts","../../src/modules/sidebar/ngx-semantic-modules-sidebar.ts"],"sourcesContent":["/**\n * Created by bolorundurowb on 1/1/2021\n */\n\nimport { EventEmitter, Injectable } from '@angular/core';\n\n@Injectable()\nexport class SuiSidebarService {\n public pusherClicked = new EventEmitter<void>();\n public visibilityChanged = new EventEmitter<boolean>();\n\n private _isVisible = false;\n\n /** The last visibility reported by the sidebar sharing this service. */\n public get isVisible(): boolean {\n return this._isVisible;\n }\n\n public notifyPusherClicked(): void {\n this.pusherClicked.emit();\n }\n\n public changeVisibility(isVisible: boolean): void {\n this._isVisible = isVisible;\n this.visibilityChanged.emit(isVisible);\n }\n}\n","/**\n * Created by bolorundurowb on 12/30/2020\n */\n\nimport { Component, EventEmitter, HostBinding, Input, OnDestroy, OnInit, Output, ViewEncapsulation, inject } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { ClassUtils, InputBoolean } from 'ngx-semantic/core/util';\nimport { SuiSidebarService } from './sidebar.service';\n\nexport type SuiSidebarPosition = 'top' | 'bottom' | 'left' | 'right';\nexport type SuiSidebarWidth = 'thin' | 'very thin' | 'wide' | 'very wide' | null;\nexport type SuiSidebarAnimation = 'overlay' | 'push' | 'scale down' | 'uncover' | 'slide along' | 'slide out' | null;\n\n/** Matches the Semantic UI sidebar transition duration. */\nconst SIDEBAR_ANIMATION_DURATION = 500;\n\n@Component({\n standalone: true,\n selector: 'sui-sidebar, [sui-sidebar]',\n exportAs: 'suiSidebar',\n encapsulation: ViewEncapsulation.None,\n template: `\n <ng-content></ng-content>\n `\n})\nexport class SuiSidebarComponent implements OnInit, OnDestroy {\n private sidebarService = inject(SuiSidebarService);\n\n @Input() public suiSidebarPosition: SuiSidebarPosition = 'left';\n @Input() public suiSidebarWidth: SuiSidebarWidth = null;\n @Input() public suiSidebarAnimation: SuiSidebarAnimation = null;\n @Input() @InputBoolean() public suiInverted = false;\n /** Whether clicking the pusher hides a sidebar whose visibility is two-way bound. */\n @Input() @InputBoolean() public suiClosable = true;\n @Output() public visibleChange = new EventEmitter<boolean>();\n\n public animating = false;\n\n private _visible = true;\n private animationTimer: ReturnType<typeof setTimeout> | null = null;\n private initialised = false;\n private readonly subscription: Subscription;\n\n @Input()\n get visible(): boolean {\n return this._visible;\n }\n\n set visible(isVisible) {\n const value = !!isVisible;\n // only animate changes made after the initial binding, so the sidebar does not flash on load\n if (this.initialised && value !== this._visible) {\n this.startAnimating();\n }\n this._visible = value;\n this.visibleChange.emit(this._visible);\n this.sidebarService.changeVisibility(this._visible);\n }\n\n @HostBinding('class')\n get classes(): string {\n return [\n 'ui',\n this.suiSidebarPosition,\n this.suiSidebarWidth,\n ClassUtils.getPropClass(this.suiInverted, 'inverted'),\n 'sidebar',\n this.suiSidebarAnimation,\n ClassUtils.getPropClass(this.animating, 'animating'),\n ClassUtils.getPropClass(this.visible, 'visible')\n ].join(' ').replace(/\\s\\s+/g, ' ').trim();\n }\n\n constructor() {\n this.sidebarService.changeVisibility(this._visible);\n this.subscription = this.sidebarService.pusherClicked\n .subscribe(() => {\n // only close the sidebar from the pusher when its visibility is bound, i.e. [(visible)]\n if (this.suiClosable && this.visibleChange.observed) {\n this.visible = false;\n }\n });\n }\n\n public ngOnInit(): void {\n this.initialised = true;\n }\n\n public ngOnDestroy(): void {\n this.subscription.unsubscribe();\n if (this.animationTimer) {\n clearTimeout(this.animationTimer);\n }\n }\n\n /** Mirrors `sidebar('toggle')`. */\n public toggle(): void {\n this.visible = !this.visible;\n }\n\n /** Mirrors `sidebar('show')`. */\n public show(): void {\n this.visible = true;\n }\n\n /** Mirrors `sidebar('hide')`. */\n public hide(): void {\n this.visible = false;\n }\n\n private startAnimating(): void {\n this.animating = true;\n if (this.animationTimer) {\n clearTimeout(this.animationTimer);\n }\n this.animationTimer = setTimeout(() => {\n this.animating = false;\n this.animationTimer = null;\n }, SIDEBAR_ANIMATION_DURATION);\n }\n}\n","/**\n * Created by bolorundurowb on 12/30/2020\n */\n\nimport { Component, HostBinding, HostListener, Input, OnDestroy, OnInit, ViewEncapsulation, inject } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { ClassUtils, InputBoolean } from 'ngx-semantic/core/util';\nimport { SuiSidebarService } from './sidebar.service';\n\n@Component({\n standalone: true,\n selector: 'sui-sidebar-pusher',\n encapsulation: ViewEncapsulation.None,\n host: {\n style: 'display: block'\n },\n template: `\n <ng-content></ng-content>\n `\n})\nexport class SuiSidebarPusherComponent implements OnInit, OnDestroy {\n private sidebarService = inject(SuiSidebarService);\n\n @Input() @InputBoolean() public suiDimmable = false;\n public isSidebarOpen = false;\n\n private subscription: Subscription | null = null;\n\n @HostBinding('class')\n get classes(): string {\n return [\n ClassUtils.getPropClass(this.isSidebarOpen && this.suiDimmable, 'dimmed'),\n 'pusher'\n ].join(' ').trim();\n }\n\n public ngOnInit(): void {\n this.isSidebarOpen = this.isSidebarOpen || this.sidebarService.isVisible;\n this.subscription = this.sidebarService.visibilityChanged\n .subscribe((isVisible) => {\n this.isSidebarOpen = isVisible;\n });\n }\n\n public ngOnDestroy(): void {\n this.subscription?.unsubscribe();\n }\n\n @HostListener('click')\n public onClick(): void {\n if (this.isSidebarOpen) {\n this.sidebarService.notifyPusherClicked();\n }\n }\n}\n","/**\n * Created by bolorundurowb on 1/1/2021\n */\n\nimport { AfterContentInit, Component, ContentChild, HostBinding, Input, OnDestroy, ViewEncapsulation, inject } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { InputBoolean } from 'ngx-semantic/core/util';\nimport { SuiSidebarComponent } from './sidebar.component';\nimport { SuiSidebarPusherComponent } from './sidebar-pusher.component';\nimport { SuiSidebarService } from './sidebar.service';\n\n@Component({\n standalone: true,\n selector: 'sui-sidebar-container',\n encapsulation: ViewEncapsulation.None,\n // each container gets its own service so multiple sidebars on a page do not affect one another\n providers: [SuiSidebarService],\n host: {\n style: 'display: block'\n },\n template: `\n <ng-content></ng-content>\n `\n})\nexport class SuiSidebarContainerComponent implements AfterContentInit, OnDestroy {\n private sidebarService = inject(SuiSidebarService);\n\n @ContentChild(SuiSidebarComponent) public suiSidebar!: SuiSidebarComponent;\n @ContentChild(SuiSidebarPusherComponent) public suiPusher!: SuiSidebarPusherComponent;\n\n /**\n * Makes the container the sidebar's context (Semantic UI `pushable`). The sidebar and dimmer are then\n * positioned inside the container rather than the viewport. Always applied when the pusher is dimmable,\n * since Semantic UI only renders the dimmer inside a pushable context.\n */\n @Input() @InputBoolean() public suiPushable = false;\n\n private subscription: Subscription | null = null;\n\n @HostBinding('class.pushable')\n get isPushable(): boolean {\n return this.suiPushable || !!this.suiPusher?.suiDimmable;\n }\n\n public ngAfterContentInit(): void {\n if (!this.suiSidebar) {\n throw new Error('You must include a <sui-sidebar> element within the container.');\n }\n\n if (!this.suiPusher) {\n throw new Error('You must include a <sui-sidebar-pusher> element within the container.');\n }\n\n // the sidebar reports its initial visibility before the pusher exists, so sync it once here\n this.suiPusher.isSidebarOpen = this.suiSidebar.visible;\n\n this.subscription = this.sidebarService.visibilityChanged\n .subscribe((isVisible) => {\n this.suiPusher.isSidebarOpen = isVisible;\n });\n }\n\n public ngOnDestroy(): void {\n this.subscription?.unsubscribe();\n }\n}\n","/**\n * Created by bolorundurowb on 12/30/2020\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SuiSidebarContainerComponent } from './sidebar-container.component';\nimport { SuiSidebarPusherComponent } from './sidebar-pusher.component';\nimport { SuiSidebarComponent } from './sidebar.component';\nimport { SuiSidebarService } from './sidebar.service';\n\n@NgModule({\n imports: [\n CommonModule,\n SuiSidebarComponent,\n SuiSidebarPusherComponent,\n SuiSidebarContainerComponent\n ],\n exports: [\n SuiSidebarComponent,\n SuiSidebarPusherComponent,\n SuiSidebarContainerComponent\n ],\n providers: [\n SuiSidebarService\n ]\n})\nexport class SuiSidebarModule {\n}\n","/**\n * Created by bolorundurowb on 12/30/2020\n */\n\nexport * from './sidebar-container.component';\nexport * from './sidebar-pusher.component';\nexport * from './sidebar.component';\nexport * from './sidebar.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;;AAEG;MAKU,iBAAiB,CAAA;AAD9B,IAAA,WAAA,GAAA;AAES,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAQ;AACxC,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,YAAY,EAAW;QAE9C,IAAA,CAAA,UAAU,GAAG,KAAK;AAe3B,IAAA;;AAZC,IAAA,IAAW,SAAS,GAAA;QAClB,OAAO,IAAI,CAAC,UAAU;IACxB;IAEO,mBAAmB,GAAA;AACxB,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE;IAC3B;AAEO,IAAA,gBAAgB,CAAC,SAAkB,EAAA;AACxC,QAAA,IAAI,CAAC,UAAU,GAAG,SAAS;AAC3B,QAAA,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC;IACxC;+GAlBW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAAjB,iBAAiB,EAAA,CAAA,CAAA;;4FAAjB,iBAAi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AA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,EAAA,SAAA,EAJhB;YACT;AACD,SAAA,EAAA,OAAA,EAAA,CAZC,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAcH,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAhB5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,yBAAyB;wBACzB;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,mBAAmB;wBACnB,yBAAyB;wBACzB;AACD,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT;AACD;AACF,iBAAA;;;AC1BD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -134,11 +134,14 @@ class SuiStickyDirective {
134
134
  savePositions() {
135
135
  const mod = this.el.nativeElement;
136
136
  const ctx = this.contextEl;
137
- const scrollH = window.innerHeight;
137
+ const scrollH = this.scrollEl === window ? window.innerHeight : this.scrollEl.clientHeight;
138
138
  const cs = getComputedStyle(mod);
139
139
  const marginTop = parseInt(cs.marginTop, 10) || 0;
140
140
  const marginBottom = parseInt(cs.marginBottom, 10) || 0;
141
- const sy = window.scrollY;
141
+ // positions are measured in the coordinate space of the scroll context so they can be compared with its scrollTop
142
+ const scroller = this.scrollEl === window ? null : this.scrollEl;
143
+ const scrollerTop = scroller ? scroller.getBoundingClientRect().top : 0;
144
+ const sy = scroller ? scroller.scrollTop - scrollerTop : window.scrollY;
142
145
  const sx = window.scrollX;
143
146
  const er = mod.getBoundingClientRect();
144
147
  const cr = ctx.getBoundingClientRect();
@@ -334,6 +337,9 @@ class SuiStickyDirective {
334
337
  this.renderer.setStyle(this.el.nativeElement, 'left', `${cache.element.left}px`);
335
338
  this.renderer.setStyle(this.el.nativeElement, 'bottom', '');
336
339
  this.renderer.setStyle(this.el.nativeElement, 'margin-bottom', '');
340
+ if (this.scrollEl !== window) {
341
+ this.renderer.setStyle(this.el.nativeElement, 'top', `${this.scrollEl.getBoundingClientRect().top}px`);
342
+ }
337
343
  this.fixed = true;
338
344
  this.bound = false;
339
345
  this.topState = true;
@@ -353,6 +359,10 @@ class SuiStickyDirective {
353
359
  }
354
360
  this.renderer.setStyle(this.el.nativeElement, 'margin-top', `${this.suiOffset}px`);
355
361
  this.renderer.setStyle(this.el.nativeElement, 'left', `${cache.element.left}px`);
362
+ if (this.scrollEl !== window) {
363
+ const bottom = window.innerHeight - this.scrollEl.getBoundingClientRect().bottom;
364
+ this.renderer.setStyle(this.el.nativeElement, 'bottom', `${bottom}px`);
365
+ }
356
366
  this.fixed = true;
357
367
  this.bound = false;
358
368
  this.topState = false;
@@ -366,6 +376,7 @@ class SuiStickyDirective {
366
376
  this.lastScroll = undefined;
367
377
  this.elementScroll = 0;
368
378
  if (wasStuck) {
379
+ this.suiOnTop.emit();
369
380
  this.suiOnUnstick.emit();
370
381
  }
371
382
  }
@@ -420,8 +431,8 @@ class SuiStickyDirective {
420
431
  this.resetLayout();
421
432
  this.cache = null;
422
433
  }
423
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiStickyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
424
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.7", type: SuiStickyDirective, isStandalone: true, selector: "[suiSticky]", inputs: { suiContext: "suiContext", suiScrollContext: "suiScrollContext", suiOffset: "suiOffset", suiBottomOffset: "suiBottomOffset", suiPushing: "suiPushing", suiSetSize: "suiSetSize", suiJitter: "suiJitter", suiObserveChanges: "suiObserveChanges" }, outputs: { suiOnReposition: "suiOnReposition", suiOnScroll: "suiOnScroll", suiOnStick: "suiOnStick", suiOnUnstick: "suiOnUnstick", suiOnTop: "suiOnTop", suiOnBottom: "suiOnBottom" }, host: { properties: { "class.ui": "this.classUi", "class.sticky": "this.classSticky", "class.fixed": "this.fixed", "class.bound": "this.bound", "class.top": "this.topState", "class.bottom": "this.bottomState" } }, exportAs: ["suiSticky"], ngImport: i0 }); }
434
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiStickyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
435
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.23", type: SuiStickyDirective, isStandalone: true, selector: "[suiSticky]", inputs: { suiContext: "suiContext", suiScrollContext: "suiScrollContext", suiOffset: "suiOffset", suiBottomOffset: "suiBottomOffset", suiPushing: "suiPushing", suiSetSize: "suiSetSize", suiJitter: "suiJitter", suiObserveChanges: "suiObserveChanges" }, outputs: { suiOnReposition: "suiOnReposition", suiOnScroll: "suiOnScroll", suiOnStick: "suiOnStick", suiOnUnstick: "suiOnUnstick", suiOnTop: "suiOnTop", suiOnBottom: "suiOnBottom" }, host: { properties: { "class.ui": "this.classUi", "class.sticky": "this.classSticky", "class.fixed": "this.fixed", "class.bound": "this.bound", "class.top": "this.topState", "class.bottom": "this.bottomState" } }, exportAs: ["suiSticky"], ngImport: i0 }); }
425
436
  }
426
437
  __decorate([
427
438
  InputBoolean()
@@ -432,7 +443,7 @@ __decorate([
432
443
  __decorate([
433
444
  InputBoolean()
434
445
  ], SuiStickyDirective.prototype, "suiObserveChanges", void 0);
435
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiStickyDirective, decorators: [{
446
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiStickyDirective, decorators: [{
436
447
  type: Directive,
437
448
  args: [{
438
449
  standalone: true,
@@ -488,11 +499,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
488
499
  }] } });
489
500
 
490
501
  class SuiStickyModule {
491
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiStickyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
492
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.7", ngImport: i0, type: SuiStickyModule, imports: [CommonModule, SuiStickyDirective], exports: [SuiStickyDirective] }); }
493
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiStickyModule, imports: [CommonModule] }); }
502
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiStickyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
503
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.23", ngImport: i0, type: SuiStickyModule, imports: [CommonModule, SuiStickyDirective], exports: [SuiStickyDirective] }); }
504
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiStickyModule, imports: [CommonModule] }); }
494
505
  }
495
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SuiStickyModule, decorators: [{
506
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SuiStickyModule, decorators: [{
496
507
  type: NgModule,
497
508
  args: [{
498
509
  imports: [CommonModule, SuiStickyDirective],