@ni/nimble-components 29.8.2 → 29.9.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 +142 -14
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1109 -1106
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/table-column/anchor/index.d.ts +23 -6
- package/dist/esm/table-column/anchor/index.js +14 -5
- package/dist/esm/table-column/anchor/index.js.map +1 -1
- package/dist/esm/table-column/anchor/models/table-column-anchor-validator.d.ts +8 -0
- package/dist/esm/table-column/anchor/models/table-column-anchor-validator.js +13 -0
- package/dist/esm/table-column/anchor/models/table-column-anchor-validator.js.map +1 -0
- package/dist/esm/table-column/base/models/column-validator.d.ts +1 -1
- package/dist/esm/table-column/base/models/column-validator.js +4 -4
- package/dist/esm/table-column/base/models/column-validator.js.map +1 -1
- package/dist/esm/table-column/mixins/custom-sort-order.d.ts +26 -0
- package/dist/esm/table-column/mixins/custom-sort-order.js +66 -0
- package/dist/esm/table-column/mixins/custom-sort-order.js.map +1 -0
- package/dist/esm/table-column/text/index.d.ts +24 -6
- package/dist/esm/table-column/text/index.js +20 -4
- package/dist/esm/table-column/text/index.js.map +1 -1
- package/dist/esm/table-column/text/models/table-column-text-validator.d.ts +8 -0
- package/dist/esm/table-column/text/models/table-column-text-validator.js +13 -0
- package/dist/esm/table-column/text/models/table-column-text-validator.js.map +1 -0
- package/dist/esm/utilities/models/tracker.d.ts +1 -0
- package/dist/esm/utilities/models/tracker.js +19 -2
- package/dist/esm/utilities/models/tracker.js.map +1 -1
- package/package.json +3 -3
|
@@ -16333,7 +16333,7 @@
|
|
|
16333
16333
|
|
|
16334
16334
|
/**
|
|
16335
16335
|
* Do not edit directly
|
|
16336
|
-
* Generated on
|
|
16336
|
+
* Generated on Mon, 15 Jul 2024 21:06:17 GMT
|
|
16337
16337
|
*/
|
|
16338
16338
|
|
|
16339
16339
|
const Information100DarkUi = "#a46eff";
|
|
@@ -54474,16 +54474,32 @@ img.ProseMirror-separator {
|
|
|
54474
54474
|
return this.trackedItems[key];
|
|
54475
54475
|
}
|
|
54476
54476
|
track(key) {
|
|
54477
|
-
this.trackedItems[key]
|
|
54477
|
+
const wasTracked = this.trackedItems[key];
|
|
54478
|
+
if (!wasTracked) {
|
|
54479
|
+
this.trackedItems[key] = true;
|
|
54480
|
+
this.onTrackingChange();
|
|
54481
|
+
}
|
|
54478
54482
|
}
|
|
54479
54483
|
untrack(key) {
|
|
54480
|
-
this.trackedItems[key]
|
|
54484
|
+
const wasTracked = this.trackedItems[key];
|
|
54485
|
+
if (wasTracked) {
|
|
54486
|
+
this.trackedItems[key] = false;
|
|
54487
|
+
this.onTrackingChange();
|
|
54488
|
+
}
|
|
54481
54489
|
}
|
|
54482
54490
|
trackAll() {
|
|
54491
|
+
if (this.allTracked()) {
|
|
54492
|
+
return;
|
|
54493
|
+
}
|
|
54483
54494
|
this.setAllKeys(true);
|
|
54495
|
+
this.onTrackingChange();
|
|
54484
54496
|
}
|
|
54485
54497
|
untrackAll() {
|
|
54498
|
+
if (this.noneTracked()) {
|
|
54499
|
+
return;
|
|
54500
|
+
}
|
|
54486
54501
|
this.setAllKeys(false);
|
|
54502
|
+
this.onTrackingChange();
|
|
54487
54503
|
}
|
|
54488
54504
|
allTracked() {
|
|
54489
54505
|
return Object.values(this.trackedItems).every(x => x);
|
|
@@ -54494,6 +54510,7 @@ img.ProseMirror-separator {
|
|
|
54494
54510
|
noneTracked() {
|
|
54495
54511
|
return Object.values(this.trackedItems).every(x => !x);
|
|
54496
54512
|
}
|
|
54513
|
+
onTrackingChange() { }
|
|
54497
54514
|
setAllKeys(value) {
|
|
54498
54515
|
this.trackedItems = Object.keys(this.trackedItems).reduce((r, key) => {
|
|
54499
54516
|
return {
|
|
@@ -68457,6 +68474,10 @@ focus outline in that case.
|
|
|
68457
68474
|
getValidity() {
|
|
68458
68475
|
return this.getValidationFlags();
|
|
68459
68476
|
}
|
|
68477
|
+
onTrackingChange() {
|
|
68478
|
+
super.onTrackingChange();
|
|
68479
|
+
this.isColumnValid = this.isValid();
|
|
68480
|
+
}
|
|
68460
68481
|
/**
|
|
68461
68482
|
* Sets a particular validity condition flag's value, e.g. "hasInvalidFooValue" = true
|
|
68462
68483
|
*/
|
|
@@ -68467,10 +68488,6 @@ focus outline in that case.
|
|
|
68467
68488
|
else {
|
|
68468
68489
|
this.untrack(name);
|
|
68469
68490
|
}
|
|
68470
|
-
this.updateColumnInternalsFlag();
|
|
68471
|
-
}
|
|
68472
|
-
updateColumnInternalsFlag() {
|
|
68473
|
-
this.isColumnValid = this.isValid();
|
|
68474
68491
|
}
|
|
68475
68492
|
}
|
|
68476
68493
|
__decorate$1([
|
|
@@ -70760,25 +70777,105 @@ focus outline in that case.
|
|
|
70760
70777
|
return SortableColumn;
|
|
70761
70778
|
}
|
|
70762
70779
|
|
|
70780
|
+
// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference
|
|
70781
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
|
|
70782
|
+
function mixinCustomSortOrderColumnAPI(base) {
|
|
70783
|
+
/**
|
|
70784
|
+
* The Mixin that provides a concrete column with the API to allow sorting
|
|
70785
|
+
* by a field other than the default for that column.
|
|
70786
|
+
*/
|
|
70787
|
+
class CustomSortOrderColumn extends base {
|
|
70788
|
+
constructor() {
|
|
70789
|
+
super(...arguments);
|
|
70790
|
+
/** @internal */
|
|
70791
|
+
this.customSortOrderColumnChangeHandler = {
|
|
70792
|
+
handleChange: this.handleCustomSortOrderColumnChange.bind(this)
|
|
70793
|
+
};
|
|
70794
|
+
}
|
|
70795
|
+
getResolvedOperandDataRecordFieldName(initialOperandFieldName) {
|
|
70796
|
+
return typeof this.sortByFieldName === 'string'
|
|
70797
|
+
? this.sortByFieldName
|
|
70798
|
+
: initialOperandFieldName;
|
|
70799
|
+
}
|
|
70800
|
+
getResolvedSortOperation(initialSortOperation) {
|
|
70801
|
+
return typeof this.sortByFieldName === 'string'
|
|
70802
|
+
? TableColumnSortOperation.basic
|
|
70803
|
+
: initialSortOperation;
|
|
70804
|
+
}
|
|
70805
|
+
/** @internal */
|
|
70806
|
+
sortByFieldNameChanged() {
|
|
70807
|
+
this.handleSortConfigurationChange();
|
|
70808
|
+
this.updateCustomColumnSortingValidity();
|
|
70809
|
+
if (typeof this.sortByFieldName === 'string'
|
|
70810
|
+
&& !this.customSortOrderColumnNotifier) {
|
|
70811
|
+
this.customSortOrderColumnNotifier = Observable.getNotifier(this.columnInternals);
|
|
70812
|
+
this.customSortOrderColumnNotifier.subscribe(this.customSortOrderColumnChangeHandler);
|
|
70813
|
+
}
|
|
70814
|
+
else {
|
|
70815
|
+
this.customSortOrderColumnNotifier?.unsubscribe(this.customSortOrderColumnChangeHandler);
|
|
70816
|
+
this.customSortOrderColumnNotifier = undefined;
|
|
70817
|
+
}
|
|
70818
|
+
}
|
|
70819
|
+
/** @internal */
|
|
70820
|
+
handleCustomSortOrderColumnChange(_source, args) {
|
|
70821
|
+
if (args === 'groupingDisabled') {
|
|
70822
|
+
this.updateCustomColumnSortingValidity();
|
|
70823
|
+
}
|
|
70824
|
+
}
|
|
70825
|
+
/** @internal */
|
|
70826
|
+
updateCustomColumnSortingValidity() {
|
|
70827
|
+
const hasCustomColumnSorting = typeof this.sortByFieldName === 'string';
|
|
70828
|
+
const isGroupingEnabled = !this.columnInternals.groupingDisabled;
|
|
70829
|
+
const isValid = !isGroupingEnabled || !hasCustomColumnSorting;
|
|
70830
|
+
if (isValid) {
|
|
70831
|
+
this.columnInternals.validator.untrack('invalidCustomSortWithGrouping');
|
|
70832
|
+
}
|
|
70833
|
+
else {
|
|
70834
|
+
this.columnInternals.validator.track('invalidCustomSortWithGrouping');
|
|
70835
|
+
}
|
|
70836
|
+
}
|
|
70837
|
+
}
|
|
70838
|
+
attr({ attribute: 'sort-by-field-name' })(
|
|
70839
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
70840
|
+
CustomSortOrderColumn.prototype, 'sortByFieldName');
|
|
70841
|
+
return CustomSortOrderColumn;
|
|
70842
|
+
}
|
|
70843
|
+
|
|
70844
|
+
const columnAnchorValidityFlagNames = [
|
|
70845
|
+
'invalidCustomSortWithGrouping'
|
|
70846
|
+
];
|
|
70847
|
+
/**
|
|
70848
|
+
* Validator class for the anchor table column.
|
|
70849
|
+
*/
|
|
70850
|
+
class TableColumnAnchorValidator extends ColumnValidator {
|
|
70851
|
+
constructor() {
|
|
70852
|
+
super(columnAnchorValidityFlagNames);
|
|
70853
|
+
}
|
|
70854
|
+
}
|
|
70855
|
+
|
|
70763
70856
|
/**
|
|
70764
70857
|
* A table column for displaying links.
|
|
70765
70858
|
*/
|
|
70766
|
-
class TableColumnAnchor extends mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI(mixinColumnWithPlaceholderAPI(mixinSortableColumnAPI((TableColumn))))) {
|
|
70859
|
+
class TableColumnAnchor extends mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI(mixinColumnWithPlaceholderAPI(mixinSortableColumnAPI(mixinCustomSortOrderColumnAPI((TableColumn)))))) {
|
|
70767
70860
|
constructor() {
|
|
70768
70861
|
super(...arguments);
|
|
70769
70862
|
this.underlineHidden = false;
|
|
70863
|
+
this.defaultSortOperation = TableColumnSortOperation.localeAwareCaseSensitive;
|
|
70770
70864
|
}
|
|
70771
70865
|
placeholderChanged() {
|
|
70772
70866
|
this.updateColumnConfig();
|
|
70773
70867
|
}
|
|
70868
|
+
handleSortConfigurationChange() {
|
|
70869
|
+
this.updateColumnInternalsSortConfiguration();
|
|
70870
|
+
}
|
|
70774
70871
|
getColumnInternalsOptions() {
|
|
70775
70872
|
return {
|
|
70776
70873
|
cellRecordFieldNames: ['label', 'href'],
|
|
70777
70874
|
cellViewTag: tableColumnAnchorCellViewTag,
|
|
70778
70875
|
groupHeaderViewTag: tableColumnTextGroupHeaderViewTag,
|
|
70779
70876
|
delegatedEvents: ['click'],
|
|
70780
|
-
sortOperation:
|
|
70781
|
-
validator: new
|
|
70877
|
+
sortOperation: this.getResolvedSortOperation(this.defaultSortOperation),
|
|
70878
|
+
validator: new TableColumnAnchorValidator()
|
|
70782
70879
|
};
|
|
70783
70880
|
}
|
|
70784
70881
|
labelFieldNameChanged() {
|
|
@@ -70786,7 +70883,7 @@ focus outline in that case.
|
|
|
70786
70883
|
this.labelFieldName,
|
|
70787
70884
|
this.hrefFieldName
|
|
70788
70885
|
];
|
|
70789
|
-
this.
|
|
70886
|
+
this.updateColumnInternalsSortConfiguration();
|
|
70790
70887
|
}
|
|
70791
70888
|
hrefFieldNameChanged() {
|
|
70792
70889
|
this.columnInternals.dataRecordFieldNames = [
|
|
@@ -70835,6 +70932,10 @@ focus outline in that case.
|
|
|
70835
70932
|
placeholder: this.placeholder
|
|
70836
70933
|
};
|
|
70837
70934
|
}
|
|
70935
|
+
updateColumnInternalsSortConfiguration() {
|
|
70936
|
+
this.columnInternals.operandDataRecordFieldName = this.getResolvedOperandDataRecordFieldName(this.labelFieldName);
|
|
70937
|
+
this.columnInternals.sortOperation = this.getResolvedSortOperation(this.defaultSortOperation);
|
|
70938
|
+
}
|
|
70838
70939
|
}
|
|
70839
70940
|
__decorate$1([
|
|
70840
70941
|
attr({ attribute: 'label-field-name' })
|
|
@@ -72852,25 +72953,52 @@ focus outline in that case.
|
|
|
72852
72953
|
DesignSystem.getOrCreate().withPrefix('nimble').register(textCellView());
|
|
72853
72954
|
const tableColumnTextCellViewTag = 'nimble-table-column-text-cell-view';
|
|
72854
72955
|
|
|
72956
|
+
const columnTextValidityFlagNames = [
|
|
72957
|
+
'invalidCustomSortWithGrouping'
|
|
72958
|
+
];
|
|
72959
|
+
/**
|
|
72960
|
+
* Validator class for the text table column.
|
|
72961
|
+
*/
|
|
72962
|
+
class TableColumnTextValidator extends ColumnValidator {
|
|
72963
|
+
constructor() {
|
|
72964
|
+
super(columnTextValidityFlagNames);
|
|
72965
|
+
}
|
|
72966
|
+
}
|
|
72967
|
+
|
|
72855
72968
|
/**
|
|
72856
72969
|
* The table column for displaying string fields as text.
|
|
72857
72970
|
*/
|
|
72858
|
-
class TableColumnText extends mixinTextBase((TableColumnTextBase)) {
|
|
72971
|
+
class TableColumnText extends mixinCustomSortOrderColumnAPI(mixinTextBase((TableColumnTextBase))) {
|
|
72972
|
+
constructor() {
|
|
72973
|
+
super(...arguments);
|
|
72974
|
+
this.defaultSortOperation = TableColumnSortOperation.localeAwareCaseSensitive;
|
|
72975
|
+
}
|
|
72859
72976
|
placeholderChanged() {
|
|
72860
72977
|
this.columnInternals.columnConfig = {
|
|
72861
72978
|
placeholder: this.placeholder
|
|
72862
72979
|
};
|
|
72863
72980
|
}
|
|
72981
|
+
handleSortConfigurationChange() {
|
|
72982
|
+
this.updateColumnInternalsSortConfiguration();
|
|
72983
|
+
}
|
|
72864
72984
|
getColumnInternalsOptions() {
|
|
72865
72985
|
return {
|
|
72866
72986
|
cellRecordFieldNames: ['value'],
|
|
72867
72987
|
cellViewTag: tableColumnTextCellViewTag,
|
|
72868
72988
|
groupHeaderViewTag: tableColumnTextGroupHeaderViewTag,
|
|
72869
72989
|
delegatedEvents: [],
|
|
72870
|
-
sortOperation:
|
|
72871
|
-
validator: new
|
|
72990
|
+
sortOperation: this.getResolvedSortOperation(this.defaultSortOperation),
|
|
72991
|
+
validator: new TableColumnTextValidator()
|
|
72872
72992
|
};
|
|
72873
72993
|
}
|
|
72994
|
+
fieldNameChanged() {
|
|
72995
|
+
this.columnInternals.dataRecordFieldNames = [this.fieldName];
|
|
72996
|
+
this.updateColumnInternalsSortConfiguration();
|
|
72997
|
+
}
|
|
72998
|
+
updateColumnInternalsSortConfiguration() {
|
|
72999
|
+
this.columnInternals.operandDataRecordFieldName = this.getResolvedOperandDataRecordFieldName(this.fieldName);
|
|
73000
|
+
this.columnInternals.sortOperation = this.getResolvedSortOperation(this.defaultSortOperation);
|
|
73001
|
+
}
|
|
72874
73002
|
}
|
|
72875
73003
|
const nimbleTableColumnText = TableColumnText.compose({
|
|
72876
73004
|
baseName: 'table-column-text',
|