waibu-db 2.16.3 → 2.17.1

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.
@@ -1,5 +1,5 @@
1
1
  <!-- include waibuDb.partial:/crud/_list-btns.html -->
2
- <c:wdb-table id="main-table" border body-divider strip responsive margin="top-3"/>
2
+ <c:wdb-data-table id="main-table" border body-divider strip responsive margin="top-3"/>
3
3
  <!-- include waibuDb.partial:/crud/_list-footer.html -->
4
4
  <!-- include waibuDb.partial:/crud/_addons.html -->
5
5
  <!-- include waibuDb.partial:/crud/_list-warnings.html -->
@@ -3,7 +3,7 @@ import wdbBase from '../wdb-base.js'
3
3
  async function table () {
4
4
  const WdbBase = await wdbBase.call(this)
5
5
 
6
- return class WdbTable extends WdbBase {
6
+ return class WdbDataTable extends WdbBase {
7
7
  isRightAligned = (field, schema) => {
8
8
  const { get, find } = this.app.lib._
9
9
  const prop = find(schema.properties, { name: field })
@@ -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
 
@@ -61,7 +61,7 @@ async function query () {
61
61
  }
62
62
  this.params.noTag = true
63
63
  const container = this.params.attr.modal ? 'modal' : 'drawer'
64
- const scanables = (this.model ? this.model.scanables : []).map(item => req.t(`field.${item}`))
64
+ const scanables = (this.schema.scanables ?? []).map(item => req.t(`field.${item}`))
65
65
  let placeholder = this.params.attr.placeholder
66
66
  if (!placeholder) placeholder = scanables.length > 0 ? req.t('queryHint%s', join(scanables, { separator: ', ', lastSeparator: 'or' })) : req.t('query')
67
67
  this.params.html = await this.component.buildSentence(`
@@ -111,7 +111,6 @@ async function query () {
111
111
  val = opv.slice(v.length).replaceAll('[', '').replaceAll('{', '').replaceAll(']', '').replaceAll('}', '').replaceAll('\\'', '')
112
112
  }
113
113
  })
114
- console.log(op, val)
115
114
  if (_.isEmpty(op)) continue
116
115
  this[f + 'Op'] = op
117
116
  if (op === 'between') {
@@ -181,13 +181,13 @@ 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 schema = pick(model, ['name', 'properties', 'indexes', 'disabled', 'attachment', 'sortables', 'view', 'hidden'])
184
+ const schema = pick(model, ['name', 'properties', 'indexes', 'disabled', 'attachment', 'sortables', 'scanables', 'view', 'hidden'])
185
185
  const base = options.base ?? path.basename(model.file, path.extname(model.file))
186
186
  let ext = await readConfig(`${model.plugin.ns}:/extend/waibuDb/schema/${base}.*`, { ignoreError: true, options })
187
187
  const over = await readConfig(`main:/extend/waibuDb/extend/${model.plugin.ns}/schema/${base}.*`, { ignoreError: true, options })
188
188
  ext = defaultsDeep(options.schema ?? {}, over, ext)
189
189
  await handler[view].call(this, schema, ext, options)
190
- return { schema, ext }
190
+ return { schema, ext, model }
191
191
  }
192
192
 
193
193
  export default getSchemaExt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-db",
3
- "version": "2.16.3",
3
+ "version": "2.17.1",
4
4
  "description": "DB Helper",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-04-21
4
+
5
+ - [2.5.1] Bug fix in ```WdbLookupSelect.build()```
6
+
7
+ ## 2026-04-19
8
+
9
+ - [2.12.0] Rename ```WdbTable``` to ```WdbDataTable``` widget
10
+ - [2.12.0] ```getSchemaExt()``` now include export related model too
11
+
3
12
  ## 2026-04-18
4
13
 
5
14
  - [2.16.3] Bug fix in ```WdbForm``` widget
@@ -60,7 +69,7 @@
60
69
  - [2.12.5] Bug fix in ```wdb-pagination``` widget
61
70
  - [2.12.5] Bug fix in ```wdb-query``` widget
62
71
  - [2.12.5] Bug fix in ```wdb-recs-info``` widget
63
- - [2.12.5] Bug fix in ```wdb-table``` widget
72
+ - [2.12.5] Bug fix in ```wdb-data-table``` widget
64
73
  - [2.12.5] Bug fix in remove attachment
65
74
 
66
75
  ## 2026-03-30
@@ -71,7 +80,7 @@
71
80
  ## 2026-03-27
72
81
 
73
82
  - [2.12.1] Bug fix in all ```view.format``` & ```view.formatValue```
74
- - [2.12.2] Bug fix in ```wdb-form``` & ```wdb-table``` widgets, now correctly use value from format if provided
83
+ - [2.12.2] Bug fix in ```wdb-form``` & ```wdb-data-table``` widgets, now correctly use value from format if provided
75
84
 
76
85
  ## 2026-03-26
77
86
 
@@ -96,7 +105,7 @@
96
105
 
97
106
  - [2.9.0] Add ability to overwrite ```base``` through ```options```
98
107
  - [2.9.0] Bug fix in ```wdb-btn-columns``` widget
99
- - [2.9.0] Bug fix in ```wdb-table``` widget
108
+ - [2.9.0] Bug fix in ```wdb-data-table``` widget
100
109
 
101
110
  ## 2026-03-08
102
111