@laerdal/life-react-components 1.7.0-dev.7.full → 1.7.0-dev.8

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 (78) hide show
  1. package/dist/Chips/ActionChip.cjs +4 -4
  2. package/dist/Chips/ActionChip.cjs.map +1 -1
  3. package/dist/Chips/ActionChip.js +4 -4
  4. package/dist/Chips/ActionChip.js.map +1 -1
  5. package/dist/Chips/ChipStyles.cjs +3 -15
  6. package/dist/Chips/ChipStyles.cjs.map +1 -1
  7. package/dist/Chips/ChipStyles.d.ts +0 -3
  8. package/dist/Chips/ChipStyles.js +2 -5
  9. package/dist/Chips/ChipStyles.js.map +1 -1
  10. package/dist/Chips/ChipTypes.d.ts +6 -18
  11. package/dist/Chips/ChoiceChips.cjs +2 -2
  12. package/dist/Chips/ChoiceChips.cjs.map +1 -1
  13. package/dist/Chips/ChoiceChips.js +2 -2
  14. package/dist/Chips/ChoiceChips.js.map +1 -1
  15. package/dist/Chips/FilterChip.cjs +3 -3
  16. package/dist/Chips/FilterChip.cjs.map +1 -1
  17. package/dist/Chips/FilterChip.js +3 -3
  18. package/dist/Chips/FilterChip.js.map +1 -1
  19. package/dist/Chips/InputChip.cjs +4 -4
  20. package/dist/Chips/InputChip.cjs.map +1 -1
  21. package/dist/Chips/InputChip.js +4 -4
  22. package/dist/Chips/InputChip.js.map +1 -1
  23. package/dist/Chips/index.cjs +1 -1
  24. package/dist/Chips/index.cjs.map +1 -1
  25. package/dist/Chips/index.d.ts +1 -1
  26. package/dist/Chips/index.js +1 -1
  27. package/dist/Chips/index.js.map +1 -1
  28. package/dist/ChipsInput/ChipDropdownInput.cjs +398 -0
  29. package/dist/ChipsInput/ChipDropdownInput.cjs.map +1 -0
  30. package/dist/ChipsInput/ChipDropdownInput.d.ts +22 -0
  31. package/dist/ChipsInput/ChipDropdownInput.js +382 -0
  32. package/dist/ChipsInput/ChipDropdownInput.js.map +1 -0
  33. package/dist/ChipsInput/ChipInput.cjs +141 -0
  34. package/dist/ChipsInput/ChipInput.cjs.map +1 -0
  35. package/dist/{Chips → ChipsInput}/ChipInput.d.ts +1 -4
  36. package/dist/ChipsInput/ChipInput.js +122 -0
  37. package/dist/ChipsInput/ChipInput.js.map +1 -0
  38. package/dist/ChipsInput/ChipInputField.cjs +193 -0
  39. package/dist/ChipsInput/ChipInputField.cjs.map +1 -0
  40. package/dist/ChipsInput/ChipInputField.d.ts +24 -0
  41. package/dist/ChipsInput/ChipInputField.js +158 -0
  42. package/dist/ChipsInput/ChipInputField.js.map +1 -0
  43. package/dist/ChipsInput/ChipInputTypes.cjs +6 -0
  44. package/dist/ChipsInput/ChipInputTypes.cjs.map +1 -0
  45. package/dist/ChipsInput/ChipInputTypes.d.ts +22 -0
  46. package/dist/ChipsInput/ChipInputTypes.js +2 -0
  47. package/dist/ChipsInput/ChipInputTypes.js.map +1 -0
  48. package/dist/ChipsInput/index.cjs +19 -0
  49. package/dist/ChipsInput/index.cjs.map +1 -0
  50. package/dist/ChipsInput/index.d.ts +1 -0
  51. package/dist/ChipsInput/index.js +2 -0
  52. package/dist/ChipsInput/index.js.map +1 -0
  53. package/dist/Dropdown/DropdownContent.cjs +14 -21
  54. package/dist/Dropdown/DropdownContent.cjs.map +1 -1
  55. package/dist/Dropdown/DropdownContent.js +14 -21
  56. package/dist/Dropdown/DropdownContent.js.map +1 -1
  57. package/dist/Dropdown/index.cjs +0 -8
  58. package/dist/Dropdown/index.cjs.map +1 -1
  59. package/dist/Dropdown/index.d.ts +1 -2
  60. package/dist/Dropdown/index.js +1 -2
  61. package/dist/Dropdown/index.js.map +1 -1
  62. package/dist/InputFields/styling.cjs.map +1 -1
  63. package/dist/InputFields/styling.js.map +1 -1
  64. package/dist/index.cjs +14 -0
  65. package/dist/index.cjs.map +1 -1
  66. package/dist/index.d.ts +1 -0
  67. package/dist/index.js +1 -0
  68. package/dist/index.js.map +1 -1
  69. package/package.json +1 -1
  70. package/dist/Chips/ChipInput.cjs +0 -199
  71. package/dist/Chips/ChipInput.cjs.map +0 -1
  72. package/dist/Chips/ChipInput.js +0 -182
  73. package/dist/Chips/ChipInput.js.map +0 -1
  74. package/dist/Dropdown/ChipDropdownInput.cjs +0 -431
  75. package/dist/Dropdown/ChipDropdownInput.cjs.map +0 -1
  76. package/dist/Dropdown/ChipDropdownInput.d.ts +0 -24
  77. package/dist/Dropdown/ChipDropdownInput.js +0 -418
  78. package/dist/Dropdown/ChipDropdownInput.js.map +0 -1
