@manuscripts/style-guide 2.1.8-LEAN-4344.0 → 2.1.8
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/AlertMessage.js +49 -13
- package/dist/cjs/components/AutoSaveInput.js +53 -30
- package/dist/cjs/components/Avatar.js +40 -3
- package/dist/cjs/components/ContextMenu.js +22 -5
- package/dist/cjs/components/DatePicker/CalendarDatePicker.js +105 -87
- package/dist/cjs/components/Dialog.js +68 -24
- package/dist/cjs/components/DraggableModal.js +42 -4
- package/dist/cjs/components/Drawer.js +21 -2
- package/dist/cjs/components/Dropdown.js +1 -3
- package/dist/cjs/components/InspectorSection.js +48 -5
- package/dist/cjs/components/LoadingOverlay.js +5 -3
- package/dist/cjs/components/Menus/Menus.js +28 -9
- package/dist/cjs/components/Menus/Shortcut.js +18 -3
- package/dist/cjs/components/Menus/Submenu.js +28 -7
- package/dist/cjs/components/MultiValueInput.js +29 -3
- package/dist/cjs/components/NavDropdown.js +26 -3
- package/dist/cjs/components/RadioButton.js +19 -2
- package/dist/cjs/components/RelativeDate.js +20 -2
- package/dist/cjs/components/Resizer/Resizer.js +92 -100
- package/dist/cjs/components/Resizer/ResizerButton.js +12 -7
- package/dist/cjs/components/RichText/RichText.js +25 -3
- package/dist/cjs/components/RichText/RichTextField.js +25 -3
- package/dist/cjs/components/SaveStatus.js +31 -5
- package/dist/cjs/components/SelectField.js +17 -2
- package/dist/cjs/components/SelectedItemsBox.js +5 -2
- package/dist/cjs/components/StyledModal.js +17 -2
- package/dist/cjs/components/SystemUserAvatar.js +40 -3
- package/dist/cjs/components/TextField.js +22 -2
- package/dist/cjs/components/TextFieldContainer.js +22 -2
- package/dist/cjs/components/TextFieldError.js +19 -2
- package/dist/cjs/components/TextFieldGroupContainer.js +22 -2
- package/dist/cjs/components/Tooltip.js +4 -3
- package/dist/cjs/components/icons/add-author.js +23 -2
- package/dist/cjs/components/icons/add-comment.js +25 -2
- package/dist/cjs/components/icons/add-institution.js +20 -2
- package/dist/cjs/components/icons/add-new.js +7 -2
- package/dist/cjs/components/icons/add-outline.js +8 -2
- package/dist/cjs/components/icons/add-user.js +8 -2
- package/dist/cjs/components/icons/add.js +8 -2
- package/dist/cjs/components/icons/added.js +7 -2
- package/dist/cjs/components/icons/affiliation-placeholder.js +39 -2
- package/dist/cjs/components/icons/affiliation.js +7 -2
- package/dist/cjs/components/icons/alert.js +6 -2
- package/dist/cjs/components/icons/arrow-down-circle.js +7 -2
- package/dist/cjs/components/icons/arrow-down.js +6 -2
- package/dist/cjs/components/icons/arrow-left.js +6 -2
- package/dist/cjs/components/icons/arrow-up.js +6 -2
- package/dist/cjs/components/icons/attach.js +21 -2
- package/dist/cjs/components/icons/attention-blue.js +10 -2
- package/dist/cjs/components/icons/attention-green.js +7 -2
- package/dist/cjs/components/icons/attention-orange.js +12 -2
- package/dist/cjs/components/icons/attention-red.js +10 -2
- package/dist/cjs/components/icons/author-placeholder.js +46 -2
- package/dist/cjs/components/icons/avatar.js +8 -2
- package/dist/cjs/components/icons/book.js +22 -2
- package/dist/cjs/components/icons/circle-tick-animation.js +7 -2
- package/dist/cjs/components/icons/citation-count.js +6 -2
- package/dist/cjs/components/icons/comment-reply.js +6 -2
- package/dist/cjs/components/icons/comment-resolve.js +21 -2
- package/dist/cjs/components/icons/comment.js +25 -2
- package/dist/cjs/components/icons/corresponding-author.js +12 -2
- package/dist/cjs/components/icons/delete-solid.js +6 -2
- package/dist/cjs/components/icons/deleted.js +11 -2
- package/dist/cjs/components/icons/dots.js +23 -2
- package/dist/cjs/components/icons/draggable-icon.js +13 -2
- package/dist/cjs/components/icons/edit-attrs-tracking.js +7 -2
- package/dist/cjs/components/icons/edit.js +6 -2
- package/dist/cjs/components/icons/file-audio.js +23 -2
- package/dist/cjs/components/icons/file-code.js +23 -2
- package/dist/cjs/components/icons/file-compressed.js +30 -2
- package/dist/cjs/components/icons/file-corrupted.js +24 -2
- package/dist/cjs/components/icons/file-document.js +24 -2
- package/dist/cjs/components/icons/file-figure.js +23 -2
- package/dist/cjs/components/icons/file-graphical-abstract.js +8 -2
- package/dist/cjs/components/icons/file-image.js +6 -2
- package/dist/cjs/components/icons/file-latex-icon.js +25 -2
- package/dist/cjs/components/icons/file-main-document.js +10 -2
- package/dist/cjs/components/icons/file-pdf.js +22 -2
- package/dist/cjs/components/icons/file-table.js +21 -2
- package/dist/cjs/components/icons/file-unknown.js +22 -2
- package/dist/cjs/components/icons/file-video.js +21 -2
- package/dist/cjs/components/icons/handle-inspector.js +6 -2
- package/dist/cjs/components/icons/handle-outline.js +11 -2
- package/dist/cjs/components/icons/help.js +8 -2
- package/dist/cjs/components/icons/image-default.js +9 -2
- package/dist/cjs/components/icons/image-left.js +9 -2
- package/dist/cjs/components/icons/image-right.js +9 -2
- package/dist/cjs/components/icons/link.js +7 -2
- package/dist/cjs/components/icons/lock.js +9 -2
- package/dist/cjs/components/icons/logout.js +6 -2
- package/dist/cjs/components/icons/manuscript.js +24 -2
- package/dist/cjs/components/icons/outline-block-quote.js +8 -2
- package/dist/cjs/components/icons/outline-code.js +7 -2
- package/dist/cjs/components/icons/outline-embed.js +7 -2
- package/dist/cjs/components/icons/outline-equation.js +6 -2
- package/dist/cjs/components/icons/outline-figure.js +12 -2
- package/dist/cjs/components/icons/outline-manuscript.js +9 -2
- package/dist/cjs/components/icons/outline-ordered-list.js +6 -2
- package/dist/cjs/components/icons/outline-paragraph.js +6 -2
- package/dist/cjs/components/icons/outline-pull-quote.js +8 -2
- package/dist/cjs/components/icons/outline-section.js +6 -2
- package/dist/cjs/components/icons/outline-table.js +8 -2
- package/dist/cjs/components/icons/outline-unordered-list.js +8 -2
- package/dist/cjs/components/icons/plus.js +22 -2
- package/dist/cjs/components/icons/profile-avatar.js +6 -2
- package/dist/cjs/components/icons/role-annotating.js +8 -2
- package/dist/cjs/components/icons/role-reading.js +10 -2
- package/dist/cjs/components/icons/save-status-offline.js +23 -2
- package/dist/cjs/components/icons/save-status-saved.js +22 -2
- package/dist/cjs/components/icons/save-status-saving.js +24 -2
- package/dist/cjs/components/icons/scroll.js +10 -2
- package/dist/cjs/components/icons/search.js +22 -2
- package/dist/cjs/components/icons/section-category.js +21 -2
- package/dist/cjs/components/icons/slider-off.js +7 -2
- package/dist/cjs/components/icons/slider-on.js +7 -2
- package/dist/cjs/components/icons/system-user-avatar.js +9 -2
- package/dist/cjs/components/icons/task-step-done.js +22 -2
- package/dist/cjs/components/icons/tick.js +6 -2
- package/dist/cjs/components/icons/toolbar-bold.js +6 -2
- package/dist/cjs/components/icons/toolbar-citation.js +6 -2
- package/dist/cjs/components/icons/toolbar-code.js +7 -2
- package/dist/cjs/components/icons/toolbar-equation.js +6 -2
- package/dist/cjs/components/icons/toolbar-figure.js +6 -2
- package/dist/cjs/components/icons/toolbar-indent.js +11 -2
- package/dist/cjs/components/icons/toolbar-italic.js +6 -2
- package/dist/cjs/components/icons/toolbar-ordered-list.js +6 -2
- package/dist/cjs/components/icons/toolbar-subscript.js +6 -2
- package/dist/cjs/components/icons/toolbar-superscript.js +6 -2
- package/dist/cjs/components/icons/toolbar-symbol.js +6 -2
- package/dist/cjs/components/icons/toolbar-table.js +6 -2
- package/dist/cjs/components/icons/toolbar-underline.js +6 -2
- package/dist/cjs/components/icons/toolbar-unindent.js +11 -2
- package/dist/cjs/components/icons/toolbar-unordered-list.js +6 -2
- package/dist/cjs/components/icons/triangle-collapsed.js +6 -2
- package/dist/cjs/components/icons/triangle-expanded.js +6 -2
- package/dist/cjs/components/icons/upload.js +8 -2
- package/dist/cjs/components/icons/vertical-ellipsis.js +8 -2
- package/dist/cjs/components/icons/x.js +7 -2
- package/dist/cjs/hooks/use-scroll-detection.js +2 -2
- package/dist/cjs/lib/capabilities.js +5 -6
- package/dist/cjs/lib/files.js +17 -14
- package/dist/es/components/AlertMessage.js +47 -14
- package/dist/es/components/AutoSaveInput.js +50 -30
- package/dist/es/components/Avatar.js +17 -3
- package/dist/es/components/ContextMenu.js +22 -5
- package/dist/es/components/DatePicker/CalendarDatePicker.js +80 -86
- package/dist/es/components/Dialog.js +68 -24
- package/dist/es/components/DraggableModal.js +19 -4
- package/dist/es/components/Drawer.js +18 -2
- package/dist/es/components/Dropdown.js +1 -3
- package/dist/es/components/InspectorSection.js +25 -5
- package/dist/es/components/LoadingOverlay.js +5 -3
- package/dist/es/components/Menus/Menus.js +28 -9
- package/dist/es/components/Menus/Shortcut.js +18 -3
- package/dist/es/components/Menus/Submenu.js +28 -7
- package/dist/es/components/MultiValueInput.js +6 -3
- package/dist/es/components/NavDropdown.js +23 -3
- package/dist/es/components/RadioButton.js +19 -2
- package/dist/es/components/RelativeDate.js +17 -2
- package/dist/es/components/Resizer/Resizer.js +90 -78
- package/dist/es/components/Resizer/ResizerButton.js +11 -7
- package/dist/es/components/RichText/RichText.js +2 -3
- package/dist/es/components/RichText/RichTextField.js +2 -3
- package/dist/es/components/SaveStatus.js +31 -5
- package/dist/es/components/SelectField.js +17 -2
- package/dist/es/components/SelectedItemsBox.js +5 -2
- package/dist/es/components/StyledModal.js +17 -2
- package/dist/es/components/SystemUserAvatar.js +17 -3
- package/dist/es/components/TextField.js +19 -2
- package/dist/es/components/TextFieldContainer.js +22 -2
- package/dist/es/components/TextFieldError.js +19 -2
- package/dist/es/components/TextFieldGroupContainer.js +19 -2
- package/dist/es/components/Tooltip.js +4 -3
- package/dist/es/components/icons/add-author.js +20 -2
- package/dist/es/components/icons/add-comment.js +22 -2
- package/dist/es/components/icons/add-institution.js +17 -2
- package/dist/es/components/icons/add-new.js +4 -2
- package/dist/es/components/icons/add-outline.js +5 -2
- package/dist/es/components/icons/add-user.js +5 -2
- package/dist/es/components/icons/add.js +5 -2
- package/dist/es/components/icons/added.js +4 -2
- package/dist/es/components/icons/affiliation-placeholder.js +36 -2
- package/dist/es/components/icons/affiliation.js +4 -2
- package/dist/es/components/icons/alert.js +3 -2
- package/dist/es/components/icons/arrow-down-circle.js +4 -2
- package/dist/es/components/icons/arrow-down.js +3 -2
- package/dist/es/components/icons/arrow-left.js +3 -2
- package/dist/es/components/icons/arrow-up.js +3 -2
- package/dist/es/components/icons/attach.js +18 -2
- package/dist/es/components/icons/attention-blue.js +7 -2
- package/dist/es/components/icons/attention-green.js +4 -2
- package/dist/es/components/icons/attention-orange.js +9 -2
- package/dist/es/components/icons/attention-red.js +7 -2
- package/dist/es/components/icons/author-placeholder.js +43 -2
- package/dist/es/components/icons/avatar.js +5 -2
- package/dist/es/components/icons/book.js +19 -2
- package/dist/es/components/icons/circle-tick-animation.js +4 -2
- package/dist/es/components/icons/citation-count.js +3 -2
- package/dist/es/components/icons/comment-reply.js +3 -2
- package/dist/es/components/icons/comment-resolve.js +18 -2
- package/dist/es/components/icons/comment.js +22 -2
- package/dist/es/components/icons/corresponding-author.js +9 -2
- package/dist/es/components/icons/delete-solid.js +3 -2
- package/dist/es/components/icons/deleted.js +8 -2
- package/dist/es/components/icons/dots.js +20 -2
- package/dist/es/components/icons/draggable-icon.js +10 -2
- package/dist/es/components/icons/edit-attrs-tracking.js +4 -2
- package/dist/es/components/icons/edit.js +3 -2
- package/dist/es/components/icons/file-audio.js +20 -2
- package/dist/es/components/icons/file-code.js +20 -2
- package/dist/es/components/icons/file-compressed.js +27 -2
- package/dist/es/components/icons/file-corrupted.js +21 -2
- package/dist/es/components/icons/file-document.js +21 -2
- package/dist/es/components/icons/file-figure.js +20 -2
- package/dist/es/components/icons/file-graphical-abstract.js +5 -2
- package/dist/es/components/icons/file-image.js +3 -2
- package/dist/es/components/icons/file-latex-icon.js +22 -2
- package/dist/es/components/icons/file-main-document.js +7 -2
- package/dist/es/components/icons/file-pdf.js +19 -2
- package/dist/es/components/icons/file-table.js +18 -2
- package/dist/es/components/icons/file-unknown.js +19 -2
- package/dist/es/components/icons/file-video.js +18 -2
- package/dist/es/components/icons/handle-inspector.js +3 -2
- package/dist/es/components/icons/handle-outline.js +8 -2
- package/dist/es/components/icons/help.js +5 -2
- package/dist/es/components/icons/image-default.js +6 -2
- package/dist/es/components/icons/image-left.js +6 -2
- package/dist/es/components/icons/image-right.js +6 -2
- package/dist/es/components/icons/link.js +4 -2
- package/dist/es/components/icons/lock.js +6 -2
- package/dist/es/components/icons/logout.js +3 -2
- package/dist/es/components/icons/manuscript.js +21 -2
- package/dist/es/components/icons/outline-block-quote.js +5 -2
- package/dist/es/components/icons/outline-code.js +4 -2
- package/dist/es/components/icons/outline-embed.js +4 -2
- package/dist/es/components/icons/outline-equation.js +3 -2
- package/dist/es/components/icons/outline-figure.js +9 -2
- package/dist/es/components/icons/outline-manuscript.js +6 -2
- package/dist/es/components/icons/outline-ordered-list.js +3 -2
- package/dist/es/components/icons/outline-paragraph.js +3 -2
- package/dist/es/components/icons/outline-pull-quote.js +5 -2
- package/dist/es/components/icons/outline-section.js +3 -2
- package/dist/es/components/icons/outline-table.js +5 -2
- package/dist/es/components/icons/outline-unordered-list.js +5 -2
- package/dist/es/components/icons/plus.js +19 -2
- package/dist/es/components/icons/profile-avatar.js +3 -2
- package/dist/es/components/icons/role-annotating.js +5 -2
- package/dist/es/components/icons/role-reading.js +7 -2
- package/dist/es/components/icons/save-status-offline.js +20 -2
- package/dist/es/components/icons/save-status-saved.js +19 -2
- package/dist/es/components/icons/save-status-saving.js +21 -2
- package/dist/es/components/icons/scroll.js +7 -2
- package/dist/es/components/icons/search.js +19 -2
- package/dist/es/components/icons/section-category.js +18 -2
- package/dist/es/components/icons/slider-off.js +4 -2
- package/dist/es/components/icons/slider-on.js +4 -2
- package/dist/es/components/icons/system-user-avatar.js +6 -2
- package/dist/es/components/icons/task-step-done.js +19 -2
- package/dist/es/components/icons/tick.js +3 -2
- package/dist/es/components/icons/toolbar-bold.js +3 -2
- package/dist/es/components/icons/toolbar-citation.js +3 -2
- package/dist/es/components/icons/toolbar-code.js +4 -2
- package/dist/es/components/icons/toolbar-equation.js +3 -2
- package/dist/es/components/icons/toolbar-figure.js +3 -2
- package/dist/es/components/icons/toolbar-indent.js +8 -2
- package/dist/es/components/icons/toolbar-italic.js +3 -2
- package/dist/es/components/icons/toolbar-ordered-list.js +3 -2
- package/dist/es/components/icons/toolbar-subscript.js +3 -2
- package/dist/es/components/icons/toolbar-superscript.js +3 -2
- package/dist/es/components/icons/toolbar-symbol.js +3 -2
- package/dist/es/components/icons/toolbar-table.js +3 -2
- package/dist/es/components/icons/toolbar-underline.js +3 -2
- package/dist/es/components/icons/toolbar-unindent.js +8 -2
- package/dist/es/components/icons/toolbar-unordered-list.js +3 -2
- package/dist/es/components/icons/triangle-collapsed.js +3 -2
- package/dist/es/components/icons/triangle-expanded.js +3 -2
- package/dist/es/components/icons/upload.js +5 -2
- package/dist/es/components/icons/vertical-ellipsis.js +5 -2
- package/dist/es/components/icons/x.js +4 -2
- package/dist/es/hooks/use-scroll-detection.js +2 -2
- package/dist/es/lib/capabilities.js +5 -6
- package/dist/es/lib/files.js +14 -14
- package/dist/types/components/AlertMessage.d.ts +13 -14
- package/dist/types/components/AutoSaveInput.d.ts +14 -1
- package/dist/types/components/Badge.d.ts +1 -2
- package/dist/types/components/Button.d.ts +80 -30
- package/dist/types/components/Checkbox.d.ts +6 -5
- package/dist/types/components/DatePicker/CalendarDatePicker.d.ts +18 -19
- package/dist/types/components/Dialog.d.ts +14 -3
- package/dist/types/components/Dropdown.d.ts +6 -9
- package/dist/types/components/Form.d.ts +4 -4
- package/dist/types/components/Inspector.d.ts +10 -1720
- package/dist/types/components/InspectorSection.d.ts +10 -35
- package/dist/types/components/Menus/Shortcut.d.ts +1 -1
- package/dist/types/components/Menus/Submenu.d.ts +5 -5
- package/dist/types/components/NavDropdown.d.ts +19 -26
- package/dist/types/components/RadioButton.d.ts +1 -1
- package/dist/types/components/Resizer/Resizer.d.ts +23 -1
- package/dist/types/components/Resizer/ResizerButton.d.ts +7 -1
- package/dist/types/components/Resizer/ResizerButtonInner.d.ts +4 -5
- package/dist/types/components/Resizer/ResizerInner.d.ts +4 -5
- package/dist/types/components/Sidebar.d.ts +2 -3
- package/dist/types/components/StyledModal.d.ts +30 -43
- package/dist/types/components/Text.d.ts +4 -5
- package/dist/types/components/TextField.d.ts +6 -6
- package/dist/types/components/TextFieldError.d.ts +1 -1
- package/dist/types/components/Tooltip.d.ts +1 -1
- package/dist/types/components/icons/add-author.d.ts +2 -1
- package/dist/types/components/icons/affiliation-placeholder.d.ts +2 -1
- package/dist/types/components/icons/author-placeholder.d.ts +2 -1
- package/dist/types/components/icons/section-category.d.ts +2 -1
- package/dist/types/components/icons/x.d.ts +2 -1
- package/dist/types/hooks/use-dropdown.d.ts +1 -1
- package/dist/types/hooks/use-menus.d.ts +1 -1
- package/dist/types/lib/capabilities.d.ts +3 -2
- package/dist/types/lib/files.d.ts +3 -3
- package/package.json +23 -25
|
@@ -1,4 +1,19 @@
|
|
|
1
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
|
+
*/
|
|
2
17
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
18
|
if (k2 === undefined) k2 = k;
|
|
4
19
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -22,10 +37,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
37
|
__setModuleDefault(result, mod);
|
|
23
38
|
return result;
|
|
24
39
|
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
25
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
44
|
exports.AlertMessage = exports.AlertMessageType = exports.TextButton = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
45
|
+
const react_1 = __importDefault(require("react"));
|
|
46
|
+
const react_sizeme_1 = require("react-sizeme");
|
|
29
47
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
30
48
|
const Button_1 = require("./Button");
|
|
31
49
|
const icons_1 = require("./icons");
|
|
@@ -46,6 +64,12 @@ const buttonStyles = (0, styled_components_1.css) `
|
|
|
46
64
|
exports.TextButton = (0, styled_components_1.default)(Button_1.IconTextButton) `
|
|
47
65
|
${buttonStyles}
|
|
48
66
|
`;
|
|
67
|
+
const CloseIconButton = (0, styled_components_1.default)(Button_1.IconButton).attrs({
|
|
68
|
+
defaultColor: true,
|
|
69
|
+
size: 16,
|
|
70
|
+
}) `
|
|
71
|
+
${buttonStyles}
|
|
72
|
+
`;
|
|
49
73
|
const InformativeIcon = styled_components_1.default.div `
|
|
50
74
|
height: 24px;
|
|
51
75
|
margin-right: ${(props) => props.theme.grid.unit * 3}px;
|
|
@@ -117,16 +141,28 @@ const alertContainers = {
|
|
|
117
141
|
info: InfoAlertContainer,
|
|
118
142
|
warning: WarningAlertContainer,
|
|
119
143
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
144
|
+
class AlertMessage extends react_1.default.Component {
|
|
145
|
+
constructor() {
|
|
146
|
+
super(...arguments);
|
|
147
|
+
this.state = {
|
|
148
|
+
isOpen: true,
|
|
149
|
+
};
|
|
150
|
+
this.handleClose = () => {
|
|
151
|
+
this.setState({ isOpen: false });
|
|
152
|
+
};
|
|
127
153
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
154
|
+
render() {
|
|
155
|
+
const { hideCloseButton, dismissButton, children, type } = this.props;
|
|
156
|
+
const { isOpen } = this.state;
|
|
157
|
+
const AlertContainer = alertContainers[type];
|
|
158
|
+
const AlertIcon = alertIcons[type];
|
|
159
|
+
return (isOpen && (react_1.default.createElement(react_sizeme_1.SizeMe, null, () => (react_1.default.createElement(AlertContainer, { className: 'alert-message' },
|
|
160
|
+
react_1.default.createElement(InnerContainer, null,
|
|
161
|
+
react_1.default.createElement(InformativeIcon, null, react_1.default.createElement(AlertIcon, null)),
|
|
162
|
+
react_1.default.createElement(TextContainer, null, children),
|
|
163
|
+
dismissButton && (react_1.default.createElement(exports.TextButton, { onClick: dismissButton.action
|
|
164
|
+
? dismissButton.action
|
|
165
|
+
: this.handleClose }, dismissButton.text))))))));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
132
168
|
exports.AlertMessage = AlertMessage;
|
|
@@ -1,36 +1,59 @@
|
|
|
1
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
|
+
};
|
|
2
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
21
|
exports.AutoSaveInput = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
field.onChange(event);
|
|
23
|
-
if (saveOn === 'change') {
|
|
24
|
-
handleSubmit();
|
|
25
|
-
}
|
|
26
|
-
}, [field, saveOn, handleSubmit]);
|
|
27
|
-
(0, react_1.useEffect)(() => {
|
|
28
|
-
return () => {
|
|
29
|
-
if (focused) {
|
|
30
|
-
handleSubmit();
|
|
22
|
+
const react_1 = __importDefault(require("react"));
|
|
23
|
+
class AutoSaveInput extends react_1.default.Component {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.state = {
|
|
27
|
+
focused: false,
|
|
28
|
+
};
|
|
29
|
+
this.handleSubmit = () => {
|
|
30
|
+
window.setTimeout(this.props.form.submitForm, 10);
|
|
31
|
+
};
|
|
32
|
+
this.handleFocus = () => {
|
|
33
|
+
this.setState({ focused: true });
|
|
34
|
+
};
|
|
35
|
+
this.handleBlur = (event) => {
|
|
36
|
+
this.setState({ focused: false });
|
|
37
|
+
this.props.field.onBlur(event);
|
|
38
|
+
if (this.props.saveOn === 'blur') {
|
|
39
|
+
this.handleSubmit();
|
|
31
40
|
}
|
|
32
41
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
this.handleChange = (event) => {
|
|
43
|
+
this.props.field.onChange(event);
|
|
44
|
+
if (this.props.saveOn === 'change') {
|
|
45
|
+
this.handleSubmit();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
componentWillUnmount() {
|
|
50
|
+
if (this.state.focused) {
|
|
51
|
+
this.handleSubmit();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
const { component: Component, field, placeholder, disabled, testId, } = this.props;
|
|
56
|
+
return (react_1.default.createElement(Component, Object.assign({}, field, { placeholder: placeholder, disabled: disabled, checked: !!field.value, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, "data-testid": testId && `${testId}__input`, "aria-invalid": this.props.isInvalid || undefined })));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
36
59
|
exports.AutoSaveInput = AutoSaveInput;
|
|
@@ -1,11 +1,48 @@
|
|
|
1
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
|
+
};
|
|
2
40
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
41
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
42
|
};
|
|
5
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
44
|
exports.Avatar = void 0;
|
|
7
|
-
const
|
|
8
|
-
const react_1 = require("react");
|
|
45
|
+
const react_1 = __importStar(require("react"));
|
|
9
46
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
47
|
const icons_1 = require("./icons");
|
|
11
48
|
const AvatarContainer = styled_components_1.default.div `
|
|
@@ -36,6 +73,6 @@ const Avatar = (props) => {
|
|
|
36
73
|
const handleSrcError = (0, react_1.useCallback)(() => {
|
|
37
74
|
setSrcError(true);
|
|
38
75
|
}, []);
|
|
39
|
-
return (
|
|
76
|
+
return (react_1.default.createElement(AvatarContainer, { opacity: props.opacity || 1 }, props.src && !srcError ? (react_1.default.createElement(RoundedImage, { src: props.src, size: props.size, onError: handleSrcError })) : (react_1.default.createElement(StyledAvatar, { height: props.size, width: props.size, color: props.color }))));
|
|
40
77
|
};
|
|
41
78
|
exports.Avatar = Avatar;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2024 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
|
+
*/
|
|
2
17
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
18
|
if (k2 === undefined) k2 = k;
|
|
4
19
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -27,7 +42,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
42
|
};
|
|
28
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
44
|
exports.ContextMenu = void 0;
|
|
30
|
-
const
|
|
45
|
+
const react_1 = __importDefault(require("react"));
|
|
31
46
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
47
|
const Button_1 = require("./Button");
|
|
33
48
|
const Icons = __importStar(require("./icons"));
|
|
@@ -49,8 +64,10 @@ const icons = Object.entries(Icons).reduce((acc, [name, IconComponent]) => {
|
|
|
49
64
|
acc[iconName] = IconComponent;
|
|
50
65
|
return acc;
|
|
51
66
|
}, {});
|
|
52
|
-
const ContextMenu = ({ actions }) => (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
67
|
+
const ContextMenu = ({ actions }) => (react_1.default.createElement(Button_1.IconButtonGroup, { size: 32 }, actions.map((action) => {
|
|
68
|
+
const Icon = icons[action.icon];
|
|
69
|
+
return (react_1.default.createElement(ContextMenuIconButton, { key: action.icon, "data-tooltip-id": action.icon, onClick: action.action, className: action.selected ? 'selected' : '' },
|
|
70
|
+
react_1.default.createElement(Icon, { width: 18, height: 18 }),
|
|
71
|
+
react_1.default.createElement(Tooltip_1.Tooltip, { id: action.icon, place: "bottom" }, action.label)));
|
|
72
|
+
})));
|
|
56
73
|
exports.ContextMenu = ContextMenu;
|
|
@@ -1,112 +1,95 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CalendarDatePicker = exports.calendarDatePickerDefaultDateFormat = exports.calendarPotentialDueDate = void 0;
|
|
7
|
-
|
|
8
|
-
require('react-day-picker/style.css');
|
|
9
|
-
const react_1 = require("@headlessui/react");
|
|
29
|
+
exports.CalendarDatePicker = exports.calendarDatePickerDefaultDateFormat = exports.calendarPotentialDueDate = exports.calendarGetDay = void 0;
|
|
30
|
+
require("react-modern-calendar-datepicker/lib/DatePicker.css");
|
|
10
31
|
const date_fns_1 = require("date-fns");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
32
|
+
const react_1 = __importStar(require("react"));
|
|
33
|
+
const react_modern_calendar_datepicker_1 = __importDefault(require("react-modern-calendar-datepicker"));
|
|
13
34
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
14
35
|
const Dialog_1 = require("../Dialog");
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
36
|
+
const calendarGetDay = (date) => ({
|
|
37
|
+
year: date.getFullYear(),
|
|
38
|
+
month: date.getMonth() + 1,
|
|
39
|
+
day: date.getDate(),
|
|
40
|
+
});
|
|
41
|
+
exports.calendarGetDay = calendarGetDay;
|
|
42
|
+
const calendarPotentialDueDate = (stepDueDate, dueDate, submissionDueDate) => {
|
|
19
43
|
const duration = (0, date_fns_1.intervalToDuration)({
|
|
20
44
|
start: stepDueDate,
|
|
21
|
-
end:
|
|
45
|
+
end: new Date(`${dueDate.year}-${dueDate.month < 10 ? `0${dueDate.month}` : dueDate.month}-${dueDate.day < 10 ? `0${dueDate.day}` : dueDate.day}`),
|
|
22
46
|
});
|
|
23
47
|
return (0, date_fns_1.add)(submissionDueDate, duration);
|
|
24
48
|
};
|
|
25
49
|
exports.calendarPotentialDueDate = calendarPotentialDueDate;
|
|
26
50
|
const calendarDatePickerDefaultDateFormat = 'd MMM, EEEE';
|
|
27
51
|
exports.calendarDatePickerDefaultDateFormat = calendarDatePickerDefaultDateFormat;
|
|
28
|
-
const CalendarDatePicker = ({ handleDateChange, originalDueDate, currentDueDate, dialogConfigs, primaryButtonTitle = 'Reschedule', secondaryButtonTitle = 'Cancel',
|
|
52
|
+
const CalendarDatePicker = ({ Button, handleDateChange, originalDueDate, currentDueDate, datePickerConfigs, dialogConfigs, primaryButtonTitle = 'Reschedule', secondaryButtonTitle = 'Cancel', }) => {
|
|
53
|
+
datePickerConfigs = Object.assign({ position: 'bottom', color: '#f2fbfc', selectedDayClassName: 'selected-day', calendarClassName: 'responsive-calendar' }, datePickerConfigs);
|
|
29
54
|
const dialog = Object.assign({}, dialogConfigs, {
|
|
30
55
|
header: 'Change the task due date?',
|
|
31
56
|
});
|
|
32
|
-
const [
|
|
33
|
-
const [
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
if (potentialNewDate) {
|
|
37
|
-
handleDateChange(potentialNewDate);
|
|
38
|
-
setSelectedDay(potentialNewDate);
|
|
39
|
-
}
|
|
57
|
+
const [dueDate, setDueDate] = (0, react_1.useState)();
|
|
58
|
+
const [toggleDialog, setToggleDialog] = (0, react_1.useState)(false);
|
|
59
|
+
const onConfirmClick = (0, react_1.useCallback)(() => {
|
|
60
|
+
handleDateChange(dueDate);
|
|
40
61
|
setToggleDialog(false);
|
|
41
|
-
}, [
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
} })] }));
|
|
62
|
+
}, [dueDate, setToggleDialog, handleDateChange]);
|
|
63
|
+
const formattedDueDate = (0, react_1.useMemo)(() => dueDate &&
|
|
64
|
+
(0, date_fns_1.format)(new Date(dueDate.year, dueDate.month, dueDate.day), calendarDatePickerDefaultDateFormat), [dueDate]);
|
|
65
|
+
const formattedPotentialDueDate = (0, react_1.useMemo)(() => dueDate &&
|
|
66
|
+
(0, date_fns_1.format)(calendarPotentialDueDate(currentDueDate, dueDate, originalDueDate), calendarDatePickerDefaultDateFormat), [originalDueDate, currentDueDate, dueDate]);
|
|
67
|
+
const onDatePickerChange = (0, react_1.useCallback)((date) => {
|
|
68
|
+
setDueDate(date);
|
|
69
|
+
setToggleDialog(true);
|
|
70
|
+
const button = document.querySelector('.DatePicker button');
|
|
71
|
+
button.blur();
|
|
72
|
+
}, []);
|
|
73
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
74
|
+
react_1.default.createElement(Calendar, null,
|
|
75
|
+
react_1.default.createElement(react_modern_calendar_datepicker_1.default, { value: calendarGetDay(currentDueDate), onChange: onDatePickerChange, calendarPopperPosition: datePickerConfigs.position, colorPrimary: datePickerConfigs.color, calendarSelectedDayClassName: datePickerConfigs.selectedDayClassName, calendarClassName: datePickerConfigs.calendarClassName, renderInput: Button })),
|
|
76
|
+
react_1.default.createElement(Dialog_1.Dialog, { isOpen: toggleDialog, category: Dialog_1.Category.confirmation, header: dialog.header, message: react_1.default.createElement(react_1.default.Fragment, null,
|
|
77
|
+
react_1.default.createElement(UpdatedDueDate, null, formattedDueDate),
|
|
78
|
+
dialog.dueDateMessage && (react_1.default.createElement(DueDateMessage, null, dialog.dueDateMessage)),
|
|
79
|
+
react_1.default.createElement(Value, null,
|
|
80
|
+
react_1.default.createElement(StrikeDueDate, { as: 'del' }, (0, date_fns_1.format)(originalDueDate, calendarDatePickerDefaultDateFormat)),
|
|
81
|
+
formattedPotentialDueDate)), actions: {
|
|
82
|
+
primary: {
|
|
83
|
+
action: onConfirmClick,
|
|
84
|
+
title: primaryButtonTitle,
|
|
85
|
+
},
|
|
86
|
+
secondary: {
|
|
87
|
+
action: () => setToggleDialog(false),
|
|
88
|
+
title: secondaryButtonTitle,
|
|
89
|
+
},
|
|
90
|
+
} })));
|
|
72
91
|
};
|
|
73
92
|
exports.CalendarDatePicker = CalendarDatePicker;
|
|
74
|
-
const CalendarPopoverButton = (0, styled_components_1.default)(react_1.PopoverButton) `
|
|
75
|
-
/* Add styles similar to your original PrimaryButton or specific needs */
|
|
76
|
-
border: 1px solid
|
|
77
|
-
${(props) => props.theme.colors.button.default.border.default};
|
|
78
|
-
background: ${(props) => props.theme.colors.button.default.background.default};
|
|
79
|
-
color: ${(props) => props.theme.colors.button.default.color.default};
|
|
80
|
-
padding: 10px 15px;
|
|
81
|
-
border-radius: ${(props) => props.theme.grid.radius.small};
|
|
82
|
-
cursor: pointer;
|
|
83
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
84
|
-
font-size: ${(props) => props.theme.font.size.medium};
|
|
85
|
-
|
|
86
|
-
&:hover {
|
|
87
|
-
background: ${(props) => props.theme.colors.button.default.background.hover};
|
|
88
|
-
}
|
|
89
|
-
`;
|
|
90
|
-
const CalendarPopoverPanel = (0, styled_components_1.default)(react_1.PopoverPanel) `
|
|
91
|
-
background: ${(props) => props.theme.colors.background.primary};
|
|
92
|
-
border: 1px solid ${(props) => props.theme.colors.border.secondary};
|
|
93
|
-
border-radius: ${(props) => props.theme.grid.radius.default};
|
|
94
|
-
box-shadow: ${(props) => props.theme.shadow.dropShadow};
|
|
95
|
-
z-index: 10; /* Ensure it's above other content */
|
|
96
|
-
margin-top: 4px;
|
|
97
|
-
|
|
98
|
-
/* Target react-day-picker internal classes for styling */
|
|
99
|
-
.rdp {
|
|
100
|
-
--rdp-cell-size: 36px; /* Adjust size */
|
|
101
|
-
--rdp-accent-color: ${(props) => props.theme.colors.brand.default};
|
|
102
|
-
--rdp-background-color: ${(props) => props.theme.colors.brand.xlight};
|
|
103
|
-
/* Add more overrides as needed */
|
|
104
|
-
margin: ${(props) => props.theme.grid.unit * 2}px; /* Add some padding */
|
|
105
|
-
}
|
|
106
|
-
.rdp-day_selected {
|
|
107
|
-
font-weight: bold;
|
|
108
|
-
}
|
|
109
|
-
`;
|
|
110
93
|
const StrikeDueDate = (0, styled_components_1.default)(Dialog_1.MessageContainer) `
|
|
111
94
|
margin: 0;
|
|
112
95
|
min-height: min-content;
|
|
@@ -119,6 +102,41 @@ const Value = styled_components_1.default.div `
|
|
|
119
102
|
align-items: center;
|
|
120
103
|
line-height: 1;
|
|
121
104
|
`;
|
|
105
|
+
const Calendar = styled_components_1.default.div `
|
|
106
|
+
flex: 1;
|
|
107
|
+
|
|
108
|
+
.DatePicker {
|
|
109
|
+
width: 100%;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.DatePicker__calendarContainer {
|
|
113
|
+
position: absolute;
|
|
114
|
+
top: unset;
|
|
115
|
+
left: unset !important;
|
|
116
|
+
right: 0 !important;
|
|
117
|
+
transform: unset !important;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.Calendar__weekDay {
|
|
121
|
+
color: #e6e6e6;
|
|
122
|
+
font-size: ${(props) => props.theme.font.size.normal};
|
|
123
|
+
line-height: ${(props) => props.theme.font.lineHeight.large};
|
|
124
|
+
font-weight: ${(props) => props.theme.font.weight.medium};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.Calendar__day:not(.-blank):not(.-selected):hover {
|
|
128
|
+
background: #f2fbfc !important;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.Calendar__day.-today:hover::after {
|
|
132
|
+
opacity: 0.5 !important;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.selected-day {
|
|
136
|
+
color: ${(props) => props.theme.colors.text.primary} !important;
|
|
137
|
+
border: 1px solid ${(props) => props.theme.colors.border.primary} !important;
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
122
140
|
const UpdatedDueDate = styled_components_1.default.div `
|
|
123
141
|
background: ${(props) => props.theme.colors.background.secondary};
|
|
124
142
|
color: ${(props) => props.theme.colors.text.primary};
|
|
@@ -1,4 +1,19 @@
|
|
|
1
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
|
+
*/
|
|
2
17
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
18
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
19
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -13,8 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
28
|
};
|
|
14
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
30
|
exports.Dialog = exports.Category = exports.MessageContainer = exports.DialogModalBody = void 0;
|
|
16
|
-
const
|
|
17
|
-
const react_1 = require("react");
|
|
31
|
+
const react_1 = __importDefault(require("react"));
|
|
18
32
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
19
33
|
const Button_1 = require("./Button");
|
|
20
34
|
const icons_1 = require("./icons");
|
|
@@ -71,26 +85,56 @@ var Category;
|
|
|
71
85
|
Category["confirmation"] = "confirmation";
|
|
72
86
|
Category["warning"] = "warning";
|
|
73
87
|
})(Category = exports.Category || (exports.Category = {}));
|
|
74
|
-
const PrimaryAction = (props) => props.isDestructive ? (props.hasForm ? (
|
|
75
|
-
const SecondaryAction = (props) => (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
};
|
|
88
|
+
const PrimaryAction = (props) => props.isDestructive ? (props.hasForm ? (react_1.default.createElement(Button_1.PrimaryButton, { danger: true, disabled: props.disabled, form: "formDialog", type: "submit" }, props.title)) : (react_1.default.createElement(Button_1.PrimaryButton, { danger: true, disabled: props.disabled, onClick: props.action, autoFocus: true }, props.title))) : props.hasForm ? (react_1.default.createElement(Button_1.PrimaryButton, { disabled: props.disabled, form: "formDialog", type: "submit" }, props.title)) : (react_1.default.createElement(Button_1.PrimaryButton, { disabled: props.disabled, onClick: props.action, autoFocus: true }, props.title));
|
|
89
|
+
const SecondaryAction = (props) => (react_1.default.createElement(Button_1.SecondaryButton, { disabled: props.disabled, onClick: props.action }, props.title));
|
|
90
|
+
class Dialog extends react_1.default.Component {
|
|
91
|
+
constructor() {
|
|
92
|
+
super(...arguments);
|
|
93
|
+
this.state = {
|
|
94
|
+
primaryActionDisabled: true,
|
|
95
|
+
};
|
|
96
|
+
this.renderButtons = (props, disabled) => (react_1.default.createElement(ButtonsContainer, null, props.actions.secondary ? (!props.actions.primary.isDestructive ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
97
|
+
react_1.default.createElement(SecondaryAction, { action: props.actions.secondary.action, hasForm: !!this.props.confirmFieldText, title: props.actions.secondary.title }),
|
|
98
|
+
react_1.default.createElement(PrimaryAction, { action: props.actions.primary.action, disabled: disabled, title: props.actions.primary.title || 'Dismiss' }))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
99
|
+
react_1.default.createElement(PrimaryAction, { action: props.actions.primary.action, disabled: disabled, isDestructive: true, hasForm: !!this.props.confirmFieldText, title: props.actions.primary.title || 'Dismiss' }),
|
|
100
|
+
react_1.default.createElement(SecondaryAction, { action: props.actions.secondary.action, title: props.actions.secondary.title })))) : (react_1.default.createElement(PrimaryAction, { action: props.actions.primary.action, disabled: disabled, isDestructive: props.actions.primary.isDestructive, hasForm: !!this.props.confirmFieldText, title: props.actions.primary.title || 'Dismiss' }))));
|
|
101
|
+
this.checkInputValue = (event) => {
|
|
102
|
+
const testingVal = this.props.confirmFieldText && this.props.confirmFieldText.toUpperCase();
|
|
103
|
+
const target = event.target;
|
|
104
|
+
const newVal = target.value.toUpperCase();
|
|
105
|
+
this.setDisabledBtnState(newVal !== testingVal);
|
|
106
|
+
};
|
|
107
|
+
this.setDisabledBtnState = (state) => {
|
|
108
|
+
this.setState({ primaryActionDisabled: state });
|
|
109
|
+
};
|
|
110
|
+
this.handleSubmit = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
const { primaryActionDisabled } = this.state;
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
if (!primaryActionDisabled) {
|
|
114
|
+
this.props.actions.primary.action();
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
componentDidMount() {
|
|
119
|
+
this.setDisabledBtnState(!!this.props.confirmFieldText);
|
|
120
|
+
}
|
|
121
|
+
render() {
|
|
122
|
+
const { actions, isOpen, header, message, category, children, confirmFieldText, className, } = this.props;
|
|
123
|
+
const { primaryActionDisabled } = this.state;
|
|
124
|
+
return (react_1.default.createElement(StyledModal_1.StyledModal, { isOpen: isOpen, onRequestClose: actions.onClose, shouldCloseOnOverlayClick: true, className: className },
|
|
125
|
+
react_1.default.createElement(exports.DialogModalBody, null,
|
|
126
|
+
react_1.default.createElement(HeaderContainer, null,
|
|
127
|
+
category === Category.error && (react_1.default.createElement(Icon, null,
|
|
128
|
+
react_1.default.createElement(icons_1.AttentionRedIcon, null))),
|
|
129
|
+
category === Category.warning && (react_1.default.createElement(Icon, null,
|
|
130
|
+
react_1.default.createElement(icons_1.AttentionOrangeIcon, null))),
|
|
131
|
+
header),
|
|
132
|
+
react_1.default.createElement(exports.MessageContainer, null,
|
|
133
|
+
message,
|
|
134
|
+
confirmFieldText && (react_1.default.createElement("form", { id: "formDialog", onSubmit: this.handleSubmit },
|
|
135
|
+
react_1.default.createElement(ConfirmationTextField, { autoFocus: true, onChange: this.checkInputValue, placeholder: 'Please type: ' + confirmFieldText, required: true }))),
|
|
136
|
+
children),
|
|
137
|
+
this.renderButtons(this.props, primaryActionDisabled))));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
96
140
|
exports.Dialog = Dialog;
|