waibu-db 1.2.8 → 1.2.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-db",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "DB Helper",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -89,7 +89,7 @@ function customLayout ({ action, schema, ext, layout, readonly }) {
89
89
 
90
90
  function applyLayout (action, schema, ext) {
91
91
  const { defaultsDeep } = this.lib.aneka
92
- const { set, get, isEmpty, find } = this.lib._
92
+ const { set, get, isEmpty, find, kebabCase } = this.lib._
93
93
  const { fields, card, calcFields } = getCommons.call(this, action, schema, ext)
94
94
  const layout = get(ext, `view.${action}.layout`, get(ext, 'common.layout', []))
95
95
  const readonly = get(ext, `view.${action}.readonly`, get(ext, 'common.readonly', defReadonly))
@@ -121,6 +121,13 @@ function applyLayout (action, schema, ext) {
121
121
  if (['string', 'text'].includes(prop.type) && prop.maxLength) set(result, 'attr.maxlength', prop.maxLength)
122
122
  if (readonly.includes(f)) result.component = 'form-plaintext'
123
123
  }
124
+ for (const k in result.attr ?? {}) {
125
+ const newKey = kebabCase(k)
126
+ if (k !== newKey) {
127
+ result.attr[newKey] = result.attr[k]
128
+ delete result.attr[k]
129
+ }
130
+ }
124
131
  widget[f] = result
125
132
  }
126
133
  set(schema, 'view.widget', widget)