waibu-bootstrap 2.6.1 → 2.6.3

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.
@@ -20,17 +20,11 @@ async function appLauncherTrigger () {
20
20
  }
21
21
 
22
22
  build = async () => {
23
- const { fastGlob } = this.app.lib
24
23
  const { groupAttrs, stringifyAttribs } = this.app.waibuMpa
25
24
  const group = groupAttrs(this.params.attr, ['img'])
26
25
  this.params.attr = group._
27
26
  let src = group.img.src
28
- if (!src) {
29
- let logo = 'waibu'
30
- const files = await fastGlob(`${this.app.main.dir.pkg}/logo.*`)
31
- if (files.length > 0) logo = 'main'
32
- src = `waibuMpa:/logo/${logo}`
33
- }
27
+ if (!src) src = 'waibuMpa:/logo/main'
34
28
  this.params.tag = 'a'
35
29
  const sentence = [
36
30
  `<c:img src="${src}"`,
@@ -3,8 +3,8 @@ import { css, scripts, inlineScript, handler } from './form-datetime.js'
3
3
  async function formDate () {
4
4
  return class FormDate extends this.app.baseClass.MpaWidget {
5
5
  static css = [...super.css, ...css]
6
- static scripts = [...super.scripts, ...scripts(this.component.req)]
7
- static inlineScript = inlineScript(this.component.req)
6
+ static scripts = scripts
7
+ static inlineScript = inlineScript
8
8
 
9
9
  build = async () => {
10
10
  const { set } = this.app.lib._
@@ -2,16 +2,21 @@ import { buildFormInput } from './_lib.js'
2
2
  import { build } from './form-input.js'
3
3
 
4
4
  export const css = ['waibuExtra.virtual:/tempusDominus/css/tempus-dominus.min.css']
5
- export function scripts (req) {
5
+ export function scripts (cls) {
6
+ const { isFunction } = this.app.lib._
6
7
  const items = [
7
8
  'waibuExtra.virtual:/popperjs/umd/popper.min.js',
8
9
  'waibuExtra.virtual:/tempusDominus/js/tempus-dominus.min.js'
9
10
  ]
10
- if (req.lang === 'id') items.push('waibuExtra.asset:/js/tempus-dominus-id.js')
11
- return items
11
+ if (this.req.lang === 'id') items.push('waibuExtra.asset:/js/tempus-dominus-id.js')
12
+ else if (this.req.lang !== 'en-US') items.push(`waibuExtra.virtual:/tempusDominus/locales/${this.req.lang}.js`)
13
+
14
+ if (isFunction(cls.scripts)) return items
15
+ return [...cls.scripts ?? [], ...items]
12
16
  }
13
- export function inlineScript (req) {
14
- const { jsonStringify } = this.app.waibuMpa
17
+ export function inlineScript (cls) {
18
+ const { jsonStringify } = this.plugin.app.waibuMpa
19
+ const { isFunction } = this.app.lib._
15
20
  const opts = {
16
21
  display: {
17
22
  icons: {
@@ -28,24 +33,30 @@ export function inlineScript (req) {
28
33
  components: {
29
34
  seconds: true
30
35
  },
31
- theme: req.darkMode ? 'dark' : 'light'
36
+ theme: this.req.darkMode ? 'dark' : 'light'
32
37
  },
33
38
  localization: {
34
39
  format: 'L LTS'
35
40
  }
36
41
  }
37
- const items = [`const tdGlobalOpts = ${jsonStringify(opts, true)}`]
38
- if (req.lang === 'id') {
42
+ let items = [
43
+ `const tdGlobalOpts = ${jsonStringify(opts, true)}`
44
+ ]
45
+ if (this.req.lang !== 'en-US') {
39
46
  items.unshift(
40
- 'tempusDominus.loadLocale(tempusDominus.locales.id)',
41
- 'tempusDominus.locale(tempusDominus.locales.id.name)'
47
+ `tempusDominus.loadLocale(tempusDominus.locales.${this.req.lang})`,
48
+ `tempusDominus.locale(tempusDominus.locales.${this.req.lang}.name)`
42
49
  )
43
50
  }
44
- return items.join('\n')
51
+ items = items.join('\n')
52
+ if (isFunction(cls.inlineScript)) return items
53
+ return (cls.inlineScript ?? '') + '\n' + items
45
54
  }
46
55
 
47
56
  export async function handler (opts, params = {}) {
48
57
  const { jsonStringify } = this.app.waibuMpa
58
+ const { generateId } = this.app.lib.aneka
59
+ this.params.attr.id = generateId('alpha')
49
60
  this.params.attr['x-ref'] = 'self'
50
61
  this.params.attr['x-data'] = `{
51
62
  instance: null,
@@ -54,6 +65,11 @@ export async function handler (opts, params = {}) {
54
65
  this.params.attr['@load.window'] = `
55
66
  const options = _.merge({}, tdGlobalOpts, opts ?? {})
56
67
  instance = new tempusDominus.TempusDominus($refs.self, options)
68
+ instance.subscribe(tempusDominus.Namespace.events.change, (e) => {
69
+ if (e.type === 'change.td') {
70
+ $dispatch('input', instance.dates.lastPicked.toISOString())
71
+ }
72
+ })
57
73
  `
58
74
  await build.call(this, buildFormInput, this.params)
59
75
  }
@@ -61,8 +77,8 @@ export async function handler (opts, params = {}) {
61
77
  async function formDatetime () {
62
78
  return class FormDatetime extends this.app.baseClass.MpaWidget {
63
79
  static css = [...super.css, ...css]
64
- static scripts = [...super.scripts, ...scripts(this.component.req)]
65
- static inlineScript = inlineScript(this.component.req)
80
+ static scripts = scripts
81
+ static inlineScript = inlineScript
66
82
 
67
83
  build = async () => {
68
84
  const { set } = this.app.lib._
@@ -3,8 +3,8 @@ import { css, scripts, inlineScript, handler } from './form-datetime.js'
3
3
  async function formTime () {
4
4
  return class FormTime extends this.app.baseClass.MpaWidget {
5
5
  static css = [...super.css, ...css]
6
- static scripts = [...super.scripts, ...scripts(this.component.req)]
7
- static inlineScript = inlineScript(this.component.req)
6
+ static scripts = scripts
7
+ static inlineScript = inlineScript
8
8
 
9
9
  build = async () => {
10
10
  const { set } = this.app.lib._
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-bootstrap",
3
- "version": "2.6.1",
3
+ "version": "2.6.3",
4
4
  "description": "Bootstrap suport for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-04-01
4
+
5
+ - [2.6.3] Bug fix on widget ```form-datetime```
6
+
7
+ ## 2026-03-07
8
+
9
+ - [2.6.2] Bug fix on widget ```app-launcher-trigger```
10
+
3
11
  ## 2026-03-06
4
12
 
5
13
  - [2.6.1] Bug fix on ```wbs.js```