2020-10-02 15:10:00 +00:00
|
|
|
/**
|
|
|
|
* Link or button that opens a menu to make a copy of a document, full or empty. It's used for
|
|
|
|
* the sample documents (those in the Support user's Examples & Templates workspace).
|
|
|
|
*/
|
|
|
|
|
2023-09-09 18:50:32 +00:00
|
|
|
import {hooks} from 'app/client/Hooks';
|
2022-10-28 16:11:08 +00:00
|
|
|
import {makeT} from 'app/client/lib/localization';
|
2020-10-02 15:10:00 +00:00
|
|
|
import {AppModel, reportError} from 'app/client/models/AppModel';
|
2023-09-06 18:35:46 +00:00
|
|
|
import {DocPageModel} from 'app/client/models/DocPageModel';
|
|
|
|
import {urlState} from 'app/client/models/gristUrlState';
|
2020-10-02 15:10:00 +00:00
|
|
|
import {getWorkspaceInfo, ownerName, workspaceName} from 'app/client/models/WorkspaceInfo';
|
(core) Speed up and upgrade build.
Summary:
- Upgrades to build-related packages:
- Upgrade typescript, related libraries and typings.
- Upgrade webpack, eslint; add tsc-watch, node-dev, eslint_d.
- Build organization changes:
- Build webpack from original typescript, transpiling only; with errors still
reported by a background tsc watching process.
- Typescript-related changes:
- Reduce imports of AWS dependencies (very noticeable speedup)
- Avoid auto-loading global @types
- Client code is now built with isolatedModules flag (for safe transpilation)
- Use allowJs to avoid copying JS files manually.
- Linting changes
- Enhance Arcanist ESLintLinter to run before/after commands, and set up to use eslint_d
- Update eslint config, and include .eslintignore to avoid linting generated files.
- Include a bunch of eslint-prompted and eslint-generated fixes
- Add no-unused-expression rule to eslint, and fix a few warnings about it
- Other items:
- Refactor cssInput to avoid circular dependency
- Remove a bit of unused code, libraries, dependencies
Test Plan: No behavior changes, all existing tests pass. There are 30 tests fewer reported because `test_gpath.py` was removed (it's been unused for years)
Reviewers: paulfitz
Reviewed By: paulfitz
Subscribers: paulfitz
Differential Revision: https://phab.getgrist.com/D3498
2022-06-27 20:09:41 +00:00
|
|
|
import {cssInput} from 'app/client/ui/cssInput';
|
2020-10-02 15:10:00 +00:00
|
|
|
import {bigBasicButton, bigPrimaryButtonLink} from 'app/client/ui2018/buttons';
|
2023-08-18 10:54:03 +00:00
|
|
|
import {cssRadioCheckboxOptions, labeledSquareCheckbox, radioCheckboxOption} from 'app/client/ui2018/checkbox';
|
2022-09-06 01:51:57 +00:00
|
|
|
import {testId, theme, vars} from 'app/client/ui2018/cssVars';
|
2020-10-02 15:10:00 +00:00
|
|
|
import {loadingSpinner} from 'app/client/ui2018/loaders';
|
|
|
|
import {select} from 'app/client/ui2018/menus';
|
2023-09-06 18:35:46 +00:00
|
|
|
import {confirmModal, cssModalBody, cssModalButtons, cssModalTitle, modal, saveModal} from 'app/client/ui2018/modals';
|
2020-10-02 15:10:00 +00:00
|
|
|
import * as roles from 'app/common/roles';
|
2022-06-03 14:58:07 +00:00
|
|
|
import {Document, isTemplatesOrg, Organization, Workspace} from 'app/common/UserAPI';
|
2020-10-02 15:10:00 +00:00
|
|
|
import {Computed, Disposable, dom, input, Observable, styled, subscribe} from 'grainjs';
|
|
|
|
import sortBy = require('lodash/sortBy');
|
|
|
|
|
2022-10-28 16:11:08 +00:00
|
|
|
const t = makeT('MakeCopyMenu');
|
2020-10-02 15:10:00 +00:00
|
|
|
|
2023-09-06 18:35:46 +00:00
|
|
|
export async function replaceTrunkWithFork(doc: Document, pageModel: DocPageModel, origUrlId: string) {
|
|
|
|
const {appModel} = pageModel;
|
|
|
|
const trunkAccess = (await appModel.api.getDoc(origUrlId)).access;
|
2020-10-02 15:10:00 +00:00
|
|
|
if (!roles.canEdit(trunkAccess)) {
|
|
|
|
modal((ctl) => [
|
2022-12-06 13:57:29 +00:00
|
|
|
cssModalBody(t("Replacing the original requires editing rights on the original document.")),
|
2020-10-02 15:10:00 +00:00
|
|
|
cssModalButtons(
|
2022-12-06 13:57:29 +00:00
|
|
|
bigBasicButton(t("Cancel"), dom.on('click', () => ctl.close())),
|
2020-10-02 15:10:00 +00:00
|
|
|
)
|
|
|
|
]);
|
|
|
|
return;
|
|
|
|
}
|
2023-09-06 18:35:46 +00:00
|
|
|
const docApi = appModel.api.getDocAPI(origUrlId);
|
2020-10-02 15:10:00 +00:00
|
|
|
const cmp = await docApi.compareDoc(doc.id);
|
2022-12-06 13:57:29 +00:00
|
|
|
let titleText = t("Update Original");
|
|
|
|
let buttonText = t("Update");
|
|
|
|
let warningText = t("The original version of this document will be updated.");
|
2020-10-02 15:10:00 +00:00
|
|
|
if (cmp.summary === 'left' || cmp.summary === 'both') {
|
2022-12-06 13:57:29 +00:00
|
|
|
titleText = t("Original Has Modifications");
|
|
|
|
buttonText = t("Overwrite");
|
2023-07-16 16:52:13 +00:00
|
|
|
warningText = `${warningText} ${t("Be careful, the original has changes \
|
|
|
|
not in this document. Those changes will be overwritten.")}`;
|
2020-10-02 15:10:00 +00:00
|
|
|
} else if (cmp.summary === 'unrelated') {
|
2022-12-06 13:57:29 +00:00
|
|
|
titleText = t("Original Looks Unrelated");
|
|
|
|
buttonText = t("Overwrite");
|
|
|
|
warningText = `${warningText} ${t("It will be overwritten, losing any content not in this document.")}`;
|
2020-10-02 15:10:00 +00:00
|
|
|
} else if (cmp.summary === 'same') {
|
2022-12-19 18:53:26 +00:00
|
|
|
titleText = t('Original Looks Identical');
|
2022-12-06 13:57:29 +00:00
|
|
|
warningText = `${warningText} ${t("However, it appears to be already identical.")}`;
|
2020-10-02 15:10:00 +00:00
|
|
|
}
|
|
|
|
confirmModal(titleText, buttonText,
|
|
|
|
async () => {
|
|
|
|
try {
|
|
|
|
await docApi.replace({sourceDocId: doc.id});
|
2023-09-06 18:35:46 +00:00
|
|
|
pageModel.clearUnsavedChanges();
|
2020-10-02 15:10:00 +00:00
|
|
|
await urlState().pushUrl({doc: origUrlId});
|
|
|
|
} catch (e) {
|
|
|
|
reportError(e); // For example: no write access on trunk.
|
|
|
|
}
|
2023-04-20 13:07:45 +00:00
|
|
|
}, {explanation: warningText});
|
2020-10-02 15:10:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether we should offer user the option to copy this doc to other orgs.
|
|
|
|
* We allow copying out of source org when the source org is a personal org, or user has owner
|
|
|
|
* access to the doc, or the doc is public.
|
|
|
|
*/
|
|
|
|
function allowOtherOrgs(doc: Document, app: AppModel): boolean {
|
|
|
|
const org = app.currentOrg;
|
|
|
|
const isPersonalOrg = Boolean(org && org.owner);
|
|
|
|
// We allow copying out of a personal org.
|
|
|
|
if (isPersonalOrg) { return true; }
|
|
|
|
// Otherwise, it's a proper org. Allow copying out if the doc is public or if the user has
|
|
|
|
// owner access to it. In case of a fork, it's the owner access to trunk that matters.
|
|
|
|
if (doc.public || roles.canEditAccess(doc.trunkAccess || doc.access)) { return true; }
|
|
|
|
// For non-public docs on a team site, non-privileged users are not allowed to copy them out.
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2022-02-19 09:46:49 +00:00
|
|
|
* Ask user for the destination and new name, and make a copy of the doc using those.
|
2020-10-02 15:10:00 +00:00
|
|
|
*/
|
2023-09-06 18:35:46 +00:00
|
|
|
export async function makeCopy(options: {
|
|
|
|
pageModel: DocPageModel,
|
|
|
|
doc: Document,
|
|
|
|
modalTitle: string,
|
|
|
|
}): Promise<void> {
|
|
|
|
const {pageModel, doc, modalTitle} = options;
|
|
|
|
const {appModel} = pageModel;
|
|
|
|
let orgs = allowOtherOrgs(doc, appModel) ? await appModel.api.getOrgs(true) : null;
|
2021-07-29 22:57:05 +00:00
|
|
|
if (orgs) {
|
|
|
|
// Don't show the templates org since it's selected by default, and
|
|
|
|
// is not writable to.
|
2022-06-03 14:58:07 +00:00
|
|
|
orgs = orgs.filter(o => !isTemplatesOrg(o));
|
2021-07-29 22:57:05 +00:00
|
|
|
}
|
2020-10-02 15:10:00 +00:00
|
|
|
|
|
|
|
// Show a dialog with a form to select destination.
|
|
|
|
saveModal((ctl, owner) => {
|
2023-09-06 18:35:46 +00:00
|
|
|
const saveCopyModal = SaveCopyModal.create(owner, {pageModel, doc, orgs});
|
2020-10-02 15:10:00 +00:00
|
|
|
return {
|
|
|
|
title: modalTitle,
|
|
|
|
body: saveCopyModal.buildDom(),
|
|
|
|
saveFunc: () => saveCopyModal.save(),
|
|
|
|
saveDisabled: saveCopyModal.saveDisabled,
|
|
|
|
width: 'normal',
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-09-06 18:35:46 +00:00
|
|
|
interface SaveCopyModalParams {
|
|
|
|
pageModel: DocPageModel;
|
|
|
|
doc: Document;
|
|
|
|
orgs: Organization[]|null;
|
|
|
|
}
|
|
|
|
|
2020-10-02 15:10:00 +00:00
|
|
|
class SaveCopyModal extends Disposable {
|
2023-09-06 18:35:46 +00:00
|
|
|
private _pageModel = this._params.pageModel;
|
|
|
|
private _app = this._pageModel.appModel;
|
|
|
|
private _doc = this._params.doc;
|
|
|
|
private _orgs = this._params.orgs;
|
2020-10-02 15:10:00 +00:00
|
|
|
private _workspaces = Observable.create<Workspace[]|null>(this, null);
|
|
|
|
private _destName = Observable.create<string>(this, '');
|
|
|
|
private _destOrg = Observable.create<Organization|null>(this, this._app.currentOrg);
|
|
|
|
private _destWS = Observable.create<Workspace|null>(this, this._doc.workspace);
|
|
|
|
private _asTemplate = Observable.create<boolean>(this, false);
|
|
|
|
private _saveDisabled = Computed.create(this, this._destWS, this._destName, (use, ws, name) =>
|
|
|
|
(!name.trim() || !ws || !roles.canEdit(ws.access)));
|
|
|
|
|
2023-09-07 13:11:33 +00:00
|
|
|
private _showWorkspaces = Computed.create(this, this._destOrg, (use, org) => {
|
|
|
|
// Workspace are available for personal and team sites now, but there are legacy sites without it.
|
|
|
|
// Make best effort to figure out if they are disabled, but if we don't have the info, show the selector.
|
|
|
|
if (!org) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
// We won't have info about any other org except the one we are at.
|
|
|
|
if (org.id === this._app.currentOrg?.id) {
|
2024-05-17 19:14:34 +00:00
|
|
|
const workspaces = this._app.currentFeatures?.workspaces ?? true;
|
|
|
|
const numberAllowed = this._app.currentFeatures?.maxWorkspacesPerOrg ?? 2;
|
2023-09-07 13:11:33 +00:00
|
|
|
return workspaces && numberAllowed > 1;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
});
|
2020-10-02 15:10:00 +00:00
|
|
|
|
|
|
|
// If orgs is non-null, then we show a selector for orgs.
|
2023-09-06 18:35:46 +00:00
|
|
|
constructor(private _params: SaveCopyModalParams) {
|
2020-10-02 15:10:00 +00:00
|
|
|
super();
|
2023-09-06 18:35:46 +00:00
|
|
|
if (this._doc.name !== 'Untitled') {
|
|
|
|
this._destName.set(this._doc.name + ' (copy)');
|
2020-10-02 15:10:00 +00:00
|
|
|
}
|
|
|
|
if (this._orgs && this._app.currentOrg) {
|
|
|
|
// Set _destOrg to an Organization object from _orgs array; there should be one equivalent
|
|
|
|
// to currentOrg, but we need the actual object for select() to recognize it as selected.
|
|
|
|
const orgId = this._app.currentOrg.id;
|
2023-09-07 13:11:33 +00:00
|
|
|
const newOrg = this._orgs.find((org) => org.id === orgId) || this._orgs[0];
|
|
|
|
this._destOrg.set(newOrg);
|
2020-10-02 15:10:00 +00:00
|
|
|
}
|
|
|
|
this.autoDispose(subscribe(this._destOrg, (use, org) => this._updateWorkspaces(org).catch(reportError)));
|
|
|
|
}
|
|
|
|
|
|
|
|
public get saveDisabled() { return this._saveDisabled; }
|
|
|
|
|
|
|
|
public async save() {
|
|
|
|
const ws = this._destWS.get();
|
2022-12-06 13:57:29 +00:00
|
|
|
if (!ws) { throw new Error(t("No destination workspace")); }
|
2020-10-02 15:10:00 +00:00
|
|
|
const api = this._app.api;
|
|
|
|
const org = this._destOrg.get();
|
2023-09-06 18:35:46 +00:00
|
|
|
const destName = this._destName.get();
|
2021-11-09 10:34:26 +00:00
|
|
|
try {
|
2023-09-06 18:35:46 +00:00
|
|
|
const doc = await api.copyDoc(this._doc.id, ws.id, {
|
|
|
|
documentName: destName,
|
|
|
|
asTemplate: this._asTemplate.get(),
|
|
|
|
});
|
|
|
|
this._pageModel.clearUnsavedChanges();
|
|
|
|
await urlState().pushUrl({org: org?.domain || undefined, doc, docPage: urlState().state.get().docPage});
|
2021-11-09 10:34:26 +00:00
|
|
|
} catch(err) {
|
|
|
|
// Convert access denied errors to normal Error to make it consistent with other endpoints.
|
|
|
|
// TODO: Should not allow to click this button when user doesn't have permissions.
|
|
|
|
if (err.status === 403) {
|
|
|
|
throw new Error(err.details.userError || err.message);
|
|
|
|
}
|
|
|
|
throw err;
|
|
|
|
}
|
2020-10-02 15:10:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public buildDom() {
|
|
|
|
return [
|
|
|
|
cssField(
|
2022-10-28 16:11:08 +00:00
|
|
|
cssLabel(t("Name")),
|
2022-12-06 13:57:29 +00:00
|
|
|
input(this._destName, {onInput: true}, {placeholder: t("Enter document name")}, dom.cls(cssInput.className),
|
2020-10-02 15:10:00 +00:00
|
|
|
// modal dialog grabs focus after 10ms delay; so to focus this input, wait a bit longer
|
|
|
|
// (see the TODO in app/client/ui2018/modals.ts about weasel.js and focus).
|
|
|
|
(elem) => { setTimeout(() => { elem.focus(); }, 20); },
|
|
|
|
dom.on('focus', (ev, elem) => { elem.select(); }),
|
|
|
|
testId('copy-dest-name'))
|
|
|
|
),
|
|
|
|
cssField(
|
2022-12-06 13:57:29 +00:00
|
|
|
cssLabel(t("As Template")),
|
|
|
|
cssCheckbox(this._asTemplate, t("Include the structure without any of the data."),
|
2020-10-02 15:10:00 +00:00
|
|
|
testId('save-as-template'))
|
|
|
|
),
|
|
|
|
// Show the team picker only when saving to other teams is allowed and there are other teams
|
|
|
|
// accessible.
|
|
|
|
(this._orgs ?
|
|
|
|
cssField(
|
2022-10-28 16:11:08 +00:00
|
|
|
cssLabel(t("Organization")),
|
2020-10-02 15:10:00 +00:00
|
|
|
select(this._destOrg, this._orgs.map(value => ({value, label: value.name}))),
|
|
|
|
testId('copy-dest-org'),
|
|
|
|
) : null
|
|
|
|
),
|
|
|
|
// Don't show the workspace picker when destOrg is a personal site and there is just one
|
|
|
|
// workspace, since workspaces are not a feature of personal orgs.
|
|
|
|
// Show the workspace picker only when destOrg is a team site, because personal orgs do not have workspaces.
|
|
|
|
dom.domComputed((use) => use(this._showWorkspaces) && use(this._workspaces), (wss) =>
|
|
|
|
wss === false ? null :
|
2022-12-06 13:57:29 +00:00
|
|
|
wss && wss.length === 0 ? cssWarningText(t("You do not have write access to this site"),
|
2020-10-02 15:10:00 +00:00
|
|
|
testId('copy-warning')) :
|
|
|
|
[
|
|
|
|
cssField(
|
2022-10-28 16:11:08 +00:00
|
|
|
cssLabel(t("Workspace")),
|
2020-10-02 15:10:00 +00:00
|
|
|
(wss === null ?
|
|
|
|
cssSpinner(loadingSpinner()) :
|
|
|
|
select(this._destWS, wss.map(value => ({
|
|
|
|
value,
|
|
|
|
label: workspaceName(this._app, value),
|
|
|
|
disabled: !roles.canEdit(value.access),
|
|
|
|
})))
|
|
|
|
),
|
|
|
|
testId('copy-dest-workspace'),
|
|
|
|
),
|
2021-08-27 18:10:30 +00:00
|
|
|
wss ? dom.domComputed(this._destWS, (destWs) =>
|
|
|
|
destWs && !roles.canEdit(destWs.access) ?
|
2022-12-06 13:57:29 +00:00
|
|
|
cssWarningText(t("You do not have write access to the selected workspace"),
|
2021-08-27 18:10:30 +00:00
|
|
|
testId('copy-warning')
|
|
|
|
) : null
|
2020-10-02 15:10:00 +00:00
|
|
|
) : null
|
|
|
|
]
|
|
|
|
),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fetch a list of workspaces for the given org, in the same order in which we list them in HomeModel,
|
|
|
|
* and set this._workspaces to it. While fetching, this._workspaces is set to null.
|
|
|
|
* Once fetched, we also set this._destWS.
|
|
|
|
*/
|
|
|
|
private async _updateWorkspaces(org: Organization|null) {
|
|
|
|
this._workspaces.set(null); // Show that workspaces are loading.
|
2021-09-20 15:54:01 +00:00
|
|
|
this._destWS.set(null); // Disable saving while waiting to set a new destination workspace.
|
2020-10-02 15:10:00 +00:00
|
|
|
try {
|
|
|
|
let wss = org ? await this._app.api.getOrgWorkspaces(org.id) : [];
|
2021-09-20 15:54:01 +00:00
|
|
|
if (this._destOrg.get() !== org) {
|
|
|
|
// We must have switched the org. Don't update anything; in particularr, keep _workspaces
|
|
|
|
// and _destWS as null, to show loading/save-disabled status. Let the new fetch update things.
|
|
|
|
return;
|
|
|
|
}
|
2020-10-02 15:10:00 +00:00
|
|
|
// Sort the same way that HomeModel sorts workspaces.
|
|
|
|
wss = sortBy(wss,
|
|
|
|
(ws) => [ws.isSupportWorkspace, ownerName(this._app, ws).toLowerCase(), ws.name.toLowerCase()]);
|
|
|
|
// Filter out isSupportWorkspace, since it's not writable and confusing to include.
|
|
|
|
// (The support user creating a new example can just download and upload.)
|
|
|
|
wss = wss.filter(ws => !ws.isSupportWorkspace);
|
|
|
|
|
|
|
|
let defaultWS: Workspace|undefined;
|
|
|
|
const showWorkspaces = (org && !org.owner);
|
|
|
|
if (showWorkspaces) {
|
|
|
|
// If we show a workspace selector, default to the current document's workspace (when its
|
|
|
|
// org is selected) even if it's not writable. User can switch the workspace manually.
|
|
|
|
defaultWS = wss.find(ws => (ws.id === this._doc.workspace.id));
|
|
|
|
} else {
|
|
|
|
// If the workspace selector is not shown (for personal orgs), prefer the user's default
|
|
|
|
// Home workspace as long as its writable.
|
|
|
|
defaultWS = wss.find(ws => getWorkspaceInfo(this._app, ws).isDefault && roles.canEdit(ws.access));
|
|
|
|
}
|
|
|
|
const firstWritable = wss.find(ws => roles.canEdit(ws.access));
|
|
|
|
|
|
|
|
// If there is at least one destination available, set one as the current selection.
|
|
|
|
// Otherwise, make it clear to the user that there are no options.
|
|
|
|
if (firstWritable) {
|
|
|
|
this._workspaces.set(wss);
|
|
|
|
this._destWS.set(defaultWS || firstWritable);
|
|
|
|
} else {
|
|
|
|
this._workspaces.set([]);
|
|
|
|
this._destWS.set(null);
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
this._workspaces.set([]);
|
|
|
|
this._destWS.set(null);
|
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-18 10:54:03 +00:00
|
|
|
type DownloadOption = 'full' | 'nohistory' | 'template';
|
|
|
|
|
|
|
|
export function downloadDocModal(doc: Document, pageModel: DocPageModel) {
|
|
|
|
return modal((ctl, owner) => {
|
|
|
|
const selected = Observable.create<DownloadOption>(owner, 'full');
|
|
|
|
|
|
|
|
return [
|
2024-03-06 17:12:42 +00:00
|
|
|
cssModalTitle(t(`Download document`)),
|
2023-08-18 10:54:03 +00:00
|
|
|
cssRadioCheckboxOptions(
|
|
|
|
radioCheckboxOption(selected, 'full', t("Download full document and history")),
|
|
|
|
radioCheckboxOption(selected, 'nohistory', t("Remove document history (can significantly reduce file size)")),
|
|
|
|
radioCheckboxOption(selected, 'template', t("Remove all data but keep the structure to use as a template")),
|
|
|
|
),
|
|
|
|
cssModalButtons(
|
|
|
|
dom.domComputed(use =>
|
2024-03-06 17:12:42 +00:00
|
|
|
bigPrimaryButtonLink(t(`Download`), hooks.maybeModifyLinkAttrs({
|
2023-08-18 10:54:03 +00:00
|
|
|
href: pageModel.appModel.api.getDocAPI(doc.id).getDownloadUrl({
|
|
|
|
template: use(selected) === "template",
|
|
|
|
removeHistory: use(selected) === "nohistory" || use(selected) === "template",
|
|
|
|
}),
|
|
|
|
target: '_blank',
|
|
|
|
download: ''
|
2023-09-09 18:50:32 +00:00
|
|
|
}),
|
2023-08-18 10:54:03 +00:00
|
|
|
dom.on('click', () => {
|
|
|
|
ctl.close();
|
|
|
|
}),
|
|
|
|
testId('download-button-link'),
|
|
|
|
),
|
|
|
|
),
|
2024-03-06 17:12:42 +00:00
|
|
|
bigBasicButton(t('Cancel'), dom.on('click', () => {
|
2023-08-18 10:54:03 +00:00
|
|
|
ctl.close();
|
|
|
|
}))
|
|
|
|
)
|
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-10-02 15:10:00 +00:00
|
|
|
export const cssField = styled('div', `
|
|
|
|
margin: 16px 0;
|
|
|
|
display: flex;
|
|
|
|
`);
|
|
|
|
|
|
|
|
export const cssLabel = styled('label', `
|
|
|
|
font-weight: normal;
|
|
|
|
font-size: ${vars.mediumFontSize};
|
2022-09-06 01:51:57 +00:00
|
|
|
color: ${theme.text};
|
2020-10-02 15:10:00 +00:00
|
|
|
margin: 8px 16px 0 0;
|
|
|
|
white-space: nowrap;
|
|
|
|
width: 80px;
|
|
|
|
flex: none;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssWarningText = styled('div', `
|
2022-09-06 01:51:57 +00:00
|
|
|
color: ${theme.errorText};
|
2020-10-02 15:10:00 +00:00
|
|
|
margin-top: 8px;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssSpinner = styled('div', `
|
|
|
|
text-align: center;
|
|
|
|
flex: 1;
|
|
|
|
height: 30px;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssCheckbox = styled(labeledSquareCheckbox, `
|
|
|
|
margin-top: 8px;
|
|
|
|
`);
|