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

30 lines
1.1 KiB
TypeScript
Raw Normal View History

// Module ID: 8387
// Function ID: 8388
// Name: StringSelectActionComponentUtils
// Dependencies: [8381, 1978, 2]
2026-07-20 16:05:17 +00:00
// Exports: getInitialStringSelectOptions
// Module 8387 (StringSelectActionComponentUtils)
import Server from "Server" /* 1978 */;
import LocalInteractionComponentStateStore from "LocalInteractionComponentStateStore" /* 8381 */;
2026-07-23 10:11:24 +00:00
require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/interaction_components/StringSelectActionComponentUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getInitialStringSelectOptions = function getInitialStringSelectOptions(selectionActionComponent, containerId) {
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-07-20 16:05:17 +00:00
let mapped = interactionComponentState.values;
} 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;
};