@voplus/morpho-document 1.0.0-dev214 → 1.0.0-dev216
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/ActivityLog/index.less +64 -64
- package/es/components/AddDocDropdown/index.js +23 -5
- package/es/components/AddDocDropdown/index.js.map +1 -1
- package/es/components/AddDocDropdown/index.less +3 -2
- package/es/components/AddDocDropdown/state.d.ts +1 -0
- package/es/components/AddDocDropdown/state.js +9 -3
- package/es/components/AddDocDropdown/state.js.map +1 -1
- package/es/components/BreadCrumbsHeader/index.d.ts +9 -0
- package/es/components/BreadCrumbsHeader/index.js +30 -0
- package/es/components/BreadCrumbsHeader/index.js.map +1 -0
- package/es/components/BreadCrumbsHeader/index.less +10 -0
- package/es/components/BreadCrumbsHeader/state.d.ts +10 -0
- package/es/components/BreadCrumbsHeader/state.js +34 -0
- package/es/components/BreadCrumbsHeader/state.js.map +1 -0
- package/es/components/DocumentItem/index.js +2 -8
- package/es/components/DocumentItem/index.js.map +1 -1
- package/es/components/DocumentList/Header.d.ts +13 -0
- package/es/components/DocumentList/Header.js +16 -0
- package/es/components/DocumentList/Header.js.map +1 -0
- package/es/components/DocumentList/index.js +35 -29
- package/es/components/DocumentList/index.js.map +1 -1
- package/es/components/DocumentList/index.less +39 -15
- package/es/components/DocumentList/state.d.ts +9 -27
- package/es/components/DocumentList/state.js +20 -115
- package/es/components/DocumentList/state.js.map +1 -1
- package/es/components/DocumentListView/index.d.ts +3 -2
- package/es/components/DocumentListView/index.js +31 -54
- package/es/components/DocumentListView/index.js.map +1 -1
- package/es/components/DocumentListView/state.d.ts +1 -36
- package/es/components/DocumentListView/state.js +1 -100
- package/es/components/DocumentListView/state.js.map +1 -1
- package/es/components/DocumentSortableTree/index.js +32 -4
- package/es/components/DocumentSortableTree/index.js.map +1 -1
- package/es/components/DocumentSortableTree/state.d.ts +7 -6
- package/es/components/DocumentSortableTree/state.js +23 -32
- package/es/components/DocumentSortableTree/state.js.map +1 -1
- package/es/components/DocumentTabs/index.js +2 -4
- package/es/components/DocumentTabs/index.js.map +1 -1
- package/es/components/DocumentTree/index.js +1 -1
- package/es/components/DocumentTree/index.js.map +1 -1
- package/es/components/FileViewer/ImageViewer.js +4 -3
- package/es/components/FileViewer/ImageViewer.js.map +1 -1
- package/es/components/FileViewer/PDFViewer.js +4 -2
- package/es/components/FileViewer/PDFViewer.js.map +1 -1
- package/es/components/FileViewer/Preview.js +12 -10
- package/es/components/FileViewer/Preview.js.map +1 -1
- package/es/components/FileViewer/index.less +33 -0
- package/es/components/Links/index.less +111 -111
- package/es/components/NewDocumentForm/index.d.ts +1 -1
- package/es/components/NewDocumentForm/index.js +10 -3
- package/es/components/NewDocumentForm/index.js.map +1 -1
- package/es/components/NewDocumentForm/index.less +9 -1
- package/es/components/QuickAccessSearch/index.js +5 -4
- package/es/components/QuickAccessSearch/index.js.map +1 -1
- package/es/components/QuickViewDialog/QuickSubTab/index.d.ts +10 -4
- package/es/components/QuickViewDialog/QuickSubTab/index.js +16 -16
- package/es/components/QuickViewDialog/QuickSubTab/index.js.map +1 -1
- package/es/components/QuickViewDialog/QuickSubTab/index.less +7 -19
- package/es/components/QuickViewDialog/index.js +2 -1
- package/es/components/QuickViewDialog/index.js.map +1 -1
- package/es/components/QuickViewDialog/index.less +8 -1
- package/es/components/helper.d.ts +1 -1
- package/es/components/helper.js +4 -0
- package/es/components/helper.js.map +1 -1
- package/es/components/styles/common.less +4 -1
- package/es/controls/filters/DocumentTypeFilter/index.d.ts +3 -0
- package/es/controls/filters/DocumentTypeFilter/index.js +21 -0
- package/es/controls/filters/DocumentTypeFilter/index.js.map +1 -0
- package/es/controls/filters/DocumentTypeFilter/state.d.ts +18 -0
- package/es/controls/filters/DocumentTypeFilter/state.js +57 -0
- package/es/controls/filters/DocumentTypeFilter/state.js.map +1 -0
- package/es/controls/filters/index.d.ts +1 -0
- package/es/controls/filters/index.js +1 -0
- package/es/controls/filters/index.js.map +1 -1
- package/es/data/DocumentStore/hooks/useDocumentListEffect.d.ts +2 -1
- package/es/data/DocumentStore/hooks/useDocumentListEffect.js +2 -2
- package/es/data/DocumentStore/hooks/useDocumentListEffect.js.map +1 -1
- package/es/data/DocumentType.d.ts +3 -1
- package/es/data/DocumentType.js +3 -1
- package/es/data/DocumentType.js.map +1 -1
- package/es/data/metas/ShortcutMeta.js +1 -1
- package/es/data/metas/ShortcutMeta.js.map +1 -1
- package/es/modules/unit/components/ActivityLog/index.d.ts +6 -0
- package/es/modules/unit/components/ActivityLog/index.js +62 -0
- package/es/modules/unit/components/ActivityLog/index.js.map +1 -0
- package/es/modules/unit/components/ActivityLog/index.less +64 -0
- package/es/modules/unit/components/ActivityLog/state.d.ts +14 -0
- package/es/modules/unit/components/ActivityLog/state.js +51 -0
- package/es/modules/unit/components/ActivityLog/state.js.map +1 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.d.ts +6 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.js +27 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.js.map +1 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.less +10 -0
- package/es/modules/unit/components/BreadCrumbsHeader/state.d.ts +5 -0
- package/es/modules/unit/components/BreadCrumbsHeader/state.js +19 -0
- package/es/modules/unit/components/BreadCrumbsHeader/state.js.map +1 -0
- package/es/modules/unit/components/Members/index.d.ts +4 -0
- package/es/modules/unit/components/Members/index.js +91 -0
- package/es/modules/unit/components/Members/index.js.map +1 -0
- package/es/modules/unit/components/Members/index.less +19 -0
- package/es/modules/unit/components/Members/state.d.ts +18 -0
- package/es/modules/unit/components/Members/state.js +29 -0
- package/es/modules/unit/components/Members/state.js.map +1 -0
- package/es/modules/unit/components/NewUnitForm/index.d.ts +11 -0
- package/es/modules/unit/components/NewUnitForm/index.js +51 -0
- package/es/modules/unit/components/NewUnitForm/index.js.map +1 -0
- package/es/modules/unit/components/NewUnitForm/index.less +33 -0
- package/es/modules/unit/components/NewUnitForm/state.d.ts +22 -0
- package/es/modules/unit/components/NewUnitForm/state.js +49 -0
- package/es/modules/unit/components/NewUnitForm/state.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/index.d.ts +4 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/index.js +23 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/index.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.d.ts +3 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.js +58 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.less +46 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.d.ts +3 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.js +73 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.less +12 -0
- package/es/modules/unit/components/SubUnitList/index.d.ts +5 -0
- package/es/modules/unit/components/SubUnitList/index.js +70 -0
- package/es/modules/unit/components/SubUnitList/index.js.map +1 -0
- package/es/modules/unit/components/SubUnitList/index.less +13 -0
- package/es/modules/unit/components/SubUnitList/state.d.ts +14 -0
- package/es/modules/unit/components/SubUnitList/state.js +21 -0
- package/es/modules/unit/components/SubUnitList/state.js.map +1 -0
- package/es/modules/unit/components/UnitAvatar/index.d.ts +1 -0
- package/es/modules/unit/components/UnitAvatar/index.js +5 -4
- package/es/modules/unit/components/UnitAvatar/index.js.map +1 -1
- package/es/modules/unit/components/UnitAvatar/index.less +2 -3
- package/es/modules/unit/components/UnitDetails/index.js +98 -7
- package/es/modules/unit/components/UnitDetails/index.js.map +1 -1
- package/es/modules/unit/components/UnitDetails/index.less +41 -5
- package/es/modules/unit/components/UnitDetails/state.d.ts +8 -0
- package/es/modules/unit/components/UnitDetails/state.js +24 -0
- package/es/modules/unit/components/UnitDetails/state.js.map +1 -0
- package/es/modules/unit/components/UnitHead/index.d.ts +2 -0
- package/es/modules/unit/components/UnitHead/index.js +31 -7
- package/es/modules/unit/components/UnitHead/index.js.map +1 -1
- package/es/modules/unit/components/UnitHead/index.less +18 -3
- package/es/modules/unit/components/UnitHead/state.d.ts +11 -0
- package/es/modules/unit/components/UnitHead/state.js +8 -0
- package/es/modules/unit/components/UnitHead/state.js.map +1 -0
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.d.ts +4 -0
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.js +29 -0
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.js.map +1 -0
- package/es/modules/unit/components/UnitItem/SubUnitItem.d.ts +4 -0
- package/es/modules/unit/components/UnitItem/SubUnitItem.js +35 -0
- package/es/modules/unit/components/UnitItem/SubUnitItem.js.map +1 -0
- package/es/modules/unit/components/UnitItem/index.less +23 -5
- package/es/modules/unit/components/UnitItem/state.d.ts +20 -0
- package/es/modules/unit/components/UnitItem/state.js +20 -0
- package/es/modules/unit/components/UnitItem/state.js.map +1 -0
- package/es/modules/unit/components/UnitList/index.d.ts +4 -0
- package/es/modules/unit/components/UnitList/index.js +37 -0
- package/es/modules/unit/components/UnitList/index.js.map +1 -0
- package/es/modules/unit/components/UnitList/state.d.ts +15 -0
- package/es/modules/unit/components/UnitList/state.js +31 -0
- package/es/modules/unit/components/UnitList/state.js.map +1 -0
- package/es/modules/unit/components/UnitPropertiesView/index.d.ts +6 -0
- package/es/modules/unit/components/UnitPropertiesView/index.js +22 -0
- package/es/modules/unit/components/UnitPropertiesView/index.js.map +1 -0
- package/es/modules/unit/components/UnitSortableTree/index.d.ts +10 -0
- package/es/modules/unit/components/UnitSortableTree/index.js +54 -0
- package/es/modules/unit/components/UnitSortableTree/index.js.map +1 -0
- package/es/modules/unit/components/UnitSortableTree/state.d.ts +50 -0
- package/es/modules/unit/components/UnitSortableTree/state.js +151 -0
- package/es/modules/unit/components/UnitSortableTree/state.js.map +1 -0
- package/es/modules/unit/components/UnitTabs/index.d.ts +6 -0
- package/es/modules/unit/components/UnitTabs/index.js +29 -0
- package/es/modules/unit/components/UnitTabs/index.js.map +1 -0
- package/es/modules/unit/controls/ContactSelect/index.d.ts +9 -0
- package/es/modules/unit/controls/ContactSelect/index.js +78 -0
- package/es/modules/unit/controls/ContactSelect/index.js.map +1 -0
- package/es/modules/unit/controls/ContactSelect/state.d.ts +23 -0
- package/es/modules/unit/controls/ContactSelect/state.js +43 -0
- package/es/modules/unit/controls/ContactSelect/state.js.map +1 -0
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.d.ts +6 -0
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js +32 -0
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js.map +1 -0
- package/es/modules/unit/{components → controls}/QuickDataIcon/index.d.ts +2 -6
- package/es/modules/unit/controls/QuickDataIcon/index.js +36 -0
- package/es/modules/unit/controls/QuickDataIcon/index.js.map +1 -0
- package/es/modules/unit/controls/QuickDataIcon/index.less +0 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.d.ts +13 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.js +59 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.js.map +1 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.less +20 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.d.ts +34 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.js +71 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.js.map +1 -0
- package/es/modules/unit/controls/ToolBar/index.d.ts +12 -0
- package/es/modules/unit/controls/ToolBar/index.js +54 -0
- package/es/modules/unit/controls/ToolBar/index.js.map +1 -0
- package/es/modules/unit/controls/ToolBar/index.less +18 -0
- package/es/modules/unit/controls/ToolBar/state.d.ts +40 -0
- package/es/modules/unit/controls/ToolBar/state.js +50 -0
- package/es/modules/unit/controls/ToolBar/state.js.map +1 -0
- package/es/modules/unit/controls/UnitTypeFilter/index.d.ts +3 -0
- package/es/modules/unit/controls/UnitTypeFilter/index.js +21 -0
- package/es/modules/unit/controls/UnitTypeFilter/index.js.map +1 -0
- package/es/modules/unit/controls/UnitTypeFilter/state.d.ts +18 -0
- package/es/modules/unit/controls/UnitTypeFilter/state.js +63 -0
- package/es/modules/unit/controls/UnitTypeFilter/state.js.map +1 -0
- package/es/modules/unit/data/FileStore/FileContext.d.ts +6 -0
- package/es/modules/unit/data/FileStore/FileContext.js +40 -0
- package/es/modules/unit/data/FileStore/FileContext.js.map +1 -0
- package/es/modules/unit/data/FileStore/index.d.ts +1 -0
- package/es/modules/unit/data/FileStore/index.js +2 -0
- package/es/modules/unit/data/FileStore/index.js.map +1 -0
- package/es/modules/unit/data/StoreContext/index.d.ts +3 -0
- package/es/modules/unit/data/StoreContext/index.js +4 -0
- package/es/modules/unit/data/StoreContext/index.js.map +1 -0
- package/es/modules/unit/data/UnitContext/index.d.ts +20 -0
- package/es/modules/unit/data/UnitContext/index.js +32 -0
- package/es/modules/unit/data/UnitContext/index.js.map +1 -0
- package/es/modules/unit/data/UnitStore.d.ts +103 -0
- package/es/modules/unit/data/UnitStore.js +180 -0
- package/es/modules/unit/data/UnitStore.js.map +1 -0
- package/es/modules/unit/data/hooks.d.ts +25 -0
- package/es/modules/unit/data/hooks.js +91 -0
- package/es/modules/unit/data/hooks.js.map +1 -0
- package/es/modules/unit/data/index.d.ts +3 -0
- package/es/modules/unit/data/index.js +3 -0
- package/es/modules/unit/data/index.js.map +1 -0
- package/es/modules/unit/data/interfaces/IAddress.d.ts +14 -0
- package/es/modules/unit/data/interfaces/IAddress.js +1 -0
- package/es/modules/unit/data/interfaces/IAddress.js.map +1 -0
- package/es/modules/unit/data/interfaces/IEntityName.d.ts +6 -0
- package/es/modules/unit/data/interfaces/IEntityName.js +1 -0
- package/es/modules/unit/data/interfaces/IEntityName.js.map +1 -0
- package/es/modules/unit/data/interfaces/IUnit.d.ts +47 -0
- package/es/modules/unit/data/interfaces/IUnit.js +1 -0
- package/es/modules/unit/data/interfaces/IUnit.js.map +1 -0
- package/es/modules/unit/data/interfaces/index.d.ts +3 -0
- package/es/modules/unit/data/interfaces/index.js +1 -0
- package/es/modules/unit/data/interfaces/index.js.map +1 -0
- package/es/modules/unit/pages/UnitDefaultView/index.d.ts +3 -0
- package/es/modules/unit/pages/UnitDefaultView/index.js +47 -0
- package/es/modules/unit/pages/UnitDefaultView/index.js.map +1 -0
- package/es/modules/unit/pages/UnitDefaultView/index.less +17 -0
- package/es/modules/unit/pages/UnitListView/index.d.ts +3 -0
- package/es/modules/unit/pages/UnitListView/index.js +10 -0
- package/es/modules/unit/pages/UnitListView/index.js.map +1 -0
- package/es/modules/unit/pages/UnitTreeView/index.d.ts +3 -0
- package/es/modules/unit/pages/UnitTreeView/index.js +47 -0
- package/es/modules/unit/pages/UnitTreeView/index.js.map +1 -0
- package/es/modules/unit/pages/UnitTreeView/index.less +31 -0
- package/es/modules/unit/pages/UnitTreeView/state.d.ts +5 -0
- package/es/modules/unit/pages/UnitTreeView/state.js +14 -0
- package/es/modules/unit/pages/UnitTreeView/state.js.map +1 -0
- package/es/pages/TreeViewPage/index.js +27 -20
- package/es/pages/TreeViewPage/index.js.map +1 -1
- package/es/pages/TreeViewPage/index.less +28 -19
- package/es/pages/TreeViewPage/state.d.ts +5 -0
- package/es/pages/TreeViewPage/state.js +14 -0
- package/es/pages/TreeViewPage/state.js.map +1 -0
- package/es/routes.d.ts +18 -0
- package/es/routes.js +40 -1
- package/es/routes.js.map +1 -1
- package/package.json +3 -1
- package/es/controls/DocumentTypeFilter/index.js +0 -54
- package/es/controls/DocumentTypeFilter/index.js.map +0 -1
- package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.d.ts +0 -14
- package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js +0 -28
- package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js.map +0 -1
- package/es/modules/unit/components/QuickDataIcon/index.js +0 -45
- package/es/modules/unit/components/QuickDataIcon/index.js.map +0 -1
- package/es/modules/unit/components/UnitItem/index.d.ts +0 -6
- package/es/modules/unit/components/UnitItem/index.js +0 -19
- package/es/modules/unit/components/UnitItem/index.js.map +0 -1
- /package/es/modules/unit/components/{QuickDataIcon → UnitList}/index.less +0 -0
- /package/es/{controls/DocumentTypeFilter/index.d.ts → modules/unit/components/UnitPropertiesView/index.less} +0 -0
- /package/es/modules/unit/{components → controls}/QuickDataIcon/UnitTeamsIcon/index.less +0 -0
|
@@ -2,17 +2,18 @@ import "./index.less";
|
|
|
2
2
|
import { Avatar, Tooltip } from "@voplus/antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import classnames from "classnames";
|
|
5
|
-
import
|
|
5
|
+
import styles from "./index.less";
|
|
6
6
|
import { useObserver } from "mobx-react-lite";
|
|
7
|
+
import { useUnit } from "../../data";
|
|
7
8
|
const colorList = ["#765FEE", "#fe4066", "#FFC832", "#FF8F5E", "#3AC43A", "#FFC832"];
|
|
8
9
|
const UnitAvatar = (props) => {
|
|
9
|
-
const { id, index, size, disabled, tooltip } = props;
|
|
10
|
-
const contact =
|
|
10
|
+
const { id, index, size, disabled, tooltip, className } = props;
|
|
11
|
+
const contact = useUnit(id, { reload: false });
|
|
11
12
|
const avatar = useObserver(() => (React.createElement(Avatar
|
|
12
13
|
// src={contact.url}
|
|
13
14
|
, {
|
|
14
15
|
// src={contact.url}
|
|
15
|
-
size: size, className: classnames({ "avatar-item-disabled": !!disabled }, "avatar-item-img"), style: { backgroundColor: colorList[(index || 0) % 6] } }, setName(contact.name))));
|
|
16
|
+
size: size, className: classnames({ "avatar-item-disabled": !!disabled }, styles["avatar-item-img"], className), style: { backgroundColor: colorList[(index || 0) % 6] } }, setName(contact.name))));
|
|
16
17
|
return useObserver(() => (React.createElement(React.Fragment, null, !tooltip ? avatar : React.createElement(Tooltip, { title: contact.name }, avatar))));
|
|
17
18
|
function setName(name) {
|
|
18
19
|
let str = "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitAvatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitAvatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,SAAS,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAErF,MAAM,UAAU,GAAG,CAAC,KAOnB,EAAE,EAAE;IACJ,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAChE,MAAM,OAAO,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAE/C,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,CAChC,oBAAC,MAAM;IACN,oBAAoB;;QAApB,oBAAoB;QACpB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,UAAU,CACpB,EAAE,sBAAsB,EAAE,CAAC,CAAC,QAAQ,EAAE,EACtC,MAAM,CAAC,iBAAiB,CAAC,EACzB,SAAS,CACT,EACD,KAAK,EAAE,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,IAGtD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CACd,CACT,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CACxB,oBAAC,KAAK,CAAC,QAAQ,QACb,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAC,OAAO,IAAC,KAAK,EAAE,OAAO,CAAC,IAAI,IAAG,MAAM,CAAW,CACrD,CACjB,CAAC,CAAC;IACH,SAAS,OAAO,CAAC,IAAY;QAC5B,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE;YAC5B,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvB,CAAC,EAAE;QACH,OAAO,GAAG,CAAC;IACZ,CAAC;AACF,CAAC,CAAC;AACF,UAAU,CAAC,YAAY,GAAG;IACzB,IAAI,EAAE,OAAO;CACb,CAAC;AACF,eAAe,UAAU,CAAC"}
|
|
@@ -1,14 +1,105 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Button, DatePicker, Form, Input } from "@voplus/antd";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
import { useUnit, useUnitStore } from "../../data";
|
|
5
|
+
import { InlineEdit } from "@voplus/morpho-ui";
|
|
6
|
+
import { Scrollbars } from "react-custom-scrollbars";
|
|
7
|
+
import { State } from "./state";
|
|
8
|
+
import classnames from "classnames";
|
|
2
9
|
import styles from "./index.less";
|
|
3
|
-
import {
|
|
10
|
+
import { toJS } from "mobx";
|
|
4
11
|
import { useObserver } from "mobx-react-lite";
|
|
5
12
|
const UnitDetails = (props) => {
|
|
6
|
-
const
|
|
7
|
-
const
|
|
13
|
+
const [state] = useState(new State());
|
|
14
|
+
const store = useUnitStore();
|
|
15
|
+
state.id = props.id;
|
|
16
|
+
state.contact = useUnit(state.id, { reload: false });
|
|
17
|
+
const [form] = Form.useForm();
|
|
18
|
+
const layout = {
|
|
19
|
+
labelCol: { span: 6 },
|
|
20
|
+
wrapperCol: { span: 18 }
|
|
21
|
+
};
|
|
22
|
+
const editLayout = {
|
|
23
|
+
wrapperCol: { offset: 6, span: 16 }
|
|
24
|
+
};
|
|
25
|
+
const tailLayout = {
|
|
26
|
+
wrapperCol: { offset: 0, span: 24 }
|
|
27
|
+
};
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
state.birthday = "";
|
|
30
|
+
state.birthdayEdit = false;
|
|
31
|
+
state.addressEdit = false;
|
|
32
|
+
}, [props.id]);
|
|
8
33
|
return useObserver(() => (React.createElement("div", { className: styles["unit-details"] },
|
|
9
|
-
React.createElement(
|
|
10
|
-
React.createElement(
|
|
11
|
-
|
|
34
|
+
React.createElement(Scrollbars, { autoHide: true },
|
|
35
|
+
React.createElement(Form, Object.assign({}, layout, { form: form, scrollToFirstError: true, onFinish: onFinish }),
|
|
36
|
+
React.createElement(Form.Item, Object.assign({}, tailLayout),
|
|
37
|
+
React.createElement("div", { className: "unit-details-title" }, "CONTACT INFORMATION")),
|
|
38
|
+
React.createElement(Form.Item, { name: "phone", label: "Phone" },
|
|
39
|
+
React.createElement(InlineEdit, { defaultValue: state.contact.phone, content: v => React.createElement("div", { className: classnames("file-name") }, v.store.value), onSave: (value) => save(value, state.contact.phone, { phone: value }) })),
|
|
40
|
+
React.createElement(Form.Item, { label: "Address" }, state.addressEdit ? (React.createElement(React.Fragment, null,
|
|
41
|
+
React.createElement(Form.Item, { name: ["address", "line1"] },
|
|
42
|
+
React.createElement(Input, { placeholder: "line1..." })),
|
|
43
|
+
React.createElement(Form.Item, { name: ["address", "line2"] },
|
|
44
|
+
React.createElement(Input, { placeholder: "line2..." })),
|
|
45
|
+
React.createElement(Form.Item, { name: ["address", "city"] },
|
|
46
|
+
React.createElement(Input, { placeholder: "city..." })),
|
|
47
|
+
React.createElement(Form.Item, { name: ["address", "state"] },
|
|
48
|
+
React.createElement(Input, { placeholder: "state..." })),
|
|
49
|
+
React.createElement(Form.Item, { name: ["address", "postalCode"] },
|
|
50
|
+
React.createElement(Input, { placeholder: "postalCode..." })),
|
|
51
|
+
React.createElement(Form.Item, { name: ["address", "country"] },
|
|
52
|
+
React.createElement(Input, { placeholder: "country..." })))) : (React.createElement("div", { className: classnames("file-name"), onClick: addressEdit },
|
|
53
|
+
state.contact.address.country,
|
|
54
|
+
state.contact.address.state,
|
|
55
|
+
state.contact.address.city,
|
|
56
|
+
state.contact.address.line2,
|
|
57
|
+
state.contact.address.line1))),
|
|
58
|
+
state.addressEdit && (React.createElement(Form.Item, Object.assign({}, editLayout),
|
|
59
|
+
React.createElement(Button, { onClick: () => (state.addressEdit = false) }, "Cancel"),
|
|
60
|
+
React.createElement(Button, { className: "but-submit", type: "primary", htmlType: "submit" }, "Save"))),
|
|
61
|
+
React.createElement(Form.Item, { name: "email", label: "E-mail" },
|
|
62
|
+
React.createElement(InlineEdit, { defaultValue: state.contact.email, content: v => React.createElement("div", { className: classnames("file-name") }, v.store.value), onSave: (value) => save(value, state.contact.email, { email: value }) })),
|
|
63
|
+
React.createElement(Form.Item, { name: "site", label: "Site" },
|
|
64
|
+
React.createElement(InlineEdit, { defaultValue: state.contact.site, content: v => React.createElement("div", { className: classnames("file-name") }, v.store.value), onSave: (value) => save(value, state.contact.site, { site: value }) })),
|
|
65
|
+
React.createElement(Form.Item, Object.assign({}, tailLayout),
|
|
66
|
+
React.createElement("div", { className: "unit-details-title" }, "BASIC INFORMATION")),
|
|
67
|
+
React.createElement(Form.Item, { name: "birthday", label: "Birthday" }, state.birthdayEdit ? (React.createElement(DatePicker, { defaultValue: moment(state.contact.birthday), open: state.birthdayEdit, bordered: false, onChange: dateChange })) : (React.createElement("div", { className: classnames("file-name"), onClick: () => (state.birthdayEdit = true) }, state.birthday ? state.birthday : JSON.stringify(toJS(state.contact.birthday))))),
|
|
68
|
+
React.createElement(Form.Item, { name: "gender", label: "Gender" },
|
|
69
|
+
React.createElement(InlineEdit, { defaultValue: state.contact.gender, content: v => React.createElement("div", { className: classnames("file-name") }, v.store.value), onSave: (value) => save(value, state.contact.gender, { gender: value }) })))))));
|
|
70
|
+
function addressEdit() {
|
|
71
|
+
state.addressEdit = true;
|
|
72
|
+
form.setFieldsValue({
|
|
73
|
+
address: {
|
|
74
|
+
line1: state.contact.address.line1,
|
|
75
|
+
line2: state.contact.address.line2,
|
|
76
|
+
city: state.contact.address.city,
|
|
77
|
+
state: state.contact.address.state,
|
|
78
|
+
country: state.contact.address.country
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/** edit save */
|
|
83
|
+
function save(v, name, params) {
|
|
84
|
+
if ((v === null || v === void 0 ? void 0 : v.trim()) === name)
|
|
85
|
+
return;
|
|
86
|
+
store.edit(state.id, params);
|
|
87
|
+
}
|
|
88
|
+
/** birthday change save */
|
|
89
|
+
function dateChange(date, dateString) {
|
|
90
|
+
state.birthday = dateString;
|
|
91
|
+
save(dateString, JSON.stringify(toJS(state.contact.birthday)), {
|
|
92
|
+
birthday: new Date(dateString)
|
|
93
|
+
});
|
|
94
|
+
state.birthdayEdit = false;
|
|
95
|
+
}
|
|
96
|
+
/** address change save */
|
|
97
|
+
function onFinish(values) {
|
|
98
|
+
save(JSON.stringify(values.address), JSON.stringify(state.contact.address), {
|
|
99
|
+
address: values.address
|
|
100
|
+
});
|
|
101
|
+
state.addressEdit = false;
|
|
102
|
+
}
|
|
12
103
|
};
|
|
13
104
|
export default UnitDetails;
|
|
14
105
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitDetails/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitDetails/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,MAAkB,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,WAAW,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC7C,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACpB,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAErD,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9B,MAAM,MAAM,GAAG;QACd,QAAQ,EA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;YAC3E,OAAO,EAAE,MAAM,CAAC,OAAO;SACvB,CAAC,CAAC;QACH,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,5 +1,41 @@
|
|
|
1
|
-
.unit-details{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
.unit-details {
|
|
2
|
+
height: 100%;
|
|
3
|
+
:global {
|
|
4
|
+
.ant-form{
|
|
5
|
+
margin: 20px;
|
|
6
|
+
}
|
|
7
|
+
.ant-form-item {
|
|
8
|
+
margin-bottom: 15px;
|
|
9
|
+
}
|
|
10
|
+
.ant-form-item-label {
|
|
11
|
+
text-align: left;
|
|
12
|
+
}
|
|
13
|
+
.ant-form-item-label > label {
|
|
14
|
+
font-size: 15px;
|
|
15
|
+
color: #000000;
|
|
16
|
+
}
|
|
17
|
+
.link {
|
|
18
|
+
color: #4395ff;
|
|
19
|
+
}
|
|
20
|
+
.unit-details-title {
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
padding: 15px 0;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
.unit-editable {
|
|
28
|
+
.ant-btn {
|
|
29
|
+
font-size: 16px;
|
|
30
|
+
padding: 0 5px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
.but-submit{
|
|
35
|
+
margin: 0 20px;
|
|
36
|
+
}
|
|
37
|
+
.file-name{
|
|
38
|
+
min-height: 24.55px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.birthdayEdit = false;
|
|
6
|
+
this.addressEdit = false;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
__decorate([
|
|
10
|
+
observable
|
|
11
|
+
], State.prototype, "id", void 0);
|
|
12
|
+
__decorate([
|
|
13
|
+
observable
|
|
14
|
+
], State.prototype, "contact", void 0);
|
|
15
|
+
__decorate([
|
|
16
|
+
observable
|
|
17
|
+
], State.prototype, "birthday", void 0);
|
|
18
|
+
__decorate([
|
|
19
|
+
observable
|
|
20
|
+
], State.prototype, "birthdayEdit", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
observable
|
|
23
|
+
], State.prototype, "addressEdit", void 0);
|
|
24
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitDetails/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAoB,UAAU,EAAE,MAAM,MAAM,CAAC;AAIpD,MAAM,OAAO,KAAK;IAAlB;QAIoB,iBAAY,GAAG,KAAK,CAAC;QACrB,gBAAW,GAAG,KAAK,CAAC;IACxC,CAAC;CAAA;AALY;IAAX,UAAU;iCAAmB;AAClB;IAAX,UAAU;sCAAuB;AACtB;IAAX,UAAU;uCAAsB;AACrB;IAAX,UAAU;2CAA6B;AAC5B;IAAX,UAAU;0CAA4B"}
|
|
@@ -1,14 +1,38 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { useUnit, useUnitStore } from "../../data";
|
|
3
|
+
import { InlineEdit } from "@voplus/morpho-ui";
|
|
4
|
+
import { Skeleton } from "@voplus/antd";
|
|
5
|
+
import { State } from "./state";
|
|
6
|
+
import ToolBar from "../../controls/ToolBar";
|
|
2
7
|
import UnitAvatar from "../UnitAvatar";
|
|
8
|
+
import classnames from "classnames";
|
|
3
9
|
import styles from "./index.less";
|
|
4
|
-
import {
|
|
10
|
+
import { useAsideContentContext } from "@voplus/morpho-ui/es/components/layout/AsideContent";
|
|
5
11
|
import { useObserver } from "mobx-react-lite";
|
|
6
12
|
const UnitHead = (props) => {
|
|
7
|
-
const { id } = props;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
const { id, onExpand, onReload } = props;
|
|
14
|
+
const [state] = useState(new State());
|
|
15
|
+
const store = useUnitStore();
|
|
16
|
+
const asideContext = useAsideContentContext();
|
|
17
|
+
state.contact = useUnit(id, { reload: true });
|
|
18
|
+
return useObserver(() => (React.createElement("div", { className: styles["unit-head"] }, state.contact.loading ? (React.createElement(Skeleton, { active: true })) : (React.createElement(React.Fragment, null,
|
|
19
|
+
React.createElement("div", { className: "tool-bar-content" },
|
|
20
|
+
React.createElement(ToolBar, { id: id, reload: true, url: onExpand ? "" : `/units/${id}`, expand: !!onExpand, onDelete: onItemDelete, onReLoad: onReload, onExpand: onExpand })),
|
|
21
|
+
React.createElement(UnitAvatar, { id: id, size: 70 }),
|
|
22
|
+
React.createElement("div", { className: "unit-name" },
|
|
23
|
+
React.createElement(InlineEdit, { defaultValue: state.contact.name, content: v => React.createElement("div", { className: classnames("inline-edit") }, v.store.value), onSave: value => save(value, state.contact.name, { Name: value }) })),
|
|
24
|
+
React.createElement("div", null, state.contact.type))))));
|
|
25
|
+
/** edit save */
|
|
26
|
+
function save(v, name, params) {
|
|
27
|
+
if (v.trim() === name)
|
|
28
|
+
return;
|
|
29
|
+
store.edit(state.contact.id, params);
|
|
30
|
+
}
|
|
31
|
+
/**delete contact*/
|
|
32
|
+
async function onItemDelete() {
|
|
33
|
+
await store.delete(id);
|
|
34
|
+
asideContext.closeAside();
|
|
35
|
+
}
|
|
12
36
|
};
|
|
13
37
|
export default UnitHead;
|
|
14
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitHead/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;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,eAAe,QAAQ,CAAC"}
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
.unit-head {
|
|
2
2
|
text-align: center;
|
|
3
|
+
padding: 10px 0;
|
|
4
|
+
margin: 0 20px;
|
|
3
5
|
:global {
|
|
6
|
+
.tool-bar-content{
|
|
7
|
+
text-align: right;
|
|
8
|
+
}
|
|
9
|
+
// .unit-name {
|
|
10
|
+
// color: #000;
|
|
11
|
+
// font-size: 16px;
|
|
12
|
+
// font-weight: 500;
|
|
13
|
+
// margin-top: 12px;
|
|
14
|
+
// }
|
|
4
15
|
.unit-name {
|
|
5
16
|
color: #000;
|
|
6
|
-
font-size:
|
|
7
|
-
|
|
8
|
-
|
|
17
|
+
font-size: 16px;
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
margin-top: 12px;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
&.inline-edit{
|
|
22
|
+
cursor: text;
|
|
23
|
+
}
|
|
9
24
|
}
|
|
10
25
|
}
|
|
11
26
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitHead/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAoB,UAAU,EAAQ,MAAM,MAAM,CAAC;AAY1D,MAAM,OAAO,KAAK;CAEjB;AADY;IAAX,UAAU;sCAAuB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { State } from "./state";
|
|
3
|
+
import { UnitContext, UnitContextState, useUnitContext } from "../../data/UnitContext";
|
|
4
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
5
|
+
import QuickDataIcon from "../../controls/QuickDataIcon";
|
|
6
|
+
import UnitAvatar from "../UnitAvatar";
|
|
7
|
+
import classnames from "classnames";
|
|
8
|
+
import { faBars } from "@fortawesome/pro-light-svg-icons";
|
|
9
|
+
import styles from "./index.less";
|
|
10
|
+
import { useObserver } from "mobx-react-lite";
|
|
11
|
+
import { useUnit } from "../../data";
|
|
12
|
+
const DefaultUnitItem = (props) => {
|
|
13
|
+
const { id, index, className, connectDragSource } = props;
|
|
14
|
+
const [state] = useState(new State());
|
|
15
|
+
const contact = useUnit(id);
|
|
16
|
+
const store = useUnitContext();
|
|
17
|
+
const [options] = useState(new UnitContextState());
|
|
18
|
+
return useObserver(() => (React.createElement(UnitContext.Provider, { value: options },
|
|
19
|
+
React.createElement("div", { className: classnames(styles["unit-item"], className), onClick: () => { var _a; return (_a = store === null || store === void 0 ? void 0 : store.onUnitSelected) === null || _a === void 0 ? void 0 : _a.call(store, contact.id); } },
|
|
20
|
+
React.createElement("div", { className: "unit-avatar" },
|
|
21
|
+
React.createElement(UnitAvatar, { id: id, size: "large", index: index })),
|
|
22
|
+
React.createElement("div", null,
|
|
23
|
+
React.createElement("div", { className: "unit-name" }, contact.name),
|
|
24
|
+
React.createElement("div", null,
|
|
25
|
+
connectDragSource ? (connectDragSource(React.createElement("span", { className: classnames("task-move", { show: state.editable }) }, React.createElement(FAIcon, { icon: faBars })))) : (React.createElement("span", { className: "task-move" })),
|
|
26
|
+
React.createElement(QuickDataIcon, { id: id })))))));
|
|
27
|
+
};
|
|
28
|
+
export default DefaultUnitItem;
|
|
29
|
+
//# sourceMappingURL=DefaultUnitItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultUnitItem.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitItem/DefaultUnitItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAiB,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEvF,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,aAAa,MA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AAiB,CAChB,8BAAM,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,IAChE,oBAAC,MAAM,IAAC,IAAI,EAAE,MAAM,GAAI,CACnB,CACP,CACD,CAAC,CAAC,CAAC,CACH,8BAAM,SAAS,EAAC,WAAW,GAAG,CAC9B;oBACD,oBAAC,aAAa,IAAC,EAAE,EAAE,EAAE,GAAI,CACpB,CACD,CACD,CACgB,CACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Checkbox } from "@voplus/antd";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { State } from "./state";
|
|
4
|
+
import { UnitContext, UnitContextState, useUnitContext } from "../../data/UnitContext";
|
|
5
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
6
|
+
import QuickDataIcon from "../../controls/QuickDataIcon";
|
|
7
|
+
import ToolBar from "../../controls/ToolBar";
|
|
8
|
+
import UnitAvatar from "../UnitAvatar";
|
|
9
|
+
import classnames from "classnames";
|
|
10
|
+
import { faBars } from "@fortawesome/pro-light-svg-icons";
|
|
11
|
+
import styles from "./index.less";
|
|
12
|
+
import { useObserver } from "mobx-react-lite";
|
|
13
|
+
import { useUnit } from "../../data";
|
|
14
|
+
const SubUnitItem = (props) => {
|
|
15
|
+
const { id, index, type, multiple, className, connectDragSource } = props;
|
|
16
|
+
const [state] = useState(new State());
|
|
17
|
+
const contact = useUnit(id);
|
|
18
|
+
const store = useUnitContext();
|
|
19
|
+
const [options] = useState(new UnitContextState());
|
|
20
|
+
return useObserver(() => (React.createElement(UnitContext.Provider, { value: options },
|
|
21
|
+
React.createElement("div", { className: classnames(styles["unit-item"], className), onClick: () => { var _a; return (_a = store === null || store === void 0 ? void 0 : store.onUnitSelected) === null || _a === void 0 ? void 0 : _a.call(store, contact.id); }, onMouseLeave: () => (state.isHover = false) },
|
|
22
|
+
React.createElement("div", { className: classnames("unit-item_box", { "unit-item_hover": state.isHover }), onMouseOver: () => (state.isHover = !multiple && !state.editable) },
|
|
23
|
+
multiple && React.createElement(Checkbox, { value: props.id, className: "multiple-checkbox" }),
|
|
24
|
+
React.createElement("div", { className: "unit-avatar" },
|
|
25
|
+
React.createElement(UnitAvatar, { id: id, size: "large", index: index })),
|
|
26
|
+
React.createElement("div", null,
|
|
27
|
+
React.createElement("div", { className: "unit-name" }, contact.name),
|
|
28
|
+
React.createElement("div", null,
|
|
29
|
+
!multiple && connectDragSource ? (connectDragSource(React.createElement("span", { className: classnames("task-move", { show: state.editable }) }, React.createElement(FAIcon, { icon: faBars })))) : (React.createElement("span", { className: "task-move" })),
|
|
30
|
+
React.createElement(QuickDataIcon, { id: id })))),
|
|
31
|
+
type === "sub" && (React.createElement("div", { className: classnames("hover-operate-icon", { show: state.isHover }) },
|
|
32
|
+
React.createElement(ToolBar, { id: props.id, size: "middle", url: `/units/${props.id}` })))))));
|
|
33
|
+
};
|
|
34
|
+
export default SubUnitItem;
|
|
35
|
+
//# sourceMappingURL=SubUnitItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubUnitItem.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitItem/SubUnitItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,QAAQ,EAAS,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAiB,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEvF,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,OAAO,MAAM,wBAAwB,CAAC;A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6
|
+
position: relative;
|
|
7
|
+
padding: 10px 0;
|
|
8
|
+
margin: 0 20px;
|
|
9
|
+
border-bottom: 1px solid #d9d9d9;
|
|
6
10
|
:global {
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
.unit-item_box {
|
|
12
|
+
flex:1;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
.multiple-checkbox {
|
|
17
|
+
margin-right: 10px;
|
|
9
18
|
}
|
|
10
19
|
.unit-name {
|
|
11
20
|
color: #000;
|
|
12
21
|
font-size: 15px;
|
|
13
22
|
font-weight: 500;
|
|
14
23
|
}
|
|
15
|
-
.avatar
|
|
24
|
+
.unit-avatar {
|
|
16
25
|
margin-right: 10px;
|
|
17
26
|
}
|
|
27
|
+
.hover-operate-icon {
|
|
28
|
+
display: none;
|
|
29
|
+
position: absolute;
|
|
30
|
+
right: 0;
|
|
31
|
+
z-index: 100;
|
|
32
|
+
&.show {
|
|
33
|
+
display: block;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
18
36
|
}
|
|
19
37
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ConnectDragSource } from "react-dnd";
|
|
2
|
+
import { IUnit } from "../../data";
|
|
3
|
+
export declare type UnitItemProps = {
|
|
4
|
+
id: string;
|
|
5
|
+
index?: number;
|
|
6
|
+
type?: string;
|
|
7
|
+
reload?: boolean;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
connectDragSource?: ConnectDragSource;
|
|
10
|
+
onExpand?: () => void;
|
|
11
|
+
onReload?: () => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class State {
|
|
15
|
+
contact: IUnit;
|
|
16
|
+
/** Edit model of unit */
|
|
17
|
+
editable: boolean;
|
|
18
|
+
/** MouseOver of sub unit */
|
|
19
|
+
isHover: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
/** Edit model of unit */
|
|
6
|
+
this.editable = false;
|
|
7
|
+
/** MouseOver of sub unit */
|
|
8
|
+
this.isHover = false;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
__decorate([
|
|
12
|
+
observable
|
|
13
|
+
], State.prototype, "contact", void 0);
|
|
14
|
+
__decorate([
|
|
15
|
+
observable
|
|
16
|
+
], State.prototype, "editable", void 0);
|
|
17
|
+
__decorate([
|
|
18
|
+
observable
|
|
19
|
+
], State.prototype, "isHover", void 0);
|
|
20
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitItem/state.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAclC,MAAM,OAAO,KAAK;IAAlB;QAEC,0BAA0B;QACP,aAAQ,GAAG,KAAK,CAAC;QACpC,6BAA6B;QACV,YAAO,GAAG,KAAK,CAAC;IACpC,CAAC;CAAA;AALY;IAAX,UAAU;sCAAuB;AAEtB;IAAX,UAAU;uCAAyB;AAExB;IAAX,UAAU;sCAAwB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DocumentStatusFilter, FlagFilter } from "../../../../controls/filters";
|
|
2
|
+
import { useAutoUpdateUnitListData, useUnitListEffect } from "../../data";
|
|
3
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
|
4
|
+
import React, { useState } from "react";
|
|
5
|
+
import { State } from "./state";
|
|
6
|
+
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
|
7
|
+
import NewUnitForm from "../NewUnitForm";
|
|
8
|
+
import UnitItem from "../UnitItem/DefaultUnitItem";
|
|
9
|
+
import UnitPropertiesView from "../UnitPropertiesView";
|
|
10
|
+
import { useObserver } from "mobx-react-lite";
|
|
11
|
+
import { useRenderOnChange } from "@voplus/morpho-ui";
|
|
12
|
+
const UnitList = (props) => {
|
|
13
|
+
const { readonly, parentId } = props;
|
|
14
|
+
const [state] = useState(new State());
|
|
15
|
+
state.props = props;
|
|
16
|
+
/** 建立 ListView 和useContactListEffect所需的ListDataState. 会根据parentId重建所以不需reset. */
|
|
17
|
+
const list = useCreateListDataState({
|
|
18
|
+
filterDefaults: {
|
|
19
|
+
filters: []
|
|
20
|
+
}
|
|
21
|
+
}, [parentId]);
|
|
22
|
+
/** 如果 list.filters.options变更了就重渲染,使下一行的useContactListEffect 可以接收新参数*/
|
|
23
|
+
useRenderOnChange(() => list.filters.options);
|
|
24
|
+
/** 把ListDataState传给useContactListEffect,使之可以自動更新loading, hasmore. */
|
|
25
|
+
useUnitListEffect(list, result => list.union(result), list.filters.options);
|
|
26
|
+
/** useOnNewContact, useOnDeleteContact的sugar syntax 自動更新list. */
|
|
27
|
+
useAutoUpdateUnitListData(list, d => d.parentNodeId === parentId);
|
|
28
|
+
return useObserver(() => (React.createElement(ListDataContext.Provider, { value: list },
|
|
29
|
+
React.createElement(ListView, { renderId: parentId, headerProps: {
|
|
30
|
+
filterViewProps: {
|
|
31
|
+
columns: [React.createElement(DocumentStatusFilter, { key: "Status" }), React.createElement(FlagFilter, { key: "Flag" })]
|
|
32
|
+
},
|
|
33
|
+
sortable: false
|
|
34
|
+
}, formViewTitle: "Add Unit", formView: React.createElement(NewUnitForm, { parentId: "c896a84e-b31a-4d10-a181-5d34a21b172d" }), propertiesView: (id) => React.createElement(UnitPropertiesView, { id: id }), renderItem: ({ item, index, connectDragSource }) => (React.createElement(UnitItem, { id: item.id, index: index, reload: !!readonly })) }))));
|
|
35
|
+
};
|
|
36
|
+
export default UnitList;
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitList/index.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