@ni/nimble-components 11.6.2 → 11.7.2
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/dist/all-components-bundle.js +251 -128
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1732 -1648
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/icon-base/styles.js +5 -1
- package/dist/esm/icon-base/styles.js.map +1 -1
- package/dist/esm/icon-base/types.d.ts +1 -0
- package/dist/esm/icon-base/types.js +2 -1
- package/dist/esm/icon-base/types.js.map +1 -1
- package/dist/esm/theme-provider/design-token-comments.js +1 -0
- package/dist/esm/theme-provider/design-token-comments.js.map +1 -1
- package/dist/esm/theme-provider/design-token-names.js +1 -0
- package/dist/esm/theme-provider/design-token-names.js.map +1 -1
- package/dist/esm/theme-provider/design-tokens.d.ts +1 -0
- package/dist/esm/theme-provider/design-tokens.js +5 -1
- package/dist/esm/theme-provider/design-tokens.js.map +1 -1
- package/dist/esm/tooltip/index.js +2 -1
- package/dist/esm/tooltip/index.js.map +1 -1
- package/dist/esm/tooltip/styles.js +79 -5
- package/dist/esm/tooltip/styles.js.map +1 -1
- package/dist/esm/tooltip/template.d.ts +4 -0
- package/dist/esm/tooltip/template.js +35 -0
- package/dist/esm/tooltip/template.js.map +1 -0
- package/dist/esm/tooltip/types.d.ts +10 -0
- package/dist/esm/tooltip/types.js +10 -0
- package/dist/esm/tooltip/types.js.map +1 -0
- package/dist/tokens-internal.scss +6 -0
- package/dist/tokens.scss +3 -0
- package/package.json +3 -3
|
@@ -278,30 +278,6 @@
|
|
|
278
278
|
},
|
|
279
279
|
});
|
|
280
280
|
|
|
281
|
-
function spilloverSubscribe(subscriber) {
|
|
282
|
-
const spillover = this.spillover;
|
|
283
|
-
const index = spillover.indexOf(subscriber);
|
|
284
|
-
if (index === -1) {
|
|
285
|
-
spillover.push(subscriber);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
function spilloverUnsubscribe(subscriber) {
|
|
289
|
-
const spillover = this.spillover;
|
|
290
|
-
const index = spillover.indexOf(subscriber);
|
|
291
|
-
if (index !== -1) {
|
|
292
|
-
spillover.splice(index, 1);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
function spilloverNotifySubscribers(args) {
|
|
296
|
-
const spillover = this.spillover;
|
|
297
|
-
const source = this.source;
|
|
298
|
-
for (let i = 0, ii = spillover.length; i < ii; ++i) {
|
|
299
|
-
spillover[i].handleChange(source, args);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
function spilloverHas(subscriber) {
|
|
303
|
-
return this.spillover.indexOf(subscriber) !== -1;
|
|
304
|
-
}
|
|
305
281
|
/**
|
|
306
282
|
* An implementation of {@link Notifier} that efficiently keeps track of
|
|
307
283
|
* subscribers interested in a specific change notification on an
|
|
@@ -331,42 +307,58 @@
|
|
|
331
307
|
* @param subscriber - The subscriber to test for inclusion in this set.
|
|
332
308
|
*/
|
|
333
309
|
has(subscriber) {
|
|
334
|
-
return this.
|
|
310
|
+
return this.spillover === void 0
|
|
311
|
+
? this.sub1 === subscriber || this.sub2 === subscriber
|
|
312
|
+
: this.spillover.indexOf(subscriber) !== -1;
|
|
335
313
|
}
|
|
336
314
|
/**
|
|
337
315
|
* Subscribes to notification of changes in an object's state.
|
|
338
316
|
* @param subscriber - The object that is subscribing for change notification.
|
|
339
317
|
*/
|
|
340
318
|
subscribe(subscriber) {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
319
|
+
const spillover = this.spillover;
|
|
320
|
+
if (spillover === void 0) {
|
|
321
|
+
if (this.has(subscriber)) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (this.sub1 === void 0) {
|
|
325
|
+
this.sub1 = subscriber;
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (this.sub2 === void 0) {
|
|
329
|
+
this.sub2 = subscriber;
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
this.spillover = [this.sub1, this.sub2, subscriber];
|
|
333
|
+
this.sub1 = void 0;
|
|
334
|
+
this.sub2 = void 0;
|
|
347
335
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
336
|
+
else {
|
|
337
|
+
const index = spillover.indexOf(subscriber);
|
|
338
|
+
if (index === -1) {
|
|
339
|
+
spillover.push(subscriber);
|
|
340
|
+
}
|
|
351
341
|
}
|
|
352
|
-
this.spillover = [this.sub1, this.sub2, subscriber];
|
|
353
|
-
this.subscribe = spilloverSubscribe;
|
|
354
|
-
this.unsubscribe = spilloverUnsubscribe;
|
|
355
|
-
this.notify = spilloverNotifySubscribers;
|
|
356
|
-
this.has = spilloverHas;
|
|
357
|
-
this.sub1 = void 0;
|
|
358
|
-
this.sub2 = void 0;
|
|
359
342
|
}
|
|
360
343
|
/**
|
|
361
344
|
* Unsubscribes from notification of changes in an object's state.
|
|
362
345
|
* @param subscriber - The object that is unsubscribing from change notification.
|
|
363
346
|
*/
|
|
364
347
|
unsubscribe(subscriber) {
|
|
365
|
-
|
|
366
|
-
|
|
348
|
+
const spillover = this.spillover;
|
|
349
|
+
if (spillover === void 0) {
|
|
350
|
+
if (this.sub1 === subscriber) {
|
|
351
|
+
this.sub1 = void 0;
|
|
352
|
+
}
|
|
353
|
+
else if (this.sub2 === subscriber) {
|
|
354
|
+
this.sub2 = void 0;
|
|
355
|
+
}
|
|
367
356
|
}
|
|
368
|
-
else
|
|
369
|
-
|
|
357
|
+
else {
|
|
358
|
+
const index = spillover.indexOf(subscriber);
|
|
359
|
+
if (index !== -1) {
|
|
360
|
+
spillover.splice(index, 1);
|
|
361
|
+
}
|
|
370
362
|
}
|
|
371
363
|
}
|
|
372
364
|
/**
|
|
@@ -374,14 +366,22 @@
|
|
|
374
366
|
* @param args - Data passed along to subscribers during notification.
|
|
375
367
|
*/
|
|
376
368
|
notify(args) {
|
|
377
|
-
const
|
|
378
|
-
const sub2 = this.sub2;
|
|
369
|
+
const spillover = this.spillover;
|
|
379
370
|
const source = this.source;
|
|
380
|
-
if (
|
|
381
|
-
sub1.
|
|
371
|
+
if (spillover === void 0) {
|
|
372
|
+
const sub1 = this.sub1;
|
|
373
|
+
const sub2 = this.sub2;
|
|
374
|
+
if (sub1 !== void 0) {
|
|
375
|
+
sub1.handleChange(source, args);
|
|
376
|
+
}
|
|
377
|
+
if (sub2 !== void 0) {
|
|
378
|
+
sub2.handleChange(source, args);
|
|
379
|
+
}
|
|
382
380
|
}
|
|
383
|
-
|
|
384
|
-
|
|
381
|
+
else {
|
|
382
|
+
for (let i = 0, ii = spillover.length; i < ii; ++i) {
|
|
383
|
+
spillover[i].handleChange(source, args);
|
|
384
|
+
}
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
}
|
|
@@ -6745,8 +6745,14 @@
|
|
|
6745
6745
|
* @internal
|
|
6746
6746
|
*/
|
|
6747
6747
|
this.keypressHandler = (e) => {
|
|
6748
|
+
if (this.readOnly) {
|
|
6749
|
+
return;
|
|
6750
|
+
}
|
|
6748
6751
|
switch (e.key) {
|
|
6749
6752
|
case keySpace:
|
|
6753
|
+
if (this.indeterminate) {
|
|
6754
|
+
this.indeterminate = false;
|
|
6755
|
+
}
|
|
6750
6756
|
this.checked = !this.checked;
|
|
6751
6757
|
break;
|
|
6752
6758
|
}
|
|
@@ -6756,6 +6762,9 @@
|
|
|
6756
6762
|
*/
|
|
6757
6763
|
this.clickHandler = (e) => {
|
|
6758
6764
|
if (!this.disabled && !this.readOnly) {
|
|
6765
|
+
if (this.indeterminate) {
|
|
6766
|
+
this.indeterminate = false;
|
|
6767
|
+
}
|
|
6759
6768
|
this.checked = !this.checked;
|
|
6760
6769
|
}
|
|
6761
6770
|
};
|
|
@@ -7780,7 +7789,7 @@
|
|
|
7780
7789
|
* @internal
|
|
7781
7790
|
*/
|
|
7782
7791
|
focusoutHandler(e) {
|
|
7783
|
-
this.
|
|
7792
|
+
this.syncValue();
|
|
7784
7793
|
if (!this.open) {
|
|
7785
7794
|
return true;
|
|
7786
7795
|
}
|
|
@@ -7802,7 +7811,12 @@
|
|
|
7802
7811
|
inputHandler(e) {
|
|
7803
7812
|
this.filter = this.control.value;
|
|
7804
7813
|
this.filterOptions();
|
|
7805
|
-
if (
|
|
7814
|
+
if (!this.isAutocompleteInline) {
|
|
7815
|
+
this.selectedIndex = this.options
|
|
7816
|
+
.map(option => option.text)
|
|
7817
|
+
.indexOf(this.control.value);
|
|
7818
|
+
}
|
|
7819
|
+
if (e.inputType.includes("deleteContent") || !this.filter.length) {
|
|
7806
7820
|
return true;
|
|
7807
7821
|
}
|
|
7808
7822
|
if (this.isAutocompleteList && !this.open) {
|
|
@@ -7828,7 +7842,7 @@
|
|
|
7828
7842
|
}
|
|
7829
7843
|
switch (key) {
|
|
7830
7844
|
case "Enter": {
|
|
7831
|
-
this.
|
|
7845
|
+
this.syncValue();
|
|
7832
7846
|
if (this.isAutocompleteInline) {
|
|
7833
7847
|
this.filter = this.value;
|
|
7834
7848
|
}
|
|
@@ -7851,7 +7865,7 @@
|
|
|
7851
7865
|
break;
|
|
7852
7866
|
}
|
|
7853
7867
|
case "Tab": {
|
|
7854
|
-
this.
|
|
7868
|
+
this.setInputToSelection();
|
|
7855
7869
|
if (!this.open) {
|
|
7856
7870
|
return true;
|
|
7857
7871
|
}
|
|
@@ -7870,7 +7884,6 @@
|
|
|
7870
7884
|
super.keydownHandler(e);
|
|
7871
7885
|
}
|
|
7872
7886
|
if (this.isAutocompleteInline) {
|
|
7873
|
-
this.updateValue();
|
|
7874
7887
|
this.setInlineSelection();
|
|
7875
7888
|
}
|
|
7876
7889
|
break;
|
|
@@ -7951,18 +7964,37 @@
|
|
|
7951
7964
|
}
|
|
7952
7965
|
}
|
|
7953
7966
|
/**
|
|
7954
|
-
* Focus and
|
|
7967
|
+
* Focus and set the content of the control based on the first selected option.
|
|
7955
7968
|
*
|
|
7956
|
-
* @param start - The index for the starting range
|
|
7957
7969
|
* @internal
|
|
7958
7970
|
*/
|
|
7959
|
-
|
|
7971
|
+
setInputToSelection() {
|
|
7960
7972
|
if (this.firstSelectedOption) {
|
|
7961
7973
|
this.control.value = this.firstSelectedOption.text;
|
|
7962
7974
|
this.control.focus();
|
|
7975
|
+
}
|
|
7976
|
+
}
|
|
7977
|
+
/**
|
|
7978
|
+
* Focus, set and select the content of the control based on the first selected option.
|
|
7979
|
+
*
|
|
7980
|
+
* @internal
|
|
7981
|
+
*/
|
|
7982
|
+
setInlineSelection() {
|
|
7983
|
+
if (this.firstSelectedOption) {
|
|
7984
|
+
this.setInputToSelection();
|
|
7963
7985
|
this.control.setSelectionRange(this.filter.length, this.control.value.length, "backward");
|
|
7964
7986
|
}
|
|
7965
7987
|
}
|
|
7988
|
+
/**
|
|
7989
|
+
* Determines if a value update should involve emitting a change event, then updates the value.
|
|
7990
|
+
*
|
|
7991
|
+
* @internal
|
|
7992
|
+
*/
|
|
7993
|
+
syncValue() {
|
|
7994
|
+
var _a;
|
|
7995
|
+
const newValue = this.selectedIndex > -1 ? (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text : this.control.value;
|
|
7996
|
+
this.updateValue(this.value !== newValue);
|
|
7997
|
+
}
|
|
7966
7998
|
/**
|
|
7967
7999
|
* Calculate and apply listbox positioning based on available viewport space.
|
|
7968
8000
|
*
|
|
@@ -8024,6 +8056,7 @@
|
|
|
8024
8056
|
var _a;
|
|
8025
8057
|
if (this.$fastController.isConnected) {
|
|
8026
8058
|
this.value = ((_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) || this.control.value;
|
|
8059
|
+
this.control.value = this.value;
|
|
8027
8060
|
}
|
|
8028
8061
|
if (shouldEmit) {
|
|
8029
8062
|
this.$emit("change");
|
|
@@ -11894,7 +11927,7 @@
|
|
|
11894
11927
|
this.updateValue(true);
|
|
11895
11928
|
this.indexWhenOpened = this.selectedIndex;
|
|
11896
11929
|
}
|
|
11897
|
-
return !(key
|
|
11930
|
+
return !(key === keyArrowDown || key === keyArrowUp);
|
|
11898
11931
|
}
|
|
11899
11932
|
connectedCallback() {
|
|
11900
11933
|
super.connectedCallback();
|
|
@@ -12866,6 +12899,12 @@
|
|
|
12866
12899
|
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
12867
12900
|
@focusin="${(x, c) => x.focusinHandler(c.event)}"
|
|
12868
12901
|
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
12902
|
+
${children({
|
|
12903
|
+
property: "childItems",
|
|
12904
|
+
attributeFilter: ["disabled", "hidden"],
|
|
12905
|
+
filter: elements(),
|
|
12906
|
+
subtree: true,
|
|
12907
|
+
})}
|
|
12869
12908
|
>
|
|
12870
12909
|
<slot name="label"></slot>
|
|
12871
12910
|
<div class="positioning-region" part="positioning-region">
|
|
@@ -12942,11 +12981,6 @@
|
|
|
12942
12981
|
* HTML Attribute: `orientation`
|
|
12943
12982
|
*/
|
|
12944
12983
|
this.orientation = Orientation.horizontal;
|
|
12945
|
-
this.startEndSlotChange = () => {
|
|
12946
|
-
if (this.$fastController.isConnected) {
|
|
12947
|
-
this.reduceFocusableElements();
|
|
12948
|
-
}
|
|
12949
|
-
};
|
|
12950
12984
|
}
|
|
12951
12985
|
/**
|
|
12952
12986
|
* The index of the currently focused element, clamped between 0 and the last element.
|
|
@@ -12981,22 +13015,17 @@
|
|
|
12981
13015
|
}
|
|
12982
13016
|
return true;
|
|
12983
13017
|
}
|
|
13018
|
+
childItemsChanged(prev, next) {
|
|
13019
|
+
if (this.$fastController.isConnected) {
|
|
13020
|
+
this.reduceFocusableElements();
|
|
13021
|
+
}
|
|
13022
|
+
}
|
|
12984
13023
|
/**
|
|
12985
13024
|
* @internal
|
|
12986
13025
|
*/
|
|
12987
13026
|
connectedCallback() {
|
|
12988
13027
|
super.connectedCallback();
|
|
12989
13028
|
this.direction = getDirection(this);
|
|
12990
|
-
this.start.addEventListener("slotchange", this.startEndSlotChange);
|
|
12991
|
-
this.end.addEventListener("slotchange", this.startEndSlotChange);
|
|
12992
|
-
}
|
|
12993
|
-
/**
|
|
12994
|
-
* @internal
|
|
12995
|
-
*/
|
|
12996
|
-
disconnectedCallback() {
|
|
12997
|
-
super.disconnectedCallback();
|
|
12998
|
-
this.start.removeEventListener("slotchange", this.startEndSlotChange);
|
|
12999
|
-
this.end.removeEventListener("slotchange", this.startEndSlotChange);
|
|
13000
13029
|
}
|
|
13001
13030
|
/**
|
|
13002
13031
|
* When the toolbar receives focus, set the currently active element as focused.
|
|
@@ -13059,7 +13088,13 @@
|
|
|
13059
13088
|
* @internal
|
|
13060
13089
|
*/
|
|
13061
13090
|
reduceFocusableElements() {
|
|
13091
|
+
var _a;
|
|
13092
|
+
const previousFocusedElement = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a[this.activeIndex];
|
|
13062
13093
|
this.focusableElements = this.allSlottedItems.reduce(Toolbar$1.reduceFocusableItems, []);
|
|
13094
|
+
// If the previously active item is still focusable, adjust the active index to the
|
|
13095
|
+
// index of that item.
|
|
13096
|
+
const adjustedActiveIndex = this.focusableElements.indexOf(previousFocusedElement);
|
|
13097
|
+
this.activeIndex = Math.max(0, adjustedActiveIndex);
|
|
13063
13098
|
this.setFocusableElements();
|
|
13064
13099
|
}
|
|
13065
13100
|
/**
|
|
@@ -13087,10 +13122,12 @@
|
|
|
13087
13122
|
const isRoleRadio = element.getAttribute("role") === "radio";
|
|
13088
13123
|
const isFocusableFastElement = (_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus;
|
|
13089
13124
|
const hasFocusableShadow = Array.from((_d = (_c = element.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelectorAll("*")) !== null && _d !== void 0 ? _d : []).some(x => isFocusable(x));
|
|
13090
|
-
if (
|
|
13091
|
-
|
|
13092
|
-
|
|
13093
|
-
|
|
13125
|
+
if (!element.hasAttribute("disabled") &&
|
|
13126
|
+
!element.hasAttribute("hidden") &&
|
|
13127
|
+
(isFocusable(element) ||
|
|
13128
|
+
isRoleRadio ||
|
|
13129
|
+
isFocusableFastElement ||
|
|
13130
|
+
hasFocusableShadow)) {
|
|
13094
13131
|
elements.push(element);
|
|
13095
13132
|
return elements;
|
|
13096
13133
|
}
|
|
@@ -13122,6 +13159,9 @@
|
|
|
13122
13159
|
__decorate$1([
|
|
13123
13160
|
observable
|
|
13124
13161
|
], Toolbar$1.prototype, "slottedLabel", void 0);
|
|
13162
|
+
__decorate$1([
|
|
13163
|
+
observable
|
|
13164
|
+
], Toolbar$1.prototype, "childItems", void 0);
|
|
13125
13165
|
/**
|
|
13126
13166
|
* Includes ARIA states and properties relating to the ARIA toolbar role
|
|
13127
13167
|
*
|
|
@@ -13138,37 +13178,6 @@
|
|
|
13138
13178
|
applyMixins(DelegatesARIAToolbar, ARIAGlobalStatesAndProperties);
|
|
13139
13179
|
applyMixins(Toolbar$1, StartEnd, DelegatesARIAToolbar);
|
|
13140
13180
|
|
|
13141
|
-
/**
|
|
13142
|
-
* Creates a template for the {@link @microsoft/fast-foundation#(Tooltip:class)} component using the provided prefix.
|
|
13143
|
-
* @public
|
|
13144
|
-
*/
|
|
13145
|
-
const tooltipTemplate = (context, definition) => {
|
|
13146
|
-
return html `
|
|
13147
|
-
${when(x => x.tooltipVisible, html `
|
|
13148
|
-
<${context.tagFor(AnchoredRegion$1)}
|
|
13149
|
-
fixed-placement="true"
|
|
13150
|
-
auto-update-mode="${x => x.autoUpdateMode}"
|
|
13151
|
-
vertical-positioning-mode="${x => x.verticalPositioningMode}"
|
|
13152
|
-
vertical-default-position="${x => x.verticalDefaultPosition}"
|
|
13153
|
-
vertical-inset="${x => x.verticalInset}"
|
|
13154
|
-
vertical-scaling="${x => x.verticalScaling}"
|
|
13155
|
-
horizontal-positioning-mode="${x => x.horizontalPositioningMode}"
|
|
13156
|
-
horizontal-default-position="${x => x.horizontalDefaultPosition}"
|
|
13157
|
-
horizontal-scaling="${x => x.horizontalScaling}"
|
|
13158
|
-
horizontal-inset="${x => x.horizontalInset}"
|
|
13159
|
-
vertical-viewport-lock="${x => x.horizontalViewportLock}"
|
|
13160
|
-
horizontal-viewport-lock="${x => x.verticalViewportLock}"
|
|
13161
|
-
dir="${x => x.currentDirection}"
|
|
13162
|
-
${ref("region")}
|
|
13163
|
-
>
|
|
13164
|
-
<div class="tooltip" part="tooltip" role="tooltip">
|
|
13165
|
-
<slot></slot>
|
|
13166
|
-
</div>
|
|
13167
|
-
</${context.tagFor(AnchoredRegion$1)}>
|
|
13168
|
-
`)}
|
|
13169
|
-
`;
|
|
13170
|
-
};
|
|
13171
|
-
|
|
13172
13181
|
/**
|
|
13173
13182
|
* Enumerates possible tooltip positions
|
|
13174
13183
|
*
|
|
@@ -14327,6 +14336,8 @@
|
|
|
14327
14336
|
* Do not edit directly
|
|
14328
14337
|
* Generated on Thu, 26 May 2022 18:20:05 GMT
|
|
14329
14338
|
*/
|
|
14339
|
+
const Information100DarkUi = "#a46eff";
|
|
14340
|
+
const Information100LightUi = "#804ad9";
|
|
14330
14341
|
const Warning100DarkUi = "#ff8126";
|
|
14331
14342
|
const Pass100LightUi = "#009921";
|
|
14332
14343
|
const Pass100DarkUi = "#00c12b";
|
|
@@ -14342,6 +14353,7 @@
|
|
|
14342
14353
|
const Black91 = "#161617";
|
|
14343
14354
|
const ForestGreen = "#074023";
|
|
14344
14355
|
const DigitalGreenLight = "#009b65";
|
|
14356
|
+
const BannerFail100DarkUi = "#d63434";
|
|
14345
14357
|
const Warning100LightUi = "#ff4b00";
|
|
14346
14358
|
const DigitalGreenDark = "#006b46";
|
|
14347
14359
|
const PowerGreen = "#32eb96";
|
|
@@ -14484,6 +14496,7 @@
|
|
|
14484
14496
|
failColor: 'fail-color',
|
|
14485
14497
|
warningColor: 'warning-color',
|
|
14486
14498
|
passColor: 'pass-color',
|
|
14499
|
+
informationColor: 'information-color',
|
|
14487
14500
|
borderHoverColor: 'border-hover-color',
|
|
14488
14501
|
iconColor: 'icon-color',
|
|
14489
14502
|
popupBoxShadowColor: 'popup-box-shadow-color',
|
|
@@ -14654,7 +14667,7 @@
|
|
|
14654
14667
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14655
14668
|
}
|
|
14656
14669
|
|
|
14657
|
-
const template$
|
|
14670
|
+
const template$6 = html `<slot></slot>`;
|
|
14658
14671
|
|
|
14659
14672
|
const styles$s = css `
|
|
14660
14673
|
:host {
|
|
@@ -14713,7 +14726,7 @@
|
|
|
14713
14726
|
const nimbleDesignSystemProvider = ThemeProvider.compose({
|
|
14714
14727
|
baseName: 'theme-provider',
|
|
14715
14728
|
styles: styles$s,
|
|
14716
|
-
template: template$
|
|
14729
|
+
template: template$6
|
|
14717
14730
|
});
|
|
14718
14731
|
DesignSystem.getOrCreate()
|
|
14719
14732
|
.withPrefix('nimble')
|
|
@@ -14747,12 +14760,13 @@
|
|
|
14747
14760
|
const failColor = DesignToken.create(styleNameFromTokenName(tokenNames.failColor)).withDefault((element) => getFailColorForTheme(element));
|
|
14748
14761
|
const warningColor = DesignToken.create(styleNameFromTokenName(tokenNames.warningColor)).withDefault((element) => getWarningColorForTheme(element));
|
|
14749
14762
|
const passColor = DesignToken.create(styleNameFromTokenName(tokenNames.passColor)).withDefault((element) => getPassColorForTheme(element));
|
|
14763
|
+
const informationColor = DesignToken.create(styleNameFromTokenName(tokenNames.informationColor)).withDefault((element) => getInformationColorForTheme(element));
|
|
14750
14764
|
const borderHoverColor = DesignToken.create(styleNameFromTokenName(tokenNames.borderHoverColor)).withDefault((element) => getColorForTheme(element, DigitalGreenLight, DigitalGreenLight, White));
|
|
14751
14765
|
// Component Color Tokens
|
|
14752
14766
|
const iconColor = DesignToken.create(styleNameFromTokenName(tokenNames.iconColor)).withDefault((element) => getColorForTheme(element, Black91, Black15, White));
|
|
14753
14767
|
const popupBoxShadowColor = DesignToken.create(styleNameFromTokenName(tokenNames.popupBoxShadowColor)).withDefault((element) => hexToRgbaCssColor(getColorForTheme(element, Black75, Black85, Black85), 0.3));
|
|
14754
14768
|
const popupBorderColor = DesignToken.create(styleNameFromTokenName(tokenNames.popupBorderColor)).withDefault((element) => hexToRgbaCssColor(getColorForTheme(element, Black91, Black15, White), 0.3));
|
|
14755
|
-
|
|
14769
|
+
DesignToken.create(styleNameFromTokenName(tokenNames.tooltipBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black85, ForestGreen));
|
|
14756
14770
|
// Component Sizing Tokens
|
|
14757
14771
|
const controlHeight = DesignToken.create(styleNameFromTokenName(tokenNames.controlHeight)).withDefault('32px');
|
|
14758
14772
|
const smallPadding = DesignToken.create(styleNameFromTokenName(tokenNames.smallPadding)).withDefault('4px');
|
|
@@ -14843,6 +14857,9 @@
|
|
|
14843
14857
|
function getPassColorForTheme(element) {
|
|
14844
14858
|
return getColorForTheme(element, Pass100LightUi, Pass100DarkUi, White);
|
|
14845
14859
|
}
|
|
14860
|
+
function getInformationColorForTheme(element) {
|
|
14861
|
+
return getColorForTheme(element, Information100LightUi, Information100DarkUi, White);
|
|
14862
|
+
}
|
|
14846
14863
|
function getDefaultLineColorForTheme(element) {
|
|
14847
14864
|
return getColorForTheme(element, Black91, Black15, White);
|
|
14848
14865
|
}
|
|
@@ -16180,7 +16197,7 @@
|
|
|
16180
16197
|
</div>
|
|
16181
16198
|
`;
|
|
16182
16199
|
|
|
16183
|
-
const template$
|
|
16200
|
+
const template$5 = html `
|
|
16184
16201
|
<template>
|
|
16185
16202
|
<div class="icon" :innerHTML=${x => x.icon.data}></div>
|
|
16186
16203
|
</template
|
|
@@ -16213,6 +16230,10 @@
|
|
|
16213
16230
|
${iconColor.cssCustomProperty}: ${passColor};
|
|
16214
16231
|
}
|
|
16215
16232
|
|
|
16233
|
+
:host(.information) {
|
|
16234
|
+
${iconColor.cssCustomProperty}: ${informationColor};
|
|
16235
|
+
}
|
|
16236
|
+
|
|
16216
16237
|
.icon svg {
|
|
16217
16238
|
fill: ${iconColor};
|
|
16218
16239
|
width: 100%;
|
|
@@ -16232,7 +16253,7 @@
|
|
|
16232
16253
|
const registerIcon = (baseName, iconClass) => {
|
|
16233
16254
|
const composedIcon = iconClass.compose({
|
|
16234
16255
|
baseName,
|
|
16235
|
-
template: template$
|
|
16256
|
+
template: template$5,
|
|
16236
16257
|
styles: styles$m,
|
|
16237
16258
|
baseClass: iconClass
|
|
16238
16259
|
});
|
|
@@ -19832,7 +19853,7 @@
|
|
|
19832
19853
|
}
|
|
19833
19854
|
`;
|
|
19834
19855
|
|
|
19835
|
-
const template$
|
|
19856
|
+
const template$4 = (context, definition) => html `
|
|
19836
19857
|
<div
|
|
19837
19858
|
role="button"
|
|
19838
19859
|
part="control"
|
|
@@ -19907,7 +19928,7 @@
|
|
|
19907
19928
|
applyMixins(ToggleButton, StartEnd, DelegatesARIAButton);
|
|
19908
19929
|
const nimbleToggleButton = ToggleButton.compose({
|
|
19909
19930
|
baseName: 'toggle-button',
|
|
19910
|
-
template: template$
|
|
19931
|
+
template: template$4,
|
|
19911
19932
|
styles: styles$e,
|
|
19912
19933
|
shadowOptions: {
|
|
19913
19934
|
delegatesFocus: true
|
|
@@ -19916,7 +19937,7 @@
|
|
|
19916
19937
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleToggleButton());
|
|
19917
19938
|
|
|
19918
19939
|
// prettier-ignore
|
|
19919
|
-
const template$
|
|
19940
|
+
const template$3 = context => html `
|
|
19920
19941
|
<template
|
|
19921
19942
|
?open="${x => x.open}"
|
|
19922
19943
|
@focusout="${(x, c) => x.focusoutHandler(c.event)}"
|
|
@@ -20124,7 +20145,7 @@
|
|
|
20124
20145
|
], MenuButton.prototype, "slottedMenus", void 0);
|
|
20125
20146
|
const nimbleMenuButton = MenuButton.compose({
|
|
20126
20147
|
baseName: 'menu-button',
|
|
20127
|
-
template: template$
|
|
20148
|
+
template: template$3,
|
|
20128
20149
|
styles: styles$f,
|
|
20129
20150
|
shadowOptions: {
|
|
20130
20151
|
delegatesFocus: true
|
|
@@ -20756,7 +20777,7 @@
|
|
|
20756
20777
|
`));
|
|
20757
20778
|
|
|
20758
20779
|
// prettier-ignore
|
|
20759
|
-
const template$
|
|
20780
|
+
const template$2 = html `
|
|
20760
20781
|
<template
|
|
20761
20782
|
role="switch"
|
|
20762
20783
|
aria-checked="${x => x.checked}"
|
|
@@ -20800,7 +20821,7 @@
|
|
|
20800
20821
|
const nimbleSwitch = Switch.compose({
|
|
20801
20822
|
baseClass: Switch$1,
|
|
20802
20823
|
baseName: 'switch',
|
|
20803
|
-
template: template$
|
|
20824
|
+
template: template$2,
|
|
20804
20825
|
styles: styles$a
|
|
20805
20826
|
});
|
|
20806
20827
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSwitch());
|
|
@@ -20999,7 +21020,7 @@
|
|
|
20999
21020
|
}
|
|
21000
21021
|
`;
|
|
21001
21022
|
|
|
21002
|
-
const template = html `
|
|
21023
|
+
const template$1 = html `
|
|
21003
21024
|
<template slot="end">
|
|
21004
21025
|
<div class="separator"></div>
|
|
21005
21026
|
<slot></slot>
|
|
@@ -21013,7 +21034,7 @@
|
|
|
21013
21034
|
}
|
|
21014
21035
|
const nimbleTabsToolbar = TabsToolbar.compose({
|
|
21015
21036
|
baseName: 'tabs-toolbar',
|
|
21016
|
-
template,
|
|
21037
|
+
template: template$1,
|
|
21017
21038
|
styles: styles$6
|
|
21018
21039
|
});
|
|
21019
21040
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTabsToolbar());
|
|
@@ -21519,22 +21540,124 @@
|
|
|
21519
21540
|
font: ${tooltipCaptionFont};
|
|
21520
21541
|
color: ${tooltipCaptionFontColor};
|
|
21521
21542
|
text-align: left;
|
|
21543
|
+
--ni-private-tooltip-border-color: ${hexToRgbaCssColor(Black91, 0.3)};
|
|
21544
|
+
--ni-private-tooltip-background-color: ${Black15};
|
|
21522
21545
|
}
|
|
21523
21546
|
|
|
21524
21547
|
.tooltip {
|
|
21525
21548
|
box-sizing: border-box;
|
|
21526
21549
|
flex-shrink: 0;
|
|
21527
21550
|
max-width: 440px;
|
|
21528
|
-
border: ${borderWidth} solid rgba(${borderRgbPartialColor}, 0.3);
|
|
21529
21551
|
box-shadow: 0px 3px 4px ${popupBoxShadowColor};
|
|
21530
|
-
|
|
21552
|
+
display: inline-flex;
|
|
21553
|
+
border: ${borderWidth} solid var(--ni-private-tooltip-border-color);
|
|
21554
|
+
background-color: var(--ni-private-tooltip-background-color);
|
|
21531
21555
|
padding-bottom: 6px;
|
|
21532
21556
|
padding-left: calc(${standardPadding} / 2);
|
|
21533
21557
|
padding-right: calc(${standardPadding} / 2);
|
|
21534
21558
|
padding-top: ${smallPadding};
|
|
21535
|
-
display: inline-flex;
|
|
21536
21559
|
}
|
|
21537
|
-
|
|
21560
|
+
|
|
21561
|
+
.status-icon {
|
|
21562
|
+
display: none;
|
|
21563
|
+
width: 14px;
|
|
21564
|
+
height: 14px;
|
|
21565
|
+
padding-right: 8px;
|
|
21566
|
+
}
|
|
21567
|
+
|
|
21568
|
+
:host(.fail.icon-visible) .fail {
|
|
21569
|
+
display: flex;
|
|
21570
|
+
flex: 0 0 auto;
|
|
21571
|
+
}
|
|
21572
|
+
|
|
21573
|
+
:host(.information.icon-visible) .information {
|
|
21574
|
+
display: flex;
|
|
21575
|
+
flex: 0 0 auto;
|
|
21576
|
+
}
|
|
21577
|
+
`.withBehaviors(
|
|
21578
|
+
/* Local Theme Behaviors for tooltip borders and backgrounds */
|
|
21579
|
+
themeBehavior(
|
|
21580
|
+
// Light Theme
|
|
21581
|
+
css `
|
|
21582
|
+
:host(.fail) {
|
|
21583
|
+
--ni-private-tooltip-border-color: ${BannerFail100DarkUi};
|
|
21584
|
+
--ni-private-tooltip-background-color: ${White};
|
|
21585
|
+
}
|
|
21586
|
+
|
|
21587
|
+
:host(.information) {
|
|
21588
|
+
--ni-private-tooltip-border-color: ${Information100LightUi};
|
|
21589
|
+
--ni-private-tooltip-background-color: ${White};
|
|
21590
|
+
}
|
|
21591
|
+
`,
|
|
21592
|
+
// Dark Theme
|
|
21593
|
+
css `
|
|
21594
|
+
:host {
|
|
21595
|
+
--ni-private-tooltip-border-color: ${hexToRgbaCssColor(Black15, 0.3)};
|
|
21596
|
+
--ni-private-tooltip-background-color: ${Black85};
|
|
21597
|
+
}
|
|
21598
|
+
|
|
21599
|
+
:host(.information) {
|
|
21600
|
+
--ni-private-tooltip-border-color: ${Information100DarkUi};
|
|
21601
|
+
}
|
|
21602
|
+
|
|
21603
|
+
:host(.fail) {
|
|
21604
|
+
--ni-private-tooltip-border-color: ${BannerFail100DarkUi};
|
|
21605
|
+
}
|
|
21606
|
+
`,
|
|
21607
|
+
// Color Theme
|
|
21608
|
+
css `
|
|
21609
|
+
.anchored-region {
|
|
21610
|
+
background-color: ${ForestGreen};
|
|
21611
|
+
}
|
|
21612
|
+
|
|
21613
|
+
:host {
|
|
21614
|
+
--ni-private-tooltip-border-color: ${hexToRgbaCssColor(White, 0.3)};
|
|
21615
|
+
--ni-private-tooltip-background-color: ${hexToRgbaCssColor(White, 0.15)};
|
|
21616
|
+
}
|
|
21617
|
+
|
|
21618
|
+
:host(.fail) {
|
|
21619
|
+
--ni-private-tooltip-border-color: ${White};
|
|
21620
|
+
}
|
|
21621
|
+
|
|
21622
|
+
:host(.information) {
|
|
21623
|
+
--ni-private-tooltip-border-color: ${White};
|
|
21624
|
+
}
|
|
21625
|
+
|
|
21626
|
+
.status-icon {
|
|
21627
|
+
opacity: 0.6;
|
|
21628
|
+
}
|
|
21629
|
+
`));
|
|
21630
|
+
|
|
21631
|
+
// prettier-ignore
|
|
21632
|
+
const template = context => {
|
|
21633
|
+
return html `
|
|
21634
|
+
${when(x => x.tooltipVisible, html `
|
|
21635
|
+
<${context.tagFor(AnchoredRegion)}
|
|
21636
|
+
class="anchored-region"
|
|
21637
|
+
fixed-placement="true"
|
|
21638
|
+
auto-update-mode="${x => x.autoUpdateMode}"
|
|
21639
|
+
vertical-positioning-mode="${x => x.verticalPositioningMode}"
|
|
21640
|
+
vertical-default-position="${x => x.verticalDefaultPosition}"
|
|
21641
|
+
vertical-inset="${x => x.verticalInset}"
|
|
21642
|
+
vertical-scaling="${x => x.verticalScaling}"
|
|
21643
|
+
horizontal-positioning-mode="${x => x.horizontalPositioningMode}"
|
|
21644
|
+
horizontal-default-position="${x => x.horizontalDefaultPosition}"
|
|
21645
|
+
horizontal-scaling="${x => x.horizontalScaling}"
|
|
21646
|
+
horizontal-inset="${x => x.horizontalInset}"
|
|
21647
|
+
vertical-viewport-lock="${x => x.horizontalViewportLock}"
|
|
21648
|
+
horizontal-viewport-lock="${x => x.verticalViewportLock}"
|
|
21649
|
+
dir="${x => x.currentDirection}"
|
|
21650
|
+
${ref('region')}
|
|
21651
|
+
>
|
|
21652
|
+
<div class="tooltip" part="tooltip" role="tooltip">
|
|
21653
|
+
<${context.tagFor(IconExclamationMark)} class="fail status-icon"></${context.tagFor(IconExclamationMark)}>
|
|
21654
|
+
<${context.tagFor(IconInfo)} class="information status-icon"></${context.tagFor(IconInfo)}>
|
|
21655
|
+
<slot></slot>
|
|
21656
|
+
</div>
|
|
21657
|
+
</${context.tagFor(AnchoredRegion)}>
|
|
21658
|
+
`)}
|
|
21659
|
+
`;
|
|
21660
|
+
};
|
|
21538
21661
|
|
|
21539
21662
|
/**
|
|
21540
21663
|
* A nimble-styled tooltip control.
|
|
@@ -21544,7 +21667,7 @@
|
|
|
21544
21667
|
const nimbleTooltip = Tooltip.compose({
|
|
21545
21668
|
baseName: 'tooltip',
|
|
21546
21669
|
baseClass: Tooltip$1,
|
|
21547
|
-
template
|
|
21670
|
+
template,
|
|
21548
21671
|
styles: styles$2
|
|
21549
21672
|
});
|
|
21550
21673
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTooltip());
|