waibu-bootstrap 1.2.4 → 1.2.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-bootstrap",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Bootstrap suport for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -82,15 +82,15 @@ async function formSelectExt () {
82
82
  const group = groupAttrs(this.params.attr, ['remote'])
83
83
  if (group.remote) {
84
84
  group.remote.url = routePath(group.remote.url)
85
- group.remote.searchField = group.remote.searchField ?? 'name'
86
- group.remote.labelField = group.remote.labelField ?? 'name'
85
+ group.remote.searchField = group.remote.searchField ?? 'id'
86
+ group.remote.labelField = group.remote.labelField ?? 'id'
87
87
  group.remote.valueField = group.remote.valueField ?? 'id'
88
88
  opts = `{
89
89
  searchField: '${group.remote.searchField}',
90
90
  labelField: '${group.remote.labelField}',
91
91
  valueField: '${group.remote.valueField}',
92
92
  load: (query, callback) => {
93
- fetch('${group.remote.url}?query=${group.remote.searchField}:~^\\'' + query + '\\'')
93
+ fetch('${group.remote.url}?query=${group.remote.searchField}:~\\'' + query + '\\'')
94
94
  .then(resp => resp.json())
95
95
  .then(json => {
96
96
  callback(json.data)
@@ -101,11 +101,11 @@ async function formSelectExt () {
101
101
  },
102
102
  render: {
103
103
  option: (data, escape) => {
104
- return '<div>' + escape(data.name) + '</div>'
104
+ return '<div>' + escape(data.${group.remote.labelField}) + '</div>'
105
105
  },
106
106
  item: (data, escape) => {
107
107
  $dispatch('formselectext', { id: '${this.params.attr.id}', data })
108
- return '<div>' + escape(data.name) + '</div>'
108
+ return '<div>' + escape(data.${group.remote.labelField}) + '</div>'
109
109
  }
110
110
  }
111
111
  }`
@@ -13,6 +13,11 @@ async function heading () {
13
13
  }
14
14
  if (display) this.params.attr.class.push(`display-${type}`)
15
15
  delete this.params.attr.type
16
+ if (this.params.attr.href) {
17
+ this.params.prepend = `<a class="link-offset-2 link-underline link-underline-opacity-0 link-underline-opacity-75-hover" href="${this.params.attr.href}">`
18
+ this.params.append = '</a>'
19
+ delete this.params.attr.href
20
+ }
16
21
  }
17
22
  }
18
23
  }
@@ -54,15 +54,15 @@ async function navDropdownSetting () {
54
54
  <c:dropdown-item divider />
55
55
  <c:dropdown-item t:content="fullscreen"
56
56
  x-data="{
57
- inText: '${this.component.req.t('fullscreen')}',
58
- outText: '${this.component.req.t('exitFullscreen')}',
57
+ inText: \`${this.component.req.t('fullscreen')}\`,
58
+ outText: \`${this.component.req.t('exitFullscreen')}\`,
59
59
  async toggle () {
60
60
  const el = document.querySelector('body')
61
61
  if (!document.fullscreenElement) {
62
62
  try {
63
63
  await el.requestFullscreen()
64
64
  } catch (err) {
65
- await wbs.notify('cantGoFullscreen', { type: 'danger' })
65
+ await wbs.notify(\`${this.component.req.t('cantGoFullscreen')}\`, { type: 'danger' })
66
66
  }
67
67
  } else {
68
68
  document.exitFullscreen()
@@ -88,7 +88,7 @@ async function navDropdownSetting () {
88
88
  id="${id}"
89
89
  x-data="{
90
90
  async signout () {
91
- await wbs.confirmation('${this.component.req.t('signoutWarning')}', { ok: '${id}:post', close: 'y' })
91
+ await wbs.confirmation(\`${this.component.req.t('signoutWarning')}\`, { ok: '${id}:post', close: 'y' })
92
92
  },
93
93
  post () {
94
94
  wmpa.postForm({}, '${routePath('sumba:/signout')}')
@@ -39,7 +39,7 @@ async function navbar () {
39
39
  const id = generateId()
40
40
  if (this.params.group.drawer) this.params.group.drawer.id = id
41
41
  const btn = `<button class="navbar-toggler" type="button" data-bs-toggle="${type}" ` +
42
- `data-bs-target="#${id}" aria-controls="${id}"${this.params.attr.drawer ? '' : ' aria-expanded="false"'} aria-label="${this.component.req.t('Toggle Navigation')}">` +
42
+ `data-bs-target="#${id}" aria-controls="${id}"${this.params.attr.drawer ? '' : ' aria-expanded="false"'} aria-label="${this.component.req.t('toggleNavigation')}">` +
43
43
  '<span class="navbar-toggler-icon"></span></button>'
44
44
  if (type === 'offcanvas') html = await this.component.buildTag({ tag: 'drawer', attr: this.params.group.drawer, html })
45
45
  else html = `<div class="collapse navbar-collapse justify-content-between" id="${id}">${html}</div>`