@koobiq/components 18.7.0 → 18.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/accordion/accordion-trigger.component.mjs +5 -17
- package/esm2022/alert/alert.component.mjs +3 -3
- package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +4 -3
- package/esm2022/autocomplete/autocomplete.component.mjs +3 -3
- package/esm2022/button/button.component.mjs +3 -3
- package/esm2022/button-toggle/button-toggle.component.mjs +3 -9
- package/esm2022/checkbox/checkbox.mjs +3 -3
- package/esm2022/code-block/code-block.component.mjs +3 -3
- package/esm2022/core/option/optgroup.mjs +3 -3
- package/esm2022/core/option/option.mjs +3 -3
- package/esm2022/core/version.mjs +2 -2
- package/esm2022/datepicker/calendar-body.component.mjs +3 -3
- package/esm2022/datepicker/calendar-header.component.mjs +3 -3
- package/esm2022/datepicker/datepicker-toggle.component.mjs +3 -3
- package/esm2022/datepicker/datepicker.component.mjs +3 -2
- package/esm2022/datepicker/month-view.component.mjs +3 -3
- package/esm2022/dropdown/dropdown-item.component.mjs +3 -3
- package/esm2022/file-upload/multiple-file-upload.component.mjs +3 -3
- package/esm2022/file-upload/single-file-upload.component.mjs +3 -3
- package/esm2022/form-field/cleaner.mjs +3 -9
- package/esm2022/form-field/form-field.mjs +3 -3
- package/esm2022/form-field/password-hint.mjs +3 -11
- package/esm2022/list/list-selection.component.mjs +5 -13
- package/esm2022/loader-overlay/loader-overlay.component.mjs +3 -3
- package/esm2022/markdown/markdown.component.mjs +5 -19
- package/esm2022/modal/modal.component.mjs +5 -4
- package/esm2022/modal/modal.directive.mjs +5 -17
- package/esm2022/navbar/navbar-item.component.mjs +3 -3
- package/esm2022/navbar/vertical-navbar.component.mjs +3 -11
- package/esm2022/popover/popover-confirm.component.mjs +3 -3
- package/esm2022/popover/popover.component.mjs +3 -3
- package/esm2022/progress-bar/progress-bar.component.mjs +3 -3
- package/esm2022/progress-spinner/progress-spinner.component.mjs +3 -3
- package/esm2022/radio/radio.component.mjs +3 -3
- package/esm2022/select/select.component.mjs +3 -3
- package/esm2022/sidepanel/sidepanel-container.component.mjs +3 -3
- package/esm2022/sidepanel/sidepanel-directives.mjs +7 -29
- package/esm2022/tabs/paginated-tab-header.mjs +32 -30
- package/esm2022/tabs/public-api.mjs +8 -8
- package/esm2022/tabs/tab-body.component.mjs +3 -3
- package/esm2022/tabs/tab-group.component.mjs +34 -52
- package/esm2022/tabs/tab-header.component.mjs +17 -35
- package/esm2022/tabs/tab-nav-bar.mjs +292 -0
- package/esm2022/tabs/tab.component.mjs +6 -5
- package/esm2022/tabs/tabs.module.mjs +39 -45
- package/esm2022/tags/tag.component.mjs +3 -3
- package/esm2022/timezone/timezone-option.component.mjs +3 -3
- package/esm2022/timezone/timezone-select.component.mjs +3 -3
- package/esm2022/toast/toast.component.mjs +3 -3
- package/esm2022/toggle/toggle.component.mjs +3 -3
- package/esm2022/tooltip/tooltip.component.mjs +3 -3
- package/esm2022/tree/tree-option.component.mjs +3 -3
- package/esm2022/tree-select/tree-select.component.mjs +5 -4
- package/fesm2022/koobiq-components-accordion.mjs +4 -16
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-alert.mjs +2 -2
- package/fesm2022/koobiq-components-alert.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +5 -4
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +2 -8
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +2 -2
- package/fesm2022/koobiq-components-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-checkbox.mjs +2 -2
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +2 -2
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +5 -5
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +10 -9
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +2 -2
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-file-upload.mjs +4 -4
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +6 -20
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +4 -12
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-loader-overlay.mjs +2 -2
- package/fesm2022/koobiq-components-loader-overlay.mjs.map +1 -1
- package/fesm2022/koobiq-components-markdown.mjs +4 -18
- package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +8 -19
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +4 -12
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +4 -4
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-bar.mjs +2 -2
- package/fesm2022/koobiq-components-progress-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-spinner.mjs +2 -2
- package/fesm2022/koobiq-components-progress-spinner.mjs.map +1 -1
- package/fesm2022/koobiq-components-radio.mjs +2 -2
- package/fesm2022/koobiq-components-radio.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +2 -2
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidepanel.mjs +8 -30
- package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +349 -208
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +2 -2
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +4 -4
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-toast.mjs +2 -2
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +2 -2
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +2 -2
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +4 -3
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +2 -2
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/package.json +5 -5
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/prebuilt-themes/theme.css +1 -1
- package/schematics/migrations/css-selectors/index.js +4 -3
- package/schematics/migrations/deprecated-icons/index.js +4 -3
- package/schematics/migrations/new-icons-pack/index.js +3 -2
- package/schematics/ng-add/index.js +6 -5
- package/schematics/utils/messages.js +13 -0
- package/schematics/utils/package-config.js +58 -7
- package/tabs/_tabs-common.scss +27 -5
- package/tabs/_tabs-theme.scss +6 -16
- package/tabs/paginated-tab-header.d.ts +23 -21
- package/tabs/public-api.d.ts +7 -7
- package/tabs/tab-group.component.d.ts +21 -24
- package/tabs/tab-group.scss +27 -29
- package/tabs/tab-header.component.d.ts +13 -19
- package/tabs/tab-header.scss +5 -27
- package/tabs/tab-link.scss +14 -0
- package/tabs/tab-nav-bar.d.ts +92 -0
- package/tabs/tab-nav-bar.scss +36 -0
- package/tabs/tab.component.d.ts +1 -0
- package/tabs/tabs.module.d.ts +12 -12
- package/esm2022/tabs/tab-nav-bar/index.mjs +0 -2
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +0 -119
- package/tabs/README.md +0 -0
- package/tabs/tab-nav-bar/index.d.ts +0 -1
- package/tabs/tab-nav-bar/tab-nav-bar.d.ts +0 -42
- package/tabs/tab-nav-bar/tab-nav-bar.scss +0 -35
|
@@ -1,11 +1,62 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('@angular-devkit/schematics');
|
|
4
|
-
require('@schematics/angular/utility');
|
|
5
|
-
var
|
|
3
|
+
var schematics = require('@angular-devkit/schematics');
|
|
4
|
+
var utility = require('@schematics/angular/utility');
|
|
5
|
+
var utils_messages = require('./messages.js');
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Sorts the keys of the given object.
|
|
9
|
+
* @returns A new object instance with sorted keys
|
|
10
|
+
*/
|
|
11
|
+
function sortObjectByKeys(obj) {
|
|
12
|
+
return Object.keys(obj)
|
|
13
|
+
.sort()
|
|
14
|
+
.reduce((result, key) => (result[key] = obj[key]) && result, {});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Adds a package to the package.json in the given tree
|
|
18
|
+
*/
|
|
19
|
+
function addPackageToPackageJson(tree, pkg, version, devDependency = false) {
|
|
20
|
+
if (tree.exists('package.json')) {
|
|
21
|
+
const sourceText = tree.read('package.json').toString('utf-8');
|
|
22
|
+
const json = JSON.parse(sourceText);
|
|
23
|
+
const dependenciesType = devDependency ? 'devDependencies' : 'dependencies';
|
|
24
|
+
const dependencies = json[dependenciesType] || {};
|
|
25
|
+
if (!dependencies[pkg]) {
|
|
26
|
+
dependencies[pkg] = version;
|
|
27
|
+
json[dependenciesType] = sortObjectByKeys(dependencies);
|
|
28
|
+
}
|
|
29
|
+
tree.overwrite('package.json', JSON.stringify(json, null, 2));
|
|
30
|
+
}
|
|
31
|
+
return tree;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Gets the version of the specified package by looking at the package.json in the given tree
|
|
35
|
+
*/
|
|
36
|
+
function getPackageVersionFromPackageJson(tree, name, includeDevDependencies = false) {
|
|
37
|
+
if (!tree.exists('package.json')) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const packageJson = JSON.parse(tree.read('package.json').toString('utf8'));
|
|
41
|
+
if (packageJson.dependencies && packageJson.dependencies[name]) {
|
|
42
|
+
return packageJson.dependencies[name];
|
|
43
|
+
}
|
|
44
|
+
if (includeDevDependencies && packageJson.devDependencies && packageJson.devDependencies[name]) {
|
|
45
|
+
return packageJson.devDependencies[name];
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
async function setupOptions(project, tree) {
|
|
50
|
+
if (project) {
|
|
51
|
+
const workspace = await utility.readWorkspace(tree);
|
|
52
|
+
const projectWorkspace = workspace.projects.get(project);
|
|
53
|
+
if (!projectWorkspace) {
|
|
54
|
+
throw new schematics.SchematicsException(utils_messages.noProject(project));
|
|
55
|
+
}
|
|
56
|
+
return projectWorkspace;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
7
59
|
|
|
8
|
-
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.setupOptions = utils_packageConfig.setupOptions;
|
|
60
|
+
exports.addPackageToPackageJson = addPackageToPackageJson;
|
|
61
|
+
exports.getPackageVersionFromPackageJson = getPackageVersionFromPackageJson;
|
|
62
|
+
exports.setupOptions = setupOptions;
|
package/tabs/_tabs-common.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
@use '../core/styles/common/tokens'
|
|
1
|
+
@use '../core/styles/common/tokens';
|
|
2
|
+
@use '../core/styles/common/vendor-prefixes';
|
|
2
3
|
|
|
3
4
|
@mixin tab-label {
|
|
4
5
|
position: relative;
|
|
@@ -14,11 +15,11 @@
|
|
|
14
15
|
|
|
15
16
|
cursor: pointer;
|
|
16
17
|
|
|
17
|
-
padding: kbq-difference-series-css-variables(
|
|
18
|
+
padding: tokens.kbq-difference-series-css-variables(
|
|
18
19
|
[tabs-size-tab-item-padding-vertical,
|
|
19
20
|
tabs-size-tab-item-focus-outline-width]
|
|
20
21
|
)
|
|
21
|
-
kbq-difference-series-css-variables(
|
|
22
|
+
tokens.kbq-difference-series-css-variables(
|
|
22
23
|
[tabs-size-tab-item-padding-horizontal,
|
|
23
24
|
tabs-size-tab-item-focus-outline-width]
|
|
24
25
|
);
|
|
@@ -38,14 +39,14 @@
|
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
&.kbq-tab-label_underlined:not(.kbq-tab-label_vertical).kbq-tab-label_with-icon-left {
|
|
41
|
-
padding-left: kbq-difference-series-css-variables(
|
|
42
|
+
padding-left: tokens.kbq-difference-series-css-variables(
|
|
42
43
|
[tabs-size-tab-item-padding-horizontal,
|
|
43
44
|
tabs-size-tab-item-focus-outline-width]
|
|
44
45
|
);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
&.kbq-tab-label_underlined:not(.kbq-tab-label_vertical).kbq-tab-label_with-icon-right {
|
|
48
|
-
padding-right: kbq-difference-series-css-variables(
|
|
49
|
+
padding-right: tokens.kbq-difference-series-css-variables(
|
|
49
50
|
[tabs-size-tab-item-padding-horizontal,
|
|
50
51
|
tabs-size-tab-item-focus-outline-width]
|
|
51
52
|
);
|
|
@@ -90,3 +91,24 @@
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
}
|
|
94
|
+
|
|
95
|
+
// Common styles for paginated tabs, used by `.kbq-tab-header` and `.kbq-tab-nav-bar`
|
|
96
|
+
@mixin paginated-tab-header {
|
|
97
|
+
.kbq-tab-header__pagination {
|
|
98
|
+
@include vendor-prefixes.user-select(none);
|
|
99
|
+
|
|
100
|
+
position: relative;
|
|
101
|
+
display: none;
|
|
102
|
+
justify-content: center;
|
|
103
|
+
align-items: center;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
z-index: 2;
|
|
106
|
+
-webkit-tap-highlight-color: transparent;
|
|
107
|
+
touch-action: none;
|
|
108
|
+
padding: 0 var(--kbq-size-m);
|
|
109
|
+
|
|
110
|
+
.kbq-tab-header__pagination-controls_enabled & {
|
|
111
|
+
display: flex;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
package/tabs/_tabs-theme.scss
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
@use '../core/styles/
|
|
2
|
-
@use '../core/styles/common/tokens' as *;
|
|
1
|
+
@use '../core/styles/common/tokens';
|
|
3
2
|
|
|
4
3
|
@mixin kbq-tab-item-state($type, $sub-type, $style-name) {
|
|
5
4
|
$base: tabs-tab-item-#{$type}-#{$sub-type}-#{$style-name};
|
|
@@ -52,7 +51,6 @@
|
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
//noinspection ALL
|
|
56
54
|
@mixin kbq-tabs-theme() {
|
|
57
55
|
.kbq-tab-group {
|
|
58
56
|
&.kbq-tab-group_filled {
|
|
@@ -104,9 +102,7 @@
|
|
|
104
102
|
.kbq-tab-nav-bar {
|
|
105
103
|
&.kbq-tab-nav-bar_filled {
|
|
106
104
|
&.kbq-tab-nav-bar_on-background {
|
|
107
|
-
|
|
108
|
-
background: var(--kbq-tabs-tab-stack-filled-on-background-background);
|
|
109
|
-
}
|
|
105
|
+
background: var(--kbq-tabs-tab-stack-filled-on-background-background);
|
|
110
106
|
|
|
111
107
|
& .kbq-tab-link {
|
|
112
108
|
@include kbq-tab-item-style(filled, on-background);
|
|
@@ -114,9 +110,7 @@
|
|
|
114
110
|
}
|
|
115
111
|
|
|
116
112
|
&.kbq-tab-nav-bar_on-surface {
|
|
117
|
-
|
|
118
|
-
background: var(--kbq-tabs-tab-stack-filled-on-surface-background);
|
|
119
|
-
}
|
|
113
|
+
background: var(--kbq-tabs-tab-stack-filled-on-surface-background);
|
|
120
114
|
|
|
121
115
|
& .kbq-tab-link {
|
|
122
116
|
@include kbq-tab-item-style(filled, on-background);
|
|
@@ -126,9 +120,7 @@
|
|
|
126
120
|
|
|
127
121
|
&.kbq-tab-nav-bar_transparent {
|
|
128
122
|
&.kbq-tab-nav-bar_on-background {
|
|
129
|
-
|
|
130
|
-
background: var(--kbq-tabs-tab-stack-transparent-on-background-background);
|
|
131
|
-
}
|
|
123
|
+
background: var(--kbq-tabs-tab-stack-transparent-on-background-background);
|
|
132
124
|
|
|
133
125
|
& .kbq-tab-link {
|
|
134
126
|
@include kbq-tab-item-style(transparent, on-background);
|
|
@@ -136,9 +128,7 @@
|
|
|
136
128
|
}
|
|
137
129
|
|
|
138
130
|
&.kbq-tab-nav-bar_on-surface {
|
|
139
|
-
|
|
140
|
-
background: var(--kbq-tabs-tab-stack-transparent-on-surface-background);
|
|
141
|
-
}
|
|
131
|
+
background: var(--kbq-tabs-tab-stack-transparent-on-surface-background);
|
|
142
132
|
|
|
143
133
|
& .kbq-tab-link {
|
|
144
134
|
@include kbq-tab-item-style(transparent, on-background);
|
|
@@ -151,6 +141,6 @@
|
|
|
151
141
|
@mixin kbq-tabs-typography() {
|
|
152
142
|
.kbq-tab-label,
|
|
153
143
|
.kbq-tab-link {
|
|
154
|
-
@include kbq-typography-level-to-styles-css-variables(typography, text-normal-medium);
|
|
144
|
+
@include tokens.kbq-typography-level-to-styles-css-variables(typography, text-normal-medium);
|
|
155
145
|
}
|
|
156
146
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { FocusableOption } from '@angular/cdk/a11y';
|
|
2
|
-
import { Direction
|
|
3
|
-
import {
|
|
4
|
-
import { ViewportRuler } from '@angular/cdk/scrolling';
|
|
5
|
-
import { AfterContentChecked, AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy, QueryList } from '@angular/core';
|
|
2
|
+
import { Direction } from '@angular/cdk/bidi';
|
|
3
|
+
import { AfterContentChecked, AfterContentInit, AfterViewInit, ChangeDetectorRef, DestroyRef, ElementRef, EventEmitter, OnDestroy, QueryList } from '@angular/core';
|
|
6
4
|
import * as i0 from "@angular/core";
|
|
7
5
|
/**
|
|
8
6
|
* The directions that scrolling can go in when the header's tabs exceed the header width. 'After'
|
|
@@ -19,13 +17,6 @@ export type KbqPaginatedTabHeaderItem = FocusableOption & {
|
|
|
19
17
|
* @docs-private
|
|
20
18
|
*/
|
|
21
19
|
export declare abstract class KbqPaginatedTabHeader implements AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy {
|
|
22
|
-
protected elementRef: ElementRef<HTMLElement>;
|
|
23
|
-
protected changeDetectorRef: ChangeDetectorRef;
|
|
24
|
-
private viewportRuler;
|
|
25
|
-
private ngZone;
|
|
26
|
-
private platform;
|
|
27
|
-
private dir;
|
|
28
|
-
animationMode?: string | undefined;
|
|
29
20
|
/** The index of the active tab. */
|
|
30
21
|
get selectedIndex(): number;
|
|
31
22
|
set selectedIndex(value: number);
|
|
@@ -39,11 +30,11 @@ export declare abstract class KbqPaginatedTabHeader implements AfterContentCheck
|
|
|
39
30
|
set scrollDistance(v: number);
|
|
40
31
|
/** The distance in pixels that the tab labels should be translated to the left. */
|
|
41
32
|
private _scrollDistance;
|
|
42
|
-
abstract items: QueryList<KbqPaginatedTabHeaderItem>;
|
|
43
|
-
abstract tabListContainer: ElementRef<HTMLElement>;
|
|
44
|
-
abstract tabList: ElementRef<HTMLElement>;
|
|
45
|
-
abstract nextPaginator: ElementRef<HTMLElement>;
|
|
46
|
-
abstract previousPaginator: ElementRef<HTMLElement>;
|
|
33
|
+
abstract readonly items: QueryList<KbqPaginatedTabHeaderItem>;
|
|
34
|
+
abstract readonly tabListContainer: ElementRef<HTMLElement>;
|
|
35
|
+
abstract readonly tabList: ElementRef<HTMLElement>;
|
|
36
|
+
abstract readonly nextPaginator: ElementRef<HTMLElement>;
|
|
37
|
+
abstract readonly previousPaginator: ElementRef<HTMLElement>;
|
|
47
38
|
/** Event emitted when the option is selected. */
|
|
48
39
|
readonly selectFocusedIndex: EventEmitter<number>;
|
|
49
40
|
/** Event emitted when a label is focused. */
|
|
@@ -59,8 +50,10 @@ export declare abstract class KbqPaginatedTabHeader implements AfterContentCheck
|
|
|
59
50
|
* layout recalculations if it's known that pagination won't be required.
|
|
60
51
|
*/
|
|
61
52
|
disablePagination: boolean;
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
/** Whether the tabs should be displayed vertically. */
|
|
54
|
+
set vertical(value: boolean);
|
|
55
|
+
get vertical(): boolean;
|
|
56
|
+
private _vertical;
|
|
64
57
|
/**
|
|
65
58
|
* The number of tab labels that are displayed on the header. When this changes, the header
|
|
66
59
|
* should re-evaluate the scroll position.
|
|
@@ -76,7 +69,14 @@ export declare abstract class KbqPaginatedTabHeader implements AfterContentCheck
|
|
|
76
69
|
private stopScrolling;
|
|
77
70
|
/** Whether the header should scroll to the selected index after the view has been checked. */
|
|
78
71
|
private selectedIndexChanged;
|
|
79
|
-
|
|
72
|
+
protected readonly destroyRef: DestroyRef;
|
|
73
|
+
readonly elementRef: ElementRef<any>;
|
|
74
|
+
protected readonly changeDetectorRef: ChangeDetectorRef;
|
|
75
|
+
private readonly viewportRuler;
|
|
76
|
+
private readonly ngZone;
|
|
77
|
+
private readonly platform;
|
|
78
|
+
private readonly dir;
|
|
79
|
+
constructor();
|
|
80
80
|
/** Called when the user has selected an item via the keyboard. */
|
|
81
81
|
ngAfterViewInit(): void;
|
|
82
82
|
ngAfterContentInit(): void;
|
|
@@ -173,6 +173,8 @@ export declare abstract class KbqPaginatedTabHeader implements AfterContentCheck
|
|
|
173
173
|
*/
|
|
174
174
|
private scrollTo;
|
|
175
175
|
private updateScrollPosition;
|
|
176
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<KbqPaginatedTabHeader,
|
|
177
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqPaginatedTabHeader, never, never, { "disablePagination": { "alias": "disablePagination"; "required": false; }; }, {}, never, never, false, never>;
|
|
176
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KbqPaginatedTabHeader, never>;
|
|
177
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqPaginatedTabHeader, never, never, { "disablePagination": { "alias": "disablePagination"; "required": false; }; "vertical": { "alias": "vertical"; "required": false; }; }, {}, never, never, false, never>;
|
|
178
|
+
static ngAcceptInputType_disablePagination: unknown;
|
|
179
|
+
static ngAcceptInputType_vertical: unknown;
|
|
178
180
|
}
|
package/tabs/public-api.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './tab-body.component';
|
|
2
|
+
export * from './tab-content.directive';
|
|
3
3
|
export * from './tab-group.component';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
4
|
+
export * from './tab-header.component';
|
|
5
|
+
export * from './tab-label-wrapper.directive';
|
|
6
|
+
export * from './tab-label.directive';
|
|
7
|
+
export * from './tab-nav-bar';
|
|
8
|
+
export * from './tab.component';
|
|
9
9
|
export * from './tabs-animations';
|
|
10
10
|
export * from './tabs.module';
|
|
@@ -6,23 +6,19 @@ import { KbqTab } from './tab.component';
|
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class KbqAlignTabsCenterCssStyler {
|
|
8
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<KbqAlignTabsCenterCssStyler, never>;
|
|
9
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqAlignTabsCenterCssStyler, "kbq-tab-group[kbq-align-tabs-center], [kbq-tab-nav-bar][kbq-align-tabs-center]", never, {}, {}, never, never, false, never>;
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqAlignTabsCenterCssStyler, "kbq-tab-group[kbq-align-tabs-center], [kbq-tab-nav-bar][kbq-align-tabs-center], [kbqTabNavBar][kbq-align-tabs-center]", never, {}, {}, never, never, false, never>;
|
|
10
10
|
}
|
|
11
11
|
export declare class KbqAlignTabsEndCssStyler {
|
|
12
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<KbqAlignTabsEndCssStyler, never>;
|
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqAlignTabsEndCssStyler, "kbq-tab-group[kbq-align-tabs-end], [kbq-tab-nav-bar][kbq-align-tabs-end]", never, {}, {}, never, never, false, never>;
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqAlignTabsEndCssStyler, "kbq-tab-group[kbq-align-tabs-end], [kbq-tab-nav-bar][kbq-align-tabs-end], [kbqTabNavBar][kbq-align-tabs-end]", never, {}, {}, never, never, false, never>;
|
|
14
14
|
}
|
|
15
15
|
export declare class KbqStretchTabsCssStyler {
|
|
16
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<KbqStretchTabsCssStyler, never>;
|
|
17
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqStretchTabsCssStyler, "kbq-tab-group[kbq-stretch-tabs], [kbq-tab-nav-bar][kbq-stretch-tabs]", never, {}, {}, never, never, false, never>;
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqStretchTabsCssStyler, "kbq-tab-group[kbq-stretch-tabs], [kbq-tab-nav-bar][kbq-stretch-tabs], [kbqTabNavBar][kbq-stretch-tabs]", never, {}, {}, never, never, false, never>;
|
|
18
18
|
}
|
|
19
19
|
export declare class KbqVerticalTabsCssStyler {
|
|
20
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<KbqVerticalTabsCssStyler, never>;
|
|
21
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqVerticalTabsCssStyler, "kbq-tab-group[vertical], [kbq-tab-nav-bar][vertical]", never, {}, {}, never, never, false, never>;
|
|
22
|
-
}
|
|
23
|
-
export declare class KbqUnderlinedTabsCssStyler {
|
|
24
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<KbqUnderlinedTabsCssStyler, never>;
|
|
25
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqUnderlinedTabsCssStyler, "kbq-tab-group[underlined], [kbq-tab-nav-bar][underlined]", never, {}, {}, never, never, false, never>;
|
|
21
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqVerticalTabsCssStyler, "kbq-tab-group[vertical], [kbq-tab-nav-bar][vertical], [kbqTabNavBar][vertical]", never, {}, {}, never, never, false, never>;
|
|
26
22
|
}
|
|
27
23
|
/** A simple change event emitted on focus or selection changes. */
|
|
28
24
|
export declare class KbqTabChangeEvent {
|
|
@@ -34,38 +30,33 @@ export declare class KbqTabChangeEvent {
|
|
|
34
30
|
/** Possible positions for the tab header. */
|
|
35
31
|
export type KbqTabHeaderPosition = 'above' | 'below';
|
|
36
32
|
/** Object that can be used to configure the default options for the tabs module. */
|
|
37
|
-
export interface
|
|
33
|
+
export interface KbqTabsConfig {
|
|
38
34
|
/** Duration for the tab animation. Must be a valid CSS value (e.g. 600ms). */
|
|
39
35
|
animationDuration?: string;
|
|
40
36
|
}
|
|
41
37
|
/** Injection token that can be used to provide the default options the tabs module. */
|
|
42
|
-
export declare const KBQ_TABS_CONFIG: InjectionToken<
|
|
43
|
-
|
|
44
|
-
export declare class KbqTabGroupBase {
|
|
38
|
+
export declare const KBQ_TABS_CONFIG: InjectionToken<KbqTabsConfig>;
|
|
39
|
+
declare class KbqTabGroupBase {
|
|
45
40
|
elementRef: ElementRef;
|
|
46
41
|
constructor(elementRef: ElementRef);
|
|
47
42
|
}
|
|
48
|
-
|
|
49
|
-
export declare const KbqTabGroupMixinBase: CanDisableCtor & typeof KbqTabGroupBase;
|
|
43
|
+
declare const KbqTabGroupMixinBase: CanDisableCtor & typeof KbqTabGroupBase;
|
|
50
44
|
export type KbqTabSelectBy = string | number | ((tabs: KbqTab[]) => KbqTab | null);
|
|
51
45
|
/**
|
|
52
|
-
* Tab-group component. Supports basic tab pairs (label + content) and includes
|
|
53
|
-
* keyboard navigation.
|
|
46
|
+
* Tab-group component. Supports basic tab pairs (label + content) and includes keyboard navigation.
|
|
54
47
|
*/
|
|
55
48
|
export declare class KbqTabGroup extends KbqTabGroupMixinBase implements AfterContentInit, AfterViewInit, AfterContentChecked, OnDestroy {
|
|
56
49
|
private readonly changeDetectorRef;
|
|
57
50
|
readonly resizeStream: Subject<Event>;
|
|
58
|
-
vertical: boolean;
|
|
59
|
-
underlined: boolean;
|
|
60
51
|
tabs: QueryList<KbqTab>;
|
|
61
52
|
tabBodyWrapper: ElementRef;
|
|
62
53
|
tabHeader: KbqTabHeader;
|
|
63
54
|
transparent: boolean;
|
|
64
55
|
onSurface: boolean;
|
|
56
|
+
underlined: boolean;
|
|
57
|
+
vertical: boolean;
|
|
65
58
|
/** Whether the tab group should grow to the size of the active tab. */
|
|
66
|
-
|
|
67
|
-
set dynamicHeight(value: boolean);
|
|
68
|
-
private _dynamicHeight;
|
|
59
|
+
dynamicHeight: boolean;
|
|
69
60
|
/** The index of the active tab. */
|
|
70
61
|
get selectedIndex(): number | null;
|
|
71
62
|
set selectedIndex(value: number | null);
|
|
@@ -96,7 +87,7 @@ export declare class KbqTabGroup extends KbqTabGroupMixinBase implements AfterCo
|
|
|
96
87
|
private resizeSubscription;
|
|
97
88
|
private readonly groupId;
|
|
98
89
|
private readonly resizeDebounceInterval;
|
|
99
|
-
constructor(elementRef: ElementRef, changeDetectorRef: ChangeDetectorRef,
|
|
90
|
+
constructor(elementRef: ElementRef, changeDetectorRef: ChangeDetectorRef, defaultConfig?: KbqTabsConfig);
|
|
100
91
|
/**
|
|
101
92
|
* After the content is checked, this component knows what tabs have been defined
|
|
102
93
|
* and what the selected index should be. This is where we can know exactly what position
|
|
@@ -137,6 +128,12 @@ export declare class KbqTabGroup extends KbqTabGroupMixinBase implements AfterCo
|
|
|
137
128
|
/** Clamps the given index to the bounds of 0 and the tabs length. */
|
|
138
129
|
private clampTabIndex;
|
|
139
130
|
private getTabIndexToSelect;
|
|
140
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<KbqTabGroup, [null, null, {
|
|
141
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<KbqTabGroup, "kbq-tab-group", ["kbqTabGroup"], { "disabled": { "alias": "disabled"; "required": false; }; "transparent": { "alias": "transparent"; "required": false; }; "onSurface": { "alias": "onSurface"; "required": false; }; "dynamicHeight": { "alias": "dynamicHeight"; "required": false; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; }; "activeTab": { "alias": "activeTab"; "required": false; }; "headerPosition": { "alias": "headerPosition"; "required": false; }; "animationDuration": { "alias": "animationDuration"; "required": false; }; }, { "selectedIndexChange": "selectedIndexChange"; "activeTabChange": "activeTabChange"; "focusChange": "focusChange"; "animationDone": "animationDone"; "selectedTabChange": "selectedTabChange"; }, ["tabs"], never, false, never>;
|
|
131
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KbqTabGroup, [null, null, { optional: true; }]>;
|
|
132
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KbqTabGroup, "kbq-tab-group", ["kbqTabGroup"], { "disabled": { "alias": "disabled"; "required": false; }; "transparent": { "alias": "transparent"; "required": false; }; "onSurface": { "alias": "onSurface"; "required": false; }; "underlined": { "alias": "underlined"; "required": false; }; "vertical": { "alias": "vertical"; "required": false; }; "dynamicHeight": { "alias": "dynamicHeight"; "required": false; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; }; "activeTab": { "alias": "activeTab"; "required": false; }; "headerPosition": { "alias": "headerPosition"; "required": false; }; "animationDuration": { "alias": "animationDuration"; "required": false; }; }, { "selectedIndexChange": "selectedIndexChange"; "activeTabChange": "activeTabChange"; "focusChange": "focusChange"; "animationDone": "animationDone"; "selectedTabChange": "selectedTabChange"; }, ["tabs"], never, false, never>;
|
|
133
|
+
static ngAcceptInputType_transparent: unknown;
|
|
134
|
+
static ngAcceptInputType_onSurface: unknown;
|
|
135
|
+
static ngAcceptInputType_underlined: unknown;
|
|
136
|
+
static ngAcceptInputType_vertical: unknown;
|
|
137
|
+
static ngAcceptInputType_dynamicHeight: unknown;
|
|
142
138
|
}
|
|
139
|
+
export {};
|
package/tabs/tab-group.scss
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
@use '../core/styles/common/layout';
|
|
2
2
|
|
|
3
|
-
@use '../core/styles/common/tokens' as *;
|
|
4
|
-
|
|
5
3
|
.kbq-tab-group {
|
|
6
4
|
display: flex;
|
|
7
5
|
flex-direction: column;
|
|
@@ -12,43 +10,43 @@
|
|
|
12
10
|
&.kbq-tab-group_inverted-header {
|
|
13
11
|
flex-direction: column-reverse;
|
|
14
12
|
}
|
|
15
|
-
}
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
&.kbq-tab-group_vertical {
|
|
15
|
+
flex-direction: row;
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
.kbq-tab-list__content {
|
|
18
|
+
gap: var(--kbq-tabs-size-tab-stack-vertical-content-gap-vertical) 0;
|
|
19
|
+
}
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
& .kbq-tab-header__container {
|
|
22
|
+
overflow-y: auto;
|
|
23
|
+
}
|
|
26
24
|
}
|
|
27
|
-
}
|
|
28
25
|
|
|
29
|
-
.kbq-tab-body__wrapper {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
26
|
+
.kbq-tab-body__wrapper {
|
|
27
|
+
display: flex;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
34
31
|
|
|
35
|
-
.kbq-tab-body {
|
|
36
|
-
|
|
32
|
+
.kbq-tab-body {
|
|
33
|
+
@include layout.kbq-fill;
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
display: block;
|
|
36
|
+
overflow: hidden;
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
&.kbq-tab-body__active {
|
|
39
|
+
position: relative;
|
|
43
40
|
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
overflow-x: hidden;
|
|
42
|
+
overflow-y: auto;
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
z-index: 1;
|
|
45
|
+
flex-grow: 1;
|
|
46
|
+
}
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
.kbq-tab-group.kbq-tab-group_dynamic-height &.kbq-tab-body__active {
|
|
49
|
+
overflow-y: hidden;
|
|
50
|
+
}
|
|
53
51
|
}
|
|
54
52
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Platform } from '@angular/cdk/platform';
|
|
3
|
-
import { ViewportRuler } from '@angular/cdk/scrolling';
|
|
4
|
-
import { ChangeDetectorRef, ElementRef, NgZone, QueryList } from '@angular/core';
|
|
1
|
+
import { ElementRef, QueryList } from '@angular/core';
|
|
5
2
|
import { KbqPaginatedTabHeader } from './paginated-tab-header';
|
|
6
3
|
import { KbqTabLabelWrapper } from './tab-label-wrapper.directive';
|
|
7
4
|
import * as i0 from "@angular/core";
|
|
@@ -19,20 +16,17 @@ export type ScrollDirection = 'after' | 'before';
|
|
|
19
16
|
* @docs-private
|
|
20
17
|
*/
|
|
21
18
|
export declare class KbqTabHeader extends KbqPaginatedTabHeader {
|
|
22
|
-
|
|
23
|
-
readonly changeDetectorRef: ChangeDetectorRef;
|
|
24
|
-
/** The index of the active tab. */
|
|
25
|
-
vertical: boolean;
|
|
19
|
+
/** Whether the tabs are underlined. */
|
|
26
20
|
underlined: boolean;
|
|
27
|
-
items: QueryList<KbqTabLabelWrapper>;
|
|
28
|
-
tabListContainer: ElementRef;
|
|
29
|
-
tabList: ElementRef;
|
|
30
|
-
nextPaginator: ElementRef<HTMLElement>;
|
|
31
|
-
previousPaginator: ElementRef<HTMLElement>;
|
|
32
|
-
get activeTabOffsetWidth(): string;
|
|
33
|
-
get activeTabOffsetLeft(): string;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
static
|
|
37
|
-
static
|
|
21
|
+
readonly items: QueryList<KbqTabLabelWrapper>;
|
|
22
|
+
readonly tabListContainer: ElementRef;
|
|
23
|
+
readonly tabList: ElementRef;
|
|
24
|
+
readonly nextPaginator: ElementRef<HTMLElement>;
|
|
25
|
+
readonly previousPaginator: ElementRef<HTMLElement>;
|
|
26
|
+
protected get activeTabOffsetWidth(): string | null;
|
|
27
|
+
protected get activeTabOffsetLeft(): string | null;
|
|
28
|
+
protected itemSelected(event: KeyboardEvent): void;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KbqTabHeader, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KbqTabHeader, "kbq-tab-header", never, { "selectedIndex": { "alias": "selectedIndex"; "required": false; }; "underlined": { "alias": "underlined"; "required": false; }; }, { "selectFocusedIndex": "selectFocusedIndex"; "indexFocused": "indexFocused"; }, ["items"], ["*"], false, never>;
|
|
31
|
+
static ngAcceptInputType_underlined: unknown;
|
|
38
32
|
}
|
package/tabs/tab-header.scss
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use '../core/styles/common/vendor-prefixes';
|
|
2
|
-
@use 'tabs-common'
|
|
3
|
-
|
|
2
|
+
@use './tabs-common';
|
|
3
|
+
|
|
4
|
+
@include tabs-common.paginated-tab-header;
|
|
4
5
|
|
|
5
6
|
.kbq-tab-header {
|
|
6
7
|
display: flex;
|
|
@@ -53,44 +54,21 @@
|
|
|
53
54
|
transition: all 0.2s ease-in-out;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
.kbq-tab-
|
|
57
|
-
@include vendor-prefixes.user-select(none);
|
|
58
|
-
|
|
59
|
-
position: relative;
|
|
60
|
-
display: none;
|
|
61
|
-
justify-content: center;
|
|
62
|
-
align-items: center;
|
|
63
|
-
cursor: pointer;
|
|
64
|
-
z-index: 2;
|
|
65
|
-
-webkit-tap-highlight-color: transparent;
|
|
66
|
-
touch-action: none;
|
|
67
|
-
|
|
68
|
-
padding-left: 12px;
|
|
69
|
-
padding-right: 12px;
|
|
70
|
-
|
|
71
|
-
.kbq-tab-header__pagination-controls_enabled & {
|
|
72
|
-
display: flex;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.kbq-tab-header__content {
|
|
57
|
+
.kbq-tab-header__container {
|
|
77
58
|
display: flex;
|
|
78
59
|
flex-grow: 1;
|
|
79
|
-
|
|
80
60
|
z-index: 1;
|
|
81
61
|
overflow: hidden;
|
|
82
62
|
}
|
|
83
63
|
|
|
84
64
|
.kbq-tab-list {
|
|
85
65
|
position: relative;
|
|
86
|
-
|
|
87
66
|
width: 100%;
|
|
88
|
-
|
|
89
67
|
transition: transform 500ms cubic-bezier(0.35, 0, 0.25, 1);
|
|
90
68
|
}
|
|
91
69
|
|
|
92
70
|
.kbq-tab-label {
|
|
93
|
-
@include tab-label;
|
|
71
|
+
@include tabs-common.tab-label;
|
|
94
72
|
@include vendor-prefixes.user-select(none);
|
|
95
73
|
|
|
96
74
|
.kbq-tab-group_stretch-labels & {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use './tabs-common';
|
|
2
|
+
|
|
3
|
+
.kbq-tab-link {
|
|
4
|
+
vertical-align: top;
|
|
5
|
+
text-decoration: none;
|
|
6
|
+
-webkit-tap-highlight-color: transparent;
|
|
7
|
+
|
|
8
|
+
@include tabs-common.tab-label;
|
|
9
|
+
|
|
10
|
+
& .kbq-tab-group_stretch-labels & {
|
|
11
|
+
flex-basis: 0;
|
|
12
|
+
flex-grow: 1;
|
|
13
|
+
}
|
|
14
|
+
}
|