@rh-support/react-context 2.1.86 → 2.1.88

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.
@@ -1,4 +1,3 @@
1
- export * from './bookmarks';
2
1
  export * from './AccountSelector';
3
2
  export * from './NewFeatureAnnouncement';
4
3
  export * from './SharedModals';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
@@ -1,4 +1,3 @@
1
- export * from './bookmarks';
2
1
  export * from './AccountSelector';
3
2
  export * from './NewFeatureAnnouncement';
4
3
  export * from './SharedModals';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/react-context",
3
- "version": "2.1.86",
3
+ "version": "2.1.88",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -40,7 +40,7 @@
40
40
  "@cee-eng/hydrajs": "4.17.24",
41
41
  "@patternfly/react-core": "5.1.1",
42
42
  "@patternfly/react-icons": "5.1.1",
43
- "@rh-support/components": "2.1.77",
43
+ "@rh-support/components": "2.1.79",
44
44
  "@rh-support/types": "2.0.4",
45
45
  "@rh-support/user-permissions": "2.1.49",
46
46
  "@rh-support/utils": "2.1.38",
@@ -93,5 +93,5 @@
93
93
  "defaults and supports es6-module",
94
94
  "maintained node versions"
95
95
  ],
96
- "gitHead": "c83dfde6b2b3b941cf947014ae27f94b9581fb61"
96
+ "gitHead": "f1515c1af548192fac41b8c278aa594d59a9c960"
97
97
  }
@@ -1,16 +0,0 @@
1
- import { IAccount } from '@cee-eng/hydrajs/@types/models/account';
2
- import { IDClassNameProps, IOption } from '@rh-support/types/shared';
3
- import React from 'react';
4
- interface IProps extends IDClassNameProps {
5
- selectedAccountNumber: string;
6
- placeholder: string;
7
- title: string;
8
- onBookmarkedAccountChange: (selection: IOption<IAccount>) => void;
9
- disabled?: boolean;
10
- }
11
- declare function BookmarkedAccountsDropdown(props: IProps): React.JSX.Element;
12
- declare namespace BookmarkedAccountsDropdown {
13
- var defaultProps: Partial<IProps>;
14
- }
15
- export { BookmarkedAccountsDropdown };
16
- //# sourceMappingURL=BookmarkedAccountsDropdown.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BookmarkedAccountsDropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/bookmarks/BookmarkedAccountsDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGrE,OAAO,KAA0C,MAAM,OAAO,CAAC;AAI/D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAQD,iBAAS,0BAA0B,CAAC,KAAK,EAAE,MAAM,qBAyChD;kBAzCQ,0BAA0B;;;AA4CnC,OAAO,EAAE,0BAA0B,EAAE,CAAC"}
@@ -1,35 +0,0 @@
1
- import { Dropdown } from '@rh-support/components';
2
- import { toOption, toOptions } from '@rh-support/utils';
3
- import find from 'lodash/find';
4
- import React, { useContext, useEffect, useState } from 'react';
5
- import { GlobalMetadataStateContext } from '../../context/GlobalMetadataContext';
6
- const defaultProps = {
7
- className: '',
8
- id: '',
9
- placeholder: 'Select a bookmarked account',
10
- title: 'Bookmarked accounts',
11
- disabled: false,
12
- };
13
- function BookmarkedAccountsDropdown(props) {
14
- const { globalMetadataState: { bookmarkedAccounts }, } = useContext(GlobalMetadataStateContext);
15
- const getLabelForAccountOption = (account) => {
16
- return account.accountNumber
17
- ? account.name
18
- ? `${account.name} (${account.accountNumber})`
19
- : account.accountNumber
20
- : '';
21
- };
22
- const [selectedItem, setSelectedItem] = useState(toOption({ accountNumber: '' }, { labelKey: getLabelForAccountOption }));
23
- useEffect(() => {
24
- const item = find(bookmarkedAccounts.data, (account) => account.accountNumber === props.selectedAccountNumber) || {
25
- accountNumber: '',
26
- };
27
- setSelectedItem(toOption(item, { labelKey: getLabelForAccountOption }));
28
- }, [bookmarkedAccounts.data, props.selectedAccountNumber]);
29
- const bookmarkedAccountsOptions = bookmarkedAccounts.data
30
- ? toOptions(bookmarkedAccounts.data, { labelKey: getLabelForAccountOption })
31
- : [];
32
- return (React.createElement(Dropdown, { id: props.id, className: `bookmarked-account-dropdown ${props.className}`, placeholder: props.placeholder, list: bookmarkedAccountsOptions, selectedItem: selectedItem, title: props.title, onChange: props.onBookmarkedAccountChange, disabled: props.disabled }));
33
- }
34
- BookmarkedAccountsDropdown.defaultProps = defaultProps;
35
- export { BookmarkedAccountsDropdown };
@@ -1,2 +0,0 @@
1
- export * from './BookmarkedAccountsDropdown';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/bookmarks/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
@@ -1 +0,0 @@
1
- export * from './BookmarkedAccountsDropdown';