@hcd-bsas/list-documents-adapter 0.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/dist/ListDocuments.min.js +246 -0
- package/exampleJavascript.html +40 -0
- package/exampleVue2.html +40 -0
- package/package.json +37 -0
- package/readme.md +3 -0
- package/src/App.vue +21 -0
- package/src/index.js +34 -0
- package/webpack.config.js +54 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>TEST</title>
|
|
8
|
+
<link rel="stylesheet" href="node_modules/hcd-bootstrap/dist/hcd-bootstrap.min.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
|
|
12
|
+
<button onclick="prueba()">Prueba</button>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
</body>
|
|
16
|
+
<footer>
|
|
17
|
+
<script src="node_modules/hcd-bootstrap/dist/hcd-bootstrap.min.js"></script>
|
|
18
|
+
<script src="dist/ListDocuments.min.js"></script>
|
|
19
|
+
<script>
|
|
20
|
+
var list = new ImagesList({
|
|
21
|
+
base_url: "http://localhost/admin",
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
function prueba(){
|
|
25
|
+
list.open({
|
|
26
|
+
title: "Listado de imagenes escaneadas en Rhys"
|
|
27
|
+
},{
|
|
28
|
+
id_tabla: 1,
|
|
29
|
+
id_tabla_reg: 22264,
|
|
30
|
+
id_dependen_responsable: 54,
|
|
31
|
+
id_pers_reso: 23956,
|
|
32
|
+
campo_escan: "INASISTE"
|
|
33
|
+
})
|
|
34
|
+
.then((response) => {
|
|
35
|
+
console.log(response)
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
</footer>
|
|
40
|
+
</html>
|
package/exampleVue2.html
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<link rel="stylesheet" href="node_modules/hcd-list/dist/list-files.css">
|
|
8
|
+
<title>TEST</title>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
|
|
12
|
+
<div id="test-list-plugin-vue2"></div>
|
|
13
|
+
|
|
14
|
+
<script src="./dist/vue.js"></script>
|
|
15
|
+
<script src="./node_modules/hcd-list/dist/list-files.umd.js"></script>
|
|
16
|
+
<script>
|
|
17
|
+
Vue.use(list-files);
|
|
18
|
+
var vue = new Vue({
|
|
19
|
+
el: '#test-list-plugin-vue2', // <-- Id del componente padre que incluye la aplicacion vue para que se instancie
|
|
20
|
+
data: {
|
|
21
|
+
nombre_atributo: {
|
|
22
|
+
// valores
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
computed: {},
|
|
26
|
+
created() {
|
|
27
|
+
// Se ejecuta al crear la instancia vue
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
metodo_de_ejemplo() {}
|
|
31
|
+
},
|
|
32
|
+
watch: {
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</script>
|
|
39
|
+
</body>
|
|
40
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hcd-bsas/list-documents-adapter",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"main": "dist/ListDocuments.min.js",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"babel-loader": "^8.2.5",
|
|
12
|
+
"browserify": "^17.0.0",
|
|
13
|
+
"css-loader": "^6.7.1",
|
|
14
|
+
"file-loader": "^6.2.0",
|
|
15
|
+
"hcd-list": "^0.3.1",
|
|
16
|
+
"html-loader": "^3.1.0",
|
|
17
|
+
"mini-css-extract-plugin": "^2.6.1",
|
|
18
|
+
"postcss": "^8.4.14",
|
|
19
|
+
"postcss-loader": "^7.0.0",
|
|
20
|
+
"sass-loader": "^13.0.2",
|
|
21
|
+
"style-loader": "^3.3.1",
|
|
22
|
+
"uglifyjs-webpack-plugin": "^2.2.0",
|
|
23
|
+
"url-loader": "^4.1.1",
|
|
24
|
+
"vue": "^3.2.37",
|
|
25
|
+
"vue-loader": "^17.0.0",
|
|
26
|
+
"vue-style-loader": "^4.1.3",
|
|
27
|
+
"vue-template-compiler": "^2.6.14",
|
|
28
|
+
"webpack": "^5.72.1",
|
|
29
|
+
"webpack-cli": "^4.9.2"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"hcd-bootstrap": "^0.0.13"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "webpack"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/readme.md
ADDED
package/src/App.vue
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<list-files ref="list"></list-files>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
export default {
|
|
7
|
+
name: "App",
|
|
8
|
+
props: {},
|
|
9
|
+
data() {
|
|
10
|
+
return {
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
created() {
|
|
14
|
+
},
|
|
15
|
+
methods: {
|
|
16
|
+
showModal(app_config, params) {
|
|
17
|
+
return this.$refs['list'].show(app_config, params);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
</script>
|
package/src/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createApp } from 'vue'
|
|
2
|
+
import App from './App.vue'
|
|
3
|
+
import hcdListPlugin from 'hcd-list'
|
|
4
|
+
|
|
5
|
+
export default class ImagesList {
|
|
6
|
+
|
|
7
|
+
#imagesListId = "hcd-list-plugin-id";
|
|
8
|
+
#app = null
|
|
9
|
+
#root = null;
|
|
10
|
+
|
|
11
|
+
constructor(config) {
|
|
12
|
+
try {
|
|
13
|
+
this.#render();
|
|
14
|
+
this.#app = createApp(App);
|
|
15
|
+
this.#app.use(hcdListPlugin, config)
|
|
16
|
+
this.#root = this.#app.mount("#"+this.#imagesListId);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
// console.log(error);
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
#render(){
|
|
24
|
+
var body = document.body;
|
|
25
|
+
var layout = document.createElement('div');
|
|
26
|
+
layout.id = this.#imagesListId
|
|
27
|
+
body.prepend(layout);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
open(app_config, params){
|
|
31
|
+
return this.#root.showModal(app_config, params);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const Webpack = require('webpack');
|
|
3
|
+
const { VueLoaderPlugin } = require('vue-loader');
|
|
4
|
+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
5
|
+
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
mode: 'production',
|
|
9
|
+
// mode: 'development',
|
|
10
|
+
entry: './src/index.js',
|
|
11
|
+
output: {
|
|
12
|
+
path: path.resolve(__dirname, 'dist'),
|
|
13
|
+
filename: 'ListDocuments.min.js',
|
|
14
|
+
library: {
|
|
15
|
+
name: 'ImagesList',
|
|
16
|
+
type: 'umd',
|
|
17
|
+
export: 'default'
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
module: {
|
|
21
|
+
rules: [
|
|
22
|
+
{
|
|
23
|
+
test: /\.vue$/,
|
|
24
|
+
loader: 'vue-loader',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
test: /\.css$/,
|
|
28
|
+
use: [
|
|
29
|
+
MiniCssExtractPlugin.loader,
|
|
30
|
+
'css-loader',
|
|
31
|
+
'postcss-loader',
|
|
32
|
+
'sass-loader'
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
optimization: {
|
|
38
|
+
minimizer: [
|
|
39
|
+
new UglifyJsPlugin({
|
|
40
|
+
cache: true,
|
|
41
|
+
parallel: true,
|
|
42
|
+
sourceMap: true
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
plugins: [
|
|
47
|
+
// make sure to include the plugin!
|
|
48
|
+
new VueLoaderPlugin(),
|
|
49
|
+
new MiniCssExtractPlugin({
|
|
50
|
+
filename: 'hcd-bootstrap.min.css'
|
|
51
|
+
}),
|
|
52
|
+
new Webpack.DefinePlugin({ __VUE_OPTIONS_API__: true, __VUE_PROD_DEVTOOLS__: false }), // to remove warn in browser console: runtime-core.esm-bundler.js:3607 Feature flags __VUE_OPTIONS_API__, __VUE_PROD_DEVTOOLS__ are not explicitly defined...
|
|
53
|
+
]
|
|
54
|
+
};
|