waibu-bootstrap 2.1.0 → 2.1.2
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/{factory → widget}/a.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/accordion-item.js +13 -8
- package/extend/waibuMpa/theme/component/{factory → widget}/accordion.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/alert.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/app-launcher-trigger.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/app-launcher.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/badge.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/blockquote.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/breadcrumb-item.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/breadcrumb.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/btn-back-to-top.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/btn-close.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/btn-group.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/btn-toolbar.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/btn.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/card-body.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/card-footer.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/card-group.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/card-header.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/card-link.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/card-subtitle.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/card-text.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/card-title.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/card.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/carousel-item.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/carousel.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/collapse-item.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/collapse.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/container.js +1 -1
- package/extend/waibuMpa/theme/component/widget/drawer-toolbar.js +6 -0
- package/extend/waibuMpa/theme/component/{factory → widget}/drawer.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/dropdown-item.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/dropdown.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/fieldset.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/figcaption.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/figure.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-check-toggle.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-check.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-color.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-date.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-datetime.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-file.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-input-addon.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-input.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-password.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-plaintext.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-radio-toggle.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-radio.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-range.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-select-country.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-select-ext.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-select.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-switch.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-textarea.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form-time.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/form.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/grid-col.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/grid-row.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/heading.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/img.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/lead.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/list-item.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/list.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/masonry.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/modal-body.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/modal-footer.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/modal-header.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/modal.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-divider.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-dropdown-darkmode.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-dropdown-language.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-dropdown-setting.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-item-signout.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-item.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-toggle-fullscreen.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/nav.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/navbar-brand.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/navbar-text.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/navbar.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/pagination-item.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/pagination.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/progress-stack.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/progress.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/scrollspy.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/sidebar.js +2 -2
- package/extend/waibuMpa/theme/component/{factory → widget}/spinner.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/table.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/tbody.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/td.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/tfoot.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/th.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/thead.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/toast-stack.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/toast.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/tr.js +1 -1
- package/extend/waibuStatic/asset/js/wbs.js +10 -8
- package/package.json +1 -1
- package/wiki/CHANGES.md +4 -0
- package/extend/waibuMpa/theme/component/factory/drawer-toolbar.js +0 -6
- /package/extend/waibuMpa/theme/component/{factory → widget}/_lib.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const cls = 'accordion-item'
|
|
2
2
|
|
|
3
3
|
async function accordionItem () {
|
|
4
|
-
return class AccordionItem extends this.
|
|
4
|
+
return class AccordionItem extends this.app.baseClass.MpaWidget {
|
|
5
5
|
constructor (options) {
|
|
6
6
|
super(options)
|
|
7
7
|
this.selector = '.' + cls
|
|
@@ -16,13 +16,18 @@ async function accordionItem () {
|
|
|
16
16
|
if (!group.body.noPadding) group.body.class.push('accordion-body')
|
|
17
17
|
const clsList = without(this.params.attr.class, cls)
|
|
18
18
|
group.header.class.push('accordion-header')
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const btnAttr = {
|
|
20
|
+
class: `${this.params.attr.narrowHeader ? 'px-3 py-2 ' : ''}accordion-button${this.params.attr.showOnStart ? '' : ' collapsed'}`,
|
|
21
|
+
type: 'button',
|
|
22
|
+
dataBsToggle: 'collapse',
|
|
23
|
+
dataBsTarget: `#${this.params.attr.id}`,
|
|
24
|
+
ariaExpanded: this.params.attr.showOnStart,
|
|
25
|
+
ariaControls: this.params.attr.id,
|
|
26
|
+
'x-data': true,
|
|
27
|
+
'@click': `$dispatch('accordion-item', { id: $el.closest('.accordion').id, cls: '${clsList.join(' ')}' })`
|
|
28
|
+
}
|
|
29
|
+
const btn = await this.component.buildTag({ tag: 'button', attr: btnAttr, html: `<c:span margin="end-2">${this.params.attr.header}</c:span>` })
|
|
30
|
+
const header = [`<c:h2 ${stringifyAttribs(group.header)}>`, btn, '</c:h2>']
|
|
26
31
|
const body = await this.component.buildTag({ tag: 'div', attr: group.body, html: this.params.html })
|
|
27
32
|
const details = [`<div id="${this.params.attr.id}" class="accordion-collapse collapse${this.params.attr.showOnStart ? ' show' : ''}">`,
|
|
28
33
|
body, '</div']
|
|
@@ -3,7 +3,7 @@ import { colors, parseVariant } from '../method/after-build-tag/_lib.js'
|
|
|
3
3
|
const cls = 'alert'
|
|
4
4
|
|
|
5
5
|
async function alert () {
|
|
6
|
-
return class Alert extends this.
|
|
6
|
+
return class Alert extends this.app.baseClass.MpaWidget {
|
|
7
7
|
constructor (options) {
|
|
8
8
|
super(options)
|
|
9
9
|
const { without } = this.app.lib._
|
|
@@ -29,7 +29,7 @@ async function generateItems (breadcrumb) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
async function breadcrumb () {
|
|
32
|
-
return class Breadcrumb extends this.
|
|
32
|
+
return class Breadcrumb extends this.app.baseClass.MpaWidget {
|
|
33
33
|
constructor (options) {
|
|
34
34
|
super(options)
|
|
35
35
|
this.selector = '.' + cls
|
|
@@ -3,7 +3,7 @@ import { parseSimple, sizes } from '../method/after-build-tag/_lib.js'
|
|
|
3
3
|
const cls = 'btn-group'
|
|
4
4
|
|
|
5
5
|
async function btnGroup () {
|
|
6
|
-
return class BtnGroup extends this.
|
|
6
|
+
return class BtnGroup extends this.app.baseClass.MpaWidget {
|
|
7
7
|
constructor (options) {
|
|
8
8
|
super(options)
|
|
9
9
|
this.selector = '.' + cls
|
|
@@ -3,7 +3,7 @@ import { parseVariant, parseSimple, sizes, colors, colorVariants } from '../meth
|
|
|
3
3
|
const cls = 'btn'
|
|
4
4
|
|
|
5
5
|
async function btn () {
|
|
6
|
-
return class Btn extends this.
|
|
6
|
+
return class Btn extends this.app.baseClass.MpaWidget {
|
|
7
7
|
constructor (options) {
|
|
8
8
|
super(options)
|
|
9
9
|
this.selector = '.' + cls
|
|
@@ -2,7 +2,7 @@ import { handler } from './card-header.js'
|
|
|
2
2
|
const cls = 'card-footer'
|
|
3
3
|
|
|
4
4
|
async function cardFooter () {
|
|
5
|
-
return class CardFooter extends this.
|
|
5
|
+
return class CardFooter extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.selector = '.' + cls
|
|
@@ -12,7 +12,7 @@ export async function handler (cls, params = {}) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async function cardHeader () {
|
|
15
|
-
return class CardHeader extends this.
|
|
15
|
+
return class CardHeader extends this.app.baseClass.MpaWidget {
|
|
16
16
|
constructor (options) {
|
|
17
17
|
super(options)
|
|
18
18
|
this.selector = '.' + cls
|
|
@@ -7,7 +7,7 @@ function collectAttr (group, item) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
async function collapse () {
|
|
10
|
-
return class Collapse extends this.
|
|
10
|
+
return class Collapse extends this.app.baseClass.MpaWidget {
|
|
11
11
|
build = async () => {
|
|
12
12
|
const { generateId } = this.app.lib.aneka
|
|
13
13
|
const { merge, isString } = this.app.lib._
|
|
@@ -2,7 +2,7 @@ import { breakpoints, parseSimple } from '../method/after-build-tag/_lib.js'
|
|
|
2
2
|
const cls = 'container'
|
|
3
3
|
|
|
4
4
|
async function container () {
|
|
5
|
-
return class Container extends this.
|
|
5
|
+
return class Container extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.selector = '.' + cls
|
|
@@ -2,7 +2,7 @@ import { aligns, breakpoints, parseVariant, parseSimple } from '../method/after-
|
|
|
2
2
|
const cls = 'offcanvas'
|
|
3
3
|
|
|
4
4
|
async function drawer () {
|
|
5
|
-
return class Drawer extends this.
|
|
5
|
+
return class Drawer extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.selector = '.' + cls
|
|
@@ -62,7 +62,7 @@ export async function buildMenu (params = {}) { // scope: component
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
async function dropdown () {
|
|
65
|
-
return class Dropdown extends this.
|
|
65
|
+
return class Dropdown extends this.app.baseClass.MpaWidget {
|
|
66
66
|
constructor (options) {
|
|
67
67
|
super(options)
|
|
68
68
|
const { isString } = this.app.lib._
|
|
@@ -21,7 +21,7 @@ export async function build (handler, params = {}) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
async function formCheckToggle () {
|
|
24
|
-
return class FormCheckToggle extends this.
|
|
24
|
+
return class FormCheckToggle extends this.app.baseClass.MpaWidget {
|
|
25
25
|
build = async () => {
|
|
26
26
|
const { has } = this.app.lib._
|
|
27
27
|
const { req } = this.component
|
|
@@ -47,7 +47,7 @@ export async function build (handler, params = {}) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
async function formCheck () {
|
|
50
|
-
return class FormCheck extends this.
|
|
50
|
+
return class FormCheck extends this.app.baseClass.MpaWidget {
|
|
51
51
|
build = async () => {
|
|
52
52
|
await build.call(this, buildFormCheck, this.params)
|
|
53
53
|
}
|
|
@@ -2,7 +2,7 @@ import { buildFormColor } from './_lib.js'
|
|
|
2
2
|
import { build } from './form-input.js'
|
|
3
3
|
|
|
4
4
|
async function formColor () {
|
|
5
|
-
return class FormColor extends this.
|
|
5
|
+
return class FormColor extends this.app.baseClass.MpaWidget {
|
|
6
6
|
build = async () => {
|
|
7
7
|
await build.call(this, buildFormColor, this.params)
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css, scripts, inlineScript, handler } from './form-datetime.js'
|
|
2
2
|
|
|
3
3
|
async function formDate () {
|
|
4
|
-
return class FormDate extends this.
|
|
4
|
+
return class FormDate extends this.app.baseClass.MpaWidget {
|
|
5
5
|
static css = [...super.css, ...css]
|
|
6
6
|
static scripts = [...super.scripts, ...scripts(this.component.req)]
|
|
7
7
|
static inlineScript = inlineScript(this.component.req)
|
|
@@ -59,7 +59,7 @@ export async function handler (opts, params = {}) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
async function formDatetime () {
|
|
62
|
-
return class FormDatetime extends this.
|
|
62
|
+
return class FormDatetime extends this.app.baseClass.MpaWidget {
|
|
63
63
|
static css = [...super.css, ...css]
|
|
64
64
|
static scripts = [...super.scripts, ...scripts(this.component.req)]
|
|
65
65
|
static inlineScript = inlineScript(this.component.req)
|
|
@@ -2,7 +2,7 @@ import { buildFormFile } from './_lib.js'
|
|
|
2
2
|
import { build } from './form-input.js'
|
|
3
3
|
|
|
4
4
|
async function formFile () {
|
|
5
|
-
return class FormFile extends this.
|
|
5
|
+
return class FormFile extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.params.attr.type = 'file'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
async function formInputAddon () {
|
|
2
|
-
return class FormInputAddon extends this.
|
|
2
|
+
return class FormInputAddon extends this.app.baseClass.MpaWidget {
|
|
3
3
|
constructor (options) {
|
|
4
4
|
super(options)
|
|
5
5
|
this.component.normalizeAttr(this.params, { tag: 'div', addon: this.params.attr.prepend ? 'prepend' : 'append' })
|
|
@@ -122,7 +122,7 @@ export async function build (handler, params = {}) {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
async function formInput () {
|
|
125
|
-
return class FormInput extends this.
|
|
125
|
+
return class FormInput extends this.app.baseClass.MpaWidget {
|
|
126
126
|
build = async () => {
|
|
127
127
|
await build.call(this, buildFormInput, this.params)
|
|
128
128
|
}
|
|
@@ -2,7 +2,7 @@ import { buildFormInput } from './_lib.js'
|
|
|
2
2
|
import { build } from './form-input.js'
|
|
3
3
|
|
|
4
4
|
async function formPassword () {
|
|
5
|
-
return class FormPassword extends this.
|
|
5
|
+
return class FormPassword extends this.app.baseClass.MpaWidget {
|
|
6
6
|
build = async () => {
|
|
7
7
|
this.params.attr.type = 'password'
|
|
8
8
|
await build.call(this, buildFormInput, this.params)
|
|
@@ -2,7 +2,7 @@ import { buildFormPlaintext } from './_lib.js'
|
|
|
2
2
|
import { build } from './form-input.js'
|
|
3
3
|
|
|
4
4
|
async function formPlaintext () {
|
|
5
|
-
return class FormPlaintext extends this.
|
|
5
|
+
return class FormPlaintext extends this.app.baseClass.MpaWidget {
|
|
6
6
|
build = async () => {
|
|
7
7
|
this.params.attr.disabled = true
|
|
8
8
|
if (this.params.attr.labelFloating) this.params.attr.class.push('border', 'rounded')
|
|
@@ -2,7 +2,7 @@ import { buildFormRadioToggle } from './_lib.js'
|
|
|
2
2
|
import { build } from './form-check-toggle.js'
|
|
3
3
|
|
|
4
4
|
async function formRadioToggle () {
|
|
5
|
-
return class FormRadioToggle extends this.
|
|
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
8
|
await build.call(this, buildFormRadioToggle, this.params)
|
|
@@ -2,7 +2,7 @@ import { buildFormRadio } from './_lib.js'
|
|
|
2
2
|
import { build } from './form-check.js'
|
|
3
3
|
|
|
4
4
|
async function formRadio () {
|
|
5
|
-
return class FormRadio extends this.
|
|
5
|
+
return class FormRadio extends this.app.baseClass.MpaWidget {
|
|
6
6
|
build = async () => {
|
|
7
7
|
await build.call(this, buildFormRadio, this.params)
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@ import { buildFormRange } from './_lib.js'
|
|
|
2
2
|
import { build } from './form-input.js'
|
|
3
3
|
|
|
4
4
|
async function formRange () {
|
|
5
|
-
return class FormRange extends this.
|
|
5
|
+
return class FormRange extends this.app.baseClass.MpaWidget {
|
|
6
6
|
build = async () => {
|
|
7
7
|
this.params.attr.type = 'range'
|
|
8
8
|
delete this.params.attr.labelFloating
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { inlineCss, css, scripts } from './form-select-ext.js'
|
|
2
2
|
|
|
3
3
|
async function formSelectCountry () {
|
|
4
|
-
return class FormSelectCountry extends this.
|
|
4
|
+
return class FormSelectCountry extends this.app.baseClass.MpaWidget {
|
|
5
5
|
static css = [...super.css, css]
|
|
6
6
|
|
|
7
7
|
static scripts = [...super.scripts, scripts]
|
|
@@ -38,7 +38,7 @@ export const css = 'waibuExtra.virtual:/tom-select/css/tom-select.bootstrap5.min
|
|
|
38
38
|
export const scripts = 'waibuExtra.virtual:/tom-select/js/tom-select.complete.min.js'
|
|
39
39
|
|
|
40
40
|
async function formSelectExt () {
|
|
41
|
-
return class FormSelectExt extends this.
|
|
41
|
+
return class FormSelectExt extends this.app.baseClass.MpaWidget {
|
|
42
42
|
static css = [...super.css, css]
|
|
43
43
|
static scripts = [...super.scripts, scripts]
|
|
44
44
|
static inlineCss = inlineCss
|
|
@@ -2,7 +2,7 @@ import { buildFormSelect } from './_lib.js'
|
|
|
2
2
|
import { handleInput } from './form-input.js'
|
|
3
3
|
|
|
4
4
|
async function formSelect () {
|
|
5
|
-
return class FormSelect extends this.
|
|
5
|
+
return class FormSelect extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.component.normalizeAttr(this.params, { autoId: true })
|
|
@@ -2,7 +2,7 @@ import { buildFormSwitch } from './_lib.js'
|
|
|
2
2
|
import { build } from './form-check.js'
|
|
3
3
|
|
|
4
4
|
async function formSwitch () {
|
|
5
|
-
return class FormSwitch extends this.
|
|
5
|
+
return class FormSwitch extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.params.attr.wrapperClass = this.params.attr.wrapperClass ?? ''
|
|
@@ -2,7 +2,7 @@ import { buildFormTextarea } from './_lib.js'
|
|
|
2
2
|
import { build } from './form-input.js'
|
|
3
3
|
|
|
4
4
|
async function formTextarea () {
|
|
5
|
-
return class FormTextarea extends this.
|
|
5
|
+
return class FormTextarea extends this.app.baseClass.MpaWidget {
|
|
6
6
|
build = async () => {
|
|
7
7
|
await build.call(this, buildFormTextarea, this.params)
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css, scripts, inlineScript, handler } from './form-datetime.js'
|
|
2
2
|
|
|
3
3
|
async function formTime () {
|
|
4
|
-
return class FormTime extends this.
|
|
4
|
+
return class FormTime extends this.app.baseClass.MpaWidget {
|
|
5
5
|
static css = [...super.css, ...css]
|
|
6
6
|
static scripts = [...super.scripts, ...scripts(this.component.req)]
|
|
7
7
|
static inlineScript = inlineScript(this.component.req)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const inlineClass = 'list-inline-item'
|
|
2
2
|
|
|
3
3
|
async function listItem () {
|
|
4
|
-
return class ListItem extends this.
|
|
4
|
+
return class ListItem extends this.app.baseClass.MpaWidget {
|
|
5
5
|
constructor (options) {
|
|
6
6
|
super(options)
|
|
7
7
|
this.component.normalizeAttr(this.params, { tag: 'li' })
|
|
@@ -2,7 +2,7 @@ import { breakpoints, colors, parseVariant } from '../method/after-build-tag/_li
|
|
|
2
2
|
const cls = 'list'
|
|
3
3
|
|
|
4
4
|
async function list () {
|
|
5
|
-
return class List extends this.
|
|
5
|
+
return class List extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.selector = '.' + cls
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import gutter from '../method/after-build-tag/gutter.js'
|
|
2
2
|
|
|
3
3
|
async function masonry () {
|
|
4
|
-
return class Masonry extends this.
|
|
4
|
+
return class Masonry extends this.app.baseClass.MpaWidget {
|
|
5
5
|
constructor (options) {
|
|
6
6
|
super(options)
|
|
7
7
|
this.component.normalizeAttr(this.params)
|
|
@@ -4,7 +4,7 @@ const modalSizes = ['xl', ...sizes]
|
|
|
4
4
|
const fullscreens = breakpoints.map(b => `${b}-down`)
|
|
5
5
|
|
|
6
6
|
async function modal () {
|
|
7
|
-
return class Modal extends this.
|
|
7
|
+
return class Modal extends this.app.baseClass.MpaWidget {
|
|
8
8
|
constructor (options) {
|
|
9
9
|
super(options)
|
|
10
10
|
this.selector = '.' + cls
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
async function navDropdownDarkmode () {
|
|
2
|
-
return class NavDropdownDarkmode extends this.
|
|
2
|
+
return class NavDropdownDarkmode extends this.app.baseClass.MpaWidget {
|
|
3
3
|
build = async () => {
|
|
4
4
|
const { titleize, isSet } = this.app.lib.aneka
|
|
5
5
|
const { set, omit } = this.app.lib._
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
async function navDropdownLanguage () {
|
|
2
|
-
return class NavDropdownLanguage extends this.
|
|
2
|
+
return class NavDropdownLanguage extends this.app.baseClass.MpaWidget {
|
|
3
3
|
build = async () => {
|
|
4
4
|
const { camelCase, cloneDeep, omit } = this.app.lib._
|
|
5
5
|
const { supported } = this.app.bajo.config.intl
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
async function navDropdownSetting () {
|
|
2
|
-
return class NavDropdownSetting extends this.
|
|
2
|
+
return class NavDropdownSetting extends this.app.baseClass.MpaWidget {
|
|
3
3
|
build = async () => {
|
|
4
4
|
const { set, camelCase } = this.app.lib._
|
|
5
5
|
const { supported } = this.app.bajo.config.intl
|
|
@@ -2,7 +2,7 @@ import { buildMenu, autoCloses } from './dropdown.js'
|
|
|
2
2
|
const cls = 'nav-item'
|
|
3
3
|
|
|
4
4
|
async function navItem () {
|
|
5
|
-
return class NavItem extends this.
|
|
5
|
+
return class NavItem extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.selector = '.' + cls
|
|
@@ -2,7 +2,7 @@ const cls = 'nav'
|
|
|
2
2
|
const types = ['tabs', 'pills', 'underline']
|
|
3
3
|
|
|
4
4
|
async function nav () {
|
|
5
|
-
return class Nav extends this.
|
|
5
|
+
return class Nav extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
const { isString } = this.app.lib._
|
|
@@ -2,7 +2,7 @@ import { breakpoints, parseSimple } from '../method/after-build-tag/_lib.js'
|
|
|
2
2
|
const cls = 'navbar'
|
|
3
3
|
|
|
4
4
|
async function navbar () {
|
|
5
|
-
return class Navbar extends this.
|
|
5
|
+
return class Navbar extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.selector = '.' + cls
|
|
@@ -2,7 +2,7 @@ import { sizes, parseSimple } from '../method/after-build-tag/_lib.js'
|
|
|
2
2
|
const cls = 'pagination'
|
|
3
3
|
|
|
4
4
|
async function pagination () {
|
|
5
|
-
return class Pagination extends this.
|
|
5
|
+
return class Pagination extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.selector = '.' + cls
|
|
@@ -27,7 +27,7 @@ function formatSentence (item, params) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async function sidebar () {
|
|
30
|
-
return class Sidebar extends this.
|
|
30
|
+
return class Sidebar extends this.app.baseClass.MpaWidget {
|
|
31
31
|
constructor (options) {
|
|
32
32
|
super(options)
|
|
33
33
|
this.component.normalizeAttr(this.params, { tag: 'div', flex: 'column' })
|
|
@@ -47,7 +47,7 @@ async function sidebar () {
|
|
|
47
47
|
this.params.attr.id = generateId('alpha')
|
|
48
48
|
const html = []
|
|
49
49
|
if (this.params.attr.mini) {
|
|
50
|
-
this.params.attr.style.width = this.params.attr.style.width ?? '60px'
|
|
50
|
+
// this.params.attr.style.width = this.params.attr.style.width ?? '60px'
|
|
51
51
|
this.params.attr.align = this.params.attr.align ?? 'center'
|
|
52
52
|
this.params.attr.margin = 'all-0'
|
|
53
53
|
if (this.params.attr.autoFill) {
|
|
@@ -2,7 +2,7 @@ import { sizes, parseSimple } from '../method/after-build-tag/_lib.js'
|
|
|
2
2
|
const types = ['border', 'grow']
|
|
3
3
|
|
|
4
4
|
async function spinner () {
|
|
5
|
-
return class Spinner extends this.
|
|
5
|
+
return class Spinner extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
const type = types.includes(this.params.attr.type) ? this.params.attr.type : 'border'
|
|
@@ -2,7 +2,7 @@ import { colors, parseVariant } from '../method/after-build-tag/_lib.js'
|
|
|
2
2
|
const cls = 'table'
|
|
3
3
|
|
|
4
4
|
async function td () {
|
|
5
|
-
return class Td extends this.
|
|
5
|
+
return class Td extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.selector = `.${cls} td`
|
|
@@ -2,7 +2,7 @@ import { colors, parseVariant } from '../method/after-build-tag/_lib.js'
|
|
|
2
2
|
const cls = 'table'
|
|
3
3
|
|
|
4
4
|
async function th () {
|
|
5
|
-
return class Th extends this.
|
|
5
|
+
return class Th extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.selector = `.${cls} th`
|
|
@@ -2,7 +2,7 @@ import { colors, parseVariant } from '../method/after-build-tag/_lib.js'
|
|
|
2
2
|
const cls = 'table'
|
|
3
3
|
|
|
4
4
|
async function tr () {
|
|
5
|
-
return class Tr extends this.
|
|
5
|
+
return class Tr extends this.app.baseClass.MpaWidget {
|
|
6
6
|
constructor (options) {
|
|
7
7
|
super(options)
|
|
8
8
|
this.selector = `.${cls} tr`
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
/* global
|
|
1
|
+
/* global wmpa, _ */
|
|
2
2
|
|
|
3
3
|
class Wbs {
|
|
4
4
|
constructor () {
|
|
5
|
+
this.engine = window.mdb ?? window.bootstrap
|
|
5
6
|
this.init()
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
init () {
|
|
9
10
|
window.addEventListener('load', evt => {
|
|
10
11
|
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
|
|
11
|
-
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new
|
|
12
|
+
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new this.engine.Popover(popoverTriggerEl)) // eslint-disable-line no-unused-vars
|
|
12
13
|
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
|
13
|
-
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new
|
|
14
|
+
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new this.engine.Tooltip(tooltipTriggerEl)) // eslint-disable-line no-unused-vars
|
|
14
15
|
const toastElList = document.querySelectorAll('.toast')
|
|
15
|
-
const toastList = [...toastElList].map(toastEl => new
|
|
16
|
+
const toastList = [...toastElList].map(toastEl => new this.engine.Toast(toastEl))
|
|
16
17
|
toastList.forEach(toast => toast.show())
|
|
17
18
|
})
|
|
18
19
|
}
|
|
@@ -20,7 +21,7 @@ class Wbs {
|
|
|
20
21
|
getInstance (type, id) {
|
|
21
22
|
if (type === 'Drawer') type = 'Offcanvas'
|
|
22
23
|
const el = typeof id === 'string' ? document.getElementById(id) : id
|
|
23
|
-
return
|
|
24
|
+
return this.engine[type].getOrCreateInstance(el)
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
notifyHtml (id, html) {
|
|
@@ -110,8 +111,9 @@ class Wbs {
|
|
|
110
111
|
const menuId = menu ? `menu="${menu}"` : ''
|
|
111
112
|
const body = [`<c:app-launcher id="${id}" ${toolbar} ${menuId} />`]
|
|
112
113
|
await wmpa.addComponent(body.join('\n'), 'body')
|
|
113
|
-
const item = new
|
|
114
|
+
const item = new this.engine.Offcanvas(`#${id}`)
|
|
114
115
|
const itemEl = document.getElementById(id)
|
|
116
|
+
if (window.mdb) this.engine.Collapse.getOrCreateInstance(itemEl)
|
|
115
117
|
itemEl.addEventListener('hidden.bs.offcanvas', evt => {
|
|
116
118
|
itemEl.remove()
|
|
117
119
|
})
|
|
@@ -155,7 +157,7 @@ class Wbs {
|
|
|
155
157
|
body.push(...buttons)
|
|
156
158
|
body.push('</c:div></c:modal>')
|
|
157
159
|
await wmpa.addComponent(body.join('\n'), 'body')
|
|
158
|
-
const modal = new
|
|
160
|
+
const modal = new this.engine.Modal(`#${id}`)
|
|
159
161
|
const modalEl = document.getElementById(id)
|
|
160
162
|
modalEl.addEventListener('hidden.bs.modal', evt => {
|
|
161
163
|
modalEl.remove()
|
|
@@ -198,7 +200,7 @@ class Wbs {
|
|
|
198
200
|
if (_.isArray(body)) body = body.join('\n')
|
|
199
201
|
if (!['modal', 'offcanvas'].includes(type)) type = 'modal'
|
|
200
202
|
await wmpa.addComponent(body)
|
|
201
|
-
const item = new
|
|
203
|
+
const item = new this.engine[_.upperFirst(type)](`#${id}`)
|
|
202
204
|
const itemEl = document.getElementById(id)
|
|
203
205
|
itemEl.addEventListener(`hidden.bs.${type}`, evt => {
|
|
204
206
|
itemEl.remove()
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
File without changes
|