@bigbinary/neeto-molecules 1.1.78 → 1.2.0-beta2
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/README.md +67 -52
- package/dist/Breadcrumbs.js +16 -19
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/BrowserSupport.js +41 -138
- package/dist/BrowserSupport.js.map +1 -1
- package/dist/Builder.js +207 -364
- package/dist/Builder.js.map +1 -1
- package/dist/CalendarView.js +40 -288
- package/dist/CalendarView.js.map +1 -1
- package/dist/Chevron-c639aa31.js +190 -0
- package/dist/Chevron-c639aa31.js.map +1 -0
- package/dist/Codeblock.js +26 -209
- package/dist/Codeblock.js.map +1 -1
- package/dist/Columns.js +16 -240
- package/dist/Columns.js.map +1 -1
- package/dist/ConfigurePageSidebar.js +97 -0
- package/dist/ConfigurePageSidebar.js.map +1 -0
- package/dist/ConfirmationModal.js +10 -10
- package/dist/ConfirmationModal.js.map +1 -1
- package/dist/Container.js +5 -1187
- package/dist/Container.js.map +1 -1
- package/dist/CopyToClipboardButton.js +26 -155
- package/dist/CopyToClipboardButton.js.map +1 -1
- package/dist/Currency.js +912 -0
- package/dist/Currency.js.map +1 -0
- package/dist/CustomDomain.js +37 -633
- package/dist/CustomDomain.js.map +1 -1
- package/dist/CustomDomainDashboard.js +69 -2192
- package/dist/CustomDomainDashboard.js.map +1 -1
- package/dist/DateFormat.js +6 -20
- package/dist/DateFormat.js.map +1 -1
- package/dist/DateRangeFilter.js +22 -77
- package/dist/DateRangeFilter.js.map +1 -1
- package/dist/DeleteArchiveModal.js +86 -0
- package/dist/DeleteArchiveModal.js.map +1 -0
- package/dist/DocumentEditor.js +43 -133
- package/dist/DocumentEditor.js.map +1 -1
- package/dist/DownloadMobileAppCallout.js +4 -4
- package/dist/DownloadMobileAppCallout.js.map +1 -1
- package/dist/DynamicVariables.js +12 -95
- package/dist/DynamicVariables.js.map +1 -1
- package/dist/EmailForm.js +79 -1741
- package/dist/EmailForm.js.map +1 -1
- package/dist/EmailPreview.js +32 -1213
- package/dist/EmailPreview.js.map +1 -1
- package/dist/EmojiPicker.js +106 -0
- package/dist/EmojiPicker.js.map +1 -0
- package/dist/EmojiReactions.js +69 -0
- package/dist/EmojiReactions.js.map +1 -0
- package/dist/ErrorPage.js +17 -26
- package/dist/ErrorPage.js.map +1 -1
- package/dist/FloatingActionMenu.js +646 -0
- package/dist/FloatingActionMenu.js.map +1 -0
- package/dist/Header.js +45 -117
- package/dist/Header.js.map +1 -1
- package/dist/HelpPopover.js +73 -0
- package/dist/HelpPopover.js.map +1 -0
- package/dist/IconPicker.js +36 -129
- package/dist/IconPicker.js.map +1 -1
- package/dist/ImageWithFallback.js +8 -144
- package/dist/ImageWithFallback.js.map +1 -1
- package/dist/InlineInput.js +25 -528
- package/dist/InlineInput.js.map +1 -1
- package/dist/Insights.js +305 -0
- package/dist/Insights.js.map +1 -0
- package/dist/IntegrationCard.js +42 -226
- package/dist/IntegrationCard.js.map +1 -1
- package/dist/IntegrationDisconnectAlert.js +6 -48
- package/dist/IntegrationDisconnectAlert.js.map +1 -1
- package/dist/IntegrationWalkthroughModal.js +10 -10
- package/dist/IntegrationWalkthroughModal.js.map +1 -1
- package/dist/IpRestriction.js +74 -221
- package/dist/IpRestriction.js.map +1 -1
- package/dist/KeyboardShortcuts.js +38 -128
- package/dist/KeyboardShortcuts.js.map +1 -1
- package/dist/LoginPage.js +44 -463
- package/dist/LoginPage.js.map +1 -1
- package/dist/MadeWith.js +32 -0
- package/dist/MadeWith.js.map +1 -0
- package/dist/MenuBar.js +34 -1295
- package/dist/MenuBar.js.map +1 -1
- package/dist/Metadata.js +65 -86
- package/dist/Metadata.js.map +1 -1
- package/dist/MoreDropdown.js +48 -107
- package/dist/MoreDropdown.js.map +1 -1
- package/dist/NavigationHeader.js +62 -733
- package/dist/NavigationHeader.js.map +1 -1
- package/dist/NeetoWidget.js +148 -316
- package/dist/NeetoWidget.js.map +1 -1
- package/dist/Onboarding.js +204 -0
- package/dist/Onboarding.js.map +1 -0
- package/dist/OptionFields.js +507 -0
- package/dist/OptionFields.js.map +1 -0
- package/dist/PageLoader.js +9 -112
- package/dist/PageLoader.js.map +1 -1
- package/dist/PhoneNumber.js +122 -201
- package/dist/PhoneNumber.js.map +1 -1
- package/dist/ProductEmbed.js +767 -0
- package/dist/ProductEmbed.js.map +1 -0
- package/dist/PublishBlock.js +19 -60
- package/dist/PublishBlock.js.map +1 -1
- package/dist/PublishYourItem.js +52 -0
- package/dist/PublishYourItem.js.map +1 -0
- package/dist/Rename.js +127 -394
- package/dist/Rename.js.map +1 -1
- package/dist/ResponsiveDevicePicker.js +8 -144
- package/dist/ResponsiveDevicePicker.js.map +1 -1
- package/dist/Schedule.js +134 -389
- package/dist/Schedule.js.map +1 -1
- package/dist/Scrollable.js +6 -89
- package/dist/Scrollable.js.map +1 -1
- package/dist/Search.js +54 -157
- package/dist/Search.js.map +1 -1
- package/dist/Security.js +72 -1567
- package/dist/Security.js.map +1 -1
- package/dist/SendToFields.js +51 -133
- package/dist/SendToFields.js.map +1 -1
- package/dist/Settings.js +141 -412
- package/dist/Settings.js.map +1 -1
- package/dist/ShareRecordingPane.js +189 -0
- package/dist/ShareRecordingPane.js.map +1 -0
- package/dist/ShareViaEmail.js +126 -551
- package/dist/ShareViaEmail.js.map +1 -1
- package/dist/ShareViaLink.js +127 -345
- package/dist/ShareViaLink.js.map +1 -1
- package/dist/Sidebar.js +161 -758
- package/dist/Sidebar.js.map +1 -1
- package/dist/StickyRibbonsContainer.js +81 -0
- package/dist/StickyRibbonsContainer.js.map +1 -0
- package/dist/SubHeader.js +63 -108
- package/dist/SubHeader.js.map +1 -1
- package/dist/SuffixedInput.js +105 -0
- package/dist/SuffixedInput.js.map +1 -0
- package/dist/TableWrapper.js +8 -9
- package/dist/TableWrapper.js.map +1 -1
- package/dist/Taxonomy.js +112 -1774
- package/dist/Taxonomy.js.map +1 -1
- package/dist/ThemeSidebar.js +168 -784
- package/dist/ThemeSidebar.js.map +1 -1
- package/dist/TimeFormat.js +8 -44
- package/dist/TimeFormat.js.map +1 -1
- package/dist/TimezoneMismatchModal.js +49 -84
- package/dist/TimezoneMismatchModal.js.map +1 -1
- package/dist/ToggleFeatureCard.js +46 -169
- package/dist/ToggleFeatureCard.js.map +1 -1
- package/dist/cjs/Breadcrumbs.js +49 -0
- package/dist/cjs/Breadcrumbs.js.map +1 -0
- package/dist/cjs/BrowserSupport.js +332 -0
- package/dist/cjs/BrowserSupport.js.map +1 -0
- package/dist/cjs/Builder.js +560 -0
- package/dist/cjs/Builder.js.map +1 -0
- package/dist/cjs/CalendarView.js +303 -0
- package/dist/cjs/CalendarView.js.map +1 -0
- package/dist/cjs/Chevron-5fe59f57.js +206 -0
- package/dist/cjs/Chevron-5fe59f57.js.map +1 -0
- package/dist/cjs/Codeblock.js +59 -0
- package/dist/cjs/Codeblock.js.map +1 -0
- package/dist/cjs/Columns.js +31 -0
- package/dist/cjs/Columns.js.map +1 -0
- package/dist/cjs/ConfigurePageSidebar.js +105 -0
- package/dist/cjs/ConfigurePageSidebar.js.map +1 -0
- package/dist/cjs/ConfirmationModal.js +120 -0
- package/dist/cjs/ConfirmationModal.js.map +1 -0
- package/dist/cjs/Container.js +36 -0
- package/dist/cjs/Container.js.map +1 -0
- package/dist/cjs/CopyToClipboardButton.js +90 -0
- package/dist/cjs/CopyToClipboardButton.js.map +1 -0
- package/dist/cjs/Currency.js +923 -0
- package/dist/cjs/Currency.js.map +1 -0
- package/dist/cjs/CustomDomain.js +126 -0
- package/dist/cjs/CustomDomain.js.map +1 -0
- package/dist/cjs/CustomDomainDashboard.js +202 -0
- package/dist/cjs/CustomDomainDashboard.js.map +1 -0
- package/dist/cjs/DateFormat.js +41 -0
- package/dist/cjs/DateFormat.js.map +1 -0
- package/dist/cjs/DateRangeFilter.js +183 -0
- package/dist/cjs/DateRangeFilter.js.map +1 -0
- package/dist/cjs/DeleteArchiveModal.js +93 -0
- package/dist/cjs/DeleteArchiveModal.js.map +1 -0
- package/dist/cjs/DocumentEditor.js +197 -0
- package/dist/cjs/DocumentEditor.js.map +1 -0
- package/dist/cjs/DownloadMobileAppCallout.js +45 -0
- package/dist/cjs/DownloadMobileAppCallout.js.map +1 -0
- package/dist/cjs/DynamicVariables.js +109 -0
- package/dist/cjs/DynamicVariables.js.map +1 -0
- package/dist/cjs/EmailForm.js +397 -0
- package/dist/cjs/EmailForm.js.map +1 -0
- package/dist/cjs/EmailPreview.js +139 -0
- package/dist/cjs/EmailPreview.js.map +1 -0
- package/dist/cjs/EmojiPicker.js +115 -0
- package/dist/cjs/EmojiPicker.js.map +1 -0
- package/dist/cjs/EmojiReactions.js +77 -0
- package/dist/cjs/EmojiReactions.js.map +1 -0
- package/dist/cjs/ErrorPage.js +180 -0
- package/dist/cjs/ErrorPage.js.map +1 -0
- package/dist/cjs/FloatingActionMenu.js +680 -0
- package/dist/cjs/FloatingActionMenu.js.map +1 -0
- package/dist/cjs/Header.js +107 -0
- package/dist/cjs/Header.js.map +1 -0
- package/dist/cjs/HelpPopover.js +82 -0
- package/dist/cjs/HelpPopover.js.map +1 -0
- package/dist/cjs/IconPicker.js +231 -0
- package/dist/cjs/IconPicker.js.map +1 -0
- package/dist/cjs/ImageWithFallback.js +56 -0
- package/dist/cjs/ImageWithFallback.js.map +1 -0
- package/dist/cjs/InlineInput.js +240 -0
- package/dist/cjs/InlineInput.js.map +1 -0
- package/dist/cjs/Insights.js +311 -0
- package/dist/cjs/Insights.js.map +1 -0
- package/dist/cjs/IntegrationCard.js +210 -0
- package/dist/cjs/IntegrationCard.js.map +1 -0
- package/dist/cjs/IntegrationDisconnectAlert.js +50 -0
- package/dist/cjs/IntegrationDisconnectAlert.js.map +1 -0
- package/dist/cjs/IntegrationWalkthroughModal.js +51 -0
- package/dist/cjs/IntegrationWalkthroughModal.js.map +1 -0
- package/dist/cjs/IpRestriction.js +527 -0
- package/dist/cjs/IpRestriction.js.map +1 -0
- package/dist/cjs/KeyboardShortcuts.js +284 -0
- package/dist/cjs/KeyboardShortcuts.js.map +1 -0
- package/dist/cjs/LoginPage.js +202 -0
- package/dist/cjs/LoginPage.js.map +1 -0
- package/dist/cjs/MadeWith.js +40 -0
- package/dist/cjs/MadeWith.js.map +1 -0
- package/dist/cjs/MenuBar.js +211 -0
- package/dist/cjs/MenuBar.js.map +1 -0
- package/dist/cjs/Metadata.js +196 -0
- package/dist/cjs/Metadata.js.map +1 -0
- package/dist/cjs/MoreDropdown.js +155 -0
- package/dist/cjs/MoreDropdown.js.map +1 -0
- package/dist/cjs/NavigationHeader.js +187 -0
- package/dist/cjs/NavigationHeader.js.map +1 -0
- package/dist/cjs/NeetoWidget.js +915 -0
- package/dist/cjs/NeetoWidget.js.map +1 -0
- package/dist/cjs/Onboarding.js +216 -0
- package/dist/cjs/Onboarding.js.map +1 -0
- package/dist/cjs/OptionFields.js +518 -0
- package/dist/cjs/OptionFields.js.map +1 -0
- package/dist/cjs/PageLoader.js +40 -0
- package/dist/cjs/PageLoader.js.map +1 -0
- package/dist/cjs/PhoneNumber.js +367 -0
- package/dist/cjs/PhoneNumber.js.map +1 -0
- package/dist/cjs/ProductEmbed.js +777 -0
- package/dist/cjs/ProductEmbed.js.map +1 -0
- package/dist/cjs/PublishBlock.js +127 -0
- package/dist/cjs/PublishBlock.js.map +1 -0
- package/dist/cjs/PublishYourItem.js +59 -0
- package/dist/cjs/PublishYourItem.js.map +1 -0
- package/dist/cjs/Rename.js +354 -0
- package/dist/cjs/Rename.js.map +1 -0
- package/dist/cjs/ResponsiveDevicePicker.js +68 -0
- package/dist/cjs/ResponsiveDevicePicker.js.map +1 -0
- package/dist/cjs/Schedule.js +874 -0
- package/dist/cjs/Schedule.js.map +1 -0
- package/dist/cjs/Scrollable.js +49 -0
- package/dist/cjs/Scrollable.js.map +1 -0
- package/dist/cjs/Search.js +121 -0
- package/dist/cjs/Search.js.map +1 -0
- package/dist/cjs/Security.js +379 -0
- package/dist/cjs/Security.js.map +1 -0
- package/dist/cjs/SendToFields.js +275 -0
- package/dist/cjs/SendToFields.js.map +1 -0
- package/dist/cjs/Settings.js +217 -0
- package/dist/cjs/Settings.js.map +1 -0
- package/dist/cjs/ShareRecordingPane.js +199 -0
- package/dist/cjs/ShareRecordingPane.js.map +1 -0
- package/dist/cjs/ShareViaEmail.js +353 -0
- package/dist/cjs/ShareViaEmail.js.map +1 -0
- package/dist/cjs/ShareViaLink.js +508 -0
- package/dist/cjs/ShareViaLink.js.map +1 -0
- package/dist/cjs/Sidebar.js +292 -0
- package/dist/cjs/Sidebar.js.map +1 -0
- package/dist/cjs/StickyRibbonsContainer.js +90 -0
- package/dist/cjs/StickyRibbonsContainer.js.map +1 -0
- package/dist/cjs/SubHeader.js +181 -0
- package/dist/cjs/SubHeader.js.map +1 -0
- package/dist/cjs/SuffixedInput.js +114 -0
- package/dist/cjs/SuffixedInput.js.map +1 -0
- package/dist/cjs/TableWrapper.js +32 -0
- package/dist/cjs/TableWrapper.js.map +1 -0
- package/dist/cjs/Taxonomy.js +445 -0
- package/dist/cjs/Taxonomy.js.map +1 -0
- package/dist/cjs/ThemeSidebar.js +1443 -0
- package/dist/cjs/ThemeSidebar.js.map +1 -0
- package/dist/cjs/TimeFormat.js +15 -0
- package/dist/cjs/TimeFormat.js.map +1 -0
- package/dist/cjs/TimezoneMismatchModal.js +144 -0
- package/dist/cjs/TimezoneMismatchModal.js.map +1 -0
- package/dist/cjs/ToggleFeatureCard.js +213 -0
- package/dist/cjs/ToggleFeatureCard.js.map +1 -0
- package/dist/cjs/index-248c4f4c.js +1186 -0
- package/dist/cjs/index-248c4f4c.js.map +1 -0
- package/dist/cjs/index-7db1772e.js +544 -0
- package/dist/cjs/index-7db1772e.js.map +1 -0
- package/dist/cjs/inject-css-80a5faa3.js +6 -0
- package/dist/cjs/inject-css-80a5faa3.js.map +1 -0
- package/dist/cjs/useColumns-9978cf70.js +275 -0
- package/dist/cjs/useColumns-9978cf70.js.map +1 -0
- package/dist/index-7d311b7a.js +509 -0
- package/dist/index-7d311b7a.js.map +1 -0
- package/dist/index-e5588516.js +1184 -0
- package/dist/index-e5588516.js.map +1 -0
- package/dist/inject-css-c86de496.js +4 -0
- package/dist/inject-css-c86de496.js.map +1 -0
- package/dist/useColumns-751e9192.js +258 -0
- package/dist/useColumns-751e9192.js.map +1 -0
- package/package.json +30 -19
- package/src/translations/de.json +7 -0
- package/src/translations/en.json +191 -31
- package/src/translations/es.json +7 -0
- package/src/translations/fr.json +7 -0
- package/src/translations/nl.json +7 -0
- package/src/translations/pl.json +7 -0
- package/src/translations/pt.json +7 -0
- package/types/Breadcrumbs.d.ts +1 -0
- package/types/Builder.d.ts +61 -12
- package/types/Columns.d.ts +112 -5
- package/types/ConfigurePageSidebar.d.ts +43 -0
- package/types/CopyToClipboardButton.d.ts +3 -0
- package/types/Currency.d.ts +48 -0
- package/types/CustomDomain.d.ts +2 -0
- package/types/CustomDomainDashboard.d.ts +14 -0
- package/types/DateRangeFilter.d.ts +2 -0
- package/types/DeleteArchiveModal.d.ts +60 -0
- package/types/EmailForm.d.ts +1 -1
- package/types/EmojiPicker.d.ts +33 -0
- package/types/EmojiReactions.d.ts +60 -0
- package/types/ErrorPage.d.ts +1 -0
- package/types/FloatingActionMenu.d.ts +56 -0
- package/types/Header.d.ts +2 -1
- package/types/HelpPopover.d.ts +42 -0
- package/types/Insights.d.ts +108 -0
- package/types/IntegrationCard.d.ts +2 -0
- package/types/KeyboardShortcuts.d.ts +2 -2
- package/types/MadeWith.d.ts +16 -0
- package/types/MoreDropdown.d.ts +4 -1
- package/types/NavigationHeader.d.ts +3 -1
- package/types/Onboarding.d.ts +65 -0
- package/types/OptionFields.d.ts +63 -0
- package/types/PhoneNumber.d.ts +6 -2
- package/types/ProductEmbed.d.ts +87 -0
- package/types/Rename.d.ts +4 -1
- package/types/Schedule.d.ts +2 -0
- package/types/Search.d.ts +2 -0
- package/types/Settings.d.ts +13 -10
- package/types/ShareRecordingPane.d.ts +50 -0
- package/types/ShareViaLink.d.ts +15 -4
- package/types/Sidebar.d.ts +16 -32
- package/types/StickyRibbonsContainer.d.ts +26 -0
- package/types/SubHeader.d.ts +0 -1
- package/types/SuffixedInput.d.ts +43 -0
- package/types/ToggleFeatureCard.d.ts +8 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var classnames = require('classnames');
|
|
5
|
+
var neetoCist = require('@bigbinary/neeto-cist');
|
|
6
|
+
var ramda = require('ramda');
|
|
7
|
+
var _extends = require('@babel/runtime/helpers/extends');
|
|
8
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
9
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
10
|
+
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
11
|
+
var neetoui = require('@bigbinary/neetoui');
|
|
12
|
+
var reactI18next = require('react-i18next');
|
|
13
|
+
var useColumns = require('./useColumns-9978cf70.js');
|
|
14
|
+
var neetoFiltersFrontend = require('@bigbinary/neeto-filters-frontend');
|
|
15
|
+
var injectCss = require('./inject-css-80a5faa3.js');
|
|
16
|
+
require('@babel/runtime/helpers/slicedToArray');
|
|
17
|
+
require('i18next');
|
|
18
|
+
require('zustand');
|
|
19
|
+
require('zustand/middleware');
|
|
20
|
+
require('@bigbinary/neeto-commons-frontend/utils/general');
|
|
21
|
+
|
|
22
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
+
|
|
24
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
26
|
+
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
27
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
28
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
29
|
+
|
|
30
|
+
var _excluded$1 = ["buttonProps", "columnData", "localStorageKey", "fixedColumns"];
|
|
31
|
+
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; }
|
|
32
|
+
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__default["default"](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; }
|
|
33
|
+
var Columns = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
34
|
+
var _ref$buttonProps = _ref.buttonProps,
|
|
35
|
+
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
36
|
+
columnData = _ref.columnData,
|
|
37
|
+
localStorageKey = _ref.localStorageKey,
|
|
38
|
+
fixedColumns = _ref.fixedColumns,
|
|
39
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded$1);
|
|
40
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
41
|
+
t = _useTranslation.t;
|
|
42
|
+
var columnDataIndex = React.useMemo(function () {
|
|
43
|
+
return ramda.pluck("dataIndex", (columnData || []).filter(function (column) {
|
|
44
|
+
return !(fixedColumns !== null && fixedColumns !== void 0 && fixedColumns.includes(column.dataIndex));
|
|
45
|
+
}));
|
|
46
|
+
}, [columnData, fixedColumns]);
|
|
47
|
+
var _useHiddenColumns = useColumns.useHiddenColumns(localStorageKey),
|
|
48
|
+
hideColumn = _useHiddenColumns.hideColumn,
|
|
49
|
+
showColumn = _useHiddenColumns.showColumn;
|
|
50
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
51
|
+
className: "neeto-molecules-subheader__columns"
|
|
52
|
+
}, /*#__PURE__*/React__default["default"].createElement(useColumns.Columns, _extends__default["default"]({
|
|
53
|
+
isSearchable: true,
|
|
54
|
+
className: "neeto-ui-dropdown--manage-columns",
|
|
55
|
+
actionBlock: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
56
|
+
className: "grid grid-cols-2 gap-2 px-4 py-3"
|
|
57
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
58
|
+
className: "col-span-1 justify-center",
|
|
59
|
+
label: "Hide all",
|
|
60
|
+
style: "secondary",
|
|
61
|
+
onClick: function onClick() {
|
|
62
|
+
return hideColumn(columnDataIndex);
|
|
63
|
+
}
|
|
64
|
+
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
65
|
+
className: "col-span-1 justify-center",
|
|
66
|
+
label: "Show all",
|
|
67
|
+
style: "secondary",
|
|
68
|
+
onClick: function onClick() {
|
|
69
|
+
return showColumn(columnDataIndex);
|
|
70
|
+
}
|
|
71
|
+
})),
|
|
72
|
+
buttonProps: _objectSpread$1({
|
|
73
|
+
icon: neetoIcons.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$1(_objectSpread$1({
|
|
83
|
+
columnData: columnData,
|
|
84
|
+
localStorageKey: localStorageKey
|
|
85
|
+
}, props), {}, {
|
|
86
|
+
ref: ref
|
|
87
|
+
}))));
|
|
88
|
+
});
|
|
89
|
+
Columns.displayName = "Columns";
|
|
90
|
+
|
|
91
|
+
var DownloadButton = function DownloadButton(_ref) {
|
|
92
|
+
var count = _ref.count,
|
|
93
|
+
onClick = _ref.onClick,
|
|
94
|
+
_ref$dataCy = _ref["data-cy"],
|
|
95
|
+
dataCy = _ref$dataCy === void 0 ? "download-button" : _ref$dataCy;
|
|
96
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
97
|
+
t = _useTranslation.t;
|
|
98
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
99
|
+
className: "neeto-molecules-subheader__download"
|
|
100
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
101
|
+
"data-cy": dataCy,
|
|
102
|
+
"data-testid": "download-button",
|
|
103
|
+
icon: neetoIcons.Download,
|
|
104
|
+
style: "text",
|
|
105
|
+
tooltipProps: {
|
|
106
|
+
content: t("neetoMolecules.common.download"),
|
|
107
|
+
position: "bottom"
|
|
108
|
+
},
|
|
109
|
+
onClick: onClick
|
|
110
|
+
}), count && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
111
|
+
className: "neeto-molecules-subheader__download-count"
|
|
112
|
+
}, count));
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
var _excluded = ["buttonProps"];
|
|
116
|
+
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; }
|
|
117
|
+
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__default["default"](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; }
|
|
118
|
+
var FilterButton = function FilterButton(_ref) {
|
|
119
|
+
var buttonProps = _ref.buttonProps,
|
|
120
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
121
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
122
|
+
t = _useTranslation.t;
|
|
123
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
124
|
+
className: "neeto-molecules-subheader__filter"
|
|
125
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoFiltersFrontend.Filters, _extends__default["default"]({
|
|
126
|
+
buttonProps: _objectSpread({
|
|
127
|
+
"data-testid": "filter-button",
|
|
128
|
+
icon: neetoIcons.Filter,
|
|
129
|
+
style: "text",
|
|
130
|
+
tooltipProps: {
|
|
131
|
+
content: t("neetoMolecules.common.filter"),
|
|
132
|
+
position: "bottom"
|
|
133
|
+
},
|
|
134
|
+
label: null
|
|
135
|
+
}, buttonProps)
|
|
136
|
+
}, props)));
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
var RightBlock = function RightBlock(_ref) {
|
|
140
|
+
var downloadButtonProps = _ref.downloadButtonProps,
|
|
141
|
+
columnsButtonProps = _ref.columnsButtonProps,
|
|
142
|
+
filterProps = _ref.filterProps,
|
|
143
|
+
dataProps = _ref.dataProps;
|
|
144
|
+
var showIcons = neetoCist.isNotPresent(dataProps === null || dataProps === void 0 ? void 0 : dataProps.totalCount) ? true : (dataProps === null || dataProps === void 0 ? void 0 : dataProps.totalCount) > 0;
|
|
145
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
146
|
+
"data-testid": "subheader-rightblock-buttons-container",
|
|
147
|
+
className: classnames__default["default"]("neeto-molecules-subheader__right-actions", {
|
|
148
|
+
hidden: ramda.not(showIcons)
|
|
149
|
+
})
|
|
150
|
+
}, downloadButtonProps && /*#__PURE__*/React__default["default"].createElement(DownloadButton, downloadButtonProps), columnsButtonProps && /*#__PURE__*/React__default["default"].createElement(Columns, columnsButtonProps), filterProps && /*#__PURE__*/React__default["default"].createElement(FilterButton, filterProps));
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
var css = ":root{--neeto-molecules-sub-header-height:37px;--neeto-molecules-sub-header-bottom-margin:20px}.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);min-height:37px;min-height:var(--neeto-molecules-sub-header-height);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-300));padding-left:8px}.neeto-molecules-subheader__download{position:relative}.neeto-molecules-subheader__download-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-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-main-header-with-breadcrumbs-height) - 57px);max-height:calc(100vh - var(--neeto-molecules-main-header-with-breadcrumbs-height) - var(--neeto-molecules-sub-header-height) - var(--neeto-molecules-sub-header-bottom-margin));min-width:320px}";
|
|
154
|
+
injectCss.n(css,{});
|
|
155
|
+
|
|
156
|
+
var SubHeader = function SubHeader(_ref) {
|
|
157
|
+
var _ref$className = _ref.className,
|
|
158
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
159
|
+
leftActionBlock = _ref.leftActionBlock,
|
|
160
|
+
rightActionBlock = _ref.rightActionBlock,
|
|
161
|
+
_ref$dataCy = _ref["data-cy"],
|
|
162
|
+
dataCy = _ref$dataCy === void 0 ? "subheader" : _ref$dataCy;
|
|
163
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
164
|
+
className: classnames__default["default"](["neeto-molecules-subheader", className]),
|
|
165
|
+
"data-cy": dataCy,
|
|
166
|
+
"data-testid": "subheader"
|
|
167
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
168
|
+
className: "neeto-molecules-subheader__left-wrapper",
|
|
169
|
+
"data-cy": "subheader-left-wrapper"
|
|
170
|
+
}, leftActionBlock && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
171
|
+
className: "neeto-molecules-subheader__left",
|
|
172
|
+
"data-cy": "subheader-left"
|
|
173
|
+
}, leftActionBlock)), rightActionBlock && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
174
|
+
className: "neeto-molecules-subheader__right",
|
|
175
|
+
"data-cy": "subheader-right"
|
|
176
|
+
}, rightActionBlock));
|
|
177
|
+
};
|
|
178
|
+
SubHeader.RightBlock = RightBlock;
|
|
179
|
+
|
|
180
|
+
module.exports = SubHeader;
|
|
181
|
+
//# sourceMappingURL=SubHeader.js.map
|
|
@@ -0,0 +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 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 <div\n className={classnames([\"neeto-molecules-subheader\", className])}\n data-cy={dataCy}\n data-testid=\"subheader\"\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\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,OAAO,gBAAGC,gBAAU,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,4CAAA,CAAAR,IAAA,EAAAS,WAAA,CAAA,CAAA;AAGvE,EAAA,IAAAC,eAAA,GAAcC,2BAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC,CAAA;EAET,IAAMC,eAAe,GAAGC,aAAO,CAC7B,YAAA;AAAA,IAAA,OACEC,WAAK,CACH,WAAW,EACX,CAACX,UAAU,IAAI,EAAE,EAAEY,MAAM,CACvB,UAAAC,MAAM,EAAA;AAAA,MAAA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;AAAE6C,IAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,WAAW,GAAAA,WAAA,CAAA;EAAA,oBAE/BpB,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;IACEC,SAAS,EAAEgC,8BAAU,CAAC,CAAC,2BAA2B,EAAEhC,SAAS,CAAC,CAAE;AAChE,IAAA,SAAA,EAASmB,MAAO;IAChB,aAAY,EAAA,WAAA;GAEZrB,eAAAA,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,yCAAyC;IACnD,SAAQ,EAAA,wBAAA;AAAwB,GAAA,EAE/BqC,eAAe,iBACdvC,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,iCAAiC;IAC3C,SAAQ,EAAA,gBAAA;GAEPqC,EAAAA,eACE,CAEJ,CAAC,EACLC,gBAAgB,iBACfxC,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,kCAAkC;IAC5C,SAAQ,EAAA,iBAAA;GAEPsC,EAAAA,gBACE,CAEJ,CAAC,CAAA;AAAA,EACP;AAEDH,SAAS,CAACX,UAAU,GAAGA,UAAU;;;;"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _extends = require('@babel/runtime/helpers/extends');
|
|
4
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var neetoCist = require('@bigbinary/neeto-cist');
|
|
8
|
+
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
9
|
+
var formik = require('@bigbinary/neetoui/formik');
|
|
10
|
+
var ramda = require('ramda');
|
|
11
|
+
var CopyToClipboardButton = require('./CopyToClipboardButton.js');
|
|
12
|
+
var injectCss = require('./inject-css-80a5faa3.js');
|
|
13
|
+
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
14
|
+
require('classnames');
|
|
15
|
+
require('@bigbinary/neeto-commons-frontend/utils/general');
|
|
16
|
+
require('@bigbinary/neetoui');
|
|
17
|
+
require('react-i18next');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
+
|
|
21
|
+
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
22
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
23
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
24
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
+
|
|
26
|
+
var INPUT_FIELD_MIN_WIDTH = 60;
|
|
27
|
+
|
|
28
|
+
var css = ".nm-suffixed-input-field{max-width:100%;min-width:0;width:-moz-max-content;width:max-content}.nm-suffixed-input-field .neeto-ui-input{align-items:stretch}.nm-suffixed-input-field .neeto-ui-input .neeto-ui-input__suffix{background-color:rgb(var(--neeto-ui-gray-200));cursor:not-allowed;margin:0 0 0 4px!important;padding:5px 8px;white-space:nowrap}.nm-suffixed-input-field input{padding-right:0!important}";
|
|
29
|
+
injectCss.n(css,{});
|
|
30
|
+
|
|
31
|
+
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; }
|
|
32
|
+
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__default["default"](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; }
|
|
33
|
+
var SuffixedInput = function SuffixedInput(_ref) {
|
|
34
|
+
var _placeholderRef$curre2, _placeholderRef$curre3;
|
|
35
|
+
var placeholder = _ref.placeholder,
|
|
36
|
+
helpUrl = _ref.helpUrl,
|
|
37
|
+
helpIconTooltipContent = _ref.helpIconTooltipContent,
|
|
38
|
+
label = _ref.label,
|
|
39
|
+
value = _ref.value,
|
|
40
|
+
getInputRef = _ref.getInputRef,
|
|
41
|
+
suffix = _ref.suffix,
|
|
42
|
+
_ref$isCopyToClipboar = _ref.isCopyToClipboardEnabled,
|
|
43
|
+
isCopyToClipboardEnabled = _ref$isCopyToClipboar === void 0 ? false : _ref$isCopyToClipboar,
|
|
44
|
+
_ref$name = _ref.name,
|
|
45
|
+
name = _ref$name === void 0 ? "email" : _ref$name,
|
|
46
|
+
_ref$inputProps = _ref.inputProps,
|
|
47
|
+
inputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps;
|
|
48
|
+
var _useState = React.useState(INPUT_FIELD_MIN_WIDTH),
|
|
49
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
50
|
+
initialInputWidth = _useState2[0],
|
|
51
|
+
setInitialInputWidth = _useState2[1];
|
|
52
|
+
var inputRef = React.useRef(null);
|
|
53
|
+
var placeholderRef = React.useRef(null);
|
|
54
|
+
var setInputRef = function setInputRef(ref) {
|
|
55
|
+
inputRef.current = ref;
|
|
56
|
+
getInputRef === null || getInputRef === void 0 ? void 0 : getInputRef(ref);
|
|
57
|
+
};
|
|
58
|
+
React.useEffect(function () {
|
|
59
|
+
var _placeholderRef$curre;
|
|
60
|
+
//To handle the input width on initial render.
|
|
61
|
+
var placeholderSpanWidth = (_placeholderRef$curre = placeholderRef.current) === null || _placeholderRef$curre === void 0 ? void 0 : _placeholderRef$curre.offsetWidth;
|
|
62
|
+
setInitialInputWidth(placeholderSpanWidth);
|
|
63
|
+
}, []);
|
|
64
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
65
|
+
// Dummy element to calculate the width to be set for the input. Do not remove.
|
|
66
|
+
className: "pointer-events-none invisible absolute pl-2",
|
|
67
|
+
ref: placeholderRef
|
|
68
|
+
}, value || placeholder), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
69
|
+
className: "inline-flex max-w-full items-end gap-2"
|
|
70
|
+
}, /*#__PURE__*/React__default["default"].createElement(formik.Input, _extends__default["default"]({}, _objectSpread({
|
|
71
|
+
label: label,
|
|
72
|
+
name: name,
|
|
73
|
+
placeholder: placeholder
|
|
74
|
+
}, inputProps), {
|
|
75
|
+
className: "nm-suffixed-input-field",
|
|
76
|
+
ref: setInputRef,
|
|
77
|
+
type: "text",
|
|
78
|
+
labelProps: {
|
|
79
|
+
helpIconProps: neetoCist.isPresent(helpUrl) && {
|
|
80
|
+
icon: neetoIcons.Info,
|
|
81
|
+
className: "cursor-pointer opacity-75 hover:opacity-100 transition-opacity duration-300 ease-in-out",
|
|
82
|
+
onClick: function onClick() {
|
|
83
|
+
return window.open(helpUrl, "_blank");
|
|
84
|
+
},
|
|
85
|
+
tooltipProps: {
|
|
86
|
+
content: helpIconTooltipContent,
|
|
87
|
+
position: "right",
|
|
88
|
+
disabled: neetoCist.isNotPresent(helpUrl)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
style: {
|
|
93
|
+
minWidth: ramda.isEmpty(value) ? INPUT_FIELD_MIN_WIDTH : 0,
|
|
94
|
+
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.
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
suffix:
|
|
98
|
+
/*#__PURE__*/
|
|
99
|
+
// Added onClick to focus the input even when the suffix part is clicked.
|
|
100
|
+
React__default["default"].createElement("span", {
|
|
101
|
+
onClick: function onClick() {
|
|
102
|
+
var _inputRef$current;
|
|
103
|
+
return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
104
|
+
}
|
|
105
|
+
}, suffix)
|
|
106
|
+
})), isCopyToClipboardEnabled && /*#__PURE__*/React__default["default"].createElement(CopyToClipboardButton, {
|
|
107
|
+
disabled: ramda.isEmpty(value),
|
|
108
|
+
style: "text",
|
|
109
|
+
value: "".concat(value).concat(suffix)
|
|
110
|
+
})));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
module.exports = SuffixedInput;
|
|
114
|
+
//# sourceMappingURL=SuffixedInput.js.map
|
|
@@ -0,0 +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 React, { 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","React","createElement","Fragment","className","Input","_extends","_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,CAAtBK,sBAAsB;IACtBC,KAAK,GAAAN,IAAA,CAALM,KAAK;IACLC,KAAK,GAAAP,IAAA,CAALO,KAAK;IACLC,WAAW,GAAAR,IAAA,CAAXQ,WAAW;IACXC,MAAM,GAAAT,IAAA,CAANS,MAAM;IAAAC,qBAAA,GAAAV,IAAA,CACNW,wBAAwB;AAAxBA,IAAAA,wBAAwB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,qBAAA;IAAAE,SAAA,GAAAZ,IAAA,CAChCa,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,OAAO,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MAAM;AAAA;AACJ;AACAuB,IAAAA,yBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;MAAMY,OAAO,EAAE,SAAAA,OAAA,GAAA;AAAA,QAAA,IAAAY,iBAAA,CAAA;AAAA,QAAA,OAAA,CAAAA,iBAAA,GAAMnC,QAAQ,CAACK,OAAO,MAAA,IAAA,IAAA8B,iBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAhBA,iBAAA,CAAkBC,KAAK,EAAE,CAAA;AAAA,OAAA;AAAC,KAAA,EAAEjD,MAAa,CAAA;GAEjE,CAAA,CAAC,EACDE,wBAAwB,iBACvBqB,yBAAA,CAAAC,aAAA,CAAC0B,qBAAqB,EAAA;AACpBR,IAAAA,QAAQ,EAAEI,aAAO,CAAChD,KAAK,CAAE;AACzB8C,IAAAA,KAAK,EAAC,MAAM;AACZ9C,IAAAA,KAAK,KAAAqD,MAAA,CAAKrD,KAAK,CAAAqD,CAAAA,MAAA,CAAGnD,MAAM,CAAA;GACzB,CAEA,CACL,CAAC,CAAA;AAEP;;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var classnames = require('classnames');
|
|
5
|
+
var injectCss = require('./inject-css-80a5faa3.js');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
11
|
+
|
|
12
|
+
var css = ".neeto-molecules-tablewrapper-pagination--height{padding:0 0 48px}";
|
|
13
|
+
injectCss.n(css,{});
|
|
14
|
+
|
|
15
|
+
var TableWrapper = function TableWrapper(_ref) {
|
|
16
|
+
var children = _ref.children,
|
|
17
|
+
_ref$className = _ref.className,
|
|
18
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
19
|
+
_ref$hasPagination = _ref.hasPagination,
|
|
20
|
+
hasPagination = _ref$hasPagination === void 0 ? false : _ref$hasPagination;
|
|
21
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22
|
+
"data-testid": "table-wrapper",
|
|
23
|
+
className: classnames__default["default"]("flex min-h-0 w-full flex-grow flex-col pb-6", className)
|
|
24
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
25
|
+
className: classnames__default["default"]("min-h-0 flex-grow", {
|
|
26
|
+
"neeto-molecules-tablewrapper-pagination--height": hasPagination
|
|
27
|
+
})
|
|
28
|
+
}, children));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
module.exports = TableWrapper;
|
|
32
|
+
//# sourceMappingURL=TableWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableWrapper.js","sources":["../../src/components/TableWrapper/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport 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","React","createElement","classNames"],"mappings":";;;;;;;;;;;;;;AAOA,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;EAAA,oBACrEE,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACE,IAAA,aAAA,EAAY,eAAe;AAC3BJ,IAAAA,SAAS,EAAEK,8BAAU,CACnB,6CAA6C,EAC7CL,SACF,CAAA;GAEAG,eAAAA,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEJ,IAAAA,SAAS,EAAEK,8BAAU,CAAC,mBAAmB,EAAE;AACzC,MAAA,iDAAiD,EAAEH,aAAAA;KACpD,CAAA;GAEAJ,EAAAA,QACE,CACF,CAAC,CAAA;AAAA;;;;"}
|