@koobiq/components 20.3.2 → 20.4.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 (37) hide show
  1. package/core/index.d.ts +114 -5
  2. package/core/option/_option-theme.scss +3 -0
  3. package/ellipsis-center/ellipsis-center.scss +31 -0
  4. package/ellipsis-center/index.d.ts +3 -3
  5. package/fesm2022/koobiq-components-core.mjs +173 -8
  6. package/fesm2022/koobiq-components-core.mjs.map +1 -1
  7. package/fesm2022/koobiq-components-ellipsis-center.mjs +27 -15
  8. package/fesm2022/koobiq-components-ellipsis-center.mjs.map +1 -1
  9. package/fesm2022/koobiq-components-file-upload.mjs +4 -4
  10. package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
  11. package/fesm2022/koobiq-components-filter-bar.mjs +36 -32
  12. package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
  13. package/fesm2022/koobiq-components-inline-edit.mjs +177 -14
  14. package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
  15. package/fesm2022/koobiq-components-list.mjs +357 -42
  16. package/fesm2022/koobiq-components-list.mjs.map +1 -1
  17. package/fesm2022/koobiq-components-select.mjs +20 -2
  18. package/fesm2022/koobiq-components-select.mjs.map +1 -1
  19. package/fesm2022/koobiq-components-tabs.mjs +453 -196
  20. package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
  21. package/fesm2022/koobiq-components-timezone.mjs +2 -2
  22. package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
  23. package/file-upload/file-upload.scss +0 -29
  24. package/filter-bar/index.d.ts +16 -0
  25. package/filter-bar/pipes/base-pipe.scss +11 -0
  26. package/inline-edit/index.d.ts +87 -8
  27. package/inline-edit/inline-edit-tokens.scss +1 -0
  28. package/inline-edit/inline-edit.scss +26 -0
  29. package/list/index.d.ts +126 -5
  30. package/package.json +3 -3
  31. package/schematics/ng-add/index.js +1 -1
  32. package/select/index.d.ts +6 -0
  33. package/tabs/_tabs-common.scss +111 -2
  34. package/tabs/index.d.ts +78 -48
  35. package/tabs/tab-group.scss +0 -4
  36. package/tabs/tab-header.scss +0 -2
  37. package/tabs/tab-nav-bar.scss +3 -11
package/tabs/index.d.ts CHANGED
@@ -133,11 +133,6 @@ declare abstract class KbqPaginatedTabHeader implements AfterContentChecked, Aft
133
133
  get focusIndex(): number;
134
134
  /** When the focus index is set, we must manually send focus to the correct label */
135
135
  set focusIndex(value: number);
136
- /** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
137
- get scrollDistance(): number;
138
- set scrollDistance(v: number);
139
- /** The distance in pixels that the tab labels should be translated to the left. */
140
- private _scrollDistance;
141
136
  abstract readonly items: QueryList<KbqPaginatedTabHeaderItem>;
142
137
  abstract readonly tabListContainer: ElementRef<HTMLElement>;
143
138
  abstract readonly tabList: ElementRef<HTMLElement>;
@@ -167,8 +162,6 @@ declare abstract class KbqPaginatedTabHeader implements AfterContentChecked, Aft
167
162
  * should re-evaluate the scroll position.
168
163
  */
169
164
  private tabLabelCount;
170
- /** Whether the scroll distance has changed and should be applied after the view is checked. */
171
- private scrollDistanceChanged;
172
165
  /** Used to manage focus between the tabs. */
173
166
  private keyManager;
174
167
  /** Cached text content of the header. */
@@ -177,14 +170,35 @@ declare abstract class KbqPaginatedTabHeader implements AfterContentChecked, Aft
177
170
  private stopScrolling;
178
171
  /** Whether the header should scroll to the selected index after the view has been checked. */
179
172
  private selectedIndexChanged;
173
+ /** State of the in-progress mouse/pen drag gesture, if any. */
174
+ private dragState;
175
+ /** `requestAnimationFrame` handle for an in-progress inertia coast, if any. */
176
+ private inertiaFrameId;
177
+ /** Set after a drag gesture so the click it would otherwise trigger on a tab is suppressed. */
178
+ private suppressNextClick;
179
+ /** Handle of the timer that clears {@link suppressNextClick}, so it can be cancelled on destroy. */
180
+ private suppressClickTimeoutId;
181
+ private readonly documentPointerMoveListener;
182
+ private readonly documentPointerUpListener;
183
+ private readonly documentPointerCancelListener;
184
+ /** Emits on every native `scroll` event and drag/inertia frame; throttled to limit change detection. */
185
+ private readonly scrollProgress;
186
+ /**
187
+ * Emits scroll-correction requests (from focus or selection changes); debounced so a burst
188
+ * settles once. `ReplaySubject(1)`, not `Subject`: content hooks (where the very first request,
189
+ * from `ngAfterContentChecked`, is sent) run before view hooks in the same initial change-
190
+ * detection pass, so a plain `Subject` would drop it — the `ngAfterViewInit` subscription below
191
+ * doesn't exist yet when it's emitted.
192
+ */
193
+ private readonly scrollCorrectionRequest;
180
194
  protected readonly destroyRef: DestroyRef;
