dropdowns-js 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,38 +6,20 @@ Searchable dropdown components for React applications.
6
6
  - DropdownObj - a single selection dropdown whose underlying data is an array of objects.
7
7
  - MultiSelectionDropdown - a multi-selection dropdown whose underlying data is a primitive array.
8
8
  - MultiSelectionDropdownObj - a multi-selection dropdown whose underlying data is an array of objects.
9
+ The components sort the data provided to them.
9
10
 
10
11
  ## Installation
11
12
  ```
12
13
  npm install dropdowns-js
13
14
  ```
14
-
15
- ## 1. Wrap your Component
16
- All components must be separately wrapped in the CollectionsProvider to manage the dropdown states.
17
-
18
- ```
19
- // App.jsx
20
- import { CollectionsProvider } from "dropdowns-js";
21
- import MyComponent from "./MyComponent";
22
15
 
23
- function App() {
24
- return (
25
- <CollectionsProvider>
26
- <MyComponent />
27
- </CollectionsProvider>
28
- );
29
- }
30
- export default App;
31
- ```
32
-
33
- ## 2. Import styles and hook
16
+ ## 1. Imports
34
17
  Inside your component, where you use any of the dropdowns, import as follows:
35
18
 
36
19
  ```
37
20
  // File: MyComponent.jsx
38
21
  import "dropdowns-js/style.css"; // Must not be left out, so as to enforce dropdown styling.
39
22
  import {
40
- useCollectionsContext,
41
23
  Dropdown, // If you use it.
42
24
  DropdownObj, // If you use it.
43
25
  MultiselectionDropdown, // If you use it.
@@ -45,88 +27,51 @@ import {
45
27
  } from "dropdowns-js";
46
28
 
47
29
  export default function MyComponent {
48
- // Inside your component.
49
- const {
50
- addCollection, // A must. For pre-populating your dropdown
51
- collectionExists, // A must. To be called prior to adding a collection.
52
- getCollectionData, // Depends
53
- updateCollection, // Depends on whether the collection's data gets updated.
54
- setSelected, // Depends. Use-case: pre-populated selection.
55
- getSelected // A must. For obtaining selected items.
56
- } = useCollectionsContext();
57
-
58
30
  // ...
59
31
  }
60
32
  ```
61
- **Context functions**
62
- `addCollection(collectionName, anArray, maxNumSelections = null, primitiveType = true, ...sortFields)`
63
- Add a new collection of data to be displayed in a dropdown for selection.
64
-
65
-
66
- `collectionExists(collectionName)`
67
- Check (true/false) whether the collection with the specified name exists.
68
-
69
- `updateCollection(collectionName, anArray)`
70
- Update the specified collection with new data. An error is thrown for a non-existent collection name. A dropdown whose data is updated must be given a key attribute, and the key value must be updated to cause a re-render with new data.
71
-
72
- `getCollectionData(collectionName)`
73
- Get the data (array) of the specified collection. An error is thrown for a non-existent collection name.
74
-
75
- `setSelected(collectionName, selectedItemsArray)`
76
- Set the selected items in the specified collection. They are ignored if they were are part of the collection. An error is thrown for a non-existent collection name.
77
-
78
- `getSelected(collectionName)`
79
- Get the selected items (array) of the specified collection. An error is thrown for a non-existent collection name is specified.
80
-
81
- `getMaxNumSelections(collectionName)`
82
- Get the maximum number of items that can be selected on this collection. An error is thrown for a non-existent collection name is specified.
83
33
 
84
34
  ## 3. Dropdown Component Attributes
85
- `label` - to be used for aria-label.
35
+ `label` - the name of the data to be displayed displayed in the dropdown. e.g. Cars, Users.
86
36
 
87
37
  `isDisabled` - disables the component when set to true. Default = false.
88
38
 
89
- `collectionName` - name of the collection to populate the dropdown.
39
+ `data` - data to display in the dropdown, for the user to select from.
40
+
41
+ `sortDirection` - for dropdowns using primitive type array input. Specifies the sort order of the dropdown data. 'asc' or 'desc'. Default is 'asc'.
42
+
43
+ `sortFields` - for dropdonws using object type array input. An array. Specifies the field sort orders of the dropdown data. e.g. ['score desc', 'numGames asc']. If a field is to be sorted ascending order, you can ommit asc. .e.g. ['fullName', 'score desc'].
44
+
45
+ `displayName` - for dropdowns using object type array input. The field (name) by which the dropdown items will be displayed.
46
+
47
+ `valueName` - for dropdowns using object type array input. The name of the field that will be used as the underlying unique value of each dropdown item. e.g. 'code', 'id'.
48
+
49
+ `selectedData` - for multi-selection dropdowns. An array of pre-set selection of options. This is an array of multi-selection dropdowns. Optional.
50
+
51
+ `selected` - for single selection dropdowns. A pre-set selected option.
90
52
 
91
- `dropdownStyle` - for providing styling the dropdown. Fields: {color, backgroundColor, borderColor (optional)}.
53
+ `onItemSelected` - for single selection dropdowns. A function to call when the user has made a selection.
92
54
 
93
- `buttonStyle` - for providing styling the DONE button (pressed after completing selection in multi-selection dropdowns). Fields: {color, backgroundColor}.
55
+ `onItemsSelected` - for multi-selection dropdowns. A function to call when the user has made a selection. Or removed items from their selection.
94
56
 
95
- `onItemSelected` - a providing a method to execute on selection of items.
57
+ `dropdownStyle` - CSS styling for the dropdown. Fields: {color, backgroundColor, borderColor (optional)}.
58
+
59
+ `buttonStyle` - for multi-selecton dropdowns. CSS styling for the DONE button (pressed after completing a selection). Fields: {color, backgroundColor}.
96
60
 
97
61
  ## 4. Dropdown usage example
98
62
  This dropdown is to be used when the underlying data is a primitive type array.
99
63
  ```
100
- import { Dropdown, useCollectionsContext } from 'dropdowns-js';
64
+ import { Dropdown } from 'dropdowns-js';
101
65
  import 'dropdowns-js/style.css'; // styles must be imported, otherwise the dropdowns do not display properly.
102
- import { useEffect, useState } from 'react';
66
+ import { useState } from 'react';
103
67
 
104
68
  export default function MyComponent() {
105
69
  const [output, setOutput] = useState('');
106
-
107
- const {
108
- addCollection,
109
- collectionExists,
110
- getSelected
111
- } = useCollectionsContext();
112
-
113
- useEffect(()=> {
114
- if (!collectionExists("FRUITS")) {
115
- const fruits = ["APPLE", "BANANA" "ORANGE", "NAARJIE", "PEACH"]
116
- // Create an APPLES collection
117
- addCollection("FRUITS", // collection name
118
- fruits, // collection data
119
- 1, // Maximum number of allowed selections.
120
- true, // true = primitive type (string) data collection
121
- 'asc'); // sort order
122
- }
123
- }, []);
70
+ const fruits = [ "BANANA" "ORANGE", "NAARJIE", "PEACH", "APPLE" ];
124
71
 
125
72
  /**Respond when the user has chosen a fruit */
126
- function fruitSelected() {
127
- // Obtain the selected items. Only 1 selection was made (size 1 array)
128
- const selectedFruit = getSelected("FRUITS")[0];
129
- setOutput(selectedFruit);
73
+ function fruitSelected(selFruit) {
74
+ setOutput(selFruit);
130
75
  }
131
76
 
132
77
  return (
@@ -136,9 +81,13 @@ export default function MyComponent() {
136
81
  <div style={{padding: '2px', display: 'flex'}}>
137
82
  <label htmlFor='fruits' style={{width: '70px'}}>Fruit</label>
138
83
 
139
- <Dropdown id='fruits' label={'Fruits'} collectionName={'FRUITS'}
140
- onItemSelected={fruitSelected}
141
- dropdownStyle={{color: '#000', backgroundColor: '#66ff66'}} />
84
+ <Dropdown
85
+ label={'Fruits'}
86
+ data={fruits} sortDirection='asc'
87
+ onItemSelected={fruitSelected}
88
+ selected={"BANANA"}
89
+ dropdownStyle={{color: '#000', backgroundColor: '#66ff66'}}
90
+ />
142
91
 
143
92
  </div>
144
93
  <p>{output}</p>
@@ -149,47 +98,27 @@ export default function MyComponent() {
149
98
  ```
150
99
  ## 5. DropdownObj usage example
151
100
  ```
152
- import { DropdownObj, useCollectionsContext } from 'dropdowns-js';
101
+ import { DropdownObj } from 'dropdowns-js';
153
102
  import 'dropdowns-js/style.css'; // Not to be left out.
154
103
 
155
- import { useEffect, useState } from 'react';
104
+ import { useState } from 'react';
156
105
 
157
106
  export default function MyComponent2() {
158
107
  const [output, setOutput] = useState('');
159
- const [aKey, setAKey] = useState(0);
160
- const {
161
- addCollection,
162
- collectionExists,
163
- updateCollection,
164
- getSelected
165
- } = useCollectionsContext();
166
-
167
- useEffect(()=> {
168
- if (!collectionExists("DRIVING_CODES")) {
169
- // Create a DRIVING_CODES collection, sorted by description ascending
170
- const drivingCodes = [
171
- { code: 'A1', description: 'Light Motorcycles' },
172
- { code: 'A', description: 'Heavy Motorcycles' },
173
- { code: 'B', description: 'Light Vehicles' },
174
- { code: 'EB', description: 'Light Articulated' },
175
- { code: 'C1', description: 'Heavy Vehicles' },
176
- { code: 'C', description: 'Extra Heavy Vehicles' },
177
- { code: 'EC1', description: 'Heavy Articulated' },
178
- { code: 'EC', description: 'Extra Heavy Articulated' }
179
- ];
180
- addCollection("DRIVING_CODES", // collection name
181
- drivingCodes, // collection data
182
- 1, // allow maximum 1 selection
183
- false, // non-primitive type, that is, object type data collection
184
- 'description asc'); // sort order
185
- }
186
- }, []);
108
+ const drivingCodes = [
109
+ { code: 'A1', description: 'Light Motorcycles' },
110
+ { code: 'A', description: 'Heavy Motorcycles' },
111
+ { code: 'B', description: 'Light Vehicles' },
112
+ { code: 'EB', description: 'Light Articulated' },
113
+ { code: 'C1', description: 'Heavy Vehicles' },
114
+ { code: 'C', description: 'Extra Heavy Vehicles' },
115
+ { code: 'EC1', description: 'Heavy Articulated' },
116
+ { code: 'EC', description: 'Extra Heavy Articulated' }
117
+ ];
187
118
 
188
119
  /**Respond when the user has chosen a driving code */
189
- function drivingCodeSelected() {
190
- // Obtain the selected items. Only 1 selection was made (size 1 array)
191
- const selectedDrivingCode = [...getSelected(collectionNames.DRIVING_CODES)[0]];
192
- setOutput(`${selectedDrivingCode.code} => ${selectedDrivingCode.description}`);
120
+ function drivingCodeSelected(selDrivingCode) {
121
+ setOutput(`${selDrivingCode.code} => ${selDrivingCode.description}`);
193
122
  }
194
123
 
195
124
  return (
@@ -199,8 +128,13 @@ export default function MyComponent2() {
199
128
  <div style={{padding: '2px', display: 'flex'}}>
200
129
  <label htmlFor='driving-codes' style={{width: '70px'}}>Driving Codes</label>
201
130
 
202
- <DropdownObj id='driving-codes' label='Driving Codes' collectionName={"DRIVING_CODES"}
203
- displayName="description" valueName="code" onItemSelected={drivingCodeSelected}
131
+ <DropdownObj
132
+ label='Driving Codes' data={drivingCodes}
133
+ displayName="description"
134
+ valueName="code"
135
+ sortFields={ ['description'] }
136
+ onItemSelected={drivingCodeSelected}
137
+ selected={drivingCodes[0]}
204
138
  dropdownStyle={{color: '#000', backgroundColor: '#66ff66'}} />
205
139
  </div>
206
140
 
@@ -211,40 +145,22 @@ export default function MyComponent2() {
211
145
  ```
212
146
  ## 6. MultiselectionDropdown usage example
