コンパイルの失敗を修正

This commit is contained in:
Mouriya
2024-09-13 15:17:16 +09:00
parent 9dd2ffd549
commit 20ca47c004

View File

@@ -121,8 +121,8 @@ namespace DropDownConfig {
value: fieldData.value, value: fieldData.value,
index: fieldCodeToIndexMap.get(fieldCode), index: fieldCodeToIndexMap.get(fieldCode),
})) }))
.filter((item) => item.index !== undefined) .filter((item) => item.index !== undefined || item.index !== null)
.sort((a, b) => a.index - b.index) .sort((a, b) => a.index! - b.index!)
) )
.forEach((recordArray) => { .forEach((recordArray) => {
recordArray.forEach((item, i, array) => { recordArray.forEach((item, i, array) => {
@@ -133,7 +133,7 @@ namespace DropDownConfig {
if (index === 0) { if (index === 0) {
tempDictionary["0_TOP"].add(v); tempDictionary["0_TOP"].add(v);
} else { } else {
const previousItem = array[index - 1]; const previousItem = array[index! - 1];
const previousKey = `${previousItem.index}_${previousItem.value}`; const previousKey = `${previousItem.index}_${previousItem.value}`;
tempDictionary[previousKey] = tempDictionary[previousKey] =
tempDictionary[previousKey] || new Set(); tempDictionary[previousKey] || new Set();
@@ -250,7 +250,7 @@ export class CascadingDropDownAction implements IAction {
DropdownContainer.addSaveBtnEvent( DropdownContainer.addSaveBtnEvent(
pageType === "app" pageType === "app"
? tableElement ? tableElement
: document.getElementById("appForm-gaia") : document.getElementById("appForm-gaia")!
); );
DropdownContainer.render(tableElement); DropdownContainer.render(tableElement);
} }
@@ -371,9 +371,7 @@ namespace DropdownContainer {
): void => { ): void => {
let select; let select;
if (!initSelect) { if (!initSelect) {
select = selects select = selects.get(fieldCode)?.querySelector<HTMLSelectElement>("select");
.get(fieldCode)
.querySelector<HTMLSelectElement>("select");
if (!select) { if (!select) {
console.error( console.error(
`フィールド ${fieldCode} のドロップダウンメニュー要素が見つかりません` `フィールド ${fieldCode} のドロップダウンメニュー要素が見つかりません`
@@ -383,7 +381,7 @@ namespace DropdownContainer {
} }
} else { } else {
select = initSelect; select = initSelect;
state[fieldCode] = value; state[fieldCode] = value!;
} }
const field = fieldList.find((f) => f.dropDown.code === fieldCode); const field = fieldList.find((f) => f.dropDown.code === fieldCode);
@@ -421,7 +419,7 @@ namespace DropdownContainer {
const fieldCode = field.dropDown.code; const fieldCode = field.dropDown.code;
updateOptions(fieldCode); updateOptions(fieldCode);
( (
selects.get(fieldCode).previousElementSibling as HTMLInputElement selects.get(fieldCode)?.previousElementSibling as HTMLInputElement
).value = ""; ).value = "";
delete state[fieldCode]; delete state[fieldCode];
}); });