easyprintand 1.0.9 → 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.
Files changed (3) hide show
  1. package/INSTRUCCIONES.md +23 -0
  2. package/index.js +24 -37
  3. package/package.json +13 -11
@@ -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,8 +1,5 @@
1
-
2
-
3
-
4
1
  /**
5
- * Version 2.4.1 Copyright (C) 2013
2
+ * Version 2.4.2 Copyright (C) 2013
6
3
  * Tested in IE 11, FF 28.0 and Chrome 33.0.1750.154
7
4
  * No official support for other browsers, but will TRY to accommodate challenges in other browsers.
8
5
  * Example:
@@ -13,7 +10,7 @@
13
10
  * $("div.PrintArea").printArea( [OPTIONS] );
14
11
  * });
15
12
  * </script>
16
- * options are passed as json (example: {mode: "popup", popClose: false})
13
+ * * options are passed as json (example: {mode: "popup", popClose: false})
17
14
  *
18
15
  * {OPTIONS} | [type] | (default), values | Explanation
19
16
  * --------- | --------- | ---------------------- | -----------
@@ -25,6 +22,7 @@
25
22
  * @popTitle | [string] | ('') | popup window title element
26
23
  * @popClose | [boolean] | (false),true | popup window close after printing
27
24
  * @extraCss | [string] | ('') | comma separated list of extra css to include
25
+ * @style | [string] | ('') | raw css string to include in <style> tag
28
26
  * @retainAttr | [string[]] | ["id","class","style"] | string array of attributes to retain for the containment area. (ie: id, style, class)
29
27
  * @standard | [string] | strict, loose, (html5) | Only for popup. For html 4.01, strict or loose document standard, or html 5 standard
30
28
  * @extraHead | [string] | ('') | comma separated list of extra elements to be appended to the head tag
@@ -69,14 +67,18 @@
69
67
 
70
68
  function prindiv ( id_elemento = 'EasyPrintAnd' , options , modo = 'produccion' )
71
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.
72
74
 
73
-
74
-
75
-
76
- var $printSource = document.querySelector("div#" + id_elemento );
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 );
77
79
 
78
80
  if (!$printSource){
79
- console.log("No prindiv no puede imprimir por que \"div#" + id_elemento + "\" No existe");
81
+ console.warn("No prindiv no puede imprimir por que \"div#" + id_elemento + "\" No existe");
80
82
  return false;
81
83
  }
82
84
 
@@ -89,6 +91,7 @@
89
91
  var defaults = { mode : modes.iframe,
90
92
  standard : standards.html5,
91
93
  extraCss : '',
94
+ style : '',
92
95
  defaultCss : false,
93
96
  extraHead : '',
94
97
  retainAttr : ["id","class","style"] };
@@ -202,6 +205,10 @@
202
205
  links += '<link type="text/css" rel="stylesheet" href="' + m + '">'
203
206
  });
204
207
  }
208
+
209
+ if ( settings.style ) {
210
+ links += '<style>' + settings.style + '</style>';
211
+ }
205
212
 
206
213
 
207
214
 
@@ -246,7 +253,7 @@
246
253
 
247
254
  var f = new Iframe();
248
255
 
249
- console.log(f);
256
+ // console.log(f);
250
257
 
251
258
  let data = {
252
259
 
@@ -325,30 +332,10 @@
325
332
 
326
333
 
327
334
  }
328
-
329
-
330
-
331
-
332
-
333
-
334
-
335
-
336
-
337
-
338
-
339
-
340
-
341
-
342
-
343
-
344
-
345
- module.exports = prindiv;
346
-
347
-
348
-
349
-
350
-
351
-
352
-
335
+ export default prindiv;
336
+ export { prindiv };
353
337
 
354
-
338
+ // Para CommonJS (compatibilidad)
339
+ if (typeof module !== 'undefined') {
340
+ module.exports = prindiv;
341
+ }
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
- {
2
- "name": "easyprintand",
3
- "version": "1.0.9",
4
- "description": "Easily print the content of a DIV",
5
- "main": "EasyprintAnd.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "AndresLopez",
10
- "license": "ISC"
11
- }
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
+ }