mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add basic activation page to grist-ee
Summary: Adds an activation page to grist-ee that currently shows activation status. Follow-up diffs will introduce additional functionality, such as the ability to enter activation keys directly from the activation page. Test Plan: No grist-ee tests (yet). Reviewers: paulfitz Reviewed By: paulfitz Subscribers: dsagal, paulfitz Differential Revision: https://phab.getgrist.com/D3582
This commit is contained in:
42
app/client/ui/inputs.ts
Normal file
42
app/client/ui/inputs.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import {colors, vars} from 'app/client/ui2018/cssVars';
|
||||
import {dom, DomElementArg, Observable, styled} from 'grainjs';
|
||||
|
||||
export const cssInput = styled('input', `
|
||||
font-size: ${vars.mediumFontSize};
|
||||
height: 48px;
|
||||
line-height: 20px;
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
border: 1px solid #D9D9D9;
|
||||
border-radius: 4px;
|
||||
outline: none;
|
||||
display: block;
|
||||
|
||||
&[type=number] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
&[type=number]::-webkit-inner-spin-button,
|
||||
&[type=number]::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
&-invalid {
|
||||
border: 1px solid ${colors.error};
|
||||
}
|
||||
|
||||
&-valid {
|
||||
border: 1px solid ${colors.lightGreen};
|
||||
}
|
||||
`);
|
||||
|
||||
/**
|
||||
* Builds a text input that updates `obs` as you type.
|
||||
*/
|
||||
export function textInput(obs: Observable<string>, ...args: DomElementArg[]): HTMLInputElement {
|
||||
return cssInput(
|
||||
dom.prop('value', obs),
|
||||
dom.on('input', (_e, elem) => obs.set(elem.value)),
|
||||
...args,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user