@ni/nimble-components 24.1.8 → 24.1.10
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 +147 -148
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +5243 -5238
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/anchor-menu-item/index.js +1 -15
- package/dist/esm/anchor-menu-item/index.js.map +1 -1
- package/dist/esm/src/table-column/anchor/index.d.ts +4 -3
- package/dist/esm/src/table-column/base/index.d.ts +4 -3
- package/dist/esm/src/table-column/base/models/column-internals.d.ts +10 -8
- package/dist/esm/src/table-column/base/models/column-validator.d.ts +2 -3
- package/dist/esm/src/table-column/base/template.d.ts +1 -1
- package/dist/esm/src/table-column/date-text/index.d.ts +4 -8
- package/dist/esm/src/table-column/date-text/models/table-column-date-text-validator.d.ts +1 -2
- package/dist/esm/src/table-column/duration-text/index.d.ts +4 -3
- package/dist/esm/src/table-column/enum-base/index.d.ts +1 -4
- package/dist/esm/src/table-column/enum-base/models/table-column-enum-base-validator.d.ts +1 -2
- package/dist/esm/src/table-column/enum-text/index.d.ts +3 -6
- package/dist/esm/src/table-column/enum-text/models/table-column-enum-text-validator.d.ts +1 -2
- package/dist/esm/src/table-column/icon/index.d.ts +3 -6
- package/dist/esm/src/table-column/icon/models/table-column-icon-validator.d.ts +1 -2
- package/dist/esm/src/table-column/mixins/fractional-width-column.d.ts +1 -1
- package/dist/esm/src/table-column/mixins/groupable-column.d.ts +1 -1
- package/dist/esm/src/table-column/number-text/index.d.ts +4 -8
- package/dist/esm/src/table-column/number-text/models/table-column-number-text-validator.d.ts +1 -2
- package/dist/esm/src/table-column/text/index.d.ts +4 -3
- package/dist/esm/src/table-column/text-base/index.d.ts +6 -5
- package/dist/esm/table/index.js +9 -6
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/models/table-validator.js +1 -1
- package/dist/esm/table/models/table-validator.js.map +1 -1
- package/dist/esm/table-column/anchor/index.d.ts +4 -3
- package/dist/esm/table-column/anchor/index.js +3 -1
- package/dist/esm/table-column/anchor/index.js.map +1 -1
- package/dist/esm/table-column/base/index.d.ts +4 -3
- package/dist/esm/table-column/base/index.js +2 -2
- package/dist/esm/table-column/base/index.js.map +1 -1
- package/dist/esm/table-column/base/models/column-internals.d.ts +10 -8
- package/dist/esm/table-column/base/models/column-internals.js +1 -7
- package/dist/esm/table-column/base/models/column-internals.js.map +1 -1
- package/dist/esm/table-column/base/models/column-validator.d.ts +2 -3
- package/dist/esm/table-column/base/models/column-validator.js +8 -3
- package/dist/esm/table-column/base/models/column-validator.js.map +1 -1
- package/dist/esm/table-column/base/template.d.ts +1 -1
- package/dist/esm/table-column/date-text/index.d.ts +4 -8
- package/dist/esm/table-column/date-text/index.js +4 -8
- package/dist/esm/table-column/date-text/index.js.map +1 -1
- package/dist/esm/table-column/date-text/models/table-column-date-text-validator.d.ts +1 -2
- package/dist/esm/table-column/date-text/models/table-column-date-text-validator.js +2 -2
- package/dist/esm/table-column/date-text/models/table-column-date-text-validator.js.map +1 -1
- package/dist/esm/table-column/duration-text/index.d.ts +4 -3
- package/dist/esm/table-column/duration-text/index.js +3 -1
- package/dist/esm/table-column/duration-text/index.js.map +1 -1
- package/dist/esm/table-column/enum-base/index.d.ts +1 -4
- package/dist/esm/table-column/enum-base/index.js +2 -6
- package/dist/esm/table-column/enum-base/index.js.map +1 -1
- package/dist/esm/table-column/enum-base/models/table-column-enum-base-validator.d.ts +1 -2
- package/dist/esm/table-column/enum-base/models/table-column-enum-base-validator.js +2 -2
- package/dist/esm/table-column/enum-base/models/table-column-enum-base-validator.js.map +1 -1
- package/dist/esm/table-column/enum-text/index.d.ts +3 -6
- package/dist/esm/table-column/enum-text/index.js +2 -7
- package/dist/esm/table-column/enum-text/index.js.map +1 -1
- package/dist/esm/table-column/enum-text/models/table-column-enum-text-validator.d.ts +1 -2
- package/dist/esm/table-column/enum-text/models/table-column-enum-text-validator.js +2 -2
- package/dist/esm/table-column/enum-text/models/table-column-enum-text-validator.js.map +1 -1
- package/dist/esm/table-column/icon/index.d.ts +3 -6
- package/dist/esm/table-column/icon/index.js +2 -7
- package/dist/esm/table-column/icon/index.js.map +1 -1
- package/dist/esm/table-column/icon/models/table-column-icon-validator.d.ts +1 -2
- package/dist/esm/table-column/icon/models/table-column-icon-validator.js +2 -2
- package/dist/esm/table-column/icon/models/table-column-icon-validator.js.map +1 -1
- package/dist/esm/table-column/mixins/fractional-width-column.d.ts +1 -1
- package/dist/esm/table-column/mixins/groupable-column.d.ts +1 -1
- package/dist/esm/table-column/number-text/index.d.ts +4 -8
- package/dist/esm/table-column/number-text/index.js +8 -11
- 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 +1 -2
- package/dist/esm/table-column/number-text/models/table-column-number-text-validator.js +2 -2
- package/dist/esm/table-column/number-text/models/table-column-number-text-validator.js.map +1 -1
- package/dist/esm/table-column/text/index.d.ts +4 -3
- package/dist/esm/table-column/text/index.js +3 -1
- package/dist/esm/table-column/text/index.js.map +1 -1
- package/dist/esm/table-column/text-base/index.d.ts +6 -5
- package/dist/esm/table-column/text-base/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1715,8 +1715,20 @@
|
|
|
1715
1715
|
return prev.concat(curr);
|
|
1716
1716
|
}, null);
|
|
1717
1717
|
}
|
|
1718
|
+
/**
|
|
1719
|
+
* A Symbol that can be added to a CSSStyleSheet to cause it to be prepended (rather than appended) to adoptedStyleSheets.
|
|
1720
|
+
* @public
|
|
1721
|
+
*/
|
|
1722
|
+
const prependToAdoptedStyleSheetsSymbol = Symbol("prependToAdoptedStyleSheets");
|
|
1723
|
+
function separateSheetsToPrepend(sheets) {
|
|
1724
|
+
const prepend = [];
|
|
1725
|
+
const append = [];
|
|
1726
|
+
sheets.forEach(x => (x[prependToAdoptedStyleSheetsSymbol] ? prepend : append).push(x));
|
|
1727
|
+
return { prepend, append };
|
|
1728
|
+
}
|
|
1718
1729
|
let addAdoptedStyleSheets = (target, sheets) => {
|
|
1719
|
-
|
|
1730
|
+
const { prepend, append } = separateSheetsToPrepend(sheets);
|
|
1731
|
+
target.adoptedStyleSheets = [...prepend, ...target.adoptedStyleSheets, ...append];
|
|
1720
1732
|
};
|
|
1721
1733
|
let removeAdoptedStyleSheets = (target, sheets) => {
|
|
1722
1734
|
target.adoptedStyleSheets = target.adoptedStyleSheets.filter((x) => sheets.indexOf(x) === -1);
|
|
@@ -1731,7 +1743,9 @@
|
|
|
1731
1743
|
document.adoptedStyleSheets.push();
|
|
1732
1744
|
document.adoptedStyleSheets.splice();
|
|
1733
1745
|
addAdoptedStyleSheets = (target, sheets) => {
|
|
1734
|
-
|
|
1746
|
+
const { prepend, append } = separateSheetsToPrepend(sheets);
|
|
1747
|
+
target.adoptedStyleSheets.splice(0, 0, ...prepend);
|
|
1748
|
+
target.adoptedStyleSheets.push(...append);
|
|
1735
1749
|
};
|
|
1736
1750
|
removeAdoptedStyleSheets = (target, sheets) => {
|
|
1737
1751
|
for (const sheet of sheets) {
|
|
@@ -9040,6 +9054,7 @@
|
|
|
9040
9054
|
constructor(source) {
|
|
9041
9055
|
super();
|
|
9042
9056
|
const sheet = new CSSStyleSheet();
|
|
9057
|
+
sheet[prependToAdoptedStyleSheetsSymbol] = true;
|
|
9043
9058
|
this.target = sheet.cssRules[sheet.insertRule(":host{}")].style;
|
|
9044
9059
|
source.$fastController.addStyles(ElementStyles.create([sheet]));
|
|
9045
9060
|
}
|
|
@@ -9476,23 +9491,7 @@
|
|
|
9476
9491
|
if (token) {
|
|
9477
9492
|
// Notify any token subscribers
|
|
9478
9493
|
token.notify(this.target);
|
|
9479
|
-
|
|
9480
|
-
const parent = this.parent;
|
|
9481
|
-
const reflecting = this.isReflecting(token);
|
|
9482
|
-
if (parent) {
|
|
9483
|
-
const parentValue = parent.get(token);
|
|
9484
|
-
const sourceValue = source.get(token);
|
|
9485
|
-
if (parentValue !== sourceValue && !reflecting) {
|
|
9486
|
-
this.reflectToCSS(token);
|
|
9487
|
-
}
|
|
9488
|
-
else if (parentValue === sourceValue && reflecting) {
|
|
9489
|
-
this.stopReflectToCSS(token);
|
|
9490
|
-
}
|
|
9491
|
-
}
|
|
9492
|
-
else if (!reflecting) {
|
|
9493
|
-
this.reflectToCSS(token);
|
|
9494
|
-
}
|
|
9495
|
-
}
|
|
9494
|
+
this.updateCSSTokenReflection(source, token);
|
|
9496
9495
|
}
|
|
9497
9496
|
},
|
|
9498
9497
|
};
|
|
@@ -9566,6 +9565,25 @@
|
|
|
9566
9565
|
get parent() {
|
|
9567
9566
|
return childToParent.get(this) || null;
|
|
9568
9567
|
}
|
|
9568
|
+
updateCSSTokenReflection(source, token) {
|
|
9569
|
+
if (DesignTokenImpl.isCSSDesignToken(token)) {
|
|
9570
|
+
const parent = this.parent;
|
|
9571
|
+
const reflecting = this.isReflecting(token);
|
|
9572
|
+
if (parent) {
|
|
9573
|
+
const parentValue = parent.get(token);
|
|
9574
|
+
const sourceValue = source.get(token);
|
|
9575
|
+
if (parentValue !== sourceValue && !reflecting) {
|
|
9576
|
+
this.reflectToCSS(token);
|
|
9577
|
+
}
|
|
9578
|
+
else if (parentValue === sourceValue && reflecting) {
|
|
9579
|
+
this.stopReflectToCSS(token);
|
|
9580
|
+
}
|
|
9581
|
+
}
|
|
9582
|
+
else if (!reflecting) {
|
|
9583
|
+
this.reflectToCSS(token);
|
|
9584
|
+
}
|
|
9585
|
+
}
|
|
9586
|
+
}
|
|
9569
9587
|
/**
|
|
9570
9588
|
* Checks if a token has been assigned an explicit value the node.
|
|
9571
9589
|
* @param token - the token to check.
|
|
@@ -9731,6 +9749,7 @@
|
|
|
9731
9749
|
return;
|
|
9732
9750
|
}
|
|
9733
9751
|
this.hydrate(token, this.getRaw(token));
|
|
9752
|
+
this.updateCSSTokenReflection(this.store, token);
|
|
9734
9753
|
}
|
|
9735
9754
|
/**
|
|
9736
9755
|
* Hydrates a token with a DesignTokenValue, making retrieval available.
|
|
@@ -11220,7 +11239,7 @@
|
|
|
11220
11239
|
item.setAttribute("tabindex", index === 0 ? "0" : "-1");
|
|
11221
11240
|
item.addEventListener("expanded-change", this.handleExpandedChanged);
|
|
11222
11241
|
item.addEventListener("focus", this.handleItemFocus);
|
|
11223
|
-
if (item instanceof MenuItem$1) {
|
|
11242
|
+
if (item instanceof MenuItem$1 || "startColumnCount" in item) {
|
|
11224
11243
|
item.startColumnCount = indent;
|
|
11225
11244
|
}
|
|
11226
11245
|
});
|
|
@@ -13869,6 +13888,15 @@
|
|
|
13869
13888
|
</template>
|
|
13870
13889
|
`;
|
|
13871
13890
|
|
|
13891
|
+
// returns the active element in the shadow context of the element in question.
|
|
13892
|
+
function getRootActiveElement(element) {
|
|
13893
|
+
const rootNode = element.getRootNode();
|
|
13894
|
+
if (rootNode instanceof ShadowRoot) {
|
|
13895
|
+
return rootNode.activeElement;
|
|
13896
|
+
}
|
|
13897
|
+
return document.activeElement;
|
|
13898
|
+
}
|
|
13899
|
+
|
|
13872
13900
|
/**
|
|
13873
13901
|
* A map for directionality derived from keyboard input strings,
|
|
13874
13902
|
* visual orientation, and text direction.
|
|
@@ -14053,10 +14081,14 @@
|
|
|
14053
14081
|
* @internal
|
|
14054
14082
|
*/
|
|
14055
14083
|
setFocusedElement(activeIndex = this.activeIndex) {
|
|
14056
|
-
var _a;
|
|
14057
14084
|
this.activeIndex = activeIndex;
|
|
14058
14085
|
this.setFocusableElements();
|
|
14059
|
-
(
|
|
14086
|
+
if (this.focusableElements[this.activeIndex] &&
|
|
14087
|
+
// Don't focus the toolbar element if some event handlers moved
|
|
14088
|
+
// the focus on another element in the page.
|
|
14089
|
+
this.contains(getRootActiveElement(this))) {
|
|
14090
|
+
this.focusableElements[this.activeIndex].focus();
|
|
14091
|
+
}
|
|
14060
14092
|
}
|
|
14061
14093
|
/**
|
|
14062
14094
|
* Reduce a collection to only its focusable elements.
|
|
@@ -16301,7 +16333,7 @@
|
|
|
16301
16333
|
|
|
16302
16334
|
/**
|
|
16303
16335
|
* Do not edit directly
|
|
16304
|
-
* Generated on
|
|
16336
|
+
* Generated on Wed, 10 Apr 2024 00:13:11 GMT
|
|
16305
16337
|
*/
|
|
16306
16338
|
|
|
16307
16339
|
const Information100DarkUi = "#a46eff";
|
|
@@ -17941,20 +17973,6 @@
|
|
|
17941
17973
|
DesignSystem.getOrCreate()
|
|
17942
17974
|
.withPrefix('nimble')
|
|
17943
17975
|
.register(nimbleAnchorMenuItem());
|
|
17944
|
-
// This is a workaround for the fact that FAST's menu uses `instanceof MenuItem`
|
|
17945
|
-
// in their logic for indenting menu items. Since our AnchorMenuItem derives from
|
|
17946
|
-
// AnchorBase and not FAST's MenuItem, we need to change their MenuItem's definition
|
|
17947
|
-
// of `hasInstance` so that it includes our AnchorMenuItem, too.
|
|
17948
|
-
//
|
|
17949
|
-
// If/when we change FAST to test for the presence of `startColumnCount` instead
|
|
17950
|
-
// of using `instanceof MenuItem`, we can remove this workaround. Here is the
|
|
17951
|
-
// PR into FAST: https://github.com/microsoft/fast/pull/6667
|
|
17952
|
-
const originalInstanceOf = MenuItem$1[Symbol.hasInstance].bind(MenuItem$1);
|
|
17953
|
-
Object.defineProperty(MenuItem$1, Symbol.hasInstance, {
|
|
17954
|
-
value(instance) {
|
|
17955
|
-
return (originalInstanceOf(instance) || instance instanceof AnchorMenuItem);
|
|
17956
|
-
}
|
|
17957
|
-
});
|
|
17958
17976
|
|
|
17959
17977
|
const styles$S = css `
|
|
17960
17978
|
${display('inline-flex')}
|
|
@@ -63280,10 +63298,6 @@ img.ProseMirror-separator {
|
|
|
63280
63298
|
* A unique id used internally in the table to identify specific column instances
|
|
63281
63299
|
*/
|
|
63282
63300
|
this.uniqueId = uniqueId('table-column-slot');
|
|
63283
|
-
/**
|
|
63284
|
-
* Whether this column has a valid configuration.
|
|
63285
|
-
*/
|
|
63286
|
-
this.validConfiguration = true;
|
|
63287
63301
|
/**
|
|
63288
63302
|
* The operation to use when sorting the table by this column.
|
|
63289
63303
|
*/
|
|
@@ -63321,6 +63335,7 @@ img.ProseMirror-separator {
|
|
|
63321
63335
|
this.groupHeaderViewTemplate = createGroupHeaderViewTemplate(options.groupHeaderViewTag);
|
|
63322
63336
|
this.delegatedEvents = options.delegatedEvents;
|
|
63323
63337
|
this.sortOperation = options.sortOperation ?? TableColumnSortOperation.basic;
|
|
63338
|
+
this.validator = options.validator;
|
|
63324
63339
|
}
|
|
63325
63340
|
fractionalWidthChanged() {
|
|
63326
63341
|
this.currentFractionalWidth = this.fractionalWidth;
|
|
@@ -63332,9 +63347,6 @@ img.ProseMirror-separator {
|
|
|
63332
63347
|
__decorate$1([
|
|
63333
63348
|
observable
|
|
63334
63349
|
], ColumnInternals.prototype, "columnConfig", void 0);
|
|
63335
|
-
__decorate$1([
|
|
63336
|
-
observable
|
|
63337
|
-
], ColumnInternals.prototype, "validConfiguration", void 0);
|
|
63338
63350
|
__decorate$1([
|
|
63339
63351
|
observable
|
|
63340
63352
|
], ColumnInternals.prototype, "operandDataRecordFieldName", void 0);
|
|
@@ -63399,10 +63411,10 @@ img.ProseMirror-separator {
|
|
|
63399
63411
|
this.hasOverflow = false;
|
|
63400
63412
|
}
|
|
63401
63413
|
checkValidity() {
|
|
63402
|
-
return this.columnInternals.
|
|
63414
|
+
return this.columnInternals.validator.isColumnValid;
|
|
63403
63415
|
}
|
|
63404
63416
|
get validity() {
|
|
63405
|
-
return
|
|
63417
|
+
return this.columnInternals.validator.getValidity();
|
|
63406
63418
|
}
|
|
63407
63419
|
/** @internal */
|
|
63408
63420
|
get headerTextContent() {
|
|
@@ -63571,7 +63583,7 @@ img.ProseMirror-separator {
|
|
|
63571
63583
|
return !this.duplicateGroupIndex;
|
|
63572
63584
|
}
|
|
63573
63585
|
validateColumnConfigurations(columns) {
|
|
63574
|
-
this.invalidColumnConfiguration = columns.some(x => !x.columnInternals.
|
|
63586
|
+
this.invalidColumnConfiguration = columns.some(x => !x.columnInternals.validator.isColumnValid);
|
|
63575
63587
|
return !this.invalidColumnConfiguration;
|
|
63576
63588
|
}
|
|
63577
63589
|
getPresentRecordIds(requestedRecordIds) {
|
|
@@ -66557,6 +66569,52 @@ img.ProseMirror-separator {
|
|
|
66557
66569
|
}
|
|
66558
66570
|
}
|
|
66559
66571
|
|
|
66572
|
+
/**
|
|
66573
|
+
* Generic Validator Utility extends Tracker Utility for validation purposes
|
|
66574
|
+
*/
|
|
66575
|
+
class Validator extends Tracker {
|
|
66576
|
+
isValid() {
|
|
66577
|
+
return this.noneTracked();
|
|
66578
|
+
}
|
|
66579
|
+
getValidationFlags() {
|
|
66580
|
+
return this.getTrackedItems();
|
|
66581
|
+
}
|
|
66582
|
+
}
|
|
66583
|
+
|
|
66584
|
+
/**
|
|
66585
|
+
* Base column validator
|
|
66586
|
+
*/
|
|
66587
|
+
class ColumnValidator extends Validator {
|
|
66588
|
+
constructor(configValidityKeys) {
|
|
66589
|
+
super(configValidityKeys);
|
|
66590
|
+
this.isColumnValid = true;
|
|
66591
|
+
}
|
|
66592
|
+
/**
|
|
66593
|
+
* @returns an object containing flags for various ways the configuation can be invalid
|
|
66594
|
+
*/
|
|
66595
|
+
getValidity() {
|
|
66596
|
+
return this.getValidationFlags();
|
|
66597
|
+
}
|
|
66598
|
+
/**
|
|
66599
|
+
* Sets a particular validity condition flag's value, e.g. "hasInvalidFooValue" = true
|
|
66600
|
+
*/
|
|
66601
|
+
setConditionValue(name, isInvalid) {
|
|
66602
|
+
if (isInvalid) {
|
|
66603
|
+
this.track(name);
|
|
66604
|
+
}
|
|
66605
|
+
else {
|
|
66606
|
+
this.untrack(name);
|
|
66607
|
+
}
|
|
66608
|
+
this.updateColumnInternalsFlag();
|
|
66609
|
+
}
|
|
66610
|
+
updateColumnInternalsFlag() {
|
|
66611
|
+
this.isColumnValid = this.isValid();
|
|
66612
|
+
}
|
|
66613
|
+
}
|
|
66614
|
+
__decorate$1([
|
|
66615
|
+
observable
|
|
66616
|
+
], ColumnValidator.prototype, "isColumnValid", void 0);
|
|
66617
|
+
|
|
66560
66618
|
/**
|
|
66561
66619
|
* A nimble-styled table.
|
|
66562
66620
|
*/
|
|
@@ -66761,12 +66819,11 @@ img.ProseMirror-separator {
|
|
|
66761
66819
|
if ((source instanceof TableColumn
|
|
66762
66820
|
|| source instanceof ColumnInternals)
|
|
66763
66821
|
&& typeof args === 'string') {
|
|
66764
|
-
|
|
66765
|
-
|
|
66766
|
-
|
|
66767
|
-
|
|
66768
|
-
|
|
66769
|
-
}
|
|
66822
|
+
this.tableUpdateTracker.trackColumnPropertyChanged(args);
|
|
66823
|
+
}
|
|
66824
|
+
else if (source instanceof ColumnValidator
|
|
66825
|
+
&& args === 'isColumnValid') {
|
|
66826
|
+
this.tableValidator.validateColumnConfigurations(this.columns);
|
|
66770
66827
|
}
|
|
66771
66828
|
else if (source instanceof TableLayoutManager
|
|
66772
66829
|
&& args === 'isColumnBeingSized'
|
|
@@ -67026,6 +67083,9 @@ img.ProseMirror-separator {
|
|
|
67026
67083
|
const notifierInternals = Observable.getNotifier(column.columnInternals);
|
|
67027
67084
|
notifierInternals.subscribe(this);
|
|
67028
67085
|
this.columnNotifiers.push(notifierInternals);
|
|
67086
|
+
const validatorNotifier = Observable.getNotifier(column.columnInternals.validator);
|
|
67087
|
+
validatorNotifier.subscribe(this);
|
|
67088
|
+
this.columnNotifiers.push(validatorNotifier);
|
|
67029
67089
|
}
|
|
67030
67090
|
}
|
|
67031
67091
|
getColumnsParticipatingInSorting() {
|
|
@@ -67724,7 +67784,8 @@ img.ProseMirror-separator {
|
|
|
67724
67784
|
cellViewTag: tableColumnAnchorCellViewTag,
|
|
67725
67785
|
groupHeaderViewTag: tableColumnTextGroupHeaderViewTag,
|
|
67726
67786
|
delegatedEvents: ['click'],
|
|
67727
|
-
sortOperation: TableColumnSortOperation.localeAwareCaseSensitive
|
|
67787
|
+
sortOperation: TableColumnSortOperation.localeAwareCaseSensitive,
|
|
67788
|
+
validator: new ColumnValidator([])
|
|
67728
67789
|
};
|
|
67729
67790
|
}
|
|
67730
67791
|
labelFieldNameChanged() {
|
|
@@ -68013,56 +68074,13 @@ img.ProseMirror-separator {
|
|
|
68013
68074
|
custom: 'custom'
|
|
68014
68075
|
};
|
|
68015
68076
|
|
|
68016
|
-
/**
|
|
68017
|
-
* Generic Validator Utility extends Tracker Utility for validation purposes
|
|
68018
|
-
*/
|
|
68019
|
-
class Validator extends Tracker {
|
|
68020
|
-
isValid() {
|
|
68021
|
-
return this.noneTracked();
|
|
68022
|
-
}
|
|
68023
|
-
getValidationFlags() {
|
|
68024
|
-
return this.getTrackedItems();
|
|
68025
|
-
}
|
|
68026
|
-
}
|
|
68027
|
-
|
|
68028
|
-
/**
|
|
68029
|
-
* Base column validator
|
|
68030
|
-
*/
|
|
68031
|
-
class ColumnValidator extends Validator {
|
|
68032
|
-
constructor(columnInternals, configValidityKeys) {
|
|
68033
|
-
super(configValidityKeys);
|
|
68034
|
-
this.columnInternals = columnInternals;
|
|
68035
|
-
}
|
|
68036
|
-
/**
|
|
68037
|
-
* @returns an object containing flags for various ways the configuation can be invalid
|
|
68038
|
-
*/
|
|
68039
|
-
getValidity() {
|
|
68040
|
-
return this.getValidationFlags();
|
|
68041
|
-
}
|
|
68042
|
-
/**
|
|
68043
|
-
* Sets a particular validity condition flag's value, e.g. "hasInvalidFooValue" = true
|
|
68044
|
-
*/
|
|
68045
|
-
setConditionValue(name, isInvalid) {
|
|
68046
|
-
if (isInvalid) {
|
|
68047
|
-
this.track(name);
|
|
68048
|
-
}
|
|
68049
|
-
else {
|
|
68050
|
-
this.untrack(name);
|
|
68051
|
-
}
|
|
68052
|
-
this.updateColumnInternalsFlag();
|
|
68053
|
-
}
|
|
68054
|
-
updateColumnInternalsFlag() {
|
|
68055
|
-
this.columnInternals.validConfiguration = this.isValid();
|
|
68056
|
-
}
|
|
68057
|
-
}
|
|
68058
|
-
|
|
68059
68077
|
const dateTextValidityFlagNames = ['invalidCustomOptionsCombination'];
|
|
68060
68078
|
/**
|
|
68061
68079
|
* Validator for TableColumnDateText.
|
|
68062
68080
|
*/
|
|
68063
68081
|
class TableColumnDateTextValidator extends ColumnValidator {
|
|
68064
|
-
constructor(
|
|
68065
|
-
super(
|
|
68082
|
+
constructor() {
|
|
68083
|
+
super(dateTextValidityFlagNames);
|
|
68066
68084
|
}
|
|
68067
68085
|
setCustomOptionsValidity(valid) {
|
|
68068
68086
|
this.setConditionValue('invalidCustomOptionsCombination', !valid);
|
|
@@ -68092,8 +68110,6 @@ img.ProseMirror-separator {
|
|
|
68092
68110
|
class TableColumnDateText extends mixinTextBase((TableColumnTextBase)) {
|
|
68093
68111
|
constructor() {
|
|
68094
68112
|
super(...arguments);
|
|
68095
|
-
/** @internal */
|
|
68096
|
-
this.validator = new TableColumnDateTextValidator(this.columnInternals);
|
|
68097
68113
|
this.langSubscriber = {
|
|
68098
68114
|
handleChange: () => {
|
|
68099
68115
|
this.updateColumnConfig();
|
|
@@ -68109,9 +68125,6 @@ img.ProseMirror-separator {
|
|
|
68109
68125
|
super.disconnectedCallback();
|
|
68110
68126
|
lang.unsubscribe(this.langSubscriber, this);
|
|
68111
68127
|
}
|
|
68112
|
-
get validity() {
|
|
68113
|
-
return this.validator.getValidity();
|
|
68114
|
-
}
|
|
68115
68128
|
placeholderChanged() {
|
|
68116
68129
|
this.updateColumnConfig();
|
|
68117
68130
|
}
|
|
@@ -68121,7 +68134,8 @@ img.ProseMirror-separator {
|
|
|
68121
68134
|
cellViewTag: tableColumnDateTextCellViewTag,
|
|
68122
68135
|
groupHeaderViewTag: tableColumnDateTextGroupHeaderViewTag,
|
|
68123
68136
|
delegatedEvents: [],
|
|
68124
|
-
sortOperation: TableColumnSortOperation.basic
|
|
68137
|
+
sortOperation: TableColumnSortOperation.basic,
|
|
68138
|
+
validator: new TableColumnDateTextValidator()
|
|
68125
68139
|
};
|
|
68126
68140
|
}
|
|
68127
68141
|
formatChanged() {
|
|
@@ -68192,11 +68206,11 @@ img.ProseMirror-separator {
|
|
|
68192
68206
|
placeholder: this.placeholder
|
|
68193
68207
|
};
|
|
68194
68208
|
this.columnInternals.columnConfig = columnConfig;
|
|
68195
|
-
this.validator.setCustomOptionsValidity(true);
|
|
68209
|
+
this.columnInternals.validator.setCustomOptionsValidity(true);
|
|
68196
68210
|
}
|
|
68197
68211
|
else {
|
|
68198
68212
|
this.columnInternals.columnConfig = undefined;
|
|
68199
|
-
this.validator.setCustomOptionsValidity(false);
|
|
68213
|
+
this.columnInternals.validator.setCustomOptionsValidity(false);
|
|
68200
68214
|
}
|
|
68201
68215
|
}
|
|
68202
68216
|
createFormatter() {
|
|
@@ -68464,7 +68478,8 @@ img.ProseMirror-separator {
|
|
|
68464
68478
|
cellViewTag: tableColumnDurationTextCellViewTag,
|
|
68465
68479
|
groupHeaderViewTag: tableColumnDurationTextGroupHeaderViewTag,
|
|
68466
68480
|
delegatedEvents: [],
|
|
68467
|
-
sortOperation: TableColumnSortOperation.basic
|
|
68481
|
+
sortOperation: TableColumnSortOperation.basic,
|
|
68482
|
+
validator: new ColumnValidator([])
|
|
68468
68483
|
};
|
|
68469
68484
|
}
|
|
68470
68485
|
updateColumnConfig() {
|
|
@@ -68513,10 +68528,6 @@ img.ProseMirror-separator {
|
|
|
68513
68528
|
class TableColumnEnumBase extends TableColumn {
|
|
68514
68529
|
constructor() {
|
|
68515
68530
|
super(...arguments);
|
|
68516
|
-
// To ensure the validator is available when other properties get initialized
|
|
68517
|
-
// (which can trigger validation), declare the validator first.
|
|
68518
|
-
/** @internal */
|
|
68519
|
-
this.validator = this.createValidator();
|
|
68520
68531
|
/** @internal */
|
|
68521
68532
|
this.mappingNotifiers = [];
|
|
68522
68533
|
/** @internal */
|
|
@@ -68538,8 +68549,8 @@ img.ProseMirror-separator {
|
|
|
68538
68549
|
* Called when any Mapping related state has changed.
|
|
68539
68550
|
*/
|
|
68540
68551
|
updateColumnConfig() {
|
|
68541
|
-
this.validator.validate(this.mappings, this.keyType);
|
|
68542
|
-
this.columnInternals.columnConfig = this.
|
|
68552
|
+
this.columnInternals.validator.validate(this.mappings, this.keyType);
|
|
68553
|
+
this.columnInternals.columnConfig = this.checkValidity()
|
|
68543
68554
|
? this.createColumnConfig(this.getMappingConfigs())
|
|
68544
68555
|
: undefined;
|
|
68545
68556
|
}
|
|
@@ -68610,8 +68621,8 @@ img.ProseMirror-separator {
|
|
|
68610
68621
|
* Validator for TableColumnEnumText. Implementations MUST include enumBaseValidityFlagNames in validity flag names set.
|
|
68611
68622
|
*/
|
|
68612
68623
|
class TableColumnEnumBaseValidator extends ColumnValidator {
|
|
68613
|
-
constructor(
|
|
68614
|
-
super(
|
|
68624
|
+
constructor(configValidityKeys) {
|
|
68625
|
+
super(configValidityKeys);
|
|
68615
68626
|
}
|
|
68616
68627
|
validate(mappings, keyType) {
|
|
68617
68628
|
this.untrackAll();
|
|
@@ -68648,8 +68659,8 @@ img.ProseMirror-separator {
|
|
|
68648
68659
|
* Validator for TableColumnEnumText
|
|
68649
68660
|
*/
|
|
68650
68661
|
class TableColumnEnumTextValidator extends TableColumnEnumBaseValidator {
|
|
68651
|
-
constructor(
|
|
68652
|
-
super(
|
|
68662
|
+
constructor() {
|
|
68663
|
+
super(enumTextValidityFlagNames);
|
|
68653
68664
|
}
|
|
68654
68665
|
static isSupportedMappingElement(mapping) {
|
|
68655
68666
|
return mapping instanceof MappingText;
|
|
@@ -68735,19 +68746,14 @@ img.ProseMirror-separator {
|
|
|
68735
68746
|
* Table column that maps values to strings
|
|
68736
68747
|
*/
|
|
68737
68748
|
class TableColumnEnumText extends mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI((TableColumnEnumBase))) {
|
|
68738
|
-
createValidator() {
|
|
68739
|
-
return new TableColumnEnumTextValidator(this.columnInternals);
|
|
68740
|
-
}
|
|
68741
|
-
get validity() {
|
|
68742
|
-
return this.validator.getValidity();
|
|
68743
|
-
}
|
|
68744
68749
|
getColumnInternalsOptions() {
|
|
68745
68750
|
return {
|
|
68746
68751
|
cellRecordFieldNames: ['value'],
|
|
68747
68752
|
cellViewTag: tableColumnEnumTextCellViewTag,
|
|
68748
68753
|
groupHeaderViewTag: tableColumnEnumTextGroupHeaderViewTag,
|
|
68749
68754
|
delegatedEvents: [],
|
|
68750
|
-
sortOperation: TableColumnSortOperation.basic
|
|
68755
|
+
sortOperation: TableColumnSortOperation.basic,
|
|
68756
|
+
validator: new TableColumnEnumTextValidator()
|
|
68751
68757
|
};
|
|
68752
68758
|
}
|
|
68753
68759
|
createColumnConfig(mappingConfigs) {
|
|
@@ -69168,8 +69174,8 @@ img.ProseMirror-separator {
|
|
|
69168
69174
|
* Validator for TableColumnNumberText.
|
|
69169
69175
|
*/
|
|
69170
69176
|
class TableColumnNumberTextValidator extends ColumnValidator {
|
|
69171
|
-
constructor(
|
|
69172
|
-
super(
|
|
69177
|
+
constructor() {
|
|
69178
|
+
super(numberTextValidityFlagNames);
|
|
69173
69179
|
}
|
|
69174
69180
|
validateDecimalDigits(format, decimalDigits) {
|
|
69175
69181
|
const shouldValidateDecimalDigitsValue = format === NumberTextFormat.decimal
|
|
@@ -69220,8 +69226,6 @@ img.ProseMirror-separator {
|
|
|
69220
69226
|
class TableColumnNumberText extends mixinTextBase((TableColumnTextBase)) {
|
|
69221
69227
|
constructor() {
|
|
69222
69228
|
super(...arguments);
|
|
69223
|
-
/** @internal */
|
|
69224
|
-
this.validator = new TableColumnNumberTextValidator(this.columnInternals);
|
|
69225
69229
|
this.langSubscriber = {
|
|
69226
69230
|
handleChange: () => {
|
|
69227
69231
|
this.updateColumnConfig();
|
|
@@ -69242,9 +69246,6 @@ img.ProseMirror-separator {
|
|
|
69242
69246
|
super.disconnectedCallback();
|
|
69243
69247
|
lang.unsubscribe(this.langSubscriber, this);
|
|
69244
69248
|
}
|
|
69245
|
-
get validity() {
|
|
69246
|
-
return this.validator.getValidity();
|
|
69247
|
-
}
|
|
69248
69249
|
placeholderChanged() {
|
|
69249
69250
|
this.updateColumnConfig();
|
|
69250
69251
|
}
|
|
@@ -69254,7 +69255,8 @@ img.ProseMirror-separator {
|
|
|
69254
69255
|
cellViewTag: tableColumnNumberTextCellViewTag,
|
|
69255
69256
|
groupHeaderViewTag: tableColumnNumberTextGroupHeaderTag,
|
|
69256
69257
|
delegatedEvents: [],
|
|
69257
|
-
sortOperation: TableColumnSortOperation.basic
|
|
69258
|
+
sortOperation: TableColumnSortOperation.basic,
|
|
69259
|
+
validator: new TableColumnNumberTextValidator()
|
|
69258
69260
|
};
|
|
69259
69261
|
}
|
|
69260
69262
|
updateUnitNotifier() {
|
|
@@ -69295,11 +69297,12 @@ img.ProseMirror-separator {
|
|
|
69295
69297
|
this.updateColumnConfig();
|
|
69296
69298
|
}
|
|
69297
69299
|
updateColumnConfig() {
|
|
69298
|
-
|
|
69299
|
-
|
|
69300
|
-
|
|
69301
|
-
|
|
69302
|
-
|
|
69300
|
+
const validator = this.columnInternals.validator;
|
|
69301
|
+
validator.validateDecimalDigits(this.format, this.decimalDigits);
|
|
69302
|
+
validator.validateDecimalMaximumDigits(this.format, this.decimalMaximumDigits);
|
|
69303
|
+
validator.validateNoMutuallyExclusiveProperties(this.format, this.decimalDigits, this.decimalMaximumDigits);
|
|
69304
|
+
validator.validateAtMostOneUnit(this.unitElements ?? []);
|
|
69305
|
+
if (validator.isValid()) {
|
|
69303
69306
|
const columnConfig = {
|
|
69304
69307
|
formatter: this.createFormatter(),
|
|
69305
69308
|
alignment: this.determineCellContentAlignment(),
|
|
@@ -69378,8 +69381,8 @@ img.ProseMirror-separator {
|
|
|
69378
69381
|
* Validator for TableColumnIcon
|
|
69379
69382
|
*/
|
|
69380
69383
|
class TableColumnIconValidator extends TableColumnEnumBaseValidator {
|
|
69381
|
-
constructor(
|
|
69382
|
-
super(
|
|
69384
|
+
constructor() {
|
|
69385
|
+
super(iconValidityFlagNames);
|
|
69383
69386
|
}
|
|
69384
69387
|
static isIconMappingElement(mapping) {
|
|
69385
69388
|
return mapping instanceof MappingIcon;
|
|
@@ -69610,19 +69613,14 @@ img.ProseMirror-separator {
|
|
|
69610
69613
|
* Table column that maps values to icons / spinners
|
|
69611
69614
|
*/
|
|
69612
69615
|
class TableColumnIcon extends mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI((TableColumnEnumBase))) {
|
|
69613
|
-
createValidator() {
|
|
69614
|
-
return new TableColumnIconValidator(this.columnInternals);
|
|
69615
|
-
}
|
|
69616
|
-
get validity() {
|
|
69617
|
-
return this.validator.getValidity();
|
|
69618
|
-
}
|
|
69619
69616
|
getColumnInternalsOptions() {
|
|
69620
69617
|
return {
|
|
69621
69618
|
cellRecordFieldNames: ['value'],
|
|
69622
69619
|
cellViewTag: tableColumnIconCellViewTag,
|
|
69623
69620
|
groupHeaderViewTag: tableColumnIconGroupHeaderViewTag,
|
|
69624
69621
|
delegatedEvents: [],
|
|
69625
|
-
sortOperation: TableColumnSortOperation.basic
|
|
69622
|
+
sortOperation: TableColumnSortOperation.basic,
|
|
69623
|
+
validator: new TableColumnIconValidator()
|
|
69626
69624
|
};
|
|
69627
69625
|
}
|
|
69628
69626
|
createColumnConfig(mappingConfigs) {
|
|
@@ -69684,7 +69682,8 @@ img.ProseMirror-separator {
|
|
|
69684
69682
|
cellViewTag: tableColumnTextCellViewTag,
|
|
69685
69683
|
groupHeaderViewTag: tableColumnTextGroupHeaderViewTag,
|
|
69686
69684
|
delegatedEvents: [],
|
|
69687
|
-
sortOperation: TableColumnSortOperation.localeAwareCaseSensitive
|
|
69685
|
+
sortOperation: TableColumnSortOperation.localeAwareCaseSensitive,
|
|
69686
|
+
validator: new ColumnValidator([])
|
|
69688
69687
|
};
|
|
69689
69688
|
}
|
|
69690
69689
|
}
|