@manuscripts/style-guide 1.7.10-LEAN-3301 → 1.7.10-LEAN-3415-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditor.js +62 -0
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorItem.js +176 -0
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorProfile.js +62 -0
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorView.js +80 -0
- package/dist/cjs/components/AffiliationsEditor/index.js +25 -0
- package/dist/cjs/components/AffiliationsEditor/styles.js +56 -0
- package/dist/cjs/components/AuthorForm/AuthorForm.js +99 -0
- package/dist/cjs/components/AuthorForm/AuthorFormComponents.js +63 -0
- package/dist/cjs/components/AuthorForm/ContributorRolesSelect.js +100 -0
- package/dist/cjs/components/AuthorForm/RemoveAuthorButton.js +45 -0
- package/dist/cjs/components/AuthorForm/index.js +32 -0
- package/dist/cjs/components/AuthorName.js +52 -0
- package/dist/cjs/components/AuthorsDND/AuthorItemComponents.js +22 -0
- package/dist/cjs/components/AuthorsDND/AuthorsDND.js +68 -0
- package/dist/cjs/components/AuthorsDND/DraggableAuthorItem.js +197 -0
- package/dist/cjs/components/AuthorsDND/index.js +23 -0
- package/dist/cjs/components/Button.js +13 -3
- package/dist/cjs/components/ContextMenu.js +51 -0
- package/dist/cjs/components/{DragLayer.js → FileManager/DragLayer.js} +50 -26
- package/dist/cjs/components/FileManager/FileManager.js +1 -1
- package/dist/cjs/components/References/CitationEditor.js +1 -4
- package/dist/cjs/components/icons/index.js +1 -3
- package/dist/cjs/index.js +7 -2
- package/dist/cjs/lib/authors.js +110 -0
- package/dist/cjs/lib/formatAddress.js +31 -0
- package/dist/cjs/lib/name.js +26 -0
- package/dist/cjs/types.js +17 -0
- package/dist/es/components/AffiliationsEditor/AffiliationsEditor.js +34 -0
- package/dist/es/components/AffiliationsEditor/AffiliationsEditorItem.js +146 -0
- package/dist/es/components/AffiliationsEditor/AffiliationsEditorProfile.js +34 -0
- package/dist/es/components/AffiliationsEditor/AffiliationsEditorView.js +52 -0
- package/dist/es/components/AffiliationsEditor/index.js +17 -0
- package/dist/es/components/AffiliationsEditor/styles.js +49 -0
- package/dist/es/components/AuthorForm/AuthorForm.js +92 -0
- package/dist/es/components/AuthorForm/AuthorFormComponents.js +57 -0
- package/dist/es/components/AuthorForm/ContributorRolesSelect.js +70 -0
- package/dist/es/components/AuthorForm/RemoveAuthorButton.js +40 -0
- package/dist/es/components/AuthorForm/index.js +16 -0
- package/dist/es/components/AuthorName.js +23 -0
- package/dist/es/components/AuthorsDND/AuthorItemComponents.js +19 -0
- package/dist/es/components/AuthorsDND/AuthorsDND.js +40 -0
- package/dist/es/components/AuthorsDND/DraggableAuthorItem.js +192 -0
- package/dist/es/components/AuthorsDND/index.js +16 -0
- package/dist/es/components/Button.js +12 -2
- package/dist/es/components/ContextMenu.js +44 -0
- package/dist/es/components/{DragLayer.js → FileManager/DragLayer.js} +27 -26
- package/dist/es/components/FileManager/FileManager.js +1 -1
- package/dist/es/components/References/CitationEditor.js +1 -4
- package/dist/es/components/icons/index.js +0 -1
- package/dist/es/index.js +7 -2
- package/dist/es/lib/authors.js +98 -0
- package/dist/es/lib/formatAddress.js +29 -0
- package/dist/es/lib/name.js +22 -0
- package/dist/es/types.js +16 -0
- package/dist/types/components/AffiliationsEditor/AffiliationsEditor.d.ts +31 -0
- package/dist/types/components/AffiliationsEditor/AffiliationsEditorItem.d.ts +26 -0
- package/dist/types/components/AffiliationsEditor/AffiliationsEditorProfile.d.ts +30 -0
- package/dist/types/components/AffiliationsEditor/AffiliationsEditorView.d.ts +34 -0
- package/dist/types/components/AffiliationsEditor/index.d.ts +17 -0
- package/dist/types/components/AffiliationsEditor/styles.d.ts +23 -0
- package/dist/types/components/AlertMessage.d.ts +1 -1
- package/dist/types/components/AuthorForm/AuthorForm.d.ts +29 -0
- package/dist/types/components/AuthorForm/AuthorFormComponents.d.ts +31 -0
- package/dist/types/components/AuthorForm/ContributorRolesSelect.d.ts +23 -0
- package/dist/types/components/AuthorForm/RemoveAuthorButton.d.ts +27 -0
- package/dist/types/components/AuthorForm/index.d.ts +16 -0
- package/dist/types/components/AuthorName.d.ts +22 -0
- package/dist/types/components/AuthorsDND/AuthorItemComponents.d.ts +24 -0
- package/dist/types/components/AuthorsDND/AuthorsDND.d.ts +28 -0
- package/dist/types/components/AuthorsDND/DraggableAuthorItem.d.ts +50 -0
- package/dist/types/components/AuthorsDND/index.d.ts +16 -0
- package/dist/types/components/Button.d.ts +10 -9
- package/dist/types/components/ContextMenu.d.ts +25 -0
- package/dist/types/components/EditorHeader/EditorHeader.d.ts +1 -1
- package/dist/types/components/InspectorSection.d.ts +1 -1
- package/dist/types/components/NavDropdown.d.ts +1 -1
- package/dist/types/components/StyledModal.d.ts +1 -1
- package/dist/types/components/icons/index.d.ts +0 -1
- package/dist/types/index.d.ts +7 -2
- package/dist/types/lib/authors.d.ts +30 -0
- package/dist/types/lib/formatAddress.d.ts +18 -0
- package/dist/types/lib/name.d.ts +17 -0
- package/dist/types/types.d.ts +80 -0
- package/package.json +1 -1
- /package/dist/types/components/{DragLayer.d.ts → FileManager/DragLayer.d.ts} +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
const react_1 = __importStar(require("react"));
|
|
45
|
+
const authors_1 = require("../../lib/authors");
|
|
46
|
+
const AffiliationsEditorView_1 = __importDefault(require("./AffiliationsEditorView"));
|
|
47
|
+
const AffiliationsEditor = ({ affiliations, authorAffiliations, addAuthorAffiliation, updateAffiliation, removeAuthorAffiliation, components, styleOverrides, }) => {
|
|
48
|
+
const [searchText, setSearchText] = (0, react_1.useState)('');
|
|
49
|
+
const handleChoose = (0, react_1.useCallback)((value) => {
|
|
50
|
+
if (value) {
|
|
51
|
+
const selectedAffiliation = value;
|
|
52
|
+
addAuthorAffiliation(selectedAffiliation.value);
|
|
53
|
+
}
|
|
54
|
+
setSearchText('');
|
|
55
|
+
}, [addAuthorAffiliation]);
|
|
56
|
+
const options = (0, authors_1.affiliationsOptions)(affiliations, authorAffiliations);
|
|
57
|
+
const active = authorAffiliations
|
|
58
|
+
? authorAffiliations.map((item) => item.data)
|
|
59
|
+
: [];
|
|
60
|
+
return (react_1.default.createElement(AffiliationsEditorView_1.default, { options: options, selected: active, updateAffiliation: updateAffiliation, removeAuthorAffiliation: removeAuthorAffiliation, components: components, styleOverrides: styleOverrides, handleChoose: handleChoose, handleInputChange: setSearchText, inputValue: searchText }));
|
|
61
|
+
};
|
|
62
|
+
exports.default = AffiliationsEditor;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.AffiliationsEditorItem = void 0;
|
|
45
|
+
const AnnotationRemove_1 = __importDefault(require("@manuscripts/assets/react/AnnotationRemove"));
|
|
46
|
+
const ArrowDownBlue_1 = __importDefault(require("@manuscripts/assets/react/ArrowDownBlue"));
|
|
47
|
+
const formik_1 = require("formik");
|
|
48
|
+
const react_1 = __importStar(require("react"));
|
|
49
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
50
|
+
const authors_1 = require("../../lib/authors");
|
|
51
|
+
const AutoSaveInput_1 = require("../AutoSaveInput");
|
|
52
|
+
const TextField_1 = require("../TextField");
|
|
53
|
+
const Section = styled_components_1.default.section `
|
|
54
|
+
border: 1px solid ${(props) => props.theme.colors.border.field.default};
|
|
55
|
+
border-radius: ${(props) => props.theme.grid.radius.default};
|
|
56
|
+
background: ${(props) => props.theme.colors.background.primary};
|
|
57
|
+
margin-bottom: 2px;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
`;
|
|
60
|
+
const Title = styled_components_1.default.h4 `
|
|
61
|
+
margin: 0;
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
font-size: 0.875rem;
|
|
65
|
+
padding-right: 0.5rem;
|
|
66
|
+
background: ${(props) => props.isInvalid ? props.theme.colors.background.warning : 'transparent'};
|
|
67
|
+
color: ${(props) => props.isInvalid ? props.theme.colors.text.warning : 'inherit'};
|
|
68
|
+
`;
|
|
69
|
+
const DropdownIndicator = (0, styled_components_1.default)(ArrowDownBlue_1.default) `
|
|
70
|
+
border: 0;
|
|
71
|
+
border-radius: 50%;
|
|
72
|
+
margin-right: 0.6em;
|
|
73
|
+
min-width: 20px;
|
|
74
|
+
`;
|
|
75
|
+
const ToggleButton = styled_components_1.default.button `
|
|
76
|
+
flex-grow: 1;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
width: 100%;
|
|
80
|
+
background: transparent;
|
|
81
|
+
border: none;
|
|
82
|
+
text-align: left;
|
|
83
|
+
font-family: ${(props) => props.theme.font.family.sans};
|
|
84
|
+
font-size: 1rem;
|
|
85
|
+
padding: 0.6em 0.5em;
|
|
86
|
+
|
|
87
|
+
outline: none;
|
|
88
|
+
|
|
89
|
+
&:focus {
|
|
90
|
+
color: ${(props) => props.theme.colors.button.primary.border.hover};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
svg {
|
|
94
|
+
transform: ${(props) => (props.isOpen ? 'rotateX(180deg)' : 'initial')};
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
const RemoveButton = styled_components_1.default.button `
|
|
98
|
+
border: none;
|
|
99
|
+
background: transparent;
|
|
100
|
+
padding: 0;
|
|
101
|
+
|
|
102
|
+
outline: none;
|
|
103
|
+
|
|
104
|
+
&:focus path {
|
|
105
|
+
fill: ${(props) => props.theme.colors.button.primary.color.hover};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
svg {
|
|
109
|
+
width: 2rem;
|
|
110
|
+
height: 2rem;
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
const AffiliationsForm = (0, styled_components_1.default)(formik_1.Form) `
|
|
114
|
+
border: 1px solid ${(props) => props.theme.colors.border.field.default};
|
|
115
|
+
border-radius: ${(props) => props.theme.grid.radius.default};
|
|
116
|
+
margin: 0.4rem 0.71rem 0.71rem;
|
|
117
|
+
overflow: hidden;
|
|
118
|
+
`;
|
|
119
|
+
const AffiliationsTextField = (0, styled_components_1.default)(TextField_1.TextField) `
|
|
120
|
+
border-radius: 0;
|
|
121
|
+
border-bottom: none;
|
|
122
|
+
border-right: none;
|
|
123
|
+
border-left: none;
|
|
124
|
+
background: transparent;
|
|
125
|
+
&:first-child {
|
|
126
|
+
border-top: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&[aria-invalid] {
|
|
130
|
+
background: ${(props) => props.theme.colors.background.warning};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&[aria-invalid]:focus {
|
|
134
|
+
background: transparent;
|
|
135
|
+
}
|
|
136
|
+
`;
|
|
137
|
+
const Columns = styled_components_1.default.div `
|
|
138
|
+
display: flex;
|
|
139
|
+
`;
|
|
140
|
+
const Column = styled_components_1.default.div `
|
|
141
|
+
flex: 1 1 auto;
|
|
142
|
+
max-width: 50%;
|
|
143
|
+
border-top: 1px solid ${(props) => props.theme.colors.border.field.default};
|
|
144
|
+
border-left: 1px solid ${(props) => props.theme.colors.border.field.default};
|
|
145
|
+
&:first-child {
|
|
146
|
+
border-left: none;
|
|
147
|
+
}
|
|
148
|
+
`;
|
|
149
|
+
const AffiliationsEditorItem = ({ affiliation, requestToggle, isOpen, updateAffiliation, removeAuthorAffiliation, }) => {
|
|
150
|
+
const remove = (0, react_1.useCallback)(() => {
|
|
151
|
+
removeAuthorAffiliation(affiliation);
|
|
152
|
+
}, [affiliation, removeAuthorAffiliation]);
|
|
153
|
+
const vivifiedAffiliation = Object.assign({ institution: '', department: '', addressLine1: '', addressLine2: '', addressLine3: '', city: '', county: '', country: '', postCode: '' }, affiliation);
|
|
154
|
+
const isInvalid = !vivifiedAffiliation.institution;
|
|
155
|
+
return (react_1.default.createElement(Section, null,
|
|
156
|
+
react_1.default.createElement(Title, { isInvalid: isInvalid },
|
|
157
|
+
react_1.default.createElement(ToggleButton, { type: "button", onClick: requestToggle, isOpen: isOpen },
|
|
158
|
+
react_1.default.createElement(DropdownIndicator, null,
|
|
159
|
+
react_1.default.createElement(ArrowDownBlue_1.default, null)),
|
|
160
|
+
(0, authors_1.affiliationLabel)(affiliation)),
|
|
161
|
+
react_1.default.createElement(RemoveButton, { type: "button", "aria-label": "Delete this affiliation", onClick: remove },
|
|
162
|
+
react_1.default.createElement(AnnotationRemove_1.default, null))),
|
|
163
|
+
isOpen && (react_1.default.createElement(formik_1.Formik, { initialValues: vivifiedAffiliation, onSubmit: updateAffiliation }, () => (react_1.default.createElement(AffiliationsForm, null,
|
|
164
|
+
react_1.default.createElement(formik_1.Field, { name: "institution" }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { component: AffiliationsTextField, saveOn: "blur", placeholder: "Institution Name", isInvalid: isInvalid })))),
|
|
165
|
+
react_1.default.createElement(formik_1.Field, { name: "department" }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { component: AffiliationsTextField, saveOn: "blur", placeholder: "Department" })))),
|
|
166
|
+
react_1.default.createElement(formik_1.Field, { name: "addressLine1" }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { component: AffiliationsTextField, saveOn: "blur", placeholder: "Street Address" })))),
|
|
167
|
+
react_1.default.createElement(Columns, null,
|
|
168
|
+
react_1.default.createElement(Column, null,
|
|
169
|
+
react_1.default.createElement(formik_1.Field, { name: "city" }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { component: AffiliationsTextField, saveOn: "blur", placeholder: "City" })))),
|
|
170
|
+
react_1.default.createElement(formik_1.Field, { name: "county" }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { component: AffiliationsTextField, saveOn: "blur", placeholder: "State / Province" }))))),
|
|
171
|
+
react_1.default.createElement(Column, null,
|
|
172
|
+
react_1.default.createElement(formik_1.Field, { name: "postCode" }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { component: AffiliationsTextField, saveOn: "blur", placeholder: "Postal Code" })))),
|
|
173
|
+
react_1.default.createElement(formik_1.Field, { name: "country" }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { component: AffiliationsTextField, saveOn: "blur", placeholder: "Country" }))))))))))));
|
|
174
|
+
};
|
|
175
|
+
exports.AffiliationsEditorItem = AffiliationsEditorItem;
|
|
176
|
+
exports.default = exports.AffiliationsEditorItem;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
const json_schema_1 = require("@manuscripts/json-schema");
|
|
45
|
+
const react_1 = __importStar(require("react"));
|
|
46
|
+
const AffiliationsEditorView_1 = __importDefault(require("./AffiliationsEditorView"));
|
|
47
|
+
const AffiliationsEditorProfile = ({ affiliations, addAffiliation, updateAffiliation, removeAffiliation, components, styleOverrides, }) => {
|
|
48
|
+
const [searchText, setSearchText] = (0, react_1.useState)('');
|
|
49
|
+
const handleChoose = (0, react_1.useCallback)((value) => {
|
|
50
|
+
if (value) {
|
|
51
|
+
const selectedAffiliation = value;
|
|
52
|
+
addAffiliation(selectedAffiliation.value);
|
|
53
|
+
}
|
|
54
|
+
setSearchText('');
|
|
55
|
+
}, [addAffiliation]);
|
|
56
|
+
const affiliationsArr = Array.from(affiliations.values());
|
|
57
|
+
const updateUserProfileAffiliation = (0, react_1.useCallback)((data) => {
|
|
58
|
+
updateAffiliation(Object.assign(Object.assign({}, data), { objectType: json_schema_1.ObjectTypes.UserProfileAffiliation }));
|
|
59
|
+
}, [updateAffiliation]);
|
|
60
|
+
return (react_1.default.createElement(AffiliationsEditorView_1.default, { options: [], selected: affiliationsArr, updateAffiliation: updateUserProfileAffiliation, removeAuthorAffiliation: removeAffiliation, components: components, styleOverrides: styleOverrides, handleChoose: handleChoose, handleInputChange: setSearchText, inputValue: searchText }));
|
|
61
|
+
};
|
|
62
|
+
exports.default = AffiliationsEditorProfile;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
const react_1 = __importStar(require("react"));
|
|
45
|
+
const creatable_1 = __importDefault(require("react-select/creatable"));
|
|
46
|
+
const styled_components_1 = require("styled-components");
|
|
47
|
+
const AuthorFormComponents_1 = require("../AuthorForm/AuthorFormComponents");
|
|
48
|
+
const AffiliationsEditorItem_1 = require("./AffiliationsEditorItem");
|
|
49
|
+
const styles_1 = require("./styles");
|
|
50
|
+
const reactSelectComponents = {
|
|
51
|
+
IndicatorsContainer: styles_1.AddAffiliationIndicator,
|
|
52
|
+
};
|
|
53
|
+
const AffiliationsEditorView = ({ options, selected, updateAffiliation, removeAuthorAffiliation, handleChoose, handleInputChange, inputValue, components, styleOverrides, }) => {
|
|
54
|
+
const { Legend } = Object.assign(Object.assign({}, AuthorFormComponents_1.defaultAuthorFormComponents), components);
|
|
55
|
+
const [currentSection, setCurrentSection] = (0, react_1.useState)('');
|
|
56
|
+
const requestOpen = (id) => {
|
|
57
|
+
setCurrentSection(id === currentSection ? '' : id);
|
|
58
|
+
};
|
|
59
|
+
const theme = (0, react_1.useContext)(styled_components_1.ThemeContext);
|
|
60
|
+
return (react_1.default.createElement(styles_1.Container, null,
|
|
61
|
+
react_1.default.createElement(Legend, null, "Affiliations"),
|
|
62
|
+
react_1.default.createElement(styles_1.Field, null,
|
|
63
|
+
react_1.default.createElement(styles_1.List, null, selected &&
|
|
64
|
+
selected.map((affiliation) => {
|
|
65
|
+
const { _id } = affiliation;
|
|
66
|
+
return (react_1.default.createElement(AffiliationsEditorItem_1.AffiliationsEditorItem, { key: _id, affiliation: affiliation, isOpen: currentSection === _id, requestToggle: () => requestOpen(_id), updateAffiliation: updateAffiliation, removeAuthorAffiliation: removeAuthorAffiliation }));
|
|
67
|
+
})),
|
|
68
|
+
react_1.default.createElement(creatable_1.default, { isMulti: false, isClearable: false, options: options, onInputChange: (t) => handleInputChange(t), inputValue: inputValue, onChange: handleChoose, value: null, placeholder: "Begin typing to add affiliation", isValidNewOption: (currentText) => !!currentText, components: reactSelectComponents, noOptionsMessage: () => 'Type the name of an institution', styles: {
|
|
69
|
+
control: (provided, state) => (Object.assign(Object.assign({}, provided), { backgroundColor: state.isFocused
|
|
70
|
+
? theme.colors.background.fifth
|
|
71
|
+
: theme.colors.background.primary, borderColor: state.isFocused
|
|
72
|
+
? theme.colors.border.field.active
|
|
73
|
+
: theme.colors.border.field.default, '&:hover': {
|
|
74
|
+
backgroundColor: theme.colors.background.fifth,
|
|
75
|
+
}, borderRadius: theme.grid.radius.default, boxShadow: 'none', fontFamily: theme.font.family.sans })),
|
|
76
|
+
menu: (provided) => (Object.assign(Object.assign({}, provided), { zIndex: (styleOverrides && styleOverrides.menuZIndex) ||
|
|
77
|
+
provided.zIndex })),
|
|
78
|
+
} }))));
|
|
79
|
+
};
|
|
80
|
+
exports.default = AffiliationsEditorView;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.AffiliationsEditorProfile = exports.AffiliationsEditor = void 0;
|
|
22
|
+
var AffiliationsEditor_1 = require("./AffiliationsEditor");
|
|
23
|
+
Object.defineProperty(exports, "AffiliationsEditor", { enumerable: true, get: function () { return __importDefault(AffiliationsEditor_1).default; } });
|
|
24
|
+
var AffiliationsEditorProfile_1 = require("./AffiliationsEditorProfile");
|
|
25
|
+
Object.defineProperty(exports, "AffiliationsEditorProfile", { enumerable: true, get: function () { return __importDefault(AffiliationsEditorProfile_1).default; } });
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.AddAffiliationIndicator = exports.AddAffiliationContainer = exports.List = exports.Field = exports.Container = void 0;
|
|
22
|
+
const AddAuthor_1 = __importDefault(require("@manuscripts/assets/react/AddAuthor"));
|
|
23
|
+
const react_1 = __importDefault(require("react"));
|
|
24
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
25
|
+
exports.Container = styled_components_1.default.div `
|
|
26
|
+
margin: 0 1.89rem 1rem;
|
|
27
|
+
`;
|
|
28
|
+
exports.Field = styled_components_1.default.div `
|
|
29
|
+
margin: 1rem 0;
|
|
30
|
+
`;
|
|
31
|
+
exports.List = styled_components_1.default.div `
|
|
32
|
+
margin-bottom: 0.5rem;
|
|
33
|
+
`;
|
|
34
|
+
exports.AddAffiliationContainer = styled_components_1.default.div `
|
|
35
|
+
padding-right: 0.71rem;
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
justify-content: space-around;
|
|
39
|
+
|
|
40
|
+
svg {
|
|
41
|
+
width: 1.5rem;
|
|
42
|
+
height: 1.5rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
circle,
|
|
46
|
+
use {
|
|
47
|
+
fill: ${(props) => props.theme.colors.brand.default};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
path {
|
|
51
|
+
mask: none;
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
const AddAffiliationIndicator = () => (react_1.default.createElement(exports.AddAffiliationContainer, null,
|
|
55
|
+
react_1.default.createElement(AddAuthor_1.default, null)));
|
|
56
|
+
exports.AddAffiliationIndicator = AddAffiliationIndicator;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.AuthorForm = void 0;
|
|
31
|
+
const formik_1 = require("formik");
|
|
32
|
+
const react_1 = __importDefault(require("react"));
|
|
33
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
34
|
+
const AutoSaveInput_1 = require("../AutoSaveInput");
|
|
35
|
+
const Checkbox_1 = require("../Checkbox");
|
|
36
|
+
const TextField_1 = require("../TextField");
|
|
37
|
+
const TextFieldGroupContainer_1 = require("../TextFieldGroupContainer");
|
|
38
|
+
const AuthorFormComponents_1 = require("./AuthorFormComponents");
|
|
39
|
+
const RemoveAuthorButton_1 = __importDefault(require("./RemoveAuthorButton"));
|
|
40
|
+
const ensureString = (value) => value || '';
|
|
41
|
+
const buildInitialValues = (author) => {
|
|
42
|
+
return {
|
|
43
|
+
affiliations: author.affiliations || [],
|
|
44
|
+
_id: author._id,
|
|
45
|
+
priority: Number(author.priority),
|
|
46
|
+
email: ensureString(author.email),
|
|
47
|
+
isCorresponding: Boolean(author.isCorresponding),
|
|
48
|
+
bibliographicName: {
|
|
49
|
+
_id: author.bibliographicName._id,
|
|
50
|
+
objectType: author.bibliographicName.objectType,
|
|
51
|
+
given: ensureString(author.bibliographicName.given),
|
|
52
|
+
family: ensureString(author.bibliographicName.family),
|
|
53
|
+
suffix: ensureString(author.bibliographicName.suffix),
|
|
54
|
+
},
|
|
55
|
+
role: ensureString(author.role),
|
|
56
|
+
contribution: ensureString(author.contribution),
|
|
57
|
+
ORCIDIdentifier: ensureString(author.ORCIDIdentifier),
|
|
58
|
+
roles: author.roles || [],
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
const OrcidContainer = styled_components_1.default.div `
|
|
62
|
+
margin: 16px 0 0;
|
|
63
|
+
`;
|
|
64
|
+
const RolesContainer = styled_components_1.default.div `
|
|
65
|
+
margin: 16px 0;
|
|
66
|
+
`;
|
|
67
|
+
const AuthorForm = ({ author, handleSave, removeAuthor, isRemoveAuthorOpen, handleRemoveAuthor, components, }) => {
|
|
68
|
+
const { Legend, TextField } = Object.assign(Object.assign({}, AuthorFormComponents_1.defaultAuthorFormComponents), components);
|
|
69
|
+
return (react_1.default.createElement(formik_1.Formik, { initialValues: buildInitialValues(author), onSubmit: handleSave, enableReinitialize: true }, ({ values }) => {
|
|
70
|
+
const isAuthor = values.role === 'author';
|
|
71
|
+
return (react_1.default.createElement(formik_1.Form, null,
|
|
72
|
+
react_1.default.createElement(AuthorFormComponents_1.Fields, null,
|
|
73
|
+
react_1.default.createElement(AuthorFormComponents_1.Fieldset, null,
|
|
74
|
+
react_1.default.createElement(AuthorFormComponents_1.Container, null,
|
|
75
|
+
react_1.default.createElement(Legend, null, "Details"),
|
|
76
|
+
react_1.default.createElement(RemoveAuthorButton_1.default, { author: author, removeAuthor: () => {
|
|
77
|
+
removeAuthor(author);
|
|
78
|
+
}, isOpen: isRemoveAuthorOpen, handleOpen: handleRemoveAuthor })),
|
|
79
|
+
react_1.default.createElement(TextFieldGroupContainer_1.TextFieldGroupContainer, null,
|
|
80
|
+
react_1.default.createElement(formik_1.Field, { name: 'bibliographicName.given' }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { component: TextField, saveOn: 'blur', placeholder: 'Given name', testId: "bibliographic-name-given" })))),
|
|
81
|
+
react_1.default.createElement(formik_1.Field, { name: 'bibliographicName.family' }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { component: TextField, saveOn: 'blur', placeholder: 'Family name', testId: "bibliographic-name-family" }))))),
|
|
82
|
+
react_1.default.createElement(Checkbox_1.CheckboxLabel, { disabled: !isAuthor },
|
|
83
|
+
react_1.default.createElement(formik_1.Field, { name: 'isCorresponding' }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { disabled: !isAuthor, component: Checkbox_1.CheckboxField, saveOn: 'change', testId: "corresponding-checkbox" })))),
|
|
84
|
+
react_1.default.createElement(AuthorFormComponents_1.LabelText, null, "Corresponding Author")),
|
|
85
|
+
values.isCorresponding && (react_1.default.createElement(AuthorFormComponents_1.Label, null,
|
|
86
|
+
react_1.default.createElement(formik_1.Field, { name: 'email', type: 'email' }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { disabled: !isAuthor, component: TextField, saveOn: 'blur', placeholder: 'Email address', testId: "corresponding-email" })))))),
|
|
87
|
+
react_1.default.createElement(Checkbox_1.CheckboxLabel, null,
|
|
88
|
+
react_1.default.createElement(formik_1.Field, { name: 'role', type: 'checkbox' }, (props) => (react_1.default.createElement(Checkbox_1.CheckboxField, { name: 'role', checked: isAuthor, onChange: (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
+
props.form.setFieldValue(props.field.name, event.target.checked ? 'author' : 'other', false);
|
|
90
|
+
yield props.form.submitForm();
|
|
91
|
+
}) }))),
|
|
92
|
+
react_1.default.createElement(AuthorFormComponents_1.LabelText, null, "Include in Authors List")),
|
|
93
|
+
react_1.default.createElement(OrcidContainer, null,
|
|
94
|
+
react_1.default.createElement(TextField_1.TextFieldLabel, null,
|
|
95
|
+
react_1.default.createElement(AuthorFormComponents_1.LabelText, null, "ORCID"),
|
|
96
|
+
react_1.default.createElement(formik_1.Field, { name: 'ORCIDIdentifier', type: 'text' }, (props) => (react_1.default.createElement(AutoSaveInput_1.AutoSaveInput, Object.assign({}, props, { component: TextField, saveOn: 'blur', placeholder: 'https://orcid.org/...', testId: "bibliographic-name-family" }))))))))));
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
exports.AuthorForm = AuthorForm;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.defaultAuthorFormComponents = exports.Container = exports.Legend = exports.Fieldset = exports.LabelText = exports.Label = exports.Fields = void 0;
|
|
22
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
23
|
+
const Checkbox_1 = require("../Checkbox");
|
|
24
|
+
const TextField_1 = require("../TextField");
|
|
25
|
+
exports.Fields = styled_components_1.default.div `
|
|
26
|
+
padding: 16px;
|
|
27
|
+
`;
|
|
28
|
+
exports.Label = styled_components_1.default.label `
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
margin-bottom: 10px;
|
|
32
|
+
`;
|
|
33
|
+
exports.LabelText = styled_components_1.default.div `
|
|
34
|
+
font: ${(props) => props.theme.font.weight.normal}
|
|
35
|
+
${(props) => props.theme.font.size.normal} / 1
|
|
36
|
+
${(props) => props.theme.font.family.sans};
|
|
37
|
+
letter-spacing: -0.2px;
|
|
38
|
+
color: ${(props) => props.theme.colors.text.primary};
|
|
39
|
+
`;
|
|
40
|
+
exports.Fieldset = styled_components_1.default.fieldset `
|
|
41
|
+
border: none;
|
|
42
|
+
|
|
43
|
+
&:not(:last-child) {
|
|
44
|
+
margin-bottom: 16px;
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
exports.Legend = styled_components_1.default.legend `
|
|
48
|
+
font: ${(props) => props.theme.font.weight.normal}
|
|
49
|
+
${(props) => props.theme.font.size.xlarge} /
|
|
50
|
+
${(props) => props.theme.font.lineHeight.large}
|
|
51
|
+
${(props) => props.theme.font.family.sans};
|
|
52
|
+
letter-spacing: -0.4px;
|
|
53
|
+
color: ${(props) => props.theme.colors.text.secondary};
|
|
54
|
+
`;
|
|
55
|
+
exports.Container = styled_components_1.default.div `
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
`;
|
|
59
|
+
exports.defaultAuthorFormComponents = {
|
|
60
|
+
Legend: exports.Legend,
|
|
61
|
+
CheckboxLabel: Checkbox_1.CheckboxLabel,
|
|
62
|
+
TextField: TextField_1.TextField,
|
|
63
|
+
};
|