@webiny/app-aco 0.0.0-unstable.2af142b57e → 0.0.0-unstable.496cf268ac
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/README.md +107 -47
- package/components/Dialogs/DialogCreate.d.ts +1 -1
- package/components/Dialogs/DialogCreate.js +55 -28
- package/components/Dialogs/DialogCreate.js.map +1 -1
- package/components/Dialogs/DialogDelete.js +1 -1
- package/components/Dialogs/DialogDelete.js.map +1 -1
- package/components/Dialogs/DialogMove.d.ts +11 -0
- package/components/Dialogs/DialogMove.js +115 -0
- package/components/Dialogs/DialogMove.js.map +1 -0
- package/components/Dialogs/DialogUpdate.js +30 -45
- package/components/Dialogs/DialogUpdate.js.map +1 -1
- package/components/Dialogs/styled.d.ts +15 -5
- package/components/Dialogs/styled.js +8 -3
- package/components/Dialogs/styled.js.map +1 -1
- package/components/Tree/ButtonCreate/styled.d.ts +12 -12
- package/components/Tree/ButtonCreate/styled.js +1 -1
- package/components/Tree/ButtonCreate/styled.js.map +1 -1
- package/components/Tree/Empty/styled.d.ts +5 -2
- package/components/Tree/List/index.d.ts +3 -1
- package/components/Tree/List/index.js +4 -1
- package/components/Tree/List/index.js.map +1 -1
- package/components/Tree/List/utils.d.ts +2 -1
- package/components/Tree/List/utils.js +4 -0
- package/components/Tree/List/utils.js.map +1 -1
- package/components/Tree/Loader/index.js +2 -1
- package/components/Tree/Loader/index.js.map +1 -1
- package/components/Tree/Loader/styled.d.ts +9 -3
- package/components/Tree/MenuActions/index.js +10 -3
- package/components/Tree/MenuActions/index.js.map +1 -1
- package/components/Tree/MenuActions/styled.d.ts +8 -2
- package/components/Tree/MenuActions/styled.js +8 -2
- package/components/Tree/MenuActions/styled.js.map +1 -1
- package/components/Tree/Node/index.d.ts +4 -2
- package/components/Tree/Node/index.js +11 -6
- package/components/Tree/Node/index.js.map +1 -1
- package/components/Tree/Node/styled.d.ts +29 -24
- package/components/Tree/Node/styled.js +4 -4
- package/components/Tree/Node/styled.js.map +1 -1
- package/components/Tree/NodePreview/styled.d.ts +5 -2
- package/components/Tree/Placeholder/styled.d.ts +5 -2
- package/components/Tree/Title/styled.d.ts +9 -3
- package/components/Tree/Title/styled.js +1 -1
- package/components/Tree/Title/styled.js.map +1 -1
- package/components/Tree/index.d.ts +3 -0
- package/components/Tree/index.js +8 -3
- package/components/Tree/index.js.map +1 -1
- package/components/Tree/styled.d.ts +5 -2
- package/components/Tree/styled.js +1 -1
- package/components/Tree/styled.js.map +1 -1
- package/contexts/folders.js +1 -1
- package/contexts/folders.js.map +1 -1
- package/contexts/links.d.ts +18 -0
- package/contexts/links.js +371 -0
- package/contexts/links.js.map +1 -0
- package/contexts/records.d.ts +12 -6
- package/contexts/records.js +97 -36
- package/contexts/records.js.map +1 -1
- package/graphql/links.gql.d.ts +5 -0
- package/graphql/links.gql.js +34 -0
- package/graphql/links.gql.js.map +1 -0
- package/graphql/records.gql.js +2 -2
- package/graphql/records.gql.js.map +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +11 -0
- package/hooks/index.js.map +1 -1
- package/hooks/useAcoList.d.ts +18 -0
- package/hooks/useAcoList.js +137 -0
- package/hooks/useAcoList.js.map +1 -0
- package/hooks/useLinks.d.ts +20 -0
- package/hooks/useLinks.js +65 -0
- package/hooks/useLinks.js.map +1 -0
- package/hooks/useRecords.d.ts +12 -8
- package/hooks/useRecords.js +16 -6
- package/hooks/useRecords.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +6 -0
- package/index.js.map +1 -1
- package/package.json +13 -11
- package/sorting.d.ts +3 -0
- package/sorting.js +32 -0
- package/sorting.js.map +1 -0
- package/types.d.ts +21 -5
- package/types.js +14 -1
- package/types.js.map +1 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.EntryDialogMove = void 0;
|
|
9
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _appAdmin = require("@webiny/app-admin");
|
|
15
|
+
var _i18n = require("@webiny/app/i18n");
|
|
16
|
+
var _Button = require("@webiny/ui/Button");
|
|
17
|
+
var _Dialog = require("@webiny/ui/Dialog");
|
|
18
|
+
var _Progress = require("@webiny/ui/Progress");
|
|
19
|
+
var _Typography = require("@webiny/ui/Typography");
|
|
20
|
+
var _ = require("./..");
|
|
21
|
+
var _hooks = require("../../hooks");
|
|
22
|
+
var _styled = require("./styled");
|
|
23
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
24
|
+
var t = _i18n.i18n.ns("app-aco/components/tree/dialog-move");
|
|
25
|
+
var EntryDialogMove = function EntryDialogMove(_ref) {
|
|
26
|
+
var type = _ref.type,
|
|
27
|
+
searchRecord = _ref.searchRecord,
|
|
28
|
+
onClose = _ref.onClose,
|
|
29
|
+
open = _ref.open;
|
|
30
|
+
var _useRecords = (0, _hooks.useRecords)(type, searchRecord.location.folderId || "ROOT"),
|
|
31
|
+
updateRecord = _useRecords.updateRecord,
|
|
32
|
+
loading = _useRecords.loading;
|
|
33
|
+
var _useState = (0, _react.useState)(false),
|
|
34
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
|
+
dialogOpen = _useState2[0],
|
|
36
|
+
setDialogOpen = _useState2[1];
|
|
37
|
+
var _useState3 = (0, _react.useState)(),
|
|
38
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
39
|
+
folderId = _useState4[0],
|
|
40
|
+
setFolderId = _useState4[1];
|
|
41
|
+
var _useSnackbar = (0, _appAdmin.useSnackbar)(),
|
|
42
|
+
showSnackbar = _useSnackbar.showSnackbar;
|
|
43
|
+
var onSubmit = /*#__PURE__*/function () {
|
|
44
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
45
|
+
var id, title, _type, content, data;
|
|
46
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
47
|
+
while (1) switch (_context.prev = _context.next) {
|
|
48
|
+
case 0:
|
|
49
|
+
_context.prev = 0;
|
|
50
|
+
if (!folderId) {
|
|
51
|
+
_context.next = 6;
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
id = searchRecord.id, title = searchRecord.title, _type = searchRecord.type, content = searchRecord.content, data = searchRecord.data;
|
|
55
|
+
_context.next = 5;
|
|
56
|
+
return updateRecord({
|
|
57
|
+
id: id,
|
|
58
|
+
title: title,
|
|
59
|
+
type: _type,
|
|
60
|
+
content: content,
|
|
61
|
+
data: data,
|
|
62
|
+
location: {
|
|
63
|
+
folderId: folderId
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
case 5:
|
|
67
|
+
showSnackbar(t(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["Item moved successfully!"]))));
|
|
68
|
+
case 6:
|
|
69
|
+
setDialogOpen(false);
|
|
70
|
+
_context.next = 12;
|
|
71
|
+
break;
|
|
72
|
+
case 9:
|
|
73
|
+
_context.prev = 9;
|
|
74
|
+
_context.t0 = _context["catch"](0);
|
|
75
|
+
showSnackbar(_context.t0.message);
|
|
76
|
+
case 12:
|
|
77
|
+
case "end":
|
|
78
|
+
return _context.stop();
|
|
79
|
+
}
|
|
80
|
+
}, _callee, null, [[0, 9]]);
|
|
81
|
+
}));
|
|
82
|
+
return function onSubmit() {
|
|
83
|
+
return _ref2.apply(this, arguments);
|
|
84
|
+
};
|
|
85
|
+
}();
|
|
86
|
+
(0, _react.useEffect)(function () {
|
|
87
|
+
setDialogOpen(open);
|
|
88
|
+
}, [open]);
|
|
89
|
+
return /*#__PURE__*/_react.default.createElement(_styled.DialogContainer, {
|
|
90
|
+
open: dialogOpen,
|
|
91
|
+
onClose: onClose
|
|
92
|
+
}, dialogOpen && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Dialog.DialogTitle, null, t(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["Move item"])))), loading.UPDATE && /*#__PURE__*/_react.default.createElement(_Progress.CircularProgress, {
|
|
93
|
+
label: t(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["Moving item..."])))
|
|
94
|
+
}), /*#__PURE__*/_react.default.createElement(_Dialog.DialogContent, null, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
95
|
+
use: "body1"
|
|
96
|
+
}, t(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["Choose the folder where you want to move the item. You can always create a new one if you prefer."])))), /*#__PURE__*/_react.default.createElement(_styled.DialogFoldersContainer, null, /*#__PURE__*/_react.default.createElement(_.FolderTree, {
|
|
97
|
+
title: t(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["Root folder"]))),
|
|
98
|
+
type: type,
|
|
99
|
+
focusedFolderId: folderId || searchRecord.location.folderId,
|
|
100
|
+
onFolderClick: function onFolderClick(data) {
|
|
101
|
+
return setFolderId(data === null || data === void 0 ? void 0 : data.id);
|
|
102
|
+
},
|
|
103
|
+
onTitleClick: function onTitleClick() {
|
|
104
|
+
return setFolderId("ROOT");
|
|
105
|
+
},
|
|
106
|
+
enableCreate: true
|
|
107
|
+
}))), /*#__PURE__*/_react.default.createElement(_Dialog.DialogActions, null, /*#__PURE__*/_react.default.createElement(_Dialog.DialogCancel, {
|
|
108
|
+
onClick: function onClick() {
|
|
109
|
+
setDialogOpen(false);
|
|
110
|
+
}
|
|
111
|
+
}, t(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["Cancel"])))), /*#__PURE__*/_react.default.createElement(_Button.ButtonPrimary, {
|
|
112
|
+
onClick: onSubmit
|
|
113
|
+
}, t(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["Move item"])))))));
|
|
114
|
+
};
|
|
115
|
+
exports.EntryDialogMove = EntryDialogMove;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["t","i18n","ns","EntryDialogMove","type","searchRecord","onClose","open","useRecords","location","folderId","updateRecord","loading","useState","dialogOpen","setDialogOpen","setFolderId","useSnackbar","showSnackbar","onSubmit","id","title","content","data","message","useEffect","UPDATE"],"sources":["DialogMove.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\n\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport {\n DialogTitle,\n DialogActions,\n DialogContent,\n DialogOnClose,\n DialogCancel\n} from \"@webiny/ui/Dialog\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { Typography } from \"@webiny/ui/Typography\";\n\nimport { FolderTree } from \"~/components\";\nimport { useRecords } from \"~/hooks\";\n\nimport { DialogContainer, DialogFoldersContainer } from \"./styled\";\n\nimport { SearchRecordItem } from \"~/types\";\n\ntype Props = {\n type: string;\n searchRecord: SearchRecordItem;\n open: boolean;\n onClose: DialogOnClose;\n};\n\nconst t = i18n.ns(\"app-aco/components/tree/dialog-move\");\n\nexport const EntryDialogMove: React.FC<Props> = ({ type, searchRecord, onClose, open }) => {\n const { updateRecord, loading } = useRecords(type, searchRecord.location.folderId || \"ROOT\");\n const [dialogOpen, setDialogOpen] = useState(false);\n const [folderId, setFolderId] = useState<string>();\n const { showSnackbar } = useSnackbar();\n\n const onSubmit = async () => {\n try {\n if (folderId) {\n const { id, title, type, content, data } = searchRecord;\n await updateRecord({\n id,\n title,\n type,\n content,\n data,\n location: {\n folderId\n }\n });\n\n showSnackbar(t`Item moved successfully!`);\n }\n setDialogOpen(false);\n } catch (error) {\n showSnackbar(error.message);\n }\n };\n\n useEffect(() => {\n setDialogOpen(open);\n }, [open]);\n\n return (\n <DialogContainer open={dialogOpen} onClose={onClose}>\n {dialogOpen && (\n <>\n <DialogTitle>{t`Move item`}</DialogTitle>\n {loading.UPDATE && <CircularProgress label={t`Moving item...`} />}\n <DialogContent>\n <Typography use=\"body1\">{t`Choose the folder where you want to move the item. You can always create a new one if you prefer.`}</Typography>\n <DialogFoldersContainer>\n <FolderTree\n title={t`Root folder`}\n type={type}\n focusedFolderId={folderId || searchRecord.location.folderId}\n onFolderClick={data => setFolderId(data?.id)}\n onTitleClick={() => setFolderId(\"ROOT\")}\n enableCreate={true}\n />\n </DialogFoldersContainer>\n </DialogContent>\n <DialogActions>\n <DialogCancel\n onClick={() => {\n setDialogOpen(false);\n }}\n >\n {t`Cancel`}\n </DialogCancel>\n <ButtonPrimary onClick={onSubmit}>{t`Move item`}</ButtonPrimary>\n </DialogActions>\n </>\n )}\n </DialogContainer>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAAA;AAEA;AACA;AACA;AACA;AAOA;AACA;AAEA;AACA;AAEA;AAAmE;AAWnE,IAAMA,CAAC,GAAGC,UAAI,CAACC,EAAE,CAAC,qCAAqC,CAAC;AAEjD,IAAMC,eAAgC,GAAG,SAAnCA,eAAgC,OAA8C;EAAA,IAAxCC,IAAI,QAAJA,IAAI;IAAEC,YAAY,QAAZA,YAAY;IAAEC,OAAO,QAAPA,OAAO;IAAEC,IAAI,QAAJA,IAAI;EAChF,kBAAkC,IAAAC,iBAAU,EAACJ,IAA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C,uBAAe;IAAC,IAAI,EAAEO,UAAW;IAAC,OAAO,EAAER;EAAQ,GAC/CQ,UAAU,iBACP,yEACI,6BAAC,mBAAW,QAAEd,CAAC,+FAA0B,EACxCY,OAAO,CAACc,MAAM,iBAAI,6BAAC,0BAAgB;IAAC,KAAK,EAAE1B,CAAC;EAAiB,EAAG,eACjE,6BAAC,qBAAa,qBACV,6BAAC,sBAAU;IAAC,GAAG,EAAC;EAAO,GAAEA,CAAC,uLAAiH,eAC3I,6BAAC,8BAAsB,qBACnB,6BAAC,YAAU;IACP,KAAK,EAAEA,CAAC,gGAAc;IACtB,IAAI,EAAEI,IAAK;IACX,eAAe,EAAEM,QAAQ,IAAIL,YAAY,CAACI,QAAQ,CAACC,QAAS;IAC5D,aAAa,EAAE,uBAAAa,IAAI;MAAA,OAAIP,WAAW,CAACO,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEH,EAAE,CAAC;IAAA,CAAC;IAC7C,YAAY,EAAE;MAAA,OAAMJ,WAAW,CAAC,MAAM,CAAC;IAAA,CAAC;IACxC,YAAY,EAAE;EAAK,EACrB,CACmB,CACb,eAChB,6BAAC,qBAAa,qBACV,6BAAC,oBAAY;IACT,OAAO,EAAE,mBAAM;MACXD,aAAa,CAAC,KAAK,CAAC;IACxB;EAAE,GAEDf,CAAC,4FACS,eACf,6BAAC,qBAAa;IAAC,OAAO,EAAEmB;EAAS,GAAEnB,CAAC,+FAA4B,CACpD,CAEvB,CACa;AAE1B,CAAC;AAAC"}
|
|
@@ -12,44 +12,47 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
var _i18n = require("@webiny/app/i18n");
|
|
15
16
|
var _appAdmin = require("@webiny/app-admin");
|
|
16
|
-
var
|
|
17
|
+
var _form = require("@webiny/form");
|
|
17
18
|
var _Button = require("@webiny/ui/Button");
|
|
18
19
|
var _Dialog = require("@webiny/ui/Dialog");
|
|
19
20
|
var _Grid = require("@webiny/ui/Grid");
|
|
20
21
|
var _Input = require("@webiny/ui/Input");
|
|
21
22
|
var _Progress = require("@webiny/ui/Progress");
|
|
22
|
-
var
|
|
23
|
+
var _Typography = require("@webiny/ui/Typography");
|
|
23
24
|
var _validation = require("@webiny/validation");
|
|
24
|
-
var
|
|
25
|
+
var _ = require("./..");
|
|
25
26
|
var _useFolders2 = require("../../hooks/useFolders");
|
|
26
27
|
var _styled = require("./styled");
|
|
27
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
28
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
28
29
|
var t = _i18n.i18n.ns("app-aco/components/tree/dialog-update");
|
|
29
30
|
var FolderDialogUpdate = function FolderDialogUpdate(_ref) {
|
|
30
31
|
var folder = _ref.folder,
|
|
31
32
|
onClose = _ref.onClose,
|
|
32
33
|
open = _ref.open;
|
|
33
34
|
var _useFolders = (0, _useFolders2.useFolders)(folder.type),
|
|
34
|
-
folders = _useFolders.folders,
|
|
35
35
|
loading = _useFolders.loading,
|
|
36
36
|
updateFolder = _useFolders.updateFolder;
|
|
37
37
|
var _useState = (0, _react.useState)(false),
|
|
38
38
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
39
39
|
dialogOpen = _useState2[0],
|
|
40
40
|
setDialogOpen = _useState2[1];
|
|
41
|
+
var _useState3 = (0, _react.useState)(),
|
|
42
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
43
|
+
parentId = _useState4[0],
|
|
44
|
+
setParentId = _useState4[1];
|
|
41
45
|
var _useSnackbar = (0, _appAdmin.useSnackbar)(),
|
|
42
46
|
showSnackbar = _useSnackbar.showSnackbar;
|
|
43
47
|
var onSubmit = /*#__PURE__*/function () {
|
|
44
48
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(data) {
|
|
45
|
-
var _data$parent;
|
|
46
49
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
47
50
|
while (1) switch (_context.prev = _context.next) {
|
|
48
51
|
case 0:
|
|
49
52
|
_context.prev = 0;
|
|
50
53
|
_context.next = 3;
|
|
51
54
|
return updateFolder((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, folder), data), {}, {
|
|
52
|
-
parentId:
|
|
55
|
+
parentId: parentId || null
|
|
53
56
|
}));
|
|
54
57
|
case 3:
|
|
55
58
|
setDialogOpen(false);
|
|
@@ -70,14 +73,12 @@ var FolderDialogUpdate = function FolderDialogUpdate(_ref) {
|
|
|
70
73
|
return _ref2.apply(this, arguments);
|
|
71
74
|
};
|
|
72
75
|
}();
|
|
76
|
+
(0, _react.useEffect)(function () {
|
|
77
|
+
setParentId(folder.parentId);
|
|
78
|
+
}, [folder.parentId]);
|
|
73
79
|
(0, _react.useEffect)(function () {
|
|
74
80
|
setDialogOpen(open);
|
|
75
81
|
}, [open]);
|
|
76
|
-
var parentFolder = (0, _react.useMemo)(function () {
|
|
77
|
-
return folders.find(function (el) {
|
|
78
|
-
return el.id == folder.parentId;
|
|
79
|
-
});
|
|
80
|
-
}, [folder]);
|
|
81
82
|
return /*#__PURE__*/_react.default.createElement(_styled.DialogContainer, {
|
|
82
83
|
open: dialogOpen,
|
|
83
84
|
onClose: onClose
|
|
@@ -85,11 +86,7 @@ var FolderDialogUpdate = function FolderDialogUpdate(_ref) {
|
|
|
85
86
|
onSubmit: onSubmit,
|
|
86
87
|
data: {
|
|
87
88
|
title: folder.title,
|
|
88
|
-
slug: folder.slug
|
|
89
|
-
parent: parentFolder && {
|
|
90
|
-
id: parentFolder.id,
|
|
91
|
-
name: parentFolder.title
|
|
92
|
-
}
|
|
89
|
+
slug: folder.slug
|
|
93
90
|
}
|
|
94
91
|
}, function (_ref3) {
|
|
95
92
|
var Bind = _ref3.Bind,
|
|
@@ -113,38 +110,26 @@ var FolderDialogUpdate = function FolderDialogUpdate(_ref) {
|
|
|
113
110
|
value: folder.slug
|
|
114
111
|
}))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
115
112
|
span: 12
|
|
116
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
name: title
|
|
131
|
-
};
|
|
132
|
-
}),
|
|
133
|
-
label: t(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["Parent"]))),
|
|
134
|
-
onChange: function onChange(value, selection) {
|
|
135
|
-
onBindChange({
|
|
136
|
-
id: value,
|
|
137
|
-
name: selection === null || selection === void 0 ? void 0 : selection.name
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
})))), /*#__PURE__*/_react.default.createElement(_styled.DialogActions, null, /*#__PURE__*/_react.default.createElement(_Button.ButtonDefault, {
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
114
|
+
use: "body1"
|
|
115
|
+
}, t(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["Parent folder"])))), /*#__PURE__*/_react.default.createElement(_styled.DialogFoldersContainer, null, /*#__PURE__*/_react.default.createElement(_.FolderTree, {
|
|
116
|
+
title: t(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["Root folder"]))),
|
|
117
|
+
type: folder.type,
|
|
118
|
+
focusedFolderId: parentId || undefined,
|
|
119
|
+
hiddenFolderIds: [folder.id],
|
|
120
|
+
onFolderClick: function onFolderClick(data) {
|
|
121
|
+
return setParentId((data === null || data === void 0 ? void 0 : data.id) || null);
|
|
122
|
+
},
|
|
123
|
+
onTitleClick: function onTitleClick() {
|
|
124
|
+
return setParentId(null);
|
|
125
|
+
}
|
|
126
|
+
}))))), /*#__PURE__*/_react.default.createElement(_Dialog.DialogActions, null, /*#__PURE__*/_react.default.createElement(_Dialog.DialogCancel, {
|
|
142
127
|
onClick: function onClick() {
|
|
143
128
|
setDialogOpen(false);
|
|
144
129
|
}
|
|
145
|
-
}, t(
|
|
130
|
+
}, t(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["Cancel"])))), /*#__PURE__*/_react.default.createElement(_Button.ButtonPrimary, {
|
|
146
131
|
onClick: submit
|
|
147
|
-
}, t(
|
|
132
|
+
}, t(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["Update Folder"]))))));
|
|
148
133
|
})));
|
|
149
134
|
};
|
|
150
135
|
exports.FolderDialogUpdate = FolderDialogUpdate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["t","i18n","ns","FolderDialogUpdate","folder","onClose","open","useFolders","type","folders","loading","updateFolder","useState","dialogOpen","setDialogOpen","useSnackbar","showSnackbar","onSubmit","data","parentId","parent","id","message","useEffect","parentFolder","useMemo","find","el","title","slug","name","Bind","submit","UPDATE","validation","create","value","onBindChange","onChange","filter","map","selection"],"sources":["DialogUpdate.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\n\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { AutoComplete } from \"@webiny/ui/AutoComplete\";\nimport { ButtonPrimary, ButtonDefault } from \"@webiny/ui/Button\";\nimport { DialogTitle, DialogContent, DialogOnClose } from \"@webiny/ui/Dialog\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { Form, FormOnSubmit } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { i18n } from \"@webiny/app/i18n\";\n\nimport { useFolders } from \"~/hooks/useFolders\";\n\nimport { DialogContainer, DialogActions } from \"./styled\";\n\nimport { FolderItem } from \"~/types\";\n\ntype Props = {\n folder: FolderItem;\n open: boolean;\n onClose: DialogOnClose;\n};\n\ninterface SubmitData extends Omit<FolderItem, \"id\" | \"parentId\"> {\n parent: {\n id: string | null;\n name?: string;\n };\n}\n\nconst t = i18n.ns(\"app-aco/components/tree/dialog-update\");\n\nexport const FolderDialogUpdate: React.FC<Props> = ({ folder, onClose, open }) => {\n const { folders, loading, updateFolder } = useFolders(folder.type);\n const [dialogOpen, setDialogOpen] = useState(false);\n const { showSnackbar } = useSnackbar();\n\n const onSubmit: FormOnSubmit<SubmitData> = async data => {\n try {\n await updateFolder({\n ...folder,\n ...data,\n parentId: data.parent?.id || null\n });\n setDialogOpen(false);\n showSnackbar(t`Folder updated successfully!`);\n } catch (error) {\n showSnackbar(error.message);\n }\n };\n\n useEffect(() => {\n setDialogOpen(open);\n }, [open]);\n\n const parentFolder = useMemo(() => folders.find(el => el.id == folder.parentId), [folder]);\n\n return (\n <DialogContainer open={dialogOpen} onClose={onClose}>\n {dialogOpen && (\n <>\n <Form<SubmitData>\n onSubmit={onSubmit}\n data={{\n title: folder.title,\n slug: folder.slug,\n parent: parentFolder && {\n id: parentFolder.id,\n name: parentFolder.title\n }\n }}\n >\n {({ Bind, submit }) => (\n <>\n {loading.UPDATE && (\n <CircularProgress label={t`Updating folder...`} />\n )}\n <DialogTitle>{t`Update folder`}</DialogTitle>\n <DialogContent>\n <Grid>\n <Cell span={12}>\n <Bind\n name={\"title\"}\n validators={[\n validation.create(\"required,minLength:3\")\n ]}\n >\n <Input label={t`Title`} />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"slug\"}\n validators={[\n validation.create(\"required,minLength:3,slug\")\n ]}\n >\n <Input label={t`Slug`} value={folder.slug} />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name={\"parent\"}>\n {({ value, onChange: onBindChange }) => {\n return (\n <AutoComplete\n value={value}\n options={folders\n .filter(el => el.id !== folder.id)\n .map(({ id, title }) => ({\n id,\n name: title\n }))}\n label={t`Parent`}\n onChange={(value, selection) => {\n onBindChange({\n id: value,\n name: selection?.name\n });\n }}\n />\n );\n }}\n </Bind>\n </Cell>\n </Grid>\n </DialogContent>\n <DialogActions>\n <ButtonDefault\n onClick={() => {\n setDialogOpen(false);\n }}\n >\n {t`Cancel`}\n </ButtonDefault>\n <ButtonPrimary onClick={submit}>\n {t`Update Folder`}\n </ButtonPrimary>\n </DialogActions>\n </>\n )}\n </Form>\n </>\n )}\n </DialogContainer>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAA0D;AAiB1D,IAAMA,CAAC,GAAGC,UAAI,CAACC,EAAE,CAAC,uCAAuC,CAAC;AAEnD,IAAMC,kBAAmC,GAAG,SAAtCA,kBAAmC,OAAkC;EAAA,IAA5BC,MAAM,QAANA,MAAM;IAAEC,OAAO,QAAPA,OAAO;IAAEC,IAAI,QAAJA,IAAI;EACvE,kBAA2C,IAAAC,uBAAU,EAACH,MAAM,CAACI,IAAI,CAAC;IAA1DC,OAAO,eAAPA,OAAO;IAAEC,OAAO,eAAPA,OAAO;IAAEC,YAAY,eAAZA,YAAY;EACtC,gBAAoC,IAAAC,eAAQ,EAAC,KAAK,CAAC;IAAA;IAA5CC,UAAU;IAAEC,aAAa;EAChC,mBAAyB,IAAAC,qBAAW,GAAE;IAA9BC,YAAY,gBAAZA,YAAY;EAEpB,IAAMC,QAAkC;IAAA,mGAAG,iBAAMC,IAAI;MAAA;MAAA;QAAA;UAAA;YAAA;YAAA;YAAA,OAEvCP,YAAY,yFACXP,MAAM,GACNc,IAAI;cACPC,QAAQ,EAAE,iBAAAD,I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K,eAChB,6BAAC,qBAAa,qBACV,6BAAC,qBAAa;MACV,OAAO,EAAE,mBAAM;QACXhB,aAAa,CAAC,KAAK,CAAC;MACxB;IAAE,GAEDd,CAAC,4FACU,eAChB,6BAAC,qBAAa;MAAC,OAAO,EAAEgC;IAAO,GAC1BhC,CAAC,mGACU,CACJ,CACjB;EAAA,CACN,CACE,CAEd,CACa;AAE1B,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"names":["t","i18n","ns","FolderDialogUpdate","folder","onClose","open","useFolders","type","loading","updateFolder","useState","dialogOpen","setDialogOpen","parentId","setParentId","useSnackbar","showSnackbar","onSubmit","data","message","useEffect","title","slug","Bind","submit","UPDATE","validation","create","undefined","id"],"sources":["DialogUpdate.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\n\nimport { i18n } from \"@webiny/app/i18n\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { Form, FormOnSubmit } from \"@webiny/form\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport {\n DialogTitle,\n DialogActions,\n DialogContent,\n DialogOnClose,\n DialogCancel\n} from \"@webiny/ui/Dialog\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { validation } from \"@webiny/validation\";\n\nimport { FolderTree } from \"~/components\";\nimport { useFolders } from \"~/hooks/useFolders\";\n\nimport { DialogContainer, DialogFoldersContainer } from \"./styled\";\n\nimport { FolderItem } from \"~/types\";\n\ntype Props = {\n folder: FolderItem;\n open: boolean;\n onClose: DialogOnClose;\n};\n\ntype SubmitData = Pick<FolderItem, \"title\" | \"slug\">;\n\nconst t = i18n.ns(\"app-aco/components/tree/dialog-update\");\n\nexport const FolderDialogUpdate: React.FC<Props> = ({ folder, onClose, open }) => {\n const { loading, updateFolder } = useFolders(folder.type);\n const [dialogOpen, setDialogOpen] = useState(false);\n const [parentId, setParentId] = useState<string | null>();\n const { showSnackbar } = useSnackbar();\n\n const onSubmit: FormOnSubmit<SubmitData> = async data => {\n try {\n await updateFolder({\n ...folder,\n ...data,\n parentId: parentId || null\n });\n setDialogOpen(false);\n showSnackbar(t`Folder updated successfully!`);\n } catch (error) {\n showSnackbar(error.message);\n }\n };\n\n useEffect(() => {\n setParentId(folder.parentId);\n }, [folder.parentId]);\n\n useEffect(() => {\n setDialogOpen(open);\n }, [open]);\n\n return (\n <DialogContainer open={dialogOpen} onClose={onClose}>\n {dialogOpen && (\n <>\n <Form<SubmitData>\n onSubmit={onSubmit}\n data={{\n title: folder.title,\n slug: folder.slug\n }}\n >\n {({ Bind, submit }) => (\n <>\n {loading.UPDATE && (\n <CircularProgress label={t`Updating folder...`} />\n )}\n <DialogTitle>{t`Update folder`}</DialogTitle>\n <DialogContent>\n <Grid>\n <Cell span={12}>\n <Bind\n name={\"title\"}\n validators={[\n validation.create(\"required,minLength:3\")\n ]}\n >\n <Input label={t`Title`} />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"slug\"}\n validators={[\n validation.create(\"required,minLength:3,slug\")\n ]}\n >\n <Input label={t`Slug`} value={folder.slug} />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Typography use=\"body1\">{t`Parent folder`}</Typography>\n <DialogFoldersContainer>\n <FolderTree\n title={t`Root folder`}\n type={folder.type}\n focusedFolderId={parentId || undefined}\n hiddenFolderIds={[folder.id]}\n onFolderClick={data =>\n setParentId(data?.id || null)\n }\n onTitleClick={() => setParentId(null)}\n />\n </DialogFoldersContainer>\n </Cell>\n </Grid>\n </DialogContent>\n <DialogActions>\n <DialogCancel\n onClick={() => {\n setDialogOpen(false);\n }}\n >\n {t`Cancel`}\n </DialogCancel>\n <ButtonPrimary onClick={submit}>\n {t`Update Folder`}\n </ButtonPrimary>\n </DialogActions>\n </>\n )}\n </Form>\n </>\n )}\n </DialogContainer>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAAA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,eAAe,EAAEM,QAAQ,IAAIe,SAAU;MACvC,eAAe,EAAE,CAACzB,MAAM,CAAC0B,EAAE,CAAE;MAC7B,aAAa,EAAE,uBAAAX,IAAI;QAAA,OACfJ,WAAW,CAAC,CAAAI,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEW,EAAE,KAAI,IAAI,CAAC;MAAA,CAChC;MACD,YAAY,EAAE;QAAA,OAAMf,WAAW,CAAC,IAAI,CAAC;MAAA;IAAC,EACxC,CACmB,CACtB,CACJ,CACK,eAChB,6BAAC,qBAAa,qBACV,6BAAC,oBAAY;MACT,OAAO,EAAE,mBAAM;QACXF,aAAa,CAAC,KAAK,CAAC;MACxB;IAAE,GAEDb,CAAC,4FACS,eACf,6BAAC,qBAAa;MAAC,OAAO,EAAEyB;IAAO,GAC1BzB,CAAC,mGACU,CACJ,CACjB;EAAA,CACN,CACE,CAEd,CACa;AAE1B,CAAC;AAAC"}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
/// <reference types="web" />
|
|
2
4
|
import { Dialog } from "@webiny/ui/Dialog";
|
|
3
|
-
export declare const DialogContainer: import("@emotion/styled
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
export declare const DialogContainer: import("@emotion/styled").StyledComponent<import("@webiny/ui/Dialog").DialogProps & {
|
|
6
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
7
|
+
}, {}, {
|
|
8
|
+
ref?: import("react").Ref<Dialog> | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const DialogActions: import("@emotion/styled").StyledComponent<import("@webiny/ui/Dialog").DialogActionsProps & {
|
|
7
11
|
children?: import("react").ReactNode;
|
|
8
|
-
}
|
|
12
|
+
} & {
|
|
13
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
14
|
+
}, {}, {}>;
|
|
15
|
+
export declare const DialogFoldersContainer: import("@emotion/styled").StyledComponent<{
|
|
16
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
17
|
+
as?: import("react").ElementType<any> | undefined;
|
|
18
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -4,16 +4,21 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.DialogContainer = exports.DialogActions = void 0;
|
|
7
|
+
exports.DialogFoldersContainer = exports.DialogContainer = exports.DialogActions = void 0;
|
|
8
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
9
|
var _Dialog = require("@webiny/ui/Dialog");
|
|
10
10
|
var DialogContainer = /*#__PURE__*/(0, _styled.default)(_Dialog.Dialog, {
|
|
11
11
|
label: "DialogContainer",
|
|
12
12
|
target: "e1ys0rdp0"
|
|
13
|
-
})(".mdc-dialog__surface{width:600px;min-width:600px;
|
|
13
|
+
})(".mdc-dialog__surface{width:600px;min-width:600px;}");
|
|
14
14
|
exports.DialogContainer = DialogContainer;
|
|
15
15
|
var DialogActions = /*#__PURE__*/(0, _styled.default)(_Dialog.DialogActions, {
|
|
16
16
|
label: "DialogActions",
|
|
17
17
|
target: "e1ys0rdp1"
|
|
18
18
|
})("justify-content:space-between;");
|
|
19
|
-
exports.DialogActions = DialogActions;
|
|
19
|
+
exports.DialogActions = DialogActions;
|
|
20
|
+
var DialogFoldersContainer = /*#__PURE__*/(0, _styled.default)("div", {
|
|
21
|
+
label: "DialogFoldersContainer",
|
|
22
|
+
target: "e1ys0rdp2"
|
|
23
|
+
})("max-height:30vh;overflow-y:scroll;margin-top:8px;padding:8px;background:var(--mdc-theme-background);");
|
|
24
|
+
exports.DialogFoldersContainer = DialogFoldersContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DialogContainer","styled","Dialog","DialogActions","DefaultDialogActions"],"sources":["styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { Dialog, DialogActions as DefaultDialogActions } from \"@webiny/ui/Dialog\";\n\nexport const DialogContainer = styled(Dialog)`\n .mdc-dialog__surface {\n width: 600px;\n min-width: 600px;\n
|
|
1
|
+
{"version":3,"names":["DialogContainer","styled","Dialog","DialogActions","DefaultDialogActions","DialogFoldersContainer"],"sources":["styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { Dialog, DialogActions as DefaultDialogActions } from \"@webiny/ui/Dialog\";\n\nexport const DialogContainer = styled(Dialog)`\n .mdc-dialog__surface {\n width: 600px;\n min-width: 600px;\n }\n`;\n\nexport const DialogActions = styled(DefaultDialogActions)`\n justify-content: space-between;\n`;\n\nexport const DialogFoldersContainer = styled(\"div\")`\n max-height: 30vh;\n overflow-y: scroll;\n margin-top: 8px;\n padding: 8px;\n background: var(--mdc-theme-background);\n`;\n"],"mappings":";;;;;;;AAAA;AACA;AAEO,IAAMA,eAAe,oBAAGC,eAAM,EAACC,cAAM;EAAA;EAAA;AAAA,wDAK3C;AAAC;AAEK,IAAMC,aAAa,oBAAGF,eAAM,EAACG,qBAAoB;EAAA;EAAA;AAAA,oCAEvD;AAAC;AAEK,IAAMC,sBAAsB,oBAAGJ,eAAM,EAAC,KAAK;EAAA;EAAA;AAAA,0GAMjD;AAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="web" />
|
|
3
2
|
/// <reference types="react" />
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
3
|
+
/// <reference types="web" />
|
|
4
|
+
export declare const Button: import("@emotion/styled").StyledComponent<{
|
|
5
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
6
|
+
as?: import("react").ElementType<any> | undefined;
|
|
7
|
+
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
8
|
+
export declare const IconContainer: import("@emotion/styled").StyledComponent<{
|
|
9
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
+
as?: import("react").ElementType<any> | undefined;
|
|
11
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export declare const Icon: import("@emotion/styled").StyledComponent<import("react").SVGProps<SVGSVGElement> & {
|
|
7
13
|
alt?: string | undefined;
|
|
8
14
|
} & {
|
|
9
15
|
children?: import("react").ReactNode;
|
|
10
|
-
}, "string" | "filter" | "values" | "fill" | "name" | "type" | "style" | "method" | "target" | "lang" | "className" | "id" | "children" | "tabIndex" | "end" | "local" | "color" | "clip" | "stroke" | "x" | "y" | "clipPath" | "cursor" | "direction" | "display" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "height" | "imageRendering" | "letterSpacing" | "opacity" | "order" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "width" | "wordSpacing" | "writingMode" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "mask" | "offset" | "overflow" | "textDecoration" | "azimuth" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "additive" | "path" | "key" | "alt" | "crossOrigin" | "href" | "max" | "media" | "min" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accentHeight" | "accumulate" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "orientation" | "origin" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
|
|
11
|
-
ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
12
|
-
}, Pick<Pick<import("react").SVGProps<SVGSVGElement> & {
|
|
13
|
-
alt?: string | undefined;
|
|
14
16
|
} & {
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
18
|
-
}, "string" | "filter" | "values" | "fill" | "name" | "type" | "style" | "method" | "target" | "lang" | "className" | "id" | "children" | "tabIndex" | "end" | "local" | "color" | "clip" | "stroke" | "x" | "y" | "clipPath" | "cursor" | "direction" | "display" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "height" | "imageRendering" | "letterSpacing" | "opacity" | "order" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "width" | "wordSpacing" | "writingMode" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "mask" | "offset" | "overflow" | "textDecoration" | "azimuth" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "additive" | "path" | "alt" | "crossOrigin" | "href" | "max" | "media" | "min" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accentHeight" | "accumulate" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "orientation" | "origin" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">, object>;
|
|
17
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
+
}, {}, {}>;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.IconContainer = exports.Icon = exports.Button = void 0;
|
|
8
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
|
-
var _add_circle_outline = require("@material-design-icons/svg/
|
|
9
|
+
var _add_circle_outline = require("@material-design-icons/svg/outlined/add_circle_outline.svg");
|
|
10
10
|
var Button = /*#__PURE__*/(0, _styled.default)("button", {
|
|
11
11
|
label: "Button",
|
|
12
12
|
target: "e14jl0o30"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","styled","IconContainer","Icon","Plus"],"sources":["styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { ReactComponent as Plus } from \"@material-design-icons/svg/
|
|
1
|
+
{"version":3,"names":["Button","styled","IconContainer","Icon","Plus"],"sources":["styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { ReactComponent as Plus } from \"@material-design-icons/svg/outlined/add_circle_outline.svg\";\n\nexport const Button = styled(\"button\")`\n background: none;\n border: none;\n cursor: pointer;\n outline: none;\n font-family: var(--mdc-typography-font-family);\n color: var(--webiny-theme-color-text-secondary);\n fill: currentColor;\n display: flex;\n align-items: center;\n font-size: 1em;\n padding: 8px;\n`;\n\nexport const IconContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const Icon = styled(Plus)`\n padding: 0 4px;\n height: 16px;\n width: 16px;\n`;\n"],"mappings":";;;;;;;AAAA;AACA;AAEO,IAAMA,MAAM,oBAAGC,eAAM,EAAC,QAAQ;EAAA;EAAA;AAAA,uOAYpC;AAAC;AAEK,IAAMC,aAAa,oBAAGD,eAAM;EAAA;EAAA;AAAA,6DAIlC;AAAC;AAEK,IAAME,IAAI,oBAAGF,eAAM,EAACG,kCAAI;EAAA;EAAA;AAAA,2CAI9B;AAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="web" />
|
|
3
2
|
/// <reference types="react" />
|
|
4
|
-
|
|
3
|
+
/// <reference types="web" />
|
|
4
|
+
export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
5
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
6
|
+
as?: import("react").ElementType<any> | undefined;
|
|
7
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -5,9 +5,11 @@ declare type Props = {
|
|
|
5
5
|
type: string;
|
|
6
6
|
folders: FolderItem[];
|
|
7
7
|
focusedFolderId?: string;
|
|
8
|
+
hiddenFolderIds?: string[];
|
|
9
|
+
enableActions?: boolean;
|
|
8
10
|
onFolderClick: (data: NodeModel<DndItemData>["data"]) => void;
|
|
9
11
|
onDragStart: () => void;
|
|
10
12
|
onDragEnd: () => void;
|
|
11
13
|
};
|
|
12
|
-
export declare const List: ({ type, folders, onFolderClick, focusedFolderId, onDragStart, onDragEnd }: Props) => JSX.Element;
|
|
14
|
+
export declare const List: ({ type, folders, onFolderClick, focusedFolderId, hiddenFolderIds, enableActions, onDragStart, onDragEnd }: Props) => JSX.Element;
|
|
13
15
|
export {};
|
|
@@ -27,6 +27,8 @@ var List = function List(_ref) {
|
|
|
27
27
|
folders = _ref.folders,
|
|
28
28
|
onFolderClick = _ref.onFolderClick,
|
|
29
29
|
focusedFolderId = _ref.focusedFolderId,
|
|
30
|
+
hiddenFolderIds = _ref.hiddenFolderIds,
|
|
31
|
+
enableActions = _ref.enableActions,
|
|
30
32
|
onDragStart = _ref.onDragStart,
|
|
31
33
|
onDragEnd = _ref.onDragEnd;
|
|
32
34
|
var _useFolders = (0, _hooks.useFolders)(type),
|
|
@@ -59,7 +61,7 @@ var List = function List(_ref) {
|
|
|
59
61
|
setSelectedFolder = _useState12[1];
|
|
60
62
|
(0, _useDeepCompareEffect.default)(function () {
|
|
61
63
|
if (folders) {
|
|
62
|
-
setTreeData((0, _utils.createTreeData)(folders, focusedFolderId));
|
|
64
|
+
setTreeData((0, _utils.createTreeData)(folders, focusedFolderId, hiddenFolderIds));
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
/**
|
|
@@ -139,6 +141,7 @@ var List = function List(_ref) {
|
|
|
139
141
|
node: node,
|
|
140
142
|
depth: depth,
|
|
141
143
|
isOpen: isOpen,
|
|
144
|
+
enableActions: enableActions,
|
|
142
145
|
onToggle: onToggle,
|
|
143
146
|
onClick: function onClick(data) {
|
|
144
147
|
return onFolderClick(data);
|