waibu-bootstrap 2.0.1 → 2.1.1
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/.github/FUNDING.yml +0 -0
- package/.github/workflows/repo-lockdown.yml +0 -0
- package/.jsdoc.conf.json +0 -0
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/docs/WaibuBootstrap.html +0 -0
- package/docs/data/search.json +0 -0
- package/docs/fonts/Inconsolata-Regular.ttf +0 -0
- package/docs/fonts/OpenSans-Regular.ttf +0 -0
- package/docs/fonts/WorkSans-Bold.ttf +0 -0
- package/docs/global.html +0 -0
- package/docs/index.html +0 -0
- package/docs/index.js.html +2 -2
- package/docs/scripts/core.js +0 -0
- package/docs/scripts/core.min.js +0 -0
- package/docs/scripts/resize.js +0 -0
- package/docs/scripts/search.js +0 -0
- package/docs/scripts/search.min.js +0 -0
- package/docs/scripts/third-party/Apache-License-2.0.txt +0 -0
- package/docs/scripts/third-party/fuse.js +0 -0
- package/docs/scripts/third-party/hljs-line-num-original.js +0 -0
- package/docs/scripts/third-party/hljs-line-num.js +0 -0
- package/docs/scripts/third-party/hljs-original.js +0 -0
- package/docs/scripts/third-party/hljs.js +0 -0
- package/docs/scripts/third-party/popper.js +0 -0
- package/docs/scripts/third-party/tippy.js +0 -0
- package/docs/scripts/third-party/tocbot.js +0 -0
- package/docs/scripts/third-party/tocbot.min.js +0 -0
- package/docs/static/bitcoin.jpeg +0 -0
- package/docs/static/home.md +0 -0
- package/docs/static/logo-ecosystem.png +0 -0
- package/docs/static/logo.png +0 -0
- package/docs/styles/clean-jsdoc-theme-base.css +0 -0
- package/docs/styles/clean-jsdoc-theme-dark.css +0 -0
- package/docs/styles/clean-jsdoc-theme-light.css +0 -0
- package/docs/styles/clean-jsdoc-theme-scrollbar.css +0 -0
- package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -0
- package/docs/styles/clean-jsdoc-theme.min.css +0 -0
- package/extend/bajo/hook/waibu-mpa.bootstrap@after-build-page.js +0 -0
- package/extend/bajo/intl/id.json +0 -0
- package/extend/waibuMpa/theme/component/method/after-build-tag/_lib.js +0 -0
- package/extend/waibuMpa/theme/component/method/after-build-tag/active.js +0 -0
- package/extend/waibuMpa/theme/component/method/after-build-tag/background.js +1 -1
- package/extend/waibuMpa/theme/component/method/after-build-tag/border.js +1 -1
- package/extend/waibuMpa/theme/component/method/after-build-tag/dim.js +1 -1
- package/extend/waibuMpa/theme/component/method/after-build-tag/disabled.js +0 -0
- package/extend/waibuMpa/theme/component/method/after-build-tag/display.js +1 -1
- package/extend/waibuMpa/theme/component/method/after-build-tag/flex.js +1 -1
- package/extend/waibuMpa/theme/component/method/after-build-tag/font.js +1 -1
- package/extend/waibuMpa/theme/component/method/after-build-tag/gutter.js +1 -1
- package/extend/waibuMpa/theme/component/method/after-build-tag/label.js +0 -0
- package/extend/waibuMpa/theme/component/method/after-build-tag/link.js +1 -1
- package/extend/waibuMpa/theme/component/method/after-build-tag/margin-padding.js +1 -1
- package/extend/waibuMpa/theme/component/method/after-build-tag/popover.js +0 -0
- package/extend/waibuMpa/theme/component/method/after-build-tag/position.js +2 -2
- package/extend/waibuMpa/theme/component/method/after-build-tag/rounded.js +1 -1
- package/extend/waibuMpa/theme/component/method/after-build-tag/text.js +1 -1
- package/extend/waibuMpa/theme/component/method/after-build-tag/tooltip.js +0 -0
- package/extend/waibuMpa/theme/component/method/after-build-tag.js +0 -0
- package/extend/waibuMpa/theme/component/{factory → widget}/_lib.js +19 -13
- package/extend/waibuMpa/theme/component/{factory → widget}/a.js +2 -2
- package/extend/waibuMpa/theme/component/{factory → widget}/accordion-item.js +3 -3
- 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 +4 -4
- package/extend/waibuMpa/theme/component/{factory → widget}/app-launcher.js +3 -3
- 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 +2 -2
- package/extend/waibuMpa/theme/component/{factory → widget}/breadcrumb.js +3 -3
- 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 +2 -2
- package/extend/waibuMpa/theme/component/{factory → widget}/collapse-item.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/collapse.js +3 -3
- 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 +2 -2
- package/extend/waibuMpa/theme/component/{factory → widget}/dropdown-item.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/dropdown.js +4 -4
- package/extend/waibuMpa/theme/component/{factory → widget}/fieldset.js +2 -2
- 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 +4 -3
- package/extend/waibuMpa/theme/component/{factory → widget}/form-check.js +4 -3
- 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 +3 -3
- 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 +5 -6
- 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 +3 -3
- package/extend/waibuMpa/theme/component/{factory → widget}/form-select-ext.js +5 -5
- package/extend/waibuMpa/theme/component/{factory → widget}/form-select.js +2 -2
- 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 +3 -3
- package/extend/waibuMpa/theme/component/{factory → widget}/grid-col.js +2 -2
- 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 +2 -2
- package/extend/waibuMpa/theme/component/{factory → widget}/list.js +3 -3
- package/extend/waibuMpa/theme/component/{factory → widget}/masonry.js +3 -3
- 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 +2 -2
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-divider.js +1 -1
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-dropdown-darkmode.js +3 -3
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-dropdown-language.js +2 -2
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-dropdown-setting.js +23 -23
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-item-signout.js +3 -3
- package/extend/waibuMpa/theme/component/{factory → widget}/nav-item.js +5 -5
- 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 +4 -3
- 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 +2 -2
- package/extend/waibuMpa/theme/component/{factory → widget}/scrollspy.js +2 -2
- package/extend/waibuMpa/theme/component/{factory → widget}/sidebar.js +3 -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/waibuMpa/theme.js +0 -0
- package/extend/waibuStatic/asset/css/wbs.css +0 -0
- package/extend/waibuStatic/asset/js/wbs.js +0 -0
- package/extend/waibuStatic/virtual.json +0 -0
- package/index.js +1 -4
- package/package.json +9 -3
- package/wiki/CHANGES.md +10 -0
- package/wiki/CONFIG.md +0 -0
- package/wiki/CONTRIBUTING.md +0 -0
- package/extend/waibuMpa/theme/component/factory/drawer-toolbar.js +0 -6
package/.github/FUNDING.yml
CHANGED
|
File without changes
|
|
File without changes
|
package/.jsdoc.conf.json
CHANGED
|
File without changes
|
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/docs/WaibuBootstrap.html
CHANGED
|
File without changes
|
package/docs/data/search.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/docs/global.html
CHANGED
|
File without changes
|
package/docs/index.html
CHANGED
|
File without changes
|
package/docs/index.js.html
CHANGED
|
@@ -14,9 +14,9 @@ async function factory (pkgName) {
|
|
|
14
14
|
*
|
|
15
15
|
* @class
|
|
16
16
|
*/
|
|
17
|
-
class WaibuBootstrap extends this.app.
|
|
17
|
+
class WaibuBootstrap extends this.app.baseClass.Base {
|
|
18
18
|
static alias = 'wbs'
|
|
19
|
-
static dependencies = ['waibu-mpa', 'waibu-extra']
|
|
19
|
+
static dependencies = ['waibu-mpa', 'waibu-extra', 'waibu-alpinejs']
|
|
20
20
|
|
|
21
21
|
constructor () {
|
|
22
22
|
super(pkgName, me.app)
|
package/docs/scripts/core.js
CHANGED
|
File without changes
|
package/docs/scripts/core.min.js
CHANGED
|
File without changes
|
package/docs/scripts/resize.js
CHANGED
|
File without changes
|
package/docs/scripts/search.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/docs/static/bitcoin.jpeg
CHANGED
|
File without changes
|
package/docs/static/home.md
CHANGED
|
File without changes
|
|
File without changes
|
package/docs/static/logo.png
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/extend/bajo/intl/id.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ const variants = ['subtle', 'secondary', 'tertiary']
|
|
|
5
5
|
|
|
6
6
|
function background ({ key, params }) {
|
|
7
7
|
const { uniq } = this.app.lib._
|
|
8
|
-
const attrs = this.
|
|
8
|
+
const attrs = this.app.waibuMpa.attrToArray(params.attr[key])
|
|
9
9
|
const bgColors = ['body', 'black', 'white', 'transparent', ...colors]
|
|
10
10
|
for (const attr of attrs) {
|
|
11
11
|
const [item, val] = attr.split(':')
|
|
@@ -5,7 +5,7 @@ const variants = ['subtle', 'secondary', 'tertiary']
|
|
|
5
5
|
function border ({ tag, key, params }) {
|
|
6
6
|
if (['table'].includes(tag)) return
|
|
7
7
|
const { uniq } = this.app.lib._
|
|
8
|
-
const attrs = this.
|
|
8
|
+
const attrs = this.app.waibuMpa.attrToArray(params.attr[key])
|
|
9
9
|
const borderColors = ['body', 'black', 'white', ...colors]
|
|
10
10
|
let hasSide
|
|
11
11
|
for (const attr of attrs) {
|
|
@@ -2,7 +2,7 @@ import { dims } from './_lib.js'
|
|
|
2
2
|
|
|
3
3
|
function dim ({ key, params }) {
|
|
4
4
|
const { uniq } = this.app.lib._
|
|
5
|
-
const attrs = this.
|
|
5
|
+
const attrs = this.app.waibuMpa.attrToArray(params.attr[key])
|
|
6
6
|
for (const attr of attrs) {
|
|
7
7
|
const [item, val] = attr.split(':')
|
|
8
8
|
for (const value of uniq((val ?? '').split(','))) {
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ import { breakpoints, displays } from './_lib.js'
|
|
|
2
2
|
|
|
3
3
|
function display ({ key, params }) {
|
|
4
4
|
const { uniq, isEmpty } = this.app.lib._
|
|
5
|
-
const attrs = this.
|
|
5
|
+
const attrs = this.app.waibuMpa.attrToArray(params.attr[key])
|
|
6
6
|
let canHaveGap
|
|
7
7
|
for (const attr of attrs) {
|
|
8
8
|
const [item, val] = attr.split(':')
|
|
@@ -19,7 +19,7 @@ function flex ({ key, params }) {
|
|
|
19
19
|
params.attr.class.push('d-flex')
|
|
20
20
|
return
|
|
21
21
|
}
|
|
22
|
-
const attrs = this.
|
|
22
|
+
const attrs = this.app.waibuMpa.attrToArray(params.attr[key])
|
|
23
23
|
const inline = attrs.includes('inline')
|
|
24
24
|
let hasFlex = false
|
|
25
25
|
for (const attr of attrs) {
|
|
@@ -2,7 +2,7 @@ import { levels, weights, fstyles, parseSimple } from './_lib.js'
|
|
|
2
2
|
|
|
3
3
|
function font ({ key, params }) {
|
|
4
4
|
const { uniq } = this.app.lib._
|
|
5
|
-
const attrs = this.
|
|
5
|
+
const attrs = this.app.waibuMpa.attrToArray(params.attr[key])
|
|
6
6
|
for (const attr of attrs) {
|
|
7
7
|
const [item, val] = attr.split(':')
|
|
8
8
|
for (const value of uniq((val ?? '').split(','))) {
|
|
@@ -5,7 +5,7 @@ const prefixes = ['x', 'y', '']
|
|
|
5
5
|
|
|
6
6
|
function gutter ({ key, params }) {
|
|
7
7
|
const { isString } = this.app.lib._
|
|
8
|
-
const { attrToArray } = this.
|
|
8
|
+
const { attrToArray } = this.app.waibuMpa
|
|
9
9
|
if (isString(params.attr.gutter)) {
|
|
10
10
|
const items = attrToArray(params.attr.gutter)
|
|
11
11
|
for (const item of items) {
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ const ovariants = ['hover']
|
|
|
5
5
|
|
|
6
6
|
function link ({ key, params }) {
|
|
7
7
|
const { uniq } = this.app.lib._
|
|
8
|
-
const attrs = this.
|
|
8
|
+
const attrs = this.app.waibuMpa.attrToArray(params.attr[key])
|
|
9
9
|
const linkColors = ['body', 'black', 'white', ...colors]
|
|
10
10
|
for (const attr of attrs) {
|
|
11
11
|
const [item, val] = attr.split(':')
|
|
@@ -4,7 +4,7 @@ const sides = ['x', 'y', 'all', ...aligns]
|
|
|
4
4
|
const sizes = ['0', 'auto', ...widths]
|
|
5
5
|
|
|
6
6
|
function marginPadding ({ key, params }) {
|
|
7
|
-
for (const item of this.
|
|
7
|
+
for (const item of this.app.waibuMpa.attrToArray(params.attr[key])) {
|
|
8
8
|
let [side, size, bp] = item.split('-')
|
|
9
9
|
if (bp && !breakpoints.includes(bp)) bp = undefined
|
|
10
10
|
if (sides.includes(side) && (!size || sizes.includes(size))) {
|
|
File without changes
|
|
@@ -4,7 +4,7 @@ const zes = ['n1', '0', '1', '2', '3']
|
|
|
4
4
|
function position ({ key, params }) {
|
|
5
5
|
const { without } = this.app.lib._
|
|
6
6
|
if (params.attr[key].includes(':')) {
|
|
7
|
-
const attrs = this.
|
|
7
|
+
const attrs = this.app.waibuMpa.attrToArray(params.attr[key])
|
|
8
8
|
for (const attr of attrs) {
|
|
9
9
|
const [item, val] = attr.split(':')
|
|
10
10
|
/*
|
|
@@ -19,7 +19,7 @@ function position ({ key, params }) {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
} else {
|
|
22
|
-
const [type, arrangeStart, arrangeEnd, translateMiddle] = this.
|
|
22
|
+
const [type, arrangeStart, arrangeEnd, translateMiddle] = this.app.waibuMpa.attrToArray(params.attr[key])
|
|
23
23
|
if (positions.includes(type)) {
|
|
24
24
|
params.attr.class.push(`position-${type}`)
|
|
25
25
|
if (without(positions, 'static').includes(type) && arrangeStart &&
|
|
@@ -7,7 +7,7 @@ function rounded ({ key, params }) {
|
|
|
7
7
|
params.attr.class.push('rounded')
|
|
8
8
|
return
|
|
9
9
|
}
|
|
10
|
-
const attrs = this.
|
|
10
|
+
const attrs = this.app.waibuMpa.attrToArray(params.attr[key])
|
|
11
11
|
let hasType
|
|
12
12
|
for (const attr of attrs) {
|
|
13
13
|
const [item, val] = attr.split(':')
|
|
@@ -8,7 +8,7 @@ const variants = ['emphasis', 'secondary', 'tertiary']
|
|
|
8
8
|
|
|
9
9
|
function text ({ key, params }) {
|
|
10
10
|
const { uniq } = this.app.lib._
|
|
11
|
-
const attrs = this.
|
|
11
|
+
const attrs = this.app.waibuMpa.attrToArray(params.attr[key])
|
|
12
12
|
const textColors = ['body', 'black', 'white', ...colors]
|
|
13
13
|
for (const attr of attrs) {
|
|
14
14
|
const [item, val] = attr.split(':')
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { sizes } from '../method/after-build-tag/_lib.js'
|
|
2
2
|
|
|
3
|
+
const trueValues = ['true', 'on', 'yes', '1', 1, true]
|
|
4
|
+
|
|
3
5
|
function getInputAttr (group, formControl = true, ro) {
|
|
4
|
-
const { omit, get, isPlainObject, isArray, isString, has, forOwn } = this.app.lib._
|
|
5
|
-
const { escape } = this.
|
|
6
|
+
const { omit, get, set, isPlainObject, isArray, isString, has, forOwn } = this.app.lib._
|
|
7
|
+
const { escape } = this.app.waibu
|
|
6
8
|
if (formControl) group._.class.push('form-control')
|
|
7
9
|
const attr = omit(group._, ['hint', 'label', 'wrapper'])
|
|
8
10
|
if (attr.href) {
|
|
@@ -10,17 +12,21 @@ function getInputAttr (group, formControl = true, ro) {
|
|
|
10
12
|
attr.href = attr.href.replace(`%7B${k}%7D`, v)
|
|
11
13
|
})
|
|
12
14
|
}
|
|
13
|
-
if (has(attr, 'name') && !attr
|
|
15
|
+
if (has(attr, 'name') && !has(attr, 'value') && this.component.locals.form) {
|
|
14
16
|
attr.dataType = attr.dataType ?? 'auto'
|
|
15
|
-
|
|
17
|
+
let val = get(this, `component.locals.form.${attr.name}`)
|
|
18
|
+
if (attr.dataType === 'boolean') {
|
|
19
|
+
val = trueValues.includes(val)
|
|
20
|
+
set(this, `component.locals.form.${attr.name}`, val)
|
|
21
|
+
}
|
|
16
22
|
if (isPlainObject(val) || isArray(val)) attr.dataValue = escape(JSON.stringify(val))
|
|
17
23
|
else if (isString(val)) attr.dataValue = escape(val)
|
|
18
24
|
else attr.dataValue = val
|
|
19
25
|
if (ro) {
|
|
20
|
-
if (attr.
|
|
21
|
-
const [
|
|
22
|
-
attr.value = get(this, `component.locals.form.
|
|
23
|
-
} else if (attr.dataType === 'boolean') attr.value = this.component.req.t(val ? '
|
|
26
|
+
if (attr.ref) {
|
|
27
|
+
const [ref, fieldName = 'id'] = attr.ref.split(':')
|
|
28
|
+
attr.value = get(this, `component.locals.form._ref.${ref}.${fieldName}`, val)
|
|
29
|
+
} else if (attr.dataType === 'boolean') attr.value = this.component.req.t(val ? 'true' : 'false')
|
|
24
30
|
else if (has(attr, 'name') === 'lat') attr.value = escape(this.component.req.format(val, attr.dataType, { latitude: true }))
|
|
25
31
|
else if (has(attr, 'name') === 'lng') attr.value = escape(this.component.req.format(val, attr.dataType, { longitude: true }))
|
|
26
32
|
else attr.value = escape(this.component.req.format(val, attr.dataType))
|
|
@@ -55,19 +61,19 @@ export async function buildFormCheck (group, params) {
|
|
|
55
61
|
const attr = getInputAttr.call(this, group, false)
|
|
56
62
|
attr.type = 'checkbox'
|
|
57
63
|
attr.class.push('form-check-input')
|
|
58
|
-
if (has(attr, 'name') && !attr
|
|
59
|
-
if (has(attr, 'name') && !has(attr, 'checked') && attr.value === get(this, `locals.form.${attr.name}`)) attr.checked = true
|
|
64
|
+
if (has(attr, 'name') && !has(attr, 'value')) attr.value = 'true'
|
|
65
|
+
if (has(attr, 'name') && !has(attr, 'checked') && attr.value === get(this, `component.locals.form.${attr.name}`)) attr.checked = true
|
|
60
66
|
return await this.component.buildTag({ tag: 'input', attr, selfClosing: true })
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
export async function buildFormSwitch (group, params) {
|
|
64
|
-
const { has
|
|
70
|
+
const { has } = this.app.lib._
|
|
65
71
|
const attr = getInputAttr.call(this, group, false)
|
|
66
72
|
attr.type = 'checkbox'
|
|
67
73
|
attr.class.push('form-check-input')
|
|
68
74
|
attr.role = 'switch'
|
|
69
|
-
if (has(attr, 'name')
|
|
70
|
-
if (has(attr, 'name') && !has(attr, 'checked') && attr.
|
|
75
|
+
if (has(attr, 'name')) attr.value = 'true'
|
|
76
|
+
if (has(attr, 'name') && !has(attr, 'checked') && attr.dataValue) attr.checked = 'true'
|
|
71
77
|
return await this.component.buildTag({ tag: 'input', attr, selfClosing: true })
|
|
72
78
|
}
|
|
73
79
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
async function a () {
|
|
2
|
-
return class A extends this.
|
|
2
|
+
return class A extends this.app.baseClass.MpaWidget {
|
|
3
3
|
constructor (options) {
|
|
4
4
|
super(options)
|
|
5
5
|
this.component.normalizeAttr(this.params, { tag: 'a' })
|
|
6
6
|
if (!this.params.attr.href) this.params.attr.href = '#'
|
|
7
|
-
if (this.params.html.includes('<i class="')) this.params.attr.class.push('icon-link')
|
|
7
|
+
if (this.params.html.includes('<i class="') && !this.params.attr.noIconLink) this.params.attr.class.push('icon-link')
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -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
|
|
@@ -11,12 +11,12 @@ async function accordionItem () {
|
|
|
11
11
|
|
|
12
12
|
build = async () => {
|
|
13
13
|
const { omit, without } = this.app.lib._
|
|
14
|
-
const { groupAttrs,
|
|
14
|
+
const { groupAttrs, stringifyAttribs } = this.app.waibuMpa
|
|
15
15
|
const group = groupAttrs(this.params.attr, ['body', 'header'])
|
|
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 header = [`<c:h2 ${
|
|
19
|
+
const header = [`<c:h2 ${stringifyAttribs(group.header)}>`,
|
|
20
20
|
`<button class="${this.params.attr.narrowHeader ? 'px-3 py-2 ' : ''}accordion-button${this.params.attr.showOnStart ? '' : ' collapsed'}"`,
|
|
21
21
|
`type="button" data-bs-toggle="collapse" data-bs-target="#${this.params.attr.id}"`,
|
|
22
22
|
`aria-expanded="${this.params.attr.showOnStart}"`,
|
|
@@ -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._
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
async function appLauncherTrigger () {
|
|
2
|
-
return class AppLauncherTrigger extends this.
|
|
2
|
+
return class AppLauncherTrigger extends this.app.baseClass.MpaWidget {
|
|
3
3
|
constructor (options) {
|
|
4
4
|
super(options)
|
|
5
5
|
const { isString } = this.app.lib._
|
|
@@ -21,13 +21,13 @@ async function appLauncherTrigger () {
|
|
|
21
21
|
|
|
22
22
|
build = async () => {
|
|
23
23
|
const { fastGlob } = this.app.lib
|
|
24
|
-
const { groupAttrs,
|
|
24
|
+
const { groupAttrs, stringifyAttribs } = this.app.waibuMpa
|
|
25
25
|
const group = groupAttrs(this.params.attr, ['img'])
|
|
26
26
|
this.params.attr = group._
|
|
27
27
|
let src = group.img.src
|
|
28
28
|
if (!src) {
|
|
29
29
|
let logo = 'waibu'
|
|
30
|
-
const files = await fastGlob(`${this.
|
|
30
|
+
const files = await fastGlob(`${this.app.main.dir.pkg}/logo.*`)
|
|
31
31
|
if (files.length > 0) logo = 'main'
|
|
32
32
|
src = `waibuMpa:/logo/${logo}`
|
|
33
33
|
}
|
|
@@ -36,7 +36,7 @@ async function appLauncherTrigger () {
|
|
|
36
36
|
`<c:img src="${src}"`,
|
|
37
37
|
`width="${group.img.dimWidth}" height="${group.img.dimHeight}"`
|
|
38
38
|
]
|
|
39
|
-
if (group.img.style) sentence.push(`style="${
|
|
39
|
+
if (group.img.style) sentence.push(`style="${stringifyAttribs(group.img.style)}"`)
|
|
40
40
|
sentence.push('/>')
|
|
41
41
|
this.params.html = await this.component.buildSentence(sentence)
|
|
42
42
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
async function appLauncher () {
|
|
2
|
-
return class AppLauncher extends this.
|
|
2
|
+
return class AppLauncher extends this.app.baseClass.MpaWidget {
|
|
3
3
|
constructor (options) {
|
|
4
4
|
super(options)
|
|
5
|
-
const { generateId } = this.
|
|
5
|
+
const { generateId } = this.app.lib.aneka
|
|
6
6
|
this.params.noTag = true
|
|
7
7
|
this.params.attr.id = this.params.attr.id ?? generateId('alpha')
|
|
8
8
|
this.params.attr.type = this.params.attr.type ?? 'drawer'
|
|
@@ -25,7 +25,7 @@ async function appLauncher () {
|
|
|
25
25
|
launcher += '</c:nav>\n<c:nav tag="ul">\n'
|
|
26
26
|
for (const t of toolbar) {
|
|
27
27
|
if (t === 'home') launcher += '<c:nav-item href="/" icon="house" padding="end-2" />\n'
|
|
28
|
-
if (t === 'user' && this.
|
|
28
|
+
if (t === 'user' && this.app.sumba) launcher += '<c:sumba-nav-dropdown-user padding="end-2" />\n'
|
|
29
29
|
if (t === '-') launcher += '<c:nav-divider />\n'
|
|
30
30
|
if (t === 'fullscreen') launcher += '<c:nav-toggle-fullscreen padding="end-2" />\n'
|
|
31
31
|
if (t === 'darkmode') launcher += '<c:nav-dropdown-darkmode padding="end-2" dropdown-menudir="end" />\n'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const cls = 'breadcrumb-item'
|
|
2
2
|
|
|
3
3
|
async function breadcrumbItem () {
|
|
4
|
-
return class BreadcrumbItem extends this.
|
|
4
|
+
return class BreadcrumbItem extends this.app.baseClass.MpaWidget {
|
|
5
5
|
constructor (options) {
|
|
6
6
|
super(options)
|
|
7
7
|
this.selector = '.' + cls
|
|
@@ -10,7 +10,7 @@ async function breadcrumbItem () {
|
|
|
10
10
|
|
|
11
11
|
build = async () => {
|
|
12
12
|
const { omit } = this.app.lib._
|
|
13
|
-
const { attrToArray } = this.
|
|
13
|
+
const { attrToArray } = this.app.waibuMpa
|
|
14
14
|
if (this.params.attr.href) {
|
|
15
15
|
if (this.params.attr.hrefRebuild) {
|
|
16
16
|
this.params.attr.hrefRebuild = attrToArray(this.params.attr.hrefRebuild)
|
|
@@ -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
|
|
@@ -38,8 +38,8 @@ async function breadcrumb () {
|
|
|
38
38
|
|
|
39
39
|
build = async () => {
|
|
40
40
|
const { isString, omit } = this.app.lib._
|
|
41
|
-
const { routePath } = this.
|
|
42
|
-
const { urlToBreadcrumb, attrToArray } = this.
|
|
41
|
+
const { routePath } = this.app.waibu
|
|
42
|
+
const { urlToBreadcrumb, attrToArray } = this.app.waibuMpa
|
|
43
43
|
let divider = ''
|
|
44
44
|
if (this.params.attr.noDivider) divider = ' style="--bs-breadcrumb-divider: \'\';"'
|
|
45
45
|
else if (isString(this.params.attr.divider)) divider = ` style="--bs-breadcrumb-divider: '${this.params.attr.divider}';"`
|
|
@@ -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
|