@bigbinary/neeto-api-keys-frontend 1.0.2 → 1.0.3

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 CHANGED
@@ -1,9 +1,9 @@
1
1
  import React, { createElement, isValidElement, cloneElement, createContext, useContext, useState, useRef, useEffect } from 'react';
2
2
  import { DEFAULT_PAGE_INDEX, PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
3
3
  import { isPresent, isNotPresent, isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
4
+ import { useMutationWithInvalidation, useDebounce, withTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
4
5
  import Header from '@bigbinary/neeto-molecules/Header';
5
6
  import { Dropdown, Typography, Button, Tag, DatePicker as DatePicker$1, Pane, NoData, Table as Table$1, Alert } from '@bigbinary/neetoui';
6
- import { useMutationWithInvalidation, useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
7
7
  import { useQuery } from 'react-query';
8
8
  import axios from 'axios';
9
9
  import { Form as Form$1, Input, Checkbox, ActionBlock } from '@bigbinary/neetoui/formik';
@@ -2940,6 +2940,21 @@ instance.use(initReactI18next).init({
2940
2940
  fallbackLng: "en"
2941
2941
  });
2942
2942
 
2943
+ function _extends() {
2944
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
2945
+ for (var i = 1; i < arguments.length; i++) {
2946
+ var source = arguments[i];
2947
+ for (var key in source) {
2948
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
2949
+ target[key] = source[key];
2950
+ }
2951
+ }
2952
+ }
2953
+ return target;
2954
+ };
2955
+ return _extends.apply(this, arguments);
2956
+ }
2957
+
2943
2958
  function _arrayWithHoles(arr) {
2944
2959
  if (Array.isArray(arr)) return arr;
2945
2960
  }
@@ -3061,21 +3076,6 @@ var useDeleteApiKey = function useDeleteApiKey(onSuccess) {
3061
3076
  });
3062
3077
  };
3063
3078
 
3064
- function _extends() {
3065
- _extends = Object.assign ? Object.assign.bind() : function (target) {
3066
- for (var i = 1; i < arguments.length; i++) {
3067
- var source = arguments[i];
3068
- for (var key in source) {
3069
- if (Object.prototype.hasOwnProperty.call(source, key)) {
3070
- target[key] = source[key];
3071
- }
3072
- }
3073
- }
3074
- return target;
3075
- };
3076
- return _extends.apply(this, arguments);
3077
- }
3078
-
3079
3079
  var dayjs_min = {exports: {}};
3080
3080
 
3081
3081
  dayjs_min.exports;
@@ -3474,7 +3474,9 @@ var usePagination = function usePagination(_ref) {
3474
3474
  var Table = function Table(_ref) {
3475
3475
  var handleDelete = _ref.handleDelete,
3476
3476
  handleEdit = _ref.handleEdit,
3477
- searchTerm = _ref.searchTerm;
3477
+ searchTerm = _ref.searchTerm,
3478
+ _ref$noDataProps = _ref.noDataProps,
3479
+ noDataProps = _ref$noDataProps === void 0 ? {} : _ref$noDataProps;
3478
3480
  var debouncedSearchTerm = useDebounce(searchTerm);
3479
3481
  var _useTranslation = useTranslation(),
3480
3482
  t = _useTranslation.t;
@@ -3506,10 +3508,10 @@ var Table = function Table(_ref) {
3506
3508
  if (isEmpty(apiKeys)) {
3507
3509
  return /*#__PURE__*/React.createElement("div", {
3508
3510
  className: "flex h-full w-full items-center justify-center"
3509
- }, /*#__PURE__*/React.createElement(NoData, {
3511
+ }, /*#__PURE__*/React.createElement(NoData, _extends({
3510
3512
  className: "w-full",
3511
3513
  title: t("noData.title")
3512
- }), ";");
3514
+ }, noDataProps)), ";");
3513
3515
  }
3514
3516
  return /*#__PURE__*/React.createElement(TableWrapper, {
3515
3517
  hasPagination: totalCount > DEFAULT_PAGE_SIZE
@@ -3529,8 +3531,8 @@ var Table = function Table(_ref) {
3529
3531
  };
3530
3532
 
3531
3533
  var ApiKeys = function ApiKeys(_ref) {
3532
- var _ref$breadcrumbs = _ref.breadcrumbs,
3533
- breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs;
3534
+ var noDataProps = _ref.noDataProps,
3535
+ headerProps = _ref.headerProps;
3534
3536
  var _useState = useState(""),
3535
3537
  _useState2 = _slicedToArray(_useState, 2),
3536
3538
  searchTerm = _useState2[0],
@@ -3556,8 +3558,7 @@ var ApiKeys = function ApiKeys(_ref) {
3556
3558
  isDeleting = _useDeleteApiKey.isLoading;
3557
3559
  return /*#__PURE__*/React.createElement("div", {
3558
3560
  className: "flex h-full w-full flex-col"
3559
- }, /*#__PURE__*/React.createElement(Header, {
3560
- breadcrumbs: breadcrumbs,
3561
+ }, /*#__PURE__*/React.createElement(Header, _extends({
3561
3562
  title: t("common.apiKey", PLURAL),
3562
3563
  actionBlock: /*#__PURE__*/React.createElement(Button, {
3563
3564
  label: t("buttons.addApiKey"),
@@ -3573,10 +3574,11 @@ var ApiKeys = function ApiKeys(_ref) {
3573
3574
  },
3574
3575
  placeholder: t("placeholders.search")
3575
3576
  }
3576
- }), /*#__PURE__*/React.createElement(Table, {
3577
+ }, headerProps)), /*#__PURE__*/React.createElement(Table, {
3577
3578
  handleDelete: setApiKeyToBeDeleted,
3578
3579
  handleEdit: setApiKeyToBeEdited,
3579
- searchTerm: searchTerm
3580
+ searchTerm: searchTerm,
3581
+ noDataProps: noDataProps
3580
3582
  }), /*#__PURE__*/React.createElement(Alert, {
3581
3583
  isOpen: isNotEmpty(apiKeyToBeDeleted),
3582
3584
  isSubmitting: isDeleting,
@@ -3609,6 +3611,7 @@ var ApiKeys = function ApiKeys(_ref) {
3609
3611
  }
3610
3612
  }));
3611
3613
  };
3614
+ var index = withTitle(ApiKeys, t$1("common.apiKey", PLURAL));
3612
3615
 
3613
- export { ApiKeys };
3616
+ export { index as ApiKeys };
3614
3617
  //# sourceMappingURL=index.js.map