@manuscripts/style-guide 1.13.8-LEAN-3450.0 → 1.13.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.
|
@@ -41,7 +41,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
41
41
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
42
|
};
|
|
43
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.Label = exports.Block = exports.BlockItem = exports.StyleBlock = exports.ListContainer = exports.bulletListContextMenu = exports.orderedListContextMenu = exports.Menus = void 0;
|
|
44
|
+
exports.ColumnChangeWarningDialog = exports.Label = exports.Block = exports.BlockItem = exports.StyleBlock = exports.ListContainer = exports.bulletListContextMenu = exports.orderedListContextMenu = exports.Menus = void 0;
|
|
45
45
|
const react_1 = __importStar(require("react"));
|
|
46
46
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
47
47
|
const Dialog_1 = require("../Dialog");
|
|
@@ -81,21 +81,12 @@ const Menus = ({ menus, innerRef, handleClick, }) => {
|
|
|
81
81
|
return (react_1.default.createElement(Submenu_1.Submenu, { key: `${index}-${sindex}`, menu: submenu, handleClick: (i) => handleClick([index, sindex, ...i]), setColumnMenu: setColumnMenu }));
|
|
82
82
|
})))));
|
|
83
83
|
}),
|
|
84
|
-
react_1.default.createElement(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
title: 'Ok',
|
|
93
|
-
},
|
|
94
|
-
secondary: {
|
|
95
|
-
action: () => setColumnMenu(undefined),
|
|
96
|
-
title: 'Cancel',
|
|
97
|
-
},
|
|
98
|
-
} })));
|
|
84
|
+
react_1.default.createElement(exports.ColumnChangeWarningDialog, { isOpen: !!columnMenu, primaryAction: () => {
|
|
85
|
+
if (columnMenu === null || columnMenu === void 0 ? void 0 : columnMenu.run) {
|
|
86
|
+
columnMenu.run();
|
|
87
|
+
setColumnMenu(undefined);
|
|
88
|
+
}
|
|
89
|
+
}, secondaryAction: () => setColumnMenu(undefined) })));
|
|
99
90
|
};
|
|
100
91
|
exports.Menus = Menus;
|
|
101
92
|
exports.orderedListContextMenu = [
|
|
@@ -151,3 +142,14 @@ exports.Label = styled_components_1.default.div `
|
|
|
151
142
|
font-style: normal;
|
|
152
143
|
color: ${(props) => (props.hide && 'white') || 'initial'};
|
|
153
144
|
`;
|
|
145
|
+
const ColumnChangeWarningDialog = ({ isOpen, primaryAction, secondaryAction }) => (react_1.default.createElement(Dialog_1.Dialog, { isOpen: isOpen, category: Dialog_1.Category.confirmation, header: "This change can't be tracked", message: "This column action won't be marked as chnage. Do you want to continue?", actions: {
|
|
146
|
+
primary: {
|
|
147
|
+
action: primaryAction,
|
|
148
|
+
title: 'Ok',
|
|
149
|
+
},
|
|
150
|
+
secondary: {
|
|
151
|
+
action: secondaryAction,
|
|
152
|
+
title: 'Cancel',
|
|
153
|
+
},
|
|
154
|
+
} }));
|
|
155
|
+
exports.ColumnChangeWarningDialog = ColumnChangeWarningDialog;
|
|
@@ -52,21 +52,12 @@ export const Menus = ({ menus, innerRef, handleClick, }) => {
|
|
|
52
52
|
return (React.createElement(Submenu, { key: `${index}-${sindex}`, menu: submenu, handleClick: (i) => handleClick([index, sindex, ...i]), setColumnMenu: setColumnMenu }));
|
|
53
53
|
})))));
|
|
54
54
|
}),
|
|
55
|
-
React.createElement(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
title: 'Ok',
|
|
64
|
-
},
|
|
65
|
-
secondary: {
|
|
66
|
-
action: () => setColumnMenu(undefined),
|
|
67
|
-
title: 'Cancel',
|
|
68
|
-
},
|
|
69
|
-
} })));
|
|
55
|
+
React.createElement(ColumnChangeWarningDialog, { isOpen: !!columnMenu, primaryAction: () => {
|
|
56
|
+
if (columnMenu === null || columnMenu === void 0 ? void 0 : columnMenu.run) {
|
|
57
|
+
columnMenu.run();
|
|
58
|
+
setColumnMenu(undefined);
|
|
59
|
+
}
|
|
60
|
+
}, secondaryAction: () => setColumnMenu(undefined) })));
|
|
70
61
|
};
|
|
71
62
|
export const orderedListContextMenu = [
|
|
72
63
|
{ items: ['1.', '2.', '3.'], type: 'order' },
|
|
@@ -121,3 +112,13 @@ export const Label = styled.div `
|
|
|
121
112
|
font-style: normal;
|
|
122
113
|
color: ${(props) => (props.hide && 'white') || 'initial'};
|
|
123
114
|
`;
|
|
115
|
+
export const ColumnChangeWarningDialog = ({ isOpen, primaryAction, secondaryAction }) => (React.createElement(Dialog, { isOpen: isOpen, category: Category.confirmation, header: "This change can't be tracked", message: "This column action won't be marked as chnage. Do you want to continue?", actions: {
|
|
116
|
+
primary: {
|
|
117
|
+
action: primaryAction,
|
|
118
|
+
title: 'Ok',
|
|
119
|
+
},
|
|
120
|
+
secondary: {
|
|
121
|
+
action: secondaryAction,
|
|
122
|
+
title: 'Cancel',
|
|
123
|
+
},
|
|
124
|
+
} }));
|
|
@@ -36,4 +36,9 @@ export declare const Block: import("styled-components").StyledComponent<"div", i
|
|
|
36
36
|
export declare const Label: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
37
37
|
hide?: boolean | undefined;
|
|
38
38
|
}, never>;
|
|
39
|
+
export declare const ColumnChangeWarningDialog: React.FC<{
|
|
40
|
+
isOpen: boolean;
|
|
41
|
+
primaryAction: () => void;
|
|
42
|
+
secondaryAction: () => void;
|
|
43
|
+
}>;
|
|
39
44
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/style-guide",
|
|
3
3
|
"description": "Shared components for Manuscripts applications",
|
|
4
|
-
"version": "1.13.8
|
|
4
|
+
"version": "1.13.8",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|