@bigbinary/neeto-molecules 3.3.10 → 3.3.12
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/Breadcrumbs.js +28 -24
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/BrowserSupport.js +95 -69
- package/dist/BrowserSupport.js.map +1 -1
- package/dist/Builder.js +337 -285
- package/dist/Builder.js.map +1 -1
- package/dist/CalendarView.js +121 -110
- package/dist/CalendarView.js.map +1 -1
- package/dist/{Chevron-dee43d2f.js → Chevron-6564bcdc.js} +81 -67
- package/dist/Chevron-6564bcdc.js.map +1 -0
- package/dist/Codeblock.js +30 -25
- package/dist/Codeblock.js.map +1 -1
- package/dist/Columns.js +3 -3
- package/dist/ConfigurePageSidebar.js +39 -37
- package/dist/ConfigurePageSidebar.js.map +1 -1
- package/dist/ConfirmationModal.js +54 -42
- package/dist/ConfirmationModal.js.map +1 -1
- package/dist/Container.js +6 -4
- package/dist/Container.js.map +1 -1
- package/dist/CopyToClipboardButton.js +5 -3
- package/dist/CopyToClipboardButton.js.map +1 -1
- package/dist/Currency.js +9 -4
- package/dist/Currency.js.map +1 -1
- package/dist/CustomDomain.js +56 -53
- package/dist/CustomDomain.js.map +1 -1
- package/dist/CustomDomainDashboard.js +131 -113
- package/dist/CustomDomainDashboard.js.map +1 -1
- package/dist/DateFormat.js +13 -7
- package/dist/DateFormat.js.map +1 -1
- package/dist/DateRangeFilter.js +43 -38
- package/dist/DateRangeFilter.js.map +1 -1
- package/dist/DeleteArchiveModal.js +47 -38
- package/dist/DeleteArchiveModal.js.map +1 -1
- package/dist/DocumentEditor.js +43 -39
- package/dist/DocumentEditor.js.map +1 -1
- package/dist/DownloadMobileAppCallout.js +15 -14
- package/dist/DownloadMobileAppCallout.js.map +1 -1
- package/dist/DynamicVariables.js +33 -26
- package/dist/DynamicVariables.js.map +1 -1
- package/dist/EmailForm.js +144 -131
- package/dist/EmailForm.js.map +1 -1
- package/dist/EmailPreview.js +83 -68
- package/dist/EmailPreview.js.map +1 -1
- package/dist/EmojiPicker.js +11 -6
- package/dist/EmojiPicker.js.map +1 -1
- package/dist/EmojiReactions.js +48 -37
- package/dist/EmojiReactions.js.map +1 -1
- package/dist/ErrorPage.js +51 -38
- package/dist/ErrorPage.js.map +1 -1
- package/dist/FileUpload.js +180 -149
- package/dist/FileUpload.js.map +1 -1
- package/dist/FloatingActionMenu.js +288 -230
- package/dist/FloatingActionMenu.js.map +1 -1
- package/dist/Header.js +42 -35
- package/dist/Header.js.map +1 -1
- package/dist/HelpPopover.js +50 -42
- package/dist/HelpPopover.js.map +1 -1
- package/dist/IconPicker.js +121 -100
- package/dist/IconPicker.js.map +1 -1
- package/dist/ImageWithFallback.js +9 -5
- package/dist/ImageWithFallback.js.map +1 -1
- package/dist/InlineInput.js +59 -52
- package/dist/InlineInput.js.map +1 -1
- package/dist/Insights.js +185 -153
- package/dist/Insights.js.map +1 -1
- package/dist/IntegrationCard.js +109 -91
- package/dist/IntegrationCard.js.map +1 -1
- package/dist/IntegrationDisconnectAlert.js +5 -3
- package/dist/IntegrationDisconnectAlert.js.map +1 -1
- package/dist/IntegrationWalkthroughModal.js +30 -20
- package/dist/IntegrationWalkthroughModal.js.map +1 -1
- package/dist/IpRestriction.js +209 -177
- package/dist/IpRestriction.js.map +1 -1
- package/dist/KeyboardShortcuts.js +83 -73
- package/dist/KeyboardShortcuts.js.map +1 -1
- package/dist/LoginPage.js +70 -63
- package/dist/LoginPage.js.map +1 -1
- package/dist/MadeWith.js +14 -9
- package/dist/MadeWith.js.map +1 -1
- package/dist/MenuBar.js +107 -77
- package/dist/MenuBar.js.map +1 -1
- package/dist/Metadata.js +124 -100
- package/dist/Metadata.js.map +1 -1
- package/dist/MoreDropdown.js +55 -43
- package/dist/MoreDropdown.js.map +1 -1
- package/dist/NavigationHeader.js +104 -81
- package/dist/NavigationHeader.js.map +1 -1
- package/dist/NeetoWidget.js +383 -330
- package/dist/NeetoWidget.js.map +1 -1
- package/dist/Onboarding.js +125 -107
- package/dist/Onboarding.js.map +1 -1
- package/dist/OptionFields.js +261 -227
- package/dist/OptionFields.js.map +1 -1
- package/dist/PageLoader.js +23 -19
- package/dist/PageLoader.js.map +1 -1
- package/dist/PhoneNumber.js +85 -69
- package/dist/PhoneNumber.js.map +1 -1
- package/dist/ProductEmbed.js +384 -341
- package/dist/ProductEmbed.js.map +1 -1
- package/dist/PublishBlock.js +185 -154
- package/dist/PublishBlock.js.map +1 -1
- package/dist/PublishYourItem.js +35 -30
- package/dist/PublishYourItem.js.map +1 -1
- package/dist/Rename.js +102 -83
- package/dist/Rename.js.map +1 -1
- package/dist/ResponsiveDevicePicker.js +25 -21
- package/dist/ResponsiveDevicePicker.js.map +1 -1
- package/dist/Schedule.js +340 -301
- package/dist/Schedule.js.map +1 -1
- package/dist/Scrollable.js +7 -4
- package/dist/Scrollable.js.map +1 -1
- package/dist/Search.js +6 -4
- package/dist/Search.js.map +1 -1
- package/dist/SendToFields.js +154 -125
- package/dist/SendToFields.js.map +1 -1
- package/dist/Settings.js +94 -78
- package/dist/Settings.js.map +1 -1
- package/dist/ShareRecordingPane.js +60 -49
- package/dist/ShareRecordingPane.js.map +1 -1
- package/dist/ShareViaEmail.js +167 -146
- package/dist/ShareViaEmail.js.map +1 -1
- package/dist/ShareViaLink.js +289 -255
- package/dist/ShareViaLink.js.map +1 -1
- package/dist/Sidebar.js +122 -111
- package/dist/Sidebar.js.map +1 -1
- package/dist/StickyRibbonsContainer.js +20 -18
- package/dist/StickyRibbonsContainer.js.map +1 -1
- package/dist/SubHeader.js +111 -100
- package/dist/SubHeader.js.map +1 -1
- package/dist/SuffixedInput.js +52 -47
- package/dist/SuffixedInput.js.map +1 -1
- package/dist/TableWrapper.js +9 -7
- package/dist/TableWrapper.js.map +1 -1
- package/dist/Taxonomy.js +179 -151
- package/dist/Taxonomy.js.map +1 -1
- package/dist/TimeFormat.js +2 -2
- package/dist/TimezoneMismatchModal.js +55 -43
- package/dist/TimezoneMismatchModal.js.map +1 -1
- package/dist/ToggleFeatureCard.js +74 -65
- package/dist/ToggleFeatureCard.js.map +1 -1
- package/dist/cjs/Breadcrumbs.js +28 -25
- package/dist/cjs/Breadcrumbs.js.map +1 -1
- package/dist/cjs/BrowserSupport.js +96 -71
- package/dist/cjs/BrowserSupport.js.map +1 -1
- package/dist/cjs/Builder.js +336 -286
- package/dist/cjs/Builder.js.map +1 -1
- package/dist/cjs/CalendarView.js +120 -111
- package/dist/cjs/CalendarView.js.map +1 -1
- package/dist/cjs/{Chevron-c10b4e16.js → Chevron-6368e586.js} +81 -69
- package/dist/cjs/Chevron-6368e586.js.map +1 -0
- package/dist/cjs/Codeblock.js +31 -27
- package/dist/cjs/Codeblock.js.map +1 -1
- package/dist/cjs/Columns.js +3 -3
- package/dist/cjs/ConfigurePageSidebar.js +38 -37
- package/dist/cjs/ConfigurePageSidebar.js.map +1 -1
- package/dist/cjs/ConfirmationModal.js +53 -42
- package/dist/cjs/ConfirmationModal.js.map +1 -1
- package/dist/cjs/Container.js +5 -4
- package/dist/cjs/Container.js.map +1 -1
- package/dist/cjs/CopyToClipboardButton.js +4 -4
- package/dist/cjs/CopyToClipboardButton.js.map +1 -1
- package/dist/cjs/Currency.js +9 -5
- package/dist/cjs/Currency.js.map +1 -1
- package/dist/cjs/CustomDomain.js +55 -53
- package/dist/cjs/CustomDomain.js.map +1 -1
- package/dist/cjs/CustomDomainDashboard.js +131 -114
- package/dist/cjs/CustomDomainDashboard.js.map +1 -1
- package/dist/cjs/DateFormat.js +14 -9
- package/dist/cjs/DateFormat.js.map +1 -1
- package/dist/cjs/DateRangeFilter.js +44 -40
- package/dist/cjs/DateRangeFilter.js.map +1 -1
- package/dist/cjs/DeleteArchiveModal.js +46 -38
- package/dist/cjs/DeleteArchiveModal.js.map +1 -1
- package/dist/cjs/DocumentEditor.js +42 -40
- package/dist/cjs/DocumentEditor.js.map +1 -1
- package/dist/cjs/DownloadMobileAppCallout.js +15 -15
- package/dist/cjs/DownloadMobileAppCallout.js.map +1 -1
- package/dist/cjs/DynamicVariables.js +32 -27
- package/dist/cjs/DynamicVariables.js.map +1 -1
- package/dist/cjs/EmailForm.js +143 -131
- package/dist/cjs/EmailForm.js.map +1 -1
- package/dist/cjs/EmailPreview.js +82 -68
- package/dist/cjs/EmailPreview.js.map +1 -1
- package/dist/cjs/EmojiPicker.js +11 -7
- package/dist/cjs/EmojiPicker.js.map +1 -1
- package/dist/cjs/EmojiReactions.js +47 -37
- package/dist/cjs/EmojiReactions.js.map +1 -1
- package/dist/cjs/ErrorPage.js +51 -39
- package/dist/cjs/ErrorPage.js.map +1 -1
- package/dist/cjs/FileUpload.js +181 -152
- package/dist/cjs/FileUpload.js.map +1 -1
- package/dist/cjs/FloatingActionMenu.js +288 -232
- package/dist/cjs/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/Header.js +41 -36
- package/dist/cjs/Header.js.map +1 -1
- package/dist/cjs/HelpPopover.js +50 -43
- package/dist/cjs/HelpPopover.js.map +1 -1
- package/dist/cjs/IconPicker.js +121 -101
- package/dist/cjs/IconPicker.js.map +1 -1
- package/dist/cjs/ImageWithFallback.js +8 -6
- package/dist/cjs/ImageWithFallback.js.map +1 -1
- package/dist/cjs/InlineInput.js +59 -54
- package/dist/cjs/InlineInput.js.map +1 -1
- package/dist/cjs/Insights.js +185 -154
- package/dist/cjs/Insights.js.map +1 -1
- package/dist/cjs/IntegrationCard.js +110 -93
- package/dist/cjs/IntegrationCard.js.map +1 -1
- package/dist/cjs/IntegrationDisconnectAlert.js +6 -5
- package/dist/cjs/IntegrationDisconnectAlert.js.map +1 -1
- package/dist/cjs/IntegrationWalkthroughModal.js +30 -21
- package/dist/cjs/IntegrationWalkthroughModal.js.map +1 -1
- package/dist/cjs/IpRestriction.js +208 -177
- package/dist/cjs/IpRestriction.js.map +1 -1
- package/dist/cjs/KeyboardShortcuts.js +83 -74
- package/dist/cjs/KeyboardShortcuts.js.map +1 -1
- package/dist/cjs/LoginPage.js +69 -63
- package/dist/cjs/LoginPage.js.map +1 -1
- package/dist/cjs/MadeWith.js +14 -10
- package/dist/cjs/MadeWith.js.map +1 -1
- package/dist/cjs/MenuBar.js +108 -79
- package/dist/cjs/MenuBar.js.map +1 -1
- package/dist/cjs/Metadata.js +123 -100
- package/dist/cjs/Metadata.js.map +1 -1
- package/dist/cjs/MoreDropdown.js +55 -45
- package/dist/cjs/MoreDropdown.js.map +1 -1
- package/dist/cjs/NavigationHeader.js +105 -83
- package/dist/cjs/NavigationHeader.js.map +1 -1
- package/dist/cjs/NeetoWidget.js +383 -332
- package/dist/cjs/NeetoWidget.js.map +1 -1
- package/dist/cjs/Onboarding.js +125 -109
- package/dist/cjs/Onboarding.js.map +1 -1
- package/dist/cjs/OptionFields.js +261 -229
- package/dist/cjs/OptionFields.js.map +1 -1
- package/dist/cjs/PageLoader.js +23 -20
- package/dist/cjs/PageLoader.js.map +1 -1
- package/dist/cjs/PhoneNumber.js +86 -72
- package/dist/cjs/PhoneNumber.js.map +1 -1
- package/dist/cjs/ProductEmbed.js +383 -341
- package/dist/cjs/ProductEmbed.js.map +1 -1
- package/dist/cjs/PublishBlock.js +185 -156
- package/dist/cjs/PublishBlock.js.map +1 -1
- package/dist/cjs/PublishYourItem.js +35 -31
- package/dist/cjs/PublishYourItem.js.map +1 -1
- package/dist/cjs/Rename.js +102 -85
- package/dist/cjs/Rename.js.map +1 -1
- package/dist/cjs/ResponsiveDevicePicker.js +26 -24
- package/dist/cjs/ResponsiveDevicePicker.js.map +1 -1
- package/dist/cjs/Schedule.js +339 -301
- package/dist/cjs/Schedule.js.map +1 -1
- package/dist/cjs/Scrollable.js +7 -6
- package/dist/cjs/Scrollable.js.map +1 -1
- package/dist/cjs/Search.js +5 -5
- package/dist/cjs/Search.js.map +1 -1
- package/dist/cjs/SendToFields.js +154 -126
- package/dist/cjs/SendToFields.js.map +1 -1
- package/dist/cjs/Settings.js +94 -80
- package/dist/cjs/Settings.js.map +1 -1
- package/dist/cjs/ShareRecordingPane.js +60 -51
- package/dist/cjs/ShareRecordingPane.js.map +1 -1
- package/dist/cjs/ShareViaEmail.js +167 -148
- package/dist/cjs/ShareViaEmail.js.map +1 -1
- package/dist/cjs/ShareViaLink.js +290 -256
- package/dist/cjs/ShareViaLink.js.map +1 -1
- package/dist/cjs/Sidebar.js +120 -111
- package/dist/cjs/Sidebar.js.map +1 -1
- package/dist/cjs/StickyRibbonsContainer.js +20 -19
- package/dist/cjs/StickyRibbonsContainer.js.map +1 -1
- package/dist/cjs/SubHeader.js +110 -101
- package/dist/cjs/SubHeader.js.map +1 -1
- package/dist/cjs/SuffixedInput.js +51 -48
- package/dist/cjs/SuffixedInput.js.map +1 -1
- package/dist/cjs/TableWrapper.js +9 -8
- package/dist/cjs/TableWrapper.js.map +1 -1
- package/dist/cjs/Taxonomy.js +178 -151
- package/dist/cjs/Taxonomy.js.map +1 -1
- package/dist/cjs/TimeFormat.js +2 -2
- package/dist/cjs/TimezoneMismatchModal.js +54 -43
- package/dist/cjs/TimezoneMismatchModal.js.map +1 -1
- package/dist/cjs/ToggleFeatureCard.js +73 -66
- package/dist/cjs/ToggleFeatureCard.js.map +1 -1
- package/dist/cjs/{index-4ee3f585.js → index-c925b4b1.js} +296 -239
- package/dist/cjs/index-c925b4b1.js.map +1 -0
- package/dist/cjs/{useColumns-5ce3cf1e.js → useColumns-8894f767.js} +52 -42
- package/dist/cjs/useColumns-8894f767.js.map +1 -0
- package/dist/{index-0063079e.js → index-e123ffe8.js} +296 -238
- package/dist/index-e123ffe8.js.map +1 -0
- package/dist/{useColumns-e0b5dfb7.js → useColumns-13263cd8.js} +52 -40
- package/dist/useColumns-13263cd8.js.map +1 -0
- package/package.json +5 -3
- package/types/Breadcrumbs.d.ts +0 -1
- package/types/Builder.d.ts +0 -1
- package/types/Codeblock.d.ts +0 -1
- package/types/Columns.d.ts +10 -4
- package/types/ConfirmationModal.d.ts +0 -1
- package/types/DeleteArchiveModal.d.ts +9 -6
- package/types/DocumentEditor.d.ts +0 -1
- package/types/EmailForm.d.ts +0 -1
- package/types/EmailFormProvider.d.ts +0 -1
- package/types/EmailPreview.d.ts +0 -1
- package/types/FileUpload.d.ts +8 -4
- package/types/IntegrationWalkthroughModal.d.ts +1 -1
- package/types/Metadata.d.ts +0 -1
- package/types/MoreDropdown.d.ts +0 -1
- package/types/NavigationHeader.d.ts +0 -4
- package/types/PhoneNumber.d.ts +1 -1
- package/types/ProductEmbed.d.ts +0 -1
- package/types/Schedule.d.ts +1 -1
- package/types/Search.d.ts +0 -1
- package/types/SendToFields.d.ts +0 -1
- package/types/Settings.d.ts +1 -1
- package/types/ShareRecordingPane.d.ts +1 -1
- package/types/ShareViaEmail.d.ts +1 -2
- package/types/Taxonomy.d.ts +0 -1
- package/dist/Chevron-dee43d2f.js.map +0 -1
- package/dist/cjs/Chevron-c10b4e16.js.map +0 -1
- package/dist/cjs/index-4ee3f585.js.map +0 -1
- package/dist/cjs/useColumns-5ce3cf1e.js.map +0 -1
- package/dist/index-0063079e.js.map +0 -1
- package/dist/useColumns-e0b5dfb7.js.map +0 -1
package/dist/SubHeader.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef, useMemo, useRef, useLayoutEffect } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
4
|
import { isNotPresent } from '@bigbinary/neeto-cist';
|
|
4
5
|
import { pluck, not } from 'ramda';
|
|
5
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
7
6
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
8
7
|
import Column from '@bigbinary/neeto-icons/Column';
|
|
9
8
|
import Button from '@bigbinary/neetoui/Button';
|
|
10
9
|
import { useTranslation } from 'react-i18next';
|
|
11
|
-
import { u as useHiddenColumns, C as Columns$1 } from './useColumns-
|
|
10
|
+
import { u as useHiddenColumns, C as Columns$1 } from './useColumns-13263cd8.js';
|
|
11
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
+
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
12
13
|
import Download from '@bigbinary/neeto-icons/Download';
|
|
13
14
|
import { Filters } from '@bigbinary/neeto-filters-frontend';
|
|
14
15
|
import Filter from '@bigbinary/neeto-icons/Filter';
|
|
@@ -26,8 +27,8 @@ import 'zustand/middleware';
|
|
|
26
27
|
import '@bigbinary/neeto-commons-frontend/utils/general';
|
|
27
28
|
|
|
28
29
|
var _excluded$1 = ["buttonProps", "columnData", "localStorageKey", "fixedColumns"];
|
|
29
|
-
function ownKeys$
|
|
30
|
-
function _objectSpread$
|
|
30
|
+
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; }
|
|
31
|
+
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; }
|
|
31
32
|
var Columns = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
32
33
|
var _ref$buttonProps = _ref.buttonProps,
|
|
33
34
|
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
@@ -45,107 +46,113 @@ var Columns = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
45
46
|
var _useHiddenColumns = useHiddenColumns(localStorageKey),
|
|
46
47
|
hideColumn = _useHiddenColumns.hideColumn,
|
|
47
48
|
showColumn = _useHiddenColumns.showColumn;
|
|
48
|
-
return /*#__PURE__*/
|
|
49
|
-
className: "neeto-molecules-subheader__columns"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
49
|
+
return /*#__PURE__*/jsx("div", {
|
|
50
|
+
className: "neeto-molecules-subheader__columns",
|
|
51
|
+
children: /*#__PURE__*/jsx(Columns$1, _objectSpread$2({
|
|
52
|
+
isSearchable: true,
|
|
53
|
+
className: "neeto-ui-dropdown--manage-columns",
|
|
54
|
+
actionBlock: /*#__PURE__*/jsxs("div", {
|
|
55
|
+
className: "grid grid-cols-2 gap-2 px-4 py-3",
|
|
56
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
57
|
+
className: "col-span-1 justify-center",
|
|
58
|
+
label: "Hide all",
|
|
59
|
+
style: "secondary",
|
|
60
|
+
onClick: function onClick() {
|
|
61
|
+
return hideColumn(columnDataIndex);
|
|
62
|
+
}
|
|
63
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
64
|
+
className: "col-span-1 justify-center",
|
|
65
|
+
label: "Show all",
|
|
66
|
+
style: "secondary",
|
|
67
|
+
onClick: function onClick() {
|
|
68
|
+
return showColumn(columnDataIndex);
|
|
69
|
+
}
|
|
70
|
+
})]
|
|
71
|
+
}),
|
|
72
|
+
buttonProps: _objectSpread$2({
|
|
73
|
+
icon: Column,
|
|
74
|
+
label: null,
|
|
75
|
+
tooltipProps: {
|
|
76
|
+
content: t("neetoMolecules.columns.columns"),
|
|
77
|
+
position: "bottom"
|
|
78
|
+
},
|
|
79
|
+
"data-testid": "columns-button",
|
|
80
|
+
"data-cy": "columns-dropdown-button"
|
|
81
|
+
}, buttonProps)
|
|
82
|
+
}, _objectSpread$2(_objectSpread$2({
|
|
83
|
+
columnData: columnData,
|
|
84
|
+
localStorageKey: localStorageKey
|
|
85
|
+
}, props), {}, {
|
|
86
|
+
ref: ref
|
|
87
|
+
})))
|
|
88
|
+
});
|
|
86
89
|
});
|
|
87
90
|
Columns.displayName = "Columns";
|
|
88
91
|
|
|
89
|
-
var DownloadButton = function
|
|
90
|
-
var
|
|
92
|
+
var DownloadButton = withT(function (_ref) {
|
|
93
|
+
var t = _ref.t,
|
|
94
|
+
count = _ref.count,
|
|
91
95
|
onClick = _ref.onClick,
|
|
92
96
|
_ref$dataCy = _ref["data-cy"],
|
|
93
97
|
dataCy = _ref$dataCy === void 0 ? "download-button" : _ref$dataCy;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
icon: Download,
|
|
102
|
-
style: "text",
|
|
103
|
-
tooltipProps: {
|
|
104
|
-
content: t("neetoMolecules.common.download"),
|
|
105
|
-
position: "bottom"
|
|
106
|
-
},
|
|
107
|
-
onClick: onClick
|
|
108
|
-
}), count && /*#__PURE__*/React__default.createElement("span", {
|
|
109
|
-
className: "neeto-molecules-subheader__download-count"
|
|
110
|
-
}, count));
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
var _excluded = ["buttonProps"];
|
|
114
|
-
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; }
|
|
115
|
-
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; }
|
|
116
|
-
var FilterButton = function FilterButton(_ref) {
|
|
117
|
-
var buttonProps = _ref.buttonProps,
|
|
118
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
119
|
-
var _useTranslation = useTranslation(),
|
|
120
|
-
t = _useTranslation.t;
|
|
121
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
122
|
-
className: "neeto-molecules-subheader__filter"
|
|
123
|
-
}, /*#__PURE__*/React__default.createElement(Filters, _extends({
|
|
124
|
-
buttonProps: _objectSpread({
|
|
125
|
-
"data-testid": "filter-button",
|
|
126
|
-
icon: Filter,
|
|
98
|
+
return /*#__PURE__*/jsxs("div", {
|
|
99
|
+
className: "neeto-molecules-subheader__download",
|
|
100
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
101
|
+
onClick: onClick,
|
|
102
|
+
"data-cy": dataCy,
|
|
103
|
+
"data-testid": "download-button",
|
|
104
|
+
icon: Download,
|
|
127
105
|
style: "text",
|
|
128
106
|
tooltipProps: {
|
|
129
|
-
content: t("neetoMolecules.common.
|
|
107
|
+
content: t("neetoMolecules.common.download"),
|
|
130
108
|
position: "bottom"
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
109
|
+
}
|
|
110
|
+
}), count && /*#__PURE__*/jsx("span", {
|
|
111
|
+
className: "neeto-molecules-subheader__download-count",
|
|
112
|
+
children: count
|
|
113
|
+
})]
|
|
114
|
+
});
|
|
115
|
+
});
|
|
136
116
|
|
|
117
|
+
var _excluded = ["t", "buttonProps"];
|
|
118
|
+
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; }
|
|
119
|
+
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; }
|
|
120
|
+
var FilterButton = withT(function (_ref) {
|
|
121
|
+
var t = _ref.t,
|
|
122
|
+
buttonProps = _ref.buttonProps,
|
|
123
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
124
|
+
return /*#__PURE__*/jsx("div", {
|
|
125
|
+
className: "neeto-molecules-subheader__filter",
|
|
126
|
+
children: /*#__PURE__*/jsx(Filters, _objectSpread$1({
|
|
127
|
+
buttonProps: _objectSpread$1({
|
|
128
|
+
"data-testid": "filter-button",
|
|
129
|
+
icon: Filter,
|
|
130
|
+
style: "text",
|
|
131
|
+
tooltipProps: {
|
|
132
|
+
content: t("neetoMolecules.common.filter"),
|
|
133
|
+
position: "bottom"
|
|
134
|
+
},
|
|
135
|
+
label: null
|
|
136
|
+
}, buttonProps)
|
|
137
|
+
}, props))
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
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; }
|
|
142
|
+
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; }
|
|
137
143
|
var RightBlock = function RightBlock(_ref) {
|
|
138
144
|
var downloadButtonProps = _ref.downloadButtonProps,
|
|
139
145
|
columnsButtonProps = _ref.columnsButtonProps,
|
|
140
146
|
filterProps = _ref.filterProps,
|
|
141
147
|
dataProps = _ref.dataProps;
|
|
142
148
|
var showIcons = isNotPresent(dataProps === null || dataProps === void 0 ? void 0 : dataProps.totalCount) ? true : (dataProps === null || dataProps === void 0 ? void 0 : dataProps.totalCount) > 0;
|
|
143
|
-
return /*#__PURE__*/
|
|
149
|
+
return /*#__PURE__*/jsxs("div", {
|
|
144
150
|
"data-testid": "subheader-rightblock-buttons-container",
|
|
145
151
|
className: classnames("neeto-molecules-subheader__right-actions", {
|
|
146
152
|
hidden: not(showIcons)
|
|
147
|
-
})
|
|
148
|
-
|
|
153
|
+
}),
|
|
154
|
+
children: [downloadButtonProps && /*#__PURE__*/jsx(DownloadButton, _objectSpread({}, downloadButtonProps)), columnsButtonProps && /*#__PURE__*/jsx(Columns, _objectSpread({}, columnsButtonProps)), filterProps && /*#__PURE__*/jsx(FilterButton, _objectSpread({}, filterProps))]
|
|
155
|
+
});
|
|
149
156
|
};
|
|
150
157
|
|
|
151
158
|
var css = ":root{--neeto-molecules-sub-header-height:37px;--neeto-molecules-sub-header-bottom-margin:20px;--neeto-molecules-effective-subheader-height:0px}.neeto-molecules-subheader{align-items:center;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;flex-shrink:0;gap:16px;justify-content:space-between;margin-bottom:20px;margin-bottom:var(--neeto-molecules-sub-header-bottom-margin);width:100%}@media screen and (max-width:768px){.neeto-molecules-subheader{flex-wrap:wrap}}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper{display:flex;flex-grow:1}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left{align-items:center;display:flex;flex-direction:row;justify-content:flex-start}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left .neeto-molecules-input__prefix{color:rgb(var(--neeto-ui-gray-400))}@media screen and (max-width:360px){.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left h4{font-size:14px}}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-ui-btn{flex-shrink:0}.neeto-molecules-subheader .neeto-molecules-subheader__right{align-items:center;display:flex;flex-direction:row;gap:12px;justify-content:flex-end}@media screen and (max-width:768px){.neeto-molecules-subheader .neeto-molecules-subheader__right{margin-left:auto}}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions{align-items:center;display:flex;flex-direction:row;gap:8px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions>:not([hidden])~:not([hidden]){border-left:thin solid rgb(var(--neeto-ui-gray-200));padding-left:8px}.neeto-molecules-subheader__download{position:relative}.neeto-molecules-subheader__download-count{align-items:center;background-color:rgb(var(--neeto-ui-accent-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;font-size:10px;justify-content:center;min-height:16px;min-width:16px;position:absolute;right:-2px;text-align:center;top:-2px;z-index:1}.neeto-molecules-subheader__columns .neeto-ui-dropdown__popup{max-height:calc(100vh - var(--neeto-molecules-effective-header-height) - 57px);max-height:calc(100vh - var(--neeto-molecules-effective-header-height) - var(--neeto-molecules-sub-header-height) - var(--neeto-molecules-sub-header-bottom-margin));min-width:320px}";
|
|
@@ -171,21 +178,25 @@ var SubHeader = function SubHeader(_ref) {
|
|
|
171
178
|
return window.removeEventListener("resize", updateHeaderHeight);
|
|
172
179
|
};
|
|
173
180
|
}, []);
|
|
174
|
-
return /*#__PURE__*/
|
|
181
|
+
return /*#__PURE__*/jsxs("div", {
|
|
175
182
|
className: classnames(["neeto-molecules-subheader", className]),
|
|
176
183
|
"data-cy": dataCy,
|
|
177
184
|
"data-testid": "subheader",
|
|
178
|
-
ref: subheaderRef
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
"
|
|
188
|
-
|
|
185
|
+
ref: subheaderRef,
|
|
186
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
187
|
+
className: "neeto-molecules-subheader__left-wrapper",
|
|
188
|
+
"data-cy": "subheader-left-wrapper",
|
|
189
|
+
children: leftActionBlock && /*#__PURE__*/jsx("div", {
|
|
190
|
+
className: "neeto-molecules-subheader__left",
|
|
191
|
+
"data-cy": "subheader-left",
|
|
192
|
+
children: leftActionBlock
|
|
193
|
+
})
|
|
194
|
+
}), rightActionBlock && /*#__PURE__*/jsx("div", {
|
|
195
|
+
className: "neeto-molecules-subheader__right",
|
|
196
|
+
"data-cy": "subheader-right",
|
|
197
|
+
children: rightActionBlock
|
|
198
|
+
})]
|
|
199
|
+
});
|
|
189
200
|
};
|
|
190
201
|
SubHeader.RightBlock = RightBlock;
|
|
191
202
|
|
package/dist/SubHeader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubHeader.js","sources":["../src/components/SubHeader/RightBlock/Columns.jsx","../src/components/SubHeader/RightBlock/Download.jsx","../src/components/SubHeader/RightBlock/Filter.jsx","../src/components/SubHeader/RightBlock/index.jsx","../src/components/SubHeader/index.jsx"],"sourcesContent":["import React, { forwardRef, useMemo } from \"react\";\n\nimport { Column } from \"neetoicons\";\nimport { Button } from \"neetoui\";\nimport { pluck } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport ManageColumns, { useHiddenColumns } from \"components/Columns\";\n\nconst Columns = forwardRef(\n (\n { buttonProps = {}, columnData, localStorageKey, fixedColumns, ...props },\n ref\n ) => {\n const { t } = useTranslation();\n\n const columnDataIndex = useMemo(\n () =>\n pluck(\n \"dataIndex\",\n (columnData || []).filter(\n column => !fixedColumns?.includes(column.dataIndex)\n )\n ),\n [columnData, fixedColumns]\n );\n\n const { hideColumn, showColumn } = useHiddenColumns(localStorageKey);\n\n return (\n <div className=\"neeto-molecules-subheader__columns\">\n <ManageColumns\n isSearchable\n className=\"neeto-ui-dropdown--manage-columns\"\n actionBlock={\n <div className=\"grid grid-cols-2 gap-2 px-4 py-3\">\n <Button\n className=\"col-span-1 justify-center\"\n label=\"Hide all\"\n style=\"secondary\"\n onClick={() => hideColumn(columnDataIndex)}\n />\n <Button\n className=\"col-span-1 justify-center\"\n label=\"Show all\"\n style=\"secondary\"\n onClick={() => showColumn(columnDataIndex)}\n />\n </div>\n }\n buttonProps={{\n icon: Column,\n label: null,\n tooltipProps: {\n content: t(\"neetoMolecules.columns.columns\"),\n position: \"bottom\",\n },\n \"data-testid\": \"columns-button\",\n \"data-cy\": \"columns-dropdown-button\",\n ...buttonProps,\n }}\n {...{ columnData, localStorageKey, ...props, ref }}\n />\n </div>\n );\n }\n);\n\nColumns.displayName = \"Columns\";\nexport default Columns;\n","import React from \"react\";\n\nimport { Download } from \"neetoicons\";\nimport { Button } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst DownloadButton = ({\n count,\n onClick,\n \"data-cy\": dataCy = \"download-button\",\n}) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"neeto-molecules-subheader__download\">\n <Button\n data-cy={dataCy}\n data-testid=\"download-button\"\n icon={Download}\n style=\"text\"\n tooltipProps={{\n content: t(\"neetoMolecules.common.download\"),\n position: \"bottom\",\n }}\n onClick={onClick}\n />\n {count && (\n <span className=\"neeto-molecules-subheader__download-count\">\n {count}\n </span>\n )}\n </div>\n );\n};\n\nexport default DownloadButton;\n","import React from \"react\";\n\nimport { Filters as NeetoFilters } from \"neetofilters\";\nimport { Filter } from \"neetoicons\";\nimport { useTranslation } from \"react-i18next\";\n\nconst FilterButton = ({ buttonProps, ...props }) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"neeto-molecules-subheader__filter\">\n <NeetoFilters\n buttonProps={{\n \"data-testid\": \"filter-button\",\n icon: Filter,\n style: \"text\",\n tooltipProps: {\n content: t(\"neetoMolecules.common.filter\"),\n position: \"bottom\",\n },\n label: null,\n ...buttonProps,\n }}\n {...props}\n />\n </div>\n );\n};\n\nexport default FilterButton;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isNotPresent } from \"neetocist\";\nimport PropTypes from \"prop-types\";\nimport { not } from \"ramda\";\n\nimport Columns from \"./Columns\";\nimport Download from \"./Download\";\nimport Filter from \"./Filter\";\n\nconst RightBlock = ({\n downloadButtonProps,\n columnsButtonProps,\n filterProps,\n dataProps,\n}) => {\n const showIcons = isNotPresent(dataProps?.totalCount)\n ? true\n : dataProps?.totalCount > 0;\n\n return (\n <div\n data-testid=\"subheader-rightblock-buttons-container\"\n className={classnames(\"neeto-molecules-subheader__right-actions\", {\n hidden: not(showIcons),\n })}\n >\n {downloadButtonProps && <Download {...downloadButtonProps} />}\n {columnsButtonProps && <Columns {...columnsButtonProps} />}\n {filterProps && <Filter {...filterProps} />}\n </div>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * Props that are passed to the download button.\n */\n downloadButtonProps: PropTypes.shape({\n count: PropTypes.number,\n onClick: PropTypes.func,\n }),\n /**\n * Props that are passed to the columns button, same as the `Columns` component from neetoMolecules.\n */\n columnsButtonProps: PropTypes.shape({\n onChange: PropTypes.func,\n actionBlock: PropTypes.node,\n checkboxProps: PropTypes.object,\n columnData: PropTypes.array,\n isSearchable: PropTypes.bool,\n localStorageKey: PropTypes.string,\n initialValue: PropTypes.array,\n noColumnMessage: PropTypes.string,\n searchProps: PropTypes.object,\n }),\n /**\n * Props that are passed the the filter component. These are the same props as the\n * neetoFilters `Filters` component.\n */\n filterProps: PropTypes.shape({\n size: PropTypes.oneOf([\"xsmall\", \"small\", \"large\"]),\n isOpen: PropTypes.bool,\n setIsOpen: PropTypes.func,\n columns: PropTypes.object,\n onChange: PropTypes.func,\n onSelectorsChange: PropTypes.func,\n buttonProps: PropTypes.object,\n paneProps: PropTypes.object,\n isSearchable: PropTypes.bool,\n className: PropTypes.string,\n }),\n /**\n * Props related to data being displayed, such as tables, lists, and more. The buttons\n * will be hidden if the value of `totalCount` in `dataProps` is `0`.\n */\n dataProps: PropTypes.shape({ totalCount: PropTypes.number }),\n};\n\nexport default RightBlock;\n","import React, { useLayoutEffect, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport RightBlock from \"./RightBlock\";\nimport \"./subheader.scss\";\n\nconst SubHeader = ({\n className = \"\",\n leftActionBlock,\n rightActionBlock,\n \"data-cy\": dataCy = \"subheader\",\n}) => {\n const subheaderRef = useRef(null);\n\n useLayoutEffect(() => {\n const updateHeaderHeight = () => {\n if (!subheaderRef.current) return;\n const height = subheaderRef.current.offsetHeight;\n document.body.style.setProperty(\n \"--neeto-molecules-effective-subheader-height\",\n `${height}px`\n );\n };\n\n updateHeaderHeight();\n\n window.addEventListener(\"resize\", updateHeaderHeight);\n\n return () => window.removeEventListener(\"resize\", updateHeaderHeight);\n }, []);\n\n return (\n <div\n className={classnames([\"neeto-molecules-subheader\", className])}\n data-cy={dataCy}\n data-testid=\"subheader\"\n ref={subheaderRef}\n >\n <div\n className=\"neeto-molecules-subheader__left-wrapper\"\n data-cy=\"subheader-left-wrapper\"\n >\n {leftActionBlock && (\n <div\n className=\"neeto-molecules-subheader__left\"\n data-cy=\"subheader-left\"\n >\n {leftActionBlock}\n </div>\n )}\n </div>\n {rightActionBlock && (\n <div\n className=\"neeto-molecules-subheader__right\"\n data-cy=\"subheader-right\"\n >\n {rightActionBlock}\n </div>\n )}\n </div>\n );\n};\n\nSubHeader.RightBlock = RightBlock;\n\nSubHeader.propTypes = {\n /**\n * To specify external classnames as overrides to the `SubHeader`.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered in the left side of the `SubHeader` section.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `SubHeader` section.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default SubHeader;\n"],"names":["Columns","forwardRef","_ref","ref","_ref$buttonProps","buttonProps","columnData","localStorageKey","fixedColumns","props","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","columnDataIndex","useMemo","pluck","filter","column","includes","dataIndex","_useHiddenColumns","useHiddenColumns","hideColumn","showColumn","React","createElement","className","ManageColumns","_extends","isSearchable","actionBlock","Button","label","style","onClick","_objectSpread","icon","Column","tooltipProps","content","position","displayName","DownloadButton","count","_ref$dataCy","dataCy","Download","FilterButton","NeetoFilters","Filter","RightBlock","downloadButtonProps","columnsButtonProps","filterProps","dataProps","showIcons","isNotPresent","totalCount","classnames","hidden","not","SubHeader","_ref$className","leftActionBlock","rightActionBlock","subheaderRef","useRef","useLayoutEffect","updateHeaderHeight","current","height","offsetHeight","document","body","setProperty","concat","window","addEventListener","removeEventListener"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,OAAO,gBAAGC,UAAU,CACxB,UAAAC,IAAA,EAEEC,GAAG,EACA;AAAA,EAAA,IAAAC,gBAAA,GAAAF,IAAA,CAFDG,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAA,KAAA,CAAA,GAAG,EAAE,GAAAA,gBAAA;IAAEE,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IAAEC,eAAe,GAAAL,IAAA,CAAfK,eAAe;IAAEC,YAAY,GAAAN,IAAA,CAAZM,YAAY;AAAKC,IAAAA,KAAK,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,WAAA,CAAA,CAAA;AAGvE,EAAA,IAAAC,eAAA,GAAcC,cAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC,CAAA;EAET,IAAMC,eAAe,GAAGC,OAAO,CAC7B,YAAA;AAAA,IAAA,OACEC,KAAK,CACH,WAAW,EACX,CAACX,UAAU,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S,EAAC,iCAAiC;IAC3C,SAAQ,EAAA,gBAAA;GAEPqC,EAAAA,eACE,CAEJ,CAAC,EACLC,gBAAgB,iBACfxC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,kCAAkC;IAC5C,SAAQ,EAAA,iBAAA;GAEPsC,EAAAA,gBACE,CAEJ,CAAC,CAAA;AAEV,EAAC;AAEDH,SAAS,CAACX,UAAU,GAAGA,UAAU;;;;"}
|
|
1
|
+
{"version":3,"file":"SubHeader.js","sources":["../src/components/SubHeader/RightBlock/Columns.jsx","../src/components/SubHeader/RightBlock/Download.jsx","../src/components/SubHeader/RightBlock/Filter.jsx","../src/components/SubHeader/RightBlock/index.jsx","../src/components/SubHeader/index.jsx"],"sourcesContent":["import { forwardRef, useMemo } from \"react\";\n\nimport { Column } from \"neetoicons\";\nimport { Button } from \"neetoui\";\nimport { pluck } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport ManageColumns, { useHiddenColumns } from \"components/Columns\";\n\nconst Columns = forwardRef(\n (\n { buttonProps = {}, columnData, localStorageKey, fixedColumns, ...props },\n ref\n ) => {\n const { t } = useTranslation();\n\n const columnDataIndex = useMemo(\n () =>\n pluck(\n \"dataIndex\",\n (columnData || []).filter(\n column => !fixedColumns?.includes(column.dataIndex)\n )\n ),\n [columnData, fixedColumns]\n );\n\n const { hideColumn, showColumn } = useHiddenColumns(localStorageKey);\n\n return (\n <div className=\"neeto-molecules-subheader__columns\">\n <ManageColumns\n isSearchable\n className=\"neeto-ui-dropdown--manage-columns\"\n actionBlock={\n <div className=\"grid grid-cols-2 gap-2 px-4 py-3\">\n <Button\n className=\"col-span-1 justify-center\"\n label=\"Hide all\"\n style=\"secondary\"\n onClick={() => hideColumn(columnDataIndex)}\n />\n <Button\n className=\"col-span-1 justify-center\"\n label=\"Show all\"\n style=\"secondary\"\n onClick={() => showColumn(columnDataIndex)}\n />\n </div>\n }\n buttonProps={{\n icon: Column,\n label: null,\n tooltipProps: {\n content: t(\"neetoMolecules.columns.columns\"),\n position: \"bottom\",\n },\n \"data-testid\": \"columns-button\",\n \"data-cy\": \"columns-dropdown-button\",\n ...buttonProps,\n }}\n {...{ columnData, localStorageKey, ...props, ref }}\n />\n </div>\n );\n }\n);\n\nColumns.displayName = \"Columns\";\nexport default Columns;\n","import { withT } from \"neetocommons/react-utils\";\nimport { Download } from \"neetoicons\";\nimport { Button } from \"neetoui\";\n\nconst DownloadButton = withT(\n ({ t, count, onClick, \"data-cy\": dataCy = \"download-button\" }) => (\n <div className=\"neeto-molecules-subheader__download\">\n <Button\n {...{ onClick }}\n data-cy={dataCy}\n data-testid=\"download-button\"\n icon={Download}\n style=\"text\"\n tooltipProps={{\n content: t(\"neetoMolecules.common.download\"),\n position: \"bottom\",\n }}\n />\n {count && (\n <span className=\"neeto-molecules-subheader__download-count\">\n {count}\n </span>\n )}\n </div>\n )\n);\n\nexport default DownloadButton;\n","import { withT } from \"neetocommons/react-utils\";\nimport { Filters as NeetoFilters } from \"neetofilters\";\nimport { Filter } from \"neetoicons\";\n\nconst FilterButton = withT(({ t, buttonProps, ...props }) => (\n <div className=\"neeto-molecules-subheader__filter\">\n <NeetoFilters\n buttonProps={{\n \"data-testid\": \"filter-button\",\n icon: Filter,\n style: \"text\",\n tooltipProps: {\n content: t(\"neetoMolecules.common.filter\"),\n position: \"bottom\",\n },\n label: null,\n ...buttonProps,\n }}\n {...props}\n />\n </div>\n));\n\nexport default FilterButton;\n","import classnames from \"classnames\";\nimport { isNotPresent } from \"neetocist\";\nimport PropTypes from \"prop-types\";\nimport { not } from \"ramda\";\n\nimport Columns from \"./Columns\";\nimport Download from \"./Download\";\nimport Filter from \"./Filter\";\n\nconst RightBlock = ({\n downloadButtonProps,\n columnsButtonProps,\n filterProps,\n dataProps,\n}) => {\n const showIcons = isNotPresent(dataProps?.totalCount)\n ? true\n : dataProps?.totalCount > 0;\n\n return (\n <div\n data-testid=\"subheader-rightblock-buttons-container\"\n className={classnames(\"neeto-molecules-subheader__right-actions\", {\n hidden: not(showIcons),\n })}\n >\n {downloadButtonProps && <Download {...downloadButtonProps} />}\n {columnsButtonProps && <Columns {...columnsButtonProps} />}\n {filterProps && <Filter {...filterProps} />}\n </div>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * Props that are passed to the download button.\n */\n downloadButtonProps: PropTypes.shape({\n count: PropTypes.number,\n onClick: PropTypes.func,\n }),\n /**\n * Props that are passed to the columns button, same as the `Columns` component from neetoMolecules.\n */\n columnsButtonProps: PropTypes.shape({\n onChange: PropTypes.func,\n actionBlock: PropTypes.node,\n checkboxProps: PropTypes.object,\n columnData: PropTypes.array,\n isSearchable: PropTypes.bool,\n localStorageKey: PropTypes.string,\n initialValue: PropTypes.array,\n noColumnMessage: PropTypes.string,\n searchProps: PropTypes.object,\n }),\n /**\n * Props that are passed the the filter component. These are the same props as the\n * neetoFilters `Filters` component.\n */\n filterProps: PropTypes.shape({\n size: PropTypes.oneOf([\"xsmall\", \"small\", \"large\"]),\n isOpen: PropTypes.bool,\n setIsOpen: PropTypes.func,\n columns: PropTypes.object,\n onChange: PropTypes.func,\n onSelectorsChange: PropTypes.func,\n buttonProps: PropTypes.object,\n paneProps: PropTypes.object,\n isSearchable: PropTypes.bool,\n className: PropTypes.string,\n }),\n /**\n * Props related to data being displayed, such as tables, lists, and more. The buttons\n * will be hidden if the value of `totalCount` in `dataProps` is `0`.\n */\n dataProps: PropTypes.shape({ totalCount: PropTypes.number }),\n};\n\nexport default RightBlock;\n","import { useLayoutEffect, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport RightBlock from \"./RightBlock\";\nimport \"./subheader.scss\";\n\nconst SubHeader = ({\n className = \"\",\n leftActionBlock,\n rightActionBlock,\n \"data-cy\": dataCy = \"subheader\",\n}) => {\n const subheaderRef = useRef(null);\n\n useLayoutEffect(() => {\n const updateHeaderHeight = () => {\n if (!subheaderRef.current) return;\n const height = subheaderRef.current.offsetHeight;\n document.body.style.setProperty(\n \"--neeto-molecules-effective-subheader-height\",\n `${height}px`\n );\n };\n\n updateHeaderHeight();\n\n window.addEventListener(\"resize\", updateHeaderHeight);\n\n return () => window.removeEventListener(\"resize\", updateHeaderHeight);\n }, []);\n\n return (\n <div\n className={classnames([\"neeto-molecules-subheader\", className])}\n data-cy={dataCy}\n data-testid=\"subheader\"\n ref={subheaderRef}\n >\n <div\n className=\"neeto-molecules-subheader__left-wrapper\"\n data-cy=\"subheader-left-wrapper\"\n >\n {leftActionBlock && (\n <div\n className=\"neeto-molecules-subheader__left\"\n data-cy=\"subheader-left\"\n >\n {leftActionBlock}\n </div>\n )}\n </div>\n {rightActionBlock && (\n <div\n className=\"neeto-molecules-subheader__right\"\n data-cy=\"subheader-right\"\n >\n {rightActionBlock}\n </div>\n )}\n </div>\n );\n};\n\nSubHeader.RightBlock = RightBlock;\n\nSubHeader.propTypes = {\n /**\n * To specify external classnames as overrides to the `SubHeader`.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered in the left side of the `SubHeader` section.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `SubHeader` section.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default SubHeader;\n"],"names":["Columns","forwardRef","_ref","ref","_ref$buttonProps","buttonProps","columnData","localStorageKey","fixedColumns","props","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","columnDataIndex","useMemo","pluck","filter","column","includes","dataIndex","_useHiddenColumns","useHiddenColumns","hideColumn","showColumn","_jsx","className","children","ManageColumns","_objectSpread","isSearchable","actionBlock","_jsxs","Button","label","style","onClick","icon","Column","tooltipProps","content","position","displayName","DownloadButton","withT","count","_ref$dataCy","dataCy","Download","FilterButton","NeetoFilters","Filter","RightBlock","downloadButtonProps","columnsButtonProps","filterProps","dataProps","showIcons","isNotPresent","totalCount","classnames","hidden","not","SubHeader","_ref$className","leftActionBlock","rightActionBlock","subheaderRef","useRef","useLayoutEffect","updateHeaderHeight","current","height","offsetHeight","document","body","setProperty","concat","window","addEventListener","removeEventListener"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,OAAO,gBAAGC,UAAU,CACxB,UAAAC,IAAA,EAEEC,GAAG,EACA;AAAA,EAAA,IAAAC,gBAAA,GAAAF,IAAA,CAFDG,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAA,KAAA,CAAA,GAAG,EAAE,GAAAA,gBAAA;IAAEE,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IAAEC,eAAe,GAAAL,IAAA,CAAfK,eAAe;IAAEC,YAAY,GAAAN,IAAA,CAAZM,YAAY;AAAKC,IAAAA,KAAK,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,WAAA,CAAA,CAAA;AAGvE,EAAA,IAAAC,eAAA,GAAcC,cAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC,CAAA;EAET,IAAMC,eAAe,GAAGC,OAAO,CAC7B,YAAA;AAAA,IAAA,OACEC,KAAK,CACH,WAAW,EACX,CAACX,UAAU,IAAI,EAAE,EAAEY,MAAM,CACvB,UAAAC,MAAM,EAAA;AAAA,MAAA,OAAI,EAACX,YAAY,KAAZA,IAAAA,IAAAA,YAAY,KAAZA,KAAAA,CAAAA,IAAAA,YAAY,CAAEY,QAAQ,CAACD,MAAM,CAACE,SAAS,CAAC,CAAA,CAAA;AAAA,KACrD,CACF,CAAC,CAAA;AAAA,GAAA,EACH,CAACf,UAAU,EAAEE,YAAY,CAC3B,CAAC,CAAA;AAED,EAAA,IAAAc,iBAAA,GAAmCC,gBAAgB,CAAChB,eAAe,CAAC;IAA5DiB,UAAU,GAAAF,iBAAA,CAAVE,UAAU;IAAEC,UAAU,GAAAH,iBAAA,CAAVG,UAAU,CAAA;AAE9B,EAAA,oBACEC,GAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,oCAAoC;AAAAC,IAAAA,QAAA,eACjDF,GA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,CAAC,CAAA;KACF,CAAA;AAEDF,IAAAA,kBAAkB,EAAE,CAAA;AAEpBQ,IAAAA,MAAM,CAACC,gBAAgB,CAAC,QAAQ,EAAET,kBAAkB,CAAC,CAAA;IAErD,OAAO,YAAA;AAAA,MAAA,OAAMQ,MAAM,CAACE,mBAAmB,CAAC,QAAQ,EAAEV,kBAAkB,CAAC,CAAA;AAAA,KAAA,CAAA;GACtE,EAAE,EAAE,CAAC,CAAA;AAEN,EAAA,oBACEtC,IAAA,CAAA,KAAA,EAAA;IACEN,SAAS,EAAEkC,UAAU,CAAC,CAAC,2BAA2B,EAAElC,SAAS,CAAC,CAAE;AAChE,IAAA,SAAA,EAASqB,MAAO;AAChB,IAAA,aAAA,EAAY,WAAW;AACvB7C,IAAAA,GAAG,EAAEiE,YAAa;AAAAxC,IAAAA,QAAA,gBAElBF,GAAA,CAAA,KAAA,EAAA;AACEC,MAAAA,SAAS,EAAC,yCAAyC;AACnD,MAAA,SAAA,EAAQ,wBAAwB;MAAAC,QAAA,EAE/BsC,eAAe,iBACdxC,GAAA,CAAA,KAAA,EAAA;AACEC,QAAAA,SAAS,EAAC,iCAAiC;AAC3C,QAAA,SAAA,EAAQ,gBAAgB;AAAAC,QAAAA,QAAA,EAEvBsC,eAAAA;OACE,CAAA;AACN,KACE,CAAC,EACLC,gBAAgB,iBACfzC,GAAA,CAAA,KAAA,EAAA;AACEC,MAAAA,SAAS,EAAC,kCAAkC;AAC5C,MAAA,SAAA,EAAQ,iBAAiB;AAAAC,MAAAA,QAAA,EAExBuC,gBAAAA;AAAgB,KACd,CACN,CAAA;AAAA,GACE,CAAC,CAAA;AAEV,EAAC;AAEDH,SAAS,CAACX,UAAU,GAAGA,UAAU;;;;"}
|
package/dist/SuffixedInput.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
-
import
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
5
4
|
import { isPresent, isNotPresent } from '@bigbinary/neeto-cist';
|
|
6
5
|
import Info from '@bigbinary/neeto-icons/Info';
|
|
7
6
|
import Input from '@bigbinary/neetoui/formik/Input';
|
|
8
7
|
import { isEmpty } from 'ramda';
|
|
9
8
|
import CopyToClipboardButton from './CopyToClipboardButton.js';
|
|
10
9
|
import { n } from './inject-css-c86de496.js';
|
|
10
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
11
11
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
12
12
|
import 'classnames';
|
|
13
13
|
import '@bigbinary/neeto-commons-frontend/utils/general';
|
|
@@ -54,53 +54,58 @@ var SuffixedInput = function SuffixedInput(_ref) {
|
|
|
54
54
|
var placeholderSpanWidth = (_placeholderRef$curre = placeholderRef.current) === null || _placeholderRef$curre === void 0 ? void 0 : _placeholderRef$curre.offsetWidth;
|
|
55
55
|
setInitialInputWidth(placeholderSpanWidth);
|
|
56
56
|
}, []);
|
|
57
|
-
return /*#__PURE__*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
57
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
58
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
59
|
+
// Dummy element to calculate the width to be set for the input. Do not remove.
|
|
60
|
+
className: "pointer-events-none invisible absolute pl-2",
|
|
61
|
+
ref: placeholderRef,
|
|
62
|
+
children: value || placeholder
|
|
63
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
64
|
+
className: "inline-flex max-w-full items-end gap-2",
|
|
65
|
+
children: [/*#__PURE__*/jsx(Input, _objectSpread(_objectSpread({}, _objectSpread({
|
|
66
|
+
label: label,
|
|
67
|
+
name: name,
|
|
68
|
+
placeholder: placeholder
|
|
69
|
+
}, inputProps)), {}, {
|
|
70
|
+
className: "nm-suffixed-input-field",
|
|
71
|
+
ref: setInputRef,
|
|
72
|
+
type: "text",
|
|
73
|
+
labelProps: {
|
|
74
|
+
helpIconProps: isPresent(helpUrl) && {
|
|
75
|
+
icon: Info,
|
|
76
|
+
className: "cursor-pointer opacity-75 hover:opacity-100 transition-opacity duration-300 ease-in-out",
|
|
77
|
+
onClick: function onClick() {
|
|
78
|
+
return window.open(helpUrl, "_blank");
|
|
79
|
+
},
|
|
80
|
+
tooltipProps: {
|
|
81
|
+
content: helpIconTooltipContent,
|
|
82
|
+
position: "right",
|
|
83
|
+
disabled: isNotPresent(helpUrl)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
style: {
|
|
88
|
+
minWidth: isEmpty(value) ? INPUT_FIELD_MIN_WIDTH : 0,
|
|
89
|
+
width: (_placeholderRef$curre2 = (_placeholderRef$curre3 = placeholderRef.current) === null || _placeholderRef$curre3 === void 0 ? void 0 : _placeholderRef$curre3.offsetWidth) !== null && _placeholderRef$curre2 !== void 0 ? _placeholderRef$curre2 : initialInputWidth // Additional 2px to act as a buffer.
|
|
77
90
|
},
|
|
78
|
-
tooltipProps: {
|
|
79
|
-
content: helpIconTooltipContent,
|
|
80
|
-
position: "right",
|
|
81
|
-
disabled: isNotPresent(helpUrl)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
style: {
|
|
86
|
-
minWidth: isEmpty(value) ? INPUT_FIELD_MIN_WIDTH : 0,
|
|
87
|
-
width: (_placeholderRef$curre2 = (_placeholderRef$curre3 = placeholderRef.current) === null || _placeholderRef$curre3 === void 0 ? void 0 : _placeholderRef$curre3.offsetWidth) !== null && _placeholderRef$curre2 !== void 0 ? _placeholderRef$curre2 : initialInputWidth // Additional 2px to act as a buffer.
|
|
88
|
-
},
|
|
89
91
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
92
|
+
suffix:
|
|
93
|
+
/*#__PURE__*/
|
|
94
|
+
// Added onClick to focus the input even when the suffix part is clicked.
|
|
95
|
+
jsx("span", {
|
|
96
|
+
onClick: function onClick() {
|
|
97
|
+
var _inputRef$current;
|
|
98
|
+
return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
99
|
+
},
|
|
100
|
+
children: suffix
|
|
101
|
+
})
|
|
102
|
+
})), isCopyToClipboardEnabled && /*#__PURE__*/jsx(CopyToClipboardButton, {
|
|
103
|
+
disabled: isEmpty(value),
|
|
104
|
+
style: "text",
|
|
105
|
+
value: "".concat(value).concat(suffix)
|
|
106
|
+
})]
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
104
109
|
};
|
|
105
110
|
|
|
106
111
|
export { SuffixedInput as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuffixedInput.js","sources":["../src/components/SuffixedInput/constants.js","../src/components/SuffixedInput/index.jsx"],"sourcesContent":["export const INPUT_FIELD_MIN_WIDTH = 60;\n","import
|
|
1
|
+
{"version":3,"file":"SuffixedInput.js","sources":["../src/components/SuffixedInput/constants.js","../src/components/SuffixedInput/index.jsx"],"sourcesContent":["export const INPUT_FIELD_MIN_WIDTH = 60;\n","import { useEffect, useRef, useState } from \"react\";\n\nimport { isPresent, isNotPresent } from \"neetocist\";\nimport { Info } from \"neetoicons\";\nimport { Input } from \"neetoui/formik\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport CopyToClipboardButton from \"components/CopyToClipboardButton\";\n\nimport { INPUT_FIELD_MIN_WIDTH } from \"./constants\";\nimport \"./suffixed-input.scss\";\n\nconst SuffixedInput = ({\n placeholder,\n helpUrl,\n helpIconTooltipContent,\n label,\n value,\n getInputRef,\n suffix,\n isCopyToClipboardEnabled = false,\n name = \"email\",\n inputProps = {},\n}) => {\n const [initialInputWidth, setInitialInputWidth] = useState(\n INPUT_FIELD_MIN_WIDTH\n );\n const inputRef = useRef(null);\n const placeholderRef = useRef(null);\n\n const setInputRef = ref => {\n inputRef.current = ref;\n getInputRef?.(ref);\n };\n\n useEffect(() => {\n //To handle the input width on initial render.\n const placeholderSpanWidth = placeholderRef.current?.offsetWidth;\n setInitialInputWidth(placeholderSpanWidth);\n }, []);\n\n return (\n <>\n <span // Dummy element to calculate the width to be set for the input. Do not remove.\n className=\"pointer-events-none invisible absolute pl-2\"\n ref={placeholderRef}\n >\n {value || placeholder}\n </span>\n <div className=\"inline-flex max-w-full items-end gap-2\">\n <Input\n {...{ label, name, placeholder, ...inputProps }}\n className=\"nm-suffixed-input-field\"\n ref={setInputRef}\n type=\"text\"\n labelProps={{\n helpIconProps: isPresent(helpUrl) && {\n icon: Info,\n className:\n \"cursor-pointer opacity-75 hover:opacity-100 transition-opacity duration-300 ease-in-out\",\n onClick: () => window.open(helpUrl, \"_blank\"),\n tooltipProps: {\n content: helpIconTooltipContent,\n position: \"right\",\n disabled: isNotPresent(helpUrl),\n },\n },\n }}\n style={{\n minWidth: isEmpty(value) ? INPUT_FIELD_MIN_WIDTH : 0,\n width: placeholderRef.current?.offsetWidth ?? initialInputWidth, // Additional 2px to act as a buffer.\n }}\n suffix={\n // Added onClick to focus the input even when the suffix part is clicked.\n <span onClick={() => inputRef.current?.focus()}>{suffix}</span>\n }\n />\n {isCopyToClipboardEnabled && (\n <CopyToClipboardButton\n disabled={isEmpty(value)}\n style=\"text\"\n value={`${value}${suffix}`}\n />\n )}\n </div>\n </>\n );\n};\n\nSuffixedInput.propTypes = {\n /**\n * Placeholder of the input field.\n */\n placeholder: PropTypes.string,\n /**\n * A help icon will be displayed next to the label if helpUrl is present. On clicking the icon will take the user to the URL.\n */\n helpUrl: PropTypes.string,\n /**\n * Text to be displayed inside the tooltip of the help icon.\n */\n helpIconTooltipContent: PropTypes.string,\n /**\n * Label of the input field.\n */\n label: PropTypes.string,\n /**\n * The value entered by the user, eg: email.\n */\n value: PropTypes.string,\n /**\n * A method to get the ref of the input field.\n */\n getInputRef: PropTypes.func,\n /**\n * Domain name to be rendered next to the input field.\n */\n suffix: PropTypes.string,\n /**\n * Whether to show the copy to clipboard button.\n */\n isCopyToClipboardEnabled: PropTypes.bool,\n /**\n * Formik field name of the input field.\n */\n name: PropTypes.string,\n /**\n * This will be passed down to the `Input` component.\n */\n inputProps: PropTypes.object,\n};\n\nexport default SuffixedInput;\n"],"names":["INPUT_FIELD_MIN_WIDTH","SuffixedInput","_ref","_placeholderRef$curre2","_placeholderRef$curre3","placeholder","helpUrl","helpIconTooltipContent","label","value","getInputRef","suffix","_ref$isCopyToClipboar","isCopyToClipboardEnabled","_ref$name","name","_ref$inputProps","inputProps","_useState","useState","_useState2","_slicedToArray","initialInputWidth","setInitialInputWidth","inputRef","useRef","placeholderRef","setInputRef","ref","current","useEffect","_placeholderRef$curre","placeholderSpanWidth","offsetWidth","_jsxs","_Fragment","children","_jsx","className","Input","_objectSpread","type","labelProps","helpIconProps","isPresent","icon","Info","onClick","window","open","tooltipProps","content","position","disabled","isNotPresent","style","minWidth","isEmpty","width","_inputRef$current","focus","CopyToClipboardButton","concat"],"mappings":";;;;;;;;;;;;;;;;;;AAAO,IAAMA,qBAAqB,GAAG,EAAE;;;;;;;ACavC,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAWb;EAAA,IAAAC,sBAAA,EAAAC,sBAAA,CAAA;AAAA,EAAA,IAVJC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACPC,sBAAsB,GAAAL,IAAA,C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OAAO;cACjBC,QAAQ,EAAEC,YAAY,CAAChD,OAAO,CAAA;AAChC,aAAA;AACF,WAAA;SACA;AACFiD,QAAAA,KAAK,EAAE;UACLC,QAAQ,EAAEC,OAAO,CAAChD,KAAK,CAAC,GAAGT,qBAAqB,GAAG,CAAC;UACpD0D,KAAK,EAAA,CAAAvD,sBAAA,GAAAC,CAAAA,sBAAA,GAAEsB,cAAc,CAACG,OAAO,MAAAzB,IAAAA,IAAAA,sBAAA,uBAAtBA,sBAAA,CAAwB6B,WAAW,MAAA9B,IAAAA,IAAAA,sBAAA,cAAAA,sBAAA,GAAImB,iBAAiB;SAC/D;;QACFX,MAAM;AAAA;AACJ;QACA0B,GAAA,CAAA,MAAA,EAAA;UAAMU,OAAO,EAAE,SAAAA,OAAA,GAAA;AAAA,YAAA,IAAAY,iBAAA,CAAA;AAAA,YAAA,OAAA,CAAAA,iBAAA,GAAMnC,QAAQ,CAACK,OAAO,MAAA,IAAA,IAAA8B,iBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAhBA,iBAAA,CAAkBC,KAAK,EAAE,CAAA;WAAC;AAAAxB,UAAAA,QAAA,EAAEzB,MAAAA;SAAa,CAAA;AAC/D,OAAA,CACF,CAAC,EACDE,wBAAwB,iBACvBwB,GAAA,CAACwB,qBAAqB,EAAA;AACpBR,QAAAA,QAAQ,EAAEI,OAAO,CAAChD,KAAK,CAAE;AACzB8C,QAAAA,KAAK,EAAC,MAAM;AACZ9C,QAAAA,KAAK,KAAAqD,MAAA,CAAKrD,KAAK,CAAAqD,CAAAA,MAAA,CAAGnD,MAAM,CAAA;AAAG,OAC5B,CACF,CAAA;AAAA,KACE,CAAC,CAAA;AAAA,GACN,CAAC,CAAA;AAEP;;;;"}
|
package/dist/TableWrapper.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
1
|
import classnames from 'classnames';
|
|
3
2
|
import { n } from './inject-css-c86de496.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
var css = ".neeto-molecules-tablewrapper-pagination--height{padding:0 0 48px}";
|
|
6
6
|
n(css,{});
|
|
@@ -11,14 +11,16 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
11
11
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
12
12
|
_ref$hasPagination = _ref.hasPagination,
|
|
13
13
|
hasPagination = _ref$hasPagination === void 0 ? false : _ref$hasPagination;
|
|
14
|
-
return /*#__PURE__*/
|
|
14
|
+
return /*#__PURE__*/jsx("div", {
|
|
15
15
|
"data-testid": "table-wrapper",
|
|
16
|
-
className: classnames("flex min-h-0 w-full flex-grow flex-col pb-6", className)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
className: classnames("flex min-h-0 w-full flex-grow flex-col pb-6", className),
|
|
17
|
+
children: /*#__PURE__*/jsx("div", {
|
|
18
|
+
className: classnames("min-h-0 flex-grow", {
|
|
19
|
+
"neeto-molecules-tablewrapper-pagination--height": hasPagination
|
|
20
|
+
}),
|
|
21
|
+
children: children
|
|
20
22
|
})
|
|
21
|
-
}
|
|
23
|
+
});
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
export { TableWrapper as default };
|
package/dist/TableWrapper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableWrapper.js","sources":["../src/components/TableWrapper/index.jsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"TableWrapper.js","sources":["../src/components/TableWrapper/index.jsx"],"sourcesContent":["import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport \"./table-wrapper.scss\";\n\nconst TableWrapper = ({ children, className = \"\", hasPagination = false }) => (\n <div\n data-testid=\"table-wrapper\"\n className={classNames(\n \"flex min-h-0 w-full flex-grow flex-col pb-6\",\n className\n )}\n >\n <div\n className={classNames(\"min-h-0 flex-grow\", {\n \"neeto-molecules-tablewrapper-pagination--height\": hasPagination,\n })}\n >\n {children}\n </div>\n </div>\n);\n\nTableWrapper.propTypes = {\n /**\n * Custom classnames for table wrapper.\n */\n className: PropTypes.string,\n /**\n * Handles table wrapper height when pagination is enabled.\n *\n * `hasPagination={totalCount > defaultPageSize}`\n */\n hasPagination: PropTypes.bool,\n};\n\nexport default TableWrapper;\n"],"names":["TableWrapper","_ref","children","_ref$className","className","_ref$hasPagination","hasPagination","_jsx","classNames"],"mappings":";;;;;;;AAKA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,cAAA,GAAAF,IAAA,CAAEG,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA;IAAAE,kBAAA,GAAAJ,IAAA,CAAEK,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,kBAAA,CAAA;AAAA,EAAA,oBACrEE,GAAA,CAAA,KAAA,EAAA;AACE,IAAA,aAAA,EAAY,eAAe;AAC3BH,IAAAA,SAAS,EAAEI,UAAU,CACnB,6CAA6C,EAC7CJ,SACF,CAAE;AAAAF,IAAAA,QAAA,eAEFK,GAAA,CAAA,KAAA,EAAA;AACEH,MAAAA,SAAS,EAAEI,UAAU,CAAC,mBAAmB,EAAE;AACzC,QAAA,iDAAiD,EAAEF,aAAAA;AACrD,OAAC,CAAE;AAAAJ,MAAAA,QAAA,EAEFA,QAAAA;KACE,CAAA;AAAC,GACH,CAAC,CAAA;AAAA;;;;"}
|