desy-html 8.13.1 → 9.0.1
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/config/tailwind.config.js +189 -189
- package/docs/_global.foot.njk +1 -0
- package/docs/_include.template-header.njk +5 -0
- package/docs/_macro.example-render.njk +4 -0
- package/docs/componentes.html +3 -0
- package/docs/ds/_ds.section.layout.njk +5 -0
- package/docs/examples-datepicker.html +8 -0
- package/docs/index.html +10 -0
- package/gulpfile.js +32 -36
- package/package.json +9 -2
- package/src/css/styles.css +1 -0
- package/src/js/cally.js +1114 -0
- package/src/js/desy-html.js +88 -0
- package/src/js/filters/filter-caller.js +2 -2
- package/src/js/filters/filter-slugify.js +2 -2
- package/src/js/filters/highlight.js +4 -4
- package/src/js/filters/index.js +6 -5
- package/src/js/globals/get-html-code-from-example.js +8 -6
- package/src/js/globals/get-html-code-from-file.js +7 -7
- package/src/js/globals/get-nunjucks-code-from-example.js +9 -10
- package/src/js/globals/get-nunjucks-code-from-file.js +6 -6
- package/src/js/globals/index.js +6 -6
- package/src/js/index.js +3 -1
- package/src/templates/components/datepicker/_examples.datepicker.njk +347 -0
- package/src/templates/components/datepicker/_macro.datepicker.njk +3 -0
- package/src/templates/components/datepicker/_styles.datepicker.css +85 -0
- package/src/templates/components/datepicker/_template.datepicker.njk +124 -0
- package/src/templates/components/datepicker/params.datepicker.yaml +105 -0
package/gulpfile.js
CHANGED
|
@@ -1,45 +1,50 @@
|
|
|
1
1
|
// https://github.com/idmytro/tailwindcss-gulp-starter
|
|
2
2
|
// https://gist.github.com/taylorbryant/91fc05b12472a88a8b6494f610647cd4
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
import gulp from 'gulp';
|
|
5
|
+
import sourcemaps from 'gulp-sourcemaps';
|
|
6
|
+
import clean from 'gulp-clean';
|
|
7
|
+
import nunjucksRender from 'gulp-nunjucks-render';
|
|
8
|
+
import browserSyncPackage from 'browser-sync';
|
|
9
|
+
import postcss from 'gulp-postcss';
|
|
10
|
+
import atimport from 'postcss-import';
|
|
11
|
+
import stripCssComments from 'gulp-strip-css-comments';
|
|
12
|
+
import footer from 'gulp-footer';
|
|
13
|
+
import tailwindcss from 'tailwindcss';
|
|
14
|
+
import tailwindcssNesting from 'tailwindcss/nesting/index.js';
|
|
15
|
+
import autoprefixer from 'autoprefixer';
|
|
16
|
+
import babel from 'gulp-babel';
|
|
17
|
+
|
|
18
|
+
import { SOURCE_NUNJUCKS_GLOBALS } from './src/js/globals/index.js';
|
|
19
|
+
import { SOURCE_NUNJUCKS_FILTERS } from './src/js/filters/index.js';
|
|
20
|
+
|
|
21
|
+
import { series } from 'gulp';
|
|
22
|
+
|
|
23
|
+
const browserSync = browserSyncPackage.create();
|
|
16
24
|
|
|
17
25
|
const TAILWIND_CONFIG = './config/tailwind.config.js';
|
|
18
26
|
const SOURCE_HTML_DIR = './docs/**.html';
|
|
19
27
|
const SOURCE_NUNJUCKS_PATHS = ['./src/templates/','./docs/'];
|
|
20
28
|
const SOURCE_NUNJUCKS_FILES = ['./src/templates/**/*','./docs/**/*'];
|
|
21
29
|
const SOURCE_NUNJUCKS_DIR = './docs/**/*.html';
|
|
22
|
-
const SOURCE_JS_FILES = ['./src
|
|
30
|
+
const SOURCE_JS_FILES = ['./src/**/*.js','!./src/js/globals/**', '!./src/js/filters/**'];
|
|
23
31
|
const SOURCE_STYLESHEET = './src/css/styles.css';
|
|
24
32
|
const SOURCE_STYLESHEET_DIR = './src/**/*.css';
|
|
25
|
-
const SOURCE_NUNJUCKS_GLOBALS = require('./src/js/globals/index.js');
|
|
26
|
-
const SOURCE_NUNJUCKS_FILTERS = require('./src/js/filters/index.js');
|
|
27
33
|
const DESTINATION_HTML_DIR = './dist/';
|
|
28
34
|
const DESTINATION_JS_DIR = './dist/';
|
|
29
35
|
const DESTINATION_STYLESHEET = './dist/css/';
|
|
30
36
|
|
|
31
|
-
|
|
32
37
|
const manageEnvironment = function(environment) {
|
|
33
38
|
// Custom globals
|
|
34
39
|
for (const key in SOURCE_NUNJUCKS_GLOBALS) {
|
|
35
|
-
environment.addGlobal(key, SOURCE_NUNJUCKS_GLOBALS[key])
|
|
40
|
+
environment.addGlobal(key, SOURCE_NUNJUCKS_GLOBALS[key]);
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
// Custom filters
|
|
39
44
|
for (const key in SOURCE_NUNJUCKS_FILTERS) {
|
|
40
|
-
environment.addFilter(key, SOURCE_NUNJUCKS_FILTERS[key])
|
|
45
|
+
environment.addFilter(key, SOURCE_NUNJUCKS_FILTERS[key]);
|
|
41
46
|
}
|
|
42
|
-
}
|
|
47
|
+
};
|
|
43
48
|
|
|
44
49
|
function bs(cb) {
|
|
45
50
|
browserSync.init({
|
|
@@ -52,27 +57,24 @@ function bs(cb) {
|
|
|
52
57
|
cb();
|
|
53
58
|
}
|
|
54
59
|
|
|
55
|
-
|
|
56
60
|
function watchFiles(cb) {
|
|
57
61
|
gulp.watch([TAILWIND_CONFIG, SOURCE_STYLESHEET_DIR, SOURCE_HTML_DIR, ...SOURCE_JS_FILES, SOURCE_NUNJUCKS_DIR, ...SOURCE_NUNJUCKS_FILES], gulp.series(html, nunjucks, js, css, reload));
|
|
58
62
|
cb();
|
|
59
63
|
}
|
|
60
64
|
|
|
61
|
-
|
|
62
65
|
function reload(cb) {
|
|
63
66
|
browserSync.reload();
|
|
64
67
|
cb();
|
|
65
68
|
}
|
|
66
69
|
|
|
67
|
-
|
|
68
70
|
function css() {
|
|
69
71
|
return gulp.src(SOURCE_STYLESHEET)
|
|
70
72
|
.pipe(
|
|
71
73
|
postcss([
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
atimport(),
|
|
75
|
+
tailwindcssNesting(),
|
|
76
|
+
tailwindcss(TAILWIND_CONFIG),
|
|
77
|
+
autoprefixer()
|
|
76
78
|
])
|
|
77
79
|
)
|
|
78
80
|
.pipe(stripCssComments({preserve: false}))
|
|
@@ -80,13 +82,11 @@ function css() {
|
|
|
80
82
|
.pipe(gulp.dest(DESTINATION_STYLESHEET));
|
|
81
83
|
}
|
|
82
84
|
|
|
83
|
-
|
|
84
85
|
function html() {
|
|
85
86
|
return gulp.src(SOURCE_HTML_DIR)
|
|
86
87
|
.pipe(gulp.dest(DESTINATION_HTML_DIR));
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
|
|
90
90
|
function nunjucks() {
|
|
91
91
|
return gulp.src(SOURCE_NUNJUCKS_DIR)
|
|
92
92
|
.pipe(nunjucksRender({
|
|
@@ -102,30 +102,26 @@ function nunjucks() {
|
|
|
102
102
|
.pipe(gulp.dest(DESTINATION_HTML_DIR));
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
|
|
106
105
|
function js() {
|
|
107
|
-
return gulp.src(SOURCE_JS_FILES)
|
|
106
|
+
return gulp.src(SOURCE_JS_FILES, { sourcemaps: true })
|
|
107
|
+
.pipe(babel())
|
|
108
108
|
.pipe(gulp.dest(DESTINATION_JS_DIR));
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
|
|
112
111
|
function version() {
|
|
113
112
|
return gulp.src('./package.json')
|
|
114
113
|
.pipe(gulp.dest('./dist/'));
|
|
115
114
|
}
|
|
116
115
|
|
|
117
|
-
|
|
118
116
|
function license() {
|
|
119
117
|
return gulp.src('./src/EUPL-1.2.txt')
|
|
120
118
|
.pipe(gulp.dest('./dist/'));
|
|
121
119
|
}
|
|
122
120
|
|
|
123
|
-
|
|
124
121
|
function cleanFolder() {
|
|
125
122
|
return gulp.src(DESTINATION_HTML_DIR, {read: false, allowEmpty: true})
|
|
126
123
|
.pipe(clean());
|
|
127
124
|
}
|
|
128
125
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
exports.prod = series(cleanFolder, html, nunjucks, js, css, license, version, bs);
|
|
126
|
+
export default series(cleanFolder, html, nunjucks, js, css, license, version, bs, watchFiles);
|
|
127
|
+
export const prod = series(cleanFolder, html, nunjucks, js, css, license, version, bs);
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "desy-html",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"description": "desy-html contains the code you need to start building a user interface for Gobierno de Aragón government webapps.",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"author": {
|
|
6
7
|
"name": "Desy (SDA Servicios Digitales de Aragón)",
|
|
7
8
|
"email": "sda@aragon.es"
|
|
@@ -43,13 +44,19 @@
|
|
|
43
44
|
"tailwindcss": "^3.4.3"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
47
|
+
"@babel/core": "^7.24.6",
|
|
48
|
+
"@babel/preset-env": "^7.24.6",
|
|
49
|
+
"@babel/register": "^7.24.6",
|
|
50
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
46
51
|
"browser-sync": "^2.26.13",
|
|
47
|
-
"gulp": "^
|
|
52
|
+
"gulp": "^5.0.0",
|
|
53
|
+
"gulp-babel": "^8.0.0",
|
|
48
54
|
"gulp-clean": "^0.4.0",
|
|
49
55
|
"gulp-clean-css": "^4.3.0",
|
|
50
56
|
"gulp-footer": "^2.0.2",
|
|
51
57
|
"gulp-nunjucks-render": "^2.2.3",
|
|
52
58
|
"gulp-postcss": "^9.0.1",
|
|
59
|
+
"gulp-sourcemaps": "^3.0.0",
|
|
53
60
|
"gulp-strip-css-comments": "^2.0.0",
|
|
54
61
|
"js-beautify": "^1.14.7",
|
|
55
62
|
"outdent": "^0.8.0"
|
package/src/css/styles.css
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
@import "../templates/components/button-loader/_styles.button-loader.css";
|
|
22
22
|
@import "../templates/components/checkboxes/_styles.checkboxes.css";
|
|
23
23
|
@import "../templates/components/collapsible/_styles.collapsible.css";
|
|
24
|
+
@import "../templates/components/datepicker/_styles.datepicker.css";
|
|
24
25
|
@import "../templates/components/dialog/_styles.dialog.css";
|
|
25
26
|
@import "../templates/components/dropdown/_styles.dropdown.css";
|
|
26
27
|
@import "../templates/components/footer/_styles.footer.css";
|