@oslokommune/punkt-react 13.6.4 → 13.6.6
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/punkt-react.es.js +10 -9
- package/dist/punkt-react.umd.js +88 -88
- package/package.json +4 -4
package/dist/punkt-react.es.js
CHANGED
|
@@ -6013,7 +6013,7 @@ let it = class extends ge {
|
|
|
6013
6013
|
this._isOptionsOpen && !this.contains(r.target) && this.handleFocusOut(r);
|
|
6014
6014
|
}), this._options = [], this.defaultOptions && this.defaultOptions.length) {
|
|
6015
6015
|
const r = ((t = this.options) == null ? void 0 : t.filter((n) => n.userAdded)) || [];
|
|
6016
|
-
this.options = [...r, ...JSON.parse(JSON.stringify(this.defaultOptions))], this._options = [...this.options];
|
|
6016
|
+
this.options = [...r, ...JSON.parse(JSON.stringify(this.defaultOptions))], this._options = Array.isArray(this.options) ? [...this.options] : [];
|
|
6017
6017
|
}
|
|
6018
6018
|
if (this.optionsController.nodes.length) {
|
|
6019
6019
|
const r = [];
|
|
@@ -6028,16 +6028,17 @@ let it = class extends ge {
|
|
|
6028
6028
|
}
|
|
6029
6029
|
}
|
|
6030
6030
|
updated(t) {
|
|
6031
|
-
var r;
|
|
6032
6031
|
if (t.has("_value") && this.valueChanged(this._value, t.get("_value")), t.has("value") && (Array.isArray(this.value) ? this._value = this.value : this.value && this.multiple ? this._value = this.value.split(",") : this.value ? this._value = [this.value] : this._value = [], !this.multiple && this._value.length > 1 && (this._value = [this._value[0]]), this.isMaxItemsReached()), t.has("defaultOptions") && this.defaultOptions.length) {
|
|
6033
|
-
const
|
|
6034
|
-
this.options = [...
|
|
6032
|
+
const r = (Array.isArray(this.options) ? this.options : []).filter((n) => n.userAdded) || [];
|
|
6033
|
+
this.options = [...r, ...JSON.parse(JSON.stringify(this.defaultOptions))], this._options = Array.isArray(this.options) ? [...this.options] : [];
|
|
6035
6034
|
}
|
|
6036
6035
|
if (t.has("options")) {
|
|
6037
|
-
const
|
|
6038
|
-
(a) => !this.options
|
|
6039
|
-
|
|
6040
|
-
|
|
6036
|
+
const r = (t.get("options") || this._options || []).filter((a) => a && a.userAdded).filter(
|
|
6037
|
+
(a) => !(Array.isArray(this.options) ? this.options : []).some(
|
|
6038
|
+
(i) => i.value === a.value
|
|
6039
|
+
)
|
|
6040
|
+
), n = [...r, ...this.options];
|
|
6041
|
+
this._options = n, r.length > 0 && (this.options = n), this._options.forEach((a) => {
|
|
6041
6042
|
if (a.value && !a.label && (a.label = a.value), a.selected && !this._value.includes(a.value)) {
|
|
6042
6043
|
const i = [...this._value];
|
|
6043
6044
|
this._value = [...this._value, a.value], this.valueChanged(this._value, i);
|
|
@@ -6053,7 +6054,7 @@ let it = class extends ge {
|
|
|
6053
6054
|
), super.updated(t);
|
|
6054
6055
|
}
|
|
6055
6056
|
attributeChangedCallback(t, r, n) {
|
|
6056
|
-
t === "value" && (Array.isArray(this.value) ? this._value = this.value : this.value && this.multiple ? this._value = this.value.split(",") : this.value ? this._value = [this.value] : this._value = [], !this.multiple && this._value.length > 1 && (this._value = [this._value[0]])), t === "options" && (this._options = this.options, this._options.forEach((a) => {
|
|
6057
|
+
t === "value" && (Array.isArray(this.value) ? this._value = this.value : this.value && this.multiple ? this._value = this.value.split(",") : this.value ? this._value = [this.value] : this._value = [], !this.multiple && this._value.length > 1 && (this._value = [this._value[0]])), t === "options" && (this._options = Array.isArray(this.options) ? [...this.options] : [], this._options.forEach((a) => {
|
|
6057
6058
|
a.value && !a.label && (a.label = a.value), a.selected && !this._value.includes(a.value) && (this._value = [...this._value, a.value]), a.fulltext = a.value + a.label + (a.prefix || "");
|
|
6058
6059
|
}), this._search = ""), super.attributeChangedCallback(t, r, n);
|
|
6059
6060
|
}
|