+
+
+
+
+
+ {/* Options row */}
+
+ {"Simplify"}:
+
+
+
+
+
}
- return setFetchResult(res);
- })
- .catch(err => setError({ title: "Fetch error", message: err.toString() }))
- .finally(() => setIsLoaded(true));
- }
- }
-
- onMount((): void => {
-
- if (searchParams.exp) {
- const exp = searchParams.exp;
- if (exp && inputElement) {
- inputElement.value = exp;
- }
- const hide = searchParams.hide;
- if (hide) {
- setHideValues(hideOptions.find(o => o.value === hide) ?? hideOptions[0]);
- }
- const sort = searchParams.sort;
- if (sort) {
- setSortValues(sortOptions.find(o => o.value === sort) ?? sortOptions[0]);
- }
-
- getFetchResult(exp);
- }
-
- // Focuses searchbar on load
- if (!isTouch()) {
- inputElement?.focus();
- }
- });
-
- const tableId = "truth-table";
- const filenameId = "excel-filename";
-
- function _exportToExcel(): void {
- const value = getElementById
(filenameId)?.value;
- exportToExcel({
- name: value !== "" ? value : undefined, tableId
- });
- }
-
- return (
-
-
-
- (DEV) Use localhost:
-
-
-
-
-
-
-
-
-
-
- { /* Options row */ }
-
- { "Simplify" }:
-
-
-
-
-
- } fallback={
-
- } keyed />
- }
- children={
-
- { (option) => (
- setHideValues(option) }
- option={ option }
- currentValue={ hideValues } />
- ) }
-
- } itemsClassName={ "right-0" }
- />
-
-
-
- }
- children={
-
- { (option) => (
- setSortValues(option) } />
- ) }
-
- }
- itemsClassName={ "right-0" }
- />
-
-
-
-
-
-
-
- { "Download" }
-
- > }
- callback={ _exportToExcel }
- acceptButtonName={ "Download" }
- cancelButtonName={ "Cancel" }
- buttonClass={ `float-right` }
- buttonTitle={ "Export current table" }
- acceptButtonId={ "download-accept" }>
- { "Filename" }:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
0 } keyed>
-
-
-
-
-
-
-
-
- { fetchResult()?.after }
-
-
-
-
-
-
+ fallback={
}
+ keyed
+ />
+ }
+ children={
+
+ {(option) => (
+ setHideValues(option)}
+ option={option}
+ currentValue={hideValues}
+ />
+ )}
+
+ }
+ itemsClassName={"right-0"}
+ />
-
- );
+
+
+ }
+ children={
+
+ {(option) => (
+ setSortValues(option)}
+ />
+ )}
+
+ }
+ itemsClassName={"right-0"}
+ />
+
+
+
+
+
+
+ {"Download"}
+
+ >
+ }
+ callback={_exportToExcel}
+ acceptButtonName={"Download"}
+ cancelButtonName={"Cancel"}
+ buttonClass={`float-right`}
+ buttonTitle={"Export current table"}
+ acceptButtonId={"download-accept"}
+ >
+ {"Filename"}:
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0} keyed>
+
+
+
+
+
+
+
+ {fetchResult()?.after}
+
+
+
+
+
+
+
+ )
}
-export default TruthTablePage;
+export default TruthTablePage
interface SingleMenuItem {
- option: Option,
- currentValue?: Accessor