waibu-bootstrap 1.0.19 → 1.1.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/package.json +1 -1
- package/waibuMpa/theme/component/factory/accordion-item.js +1 -1
- package/waibuMpa/theme/component/factory/accordion.js +1 -1
- package/waibuMpa/theme/component/factory/alert.js +1 -1
- package/waibuMpa/theme/component/factory/app-launcher-trigger.js +1 -1
- package/waibuMpa/theme/component/factory/app-launcher.js +1 -1
- package/waibuMpa/theme/component/factory/badge.js +1 -1
- package/waibuMpa/theme/component/factory/blockquote.js +1 -1
- package/waibuMpa/theme/component/factory/breadcrumb-item.js +1 -1
- package/waibuMpa/theme/component/factory/breadcrumb.js +1 -1
- package/waibuMpa/theme/component/factory/btn-back-to-top.js +1 -1
- package/waibuMpa/theme/component/factory/btn-group.js +1 -1
- package/waibuMpa/theme/component/factory/btn.js +1 -1
- package/waibuMpa/theme/component/factory/card-footer.js +1 -1
- package/waibuMpa/theme/component/factory/card-header.js +1 -1
- package/waibuMpa/theme/component/factory/card.js +1 -1
- package/waibuMpa/theme/component/factory/carousel-item.js +1 -1
- package/waibuMpa/theme/component/factory/carousel.js +1 -1
- package/waibuMpa/theme/component/factory/collapse.js +1 -1
- package/waibuMpa/theme/component/factory/container.js +1 -1
- package/waibuMpa/theme/component/factory/drawer.js +1 -1
- package/waibuMpa/theme/component/factory/dropdown-item.js +1 -1
- package/waibuMpa/theme/component/factory/dropdown.js +1 -1
- package/waibuMpa/theme/component/factory/fieldset.js +1 -1
- package/waibuMpa/theme/component/factory/figure.js +1 -1
- package/waibuMpa/theme/component/factory/form-check-toggle.js +1 -1
- package/waibuMpa/theme/component/factory/form-check.js +1 -1
- package/waibuMpa/theme/component/factory/form-color.js +1 -1
- package/waibuMpa/theme/component/factory/form-date.js +1 -1
- package/waibuMpa/theme/component/factory/form-datetime.js +1 -1
- package/waibuMpa/theme/component/factory/form-file.js +1 -1
- package/waibuMpa/theme/component/factory/form-input.js +1 -1
- package/waibuMpa/theme/component/factory/form-password.js +1 -1
- package/waibuMpa/theme/component/factory/form-plaintext.js +1 -1
- package/waibuMpa/theme/component/factory/form-radio-toggle.js +1 -1
- package/waibuMpa/theme/component/factory/form-radio.js +1 -1
- package/waibuMpa/theme/component/factory/form-range.js +1 -1
- package/waibuMpa/theme/component/factory/form-select-country.js +1 -1
- package/waibuMpa/theme/component/factory/form-select-ext.js +1 -1
- package/waibuMpa/theme/component/factory/form-select.js +1 -1
- package/waibuMpa/theme/component/factory/form-switch.js +1 -1
- package/waibuMpa/theme/component/factory/form-textarea.js +1 -1
- package/waibuMpa/theme/component/factory/form-time.js +1 -1
- package/waibuMpa/theme/component/factory/form.js +1 -1
- package/waibuMpa/theme/component/factory/grid-col.js +1 -1
- package/waibuMpa/theme/component/factory/img.js +1 -1
- package/waibuMpa/theme/component/factory/list-item.js +1 -1
- package/waibuMpa/theme/component/factory/list.js +1 -1
- package/waibuMpa/theme/component/factory/masonry.js +1 -1
- package/waibuMpa/theme/component/factory/modal.js +1 -1
- package/waibuMpa/theme/component/factory/nav-divider.js +1 -1
- package/waibuMpa/theme/component/factory/nav-dropdown-darkmode.js +1 -1
- package/waibuMpa/theme/component/factory/nav-dropdown-language.js +1 -1
- package/waibuMpa/theme/component/factory/nav-dropdown-setting.js +20 -5
- package/waibuMpa/theme/component/factory/nav-dropdown-user.js +25 -12
- package/waibuMpa/theme/component/factory/nav-item-signout.js +1 -1
- package/waibuMpa/theme/component/factory/nav-item.js +1 -1
- package/waibuMpa/theme/component/factory/nav-toggle-fullscreen.js +1 -1
- package/waibuMpa/theme/component/factory/nav.js +1 -1
- package/waibuMpa/theme/component/factory/navbar.js +1 -1
- package/waibuMpa/theme/component/factory/pagination-item.js +1 -1
- package/waibuMpa/theme/component/factory/pagination.js +1 -1
- package/waibuMpa/theme/component/factory/progress-stack.js +1 -1
- package/waibuMpa/theme/component/factory/progress.js +1 -1
- package/waibuMpa/theme/component/factory/scrollspy.js +1 -1
- package/waibuMpa/theme/component/factory/sidebar.js +2 -2
- package/waibuMpa/theme/component/factory/table.js +1 -1
- package/waibuMpa/theme/component/factory/toast.js +1 -1
- package/waibuStatic/asset/css/wbs.css +6 -0
- /package/{bajo → plugin}/.alias +0 -0
- /package/{bajo → plugin}/.dependencies +0 -0
- /package/{bajo → plugin}/config.json +0 -0
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ async function accordionItem () {
|
|
|
9
9
|
this.params.attr.body = this.params.attr.body ?? true
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
async
|
|
12
|
+
build = async () => {
|
|
13
13
|
const { omit, without } = this.plugin.app.bajo.lib._
|
|
14
14
|
const { groupAttrs } = this.plugin.app.waibuMpa
|
|
15
15
|
const group = groupAttrs(this.params.attr, ['body'])
|
|
@@ -13,7 +13,7 @@ async function alert () {
|
|
|
13
13
|
if (this.params.attr.color) this.params.attr.class.push(parseVariant.call(this, { cls, value: this.params.attr.color, values: myColors, prepend: true }))
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
async
|
|
16
|
+
build = async () => {
|
|
17
17
|
const { isEmpty } = this.plugin.app.bajo.lib._
|
|
18
18
|
const { $ } = this.component
|
|
19
19
|
const html = $(`<div>${this.params.html}</div>`).children().each(function () {
|
|
@@ -19,7 +19,7 @@ async function appLauncherTrigger () {
|
|
|
19
19
|
this.params.attr.imgDimHeight = this.params.attr.imgDimHeight ?? 48
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
async
|
|
22
|
+
build = async () => {
|
|
23
23
|
const { fastGlob } = this.plugin.app.bajo.lib
|
|
24
24
|
const { omit } = this.plugin.app.bajo.lib._
|
|
25
25
|
let logo = 'waibu'
|
|
@@ -8,7 +8,7 @@ async function appLauncher () {
|
|
|
8
8
|
this.params.attr.type = this.params.attr.type ?? 'drawer'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
async
|
|
11
|
+
build = async () => {
|
|
12
12
|
const { groupAttrs, attrToArray } = this.plugin.app.waibuMpa
|
|
13
13
|
const group = groupAttrs(this.params.attr, ['trigger'])
|
|
14
14
|
let launcher = `<c:drawer id="${this.params.attr.id}" t:title="Modules" no-padding>\n`
|
|
@@ -8,7 +8,7 @@ async function badge () {
|
|
|
8
8
|
this.component.normalizeAttr(this.params, { tag: 'span' })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
async
|
|
11
|
+
build = async () => {
|
|
12
12
|
const { isString, omit } = this.plugin.app.bajo.lib._
|
|
13
13
|
if (isString(this.params.attr.alt)) this.params.html += `<span class="visually-hidden">${this.params.attr.alt}</span>`
|
|
14
14
|
if (this.params.attr.dot) {
|
|
@@ -8,7 +8,7 @@ async function breadcrumbItem () {
|
|
|
8
8
|
this.component.normalizeAttr(this.params, { tag: 'li', cls })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
async
|
|
11
|
+
build = async () => {
|
|
12
12
|
const { omit } = this.plugin.app.bajo.lib._
|
|
13
13
|
const { attrToArray } = this.plugin.app.waibuMpa
|
|
14
14
|
if (this.params.attr.href) {
|
|
@@ -37,7 +37,7 @@ async function breadcrumb () {
|
|
|
37
37
|
this.component.normalizeAttr(this.params, { tag: 'ol', cls })
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
async
|
|
40
|
+
build = async () => {
|
|
41
41
|
const { isString, omit } = this.plugin.app.bajo.lib._
|
|
42
42
|
const { routePath } = this.plugin.app.waibu
|
|
43
43
|
const { urlToBreadcrumb, attrToArray } = this.plugin.app.waibuMpa
|
|
@@ -14,7 +14,7 @@ async function btnBackToTop () {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
async
|
|
17
|
+
build = async () => {
|
|
18
18
|
this.params.attr['x-data'] = `{
|
|
19
19
|
scroll () {
|
|
20
20
|
if (document.body.scrollTop > ${this.params.attr.revealAt} || document.documentElement.scrollTop > ${this.params.attr.revealAt}) {
|
|
@@ -11,7 +11,7 @@ async function btnGroup () {
|
|
|
11
11
|
if (this.params.attr.size) this.params.attr.class.push(parseSimple.call(this, { cls, value: this.params.attr.size, values: sizes }))
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
async
|
|
14
|
+
build = async () => {
|
|
15
15
|
const { $ } = this.component
|
|
16
16
|
const html = []
|
|
17
17
|
$(`<div>${this.params.html}</div>`).children().each(function () {
|
|
@@ -11,7 +11,7 @@ async function btn () {
|
|
|
11
11
|
this.params.attr.class.push(cls)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
async
|
|
14
|
+
build = async () => {
|
|
15
15
|
const { has, omit, isString } = this.plugin.app.bajo.lib._
|
|
16
16
|
// tag
|
|
17
17
|
this.params.tag = !!this.params.attr.href || this.params.attr.tag === 'a' ? 'a' : 'button'
|
|
@@ -8,7 +8,7 @@ async function card () {
|
|
|
8
8
|
this.component.normalizeAttr(this.params, { tag: 'div', cls })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
async
|
|
11
|
+
build = async () => {
|
|
12
12
|
const { $ } = this.component
|
|
13
13
|
const children = $(`<div>${this.params.html}</div>`).children()
|
|
14
14
|
this.params.html = children.each(function (idx) {
|
|
@@ -8,7 +8,7 @@ async function carouselItem () {
|
|
|
8
8
|
this.component.normalizeAttr(this.params, { tag: 'div', cls, dataBsInterval: this.params.attr.interval })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
async
|
|
11
|
+
build = async () => {
|
|
12
12
|
const { isString } = this.plugin.app.bajo.lib._
|
|
13
13
|
if (isString(this.params.attr.caption)) {
|
|
14
14
|
const captions = ['<div class="carousel-caption d-none d-md-block">']
|
|
@@ -13,7 +13,7 @@ async function carousel () {
|
|
|
13
13
|
this.params.html = `<div class="${cls}-inner">${this.params.html}</div>`
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
async
|
|
16
|
+
build = async () => {
|
|
17
17
|
const { attrToArray } = this.plugin.app.waibuMpa
|
|
18
18
|
const { $ } = this.component
|
|
19
19
|
let activeItem = 0
|
|
@@ -8,7 +8,7 @@ function collectAttr (group, item) {
|
|
|
8
8
|
|
|
9
9
|
async function collapse () {
|
|
10
10
|
return class Collapse extends this.baseFactory {
|
|
11
|
-
async
|
|
11
|
+
build = async () => {
|
|
12
12
|
const { generateId } = this.plugin.app.bajo
|
|
13
13
|
const { merge, isString } = this.plugin.app.bajo.lib._
|
|
14
14
|
const { attrToArray, groupAttrs } = this.plugin.app.waibuMpa
|
|
@@ -9,7 +9,7 @@ async function container () {
|
|
|
9
9
|
this.component.normalizeAttr(this.params, { tag: 'div' })
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
async
|
|
12
|
+
build = async () => {
|
|
13
13
|
const { has, omit } = this.plugin.app.bajo.lib._
|
|
14
14
|
if (has(this.params.attr, 'responsive')) this.params.attr.class.push(`${cls}-fluid`)
|
|
15
15
|
else if (has(this.params.attr, 'breakpoint')) this.params.attr.class.push(parseSimple({ cls, value: this.params.attr.breakpoint, values: breakpoints }))
|
|
@@ -9,7 +9,7 @@ async function drawer () {
|
|
|
9
9
|
this.component.normalizeAttr(this.params, { tag: 'div', autoId: true, tabIndex: -1 })
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
async
|
|
12
|
+
build = async () => {
|
|
13
13
|
const { isString, omit, trim } = this.plugin.app.bajo.lib._
|
|
14
14
|
const { groupAttrs } = this.plugin.app.waibuMpa
|
|
15
15
|
const { $ } = this.component
|
|
@@ -8,7 +8,7 @@ async function dropdownItem () {
|
|
|
8
8
|
this.component.normalizeAttr(this.params, { tag: 'a' })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
async
|
|
11
|
+
build = async () => {
|
|
12
12
|
const { $ } = this.component
|
|
13
13
|
if ($(this.params.html).children().length === 0 && !this.params.attr.href) this.params.attr.href = '#'
|
|
14
14
|
if (this.params.attr.divider) {
|
|
@@ -71,7 +71,7 @@ async function dropdown () {
|
|
|
71
71
|
this.component.normalizeAttr(this.params, { tag })
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
async
|
|
74
|
+
build = async () => {
|
|
75
75
|
const { merge, cloneDeep, omit } = this.plugin.app.bajo.lib._
|
|
76
76
|
const { groupAttrs } = this.plugin.app.waibuMpa
|
|
77
77
|
const alpinejs = this.plugin.app.waibuAlpinejs
|
|
@@ -6,7 +6,7 @@ async function fieldset () {
|
|
|
6
6
|
if (!this.params.attr.legendType) this.params.attr.legendType = '5'
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
async
|
|
9
|
+
build = async () => {
|
|
10
10
|
const { omit } = this.plugin.app.bajo.lib._
|
|
11
11
|
const { groupAttrs } = this.plugin.app.waibuMpa
|
|
12
12
|
const group = groupAttrs(this.params.attr, ['grid', 'legend', 'card'])
|
|
@@ -8,7 +8,7 @@ async function figure () {
|
|
|
8
8
|
this.component.normalizeAttr(this.params, { cls })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
async
|
|
11
|
+
build = async () => {
|
|
12
12
|
const { $ } = this.component
|
|
13
13
|
this.params.html = $(`<div>${this.params.html}</div>`).children().each(function () {
|
|
14
14
|
if (this.name === 'img') $(this).addClass('figure-img')
|
|
@@ -21,7 +21,7 @@ export async function build (handler, params = {}) {
|
|
|
21
21
|
|
|
22
22
|
async function formCheckToggle () {
|
|
23
23
|
return class FormCheckToggle extends this.baseFactory {
|
|
24
|
-
async
|
|
24
|
+
build = async () => {
|
|
25
25
|
const { has } = this.plugin.app.bajo.lib._
|
|
26
26
|
const { req } = this.component
|
|
27
27
|
if (!has(this.params.attr, 'label')) this.params.attr.label = req.t('Toggle Check')
|
|
@@ -67,7 +67,7 @@ async function formDatetime () {
|
|
|
67
67
|
this.inlineScript = inlineScript
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
async
|
|
70
|
+
build = async () => {
|
|
71
71
|
const { set } = this.plugin.app.bajo.lib._
|
|
72
72
|
const opts = {}
|
|
73
73
|
if (this.params.attr.sideBySide) set(opts, 'display.sideBySide', true)
|
|
@@ -123,7 +123,7 @@ export async function build (handler, params = {}) {
|
|
|
123
123
|
|
|
124
124
|
async function formInput () {
|
|
125
125
|
return class FormInput extends this.baseFactory {
|
|
126
|
-
async
|
|
126
|
+
build = async () => {
|
|
127
127
|
await build.call(this, buildFormInput, this.params)
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -3,7 +3,7 @@ import { build } from './form-input.js'
|
|
|
3
3
|
|
|
4
4
|
async function formPassword () {
|
|
5
5
|
return class FormPassword extends this.baseFactory {
|
|
6
|
-
async
|
|
6
|
+
build = async () => {
|
|
7
7
|
this.params.attr.type = 'password'
|
|
8
8
|
await build.call(this, buildFormInput, this.params)
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ import { build } from './form-input.js'
|
|
|
3
3
|
|
|
4
4
|
async function formPlaintext () {
|
|
5
5
|
return class FormPlaintext extends this.baseFactory {
|
|
6
|
-
async
|
|
6
|
+
build = async () => {
|
|
7
7
|
this.params.attr.disabled = true
|
|
8
8
|
if (this.params.attr.labelFloating) this.params.attr.class.push('border', 'rounded')
|
|
9
9
|
await build.call(this, buildFormPlaintext, this.params)
|
|
@@ -3,7 +3,7 @@ import { build } from './form-check-toggle.js'
|
|
|
3
3
|
|
|
4
4
|
async function formRadioToggle () {
|
|
5
5
|
return class FormRadioToggle extends this.baseFactory {
|
|
6
|
-
async
|
|
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)
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ import { build } from './form-input.js'
|
|
|
3
3
|
|
|
4
4
|
async function formRange () {
|
|
5
5
|
return class FormRange extends this.baseFactory {
|
|
6
|
-
async
|
|
6
|
+
build = async () => {
|
|
7
7
|
this.params.attr.type = 'range'
|
|
8
8
|
delete this.params.attr.labelFloating
|
|
9
9
|
await build.call(this, buildFormRange, this.params)
|
|
@@ -13,7 +13,7 @@ async function formSelectCountry () {
|
|
|
13
13
|
this.params.noTag = true
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
async
|
|
16
|
+
build = async () => {
|
|
17
17
|
const { readConfig } = this.plugin.app.bajo
|
|
18
18
|
const { map } = this.plugin.app.bajo.lib._
|
|
19
19
|
const { base64JsonEncode } = this.plugin.app.waibuMpa
|
|
@@ -33,7 +33,7 @@ async function formSelectExt () {
|
|
|
33
33
|
this.scripts = scripts
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
async
|
|
36
|
+
build = async () => {
|
|
37
37
|
const { omit } = this.plugin.app.bajo.lib._
|
|
38
38
|
const { jsonStringify, base64JsonDecode } = this.plugin.app.waibuMpa
|
|
39
39
|
this.params.attr['x-ref'] = 'select'
|
|
@@ -10,7 +10,7 @@ async function formSelect () {
|
|
|
10
10
|
if (this.params.attr.noLabel) delete this.params.attr.label
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
async
|
|
13
|
+
build = async () => {
|
|
14
14
|
const { groupAttrs } = this.plugin.app.waibuMpa
|
|
15
15
|
const group = groupAttrs(this.params.attr, ['label', 'hint', 'wrapper', 'col'], false)
|
|
16
16
|
const contents = await handleInput.call(this, { handler: buildFormSelect, params: this.params, group })
|
|
@@ -6,7 +6,7 @@ async function form () {
|
|
|
6
6
|
if (!this.params.attr.method) this.params.attr.method = 'POST'
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
async
|
|
9
|
+
build = async () => {
|
|
10
10
|
this.component.locals.form = this.component.locals.form ?? {}
|
|
11
11
|
const { pascalCase } = this.plugin.app.bajo
|
|
12
12
|
const { isEmpty, omit } = this.plugin.app.bajo.lib._
|
|
@@ -20,7 +20,7 @@ async function gridCol () {
|
|
|
20
20
|
this.component.normalizeAttr(this.params, { tag: 'div' })
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
async
|
|
23
|
+
build = async () => {
|
|
24
24
|
const { map, without, isString } = this.plugin.app.bajo.lib._
|
|
25
25
|
const { attrToArray } = this.plugin.app.waibuMpa
|
|
26
26
|
if (this.params.attr.break) {
|
|
@@ -7,7 +7,7 @@ async function listItem () {
|
|
|
7
7
|
this.component.normalizeAttr(this.params, { tag: 'li' })
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
async
|
|
10
|
+
build = async () => {
|
|
11
11
|
const { isString } = this.plugin.app.bajo.lib._
|
|
12
12
|
const { groupAttrs } = this.plugin.app.waibuMpa
|
|
13
13
|
const group = groupAttrs(this.params.attr, ['badge'])
|
|
@@ -9,7 +9,7 @@ async function list () {
|
|
|
9
9
|
this.component.normalizeAttr(this.params, { tag: this.params.attr.ordered ? 'ol' : 'ul' })
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
async
|
|
12
|
+
build = async () => {
|
|
13
13
|
const { isString, omit } = this.plugin.app.bajo.lib._
|
|
14
14
|
const { attribsStringify } = this.plugin.app.waibuMpa
|
|
15
15
|
const { $ } = this.component
|
|
@@ -11,7 +11,7 @@ async function modal () {
|
|
|
11
11
|
this.component.normalizeAttr(this.params, { tag: 'div', cls, autoId: true, tabIndex: -1, ariaHidden: 'true' })
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
async
|
|
14
|
+
build = async () => {
|
|
15
15
|
const { isString, omit } = this.plugin.app.bajo.lib._
|
|
16
16
|
const { groupAttrs } = this.plugin.app.waibuMpa
|
|
17
17
|
const { $ } = this.component
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
async function navDropdownDarkmode () {
|
|
2
2
|
return class NavDropdownDarkmode extends this.baseFactory {
|
|
3
|
-
async
|
|
3
|
+
build = async () => {
|
|
4
4
|
const { titleize } = this.plugin.app.bajo
|
|
5
5
|
const { set } = this.plugin.app.bajo.lib._
|
|
6
6
|
const cfgWmpa = this.plugin.app.waibuMpa.config
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
async function navDropdownLanguage () {
|
|
2
2
|
return class NavDropdownLanguage extends this.baseFactory {
|
|
3
|
-
async
|
|
3
|
+
build = async () => {
|
|
4
4
|
const { camelCase } = this.plugin.app.bajo.lib._
|
|
5
5
|
const { supported } = this.plugin.app.bajo.config.intl
|
|
6
6
|
const lang = this.component.req.lang
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
async function navDropdownSetting () {
|
|
2
2
|
return class NavDropdownSetting extends this.baseFactory {
|
|
3
|
-
async
|
|
3
|
+
build = async () => {
|
|
4
4
|
const { set, camelCase } = this.plugin.app.bajo.lib._
|
|
5
5
|
const { supported } = this.plugin.app.bajo.config.intl
|
|
6
6
|
const { groupAttrs } = this.plugin.app.waibuMpa
|
|
7
7
|
const { generateId } = this.plugin.app.bajo
|
|
8
8
|
const { routePath } = this.plugin.app.waibu
|
|
9
|
+
const { req } = this.component
|
|
9
10
|
const cfgWmpa = this.plugin.app.waibuMpa.config
|
|
10
11
|
|
|
11
12
|
const group = groupAttrs(this.params.attr, ['icon'])
|
|
@@ -13,15 +14,29 @@ async function navDropdownSetting () {
|
|
|
13
14
|
const icon = this.component.req.iconset ? await this.component.buildTag({ tag: 'icon', attr: group.icon }) : ''
|
|
14
15
|
this.params.attr.dropdown = true
|
|
15
16
|
this.params.attr.content = icon
|
|
17
|
+
let profile = `
|
|
18
|
+
<c:dropdown-item href="sumba:/my-stuff/profile" t:content="yourProfile" />
|
|
19
|
+
<c:dropdown-item href="sumba:/my-stuff/change-password" t:content="changePassword" />
|
|
20
|
+
`
|
|
21
|
+
if (this.params.attr.fancyProfile) {
|
|
22
|
+
profile = await this.component.buildSentence(`
|
|
23
|
+
<div>
|
|
24
|
+
<c:dropdown-item href="sumba:/my-stuff/profile">
|
|
25
|
+
<c:img src="dobo:/attachment/SumbaUser/${req.user.id}/profile/main.png" responsive rounded />
|
|
26
|
+
<c:div margin="top-1">${req.user.firstName} ${req.user.lastName}</c:div>
|
|
27
|
+
</c:dropdown-item>
|
|
28
|
+
</div>
|
|
29
|
+
`)
|
|
30
|
+
}
|
|
16
31
|
let html = `
|
|
17
|
-
|
|
18
|
-
<c:dropdown-item
|
|
19
|
-
<c:dropdown-item href="${this.component.buildUrl({ params: set({}, cfgWmpa.darkMode.qsKey, '
|
|
32
|
+
${profile}
|
|
33
|
+
<c:dropdown-item divider />
|
|
34
|
+
<c:dropdown-item href="${this.component.buildUrl({ params: set({}, cfgWmpa.darkMode.qsKey, 'false') })}" ${this.component.req.darkMode ? '' : 'active'} t:content="bright" />
|
|
35
|
+
<c:dropdown-item href="${this.component.buildUrl({ params: set({}, cfgWmpa.darkMode.qsKey, 'true') })}" ${!this.component.req.darkMode ? '' : 'active'} t:content="dark" />
|
|
20
36
|
`
|
|
21
37
|
if (supported.length > 0) {
|
|
22
38
|
html += `
|
|
23
39
|
<c:dropdown-item divider />
|
|
24
|
-
<c:dropdown-item header t:content="Language" />
|
|
25
40
|
`
|
|
26
41
|
for (const s of supported) {
|
|
27
42
|
html += `<c:dropdown-item href="${this.component.buildUrl({ params: { lang: s } })}" ${this.component.req.lang === s ? 'active' : ''} t:content="${camelCase('lang ' + s)}" />`
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
async function navDropdownUser () {
|
|
2
2
|
return class NavDropdownUser extends this.baseFactory {
|
|
3
|
-
async
|
|
3
|
+
build = async () => {
|
|
4
4
|
const { has } = this.plugin.app.bajo.lib._
|
|
5
5
|
const { routePath } = this.plugin.app.waibu
|
|
6
6
|
const { req } = this.component
|
|
7
7
|
const icon = this.component.req.iconset ? await this.component.buildTag({ tag: 'icon', attr: { name: 'person' } }) : ''
|
|
8
8
|
let text = ''
|
|
9
|
-
if (has(this.params.attr, '
|
|
9
|
+
if (has(this.params.attr, 'title')) {
|
|
10
10
|
if (req.user) {
|
|
11
|
-
if (this.params.attr.
|
|
12
|
-
else if (this.params.attr.
|
|
13
|
-
else
|
|
14
|
-
else text = req.user[this.params.attr.showName]
|
|
11
|
+
if (this.params.attr.title === 'short') text = `${req.user.firstName} ${req.user.lastName[0]}.`
|
|
12
|
+
else if (['firstName', 'lastName', 'username'].includes(this.params.attr.title)) text = req.user[this.params.attr.title]
|
|
13
|
+
else text = `${req.user.firstName} ${req.user.lastName}`
|
|
15
14
|
} else text = req.t('guest')
|
|
16
15
|
}
|
|
17
|
-
if (this.params.attr.noText) text = ''
|
|
18
16
|
const html = []
|
|
19
17
|
const attr = {
|
|
20
18
|
dropdown: true,
|
|
@@ -27,11 +25,26 @@ async function navDropdownUser () {
|
|
|
27
25
|
delete attr.dropdownMenu
|
|
28
26
|
attr.href = routePath(this.component.req.user ? 'sumba:/my-stuff/profile' : 'sumba:/signin')
|
|
29
27
|
} else {
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
if (req.user) {
|
|
29
|
+
if (this.params.attr.fancyProfile) {
|
|
30
|
+
const profile = await this.component.buildSentence(`
|
|
31
|
+
<div>
|
|
32
|
+
<c:dropdown-item href="sumba:/my-stuff/profile">
|
|
33
|
+
<c:img src="dobo:/attachment/SumbaUser/${req.user.id}/profile/main.png" responsive rounded />
|
|
34
|
+
<c:div margin="top-1">${req.user.firstName} ${req.user.lastName}</c:div>
|
|
35
|
+
</c:dropdown-item>
|
|
36
|
+
</div>
|
|
37
|
+
`)
|
|
38
|
+
html.push(profile)
|
|
39
|
+
html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { divider: true } }))
|
|
40
|
+
html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/my-stuff/change-password') }, html: this.component.req.t('changePassword') }))
|
|
41
|
+
html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/signout') }, html: this.component.req.t('signout') }))
|
|
42
|
+
} else {
|
|
43
|
+
html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/my-stuff/profile') }, html: this.component.req.t('yourProfile') }))
|
|
44
|
+
html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/my-stuff/change-password') }, html: this.component.req.t('changePassword') }))
|
|
45
|
+
html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { divider: true } }))
|
|
46
|
+
html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/signout') }, html: this.component.req.t('signout') }))
|
|
47
|
+
}
|
|
35
48
|
} else {
|
|
36
49
|
html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/signin') }, html: this.component.req.t('signin') }))
|
|
37
50
|
html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { divider: true } }))
|
|
@@ -9,7 +9,7 @@ async function navItem () {
|
|
|
9
9
|
this.component.normalizeAttr(this.params, { tag: 'a', cls: 'nav-link', href: this.params.attr.href ?? '#' })
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
async
|
|
12
|
+
build = async () => {
|
|
13
13
|
const { isString } = this.plugin.app.bajo.lib._
|
|
14
14
|
const { groupAttrs } = this.plugin.app.waibuMpa
|
|
15
15
|
const { $ } = this.component
|
|
@@ -9,7 +9,7 @@ async function navbar () {
|
|
|
9
9
|
this.component.normalizeAttr(this.params, { tag: 'nav', cls })
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
async
|
|
12
|
+
build = async () => {
|
|
13
13
|
const { omit, cloneDeep, has } = this.plugin.app.bajo.lib._
|
|
14
14
|
const { generateId, numUnit } = this.plugin.app.bajo
|
|
15
15
|
const { groupAttrs } = this.plugin.app.waibuMpa
|
|
@@ -8,7 +8,7 @@ async function paginationItem () {
|
|
|
8
8
|
this.component.normalizeAttr(this.params, { tag: 'li', cls })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
async
|
|
11
|
+
build = async () => {
|
|
12
12
|
const attr = { class: 'page-link', href: this.params.attr.href ?? '#' }
|
|
13
13
|
const tag = this.params.attr.active || this.params.attr.disabled ? 'span' : 'a'
|
|
14
14
|
if (this.params.attr.active || this.params.attr.disabled) delete attr.href
|
|
@@ -9,7 +9,7 @@ async function pagination () {
|
|
|
9
9
|
this.component.normalizeAttr(this.params, { tag: 'ul', cls })
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
async
|
|
12
|
+
build = async () => {
|
|
13
13
|
const { isString } = this.plugin.app.bajo.lib._
|
|
14
14
|
if (!this.params.attr.margin) this.params.attr.margin = 'bottom-0'
|
|
15
15
|
if (this.params.attr.size) this.params.attr.class.push(parseSimple.call(this, { cls, value: this.params.attr.size, values: sizes }))
|
|
@@ -8,7 +8,7 @@ async function progressStack () {
|
|
|
8
8
|
this.component.normalizeAttr(this.params, { tag: 'div', cls })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
async
|
|
11
|
+
build = async () => {
|
|
12
12
|
const { pick } = this.plugin.app.bajo.lib._
|
|
13
13
|
const { $ } = this.component
|
|
14
14
|
this.params.html = $(`<div>${this.params.html}</div>`).children().each(function () {
|
|
@@ -7,7 +7,7 @@ async function scrollspy () {
|
|
|
7
7
|
this.selector = '.' + cls
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
async
|
|
10
|
+
build = async () => {
|
|
11
11
|
const { isString } = this.plugin.app.bajo.lib._
|
|
12
12
|
const { generateId } = this.plugin.app.bajo
|
|
13
13
|
const target = isString(this.params.attr.target) ? this.params.attr.target : generateId()
|
|
@@ -28,7 +28,7 @@ async function sidebar () {
|
|
|
28
28
|
this.component.normalizeAttr(this.params, { tag: 'div', flex: 'column' })
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
async
|
|
31
|
+
build = async () => {
|
|
32
32
|
const { generateId } = this.plugin.app.bajo
|
|
33
33
|
const { omit, filter } = this.plugin.app.bajo.lib._
|
|
34
34
|
this.params.attr.margin = this.params.attr.margin ?? 'all-3'
|
|
@@ -55,7 +55,7 @@ async function sidebar () {
|
|
|
55
55
|
}
|
|
56
56
|
items = filter(this.component.locals.sidebar ?? [], s => s.bottom)
|
|
57
57
|
if (items.length > 0) {
|
|
58
|
-
html.push(`<c:nav tag="ul" flex="column" text="align:${this.params.attr.align}" type="pills" ${this.params.attr.expanded ? '' : 'padding="all-1"'}>`)
|
|
58
|
+
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' : ''}>`)
|
|
59
59
|
for (const item of items) {
|
|
60
60
|
html.push(formatSentence.call(this, item, this.params))
|
|
61
61
|
}
|
|
@@ -22,7 +22,7 @@ async function table () {
|
|
|
22
22
|
this.component.normalizeAttr(this.params, { cls })
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
async
|
|
25
|
+
build = async () => {
|
|
26
26
|
const { omit } = this.plugin.app.bajo.lib._
|
|
27
27
|
if (this.params.attr.strip) setStrip.call(this, this.params)
|
|
28
28
|
if (this.params.attr.responsive) setResponsive.call(this, this.params)
|
|
@@ -8,7 +8,7 @@ async function toast () {
|
|
|
8
8
|
this.component.normalizeAttr(this.params, { cls, tag: 'div', role: 'alert', ariaLive: 'assertive', ariaAtomic: 'true' })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
async
|
|
11
|
+
build = async () => {
|
|
12
12
|
const { isString, omit, has, get } = this.plugin.app.bajo.lib._
|
|
13
13
|
const header = []
|
|
14
14
|
if (this.params.attr.noHide) this.params.attr.dataBsAutohide = 'false'
|
/package/{bajo → plugin}/.alias
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|