Commit ba2a223d816332cd025eea9ebc8f2e6605fa44de

Authored by Nicolás Guarnieri
1 parent 5287140275
Exists in master

mejora en tabla de articulos para responsive

1 const gulp = require('gulp'); 1 const gulp = require('gulp');
2 const sass = require('gulp-sass'); 2 const sass = require('gulp-sass');
3 const concat = require('gulp-concat'); 3 const concat = require('gulp-concat');
4 const rename = require('gulp-rename'); 4 const rename = require('gulp-rename');
5 const uglify = require('gulp-uglify-es').default; 5 const uglify = require('gulp-uglify');
6 const pump = require('pump'); 6 const pump = require('pump');
7 const jshint = require('gulp-jshint'); 7 const jshint = require('gulp-jshint');
8 const replace = require('gulp-replace'); 8 const replace = require('gulp-replace');
9 const connect = require('gulp-connect'); 9 const connect = require('gulp-connect');
10 const watch = require('gulp-watch'); 10 const watch = require('gulp-watch');
11 11
12 var paths = { 12 var paths = {
13 srcHTML : 'src/views/*.html', 13 srcHTML : 'src/views/*.html',
14 srcJS : 'src/js/*.js', 14 srcJS : 'src/js/*.js',
15 dist : 'dist/', 15 dist : 'dist/',
16 distHTML : 'dist/views/' 16 distHTML : 'dist/views/'
17 }; 17 };
18 18
19 gulp.task('uglify', function() { 19 gulp.task('uglify', function() {
20 pump( 20 pump(
21 [ 21 [
22 gulp.src(paths.srcJS), 22 gulp.src(paths.srcJS),
23 concat('wrapper-demo.js'), 23 concat('wrapper-demo.js'),
24 replace('/src/', '/dist/'), 24 replace('/src/', '/dist/'),
25 gulp.dest(paths.dist), 25 gulp.dest(paths.dist),
26 rename('wrapper-demo.min.js'), 26 rename('wrapper-demo.min.js'),
27 uglify(), 27 uglify(),
28 gulp.dest(paths.dist) 28 gulp.dest(paths.dist)
29 ] 29 ]
30 ); 30 );
31 }); 31 });
32 32
33 gulp.task('html', function() { 33 gulp.task('html', function() {
34 pump([ 34 pump([
35 gulp.src('index.html'), 35 gulp.src('index.html'),
36 replace(/\<!\-\- BUILD \-\-\>.*\<!\-\- \/BUILD \-\-\>/sgm, '<script src="wrapper-demo.min.js"></script>'), 36 replace(/\<!\-\- BUILD \-\-\>.*\<!\-\- \/BUILD \-\-\>/sgm, '<script src="wrapper-demo.min.js"></script>'),
37 gulp.dest(paths.dist) 37 gulp.dest(paths.dist)
38 ]); 38 ]);
39 pump([ 39 pump([
40 gulp.src(paths.srcHTML), 40 gulp.src(paths.srcHTML),
41 gulp.dest(paths.distHTML) 41 gulp.dest(paths.distHTML)
42 ]); 42 ]);
43 }) 43 })
44 44
45 gulp.task('sass', function() { 45 gulp.task('sass', function() {
46 return gulp.src('src/sass/*.scss') 46 return gulp.src('src/sass/*.scss')
47 .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) 47 .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
48 .pipe(gulp.dest('css')); 48 .pipe(gulp.dest('css'));
49 }); 49 });
50 50
51 gulp.task('pre-commit', function() { 51 gulp.task('pre-commit', function() {
52 pump( 52 pump(
53 [ 53 [
54 gulp.src(paths.srcJS), 54 gulp.src(paths.srcJS),
55 jshint('.jshintrc'), 55 jshint('.jshintrc'),
56 jshint.reporter('default'), 56 jshint.reporter('default'),
57 jshint.reporter('fail') 57 jshint.reporter('fail')
58 ] 58 ]
59 ); 59 );
60 gulp.start('uglify'); 60 gulp.start('uglify');
61 gulp.start('sass'); 61 gulp.start('sass');
62 }); 62 });
63 63
64 gulp.task('webserver', function() { 64 gulp.task('webserver', function() {
65 pump [ 65 pump [
66 connect.server( 66 connect.server(
67 { 67 {
68 port: 3000, 68 port: 3000,
69 host: '0.0.0.0' 69 host: '0.0.0.0',
70 livereload: true
70 } 71 }
71 ) 72 )
72 ] 73 ]
73 }); 74 });
74 75
75 gulp.task('watch', function() { 76 gulp.task('watch', function() {
76 gulp.watch([paths.srcJS], ['uglify']); 77 //gulp.watch([paths.srcJS], ['uglify']);
77 gulp.watch('src/sass/*.scss', ['sass']); 78 gulp.watch('src/sass/*.scss', ['sass']);
78 }) 79 })
79 80
80 gulp.task('reload'), function() { 81 gulp.task('reload'), function() {
81 connect.reload(); 82 connect.reload();
82 } 83 }
83 84
84 gulp.task('livereload', function() { 85 gulp.task('livereload', function() {
85 gulp.watch('css/*.css', ['reload']); 86 gulp.watch('css/*.css', ['reload']);
86 gulp.watch('js/dist/*.js', ['reload']); 87 gulp.watch('js/dist/*.js', ['reload']);
87 gulp.watch('vistas/**/*.html', ['reload']); 88 gulp.watch('vistas/**/*.html', ['reload']);
88 }); 89 });
89 90
90 gulp.task('default', ['webserver']); 91 gulp.task('default', ['webserver', 'livereload', 'watch']);
91 92
1 { 1 {
2 "name": "wrapper-demo", 2 "name": "wrapper-demo",
3 "version": "0.0.1", 3 "version": "0.0.1",
4 "description": "", 4 "description": "",
5 "main": "main.js", 5 "main": "main.js",
6 "scripts": { 6 "scripts": {
7 "initdev": "npm install gulp --global && npm install && npm install -g jshint", 7 "initdev": "npm install gulp --global && npm install && npm install -g jshint",
8 "gulp-pre-commit": "gulp pre-commit", 8 "gulp-pre-commit": "gulp pre-commit",
9 "compile": "gulp uglify && gulp sass", 9 "compile": "gulp uglify && gulp sass",
10 "electron": "electron .", 10 "electron": "electron .",
11 "electron-build": "gulp uglify && gulp html && gulp sass && electron ." 11 "electron-build": "gulp uglify && gulp html && gulp sass && electron ."
12 }, 12 },
13 "pre-commit": [ 13 "pre-commit": [
14 "gulp-pre-commit" 14 "gulp-pre-commit"
15 ], 15 ],
16 "repository": { 16 "repository": {
17 "type": "git", 17 "type": "git",
18 "url": "https://debo.suite.repo/Wrappers/wrapper-demo.git" 18 "url": "https://debo.suite.repo/Wrappers/wrapper-demo.git"
19 }, 19 },
20 "author": "Foca Software", 20 "author": "Foca Software",
21 "license": "ISC", 21 "license": "ISC",
22 "dependencies": { 22 "dependencies": {
23 "angular": "^1.7.5", 23 "angular": "^1.7.5",
24 "angular-cookies": "^1.7.5", 24 "angular-cookies": "^1.7.5",
25 "angular-i18n": "^1.7.5", 25 "angular-i18n": "^1.7.5",
26 "angular-on-screen-keyboard": "git+https://github.com/ericf97/angular-on-screen-keyboard.git", 26 "angular-on-screen-keyboard": "git+https://github.com/ericf97/angular-on-screen-keyboard.git",
27 "angular-route": "^1.7.5", 27 "angular-route": "^1.7.5",
28 "angular-sanitize": "^1.7.5", 28 "angular-sanitize": "^1.7.5",
29 "bootstrap": "^4.1.3", 29 "bootstrap": "^4.1.3",
30 "foca-abm-plazo-pago": "git+https://debo.suite.repo/modulos-npm/foca-abm-plazo-pago.git", 30 "foca-abm-plazo-pago": "git+https://debo.suite.repo/modulos-npm/foca-abm-plazo-pago.git",
31 "foca-abm-precios-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-abm-precios-condiciones.git", 31 "foca-abm-precios-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-abm-precios-condiciones.git",
32 "foca-abm-sectores": "git+https://debo.suite.repo/modulos-npm/foca-abm-sectores", 32 "foca-abm-sectores": "git+https://debo.suite.repo/modulos-npm/foca-abm-sectores",
33 "foca-botonera-principal": "git+https://debo.suite.repo/modulos-npm/foca-botonera-principal.git", 33 "foca-botonera-principal": "git+https://debo.suite.repo/modulos-npm/foca-botonera-principal.git",
34 "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", 34 "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git",
35 "foca-crear-nota-pedido": "git+https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido.git", 35 "foca-crear-nota-pedido": "git+https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido.git",
36 "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", 36 "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git",
37 "foca-login": "git+https://debo.suite.repo/modulos-npm/foca-login.git", 37 "foca-login": "git+https://debo.suite.repo/modulos-npm/foca-login.git",
38 "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal", 38 "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal",
39 "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", 39 "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos",
40 "foca-modal-domicilio": "git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git", 40 "foca-modal-domicilio": "git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git",
41 "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete.git", 41 "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete.git",
42 "foca-modal-moneda": "git+https://debo.suite.repo/modulos-npm/foca-modal-moneda.git", 42 "foca-modal-moneda": "git+https://debo.suite.repo/modulos-npm/foca-modal-moneda.git",
43 "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", 43 "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git",
44 "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", 44 "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git",
45 "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", 45 "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git",
46 "foca-teclado": "git+https://debo.suite.repo/modulos-npm/foca-teclado.git", 46 "foca-teclado": "git+https://debo.suite.repo/modulos-npm/foca-teclado.git",
47 "foca-turno-apertura": "git+https://debo.suite.repo/modulos-npm/foca-turno-apertura.git", 47 "foca-turno-apertura": "git+https://debo.suite.repo/modulos-npm/foca-turno-apertura.git",
48 "font-awesome": "^4.7.0", 48 "font-awesome": "^4.7.0",
49 "gulp-angular-templatecache": "^2.2.1", 49 "gulp-angular-templatecache": "^2.2.1",
50 "gulp-htmlmin": "^5.0.1", 50 "gulp-htmlmin": "^5.0.1",
51 "gulp-uglify": "^3.0.1", 51 "gulp-uglify": "^3.0.1",
52 "jquery": "^3.3.1", 52 "jquery": "^3.3.1",
53 "node-sass": "^4.9.4", 53 "node-sass": "^4.9.4",
54 "uglify": "^0.1.5", 54 "uglify": "^0.1.5",
55 "ui-bootstrap4": "^3.0.5" 55 "ui-bootstrap4": "^3.0.5"
56 }, 56 },
57 "devDependencies": { 57 "devDependencies": {
58 "electron": "^3.0.2", 58 "electron": "^3.0.2",
59 "gulp": "^3.9.1", 59 "gulp": "^3.9.1",
60 "gulp-clean": "^0.4.0", 60 "gulp-clean": "^0.4.0",
61 "gulp-concat": "^2.6.1", 61 "gulp-concat": "^2.6.1",
62 "gulp-connect": "^5.6.1", 62 "gulp-connect": "^5.6.1",
63 "gulp-jshint": "^2.1.0", 63 "gulp-jshint": "^2.1.0",
64 "gulp-rename": "^1.4.0", 64 "gulp-rename": "^1.4.0",
65 "gulp-replace": "^1.0.0", 65 "gulp-replace": "^1.0.0",
66 "gulp-sass": "^4.0.1", 66 "gulp-sass": "^4.0.1",
67 "gulp-uglify-es": "^1.0.4", 67 "gulp-uglify": "^1.0.4",
68 "gulp-watch": "^5.0.1", 68 "gulp-watch": "^5.0.1",
69 "jasmine-core": "^3.2.1", 69 "jasmine-core": "^3.2.1",
70 "jshint": "^2.9.6", 70 "jshint": "^2.9.6",
71 "pre-commit": "^1.2.2", 71 "pre-commit": "^1.2.2",
72 "pump": "^3.0.0" 72 "pump": "^3.0.0"
73 } 73 }
74 } 74 }
75 75
src/sass/_panel-informativo.scss
1 .panel-informativo { 1 .panel-informativo {
2 background: linear-gradient(#ccc, #eee); 2 background: linear-gradient(#ccc, #eee);
3 min-height: 32px; 3 min-height: 32px;
4 .form-group { 4 .form-group {
5 margin-bottom: 5px; 5 margin-bottom: 5px;
6 } 6 }
7 .form-control-xs { 7 .form-control-xs {
8 height: calc(1.6rem); 8 height: calc(1.6rem);
9 padding: .25rem .5rem; 9 padding: .25rem .5rem;
10 font-size: .8rem; 10 font-size: .8rem;
11 line-height: 1.3; 11 line-height: 1.3;
12 border-radius: .2rem; 12 border-radius: .2rem;
13 } 13 }
14 .label { 14 .label {
15 font-size: .8em; 15 font-size: .8em;
16 } 16 }
17 .valor { 17 .valor {
18 font-size: .8em; 18 font-size: .8em;
19 } 19 }
20
21 .nota-pedido {
22 @media (max-width: 576px) {
23 text-align: center;
24 }
25 }
26
27 .numero-pedido {
28 @media (min-width: 576px) {
29 text-align: center;
30 }
31 }
20 } 32 }
21 33
src/sass/_tabla-articulos.scss
1 .tabla-articulo { 1 .tabla-articulo {
2 max-height: 420px; 2 max-height: 420px;
3 display: -moz-groupbox;
4 width: 100%;
5 display: block;
6 3
7 tr { 4 tr {
8 width: 100%;
9 display: inline-table; 5 display: inline-table;
10 table-layout: fixed; 6 table-layout: fixed;
11 } 7 }
12 8
13 tbody { 9 tbody {
14 overflow-y: auto; 10 overflow-y: auto;
15 max-height: 280px; 11 max-height: 280px;
16 width: 100%;
17 display: block; 12 display: block;
18 } 13 }
19 14
20 &-numero {
21 width: 25px;
22 }
23
24 &-codigo {
25 width: 70px;
26 }
27
28 &-descripcion {
29 width: 250px;
30 }
31
32 &-cantidad {
33 width: 100px;
34 }
35
36 &-precio {
37 width: 130px;
38 }
39
40 &-subtotal {
41 width: 130px;
42 }
43
44 &-boton {
45 width: 52px;
46 }
47 } 15 }
48 16