@skyux/theme 12.0.0-alpha.12 → 12.0.0-alpha.14
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/css/themes/modern/styles.css +41 -41
- package/fesm2022/skyux-theme.mjs +113 -63
- package/fesm2022/skyux-theme.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/theming/theme-brand.d.ts +18 -0
- package/lib/theming/theme-settings.d.ts +3 -1
- package/package.json +13 -16
- package/scss/_compat/_variables.scss +2 -2
- package/documentation.json +0 -4643
|
@@ -621,7 +621,7 @@
|
|
|
621
621
|
overflow: hidden;
|
|
622
622
|
}
|
|
623
623
|
|
|
624
|
-
.sky-theme-modern:not(.sky-theme-brand-
|
|
624
|
+
.sky-theme-modern:not(.sky-theme-brand-base) .sky-btn {
|
|
625
625
|
--sky-override-borderless-icon-size: 26px;
|
|
626
626
|
--sky-override-button-icon-borderless-padding: 1px;
|
|
627
627
|
--sky-override-button-icon-padding: 9px 15px;
|
|
@@ -635,40 +635,40 @@
|
|
|
635
635
|
--sky-override-button-link-inline-font-size: var(--sky-font-size-body-m);
|
|
636
636
|
--sky-override-button-link-inline-vertical-align: top;
|
|
637
637
|
--sky-override-button-padding: 9px 21px;
|
|
638
|
-
--sky-override-button-primary-disabled-box-shadow:
|
|
639
|
-
|
|
638
|
+
--sky-override-button-primary-disabled-box-shadow:
|
|
639
|
+
inset 0 0 0 var(--sky-border-width-action-focus)
|
|
640
640
|
var(--sky-color-border-action-primary-focus),
|
|
641
641
|
var(--sky-elevation-focus);
|
|
642
|
-
--sky-override-button-icon-disabled-box-shadow:
|
|
643
|
-
|
|
642
|
+
--sky-override-button-icon-disabled-box-shadow:
|
|
643
|
+
inset 0 0 0 var(--sky-border-width-action-focus)
|
|
644
644
|
var(--sky-color-border-action-secondary-focus),
|
|
645
645
|
var(--sky-elevation-focus);
|
|
646
|
-
--sky-override-button-danger-disabled-box-shadow:
|
|
647
|
-
|
|
646
|
+
--sky-override-button-danger-disabled-box-shadow:
|
|
647
|
+
inset 0 0 0 var(--sky-border-width-action-focus)
|
|
648
648
|
var(--sky-color-border-action-danger-focus),
|
|
649
649
|
var(--sky-elevation-focus);
|
|
650
|
-
--sky-override-button-tertiary-disabled-box-shadow:
|
|
651
|
-
|
|
650
|
+
--sky-override-button-tertiary-disabled-box-shadow:
|
|
651
|
+
inset 0 0 0 var(--sky-border-width-action-focus)
|
|
652
652
|
var(--sky-color-border-action-tertiary-focus),
|
|
653
653
|
var(--sky-elevation-focus,);
|
|
654
|
-
--sky-override-button-link-inline-disabled-box-shadow:
|
|
655
|
-
|
|
654
|
+
--sky-override-button-link-inline-disabled-box-shadow:
|
|
655
|
+
0 0 0 var(--sky-border-width-action-focus)
|
|
656
656
|
var(--sky-color-border-action-tertiary-focus),
|
|
657
657
|
var(--sky-elevation-focus);
|
|
658
|
-
--sky-override-button-borderless-inline-disabled-box-shadow:
|
|
659
|
-
|
|
658
|
+
--sky-override-button-borderless-inline-disabled-box-shadow:
|
|
659
|
+
0 0 0 var(--sky-border-width-action-focus)
|
|
660
660
|
var(--sky-color-border-action-tertiary-focus),
|
|
661
661
|
var(--sky-elevation-focus);
|
|
662
662
|
}
|
|
663
|
-
.sky-theme-modern:not(.sky-theme-brand-
|
|
663
|
+
.sky-theme-modern:not(.sky-theme-brand-base) .sky-btn:not(.sky-btn-link-inline):not(.sky-btn-borderless-inline) {
|
|
664
664
|
--sky-override-button-line-height: calc(20 / 14);
|
|
665
665
|
}
|
|
666
|
-
.sky-theme-modern:not(.sky-theme-brand-
|
|
666
|
+
.sky-theme-modern:not(.sky-theme-brand-base) .sky-btn.sky-btn-link-inline, .sky-theme-modern:not(.sky-theme-brand-base) .sky-btn.sky-btn-borderless-inline {
|
|
667
667
|
--sky-override-button-line-height: normal;
|
|
668
668
|
--sky-override-button-opacity-disabled: 0.65;
|
|
669
669
|
}
|
|
670
670
|
|
|
671
|
-
.sky-theme-modern:not(.sky-theme-brand-
|
|
671
|
+
.sky-theme-modern:not(.sky-theme-brand-base) .sky-btn-tab {
|
|
672
672
|
--sky-override-tab-selected-background-color: var(--modern-color-transparent);
|
|
673
673
|
--sky-override-tab-selected-border-bottom-size: var(--modern-size-3);
|
|
674
674
|
--sky-override-tab-hover-border-bottom-color: var(--modern-color-blue-50);
|
|
@@ -1290,11 +1290,11 @@
|
|
|
1290
1290
|
box-shadow: var(--sky-elevation-overlay-400);
|
|
1291
1291
|
}
|
|
1292
1292
|
|
|
1293
|
-
.sky-theme-modern:not(.sky-theme-brand-
|
|
1293
|
+
.sky-theme-modern:not(.sky-theme-brand-base) select {
|
|
1294
1294
|
--sky-override-select-icon-size: var(--modern-size-15) var(--modern-size-30);
|
|
1295
1295
|
}
|
|
1296
1296
|
|
|
1297
|
-
.sky-theme-modern:not(.sky-theme-brand-
|
|
1297
|
+
.sky-theme-modern:not(.sky-theme-brand-base) .sky-error-label {
|
|
1298
1298
|
--sky-override-error-label-margin-top: var(--modern-size-5);
|
|
1299
1299
|
}
|
|
1300
1300
|
|
|
@@ -1318,7 +1318,7 @@
|
|
|
1318
1318
|
background-size: var(--sky-override-select-icon-size, var(--sky-size-icon-s) var(--sky-size-icon-xl));
|
|
1319
1319
|
}
|
|
1320
1320
|
|
|
1321
|
-
.sky-theme-modern:not(.sky-theme-brand-
|
|
1321
|
+
.sky-theme-modern:not(.sky-theme-brand-base) {
|
|
1322
1322
|
--sky-override-icon-color-group: var(--sky-color-icon-action);
|
|
1323
1323
|
--sky-override-icon-switch-border-width-disabled: 0;
|
|
1324
1324
|
--sky-override-icon-switch-font-size: 18px;
|
|
@@ -1511,7 +1511,7 @@
|
|
|
1511
1511
|
border-radius: var(--sky-border-radius-s);
|
|
1512
1512
|
}
|
|
1513
1513
|
|
|
1514
|
-
.sky-theme-modern:not(.sky-theme-brand-
|
|
1514
|
+
.sky-theme-modern:not(.sky-theme-brand-base) {
|
|
1515
1515
|
--sky-override-a-border-radius: 0;
|
|
1516
1516
|
--sky-override-a-color-hover-active: var(
|
|
1517
1517
|
--sky-text-color-action-primary-hover
|
|
@@ -1520,7 +1520,7 @@
|
|
|
1520
1520
|
--sky-override-p-line-height: var(--sky-font-line_height-body-m);
|
|
1521
1521
|
}
|
|
1522
1522
|
|
|
1523
|
-
html:has(.sky-theme-brand-
|
|
1523
|
+
html:has(.sky-theme-brand-base) {
|
|
1524
1524
|
font-size: initial;
|
|
1525
1525
|
line-height: 1.4285714286;
|
|
1526
1526
|
}
|
|
@@ -1597,24 +1597,24 @@ html:has(.sky-theme-brand-blackbaud) {
|
|
|
1597
1597
|
border-radius: var(--sky-border-radius-s);
|
|
1598
1598
|
}
|
|
1599
1599
|
|
|
1600
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1601
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1600
|
+
.sky-theme-modern.sky-theme-brand-base h1,
|
|
1601
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-heading-1 {
|
|
1602
1602
|
line-height: var(--sky-font-line_height-heading-1);
|
|
1603
1603
|
}
|
|
1604
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1605
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1604
|
+
.sky-theme-modern.sky-theme-brand-base h2,
|
|
1605
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-heading-2 {
|
|
1606
1606
|
line-height: var(--sky-font-line_height-heading-2);
|
|
1607
1607
|
}
|
|
1608
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1609
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1608
|
+
.sky-theme-modern.sky-theme-brand-base h3,
|
|
1609
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-heading-3 {
|
|
1610
1610
|
line-height: var(--sky-font-line_height-heading-3);
|
|
1611
1611
|
}
|
|
1612
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1613
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1612
|
+
.sky-theme-modern.sky-theme-brand-base h4,
|
|
1613
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-heading-4 {
|
|
1614
1614
|
line-height: var(--sky-font-line_height-heading-4);
|
|
1615
1615
|
}
|
|
1616
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1617
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1616
|
+
.sky-theme-modern.sky-theme-brand-base h5,
|
|
1617
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-heading-5 {
|
|
1618
1618
|
line-height: var(--sky-font-line_height-heading-5);
|
|
1619
1619
|
}
|
|
1620
1620
|
|
|
@@ -1703,32 +1703,32 @@ html:has(.sky-theme-brand-blackbaud) {
|
|
|
1703
1703
|
font-weight: var(--sky-font-weight-display-4);
|
|
1704
1704
|
}
|
|
1705
1705
|
|
|
1706
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1706
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-body-default {
|
|
1707
1707
|
line-height: var(--sky-font-line_height-body-m);
|
|
1708
1708
|
}
|
|
1709
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1709
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-body-sm {
|
|
1710
1710
|
line-height: var(--sky-font-line_height-body-s);
|
|
1711
1711
|
}
|
|
1712
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1712
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-body-lg {
|
|
1713
1713
|
line-height: var(--sky-font-line_height-body-l);
|
|
1714
1714
|
}
|
|
1715
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1715
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-data-label {
|
|
1716
1716
|
line-height: var(--sky-font-line_height-data_label);
|
|
1717
1717
|
}
|
|
1718
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1718
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-field-label {
|
|
1719
1719
|
line-height: var(--sky-font-line_height-data_label);
|
|
1720
1720
|
}
|
|
1721
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1721
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-display-1 {
|
|
1722
1722
|
line-height: var(--sky-font-line_height-display-1);
|
|
1723
1723
|
}
|
|
1724
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1724
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-display-2 {
|
|
1725
1725
|
line-height: var(--sky-font-line_height-display-2);
|
|
1726
1726
|
}
|
|
1727
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1728
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1727
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-display-3,
|
|
1728
|
+
.sky-theme-modern.sky-theme-brand-base .sky-headline {
|
|
1729
1729
|
line-height: var(--sky-font-line_height-display-3);
|
|
1730
1730
|
}
|
|
1731
|
-
.sky-theme-modern.sky-theme-brand-
|
|
1731
|
+
.sky-theme-modern.sky-theme-brand-base .sky-font-display-4 {
|
|
1732
1732
|
line-height: var(--sky-font-line_height-display-4);
|
|
1733
1733
|
}
|
|
1734
1734
|
|
package/fesm2022/skyux-theme.mjs
CHANGED
|
@@ -28,6 +28,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
28
28
|
}]
|
|
29
29
|
}] });
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Defines properties of a SKY UX theme mode.
|
|
33
|
+
*/
|
|
34
|
+
class SkyThemeMode {
|
|
35
|
+
/**
|
|
36
|
+
* The preset themes available in SKY UX.
|
|
37
|
+
*/
|
|
38
|
+
static { this.presets = {
|
|
39
|
+
light: new SkyThemeMode('light', 'sky-theme-mode-light'),
|
|
40
|
+
dark: new SkyThemeMode('dark', 'sky-theme-mode-dark'),
|
|
41
|
+
}; }
|
|
42
|
+
/**
|
|
43
|
+
* Creates a new theme mode.
|
|
44
|
+
* @param name The name of the theme mode.
|
|
45
|
+
* @param hostClass The class on the host element which child components should reference when
|
|
46
|
+
* adjusting for a specified theme mode.
|
|
47
|
+
*/
|
|
48
|
+
constructor(name, hostClass) {
|
|
49
|
+
this.name = name;
|
|
50
|
+
this.hostClass = hostClass;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Defines properties of SKY UX theme spacing.
|
|
56
|
+
*/
|
|
57
|
+
class SkyThemeSpacing {
|
|
58
|
+
/**
|
|
59
|
+
* The preset spacing available in SKY UX.
|
|
60
|
+
*/
|
|
61
|
+
static { this.presets = {
|
|
62
|
+
standard: new SkyThemeSpacing('standard', 'sky-theme-spacing-standard'),
|
|
63
|
+
compact: new SkyThemeSpacing('compact', 'sky-theme-spacing-compact'),
|
|
64
|
+
}; }
|
|
65
|
+
/**
|
|
66
|
+
* Creates a new theme spacing.
|
|
67
|
+
* @param name The name of the theme spacing.
|
|
68
|
+
* @param hostClass The class on the host element which child components should reference when
|
|
69
|
+
* adjusting for a specified theme spacing.
|
|
70
|
+
*/
|
|
71
|
+
constructor(name, hostClass) {
|
|
72
|
+
this.name = name;
|
|
73
|
+
this.hostClass = hostClass;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
31
77
|
/**
|
|
32
78
|
* Provides methods for updating and handling changes to the current theme.
|
|
33
79
|
*/
|
|
@@ -76,6 +122,7 @@ class SkyThemeService {
|
|
|
76
122
|
this.#applyThemeClass(previous, settings, 'theme');
|
|
77
123
|
this.#applyThemeClass(previous, settings, 'mode', 'supportedModes');
|
|
78
124
|
this.#applyThemeClass(previous, settings, 'spacing', 'supportedSpacing');
|
|
125
|
+
this.#applyThemeClass(previous, settings, 'brand');
|
|
79
126
|
this.#settings.next({
|
|
80
127
|
currentSettings: settings,
|
|
81
128
|
previousSettings: previous,
|
|
@@ -84,18 +131,28 @@ class SkyThemeService {
|
|
|
84
131
|
}
|
|
85
132
|
#applyThemeClass(previous, current, prop, supportedProp) {
|
|
86
133
|
const currentSetting = current[prop];
|
|
87
|
-
const previousClass = previous?.[prop]
|
|
88
|
-
const currentClass = currentSetting
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
134
|
+
const previousClass = previous?.[prop]?.hostClass;
|
|
135
|
+
const currentClass = currentSetting?.hostClass;
|
|
136
|
+
if (!previousClass || previousClass !== currentClass) {
|
|
137
|
+
this.#updateHostClass(prop, previousClass, currentClass, currentSetting, current, supportedProp);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
#updateHostClass(prop, previousClass, currentClass, currentSetting, current, supportedProp) {
|
|
141
|
+
if (previousClass) {
|
|
142
|
+
this.#removeHostClass(previousClass);
|
|
143
|
+
}
|
|
144
|
+
if (prop === 'brand') {
|
|
145
|
+
if (currentClass && !previousClass) {
|
|
146
|
+
this.#addHostClass('sky-theme-brand-base');
|
|
93
147
|
}
|
|
94
|
-
if (!
|
|
95
|
-
|
|
96
|
-
this.#addHostClass(currentClass);
|
|
148
|
+
else if (!currentClass && previousClass) {
|
|
149
|
+
this.#removeHostClass('sky-theme-brand-base');
|
|
97
150
|
}
|
|
98
151
|
}
|
|
152
|
+
if (currentClass &&
|
|
153
|
+
this.#isSupportedProperty(currentSetting, current, supportedProp)) {
|
|
154
|
+
this.#addHostClass(currentClass);
|
|
155
|
+
}
|
|
99
156
|
}
|
|
100
157
|
#addHostClass(className) {
|
|
101
158
|
this.#renderer.addClass(this.#hostEl, className);
|
|
@@ -103,6 +160,12 @@ class SkyThemeService {
|
|
|
103
160
|
#removeHostClass(className) {
|
|
104
161
|
this.#renderer.removeClass(this.#hostEl, className);
|
|
105
162
|
}
|
|
163
|
+
#isSupportedProperty(currentSetting, current, supportedProp) {
|
|
164
|
+
return (!supportedProp ||
|
|
165
|
+
((currentSetting instanceof SkyThemeMode ||
|
|
166
|
+
currentSetting instanceof SkyThemeSpacing) &&
|
|
167
|
+
current.theme[supportedProp].includes(currentSetting)));
|
|
168
|
+
}
|
|
106
169
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: SkyThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
107
170
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: SkyThemeService }); }
|
|
108
171
|
}
|
|
@@ -347,52 +410,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
347
410
|
type: Input
|
|
348
411
|
}] } });
|
|
349
412
|
|
|
350
|
-
/**
|
|
351
|
-
* Defines properties of a SKY UX theme mode.
|
|
352
|
-
*/
|
|
353
|
-
class SkyThemeMode {
|
|
354
|
-
/**
|
|
355
|
-
* The preset themes available in SKY UX.
|
|
356
|
-
*/
|
|
357
|
-
static { this.presets = {
|
|
358
|
-
light: new SkyThemeMode('light', 'sky-theme-mode-light'),
|
|
359
|
-
dark: new SkyThemeMode('dark', 'sky-theme-mode-dark'),
|
|
360
|
-
}; }
|
|
361
|
-
/**
|
|
362
|
-
* Creates a new theme mode.
|
|
363
|
-
* @param name The name of the theme mode.
|
|
364
|
-
* @param hostClass The class on the host element which child components should reference when
|
|
365
|
-
* adjusting for a specified theme mode.
|
|
366
|
-
*/
|
|
367
|
-
constructor(name, hostClass) {
|
|
368
|
-
this.name = name;
|
|
369
|
-
this.hostClass = hostClass;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* Defines properties of SKY UX theme spacing.
|
|
375
|
-
*/
|
|
376
|
-
class SkyThemeSpacing {
|
|
377
|
-
/**
|
|
378
|
-
* The preset spacing available in SKY UX.
|
|
379
|
-
*/
|
|
380
|
-
static { this.presets = {
|
|
381
|
-
standard: new SkyThemeSpacing('standard', 'sky-theme-spacing-standard'),
|
|
382
|
-
compact: new SkyThemeSpacing('compact', 'sky-theme-spacing-compact'),
|
|
383
|
-
}; }
|
|
384
|
-
/**
|
|
385
|
-
* Creates a new theme spacing.
|
|
386
|
-
* @param name The name of the theme spacing.
|
|
387
|
-
* @param hostClass The class on the host element which child components should reference when
|
|
388
|
-
* adjusting for a specified theme spacing.
|
|
389
|
-
*/
|
|
390
|
-
constructor(name, hostClass) {
|
|
391
|
-
this.name = name;
|
|
392
|
-
this.hostClass = hostClass;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
413
|
/**
|
|
397
414
|
* Defines properties of a SKY UX theme.
|
|
398
415
|
*/
|
|
@@ -429,10 +446,11 @@ class SkyThemeSettings {
|
|
|
429
446
|
* @param theme The theme configuration.
|
|
430
447
|
* @param mode The theme mode.
|
|
431
448
|
*/
|
|
432
|
-
constructor(theme, mode, spacing = SkyThemeSpacing.presets.standard) {
|
|
449
|
+
constructor(theme, mode, spacing = SkyThemeSpacing.presets.standard, brand) {
|
|
433
450
|
this.theme = theme;
|
|
434
451
|
this.mode = mode;
|
|
435
452
|
this.spacing = spacing;
|
|
453
|
+
this.brand = brand;
|
|
436
454
|
}
|
|
437
455
|
}
|
|
438
456
|
|
|
@@ -499,6 +517,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
499
517
|
}]
|
|
500
518
|
}] });
|
|
501
519
|
|
|
520
|
+
/**
|
|
521
|
+
* @internal
|
|
522
|
+
* Defines properties of SKY UX theme branding.
|
|
523
|
+
*/
|
|
524
|
+
class SkyThemeBrand {
|
|
525
|
+
get hostClass() {
|
|
526
|
+
return this.#hostClass || `sky-theme-brand-${this.name}`;
|
|
527
|
+
}
|
|
528
|
+
set hostClass(value) {
|
|
529
|
+
this.#hostClass = value;
|
|
530
|
+
}
|
|
531
|
+
#hostClass;
|
|
532
|
+
/**
|
|
533
|
+
* Creates a new theme brand.
|
|
534
|
+
* @param name The name of the theme brand.
|
|
535
|
+
* @param hostClass The class on the host element which child components should reference when
|
|
536
|
+
* adjusting for a specified theme brand. This defaults to `sky-theme-brand-<name>
|
|
537
|
+
*/
|
|
538
|
+
constructor(name, version, hostClass) {
|
|
539
|
+
this.name = name;
|
|
540
|
+
this.version = version;
|
|
541
|
+
this.hostClass = hostClass;
|
|
542
|
+
if (!/\d+\.\d+\.\d+(?:-(?:alpha|beta|rc)\.\d)*$/.test(version)) {
|
|
543
|
+
throw new Error(`Invalid version format "${version}" for theme brand "${name}".`);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
502
548
|
class SkyThemeComponentClassDirective {
|
|
503
549
|
#changeDetector;
|
|
504
550
|
#themeService;
|
|
@@ -571,6 +617,10 @@ class SkyAppViewportService {
|
|
|
571
617
|
};
|
|
572
618
|
this.#document.addEventListener('scroll', onScroll);
|
|
573
619
|
inject(DestroyRef).onDestroy(() => {
|
|
620
|
+
/* istanbul ignore next */
|
|
621
|
+
if (this.#updateRequest !== undefined) {
|
|
622
|
+
cancelAnimationFrame(this.#updateRequest);
|
|
623
|
+
}
|
|
574
624
|
this.#intersectionObserver.disconnect();
|
|
575
625
|
this.#document.removeEventListener('scroll', onScroll);
|
|
576
626
|
});
|
|
@@ -611,7 +661,7 @@ class SkyAppViewportService {
|
|
|
611
661
|
top: 0,
|
|
612
662
|
};
|
|
613
663
|
for (const args of this.#reserveItems.values()) {
|
|
614
|
-
args.active = this.#isElementVisible(args);
|
|
664
|
+
args.active = this.#isElementVisible(args, reservedSpaces);
|
|
615
665
|
if (args.active) {
|
|
616
666
|
reservedSpaces[args.position] += args.size;
|
|
617
667
|
}
|
|
@@ -629,7 +679,8 @@ class SkyAppViewportService {
|
|
|
629
679
|
this.#intersectionObserver.observe(item.reserveForElement);
|
|
630
680
|
}
|
|
631
681
|
}
|
|
632
|
-
#isElementVisible(args
|
|
682
|
+
#isElementVisible(args, reservedSpaces = this
|
|
683
|
+
.#reservedSpaces) {
|
|
633
684
|
if (!args.reserveForElement) {
|
|
634
685
|
return true;
|
|
635
686
|
}
|
|
@@ -652,10 +703,9 @@ class SkyAppViewportService {
|
|
|
652
703
|
if (args.reserveForElement.contains(this.#document.elementFromPoint(midpoint.x, midpoint.y))) {
|
|
653
704
|
return true;
|
|
654
705
|
}
|
|
655
|
-
// Check if the item's midpoint is visible
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
: this.#reservedSpaces[args.position];
|
|
706
|
+
// Check if the item's midpoint is visible based on current reserved spaces.
|
|
707
|
+
// Assumes reserved spaces are intended to be additive and not overlapping.
|
|
708
|
+
const threshold = reservedSpaces[args.position];
|
|
659
709
|
switch (args.position) {
|
|
660
710
|
case 'top':
|
|
661
711
|
return midpoint.y >= threshold;
|
|
@@ -697,5 +747,5 @@ function provideInitialTheme(name = 'default', options) {
|
|
|
697
747
|
* Generated bundle index. Do not edit.
|
|
698
748
|
*/
|
|
699
749
|
|
|
700
|
-
export { SkyAppStyleLoader, SkyAppViewportService, SkyTheme, SkyThemeComponentClassDirective, SkyThemeIconManifestService, SkyThemeMode, SkyThemeModule, SkyThemeService, SkyThemeSettings, SkyThemeSpacing, provideInitialTheme, SkyThemeDirective as λ1, SkyThemeClassDirective as λ2, SkyThemeIfDirective as λ3 };
|
|
750
|
+
export { SkyAppStyleLoader, SkyAppViewportService, SkyTheme, SkyThemeBrand, SkyThemeComponentClassDirective, SkyThemeIconManifestService, SkyThemeMode, SkyThemeModule, SkyThemeService, SkyThemeSettings, SkyThemeSpacing, provideInitialTheme, SkyThemeDirective as λ1, SkyThemeClassDirective as λ2, SkyThemeIfDirective as λ3 };
|
|
701
751
|
//# sourceMappingURL=skyux-theme.mjs.map
|