@pedidopago/ui 1.5.18 → 1.5.20

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 (69) hide show
  1. package/dist/components/Icon/data/dash.js +1 -1
  2. package/dist/components/MultipleSelect/components/SelectArea/index.js +2 -2
  3. package/dist/components/MultipleSelect/components/SelectArea/types.d.ts +1 -1
  4. package/dist/components/MultipleSelect/components/SelectArea/types.d.ts.map +1 -1
  5. package/dist/components/MultipleSelect/index.js +1 -1
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +14 -0
  9. package/dist/shared/types/credit-card.d.ts +6 -0
  10. package/dist/shared/types/credit-card.d.ts.map +1 -0
  11. package/dist/shared/types/credit-card.js +1 -0
  12. package/dist/shared/types/file.d.ts +12 -0
  13. package/dist/shared/types/file.d.ts.map +1 -0
  14. package/dist/shared/types/file.js +1 -0
  15. package/dist/shared/types/name.d.ts +4 -0
  16. package/dist/shared/types/name.d.ts.map +1 -0
  17. package/dist/shared/types/name.js +1 -0
  18. package/dist/utils/file.d.ts +27 -0
  19. package/dist/utils/file.d.ts.map +1 -0
  20. package/dist/utils/file.js +160 -0
  21. package/dist/utils/formatters/bytes.d.ts +8 -0
  22. package/dist/utils/formatters/bytes.d.ts.map +1 -0
  23. package/dist/utils/formatters/bytes.js +22 -0
  24. package/dist/utils/formatters/capitalize.d.ts +7 -0
  25. package/dist/utils/formatters/capitalize.d.ts.map +1 -0
  26. package/dist/utils/formatters/capitalize.js +15 -0
  27. package/dist/utils/formatters/cep.d.ts +13 -0
  28. package/dist/utils/formatters/cep.d.ts.map +1 -0
  29. package/dist/utils/formatters/cep.js +26 -0
  30. package/dist/utils/formatters/cnpj.d.ts +19 -0
  31. package/dist/utils/formatters/cnpj.d.ts.map +1 -0
  32. package/dist/utils/formatters/cnpj.js +54 -0
  33. package/dist/utils/formatters/color.d.ts +16 -0
  34. package/dist/utils/formatters/color.d.ts.map +1 -0
  35. package/dist/utils/formatters/color.js +111 -0
  36. package/dist/utils/formatters/cpf.d.ts +19 -0
  37. package/dist/utils/formatters/cpf.d.ts.map +1 -0
  38. package/dist/utils/formatters/cpf.js +101 -0
  39. package/dist/utils/formatters/credit-card.d.ts +27 -0
  40. package/dist/utils/formatters/credit-card.d.ts.map +1 -0
  41. package/dist/utils/formatters/credit-card.js +80 -0
  42. package/dist/utils/formatters/email.d.ts +2 -0
  43. package/dist/utils/formatters/email.d.ts.map +1 -0
  44. package/dist/utils/formatters/email.js +8 -0
  45. package/dist/utils/formatters/index.d.ts +16 -0
  46. package/dist/utils/formatters/index.d.ts.map +1 -0
  47. package/dist/utils/formatters/index.js +200 -0
  48. package/dist/utils/formatters/name.d.ts +21 -0
  49. package/dist/utils/formatters/name.d.ts.map +1 -0
  50. package/dist/utils/formatters/name.js +46 -0
  51. package/dist/utils/formatters/number.d.ts +7 -0
  52. package/dist/utils/formatters/number.d.ts.map +1 -0
  53. package/dist/utils/formatters/number.js +18 -0
  54. package/dist/utils/formatters/passport.d.ts +25 -0
  55. package/dist/utils/formatters/passport.d.ts.map +1 -0
  56. package/dist/utils/formatters/passport.js +49 -0
  57. package/dist/utils/formatters/phone.d.ts +60 -0
  58. package/dist/utils/formatters/phone.d.ts.map +1 -0
  59. package/dist/utils/formatters/phone.js +209 -0
  60. package/dist/utils/formatters/price.d.ts +12 -0
  61. package/dist/utils/formatters/price.d.ts.map +1 -0
  62. package/dist/utils/formatters/price.js +28 -0
  63. package/dist/utils/formatters/rg.d.ts +13 -0
  64. package/dist/utils/formatters/rg.d.ts.map +1 -0
  65. package/dist/utils/formatters/rg.js +26 -0
  66. package/dist/utils/formatters/strings.d.ts +20 -0
  67. package/dist/utils/formatters/strings.d.ts.map +1 -0
  68. package/dist/utils/formatters/strings.js +42 -0
  69. package/package.json +4 -3
