siam-ui-utils 2.2.25 → 2.2.27

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 (137) hide show
  1. package/dist/CustomBootstrap.js +9 -0
  2. package/dist/CustomBootstrap.js.map +1 -0
  3. package/dist/CustomSelectInput.js +12 -0
  4. package/dist/CustomSelectInput.js.map +1 -0
  5. package/dist/IntlMessages.js +10 -0
  6. package/dist/IntlMessages.js.map +1 -0
  7. package/dist/assets/img/copiar.png.js +5 -0
  8. package/dist/assets/img/copiar.png.js.map +1 -0
  9. package/dist/assets/img/take-photo.png.js +5 -0
  10. package/dist/assets/img/take-photo.png.js.map +1 -0
  11. package/dist/bridges/with-router-bridge.js +14 -0
  12. package/dist/bridges/with-router-bridge.js.map +1 -0
  13. package/dist/constants.js +9 -0
  14. package/dist/constants.js.map +1 -0
  15. package/dist/copy-link/index.js +60 -0
  16. package/dist/copy-link/index.js.map +1 -0
  17. package/dist/custom-input/CustomInputCheckbox.js +36 -0
  18. package/dist/custom-input/CustomInputCheckbox.js.map +1 -0
  19. package/dist/custom-input/CustomInputRadio.js +43 -0
  20. package/dist/custom-input/CustomInputRadio.js.map +1 -0
  21. package/dist/dropzone/Dropzone.js +513 -0
  22. package/dist/dropzone/Dropzone.js.map +1 -0
  23. package/{src/dropzone/Input.tsx → dist/dropzone/Input.js} +77 -76
  24. package/dist/dropzone/Input.js.map +1 -0
  25. package/{src/dropzone/Layout.tsx → dist/dropzone/Layout.js} +50 -57
  26. package/dist/dropzone/Layout.js.map +1 -0
  27. package/dist/dropzone/Preview.js +117 -0
  28. package/dist/dropzone/Preview.js.map +1 -0
  29. package/dist/dropzone/SubmitButton.js +34 -0
  30. package/dist/dropzone/SubmitButton.js.map +1 -0
  31. package/dist/dropzone/assets/cancel.svg.js +5 -0
  32. package/dist/dropzone/assets/cancel.svg.js.map +1 -0
  33. package/dist/dropzone/assets/remove.svg.js +5 -0
  34. package/dist/dropzone/assets/remove.svg.js.map +1 -0
  35. package/dist/dropzone/assets/restart.svg.js +5 -0
  36. package/dist/dropzone/assets/restart.svg.js.map +1 -0
  37. package/dist/dropzone/utils.js +85 -0
  38. package/dist/dropzone/utils.js.map +1 -0
  39. package/dist/dropzone-uploader/dropzone-uploader-dni-digital/index.js +150 -0
  40. package/dist/dropzone-uploader/dropzone-uploader-dni-digital/index.js.map +1 -0
  41. package/dist/dropzone-uploader/index.js +136 -0
  42. package/dist/dropzone-uploader/index.js.map +1 -0
  43. package/dist/iconos/constants-svg.js +41 -0
  44. package/dist/iconos/constants-svg.js.map +1 -0
  45. package/dist/iconos/icon-button-svg.js +50 -0
  46. package/dist/iconos/icon-button-svg.js.map +1 -0
  47. package/dist/iconos/styled-icon.js +26 -0
  48. package/dist/iconos/styled-icon.js.map +1 -0
  49. package/dist/index.js +33 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/select/constants.js +8 -0
  52. package/dist/select/constants.js.map +1 -0
  53. package/dist/select/index.js +90 -0
  54. package/dist/select/index.js.map +1 -0
  55. package/dist/timer/index.js +60 -0
  56. package/dist/timer/index.js.map +1 -0
  57. package/dist/tomar-foto/index.js +62 -0
  58. package/dist/tomar-foto/index.js.map +1 -0
  59. package/dist/view-layout/button-editor.js +14 -0
  60. package/dist/view-layout/button-editor.js.map +1 -0
  61. package/dist/view-layout/constants.js +11 -0
  62. package/dist/view-layout/constants.js.map +1 -0
  63. package/dist/view-layout/editor-layer.js +28 -0
  64. package/dist/view-layout/editor-layer.js.map +1 -0
  65. package/dist/view-layout/index.js +53 -0
  66. package/dist/view-layout/index.js.map +1 -0
  67. package/dist/view-layout/slot-wrapper.js +39 -0
  68. package/dist/view-layout/slot-wrapper.js.map +1 -0
  69. package/dist/where-by-room/index.js +20 -0
  70. package/dist/where-by-room/index.js.map +1 -0
  71. package/dist/where-by-room/room.js +78 -0
  72. package/dist/where-by-room/room.js.map +1 -0
  73. package/package.json +69 -18
  74. package/eslint.config.mjs +0 -45
  75. package/index.html +0 -17
  76. package/src/App.css +0 -47
  77. package/src/App.jsx +0 -66
  78. package/src/CustomBootstrap.jsx +0 -10
  79. package/src/CustomSelectInput.jsx +0 -8
  80. package/src/IntlMessages.jsx +0 -7
  81. package/src/assets/css/sass/_gogo.style.scss +0 -8967
  82. package/src/assets/css/sass/_mixins.scss +0 -125
  83. package/src/assets/css/sass/_plugins.scss +0 -1
  84. package/src/assets/css/sass/ampf_style.scss +0 -185
  85. package/src/assets/css/sass/main.scss +0 -11
  86. package/src/assets/css/sass/plugins/react-table.scss +0 -314
  87. package/src/assets/css/sass/themes/gogo.light.redruby.scss +0 -41
  88. package/src/assets/css/sass/themes/variables.scss +0 -86
  89. package/src/assets/css/vendor/bootstrap.min.css +0 -6
  90. package/src/assets/css/vendor/bootstrap.rtl.only.min.css +0 -1428
  91. package/src/assets/img/copiar.png +0 -0
  92. package/src/assets/img/take-photo.png +0 -0
  93. package/src/bridges/index.js +0 -1
  94. package/src/bridges/with-router-bridge.jsx +0 -11
  95. package/src/constants.js +0 -7
  96. package/src/copy-link/index.jsx +0 -58
  97. package/src/copy-link/styles.scss +0 -39
  98. package/src/custom-input/CustomInputCheckbox.jsx +0 -33
  99. package/src/custom-input/CustomInputRadio.jsx +0 -37
  100. package/src/custom-input/index.css +0 -168
  101. package/src/custom-input/index.js +0 -2
  102. package/src/dropzone/Dropzone.tsx +0 -816
  103. package/src/dropzone/Preview.tsx +0 -139
  104. package/src/dropzone/SubmitButton.tsx +0 -47
  105. package/src/dropzone/assets/cancel.svg +0 -1
  106. package/src/dropzone/assets/remove.svg +0 -1
  107. package/src/dropzone/assets/restart.svg +0 -1
  108. package/src/dropzone/styles.css +0 -140
  109. package/src/dropzone/utils.ts +0 -113
  110. package/src/dropzone-uploader/dropzone-uploader-dni-digital/index.jsx +0 -151
  111. package/src/dropzone-uploader/dropzone-uploader.css +0 -66
  112. package/src/dropzone-uploader/index.jsx +0 -138
  113. package/src/iconos/constants-svg.js +0 -659
  114. package/src/iconos/icon-button-svg.jsx +0 -50
  115. package/src/iconos/index.js +0 -2
  116. package/src/iconos/styled-icon.jsx +0 -25
  117. package/src/index.css +0 -74
  118. package/src/index.js +0 -13
  119. package/src/main.jsx +0 -7
  120. package/src/select/constants.js +0 -4
  121. package/src/select/index.tsx +0 -147
  122. package/src/test-resources.jsx +0 -145
  123. package/src/timer/index.jsx +0 -62
  124. package/src/timer/styles.scss +0 -54
  125. package/src/tomar-foto/index.jsx +0 -69
  126. package/src/view-layout/button-editor.jsx +0 -18
  127. package/src/view-layout/constants.js +0 -7
  128. package/src/view-layout/editor-layer.jsx +0 -27
  129. package/src/view-layout/index.tsx +0 -62
  130. package/src/view-layout/item-slot.tsx +0 -20
  131. package/src/view-layout/slot-wrapper.tsx +0 -44
  132. package/src/view-layout/styles.scss +0 -143
  133. package/src/where-by-room/constants.js +0 -2
  134. package/src/where-by-room/index.jsx +0 -17
  135. package/src/where-by-room/room.jsx +0 -79
  136. package/tsconfig.json +0 -19
  137. package/vite.config.ts +0 -22
