waibu-bootstrap 1.2.11 → 1.2.13
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,36 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "waibu-bootstrap",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "Bootstrap suport for Waibu Framework",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
-
},
|
|
9
|
-
"type": "module",
|
|
10
|
-
"bajo": {
|
|
11
|
-
"type": "plugin"
|
|
12
|
-
},
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/ardhi/waibu-bootstrap.git"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"bootstrap",
|
|
19
|
-
"waibu",
|
|
20
|
-
"web",
|
|
21
|
-
"webserver",
|
|
22
|
-
"bajo",
|
|
23
|
-
"framework",
|
|
24
|
-
"fastify",
|
|
25
|
-
"modular"
|
|
26
|
-
],
|
|
27
|
-
"author": "Ardhi Lukianto <ardhi@lukianto.com>",
|
|
28
|
-
"license": "MIT",
|
|
29
|
-
"bugs": {
|
|
30
|
-
"url": "https://github.com/ardhi/waibu-bootstrap/issues"
|
|
31
|
-
},
|
|
32
|
-
"homepage": "https://github.com/ardhi/waibu-bootstrap#readme",
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"bootstrap": "^5.3.3"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "waibu-bootstrap",
|
|
3
|
+
"version": "1.2.13",
|
|
4
|
+
"description": "Bootstrap suport for Waibu Framework",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"bajo": {
|
|
11
|
+
"type": "plugin"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/ardhi/waibu-bootstrap.git"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"bootstrap",
|
|
19
|
+
"waibu",
|
|
20
|
+
"web",
|
|
21
|
+
"webserver",
|
|
22
|
+
"bajo",
|
|
23
|
+
"framework",
|
|
24
|
+
"fastify",
|
|
25
|
+
"modular"
|
|
26
|
+
],
|
|
27
|
+
"author": "Ardhi Lukianto <ardhi@lukianto.com>",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/ardhi/waibu-bootstrap/issues"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/ardhi/waibu-bootstrap#readme",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"bootstrap": "^5.3.3"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -9,7 +9,9 @@ async function appLauncher () {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
build = async () => {
|
|
12
|
-
const {
|
|
12
|
+
const { locals } = this.component
|
|
13
|
+
const { routePath } = this.app.waibu
|
|
14
|
+
const { groupAttrs, attrToArray } = this.app.waibuMpa
|
|
13
15
|
const menu = this.params.attr.menu ?? 'pages'
|
|
14
16
|
const group = groupAttrs(this.params.attr, ['trigger'])
|
|
15
17
|
let launcher = `<c:drawer id="${this.params.attr.id}" t:title="Modules" no-padding style="${menu === 'pages' ? 'width:350px' : ''}">\n`
|
|
@@ -18,7 +20,9 @@ async function appLauncher () {
|
|
|
18
20
|
if (toolbar.length > 0) {
|
|
19
21
|
if (menu === 'pages') toolbar.unshift('home')
|
|
20
22
|
launcher += `<c:div padding="x-3 ${menu === 'home' ? 'bottom-3' : ''}">`
|
|
21
|
-
launcher += '<c:navbar padding="y-0"
|
|
23
|
+
launcher += '<c:navbar padding="y-0"><c:nav tag="ul">\n'
|
|
24
|
+
if (locals._meta.isAdmin) launcher += '<c:nav-item text="color:danger" href="' + routePath('waibuAdmin:/') + '" icon="lock" padding="start-0" />\n'
|
|
25
|
+
launcher += '</c:nav>\n<c:nav tag="ul">\n'
|
|
22
26
|
for (const t of toolbar) {
|
|
23
27
|
if (t === 'home') launcher += '<c:nav-item href="/" icon="house" padding="end-2" />\n'
|
|
24
28
|
if (t === 'user' && this.plugin.app.sumba) launcher += '<c:sumba-nav-dropdown-user padding="end-2" />\n'
|
|
@@ -117,22 +117,25 @@ async function formSelectExt () {
|
|
|
117
117
|
}
|
|
118
118
|
}`
|
|
119
119
|
}
|
|
120
|
-
|
|
121
120
|
this.params.attr['@load.window'] = `
|
|
122
121
|
const opts = ${opts}
|
|
123
122
|
instance = new TomSelect($refs.${xref}, opts)
|
|
124
123
|
const val = $refs.${xref}.dataset.value
|
|
125
|
-
if (!_.isEmpty(val)) {
|
|
126
|
-
fetch('${group.remote.url}?query=${group.remote.valueField}:' + val, ${jsonStringify(fetchOpts, true)})
|
|
127
|
-
.then(resp => resp.json())
|
|
128
|
-
.then(json => {
|
|
129
|
-
if (json.data.length === 0) return
|
|
130
|
-
const opt = _.pick(json.data[0], ['${group.remote.valueField}', '${group.remote.labelField}'])
|
|
131
|
-
instance.addOption(opt)
|
|
132
|
-
instance.setValue(opt.${group.remote.valueField})
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
124
|
`
|
|
125
|
+
if (group.remote) {
|
|
126
|
+
this.params.attr['@load.window'] += `
|
|
127
|
+
if (!_.isEmpty(val)) {
|
|
128
|
+
fetch('${group.remote.url}?query=${group.remote.valueField}:' + val, ${jsonStringify(fetchOpts, true)})
|
|
129
|
+
.then(resp => resp.json())
|
|
130
|
+
.then(json => {
|
|
131
|
+
if (json.data.length === 0) return
|
|
132
|
+
const opt = _.pick(json.data[0], ['${group.remote.valueField}', '${group.remote.labelField}'])
|
|
133
|
+
instance.addOption(opt)
|
|
134
|
+
instance.setValue(opt.${group.remote.valueField})
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
`
|
|
138
|
+
}
|
|
136
139
|
this.params.attr.options = options
|
|
137
140
|
this.params.attr = omit(this.params.attr, ['noDropdownInput', 'removeBtn', 'clearBtn', 'c-opts', 'remoteUrl', 'remoteSearchField', 'remoteLabelField', 'remoteValueField'])
|
|
138
141
|
await build.call(this, buildFormSelect, this.params)
|