From ccb96e15e2cef61836dcc74a0a5504ee0e872e9d Mon Sep 17 00:00:00 2001 From: Kilian Hofmann Date: Sun, 7 Dec 2025 02:09:41 +0100 Subject: [PATCH] Newest EFB --- EFB/efb-js.patch | 93 +------------------ PackageSources/js-bundle/package.json | 2 +- .../js-bundle/src/components/input/Input.tsx | 2 + .../src/components/keyboard/Keyboard.tsx | 7 +- .../src/components/options/OptionsPax.tsx | 9 +- .../components/stationEntry/StationEntryF.tsx | 2 + .../stationEntry/StationEntryPax.tsx | 2 + 7 files changed, 18 insertions(+), 99 deletions(-) diff --git a/EFB/efb-js.patch b/EFB/efb-js.patch index ed88be2..3af072b 100644 --- a/EFB/efb-js.patch +++ b/EFB/efb-js.patch @@ -2,96 +2,7 @@ Index: EFB.js =================================================================== --- EFB.js +++ EFB.js -@@ -29548,18 +29548,17 @@ - "{shift} Z X C V B N M /", - "{space} {close}" - ] - }; -- var Keyboard = (0, import_react4.forwardRef)(({ value, inputRef, onInput, onClose }, ref) => { -+ var Keyboard = (0, import_react4.forwardRef)(({ value, blurRef, onInput, onClose }, ref) => { - const [shift, setShift] = (0, import_react4.useState)(false); - const layout = shift ? defaultLayout.shift : defaultLayout.default; - const handleKeyPress = (key) => { -- var _a; - if (key === "{close}") { - onClose(); - return; - } -- (_a = inputRef.current) == null ? void 0 : _a.focus(); -+ blurRef.current = true; - if (key === "{shift}") { - setShift(!shift); - return; - } -@@ -29603,12 +29602,8 @@ - "button", - { - className: `flex justify-center rounded-md p-4 ${key === "{close}" ? "bg-zinc-700 px-12 focus:bg-zinc-600" : "flex-1 bg-zinc-600"}`, - onMouseDown: () => handleKeyPress(key), -- onMouseUp: () => { -- var _a; -- return (_a = inputRef.current) == null ? void 0 : _a.focus(); -- }, - children: keyIdent - }, - `key-${rowIndex}-${keyIndex}` - ); -@@ -29628,9 +29623,9 @@ - function Input(props) { - const [guid] = (0, import_react5.useState)(v4_default()); - const ref = (0, import_react5.useRef)(null); - const keyboardRef = (0, import_react5.useRef)(null); -- const blurTimeoutRef = (0, import_react5.useRef)(); -+ const blurRef = (0, import_react5.useRef)(false); - const [isFocused, setFocused] = (0, import_react5.useState)(false); - const [showKeyboard, setShowKeyboard] = (0, import_react5.useState)(false); - (0, import_react5.useEffect)(() => { - if (simulator() === 0 /* MSFS */) { -@@ -29660,25 +29655,23 @@ - placeholder: props.placeholder, - disabled: props.disabled, - onFocus: () => { - var _a; -- clearTimeout(blurTimeoutRef.current); - if (!isFocused) { - setFocused(true); - setShowKeyboard(true); - (_a = ref.current) == null ? void 0 : _a.select(); - } - }, -- onBlur: (e) => { -+ onBlur: () => { - var _a; -- if ((_a = keyboardRef.current) == null ? void 0 : _a.contains(e.relatedTarget)) { -- return; -- } -- blurTimeoutRef.current = setTimeout(() => { -- if (props.onBlur) props.onBlur(e.target.value); -- if (isFocused) setFocused(false); -+ if (blurRef.current && isFocused) (_a = ref.current) == null ? void 0 : _a.focus(); -+ else { - setShowKeyboard(false); -- }, 100); -+ setFocused(false); -+ (_a = ref.current) == null ? void 0 : _a.blur(); -+ } -+ blurRef.current = false; - }, - onChange: (e) => { - if (props.onChange) props.onChange(e.target.value); - }, -@@ -29690,9 +29683,9 @@ - Keyboard_default, - { - ref: keyboardRef, - value: String(props.value), -- inputRef: ref, -+ blurRef: blurRef, - onInput: (value) => props.onChange && props.onChange(value), - onClose: () => { - var _a; - setShowKeyboard(false); -@@ -30209,9 +30202,9 @@ +@@ -30203,9 +30203,9 @@ { className: "middle none center rounded-lg bg-green-700 px-6 py-3 font-sans text-xs font-bold uppercase text-white shadow-md shadow-green-500/20 transition-all hover:shadow-lg hover:shadow-green-500/40 focus:opacity-[0.85] focus:shadow-none active:opacity-[0.85] active:shadow-none disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none", "data-ripple-light": "true", @@ -102,7 +13,7 @@ Index: EFB.js ) }) }) ] }) }) }); } -@@ -40562,8 +40555,27 @@ +@@ -40556,8 +40556,27 @@ ] }) ] }) }) }); } diff --git a/PackageSources/js-bundle/package.json b/PackageSources/js-bundle/package.json index af9101e..ad56de4 100644 --- a/PackageSources/js-bundle/package.json +++ b/PackageSources/js-bundle/package.json @@ -1,6 +1,6 @@ { "name": "tfdidesign-md11-load-manager", - "version": "0.1.182", + "version": "0.1.186", "description": "", "main": "index.js", "type": "module", diff --git a/PackageSources/js-bundle/src/components/input/Input.tsx b/PackageSources/js-bundle/src/components/input/Input.tsx index ec8f0f0..d849761 100644 --- a/PackageSources/js-bundle/src/components/input/Input.tsx +++ b/PackageSources/js-bundle/src/components/input/Input.tsx @@ -4,6 +4,7 @@ import Keyboard from '../keyboard/Keyboard'; export default function Input(props: { type?: string; + topKeyboard?: boolean; value: any; min?: number; max?: number; @@ -66,6 +67,7 @@ export default function Input(props: { {showKeyboard && ( props.onChange && props.onChange(value)} diff --git a/PackageSources/js-bundle/src/components/keyboard/Keyboard.tsx b/PackageSources/js-bundle/src/components/keyboard/Keyboard.tsx index 9d92e91..266b21b 100644 --- a/PackageSources/js-bundle/src/components/keyboard/Keyboard.tsx +++ b/PackageSources/js-bundle/src/components/keyboard/Keyboard.tsx @@ -23,11 +23,12 @@ const Keyboard = forwardRef< HTMLDivElement, { value: string; - blurRef: RefObject + blurRef: RefObject; + top?: boolean; onInput: (value: string) => void; onClose: () => void; } ->(({ value, blurRef, onInput, onClose }, ref) => { +>(({ value, top, blurRef, onInput, onClose }, ref) => { const [shift, setShift] = useState(false); const layout = shift ? defaultLayout.shift : defaultLayout.default; @@ -63,7 +64,7 @@ const Keyboard = forwardRef< return createPortal(
{layout.map((row, rowIndex) => (
diff --git a/PackageSources/js-bundle/src/components/options/OptionsPax.tsx b/PackageSources/js-bundle/src/components/options/OptionsPax.tsx index 45970f4..3518e2e 100644 --- a/PackageSources/js-bundle/src/components/options/OptionsPax.tsx +++ b/PackageSources/js-bundle/src/components/options/OptionsPax.tsx @@ -3,6 +3,7 @@ import { LoadingState } from '../../types/general'; import { WASMDataPax } from '../../types/WASMData'; import { CoherentCallGSXReset, CoherentCallOptionsSet } from '../../utils/utils'; import ToggleComponentKH from '../toggleComponent/ToggleComponent'; +import Input from '../input/Input'; interface OptionsPaxProps { WASMData: WASMDataPax; @@ -56,12 +57,12 @@ const OptionsPax: FC = ({ WASMData, loadingState, gsxActive })
- handleInput(e.target.value, Number.MAX_VALUE, setPaxWeight)} + onChange={(value) => handleInput(value, Number.MAX_VALUE, setPaxWeight)} disabled={loadingState !== 'preview' || gsxActive} />
@@ -69,12 +70,12 @@ const OptionsPax: FC = ({ WASMData, loadingState, gsxActive })
- handleInput(e.target.value, Number.MAX_VALUE, setBagWeight)} + onChange={(value) => handleInput(value, Number.MAX_VALUE, setBagWeight)} disabled={loadingState !== 'preview' || gsxActive} />
diff --git a/PackageSources/js-bundle/src/components/stationEntry/StationEntryF.tsx b/PackageSources/js-bundle/src/components/stationEntry/StationEntryF.tsx index 8892673..7eafa3c 100644 --- a/PackageSources/js-bundle/src/components/stationEntry/StationEntryF.tsx +++ b/PackageSources/js-bundle/src/components/stationEntry/StationEntryF.tsx @@ -160,6 +160,7 @@ const StationEntryF: FC = ({ WASMData, loadingState, gsxActiv = ({ WASMData, loadingState, gsxActiv = ({ WASMData, loadingState, gsxAct = ({ WASMData, loadingState, gsxAct