@@ -1,50 +0,0 @@
1
- import { useEffect, useRef, useState } from 'react';
2
- import { withTheme } from 'styled-components';
3
- import { Icon } from './styled-icon';
4
-
5
- const useSvgToReactEncoded = (svg) => {
6
- const svgWrapperRef = useRef();
7
- useEffect(() => {
8
- svgWrapperRef.current.innerHTML = svg;
9
- }, [svg]);
10
-
11
- return svgWrapperRef;
12
- };
13
-
14
- const IconButtonSvg = (props) => {
15
- const {
16
- sublabel = '',
17
- onClick = () => {
18
- undefined;
19
- },
20
- onTouchStart = () => {
21
- undefined;
22
- },
23
- svg,
24
- svgOver,
25
- height = '3rem',
26
- width = '3rem',
27
- title,
28
- } = props || {};
29
- const [svgActive, setSvgActive] = useState(svg);
30
- const svgWrapperRef = useSvgToReactEncoded(svgActive);
31
-
32
- return (
33
- <Icon
34
- title={title}
35
- display={sublabel !== '' ? 'block' : 'none'}
36
- onClick={onClick}
37
- onTouchStart={onTouchStart}
38
- onMouseOver={() => setSvgActive(svgOver || svg)}
39
- onMouseOut={() => setSvgActive(svg)}
40
- width={width}
41
- height={height}
42
- >
43
- <div ref={svgWrapperRef} />
44
- <label>{sublabel}</label>
45
- </Icon>
46
- );
47
- };
48
- IconButtonSvg.defaultProps = { theme: {} };
49
- const _t = withTheme(IconButtonSvg);
50
- export { _t as IconButtonSvg };
@@ -1,2 +0,0 @@
1
- export * from "./constants-svg";
2
- export * from "./icon-button-svg";
@@ -1,25 +0,0 @@
1
- import { styled } from 'styled-components';
2
-
3
-
4
- const IconDiv = (props) => <div {...props} />;
5
-
6
- export const Icon = styled(IconDiv)`
7
- display: flex;
8
- flex-direction: column;
9
- justify-content: center;
10
- align-items: center;
11
- svg {
12
- margin: 0.1rem;
13
- margin-right: 0.1rem;
14
- margin-top: 0.1rem;
15
- justify-content: center;
16
- color: red;
17
- width: ${(props) => props.width || '3rem'};
18
- height: ${(props) => props.height || props.width || '3rem'};
19
- cursor: pointer;
20
- }
21
- label {
22
- display: ${(props) => props.display || 'none'};
23
- }
24
- `;
25
-
package/src/index.css DELETED
@@ -1,74 +0,0 @@
1
- :root {
2
- font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3
- line-height: 0.2;
4
- font-weight: 400;
5
-
6
- color-scheme: inherit;
7
- color: rgba(255, 255, 255, 0.87);
8
- background-color: #242424;
9
-
10
- font-synthesis: none;
11
- text-rendering: optimizeLegibility;
12
- -webkit-font-smoothing: antialiased;
13
- -moz-osx-font-smoothing: grayscale;
14
- }
15
-
16
- a {
17
- font-weight: 500;
18
- color: #646cff;
19
- text-decoration: inherit;
20
- }
21
- a:hover {
22
- color: #535bf2;
23
- }
24
-
25
- body {
26
- margin: 0;
27
- display: flex;
28
- place-items: center;
29
- min-width: 320px;
30
- min-height: 100vh;
31
- }
32
-
33
- h1 {
34
- font-size: 1.2em;
35
- line-height: 1.1;
36
- }
37
-
38
- h2 {
39
- font-size: 1.2em;
40
- line-height: 1.1;
41
- }
42
-
43
-
44
- button {
45
- border-radius: 8px;
46
- border: 1px solid transparent;
47
- padding: 0.6em 1.2em;
48
- font-size: 1em;
49
- font-weight: 500;
50
- font-family: inherit;
51
- background-color: grey;
52
- cursor: pointer;
53
- transition: border-color 0.25s;
54
- }
55
- button:hover {
56
- border-color: #646cff;
57
- }
58
- button:focus,
59
- button:focus-visible {
60
- outline: 4px auto -webkit-focus-ring-color;
61
- }
62
-
63
- @media (prefers-color-scheme: light) {
64
- :root {
65
- color: #213547;
66
- background-color: #ffffff;
67
- }
68
- a:hover {
69
- color: #747bff;
70
- }
71
- button {
72
- background-color: #f9f9f9;
73
- }
74
- }
package/src/index.js DELETED
@@ -1,13 +0,0 @@
1
- export * from './dropzone-uploader';
2
- export * from './dropzone-uploader/dropzone-uploader-dni-digital';
3
- export * from './bridges';
4
- export * from './CustomBootstrap';
5
- export * from './custom-input';
6
- export * from './select';
7
- export * from './CustomSelectInput';
8
- export * from './tomar-foto';
9
- export * as IntlMessages from './IntlMessages';
10
- export * from './where-by-room';
11
- export * from './copy-link';
12
- export * from './view-layout';
13
- export * from './timer';
package/src/main.jsx DELETED
@@ -1,7 +0,0 @@
1
- import { createRoot } from 'react-dom/client';
2
- import './assets/css/vendor/bootstrap.min.css';
3
- import './assets/css/vendor/bootstrap.rtl.only.min.css';
4
- import './assets/css/sass/themes/gogo.light.redruby.scss';
5
- import App from './App';
6
-
7
- createRoot(document.getElementById('root')).render(<App />);
@@ -1,4 +0,0 @@
1
- export const LABELS = {
2
- SIN_DATOS: "SIN DATOS",
3
- SELECCIONE: "SELECCIONE...",
4
- };
@@ -1,147 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import Select from 'react-select';
3
- import { Label } from 'reactstrap';
4
- import {CustomSelectInput} from '../CustomSelectInput';
5
- import { LABELS } from './constants';
6
- import 'react-tagsinput/react-tagsinput.css';
7
-
8
- interface ICustomStylesOption {
9
- fieldMatch: string;
10
- valueMatch: any;
11
- }
12
- interface IOption {
13
- label: string;
14
- value: any;
15
- fields?: any;
16
- }
17
- interface IOption {
18
- label: string;
19
- value: any;
20
- fields?: any;
21
- }
22
- interface Props {
23
- label: string;
24
- tabIndex: number;
25
- options: [IOption];
26
- onChange: any;
27
- selectedValue: any;
28
- firstElement?: IOption; // no ingresar null como VALUE del elemento, setear '' ya que lo toma como que no se selecciono nada
29
- newItem?: IOption;
30
- placeholder?: string;
31
- disabled?: boolean;
32
- customStylesOption?: ICustomStylesOption;
33
- }
34
-
35
- const {SIN_DATOS, SELECCIONE}=LABELS
36
-
37
- export const CustomSelect: React.FC<Props> = (props: Props) => {
38
- const [firstElement] = useState(props.firstElement);
39
- const [newItem] = useState(props.newItem);
40
- const [selectedIoption, setIoption] = useState({});
41
- const [customStylesOption] = useState(props.customStylesOption);
42
- const [customStyles, setCustomStyles] = useState({});
43
-
44
- // agrega items
45
- useEffect(() => {
46
- if (newItem) {
47
- props.options.push(newItem);
48
- }
49
- }, [newItem, props.options]);
50
-
51
- // Seleccion del 1er item.
52
- useEffect(() => {
53
- const { options = [] } = props;
54
- if (firstElement && Number(options?.length) > 1) {
55
- const propIOption = options.filter((item) => item === firstElement);
56
-
57
- if (propIOption?.length === 0) {
58
- props.options.unshift(firstElement);
59
- }
60
- }
61
- // eslint-disable-next-line react-hooks/exhaustive-deps
62
- }, [firstElement, props.options]);
63
-
64
- // selecciona un valor seteado dentro de la coleccion
65
- useEffect(() => {
66
- const { selectedValue } = props;
67
- const errorProp = { value: null };
68
-
69
- if (
70
- selectedValue ||
71
- (firstElement && firstElement.value === selectedValue)
72
- ) {
73
- const propIOption = props.options.filter(({ value }) => {
74
- return JSON.stringify(value) === JSON.stringify(selectedValue);
75
- });
76
-
77
- if (propIOption[0]) {
78
- setIoption(propIOption[0]);
79
- if (!Object.getOwnPropertyDescriptor(selectedIoption, 'label')) {
80
- props.onChange(propIOption[0]);
81
- }
82
- } else {
83
- setIoption(errorProp);
84
- props.onChange(errorProp);
85
- }
86
- } else if (props.options.length > 0) {
87
- setIoption(errorProp);
88
- props.onChange(errorProp);
89
- }
90
- // eslint-disable-next-line react-hooks/exhaustive-deps
91
- }, [props.selectedValue, props.options, firstElement]);
92
-
93
- useEffect(() => {
94
- if (customStylesOption) {
95
- const stylesOption = {
96
- option: (base: any, { data }: any) => {
97
- return {
98
- ...base,
99
- color:
100
- data.fields &&
101
- data.fields[customStylesOption.fieldMatch] ===
102
- customStylesOption.valueMatch
103
- ? 'blue !important'
104
- : '',
105
- fontWeight:
106
- data.fields &&
107
- data.fields[customStylesOption.fieldMatch] ===
108
- customStylesOption.valueMatch
109
- ? 'bold'
110
- : '',
111
- };
112
- },
113
- };
114
- setCustomStyles(stylesOption);
115
- }
116
- }, [customStylesOption]);
117
-
118
- return (
119
- <>
120
- {props.label && props.label !== '' && (
121
- <Label className="mb-0">{props.label}:</Label>
122
- )}
123
- <Select
124
- {...props}
125
- components={{ Input: CustomSelectInput }}
126
- className="react-select"
127
- classNamePrefix="react-select"
128
- name="form-field-name"
129
- value={
130
- Object.getOwnPropertyDescriptor(selectedIoption, 'label')
131
- ? selectedIoption
132
- : ''
133
- }
134
- onChange={props.onChange}
135
- options={props.options}
136
- placeholder={
137
- Number(props.options.length) === 0
138
- ? SIN_DATOS
139
- : props.placeholder || SELECCIONE
140
- }
141
- isDisabled={props.disabled}
142
- styles={customStyles}
143
- />
144
- </>
145
- );
146
- };
147
-
@@ -1,145 +0,0 @@
1
- import { DropzoneUploader, DropzoneUploaderDniDigital, TomarFoto } from '.';
2
- import { CopyLink } from './copy-link';
3
- import { CustomInputCheckbox, CustomInputRadio } from './custom-input';
4
- import { CustomSelect } from './select';
5
- import { Timer } from './timer';
6
- import { ViewLayout } from './view-layout';
7
- import { WhereByRoom } from './where-by-room';
8
- import './assets/css/vendor/bootstrap.min.css';
9
- import './index.css';
10
- import './App.css';
11
- import { useState } from 'react';
12
-
13
- const slots = [
14
- {
15
- slot: 1,
16
- x: 3,
17
- y: 3,
18
- w: 2,
19
- h: 2,
20
- legend: 'Prueba',
21
- direction: 'column',
22
- contentSize: 'medium',
23
- align: 'stretch',
24
- justify: 'flex-start',
25
- component: null,
26
- showBorder: true,
27
- },
28
- ];
29
-
30
- export const DropzoneUploaderView = () => (
31
- <>
32
- <TomarFoto isMobile={true} />
33
- <DropzoneUploader
34
- totalFiles={4}
35
- onChangeFiles={() => alert('onChange')}
36
- maxFiles={3}
37
- nameFileLabel="file"
38
- />
39
- </>
40
- );
41
-
42
- export const DropzoneUploaderFirmaDigitalView = () => (
43
- <DropzoneUploader
44
- totalFiles={0}
45
- onChangeFiles={() => {
46
- console.log('onChange');
47
- }}
48
- maxFiles={7}
49
- nameFileLabel="Subir archivos"
50
- capture="environment"
51
- onFilesSelectedSelfie
52
- />
53
- );
54
-
55
- export const DropzoneUploaderDniDigitalView = () => (
56
- <DropzoneUploaderDniDigital
57
- totalFiles={0}
58
- onChangeFiles={() => {
59
- console.log('onChange');
60
- }}
61
- maxFiles={7}
62
- nameFileLabel="Subir archivos"
63
- capture="environment"
64
- onFilesSelectedSelfie
65
- />
66
- );
67
-
68
- export const VideoCallView = () => (
69
- <WhereByRoom
70
- src="https://whereby.com/test-ampf-room"
71
- title="Videollamada de ejemplo"
72
- />
73
- );
74
-
75
- export const CustomInputsView = () => {
76
- const handleChecked = (item, isSelected) => {
77
- console.log('Item checked:', item, 'Selected:', isSelected);
78
- };
79
-
80
- const handleChangeRadio = (ID) => {
81
- console.log('ID :', ID);
82
- };
83
- return (
84
- <>
85
- <CustomInputCheckbox
86
- className="itemCheck m-0"
87
- id={1}
88
- onChange={(e) => handleChecked(1, e.target.checked)}
89
- label={<span className="custom-checkbox">Checkbox 1</span>}
90
- />
91
- <CustomInputRadio
92
- name="radioTest"
93
- label="1"
94
- id="1"
95
- defaultChecked={true}
96
- onChange={handleChangeRadio}
97
- />
98
- <CustomInputRadio
99
- name="radioTest"
100
- label="2"
101
- id="2"
102
- onChange={handleChangeRadio}
103
- />
104
- </>
105
- );
106
- };
107
-
108
- export const CopyLinkView = () => (
109
- <CopyLink link="https://linkdepruebaparaelcopylink.com" />
110
- );
111
-
112
- export const ViewLayoutView = () => <ViewLayout slots={slots} />;
113
-
114
- export const TimerView = () => (
115
- <Timer initialMinutes={2} active={true} style={{ color: 'green' }} />
116
- );
117
-
118
- export const CustomSelectView = () => {
119
- const motivosBaja = [
120
- {
121
- label: 'MAL SERVICIO',
122
- value: 'MSR',
123
- },
124
- {
125
- label: 'AUMENTO DE CUOTA',
126
- value: 'ADC',
127
- },
128
- ];
129
- const [motivoBajaSelected, setMotivoBajaSelected] = useState({});
130
-
131
- const handleMotivoSelected = (e) => {
132
- setMotivoBajaSelected(e.value);
133
- };
134
-
135
- return (
136
- <CustomSelect
137
- tabIndex={0}
138
- options={motivosBaja}
139
- label="Seleccione una opción"
140
- onChange={handleMotivoSelected}
141
- placeholder="Seleccione..."
142
- selectedValue={motivoBajaSelected}
143
- />
144
- );
145
- };
@@ -1,62 +0,0 @@
1
- import { useEffect, useState, useRef } from 'react';
2
- import './styles.scss';
3
-
4
- export const formatTiempo = (ms) => {
5
- if (ms == null) return '--:--';
6
- const absMs = Math.abs(ms);
7
- const totalSec = Math.floor(absMs / 1000);
8
- const min = Math.floor(totalSec / 60);
9
- const sec = totalSec % 60;
10
- const formatted = `${min.toString().padStart(2, '0')}:${sec
11
- .toString()
12
- .padStart(2, '0')}`;
13
- return ms < 0 ? `-${formatted}` : formatted;
14
- };
15
-
16
- const getTimerColorClass = (ms, maxTime) => {
17
- if (!maxTime) return '';
18
- const percent = ms / maxTime;
19
- if (percent > 0.33) return 'timer-green';
20
- if (percent > 0.15) return 'timer-yellow';
21
- if (percent > 0) return 'timer-red';
22
- if (ms === 0) return 'timer-out';
23
- if (ms < 0) return 'timer-over';
24
- return '';
25
- };
26
-
27
- const Timer = ({
28
- initialMinutes = 0,
29
- icon = true,
30
- className = '',
31
- active = true,
32
- style = {},
33
- }) => {
34
- const initialMs = initialMinutes * 60 * 1000;
35
- const [ms, setMs] = useState(initialMs);
36
- const intervalRef = useRef();
37
-
38
- useEffect(() => {
39
- if (!active) return;
40
- intervalRef.current = setInterval(() => {
41
- setMs((prev) => prev - 1000);
42
- }, 1000);
43
- return () => clearInterval(intervalRef.current);
44
- }, [active]);
45
-
46
- useEffect(() => {
47
- setMs(initialMs);
48
- }, [initialMs]);
49
-
50
- const timerColorClass = getTimerColorClass(ms, initialMs);
51
-
52
- return (
53
- <span
54
- className={`av-video-timer timer ${timerColorClass} ${className}`}
55
- style={style}
56
- >
57
- {icon && <i className="icon-clock timer" />}
58
- {formatTiempo(ms)}
59
- </span>
60
- );
61
- };
62
- export { Timer };
@@ -1,54 +0,0 @@
1
- .av-video-timer {
2
- color: inherit;
3
- margin: 0 12px;
4
- flex: 1;
5
- text-align: center;
6
- display: flex;
7
- justify-content: center;
8
- font-weight: bold;
9
- align-items: center;
10
- font-size: 1.3em;
11
- width: 100%;
12
- margin: 8px 0;
13
- }
14
- .timer {
15
- font-size: clamp(5px, 2vw, 20px);
16
- margin-right: 4px;
17
- }
18
- .timer-green {
19
- color: #28a745;
20
- }
21
- .timer-yellow {
22
- color: #ffc107;
23
- }
24
- .timer-red {
25
- color: #bd0300;
26
- }
27
-
28
- @keyframes vibrate {
29
- 0% {
30
- transform: translateX(0);
31
- }
32
- 20% {
33
- transform: translateX(-3px);
34
- }
35
- 40% {
36
- transform: translateX(3px);
37
- }
38
- 60% {
39
- transform: translateX(-3px);
40
- }
41
- 80% {
42
- transform: translateX(3px);
43
- }
44
- 100% {
45
- transform: translateX(0);
46
- }
47
- }
48
- .timer-out {
49
- color: #000000;
50
- animation: vibrate 0.3s linear infinite;
51
- }
52
- .timer-over {
53
- color: #c00805;
54
- }
@@ -1,69 +0,0 @@
1
- import { useState } from 'react';
2
- import { Row } from 'reactstrap';
3
- import { DropzoneUploader, Colxx } from '../';
4
- import { TAKE_PHOTO } from '../constants';
5
- import imgHacerFoto from '../assets/img/take-photo.png';
6
-
7
-
8
- export const TomarFoto = ({
9
- onFilesSelectedSelfie = () => {},
10
- isMobile = false,
11
- }) => {
12
- const [filesTotalSelectedSelfie, setTotalFilesSelectedSelfie] = useState(0);
13
- const {
14
- LOAD_SELFIE_WITH_IDENTITY_CARD_MESSAGE,
15
- MESSAGE_SELFIE_ONLY_CAN_TAKE_FROM_CELLPHONE,
16
- TAKE_PHOTO_MESSAGE,
17
- } = TAKE_PHOTO;
18
-
19
- const handleFilesSelectedSelfie = (files) => {
20
- setTotalFilesSelectedSelfie(files.length);
21
- onFilesSelectedSelfie(files);
22
- };
23
-
24
- return (
25
- <>
26
- <Row className="pt-2 ml-4">
27
- <Colxx xxs="11" md="5">
28
- {LOAD_SELFIE_WITH_IDENTITY_CARD_MESSAGE}
29
- </Colxx>
30
- </Row>
31
- <Row className="pt-2 ml-2">
32
- <Colxx xxs="12" md="9">
33
- {isMobile ? (
34
- <>
35
- <Colxx xxs="12" className="text-center">
36
- {filesTotalSelectedSelfie === 0 && (
37
- <img
38
- style={{ width: '97%' }}
39
- alt="hacerFotoDNI"
40
- src={imgHacerFoto}
41
- />
42
- )}
43
- <DropzoneUploader
44
- className="pt-2 ml-2"
45
- maxFiles={1}
46
- onChangeFiles={handleFilesSelectedSelfie}
47
- totalFiles={filesTotalSelectedSelfie}
48
- accept="image/jpg,image/jpeg"
49
- capture="environment"
50
- nameFileLabel={TAKE_PHOTO_MESSAGE}
51
- />
52
- </Colxx>
53
- </>
54
- ) : (
55
- <h2
56
- className={'view-icon iconsminds-smartphone-4 ml-2 mr-2'}
57
- style={{
58
- color: 'red',
59
- margin: '10px 10px 0px 10px',
60
- }}
61
- >
62
- {MESSAGE_SELFIE_ONLY_CAN_TAKE_FROM_CELLPHONE}
63
- </h2>
64
- )}
65
- </Colxx>
66
- </Row>
67
- </>
68
- );
69
- };
@@ -1,18 +0,0 @@
1
- import './styles.scss';
2
-
3
- const ButtonEditor = ({ activo, onClick }) => (
4
- <button
5
- className={`visualizador-editor-btn ${
6
- activo
7
- ? 'visualizador-editor-btn--activo'
8
- : 'visualizador-editor-btn--inactivo'
9
- }`}
10
- onClick={onClick}
11
- >
12
- <span>
13
- <i className="icon-eye simple-icon-eye" />
14
- </span>
15
- </button>
16
- );
17
-
18
- export default ButtonEditor;
@@ -1,7 +0,0 @@
1
- export const GRID_SIZES = {
2
- sm: { cols: 18, rows: 18 },
3
- md: { cols: 12, rows: 12 },
4
- lg: { cols: 6, rows: 6 },
5
- };
6
-
7
- export const LOCALHOST = ['localhost', '127.0.0.1'];