@questwork/vue-q-widget-vue3 3.1.1 → 3.1.3

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 (44) hide show
  1. package/dist/q-widget.min.js +34 -15
  2. package/dist/q-widget.min.js.LICENSE.txt +82 -1
  3. package/lib/helpers/index.js +1 -0
  4. package/lib/helpers/utilities/convertString/convertString.js +14 -0
  5. package/lib/helpers/utilities/convertString/index.js +1 -0
  6. package/lib/helpers/utilities/getStringByArr/getStringByArr.js +59 -0
  7. package/lib/helpers/utilities/getStringByArr/index.js +1 -0
  8. package/lib/helpers/utilities/getValidation/getValidation.js +19 -0
  9. package/lib/helpers/utilities/getValidation/index.js +1 -0
  10. package/lib/helpers/utilities/getValueByKeys/getValueByKeys.js +13 -0
  11. package/lib/helpers/utilities/getValueByKeys/index.js +1 -0
  12. package/lib/helpers/utilities/index.js +5 -1
  13. package/lib/helpers/utilities/keyValueObject/index.js +1 -0
  14. package/lib/helpers/utilities/keyValueObject/keyValueObject.js +7 -0
  15. package/lib/models/controller/controller.js +21 -6
  16. package/lib/models/factories/nodeFactory.js +1 -0
  17. package/lib/models/index.js +0 -1
  18. package/lib/models/nodes/element.js +1 -0
  19. package/lib/models/nodes/elements/index.js +3 -0
  20. package/lib/models/nodes/elements/qButton.js +15 -0
  21. package/lib/models/nodes/elements/qForm.js +21 -15
  22. package/lib/models/nodes/elements/qGrid.js +16 -2
  23. package/lib/models/nodes/elements/qHtml.js +15 -0
  24. package/lib/models/nodes/elements/qLabel.js +15 -0
  25. package/lib/models/nodes/elements/qList.js +29 -9
  26. package/lib/models/nodes/elements/qPaginator.js +18 -0
  27. package/lib/models/nodes/elements/qScheduler.js +30 -0
  28. package/lib/models/nodes/elements/qTab.js +13 -0
  29. package/package.json +17 -27
  30. package/vite.config.js +20 -27
  31. package/lib/models/controllerHelpers/controllerHelpers.js +0 -46
  32. package/lib/models/controllerHelpers/index.js +0 -1
  33. /package/lib/helpers/{utilities/configHandler → configHandler}/configHandler.js +0 -0
  34. /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQForm/buttonsHandler.js +0 -0
  35. /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQForm/elementQFormConfigHandler.js +0 -0
  36. /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQForm/index.js +0 -0
  37. /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQForm/layoutHandler.js +0 -0
  38. /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQList/actionsHandler.js +0 -0
  39. /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQList/bulkActionHandler.js +0 -0
  40. /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQList/elementQListConfigHandler.js +0 -0
  41. /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQList/headersHandler.js +0 -0
  42. /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/elementQList/index.js +0 -0
  43. /package/lib/helpers/{utilities/configHandler → configHandler}/handlers/index.js +0 -0
  44. /package/lib/helpers/{utilities/configHandler → configHandler}/index.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@questwork/vue-q-widget-vue3",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "Questwork vue component Sample",
5
5
  "exports": {
6
6
  ".": {
@@ -19,48 +19,38 @@
19
19
  "@babel/core": "^7.12.16",
20
20
  "@babel/eslint-parser": "^7.12.16",
21
21
  "@babel/preset-env": "^7.22.4",
22
- "@questwork/q-utilities": "^0.1.0",
23
22
  "@questwork/vue-q-buttons-vue3": "^3.1.0",
24
23
  "@questwork/vue-q-form-vue3": "3.1.0",
25
24
  "@questwork/vue-q-grid-vue3": "^3.1.0",
26
25
  "@questwork/vue-q-list-vue3": "^3.1.0",
27
26
  "@questwork/vue-q-modal-vue3": "^3.1.0",
28
27
  "@questwork/vue-q-paginator-vue3": "^3.1.0",
29
- "@storybook/addon-links": "^8.4.6",
30
- "@storybook/addon-viewport": "^8.4.6",
31
- "@storybook/source-loader": "^8.4.6",
32
- "@storybook/test": "^8.4.6",
33
- "@storybook/vue3": "^8.4.6",
34
- "@storybook/vue3-vite": "^8.4.6",
28
+ "@questwork/vue-q-scheduler": "3.1.1",
29
+ "@storybook/addon-essentials": "^8.5.3",
30
+ "@storybook/addon-links": "^8.4.7",
31
+ "@storybook/vue3": "^8.4.7",
32
+ "@storybook/vue3-vite": "^8.4.7",
35
33
  "@vitejs/plugin-vue": "^5.2.1",
36
- "chai": "^4.3.6",
37
- "chromedriver": "^116.0.0",
38
34
  "cross-env": "^7.0.3",
39
- "esbuild": "0.24.0",
40
- "eslint": "^8.47.0",
35
+ "eslint": "8.47.0",
41
36
  "eslint-config-airbnb-base": "11.2.0",
42
37
  "eslint-plugin-import": "2.3.0",
43
- "eslint-plugin-storybook": "^0.11.1",
44
- "eslint-plugin-vue": "^8.0.3",
45
- "gulp": "^4.0.2",
46
- "lodash": "^4.17.21",
38
+ "eslint-plugin-storybook": "^0.11.2",
39
+ "eslint-plugin-vue": "^9.32.0",
47
40
  "rollup-plugin-license": "^3.5.3",
48
- "rollup-webpack-umd": "^0.1.2",
49
- "sass": "^1.49.11",
50
- "selenium-webdriver": "^4.11.1",
51
- "sinon": "^9.2.4",
52
- "sinon-chai": "^3.7.0",
53
- "storybook": "^8.4.6",
54
- "underscore": "1.4.4",
55
- "vite": "^6.0.2",
41
+ "sass": "^1.83.4",
42
+ "storybook": "^8.4.7",
43
+ "vite": "5.4.11",
56
44
  "vite-plugin-commonjs": "^0.10.4",
57
- "vite-plugin-lib-inject-css": "^2.1.1",
58
- "vue": "^3.5.13",
59
- "vue-template-compiler": "^2.6.14"
45
+ "vue": "^3.5.13"
60
46
  },
61
47
  "engines": {
62
48
  "node": ">=10.0.0"
63
49
  },
50
+ "dependencies": {
51
+ "@questwork/q-utilities": "^0.1.0",
52
+ "lodash": "^4.17.21"
53
+ },
64
54
  "scripts": {
65
55
  "build": "vite build",
66
56
  "build:storybook": "storybook build -c .storybook -o storybook",
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
- ;(function(${root},${factory}){
85
- if (typeof exports == "object" && typeof module < "u") { // for commonjs
86
- const returns = {}
87
- ${factory}(returns, ${imports.map((i) => `require("${i}")`).join(', ')});
88
- module.exports = returns;
89
- ${exports.map((exp) => `exports.${exp} = returns.${exp};`).join('\n')}
90
- }
91
- else if (typeof define == "function" && define.amd) { // for amd
92
- define(["exports", ${imports.map((i) => `"${i}"`).join(', ')}], ${factory});
93
- }
94
- else { // for browser script tag
95
- ${root} = (typeof globalThis < "u") ? globalThis : ${root} || self;
96
- ${scriptTag};
97
- }
98
- })(this,function`
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'