linear-react-components-ui 1.1.19-beta.1 → 1.1.19-beta.3

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 (225) hide show
  1. package/.editorconfig +19 -0
  2. package/.eslintcache +1 -0
  3. package/.eslintrc.json +68 -0
  4. package/.gitlab-ci.yml +27 -0
  5. package/.husky/pre-push +4 -0
  6. package/.nvmrc +1 -0
  7. package/.stylelintrc +26 -0
  8. package/.vscode/launch.json +15 -0
  9. package/.vscode/settings.json +22 -0
  10. package/babel.config.json +11 -0
  11. package/config/getHttpsConfig.js +56 -0
  12. package/config/jest/cssTransform.js +14 -0
  13. package/config/jest/fileTransform.js +12 -0
  14. package/config/jest/storageMock.js +40 -0
  15. package/config/paths.js +140 -0
  16. package/config/webpackDevServer.config.js +128 -0
  17. package/jest.config.js +18 -0
  18. package/lib/alerts/AlertContainer.js +1 -1
  19. package/lib/alerts/AlertProvider.js +3 -3
  20. package/lib/alerts/BaseAlert.js +1 -1
  21. package/lib/alerts/Message.js +1 -1
  22. package/lib/alerts/index.js +1 -1
  23. package/lib/alerts/withAlert.js +2 -2
  24. package/lib/assets/styles/table.scss +7 -6
  25. package/lib/avatar/index.js +2 -2
  26. package/lib/badge/index.js +1 -1
  27. package/lib/buttons/ActivateButton.js +2 -2
  28. package/lib/buttons/AddButton.js +2 -2
  29. package/lib/buttons/Button.js +3 -3
  30. package/lib/buttons/ButtonGroups.js +1 -1
  31. package/lib/buttons/CancelButton.js +4 -4
  32. package/lib/buttons/DangerButton.js +4 -4
  33. package/lib/buttons/DefaultButton.js +5 -5
  34. package/lib/buttons/DestroyButton.js +4 -4
  35. package/lib/buttons/EditButton.js +2 -2
  36. package/lib/buttons/InactivateButton.js +2 -2
  37. package/lib/buttons/InfoButton.js +4 -4
  38. package/lib/buttons/PrimaryButton.js +4 -4
  39. package/lib/buttons/RestoreButton.js +2 -2
  40. package/lib/buttons/SaveButton.js +4 -4
  41. package/lib/buttons/SuccessButton.js +4 -4
  42. package/lib/buttons/WarningButton.js +4 -4
  43. package/lib/buttons/button_container/index.js +2 -2
  44. package/lib/buttons/index.js +1 -1
  45. package/lib/buttons/split_button/index.js +2 -2
  46. package/lib/calendar/DangerCalendar.js +4 -4
  47. package/lib/calendar/InfoCalendar.js +4 -4
  48. package/lib/calendar/PrimaryCalendar.js +4 -4
  49. package/lib/calendar/SuccessCalendar.js +4 -4
  50. package/lib/calendar/WarningCalendar.js +4 -4
  51. package/lib/calendar/base/Day.js +1 -1
  52. package/lib/calendar/base/Month.js +1 -1
  53. package/lib/calendar/base/Week.js +1 -1
  54. package/lib/calendar/base/helpers.js +1 -1
  55. package/lib/calendar/base/index.js +1 -1
  56. package/lib/calendar/index.js +1 -1
  57. package/lib/checkbox/Label.js +1 -1
  58. package/lib/checkbox/index.js +2 -2
  59. package/lib/dialog/Alert.js +2 -2
  60. package/lib/dialog/Custom.js +2 -2
  61. package/lib/dialog/Error.js +2 -2
  62. package/lib/dialog/Information.js +2 -2
  63. package/lib/dialog/Question.js +2 -2
  64. package/lib/dialog/Warning.js +2 -2
  65. package/lib/dialog/base/Content.js +1 -1
  66. package/lib/dialog/base/Footer.js +1 -1
  67. package/lib/dialog/base/Header.js +1 -1
  68. package/lib/dialog/base/index.js +1 -1
  69. package/lib/dialog/form/index.js +3 -3
  70. package/lib/dialog/index.js +1 -1
  71. package/lib/drawer/Content.js +1 -1
  72. package/lib/drawer/Drawer.js +5 -5
  73. package/lib/drawer/Header.js +1 -1
  74. package/lib/drawer/helpers.js +1 -1
  75. package/lib/drawer/index.js +1 -1
  76. package/lib/dropdown/Popup.js +3 -3
  77. package/lib/dropdown/withDropdown.js +2 -2
  78. package/lib/fieldset/index.js +2 -2
  79. package/lib/form/Field.js +5 -5
  80. package/lib/form/FieldArray.js +5 -5
  81. package/lib/form/FieldNumber.js +3 -3
  82. package/lib/form/FieldPeriod.js +2 -2
  83. package/lib/form/helpers.js +1 -1
  84. package/lib/form/index.js +3 -3
  85. package/lib/form/withFieldHOC.js +1 -1
  86. package/lib/form/withFormSecurity.js +1 -1
  87. package/lib/gridlayout/GridCol.js +1 -1
  88. package/lib/gridlayout/GridRow.js +2 -2
  89. package/lib/gridlayout/index.js +1 -1
  90. package/lib/hint/helpers.js +1 -1
  91. package/lib/hint/index.js +1 -1
  92. package/lib/icons/index.js +1 -1
  93. package/lib/index.js +1 -1
  94. package/lib/inputs/base/InputTextBase.js +3 -3
  95. package/lib/inputs/base/Label.js +1 -1
  96. package/lib/inputs/base/helpers.js +1 -1
  97. package/lib/inputs/color/index.js +2 -2
  98. package/lib/inputs/date/Dialog.js +1 -1
  99. package/lib/inputs/date/Dropdown.js +1 -1
  100. package/lib/inputs/date/helpers.js +1 -1
  101. package/lib/inputs/date/index.js +2 -2
  102. package/lib/inputs/file/DefaultFile.js +2 -2
  103. package/lib/inputs/file/DragDropFile.js +2 -2
  104. package/lib/inputs/file/File.js +4 -4
  105. package/lib/inputs/file/FileButtonSettings.js +1 -1
  106. package/lib/inputs/file/index.js +1 -1
  107. package/lib/inputs/inputHOC.js +2 -2
  108. package/lib/inputs/mask/BaseMask.js +5 -5
  109. package/lib/inputs/mask/Cnpj.js +2 -2
  110. package/lib/inputs/mask/Cpf.js +2 -2
  111. package/lib/inputs/mask/Phone.js +2 -2
  112. package/lib/inputs/mask/ZipCode.js +2 -2
  113. package/lib/inputs/mask/helpers.js +3 -3
  114. package/lib/inputs/mask/index.js +1 -1
  115. package/lib/inputs/multiSelect/ActionButtons.js +1 -1
  116. package/lib/inputs/multiSelect/Dropdown.js +2 -2
  117. package/lib/inputs/multiSelect/index.js +3 -3
  118. package/lib/inputs/number/BaseNumber.js +3 -3
  119. package/lib/inputs/number/Currency.js +2 -2
  120. package/lib/inputs/number/Decimal.js +1 -1
  121. package/lib/inputs/number/index.js +2 -2
  122. package/lib/inputs/period/Dialog.js +1 -1
  123. package/lib/inputs/period/Dropdown.js +1 -1
  124. package/lib/inputs/period/PeriodList.js +1 -1
  125. package/lib/inputs/period/helper.js +1 -1
  126. package/lib/inputs/period/index.js +2 -2
  127. package/lib/inputs/search/index.js +5 -5
  128. package/lib/inputs/select/ActionButtons.js +1 -1
  129. package/lib/inputs/select/Dropdown.js +2 -2
  130. package/lib/inputs/select/index.js +4 -4
  131. package/lib/inputs/select/multiple/Selecteds.js +1 -1
  132. package/lib/inputs/select/multiple/index.js +2 -2
  133. package/lib/inputs/select/simple/index.js +2 -2
  134. package/lib/inputs/text/index.js +1 -1
  135. package/lib/inputs/textarea/index.js +2 -2
  136. package/lib/internals/withTooltip.js +2 -2
  137. package/lib/labelMessages/index.js +1 -1
  138. package/lib/labels/DangerLabel.js +4 -4
  139. package/lib/labels/DefaultLabel.js +1 -1
  140. package/lib/labels/InfoLabel.js +4 -4
  141. package/lib/labels/PrimaryLabel.js +4 -4
  142. package/lib/labels/SuccessLabel.js +4 -4
  143. package/lib/labels/WarningLabel.js +4 -4
  144. package/lib/labels/index.js +1 -1
  145. package/lib/labels/label_container/index.js +1 -1
  146. package/lib/list/Header.js +1 -1
  147. package/lib/list/Item.js +2 -2
  148. package/lib/list/Separator.js +1 -1
  149. package/lib/list/helpers.js +1 -1
  150. package/lib/list/index.js +1 -1
  151. package/lib/menus/float/MenuItem.js +1 -1
  152. package/lib/menus/float/SubMenuContainer.js +1 -1
  153. package/lib/menus/float/helpers.js +1 -1
  154. package/lib/menus/float/index.js +1 -1
  155. package/lib/menus/index.js +1 -1
  156. package/lib/menus/sidenav/ExpandMenu.js +1 -1
  157. package/lib/menus/sidenav/MenuLink.js +1 -1
  158. package/lib/menus/sidenav/NavMenuItem.js +2 -2
  159. package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
  160. package/lib/menus/sidenav/helpers.js +1 -1
  161. package/lib/menus/sidenav/index.js +2 -2
  162. package/lib/menus/sidenav/popup_menu_search/EmptyList.js +1 -1
  163. package/lib/menus/sidenav/popup_menu_search/index.js +1 -1
  164. package/lib/noPermission/index.js +1 -1
  165. package/lib/panel/Content.js +4 -4
  166. package/lib/panel/DangerPanel.js +2 -2
  167. package/lib/panel/Default.js +4 -4
  168. package/lib/panel/Header.js +4 -4
  169. package/lib/panel/InfoPanel.js +2 -2
  170. package/lib/panel/PrimaryPanel.js +2 -2
  171. package/lib/panel/SuccessPanel.js +2 -2
  172. package/lib/panel/ToolBar.js +1 -1
  173. package/lib/panel/WarningPanel.js +2 -2
  174. package/lib/panel/helpers.js +1 -1
  175. package/lib/panel/index.js +1 -1
  176. package/lib/popover/PopoverText.js +1 -1
  177. package/lib/popover/PopoverTitle.js +1 -1
  178. package/lib/popover/index.js +1 -1
  179. package/lib/progress/Bar.js +1 -1
  180. package/lib/progress/index.js +2 -2
  181. package/lib/radio/index.js +2 -2
  182. package/lib/shortcuts/index.js +1 -1
  183. package/lib/skeleton/SkeletonContainer.js +1 -1
  184. package/lib/skeleton/index.js +2 -2
  185. package/lib/spinner/SpinnerLoading.js +1 -1
  186. package/lib/spinner/index.js +1 -1
  187. package/lib/split/Split.js +2 -2
  188. package/lib/split/SplitSide.js +1 -1
  189. package/lib/split/helpers.js +1 -1
  190. package/lib/split/index.js +1 -1
  191. package/lib/table/Body.js +1 -1
  192. package/lib/table/Header.js +1 -1
  193. package/lib/table/HeaderColumn.d.ts +1 -1
  194. package/lib/table/HeaderColumn.js +7 -6
  195. package/lib/table/Row.js +1 -1
  196. package/lib/table/RowColumn.js +5 -4
  197. package/lib/table/helpers.js +1 -1
  198. package/lib/table/index.js +4 -4
  199. package/lib/table/types.d.ts +4 -2
  200. package/lib/tabs/DropdownTabs.js +2 -2
  201. package/lib/tabs/Menu.js +3 -3
  202. package/lib/tabs/MenuTabs.js +2 -2
  203. package/lib/tabs/Panel.js +1 -1
  204. package/lib/tabs/context.js +1 -1
  205. package/lib/tabs/index.js +4 -4
  206. package/lib/tabs/tabHelpers.js +3 -3
  207. package/lib/textContent/index.js +3 -3
  208. package/lib/toolbar/ButtonBar.js +4 -4
  209. package/lib/toolbar/LabelBar.js +4 -4
  210. package/lib/toolbar/Separator.js +1 -1
  211. package/lib/toolbar/ToolBarGroup.js +1 -1
  212. package/lib/toolbar/index.js +4 -4
  213. package/lib/tooltip/index.js +1 -1
  214. package/lib/treetable/Body.js +1 -1
  215. package/lib/treetable/Row.js +5 -5
  216. package/lib/treetable/index.js +3 -3
  217. package/lib/treeview/Header.js +1 -1
  218. package/lib/treeview/Node.js +8 -10
  219. package/lib/treeview/constants.js +1 -1
  220. package/lib/treeview/index.js +2 -2
  221. package/lib/uitour/index.js +1 -1
  222. package/package.json +1 -4
  223. package/scripts/start.js +135 -0
  224. package/tsconfig.json +33 -0
  225. package/tsup.config.ts +10 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "jest": true
