Skip to content
Snippets Groups Projects
Verified Commit f8505445 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: update nix, node, code format

parent 798ac427
No related branches found
No related tags found
No related merge requests found
Showing
with 3790 additions and 3351 deletions
export const projectRoot = "/home/vs/workspaces/oss/monster/monster";
export const sourcePath = "/home/vs/workspaces/oss/monster/monster/source";
export const developmentPath = "/home/vs/workspaces/oss/monster/monster/development";
export const pnpxBin = "/nix/store/aik0qrmx9wxy1q480lfwqv1wqsrhcsl8-pnpm-9.15.3/bin/pnpx";
export const nodeBin = "/nix/store/l9vrjjavsgf5b5ypp5m9qcqnivsjpgbf-nodejs-22.13.1/bin/node";
export const pnpxBin = "/nix/store/sxw7i3pyw8v1ycw2sph0zq2byh1prrwm-nodejs-20.18.1/bin/npx";
export const nodeBin = "/nix/store/95gnwih6qz9w2iahacfq9awadby19n3k-nodejs-23.6.1/bin/node";
export const license = "/**" + "\n" +
" * Copyright © schukai GmbH and all contributing authors, {{copyRightYear}}. All rights reserved." + "\n" +
" * Node module: @schukai/monster" + "\n" +
......
......@@ -10,7 +10,7 @@ in
echo_step "Installing dependencies"
if ! ${pkgs'.findutils}/bin/find . -type d -name node_modules -prune -o -type f -name package.json -print | ${pkgs'.findutils}/bin/xargs -I {} sh -c "cd $(dirname {}); ${pkgs'.projectCorepack}/bin/npm install"
if ! ${pkgs'.findutils}/bin/find . -type d -name node_modules -prune -o -type f -name package.json -print | ${pkgs'.findutils}/bin/xargs -I {} sh -c "cd $(dirname {}); ${pkgs'.projectNodeJS}/bin/npm install"
then
echo_error "Failed to install dependencies"
echo_hint "Check the error message and try again"
......
......@@ -19,7 +19,7 @@ in
echo_step "Installing dependencies (node)"
if ! ${pkgs'.findutils}/bin/find . -type d -name node_modules -prune -o -type f -name package.json -print | ${pkgs'.findutils}/bin/xargs -I {} sh -c "cd $(dirname {}); ${pkgs'.projectCorepack}/bin/npm install"
if ! ${pkgs'.findutils}/bin/find . -type d -name node_modules -prune -o -type f -name package.json -print | ${pkgs'.findutils}/bin/xargs -I {} sh -c "cd $(dirname {}); ${pkgs'.projectNodeJS}/bin/npm install"
then
echo_error "Failed to install dependencies"
echo_hint "Check the error message and try again"
......
This diff is collapsed.
......@@ -41,7 +41,8 @@
"license": "AGPL 3.0",
"dependencies": {
"@floating-ui/dom": "^1.6.13",
"@popperjs/core": "^2.11.8"
"@popperjs/core": "^2.11.8",
"buffer": "^6.0.3"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
......@@ -59,10 +60,10 @@
"cssnano": "^7.0.6",
"dom-storage": "^2.1.0",
"element-internals-polyfill": "^1.3.13",
"esbuild": "^0.24.2",
"esbuild": "^0.25.0",
"espree": "^10.3.0",
"estraverse": "^5.3.0",
"flow-bin": "^0.259.1",
"flow-bin": "^0.260.0",
"fs": "0.0.1-security",
"glob": "^11.0.1",
"graphviz": "^0.0.9",
......@@ -70,7 +71,7 @@
"jsdom-global": "^3.0.2",
"mocha": "^11.1.0",
"playwright": "^1.50.1",
"postcss": "^8.5.1",
"postcss": "^8.5.2",
"postcss-fluid": "^1.4.2",
"postcss-for": "^2.1.1",
"postcss-import": "^16.1.0",
......@@ -82,7 +83,7 @@
"postcss-responsive-type": "^1.0.0",
"postcss-rtlcss": "^5.6.0",
"postcss-strip-units": "^2.0.1",
"puppeteer": "^24.1.1",
"puppeteer": "^24.2.0",
"sinon": "^19.0.2",
"turbowatch": "^2.29.4",
"url": "^0.11.4",
......
......@@ -32,7 +32,13 @@ import { Settings } from "./filter/settings.mjs";
import { FilterStyleSheet } from "./stylesheet/filter.mjs";
import { getDocument, getWindow } from "../../dom/util.mjs";
import { getGlobal } from "../../types/global.mjs";
import {isInstance, isFunction, isObject, isArray, isString} from "../../types/is.mjs";
import {
isInstance,
isFunction,
isObject,
isArray,
isString,
} from "../../types/is.mjs";
import { Host } from "../host/host.mjs";
import { addAttributeToken } from "../../dom/attributes.mjs";
import { ATTRIBUTE_ERRORMESSAGE } from "../../dom/constants.mjs";
......@@ -1063,8 +1069,10 @@ function doSearch({ showEffect } = { showEffect: true }) {
return Promise.reject(new Error(msg));
}
if (this.getOption("features.preventSameQuery") &&
buildQuery === this.getOption("query")) {
if (
this.getOption("features.preventSameQuery") &&
buildQuery === this.getOption("query")
) {
const msg = this.getOption("labels.query-not-changed");
if (showEffect) {
......@@ -1205,7 +1213,6 @@ function collectSearchQueries() {
});
},
"tag-list": (value, key) => {
if (isString(value)) {
value = value.split(",");
}
......@@ -1214,11 +1221,15 @@ function collectSearchQueries() {
return "";
}
return key+" IN "+value
return (
key +
" IN " +
value
.map((v) => {
return `"${encodeURIComponent(v)}"`;
})
.join(",");
.join(",")
);
},
"date-range": (value, key) => {
const query = parseDateInput(value, key);
......
......@@ -129,7 +129,6 @@ class SaveButton extends CustomElement {
disabled: false,
logLevel: "off",
});
updateOptionsFromArguments.call(this, obj);
......@@ -209,13 +208,13 @@ class SaveButton extends CustomElement {
console.log(result);
if (isArray(result) && result.length > 0) {
const formattedDiff = result.map(change => ({
const formattedDiff = result.map((change) => ({
Operator: change?.operator,
Path: change?.path?.join("."),
"First Value": change?.first?.value,
"First Type": change?.first?.type,
"Second Value": change?.second?.value,
"Second Type": change?.second?.type
"Second Type": change?.second?.type,
}));
console.table(formattedDiff);
......@@ -223,7 +222,6 @@ class SaveButton extends CustomElement {
console.log("There are no changes to save");
}
console.groupEnd();
}
if (isArray(ignoreChanges) && ignoreChanges.length > 0) {
......
......@@ -342,13 +342,11 @@ class Select extends CustomControl {
* @fires monster-selected this event is fired when the selection is set
*/
set value(value) {
const result = convertValueToSelection.call(this, value);
setSelection
.call(this, result.selection)
.then(() => {
})
.then(() => {})
.catch((e) => {
addErrorAttribute(this, e);
});
......@@ -555,8 +553,7 @@ class Select extends CustomControl {
lastValue = n;
setSelection
.call(self, n)
.then(() => {
})
.then(() => {})
.catch((e) => {
addErrorAttribute(self, e);
});
......@@ -719,32 +716,33 @@ class Select extends CustomControl {
throw new Error("missing label configuration");
}
if (isString(filter)) {
if (0 === filter.indexOf('run:')) {
const code = filter.replace('run:', '');
if (0 === filter.indexOf("run:")) {
const code = filter.replace("run:", "");
filter = (m, v, k) => {
const fkt = new Function('m', 'v', 'k', "control", code);
const fkt = new Function("m", "v", "k", "control", code);
return fkt(m, v, k, self);
}
} else if (0 === filter.indexOf('call:')) {
const parts = filter.split(':');
};
} else if (0 === filter.indexOf("call:")) {
const parts = filter.split(":");
parts.shift(); // remove prefix
const fkt = parts.shift();
switch (fkt) {
case "filterValueOfAttribute":
const attribute = parts.shift();
const attrValue = self.getAttribute(attribute);
filter = (m, v, k) => {
const mm = buildValue(m, valueTemplate);
return mm != attrValue; // no type check, no !==
}
};
break;
default:
addErrorAttribute(this, new Error(`Unknown filter function ${fkt}`));
addErrorAttribute(
this,
new Error(`Unknown filter function ${fkt}`),
);
}
}
}
......@@ -778,8 +776,7 @@ class Select extends CustomControl {
setTimeout(() => {
setSelection
.call(this, this.getOption("selection"))
.then(() => {
})
.then(() => {})
.catch((e) => {
addErrorAttribute(this, e);
});
......@@ -1156,7 +1153,6 @@ function attachResizeObserver() {
});
});
let parent = this.parentNode;
while (!(parent instanceof HTMLElement) && parent !== null) {
parent = parent.parentNode;
......@@ -1165,7 +1161,6 @@ function attachResizeObserver() {
if (parent instanceof HTMLElement) {
this[resizeObserverSymbol].observe(parent);
}
}
/**
......@@ -1416,8 +1411,7 @@ function getDefaultTranslation() {
try {
const doc = getDocumentTranslations();
translation.locale = doc.locale;
} catch (e) {
}
} catch (e) {}
return translation;
}
......@@ -2037,8 +2031,7 @@ function gatherState() {
setSelection
.call(this, selection)
.then(() => {
})
.then(() => {})
.catch((e) => {
addErrorAttribute(this, e);
});
......@@ -2067,8 +2060,7 @@ function clearSelection() {
setSelection
.call(this, [])
.then(() => {
})
.then(() => {})
.catch((e) => {
addErrorAttribute(this, e);
});
......@@ -2289,7 +2281,6 @@ function isValueIsEmpty(value) {
}
return equivalents.indexOf(value) !== -1;
}
/**
......@@ -2298,7 +2289,7 @@ function isValueIsEmpty(value) {
* @returns {*}
*/
function isValueIsEmptyThenGetNormalize(value) {
let emptyDefault = null
let emptyDefault = null;
if (this.getOption("type") === "checkbox") {
emptyDefault = this.getOption("empty.defaultValueCheckbox");
} else {
......@@ -2310,7 +2301,6 @@ function isValueIsEmptyThenGetNormalize(value) {
}
return value;
}
/**
......@@ -2332,9 +2322,8 @@ function setSelection(selection) {
let resultSelection = [];
for (let i = 0; i < selection.length; i++) {
if (isValueIsEmpty.call(this, selection[i].value)) {
continue
continue;
}
let l = getSelectionLabel.call(this, selection[i].value);
......@@ -2368,8 +2357,7 @@ function setSelection(selection) {
fireEvent(this, "change"); // https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/291
if (this[runLookupOnceSymbol] !== true && selection.length > 0) {
this[runLookupOnceSymbol] = true
this[runLookupOnceSymbol] = true;
const lazyLoadFlag =
this.getOption("features.lazyLoad") && this[lazyLoadDoneSymbol] !== true;
......
......@@ -164,34 +164,34 @@ class TreeSelect extends Select {
let filter = mappingOptions?.["filter"];
if (isString(filter)) {
if (0 === filter.indexOf('run:')) {
const code = filter.replace('run:', '');
if (0 === filter.indexOf("run:")) {
const code = filter.replace("run:", "");
filter = (m, v, k) => {
const fkt = new Function('m', 'v', 'k', "control", code);
const fkt = new Function("m", "v", "k", "control", code);
return fkt(m, v, k, self);
}
} else if (0 === filter.indexOf('call:')) {
const parts = filter.split(':');
};
} else if (0 === filter.indexOf("call:")) {
const parts = filter.split(":");
parts.shift(); // remove prefix
const fkt = parts.shift();
switch (fkt) {
case "filterValueOfAttribute":
const attribute = parts.shift();
const attrValue = self.getAttribute(attribute);
filter = (m, v, k) => {
return m?.[id] != attrValue; // no type check, no !==
}
};
break;
default:
addErrorAttribute(this, new Error(`Unknown filter function ${fkt}`));
addErrorAttribute(
this,
new Error(`Unknown filter function ${fkt}`),
);
}
}
}
const rootReferences = mappingOptions?.["rootReferences"];
......@@ -252,7 +252,6 @@ class TreeSelect extends Select {
}
}
/**
* @private
* @param event
......
......@@ -226,7 +226,7 @@ function fetchData(init, key, callback) {
if (acceptedStatus.indexOf(resp.status) === -1) {
throw new DataFetchError(
getInternalLocalizationMessage(
`i18n{the-response-does-not-contain-an-accepted-status::status=${resp.status}}`
`i18n{the-response-does-not-contain-an-accepted-status::status=${resp.status}}`,
),
response,
);
......@@ -248,7 +248,7 @@ function fetchData(init, key, callback) {
throw new DataFetchError(
getInternalLocalizationMessage(
`i18n{the-response-does-not-contain-a-valid-json::actual=${body}}`
`i18n{the-response-does-not-contain-a-valid-json::actual=${body}}`,
),
response,
);
......
......@@ -21,9 +21,7 @@ export {getInternalLocalizationMessage};
let internalTranslations = null;
getInternalTranslations();
function getInternalTranslations() {
if (internalTranslations) {
return internalTranslations;
}
......@@ -31,8 +29,7 @@ function getInternalTranslations() {
let locale = "en";
try {
let locale = getLocaleOfDocument();
} catch (error) {
}
} catch (error) {}
let messages = {};
......@@ -116,16 +113,14 @@ function getInternalTranslations() {
};
}
const translation = new Translations(locale);
translation.assignTranslations(messages);
internalTranslations = translation;
return translation
return translation;
}
/**
* Returns the internal localization message.
* @param message
......@@ -135,5 +130,4 @@ function getInternalTranslations() {
function getInternalLocalizationMessage(message) {
const formatter = new Formatter({}, getInternalTranslations());
return formatter.format(message);
}
......@@ -36,11 +36,9 @@ export const currentSupportedLanguages = [
"da", // Danish
"fi", // Finnish
"no", // Norwegian
"cs" // Czech
"cs", // Czech
];
export const languages = {
en: "English",
"en-GB": "English (United Kingdom)",
......
......@@ -199,6 +199,7 @@ export * from "./types/queue.mjs";
export * from "./types/noderecursiveiterator.mjs";
export * from "./i18n/time-ago.mjs";
export * from "./i18n/formatter.mjs";
export * from "./i18n/internal.mjs";
export * from "./i18n/locale.mjs";
export * from "./i18n/provider.mjs";
export * from "./i18n/providers/fetch.mjs";
......
......@@ -61,8 +61,7 @@ let globalReference;
try {
globalReference = Function("return this")();
} catch (e) {
}
} catch (e) {}
throw new Error("unsupported environment.");
})();
......
......@@ -156,7 +156,7 @@ function getMonsterVersion() {
}
/** don't touch, replaced by make with package.json version */
monsterVersion = new Version("3.104.1");
monsterVersion = new Version("3.107.0");
return monsterVersion;
}
......@@ -7,7 +7,7 @@ describe('Monster', function () {
let monsterVersion
/** don´t touch, replaced by make with package.json version */
monsterVersion = new Version("3.104.1")
monsterVersion = new Version("3.107.0")
let m = getMonsterVersion();
......
......@@ -9,8 +9,8 @@
</head>
<body>
<div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
<h1 style='margin-bottom: 0.1em;'>Monster 3.104.1</h1>
<div id="lastupdate" style='font-size:0.7em'>last update Mi 5. Feb 19:28:33 CET 2025</div>
<h1 style='margin-bottom: 0.1em;'>Monster 3.107.0</h1>
<div id="lastupdate" style='font-size:0.7em'>last update Di 11. Feb 14:09:24 CET 2025</div>
</div>
<div id="mocha-errors"
style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment