waibu-bootstrap 2.3.0 → 2.4.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.
Files changed (25) hide show
  1. package/extend/waibuMpa/theme/component/method/after-build-tag/background.js +1 -1
  2. package/extend/waibuMpa/theme/component/method/after-build-tag/border.js +1 -1
  3. package/extend/waibuMpa/theme/component/method/after-build-tag/dim.js +1 -1
  4. package/extend/waibuMpa/theme/component/method/after-build-tag/display.js +1 -1
  5. package/extend/waibuMpa/theme/component/method/after-build-tag/flex.js +1 -1
  6. package/extend/waibuMpa/theme/component/method/after-build-tag/font.js +1 -1
  7. package/extend/waibuMpa/theme/component/method/after-build-tag/gutter.js +1 -1
  8. package/extend/waibuMpa/theme/component/method/after-build-tag/link.js +1 -1
  9. package/extend/waibuMpa/theme/component/method/after-build-tag/margin-padding.js +1 -1
  10. package/extend/waibuMpa/theme/component/method/after-build-tag/position.js +2 -2
  11. package/extend/waibuMpa/theme/component/method/after-build-tag/rounded.js +1 -1
  12. package/extend/waibuMpa/theme/component/method/after-build-tag/text.js +1 -1
  13. package/extend/waibuMpa/theme/component/widget/_lib.js +1 -1
  14. package/extend/waibuMpa/theme/component/widget/app-launcher.js +2 -2
  15. package/extend/waibuMpa/theme/component/widget/breadcrumb-item.js +1 -1
  16. package/extend/waibuMpa/theme/component/widget/breadcrumb.js +2 -2
  17. package/extend/waibuMpa/theme/component/widget/carousel.js +1 -1
  18. package/extend/waibuMpa/theme/component/widget/collapse.js +2 -1
  19. package/extend/waibuMpa/theme/component/widget/form-input.js +1 -1
  20. package/extend/waibuMpa/theme/component/widget/form-select-country.js +2 -2
  21. package/extend/waibuMpa/theme/component/widget/form-select-ext.js +3 -2
  22. package/extend/waibuMpa/theme/component/widget/form.js +1 -1
  23. package/extend/waibuMpa/theme/component/widget/grid-col.js +1 -1
  24. package/package.json +1 -1
  25. package/wiki/CHANGES.md +6 -0