@@ -1,418 +0,0 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
- import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
4
- import _pt from "prop-types";
5
-
6
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
7
-
8
- /**
9
- * Import React libraries.
10
- */
11
- import * as React from 'react';
12
- /**
13
- * Import third-party libraries.
14
- */
15
-
16
- import styled from 'styled-components';
17
- /**
18
- * Import custom components.
19
- */
20
-
21
- import { InputChip } from '../Chips/index';
22
- import { Search, TechnicalWarning } from '../icons/systemicons/SystemIcons';
23
- import { WarningMessage, ErrorMessage } from '../InputFields/styling';
24
- import { COLORS } from '../styles';
25
- /**
26
- * Import custom styles.
27
- */
28
-
29
- import { ChipInputContainer } from '../Chips/ChipStyles';
30
- /**
31
- * Import custom types.
32
- */
33
-
34
- import { Size } from '../types';
35
- import DropdownContent from './DropdownContent';
36
- import { LoadingIndicator } from '../LoadingIndicator';
37
- import { ComponentMStyling, ComponentTextStyle } from '../styles/typography';
38
- import { jsx as _jsx } from "react/jsx-runtime";
39
- import { jsxs as _jsxs } from "react/jsx-runtime";
40
- var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n display: inline-block;\n width: 100%;\n min-width: 344px;\n"])));
41
- var StyledChipInputContainer = styled(ChipInputContainer)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 2px 2px 2px 48px !important;\n min-height: 56px;\n max-height: 176px;\n overflow-y: auto;\n box-shadow: 0px 0px 0px 1px ", ";\n\n .medium {\n margin-right: 8px !important;\n }\n .SearchIcon {\n position: absolute;\n left: 18px;\n top: 18px;\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.invalid {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n &.alreadyInOrganization {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &.empty:hover {\n box-shadow: 0px 0px 0px 2px ", ";\n }\n\n &.inputHasFocus {\n box-shadow: 0px 0px 0px 2px ", ";\n }\n &:hover {\n box-shadow: 0px 0px 0px 2px ", ";\n }\n"])), COLORS.neutral_400, COLORS.primary_100, COLORS.critical_400, COLORS.warning_400, COLORS.primary_600, COLORS.primary_800, COLORS.primary_700);
42
- var ChipInput = styled.input(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 40px;\n width: auto;\n display: inline-flex;\n border: none;\n outline: none;\n margin: 4px;\n\n ", "\n color: ", " !important;\n background-color: inherit;\n"])), ComponentMStyling(ComponentTextStyle.Regular, COLORS.black), COLORS.black);
43
- var Loading = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin: auto 16px auto auto !important;\n height: 20px;\n div {\n height: 20px;\n }\n"])));
44
-
45
- var ChipDropdownInput = function ChipDropdownInput(_ref) {
46
- var list = _ref.list,
47
- onInputChange = _ref.onInputChange,
48
- disableSorting = _ref.disableSorting,
49
- messageOnNoResults = _ref.messageOnNoResults,
50
- values = _ref.values,
51
- inputId = _ref.inputId,
52
- variants = _ref.variants,
53
- placeholder = _ref.placeholder,
54
- validationType = _ref.validationType,
55
- validationMessage = _ref.validationMessage,
56
- onValueChange = _ref.onValueChange,
57
- suggestion = _ref.suggestion,
58
- excludeIcon = _ref.excludeIcon,
59
- loading = _ref.loading,
60
- maxSelectedItems = _ref.maxSelectedItems;
61
-
62
- // Initiate states
63
- var _React$useState = React.useState([]),
64
- _React$useState2 = _slicedToArray(_React$useState, 2),
65
- givenList = _React$useState2[0],
66
- setGivenList = _React$useState2[1];
67
-
68
- var _React$useState3 = React.useState([]),
69
- _React$useState4 = _slicedToArray(_React$useState3, 2),
70
- chips = _React$useState4[0],
71
- setChips = _React$useState4[1];
72
-
73
- var _React$useState5 = React.useState(''),
74
- _React$useState6 = _slicedToArray(_React$useState5, 2),
75
- value = _React$useState6[0],
76
- setValue = _React$useState6[1];
77
-
78
- var _React$useState7 = React.useState(false),
79
- _React$useState8 = _slicedToArray(_React$useState7, 2),
80
- dropdownIsOpen = _React$useState8[0],
81
- setDropdownIsOpen = _React$useState8[1];
82
-
83
- var _React$useState9 = React.useState(),
84
- _React$useState10 = _slicedToArray(_React$useState9, 2),
85
- currentSearchResult = _React$useState10[0],
86
- setCurrentSearchResult = _React$useState10[1];
87
-
88
- var _React$useState11 = React.useState(false),
89
- _React$useState12 = _slicedToArray(_React$useState11, 2),
90
- restartFilter = _React$useState12[0],
91
- setRestartFilter = _React$useState12[1];
92
-
93
- var _React$useState13 = React.useState(null),
94
- _React$useState14 = _slicedToArray(_React$useState13, 2),
95
- focused = _React$useState14[0],
96
- setFocused = _React$useState14[1]; // Initiate refs
97
-
98
-
99
- var chipInput = React.useRef();
100
- var styledFieldRef = React.useRef(null);
101
- /**
102
- * Sets initial values for the chips.
103
- */
104
-
105
- React.useEffect(function () {
106
- // Let's add initial chip values
107
- setChips(values);
108
- }, [values]);
109
- /**
110
- * Convert string[] to List[] if necessary
111
- */
112
-
113
- React.useEffect(function () {
114
- if (typeof list[0] === 'string') {
115
- var newList = list.map(function (e) {
116
- return {
117
- label: e,
118
- value: e
119
- };
120
- });
121
- setGivenList(newList);
122
- } else {
123
- setGivenList(list);
124
- }
125
- }, [list]);
126
-
127
- var addChip = function addChip(newChip) {
128
- // Let's add the chip
129
- setChips([].concat(_toConsumableArray(chips), [newChip]));
130
- onValueChange([].concat(_toConsumableArray(chips), [newChip])); // Let's clear the old value
131
-
132
- chipInput.current.value = '';
133
- setValue('');
134
- };
135
- /**
136
- * Adds a chip to the chip list.
137
- * @param event - Event handler from the key down event.
138
- */
139
-
140
-
141
- var onAddChip = function onAddChip(event) {
142
- // Let's trigger only on enter, comma and space key press
143
- if ((event.keyCode === 13 || event.keyCode === 32 || event.keyCode === 188) && value) {
144
- if (!givenList.find(function (e) {
145
- return e.value === value;
146
- })) {
147
- setValue('');
148
- return;
149
- } // Let's prevent default action - adding new key to the value
150
-
151
-
152
- event.preventDefault();
153
- addChip(value);
154
- }
155
-
156
- if (event.keyCode === 8 && value === '') {
157
- onRemoveChip(chips.length - 1);
158
- }
159
- };
160
- /**
161
- * Removes a specific chip from the chip list.
162
- * @param index - Index of the chip that needs to be removed.
163
- * @param elementToAdd - Element which needs to be added in the deleted element place.
164
- */
165
-
166
-
167
- var onRemoveChip = function onRemoveChip(index, elementToAdd) {
168
- // Let's copy the chips
169
- var newChips = _toConsumableArray(chips); // Let's delete the chip
170
- // If necessary, let's replace it with a different chip
171
-
172
-
173
- if (elementToAdd) {
174
- newChips.splice(index, 1, elementToAdd);
175
- } else {
176
- newChips.splice(index, 1);
177
- } // Let's update the chip list
178
-
179
-
180
- setChips(_toConsumableArray(newChips));
181
- onValueChange(_toConsumableArray(newChips));
182
- };
183
- /**
184
- * Changes a status of the chip to edit.
185
- * @param text - Text of the chip that is being edited.
186
- * @param index - Index of the chip in the array.
187
- */
188
-
189
-
190
- var onEditChip = function onEditChip(text, index) {
191
- // Let's check if we have to add value as a chip (in case we have entered something in the input field)
192
- if (chipInput.current.value !== '') {
193
- // Let's replace the chip
194
- onRemoveChip(index, chipInput.current.value);
195
- } else {
196
- // Let's just remove the chip
197
- onRemoveChip(index);
198
- } // Let's update the text value of input field
199
-
200
-
201
- chipInput.current.value = text;
202
- setValue(text);
203
- };
204
-
205
- React.useEffect(function () {
206
- var options = _toConsumableArray(givenList);
207
-
208
- if (!restartFilter && value !== '') {
209
- options = options.filter(function (option) {
210
- var _option$secondaryLabe;
211
-
212
- return option.label.toUpperCase().indexOf(value.toUpperCase()) !== -1 || option.secondaryLabel && ((_option$secondaryLabe = option.secondaryLabel) === null || _option$secondaryLabe === void 0 ? void 0 : _option$secondaryLabe.toUpperCase().indexOf(value.toUpperCase())) !== -1;
213
- });
214
- }
215
-
216
- if (!disableSorting) {
217
- options = options.sort();
218
- }
219
-
220
- options = options.filter(function (o) {
221
- return !chips.includes(o.value);
222
- });
223
- setCurrentSearchResult(options);
224
- }, [value, givenList, chips]);
225
-
226
- var handleValueUpdate = function handleValueUpdate(values) {
227
- var _chipInput$current;
228
-
229
- setRestartFilter(true);
230
- addChip(values[0]);
231
- chipInput === null || chipInput === void 0 ? void 0 : (_chipInput$current = chipInput.current) === null || _chipInput$current === void 0 ? void 0 : _chipInput$current.focus();
232
- };
233
-
234
- var handleKeyPress = function handleKeyPress(e) {
235
- if (styledFieldRef !== null && styledFieldRef !== void 0 && styledFieldRef.current && styledFieldRef.current.contains(e.target)) {
236
- if (e.keyCode === 13) {
237
- var matches = currentSearchResult === null || currentSearchResult === void 0 ? void 0 : currentSearchResult.filter(function (c) {
238
- return c.value.toLowerCase() === value.toLowerCase();
239
- });
240
-
241
- if ((matches === null || matches === void 0 ? void 0 : matches.length) === 1
242
- /*&& onSelect*/
243
- ) {
244
- addChip(matches[0].value); //onSelect(chips);
245
- } else if (e.target.value === (suggestion === null || suggestion === void 0 ? void 0 : suggestion.label)) {
246
- addChip(e.target.value);
247
- }
248
-
249
- setDropdownIsOpen(!dropdownIsOpen);
250
-
251
- if ((matches === null || matches === void 0 ? void 0 : matches.length) === 0) {
252
- setValue('');
253
- }
254
- } else if (e.keyCode === 40) {
255
- setDropdownIsOpen(!dropdownIsOpen);
256
- }
257
- }
258
- };
259
-
260
- var handleClickOutside = function handleClickOutside(e) {
261
- if (styledFieldRef !== null && styledFieldRef !== void 0 && styledFieldRef.current && !styledFieldRef.current.contains(e.target)) {
262
- if (dropdownIsOpen) {
263
- setDropdownIsOpen(false);
264
-
265
- if (!givenList.find(function (e) {
266
- return e.value === value;
267
- })) {
268
- setValue('');
269
- }
270
- }
271
- }
272
- };
273
-
274
- React.useEffect(function () {
275
- document.addEventListener('keypress', handleKeyPress);
276
- document.addEventListener('click', handleClickOutside);
277
- return function () {
278
- document.removeEventListener('keypress', handleKeyPress);
279
- document.removeEventListener('click', handleClickOutside);
280
- };
281
- });
282
- /**
283
- * Return Chip Input component.
284
- */
285
-
286
- var dropdownItems = [];
287
- if (currentSearchResult) dropdownItems = currentSearchResult.map(function (x) {
288
- return {
289
- value: x.value,
290
- displayLabel: x.label,
291
- noteLabel: x.secondaryLabel
292
- };
293
- });
294
- if (suggestion && !chips.includes(suggestion.value)) dropdownItems = [{
295
- value: suggestion.value,
296
- displayLabel: suggestion.label,
297
- noteLabel: suggestion.secondaryLabel,
298
- suggestion: true
299
- }].concat(_toConsumableArray(dropdownItems));
300
- return /*#__PURE__*/_jsxs(Wrapper, {
301
- children: [/*#__PURE__*/_jsxs(StyledChipInputContainer, {
302
- id: inputId,
303
- onClick: function onClick(e) {
304
- e.stopPropagation();
305
- setDropdownIsOpen(true);
306
- chipInput.current.focus();
307
- },
308
- className: validationType,
309
- ref: styledFieldRef,
310
- children: [/*#__PURE__*/_jsx(Search, {
311
- size: "24px",
312
- className: "SearchIcon"
313
- }), chips === null || chips === void 0 ? void 0 : chips.map(function (chip, index) {
314
- return /*#__PURE__*/_jsx(InputChip, {
315
- icon: givenList.find(function (l) {
316
- return l.value === chip;
317
- }) ? 'User' : undefined,
318
- size: Size.Medium,
319
- variant: variants && variants !== null && variants !== void 0 && variants.length && variants[index] ? variants[index] : 'normal',
320
- text: chip,
321
- onRemove: function onRemove() {
322
- return onRemoveChip(index);
323
- },
324
- onClick: function onClick() {
325
- return onEditChip(chip, index);
326
- }
327
- }, "chip_".concat(index));
328
- }), /*#__PURE__*/_jsx(ChipInput, {
329
- type: "text",
330
- onChange: function onChange(event) {
331
- setValue(event.target.value);
332
- setRestartFilter(false);
333
- setDropdownIsOpen(true);
334
-
335
- if (onInputChange) {
336
- onInputChange(event.target.value || '');
337
- }
338
- },
339
- onKeyDown: function onKeyDown(event) {
340
- onAddChip(event);
341
- },
342
- placeholder: placeholder && (chips === null || chips === void 0 ? void 0 : chips.length) === 0 ? placeholder : '',
343
- onClick: function onClick(e) {
344
- e.stopPropagation();
345
- setDropdownIsOpen(true);
346
- },
347
- onFocus: function onFocus() {
348
- setDropdownIsOpen(true);
349
- },
350
- ref: chipInput
351
- }), loading ? /*#__PURE__*/_jsx(Loading, {
352
- children: /*#__PURE__*/_jsx(LoadingIndicator, {
353
- size: Size.Small,
354
- color: COLORS.neutral_600
355
- })
356
- }) : null]
357
- }), (!maxSelectedItems || maxSelectedItems && chips.length < maxSelectedItems) && /*#__PURE__*/_jsx(DropdownContent, {
358
- customizationProps: {
359
- action: function action() {},
360
- pinTopItem: true,
361
- itemsType: 'normal',
362
- scrollable: true,
363
- actionLabel: '',
364
- multiSelect: false,
365
- onValueUpdate: handleValueUpdate,
366
- items: dropdownItems
367
- },
368
- focused: focused,
369
- setFocused: setFocused,
370
- hideOnClickOutside: false,
371
- selectedValues: [],
372
- messageOnNoResults: messageOnNoResults !== null && messageOnNoResults !== void 0 ? messageOnNoResults : '',
373
- setSelectedValues: function setSelectedValues() {},
374
- isOpen: dropdownIsOpen,
375
- setIsOpen: setDropdownIsOpen,
376
- filter: '',
377
- isButton: false,
378
- id: "".concat(inputId, "_dropdowncontent")
379
- }), validationMessage && validationType === 'warning' ? /*#__PURE__*/_jsxs(WarningMessage, {
380
- children: [/*#__PURE__*/_jsx(TechnicalWarning, {
381
- size: "20px",
382
- color: COLORS.critical_500
383
- }), /*#__PURE__*/_jsx("span", {
384
- children: validationMessage
385
- })]
386
- }) : validationType === 'error' && /*#__PURE__*/_jsxs(ErrorMessage, {
387
- children: [/*#__PURE__*/_jsx(TechnicalWarning, {
388
- size: "20px",
389
- color: COLORS.critical_400
390
- }), /*#__PURE__*/_jsx("span", {
391
- children: validationMessage
392
- })]
393
- })]
394
- });
395
- };
396
-
397
- ChipDropdownInput.propTypes = {
398
- list: _pt.oneOfType([_pt.arrayOf(_pt.shape({
399
- label: _pt.string.isRequired,
400
- secondaryLabel: _pt.string,
401
- value: _pt.string.isRequired
402
- })), _pt.arrayOf(_pt.string)]).isRequired,
403
- onInputChange: _pt.func,
404
- disableSorting: _pt.bool,
405
- messageOnNoResults: _pt.string,
406
- isButton: _pt.bool,
407
- autofilledMessage: _pt.string,
408
- suggestion: _pt.shape({
409
- label: _pt.string.isRequired,
410
- secondaryLabel: _pt.string,
411
- value: _pt.string.isRequired
412
- }),
413
- excludeIcon: _pt.bool,
414
- loading: _pt.bool,
415
- maxSelectedItems: _pt.number
416
- };
417
- export default ChipDropdownInput;
418
- //# sourceMappingURL=ChipDropdownInput.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Dropdown/ChipDropdownInput.tsx"],"names":["React","styled","InputChip","Search","TechnicalWarning","WarningMessage","ErrorMessage","COLORS","ChipInputContainer","Size","DropdownContent","LoadingIndicator","ComponentMStyling","ComponentTextStyle","Wrapper","div","StyledChipInputContainer","neutral_400","primary_100","critical_400","warning_400","primary_600","primary_800","primary_700","ChipInput","input","Regular","black","Loading","ChipDropdownInput","list","onInputChange","disableSorting","messageOnNoResults","values","inputId","variants","placeholder","validationType","validationMessage","onValueChange","suggestion","excludeIcon","loading","maxSelectedItems","useState","givenList","setGivenList","chips","setChips","value","setValue","dropdownIsOpen","setDropdownIsOpen","currentSearchResult","setCurrentSearchResult","restartFilter","setRestartFilter","focused","setFocused","chipInput","useRef","styledFieldRef","useEffect","newList","map","e","label","addChip","newChip","current","onAddChip","event","keyCode","find","preventDefault","onRemoveChip","length","index","elementToAdd","newChips","splice","onEditChip","text","options","filter","option","toUpperCase","indexOf","secondaryLabel","sort","o","includes","handleValueUpdate","focus","handleKeyPress","contains","target","matches","c","toLowerCase","handleClickOutside","document","addEventListener","removeEventListener","dropdownItems","x","displayLabel","noteLabel","stopPropagation","chip","l","undefined","Medium","Small","neutral_600","action","pinTopItem","itemsType","scrollable","actionLabel","multiSelect","onValueUpdate","items","critical_500","isButton","autofilledMessage"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,gBAA1B;AACA,SAASC,MAAT,EAAiBC,gBAAjB,QAA+C,kCAA/C;AACA,SAASC,cAAT,EAAyBC,YAAzB,QAA6C,wBAA7C;AACA,SAASC,MAAT,QAAyC,WAAzC;AAEA;AACA;AACA;;AACA,SAASC,kBAAT,QAAmC,qBAAnC;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,UAArB;AAGA,OAAOC,eAAP,MAA8C,mBAA9C;AACA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,SAASC,iBAAT,EAAiDC,kBAAjD,QAA2E,sBAA3E;;;AAEA,IAAMC,OAAO,GAAGb,MAAM,CAACc,GAAV,6JAAb;AAOA,IAAMC,wBAAwB,GAAGf,MAAM,CAACO,kBAAD,CAAT,guBAKED,MAAM,CAACU,WALT,EAiBNV,MAAM,CAACW,WAjBD,EAqBUX,MAAM,CAACY,YArBjB,EAwBUZ,MAAM,CAACa,WAxBjB,EA4BIb,MAAM,CAACc,WA5BX,EAgCId,MAAM,CAACe,WAhCX,EAmCIf,MAAM,CAACgB,WAnCX,CAA9B;AAuCA,IAAMC,SAAS,GAAGvB,MAAM,CAACwB,KAAV,0PAQXb,iBAAiB,CAACC,kBAAkB,CAACa,OAApB,EAA6BnB,MAAM,CAACoB,KAApC,CARN,EASJpB,MAAM,CAACoB,KATH,CAAf;AAaA,IAAMC,OAAO,GAAG3B,MAAM,CAACc,GAAV,sKAAb;;AA2BA,IAAMc,iBAAkE,GAAG,SAArEA,iBAAqE,OAgB7C;AAAA,MAf5BC,IAe4B,QAf5BA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cAAc,KAAK,OAAnB,iBACE,MAAC,YAAD;AAAA,8BACE,KAAC,gBAAD;AAAkB,QAAA,IAAI,EAAC,MAAvB;AAA8B,QAAA,KAAK,EAAE/B,MAAM,CAACY;AAA5C,QADF,eAEE;AAAA,kBAAOoB;AAAP,QAFF;AAAA,MArFN;AAAA,IADF;AA8FD,CAhSD;;;AAZET,EAAAA,I;AANAqC,IAAAA,K;AACAsB,IAAAA,c;AACAvC,IAAAA,K;;AAKAnB,EAAAA,a;AACAC,EAAAA,c;AACAC,EAAAA,kB;AACA4F,EAAAA,Q;AACAC,EAAAA,iB;AACArF,EAAAA,U;AAZA0B,IAAAA,K;AACAsB,IAAAA,c;AACAvC,IAAAA,K;;AAWAR,EAAAA,W;AACAC,EAAAA,O;AACAC,EAAAA,gB;;AAqSF,eAAef,iBAAf","sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom components.\n */\nimport { InputChip } from '../Chips/index';\nimport { Search, TechnicalWarning, User } from '../icons/systemicons/SystemIcons';\nimport { WarningMessage, ErrorMessage } from '../InputFields/styling';\nimport { COLORS, scrollBarStyling } from '../styles';\n\n/**\n * Import custom styles.\n */\nimport { ChipInputContainer } from '../Chips/ChipStyles';\n\n/**\n * Import custom types.\n */\nimport { Size } from '../types';\nimport { ChipInputProps } from '../Chips/ChipTypes';\n\nimport DropdownContent, { DropdownItem } from './DropdownContent';\nimport { LoadingIndicator } from '../LoadingIndicator';\nimport { ComponentMStyling, ComponentXXSStyling, ComponentTextStyle } from '../styles/typography';\n\nconst Wrapper = styled.div`\n position: relative;\n display: inline-block;\n width: 100%;\n min-width: 344px;\n`;\n\nconst StyledChipInputContainer = styled(ChipInputContainer)`\n padding: 2px 2px 2px 48px !important;\n min-height: 56px;\n max-height: 176px;\n overflow-y: auto;\n box-shadow: 0px 0px 0px 1px ${COLORS.neutral_400};\n\n .medium {\n margin-right: 8px !important;\n }\n .SearchIcon {\n position: absolute;\n left: 18px;\n top: 18px;\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n }\n\n &.invalid {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.critical_400};\n }\n &.alreadyInOrganization {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.warning_400};\n }\n\n &.empty:hover {\n box-shadow: 0px 0px 0px 2px ${COLORS.primary_600};\n }\n\n &.inputHasFocus {\n box-shadow: 0px 0px 0px 2px ${COLORS.primary_800};\n }\n &:hover {\n box-shadow: 0px 0px 0px 2px ${COLORS.primary_700};\n }\n`;\n\nconst ChipInput = styled.input`\n height: 40px;\n width: auto;\n display: inline-flex;\n border: none;\n outline: none;\n margin: 4px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n color: ${COLORS.black} !important;\n background-color: inherit;\n`;\n\nconst Loading = styled.div`\n margin: auto 16px auto auto !important;\n height: 20px;\n div {\n height: 20px;\n }\n`;\n\ninterface List {\n label: string;\n secondaryLabel?: string;\n value: string;\n}\n\ninterface ChipDropdownInputProps extends ChipInputProps {\n list: List[] | string[];\n onInputChange?: (input: string) => void;\n disableSorting?: boolean;\n messageOnNoResults?: string;\n isButton?: boolean;\n autofilledMessage?: string;\n suggestion?: List;\n excludeIcon?: boolean;\n loading?: boolean;\n maxSelectedItems?: number;\n}\n\nconst ChipDropdownInput: React.FunctionComponent<ChipDropdownInputProps> = ({\n list,\n onInputChange,\n disableSorting,\n messageOnNoResults,\n values,\n inputId,\n variants,\n placeholder,\n validationType,\n validationMessage,\n onValueChange,\n suggestion,\n excludeIcon,\n loading,\n maxSelectedItems,\n}: ChipDropdownInputProps) => {\n // Initiate states\n const [givenList, setGivenList] = React.useState<List[]>([]);\n const [chips, setChips] = React.useState<string[]>([]);\n const [value, setValue] = React.useState<string>('');\n const [dropdownIsOpen, setDropdownIsOpen] = React.useState<boolean>(false);\n const [currentSearchResult, setCurrentSearchResult] = React.useState<List[]>();\n const [restartFilter, setRestartFilter] = React.useState<boolean>(false);\n const [focused, setFocused] = React.useState<number | null>(null);\n\n // Initiate refs\n const chipInput = React.useRef<any>();\n const styledFieldRef = React.useRef<HTMLDivElement>(null);\n\n /**\n * Sets initial values for the chips.\n */\n React.useEffect(() => {\n // Let's add initial chip values\n setChips(values);\n }, [values]);\n\n /**\n * Convert string[] to List[] if necessary\n */\n React.useEffect(() => {\n if (typeof list[0] === 'string') {\n const newList: List[] = (list as string[]).map((e: string) => ({ label: e, value: e }));\n setGivenList(newList);\n } else {\n setGivenList(list as List[]);\n }\n }, [list]);\n\n const addChip = (newChip: string) => {\n // Let's add the chip\n setChips([...chips, newChip]);\n onValueChange([...chips, newChip]);\n\n // Let's clear the old value\n chipInput.current.value = '';\n setValue('');\n };\n\n /**\n * Adds a chip to the chip list.\n * @param event - Event handler from the key down event.\n */\n const onAddChip = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n // Let's trigger only on enter, comma and space key press\n if ((event.keyCode === 13 || event.keyCode === 32 || event.keyCode === 188) && value) {\n if (!givenList.find((e) => e.value === value)) {\n setValue('');\n return;\n }\n // Let's prevent default action - adding new key to the value\n event.preventDefault();\n\n addChip(value);\n }\n if (event.keyCode === 8 && value === '') {\n onRemoveChip(chips.length - 1);\n }\n };\n\n /**\n * Removes a specific chip from the chip list.\n * @param index - Index of the chip that needs to be removed.\n * @param elementToAdd - Element which needs to be added in the deleted element place.\n */\n const onRemoveChip = (index: number, elementToAdd?: string): void => {\n // Let's copy the chips\n const newChips = [...chips];\n\n // Let's delete the chip\n // If necessary, let's replace it with a different chip\n if (elementToAdd) {\n newChips.splice(index, 1, elementToAdd);\n } else {\n newChips.splice(index, 1);\n }\n\n // Let's update the chip list\n setChips([...newChips]);\n onValueChange([...newChips]);\n };\n\n /**\n * Changes a status of the chip to edit.\n * @param text - Text of the chip that is being edited.\n * @param index - Index of the chip in the array.\n */\n const onEditChip = (text: string, index: number): void => {\n // Let's check if we have to add value as a chip (in case we have entered something in the input field)\n if (chipInput.current.value !== '') {\n // Let's replace the chip\n onRemoveChip(index, chipInput.current.value);\n } else {\n // Let's just remove the chip\n onRemoveChip(index);\n }\n\n // Let's update the text value of input field\n chipInput.current.value = text;\n setValue(text);\n };\n\n React.useEffect(() => {\n let options = [...givenList];\n if (!restartFilter && value !== '') {\n options = options.filter((option) => option.label.toUpperCase().indexOf(value.toUpperCase()) !== -1 ||\n (option.secondaryLabel && option.secondaryLabel?.toUpperCase().indexOf(value.toUpperCase()) !== -1));\n }\n if (!disableSorting) {\n options = options.sort();\n }\n options = options.filter((o) => !chips.includes(o.value));\n setCurrentSearchResult(options);\n }, [value, givenList, chips]);\n\n const handleValueUpdate = (values: string[]) => {\n setRestartFilter(true);\n addChip(values[0]);\n chipInput?.current?.focus();\n }\n\n const handleKeyPress = (e: any) => {\n if (styledFieldRef?.current && styledFieldRef.current.contains(e.target)) {\n if (e.keyCode === 13) {\n const matches = currentSearchResult?.filter((c) => c.value.toLowerCase() === value.toLowerCase());\n if (matches?.length === 1 /*&& onSelect*/) {\n addChip(matches[0].value);\n //onSelect(chips);\n } else if (e.target.value === suggestion?.label) {\n addChip(e.target.value);\n }\n\n setDropdownIsOpen(!dropdownIsOpen);\n if (matches?.length === 0) {\n setValue('');\n }\n } else if (e.keyCode === 40) {\n setDropdownIsOpen(!dropdownIsOpen);\n }\n }\n };\n\n const handleClickOutside = (e: any) => {\n if (styledFieldRef?.current && !styledFieldRef.current.contains(e.target)) {\n if (dropdownIsOpen) {\n setDropdownIsOpen(false);\n if (!givenList.find((e) => e.value === value)) {\n setValue('');\n }\n }\n }\n };\n\n React.useEffect(() => {\n document.addEventListener('keypress', handleKeyPress);\n document.addEventListener('click', handleClickOutside);\n return () => {\n document.removeEventListener('keypress', handleKeyPress);\n document.removeEventListener('click', handleClickOutside);\n };\n });\n\n /**\n * Return Chip Input component.\n */\n\n let dropdownItems: DropdownItem[] = [];\n if(currentSearchResult)\n dropdownItems = currentSearchResult.map(x => ({ value: x.value, displayLabel: x.label, noteLabel: x.secondaryLabel }));\n \n if(suggestion && !chips.includes(suggestion.value))\n dropdownItems = [{ value: suggestion.value, displayLabel: suggestion.label, noteLabel: suggestion.secondaryLabel, suggestion: true }, ...dropdownItems];\n\n return (\n <Wrapper>\n <StyledChipInputContainer\n id={inputId}\n onClick={(e: any) => {\n e.stopPropagation();\n setDropdownIsOpen(true);\n chipInput.current.focus();\n }}\n className={validationType}\n ref={styledFieldRef}>\n <Search size=\"24px\" className=\"SearchIcon\" />\n {chips?.map((chip: string, index: number) => (\n <InputChip\n icon={givenList.find((l: List) => l.value === chip) ? 'User' : undefined}\n size={Size.Medium}\n variant={variants && variants?.length && variants[index] ? variants[index] : 'normal'}\n text={chip}\n onRemove={() => onRemoveChip(index)}\n onClick={() => onEditChip(chip, index)}\n key={`chip_${index}`}></InputChip>\n ))}\n\n <ChipInput\n type=\"text\"\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n setValue(event.target.value);\n setRestartFilter(false);\n setDropdownIsOpen(true);\n if (onInputChange) {\n onInputChange(event.target.value || '');\n }\n }}\n onKeyDown={(event: React.KeyboardEvent<HTMLInputElement>) => {\n onAddChip(event);\n }}\n placeholder={placeholder && chips?.length === 0 ? placeholder : ''}\n onClick={(e: any) => {\n e.stopPropagation();\n setDropdownIsOpen(true);\n }}\n onFocus={() => {\n setDropdownIsOpen(true);\n }}\n ref={chipInput}\n />\n {loading ? (\n <Loading>\n <LoadingIndicator size={Size.Small} color={COLORS.neutral_600} />\n </Loading>\n ) : null}\n </StyledChipInputContainer>\n {(!maxSelectedItems || (maxSelectedItems && chips.length < maxSelectedItems)) && (\n <DropdownContent \n customizationProps={{\n action: () => {},\n pinTopItem: true,\n \n itemsType: 'normal',\n scrollable: true,\n actionLabel: '',\n multiSelect: false,\n onValueUpdate: handleValueUpdate,\n items: dropdownItems\n }}\n focused={focused}\n setFocused={setFocused}\n hideOnClickOutside={false}\n selectedValues={[]}\n messageOnNoResults={messageOnNoResults ?? ''}\n setSelectedValues={() => {}}\n isOpen={dropdownIsOpen}\n setIsOpen={setDropdownIsOpen}\n filter={''}\n isButton={false} \n id={`${inputId}_dropdowncontent`} />\n )}\n\n {/* If there is an error, let's render the error */}\n {validationMessage && validationType === 'warning' ? (\n <WarningMessage>\n <TechnicalWarning size=\"20px\" color={COLORS.critical_500} />\n <span>{validationMessage}</span>\n </WarningMessage>\n ) : (\n validationType === 'error' && (\n <ErrorMessage>\n <TechnicalWarning size=\"20px\" color={COLORS.critical_400} />\n <span>{validationMessage}</span>\n </ErrorMessage>\n )\n )}\n </Wrapper>\n );\n};\n\nexport default ChipDropdownInput;\n"],"file":"ChipDropdownInput.js"}