@inboxsdk/core 0.2.29-aplha.3 → 1.0.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/inboxsdk.js +35 -35
- package/inboxsdk.js.map +1 -1
- package/package.json +2 -1
- package/src/inboxsdk.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-app-menu-item.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-app-menu-item.js +3 -4
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-collapsible-panel.d.ts +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-collapsible-panel.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-collapsible-panel.js +13 -2
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/gmail-load-event.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/gmail-load-event.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/gmail-load-event.js +42 -43
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/isIntegratedViewGmail.d.ts +5 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/isIntegratedViewGmail.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/isIntegratedViewGmail.js +10 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-gmail-styles.d.ts +6 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-gmail-styles.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-gmail-styles.js +33 -21
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.js +8 -2
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-menu-item-view.d.ts +5 -12
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-menu-item-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-menu-item-view.js +29 -18
- package/src/platform-implementation-js/namespaces/app-menu.d.ts +14 -5
- package/src/platform-implementation-js/namespaces/app-menu.d.ts.map +1 -1
- package/src/platform-implementation-js/views/app-menu-item-view.d.ts.map +1 -1
- package/src/platform-implementation-js/views/app-menu-item-view.js +53 -6
- package/src/platform-implementation-js/views/collapsible-panel-view.d.ts.map +1 -1
- package/src/platform-implementation-js/views/collapsible-panel-view.js +70 -23
|
@@ -2,7 +2,7 @@ import Kefir from 'kefir';
|
|
|
2
2
|
import kefirBus from 'kefir-bus';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import EventEmitter from '../lib/safe-event-emitter';
|
|
5
|
-
import { GmailAppMenuItemView, NATIVE_CLASS, INBOXSDK_CLASS, } from '../dom-driver/gmail/views/gmail-app-menu-item-view';
|
|
5
|
+
import { GmailAppMenuItemView, NATIVE_CLASS, INBOXSDK_CLASS, ICON_ELEMENT_SELECTOR, } from '../dom-driver/gmail/views/gmail-app-menu-item-view';
|
|
6
6
|
import { NATIVE_CLASS as PANEL_NATIVE_CLASS, CollapsiblePanelView, } from './collapsible-panel-view';
|
|
7
7
|
import { addCollapsiblePanel } from '../dom-driver/gmail/gmail-driver/add-collapsible-panel';
|
|
8
8
|
import GmailElementGetter from '../dom-driver/gmail/gmail-element-getter';
|
|
@@ -60,6 +60,42 @@ export class AppMenuItemView extends EventEmitter {
|
|
|
60
60
|
const activePanel = AppMenuItemView.#getActivePanel();
|
|
61
61
|
return !activePanel;
|
|
62
62
|
}
|
|
63
|
+
static #adjustTooltipNub() {
|
|
64
|
+
// adjust all menu items' collapsible panel's tooltip nub position
|
|
65
|
+
const appMenuElement = GmailElementGetter.getAppMenu();
|
|
66
|
+
for (const menuItem of appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}`) ?? []) {
|
|
67
|
+
const panel = AppMenuItemView.#menuItemToPanelMap.get(menuItem);
|
|
68
|
+
if (!panel)
|
|
69
|
+
continue;
|
|
70
|
+
const nubElement = panel?.querySelector('* > .aTV');
|
|
71
|
+
const iconElement = menuItem?.querySelector('.V6');
|
|
72
|
+
const iconElementBox = iconElement?.getBoundingClientRect();
|
|
73
|
+
const offsetTop = (iconElement?.offsetTop ?? 0) + (iconElementBox?.height ?? 0) * 0.5;
|
|
74
|
+
const nubSide = 17;
|
|
75
|
+
const nubDiagonal = nubSide * Math.sqrt(2);
|
|
76
|
+
const offsetNub = nubDiagonal / 4;
|
|
77
|
+
const offset = offsetTop - offsetNub;
|
|
78
|
+
if (nubElement && offset) {
|
|
79
|
+
nubElement.style.top = `${offset}px`;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
static #isPanelDropdownShown() {
|
|
84
|
+
const sdkDropdown = document.querySelector('.inboxsdk__menu');
|
|
85
|
+
if (sdkDropdown) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
const mailDropdown = document.querySelector('.JM');
|
|
89
|
+
if (mailDropdown && mailDropdown.style.display !== 'none') {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
const chatAndSpacesDropdown = document.querySelector('.tP');
|
|
93
|
+
if (chatAndSpacesDropdown &&
|
|
94
|
+
chatAndSpacesDropdown.style.display !== 'none') {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
63
99
|
static #setUpRouteViewDriverStream(driver) {
|
|
64
100
|
if (AppMenuItemView.#routeViewDriverStream)
|
|
65
101
|
return;
|
|
@@ -154,6 +190,7 @@ export class AppMenuItemView extends EventEmitter {
|
|
|
154
190
|
// Handle moving cursor out of panel. We use it to enhance the styling since it won't be handled by Gmail
|
|
155
191
|
const panel = AppMenuItemView.#menuItemToPanelMap.get(nativeMenuItem);
|
|
156
192
|
panel?.addEventListener('mouseleave', (e) => {
|
|
193
|
+
e.stopImmediatePropagation();
|
|
157
194
|
AppMenuItemView.#menuItemChangeBus.emit([
|
|
158
195
|
'mouseleave',
|
|
159
196
|
nativeMenuItem,
|
|
@@ -176,10 +213,15 @@ export class AppMenuItemView extends EventEmitter {
|
|
|
176
213
|
activePanel.classList.remove(CollapsiblePanelView.elementCss.ACTIVE);
|
|
177
214
|
activePanel.classList.remove(CollapsiblePanelView.elementCss.HOVER);
|
|
178
215
|
}
|
|
179
|
-
// deactivate menu items
|
|
216
|
+
// deactivate menu items and handle keyboard accessibility
|
|
180
217
|
for (const menuItem_ of appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}`) ?? []) {
|
|
181
218
|
menuItem_.classList.remove(ACTIVE);
|
|
182
219
|
menuItem_.classList.remove(HOVER);
|
|
220
|
+
// update tabindex
|
|
221
|
+
const iconElement = menuItem_.querySelector(ICON_ELEMENT_SELECTOR);
|
|
222
|
+
if (iconElement) {
|
|
223
|
+
iconElement.tabIndex = menuItem_ === menuItem ? 0 : -1;
|
|
224
|
+
}
|
|
183
225
|
}
|
|
184
226
|
// activate menu item
|
|
185
227
|
menuItem.classList.add(ACTIVE);
|
|
@@ -230,6 +272,10 @@ export class AppMenuItemView extends EventEmitter {
|
|
|
230
272
|
break;
|
|
231
273
|
}
|
|
232
274
|
case 'mouseleave': {
|
|
275
|
+
// Do not handle blur event when we're in one of the panel's dropdowns
|
|
276
|
+
const isPanelDropdownShown = AppMenuItemView.#isPanelDropdownShown();
|
|
277
|
+
if (isPanelDropdownShown)
|
|
278
|
+
return;
|
|
233
279
|
const activeMenuItem = AppMenuItemView.#getActiveMenuItem();
|
|
234
280
|
const activePanel = AppMenuItemView.#getActivePanel();
|
|
235
281
|
const activeMenuItemPanel = activeMenuItem &&
|
|
@@ -298,6 +344,7 @@ export class AppMenuItemView extends EventEmitter {
|
|
|
298
344
|
const gmailElement = gmailView.element;
|
|
299
345
|
if (gmailElement) {
|
|
300
346
|
AppMenuItemView.#menuItemToPanelMap.set(gmailElement, undefined);
|
|
347
|
+
AppMenuItemView.#adjustTooltipNub();
|
|
301
348
|
}
|
|
302
349
|
gmailView.on('destroy', () => {
|
|
303
350
|
this.remove();
|
|
@@ -335,7 +382,7 @@ export class AppMenuItemView extends EventEmitter {
|
|
|
335
382
|
[CollapsiblePanelView.elementCss.PANEL_LESS]: AppMenuItemView.#isPanelLess(),
|
|
336
383
|
}),
|
|
337
384
|
};
|
|
338
|
-
const collapsiblePanel = await addCollapsiblePanel(this.#driver, descriptor);
|
|
385
|
+
const collapsiblePanel = await addCollapsiblePanel(this.#driver, descriptor, this.menuItemDescriptor.insertIndex);
|
|
339
386
|
if (collapsiblePanel) {
|
|
340
387
|
this.#gmailViewPromise.then((gmailView) => {
|
|
341
388
|
const gmailElement = gmailView.element;
|
|
@@ -347,9 +394,8 @@ export class AppMenuItemView extends EventEmitter {
|
|
|
347
394
|
e,
|
|
348
395
|
]);
|
|
349
396
|
});
|
|
350
|
-
}
|
|
351
|
-
if (gmailElement && collapsiblePanel) {
|
|
352
397
|
AppMenuItemView.#menuItemToPanelMap.set(gmailElement, collapsiblePanel.element);
|
|
398
|
+
AppMenuItemView.#adjustTooltipNub();
|
|
353
399
|
}
|
|
354
400
|
});
|
|
355
401
|
}
|
|
@@ -358,7 +404,7 @@ export class AppMenuItemView extends EventEmitter {
|
|
|
358
404
|
}
|
|
359
405
|
async update(menuItemDescriptor) {
|
|
360
406
|
const gmailView = await this.#gmailViewPromise;
|
|
361
|
-
gmailView.
|
|
407
|
+
gmailView.menuItemDescriptor = menuItemDescriptor;
|
|
362
408
|
this.#menuItemDescriptor = menuItemDescriptor;
|
|
363
409
|
}
|
|
364
410
|
remove() {
|
|
@@ -371,6 +417,7 @@ export class AppMenuItemView extends EventEmitter {
|
|
|
371
417
|
gmailView.element &&
|
|
372
418
|
AppMenuItemView.#menuItemToPanelMap.delete(gmailView.element);
|
|
373
419
|
gmailView.remove();
|
|
420
|
+
AppMenuItemView.#adjustTooltipNub();
|
|
374
421
|
});
|
|
375
422
|
AppMenuItemView.#appMenuItemViews.delete(this);
|
|
376
423
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible-panel-view.d.ts","sourceRoot":"","sources":["../../../../../src/platform-implementation-js/views/collapsible-panel-view.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAIpE,OAAO,WAAW,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,WAAW,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"collapsible-panel-view.d.ts","sourceRoot":"","sources":["../../../../../src/platform-implementation-js/views/collapsible-panel-view.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAIpE,OAAO,WAAW,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAI1C,eAAO,MAAM,YAAY,OAAiB,CAAC;AAC3C,eAAO,MAAM,cAAc,8BAAwC,CAAC;AAcpE,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CAC/B,CAAC;mDAEmE,aAAa,aAAa,CAAC;AAAhG,qBAAa,oBAAqB,SAAQ,yBAAuD;;IAC/F,MAAM,CAAC,gBAAgB;;;MAGZ;IACX,MAAM,CAAC,UAAU;;;QAGf,kDAAkD;;;;MAIzC;IASX,IAAI,OAAO,YAEV;IAED,UAAU,CAAC,OAAO,EAAE,OAAO;IAS3B,IAAI,eAAe,+BAElB;IAED,IAAI,eAAe,CAAC,eAAe,4BAAA,EAGlC;IAED,IAAI,OAAO,gBAEV;IAED,IAAI,qBAAqB,mBAExB;gBAGC,MAAM,EAAE,WAAW,EACnB,eAAe,EAAE,0BAA0B;IAmB7C,MAAM;IAON,UAAU,CACR,iBAAiB,EACb,iBAAiB,GACjB,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,GAAG,CAAC;CA+N/C"}
|
|
@@ -6,6 +6,8 @@ import autoHtml from 'auto-html';
|
|
|
6
6
|
import querySelector from '../lib/dom/querySelectorOrFail';
|
|
7
7
|
import GmailElementGetter from '../dom-driver/gmail/gmail-element-getter';
|
|
8
8
|
import NavItemView from './nav-item-view';
|
|
9
|
+
import { stylesStream } from '../dom-driver/gmail/gmail-driver/track-gmail-styles';
|
|
10
|
+
import isEqual from 'fast-deep-equal';
|
|
9
11
|
export const NATIVE_CLASS = 'aqn';
|
|
10
12
|
export const INBOXSDK_CLASS = 'inboxsdk__collapsiblePanel';
|
|
11
13
|
const ELEMENT_CLASS = `${NATIVE_CLASS} ${INBOXSDK_CLASS} oy8Mbf`;
|
|
@@ -14,6 +16,7 @@ const PRIMARY_BUTTON_ELEMENT_SELECTOR = '.T-I.T-I-KE.L3';
|
|
|
14
16
|
const scrollablePanelClass = 'at9';
|
|
15
17
|
const scrollablePanelSelector = `.${scrollablePanelClass}`;
|
|
16
18
|
const loadingElementClass = 'inboxsdk__collapsiblePanel_loading_container';
|
|
19
|
+
const panelLoadingClass = `${loadingElementClass}--active`;
|
|
17
20
|
const loadingElementSelector = `.${loadingElementClass}`;
|
|
18
21
|
const NAV_MENU_CONTAINER_ELEMENT_SELECTOR = '.at9 .n3 .TK';
|
|
19
22
|
export class CollapsiblePanelView extends EventEmitter {
|
|
@@ -35,7 +38,7 @@ export class CollapsiblePanelView extends EventEmitter {
|
|
|
35
38
|
#id = Math.random().toFixed(3);
|
|
36
39
|
#ARIA_LABELLED_BY_ID = Math.random().toFixed(3);
|
|
37
40
|
#driver;
|
|
38
|
-
#loading
|
|
41
|
+
#loading;
|
|
39
42
|
get loading() {
|
|
40
43
|
return this.#loading;
|
|
41
44
|
}
|
|
@@ -63,10 +66,18 @@ export class CollapsiblePanelView extends EventEmitter {
|
|
|
63
66
|
super();
|
|
64
67
|
this.#driver = driver;
|
|
65
68
|
this.#panelDescriptor = panelDescriptor;
|
|
69
|
+
this.#loading = panelDescriptor.loadingIcon != null;
|
|
66
70
|
this.#element = this.#setupElement();
|
|
67
71
|
this.#element.addEventListener('mouseleave', (e) => {
|
|
68
72
|
this.emit('blur', e);
|
|
69
73
|
});
|
|
74
|
+
stylesStream
|
|
75
|
+
.skipDuplicates((a, b) => isEqual(a, b))
|
|
76
|
+
.onValue(({ type }) => {
|
|
77
|
+
if (type === 'theme') {
|
|
78
|
+
this.#update();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
70
81
|
}
|
|
71
82
|
remove() {
|
|
72
83
|
if (this.#destroyed)
|
|
@@ -85,22 +96,41 @@ export class CollapsiblePanelView extends EventEmitter {
|
|
|
85
96
|
const navItemView = new NavItemView(appId, this.#driver, navItemDescriptorPropertyStream, gmailNavItemView);
|
|
86
97
|
return navItemView;
|
|
87
98
|
}
|
|
99
|
+
#extractPrimaryButtonTheme() {
|
|
100
|
+
const { iconUrl } = this.panelDescriptor.primaryButton ?? {};
|
|
101
|
+
if (!iconUrl) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const theme = GmailElementGetter.isDarkTheme()
|
|
105
|
+
? iconUrl.darkTheme
|
|
106
|
+
: iconUrl.lightTheme;
|
|
107
|
+
if (!theme) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (typeof theme === 'string') {
|
|
111
|
+
return {
|
|
112
|
+
panelHovered: theme,
|
|
113
|
+
panelDefault: theme,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
return {
|
|
118
|
+
panelDefault: theme.panelDefault,
|
|
119
|
+
panelHovered: theme.panelHovered,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
88
123
|
#setupElement() {
|
|
89
124
|
const { panelDescriptor } = this;
|
|
90
125
|
const { loadingIcon } = panelDescriptor;
|
|
91
|
-
const {
|
|
126
|
+
const { className, name = '' } = panelDescriptor?.primaryButton ?? {};
|
|
92
127
|
const element = document.createElement('div');
|
|
93
128
|
element.className = cx(ELEMENT_CLASS, this.panelDescriptor.className);
|
|
94
129
|
const primaryButtonClass = cx(PRIMARY_BUTTON_ELEMENT_CLASS, className);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
iconUrl = themedIcons.lightTheme;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
130
|
+
const loadingElClass = cx(loadingElementClass, {
|
|
131
|
+
[panelLoadingClass]: this.#loading,
|
|
132
|
+
});
|
|
133
|
+
const { panelDefault: defaultIconUrl, panelHovered: hoverPanelIconUrl } = this.#extractPrimaryButtonTheme() ?? {};
|
|
104
134
|
element.innerHTML = autoHtml `
|
|
105
135
|
<div class="aBO">
|
|
106
136
|
<div class="aic">
|
|
@@ -111,7 +141,7 @@ export class CollapsiblePanelView extends EventEmitter {
|
|
|
111
141
|
</div>
|
|
112
142
|
</div>
|
|
113
143
|
<div class="${scrollablePanelClass}">
|
|
114
|
-
<div class="${
|
|
144
|
+
<div class="${loadingElClass}">${loadingIcon ? { __html: loadingIcon } : ''}</div>
|
|
115
145
|
<div class="Ls77Lb aZ6">
|
|
116
146
|
<div class="pp" style="user-select: none;">
|
|
117
147
|
<div>
|
|
@@ -135,10 +165,11 @@ export class CollapsiblePanelView extends EventEmitter {
|
|
|
135
165
|
</div>
|
|
136
166
|
</div>
|
|
137
167
|
</div>
|
|
138
|
-
<div class="aTV"
|
|
168
|
+
<div class="aTV"></div>
|
|
139
169
|
`.trim();
|
|
140
170
|
const primaryBtnEl = querySelector(element, PRIMARY_BUTTON_ELEMENT_SELECTOR);
|
|
141
|
-
primaryBtnEl.style.setProperty('--background-image',
|
|
171
|
+
primaryBtnEl.style.setProperty('--background-image', defaultIconUrl ? `url(${defaultIconUrl})` : 'unset');
|
|
172
|
+
primaryBtnEl.style.setProperty('--background-image--hover', hoverPanelIconUrl ? `url(${hoverPanelIconUrl})` : 'unset');
|
|
142
173
|
primaryBtnEl.addEventListener('click', this.#onPrimaryButtonClick);
|
|
143
174
|
return element;
|
|
144
175
|
}
|
|
@@ -155,18 +186,35 @@ export class CollapsiblePanelView extends EventEmitter {
|
|
|
155
186
|
this.#updateIcon(element);
|
|
156
187
|
this.#updateScrollablePanelLoading(element);
|
|
157
188
|
}
|
|
189
|
+
static #preloadedIcons = new Set();
|
|
158
190
|
#updateIcon(element) {
|
|
159
191
|
const iconContainerEl = querySelector(element, PRIMARY_BUTTON_ELEMENT_SELECTOR);
|
|
160
|
-
const {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
192
|
+
const { panelDefault, panelHovered } = this.#extractPrimaryButtonTheme() ?? {};
|
|
193
|
+
// alleviate FOUC when switching between active and default icons
|
|
194
|
+
// https://stackoverflow.com/a/68521953/1924257
|
|
195
|
+
for (const url of [panelHovered, panelDefault]) {
|
|
196
|
+
if (!url || CollapsiblePanelView.#preloadedIcons.has(url)) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
CollapsiblePanelView.#preloadedIcons.add(url);
|
|
200
|
+
var link = document.createElement('link');
|
|
201
|
+
link.rel = 'preload';
|
|
202
|
+
link.as = 'image';
|
|
203
|
+
link.href = url;
|
|
204
|
+
document.head.appendChild(link);
|
|
166
205
|
}
|
|
167
|
-
|
|
168
|
-
|
|
206
|
+
for (const [key, value] of Object.entries({
|
|
207
|
+
'--background-image--hover': panelHovered,
|
|
208
|
+
'--background-image': panelDefault,
|
|
209
|
+
})) {
|
|
210
|
+
if (value) {
|
|
211
|
+
iconContainerEl.style.setProperty(key, `url(${value})`);
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
iconContainerEl.style.removeProperty(key);
|
|
215
|
+
}
|
|
169
216
|
}
|
|
217
|
+
const { className } = this.panelDescriptor.primaryButton ?? {};
|
|
170
218
|
iconContainerEl.className = cx(PRIMARY_BUTTON_ELEMENT_CLASS, className);
|
|
171
219
|
}
|
|
172
220
|
#updateName(element) {
|
|
@@ -181,7 +229,6 @@ export class CollapsiblePanelView extends EventEmitter {
|
|
|
181
229
|
if (!scrollablePanelLoadingEl) {
|
|
182
230
|
return;
|
|
183
231
|
}
|
|
184
|
-
const panelLoadingClass = `${loadingElementClass}--active`;
|
|
185
232
|
if (this.loading) {
|
|
186
233
|
scrollablePanelLoadingEl.classList.add(panelLoadingClass);
|
|
187
234
|
}
|