decord/alpha/source/modules/interaction_components/StringSelectActionComponentUtils.tsx

30 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-10-08 09:57:35 +00:00
// Module ID: 8232
// Function ID: 8233
// Name: StringSelectActionComponentUtils
2026-10-08 09:57:35 +00:00
// Dependencies: [8226, 1997, 2]
2026-07-20 16:05:17 +00:00
// Exports: getInitialStringSelectOptions
2026-10-08 09:57:35 +00:00
// Module 8232 (StringSelectActionComponentUtils)
import Server from "Server" /* 1997 */;
import LocalInteractionComponentStateStore from "LocalInteractionComponentStateStore" /* 8226 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const result = size.fileFinishedImporting("modules/interaction_components/StringSelectActionComponentUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getInitialStringSelectOptions = function getInitialStringSelectOptions(selectionActionComponent, containerId) {
2026-10-03 08:58:59 +00:00
let mapped;
const interactionComponentState = LocalInteractionComponentStateStore.getInteractionComponentState(containerId, selectionActionComponent.id);
2026-07-20 16:05:17 +00:00
let type;
2026-07-29 08:29:29 +00:00
if (interactionComponentState != null) {
2026-07-20 16:05:17 +00:00
type = interactionComponentState.type;
}
if (type === Server.ComponentType.STRING_SELECT) {
2026-10-03 08:58:59 +00:00
mapped = interactionComponentState.values;
2026-07-20 16:05:17 +00:00
} else {
const options = selectionActionComponent.options;
const found = options.filter((item) => item.default);
2026-07-20 16:05:17 +00:00
mapped = found.map((value) => value.value);
}
return mapped;
};