@popsure/dirty-swan 0.28.3 → 0.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cjs/index.js +9 -66
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/util/generateId/index.d.ts +2 -0
  4. package/dist/esm/components/autocompleteAddress/demo.js +1 -2
  5. package/dist/esm/components/autocompleteAddress/demo.js.map +1 -1
  6. package/dist/esm/components/autocompleteAddress/index.js +1 -2
  7. package/dist/esm/components/autocompleteAddress/index.js.map +1 -1
  8. package/dist/esm/components/autocompleteAddress/index.test.js +1 -2
  9. package/dist/esm/components/autocompleteAddress/index.test.js.map +1 -1
  10. package/dist/esm/components/input/autoSuggestInput/index.js +1 -2
  11. package/dist/esm/components/input/autoSuggestInput/index.js.map +1 -1
  12. package/dist/esm/components/input/autoSuggestMultiSelect/index.js +1 -2
  13. package/dist/esm/components/input/autoSuggestMultiSelect/index.js.map +1 -1
  14. package/dist/esm/components/input/currency/index.js +1 -2
  15. package/dist/esm/components/input/currency/index.js.map +1 -1
  16. package/dist/esm/components/input/currency/index.test.js +1 -2
  17. package/dist/esm/components/input/currency/index.test.js.map +1 -1
  18. package/dist/esm/components/input/iban/index.js +1 -2
  19. package/dist/esm/components/input/iban/index.js.map +1 -1
  20. package/dist/esm/components/input/index.js +2 -3
  21. package/dist/esm/components/input/index.js.map +1 -1
  22. package/dist/esm/components/multiDropzone/index.js +2 -3
  23. package/dist/esm/components/multiDropzone/index.js.map +1 -1
  24. package/dist/esm/components/multiDropzone/index.test.js +1 -2
  25. package/dist/esm/components/multiDropzone/index.test.js.map +1 -1
  26. package/dist/esm/index-a5a71d5e.js +12 -0
  27. package/dist/esm/index-a5a71d5e.js.map +1 -0
  28. package/dist/esm/index.js +1 -2
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/lib/util/generateId/index.d.ts +2 -0
  31. package/package.json +2 -4
  32. package/src/lib/components/input/index.tsx +2 -2
  33. package/src/lib/components/multiDropzone/index.tsx +2 -2
  34. package/src/lib/util/generateId/index.test.ts +10 -0
  35. package/src/lib/util/generateId/index.ts +15 -0
  36. package/dist/esm/v4-d2999257.js +0 -69
  37. package/dist/esm/v4-d2999257.js.map +0 -1
@@ -8,8 +8,7 @@ import '../../../index-e9e37a34.js';
8
8
  import '../../../index-171a0108.js';
9
9
  import '../../../index-dd80248b.js';
10
10
  import '../index.js';
11
- import '../../../v4-d2999257.js';
12
- import 'crypto';
11
+ import '../../../index-a5a71d5e.js';
13
12
 
14
13
  var css_248z = ".style-module_chip-container__26s37 {\n display: flex;\n flex-wrap: wrap;\n}";
