@voplus/morpho-workspace 1.0.0-dev45 → 1.0.0-dev47
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/es/components/ToolBar/index.d.ts +1 -0
- package/es/components/ToolBar/index.js +4 -2
- package/es/components/ToolBar/index.js.map +1 -1
- package/es/controls/DocumentStatusLabel/index.js +1 -1
- package/es/controls/DocumentStatusLabel/index.js.map +1 -1
- package/es/data/contexts/StoreContext/index.d.ts +3 -6
- package/es/data/contexts/StoreContext/index.js +3 -39
- package/es/data/contexts/StoreContext/index.js.map +1 -1
- package/es/modules/BoardView/components/TaskList/index.js.map +1 -1
- package/es/modules/BoardView/pages/BoardViewList/index.js +0 -2
- package/es/modules/BoardView/pages/BoardViewList/index.js.map +1 -1
- package/es/modules/calendar/components/TaskCard/index.d.ts +7 -0
- package/es/modules/calendar/components/TaskCard/index.js +25 -0
- package/es/modules/calendar/components/TaskCard/index.js.map +1 -0
- package/es/modules/calendar/components/TaskCard/index.less +13 -0
- package/es/modules/calendar/components/TaskCard/state.d.ts +16 -0
- package/es/modules/calendar/components/TaskCard/state.js +58 -0
- package/es/modules/calendar/components/TaskCard/state.js.map +1 -0
- package/es/modules/calendar/pages/CalendarMonth/index.js +14 -18
- package/es/modules/calendar/pages/CalendarMonth/index.js.map +1 -1
- package/es/modules/document/pages/DocumentListView/index.js +1 -1
- package/es/modules/document/pages/DocumentListView/index.js.map +1 -1
- package/es/modules/meeting/MeetingRoutes.d.ts +6 -0
- package/es/modules/meeting/MeetingRoutes.js +19 -6
- package/es/modules/meeting/MeetingRoutes.js.map +1 -1
- package/es/modules/meeting/components/AgendaList/AgendaItem/components/TaskList/index.js +4 -3
- package/es/modules/meeting/components/AgendaList/AgendaItem/components/TaskList/index.js.map +1 -1
- package/es/modules/meeting/components/AgendaList/AgendaItem/index.d.ts +2 -7
- package/es/modules/meeting/components/AgendaList/AgendaItem/index.js +17 -15
- package/es/modules/meeting/components/AgendaList/AgendaItem/index.js.map +1 -1
- package/es/modules/meeting/components/AgendaList/AgendaItem/state.d.ts +7 -0
- package/es/modules/meeting/components/AgendaList/AgendaItem/state.js.map +1 -1
- package/es/modules/meeting/components/AgendaList/index.js +25 -20
- package/es/modules/meeting/components/AgendaList/index.js.map +1 -1
- package/es/modules/meeting/components/MeetingDetail/index.js +4 -2
- package/es/modules/meeting/components/MeetingDetail/index.js.map +1 -1
- package/es/modules/meeting/components/MeetingHeader/index.js +18 -11
- package/es/modules/meeting/components/MeetingHeader/index.js.map +1 -1
- package/es/modules/meeting/components/MeetingItem/index.js +6 -5
- package/es/modules/meeting/components/MeetingItem/index.js.map +1 -1
- package/es/modules/meeting/components/MeetingQuickViewDialog/index.js +2 -1
- package/es/modules/meeting/components/MeetingQuickViewDialog/index.js.map +1 -1
- package/es/modules/meeting/components/NewMeetingForm/index.js.map +1 -1
- package/es/modules/meeting/pages/MeetingList/index.js +1 -1
- package/es/modules/meeting/pages/MeetingList/index.js.map +1 -1
- package/es/modules/meeting/pages/MeetingPrintView/index.d.ts +4 -0
- package/es/modules/meeting/pages/MeetingPrintView/index.js +54 -0
- package/es/modules/meeting/pages/MeetingPrintView/index.js.map +1 -0
- package/es/modules/meeting/pages/MeetingPrintView/index.less +0 -0
- package/es/modules/meeting/pages/MeetingTabView/index.js +4 -2
- package/es/modules/meeting/pages/MeetingTabView/index.js.map +1 -1
- package/es/modules/tasks/components/NewTaskForm/index.js.map +1 -1
- package/es/modules/tasks/components/SubTaskList/index.js +6 -14
- package/es/modules/tasks/components/SubTaskList/index.js.map +1 -1
- package/es/modules/tasks/components/SubTaskList/state.d.ts +1 -2
- package/es/modules/tasks/components/SubTaskList/state.js +1 -9
- package/es/modules/tasks/components/SubTaskList/state.js.map +1 -1
- package/es/modules/tasks/components/TaskDescription/index.js +9 -9
- package/es/modules/tasks/components/TaskDescription/index.js.map +1 -1
- package/es/modules/tasks/components/TaskDetail/index.js +2 -1
- package/es/modules/tasks/components/TaskDetail/index.js.map +1 -1
- package/es/modules/tasks/components/TaskItem/TaskItem.d.ts +1 -0
- package/es/modules/tasks/components/TaskItem/TaskItem.js +39 -25
- package/es/modules/tasks/components/TaskItem/TaskItem.js.map +1 -1
- package/es/modules/tasks/components/TaskItem/index.less +4 -5
- package/es/modules/tasks/components/TaskQuickViewDialog/index.js +2 -1
- package/es/modules/tasks/components/TaskQuickViewDialog/index.js.map +1 -1
- package/es/modules/tasks/pages/TaskList/index.js +5 -2
- package/es/modules/tasks/pages/TaskList/index.js.map +1 -1
- package/es/modules/tasks/pages/TaskTabView/index.js +28 -51
- package/es/modules/tasks/pages/TaskTabView/index.js.map +1 -1
- package/es/modules/tasks/pages/TaskTabView/index.less +1 -12
- package/es/modules/workspaces/components/ListHeard/index.js +1 -3
- package/es/modules/workspaces/components/ListHeard/index.js.map +1 -1
- package/package.json +9 -9
- package/es/components/PageListView/index.d.ts +0 -15
- package/es/components/PageListView/index.js +0 -50
- package/es/components/PageListView/index.js.map +0 -1
- package/es/components/PageListView/index.less +0 -7
- package/es/components/PageListView/state.d.ts +0 -9
- package/es/components/PageListView/state.js +0 -36
- package/es/components/PageListView/state.js.map +0 -1
- package/es/components/RichTextEditor/BlockStyleControls.d.ts +0 -3
- package/es/components/RichTextEditor/BlockStyleControls.js +0 -27
- package/es/components/RichTextEditor/BlockStyleControls.js.map +0 -1
- package/es/components/RichTextEditor/InlineStyleControls.d.ts +0 -3
- package/es/components/RichTextEditor/InlineStyleControls.js +0 -18
- package/es/components/RichTextEditor/InlineStyleControls.js.map +0 -1
- package/es/components/RichTextEditor/StyleButton.d.ts +0 -3
- package/es/components/RichTextEditor/StyleButton.js +0 -14
- package/es/components/RichTextEditor/StyleButton.js.map +0 -1
- package/es/components/RichTextEditor/index.d.ts +0 -23
- package/es/components/RichTextEditor/index.js +0 -133
- package/es/components/RichTextEditor/index.js.map +0 -1
- package/es/components/RichTextEditor/index.less +0 -96
- package/es/controls/SortViewDropdown/index.d.ts +0 -6
- package/es/controls/SortViewDropdown/index.js +0 -63
- package/es/controls/SortViewDropdown/index.js.map +0 -1
- package/es/controls/SortViewDropdown/index.less +0 -63
- package/es/controls/SortViewDropdown/state.d.ts +0 -6
- package/es/controls/SortViewDropdown/state.js +0 -21
- package/es/controls/SortViewDropdown/state.js.map +0 -1
- package/es/controls/cc/index.d.ts +0 -3
- package/es/controls/cc/index.js +0 -84
- package/es/controls/cc/index.js.map +0 -1
- package/es/controls/cc/index.less +0 -64
- package/es/data/contexts/SortContext/index.d.ts +0 -13
- package/es/data/contexts/SortContext/index.js +0 -47
- package/es/data/contexts/SortContext/index.js.map +0 -1
- package/es/data/contexts/index.d.ts +0 -1
- package/es/data/contexts/index.js +0 -2
- package/es/data/contexts/index.js.map +0 -1
@@ -1,133 +0,0 @@
|
|
1
|
-
import { faRedo, faSave, faUndo } from "@fortawesome/pro-light-svg-icons";
|
2
|
-
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
3
|
-
import { Button, Spin, Tooltip, Icon } from "@voplus/antd";
|
4
|
-
import { ContentState, convertFromHTML, convertFromRaw, convertToRaw, Editor, EditorState, getDefaultKeyBinding, RichUtils } from "draft-js";
|
5
|
-
import React, { useEffect, useRef, useState } from "react";
|
6
|
-
import BlockStyleControls from "./BlockStyleControls";
|
7
|
-
import InlineStyleControls from "./InlineStyleControls";
|
8
|
-
import StyleButton from "./StyleButton";
|
9
|
-
import { useObserver } from "mobx-react-lite";
|
10
|
-
import "./index.less";
|
11
|
-
const RichTextEditor = (props) => {
|
12
|
-
const blocksFromHTML = convertFromHTML(props.content);
|
13
|
-
const [editorState, setEditorState] = React.useState(EditorState.createEmpty());
|
14
|
-
const [placeholder, setPlaceholder] = useState(props.placeholder);
|
15
|
-
const [edit, setEdit] = useState();
|
16
|
-
const content = props.content
|
17
|
-
? EditorState.createWithContent(props.content.indexOf("{") > -1
|
18
|
-
? convertFromRaw(JSON.parse(props.content))
|
19
|
-
: ContentState.createFromBlockArray(blocksFromHTML.contentBlocks, blocksFromHTML.entityMap))
|
20
|
-
: EditorState.createEmpty();
|
21
|
-
useEffect(() => {
|
22
|
-
setEdit(false);
|
23
|
-
setPlaceholder(props.placeholder);
|
24
|
-
setEditorState(content);
|
25
|
-
}, [props.defaultValue]);
|
26
|
-
const [loading, setLoading] = useState(false);
|
27
|
-
const editor = useRef(null);
|
28
|
-
const getBlockStyle = (block) => {
|
29
|
-
switch (block.getType()) {
|
30
|
-
case "blockquote":
|
31
|
-
return "richEditor-blockquote";
|
32
|
-
default:
|
33
|
-
return "";
|
34
|
-
}
|
35
|
-
};
|
36
|
-
const handleKeyCommand = (command, editorState) => {
|
37
|
-
const newState = RichUtils.handleKeyCommand(editorState, command);
|
38
|
-
if (newState) {
|
39
|
-
onChange(newState);
|
40
|
-
return true;
|
41
|
-
}
|
42
|
-
return false;
|
43
|
-
};
|
44
|
-
const mapKeyToEditorCommand = (e) => {
|
45
|
-
if (e.keyCode === 27 /* Esc */)
|
46
|
-
clear();
|
47
|
-
if (e.keyCode === 9 /* TAB */) {
|
48
|
-
const newEditorState = RichUtils.onTab(e, editorState, 4 /* maxDepth */);
|
49
|
-
if (newEditorState !== editorState) {
|
50
|
-
onChange(newEditorState);
|
51
|
-
}
|
52
|
-
return;
|
53
|
-
}
|
54
|
-
return getDefaultKeyBinding(e);
|
55
|
-
};
|
56
|
-
const toggleBlockType = (blockType) => {
|
57
|
-
onChange(RichUtils.toggleBlockType(editorState, blockType));
|
58
|
-
};
|
59
|
-
const toggleInlineStyle = (inlineStyle) => {
|
60
|
-
onChange(RichUtils.toggleInlineStyle(editorState, inlineStyle));
|
61
|
-
};
|
62
|
-
const styleMap = {
|
63
|
-
RED: { color: "#e24" },
|
64
|
-
BLUE: { color: "#39f" },
|
65
|
-
ORANGE: { color: "#f93" },
|
66
|
-
GREEN: { color: "#3a6" }
|
67
|
-
};
|
68
|
-
let className = "richEditor-editor";
|
69
|
-
const contentState = editorState.getCurrentContent();
|
70
|
-
if (!contentState.hasText()) {
|
71
|
-
if (contentState
|
72
|
-
.getBlockMap()
|
73
|
-
.first()
|
74
|
-
.getType() !== "unstyled") {
|
75
|
-
className += " richEditor-hidePlaceholder";
|
76
|
-
}
|
77
|
-
}
|
78
|
-
const undo = () => {
|
79
|
-
onChange(EditorState.undo(editorState));
|
80
|
-
};
|
81
|
-
const redo = () => {
|
82
|
-
onChange(EditorState.redo(editorState));
|
83
|
-
};
|
84
|
-
const focus = () => {
|
85
|
-
setPlaceholder("");
|
86
|
-
editor.current.focus();
|
87
|
-
};
|
88
|
-
const a = () => {
|
89
|
-
setEdit(!edit);
|
90
|
-
setPlaceholder("");
|
91
|
-
};
|
92
|
-
const onChange = (editorState) => {
|
93
|
-
setEditorState(editorState);
|
94
|
-
if (props.onChange)
|
95
|
-
props.onChange(JSON.stringify(convertToRaw(contentState)));
|
96
|
-
};
|
97
|
-
const save = async () => {
|
98
|
-
setLoading(true);
|
99
|
-
await props.onSave(JSON.stringify(convertToRaw(contentState)));
|
100
|
-
setLoading(false);
|
101
|
-
setEdit(false);
|
102
|
-
};
|
103
|
-
const clear = () => {
|
104
|
-
onChange(content);
|
105
|
-
setEdit(false);
|
106
|
-
setPlaceholder(props.placeholder);
|
107
|
-
};
|
108
|
-
const { readOnly, editable, toolbar, btn, minHeight } = props;
|
109
|
-
return useObserver(() => (React.createElement(React.Fragment, null, editable || edit ? (React.createElement("div", { className: "rich-text-editor" },
|
110
|
-
React.createElement(Spin, { spinning: loading && !btn, indicator: React.createElement(Icon, { type: "loading" }) },
|
111
|
-
React.createElement("div", { className: "richEditor-root" },
|
112
|
-
toolbar && (React.createElement("div", { className: "richEditor-toolbar" },
|
113
|
-
React.createElement("div", { className: "richEditor-controls" },
|
114
|
-
React.createElement(StyleButton, { label: React.createElement(FAIcon, { icon: faUndo }), onToggle: undo }),
|
115
|
-
React.createElement(StyleButton, { label: React.createElement(FAIcon, { icon: faRedo }), onToggle: redo })),
|
116
|
-
React.createElement(InlineStyleControls, { editorState: editorState, onToggle: toggleInlineStyle }),
|
117
|
-
React.createElement(BlockStyleControls, { editorState: editorState, onToggle: toggleBlockType }),
|
118
|
-
React.createElement(StyleButton, { label: React.createElement(Tooltip, { title: "Save" },
|
119
|
-
React.createElement(FAIcon, { icon: faSave })), onToggle: () => save() }))),
|
120
|
-
React.createElement("div", { className: className, onClick: focus, style: { minHeight: minHeight } },
|
121
|
-
React.createElement(Editor, { readOnly: readOnly, blockStyleFn: getBlockStyle, customStyleMap: styleMap, editorState: editorState, handleKeyCommand: handleKeyCommand.bind(event), keyBindingFn: mapKeyToEditorCommand.bind(event), onChange: onChange, placeholder: placeholder, ref: editor, spellCheck: true }))),
|
122
|
-
btn && (React.createElement("div", { className: "rich-text-editor-btn" },
|
123
|
-
!editable && (React.createElement(Button, { type: "default", onClick: clear }, "Cancel")),
|
124
|
-
React.createElement(Button, { type: "primary", loading: loading, onClick: save }, "Save")))))) : (React.createElement("div", { className: "readonly-editor", onClick: a }, contentState.hasText() ? (React.createElement(Editor, { editorState: editorState, customStyleMap: styleMap, readOnly: true, onChange: () => { } })) : (placeholder))))));
|
125
|
-
};
|
126
|
-
RichTextEditor.defaultProps = {
|
127
|
-
editable: true,
|
128
|
-
toolbar: true,
|
129
|
-
btn: true,
|
130
|
-
minHeight: 80
|
131
|
-
};
|
132
|
-
export default RichTextEditor;
|
133
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/RichTextEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EACN,YAAY,EACZ,eAAe,EACf,cAAc,EACd,YAAY,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CACN,CACK,CACF,CACN,CAAC,CAAC,CAAC,CACH,6BAAK,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,CAAC,IACzC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CACzB,oBAAC,MAAM,IACN,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,QAAQ,EACxB,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,GACjB,CACF,CAAC,CAAC,CAAC,CACH,WAAW,CACX,CACI,CACN,CACe,CACjB,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,cAAc,CAAC,YAAY,GAAG;IAC7B,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,GAAG,EAAE,IAAI;IACT,SAAS,EAAE,EAAE;CACb,CAAC;AACF,eAAe,cAAc,CAAC"}
|
@@ -1,96 +0,0 @@
|
|
1
|
-
:global {
|
2
|
-
.richEditor-root {
|
3
|
-
background: #fff;
|
4
|
-
border: 1px solid #ddd;
|
5
|
-
font-size: 14px;
|
6
|
-
.richEditor-toolbar {
|
7
|
-
padding: 0 15px;
|
8
|
-
}
|
9
|
-
.richEditor-editor {
|
10
|
-
padding: 0 15px;
|
11
|
-
border-top: 1px solid #ddd;
|
12
|
-
cursor: text;
|
13
|
-
font-size: 16px;
|
14
|
-
.public-DraftEditorPlaceholder-root,
|
15
|
-
.public-DraftEditor-content {
|
16
|
-
margin: 0 -15px;
|
17
|
-
padding: 15px;
|
18
|
-
}
|
19
|
-
.richEditor-blockquote {
|
20
|
-
// color: #333;
|
21
|
-
// font-style: italic;
|
22
|
-
margin: 15px 0;
|
23
|
-
}
|
24
|
-
|
25
|
-
.public-DraftStyleDefault-pre {
|
26
|
-
background-color: rgba(0, 0, 0, 0.05);
|
27
|
-
font-size: 16px;
|
28
|
-
padding: 20px;
|
29
|
-
}
|
30
|
-
}
|
31
|
-
.richEditor-hidePlaceholder .public-DraftEditorPlaceholder-root {
|
32
|
-
display: none;
|
33
|
-
}
|
34
|
-
|
35
|
-
.richEditor-controls {
|
36
|
-
display: inline-block;
|
37
|
-
padding: 8px 0;
|
38
|
-
font-size: 14px;
|
39
|
-
margin-right: 15px;
|
40
|
-
user-select: none;
|
41
|
-
// border-right: 1px #ddd solid;
|
42
|
-
.color-bld {
|
43
|
-
font-weight: bold;
|
44
|
-
}
|
45
|
-
.color-italic {
|
46
|
-
font-weight: italic;
|
47
|
-
}
|
48
|
-
.color-underline {
|
49
|
-
text-decoration: underline;
|
50
|
-
}
|
51
|
-
.color-red,
|
52
|
-
.color-orange,
|
53
|
-
.color-blue,
|
54
|
-
.color-green {
|
55
|
-
display: inline-block;
|
56
|
-
width: 10px;
|
57
|
-
height: 10px;
|
58
|
-
}
|
59
|
-
.color-red {
|
60
|
-
background: #e24;
|
61
|
-
}
|
62
|
-
.color-orange {
|
63
|
-
background: #f93;
|
64
|
-
}
|
65
|
-
.color-blue {
|
66
|
-
background: #39f;
|
67
|
-
}
|
68
|
-
.color-green {
|
69
|
-
background: #3a6;
|
70
|
-
}
|
71
|
-
&:last-child {
|
72
|
-
border-right: 0;
|
73
|
-
margin-right: 0;
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
.richEditor-styleButton {
|
78
|
-
display: inline-block;
|
79
|
-
margin-right: 15px;
|
80
|
-
color: #333;
|
81
|
-
cursor: pointer;
|
82
|
-
font-weight: 500;
|
83
|
-
}
|
84
|
-
|
85
|
-
.richEditor-activeButton {
|
86
|
-
color: #5890ff;
|
87
|
-
}
|
88
|
-
}
|
89
|
-
|
90
|
-
.rich-text-editor-btn {
|
91
|
-
padding: 10px 0;
|
92
|
-
.ant-btn + .ant-btn {
|
93
|
-
margin-left: 10px;
|
94
|
-
}
|
95
|
-
}
|
96
|
-
}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import React, { useState } from "react";
|
2
|
-
import { Button, Checkbox, Dropdown, Icon, Row } from "@voplus/antd";
|
3
|
-
import { useObserver } from "mobx-react-lite";
|
4
|
-
import styles from "./index.less";
|
5
|
-
import { State } from "./state";
|
6
|
-
const SortViewDropdown = (props) => {
|
7
|
-
const [state] = useState(new State());
|
8
|
-
// const [visible, setVisible] = useState(false);
|
9
|
-
const options = [
|
10
|
-
// { label: "Groups", value: "Groups" },
|
11
|
-
{ label: "Name", value: "Name" },
|
12
|
-
// { label: "Status", value: "Status" },
|
13
|
-
{ label: "Start Date", value: "StartDate" },
|
14
|
-
{ label: "Due Date", value: "DueDate" }
|
15
|
-
];
|
16
|
-
const onSortByFilter = () => {
|
17
|
-
state.data.Direction = state.data.Direction === "Asc" ? "Desc" : "Asc";
|
18
|
-
console.log(state.data);
|
19
|
-
if (props.onChange)
|
20
|
-
props.onChange(state.data);
|
21
|
-
// sortStore.sort(sortValue, direction === "Asc" ? "Desc" : "Asc");
|
22
|
-
};
|
23
|
-
const onChange = (checkedValue) => {
|
24
|
-
const value = checkedValue.length === 1
|
25
|
-
? checkedValue
|
26
|
-
: checkedValue.filter(value => value !== state.data.Sort);
|
27
|
-
// setVisible(true);
|
28
|
-
state.data.Sort = value[0];
|
29
|
-
state.data.Direction = state.data.Direction || "Asc";
|
30
|
-
if (props.onChange)
|
31
|
-
props.onChange(state.data);
|
32
|
-
};
|
33
|
-
// const handleVisibleChange = (flag: any) => {
|
34
|
-
// setVisible(flag);
|
35
|
-
// };
|
36
|
-
const reset = () => {
|
37
|
-
state.reset();
|
38
|
-
if (props.onReset)
|
39
|
-
props.onReset();
|
40
|
-
console.log("reset");
|
41
|
-
};
|
42
|
-
const overlay = useObserver(() => (React.createElement("div", { className: styles["sort-view-dropdown"] },
|
43
|
-
React.createElement("h4", null, "Sorting By"),
|
44
|
-
React.createElement(Checkbox.Group, { value: [state.data.Sort || ""], options: options, onChange: onChange }),
|
45
|
-
React.createElement(Row, { type: "flex", justify: "end", className: "sort-view-bottom" },
|
46
|
-
React.createElement(Button, { type: "link", onClick: reset }, "Reset")))));
|
47
|
-
const option = options.find(o => o.value === state.data.Sort);
|
48
|
-
return useObserver(() => (React.createElement("span", { className: styles["sort-menu"] },
|
49
|
-
option && React.createElement("span", { onClick: onSortByFilter }, option.label),
|
50
|
-
React.createElement("span", { className: "sort-icon", onClick: onSortByFilter },
|
51
|
-
React.createElement(Icon, { type: "caret-up", className: "sort-up" + (state.data.Direction === "Asc" ? " on" : "") }),
|
52
|
-
React.createElement(Icon, { type: "caret-down", className: "sort-down" + (state.data.Direction === "Desc" ? " on" : "") })),
|
53
|
-
React.createElement(Dropdown
|
54
|
-
// visible={visible}
|
55
|
-
// onVisibleChange={handleVisibleChange}
|
56
|
-
, {
|
57
|
-
// visible={visible}
|
58
|
-
// onVisibleChange={handleVisibleChange}
|
59
|
-
overlay: overlay, trigger: ["click"] },
|
60
|
-
React.createElement(Icon, { type: "down", className: "more-menu" })))));
|
61
|
-
};
|
62
|
-
export default SortViewDropdown;
|
63
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controls/SortViewDropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,gBAAgB,GAAG,CAAC,KAAkE,EAAE,EAAE;IAC/F,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IACtC,iDAAiD;IAEjD,MAAM,OAAO,GAAG;QACf,wCAAwC;QACxC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;QAChC,wCAAw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,CAAC,GACvE,CACI;QACP,oBAAC,QAAQ;QACR,oBAAoB;QACpB,wCAAwC;;YADxC,oBAAoB;YACpB,wCAAwC;YACxC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,CAAC,OAAO,CAAC;YAElB,oBAAC,IAAI,IAAC,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,WAAW,GAAG,CAChC,CACL,CACP,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,gBAAgB,CAAC"}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
@import "~@voplus/antd/es/style/themes/default.less";
|
2
|
-
.sort-view-dropdown {
|
3
|
-
background: #fff;
|
4
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
5
|
-
:global {
|
6
|
-
h4 {
|
7
|
-
padding: 10px 15px;
|
8
|
-
font-weight: bold;
|
9
|
-
}
|
10
|
-
.ant-checkbox-group {
|
11
|
-
// display: block;
|
12
|
-
padding: 0px 20px;
|
13
|
-
.ant-checkbox-group-item {
|
14
|
-
display: block;
|
15
|
-
margin-bottom: 10px;
|
16
|
-
font-size: 13px;
|
17
|
-
}
|
18
|
-
}
|
19
|
-
.sort-view-bottom {
|
20
|
-
border-top: 1px solid #ebeef5;
|
21
|
-
// margin-top: 10px;
|
22
|
-
padding: 0 15px;
|
23
|
-
.ant-btn {
|
24
|
-
padding: 0 5px;
|
25
|
-
}
|
26
|
-
.default {
|
27
|
-
color: #606266;
|
28
|
-
}
|
29
|
-
}
|
30
|
-
}
|
31
|
-
}
|
32
|
-
.sort-menu {
|
33
|
-
padding: 2px 3px;
|
34
|
-
border: 1px solid #d9d9dd;
|
35
|
-
border-radius: 4px;
|
36
|
-
font-size: 12px;
|
37
|
-
:global {
|
38
|
-
.sort-icon {
|
39
|
-
display: table-cell;
|
40
|
-
vertical-align: middle;
|
41
|
-
height: 14px;
|
42
|
-
transition: all 0.3s;
|
43
|
-
cursor: pointer;
|
44
|
-
padding-left: 3px;
|
45
|
-
.sort-up,
|
46
|
-
.sort-down {
|
47
|
-
display: block;
|
48
|
-
height: 7px;
|
49
|
-
font-size: 12px;
|
50
|
-
transition: all 0.3s;
|
51
|
-
}
|
52
|
-
.on {
|
53
|
-
color: @primary-color;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
.more-menu {
|
57
|
-
border-left: 1px solid #d9d9dd;
|
58
|
-
padding-left: 5px;
|
59
|
-
margin-left: 5px;
|
60
|
-
font-size: 12px;
|
61
|
-
}
|
62
|
-
}
|
63
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { action, observable } from "mobx";
|
3
|
-
export class State {
|
4
|
-
constructor() {
|
5
|
-
this.data = {};
|
6
|
-
this.label = "";
|
7
|
-
}
|
8
|
-
reset() {
|
9
|
-
this.data = {};
|
10
|
-
}
|
11
|
-
}
|
12
|
-
__decorate([
|
13
|
-
observable
|
14
|
-
], State.prototype, "data", void 0);
|
15
|
-
__decorate([
|
16
|
-
observable
|
17
|
-
], State.prototype, "label", void 0);
|
18
|
-
__decorate([
|
19
|
-
action
|
20
|
-
], State.prototype, "reset", null);
|
21
|
-
//# sourceMappingURL=state.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/controls/SortViewDropdown/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1C,MAAM,OAAO,KAAK;IAAlB;QAEQ,SAAI,GAAmB,EAAE,CAAC;QAE1B,UAAK,GAAW,EAAE,CAAC;IAM3B,CAAC;IAHO,KAAK;QACX,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IAChB,CAAC;CACD;AARA;IADC,UAAU;mCACsB;AAEjC;IADC,UAAU;oCACe;AAG1B;IADC,MAAM;kCAGN"}
|
package/es/controls/cc/index.js
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
import React, { useState } from "react";
|
2
|
-
import { Dropdown, Menu, Icon, Button, Input, message, Modal } from "@voplus/antd";
|
3
|
-
import { faThList } from "@fortawesome/pro-light-svg-icons";
|
4
|
-
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
5
|
-
const confirm = Modal.confirm;
|
6
|
-
import styles from "./index.less";
|
7
|
-
export default () => {
|
8
|
-
const [menuList, setMenuList] = useState([
|
9
|
-
{ label: "Created by me", value: "1", settings: { filters: [], sort: "asc" } },
|
10
|
-
{ label: "Cameras", value: "2" },
|
11
|
-
{ label: "Greg view", value: "3" },
|
12
|
-
{ label: "Default View", value: "4" }
|
13
|
-
]);
|
14
|
-
const [{ visible, selectValue }, setSelectState] = useState({
|
15
|
-
visible: false,
|
16
|
-
selectValue: ""
|
17
|
-
});
|
18
|
-
const [{ isEdit, editIndex }, setEdit] = useState({ isEdit: false, editIndex: -1 });
|
19
|
-
const handleVisibleChange = (visible) => {
|
20
|
-
setSelectState({ visible: !!visible, selectValue });
|
21
|
-
};
|
22
|
-
const onSelect = (value) => {
|
23
|
-
if (isEdit)
|
24
|
-
return;
|
25
|
-
setSelectState({ visible: false, selectValue: value });
|
26
|
-
};
|
27
|
-
const onDelete = (index, e) => {
|
28
|
-
confirm({
|
29
|
-
title: React.createElement("span", { style: { fontSize: "14px" } }, "Are you sure delete this item?"),
|
30
|
-
width: 320,
|
31
|
-
zIndex: 9999,
|
32
|
-
maskClosable: true,
|
33
|
-
centered: true,
|
34
|
-
keyboard: true,
|
35
|
-
okText: "Yes",
|
36
|
-
okType: "danger",
|
37
|
-
cancelText: "No",
|
38
|
-
onOk() {
|
39
|
-
console.log("OK");
|
40
|
-
},
|
41
|
-
onCancel() {
|
42
|
-
console.log("Cancel");
|
43
|
-
}
|
44
|
-
});
|
45
|
-
};
|
46
|
-
const onEdit = (index, e) => {
|
47
|
-
setEdit({ isEdit: true, editIndex: index });
|
48
|
-
};
|
49
|
-
const saveFilterName = (index, e) => {
|
50
|
-
e.persist();
|
51
|
-
const list = [...menuList];
|
52
|
-
if (list[index])
|
53
|
-
list[index].label = e.target.value;
|
54
|
-
setMenuList(list);
|
55
|
-
setEdit({ isEdit: true, editIndex: -1 });
|
56
|
-
message.success("Successful change");
|
57
|
-
};
|
58
|
-
const menu = (React.createElement(Menu, { className: styles["filter-views-dropdown"] },
|
59
|
-
menuList.map((item, index) => (React.createElement(Menu.SubMenu, { key: item.value, title: React.createElement("span", { className: "filter-item" }, isEdit && index === editIndex ? (React.createElement("div", { style: { display: "flex", justifyContent: "space-between" } },
|
60
|
-
React.createElement(Input, { defaultValue: item.label, autoFocus: true, maxLength: 20, size: "small", onPressEnter: saveFilterName.bind(event, index), onKeyDown: () => setEdit({ isEdit: false, editIndex: -1 }) }),
|
61
|
-
React.createElement("span", { className: "item-operate" },
|
62
|
-
React.createElement(Button, { type: "link", size: "small", className: "default", onClick: () => setEdit({ isEdit: false, editIndex: -1 }) }, "Cancel"),
|
63
|
-
React.createElement(Button, { type: "link", size: "small", onClick: saveFilterName.bind(event, index) }, "Save")))) : (React.createElement("div", { style: { display: "flex", justifyContent: "space-between" } },
|
64
|
-
React.createElement("span", { className: "item-name", onClick: onSelect.bind(event, item.label) }, item.label),
|
65
|
-
React.createElement("span", { className: "view-operate" },
|
66
|
-
React.createElement(Icon, { type: "edit", className: "margin-left-10", onClick: onEdit.bind(event, index) }),
|
67
|
-
React.createElement(Icon, { type: "delete", style: { color: "#f5222d" }, className: "margin-left-10", onClick: onDelete.bind(event, index) }))))) }, !isEdit && (React.createElement(Menu.Item, { className: styles["sub-views-dropdown"] },
|
68
|
-
React.createElement("h4", null, "Filter By"),
|
69
|
-
React.createElement("div", null),
|
70
|
-
React.createElement("h4", null, "Sort By"),
|
71
|
-
React.createElement("div", { className: "filter-info" },
|
72
|
-
React.createElement("p", null, "Group"),
|
73
|
-
React.createElement("p", null, "Person"))))))),
|
74
|
-
React.createElement(Menu.Item, null,
|
75
|
-
React.createElement(Button, { type: "link" }, "Save Current View"))));
|
76
|
-
return (React.createElement(Dropdown, { overlay: menu, onVisibleChange: handleVisibleChange, visible: visible, trigger: ["click"] },
|
77
|
-
React.createElement("span", { className: styles["filter-views-menu-icon"] },
|
78
|
-
(!visible || !selectValue) && React.createElement(Icon, { type: "down", className: "margin-right-5" }),
|
79
|
-
React.createElement(FAIcon, { icon: faThList, color: "#666", size: "lg", className: "margin-right-5" }),
|
80
|
-
selectValue,
|
81
|
-
"Created by me",
|
82
|
-
visible && selectValue && React.createElement(Icon, { type: "caret-up", className: "margin-left-5" }))));
|
83
|
-
};
|
84
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controls/cc/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAsB,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAE9B,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,eAAe,GAAG,EAAE;IACnB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC;QACxC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QAC9E,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;QAChC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE;QAClC,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,E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P,0CAAgB;YAChB,6BAAK,SAAS,EAAC,aAAa;gBAC3B,uCAAY;gBACZ,wCAAa,CACR,CACK,CACZ,CACa,CACf,CAAC;QACF,oBAAC,IAAI,CAAC,IAAI;YACT,oBAAC,MAAM,IAAC,IAAI,EAAC,MAAM,wBAA2B,CACnC,CACN,CACP,CAAC;IACF,OAAO,CACN,oBAAC,QAAQ,IACR,OAAO,EAAE,IAAI,EACb,eAAe,EAAE,mBAAmB,EACpC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,CAAC,OAAO,CAAC;QAElB,8BAAM,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC;YAC/C,CAAC,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,oBAAC,IAAI,IAAC,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,gBAAgB,GAAG;YAC9E,oBAAC,MAAM,IAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,gBAAgB,GAAG;YAC3E,WAAW;;YAEX,OAAO,IAAI,WAAW,IAAI,oBAAC,IAAI,IAAC,IAAI,EAAC,UAAU,EAAC,SAAS,EAAC,eAAe,GAAG,CACvE,CACG,CACX,CAAC;AACH,CAAC,CAAC"}
|
@@ -1,64 +0,0 @@
|
|
1
|
-
@import "~@voplus/antd/es/style/themes/default.less";
|
2
|
-
@import "../../styles/common.less";
|
3
|
-
.filter-views-dropdown {
|
4
|
-
padding: 8px 0;
|
5
|
-
:global {
|
6
|
-
.ant-dropdown-menu-item {
|
7
|
-
padding: 0;
|
8
|
-
}
|
9
|
-
.ant-dropdown-menu-submenu-title {
|
10
|
-
padding: 5px 15px;
|
11
|
-
font-size: 13px;
|
12
|
-
color: #333;
|
13
|
-
.ant-btn {
|
14
|
-
padding: 0;
|
15
|
-
}
|
16
|
-
.filter-item {
|
17
|
-
display: inline-block;
|
18
|
-
width: 100%;
|
19
|
-
position: relative;
|
20
|
-
}
|
21
|
-
.item-operate {
|
22
|
-
padding-left: 10px;
|
23
|
-
.default {
|
24
|
-
color: #666;
|
25
|
-
margin-right: 10px;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
.ant-dropdown-menu-submenu-arrow {
|
29
|
-
display: none;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
.ant-btn-link {
|
33
|
-
font-size: 13px;
|
34
|
-
}
|
35
|
-
.ant-dropdown-menu-item:hover,
|
36
|
-
.ant-dropdown-menu-submenu-title:hover {
|
37
|
-
background: transparent;
|
38
|
-
.item-name {
|
39
|
-
color: @primary-color;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
44
|
-
.sub-views-dropdown {
|
45
|
-
padding: 8px 15px;
|
46
|
-
:global {
|
47
|
-
h4 {
|
48
|
-
font-weight: bold;
|
49
|
-
}
|
50
|
-
.filter-info {
|
51
|
-
margin: 0 10px;
|
52
|
-
line-height: 24px;
|
53
|
-
font-size: 13px;
|
54
|
-
color: #333;
|
55
|
-
}
|
56
|
-
}
|
57
|
-
}
|
58
|
-
.sub-views-dropdown:hover {
|
59
|
-
background: transparent;
|
60
|
-
}
|
61
|
-
.filter-views-menu-icon {
|
62
|
-
padding: 5px 0;
|
63
|
-
cursor: pointer;
|
64
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { SortParameters } from "@voplus/morpho-data/es/types";
|
2
|
-
import React from "react";
|
3
|
-
export declare class SortStore {
|
4
|
-
data: SortParameters;
|
5
|
-
filters: any[];
|
6
|
-
canDrag: boolean;
|
7
|
-
reset(): void;
|
8
|
-
sort(sort: string, dir?: "Asc" | "Desc"): void;
|
9
|
-
setCanDrag(canDrag: boolean): void;
|
10
|
-
setFilters(filters: any[]): void;
|
11
|
-
}
|
12
|
-
export declare const SortContext: React.Context<SortStore | null>;
|
13
|
-
export declare const useSort: () => SortStore | null;
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { action, observable } from "mobx";
|
3
|
-
import React, { useContext } from "react";
|
4
|
-
export class SortStore {
|
5
|
-
constructor() {
|
6
|
-
this.data = {};
|
7
|
-
this.filters = [];
|
8
|
-
this.canDrag = false;
|
9
|
-
}
|
10
|
-
reset() {
|
11
|
-
this.data = {};
|
12
|
-
}
|
13
|
-
sort(sort, dir) {
|
14
|
-
this.data.Sort = sort;
|
15
|
-
this.data.Direction = dir;
|
16
|
-
}
|
17
|
-
setCanDrag(canDrag) {
|
18
|
-
this.canDrag = canDrag;
|
19
|
-
}
|
20
|
-
setFilters(filters) {
|
21
|
-
this.filters = filters;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
__decorate([
|
25
|
-
observable
|
26
|
-
], SortStore.prototype, "data", void 0);
|
27
|
-
__decorate([
|
28
|
-
observable
|
29
|
-
], SortStore.prototype, "filters", void 0);
|
30
|
-
__decorate([
|
31
|
-
observable
|
32
|
-
], SortStore.prototype, "canDrag", void 0);
|
33
|
-
__decorate([
|
34
|
-
action
|
35
|
-
], SortStore.prototype, "reset", null);
|
36
|
-
__decorate([
|
37
|
-
action
|
38
|
-
], SortStore.prototype, "sort", null);
|
39
|
-
__decorate([
|
40
|
-
action
|
41
|
-
], SortStore.prototype, "setCanDrag", null);
|
42
|
-
__decorate([
|
43
|
-
action
|
44
|
-
], SortStore.prototype, "setFilters", null);
|
45
|
-
export const SortContext = React.createContext(null);
|
46
|
-
export const useSort = () => useContext(SortContext);
|
47
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data/contexts/SortContext/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,OAAO,SAAS;IAAtB;QAEQ,SAAI,GAAmB,EAAE,CAAC;QAG1B,YAAO,GAAU,EAAE,CAAC;QAGpB,YAAO,GAAY,KAAK,CAAC;IAsBjC,CAAC;IAnBO,KAAK;QACX,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IAChB,CAAC;IAGM,IAAI,CAAC,IAAY,EAAE,GAAoB;QAC7C,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;IAC3B,CAAC;IAGM,UAAU,CAAC,OAAgB;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAGM,UAAU,CAAC,OAAc;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;CACD;AA5BA;IADC,UAAU;uCACsB;AAGjC;IADC,UAAU;0CACgB;AAG3B;IADC,UAAU;0CACqB;AAGhC;IADC,MAAM;sCAGN;AAGD;IADC,MAAM;qCAIN;AAGD;IADC,MAAM;2CAGN;AAGD;IADC,MAAM;2CAGN;AAGF,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAmB,IAAI,CAAC,CAAC;AAEvE,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from "./SortContext";
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|