waibu-db 1.1.14 → 1.1.16

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.
@@ -28,6 +28,7 @@
28
28
  "addMoreAfterSubmit": "Add more after submit",
29
29
  "clonePrevious": "Clone previous",
30
30
  "actionPermanentlyDisabled%s": "Sorry, action '%s' is permanently disabled at database level. For more information, please contact your Admin immediately, thank you!",
31
+ "dbModels": "Database Models",
31
32
  "op": {
32
33
  "equals": "Equals",
33
34
  "notEquals": "Not Equals",
package/bajo/intl/id.json CHANGED
@@ -28,6 +28,7 @@
28
28
  "addMoreAfterSubmit": "Tambah lagi setelah kirim",
29
29
  "clonePrevious": "Duplikasi sebelumnya",
30
30
  "actionPermanentlyDisabled%s": "Sorry, action '%s' is permanently disabled at database level. For more information, please contact your Admin immediately, thank you!",
31
+ "dbModels": "Model Database",
31
32
  "op": {
32
33
  "equals": "Sama Dengan",
33
34
  "notEquals": "Tidak Sama Dengan",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-db",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
4
4
  "description": "DB Helper",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "waibu": {
3
3
  "prefix": "db",
4
- "title": "Model Database"
4
+ "title": "dbModels"
5
5
  },
6
6
  "waibuAdmin": {
7
+ "menuCollapsible": true,
7
8
  "menuHandler": "waibuDb:adminMenu"
8
9
  },
9
10
  "waibuMpa": {
@@ -39,8 +39,7 @@ function modelsMenu (locals, req) {
39
39
  }
40
40
 
41
41
  async function adminMenu (locals, req) {
42
- const { buildAccordionMenu } = this.app.waibuAdmin
43
- return buildAccordionMenu(modelsMenu.call(this, locals, req), locals, req)
42
+ return modelsMenu.call(this, locals, req)
44
43
  }
45
44
 
46
45
  export default adminMenu
@@ -24,22 +24,13 @@ async function echarts () {
24
24
  build = async () => {
25
25
  const { generateId } = this.plugin.app.bajo
26
26
  const { base64JsonDecode, jsonStringify } = this.plugin.app.waibuMpa
27
- const { merge, cloneDeep } = this.plugin.app.bajo.lib._
27
+ const { merge, cloneDeep, omit } = this.plugin.app.bajo.lib._
28
28
  this.params.attr.id = generateId('alpha')
29
29
  this.params.attr['x-data'] = `chart${this.params.attr.id}`
30
- this.params.attr['@resize.window.debounce.500ms'] = `
31
- if (chart) {
32
- chart.resize()
33
- }
34
- `
30
+ this.params.attr['x-bind'] = 'resize'
35
31
  let option = cloneDeep(this.defOption)
36
32
  if (this.params.attr.option === true) this.params.attr.option = 'e30='
37
33
  if (this.params.attr.option) option = merge(option, base64JsonDecode(this.params.attr.option))
38
- this.params.attr['x-init'] = `
39
- $watch('option', val => {
40
- if (chart) chart.setOption(val)
41
- })
42
- `
43
34
  this.params.append = `
44
35
  <script>
45
36
  document.addEventListener('alpine:init', () => {
@@ -50,16 +41,27 @@ async function echarts () {
50
41
  const el = document.getElementById('${this.params.attr.id}')
51
42
  chart = echarts.init(el, null, { renderer: 'canvas' })
52
43
  chart.setOption(this.option)
44
+ this.$watch('option', val => {
45
+ chart.setOption(val)
46
+ })
53
47
  },
54
48
  get chart () {
55
49
  return chart
56
50
  },
51
+ resize: {
52
+ ['@resize.window.debounce.500ms']() {
53
+ if (chart) {
54
+ chart.resize()
55
+ }
56
+ }
57
+ },
57
58
  option: ${jsonStringify(option, true)}
58
59
  }
59
60
  })
60
61
  })
61
62
  </script>
62
63
  `
64
+ this.params.attr = omit(this.params.attr, ['option'])
63
65
  }
64
66
  }
65
67
  }