mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
a424450cbe
Summary: A new widget type Forms. For now hidden behind GRIST_EXPERIMENTAL_PLUGINS(). This diff contains all the core moving parts as a serves as a base to extend this functionality further. Test Plan: New test added Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D4130
17 lines
471 B
TypeScript
17 lines
471 B
TypeScript
import {useBindable} from 'app/common/gutil';
|
|
import {BindableValue, dom} from 'grainjs';
|
|
|
|
/**
|
|
* Version of makeTestId that can be appended conditionally.
|
|
*/
|
|
export function makeTestId(prefix: string) {
|
|
return (id: BindableValue<string>, obs?: BindableValue<boolean>) => {
|
|
return dom.cls(use => {
|
|
if (obs !== undefined && !useBindable(use, obs)) {
|
|
return '';
|
|
}
|
|
return `${useBindable(use, prefix)}${useBindable(use, id)}`;
|
|
});
|
|
};
|
|
}
|