213
147
  ```
214
- import { MultiSelectionDropdown, useCollectionsContext } from 'dropdowns-js';
148
+ import { MultiSelectionDropdown } from 'dropdowns-js';
215
149
  import 'dropdowns-js/style.css';
216
150
 
217
- import { useEffect, useState } from 'react';
151
+ import { useState } from 'react';
218
152
 
219
153
  export default function MyComponent3() {
220
154
  const [output, setOutput] = useState('');
221
- const [aKey, setAKey] = useState(0);
222
- const {
223
- addCollection,
224
- collectionExists,
225
- updateCollection,
226
- getSelected
227
- } = useCollectionsContext();
228
-
229
- useEffect(()=> {
230
- if (!collectionExists("SPORTS")) {
231
- // Create an SPORT collection sorted in ascending order.
232
- const sport = [
233
- "Motor Racing", "Cycling", "Wrestling", "Kung Fu", "Boxing", "Basket Ball",
234
- "Rugby", "Cricket", "Running", "Soccer", "Netball", "Hockey"
235
- ];
236
- addCollection("SPORT", // collection name
237
- sport, // collection data
238
- 4, // maximum number of selections
239
- true, // primitive type data (string in this case)
240
- 'asc'); // asc - sort order
241
- }
242
- }, []);
155
+ const sport = [
156
+ "Motor Racing", "Cycling", "Wrestling", "Kung Fu", "Boxing", "Basket Ball",
157
+ "Rugby", "Cricket", "Running", "Soccer", "Netball", "Hockey"
158
+ ];
243
159
 
244
160
  /**Respond when the user has chosen an interest */
245
- function sportSelected() {
161
+ function sportsSelected(selSports) {
246
162
  // Obtain the selected items.
247
- const selectedSport = getSelected("SPORT").join(", );
163
+ const selectedSport = selSports("SPORT").join(", );
248
164
  setOutput(selectedSport);
249
165
  }
250
166
 
@@ -255,10 +171,10 @@ export default function MyComponent3() {
255
171
  <div style={{padding: '2px', display: 'flex'}}>
256
172
  <label htmlFor='sport' style={{width: '70px'}}>Sport</label>
257
173
 
258
- <MultiSelectionDropdown label='Sport'
259
- id='sport'
260
- collectionName={"SPORT"}
261
- onItemsSelected={sportSelected}
174
+ <MultiSelectionDropdown
175
+ label='Sport'
176
+ data={sport}
177
+ onItemsSelected={sportsSelected}
262
178
  dropdownStyle={{color: '#000', backgroundColor: '#66ff66'}}
263
179
  buttonStyle={{color: '#fff', backgroundColor: '#008000'}} />
264
180
  </div>
@@ -272,58 +188,29 @@ export default function MyComponent3() {
272
188
  ## 7. MultiSelectionDropdownObj usage example
273
189
  ```
274
190
  import 'dropdowns-js/style.css';
275
- import { MultiSelectionDropdownObj, useCollectionsContext } from 'dropdowns-js';
191
+ import { MultiSelectionDropdownObj } from 'dropdowns-js';
276
192
 
277
- import { useEffect, useState } from 'react';
193
+ import { useState } from 'react';
278
194
 
279
195
 
