@dakataa/crud-react 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/.env +3 -0
  2. package/README.md +58 -0
  3. package/babel-plugin-macros.config.js +5 -0
  4. package/index.html +12 -0
  5. package/package.json +74 -0
  6. package/public/favicon.ico +0 -0
  7. package/public/logo192.png +0 -0
  8. package/public/logo512.png +0 -0
  9. package/public/manifest.json +25 -0
  10. package/public/robots.txt +3 -0
  11. package/src/Crud.tsx +29 -0
  12. package/src/CrudContext.tsx +21 -0
  13. package/src/CrudLoader.tsx +27 -0
  14. package/src/assets/images/alert/denied.json +1 -0
  15. package/src/assets/images/alert/info.json +1 -0
  16. package/src/assets/images/alert/success.json +1 -0
  17. package/src/assets/images/alert/warning.json +1 -0
  18. package/src/assets/style/alert.scss +97 -0
  19. package/src/component/Animation.tsx +50 -0
  20. package/src/component/BaseButton.tsx +26 -0
  21. package/src/component/Button.tsx +15 -0
  22. package/src/component/Dropdown.tsx +55 -0
  23. package/src/component/EmptyView.tsx +5 -0
  24. package/src/component/Link.tsx +11 -0
  25. package/src/component/Modal.tsx +174 -0
  26. package/src/component/ModifyForm.tsx +139 -0
  27. package/src/component/TemplateBlock.tsx +21 -0
  28. package/src/component/TemplateExtend.tsx +17 -0
  29. package/src/component/TemplateParentBlock.tsx +7 -0
  30. package/src/component/Translation.tsx +7 -0
  31. package/src/component/ViewLoader.tsx +33 -0
  32. package/src/component/crud/DynamicView.tsx +42 -0
  33. package/src/component/crud/FormView.tsx +29 -0
  34. package/src/component/crud/GridTableView.tsx +205 -0
  35. package/src/component/crud/PaginatorView.tsx +80 -0
  36. package/src/component/error/ErrorBoundary.tsx +78 -0
  37. package/src/component/error/Exception.tsx +17 -0
  38. package/src/component/error/HttpException.tsx +24 -0
  39. package/src/component/form/Choice.tsx +119 -0
  40. package/src/component/form/Form.tsx +233 -0
  41. package/src/component/form/FormAlert.tsx +19 -0
  42. package/src/component/form/FormFieldError.tsx +16 -0
  43. package/src/component/form/FormGroup.tsx +53 -0
  44. package/src/component/form/FormWidget.tsx +34 -0
  45. package/src/component/form/Input.tsx +63 -0
  46. package/src/component/form/constraint/Contraint.tsx +8 -0
  47. package/src/component/form/constraint/NotBlank.tsx +20 -0
  48. package/src/component/hooks/GetData.tsx +137 -0
  49. package/src/context/ActionContext.tsx +99 -0
  50. package/src/context/AlertContext.tsx +181 -0
  51. package/src/context/ModalContext.tsx +56 -0
  52. package/src/context/SessionContext.tsx +97 -0
  53. package/src/helper/ObjectUtils.tsx +36 -0
  54. package/src/helper/RouterUtils.tsx +24 -0
  55. package/src/helper/StingUtils.tsx +25 -0
  56. package/src/index.tsx +23 -0
  57. package/src/layout/default/Base.tsx +15 -0
  58. package/src/layout/default/Error.tsx +27 -0
  59. package/src/layout/default/Main.tsx +64 -0
  60. package/src/layout/default/component/Navigation.tsx +197 -0
  61. package/src/page/List.tsx +268 -0
  62. package/src/page/Modify.tsx +156 -0
  63. package/src/react-app-env.d.ts +2 -0
  64. package/src/setupTests.ts +5 -0
  65. package/src/type/ActionType.tsx +10 -0
  66. package/src/type/ColumnType.tsx +18 -0
  67. package/src/type/ExceptionType.tsx +7 -0
  68. package/src/type/FormType.tsx +6 -0
  69. package/src/type/FormViewType.tsx +37 -0
  70. package/src/type/ListMetaType.tsx +7 -0
  71. package/src/type/ListType.tsx +20 -0
  72. package/src/type/ModifyType.tsx +10 -0
  73. package/src/type/RedirectType.tsx +6 -0
  74. package/src/type/RouteType.tsx +5 -0
  75. package/tsconfig.app.json +46 -0
  76. package/tsconfig.json +11 -0
  77. package/tsconfig.node.json +15 -0
  78. package/vite.config.ts +33 -0
