waibu-bootstrap 2.10.0 → 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.
- package/extend/waibuMpa/theme/component/widget/_lib.js +15 -15
- package/extend/waibuMpa/theme/component/widget/form-check-toggle.js +2 -2
- package/extend/waibuMpa/theme/component/widget/form-check.js +2 -2
- package/extend/waibuMpa/theme/component/widget/form-color.js +1 -1
- package/extend/waibuMpa/theme/component/widget/form-datetime.js +3 -3
- package/extend/waibuMpa/theme/component/widget/form-file.js +1 -1
- package/extend/waibuMpa/theme/component/widget/form-input.js +6 -6
- package/extend/waibuMpa/theme/component/widget/form-password.js +1 -1
- package/extend/waibuMpa/theme/component/widget/form-plaintext.js +1 -1
- package/extend/waibuMpa/theme/component/widget/form-radio-toggle.js +1 -1
- package/extend/waibuMpa/theme/component/widget/form-radio.js +1 -1
- package/extend/waibuMpa/theme/component/widget/form-range.js +1 -1
- package/extend/waibuMpa/theme/component/widget/form-select-ext.js +1 -1
- package/extend/waibuMpa/theme/component/widget/form-switch.js +1 -1
- package/extend/waibuMpa/theme/component/widget/form-textarea.js +1 -1
- package/extend/waibuMpa/theme/component/widget/sidebar.js +3 -3
- package/package.json +1 -1
- package/wiki/CHANGES.md +5 -0
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
91
|
+
await handler.call(this, opts)
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -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
|
|
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
|
|
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
|
|
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,
|
|
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
|
|
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
|
|
8
|
+
await build.call(this, buildFormInput)
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -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
|
|
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
|
|
7
|
+
await build.call(this, buildFormRadio)
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -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
|
|
145
|
+
await build.call(this, buildFormSelect)
|
|
146
146
|
/*
|
|
147
147
|
let options = []
|
|
148
148
|
if (this.params.attr.options) {
|
|
@@ -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
|
|
7
|
+
await build.call(this, buildFormTextarea)
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function formatSentence (item
|
|
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
|
|
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
|
|
69
|
+
html.push(formatSentence.call(this, item))
|
|
70
70
|
}
|
|
71
71
|
html.push('</c:nav>')
|
|
72
72
|
}
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED