@rh-support/components 2.5.213 → 2.5.222

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.
Files changed (46) hide show
  1. package/lib/esm/ConfirmationModal/ConfirmationDialog.js +1 -1
  2. package/lib/esm/Functional/CaseContactsSelectorExternal.d.ts +0 -2
  3. package/lib/esm/Functional/CaseContactsSelectorExternal.d.ts.map +1 -1
  4. package/lib/esm/Functional/CaseContactsSelectorExternal.js +82 -156
  5. package/lib/esm/MarkdownEditor/MarkdownEditor.d.ts +49 -0
  6. package/lib/esm/MarkdownEditor/MarkdownEditor.d.ts.map +1 -0
  7. package/lib/esm/MarkdownEditor/MarkdownEditor.js +601 -0
  8. package/lib/esm/MarkdownEditor/index.d.ts +2 -0
  9. package/lib/esm/MarkdownEditor/index.d.ts.map +1 -0
  10. package/lib/esm/MarkdownEditor/index.js +1 -0
  11. package/lib/esm/MarkdownEditor/markdownEditor.css +223 -0
  12. package/lib/esm/OwnerTypeaheadDropdown/OwnerTypeaheadDropdown.d.ts +0 -2
  13. package/lib/esm/OwnerTypeaheadDropdown/OwnerTypeaheadDropdown.d.ts.map +1 -1
  14. package/lib/esm/OwnerTypeaheadDropdown/OwnerTypeaheadDropdown.js +3 -8
  15. package/lib/esm/PhoneInput/PhoneInput.d.ts.map +1 -1
  16. package/lib/esm/PhoneInput/PhoneInput.js +1 -38
  17. package/lib/esm/Table/TablePagination.d.ts +0 -1
  18. package/lib/esm/Table/TablePagination.d.ts.map +1 -1
  19. package/lib/esm/Table/TablePagination.js +1 -1
  20. package/lib/esm/helperFunctions/errorMessage.d.ts +1 -2
  21. package/lib/esm/helperFunctions/errorMessage.d.ts.map +1 -1
  22. package/lib/esm/helperFunctions/errorMessage.js +5 -19
  23. package/lib/esm/hooks/useCopyToClipboard.d.ts +1 -1
  24. package/lib/esm/hooks/useCopyToClipboard.d.ts.map +1 -1
  25. package/lib/esm/hooks/useCopyToClipboard.js +1 -3
  26. package/lib/esm/index.d.ts +1 -2
  27. package/lib/esm/index.d.ts.map +1 -1
  28. package/lib/esm/index.js +1 -3
  29. package/package.json +7 -9
  30. package/lib/esm/CustomDatePicker/CustomDatePicker.d.ts +0 -18
  31. package/lib/esm/CustomDatePicker/CustomDatePicker.d.ts.map +0 -1
  32. package/lib/esm/CustomDatePicker/CustomDatePicker.js +0 -27
  33. package/lib/esm/CustomDatePicker/customDatePicker.css +0 -52
  34. package/lib/esm/CustomDatePicker/index.d.ts +0 -2
  35. package/lib/esm/CustomDatePicker/index.d.ts.map +0 -1
  36. package/lib/esm/CustomDatePicker/index.js +0 -1
  37. package/lib/esm/RichTextEditor/RichTextEditor.d.ts +0 -45
  38. package/lib/esm/RichTextEditor/RichTextEditor.d.ts.map +0 -1
  39. package/lib/esm/RichTextEditor/RichTextEditor.js +0 -463
  40. package/lib/esm/RichTextEditor/index.d.ts +0 -4
  41. package/lib/esm/RichTextEditor/index.d.ts.map +0 -1
  42. package/lib/esm/RichTextEditor/index.js +0 -2
  43. package/lib/esm/RichTextEditor/richTextEditor.css +0 -148
  44. package/lib/esm/RichTextEditor/useQuillEditor.d.ts +0 -20
  45. package/lib/esm/RichTextEditor/useQuillEditor.d.ts.map +0 -1
  46. package/lib/esm/RichTextEditor/useQuillEditor.js +0 -81
@@ -0,0 +1,223 @@
1
+ .markdown-content .markdown-preview {
2
+ min-height: 100px;
3
+ overflow: auto;
4
+ font-size: 15px;
5
+ padding: 0.8rem;
6
+ border: 1px solid #e3e3e3;
7
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
8
+ border-radius: 1px;
9
+ }
10
+
11
+ .markdown-content .markdown-preview ul,
12
+ .markdown-content .markdown-preview ol {
13
+ padding-left: 24px;
14
+ }
15
+
16
+ .markdown-content .markdown-preview blockquote {
17
+ border-left: 5px solid #c0c0c0 !important;
18
+ }
19
+
20
+ .markdown-editor-container {
21
+ background: #fff;
22
+ border: 1px solid #d2d2d2;
23
+ display: block;
24
+ min-height: 100px;
25
+ }
26
+
27
+ .markdown-editor-container .pf-v6-c-toolbar {
28
+ padding: 0.5rem;
29
+ }
30
+
31
+ .btn-group-separator {
32
+ background: rgba(40, 45, 51, 0.3);
33
+ height: 16px;
34
+ margin-left: 10px;
35
+ margin-right: 5px;
36
+ width: 1px;
37
+ margin-top: 10px;
38
+ }
39
+
40
+ .markdown-content .markdown-text-area {
41
+ resize: vertical;
42
+ border-radius: 0;
43
+ box-shadow: none !important;
44
+ outline: none;
45
+ border: none;
46
+ font-size: 15px;
47
+ padding: 0.8rem;
48
+ min-width: 100%;
49
+ }
50
+
51
+ .markdown-editor-container .markdown-toggle-toolbar {
52
+ border-top: 1px solid #d2d2d2;
53
+ }
54
+
55
+ .markdown-editor-container .markdown-toggle-toolbar button {
56
+ font-size: 14px;
57
+ padding: 10px 1rem;
58
+ }
59
+
60
+ .markdown-editor-container .markdown-toggle-toolbar .markdown-active-mode {
61
+ border-top: 2px solid #06c;
62
+ border-radius: 0px;
63
+ color: #6a6e73;
64
+ font-weight: 500;
65
+ color: #06c;
66
+ }
67
+
68
+ .markdown-editor-container .pf-v6-c-button.pf-m-link.pf-m-inline.markdown-guidance {
69
+ padding-block-start: 0.375rem;
70
+ padding-block-end: 0.375rem;
71
+ padding-inline-start: 0.375rem;
72
+ padding-inline-end: 0.375rem;
73
+ box-sizing: border-box;
74
+ }
75
+
76
+ .markdown-editor-container .character-count-wrapper {
77
+ white-space: nowrap;
78
+ padding: 0 16px;
79
+ font-size: 14px;
80
+ }
81
+
82
+ .markdown-editor-container .character-count-wrapper.red {
83
+ color: #e00;
84
+ }
85
+
86
+ .markdown-editor-container .markdown-toolbar-left-section {
87
+ flex: 1;
88
+ }
89
+
90
+ .markdown-editor-container.is-private .markdown-content .markdown-text-area {
91
+ background-color: #f5eeee;
92
+ }
93
+
94
+ a[href*='/attachments/']::before,
95
+ button[data-link*='/attachments/']::before {
96
+ margin-right: 4px;
97
+ font-style: normal;
98
+ text-rendering: auto;
99
+ -webkit-font-smoothing: antialiased;
100
+ content: '📎';
101
+ }
102
+
103
+ .toolbar-container {
104
+ height: 50px;
105
+ }
106
+ .markdown-text-area {
107
+ width: 100%;
108
+ height: 313px;
109
+ border: none;
110
+ }
111
+
112
+ .markdown-preview {
113
+ border-bottom: none !important;
114
+ }
115
+
116
+ .markdown-preview ul {
117
+ list-style: '-';
118
+ }
119
+
120
+ .desktop-markdown-toolbar {
121
+ display: flex;
122
+ }
123
+
124
+ .markdown-toolbar-left-section {
125
+ display: flex;
126
+ align-items: center;
127
+ }
128
+
129
+ .btn-group-separator {
130
+ display: inline-block;
131
+ width: 1px;
132
+ height: 24px;
133
+ margin: 0 8px;
134
+ background-color: #ccc;
135
+ }
136
+
137
+ .markdown-guidance-container {
138
+ display: none;
139
+ }
140
+
141
+ .mobile-markdown-toolbar {
142
+ display: none;
143
+ }
144
+
145
+ #toolsKebabMenu {
146
+ overflow: hidden;
147
+ inset: 0px auto auto -12rem !important;
148
+
149
+ .pf-v6-c-menu__list {
150
+ padding-left: 0px !important;
151
+ padding-right: 0px !important;
152
+ }
153
+
154
+ .attachments-items li {
155
+ padding: 0px 10px !important;
156
+
157
+ .pf-v6-c-divider {
158
+ width: 15rem;
159
+ margin-left: -1rem;
160
+ }
161
+ }
162
+ }
163
+
164
+ /* Mobile toolbar styles */
165
+ @media (max-width: 880px) {
166
+ .desktop-markdown-toolbar {
167
+ display: none;
168
+ }
169
+
170
+ .markdown-guidance-container {
171
+ display: flex;
172
+ justify-content: flex-end;
173
+ padding: 9px;
174
+ }
175
+
176
+ .mobile-markdown-toolbar {
177
+ display: flex;
178
+ flex-direction: row;
179
+ justify-content: space-between;
180
+ align-items: center;
181
+
182
+ .mobile-markdown-tool-item {
183
+ width: 2.5rem !important;
184
+ }
185
+ }
186
+
187
+ .markdown-toolbar-left-section {
188
+ margin-inline-end: 0px !important;
189
+ }
190
+
191
+ .markdown-preview-btn,
192
+ .plain-mode-btn,
193
+ .markdown-mode-btn {
194
+ padding-left: 4px;
195
+ padding-right: 4px;
196
+ }
197
+
198
+ .markdown-editor-container .markdown-toggle-toolbar button {
199
+ font-size: 14px;
200
+ padding: 10px 0.25rem;
201
+ }
202
+ }
203
+
204
+ @media (max-width: 475px) {
205
+ .markdown-editor-container .pf-v6-c-toolbar {
206
+ padding: 0.5rem 0rem;
207
+ }
208
+
209
+ .mobile-markdown-toolbar {
210
+ .mobile-markdown-tool-item {
211
+ width: 0.1rem !important;
212
+ }
213
+
214
+ #tools-kebab-menu-container {
215
+ position: relative;
216
+ right: 2rem;
217
+ }
218
+ }
219
+
220
+ .uploading-spinner-text {
221
+ display: none;
222
+ }
223
+ }
@@ -10,8 +10,6 @@ export interface IOwnerSelectorProps extends IOwnerSelectorExtends {
10
10
  onSelect: (contacts: IContact[]) => void;
11
11
  onChipRemoved?: (contact: IContact) => void;
12
12
  isLoading?: boolean;
13
- onHandleLoadMore?: (event: any) => void;
14
- isShowMoreOptionVisible?: boolean;
15
13
  }
16
14
  export interface IOwnerOption {
17
15
  contact: IContact;
@@ -1 +1 @@
1
- {"version":3,"file":"OwnerTypeaheadDropdown.d.ts","sourceRoot":"","sources":["../../../src/OwnerTypeaheadDropdown/OwnerTypeaheadDropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAKlE,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,OAAO,EAGH,uBAAuB,EAE1B,MAAM,wCAAwC,CAAC;AAGhD,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACpC,uBAAuB,EACvB,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,kBAAkB,GAAG,yBAAyB,GAAG,eAAe,GAAG,OAAO,CACnH,CAAC;AAEF,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAC9D,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACxC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,QAAQ,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAcD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,qBAkIhE"}
1
+ {"version":3,"file":"OwnerTypeaheadDropdown.d.ts","sourceRoot":"","sources":["../../../src/OwnerTypeaheadDropdown/OwnerTypeaheadDropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAKlE,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,OAAO,EAGH,uBAAuB,EAE1B,MAAM,wCAAwC,CAAC;AAGhD,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACpC,uBAAuB,EACvB,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,kBAAkB,GAAG,yBAAyB,GAAG,eAAe,GAAG,OAAO,CACnH,CAAC;AAEF,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAC9D,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,QAAQ,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAcD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,qBA2HhE"}
@@ -27,19 +27,14 @@ function getTypeaheadOptionsFromContacts(contacts, caseContactSsoUsername) {
27
27
  }));
28
28
  }
29
29
  export function OwnerTypeaheadDropdown(props) {
30
- var _a;
31
30
  const { contactSsoUsername, groupContactsAndEmails, options, selected, onSelect, onToggleClosed, onChipRemoved } = props, restProps = __rest(props, ["contactSsoUsername", "groupContactsAndEmails", "options", "selected", "onSelect", "onToggleClosed", "onChipRemoved"]);
32
31
  const selectedTypeaheadOptions = useMemo(() => getTypeaheadOptionsFromContacts(selected, contactSsoUsername), [selected, contactSsoUsername]);
33
32
  const { t } = useTranslation();
34
- const { visibleItems, hasMoreItems: hasMoreItemsLocal, onHandleLoadMore: onHandleLoadMoreLocal, resetVisibleItems, } = useProgressiveLoading(options, PAGE_SIZE);
35
- const useServerPagination = !!props.onHandleLoadMore;
36
- const displayItems = useServerPagination ? options : visibleItems;
37
- const showMore = useServerPagination ? (_a = props.isShowMoreOptionVisible) !== null && _a !== void 0 ? _a : false : hasMoreItemsLocal();
38
- const handleLoadMore = useServerPagination ? props.onHandleLoadMore : onHandleLoadMoreLocal;
33
+ const { visibleItems, hasMoreItems, onHandleLoadMore, resetVisibleItems } = useProgressiveLoading(options, PAGE_SIZE);
39
34
  const typeaheadOptions = useMemo(() => {
40
35
  const contacts = [];
41
36
  const customEmails = [];
42
- for (const option of displayItems) {
37
+ for (const option of visibleItems) {
43
38
  const typeaheadOption = {
44
39
  label: getHydraContactLabel(option.contact),
45
40
  value: option.contact.ssoUsername,
@@ -102,5 +97,5 @@ export function OwnerTypeaheadDropdown(props) {
102
97
  };
103
98
  onSelect([newCustomOption]);
104
99
  };
105
- return (React.createElement(TypeaheadDropdown, Object.assign({ "data-tracking-id": "external-case-contact-selector", selected: selectedTypeaheadOptions, options: typeaheadOptions, onSelect: onSelectContact, onHandleLoadMore: handleLoadMore, isShowMoreOptionVisible: showMore, onToggleClosed: onLocalToggleClosed, onChipRemoved: onLocalChipRemoved, onNew: onLocalNew }, restProps)));
100
+ return (React.createElement(TypeaheadDropdown, Object.assign({ "data-tracking-id": "external-case-contact-selector", selected: selectedTypeaheadOptions, options: typeaheadOptions, onSelect: onSelectContact, onHandleLoadMore: onHandleLoadMore, isShowMoreOptionVisible: hasMoreItems(), onToggleClosed: onLocalToggleClosed, onChipRemoved: onLocalChipRemoved, onNew: onLocalNew }, restProps)));
106
101
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../src/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAoB3B,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,CAAC,MAAM,KAAA,KAAK,IAAI,CAAC;IACrC,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACtE,mBAAmB,CAAC,EAAE,CAAC,MAAM,KAAA,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,OAAO,KAAA,KAAK,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAoDD,eAAO,MAAM,eAAe,GAAI,aAAa,MAAM;;;;;;;;;;CAmClD,CAAC;AAyCF,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM;;;CAgB9C,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBA8RvC"}
1
+ {"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../src/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAoB3B,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,CAAC,MAAM,KAAA,KAAK,IAAI,CAAC;IACrC,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACtE,mBAAmB,CAAC,EAAE,CAAC,MAAM,KAAA,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,OAAO,KAAA,KAAK,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAoDD,eAAO,MAAM,eAAe,GAAI,aAAa,MAAM;;;;;;;;;;CAmClD,CAAC;AAqCF,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM;;;CAgB9C,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBA2PvC"}
@@ -107,11 +107,7 @@ const formatNumber = (fullPhoneNumber, localFormat) => {
107
107
  }
108
108
  }
109
109
  const isPatternWithPrefix = (_a = pattern === null || pattern === void 0 ? void 0 : pattern.replace(/\s+/g, '')) === null || _a === void 0 ? void 0 : _a.startsWith(PREFIX);
110
- // TODO: Temporary — return pattern without forcing + prefix for portal phone without country code.
111
- pattern = isPatternWithPrefix ? pattern : pattern;
112
- /* TODO: Revert to previous logic after phone format handling is finalized.
113
110
  pattern = isPatternWithPrefix ? pattern : !isEmpty(isPatternWithPrefix) ? PREFIX + pattern : '';
114
- */
115
111
  return pattern;
116
112
  };
117
113
  // return phoneline and countrycode for any given phone
@@ -144,11 +140,7 @@ export function PhoneInput(props) {
144
140
  const setLocalFormat = (phoneNumber) => {
145
141
  const localPhone = removeAllChars(phoneNumber);
146
142
  if (shouldNotSetCountryCode) {
147
- // TODO: Temporary — portal phone without country code; use mask without + prefix.
148
- return DEFAULT_MASK;
149
- /* TODO: Revert to previous logic after phone format handling is finalized.
150
143
  return DEFAULT_FORMAT; // default format for portal phone without country code
151
- */
152
144
  }
153
145
  let localFormat;
154
146
  const exactCountry = getExactCountry(localPhone);
@@ -177,23 +169,12 @@ export function PhoneInput(props) {
177
169
  const localFormat = setLocalFormat(phone);
178
170
  const _formattedNumber = formatNumber(phone, localFormat);
179
171
  setFormattedNumber(_formattedNumber);
180
- // TODO: Temporary — do not prepend + when shouldNotSetCountryCode is true.
181
- if (!shouldNotSetCountryCode &&
182
- !(phone === null || phone === void 0 ? void 0 : phone.trim().startsWith(PREFIX)) &&
183
- regex.test(phone) &&
184
- !isEqual(phone, '-')) {
172
+ if (!(phone === null || phone === void 0 ? void 0 : phone.trim().startsWith(PREFIX)) && regex.test(phone) && !isEqual(phone, '-')) {
185
173
  onPhoneValueChange(PREFIX + (phone === null || phone === void 0 ? void 0 : phone.trim()));
186
174
  }
187
175
  else {
188
176
  onPhoneValueChange(phone === null || phone === void 0 ? void 0 : phone.slice(0, localFormat === null || localFormat === void 0 ? void 0 : localFormat.length));
189
177
  }
190
- /* TODO: Revert to previous logic after phone format handling is finalized.
191
- if (!phone?.trim().startsWith(PREFIX) && regex.test(phone) && !isEqual(phone, '-')) {
192
- onPhoneValueChange(PREFIX + phone?.trim());
193
- } else {
194
- onPhoneValueChange(phone?.slice(0, localFormat?.length));
195
- }
196
- */
197
178
  };
198
179
  const onCountrySelect = (_event, itemId) => {
199
180
  var _a, _b;
@@ -252,18 +233,10 @@ export function PhoneInput(props) {
252
233
  onPhoneValueChange('');
253
234
  }
254
235
  else {
255
- // TODO: Temporary — strip leading + when shouldNotSetCountryCode is true.
256
- const normalizedPhone = shouldNotSetCountryCode ? (phoneValue === null || phoneValue === void 0 ? void 0 : phoneValue.replace(/^\++/, '')) || '' : phoneValue;
257
- onPhoneValueChange(normalizedPhone);
258
- const localFormat = setLocalFormat(normalizedPhone);
259
- const _formattedNumber = formatNumber(normalizedPhone, localFormat);
260
- setFormattedNumber(_formattedNumber);
261
- /* TODO: Revert to previous logic after phone format handling is finalized.
262
236
  onPhoneValueChange(phoneValue);
263
237
  const localFormat = setLocalFormat(phoneValue);
264
238
  const _formattedNumber = formatNumber(phoneValue, localFormat);
265
239
  setFormattedNumber(_formattedNumber);
266
- */
267
240
  }
268
241
  // eslint-disable-next-line react-hooks/exhaustive-deps
269
242
  }, [phoneValue]);
@@ -278,20 +251,10 @@ export function PhoneInput(props) {
278
251
  else {
279
252
  onCountryCodeChange && onCountryCodeChange(PREFIX + countryCode);
280
253
  }
281
- // TODO: Temporary — strip leading + when shouldNotSetCountryCode is true.
282
- const normalizedPhone = shouldNotSetCountryCode
283
- ? removeAllSpaces((phoneValue === null || phoneValue === void 0 ? void 0 : phoneValue.replace(/^\++/, '')) || '')
284
- : removeAllSpaces(phoneValue);
285
- onPhoneValueChange && onPhoneValueChange(normalizedPhone);
286
- const localFormat = setLocalFormat(normalizedPhone);
287
- const _formattedNumber = formatNumber(normalizedPhone, localFormat);
288
- setFormattedNumber(_formattedNumber);
289
- /* TODO: Revert to previous logic after phone format handling is finalized.
290
254
  onPhoneValueChange && onPhoneValueChange(removeAllSpaces(phoneValue)); // removing trailing and in between spaces
291
255
  const localFormat = setLocalFormat(phoneValue);
292
256
  const _formattedNumber = formatNumber(phoneValue, localFormat);
293
257
  setFormattedNumber(_formattedNumber);
294
- */
295
258
  // eslint-disable-next-line react-hooks/exhaustive-deps
296
259
  }, [shouldNotSetCountryCode]);
297
260
  const toggle = (React.createElement(MenuToggle, { ref: toggleRef, onClick: () => setIsOpen(!isOpen), isExpanded: isOpen, className: "phone-number-select", "data-tracking-id": "case-phone-number-country-code", isDisabled: props.isDisabled, "aria-label": "Country Code" }, iso2 && phoneValue !== '' ? placeholder : t('Country Code')));
@@ -13,7 +13,6 @@ interface IProps {
13
13
  perPage?: number;
14
14
  currentPage?: number;
15
15
  variant: PaginationVariant;
16
- isCompact?: boolean;
17
16
  }
18
17
  export declare function TablePagination(props: IProps): React.JSX.Element;
19
18
  export {};
@@ -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;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAiC5C"}
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;CAC9B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAgC5C"}
@@ -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, isCompact: props.isCompact, titles: {
20
+ return (React.createElement(Pagination, { itemCount: props.itemCount || (data || []).length, widgetId: "pagination-options-menu-top", perPage: perPage, page: currentPage, variant: props.variant, titles: {
21
21
  paginationAriaLabel: props.variant === PaginationVariant.top ? 'Upper pagination' : 'Lower pagination',
22
22
  }, onSetPage: onSetPage, onPerPageSelect: onPerPageSelect }));
23
23
  }
@@ -6,8 +6,7 @@ export interface IAppErrorObj {
6
6
  export interface IAppError {
7
7
  [key: string]: Partial<IAppErrorObj>;
8
8
  }
9
- declare function getDirectErrorMessage(error: any): string;
10
9
  declare function formattedApiErrorMessage(error: any, customMessage?: IAppError, canManageCase?: boolean): string | JSX.Element;
11
10
  declare function errorMessageTitle(error: any, customError?: IAppError, canManageCase?: boolean): string;
12
- export { formattedApiErrorMessage, errorMessageTitle, getDirectErrorMessage };
11
+ export { formattedApiErrorMessage, errorMessageTitle };
13
12
  //# sourceMappingURL=errorMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errorMessage.d.ts","sourceRoot":"","sources":["../../../src/helperFunctions/errorMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAQ7B,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;AAmED,iBAAS,qBAAqB,CAAC,KAAK,KAAA,GAAG,MAAM,CAI5C;AAGD,iBAAS,wBAAwB,CAAC,KAAK,KAAA,EAAE,aAAa,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,GAAG,CAAC,OAAO,CAmDjH;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,qBAAqB,EAAE,CAAC"}
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;AA8DD,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,6 +1,7 @@
1
1
  import './errorMessage.scss';
2
2
  import { Button } from '@patternfly/react-core';
3
3
  import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
4
+ import isEmpty from 'lodash/isEmpty';
4
5
  import React from 'react';
5
6
  import { SupportFeedbackForm } from '../SupportFeedbackForm';
6
7
  const defaultTitle = "Sorry, we're experiencing an error";
@@ -42,15 +43,6 @@ const defaultErrorObj = {
42
43
  " for assistance.")),
43
44
  },
44
45
  };
45
- function getApiErrorMessage(error) {
46
- return [error === null || error === void 0 ? void 0 : error.message, error === null || error === void 0 ? void 0 : error.detailMessage].filter(Boolean).join(' ').trim();
47
- }
48
- // TODO: helper to pass API or status message directly in error popup
49
- function getDirectErrorMessage(error) {
50
- const apiMessage = getApiErrorMessage(error);
51
- const message = (error === null || error === void 0 ? void 0 : error.statusText) || (error === null || error === void 0 ? void 0 : error.responseText) || '';
52
- return apiMessage || message;
53
- }
54
46
  // the error argument need a better typing here. We want to make sure that user is passing an error object and not an error string
55
47
  function formattedApiErrorMessage(error, customMessage, canManageCase) {
56
48
  var _a, _b, _c;
@@ -92,15 +84,9 @@ function formattedApiErrorMessage(error, customMessage, canManageCase) {
92
84
  }
93
85
  // api call error
94
86
  const message = (error === null || error === void 0 ? void 0 : error.statusText) || (error === null || error === void 0 ? void 0 : error.responseText) || '';
95
- // TODO: original logic — showed default when error.message existed
96
- // // error.message -> javascript error
97
- // const isNotProperUXError = isEmpty(message) || message?.length > 200 || error?.message || error?.detailMessage;
98
- // return isNotProperUXError ? defaultErrorMessage : message;
99
- const apiMessage = getApiErrorMessage(error);
100
- if (apiMessage || message) {
101
- return apiMessage || message;
102
- }
103
- return defaultErrorMessage;
87
+ // error.message -> javascript error
88
+ const isNotProperUXError = isEmpty(message) || (message === null || message === void 0 ? void 0 : message.length) > 200 || (error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : error.detailMessage);
89
+ return isNotProperUXError ? defaultErrorMessage : message;
104
90
  }
105
91
  }
106
92
  function errorMessageTitle(error, customError, canManageCase) {
@@ -116,4 +102,4 @@ function errorMessageTitle(error, customError, canManageCase) {
116
102
  }
117
103
  return defaultTitle;
118
104
  }
119
- export { formattedApiErrorMessage, errorMessageTitle, getDirectErrorMessage };
105
+ export { formattedApiErrorMessage, errorMessageTitle };
@@ -1,4 +1,4 @@
1
- export declare function useCopyToClipboard(ref: React.RefObject<HTMLElement>): {
1
+ export declare function useCopyToClipboard(ref: React.RefObject<HTMLInputElement>): {
2
2
  clipboardText: string;
3
3
  copyToClipboard: () => Promise<void>;
4
4
  };
@@ -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,WAAW,CAAC;;;EA6BnE"}
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,gBAAgB,CAAC;;;EA2BxE"}
@@ -14,11 +14,9 @@ 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;
18
17
  if (!ref.current)
19
18
  return;
20
- const el = ref.current;
21
- const textToCopy = el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement ? el.value : (_a = el.textContent) !== null && _a !== void 0 ? _a : '';
19
+ const textToCopy = ref.current.value;
22
20
  try {
23
21
  yield navigator.clipboard.writeText(textToCopy);
24
22
  setClipboardText(t('Copied!'));
@@ -5,7 +5,7 @@ export * from './ErrorBoundary';
5
5
  export * from './ErrorPages';
6
6
  export * from './LoginModal';
7
7
  export * from './Table';
8
- export * from './RichTextEditor';
8
+ export * from './MarkdownEditor';
9
9
  export * from './InlineEdit';
10
10
  export * from './CoverSpinner';
11
11
  export * from './hooks';
@@ -29,7 +29,6 @@ export * from './SubscriptionAbuse';
29
29
  export * from './TermsAndConditions';
30
30
  export * from './TextAreaResizable';
31
31
  export * from './CustomTextInput';
32
- export * from './CustomDatePicker';
33
32
  export * from './PhoneInput';
34
33
  export * from './TagsSelector';
35
34
  export * from './SingleSelectDropdown';
@@ -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,oBAAoB,CAAC;AACnC,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,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
package/lib/esm/index.js CHANGED
@@ -6,7 +6,7 @@ export * from './ErrorBoundary';
6
6
  export * from './ErrorPages';
7
7
  export * from './LoginModal';
8
8
  export * from './Table';
9
- export * from './RichTextEditor';
9
+ export * from './MarkdownEditor';
10
10
  export * from './InlineEdit';
11
11
  export * from './CoverSpinner';
12
12
  export * from './hooks';
@@ -30,9 +30,7 @@ export * from './SubscriptionAbuse';
30
30
  export * from './TermsAndConditions';
31
31
  export * from './TextAreaResizable';
32
32
  export * from './CustomTextInput';
33
- export * from './CustomDatePicker';
34
33
  export * from './PhoneInput';
35
34
  export * from './TagsSelector';
36
35
  export * from './SingleSelectDropdown';
37
36
  export * from './OwnerTypeaheadDropdown';
38
- // dummy change for publish
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/components",
3
- "version": "2.5.213",
3
+ "version": "2.5.222",
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
- "@apollo/client": "^4.1.6",
43
+ "@cee-eng/hydrajs": "4.18.111",
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,21 +55,21 @@
55
55
  "use-deep-compare-effect": "^1.6.1"
56
56
  },
57
57
  "dependencies": {
58
- "@cee-eng/hydrajs": "^4.18.114",
58
+ "@cee-eng/hydrajs": "4.18.111",
59
59
  "@cee-eng/ui-toolkit": "1.1.9",
60
60
  "@patternfly/patternfly": "6.2.1",
61
61
  "@patternfly/react-core": "6.2.1",
62
62
  "@patternfly/react-icons": "6.2.1",
63
63
  "@patternfly/react-table": "6.2.1",
64
+ "@patternfly/react-tokens": "6.2.1",
64
65
  "@rh-support/types": "2.0.26",
65
- "@rh-support/user-permissions": "2.5.160",
66
- "@rh-support/utils": "2.5.141",
66
+ "@rh-support/user-permissions": "2.5.170",
67
+ "@rh-support/utils": "2.5.149",
67
68
  "dompurify": "^2.2.6",
68
69
  "js-worker-search": "^1.4.1",
69
70
  "lazysizes": "^5.3.2",
70
71
  "lodash": "^4.17.21",
71
72
  "mark.js": "^8.11.1",
72
- "quill": "~2.0.3",
73
73
  "react": "18.2.0",
74
74
  "react-dom": "18.2.0",
75
75
  "react-i18next": "15.6.0",
@@ -83,8 +83,6 @@
83
83
  "@types/react-dom": "^18.2.18"
84
84
  },
85
85
  "devDependencies": {
86
- "@patternfly/react-styles": "^6.2.1",
87
- "@patternfly/react-tokens": "^6.2.1",
88
86
  "@testing-library/jest-dom": "^6.2.0",
89
87
  "@testing-library/react": "^14.1.2",
90
88
  "@testing-library/user-event": "^14.5.1",
@@ -103,5 +101,5 @@
103
101
  "defaults and supports es6-module",
104
102
  "maintained node versions"
105
103
  ],
106
- "gitHead": "62d92ed52ff1bf81a6103af96c29e96442da5963"
104
+ "gitHead": "cc1c26280084d477ee0abcec8d46963c8213b783"
107
105
  }
@@ -1,18 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,27 +0,0 @@
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
- }