@rh-support/components 2.5.182 → 2.5.184
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/lib/esm/CustomDatePicker/CustomDatePicker.d.ts +18 -0
- package/lib/esm/CustomDatePicker/CustomDatePicker.d.ts.map +1 -0
- package/lib/esm/CustomDatePicker/CustomDatePicker.js +27 -0
- package/lib/esm/CustomDatePicker/customDatePicker.css +52 -0
- package/lib/esm/CustomDatePicker/index.d.ts +2 -0
- package/lib/esm/CustomDatePicker/index.d.ts.map +1 -0
- package/lib/esm/CustomDatePicker/index.js +1 -0
- package/lib/esm/Functional/CaseContactsSelectorExternal.d.ts +1 -0
- package/lib/esm/Functional/CaseContactsSelectorExternal.d.ts.map +1 -1
- package/lib/esm/Functional/CaseContactsSelectorExternal.js +97 -68
- package/lib/esm/MarkdownEditor/MarkdownEditor.d.ts +1 -0
- package/lib/esm/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/lib/esm/MarkdownEditor/MarkdownEditor.js +4 -3
- package/lib/esm/Table/TablePagination.d.ts +1 -0
- package/lib/esm/Table/TablePagination.d.ts.map +1 -1
- package/lib/esm/Table/TablePagination.js +1 -1
- package/lib/esm/helperFunctions/errorMessage.d.ts.map +1 -1
- package/lib/esm/hooks/useCopyToClipboard.d.ts +1 -1
- package/lib/esm/hooks/useCopyToClipboard.d.ts.map +1 -1
- package/lib/esm/hooks/useCopyToClipboard.js +3 -1
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './customDatePicker.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ICustomDatePickerProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
'aria-label'?: string;
|
|
7
|
+
onChange?: (event: React.FormEvent<HTMLInputElement>, value: string, date?: Date) => void;
|
|
8
|
+
validators?: Array<(date: Date) => string>;
|
|
9
|
+
popoverPosition?: 'bottom' | 'bottom-start' | 'bottom-end';
|
|
10
|
+
dateParse?: (value: string) => Date;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
invalidFormatText?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
isDisabled?: boolean;
|
|
15
|
+
validationError?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function CustomDatePicker({ id, value, 'aria-label': ariaLabel, onChange, validators, popoverPosition, dateParse, placeholder, invalidFormatText, className, isDisabled, validationError, }: ICustomDatePickerProps): React.JSX.Element;
|
|
18
|
+
//# sourceMappingURL=CustomDatePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomDatePicker.d.ts","sourceRoot":"","sources":["../../../src/CustomDatePicker/CustomDatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAGhC,OAAO,KAAiB,MAAM,OAAO,CAAC;AAKtC,MAAM,WAAW,sBAAsB;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IAC1F,UAAU,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC;IAC3C,eAAe,CAAC,EAAE,QAAQ,GAAG,cAAc,GAAG,YAAY,CAAC;IAC3D,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,EAC7B,EAAE,EACF,KAAU,EACV,YAAY,EAAE,SAAS,EACvB,QAAQ,EACR,UAAU,EACV,eAAgC,EAChC,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,eAAe,GAClB,EAAE,sBAAsB,qBA4CxB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import './customDatePicker.css';
|
|
2
|
+
import { DatePicker, HelperText, HelperTextItem } from '@patternfly/react-core';
|
|
3
|
+
import React, { useRef } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
export function CustomDatePicker({ id, value = '', 'aria-label': ariaLabel, onChange, validators, popoverPosition = 'bottom-start', dateParse, placeholder, invalidFormatText, className, isDisabled, validationError, }) {
|
|
6
|
+
const { t } = useTranslation();
|
|
7
|
+
const datePickerRef = useRef(null);
|
|
8
|
+
const datePickerClassName = [
|
|
9
|
+
'custom-date-picker',
|
|
10
|
+
'custom-date-picker--input-only',
|
|
11
|
+
validationError && 'custom-date-picker--has-error',
|
|
12
|
+
validationError && 'custom-date-picker--external-validation',
|
|
13
|
+
className,
|
|
14
|
+
]
|
|
15
|
+
.filter(Boolean)
|
|
16
|
+
.join(' ');
|
|
17
|
+
return (React.createElement(React.Fragment, null,
|
|
18
|
+
React.createElement(DatePicker, { ref: datePickerRef, id: id, value: value, isDisabled: isDisabled, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t('YYYY-MM-DD'), invalidFormatText: invalidFormatText !== null && invalidFormatText !== void 0 ? invalidFormatText : t('Invalid date format.'), dateParse: dateParse, "aria-label": ariaLabel, validators: validators, appendTo: () => document.body, className: datePickerClassName, popoverProps: {
|
|
19
|
+
className: 'custom-date-picker-popover',
|
|
20
|
+
hasAutoWidth: false,
|
|
21
|
+
position: popoverPosition,
|
|
22
|
+
}, onChange: onChange, inputProps: {
|
|
23
|
+
onClick: () => { var _a; return (_a = datePickerRef.current) === null || _a === void 0 ? void 0 : _a.toggleCalendar(); },
|
|
24
|
+
} }),
|
|
25
|
+
validationError && (React.createElement(HelperText, null,
|
|
26
|
+
React.createElement(HelperTextItem, { variant: "error" }, validationError)))));
|
|
27
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.custom-date-picker--input-only {
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
--pf-v6-c-date-picker__input--c-form-control--Width: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.custom-date-picker--has-error .pf-v6-c-form-control {
|
|
8
|
+
--pf-v6-c-form-control--BorderColor: var(--pf-t--global--border--color--status--danger--default);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.custom-date-picker--external-validation .pf-v6-c-date-picker__helper-text {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.custom-date-picker--input-only .pf-v6-c-input-group {
|
|
16
|
+
display: block;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.custom-date-picker--input-only .pf-v6-c-input-group__item:first-child {
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.custom-date-picker--input-only .pf-v6-c-input-group__item:last-child {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.pf-v6-c-popover.custom-date-picker-popover {
|
|
28
|
+
--pf-v6-c-popover--MaxWidth: 18.5rem;
|
|
29
|
+
max-width: 18.5rem;
|
|
30
|
+
width: 18.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.pf-v6-c-popover.custom-date-picker-popover .pf-v6-c-calendar-month {
|
|
34
|
+
--pf-v6-c-calendar-month--PaddingBlockStart: var(--pf-t--global--spacer--sm);
|
|
35
|
+
--pf-v6-c-calendar-month--PaddingInlineEnd: var(--pf-t--global--spacer--sm);
|
|
36
|
+
--pf-v6-c-calendar-month--PaddingBlockEnd: var(--pf-t--global--spacer--sm);
|
|
37
|
+
--pf-v6-c-calendar-month--PaddingInlineStart: var(--pf-t--global--spacer--sm);
|
|
38
|
+
--pf-v6-c-calendar-month__header--MarginBlockEnd: var(--pf-t--global--spacer--sm);
|
|
39
|
+
--pf-v6-c-calendar-month__date--Width: 2.25rem;
|
|
40
|
+
--pf-v6-c-calendar-month__date--Height: 2.25rem;
|
|
41
|
+
--pf-v6-c-calendar-month__day--PaddingBlockEnd: var(--pf-t--global--spacer--xs);
|
|
42
|
+
width: 100%;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.pf-v6-c-popover.custom-date-picker-popover .pf-v6-c-calendar-month__header-month .pf-v6-c-menu-toggle {
|
|
46
|
+
width: 100% !important;
|
|
47
|
+
max-width: 6.5rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.pf-v6-c-popover.custom-date-picker-popover .pf-v6-c-calendar-month__calendar {
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/CustomDatePicker/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CustomDatePicker';
|
|
@@ -28,6 +28,7 @@ interface IProps extends IDClassNameProps {
|
|
|
28
28
|
onNew?: (query: string) => void;
|
|
29
29
|
canAddNew?: (options: ITypeaheadDropdownGroupOrOption[], query: string) => boolean;
|
|
30
30
|
getCreateNewText?: (query: string) => string;
|
|
31
|
+
onContactEnriched?: (contact: IContact) => void;
|
|
31
32
|
}
|
|
32
33
|
export declare const CONTACTS_PAGE_SIZE = 10;
|
|
33
34
|
export declare const DEFAULT_CONTACTS_OFFSET: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseContactsSelectorExternal.d.ts","sourceRoot":"","sources":["../../../src/Functional/CaseContactsSelectorExternal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAuB,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseContactsSelectorExternal.d.ts","sourceRoot":"","sources":["../../../src/Functional/CaseContactsSelectorExternal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAuB,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAcxD,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AAEzF,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,0BAA0B,CAAC;AACzE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE,CAAC,QAAQ,GAAG,0BAA0B,CAAC,EAAE,CAAC;IACpD,QAAQ,EAAE,CAAC,gBAAgB,EAAE,CAAC,QAAQ,GAAG,0BAA0B,CAAC,EAAE,KAAK,IAAI,CAAC;IAChF,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;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ator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
11
|
-
import { getApiResourceObject, isEmailValid, sortHydraContacts } from '@rh-support/utils';
|
|
10
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
11
|
+
import { GET_ACCOUNT_CONTACTS, getApiResourceObject, isEmailValid, sortHydraContacts, } from '@rh-support/utils';
|
|
12
12
|
import differenceBy from 'lodash/differenceBy';
|
|
13
13
|
import filter from 'lodash/filter';
|
|
14
14
|
import isArray from 'lodash/isArray';
|
|
15
15
|
import isEmpty from 'lodash/isEmpty';
|
|
16
16
|
import map from 'lodash/map';
|
|
17
17
|
import sortBy from 'lodash/sortBy';
|
|
18
|
-
import React, { useCallback, useEffect, useMemo,
|
|
19
|
-
import { usePrevious } from '../hooks/usePrevious';
|
|
18
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
20
19
|
import { OwnerTypeaheadDropdown } from '../OwnerTypeaheadDropdown';
|
|
21
20
|
export const CONTACTS_PAGE_SIZE = 10;
|
|
22
21
|
export const DEFAULT_CONTACTS_OFFSET = CONTACTS_PAGE_SIZE - 1;
|
|
@@ -42,82 +41,113 @@ const getHydraContactLabel = (user) => {
|
|
|
42
41
|
return label ? label : '';
|
|
43
42
|
};
|
|
44
43
|
function CaseContactsSelectorExternal(props) {
|
|
44
|
+
const apolloClient = useApolloClient();
|
|
45
45
|
const { customEmails, contactSsoUsername, isInvalid, groupContactsAndEmails, selected } = props;
|
|
46
|
-
const previousSelectedAccountNumber = usePrevious(props.selectedAccountNumber);
|
|
47
46
|
const [filteredContacts, setFilteredContacts] = useState([]);
|
|
48
|
-
/**
|
|
49
|
-
* External owner selector related
|
|
50
|
-
*/
|
|
51
|
-
/** Getting user list for selected account when logged in user is a external */
|
|
52
47
|
const [contactList, setContactList] = useState(getApiResourceObject([]));
|
|
53
|
-
const
|
|
54
|
-
|
|
48
|
+
const fetchContactsViaGraphQL = (accountNumber) => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
50
|
+
const { data } = yield apolloClient.query({
|
|
51
|
+
query: GET_ACCOUNT_CONTACTS,
|
|
52
|
+
variables: {
|
|
53
|
+
accountNumber: { eq: accountNumber },
|
|
54
|
+
first: 200,
|
|
55
|
+
orderBy: { Name: { order: 'ASC' } },
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
const response = data;
|
|
59
|
+
const contactEdges = (_h = (_g = (_f = (_e = (_d = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportAccount) === null || _c === void 0 ? void 0 : _c.edges) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.node) === null || _f === void 0 ? void 0 : _f.Contacts) === null || _g === void 0 ? void 0 : _g.edges) !== null && _h !== void 0 ? _h : [];
|
|
60
|
+
return contactEdges
|
|
61
|
+
.filter(({ node }) => { var _a, _b, _c; return ((_a = node.SSOUserName__c) === null || _a === void 0 ? void 0 : _a.value) && ((_c = (_b = node.IsActive__c) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : true); })
|
|
62
|
+
.map(({ node }) => {
|
|
63
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
64
|
+
return ({
|
|
65
|
+
id: node.Id,
|
|
66
|
+
ssoUsername: node.SSOUserName__c.value,
|
|
67
|
+
firstName: (_b = (_a = node.FirstName) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '',
|
|
68
|
+
lastName: (_d = (_c = node.LastName) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : '',
|
|
69
|
+
fullNameCustom: (_f = (_e = node.Name) === null || _e === void 0 ? void 0 : _e.value) !== null && _f !== void 0 ? _f : '',
|
|
70
|
+
manageSupportCases: (_h = (_g = node.ManageSupportCases__c) === null || _g === void 0 ? void 0 : _g.value) !== null && _h !== void 0 ? _h : true,
|
|
71
|
+
isInternal: (_k = (_j = node.IsInternal__c) === null || _j === void 0 ? void 0 : _j.value) !== null && _k !== void 0 ? _k : false,
|
|
72
|
+
isOrgAdmin: (_m = (_l = node.IsOrgAdmin__c) === null || _l === void 0 ? void 0 : _l.value) !== null && _m !== void 0 ? _m : false,
|
|
73
|
+
phone: (_p = (_o = node.Phone) === null || _o === void 0 ? void 0 : _o.value) !== null && _p !== void 0 ? _p : '',
|
|
74
|
+
defaultCaseGroup: (_r = (_q = node.DefaultCaseGroup__c) === null || _q === void 0 ? void 0 : _q.value) !== null && _r !== void 0 ? _r : null,
|
|
75
|
+
accountNumber,
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
});
|
|
55
79
|
useEffect(() => {
|
|
56
|
-
|
|
80
|
+
const { selectedAccountNumber, loggedInUserRights, isExportingPDF } = props;
|
|
81
|
+
const isNonOrgAdminSameAccount = loggedInUserRights.isExternal() && loggedInUserRights.isNonOrgAdminWithSameAccount(selectedAccountNumber);
|
|
82
|
+
if (isExportingPDF || !selectedAccountNumber || isNonOrgAdminSameAccount) {
|
|
57
83
|
return;
|
|
58
|
-
|
|
59
|
-
let
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
controllerRef1.current = new AbortController();
|
|
65
|
-
if (controllerRef2.current) {
|
|
66
|
-
controllerRef2.current.abort();
|
|
67
|
-
}
|
|
68
|
-
controllerRef2.current = new AbortController();
|
|
84
|
+
}
|
|
85
|
+
let cancelled = false;
|
|
86
|
+
const accountNumberAtFetch = selectedAccountNumber;
|
|
87
|
+
const fetchAccountContacts = () => __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
setContactList(getApiResourceObject([], true));
|
|
69
89
|
try {
|
|
70
|
-
setContactList(getApiResourceObject([], true));
|
|
71
90
|
let contactListTemp = [];
|
|
72
|
-
if (
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (props.loggedInUserRights.isNonOrgAdmin()) {
|
|
78
|
-
const extraLoggedInContacts = props.loggedInUserRights.getHydraContactFromLoggedInUser();
|
|
79
|
-
const contacts = yield accounts.getAccountContacts(props.selectedAccountNumber, controllerRef1.current.signal);
|
|
91
|
+
if (loggedInUserRights.isPartner() &&
|
|
92
|
+
loggedInUserRights.isAccountDifferentFromLoggedInAccount(accountNumberAtFetch)) {
|
|
93
|
+
if (loggedInUserRights.isNonOrgAdmin()) {
|
|
94
|
+
const extraLoggedInContacts = loggedInUserRights.getHydraContactFromLoggedInUser();
|
|
95
|
+
const contacts = yield fetchContactsViaGraphQL(accountNumberAtFetch);
|
|
80
96
|
contactListTemp = contacts.concat(extraLoggedInContacts);
|
|
81
97
|
}
|
|
82
98
|
else {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
];
|
|
87
|
-
const loggedInContactsResponse = yield Promise.all(promiseArray);
|
|
88
|
-
const selectedAccountsContacts = loggedInContactsResponse[0];
|
|
89
|
-
const currentAccountsContacts = loggedInContactsResponse[1];
|
|
99
|
+
const [selectedAccountsContacts, currentAccountsContacts] = yield Promise.all([
|
|
100
|
+
fetchContactsViaGraphQL(accountNumberAtFetch),
|
|
101
|
+
fetchContactsViaGraphQL(loggedInUserRights.getAccountNumber()),
|
|
102
|
+
]);
|
|
90
103
|
contactListTemp = [...selectedAccountsContacts, ...currentAccountsContacts];
|
|
91
104
|
}
|
|
92
105
|
}
|
|
93
106
|
else {
|
|
94
|
-
contactListTemp = yield
|
|
107
|
+
contactListTemp = yield fetchContactsViaGraphQL(accountNumberAtFetch);
|
|
95
108
|
}
|
|
96
|
-
if (
|
|
97
|
-
|
|
109
|
+
if (!cancelled) {
|
|
110
|
+
setContactList(getApiResourceObject(sortHydraContacts(contactListTemp)));
|
|
98
111
|
}
|
|
99
|
-
setContactList(getApiResourceObject(sortHydraContacts(contactListTemp)));
|
|
100
112
|
}
|
|
101
113
|
catch (e) {
|
|
102
|
-
|
|
114
|
+
if (!cancelled) {
|
|
115
|
+
setContactList(getApiResourceObject([], false, true, e.message));
|
|
116
|
+
}
|
|
103
117
|
}
|
|
104
118
|
});
|
|
105
|
-
|
|
106
|
-
if (isOldAccountNumber ||
|
|
107
|
-
(props.loggedInUserRights.isExternal() &&
|
|
108
|
-
props.loggedInUserRights.isNonOrgAdminWithSameAccount(props.selectedAccountNumber)))
|
|
109
|
-
return;
|
|
110
|
-
fetchStrataAccountUsers();
|
|
119
|
+
fetchAccountContacts();
|
|
111
120
|
return () => {
|
|
112
|
-
|
|
121
|
+
cancelled = true;
|
|
113
122
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
124
|
+
}, [apolloClient, props.selectedAccountNumber, props.isExportingPDF]);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
if (contactList.isFetching || isEmpty(contactList.data) || isEmpty(selected))
|
|
127
|
+
return;
|
|
128
|
+
const currentOwner = selected[0];
|
|
129
|
+
if (!(currentOwner === null || currentOwner === void 0 ? void 0 : currentOwner.ssoUsername))
|
|
130
|
+
return;
|
|
131
|
+
const matchedContact = contactList.data.find((c) => {
|
|
132
|
+
var _a, _b;
|
|
133
|
+
return c.id === (currentOwner === null || currentOwner === void 0 ? void 0 : currentOwner.id) ||
|
|
134
|
+
((_a = c.ssoUsername) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = currentOwner.ssoUsername) === null || _b === void 0 ? void 0 : _b.toLowerCase());
|
|
135
|
+
});
|
|
136
|
+
if (matchedContact === null || matchedContact === void 0 ? void 0 : matchedContact.id) {
|
|
137
|
+
props.onContactEnriched
|
|
138
|
+
? props.onContactEnriched(matchedContact)
|
|
139
|
+
: props.onChange && props.onChange([matchedContact]);
|
|
140
|
+
}
|
|
141
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
142
|
+
}, [contactList.data, contactList.isFetching]);
|
|
143
|
+
const displayedContacts = useMemo(() => {
|
|
144
|
+
var _a;
|
|
145
|
+
let contacts = (_a = contactList.data) !== null && _a !== void 0 ? _a : [];
|
|
146
|
+
if (props.contactsToExclude && props.contactsToExclude.length > 0) {
|
|
147
|
+
contacts = differenceBy(contacts, props.contactsToExclude, 'ssoUsername');
|
|
148
|
+
}
|
|
149
|
+
return contacts;
|
|
150
|
+
}, [contactList.data, props.contactsToExclude]);
|
|
121
151
|
const onCustomerContactSelect = (contacts) => {
|
|
122
152
|
if (!isArray(contacts))
|
|
123
153
|
return;
|
|
@@ -134,11 +164,10 @@ function CaseContactsSelectorExternal(props) {
|
|
|
134
164
|
];
|
|
135
165
|
props.onChange && props.onChange(customerContacts);
|
|
136
166
|
};
|
|
137
|
-
const
|
|
138
|
-
props.loggedInUserRights.isNonOrgAdminWithSameAccount(props.selectedAccountNumber)
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
props.isDisabled;
|
|
167
|
+
const isNonOrgAdminSameAccountDisabled = props.loggedInUserRights.isExternal() &&
|
|
168
|
+
props.loggedInUserRights.isNonOrgAdminWithSameAccount(props.selectedAccountNumber);
|
|
169
|
+
const isDisabled = isNonOrgAdminSameAccountDisabled || props.isUpdating || contactList.isFetching || props.isDisabled;
|
|
170
|
+
const isLoading = props.isUpdating || contactList.isFetching;
|
|
142
171
|
const getCustomEmails = useCallback(() => {
|
|
143
172
|
return sortBy((customEmails || []).map((item) => (Object.assign(Object.assign({}, item), { ssoUsername: item.emailAddress, firstName: item.emailAddress, lastName: item.emailAddress }))), 'emailAddress');
|
|
144
173
|
}, [customEmails]);
|
|
@@ -147,13 +176,13 @@ function CaseContactsSelectorExternal(props) {
|
|
|
147
176
|
*/
|
|
148
177
|
const allOptions = useMemo(() => {
|
|
149
178
|
return [
|
|
150
|
-
...map(
|
|
179
|
+
...map(displayedContacts, (contact) => ({ contact, isCustomEmail: false })),
|
|
151
180
|
...map(getCustomEmails(), (email) => ({
|
|
152
181
|
isCustomEmail: true,
|
|
153
182
|
contact: Object.assign(Object.assign({}, email), { ssoUsername: email.emailAddress, firstName: email.emailAddress, lastName: email.emailAddress }),
|
|
154
183
|
})),
|
|
155
184
|
];
|
|
156
|
-
}, [
|
|
185
|
+
}, [displayedContacts, getCustomEmails]);
|
|
157
186
|
/**
|
|
158
187
|
* update the shown options in the dropdown and reset the amount of options show to the default.
|
|
159
188
|
* @param query The user search term
|
|
@@ -173,7 +202,7 @@ function CaseContactsSelectorExternal(props) {
|
|
|
173
202
|
const onClearQuery = () => {
|
|
174
203
|
var _a;
|
|
175
204
|
const numOfCustomEmails = (_a = customEmails === null || customEmails === void 0 ? void 0 : customEmails.length) !== null && _a !== void 0 ? _a : 0;
|
|
176
|
-
if (filteredContacts.length ===
|
|
205
|
+
if (filteredContacts.length === displayedContacts.length + numOfCustomEmails)
|
|
177
206
|
return;
|
|
178
207
|
setFilteredContacts(allOptions);
|
|
179
208
|
};
|
|
@@ -195,7 +224,7 @@ function CaseContactsSelectorExternal(props) {
|
|
|
195
224
|
*/
|
|
196
225
|
useEffect(() => {
|
|
197
226
|
setFilteredContacts(allOptions);
|
|
198
|
-
}, [
|
|
199
|
-
return (React.createElement(OwnerTypeaheadDropdown, { id: props.id || '', hasClearButton: true, multiple: !!props.multiple, contactSsoUsername: contactSsoUsername, groupContactsAndEmails: groupContactsAndEmails, selected: !isEmpty(props.selected) ? props.selected : [], options: filteredContacts, placeholder: props.placeholder || 'Search by name or username', "data-tracking-id": "external-case-contact-selector", isDisabled: isDisabled, status: isInvalid ? 'danger' : undefined, onChipRemoved: onChipRemoved, onClearQuery: onClearQuery, onQueryUpdated: onQueryUpdated, onSelect: onCustomerContactSelect, canAddNew: canAddNew, getCreateNewText: props === null || props === void 0 ? void 0 : props.getCreateNewText, isLoading:
|
|
227
|
+
}, [displayedContacts, customEmails, allOptions, selected]);
|
|
228
|
+
return (React.createElement(OwnerTypeaheadDropdown, { id: props.id || '', hasClearButton: true, multiple: !!props.multiple, contactSsoUsername: contactSsoUsername, groupContactsAndEmails: groupContactsAndEmails, selected: !isEmpty(props.selected) ? props.selected : [], options: filteredContacts, placeholder: props.placeholder || 'Search by name or username', "data-tracking-id": "external-case-contact-selector", isDisabled: isDisabled, status: isInvalid ? 'danger' : undefined, onChipRemoved: onChipRemoved, onClearQuery: onClearQuery, onQueryUpdated: onQueryUpdated, onSelect: onCustomerContactSelect, canAddNew: canAddNew, getCreateNewText: props === null || props === void 0 ? void 0 : props.getCreateNewText, isLoading: isLoading }));
|
|
200
229
|
}
|
|
201
230
|
export { CaseContactsSelectorExternal, getHydraContactLabel };
|
|
@@ -32,6 +32,7 @@ export interface IMDEditorProps extends Omit<HTMLProps<HTMLTextAreaElement>, 'on
|
|
|
32
32
|
markedownOptions?: IMarkdownOptions;
|
|
33
33
|
showMarkdownPlainTextToggle?: boolean;
|
|
34
34
|
editorMode?: EditorMode;
|
|
35
|
+
hideToolbars?: boolean;
|
|
35
36
|
charLimit?: number;
|
|
36
37
|
minCharsForCounter?: number;
|
|
37
38
|
onCommentExceedCharsLimit: (val: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownEditor.d.ts","sourceRoot":"","sources":["../../../src/MarkdownEditor/MarkdownEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAwB,MAAM,qBAAqB,CAAC;AAiC7E,OAAO,KAAK,EAAE,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAMtE,oBAAY,UAAU;IAClB,KAAK,cAAc;IACnB,QAAQ,aAAa;CACxB;AAED,UAAU,kBAAkB;IACxB,yBAAyB,EAAE,OAAO,CAAC;IACnC,SAAS,EAAE,OAAO,CAAC,WAAW,C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CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAClD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,iBAAiB,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACnD;AA4BD,eAAO,MAAM,YAAY,GAAI,MAAM,OAAO,CAAC,WAAW,CAAC,KAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAiB7F,CAAC;AAEF,iBAAS,cAAc,CAAC,KAAK,EAAE,cAAc,qBAo8B5C;kBAp8BQ,cAAc;;;AAw8BvB,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -46,6 +46,7 @@ const defaultProps = {
|
|
|
46
46
|
hideHeadingOptions: false,
|
|
47
47
|
showMarkdownPlainTextToggle: false,
|
|
48
48
|
editorMode: EditorMode.PLAIN,
|
|
49
|
+
hideToolbars: false,
|
|
49
50
|
charLimit: 32000,
|
|
50
51
|
minCharsForCounter: 31800,
|
|
51
52
|
fileSelectorProps: {
|
|
@@ -72,7 +73,7 @@ export const validateFile = (file) => {
|
|
|
72
73
|
};
|
|
73
74
|
function MarkdownEditor(props) {
|
|
74
75
|
const { t } = useTranslation();
|
|
75
|
-
const { hidePreviewText, showPreviewText, mdPlaceholder, plainTextPlaceholder, textAreaClassName, bindTextArea, markedownOptions, allowEmoji, hideHeadingOptions, rows, showMarkdownPlainTextToggle, editorMode, className, charLimit, minCharsForCounter, id, value, onCommentExceedCharsLimit, fileSelectorProps: { onClipboardPaste, onFileSelect, isSupportedFile, showFileSelectorInToolbar = false, isUploadingFile = false, filesList = [], attachFileBtn, } } = props, textAreaProps = __rest(props, ["hidePreviewText", "showPreviewText", "mdPlaceholder", "plainTextPlaceholder", "textAreaClassName", "bindTextArea", "markedownOptions", "allowEmoji", "hideHeadingOptions", "rows", "showMarkdownPlainTextToggle", "editorMode", "className", "charLimit", "minCharsForCounter", "id", "value", "onCommentExceedCharsLimit", "fileSelectorProps"]);
|
|
76
|
+
const { hidePreviewText, showPreviewText, mdPlaceholder, plainTextPlaceholder, textAreaClassName, bindTextArea, markedownOptions, allowEmoji, hideHeadingOptions, rows, showMarkdownPlainTextToggle, editorMode, className, charLimit, minCharsForCounter, id, value, hideToolbars, onCommentExceedCharsLimit, fileSelectorProps: { onClipboardPaste, onFileSelect, isSupportedFile, showFileSelectorInToolbar = false, isUploadingFile = false, filesList = [], attachFileBtn, } } = props, textAreaProps = __rest(props, ["hidePreviewText", "showPreviewText", "mdPlaceholder", "plainTextPlaceholder", "textAreaClassName", "bindTextArea", "markedownOptions", "allowEmoji", "hideHeadingOptions", "rows", "showMarkdownPlainTextToggle", "editorMode", "className", "charLimit", "minCharsForCounter", "id", "value", "hideToolbars", "onCommentExceedCharsLimit", "fileSelectorProps"]);
|
|
76
77
|
const [isPreview, setIsPreview] = useState(false);
|
|
77
78
|
const [mdValue, setMdValue] = useState(props.value || '');
|
|
78
79
|
const previousFileList = usePrevious(filesList);
|
|
@@ -528,7 +529,7 @@ function MarkdownEditor(props) {
|
|
|
528
529
|
return (React.createElement("div", { id: "markdown-editor" },
|
|
529
530
|
!isPlainModeEnabled && React.createElement("div", { className: "markdown-guidance-container" }, markdownGuidanceBtn),
|
|
530
531
|
React.createElement("div", { className: `markdown-editor-container ${props.className}`, id: props.id, "data-tracking-id": "md-editor-container", onDrop: onDrop, onPaste: onPaste },
|
|
531
|
-
React.createElement("div", { className: "toolbar-container border-bottom" }, !isPlainModeEnabled && (React.createElement(React.Fragment, null,
|
|
532
|
+
React.createElement("div", { className: "toolbar-container border-bottom", style: hideToolbars ? { display: 'none' } : undefined }, !isPlainModeEnabled && (React.createElement(React.Fragment, null,
|
|
532
533
|
React.createElement(Toolbar, { className: "desktop-markdown-toolbar pf-v6-l-flex" },
|
|
533
534
|
React.createElement(ToolbarGroup, { "data-tracking-id": "md-editor-toolbar", className: "markdown-toolbar-left-section pf-m-wrap" },
|
|
534
535
|
React.createElement(Button, { icon: "B", variant: ButtonVariant.plain, tabIndex: -1, isDisabled: props.disabled || isPreview, onClick: bold, "data-tracking-id": "md-editor-toolbar-b", title: "Bold" }),
|
|
@@ -580,7 +581,7 @@ function MarkdownEditor(props) {
|
|
|
580
581
|
React.createElement("div", { dangerouslySetInnerHTML: {
|
|
581
582
|
__html: DOMPurify.sanitize(previewMDText(mdValue)),
|
|
582
583
|
} }))))),
|
|
583
|
-
React.createElement("div",
|
|
584
|
+
React.createElement("div", { style: hideToolbars ? { display: 'none' } : undefined }, props.showMarkdownPlainTextToggle && (React.createElement("div", { className: `markdown-toggle-toolbar pf-v6-l-flex` },
|
|
584
585
|
React.createElement("span", { className: "markdown-toolbar-left-section pf-m-wrap" },
|
|
585
586
|
!isPlainModeEnabled && (React.createElement(Button, { className: "markdown-preview-btn", tabIndex: -1, variant: ButtonVariant.plain, onClick: preview, title: "Show preview", "data-tracking-id": `md-preview-${isPreview ? 'hide' : 'show'}`, isDisabled: disablePreviewButton, icon: React.createElement(Trans, null, isPreview ? (React.createElement("span", null,
|
|
586
587
|
" ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePagination.d.ts","sourceRoot":"","sources":["../../../src/Table/TablePagination.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE;;;KAAA,KAAK,IAAI,CAAC;IAChD,eAAe,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE;;;KAAA,KAAK,IAAI,CAAC;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"TablePagination.d.ts","sourceRoot":"","sources":["../../../src/Table/TablePagination.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE;;;KAAA,KAAK,IAAI,CAAC;IAChD,eAAe,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE;;;KAAA,KAAK,IAAI,CAAC;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAiC5C"}
|
|
@@ -17,7 +17,7 @@ export function TablePagination(props) {
|
|
|
17
17
|
props.currentPage && props.currentPage !== currentPage && setSelectedPage(props.currentPage);
|
|
18
18
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
19
|
}, [props.perPage, props.currentPage]);
|
|
20
|
-
return (React.createElement(Pagination, { itemCount: props.itemCount || (data || []).length, widgetId: "pagination-options-menu-top", perPage: perPage, page: currentPage, variant: props.variant, titles: {
|
|
20
|
+
return (React.createElement(Pagination, { itemCount: props.itemCount || (data || []).length, widgetId: "pagination-options-menu-top", perPage: perPage, page: currentPage, variant: props.variant, isCompact: props.isCompact, titles: {
|
|
21
21
|
paginationAriaLabel: props.variant === PaginationVariant.top ? 'Upper pagination' : 'Lower pagination',
|
|
22
22
|
}, onSetPage: onSetPage, onPerPageSelect: onPerPageSelect }));
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorMessage.d.ts","sourceRoot":"","sources":["../../../src/helperFunctions/errorMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAS7B,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,SAAS;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACxC;
|
|
1
|
+
{"version":3,"file":"errorMessage.d.ts","sourceRoot":"","sources":["../../../src/helperFunctions/errorMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAS7B,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,SAAS;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACxC;AA+DD,iBAAS,wBAAwB,CAAC,KAAK,KAAA,EAAE,aAAa,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,GAAG,CAAC,OAAO,CA2CjH;AAED,iBAAS,iBAAiB,CAAC,KAAK,KAAA,EAAE,WAAW,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAa1F;AAED,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCopyToClipboard.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCopyToClipboard.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"useCopyToClipboard.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCopyToClipboard.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;;;EA6BnE"}
|
|
@@ -14,9 +14,11 @@ export function useCopyToClipboard(ref) {
|
|
|
14
14
|
// @ts-ignore
|
|
15
15
|
const { t } = useTranslation();
|
|
16
16
|
const copyToClipboard = () => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
var _a;
|
|
17
18
|
if (!ref.current)
|
|
18
19
|
return;
|
|
19
|
-
const
|
|
20
|
+
const el = ref.current;
|
|
21
|
+
const textToCopy = el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement ? el.value : (_a = el.textContent) !== null && _a !== void 0 ? _a : '';
|
|
20
22
|
try {
|
|
21
23
|
yield navigator.clipboard.writeText(textToCopy);
|
|
22
24
|
setClipboardText(t('Copied!'));
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export * from './SubscriptionAbuse';
|
|
|
29
29
|
export * from './TermsAndConditions';
|
|
30
30
|
export * from './TextAreaResizable';
|
|
31
31
|
export * from './CustomTextInput';
|
|
32
|
+
export * from './CustomDatePicker';
|
|
32
33
|
export * from './PhoneInput';
|
|
33
34
|
export * from './TagsSelector';
|
|
34
35
|
export * from './SingleSelectDropdown';
|
package/lib/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
|
package/lib/esm/index.js
CHANGED
|
@@ -30,6 +30,7 @@ export * from './SubscriptionAbuse';
|
|
|
30
30
|
export * from './TermsAndConditions';
|
|
31
31
|
export * from './TextAreaResizable';
|
|
32
32
|
export * from './CustomTextInput';
|
|
33
|
+
export * from './CustomDatePicker';
|
|
33
34
|
export * from './PhoneInput';
|
|
34
35
|
export * from './TagsSelector';
|
|
35
36
|
export * from './SingleSelectDropdown';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/components",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.184",
|
|
4
4
|
"description": "Contains all reusabel components for support app",
|
|
5
5
|
"author": "Vikas Rathee <vrathee@redhat.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"prepublishOnly": "npm run build"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@
|
|
43
|
+
"@apollo/client": "^4.1.6",
|
|
44
44
|
"@cee-eng/ui-toolkit": "1.1.9",
|
|
45
45
|
"@patternfly/patternfly": "6.2.1",
|
|
46
46
|
"@patternfly/react-core": "6.2.1",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"use-deep-compare-effect": "^1.6.1"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@cee-eng/hydrajs": "4.18.
|
|
58
|
+
"@cee-eng/hydrajs": "^4.18.113",
|
|
59
59
|
"@cee-eng/ui-toolkit": "1.1.9",
|
|
60
60
|
"@patternfly/patternfly": "6.2.1",
|
|
61
61
|
"@patternfly/react-core": "6.2.1",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"@patternfly/react-table": "6.2.1",
|
|
64
64
|
"@patternfly/react-tokens": "6.2.1",
|
|
65
65
|
"@rh-support/types": "2.0.26",
|
|
66
|
-
"@rh-support/user-permissions": "2.5.
|
|
67
|
-
"@rh-support/utils": "2.5.
|
|
66
|
+
"@rh-support/user-permissions": "2.5.130",
|
|
67
|
+
"@rh-support/utils": "2.5.112",
|
|
68
68
|
"dompurify": "^2.2.6",
|
|
69
69
|
"js-worker-search": "^1.4.1",
|
|
70
70
|
"lazysizes": "^5.3.2",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"defaults and supports es6-module",
|
|
102
102
|
"maintained node versions"
|
|
103
103
|
],
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "d93a57f2a62bdfc7ec25341b3dcae197f3e5f1a3"
|
|
105
105
|
}
|