@bigbinary/neeto-tags-frontend 0.0.19 → 0.0.20
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/index.js +66 -65
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +21 -29
package/dist/index.js
CHANGED
|
@@ -17,15 +17,15 @@ import _classCallCheck$1 from '@babel/runtime/helpers/classCallCheck';
|
|
|
17
17
|
import _createClass$1 from '@babel/runtime/helpers/createClass';
|
|
18
18
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
19
19
|
import { useHistory, Switch, Route } from 'react-router-dom';
|
|
20
|
-
import { MenuBar, Container, Header, SubHeader, Scrollable } from '@bigbinary/neetoui/layouts';
|
|
21
20
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
22
|
-
import {
|
|
23
|
-
import { Tag, Toastr, Pane, Typography, PageLoader, Button, Table, Alert, Input as Input$1, Modal, Dropdown } from '@bigbinary/neetoui';
|
|
21
|
+
import { Tag, Dropdown, Button, Toastr, Pane, Typography, PageLoader, Table, Alert, Input as Input$1, Modal } from '@bigbinary/neetoui';
|
|
24
22
|
import * as yup from 'yup';
|
|
23
|
+
import { MenuHorizontal, Plus } from '@bigbinary/neeto-icons';
|
|
25
24
|
import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';
|
|
26
25
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
27
26
|
import ReactDOM from 'react-dom';
|
|
28
27
|
import axios from 'axios';
|
|
28
|
+
import { Container, Header, SubHeader, Scrollable, MenuBar } from '@bigbinary/neetoui/layouts';
|
|
29
29
|
import { Formik, Form } from 'formik';
|
|
30
30
|
import { Input, Textarea, ActionBlock } from '@bigbinary/neetoui/formik';
|
|
31
31
|
import classames from 'classnames';
|
|
@@ -3464,31 +3464,6 @@ instance.use(initReactI18next).init({
|
|
|
3464
3464
|
}
|
|
3465
3465
|
});
|
|
3466
3466
|
|
|
3467
|
-
var Menu = function Menu(_ref) {
|
|
3468
|
-
var tagTypes = _ref.tagTypes,
|
|
3469
|
-
showMenu = _ref.showMenu,
|
|
3470
|
-
tagType = _ref.tagType,
|
|
3471
|
-
setTagType = _ref.setTagType;
|
|
3472
|
-
|
|
3473
|
-
var _useTranslation = useTranslation(),
|
|
3474
|
-
t = _useTranslation.t;
|
|
3475
|
-
|
|
3476
|
-
return /*#__PURE__*/React.createElement(MenuBar, {
|
|
3477
|
-
showMenu: showMenu,
|
|
3478
|
-
title: t("title")
|
|
3479
|
-
}, Object.values(tagTypes).map(function (tag) {
|
|
3480
|
-
return /*#__PURE__*/React.createElement(MenuBar.Item, {
|
|
3481
|
-
key: tag.id,
|
|
3482
|
-
label: tag.label,
|
|
3483
|
-
description: tag.description,
|
|
3484
|
-
active: tagType.id === tag.id,
|
|
3485
|
-
onClick: function onClick() {
|
|
3486
|
-
setTagType(tag);
|
|
3487
|
-
}
|
|
3488
|
-
});
|
|
3489
|
-
}));
|
|
3490
|
-
};
|
|
3491
|
-
|
|
3492
3467
|
var DEFAULT_PAGE_INDEX = 1;
|
|
3493
3468
|
var DEFAULT_PAGE_SIZE = 10;
|
|
3494
3469
|
var COMMON_COLUMNS = [{
|
|
@@ -3527,6 +3502,43 @@ var PLURAL = {
|
|
|
3527
3502
|
count: 2
|
|
3528
3503
|
};
|
|
3529
3504
|
|
|
3505
|
+
var renderColumnData = function renderColumnData(columns, handleEdit, handleDelete) {
|
|
3506
|
+
return [].concat(_toConsumableArray(columns), [{
|
|
3507
|
+
id: "actions",
|
|
3508
|
+
width: "10%",
|
|
3509
|
+
render: function render(_, tag) {
|
|
3510
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
3511
|
+
icon: MenuHorizontal,
|
|
3512
|
+
buttonProps: {
|
|
3513
|
+
style: "text"
|
|
3514
|
+
},
|
|
3515
|
+
position: "bottom-end",
|
|
3516
|
+
autoWidth: true,
|
|
3517
|
+
strategy: "fixed"
|
|
3518
|
+
}, /*#__PURE__*/React.createElement("li", {
|
|
3519
|
+
className: "neeto-tag-dropdown__item"
|
|
3520
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
3521
|
+
onClick: function onClick() {
|
|
3522
|
+
return handleEdit(tag);
|
|
3523
|
+
},
|
|
3524
|
+
label: "Edit",
|
|
3525
|
+
style: "text",
|
|
3526
|
+
className: "neeto-tag-dropdown__button"
|
|
3527
|
+
})), /*#__PURE__*/React.createElement("li", {
|
|
3528
|
+
className: "neeto-tag-dropdown__item"
|
|
3529
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
3530
|
+
label: "Delete",
|
|
3531
|
+
onClick: function onClick() {
|
|
3532
|
+
return handleDelete(tag);
|
|
3533
|
+
},
|
|
3534
|
+
style: "danger-text",
|
|
3535
|
+
className: "neeto-tag-dropdown__button",
|
|
3536
|
+
"data-cy": "tags-delete-button"
|
|
3537
|
+
})));
|
|
3538
|
+
}
|
|
3539
|
+
}]);
|
|
3540
|
+
};
|
|
3541
|
+
|
|
3530
3542
|
function useDebounce(value, delay) {
|
|
3531
3543
|
var _useState = useState(value),
|
|
3532
3544
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -7031,7 +7043,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
7031
7043
|
}, /*#__PURE__*/React.createElement(PageLoader, null));
|
|
7032
7044
|
}
|
|
7033
7045
|
|
|
7034
|
-
return /*#__PURE__*/React.createElement(
|
|
7046
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Header, {
|
|
7035
7047
|
title: "".concat(tagType.label, " ").concat(t("title")),
|
|
7036
7048
|
menuBarToggle: displayMenu ? handleMenuToggle : null,
|
|
7037
7049
|
searchProps: {
|
|
@@ -7500,42 +7512,6 @@ var renderComponent = function renderComponent(Component, props) {
|
|
|
7500
7512
|
return /*#__PURE__*/React.createElement(Component, props);
|
|
7501
7513
|
};
|
|
7502
7514
|
|
|
7503
|
-
var renderColumnData = function renderColumnData(columns, handleEdit, handleDelete) {
|
|
7504
|
-
return [].concat(_toConsumableArray(columns), [{
|
|
7505
|
-
id: "actions",
|
|
7506
|
-
width: "10%",
|
|
7507
|
-
render: function render(_, tag) {
|
|
7508
|
-
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
7509
|
-
icon: MenuHorizontal,
|
|
7510
|
-
buttonProps: {
|
|
7511
|
-
style: "text"
|
|
7512
|
-
},
|
|
7513
|
-
position: "bottom-end",
|
|
7514
|
-
autoWidth: true,
|
|
7515
|
-
strategy: "fixed"
|
|
7516
|
-
}, /*#__PURE__*/React.createElement("li", {
|
|
7517
|
-
className: "neeto-tag-dropdown__item"
|
|
7518
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
7519
|
-
onClick: function onClick() {
|
|
7520
|
-
return handleEdit(tag);
|
|
7521
|
-
},
|
|
7522
|
-
label: "Edit",
|
|
7523
|
-
style: "text",
|
|
7524
|
-
className: "neeto-tag-dropdown__button"
|
|
7525
|
-
})), /*#__PURE__*/React.createElement("li", {
|
|
7526
|
-
className: "neeto-tag-dropdown__item"
|
|
7527
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
7528
|
-
label: "Delete",
|
|
7529
|
-
onClick: function onClick() {
|
|
7530
|
-
return handleDelete(tag);
|
|
7531
|
-
},
|
|
7532
|
-
style: "danger-text",
|
|
7533
|
-
className: "neeto-tag-dropdown__button",
|
|
7534
|
-
"data-cy": "tags-delete-button"
|
|
7535
|
-
})));
|
|
7536
|
-
}
|
|
7537
|
-
}]);
|
|
7538
|
-
};
|
|
7539
7515
|
var createRoutes = function createRoutes(props) {
|
|
7540
7516
|
return [{
|
|
7541
7517
|
component: function component() {
|
|
@@ -7552,6 +7528,31 @@ var createRoutes = function createRoutes(props) {
|
|
|
7552
7528
|
}];
|
|
7553
7529
|
};
|
|
7554
7530
|
|
|
7531
|
+
var Menu = function Menu(_ref) {
|
|
7532
|
+
var tagTypes = _ref.tagTypes,
|
|
7533
|
+
showMenu = _ref.showMenu,
|
|
7534
|
+
tagType = _ref.tagType,
|
|
7535
|
+
setTagType = _ref.setTagType;
|
|
7536
|
+
|
|
7537
|
+
var _useTranslation = useTranslation(),
|
|
7538
|
+
t = _useTranslation.t;
|
|
7539
|
+
|
|
7540
|
+
return /*#__PURE__*/React.createElement(MenuBar, {
|
|
7541
|
+
showMenu: showMenu,
|
|
7542
|
+
title: t("title")
|
|
7543
|
+
}, Object.values(tagTypes).map(function (tag) {
|
|
7544
|
+
return /*#__PURE__*/React.createElement(MenuBar.Item, {
|
|
7545
|
+
key: tag.id,
|
|
7546
|
+
label: tag.label,
|
|
7547
|
+
description: tag.description,
|
|
7548
|
+
active: tagType.id === tag.id,
|
|
7549
|
+
onClick: function onClick() {
|
|
7550
|
+
setTagType(tag);
|
|
7551
|
+
}
|
|
7552
|
+
});
|
|
7553
|
+
}));
|
|
7554
|
+
};
|
|
7555
|
+
|
|
7555
7556
|
var devtools = {exports: {}};
|
|
7556
7557
|
|
|
7557
7558
|
{
|