@ni/nimble-components 21.3.3 → 21.5.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 +1238 -235
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +3744 -3538
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/anchored-region/styles.js +6 -1
- package/dist/esm/anchored-region/styles.js.map +1 -1
- package/dist/esm/label-provider/core/index.d.ts +6 -0
- package/dist/esm/label-provider/core/index.js +10 -2
- package/dist/esm/label-provider/core/index.js.map +1 -1
- package/dist/esm/label-provider/core/label-token-defaults.js +3 -1
- package/dist/esm/label-provider/core/label-token-defaults.js.map +1 -1
- package/dist/esm/label-provider/core/label-tokens.d.ts +2 -0
- package/dist/esm/label-provider/core/label-tokens.js +8 -0
- package/dist/esm/label-provider/core/label-tokens.js.map +1 -1
- package/dist/esm/label-provider/table/index.d.ts +3 -0
- package/dist/esm/label-provider/table/index.js +6 -2
- package/dist/esm/label-provider/table/index.js.map +1 -1
- package/dist/esm/label-provider/table/label-token-defaults.js +2 -1
- package/dist/esm/label-provider/table/label-token-defaults.js.map +1 -1
- package/dist/esm/label-provider/table/label-tokens.d.ts +1 -0
- package/dist/esm/label-provider/table/label-tokens.js +4 -0
- package/dist/esm/label-provider/table/label-tokens.js.map +1 -1
- package/dist/esm/patterns/dropdown/styles.js +0 -4
- package/dist/esm/patterns/dropdown/styles.js.map +1 -1
- package/dist/esm/select/index.d.ts +251 -7
- package/dist/esm/select/index.js +653 -19
- package/dist/esm/select/index.js.map +1 -1
- package/dist/esm/select/models/select-form-associated.d.ts +16 -0
- package/dist/esm/select/models/select-form-associated.js +19 -0
- package/dist/esm/select/models/select-form-associated.js.map +1 -0
- package/dist/esm/select/styles.js +89 -1
- package/dist/esm/select/styles.js.map +1 -1
- package/dist/esm/select/template.js +71 -37
- package/dist/esm/select/template.js.map +1 -1
- package/dist/esm/select/testing/select.pageobject.d.ts +32 -0
- package/dist/esm/select/testing/select.pageobject.js +128 -0
- package/dist/esm/select/testing/select.pageobject.js.map +1 -0
- package/dist/esm/select/types.d.ts +9 -0
- package/dist/esm/select/types.js +8 -0
- package/dist/esm/select/types.js.map +1 -1
- package/dist/esm/table/components/row/index.d.ts +1 -0
- package/dist/esm/table/components/row/index.js +4 -0
- package/dist/esm/table/components/row/index.js.map +1 -1
- package/dist/esm/table/components/row/styles.js +17 -1
- package/dist/esm/table/components/row/styles.js.map +1 -1
- package/dist/esm/table/components/row/template.js +26 -12
- package/dist/esm/table/components/row/template.js.map +1 -1
- package/dist/esm/table/index.js +2 -1
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/models/expansion-manager.d.ts +1 -0
- package/dist/esm/table/models/expansion-manager.js +9 -2
- package/dist/esm/table/models/expansion-manager.js.map +1 -1
- package/dist/esm/table/template.js +1 -0
- package/dist/esm/table/template.js.map +1 -1
- package/dist/esm/table/testing/table.pageobject.d.ts +1 -0
- package/dist/esm/table/testing/table.pageobject.js +6 -1
- package/dist/esm/table/testing/table.pageobject.js.map +1 -1
- package/dist/esm/table/types.d.ts +2 -0
- package/dist/esm/table/types.js +2 -1
- package/dist/esm/table/types.js.map +1 -1
- package/package.json +5 -2
|
@@ -12570,12 +12570,12 @@
|
|
|
12570
12570
|
*
|
|
12571
12571
|
* @internal
|
|
12572
12572
|
*/
|
|
12573
|
-
class FormAssociatedSelect extends FormAssociated(_Select) {
|
|
12573
|
+
let FormAssociatedSelect$1 = class FormAssociatedSelect extends FormAssociated(_Select) {
|
|
12574
12574
|
constructor() {
|
|
12575
12575
|
super(...arguments);
|
|
12576
12576
|
this.proxy = document.createElement("select");
|
|
12577
12577
|
}
|
|
12578
|
-
}
|
|
12578
|
+
};
|
|
12579
12579
|
|
|
12580
12580
|
/**
|
|
12581
12581
|
* A Select Custom HTML Element.
|
|
@@ -12596,7 +12596,7 @@
|
|
|
12596
12596
|
*
|
|
12597
12597
|
* @public
|
|
12598
12598
|
*/
|
|
12599
|
-
let Select$
|
|
12599
|
+
let Select$2 = class Select extends FormAssociatedSelect$1 {
|
|
12600
12600
|
constructor() {
|
|
12601
12601
|
super(...arguments);
|
|
12602
12602
|
/**
|
|
@@ -13031,22 +13031,22 @@
|
|
|
13031
13031
|
};
|
|
13032
13032
|
__decorate([
|
|
13033
13033
|
attr({ attribute: "open", mode: "boolean" })
|
|
13034
|
-
], Select$
|
|
13034
|
+
], Select$2.prototype, "open", void 0);
|
|
13035
13035
|
__decorate([
|
|
13036
13036
|
volatile
|
|
13037
|
-
], Select$
|
|
13037
|
+
], Select$2.prototype, "collapsible", null);
|
|
13038
13038
|
__decorate([
|
|
13039
13039
|
observable
|
|
13040
|
-
], Select$
|
|
13040
|
+
], Select$2.prototype, "control", void 0);
|
|
13041
13041
|
__decorate([
|
|
13042
13042
|
attr({ attribute: "position" })
|
|
13043
|
-
], Select$
|
|
13043
|
+
], Select$2.prototype, "positionAttribute", void 0);
|
|
13044
13044
|
__decorate([
|
|
13045
13045
|
observable
|
|
13046
|
-
], Select$
|
|
13046
|
+
], Select$2.prototype, "position", void 0);
|
|
13047
13047
|
__decorate([
|
|
13048
13048
|
observable
|
|
13049
|
-
], Select$
|
|
13049
|
+
], Select$2.prototype, "maxHeight", void 0);
|
|
13050
13050
|
/**
|
|
13051
13051
|
* Includes ARIA states and properties relating to the ARIA select role.
|
|
13052
13052
|
*
|
|
@@ -13058,7 +13058,7 @@
|
|
|
13058
13058
|
observable
|
|
13059
13059
|
], DelegatesARIASelect.prototype, "ariaControls", void 0);
|
|
13060
13060
|
applyMixins(DelegatesARIASelect, DelegatesARIAListbox);
|
|
13061
|
-
applyMixins(Select$
|
|
13061
|
+
applyMixins(Select$2, StartEnd, DelegatesARIASelect);
|
|
13062
13062
|
|
|
13063
13063
|
class _Switch extends FoundationElement {
|
|
13064
13064
|
}
|
|
@@ -16301,7 +16301,7 @@
|
|
|
16301
16301
|
|
|
16302
16302
|
/**
|
|
16303
16303
|
* Do not edit directly
|
|
16304
|
-
* Generated on
|
|
16304
|
+
* Generated on Thu, 15 Feb 2024 20:33:21 GMT
|
|
16305
16305
|
*/
|
|
16306
16306
|
|
|
16307
16307
|
const Information100DarkUi = "#a46eff";
|
|
@@ -18576,10 +18576,15 @@
|
|
|
18576
18576
|
|
|
18577
18577
|
const styles$P = css `
|
|
18578
18578
|
:host {
|
|
18579
|
-
|
|
18579
|
+
/* Avoid using the 'display' helper to customize hidden behavior */
|
|
18580
18580
|
display: block;
|
|
18581
|
+
contain: layout;
|
|
18581
18582
|
z-index: ${ZIndexLevels.zIndex1000};
|
|
18582
18583
|
}
|
|
18584
|
+
|
|
18585
|
+
:host([hidden]) {
|
|
18586
|
+
visibility: hidden;
|
|
18587
|
+
}
|
|
18583
18588
|
`;
|
|
18584
18589
|
|
|
18585
18590
|
// When the anchor element changes position on the page, it is the client's responsibility to update the position
|
|
@@ -19730,7 +19735,9 @@
|
|
|
19730
19735
|
numericDecrementLabel: 'Decrement',
|
|
19731
19736
|
errorIconLabel: 'Error',
|
|
19732
19737
|
warningIconLabel: 'Warning',
|
|
19733
|
-
informationIconLabel: 'Information'
|
|
19738
|
+
informationIconLabel: 'Information',
|
|
19739
|
+
filterSearchLabel: 'Search',
|
|
19740
|
+
filterNoResultsLabel: 'No items found'
|
|
19734
19741
|
};
|
|
19735
19742
|
|
|
19736
19743
|
const popupDismissLabel = DesignToken.create({
|
|
@@ -19757,6 +19764,14 @@
|
|
|
19757
19764
|
name: 'information-icon-label',
|
|
19758
19765
|
cssCustomPropertyName: null
|
|
19759
19766
|
}).withDefault(coreLabelDefaults.informationIconLabel);
|
|
19767
|
+
const filterSearchLabel = DesignToken.create({
|
|
19768
|
+
name: 'filter-search-label',
|
|
19769
|
+
cssCustomPropertyName: null
|
|
19770
|
+
}).withDefault(coreLabelDefaults.filterSearchLabel);
|
|
19771
|
+
const filterNoResultsLabel = DesignToken.create({
|
|
19772
|
+
name: 'filter-no-results-label',
|
|
19773
|
+
cssCustomPropertyName: null
|
|
19774
|
+
}).withDefault(coreLabelDefaults.filterNoResultsLabel);
|
|
19760
19775
|
|
|
19761
19776
|
// prettier-ignore
|
|
19762
19777
|
const template$x = html `
|
|
@@ -20643,10 +20658,6 @@
|
|
|
20643
20658
|
border-bottom-color: ${failColor};
|
|
20644
20659
|
}
|
|
20645
20660
|
|
|
20646
|
-
.anchored-region[hidden] {
|
|
20647
|
-
visibility: hidden;
|
|
20648
|
-
}
|
|
20649
|
-
|
|
20650
20661
|
.listbox {
|
|
20651
20662
|
box-sizing: border-box;
|
|
20652
20663
|
display: inline-flex;
|
|
@@ -20793,6 +20804,19 @@
|
|
|
20793
20804
|
}
|
|
20794
20805
|
`;
|
|
20795
20806
|
|
|
20807
|
+
/**
|
|
20808
|
+
* Types of dropdown appearance.
|
|
20809
|
+
* @public
|
|
20810
|
+
*/
|
|
20811
|
+
/**
|
|
20812
|
+
* Types of select filter mode.
|
|
20813
|
+
* @public
|
|
20814
|
+
*/
|
|
20815
|
+
const FilterMode = {
|
|
20816
|
+
none: undefined,
|
|
20817
|
+
standard: 'standard'
|
|
20818
|
+
};
|
|
20819
|
+
|
|
20796
20820
|
const styles$D = css `
|
|
20797
20821
|
${styles$F}
|
|
20798
20822
|
${styles$E}
|
|
@@ -23135,6 +23159,7 @@
|
|
|
23135
23159
|
}
|
|
23136
23160
|
}
|
|
23137
23161
|
registerIcon('icon-magnifying-glass', IconMagnifyingGlass);
|
|
23162
|
+
const iconMagnifyingGlassTag = 'nimble-icon-magnifying-glass';
|
|
23138
23163
|
|
|
23139
23164
|
// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
23140
23165
|
// See generation source in nimble-components/build/generate-icons
|
|
@@ -23920,7 +23945,9 @@
|
|
|
23920
23945
|
numericIncrement: numericIncrementLabel,
|
|
23921
23946
|
errorIcon: errorIconLabel,
|
|
23922
23947
|
warningIcon: warningIconLabel,
|
|
23923
|
-
informationIcon: informationIconLabel
|
|
23948
|
+
informationIcon: informationIconLabel,
|
|
23949
|
+
filterSearch: filterSearchLabel,
|
|
23950
|
+
filterNoResults: filterNoResultsLabel
|
|
23924
23951
|
};
|
|
23925
23952
|
/**
|
|
23926
23953
|
* Core label provider for Nimble
|
|
@@ -23949,6 +23976,12 @@
|
|
|
23949
23976
|
__decorate$1([
|
|
23950
23977
|
attr({ attribute: 'information-icon' })
|
|
23951
23978
|
], LabelProviderCore.prototype, "informationIcon", void 0);
|
|
23979
|
+
__decorate$1([
|
|
23980
|
+
attr({ attribute: 'filter-search' })
|
|
23981
|
+
], LabelProviderCore.prototype, "filterSearch", void 0);
|
|
23982
|
+
__decorate$1([
|
|
23983
|
+
attr({ attribute: 'filter-no-results' })
|
|
23984
|
+
], LabelProviderCore.prototype, "filterNoResults", void 0);
|
|
23952
23985
|
const nimbleLabelProviderCore = LabelProviderCore.compose({
|
|
23953
23986
|
baseName: 'label-provider-core'
|
|
23954
23987
|
});
|
|
@@ -23969,7 +24002,8 @@
|
|
|
23969
24002
|
tableSelectAllLabel: 'Select all rows',
|
|
23970
24003
|
tableGroupSelectAllLabel: 'Select all rows in group',
|
|
23971
24004
|
tableRowSelectLabel: 'Select row',
|
|
23972
|
-
tableRowOperationColumnLabel: 'Row operations'
|
|
24005
|
+
tableRowOperationColumnLabel: 'Row operations',
|
|
24006
|
+
tableRowLoadingLabel: 'Loading'
|
|
23973
24007
|
};
|
|
23974
24008
|
|
|
23975
24009
|
const tableGroupCollapseLabel = DesignToken.create({
|
|
@@ -24024,6 +24058,10 @@
|
|
|
24024
24058
|
name: 'table-row-operation-column-label',
|
|
24025
24059
|
cssCustomPropertyName: null
|
|
24026
24060
|
}).withDefault(tableLabelDefaults.tableRowOperationColumnLabel);
|
|
24061
|
+
const tableRowLoadingLabel = DesignToken.create({
|
|
24062
|
+
name: 'table-row-loading-label',
|
|
24063
|
+
cssCustomPropertyName: null
|
|
24064
|
+
}).withDefault(tableLabelDefaults.tableRowLoadingLabel);
|
|
24027
24065
|
|
|
24028
24066
|
const supportedLabels = {
|
|
24029
24067
|
groupCollapse: tableGroupCollapseLabel,
|
|
@@ -24038,7 +24076,8 @@
|
|
|
24038
24076
|
selectAll: tableSelectAllLabel,
|
|
24039
24077
|
groupSelectAll: tableGroupSelectAllLabel,
|
|
24040
24078
|
rowSelect: tableRowSelectLabel,
|
|
24041
|
-
rowOperationColumn: tableRowOperationColumnLabel
|
|
24079
|
+
rowOperationColumn: tableRowOperationColumnLabel,
|
|
24080
|
+
rowLoading: tableRowLoadingLabel
|
|
24042
24081
|
};
|
|
24043
24082
|
/**
|
|
24044
24083
|
* Label provider for the Nimble table (and its sub-components and columns)
|
|
@@ -24088,6 +24127,9 @@
|
|
|
24088
24127
|
__decorate$1([
|
|
24089
24128
|
attr({ attribute: 'row-operation-column' })
|
|
24090
24129
|
], LabelProviderTable.prototype, "rowOperationColumn", void 0);
|
|
24130
|
+
__decorate$1([
|
|
24131
|
+
attr({ attribute: 'row-loading' })
|
|
24132
|
+
], LabelProviderTable.prototype, "rowLoading", void 0);
|
|
24091
24133
|
const nimbleLabelProviderTable = LabelProviderTable.compose({
|
|
24092
24134
|
baseName: 'label-provider-table'
|
|
24093
24135
|
});
|
|
@@ -30335,10 +30377,10 @@
|
|
|
30335
30377
|
// Back up preferredDepth to cover defining textblocks directly
|
|
30336
30378
|
// above it, possibly skipping a non-defining textblock.
|
|
30337
30379
|
for (let d = preferredDepth - 1; d >= 0; d--) {
|
|
30338
|
-
let
|
|
30339
|
-
if (def && $from.node(
|
|
30380
|
+
let leftNode = leftNodes[d], def = definesContent(leftNode.type);
|
|
30381
|
+
if (def && !leftNode.sameMarkup($from.node(Math.abs(preferredTarget) - 1)))
|
|
30340
30382
|
preferredDepth = d;
|
|
30341
|
-
else if (def || !type.isTextblock)
|
|
30383
|
+
else if (def || !leftNode.type.isTextblock)
|
|
30342
30384
|
break;
|
|
30343
30385
|
}
|
|
30344
30386
|
for (let j = slice.openStart; j >= 0; j--) {
|
|
@@ -30480,6 +30522,51 @@
|
|
|
30480
30522
|
}
|
|
30481
30523
|
}
|
|
30482
30524
|
Step.jsonID("attr", AttrStep);
|
|
30525
|
+
/**
|
|
30526
|
+
Update an attribute in the doc node.
|
|
30527
|
+
*/
|
|
30528
|
+
class DocAttrStep extends Step {
|
|
30529
|
+
/**
|
|
30530
|
+
Construct an attribute step.
|
|
30531
|
+
*/
|
|
30532
|
+
constructor(
|
|
30533
|
+
/**
|
|
30534
|
+
The attribute to set.
|
|
30535
|
+
*/
|
|
30536
|
+
attr,
|
|
30537
|
+
// The attribute's new value.
|
|
30538
|
+
value) {
|
|
30539
|
+
super();
|
|
30540
|
+
this.attr = attr;
|
|
30541
|
+
this.value = value;
|
|
30542
|
+
}
|
|
30543
|
+
apply(doc) {
|
|
30544
|
+
let attrs = Object.create(null);
|
|
30545
|
+
for (let name in doc.attrs)
|
|
30546
|
+
attrs[name] = doc.attrs[name];
|
|
30547
|
+
attrs[this.attr] = this.value;
|
|
30548
|
+
let updated = doc.type.create(attrs, doc.content, doc.marks);
|
|
30549
|
+
return StepResult.ok(updated);
|
|
30550
|
+
}
|
|
30551
|
+
getMap() {
|
|
30552
|
+
return StepMap.empty;
|
|
30553
|
+
}
|
|
30554
|
+
invert(doc) {
|
|
30555
|
+
return new DocAttrStep(this.attr, doc.attrs[this.attr]);
|
|
30556
|
+
}
|
|
30557
|
+
map(mapping) {
|
|
30558
|
+
return this;
|
|
30559
|
+
}
|
|
30560
|
+
toJSON() {
|
|
30561
|
+
return { stepType: "docAttr", attr: this.attr, value: this.value };
|
|
30562
|
+
}
|
|
30563
|
+
static fromJSON(schema, json) {
|
|
30564
|
+
if (typeof json.attr != "string")
|
|
30565
|
+
throw new RangeError("Invalid input for DocAttrStep.fromJSON");
|
|
30566
|
+
return new DocAttrStep(json.attr, json.value);
|
|
30567
|
+
}
|
|
30568
|
+
}
|
|
30569
|
+
Step.jsonID("docAttr", DocAttrStep);
|
|
30483
30570
|
|
|
30484
30571
|
/**
|
|
30485
30572
|
@internal
|
|
@@ -30684,12 +30771,21 @@
|
|
|
30684
30771
|
}
|
|
30685
30772
|
/**
|
|
30686
30773
|
Set a single attribute on a given node to a new value.
|
|
30774
|
+
The `pos` addresses the document content. Use `setDocAttribute`
|
|
30775
|
+
to set attributes on the document itself.
|
|
30687
30776
|
*/
|
|
30688
30777
|
setNodeAttribute(pos, attr, value) {
|
|
30689
30778
|
this.step(new AttrStep(pos, attr, value));
|
|
30690
30779
|
return this;
|
|
30691
30780
|
}
|
|
30692
30781
|
/**
|
|
30782
|
+
Set a single attribute on the document to a new value.
|
|
30783
|
+
*/
|
|
30784
|
+
setDocAttribute(attr, value) {
|
|
30785
|
+
this.step(new DocAttrStep(attr, value));
|
|
30786
|
+
return this;
|
|
30787
|
+
}
|
|
30788
|
+
/**
|
|
30693
30789
|
Add a mark to the node at position `pos`.
|
|
30694
30790
|
*/
|
|
30695
30791
|
addNodeMark(pos, mark) {
|
|
@@ -32175,6 +32271,11 @@
|
|
|
32175
32271
|
offset++;
|
|
32176
32272
|
}
|
|
32177
32273
|
}
|
|
32274
|
+
let prev;
|
|
32275
|
+
// When clicking above the right side of an uneditable node, Chrome will report a cursor position after that node.
|
|
32276
|
+
if (webkit && offset && node.nodeType == 1 && (prev = node.childNodes[offset - 1]).nodeType == 1 &&
|
|
32277
|
+
prev.contentEditable == "false" && prev.getBoundingClientRect().top >= coords.top)
|
|
32278
|
+
offset--;
|
|
32178
32279
|
// Suspiciously specific kludge to work around caret*FromPoint
|
|
32179
32280
|
// never returning a position at the end of the document
|
|
32180
32281
|
if (node == view.dom && offset == node.childNodes.length - 1 && node.lastChild.nodeType == 1 &&
|
|
@@ -33559,9 +33660,11 @@
|
|
|
33559
33660
|
}
|
|
33560
33661
|
else if (!locked && (updated = this.recreateWrapper(next, node, outerDeco, innerDeco, view, pos))) {
|
|
33561
33662
|
this.top.children[this.index] = updated;
|
|
33562
|
-
updated.
|
|
33563
|
-
|
|
33564
|
-
|
|
33663
|
+
if (updated.contentDOM) {
|
|
33664
|
+
updated.dirty = CONTENT_DIRTY;
|
|
33665
|
+
updated.updateChildren(view, pos + 1);
|
|
33666
|
+
updated.dirty = NOT_DIRTY;
|
|
33667
|
+
}
|
|
33565
33668
|
this.changed = true;
|
|
33566
33669
|
this.index++;
|
|
33567
33670
|
return true;
|
|
@@ -33578,13 +33681,13 @@
|
|
|
33578
33681
|
!next.node.content.eq(node.content))
|
|
33579
33682
|
return null;
|
|
33580
33683
|
let wrapper = NodeViewDesc.create(this.top, node, outerDeco, innerDeco, view, pos);
|
|
33581
|
-
if (
|
|
33582
|
-
|
|
33583
|
-
|
|
33584
|
-
|
|
33684
|
+
if (wrapper.contentDOM) {
|
|
33685
|
+
wrapper.children = next.children;
|
|
33686
|
+
next.children = [];
|
|
33687
|
+
for (let ch of wrapper.children)
|
|
33688
|
+
ch.parent = wrapper;
|
|
33689
|
+
}
|
|
33585
33690
|
next.destroy();
|
|
33586
|
-
for (let ch of wrapper.children)
|
|
33587
|
-
ch.parent = wrapper;
|
|
33588
33691
|
return wrapper;
|
|
33589
33692
|
}
|
|
33590
33693
|
// Insert the node as a newly created node desc.
|
|
@@ -33712,10 +33815,17 @@
|
|
|
33712
33815
|
}
|
|
33713
33816
|
let decoIndex = 0, active = [], restNode = null;
|
|
33714
33817
|
for (let parentIndex = 0;;) {
|
|
33715
|
-
|
|
33716
|
-
|
|
33717
|
-
|
|
33718
|
-
|
|
33818
|
+
let widget, widgets;
|
|
33819
|
+
while (decoIndex < locals.length && locals[decoIndex].to == offset) {
|
|
33820
|
+
let next = locals[decoIndex++];
|
|
33821
|
+
if (next.widget) {
|
|
33822
|
+
if (!widget)
|
|
33823
|
+
widget = next;
|
|
33824
|
+
else
|
|
33825
|
+
(widgets || (widgets = [widget])).push(next);
|
|
33826
|
+
}
|
|
33827
|
+
}
|
|
33828
|
+
if (widget) {
|
|
33719
33829
|
if (widgets) {
|
|
33720
33830
|
widgets.sort(compareSide);
|
|
33721
33831
|
for (let i = 0; i < widgets.length; i++)
|
|
@@ -33758,6 +33868,10 @@
|
|
|
33758
33868
|
index = -1;
|
|
33759
33869
|
}
|
|
33760
33870
|
}
|
|
33871
|
+
else {
|
|
33872
|
+
while (decoIndex < locals.length && locals[decoIndex].to < end)
|
|
33873
|
+
decoIndex++;
|
|
33874
|
+
}
|
|
33761
33875
|
let outerDeco = child.isInline && !child.isLeaf ? active.filter(d => !d.inline) : active.slice();
|
|
33762
33876
|
onNode(child, outerDeco, deco.forChild(offset, child), index);
|
|
33763
33877
|
offset = end;
|
|
@@ -33808,6 +33922,8 @@
|
|
|
33808
33922
|
str += next.text;
|
|
33809
33923
|
}
|
|
33810
33924
|
if (pos >= from) {
|
|
33925
|
+
if (pos >= to && str.slice(to - text.length - childStart, to - childStart) == text)
|
|
33926
|
+
return to - text.length;
|
|
33811
33927
|
let found = childStart < to ? str.lastIndexOf(text, to - childStart - 1) : -1;
|
|
33812
33928
|
if (found >= 0 && found + text.length + childStart >= from)
|
|
33813
33929
|
return childStart + found;
|
|
@@ -34061,7 +34177,14 @@
|
|
|
34061
34177
|
function selectHorizontally(view, dir, mods) {
|
|
34062
34178
|
let sel = view.state.selection;
|
|
34063
34179
|
if (sel instanceof TextSelection) {
|
|
34064
|
-
if (
|
|
34180
|
+
if (mods.indexOf("s") > -1) {
|
|
34181
|
+
let { $head } = sel, node = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter;
|
|
34182
|
+
if (!node || node.isText || !node.isLeaf)
|
|
34183
|
+
return false;
|
|
34184
|
+
let $newHead = view.state.doc.resolve($head.pos + node.nodeSize * (dir < 0 ? -1 : 1));
|
|
34185
|
+
return apply(view, new TextSelection(sel.$anchor, $newHead));
|
|
34186
|
+
}
|
|
34187
|
+
else if (!sel.empty) {
|
|
34065
34188
|
return false;
|
|
34066
34189
|
}
|
|
34067
34190
|
else if (view.endOfTextblock(dir > 0 ? "forward" : "backward")) {
|
|
@@ -34104,11 +34227,9 @@
|
|
|
34104
34227
|
function nodeLen(node) {
|
|
34105
34228
|
return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;
|
|
34106
34229
|
}
|
|
34107
|
-
function isIgnorable(dom) {
|
|
34108
|
-
if (dom.contentEditable == "false")
|
|
34109
|
-
return true;
|
|
34230
|
+
function isIgnorable(dom, dir) {
|
|
34110
34231
|
let desc = dom.pmViewDesc;
|
|
34111
|
-
return desc && desc.size == 0 && (dom.nextSibling || dom.nodeName != "BR");
|
|
34232
|
+
return desc && desc.size == 0 && (dir < 0 || dom.nextSibling || dom.nodeName != "BR");
|
|
34112
34233
|
}
|
|
34113
34234
|
function skipIgnoredNodes(view, dir) {
|
|
34114
34235
|
return dir < 0 ? skipIgnoredNodesBefore(view) : skipIgnoredNodesAfter(view);
|
|
@@ -34124,7 +34245,7 @@
|
|
|
34124
34245
|
// Gecko will do odd things when the selection is directly in front
|
|
34125
34246
|
// of a non-editable node, so in that case, move it into the next
|
|
34126
34247
|
// node if possible. Issue prosemirror/prosemirror#832.
|
|
34127
|
-
if (gecko && node.nodeType == 1 && offset < nodeLen(node) && isIgnorable(node.childNodes[offset]))
|
|
34248
|
+
if (gecko && node.nodeType == 1 && offset < nodeLen(node) && isIgnorable(node.childNodes[offset], -1))
|
|
34128
34249
|
force = true;
|
|
34129
34250
|
for (;;) {
|
|
34130
34251
|
if (offset > 0) {
|
|
@@ -34133,7 +34254,7 @@
|
|
|
34133
34254
|
}
|
|
34134
34255
|
else {
|
|
34135
34256
|
let before = node.childNodes[offset - 1];
|
|
34136
|
-
if (isIgnorable(before)) {
|
|
34257
|
+
if (isIgnorable(before, -1)) {
|
|
34137
34258
|
moveNode = node;
|
|
34138
34259
|
moveOffset = --offset;
|
|
34139
34260
|
}
|
|
@@ -34150,7 +34271,7 @@
|
|
|
34150
34271
|
}
|
|
34151
34272
|
else {
|
|
34152
34273
|
let prev = node.previousSibling;
|
|
34153
|
-
while (prev && isIgnorable(prev)) {
|
|
34274
|
+
while (prev && isIgnorable(prev, -1)) {
|
|
34154
34275
|
moveNode = node.parentNode;
|
|
34155
34276
|
moveOffset = domIndex(prev);
|
|
34156
34277
|
prev = prev.previousSibling;
|
|
@@ -34186,7 +34307,7 @@
|
|
|
34186
34307
|
if (node.nodeType != 1)
|
|
34187
34308
|
break;
|
|
34188
34309
|
let after = node.childNodes[offset];
|
|
34189
|
-
if (isIgnorable(after)) {
|
|
34310
|
+
if (isIgnorable(after, 1)) {
|
|
34190
34311
|
moveNode = node;
|
|
34191
34312
|
moveOffset = ++offset;
|
|
34192
34313
|
}
|
|
@@ -34198,7 +34319,7 @@
|
|
|
34198
34319
|
}
|
|
34199
34320
|
else {
|
|
34200
34321
|
let next = node.nextSibling;
|
|
34201
|
-
while (next && isIgnorable(next)) {
|
|
34322
|
+
while (next && isIgnorable(next, 1)) {
|
|
34202
34323
|
moveNode = next.parentNode;
|
|
34203
34324
|
moveOffset = domIndex(next) + 1;
|
|
34204
34325
|
next = next.nextSibling;
|
|
@@ -34229,9 +34350,12 @@
|
|
|
34229
34350
|
node = node.parentNode;
|
|
34230
34351
|
}
|
|
34231
34352
|
while (node && offset < node.childNodes.length) {
|
|
34232
|
-
|
|
34233
|
-
if (
|
|
34234
|
-
return
|
|
34353
|
+
let next = node.childNodes[offset];
|
|
34354
|
+
if (next.nodeType == 3)
|
|
34355
|
+
return next;
|
|
34356
|
+
if (next.nodeType == 1 && next.contentEditable == "false")
|
|
34357
|
+
break;
|
|
34358
|
+
node = next;
|
|
34235
34359
|
offset = 0;
|
|
34236
34360
|
}
|
|
34237
34361
|
}
|
|
@@ -34241,9 +34365,12 @@
|
|
|
34241
34365
|
node = node.parentNode;
|
|
34242
34366
|
}
|
|
34243
34367
|
while (node && offset) {
|
|
34244
|
-
|
|
34245
|
-
if (
|
|
34246
|
-
return
|
|
34368
|
+
let next = node.childNodes[offset - 1];
|
|
34369
|
+
if (next.nodeType == 3)
|
|
34370
|
+
return next;
|
|
34371
|
+
if (next.nodeType == 1 && next.contentEditable == "false")
|
|
34372
|
+
break;
|
|
34373
|
+
node = next;
|
|
34247
34374
|
offset = node.childNodes.length;
|
|
34248
34375
|
}
|
|
34249
34376
|
}
|
|
@@ -34405,7 +34532,7 @@
|
|
|
34405
34532
|
return selectVertically(view, -1, mods) || skipIgnoredNodes(view, -1);
|
|
34406
34533
|
}
|
|
34407
34534
|
else if (code == 40 || (mac$2 && code == 78 && mods == "c")) { // Down arrow, Ctrl-n on Mac
|
|
34408
|
-
return safariDownArrowBug(view) || selectVertically(view, 1, mods) ||
|
|
34535
|
+
return safariDownArrowBug(view) || selectVertically(view, 1, mods) || skipIgnoredNodes(view, 1);
|
|
34409
34536
|
}
|
|
34410
34537
|
else if (mods == (mac$2 ? "m" : "c") &&
|
|
34411
34538
|
(code == 66 || code == 73 || code == 89 || code == 90)) { // Mod-[biyz]
|
|
@@ -35244,6 +35371,13 @@
|
|
|
35244
35371
|
view.dispatch(tr.scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste"));
|
|
35245
35372
|
return true;
|
|
35246
35373
|
}
|
|
35374
|
+
function getText$1(clipboardData) {
|
|
35375
|
+
let text = clipboardData.getData("text/plain") || clipboardData.getData("Text");
|
|
35376
|
+
if (text)
|
|
35377
|
+
return text;
|
|
35378
|
+
let uris = clipboardData.getData("text/uri-list");
|
|
35379
|
+
return uris ? uris.replace(/\r?\n/g, " ") : "";
|
|
35380
|
+
}
|
|
35247
35381
|
editHandlers.paste = (view, _event) => {
|
|
35248
35382
|
let event = _event;
|
|
35249
35383
|
// Handling paste from JavaScript during composition is very poorly
|
|
@@ -35254,15 +35388,16 @@
|
|
|
35254
35388
|
return;
|
|
35255
35389
|
let data = brokenClipboardAPI ? null : event.clipboardData;
|
|
35256
35390
|
let plain = view.input.shiftKey && view.input.lastKeyCode != 45;
|
|
35257
|
-
if (data && doPaste(view, data
|
|
35391
|
+
if (data && doPaste(view, getText$1(data), data.getData("text/html"), plain, event))
|
|
35258
35392
|
event.preventDefault();
|
|
35259
35393
|
else
|
|
35260
35394
|
capturePaste(view, event);
|
|
35261
35395
|
};
|
|
35262
35396
|
class Dragging {
|
|
35263
|
-
constructor(slice, move) {
|
|
35397
|
+
constructor(slice, move, node) {
|
|
35264
35398
|
this.slice = slice;
|
|
35265
35399
|
this.move = move;
|
|
35400
|
+
this.node = node;
|
|
35266
35401
|
}
|
|
35267
35402
|
}
|
|
35268
35403
|
const dragCopyModifier = mac$2 ? "altKey" : "ctrlKey";
|
|
@@ -35275,23 +35410,24 @@
|
|
|
35275
35410
|
return;
|
|
35276
35411
|
let sel = view.state.selection;
|
|
35277
35412
|
let pos = sel.empty ? null : view.posAtCoords(eventCoords(event));
|
|
35413
|
+
let node;
|
|
35278
35414
|
if (pos && pos.pos >= sel.from && pos.pos <= (sel instanceof NodeSelection ? sel.to - 1 : sel.to)) ;
|
|
35279
35415
|
else if (mouseDown && mouseDown.mightDrag) {
|
|
35280
|
-
|
|
35416
|
+
node = NodeSelection.create(view.state.doc, mouseDown.mightDrag.pos);
|
|
35281
35417
|
}
|
|
35282
35418
|
else if (event.target && event.target.nodeType == 1) {
|
|
35283
35419
|
let desc = view.docView.nearestDesc(event.target, true);
|
|
35284
35420
|
if (desc && desc.node.type.spec.draggable && desc != view.docView)
|
|
35285
|
-
|
|
35421
|
+
node = NodeSelection.create(view.state.doc, desc.posBefore);
|
|
35286
35422
|
}
|
|
35287
|
-
let slice = view.state.selection.content(), { dom, text } = serializeForClipboard(view, slice);
|
|
35423
|
+
let slice = (node || view.state.selection).content(), { dom, text } = serializeForClipboard(view, slice);
|
|
35288
35424
|
event.dataTransfer.clearData();
|
|
35289
35425
|
event.dataTransfer.setData(brokenClipboardAPI ? "Text" : "text/html", dom.innerHTML);
|
|
35290
35426
|
// See https://github.com/ProseMirror/prosemirror/issues/1156
|
|
35291
35427
|
event.dataTransfer.effectAllowed = "copyMove";
|
|
35292
35428
|
if (!brokenClipboardAPI)
|
|
35293
35429
|
event.dataTransfer.setData("text/plain", text);
|
|
35294
|
-
view.dragging = new Dragging(slice, !event[dragCopyModifier]);
|
|
35430
|
+
view.dragging = new Dragging(slice, !event[dragCopyModifier], node);
|
|
35295
35431
|
};
|
|
35296
35432
|
handlers.dragend = view => {
|
|
35297
35433
|
let dragging = view.dragging;
|
|
@@ -35316,7 +35452,7 @@
|
|
|
35316
35452
|
view.someProp("transformPasted", f => { slice = f(slice, view); });
|
|
35317
35453
|
}
|
|
35318
35454
|
else {
|
|
35319
|
-
slice = parseFromClipboard(view, event.dataTransfer
|
|
35455
|
+
slice = parseFromClipboard(view, getText$1(event.dataTransfer), brokenClipboardAPI ? null : event.dataTransfer.getData("text/html"), false, $mouse);
|
|
35320
35456
|
}
|
|
35321
35457
|
let move = !!(dragging && !event[dragCopyModifier]);
|
|
35322
35458
|
if (view.someProp("handleDrop", f => f(view, event, slice || Slice.empty, move))) {
|
|
@@ -35330,8 +35466,13 @@
|
|
|
35330
35466
|
if (insertPos == null)
|
|
35331
35467
|
insertPos = $mouse.pos;
|
|
35332
35468
|
let tr = view.state.tr;
|
|
35333
|
-
if (move)
|
|
35334
|
-
|
|
35469
|
+
if (move) {
|
|
35470
|
+
let { node } = dragging;
|
|
35471
|
+
if (node)
|
|
35472
|
+
node.replace(tr);
|
|
35473
|
+
else
|
|
35474
|
+
tr.deleteSelection();
|
|
35475
|
+
}
|
|
35335
35476
|
let pos = tr.mapping.map(insertPos);
|
|
35336
35477
|
let isNode = slice.openStart == 0 && slice.openEnd == 0 && slice.content.childCount == 1;
|
|
35337
35478
|
let beforeInsert = tr.doc;
|
|
@@ -35563,6 +35704,10 @@
|
|
|
35563
35704
|
@internal
|
|
35564
35705
|
*/
|
|
35565
35706
|
get inline() { return this.type instanceof InlineType; }
|
|
35707
|
+
/**
|
|
35708
|
+
@internal
|
|
35709
|
+
*/
|
|
35710
|
+
get widget() { return this.type instanceof WidgetType; }
|
|
35566
35711
|
}
|
|
35567
35712
|
const none$1 = [], noSpec = {};
|
|
35568
35713
|
/**
|
|
@@ -35581,7 +35726,8 @@
|
|
|
35581
35726
|
}
|
|
35582
35727
|
/**
|
|
35583
35728
|
Create a set of decorations, using the structure of the given
|
|
35584
|
-
document.
|
|
35729
|
+
document. This will consume (modify) the `decorations` array, so
|
|
35730
|
+
you must make a copy if you want need to preserve that.
|
|
35585
35731
|
*/
|
|
35586
35732
|
static create(doc, decorations) {
|
|
35587
35733
|
return decorations.length ? buildTree(decorations, doc, 0, noSpec) : empty$1;
|
|
@@ -35640,8 +35786,9 @@
|
|
|
35640
35786
|
}
|
|
35641
35787
|
/**
|
|
35642
35788
|
Add the given array of decorations to the ones in the set,
|
|
35643
|
-
producing a new set.
|
|
35644
|
-
create the appropriate tree
|
|
35789
|
+
producing a new set. Consumes the `decorations` array. Needs
|
|
35790
|
+
access to the current document to create the appropriate tree
|
|
35791
|
+
structure.
|
|
35645
35792
|
*/
|
|
35646
35793
|
add(doc, decorations) {
|
|
35647
35794
|
if (!decorations.length)
|
|
@@ -35883,7 +36030,7 @@
|
|
|
35883
36030
|
if (oldEnd >= start) {
|
|
35884
36031
|
children[i + 1] = oldStart <= start ? -2 : -1;
|
|
35885
36032
|
}
|
|
35886
|
-
else if (
|
|
36033
|
+
else if (oldStart >= baseOffset && dSize) {
|
|
35887
36034
|
children[i] += dSize;
|
|
35888
36035
|
children[i + 1] += dSize;
|
|
35889
36036
|
}
|
|
@@ -36734,17 +36881,27 @@
|
|
|
36734
36881
|
if (endA < start && a.size < b.size) {
|
|
36735
36882
|
let move = preferredPos <= start && preferredPos >= endA ? start - preferredPos : 0;
|
|
36736
36883
|
start -= move;
|
|
36884
|
+
if (start && start < b.size && isSurrogatePair(b.textBetween(start - 1, start + 1)))
|
|
36885
|
+
start += move ? 1 : -1;
|
|
36737
36886
|
endB = start + (endB - endA);
|
|
36738
36887
|
endA = start;
|
|
36739
36888
|
}
|
|
36740
36889
|
else if (endB < start) {
|
|
36741
36890
|
let move = preferredPos <= start && preferredPos >= endB ? start - preferredPos : 0;
|
|
36742
36891
|
start -= move;
|
|
36892
|
+
if (start && start < a.size && isSurrogatePair(a.textBetween(start - 1, start + 1)))
|
|
36893
|
+
start += move ? 1 : -1;
|
|
36743
36894
|
endA = start + (endA - endB);
|
|
36744
36895
|
endB = start;
|
|
36745
36896
|
}
|
|
36746
36897
|
return { start, endA, endB };
|
|
36747
36898
|
}
|
|
36899
|
+
function isSurrogatePair(str) {
|
|
36900
|
+
if (str.length != 2)
|
|
36901
|
+
return false;
|
|
36902
|
+
let a = str.charCodeAt(0), b = str.charCodeAt(1);
|
|
36903
|
+
return a >= 0xDC00 && a <= 0xDFFF && b >= 0xD800 && b <= 0xDBFF;
|
|
36904
|
+
}
|
|
36748
36905
|
/**
|
|
36749
36906
|
An editor view manages the DOM structure that represents an
|
|
36750
36907
|
editable document. Its state and behavior are determined by its
|
|
@@ -36878,6 +37035,7 @@
|
|
|
36878
37035
|
this.updateStateInner(state, this._props);
|
|
36879
37036
|
}
|
|
36880
37037
|
updateStateInner(state, prevProps) {
|
|
37038
|
+
var _a;
|
|
36881
37039
|
let prev = this.state, redraw = false, updateSel = false;
|
|
36882
37040
|
// When stored marks are added, stop composition, so that they can
|
|
36883
37041
|
// be displayed.
|
|
@@ -36945,6 +37103,8 @@
|
|
|
36945
37103
|
this.domObserver.start();
|
|
36946
37104
|
}
|
|
36947
37105
|
this.updatePluginViews(prev);
|
|
37106
|
+
if (((_a = this.dragging) === null || _a === void 0 ? void 0 : _a.node) && !prev.doc.eq(state.doc))
|
|
37107
|
+
this.updateDraggedNode(this.dragging, prev);
|
|
36948
37108
|
if (scroll == "reset") {
|
|
36949
37109
|
this.dom.scrollTop = 0;
|
|
36950
37110
|
}
|
|
@@ -36999,6 +37159,19 @@
|
|
|
36999
37159
|
}
|
|
37000
37160
|
}
|
|
37001
37161
|
}
|
|
37162
|
+
updateDraggedNode(dragging, prev) {
|
|
37163
|
+
let sel = dragging.node, found = -1;
|
|
37164
|
+
if (this.state.doc.nodeAt(sel.from) == sel.node) {
|
|
37165
|
+
found = sel.from;
|
|
37166
|
+
}
|
|
37167
|
+
else {
|
|
37168
|
+
let movedPos = sel.from + (this.state.doc.content.size - prev.doc.content.size);
|
|
37169
|
+
let moved = movedPos > 0 && this.state.doc.nodeAt(movedPos);
|
|
37170
|
+
if (moved == sel.node)
|
|
37171
|
+
found = movedPos;
|
|
37172
|
+
}
|
|
37173
|
+
this.dragging = new Dragging(dragging.slice, dragging.move, found < 0 ? undefined : NodeSelection.create(this.state.doc, found));
|
|
37174
|
+
}
|
|
37002
37175
|
someProp(propName, f) {
|
|
37003
37176
|
let prop = this._props && this._props[propName], value;
|
|
37004
37177
|
if (prop != null && (value = f ? f(prop) : prop))
|
|
@@ -37069,6 +37242,13 @@
|
|
|
37069
37242
|
return cached || document;
|
|
37070
37243
|
}
|
|
37071
37244
|
/**
|
|
37245
|
+
When an existing editor view is moved to a new document or
|
|
37246
|
+
shadow tree, call this to make it recompute its root.
|
|
37247
|
+
*/
|
|
37248
|
+
updateRoot() {
|
|
37249
|
+
this._root = null;
|
|
37250
|
+
}
|
|
37251
|
+
/**
|
|
37072
37252
|
Given a pair of viewport coordinates, return the document
|
|
37073
37253
|
position that corresponds to them. May return null if the given
|
|
37074
37254
|
coordinates aren't inside of the editor. When an object is
|
|
@@ -53881,9 +54061,9 @@ img.ProseMirror-separator {
|
|
|
53881
54061
|
// THIS FILE IS AUTOMATICALLY GENERATED DO NOT EDIT DIRECTLY
|
|
53882
54062
|
// See update-tlds.js for encoding/decoding format
|
|
53883
54063
|
// https://data.iana.org/TLD/tlds-alpha-by-domain.txt
|
|
53884
|
-
const encodedTlds = '
|
|
54064
|
+
const encodedTlds = 'aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2';
|
|
53885
54065
|
// Internationalized domain names containing non-ASCII
|
|
53886
|
-
const encodedUtlds = 'ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5
|
|
54066
|
+
const encodedUtlds = 'ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2';
|
|
53887
54067
|
|
|
53888
54068
|
/**
|
|
53889
54069
|
* @template A
|
|
@@ -54271,14 +54451,24 @@ img.ProseMirror-separator {
|
|
|
54271
54451
|
const NL$1 = 'NL'; // \n
|
|
54272
54452
|
|
|
54273
54453
|
// Opening/closing bracket classes
|
|
54454
|
+
// TODO: Rename OPEN -> LEFT and CLOSE -> RIGHT in v5 to fit with Unicode names
|
|
54455
|
+
// Also rename angle brackes to LESSTHAN and GREATER THAN
|
|
54274
54456
|
const OPENBRACE = 'OPENBRACE'; // {
|
|
54275
|
-
const OPENBRACKET = 'OPENBRACKET'; // [
|
|
54276
|
-
const OPENANGLEBRACKET = 'OPENANGLEBRACKET'; // <
|
|
54277
|
-
const OPENPAREN = 'OPENPAREN'; // (
|
|
54278
54457
|
const CLOSEBRACE = 'CLOSEBRACE'; // }
|
|
54458
|
+
const OPENBRACKET = 'OPENBRACKET'; // [
|
|
54279
54459
|
const CLOSEBRACKET = 'CLOSEBRACKET'; // ]
|
|
54280
|
-
const
|
|
54460
|
+
const OPENPAREN = 'OPENPAREN'; // (
|
|
54281
54461
|
const CLOSEPAREN = 'CLOSEPAREN'; // )
|
|
54462
|
+
const OPENANGLEBRACKET = 'OPENANGLEBRACKET'; // <
|
|
54463
|
+
const CLOSEANGLEBRACKET = 'CLOSEANGLEBRACKET'; // >
|
|
54464
|
+
const FULLWIDTHLEFTPAREN = 'FULLWIDTHLEFTPAREN'; // (
|
|
54465
|
+
const FULLWIDTHRIGHTPAREN = 'FULLWIDTHRIGHTPAREN'; // )
|
|
54466
|
+
const LEFTCORNERBRACKET = 'LEFTCORNERBRACKET'; // 「
|
|
54467
|
+
const RIGHTCORNERBRACKET = 'RIGHTCORNERBRACKET'; // 」
|
|
54468
|
+
const LEFTWHITECORNERBRACKET = 'LEFTWHITECORNERBRACKET'; // 『
|
|
54469
|
+
const RIGHTWHITECORNERBRACKET = 'RIGHTWHITECORNERBRACKET'; // 』
|
|
54470
|
+
const FULLWIDTHLESSTHAN = 'FULLWIDTHLESSTHAN'; // <
|
|
54471
|
+
const FULLWIDTHGREATERTHAN = 'FULLWIDTHGREATERTHAN'; // >
|
|
54282
54472
|
|
|
54283
54473
|
// Various symbols
|
|
54284
54474
|
const AMPERSAND = 'AMPERSAND'; // &
|
|
@@ -54326,13 +54516,21 @@ img.ProseMirror-separator {
|
|
|
54326
54516
|
WS: WS,
|
|
54327
54517
|
NL: NL$1,
|
|
54328
54518
|
OPENBRACE: OPENBRACE,
|
|
54329
|
-
OPENBRACKET: OPENBRACKET,
|
|
54330
|
-
OPENANGLEBRACKET: OPENANGLEBRACKET,
|
|
54331
|
-
OPENPAREN: OPENPAREN,
|
|
54332
54519
|
CLOSEBRACE: CLOSEBRACE,
|
|
54520
|
+
OPENBRACKET: OPENBRACKET,
|
|
54333
54521
|
CLOSEBRACKET: CLOSEBRACKET,
|
|
54334
|
-
|
|
54522
|
+
OPENPAREN: OPENPAREN,
|
|
54335
54523
|
CLOSEPAREN: CLOSEPAREN,
|
|
54524
|
+
OPENANGLEBRACKET: OPENANGLEBRACKET,
|
|
54525
|
+
CLOSEANGLEBRACKET: CLOSEANGLEBRACKET,
|
|
54526
|
+
FULLWIDTHLEFTPAREN: FULLWIDTHLEFTPAREN,
|
|
54527
|
+
FULLWIDTHRIGHTPAREN: FULLWIDTHRIGHTPAREN,
|
|
54528
|
+
LEFTCORNERBRACKET: LEFTCORNERBRACKET,
|
|
54529
|
+
RIGHTCORNERBRACKET: RIGHTCORNERBRACKET,
|
|
54530
|
+
LEFTWHITECORNERBRACKET: LEFTWHITECORNERBRACKET,
|
|
54531
|
+
RIGHTWHITECORNERBRACKET: RIGHTWHITECORNERBRACKET,
|
|
54532
|
+
FULLWIDTHLESSTHAN: FULLWIDTHLESSTHAN,
|
|
54533
|
+
FULLWIDTHGREATERTHAN: FULLWIDTHGREATERTHAN,
|
|
54336
54534
|
AMPERSAND: AMPERSAND,
|
|
54337
54535
|
APOSTROPHE: APOSTROPHE,
|
|
54338
54536
|
ASTERISK: ASTERISK,
|
|
@@ -54420,13 +54618,21 @@ img.ProseMirror-separator {
|
|
|
54420
54618
|
// States for special URL symbols that accept immediately after start
|
|
54421
54619
|
tt(Start, "'", APOSTROPHE);
|
|
54422
54620
|
tt(Start, '{', OPENBRACE);
|
|
54423
|
-
tt(Start, '[', OPENBRACKET);
|
|
54424
|
-
tt(Start, '<', OPENANGLEBRACKET);
|
|
54425
|
-
tt(Start, '(', OPENPAREN);
|
|
54426
54621
|
tt(Start, '}', CLOSEBRACE);
|
|
54622
|
+
tt(Start, '[', OPENBRACKET);
|
|
54427
54623
|
tt(Start, ']', CLOSEBRACKET);
|
|
54428
|
-
tt(Start, '
|
|
54624
|
+
tt(Start, '(', OPENPAREN);
|
|
54429
54625
|
tt(Start, ')', CLOSEPAREN);
|
|
54626
|
+
tt(Start, '<', OPENANGLEBRACKET);
|
|
54627
|
+
tt(Start, '>', CLOSEANGLEBRACKET);
|
|
54628
|
+
tt(Start, '(', FULLWIDTHLEFTPAREN);
|
|
54629
|
+
tt(Start, ')', FULLWIDTHRIGHTPAREN);
|
|
54630
|
+
tt(Start, '「', LEFTCORNERBRACKET);
|
|
54631
|
+
tt(Start, '」', RIGHTCORNERBRACKET);
|
|
54632
|
+
tt(Start, '『', LEFTWHITECORNERBRACKET);
|
|
54633
|
+
tt(Start, '』', RIGHTWHITECORNERBRACKET);
|
|
54634
|
+
tt(Start, '<', FULLWIDTHLESSTHAN);
|
|
54635
|
+
tt(Start, '>', FULLWIDTHGREATERTHAN);
|
|
54430
54636
|
tt(Start, '&', AMPERSAND);
|
|
54431
54637
|
tt(Start, '*', ASTERISK);
|
|
54432
54638
|
tt(Start, '@', AT);
|
|
@@ -55197,11 +55403,11 @@ img.ProseMirror-separator {
|
|
|
55197
55403
|
// Types of tokens that can follow a URL and be part of the query string
|
|
55198
55404
|
// but cannot be the very last characters
|
|
55199
55405
|
// Characters that cannot appear in the URL at all should be excluded
|
|
55200
|
-
const qsNonAccepting = [APOSTROPHE,
|
|
55406
|
+
const qsNonAccepting = [APOSTROPHE, COLON, COMMA, DOT, EXCLAMATION, QUERY, QUOTE, SEMI, OPENANGLEBRACKET, CLOSEANGLEBRACKET, OPENBRACE, CLOSEBRACE, CLOSEBRACKET, OPENBRACKET, OPENPAREN, CLOSEPAREN, FULLWIDTHLEFTPAREN, FULLWIDTHRIGHTPAREN, LEFTCORNERBRACKET, RIGHTCORNERBRACKET, LEFTWHITECORNERBRACKET, RIGHTWHITECORNERBRACKET, FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN];
|
|
55201
55407
|
|
|
55202
55408
|
// For addresses without the mailto prefix
|
|
55203
55409
|
// Tokens allowed in the localpart of the email
|
|
55204
|
-
const localpartAccepting = [AMPERSAND, APOSTROPHE, ASTERISK, BACKSLASH, BACKTICK, CARET,
|
|
55410
|
+
const localpartAccepting = [AMPERSAND, APOSTROPHE, ASTERISK, BACKSLASH, BACKTICK, CARET, DOLLAR, EQUALS, HYPHEN, OPENBRACE, CLOSEBRACE, PERCENT, PIPE, PLUS, POUND, QUERY, SLASH, SYM, TILDE, UNDERSCORE];
|
|
55205
55411
|
|
|
55206
55412
|
// The universal starting state.
|
|
55207
55413
|
/**
|
|
@@ -55250,7 +55456,7 @@ img.ProseMirror-separator {
|
|
|
55250
55456
|
// Final possible email states
|
|
55251
55457
|
const EmailColon = tt(Email$1, COLON); // URL followed by colon (potential port number here)
|
|
55252
55458
|
/*const EmailColonPort = */
|
|
55253
|
-
ta(EmailColon, groups.numeric, Email); // URL followed by colon and port
|
|
55459
|
+
ta(EmailColon, groups.numeric, Email); // URL followed by colon and port number
|
|
55254
55460
|
|
|
55255
55461
|
// Account for dots and hyphens. Hyphens are usually parts of domain names
|
|
55256
55462
|
// (but not TLDs)
|
|
@@ -55309,72 +55515,51 @@ img.ProseMirror-separator {
|
|
|
55309
55515
|
ta(UriPrefix, groups.domain, Url$1);
|
|
55310
55516
|
ta(UriPrefix, qsAccepting, Url$1);
|
|
55311
55517
|
tt(UriPrefix, SLASH, Url$1);
|
|
55518
|
+
const bracketPairs = [[OPENBRACE, CLOSEBRACE],
|
|
55519
|
+
// {}
|
|
55520
|
+
[OPENBRACKET, CLOSEBRACKET],
|
|
55521
|
+
// []
|
|
55522
|
+
[OPENPAREN, CLOSEPAREN],
|
|
55523
|
+
// ()
|
|
55524
|
+
[OPENANGLEBRACKET, CLOSEANGLEBRACKET],
|
|
55525
|
+
// <>
|
|
55526
|
+
[FULLWIDTHLEFTPAREN, FULLWIDTHRIGHTPAREN],
|
|
55527
|
+
// ()
|
|
55528
|
+
[LEFTCORNERBRACKET, RIGHTCORNERBRACKET],
|
|
55529
|
+
// 「」
|
|
55530
|
+
[LEFTWHITECORNERBRACKET, RIGHTWHITECORNERBRACKET],
|
|
55531
|
+
// 『』
|
|
55532
|
+
[FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN] // <>
|
|
55533
|
+
];
|
|
55534
|
+
|
|
55535
|
+
for (let i = 0; i < bracketPairs.length; i++) {
|
|
55536
|
+
const [OPEN, CLOSE] = bracketPairs[i];
|
|
55537
|
+
const UrlOpen = tt(Url$1, OPEN); // URL followed by open bracket
|
|
55312
55538
|
|
|
55313
|
-
|
|
55314
|
-
|
|
55315
|
-
|
|
55316
|
-
|
|
55317
|
-
|
|
55318
|
-
|
|
55319
|
-
|
|
55320
|
-
|
|
55321
|
-
|
|
55322
|
-
|
|
55323
|
-
|
|
55324
|
-
|
|
55325
|
-
|
|
55326
|
-
|
|
55327
|
-
|
|
55328
|
-
|
|
55329
|
-
|
|
55330
|
-
|
|
55331
|
-
|
|
55332
|
-
|
|
55333
|
-
|
|
55334
|
-
|
|
55335
|
-
|
|
55336
|
-
|
|
55337
|
-
const UrlOpenparenQ = makeState(Url); // URL followed by ( and some symbols that the URL can end it
|
|
55338
|
-
ta(UrlOpenbrace, qsAccepting, UrlOpenbraceQ);
|
|
55339
|
-
ta(UrlOpenbracket, qsAccepting, UrlOpenbracketQ);
|
|
55340
|
-
ta(UrlOpenanglebracket, qsAccepting, UrlOpenanglebracketQ);
|
|
55341
|
-
ta(UrlOpenparen, qsAccepting, UrlOpenparenQ);
|
|
55342
|
-
const UrlOpenbraceSyms = makeState(); // UrlOpenbrace followed by some symbols it cannot end it
|
|
55343
|
-
const UrlOpenbracketSyms = makeState(); // UrlOpenbracketQ followed by some symbols it cannot end it
|
|
55344
|
-
const UrlOpenanglebracketSyms = makeState(); // UrlOpenanglebracketQ followed by some symbols it cannot end it
|
|
55345
|
-
const UrlOpenparenSyms = makeState(); // UrlOpenparenQ followed by some symbols it cannot end it
|
|
55346
|
-
ta(UrlOpenbrace, qsNonAccepting);
|
|
55347
|
-
ta(UrlOpenbracket, qsNonAccepting);
|
|
55348
|
-
ta(UrlOpenanglebracket, qsNonAccepting);
|
|
55349
|
-
ta(UrlOpenparen, qsNonAccepting);
|
|
55350
|
-
|
|
55351
|
-
// URL that begins with an opening bracket, followed by some symbols
|
|
55352
|
-
ta(UrlOpenbraceQ, qsAccepting, UrlOpenbraceQ);
|
|
55353
|
-
ta(UrlOpenbracketQ, qsAccepting, UrlOpenbracketQ);
|
|
55354
|
-
ta(UrlOpenanglebracketQ, qsAccepting, UrlOpenanglebracketQ);
|
|
55355
|
-
ta(UrlOpenparenQ, qsAccepting, UrlOpenparenQ);
|
|
55356
|
-
ta(UrlOpenbraceQ, qsNonAccepting, UrlOpenbraceQ);
|
|
55357
|
-
ta(UrlOpenbracketQ, qsNonAccepting, UrlOpenbracketQ);
|
|
55358
|
-
ta(UrlOpenanglebracketQ, qsNonAccepting, UrlOpenanglebracketQ);
|
|
55359
|
-
ta(UrlOpenparenQ, qsNonAccepting, UrlOpenparenQ);
|
|
55360
|
-
ta(UrlOpenbraceSyms, qsAccepting, UrlOpenbraceSyms);
|
|
55361
|
-
ta(UrlOpenbracketSyms, qsAccepting, UrlOpenbracketQ);
|
|
55362
|
-
ta(UrlOpenanglebracketSyms, qsAccepting, UrlOpenanglebracketQ);
|
|
55363
|
-
ta(UrlOpenparenSyms, qsAccepting, UrlOpenparenQ);
|
|
55364
|
-
ta(UrlOpenbraceSyms, qsNonAccepting, UrlOpenbraceSyms);
|
|
55365
|
-
ta(UrlOpenbracketSyms, qsNonAccepting, UrlOpenbracketSyms);
|
|
55366
|
-
ta(UrlOpenanglebracketSyms, qsNonAccepting, UrlOpenanglebracketSyms);
|
|
55367
|
-
ta(UrlOpenparenSyms, qsNonAccepting, UrlOpenparenSyms);
|
|
55368
|
-
|
|
55369
|
-
// Close brace/bracket to become regular URL
|
|
55370
|
-
tt(UrlOpenbracketQ, CLOSEBRACKET, Url$1);
|
|
55371
|
-
tt(UrlOpenanglebracketQ, CLOSEANGLEBRACKET, Url$1);
|
|
55372
|
-
tt(UrlOpenparenQ, CLOSEPAREN, Url$1);
|
|
55373
|
-
tt(UrlOpenbraceQ, CLOSEBRACE, Url$1);
|
|
55374
|
-
tt(UrlOpenbracketSyms, CLOSEBRACKET, Url$1);
|
|
55375
|
-
tt(UrlOpenanglebracketSyms, CLOSEANGLEBRACKET, Url$1);
|
|
55376
|
-
tt(UrlOpenparenSyms, CLOSEPAREN, Url$1);
|
|
55377
|
-
tt(UrlOpenbraceSyms, CLOSEPAREN, Url$1);
|
|
55539
|
+
// Continue not accepting for open brackets
|
|
55540
|
+
tt(UrlNonaccept, OPEN, UrlOpen);
|
|
55541
|
+
|
|
55542
|
+
// Closing bracket component. This character WILL be included in the URL
|
|
55543
|
+
tt(UrlOpen, CLOSE, Url$1);
|
|
55544
|
+
|
|
55545
|
+
// URL that beings with an opening bracket, followed by a symbols.
|
|
55546
|
+
// Note that the final state can still be `UrlOpen` (if the URL has a
|
|
55547
|
+
// single opening bracket for some reason).
|
|
55548
|
+
const UrlOpenQ = makeState(Url);
|
|
55549
|
+
ta(UrlOpen, qsAccepting, UrlOpenQ);
|
|
55550
|
+
const UrlOpenSyms = makeState(); // UrlOpen followed by some symbols it cannot end it
|
|
55551
|
+
ta(UrlOpen, qsNonAccepting);
|
|
55552
|
+
|
|
55553
|
+
// URL that begins with an opening bracket, followed by some symbols
|
|
55554
|
+
ta(UrlOpenQ, qsAccepting, UrlOpenQ);
|
|
55555
|
+
ta(UrlOpenQ, qsNonAccepting, UrlOpenSyms);
|
|
55556
|
+
ta(UrlOpenSyms, qsAccepting, UrlOpenQ);
|
|
55557
|
+
ta(UrlOpenSyms, qsNonAccepting, UrlOpenSyms);
|
|
55558
|
+
|
|
55559
|
+
// Close brace/bracket to become regular URL
|
|
55560
|
+
tt(UrlOpenQ, CLOSE, Url$1);
|
|
55561
|
+
tt(UrlOpenSyms, CLOSE, Url$1);
|
|
55562
|
+
}
|
|
55378
55563
|
tt(Start, LOCALHOST, DomainDotTld); // localhost is a valid URL state
|
|
55379
55564
|
tt(Start, NL$1, Nl); // single new line
|
|
55380
55565
|
|
|
@@ -55541,7 +55726,10 @@ img.ProseMirror-separator {
|
|
|
55541
55726
|
warn(`linkifyjs: already initialized - will not register custom scheme "${scheme}" ${warnAdvice}`);
|
|
55542
55727
|
}
|
|
55543
55728
|
if (!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(scheme)) {
|
|
55544
|
-
throw new Error(
|
|
55729
|
+
throw new Error(`linkifyjs: incorrect scheme format.
|
|
55730
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
55731
|
+
2. Cannot start or end with "-"
|
|
55732
|
+
3. "-" cannot repeat`);
|
|
55545
55733
|
}
|
|
55546
55734
|
INIT.customSchemes.push([scheme, optionalSlashSlash]);
|
|
55547
55735
|
}
|
|
@@ -55589,7 +55777,7 @@ img.ProseMirror-separator {
|
|
|
55589
55777
|
* links to find, e.g., 'url' or 'email'
|
|
55590
55778
|
* @param {Opts} [opts] formatting options for final output. Cannot be specified
|
|
55591
55779
|
* if opts already provided in `type` argument
|
|
55592
|
-
|
|
55780
|
+
*/
|
|
55593
55781
|
function find$1(str, type, opts) {
|
|
55594
55782
|
if (type === void 0) {
|
|
55595
55783
|
type = null;
|
|
@@ -55609,7 +55797,7 @@ img.ProseMirror-separator {
|
|
|
55609
55797
|
const filtered = [];
|
|
55610
55798
|
for (let i = 0; i < tokens.length; i++) {
|
|
55611
55799
|
const token = tokens[i];
|
|
55612
|
-
if (token.isLink && (!type || token.t === type)) {
|
|
55800
|
+
if (token.isLink && (!type || token.t === type) && options.check(token)) {
|
|
55613
55801
|
filtered.push(token.toFormattedObject(options));
|
|
55614
55802
|
}
|
|
55615
55803
|
}
|
|
@@ -56235,7 +56423,7 @@ img.ProseMirror-separator {
|
|
|
56235
56423
|
}
|
|
56236
56424
|
|
|
56237
56425
|
const SuggestionPluginKey = new PluginKey('suggestion');
|
|
56238
|
-
function Suggestion({ pluginKey = SuggestionPluginKey, editor, char = '@', allowSpaces = false, allowedPrefixes = [' '], startOfLine = false, decorationTag = 'span', decorationClass = 'suggestion', command = () => null, items = () => [], render = () => ({}), allow = () => true, }) {
|
|
56426
|
+
function Suggestion({ pluginKey = SuggestionPluginKey, editor, char = '@', allowSpaces = false, allowedPrefixes = [' '], startOfLine = false, decorationTag = 'span', decorationClass = 'suggestion', command = () => null, items = () => [], render = () => ({}), allow = () => true, findSuggestionMatch: findSuggestionMatch$1 = findSuggestionMatch, }) {
|
|
56239
56427
|
let props;
|
|
56240
56428
|
const renderer = render === null || render === void 0 ? void 0 : render();
|
|
56241
56429
|
const plugin = new Plugin({
|
|
@@ -56349,7 +56537,7 @@ img.ProseMirror-separator {
|
|
|
56349
56537
|
next.active = false;
|
|
56350
56538
|
}
|
|
56351
56539
|
// Try to match against where our cursor currently is
|
|
56352
|
-
const match = findSuggestionMatch({
|
|
56540
|
+
const match = findSuggestionMatch$1({
|
|
56353
56541
|
char,
|
|
56354
56542
|
allowSpaces,
|
|
56355
56543
|
allowedPrefixes,
|
|
@@ -57569,13 +57757,97 @@ img.ProseMirror-separator {
|
|
|
57569
57757
|
[part='end'] {
|
|
57570
57758
|
display: contents;
|
|
57571
57759
|
}
|
|
57760
|
+
|
|
57761
|
+
.listbox {
|
|
57762
|
+
overflow-x: clip;
|
|
57763
|
+
}
|
|
57764
|
+
|
|
57765
|
+
.listbox.empty slot {
|
|
57766
|
+
display: none;
|
|
57767
|
+
}
|
|
57768
|
+
|
|
57769
|
+
.listbox.above {
|
|
57770
|
+
flex-flow: column-reverse;
|
|
57771
|
+
}
|
|
57772
|
+
|
|
57773
|
+
.filter-field {
|
|
57774
|
+
display: flex;
|
|
57775
|
+
flex-direction: row;
|
|
57776
|
+
align-items: center;
|
|
57777
|
+
height: ${controlHeight};
|
|
57778
|
+
background: transparent;
|
|
57779
|
+
}
|
|
57780
|
+
|
|
57781
|
+
.filter-field::before {
|
|
57782
|
+
content: '';
|
|
57783
|
+
position: absolute;
|
|
57784
|
+
height: 0px;
|
|
57785
|
+
border-bottom: rgba(${borderRgbPartialColor}, 0.1) 2px solid;
|
|
57786
|
+
bottom: calc(${controlHeight} + ${smallPadding} - ${borderWidth});
|
|
57787
|
+
}
|
|
57788
|
+
|
|
57789
|
+
.filter-field.above::before {
|
|
57790
|
+
width: calc(100% - (2 * ${borderWidth}));
|
|
57791
|
+
}
|
|
57792
|
+
|
|
57793
|
+
.filter-field::after {
|
|
57794
|
+
content: '';
|
|
57795
|
+
position: absolute;
|
|
57796
|
+
height: 0px;
|
|
57797
|
+
border-bottom: rgba(${borderRgbPartialColor}, 0.1) 2px solid;
|
|
57798
|
+
top: calc(${controlHeight} + ${smallPadding} - ${borderWidth});
|
|
57799
|
+
}
|
|
57800
|
+
|
|
57801
|
+
.filter-field:not(.above)::after {
|
|
57802
|
+
width: calc(100% - (2 * ${borderWidth}));
|
|
57803
|
+
}
|
|
57804
|
+
|
|
57805
|
+
.filter-icon {
|
|
57806
|
+
padding-left: ${smallPadding};
|
|
57807
|
+
}
|
|
57808
|
+
|
|
57809
|
+
.filter-input {
|
|
57810
|
+
background: transparent;
|
|
57811
|
+
border: none;
|
|
57812
|
+
color: inherit;
|
|
57813
|
+
font: inherit;
|
|
57814
|
+
height: var(--ni-nimble-control-height);
|
|
57815
|
+
padding: 0 ${smallPadding} 0 ${mediumPadding};
|
|
57816
|
+
width: 100%;
|
|
57817
|
+
}
|
|
57818
|
+
|
|
57819
|
+
.filter-input::placeholder {
|
|
57820
|
+
color: ${placeholderFontColor};
|
|
57821
|
+
}
|
|
57822
|
+
|
|
57823
|
+
.filter-input${focusVisible} {
|
|
57824
|
+
outline: 0px;
|
|
57825
|
+
}
|
|
57826
|
+
|
|
57827
|
+
.scrollable-region {
|
|
57828
|
+
overflow: auto;
|
|
57829
|
+
}
|
|
57830
|
+
|
|
57831
|
+
.no-results-label {
|
|
57832
|
+
color: ${placeholderFontColor};
|
|
57833
|
+
height: ${controlHeight};
|
|
57834
|
+
display: inline-flex;
|
|
57835
|
+
align-items: center;
|
|
57836
|
+
padding: ${smallPadding} ${mediumPadding};
|
|
57837
|
+
}
|
|
57572
57838
|
`.withBehaviors(appearanceBehavior(DropdownAppearance.block, css `
|
|
57573
57839
|
:host([error-visible]) .control {
|
|
57574
57840
|
border-bottom-width: ${borderWidth};
|
|
57575
57841
|
padding-bottom: 0;
|
|
57576
57842
|
}
|
|
57843
|
+
`), themeBehavior(Theme.color, css `
|
|
57844
|
+
.filter-field,
|
|
57845
|
+
.no-results-label {
|
|
57846
|
+
background: ${hexToRgbaCssColor(White, 0.15)};
|
|
57847
|
+
}
|
|
57577
57848
|
`));
|
|
57578
57849
|
|
|
57850
|
+
/* eslint-disable @typescript-eslint/indent */
|
|
57579
57851
|
// prettier-ignore
|
|
57580
57852
|
const template$l = (context, definition) => html `
|
|
57581
57853
|
<template
|
|
@@ -57584,11 +57856,9 @@ img.ProseMirror-separator {
|
|
|
57584
57856
|
x.collapsible && x.open && 'open',
|
|
57585
57857
|
x.disabled && 'disabled',
|
|
57586
57858
|
x.collapsible && x.position,
|
|
57587
|
-
]
|
|
57588
|
-
|
|
57589
|
-
|
|
57590
|
-
aria-activedescendant="${x => x.ariaActiveDescendant}"
|
|
57591
|
-
aria-controls="${x => x.ariaControls}"
|
|
57859
|
+
].filter(Boolean).join(' ')}"
|
|
57860
|
+
aria-activedescendant="${x => (x.filterMode === FilterMode.none ? x.ariaActiveDescendant : null)}"
|
|
57861
|
+
aria-controls="${x => (x.filterMode === FilterMode.none ? x.ariaControls : null)}"
|
|
57592
57862
|
aria-disabled="${x => x.ariaDisabled}"
|
|
57593
57863
|
aria-expanded="${x => x.ariaExpanded}"
|
|
57594
57864
|
aria-haspopup="${x => (x.collapsible ? 'listbox' : null)}"
|
|
@@ -57597,34 +57867,36 @@ img.ProseMirror-separator {
|
|
|
57597
57867
|
role="combobox"
|
|
57598
57868
|
tabindex="${x => (!x.disabled ? '0' : null)}"
|
|
57599
57869
|
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
57870
|
+
@change="${x => x.changeValueHandler()}"
|
|
57871
|
+
@contentchange="${x => x.updateDisplayValue()}"
|
|
57600
57872
|
@focusin="${(x, c) => x.focusinHandler(c.event)}"
|
|
57601
57873
|
@focusout="${(x, c) => x.focusoutHandler(c.event)}"
|
|
57602
57874
|
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
57603
57875
|
@mousedown="${(x, c) => x.mousedownHandler(c.event)}"
|
|
57604
57876
|
>
|
|
57605
57877
|
${when(x => x.collapsible, html `
|
|
57606
|
-
|
|
57607
|
-
|
|
57608
|
-
|
|
57609
|
-
|
|
57610
|
-
|
|
57611
|
-
|
|
57612
|
-
|
|
57613
|
-
|
|
57614
|
-
|
|
57615
|
-
|
|
57616
|
-
|
|
57617
|
-
|
|
57618
|
-
|
|
57619
|
-
|
|
57620
|
-
|
|
57621
|
-
|
|
57622
|
-
|
|
57623
|
-
|
|
57624
|
-
|
|
57625
|
-
|
|
57878
|
+
<div
|
|
57879
|
+
class="control"
|
|
57880
|
+
part="control"
|
|
57881
|
+
?disabled="${x => x.disabled}"
|
|
57882
|
+
${ref('control')}
|
|
57883
|
+
>
|
|
57884
|
+
${startSlotTemplate(context, definition)}
|
|
57885
|
+
<slot name="button-container">
|
|
57886
|
+
<div class="selected-value" part="selected-value" ${overflow('hasOverflow')} title=${x => (x.hasOverflow && x.displayValue ? x.displayValue : null)}>
|
|
57887
|
+
<slot name="selected-value">${x => x.displayValue}</slot>
|
|
57888
|
+
</div>
|
|
57889
|
+
<div aria-hidden="true" class="indicator" part="indicator">
|
|
57890
|
+
<slot name="indicator">
|
|
57891
|
+
${definition.indicator || ''}
|
|
57892
|
+
</slot>
|
|
57893
|
+
</div>
|
|
57894
|
+
</slot>
|
|
57895
|
+
${endSlotTemplate(context, definition)}
|
|
57896
|
+
</div>
|
|
57897
|
+
`)}
|
|
57626
57898
|
<${anchoredRegionTag}
|
|
57627
|
-
${ref('
|
|
57899
|
+
${ref('anchoredRegion')}
|
|
57628
57900
|
class="anchored-region"
|
|
57629
57901
|
fixed-placement
|
|
57630
57902
|
auto-update-mode="auto"
|
|
@@ -57633,93 +57905,766 @@ img.ProseMirror-separator {
|
|
|
57633
57905
|
horizontal-default-position="center"
|
|
57634
57906
|
horizontal-positioning-mode="locktodefault"
|
|
57635
57907
|
horizontal-scaling="anchor"
|
|
57908
|
+
@loaded="${x => x.regionLoadedHandler()}"
|
|
57636
57909
|
?hidden="${x => (x.collapsible ? !x.open : false)}">
|
|
57637
|
-
<div
|
|
57638
|
-
|
|
57639
|
-
|
|
57640
|
-
|
|
57641
|
-
|
|
57642
|
-
|
|
57643
|
-
|
|
57644
|
-
|
|
57645
|
-
|
|
57646
|
-
|
|
57910
|
+
<div class="listbox-background">
|
|
57911
|
+
<div
|
|
57912
|
+
class="
|
|
57913
|
+
listbox
|
|
57914
|
+
${x => (x.filteredOptions.length === 0 ? 'empty' : '')}
|
|
57915
|
+
${x => x.positionAttribute}
|
|
57916
|
+
"
|
|
57917
|
+
id="${x => x.listboxId}"
|
|
57918
|
+
part="listbox"
|
|
57919
|
+
role="listbox"
|
|
57920
|
+
?disabled="${x => x.disabled}"
|
|
57921
|
+
${ref('listbox')}
|
|
57922
|
+
>
|
|
57923
|
+
${when(x => x.filterMode !== FilterMode.none, html `
|
|
57924
|
+
<div class="filter-field ${x => x.positionAttribute}">
|
|
57925
|
+
<${iconMagnifyingGlassTag} class="filter-icon"></${iconMagnifyingGlassTag}>
|
|
57926
|
+
<input
|
|
57927
|
+
${ref('filterInput')}
|
|
57928
|
+
class="filter-input"
|
|
57929
|
+
aria-controls="${x => x.ariaControls}"
|
|
57930
|
+
aria-activedescendant="${x => x.ariaActiveDescendant}"
|
|
57931
|
+
@input="${(x, c) => x.inputHandler(c.event)}"
|
|
57932
|
+
@click="${(x, c) => x.inputClickHandler(c.event)}"
|
|
57933
|
+
placeholder="${x => filterSearchLabel.getValueFor(x)}"
|
|
57934
|
+
value="${x => x.filter}"
|
|
57935
|
+
/>
|
|
57936
|
+
</div>
|
|
57937
|
+
`)}
|
|
57938
|
+
<div ${ref('scrollableRegion')}
|
|
57939
|
+
class="scrollable-region">
|
|
57940
|
+
<slot
|
|
57941
|
+
${slotted({
|
|
57647
57942
|
filter: (n) => n instanceof HTMLElement && Listbox$1.slottedOptionFilter(n),
|
|
57648
57943
|
flatten: true,
|
|
57649
57944
|
property: 'slottedOptions',
|
|
57650
57945
|
})}
|
|
57651
|
-
|
|
57946
|
+
></slot>
|
|
57947
|
+
</div>
|
|
57948
|
+
${when(x => (x.filterMode !== FilterMode.none && x.filteredOptions.length === 0), html `
|
|
57949
|
+
<span class="no-results-label ${x => x.positionAttribute}">
|
|
57950
|
+
${x => filterNoResultsLabel.getValueFor(x)}
|
|
57951
|
+
</span>
|
|
57952
|
+
`)}
|
|
57953
|
+
</div>
|
|
57652
57954
|
</div>
|
|
57653
57955
|
</${anchoredRegionTag}>
|
|
57654
57956
|
</template>
|
|
57655
57957
|
`;
|
|
57656
57958
|
|
|
57959
|
+
// Based on: https://github.com/microsoft/fast/blob/%40microsoft/fast-foundation_v2.49.5/packages/web-components/fast-foundation/src/select/select.form-associated.ts
|
|
57960
|
+
/* eslint-disable max-classes-per-file */
|
|
57961
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
57962
|
+
let Select$1 = class Select extends ListboxElement {
|
|
57963
|
+
};
|
|
57964
|
+
/**
|
|
57965
|
+
* A form-associated base class for the Select component. This was copied from the
|
|
57966
|
+
* FAST FormAssociatedSelect (which is not exported by fast-foundation)
|
|
57967
|
+
*
|
|
57968
|
+
* @internal
|
|
57969
|
+
*/
|
|
57970
|
+
class FormAssociatedSelect extends FormAssociated(Select$1) {
|
|
57971
|
+
constructor() {
|
|
57972
|
+
super(...arguments);
|
|
57973
|
+
this.proxy = document.createElement('select');
|
|
57974
|
+
}
|
|
57975
|
+
}
|
|
57976
|
+
|
|
57657
57977
|
/**
|
|
57658
|
-
* A nimble-styled HTML select
|
|
57978
|
+
* A nimble-styled HTML select.
|
|
57659
57979
|
*/
|
|
57660
|
-
class Select extends
|
|
57980
|
+
class Select extends FormAssociatedSelect {
|
|
57661
57981
|
constructor() {
|
|
57662
57982
|
super(...arguments);
|
|
57663
57983
|
this.appearance = DropdownAppearance.underline;
|
|
57664
57984
|
this.errorVisible = false;
|
|
57985
|
+
this.filterMode = FilterMode.none;
|
|
57986
|
+
/**
|
|
57987
|
+
* @internal
|
|
57988
|
+
*/
|
|
57989
|
+
this.open = false;
|
|
57990
|
+
/**
|
|
57991
|
+
* The unique id for the internal listbox element.
|
|
57992
|
+
*
|
|
57993
|
+
* @internal
|
|
57994
|
+
*/
|
|
57995
|
+
this.listboxId = uniqueId('listbox-');
|
|
57665
57996
|
/** @internal */
|
|
57666
57997
|
this.hasOverflow = false;
|
|
57998
|
+
/**
|
|
57999
|
+
* @internal
|
|
58000
|
+
*/
|
|
58001
|
+
this.filteredOptions = [];
|
|
58002
|
+
/**
|
|
58003
|
+
* @internal
|
|
58004
|
+
*/
|
|
58005
|
+
this.filter = '';
|
|
58006
|
+
/**
|
|
58007
|
+
* @internal
|
|
58008
|
+
*/
|
|
58009
|
+
this.committedSelectedOption = undefined;
|
|
58010
|
+
/**
|
|
58011
|
+
* The max height for the listbox when opened.
|
|
58012
|
+
*
|
|
58013
|
+
* @internal
|
|
58014
|
+
*/
|
|
58015
|
+
this.maxHeight = 0;
|
|
58016
|
+
this._value = '';
|
|
58017
|
+
this.forcedPosition = false;
|
|
58018
|
+
}
|
|
58019
|
+
/**
|
|
58020
|
+
* The component is collapsible when in single-selection mode with no size attribute.
|
|
58021
|
+
*
|
|
58022
|
+
* @internal
|
|
58023
|
+
*/
|
|
58024
|
+
get collapsible() {
|
|
58025
|
+
return !(this.multiple || typeof this.size === 'number');
|
|
58026
|
+
}
|
|
58027
|
+
/**
|
|
58028
|
+
* @internal
|
|
58029
|
+
*/
|
|
58030
|
+
connectedCallback() {
|
|
58031
|
+
super.connectedCallback();
|
|
58032
|
+
this.forcedPosition = !!this.positionAttribute;
|
|
58033
|
+
this.initializeOpenState();
|
|
58034
|
+
}
|
|
58035
|
+
/**
|
|
58036
|
+
* The list of options. This mirrors FAST's override implementation for this
|
|
58037
|
+
* member for the Combobox to support a filtered list in the dropdown.
|
|
58038
|
+
*
|
|
58039
|
+
* @public
|
|
58040
|
+
* @remarks
|
|
58041
|
+
* Overrides `Listbox.options`.
|
|
58042
|
+
*/
|
|
58043
|
+
get options() {
|
|
58044
|
+
Observable.track(this, 'options');
|
|
58045
|
+
return this.filteredOptions?.length
|
|
58046
|
+
? this.filteredOptions
|
|
58047
|
+
: this._options;
|
|
58048
|
+
}
|
|
58049
|
+
set options(value) {
|
|
58050
|
+
this._options = value;
|
|
58051
|
+
Observable.notify(this, 'options');
|
|
58052
|
+
}
|
|
58053
|
+
get value() {
|
|
58054
|
+
Observable.track(this, 'value');
|
|
58055
|
+
return this._value;
|
|
58056
|
+
}
|
|
58057
|
+
set value(next) {
|
|
58058
|
+
const prev = this._value;
|
|
58059
|
+
let newValue = next;
|
|
58060
|
+
// use 'options' here instead of '_options' as 'selectedIndex' may be relative
|
|
58061
|
+
// to filtered set
|
|
58062
|
+
if (this.options?.length) {
|
|
58063
|
+
const newValueIndex = this.options.findIndex(el => el.value === newValue);
|
|
58064
|
+
const prevSelectedValue = this.options[this.selectedIndex]?.value ?? null;
|
|
58065
|
+
const nextSelectedValue = this.options[newValueIndex]?.value ?? null;
|
|
58066
|
+
if (newValueIndex === -1
|
|
58067
|
+
|| prevSelectedValue !== nextSelectedValue) {
|
|
58068
|
+
newValue = '';
|
|
58069
|
+
this.selectedIndex = newValueIndex;
|
|
58070
|
+
}
|
|
58071
|
+
newValue = this.firstSelectedOption?.value ?? newValue;
|
|
58072
|
+
}
|
|
58073
|
+
if (prev !== newValue && !(this.open && this.selectedIndex < 0)) {
|
|
58074
|
+
this._value = newValue;
|
|
58075
|
+
super.valueChanged(prev, newValue);
|
|
58076
|
+
if (!this.open) {
|
|
58077
|
+
this.committedSelectedOption = this._options.find(o => o.value === newValue);
|
|
58078
|
+
}
|
|
58079
|
+
Observable.notify(this, 'value');
|
|
58080
|
+
if (this.collapsible) {
|
|
58081
|
+
Observable.notify(this, 'displayValue');
|
|
58082
|
+
}
|
|
58083
|
+
}
|
|
58084
|
+
}
|
|
58085
|
+
/**
|
|
58086
|
+
* @internal
|
|
58087
|
+
*/
|
|
58088
|
+
get displayValue() {
|
|
58089
|
+
Observable.track(this, 'displayValue');
|
|
58090
|
+
return this.committedSelectedOption?.text ?? '';
|
|
58091
|
+
}
|
|
58092
|
+
/**
|
|
58093
|
+
* @internal
|
|
58094
|
+
*/
|
|
58095
|
+
anchoredRegionChanged(_prev, _next) {
|
|
58096
|
+
if (this.anchoredRegion && this.control) {
|
|
58097
|
+
this.anchoredRegion.anchorElement = this.control;
|
|
58098
|
+
}
|
|
58099
|
+
}
|
|
58100
|
+
/**
|
|
58101
|
+
* @internal
|
|
58102
|
+
*/
|
|
58103
|
+
controlChanged(_prev, _next) {
|
|
58104
|
+
if (this.anchoredRegion && this.control) {
|
|
58105
|
+
this.anchoredRegion.anchorElement = this.control;
|
|
58106
|
+
}
|
|
58107
|
+
}
|
|
58108
|
+
/**
|
|
58109
|
+
* @internal
|
|
58110
|
+
*/
|
|
58111
|
+
slottedOptionsChanged(prev, next) {
|
|
58112
|
+
const value = this.value;
|
|
58113
|
+
this._options.forEach(o => {
|
|
58114
|
+
const notifier = Observable.getNotifier(o);
|
|
58115
|
+
notifier.unsubscribe(this, 'value');
|
|
58116
|
+
});
|
|
58117
|
+
super.slottedOptionsChanged(prev, next);
|
|
58118
|
+
this._options.forEach(o => {
|
|
58119
|
+
const notifier = Observable.getNotifier(o);
|
|
58120
|
+
notifier.subscribe(this, 'value');
|
|
58121
|
+
});
|
|
58122
|
+
this.setProxyOptions();
|
|
58123
|
+
this.updateValue();
|
|
58124
|
+
// We need to force an update to the filteredOptions observable
|
|
58125
|
+
// (by calling 'filterOptions()) so that the template correctly updates.
|
|
58126
|
+
this.filterOptions();
|
|
58127
|
+
if (value) {
|
|
58128
|
+
this.value = value;
|
|
58129
|
+
}
|
|
58130
|
+
this.committedSelectedOption = this.options[this.selectedIndex];
|
|
58131
|
+
}
|
|
58132
|
+
/**
|
|
58133
|
+
* @internal
|
|
58134
|
+
*/
|
|
58135
|
+
clickHandler(e) {
|
|
58136
|
+
// do nothing if the select is disabled
|
|
58137
|
+
if (this.disabled) {
|
|
58138
|
+
return;
|
|
58139
|
+
}
|
|
58140
|
+
if (this.open) {
|
|
58141
|
+
const captured = e.target.closest('option,[role=option]');
|
|
58142
|
+
if (!captured?.disabled) {
|
|
58143
|
+
this.updateSelectedIndexFromFilteredSet();
|
|
58144
|
+
}
|
|
58145
|
+
if (captured?.disabled) {
|
|
58146
|
+
return;
|
|
58147
|
+
}
|
|
58148
|
+
}
|
|
58149
|
+
super.clickHandler(e);
|
|
58150
|
+
this.open = this.collapsible && !this.open;
|
|
58151
|
+
if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
|
|
58152
|
+
this.updateValue(true);
|
|
58153
|
+
}
|
|
58154
|
+
}
|
|
58155
|
+
/**
|
|
58156
|
+
* Updates the value when an option's value changes.
|
|
58157
|
+
*
|
|
58158
|
+
* @param source - the source object
|
|
58159
|
+
* @param propertyName - the property to evaluate
|
|
58160
|
+
*
|
|
58161
|
+
* @internal
|
|
58162
|
+
* @override
|
|
58163
|
+
*/
|
|
58164
|
+
handleChange(source, propertyName) {
|
|
58165
|
+
super.handleChange(source, propertyName);
|
|
58166
|
+
if (propertyName === 'value') {
|
|
58167
|
+
this.updateValue();
|
|
58168
|
+
}
|
|
58169
|
+
}
|
|
58170
|
+
/**
|
|
58171
|
+
* Prevents focus when size is set and a scrollbar is clicked.
|
|
58172
|
+
*
|
|
58173
|
+
* @param e - the mouse event object
|
|
58174
|
+
*
|
|
58175
|
+
* @override
|
|
58176
|
+
* @internal
|
|
58177
|
+
*/
|
|
58178
|
+
mousedownHandler(e) {
|
|
58179
|
+
if (e.offsetX >= 0 && e.offsetX <= this.listbox?.scrollWidth) {
|
|
58180
|
+
return super.mousedownHandler(e);
|
|
58181
|
+
}
|
|
58182
|
+
return this.collapsible;
|
|
58183
|
+
}
|
|
58184
|
+
/**
|
|
58185
|
+
* @internal
|
|
58186
|
+
*/
|
|
58187
|
+
regionLoadedHandler() {
|
|
58188
|
+
this.focusAndScrollOptionIntoView();
|
|
58189
|
+
}
|
|
58190
|
+
/**
|
|
58191
|
+
* Sets the multiple property on the proxy element.
|
|
58192
|
+
*
|
|
58193
|
+
* @param prev - the previous multiple value
|
|
58194
|
+
* @param next - the current multiple value
|
|
58195
|
+
*/
|
|
58196
|
+
multipleChanged(prev, next) {
|
|
58197
|
+
super.multipleChanged(prev, next);
|
|
58198
|
+
if (this.proxy) {
|
|
58199
|
+
this.proxy.multiple = next;
|
|
58200
|
+
}
|
|
58201
|
+
}
|
|
58202
|
+
/**
|
|
58203
|
+
* @internal
|
|
58204
|
+
*/
|
|
58205
|
+
inputClickHandler(e) {
|
|
58206
|
+
e.stopPropagation(); // clicking in filter input shouldn't close dropdown
|
|
58207
|
+
}
|
|
58208
|
+
/**
|
|
58209
|
+
* @internal
|
|
58210
|
+
*/
|
|
58211
|
+
changeValueHandler() {
|
|
58212
|
+
this.committedSelectedOption = this.options.find(option => option.selected);
|
|
58213
|
+
}
|
|
58214
|
+
/**
|
|
58215
|
+
* @internal
|
|
58216
|
+
*/
|
|
58217
|
+
updateDisplayValue() {
|
|
58218
|
+
if (this.collapsible) {
|
|
58219
|
+
Observable.notify(this, 'displayValue');
|
|
58220
|
+
}
|
|
58221
|
+
}
|
|
58222
|
+
/**
|
|
58223
|
+
* Handle content changes on the control input.
|
|
58224
|
+
*
|
|
58225
|
+
* @param e - the input event
|
|
58226
|
+
* @internal
|
|
58227
|
+
*/
|
|
58228
|
+
inputHandler(e) {
|
|
58229
|
+
this.filter = this.filterInput?.value ?? '';
|
|
58230
|
+
if (!this.committedSelectedOption) {
|
|
58231
|
+
this.committedSelectedOption = this._options.find(option => option.selected);
|
|
58232
|
+
}
|
|
58233
|
+
this.clearSelection();
|
|
58234
|
+
this.filterOptions();
|
|
58235
|
+
if (this.filteredOptions.length > 0
|
|
58236
|
+
&& this.committedSelectedOption
|
|
58237
|
+
&& !this.filteredOptions.includes(this.committedSelectedOption)) {
|
|
58238
|
+
const enabledOptions = this.filteredOptions.filter(o => !o.disabled);
|
|
58239
|
+
if (enabledOptions.length > 0) {
|
|
58240
|
+
enabledOptions[0].selected = true;
|
|
58241
|
+
}
|
|
58242
|
+
else {
|
|
58243
|
+
// only filtered option is disabled
|
|
58244
|
+
this.selectedOptions = [];
|
|
58245
|
+
this.selectedIndex = -1;
|
|
58246
|
+
}
|
|
58247
|
+
}
|
|
58248
|
+
else if (this.committedSelectedOption) {
|
|
58249
|
+
this.committedSelectedOption.selected = true;
|
|
58250
|
+
}
|
|
58251
|
+
if (e.inputType.includes('deleteContent') || !this.filter.length) {
|
|
58252
|
+
return true;
|
|
58253
|
+
}
|
|
58254
|
+
e.stopPropagation();
|
|
58255
|
+
return true;
|
|
58256
|
+
}
|
|
58257
|
+
/**
|
|
58258
|
+
* @internal
|
|
58259
|
+
*/
|
|
58260
|
+
focusoutHandler(e) {
|
|
58261
|
+
this.updateSelectedIndexFromFilteredSet();
|
|
58262
|
+
super.focusoutHandler(e);
|
|
58263
|
+
if (!this.open) {
|
|
58264
|
+
return true;
|
|
58265
|
+
}
|
|
58266
|
+
const focusTarget = e.relatedTarget;
|
|
58267
|
+
if (this.isSameNode(focusTarget)) {
|
|
58268
|
+
this.focus();
|
|
58269
|
+
return true;
|
|
58270
|
+
}
|
|
58271
|
+
if (!this.options?.includes(focusTarget)) {
|
|
58272
|
+
this.open = false;
|
|
58273
|
+
if (this.indexWhenOpened !== this.selectedIndex) {
|
|
58274
|
+
this.updateValue(true);
|
|
58275
|
+
}
|
|
58276
|
+
}
|
|
58277
|
+
return true;
|
|
58278
|
+
}
|
|
58279
|
+
/**
|
|
58280
|
+
* @internal
|
|
58281
|
+
*/
|
|
58282
|
+
keydownHandler(e) {
|
|
58283
|
+
super.keydownHandler(e);
|
|
58284
|
+
const key = e.key;
|
|
58285
|
+
if (e.ctrlKey || e.shiftKey) {
|
|
58286
|
+
return true;
|
|
58287
|
+
}
|
|
58288
|
+
switch (key) {
|
|
58289
|
+
case keySpace: {
|
|
58290
|
+
// when dropdown is open allow user to enter a space for filter text
|
|
58291
|
+
if (this.open && this.filterMode !== FilterMode.none) {
|
|
58292
|
+
break;
|
|
58293
|
+
}
|
|
58294
|
+
e.preventDefault();
|
|
58295
|
+
if (this.collapsible && this.typeAheadExpired) {
|
|
58296
|
+
this.open = !this.open;
|
|
58297
|
+
}
|
|
58298
|
+
if (!this.open) {
|
|
58299
|
+
this.focus();
|
|
58300
|
+
}
|
|
58301
|
+
break;
|
|
58302
|
+
}
|
|
58303
|
+
case keyHome:
|
|
58304
|
+
case keyEnd: {
|
|
58305
|
+
e.preventDefault();
|
|
58306
|
+
break;
|
|
58307
|
+
}
|
|
58308
|
+
case keyEnter: {
|
|
58309
|
+
e.preventDefault();
|
|
58310
|
+
if (this.filteredOptions.length === 0
|
|
58311
|
+
|| this.filteredOptions.every(o => o.disabled)) {
|
|
58312
|
+
return false;
|
|
58313
|
+
}
|
|
58314
|
+
this.updateSelectedIndexFromFilteredSet();
|
|
58315
|
+
this.open = !this.open;
|
|
58316
|
+
if (!this.open) {
|
|
58317
|
+
this.focus();
|
|
58318
|
+
}
|
|
58319
|
+
break;
|
|
58320
|
+
}
|
|
58321
|
+
case keyEscape: {
|
|
58322
|
+
// clear filter as update to "selectedIndex" will result in processing
|
|
58323
|
+
// "options" and not "_options"
|
|
58324
|
+
this.filter = '';
|
|
58325
|
+
if (this.committedSelectedOption) {
|
|
58326
|
+
this.clearSelection();
|
|
58327
|
+
this.selectedIndex = this._options.indexOf(this.committedSelectedOption);
|
|
58328
|
+
}
|
|
58329
|
+
if (this.collapsible && this.open) {
|
|
58330
|
+
e.preventDefault();
|
|
58331
|
+
this.open = false;
|
|
58332
|
+
}
|
|
58333
|
+
// reset 'selected' state otherwise the selected state doesn't stick.
|
|
58334
|
+
const selectedOption = this._options[this.selectedIndex];
|
|
58335
|
+
if (selectedOption) {
|
|
58336
|
+
selectedOption.selected = true;
|
|
58337
|
+
}
|
|
58338
|
+
this.focus();
|
|
58339
|
+
break;
|
|
58340
|
+
}
|
|
58341
|
+
case keyTab: {
|
|
58342
|
+
if (this.collapsible && this.open) {
|
|
58343
|
+
e.preventDefault();
|
|
58344
|
+
this.open = false;
|
|
58345
|
+
}
|
|
58346
|
+
return true;
|
|
58347
|
+
}
|
|
58348
|
+
}
|
|
58349
|
+
if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
|
|
58350
|
+
this.updateValue(true);
|
|
58351
|
+
this.indexWhenOpened = this.selectedIndex;
|
|
58352
|
+
}
|
|
58353
|
+
return !(key === keyArrowDown || key === keyArrowUp);
|
|
58354
|
+
}
|
|
58355
|
+
/**
|
|
58356
|
+
* Updates the proxy value when the selected index changes.
|
|
58357
|
+
*
|
|
58358
|
+
* @param prev - the previous selected index
|
|
58359
|
+
* @param next - the next selected index
|
|
58360
|
+
*
|
|
58361
|
+
* @internal
|
|
58362
|
+
*/
|
|
58363
|
+
selectedIndexChanged(prev, next) {
|
|
58364
|
+
super.selectedIndexChanged(prev, next);
|
|
58365
|
+
this.updateValue();
|
|
58366
|
+
}
|
|
58367
|
+
/**
|
|
58368
|
+
* Synchronize the `aria-disabled` property when the `disabled` property changes.
|
|
58369
|
+
*
|
|
58370
|
+
* @param prev - The previous disabled value
|
|
58371
|
+
* @param next - The next disabled value
|
|
58372
|
+
*
|
|
58373
|
+
* @internal
|
|
58374
|
+
*/
|
|
58375
|
+
disabledChanged(prev, next) {
|
|
58376
|
+
if (super.disabledChanged) {
|
|
58377
|
+
super.disabledChanged(prev, next);
|
|
58378
|
+
}
|
|
58379
|
+
this.ariaDisabled = this.disabled ? 'true' : 'false';
|
|
58380
|
+
}
|
|
58381
|
+
/**
|
|
58382
|
+
* Reset the element to its first selectable option when its parent form is reset.
|
|
58383
|
+
*
|
|
58384
|
+
* @internal
|
|
58385
|
+
*/
|
|
58386
|
+
formResetCallback() {
|
|
58387
|
+
this.setProxyOptions();
|
|
58388
|
+
// Call the base class's implementation setDefaultSelectedOption instead of the select's
|
|
58389
|
+
// override, in order to reset the selectedIndex without using the value property.
|
|
58390
|
+
super.setDefaultSelectedOption();
|
|
58391
|
+
if (this.selectedIndex === -1) {
|
|
58392
|
+
this.selectedIndex = 0;
|
|
58393
|
+
}
|
|
58394
|
+
}
|
|
58395
|
+
// Prevents parent classes from resetting selectedIndex to a positive
|
|
58396
|
+
// value while filtering, which can result in a disabled option being
|
|
58397
|
+
// selected.
|
|
58398
|
+
setSelectedOptions() {
|
|
58399
|
+
if (this.open && this.selectedIndex === -1) {
|
|
58400
|
+
return;
|
|
58401
|
+
}
|
|
58402
|
+
super.setSelectedOptions();
|
|
58403
|
+
}
|
|
58404
|
+
focusAndScrollOptionIntoView() {
|
|
58405
|
+
super.focusAndScrollOptionIntoView();
|
|
58406
|
+
if (this.open) {
|
|
58407
|
+
window.requestAnimationFrame(() => {
|
|
58408
|
+
this.filterInput?.focus();
|
|
58409
|
+
});
|
|
58410
|
+
}
|
|
58411
|
+
}
|
|
58412
|
+
positionChanged(_, next) {
|
|
58413
|
+
this.positionAttribute = next;
|
|
58414
|
+
this.setPositioning();
|
|
58415
|
+
}
|
|
58416
|
+
/**
|
|
58417
|
+
* Updates the proxy's size property when the size attribute changes.
|
|
58418
|
+
*
|
|
58419
|
+
* @param prev - the previous size
|
|
58420
|
+
* @param next - the current size
|
|
58421
|
+
*
|
|
58422
|
+
* @override
|
|
58423
|
+
* @internal
|
|
58424
|
+
*/
|
|
58425
|
+
sizeChanged(prev, next) {
|
|
58426
|
+
super.sizeChanged(prev, next);
|
|
58427
|
+
if (this.proxy) {
|
|
58428
|
+
this.proxy.size = next;
|
|
58429
|
+
}
|
|
58430
|
+
}
|
|
58431
|
+
openChanged() {
|
|
58432
|
+
if (!this.collapsible) {
|
|
58433
|
+
return;
|
|
58434
|
+
}
|
|
58435
|
+
if (this.open) {
|
|
58436
|
+
this.initializeOpenState();
|
|
58437
|
+
this.indexWhenOpened = this.selectedIndex;
|
|
58438
|
+
return;
|
|
58439
|
+
}
|
|
58440
|
+
this.filter = '';
|
|
58441
|
+
if (this.filterInput) {
|
|
58442
|
+
this.filterInput.value = '';
|
|
58443
|
+
}
|
|
58444
|
+
this.ariaControls = '';
|
|
58445
|
+
this.ariaExpanded = 'false';
|
|
58446
|
+
}
|
|
58447
|
+
/**
|
|
58448
|
+
* Updates the selectedness of each option when the list of selected options changes.
|
|
58449
|
+
*
|
|
58450
|
+
* @param prev - the previous list of selected options
|
|
58451
|
+
* @param next - the current list of selected options
|
|
58452
|
+
*
|
|
58453
|
+
* @override
|
|
58454
|
+
* @internal
|
|
58455
|
+
*/
|
|
58456
|
+
selectedOptionsChanged(prev, next) {
|
|
58457
|
+
super.selectedOptionsChanged(prev, next);
|
|
58458
|
+
this.options?.forEach((o, i) => {
|
|
58459
|
+
const proxyOption = this.proxy?.options.item(i);
|
|
58460
|
+
if (proxyOption) {
|
|
58461
|
+
proxyOption.selected = o.selected;
|
|
58462
|
+
}
|
|
58463
|
+
});
|
|
58464
|
+
}
|
|
58465
|
+
/**
|
|
58466
|
+
* Sets the selected index to match the first option with the selected attribute, or
|
|
58467
|
+
* the first selectable option.
|
|
58468
|
+
*
|
|
58469
|
+
* @override
|
|
58470
|
+
* @internal
|
|
58471
|
+
*/
|
|
58472
|
+
setDefaultSelectedOption() {
|
|
58473
|
+
const options = this.options
|
|
58474
|
+
?? Array.from(this.children).filter(o => Listbox$1.slottedOptionFilter(o));
|
|
58475
|
+
const selectedIndex = options?.findIndex(el => el.hasAttribute('selected')
|
|
58476
|
+
|| el.selected
|
|
58477
|
+
|| el.value === this.value);
|
|
58478
|
+
if (selectedIndex !== -1) {
|
|
58479
|
+
this.selectedIndex = selectedIndex;
|
|
58480
|
+
return;
|
|
58481
|
+
}
|
|
58482
|
+
this.selectedIndex = 0;
|
|
57667
58483
|
}
|
|
57668
|
-
// Workaround for https://github.com/microsoft/fast/issues/5123
|
|
57669
58484
|
setPositioning() {
|
|
57670
58485
|
if (!this.$fastController.isConnected) {
|
|
57671
58486
|
// Don't call setPositioning() until we're connected,
|
|
57672
58487
|
// since this.forcedPosition isn't initialized yet.
|
|
57673
58488
|
return;
|
|
57674
58489
|
}
|
|
57675
|
-
|
|
58490
|
+
const currentBox = this.getBoundingClientRect();
|
|
58491
|
+
const viewportHeight = window.innerHeight;
|
|
58492
|
+
const availableBottom = viewportHeight - currentBox.bottom;
|
|
58493
|
+
if (this.forcedPosition) {
|
|
58494
|
+
this.position = this.positionAttribute;
|
|
58495
|
+
}
|
|
58496
|
+
else if (currentBox.top > availableBottom) {
|
|
58497
|
+
this.position = SelectPosition.above;
|
|
58498
|
+
}
|
|
58499
|
+
else {
|
|
58500
|
+
this.position = SelectPosition.below;
|
|
58501
|
+
}
|
|
58502
|
+
this.positionAttribute = this.forcedPosition
|
|
58503
|
+
? this.positionAttribute
|
|
58504
|
+
: this.position;
|
|
58505
|
+
this.maxHeight = this.position === SelectPosition.above
|
|
58506
|
+
? Math.trunc(currentBox.top)
|
|
58507
|
+
: Math.trunc(availableBottom);
|
|
57676
58508
|
this.updateListboxMaxHeightCssVariable();
|
|
57677
58509
|
}
|
|
57678
|
-
|
|
57679
|
-
|
|
57680
|
-
|
|
57681
|
-
|
|
57682
|
-
|
|
57683
|
-
|
|
58510
|
+
/**
|
|
58511
|
+
* Filter available options by text value.
|
|
58512
|
+
*
|
|
58513
|
+
* @public
|
|
58514
|
+
*/
|
|
58515
|
+
filterOptions() {
|
|
58516
|
+
const filter = this.filter.toLowerCase();
|
|
58517
|
+
if (filter) {
|
|
58518
|
+
this.filteredOptions = this._options.filter(option => {
|
|
58519
|
+
return diacriticInsensitiveStringNormalizer(option.text).includes(diacriticInsensitiveStringNormalizer(filter));
|
|
58520
|
+
});
|
|
57684
58521
|
}
|
|
58522
|
+
else {
|
|
58523
|
+
this.filteredOptions = this._options;
|
|
58524
|
+
}
|
|
58525
|
+
this._options.forEach(o => {
|
|
58526
|
+
o.hidden = !this.filteredOptions.includes(o);
|
|
58527
|
+
});
|
|
57685
58528
|
}
|
|
57686
|
-
|
|
57687
|
-
|
|
57688
|
-
|
|
58529
|
+
/**
|
|
58530
|
+
* Sets the value and display value to match the first selected option.
|
|
58531
|
+
*
|
|
58532
|
+
* @param shouldEmit - if true, the input and change events will be emitted
|
|
58533
|
+
*
|
|
58534
|
+
* @internal
|
|
58535
|
+
*/
|
|
58536
|
+
updateValue(shouldEmit) {
|
|
58537
|
+
if (this.$fastController.isConnected) {
|
|
58538
|
+
this.value = this.firstSelectedOption?.value ?? '';
|
|
58539
|
+
}
|
|
58540
|
+
if (shouldEmit) {
|
|
58541
|
+
this.$emit('input');
|
|
58542
|
+
this.$emit('change', this, {
|
|
58543
|
+
bubbles: true,
|
|
58544
|
+
composed: undefined
|
|
58545
|
+
});
|
|
57689
58546
|
}
|
|
57690
58547
|
}
|
|
57691
|
-
|
|
57692
|
-
|
|
57693
|
-
|
|
58548
|
+
/**
|
|
58549
|
+
* Resets and fills the proxy to match the component's options.
|
|
58550
|
+
*
|
|
58551
|
+
* @internal
|
|
58552
|
+
*/
|
|
58553
|
+
setProxyOptions() {
|
|
58554
|
+
if (this.proxy instanceof HTMLSelectElement && this.options) {
|
|
58555
|
+
this.proxy.options.length = 0;
|
|
58556
|
+
this.options.forEach(option => {
|
|
58557
|
+
const proxyOption = option.proxy
|
|
58558
|
+
|| (option instanceof HTMLOptionElement
|
|
58559
|
+
? option.cloneNode()
|
|
58560
|
+
: null);
|
|
58561
|
+
if (proxyOption) {
|
|
58562
|
+
this.proxy.options.add(proxyOption);
|
|
58563
|
+
}
|
|
58564
|
+
});
|
|
57694
58565
|
}
|
|
57695
58566
|
}
|
|
58567
|
+
clearSelection() {
|
|
58568
|
+
this.options.forEach(option => {
|
|
58569
|
+
option.selected = false;
|
|
58570
|
+
});
|
|
58571
|
+
}
|
|
58572
|
+
filterChanged() {
|
|
58573
|
+
this.filterOptions();
|
|
58574
|
+
}
|
|
57696
58575
|
maxHeightChanged() {
|
|
57697
58576
|
this.updateListboxMaxHeightCssVariable();
|
|
57698
58577
|
}
|
|
58578
|
+
initializeOpenState() {
|
|
58579
|
+
if (!this.open) {
|
|
58580
|
+
this.ariaExpanded = 'false';
|
|
58581
|
+
this.ariaControls = '';
|
|
58582
|
+
return;
|
|
58583
|
+
}
|
|
58584
|
+
this.committedSelectedOption = this._options[this.selectedIndex];
|
|
58585
|
+
this.ariaControls = this.listboxId;
|
|
58586
|
+
this.ariaExpanded = 'true';
|
|
58587
|
+
this.setPositioning();
|
|
58588
|
+
this.focusAndScrollOptionIntoView();
|
|
58589
|
+
}
|
|
57699
58590
|
updateListboxMaxHeightCssVariable() {
|
|
57700
58591
|
if (this.listbox) {
|
|
57701
58592
|
this.listbox.style.setProperty('--ni-private-select-max-height', `${this.maxHeight}px`);
|
|
57702
58593
|
}
|
|
57703
58594
|
}
|
|
58595
|
+
updateSelectedIndexFromFilteredSet() {
|
|
58596
|
+
const selectedItem = this.filteredOptions.length > 0
|
|
58597
|
+
? this.options[this.selectedIndex]
|
|
58598
|
+
?? this.committedSelectedOption
|
|
58599
|
+
: this.committedSelectedOption;
|
|
58600
|
+
if (!selectedItem) {
|
|
58601
|
+
return;
|
|
58602
|
+
}
|
|
58603
|
+
// Clear filter so any logic resolving against 'this.options' resolves against all options,
|
|
58604
|
+
// since selectedIndex should be relative to entire set.
|
|
58605
|
+
this.filter = '';
|
|
58606
|
+
// translate selectedIndex for filtered list to selectedIndex for all items
|
|
58607
|
+
this.selectedIndex = this._options.indexOf(selectedItem);
|
|
58608
|
+
// force selected to true again if the selection hasn't actually changed
|
|
58609
|
+
if (selectedItem === this.committedSelectedOption) {
|
|
58610
|
+
selectedItem.selected = true;
|
|
58611
|
+
}
|
|
58612
|
+
}
|
|
57704
58613
|
}
|
|
57705
58614
|
__decorate$1([
|
|
57706
58615
|
attr
|
|
57707
58616
|
], Select.prototype, "appearance", void 0);
|
|
58617
|
+
__decorate$1([
|
|
58618
|
+
attr({ attribute: 'position' })
|
|
58619
|
+
], Select.prototype, "positionAttribute", void 0);
|
|
57708
58620
|
__decorate$1([
|
|
57709
58621
|
attr({ attribute: 'error-text' })
|
|
57710
58622
|
], Select.prototype, "errorText", void 0);
|
|
57711
58623
|
__decorate$1([
|
|
57712
58624
|
attr({ attribute: 'error-visible', mode: 'boolean' })
|
|
57713
58625
|
], Select.prototype, "errorVisible", void 0);
|
|
58626
|
+
__decorate$1([
|
|
58627
|
+
attr({ attribute: 'filter-mode' })
|
|
58628
|
+
], Select.prototype, "filterMode", void 0);
|
|
58629
|
+
__decorate$1([
|
|
58630
|
+
attr({ attribute: 'open', mode: 'boolean' })
|
|
58631
|
+
], Select.prototype, "open", void 0);
|
|
57714
58632
|
__decorate$1([
|
|
57715
58633
|
observable
|
|
57716
|
-
], Select.prototype, "
|
|
58634
|
+
], Select.prototype, "position", void 0);
|
|
58635
|
+
__decorate$1([
|
|
58636
|
+
observable
|
|
58637
|
+
], Select.prototype, "control", void 0);
|
|
58638
|
+
__decorate$1([
|
|
58639
|
+
observable
|
|
58640
|
+
], Select.prototype, "scrollableRegion", void 0);
|
|
58641
|
+
__decorate$1([
|
|
58642
|
+
observable
|
|
58643
|
+
], Select.prototype, "filterInput", void 0);
|
|
58644
|
+
__decorate$1([
|
|
58645
|
+
observable
|
|
58646
|
+
], Select.prototype, "anchoredRegion", void 0);
|
|
57717
58647
|
__decorate$1([
|
|
57718
58648
|
observable
|
|
57719
58649
|
], Select.prototype, "hasOverflow", void 0);
|
|
58650
|
+
__decorate$1([
|
|
58651
|
+
observable
|
|
58652
|
+
], Select.prototype, "filteredOptions", void 0);
|
|
58653
|
+
__decorate$1([
|
|
58654
|
+
observable
|
|
58655
|
+
], Select.prototype, "filter", void 0);
|
|
58656
|
+
__decorate$1([
|
|
58657
|
+
observable
|
|
58658
|
+
], Select.prototype, "committedSelectedOption", void 0);
|
|
58659
|
+
__decorate$1([
|
|
58660
|
+
observable
|
|
58661
|
+
], Select.prototype, "maxHeight", void 0);
|
|
58662
|
+
__decorate$1([
|
|
58663
|
+
volatile
|
|
58664
|
+
], Select.prototype, "collapsible", null);
|
|
57720
58665
|
const nimbleSelect = Select.compose({
|
|
57721
58666
|
baseName: 'select',
|
|
57722
|
-
baseClass: Select$
|
|
58667
|
+
baseClass: Select$2,
|
|
57723
58668
|
template: template$l,
|
|
57724
58669
|
styles: styles$o,
|
|
57725
58670
|
indicator: arrowExpanderDown16X16.data,
|
|
@@ -57731,6 +58676,7 @@ img.ProseMirror-separator {
|
|
|
57731
58676
|
${errorTextTemplate}
|
|
57732
58677
|
`
|
|
57733
58678
|
});
|
|
58679
|
+
applyMixins(Select, StartEnd, DelegatesARIASelect);
|
|
57734
58680
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSelect());
|
|
57735
58681
|
|
|
57736
58682
|
const styles$n = css `
|
|
@@ -58889,7 +59835,7 @@ img.ProseMirror-separator {
|
|
|
58889
59835
|
}
|
|
58890
59836
|
return 0;
|
|
58891
59837
|
};
|
|
58892
|
-
header.getResizeHandler =
|
|
59838
|
+
header.getResizeHandler = _contextDocument => {
|
|
58893
59839
|
const column = table.getColumn(header.column.id);
|
|
58894
59840
|
const canResize = column == null ? void 0 : column.getCanResize();
|
|
58895
59841
|
return e => {
|
|
@@ -58946,11 +59892,12 @@ img.ProseMirror-separator {
|
|
|
58946
59892
|
columnSizingStart: []
|
|
58947
59893
|
}));
|
|
58948
59894
|
};
|
|
59895
|
+
const contextDocument = _contextDocument || typeof document !== 'undefined' ? document : null;
|
|
58949
59896
|
const mouseEvents = {
|
|
58950
59897
|
moveHandler: e => onMove(e.clientX),
|
|
58951
59898
|
upHandler: e => {
|
|
58952
|
-
|
|
58953
|
-
|
|
59899
|
+
contextDocument == null || contextDocument.removeEventListener('mousemove', mouseEvents.moveHandler);
|
|
59900
|
+
contextDocument == null || contextDocument.removeEventListener('mouseup', mouseEvents.upHandler);
|
|
58954
59901
|
onEnd(e.clientX);
|
|
58955
59902
|
}
|
|
58956
59903
|
};
|
|
@@ -58965,8 +59912,8 @@ img.ProseMirror-separator {
|
|
|
58965
59912
|
},
|
|
58966
59913
|
upHandler: e => {
|
|
58967
59914
|
var _e$touches$;
|
|
58968
|
-
|
|
58969
|
-
|
|
59915
|
+
contextDocument == null || contextDocument.removeEventListener('touchmove', touchEvents.moveHandler);
|
|
59916
|
+
contextDocument == null || contextDocument.removeEventListener('touchend', touchEvents.upHandler);
|
|
58970
59917
|
if (e.cancelable) {
|
|
58971
59918
|
e.preventDefault();
|
|
58972
59919
|
e.stopPropagation();
|
|
@@ -58978,11 +59925,11 @@ img.ProseMirror-separator {
|
|
|
58978
59925
|
passive: false
|
|
58979
59926
|
} : false;
|
|
58980
59927
|
if (isTouchStartEvent(e)) {
|
|
58981
|
-
|
|
58982
|
-
|
|
59928
|
+
contextDocument == null || contextDocument.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
|
|
59929
|
+
contextDocument == null || contextDocument.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
|
|
58983
59930
|
} else {
|
|
58984
|
-
|
|
58985
|
-
|
|
59931
|
+
contextDocument == null || contextDocument.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
|
|
59932
|
+
contextDocument == null || contextDocument.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
|
|
58986
59933
|
}
|
|
58987
59934
|
table.setColumnSizingInfo(old => ({
|
|
58988
59935
|
...old,
|
|
@@ -61638,7 +62585,8 @@ img.ProseMirror-separator {
|
|
|
61638
62585
|
|
|
61639
62586
|
const TableRecordDelayedHierarchyState = {
|
|
61640
62587
|
none: undefined,
|
|
61641
|
-
canLoadChildren: 'canLoadChildren'
|
|
62588
|
+
canLoadChildren: 'canLoadChildren',
|
|
62589
|
+
loadingChildren: 'loadingChildren'
|
|
61642
62590
|
};
|
|
61643
62591
|
/**
|
|
61644
62592
|
* The possible directions a table column can be sorted in.
|
|
@@ -62482,6 +63430,21 @@ img.ProseMirror-separator {
|
|
|
62482
63430
|
}
|
|
62483
63431
|
|
|
62484
63432
|
.expand-collapse-button {
|
|
63433
|
+
flex: 0 0 auto;
|
|
63434
|
+
padding-left: calc(
|
|
63435
|
+
${mediumPadding} + (var(--ni-private-table-row-indent-level) - 1) *
|
|
63436
|
+
${controlHeight}
|
|
63437
|
+
);
|
|
63438
|
+
}
|
|
63439
|
+
|
|
63440
|
+
.spinner-container {
|
|
63441
|
+
flex: 0 0 auto;
|
|
63442
|
+
width: ${controlSlimHeight};
|
|
63443
|
+
height: ${controlSlimHeight};
|
|
63444
|
+
align-self: center;
|
|
63445
|
+
display: flex;
|
|
63446
|
+
align-items: center;
|
|
63447
|
+
justify-content: center;
|
|
62485
63448
|
padding-left: calc(
|
|
62486
63449
|
${mediumPadding} + (var(--ni-private-table-row-indent-level) - 1) *
|
|
62487
63450
|
${controlHeight}
|
|
@@ -62489,6 +63452,7 @@ img.ProseMirror-separator {
|
|
|
62489
63452
|
}
|
|
62490
63453
|
|
|
62491
63454
|
.row-operations-container {
|
|
63455
|
+
flex: 0 0 auto;
|
|
62492
63456
|
display: flex;
|
|
62493
63457
|
}
|
|
62494
63458
|
|
|
@@ -62685,17 +63649,29 @@ img.ProseMirror-separator {
|
|
|
62685
63649
|
`)}
|
|
62686
63650
|
<span class="row-front-spacer ${x => (x.isTopLevelParentRow ? 'top-level-parent' : '')}"></span>
|
|
62687
63651
|
${when(x => x.isParentRow, html `
|
|
62688
|
-
|
|
62689
|
-
|
|
62690
|
-
|
|
62691
|
-
|
|
62692
|
-
|
|
62693
|
-
|
|
62694
|
-
|
|
62695
|
-
|
|
62696
|
-
|
|
62697
|
-
|
|
62698
|
-
|
|
63652
|
+
${when(x => x.loading, html `
|
|
63653
|
+
<span class="spinner-container">
|
|
63654
|
+
<${spinnerTag}
|
|
63655
|
+
appearance="${SpinnerAppearance.accent}"
|
|
63656
|
+
aria-label="${x => tableRowLoadingLabel.getValueFor(x)}"
|
|
63657
|
+
title="${x => tableRowLoadingLabel.getValueFor(x)}"
|
|
63658
|
+
>
|
|
63659
|
+
<${spinnerTag}>
|
|
63660
|
+
</span>
|
|
63661
|
+
`)}
|
|
63662
|
+
${when(x => !x.loading, html `
|
|
63663
|
+
<${buttonTag}
|
|
63664
|
+
appearance="${ButtonAppearance.ghost}"
|
|
63665
|
+
content-hidden
|
|
63666
|
+
class="expand-collapse-button"
|
|
63667
|
+
tabindex="-1"
|
|
63668
|
+
@click="${(x, c) => x.onRowExpandToggle(c.event)}"
|
|
63669
|
+
title="${x => (x.expanded ? tableRowCollapseLabel.getValueFor(x) : tableRowExpandLabel.getValueFor(x))}"
|
|
63670
|
+
aria-hidden="true"
|
|
63671
|
+
>
|
|
63672
|
+
<${iconArrowExpanderRightTag} ${ref('expandIcon')} slot="start" class="expander-icon ${x => x.animationClass}"></${iconArrowExpanderRightTag}>
|
|
63673
|
+
</${buttonTag}>
|
|
63674
|
+
`)}
|
|
62699
63675
|
`)}
|
|
62700
63676
|
|
|
62701
63677
|
<span ${ref('cellContainer')}
|
|
@@ -62750,6 +63726,7 @@ img.ProseMirror-separator {
|
|
|
62750
63726
|
this.isParentRow = false;
|
|
62751
63727
|
this.menuOpen = false;
|
|
62752
63728
|
this.rowOperationGridCellHidden = false;
|
|
63729
|
+
this.loading = false;
|
|
62753
63730
|
/**
|
|
62754
63731
|
* @internal
|
|
62755
63732
|
* An array that parallels the `columns` array and contains the indent
|
|
@@ -62954,6 +63931,9 @@ img.ProseMirror-separator {
|
|
|
62954
63931
|
__decorate$1([
|
|
62955
63932
|
attr({ attribute: 'row-operation-grid-cell-hidden', mode: 'boolean' })
|
|
62956
63933
|
], TableRow.prototype, "rowOperationGridCellHidden", void 0);
|
|
63934
|
+
__decorate$1([
|
|
63935
|
+
attr({ mode: 'boolean' })
|
|
63936
|
+
], TableRow.prototype, "loading", void 0);
|
|
62957
63937
|
__decorate$1([
|
|
62958
63938
|
observable
|
|
62959
63939
|
], TableRow.prototype, "cellIndentLevels", void 0);
|
|
@@ -63325,6 +64305,7 @@ img.ProseMirror-separator {
|
|
|
63325
64305
|
:isParentRow="${(x, c) => c.parent.tableData[x.index]?.isParentRow}"
|
|
63326
64306
|
:nestingLevel="${(x, c) => c.parent.tableData[x.index]?.nestingLevel}"
|
|
63327
64307
|
?row-operation-grid-cell-hidden="${(_, c) => !c.parent.showRowOperationColumn}"
|
|
64308
|
+
?loading="${(x, c) => c.parent.tableData[x.index]?.isLoadingChildren}"
|
|
63328
64309
|
@click="${(x, c) => c.parent.onRowClick(x.index, c.event)}"
|
|
63329
64310
|
@row-selection-toggle="${(x, c) => c.parent.onRowSelectionToggle(x.index, c.event)}"
|
|
63330
64311
|
@row-action-menu-beforetoggle="${(x, c) => c.parent.onRowActionMenuBeforeToggle(x.index, c.event)}"
|
|
@@ -63703,6 +64684,9 @@ img.ProseMirror-separator {
|
|
|
63703
64684
|
}
|
|
63704
64685
|
}
|
|
63705
64686
|
return furthestMeasurements.size === _this.options.lanes ? Array.from(furthestMeasurements.values()).sort(function (a, b) {
|
|
64687
|
+
if (a.end === b.end) {
|
|
64688
|
+
return a.index - b.index;
|
|
64689
|
+
}
|
|
63706
64690
|
return a.end - b.end;
|
|
63707
64691
|
})[0] : undefined;
|
|
63708
64692
|
};
|
|
@@ -63804,7 +64788,7 @@ img.ProseMirror-separator {
|
|
|
63804
64788
|
var itemSize = (_this$itemSizeCache$g = _this.itemSizeCache.get(item.key)) != null ? _this$itemSizeCache$g : item.size;
|
|
63805
64789
|
var delta = size - itemSize;
|
|
63806
64790
|
if (delta !== 0) {
|
|
63807
|
-
if (item.start < _this.scrollOffset) {
|
|
64791
|
+
if (item.start < _this.scrollOffset + _this.scrollAdjustments) {
|
|
63808
64792
|
if (_this.options.debug) {
|
|
63809
64793
|
console.info('correction', delta);
|
|
63810
64794
|
}
|
|
@@ -63962,8 +64946,19 @@ img.ProseMirror-separator {
|
|
|
63962
64946
|
});
|
|
63963
64947
|
};
|
|
63964
64948
|
this.getTotalSize = function () {
|
|
63965
|
-
var _this
|
|
63966
|
-
|
|
64949
|
+
var measurements = _this.getMeasurements();
|
|
64950
|
+
var end;
|
|
64951
|
+
// If there are no measurements, set the end to paddingStart
|
|
64952
|
+
if (measurements.length === 0) {
|
|
64953
|
+
end = _this.options.paddingStart;
|
|
64954
|
+
} else {
|
|
64955
|
+
var _measurements$end, _measurements;
|
|
64956
|
+
// If lanes is 1, use the last measurement's end, otherwise find the maximum end value among all measurements
|
|
64957
|
+
end = _this.options.lanes === 1 ? (_measurements$end = (_measurements = measurements[measurements.length - 1]) == null ? void 0 : _measurements.end) != null ? _measurements$end : 0 : Math.max.apply(Math, measurements.slice(-_this.options.lanes).map(function (m) {
|
|
64958
|
+
return m.end;
|
|
64959
|
+
}));
|
|
64960
|
+
}
|
|
64961
|
+
return end - _this.options.scrollMargin + _this.options.paddingEnd;
|
|
63967
64962
|
};
|
|
63968
64963
|
this._scrollToOffset = function (offset, _ref8) {
|
|
63969
64964
|
var adjustments = _ref8.adjustments,
|
|
@@ -65038,12 +66033,19 @@ img.ProseMirror-separator {
|
|
|
65038
66033
|
setHierarchyEnabled(isHierarchyEnabled) {
|
|
65039
66034
|
this.isHierarchyEnabled = isHierarchyEnabled;
|
|
65040
66035
|
}
|
|
65041
|
-
|
|
66036
|
+
isLoadingChildren(id) {
|
|
65042
66037
|
if (!this.isHierarchyEnabled) {
|
|
65043
66038
|
return false;
|
|
65044
66039
|
}
|
|
65045
66040
|
return (this.hierarchyOptions.get(id)?.delayedHierarchyState
|
|
65046
|
-
=== TableRecordDelayedHierarchyState.
|
|
66041
|
+
=== TableRecordDelayedHierarchyState.loadingChildren ?? false);
|
|
66042
|
+
}
|
|
66043
|
+
canLoadDelayedChildren(id) {
|
|
66044
|
+
if (!this.isHierarchyEnabled) {
|
|
66045
|
+
return false;
|
|
66046
|
+
}
|
|
66047
|
+
const delayedHierarchyState = this.hierarchyOptions.get(id)?.delayedHierarchyState;
|
|
66048
|
+
return delayedHierarchyState !== TableRecordDelayedHierarchyState.none;
|
|
65047
66049
|
}
|
|
65048
66050
|
}
|
|
65049
66051
|
|
|
@@ -65666,7 +66668,8 @@ img.ProseMirror-separator {
|
|
|
65666
66668
|
: row.depth,
|
|
65667
66669
|
isParentRow: isParent,
|
|
65668
66670
|
immediateChildCount: row.subRows.length,
|
|
65669
|
-
groupColumn: this.getGroupRowColumn(row)
|
|
66671
|
+
groupColumn: this.getGroupRowColumn(row),
|
|
66672
|
+
isLoadingChildren: this.expansionManager.isLoadingChildren(row.id)
|
|
65670
66673
|
};
|
|
65671
66674
|
hasDataHierarchy = hasDataHierarchy || isParent;
|
|
65672
66675
|
return rowState;
|