@ni/nimble-components 24.1.11 → 24.1.13
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 +20 -23
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +769 -767
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/rich-text/editor/testing/rich-text-editor.pageobject.js +3 -1
- package/dist/esm/rich-text/editor/testing/rich-text-editor.pageobject.js.map +1 -1
- package/dist/esm/rich-text/models/configuration.js +1 -1
- package/dist/esm/rich-text/models/configuration.js.map +1 -1
- package/dist/esm/rich-text/models/rich-text-validator.js +1 -1
- package/dist/esm/rich-text/models/rich-text-validator.js.map +1 -1
- package/dist/esm/rich-text-mention/base/index.d.ts +1 -4
- package/dist/esm/rich-text-mention/base/index.js +5 -7
- package/dist/esm/rich-text-mention/base/index.js.map +1 -1
- package/dist/esm/rich-text-mention/base/models/mention-internals.d.ts +9 -7
- package/dist/esm/rich-text-mention/base/models/mention-internals.js +1 -7
- package/dist/esm/rich-text-mention/base/models/mention-internals.js.map +1 -1
- package/dist/esm/rich-text-mention/base/models/mention-validator.d.ts +1 -4
- package/dist/esm/rich-text-mention/base/models/mention-validator.js +1 -6
- package/dist/esm/rich-text-mention/base/models/mention-validator.js.map +1 -1
- package/dist/esm/rich-text-mention/users/index.d.ts +1 -2
- package/dist/esm/rich-text-mention/users/index.js +2 -4
- package/dist/esm/rich-text-mention/users/index.js.map +1 -1
- package/dist/esm/rich-text-mention/users/models/rich-text-mention-users-validator.d.ts +1 -2
- package/dist/esm/rich-text-mention/users/models/rich-text-mention-users-validator.js +2 -2
- package/dist/esm/rich-text-mention/users/models/rich-text-mention-users-validator.js.map +1 -1
- package/dist/esm/select/index.js +11 -6
- package/dist/esm/select/index.js.map +1 -1
- package/dist/esm/src/rich-text-mention/base/index.d.ts +1 -4
- package/dist/esm/src/rich-text-mention/base/models/mention-internals.d.ts +9 -7
- package/dist/esm/src/rich-text-mention/base/models/mention-validator.d.ts +1 -4
- package/dist/esm/src/rich-text-mention/users/index.d.ts +1 -2
- package/dist/esm/src/rich-text-mention/users/models/rich-text-mention-users-validator.d.ts +1 -2
- package/package.json +1 -1
|
@@ -16333,7 +16333,7 @@
|
|
|
16333
16333
|
|
|
16334
16334
|
/**
|
|
16335
16335
|
* Do not edit directly
|
|
16336
|
-
* Generated on Wed, 10 Apr 2024
|
|
16336
|
+
* Generated on Wed, 10 Apr 2024 21:43:42 GMT
|
|
16337
16337
|
*/
|
|
16338
16338
|
|
|
16339
16339
|
const Information100DarkUi = "#a46eff";
|
|
@@ -53413,22 +53413,16 @@ img.ProseMirror-separator {
|
|
|
53413
53413
|
*/
|
|
53414
53414
|
class MentionInternals {
|
|
53415
53415
|
constructor(options, mentionUpdateEmitter) {
|
|
53416
|
-
/**
|
|
53417
|
-
* Whether this mention has a valid configuration.
|
|
53418
|
-
*/
|
|
53419
|
-
this.validConfiguration = true;
|
|
53420
53416
|
this.iconTemplate = html `<${options.icon} slot="start"></${options.icon}>`;
|
|
53421
53417
|
this.character = options.character;
|
|
53422
53418
|
this.viewElement = options.viewElement;
|
|
53419
|
+
this.validator = options.validator;
|
|
53423
53420
|
this.mentionUpdateEmitter = mentionUpdateEmitter;
|
|
53424
53421
|
}
|
|
53425
53422
|
}
|
|
53426
53423
|
__decorate$1([
|
|
53427
53424
|
observable
|
|
53428
53425
|
], MentionInternals.prototype, "mappingConfigs", void 0);
|
|
53429
|
-
__decorate$1([
|
|
53430
|
-
observable
|
|
53431
|
-
], MentionInternals.prototype, "validConfiguration", void 0);
|
|
53432
53426
|
__decorate$1([
|
|
53433
53427
|
observable
|
|
53434
53428
|
], MentionInternals.prototype, "pattern", void 0);
|
|
@@ -53449,8 +53443,6 @@ img.ProseMirror-separator {
|
|
|
53449
53443
|
this.emitMentionUpdate(filter);
|
|
53450
53444
|
});
|
|
53451
53445
|
/** @internal */
|
|
53452
|
-
this.validator = this.createValidator();
|
|
53453
|
-
/** @internal */
|
|
53454
53446
|
this.mappingNotifiers = [];
|
|
53455
53447
|
/** @internal */
|
|
53456
53448
|
this.mappingElements = [];
|
|
@@ -53459,13 +53451,13 @@ img.ProseMirror-separator {
|
|
|
53459
53451
|
* @public
|
|
53460
53452
|
*/
|
|
53461
53453
|
checkValidity() {
|
|
53462
|
-
return this.mentionInternals.
|
|
53454
|
+
return this.mentionInternals.validator.isValid();
|
|
53463
53455
|
}
|
|
53464
53456
|
/**
|
|
53465
53457
|
* @public
|
|
53466
53458
|
*/
|
|
53467
53459
|
get validity() {
|
|
53468
|
-
return this.validator.getValidity();
|
|
53460
|
+
return this.mentionInternals.validator.getValidity();
|
|
53469
53461
|
}
|
|
53470
53462
|
/**
|
|
53471
53463
|
* @internal
|
|
@@ -53499,8 +53491,8 @@ img.ProseMirror-separator {
|
|
|
53499
53491
|
return mappingConfigs;
|
|
53500
53492
|
}
|
|
53501
53493
|
updateMappingConfigs() {
|
|
53502
|
-
this.validator.validate(this.mappingElements, this.pattern);
|
|
53503
|
-
this.mentionInternals.mappingConfigs = this.validator.isValid()
|
|
53494
|
+
this.mentionInternals.validator.validate(this.mappingElements, this.pattern);
|
|
53495
|
+
this.mentionInternals.mappingConfigs = this.mentionInternals.validator.isValid()
|
|
53504
53496
|
? this.getMappingConfigs()
|
|
53505
53497
|
: undefined;
|
|
53506
53498
|
}
|
|
@@ -53509,7 +53501,7 @@ img.ProseMirror-separator {
|
|
|
53509
53501
|
this.observeMappingElements();
|
|
53510
53502
|
}
|
|
53511
53503
|
patternChanged() {
|
|
53512
|
-
this.validator.validate(this.mappingElements, this.pattern);
|
|
53504
|
+
this.mentionInternals.validator.validate(this.mappingElements, this.pattern);
|
|
53513
53505
|
this.mentionInternals.pattern = this.pattern;
|
|
53514
53506
|
}
|
|
53515
53507
|
buttonLabelChanged() {
|
|
@@ -53573,7 +53565,7 @@ img.ProseMirror-separator {
|
|
|
53573
53565
|
constructor(mentionElements) {
|
|
53574
53566
|
this.parserMentionConfig = [];
|
|
53575
53567
|
this.isValid = true;
|
|
53576
|
-
this.isValid = mentionElements.every(mentionElement => mentionElement.mentionInternals.
|
|
53568
|
+
this.isValid = mentionElements.every(mentionElement => mentionElement.mentionInternals.validator.isValid());
|
|
53577
53569
|
this.parserMentionConfig = this.isValid
|
|
53578
53570
|
? mentionElements.map(mentionElement => new MarkdownParserMentionConfiguration(mentionElement.mentionInternals))
|
|
53579
53571
|
: [];
|
|
@@ -53714,7 +53706,7 @@ img.ProseMirror-separator {
|
|
|
53714
53706
|
this.validateMentionConfigurations(mentions);
|
|
53715
53707
|
}
|
|
53716
53708
|
validateMentionConfigurations(mentions) {
|
|
53717
|
-
this.invalidMentionConfiguration = mentions.some(x => !x.mentionInternals.
|
|
53709
|
+
this.invalidMentionConfiguration = mentions.some(x => !x.mentionInternals.validator.isValid());
|
|
53718
53710
|
return !this.invalidMentionConfiguration;
|
|
53719
53711
|
}
|
|
53720
53712
|
validateDuplicateMentionConfigurations(mentions) {
|
|
@@ -58659,6 +58651,9 @@ img.ProseMirror-separator {
|
|
|
58659
58651
|
const isNimbleListOption = (el) => {
|
|
58660
58652
|
return el instanceof ListOption;
|
|
58661
58653
|
};
|
|
58654
|
+
const isOptionSelectable = (el) => {
|
|
58655
|
+
return !el.visuallyHidden && !el.disabled && !el.hidden;
|
|
58656
|
+
};
|
|
58662
58657
|
/**
|
|
58663
58658
|
* A nimble-styled HTML select.
|
|
58664
58659
|
*/
|
|
@@ -59088,7 +59083,9 @@ img.ProseMirror-separator {
|
|
|
59088
59083
|
// don't call super.selectNextOption as that relies on side-effecty
|
|
59089
59084
|
// behavior to not select disabled option (which no longer works)
|
|
59090
59085
|
for (let i = this.selectedIndex + 1; i < this.options.length; i++) {
|
|
59091
|
-
|
|
59086
|
+
const listOption = this.options[i];
|
|
59087
|
+
if (isNimbleListOption(listOption)
|
|
59088
|
+
&& isOptionSelectable(listOption)) {
|
|
59092
59089
|
this.selectedIndex = i;
|
|
59093
59090
|
break;
|
|
59094
59091
|
}
|
|
@@ -59098,7 +59095,9 @@ img.ProseMirror-separator {
|
|
|
59098
59095
|
// don't call super.selectPreviousOption as that relies on side-effecty
|
|
59099
59096
|
// behavior to not select disabled option (which no longer works)
|
|
59100
59097
|
for (let i = this.selectedIndex - 1; i >= 0; i--) {
|
|
59101
|
-
|
|
59098
|
+
const listOption = this.options[i];
|
|
59099
|
+
if (isNimbleListOption(listOption)
|
|
59100
|
+
&& isOptionSelectable(listOption)) {
|
|
59102
59101
|
this.selectedIndex = i;
|
|
59103
59102
|
break;
|
|
59104
59103
|
}
|
|
@@ -59207,9 +59206,6 @@ img.ProseMirror-separator {
|
|
|
59207
59206
|
const optionIsSelected = (option) => {
|
|
59208
59207
|
return option.hasAttribute('selected') || option.selected;
|
|
59209
59208
|
};
|
|
59210
|
-
const optionIsDisabled = (option) => {
|
|
59211
|
-
return option.hasAttribute('disabled') || option.disabled;
|
|
59212
|
-
};
|
|
59213
59209
|
let selectedIndex = -1;
|
|
59214
59210
|
let firstValidOptionIndex = -1;
|
|
59215
59211
|
for (let i = 0; i < options?.length; i++) {
|
|
@@ -59217,7 +59213,8 @@ img.ProseMirror-separator {
|
|
|
59217
59213
|
if (optionIsSelected(option) || option?.value === this.value) {
|
|
59218
59214
|
selectedIndex = i;
|
|
59219
59215
|
}
|
|
59220
|
-
if (firstValidOptionIndex === -1
|
|
59216
|
+
if (firstValidOptionIndex === -1
|
|
59217
|
+
&& isOptionSelectable(option)) {
|
|
59221
59218
|
firstValidOptionIndex = i;
|
|
59222
59219
|
}
|
|
59223
59220
|
}
|