280
196
  export default function MyComponent4() {
281
197
  const [output, setOutput] = useState('');
282
- const [dropdownKey2, setDropdownKey2] = useState(0);
283
- const keyStep = .000001;
284
- const {
285
- addCollection,
286
- collectionExists,
287
- updateCollection,
288
- getSelected
289
- } = useCollectionsContext();
290
-
291
- const collectionNames = {
292
- DRIVING_CODES: "DRIVING_CODES",
293
- DRIVERS: "DRIVERS"
294
- };
295
-
296
- useEffect(()=> {
297
- if (!collectionExists(collectionNames.DRIVING_CODES)) {
298
- // Create DRIVING_CODES collection sorted in ascending order.
299
- // Create a DRIVING_CODES collection, sorted by description ascending
300
- const drivingCodes = [
301
- { code: 'A1', description: 'Light Motorcycles' },
302
- { code: 'A', description: 'Heavy Motorcycles' },
303
- { code: 'B', description: 'Light Vehicles' },
304
- { code: 'EB', description: 'Light Articulated' },
305
- { code: 'C1', description: 'Heavy Vehicles' },
306
- { code: 'C', description: 'Extra Heavy Vehicles' },
307
- { code: 'EC1', description: 'Heavy Articulated' },
308
- { code: 'EC', description: 'Extra Heavy Articulated' }
309
- ];
310
-
311
- addCollection("DRIVING_CODES", // collection name
312
- drivingCodes, // collection data
313
- 3, // maximum number of selections
314
- false, // object type data
315
- 'description asc'); // asc - sort order
316
- }
317
- }, []);
198
+ const drivingCodes = [
199
+ { code: 'A1', description: 'Light Motorcycles' },
200
+ { code: 'A', description: 'Heavy Motorcycles' },
201
+ { code: 'B', description: 'Light Vehicles' },
202
+ { code: 'EB', description: 'Light Articulated' },
203
+ { code: 'C1', description: 'Heavy Vehicles' },
204
+ { code: 'C', description: 'Extra Heavy Vehicles' },
205
+ { code: 'EC1', description: 'Heavy Articulated' },
206
+ { code: 'EC', description: 'Extra Heavy Articulated' }
207
+ ];
318
208
 
319
209
  /**Respond when the user has chosen an interest */
320
- function drivingCodesSelected() {
321
- // Obtain the selected driving codes.
322
- const selectedDrivingCodes = getSelected("DRIVING_CODES");
323
-
210
+ function drivCodesSelected(selDrivCode) {
324
211
  // Create a string array of driving codes.
325
- const strSelectedCodes = selectedDrivingCodes.map((drivingCode)=> drivingCode.code)
326
- .map(drivingCode => drivingCode.code)
212
+ const strSelectedCodes = selDrivCodes.map((drivCode)=> drivCode.code)
213
+ .map(drivCode => drivCode.code)
327
214
  .join(", ");
328
215
  setOutput(strSelectedCodes);
329
216
  }
@@ -335,12 +222,12 @@ export default function MyComponent4() {
335
222
  <div style={{padding: '2px', display: 'flex'}}>
336
223
  <label htmlFor={'driving-licence-codes'} style={{width: '100px'}}>Lic. Codes</label>
337
224
  <MultiSelectionDropdownObj
338
- id='driving-licence-codes'
339
225
  label='Driving Licence Codes'
340
- collectionName='DRIVING_CODES'
226
+ data={drivingCodes}
227
+ sortFields={ ['description'] }
341
228
  valueName='code'
342
229
  displayName='description'
343
- onItemsSelected={drivingCodeSelected}
230
+ onItemsSelected={drivCodeSelected}
344
231
  isDisabled={false}
345
232
  dropdownStyle={{color: '#000', backgroundColor: '#66ff66'}}
346
233
  buttonStyle={{color: '#fff', backgroundColor: '#008000'}} />
@@ -1,10 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),J=require("react");function ke(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var se={exports:{}},ie={exports:{}},U={};var ye;function qe(){if(ye)return U;ye=1;var s=typeof Symbol=="function"&&Symbol.for,r=s?Symbol.for("react.element"):60103,c=s?Symbol.for("react.portal"):60106,a=s?Symbol.for("react.fragment"):60107,y=s?Symbol.for("react.strict_mode"):60108,h=s?Symbol.for("react.profiler"):60114,j=s?Symbol.for("react.provider"):60109,C=s?Symbol.for("react.context"):60110,T=s?Symbol.for("react.async_mode"):60111,l=s?Symbol.for("react.concurrent_mode"):60111,v=s?Symbol.for("react.forward_ref"):60112,m=s?Symbol.for("react.suspense"):60113,q=s?Symbol.for("react.suspense_list"):60120,O=s?Symbol.for("react.memo"):60115,V=s?Symbol.for("react.lazy"):60116,R=s?Symbol.for("react.block"):60121,L=s?Symbol.for("react.fundamental"):60117,B=s?Symbol.for("react.responder"):60118,Q=s?Symbol.for("react.scope"):60119;function N(i){if(typeof i=="object"&&i!==null){var $=i.$$typeof;switch($){case r:switch(i=i.type,i){case T:case l:case a:case h:case y:case m:return i;default:switch(i=i&&i.$$typeof,i){case C:case v:case V:case O:case j:return i;default:return $}}case c:return $}}}function A(i){return N(i)===l}return U.AsyncMode=T,U.ConcurrentMode=l,U.ContextConsumer=C,U.ContextProvider=j,U.Element=r,U.ForwardRef=v,U.Fragment=a,U.Lazy=V,U.Memo=O,U.Portal=c,U.Profiler=h,U.StrictMode=y,U.Suspense=m,U.isAsyncMode=function(i){return A(i)||N(i)===T},U.isConcurrentMode=A,U.isContextConsumer=function(i){return N(i)===C},U.isContextProvider=function(i){return N(i)===j},U.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===r},U.isForwardRef=function(i){return N(i)===v},U.isFragment=function(i){return N(i)===a},U.isLazy=function(i){return N(i)===V},U.isMemo=function(i){return N(i)===O},U.isPortal=function(i){return N(i)===c},U.isProfiler=function(i){return N(i)===h},U.isStrictMode=function(i){return N(i)===y},U.isSuspense=function(i){return N(i)===m},U.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===a||i===l||i===h||i===y||i===m||i===q||typeof i=="object"&&i!==null&&(i.$$typeof===V||i.$$typeof===O||i.$$typeof===j||i.$$typeof===C||i.$$typeof===v||i.$$typeof===L||i.$$typeof===B||i.$$typeof===Q||i.$$typeof===R)},U.typeOf=N,U}var W={};var ge;function Ae(){return ge||(ge=1,process.env.NODE_ENV!=="production"&&(function(){var s=typeof Symbol=="function"&&Symbol.for,r=s?Symbol.for("react.element"):60103,c=s?Symbol.for("react.portal"):60106,a=s?Symbol.for("react.fragment"):60107,y=s?Symbol.for("react.strict_mode"):60108,h=s?Symbol.for("react.profiler"):60114,j=s?Symbol.for("react.provider"):60109,C=s?Symbol.for("react.context"):60110,T=s?Symbol.for("react.async_mode"):60111,l=s?Symbol.for("react.concurrent_mode"):60111,v=s?Symbol.for("react.forward_ref"):60112,m=s?Symbol.for("react.suspense"):60113,q=s?Symbol.for("react.suspense_list"):60120,O=s?Symbol.for("react.memo"):60115,V=s?Symbol.for("react.lazy"):60116,R=s?Symbol.for("react.block"):60121,L=s?Symbol.for("react.fundamental"):60117,B=s?Symbol.for("react.responder"):60118,Q=s?Symbol.for("react.scope"):60119;function N(d){return typeof d=="string"||typeof d=="function"||d===a||d===l||d===h||d===y||d===m||d===q||typeof d=="object"&&d!==null&&(d.$$typeof===V||d.$$typeof===O||d.$$typeof===j||d.$$typeof===C||d.$$typeof===v||d.$$typeof===L||d.$$typeof===B||d.$$typeof===Q||d.$$typeof===R)}function A(d){if(typeof d=="object"&&d!==null){var te=d.$$typeof;switch(te){case r:var oe=d.type;switch(oe){case T:case l:case a:case h:case y:case m:return oe;default:var he=oe&&oe.$$typeof;switch(he){case C:case v:case V:case O:case j:return he;default:return te}}case c:return te}}}var i=T,$=l,K=C,b=j,e=r,o=v,p=a,n=V,f=O,S=c,M=h,G=y,x=m,H=!1;function g(d){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),t(d)||A(d)===T}function t(d){return A(d)===l}function u(d){return A(d)===C}function P(d){return A(d)===j}function D(d){return typeof d=="object"&&d!==null&&d.$$typeof===r}function _(d){return A(d)===v}function z(d){return A(d)===a}function I(d){return A(d)===V}function k(d){return A(d)===O}function F(d){return A(d)===c}function Z(d){return A(d)===h}function Y(d){return A(d)===y}function ee(d){return A(d)===m}W.AsyncMode=i,W.ConcurrentMode=$,W.ContextConsumer=K,W.ContextProvider=b,W.Element=e,W.ForwardRef=o,W.Fragment=p,W.Lazy=n,W.Memo=f,W.Portal=S,W.Profiler=M,W.StrictMode=G,W.Suspense=x,W.isAsyncMode=g,W.isConcurrentMode=t,W.isContextConsumer=u,W.isContextProvider=P,W.isElement=D,W.isForwardRef=_,W.isFragment=z,W.isLazy=I,W.isMemo=k,W.isPortal=F,W.isProfiler=Z,W.isStrictMode=Y,W.isSuspense=ee,W.isValidElementType=N,W.typeOf=A})()),W}var ve;function Te(){return ve||(ve=1,process.env.NODE_ENV==="production"?ie.exports=qe():ie.exports=Ae()),ie.exports}var ae,we;function Le(){if(we)return ae;we=1;var s=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;function a(h){if(h==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(h)}function y(){try{if(!Object.assign)return!1;var h=new String("abc");if(h[5]="de",Object.getOwnPropertyNames(h)[0]==="5")return!1;for(var j={},C=0;C<10;C++)j["_"+String.fromCharCode(C)]=C;var T=Object.getOwnPropertyNames(j).map(function(v){return j[v]});if(T.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(v){l[v]=v}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ae=y()?Object.assign:function(h,j){for(var C,T=a(h),l,v=1;v<arguments.length;v++){C=Object(arguments[v]);for(var m in C)r.call(C,m)&&(T[m]=C[m]);if(s){l=s(C);for(var q=0;q<l.length;q++)c.call(C,l[q])&&(T[l[q]]=C[l[q]])}}return T},ae}var ue,me;function pe(){if(me)return ue;me=1;var s="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ue=s,ue}var ce,be;function Re(){return be||(be=1,ce=Function.call.bind(Object.prototype.hasOwnProperty)),ce}var le,Se;function ze(){if(Se)return le;Se=1;var s=function(){};if(process.env.NODE_ENV!=="production"){var r=pe(),c={},a=Re();s=function(h){var j="Warning: "+h;typeof console<"u"&&console.error(j);try{throw new Error(j)}catch{}}}function y(h,j,C,T,l){if(process.env.NODE_ENV!=="production"){for(var v in h)if(a(h,v)){var m;try{if(typeof h[v]!="function"){var q=Error((T||"React class")+": "+C+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof h[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw q.name="Invariant Violation",q}m=h[v](j,v,T,C,null,r)}catch(V){m=V}if(m&&!(m instanceof Error)&&s((T||"React class")+": type specification of "+C+" `"+v+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof m+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),m instanceof Error&&!(m.message in c)){c[m.message]=!0;var O=l?l():"";s("Failed "+C+" type: "+m.message+(O??""))}}}}return y.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(c={})},le=y,le}var de,xe;function Fe(){if(xe)return de;xe=1;var s=Te(),r=Le(),c=pe(),a=Re(),y=ze(),h=function(){};process.env.NODE_ENV!=="production"&&(h=function(C){var T="Warning: "+C;typeof console<"u"&&console.error(T);try{throw new Error(T)}catch{}});function j(){return null}return de=function(C,T){var l=typeof Symbol=="function"&&Symbol.iterator,v="@@iterator";function m(t){var u=t&&(l&&t[l]||t[v]);if(typeof u=="function")return u}var q="<<anonymous>>",O={array:B("array"),bigint:B("bigint"),bool:B("boolean"),func:B("function"),number:B("number"),object:B("object"),string:B("string"),symbol:B("symbol"),any:Q(),arrayOf:N,element:A(),elementType:i(),instanceOf:$,node:o(),objectOf:b,oneOf:K,oneOfType:e,shape:n,exact:f};function V(t,u){return t===u?t!==0||1/t===1/u:t!==t&&u!==u}function R(t,u){this.message=t,this.data=u&&typeof u=="object"?u:{},this.stack=""}R.prototype=Error.prototype;function L(t){if(process.env.NODE_ENV!=="production")var u={},P=0;function D(z,I,k,F,Z,Y,ee){if(F=F||q,Y=Y||k,ee!==c){if(T){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var te=F+":"+k;!u[te]&&P<3&&(h("You are manually calling a React.PropTypes validation function for the `"+Y+"` prop on `"+F+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),u[te]=!0,P++)}}return I[k]==null?z?I[k]===null?new R("The "+Z+" `"+Y+"` is marked as required "+("in `"+F+"`, but its value is `null`.")):new R("The "+Z+" `"+Y+"` is marked as required in "+("`"+F+"`, but its value is `undefined`.")):null:t(I,k,F,Z,Y)}var _=D.bind(null,!1);return _.isRequired=D.bind(null,!0),_}function B(t){function u(P,D,_,z,I,k){var F=P[D],Z=G(F);if(Z!==t){var Y=x(F);return new R("Invalid "+z+" `"+I+"` of type "+("`"+Y+"` supplied to `"+_+"`, expected ")+("`"+t+"`."),{expectedType:t})}return null}return L(u)}function Q(){return L(j)}function N(t){function u(P,D,_,z,I){if(typeof t!="function")return new R("Property `"+I+"` of component `"+_+"` has invalid PropType notation inside arrayOf.");var k=P[D];if(!Array.isArray(k)){var F=G(k);return new R("Invalid "+z+" `"+I+"` of type "+("`"+F+"` supplied to `"+_+"`, expected an array."))}for(var Z=0;Z<k.length;Z++){var Y=t(k,Z,_,z,I+"["+Z+"]",c);if(Y instanceof Error)return Y}return null}return L(u)}function A(){function t(u,P,D,_,z){var I=u[P];if(!C(I)){var k=G(I);return new R("Invalid "+_+" `"+z+"` of type "+("`"+k+"` supplied to `"+D+"`, expected a single ReactElement."))}return null}return L(t)}function i(){function t(u,P,D,_,z){var I=u[P];if(!s.isValidElementType(I)){var k=G(I);return new R("Invalid "+_+" `"+z+"` of type "+("`"+k+"` supplied to `"+D+"`, expected a single ReactElement type."))}return null}return L(t)}function $(t){function u(P,D,_,z,I){if(!(P[D]instanceof t)){var k=t.name||q,F=g(P[D]);return new R("Invalid "+z+" `"+I+"` of type "+("`"+F+"` supplied to `"+_+"`, expected ")+("instance of `"+k+"`."))}return null}return L(u)}function K(t){if(!Array.isArray(t))return process.env.NODE_ENV!=="production"&&(arguments.length>1?h("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):h("Invalid argument supplied to oneOf, expected an array.")),j;function u(P,D,_,z,I){for(var k=P[D],F=0;F<t.length;F++)if(V(k,t[F]))return null;var Z=JSON.stringify(t,function(ee,d){var te=x(d);return te==="symbol"?String(d):d});return new R("Invalid "+z+" `"+I+"` of value `"+String(k)+"` "+("supplied to `"+_+"`, expected one of "+Z+"."))}return L(u)}function b(t){function u(P,D,_,z,I){if(typeof t!="function")return new R("Property `"+I+"` of component `"+_+"` has invalid PropType notation inside objectOf.");var k=P[D],F=G(k);if(F!=="object")return new R("Invalid "+z+" `"+I+"` of type "+("`"+F+"` supplied to `"+_+"`, expected an object."));for(var Z in k)if(a(k,Z)){var Y=t(k,Z,_,z,I+"."+Z,c);if(Y instanceof Error)return Y}return null}return L(u)}function e(t){if(!Array.isArray(t))return process.env.NODE_ENV!=="production"&&h("Invalid argument supplied to oneOfType, expected an instance of array."),j;for(var u=0;u<t.length;u++){var P=t[u];if(typeof P!="function")return h("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+H(P)+" at index "+u+"."),j}function D(_,z,I,k,F){for(var Z=[],Y=0;Y<t.length;Y++){var ee=t[Y],d=ee(_,z,I,k,F,c);if(d==null)return null;d.data&&a(d.data,"expectedType")&&Z.push(d.data.expectedType)}var te=Z.length>0?", expected one of type ["+Z.join(", ")+"]":"";return new R("Invalid "+k+" `"+F+"` supplied to "+("`"+I+"`"+te+"."))}return L(D)}function o(){function t(u,P,D,_,z){return S(u[P])?null:new R("Invalid "+_+" `"+z+"` supplied to "+("`"+D+"`, expected a ReactNode."))}return L(t)}function p(t,u,P,D,_){return new R((t||"React class")+": "+u+" type `"+P+"."+D+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+_+"`.")}function n(t){function u(P,D,_,z,I){var k=P[D],F=G(k);if(F!=="object")return new R("Invalid "+z+" `"+I+"` of type `"+F+"` "+("supplied to `"+_+"`, expected `object`."));for(var Z in t){var Y=t[Z];if(typeof Y!="function")return p(_,z,I,Z,x(Y));var ee=Y(k,Z,_,z,I+"."+Z,c);if(ee)return ee}return null}return L(u)}function f(t){function u(P,D,_,z,I){var k=P[D],F=G(k);if(F!=="object")return new R("Invalid "+z+" `"+I+"` of type `"+F+"` "+("supplied to `"+_+"`, expected `object`."));var Z=r({},P[D],t);for(var Y in Z){var ee=t[Y];if(a(t,Y)&&typeof ee!="function")return p(_,z,I,Y,x(ee));if(!ee)return new R("Invalid "+z+" `"+I+"` key `"+Y+"` supplied to `"+_+"`.\nBad object: "+JSON.stringify(P[D],null," ")+`
2
- Valid keys: `+JSON.stringify(Object.keys(t),null," "));var d=ee(k,Y,_,z,I+"."+Y,c);if(d)return d}return null}return L(u)}function S(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(S);if(t===null||C(t))return!0;var u=m(t);if(u){var P=u.call(t),D;if(u!==t.entries){for(;!(D=P.next()).done;)if(!S(D.value))return!1}else for(;!(D=P.next()).done;){var _=D.value;if(_&&!S(_[1]))return!1}}else return!1;return!0;default:return!1}}function M(t,u){return t==="symbol"?!0:u?u["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&u instanceof Symbol:!1}function G(t){var u=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":M(u,t)?"symbol":u}function x(t){if(typeof t>"u"||t===null)return""+t;var u=G(t);if(u==="object"){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return u}function H(t){var u=x(t);switch(u){case"array":case"object":return"an "+u;case"boolean":case"date":case"regexp":return"a "+u;default:return u}}function g(t){return!t.constructor||!t.constructor.name?q:t.constructor.name}return O.checkPropTypes=y,O.resetWarningCache=y.resetWarningCache,O.PropTypes=O,O},de}var fe,Ee;function Ye(){if(Ee)return fe;Ee=1;var s=pe();function r(){}function c(){}return c.resetWarningCache=r,fe=function(){function a(j,C,T,l,v,m){if(m!==s){var q=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw q.name="Invariant Violation",q}}a.isRequired=a;function y(){return a}var h={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:y,element:a,elementType:a,instanceOf:y,node:a,objectOf:y,oneOf:y,oneOfType:y,shape:y,exact:y,checkPropTypes:c,resetWarningCache:r};return h.PropTypes=h,h},fe}var Ce;function Ve(){if(Ce)return se.exports;if(Ce=1,process.env.NODE_ENV!=="production"){var s=Te(),r=!0;se.exports=Fe()(s.isElement,r)}else se.exports=Ye()();return se.exports}var Ue=Ve();const w=ke(Ue);var X={},je;function We(){if(je)return X;je=1;function s(e){return e?/^[a-zA-Z][a-zA-Z0-9_-]{2,50}$/.test(e):!1}X.isValidUserName=s;function r(e){return e?/^[A-Za-z' -]{2,50}$/.test(e):!1}X.isValidName=r;function c(e){return e?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e):!1}X.isValidEmail=c;function a(e){return e?/^[0-9]{10,15}$/g.test(e):!1}X.isValidPhoneNum=a;function y(e){return e?/^[a-zA-Z0-9.\-\(\) ]{2,}$/.test(e):!1}X.isValidOrganisationName=y;function h(e){return!(!e||e.length<6||/[A-Z]/.test(e)===!1||/[a-z]/.test(e)===!1||/[0-9]/.test(e)===!1||/[\s]/.test(e)||/[\][!"#$%&'()*+,./:;<=>?@^\\_`{|}~-]/.test(e)===!1)}X.isValidPassword=h;function j(e){let o=e.getFullYear(),p=e.getMonth()+1;p=T(p,2);let n=e.getDate();return n=T(n,2),`${o}-${p}-${n}`}X.timeStampYyyyMmDd=j;function C(e){let o=T(e.getHours(),2),p=T(e.getMinutes(),2),n=T(e.getSeconds(),2),f=T(e.getMilliseconds(),3);return`${j(e)}T${o}:${p}:${n}.${f}`}X.timeStampString=C;function T(e,o){let p=e+"";const n=o-p.length;for(let f=1;f<=n;f++)p="0"+p;return p}X.addLeadingZeros=T;function l(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"ZAR"}).format(e).replace(/ZAR/gi,"R")}X.toZarCurrencyFormat=l;function v(e){if(Object.prototype.toString.call(e)!=="[object Object]")return e instanceof Date?new Date(e):(["string","number","boolean"].includes(typeof e),e);const o=[{...e}];let p=0;for(;p<o.length;){let n=o[p];if(Object.prototype.toString.call(n)==="[object Object]")for(let f in n)n[f]instanceof Date&&(n[f]=new Date(n[f])),o.push(n[f]);p++}return o[0]}X.deepClone=v;function m(e){const o=[{value:e}];let p=0;for(;p<o.length;){const n=o[p];if(Object.prototype.toString.call(n.value)==="[object Object]"){for(const f in n.value){let S=n.path?n.path+"."+f:f;o.push({value:n.value[f],path:S})}n.remove=!0}p++}return o.filter(n=>!n.remove).map(n=>n.path)}X.getPaths=m;function q(e){let o=v(e),p=0;const n=m(o).toSorted();sortedObj={};for(p in n){const f=n[p],S=O(o,f);V(sortedObj,f,S)}return sortedObj}X.getSortedObject=q;function O(e,o,p=void 0){let n=o.split("."),f=e;for(let S in n){let M=n[S];if(f=f[M],!f)return p}return f}X.get=O;function V(e,o,p){let n=e,f=o.split(".");for(let S in f){let M=f[S];S<f.length-1?(M in n||(n[M]={}),n=n[M]):n[M]=p}}X.set=V;function R(e,o){let p=o.split("."),n=e;for(let f in p){let S=p[f];if(!n)return;f<p.length-1?n=n[S]:delete n[S]}}X.unset=R;function L(e,...o){if(!o||!o.length)throw new Error("fields must be specified");const p=m(e);let n=0;for(const f in p){const S=p[f];if(o.includes(S))n++;else return!1}return n>0}X.hasOnly=L;function B(e,...o){if(!o||!o.length)throw new Error("fields must be specified");const p=m(e);let n=0;for(const f in o){const S=o[f];if(p.includes(S))n++;else return!1}return n===o.length}X.hasAll=B;function Q(e,...o){return L(e,...o)&&B(e,...o)}X.hasOnlyAll=Q;function N(e,o,p=0,n="asc"){const f=["asc","desc"];if(!["asc","desc"].includes(n))throw new Error(`arraySortDir must be one of ${f}`);if(e.length===0)return-1;let S=p,M=e.length-1;for(;S<M;){if(A(e[S],o)===0)return S;if(A(e[M],o)===0)return M;const G=Math.trunc((S+M)/2),x=A(e[G],o,n);if(x<0)S=G+1;else if(x>0)M=G-1;else return G}return S}X.binarySearch=N;function A(e,o,p="asc"){if(!["asc","desc"].includes(p))throw new Error(`sortDir must be one of ${p}`);const n=p==="desc"?-1:1;return e>o?n:e<o?-n:0}X.compare=A;function i(e,o,p=0,...n){if(e.length===0)return-1;let f=p,S=e.length-1;for(;f<S;){if(b(e[f],o,...n)===0)return f;if(b(e[S],o,...n)===0)return S;let M=Math.trunc((f+S)/2);if(b(e[M],o,...n)<0)f=M+1;else if(b(e[M],o,...n)>0)S=M-1;else return M}return f}X.binarySearchObj=i;function $(e,o,p,...n){let f=p,S=e.length-1;if(f>=e.length)throw new Error("startFrom is outside the bounds of the array.");if(b(o,e[f],...n)>0)throw new Error("targetObj is to the right ('greater than') objArray[startFrom].");for(;f<S;){let M=Math.trunc((f+S)/2);b(o,e[M],...n)===0?f=M+1:b(o,e[M],...n)<0&&(S=M)}return b(o,e[f],...n)===0?-1:f}X.getNextDifferent=$;function K(e,o,...p){if(e.length<=1)return[...e];if(typeof o!="boolean")throw new Error("firstOfDuplicates must be boolean true or false.");const n=[];let f=0;for(;f<e.length-1&&(o&&n.push(e[f]),f=$(e,e[f],f+1,...p),!(f<0));){let S=f-1;o||n.push(e[S])}return n.length===0?o?n.push(e[0]):n.push(e[e.length-1]):b(n[n.length-1],e[e.length-1],...p)!==0&&n.push(e[e.length-1]),n}X.getObjArrayWithNoDuplicates=K;function b(e,o,...p){if(p.length===0)throw new Error("comparisonFields not supplied!");const n=["","asc","desc"];for(const f in p){const S=p[f].split(" "),M=S[0];let G="";if(S.length===2&&(G=S[1]),!n.includes(G))throw new Error("Sort direction must be one of "+n.toString());const x=O(e,M),H=O(o,M),g=G==="desc"?-1:1;if(x>H)return g;if(x<H)return-g}return 0}return X.objCompare=b,X}var re=We();const Oe=J.createContext();function $e({children:s}){const r=J.useRef({});function c(l,v,m=null,q=!0,...O){if(a(l))throw new Error(`The collection ${l} already exists.`);q?r.current[l]=new Ze(l,v,m,...O):r.current[l]=new Pe(l,v,m,...O)}function a(l){return r.current[l]!==void 0}function y(l,v){if(!a(l))throw new Error(`Collection ${l} not found.`);r.current[l].updateData(v)}function h(l){if(!a(l))throw new Error(`Collection ${l} not found.`);return r.current[l].getData()}function j(l,v){if(!a(l))throw new Error(`Collection ${l} not found.`);r.current[l].setSelectedItems(v)}function C(l){if(!a(l))throw new Error(`Collection ${l} not found.`);return r.current[l].getSelectedItems()}function T(l){if(!a(l))throw new Error(`Collection ${l} not found.`);return r.current[l].getMaxNumSelections()}return E.jsx(Oe.Provider,{value:{addCollection:c,collectionExists:a,getCollectionData:h,updateCollection:y,setSelected:j,getSelected:C,getMaxNumSelections:T},children:s})}$e.propTypes={children:w.element.isRequired};function ne(){return J.useContext(Oe)}class Pe{constructor(r,c,a=null,...y){this.sortFields=y,this.collectionName=r,this.selectedItems=[],this.maxNumSelections=a,this.data=[...c],this.sortData()}sortData(){this.data.sort(this.comparisonFunction)}comparisonFunction=(r,c)=>{if(Object.prototype.toString.call(r)==="[object Object]"&&Object.prototype.toString.call(c)==="[object Object]"){if(this.sortFields.length>0)return re.objCompare(r,c,...this.sortFields)}else{if(this.sortFields.length===1)return re.compare(r,c,this.sortFields[0]);if(this.sortFields.length===0)return re.compare(r,c);throw new Error("Only 1 sort order can be provided for a primitive data type collection.")}return 0};updateData(r){this.data=[...r],this.sortData();let c=null;this.selectedItems=this.selectedItems.filter(a=>this.data.findIndex(y=>(c===null&&(c=re.getPaths(y)),re.objCompare(y,a,...c)===0))>=0),this.selectedItems=this.selectedItems.toSorted(this.comparisonFunction)}setSelectedItems(r){if(this.maxNumSelections!==null&&r.length>this.maxNumSelections)return;let c=re.getPaths(this.data[0]);r=r.filter(a=>this.data.findIndex(y=>re.objCompare(y,a,...c)===0)>=0),this.selectedItems=r.toSorted(this.comparisonFunction)}getData(){return this.data}getSelectedItems(){return this.selectedItems}getCollectionName(){return this.collectionName}getMaxNumSelections(){return this.maxNumSelections}}class Ze extends Pe{constructor(r,c,a=null,...y){super(r,c,a,...y)}comparisonFunction(r,c){return re.compare(r,c,this.sortFields[0])}sortData(r){this.data.sort(this.comparisonFunction)}updateData(r){this.data=[...r],this.sortData(),this.selectedItems=this.selectedItems.filter(c=>this.data.findIndex(a=>a===c)>=0),this.selectedItems=this.selectedItems.toSorted(this.comparisonFunction)}setSelectedItems(r){if(this.maxNumSelections!==null&&r.length>this.maxNumSelections)throw new Error("Selected items exceed the maximum number of allowed selections.");r=r.filter(c=>this.data.findIndex(a=>a===c)>=0),this.selectedItems=r.toSorted(this.comparisonFunction)}}function _e({label:s,collectionName:r,onItemSelected:c=null,dropdownStyle:a,isDisabled:y=!1}){const{getCollectionData:h,setSelected:j,getSelected:C,collectionExists:T}=ne(),[l]=J.useState(()=>{const $={backgroundColor:a?.backgroundColor,color:a?.color};return a?.fontSize&&($.fontSize=a?.fontSize),$}),v=a?.borderColor,[m,q]=J.useState(!1),[O,V]=J.useState(""),[R,L]=J.useState([]);async function B($){V($.target.value);let K=[];K=h(r),K=K.filter(b=>{const e=b.toUpperCase(),o=$.target.value.toUpperCase();return e.includes(o)}),L(K),K.length===0?A():i()}async function Q($){V($),j(r,[$]),c!==null&&c(),A()}function N(){m?A():i()}function A(){q(!1)}function i(){R.length>0&&q(!0)}return J.useEffect(()=>{if(T(r))try{let $;$=h(r),L($);const K=C(r);K.length>0?V(K[0]):V("")}catch{}},[T(r)]),E.jsxs("div",{className:`dropdown-js dropdown-js-rounded
3
- ${v&&`dropdown-js-border ${v}`}`,style:{...y?{pointerEvents:"none"}:{}},children:[E.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:l,children:[E.jsx("input",{className:"dropdown-js-input dropdown-js-rounded",autoComplete:"off",type:"text",id:"searchDropDown",name:"searchDropDown",style:l,"aria-label":`Type to Search for ${s}`,"aria-required":!0,onChange:$=>B($),disabled:y,placeholder:`Type to Search for ${s}`,value:O}),E.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded",onClick:$=>N(),children:E.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:m?"-":"+"})})]}),E.jsx("div",{className:`dropdown-js-padding dropdown-js-menu ${!m&&"dropdown-js-hide"}`,id:"dropDown",name:"dropDown",disabled:y,"aria-label":s,style:{...l,marginTop:"3.5px"},children:R.map(($,K)=>E.jsxs("div",{name:$,"aria-label":$,style:{cursor:"pointer"},onClick:b=>Q($),children:[$,K<R.length-1&&E.jsx("hr",{style:{borderColor:l.color}})]},`${K}#${$}`))})]})}_e.propTypes={label:w.string.isRequired,collectionName:w.string.isRequired,isDisabled:w.bool,onItemSelected:w.func,dropdownStyle:w.shape({color:w.string.isRequired,backgroundColor:w.string.isRequired,fontSize:w.string,borderColor:w.string})};function De({label:s,collectionName:r,displayName:c,valueName:a,onItemSelected:y=null,dropdownStyle:h,isDisabled:j=!1}){const{getCollectionData:C,setSelected:T,getSelected:l,collectionExists:v}=ne(),[m]=J.useState(()=>{const b={backgroundColor:h?.backgroundColor,color:h?.color};return h?.fontSize&&(b.fontSize=h?.fontSize),b}),q=h?.borderColor,[O,V]=J.useState(null),[R,L]=J.useState([]),[B,Q]=J.useState("");async function N(b){Q(b.target.value);let e=C(r);e=e.filter(o=>{const p=o[c].toUpperCase(),n=b.target.value.toUpperCase();return p.includes(n)}),L(e),K()}function A(b){Q(b[c]),T(r,[b]),y!==null&&y(),$()}function i(){O?$():K()}function $(){V(!1)}function K(){R.length>0&&V(!0)}return J.useEffect(()=>{if(!v(r))return;if(!c)throw new Error("displayName must be provided");if(!a)throw new Error("valueName must be provided");let b=[...C(r)];b.forEach((e,o)=>{if(!e[c])throw new Error(`Error in collection ${r}, index ${o}:
4
- field ${c} found`);if(!e[a])throw new Error(`Error in collection ${r}, index ${o}:
5
- field ${a} not found`)}),L(b),b=l(r),b.length>0?Q(b[0][c]):Q("")},[v(r)]),E.jsxs("div",{className:`dropdown-js dropdown-js-rounded
6
- ${q&&`dropdown-js-border ${q}`}`,style:{...j?{pointerEvents:"none"}:{}},children:[E.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:m,children:[E.jsx("input",{className:"dropdown-js-input dropdown-js-rounded",style:m,type:"text",id:"searchDropDown",name:"searchDropDown",autoComplete:"off","aria-label":`Type to Search for ${s}`,"aria-required":!0,onChange:b=>N(b),disabled:j,placeholder:`Type to Search for ${s}`,value:B}),E.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded",onClick:b=>i(),children:E.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:O?"-":"+"})})]}),E.jsx("div",{className:`dropdown-js-padding dropdown-js-menu ${!O&&"dropdown-js-hide"}`,id:"dropDown",name:"dropDown","aria-label":s,style:{...m,marginTop:"3.5px"},children:R.map((b,e)=>E.jsxs("div",{name:b[c],"aria-label":b[c],style:{cursor:"pointer"},onClick:o=>A(b),children:[b[c],e<R.length-1&&E.jsx("hr",{style:{borderColor:m.color}})]},b[a]))})]})}De.propTypes={collectionName:w.string.isRequired,label:w.string.isRequired,isDisabled:w.bool,onItemSelected:w.func,dropdownStyle:w.shape({color:w.string.isRequired,backgroundColor:w.string.isRequired,fontSize:w.string,borderColor:w.string})};function Ie({label:s,collectionName:r,displayName:c,valueName:a,isDisabled:y=!1,onItemsSelected:h=null,dropdownStyle:j,buttonStyle:C}){const{collectionExists:T,getCollectionData:l,setSelected:v,getSelected:m,getMaxNumSelections:q}=ne(),[O,V]=J.useState(!1),[R,L]=J.useState([]),[B,Q]=J.useState([]),[N,A]=J.useState(""),[i,$]=J.useState(Math.random()),[K,b]=J.useState(Math.random),e=1e-12,[o]=J.useState(()=>{const g={backgroundColor:j?.backgroundColor,color:j?.color};return j?.fontSize&&(g.fontSize=j?.fontSize),g}),p=j?.borderColor;J.useEffect(()=>{if(!T(r))return;if(!c)throw new Error("displayName must be provided");if(!a)throw new Error("valueName must be provided");const g=[...l(r)];g.forEach((u,P)=>{if(!u[c])throw new Error(`Error in collection ${r}, index ${P}:
7
- field ${c} found`);if(!u[a])throw new Error(`Error in collection ${r}, index ${P}:
8
- field ${a} not found`)}),L(g);const t=[...m(r)];Q(t)},[T(r)]);function n(g){A(g.target.value);const t=[...l(r).filter(u=>{const P=u[c].toUpperCase(),D=g.target.value.toUpperCase();return P.includes(D)})];L(t),t.length>0?H():x(),$(i+e)}function f(g){let t=[...B];if(S(g))t=t.filter(u=>JSON.stringify(u)!==JSON.stringify(g));else{const u=q(r);if(u!==null&&B.length>=u)return;t.push(g)}v(r,t),Q(t),b(K+e)}function S(g){return B.findIndex(t=>JSON.stringify(t)===JSON.stringify(g))>=0}function M(g){const t=B.filter(u=>JSON.stringify(u)!==JSON.stringify(g));Q(t),v(r,t),b(K+e),h!==null&&h()}function G(){O?x():H()}function x(){V(!1),h!==null&&h()}function H(){R.length>0&&V(!0)}return E.jsxs("div",{className:`dropdown-js dropdown-js-rounded
9
- ${p&&`dropdown-js-border ${p}`}`,style:{...y?{pointerEvents:"none"}:{}},children:[E.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:o,children:[E.jsx("div",{children:E.jsx("input",{className:"dropdown-js-input dropdown-js-rounded",style:o,type:"text",id:"searchDropDown",name:"searchDropDown",autoComplete:"off","aria-label":`Type to Search for ${s}`,"aria-required":!0,onChange:g=>n(g),placeholder:`Type to Search for ${s}`,value:N})}),E.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded",onClick:g=>G(),children:E.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:O?"-":"+"})})]}),E.jsx("div",{className:"dropdown-js-padding dropdown-js-selected-wrapper dropdown-js-selected-container",children:E.jsx("div",{className:"dropdown-js-selected-items",children:B.map(g=>E.jsxs("span",{className:"dropdown-js-padding dropdown-js-rounded",style:{...o,margin:"3.5px",marginRight:"0px"},children:[g[c]," ",E.jsx("span",{className:"dropdown-js-padding",style:{cursor:"pointer"},onClick:t=>M(g),children:"×"})]},`${g[a]}${g[c]}`))},K)}),E.jsxs("div",{className:`dropdown-js-padding dropdown-js-menu dropdown-js-rounded ${!O&&"dropdown-js-hide"}`,style:o,id:"dropDown",name:"dropDown","aria-label":s,children:[R.map(g=>E.jsxs("div",{"aria-label":g[c],children:[E.jsx("input",{type:"checkbox",name:`${g[c]}Checkbox`,style:{cursor:"pointer"},checked:S(g),onChange:t=>f(g),value:g[a]}),E.jsx("label",{style:{marginLeft:"5px"},htmlFor:`${g[c]}`,children:g[c]}),E.jsx("hr",{style:{borderColor:o.color}})]},`${g[a]}${g[c]}`)),E.jsx("button",{className:"dropdown-js-padding dropdown-js-round",style:C,title:"Done",disabled:R.length===0,onClick:g=>x(),type:"button",children:"Done"})]},i)]})}Ie.propTypes={label:w.string.isRequired,collectionName:w.string.isRequired,displayName:w.string.isRequired,valueName:w.string.isRequired,isDisabled:w.bool,selectedItem:w.array,onItemsSelected:w.func,dropdownStyle:w.shape({color:w.string.isRequired,backgroundColor:w.string.isRequired,fontSize:w.string,borderColor:w.string}),buttonStyle:w.shape({color:w.string.isRequired,backgroundColor:w.string.isRequired,fontSize:w.string,borderColor:w.string})};function Me({label:s,collectionName:r,isDisabled:c=!1,onItemsSelected:a=null,dropdownStyle:y,buttonStyle:h}){const{getCollectionData:j,setSelected:C,getSelected:T,getMaxNumSelections:l,collectionExists:v}=ne(),[m,q]=J.useState(!1),[O,V]=J.useState([]),[R,L]=J.useState([]),[B,Q]=J.useState(""),[N,A]=J.useState(Math.random()),[i,$]=J.useState(Math.random()),K=.001,[b]=J.useState(()=>{const x={backgroundColor:y?.backgroundColor,color:y?.color};return y?.fontSize&&(x.fontSize=y?.fontSize),x}),e=y?.borderColor;J.useEffect(()=>{if(!v(r))return;V(j(r));const x=T(r);L(x)},[v(r)]);function o(x){Q(x.target.value);let H=j(r).filter(g=>{const t=g.toUpperCase(),u=x.target.value.toUpperCase();return t.includes(u)});V(H),H.length>0?G():M(),A(N+K)}function p(x){let H=[...R];if(n(x))H=H.filter(g=>g!==x);else{const g=l(r);if(g!==null&&R.length>=g)return;H.push(x)}C(r,H),L(H),$(i+K)}function n(x){return R.findIndex(H=>H===x)>=0}function f(x){const H=R.filter(g=>g!==x);L(H),$(i+K),C(r,H),a!==null&&a()}function S(){m?M():G()}function M(){q(!1),a!==null&&a()}function G(){O.length>0&&q(!0)}return E.jsxs("div",{className:`dropdown-js dropdown-js-rounded
10
- ${e&&`dropdown-js-border ${e}`}`,style:{...c?{pointerEvents:"none"}:{}},children:[E.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:b,children:[E.jsx("div",{children:E.jsx("input",{className:"dropdown-js-input dropdown-js-rounded",style:b,type:"text",id:"searchDropDown",name:"searchDropDown",autoComplete:"off","aria-label":`Type to search for ${s}`,"aria-required":!0,onChange:x=>o(x),placeholder:`Type to Search for ${s}`,value:B})}),E.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded",onClick:x=>S(),children:E.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:m?"-":"+"})})]}),E.jsx("div",{className:"dropdown-js-padding dropdown-js-selected-wrapper dropdown-js-selected-container",children:E.jsx("div",{className:"dropdown-js-selected-items",children:R.map((x,H)=>E.jsxs("span",{className:"dropdown-js-padding dropdown-js-rounded",style:{...b,margin:"3.5px",marginRight:"0px"},children:[x," ",E.jsx("span",{style:{cursor:"pointer"},onClick:g=>f(x),children:"×"})]},`${x}`))},i)}),E.jsxs("div",{className:`dropdown-js-padding dropdown-js-menu dropdown-js-rounded ${!m&&"dropdown-js-hide"}`,style:b,id:"dropDown",name:"dropDown","aria-label":s,children:[O.map((x,H)=>E.jsxs("div",{"aria-label":x,children:[E.jsx("input",{type:"checkbox",name:`${x}Checkbox`,style:{cursor:"pointer"},checked:n(x),onChange:g=>p(x),value:x}),E.jsx("label",{style:{marginLeft:"5px"},htmlFor:`${x}`,children:x}),E.jsx("hr",{style:{borderColor:b.color}})]},`${H}#${x}`)),E.jsx("button",{className:"dropdown-js-padding dropdown-js-round",style:h,title:"Done",disabled:O.length===0,onClick:x=>M(),type:"button",children:"Done"})]},N)]})}Me.propTypes={label:w.string.isRequired,collectionName:w.string.isRequired,isDisabled:w.bool,selectedItem:w.array,onItemsSelected:w.func,dropdownStyle:w.shape({color:w.string.isRequired,backgroundColor:w.string.isRequired,fontSize:w.string,borderColor:w.string}),buttonStyle:w.shape({color:w.string.isRequired,backgroundColor:w.string.isRequired,fontSize:w.string,borderColor:w.string})};exports.CollectionsProvider=$e;exports.Dropdown=_e;exports.DropdownObj=De;exports.MultiSelectionDropdown=Me;exports.MultiSelectionDropdownObj=Ie;exports.useCollectionsContext=ne;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),z=require("react");function _e(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var oe={exports:{}},ie={exports:{}},U={};var he;function De(){if(he)return U;he=1;var i=typeof Symbol=="function"&&Symbol.for,T=i?Symbol.for("react.element"):60103,A=i?Symbol.for("react.portal"):60106,v=i?Symbol.for("react.fragment"):60107,j=i?Symbol.for("react.strict_mode"):60108,p=i?Symbol.for("react.profiler"):60114,w=i?Symbol.for("react.provider"):60109,y=i?Symbol.for("react.context"):60110,S=i?Symbol.for("react.async_mode"):60111,g=i?Symbol.for("react.concurrent_mode"):60111,x=i?Symbol.for("react.forward_ref"):60112,m=i?Symbol.for("react.suspense"):60113,$=i?Symbol.for("react.suspense_list"):60120,O=i?Symbol.for("react.memo"):60115,B=i?Symbol.for("react.lazy"):60116,C=i?Symbol.for("react.block"):60121,q=i?Symbol.for("react.fundamental"):60117,W=i?Symbol.for("react.responder"):60118,X=i?Symbol.for("react.scope"):60119;function I(s){if(typeof s=="object"&&s!==null){var G=s.$$typeof;switch(G){case T:switch(s=s.type,s){case S:case g:case v:case p:case j:case m:return s;default:switch(s=s&&s.$$typeof,s){case y:case x:case B:case O:case w:return s;default:return G}}case A:return G}}}function R(s){return I(s)===g}return U.AsyncMode=S,U.ConcurrentMode=g,U.ContextConsumer=y,U.ContextProvider=w,U.Element=T,U.ForwardRef=x,U.Fragment=v,U.Lazy=B,U.Memo=O,U.Portal=A,U.Profiler=p,U.StrictMode=j,U.Suspense=m,U.isAsyncMode=function(s){return R(s)||I(s)===S},U.isConcurrentMode=R,U.isContextConsumer=function(s){return I(s)===y},U.isContextProvider=function(s){return I(s)===w},U.isElement=function(s){return typeof s=="object"&&s!==null&&s.$$typeof===T},U.isForwardRef=function(s){return I(s)===x},U.isFragment=function(s){return I(s)===v},U.isLazy=function(s){return I(s)===B},U.isMemo=function(s){return I(s)===O},U.isPortal=function(s){return I(s)===A},U.isProfiler=function(s){return I(s)===p},U.isStrictMode=function(s){return I(s)===j},U.isSuspense=function(s){return I(s)===m},U.isValidElementType=function(s){return typeof s=="string"||typeof s=="function"||s===v||s===g||s===p||s===j||s===m||s===$||typeof s=="object"&&s!==null&&(s.$$typeof===B||s.$$typeof===O||s.$$typeof===w||s.$$typeof===y||s.$$typeof===x||s.$$typeof===q||s.$$typeof===W||s.$$typeof===X||s.$$typeof===C)},U.typeOf=I,U}var F={};var ye;function Ie(){return ye||(ye=1,process.env.NODE_ENV!=="production"&&(function(){var i=typeof Symbol=="function"&&Symbol.for,T=i?Symbol.for("react.element"):60103,A=i?Symbol.for("react.portal"):60106,v=i?Symbol.for("react.fragment"):60107,j=i?Symbol.for("react.strict_mode"):60108,p=i?Symbol.for("react.profiler"):60114,w=i?Symbol.for("react.provider"):60109,y=i?Symbol.for("react.context"):60110,S=i?Symbol.for("react.async_mode"):60111,g=i?Symbol.for("react.concurrent_mode"):60111,x=i?Symbol.for("react.forward_ref"):60112,m=i?Symbol.for("react.suspense"):60113,$=i?Symbol.for("react.suspense_list"):60120,O=i?Symbol.for("react.memo"):60115,B=i?Symbol.for("react.lazy"):60116,C=i?Symbol.for("react.block"):60121,q=i?Symbol.for("react.fundamental"):60117,W=i?Symbol.for("react.responder"):60118,X=i?Symbol.for("react.scope"):60119;function I(d){return typeof d=="string"||typeof d=="function"||d===v||d===g||d===p||d===j||d===m||d===$||typeof d=="object"&&d!==null&&(d.$$typeof===B||d.$$typeof===O||d.$$typeof===w||d.$$typeof===y||d.$$typeof===x||d.$$typeof===q||d.$$typeof===W||d.$$typeof===X||d.$$typeof===C)}function R(d){if(typeof d=="object"&&d!==null){var te=d.$$typeof;switch(te){case T:var ne=d.type;switch(ne){case S:case g:case v:case p:case j:case m:return ne;default:var pe=ne&&ne.$$typeof;switch(pe){case y:case x:case B:case O:case w:return pe;default:return te}}case A:return te}}}var s=S,G=g,Q=y,Z=w,e=T,t=x,a=v,o=B,r=O,u=A,l=p,M=j,K=m,h=!1;function H(d){return h||(h=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),n(d)||R(d)===S}function n(d){return R(d)===g}function f(d){return R(d)===y}function k(d){return R(d)===w}function _(d){return typeof d=="object"&&d!==null&&d.$$typeof===T}function E(d){return R(d)===x}function N(d){return R(d)===v}function P(d){return R(d)===B}function D(d){return R(d)===O}function L(d){return R(d)===A}function V(d){return R(d)===p}function Y(d){return R(d)===j}function ee(d){return R(d)===m}F.AsyncMode=s,F.ConcurrentMode=G,F.ContextConsumer=Q,F.ContextProvider=Z,F.Element=e,F.ForwardRef=t,F.Fragment=a,F.Lazy=o,F.Memo=r,F.Portal=u,F.Profiler=l,F.StrictMode=M,F.Suspense=K,F.isAsyncMode=H,F.isConcurrentMode=n,F.isContextConsumer=f,F.isContextProvider=k,F.isElement=_,F.isForwardRef=E,F.isFragment=N,F.isLazy=P,F.isMemo=D,F.isPortal=L,F.isProfiler=V,F.isStrictMode=Y,F.isSuspense=ee,F.isValidElementType=I,F.typeOf=R})()),F}var ge;function Te(){return ge||(ge=1,process.env.NODE_ENV==="production"?ie.exports=De():ie.exports=Ie()),ie.exports}var se,me;function Me(){if(me)return se;me=1;var i=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;function v(p){if(p==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(p)}function j(){try{if(!Object.assign)return!1;var p=new String("abc");if(p[5]="de",Object.getOwnPropertyNames(p)[0]==="5")return!1;for(var w={},y=0;y<10;y++)w["_"+String.fromCharCode(y)]=y;var S=Object.getOwnPropertyNames(w).map(function(x){return w[x]});if(S.join("")!=="0123456789")return!1;var g={};return"abcdefghijklmnopqrst".split("").forEach(function(x){g[x]=x}),Object.keys(Object.assign({},g)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return se=j()?Object.assign:function(p,w){for(var y,S=v(p),g,x=1;x<arguments.length;x++){y=Object(arguments[x]);for(var m in y)T.call(y,m)&&(S[m]=y[m]);if(i){g=i(y);for(var $=0;$<g.length;$++)A.call(y,g[$])&&(S[g[$]]=y[g[$]])}}return S},se}var ae,ve;function fe(){if(ve)return ae;ve=1;var i="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ae=i,ae}var ue,be;function Ee(){return be||(be=1,ue=Function.call.bind(Object.prototype.hasOwnProperty)),ue}var ce,we;function ke(){if(we)return ce;we=1;var i=function(){};if(process.env.NODE_ENV!=="production"){var T=fe(),A={},v=Ee();i=function(p){var w="Warning: "+p;typeof console<"u"&&console.error(w);try{throw new Error(w)}catch{}}}function j(p,w,y,S,g){if(process.env.NODE_ENV!=="production"){for(var x in p)if(v(p,x)){var m;try{if(typeof p[x]!="function"){var $=Error((S||"React class")+": "+y+" type `"+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[x]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw $.name="Invariant Violation",$}m=p[x](w,x,S,y,null,T)}catch(B){m=B}if(m&&!(m instanceof Error)&&i((S||"React class")+": type specification of "+y+" `"+x+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof m+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),m instanceof Error&&!(m.message in A)){A[m.message]=!0;var O=g?g():"";i("Failed "+y+" type: "+m.message+(O??""))}}}}return j.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(A={})},ce=j,ce}var le,Se;function qe(){if(Se)return le;Se=1;var i=Te(),T=Me(),A=fe(),v=Ee(),j=ke(),p=function(){};process.env.NODE_ENV!=="production"&&(p=function(y){var S="Warning: "+y;typeof console<"u"&&console.error(S);try{throw new Error(S)}catch{}});function w(){return null}return le=function(y,S){var g=typeof Symbol=="function"&&Symbol.iterator,x="@@iterator";function m(n){var f=n&&(g&&n[g]||n[x]);if(typeof f=="function")return f}var $="<<anonymous>>",O={array:W("array"),bigint:W("bigint"),bool:W("boolean"),func:W("function"),number:W("number"),object:W("object"),string:W("string"),symbol:W("symbol"),any:X(),arrayOf:I,element:R(),elementType:s(),instanceOf:G,node:t(),objectOf:Z,oneOf:Q,oneOfType:e,shape:o,exact:r};function B(n,f){return n===f?n!==0||1/n===1/f:n!==n&&f!==f}function C(n,f){this.message=n,this.data=f&&typeof f=="object"?f:{},this.stack=""}C.prototype=Error.prototype;function q(n){if(process.env.NODE_ENV!=="production")var f={},k=0;function _(N,P,D,L,V,Y,ee){if(L=L||$,Y=Y||D,ee!==A){if(S){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var te=L+":"+D;!f[te]&&k<3&&(p("You are manually calling a React.PropTypes validation function for the `"+Y+"` prop on `"+L+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),f[te]=!0,k++)}}return P[D]==null?N?P[D]===null?new C("The "+V+" `"+Y+"` is marked as required "+("in `"+L+"`, but its value is `null`.")):new C("The "+V+" `"+Y+"` is marked as required in "+("`"+L+"`, but its value is `undefined`.")):null:n(P,D,L,V,Y)}var E=_.bind(null,!1);return E.isRequired=_.bind(null,!0),E}function W(n){function f(k,_,E,N,P,D){var L=k[_],V=M(L);if(V!==n){var Y=K(L);return new C("Invalid "+N+" `"+P+"` of type "+("`"+Y+"` supplied to `"+E+"`, expected ")+("`"+n+"`."),{expectedType:n})}return null}return q(f)}function X(){return q(w)}function I(n){function f(k,_,E,N,P){if(typeof n!="function")return new C("Property `"+P+"` of component `"+E+"` has invalid PropType notation inside arrayOf.");var D=k[_];if(!Array.isArray(D)){var L=M(D);return new C("Invalid "+N+" `"+P+"` of type "+("`"+L+"` supplied to `"+E+"`, expected an array."))}for(var V=0;V<D.length;V++){var Y=n(D,V,E,N,P+"["+V+"]",A);if(Y instanceof Error)return Y}return null}return q(f)}function R(){function n(f,k,_,E,N){var P=f[k];if(!y(P)){var D=M(P);return new C("Invalid "+E+" `"+N+"` of type "+("`"+D+"` supplied to `"+_+"`, expected a single ReactElement."))}return null}return q(n)}function s(){function n(f,k,_,E,N){var P=f[k];if(!i.isValidElementType(P)){var D=M(P);return new C("Invalid "+E+" `"+N+"` of type "+("`"+D+"` supplied to `"+_+"`, expected a single ReactElement type."))}return null}return q(n)}function G(n){function f(k,_,E,N,P){if(!(k[_]instanceof n)){var D=n.name||$,L=H(k[_]);return new C("Invalid "+N+" `"+P+"` of type "+("`"+L+"` supplied to `"+E+"`, expected ")+("instance of `"+D+"`."))}return null}return q(f)}function Q(n){if(!Array.isArray(n))return process.env.NODE_ENV!=="production"&&(arguments.length>1?p("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):p("Invalid argument supplied to oneOf, expected an array.")),w;function f(k,_,E,N,P){for(var D=k[_],L=0;L<n.length;L++)if(B(D,n[L]))return null;var V=JSON.stringify(n,function(ee,d){var te=K(d);return te==="symbol"?String(d):d});return new C("Invalid "+N+" `"+P+"` of value `"+String(D)+"` "+("supplied to `"+E+"`, expected one of "+V+"."))}return q(f)}function Z(n){function f(k,_,E,N,P){if(typeof n!="function")return new C("Property `"+P+"` of component `"+E+"` has invalid PropType notation inside objectOf.");var D=k[_],L=M(D);if(L!=="object")return new C("Invalid "+N+" `"+P+"` of type "+("`"+L+"` supplied to `"+E+"`, expected an object."));for(var V in D)if(v(D,V)){var Y=n(D,V,E,N,P+"."+V,A);if(Y instanceof Error)return Y}return null}return q(f)}function e(n){if(!Array.isArray(n))return process.env.NODE_ENV!=="production"&&p("Invalid argument supplied to oneOfType, expected an instance of array."),w;for(var f=0;f<n.length;f++){var k=n[f];if(typeof k!="function")return p("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+h(k)+" at index "+f+"."),w}function _(E,N,P,D,L){for(var V=[],Y=0;Y<n.length;Y++){var ee=n[Y],d=ee(E,N,P,D,L,A);if(d==null)return null;d.data&&v(d.data,"expectedType")&&V.push(d.data.expectedType)}var te=V.length>0?", expected one of type ["+V.join(", ")+"]":"";return new C("Invalid "+D+" `"+L+"` supplied to "+("`"+P+"`"+te+"."))}return q(_)}function t(){function n(f,k,_,E,N){return u(f[k])?null:new C("Invalid "+E+" `"+N+"` supplied to "+("`"+_+"`, expected a ReactNode."))}return q(n)}function a(n,f,k,_,E){return new C((n||"React class")+": "+f+" type `"+k+"."+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+E+"`.")}function o(n){function f(k,_,E,N,P){var D=k[_],L=M(D);if(L!=="object")return new C("Invalid "+N+" `"+P+"` of type `"+L+"` "+("supplied to `"+E+"`, expected `object`."));for(var V in n){var Y=n[V];if(typeof Y!="function")return a(E,N,P,V,K(Y));var ee=Y(D,V,E,N,P+"."+V,A);if(ee)return ee}return null}return q(f)}function r(n){function f(k,_,E,N,P){var D=k[_],L=M(D);if(L!=="object")return new C("Invalid "+N+" `"+P+"` of type `"+L+"` "+("supplied to `"+E+"`, expected `object`."));var V=T({},k[_],n);for(var Y in V){var ee=n[Y];if(v(n,Y)&&typeof ee!="function")return a(E,N,P,Y,K(ee));if(!ee)return new C("Invalid "+N+" `"+P+"` key `"+Y+"` supplied to `"+E+"`.\nBad object: "+JSON.stringify(k[_],null," ")+`
2
+ Valid keys: `+JSON.stringify(Object.keys(n),null," "));var d=ee(D,Y,E,N,P+"."+Y,A);if(d)return d}return null}return q(f)}function u(n){switch(typeof n){case"number":case"string":case"undefined":return!0;case"boolean":return!n;case"object":if(Array.isArray(n))return n.every(u);if(n===null||y(n))return!0;var f=m(n);if(f){var k=f.call(n),_;if(f!==n.entries){for(;!(_=k.next()).done;)if(!u(_.value))return!1}else for(;!(_=k.next()).done;){var E=_.value;if(E&&!u(E[1]))return!1}}else return!1;return!0;default:return!1}}function l(n,f){return n==="symbol"?!0:f?f["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&f instanceof Symbol:!1}function M(n){var f=typeof n;return Array.isArray(n)?"array":n instanceof RegExp?"object":l(f,n)?"symbol":f}function K(n){if(typeof n>"u"||n===null)return""+n;var f=M(n);if(f==="object"){if(n instanceof Date)return"date";if(n instanceof RegExp)return"regexp"}return f}function h(n){var f=K(n);switch(f){case"array":case"object":return"an "+f;case"boolean":case"date":case"regexp":return"a "+f;default:return f}}function H(n){return!n.constructor||!n.constructor.name?$:n.constructor.name}return O.checkPropTypes=j,O.resetWarningCache=j.resetWarningCache,O.PropTypes=O,O},le}var de,xe;function Ae(){if(xe)return de;xe=1;var i=fe();function T(){}function A(){}return A.resetWarningCache=T,de=function(){function v(w,y,S,g,x,m){if(m!==i){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}}v.isRequired=v;function j(){return v}var p={array:v,bigint:v,bool:v,func:v,number:v,object:v,string:v,symbol:v,any:v,arrayOf:j,element:v,elementType:v,instanceOf:j,node:v,objectOf:j,oneOf:j,oneOfType:j,shape:j,exact:j,checkPropTypes:A,resetWarningCache:T};return p.PropTypes=p,p},de}var je;function ze(){if(je)return oe.exports;if(je=1,process.env.NODE_ENV!=="production"){var i=Te(),T=!0;oe.exports=qe()(i.isElement,T)}else oe.exports=Ae()();return oe.exports}var Ne=ze();const c=_e(Ne);var J={},Ce;function Le(){if(Ce)return J;Ce=1;function i(e){return e?/^[a-zA-Z][a-zA-Z0-9_-]{2,50}$/.test(e):!1}J.isValidUserName=i;function T(e){return e?/^[A-Za-z' -]{2,50}$/.test(e):!1}J.isValidName=T;function A(e){return e?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e):!1}J.isValidEmail=A;function v(e){return e?/^[0-9]{10,15}$/g.test(e):!1}J.isValidPhoneNum=v;function j(e){return e?/^[a-zA-Z0-9.\-\(\) ]{2,}$/.test(e):!1}J.isValidOrganisationName=j;function p(e){return!(!e||e.length<6||/[A-Z]/.test(e)===!1||/[a-z]/.test(e)===!1||/[0-9]/.test(e)===!1||/[\s]/.test(e)||/[\][!"#$%&'()*+,./:;<=>?@^\\_`{|}~-]/.test(e)===!1)}J.isValidPassword=p;function w(e){let t=e.getFullYear(),a=e.getMonth()+1;a=S(a,2);let o=e.getDate();return o=S(o,2),`${t}-${a}-${o}`}J.timeStampYyyyMmDd=w;function y(e){let t=S(e.getHours(),2),a=S(e.getMinutes(),2),o=S(e.getSeconds(),2),r=S(e.getMilliseconds(),3);return`${w(e)}T${t}:${a}:${o}.${r}`}J.timeStampString=y;function S(e,t){let a=e+"";const o=t-a.length;for(let r=1;r<=o;r++)a="0"+a;return a}J.addLeadingZeros=S;function g(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"ZAR"}).format(e).replace(/ZAR/gi,"R")}J.toZarCurrencyFormat=g;function x(e){if(Object.prototype.toString.call(e)!=="[object Object]")return e instanceof Date?new Date(e):(["string","number","boolean"].includes(typeof e),e);const t=[{...e}];let a=0;for(;a<t.length;){let o=t[a];if(Object.prototype.toString.call(o)==="[object Object]")for(let r in o)o[r]instanceof Date?o[r]=new Date(o[r]):Object.prototype.toString.call(o[r])==="[object Object]"&&(o[r]={...o[r]}),t.push(o[r]);a++}return t[0]}J.deepClone=x;function m(e){const t=[{value:e}];let a=0;for(;a<t.length;){const o=t[a];if(Object.prototype.toString.call(o.value)==="[object Object]"){for(const r in o.value){let u=o.path?o.path+"."+r:r;t.push({value:o.value[r],path:u})}o.remove=!0}a++}return t.filter(o=>!o.remove).map(o=>o.path)}J.getPaths=m;function $(e){let t=x(e),a=0;const o=m(t).toSorted();sortedObj={};for(a in o){const r=o[a],u=O(t,r);B(sortedObj,r,u)}return sortedObj}J.getSortedObject=$;function O(e,t,a=void 0){let o=t.split("."),r=e;for(let u in o){let l=o[u];if(r[l]===void 0||(r=r[l],r===void 0))return a}return r}J.get=O;function B(e,t,a){let o=e,r=t.split(".");for(let u in r){let l=r[u];u<r.length-1?(l in o||(o[l]={}),o=o[l]):o[l]=a}}J.set=B;function C(e,t){let a=t.split("."),o=e;for(let r in a){let u=a[r];if(Object.prototype.toString.call(o)!=="[object Object]"||o[u]===void 0)return;r<a.length-1?o=o[u]:delete o[u]}}J.unset=C;function q(e,...t){if(!t||!t.length)throw new Error("fields must be specified");const a=m(e);let o=0;for(const r in a){const u=a[r];if(t.includes(u))o++;else return!1}return o>0}J.hasOnly=q;function W(e,...t){if(!t||!t.length)throw new Error("fields must be specified");const a=m(e);let o=0;for(const r in t){const u=t[r];if(a.includes(u))o++;else return!1}return o===t.length}J.hasAll=W;function X(e,...t){return q(e,...t)&&W(e,...t)}J.hasOnlyAll=X;function I(e,t,a=0,o="asc"){const r=["asc","desc"];if(!["asc","desc"].includes(o))throw new Error(`arraySortDir must be one of ${r}`);if(e.length===0)return-1;let u=a,l=e.length-1;for(;u<l;){if(R(e[u],t)===0)return u;if(R(e[l],t)===0)return l;const M=Math.trunc((u+l)/2),K=R(e[M],t,o);if(K<0)u=M+1;else if(K>0)l=M-1;else return M}return u}J.binarySearch=I;function R(e,t,a="asc"){if(!["asc","desc"].includes(a))throw new Error(`sortDir must be one of ${a}`);const o=a==="desc"?-1:1;return e>t?o:e<t?-o:0}J.compare=R;function s(e,t,a=0,...o){if(e.length===0)return-1;let r=a,u=e.length-1;for(;r<u;){if(Z(e[r],t,...o)===0)return r;if(Z(e[u],t,...o)===0)return u;let l=Math.trunc((r+u)/2);if(Z(e[l],t,...o)<0)r=l+1;else if(Z(e[l],t,...o)>0)u=l-1;else return l}return r}J.binarySearchObj=s;function G(e,t,a,...o){let r=a,u=e.length-1;if(r>=e.length)throw new Error("startFrom is outside the bounds of the array.");if(Z(t,e[r],...o)>0)throw new Error("targetObj is to the right ('greater than') objArray[startFrom].");for(;r<u;){let l=Math.trunc((r+u)/2);Z(t,e[l],...o)===0?r=l+1:Z(t,e[l],...o)<0&&(u=l)}return Z(t,e[r],...o)===0?-1:r}J.getNextDifferent=G;function Q(e,t,...a){if(e.length<=1)return[...e];if(typeof t!="boolean")throw new Error("firstOfDuplicates must be boolean true or false.");const o=[];let r=0;for(;r<e.length-1&&(t&&o.push(e[r]),r=G(e,e[r],r+1,...a),!(r<0));){let u=r-1;t||o.push(e[u])}return o.length===0?t?o.push(e[0]):o.push(e[e.length-1]):Z(o[o.length-1],e[e.length-1],...a)!==0&&o.push(e[e.length-1]),o}J.getObjArrayWithNoDuplicates=Q;function Z(e,t,...a){if(a.length===0)throw new Error("comparisonFields not supplied!");const o=["","asc","desc"];for(const r in a){const u=a[r].split(" "),l=u[0];let M="";if(u.length===2&&(M=u[1]),!o.includes(M))throw new Error("Sort direction must be one of "+o.toString());const K=O(e,l),h=O(t,l),H=M==="desc"?-1:1;if(K>h)return H;if(K<h)return-H}return 0}return J.objCompare=Z,J}var re=Le();function Oe({label:i,data:T,sortOrder:A="asc",onItemSelected:v=null,selected:j=null,dropdownStyle:p,isDisabled:w=!1}){const[y,S]=z.useState(!1),[g,x]=z.useState(""),m=z.useMemo(()=>T.toSorted(R),[T]),$=z.useMemo(()=>{if(g.length===0)return[];const t=g.toUpperCase();return m.filter(a=>a.toUpperCase().includes(t))},[m,g]),O=z.useMemo(()=>g.length===0?m:$,[m,g]),[B,C]=z.useState(""),[q,W]=z.useState(null);z.useMemo(()=>{let t="";if(q)t=q;else if(j){const a=T.findIndex(o=>o===j);a>=0&&(t=T[a])}return C(t),t},[j,q]);const X=(()=>{const t={backgroundColor:p?.backgroundColor,color:p?.color};return p?.fontSize&&(t.fontSize=p?.fontSize),t})(),I=p?.borderColor;function R(t,a){return re.compare(t,a,A)}function s(t){x(t.target.value),C(t.target.value),$.length===0?Z():e()}async function G(t){C(t),x(""),W(t),v!==null&&v(t),Z()}function Q(){y?Z():e()}function Z(){S(!1)}function e(){O.length>0&&S(!0)}return b.jsxs("div",{className:`dropdown-js dropdown-js-rounded
3
+ ${I&&`dropdown-js-border ${I}`}`,style:{...w?{pointerEvents:"none"}:{}},children:[b.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:X,children:[b.jsx("input",{id:"dropdownSearch",name:"dropdownSearch",className:"dropdown-js-input dropdown-js-rounded",autoComplete:"off",type:"text",style:X,role:"combobox","aria-placeholder":`Type to Search for ${i}`,"aria-required":!0,"aria-controls":"dropdown","aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":y,onChange:t=>s(t),disabled:w,placeholder:`Type to Search for ${i}`,value:B}),b.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-expanded":y,"aria-controls":"multiSelectionDropdown","aria-label":`${i} options`,onClick:t=>Q(),children:b.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding","aria-label":`${i} options`,"aria-expanded":y,children:y?"-":"+"})})]}),b.jsx("div",{className:`dropdown-js-padding dropdown-js-menu ${!y&&"dropdown-js-hide"}`,id:"dropDown",name:"dropDown",role:"listbox","aria-expanded":y,disabled:w,"aria-label":i,style:{...X,marginTop:"3.5px"},children:O.map((t,a)=>b.jsxs("div",{name:t,role:"option","aria-label":t,style:{cursor:"pointer"},onClick:o=>G(t),children:[t,a<O.length-1&&b.jsx("hr",{style:{borderColor:X.color}})]},`${a}#${t}`))})]})}Oe.propTypes={label:c.string.isRequired,data:c.array.isRequired,sortDirection:c.string,selectedData:c.array.isRequired,selectedItems:c.array,maxNumSelections:c.number,isDisabled:c.bool,onItemsSelected:c.func,dropdownStyle:c.shape({color:c.string.isRequired,backgroundColor:c.string.isRequired,fontSize:c.string,borderColor:c.string}),buttonStyle:c.shape({color:c.string.isRequired,backgroundColor:c.string.isRequired,fontSize:c.string,borderColor:c.string})};function Re({label:i,data:T,sortFields:A,selected:v=null,displayName:j,valueName:p,isDisabled:w=!1,onItemSelected:y=null,dropdownStyle:S}){const[g,x]=z.useState(null),[m,$]=z.useState(""),[O,B]=z.useState(""),C=z.useMemo(()=>T.toSorted(e),[T]),q=z.useMemo(()=>{if(O.length===0)return[];const l=O.toUpperCase();return C.filter(M=>M[j].toUpperCase().toUpperCase().includes(l))},[O]),[W,X]=z.useState(""),[I,R]=z.useState(null);z.useMemo(()=>{let l;if(I)l={...I};else if(v){const M=t(),K=T.findIndex(h=>re.get(h,...M)===re.get(v,...M));K>=0&&(l=T[K])}return l&&X(l[j]),l},[v,I]);const s=z.useMemo(()=>O.length>0?q:C,[O,C]),G=(()=>{const l={backgroundColor:S?.backgroundColor,color:S?.color};return S?.fontSize&&(l.fontSize=S?.fontSize),l})(),Q=S?.borderColor;async function Z(l){B(M=>l.target.value),X(M=>l.target.value),q.length>0?u():r()}function e(l,M){return re.objCompare(l,M,...A)}function t(){let l=m;return l||(T.length>0&&(l=re.getPaths(T[0])),$(l)),l}function a(l){R(l),y!==null&&y(l),r()}function o(){g?r():u()}function r(){x(!1)}function u(){s.length>0&&x(!0)}return b.jsxs("div",{className:`dropdown-js dropdown-js-rounded
4
+ ${Q&&`dropdown-js-border ${Q}`}`,style:{...w?{pointerEvents:"none"}:{}},children:[b.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:G,children:[b.jsx("input",{id:"dropdownObjSearch",name:"dropdownObjSearch",className:"dropdown-js-input dropdown-js-rounded",style:G,type:"text",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-controls":"dropdownObj","aria-expanded":g,"aria-placeholder":`Type to Search for ${i}`,"aria-required":!0,onChange:l=>Z(l),disabled:w,placeholder:`Type to Search for ${i}`,value:W}),b.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-label":`${i} options`,"aria-expanded":g,onClick:l=>o(),children:b.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:g?"-":"+"})})]}),b.jsx("div",{className:`dropdown-js-padding dropdown-js-menu ${!g&&"dropdown-js-hide"}`,id:"dropDownObj",name:"dropDownObj",role:"listbox","aria-expanded":g,style:{...G,marginTop:"3.5px"},children:s.map((l,M)=>b.jsxs("div",{name:l[j],role:"option","aria-label":l[j],style:{cursor:"pointer"},onClick:K=>a(l),children:[l[j],M<s.length-1&&b.jsx("hr",{style:{borderColor:G.color}})]},`${l[p]}${M}`))})]})}Re.propTypes={label:c.string.isRequired,data:c.arrayOf(c.object).isRequired,sortFields:c.arrayOf(c.string).isRequired,selected:c.object,displayName:c.string.isRequired,valueName:c.string.isRequired,isDisabled:c.bool,onItemSelected:c.func,dropdownStyle:c.shape({color:c.string.isRequired,backgroundColor:c.string.isRequired,fontSize:c.string,borderColor:c.string})};function Pe({label:i,data:T,sortFields:A,selectedData:v=[],maxNumSelections:j=null,displayName:p,valueName:w,isDisabled:y=!1,onItemsSelected:S=null,dropdownStyle:g,buttonStyle:x}){const[m,$]=z.useState(!1),[O,B]=z.useState(""),[C,q]=z.useState(""),W=z.useMemo(()=>T.toSorted(t),[T]),[X,I]=z.useState([]),R=z.useMemo(()=>X.length>0?X.filter(h=>W.findIndex(H=>{const n=e();return re.objCompare(h,H,...n)===0})>=0).toSorted(t):v.filter(h=>W.findIndex(H=>{const n=e();return re.objCompare(h,H,...n)===0})>=0).toSorted(t),[W,v,X]),s=z.useMemo(()=>{if(C.length===0)return[];const h=C.toUpperCase();return W.filter(H=>H[p].toUpperCase().includes(h))},[C]),G=z.useMemo(()=>C.length>0?s:W,[C,W]),Q=(()=>{const h={backgroundColor:g?.backgroundColor,color:g?.color};return g?.fontSize&&(h.fontSize=g?.fontSize),h})(),Z=g?.borderColor;z.useEffect(()=>{if(!p)throw new Error("displayName must be provided");if(!w)throw new Error("valueName must be provided")},[]);function e(){let h=O;return h||(T.length>0&&(h=re.getPaths(T[0])),B(h)),h}function t(h,H){return re.objCompare(h,H,...A)}function a(h){q(h.target.value),s.length>0?K():M()}function o(h){let H=[...R];if(r(h))H=H.filter(n=>{const f=e();return re.objCompare(n,h,...f)!==0});else{if(j!==null&&R.length>=j)return;H.push(h)}I(H)}function r(h){const H=e();return R.findIndex(n=>re.objCompare(n,h,...H)===0)>=0}function u(h){const H=e(),n=R.filter(f=>re.objCompare(f,h,...H)!==0);I(n),S!==null&&S(n)}function l(){m?M():K()}function M(){$(!1),S!==null&&S(R)}function K(){G.length>0&&$(!0)}return b.jsxs("div",{className:`dropdown-js dropdown-js-rounded
5
+ ${Z&&`dropdown-js-border ${Z}`}`,style:{...y?{pointerEvents:"none"}:{}},children:[b.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:Q,children:[b.jsx("div",{children:b.jsx("input",{id:"multiSelectionDropdownObjSearch",name:"multiSelectionDropdownObjSearch",className:"dropdown-js-input dropdown-js-rounded",style:Q,"aria-label":i,"aria-autocomplete":"list","aria-controls":"multiSelectionDropdownObj",role:"combobox","aria-expanded":m,"aria-haspopup":"listbox",type:"text",autoComplete:"off","aria-placeholder":`Type to Search for ${i}`,onChange:h=>a(h),placeholder:`Type to Search for ${i}`,value:C})}),b.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-expanded":m,"aria-controls":"multiSelectionDropdownObj","aria-label":`${i} options`,onClick:h=>l(),children:b.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:m?"-":"+"})})]}),b.jsx("div",{className:"dropdown-js-padding dropdown-js-selected-wrapper dropdown-js-selected-container",children:b.jsx("div",{id:"multiSelectionDropdownObj",className:"dropdown-js-selected-items","aria-label":`Selected ${i} options`,"aria-multiselectable":!0,"aria-live":"polite",children:R.map(h=>b.jsxs("span",{className:"dropdown-js-padding dropdown-js-rounded","aria-label":`${h[p]}`,style:{...Q,margin:"3.5px",marginRight:"0px"},children:[h[p]," ",b.jsx("span",{className:"dropdown-js-padding",style:{cursor:"pointer"},"aria-label":`Remove ${h[p]}`,onClick:H=>u(h),children:"×"})]},`${h[w]}${h[p]}`))})}),b.jsxs("div",{className:`dropdown-js-padding dropdown-js-menu dropdown-js-rounded ${!m&&"dropdown-js-hide"}`,style:Q,id:"multiSelectionDropdownObj",name:"multiSelectionDropdownObj",role:"listbox","aria-multiselectable":!0,"aria-expanded":m,children:[G.map(h=>b.jsxs("div",{children:[b.jsx("input",{id:`${h[w]}Checkbox`,type:"checkbox",name:`${h[p]}Checkbox`,role:"option","aria-label":`${h[p]}`,"aria-checked":r(h),style:{cursor:"pointer"},checked:r(h),onChange:H=>o(h),value:h[w]}),b.jsx("label",{style:{marginLeft:"5px"},htmlFor:`${h[w]}`,children:h[p]}),b.jsx("hr",{style:{backgroundColor:Q.color,border:"none",height:"0.5px"}})]},`${h[w]}${h[p]}`)),b.jsx("button",{className:"dropdown-js-padding dropdown-js-round",style:x,title:"Done",disabled:G.length===0,"aria-label":`Close ${i} options`,onClick:h=>M(),type:"button",children:"Done"})]})]})}Pe.propTypes={label:c.string.isRequired,data:c.arrayOf(c.object).isRequired,sortFields:c.arrayOf(c.string).isRequired,selectedData:c.arrayOf(c.object),maxNumSelections:c.number,displayName:c.string.isRequired,valueName:c.string.isRequired,isDisabled:c.bool,onItemsSelected:c.func,dropdownStyle:c.shape({color:c.string.isRequired,backgroundColor:c.string.isRequired,fontSize:c.string,borderColor:c.string}),buttonStyle:c.shape({color:c.string.isRequired,backgroundColor:c.string.isRequired,fontSize:c.string,borderColor:c.string})};function $e({label:i,data:T,sortDirection:A="asc",selectedData:v=[],maxNumSelections:j=null,isDisabled:p=!1,onItemsSelected:w=null,dropdownStyle:y,buttonStyle:S}){const[g,x]=z.useState(!1),m=z.useMemo(()=>T.toSorted(s),[T]),[$,O]=z.useState(""),[B,C]=z.useState([]),q=z.useMemo(()=>B.length>0?B.filter(r=>m.findIndex(u=>u===r)>=0).toSorted(s):v.filter(r=>m.findIndex(u=>u===r)>=0).toSorted(s),[m,v,B]),W=z.useMemo(()=>{if($.length===0)return[];const r=$.toUpperCase();return m.filter(u=>u.toUpperCase().includes(r))},[$]),X=z.useMemo(()=>$.length>0?W:m,[$,m]),I=(()=>{const r={backgroundColor:y?.backgroundColor,color:y?.color};return y?.fontSize&&(r.fontSize=y?.fontSize),r})(),R=y?.borderColor;function s(r,u){return re.compare(r,u,A)}function G(r){const u=r.target.value;O(u),X.length>0?o():a()}function Q(r){let u=[...q];if(Z(r))u=u.filter(l=>l!==r);else{if(j!==null&&u.length>=j)return;u.push(r)}C(u)}function Z(r){return q.findIndex(u=>u===r)>=0}function e(r){const u=q.filter(l=>l!==r);C(l=>u),w!==null&&w(u)}function t(){g?a():o()}function a(){x(!1),w!==null&&w(q)}function o(){X.length>0&&x(!0)}return b.jsxs("div",{className:`dropdown-js dropdown-js-rounded
6
+ ${R&&`dropdown-js-border ${R}`}`,style:{...p?{pointerEvents:"none"}:{}},children:[b.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:I,children:[b.jsx("div",{children:b.jsx("input",{className:"dropdown-js-input dropdown-js-rounded",id:"multiselectionDropdownSearch",name:"multiselectionDropdownSearch",style:I,type:"text",autoComplete:"off",role:"combobox","aria-label":i,"aria-placeholder":`Type to search for ${i}`,"aria-autocomplete":"list","aria-controls":"multiSelectionDropdown","aria-expanded":g,"aria-haspopup":"listbox",onChange:r=>G(r),placeholder:`Type to Search for ${i}`,value:$})}),b.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-expanded":g,"aria-controls":"multiSelectionDropdown","aria-label":`${i} options`,onClick:r=>t(),children:b.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:g?"-":"+"})})]}),b.jsx("div",{className:"dropdown-js-padding dropdown-js-selected-wrapper dropdown-js-selected-container",children:b.jsx("div",{id:"multiSelectionDropdown-selectedItems",className:"dropdown-js-selected-items","aria-label":`Selected ${i} options`,"aria-live":"polite",children:q.map(r=>b.jsxs("span",{className:"dropdown-js-padding dropdown-js-rounded","aria-label":`${r}`,style:{...I,margin:"3.5px",marginRight:"0px"},children:[r," ",b.jsx("span",{style:{cursor:"pointer"},"aria-label":`Remove ${r}`,onClick:u=>e(r),children:"×"})]},`${r}`))})}),b.jsxs("div",{className:`dropdown-js-padding dropdown-js-menu dropdown-js-rounded ${!g&&"dropdown-js-hide"}`,style:I,id:"multiSelectionDropdown",name:"multiSelectionDropdown",role:"listbox","aria-multiselectable":!0,"aria-expanded":g,children:[X.map((r,u)=>b.jsxs("div",{children:[b.jsx("input",{type:"checkbox",name:`${r}Checkbox`,role:"option","aria-label":r,"aria-checked":Z(r),style:{cursor:"pointer"},checked:Z(r),onChange:l=>Q(r),value:r}),b.jsx("label",{style:{marginLeft:"5px"},htmlFor:`${r}`,children:r}),b.jsx("hr",{style:{backgroundColor:I.color,border:"none",height:"0.5px"}})]},`${u}#${r}`)),b.jsx("button",{className:"dropdown-js-padding dropdown-js-round",style:S,"aria-label":`Click to collapse ${i} options`,title:"Done",disabled:X.length===0,onClick:r=>a(),type:"button",children:"Done"})]})]})}$e.propTypes={label:c.string.isRequired,data:c.array.isRequired,sortDirection:c.string,selectedData:c.array.isRequired,selectedItems:c.array,maxNumSelections:c.number,isDisabled:c.bool,onItemsSelected:c.func,dropdownStyle:c.shape({color:c.string.isRequired,backgroundColor:c.string.isRequired,fontSize:c.string,borderColor:c.string}),buttonStyle:c.shape({color:c.string.isRequired,backgroundColor:c.string.isRequired,fontSize:c.string,borderColor:c.string})};exports.Dropdown=Oe;exports.DropdownObj=Re;exports.MultiSelectionDropdown=$e;exports.MultiSelectionDropdownObj=Pe;