decord/beta/source/modules/interaction_components/StringSelectActionComponentUtils.tsx
github-actions 30c0bb2ec3 chore: update source for beta 347.10
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4975.js (118.4 MB)
2026-09-24 16:03:38 +00:00

29 lines
1.1 KiB
TypeScript

// Module ID: 8425
// Function ID: 8426
// Name: StringSelectActionComponentUtils
// Dependencies: [8419, 1982, 2]
// Exports: getInitialStringSelectOptions
// Module 8425 (StringSelectActionComponentUtils)
import Server from "Server" /* 1982 */;
import LocalInteractionComponentStateStore from "LocalInteractionComponentStateStore" /* 8419 */;
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 {
options = selectionActionComponent.options;
const found = options.filter((item) => item.default);
mapped = found.map((value) => value.value);
}
return mapped;
};