neue Homepage auf react basis

This commit is contained in:
2026-08-07 21:39:30 +02:00
parent 164bdd19ad
commit ee89442c04
52191 changed files with 1230242 additions and 58 deletions
@@ -0,0 +1,4 @@
import * as React from 'react';
declare function useSelectFocusSource(): "keyboard" | "mouse" | "touch" | null;
declare const SelectFocusSourceProvider: React.Provider<"keyboard" | "mouse" | "touch" | null>;
export { useSelectFocusSource, SelectFocusSourceProvider };
@@ -0,0 +1,4 @@
import * as React from 'react';
declare function useSelectFocusSource(): "keyboard" | "mouse" | "touch" | null;
declare const SelectFocusSourceProvider: React.Provider<"keyboard" | "mouse" | "touch" | null>;
export { useSelectFocusSource, SelectFocusSourceProvider };
@@ -0,0 +1,19 @@
"use strict";
'use client';
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SelectFocusSourceProvider = void 0;
exports.useSelectFocusSource = useSelectFocusSource;
var React = _interopRequireWildcard(require("react"));
const SelectFocusSourceContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== 'production') {
SelectFocusSourceContext.displayName = 'SelectFocusSourceContext';
}
function useSelectFocusSource() {
const context = React.useContext(SelectFocusSourceContext);
return context;
}
const SelectFocusSourceProvider = exports.SelectFocusSourceProvider = SelectFocusSourceContext.Provider;
@@ -0,0 +1,13 @@
'use client';
import * as React from 'react';
const SelectFocusSourceContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== 'production') {
SelectFocusSourceContext.displayName = 'SelectFocusSourceContext';
}
function useSelectFocusSource() {
const context = React.useContext(SelectFocusSourceContext);
return context;
}
const SelectFocusSourceProvider = SelectFocusSourceContext.Provider;
export { useSelectFocusSource, SelectFocusSourceProvider };
+1
View File
@@ -0,0 +1 @@
export default function areEqualValues(a: unknown, b: unknown): boolean;
+1
View File
@@ -0,0 +1 @@
export default function areEqualValues(a: unknown, b: unknown): boolean;
+14
View File
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = areEqualValues;
function areEqualValues(a, b) {
if (typeof b === 'object' && b !== null) {
return a === b;
}
// The value could be a number, the DOM will stringify it anyway.
return String(a) === String(b);
}
+8
View File
@@ -0,0 +1,8 @@
export default function areEqualValues(a, b) {
if (typeof b === 'object' && b !== null) {
return a === b;
}
// The value could be a number, the DOM will stringify it anyway.
return String(a) === String(b);
}
+73
View File
@@ -0,0 +1,73 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.canCycleRepeatedCharacter = canCycleRepeatedCharacter;
exports.getMatchingOptionIndex = getMatchingOptionIndex;
exports.getTypeaheadOptions = getTypeaheadOptions;
var React = _interopRequireWildcard(require("react"));
var _areEqualValues = _interopRequireDefault(require("./areEqualValues"));
function hasOwnValueProp(child) {
return Object.prototype.hasOwnProperty.call(child.props, 'value');
}
function getTextFromReactNode(node) {
if (typeof node === 'string' || typeof node === 'number') {
return String(node);
}
let text = '';
React.Children.forEach(node, child => {
if (typeof child === 'string' || typeof child === 'number') {
text += String(child);
} else if (/*#__PURE__*/React.isValidElement(child)) {
text += getTextFromReactNode(child.props.children);
}
});
return text;
}
function getMatchingOptionIndex(options, search, startIndex = 0) {
if (options.length === 0) {
return -1;
}
const normalizedStartIndex = (startIndex % options.length + options.length) % options.length;
for (let offset = 0; offset < options.length; offset += 1) {
const index = (normalizedStartIndex + offset) % options.length;
if (options[index].label.startsWith(search)) {
return index;
}
}
return -1;
}
function canCycleRepeatedCharacter(options, key) {
return !options.some(option => option.label[0] === key && option.label[1] === key);
}
function getTypeaheadOptions(childrenArray, value) {
const options = [];
let selectedIndex = -1;
for (let index = 0; index < childrenArray.length; index += 1) {
const child = childrenArray[index];
if (! /*#__PURE__*/React.isValidElement(child) || !hasOwnValueProp(child) || child.props.disabled) {
continue;
}
// Closed typeahead cannot exclude CSS-hidden text because no option DOM is mounted.
const label = getTextFromReactNode(child.props.children).trim().toLowerCase();
if (label === '') {
continue;
}
if (selectedIndex === -1 && (0, _areEqualValues.default)(value, child.props.value)) {
selectedIndex = options.length;
}
options.push({
child,
label,
value: child.props.value
});
}
return {
options,
selectedIndex
};
}
+63
View File
@@ -0,0 +1,63 @@
import * as React from 'react';
import areEqualValues from "./areEqualValues.mjs";
function hasOwnValueProp(child) {
return Object.prototype.hasOwnProperty.call(child.props, 'value');
}
function getTextFromReactNode(node) {
if (typeof node === 'string' || typeof node === 'number') {
return String(node);
}
let text = '';
React.Children.forEach(node, child => {
if (typeof child === 'string' || typeof child === 'number') {
text += String(child);
} else if (/*#__PURE__*/React.isValidElement(child)) {
text += getTextFromReactNode(child.props.children);
}
});
return text;
}
export function getMatchingOptionIndex(options, search, startIndex = 0) {
if (options.length === 0) {
return -1;
}
const normalizedStartIndex = (startIndex % options.length + options.length) % options.length;
for (let offset = 0; offset < options.length; offset += 1) {
const index = (normalizedStartIndex + offset) % options.length;
if (options[index].label.startsWith(search)) {
return index;
}
}
return -1;
}
export function canCycleRepeatedCharacter(options, key) {
return !options.some(option => option.label[0] === key && option.label[1] === key);
}
export function getTypeaheadOptions(childrenArray, value) {
const options = [];
let selectedIndex = -1;
for (let index = 0; index < childrenArray.length; index += 1) {
const child = childrenArray[index];
if (! /*#__PURE__*/React.isValidElement(child) || !hasOwnValueProp(child) || child.props.disabled) {
continue;
}
// Closed typeahead cannot exclude CSS-hidden text because no option DOM is mounted.
const label = getTextFromReactNode(child.props.children).trim().toLowerCase();
if (label === '') {
continue;
}
if (selectedIndex === -1 && areEqualValues(value, child.props.value)) {
selectedIndex = options.length;
}
options.push({
child,
label,
value: child.props.value
});
}
return {
options,
selectedIndex
};
}
@@ -0,0 +1 @@
export default function getOpenInteractionType(event: MouseEvent | KeyboardEvent | TouchEvent | PointerEvent | null): 'keyboard' | 'pointer' | null;
@@ -0,0 +1 @@
export default function getOpenInteractionType(event: MouseEvent | KeyboardEvent | TouchEvent | PointerEvent | null): 'keyboard' | 'pointer' | null;
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getOpenInteractionType;
function getOpenInteractionType(event) {
if (!event) {
return null;
}
if (event.type === 'mousedown' || event.type === 'pointerdown' || event.type === 'touchstart') {
return 'pointer';
}
if (event.type === 'keydown' || event.type === 'click' && event.detail === 0) {
return 'keyboard';
}
return null;
}
@@ -0,0 +1,12 @@
export default function getOpenInteractionType(event) {
if (!event) {
return null;
}
if (event.type === 'mousedown' || event.type === 'pointerdown' || event.type === 'touchstart') {
return 'pointer';
}
if (event.type === 'keydown' || event.type === 'click' && event.detail === 0) {
return 'keyboard';
}
return null;
}
+4
View File
@@ -0,0 +1,4 @@
export { default as getOpenInteractionType } from "./getOpenInteractionType.mjs";
export { default as isEmpty } from "./isEmpty.mjs";
export { default as areEqualValues } from "./areEqualValues.mjs";
export { useSelectFocusSource, SelectFocusSourceProvider } from "./SelectFocusSourceContext.mjs";
+4
View File
@@ -0,0 +1,4 @@
export { default as getOpenInteractionType } from "./getOpenInteractionType.js";
export { default as isEmpty } from "./isEmpty.js";
export { default as areEqualValues } from "./areEqualValues.js";
export { useSelectFocusSource, SelectFocusSourceProvider } from "./SelectFocusSourceContext.js";
+40
View File
@@ -0,0 +1,40 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "SelectFocusSourceProvider", {
enumerable: true,
get: function () {
return _SelectFocusSourceContext.SelectFocusSourceProvider;
}
});
Object.defineProperty(exports, "areEqualValues", {
enumerable: true,
get: function () {
return _areEqualValues.default;
}
});
Object.defineProperty(exports, "getOpenInteractionType", {
enumerable: true,
get: function () {
return _getOpenInteractionType.default;
}
});
Object.defineProperty(exports, "isEmpty", {
enumerable: true,
get: function () {
return _isEmpty.default;
}
});
Object.defineProperty(exports, "useSelectFocusSource", {
enumerable: true,
get: function () {
return _SelectFocusSourceContext.useSelectFocusSource;
}
});
var _getOpenInteractionType = _interopRequireDefault(require("./getOpenInteractionType"));
var _isEmpty = _interopRequireDefault(require("./isEmpty"));
var _areEqualValues = _interopRequireDefault(require("./areEqualValues"));
var _SelectFocusSourceContext = require("./SelectFocusSourceContext");
+4
View File
@@ -0,0 +1,4 @@
export { default as getOpenInteractionType } from "./getOpenInteractionType.mjs";
export { default as isEmpty } from "./isEmpty.mjs";
export { default as areEqualValues } from "./areEqualValues.mjs";
export { useSelectFocusSource, SelectFocusSourceProvider } from "./SelectFocusSourceContext.mjs";
+1
View File
@@ -0,0 +1 @@
export default function isEmpty(display: unknown): boolean;
+1
View File
@@ -0,0 +1 @@
export default function isEmpty(display: unknown): boolean;
+9
View File
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isEmpty;
function isEmpty(display) {
return display == null || typeof display === 'string' && !display.trim();
}
+3
View File
@@ -0,0 +1,3 @@
export default function isEmpty(display) {
return display == null || typeof display === 'string' && !display.trim();
}