decord/alpha/source/modules/interaction_components/StringSelectActionComponentUtils.tsx
github-actions c6aa9eb120 chore: update source for alpha 349.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5030.js (118.4 MB)
2026-10-01 06:55:13 +00:00

29 lines
1.1 KiB
TypeScript

// Module ID: 7758
// Function ID: 7759
// Name: StringSelectActionComponentUtils
// Dependencies: [7752, 1979, 2]
// Exports: getInitialStringSelectOptions
// Module 7758 (StringSelectActionComponentUtils)
import Server from "Server" /* 1979 */;
import LocalInteractionComponentStateStore from "LocalInteractionComponentStateStore" /* 7752 */;
require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/interaction_components/StringSelectActionComponentUtils.tsx");
export const getInitialStringSelectOptions = function getInitialStringSelectOptions(selectionActionComponent, containerId) {
const interactionComponentState = LocalInteractionComponentStateStore.getInteractionComponentState(containerId, selectionActionComponent.id);
let type;
if (interactionComponentState != null) {
type = interactionComponentState.type;
}
if (type === Server.ComponentType.STRING_SELECT) {
let mapped = interactionComponentState.values;
} else {
const options = selectionActionComponent.options;
const found = options.filter((item) => item.default);
mapped = found.map((value) => value.value);
}
return mapped;
};