mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
e146f95c1c
Summary: Adds a new UI for writing access rule memos. Migrates old memos (written as Python comments) to the new UI. Test Plan: Browser and migration tests. Reviewers: jarek, dsagal Reviewed By: jarek Subscribers: dsagal, paulfitz Differential Revision: https://phab.getgrist.com/D3726
36 lines
997 B
TypeScript
36 lines
997 B
TypeScript
import {theme} from 'app/client/ui2018/cssVars';
|
|
import {dom, DomElementArg, Observable, styled} from 'grainjs';
|
|
|
|
export function aclMemoEditor(obs: Observable<string>, ...args: DomElementArg[]): HTMLInputElement {
|
|
return cssMemoInput(
|
|
dom.prop('value', obs),
|
|
dom.on('input', (_e, elem) => obs.set(elem.value)),
|
|
...args,
|
|
);
|
|
}
|
|
|
|
const cssMemoInput = styled('input', `
|
|
width: 100%;
|
|
min-height: 28px;
|
|
padding: 4px 5px;
|
|
border-radius: 3px;
|
|
border: 1px solid transparent;
|
|
cursor: pointer;
|
|
color: ${theme.accentText};
|
|
background-color: ${theme.inputBg};
|
|
caret-color : ${theme.inputFg};
|
|
font: 12px 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
|
|
&:hover {
|
|
border: 1px solid ${theme.inputBorder};
|
|
}
|
|
&:not(&-disabled):focus-within {
|
|
outline: none !important;
|
|
cursor: text;
|
|
box-shadow: inset 0 0 0 1px ${theme.accentBorder};
|
|
border-color: ${theme.accentBorder};
|
|
}
|
|
`);
|