waibu-db 2.17.0 → 2.17.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.
@@ -127,7 +127,7 @@ async function table () {
127
127
  if (!prop) prop = find(schema.view.calcFields, { name: f })
128
128
  if (!prop) continue
129
129
  let dataValue = d._orig[f]
130
- if (['datetime'].includes(prop.type) && dataValue) dataValue = escape(dataValue.toISOString())
130
+ if (['datetime'].includes(prop.type) && dataValue instanceof Date && !isNaN(dataValue)) dataValue = escape(dataValue.toISOString())
131
131
  else if (['string', 'text'].includes(prop.type)) dataValue = escape(dataValue)
132
132
  else if (['array', 'object'].includes(prop.type)) dataValue = escape(JSON.stringify(dataValue))
133
133
  const refName = get(schema, `view.widget.${f}.attr.refName`)
@@ -16,7 +16,7 @@ async function lookupSelect () {
16
16
  const ref = this.getRef({ field: this.params.attr.name, refName: this.getRefName(this.params.attr.name) })
17
17
  if (isEmpty(ref)) {
18
18
  const sentence = `<c:form-input ${Object.entries(this.params.attr).map(([k, v]) => `${kebabCase(k)}="${v}"`).join(' ')} />`
19
- this.params.html = this.component.buildSentence(sentence, this.component.locals)
19
+ this.params.html = await this.component.buildSentence(sentence, this.component.locals)
20
20
  return
21
21
  }
22
22
 
@@ -181,11 +181,12 @@ async function getSchemaExt (modelName, view, options = {}) {
181
181
  const { pick, isString } = this.app.lib._
182
182
 
183
183
  const model = isString(modelName) ? this.app.dobo.getModel(modelName) : modelName
184
+ const ns = model.plugin.ns
184
185
  const schema = pick(model, ['name', 'properties', 'indexes', 'disabled', 'attachment', 'sortables', 'scanables', 'view', 'hidden'])
185
186
  const base = options.base ?? path.basename(model.file, path.extname(model.file))
186
- let ext = await readConfig(`${model.plugin.ns}:/extend/waibuDb/schema/${base}.*`, { ignoreError: true, options })
187
- const over = await readConfig(`main:/extend/waibuDb/extend/${model.plugin.ns}/schema/${base}.*`, { ignoreError: true, options })
188
- ext = defaultsDeep(options.schema ?? {}, over, ext)
187
+ const parserOpts = { args: options.args }
188
+ let ext = await readConfig(`${ns}:/extend/waibuDb/schema/${base}.*`, { ns, baseNs: 'waibuDb', parserOpts })
189
+ ext = defaultsDeep(options.schema ?? {}, ext)
189
190
  await handler[view].call(this, schema, ext, options)
190
191
  return { schema, ext, model }
191
192
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-db",
3
- "version": "2.17.0",
3
+ "version": "2.17.2",
4
4
  "description": "DB Helper",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,9 +1,18 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-04-23
4
+
5
+ - [2.17.2] Bug fix in ```getSchemaExt()```
6
+ - [2.17.2] Bug fix in ```WdbDataTable``` widget
7
+
8
+ ## 2026-04-21
9
+
10
+ - [2.17.1] Bug fix in ```WdbLookupSelect.build()```
11
+
3
12
  ## 2026-04-19
4
13
 
5
- - [2.12.0] Rename ```WdbTable``` to ```WdbDataTable``` widget
6
- - [2.12.0] ```getSchemaExt()``` now include export related model too
14
+ - [2.17.0] Rename ```WdbTable``` to ```WdbDataTable``` widget
15
+ - [2.17.0] ```getSchemaExt()``` now include export related model too
7
16
 
8
17
  ## 2026-04-18
9
18