waibu-bootstrap 1.1.8 → 1.1.10

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-bootstrap",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "Bootstrap suport for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,6 +17,7 @@ function getInputAttr (group, formControl = true, ro) {
17
17
  else if (has(attr, 'name') === 'lng') attr.value = escape(this.component.req.format(val, attr.dataType, { longitude: true }))
18
18
  else attr.value = escape(this.component.req.format(val, attr.dataType))
19
19
  } else attr.value = attr.dataValue
20
+ if (isArray(val)) attr.value = val.join(' ')
20
21
  }
21
22
  if (sizes.includes(attr.size) && formControl) attr.class.push(`form-control-${attr.size}`)
22
23
  return omit(attr, ['size', 'col'])
@@ -96,6 +97,7 @@ export async function buildFormColor (group, params) {
96
97
  const attr = getInputAttr.call(this, group)
97
98
  attr.class.push('form-control-color')
98
99
  attr.type = 'color'
100
+ if (!attr.dim) attr.dim = 'width:100'
99
101
  return await this.component.buildTag({ tag: 'input', attr, selfClosing: true })
100
102
  }
101
103
 
@@ -22,7 +22,7 @@ async function accordionItem () {
22
22
  `aria-expanded="${this.params.attr.showOnStart}"`,
23
23
  'x-data',
24
24
  `@click="$dispatch('accordion-item', { id: $el.closest('.accordion').id, cls: '${clsList.join(' ')}' })"`,
25
- `aria-controls="${this.params.attr.id}">${this.params.attr.header}</button></c:h2>`]
25
+ `aria-controls="${this.params.attr.id}"><c:span margin="end-2">${this.params.attr.header}</c:span></button></c:h2>`]
26
26
  const body = await this.component.buildTag({ tag: 'div', attr: group.body, html: this.params.html })
27
27
  const details = [`<div id="${this.params.attr.id}" class="accordion-collapse collapse${this.params.attr.showOnStart ? ' show' : ''}">`,
28
28
  body, '</div']
@@ -9,8 +9,7 @@ async function dropdownItem () {
9
9
  }
10
10
 
11
11
  build = async () => {
12
- const { $ } = this.component
13
- if ($(this.params.html).children().length === 0 && !this.params.attr.href) this.params.attr.href = '#'
12
+ if (!this.params.attr.href) this.params.attr.href = '#'
14
13
  if (this.params.attr.divider) {
15
14
  this.params.tag = 'hr'
16
15
  this.params.attr.class.push('dropdown-divider')
@@ -14,6 +14,21 @@ export const inlineCss = `
14
14
  .ts-control, .ts-control input, .ts-dropdown {
15
15
  color: inherit;
16
16
  }
17
+ .form-floating > .ts-wrapper {
18
+ padding-top: 1.625rem !important;
19
+ }
20
+
21
+ .ts-wrapper.focus {
22
+ border-color: #86b7fe;
23
+ outline: 0;
24
+ box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
25
+ }
26
+
27
+ .focus .ts-control {
28
+ box-shadow: none;
29
+ border: none;
30
+ box-shadow: none;
31
+ }
17
32
  `
18
33
  export const css = 'waibuExtra.virtual:/tom-select/css/tom-select.bootstrap5.min.css'
19
34
  export const scripts = 'waibuExtra.virtual:/tom-select/js/tom-select.complete.min.js'
@@ -36,11 +51,21 @@ async function formSelectExt () {
36
51
  if (this.params.attr.removeBtn) plugins.push('remove_button')
37
52
  if (this.params.attr.clearBtn) plugins.push('clear_button')
38
53
  if (this.params.attr.optgroupColumns) plugins.push('optgroup_columns')
39
- const defOpts = { plugins }
40
- this.params.attr.options = this.params.attr.options ? base64JsonDecode(this.params.attr.options) : defOpts
54
+ let options = []
55
+ if (this.params.attr.options) {
56
+ try {
57
+ options = base64JsonDecode(this.params.attr.options)
58
+ } catch (err) {
59
+ options = this.params.attr.options.split(' ').map(item => {
60
+ return { value: item, text: item }
61
+ })
62
+ }
63
+ this.params.attr.options = options
64
+ }
65
+ const opts = { plugins }
41
66
  this.params.attr['@load.window'] = `
42
- const options = ${jsonStringify(this.params.attr.options, true)}
43
- instance = new TomSelect($refs.select, options)
67
+ const opts = ${jsonStringify(opts, true)}
68
+ instance = new TomSelect($refs.select, opts)
44
69
  `
45
70
  await build.call(this, buildFormSelect, this.params)
46
71
  this.params.attr = omit(this.params.attr, ['noDropdownInput', 'removeBtn', 'clearBtn'])
@@ -56,7 +56,7 @@ const styles = [
56
56
  async function afterBuildTag (tag, params) {
57
57
  const { omit, map, isEmpty } = this.plugin.lib._
58
58
  const keys = map(styles, 'key')
59
- const excluded = []
59
+ let excluded = []
60
60
  params.attr = params.attr ?? {}
61
61
  tag = tag ?? params.tag
62
62
  if (tag === 'any') tag = params.tag
@@ -98,6 +98,7 @@ async function afterBuildTag (tag, params) {
98
98
  if (key.includes(k)) excluded.push(key)
99
99
  }
100
100
  }
101
+ if (!['btn'].includes(tag)) excluded = excluded.filter(item => !['disabled'].includes(item))
101
102
  params.attr = omit(params.attr, ['color', 'noDismiss', 'size', 'split', 'ordered',
102
103
  'dir', 'menu', 'divider', 'header', 'autoClose', 'offset', 'group', 'toggleAll',
103
104
  'showOnStart', 'autoPlay', 'fade', 'indicator', 'noNavigation', 'noTouch', 'alwaysOpen',
@@ -82,7 +82,7 @@ class Wbs {
82
82
  this.$el.closest('.modal-body').querySelector('button[type=submit]').click()
83
83
  }
84
84
  }" @keyup.enter="submit" value="` + (value ?? opts.value) + '"/>',
85
- msg ? ('<c:div margin="top-3">' + msg + '</c:div>') : ''
85
+ msg ? ('<c:div margin="top-3"><c:t>' + msg + '</c:t></c:div>') : ''
86
86
  ].join('\n')
87
87
  opts.close = opts.close ?? ''
88
88
  opts.buttons = [