waibu-bootstrap 1.0.4 → 1.0.6

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.
@@ -0,0 +1,2 @@
1
+ waibu-mpa
2
+ waibu-extra
package/bajo/config.json CHANGED
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "waibu": {
3
3
  "prefix": "bootstrap"
4
- },
5
- "dependencies": ["waibu-mpa", "waibu-extra"]
4
+ }
6
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-bootstrap",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Bootstrap suport for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2,11 +2,14 @@ import { inlineCss, css, scripts } from './form-select-ext.js'
2
2
 
3
3
  async function formSelectCountry () {
4
4
  return class FormSelectCountry extends this.baseFactory {
5
+ static css = [...super.css, css]
6
+
7
+ static scripts = [...super.scripts, scripts]
8
+
9
+ static inlineCss = inlineCss
10
+
5
11
  constructor (options) {
6
12
  super(options)
7
- this.css = css
8
- this.inlineCss = inlineCss
9
- this.scripts = scripts
10
13
  this.params.noTag = true
11
14
  }
12
15
 
@@ -16,7 +19,7 @@ async function formSelectCountry () {
16
19
  const { base64JsonEncode } = this.plugin.app.waibuMpa
17
20
  const countries = await readConfig('bajoCommonDb:/dobo/fixture/country.json', { ignoreError: true, defValue: [] })
18
21
  this.params.attr.options = base64JsonEncode(map(countries, c => {
19
- return { value: c.id, text: c.name }
22
+ return { value: c.id, text: c.name.replaceAll('\'', '') }
20
23
  }))
21
24
  this.params.html = await this.component.buildTag({ tag: 'formSelectExt', attr: this.params.attr, html: '' })
22
25
  }
@@ -20,6 +20,12 @@ export const scripts = 'waibuExtra.virtual:/tom-select/js/tom-select.complete.mi
20
20
 
21
21
  async function formSelectExt () {
22
22
  return class FormSelectExt extends this.baseFactory {
23
+ static css = [...super.css, css]
24
+
25
+ static scripts = [...super.scripts, scripts]
26
+
27
+ static inlineCss = inlineCss
28
+
23
29
  constructor (options) {
24
30
  super(options)
25
31
  this.css = css
@@ -40,8 +46,9 @@ async function formSelectExt () {
40
46
  if (this.params.attr.clearBtn) plugins.push('clear_button')
41
47
  if (this.params.attr.optgroupColumns) plugins.push('optgroup_columns')
42
48
  const defOpts = { plugins }
49
+ this.params.attr.options = this.params.attr.options ? base64JsonDecode(this.params.attr.options) : defOpts
43
50
  this.params.attr['@load.window'] = `
44
- const options = ${jsonStringify(this.params.attr.options ? base64JsonDecode(this.params.attr.options) : defOpts, true)}
51
+ const options = ${jsonStringify(this.params.attr.options, true)}
45
52
  instance = new TomSelect($refs.select, options)
46
53
  `
47
54
  await build.call(this, buildFormSelect, this.params)