@studion/infra-code-blocks
Version:
Studion common infra components
36 lines (35 loc) • 925 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createCustomJSONVariable = createCustomJSONVariable;
exports.createCustomCSVVariable = createCustomCSVVariable;
exports.createTextBoxVariable = createTextBoxVariable;
function createCustomJSONVariable(name, label, values, current, options) {
return {
type: 'custom',
name,
label,
query: JSON.stringify(values),
current: current,
valuesFormat: 'json',
...options,
};
}
function createCustomCSVVariable(name, label, values, current, options) {
return {
type: 'custom',
name,
label,
query: values.join(','),
current: current,
valuesFormat: 'csv',
...options,
};
}
function createTextBoxVariable(name, label, options) {
return {
type: 'textbox',
name,
label,
...options,
};
}