@bigbinary/neeto-folders-frontend 2.0.40 → 2.0.42
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/dist/.ready +1 -1
- package/dist/cjs/v2/components.js +42 -29
- package/dist/cjs/v2/components.js.map +1 -1
- package/dist/v2/components.js +43 -30
- package/dist/v2/components.js.map +1 -1
- package/package.json +10 -10
package/dist/v2/components.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
3
|
import { shallow } from 'zustand/shallow';
|
|
4
|
-
import { Alert, Sheet, Spinner, Typography,
|
|
4
|
+
import { Alert, Sheet, Spinner, Typography, Button, Toastr, Checkbox, Tree } from '@bigbinary/neeto-atoms';
|
|
5
5
|
import { useQueryClient } from '@tanstack/react-query';
|
|
6
6
|
import { useQueryParams, useStateWithDependency } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
7
7
|
import { buildUrl, showThumbsUpToastr } from '@bigbinary/neeto-commons-frontend/v2/utils';
|
|
@@ -21,6 +21,7 @@ import { Textarea, Switch, Input, Form, ActionBlock, TreeSelect as TreeSelect$1
|
|
|
21
21
|
import { t } from 'i18next';
|
|
22
22
|
import { object, string } from 'yup';
|
|
23
23
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
24
|
+
import { RadioGroupItem, RadioGroup } from '@bigbinary/neeto-atoms/primitives';
|
|
24
25
|
import useHotkeys from '@bigbinary/neeto-hotkeys';
|
|
25
26
|
import { hyphenate, isNotPresent, noop, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
26
27
|
import { isEmpty, assoc } from 'ramda';
|
|
@@ -411,6 +412,9 @@ var Node$1 = /*#__PURE__*/forwardRef(Node$2);
|
|
|
411
412
|
var _excluded$5 = ["folder", "item", "depth", "maxDepth", "disabled", "config"];
|
|
412
413
|
function ownKeys$i(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
413
414
|
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
415
|
+
var toRadioValue = function toRadioValue(id) {
|
|
416
|
+
return id == null ? "__root__" : String(id);
|
|
417
|
+
};
|
|
414
418
|
var _SelectableNode = function SelectableNode(_ref) {
|
|
415
419
|
var _folder$children$leng, _folder$children;
|
|
416
420
|
var folder = _ref.folder,
|
|
@@ -421,8 +425,8 @@ var _SelectableNode = function SelectableNode(_ref) {
|
|
|
421
425
|
disabled = _ref.disabled,
|
|
422
426
|
config = _ref.config,
|
|
423
427
|
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
424
|
-
|
|
425
|
-
onSelect = rest.onSelect;
|
|
428
|
+
rest.selection;
|
|
429
|
+
var onSelect = rest.onSelect;
|
|
426
430
|
var _useTranslation = useTranslation(config),
|
|
427
431
|
t = _useTranslation.t;
|
|
428
432
|
var isDisabled = disabled || (item === null || item === void 0 ? void 0 : item.id) === folder.id || depth >= maxDepth;
|
|
@@ -455,11 +459,10 @@ var _SelectableNode = function SelectableNode(_ref) {
|
|
|
455
459
|
folderLabel: folderLabel,
|
|
456
460
|
itemLabel: itemLabel
|
|
457
461
|
})), {}, {
|
|
458
|
-
icon: /*#__PURE__*/jsx(
|
|
459
|
-
readOnly: true,
|
|
460
|
-
checked: selection === folder.id,
|
|
462
|
+
icon: /*#__PURE__*/jsx(RadioGroupItem, {
|
|
461
463
|
"data-testid": "".concat(hyphenate(folder.name), "-folder-option"),
|
|
462
|
-
|
|
464
|
+
disabled: isDisabled,
|
|
465
|
+
value: toRadioValue(folder.id)
|
|
463
466
|
}),
|
|
464
467
|
onClick: isDisabled ? noop : function () {
|
|
465
468
|
return onSelect(folder);
|
|
@@ -563,31 +566,36 @@ var PaneBody = function PaneBody(_ref) {
|
|
|
563
566
|
}
|
|
564
567
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
565
568
|
children: [/*#__PURE__*/jsxs(Sheet.Header, {
|
|
566
|
-
className: "flex items-center justify-between",
|
|
569
|
+
className: "flex flex-row items-center justify-between",
|
|
567
570
|
children: [/*#__PURE__*/jsx(Sheet.Title, {
|
|
568
571
|
children: t("moveToFolder.title")
|
|
569
572
|
}), /*#__PURE__*/jsx(Button, {
|
|
570
|
-
className: "
|
|
573
|
+
className: "absolute end-12 top-3",
|
|
571
574
|
"data-testid": "add-new-folder-button",
|
|
572
575
|
label: t("folders.add"),
|
|
573
|
-
|
|
576
|
+
size: "sm",
|
|
577
|
+
variant: "outline",
|
|
574
578
|
onClick: onAddFolder
|
|
575
579
|
})]
|
|
576
580
|
}), /*#__PURE__*/jsx(Sheet.Body, {
|
|
577
581
|
className: "pb-6",
|
|
578
|
-
children:
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
582
|
+
children: /*#__PURE__*/jsx(RadioGroup, {
|
|
583
|
+
className: "contents",
|
|
584
|
+
value: toRadioValue(selection),
|
|
585
|
+
children: tree.map(function (folder) {
|
|
586
|
+
return /*#__PURE__*/createElement(_SelectableNode, {
|
|
587
|
+
config: config,
|
|
588
|
+
folder: folder,
|
|
589
|
+
item: item,
|
|
590
|
+
maxDepth: maxDepth,
|
|
591
|
+
selection: selection,
|
|
592
|
+
disabled: (item === null || item === void 0 ? void 0 : item.id) === folder.id || maxDepth <= 0,
|
|
593
|
+
key: folder.id,
|
|
594
|
+
onSelect: function onSelect(folder) {
|
|
595
|
+
return setSelection(folder.id);
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
})
|
|
591
599
|
})
|
|
592
600
|
}), /*#__PURE__*/jsxs(Sheet.Footer, {
|
|
593
601
|
className: "space-x-2",
|
|
@@ -814,7 +822,7 @@ var RearrangeFoldersPane = function RearrangeFoldersPane(_ref) {
|
|
|
814
822
|
});
|
|
815
823
|
var nodeProps = {
|
|
816
824
|
icon: /*#__PURE__*/jsx(GripVertical, {
|
|
817
|
-
className: "text-muted-foreground relative -start-[0.3125rem] flex-shrink-0"
|
|
825
|
+
className: "text-muted-foreground relative -start-[0.3125rem] size-4 flex-shrink-0"
|
|
818
826
|
})
|
|
819
827
|
};
|
|
820
828
|
if (isFetching) {
|
|
@@ -1095,7 +1103,7 @@ var ReorderFoldersPane = function ReorderFoldersPane(_ref) {
|
|
|
1095
1103
|
});
|
|
1096
1104
|
var nodeProps = {
|
|
1097
1105
|
icon: /*#__PURE__*/jsx(GripVertical, {
|
|
1098
|
-
className: "text-muted-foreground relative -start-[0.3125rem] flex-shrink-0"
|
|
1106
|
+
className: "text-muted-foreground relative -start-[0.3125rem] size-4 flex-shrink-0"
|
|
1099
1107
|
})
|
|
1100
1108
|
};
|
|
1101
1109
|
if (isFetching) {
|
|
@@ -1193,6 +1201,7 @@ var FoldersPane = function FoldersPane(_ref) {
|
|
|
1193
1201
|
onClose: onClose,
|
|
1194
1202
|
initialFocusRef: setFocusField,
|
|
1195
1203
|
isOpen: !!type,
|
|
1204
|
+
size: "large",
|
|
1196
1205
|
children: [(type === "edit" || type === "add") && /*#__PURE__*/jsx(AddEditPane, _objectSpread$c({}, _objectSpread$c({
|
|
1197
1206
|
setFocusField: setFocusField
|
|
1198
1207
|
}, commonProps))), type === "move" && /*#__PURE__*/jsx(MoveFolderPane, _objectSpread$c({}, commonProps)), type === "reorder" && /*#__PURE__*/jsx(ReorderPaneComponent, _objectSpread$c({}, commonProps))]
|
|
@@ -1301,13 +1310,16 @@ var FolderTile = function FolderTile(_ref) {
|
|
|
1301
1310
|
})]
|
|
1302
1311
|
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
1303
1312
|
menuItems: menuItems,
|
|
1304
|
-
dropdownButtonProps: {
|
|
1305
|
-
className: "absolute end-2 top-2"
|
|
1306
|
-
},
|
|
1307
1313
|
dropdownProps: {
|
|
1308
1314
|
onClick: function onClick(event) {
|
|
1309
1315
|
return event.preventDefault();
|
|
1310
1316
|
}
|
|
1317
|
+
},
|
|
1318
|
+
dropdownButtonProps: {
|
|
1319
|
+
className: "absolute end-2 top-2",
|
|
1320
|
+
onClick: function onClick(event) {
|
|
1321
|
+
return event.preventDefault();
|
|
1322
|
+
}
|
|
1311
1323
|
}
|
|
1312
1324
|
})]
|
|
1313
1325
|
}));
|
|
@@ -1402,7 +1414,7 @@ var FoldersList = function FoldersList(_ref) {
|
|
|
1402
1414
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
1403
1415
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
1404
1416
|
className: "my-3",
|
|
1405
|
-
variant: "
|
|
1417
|
+
variant: "h6",
|
|
1406
1418
|
children: t("folders.title")
|
|
1407
1419
|
}), /*#__PURE__*/jsx("div", {
|
|
1408
1420
|
className: "neeto-folders-grid-view-wrapper mb-10 grid w-full gap-4",
|
|
@@ -1455,6 +1467,7 @@ var MoveToFolderPane = function MoveToFolderPane(_ref) {
|
|
|
1455
1467
|
return /*#__PURE__*/jsx(Sheet, {
|
|
1456
1468
|
isOpen: isOpen,
|
|
1457
1469
|
onClose: onClose,
|
|
1470
|
+
size: "large",
|
|
1458
1471
|
children: /*#__PURE__*/jsx(PaneBody, _objectSpread$8({}, _objectSpread$8(_objectSpread$8({}, rest), {}, {
|
|
1459
1472
|
onClose: onClose
|
|
1460
1473
|
})))
|
|
@@ -1844,7 +1857,7 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1844
1857
|
});
|
|
1845
1858
|
TreeSelect.displayName = "TreeSelect";
|
|
1846
1859
|
|
|
1847
|
-
var css = ".neeto-sidebar-folders-tree__folder-node{color:inherit!important}.neeto-
|
|
1860
|
+
var css = ".neeto-sidebar-folders-tree__folder-node{color:inherit!important}.neeto-folders-grid-view-wrapper{grid-template-columns:repeat(auto-fill,minmax(256px,1fr))}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy92Mi9jb21wb25lbnRzL25lZXRvLWZvbGRlcnMtbmFuby5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVFBLHlDQUNFLHVCQVBGLENBVUEsaUNBQ0UseURBUEYiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBUaGUgbmVldG8tYXRvbXMgVHJlZSBpcyByZWFjdC1hcmJvcmlzdCBiYXNlZCBhbmQgZW1pdHMgbm8gYC5hbnQtdHJlZWBcbi8vIG1hcmt1cCwgc28gdGhlIGFudGQtc2NvcGVkIHJ1bGVzIGZyb20gdGhlIG5lZXRvLXVpIHZlcnNpb24gKG5vZGUgc3BhY2luZyxcbi8vIHNlbGVjdGVkL2hvdmVyIHN0eWxpbmcsIHN3aXRjaGVyIHR3ZWFrcykgbm8gbG9uZ2VyIG1hdGNoIGFueXRoaW5nIGhlcmUuXG4vLyBUaGV5IGFsc28gY2FycmllZCB0aGUgbGFzdCBsZWdhY3kgbmVldG8tdWkgQ1NTIHZhcmlhYmxlcyBpbiB0aGlzIGZpbGU7IHRoZVxuLy8gYXRvbXMgVHJlZSBvd25zIGl0cyBvd24gc2VsZWN0aW9uL2hvdmVyIHN0eWxpbmcgYW5kIHRoZSBub2RlIGFjdGlvbnMgbm93IGZhZGUgaW5cbi8vIHZpYSBgb3BhY2l0eS0wIGdyb3VwLWhvdmVyOm9wYWNpdHktMTAwYCBvbiB0aGUgZWxlbWVudCBpdHNlbGYsIHNvIG9ubHkgdGhlXG4vLyB0d28gc2VsZWN0b3JzIGJlbG93IHJlbWFpbiBsaXZlLlxuXG4ubmVldG8tc2lkZWJhci1mb2xkZXJzLXRyZWVfX2ZvbGRlci1ub2RlIHtcbiAgY29sb3I6IGluaGVyaXQgIWltcG9ydGFudDtcbn1cblxuLm5lZXRvLWZvbGRlcnMtZ3JpZC12aWV3LXdyYXBwZXIge1xuICBncmlkLXRlbXBsYXRlLWNvbHVtbnM6IHJlcGVhdChhdXRvLWZpbGwsIG1pbm1heCgyNTZweCwgMWZyKSk7XG59XG4iXX0= */";
|
|
1848
1861
|
n(css,{});
|
|
1849
1862
|
|
|
1850
1863
|
export { AddEditPane, DraggableWrapper, FoldersContext, FoldersDnd, FoldersList, FoldersTree, MoveToFolderPane, TreeSelect };
|