mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-20 17:14:11 +00:00
86062a8c28
Summary: - New styling for forms. - New field options for various field types (spinner, checkbox, radio buttons, alignment, sort). - Improved alignment of form fields in columns. - Support for additional select input keyboard shortcuts (Enter and Backspace). - Prevent submitting form on Enter if an input has focus. - Fix for changing form field type causing the field to disappear. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D4223
24 lines
715 B
TypeScript
24 lines
715 B
TypeScript
import * as css from "app/client/components/FormRendererCss";
|
|
import { BoxModel } from "app/client/components/Forms/Model";
|
|
import { makeTestId } from "app/client/lib/domUtils";
|
|
import { bigPrimaryButton } from "app/client/ui2018/buttons";
|
|
import { dom } from "grainjs";
|
|
const testId = makeTestId("test-forms-");
|
|
|
|
export class SubmitModel extends BoxModel {
|
|
public override render() {
|
|
const text = this.view.viewSection.layoutSpecObj.prop('submitText');
|
|
return dom(
|
|
"div",
|
|
css.error(testId("error")),
|
|
css.submitButtons(
|
|
bigPrimaryButton(
|
|
dom.text(use => use(text) || 'Submit'),
|
|
{ disabled: true },
|
|
testId("submit"),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|