waibu-bootstrap 2.9.2 → 2.11.0

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.
@@ -5,7 +5,7 @@ export const fstyles = ['italic', 'normal']
5
5
  export const heights = ['1', 'sm', 'base', 'lg']
6
6
  export const cvariants = ['emphasis', 'secondary', 'tertiary']
7
7
  export const cbgvariants = ['subtle']
8
- export const opacities = ['0', '25', '50', '75', '100']
8
+ export const opacities = ['10', '25', '50', '75', '100']
9
9
  export const aligns = ['top', 'bottom', 'start', 'end', 'middle']
10
10
  export const dirs = ['up', 'down', 'start', 'end']
11
11
  export const widths = ['0', '1', '2', '3', '4', '5']
@@ -53,12 +53,12 @@ export async function buildFormLabel (group, tag, cls) {
53
53
  return await this.component.buildTag({ tag: tag ?? 'label', attr: group.label, html: group._.label })
54
54
  }
55
55
 
56
- export async function buildFormInput (group, params) {
56
+ export async function buildFormInput (group) {
57
57
  const attr = await getInputAttr.call(this, group)
58
58
  return await this.component.buildTag({ tag: 'input', attr, selfClosing: true })
59
59
  }
60
60
 
61
- export async function buildFormCheck (group, params) {
61
+ export async function buildFormCheck (group) {
62
62
  const { has, get } = this.app.lib._
63
63
  const attr = await getInputAttr.call(this, group, false)
64
64
  attr.type = 'checkbox'
@@ -68,7 +68,7 @@ export async function buildFormCheck (group, params) {
68
68
  return await this.component.buildTag({ tag: 'input', attr, selfClosing: true })
69
69
  }
70
70
 
71
- export async function buildFormSwitch (group, params) {
71
+ export async function buildFormSwitch (group) {
72
72
  const { has } = this.app.lib._
73
73
  const attr = await getInputAttr.call(this, group, false)
74
74
  attr.type = 'checkbox'
@@ -79,14 +79,14 @@ export async function buildFormSwitch (group, params) {
79
79
  return await this.component.buildTag({ tag: 'input', attr, selfClosing: true })
80
80
  }
81
81
 
82
- export async function buildFormRadio (group, params) {
82
+ export async function buildFormRadio (group) {
83
83
  const attr = await getInputAttr.call(this, group, false)
84
84
  attr.type = 'radio'
85
85
  attr.class.push('form-check-input')
86
86
  return await this.component.buildTag({ tag: 'input', attr, selfClosing: true })
87
87
  }
88
88
 
89
- export async function buildFormCheckToggle (group, params) {
89
+ export async function buildFormCheckToggle (group) {
90
90
  const attr = await getInputAttr.call(this, group, false)
91
91
  attr.type = 'checkbox'
92
92
  attr.autocomplete = 'off'
@@ -94,7 +94,7 @@ export async function buildFormCheckToggle (group, params) {
94
94
  return await this.component.buildTag({ tag: 'input', attr, selfClosing: true })
95
95
  }
96
96
 
97
- export async function buildFormRadioToggle (group, params) {
97
+ export async function buildFormRadioToggle (group) {
98
98
  const attr = await getInputAttr.call(this, group, false)
99
99
  attr.type = 'radio'
100
100
  attr.autocomplete = 'off'
@@ -102,7 +102,7 @@ export async function buildFormRadioToggle (group, params) {
102
102
  return await this.component.buildTag({ tag: 'input', attr, selfClosing: true })
103
103
  }
104
104
 
105
- export async function buildFormPlaintext (group, params) {
105
+ export async function buildFormPlaintext (group) {
106
106
  const { omit } = this.app.lib._
107
107
  const attr = await getInputAttr.call(this, group, false, true)
108
108
  attr.class.push('form-control-plaintext')
@@ -110,7 +110,7 @@ export async function buildFormPlaintext (group, params) {
110
110
  return await this.component.buildTag({ tag: 'div', attr: omit(attr, ['value']), html: attr.value })
111
111
  }
112
112
 
113
- export async function buildFormColor (group, params) {
113
+ export async function buildFormColor (group) {
114
114
  const attr = await getInputAttr.call(this, group)
115
115
  attr.class.push('form-control-color')
116
116
  attr.type = 'color'
@@ -118,21 +118,21 @@ export async function buildFormColor (group, params) {
118
118
  return await this.component.buildTag({ tag: 'input', attr, selfClosing: true })
119
119
  }
120
120
 
121
- export async function buildFormFile (group, params) {
121
+ export async function buildFormFile (group) {
122
122
  const attr = await getInputAttr.call(this, group)
123
123
  attr.type = 'file'
124
124
  return await this.component.buildTag({ tag: 'input', attr, selfClosing: true })
125
125
  }
126
126
 
127
- export async function buildFormTextarea (group, params) {
127
+ export async function buildFormTextarea (group) {
128
128
  const attr = await getInputAttr.call(this, group)
129
- params.html = attr.value
129
+ this.params.html = attr.value
130
130
  attr.style.minHeight = '100px'
131
131
  delete attr.value
132
- return await this.component.buildTag({ tag: 'textarea', attr, html: params.html })
132
+ return await this.component.buildTag({ tag: 'textarea', attr, html: this.params.html })
133
133
  }
134
134
 
135
- export async function buildFormSelect (group, params) {
135
+ export async function buildFormSelect (group) {
136
136
  const { omit, trim } = this.app.lib._
137
137
  const { isSet } = this.app.lib.aneka
138
138
  const { $ } = this.component
@@ -144,7 +144,7 @@ export async function buildFormSelect (group, params) {
144
144
  } catch (err) {}
145
145
  attr.value = isSet(attr.value) ? (attr.value + '') : undefined
146
146
  attr.class.push('form-select')
147
- let html = params.html
147
+ let html = this.params.html
148
148
  if (sizes.includes(attr.size)) attr.class.push(`form-select-${attr.size}`)
149
149
  if (attr.options) html = await this.component.buildOptions({ attr })
150
150
  else {
@@ -158,7 +158,7 @@ export async function buildFormSelect (group, params) {
158
158
  return await this.component.buildTag({ tag: attr.tag ?? 'select', attr, html })
159
159
  }
160
160
 
161
- export async function buildFormRange (group, params) {
161
+ export async function buildFormRange (group) {
162
162
  const attr = await getInputAttr.call(this, group, false)
163
163
  attr.type = 'range'
164
164
  attr.class.push('form-range')
@@ -2,7 +2,7 @@ import { buildFormLabel, buildFormCheckToggle } from './_lib.js'
2
2
  import { parseVariant, colors } from '../method/after-build-tag/_lib.js'
3
3
  const variants = ['outline']
4
4
 
5
- export async function build (handler, params = {}) {
5
+ export async function build (handler) {
6
6
  const { groupAttrs } = this.app.waibuMpa
7
7
  const { generateId } = this.app.lib.aneka
8
8
  this.component.normalizeAttr(this.params)
@@ -26,7 +26,7 @@ async function formCheckToggle () {
26
26
  const { has } = this.app.lib._
27
27
  const { req } = this.component
28
28
  if (!has(this.params.attr, 'label')) this.params.attr.label = req.t('Toggle Check')
29
- await build.call(this, buildFormCheckToggle, this.params)
29
+ await build.call(this, buildFormCheckToggle)
30
30
  }
31
31
  }
32
32
  }
@@ -1,6 +1,6 @@
1
1
  import { buildFormHint, buildFormLabel, buildFormCheck } from './_lib.js'
2
2
 
3
- export async function build (handler, params = {}) {
3
+ export async function build (handler) {
4
4
  const { isEmpty, get, find } = this.app.lib._
5
5
  const { groupAttrs } = this.app.waibuMpa
6
6
  const { generateId } = this.app.lib.aneka
@@ -49,7 +49,7 @@ export async function build (handler, params = {}) {
49
49
  async function formCheck () {
50
50
  return class FormCheck extends this.app.baseClass.MpaWidget {
51
51
  build = async () => {
52
- await build.call(this, buildFormCheck, this.params)
52
+ await build.call(this, buildFormCheck)
53
53
  }
54
54
  }
55
55
  }
@@ -4,7 +4,7 @@ import { build } from './form-input.js'
4
4
  async function formColor () {
5
5
  return class FormColor extends this.app.baseClass.MpaWidget {
6
6
  build = async () => {
7
- await build.call(this, buildFormColor, this.params)
7
+ await build.call(this, buildFormColor)
8
8
  }
9
9
  }
10
10
  }
@@ -53,7 +53,7 @@ export function inlineScript (cls) {
53
53
  return (cls.inlineScript ?? '') + '\n' + items
54
54
  }
55
55
 
56
- export async function handler (opts, params = {}) {
56
+ export async function handler (opts) {
57
57
  const { jsonStringify } = this.app.waibuMpa
58
58
  const { generateId } = this.app.lib.aneka
59
59
  this.params.attr.id = generateId('alpha')
@@ -71,7 +71,7 @@ export async function handler (opts, params = {}) {
71
71
  }
72
72
  })
73
73
  `
74
- await build.call(this, buildFormInput, this.params)
74
+ await build.call(this, buildFormInput)
75
75
  }
76
76
 
77
77
  async function formDatetime () {
@@ -88,7 +88,7 @@ async function formDatetime () {
88
88
  set(opts, 'display.buttons.today', true)
89
89
  set(opts, 'display.buttons.clear', true)
90
90
  if (this.params.attr.dateRange) set(opts, 'dateRange', true)
91
- await handler.call(this, opts, this.params)
91
+ await handler.call(this, opts)
92
92
  }
93
93
  }
94
94
  }
@@ -9,7 +9,7 @@ async function formFile () {
9
9
  }
10
10
 
11
11
  build = async () => {
12
- await build.call(this, buildFormFile, this.params)
12
+ await build.call(this, buildFormFile)
13
13
  }
14
14
  }
15
15
  }
@@ -1,11 +1,11 @@
1
1
  import { buildFormHint, buildFormLabel, buildFormInput } from './_lib.js'
2
2
  import { sizes } from '../method/after-build-tag/_lib.js'
3
3
 
4
- export async function handleInput ({ handler, group, params } = {}) {
4
+ export async function handleInput ({ handler, group } = {}) {
5
5
  const { trim, filter, has, omit, pull, find, get } = this.app.lib._
6
6
  const { attrToArray } = this.app.waibu
7
7
  const { $ } = this.component
8
- const addons = []
8
+ const addons = [...(this.params.addons ?? [])]
9
9
  const isLabel = has(this.params.attr, 'label')
10
10
  const isLabelFloating = group.label && group.label.floating && isLabel
11
11
  if (isLabelFloating) {
@@ -23,7 +23,7 @@ export async function handleInput ({ handler, group, params } = {}) {
23
23
  const result = {
24
24
  prepend: [],
25
25
  append: [],
26
- input: await handler.call(this, group, this.params)
26
+ input: await handler.call(this, group)
27
27
  }
28
28
  if (group._.name) {
29
29
  const details = get(this, 'component.locals.error.details', [])
@@ -82,7 +82,7 @@ export async function handleInput ({ handler, group, params } = {}) {
82
82
  return contents
83
83
  }
84
84
 
85
- export async function build (handler, params = {}) {
85
+ export async function build (handler) {
86
86
  const { generateId } = this.app.lib.aneka
87
87
  const { groupAttrs } = this.app.waibuMpa
88
88
  this.component.normalizeAttr(this.params, { autoId: true, type: this.params.attr.type ?? 'text' })
@@ -100,7 +100,7 @@ export async function build (handler, params = {}) {
100
100
  datalist = group._.datalist
101
101
  group._.list = generateId('alpha')
102
102
  }
103
- const contents = await handleInput.call(this, { handler, params, group })
103
+ const contents = await handleInput.call(this, { handler, group })
104
104
  if (datalist) {
105
105
  const args = { tag: 'datalist', attr: { id: group._.list, options: datalist }, html: '' }
106
106
  const cmp = await this.component.buildTag(args)
@@ -124,7 +124,7 @@ export async function build (handler, params = {}) {
124
124
  async function formInput () {
125
125
  return class FormInput extends this.app.baseClass.MpaWidget {
126
126
  build = async () => {
127
- await build.call(this, buildFormInput, this.params)
127
+ await build.call(this, buildFormInput)
128
128
  }
129
129
  }
130
130
  }
@@ -5,7 +5,7 @@ async function formPassword () {
5
5
  return class FormPassword extends this.app.baseClass.MpaWidget {
6
6
  build = async () => {
7
7
  this.params.attr.type = 'password'
8
- await build.call(this, buildFormInput, this.params)
8
+ await build.call(this, buildFormInput)
9
9
  }
10
10
  }
11
11
  }
@@ -8,6 +8,7 @@ async function formPlaintext () {
8
8
  const { isEmpty, get } = this.app.lib._
9
9
  const { escape } = this.app.waibu
10
10
  this.params.attr.disabled = true
11
+ this.params.attr.background = 'color:secondary opacity:10'
11
12
  const { name } = this.params.attr
12
13
  if (this.params.attr.labelFloating) this.params.attr.class.push('border', 'rounded')
13
14
  if (!isEmpty(name) && isEmpty(this.params.attr.value)) {
@@ -26,7 +27,7 @@ async function formPlaintext () {
26
27
  this.params.attr.value = value
27
28
  this.params.attr.dataType = prop.type
28
29
  }
29
- await build.call(this, buildFormPlaintext, this.params)
30
+ await build.call(this, buildFormPlaintext)
30
31
  }
31
32
  }
32
33
  }
@@ -5,7 +5,7 @@ async function formRadioToggle () {
5
5
  return class FormRadioToggle extends this.app.baseClass.MpaWidget {
6
6
  build = async () => {
7
7
  if (!this.params.attr.label) this.params.attr.label = this.component.req.t('Toggle Radio')
8
- await build.call(this, buildFormRadioToggle, this.params)
8
+ await build.call(this, buildFormRadioToggle)
9
9
  }
10
10
  }
11
11
  }
@@ -4,7 +4,7 @@ import { build } from './form-check.js'
4
4
  async function formRadio () {
5
5
  return class FormRadio extends this.app.baseClass.MpaWidget {
6
6
  build = async () => {
7
- await build.call(this, buildFormRadio, this.params)
7
+ await build.call(this, buildFormRadio)
8
8
  }
9
9
  }
10
10
  }
@@ -6,7 +6,7 @@ async function formRange () {
6
6
  build = async () => {
7
7
  this.params.attr.type = 'range'
8
8
  delete this.params.attr.labelFloating
9
- await build.call(this, buildFormRange, this.params)
9
+ await build.call(this, buildFormRange)
10
10
  }
11
11
  }
12
12
  }
@@ -142,7 +142,7 @@ async function formSelectExt () {
142
142
  this.params.attr['x-data'] = `{ ${xData.join(',\n')} }`
143
143
  // this.params.attr['@load.window'] = 'onLoad()'
144
144
  this.params.attr['x-init'] = 'onLoad()'
145
- await build.call(this, buildFormSelect, this.params)
145
+ await build.call(this, buildFormSelect)
146
146
  /*
147
147
  let options = []
148
148
  if (this.params.attr.options) {
@@ -10,7 +10,7 @@ async function formSwitch () {
10
10
  }
11
11
 
12
12
  build = async () => {
13
- await build.call(this, buildFormSwitch, this.params)
13
+ await build.call(this, buildFormSwitch)
14
14
  }
15
15
  }
16
16
  }
@@ -4,7 +4,7 @@ import { build } from './form-input.js'
4
4
  async function formTextarea () {
5
5
  return class FormTextarea extends this.app.baseClass.MpaWidget {
6
6
  build = async () => {
7
- await build.call(this, buildFormTextarea, this.params)
7
+ await build.call(this, buildFormTextarea)
8
8
  }
9
9
  }
10
10
  }
@@ -93,9 +93,7 @@ async function navDropdownSetting () {
93
93
  async signout () {
94
94
  await wbs.confirmation(\`${this.component.req.t('signoutWarning')}\`, {
95
95
  ok: '${id}:post',
96
- close: 'y',
97
- theme: '${this.component.theme.name}',
98
- iconset: '${this.component.iconset.name}'
96
+ close: 'y'
99
97
  })
100
98
  },
101
99
  post () {
@@ -10,9 +10,7 @@ async function navItemSignout () {
10
10
  async signout () {
11
11
  await wbs.confirmation(\`${this.component.req.t('signoutWarning')}\`, {
12
12
  ok: '${this.params.attr.id}:post',
13
- close: 'y',
14
- theme: '${this.component.theme.name}',
15
- iconset: '${this.component.iconset.name}'
13
+ close: 'y'
16
14
  })
17
15
  },
18
16
  post () {
@@ -1,4 +1,4 @@
1
- function formatSentence (item, params) {
1
+ function formatSentence (item) {
2
2
  const { kebabCase, omit, merge } = this.app.lib._
3
3
  const { isSet } = this.app.lib.aneka
4
4
  if (item.divider) return '<c:li class="nav-item"><c:hr margin="y-2"/></c:li>'
@@ -59,14 +59,14 @@ async function sidebar () {
59
59
  let items = filter(this.component.locals.sidebar ?? [], s => !s.bottom)
60
60
  html.push(`<c:nav tag="ul" flex="column" margin="bottom-auto" text="align:${this.params.attr.align}" type="pills" ${this.params.attr.expanded ? '' : 'padding="all-1"'}>`)
61
61
  for (const item of items) {
62
- html.push(formatSentence.call(this, item, this.params))
62
+ html.push(formatSentence.call(this, item))
63
63
  }
64
64
  html.push('</c:nav>')
65
65
  // bottom
66
66
  html.push(`<c:nav tag="ul" flex="column" text="align:${this.params.attr.align}" type="pills" ${this.params.attr.expanded ? '' : 'padding="all-1"'} ${this.params.attr.fancyProfile ? 'fancy-profile' : ''}>`)
67
67
  items = filter(this.component.locals.sidebar ?? [], s => s.bottom)
68
68
  for (const item of items) {
69
- html.push(formatSentence.call(this, item, this.params))
69
+ html.push(formatSentence.call(this, item))
70
70
  }
71
71
  html.push('</c:nav>')
72
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-bootstrap",
3
- "version": "2.9.2",
3
+ "version": "2.11.0",
4
4
  "description": "Bootstrap suport for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-06-01
4
+
5
+ - [2.11.0] Remove ```params``` on all widget since it already there through ```this.params```
6
+ - [2.11.0] Add feature to add addons on all form inputs through schema
7
+
8
+ ## 2026-05-25
9
+
10
+ - [2.10.0] Bug fix in ```_lib.js```
11
+ - [2.10.0] Add dimmed background for ```form-plaintext``` widget
12
+ - [2.10.0] Auto detect theme & iconset
13
+
3
14
  ## 2026-05-22
4
15
 
5
16
  - [2.9.2] Bug fix in ```drawer``` widget