@@ -13,9 +13,9 @@ var _SelectAreaWrapper = require("./SelectAreaWrapper");
13
13
 
14
14
  var _SelectedOptionsArea = require("./SelectedOptionsArea");
15
15
 
16
- var _Icon = _interopRequireDefault(require("src/components/Icon"));
16
+ var _Flex = _interopRequireDefault(require("../../../Flex"));
17
17
 
18
- var _Flex = _interopRequireDefault(require("src/components/Flex"));
18
+ var _Icon = _interopRequireDefault(require("../../../Icon"));
19
19
 
20
20
  var _styles = require("./styles");
21
21
 
@@ -1,5 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
- import { ExtendThemeProps } from 'src/shared/theme';
2
+ import { ExtendThemeProps } from '../../../../shared/theme';
3
3
  import { SelectType, SelectData } from '../../types';
4
4
  export interface ISelectAreaProps {
5
5
  disabled: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/MultipleSelect/components/SelectArea/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,UAAU,EAAE,CAAC;IAC9B,oBAAoB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACtF,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,kBAAkB,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAClD,qBAAqB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACnE;AAED,oBAAY,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/MultipleSelect/components/SelectArea/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,UAAU,EAAE,CAAC;IAC9B,oBAAoB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACtF,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,kBAAkB,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAClD,qBAAqB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACnE;AAED,oBAAY,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC"}
@@ -11,7 +11,7 @@ var _framerMotion = require("framer-motion");
11
11
 
12
12
  var _Flex = _interopRequireDefault(require("../Flex"));
13
13
 
14
- var _useDisableBodyScroll = require("src/shared/hooks/useDisableBodyScroll");
14
+ var _useDisableBodyScroll = require("../../shared/hooks/useDisableBodyScroll");
15
15
 
16
16
  var _animations = require("./animations");
17
17
 
package/dist/index.d.ts CHANGED
@@ -52,4 +52,5 @@ export { useKeyPress } from './shared/hooks/useKeyPress';
52
52
  export { useOnClickOutside } from './shared/hooks/useOnClickOutside';
53
53
  export { useWindowSize } from './shared/hooks/useWindowSize';
54
54
  export * from './shared/theme';
55
+ export * from './utils/formatters';
55
56
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,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AI,UAAU,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -498,4 +498,18 @@ Object.keys(_theme).forEach(function (key) {
498
498
  });
499
499
  });
500
500
 