package/.env ADDED
@@ -0,0 +1,3 @@
1
+ CRUD_LOCALE=en
2
+ CRUD_API_BASE_URL=
3
+ CRUD_ASSET_BASE_URL=
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # CRUD Dashboard React (Frontend)
2
+
3
+ ## Setup
4
+
5
+ ### Install packages
6
+ ```
7
+ yarn install dakataa/crud-react
8
+ ```
9
+
10
+ ### Configure ENV Variables
11
+ Copy `.env` to `.env.local` and set variables
12
+
13
+ ```
14
+ CRUD_API_BASE_URL=https://example.com/dakataa/crud
15
+ ```
16
+
17
+ ## Overview
18
+
19
+ ### Legend
20
+ * Action
21
+ * **Entity** - Model Name (Article)
22
+ * **Namespace**
23
+ * **Route** - API Endpoint information.
24
+
25
+ ## Routing
26
+
27
+ ## Hooks
28
+ ### Data Provider
29
+
30
+ `GetData` is a Hook that allows you to fetch data based on CRUD action (see section [Actions](#legend)).
31
+
32
+ ```js
33
+ const {
34
+ results,
35
+ setParameters,
36
+ setQueryParameters,
37
+ refresh
38
+ } = GetData({entityAction: action});
39
+ ```
40
+
41
+ ### Actions
42
+
43
+ CRUD Actions is a collection of entity routes
44
+
45
+ `UseActions` is Hook that allows you to get all available [CRUD Actions].
46
+ ```js
47
+ const {actions, getAction, getActionByPath} = UseActions();
48
+ ```
49
+
50
+
51
+ ## Components
52
+ ### Dynamic View
53
+
54
+ ### Templates
55
+ ### Modal
56
+ ### Dropdown
57
+ ### Translation
58
+ ### Types
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ 'fontawesome-svg-core': {
3
+ 'license': 'free'
4
+ }
5
+ }
package/index.html ADDED
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>CRUD</title>
7
+ </head>
8
+ <body id="root">
9
+
10
+ <script type="module" src="/src/index.tsx"></script>
11
+ </body>
12
+ </html>
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@dakataa/crud-react",
3
+ "version": "1.0.0",
4
+ "description": "Dakataa CRUD React",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/dakataa/crud-react.git"
8
+ },
9
+ "keywords": [
10
+ "CRUD",
11
+ "React",
12
+ "Frontend",
13
+ "Dashboard"
14
+ ],
15
+ "author": "Yordan Lazarov",
16
+ "license": "MIT",
17
+ "bugs": {
18
+ "url": "https://github.com/dakataa/crud-react/issues"
19
+ },
20
+ "homepage": "https://github.com/dakataa/crud-react#readme",
21
+ "dependencies": {
22
+ "@dakataa/crud-theme": "^1.0.1",
23
+ "@dakataa/requester": "^1.0.3",
24
+ "@fortawesome/fontawesome-common-types": "^6.7.2",
25
+ "@popperjs/core": "^2.11.8",
26
+ "@testing-library/jest-dom": "^6.6.3",
27
+ "@testing-library/react": "^16.1.0",
28
+ "@testing-library/user-event": "^14.5.2",
29
+ "lottie-web": "^5.12.2",
30
+ "path": "^0.12.7",
31
+ "react": "^19.0.0",
32
+ "react-dom": "^19.0.0",
33
+ "react-router-dom": "^7.2.0"
34
+ },
35
+ "scripts": {
36
+ "start": "vite",
37
+ "build": "tsc -b && vite build",
38
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
39
+ "preview": "vite preview",
40
+ "analyze": "source-map-explorer 'build/static/js/*.js'"
41
+ },
42
+ "eslintConfig": {
43
+ "extends": [
44
+ "react-app",
45
+ "react-app/jest"
46
+ ]
47
+ },
48
+ "browserslist": {
49
+ "production": [
50
+ ">0.2%",
51
+ "not dead",
52
+ "not op_mini all"
53
+ ],
54
+ "development": [
55
+ "last 1 chrome version",
56
+ "last 1 firefox version",
57
+ "last 1 safari version"
58
+ ]
59
+ },
60
+ "devDependencies": {
61
+ "@types/jest": "^29.5.14",
62
+ "@types/node": "^22.10.1",
63
+ "@types/react": "^19.0.10",
64
+ "@types/react-dom": "^19.0.4",
65
+ "@vitejs/plugin-react": "^4.3.4",
66
+ "babel-plugin-transform-imports": "^2.0.0",
67
+ "dotenv": "^16.4.5",
68
+ "sass": "^1.81.0",
69
+ "source-map-explorer": "^2.5.3",
70
+ "typescript": "^5.7.2",
71
+ "vite": "^6.0.1",
72
+ "vite-tsconfig-paths": "^5.1.3"
73
+ }
74
+ }
Binary file
Binary file
Binary file
@@ -0,0 +1,25 @@
1
+ {
2
+ "short_name": "React App",
3
+ "name": "Create React App Sample",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
package/src/Crud.tsx ADDED
@@ -0,0 +1,29 @@
1
+ import React, {Suspense} from 'react';
2
+ import Requester from '@dakataa/requester';
3
+ import ErrorBoundary from "@src/component/error/ErrorBoundary.tsx";
4
+ import Error from "@src/layout/default/Error.tsx";
5
+ import CrudLoader from "@src/CrudLoader.tsx";
6
+ import CrudContext from "@src/CrudContext.tsx";
7
+
8
+ Requester.defaults = {
9
+ baseURL: import.meta.env.CRUD_API_BASE_URL,
10
+ headers: {
11
+ Accept: 'application/json'
12
+ }
13
+ };
14
+
15
+
16
+ const Crud = () => {
17
+
18
+ return (
19
+ <CrudContext>
20
+ <ErrorBoundary fallback={<Error/>}>
21
+ <Suspense fallback={<>Loading</>}>
22
+ <CrudLoader/>
23
+ </Suspense>
24
+ </ErrorBoundary>
25
+ </CrudContext>
26
+ );
27
+ }
28
+
29
+ export default Crud;
@@ -0,0 +1,21 @@
1
+ import React, {ReactNode} from "react";
2
+ import {ModalProvider} from "@src/context/ModalContext.tsx";
3
+ import {AlertProvider} from "@src/context/AlertContext.tsx";
4
+ import {ActionProvider} from "@src/context/ActionContext.tsx";
5
+ import {SessionProvider} from "@src/context/SessionContext.tsx";
6
+
7
+ const CrudContext = ({children}: { children: ReactNode }) => {
8
+ return (
9
+ <ModalProvider>
10
+ <AlertProvider>
11
+ <ActionProvider>
12
+ <SessionProvider>
13
+ {children}
14
+ </SessionProvider>
15
+ </ActionProvider>
16
+ </AlertProvider>
17
+ </ModalProvider>
18
+ )
19
+ }
20
+
21
+ export default CrudContext;
@@ -0,0 +1,27 @@
1
+ import ViewLoader from "@src/component/ViewLoader.tsx";
2
+ import React, {use} from "react";
3
+ import {UseActions} from "@src/context/ActionContext.tsx";
4
+ import HttpException from "@src/component/error/HttpException.tsx";
5
+ import {UseCurrentReactRoute} from "@src/helper/RouterUtils.tsx";
6
+
7
+ const CrudLoader = ({path}: { path?: string }) => {
8
+ const currentRoute = UseCurrentReactRoute();
9
+
10
+ path ??= document.location.pathname.replace(new RegExp('^' + currentRoute?.pathnameBase + '(/)?'), '/');
11
+
12
+ const {getOnClickActionByPath} = UseActions();
13
+ const onClickAction = use(getOnClickActionByPath(path));
14
+ if (!onClickAction) {
15
+ throw new HttpException(404, 'Missing Route');
16
+ }
17
+
18
+ return (
19
+ <ViewLoader
20
+ view={onClickAction.action.name}
21
+ namespace={onClickAction.action.namespace || ''}
22
+ props={{action: onClickAction}}
23
+ />
24
+ );
25
+ }
26
+
27
+ export default CrudLoader;
@@ -0,0 +1 @@
1
+ {"v":"5.9.2","fr":25,"ip":0,"op":52,"w":800,"h":800,"nm":"Precomp. 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Capa de formas 11","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":90,"ix":10},"p":{"a":0,"k":[394.648,397.167,0],"ix":2,"l":2},"a":{"a":0,"k":[-9,17,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-170,-144],[152,178]],"c":false},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"t":17,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0.925490196078,0.219607843137,0.192156862745,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":70,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.176470588235,0.16862745098,0.2,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[68.518,68.518],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Forma 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":2,"op":52,"st":-502,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Capa de formas 10","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[397.401,404.91,0],"ix":2,"l":2},"a":{"a":0,"k":[-9,17,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-170,-144],[152,178]],"c":false},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":8,"s":[0]},{"t":15,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0.925490196078,0.219607843137,0.192156862745,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":70,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.176470588235,0.16862745098,0.2,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[71.117,71.117],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Forma 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":52,"st":-504,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Capa 1 contornos 19","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":1,"s":[-90]},{"t":51,"s":[270]}],"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2,"l":2},"a":{"a":0,"k":[586.5,586.5,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-185.844],[185.844,0],[0,185.844],[-185.844,0]],"o":[[0,185.844],[-185.844,0],[0,-185.844],[185.844,0]],"v":[[336.5,0],[0,336.5],[-336.5,0],[0,-336.5]],"c":true},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":1,"s":[0.176470592618,0.168627455831,0.20000000298,1]},{"t":13,"s":[0.92549020052,0.219607844949,0.192156866193,1]}],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":2,"lj":1,"ml":10,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[586.5,586.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Grupo 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":1,"s":[0]},{"t":18,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":1,"op":52,"st":1,"bm":0}],"markers":[{"tm":-278,"cm":"1","dr":0},{"tm":-229,"cm":"2","dr":0}]}
@@ -0,0 +1 @@
1
+ {"v":"5.9.2","fr":25,"ip":0,"op":51,"w":800,"h":800,"nm":"Azul","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Capa de formas 14","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[401.405,551.405,0],"ix":2,"l":2},"a":{"a":0,"k":[-10.595,165.405,0],"ix":1,"l":2},"s":{"a":0,"k":[216.866,216.866,100],"ix":6,"l":2,"x":"var $bm_rt;\nvar result;\nresult = getAnimationComposerPresetValue();\nfunction getAnimationComposerPresetValue() {\n var bL = thisLayer;\n var tTrI = null;\n var tTrO = null;\n if (bL.marker.numKeys > 0) {\n var acmp = 'zzzzzzzzzzzzzzz_AC';\n for (var i = 1; i <= bL.marker.numKeys; i++) {\n var m = bL.marker.key(i);\n var p = m.parameters;\n if (p.hasOwnProperty(acmp + 'MarkerEnabled') && p.hasOwnProperty(acmp + 'MarkerType') && p.hasOwnProperty(acmp + 'MarkerAppPresetType')) {\n if (p[acmp + 'MarkerEnabled'] != '1') {\n continue;\n }\n switch (p[acmp + 'MarkerAppPresetType']) {\n case '1': {\n tTrI = m.time;\n break;\n }\n }\n }\n }\n }\n function acPD(fxN) {\n try {\n if (bL.effect(fxN).active === false) {\n ac.en = false;\n }\n } catch (e) {\n }\n }\n function acSliderValP(fxN, stN, dV) {\n try {\n return bL.effect(fxN)(stN);\n } catch (e) {\n return dV;\n }\n }\n function acValMul(val) {\n acAccM *= val;\n }\n function mhOvershoot(t, a, f, d) {\n if (d <= 0) {\n d = 0;\n }\n var y = $bm_div($bm_mul(a, Math.cos($bm_mul($bm_mul($bm_mul(t, f), Math.PI), 2))), Math.exp($bm_mul(t, d)));\n if (t < 0.8) {\n return y;\n }\n return $bm_mul(y, $bm_sub(1, $bm_div($bm_sub(t, 0.8), 0.2)));\n }\n function upACo(tIn, dIn, tOut, dOut, eFi, eFo) {\n if (dIn < 0) {\n dIn = 0;\n }\n if (dOut < 0) {\n dOut = 0;\n }\n ac.fade = 1;\n if (t < tOut) {\n if (t < $bm_sum(tIn, dIn)) {\n if (dIn == 0) {\n ac.fade = 0;\n } else {\n ac.fade = $bm_div($bm_sub(t, tIn), dIn);\n if (ac.fade < 0) {\n ac.fade = 0;\n }\n if (ac.fade > 1) {\n ac.fade = 1;\n }\n if (eFi) {\n ac.fade = eFi(ac.fade);\n }\n }\n }\n } else {\n if (dOut == 0) {\n ac.fade = 0;\n } else {\n ac.fade = $bm_div($bm_sub(t, tOut), dOut);\n if (ac.fade < 0) {\n ac.fade = 0;\n }\n if (ac.fade > 1) {\n ac.fade = 1;\n }\n if (eFo) {\n ac.fade = eFo(ac.fade);\n }\n ac.fade = $bm_sub(1, ac.fade);\n }\n }\n ac.intensity = 1;\n ac.en = true;\n ac.t = $bm_sub(t, tIn);\n }\n var ac = {};\n ac.en = false;\n var v = thisProperty.value;\n var t = time;\n var acAccM = 1;\n ac.en = false;\n if (tTrI !== null && t < tTrI) {\n upACo(bL.inPoint, $bm_sub(tTrI, bL.inPoint), bL.outPoint, 0);\n ac.fade = $bm_sub(1, ac.fade);\n }\n acPD('AC IN [YRH] Controls');\n if (ac.en) {\n acValMul($bm_sub(1, $bm_mul(mhOvershoot($bm_sub(1, ac.fade), 1, acSliderValP('AC IN [YRH] Controls', 'Number of bounces', 2), 7), $bm_sum($bm_div(acSliderValP('AC IN [YRH] Controls', 'Scale', 0), -100), 1))));\n }\n v = thisProperty.value;\n v *= acAccM;\n return v;\n}\n$bm_rt = result;"}},"ao":0,"ef":[{"ty":5,"nm":"AC IN [YRH] Controls","np":4,"mn":"Pseudo/MHAC PrCtrl YRH 4","ix":1,"en":1,"ef":[{"ty":0,"nm":"Number of bounces","mn":"Pseudo/MHAC PrCtrl YRH 4-0001","ix":1,"v":{"a":0,"k":2,"ix":1}},{"ty":0,"nm":"Scale","mn":"Pseudo/MHAC PrCtrl YRH 4-0002","ix":2,"v":{"a":0,"k":0,"ix":2}}]}],"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[30.81,30.81],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.180392156863,0.545098039216,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-10.595,165.405],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":16,"op":51,"st":-757,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Capa de formas 13","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[396.219,320,0],"ix":2,"l":2},"a":{"a":0,"k":[-12,-56,0],"ix":1,"l":2},"s":{"a":0,"k":[100,81.25,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-12,-216],[-12,104]],"c":false},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.180392156863,0.545098039216,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":74,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[68.49,76.853],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Forma 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"t":16,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":51,"st":-777,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Capa 1 contornos 16","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[-90]},{"t":50,"s":[270]}],"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2,"l":2},"a":{"a":0,"k":[586.5,586.5,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-185.844],[185.844,0],[0,185.844],[-185.844,0]],"o":[[0,185.844],[-185.844,0],[0,-185.844],[185.844,0]],"v":[[336.5,0],[0,336.5],[-336.5,0],[0,-336.5]],"c":true},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0.176470592618,0.168627455831,0.20000000298,1]},{"t":12,"s":[0.180392161012,0.54509806633,1,1]}],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":2,"lj":1,"ml":10,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[586.5,586.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Grupo 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":17,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":51,"st":0,"bm":0}],"markers":[{"tm":-356,"cm":"1","dr":0},{"tm":-307,"cm":"2","dr":0}]}
@@ -0,0 +1 @@
1
+ {"v":"5.9.2","fr":25,"ip":0,"op":51,"w":800,"h":800,"nm":"Chulito","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Capa de formas 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[410,436,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[79.552,79.552,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-204,-20],[-79.486,91.943],[182.972,-155.43]],"c":false},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,0.686274509804,0.274509803922,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":64,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Forma 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":8,"s":[0]},{"t":18,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":51,"st":-486,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Capa 1 contornos 9","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[-90]},{"t":50,"s":[270]}],"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2,"l":2},"a":{"a":0,"k":[586.5,586.5,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-185.844],[185.844,0],[0,185.844],[-185.844,0]],"o":[[0,185.844],[-185.844,0],[0,-185.844],[185.844,0]],"v":[[336.5,0],[0,336.5],[-336.5,0],[0,-336.5]],"c":true},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0.176470592618,0.168627455831,0.20000000298,1]},{"t":12,"s":[0,0.686274509804,0.274509803922,1]}],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":2,"lj":1,"ml":10,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[586.5,586.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Grupo 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":17,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"gr","it":[{"ty":"st","c":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":21,"s":[0.176470588235,0.16862745098,0.2,1]},{"t":34,"s":[0,0.686274528503,0.274509817362,1]}],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Grupo 2","np":1,"cix":2,"bm":0,"ix":3,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":51,"st":0,"bm":0}],"markers":[{"tm":-147,"cm":"1","dr":0},{"tm":-98,"cm":"2","dr":0}]}
@@ -0,0 +1 @@
1
+ {"v":"5.9.2","fr":25,"ip":0,"op":51,"w":800,"h":800,"nm":"Azul","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Capa de formas 14","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[401.405,551.405,0],"ix":2,"l":2},"a":{"a":0,"k":[-10.595,165.405,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":16,"s":[0,0,100]},{"t":20,"s":[216.866,216.866,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[30.81,30.81],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.517647058824,0.074509803922,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-10.595,165.405],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":16,"op":51,"st":-757,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Capa de formas 13","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[396.219,320,0],"ix":2,"l":2},"a":{"a":0,"k":[-12,-56,0],"ix":1,"l":2},"s":{"a":0,"k":[100,81.25,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-12,-216],[-12,104]],"c":false},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0.517647058824,0.074509803922,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":74,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[68.49,76.853],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Forma 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"t":16,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":51,"st":-777,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Capa 1 contornos 16","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[-90]},{"t":50,"s":[270]}],"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2,"l":2},"a":{"a":0,"k":[586.5,586.5,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-185.844],[185.844,0],[0,185.844],[-185.844,0]],"o":[[0,185.844],[-185.844,0],[0,-185.844],[185.844,0]],"v":[[336.5,0],[0,336.5],[-336.5,0],[0,-336.5]],"c":true},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0.176470592618,0.168627455831,0.20000000298,1]},{"t":12,"s":[1,0.517647087574,0.074509806931,1]}],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":2,"lj":1,"ml":10,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[586.5,586.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Grupo 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":17,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":51,"st":0,"bm":0}],"markers":[{"tm":-356,"cm":"1","dr":0},{"tm":-307,"cm":"2","dr":0}]}
@@ -0,0 +1,97 @@
1
+ .modal-alert {
2
+ --animation-transform: null;
3
+ --animation-transition: null;
4
+ --animation-keyframes: animation-open-default;
5
+ --animation-keyframes-duration: .3s;
6
+ --animation-timeout-progress: 1s;
7
+ --modal-alert-vertical-gutter: 1.5rem;
8
+ --modal-alert-icon-size: 92px;
9
+
10
+ transition: var(--animation-transition);
11
+ transform: var(--animation-transform);
12
+
13
+ &.fade {
14
+ animation: animation-open-fade;
15
+ }
16
+
17
+ &.scale,
18
+ &.bounce,
19
+ &.default {
20
+ animation: var(--animation-keyframes) var(--animation-keyframes-duration) ease-in-out;
21
+ }
22
+
23
+
24
+ &.show {
25
+ --animation-transform: none;
26
+ }
27
+
28
+ &.close {
29
+ animation-direction: reverse;
30
+ animation-duration: calc(var(--animation-keyframes-duration) / 2);
31
+ }
32
+
33
+ .btn-close {
34
+ position: absolute;
35
+ top: 1rem;
36
+ right: 1rem;
37
+ }
38
+
39
+ .modal-alert-icon {
40
+ width: var(--modal-alert-icon-size);
41
+ height: var(--modal-alert-icon-size);
42
+ margin-bottom: var(--modal-alert-vertical-gutter);
43
+ }
44
+
45
+ .modal-alert-title,
46
+ .modal-alert-text {
47
+ margin-bottom: var(--modal-alert-vertical-gutter);
48
+ }
49
+
50
+ .modal-alert-progress {
51
+ background: var(--bs-primary);
52
+ animation: animation-progress var(--animation-timeout-progress) linear;
53
+ height: .25rem;
54
+ position: absolute;
55
+ bottom: 0;
56
+ }
57
+ }
58
+
59
+ @keyframes animation-progress {
60
+ 0% {
61
+ width: 100%;
62
+ }
63
+
64
+ 100% {
65
+ width: 0%;
66
+ }
67
+ }
68
+
69
+
70
+ @keyframes animation-open-default {
71
+ 0% {
72
+ transform: scale(0.7);
73
+ opacity: 0;
74
+ }
75
+
76
+ 45% {
77
+ transform: scale(1.05);
78
+ }
79
+
80
+ 80% {
81
+ transform: scale(.95);
82
+ }
83
+
84
+ 100% {
85
+ transform: scale(1);
86
+ opacity: 1;
87
+ }
88
+ }
89
+
90
+ @keyframes animation-open-fade {
91
+ 0% {
92
+ opacity: 0;
93
+ }
94
+ 100% {
95
+ opacity: 1;
96
+ }
97
+ }
@@ -0,0 +1,50 @@
1
+ import {useEffect, useRef} from "react";
2
+ import {default as LottiePlayer, AnimationConfigWithData, AnimationConfigWithPath, AnimationConfig} from "lottie-web";
3
+
4
+ const Animation = ({
5
+ animationData,
6
+ path,
7
+ options,
8
+ width,
9
+ height,
10
+ className,
11
+ ...props
12
+ }: Omit<AnimationConfigWithPath, "container"> & Omit<AnimationConfigWithData, "container"> & {
13
+ width?: number | `${number}%`;
14
+ height?: number | `${number}%`;
15
+ className?: string;
16
+ options?: AnimationConfig;
17
+
18
+ }) => {
19
+ const elementRef = useRef<HTMLDivElement | null>(null);
20
+
21
+ useEffect(() => {
22
+ if (!elementRef.current) {
23
+ return;
24
+ }
25
+
26
+ const animation = LottiePlayer.loadAnimation({
27
+ renderer: 'svg',
28
+ loop: false,
29
+ autoplay: true,
30
+ rendererSettings: {
31
+ preserveAspectRatio: 'xMidYMid meet'
32
+ },
33
+ animationData: animationData,
34
+ path: path,
35
+ container: elementRef.current,
36
+ ...(options || {})
37
+ });
38
+
39
+ return () => {
40
+ animation.destroy();
41
+ }
42
+ }, []);
43
+
44
+ return (
45
+ <div className={className} ref={elementRef} style={{width: width, height: height}}>
46
+ </div>
47
+ )
48
+ }
49
+
50
+ export default Animation;
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+
3
+ export type Link = {
4
+ icon?: any;
5
+ rightIcon?: any,
6
+ textClassName?: string,
7
+ permission?: string | string[],
8
+ rightIconProps?: any,
9
+ children?: any,
10
+ preload?: boolean;
11
+ }
12
+
13
+ const BaseButton = ({icon, rightIcon, rightIconProps, children, preload = false}: Link) => {
14
+ return (
15
+ <>
16
+ {/*{preload ?*/}
17
+ {/* <Icon {...iconProps} icon={['far', 'spinner']} spin={true} className={"icon " + (children && "me-2")}/> :*/}
18
+ {/* (icon && <Icon {...iconProps} icon={icon} className={"icon " + (children && "me-2")}/>)*/}
19
+ {/*}*/}
20
+ {children && children}
21
+ {/*{rightIcon && <Icon className={"icon-right ms-2"} icon={rightIcon} {...rightIconProps} />}*/}
22
+ </>
23
+ );
24
+ }
25
+
26
+ export default BaseButton;
@@ -0,0 +1,15 @@
1
+ import React, {ForwardedRef, forwardRef} from "react";
2
+ import BaseButton, {Link} from "./BaseButton";
3
+
4
+ export default forwardRef(({
5
+ children,
6
+ preload,
7
+ ...props
8
+ }: Link & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ref:ForwardedRef<HTMLButtonElement>) => {
9
+
10
+ return (
11
+ <button {...{disabled: preload}} {...props} ref={ref}>
12
+ <BaseButton preload={preload} {...props}>{children}</BaseButton>
13
+ </button>
14
+ );
15
+ })
@@ -0,0 +1,55 @@
1
+ import React, {PropsWithChildren, useEffect, useRef} from "react";
2
+ import {Link as LinkType} from "./BaseButton";
3
+ import Button from "./Button";
4
+ import Link from "./Link";
5
+ import {default as BootstrapDropdown} from "bootstrap/js/src/dropdown"
6
+ import {LinkProps} from "react-router-dom";
7
+ import {IconName, IconPrefix} from "@fortawesome/fontawesome-common-types";
8
+
9
+ const DropdownButton = ({children, disabled, className}: PropsWithChildren<{className?: string, disabled?: boolean}>) => {
10
+ return <>
11
+ {children}
12
+ </>
13
+ };
14
+
15
+ const DropdownContent = ({children, ...props}: { children: any }) => {
16
+ return <div className={"dropdown-menu"}>
17
+ {children}
18
+ </div>
19
+ }
20
+
21
+ const Dropdown = ({items, className, children, icon}: PropsWithChildren<{
22
+ className?: string,
23
+ items?: (LinkProps & LinkType)[],
24
+ icon?: [IconPrefix, IconName] | false
25
+ }>) => {
26
+ const ref = useRef<HTMLButtonElement>(null);
27
+ useEffect(() => {
28
+ const dropdown = new BootstrapDropdown(ref.current);
29
+ return () => {
30
+ dropdown.dispose();
31
+ };
32
+ }, []);
33
+
34
+ const contentElement = React.Children.toArray(children).find(x => React.isValidElement(x) && x.type === DropdownContent);
35
+ const linkElements = React.Children.toArray(children).filter(x => React.isValidElement(x) && x.type === Link);
36
+ const buttonElement = React.Children.toArray(children).find(x => React.isValidElement(x) && x.type === DropdownButton);
37
+ const buttonElements = React.Children.toArray(children).filter(x => !React.isValidElement(x) || (x.type !== Link && x.type !== DropdownContent && x.type !== DropdownButton));
38
+ const buttonProps: any = React.isValidElement(buttonElement) ? buttonElement.props : {};
39
+
40
+ return (
41
+ <div className={[...(className || '').split(' '), 'dropdown'].filter((v, i, self) => self.indexOf(v) === i).join(' ')}>
42
+ <Button ref={ref} data-bs-toggle={"dropdown"} {...buttonProps} className={[...(buttonProps.className || '').split(' '), 'btn', 'dropdown-toggle'].filter((v, i, self) => self.indexOf(v) === i).join(' ')}>
43
+ {buttonProps.children ? buttonProps.children : buttonElements}
44
+ </Button>
45
+ {contentElement || (
46
+ <DropdownContent>
47
+ {linkElements}
48
+ </DropdownContent>
49
+ )}
50
+ </div>
51
+ );
52
+ }
53
+
54
+ export {DropdownContent, DropdownButton};
55
+ export default Dropdown;
@@ -0,0 +1,5 @@
1
+ export default () => {
2
+ return <div>
3
+ No View Found
4
+ </div>
5
+ }
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import {Link, LinkProps} from "react-router-dom";
3
+ import BaseButton, {Link as LinkType} from "./BaseButton";
4
+
5
+ export default ({to, children, ...props}: LinkProps & React.RefAttributes<HTMLAnchorElement> & LinkType) => {
6
+ return (
7
+ <Link to={to} {...props}>
8
+ <BaseButton {...props}>{children && children}</BaseButton>
9
+ </Link>
10
+ );
11
+ }