@knime/kds-components 11.5.0 → 11.6.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/CHANGELOG.md +14 -0
- package/dist/index.css +23 -23
- package/dist/index.js +287 -218
- package/dist/index.js.map +1 -1
- package/dist/src/components/buttons/KdsMenuButton/KdsMenuButton.vue.d.ts +2 -83
- package/dist/src/components/buttons/KdsMenuButton/KdsMenuButton.vue.d.ts.map +1 -1
- package/dist/src/components/buttons/KdsMenuButton/types.d.ts +4 -0
- package/dist/src/components/buttons/KdsMenuButton/types.d.ts.map +1 -1
- package/dist/src/components/forms/selects/MultiSelectListBox/KdsMultiSelectListBox.vue.d.ts.map +1 -1
- package/dist/src/components/forms/selects/TwinList/TwinListBody.vue.d.ts.map +1 -1
- package/dist/src/layouts/panels/Navigation/KdsNavItem/types.d.ts +3 -1
- package/dist/src/layouts/panels/Navigation/KdsNavItem/types.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -7167,8 +7167,8 @@ function prettyBytes(number, options) {
|
|
|
7167
7167
|
return applyFixedWidth(result, options.fixedWidth);
|
|
7168
7168
|
}
|
|
7169
7169
|
//#endregion
|
|
7170
|
-
//#region ../../node_modules/.pnpm/dompurify@3.4.
|
|
7171
|
-
/*! @license DOMPurify 3.4.
|
|
7170
|
+
//#region ../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs
|
|
7171
|
+
/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */
|
|
7172
7172
|
function _OverloadYield(e, d) {
|
|
7173
7173
|
this.v = e, this.k = d;
|
|
7174
7174
|
}
|
|
@@ -7292,9 +7292,12 @@ Array.prototype.indexOf;
|
|
|
7292
7292
|
var arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
|
7293
7293
|
var arrayPop = unapply(Array.prototype.pop);
|
|
7294
7294
|
var arrayPush = unapply(Array.prototype.push);
|
|
7295
|
-
Array.prototype.slice;
|
|
7295
|
+
var arraySlice = unapply(Array.prototype.slice);
|
|
7296
7296
|
var arraySplice = unapply(Array.prototype.splice);
|
|
7297
7297
|
var arrayIsArray = Array.isArray;
|
|
7298
|
+
var setCreate = unconstruct(Set);
|
|
7299
|
+
var setAdd = unapply(Set.prototype.add);
|
|
7300
|
+
var setHas = unapply(Set.prototype.has);
|
|
7298
7301
|
var stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
7299
7302
|
var stringToString = unapply(String.prototype.toString);
|
|
7300
7303
|
var stringMatch = unapply(String.prototype.match);
|
|
@@ -7437,6 +7440,25 @@ function lookupGetter(object, prop) {
|
|
|
7437
7440
|
}
|
|
7438
7441
|
return fallbackValue;
|
|
7439
7442
|
}
|
|
7443
|
+
/**
|
|
7444
|
+
* Like lookupGetter, but for accessor properties only, and returns null
|
|
7445
|
+
* instead of a null-returning fallback when no getter exists on the chain.
|
|
7446
|
+
* Lets a caller fall back to a direct property read in environments that
|
|
7447
|
+
* lack the getter, where a fallback returning null would be indistinguishable
|
|
7448
|
+
* from a legitimate null value (e.g. namespaceURI of a no-namespace element).
|
|
7449
|
+
*
|
|
7450
|
+
* @param object - The object (usually a prototype) to start the lookup at.
|
|
7451
|
+
* @param prop - The accessor property name.
|
|
7452
|
+
* @returns The unapplied getter, or null if none was found.
|
|
7453
|
+
*/
|
|
7454
|
+
function lookupAccessor(object, prop) {
|
|
7455
|
+
while (object !== null) {
|
|
7456
|
+
const desc = getOwnPropertyDescriptor(object, prop);
|
|
7457
|
+
if (desc) return desc.get ? unapply(desc.get) : null;
|
|
7458
|
+
object = getPrototypeOf(object);
|
|
7459
|
+
}
|
|
7460
|
+
return null;
|
|
7461
|
+
}
|
|
7440
7462
|
function isRegex(value) {
|
|
7441
7463
|
try {
|
|
7442
7464
|
regExpTest(value, "");
|
|
@@ -8121,7 +8143,7 @@ var NODE_TYPE = {
|
|
|
8121
8143
|
documentFragment: 11,
|
|
8122
8144
|
notation: 12
|
|
8123
8145
|
};
|
|
8124
|
-
var
|
|
8146
|
+
var LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, [
|
|
8125
8147
|
"style",
|
|
8126
8148
|
"script",
|
|
8127
8149
|
"xmp",
|
|
@@ -8130,15 +8152,7 @@ var LITERAL_TEXT_ELEMENT_NAMES = [
|
|
|
8130
8152
|
"noframes",
|
|
8131
8153
|
"plaintext",
|
|
8132
8154
|
"noscript"
|
|
8133
|
-
];
|
|
8134
|
-
var LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, LITERAL_TEXT_ELEMENT_NAMES));
|
|
8135
|
-
var LITERAL_TEXT_CLOSE = function() {
|
|
8136
|
-
const map = {};
|
|
8137
|
-
arrayForEach(LITERAL_TEXT_ELEMENT_NAMES, (name) => {
|
|
8138
|
-
map[name] = seal(new RegExp("</" + name + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
8139
|
-
});
|
|
8140
|
-
return freeze(map);
|
|
8141
|
-
}();
|
|
8155
|
+
]));
|
|
8142
8156
|
var getGlobal = function getGlobal() {
|
|
8143
8157
|
return typeof window === "undefined" ? null : window;
|
|
8144
8158
|
};
|
|
@@ -8216,7 +8230,7 @@ var _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallback)
|
|
|
8216
8230
|
function createDOMPurify() {
|
|
8217
8231
|
let window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
|
|
8218
8232
|
const DOMPurify = (root) => createDOMPurify(root);
|
|
8219
|
-
DOMPurify.version = "3.4.
|
|
8233
|
+
DOMPurify.version = "3.4.17";
|
|
8220
8234
|
DOMPurify.removed = [];
|
|
8221
8235
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
8222
8236
|
DOMPurify.isSupported = false;
|
|
@@ -8248,6 +8262,10 @@ function createDOMPurify() {
|
|
|
8248
8262
|
const _readNodeName = function _readNodeName(node) {
|
|
8249
8263
|
return getNodeName ? getNodeName(node) : node.nodeName;
|
|
8250
8264
|
};
|
|
8265
|
+
const getNamespaceURI = lookupAccessor(ElementPrototype, "namespaceURI");
|
|
8266
|
+
const _readNamespaceURI = function _readNamespaceURI(element) {
|
|
8267
|
+
return getNamespaceURI ? getNamespaceURI(element) : element.namespaceURI;
|
|
8268
|
+
};
|
|
8251
8269
|
if (typeof HTMLTemplateElement === "function") {
|
|
8252
8270
|
const template = document.createElement("template");
|
|
8253
8271
|
if (template.content && template.content.ownerDocument) document = template.content.ownerDocument;
|
|
@@ -8368,6 +8386,7 @@ function createDOMPurify() {
|
|
|
8368
8386
|
const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
|
|
8369
8387
|
let KEEP_CONTENT = true;
|
|
8370
8388
|
let IN_PLACE = false;
|
|
8389
|
+
let IN_PLACE_VISITED = null;
|
|
8371
8390
|
let USE_PROFILES = {};
|
|
8372
8391
|
let FORBID_CONTENTS = null;
|
|
8373
8392
|
const DEFAULT_FORBID_CONTENTS = addToSet({}, [
|
|
@@ -8641,18 +8660,23 @@ function createDOMPurify() {
|
|
|
8641
8660
|
* return. Return true otherwise.
|
|
8642
8661
|
*/
|
|
8643
8662
|
const _checkValidNamespace = function _checkValidNamespace(element) {
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8663
|
+
const elementNamespace = _readNamespaceURI(element);
|
|
8664
|
+
const tagName = stringToLowerCase(_readNodeName(element));
|
|
8665
|
+
const parentNode = getParentNode(element);
|
|
8666
|
+
let parent;
|
|
8667
|
+
let parentTagName;
|
|
8668
|
+
if (parentNode && _readNodeType(parentNode) === NODE_TYPE.element) {
|
|
8669
|
+
parent = { namespaceURI: _readNamespaceURI(parentNode) };
|
|
8670
|
+
parentTagName = stringToLowerCase(_readNodeName(parentNode));
|
|
8671
|
+
} else {
|
|
8672
|
+
parent = { namespaceURI: NAMESPACE };
|
|
8673
|
+
parentTagName = "template";
|
|
8674
|
+
}
|
|
8675
|
+
if (!ALLOWED_NAMESPACES[elementNamespace]) return false;
|
|
8676
|
+
if (elementNamespace === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parent, parentTagName);
|
|
8677
|
+
if (elementNamespace === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parent, parentTagName);
|
|
8678
|
+
if (elementNamespace === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parent, parentTagName);
|
|
8679
|
+
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[elementNamespace]) return true;
|
|
8656
8680
|
return false;
|
|
8657
8681
|
};
|
|
8658
8682
|
/**
|
|
@@ -8696,36 +8720,21 @@ function createDOMPurify() {
|
|
|
8696
8720
|
}
|
|
8697
8721
|
};
|
|
8698
8722
|
/**
|
|
8699
|
-
*
|
|
8700
|
-
*
|
|
8701
|
-
*
|
|
8702
|
-
* (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered
|
|
8703
|
-
* custom element's reaction detaches a node so `_forceRemove`'s deliberate
|
|
8704
|
-
* parentless guard throws, or any other re-entrant engine mutation — would
|
|
8705
|
-
* otherwise leave the caller's *live* tree half-sanitized, with everything
|
|
8706
|
-
* after the abort point still carrying its handlers. There is no safe way
|
|
8707
|
-
* to resume the walk (the tree mutated under us), so we strip the root bare:
|
|
8708
|
-
* remove every child and every attribute, then let the caller's catch see
|
|
8709
|
-
* the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`
|
|
8710
|
-
* getters; the root was already clobber-pre-flighted at the IN_PLACE entry).
|
|
8723
|
+
* Fail-closed teardown of an in-place root: strip every disallowed attribute
|
|
8724
|
+
* in the subtree first, so nothing armed is left behind, then remove all
|
|
8725
|
+
* children and the root's own attributes.
|
|
8711
8726
|
*
|
|
8712
8727
|
* @param root the in-place root to empty
|
|
8713
8728
|
*/
|
|
8714
8729
|
const _neutralizeRoot = function _neutralizeRoot(root) {
|
|
8715
8730
|
_neutralizeSubtree(root);
|
|
8716
8731
|
const childNodes = getChildNodes(root);
|
|
8717
|
-
if (childNodes) {
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
try {
|
|
8724
|
-
remove(child);
|
|
8725
|
-
} catch (_) {}
|
|
8726
|
-
});
|
|
8727
|
-
}
|
|
8728
|
-
const attributes = getAttributes(root);
|
|
8732
|
+
if (childNodes) arrayForEach(arraySlice(childNodes), (child) => {
|
|
8733
|
+
try {
|
|
8734
|
+
remove(child);
|
|
8735
|
+
} catch (_) {}
|
|
8736
|
+
});
|
|
8737
|
+
const attributes = _readNodeType(root) === NODE_TYPE.element ? getAttributes(root) : null;
|
|
8729
8738
|
if (attributes) for (let i = attributes.length - 1; i >= 0; --i) {
|
|
8730
8739
|
const attribute = attributes[i];
|
|
8731
8740
|
const name = attribute && attribute.name;
|
|
@@ -8733,18 +8742,9 @@ function createDOMPurify() {
|
|
|
8733
8742
|
}
|
|
8734
8743
|
};
|
|
8735
8744
|
/**
|
|
8736
|
-
*
|
|
8737
|
-
*
|
|
8738
|
-
*
|
|
8739
|
-
* lookup key for HTML elements in an HTML document, so they silently miss an
|
|
8740
|
-
* attribute whose stored qualified name still contains uppercase ASCII
|
|
8741
|
-
* letters. That happens when the node came from a case-preserving source
|
|
8742
|
-
* (an XML/XHTML document imported via importNode(), or createAttributeNS()),
|
|
8743
|
-
* where e.g. `ONERROR` survives the walk: the policy check lowercases to
|
|
8744
|
-
* `onerror` and rejects it, but `removeAttribute('ONERROR')` looks up
|
|
8745
|
-
* `onerror` and finds nothing. Remove the exact Attr node instead, which is
|
|
8746
|
-
* case- and namespace-exact, and fall back to name-based removal only when
|
|
8747
|
-
* the caller could not supply the node.
|
|
8745
|
+
* Removes an attribute, preferably as its exact Attr node: name-based
|
|
8746
|
+
* removal lowercases the name in HTML documents and misses case-preserved
|
|
8747
|
+
* names, e.g. from imported XHTML.
|
|
8748
8748
|
*
|
|
8749
8749
|
* @param name an Attribute name
|
|
8750
8750
|
* @param element a DOM node
|
|
@@ -8776,12 +8776,8 @@ function createDOMPurify() {
|
|
|
8776
8776
|
} catch (_) {}
|
|
8777
8777
|
};
|
|
8778
8778
|
/**
|
|
8779
|
-
*
|
|
8780
|
-
*
|
|
8781
|
-
* Removes every attribute the active configuration does not allow from a
|
|
8782
|
-
* single element, using the same allowlist as the main attribute pass (so
|
|
8783
|
-
* `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to
|
|
8784
|
-
* neutralise nodes that are being discarded from an in-place tree.
|
|
8779
|
+
* Removes every attribute the configuration does not allow. Used to
|
|
8780
|
+
* neutralize nodes discarded from an in-place tree.
|
|
8785
8781
|
*
|
|
8786
8782
|
* @param element the element to strip
|
|
8787
8783
|
*/
|
|
@@ -8796,77 +8792,158 @@ function createDOMPurify() {
|
|
|
8796
8792
|
}
|
|
8797
8793
|
};
|
|
8798
8794
|
/**
|
|
8799
|
-
*
|
|
8795
|
+
* Iterative depth-first walk, so deep trees cannot overflow the call stack,
|
|
8796
|
+
* reading through the cached getters, so clobbering cannot hide children.
|
|
8797
|
+
* When `visit` returns false, the node's children are skipped. With
|
|
8798
|
+
* `intoShadow`, open shadow roots are walked after their host's children.
|
|
8800
8799
|
*
|
|
8801
|
-
*
|
|
8802
|
-
*
|
|
8803
|
-
*
|
|
8804
|
-
* all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path
|
|
8805
|
-
* those dropped nodes are detached from the caller's LIVE tree but a
|
|
8806
|
-
* handler-bearing original among them (an `<img onerror>`/`<video>` that was
|
|
8807
|
-
* loading) keeps its queued resource event, which fires in page scope after
|
|
8808
|
-
* sanitize returns. This walks a removed subtree and strips every attribute
|
|
8809
|
-
* the active configuration does not allow — so `on*` handlers are cancelled
|
|
8810
|
-
* through the SAME allowlist that governs kept nodes, not a separate `/^on/`
|
|
8811
|
-
* blocklist. Run synchronously before sanitize returns, i.e. before any
|
|
8812
|
-
* queued event can fire. Hook-free by design: these nodes leave the output,
|
|
8813
|
-
* so firing attribute hooks for them would be surprising. Clobber-safe reads;
|
|
8814
|
-
* a doomed clobbered node may shadow `removeAttribute` (its own attributes are
|
|
8815
|
-
* irrelevant — it is discarded — while its non-clobbered descendants, e.g.
|
|
8816
|
-
* the `<img>`, are reached and scrubbed).
|
|
8817
|
-
*
|
|
8818
|
-
* @param root the root of a removed subtree to neutralise
|
|
8800
|
+
* @param root where to start
|
|
8801
|
+
* @param visit called for every node
|
|
8802
|
+
* @param intoShadow whether to enter open shadow roots
|
|
8819
8803
|
*/
|
|
8820
|
-
const
|
|
8804
|
+
const _walkTree = function _walkTree(root, visit) {
|
|
8805
|
+
let intoShadow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
8821
8806
|
const stack = [root];
|
|
8822
8807
|
while (stack.length > 0) {
|
|
8823
8808
|
const node = stack.pop();
|
|
8824
|
-
if (
|
|
8809
|
+
if (visit(node) === false) continue;
|
|
8810
|
+
if (intoShadow && _readNodeType(node) === NODE_TYPE.element) {
|
|
8811
|
+
const shadowRoot = getShadowRoot(node);
|
|
8812
|
+
if (_isDocumentFragment(shadowRoot)) stack.push(shadowRoot);
|
|
8813
|
+
}
|
|
8825
8814
|
const childNodes = getChildNodes(node);
|
|
8826
8815
|
if (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);
|
|
8827
8816
|
}
|
|
8828
8817
|
};
|
|
8829
8818
|
/**
|
|
8830
|
-
*
|
|
8819
|
+
* Strips disallowed attributes from every element of a discarded subtree,
|
|
8820
|
+
* so a handler that is already queued (a loading image) cannot fire.
|
|
8831
8821
|
*
|
|
8832
|
-
*
|
|
8833
|
-
|
|
8822
|
+
* @param root the root of a removed subtree
|
|
8823
|
+
*/
|
|
8824
|
+
const _neutralizeSubtree = function _neutralizeSubtree(root) {
|
|
8825
|
+
_walkTree(root, (node) => {
|
|
8826
|
+
if (_readNodeType(node) === NODE_TYPE.element) _stripDisallowedAttributes(node);
|
|
8827
|
+
});
|
|
8828
|
+
};
|
|
8829
|
+
/**
|
|
8830
|
+
* All nodes under `root`, root first, including open shadow roots. Template
|
|
8831
|
+
* content is not entered, it is inert.
|
|
8834
8832
|
*
|
|
8835
|
-
*
|
|
8836
|
-
*
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8833
|
+
* @param root the in-place root
|
|
8834
|
+
* @return the nodes
|
|
8835
|
+
*/
|
|
8836
|
+
const _collectLiveNodes = function _collectLiveNodes(root) {
|
|
8837
|
+
const nodes = [];
|
|
8838
|
+
_walkTree(root, (node) => {
|
|
8839
|
+
nodes.push(node);
|
|
8840
|
+
}, true);
|
|
8841
|
+
return nodes;
|
|
8842
|
+
};
|
|
8843
|
+
/**
|
|
8844
|
+
* Strips disallowed attributes from every element that was under the
|
|
8845
|
+
* in-place root when the call started and no longer is, whatever removed
|
|
8846
|
+
* or moved it.
|
|
8845
8847
|
*
|
|
8846
|
-
*
|
|
8847
|
-
*
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8848
|
+
* @param root the in-place root
|
|
8849
|
+
* @param before the root's nodes, collected before the walk
|
|
8850
|
+
*/
|
|
8851
|
+
const _neutralizeEscapedElements = function _neutralizeEscapedElements(root, before) {
|
|
8852
|
+
const reachable = setCreate();
|
|
8853
|
+
arrayForEach(_collectLiveNodes(root), (node) => {
|
|
8854
|
+
if (_readNodeType(node) === NODE_TYPE.element) setAdd(reachable, node);
|
|
8855
|
+
});
|
|
8856
|
+
arrayForEach(before, (node) => {
|
|
8857
|
+
if (_readNodeType(node) === NODE_TYPE.element && !setHas(reachable, node)) _stripDisallowedAttributes(node);
|
|
8858
|
+
});
|
|
8859
|
+
};
|
|
8860
|
+
/**
|
|
8861
|
+
* Neutralizes everything that left the in-place tree during the call: what
|
|
8862
|
+
* DOMPurify removed, and what hooks or custom elements removed or moved out.
|
|
8851
8863
|
*
|
|
8852
|
-
*
|
|
8853
|
-
*
|
|
8864
|
+
* @param root the in-place root
|
|
8865
|
+
* @param before the root's nodes, collected before the walk
|
|
8866
|
+
* @return true if the root itself was removed
|
|
8867
|
+
*/
|
|
8868
|
+
const _neutralizeDiscarded = function _neutralizeDiscarded(root, before) {
|
|
8869
|
+
let rootRemoved = false;
|
|
8870
|
+
arrayForEach(DOMPurify.removed, (entry) => {
|
|
8871
|
+
if (entry.element) {
|
|
8872
|
+
rootRemoved = rootRemoved || entry.element === root;
|
|
8873
|
+
_neutralizeSubtree(entry.element);
|
|
8874
|
+
}
|
|
8875
|
+
});
|
|
8876
|
+
_neutralizeEscapedElements(root, before);
|
|
8877
|
+
return rootRemoved;
|
|
8878
|
+
};
|
|
8879
|
+
const MAX_UNVISITED_ROUNDS = 8;
|
|
8880
|
+
/**
|
|
8881
|
+
* The walk only moves forward, so a node moved to a position it already
|
|
8882
|
+
* passed is never visited. Give every original node that is still in the
|
|
8883
|
+
* tree but unvisited the normal treatment, hooks included. Nodes created
|
|
8884
|
+
* during the call are left alone. Fails closed if the tree keeps changing.
|
|
8854
8885
|
*
|
|
8855
|
-
*
|
|
8856
|
-
*
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8886
|
+
* @param root the in-place root
|
|
8887
|
+
* @param before the root's nodes, collected before the walk
|
|
8888
|
+
*/
|
|
8889
|
+
const _sanitizeUnvisitedNodes = function _sanitizeUnvisitedNodes(root, before) {
|
|
8890
|
+
const visited = IN_PLACE_VISITED;
|
|
8891
|
+
let original = null;
|
|
8892
|
+
const getOriginal = () => {
|
|
8893
|
+
if (!original) {
|
|
8894
|
+
original = setCreate();
|
|
8895
|
+
arrayForEach(before, (beforeNode) => {
|
|
8896
|
+
setAdd(original, beforeNode);
|
|
8897
|
+
});
|
|
8898
|
+
}
|
|
8899
|
+
return original;
|
|
8900
|
+
};
|
|
8901
|
+
for (let round = 0;; round++) {
|
|
8902
|
+
const live = _collectLiveNodes(root);
|
|
8903
|
+
const containers = [root];
|
|
8904
|
+
let pending = false;
|
|
8905
|
+
arrayForEach(live, (node) => {
|
|
8906
|
+
if (_readNodeType(node) === NODE_TYPE.documentFragment) arrayPush(containers, node);
|
|
8907
|
+
else if (!pending && !setHas(visited, node)) pending = setHas(getOriginal(), node);
|
|
8908
|
+
});
|
|
8909
|
+
if (!pending) return;
|
|
8910
|
+
if (round >= MAX_UNVISITED_ROUNDS) throw typeErrorCreate("the tree kept changing during in-place sanitization; refusing to return it");
|
|
8911
|
+
arrayForEach(containers, (container, index) => {
|
|
8912
|
+
_sanitizeUnvisitedIn(container, index > 0, root, getOriginal());
|
|
8913
|
+
});
|
|
8914
|
+
}
|
|
8915
|
+
};
|
|
8916
|
+
/**
|
|
8917
|
+
* One _sanitizeUnvisitedNodes pass over the root or an open shadow root.
|
|
8861
8918
|
*
|
|
8862
|
-
* @param
|
|
8919
|
+
* @param container the root or an open shadow root
|
|
8920
|
+
* @param inShadow whether container is a shadow root
|
|
8921
|
+
* @param root the in-place root
|
|
8922
|
+
* @param original the root's nodes collected before the walk, as a set
|
|
8863
8923
|
*/
|
|
8924
|
+
const _sanitizeUnvisitedIn = function _sanitizeUnvisitedIn(container, inShadow, root, original) {
|
|
8925
|
+
const iterator = _createNodeIterator(container);
|
|
8926
|
+
let node;
|
|
8927
|
+
while (node = iterator.nextNode()) {
|
|
8928
|
+
if (!setHas(original, node) || setHas(IN_PLACE_VISITED, node)) continue;
|
|
8929
|
+
if (inShadow) _executeHooks(hooks.uponSanitizeShadowNode, node, null);
|
|
8930
|
+
_sanitizeElements(node, root);
|
|
8931
|
+
_sanitizeAttributes(node, root);
|
|
8932
|
+
if (_isDocumentFragment(node.content)) _sanitizeShadowDOM2(node.content);
|
|
8933
|
+
}
|
|
8934
|
+
};
|
|
8935
|
+
/**
|
|
8936
|
+
* Records that _sanitizeElements processed `node`. No-op outside IN_PLACE.
|
|
8937
|
+
*
|
|
8938
|
+
* @param node the node being processed
|
|
8939
|
+
*/
|
|
8940
|
+
const _markVisited = function _markVisited(node) {
|
|
8941
|
+
if (IN_PLACE_VISITED) setAdd(IN_PLACE_VISITED, node);
|
|
8942
|
+
};
|
|
8864
8943
|
/**
|
|
8865
|
-
*
|
|
8866
|
-
*
|
|
8867
|
-
*
|
|
8868
|
-
* everywhere except on <label>/<output>, and the whole policy is gated on
|
|
8869
|
-
* SAFE_FOR_XML (see the rationale block in _isValidAttribute).
|
|
8944
|
+
* Patch-linkage attributes (declarative partial updates): `patchsrc`
|
|
8945
|
+
* always, `for` everywhere except on <label> and <output>. Gated on
|
|
8946
|
+
* SAFE_FOR_XML. Shared by the IN_PLACE pre-pass and _isValidAttribute.
|
|
8870
8947
|
*
|
|
8871
8948
|
* @param lcName the transformCaseFunc'd attribute name
|
|
8872
8949
|
* @param lcTag the transformCaseFunc'd tag name of the carrying element
|
|
@@ -8877,17 +8954,26 @@ function createDOMPurify() {
|
|
|
8877
8954
|
if (lcName === "patchsrc") return true;
|
|
8878
8955
|
return lcName === "for" && lcTag !== "label" && lcTag !== "output";
|
|
8879
8956
|
};
|
|
8957
|
+
/**
|
|
8958
|
+
* IN_PLACE pre-pass: sever all patch linkage before the walk, so no patch
|
|
8959
|
+
* can fire mid-walk into a part of the tree the walker already passed.
|
|
8960
|
+
* Removes range markers (processing instructions, comments with markup)
|
|
8961
|
+
* and strips linkage attributes. It cannot undo a patch that already fired.
|
|
8962
|
+
*
|
|
8963
|
+
* TODO: if the shipped feature can patch through `for` on <label>/<output>,
|
|
8964
|
+
* drop that pair here too (see test/declarative-patch-probe.html).
|
|
8965
|
+
*
|
|
8966
|
+
* @param root the in-place root to sweep
|
|
8967
|
+
*/
|
|
8880
8968
|
const _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {
|
|
8881
8969
|
if (!SAFE_FOR_XML) return;
|
|
8882
|
-
|
|
8883
|
-
while (stack.length > 0) {
|
|
8884
|
-
const node = stack.pop();
|
|
8970
|
+
_walkTree(root, (node) => {
|
|
8885
8971
|
const nodeType = _readNodeType(node);
|
|
8886
8972
|
if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
|
|
8887
8973
|
try {
|
|
8888
8974
|
remove(node);
|
|
8889
8975
|
} catch (_) {}
|
|
8890
|
-
|
|
8976
|
+
return false;
|
|
8891
8977
|
}
|
|
8892
8978
|
if (nodeType === NODE_TYPE.element) {
|
|
8893
8979
|
const element = node;
|
|
@@ -8897,9 +8983,8 @@ function createDOMPurify() {
|
|
|
8897
8983
|
if (element.hasAttribute && element.hasAttribute("for") && _isPatchLinkageAttribute("for", lcTag)) element.removeAttribute("for");
|
|
8898
8984
|
} catch (_) {}
|
|
8899
8985
|
}
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
}
|
|
8986
|
+
return true;
|
|
8987
|
+
});
|
|
8903
8988
|
};
|
|
8904
8989
|
/**
|
|
8905
8990
|
* _initDocument
|
|
@@ -8976,6 +9061,27 @@ function createDOMPurify() {
|
|
|
8976
9061
|
*/
|
|
8977
9062
|
const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
|
|
8978
9063
|
var _node$querySelectorAl;
|
|
9064
|
+
_scrubOwnCharacterData(node);
|
|
9065
|
+
const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, "template");
|
|
9066
|
+
if (templates) arrayForEach(templates, (tmpl) => {
|
|
9067
|
+
if (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);
|
|
9068
|
+
});
|
|
9069
|
+
};
|
|
9070
|
+
/**
|
|
9071
|
+
* _scrubOwnCharacterData
|
|
9072
|
+
*
|
|
9073
|
+
* Non-recursive core of _scrubTemplateExpressions: normalize `node` and
|
|
9074
|
+
* strip template expressions from its own character data only. Does not
|
|
9075
|
+
* enter <template>.content or attached shadow roots (NodeIterator never
|
|
9076
|
+
* does). Used by _sanitizeShadowDOM, where every nested template content
|
|
9077
|
+
* and shadow root is already walked - and therefore scrubbed - by its own
|
|
9078
|
+
* recursive _sanitizeShadowDOM call; recursing here as well would rescrub
|
|
9079
|
+
* each nested fragment once per ancestor, which is quadratic in nesting
|
|
9080
|
+
* depth.
|
|
9081
|
+
*
|
|
9082
|
+
* @param node The root whose own character data should be scrubbed.
|
|
9083
|
+
*/
|
|
9084
|
+
const _scrubOwnCharacterData = function _scrubOwnCharacterData(node) {
|
|
8979
9085
|
node.normalize();
|
|
8980
9086
|
const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;
|
|
8981
9087
|
const walker = createNodeIterator.call(doc || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
|
|
@@ -8984,10 +9090,6 @@ function createDOMPurify() {
|
|
|
8984
9090
|
currentNode.data = _stripTemplateExpressions(currentNode.data);
|
|
8985
9091
|
currentNode = walker.nextNode();
|
|
8986
9092
|
}
|
|
8987
|
-
const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, "template");
|
|
8988
|
-
if (templates) arrayForEach(templates, (tmpl) => {
|
|
8989
|
-
if (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);
|
|
8990
|
-
});
|
|
8991
9093
|
};
|
|
8992
9094
|
/**
|
|
8993
9095
|
* _isClobbered
|
|
@@ -9063,7 +9165,7 @@ function createDOMPurify() {
|
|
|
9063
9165
|
*/
|
|
9064
9166
|
const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {
|
|
9065
9167
|
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;
|
|
9066
|
-
if (SAFE_FOR_XML && currentNode
|
|
9168
|
+
if (SAFE_FOR_XML && LITERAL_TEXT_ELEMENTS[tagName] && _readNodeType(currentNode) === NODE_TYPE.element && _readNamespaceURI(currentNode) === HTML_NAMESPACE && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === "string" && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent))) return true;
|
|
9067
9169
|
if (currentNode.nodeType === NODE_TYPE.processingInstruction) return true;
|
|
9068
9170
|
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;
|
|
9069
9171
|
return false;
|
|
@@ -9107,7 +9209,7 @@ function createDOMPurify() {
|
|
|
9107
9209
|
*/
|
|
9108
9210
|
const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {
|
|
9109
9211
|
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
|
|
9110
|
-
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
9212
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && !FORBID_CONTENTS[stringToLowerCase(tagName)]) {
|
|
9111
9213
|
const parentNode = getParentNode(currentNode);
|
|
9112
9214
|
const childNodes = getChildNodes(currentNode);
|
|
9113
9215
|
if (childNodes && parentNode) {
|
|
@@ -9140,35 +9242,13 @@ function createDOMPurify() {
|
|
|
9140
9242
|
return set === defaultSet || set === setConfigSet ? clone(set) : set;
|
|
9141
9243
|
};
|
|
9142
9244
|
/**
|
|
9143
|
-
*
|
|
9144
|
-
*
|
|
9145
|
-
*
|
|
9146
|
-
* filtering). Per the cached, unclobberable parentNode getter the node is
|
|
9147
|
-
* genuinely out of the tree, so it can reach neither the serialized
|
|
9148
|
-
* output nor an IN_PLACE live tree; treat it as removed and stop
|
|
9149
|
-
* processing it. Without this guard, the unsafe-node / namespace checks
|
|
9150
|
-
* would call _forceRemove on a parentless node and hit the REPORT-3
|
|
9151
|
-
* fail-closed throw — which exists for nodes DOMPurify wants gone but
|
|
9152
|
-
* *cannot* detach (clobbered / parentless roots), the opposite of a node
|
|
9153
|
-
* that is already safely gone. The walk root is exempt: a detached
|
|
9154
|
-
* IN_PLACE root is legitimate input and must still be fully sanitized,
|
|
9155
|
-
* and a kill-decision on it must keep hitting the REPORT-3 throw.
|
|
9156
|
-
*
|
|
9157
|
-
* Nodes detached by hooks stay the hook's responsibility for placement:
|
|
9158
|
-
* they are not recorded in DOMPurify.removed, so the post-walk IN_PLACE
|
|
9159
|
-
* pass (which iterates DOMPurify.removed) does not reach them. But a
|
|
9160
|
-
* hook-detached subtree can still hold a queued resource-event handler -
|
|
9161
|
-
* e.g. an <img onload> that began loading when the caller built the live
|
|
9162
|
-
* tree - which fires in page scope after sanitize returns even though the
|
|
9163
|
-
* handler never reached the returned tree. That is the audit-5 F1 hazard,
|
|
9164
|
-
* and the documented node.remove() hook pattern walks straight into it.
|
|
9165
|
-
* So on the IN_PLACE path we neutralize the detached subtree inline,
|
|
9166
|
-
* stripping its non-allow-listed attributes before returning, exactly as
|
|
9167
|
-
* the post-walk pass does for _forceRemove'd subtrees.
|
|
9245
|
+
* A hook may have detached the node it was called for. If so, treat it as
|
|
9246
|
+
* removed and stop processing it; the walk root is exempt. On the IN_PLACE
|
|
9247
|
+
* path the detached subtree is neutralized right away.
|
|
9168
9248
|
*
|
|
9169
9249
|
* @param currentNode the node a hook may have detached
|
|
9170
9250
|
* @param root the current walk root
|
|
9171
|
-
* @return true if the node
|
|
9251
|
+
* @return true if the node was detached
|
|
9172
9252
|
*/
|
|
9173
9253
|
const _handleHookDetachedNode = function _handleHookDetachedNode(currentNode, root) {
|
|
9174
9254
|
if (currentNode === root || getParentNode(currentNode) !== null) return false;
|
|
@@ -9185,6 +9265,7 @@ function createDOMPurify() {
|
|
|
9185
9265
|
* @return true if node was killed, false if left alive
|
|
9186
9266
|
*/
|
|
9187
9267
|
const _sanitizeElements = function _sanitizeElements(currentNode, root) {
|
|
9268
|
+
_markVisited(currentNode);
|
|
9188
9269
|
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
9189
9270
|
if (_handleHookDetachedNode(currentNode, root)) return true;
|
|
9190
9271
|
if (_isClobbered(currentNode)) {
|
|
@@ -9328,6 +9409,22 @@ function createDOMPurify() {
|
|
|
9328
9409
|
}
|
|
9329
9410
|
};
|
|
9330
9411
|
/**
|
|
9412
|
+
* _isUnsafeAttributeValue
|
|
9413
|
+
*
|
|
9414
|
+
* Value-based attribute checks that the attribute walk applies before any
|
|
9415
|
+
* hook can force-keep an attribute, shared with the public
|
|
9416
|
+
* isValidAttribute() so that it never approves a value sanitize() would
|
|
9417
|
+
* strip.
|
|
9418
|
+
*
|
|
9419
|
+
* @param name the attribute name as found on the node (case preserved)
|
|
9420
|
+
* @param value the attribute value
|
|
9421
|
+
* @returns true if the attribute must be removed because of its value
|
|
9422
|
+
*/
|
|
9423
|
+
const _isUnsafeAttributeValue = function _isUnsafeAttributeValue(name, value) {
|
|
9424
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) return true;
|
|
9425
|
+
return stringToLowerCase(name) === "attributename" && stringMatch(value, "href") !== null;
|
|
9426
|
+
};
|
|
9427
|
+
/**
|
|
9331
9428
|
* _sanitizeAttributes
|
|
9332
9429
|
*
|
|
9333
9430
|
* @protect attributes
|
|
@@ -9371,11 +9468,7 @@ function createDOMPurify() {
|
|
|
9371
9468
|
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
9372
9469
|
recreatedNamedProp = true;
|
|
9373
9470
|
}
|
|
9374
|
-
if (
|
|
9375
|
-
_removeAttribute(name, currentNode, attr);
|
|
9376
|
-
continue;
|
|
9377
|
-
}
|
|
9378
|
-
if (lcName === "attributename" && stringMatch(value, "href")) {
|
|
9471
|
+
if (_isUnsafeAttributeValue(name, value)) {
|
|
9379
9472
|
_removeAttribute(name, currentNode, attr);
|
|
9380
9473
|
continue;
|
|
9381
9474
|
}
|
|
@@ -9423,24 +9516,13 @@ function createDOMPurify() {
|
|
|
9423
9516
|
}
|
|
9424
9517
|
}
|
|
9425
9518
|
}
|
|
9519
|
+
if (SAFE_FOR_TEMPLATES) _scrubOwnCharacterData(fragment);
|
|
9426
9520
|
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
9427
9521
|
};
|
|
9428
9522
|
/**
|
|
9429
|
-
*
|
|
9430
|
-
*
|
|
9431
|
-
*
|
|
9432
|
-
* the existing _sanitizeShadowDOM pipeline. The default node iterator
|
|
9433
|
-
* does not descend into shadow trees, so nodes inside an attached
|
|
9434
|
-
* shadow root would otherwise be skipped entirely.
|
|
9435
|
-
*
|
|
9436
|
-
* Two real input paths put attached shadow roots in front of us:
|
|
9437
|
-
* 1. IN_PLACE on a DOM node that already has shadow roots attached.
|
|
9438
|
-
* 2. DOM-node input where importNode(dirty, true) deep-clones the
|
|
9439
|
-
* shadow root because it was created with `clonable: true`.
|
|
9440
|
-
*
|
|
9441
|
-
* This pass runs once, up front, so the main iteration loop (and the
|
|
9442
|
-
* existing _sanitizeShadowDOM template-content recursion) stay
|
|
9443
|
-
* untouched — string-input paths are not affected.
|
|
9523
|
+
* Sanitizes every attached shadow root under `root`, since the node
|
|
9524
|
+
* iterator does not enter shadow trees. Needed for IN_PLACE input and for
|
|
9525
|
+
* DOM input whose clonable shadow roots were copied by importNode().
|
|
9444
9526
|
*
|
|
9445
9527
|
* @param root the subtree root to walk for attached shadow roots
|
|
9446
9528
|
*/
|
|
@@ -9505,6 +9587,8 @@ function createDOMPurify() {
|
|
|
9505
9587
|
if (hooks.uponSanitizeAttribute.length > 0) ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
9506
9588
|
DOMPurify.removed = [];
|
|
9507
9589
|
const inPlace = IN_PLACE && typeof dirty !== "string" && _isNode(dirty);
|
|
9590
|
+
let inPlaceNodes = [];
|
|
9591
|
+
const outerVisited = IN_PLACE_VISITED;
|
|
9508
9592
|
if (inPlace) {
|
|
9509
9593
|
_neutralizePatchLinkage(dirty);
|
|
9510
9594
|
const nn = _readNodeName(dirty);
|
|
@@ -9519,12 +9603,8 @@ function createDOMPurify() {
|
|
|
9519
9603
|
_neutralizeRoot(dirty);
|
|
9520
9604
|
throw typeErrorCreate("root node is clobbered and cannot be sanitized in-place");
|
|
9521
9605
|
}
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
} catch (error) {
|
|
9525
|
-
_neutralizeRoot(dirty);
|
|
9526
|
-
throw error;
|
|
9527
|
-
}
|
|
9606
|
+
inPlaceNodes = _collectLiveNodes(dirty);
|
|
9607
|
+
IN_PLACE_VISITED = setCreate();
|
|
9528
9608
|
} else if (_isNode(dirty)) {
|
|
9529
9609
|
body = _initDocument("<!---->");
|
|
9530
9610
|
importedNode = body.ownerDocument.importNode(dirty, true);
|
|
@@ -9540,30 +9620,25 @@ function createDOMPurify() {
|
|
|
9540
9620
|
if (body && FORCE_BODY) _forceRemove(body.firstChild);
|
|
9541
9621
|
const walkRoot = inPlace ? dirty : body;
|
|
9542
9622
|
try {
|
|
9623
|
+
if (inPlace) _sanitizeAttachedShadowRoots(dirty);
|
|
9543
9624
|
const nodeIterator = _createNodeIterator(walkRoot);
|
|
9544
9625
|
while (currentNode = nodeIterator.nextNode()) {
|
|
9545
9626
|
_sanitizeElements(currentNode, walkRoot);
|
|
9546
9627
|
_sanitizeAttributes(currentNode, walkRoot);
|
|
9547
9628
|
if (_isDocumentFragment(currentNode.content)) _sanitizeShadowDOM2(currentNode.content);
|
|
9548
9629
|
}
|
|
9630
|
+
if (inPlace) _sanitizeUnvisitedNodes(dirty, inPlaceNodes);
|
|
9549
9631
|
} catch (error) {
|
|
9550
9632
|
if (inPlace) {
|
|
9551
9633
|
_neutralizeRoot(dirty);
|
|
9552
|
-
|
|
9553
|
-
if (entry.element) _neutralizeSubtree(entry.element);
|
|
9554
|
-
});
|
|
9634
|
+
_neutralizeDiscarded(dirty, inPlaceNodes);
|
|
9555
9635
|
}
|
|
9556
9636
|
throw error;
|
|
9637
|
+
} finally {
|
|
9638
|
+
IN_PLACE_VISITED = outerVisited;
|
|
9557
9639
|
}
|
|
9558
9640
|
if (inPlace) {
|
|
9559
|
-
|
|
9560
|
-
arrayForEach(DOMPurify.removed, (entry) => {
|
|
9561
|
-
if (entry.element) {
|
|
9562
|
-
if (entry.element === dirty) rootWasRemoved = true;
|
|
9563
|
-
_neutralizeSubtree(entry.element);
|
|
9564
|
-
}
|
|
9565
|
-
});
|
|
9566
|
-
if (rootWasRemoved) throw typeErrorCreate("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
9641
|
+
if (_neutralizeDiscarded(dirty, inPlaceNodes)) throw typeErrorCreate("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
9567
9642
|
if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);
|
|
9568
9643
|
return dirty;
|
|
9569
9644
|
}
|
|
@@ -9600,6 +9675,7 @@ function createDOMPurify() {
|
|
|
9600
9675
|
if (!CONFIG) _parseConfig({});
|
|
9601
9676
|
const lcTag = transformCaseFunc(tag);
|
|
9602
9677
|
const lcName = transformCaseFunc(attr);
|
|
9678
|
+
if (typeof value === "string" && (_isUnsafeAttributeValue(attr, value) || !ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value))) return false;
|
|
9603
9679
|
return _isValidAttribute(lcTag, lcName, value);
|
|
9604
9680
|
};
|
|
9605
9681
|
DOMPurify.addHook = function(entryPoint, hookFunction) {
|
|
@@ -25565,9 +25641,9 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
|
|
|
25565
25641
|
], ["update:modelValue"]),
|
|
25566
25642
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
25567
25643
|
useCssVars((_ctx) => ({
|
|
25568
|
-
"
|
|
25569
|
-
"
|
|
25570
|
-
"
|
|
25644
|
+
"v452199fa": dropIndicatorTop.value,
|
|
25645
|
+
"v5f1937ce": dropIndicatorLeft.value,
|
|
25646
|
+
"v3e95ebf4": dropIndicatorWidth.value
|
|
25571
25647
|
}));
|
|
25572
25648
|
const OPTION_LINE_HEIGHT = dimension.component.height["1.5x"].value + spacing.container["0.10x"].value;
|
|
25573
25649
|
const DEFAULT_HEIGHT = dimension.component.height["20x"].value;
|
|
@@ -25599,10 +25675,11 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
|
|
|
25599
25675
|
const allValues = computed(() => visibleBottomValue.value ? [...visiblePossibleValues.value, visibleBottomValue.value] : visiblePossibleValues.value);
|
|
25600
25676
|
const bottomIndex = computed(() => visiblePossibleValues.value.length);
|
|
25601
25677
|
const { containerProps, wrapperProps, list: virtualList, scrollTo } = useVirtualList(visiblePossibleValues, { itemHeight: OPTION_LINE_HEIGHT });
|
|
25602
|
-
watch(visiblePossibleValues, () => {
|
|
25678
|
+
watch(visiblePossibleValues, (values) => {
|
|
25603
25679
|
const el = containerProps.ref.value;
|
|
25604
25680
|
if (!el) return;
|
|
25605
|
-
|
|
25681
|
+
if (Math.floor(el.scrollTop / OPTION_LINE_HEIGHT) < values.length) return;
|
|
25682
|
+
scrollTo(Math.max(values.length - 1, 0));
|
|
25606
25683
|
});
|
|
25607
25684
|
const scrollToIndex = (index) => {
|
|
25608
25685
|
if (index === bottomIndex.value && visibleBottomValue.value) return;
|
|
@@ -25839,7 +25916,7 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
|
|
|
25839
25916
|
]);
|
|
25840
25917
|
};
|
|
25841
25918
|
}
|
|
25842
|
-
}), [["__scopeId", "data-v-
|
|
25919
|
+
}), [["__scopeId", "data-v-9feb50c6"]]);
|
|
25843
25920
|
//#endregion
|
|
25844
25921
|
//#region src/components/forms/selects/TwinList/TwinListBody.vue?vue&type=script&setup=true&lang.ts
|
|
25845
25922
|
var _hoisted_1$29 = { class: "kds-list-column" };
|
|
@@ -25926,28 +26003,20 @@ var TwinListBody_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
25926
26003
|
return props.possibleValues.filter((v) => includedSet.has(String(v.id)));
|
|
25927
26004
|
});
|
|
25928
26005
|
const matchesSearch = (item) => item.text.toLowerCase().includes(__props.searchTerm.toLowerCase());
|
|
25929
|
-
const toMissingOption = (id
|
|
26006
|
+
const toMissingOption = (id) => ({
|
|
25930
26007
|
id,
|
|
25931
26008
|
text: id,
|
|
25932
|
-
missing: true
|
|
25933
|
-
selected: selectedSet.has(id)
|
|
26009
|
+
missing: true
|
|
25934
26010
|
});
|
|
25935
26011
|
const filteredExcludedItems = computed(() => __props.searchTerm ? excludedItems.value.filter(matchesSearch) : excludedItems.value);
|
|
25936
26012
|
const filteredIncludedItems = computed(() => __props.searchTerm ? includedItems.value.filter(matchesSearch) : includedItems.value);
|
|
25937
|
-
const toListOption = (item
|
|
26013
|
+
const toListOption = (item) => ({
|
|
25938
26014
|
id: String(item.id),
|
|
25939
26015
|
text: item.text,
|
|
25940
|
-
accessory: item.accessory
|
|
25941
|
-
selected: selectedSet.has(String(item.id))
|
|
25942
|
-
});
|
|
25943
|
-
const leftOptions = computed(() => {
|
|
25944
|
-
const selectedSet = new Set(leftSelected.value);
|
|
25945
|
-
return [...missingExcludedIds.value.map((id) => toMissingOption(id, selectedSet)), ...filteredExcludedItems.value.map((item) => toListOption(item, selectedSet))];
|
|
25946
|
-
});
|
|
25947
|
-
const rightOptions = computed(() => {
|
|
25948
|
-
const selectedSet = new Set(rightSelected.value);
|
|
25949
|
-
return [...missingIncludedIds.value.map((id) => toMissingOption(id, selectedSet)), ...filteredIncludedItems.value.map((item) => toListOption(item, selectedSet))];
|
|
26016
|
+
accessory: item.accessory
|
|
25950
26017
|
});
|
|
26018
|
+
const leftOptions = computed(() => [...missingExcludedIds.value.map(toMissingOption), ...filteredExcludedItems.value.map(toListOption)]);
|
|
26019
|
+
const rightOptions = computed(() => [...missingIncludedIds.value.map(toMissingOption), ...filteredIncludedItems.value.map(toListOption)]);
|
|
25951
26020
|
const unknownValueOption = computed(() => ({
|
|
25952
26021
|
text: __props.unknownValuesText,
|
|
25953
26022
|
id: UNKNOWN_VALUE_ID
|
|
@@ -26087,7 +26156,7 @@ var TwinListBody_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
26087
26156
|
}, 8, ["height", "min-height"]);
|
|
26088
26157
|
};
|
|
26089
26158
|
}
|
|
26090
|
-
}), [["__scopeId", "data-v-
|
|
26159
|
+
}), [["__scopeId", "data-v-026f08a0"]]);
|
|
26091
26160
|
//#endregion
|
|
26092
26161
|
//#region src/components/forms/selects/TwinList/enums.ts
|
|
26093
26162
|
var kdsTwinListSearchMode = {
|