@ni/nimble-components 20.17.6 → 20.18.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/dist/all-components-bundle.js +667 -167
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1171 -1109
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/all-components.d.ts +2 -0
- package/dist/esm/all-components.js +2 -0
- package/dist/esm/all-components.js.map +1 -1
- package/dist/esm/rich-text/base/index.js +2 -4
- package/dist/esm/rich-text/base/index.js.map +1 -1
- package/dist/esm/rich-text/editor/styles.js +29 -5
- package/dist/esm/rich-text/editor/styles.js.map +1 -1
- package/dist/esm/table/index.js +2 -4
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/testing/table.pageobject.d.ts +1 -1
- package/dist/esm/table/testing/table.pageobject.js +9 -5
- package/dist/esm/table/testing/table.pageobject.js.map +1 -1
- package/dist/esm/table-column/number-text/cell-view/index.js +1 -2
- package/dist/esm/table-column/number-text/cell-view/index.js.map +1 -1
- package/dist/esm/table-column/number-text/group-header-view/index.js +1 -2
- package/dist/esm/table-column/number-text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/number-text/index.d.ts +11 -2
- package/dist/esm/table-column/number-text/index.js +61 -14
- package/dist/esm/table-column/number-text/index.js.map +1 -1
- package/dist/esm/table-column/number-text/models/table-column-number-text-validator.d.ts +2 -1
- package/dist/esm/table-column/number-text/models/table-column-number-text-validator.js +6 -1
- package/dist/esm/table-column/number-text/models/table-column-number-text-validator.js.map +1 -1
- package/dist/esm/table-column/number-text/template.d.ts +2 -0
- package/dist/esm/table-column/number-text/template.js +14 -0
- package/dist/esm/table-column/number-text/template.js.map +1 -0
- package/dist/esm/unit/base/template.d.ts +1 -0
- package/dist/esm/unit/base/template.js +3 -0
- package/dist/esm/unit/base/template.js.map +1 -0
- package/dist/esm/unit/base/unit.d.ts +9 -0
- package/dist/esm/unit/base/unit.js +12 -0
- package/dist/esm/unit/base/unit.js.map +1 -0
- package/dist/esm/unit/byte/index.d.ts +19 -0
- package/dist/esm/unit/byte/index.js +36 -0
- package/dist/esm/unit/byte/index.js.map +1 -0
- package/dist/esm/unit/volt/index.d.ts +13 -0
- package/dist/esm/unit/volt/index.js +20 -0
- package/dist/esm/unit/volt/index.js.map +1 -0
- package/dist/esm/utilities/unit-format/base/unit-format.d.ts +16 -0
- package/dist/esm/utilities/unit-format/base/unit-format.js +21 -0
- package/dist/esm/utilities/unit-format/base/unit-format.js.map +1 -0
- package/dist/esm/utilities/unit-format/decimal-unit-format.d.ts +22 -0
- package/dist/esm/utilities/unit-format/decimal-unit-format.js +51 -0
- package/dist/esm/utilities/unit-format/decimal-unit-format.js.map +1 -0
- package/dist/esm/utilities/unit-format/default-unit-format.d.ts +21 -0
- package/dist/esm/utilities/unit-format/default-unit-format.js +102 -0
- package/dist/esm/utilities/unit-format/default-unit-format.js.map +1 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/manually-translated-scaled-unit-format.d.ts +18 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/manually-translated-scaled-unit-format.js +49 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/manually-translated-scaled-unit-format.js.map +1 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/manually-translated-unit-scale.d.ts +10 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/manually-translated-unit-scale.js +19 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/manually-translated-unit-scale.js.map +1 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefix.d.ts +10 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefix.js +17 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefix.js.map +1 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefixes-metric.d.ts +5 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefixes-metric.js +21 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefixes-metric.js.map +1 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-translation.d.ts +9 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-translation.js +11 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-translation.js.map +1 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/byte-1024-unit-scale.d.ts +9 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/byte-1024-unit-scale.js +26 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/byte-1024-unit-scale.js.map +1 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/volt-unit-scale.d.ts +9 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/volt-unit-scale.js +19 -0
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/volt-unit-scale.js.map +1 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/intl-number-format-scaled-unit-format.d.ts +11 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/intl-number-format-scaled-unit-format.js +21 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/intl-number-format-scaled-unit-format.js.map +1 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/scaled-unit-format.d.ts +10 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/scaled-unit-format.js +10 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/scaled-unit-format.js.map +1 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/scaled-unit.d.ts +16 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/scaled-unit.js +13 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/scaled-unit.js.map +1 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/unit-scale.d.ts +15 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/unit-scale.js +49 -0
- package/dist/esm/utilities/unit-format/unit-scale/base/unit-scale.js.map +1 -0
- package/dist/esm/utilities/unit-format/unit-scale/byte-unit-scale.d.ts +9 -0
- package/dist/esm/utilities/unit-format/unit-scale/byte-unit-scale.js +44 -0
- package/dist/esm/utilities/unit-format/unit-scale/byte-unit-scale.js.map +1 -0
- package/dist/esm/utilities/unit-format/unit-scale/passthrough-unit-scale.d.ts +9 -0
- package/dist/esm/utilities/unit-format/unit-scale/passthrough-unit-scale.js +15 -0
- package/dist/esm/utilities/unit-format/unit-scale/passthrough-unit-scale.js.map +1 -0
- package/dist/esm/utilities/wait-until-custom-elements-defined-async.d.ts +1 -0
- package/dist/esm/utilities/wait-until-custom-elements-defined-async.js +7 -0
- package/dist/esm/utilities/wait-until-custom-elements-defined-async.js.map +1 -0
- package/package.json +2 -2
- package/dist/esm/table-column/number-text/models/decimal-formatter.d.ts +0 -11
- package/dist/esm/table-column/number-text/models/decimal-formatter.js +0 -27
- package/dist/esm/table-column/number-text/models/decimal-formatter.js.map +0 -1
- package/dist/esm/table-column/number-text/models/default-formatter.d.ts +0 -15
- package/dist/esm/table-column/number-text/models/default-formatter.js +0 -55
- package/dist/esm/table-column/number-text/models/default-formatter.js.map +0 -1
- package/dist/esm/table-column/number-text/models/number-formatter.d.ts +0 -11
- package/dist/esm/table-column/number-text/models/number-formatter.js +0 -21
- package/dist/esm/table-column/number-text/models/number-formatter.js.map +0 -1
|
@@ -16301,7 +16301,7 @@
|
|
|
16301
16301
|
|
|
16302
16302
|
/**
|
|
16303
16303
|
* Do not edit directly
|
|
16304
|
-
* Generated on
|
|
16304
|
+
* Generated on Wed, 17 Jan 2024 14:08:42 GMT
|
|
16305
16305
|
*/
|
|
16306
16306
|
|
|
16307
16307
|
const Information100DarkUi = "#a46eff";
|
|
@@ -16704,7 +16704,7 @@
|
|
|
16704
16704
|
return `${prefix}${uniqueIdCounter++}`;
|
|
16705
16705
|
}
|
|
16706
16706
|
|
|
16707
|
-
const template$
|
|
16707
|
+
const template$F = html `<slot></slot>`;
|
|
16708
16708
|
|
|
16709
16709
|
const styles$X = css `
|
|
16710
16710
|
:host {
|
|
@@ -16824,7 +16824,7 @@
|
|
|
16824
16824
|
const nimbleDesignSystemProvider = ThemeProvider.compose({
|
|
16825
16825
|
baseName: 'theme-provider',
|
|
16826
16826
|
styles: styles$X,
|
|
16827
|
-
template: template$
|
|
16827
|
+
template: template$F
|
|
16828
16828
|
});
|
|
16829
16829
|
DesignSystem.getOrCreate()
|
|
16830
16830
|
.withPrefix('nimble')
|
|
@@ -17116,7 +17116,7 @@
|
|
|
17116
17116
|
`;
|
|
17117
17117
|
|
|
17118
17118
|
// prettier-ignore
|
|
17119
|
-
const template$
|
|
17119
|
+
const template$E = (_context, definition) => html `${
|
|
17120
17120
|
/* top-container div is necessary because setting contenteditable directly on the native anchor instead
|
|
17121
17121
|
leaves it focusable, unlike the behavior you get when the anchor is _within_ a contenteditable element.
|
|
17122
17122
|
*/ ''}<div
|
|
@@ -17215,7 +17215,7 @@
|
|
|
17215
17215
|
const nimbleAnchor = Anchor.compose({
|
|
17216
17216
|
baseName: 'anchor',
|
|
17217
17217
|
baseClass: Anchor$1,
|
|
17218
|
-
template: template$
|
|
17218
|
+
template: template$E,
|
|
17219
17219
|
styles: styles$W,
|
|
17220
17220
|
shadowOptions: {
|
|
17221
17221
|
delegatesFocus: true
|
|
@@ -17605,7 +17605,7 @@
|
|
|
17605
17605
|
}
|
|
17606
17606
|
`;
|
|
17607
17607
|
|
|
17608
|
-
const template$
|
|
17608
|
+
const template$D = (context, definition) => html `
|
|
17609
17609
|
<a
|
|
17610
17610
|
class="control"
|
|
17611
17611
|
part="control"
|
|
@@ -17687,13 +17687,14 @@
|
|
|
17687
17687
|
], AnchorButton.prototype, "disabled", void 0);
|
|
17688
17688
|
const nimbleAnchorButton = AnchorButton.compose({
|
|
17689
17689
|
baseName: 'anchor-button',
|
|
17690
|
-
template: template$
|
|
17690
|
+
template: template$D,
|
|
17691
17691
|
styles: styles$U,
|
|
17692
17692
|
shadowOptions: {
|
|
17693
17693
|
delegatesFocus: true
|
|
17694
17694
|
}
|
|
17695
17695
|
});
|
|
17696
17696
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorButton());
|
|
17697
|
+
const anchorButtonTag = 'nimble-anchor-button';
|
|
17697
17698
|
|
|
17698
17699
|
const styles$T = css `
|
|
17699
17700
|
${display('grid')}
|
|
@@ -17772,7 +17773,7 @@
|
|
|
17772
17773
|
}
|
|
17773
17774
|
`;
|
|
17774
17775
|
|
|
17775
|
-
const template$
|
|
17776
|
+
const template$C = (context, definition) => html `
|
|
17776
17777
|
<template
|
|
17777
17778
|
role="menuitem"
|
|
17778
17779
|
class="${x => (typeof x.startColumnCount === 'number'
|
|
@@ -17873,7 +17874,7 @@
|
|
|
17873
17874
|
// FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
|
|
17874
17875
|
const nimbleAnchorMenuItem = AnchorMenuItem.compose({
|
|
17875
17876
|
baseName: 'anchor-menu-item',
|
|
17876
|
-
template: template$
|
|
17877
|
+
template: template$C,
|
|
17877
17878
|
styles: styles$T,
|
|
17878
17879
|
shadowOptions: {
|
|
17879
17880
|
delegatesFocus: true
|
|
@@ -18013,7 +18014,7 @@
|
|
|
18013
18014
|
}
|
|
18014
18015
|
`;
|
|
18015
18016
|
|
|
18016
|
-
const template$
|
|
18017
|
+
const template$B = (context, definition) => html `
|
|
18017
18018
|
<template slot="anchortab" role="tab" aria-disabled="${x => x.disabled}">
|
|
18018
18019
|
<a
|
|
18019
18020
|
download="${x => x.download}"
|
|
@@ -18065,7 +18066,7 @@
|
|
|
18065
18066
|
// FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
|
|
18066
18067
|
const nimbleAnchorTab = AnchorTab.compose({
|
|
18067
18068
|
baseName: 'anchor-tab',
|
|
18068
|
-
template: template$
|
|
18069
|
+
template: template$B,
|
|
18069
18070
|
styles: styles$S,
|
|
18070
18071
|
shadowOptions: {
|
|
18071
18072
|
delegatesFocus: true
|
|
@@ -18095,7 +18096,7 @@
|
|
|
18095
18096
|
}
|
|
18096
18097
|
`;
|
|
18097
18098
|
|
|
18098
|
-
const template$
|
|
18099
|
+
const template$A = (context, definition) => html `
|
|
18099
18100
|
${startSlotTemplate(context, definition)}
|
|
18100
18101
|
<div ${ref('tablist')} class="tablist" part="tablist" role="tablist">
|
|
18101
18102
|
<slot name="anchortab" ${slotted('tabs')}></slot>
|
|
@@ -18301,7 +18302,7 @@
|
|
|
18301
18302
|
applyMixins(AnchorTabs, StartEnd);
|
|
18302
18303
|
const nimbleAnchorTabs = AnchorTabs.compose({
|
|
18303
18304
|
baseName: 'anchor-tabs',
|
|
18304
|
-
template: template$
|
|
18305
|
+
template: template$A,
|
|
18305
18306
|
styles: styles$R,
|
|
18306
18307
|
shadowOptions: {
|
|
18307
18308
|
delegatesFocus: false
|
|
@@ -18419,7 +18420,7 @@
|
|
|
18419
18420
|
}
|
|
18420
18421
|
`;
|
|
18421
18422
|
|
|
18422
|
-
const template$
|
|
18423
|
+
const template$z = (context, definition) => html `
|
|
18423
18424
|
<template
|
|
18424
18425
|
role="treeitem"
|
|
18425
18426
|
slot="${x => (x.isNestedItem() ? 'item' : null)}"
|
|
@@ -18556,7 +18557,7 @@
|
|
|
18556
18557
|
// FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
|
|
18557
18558
|
const nimbleAnchorTreeItem = AnchorTreeItem.compose({
|
|
18558
18559
|
baseName: 'anchor-tree-item',
|
|
18559
|
-
template: template$
|
|
18560
|
+
template: template$z,
|
|
18560
18561
|
styles: styles$Q,
|
|
18561
18562
|
shadowOptions: {
|
|
18562
18563
|
delegatesFocus: true
|
|
@@ -19578,7 +19579,7 @@
|
|
|
19578
19579
|
};
|
|
19579
19580
|
|
|
19580
19581
|
// Avoiding any whitespace in the template because this is an inline element
|
|
19581
|
-
const template$
|
|
19582
|
+
const template$y = html `<div
|
|
19582
19583
|
class="icon"
|
|
19583
19584
|
aria-hidden="true"
|
|
19584
19585
|
:innerHTML=${x => x.icon.data}
|
|
@@ -19637,7 +19638,7 @@
|
|
|
19637
19638
|
const registerIcon = (baseName, iconClass) => {
|
|
19638
19639
|
const composedIcon = iconClass.compose({
|
|
19639
19640
|
baseName,
|
|
19640
|
-
template: template$
|
|
19641
|
+
template: template$y,
|
|
19641
19642
|
styles: styles$M,
|
|
19642
19643
|
baseClass: iconClass
|
|
19643
19644
|
});
|
|
@@ -19742,7 +19743,7 @@
|
|
|
19742
19743
|
}).withDefault(coreLabelDefaults.informationIconLabel);
|
|
19743
19744
|
|
|
19744
19745
|
// prettier-ignore
|
|
19745
|
-
const template$
|
|
19746
|
+
const template$x = html `
|
|
19746
19747
|
<div class="container"
|
|
19747
19748
|
role="status"
|
|
19748
19749
|
aria-atomic="${x => x.ariaAtomic}"
|
|
@@ -19858,7 +19859,7 @@
|
|
|
19858
19859
|
applyMixins(Banner, ARIAGlobalStatesAndProperties);
|
|
19859
19860
|
const nimbleBanner = Banner.compose({
|
|
19860
19861
|
baseName: 'banner',
|
|
19861
|
-
template: template$
|
|
19862
|
+
template: template$x,
|
|
19862
19863
|
styles: styles$O
|
|
19863
19864
|
});
|
|
19864
19865
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
|
|
@@ -20013,7 +20014,7 @@
|
|
|
20013
20014
|
}
|
|
20014
20015
|
`;
|
|
20015
20016
|
|
|
20016
|
-
const template$
|
|
20017
|
+
const template$w = html `
|
|
20017
20018
|
${'' /* Explicitly set role to work around Lighthouse error. See https://github.com/ni/nimble/issues/1650. */}
|
|
20018
20019
|
<section role="region" aria-labelledby="title-slot">
|
|
20019
20020
|
<slot name="title" id="title-slot"></slot>
|
|
@@ -20029,7 +20030,7 @@
|
|
|
20029
20030
|
const nimbleCard = Card.compose({
|
|
20030
20031
|
baseName: 'card',
|
|
20031
20032
|
baseClass: Card$1,
|
|
20032
|
-
template: template$
|
|
20033
|
+
template: template$w,
|
|
20033
20034
|
styles: styles$J
|
|
20034
20035
|
});
|
|
20035
20036
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCard());
|
|
@@ -20405,7 +20406,7 @@
|
|
|
20405
20406
|
}
|
|
20406
20407
|
`;
|
|
20407
20408
|
|
|
20408
|
-
const template$
|
|
20409
|
+
const template$v = (context, definition) => html `
|
|
20409
20410
|
<div
|
|
20410
20411
|
role="button"
|
|
20411
20412
|
part="control"
|
|
@@ -20480,7 +20481,7 @@
|
|
|
20480
20481
|
applyMixins(ToggleButton, StartEnd, DelegatesARIAButton);
|
|
20481
20482
|
const nimbleToggleButton = ToggleButton.compose({
|
|
20482
20483
|
baseName: 'toggle-button',
|
|
20483
|
-
template: template$
|
|
20484
|
+
template: template$v,
|
|
20484
20485
|
styles: styles$G,
|
|
20485
20486
|
shadowOptions: {
|
|
20486
20487
|
delegatesFocus: true
|
|
@@ -20914,7 +20915,7 @@
|
|
|
20914
20915
|
}
|
|
20915
20916
|
|
|
20916
20917
|
// prettier-ignore
|
|
20917
|
-
const template$
|
|
20918
|
+
const template$u = (context, definition) => html `
|
|
20918
20919
|
<template
|
|
20919
20920
|
aria-disabled="${x => x.ariaDisabled}"
|
|
20920
20921
|
autocomplete="${x => x.autocomplete}"
|
|
@@ -21192,7 +21193,7 @@
|
|
|
21192
21193
|
const nimbleCombobox = Combobox.compose({
|
|
21193
21194
|
baseName: 'combobox',
|
|
21194
21195
|
baseClass: Combobox$1,
|
|
21195
|
-
template: template$
|
|
21196
|
+
template: template$u,
|
|
21196
21197
|
styles: styles$D,
|
|
21197
21198
|
shadowOptions: {
|
|
21198
21199
|
delegatesFocus: true
|
|
@@ -21339,7 +21340,7 @@
|
|
|
21339
21340
|
}
|
|
21340
21341
|
`));
|
|
21341
21342
|
|
|
21342
|
-
const template$
|
|
21343
|
+
const template$t = html `
|
|
21343
21344
|
<template>
|
|
21344
21345
|
<dialog
|
|
21345
21346
|
${ref('dialogElement')}
|
|
@@ -21466,7 +21467,7 @@
|
|
|
21466
21467
|
applyMixins(Dialog, ARIAGlobalStatesAndProperties);
|
|
21467
21468
|
const nimbleDialog = Dialog.compose({
|
|
21468
21469
|
baseName: 'dialog',
|
|
21469
|
-
template: template$
|
|
21470
|
+
template: template$t,
|
|
21470
21471
|
styles: styles$C,
|
|
21471
21472
|
baseClass: Dialog
|
|
21472
21473
|
});
|
|
@@ -21625,7 +21626,7 @@
|
|
|
21625
21626
|
}
|
|
21626
21627
|
`));
|
|
21627
21628
|
|
|
21628
|
-
const template$
|
|
21629
|
+
const template$s = html `
|
|
21629
21630
|
<dialog
|
|
21630
21631
|
${ref('dialog')}
|
|
21631
21632
|
aria-label="${x => x.ariaLabel}"
|
|
@@ -21739,7 +21740,7 @@
|
|
|
21739
21740
|
applyMixins(Drawer, ARIAGlobalStatesAndProperties);
|
|
21740
21741
|
const nimbleDrawer = Drawer.compose({
|
|
21741
21742
|
baseName: 'drawer',
|
|
21742
|
-
template: template$
|
|
21743
|
+
template: template$s,
|
|
21743
21744
|
styles: styles$B
|
|
21744
21745
|
});
|
|
21745
21746
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDrawer());
|
|
@@ -24103,7 +24104,7 @@
|
|
|
24103
24104
|
* @public
|
|
24104
24105
|
*/
|
|
24105
24106
|
// prettier-ignore
|
|
24106
|
-
const template$
|
|
24107
|
+
const template$r = (context, definition) => html `
|
|
24107
24108
|
<template
|
|
24108
24109
|
aria-checked="${x => x.ariaChecked}"
|
|
24109
24110
|
aria-disabled="${x => x.ariaDisabled}"
|
|
@@ -24151,7 +24152,7 @@
|
|
|
24151
24152
|
const nimbleListOption = ListOption.compose({
|
|
24152
24153
|
baseName: 'list-option',
|
|
24153
24154
|
baseClass: ListboxOption,
|
|
24154
|
-
template: template$
|
|
24155
|
+
template: template$r,
|
|
24155
24156
|
styles: styles$A
|
|
24156
24157
|
});
|
|
24157
24158
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleListOption());
|
|
@@ -24166,7 +24167,7 @@
|
|
|
24166
24167
|
attr()
|
|
24167
24168
|
], Mapping$1.prototype, "key", void 0);
|
|
24168
24169
|
|
|
24169
|
-
const template$
|
|
24170
|
+
const template$q = html `<template slot="mapping"></template>`;
|
|
24170
24171
|
|
|
24171
24172
|
/**
|
|
24172
24173
|
* Defines a mapping from one data value ('key' property) to display text ('text' property).
|
|
@@ -24180,7 +24181,7 @@
|
|
|
24180
24181
|
], MappingText.prototype, "text", void 0);
|
|
24181
24182
|
const textMapping = MappingText.compose({
|
|
24182
24183
|
baseName: 'mapping-text',
|
|
24183
|
-
template: template$
|
|
24184
|
+
template: template$q
|
|
24184
24185
|
});
|
|
24185
24186
|
DesignSystem.getOrCreate().withPrefix('nimble').register(textMapping());
|
|
24186
24187
|
|
|
@@ -24243,7 +24244,7 @@
|
|
|
24243
24244
|
], MappingIcon.prototype, "resolvedIcon", void 0);
|
|
24244
24245
|
const iconMapping = MappingIcon.compose({
|
|
24245
24246
|
baseName: 'mapping-icon',
|
|
24246
|
-
template: template$
|
|
24247
|
+
template: template$q
|
|
24247
24248
|
});
|
|
24248
24249
|
DesignSystem.getOrCreate().withPrefix('nimble').register(iconMapping());
|
|
24249
24250
|
|
|
@@ -24259,7 +24260,7 @@
|
|
|
24259
24260
|
], MappingSpinner.prototype, "text", void 0);
|
|
24260
24261
|
const spinnerMapping = MappingSpinner.compose({
|
|
24261
24262
|
baseName: 'mapping-spinner',
|
|
24262
|
-
template: template$
|
|
24263
|
+
template: template$q
|
|
24263
24264
|
});
|
|
24264
24265
|
DesignSystem.getOrCreate().withPrefix('nimble').register(spinnerMapping());
|
|
24265
24266
|
|
|
@@ -24353,7 +24354,7 @@
|
|
|
24353
24354
|
`;
|
|
24354
24355
|
|
|
24355
24356
|
// prettier-ignore
|
|
24356
|
-
const template$
|
|
24357
|
+
const template$p = html `
|
|
24357
24358
|
<template
|
|
24358
24359
|
?open="${x => x.open}"
|
|
24359
24360
|
@focusout="${(x, c) => x.focusoutHandler(c.event)}"
|
|
@@ -24608,7 +24609,7 @@
|
|
|
24608
24609
|
], MenuButton.prototype, "slottedMenus", void 0);
|
|
24609
24610
|
const nimbleMenuButton = MenuButton.compose({
|
|
24610
24611
|
baseName: 'menu-button',
|
|
24611
|
-
template: template$
|
|
24612
|
+
template: template$p,
|
|
24612
24613
|
styles: styles$y,
|
|
24613
24614
|
shadowOptions: {
|
|
24614
24615
|
delegatesFocus: true
|
|
@@ -42157,7 +42158,7 @@ img.ProseMirror-separator {
|
|
|
42157
42158
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleListbox());
|
|
42158
42159
|
|
|
42159
42160
|
// prettier-ignore
|
|
42160
|
-
const template$
|
|
42161
|
+
const template$o = html `
|
|
42161
42162
|
<template>
|
|
42162
42163
|
<${anchoredRegionTag}
|
|
42163
42164
|
${ref('region')}
|
|
@@ -42418,7 +42419,7 @@ img.ProseMirror-separator {
|
|
|
42418
42419
|
], RichTextMentionListbox.prototype, "anchorElement", void 0);
|
|
42419
42420
|
const nimbleRichTextMentionListbox = RichTextMentionListbox.compose({
|
|
42420
42421
|
baseName: 'rich-text-mention-listbox',
|
|
42421
|
-
template: template$
|
|
42422
|
+
template: template$o,
|
|
42422
42423
|
styles: styles$s
|
|
42423
42424
|
});
|
|
42424
42425
|
DesignSystem.getOrCreate()
|
|
@@ -42427,7 +42428,7 @@ img.ProseMirror-separator {
|
|
|
42427
42428
|
const richTextMentionListboxTag = 'nimble-rich-text-mention-listbox';
|
|
42428
42429
|
|
|
42429
42430
|
// prettier-ignore
|
|
42430
|
-
const template$
|
|
42431
|
+
const template$n = html `
|
|
42431
42432
|
<template
|
|
42432
42433
|
${children$1({ property: 'childItems', filter: elements() })}
|
|
42433
42434
|
@focusout="${x => x.focusoutHandler()}"
|
|
@@ -42546,6 +42547,7 @@ img.ProseMirror-separator {
|
|
|
42546
42547
|
/** Initial height of rich text editor with one line space when the footer is visible. */ ''}
|
|
42547
42548
|
height: 82px;
|
|
42548
42549
|
--ni-private-rich-text-editor-footer-section-height: 40px;
|
|
42550
|
+
--ni-private-rich-text-editor-footer-section-border-top-width: 2px;
|
|
42549
42551
|
${
|
|
42550
42552
|
/** Minimum width is added to accommodate all the possible buttons in the toolbar and to support the mobile width. */ ''}
|
|
42551
42553
|
min-width: 360px;
|
|
@@ -42739,8 +42741,11 @@ img.ProseMirror-separator {
|
|
|
42739
42741
|
display: flex;
|
|
42740
42742
|
justify-content: space-between;
|
|
42741
42743
|
flex-shrink: 0;
|
|
42742
|
-
border:
|
|
42743
|
-
border-top
|
|
42744
|
+
border: 0px;
|
|
42745
|
+
border-top: var(
|
|
42746
|
+
--ni-private-rich-text-editor-footer-section-border-top-width
|
|
42747
|
+
)
|
|
42748
|
+
solid rgba(${borderRgbPartialColor}, 0.1);
|
|
42744
42749
|
height: var(--ni-private-rich-text-editor-footer-section-height);
|
|
42745
42750
|
overflow: hidden;
|
|
42746
42751
|
}
|
|
@@ -42749,15 +42754,23 @@ img.ProseMirror-separator {
|
|
|
42749
42754
|
display: none;
|
|
42750
42755
|
}
|
|
42751
42756
|
|
|
42752
|
-
|
|
42757
|
+
${toolbarTag}::part(positioning-region) {
|
|
42753
42758
|
background: transparent;
|
|
42754
42759
|
padding-right: 8px;
|
|
42760
|
+
box-sizing: border-box;
|
|
42761
|
+
gap: 0px;
|
|
42762
|
+
height: var(--ni-private-rich-text-editor-footer-section-height);
|
|
42755
42763
|
}
|
|
42756
42764
|
|
|
42757
|
-
|
|
42765
|
+
${toolbarTag}::part(start) {
|
|
42758
42766
|
gap: 8px;
|
|
42759
42767
|
}
|
|
42760
42768
|
|
|
42769
|
+
${buttonTag},
|
|
42770
|
+
${toggleButtonTag} {
|
|
42771
|
+
height: ${controlSlimHeight};
|
|
42772
|
+
}
|
|
42773
|
+
|
|
42761
42774
|
.footer-actions {
|
|
42762
42775
|
display: flex;
|
|
42763
42776
|
justify-content: flex-end;
|
|
@@ -42766,6 +42779,13 @@ img.ProseMirror-separator {
|
|
|
42766
42779
|
place-items: center;
|
|
42767
42780
|
}
|
|
42768
42781
|
|
|
42782
|
+
::slotted(${buttonTag}),
|
|
42783
|
+
::slotted(${toggleButtonTag}),
|
|
42784
|
+
::slotted(${anchorButtonTag}),
|
|
42785
|
+
::slotted(${menuButtonTag}) {
|
|
42786
|
+
height: ${controlSlimHeight};
|
|
42787
|
+
}
|
|
42788
|
+
|
|
42769
42789
|
:host([error-visible]) .error-icon {
|
|
42770
42790
|
display: none;
|
|
42771
42791
|
}
|
|
@@ -52360,6 +52380,13 @@ img.ProseMirror-separator {
|
|
|
52360
52380
|
}
|
|
52361
52381
|
}
|
|
52362
52382
|
|
|
52383
|
+
async function waitUntilCustomElementsDefinedAsync(elements) {
|
|
52384
|
+
const definedElements = elements.map(async (item) => (item.matches(':not(:defined)')
|
|
52385
|
+
? customElements.whenDefined(item.localName)
|
|
52386
|
+
: Promise.resolve()));
|
|
52387
|
+
await Promise.all(definedElements);
|
|
52388
|
+
}
|
|
52389
|
+
|
|
52363
52390
|
/**
|
|
52364
52391
|
* Base class for rich text components
|
|
52365
52392
|
*/
|
|
@@ -52395,10 +52422,7 @@ img.ProseMirror-separator {
|
|
|
52395
52422
|
void this.updateMentionElementsFromChildItems();
|
|
52396
52423
|
}
|
|
52397
52424
|
async updateMentionElementsFromChildItems() {
|
|
52398
|
-
|
|
52399
|
-
? customElements.whenDefined(item.localName)
|
|
52400
|
-
: Promise.resolve()));
|
|
52401
|
-
await Promise.all(definedElements);
|
|
52425
|
+
await waitUntilCustomElementsDefinedAsync(this.childItems);
|
|
52402
52426
|
this.mentionElements = this.childItems.filter((x) => x instanceof RichTextMention);
|
|
52403
52427
|
}
|
|
52404
52428
|
observeMentionInternals() {
|
|
@@ -56853,7 +56877,7 @@ img.ProseMirror-separator {
|
|
|
56853
56877
|
applyMixins(RichTextEditor, ARIAGlobalStatesAndProperties);
|
|
56854
56878
|
const nimbleRichTextEditor = RichTextEditor.compose({
|
|
56855
56879
|
baseName: 'rich-text-editor',
|
|
56856
|
-
template: template$
|
|
56880
|
+
template: template$n,
|
|
56857
56881
|
styles: styles$q,
|
|
56858
56882
|
shadowOptions: {
|
|
56859
56883
|
delegatesFocus: true
|
|
@@ -56863,7 +56887,7 @@ img.ProseMirror-separator {
|
|
|
56863
56887
|
.withPrefix('nimble')
|
|
56864
56888
|
.register(nimbleRichTextEditor());
|
|
56865
56889
|
|
|
56866
|
-
const template$
|
|
56890
|
+
const template$m = html `
|
|
56867
56891
|
<template ${children$1({ property: 'childItems', filter: elements() })}>
|
|
56868
56892
|
<div ${ref('viewer')} class="viewer"></div>
|
|
56869
56893
|
</template>
|
|
@@ -56978,7 +57002,7 @@ img.ProseMirror-separator {
|
|
|
56978
57002
|
], RichTextViewer.prototype, "markdown", void 0);
|
|
56979
57003
|
const nimbleRichTextViewer = RichTextViewer.compose({
|
|
56980
57004
|
baseName: 'rich-text-viewer',
|
|
56981
|
-
template: template$
|
|
57005
|
+
template: template$m,
|
|
56982
57006
|
styles: styles$p
|
|
56983
57007
|
});
|
|
56984
57008
|
DesignSystem.getOrCreate()
|
|
@@ -57015,7 +57039,7 @@ img.ProseMirror-separator {
|
|
|
57015
57039
|
`));
|
|
57016
57040
|
|
|
57017
57041
|
// prettier-ignore
|
|
57018
|
-
const template$
|
|
57042
|
+
const template$l = (context, definition) => html `
|
|
57019
57043
|
<template
|
|
57020
57044
|
class="${x => [
|
|
57021
57045
|
x.collapsible && 'collapsible',
|
|
@@ -57158,7 +57182,7 @@ img.ProseMirror-separator {
|
|
|
57158
57182
|
const nimbleSelect = Select.compose({
|
|
57159
57183
|
baseName: 'select',
|
|
57160
57184
|
baseClass: Select$1,
|
|
57161
|
-
template: template$
|
|
57185
|
+
template: template$l,
|
|
57162
57186
|
styles: styles$o,
|
|
57163
57187
|
indicator: arrowExpanderDown16X16.data,
|
|
57164
57188
|
end: html `
|
|
@@ -57333,7 +57357,7 @@ img.ProseMirror-separator {
|
|
|
57333
57357
|
}
|
|
57334
57358
|
`));
|
|
57335
57359
|
|
|
57336
|
-
const template$
|
|
57360
|
+
const template$k = html `
|
|
57337
57361
|
<template role="progressbar">
|
|
57338
57362
|
<div class="container">
|
|
57339
57363
|
<div class="bit1"></div>
|
|
@@ -57371,7 +57395,7 @@ img.ProseMirror-separator {
|
|
|
57371
57395
|
], Spinner.prototype, "appearance", void 0);
|
|
57372
57396
|
const nimbleSpinner = Spinner.compose({
|
|
57373
57397
|
baseName: 'spinner',
|
|
57374
|
-
template: template$
|
|
57398
|
+
template: template$k,
|
|
57375
57399
|
styles: styles$n
|
|
57376
57400
|
});
|
|
57377
57401
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSpinner());
|
|
@@ -57540,7 +57564,7 @@ img.ProseMirror-separator {
|
|
|
57540
57564
|
`));
|
|
57541
57565
|
|
|
57542
57566
|
// prettier-ignore
|
|
57543
|
-
const template$
|
|
57567
|
+
const template$j = html `
|
|
57544
57568
|
<template
|
|
57545
57569
|
role="switch"
|
|
57546
57570
|
aria-checked="${x => x.checked}"
|
|
@@ -57584,7 +57608,7 @@ img.ProseMirror-separator {
|
|
|
57584
57608
|
const nimbleSwitch = Switch.compose({
|
|
57585
57609
|
baseClass: Switch$1,
|
|
57586
57610
|
baseName: 'switch',
|
|
57587
|
-
template: template$
|
|
57611
|
+
template: template$j,
|
|
57588
57612
|
styles: styles$m
|
|
57589
57613
|
});
|
|
57590
57614
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSwitch());
|
|
@@ -61764,7 +61788,7 @@ img.ProseMirror-separator {
|
|
|
61764
61788
|
`;
|
|
61765
61789
|
|
|
61766
61790
|
// prettier-ignore
|
|
61767
|
-
const template$
|
|
61791
|
+
const template$i = html `
|
|
61768
61792
|
<template role="columnheader"
|
|
61769
61793
|
aria-sort="${x => x.ariaSort}"
|
|
61770
61794
|
${'' /* Prevent header double clicks from selecting text */}
|
|
@@ -61838,7 +61862,7 @@ img.ProseMirror-separator {
|
|
|
61838
61862
|
], TableHeader.prototype, "isGrouped", void 0);
|
|
61839
61863
|
const nimbleTableHeader = TableHeader.compose({
|
|
61840
61864
|
baseName: 'table-header',
|
|
61841
|
-
template: template$
|
|
61865
|
+
template: template$i,
|
|
61842
61866
|
styles: styles$i
|
|
61843
61867
|
});
|
|
61844
61868
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableHeader());
|
|
@@ -62009,7 +62033,7 @@ img.ProseMirror-separator {
|
|
|
62009
62033
|
`;
|
|
62010
62034
|
|
|
62011
62035
|
// prettier-ignore
|
|
62012
|
-
const template$
|
|
62036
|
+
const template$h = html `
|
|
62013
62037
|
<template role="cell" style="--ni-private-table-cell-nesting-level: ${x => x.nestingLevel}">
|
|
62014
62038
|
${x => x.cellViewTemplate}
|
|
62015
62039
|
${when(x => x.hasActionMenu, html `
|
|
@@ -62078,14 +62102,14 @@ img.ProseMirror-separator {
|
|
|
62078
62102
|
], TableCell.prototype, "nestingLevel", void 0);
|
|
62079
62103
|
const nimbleTableCell = TableCell.compose({
|
|
62080
62104
|
baseName: 'table-cell',
|
|
62081
|
-
template: template$
|
|
62105
|
+
template: template$h,
|
|
62082
62106
|
styles: styles$f
|
|
62083
62107
|
});
|
|
62084
62108
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableCell());
|
|
62085
62109
|
const tableCellTag = 'nimble-table-cell';
|
|
62086
62110
|
|
|
62087
62111
|
// prettier-ignore
|
|
62088
|
-
const template$
|
|
62112
|
+
const template$g = html `
|
|
62089
62113
|
<template
|
|
62090
62114
|
role="row"
|
|
62091
62115
|
aria-selected=${x => x.ariaSelected}
|
|
@@ -62392,7 +62416,7 @@ img.ProseMirror-separator {
|
|
|
62392
62416
|
], TableRow.prototype, "ariaSelected", null);
|
|
62393
62417
|
const nimbleTableRow = TableRow.compose({
|
|
62394
62418
|
baseName: 'table-row',
|
|
62395
|
-
template: template$
|
|
62419
|
+
template: template$g,
|
|
62396
62420
|
styles: styles$g
|
|
62397
62421
|
});
|
|
62398
62422
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableRow());
|
|
@@ -62487,7 +62511,7 @@ img.ProseMirror-separator {
|
|
|
62487
62511
|
|
|
62488
62512
|
/* eslint-disable @typescript-eslint/indent */
|
|
62489
62513
|
// prettier-ignore
|
|
62490
|
-
const template$
|
|
62514
|
+
const template$f = html `
|
|
62491
62515
|
<template
|
|
62492
62516
|
role="row"
|
|
62493
62517
|
@click=${x => x.onGroupExpandToggle()}
|
|
@@ -62625,14 +62649,14 @@ img.ProseMirror-separator {
|
|
|
62625
62649
|
], TableGroupRow.prototype, "animationClass", void 0);
|
|
62626
62650
|
const nimbleTableGroupRow = TableGroupRow.compose({
|
|
62627
62651
|
baseName: 'table-group-row',
|
|
62628
|
-
template: template$
|
|
62652
|
+
template: template$f,
|
|
62629
62653
|
styles: styles$e
|
|
62630
62654
|
});
|
|
62631
62655
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableGroupRow());
|
|
62632
62656
|
const tableGroupRowTag = 'nimble-table-group-row';
|
|
62633
62657
|
|
|
62634
62658
|
// prettier-ignore
|
|
62635
|
-
const template$
|
|
62659
|
+
const template$e = html `
|
|
62636
62660
|
<template
|
|
62637
62661
|
role="grid"
|
|
62638
62662
|
aria-multiselectable="${x => x.ariaMultiSelectable}"
|
|
@@ -64713,10 +64737,7 @@ img.ProseMirror-separator {
|
|
|
64713
64737
|
void this.updateColumnsFromChildItems();
|
|
64714
64738
|
}
|
|
64715
64739
|
async updateColumnsFromChildItems() {
|
|
64716
|
-
|
|
64717
|
-
? customElements.whenDefined(item.localName)
|
|
64718
|
-
: Promise.resolve()));
|
|
64719
|
-
await Promise.all(definedElements);
|
|
64740
|
+
await waitUntilCustomElementsDefinedAsync(this.childItems);
|
|
64720
64741
|
this.columns = this.childItems.filter((x) => x instanceof TableColumn);
|
|
64721
64742
|
}
|
|
64722
64743
|
updateTanStack() {
|
|
@@ -65019,7 +65040,7 @@ img.ProseMirror-separator {
|
|
|
65019
65040
|
], Table.prototype, "documentShiftKeyDown", void 0);
|
|
65020
65041
|
const nimbleTable = Table.compose({
|
|
65021
65042
|
baseName: 'table',
|
|
65022
|
-
template: template$
|
|
65043
|
+
template: template$e,
|
|
65023
65044
|
styles: styles$j
|
|
65024
65045
|
});
|
|
65025
65046
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTable());
|
|
@@ -65039,7 +65060,7 @@ img.ProseMirror-separator {
|
|
|
65039
65060
|
// Avoiding a wrapping <template> and be careful about starting and ending whitspace
|
|
65040
65061
|
// so the template can be composed into other column header templates
|
|
65041
65062
|
// prettier-ignore
|
|
65042
|
-
const template$
|
|
65063
|
+
const template$d = html `<span
|
|
65043
65064
|
${overflow('hasOverflow')}
|
|
65044
65065
|
class="header-content"
|
|
65045
65066
|
title=${x => (x.hasOverflow && x.headerTextContent ? x.headerTextContent : null)}
|
|
@@ -65140,7 +65161,7 @@ img.ProseMirror-separator {
|
|
|
65140
65161
|
|
|
65141
65162
|
/* eslint-disable @typescript-eslint/indent */
|
|
65142
65163
|
// prettier-ignore
|
|
65143
|
-
const template$
|
|
65164
|
+
const template$c = html `
|
|
65144
65165
|
<template
|
|
65145
65166
|
@click="${(x, c) => {
|
|
65146
65167
|
if (typeof x.cellRecord?.href === 'string') {
|
|
@@ -65207,7 +65228,7 @@ img.ProseMirror-separator {
|
|
|
65207
65228
|
], TableColumnAnchorCellView.prototype, "text", null);
|
|
65208
65229
|
const anchorCellView = TableColumnAnchorCellView.compose({
|
|
65209
65230
|
baseName: 'table-column-anchor-cell-view',
|
|
65210
|
-
template: template$
|
|
65231
|
+
template: template$c,
|
|
65211
65232
|
styles: styles$c
|
|
65212
65233
|
});
|
|
65213
65234
|
DesignSystem.getOrCreate().withPrefix('nimble').register(anchorCellView());
|
|
@@ -65234,7 +65255,7 @@ img.ProseMirror-separator {
|
|
|
65234
65255
|
observable
|
|
65235
65256
|
], TableColumnTextGroupHeaderViewBase.prototype, "text", void 0);
|
|
65236
65257
|
|
|
65237
|
-
const template$
|
|
65258
|
+
const template$b = html `
|
|
65238
65259
|
<span
|
|
65239
65260
|
${overflow('hasOverflow')}
|
|
65240
65261
|
title="${x => (x.hasOverflow && x.text ? x.text : null)}"
|
|
@@ -65265,7 +65286,7 @@ img.ProseMirror-separator {
|
|
|
65265
65286
|
}
|
|
65266
65287
|
const tableColumnTextGroupHeaderView = TableColumnTextGroupHeaderView.compose({
|
|
65267
65288
|
baseName: 'table-column-text-group-header-view',
|
|
65268
|
-
template: template$
|
|
65289
|
+
template: template$b,
|
|
65269
65290
|
styles: styles$b
|
|
65270
65291
|
});
|
|
65271
65292
|
DesignSystem.getOrCreate()
|
|
@@ -65379,7 +65400,7 @@ img.ProseMirror-separator {
|
|
|
65379
65400
|
], TableColumnAnchor.prototype, "download", void 0);
|
|
65380
65401
|
const nimbleTableColumnAnchor = TableColumnAnchor.compose({
|
|
65381
65402
|
baseName: 'table-column-anchor',
|
|
65382
|
-
template: template$
|
|
65403
|
+
template: template$d,
|
|
65383
65404
|
styles: styles$d
|
|
65384
65405
|
});
|
|
65385
65406
|
DesignSystem.getOrCreate()
|
|
@@ -65434,7 +65455,7 @@ img.ProseMirror-separator {
|
|
|
65434
65455
|
}
|
|
65435
65456
|
const tableColumnDateTextGroupHeaderView = TableColumnDateTextGroupHeaderView.compose({
|
|
65436
65457
|
baseName: 'table-column-date-text-group-header-view',
|
|
65437
|
-
template: template$
|
|
65458
|
+
template: template$b,
|
|
65438
65459
|
styles: styles$b
|
|
65439
65460
|
});
|
|
65440
65461
|
DesignSystem.getOrCreate()
|
|
@@ -65450,7 +65471,7 @@ img.ProseMirror-separator {
|
|
|
65450
65471
|
right: 'right'
|
|
65451
65472
|
};
|
|
65452
65473
|
|
|
65453
|
-
const template$
|
|
65474
|
+
const template$a = html `
|
|
65454
65475
|
<template
|
|
65455
65476
|
class="${x => (x.alignment === TextCellViewBaseAlignment.right
|
|
65456
65477
|
? 'right-align'
|
|
@@ -65528,7 +65549,7 @@ img.ProseMirror-separator {
|
|
|
65528
65549
|
}
|
|
65529
65550
|
const dateTextCellView = TableColumnDateTextCellView.compose({
|
|
65530
65551
|
baseName: 'table-column-date-text-cell-view',
|
|
65531
|
-
template: template$
|
|
65552
|
+
template: template$a,
|
|
65532
65553
|
styles: styles$a
|
|
65533
65554
|
});
|
|
65534
65555
|
DesignSystem.getOrCreate().withPrefix('nimble').register(dateTextCellView());
|
|
@@ -65832,7 +65853,7 @@ img.ProseMirror-separator {
|
|
|
65832
65853
|
], TableColumnDateText.prototype, "customHourCycle", void 0);
|
|
65833
65854
|
const nimbleTableColumnDateText = TableColumnDateText.compose({
|
|
65834
65855
|
baseName: 'table-column-date-text',
|
|
65835
|
-
template: template$
|
|
65856
|
+
template: template$d,
|
|
65836
65857
|
styles: styles$d
|
|
65837
65858
|
});
|
|
65838
65859
|
DesignSystem.getOrCreate()
|
|
@@ -65855,7 +65876,7 @@ img.ProseMirror-separator {
|
|
|
65855
65876
|
}
|
|
65856
65877
|
const durationTextCellView = TableColumnDurationTextCellView.compose({
|
|
65857
65878
|
baseName: 'table-column-duration-text-cell-view',
|
|
65858
|
-
template: template$
|
|
65879
|
+
template: template$a,
|
|
65859
65880
|
styles: styles$a
|
|
65860
65881
|
});
|
|
65861
65882
|
DesignSystem.getOrCreate()
|
|
@@ -65963,7 +65984,7 @@ img.ProseMirror-separator {
|
|
|
65963
65984
|
}
|
|
65964
65985
|
const tableColumnDurationTextGroupHeaderView = TableColumnDurationTextGroupHeaderView.compose({
|
|
65965
65986
|
baseName: 'table-column-duration-text-group-header-view',
|
|
65966
|
-
template: template$
|
|
65987
|
+
template: template$b,
|
|
65967
65988
|
styles: styles$b
|
|
65968
65989
|
});
|
|
65969
65990
|
DesignSystem.getOrCreate()
|
|
@@ -66016,7 +66037,7 @@ img.ProseMirror-separator {
|
|
|
66016
66037
|
}
|
|
66017
66038
|
const nimbleTableColumnDurationText = TableColumnDurationText.compose({
|
|
66018
66039
|
baseName: 'table-column-duration-text',
|
|
66019
|
-
template: template$
|
|
66040
|
+
template: template$d,
|
|
66020
66041
|
styles: styles$d
|
|
66021
66042
|
});
|
|
66022
66043
|
DesignSystem.getOrCreate()
|
|
@@ -66137,7 +66158,7 @@ img.ProseMirror-separator {
|
|
|
66137
66158
|
}
|
|
66138
66159
|
`;
|
|
66139
66160
|
|
|
66140
|
-
const template$
|
|
66161
|
+
const template$9 = html `${template$d}<slot ${slotted('mappings')} name="mapping"></slot>`;
|
|
66141
66162
|
|
|
66142
66163
|
const enumBaseValidityFlagNames = [
|
|
66143
66164
|
'invalidMappingKeyValueForType',
|
|
@@ -66248,7 +66269,7 @@ img.ProseMirror-separator {
|
|
|
66248
66269
|
}
|
|
66249
66270
|
const enumTextCellView = TableColumnEnumTextCellView.compose({
|
|
66250
66271
|
baseName: 'table-column-enum-text-cell-view',
|
|
66251
|
-
template: template$
|
|
66272
|
+
template: template$a,
|
|
66252
66273
|
styles: styles$a
|
|
66253
66274
|
});
|
|
66254
66275
|
DesignSystem.getOrCreate().withPrefix('nimble').register(enumTextCellView());
|
|
@@ -66278,7 +66299,7 @@ img.ProseMirror-separator {
|
|
|
66278
66299
|
}
|
|
66279
66300
|
const enumTextGroupHeaderView = TableColumnEnumTextGroupHeaderView.compose({
|
|
66280
66301
|
baseName: 'table-column-enum-text-group-header-view',
|
|
66281
|
-
template: template$
|
|
66302
|
+
template: template$b,
|
|
66282
66303
|
styles: styles$b
|
|
66283
66304
|
});
|
|
66284
66305
|
DesignSystem.getOrCreate()
|
|
@@ -66321,13 +66342,25 @@ img.ProseMirror-separator {
|
|
|
66321
66342
|
}
|
|
66322
66343
|
const nimbleTableColumnEnumText = TableColumnEnumText.compose({
|
|
66323
66344
|
baseName: 'table-column-enum-text',
|
|
66324
|
-
template: template$
|
|
66345
|
+
template: template$9,
|
|
66325
66346
|
styles: styles$9
|
|
66326
66347
|
});
|
|
66327
66348
|
DesignSystem.getOrCreate()
|
|
66328
66349
|
.withPrefix('nimble')
|
|
66329
66350
|
.register(nimbleTableColumnEnumText());
|
|
66330
66351
|
|
|
66352
|
+
// Avoiding a wrapping <template> and be careful about starting and ending whitespace
|
|
66353
|
+
// so the template can be composed into other column header templates
|
|
66354
|
+
// prettier-ignore
|
|
66355
|
+
const template$8 = html `<span
|
|
66356
|
+
${overflow('hasOverflow')}
|
|
66357
|
+
class="header-content"
|
|
66358
|
+
title=${x => (x.hasOverflow && x.headerTextContent ? x.headerTextContent : null)}
|
|
66359
|
+
>
|
|
66360
|
+
<slot ${ref('contentSlot')}></slot>
|
|
66361
|
+
<slot ${slotted({ property: 'unitElements', filter: elements() })} name="unit"></slot>
|
|
66362
|
+
</span>`;
|
|
66363
|
+
|
|
66331
66364
|
/**
|
|
66332
66365
|
* The group header view for displaying number fields as text.
|
|
66333
66366
|
*/
|
|
@@ -66339,13 +66372,12 @@ img.ProseMirror-separator {
|
|
|
66339
66372
|
this.updateText();
|
|
66340
66373
|
}
|
|
66341
66374
|
updateText() {
|
|
66342
|
-
this.text = this.columnConfig?.formatter?.
|
|
66343
|
-
?? '';
|
|
66375
|
+
this.text = this.columnConfig?.formatter?.format(this.groupHeaderValue) ?? '';
|
|
66344
66376
|
}
|
|
66345
66377
|
}
|
|
66346
66378
|
const tableColumnNumberTextGroupHeaderView = TableColumnNumberTextGroupHeaderView.compose({
|
|
66347
66379
|
baseName: 'table-column-number-text-group-header-view',
|
|
66348
|
-
template: template$
|
|
66380
|
+
template: template$b,
|
|
66349
66381
|
styles: styles$b
|
|
66350
66382
|
});
|
|
66351
66383
|
DesignSystem.getOrCreate()
|
|
@@ -66365,13 +66397,12 @@ img.ProseMirror-separator {
|
|
|
66365
66397
|
this.updateText();
|
|
66366
66398
|
}
|
|
66367
66399
|
updateText() {
|
|
66368
|
-
this.text = this.columnConfig?.formatter?.
|
|
66369
|
-
?? '';
|
|
66400
|
+
this.text = this.columnConfig?.formatter?.format(this.cellRecord?.value) ?? '';
|
|
66370
66401
|
}
|
|
66371
66402
|
}
|
|
66372
66403
|
const numberTextCellView = TableColumnNumberTextCellView.compose({
|
|
66373
66404
|
baseName: 'table-column-number-text-cell-view',
|
|
66374
|
-
template: template$
|
|
66405
|
+
template: template$a,
|
|
66375
66406
|
styles: styles$a
|
|
66376
66407
|
});
|
|
66377
66408
|
DesignSystem.getOrCreate().withPrefix('nimble').register(numberTextCellView());
|
|
@@ -66395,19 +66426,19 @@ img.ProseMirror-separator {
|
|
|
66395
66426
|
};
|
|
66396
66427
|
|
|
66397
66428
|
/**
|
|
66398
|
-
* The base class for
|
|
66429
|
+
* The base class for unit formats.
|
|
66399
66430
|
*/
|
|
66400
|
-
class
|
|
66431
|
+
class UnitFormat {
|
|
66401
66432
|
/**
|
|
66402
|
-
*
|
|
66403
|
-
*
|
|
66433
|
+
* Formats a number value to a string.
|
|
66434
|
+
* For nullish values or values that result in an exception being thrown, empty string is returned
|
|
66404
66435
|
*/
|
|
66405
|
-
|
|
66436
|
+
format(value) {
|
|
66406
66437
|
if (typeof value !== 'number') {
|
|
66407
66438
|
return '';
|
|
66408
66439
|
}
|
|
66409
66440
|
try {
|
|
66410
|
-
return this.
|
|
66441
|
+
return this.tryFormat(value);
|
|
66411
66442
|
}
|
|
66412
66443
|
catch {
|
|
66413
66444
|
return '';
|
|
@@ -66416,81 +66447,254 @@ img.ProseMirror-separator {
|
|
|
66416
66447
|
}
|
|
66417
66448
|
|
|
66418
66449
|
/**
|
|
66419
|
-
*
|
|
66450
|
+
* A class that knows how to format a numeric value as a string that includes units.
|
|
66451
|
+
*/
|
|
66452
|
+
class ScaledUnitFormat {
|
|
66453
|
+
constructor(scaledUnitFormatFactoryOptions) {
|
|
66454
|
+
this.locale = scaledUnitFormatFactoryOptions.locale;
|
|
66455
|
+
this.intlNumberFormatOptions = scaledUnitFormatFactoryOptions.intlNumberFormatOptions;
|
|
66456
|
+
}
|
|
66457
|
+
}
|
|
66458
|
+
|
|
66459
|
+
/**
|
|
66460
|
+
* A formatter for units that can be formatted/translated by Intl.NumberFormat
|
|
66461
|
+
*/
|
|
66462
|
+
class IntlNumberFormatScaledUnitFormat extends ScaledUnitFormat {
|
|
66463
|
+
constructor(scaledUnitFormatFactoryOptions, unitSpecificIntlNumberFormatOptions = {}) {
|
|
66464
|
+
super(scaledUnitFormatFactoryOptions);
|
|
66465
|
+
this.formatter = new Intl.NumberFormat(this.locale, {
|
|
66466
|
+
...unitSpecificIntlNumberFormatOptions,
|
|
66467
|
+
// Application configured options override unit specific options
|
|
66468
|
+
...this.intlNumberFormatOptions
|
|
66469
|
+
});
|
|
66470
|
+
}
|
|
66471
|
+
static createFactory(unitSpecificIntlNumberFormatOptions = {}) {
|
|
66472
|
+
return (scaledUnitFormatFactoryOptions) => new IntlNumberFormatScaledUnitFormat(scaledUnitFormatFactoryOptions, unitSpecificIntlNumberFormatOptions);
|
|
66473
|
+
}
|
|
66474
|
+
format(value) {
|
|
66475
|
+
return this.formatter.format(value);
|
|
66476
|
+
}
|
|
66477
|
+
}
|
|
66478
|
+
|
|
66479
|
+
/**
|
|
66480
|
+
* A unit that represents a scaled version of a base unit.
|
|
66481
|
+
*/
|
|
66482
|
+
class ScaledUnit {
|
|
66483
|
+
constructor(scaleFactor, scaledUnitFormatFactory) {
|
|
66484
|
+
this.scaleFactor = scaleFactor;
|
|
66485
|
+
this.scaledUnitFormatFactory = scaledUnitFormatFactory;
|
|
66486
|
+
}
|
|
66487
|
+
isBase() {
|
|
66488
|
+
return this.scaleFactor === 1;
|
|
66489
|
+
}
|
|
66490
|
+
}
|
|
66491
|
+
|
|
66492
|
+
/**
|
|
66493
|
+
* A unit scale consisting of a set of scaled units.
|
|
66494
|
+
*/
|
|
66495
|
+
class UnitScale {
|
|
66496
|
+
constructor(supportedScaledUnits) {
|
|
66497
|
+
this.supportedScaledUnits = supportedScaledUnits;
|
|
66498
|
+
const unitsSorted = supportedScaledUnits.every((curr, i, arr) => i === 0 || arr[i - 1].scaleFactor < curr.scaleFactor);
|
|
66499
|
+
if (!unitsSorted) {
|
|
66500
|
+
throw new Error('Supported scaled units must have unique and ordered scale factors');
|
|
66501
|
+
}
|
|
66502
|
+
const baseScaledUnit = supportedScaledUnits.find(x => x.isBase());
|
|
66503
|
+
if (!baseScaledUnit) {
|
|
66504
|
+
throw new Error('Supported scaled units must include a base scaled unit (scale factor=1)');
|
|
66505
|
+
}
|
|
66506
|
+
this.supportedScaledUnits = supportedScaledUnits;
|
|
66507
|
+
this.baseScaledUnit = baseScaledUnit;
|
|
66508
|
+
}
|
|
66509
|
+
// Note that for the sake of reducing complexity in the implementation,
|
|
66510
|
+
// we do NOT consider the effects of rounding when picking the unit to
|
|
66511
|
+
// use for a given value. If formatting results in rounding, a value
|
|
66512
|
+
// may be shown with an unexpected unit. Examples:
|
|
66513
|
+
// - 999 bytes with two significant digits => "1000 bytes" (instead of "1 kB")
|
|
66514
|
+
// - 0.00000000000000001 volts (= 0.01 fV) with one fractional digit => "0 fV" (instead of "0 volts")
|
|
66515
|
+
scaleNumber(number) {
|
|
66516
|
+
const magnitude = Math.abs(number);
|
|
66517
|
+
const onlyBaseScaledUnit = this.supportedScaledUnits.length === 1;
|
|
66518
|
+
if (onlyBaseScaledUnit
|
|
66519
|
+
|| magnitude === 0
|
|
66520
|
+
|| magnitude === Infinity
|
|
66521
|
+
|| Number.isNaN(magnitude)) {
|
|
66522
|
+
return { scaledValue: number, scaledUnit: this.baseScaledUnit };
|
|
66523
|
+
}
|
|
66524
|
+
for (let i = this.supportedScaledUnits.length - 1; i >= 0; i -= 1) {
|
|
66525
|
+
const scaledUnit = this.supportedScaledUnits[i];
|
|
66526
|
+
if (magnitude / scaledUnit.scaleFactor >= 1) {
|
|
66527
|
+
return {
|
|
66528
|
+
scaledValue: number / scaledUnit.scaleFactor,
|
|
66529
|
+
scaledUnit
|
|
66530
|
+
};
|
|
66531
|
+
}
|
|
66532
|
+
}
|
|
66533
|
+
const smallestUnit = this.supportedScaledUnits[0];
|
|
66534
|
+
return {
|
|
66535
|
+
scaledValue: number / smallestUnit.scaleFactor,
|
|
66536
|
+
scaledUnit: smallestUnit
|
|
66537
|
+
};
|
|
66538
|
+
}
|
|
66539
|
+
}
|
|
66540
|
+
|
|
66541
|
+
/**
|
|
66542
|
+
* Unit scale that is used to passthrough a number without applying scaling or units
|
|
66420
66543
|
*/
|
|
66421
|
-
class
|
|
66422
|
-
constructor(
|
|
66544
|
+
class PassthroughUnitScale extends UnitScale {
|
|
66545
|
+
constructor() {
|
|
66546
|
+
super([
|
|
66547
|
+
new ScaledUnit(10 ** 0, IntlNumberFormatScaledUnitFormat.createFactory())
|
|
66548
|
+
]);
|
|
66549
|
+
}
|
|
66550
|
+
}
|
|
66551
|
+
const passthroughUnitScale = new PassthroughUnitScale();
|
|
66552
|
+
|
|
66553
|
+
/**
|
|
66554
|
+
* Format for numbers with units to show in a tabular form.
|
|
66555
|
+
* Large and tiny numbers are shown exponentially and the rest as decimal.
|
|
66556
|
+
*/
|
|
66557
|
+
class DefaultUnitFormat extends UnitFormat {
|
|
66558
|
+
constructor(locale, { unitScale = passthroughUnitScale } = {
|
|
66559
|
+
unitScale: passthroughUnitScale
|
|
66560
|
+
}) {
|
|
66423
66561
|
super();
|
|
66424
|
-
|
|
66425
|
-
|
|
66562
|
+
// Format options to use by default. It renders the number with a maximum of 6 signficant digits.
|
|
66563
|
+
this.defaultIntlNumberFormatOptions = {
|
|
66564
|
+
maximumSignificantDigits: DefaultUnitFormat.maximumDigits,
|
|
66426
66565
|
useGrouping: true
|
|
66427
|
-
}
|
|
66428
|
-
this.
|
|
66429
|
-
|
|
66566
|
+
};
|
|
66567
|
+
this.defaultScaledUnitFormatters = new Map();
|
|
66568
|
+
// Format options to use for numbers that have leading zeros. It limits the number of rendered
|
|
66569
|
+
// digits using 'maximumFractionDigits', which will result in less than 6 significant digits
|
|
66570
|
+
// in order to render no more than 6 total digits.
|
|
66571
|
+
this.leadingZeroIntlNumberFormatOptions = {
|
|
66572
|
+
maximumFractionDigits: DefaultUnitFormat.maximumDigits - 1,
|
|
66430
66573
|
useGrouping: true
|
|
66431
|
-
}
|
|
66432
|
-
this.
|
|
66433
|
-
|
|
66574
|
+
};
|
|
66575
|
+
this.leadingZeroScaledUnitFormatters = new Map();
|
|
66576
|
+
// Format options for numbers that should be displayed in exponential notation. This should be used
|
|
66577
|
+
// for numbers with magintudes over 'exponentialUpperBound' or under 'exponentialLowerBound'.
|
|
66578
|
+
this.exponentialIntlNumberFormatOptions = {
|
|
66579
|
+
maximumSignificantDigits: DefaultUnitFormat.maximumDigits,
|
|
66434
66580
|
notation: 'scientific'
|
|
66581
|
+
};
|
|
66582
|
+
for (const unit of unitScale.supportedScaledUnits) {
|
|
66583
|
+
this.defaultScaledUnitFormatters.set(unit.scaleFactor, unit.scaledUnitFormatFactory({
|
|
66584
|
+
locale,
|
|
66585
|
+
intlNumberFormatOptions: this.defaultIntlNumberFormatOptions
|
|
66586
|
+
}));
|
|
66587
|
+
this.leadingZeroScaledUnitFormatters.set(unit.scaleFactor, unit.scaledUnitFormatFactory({
|
|
66588
|
+
locale,
|
|
66589
|
+
intlNumberFormatOptions: this.leadingZeroIntlNumberFormatOptions
|
|
66590
|
+
}));
|
|
66591
|
+
}
|
|
66592
|
+
this.exponentialScaledUnitFormatter = unitScale.baseScaledUnit.scaledUnitFormatFactory({
|
|
66593
|
+
locale,
|
|
66594
|
+
intlNumberFormatOptions: this.exponentialIntlNumberFormatOptions
|
|
66435
66595
|
});
|
|
66596
|
+
this.unitScale = unitScale;
|
|
66436
66597
|
}
|
|
66437
|
-
|
|
66438
|
-
|
|
66439
|
-
|
|
66440
|
-
|
|
66441
|
-
const formatter = this.getFormatterForNumber(valueToFormat);
|
|
66442
|
-
return formatter.format(valueToFormat);
|
|
66598
|
+
resolvedOptions() {
|
|
66599
|
+
return {
|
|
66600
|
+
unitScale: this.unitScale
|
|
66601
|
+
};
|
|
66443
66602
|
}
|
|
66444
|
-
|
|
66603
|
+
tryFormat(number) {
|
|
66604
|
+
// Normalize +0 / -0 --> +0
|
|
66605
|
+
const numberNormalized = number === 0 ? 0 : number;
|
|
66606
|
+
const { scaledValue, scaledUnit } = this.unitScale.scaleNumber(numberNormalized);
|
|
66607
|
+
const numberStyle = this.resolveNumberStyle(scaledValue);
|
|
66608
|
+
switch (numberStyle) {
|
|
66609
|
+
case 'default': {
|
|
66610
|
+
const scaledUnitFormatter = this.defaultScaledUnitFormatters.get(scaledUnit.scaleFactor);
|
|
66611
|
+
return scaledUnitFormatter.format(scaledValue);
|
|
66612
|
+
}
|
|
66613
|
+
case 'leadingZero': {
|
|
66614
|
+
const scaledUnitFormatter = this.leadingZeroScaledUnitFormatters.get(scaledUnit.scaleFactor);
|
|
66615
|
+
return scaledUnitFormatter.format(scaledValue);
|
|
66616
|
+
}
|
|
66617
|
+
case 'exponential': {
|
|
66618
|
+
const scaledUnitFormatter = this.exponentialScaledUnitFormatter;
|
|
66619
|
+
return scaledUnitFormatter.format(numberNormalized);
|
|
66620
|
+
}
|
|
66621
|
+
default:
|
|
66622
|
+
throw new Error('Unexpected number format style');
|
|
66623
|
+
}
|
|
66624
|
+
}
|
|
66625
|
+
resolveNumberStyle(number) {
|
|
66445
66626
|
if (number === 0) {
|
|
66446
|
-
return
|
|
66627
|
+
return 'default';
|
|
66447
66628
|
}
|
|
66448
66629
|
const absoluteValue = Math.abs(number);
|
|
66449
|
-
if (absoluteValue >=
|
|
66450
|
-
|| absoluteValue <
|
|
66451
|
-
return
|
|
66630
|
+
if (absoluteValue >= DefaultUnitFormat.exponentialUpperBound
|
|
66631
|
+
|| absoluteValue < DefaultUnitFormat.exponentialLowerBound) {
|
|
66632
|
+
return 'exponential';
|
|
66452
66633
|
}
|
|
66453
66634
|
// Ideally, we could set 'roundingPriority: "lessPrecision"' with a formatter that has both 'maximumSignificantDigits' and
|
|
66454
66635
|
// 'maximumFractionDigits' configured instead of having two different formatters that we conditionally choose between. However,
|
|
66455
|
-
// 'roundingPrioirty' is not supported yet in all browsers
|
|
66636
|
+
// 'roundingPrioirty' is not supported yet in all browsers.
|
|
66456
66637
|
if (absoluteValue < 1) {
|
|
66457
|
-
return
|
|
66638
|
+
return 'leadingZero';
|
|
66458
66639
|
}
|
|
66459
|
-
return
|
|
66640
|
+
return 'default';
|
|
66460
66641
|
}
|
|
66461
66642
|
}
|
|
66462
66643
|
// The maximum number of digits that should be rendered for any given value.
|
|
66463
|
-
|
|
66644
|
+
DefaultUnitFormat.maximumDigits = 6;
|
|
66464
66645
|
// Use exponential notation for numbers that will be rendered with 3 leading 0s or more.
|
|
66465
66646
|
// Because a maximum of 6 digits are rendered, showing more than 3 leading 0s is not ideal
|
|
66466
66647
|
// because then at least half of the displayed digits will be leading 0s.
|
|
66467
|
-
|
|
66648
|
+
DefaultUnitFormat.exponentialLowerBound = 0.000995;
|
|
66468
66649
|
// Use exponential formatting for numbers whose magnitude cannot otherwise be displayed
|
|
66469
66650
|
// with 6 digits or less.
|
|
66470
|
-
|
|
66651
|
+
DefaultUnitFormat.exponentialUpperBound = 999999.5;
|
|
66471
66652
|
|
|
66472
66653
|
/**
|
|
66473
|
-
*
|
|
66654
|
+
* Format for decimal numbers with units.
|
|
66474
66655
|
*/
|
|
66475
|
-
class
|
|
66476
|
-
constructor(locale, minimumFractionDigits, maximumFractionDigits) {
|
|
66656
|
+
class DecimalUnitFormat extends UnitFormat {
|
|
66657
|
+
constructor(locale, { minimumFractionDigits = 0, maximumFractionDigits = Math.max(3, minimumFractionDigits), unitScale = passthroughUnitScale } = {
|
|
66658
|
+
minimumFractionDigits: 0,
|
|
66659
|
+
maximumFractionDigits: 3,
|
|
66660
|
+
unitScale: passthroughUnitScale
|
|
66661
|
+
}) {
|
|
66477
66662
|
super();
|
|
66478
|
-
this.
|
|
66663
|
+
this.scaledUnitFormatters = new Map();
|
|
66664
|
+
const intlNumberFormatOptions = {
|
|
66479
66665
|
maximumFractionDigits,
|
|
66480
66666
|
minimumFractionDigits,
|
|
66481
66667
|
useGrouping: true
|
|
66482
|
-
}
|
|
66668
|
+
};
|
|
66669
|
+
for (const scaledUnit of unitScale.supportedScaledUnits) {
|
|
66670
|
+
this.scaledUnitFormatters.set(scaledUnit.scaleFactor, scaledUnit.scaledUnitFormatFactory({
|
|
66671
|
+
locale,
|
|
66672
|
+
intlNumberFormatOptions
|
|
66673
|
+
}));
|
|
66674
|
+
}
|
|
66483
66675
|
this.tenPowDecimalDigits = 10 ** maximumFractionDigits;
|
|
66676
|
+
this.unitScale = unitScale;
|
|
66677
|
+
this.minimumFractionDigits = minimumFractionDigits;
|
|
66678
|
+
this.maximumFractionDigits = maximumFractionDigits;
|
|
66679
|
+
}
|
|
66680
|
+
resolvedOptions() {
|
|
66681
|
+
return {
|
|
66682
|
+
unitScale: this.unitScale,
|
|
66683
|
+
maximumFractionDigits: this.maximumFractionDigits,
|
|
66684
|
+
minimumFractionDigits: this.minimumFractionDigits
|
|
66685
|
+
};
|
|
66484
66686
|
}
|
|
66485
|
-
|
|
66486
|
-
|
|
66487
|
-
|
|
66488
|
-
|
|
66489
|
-
|
|
66687
|
+
tryFormat(number) {
|
|
66688
|
+
const { scaledValue, scaledUnit } = this.unitScale.scaleNumber(number);
|
|
66689
|
+
const numberNormalized = this.willRoundToZero(scaledValue)
|
|
66690
|
+
? 0
|
|
66691
|
+
: scaledValue;
|
|
66692
|
+
const scaledUnitFormatter = this.scaledUnitFormatters.get(scaledUnit.scaleFactor);
|
|
66693
|
+
return scaledUnitFormatter.format(numberNormalized);
|
|
66490
66694
|
}
|
|
66491
66695
|
willRoundToZero(number) {
|
|
66492
|
-
// Multiply the value by 10 raised to
|
|
66493
|
-
//
|
|
66696
|
+
// Multiply the value by 10 raised to maximumFractionDigits so that Math.round can be used to emulate rounding to
|
|
66697
|
+
// maximumFractionDigits decimal places. If that rounded value is 0, then the value will be rendered with only 0s.
|
|
66494
66698
|
return Math.round(number * this.tenPowDecimalDigits) === 0;
|
|
66495
66699
|
}
|
|
66496
66700
|
}
|
|
@@ -66498,7 +66702,8 @@ img.ProseMirror-separator {
|
|
|
66498
66702
|
const numberTextValidityFlagNames = [
|
|
66499
66703
|
'invalidDecimalDigits',
|
|
66500
66704
|
'invalidDecimalMaximumDigits',
|
|
66501
|
-
'decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits'
|
|
66705
|
+
'decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits',
|
|
66706
|
+
'moreThanOneUnitSpecified'
|
|
66502
66707
|
];
|
|
66503
66708
|
// The maximum and minimum allowed configuration for 'maximumFractionDigits'
|
|
66504
66709
|
// and 'minimumFractionDigits' on the NumberFormat.
|
|
@@ -66535,12 +66740,25 @@ img.ProseMirror-separator {
|
|
|
66535
66740
|
: false;
|
|
66536
66741
|
this.setConditionValue('decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits', invalid);
|
|
66537
66742
|
}
|
|
66743
|
+
validateAtMostOneUnit(unitElements) {
|
|
66744
|
+
const invalid = unitElements.length > 1;
|
|
66745
|
+
this.setConditionValue('moreThanOneUnitSpecified', invalid);
|
|
66746
|
+
}
|
|
66538
66747
|
isInvalidDecimalDigitsValue(decimalDigits) {
|
|
66539
66748
|
return (decimalDigits < minimumValidDecimalDigits
|
|
66540
66749
|
|| decimalDigits > maximumValidDecimalDigits);
|
|
66541
66750
|
}
|
|
66542
66751
|
}
|
|
66543
66752
|
|
|
66753
|
+
/**
|
|
66754
|
+
* The base class for an element that provides a unit scale for scaled unit conversions
|
|
66755
|
+
*/
|
|
66756
|
+
class Unit extends FoundationElement {
|
|
66757
|
+
}
|
|
66758
|
+
__decorate$1([
|
|
66759
|
+
observable
|
|
66760
|
+
], Unit.prototype, "resolvedUnitScale", void 0);
|
|
66761
|
+
|
|
66544
66762
|
const defaultDecimalDigits = 2;
|
|
66545
66763
|
/**
|
|
66546
66764
|
* The table column for displaying numbers as text.
|
|
@@ -66555,6 +66773,11 @@ img.ProseMirror-separator {
|
|
|
66555
66773
|
this.updateColumnConfig();
|
|
66556
66774
|
}
|
|
66557
66775
|
};
|
|
66776
|
+
this.unitSubscriber = {
|
|
66777
|
+
handleChange: () => {
|
|
66778
|
+
this.updateColumnConfig();
|
|
66779
|
+
}
|
|
66780
|
+
};
|
|
66558
66781
|
}
|
|
66559
66782
|
connectedCallback() {
|
|
66560
66783
|
super.connectedCallback();
|
|
@@ -66577,6 +66800,17 @@ img.ProseMirror-separator {
|
|
|
66577
66800
|
sortOperation: TableColumnSortOperation.basic
|
|
66578
66801
|
};
|
|
66579
66802
|
}
|
|
66803
|
+
updateUnitNotifier() {
|
|
66804
|
+
if (this.unitNotifier) {
|
|
66805
|
+
this.unitNotifier.unsubscribe(this.unitSubscriber);
|
|
66806
|
+
this.unitNotifier = undefined;
|
|
66807
|
+
}
|
|
66808
|
+
if (this.unit) {
|
|
66809
|
+
const notifier = Observable.getNotifier(this.unit);
|
|
66810
|
+
notifier.subscribe(this.unitSubscriber, 'resolvedUnitScale');
|
|
66811
|
+
this.unitNotifier = notifier;
|
|
66812
|
+
}
|
|
66813
|
+
}
|
|
66580
66814
|
formatChanged() {
|
|
66581
66815
|
this.updateColumnConfig();
|
|
66582
66816
|
}
|
|
@@ -66589,10 +66823,25 @@ img.ProseMirror-separator {
|
|
|
66589
66823
|
decimalMaximumDigitsChanged() {
|
|
66590
66824
|
this.updateColumnConfig();
|
|
66591
66825
|
}
|
|
66826
|
+
unitElementsChanged() {
|
|
66827
|
+
void this.updateUnit();
|
|
66828
|
+
}
|
|
66829
|
+
async updateUnit() {
|
|
66830
|
+
this.unit = undefined;
|
|
66831
|
+
if (this.unitElements) {
|
|
66832
|
+
await waitUntilCustomElementsDefinedAsync(this.unitElements);
|
|
66833
|
+
this.unit = this.unitElements.find((x) => x instanceof Unit);
|
|
66834
|
+
}
|
|
66835
|
+
this.updateUnitNotifier();
|
|
66836
|
+
}
|
|
66837
|
+
unitChanged() {
|
|
66838
|
+
this.updateColumnConfig();
|
|
66839
|
+
}
|
|
66592
66840
|
updateColumnConfig() {
|
|
66593
66841
|
this.validator.validateDecimalDigits(this.format, this.decimalDigits);
|
|
66594
66842
|
this.validator.validateDecimalMaximumDigits(this.format, this.decimalMaximumDigits);
|
|
66595
66843
|
this.validator.validateNoMutuallyExclusiveProperties(this.format, this.decimalDigits, this.decimalMaximumDigits);
|
|
66844
|
+
this.validator.validateAtMostOneUnit(this.unitElements ?? []);
|
|
66596
66845
|
if (this.validator.isValid()) {
|
|
66597
66846
|
const columnConfig = {
|
|
66598
66847
|
formatter: this.createFormatter(),
|
|
@@ -66605,19 +66854,26 @@ img.ProseMirror-separator {
|
|
|
66605
66854
|
}
|
|
66606
66855
|
}
|
|
66607
66856
|
createFormatter() {
|
|
66608
|
-
|
|
66609
|
-
let maximumDigits;
|
|
66857
|
+
const unitScale = this.unit?.resolvedUnitScale;
|
|
66610
66858
|
switch (this.format) {
|
|
66611
|
-
case NumberTextFormat.decimal:
|
|
66612
|
-
|
|
66859
|
+
case NumberTextFormat.decimal: {
|
|
66860
|
+
const minimumFractionDigits = typeof this.decimalMaximumDigits === 'number'
|
|
66613
66861
|
? 0
|
|
66614
66862
|
: this.decimalDigits ?? defaultDecimalDigits;
|
|
66615
|
-
|
|
66863
|
+
const maximumFractionDigits = this.decimalMaximumDigits
|
|
66616
66864
|
?? this.decimalDigits
|
|
66617
66865
|
?? defaultDecimalDigits;
|
|
66618
|
-
return new
|
|
66619
|
-
|
|
66620
|
-
|
|
66866
|
+
return new DecimalUnitFormat(lang.getValueFor(this), {
|
|
66867
|
+
minimumFractionDigits,
|
|
66868
|
+
maximumFractionDigits,
|
|
66869
|
+
unitScale
|
|
66870
|
+
});
|
|
66871
|
+
}
|
|
66872
|
+
default: {
|
|
66873
|
+
return new DefaultUnitFormat(lang.getValueFor(this), {
|
|
66874
|
+
unitScale
|
|
66875
|
+
});
|
|
66876
|
+
}
|
|
66621
66877
|
}
|
|
66622
66878
|
}
|
|
66623
66879
|
determineCellContentAlignment() {
|
|
@@ -66627,9 +66883,10 @@ img.ProseMirror-separator {
|
|
|
66627
66883
|
if (this.alignment === NumberTextAlignment.right) {
|
|
66628
66884
|
return TextCellViewBaseAlignment.right;
|
|
66629
66885
|
}
|
|
66630
|
-
// Look at format and decimal max digits to determine the default alignment
|
|
66886
|
+
// Look at format and decimal max digits and unit to determine the default alignment
|
|
66631
66887
|
if (this.format === NumberTextFormat.decimal
|
|
66632
|
-
&& typeof this.decimalMaximumDigits !== 'number'
|
|
66888
|
+
&& typeof this.decimalMaximumDigits !== 'number'
|
|
66889
|
+
&& !this.unit) {
|
|
66633
66890
|
return TextCellViewBaseAlignment.right;
|
|
66634
66891
|
}
|
|
66635
66892
|
return TextCellViewBaseAlignment.left;
|
|
@@ -66650,9 +66907,15 @@ img.ProseMirror-separator {
|
|
|
66650
66907
|
converter: nullableNumberConverter
|
|
66651
66908
|
})
|
|
66652
66909
|
], TableColumnNumberText.prototype, "decimalMaximumDigits", void 0);
|
|
66910
|
+
__decorate$1([
|
|
66911
|
+
observable
|
|
66912
|
+
], TableColumnNumberText.prototype, "unitElements", void 0);
|
|
66913
|
+
__decorate$1([
|
|
66914
|
+
observable
|
|
66915
|
+
], TableColumnNumberText.prototype, "unit", void 0);
|
|
66653
66916
|
const nimbleTableColumnNumberText = TableColumnNumberText.compose({
|
|
66654
66917
|
baseName: 'table-column-number-text',
|
|
66655
|
-
template: template$
|
|
66918
|
+
template: template$8,
|
|
66656
66919
|
styles: styles$d
|
|
66657
66920
|
});
|
|
66658
66921
|
DesignSystem.getOrCreate()
|
|
@@ -66725,7 +66988,7 @@ img.ProseMirror-separator {
|
|
|
66725
66988
|
`;
|
|
66726
66989
|
|
|
66727
66990
|
// prettier-ignore
|
|
66728
|
-
const template$
|
|
66991
|
+
const template$7 = html `
|
|
66729
66992
|
${when(x => x.visual === 'icon', html `
|
|
66730
66993
|
${x => x.iconTemplate}
|
|
66731
66994
|
<span
|
|
@@ -66817,13 +67080,13 @@ img.ProseMirror-separator {
|
|
|
66817
67080
|
], TableColumnIconGroupHeaderView.prototype, "visual", void 0);
|
|
66818
67081
|
const iconGroupHeaderView = TableColumnIconGroupHeaderView.compose({
|
|
66819
67082
|
baseName: 'table-column-icon-group-header-view',
|
|
66820
|
-
template: template$
|
|
67083
|
+
template: template$7,
|
|
66821
67084
|
styles: styles$8
|
|
66822
67085
|
});
|
|
66823
67086
|
DesignSystem.getOrCreate().withPrefix('nimble').register(iconGroupHeaderView());
|
|
66824
67087
|
const tableColumnIconGroupHeaderViewTag = 'nimble-table-column-icon-group-header-view';
|
|
66825
67088
|
|
|
66826
|
-
const template$
|
|
67089
|
+
const template$6 = html `
|
|
66827
67090
|
${when(x => x.visual === 'icon', x => x.iconTemplate)}
|
|
66828
67091
|
${when(x => x.visual === 'spinner', html `
|
|
66829
67092
|
<${spinnerTag}
|
|
@@ -66880,7 +67143,7 @@ img.ProseMirror-separator {
|
|
|
66880
67143
|
], TableColumnIconCellView.prototype, "visual", void 0);
|
|
66881
67144
|
const iconCellView = TableColumnIconCellView.compose({
|
|
66882
67145
|
baseName: 'table-column-icon-cell-view',
|
|
66883
|
-
template: template$
|
|
67146
|
+
template: template$6
|
|
66884
67147
|
});
|
|
66885
67148
|
DesignSystem.getOrCreate().withPrefix('nimble').register(iconCellView());
|
|
66886
67149
|
const tableColumnIconCellViewTag = 'nimble-table-column-icon-cell-view';
|
|
@@ -66926,7 +67189,7 @@ img.ProseMirror-separator {
|
|
|
66926
67189
|
}
|
|
66927
67190
|
const nimbleTableColumnIcon = TableColumnIcon.compose({
|
|
66928
67191
|
baseName: 'table-column-icon',
|
|
66929
|
-
template: template$
|
|
67192
|
+
template: template$9,
|
|
66930
67193
|
styles: styles$9
|
|
66931
67194
|
});
|
|
66932
67195
|
DesignSystem.getOrCreate()
|
|
@@ -66945,7 +67208,7 @@ img.ProseMirror-separator {
|
|
|
66945
67208
|
}
|
|
66946
67209
|
const textCellView = TableColumnTextCellView.compose({
|
|
66947
67210
|
baseName: 'table-column-text-cell-view',
|
|
66948
|
-
template: template$
|
|
67211
|
+
template: template$a,
|
|
66949
67212
|
styles: styles$a
|
|
66950
67213
|
});
|
|
66951
67214
|
DesignSystem.getOrCreate().withPrefix('nimble').register(textCellView());
|
|
@@ -66967,7 +67230,7 @@ img.ProseMirror-separator {
|
|
|
66967
67230
|
}
|
|
66968
67231
|
const nimbleTableColumnText = TableColumnText.compose({
|
|
66969
67232
|
baseName: 'table-column-text',
|
|
66970
|
-
template: template$
|
|
67233
|
+
template: template$d,
|
|
66971
67234
|
styles: styles$d
|
|
66972
67235
|
});
|
|
66973
67236
|
DesignSystem.getOrCreate()
|
|
@@ -67041,7 +67304,7 @@ img.ProseMirror-separator {
|
|
|
67041
67304
|
}
|
|
67042
67305
|
`;
|
|
67043
67306
|
|
|
67044
|
-
const template$
|
|
67307
|
+
const template$5 = html `
|
|
67045
67308
|
<template slot="end">
|
|
67046
67309
|
<div class="separator"></div>
|
|
67047
67310
|
<slot></slot>
|
|
@@ -67055,7 +67318,7 @@ img.ProseMirror-separator {
|
|
|
67055
67318
|
}
|
|
67056
67319
|
const nimbleTabsToolbar = TabsToolbar.compose({
|
|
67057
67320
|
baseName: 'tabs-toolbar',
|
|
67058
|
-
template: template$
|
|
67321
|
+
template: template$5,
|
|
67059
67322
|
styles: styles$6
|
|
67060
67323
|
});
|
|
67061
67324
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTabsToolbar());
|
|
@@ -67230,7 +67493,7 @@ img.ProseMirror-separator {
|
|
|
67230
67493
|
}
|
|
67231
67494
|
`));
|
|
67232
67495
|
|
|
67233
|
-
const template$
|
|
67496
|
+
const template$4 = () => html `
|
|
67234
67497
|
<label
|
|
67235
67498
|
part="label"
|
|
67236
67499
|
for="control"
|
|
@@ -67393,7 +67656,7 @@ img.ProseMirror-separator {
|
|
|
67393
67656
|
const nimbleTextArea = TextArea.compose({
|
|
67394
67657
|
baseName: 'text-area',
|
|
67395
67658
|
baseClass: TextArea$1,
|
|
67396
|
-
template: template$
|
|
67659
|
+
template: template$4,
|
|
67397
67660
|
styles: styles$5,
|
|
67398
67661
|
shadowOptions: {
|
|
67399
67662
|
delegatesFocus: true
|
|
@@ -67782,7 +68045,7 @@ img.ProseMirror-separator {
|
|
|
67782
68045
|
`));
|
|
67783
68046
|
|
|
67784
68047
|
// prettier-ignore
|
|
67785
|
-
const template$
|
|
68048
|
+
const template$3 = html `
|
|
67786
68049
|
${when(x => x.tooltipVisible, html `
|
|
67787
68050
|
<${anchoredRegionTag}
|
|
67788
68051
|
class="anchored-region"
|
|
@@ -67834,7 +68097,7 @@ img.ProseMirror-separator {
|
|
|
67834
68097
|
const nimbleTooltip = Tooltip.compose({
|
|
67835
68098
|
baseName: 'tooltip',
|
|
67836
68099
|
baseClass: Tooltip$1,
|
|
67837
|
-
template: template$
|
|
68100
|
+
template: template$3,
|
|
67838
68101
|
styles: styles$3
|
|
67839
68102
|
});
|
|
67840
68103
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTooltip());
|
|
@@ -68161,7 +68424,7 @@ img.ProseMirror-separator {
|
|
|
68161
68424
|
`;
|
|
68162
68425
|
|
|
68163
68426
|
// prettier-ignore
|
|
68164
|
-
const template$
|
|
68427
|
+
const template$2 = html `
|
|
68165
68428
|
<template
|
|
68166
68429
|
role="tree"
|
|
68167
68430
|
${ref('treeView')}
|
|
@@ -68257,11 +68520,248 @@ img.ProseMirror-separator {
|
|
|
68257
68520
|
const nimbleTreeView = TreeView.compose({
|
|
68258
68521
|
baseName: 'tree-view',
|
|
68259
68522
|
baseClass: TreeView$1,
|
|
68260
|
-
template: template$
|
|
68523
|
+
template: template$2,
|
|
68261
68524
|
styles: styles$1
|
|
68262
68525
|
});
|
|
68263
68526
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTreeView());
|
|
68264
68527
|
|
|
68528
|
+
const template$1 = html `<template slot="unit"></template>`;
|
|
68529
|
+
|
|
68530
|
+
/**
|
|
68531
|
+
* A formatter for units that are not supported by Intl.NumberFormat
|
|
68532
|
+
*/
|
|
68533
|
+
class ManuallyTranslatedScaledUnitFormat extends ScaledUnitFormat {
|
|
68534
|
+
constructor(scaledUnitFormatFactoryOptions, unitTranslations, unitPrefix) {
|
|
68535
|
+
super(scaledUnitFormatFactoryOptions);
|
|
68536
|
+
this.unitTranslations = unitTranslations;
|
|
68537
|
+
this.unitPrefix = unitPrefix;
|
|
68538
|
+
this.pluralRules = new Intl.PluralRules(this.locale);
|
|
68539
|
+
this.formatter = new Intl.NumberFormat(this.locale, this.intlNumberFormatOptions);
|
|
68540
|
+
this.unitTranslation = this.getTranslationToUse(this.locale);
|
|
68541
|
+
}
|
|
68542
|
+
static createFactory(unitTranslations, unitPrefix) {
|
|
68543
|
+
return (scaledUnitFormatFactoryOptions) => new ManuallyTranslatedScaledUnitFormat(scaledUnitFormatFactoryOptions, unitTranslations, unitPrefix);
|
|
68544
|
+
}
|
|
68545
|
+
format(value) {
|
|
68546
|
+
const formatted = this.formatter.format(value);
|
|
68547
|
+
if (!this.unitPrefix.isBase()) {
|
|
68548
|
+
return `${formatted} ${this.unitPrefix.text}${this.unitTranslation.symbol}`;
|
|
68549
|
+
}
|
|
68550
|
+
// Some languages have more than two forms (singular/plural) of cardinal
|
|
68551
|
+
// numbers, but we are treating anything other than the 'one' form as plural.
|
|
68552
|
+
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules#description
|
|
68553
|
+
//
|
|
68554
|
+
// Because PluralRules.select() takes a number (not a string), it cannot differentiate
|
|
68555
|
+
// between 1 and 1.0. When NumberFormat is configured to format with a set number
|
|
68556
|
+
// of fractional digits, those fractional digits can have an effect on the pluralization
|
|
68557
|
+
// of the unit. E.g. in English, it formats "1 byte" vs "1.0 bytes". Thus there is
|
|
68558
|
+
// sometimes an inconsistency between unit pluralization for the same number, based
|
|
68559
|
+
// on whether it's supported by NumberFormat, or manually translated.
|
|
68560
|
+
const unitLabel = this.pluralRules.select(value) === 'one'
|
|
68561
|
+
? this.unitTranslation.singular
|
|
68562
|
+
: this.unitTranslation.plural;
|
|
68563
|
+
return `${formatted} ${unitLabel}`;
|
|
68564
|
+
}
|
|
68565
|
+
getTranslationToUse(locale) {
|
|
68566
|
+
const localeObject = new Intl.Locale(locale ?? 'en');
|
|
68567
|
+
const language = localeObject.language;
|
|
68568
|
+
const region = localeObject.region;
|
|
68569
|
+
const regionSpecificMatchedTranslations = region
|
|
68570
|
+
? this.unitTranslations.get(`${language}-${region}`) // do not include any other subtags that might be in the given locale string
|
|
68571
|
+
: null;
|
|
68572
|
+
return (regionSpecificMatchedTranslations
|
|
68573
|
+
?? this.unitTranslations.get(language)
|
|
68574
|
+
?? this.unitTranslations.get('en'));
|
|
68575
|
+
}
|
|
68576
|
+
}
|
|
68577
|
+
|
|
68578
|
+
/**
|
|
68579
|
+
* A unit scale that is not supported by Intl.NumberFormat and has manually provided translation strings
|
|
68580
|
+
*/
|
|
68581
|
+
class ManuallyTranslatedUnitScale extends UnitScale {
|
|
68582
|
+
constructor(unitTranslations, supportedUnitPrefixes) {
|
|
68583
|
+
super(ManuallyTranslatedUnitScale.createSupportedScaledUnits(unitTranslations, supportedUnitPrefixes));
|
|
68584
|
+
}
|
|
68585
|
+
static createSupportedScaledUnits(unitTranslations, supportedUnitPrefixes) {
|
|
68586
|
+
if (!unitTranslations.get('en')) {
|
|
68587
|
+
throw new Error('English translations must exist');
|
|
68588
|
+
}
|
|
68589
|
+
const supportedUnits = supportedUnitPrefixes.map(unitPrefix => new ScaledUnit(unitPrefix.scaleFactor, ManuallyTranslatedScaledUnitFormat.createFactory(unitTranslations, unitPrefix)));
|
|
68590
|
+
return supportedUnits;
|
|
68591
|
+
}
|
|
68592
|
+
}
|
|
68593
|
+
|
|
68594
|
+
/**
|
|
68595
|
+
* A prefix that represents a scaling factor when applied to a base unit.
|
|
68596
|
+
* A base unit is represented as scale factor 1 and empty text.
|
|
68597
|
+
*/
|
|
68598
|
+
class UnitPrefix {
|
|
68599
|
+
constructor(scaleFactor, text) {
|
|
68600
|
+
this.scaleFactor = scaleFactor;
|
|
68601
|
+
this.text = text;
|
|
68602
|
+
if (scaleFactor === 1 && text !== '') {
|
|
68603
|
+
throw new Error('Base scale factor of 1 has unused text and should be empty string');
|
|
68604
|
+
}
|
|
68605
|
+
}
|
|
68606
|
+
isBase() {
|
|
68607
|
+
return this.scaleFactor === 1;
|
|
68608
|
+
}
|
|
68609
|
+
}
|
|
68610
|
+
|
|
68611
|
+
/**
|
|
68612
|
+
* Representations of a base unit in a particular language
|
|
68613
|
+
*/
|
|
68614
|
+
class UnitTranslation {
|
|
68615
|
+
constructor(singular, plural, symbol) {
|
|
68616
|
+
this.singular = singular;
|
|
68617
|
+
this.plural = plural;
|
|
68618
|
+
this.symbol = symbol;
|
|
68619
|
+
}
|
|
68620
|
+
}
|
|
68621
|
+
|
|
68622
|
+
/**
|
|
68623
|
+
* Byte units (1024-based)
|
|
68624
|
+
*/
|
|
68625
|
+
class Byte1024UnitScale extends ManuallyTranslatedUnitScale {
|
|
68626
|
+
constructor() {
|
|
68627
|
+
super(new Map([
|
|
68628
|
+
['en', new UnitTranslation('byte', 'bytes', 'B')],
|
|
68629
|
+
['fr', new UnitTranslation('octet', 'octets', 'o')],
|
|
68630
|
+
['de', new UnitTranslation('Byte', 'Byte', 'B')],
|
|
68631
|
+
['ja', new UnitTranslation('バイト', 'バイト', 'B')],
|
|
68632
|
+
['zh', new UnitTranslation('字节', '字节', 'B')]
|
|
68633
|
+
]), [
|
|
68634
|
+
new UnitPrefix(1024 ** 0, ''),
|
|
68635
|
+
new UnitPrefix(1024 ** 1, 'Ki'),
|
|
68636
|
+
new UnitPrefix(1024 ** 2, 'Mi'),
|
|
68637
|
+
new UnitPrefix(1024 ** 3, 'Gi'),
|
|
68638
|
+
new UnitPrefix(1024 ** 4, 'Ti'),
|
|
68639
|
+
new UnitPrefix(1024 ** 5, 'Pi')
|
|
68640
|
+
]);
|
|
68641
|
+
}
|
|
68642
|
+
}
|
|
68643
|
+
const byte1024UnitScale = new Byte1024UnitScale();
|
|
68644
|
+
|
|
68645
|
+
/**
|
|
68646
|
+
* Byte units (1000-based)
|
|
68647
|
+
*/
|
|
68648
|
+
class ByteUnitScale extends UnitScale {
|
|
68649
|
+
constructor() {
|
|
68650
|
+
super([
|
|
68651
|
+
new ScaledUnit(10 ** 0, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68652
|
+
style: 'unit',
|
|
68653
|
+
unit: 'byte',
|
|
68654
|
+
unitDisplay: 'long'
|
|
68655
|
+
})),
|
|
68656
|
+
new ScaledUnit(10 ** 3, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68657
|
+
style: 'unit',
|
|
68658
|
+
unit: 'kilobyte',
|
|
68659
|
+
unitDisplay: 'short'
|
|
68660
|
+
})),
|
|
68661
|
+
new ScaledUnit(10 ** 6, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68662
|
+
style: 'unit',
|
|
68663
|
+
unit: 'megabyte',
|
|
68664
|
+
unitDisplay: 'short'
|
|
68665
|
+
})),
|
|
68666
|
+
new ScaledUnit(10 ** 9, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68667
|
+
style: 'unit',
|
|
68668
|
+
unit: 'gigabyte',
|
|
68669
|
+
unitDisplay: 'short'
|
|
68670
|
+
})),
|
|
68671
|
+
new ScaledUnit(10 ** 12, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68672
|
+
style: 'unit',
|
|
68673
|
+
unit: 'terabyte',
|
|
68674
|
+
unitDisplay: 'short'
|
|
68675
|
+
})),
|
|
68676
|
+
new ScaledUnit(10 ** 15, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68677
|
+
style: 'unit',
|
|
68678
|
+
unit: 'petabyte',
|
|
68679
|
+
unitDisplay: 'short'
|
|
68680
|
+
}))
|
|
68681
|
+
]);
|
|
68682
|
+
}
|
|
68683
|
+
}
|
|
68684
|
+
const byteUnitScale = new ByteUnitScale();
|
|
68685
|
+
|
|
68686
|
+
/**
|
|
68687
|
+
* Element that provides a unit scale for conversion of bytes
|
|
68688
|
+
*/
|
|
68689
|
+
class UnitByte extends Unit {
|
|
68690
|
+
constructor() {
|
|
68691
|
+
super();
|
|
68692
|
+
/**
|
|
68693
|
+
* Use binary (base 1024 scale with binary prefixes) instead of
|
|
68694
|
+
* the default of decimal (base 1000 scale with metric prefixes)
|
|
68695
|
+
*/
|
|
68696
|
+
this.binary = false;
|
|
68697
|
+
this.resolvedUnitScale = byteUnitScale;
|
|
68698
|
+
}
|
|
68699
|
+
binaryChanged() {
|
|
68700
|
+
this.resolvedUnitScale = this.binary
|
|
68701
|
+
? byte1024UnitScale
|
|
68702
|
+
: byteUnitScale;
|
|
68703
|
+
}
|
|
68704
|
+
}
|
|
68705
|
+
__decorate$1([
|
|
68706
|
+
attr({ mode: 'boolean' })
|
|
68707
|
+
], UnitByte.prototype, "binary", void 0);
|
|
68708
|
+
const nimbleUnitByte = UnitByte.compose({
|
|
68709
|
+
baseName: 'unit-byte',
|
|
68710
|
+
template: template$1
|
|
68711
|
+
});
|
|
68712
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleUnitByte());
|
|
68713
|
+
|
|
68714
|
+
/**
|
|
68715
|
+
* The metric unit prefixes for at least English, French, German, Japanese, and Chinese.
|
|
68716
|
+
*/
|
|
68717
|
+
const unitPrefixesMetric = [
|
|
68718
|
+
new UnitPrefix(10 ** -15, 'f'),
|
|
68719
|
+
new UnitPrefix(10 ** -12, 'p'),
|
|
68720
|
+
new UnitPrefix(10 ** -9, 'n'),
|
|
68721
|
+
new UnitPrefix(10 ** -6, 'μ'),
|
|
68722
|
+
new UnitPrefix(10 ** -3, 'm'),
|
|
68723
|
+
new UnitPrefix(10 ** -2, 'c'),
|
|
68724
|
+
new UnitPrefix(10 ** -1, 'd'),
|
|
68725
|
+
new UnitPrefix(10 ** 0, ''),
|
|
68726
|
+
new UnitPrefix(10 ** 3, 'k'),
|
|
68727
|
+
new UnitPrefix(10 ** 6, 'M'),
|
|
68728
|
+
new UnitPrefix(10 ** 9, 'G'),
|
|
68729
|
+
new UnitPrefix(10 ** 12, 'T'),
|
|
68730
|
+
new UnitPrefix(10 ** 15, 'P'),
|
|
68731
|
+
new UnitPrefix(10 ** 18, 'E')
|
|
68732
|
+
];
|
|
68733
|
+
|
|
68734
|
+
/**
|
|
68735
|
+
* Voltage unit scale
|
|
68736
|
+
*/
|
|
68737
|
+
class VoltUnitScale extends ManuallyTranslatedUnitScale {
|
|
68738
|
+
constructor() {
|
|
68739
|
+
super(new Map([
|
|
68740
|
+
['en', new UnitTranslation('volt', 'volts', 'V')],
|
|
68741
|
+
['fr', new UnitTranslation('volt', 'volts', 'V')],
|
|
68742
|
+
['de', new UnitTranslation('Volt', 'Volt', 'V')],
|
|
68743
|
+
['ja', new UnitTranslation('ボルト', 'ボルト', 'V')],
|
|
68744
|
+
['zh', new UnitTranslation('伏特', '伏特', 'V')]
|
|
68745
|
+
]), unitPrefixesMetric);
|
|
68746
|
+
}
|
|
68747
|
+
}
|
|
68748
|
+
const voltUnitScale = new VoltUnitScale();
|
|
68749
|
+
|
|
68750
|
+
/**
|
|
68751
|
+
* Element representing units for volts
|
|
68752
|
+
*/
|
|
68753
|
+
class UnitVolt extends Unit {
|
|
68754
|
+
constructor() {
|
|
68755
|
+
super();
|
|
68756
|
+
this.resolvedUnitScale = voltUnitScale;
|
|
68757
|
+
}
|
|
68758
|
+
}
|
|
68759
|
+
const nimbleUnitVolt = UnitVolt.compose({
|
|
68760
|
+
baseName: 'unit-volt',
|
|
68761
|
+
template: template$1
|
|
68762
|
+
});
|
|
68763
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleUnitVolt());
|
|
68764
|
+
|
|
68265
68765
|
var noop = {value: () => {}};
|
|
68266
68766
|
|
|
68267
68767
|
function dispatch() {
|