@@ -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.app.waibuMpa.attrToArray(params.attr[key])
8
+ const attrs = this.app.waibu.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.app.waibuMpa.attrToArray(params.attr[key])
8
+ const attrs = this.app.waibu.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.app.waibuMpa.attrToArray(params.attr[key])
5
+ const attrs = this.app.waibu.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(','))) {
@@ -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.app.waibuMpa.attrToArray(params.attr[key])
5
+ const attrs = this.app.waibu.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.app.waibuMpa.attrToArray(params.attr[key])
22
+ const attrs = this.app.waibu.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.app.waibuMpa.attrToArray(params.attr[key])
5
+ const attrs = this.app.waibu.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.app.waibuMpa
8
+ const { attrToArray } = this.app.waibu
9
9
  if (isString(params.attr.gutter)) {
10
10
  const items = attrToArray(params.attr.gutter)
11
11
  for (const item of items) {
@@ -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.app.waibuMpa.attrToArray(params.attr[key])
8
+ const attrs = this.app.waibu.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.app.waibuMpa.attrToArray(params.attr[key])) {
7
+ for (const item of this.app.waibu.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))) {
@@ -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.app.waibuMpa.attrToArray(params.attr[key])
7
+ const attrs = this.app.waibu.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.app.waibuMpa.attrToArray(params.attr[key])
22
+ const [type, arrangeStart, arrangeEnd, translateMiddle] = this.app.waibu.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.app.waibuMpa.attrToArray(params.attr[key])
10
+ const attrs = this.app.waibu.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.app.waibuMpa.attrToArray(params.attr[key])
11
+ const attrs = this.app.waibu.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(':')
@@ -147,7 +147,7 @@ export async function buildFormSelect (group, params) {
147
147
  attr.class.push('form-select')
148
148
  let html = params.html
149
149
  if (sizes.includes(attr.size)) attr.class.push(`form-select-${attr.size}`)
150
- if (attr.options) html = this.component.buildOptions({ attr, html: '' })
150
+ if (attr.options) html = this.component.buildOptions({ attr })
151
151
  else {
152
152
  const items = []
153
153
  $(`<div>${trim(html ?? '')}</div>`).find('option').each(function () {
@@ -10,8 +10,8 @@ async function appLauncher () {
10
10
 
11
11
  build = async () => {
12
12
  const { locals } = this.component
13
- const { routePath } = this.app.waibu
14
- const { groupAttrs, attrToArray } = this.app.waibuMpa
13
+ const { routePath, attrToArray } = this.app.waibu
14
+ const { groupAttrs } = this.app.waibuMpa
15
15
  const menu = this.params.attr.menu ?? 'pages'
16
16
  const group = groupAttrs(this.params.attr, ['trigger'])
17
17
  let launcher = `<c:drawer id="${this.params.attr.id}" t:title="Modules" no-padding style="${menu === 'pages' ? 'width:350px' : ''}">\n`
@@ -10,7 +10,7 @@ async function breadcrumbItem () {
10
10
 
11
11
  build = async () => {
12
12
  const { omit } = this.app.lib._
13
- const { attrToArray } = this.app.waibuMpa
13
+ const { attrToArray } = this.app.waibu
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)
@@ -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.app.waibu
42
- const { urlToBreadcrumb, attrToArray } = this.app.waibuMpa
41
+ const { routePath, attrToArray } = this.app.waibu
42
+ const { urlToBreadcrumb } = 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}';"`
@@ -14,7 +14,7 @@ async function carousel () {
14
14
  }
15
15
 
16
16
  build = async () => {
17
- const { attrToArray } = this.app.waibuMpa
17
+ const { attrToArray } = this.app.waibu
18
18
  const { $ } = this.component
19
19
  let activeItem = 0
20
20
  $(this.params.html).children().each(function (idx) {
@@ -11,7 +11,8 @@ async function collapse () {
11
11
  build = async () => {
12
12
  const { generateId } = this.app.lib.aneka
13
13
  const { merge, isString } = this.app.lib._
14
- const { attrToArray, groupAttrs } = this.app.waibuMpa
14
+ const { attrToArray } = this.app.waibu
15
+ const { groupAttrs } = this.app.waibuMpa
15
16
  const items = []
16
17
  const { $ } = this.component
17
18
  const me = this
@@ -3,7 +3,7 @@ import { sizes } from '../method/after-build-tag/_lib.js'
3
3
 
4
4
  export async function handleInput ({ handler, group, params } = {}) {
5
5
  const { trim, filter, has, omit, pull, find, get } = this.app.lib._
6
- const { attrToArray } = this.app.waibuMpa
6
+ const { attrToArray } = this.app.waibu
7
7
  const { $ } = this.component
8
8
  const addons = []
9
9
  const isLabel = has(this.params.attr, 'label')
@@ -2,7 +2,7 @@ import { css, scripts } from './form-select-ext.js'
2
2
 
3
3
  async function formSelectCountry () {
4
4
  return class FormSelectCountry extends this.app.baseClass.MpaWidget {
5
- static css = [...super.css, css]
5
+ static css = [...super.css, ...css]
6
6
  static scripts = [...super.scripts, scripts]
7
7
 
8
8
  constructor (options) {
@@ -13,7 +13,7 @@ async function formSelectCountry () {
13
13
  build = async () => {
14
14
  const { readConfig } = this.app.bajo
15
15
  const { map } = this.app.lib._
16
- const { base64JsonEncode } = this.app.waibuMpa
16
+ const { base64JsonEncode } = this.app.waibu
17
17
  const countries = await readConfig('bajoCommonDb:/extend/dobo/fixture/country.json', { ignoreError: true, defValue: [] })
18
18
  this.params.attr.options = base64JsonEncode(map(countries, c => {
19
19
  return { value: c.id, text: c.name.replaceAll('\'', '') }
@@ -9,14 +9,15 @@ export const scripts = 'waibuExtra.virtual:/tom-select/js/tom-select.complete.mi
9
9
 
10
10
  async function formSelectExt () {
11
11
  return class FormSelectExt extends this.app.baseClass.MpaWidget {
12
- static css = [...super.css, css]
12
+ static css = [...super.css, ...css]
13
13
  static scripts = [...super.scripts, scripts]
14
14
 
15
15
  build = async () => {
16
16
  const { generateId } = this.app.lib.aneka
17
17
  const { omit, merge, has } = this.app.lib._
18
18
  const { routePath } = this.app.waibu
19
- const { jsonStringify, base64JsonDecode, groupAttrs } = this.app.waibuMpa
19
+ const { jsonStringify, groupAttrs } = this.app.waibuMpa
20
+ const { base64JsonDecode } = this.app.waibu
20
21
  const { req } = this.component
21
22
  let apiKey = ''
22
23
  if (req.user && this.app.sumba) apiKey = await this.app.sumba.getApiKeyFromUserId(req.user.id)
@@ -10,7 +10,7 @@ async function form () {
10
10
  this.component.locals.form = this.component.locals.form ?? {}
11
11
  const { pascalCase } = this.app.lib.aneka
12
12
  const { isEmpty, omit, has } = this.app.lib._
13
- const { attrToArray } = this.app.waibuMpa
13
+ const { attrToArray } = this.app.waibu
14
14
  const { groupAttrs } = this.app.waibuMpa
15
15
  if (!has(this.params.attr, 'autocomplete')) this.params.attr.autocomplete = 'off'
16
16
  if (!has(this.params.attr, 'method')) this.params.attr.method = 'POST'
@@ -22,7 +22,7 @@ async function gridCol () {
22
22
 
23
23
  build = async () => {
24
24
  const { map, without, isString } = this.app.lib._
25
- const { attrToArray } = this.app.waibuMpa
25
+ const { attrToArray } = this.app.waibu
26
26
  if (this.params.attr.break) {
27
27
  const ext = breakpoints.includes(this.params.attr.break) ? `d-none d-${this.params.attr.break}-block` : ''
28
28
  this.params.attr.class.push('w-100', ext)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-bootstrap",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Bootstrap suport for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-02-18
4
+
5
+ - [2.4.0] Update attribute functions from ```waibu```
6
+ - [2.4.0] Bug fix on ```FormSelectExt``` 's static css
7
+ - [2.4.0] Bug fix on ```FormSelectCountry``` 's static css
8
+
3
9
  ## 2026-02-15
4
10
 
5
11
  - [2.3.0] Add capability to use custom tag on ```select```