@bigbinary/neeto-tags-frontend 2.2.17 → 2.2.18
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/NeetoTags.js +44 -1488
- package/dist/NeetoTags.js.map +1 -1
- package/dist/cjs/NeetoTags.js +48 -1507
- package/dist/cjs/NeetoTags.js.map +1 -1
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/index-_sNMrsD3.js +1489 -0
- package/dist/index-_sNMrsD3.js.map +1 -0
- package/dist/index-hfjlurOH.js +1511 -0
- package/dist/index-hfjlurOH.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +5 -5
package/dist/NeetoTags.js
CHANGED
|
@@ -1,1493 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { t } from 'i18next';
|
|
22
|
-
import * as yup from 'yup';
|
|
23
|
-
import NeetoHeader from '@bigbinary/neeto-molecules/Header';
|
|
24
|
-
import Button from '@bigbinary/neetoui/Button';
|
|
25
|
-
import Pane from '@bigbinary/neetoui/Pane';
|
|
26
|
-
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
27
|
-
import Form from '@bigbinary/neetoui/formik/Form';
|
|
28
|
-
import Input from '@bigbinary/neetoui/formik/Input';
|
|
29
|
-
import Select from '@bigbinary/neetoui/formik/Select';
|
|
30
|
-
import Textarea from '@bigbinary/neetoui/formik/Textarea';
|
|
31
|
-
import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
|
|
32
|
-
import NeetoUITable from '@bigbinary/neetoui/Table';
|
|
33
|
-
import NoData from '@bigbinary/neetoui/NoData';
|
|
34
|
-
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
35
|
-
import MenuHorizontal from '@bigbinary/neeto-icons/MenuHorizontal';
|
|
36
|
-
import Dropdown from '@bigbinary/neetoui/Dropdown';
|
|
37
|
-
import Tag from '@bigbinary/neetoui/Tag';
|
|
38
|
-
import NeetoUITagMergeIcon from '@bigbinary/neeto-icons/Merge';
|
|
39
|
-
import classNames from 'classnames';
|
|
40
|
-
import Check from '@bigbinary/neeto-icons/Check';
|
|
41
|
-
import Input$1 from '@bigbinary/neetoui/Input';
|
|
42
|
-
import Modal from '@bigbinary/neetoui/Modal';
|
|
43
|
-
import { n } from './inject-css-DmrvuTKK.js';
|
|
1
|
+
export { A as default } from './index-_sNMrsD3.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
4
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'react-router-dom';
|
|
7
|
+
import '@bigbinary/neeto-commons-frontend/utils';
|
|
8
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
9
|
+
import '@bigbinary/neeto-cist';
|
|
10
|
+
import '@bigbinary/neeto-commons-frontend/constants';
|
|
11
|
+
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
12
|
+
import '@bigbinary/neeto-filters-frontend/Bar';
|
|
13
|
+
import '@bigbinary/neeto-filters-frontend/utils';
|
|
14
|
+
import '@bigbinary/neeto-molecules/Container';
|
|
15
|
+
import '@bigbinary/neeto-molecules/SubHeader';
|
|
16
|
+
import '@bigbinary/neetoui/Alert';
|
|
17
|
+
import '@bigbinary/neetoui/Typography';
|
|
18
|
+
import 'ramda';
|
|
19
|
+
import 'react-i18next';
|
|
20
|
+
import './useTagsApi-CmFEGxns.js';
|
|
44
21
|
import '@tanstack/react-query';
|
|
45
22
|
import '@bigbinary/neetoui/Toastr';
|
|
46
23
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
47
24
|
import 'axios';
|
|
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
|
-
name: yup.string().typeError(t("neetoTags.validation.nameMustBeString")).required(t("neetoTags.validation.nameRequired")).max(TAG_NAME_MAX_LENGTH, t("neetoTags.validation.nameMaxLength", {
|
|
73
|
-
length: TAG_NAME_MAX_LENGTH
|
|
74
|
-
})),
|
|
75
|
-
description: yup.string().typeError(t("neetoTags.validation.descriptionMustBeString")).nullable().max(TAG_DESCRIPTION_MAX_LENGTH, t("neetoTags.validation.descriptionMaxLength", {
|
|
76
|
-
length: TAG_DESCRIPTION_MAX_LENGTH
|
|
77
|
-
}))
|
|
78
|
-
});
|
|
79
|
-
var TAGS_FORMIK_PROPS = {
|
|
80
|
-
validateOnBlur: true,
|
|
81
|
-
validateOnChange: true,
|
|
82
|
-
validationSchema: TAG_SCHEMA
|
|
83
|
-
};
|
|
84
|
-
var DEFAULT_FILTERS = {
|
|
85
|
-
page: DEFAULT_PAGE_INDEX,
|
|
86
|
-
pageSize: DEFAULT_PAGE_SIZE,
|
|
87
|
-
sortBy: "",
|
|
88
|
-
orderBy: ""
|
|
89
|
-
};
|
|
90
|
-
var NEETO_FILTERS = [{
|
|
91
|
-
key: "name",
|
|
92
|
-
label: t("neetoTags.common.name"),
|
|
93
|
-
node: "name",
|
|
94
|
-
type: "text"
|
|
95
|
-
}];
|
|
96
|
-
|
|
97
|
-
var Header = function Header(_ref) {
|
|
98
|
-
var breadcrumbs = _ref.breadcrumbs,
|
|
99
|
-
title = _ref.title,
|
|
100
|
-
_ref$tagsMergable = _ref.tagsMergable,
|
|
101
|
-
tagsMergable = _ref$tagsMergable === void 0 ? false : _ref$tagsMergable,
|
|
102
|
-
setPaneType = _ref.setPaneType,
|
|
103
|
-
setSelectedTag = _ref.setSelectedTag,
|
|
104
|
-
_ref$goToFirstPage = _ref.goToFirstPage,
|
|
105
|
-
goToFirstPage = _ref$goToFirstPage === void 0 ? noop : _ref$goToFirstPage,
|
|
106
|
-
_ref$tagsPath = _ref.tagsPath,
|
|
107
|
-
tagsPath = _ref$tagsPath === void 0 ? "" : _ref$tagsPath,
|
|
108
|
-
data = _ref.data,
|
|
109
|
-
_ref$showFilters = _ref.showFilters,
|
|
110
|
-
showFilters = _ref$showFilters === void 0 ? true : _ref$showFilters,
|
|
111
|
-
titleHelpPopoverProps = _ref.titleHelpPopoverProps;
|
|
112
|
-
var _useTranslation = useTranslation(),
|
|
113
|
-
t = _useTranslation.t;
|
|
114
|
-
var history = useHistory();
|
|
115
|
-
var resetPage = useFuncDebounce(function () {
|
|
116
|
-
return goToFirstPage();
|
|
117
|
-
});
|
|
118
|
-
return /*#__PURE__*/jsx(NeetoHeader, {
|
|
119
|
-
breadcrumbs: breadcrumbs,
|
|
120
|
-
titleHelpPopoverProps: titleHelpPopoverProps,
|
|
121
|
-
title: title || t("neetoTags.common.tag", PLURAL),
|
|
122
|
-
actionBlock: /*#__PURE__*/jsxs(Fragment, {
|
|
123
|
-
children: [tagsMergable && /*#__PURE__*/jsx(Button, {
|
|
124
|
-
"data-testid": "neeto-tags-merge-tags-button",
|
|
125
|
-
disabled: (data === null || data === void 0 ? void 0 : data.tags.length) < PLURAL.count,
|
|
126
|
-
label: t("neetoTags.common.mergeTag", PLURAL),
|
|
127
|
-
style: "secondary",
|
|
128
|
-
onClick: handleMetaClick(history, "".concat(tagsPath, "/merge"))
|
|
129
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
130
|
-
"data-testid": "add-new-tag-button",
|
|
131
|
-
label: t("neetoTags.common.addNewTag", SINGULAR),
|
|
132
|
-
onClick: function onClick() {
|
|
133
|
-
setSelectedTag(null);
|
|
134
|
-
setPaneType(PANE_TYPES.CREATE);
|
|
135
|
-
}
|
|
136
|
-
})]
|
|
137
|
-
}),
|
|
138
|
-
searchProps: showFilters && {
|
|
139
|
-
"data-testid": "neeto-tags-search-text-input-field",
|
|
140
|
-
onChange: resetPage,
|
|
141
|
-
placeholder: t("neetoTags.placeholder.searchTags")
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
var useTagsForm = function useTagsForm(_ref) {
|
|
147
|
-
var createTags = _ref.createTags,
|
|
148
|
-
goToFirstPage = _ref.goToFirstPage,
|
|
149
|
-
isEdit = _ref.isEdit,
|
|
150
|
-
onClose = _ref.onClose,
|
|
151
|
-
tagType = _ref.tagType,
|
|
152
|
-
updateTags = _ref.updateTags;
|
|
153
|
-
var tagModification = isEdit ? useUpdateTag : useCreateTag;
|
|
154
|
-
var tagOperation = isEdit ? updateTags : createTags;
|
|
155
|
-
var _tagModification = tagModification(),
|
|
156
|
-
mutate = _tagModification.mutate,
|
|
157
|
-
isSubmitting = _tagModification.isPending;
|
|
158
|
-
var handleSubmit = function handleSubmit(values, _ref2) {
|
|
159
|
-
var _values$description;
|
|
160
|
-
var resetForm = _ref2.resetForm;
|
|
161
|
-
var tagData = {
|
|
162
|
-
url: tagType.url,
|
|
163
|
-
payload: {
|
|
164
|
-
tag: mergeLeft({
|
|
165
|
-
description: (_values$description = values.description) === null || _values$description === void 0 ? void 0 : _values$description.trim(),
|
|
166
|
-
style: values.style.value
|
|
167
|
-
}, values)
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
if (isEdit) {
|
|
171
|
-
tagData.id = values.id;
|
|
172
|
-
}
|
|
173
|
-
mutate(tagData, {
|
|
174
|
-
onSuccess: function onSuccess() {
|
|
175
|
-
var _tagOperation$onSucce;
|
|
176
|
-
!isEdit && goToFirstPage();
|
|
177
|
-
tagOperation === null || tagOperation === void 0 || (_tagOperation$onSucce = tagOperation.onSuccess) === null || _tagOperation$onSucce === void 0 || _tagOperation$onSucce.callback();
|
|
178
|
-
onClose();
|
|
179
|
-
},
|
|
180
|
-
onError: function onError() {
|
|
181
|
-
resetForm();
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
return {
|
|
186
|
-
handleSubmit: handleSubmit,
|
|
187
|
-
isSubmitting: isSubmitting
|
|
188
|
-
};
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
function ownKeys$4(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; }
|
|
192
|
-
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
193
|
-
var ManageTags = function ManageTags(_ref) {
|
|
194
|
-
var createTags = _ref.createTags,
|
|
195
|
-
goToFirstPage = _ref.goToFirstPage,
|
|
196
|
-
onClose = _ref.onClose,
|
|
197
|
-
tag = _ref.tag,
|
|
198
|
-
tagType = _ref.tagType,
|
|
199
|
-
type = _ref.type,
|
|
200
|
-
updateTags = _ref.updateTags;
|
|
201
|
-
var _useTranslation = useTranslation(),
|
|
202
|
-
t = _useTranslation.t;
|
|
203
|
-
var isEdit = type === PANE_TYPES.EDIT;
|
|
204
|
-
var initialValues = isEdit ? tag : INITIAL_TAG_VALUES;
|
|
205
|
-
var inputReference = useRef(null);
|
|
206
|
-
var _useTagsForm = useTagsForm({
|
|
207
|
-
createTags: createTags,
|
|
208
|
-
goToFirstPage: goToFirstPage,
|
|
209
|
-
isEdit: isEdit,
|
|
210
|
-
onClose: onClose,
|
|
211
|
-
tagType: tagType,
|
|
212
|
-
updateTags: updateTags
|
|
213
|
-
}),
|
|
214
|
-
handleSubmit = _useTagsForm.handleSubmit,
|
|
215
|
-
isSubmitting = _useTagsForm.isSubmitting;
|
|
216
|
-
return /*#__PURE__*/jsxs(Pane, {
|
|
217
|
-
onClose: onClose,
|
|
218
|
-
initialFocusRef: inputReference,
|
|
219
|
-
isOpen: !!type,
|
|
220
|
-
children: [/*#__PURE__*/jsx(Pane.Header, {
|
|
221
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
222
|
-
style: "h2",
|
|
223
|
-
weight: "semibold",
|
|
224
|
-
children: isEdit ? t("neetoTags.common.editTag") : t("neetoTags.common.addNewTag", SINGULAR)
|
|
225
|
-
})
|
|
226
|
-
}), /*#__PURE__*/jsxs(Form, {
|
|
227
|
-
formikProps: _objectSpread$4(_objectSpread$4({}, TAGS_FORMIK_PROPS), {}, {
|
|
228
|
-
initialValues: initialValues,
|
|
229
|
-
onSubmit: handleSubmit
|
|
230
|
-
}),
|
|
231
|
-
children: [/*#__PURE__*/jsx(Pane.Body, {
|
|
232
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
233
|
-
className: "neeto-ui-flex neeto-ui-w-full neeto-ui-flex-col neeto-ui-gap-4",
|
|
234
|
-
children: [/*#__PURE__*/jsx(Input, {
|
|
235
|
-
required: true,
|
|
236
|
-
unlimitedChars: true,
|
|
237
|
-
"data-testid": "tag-name-text-field",
|
|
238
|
-
label: t("neetoTags.common.name"),
|
|
239
|
-
maxLength: TAG_NAME_MAX_LENGTH,
|
|
240
|
-
name: "name",
|
|
241
|
-
ref: inputReference
|
|
242
|
-
}), /*#__PURE__*/jsx(Textarea, {
|
|
243
|
-
unlimitedChars: true,
|
|
244
|
-
"data-testid": "tag-description-text-area",
|
|
245
|
-
label: t("neetoTags.common.description"),
|
|
246
|
-
maxLength: TAG_DESCRIPTION_MAX_LENGTH,
|
|
247
|
-
name: "description",
|
|
248
|
-
rows: TAG_DESCRIPTION_ROW_LENGTH
|
|
249
|
-
}), /*#__PURE__*/jsx(Select, {
|
|
250
|
-
name: "style",
|
|
251
|
-
options: Object.values(TAG_STYLES).map(toLabelAndValue)
|
|
252
|
-
})]
|
|
253
|
-
})
|
|
254
|
-
}), /*#__PURE__*/jsx(Pane.Footer, {
|
|
255
|
-
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
256
|
-
isSubmitting: isSubmitting,
|
|
257
|
-
cancelButtonProps: {
|
|
258
|
-
"data-testid": "neeto-tags-manage-tag-cancel-button",
|
|
259
|
-
onClick: onClose
|
|
260
|
-
},
|
|
261
|
-
submitButtonProps: {
|
|
262
|
-
"data-testid": "neeto-tags-manage-tag-submit-button"
|
|
263
|
-
}
|
|
264
|
-
})
|
|
265
|
-
})]
|
|
266
|
-
})]
|
|
267
|
-
});
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
var Menu = Dropdown.Menu,
|
|
271
|
-
MenuItem = Dropdown.MenuItem;
|
|
272
|
-
var renderDropdownButton = function renderDropdownButton(_ref) {
|
|
273
|
-
var _ref$handleEdit = _ref.handleEdit,
|
|
274
|
-
handleEdit = _ref$handleEdit === void 0 ? noop : _ref$handleEdit,
|
|
275
|
-
_ref$handleDelete = _ref.handleDelete,
|
|
276
|
-
handleDelete = _ref$handleDelete === void 0 ? noop : _ref$handleDelete,
|
|
277
|
-
_ref$tag = _ref.tag,
|
|
278
|
-
tag = _ref$tag === void 0 ? {} : _ref$tag;
|
|
279
|
-
return /*#__PURE__*/jsx("div", {
|
|
280
|
-
onClick: function onClick(e) {
|
|
281
|
-
return e.stopPropagation();
|
|
282
|
-
},
|
|
283
|
-
children: /*#__PURE__*/jsx(Dropdown, {
|
|
284
|
-
autoWidth: true,
|
|
285
|
-
appendTo: function appendTo() {
|
|
286
|
-
return document.body;
|
|
287
|
-
},
|
|
288
|
-
buttonProps: {
|
|
289
|
-
style: "text",
|
|
290
|
-
className: "mr-1 my-1"
|
|
291
|
-
},
|
|
292
|
-
icon: MenuHorizontal,
|
|
293
|
-
position: "bottom-end",
|
|
294
|
-
strategy: "fixed",
|
|
295
|
-
children: /*#__PURE__*/jsxs(Menu, {
|
|
296
|
-
children: [/*#__PURE__*/jsx(MenuItem.Button, {
|
|
297
|
-
"data-testid": "tags-edit-button",
|
|
298
|
-
onClick: function onClick() {
|
|
299
|
-
return handleEdit(tag);
|
|
300
|
-
},
|
|
301
|
-
children: t("neetoTags.button.edit")
|
|
302
|
-
}), /*#__PURE__*/jsx(MenuItem.Button, {
|
|
303
|
-
"data-testid": "tags-delete-button",
|
|
304
|
-
onClick: function onClick() {
|
|
305
|
-
return handleDelete(tag);
|
|
306
|
-
},
|
|
307
|
-
children: t("neetoTags.button.delete")
|
|
308
|
-
})]
|
|
309
|
-
})
|
|
310
|
-
})
|
|
311
|
-
});
|
|
312
|
-
};
|
|
313
|
-
var renderColumnData = function renderColumnData(handleEdit, handleDelete) {
|
|
314
|
-
var columns = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
315
|
-
return [{
|
|
316
|
-
title: t("neetoTags.common.name"),
|
|
317
|
-
dataIndex: "name",
|
|
318
|
-
key: "name",
|
|
319
|
-
width: 300,
|
|
320
|
-
render: function render(name, tag) {
|
|
321
|
-
return /*#__PURE__*/jsxs("div", {
|
|
322
|
-
className: "neeto-tags-table__column",
|
|
323
|
-
children: [/*#__PURE__*/jsx(Tag, {
|
|
324
|
-
label: name,
|
|
325
|
-
style: tag.style
|
|
326
|
-
}), renderDropdownButton({
|
|
327
|
-
handleEdit: handleEdit,
|
|
328
|
-
handleDelete: handleDelete,
|
|
329
|
-
tag: tag
|
|
330
|
-
})]
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
}, {
|
|
334
|
-
title: t("neetoTags.common.description"),
|
|
335
|
-
dataIndex: "description",
|
|
336
|
-
key: "description",
|
|
337
|
-
width: 400,
|
|
338
|
-
render: function render(description) {
|
|
339
|
-
return /*#__PURE__*/jsx(Typography, {
|
|
340
|
-
className: "whitespace-normal",
|
|
341
|
-
children: description
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
}].concat(_toConsumableArray(columns));
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
function ownKeys$3(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; }
|
|
348
|
-
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
349
|
-
var Table = function Table(_ref) {
|
|
350
|
-
var _data$tags;
|
|
351
|
-
var data = _ref.data,
|
|
352
|
-
filters = _ref.filters,
|
|
353
|
-
handleDelete = _ref.handleDelete,
|
|
354
|
-
handleEdit = _ref.handleEdit,
|
|
355
|
-
handleOnChange = _ref.handleOnChange,
|
|
356
|
-
isLoading = _ref.isLoading,
|
|
357
|
-
onTagRowClick = _ref.onTagRowClick,
|
|
358
|
-
primaryButtonProps = _ref.primaryButtonProps,
|
|
359
|
-
tagType = _ref.tagType,
|
|
360
|
-
noDataProps = _ref.noDataProps;
|
|
361
|
-
var _useTranslation = useTranslation(),
|
|
362
|
-
t = _useTranslation.t;
|
|
363
|
-
if (isLoading) {
|
|
364
|
-
return /*#__PURE__*/jsx("div", {
|
|
365
|
-
className: "flex h-full w-full items-center justify-center",
|
|
366
|
-
children: /*#__PURE__*/jsx(Spinner, {})
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
if (!isLoading && !(data !== null && data !== void 0 && (_data$tags = data.tags) !== null && _data$tags !== void 0 && _data$tags.length)) {
|
|
370
|
-
return /*#__PURE__*/jsx("div", {
|
|
371
|
-
className: "ntm-empty-state",
|
|
372
|
-
"data-testid": "empty-state-container",
|
|
373
|
-
children: /*#__PURE__*/jsx(NoData, _objectSpread$3(_objectSpread$3({}, _objectSpread$3({
|
|
374
|
-
primaryButtonProps: primaryButtonProps
|
|
375
|
-
}, noDataProps)), {}, {
|
|
376
|
-
title: t("neetoTags.title.noTagsToShow")
|
|
377
|
-
}))
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
return /*#__PURE__*/jsx(TableWrapper, {
|
|
381
|
-
hasPagination: (data === null || data === void 0 ? void 0 : data.totalCount) > filters.pageSize,
|
|
382
|
-
children: /*#__PURE__*/jsx(NeetoUITable, {
|
|
383
|
-
fixedHeight: true,
|
|
384
|
-
allowRowClick: !!onTagRowClick,
|
|
385
|
-
columnData: renderColumnData(handleEdit, handleDelete, tagType.columns),
|
|
386
|
-
currentPageNumber: filters.page,
|
|
387
|
-
defaultPageSize: filters.pageSize,
|
|
388
|
-
loading: isLoading,
|
|
389
|
-
paginationProps: {
|
|
390
|
-
showSizeChanger: false
|
|
391
|
-
},
|
|
392
|
-
rowData: data === null || data === void 0 ? void 0 : data.tags,
|
|
393
|
-
rowSelection: false,
|
|
394
|
-
scroll: {
|
|
395
|
-
x: 0
|
|
396
|
-
},
|
|
397
|
-
totalCount: data === null || data === void 0 ? void 0 : data.totalCount,
|
|
398
|
-
onChange: handleOnChange,
|
|
399
|
-
onRowClick: function onRowClick(event, record, rowIndex) {
|
|
400
|
-
return onTagRowClick({
|
|
401
|
-
event: event,
|
|
402
|
-
tag: record,
|
|
403
|
-
rowIndex: rowIndex
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
})
|
|
407
|
-
});
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
function ownKeys$2(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; }
|
|
411
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
412
|
-
var Dashboard = function Dashboard(_ref) {
|
|
413
|
-
var breadcrumbs = _ref.breadcrumbs,
|
|
414
|
-
title = _ref.title,
|
|
415
|
-
createTags = _ref.createTags,
|
|
416
|
-
deleteTags = _ref.deleteTags,
|
|
417
|
-
displayMenu = _ref.displayMenu,
|
|
418
|
-
onTagRowClick = _ref.onTagRowClick,
|
|
419
|
-
_ref$tagsMergable = _ref.tagsMergable,
|
|
420
|
-
tagsMergable = _ref$tagsMergable === void 0 ? false : _ref$tagsMergable,
|
|
421
|
-
tagsPath = _ref.tagsPath,
|
|
422
|
-
tagType = _ref.tagType,
|
|
423
|
-
updateTags = _ref.updateTags,
|
|
424
|
-
setTagType = _ref.setTagType,
|
|
425
|
-
tagTypes = _ref.tagTypes,
|
|
426
|
-
_ref$noDataProps = _ref.noDataProps,
|
|
427
|
-
noDataProps = _ref$noDataProps === void 0 ? {} : _ref$noDataProps,
|
|
428
|
-
_ref$titleHelpPopover = _ref.titleHelpPopoverProps,
|
|
429
|
-
titleHelpPopoverProps = _ref$titleHelpPopover === void 0 ? {} : _ref$titleHelpPopover;
|
|
430
|
-
var history = useHistory();
|
|
431
|
-
var queryParams = useQueryParams();
|
|
432
|
-
var _queryParams$searchTe = queryParams.searchTerm,
|
|
433
|
-
searchTerm = _queryParams$searchTe === void 0 ? "" : _queryParams$searchTe;
|
|
434
|
-
var searchKeywordProps = {
|
|
435
|
-
node: "name",
|
|
436
|
-
value: searchTerm,
|
|
437
|
-
key: "search_term"
|
|
438
|
-
};
|
|
439
|
-
var _useState = useState(null),
|
|
440
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
441
|
-
selectedTag = _useState2[0],
|
|
442
|
-
setSelectedTag = _useState2[1];
|
|
443
|
-
var _useState3 = useState(null),
|
|
444
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
445
|
-
paneType = _useState4[0],
|
|
446
|
-
setPaneType = _useState4[1];
|
|
447
|
-
var _useState5 = useState(false),
|
|
448
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
449
|
-
isDeleteAlertOpen = _useState6[0],
|
|
450
|
-
setIsDeleteAlertOpen = _useState6[1];
|
|
451
|
-
var _useState7 = useState(DEFAULT_FILTERS),
|
|
452
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
453
|
-
filters = _useState8[0],
|
|
454
|
-
setFilters = _useState8[1];
|
|
455
|
-
var _useState9 = useState(false),
|
|
456
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
457
|
-
isFiltersPaneOpen = _useState10[0],
|
|
458
|
-
setIsFiltersPaneOpen = _useState10[1];
|
|
459
|
-
var _useState11 = useState(buildFiltersFromURL([].concat(_toConsumableArray(NEETO_FILTERS), [searchKeywordProps]))),
|
|
460
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
461
|
-
neetoFilters = _useState12[0],
|
|
462
|
-
setNeetoFilters = _useState12[1];
|
|
463
|
-
var _useFetchTags = useFetchTags(_objectSpread$2({
|
|
464
|
-
url: tagType.url,
|
|
465
|
-
neetoFilters: neetoFilters
|
|
466
|
-
}, filters)),
|
|
467
|
-
data = _useFetchTags.data,
|
|
468
|
-
isLoading = _useFetchTags.isLoading;
|
|
469
|
-
var _useTranslation = useTranslation(),
|
|
470
|
-
t = _useTranslation.t;
|
|
471
|
-
var primaryButtonProps = {
|
|
472
|
-
"data-testid": "add-new-tag-button",
|
|
473
|
-
label: t("neetoTags.common.addNewTag", SINGULAR),
|
|
474
|
-
onClick: function onClick() {
|
|
475
|
-
setSelectedTag(null);
|
|
476
|
-
setPaneType(PANE_TYPES.CREATE);
|
|
477
|
-
}
|
|
478
|
-
};
|
|
479
|
-
var handleEdit = function handleEdit(tag) {
|
|
480
|
-
setSelectedTag(tag);
|
|
481
|
-
setPaneType(PANE_TYPES.EDIT);
|
|
482
|
-
};
|
|
483
|
-
var handleDelete = function handleDelete(tag) {
|
|
484
|
-
setSelectedTag(tag);
|
|
485
|
-
setIsDeleteAlertOpen(true);
|
|
486
|
-
};
|
|
487
|
-
var handleAlertClose = function handleAlertClose() {
|
|
488
|
-
setIsDeleteAlertOpen(false);
|
|
489
|
-
setSelectedTag(null);
|
|
490
|
-
};
|
|
491
|
-
var handleOnChange = function handleOnChange(_ref2, _, _ref3) {
|
|
492
|
-
var page = _ref2.current;
|
|
493
|
-
var sortBy = _ref3.field,
|
|
494
|
-
orderBy = _ref3.order;
|
|
495
|
-
return setFilters(mergeLeft({
|
|
496
|
-
page: page,
|
|
497
|
-
sortBy: orderBy && sortBy,
|
|
498
|
-
orderBy: orderBy
|
|
499
|
-
}));
|
|
500
|
-
};
|
|
501
|
-
var _useDeleteTag = useDeleteTag(),
|
|
502
|
-
mutate = _useDeleteTag.mutate,
|
|
503
|
-
isDeletingTag = _useDeleteTag.isPending;
|
|
504
|
-
var handleConfirmDelete = function handleConfirmDelete() {
|
|
505
|
-
var payload = {
|
|
506
|
-
url: tagType.url,
|
|
507
|
-
id: selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id
|
|
508
|
-
};
|
|
509
|
-
var isNotDeleting = !isDeletingTag && isDeleteAlertOpen;
|
|
510
|
-
isNotDeleting && mutate(payload, {
|
|
511
|
-
onSuccess: function onSuccess() {
|
|
512
|
-
var _data$tags, _deleteTags$onSuccess;
|
|
513
|
-
setIsDeleteAlertOpen(false);
|
|
514
|
-
if ((data === null || data === void 0 || (_data$tags = data.tags) === null || _data$tags === void 0 ? void 0 : _data$tags.length) === 1) {
|
|
515
|
-
setFilters(mergeLeft({
|
|
516
|
-
page: filters.page - 1
|
|
517
|
-
}));
|
|
518
|
-
}
|
|
519
|
-
deleteTags === null || deleteTags === void 0 || (_deleteTags$onSuccess = deleteTags.onSuccess) === null || _deleteTags$onSuccess === void 0 || _deleteTags$onSuccess.callback();
|
|
520
|
-
// @ts-ignore
|
|
521
|
-
showThumbsUpToastr();
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
|
-
};
|
|
525
|
-
var handleFiltersChange = function handleFiltersChange(filters) {
|
|
526
|
-
history.push(buildUrl(window.location.pathname, mergeLeft({
|
|
527
|
-
page: DEFAULT_PAGE_INDEX
|
|
528
|
-
}, queryParams)));
|
|
529
|
-
setNeetoFilters(filters);
|
|
530
|
-
};
|
|
531
|
-
var resetPage = function resetPage() {
|
|
532
|
-
return setFilters(mergeLeft({
|
|
533
|
-
page: DEFAULT_PAGE_INDEX
|
|
534
|
-
}));
|
|
535
|
-
};
|
|
536
|
-
var showFilters = isPresent(neetoFilters) || (data === null || data === void 0 ? void 0 : data.totalCount) > 0;
|
|
537
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
538
|
-
children: [/*#__PURE__*/jsxs(Container, {
|
|
539
|
-
children: [/*#__PURE__*/jsx(Header, {
|
|
540
|
-
breadcrumbs: breadcrumbs,
|
|
541
|
-
data: data,
|
|
542
|
-
displayMenu: displayMenu,
|
|
543
|
-
setPaneType: setPaneType,
|
|
544
|
-
setSelectedTag: setSelectedTag,
|
|
545
|
-
showFilters: showFilters,
|
|
546
|
-
tagsMergable: tagsMergable,
|
|
547
|
-
tagsPath: tagsPath,
|
|
548
|
-
title: title,
|
|
549
|
-
titleHelpPopoverProps: titleHelpPopoverProps,
|
|
550
|
-
goToFirstPage: resetPage
|
|
551
|
-
}), showFilters && /*#__PURE__*/jsx(SubHeader, {
|
|
552
|
-
className: "mb-4",
|
|
553
|
-
leftActionBlock: /*#__PURE__*/jsx(Typography, {
|
|
554
|
-
className: "neeto-ui-gray-800",
|
|
555
|
-
"data-testid": "neeto-tags-filtered-tags-count-text",
|
|
556
|
-
style: "h4",
|
|
557
|
-
weight: "semibold",
|
|
558
|
-
children: t("neetoTags.helper.tagWithCount", {
|
|
559
|
-
count: (data === null || data === void 0 ? void 0 : data.totalCount) || 0,
|
|
560
|
-
type: (tagType === null || tagType === void 0 ? void 0 : tagType.label) || ""
|
|
561
|
-
})
|
|
562
|
-
}),
|
|
563
|
-
rightActionBlock: /*#__PURE__*/jsx(SubHeader.RightBlock, {
|
|
564
|
-
filterProps: {
|
|
565
|
-
columns: NEETO_FILTERS,
|
|
566
|
-
isOpen: isFiltersPaneOpen,
|
|
567
|
-
setIsOpen: setIsFiltersPaneOpen,
|
|
568
|
-
onChange: handleFiltersChange,
|
|
569
|
-
keyword: searchKeywordProps
|
|
570
|
-
}
|
|
571
|
-
})
|
|
572
|
-
}), /*#__PURE__*/jsx(FiltersBar, {
|
|
573
|
-
columns: NEETO_FILTERS,
|
|
574
|
-
isOpen: isFiltersPaneOpen,
|
|
575
|
-
keyword: searchKeywordProps,
|
|
576
|
-
onChange: handleFiltersChange
|
|
577
|
-
}), displayMenu && /*#__PURE__*/jsx(Menu$1, {
|
|
578
|
-
setTagType: setTagType,
|
|
579
|
-
tagType: tagType,
|
|
580
|
-
tagTypes: tagTypes
|
|
581
|
-
}), /*#__PURE__*/jsx(Table, {
|
|
582
|
-
data: data,
|
|
583
|
-
filters: filters,
|
|
584
|
-
handleDelete: handleDelete,
|
|
585
|
-
handleEdit: handleEdit,
|
|
586
|
-
handleOnChange: handleOnChange,
|
|
587
|
-
isLoading: isLoading,
|
|
588
|
-
noDataProps: noDataProps,
|
|
589
|
-
onTagRowClick: onTagRowClick,
|
|
590
|
-
primaryButtonProps: primaryButtonProps,
|
|
591
|
-
tagType: tagType
|
|
592
|
-
})]
|
|
593
|
-
}), /*#__PURE__*/jsx(ManageTags, {
|
|
594
|
-
createTags: createTags,
|
|
595
|
-
tagType: tagType,
|
|
596
|
-
updateTags: updateTags,
|
|
597
|
-
goToFirstPage: resetPage,
|
|
598
|
-
tag: selectedTag,
|
|
599
|
-
type: paneType,
|
|
600
|
-
onClose: function onClose() {
|
|
601
|
-
return setPaneType(null);
|
|
602
|
-
}
|
|
603
|
-
}), /*#__PURE__*/jsx(Alert, {
|
|
604
|
-
cancelButtonLabel: t("neetoTags.button.cancel"),
|
|
605
|
-
isOpen: isDeleteAlertOpen,
|
|
606
|
-
isSubmitting: isDeletingTag,
|
|
607
|
-
submitButtonLabel: t("neetoTags.button.delete"),
|
|
608
|
-
title: t("neetoTags.alert.title.deleteTag"),
|
|
609
|
-
message: /*#__PURE__*/jsx(Trans, {
|
|
610
|
-
i18nKey: "neetoTags.alert.message.deleteTag_",
|
|
611
|
-
values: {
|
|
612
|
-
name: selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.name
|
|
613
|
-
}
|
|
614
|
-
}),
|
|
615
|
-
onClose: handleAlertClose,
|
|
616
|
-
onSubmit: handleConfirmDelete
|
|
617
|
-
})]
|
|
618
|
-
});
|
|
619
|
-
};
|
|
620
|
-
|
|
621
|
-
var NO_DATA_PRIMARY_BUTTON_PROPS = {
|
|
622
|
-
"data-testid": "neeto-tags-go-back-button",
|
|
623
|
-
size: "small",
|
|
624
|
-
label: t("neetoTags.button.goBack")
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
var getListType = function getListType(_ref) {
|
|
628
|
-
var _ref$destinationTags = _ref.destinationTags,
|
|
629
|
-
destinationTags = _ref$destinationTags === void 0 ? [] : _ref$destinationTags,
|
|
630
|
-
_ref$isSource = _ref.isSource,
|
|
631
|
-
isSource = _ref$isSource === void 0 ? false : _ref$isSource,
|
|
632
|
-
_ref$sourceTags = _ref.sourceTags,
|
|
633
|
-
sourceTags = _ref$sourceTags === void 0 ? [] : _ref$sourceTags;
|
|
634
|
-
return isSource ? {
|
|
635
|
-
label: t("neetoTags.title.selectSourceTag", SINGULAR),
|
|
636
|
-
value: "source",
|
|
637
|
-
tagIds: pluck("id", sourceTags),
|
|
638
|
-
counterTagIds: pluck("id", destinationTags)
|
|
639
|
-
} : {
|
|
640
|
-
label: t("neetoTags.title.selectDestinationTag", SINGULAR),
|
|
641
|
-
value: "destination",
|
|
642
|
-
tagIds: pluck("id", destinationTags),
|
|
643
|
-
counterTagIds: pluck("id", sourceTags)
|
|
644
|
-
};
|
|
645
|
-
};
|
|
646
|
-
var orderBySourceTags = function orderBySourceTags(tags, sourceTags) {
|
|
647
|
-
var withoutSourceTags = tags.filter(function (tag) {
|
|
648
|
-
return sourceTags.every(function (sourceTag) {
|
|
649
|
-
return sourceTag.id !== tag.id;
|
|
650
|
-
});
|
|
651
|
-
});
|
|
652
|
-
return [].concat(_toConsumableArray(sourceTags), _toConsumableArray(withoutSourceTags));
|
|
653
|
-
};
|
|
654
|
-
|
|
655
|
-
var List = function List(_ref) {
|
|
656
|
-
var _ref$isSource = _ref.isSource,
|
|
657
|
-
isSource = _ref$isSource === void 0 ? false : _ref$isSource,
|
|
658
|
-
_ref$destinationTags = _ref.destinationTags,
|
|
659
|
-
destinationTags = _ref$destinationTags === void 0 ? [] : _ref$destinationTags,
|
|
660
|
-
onSelect = _ref.onSelect,
|
|
661
|
-
_ref$sourceTags = _ref.sourceTags,
|
|
662
|
-
sourceTags = _ref$sourceTags === void 0 ? [] : _ref$sourceTags,
|
|
663
|
-
_ref$tagList = _ref.tagList,
|
|
664
|
-
tagList = _ref$tagList === void 0 ? [] : _ref$tagList;
|
|
665
|
-
var _useTranslation = useTranslation(),
|
|
666
|
-
t = _useTranslation.t;
|
|
667
|
-
var _useState = useState(""),
|
|
668
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
669
|
-
searchTerm = _useState2[0],
|
|
670
|
-
setSearchTerm = _useState2[1];
|
|
671
|
-
var listType = useMemo(function () {
|
|
672
|
-
return getListType({
|
|
673
|
-
destinationTags: destinationTags,
|
|
674
|
-
isSource: isSource,
|
|
675
|
-
sourceTags: sourceTags
|
|
676
|
-
});
|
|
677
|
-
}, [isSource, sourceTags, destinationTags]);
|
|
678
|
-
var filteredTags = orderBySourceTags(tagList, sourceTags).filter(function (tag) {
|
|
679
|
-
var _tag$name;
|
|
680
|
-
return tag === null || tag === void 0 || (_tag$name = tag.name) === null || _tag$name === void 0 || (_tag$name = _tag$name.toLowerCase()) === null || _tag$name === void 0 ? void 0 : _tag$name.includes(searchTerm.toLowerCase().trim());
|
|
681
|
-
});
|
|
682
|
-
return /*#__PURE__*/jsxs("div", {
|
|
683
|
-
className: "neeto-tags-merge__list neeto-tags-border neeto-ui-border-gray-300 neeto-ui-shadow-xs neeto-ui-rounded-lg neeto-ui-flex neeto-ui-flex-col p-3 md:p-4 lg:p-6",
|
|
684
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
685
|
-
className: "neeto-ui-mb-3",
|
|
686
|
-
style: "h4",
|
|
687
|
-
children: listType.label
|
|
688
|
-
}), /*#__PURE__*/jsx(Input$1, {
|
|
689
|
-
className: "grow-0",
|
|
690
|
-
"data-testid": "neeto-tags-merge-".concat(listType.value, "-search-text-input-field"),
|
|
691
|
-
placeholder: t("neetoTags.placeholder.searchTags"),
|
|
692
|
-
value: searchTerm,
|
|
693
|
-
onChange: function onChange(e) {
|
|
694
|
-
return setSearchTerm(e.target.value);
|
|
695
|
-
}
|
|
696
|
-
}), /*#__PURE__*/jsx("div", {
|
|
697
|
-
className: "neeto-tags-merge__items",
|
|
698
|
-
"data-testid": "neeto-tags-merge-".concat(listType.value, "-tags-list"),
|
|
699
|
-
children: filteredTags.map(function (tag) {
|
|
700
|
-
var selectedTagIds = listType.tagIds.includes(tag.id);
|
|
701
|
-
var selectedCounterTags = listType.counterTagIds.includes(tag.id);
|
|
702
|
-
return /*#__PURE__*/jsxs("div", {
|
|
703
|
-
"data-testid": "neeto-tags-merge-".concat(listType.value, "-tags"),
|
|
704
|
-
className: classNames("neeto-ui-flex neeto-ui-justify-between neeto-ui-items-center neeto-tags-border neeto-ui-border-white neeto-ui-p-2 neeto-ui-rounded-lg neeto-ui-cursor-pointer", {
|
|
705
|
-
"neeto-ui-bg-gray-200 neeto-ui-border-primary-600": selectedTagIds,
|
|
706
|
-
"hover:neeto-ui-bg-gray-100": !selectedTagIds,
|
|
707
|
-
"neeto-ui-cursor-not-allowed neeto-ui-bg-gray-100 neeto-ui-text-gray-500": selectedCounterTags
|
|
708
|
-
}),
|
|
709
|
-
onClick: function onClick() {
|
|
710
|
-
return !selectedCounterTags && onSelect(tag, listType.value);
|
|
711
|
-
},
|
|
712
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
713
|
-
children: tag.name
|
|
714
|
-
}), selectedTagIds && /*#__PURE__*/jsx(Check, {
|
|
715
|
-
size: 18
|
|
716
|
-
})]
|
|
717
|
-
}, tag.id);
|
|
718
|
-
})
|
|
719
|
-
})]
|
|
720
|
-
});
|
|
721
|
-
};
|
|
722
|
-
|
|
723
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
724
|
-
|
|
725
|
-
function getDefaultExportFromCjs (x) {
|
|
726
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
function commonjsRequire(path) {
|
|
730
|
-
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
var pluralize$1 = {exports: {}};
|
|
734
|
-
|
|
735
|
-
/* global define */
|
|
736
|
-
|
|
737
|
-
(function (module, exports) {
|
|
738
|
-
(function (root, pluralize) {
|
|
739
|
-
/* istanbul ignore else */
|
|
740
|
-
if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {
|
|
741
|
-
// Node.
|
|
742
|
-
module.exports = pluralize();
|
|
743
|
-
} else {
|
|
744
|
-
// Browser global.
|
|
745
|
-
root.pluralize = pluralize();
|
|
746
|
-
}
|
|
747
|
-
})(commonjsGlobal, function () {
|
|
748
|
-
// Rule storage - pluralize and singularize need to be run sequentially,
|
|
749
|
-
// while other rules can be optimized using an object for instant lookups.
|
|
750
|
-
var pluralRules = [];
|
|
751
|
-
var singularRules = [];
|
|
752
|
-
var uncountables = {};
|
|
753
|
-
var irregularPlurals = {};
|
|
754
|
-
var irregularSingles = {};
|
|
755
|
-
|
|
756
|
-
/**
|
|
757
|
-
* Sanitize a pluralization rule to a usable regular expression.
|
|
758
|
-
*
|
|
759
|
-
* @param {(RegExp|string)} rule
|
|
760
|
-
* @return {RegExp}
|
|
761
|
-
*/
|
|
762
|
-
function sanitizeRule (rule) {
|
|
763
|
-
if (typeof rule === 'string') {
|
|
764
|
-
return new RegExp('^' + rule + '$', 'i');
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
return rule;
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
/**
|
|
771
|
-
* Pass in a word token to produce a function that can replicate the case on
|
|
772
|
-
* another word.
|
|
773
|
-
*
|
|
774
|
-
* @param {string} word
|
|
775
|
-
* @param {string} token
|
|
776
|
-
* @return {Function}
|
|
777
|
-
*/
|
|
778
|
-
function restoreCase (word, token) {
|
|
779
|
-
// Tokens are an exact match.
|
|
780
|
-
if (word === token) return token;
|
|
781
|
-
|
|
782
|
-
// Lower cased words. E.g. "hello".
|
|
783
|
-
if (word === word.toLowerCase()) return token.toLowerCase();
|
|
784
|
-
|
|
785
|
-
// Upper cased words. E.g. "WHISKY".
|
|
786
|
-
if (word === word.toUpperCase()) return token.toUpperCase();
|
|
787
|
-
|
|
788
|
-
// Title cased words. E.g. "Title".
|
|
789
|
-
if (word[0] === word[0].toUpperCase()) {
|
|
790
|
-
return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
// Lower cased words. E.g. "test".
|
|
794
|
-
return token.toLowerCase();
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
/**
|
|
798
|
-
* Interpolate a regexp string.
|
|
799
|
-
*
|
|
800
|
-
* @param {string} str
|
|
801
|
-
* @param {Array} args
|
|
802
|
-
* @return {string}
|
|
803
|
-
*/
|
|
804
|
-
function interpolate (str, args) {
|
|
805
|
-
return str.replace(/\$(\d{1,2})/g, function (match, index) {
|
|
806
|
-
return args[index] || '';
|
|
807
|
-
});
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
/**
|
|
811
|
-
* Replace a word using a rule.
|
|
812
|
-
*
|
|
813
|
-
* @param {string} word
|
|
814
|
-
* @param {Array} rule
|
|
815
|
-
* @return {string}
|
|
816
|
-
*/
|
|
817
|
-
function replace (word, rule) {
|
|
818
|
-
return word.replace(rule[0], function (match, index) {
|
|
819
|
-
var result = interpolate(rule[1], arguments);
|
|
820
|
-
|
|
821
|
-
if (match === '') {
|
|
822
|
-
return restoreCase(word[index - 1], result);
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
return restoreCase(match, result);
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
/**
|
|
830
|
-
* Sanitize a word by passing in the word and sanitization rules.
|
|
831
|
-
*
|
|
832
|
-
* @param {string} token
|
|
833
|
-
* @param {string} word
|
|
834
|
-
* @param {Array} rules
|
|
835
|
-
* @return {string}
|
|
836
|
-
*/
|
|
837
|
-
function sanitizeWord (token, word, rules) {
|
|
838
|
-
// Empty string or doesn't need fixing.
|
|
839
|
-
if (!token.length || uncountables.hasOwnProperty(token)) {
|
|
840
|
-
return word;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
var len = rules.length;
|
|
844
|
-
|
|
845
|
-
// Iterate over the sanitization rules and use the first one to match.
|
|
846
|
-
while (len--) {
|
|
847
|
-
var rule = rules[len];
|
|
848
|
-
|
|
849
|
-
if (rule[0].test(word)) return replace(word, rule);
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
return word;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
/**
|
|
856
|
-
* Replace a word with the updated word.
|
|
857
|
-
*
|
|
858
|
-
* @param {Object} replaceMap
|
|
859
|
-
* @param {Object} keepMap
|
|
860
|
-
* @param {Array} rules
|
|
861
|
-
* @return {Function}
|
|
862
|
-
*/
|
|
863
|
-
function replaceWord (replaceMap, keepMap, rules) {
|
|
864
|
-
return function (word) {
|
|
865
|
-
// Get the correct token and case restoration functions.
|
|
866
|
-
var token = word.toLowerCase();
|
|
867
|
-
|
|
868
|
-
// Check against the keep object map.
|
|
869
|
-
if (keepMap.hasOwnProperty(token)) {
|
|
870
|
-
return restoreCase(word, token);
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
// Check against the replacement map for a direct word replacement.
|
|
874
|
-
if (replaceMap.hasOwnProperty(token)) {
|
|
875
|
-
return restoreCase(word, replaceMap[token]);
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
// Run all the rules against the word.
|
|
879
|
-
return sanitizeWord(token, word, rules);
|
|
880
|
-
};
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
/**
|
|
884
|
-
* Check if a word is part of the map.
|
|
885
|
-
*/
|
|
886
|
-
function checkWord (replaceMap, keepMap, rules, bool) {
|
|
887
|
-
return function (word) {
|
|
888
|
-
var token = word.toLowerCase();
|
|
889
|
-
|
|
890
|
-
if (keepMap.hasOwnProperty(token)) return true;
|
|
891
|
-
if (replaceMap.hasOwnProperty(token)) return false;
|
|
892
|
-
|
|
893
|
-
return sanitizeWord(token, token, rules) === token;
|
|
894
|
-
};
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
/**
|
|
898
|
-
* Pluralize or singularize a word based on the passed in count.
|
|
899
|
-
*
|
|
900
|
-
* @param {string} word The word to pluralize
|
|
901
|
-
* @param {number} count How many of the word exist
|
|
902
|
-
* @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)
|
|
903
|
-
* @return {string}
|
|
904
|
-
*/
|
|
905
|
-
function pluralize (word, count, inclusive) {
|
|
906
|
-
var pluralized = count === 1
|
|
907
|
-
? pluralize.singular(word) : pluralize.plural(word);
|
|
908
|
-
|
|
909
|
-
return (inclusive ? count + ' ' : '') + pluralized;
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
/**
|
|
913
|
-
* Pluralize a word.
|
|
914
|
-
*
|
|
915
|
-
* @type {Function}
|
|
916
|
-
*/
|
|
917
|
-
pluralize.plural = replaceWord(
|
|
918
|
-
irregularSingles, irregularPlurals, pluralRules
|
|
919
|
-
);
|
|
920
|
-
|
|
921
|
-
/**
|
|
922
|
-
* Check if a word is plural.
|
|
923
|
-
*
|
|
924
|
-
* @type {Function}
|
|
925
|
-
*/
|
|
926
|
-
pluralize.isPlural = checkWord(
|
|
927
|
-
irregularSingles, irregularPlurals, pluralRules
|
|
928
|
-
);
|
|
929
|
-
|
|
930
|
-
/**
|
|
931
|
-
* Singularize a word.
|
|
932
|
-
*
|
|
933
|
-
* @type {Function}
|
|
934
|
-
*/
|
|
935
|
-
pluralize.singular = replaceWord(
|
|
936
|
-
irregularPlurals, irregularSingles, singularRules
|
|
937
|
-
);
|
|
938
|
-
|
|
939
|
-
/**
|
|
940
|
-
* Check if a word is singular.
|
|
941
|
-
*
|
|
942
|
-
* @type {Function}
|
|
943
|
-
*/
|
|
944
|
-
pluralize.isSingular = checkWord(
|
|
945
|
-
irregularPlurals, irregularSingles, singularRules
|
|
946
|
-
);
|
|
947
|
-
|
|
948
|
-
/**
|
|
949
|
-
* Add a pluralization rule to the collection.
|
|
950
|
-
*
|
|
951
|
-
* @param {(string|RegExp)} rule
|
|
952
|
-
* @param {string} replacement
|
|
953
|
-
*/
|
|
954
|
-
pluralize.addPluralRule = function (rule, replacement) {
|
|
955
|
-
pluralRules.push([sanitizeRule(rule), replacement]);
|
|
956
|
-
};
|
|
957
|
-
|
|
958
|
-
/**
|
|
959
|
-
* Add a singularization rule to the collection.
|
|
960
|
-
*
|
|
961
|
-
* @param {(string|RegExp)} rule
|
|
962
|
-
* @param {string} replacement
|
|
963
|
-
*/
|
|
964
|
-
pluralize.addSingularRule = function (rule, replacement) {
|
|
965
|
-
singularRules.push([sanitizeRule(rule), replacement]);
|
|
966
|
-
};
|
|
967
|
-
|
|
968
|
-
/**
|
|
969
|
-
* Add an uncountable word rule.
|
|
970
|
-
*
|
|
971
|
-
* @param {(string|RegExp)} word
|
|
972
|
-
*/
|
|
973
|
-
pluralize.addUncountableRule = function (word) {
|
|
974
|
-
if (typeof word === 'string') {
|
|
975
|
-
uncountables[word.toLowerCase()] = true;
|
|
976
|
-
return;
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
// Set singular and plural references for the word.
|
|
980
|
-
pluralize.addPluralRule(word, '$0');
|
|
981
|
-
pluralize.addSingularRule(word, '$0');
|
|
982
|
-
};
|
|
983
|
-
|
|
984
|
-
/**
|
|
985
|
-
* Add an irregular word definition.
|
|
986
|
-
*
|
|
987
|
-
* @param {string} single
|
|
988
|
-
* @param {string} plural
|
|
989
|
-
*/
|
|
990
|
-
pluralize.addIrregularRule = function (single, plural) {
|
|
991
|
-
plural = plural.toLowerCase();
|
|
992
|
-
single = single.toLowerCase();
|
|
993
|
-
|
|
994
|
-
irregularSingles[single] = plural;
|
|
995
|
-
irregularPlurals[plural] = single;
|
|
996
|
-
};
|
|
997
|
-
|
|
998
|
-
/**
|
|
999
|
-
* Irregular rules.
|
|
1000
|
-
*/
|
|
1001
|
-
[
|
|
1002
|
-
// Pronouns.
|
|
1003
|
-
['I', 'we'],
|
|
1004
|
-
['me', 'us'],
|
|
1005
|
-
['he', 'they'],
|
|
1006
|
-
['she', 'they'],
|
|
1007
|
-
['them', 'them'],
|
|
1008
|
-
['myself', 'ourselves'],
|
|
1009
|
-
['yourself', 'yourselves'],
|
|
1010
|
-
['itself', 'themselves'],
|
|
1011
|
-
['herself', 'themselves'],
|
|
1012
|
-
['himself', 'themselves'],
|
|
1013
|
-
['themself', 'themselves'],
|
|
1014
|
-
['is', 'are'],
|
|
1015
|
-
['was', 'were'],
|
|
1016
|
-
['has', 'have'],
|
|
1017
|
-
['this', 'these'],
|
|
1018
|
-
['that', 'those'],
|
|
1019
|
-
// Words ending in with a consonant and `o`.
|
|
1020
|
-
['echo', 'echoes'],
|
|
1021
|
-
['dingo', 'dingoes'],
|
|
1022
|
-
['volcano', 'volcanoes'],
|
|
1023
|
-
['tornado', 'tornadoes'],
|
|
1024
|
-
['torpedo', 'torpedoes'],
|
|
1025
|
-
// Ends with `us`.
|
|
1026
|
-
['genus', 'genera'],
|
|
1027
|
-
['viscus', 'viscera'],
|
|
1028
|
-
// Ends with `ma`.
|
|
1029
|
-
['stigma', 'stigmata'],
|
|
1030
|
-
['stoma', 'stomata'],
|
|
1031
|
-
['dogma', 'dogmata'],
|
|
1032
|
-
['lemma', 'lemmata'],
|
|
1033
|
-
['schema', 'schemata'],
|
|
1034
|
-
['anathema', 'anathemata'],
|
|
1035
|
-
// Other irregular rules.
|
|
1036
|
-
['ox', 'oxen'],
|
|
1037
|
-
['axe', 'axes'],
|
|
1038
|
-
['die', 'dice'],
|
|
1039
|
-
['yes', 'yeses'],
|
|
1040
|
-
['foot', 'feet'],
|
|
1041
|
-
['eave', 'eaves'],
|
|
1042
|
-
['goose', 'geese'],
|
|
1043
|
-
['tooth', 'teeth'],
|
|
1044
|
-
['quiz', 'quizzes'],
|
|
1045
|
-
['human', 'humans'],
|
|
1046
|
-
['proof', 'proofs'],
|
|
1047
|
-
['carve', 'carves'],
|
|
1048
|
-
['valve', 'valves'],
|
|
1049
|
-
['looey', 'looies'],
|
|
1050
|
-
['thief', 'thieves'],
|
|
1051
|
-
['groove', 'grooves'],
|
|
1052
|
-
['pickaxe', 'pickaxes'],
|
|
1053
|
-
['passerby', 'passersby']
|
|
1054
|
-
].forEach(function (rule) {
|
|
1055
|
-
return pluralize.addIrregularRule(rule[0], rule[1]);
|
|
1056
|
-
});
|
|
1057
|
-
|
|
1058
|
-
/**
|
|
1059
|
-
* Pluralization rules.
|
|
1060
|
-
*/
|
|
1061
|
-
[
|
|
1062
|
-
[/s?$/i, 's'],
|
|
1063
|
-
[/[^\u0000-\u007F]$/i, '$0'],
|
|
1064
|
-
[/([^aeiou]ese)$/i, '$1'],
|
|
1065
|
-
[/(ax|test)is$/i, '$1es'],
|
|
1066
|
-
[/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],
|
|
1067
|
-
[/(e[mn]u)s?$/i, '$1s'],
|
|
1068
|
-
[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],
|
|
1069
|
-
[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],
|
|
1070
|
-
[/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],
|
|
1071
|
-
[/(seraph|cherub)(?:im)?$/i, '$1im'],
|
|
1072
|
-
[/(her|at|gr)o$/i, '$1oes'],
|
|
1073
|
-
[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],
|
|
1074
|
-
[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],
|
|
1075
|
-
[/sis$/i, 'ses'],
|
|
1076
|
-
[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],
|
|
1077
|
-
[/([^aeiouy]|qu)y$/i, '$1ies'],
|
|
1078
|
-
[/([^ch][ieo][ln])ey$/i, '$1ies'],
|
|
1079
|
-
[/(x|ch|ss|sh|zz)$/i, '$1es'],
|
|
1080
|
-
[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],
|
|
1081
|
-
[/\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],
|
|
1082
|
-
[/(pe)(?:rson|ople)$/i, '$1ople'],
|
|
1083
|
-
[/(child)(?:ren)?$/i, '$1ren'],
|
|
1084
|
-
[/eaux$/i, '$0'],
|
|
1085
|
-
[/m[ae]n$/i, 'men'],
|
|
1086
|
-
['thou', 'you']
|
|
1087
|
-
].forEach(function (rule) {
|
|
1088
|
-
return pluralize.addPluralRule(rule[0], rule[1]);
|
|
1089
|
-
});
|
|
1090
|
-
|
|
1091
|
-
/**
|
|
1092
|
-
* Singularization rules.
|
|
1093
|
-
*/
|
|
1094
|
-
[
|
|
1095
|
-
[/s$/i, ''],
|
|
1096
|
-
[/(ss)$/i, '$1'],
|
|
1097
|
-
[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, '$1fe'],
|
|
1098
|
-
[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],
|
|
1099
|
-
[/ies$/i, 'y'],
|
|
1100
|
-
[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],
|
|
1101
|
-
[/\b(mon|smil)ies$/i, '$1ey'],
|
|
1102
|
-
[/\b((?:tit)?m|l)ice$/i, '$1ouse'],
|
|
1103
|
-
[/(seraph|cherub)im$/i, '$1'],
|
|
1104
|
-
[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],
|
|
1105
|
-
[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],
|
|
1106
|
-
[/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],
|
|
1107
|
-
[/(test)(?:is|es)$/i, '$1is'],
|
|
1108
|
-
[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],
|
|
1109
|
-
[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],
|
|
1110
|
-
[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],
|
|
1111
|
-
[/(alumn|alg|vertebr)ae$/i, '$1a'],
|
|
1112
|
-
[/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],
|
|
1113
|
-
[/(matr|append)ices$/i, '$1ix'],
|
|
1114
|
-
[/(pe)(rson|ople)$/i, '$1rson'],
|
|
1115
|
-
[/(child)ren$/i, '$1'],
|
|
1116
|
-
[/(eau)x?$/i, '$1'],
|
|
1117
|
-
[/men$/i, 'man']
|
|
1118
|
-
].forEach(function (rule) {
|
|
1119
|
-
return pluralize.addSingularRule(rule[0], rule[1]);
|
|
1120
|
-
});
|
|
1121
|
-
|
|
1122
|
-
/**
|
|
1123
|
-
* Uncountable rules.
|
|
1124
|
-
*/
|
|
1125
|
-
[
|
|
1126
|
-
// Singular words with no plurals.
|
|
1127
|
-
'adulthood',
|
|
1128
|
-
'advice',
|
|
1129
|
-
'agenda',
|
|
1130
|
-
'aid',
|
|
1131
|
-
'aircraft',
|
|
1132
|
-
'alcohol',
|
|
1133
|
-
'ammo',
|
|
1134
|
-
'analytics',
|
|
1135
|
-
'anime',
|
|
1136
|
-
'athletics',
|
|
1137
|
-
'audio',
|
|
1138
|
-
'bison',
|
|
1139
|
-
'blood',
|
|
1140
|
-
'bream',
|
|
1141
|
-
'buffalo',
|
|
1142
|
-
'butter',
|
|
1143
|
-
'carp',
|
|
1144
|
-
'cash',
|
|
1145
|
-
'chassis',
|
|
1146
|
-
'chess',
|
|
1147
|
-
'clothing',
|
|
1148
|
-
'cod',
|
|
1149
|
-
'commerce',
|
|
1150
|
-
'cooperation',
|
|
1151
|
-
'corps',
|
|
1152
|
-
'debris',
|
|
1153
|
-
'diabetes',
|
|
1154
|
-
'digestion',
|
|
1155
|
-
'elk',
|
|
1156
|
-
'energy',
|
|
1157
|
-
'equipment',
|
|
1158
|
-
'excretion',
|
|
1159
|
-
'expertise',
|
|
1160
|
-
'firmware',
|
|
1161
|
-
'flounder',
|
|
1162
|
-
'fun',
|
|
1163
|
-
'gallows',
|
|
1164
|
-
'garbage',
|
|
1165
|
-
'graffiti',
|
|
1166
|
-
'hardware',
|
|
1167
|
-
'headquarters',
|
|
1168
|
-
'health',
|
|
1169
|
-
'herpes',
|
|
1170
|
-
'highjinks',
|
|
1171
|
-
'homework',
|
|
1172
|
-
'housework',
|
|
1173
|
-
'information',
|
|
1174
|
-
'jeans',
|
|
1175
|
-
'justice',
|
|
1176
|
-
'kudos',
|
|
1177
|
-
'labour',
|
|
1178
|
-
'literature',
|
|
1179
|
-
'machinery',
|
|
1180
|
-
'mackerel',
|
|
1181
|
-
'mail',
|
|
1182
|
-
'media',
|
|
1183
|
-
'mews',
|
|
1184
|
-
'moose',
|
|
1185
|
-
'music',
|
|
1186
|
-
'mud',
|
|
1187
|
-
'manga',
|
|
1188
|
-
'news',
|
|
1189
|
-
'only',
|
|
1190
|
-
'personnel',
|
|
1191
|
-
'pike',
|
|
1192
|
-
'plankton',
|
|
1193
|
-
'pliers',
|
|
1194
|
-
'police',
|
|
1195
|
-
'pollution',
|
|
1196
|
-
'premises',
|
|
1197
|
-
'rain',
|
|
1198
|
-
'research',
|
|
1199
|
-
'rice',
|
|
1200
|
-
'salmon',
|
|
1201
|
-
'scissors',
|
|
1202
|
-
'series',
|
|
1203
|
-
'sewage',
|
|
1204
|
-
'shambles',
|
|
1205
|
-
'shrimp',
|
|
1206
|
-
'software',
|
|
1207
|
-
'species',
|
|
1208
|
-
'staff',
|
|
1209
|
-
'swine',
|
|
1210
|
-
'tennis',
|
|
1211
|
-
'traffic',
|
|
1212
|
-
'transportation',
|
|
1213
|
-
'trout',
|
|
1214
|
-
'tuna',
|
|
1215
|
-
'wealth',
|
|
1216
|
-
'welfare',
|
|
1217
|
-
'whiting',
|
|
1218
|
-
'wildebeest',
|
|
1219
|
-
'wildlife',
|
|
1220
|
-
'you',
|
|
1221
|
-
/pok[eé]mon$/i,
|
|
1222
|
-
// Regexes.
|
|
1223
|
-
/[^aeiou]ese$/i, // "chinese", "japanese"
|
|
1224
|
-
/deer$/i, // "deer", "reindeer"
|
|
1225
|
-
/fish$/i, // "fish", "blowfish", "angelfish"
|
|
1226
|
-
/measles$/i,
|
|
1227
|
-
/o[iu]s$/i, // "carnivorous"
|
|
1228
|
-
/pox$/i, // "chickpox", "smallpox"
|
|
1229
|
-
/sheep$/i
|
|
1230
|
-
].forEach(pluralize.addUncountableRule);
|
|
1231
|
-
|
|
1232
|
-
return pluralize;
|
|
1233
|
-
});
|
|
1234
|
-
} (pluralize$1));
|
|
1235
|
-
|
|
1236
|
-
var pluralizeExports = pluralize$1.exports;
|
|
1237
|
-
var pluralize = /*@__PURE__*/getDefaultExportFromCjs(pluralizeExports);
|
|
1238
|
-
|
|
1239
|
-
var MergeAlert = withT(function (_ref) {
|
|
1240
|
-
var t = _ref.t,
|
|
1241
|
-
_ref$destinationTags = _ref.destinationTags,
|
|
1242
|
-
destinationTags = _ref$destinationTags === void 0 ? [] : _ref$destinationTags,
|
|
1243
|
-
handleSubmit = _ref.handleSubmit,
|
|
1244
|
-
_ref$isSubmitting = _ref.isSubmitting,
|
|
1245
|
-
isSubmitting = _ref$isSubmitting === void 0 ? false : _ref$isSubmitting,
|
|
1246
|
-
setShowModal = _ref.setShowModal,
|
|
1247
|
-
_ref$showModal = _ref.showModal,
|
|
1248
|
-
showModal = _ref$showModal === void 0 ? false : _ref$showModal,
|
|
1249
|
-
_ref$sourceTags = _ref.sourceTags,
|
|
1250
|
-
sourceTags = _ref$sourceTags === void 0 ? [] : _ref$sourceTags,
|
|
1251
|
-
_ref$tagType = _ref.tagType,
|
|
1252
|
-
tagType = _ref$tagType === void 0 ? "" : _ref$tagType;
|
|
1253
|
-
return /*#__PURE__*/jsxs(Modal, {
|
|
1254
|
-
isOpen: showModal,
|
|
1255
|
-
onClose: function onClose() {
|
|
1256
|
-
return setShowModal(false);
|
|
1257
|
-
},
|
|
1258
|
-
children: [/*#__PURE__*/jsx(Modal.Header, {
|
|
1259
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
1260
|
-
id: "dialog1Title",
|
|
1261
|
-
style: "h2",
|
|
1262
|
-
children: t("neetoTags.common.mergeTag", PLURAL)
|
|
1263
|
-
})
|
|
1264
|
-
}), /*#__PURE__*/jsx(Modal.Body, {
|
|
1265
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
1266
|
-
lineHeight: "normal",
|
|
1267
|
-
style: "body2",
|
|
1268
|
-
children: /*#__PURE__*/jsx(Trans, {
|
|
1269
|
-
i18nKey: "neetoTags.helper.mergeTagsMessage",
|
|
1270
|
-
values: {
|
|
1271
|
-
count: sourceTags.length,
|
|
1272
|
-
sourceTags: pluck("name", sourceTags),
|
|
1273
|
-
destinationTag: pluck("name", destinationTags),
|
|
1274
|
-
entities: pluralize(tagType.label.toLowerCase())
|
|
1275
|
-
}
|
|
1276
|
-
})
|
|
1277
|
-
})
|
|
1278
|
-
}), /*#__PURE__*/jsxs(Modal.Footer, {
|
|
1279
|
-
className: "space-x-2",
|
|
1280
|
-
children: [/*#__PURE__*/jsx(Button, {
|
|
1281
|
-
"data-testid": "neeto-tags-merge-cancel-button",
|
|
1282
|
-
label: t("neetoTags.button.cancel"),
|
|
1283
|
-
style: "tertiary",
|
|
1284
|
-
onClick: function onClick() {
|
|
1285
|
-
return setShowModal(false);
|
|
1286
|
-
}
|
|
1287
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
1288
|
-
"data-testid": "neeto-tags-merge-proceed-button",
|
|
1289
|
-
disabled: isSubmitting,
|
|
1290
|
-
label: t("neetoTags.button.proceed"),
|
|
1291
|
-
loading: isSubmitting,
|
|
1292
|
-
onClick: handleSubmit
|
|
1293
|
-
})]
|
|
1294
|
-
})]
|
|
1295
|
-
});
|
|
1296
|
-
});
|
|
1297
|
-
|
|
1298
|
-
function ownKeys$1(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; }
|
|
1299
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1300
|
-
var Merge = function Merge(_ref) {
|
|
1301
|
-
var _data$tags;
|
|
1302
|
-
var breadcrumbs = _ref.breadcrumbs,
|
|
1303
|
-
mergeTags = _ref.mergeTags,
|
|
1304
|
-
tagsPath = _ref.tagsPath,
|
|
1305
|
-
tagType = _ref.tagType;
|
|
1306
|
-
var _useState = useState([]),
|
|
1307
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1308
|
-
sourceTags = _useState2[0],
|
|
1309
|
-
setSourceTags = _useState2[1];
|
|
1310
|
-
var _useState3 = useState([]),
|
|
1311
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1312
|
-
destinationTags = _useState4[0],
|
|
1313
|
-
setDestinationTags = _useState4[1];
|
|
1314
|
-
var _useState5 = useState(false),
|
|
1315
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
1316
|
-
isModalOpen = _useState6[0],
|
|
1317
|
-
setIsModalOpen = _useState6[1];
|
|
1318
|
-
var isMergeButtonDisabled = isEmpty(sourceTags) || isEmpty(destinationTags);
|
|
1319
|
-
var _useTranslation = useTranslation(),
|
|
1320
|
-
t = _useTranslation.t;
|
|
1321
|
-
var _useFetchTags = useFetchTags({
|
|
1322
|
-
url: tagType.url,
|
|
1323
|
-
skipPagination: true
|
|
1324
|
-
}),
|
|
1325
|
-
data = _useFetchTags.data,
|
|
1326
|
-
isLoading = _useFetchTags.isLoading;
|
|
1327
|
-
var _useMergeTags = useMergeTags(),
|
|
1328
|
-
mutate = _useMergeTags.mutate,
|
|
1329
|
-
isSubmitting = _useMergeTags.isPending;
|
|
1330
|
-
var primaryButtonProps = _objectSpread$1(_objectSpread$1({}, NO_DATA_PRIMARY_BUTTON_PROPS), {}, {
|
|
1331
|
-
to: tagsPath
|
|
1332
|
-
});
|
|
1333
|
-
var updatedBreadcrumbs = useMemo(function () {
|
|
1334
|
-
return [].concat(_toConsumableArray(breadcrumbs), [{
|
|
1335
|
-
text: t("neetoTags.common.mergeTag", PLURAL)
|
|
1336
|
-
}]);
|
|
1337
|
-
}, [breadcrumbs]);
|
|
1338
|
-
var getTagState = function getTagState(type) {
|
|
1339
|
-
return {
|
|
1340
|
-
tags: type === "source" ? sourceTags : destinationTags,
|
|
1341
|
-
setTags: type === "source" ? setSourceTags : setDestinationTags
|
|
1342
|
-
};
|
|
1343
|
-
};
|
|
1344
|
-
var handleOnTagSelect = function handleOnTagSelect(tag, type) {
|
|
1345
|
-
var _getTagState = getTagState(type),
|
|
1346
|
-
tags = _getTagState.tags,
|
|
1347
|
-
setTags = _getTagState.setTags;
|
|
1348
|
-
var isTagPresent = existsById(tag.id, tags);
|
|
1349
|
-
var filteredTags = type === "source" ? [].concat(_toConsumableArray(tags), [tag]) : [tag];
|
|
1350
|
-
if (isTagPresent) {
|
|
1351
|
-
filteredTags = removeById(tag.id, tags);
|
|
1352
|
-
}
|
|
1353
|
-
setTags(filteredTags);
|
|
1354
|
-
};
|
|
1355
|
-
var handleSubmit = function handleSubmit() {
|
|
1356
|
-
var payload = {
|
|
1357
|
-
tags: {
|
|
1358
|
-
primary_id: pluck("id", destinationTags),
|
|
1359
|
-
secondary_id: pluck("id", sourceTags)
|
|
1360
|
-
}
|
|
1361
|
-
};
|
|
1362
|
-
mutate({
|
|
1363
|
-
url: tagType.url,
|
|
1364
|
-
payload: payload
|
|
1365
|
-
}, {
|
|
1366
|
-
onSuccess: function onSuccess() {
|
|
1367
|
-
var _mergeTags$onSuccess;
|
|
1368
|
-
setDestinationTags([]);
|
|
1369
|
-
setSourceTags([]);
|
|
1370
|
-
mergeTags === null || mergeTags === void 0 || (_mergeTags$onSuccess = mergeTags.onSuccess) === null || _mergeTags$onSuccess === void 0 || _mergeTags$onSuccess.callback();
|
|
1371
|
-
setIsModalOpen(false);
|
|
1372
|
-
}
|
|
1373
|
-
});
|
|
1374
|
-
};
|
|
1375
|
-
if (isLoading) {
|
|
1376
|
-
return /*#__PURE__*/jsx("div", {
|
|
1377
|
-
className: "flex h-full w-full items-center justify-center",
|
|
1378
|
-
children: /*#__PURE__*/jsx(Spinner, {})
|
|
1379
|
-
});
|
|
1380
|
-
}
|
|
1381
|
-
return /*#__PURE__*/jsxs(Container, {
|
|
1382
|
-
children: [/*#__PURE__*/jsx(NeetoHeader, {
|
|
1383
|
-
breadcrumbs: updatedBreadcrumbs,
|
|
1384
|
-
title: t("neetoTags.common.mergeTag", PLURAL),
|
|
1385
|
-
actionBlock: /*#__PURE__*/jsx(Button, {
|
|
1386
|
-
"data-testid": "neeto-tags-merge-button",
|
|
1387
|
-
disabled: isMergeButtonDisabled,
|
|
1388
|
-
label: t("neetoTags.button.merge"),
|
|
1389
|
-
onClick: function onClick() {
|
|
1390
|
-
setIsModalOpen(true);
|
|
1391
|
-
}
|
|
1392
|
-
})
|
|
1393
|
-
}), !(data !== null && data !== void 0 && (_data$tags = data.tags) !== null && _data$tags !== void 0 && _data$tags.length) ? /*#__PURE__*/jsx("div", {
|
|
1394
|
-
className: "ntm-empty-state",
|
|
1395
|
-
"data-testid": "empty-state-container",
|
|
1396
|
-
children: /*#__PURE__*/jsx(NoData, {
|
|
1397
|
-
primaryButtonProps: primaryButtonProps,
|
|
1398
|
-
title: t("neetoTags.noTagsToShow")
|
|
1399
|
-
})
|
|
1400
|
-
}) : /*#__PURE__*/jsxs("div", {
|
|
1401
|
-
className: "neeto-tags-merge__container",
|
|
1402
|
-
children: [/*#__PURE__*/jsx(List, {
|
|
1403
|
-
destinationTags: destinationTags,
|
|
1404
|
-
sourceTags: sourceTags,
|
|
1405
|
-
isSource: true,
|
|
1406
|
-
tagList: data === null || data === void 0 ? void 0 : data.tags,
|
|
1407
|
-
onSelect: handleOnTagSelect
|
|
1408
|
-
}), /*#__PURE__*/jsx(NeetoUITagMergeIcon, {
|
|
1409
|
-
className: "neeto-ui-self-center neeto-ui-text-gray-600 mx-1 md:mx-4 lg:mx-6",
|
|
1410
|
-
size: 24
|
|
1411
|
-
}), /*#__PURE__*/jsx(List, {
|
|
1412
|
-
destinationTags: destinationTags,
|
|
1413
|
-
sourceTags: sourceTags,
|
|
1414
|
-
isSource: false,
|
|
1415
|
-
tagList: data === null || data === void 0 ? void 0 : data.tags,
|
|
1416
|
-
onSelect: handleOnTagSelect
|
|
1417
|
-
})]
|
|
1418
|
-
}), /*#__PURE__*/jsx(MergeAlert, {
|
|
1419
|
-
destinationTags: destinationTags,
|
|
1420
|
-
handleSubmit: handleSubmit,
|
|
1421
|
-
isSubmitting: isSubmitting,
|
|
1422
|
-
sourceTags: sourceTags,
|
|
1423
|
-
tagType: tagType,
|
|
1424
|
-
setShowModal: setIsModalOpen,
|
|
1425
|
-
showModal: isModalOpen
|
|
1426
|
-
})]
|
|
1427
|
-
});
|
|
1428
|
-
};
|
|
1429
|
-
|
|
1430
|
-
var getCurrentTagType = function getCurrentTagType() {
|
|
1431
|
-
var tagTypes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
1432
|
-
var _getQueryParams = getQueryParams(),
|
|
1433
|
-
tagLabel = _getQueryParams.view;
|
|
1434
|
-
var requiredTagType = tagTypes.find(function (tagType) {
|
|
1435
|
-
var _tagType$label;
|
|
1436
|
-
return (tagType === null || tagType === void 0 || (_tagType$label = tagType.label) === null || _tagType$label === void 0 ? void 0 : _tagType$label.toLowerCase()) === tagLabel;
|
|
1437
|
-
});
|
|
1438
|
-
return requiredTagType || tagTypes[0];
|
|
1439
|
-
};
|
|
1440
|
-
var createRoutes = function createRoutes(path) {
|
|
1441
|
-
return [{
|
|
1442
|
-
component: Merge,
|
|
1443
|
-
exact: true,
|
|
1444
|
-
path: "".concat(path, "/merge")
|
|
1445
|
-
}, {
|
|
1446
|
-
component: Dashboard,
|
|
1447
|
-
exact: true,
|
|
1448
|
-
path: path || ""
|
|
1449
|
-
}];
|
|
1450
|
-
};
|
|
1451
|
-
|
|
1452
|
-
function ownKeys(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; }
|
|
1453
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1454
|
-
var Tags = function Tags(_ref) {
|
|
1455
|
-
var config = _ref.config;
|
|
1456
|
-
var tagTypes = config.tagTypes,
|
|
1457
|
-
_config$displayMenu = config.displayMenu,
|
|
1458
|
-
displayMenu = _config$displayMenu === void 0 ? true : _config$displayMenu;
|
|
1459
|
-
var _useState = useState(getCurrentTagType(tagTypes)),
|
|
1460
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1461
|
-
tagType = _useState2[0],
|
|
1462
|
-
setTagType = _useState2[1];
|
|
1463
|
-
var routes = createRoutes(config.tagsPath);
|
|
1464
|
-
return /*#__PURE__*/jsx(Switch, {
|
|
1465
|
-
children: routes.map(function (_ref2) {
|
|
1466
|
-
var exact = _ref2.exact,
|
|
1467
|
-
path = _ref2.path,
|
|
1468
|
-
Component = _ref2.component;
|
|
1469
|
-
return /*#__PURE__*/createElement(Route, {
|
|
1470
|
-
exact: exact,
|
|
1471
|
-
path: path,
|
|
1472
|
-
key: path
|
|
1473
|
-
}, /*#__PURE__*/jsx(Component, _objectSpread({}, _objectSpread(_objectSpread({}, config), {}, {
|
|
1474
|
-
displayMenu: displayMenu,
|
|
1475
|
-
setTagType: setTagType,
|
|
1476
|
-
tagType: tagType
|
|
1477
|
-
}))));
|
|
1478
|
-
})
|
|
1479
|
-
});
|
|
1480
|
-
};
|
|
1481
|
-
|
|
1482
|
-
var css = ".ntm-empty-state{height:100%;margin:auto;width:100%}.ntm-empty-state,.ntm-empty-state__image{align-items:center;display:flex;justify-content:center}.ntm-empty-state__image{margin-block:0 4rem;margin-inline:auto}.ntm-empty-state__title{font-size:1.25rem;line-height:1.75rem;margin-bottom:1rem;text-align:center}.ntm-empty-state__description{margin-bottom:1.5rem;text-align:center}.ntm-empty-state__action-block{display:flex;justify-content:center}.neeto-tags-table__column{align-items:center;display:flex;gap:.5rem;justify-content:space-between}.neeto-tags-card-title-block:hover p{color:rgb(var(--neeto-ui-accent-800))!important}.neeto-tags-merge__container{display:flex;flex-direction:row;flex-grow:1;justify-content:space-between;min-height:0;padding-bottom:1.5rem;width:100%}.neeto-tags-merge__container .neeto-tags-merge__list{width:48%}.neeto-tags-merge__container .neeto-tags-merge__list .neeto-tags-merge__items{display:flex;flex-direction:column;flex-grow:1;gap:.5rem;margin-top:.75rem;overflow-y:auto}.neeto-tags-border{border-width:thin}@media screen and (min-width:768px){.neeto-tags-merge__container .neeto-tags-merge__list .neeto-tags-merge__items{margin-top:1rem}}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9jb21wb25lbnRzL2VtcHR5LXN0YXRlLmNzcyIsImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9wYWdlcy9kYXNoYm9hcmQuY3NzIiwiYXBwL2phdmFzY3JpcHQvc3JjL3N0eWxlc2hlZXRzL3BhZ2VzL21lcmdlLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxpQkFJRSxXQUFZLENBRVosV0FBWSxDQURaLFVBRUYsQ0FFQSx5Q0FQRSxrQkFBbUIsQ0FEbkIsWUFBYSxDQUViLHNCQVlGLENBTkEsd0JBQ0UsbUJBQXVCLENBQ3ZCLGtCQUlGLENBRUEsd0JBR0UsaUJBQWtCLENBQ2xCLG1CQUFvQixDQUhwQixrQkFBbUIsQ0FDbkIsaUJBR0YsQ0FFQSw4QkFDRSxvQkFBcUIsQ0FDckIsaUJBQ0YsQ0FFQSwrQkFDRSxZQUFhLENBQ2Isc0JBQ0YsQ0NoQ0EsMEJBR0Usa0JBQW1CLENBRm5CLFlBQWEsQ0FHYixTQUFXLENBRlgsNkJBR0YsQ0FFQSxxQ0FDRSwrQ0FDRixDQ1RBLDZCQUNFLFlBQWEsQ0FDYixrQkFBbUIsQ0FHbkIsV0FBWSxDQUZaLDZCQUE4QixDQUc5QixZQUFhLENBQ2IscUJBQXNCLENBSHRCLFVBSUYsQ0FFQSxxREFDRSxTQUNGLENBRUEsOEVBR0UsWUFBYSxDQUNiLHFCQUFzQixDQUZ0QixXQUFZLENBR1osU0FBVyxDQUNYLGlCQUFtQixDQUxuQixlQU1GLENBRUEsbUJBQ0UsaUJBQ0YsQ0FFQSxvQ0FDRSw4RUFDRSxlQUNGLENBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyIubnRtLWVtcHR5LXN0YXRlIHtcbiAgZGlzcGxheTogZmxleDtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG4gIGhlaWdodDogMTAwJTtcbiAgd2lkdGg6IDEwMCU7XG4gIG1hcmdpbjogYXV0bztcbn1cblxuLm50bS1lbXB0eS1zdGF0ZV9faW1hZ2Uge1xuICBtYXJnaW4tYmxvY2s6IDByZW0gNHJlbTtcbiAgbWFyZ2luLWlubGluZTogYXV0bztcbiAgZGlzcGxheTogZmxleDtcbiAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG59XG5cbi5udG0tZW1wdHktc3RhdGVfX3RpdGxlIHtcbiAgbWFyZ2luLWJvdHRvbTogMXJlbTtcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xuICBmb250LXNpemU6IDEuMjVyZW07XG4gIGxpbmUtaGVpZ2h0OiAxLjc1cmVtO1xufVxuXG4ubnRtLWVtcHR5LXN0YXRlX19kZXNjcmlwdGlvbiB7XG4gIG1hcmdpbi1ib3R0b206IDEuNXJlbTtcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xufVxuXG4ubnRtLWVtcHR5LXN0YXRlX19hY3Rpb24tYmxvY2sge1xuICBkaXNwbGF5OiBmbGV4O1xuICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcbn1cbiIsIi5uZWV0by10YWdzLXRhYmxlX19jb2x1bW4ge1xuICBkaXNwbGF5OiBmbGV4O1xuICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGdhcDogMC41cmVtO1xufVxuXG4ubmVldG8tdGFncy1jYXJkLXRpdGxlLWJsb2NrOmhvdmVyIHAge1xuICBjb2xvcjogcmdiKHZhcigtLW5lZXRvLXVpLWFjY2VudC04MDApKSAhaW1wb3J0YW50O1xufVxuIiwiLm5lZXRvLXRhZ3MtbWVyZ2VfX2NvbnRhaW5lciB7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGZsZXgtZGlyZWN0aW9uOiByb3c7XG4gIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjtcbiAgd2lkdGg6IDEwMCU7XG4gIGZsZXgtZ3JvdzogMTtcbiAgbWluLWhlaWdodDogMDtcbiAgcGFkZGluZy1ib3R0b206IDEuNXJlbTtcbn1cblxuLm5lZXRvLXRhZ3MtbWVyZ2VfX2NvbnRhaW5lciAubmVldG8tdGFncy1tZXJnZV9fbGlzdCB7XG4gIHdpZHRoOiA0OCU7XG59XG5cbi5uZWV0by10YWdzLW1lcmdlX19jb250YWluZXIgLm5lZXRvLXRhZ3MtbWVyZ2VfX2xpc3QgLm5lZXRvLXRhZ3MtbWVyZ2VfX2l0ZW1zIHtcbiAgb3ZlcmZsb3cteTogYXV0bztcbiAgZmxleC1ncm93OiAxO1xuICBkaXNwbGF5OiBmbGV4O1xuICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuICBnYXA6IDAuNXJlbTtcbiAgbWFyZ2luLXRvcDogMC43NXJlbTtcbn1cblxuLm5lZXRvLXRhZ3MtYm9yZGVyIHtcbiAgYm9yZGVyLXdpZHRoOiB0aGluO1xufVxuXG5AbWVkaWEgc2NyZWVuIGFuZCAobWluLXdpZHRoOiA3NjhweCkge1xuICAubmVldG8tdGFncy1tZXJnZV9fY29udGFpbmVyIC5uZWV0by10YWdzLW1lcmdlX19saXN0IC5uZWV0by10YWdzLW1lcmdlX19pdGVtcyB7XG4gICAgbWFyZ2luLXRvcDogMXJlbTtcbiAgfVxufVxuIl19 */";
|
|
1483
|
-
n(css,{});
|
|
1484
|
-
|
|
1485
|
-
var App = function App(_ref) {
|
|
1486
|
-
var config = _ref.config;
|
|
1487
|
-
return /*#__PURE__*/jsx(Tags, {
|
|
1488
|
-
config: config
|
|
1489
|
-
});
|
|
1490
|
-
};
|
|
1491
|
-
|
|
1492
|
-
export { App as default };
|
|
25
|
+
import '@bigbinary/neetoui/Tab';
|
|
26
|
+
import 'i18next';
|
|
27
|
+
import 'yup';
|
|
28
|
+
import '@bigbinary/neeto-molecules/Header';
|
|
29
|
+
import '@bigbinary/neetoui/Button';
|
|
30
|
+
import '@bigbinary/neetoui/Pane';
|
|
31
|
+
import '@bigbinary/neetoui/formik/ActionBlock';
|
|
32
|
+
import '@bigbinary/neetoui/formik/Form';
|
|
33
|
+
import '@bigbinary/neetoui/formik/Input';
|
|
34
|
+
import '@bigbinary/neetoui/formik/Select';
|
|
35
|
+
import '@bigbinary/neetoui/formik/Textarea';
|
|
36
|
+
import '@bigbinary/neeto-molecules/TableWrapper';
|
|
37
|
+
import '@bigbinary/neetoui/Table';
|
|
38
|
+
import '@bigbinary/neetoui/NoData';
|
|
39
|
+
import '@bigbinary/neetoui/Spinner';
|
|
40
|
+
import '@bigbinary/neeto-icons/MenuHorizontal';
|
|
41
|
+
import '@bigbinary/neetoui/Dropdown';
|
|
42
|
+
import '@bigbinary/neetoui/Tag';
|
|
43
|
+
import '@bigbinary/neeto-icons/Merge';
|
|
44
|
+
import 'classnames';
|
|
45
|
+
import '@bigbinary/neeto-icons/Check';
|
|
46
|
+
import '@bigbinary/neetoui/Input';
|
|
47
|
+
import '@bigbinary/neetoui/Modal';
|
|
48
|
+
import './inject-css-DmrvuTKK.js';
|
|
1493
49
|
//# sourceMappingURL=NeetoTags.js.map
|