181
195
  readonly elementRef: ElementRef<HTMLElement>;
182
196
  protected readonly changeDetectorRef: ChangeDetectorRef;
183
- private readonly viewportRuler;
184
197
  private readonly ngZone;
185
198
  private readonly platform;
186
199
  private readonly dir;
187
200
  private readonly window;
201
+ private readonly sharedResizeObserver;
188
202
  constructor();
189
203
  /** Called when the user has selected an item via the keyboard. */
190
204
  ngAfterViewInit(): void;
@@ -216,29 +230,16 @@ declare abstract class KbqPaginatedTabHeader implements AfterContentChecked, Aft
216
230
  setTabFocus(tabIndex: number): void;
217
231
  /** The layout direction of the containing app. */
218
232
  getLayoutDirection(): Direction;
219
- /** Performs the CSS transformation on the tab list that will cause the list to scroll. */
220
- updateTabScrollPosition(): void;
221
233
  /**
222
234
  * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
223
- * the end of the list, respectively). The distance to scroll is computed to be a third of the
224
- * length of the tab list view window.
235
+ * the end of the list, respectively).
225
236
  *
226
237
  * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
227
238
  * should be called sparingly.
228
239
  */
229
- scrollHeader(direction: ScrollDirection$1): {
230
- maxScrollDistance: number;
231
- distance: number;
232
- };
240
+ scrollHeader(direction: ScrollDirection$1): void;
233
241
  /** Handles click events on the pagination arrows. */
234
242
  handlePaginatorClick(direction: ScrollDirection$1): void;
235
- /**
236
- * Moves the tab list such that the desired tab label (marked by index) is moved into view.
237
- *
238
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
239
- * should be called sparingly.
240
- */
241
- scrollToLabel(labelIndex: number): void;
242
243
  /**
243
244
  * Evaluate whether the pagination controls should be displayed. If the scroll width of the
244
245
  * tab list is wider than the size of the header container, then the pagination controls should
@@ -248,24 +249,6 @@ declare abstract class KbqPaginatedTabHeader implements AfterContentChecked, Aft
248
249
  * should be called sparingly.
249
250
  */
250
251
  checkPaginationEnabled(): void;
251
- /**
252
- * Evaluate whether the before and after controls should be enabled or disabled.
253
- * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
254
- * before button. If the header is at the end of the list (scroll distance is equal to the
255
- * maximum distance we can scroll), then disable the after button.
256
- *
257
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
258
- * should be called sparingly.
259
- */
260
- checkScrollingControls(): void;
261
- /**
262
- * Determines what is the maximum length in pixels that can be set for the scroll distance. This
263
- * is equal to the difference in width between the tab list container and tab header container.
264
- *
265
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
266
- * should be called sparingly.
267
- */
268
- getMaxScrollDistance(): number;
269
252
  /** Stops the currently-running paginator interval. */
270
253
  stopInterval(): void;
271
254
  /**
@@ -276,12 +259,43 @@ declare abstract class KbqPaginatedTabHeader implements AfterContentChecked, Aft
276
259
  handlePaginatorPress(direction: ScrollDirection$1, mouseEvent?: MouseEvent): void;
277
260
  protected abstract itemSelected(event: KeyboardEvent): void;
278
261
  /**
279
- * Scrolls the header to a given position.
280
- * @param position Position to which to scroll.
281
- * @returns Information on the current scroll distance and the maximum.
262
+ * The tab list's scroll position expressed independently of reading direction: `0` at the
263
+ * start of the tab list, growing towards the end — mirrors native `scrollLeft`'s RTL-dependent
264
+ * sign so callers can reason about "before"/"after" without checking direction themselves.
282
265
  */
283
- private scrollTo;
284
- private updateScrollPosition;
266
+ private get logicalScrollPosition();
267
+ /**
268
+ * Scrolls the header to a given logical position (see {@link logicalScrollPosition}).
269
+ * @param value Logical position to scroll to.
270
+ * @param behavior Scroll animation behavior; `'auto'` jumps instantly, `'smooth'` animates.
271
+ */
272
+ private scroll;
273
+ /**
274
+ * Moves the tab list such that the desired tab label (marked by index) is moved into view.
275
+ *
276
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
277
+ * should be called sparingly.
278
+ */
279
+ private scrollCorrection;
280
+ /**
281
+ * Recomputes the pagination arrow-enabled state from the container's real scroll metrics.
282
+ * Bound to the native `scroll` event — this is the sole source of truth, no imperative call
283
+ * is needed after drag/inertia/arrow-click scroll writes.
284
+ *
285
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
286
+ * should be called sparingly.
287
+ */
288
+ private updateScrollState;
289
+ private handlePointerDown;
290
+ private handlePointerMove;
291
+ private cancelDrag;
292
+ private endDrag;
293
+ private finishDrag;
294
+ private attachDocumentDragListeners;
295
+ private detachDocumentDragListeners;
296
+ private startInertia;
297
+ private cancelInertia;
298
+ private clampVelocity;
285
299
  static ɵfac: i0.ɵɵFactoryDeclaration<KbqPaginatedTabHeader, never>;
