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.
Files changed (165) hide show
  1. package/.github/FUNDING.yml +0 -0
  2. package/.github/workflows/repo-lockdown.yml +0 -0
  3. package/.jsdoc.conf.json +0 -0
  4. package/LICENSE +0 -0
  5. package/README.md +0 -0
  6. package/docs/WaibuBootstrap.html +0 -0
  7. package/docs/data/search.json +0 -0
  8. package/docs/fonts/Inconsolata-Regular.ttf +0 -0
  9. package/docs/fonts/OpenSans-Regular.ttf +0 -0
  10. package/docs/fonts/WorkSans-Bold.ttf +0 -0
  11. package/docs/global.html +0 -0
  12. package/docs/index.html +0 -0
  13. package/docs/index.js.html +2 -2
  14. package/docs/scripts/core.js +0 -0
  15. package/docs/scripts/core.min.js +0 -0
  16. package/docs/scripts/resize.js +0 -0
  17. package/docs/scripts/search.js +0 -0
  18. package/docs/scripts/search.min.js +0 -0
  19. package/docs/scripts/third-party/Apache-License-2.0.txt +0 -0
  20. package/docs/scripts/third-party/fuse.js +0 -0
  21. package/docs/scripts/third-party/hljs-line-num-original.js +0 -0
  22. package/docs/scripts/third-party/hljs-line-num.js +0 -0
  23. package/docs/scripts/third-party/hljs-original.js +0 -0
  24. package/docs/scripts/third-party/hljs.js +0 -0
  25. package/docs/scripts/third-party/popper.js +0 -0
  26. package/docs/scripts/third-party/tippy.js +0 -0
  27. package/docs/scripts/third-party/tocbot.js +0 -0
  28. package/docs/scripts/third-party/tocbot.min.js +0 -0
  29. package/docs/static/bitcoin.jpeg +0 -0
  30. package/docs/static/home.md +0 -0
  31. package/docs/static/logo-ecosystem.png +0 -0
  32. package/docs/static/logo.png +0 -0
  33. package/docs/styles/clean-jsdoc-theme-base.css +0 -0
  34. package/docs/styles/clean-jsdoc-theme-dark.css +0 -0
  35. package/docs/styles/clean-jsdoc-theme-light.css +0 -0
  36. package/docs/styles/clean-jsdoc-theme-scrollbar.css +0 -0
  37. package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -0
  38. package/docs/styles/clean-jsdoc-theme.min.css +0 -0
  39. package/extend/bajo/hook/waibu-mpa.bootstrap@after-build-page.js +0 -0
  40. package/extend/bajo/intl/id.json +0 -0
  41. package/extend/waibuMpa/theme/component/method/after-build-tag/_lib.js +0 -0
  42. package/extend/waibuMpa/theme/component/method/after-build-tag/active.js +0 -0
  43. package/extend/waibuMpa/theme/component/method/after-build-tag/background.js +1 -1
  44. package/extend/waibuMpa/theme/component/method/after-build-tag/border.js +1 -1
  45. package/extend/waibuMpa/theme/component/method/after-build-tag/dim.js +1 -1
  46. package/extend/waibuMpa/theme/component/method/after-build-tag/disabled.js +0 -0
  47. package/extend/waibuMpa/theme/component/method/after-build-tag/display.js +1 -1
  48. package/extend/waibuMpa/theme/component/method/after-build-tag/flex.js +1 -1
  49. package/extend/waibuMpa/theme/component/method/after-build-tag/font.js +1 -1
  50. package/extend/waibuMpa/theme/component/method/after-build-tag/gutter.js +1 -1
  51. package/extend/waibuMpa/theme/component/method/after-build-tag/label.js +0 -0
  52. package/extend/waibuMpa/theme/component/method/after-build-tag/link.js +1 -1
  53. package/extend/waibuMpa/theme/component/method/after-build-tag/margin-padding.js +1 -1
  54. package/extend/waibuMpa/theme/component/method/after-build-tag/popover.js +0 -0
  55. package/extend/waibuMpa/theme/component/method/after-build-tag/position.js +2 -2
  56. package/extend/waibuMpa/theme/component/method/after-build-tag/rounded.js +1 -1
  57. package/extend/waibuMpa/theme/component/method/after-build-tag/text.js +1 -1
  58. package/extend/waibuMpa/theme/component/method/after-build-tag/tooltip.js +0 -0
  59. package/extend/waibuMpa/theme/component/method/after-build-tag.js +0 -0
  60. package/extend/waibuMpa/theme/component/{factory → widget}/_lib.js +19 -13
  61. package/extend/waibuMpa/theme/component/{factory → widget}/a.js +2 -2
  62. package/extend/waibuMpa/theme/component/{factory → widget}/accordion-item.js +3 -3
  63. package/extend/waibuMpa/theme/component/{factory → widget}/accordion.js +1 -1
  64. package/extend/waibuMpa/theme/component/{factory → widget}/alert.js +1 -1
  65. package/extend/waibuMpa/theme/component/{factory → widget}/app-launcher-trigger.js +4 -4
  66. package/extend/waibuMpa/theme/component/{factory → widget}/app-launcher.js +3 -3
  67. package/extend/waibuMpa/theme/component/{factory → widget}/badge.js +1 -1
  68. package/extend/waibuMpa/theme/component/{factory → widget}/blockquote.js +1 -1
  69. package/extend/waibuMpa/theme/component/{factory → widget}/breadcrumb-item.js +2 -2
  70. package/extend/waibuMpa/theme/component/{factory → widget}/breadcrumb.js +3 -3
  71. package/extend/waibuMpa/theme/component/{factory → widget}/btn-back-to-top.js +1 -1
  72. package/extend/waibuMpa/theme/component/{factory → widget}/btn-close.js +1 -1
  73. package/extend/waibuMpa/theme/component/{factory → widget}/btn-group.js +1 -1
  74. package/extend/waibuMpa/theme/component/{factory → widget}/btn-toolbar.js +1 -1
  75. package/extend/waibuMpa/theme/component/{factory → widget}/btn.js +1 -1
  76. package/extend/waibuMpa/theme/component/{factory → widget}/card-body.js +1 -1
  77. package/extend/waibuMpa/theme/component/{factory → widget}/card-footer.js +1 -1
  78. package/extend/waibuMpa/theme/component/{factory → widget}/card-group.js +1 -1
  79. package/extend/waibuMpa/theme/component/{factory → widget}/card-header.js +1 -1
  80. package/extend/waibuMpa/theme/component/{factory → widget}/card-link.js +1 -1
  81. package/extend/waibuMpa/theme/component/{factory → widget}/card-subtitle.js +1 -1
  82. package/extend/waibuMpa/theme/component/{factory → widget}/card-text.js +1 -1
  83. package/extend/waibuMpa/theme/component/{factory → widget}/card-title.js +1 -1
  84. package/extend/waibuMpa/theme/component/{factory → widget}/card.js +1 -1
  85. package/extend/waibuMpa/theme/component/{factory → widget}/carousel-item.js +1 -1
  86. package/extend/waibuMpa/theme/component/{factory → widget}/carousel.js +2 -2
  87. package/extend/waibuMpa/theme/component/{factory → widget}/collapse-item.js +1 -1
  88. package/extend/waibuMpa/theme/component/{factory → widget}/collapse.js +3 -3
  89. package/extend/waibuMpa/theme/component/{factory → widget}/container.js +1 -1
  90. package/extend/waibuMpa/theme/component/widget/drawer-toolbar.js +6 -0
  91. package/extend/waibuMpa/theme/component/{factory → widget}/drawer.js +2 -2
  92. package/extend/waibuMpa/theme/component/{factory → widget}/dropdown-item.js +1 -1
  93. package/extend/waibuMpa/theme/component/{factory → widget}/dropdown.js +4 -4
  94. package/extend/waibuMpa/theme/component/{factory → widget}/fieldset.js +2 -2
  95. package/extend/waibuMpa/theme/component/{factory → widget}/figcaption.js +1 -1
  96. package/extend/waibuMpa/theme/component/{factory → widget}/figure.js +1 -1
  97. package/extend/waibuMpa/theme/component/{factory → widget}/form-check-toggle.js +4 -3
  98. package/extend/waibuMpa/theme/component/{factory → widget}/form-check.js +4 -3
  99. package/extend/waibuMpa/theme/component/{factory → widget}/form-color.js +1 -1
  100. package/extend/waibuMpa/theme/component/{factory → widget}/form-date.js +1 -1
  101. package/extend/waibuMpa/theme/component/{factory → widget}/form-datetime.js +3 -3
  102. package/extend/waibuMpa/theme/component/{factory → widget}/form-file.js +1 -1
  103. package/extend/waibuMpa/theme/component/{factory → widget}/form-input-addon.js +1 -1
  104. package/extend/waibuMpa/theme/component/{factory → widget}/form-input.js +5 -6
  105. package/extend/waibuMpa/theme/component/{factory → widget}/form-password.js +1 -1
  106. package/extend/waibuMpa/theme/component/{factory → widget}/form-plaintext.js +1 -1
  107. package/extend/waibuMpa/theme/component/{factory → widget}/form-radio-toggle.js +1 -1
  108. package/extend/waibuMpa/theme/component/{factory → widget}/form-radio.js +1 -1
  109. package/extend/waibuMpa/theme/component/{factory → widget}/form-range.js +1 -1
  110. package/extend/waibuMpa/theme/component/{factory → widget}/form-select-country.js +3 -3
  111. package/extend/waibuMpa/theme/component/{factory → widget}/form-select-ext.js +5 -5
  112. package/extend/waibuMpa/theme/component/{factory → widget}/form-select.js +2 -2
  113. package/extend/waibuMpa/theme/component/{factory → widget}/form-switch.js +1 -1
  114. package/extend/waibuMpa/theme/component/{factory → widget}/form-textarea.js +1 -1
  115. package/extend/waibuMpa/theme/component/{factory → widget}/form-time.js +1 -1
  116. package/extend/waibuMpa/theme/component/{factory → widget}/form.js +3 -3
  117. package/extend/waibuMpa/theme/component/{factory → widget}/grid-col.js +2 -2
  118. package/extend/waibuMpa/theme/component/{factory → widget}/grid-row.js +1 -1
  119. package/extend/waibuMpa/theme/component/{factory → widget}/heading.js +1 -1
  120. package/extend/waibuMpa/theme/component/{factory → widget}/img.js +1 -1
  121. package/extend/waibuMpa/theme/component/{factory → widget}/lead.js +1 -1
  122. package/extend/waibuMpa/theme/component/{factory → widget}/list-item.js +2 -2
  123. package/extend/waibuMpa/theme/component/{factory → widget}/list.js +3 -3
  124. package/extend/waibuMpa/theme/component/{factory → widget}/masonry.js +3 -3
  125. package/extend/waibuMpa/theme/component/{factory → widget}/modal-body.js +1 -1
  126. package/extend/waibuMpa/theme/component/{factory → widget}/modal-footer.js +1 -1
  127. package/extend/waibuMpa/theme/component/{factory → widget}/modal-header.js +1 -1
  128. package/extend/waibuMpa/theme/component/{factory → widget}/modal.js +2 -2
  129. package/extend/waibuMpa/theme/component/{factory → widget}/nav-divider.js +1 -1
  130. package/extend/waibuMpa/theme/component/{factory → widget}/nav-dropdown-darkmode.js +3 -3
  131. package/extend/waibuMpa/theme/component/{factory → widget}/nav-dropdown-language.js +2 -2
  132. package/extend/waibuMpa/theme/component/{factory → widget}/nav-dropdown-setting.js +23 -23
  133. package/extend/waibuMpa/theme/component/{factory → widget}/nav-item-signout.js +3 -3
  134. package/extend/waibuMpa/theme/component/{factory → widget}/nav-item.js +5 -5
  135. package/extend/waibuMpa/theme/component/{factory → widget}/nav-toggle-fullscreen.js +1 -1
  136. package/extend/waibuMpa/theme/component/{factory → widget}/nav.js +1 -1
  137. package/extend/waibuMpa/theme/component/{factory → widget}/navbar-brand.js +1 -1
  138. package/extend/waibuMpa/theme/component/{factory → widget}/navbar-text.js +1 -1
  139. package/extend/waibuMpa/theme/component/{factory → widget}/navbar.js +4 -3
  140. package/extend/waibuMpa/theme/component/{factory → widget}/pagination-item.js +1 -1
  141. package/extend/waibuMpa/theme/component/{factory → widget}/pagination.js +1 -1
  142. package/extend/waibuMpa/theme/component/{factory → widget}/progress-stack.js +1 -1
  143. package/extend/waibuMpa/theme/component/{factory → widget}/progress.js +2 -2
  144. package/extend/waibuMpa/theme/component/{factory → widget}/scrollspy.js +2 -2
  145. package/extend/waibuMpa/theme/component/{factory → widget}/sidebar.js +3 -2
  146. package/extend/waibuMpa/theme/component/{factory → widget}/spinner.js +1 -1
  147. package/extend/waibuMpa/theme/component/{factory → widget}/table.js +1 -1
  148. package/extend/waibuMpa/theme/component/{factory → widget}/tbody.js +1 -1
  149. package/extend/waibuMpa/theme/component/{factory → widget}/td.js +1 -1
  150. package/extend/waibuMpa/theme/component/{factory → widget}/tfoot.js +1 -1
  151. package/extend/waibuMpa/theme/component/{factory → widget}/th.js +1 -1
  152. package/extend/waibuMpa/theme/component/{factory → widget}/thead.js +1 -1
  153. package/extend/waibuMpa/theme/component/{factory → widget}/toast-stack.js +1 -1
  154. package/extend/waibuMpa/theme/component/{factory → widget}/toast.js +1 -1
  155. package/extend/waibuMpa/theme/component/{factory → widget}/tr.js +1 -1
  156. package/extend/waibuMpa/theme.js +0 -0
  157. package/extend/waibuStatic/asset/css/wbs.css +0 -0
  158. package/extend/waibuStatic/asset/js/wbs.js +0 -0
  159. package/extend/waibuStatic/virtual.json +0 -0
  160. package/index.js +1 -4
  161. package/package.json +9 -3
  162. package/wiki/CHANGES.md +10 -0
  163. package/wiki/CONFIG.md +0 -0
  164. package/wiki/CONTRIBUTING.md +0 -0
  165. package/extend/waibuMpa/theme/component/factory/drawer-toolbar.js +0 -6
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
File without changes
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
@@ -14,9 +14,9 @@ async function factory (pkgName) {
14
14
  *
15
15
  * @class
16
16
  */
17
- class WaibuBootstrap extends this.app.pluginClass.base {
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)
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
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
@@ -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.plugin.app.waibuMpa.attrToArray(params.attr[key])
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.plugin.app.waibuMpa.attrToArray(params.attr[key])
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.plugin.app.waibuMpa.attrToArray(params.attr[key])
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(','))) {
@@ -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.plugin.app.waibuMpa.attrToArray(params.attr[key])
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.plugin.app.waibuMpa.attrToArray(params.attr[key])
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.plugin.app.waibuMpa.attrToArray(params.attr[key])
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.plugin.app.waibuMpa
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) {
@@ -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.plugin.app.waibuMpa.attrToArray(params.attr[key])
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.plugin.app.waibuMpa.attrToArray(params.attr[key])) {
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))) {
@@ -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.plugin.app.waibuMpa.attrToArray(params.attr[key])
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.plugin.app.waibuMpa.attrToArray(params.attr[key])
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.plugin.app.waibuMpa.attrToArray(params.attr[key])
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.plugin.app.waibuMpa.attrToArray(params.attr[key])
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(':')
@@ -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.plugin.app.waibu
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.value && this.component.locals.form) {
15
+ if (has(attr, 'name') && !has(attr, 'value') && this.component.locals.form) {
14
16
  attr.dataType = attr.dataType ?? 'auto'
15
- const val = get(this, `component.locals.form.${attr.name}`)
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.rel) {
21
- const [rel, fieldName = 'id'] = attr.rel.split(':')
22
- attr.value = get(this, `component.locals.form._rel.${rel}.${fieldName}`, val)
23
- } else if (attr.dataType === 'boolean') attr.value = this.component.req.t(val ? 'Yes' : 'No')
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.value) attr.value = 'true'
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, get } = this.app.lib._
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') && !attr.value) attr.value = 'true'
70
- if (has(attr, 'name') && !has(attr, 'checked') && attr.value === get(this, `locals.form.${attr.name}`)) attr.checked = true
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.baseFactory {
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.baseFactory {
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, attribsStringify } = this.plugin.app.waibuMpa
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 ${attribsStringify(group.header)}>`,
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}"`,
@@ -1,7 +1,7 @@
1
1
  const cls = 'accordion'
2
2
 
3
3
  async function accordion () {
4
- return class Accordion extends this.baseFactory {
4
+ return class Accordion extends this.app.baseClass.MpaWidget {
5
5
  constructor (options) {
6
6
  super(options)
7
7
  this.selector = '.' + cls
@@ -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.baseFactory {
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.baseFactory {
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, attribsStringify } = this.plugin.app.waibuMpa
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.plugin.app.main.dir.pkg}/logo.*`)
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="${attribsStringify(group.img.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.baseFactory {
2
+ return class AppLauncher extends this.app.baseClass.MpaWidget {
3
3
  constructor (options) {
4
4
  super(options)
5
- const { generateId } = this.plugin.app.bajo
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.plugin.app.sumba) launcher += '<c:sumba-nav-dropdown-user padding="end-2" />\n'
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 = 'badge'
2
2
 
3
3
  async function badge () {
4
- return class Badge extends this.baseFactory {
4
+ return class Badge extends this.app.baseClass.MpaWidget {
5
5
  constructor (options) {
6
6
  super(options)
7
7
  this.selector = '.' + cls
@@ -1,7 +1,7 @@
1
1
  const cls = 'blockquote'
2
2
 
3
3
  async function blockquote () {
4
- return class Blockquote extends this.baseFactory {
4
+ return class Blockquote extends this.app.baseClass.MpaWidget {
5
5
  constructor (options) {
6
6
  super(options)
7
7
  this.selector = '.' + cls
@@ -1,7 +1,7 @@
1
1
  const cls = 'breadcrumb-item'
2
2
 
3
3
  async function breadcrumbItem () {
4
- return class BreadcrumbItem extends this.baseFactory {
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.plugin.app.waibuMpa
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.baseFactory {
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.plugin.app.waibu
42
- const { urlToBreadcrumb, attrToArray } = this.plugin.app.waibuMpa
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}';"`
@@ -1,5 +1,5 @@
1
1
  async function btnBackToTop () {
2
- return class BtnBackToTop extends this.baseFactory {
2
+ return class BtnBackToTop extends this.app.baseClass.MpaWidget {
3
3
  constructor (options) {
4
4
  super(options)
5
5
  this.params.noTag = true
@@ -1,7 +1,7 @@
1
1
  const cls = 'btn-close'
2
2
 
3
3
  async function btnClose () {
4
- return class BtnClose extends this.baseFactory {
4
+ return class BtnClose extends this.app.baseClass.MpaWidget {
5
5
  constructor (options) {
6
6
  super(options)
7
7
  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.baseFactory {
6
+ return class BtnGroup extends this.app.baseClass.MpaWidget {
7
7
  constructor (options) {
8
8
  super(options)
9
9
  this.selector = '.' + cls
@@ -1,7 +1,7 @@
1
1
  const cls = 'btn-toolbar'
2
2
 
3
3
  async function btnToolbar () {
4
- return class BtnToolbar extends this.baseFactory {
4
+ return class BtnToolbar extends this.app.baseClass.MpaWidget {
5
5
  constructor (options) {
6
6
  super(options)
7
7
  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.baseFactory {
6
+ return class Btn extends this.app.baseClass.MpaWidget {
7
7
  constructor (options) {
8
8
  super(options)
9
9
  this.selector = '.' + cls
@@ -1,7 +1,7 @@
1
1
  const cls = 'card-body'
2
2
 
3
3
  async function cardBody () {
4
- return class CardBody extends this.baseFactory {
4
+ return class CardBody extends this.app.baseClass.MpaWidget {
5
5
  constructor (options) {
6
6
  super(options)
7
7
  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.baseFactory {
5
+ return class CardFooter extends this.app.baseClass.MpaWidget {
6
6
  constructor (options) {
7
7
  super(options)
8
8
  this.selector = '.' + cls
@@ -1,7 +1,7 @@
1
1
  const cls = 'card-group'
2
2
 
3
3
  async function cardGroup () {
4
- return class CardGroup extends this.baseFactory {
4
+ return class CardGroup extends this.app.baseClass.MpaWidget {
5
5
  constructor (options) {
6
6
  super(options)
7
7
  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.baseFactory {
15
+ return class CardHeader extends this.app.baseClass.MpaWidget {
16
16
  constructor (options) {
17
17
  super(options)
18
18
  this.selector = '.' + cls
@@ -1,7 +1,7 @@
1
1
  const cls = 'card-link'
2
2
 
3
3
  async function cardLink () {
4
- return class CardLink extends this.baseFactory {
4
+ return class CardLink extends this.app.baseClass.MpaWidget {
5
5
  constructor (options) {
6
6
  super(options)
7
7
  this.selector = '.' + cls
@@ -1,7 +1,7 @@
1
1
  const cls = 'card-subtitle'
2
2
 
3
3
  async function cardSubtitle () {
4
- return class CardSubtitle extends this.baseFactory {
4
+ return class CardSubtitle extends this.app.baseClass.MpaWidget {
5
5
  constructor (options) {
6
6
  super(options)
7
7
  this.selector = '.' + cls
@@ -1,7 +1,7 @@
1
1
  const cls = 'card-text'
2
2
 
3
3
  async function cardBody () {
4
- return class CardBody extends this.baseFactory {
4
+ return class CardBody extends this.app.baseClass.MpaWidget {
5
5
  constructor (options) {
6
6
  super(options)
7
7
  this.selector = '.' + cls