5
+ },
6
+ "extends": [
7
+ "eslint:recommended",
8
+ "plugin:react/recommended",
9
+ "plugin:react-hooks/recommended",
10
+ "plugin:import/recommended",
11
+ "airbnb-typescript"
12
+ ],
13
+ "parser": "@typescript-eslint/parser",
14
+ "parserOptions": {
15
+ "ecmaFeatures": { "jsx": true },
16
+ "ecmaVersion": "latest",
17
+ "sourceType": "module",
18
+ "project": ["./tsconfig.json", "./images.d.ts"]
19
+ },
20
+ "plugins": ["react", "@typescript-eslint", "jsx-a11y"],
21
+ "rules": {
22
+ "react/jsx-filename-extension": [1, { "extensions": [".tsx", ".jsx"] }],
23
+ "import/no-extraneous-dependencies": ["off", {"devDependencies": false, "optionalDependencies": false, "peerDependencies": false}],
24
+ "jsx-a11y/no-static-element-interactions": "off",
25
+ "react/jsx-indent": "off",
26
+ "react/jsx-uses-react": "off",
27
+ "react/react-in-jsx-scope": "off",
28
+ "@typescript-eslint/indent": ["error", 2],
29
+ "import/prefer-default-export": [0],
30
+ "prefer-destructuring": ["error", {"object": true, "array": false}],
31
+ "react/forbid-prop-types": ["error", { "forbid": ["array"] }],
32
+ "react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
33
+ "react/jsx-closing-bracket-location": ["error", "after-props"],
34
+ "react/no-unused-prop-types": [0],
35
+ "jsx-a11y/heading-has-content": "off",
36
+ "jsx-a11y/anchor-has-content": "off",
37
+ "jsx-a11y/anchor-is-valid": [ "error", {
38
+ "components": [ "Link" ],
39
+ "specialLink": [ "hrefLeft", "hrefRight" ],
40
+ "aspects": ["preferButton" ]
41
+ }],
42
+ "jsx-a11y/no-autofocus": [0],
43
+ "object-curly-newline": [0],
44
+ "jsx-a11y/label-has-for": [0],
45
+ "@typescript-eslint/no-useless-constructor": "off",
46
+ "@typescript-eslint/no-throw-literal": "off",
47
+ "react/function-component-definition": "off",
48
+ "arrow-parens": "off",
49
+ "react-hooks/exhaustive-deps": "off",
50
+ "react/jsx-props-no-spreading": "off",
51
+ "implicit-arrow-linebreak": "off",
52
+ "function-paren-newline": "off",
53
+ "react/destructuring-assignment": "off",
54
+ "react/jsx-no-constructed-context-values": "off",
55
+ "@typescript-eslint/no-unused-vars": "off",
56
+ "react/no-unknown-property": ["error", { "ignore": ["align"] }],
57
+ "no-console": "warn"
58
+ },
59
+ "settings": {
60
+ "react": {
61
+ "version": "detect"
62
+ },
63
+ "import/extensions": [".js", ".mjs", ".jsx", ".ts", ".tsx", ".d.ts"],
64
+ "import/parser": {
65
+ "@typescript-eslint/parser": [".ts", ".tsx", ".d.ts"]
66
+ }
67
+ }
68
+ }
package/.gitlab-ci.yml ADDED
@@ -0,0 +1,27 @@
1
+ stages:
2
+ - lint
3
+ - tests-units
4
+
5
+ cache:
6
+ key:
7
+ files:
8
+ - package-lock.json
9
+ paths:
10
+ - .npm
11
+ - .eslintcache
12
+
13
+ lint:
14
+ stage: lint
15
+ image: node:20.11.0
16
+ before_script:
17
+ - npm ci --legacy-peer-deps --cache .npm --prefer-offline
18
+ script:
19
+ - npm run check:js
20
+
21
+ units:
22
+ stage: tests-units
23
+ image: node:20.11.0
24
+ before_script:
25
+ - npm ci --legacy-peer-deps --cache .npm --prefer-offline
26
+ script:
27
+ - npm run test
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npm run check:js
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v20.11.0
package/.stylelintrc ADDED
@@ -0,0 +1,26 @@
1
+ #https://stylelint.io/user-guide/
2
+ {
3
+ "rules": {
4
+ "block-no-empty": null,
5
+ "color-no-invalid-hex": true,
6
+ "comment-empty-line-before": [ "always", {
7
+ "ignore": ["stylelint-commands", "after-comment"]
8
+ } ],
9
+ "declaration-colon-space-after": "always",
10
+ "indentation": [2, {
11
+ "except": ["value"]
12
+ }],
13
+ "max-empty-lines": 2,
14
+ "rule-empty-line-before": [ "never", {
15
+ "except": ["after-rule", "after-single-line-comment"],
16
+ "ignore": ["after-comment", "inside-block"]
17
+ } ],
18
+ "unit-whitelist": ["em", "rem", "%", "px", "ms", "fr", "s", "deg"],
19
+ "block-opening-brace-space-before": "always",
20
+ "block-closing-brace-newline-before": "always",
21
+ "comment-no-empty": true,
22
+ "no-extra-semicolons": true,
23
+ "shorthand-property-no-redundant-values": true,
24
+ "declaration-block-no-redundant-longhand-properties": true,
25
+ }
26
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "type": "pwa-chrome",
9
+ "request": "launch",
10
+ "name": "Launch Chrome against localhost",
11
+ "url": "http://localhost:3001",
12
+ "webRoot": "${workspaceFolder}"
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "files.exclude": {
3
+ "config": true,
4
+ "coverage": true,
5
+ "node_modules": true,
6
+ "scripts": true,
7
+ ".eslintrc.js": true,
8
+ ".gitignore": true,
9
+ "package-lock.json": true,
10
+ ".nvmrc": true,
11
+ ".npmignore": true,
12
+ ".editorconfig": true,
13
+ ".stylelintrc": true,
14
+ "jest.config.js": true,
15
+ "tsup.config.ts": true,
16
+ "LICENSE": true,
17
+ "babel.config.json": true,
18
+ },
19
+ "editor.codeActionsOnSave": {
20
+ "source.fixAll.eslint": "explicit"
21
+ },
22
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "presets": [
3
+ "@babel/preset-env",
4
+ "@babel/preset-react",
5
+ "@babel/preset-typescript"
6
+ ],
7
+ "plugins": [
8
+ "@babel/plugin-transform-object-rest-spread",
9
+ "@babel/plugin-transform-class-properties"
10
+ ]
11
+ }
@@ -0,0 +1,56 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const crypto = require('crypto');
4
+ const chalk = require('react-dev-utils/chalk');
5
+ const paths = require('./paths');
6
+
7
+ // Ensure the certificate and key provided are valid and if not
8
+ // throw an easy to debug error
9
+ function validateKeyAndCerts({ cert, key, keyFile, crtFile }) {
10
+ let encrypted;
11
+ try {
12
+ // publicEncrypt will throw an error with an invalid cert
13
+ encrypted = crypto.publicEncrypt(cert, Buffer.from('test'));
14
+ } catch (err) {
15
+ throw new Error(`The certificate "${chalk.yellow(crtFile)}" is invalid.\n${err.message}`);
16
+ }
17
+
18
+ try {
19
+ // privateDecrypt will throw an error with an invalid key
20
+ crypto.privateDecrypt(key, encrypted);
21
+ } catch (err) {
22
+ throw new Error(`The certificate key "${chalk.yellow(keyFile)}" is invalid.\n${
23
+ err.message
24
+ }`);
25
+ }
26
+ }
27
+
28
+ // Read file and throw an error if it doesn't exist
29
+ function readEnvFile(file, type) {
30
+ if (!fs.existsSync(file)) {
31
+ throw new Error(`You specified ${chalk.cyan(type)} in your env, but the file "${chalk.yellow(file)}" can't be found.`);
32
+ }
33
+ return fs.readFileSync(file);
34
+ }
35
+
36
+ // Get the https config
37
+ // Return cert files if provided in env, otherwise just true or false
38
+ function getHttpsConfig() {
39
+ const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;
40
+ const isHttps = HTTPS === 'true';
41
+
42
+ if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
43
+ const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
44
+ const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
45
+ const config = {
46
+ cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
47
+ key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
48
+ };
49
+
50
+ validateKeyAndCerts({ ...config, keyFile, crtFile });
51
+ return config;
52
+ }
53
+ return isHttps;
54
+ }
55
+
56
+ module.exports = getHttpsConfig;
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ // This is a custom Jest transformer turning style imports into empty objects.
4
+ // http://facebook.github.io/jest/docs/en/webpack.html
5
+
6
+ module.exports = {
7
+ process() {
8
+ return 'module.exports = {};';
9
+ },
10
+ getCacheKey() {
11
+ // The output is always the same.
12
+ return 'cssTransform';
13
+ },
14
+ };
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+
5
+ // This is a custom Jest transformer turning file imports into filenames.
6
+ // http://facebook.github.io/jest/docs/en/webpack.html
7
+
8
+ module.exports = {
9
+ process(src, filename) {
10
+ return `module.exports = ${JSON.stringify(path.basename(filename))};`;
11
+ },
12
+ };
@@ -0,0 +1,40 @@
1
+ export const sessionStorageValueMock = '{"SG_CADASTROS":[{"nome":"Empresas","codigo":"SG_CADASTROS_EMPRESAS","permissoes":[{"codigo":"SG_CADASTROS_EMPRESAS_GRAVAR"},{"codigo":"SG_CADASTROS_EMPRESAS_CONSULTAR"},{"codigo":"SG_CADASTROS_EMPRESAS_EXCLUIR"},{"codigo":"SG_CADASTROS_EMPRESAS_RESTAURAR"},{"codigo":"SG_CADASTROS_EMPRESAS_ATIVAR"},{"codigo":"SG_CADASTROS_EMPRESAS_INATIVAR"}],"descricao":"Gestão das Empresas","itens":[]},{"nome":"Parceiros","codigo":"SG_CADASTROS_PARCEIROS","permissoes":[{"codigo":"SG_CADASTROS_PARCEIROS_GRAVAR"},{"codigo":"SG_CADASTROS_PARCEIROS_CONSULTAR"},{"codigo":"SG_CADASTROS_PARCEIROS_EXCLUIR"},{"codigo":"SG_CADASTROS_PARCEIROS_CONTATOS_GRAVAR"},{"codigo":"SG_CADASTROS_PARCEIROS_CONTATOS_CONSULTAR"},{"codigo":"SG_CADASTROS_PARCEIROS_RESTAURAR"},{"codigo":"SG_CADASTROS_PARCEIROS_ATIVAR"},{"codigo":"SG_CADASTROS_PARCEIROS_INATIVAR"}],"descricao":"Gestão de Pessoas que se relacionam com as Empresas","itens":[]},{"nome":"Produtos","codigo":"SG_CADASTROS_PRODUTOS","permissoes":[],"itens":[{"nome":"Produtos em Promoção","codigo":"SG_CADASTROS_PRODUTOS_EM_PROMOCAO","permissoes":[{"codigo":"SG_CADASTROS_PRODUTOS_EM_PROMOCAO_CONSULTAR"},{"codigo":"SG_CADASTROS_PRODUTOS_EM_PROMOCAO_VISUALIZAR"},{"codigo":"SG_CADASTROS_PRODUTOS_EM_PROMOCAO_NAO_EXPIRADAS"},{"codigo":"SG_CADASTROS_PRODUTOS_EM_PROMOCAO_UPLOAD_IMAGEM"},{"codigo":"SG_CADASTROS_PRODUTOS_EM_PROMOCAO_TROCAR_IMAGEM"}],"descricao":"Manutenção de Produtos em Promoção E-PROMO","itens":[]},{"nome":"Imagens dos Produtos","codigo":"SG_CADASTROS_PRODUTOS_IMAGENS","permissoes":[{"codigo":"SG_CADASTROS_PRODUTOS_IMAGENS_CONSULTAR"},{"codigo":"SG_CADASTROS_PRODUTOS_IMAGENS_VISUALIZAR"},{"codigo":"SG_CADASTROS_PRODUTOS_IMAGENS_INCLUIR"},{"codigo":"SG_CADASTROS_PRODUTOS_IMAGENS_EDITAR"},{"codigo":"SG_CADASTROS_PRODUTOS_IMAGENS_EXCLUIR"}],"descricao":"Manutenção das imagens privadas dos produtos","itens":[]}]},{"nome":"Tabelas Auxiliares","codigo":"SG_CADASTROS_TABELAS_AUXILIARES","permissoes":[],"descricao":"Cadastros de Tabelas Auxliliares","itens":[{"nome":"Grupo vendedor","codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_VENDEDOR","permissoes":[{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_VENDEDOR_INCLUIR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_VENDEDOR_ALTERAR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_VENDEDOR_PESQUISAR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_VENDEDOR_VISUALIZAR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_VENDEDOR_EXCLUIR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_VENDEDOR_RESTAURAR"}],"descricao":"Gestão de grupos de vendedores","itens":[]},{"nome":"Cadastro de Setor Colaborador","codigo":"SG_CADASTROS_TABELAS_AUXILIARES_SETOR_COLABORADOR","permissoes":[{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_SETOR_COLABORADOR_INCLUIR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_SETOR_COLABORADOR_ALTERAR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_SETOR_COLABORADOR_PESQUISAR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_SETOR_COLABORADOR_VISUALIZAR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_SETOR_COLABORADOR_EXCLUIR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_SETOR_COLABORADOR_RESTAURAR"}],"descricao":"Permite o cadastro de setor colaborador","itens":[]},{"nome":"Grupos de empresas","codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_EMPRESA","permissoes":[{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_EMPRESA_INCLUIR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_EMPRESA_ALTERAR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_EMPRESA_PESQUISAR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_EMPRESA_VISUALIZAR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_EMPRESA_EXCLUIR"},{"codigo":"SG_CADASTROS_TABELAS_AUXILIARES_GRUPO_EMPRESA_RESTAURAR"}],"descricao":"Gestão de grupos de empresas","itens":[]}]},{"nome":"Cadastro de turnos","codigo":"SG_CADASTROS_TURNO","permissoes":[{"codigo":"SG_CADASTROS_TURNO_INCLUIR"},{"codigo":"SG_CADASTROS_TURNO_ALTERAR"},{"codigo":"SG_CADASTROS_TURNO_PESQUISAR"},{"codigo":"SG_CADASTROS_TURNO_VISUALIZAR"},{"codigo":"SG_CADASTROS_TURNO_EXCLUIR"},{"codigo":"SG_CADASTROS_TURNO_RESTAURAR"}],"descricao":"Permite o cadastro de turnos","itens":[],"codigoPaiExibicao":"SG_ADMINISTRATIVO_TABELAS_SISTEMA"}]}';
2
+
3
+ const storageMock = () => {
4
+ const storage = {
5
+ permissionsStorage: sessionStorageValueMock,
6
+ };
7
+
8
+ return {
9
+ setItem: (key, value) => {
10
+ storage[key] = value || '';
11
+ },
12
+ getItem: key => storage[key] || null,
13
+ removeItem: (key) => {
14
+ delete storage[key];
15
+ },
16
+ get length() {
17
+ return Object.keys(storage).length;
18
+ },
19
+ key: (i) => {
20
+ const keys = Object.keys(storage);
21
+ return keys[i] || null;
22
+ },
23
+ };
24
+ };
25
+
26
+ export default storageMock;
27
+
28
+ export const permissionAttrMockAuthorized = onDenied => ({
29
+ module: 'SG_CADASTROS',
30
+ feature: 'SG_CADASTROS_EMPRESAS',
31
+ operation: 'SG_CADASTROS_EMPRESAS_GRAVAR',
32
+ onDenied,
33
+ });
34
+
35
+ export const permissionAttrMockUnauthorized = onDenied => ({
36
+ module: 'SG_COMPRAS_CADASTROS',
37
+ feature: 'SG_COMPRAS_CADASTROS_MOTIVO_BAIXAS_PEDIDOS_COMPRAS',
38
+ operation: 'SG_COMPRAS_CADASTROS_MOTIVO_BAIXAS_PEDIDOS_COMPRAS_INCLUIR',
39
+ onDenied,
40
+ });
@@ -0,0 +1,140 @@
1
+ /* eslint-disable import/no-dynamic-require */
2
+
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+
6
+ // Make sure any symlinks in the project folder are resolved:
7
+ // https://github.com/facebook/create-react-app/issues/637
8
+ const appDirectory = fs.realpathSync(process.cwd());
9
+ const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
10
+
11
+ // We use `PUBLIC_URL` environment variable or "homepage" field to infer
12
+ // "public path" at which the app is served.
13
+ // webpack needs to know it to put the right <script> hrefs into HTML even in
14
+ // single-page apps that may serve index.html for nested URLs like /todos/42.
15
+ // We can't use a relative path in HTML because we don't want to load something
16
+ // like /todos/42/static/js/bundle.7289d.js. We have to know the root.
17
+ const publicUrlOrPath = '/';
18
+
19
+ const buildPath = process.env.BUILD_PATH || 'build';
20
+
21
+ const moduleFileExtensions = [
22
+ 'web.mjs',
23
+ 'mjs',
24
+ 'web.js',
25
+ 'js',
26
+ 'web.ts',
27
+ 'ts',
28
+ 'web.tsx',
29
+ 'tsx',
30
+ 'json',
31
+ 'web.jsx',
32
+ 'jsx',
33
+ ];
34
+
35
+ // Resolve file paths in the same order as webpack
36
+ const resolveModule = (resolveFn, filePath) => {
37
+ const extension = moduleFileExtensions.find(ext =>
38
+ fs.existsSync(resolveFn(`${filePath}.${ext}`)));
39
+
40
+ if (extension) {
41
+ return resolveFn(`${filePath}.${extension}`);
42
+ }
43
+
44
+ return resolveFn(`${filePath}.js`);
45
+ };
46
+
47
+ // config after eject: we're in ./config/
48
+ module.exports = {
49
+ dotenv: resolveApp('.env'),
50
+ appPath: resolveApp('.'),
51
+ appBuild: resolveApp(buildPath),
52
+ appPublic: resolveApp('src/demo'),
53
+ appHtml: resolveApp('src/demo/index.html'),
54
+ appIndexJs: resolveModule(resolveApp, 'src/demo/index'),
55
+ appPackageJson: resolveApp('package.json'),
56
+ appSrc: resolveApp('src'),
57
+ appTsConfig: resolveApp('tsconfig.json'),
58
+ appJsConfig: resolveApp('jsconfig.json'),
59
+ yarnLockFile: resolveApp('yarn.lock'),
60
+ testsSetup: resolveModule(resolveApp, 'src/setupTests'),
61
+ proxySetup: resolveApp('src/setupProxy.js'),
62
+ appNodeModules: resolveApp('node_modules'),
63
+ appWebpackCache: resolveApp('node_modules/.cache'),
64
+ appTsBuildInfoFile: resolveApp('node_modules/.cache/tsconfig.tsbuildinfo'),
65
+ swSrc: resolveModule(resolveApp, 'src/service-worker'),
66
+ publicUrlOrPath,
67
+ };
68
+
69
+ // @remove-on-eject-begin
70
+ const resolveOwn = relativePath => path.resolve(__dirname, '..', relativePath);
71
+
72
+ // config before eject: we're in ./node_modules/react-scripts/config/
73
+ module.exports = {
74
+ dotenv: resolveApp('.env'),
75
+ appPath: resolveApp('.'),
76
+ appBuild: resolveApp(buildPath),
77
+ appPublic: resolveApp('src/demo'),
78
+ appHtml: resolveApp('src/demo/index.html'),
79
+ appIndexJs: resolveModule(resolveApp, 'src/demo/index'),
80
+ appPackageJson: resolveApp('package.json'),
81
+ appSrc: resolveApp('src'),
82
+ appTsConfig: resolveApp('tsconfig.json'),
83
+ appJsConfig: resolveApp('jsconfig.json'),
84
+ yarnLockFile: resolveApp('yarn.lock'),
85
+ testsSetup: resolveModule(resolveApp, 'src/setupTests'),
86
+ proxySetup: resolveApp('src/setupProxy.js'),
87
+ appNodeModules: resolveApp('node_modules'),
88
+ appWebpackCache: resolveApp('node_modules/.cache'),
89
+ appTsBuildInfoFile: resolveApp('node_modules/.cache/tsconfig.tsbuildinfo'),
90
+ swSrc: resolveModule(resolveApp, 'src/service-worker'),
91
+ publicUrlOrPath,
92
+ // These properties only exist before ejecting:
93
+ ownPath: resolveOwn('.'),
94
+ ownNodeModules: resolveOwn('node_modules'), // This is empty on npm 3
95
+ appTypeDeclarations: resolveApp('src/react-app-env.d.ts'),
96
+ ownTypeDeclarations: resolveOwn('lib/react-app.d.ts'),
97
+ };
98
+
99
+ const ownPackageJson = require('../package.json');
100
+
101
+ const reactScriptsPath = resolveApp(`node_modules/${ownPackageJson.name}`);
102
+ const reactScriptsLinked =
103
+ fs.existsSync(reactScriptsPath) &&
104
+ fs.lstatSync(reactScriptsPath).isSymbolicLink();
105
+
106
+ // config before publish: we're in ./packages/react-scripts/config/
107
+ if (
108
+ !reactScriptsLinked &&
109
+ __dirname.indexOf(path.join('packages', 'react-scripts', 'config')) !== -1
110
+ ) {
111
+ const templatePath = '../cra-template/template';
112
+ module.exports = {
113
+ dotenv: resolveOwn(`${templatePath}/.env`),
114
+ appPath: resolveApp('.'),
115
+ appBuild: resolveOwn(path.join('../..', buildPath)),
116
+ appPublic: resolveOwn(`${templatePath}/public`),
117
+ appHtml: resolveOwn(`${templatePath}/public/index.html`),
118
+ appIndexJs: resolveModule(resolveOwn, `${templatePath}/src/index`),
119
+ appPackageJson: resolveOwn('package.json'),
120
+ appSrc: resolveOwn(`${templatePath}/src`),
121
+ appTsConfig: resolveOwn(`${templatePath}/tsconfig.json`),
122
+ appJsConfig: resolveOwn(`${templatePath}/jsconfig.json`),
123
+ yarnLockFile: resolveOwn(`${templatePath}/yarn.lock`),
124
+ testsSetup: resolveModule(resolveOwn, `${templatePath}/src/setupTests`),
125
+ proxySetup: resolveOwn(`${templatePath}/src/setupProxy.js`),
126
+ appNodeModules: resolveOwn('node_modules'),
127
+ appWebpackCache: resolveOwn('node_modules/.cache'),
128
+ appTsBuildInfoFile: resolveOwn('node_modules/.cache/tsconfig.tsbuildinfo'),
129
+ swSrc: resolveModule(resolveOwn, `${templatePath}/src/service-worker`),
130
+ publicUrlOrPath,
131
+ // These properties only exist before ejecting:
132
+ ownPath: resolveOwn('.'),
133
+ ownNodeModules: resolveOwn('node_modules'),
134
+ appTypeDeclarations: resolveOwn(`${templatePath}/src/react-app-env.d.ts`),
135
+ ownTypeDeclarations: resolveOwn('lib/react-app.d.ts'),
136
+ };
137
+ }
138
+ // @remove-on-eject-end
139
+
140
+ module.exports.moduleFileExtensions = moduleFileExtensions;
@@ -0,0 +1,128 @@
1
+ /* eslint-disable global-require */
2
+ /* eslint-disable import/no-dynamic-require */
3
+
4
+ const fs = require('fs');
5
+ const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
6
+ const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
7
+ const ignoredFiles = require('react-dev-utils/ignoredFiles');
8
+ const redirectServedPath = require('react-dev-utils/redirectServedPathMiddleware');
9
+ const paths = require('./paths');
10
+ const getHttpsConfig = require('./getHttpsConfig');
11
+
12
+ const host = process.env.HOST || '0.0.0.0';
13
+ const sockHost = process.env.WDS_SOCKET_HOST;
14
+ const sockPath = process.env.WDS_SOCKET_PATH; // default: '/ws'
15
+ const sockPort = process.env.WDS_SOCKET_PORT;
16
+
17
+ module.exports = function (proxy, allowedHost) {
18
+ const disableFirewall =
19
+ !proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true';
20
+ return {
21
+ // WebpackDevServer 2.4.3 introduced a security fix that prevents remote
22
+ // websites from potentially accessing local content through DNS rebinding:
23
+ // https://github.com/webpack/webpack-dev-server/issues/887
24
+ // https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a
25
+ // However, it made several existing use cases such as development in cloud
26
+ // environment or subdomains in development significantly more complicated:
27
+ // https://github.com/facebook/create-react-app/issues/2271
28
+ // https://github.com/facebook/create-react-app/issues/2233
29
+ // While we're investigating better solutions, for now we will take a
30
+ // compromise. Since our WDS configuration only serves files in the `public`
31
+ // folder we won't consider accessing them a vulnerability. However, if you
32
+ // use the `proxy` feature, it gets more dangerous because it can expose
33
+ // remote code execution vulnerabilities in backends like Django and Rails.
34
+ // So we will disable the host check normally, but enable it if you have
35
+ // specified the `proxy` setting. Finally, we let you override it if you
36
+ // really know what you're doing with a special environment variable.
37
+ // Note: ["localhost", ".localhost"] will support subdomains - but we might
38
+ // want to allow setting the allowedHosts manually for more complex setups
39
+ allowedHosts: disableFirewall ? 'all' : [allowedHost],
40
+ headers: {
41
+ 'Access-Control-Allow-Origin': '*',
42
+ 'Access-Control-Allow-Methods': '*',
43
+ 'Access-Control-Allow-Headers': '*',
44
+ },
45
+ // Enable gzip compression of generated files.
46
+ compress: true,
47
+ static: {
48
+ // By default WebpackDevServer serves physical files from current directory
49
+ // in addition to all the virtual build products that it serves from memory.
50
+ // This is confusing because those files won’t automatically be available in
51
+ // production build folder unless we copy them. However, copying the whole
52
+ // project directory is dangerous because we may expose sensitive files.
53
+ // Instead, we establish a convention that only files in `public` directory
54
+ // get served. Our build script will copy `public` into the `build` folder.
55
+ // In `index.html`, you can get URL of `public` folder with %PUBLIC_URL%:
56
+ // <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
57
+ // In JavaScript code, you can access it with `process.env.PUBLIC_URL`.
58
+ // Note that we only recommend to use `public` folder as an escape hatch
59
+ // for files like `favicon.ico`, `manifest.json`, and libraries that are
60
+ // for some reason broken when imported through webpack. If you just want to
61
+ // use an image, put it in `src` and `import` it from JavaScript instead.
62
+ directory: paths.appPublic,
63
+ publicPath: [paths.publicUrlOrPath],
64
+ // By default files from `contentBase` will not trigger a page reload.
65
+ watch: {
66
+ // Reportedly, this avoids CPU overload on some systems.
67
+ // https://github.com/facebook/create-react-app/issues/293
68
+ // src/node_modules is not ignored to support absolute imports
69
+ // https://github.com/facebook/create-react-app/issues/1065
70
+ ignored: ignoredFiles(paths.appSrc),
71
+ },
72
+ },
73
+ client: {
74
+ webSocketURL: {
75
+ // Enable custom sockjs pathname for websocket connection to hot reloading server.
76
+ // Enable custom sockjs hostname, pathname and port for websocket connection
77
+ // to hot reloading server.
78
+ hostname: sockHost,
79
+ pathname: sockPath,
80
+ port: sockPort,
81
+ },
82
+ overlay: {
83
+ errors: true,
84
+ warnings: false,
85
+ },
86
+ },
87
+ devMiddleware: {
88
+ // It is important to tell WebpackDevServer to use the same "publicPath" path as
89
+ // we specified in the webpack config. When homepage is '.', default to serving
90
+ // from the root.
91
+ // remove last slash so user can land on `/test` instead of `/test/`
92
+ publicPath: paths.publicUrlOrPath.slice(0, -1),
93
+ },
94
+
95
+ https: getHttpsConfig(),
96
+ host,
97
+ historyApiFallback: {
98
+ // Paths with dots should still use the history fallback.
99
+ // See https://github.com/facebook/create-react-app/issues/387.
100
+ disableDotRule: true,
101
+ index: paths.publicUrlOrPath,
102
+ },
103
+ // `proxy` is run between `before` and `after` `webpack-dev-server` hooks
104
+ proxy,
105
+ onBeforeSetupMiddleware(devServer) {
106
+ // Keep `evalSourceMapMiddleware`
107
+ // middlewares before `redirectServedPath` otherwise will not have any effect
108
+ // This lets us fetch source contents from webpack for the error overlay
109
+ devServer.app.use(evalSourceMapMiddleware(devServer));
110
+
111
+ if (fs.existsSync(paths.proxySetup)) {
112
+ // This registers user provided middleware for proxy reasons
113
+ require(paths.proxySetup)(devServer.app);
114
+ }
115
+ },
116
+ onAfterSetupMiddleware(devServer) {
117
+ // Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match
118
+ devServer.app.use(redirectServedPath(paths.publicUrlOrPath));
119
+
120
+ // This service worker file is effectively a 'no-op' that will reset any
121
+ // previous service worker registered for the same host:port combination.
122
+ // We do this in development to avoid hitting the production cache if
123
+ // it used the same host and port.
124
+ // https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
125
+ devServer.app.use(noopServiceWorkerMiddleware(paths.publicUrlOrPath));
126
+ },
127
+ };
128
+ };
package/jest.config.js ADDED
@@ -0,0 +1,18 @@
1
+ module.exports = {
2
+ roots: ['<rootDir>'],
3
+ transform: {
4
+ '\\.(js|jsx|tsx|ts)?$': 'babel-jest',
5
+ },
6
+ testMatch: [
7
+ '<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx,mjs}',
8
+ ],
9
+ moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'node'],
10
+ testPathIgnorePatterns: ['/node_modules/', '/public/'],
11
+ setupFilesAfterEnv: [
12
+ '@testing-library/jest-dom/extend-expect',
13
+ ],
14
+ moduleNameMapper: {
15
+ '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/config/jest/fileTransform.js',
16
+ '.+\\.(css|scss)$': 'identity-obj-proxy',
17
+ },
18
+ };
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
8
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
10
10
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
11
11
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
12
  class AlertContainer {
@@ -10,13 +10,13 @@ var _BaseAlert = _interopRequireDefault(require("./BaseAlert"));
10
10
  var _AlertContainer = _interopRequireDefault(require("./AlertContainer"));
11
11
  var _Message = _interopRequireDefault(require("./Message"));
12
12
  var _helpers = _interopRequireDefault(require("./helpers"));
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
15
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
17
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
20
20
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
21
21
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
22
22
  const AlertProvider = props => {
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  var _react = require("react");
8
8
  var _reactDom = _interopRequireDefault(require("react-dom"));
9
9
  require("../assets/styles/alerts.scss");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const body = document.getElementsByTagName('body')[0];
12
12
  const alert = document.getElementById('alert');
13
13
  const BaseAlert = _ref => {