286
300
  static ɵdir: i0.ɵɵDirectiveDeclaration<KbqPaginatedTabHeader, never, never, { "selectedIndex": { "alias": "selectedIndex"; "required": false; }; "disablePagination": { "alias": "disablePagination"; "required": false; }; "vertical": { "alias": "vertical"; "required": false; }; }, {}, never, never, true, never>;
287
301
  static ngAcceptInputType_selectedIndex: unknown;
@@ -374,7 +388,15 @@ declare class KbqTabLabelWrapper implements AfterViewInit {
374
388
  set disabled(value: boolean);
375
389
  private _disabled;
376
390
  ngAfterViewInit(): void;
377
- /** Sets focus on the wrapper element */
391
+ /**
392
+ * Sets focus on the wrapper element.
393
+ *
394
+ * `preventScroll: true`: `FocusKeyManager.setActiveItem` calls this itself, right after (and
395
+ * unconditionally on) the `change` emission that runs `KbqPaginatedTabHeader.setTabFocus` — so
396
+ * without the guard here too, that call's own `preventScroll: true` is immediately undone by
397
+ * this one, and an overflowing header double-jumps (native scroll-into-view, then the
398
+ * paginator-aware `scrollCorrection`) on every arrow-key press.
399
+ */
378
400
  focus(): void;
379
401
  getOffsetLeft(): number;
380
402
  getOffsetWidth(): number;
@@ -609,7 +631,15 @@ declare class KbqTabLink implements OnDestroy, AfterViewInit {
609
631
  ngAfterViewInit(): void;
610
632
  ngOnDestroy(): void;
611
633
  private addClassModifierForIcons;
612
- /** Focuses the tab link. */
634
+ /**
635
+ * Focuses the tab link.
636
+ *
637
+ * `preventScroll: true`: `FocusKeyManager.setActiveItem` calls this itself, right after (and
638
+ * unconditionally on) the `change` emission that runs `KbqPaginatedTabHeader.setTabFocus` — so
639
+ * without the guard here too, that call's own `preventScroll: true` is immediately undone by
640
+ * this one, and an overflowing nav bar double-jumps (native scroll-into-view, then the
641
+ * paginator-aware `scrollCorrection`) on every arrow-key press.
642
+ */
613
643
  focus(): void;
614
644
  /** Handles the focus event. */
615
645
  protected handleFocus(): void;
@@ -17,10 +17,6 @@
17
17
  .kbq-tab-list__content {
18
18
  gap: var(--kbq-tabs-size-tab-stack-vertical-content-gap-vertical) 0;
19
19
  }
20
-
21
- & .kbq-tab-header__container {
22
- overflow-y: auto;
23
- }
24
20
  }
25
21
 
26
22
  .kbq-tab-body__wrapper {
@@ -41,7 +41,6 @@
41
41
  display: flex;
42
42
  flex-grow: 1;
43
43
  z-index: 1;
44
- overflow: hidden;
45
44
 
46
45
  .kbq-tab-header_underlined:not(.kbq-tab-header__pagination-controls_enabled) & {
47
46
  overflow: visible;
@@ -51,7 +50,6 @@
51
50
  .kbq-tab-list {
52
51
  position: relative;
53
52
  width: 100%;
54
- transition: transform 500ms cubic-bezier(0.35, 0, 0.25, 1);
55
53
  }
56
54
 
57
55
  .kbq-tab-label {
@@ -10,7 +10,6 @@
10
10
  display: flex;
11
11
  flex-grow: 1;
12
12
  z-index: 1;
13
- overflow: hidden;
14
13
  }
15
14
 
16
15
  &.kbq-tab-header_underlined:not(.kbq-tab-header__pagination-controls_enabled) .kbq-tab-link__container {
@@ -20,21 +19,14 @@
20
19
  .kbq-tab-list {
21
20
  position: relative;
22
21
  width: 100%;
23
- transition: transform 500ms cubic-bezier(0.35, 0, 0.25, 1);
24
22
  }
25
23
 
26
24
  .kbq-tab-list__content {
27
25
  display: flex;
28
26
  }
29
27
 
30
- &.kbq-tab-group_vertical {
31
- .kbq-tab-link__container {
32
- overflow-y: scroll;
33
- }
34
-
35
- .kbq-tab-list__content {
36
- flex-direction: column;
37
- gap: var(--kbq-tabs-size-tab-stack-vertical-content-gap-vertical);
38
- }
28
+ &.kbq-tab-group_vertical .kbq-tab-list__content {
29
+ flex-direction: column;
30
+ gap: var(--kbq-tabs-size-tab-stack-vertical-content-gap-vertical);
39
31
  }
40
32
  }