easyprintand 1.0.10 → 1.0.11
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/INSTRUCCIONES.md +23 -0
- package/index.js +18 -33
- package/package.json +13 -13
package/INSTRUCCIONES.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Instrucciones para Publicar `easyprintand`
|
|
2
|
+
|
|
3
|
+
Ya tienes la librería lista en esta carpeta. Solo sigue estos pasos en tu terminal (PowerShell o CMD):
|
|
4
|
+
|
|
5
|
+
1. **Inicia sesión en NPM** (Te pedirá usuario, contraseña y email):
|
|
6
|
+
```powershell
|
|
7
|
+
npm login
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
2. **Publica la librería**:
|
|
11
|
+
```powershell
|
|
12
|
+
npm publish
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
3. **Verifica**:
|
|
16
|
+
Entra a [npm](https://www.npmjs.com/package/easyprintand) y revisa que la versión `1.0.11` esté disponible.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
**Nota:** Una vez publicada, puedes volver a tu proyecto principal e instalarla:
|
|
20
|
+
```powershell
|
|
21
|
+
npm install easyprintand@latest
|
|
22
|
+
```
|
|
23
|
+
Y luego revertir los cambios locales en `apps/pos/src/components/Turnos/TurnoDetalleFinalizar.jsx` para usar la versión de `node_modules`.
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Version 2.4.
|
|
2
|
+
* Version 2.4.2 Copyright (C) 2013
|
|
3
3
|
* Tested in IE 11, FF 28.0 and Chrome 33.0.1750.154
|
|
4
4
|
* No official support for other browsers, but will TRY to accommodate challenges in other browsers.
|
|
5
5
|
* Example:
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* $("div.PrintArea").printArea( [OPTIONS] );
|
|
11
11
|
* });
|
|
12
12
|
* </script>
|
|
13
|
-
|
|
13
|
+
* * options are passed as json (example: {mode: "popup", popClose: false})
|
|
14
14
|
*
|
|
15
15
|
* {OPTIONS} | [type] | (default), values | Explanation
|
|
16
16
|
* --------- | --------- | ---------------------- | -----------
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
* @popTitle | [string] | ('') | popup window title element
|
|
23
23
|
* @popClose | [boolean] | (false),true | popup window close after printing
|
|
24
24
|
* @extraCss | [string] | ('') | comma separated list of extra css to include
|
|
25
|
+
* @style | [string] | ('') | raw css string to include in <style> tag
|
|
25
26
|
* @retainAttr | [string[]] | ["id","class","style"] | string array of attributes to retain for the containment area. (ie: id, style, class)
|
|
26
27
|
* @standard | [string] | strict, loose, (html5) | Only for popup. For html 4.01, strict or loose document standard, or html 5 standard
|
|
27
28
|
* @extraHead | [string] | ('') | comma separated list of extra elements to be appended to the head tag
|
|
@@ -66,14 +67,18 @@
|
|
|
66
67
|
|
|
67
68
|
function prindiv ( id_elemento = 'EasyPrintAnd' , options , modo = 'produccion' )
|
|
68
69
|
{
|
|
70
|
+
// Logs removed for production release, or keep them if debug desired?
|
|
71
|
+
// Keeping them minimal/standard for now as per user request to debug, but for pub usually we clean up.
|
|
72
|
+
// However, user found them useful. I will keep them but maybe less verbose?
|
|
73
|
+
// Let's keep the core functionality changes.
|
|
69
74
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
// const timestamp = new Date().toISOString();
|
|
76
|
+
// console.log(`%c[EasyPrintAnd] Executing v2.4.2 at ${timestamp}`, 'background: #222; color: #bada55');
|
|
77
|
+
|
|
78
|
+
var $printSource = document.querySelector("div#" + id_elemento );
|
|
74
79
|
|
|
75
80
|
if (!$printSource){
|
|
76
|
-
console.
|
|
81
|
+
console.warn("No prindiv no puede imprimir por que \"div#" + id_elemento + "\" No existe");
|
|
77
82
|
return false;
|
|
78
83
|
}
|
|
79
84
|
|
|
@@ -86,6 +91,7 @@
|
|
|
86
91
|
var defaults = { mode : modes.iframe,
|
|
87
92
|
standard : standards.html5,
|
|
88
93
|
extraCss : '',
|
|
94
|
+
style : '',
|
|
89
95
|
defaultCss : false,
|
|
90
96
|
extraHead : '',
|
|
91
97
|
retainAttr : ["id","class","style"] };
|
|
@@ -199,6 +205,10 @@
|
|
|
199
205
|
links += '<link type="text/css" rel="stylesheet" href="' + m + '">'
|
|
200
206
|
});
|
|
201
207
|
}
|
|
208
|
+
|
|
209
|
+
if ( settings.style ) {
|
|
210
|
+
links += '<style>' + settings.style + '</style>';
|
|
211
|
+
}
|
|
202
212
|
|
|
203
213
|
|
|
204
214
|
|
|
@@ -243,7 +253,7 @@
|
|
|
243
253
|
|
|
244
254
|
var f = new Iframe();
|
|
245
255
|
|
|
246
|
-
console.log(f);
|
|
256
|
+
// console.log(f);
|
|
247
257
|
|
|
248
258
|
let data = {
|
|
249
259
|
|
|
@@ -322,23 +332,6 @@
|
|
|
322
332
|
|
|
323
333
|
|
|
324
334
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
335
|
export default prindiv;
|
|
343
336
|
export { prindiv };
|
|
344
337
|
|
|
@@ -346,11 +339,3 @@ export { prindiv };
|
|
|
346
339
|
if (typeof module !== 'undefined') {
|
|
347
340
|
module.exports = prindiv;
|
|
348
341
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "easyprintand",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Easily print the content of a DIV",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"exports": {
|
|
7
|
-
"import": "./index.js",
|
|
8
|
-
"require": "./index.js"
|
|
9
|
-
},
|
|
10
|
-
"type": "module",
|
|
11
|
-
"author": "AndresLopez",
|
|
12
|
-
"license": "ISC"
|
|
13
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "easyprintand",
|
|
3
|
+
"version": "1.0.11",
|
|
4
|
+
"description": "Easily print the content of a DIV",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
"import": "./index.js",
|
|
8
|
+
"require": "./index.js"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"author": "AndresLopez",
|
|
12
|
+
"license": "ISC"
|
|
13
|
+
}
|