dropdowns-js 1.1.6 → 2.0.0

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
@@ -46,10 +46,12 @@ export default function MyComponent {
46
46
 
47
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
48
 
49
- `selectedData` - for multi-selection dropdowns. An array of pre-set selection of options. This is an array of multi-selection dropdowns. Optional.
49
+ `selectedData` - for multi-selection dropdowns. An array of pre-set selection of options. Optional.
50
50
 
51
51
  `selected` - for single selection dropdowns. A pre-set selected option.
52
-
52
+
53
+ `selReset` - optional. When set to true, selected item(s) can be set only by the parent component, via selected (single selection dropddowns) or selectedData (multi-selection dropdowns), and the user cannot make a selection/deselection.
54
+
53
55
  `onItemSelected` - for single selection dropdowns. A function to call when the user has made a selection.
54
56
 
55
57
  `onItemsSelected` - for multi-selection dropdowns. A function to call when the user has made a selection. Or removed items from their selection.
@@ -60,6 +62,7 @@ export default function MyComponent {
60
62
 
61
63
  ## 4. Dropdown usage example
62
64
  This dropdown is to be used when the underlying data is a primitive type array.
65
+ ***Javascript example***
63
66
  ```
64
67
  import { Dropdown } from 'dropdowns-js';
65
68
  import 'dropdowns-js/style.css'; // styles must be imported, otherwise the dropdowns do not display properly.
@@ -97,7 +100,50 @@ export default function MyComponent() {
97
100
  );
98
101
  }
99
102
  ```
103
+
104
+ ***Typescript example***
105
+ ```
106
+ import { Dropdown } from 'dropdowns-js';
107
+ import type { DropdownStyle } from 'dropdowns-js';
108
+ import 'dropdowns-js/style.css'; // styles must be imported, otherwise the dropdowns do not display properly.
109
+ import { useState } from 'react';
110
+
111
+ export default function MyComponent() {
112
+ const [output, setOutput] = useState('');
113
+ const fruits = [ "BANANA" "ORANGE", "NAARJIE", "PEACH", "APPLE" ];
114
+ const myDropdownStyle: DropdownStyle = {color: '#000', backgroundColor: '#66ff66'};
115
+
116
+ /**Respond when the user has chosen a fruit */
117
+ function fruitSelected(selFruit: string) {
118
+ setOutput(selFruit);
119
+ }
120
+
121
+ return (
122
+ <div className='' style={{padding: '5px', backgroundColor: 'green'}}>
123
+ <h1>Dropdown Example</h1>
124
+ <p>Select a fruit</p>
125
+ <div style={{padding: '2px', display: 'flex'}}>
126
+ <label htmlFor='fruits' style={{width: '70px'}}>Fruit</label>
127
+
128
+ <Dropdown
129
+ label={'Fruits'}
130
+ data={fruits}
131
+ sortOrder='asc'
132
+ onItemSelected={fruitSelected}
133
+ selected={"BANANA"}
134
+ dropdownStyle={myDropdownStyle}
135
+ />
136
+
137
+ </div>
138
+ <p>{output}</p>
139
+
140
+ </div>
141
+ );
142
+ }
143
+ ```
100
144
  ## 5. DropdownObj usage example
145
+
146
+ ***Javascript example***
101
147
  ```
102
148
  import { DropdownObj } from 'dropdowns-js';
103
149
  import 'dropdowns-js/style.css'; // Not to be left out.
@@ -106,7 +152,7 @@ import { useState } from 'react';
106
152
 
107
153
  export default function MyComponent2() {
108
154
  const [output, setOutput] = useState('');
109
- const drivingCodes = [
155
+ const drivingCodes: DrivingCode[] = [
110
156
  { code: 'A1', description: 'Light Motorcycles' },
111
157
  { code: 'A', description: 'Heavy Motorcycles' },
112
158
  { code: 'B', description: 'Light Vehicles' },
@@ -130,7 +176,8 @@ export default function MyComponent2() {
130
176
  <label htmlFor='driving-codes' style={{width: '70px'}}>Driving Codes</label>
131
177
 
132
178
  <DropdownObj
133
- label='Driving Codes' data={drivingCodes}
179
+ label='Driving Codes'
180
+ data={drivingCodes}
134
181
  displayName="description"
135
182
  valueName="code"
136
183
  sortFields={ ['description'] }
@@ -144,7 +191,69 @@ export default function MyComponent2() {
144
191
  );
145
192
  }
146
193
  ```
147
- ## 6. MultiselectionDropdown usage example
194
+
195
+
196
+ ***Typescript example***
197
+ ```
198
+ import { DropdownObj } from 'dropdowns-js';
199
+ import style { DropdownStyle } from 'dropdowns-js';
200
+ import 'dropdowns-js/style.css'; // Not to be left out.
201
+
202
+ import { useState } from 'react';
203
+
204
+ // Model
205
+ interface DrivingCode {
206
+ code: string;
207
+ description: string;
208
+ minAge: Number;
209
+ };
210
+
211
+ export default function MyComponent2() {
212
+ const [output, setOutput] = useState('');
213
+ const drivingCodes: DrivingCode = [
214
+ { code: 'A1', description: 'Light Motorcycles' },
215
+ { code: 'A', description: 'Heavy Motorcycles' },
216
+ { code: 'B', description: 'Light Vehicles' },
217
+ { code: 'EB', description: 'Light Articulated' },
218
+ { code: 'C1', description: 'Heavy Vehicles' },
219
+ { code: 'C', description: 'Extra Heavy Vehicles' },
220
+ { code: 'EC1', description: 'Heavy Articulated' },
221
+ { code: 'EC', description: 'Extra Heavy Articulated' }
222
+ ];
223
+
224
+ /**Respond when the user has chosen a driving code */
225
+ function drivingCodeSelected(selDrivingCode: DrivingCode) {
226
+ setOutput(`${selDrivingCode.code} => ${selDrivingCode.description}`);
227
+ }
228
+ const dropdownStyle: DropdownStyle = {color: '#000', backgroundColor: '#66ff66'};
229
+
230
+ return (
231
+ <div className='w3-container' style={{padding: '5px', backgroundColor: 'green'}}>
232
+ <h1>DropdownObj Example</h1>
233
+ <p>Select driving licence code</p>
234
+ <div style={{padding: '2px', display: 'flex'}}>
235
+ <label htmlFor='driving-codes' style={{width: '70px'}}>Driving Codes</label>
236
+
237
+ <DropdownObj
238
+ label='Driving Codes'
239
+ data={drivingCodes}
240
+ displayName="description"
241
+ valueName="code"
242
+ sortFields={ ['description'] }
243
+ onItemSelected={drivingCodeSelected}
244
+ selected={drivingCodes[0]}
245
+ dropdownStyle={dropdownStyle} />
246
+ </div>
247
+
248
+ <p>{output}</p>
249
+ </div>
250
+ );
251
+ }
252
+ ```
253
+
254
+ ## 6. MultiselectionDropdown usage example
255
+
256
+ ***Javascript Example***
148
257
  ```
149
258
  import { MultiSelectionDropdown } from 'dropdowns-js';
150
259
  import 'dropdowns-js/style.css';
@@ -185,8 +294,55 @@ export default function MyComponent3() {
185
294
  );
186
295
  }
187
296
  ```
297
+
298
+ ***Typescript Example***
299
+ ```
300
+ import { MultiSelectionDropdown } from 'dropdowns-js';
301
+ import type { DropdownStyle, ButtonStyle } from 'dropdown-js';
302
+ import 'dropdowns-js/style.css';
303
+
304
+ import { useState } from 'react';
305
+
306
+ export default function MyComponent3() {
307
+ const [output, setOutput] = useState('');
308
+ const sport = [
309
+ "Motor Racing", "Cycling", "Wrestling", "Kung Fu", "Boxing", "Basket Ball",
310
+ "Rugby", "Cricket", "Running", "Soccer", "Netball", "Hockey"
311
+ ];
312
+
313
+ /**Respond when the user has chosen an interest */
314
+ function sportsSelected(selSports: string) {
315
+ // Obtain the selected items.
316
+ const selectedSport = selSports("SPORT").join(", );
317
+ setOutput(selectedSport);
318
+ }
319
+ const dropdownStyle: DropdownStyle = {color: '#000', backgroundColor: '#66ff66'};
320
+ const buttonStyle: ButtonStyle = {color: '#fff', backgroundColor: '#008000'};
321
+
322
+ return (
323
+ <div className='container' style={{padding: '5px', backgroundColor: 'green'}}>
324
+ <h1>MultiSelectionDropdown Example</h1>
325
+ <p>Select an interest, and then your topic</p>
326
+ <div style={{padding: '2px', display: 'flex'}}>
327
+ <label htmlFor='sport' style={{width: '70px'}}>Sport</label>
328
+
329
+ <MultiSelectionDropdown
330
+ label='Sport'
331
+ data={sport}
332
+ onItemsSelected={sportsSelected}
333
+ dropdownStyle={dropdownStyle}
334
+ buttonStyle={buttonStyle} />
335
+ </div>
188
336
 
337
+ <>{output}</>
338
+ </div>
339
+ );
340
+ }
341
+ ```
342
+
189
343
  ## 7. MultiSelectionDropdownObj usage example
344
+
345
+ ***Javascript Example***
190
346
  ```
191
347
  import 'dropdowns-js/style.css';
192
348
  import { MultiSelectionDropdownObj } from 'dropdowns-js';
@@ -211,8 +367,7 @@ export default function MyComponent4() {
211
367
  function drivCodesSelected(selDrivCode) {
212
368
  // Create a string array of driving codes.
213
369
  const strSelectedCodes = selDrivCodes.map((drivCode)=> drivCode.code)
214
- .map(drivCode => drivCode.code)
215
- .join(", ");
370
+ .join(", ");
216
371
  setOutput(strSelectedCodes);
217
372
  }
218
373
 
@@ -244,6 +399,72 @@ export default function MyComponent4() {
244
399
  );
245
400
  }
246
401
  ```
402
+
403
+ ***Typescript Example***
404
+ ```
405
+ import 'dropdowns-js/style.css';
406
+ import { MultiSelectionDropdownObj } from 'dropdowns-js';
407
+
408
+ import { useState } from 'react';
409
+
410
+ // Model
411
+ interface DrivingCode {
412
+ code: string;
413
+ description: string;
414
+ minAge: Number;
415
+ };
416
+
417
+ export default function MyComponent4() {
418
+ const [output, setOutput] = useState('');
419
+ const drivingCodes = [
420
+ { code: 'A1', description: 'Light Motorcycles' },
421
+ { code: 'A', description: 'Heavy Motorcycles' },
422
+ { code: 'B', description: 'Light Vehicles' },
423
+ { code: 'EB', description: 'Light Articulated' },
424
+ { code: 'C1', description: 'Heavy Vehicles' },
425
+ { code: 'C', description: 'Extra Heavy Vehicles' },
426
+ { code: 'EC1', description: 'Heavy Articulated' },
427
+ { code: 'EC', description: 'Extra Heavy Articulated' }
428
+ ];
429
+
430
+ /**Respond when the user has chosen an interest */
431
+ function drivCodesSelected(selDrivCode: DrivingCode) {
432
+ // Create a string array of driving codes.
433
+ const strSelectedCodes = selDrivCodes.map((drivCode)=> drivCode.code)
434
+ .join(", ");
435
+ setOutput(strSelectedCodes);
436
+ }
437
+ const dropdownStyle: DropdownStyle = {color: '#000', backgroundColor: '#66ff66'};
438
+ const buttonStyle: ButtonStyle = {color: '#fff', backgroundColor: '#008000'};
439
+
440
+ return (
441
+ <div className='container' style={{padding: '5px', backgroundColor: 'green'}}>
442
+ <h1>MultiSelectionDropdownObj Example</h1>
443
+ <p>Select an interest, and then your topic</p>
444
+ <div style={{padding: '2px', display: 'flex'}}>
445
+ <label htmlFor={'driving-licence-codes'} style={{width: '100px'}}>Lic. Codes</label>
446
+ <MultiSelectionDropdownObj
447
+ label='Driving Licence Codes'
448
+ data={drivingCodes}
449
+ sortFields={ ['description'] }
450
+ valueName='code'
451
+ displayName='description'
452
+ onItemsSelected={drivCodeSelected}
453
+ isDisabled={false}
454
+ dropdownStyle={dropdownStyle}
455
+ buttonStyle={buttonStyle} />
456
+ </div>
457
+
458
+ {(output.length > 0) &&
459
+ <div style={{ marginTop: '10px', padding: '5px' }}>
460
+ {output}
461
+ </div>
462
+ }
463
+
464
+ </div>
465
+ );
466
+ }
467
+ ```
247
468
 
248
469
  ## License
249
- MIT
470
+ MIT
@@ -1,6 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),M=require("react");function _e(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var oe={exports:{}},ie={exports:{}},V={};var he;function Ie(){if(he)return V;he=1;var n=typeof Symbol=="function"&&Symbol.for,O=n?Symbol.for("react.element"):60103,z=n?Symbol.for("react.portal"):60106,b=n?Symbol.for("react.fragment"):60107,T=n?Symbol.for("react.strict_mode"):60108,p=n?Symbol.for("react.profiler"):60114,S=n?Symbol.for("react.provider"):60109,m=n?Symbol.for("react.context"):60110,g=n?Symbol.for("react.async_mode"):60111,C=n?Symbol.for("react.concurrent_mode"):60111,y=n?Symbol.for("react.forward_ref"):60112,j=n?Symbol.for("react.suspense"):60113,E=n?Symbol.for("react.suspense_list"):60120,_=n?Symbol.for("react.memo"):60115,U=n?Symbol.for("react.lazy"):60116,A=n?Symbol.for("react.block"):60121,I=n?Symbol.for("react.fundamental"):60117,F=n?Symbol.for("react.responder"):60118,G=n?Symbol.for("react.scope"):60119;function k(s){if(typeof s=="object"&&s!==null){var H=s.$$typeof;switch(H){case O:switch(s=s.type,s){case g:case C:case b:case p:case T:case j:return s;default:switch(s=s&&s.$$typeof,s){case m:case y:case U:case _:case S:return s;default:return H}}case z:return H}}}function P(s){return k(s)===C}return V.AsyncMode=g,V.ConcurrentMode=C,V.ContextConsumer=m,V.ContextProvider=S,V.Element=O,V.ForwardRef=y,V.Fragment=b,V.Lazy=U,V.Memo=_,V.Portal=z,V.Profiler=p,V.StrictMode=T,V.Suspense=j,V.isAsyncMode=function(s){return P(s)||k(s)===g},V.isConcurrentMode=P,V.isContextConsumer=function(s){return k(s)===m},V.isContextProvider=function(s){return k(s)===S},V.isElement=function(s){return typeof s=="object"&&s!==null&&s.$$typeof===O},V.isForwardRef=function(s){return k(s)===y},V.isFragment=function(s){return k(s)===b},V.isLazy=function(s){return k(s)===U},V.isMemo=function(s){return k(s)===_},V.isPortal=function(s){return k(s)===z},V.isProfiler=function(s){return k(s)===p},V.isStrictMode=function(s){return k(s)===T},V.isSuspense=function(s){return k(s)===j},V.isValidElementType=function(s){return typeof s=="string"||typeof s=="function"||s===b||s===C||s===p||s===T||s===j||s===E||typeof s=="object"&&s!==null&&(s.$$typeof===U||s.$$typeof===_||s.$$typeof===S||s.$$typeof===m||s.$$typeof===y||s.$$typeof===I||s.$$typeof===F||s.$$typeof===G||s.$$typeof===A)},V.typeOf=k,V}var W={};var ye;function De(){return ye||(ye=1,process.env.NODE_ENV!=="production"&&(function(){var n=typeof Symbol=="function"&&Symbol.for,O=n?Symbol.for("react.element"):60103,z=n?Symbol.for("react.portal"):60106,b=n?Symbol.for("react.fragment"):60107,T=n?Symbol.for("react.strict_mode"):60108,p=n?Symbol.for("react.profiler"):60114,S=n?Symbol.for("react.provider"):60109,m=n?Symbol.for("react.context"):60110,g=n?Symbol.for("react.async_mode"):60111,C=n?Symbol.for("react.concurrent_mode"):60111,y=n?Symbol.for("react.forward_ref"):60112,j=n?Symbol.for("react.suspense"):60113,E=n?Symbol.for("react.suspense_list"):60120,_=n?Symbol.for("react.memo"):60115,U=n?Symbol.for("react.lazy"):60116,A=n?Symbol.for("react.block"):60121,I=n?Symbol.for("react.fundamental"):60117,F=n?Symbol.for("react.responder"):60118,G=n?Symbol.for("react.scope"):60119;function k(d){return typeof d=="string"||typeof d=="function"||d===b||d===C||d===p||d===T||d===j||d===E||typeof d=="object"&&d!==null&&(d.$$typeof===U||d.$$typeof===_||d.$$typeof===S||d.$$typeof===m||d.$$typeof===y||d.$$typeof===I||d.$$typeof===F||d.$$typeof===G||d.$$typeof===A)}function P(d){if(typeof d=="object"&&d!==null){var te=d.$$typeof;switch(te){case O:var ne=d.type;switch(ne){case g:case C:case b:case p:case T:case j:return ne;default:var pe=ne&&ne.$$typeof;switch(pe){case m:case y:case U:case _:case S:return pe;default:return te}}case z:return te}}}var s=g,H=C,K=m,J=S,t=O,o=y,l=b,r=U,i=_,f=z,c=p,v=T,h=j,X=!1;function Q(d){return X||(X=!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.")),e(d)||P(d)===g}function e(d){return P(d)===C}function a(d){return P(d)===m}function x(d){return P(d)===S}function R(d){return typeof d=="object"&&d!==null&&d.$$typeof===O}function $(d){return P(d)===y}function N(d){return P(d)===b}function D(d){return P(d)===U}function q(d){return P(d)===_}function L(d){return P(d)===z}function Z(d){return P(d)===p}function Y(d){return P(d)===T}function ee(d){return P(d)===j}W.AsyncMode=s,W.ConcurrentMode=H,W.ContextConsumer=K,W.ContextProvider=J,W.Element=t,W.ForwardRef=o,W.Fragment=l,W.Lazy=r,W.Memo=i,W.Portal=f,W.Profiler=c,W.StrictMode=v,W.Suspense=h,W.isAsyncMode=Q,W.isConcurrentMode=e,W.isContextConsumer=a,W.isContextProvider=x,W.isElement=R,W.isForwardRef=$,W.isFragment=N,W.isLazy=D,W.isMemo=q,W.isPortal=L,W.isProfiler=Z,W.isStrictMode=Y,W.isSuspense=ee,W.isValidElementType=k,W.typeOf=P})()),W}var ge;function Te(){return ge||(ge=1,process.env.NODE_ENV==="production"?ie.exports=Ie():ie.exports=De()),ie.exports}var se,me;function Me(){if(me)return se;me=1;var n=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;function b(p){if(p==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(p)}function T(){try{if(!Object.assign)return!1;var p=new String("abc");if(p[5]="de",Object.getOwnPropertyNames(p)[0]==="5")return!1;for(var S={},m=0;m<10;m++)S["_"+String.fromCharCode(m)]=m;var g=Object.getOwnPropertyNames(S).map(function(y){return S[y]});if(g.join("")!=="0123456789")return!1;var C={};return"abcdefghijklmnopqrst".split("").forEach(function(y){C[y]=y}),Object.keys(Object.assign({},C)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return se=T()?Object.assign:function(p,S){for(var m,g=b(p),C,y=1;y<arguments.length;y++){m=Object(arguments[y]);for(var j in m)O.call(m,j)&&(g[j]=m[j]);if(n){C=n(m);for(var E=0;E<C.length;E++)z.call(m,C[E])&&(g[C[E]]=m[C[E]])}}return g},se}var ae,ve;function fe(){if(ve)return ae;ve=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ae=n,ae}var ce,be;function Ee(){return be||(be=1,ce=Function.call.bind(Object.prototype.hasOwnProperty)),ce}var ue,we;function ke(){if(we)return ue;we=1;var n=function(){};if(process.env.NODE_ENV!=="production"){var O=fe(),z={},b=Ee();n=function(p){var S="Warning: "+p;typeof console<"u"&&console.error(S);try{throw new Error(S)}catch{}}}function T(p,S,m,g,C){if(process.env.NODE_ENV!=="production"){for(var y in p)if(b(p,y)){var j;try{if(typeof p[y]!="function"){var E=Error((g||"React class")+": "+m+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw E.name="Invariant Violation",E}j=p[y](S,y,g,m,null,O)}catch(U){j=U}if(j&&!(j instanceof Error)&&n((g||"React class")+": type specification of "+m+" `"+y+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof j+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),j instanceof Error&&!(j.message in z)){z[j.message]=!0;var _=C?C():"";n("Failed "+m+" type: "+j.message+(_??""))}}}}return T.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(z={})},ue=T,ue}var le,Se;function qe(){if(Se)return le;Se=1;var n=Te(),O=Me(),z=fe(),b=Ee(),T=ke(),p=function(){};process.env.NODE_ENV!=="production"&&(p=function(m){var g="Warning: "+m;typeof console<"u"&&console.error(g);try{throw new Error(g)}catch{}});function S(){return null}return le=function(m,g){var C=typeof Symbol=="function"&&Symbol.iterator,y="@@iterator";function j(e){var a=e&&(C&&e[C]||e[y]);if(typeof a=="function")return a}var E="<<anonymous>>",_={array:F("array"),bigint:F("bigint"),bool:F("boolean"),func:F("function"),number:F("number"),object:F("object"),string:F("string"),symbol:F("symbol"),any:G(),arrayOf:k,element:P(),elementType:s(),instanceOf:H,node:o(),objectOf:J,oneOf:K,oneOfType:t,shape:r,exact:i};function U(e,a){return e===a?e!==0||1/e===1/a:e!==e&&a!==a}function A(e,a){this.message=e,this.data=a&&typeof a=="object"?a:{},this.stack=""}A.prototype=Error.prototype;function I(e){if(process.env.NODE_ENV!=="production")var a={},x=0;function R(N,D,q,L,Z,Y,ee){if(L=L||E,Y=Y||q,ee!==z){if(g){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+":"+q;!a[te]&&x<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."),a[te]=!0,x++)}}return D[q]==null?N?D[q]===null?new A("The "+Z+" `"+Y+"` is marked as required "+("in `"+L+"`, but its value is `null`.")):new A("The "+Z+" `"+Y+"` is marked as required in "+("`"+L+"`, but its value is `undefined`.")):null:e(D,q,L,Z,Y)}var $=R.bind(null,!1);return $.isRequired=R.bind(null,!0),$}function F(e){function a(x,R,$,N,D,q){var L=x[R],Z=v(L);if(Z!==e){var Y=h(L);return new A("Invalid "+N+" `"+D+"` of type "+("`"+Y+"` supplied to `"+$+"`, expected ")+("`"+e+"`."),{expectedType:e})}return null}return I(a)}function G(){return I(S)}function k(e){function a(x,R,$,N,D){if(typeof e!="function")return new A("Property `"+D+"` of component `"+$+"` has invalid PropType notation inside arrayOf.");var q=x[R];if(!Array.isArray(q)){var L=v(q);return new A("Invalid "+N+" `"+D+"` of type "+("`"+L+"` supplied to `"+$+"`, expected an array."))}for(var Z=0;Z<q.length;Z++){var Y=e(q,Z,$,N,D+"["+Z+"]",z);if(Y instanceof Error)return Y}return null}return I(a)}function P(){function e(a,x,R,$,N){var D=a[x];if(!m(D)){var q=v(D);return new A("Invalid "+$+" `"+N+"` of type "+("`"+q+"` supplied to `"+R+"`, expected a single ReactElement."))}return null}return I(e)}function s(){function e(a,x,R,$,N){var D=a[x];if(!n.isValidElementType(D)){var q=v(D);return new A("Invalid "+$+" `"+N+"` of type "+("`"+q+"` supplied to `"+R+"`, expected a single ReactElement type."))}return null}return I(e)}function H(e){function a(x,R,$,N,D){if(!(x[R]instanceof e)){var q=e.name||E,L=Q(x[R]);return new A("Invalid "+N+" `"+D+"` of type "+("`"+L+"` supplied to `"+$+"`, expected ")+("instance of `"+q+"`."))}return null}return I(a)}function K(e){if(!Array.isArray(e))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.")),S;function a(x,R,$,N,D){for(var q=x[R],L=0;L<e.length;L++)if(U(q,e[L]))return null;var Z=JSON.stringify(e,function(ee,d){var te=h(d);return te==="symbol"?String(d):d});return new A("Invalid "+N+" `"+D+"` of value `"+String(q)+"` "+("supplied to `"+$+"`, expected one of "+Z+"."))}return I(a)}function J(e){function a(x,R,$,N,D){if(typeof e!="function")return new A("Property `"+D+"` of component `"+$+"` has invalid PropType notation inside objectOf.");var q=x[R],L=v(q);if(L!=="object")return new A("Invalid "+N+" `"+D+"` of type "+("`"+L+"` supplied to `"+$+"`, expected an object."));for(var Z in q)if(b(q,Z)){var Y=e(q,Z,$,N,D+"."+Z,z);if(Y instanceof Error)return Y}return null}return I(a)}function t(e){if(!Array.isArray(e))return process.env.NODE_ENV!=="production"&&p("Invalid argument supplied to oneOfType, expected an instance of array."),S;for(var a=0;a<e.length;a++){var x=e[a];if(typeof x!="function")return p("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+X(x)+" at index "+a+"."),S}function R($,N,D,q,L){for(var Z=[],Y=0;Y<e.length;Y++){var ee=e[Y],d=ee($,N,D,q,L,z);if(d==null)return null;d.data&&b(d.data,"expectedType")&&Z.push(d.data.expectedType)}var te=Z.length>0?", expected one of type ["+Z.join(", ")+"]":"";return new A("Invalid "+q+" `"+L+"` supplied to "+("`"+D+"`"+te+"."))}return I(R)}function o(){function e(a,x,R,$,N){return f(a[x])?null:new A("Invalid "+$+" `"+N+"` supplied to "+("`"+R+"`, expected a ReactNode."))}return I(e)}function l(e,a,x,R,$){return new A((e||"React class")+": "+a+" type `"+x+"."+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+$+"`.")}function r(e){function a(x,R,$,N,D){var q=x[R],L=v(q);if(L!=="object")return new A("Invalid "+N+" `"+D+"` of type `"+L+"` "+("supplied to `"+$+"`, expected `object`."));for(var Z in e){var Y=e[Z];if(typeof Y!="function")return l($,N,D,Z,h(Y));var ee=Y(q,Z,$,N,D+"."+Z,z);if(ee)return ee}return null}return I(a)}function i(e){function a(x,R,$,N,D){var q=x[R],L=v(q);if(L!=="object")return new A("Invalid "+N+" `"+D+"` of type `"+L+"` "+("supplied to `"+$+"`, expected `object`."));var Z=O({},x[R],e);for(var Y in Z){var ee=e[Y];if(b(e,Y)&&typeof ee!="function")return l($,N,D,Y,h(ee));if(!ee)return new A("Invalid "+N+" `"+D+"` key `"+Y+"` supplied to `"+$+"`.\nBad object: "+JSON.stringify(x[R],null," ")+`
2
- Valid keys: `+JSON.stringify(Object.keys(e),null," "));var d=ee(q,Y,$,N,D+"."+Y,z);if(d)return d}return null}return I(a)}function f(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(f);if(e===null||m(e))return!0;var a=j(e);if(a){var x=a.call(e),R;if(a!==e.entries){for(;!(R=x.next()).done;)if(!f(R.value))return!1}else for(;!(R=x.next()).done;){var $=R.value;if($&&!f($[1]))return!1}}else return!1;return!0;default:return!1}}function c(e,a){return e==="symbol"?!0:a?a["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&a instanceof Symbol:!1}function v(e){var a=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":c(a,e)?"symbol":a}function h(e){if(typeof e>"u"||e===null)return""+e;var a=v(e);if(a==="object"){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return a}function X(e){var a=h(e);switch(a){case"array":case"object":return"an "+a;case"boolean":case"date":case"regexp":return"a "+a;default:return a}}function Q(e){return!e.constructor||!e.constructor.name?E:e.constructor.name}return _.checkPropTypes=T,_.resetWarningCache=T.resetWarningCache,_.PropTypes=_,_},le}var de,xe;function Ae(){if(xe)return de;xe=1;var n=fe();function O(){}function z(){}return z.resetWarningCache=O,de=function(){function b(S,m,g,C,y,j){if(j!==n){var E=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 E.name="Invariant Violation",E}}b.isRequired=b;function T(){return b}var p={array:b,bigint:b,bool:b,func:b,number:b,object:b,string:b,symbol:b,any:b,arrayOf:T,element:b,elementType:b,instanceOf:T,node:b,objectOf:T,oneOf:T,oneOfType:T,shape:T,exact:T,checkPropTypes:z,resetWarningCache:O};return p.PropTypes=p,p},de}var je;function ze(){if(je)return oe.exports;if(je=1,process.env.NODE_ENV!=="production"){var n=Te(),O=!0;oe.exports=qe()(n.isElement,O)}else oe.exports=Ae()();return oe.exports}var Ne=ze();const u=_e(Ne);var B={},Ce;function Le(){if(Ce)return B;Ce=1;function n(t){return t?/^[a-zA-Z][a-zA-Z0-9_-]{2,50}$/.test(t):!1}B.isValidUserName=n;function O(t){return t?/^[A-Za-z' -]{2,50}$/.test(t):!1}B.isValidName=O;function z(t){return t?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(t):!1}B.isValidEmail=z;function b(t){return t?/^[0-9]{10,15}$/g.test(t):!1}B.isValidPhoneNum=b;function T(t){return t?/^[a-zA-Z0-9.\-\(\) ]{2,}$/.test(t):!1}B.isValidOrganisationName=T;function p(t){return!(!t||t.length<6||/[A-Z]/.test(t)===!1||/[a-z]/.test(t)===!1||/[0-9]/.test(t)===!1||/[\s]/.test(t)||/[\][!"#$%&'()*+,./:;<=>?@^\\_`{|}~-]/.test(t)===!1)}B.isValidPassword=p;function S(t){let o=t.getFullYear(),l=t.getMonth()+1;l=g(l,2);let r=t.getDate();return r=g(r,2),`${o}-${l}-${r}`}B.timeStampYyyyMmDd=S;function m(t){let o=g(t.getHours(),2),l=g(t.getMinutes(),2),r=g(t.getSeconds(),2),i=g(t.getMilliseconds(),3);return`${S(t)}T${o}:${l}:${r}.${i}`}B.timeStampString=m;function g(t,o){let l=t+"";const r=o-l.length;for(let i=1;i<=r;i++)l="0"+l;return l}B.addLeadingZeros=g;function C(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"ZAR"}).format(t).replace(/ZAR/gi,"R")}B.toZarCurrencyFormat=C;function y(t){if(Object.prototype.toString.call(t)!=="[object Object]")return t instanceof Date?new Date(t):(["string","number","boolean"].includes(typeof t),t);const o=[{...t}];let l=0;for(;l<o.length;){let r=o[l];if(Object.prototype.toString.call(r)==="[object Object]")for(let i in r)r[i]instanceof Date?r[i]=new Date(r[i]):Object.prototype.toString.call(r[i])==="[object Object]"&&(r[i]={...r[i]}),o.push(r[i]);l++}return o[0]}B.deepClone=y;function j(t){const o=[{value:t}];let l=0;for(;l<o.length;){const r=o[l];if(Object.prototype.toString.call(r.value)==="[object Object]"){for(const i in r.value){let f=r.path?r.path+"."+i:i;o.push({value:r.value[i],path:f})}r.remove=!0}l++}return o.filter(r=>!r.remove).map(r=>r.path)}B.getPaths=j;function E(t){let o=y(t),l=0;const r=j(o).toSorted();sortedObj={};for(l in r){const i=r[l],f=_(o,i);U(sortedObj,i,f)}return sortedObj}B.getSortedObject=E;function _(t,o,l=void 0){let r=o.split("."),i=t;for(let f in r){let c=r[f];if(i[c]===void 0||(i=i[c],i===void 0))return l}return i}B.get=_;function U(t,o,l){let r=t,i=o.split(".");for(let f in i){let c=i[f];f<i.length-1?(c in r||(r[c]={}),r=r[c]):r[c]=l}}B.set=U;function A(t,o){let l=o.split("."),r=t;for(let i in l){let f=l[i];if(Object.prototype.toString.call(r)!=="[object Object]"||r[f]===void 0)return;i<l.length-1?r=r[f]:delete r[f]}}B.unset=A;function I(t,...o){if(!o||!o.length)throw new Error("fields must be specified");const l=j(t);let r=0;for(const i in l){const f=l[i];if(o.includes(f))r++;else return!1}return r>0}B.hasOnly=I;function F(t,...o){if(!o||!o.length)throw new Error("fields must be specified");const l=j(t);let r=0;for(const i in o){const f=o[i];if(l.includes(f))r++;else return!1}return r===o.length}B.hasAll=F;function G(t,...o){return I(t,...o)&&F(t,...o)}B.hasOnlyAll=G;function k(t,o,l=0,r="asc"){const i=["asc","desc"];if(!["asc","desc"].includes(r))throw new Error(`arraySortDir must be one of ${i}`);if(t.length===0)return-1;let f=l,c=t.length-1;for(;f<c;){if(P(t[f],o)===0)return f;if(P(t[c],o)===0)return c;const v=Math.trunc((f+c)/2),h=P(t[v],o,r);if(h<0)f=v+1;else if(h>0)c=v-1;else return v}return f}B.binarySearch=k;function P(t,o,l="asc"){if(!["asc","desc"].includes(l))throw new Error(`sortDir must be one of ${l}`);const r=l==="desc"?-1:1;return t>o?r:t<o?-r:0}B.compare=P;function s(t,o,l=0,...r){if(t.length===0)return-1;let i=l,f=t.length-1;for(;i<f;){if(J(t[i],o,...r)===0)return i;if(J(t[f],o,...r)===0)return f;let c=Math.trunc((i+f)/2);if(J(t[c],o,...r)<0)i=c+1;else if(J(t[c],o,...r)>0)f=c-1;else return c}return i}B.binarySearchObj=s;function H(t,o,l,...r){let i=l,f=t.length-1;if(i>=t.length)throw new Error("startFrom is outside the bounds of the array.");if(J(o,t[i],...r)>0)throw new Error("targetObj is to the right ('greater than') objArray[startFrom].");for(;i<f;){let c=Math.trunc((i+f)/2);J(o,t[c],...r)===0?i=c+1:J(o,t[c],...r)<0&&(f=c)}return J(o,t[i],...r)===0?-1:i}B.getNextDifferent=H;function K(t,o,...l){if(t.length<=1)return[...t];if(typeof o!="boolean")throw new Error("firstOfDuplicates must be boolean true or false.");const r=[];let i=0;for(;i<t.length-1&&(o&&r.push(t[i]),i=H(t,t[i],i+1,...l),!(i<0));){let f=i-1;o||r.push(t[f])}return r.length===0?o?r.push(t[0]):r.push(t[t.length-1]):J(r[r.length-1],t[t.length-1],...l)!==0&&r.push(t[t.length-1]),r}B.getObjArrayWithNoDuplicates=K;function J(t,o,...l){if(l.length===0)throw new Error("comparisonFields not supplied!");const r=["","asc","desc"];for(const i in l){const f=l[i].split(" "),c=f[0];let v="";if(f.length===2&&(v=f[1]),!r.includes(v))throw new Error("Sort direction must be one of "+r.toString());const h=_(t,c),X=_(o,c),Q=v==="desc"?-1:1;if(h>X)return Q;if(h<X)return-Q}return 0}return B.objCompare=J,B}var re=Le();function Oe({label:n,data:O,sortOrder:z="asc",onItemSelected:b=null,selected:T=null,dropdownStyle:p,isDisabled:S=!1}){const m=M.useId(),[g,C]=M.useState(!1),[y,j]=M.useState(""),E=M.useMemo(()=>O.toSorted(s),[O]),_=M.useMemo(()=>{if(y.length===0)return[];const r=y.toUpperCase();return E.filter(i=>i.toUpperCase().includes(r))},[E,y]),U=M.useMemo(()=>y.length===0?E:_,[E,y]),[A,I]=M.useState(""),[F,G]=M.useState(null);M.useMemo(()=>{let r="";if(F)r=F;else if(T){const i=O.findIndex(f=>f===T);i>=0&&(r=O[i])}return I(r),r},[T,F]);const k=(()=>{const r={backgroundColor:p?.backgroundColor,color:p?.color};return p?.fontSize&&(r.fontSize=p?.fontSize),r})(),P=p?.borderColor;function s(r,i){return re.compare(r,i,z)}function H(r){j(r.target.value),I(r.target.value),_.length===0?t():o()}async function K(r){I(r),j(""),G(r),b!==null&&b(r),t()}function J(){g?t():o()}function t(){C(!1)}function o(){U.length>0&&C(!0)}const l={dropdownSearch:`dropdownSearch-${m}`,dropdown:`dropdown-${m}`};return w.jsxs("div",{className:`dropdown-js dropdown-js-rounded
3
- ${P&&`dropdown-js-border ${P}`}`,style:{...S?{pointerEvents:"none"}:{}},children:[w.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:k,children:[w.jsx("input",{id:l.dropdownSearch,name:"dropdownSearch",className:"dropdown-js-input dropdown-js-rounded",autoComplete:"off",type:"text",style:k,role:"combobox","aria-placeholder":`Type to Search for ${n}`,"aria-required":!0,"aria-controls":l.dropdown,"aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":g,onChange:r=>H(r),disabled:S,placeholder:`Type to Search for ${n}`,value:A}),w.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-expanded":g,"aria-controls":"multiSelectionDropdown","aria-label":`${n} options`,onClick:r=>J(),children:w.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding","aria-label":`${n} options`,"aria-expanded":g,children:g?"-":"+"})})]}),w.jsx("div",{className:`dropdown-js-padding dropdown-js-menu ${!g&&"dropdown-js-hide"}`,id:l.dropdown,name:"dropDown",role:"listbox","aria-expanded":g,disabled:S,"aria-label":n,style:{...k,marginTop:"3.5px"},children:U.map((r,i)=>w.jsxs("div",{name:r,role:"option","aria-label":r,style:{cursor:"pointer"},onClick:f=>K(r),children:[r,i<U.length-1&&w.jsx("hr",{style:{borderColor:k.color}})]},`${i}#${r}`))})]})}Oe.propTypes={label:u.string.isRequired,data:u.array.isRequired,sortOrder:u.string,selected:u.any,isDisabled:u.bool,onItemSelected:u.func,dropdownStyle:u.shape({color:u.string.isRequired,backgroundColor:u.string.isRequired,fontSize:u.string,borderColor:u.string}),buttonStyle:u.shape({color:u.string.isRequired,backgroundColor:u.string.isRequired,fontSize:u.string,borderColor:u.string})};function Re({label:n,data:O,sortFields:z,selected:b=null,displayName:T,valueName:p,isDisabled:S=!1,onItemSelected:m=null,dropdownStyle:g}){const C=M.useId(),[y,j]=M.useState(null),[E,_]=M.useState(""),[U,A]=M.useState(""),I=M.useMemo(()=>O.toSorted(o),[O]),F=M.useMemo(()=>{if(U.length===0)return[];const h=U.toUpperCase();return I.filter(X=>X[T].toUpperCase().toUpperCase().includes(h))},[U]),[G,k]=M.useState(""),[P,s]=M.useState(null);M.useMemo(()=>{let h;if(P)h={...P};else if(b){const X=l(),Q=O.findIndex(e=>re.get(e,...X)===re.get(b,...X));Q>=0&&(h=O[Q])}return h&&k(h[T]),h},[b,P]);const H=M.useMemo(()=>U.length>0?F:I,[U,I]),K=(()=>{const h={backgroundColor:g?.backgroundColor,color:g?.color};return g?.fontSize&&(h.fontSize=g?.fontSize),h})(),J=g?.borderColor;async function t(h){A(X=>h.target.value),k(X=>h.target.value),F.length>0?c():f()}function o(h,X){return re.objCompare(h,X,...z)}function l(){let h=E;return h||(O.length>0&&(h=re.getPaths(O[0])),_(h)),h}function r(h){s(h),m!==null&&m(h),f()}function i(){y?f():c()}function f(){j(!1)}function c(){H.length>0&&j(!0)}const v={dropdownSearch:`dropdownObjSearch-${C}`,dropdownObj:`dropdownObj-${C}`};return w.jsxs("div",{className:`dropdown-js dropdown-js-rounded
4
- ${J&&`dropdown-js-border ${J}`}`,style:{...S?{pointerEvents:"none"}:{}},children:[w.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:K,children:[w.jsx("input",{id:v.dropdownSearch,name:"dropdownObjSearch",className:"dropdown-js-input dropdown-js-rounded",style:K,type:"text",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-controls":v.dropdownObj,"aria-expanded":y,"aria-placeholder":`Type to Search for ${n}`,"aria-required":!0,onChange:h=>t(h),disabled:S,placeholder:`Type to Search for ${n}`,value:G}),w.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-label":`${n} options`,"aria-expanded":y,onClick:h=>i(),children:w.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:y?"-":"+"})})]}),w.jsx("div",{className:`dropdown-js-padding dropdown-js-menu ${!y&&"dropdown-js-hide"}`,id:v.dropdownObj,name:"dropDownObj",role:"listbox","aria-expanded":y,style:{...K,marginTop:"3.5px"},children:H.map((h,X)=>w.jsxs("div",{name:h[T],role:"option","aria-label":h[T],style:{cursor:"pointer"},onClick:Q=>r(h),children:[h[T],X<H.length-1&&w.jsx("hr",{style:{borderColor:K.color}})]},`${h[p]}${X}`))})]})}Re.propTypes={label:u.string.isRequired,data:u.arrayOf(u.object).isRequired,sortFields:u.arrayOf(u.string).isRequired,selected:u.object,displayName:u.string.isRequired,valueName:u.string.isRequired,isDisabled:u.bool,onItemSelected:u.func,dropdownStyle:u.shape({color:u.string.isRequired,backgroundColor:u.string.isRequired,fontSize:u.string,borderColor:u.string})};function $e({label:n,data:O,sortFields:z,selectedData:b=[],maxNumSelections:T=null,displayName:p,valueName:S,isDisabled:m=!1,onItemsSelected:g=null,dropdownStyle:C,buttonStyle:y}){const j=M.useId(),[E,_]=M.useState(!1),[U,A]=M.useState(""),[I,F]=M.useState(""),G=M.useMemo(()=>O.toSorted(l),[O]),[k,P]=M.useState([]),s=M.useMemo(()=>k.length>0?k.filter(e=>G.findIndex(a=>{const x=o();return re.objCompare(e,a,...x)===0})>=0).toSorted(l):b.filter(e=>G.findIndex(a=>{const x=o();return re.objCompare(e,a,...x)===0})>=0).toSorted(l),[G,b,k]),H=M.useMemo(()=>{if(I.length===0)return[];const e=I.toUpperCase();return G.filter(a=>a[p].toUpperCase().includes(e))},[I]),K=M.useMemo(()=>I.length>0?H:G,[I,G]),J=(()=>{const e={backgroundColor:C?.backgroundColor,color:C?.color};return C?.fontSize&&(e.fontSize=C?.fontSize),e})(),t=C?.borderColor;M.useEffect(()=>{if(!p)throw new Error("displayName must be provided");if(!S)throw new Error("valueName must be provided")},[]);function o(){let e=U;return e||(O.length>0&&(e=re.getPaths(O[0])),A(e)),e}function l(e,a){return re.objCompare(e,a,...z)}function r(e){F(e.target.value),H.length>0?X():h()}function i(e){let a=[...s];if(f(e))a=a.filter(x=>{const R=o();return re.objCompare(x,e,...R)!==0});else{if(T!==null&&s.length>=T)return;a.push(e)}P(a)}function f(e){const a=o();return s.findIndex(x=>re.objCompare(x,e,...a)===0)>=0}function c(e){const a=o(),x=s.filter(R=>re.objCompare(R,e,...a)!==0);P(x),g!==null&&g(x)}function v(){E?h():X()}function h(){_(!1),g!==null&&g(s)}function X(){K.length>0&&_(!0)}const Q={multiSelectionDropdownObjSearch:`multiSelectionDropdownSearch-${j}`,multiSelectionDropdownObj:`multiSelectionDropdown-${j}`,selectedItems:`selectedItems-${j}`};return w.jsxs("div",{className:`dropdown-js dropdown-js-rounded
5
- ${t&&`dropdown-js-border ${t}`}`,style:{...m?{pointerEvents:"none"}:{}},children:[w.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:J,children:[w.jsx("div",{children:w.jsx("input",{id:Q.multiSelectionDropdownObjSearch,name:"multiSelectionDropdownObjSearch",className:"dropdown-js-input dropdown-js-rounded",style:J,"aria-label":n,"aria-autocomplete":"list","aria-controls":Q.multiSelectionDropdownObj,role:"combobox","aria-expanded":E,"aria-haspopup":"listbox",type:"text",autoComplete:"off","aria-placeholder":`Type to Search for ${n}`,onChange:e=>r(e),placeholder:`Type to Search for ${n}`,value:I})}),w.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-expanded":E,"aria-controls":"multiSelectionDropdownObj","aria-label":`${n} options`,onClick:e=>v(),children:w.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:E?"-":"+"})})]}),w.jsx("div",{className:"dropdown-js-padding dropdown-js-selected-wrapper dropdown-js-selected-container",children:w.jsx("div",{id:Q.selectedItems,className:"dropdown-js-selected-items","aria-label":`Selected ${n} options`,"aria-multiselectable":!0,"aria-live":"polite",children:s.map(e=>w.jsxs("span",{className:"dropdown-js-padding dropdown-js-rounded","aria-label":`${e[p]}`,style:{...J,margin:"3.5px",marginRight:"0px"},children:[e[p]," ",w.jsx("span",{className:"dropdown-js-padding",style:{cursor:"pointer"},"aria-label":`Remove ${e[p]}`,onClick:a=>c(e),children:"×"})]},`${e[S]}${e[p]}`))})}),w.jsxs("div",{className:`dropdown-js-padding dropdown-js-menu dropdown-js-rounded ${!E&&"dropdown-js-hide"}`,style:J,id:Q.multiSelectionDropdownObj,name:"multiSelectionDropdownObj",role:"listbox","aria-multiselectable":!0,"aria-expanded":E,children:[K.map(e=>w.jsxs("div",{children:[w.jsx("input",{id:`${e[S]}Checkbox`,type:"checkbox",name:`${e[p]}Checkbox`,role:"option","aria-label":`${e[p]}`,"aria-checked":f(e),style:{cursor:"pointer"},checked:f(e),onChange:a=>i(e),value:e[S]}),w.jsx("label",{style:{marginLeft:"5px"},htmlFor:`${e[S]}`,children:e[p]}),w.jsx("hr",{style:{backgroundColor:J.color,border:"none",height:"0.5px"}})]},`${e[S]}${e[p]}`)),w.jsx("button",{className:"dropdown-js-padding dropdown-js-round",style:y,title:"Done",disabled:K.length===0,"aria-label":`Close ${n} options`,onClick:e=>h(),type:"button",children:"Done"})]})]})}$e.propTypes={label:u.string.isRequired,data:u.arrayOf(u.object).isRequired,sortFields:u.arrayOf(u.string).isRequired,selectedData:u.arrayOf(u.object),maxNumSelections:u.number,displayName:u.string.isRequired,valueName:u.string.isRequired,isDisabled:u.bool,onItemsSelected:u.func,dropdownStyle:u.shape({color:u.string.isRequired,backgroundColor:u.string.isRequired,fontSize:u.string,borderColor:u.string}),buttonStyle:u.shape({color:u.string.isRequired,backgroundColor:u.string.isRequired,fontSize:u.string,borderColor:u.string})};function Pe({label:n,data:O,sortOrder:z="asc",selectedData:b=[],maxNumSelections:T=null,isDisabled:p=!1,onItemsSelected:S=null,dropdownStyle:m,buttonStyle:g}){const C=M.useId(),[y,j]=M.useState(!1),E=M.useMemo(()=>O.toSorted(H),[O]),[_,U]=M.useState(""),[A,I]=M.useState([]),F=M.useMemo(()=>A.length>0?A.filter(c=>E.findIndex(v=>v===c)>=0).toSorted(H):b.filter(c=>E.findIndex(v=>v===c)>=0).toSorted(H),[E,b,A]),G=M.useMemo(()=>{if(_.length===0)return[];const c=_.toUpperCase();return E.filter(v=>v.toUpperCase().includes(c))},[_]),k=M.useMemo(()=>_.length>0?G:E,[_,E]),P=(()=>{const c={backgroundColor:m?.backgroundColor,color:m?.color};return m?.fontSize&&(c.fontSize=m?.fontSize),c})(),s=m?.borderColor;function H(c,v){return re.compare(c,v,z)}function K(c){const v=c.target.value;U(v),k.length>0?i():r()}function J(c){let v=[...F];if(t(c))v=v.filter(h=>h!==c);else{if(T!==null&&v.length>=T)return;v.push(c)}I(v)}function t(c){return F.findIndex(v=>v===c)>=0}function o(c){const v=F.filter(h=>h!==c);I(h=>v),S!==null&&S(v)}function l(){y?r():i()}function r(){j(!1),S!==null&&S(F)}function i(){k.length>0&&j(!0)}const f={multiSelectionDropdownSearch:`multiSelectionDropdown-${C}`,multiSelectionDropdown:`multiSelectionDropdown-${C}`,selectedItems:`selectedItems-${C}`};return w.jsxs("div",{className:`dropdown-js dropdown-js-rounded
6
- ${s&&`dropdown-js-border ${s}`}`,style:{...p?{pointerEvents:"none"}:{}},children:[w.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:P,children:[w.jsx("div",{children:w.jsx("input",{className:"dropdown-js-input dropdown-js-rounded",id:f.multiSelectionDropdownSearch,name:"multiselectionDropdownSearch",style:P,type:"text",autoComplete:"off",role:"combobox","aria-label":n,"aria-placeholder":`Type to search for ${n}`,"aria-autocomplete":"list","aria-controls":f.multiSelectionDropdown,"aria-expanded":y,"aria-haspopup":"listbox",onChange:c=>K(c),placeholder:`Type to Search for ${n}`,value:_})}),w.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-expanded":y,"aria-controls":"multiSelectionDropdown","aria-label":`${n} options`,onClick:c=>l(),children:w.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:y?"-":"+"})})]}),w.jsx("div",{className:"dropdown-js-padding dropdown-js-selected-wrapper dropdown-js-selected-container",children:w.jsx("div",{id:f.selectedItems,className:"dropdown-js-selected-items","aria-label":`Selected ${n} options`,"aria-live":"polite",children:F.map(c=>w.jsxs("span",{className:"dropdown-js-padding dropdown-js-rounded","aria-label":`${c}`,style:{...P,margin:"3.5px",marginRight:"0px"},children:[c," ",w.jsx("span",{style:{cursor:"pointer"},"aria-label":`Remove ${c}`,onClick:v=>o(c),children:"×"})]},`${c}`))})}),w.jsxs("div",{className:`dropdown-js-padding dropdown-js-menu dropdown-js-rounded ${!y&&"dropdown-js-hide"}`,style:P,id:f.multiSelectionDropdown,name:"multiSelectionDropdown",role:"listbox","aria-multiselectable":!0,"aria-expanded":y,children:[k.map((c,v)=>w.jsxs("div",{children:[w.jsx("input",{type:"checkbox",name:`${c}Checkbox`,role:"option","aria-label":c,"aria-checked":t(c),style:{cursor:"pointer"},checked:t(c),onChange:h=>J(c),value:c}),w.jsx("label",{style:{marginLeft:"5px"},htmlFor:`${c}`,children:c}),w.jsx("hr",{style:{backgroundColor:P.color,border:"none",height:"0.5px"}})]},`${v}#${c}`)),w.jsx("button",{className:"dropdown-js-padding dropdown-js-round",style:g,"aria-label":`Click to collapse ${n} options`,title:"Done",disabled:k.length===0,onClick:c=>r(),type:"button",children:"Done"})]})]})}Pe.propTypes={label:u.string.isRequired,data:u.array.isRequired,sortOrder:u.string,selectedData:u.array,maxNumSelections:u.number,isDisabled:u.bool,onItemsSelected:u.func,dropdownStyle:u.shape({color:u.string.isRequired,backgroundColor:u.string.isRequired,fontSize:u.string,borderColor:u.string}),buttonStyle:u.shape({color:u.string.isRequired,backgroundColor:u.string.isRequired,fontSize:u.string,borderColor:u.string})};exports.Dropdown=Oe;exports.DropdownObj=Re;exports.MultiSelectionDropdown=Pe;exports.MultiSelectionDropdownObj=$e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react");function B(i){return i===null||typeof i!="object"||Object.prototype.toString.call(i)!=="[object Object]"?!1:i.constructor===Object}function H(i){if(!B(i))return[];const n=[{value:i}];let f=0;for(;f<n.length;){const c=n[f];if(B(c.value)){for(const a in c.value){let d=c.path?c.path+"."+a:a;n.push({value:c.value[a],path:d})}c.remove=!0}f++}return n.filter(c=>!c.remove).map(c=>c.path)}function G(i,n,f=void 0){if(!B(i))return;let c=n.split("."),a=i;for(let d=0;d<c.length;d++){let u=c[d];if(!(u in a)||(a=a[u],a===void 0))return f}return c.length===0?f:a}function J(i,n,f="asc"){if(!["asc","desc"].includes(f))throw new Error(`sortDir must be one of ${f}`);const c=f==="desc"?-1:1;return i>n?c:i<n?-c:0}function V(i,n,...f){if(!f||!f.length)throw new Error("comparisonFields not supplied!");if(!B(i)||!B(n))throw new Error("Both obj1 and obj2 must be plain objects.");const c=["","asc","desc"];for(let a=0;a<f.length;a++){const d=f[a].split(" "),u=d[0];let w="";if(d.length>2)throw new Error("Each comparison field must be of the form 'fieldName sortDirection' or 'fieldName'.");if(d.length===2&&(w=d[1]),!c.includes(w))throw new Error("Sort direction must be one of "+c.toString());const $=G(i,u),m=G(n,u),j=["string","number","bigint","boolean"];if(!(j.includes(typeof $)||j.includes(typeof m)||$ instanceof Date||m instanceof Date))throw new Error("Comparison values must be primitive type or Date instance");if(typeof $!=typeof m)throw new Error("Comparison values must be of the same type");const b=w==="desc"?-1:1;if($>m)return b;if($<m)return-b}return 0}function Q({label:i,data:n,sortOrder:f="asc",onItemSelected:c,selected:a,selReset:d=!1,dropdownStyle:u,isDisabled:w=!1}){const $=["number","string","boolean","bigint"];if(n.length>0&&n.some(l=>l===null||!$.includes(typeof l)))throw new Error(`Dropdown items must be one of ${$}`);const m=s.useId(),[j,b]=s.useState(!1),[x,y]=s.useState(""),v=s.useMemo(()=>n.toSorted(k),[n]),g=s.useMemo(()=>{if(x.length===0)return v;const l=x.toUpperCase();return v.filter(p=>p.toUpperCase().includes(l))},[v,x]),[M,D]=s.useState(""),[C,T]=s.useState(),z=s.useMemo(()=>{let l,p=-1;return C&&d===!1?(p=n.findIndex(e=>e===C),p>=0&&(l=n[p])):a&&(p=n.findIndex(e=>e===a),p>=0&&(l=n[p])),p>=0?D(l):D(""),l},[d,a,C]),[I,O]=s.useState(0);s.useEffect(()=>{I>0&&C&&c&&c(z)},[I]);const S=(()=>{const l={backgroundColor:u?.backgroundColor,color:u?.color};return u?.fontSize&&(l.fontSize=u.fontSize),l})(),U=u?.borderColor;function k(l,p){return J(l,p,f)}function N(l){y(l.target.value),D(l.target.value),K()}async function P(l){d||(D(l),y(""),T(l),F(),O(p=>p+1))}function q(){w||(j?F():K())}function F(){b(!1)}function K(){g.length>0&&b(!0)}const L={dropdownSearch:`dropdownSearch-${m}`,dropdown:`dropdown-${m}`};return r.jsxs("div",{className:`dropdown-js dropdown-js-rounded
2
+ ${U&&`dropdown-js-border ${U}`}`,style:{...w?{pointerEvents:"none"}:{}},children:[r.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:S,children:[r.jsx("input",{id:L.dropdownSearch,name:"dropdownSearch",className:"dropdown-js-input dropdown-js-rounded",autoComplete:"off",type:"text",style:S,role:"combobox","aria-placeholder":`Type to Search for ${i}`,"aria-required":!0,"aria-controls":L.dropdown,"aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":j,onChange:l=>N(l),disabled:w,placeholder:`Type to Search for ${i}`,value:M}),r.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-expanded":j,"aria-controls":"multiSelectionDropdown","aria-label":`${i} options`,onClick:()=>q(),children:r.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding","aria-label":`${i} options`,"aria-expanded":j,children:j?"-":"+"})})]}),r.jsx("ul",{className:`dropdown-js-padding dropdown-js-menu ${!j&&"dropdown-js-hide"}`,id:L.dropdown,role:"listbox","aria-expanded":j,"aria-disabled":w,"aria-label":i,style:{...S,marginTop:"3.5px"},children:g.map((l,p)=>r.jsxs("li",{role:"option","aria-label":l,style:{cursor:"pointer"},onClick:()=>P(l),children:[l,p<g.length-1&&r.jsx("hr",{style:{borderColor:S.color}})]},`${p}#${l}`))})]})}function W({label:i,data:n,sortFields:f,selected:c=null,selReset:a=!1,displayName:d,valueName:u,isDisabled:w=!1,onItemSelected:$,dropdownStyle:m}){s.useState(()=>(n.forEach(e=>{if(!B(e))throw new Error("[Dropdowns-js] Non plain object found");const t=Object.keys(e);if(!t.includes(d))throw new Error(`[Dropdowns-js] displayName field ${d} not found`);if(!t.includes(u))throw new Error(`[Dropdowns-js] valueName field ${u} not found`)}),!0));const j=s.useId(),[b,x]=s.useState(!1),[y,v]=s.useState(""),g=s.useMemo(()=>n.length>0?H(n[0]):[],[n]),M=s.useMemo(()=>n.toSorted(q),[n]),D=s.useMemo(()=>{if(y.length===0)return M;const e=y.toUpperCase();return M.filter(t=>t[d].toUpperCase().includes(e))},[y,M]),[C,T]=s.useState(0);s.useEffect(()=>{C>0&&O&&$&&$(U)},[C]);const[z,I]=s.useState(""),[O,S]=s.useState(null),U=s.useMemo(()=>{let e=null,t=-1;return O&&a===!1?(t=n.findIndex(o=>V(o,O,...g)===0),t>=0&&(e=n[t])):c&&(t=n.findIndex(o=>V(o,c,...g)===0),t>=0&&(e=n[t])),t>=0?I(e[d]):I(""),e},[c,O]),k=(()=>{const e={backgroundColor:m?.backgroundColor,color:m?.color};return m?.fontSize&&(e.fontSize=m?.fontSize),e})(),N=m?.borderColor;async function P(e){v(e.target.value),I(e.target.value),l()}function q(e,t){return V(e,t,...f)}function F(e){a||(S({...e}),v(""),L(),T(t=>t+1))}function K(){b?L():l()}function L(){x(!1)}function l(){D.length>0&&x(!0)}const p={dropdownSearch:`dropdownObjSearch-${j}`,dropdownObj:`dropdownObj-${j}`};return r.jsxs("div",{className:`dropdown-js dropdown-js-rounded
3
+ ${N&&`dropdown-js-border ${N}`}`,style:{...w?{pointerEvents:"none"}:{}},children:[r.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:k,children:[r.jsx("input",{id:p.dropdownSearch,name:"dropdownObjSearch",className:"dropdown-js-input dropdown-js-rounded",style:k,type:"text",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-controls":p.dropdownObj,"aria-expanded":b,"aria-placeholder":`Type to Search for ${i}`,"aria-required":!0,onChange:e=>P(e),disabled:w,placeholder:`Type to Search for ${i}`,value:z}),r.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-label":`${i} options`,"aria-expanded":b,onClick:()=>K(),children:r.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:b?"-":"+"})})]}),r.jsx("div",{className:`dropdown-js-padding dropdown-js-menu ${!b&&"dropdown-js-hide"}`,id:p.dropdownObj,role:"listbox","aria-expanded":b,style:{...k,marginTop:"3.5px"},children:D.map((e,t)=>r.jsxs("div",{role:"option","aria-label":G(e,d),style:{cursor:"pointer"},onClick:()=>F(e),children:[G(e,d),t<D.length-1&&r.jsx("hr",{style:{borderColor:k.color}})]},`${G(e,u)}${t}`))})]})}function X({label:i,data:n,sortFields:f,selectedData:c=[],selReset:a=!1,maxNumSelections:d,displayName:u,valueName:w,isDisabled:$,onItemsSelected:m,dropdownStyle:j,buttonStyle:b}){s.useState(()=>(n.forEach(o=>{if(!B(o))throw new Error("[Dropdowns-js] Non plain object found");const h=Object.keys(o);if(!h.includes(u))throw new Error(`[Dropdowns-js] displayName field ${u} not found`);if(!h.includes(w))throw new Error(`[Dropdowns-js] valueName field ${w} not found`)}),!0));const x=s.useId(),[y,v]=s.useState(!1),g=s.useMemo(()=>n.length>0?H(n[0]):[],[n]),[M,D]=s.useState(""),C=s.useMemo(()=>n.toSorted(P),[n]),[T,z]=s.useState(0),[I,O]=s.useState([]),S=s.useMemo(()=>{let o=a===!1&&I?[...I]:[...c];return o=o.filter(h=>C.some(E=>V(h,E,...g)===0)),d&&o.length>d&&(o=o.slice(0,d-1)),o.toSorted(P)},[C,c,I]);s.useEffect(()=>{T>0&&I&&m&&m([...S])},[T]);const U=s.useMemo(()=>{const o=M.toUpperCase();return o.length===0?C:C.filter(h=>h[u].toUpperCase().includes(o))},[M,C]),k=(()=>{const o={backgroundColor:j?.backgroundColor,color:j?.color};return j?.fontSize&&(o.fontSize=j?.fontSize),o})(),N=j?.borderColor;function P(o,h){return V(o,h,...f)}function q(o){D(o.target.value),e()}function F(o){a||O(h=>{let E=h?[...h]:[...S];return E.some(A=>V(A,o,...g)===0)?E=E.filter(A=>V(A,o,...g)!==0):(d===null||d&&E.length<d)&&E.push(o),E})}function K(o){return S.some(h=>V(h,o,...g)===0)}function L(o){a||(O(h=>{let E=h?[...h]:[...S];return E=E.filter(A=>V(A,o,...g)!==0),E}),z(h=>h+1))}function l(){y?p():e()}function p(){v(!1),z(o=>o+1)}function e(){U.length>0&&v(!0)}const t={multiSelectionDropdownObjSearch:`multiSelectionDropdownSearch-${x}`,multiSelectionDropdownObj:`multiSelectionDropdown-${x}`,selectedItems:`selectedItems-${x}`};return r.jsxs("div",{className:`dropdown-js dropdown-js-rounded
4
+ ${N&&`dropdown-js-border ${N}`}`,style:{...$?{pointerEvents:"none"}:{}},children:[r.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:k,children:[r.jsx("div",{children:r.jsx("input",{id:t.multiSelectionDropdownObjSearch,name:"multiSelectionDropdownObjSearch",className:"dropdown-js-input dropdown-js-rounded",style:k,"aria-label":i,"aria-autocomplete":"list","aria-controls":t.multiSelectionDropdownObj,role:"combobox","aria-expanded":y,"aria-haspopup":"listbox",type:"text",autoComplete:"off","aria-placeholder":`Type to Search for ${i}`,onChange:o=>q(o),placeholder:`Type to Search for ${i}`,value:M})}),r.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-expanded":y,"aria-controls":"multiSelectionDropdownObj","aria-label":`${i} options`,onClick:()=>l(),children:r.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:y?"-":"+"})})]}),r.jsx("div",{className:"dropdown-js-padding dropdown-js-selected-wrapper dropdown-js-selected-container",children:r.jsx("div",{id:t.selectedItems,className:"dropdown-js-selected-items","aria-label":`Selected ${i} options`,"aria-multiselectable":!0,"aria-live":"polite",children:S.map(o=>r.jsxs("span",{className:"dropdown-js-padding dropdown-js-rounded","aria-label":`${o[u]}`,style:{...k,margin:"3.5px",marginRight:"0px"},children:[o[u]," ",r.jsx("span",{className:"dropdown-js-padding",style:{cursor:"pointer"},"aria-label":`Remove ${o[u]}`,onClick:()=>L(o),children:"×"})]},`${o[w]}${o[u]}`))})}),r.jsxs("div",{className:`dropdown-js-padding dropdown-js-menu dropdown-js-rounded ${!y&&"dropdown-js-hide"}`,style:k,id:t.multiSelectionDropdownObj,role:"listbox","aria-multiselectable":!0,"aria-expanded":y,children:[U.map(o=>r.jsxs("div",{children:[r.jsx("input",{id:`${o[w]}Checkbox`,type:"checkbox",name:`${o[u]}Checkbox`,role:"option","aria-label":`${o[u]}`,"aria-checked":K(o),style:{cursor:"pointer"},checked:K(o),onChange:()=>F(o),value:o[w]}),r.jsx("label",{style:{marginLeft:"5px"},htmlFor:`${o[w]}`,children:o[u]}),r.jsx("hr",{style:{backgroundColor:k.color,border:"none",height:"0.5px"}})]},`${o[w]}${o[u]}`)),r.jsx("button",{className:"dropdown-js-padding dropdown-js-round",style:b,title:"Done","aria-label":`Close ${i} options`,onClick:()=>p(),type:"button",children:"Done"})]})]})}function Y({label:i,data:n,sortOrder:f="asc",selectedData:c=[],selReset:a=!1,maxNumSelections:d,isDisabled:u=!1,onItemsSelected:w,dropdownStyle:$,buttonStyle:m}){const j=["number","string","boolean","bigint"];if(n.length>0&&n.some(e=>e===null&&!j.includes(typeof e)))throw new Error(`Dropdown items must be one of ${j}`);const b=s.useId(),[x,y]=s.useState(!1),v=s.useMemo(()=>n.toSorted(k),[n]),[g,M]=s.useState(""),[D,C]=s.useState([]),T=s.useMemo(()=>{let e=[];return a===!1&&D?e=[...D]:e=[...c],e=e.filter(t=>v.some(o=>o===t)),d&&e.length>d&&(e=e.slice(0,d-1)),e.toSorted(k)},[a,v,c,D]),[z,I]=s.useState(0);s.useEffect(()=>{z>0&&w&&D!==null&&w([...T])},[z]);const O=s.useMemo(()=>g.length===0?v:v.filter(e=>e.toUpperCase().includes(g.toUpperCase())),[g,v]),S=$,U=$?.borderColor;function k(e,t){return J(e,t,f)}function N(e){const t=e.target.value;M(t),l()}function P(e){a||C(t=>{let o=t?[...t]:[...T];return o.some(h=>h===e)?o=o.filter(h=>h!==e):(d===null||d&&o.length<d)&&o.push(e),o})}function q(e){return T.some(t=>t===e)}function F(e){a||(C(t=>(t?[...t]:[...T]).filter(h=>h!==e)),I(t=>t+1))}function K(){x?L():l()}function L(){y(!1),I(e=>e+1)}function l(){O.length>0&&y(!0)}const p={multiSelectionDropdownSearch:`multiSelectionDropdown-${b}`,multiSelectionDropdown:`multiSelectionDropdown-${b}`,selectedItems:`selectedItems-${b}`};return r.jsxs("div",{className:`dropdown-js dropdown-js-rounded
5
+ ${U&&`dropdown-js-border ${U}`}`,style:{...u?{pointerEvents:"none"}:{}},children:[r.jsxs("div",{className:"dropdown-js-input-wrapper dropdown-js-rounded",style:S,children:[r.jsx("div",{children:r.jsx("input",{className:"dropdown-js-input dropdown-js-rounded",id:p.multiSelectionDropdownSearch,name:"multiselectionDropdownSearch",style:S,type:"text",autoComplete:"off",role:"combobox","aria-label":i,"aria-placeholder":`Type to search for ${i}`,"aria-autocomplete":"list","aria-controls":p.multiSelectionDropdown,"aria-expanded":x,"aria-haspopup":"listbox",onChange:N,placeholder:`Type to Search for ${i}`,value:g})}),r.jsx("div",{className:"dropdown-js-arrow-container dropdown-js-padding dropdown-js-rounded","aria-expanded":x,"aria-controls":"multiSelectionDropdown","aria-label":`${i} options`,onClick:()=>K(),children:r.jsx("span",{className:"dropdown-js-arrow dropdown-js-padding",children:x?"-":"+"})})]}),r.jsx("div",{className:"dropdown-js-padding dropdown-js-selected-wrapper dropdown-js-selected-container",children:r.jsx("div",{id:p.selectedItems,className:"dropdown-js-selected-items","aria-label":`Selected ${i} options`,"aria-live":"polite",children:T.map(e=>r.jsxs("span",{className:"dropdown-js-padding dropdown-js-rounded","aria-label":`${e}`,style:{...S,margin:"3.5px",marginRight:"0px"},children:[e," ",r.jsx("span",{style:{cursor:"pointer"},"aria-label":`Remove ${e}`,onClick:()=>F(e),children:"×"})]},`${e}`))})}),r.jsxs("div",{className:`dropdown-js-padding dropdown-js-menu dropdown-js-rounded ${!x&&"dropdown-js-hide"}`,style:S,id:p.multiSelectionDropdown,role:"listbox","aria-multiselectable":!0,"aria-expanded":x,children:[O.map((e,t)=>r.jsxs("div",{children:[r.jsx("input",{type:"checkbox",name:`${e}Checkbox`,role:"option","aria-label":e,"aria-checked":q(e),style:{cursor:"pointer"},checked:q(e),onChange:()=>P(e),value:e}),r.jsx("label",{style:{marginLeft:"5px"},htmlFor:`${e}`,children:e}),r.jsx("hr",{style:{backgroundColor:S.color,border:"none",height:"0.5px"}})]},`${t}#${e}`)),r.jsx("button",{className:"dropdown-js-padding dropdown-js-round",style:m,"aria-label":`Click to collapse ${i} options`,title:"Done",onClick:()=>L(),type:"button",children:"Done"})]})]})}exports.Dropdown=Q;exports.DropdownObj=W;exports.MultiSelectionDropdown=Y;exports.MultiSelectionDropdownObj=X;