@questwork/vue-q-widget-vue3 3.1.1 → 3.1.2
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/q-widget.min.js +34 -15
- package/dist/q-widget.min.js.LICENSE.txt +82 -1
- package/lib/helpers/index.js +1 -0
- package/lib/helpers/utilities/convertString/convertString.js +14 -0
- package/lib/helpers/utilities/convertString/index.js +1 -0
- package/lib/helpers/utilities/getStringByArr/getStringByArr.js +59 -0
- package/lib/helpers/utilities/getStringByArr/index.js +1 -0
- package/lib/helpers/utilities/getValidation/getValidation.js +19 -0
- package/lib/helpers/utilities/getValidation/index.js +1 -0
- package/lib/helpers/utilities/getValueByKeys/getValueByKeys.js +13 -0
- package/lib/helpers/utilities/getValueByKeys/index.js +1 -0
- package/lib/helpers/utilities/index.js +5 -1
- package/lib/helpers/utilities/keyValueObject/index.js +1 -0
- package/lib/helpers/utilities/keyValueObject/keyValueObject.js +7 -0
- package/lib/models/controller/controller.js +21 -5
- package/lib/models/factories/nodeFactory.js +1 -0
- package/lib/models/index.js +0 -1
- package/lib/models/nodes/element.js +1 -0
- package/lib/models/nodes/elements/qButton.js +15 -0
- package/lib/models/nodes/elements/qForm.js +17 -3
- package/lib/models/nodes/elements/qGrid.js +16 -2
- package/lib/models/nodes/elements/qHtml.js +15 -0
- package/lib/models/nodes/elements/qLabel.js +15 -0
- package/lib/models/nodes/elements/qList.js +29 -9
- package/lib/models/nodes/elements/qPaginator.js +18 -0
- package/lib/models/nodes/elements/qTab.js +13 -0
- package/package.json +16 -27
- package/vite.config.js +20 -27
- package/lib/models/controllerHelpers/controllerHelpers.js +0 -46
- package/lib/models/controllerHelpers/index.js +0 -1
- /package/lib/helpers/{utilities/configHandler → configHandler}/configHandler.js +0 -0
- /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQForm/buttonsHandler.js +0 -0
- /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQForm/elementQFormConfigHandler.js +0 -0
- /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQForm/index.js +0 -0
- /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQForm/layoutHandler.js +0 -0
- /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQList/actionsHandler.js +0 -0
- /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQList/bulkActionHandler.js +0 -0
- /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQList/elementQListConfigHandler.js +0 -0
- /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQList/headersHandler.js +0 -0
- /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQList/index.js +0 -0
- /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/index.js +0 -0
- /package/lib/helpers/{utilities/configHandler → configHandler}/index.js +0 -0
package/vite.config.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { URL, fileURLToPath } from 'node:url'
|
|
2
1
|
import { defineConfig } from 'vite'
|
|
3
2
|
import vue from '@vitejs/plugin-vue'
|
|
4
3
|
import license from 'rollup-plugin-license'
|
|
5
4
|
import commonjs from 'vite-plugin-commonjs'
|
|
6
5
|
|
|
7
|
-
// 与 ./webpack/prod.config.js 的 output.library 名一致
|
|
8
6
|
const libName = 'QWidget'
|
|
9
|
-
// libName 的 kebab-case 格式
|
|
10
7
|
const fileName = 'q-widget'
|
|
11
8
|
|
|
12
9
|
export default defineConfig({
|
|
@@ -33,8 +30,8 @@ export default defineConfig({
|
|
|
33
30
|
},
|
|
34
31
|
}),
|
|
35
32
|
rewriteUmdPlugin({
|
|
36
|
-
banner: `/*! For license information please see ${fileName}.min.js.LICENSE.txt
|
|
37
|
-
})
|
|
33
|
+
banner: `/*! For license information please see ${fileName}.min.js.LICENSE.txt */`,
|
|
34
|
+
}),
|
|
38
35
|
],
|
|
39
36
|
},
|
|
40
37
|
target: ['chrome100', 'safari15', 'firefox91'],
|
|
@@ -48,20 +45,15 @@ export default defineConfig({
|
|
|
48
45
|
},
|
|
49
46
|
plugins: [
|
|
50
47
|
vue(),
|
|
51
|
-
commonjs()
|
|
48
|
+
commonjs(),
|
|
52
49
|
],
|
|
53
|
-
resolve: {
|
|
54
|
-
alias: {
|
|
55
|
-
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
50
|
css: {
|
|
59
51
|
preprocessorOptions: {
|
|
60
52
|
scss: {
|
|
61
53
|
api: 'modern-compiler',
|
|
62
54
|
},
|
|
63
55
|
},
|
|
64
|
-
}
|
|
56
|
+
},
|
|
65
57
|
})
|
|
66
58
|
|
|
67
59
|
function rewriteUmdPlugin(options) {
|
|
@@ -81,21 +73,21 @@ function rewriteUmdPlugin(options) {
|
|
|
81
73
|
.replace(defineReg, (...args) => {
|
|
82
74
|
const { root, factory, scriptTag } = args.at(-1)
|
|
83
75
|
return `${banner || ''}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
76
|
+
;(function(${root},${factory}){
|
|
77
|
+
if (typeof exports == "object" && typeof module < "u") { // for commonjs
|
|
78
|
+
const returns = {}
|
|
79
|
+
${factory}(returns, ${imports.map((i) => `require("${i}")`).join(', ')});
|
|
80
|
+
module.exports = returns;
|
|
81
|
+
${exports.map((exp) => `exports.${exp} = returns.${exp};`).join('\n')}
|
|
82
|
+
}
|
|
83
|
+
else if (typeof define == "function" && define.amd) { // for amd
|
|
84
|
+
define(["exports", ${imports.map((i) => `"${i}"`).join(', ')}], ${factory});
|
|
85
|
+
}
|
|
86
|
+
else { // for browser script tag
|
|
87
|
+
${root} = (typeof globalThis < "u") ? globalThis : ${root} || self;
|
|
88
|
+
${scriptTag};
|
|
89
|
+
}
|
|
90
|
+
})(this,function`
|
|
99
91
|
})
|
|
100
92
|
|
|
101
93
|
// return the exports object at the end
|
|
@@ -103,6 +95,7 @@ function rewriteUmdPlugin(options) {
|
|
|
103
95
|
const { name } = args.at(-1)
|
|
104
96
|
return `Object.defineProperty(${name},Symbol.toStringTag,{value:"Module"}); return ${name}; });`
|
|
105
97
|
})
|
|
98
|
+
|
|
106
99
|
data.code = rewritten
|
|
107
100
|
}
|
|
108
101
|
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
class ControllerHelpers {
|
|
2
|
-
constructor(opt) {
|
|
3
|
-
this.permissionHandler = permissionHandler
|
|
4
|
-
Object.keys(opt).forEach((key) => {
|
|
5
|
-
this[key] = opt[key]
|
|
6
|
-
})
|
|
7
|
-
}
|
|
8
|
-
static init(controllerHelpers) {
|
|
9
|
-
const instance = new ControllerHelpers(controllerHelpers)
|
|
10
|
-
return instance.isValid ? instance : null
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
get isValid() {
|
|
14
|
-
return isFunction(this.eventHandler)
|
|
15
|
-
&& isFunction(this.getControllerState)
|
|
16
|
-
&& isFunction(this.getControllerUniqueKey)
|
|
17
|
-
&& isFunction(this.saveControllerState)
|
|
18
|
-
&& isFunction(this.startLoading)
|
|
19
|
-
&& isFunction(this.stopLoading)
|
|
20
|
-
&& this.qForm && isFunction(this.qForm.NodeHelper)
|
|
21
|
-
&& this.qGrid && isFunction(this.qGrid.QItem) && isFunction(this.qGrid.Cell)
|
|
22
|
-
&& this.qList && isFunction(this.qList.QRow) && isFunction(this.qList.QListBulkButton) && isFunction(this.qList.QListButton)
|
|
23
|
-
&& this.qUtilities && isFunction(this.qUtilities.convertString) && isFunction(this.qUtilities.getValidation) && isFunction(this.qUtilities.lodash)
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function isFunction(fun) {
|
|
28
|
-
return typeof fun === 'function'
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function permissionHandler() {
|
|
32
|
-
return {
|
|
33
|
-
isAllowCreate: true,
|
|
34
|
-
isAllowRead: true,
|
|
35
|
-
isAllowUpdate: true,
|
|
36
|
-
isAllowDelete: true
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default {
|
|
41
|
-
ControllerHelpers
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export {
|
|
45
|
-
ControllerHelpers
|
|
46
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ControllerHelpers } from './controllerHelpers'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQForm/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQList/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|