mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Forms feature
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
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import {useBindable} from 'app/common/gutil';
|
||||
import {BindableValue, dom} from 'grainjs';
|
||||
|
||||
/**
|
||||
* Version of makeTestId that can be appended conditionally.
|
||||
* TODO: update grainjs typings, as this is already supported there.
|
||||
*/
|
||||
export function makeTestId(prefix: string) {
|
||||
return (id: string, obs?: BindableValue<boolean>) => dom.cls(prefix + id, obs ?? true);
|
||||
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)}`;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user