contentoh-components-library 21.3.17 → 21.3.19
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.
- package/.env.development +0 -5
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- package/dist/components/atoms/GeneralInput/index.js +14 -1
- package/dist/components/atoms/ProgressBar/index.js +6 -36
- package/dist/components/atoms/ProgressBar/styles.js +3 -11
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
- package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
- package/dist/components/molecules/HeaderTop/index.js +6 -23
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ProductNameHeader/index.js +4 -6
- package/dist/components/organisms/FullProductNameHeader/index.js +0 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +50 -65
- package/dist/components/pages/ProviderProductEdition/index.js +11 -15
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +44 -36
- package/dist/components/pages/RetailerProductEdition/index.js +12 -13
- package/dist/global-files/data.js +23 -18
- package/dist/global-files/fonts.css +0 -6
- package/dist/global-files/variables.js +0 -2
- package/dist/index.js +46 -267
- package/package.json +1 -12
- package/src/assets/images/generalButton/closeIcon.svg +2 -2
- package/src/components/atoms/GeneralInput/index.js +10 -0
- package/src/components/atoms/ProgressBar/index.js +5 -40
- package/src/components/atoms/ProgressBar/styles.js +0 -24
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
- package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
- package/src/components/molecules/HeaderTop/index.js +8 -29
- package/src/components/molecules/HeaderTop/styles.js +0 -4
- package/src/components/molecules/ProductNameHeader/index.js +2 -7
- package/src/components/organisms/FullProductNameHeader/index.js +0 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +49 -67
- package/src/components/pages/ProviderProductEdition/index.js +9 -16
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +46 -36
- package/src/components/pages/RetailerProductEdition/index.js +10 -14
- package/src/global-files/data.js +23 -18
- package/src/global-files/fonts.css +0 -6
- package/src/global-files/variables.js +0 -2
- package/src/index.js +0 -17
- package/dist/assets/images/customSelect/starIcon.svg +0 -14
- package/dist/assets/images/defaultImages/Spinner.gif +0 -0
- package/dist/assets/images/defaultImages/notFound.svg +0 -124
- package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -72
- package/dist/components/atoms/ButtonFileChooser/index.js +0 -110
- package/dist/components/atoms/ButtonFileChooser/styles.js +0 -20
- package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +0 -66
- package/dist/components/atoms/ButtonV2/index.js +0 -110
- package/dist/components/atoms/ButtonV2/styles.js +0 -53
- package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +0 -50
- package/dist/components/atoms/CustomIcon/index.js +0 -40
- package/dist/components/atoms/CustomIcon/styles.js +0 -33
- package/dist/components/atoms/IconFile/IconFile.stories.js +0 -48
- package/dist/components/atoms/IconFile/index.js +0 -249
- package/dist/components/atoms/IconFile/styles.js +0 -23
- package/dist/components/atoms/Image/Image.stories.js +0 -73
- package/dist/components/atoms/Image/index.js +0 -76
- package/dist/components/atoms/Image/styles.js +0 -43
- package/dist/components/atoms/ImageLink/ImageLink.stories.js +0 -63
- package/dist/components/atoms/ImageLink/index.js +0 -77
- package/dist/components/atoms/ImageLink/styles.js +0 -40
- package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +0 -70
- package/dist/components/atoms/ImagePreview/index.js +0 -208
- package/dist/components/atoms/ImagePreview/styles.js +0 -44
- package/dist/components/atoms/InputText/InputText.stories.js +0 -60
- package/dist/components/atoms/InputText/index.js +0 -66
- package/dist/components/atoms/InputText/styles.js +0 -32
- package/dist/components/atoms/NotFound/NotFound.stories.js +0 -36
- package/dist/components/atoms/NotFound/index.js +0 -75
- package/dist/components/atoms/NotFound/styles.js +0 -20
- package/dist/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -45
- package/dist/components/atoms/SelectItemV2/index.js +0 -57
- package/dist/components/atoms/SelectItemV2/styles.js +0 -30
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +0 -66
- package/dist/components/atoms/Tooltip/index.js +0 -72
- package/dist/components/atoms/Tooltip/styles.js +0 -20
- package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -66
- package/dist/components/molecules/ButtonDownloadFile/index.js +0 -179
- package/dist/components/molecules/ButtonDownloadFile/styles.js +0 -23
- package/dist/components/molecules/Dropdown/Dropdown.stories.js +0 -98
- package/dist/components/molecules/Dropdown/index.js +0 -150
- package/dist/components/molecules/Dropdown/styles.js +0 -26
- package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -82
- package/dist/components/molecules/ImageTooltip/index.js +0 -85
- package/dist/components/molecules/ImageTooltip/styles.js +0 -33
- package/dist/components/molecules/SelectV2/SelectV2.stories.js +0 -120
- package/dist/components/molecules/SelectV2/index.js +0 -306
- package/dist/components/molecules/SelectV2/styles.js +0 -42
- package/dist/components/molecules/SelectV2/test.js +0 -95
- package/dist/components/molecules/SelectV2/test.stories.js +0 -27
- package/dist/components/organisms/Chat/Chat.stories.js +0 -160
- package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -83
- package/dist/components/organisms/Chat/ChatLists/index.js +0 -160
- package/dist/components/organisms/Chat/ChatLists/styles.js +0 -29
- package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -176
- package/dist/components/organisms/Chat/ContainerItems/index.js +0 -537
- package/dist/components/organisms/Chat/ContainerItems/styles.js +0 -20
- package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -142
- package/dist/components/organisms/Chat/ContentChat/index.js +0 -1429
- package/dist/components/organisms/Chat/ContentChat/styles.js +0 -20
- package/dist/components/organisms/Chat/Footer/Footer.stories.js +0 -43
- package/dist/components/organisms/Chat/Footer/index.js +0 -976
- package/dist/components/organisms/Chat/Footer/styles.js +0 -32
- package/dist/components/organisms/Chat/Header/Header.stories.js +0 -96
- package/dist/components/organisms/Chat/Header/index.js +0 -84
- package/dist/components/organisms/Chat/Header/styles.js +0 -20
- package/dist/components/organisms/Chat/index.js +0 -253
- package/dist/components/organisms/Chat/styles.js +0 -29
- package/dist/components/organisms/Modal/Modal.stories.js +0 -66
- package/dist/components/organisms/Modal/index.js +0 -95
- package/dist/components/organisms/Modal/styles.js +0 -20
- package/dist/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -33
- package/dist/components/organisms/RangeCalendar/index.js +0 -149
- package/dist/components/organisms/RangeCalendar/styles.js +0 -27
- package/dist/global-files/handle_http.js +0 -381
- package/dist/global-files/handle_userTech.js +0 -20
- package/dist/global-files/utils.js +0 -514
- package/src/assets/images/customSelect/starIcon.svg +0 -14
- package/src/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +0 -124
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
- package/src/components/atoms/ButtonFileChooser/index.js +0 -68
- package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -53
- package/src/components/atoms/ButtonV2/index.js +0 -85
- package/src/components/atoms/ButtonV2/styles.js +0 -217
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
- package/src/components/atoms/CustomIcon/index.js +0 -41
- package/src/components/atoms/CustomIcon/styles.js +0 -85
- package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
- package/src/components/atoms/IconFile/index.js +0 -119
- package/src/components/atoms/IconFile/styles.js +0 -67
- package/src/components/atoms/Image/Image.stories.js +0 -51
- package/src/components/atoms/Image/index.js +0 -55
- package/src/components/atoms/Image/styles.js +0 -34
- package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
- package/src/components/atoms/ImageLink/index.js +0 -57
- package/src/components/atoms/ImageLink/styles.js +0 -30
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
- package/src/components/atoms/ImagePreview/index.js +0 -178
- package/src/components/atoms/ImagePreview/styles.js +0 -77
- package/src/components/atoms/InputText/InputText.stories.js +0 -39
- package/src/components/atoms/InputText/index.js +0 -61
- package/src/components/atoms/InputText/styles.js +0 -89
- package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
- package/src/components/atoms/NotFound/index.js +0 -52
- package/src/components/atoms/NotFound/styles.js +0 -55
- package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -26
- package/src/components/atoms/SelectItemV2/index.js +0 -61
- package/src/components/atoms/SelectItemV2/styles.js +0 -90
- package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
- package/src/components/atoms/Tooltip/index.js +0 -59
- package/src/components/atoms/Tooltip/styles.js +0 -42
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
- package/src/components/molecules/ButtonDownloadFile/index.js +0 -109
- package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
- package/src/components/molecules/Dropdown/Dropdown.stories.js +0 -103
- package/src/components/molecules/Dropdown/index.js +0 -150
- package/src/components/molecules/Dropdown/styles.js +0 -75
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -68
- package/src/components/molecules/ImageTooltip/index.js +0 -63
- package/src/components/molecules/ImageTooltip/styles.js +0 -18
- package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -115
- package/src/components/molecules/SelectV2/index.js +0 -357
- package/src/components/molecules/SelectV2/styles.js +0 -105
- package/src/components/molecules/SelectV2/test.js +0 -61
- package/src/components/molecules/SelectV2/test.stories.js +0 -10
- package/src/components/organisms/Chat/Chat.stories.js +0 -147
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
- package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chat/ChatLists/index.js +0 -141
- package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
- package/src/components/organisms/Chat/ContainerItems/index.js +0 -512
- package/src/components/organisms/Chat/ContainerItems/styles.js +0 -328
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
- package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chat/ContentChat/index.js +0 -897
- package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
- package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
- package/src/components/organisms/Chat/Footer/index.js +0 -661
- package/src/components/organisms/Chat/Footer/styles.js +0 -286
- package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
- package/src/components/organisms/Chat/Header/index.js +0 -94
- package/src/components/organisms/Chat/Header/styles.js +0 -49
- package/src/components/organisms/Chat/index.js +0 -235
- package/src/components/organisms/Chat/styles.js +0 -42
- package/src/components/organisms/Modal/Modal.stories.js +0 -55
- package/src/components/organisms/Modal/index.js +0 -97
- package/src/components/organisms/Modal/styles.js +0 -103
- package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -16
- package/src/components/organisms/RangeCalendar/index.js +0 -121
- package/src/components/organisms/RangeCalendar/styles.js +0 -883
- package/src/global-files/handle_http.js +0 -225
- package/src/global-files/handle_userTech.js +0 -7
- package/src/global-files/utils.js +0 -330
|
@@ -1,514 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.isValidNaturalNumber = exports.isStringEmpty = exports.isObject = exports.isArrayEmpty = exports.getTime = exports.getResizeImgHeight = exports.getImageURL = exports.getImageSize = exports.getFullDate = exports.getFormatedDate = exports.getFileName = exports.getFileExtension = exports.getDataBuffer = exports.getDataBase64 = exports.getCustomDate = exports.getBase64 = exports.encodeUriJson = exports.decodeJSON = void 0;
|
|
9
|
-
|
|
10
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
|
|
13
|
-
|
|
14
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
15
|
-
|
|
16
|
-
var _jsBase = require("js-base64");
|
|
17
|
-
|
|
18
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
19
|
-
|
|
20
|
-
/*====================================================================
|
|
21
|
-
UTILERIAS PARA EL MANEJO DE ARCHIVOS
|
|
22
|
-
======================================================================*/
|
|
23
|
-
|
|
24
|
-
/*------------------------
|
|
25
|
-
devolver el base64
|
|
26
|
-
completo de un file
|
|
27
|
-
--------------------------*/
|
|
28
|
-
var getBase64 = /*#__PURE__*/function () {
|
|
29
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(file) {
|
|
30
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
31
|
-
while (1) {
|
|
32
|
-
switch (_context.prev = _context.next) {
|
|
33
|
-
case 0:
|
|
34
|
-
return _context.abrupt("return", new Promise(function (success) {
|
|
35
|
-
var reader = new FileReader();
|
|
36
|
-
reader.addEventListener("loadend", function () {
|
|
37
|
-
success(reader.result);
|
|
38
|
-
});
|
|
39
|
-
reader.readAsDataURL(file);
|
|
40
|
-
}));
|
|
41
|
-
|
|
42
|
-
case 1:
|
|
43
|
-
case "end":
|
|
44
|
-
return _context.stop();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}, _callee);
|
|
48
|
-
}));
|
|
49
|
-
|
|
50
|
-
return function getBase64(_x) {
|
|
51
|
-
return _ref.apply(this, arguments);
|
|
52
|
-
};
|
|
53
|
-
}();
|
|
54
|
-
/*------------------------
|
|
55
|
-
devolver la data de un string base64
|
|
56
|
-
--------------------------*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
exports.getBase64 = getBase64;
|
|
60
|
-
|
|
61
|
-
var getDataBase64 = function getDataBase64(base64Full) {
|
|
62
|
-
//const base64 = reader.result.replace(/^data:\w+\/\w+.*;base64,/, "");
|
|
63
|
-
try {
|
|
64
|
-
var base64 = base64Full.split("base64,");
|
|
65
|
-
return base64.length ? base64[1] : undefined;
|
|
66
|
-
} catch (err) {
|
|
67
|
-
return undefined;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
/*------------------------
|
|
71
|
-
devolver un data Buffer a partir
|
|
72
|
-
de un data base64
|
|
73
|
-
--------------------------*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
exports.getDataBase64 = getDataBase64;
|
|
77
|
-
|
|
78
|
-
var getDataBuffer = function getDataBuffer(dataBase64) {
|
|
79
|
-
try {
|
|
80
|
-
var dataBuffer = Buffer.from(dataBase64, "base64");
|
|
81
|
-
return dataBuffer;
|
|
82
|
-
} catch (err) {
|
|
83
|
-
return undefined;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
/*------------------------
|
|
87
|
-
devolver la extension de un file
|
|
88
|
-
a partir de un string: "name.ext"
|
|
89
|
-
--------------------------*/
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
exports.getDataBuffer = getDataBuffer;
|
|
93
|
-
|
|
94
|
-
var getFileExtension = function getFileExtension() {
|
|
95
|
-
var fileName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
96
|
-
var nameParts = fileName.split(".");
|
|
97
|
-
var ext = "";
|
|
98
|
-
nameParts.forEach(function (part, index) {
|
|
99
|
-
if (index !== 0) {
|
|
100
|
-
if (index + 1 === nameParts.length) ext += part;else ext += part + ".";
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
return ext === "" ? undefined : ext;
|
|
104
|
-
};
|
|
105
|
-
/*------------------------
|
|
106
|
-
devolver el nombre de un file
|
|
107
|
-
a partir de un string: "name.ext"
|
|
108
|
-
--------------------------*/
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
exports.getFileExtension = getFileExtension;
|
|
112
|
-
|
|
113
|
-
var getFileName = function getFileName() {
|
|
114
|
-
var fileName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
115
|
-
var nameParts = fileName.split(".");
|
|
116
|
-
if (nameParts.length) return nameParts[0];
|
|
117
|
-
return undefined;
|
|
118
|
-
};
|
|
119
|
-
/*------------------------
|
|
120
|
-
obtener la URL de una imagen
|
|
121
|
-
con un peso mas pequeño al
|
|
122
|
-
peso original pasando como
|
|
123
|
-
parametros:
|
|
124
|
-
=> bucket: <string> bucket en donde se ecuentra la img
|
|
125
|
-
=> key: <string> ruta y nombre completa de la img (keyS3)
|
|
126
|
-
=> width: <number> largo de la img en px
|
|
127
|
-
=> height: <number> altura de la img en px
|
|
128
|
-
--------------------------*/
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
exports.getFileName = getFileName;
|
|
132
|
-
|
|
133
|
-
var getImageURL = function getImageURL(bucket, key, width, height) {
|
|
134
|
-
try {
|
|
135
|
-
var configAWS = {
|
|
136
|
-
bucket: bucket,
|
|
137
|
-
key: key,
|
|
138
|
-
edits: {
|
|
139
|
-
resize: {
|
|
140
|
-
width: width,
|
|
141
|
-
height: height,
|
|
142
|
-
fit: "contain",
|
|
143
|
-
background: {
|
|
144
|
-
r: 255,
|
|
145
|
-
g: 255,
|
|
146
|
-
b: 255,
|
|
147
|
-
alpha: 0
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
var url = "https://d24s337exbt5zr.cloudfront.net/";
|
|
153
|
-
url += _jsBase.Base64.encode(JSON.stringify(configAWS));
|
|
154
|
-
return url;
|
|
155
|
-
} catch (err) {
|
|
156
|
-
console.log("ERROR al obtener la URL de la imagen (".concat(key, ")"), err.message);
|
|
157
|
-
return undefined;
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
/*------------------------
|
|
161
|
-
obtener la dimension de una imagen
|
|
162
|
-
a partir de un objeto <File>
|
|
163
|
-
retorno: {
|
|
164
|
-
=> width: <number> largo de la img en px
|
|
165
|
-
=> height: <number> altura de la img en px
|
|
166
|
-
}
|
|
167
|
-
NOTA regresa <undefined> si no se pudo
|
|
168
|
-
obtener la dimension de la imagen
|
|
169
|
-
--------------------------*/
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
exports.getImageURL = getImageURL;
|
|
173
|
-
|
|
174
|
-
var getImageSize = function getImageSize(file) {
|
|
175
|
-
return new Promise( /*#__PURE__*/function () {
|
|
176
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(response) {
|
|
177
|
-
var img, base64;
|
|
178
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
179
|
-
while (1) {
|
|
180
|
-
switch (_context2.prev = _context2.next) {
|
|
181
|
-
case 0:
|
|
182
|
-
img = new Image();
|
|
183
|
-
|
|
184
|
-
img.onload = function () {
|
|
185
|
-
return response({
|
|
186
|
-
width: img.width,
|
|
187
|
-
height: img.height
|
|
188
|
-
});
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
img.onerror = function () {
|
|
192
|
-
return response(undefined);
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
_context2.next = 5;
|
|
196
|
-
return getBase64(file);
|
|
197
|
-
|
|
198
|
-
case 5:
|
|
199
|
-
base64 = _context2.sent;
|
|
200
|
-
img.src = base64;
|
|
201
|
-
|
|
202
|
-
case 7:
|
|
203
|
-
case "end":
|
|
204
|
-
return _context2.stop();
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}, _callee2);
|
|
208
|
-
}));
|
|
209
|
-
|
|
210
|
-
return function (_x2) {
|
|
211
|
-
return _ref2.apply(this, arguments);
|
|
212
|
-
};
|
|
213
|
-
}());
|
|
214
|
-
};
|
|
215
|
-
/*------------------------
|
|
216
|
-
obtener una redimension (height) proporcional
|
|
217
|
-
a la dimension original (height) a partir de
|
|
218
|
-
un width deseado
|
|
219
|
-
retorno:
|
|
220
|
-
=> newHeight: <number> altura de la img en px
|
|
221
|
-
NOTA regresa <undefined> si no se pudo
|
|
222
|
-
obtener el nuevo <height> de la imagen
|
|
223
|
-
--------------------------*/
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
exports.getImageSize = getImageSize;
|
|
227
|
-
|
|
228
|
-
var getResizeImgHeight = function getResizeImgHeight(originalWidth, originalHeight, newWidth) {
|
|
229
|
-
var scale = newWidth * 100 / originalWidth / 100;
|
|
230
|
-
return Math.ceil(originalHeight * scale);
|
|
231
|
-
};
|
|
232
|
-
/*====================================================================
|
|
233
|
-
UTILERIAS PARA EL MANEJO DE FECHAS
|
|
234
|
-
======================================================================*/
|
|
235
|
-
|
|
236
|
-
/*------------------------
|
|
237
|
-
nombres de los dias de la semana
|
|
238
|
-
--------------------------*/
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
exports.getResizeImgHeight = getResizeImgHeight;
|
|
242
|
-
var weekdayName = {
|
|
243
|
-
1: {
|
|
244
|
-
short: "Dom",
|
|
245
|
-
full: "Domingo"
|
|
246
|
-
},
|
|
247
|
-
2: {
|
|
248
|
-
short: "Lun",
|
|
249
|
-
full: "Lunes"
|
|
250
|
-
},
|
|
251
|
-
3: {
|
|
252
|
-
short: "Mar",
|
|
253
|
-
full: "Martes"
|
|
254
|
-
},
|
|
255
|
-
4: {
|
|
256
|
-
short: "Mié",
|
|
257
|
-
full: "Miércoles"
|
|
258
|
-
},
|
|
259
|
-
5: {
|
|
260
|
-
short: "Jue",
|
|
261
|
-
full: "Jueves"
|
|
262
|
-
},
|
|
263
|
-
6: {
|
|
264
|
-
short: "Vie",
|
|
265
|
-
full: "Viernes"
|
|
266
|
-
},
|
|
267
|
-
7: {
|
|
268
|
-
short: "Sab",
|
|
269
|
-
full: "Sabado"
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
/*------------------------
|
|
273
|
-
nombres de los meses
|
|
274
|
-
--------------------------*/
|
|
275
|
-
|
|
276
|
-
var monthName = {
|
|
277
|
-
1: {
|
|
278
|
-
short: "Ene",
|
|
279
|
-
full: "Enero"
|
|
280
|
-
},
|
|
281
|
-
2: {
|
|
282
|
-
short: "Feb",
|
|
283
|
-
full: "Febrero"
|
|
284
|
-
},
|
|
285
|
-
3: {
|
|
286
|
-
short: "Mar",
|
|
287
|
-
full: "Marzo"
|
|
288
|
-
},
|
|
289
|
-
4: {
|
|
290
|
-
short: "Abr",
|
|
291
|
-
full: "Abril"
|
|
292
|
-
},
|
|
293
|
-
5: {
|
|
294
|
-
short: "May",
|
|
295
|
-
full: "Mayo"
|
|
296
|
-
},
|
|
297
|
-
6: {
|
|
298
|
-
short: "Jun",
|
|
299
|
-
full: "Junio"
|
|
300
|
-
},
|
|
301
|
-
7: {
|
|
302
|
-
short: "Jul",
|
|
303
|
-
full: "Julio"
|
|
304
|
-
},
|
|
305
|
-
8: {
|
|
306
|
-
short: "Ago",
|
|
307
|
-
full: "Agosto"
|
|
308
|
-
},
|
|
309
|
-
9: {
|
|
310
|
-
short: "Sep",
|
|
311
|
-
full: "Septiembre"
|
|
312
|
-
},
|
|
313
|
-
10: {
|
|
314
|
-
short: "Oct",
|
|
315
|
-
full: "Octubre"
|
|
316
|
-
},
|
|
317
|
-
11: {
|
|
318
|
-
short: "Nov",
|
|
319
|
-
full: "Noviembre"
|
|
320
|
-
},
|
|
321
|
-
12: {
|
|
322
|
-
short: "Dic",
|
|
323
|
-
full: "Diciembre"
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
/*------------------------
|
|
327
|
-
Obtener una fecha a partir de
|
|
328
|
-
un objeto Date() en formato:
|
|
329
|
-
'DDD dd MMM aaaa'
|
|
330
|
-
ejemplo: 'Ene 12 Jul 2022'
|
|
331
|
-
--------------------------*/
|
|
332
|
-
|
|
333
|
-
var getFullDate = function getFullDate() {
|
|
334
|
-
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
|
|
335
|
-
if (isNaN(date)) return undefined;
|
|
336
|
-
var dateString = "".concat(weekdayName[date.getDay() + 1].short, " ");
|
|
337
|
-
dateString += date.getDate() + " ";
|
|
338
|
-
dateString += "".concat(monthName[date.getMonth() + 1].short, " ");
|
|
339
|
-
dateString += date.getFullYear();
|
|
340
|
-
return dateString;
|
|
341
|
-
};
|
|
342
|
-
/*------------------------
|
|
343
|
-
Obtener una fecha a partir de
|
|
344
|
-
un objeto Date() en formato:
|
|
345
|
-
'aaaa-MM-dd'
|
|
346
|
-
ejemplo: '2022-12-25'
|
|
347
|
-
--------------------------*/
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
exports.getFullDate = getFullDate;
|
|
351
|
-
|
|
352
|
-
var getFormatedDate = function getFormatedDate() {
|
|
353
|
-
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
|
|
354
|
-
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "/";
|
|
355
|
-
if (isNaN(date)) return undefined;
|
|
356
|
-
var dateString = "";
|
|
357
|
-
dateString += date.getFullYear() + separator;
|
|
358
|
-
dateString += date.getMonth() + 1 + separator;
|
|
359
|
-
dateString += date.getDate();
|
|
360
|
-
return dateString;
|
|
361
|
-
};
|
|
362
|
-
/*------------------------
|
|
363
|
-
Obtener una fecha a partir de
|
|
364
|
-
un objeto Date() en formato:
|
|
365
|
-
'dd de MMMM del aaaa'
|
|
366
|
-
ejemplo: '12 de octubre del 2022'
|
|
367
|
-
=> si es la fecha del dia actual:
|
|
368
|
-
devolvera 'Hoy'
|
|
369
|
-
=> si es la fecha del dia de ayer:
|
|
370
|
-
devolvera 'Ayer'
|
|
371
|
-
=> si es fecha del mismo año:
|
|
372
|
-
devolvera '12 de octubre'
|
|
373
|
-
--------------------------*/
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
exports.getFormatedDate = getFormatedDate;
|
|
377
|
-
|
|
378
|
-
var getCustomDate = function getCustomDate() {
|
|
379
|
-
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
|
|
380
|
-
if (isNaN(date)) return "";
|
|
381
|
-
var dateString = date.getDate() + " de ";
|
|
382
|
-
dateString += "".concat(monthName[date.getMonth() + 1].full);
|
|
383
|
-
var today = new Date();
|
|
384
|
-
var yesterday = new Date();
|
|
385
|
-
yesterday.setDate(today.getDate() - 1); // fecha de Hoy
|
|
386
|
-
|
|
387
|
-
if (date.getDate() === today.getDate() && date.getMonth() === today.getMonth() && date.getFullYear() === today.getFullYear()) {
|
|
388
|
-
return "Hoy";
|
|
389
|
-
} // fecha de Ayer
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
if (date.getDate() === yesterday.getDate() && date.getMonth() === yesterday.getMonth() && date.getFullYear() === yesterday.getFullYear()) {
|
|
393
|
-
return "Ayer";
|
|
394
|
-
} // fechas del mismo año
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
if (date.getFullYear() === today.getFullYear()) return dateString; // fechas de diferente año
|
|
398
|
-
|
|
399
|
-
return dateString + " del " + date.getFullYear();
|
|
400
|
-
};
|
|
401
|
-
/*------------------------
|
|
402
|
-
Obtener una hora a partir de
|
|
403
|
-
una fecha string (current_timestamp)
|
|
404
|
-
en formato: 'hh:mm PM/AM'
|
|
405
|
-
ejemplo: '12:34 PM'
|
|
406
|
-
--------------------------*/
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
exports.getCustomDate = getCustomDate;
|
|
410
|
-
|
|
411
|
-
var getTime = function getTime() {
|
|
412
|
-
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
413
|
-
if ([undefined, null, ""].includes(time)) return (0, _moment.default)(new Date()).format("LT");
|
|
414
|
-
return (0, _moment.default)(time).format("LT");
|
|
415
|
-
};
|
|
416
|
-
/*====================================================================
|
|
417
|
-
UTILERIAS PARA EL MANEJO DE VALIDACIONES
|
|
418
|
-
======================================================================*/
|
|
419
|
-
|
|
420
|
-
/*------------------------
|
|
421
|
-
recibe un number o string
|
|
422
|
-
y determina si es numero natural
|
|
423
|
-
0,1,2,...
|
|
424
|
-
--------------------------*/
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
exports.getTime = getTime;
|
|
428
|
-
|
|
429
|
-
var isValidNaturalNumber = function isValidNaturalNumber(number) {
|
|
430
|
-
if ([undefined, null, ""].includes(number)) return false;
|
|
431
|
-
if (!["string", "number"].includes((0, _typeof2.default)(number))) return false;
|
|
432
|
-
|
|
433
|
-
try {
|
|
434
|
-
var numberString = number + "";
|
|
435
|
-
|
|
436
|
-
for (var i = 0; i < numberString.length; i++) {
|
|
437
|
-
if ("0123456789".indexOf(numberString.charAt(i)) === -1) return false;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
return true;
|
|
441
|
-
} catch (err) {
|
|
442
|
-
return false;
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
|
-
/*------------------------
|
|
446
|
-
recibe un array y determina si
|
|
447
|
-
el array esta vacio []
|
|
448
|
-
--------------------------*/
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
exports.isValidNaturalNumber = isValidNaturalNumber;
|
|
452
|
-
|
|
453
|
-
var isArrayEmpty = function isArrayEmpty(array) {
|
|
454
|
-
if (Array.isArray(array) && array.length) return false;
|
|
455
|
-
return true;
|
|
456
|
-
};
|
|
457
|
-
/*------------------------
|
|
458
|
-
recibe un string y determina si
|
|
459
|
-
esta vacio ""
|
|
460
|
-
--------------------------*/
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
exports.isArrayEmpty = isArrayEmpty;
|
|
464
|
-
|
|
465
|
-
var isStringEmpty = function isStringEmpty(cad) {
|
|
466
|
-
if (cad && typeof cad === "string" && cad.trim().length !== 0) return false;
|
|
467
|
-
return true;
|
|
468
|
-
};
|
|
469
|
-
/*------------------------
|
|
470
|
-
recibe un string JSON y lo
|
|
471
|
-
decodifica a su valor original
|
|
472
|
-
--------------------------*/
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
exports.isStringEmpty = isStringEmpty;
|
|
476
|
-
|
|
477
|
-
var decodeJSON = function decodeJSON(valueJSON) {
|
|
478
|
-
try {
|
|
479
|
-
var decodeValue = JSON.parse(valueJSON);
|
|
480
|
-
return decodeValue;
|
|
481
|
-
} catch (err) {
|
|
482
|
-
return valueJSON;
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
/*------------------------
|
|
486
|
-
recibe un dato y determina si
|
|
487
|
-
es objeto JS
|
|
488
|
-
--------------------------*/
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
exports.decodeJSON = decodeJSON;
|
|
492
|
-
|
|
493
|
-
var isObject = function isObject(obj) {
|
|
494
|
-
if (obj && (0, _typeof2.default)(obj) === "object" && !Array.isArray(obj)) return true;
|
|
495
|
-
return false;
|
|
496
|
-
};
|
|
497
|
-
/*------------------------
|
|
498
|
-
recibe un value y lo codifica
|
|
499
|
-
primero a JSON y luego a URI
|
|
500
|
-
--------------------------*/
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
exports.isObject = isObject;
|
|
504
|
-
|
|
505
|
-
var encodeUriJson = function encodeUriJson(value) {
|
|
506
|
-
try {
|
|
507
|
-
var encodeValue = encodeURIComponent(JSON.stringify(value));
|
|
508
|
-
return encodeValue;
|
|
509
|
-
} catch (err) {
|
|
510
|
-
return undefined;
|
|
511
|
-
}
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
exports.encodeUriJson = encodeUriJson;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<svg id="Componente_34_12" data-name="Componente 34 – 12" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
-
<defs>
|
|
3
|
-
<clipPath id="clip-path">
|
|
4
|
-
<rect id="Rectángulo_107" data-name="Rectángulo 107" width="10" height="10" transform="translate(3 3)" fill="#b3b3b3" stroke="#b3b3b3" stroke-width="1"/>
|
|
5
|
-
</clipPath>
|
|
6
|
-
</defs>
|
|
7
|
-
<g id="Rectángulo_287" data-name="Rectángulo 287" fill="#fff" stroke="#f0f0f0" stroke-width="1">
|
|
8
|
-
<rect width="16" height="16" rx="8" stroke="none"/>
|
|
9
|
-
<rect x="0.5" y="0.5" width="15" height="15" rx="7.5" fill="none"/>
|
|
10
|
-
</g>
|
|
11
|
-
<g id="Enmascarar_grupo_79" data-name="Enmascarar grupo 79" clip-path="url(#clip-path)">
|
|
12
|
-
<path id="star_FILL0_wght400_GRAD0_opsz48" d="M4.037,9.438,6,8.262,7.963,9.45,7.438,7.225l1.725-1.5-2.275-.2L6,3.425,5.113,5.512l-2.275.2,1.725,1.5ZM2.912,11l.813-3.512L1,5.125l3.6-.312L6,1.5,7.4,4.813l3.6.313L8.275,7.488,9.087,11,6,9.137ZM6,6.563Z" transform="translate(2 1.5)" fill="#b3b3b3"/>
|
|
13
|
-
</g>
|
|
14
|
-
</svg>
|
|
Binary file
|