501
+ var _formatters = require("./utils/formatters");
502
+
503
+ Object.keys(_formatters).forEach(function (key) {
504
+ if (key === "default" || key === "__esModule") return;
505
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
506
+ if (key in exports && exports[key] === _formatters[key]) return;
507
+ Object.defineProperty(exports, key, {
508
+ enumerable: true,
509
+ get: function get() {
510
+ return _formatters[key];
511
+ }
512
+ });
513
+ });
514
+
501
515
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,6 @@
1
+ export declare type CreditCardOptions = {
2
+ monthErrorMessage: string;
3
+ yearErrorMessage: string;
4
+ dateErrorMessage: string;
5
+ };
6
+ //# sourceMappingURL=credit-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credit-card.d.ts","sourceRoot":"","sources":["../../../src/shared/types/credit-card.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB,GAAG;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,12 @@
1
+ export declare type FormattedFile = {
2
+ url: string;
3
+ name: string;
4
+ type: string;
5
+ size: number;
6
+ file: Blob;
7
+ };
8
+ export declare type UrlProps = {
9
+ url: string;
10
+ name?: string;
11
+ };
12
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/shared/types/file.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,4 @@
1
+ export declare type NameOptions = {
2
+ errorMessage: string;
3
+ };
4
+ //# sourceMappingURL=name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../../../src/shared/types/name.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,27 @@
1
+ import { FormattedFile } from 'src/shared/types/file';
2
+ /**
3
+ * Converts an array of File objects to an array of base64-encoded files with additional information.
4
+ * @param {File[]} files Array of File objects.
5
+ * @returns {Promise<FormattedFile[]>} Promise that resolves with an array of FormattedFile objects.
6
+ */
7
+ export declare function filesToBase64(files: File[]): Promise<FormattedFile[]>;
8
+ /**
9
+ * Converts a single File object to a base64-encoded file with additional information.
10
+ * @param {File} file File object to be converted.
11
+ * @returns {Promise<FormattedFile>} Promise that resolves with a FormattedFile object.
12
+ */
13
+ export declare function convertFileToBase64(file: File): Promise<FormattedFile>;
14
+ /**
15
+ * Downloads a file from a given URL and converts it to a base64-encoded file with additional information.
16
+ * @param {string} url URL of the file to be downloaded.
17
+ * @param {string} name Optional name of the downloaded file.
18
+ * @returns {Promise<FormattedFile | null>} Promise that resolves with a FormattedFile object or null if the URL is not valid.
19
+ */
20
+ export declare function urlToBase64(url: string, name?: string): Promise<FormattedFile | null>;
21
+ /**
22
+ * Downloads a file from a given URL and opens the download prompt.
23
+ * @param {string} url URL of the file to be downloaded.
24
+ * @returns {Promise<boolean>} Promise that resolves with a boolean indicating whether the download was successful.
25
+ */
26
+ export declare function downloadUrlToFile(url: string): Promise<boolean>;
27
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/utils/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAErE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,CActE;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAW3F;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAYrE"}
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.convertFileToBase64 = convertFileToBase64;
7
+ exports.downloadUrlToFile = downloadUrlToFile;
8
+ exports.filesToBase64 = filesToBase64;
9
+ exports.urlToBase64 = urlToBase64;
10
+
11
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
12
+
13
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
14
+
15
+ /**
16
+ * Converts an array of File objects to an array of base64-encoded files with additional information.
17
+ * @param {File[]} files Array of File objects.
18
+ * @returns {Promise<FormattedFile[]>} Promise that resolves with an array of FormattedFile objects.
19
+ */
20
+ function filesToBase64(files) {
21
+ return Promise.all(files.map(function (file) {
22
+ return convertFileToBase64(file);
23
+ }));
24
+ }
25
+ /**
26
+ * Converts a single File object to a base64-encoded file with additional information.
27
+ * @param {File} file File object to be converted.
28
+ * @returns {Promise<FormattedFile>} Promise that resolves with a FormattedFile object.
29
+ */
30
+
31
+
32
+ function convertFileToBase64(file) {
33
+ return new Promise(function (resolve, reject) {
34
+ var reader = new FileReader();
35
+ reader.readAsDataURL(file);
36
+
37
+ reader.onload = function () {
38
+ return resolve({
39
+ url: reader.result,
40
+ name: file.name,
41
+ type: file.type,
42
+ size: file.size,
43
+ file: file
44
+ });
45
+ };
46
+
47
+ reader.onerror = function (error) {
48
+ return reject(error);
49
+ };
50
+ });
51
+ }
52
+ /**
53
+ * Downloads a file from a given URL and converts it to a base64-encoded file with additional information.
54
+ * @param {string} url URL of the file to be downloaded.
55
+ * @param {string} name Optional name of the downloaded file.
56
+ * @returns {Promise<FormattedFile | null>} Promise that resolves with a FormattedFile object or null if the URL is not valid.
57
+ */
58
+
59
+
60
+ function urlToBase64(_x, _x2) {
61
+ return _urlToBase.apply(this, arguments);
62
+ }
63
+ /**
64
+ * Downloads a file from a given URL and opens the download prompt.
65
+ * @param {string} url URL of the file to be downloaded.
66
+ * @returns {Promise<boolean>} Promise that resolves with a boolean indicating whether the download was successful.
67
+ */
68
+
69
+
70
+ function _urlToBase() {
71
+ _urlToBase = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, name) {
72
+ var blob, file;
73
+ return regeneratorRuntime.wrap(function _callee$(_context) {
74
+ while (1) {
75
+ switch (_context.prev = _context.next) {
76
+ case 0:
77
+ if (url) {
78
+ _context.next = 2;
79
+ break;
80
+ }
81
+
82
+ return _context.abrupt("return", Promise.resolve(null));
83
+
84
+ case 2:
85
+ _context.prev = 2;
86
+ _context.next = 5;
87
+ return fetch(url).then(function (res) {
88
+ return res.blob();
89
+ });
90
+
91
+ case 5:
92
+ blob = _context.sent;
93
+ file = new File([blob], name || 'file', {
94
+ type: blob.type
95
+ });
96
+ return _context.abrupt("return", convertFileToBase64(file));
97
+
98
+ case 10:
99
+ _context.prev = 10;
100
+ _context.t0 = _context["catch"](2);
101
+ console.error(_context.t0);
102
+ return _context.abrupt("return", null);
103
+
104
+ case 14:
105
+ case "end":
106
+ return _context.stop();
107
+ }
108
+ }
109
+ }, _callee, null, [[2, 10]]);
110
+ }));
111
+ return _urlToBase.apply(this, arguments);
112
+ }
113
+
114
+ function downloadUrlToFile(_x3) {
115
+ return _downloadUrlToFile.apply(this, arguments);
116
+ }
117
+
118
+ function _downloadUrlToFile() {
119
+ _downloadUrlToFile = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(url) {
120
+ var _url$split$pop;
121
+
122
+ var blob, fileName, urlBlob, link;
123
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
124
+ while (1) {
125
+ switch (_context2.prev = _context2.next) {
126
+ case 0:
127
+ _context2.next = 2;
128
+ return fetch(url).then(function (res) {
129
+ return res.blob();
130
+ });
131
+
132
+ case 2:
133
+ blob = _context2.sent;
134
+
135
+ if (blob) {
136
+ _context2.next = 5;
137
+ break;
138
+ }
139
+
140
+ return _context2.abrupt("return", false);
141
+
142
+ case 5:
143
+ fileName = decodeURI(((_url$split$pop = url.split('/').pop()) === null || _url$split$pop === void 0 ? void 0 : _url$split$pop.split('.')[0]) || 'file');
144
+ urlBlob = window.URL.createObjectURL(blob);
145
+ link = document.createElement('a');
146
+ link.href = urlBlob;
147
+ link.download = fileName;
148
+ link.click();
149
+ window.URL.revokeObjectURL(urlBlob);
150
+ return _context2.abrupt("return", true);
151
+
152
+ case 13:
153
+ case "end":
154
+ return _context2.stop();
155
+ }
156
+ }
157
+ }, _callee2);
158
+ }));
159
+ return _downloadUrlToFile.apply(this, arguments);
160
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This function takes in a number of bytes and an optional number of decimal places and converts the number of bytes into a more readable format.
3
+ * @param {number} bytes - The number of bytes to be formatted.
4
+ * @param {number} decimals - Optional number of decimal places to round the result to. Default value is 2.
5
+ * @returns {string} - A string representing the formatted bytes with the appropriate unit (e.g. "10.24 KB").
6
+ */
7
+ export declare function formatBytes(bytes: number, decimals?: number): string;
8
+ //# sourceMappingURL=bytes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src/utils/formatters/bytes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,GAAG,MAAM,CAUvE"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatBytes = formatBytes;
7
+
8
+ /**
9
+ * This function takes in a number of bytes and an optional number of decimal places and converts the number of bytes into a more readable format.
10
+ * @param {number} bytes - The number of bytes to be formatted.
11
+ * @param {number} decimals - Optional number of decimal places to round the result to. Default value is 2.
12
+ * @returns {string} - A string representing the formatted bytes with the appropriate unit (e.g. "10.24 KB").
13
+ */
14
+ function formatBytes(bytes) {
15
+ var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
16
+ if (!+bytes) return '0 Bytes';
17
+ var unit = 1024;
18
+ var dm = decimals < 0 ? 0 : decimals;
19
+ var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
20
+ var sizeIndex = Math.floor(Math.log(bytes) / Math.log(unit));
21
+ return "".concat(parseFloat((bytes / Math.pow(unit, sizeIndex)).toFixed(dm)), " ").concat(sizes[sizeIndex]);
22
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This function takes in a string and returns a new string with the first letter capitalized.
3
+ * @param {string} string - The string to be capitalized.
4
+ * @returns {string} - A new string with the first letter capitalized.
5
+ */
6
+ export declare function capitalize(string: string): string;
7
+ //# sourceMappingURL=capitalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capitalize.d.ts","sourceRoot":"","sources":["../../../src/utils/formatters/capitalize.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEjD"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.capitalize = capitalize;
7
+
8
+ /**
9
+ * This function takes in a string and returns a new string with the first letter capitalized.
10
+ * @param {string} string - The string to be capitalized.
11
+ * @returns {string} - A new string with the first letter capitalized.
12
+ */
13
+ function capitalize(string) {
14
+ return string.charAt(0).toUpperCase() + string.slice(1);
15
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This function takes in a string representing a Brazilian postal code (CEP) and returns a formatted string in the standard CEP format (e.g. "12345-678").
3
+ * @param {string} cep - The string representing the Brazilian postal code (CEP).
4
+ * @returns {string} - A formatted string in the standard CEP format.
5
+ */
6
+ export declare function formatCep(cep: string): string;
7
+ /**
8
+ * This function takes in a string representing a Brazilian postal code (CEP) and returns a sanitized string without any non-numeric characters, with a maximum length of 8 characters.
9
+ * @param {string} cep - The string representing the Brazilian postal code (CEP).
10
+ * @returns {string} - A sanitized string without any non-numeric characters, with a maximum length of 8 characters.
11
+ */
12
+ export declare function sanitizeCep(cep: string): string;
13
+ //# sourceMappingURL=cep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cep.d.ts","sourceRoot":"","sources":["../../../src/utils/formatters/cep.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK7C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatCep = formatCep;
7
+ exports.sanitizeCep = sanitizeCep;
8
+
9
+ /**
10
+ * This function takes in a string representing a Brazilian postal code (CEP) and returns a formatted string in the standard CEP format (e.g. "12345-678").
11
+ * @param {string} cep - The string representing the Brazilian postal code (CEP).
12
+ * @returns {string} - A formatted string in the standard CEP format.
13
+ */
14
+ function formatCep(cep) {
15
+ return cep.replace(/\D/g, '').replace(/(\d{5})(\d)/, '$1-$2').replace(/(-\d{3})\d+?$/, '$1');
16
+ }
17
+ /**
18
+ * This function takes in a string representing a Brazilian postal code (CEP) and returns a sanitized string without any non-numeric characters, with a maximum length of 8 characters.
19
+ * @param {string} cep - The string representing the Brazilian postal code (CEP).
20
+ * @returns {string} - A sanitized string without any non-numeric characters, with a maximum length of 8 characters.
21
+ */
22
+
23
+
24
+ function sanitizeCep(cep) {
25
+ return cep ? cep.replace(/\D/g, '').substring(0, 8) : '';
26
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This function takes in a string representing a Brazilian CNPJ number and returns a formatted string in the standard CNPJ format (e.g. "12.345.678/0001-90").
3
+ * @param {string} text - The string representing the Brazilian CNPJ number.
4
+ * @returns {string} - A formatted string in the standard CNPJ format.
5
+ */
6
+ export declare function formatCnpj(text: string): string;
7
+ /**
8
+ * This function takes in a string representing a Brazilian CNPJ number and returns a sanitized string without any non-numeric characters, with a maximum length of 14 characters.
9
+ * @param {string} cnpj - The string representing the Brazilian CNPJ number.
10
+ * @returns {string} - A sanitized string without any non-numeric characters, with a maximum length of 14 characters.
11
+ */
12
+ export declare function sanitizeCNPJ(cnpj: string): string;
13
+ /**
14
+ * This function takes in a string representing a Brazilian CNPJ number and returns a boolean indicating whether the number is valid or not.
15
+ * @param {string} cnpj - The string representing the Brazilian CNPJ number.
16
+ * @returns {boolean} - A boolean indicating whether the CNPJ number is valid or not.
17
+ */
18
+ export declare function validateCNPJ(cnpj: string): boolean;
19
+ //# sourceMappingURL=cnpj.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cnpj.d.ts","sourceRoot":"","sources":["../../../src/utils/formatters/cnpj.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAuBlD"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatCnpj = formatCnpj;
7
+ exports.sanitizeCNPJ = sanitizeCNPJ;
8
+ exports.validateCNPJ = validateCNPJ;
9
+
10
+ /**
11
+ * This function takes in a string representing a Brazilian CNPJ number and returns a formatted string in the standard CNPJ format (e.g. "12.345.678/0001-90").
12
+ * @param {string} text - The string representing the Brazilian CNPJ number.
13
+ * @returns {string} - A formatted string in the standard CNPJ format.
14
+ */
15
+ function formatCnpj(text) {
16
+ return text.replace(/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/, '$1.$2.$3/$4-$5');
17
+ }
18
+ /**
19
+ * This function takes in a string representing a Brazilian CNPJ number and returns a sanitized string without any non-numeric characters, with a maximum length of 14 characters.
20
+ * @param {string} cnpj - The string representing the Brazilian CNPJ number.
21
+ * @returns {string} - A sanitized string without any non-numeric characters, with a maximum length of 14 characters.
22
+ */
23
+
24
+
25
+ function sanitizeCNPJ(cnpj) {
26
+ return cnpj ? cnpj.replace(/\D/g, '').substring(0, 14) : '';
27
+ }
28
+ /**
29
+ * This function takes in a string representing a Brazilian CNPJ number and returns a boolean indicating whether the number is valid or not.
30
+ * @param {string} cnpj - The string representing the Brazilian CNPJ number.
31
+ * @returns {boolean} - A boolean indicating whether the CNPJ number is valid or not.
32
+ */
33
+
34
+
35
+ function validateCNPJ(cnpj) {
36
+ var sanitizedCnpj = sanitizeCNPJ(cnpj);
37
+
38
+ if (sanitizedCnpj.length === 14) {
39
+ var digits = [0, 0];
40
+
41
+ for (var i = 0; i < 12; i++) {
42
+ digits[0] += Number(sanitizedCnpj[11 - i]) * (i % 8 + 2);
43
+ digits[1] += Number(sanitizedCnpj[11 - i]) * ((i + 1) % 8 + 2);
44
+ }
45
+
46
+ digits[0] = digits[0] % 11;
47
+ if (digits[0] > 1) digits[0] = 11 - digits[0];else digits[0] = 0;
48
+ digits[1] = (digits[1] + digits[0] * 2) % 11;
49
+ if (digits[1] > 1) digits[1] = 11 - digits[1];else digits[1] = 0;
50
+ return sanitizedCnpj[12] === digits[0].toString() && sanitizedCnpj[13] === digits[1].toString();
51
+ }
52
+
53
+ return false;
54
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Converts a hexadecimal color code to HSL (Hue, Saturation, Luminance) format.
3
+ * @param {string} hex - The hexadecimal color code to convert.
4
+ * @returns {object} An object with the HSL values: hue, saturation, and luminance.
5
+ */
6
+ export declare function hexToHsl(hex: string): object;
7
+ /**
8
+ * Converts HSL color values to a hex string representation.
9
+ *
10
+ * @param {number} h - The hue value (in degrees, from 0 to 360).
11
+ * @param {number} s - The saturation value (from 0 to 100).
12
+ * @param {number} l - The lightness value (from 0 to 100).
13
+ * @returns {string} The hex string representation of the HSL color.
14
+ */
15
+ export declare function hslToHex(h: number, s: number, l: number): string;
16
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/utils/formatters/color.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA0C5C;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAkDhE"}
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.hexToHsl = hexToHsl;
7
+ exports.hslToHex = hslToHex;
8
+
9
+ /**
10
+ * Converts a hexadecimal color code to HSL (Hue, Saturation, Luminance) format.
11
+ * @param {string} hex - The hexadecimal color code to convert.
12
+ * @returns {object} An object with the HSL values: hue, saturation, and luminance.
13
+ */
14
+ function hexToHsl(hex) {
15
+ // Extract the red, green, and blue values from the hexadecimal color code.
16
+ var r, g, b;
17
+
18
+ if (hex.length === 4) {
19
+ r = parseInt('0x' + hex[1] + hex[1]);
20
+ g = parseInt('0x' + hex[2] + hex[2]);
21
+ b = parseInt('0x' + hex[3] + hex[3]);
22
+ } else {
23
+ r = parseInt('0x' + hex[1] + hex[2]);
24
+ g = parseInt('0x' + hex[3] + hex[4]);
25
+ b = parseInt('0x' + hex[5] + hex[6]);
26
+ } // Convert the RGB values to the 0-1 range and calculate the minimum, maximum, and delta values.
27
+
28
+
29
+ r /= 255;
30
+ g /= 255;
31
+ b /= 255;
32
+ var cmin = Math.min(r, g, b);
33
+ var cmax = Math.max(r, g, b);
34
+ var delta = cmax - cmin; // Calculate the hue, saturation, and luminance values based on the RGB values.
35
+
36
+ var h, s, l;
37
+ if (delta === 0) h = 0;else if (cmax === r) h = (g - b) / delta % 6;else if (cmax === g) h = (b - r) / delta + 2;else h = (r - g) / delta + 4;
38
+ h = Math.round(h * 60);
39
+ if (h < 0) h += 360;
40
+ l = (cmax + cmin) / 2;
41
+ s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));
42
+ s = +(s * 100).toFixed(1);
43
+ l = +(l * 100).toFixed(1); // Return the HSL values as an object.
44
+
45
+ return {
46
+ hue: h,
47
+ saturation: s,
48
+ luminance: l
49
+ };
50
+ }
51
+ /**
52
+ * Converts HSL color values to a hex string representation.
53
+ *
54
+ * @param {number} h - The hue value (in degrees, from 0 to 360).
55
+ * @param {number} s - The saturation value (from 0 to 100).
56
+ * @param {number} l - The lightness value (from 0 to 100).
57
+ * @returns {string} The hex string representation of the HSL color.
58
+ */
59
+
60
+
61
+ function hslToHex(h, s, l) {
62
+ // Convert saturation and lightness to values between 0 and 1.
63
+ s /= 100;
64
+ l /= 100; // Calculate chroma, which is the difference between the max and min values.
65
+
66
+ var c = (1 - Math.abs(2 * l - 1)) * s; // Calculate the intermediate value x.
67
+
68
+ var x = c * (1 - Math.abs(h / 60 % 2 - 1)); // Calculate the lightness adjustment factor.
69
+
70
+ var m = l - c / 2; // Initialize RGB values.
71
+
72
+ var r = 0;
73
+ var g = 0;
74
+ var b = 0; // Calculate RGB values based on the current hue.
75
+
76
+ switch (Math.floor(h / 60)) {
77
+ case 0:
78
+ r = c;
79
+ g = x;
80
+ break;
81
+
82
+ case 1:
83
+ r = x;
84
+ g = c;
85
+ break;
86
+
87
+ case 2:
88
+ g = c;
89
+ b = x;
90
+ break;
91
+
92
+ case 3:
93
+ g = x;
94
+ b = c;
95
+ break;
96
+
97
+ case 4:
98
+ r = x;
99
+ b = c;
100
+ break;
101
+
102
+ case 5:
103
+ r = c;
104
+ b = x;
105
+ break;
106
+ } // Convert the RGB values to a hex string.
107
+
108
+
109
+ var hexValue = (r + m) * 255 << 16 | (g + m) * 255 << 8 | (b + m) * 255;
110
+ return '#' + hexValue.toString(16).padStart(6, '0');
111
+ }