@voplus/morpho-document 1.0.0-dev242 → 1.0.0-dev243
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/changelog.md +2 -0
- package/es/components/ActivityLog/state.js +50 -54
- package/es/components/ActivityLog/state.js.map +1 -1
- package/es/components/AddDocDropdown/state.js +93 -97
- package/es/components/AddDocDropdown/state.js.map +1 -1
- package/es/components/AvatarList/state.js +46 -50
- package/es/components/AvatarList/state.js.map +1 -1
- package/es/components/BreadCrumbsHeader/state.js +33 -37
- package/es/components/BreadCrumbsHeader/state.js.map +1 -1
- package/es/components/DocumentCard/index.d.ts +10 -0
- package/es/components/DocumentCard/index.js +36 -0
- package/es/components/DocumentCard/index.js.map +1 -0
- package/es/components/DocumentCard/index.less +109 -0
- package/es/components/DocumentCard/state.d.ts +15 -0
- package/es/components/DocumentCard/state.js +67 -0
- package/es/components/DocumentCard/state.js.map +1 -0
- package/es/components/DocumentHeader/index.d.ts +1 -0
- package/es/components/DocumentHeader/index.js +11 -5
- package/es/components/DocumentHeader/index.js.map +1 -1
- package/es/components/DocumentHeader/index.less +4 -4
- package/es/components/DocumentHeader/state.d.ts +2 -0
- package/es/components/DocumentHeader/state.js +63 -67
- package/es/components/DocumentHeader/state.js.map +1 -1
- package/es/components/DocumentItem/state.js +44 -48
- package/es/components/DocumentItem/state.js.map +1 -1
- package/es/components/DocumentList/state.js +212 -216
- package/es/components/DocumentList/state.js.map +1 -1
- package/es/components/DocumentListView/state.js +8 -12
- package/es/components/DocumentListView/state.js.map +1 -1
- package/es/components/DocumentMenu/state.js +74 -78
- package/es/components/DocumentMenu/state.js.map +1 -1
- package/es/components/DocumentSelectDialog/state.js +68 -72
- package/es/components/DocumentSelectDialog/state.js.map +1 -1
- package/es/components/DocumentSortableTree/state.js +171 -175
- package/es/components/DocumentSortableTree/state.js.map +1 -1
- package/es/components/DocumentTree/state.js +82 -86
- package/es/components/DocumentTree/state.js.map +1 -1
- package/es/components/Links/state.js +63 -67
- package/es/components/Links/state.js.map +1 -1
- package/es/components/NewDocumentForm/state.js +35 -39
- package/es/components/NewDocumentForm/state.js.map +1 -1
- package/es/components/PeopleAccess/PeopleAccessState.js +132 -136
- package/es/components/PeopleAccess/PeopleAccessState.js.map +1 -1
- package/es/components/PublishModal/state.js +10 -14
- package/es/components/PublishModal/state.js.map +1 -1
- package/es/components/QuickAccessSearch/state.js +59 -63
- package/es/components/QuickAccessSearch/state.js.map +1 -1
- package/es/components/QuickViewDialog/state.js +22 -26
- package/es/components/QuickViewDialog/state.js.map +1 -1
- package/es/components/TagView/state.js +59 -63
- package/es/components/TagView/state.js.map +1 -1
- package/es/components/VersionsModal/state.js +23 -27
- package/es/components/VersionsModal/state.js.map +1 -1
- package/es/controls/DocumentStatusLabel/index.js +3 -1
- package/es/controls/DocumentStatusLabel/index.js.map +1 -1
- package/es/controls/DocumentStatusLabel/index.less +7 -1
- package/es/controls/FlagIcon/index.js +1 -1
- package/es/controls/FlagIcon/index.js.map +1 -1
- package/es/controls/FlagIcon/index.less +4 -4
- package/es/controls/ToolBar/state.js +143 -147
- package/es/controls/ToolBar/state.js.map +1 -1
- package/es/controls/filters/CreateDateFilter/state.js +27 -31
- package/es/controls/filters/CreateDateFilter/state.js.map +1 -1
- package/es/controls/filters/DocumentStatusFilter/state.js +38 -42
- package/es/controls/filters/DocumentStatusFilter/state.js.map +1 -1
- package/es/controls/filters/DocumentTypeFilter/state.js +48 -52
- package/es/controls/filters/DocumentTypeFilter/state.js.map +1 -1
- package/es/controls/filters/FlagFilter/state.js +46 -50
- package/es/controls/filters/FlagFilter/state.js.map +1 -1
- package/es/data/DocumentMetaStore.js +34 -38
- package/es/data/DocumentMetaStore.js.map +1 -1
- package/es/data/DocumentStore/DocumentStore.js +228 -232
- package/es/data/DocumentStore/DocumentStore.js.map +1 -1
- package/es/data/contexts/DocumentListContext/index.js +30 -34
- package/es/data/contexts/DocumentListContext/index.js.map +1 -1
- package/es/data/metas/FileTypeMeta.js +21 -25
- package/es/data/metas/FileTypeMeta.js.map +1 -1
- package/es/data/metas/ShortcutMeta.js +22 -26
- package/es/data/metas/ShortcutMeta.js.map +1 -1
- package/es/modules/unit/components/ActivityLog/state.js +15 -19
- package/es/modules/unit/components/ActivityLog/state.js.map +1 -1
- package/es/modules/unit/components/AddUnitDropdown/state.js +75 -79
- package/es/modules/unit/components/AddUnitDropdown/state.js.map +1 -1
- package/es/modules/unit/components/BreadCrumbsHeader/state.js +14 -18
- package/es/modules/unit/components/BreadCrumbsHeader/state.js.map +1 -1
- package/es/modules/unit/components/Members/state.js +21 -25
- package/es/modules/unit/components/Members/state.js.map +1 -1
- package/es/modules/unit/components/NewUnitForm/state.js +43 -47
- package/es/modules/unit/components/NewUnitForm/state.js.map +1 -1
- package/es/modules/unit/components/SubUnitList/state.js +28 -32
- package/es/modules/unit/components/SubUnitList/state.js.map +1 -1
- package/es/modules/unit/components/UnitDetails/state.js +20 -24
- package/es/modules/unit/components/UnitDetails/state.js.map +1 -1
- package/es/modules/unit/components/UnitHead/state.js +5 -9
- package/es/modules/unit/components/UnitHead/state.js.map +1 -1
- package/es/modules/unit/components/UnitItem/state.js +16 -20
- package/es/modules/unit/components/UnitItem/state.js.map +1 -1
- package/es/modules/unit/components/UnitList/state.js +27 -31
- package/es/modules/unit/components/UnitList/state.js.map +1 -1
- package/es/modules/unit/components/UnitSortableTree/state.js +153 -157
- package/es/modules/unit/components/UnitSortableTree/state.js.map +1 -1
- package/es/modules/unit/controls/ContactSelect/state.js +36 -40
- package/es/modules/unit/controls/ContactSelect/state.js.map +1 -1
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.js +64 -68
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.js.map +1 -1
- package/es/modules/unit/controls/ToolBar/state.js +58 -62
- package/es/modules/unit/controls/ToolBar/state.js.map +1 -1
- package/es/modules/unit/controls/UnitTypeFilter/state.js +55 -59
- package/es/modules/unit/controls/UnitTypeFilter/state.js.map +1 -1
- package/es/modules/unit/data/UnitContext/index.js +20 -24
- package/es/modules/unit/data/UnitContext/index.js.map +1 -1
- package/es/modules/unit/data/UnitStore.js +198 -202
- package/es/modules/unit/data/UnitStore.js.map +1 -1
- package/es/modules/unit/pages/UnitTreeView/state.js +10 -14
- package/es/modules/unit/pages/UnitTreeView/state.js.map +1 -1
- package/es/pages/Library/LibraryDefaultView/Content.d.ts +6 -0
- package/es/pages/Library/LibraryDefaultView/Content.js +31 -0
- package/es/pages/Library/LibraryDefaultView/Content.js.map +1 -0
- package/es/pages/Library/LibraryDefaultView/index.d.ts +4 -0
- package/es/pages/Library/LibraryDefaultView/index.js +74 -0
- package/es/pages/Library/LibraryDefaultView/index.js.map +1 -0
- package/es/pages/Library/LibraryDefaultView/index.less +54 -0
- package/es/pages/Library/LibraryDefaultView/state.d.ts +14 -0
- package/es/pages/Library/LibraryDefaultView/state.js +31 -0
- package/es/pages/Library/LibraryDefaultView/state.js.map +1 -0
- package/es/pages/Library/data/LibraryStore.d.ts +10 -0
- package/es/pages/Library/data/LibraryStore.js +16 -0
- package/es/pages/Library/data/LibraryStore.js.map +1 -0
- package/es/pages/Library/data/hook.d.ts +2 -0
- package/es/pages/Library/data/hook.js +10 -0
- package/es/pages/Library/data/hook.js.map +1 -0
- package/es/pages/Library/data/index.d.ts +3 -0
- package/es/pages/Library/data/index.js +4 -0
- package/es/pages/Library/data/index.js.map +1 -0
- package/es/pages/Library/data/interfaces.d.ts +2 -0
- package/es/pages/Library/data/interfaces.js +1 -0
- package/es/pages/Library/data/interfaces.js.map +1 -0
- package/es/pages/Page/PageDefaultView/index.d.ts +12 -0
- package/es/pages/Page/PageDefaultView/index.js +97 -0
- package/es/pages/Page/PageDefaultView/index.js.map +1 -0
- package/es/pages/Page/PageDefaultView/index.less +49 -0
- package/es/pages/Page/PageDefaultView/state.d.ts +7 -0
- package/es/pages/Page/PageDefaultView/state.js +15 -0
- package/es/pages/Page/PageDefaultView/state.js.map +1 -0
- package/es/pages/Page/PageTextItem/index.d.ts +7 -0
- package/es/pages/Page/PageTextItem/index.js +39 -0
- package/es/pages/Page/PageTextItem/index.js.map +1 -0
- package/es/pages/Page/PageTextItem/index.less +31 -0
- package/es/pages/Page/PageTextItem/state.d.ts +9 -0
- package/es/pages/Page/PageTextItem/state.js +22 -0
- package/es/pages/Page/PageTextItem/state.js.map +1 -0
- package/es/pages/Page/PlusDropDown/index.d.ts +7 -0
- package/es/pages/Page/PlusDropDown/index.js +14 -0
- package/es/pages/Page/PlusDropDown/index.js.map +1 -0
- package/es/pages/Page/PlusDropDown/index.less +11 -0
- package/es/pages/Page/data/IPageItemState.d.ts +4 -0
- package/es/pages/Page/data/IPageItemState.js +1 -0
- package/es/pages/Page/data/IPageItemState.js.map +1 -0
- package/es/pages/Page/data/PageContext.d.ts +18 -0
- package/es/pages/Page/data/PageContext.js +48 -0
- package/es/pages/Page/data/PageContext.js.map +1 -0
- package/es/pages/Page/data/PageStore.d.ts +10 -0
- package/es/pages/Page/data/PageStore.js +16 -0
- package/es/pages/Page/data/PageStore.js.map +1 -0
- package/es/pages/Page/data/hook.d.ts +2 -0
- package/es/pages/Page/data/hook.js +10 -0
- package/es/pages/Page/data/hook.js.map +1 -0
- package/es/pages/Page/data/index.d.ts +3 -0
- package/es/pages/Page/data/index.js +4 -0
- package/es/pages/Page/data/index.js.map +1 -0
- package/es/pages/Page/data/interfaces.d.ts +2 -0
- package/es/pages/Page/data/interfaces.js +1 -0
- package/es/pages/Page/data/interfaces.js.map +1 -0
- package/es/pages/TreeViewPage/state.js +10 -14
- package/es/pages/TreeViewPage/state.js.map +1 -1
- package/es/routes.d.ts +20 -0
- package/es/routes.js +27 -1
- package/es/routes.js.map +1 -1
- package/package.json +7 -7
|
@@ -3,90 +3,86 @@ import { Modal, message } from "@voplus/antd";
|
|
|
3
3
|
import { action, observable } from "mobx";
|
|
4
4
|
import ReferenceView from "@voplus/morpho-ui/es/components/layout/MainLayout/ReferenceView";
|
|
5
5
|
import Routes from "../../routes";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this._store.delete([this.props.id], { DeleteChilds: true });
|
|
25
|
-
}
|
|
6
|
+
export class State {
|
|
7
|
+
constructor(_store) {
|
|
8
|
+
this._store = _store;
|
|
9
|
+
}
|
|
10
|
+
/** Menu item click */
|
|
11
|
+
moreOperate({ key, domEvent }) {
|
|
12
|
+
domEvent.stopPropagation();
|
|
13
|
+
if (key === "Edit")
|
|
14
|
+
this.props.onEdit();
|
|
15
|
+
if (key === "Delete") {
|
|
16
|
+
Modal.confirm({
|
|
17
|
+
title: this.props.deleteTitel ? this.props.deleteTitel : "Do you want to delete this item?",
|
|
18
|
+
onOk: () => {
|
|
19
|
+
if (this.props.onDelete) {
|
|
20
|
+
return this.props.onDelete();
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this._store.delete([this.props.id], { DeleteChilds: true });
|
|
26
24
|
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
if (key === "Move") {
|
|
30
|
-
if (this.props.onMove)
|
|
31
|
-
this.props.onMove();
|
|
32
|
-
else {
|
|
33
|
-
this._store.cut([this.props.id]);
|
|
34
|
-
message.success("Document cut.");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (key === "Paste") {
|
|
38
|
-
if (this.props.onPaste) {
|
|
39
|
-
this.props.onPaste();
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.paste();
|
|
43
25
|
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (key === "Move") {
|
|
29
|
+
if (this.props.onMove)
|
|
30
|
+
this.props.onMove();
|
|
31
|
+
else {
|
|
32
|
+
this._store.cut([this.props.id]);
|
|
33
|
+
message.success("Document cut.");
|
|
44
34
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
if (key === "Open")
|
|
50
|
-
this.layout.history.push(this.props.url);
|
|
51
|
-
if (key === "Lock") {
|
|
52
|
-
this.props.onLock
|
|
53
|
-
? this.props.onLock()
|
|
54
|
-
: this._store.edit(this.props.id, { Status: "Readonly" });
|
|
35
|
+
}
|
|
36
|
+
if (key === "Paste") {
|
|
37
|
+
if (this.props.onPaste) {
|
|
38
|
+
this.props.onPaste();
|
|
55
39
|
}
|
|
56
|
-
|
|
57
|
-
this.
|
|
58
|
-
? this.props.onUnlock()
|
|
59
|
-
: this._store.edit(this.props.id, { Status: "Normal" });
|
|
40
|
+
else {
|
|
41
|
+
this.paste();
|
|
60
42
|
}
|
|
61
|
-
if (key === "Access")
|
|
62
|
-
this.props.onAccess();
|
|
63
|
-
if (key === "Publish")
|
|
64
|
-
this.props.onPublish();
|
|
65
|
-
if (key === "PublishLock")
|
|
66
|
-
this.props.onPublishLock();
|
|
67
|
-
if (key === "Refresh")
|
|
68
|
-
this.props.onRefresh();
|
|
69
|
-
if (key === "Print")
|
|
70
|
-
window.open(window.location.protocol + "//" + window.location.host + `${this.props.printPath}`, "_blank");
|
|
71
43
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
44
|
+
if (key === "OpenTreeView" && this.props.id)
|
|
45
|
+
this.layout.history.push(Routes.TreeViewPage.getUrl(this.props.id));
|
|
46
|
+
if (key === "OpenReferenceView" && this.props.id)
|
|
47
|
+
ReferenceView.navigate(this.layout, this.props.url);
|
|
48
|
+
if (key === "Open")
|
|
49
|
+
this.layout.history.push(this.props.url);
|
|
50
|
+
if (key === "Lock") {
|
|
51
|
+
this.props.onLock
|
|
52
|
+
? this.props.onLock()
|
|
53
|
+
: this._store.edit(this.props.id, { Status: "Readonly" });
|
|
54
|
+
}
|
|
55
|
+
if (key === "Unlock") {
|
|
56
|
+
this.props.onUnlock
|
|
57
|
+
? this.props.onUnlock()
|
|
58
|
+
: this._store.edit(this.props.id, { Status: "Normal" });
|
|
59
|
+
}
|
|
60
|
+
if (key === "Access")
|
|
61
|
+
this.props.onAccess();
|
|
62
|
+
if (key === "Publish")
|
|
63
|
+
this.props.onPublish();
|
|
64
|
+
if (key === "PublishLock")
|
|
65
|
+
this.props.onPublishLock();
|
|
66
|
+
if (key === "Refresh")
|
|
67
|
+
this.props.onRefresh();
|
|
68
|
+
if (key === "Print")
|
|
69
|
+
window.open(window.location.protocol + "//" + window.location.host + `${this.props.printPath}`, "_blank");
|
|
70
|
+
}
|
|
71
|
+
async paste() {
|
|
72
|
+
if (this._store.moveIds.some((id) => id === this.props.id)) {
|
|
73
|
+
return message.warn("Cannot move to itself");
|
|
78
74
|
}
|
|
75
|
+
await this._store.paste(this.props.id);
|
|
76
|
+
message.success("Document pasted.");
|
|
79
77
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
})();
|
|
91
|
-
export { State };
|
|
78
|
+
}
|
|
79
|
+
__decorate([
|
|
80
|
+
observable
|
|
81
|
+
], State.prototype, "props", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
observable
|
|
84
|
+
], State.prototype, "layout", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
action
|
|
87
|
+
], State.prototype, "moreOperate", null);
|
|
92
88
|
//# sourceMappingURL=state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/components/DocumentMenu/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM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
@@ -1,78 +1,74 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { action, observable } from "mobx";
|
|
3
3
|
import { message } from "@voplus/antd";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.selectedLists.push(item);
|
|
45
|
-
}
|
|
4
|
+
export class State {
|
|
5
|
+
constructor() {
|
|
6
|
+
/** DocumentList id */
|
|
7
|
+
this.id = "";
|
|
8
|
+
/** 已选文件列表 */
|
|
9
|
+
this.selectedLists = [];
|
|
10
|
+
/** 是否多选 */
|
|
11
|
+
this.multiSelect = false;
|
|
12
|
+
/** 是否显示DocumentSelectDialog */
|
|
13
|
+
this.visible = true;
|
|
14
|
+
}
|
|
15
|
+
/**Select function*/
|
|
16
|
+
handleOk() {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const ids = this.selectedLists.map(item => item.id);
|
|
19
|
+
if (!ids.length)
|
|
20
|
+
return message.warning("Please select file");
|
|
21
|
+
return (_b = (_a = this.props).onSelect) === null || _b === void 0 ? void 0 : _b.call(_a, ids);
|
|
22
|
+
}
|
|
23
|
+
/**cancel function*/
|
|
24
|
+
handleCancel() {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
this.visible = false;
|
|
27
|
+
(_b = (_a = this.props).onCancel) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
28
|
+
}
|
|
29
|
+
/**已选文件列表 双击取消选择文件*/
|
|
30
|
+
deselectDocument(item) {
|
|
31
|
+
this.selectedLists = this.selectedLists.filter(i => i !== item);
|
|
32
|
+
}
|
|
33
|
+
/**DocumentTree 选择文件返回document id, DocumentList获得id显示列表*/
|
|
34
|
+
onExpand(expandedKeys) {
|
|
35
|
+
this.id = expandedKeys;
|
|
36
|
+
}
|
|
37
|
+
/**DocumentTree,DocumentList 双击选择文件显示在已选文件列表*/
|
|
38
|
+
onSelectDocument(item) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
if (!this.multiSelect)
|
|
41
|
+
return (_b = (_a = this.props).onSelect) === null || _b === void 0 ? void 0 : _b.call(_a, [item.id]);
|
|
42
|
+
if (!this.selectedLists.some(ele => ele.id === item.id)) {
|
|
43
|
+
this.selectedLists.push(item);
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
})();
|
|
77
|
-
export { State };
|
|
46
|
+
}
|
|
47
|
+
__decorate([
|
|
48
|
+
observable
|
|
49
|
+
], State.prototype, "id", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
observable
|
|
52
|
+
], State.prototype, "selectedLists", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
observable
|
|
55
|
+
], State.prototype, "multiSelect", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
observable
|
|
58
|
+
], State.prototype, "visible", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
action
|
|
61
|
+
], State.prototype, "handleOk", null);
|
|
62
|
+
__decorate([
|
|
63
|
+
action
|
|
64
|
+
], State.prototype, "handleCancel", null);
|
|
65
|
+
__decorate([
|
|
66
|
+
action
|
|
67
|
+
], State.prototype, "deselectDocument", null);
|
|
68
|
+
__decorate([
|
|
69
|
+
action
|
|
70
|
+
], State.prototype, "onExpand", null);
|
|
71
|
+
__decorate([
|
|
72
|
+
action
|
|
73
|
+
], State.prototype, "onSelectDocument", null);
|
|
78
74
|
//# sourceMappingURL=state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/components/DocumentSelectDialog/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAYvC
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/components/DocumentSelectDialog/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAYvC,MAAM,OAAO,KAAK;IAAlB;QAEC,sBAAsB;QACH,OAAE,GAAG,EAAE,CAAC;QAC3B,aAAa;QACM,kBAAa,GAAgB,EAAE,CAAC;QACnD,WAAW;QACQ,gBAAW,GAAG,KAAK,CAAC;QACvC,+BAA+B;QACZ,YAAO,GAAG,IAAI,CAAC;IAqCnC,CAAC;IAnCA,oBAAoB;IAEb,QAAQ;;QACd,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,GAAG,CAAC,MAAM;YAAE,OAAO,OAAO,CAAC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