15
14
  var styles = {"chip-container":"style-module_chip-container__26s37"};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/input/autoSuggestMultiSelect/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { Option } from '../../../models/autoSuggestInput';\nimport Chip from '../../chip';\nimport AutoSuggestInput from '../autoSuggestInput';\nimport styles from './style.module.scss';\n\nexport default ({\n options,\n selectedValues,\n setValues,\n placeholder,\n chipsListClassName,\n multiSelectClassName,\n wrapText,\n}: {\n options: Option[];\n selectedValues?: Option[];\n setValues: (values: Option[]) => void;\n placeholder: string;\n chipsListClassName?: string;\n multiSelectClassName?: string;\n wrapText?: boolean;\n}) => {\n const [suggestions, setSuggestions] = useState<Option[]>([]);\n const [currentOption, setCurrentOption] = useState('');\n\n return (\n <>\n {selectedValues && selectedValues.length > 0 && (\n <div\n className={`mb8 ${styles['chip-container']} ${chipsListClassName}`}\n >\n {selectedValues.map((value, index) => (\n <Chip\n key={`${value.value}-${index}`}\n value={value}\n onRemove={(value: Option) => {\n const newValues = [...selectedValues].filter(\n (selectedValue) => selectedValue.value !== value.value\n );\n setValues(newValues);\n }}\n />\n ))}\n </div>\n )}\n <AutoSuggestInput\n className={multiSelectClassName}\n placeholder={placeholder}\n onChange={setCurrentOption}\n handleSuggestionSelected={(value) => {\n const newSelectedOptions = selectedValues ?? [];\n newSelectedOptions?.push(value);\n setValues(newSelectedOptions);\n setCurrentOption('');\n }}\n handleSuggestionFetchRequest={({ value }) => {\n const filteredOptions = options.filter(\n (option) =>\n option.value.toLowerCase().startsWith(value.toLowerCase()) &&\n selectedValues?.find(\n (selectedValue) => selectedValue.value === option.value\n ) === undefined\n );\n setSuggestions(filteredOptions);\n }}\n currentOption={currentOption}\n suggestions={suggestions}\n handleSuggestionClearRequest={() => setSuggestions([])}\n wrapText={wrapText}\n />\n </>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;AAOA,aAAe,UAAC,EAgBf;QAfC,OAAO,aAAA,EACP,cAAc,oBAAA,EACd,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,kBAAkB,wBAAA,EAClB,oBAAoB,0BAAA,EACpB,QAAQ,cAAA;IAUF,IAAA,KAAgC,QAAQ,CAAW,EAAE,CAAC,EAArD,WAAW,QAAA,EAAE,cAAc,QAA0B,CAAC;IACvD,IAAA,KAAoC,QAAQ,CAAC,EAAE,CAAC,EAA/C,aAAa,QAAA,EAAE,gBAAgB,QAAgB,CAAC;IAEvD,QACEA,4BACG,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,KAC1CC,sBACE,SAAS,EAAE,SAAO,MAAM,CAAC,gBAAgB,CAAC,SAAI,kBAAoB,gBAEjE,cAAc,CAAC,GAAG,CAAC,UAAC,KAAK,EAAE,KAAK,IAAK,QACpCA,IAAC,IAAI,IAEH,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,UAAC,KAAa;wBACtB,IAAM,SAAS,GAAG,kBAAI,cAAc,EAAE,MAAM,CAC1C,UAAC,aAAa,IAAK,OAAA,aAAa,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,GAAA,CACvD,CAAC;wBACF,SAAS,CAAC,SAAS,CAAC,CAAC;qBACtB,IAPO,KAAK,CAAC,KAAK,SAAI,KAAO,CAQ9B,IACH,CAAC,YACE,CACP;YACDA,IAAC,gBAAgB,IACf,SAAS,EAAE,oBAAoB,EAC/B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,wBAAwB,EAAE,UAAC,KAAK;oBAC9B,IAAM,kBAAkB,GAAG,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,EAAE,CAAC;oBAChD,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,IAAI,CAAC,KAAK,CAAC,CAAC;oBAChC,SAAS,CAAC,kBAAkB,CAAC,CAAC;oBAC9B,gBAAgB,CAAC,EAAE,CAAC,CAAC;iBACtB,EACD,4BAA4B,EAAE,UAAC,EAAS;wBAAP,KAAK,WAAA;oBACpC,IAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CACpC,UAAC,MAAM;wBACL,OAAA,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;4BAC1D,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,IAAI,CAClB,UAAC,aAAa,IAAK,OAAA,aAAa,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,GAAA,CACxD,MAAK,SAAS;qBAAA,CAClB,CAAC;oBACF,cAAc,CAAC,eAAe,CAAC,CAAC;iBACjC,EACD,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,4BAA4B,EAAE,cAAM,OAAA,cAAc,CAAC,EAAE,CAAC,GAAA,EACtD,QAAQ,EAAE,QAAQ,WAClB,YACD,EACH;AACJ,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/input/autoSuggestMultiSelect/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { Option } from '../../../models/autoSuggestInput';\nimport Chip from '../../chip';\nimport AutoSuggestInput from '../autoSuggestInput';\nimport styles from './style.module.scss';\n\nexport default ({\n options,\n selectedValues,\n setValues,\n placeholder,\n chipsListClassName,\n multiSelectClassName,\n wrapText,\n}: {\n options: Option[];\n selectedValues?: Option[];\n setValues: (values: Option[]) => void;\n placeholder: string;\n chipsListClassName?: string;\n multiSelectClassName?: string;\n wrapText?: boolean;\n}) => {\n const [suggestions, setSuggestions] = useState<Option[]>([]);\n const [currentOption, setCurrentOption] = useState('');\n\n return (\n <>\n {selectedValues && selectedValues.length > 0 && (\n <div\n className={`mb8 ${styles['chip-container']} ${chipsListClassName}`}\n >\n {selectedValues.map((value, index) => (\n <Chip\n key={`${value.value}-${index}`}\n value={value}\n onRemove={(value: Option) => {\n const newValues = [...selectedValues].filter(\n (selectedValue) => selectedValue.value !== value.value\n );\n setValues(newValues);\n }}\n />\n ))}\n </div>\n )}\n <AutoSuggestInput\n className={multiSelectClassName}\n placeholder={placeholder}\n onChange={setCurrentOption}\n handleSuggestionSelected={(value) => {\n const newSelectedOptions = selectedValues ?? [];\n newSelectedOptions?.push(value);\n setValues(newSelectedOptions);\n setCurrentOption('');\n }}\n handleSuggestionFetchRequest={({ value }) => {\n const filteredOptions = options.filter(\n (option) =>\n option.value.toLowerCase().startsWith(value.toLowerCase()) &&\n selectedValues?.find(\n (selectedValue) => selectedValue.value === option.value\n ) === undefined\n );\n setSuggestions(filteredOptions);\n }}\n currentOption={currentOption}\n suggestions={suggestions}\n handleSuggestionClearRequest={() => setSuggestions([])}\n wrapText={wrapText}\n />\n </>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;AAOA,aAAe,UAAC,EAgBf;QAfC,OAAO,aAAA,EACP,cAAc,oBAAA,EACd,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,kBAAkB,wBAAA,EAClB,oBAAoB,0BAAA,EACpB,QAAQ,cAAA;IAUF,IAAA,KAAgC,QAAQ,CAAW,EAAE,CAAC,EAArD,WAAW,QAAA,EAAE,cAAc,QAA0B,CAAC;IACvD,IAAA,KAAoC,QAAQ,CAAC,EAAE,CAAC,EAA/C,aAA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AA,aAAa,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,GAAA,CACxD,MAAK,SAAS;qBAAA,CAClB,CAAC;oBACF,cAAc,CAAC,eAAe,CAAC,CAAC;iBACjC,EACD,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,4BAA4B,EAAE,cAAM,OAAA,cAAc,CAAC,EAAE,CAAC,GAAA,EACtD,QAAQ,EAAE,QAAQ,WAClB,YACD,EACH;AACJ,CAAC;;;;"}
@@ -3,9 +3,8 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import { useState, useEffect } from 'react';
4
4
  import Input from '../index.js';
5
5
  import '../../../index-e9e37a34.js';
6
+ import '../../../index-a5a71d5e.js';
6
7
  import '../../../style-inject.es-1f59c1d0.js';
7
- import '../../../v4-d2999257.js';
8
- import 'crypto';
9
8
 
10
9
  var formatInput = function (input) {
11
10
  var decimalSeparator = input.includes(',') ? ',' : '.';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/input/currency/format/index.ts","../../../../../../src/lib/components/input/currency/index.tsx"],"sourcesContent":["export const formatInput = (input: string): string => {\n const decimalSeparator = input.includes(',') ? ',' : '.';\n const parts = input.split(decimalSeparator);\n const floor = parts[0];\n const ceiling = parts[1];\n parts[0] = floor.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ' ');\n if (ceiling) {\n parts[1] = ceiling.slice(0, Math.min(ceiling.length, 2));\n }\n return parts.join('.');\n};\n\nexport function reverseFormatInput(input: string): number {\n return Number(input.replace(/,/, '.').replace(/\\s/g, ''));\n}\n","import { useEffect, useState } from 'react';\n\nimport { formatInput, reverseFormatInput } from './format';\nimport Input, { InputProps } from '..';\n\nconst CurrencyInput = ({\n value,\n onChange,\n type,\n ...props\n}: {\n value?: number;\n placeholder?: string;\n onChange?: (value: number) => void;\n} & Omit<InputProps, 'onChange' | 'value' | 'ref'>) => {\n const [shadowValue, setShadowValue] = useState('');\n\n const formattedShadowValue = formatInput(\n shadowValue\n .replace(/ /g, '') // remove all whitespace\n .replace(',', '.') // change commas to dot for decimal separator\n .replace('.', 'DECIMAL_SEPARATOR') // Gymnastic to remove all the but the first decimal separators 🤸\n .replace(/\\./g, '')\n .replace('DECIMAL_SEPARATOR', '.') // End of the Gymnastic 🤸\n .replace(/[^\\d\\\\.]/g, '') // remove all non decimal and dot\n );\n\n useEffect(() => {\n if (value && value !== reverseFormatInput(shadowValue)) {\n setShadowValue(formatInput(value.toString()));\n }\n // eslint-disable-next-line\n }, [value]);\n\n useEffect(() => {\n onChange?.(reverseFormatInput(shadowValue));\n // eslint-disable-next-line\n }, [shadowValue]);\n\n return (\n <Input\n prefix=\"€\"\n type=\"string\"\n value={formattedShadowValue}\n onChange={(e) => {\n setShadowValue(e.target.value);\n }}\n {...props}\n />\n );\n};\n\nexport default CurrencyInput;\n"],"names":["_jsx"],"mappings":";;;;;;;;;AAAO,IAAM,WAAW,GAAG,UAAC,KAAa;IACvC,IAAM,gBAAgB,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;IACzD,IAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC5C,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,IAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;IACvD,IAAI,OAAO,EAAE;QACX,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;KAC1D;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC,CAAC;SAEc,kBAAkB,CAAC,KAAa;IA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3,"file":"index.js","sources":["../../../../../../src/lib/components/input/currency/format/index.ts","../../../../../../src/lib/components/input/currency/index.tsx"],"sourcesContent":["export const formatInput = (input: string): string => {\n const decimalSeparator = input.includes(',') ? ',' : '.';\n const parts = input.split(decimalSeparator);\n const floor = parts[0];\n const ceiling = parts[1];\n parts[0] = floor.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ' ');\n if (ceiling) {\n parts[1] = ceiling.slice(0, Math.min(ceiling.length, 2));\n }\n return parts.join('.');\n};\n\nexport function reverseFormatInput(input: string): number {\n return Number(input.replace(/,/, '.').replace(/\\s/g, ''));\n}\n","import { useEffect, useState } from 'react';\n\nimport { formatInput, reverseFormatInput } from './format';\nimport Input, { InputProps } from '..';\n\nconst CurrencyInput = ({\n value,\n onChange,\n type,\n ...props\n}: {\n value?: number;\n placeholder?: string;\n onChange?: (value: number) => void;\n} & Omit<InputProps, 'onChange' | 'value' | 'ref'>) => {\n const [shadowValue, setShadowValue] = useState('');\n\n const formattedShadowValue = formatInput(\n shadowValue\n .replace(/ /g, '') // remove all whitespace\n .replace(',', '.') // change commas to dot for decimal separator\n .replace('.', 'DECIMAL_SEPARATOR') // Gymnastic to remove all the but the first decimal separators 🤸\n .replace(/\\./g, '')\n .replace('DECIMAL_SEPARATOR', '.') // End of the Gymnastic 🤸\n .replace(/[^\\d\\\\.]/g, '') // remove all non decimal and dot\n );\n\n useEffect(() => {\n if (value && value !== reverseFormatInput(shadowValue)) {\n setShadowValue(formatInput(value.toString()));\n }\n // eslint-disable-next-line\n }, [value]);\n\n useEffect(() => {\n onChange?.(reverseFormatInput(shadowValue));\n // eslint-disable-next-line\n }, [shadowValue]);\n\n return (\n <Input\n prefix=\"€\"\n type=\"string\"\n value={formattedShadowValue}\n onChange={(e) => {\n setShadowValue(e.target.value);\n }}\n {...props}\n />\n );\n};\n\nexport default CurrencyInput;\n"],"names":["_jsx"],"mappings":";;;;;;;;AAAO,IAAM,WAAW,GAAG,UAAC,KAAa;IACvC,IAAM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,EAAE,EAAE,CAAC;KAC5B,CAAC;IAEF,SAAS,CAAC;QACR,IAAI,KAAK,IAAI,KAAK,KAAK,kBAAkB,CAAC,WAAW,CAAC,EAAE;YACtD,cAAc,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;SAC/C;;KAEF,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,SAAS,CAAC;QACR,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;;KAE7C,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,QACEA,IAAC,KAAK,aACJ,MAAM,EAAC,QAAG,EACV,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,EAAE,UAAC,CAAC;YACV,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAChC,IACG,KAAK,UACT,EACF;AACJ;;;;"}
@@ -8,9 +8,8 @@ import '../../../_commonjsHelpers-e7f67fd8.js';
8
8
  import 'react-dom/test-utils';
9
9
  import '../index.js';
10
10
  import '../../../index-e9e37a34.js';
11
+ import '../../../index-a5a71d5e.js';
11
12
  import '../../../style-inject.es-1f59c1d0.js';
12
- import '../../../v4-d2999257.js';
13
- import 'crypto';
14
13
 
15
14
  var setup = function () {
16
15
  var utils = customRender(jsx(CurrencyInput, {}, void 0));
@@ -1 +1 @@
1
- {"version":3,"file":"index.test.js","sources":["../../../../../../src/lib/components/input/currency/index.test.tsx"],"sourcesContent":["import { render } from '../../../util/testUtils';\n\nimport CurrencyInput from '.';\n\nconst setup = () => {\n const utils = render(<CurrencyInput />);\n const input = utils.getByTestId('ds-input-input') as HTMLInputElement;\n return {\n input,\n ...utils,\n };\n};\n\ndescribe('Currency input component', () => {\n it('Should correctly space thousands separators', async () => {\n const { input, user } = setup();\n await user.type(input, '1234567');\n expect(input.value).toBe('1 234 567');\n });\n\n it('Should remove non numerical values', async () => {\n const { input, user } = setup();\n await user.type(input, '123asdf4567');\n expect(input.value).toBe('1 234 567');\n });\n\n it('Should remove non numerical values', async () => {\n const { input, user } = setup();\n await user.type(input, '123asdf4567');\n expect(input.value).toBe('1 234 567');\n });\n\n it('Should allow decimal separator', async () => {\n const { input, user } = setup();\n await user.type(input, '1234567.34');\n expect(input.value).toBe('1 234 567.34');\n });\n\n it('Should replace comma decimal seprator with a dot', async () => {\n const { input, user } = setup();\n await user.type(input, '1234567,34');\n expect(input.value).toBe('1 234 567.34');\n });\n\n it('Should only allow one decimal separator', async () => {\n const { input, user } = setup();\n await user.type(input, '1234567..34');\n expect(input.value).toBe('1 234 567.34');\n });\n\n it('Should only allow one decimal separator after a sequence of number', async () => {\n const { input, user } = setup();\n await user.type(input, '1234567..34.4');\n expect(input.value).toBe('1 234 567.34');\n });\n});\n"],"names":["render","_jsx"],"mappings":";;;;;;;;;;;;;;AAIA,IAAM,KAAK,GAAG;IACZ,IAAM,KAAK,GAAGA,YAAM,CAACC,IAAC,aAAa,aAAG,CAAC,CAAC;IACxC,IAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAqB,CAAC;IACtE,kBACE,KAAK,OAAA,IACF,KAAK,EACR;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,0BAA0B,EAAE;IACnC,EAAE,CAAC,6CAA6C,EAAE;;;;;oBAC1C,KAAkB,KAAK,EAAE,EAAvB,KAAK,WAAA,EAAE,IAAI,UAAA,CAAa;oBAChC,qBAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,EAAA;;oBAAjC,SAAiC,CAAC;oBAClC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;;;;SACvC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE;;;;;oBACjC,KAAkB,KAAK,EAAE,EAAvB,KAAK,WAAA,EAAE,IAAI,UAAA,CA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I,CAAC,KAAK,EAAE,aAAa,CAAC,EAAA;;oBAArC,SAAqC,CAAC;oBACtC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;;;;SAC1C,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE;;;;;oBACjE,KAAkB,KAAK,EAAE,EAAvB,KAAK,WAAA,EAAE,IAAI,UAAA,CAAa;oBAChC,qBAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,eAAe,CAAC,EAAA;;oBAAvC,SAAuC,CAAC;oBACxC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;;;;SAC1C,CAAC,CAAC;AACL,CAAC,CAAC"}
1
+ {"version":3,"file":"index.test.js","sources":["../../../../../../src/lib/components/input/currency/index.test.tsx"],"sourcesContent":["import { render } from '../../../util/testUtils';\n\nimport CurrencyInput from '.';\n\nconst setup = () => {\n const utils = render(<CurrencyInput />);\n const input = utils.getByTestId('ds-input-input') as HTMLInputElement;\n return {\n input,\n ...utils,\n };\n};\n\ndescribe('Currency input component', () => {\n it('Should correctly space thousands separators', async () => {\n const { input, user } = setup();\n await user.type(input, '1234567');\n expect(input.value).toBe('1 234 567');\n });\n\n it('Should remove non numerical values', async () => {\n const { input, user } = setup();\n await user.type(input, '123asdf4567');\n expect(input.value).toBe('1 234 567');\n });\n\n it('Should remove non numerical values', async () => {\n const { input, user } = setup();\n await user.type(input, '123asdf4567');\n expect(input.value).toBe('1 234 567');\n });\n\n it('Should allow decimal separator', async () => {\n const { input, user } = setup();\n await user.type(input, '1234567.34');\n expect(input.value).toBe('1 234 567.34');\n });\n\n it('Should replace comma decimal seprator with a dot', async () => {\n const { input, user } = setup();\n await user.type(input, '1234567,34');\n expect(input.value).toBe('1 234 567.34');\n });\n\n it('Should only allow one decimal separator', async () => {\n const { input, user } = setup();\n await user.type(input, '1234567..34');\n expect(input.value).toBe('1 234 567.34');\n });\n\n it('Should only allow one decimal separator after a sequence of number', async () => {\n const { input, user } = setup();\n await user.type(input, '1234567..34.4');\n expect(input.value).toBe('1 234 567.34');\n });\n});\n"],"names":["render","_jsx"],"mappings":";;;;;;;;;;;;;AAIA,IAAM,KAAK,GAAG;IACZ,IAAM,KAAK,GAAGA,YAAM,CAACC,IAAC,aAAa,aAAG,CAAC,CAAC;IACxC,IAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAqB,CAAC;IACtE,kBACE,KAAK,OAAA,IACF,KAAK,EACR;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,0BAA0B,EAAE;IACnC,EAAE,CAAC,6CAA6C,EAAE;;;;;oBAC1C,KAAkB,KAAK,EAAE,EAAvB,KAAK,WAAA,EAAE,IAAI,UAAA,CAAa;oBAChC,qBAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,EAAA;;oBAAjC,SAAiC,CAAC;oBAClC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;;;;SACvC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE;;;;;oBACjC,KAAkB,KAAK,EAAE,EAAvB,KAAK,WAAA,EAAE,IAAI,UAAA,CAAa;oBAChC,qBAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,EAAA;;oBAArC,SAAqC,CAAC;oBACtC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;;;;SACvC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE;;;;;oBACjC,KAAkB,KAAK,EAAE,EAAvB,KAAK,WAAA,EAAE,IAAI,UAAA,CAAa;oBAChC,qBAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,EAAA;;oBAArC,SAAqC,CAAC;oBACtC,MAAM,CAAC,KAAK,CAAC,K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Ac,CAAC,CAAC;;;;SAC1C,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -3,9 +3,8 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import Input from '../index.js';
4
4
  import 'react';
5
5
  import '../../../index-e9e37a34.js';
6
+ import '../../../index-a5a71d5e.js';
6
7
  import '../../../style-inject.es-1f59c1d0.js';
7
- import '../../../v4-d2999257.js';
8
- import 'crypto';
9
8
 
10
9
  var IBAN_CHAR_LIMIT = 4;
11
10
  var formatIban = function (iban) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/input/iban/formatIban/index.ts","../../../../../../src/lib/components/input/iban/index.tsx"],"sourcesContent":["const IBAN_CHAR_LIMIT = 4;\n\nexport const formatIban = (iban?: string): string => {\n if (iban) {\n const cleanIban = iban\n .replace(/\\s\\s+/g, ' ')\n .replace(/[^0-9a-zA-Z]/gi, '')\n .toUpperCase();\n\n const values: string[] = [];\n\n cleanIban.split('').forEach((char, idx) => {\n if (idx % IBAN_CHAR_LIMIT === 0) {\n values.push(cleanIban.substring(idx, idx + IBAN_CHAR_LIMIT));\n }\n });\n\n return values.join(' ');\n }\n\n return '';\n};\n","import Input, { InputProps } from '..';\n\nimport { formatIban } from './formatIban';\n\nconst IbanInput = ({\n value,\n onChange,\n ...props\n}: {\n value?: string;\n onChange: (value: string) => void;\n} & Omit<InputProps, 'onChange' | 'value' | 'ref'>) => (\n <Input\n value={formatIban(value)}\n onChange={(e) => onChange(formatIban(e.target.value))}\n {...props}\n />\n);\n\nexport default IbanInput;\n"],"names":["_jsx"],"mappings":";;;;;;;;;AAAA,IAAM,eAAe,GAAG,CAAC,CAAC;AAEnB,IAAM,UAAU,GAAG,UAAC,IAAa;IACtC,IAAI,IAAI,EAAE;QACR,IAAM,WAAS,GAAG,IAAI;aACnB,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;aACtB,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;aAC7B,WAAW,EAAE,CAAC;QAEjB,IAAM,QAAM,GAAa,EAAE,CAAC;QAE5B,WAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,GAAG;YACpC,IAAI,GAAG,GAAG,eAAe,KAAK,CAAC,EAAE;gBAC/B,QAAM,CAAC,IAAI,CAAC,WAAS,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,eAAe,CAAC,CAAC,CAAC;aAC9D;SACF,CAAC,CAAC;QAEH,OAAO,QAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACzB;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;;ICjBK,SAAS,GAAG,UAAC,EAO+B;IANhD,IAAA,KAAK,WAAA,EACL,QAAQ,cAAA,EACL,KAAK,cAHS,qBAIlB,CADS;IAI6C,QACrDA,IAAC,KAAK,aACJ,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,EACxB,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAA,IACjD,KAAK,UACT,EACH;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/input/iban/formatIban/index.ts","../../../../../../src/lib/components/input/iban/index.tsx"],"sourcesContent":["const IBAN_CHAR_LIMIT = 4;\n\nexport const formatIban = (iban?: string): string => {\n if (iban) {\n const cleanIban = iban\n .replace(/\\s\\s+/g, ' ')\n .replace(/[^0-9a-zA-Z]/gi, '')\n .toUpperCase();\n\n const values: string[] = [];\n\n cleanIban.split('').forEach((char, idx) => {\n if (idx % IBAN_CHAR_LIMIT === 0) {\n values.push(cleanIban.substring(idx, idx + IBAN_CHAR_LIMIT));\n }\n });\n\n return values.join(' ');\n }\n\n return '';\n};\n","import Input, { InputProps } from '..';\n\nimport { formatIban } from './formatIban';\n\nconst IbanInput = ({\n value,\n onChange,\n ...props\n}: {\n value?: string;\n onChange: (value: string) => void;\n} & Omit<InputProps, 'onChange' | 'value' | 'ref'>) => (\n <Input\n value={formatIban(value)}\n onChange={(e) => onChange(formatIban(e.target.value))}\n {...props}\n />\n);\n\nexport default IbanInput;\n"],"names":["_jsx"],"mappings":";;;;;;;;AAAA,IAAM,eAAe,GAAG,CAAC,CAAC;AAEnB,IAAM,UAAU,GAAG,UAAC,IAAa;IACtC,IAAI,IAAI,EAAE;QACR,IAAM,WAAS,GAAG,IAAI;aACnB,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;aACtB,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;aAC7B,WAAW,EAAE,CAAC;QAEjB,IAAM,QAAM,GAAa,EAAE,CAAC;QAE5B,WAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,GAAG;YACpC,IAAI,GAAG,GAAG,eAAe,KAAK,CAAC,EAAE;gBAC/B,QAAM,CAAC,IAAI,CAAC,WAAS,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,eAAe,CAAC,CAAC,CAAC;aAC9D;SACF,CAAC,CAAC;QAEH,OAAO,QAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACzB;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;;ICjBK,SAAS,GAAG,UAAC,EAO+B;IANhD,IAAA,KAAK,WAAA,EACL,QAAQ,cAAA,EACL,KAAK,cAHS,qBAIlB,CADS;IAI6C,QACrDA,IAAC,KAAK,aACJ,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,EACxB,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAA,IACjD,KAAK,UACT,EACH;;;;;"}
@@ -2,9 +2,8 @@ import { a as __rest, _ as __assign } from '../../tslib.es6-5bc94358.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import React__default, { useState } from 'react';
4
4
  import { c as classnames } from '../../index-e9e37a34.js';
5
+ import { g as generateId } from '../../index-a5a71d5e.js';
5
6
  import { s as styleInject } from '../../style-inject.es-1f59c1d0.js';
6
- import { v as v4 } from '../../v4-d2999257.js';
7
- import 'crypto';
8
7
 
9
8
  var css_248z = ".style-module_container__2L4SP {\n position: relative;\n}\n\n.style-module_prefix__3jAFZ {\n position: absolute;\n left: 16px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--ds-grey-500);\n transition: 0.3s top;\n}\n.style-module_prefix--with-error__1yTTM {\n color: var(--ds-red-500);\n}\n.style-module_prefix--disabled__2-gcw {\n color: var(--ds-grey-600);\n}\n\n.style-module_input__1eJO5:not(:placeholder-shown) ~ .style-module_placeholder__1U2z0,\n.style-module_input__1eJO5:focus ~ .style-module_placeholder__1U2z0 {\n top: 7px;\n left: 16px;\n transform: translateY(0);\n font-size: 10px;\n line-height: 12px;\n opacity: 1;\n}\n\n.style-module_input__1eJO5:focus ~ .style-module_placeholder__1U2z0 {\n color: var(--ds-primary-500);\n}\n.style-module_input__1eJO5:focus ~ .style-module_placeholder--with-error__2ieRU {\n color: var(--ds-red-500);\n}\n\n.style-module_input__1eJO5:focus ~ .style-module_prefix__3jAFZ {\n color: var(--ds-primary-500);\n}\n.style-module_input__1eJO5:focus ~ .style-module_prefix--with-error__1yTTM {\n color: var(--ds-red-500);\n}\n\n.style-module_input__1eJO5:not(:placeholder-shown) ~ .style-module_prefix__3jAFZ,\n.style-module_input__1eJO5:focus ~ .style-module_prefix__3jAFZ {\n top: 28px;\n}\n\n.style-module_input__1eJO5 {\n box-sizing: border-box;\n padding-top: 9px;\n font-family: inherit;\n}\n.style-module_input--no-placeholder__3EGwh {\n padding-top: 0px;\n}\n.style-module_input--with-prefix__38e0j {\n padding-left: 32px !important;\n}\n\n.style-module_placeholder__1U2z0 {\n position: absolute;\n pointer-events: none;\n left: 16px;\n top: 50%;\n transform: translateY(-50%);\n transition: 0.3s ease all;\n color: var(--ds-grey-500);\n}\n.style-module_placeholder--with-prefix__2PquQ {\n left: 32px;\n}\n.style-module_placeholder--with-error__2ieRU {\n color: var(--ds-red-500);\n}\n\n.style-module_label__3FEZ1 {\n display: inline-block;\n margin-bottom: 8px;\n color: var(--ds-grey-600);\n}\n.style-module_label--with-error__166bP {\n color: var(--ds-red-500);\n}\n\n.style-module_error__167Zc {\n margin-top: 4px;\n}";
10
9
  var styles = {"container":"style-module_container__2L4SP","prefix":"style-module_prefix__3jAFZ","prefix--with-error":"style-module_prefix--with-error__1yTTM","prefix--disabled":"style-module_prefix--disabled__2-gcw","input":"style-module_input__1eJO5","placeholder":"style-module_placeholder__1U2z0","placeholder--with-error":"style-module_placeholder--with-error__2ieRU","input--no-placeholder":"style-module_input--no-placeholder__3EGwh","input--with-prefix":"style-module_input--with-prefix__38e0j","placeholder--with-prefix":"style-module_placeholder--with-prefix__2PquQ","label":"style-module_label__3FEZ1","label--with-error":"style-module_label--with-error__166bP","error":"style-module_error__167Zc"};
@@ -13,7 +12,7 @@ styleInject(css_248z);
13
12
  var Input = React__default.forwardRef(function (_a, ref) {
14
13
  var _b, _c, _d, _e, _f, _g;
15
14
  var className = _a.className, placeholder = _a.placeholder, label = _a.label, id = _a.id, prefix = _a.prefix, error = _a.error, disabled = _a.disabled, _h = _a.hideLabel, hideLabel = _h === void 0 ? false : _h, props = __rest(_a, ["className", "placeholder", "label", "id", "prefix", "error", "disabled", "hideLabel"]);
16
- var uniqueId = useState(id !== null && id !== void 0 ? id : v4())[0];
15
+ var uniqueId = useState(id !== null && id !== void 0 ? id : generateId())[0];
17
16
  return (jsxs("div", __assign({ className: styles.container + " " + (className !== null && className !== void 0 ? className : '') }, { children: [label && (jsx("label", __assign({ htmlFor: uniqueId, className: classnames('p-p', styles.label, (_b = {},
18
17
  _b[styles['label--with-error']] = error,
19
18
  _b['sr-only'] = hideLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/lib/components/input/index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport classnames from 'classnames';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport styles from './style.module.scss';\n\n// Something weird is going on with enterKeyHint that makes it a required field under certain circumstances. The & Omit<…> and & Pick<…> is a hacky way to go around that.\nexport type InputProps = {\n error?: string;\n prefix?: string;\n label?: string;\n id?: string;\n hideLabel?: boolean;\n} & Omit<JSX.IntrinsicElements['input'], 'enterKeyHint'> &\n Partial<Pick<JSX.IntrinsicElements['input'], 'enterKeyHint'>>;\n\nexport default React.forwardRef(\n (\n {\n className,\n placeholder,\n label,\n id,\n prefix,\n error,\n disabled,\n hideLabel = false,\n ...props\n }: InputProps,\n ref?: React.ForwardedRef<HTMLInputElement>\n ) => {\n const [uniqueId] = useState(id ?? uuidv4());\n return (\n <div className={`${styles.container} ${className ?? ''}`}>\n {label && (\n <label\n htmlFor={uniqueId}\n className={classnames('p-p', styles.label, {\n [styles['label--with-error']]: error,\n 'sr-only': hideLabel,\n })}\n >\n {label}\n </label>\n )}\n <div style={{ position: 'relative' }}>\n <input\n id={uniqueId}\n data-testid=\"ds-input-input\"\n type=\"text\"\n ref={ref}\n className={classnames(\n error ? 'p-input--error' : 'p-input',\n !label && placeholder && placeholder.length > 0\n ? styles.input\n : styles['input--no-placeholder'],\n { [styles['input--with-prefix']]: prefix }\n )}\n placeholder={label ? placeholder : ' '}\n disabled={disabled}\n {...props}\n />\n {prefix && (\n <span\n className={classnames(\n styles.prefix,\n { [styles['prefix--with-error']]: error },\n { [styles['prefix--disabled']]: disabled }\n )}\n >\n {prefix}\n </span>\n )}\n {!label && (\n <label\n htmlFor={uniqueId}\n className={classnames(\n styles.placeholder,\n { [styles['placeholder--with-prefix']]: prefix },\n { [styles['placeholder--with-error']]: error }\n )}\n >\n {placeholder}\n </label>\n )}\n </div>\n {error && (\n <p className={`p-p--small tc-red-500 w100 ${styles.error}`}>\n {error}\n </p>\n )}\n </div>\n );\n }\n);\n"],"names":["React","uuidv4","_jsxs","_jsx"],"mappings":";;;;;;;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AM,CAAC,MAAM,YACX,GAAC,MAAM,CAAC,oBAAoB,CAAC,IAAG,KAAK,iBACrC,GAAC,MAAM,CAAC,kBAAkB,CAAC,IAAG,QAAQ,MACzC,gBAEA,MAAM,YACF,CACR;oBACA,CAAC,KAAK,KACLA,wBACE,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,UAAU,CACnB,MAAM,CAAC,WAAW,YAChB,GAAC,MAAM,CAAC,0BAA0B,CAAC,IAAG,MAAM,iBAC5C,GAAC,MAAM,CAAC,yBAAyB,CAAC,IAAG,KAAK,MAC7C,gBAEA,WAAW,YACN,CACT,aACG;YACL,KAAK,KACJA,oBAAG,SAAS,EAAE,gCAA8B,MAAM,CAAC,KAAO,gBACvD,KAAK,YACJ,CACL,aACG,EACN;AACJ,CAAC,CACF;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/lib/components/input/index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport classnames from 'classnames';\nimport generateId from '../../util/generateId';\n\nimport styles from './style.module.scss';\n\n// Something weird is going on with enterKeyHint that makes it a required field under certain circumstances. The & Omit<…> and & Pick<…> is a hacky way to go around that.\nexport type InputProps = {\n error?: string;\n prefix?: string;\n label?: string;\n id?: string;\n hideLabel?: boolean;\n} & Omit<JSX.IntrinsicElements['input'], 'enterKeyHint'> &\n Partial<Pick<JSX.IntrinsicElements['input'], 'enterKeyHint'>>;\n\nexport default React.forwardRef(\n (\n {\n className,\n placeholder,\n label,\n id,\n prefix,\n error,\n disabled,\n hideLabel = false,\n ...props\n }: InputProps,\n ref?: React.ForwardedRef<HTMLInputElement>\n ) => {\n const [uniqueId] = useState(id ?? generateId());\n return (\n <div className={`${styles.container} ${className ?? ''}`}>\n {label && (\n <label\n htmlFor={uniqueId}\n className={classnames('p-p', styles.label, {\n [styles['label--with-error']]: error,\n 'sr-only': hideLabel,\n })}\n >\n {label}\n </label>\n )}\n <div style={{ position: 'relative' }}>\n <input\n id={uniqueId}\n data-testid=\"ds-input-input\"\n type=\"text\"\n ref={ref}\n className={classnames(\n error ? 'p-input--error' : 'p-input',\n !label && placeholder && placeholder.length > 0\n ? styles.input\n : styles['input--no-placeholder'],\n { [styles['input--with-prefix']]: prefix }\n )}\n placeholder={label ? placeholder : ' '}\n disabled={disabled}\n {...props}\n />\n {prefix && (\n <span\n className={classnames(\n styles.prefix,\n { [styles['prefix--with-error']]: error },\n { [styles['prefix--disabled']]: disabled }\n )}\n >\n {prefix}\n </span>\n )}\n {!label && (\n <label\n htmlFor={uniqueId}\n className={classnames(\n styles.placeholder,\n { [styles['placeholder--with-prefix']]: prefix },\n { [styles['placeholder--with-error']]: error }\n )}\n >\n {placeholder}\n </label>\n )}\n </div>\n {error && (\n <p className={`p-p--small tc-red-500 w100 ${styles.error}`}>\n {error}\n </p>\n )}\n </div>\n );\n }\n);\n"],"names":["React","_jsxs","_jsx"],"mappings":";;;;;;;;;;;AAgBA,YAAeA,cAAK,CAAC,UAAU,CAC7B,UACE,EAUa,EACb,GAA0C;;IAVxC,IAAA,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,KAAK,WAAA,EACL,EAAE,QAAA,EACF,MAAM,YAAA,EACN,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,iBAAiB,EAAjB,SAAS,mBAAG,KAAK,KAAA,EACd,KAAK,cATV,uFAUC,CADS;IAIH,IAAA,QAAQ,GAAI,QAAQ,CAAC,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,UAAU,EAAE,CAAC,GAAhC,CAAiC;IAChD,QACEC,uBAAK,SAAS,EAAK,MAAM,CAAC,SAAS,UAAI,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAE,iBACrD,KAAK,KACJC,wBACE,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK;oBACvC,GAAC,MAAM,CAAC,mBAAmB,CAAC,IAAG,KAAK;oBACpC,aAAS,GAAE,SAAS;wBACpB,gBAED,KAAK,YACA,CACT;YACDD,uBAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAClCC,wBACE,EAAE,EAAE,QAAQ,iBACA,gBAAgB,EAC5B,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CACnB,KAAK,GAAG,gBAAgB,GAAG,SAAS,EACpC,CAAC,KAAK,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC;8BAC3C,MAAM,CAAC,KAAK;8BACZ,MAAM,CAAC,uBAAuB,CAAC,YACjC,GAAC,MAAM,CAAC,oBAAoB,CAAC,IAAG,MAAM,MACzC,EACD,WAAW,EAAE,KAAK,GAAG,WAAW,GAAG,GAAG,EACtC,QAAQ,EAAE,QAAQ,IACd,KAAK,UACT;oBACD,MAAM,KACLA,uBACE,SAAS,EAAE,UAAU,CACnB,MAAM,CAAC,MAAM,YACX,GAAC,MAAM,CAAC,oBAAoB,CAAC,IAAG,KAAK,iBACrC,GAAC,MAAM,CAAC,kBAAkB,CAAC,IAAG,QAAQ,MACzC,gBAEA,MAAM,YACF,CACR;oBACA,CAAC,KAAK,KACLA,wBACE,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,UAAU,CACnB,MAAM,CAAC,WAAW,YAChB,GAAC,MAAM,CAAC,0BAA0B,CAAC,IAAG,MAAM,iBAC5C,GAAC,MAAM,CAAC,yBAAyB,CAAC,IAAG,KAAK,MAC7C,gBAEA,WAAW,YACN,CACT,aACG;YACL,KAAK,KACJA,oBAAG,SAAS,EAAE,gCAA8B,MAAM,CAAC,KAAO,gBACvD,KAAK,YACJ,CACL,aACG,EACN;AACJ,CAAC,CACF;;;;"}
@@ -4,10 +4,9 @@ import React__default, { useMemo, useRef, useReducer, useEffect, useCallback, fo
4
4
  import { c as classnames } from '../../index-e9e37a34.js';
5
5
  import { o as objectAssign } from '../../index-dd80248b.js';
6
6
  import { A as AnimateHeight } from '../../index-21239ab0.js';
7
+ import { g as generateId } from '../../index-a5a71d5e.js';
7
8
  import { s as styleInject } from '../../style-inject.es-1f59c1d0.js';
8
9
  import { i as icons, U as UploadFileCell } from '../../index-be398f1d.js';
9
- import { v as v4 } from '../../v4-d2999257.js';
10
- import 'crypto';
11
10
 
12
11
  var propTypes = {exports: {}};
13
12
 
@@ -2826,7 +2825,7 @@ var MultiDropZone = function (_a) {
2826
2825
  setErrors(function (previousErrors) { return (__spreadArray$1(__spreadArray$1([], previousErrors), filesRejected.map(function (_a) {
2827
2826
  var errors = _a.errors;
2828
2827
  return ({
2829
- id: v4(),
2828
+ id: generateId(),
2830
2829
  message: getErrorMessage(errors[0], { fileList: fileList, maxSize: maxSize }, textOverrides),
2831
2830
  });
2832
2831
  }))); });