waibu-db 1.1.3 → 1.1.5
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/bajo/intl/en-US.json +29 -0
- package/bajo/intl/id.json +28 -21
- package/bajoTemplate/partial/crud/add-handler.html +4 -4
- package/bajoTemplate/partial/crud/edit-handler.html +2 -2
- package/bajoTemplate/template/crud/add.html +1 -1
- package/bajoTemplate/template/crud/details.html +1 -1
- package/bajoTemplate/template/crud/edit.html +1 -1
- package/bajoTemplate/template/crud/list.html +1 -1
- package/bajoTemplate/template/disabled.html +1 -2
- package/lib/crud/helper/build-params.js +3 -3
- package/package.json +1 -1
- package/plugin/method/admin-menu.js +5 -5
- package/waibuBootstrap/theme/component/factory/btn-add.js +1 -1
- package/waibuBootstrap/theme/component/factory/btn-back.js +1 -1
- package/waibuBootstrap/theme/component/factory/btn-clone.js +1 -1
- package/waibuBootstrap/theme/component/factory/btn-columns.js +2 -2
- package/waibuBootstrap/theme/component/factory/btn-delete.js +2 -2
- package/waibuBootstrap/theme/component/factory/btn-details.js +1 -1
- package/waibuBootstrap/theme/component/factory/btn-edit.js +2 -2
- package/waibuBootstrap/theme/component/factory/btn-export.js +16 -16
- package/waibuBootstrap/theme/component/factory/query.js +6 -6
- package/waibuBootstrap/theme/component/factory/recs-info.js +3 -3
- package/waibuBootstrap/theme/component/factory/table.js +1 -1
package/bajo/intl/en-US.json
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
+
"pageOfPages%s%s": "Page %s of %s pages",
|
|
3
|
+
"recsFound%s": "%s record(s) found",
|
|
4
|
+
"recsPerPage": "recs per page",
|
|
5
|
+
"addAsNewClone": "Add as New Clone",
|
|
6
|
+
"details": "Details",
|
|
7
|
+
"clone": "Clone",
|
|
8
|
+
"delivery": "Delivery",
|
|
9
|
+
"saveAsFile": "Save as File",
|
|
10
|
+
"formattedField": "Formatted Field",
|
|
11
|
+
"formattedValue": "Formatted Value",
|
|
12
|
+
"zipped": "Zipped",
|
|
13
|
+
"fileType": "File Type",
|
|
14
|
+
"aboutToRemoveRecord": "You're about to remove one or more records. Are you really sure to do this?",
|
|
15
|
+
"columns": "Kolom",
|
|
16
|
+
"noStatYet": "Maaf, belum ada statistik",
|
|
17
|
+
"%s - %s": "%s - %s",
|
|
18
|
+
"list": "List ",
|
|
19
|
+
"add": "Add ",
|
|
20
|
+
"edit": "Edit",
|
|
21
|
+
"yes": "Yes",
|
|
22
|
+
"no": "No",
|
|
23
|
+
"db": "DB",
|
|
24
|
+
"excelXlsx": "Excel XLSX",
|
|
25
|
+
"csv": "CSV",
|
|
26
|
+
"xml": "XML",
|
|
27
|
+
"json": "JSON",
|
|
28
|
+
"addMoreAfterSubmit": "Add more after submit",
|
|
29
|
+
"clonePrevious": "Clone previous",
|
|
30
|
+
"actionPermanentlyDisabled%s": "Sorry, action '%s' is permanently disabled at database level. For more information, please contact your Admin immediately, thank you!",
|
|
2
31
|
"op": {
|
|
3
32
|
"equals": "Equals",
|
|
4
33
|
"notEquals": "Not Equals",
|
package/bajo/intl/id.json
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"%s
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
2
|
+
"pageOfPages%s%s": "Hal %s dari %s",
|
|
3
|
+
"recsFound%s": "Ditemukan %s data",
|
|
4
|
+
"recsPerPage": "data per halaman",
|
|
5
|
+
"addAsNewClone": "Tambah sbg Duplikat",
|
|
6
|
+
"details": "Detil",
|
|
7
|
+
"clone": "Gandakan",
|
|
8
|
+
"delivery": "Penyampaian",
|
|
9
|
+
"saveAsFile": "Simpan sbg Berkas",
|
|
10
|
+
"formattedField": "Kolom Terformat",
|
|
11
|
+
"formattedValue": "Nilai Terformat",
|
|
12
|
+
"zipped": "Di kompres",
|
|
13
|
+
"fileType": "Tipe Berkas",
|
|
14
|
+
"aboutToRemoveRecord": "Anda akan menghapus satu atau lebih data. Anda yakin akan melakukannya?",
|
|
15
|
+
"columns": "Kolom",
|
|
16
|
+
"noStatYet": "Maaf, belum ada statistik",
|
|
17
17
|
"%s - %s": "%s - %s",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
18
|
+
"list": "Daftar",
|
|
19
|
+
"add": "Tambah",
|
|
20
|
+
"edit": "Ubah",
|
|
21
|
+
"yes": "Ya",
|
|
22
|
+
"no": "Tidak",
|
|
23
|
+
"db": "DB",
|
|
24
|
+
"excelXlsx": "Excel XLSX",
|
|
25
|
+
"csv": "CSV",
|
|
26
|
+
"xml": "XML",
|
|
27
|
+
"json": "JSON",
|
|
28
|
+
"addMoreAfterSubmit": "Tambah lagi setelah kirim",
|
|
29
|
+
"clonePrevious": "Duplikasi sebelumnya",
|
|
30
|
+
"actionPermanentlyDisabled%s": "Sorry, action '%s' is permanently disabled at database level. For more information, please contact your Admin immediately, thank you!",
|
|
24
31
|
"op": {
|
|
25
32
|
"equals": "Sama Dengan",
|
|
26
33
|
"notEquals": "Tidak Sama Dengan",
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
</c:grid-col>
|
|
7
7
|
<c:grid-col col="6-md">
|
|
8
8
|
<c:div flex="justify-content:end-md align-items:center">
|
|
9
|
-
<c:btn type="reset" color="secondary" t:content="
|
|
10
|
-
<c:btn type="submit" color="primary" t:content="
|
|
9
|
+
<c:btn type="reset" color="secondary" t:content="reset" />
|
|
10
|
+
<c:btn type="submit" color="primary" t:content="submit" margin="start-2"/>
|
|
11
11
|
</c:div>
|
|
12
12
|
</c:grid-col>
|
|
13
13
|
<c:grid-col col="12" margin="top-4">
|
|
14
|
-
<c:form-switch name="_addmore" t:label="
|
|
15
|
-
<c:form-switch name="_cloneprev" t:label="
|
|
14
|
+
<c:form-switch name="_addmore" t:label="addMoreAfterSubmit"/>
|
|
15
|
+
<c:form-switch name="_cloneprev" t:label="clonePrevious"/>
|
|
16
16
|
</c:grid-col>
|
|
17
17
|
</c:grid-row>
|
|
18
18
|
</c:form>
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
</c:grid-col>
|
|
12
12
|
<c:grid-col col="6-lg" flex="justify-content:end-lg align-items:center">
|
|
13
13
|
<c:wdb-btn-delete/>
|
|
14
|
-
<c:btn type="reset" color="secondary" t:content="
|
|
15
|
-
<c:btn type="submit" color="primary" t:content="
|
|
14
|
+
<c:btn type="reset" color="secondary" t:content="reset" margin="start-2"/>
|
|
15
|
+
<c:btn type="submit" color="primary" t:content="submit" margin="start-2"/>
|
|
16
16
|
</c:grid-col>
|
|
17
17
|
</c:grid-row>
|
|
18
18
|
</c:form>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<c:heading move-to="#fullTitle" type="5" t:content="%s - %s|<%= page.modelTitle %>|<%= _t('
|
|
1
|
+
<c:heading move-to="#fullTitle" type="5" t:content="%s - %s|<%= page.modelTitle %>|<%= _t('add') %>" />
|
|
2
2
|
<!-- include waibuDb.partial:/crud/add-handler.html -->
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<c:heading move-to="#fullTitle" type="5" t:content="%s - %s|<%= page.modelTitle %>|<%= _t('
|
|
1
|
+
<c:heading move-to="#fullTitle" type="5" t:content="%s - %s|<%= page.modelTitle %>|<%= _t('details') %>" />
|
|
2
2
|
<!-- include waibuDb.partial:/crud/details-handler.html -->
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<c:heading move-to="#fullTitle" type="5" t:content="%s - %s|<%= page.modelTitle %>|<%= _t('
|
|
1
|
+
<c:heading move-to="#fullTitle" type="5" t:content="%s - %s|<%= page.modelTitle %>|<%= _t('edit') %>" />
|
|
2
2
|
<!-- include waibuDb.partial:/crud/edit-handler.html -->
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<c:heading move-to="#fullTitle" type="5" t:content="%s - %s|<%= page.modelTitle %>|<%= _t('
|
|
1
|
+
<c:heading move-to="#fullTitle" type="5" t:content="%s - %s|<%= page.modelTitle %>|<%= _t('list') %>" />
|
|
2
2
|
<!-- include waibuDb.partial:/crud/list-handler.html -->
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<c:div margin="top-5">
|
|
2
2
|
<c:heading type="3-display" t:content="Action Disabled" margin="bottom-5"/>
|
|
3
3
|
<c:div>
|
|
4
|
-
<c:t value="<%= action %>">
|
|
5
|
-
please contact your Admin immediately, thank you!</c:t>
|
|
4
|
+
<c:t value="<%= action %>">actionPermanentlyDisabled%s</c:t>
|
|
6
5
|
</c:t>
|
|
7
6
|
</c:div>
|
|
8
7
|
</c:div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
function buildParams ({ model, req, reply, action }) {
|
|
2
2
|
const { camelCase, kebabCase, map, upperFirst, get } = this.lib._
|
|
3
3
|
const { getSchema } = this.app.dobo
|
|
4
|
-
const [
|
|
4
|
+
const [, ...names] = map(kebabCase(model).split('-'), n => upperFirst(n))
|
|
5
5
|
const schema = getSchema(camelCase(model), false)
|
|
6
|
-
const modelTitle = this.app[schema.ns].title + ': ' + names.join(' ')
|
|
6
|
+
const modelTitle = this.app[schema.ns].title + ': ' + req.t(camelCase(names.join(' ')))
|
|
7
7
|
const page = {
|
|
8
|
-
title: req.t(get(req, 'routeOptions.config.title',
|
|
8
|
+
title: req.t(get(req, 'routeOptions.config.title', this.app[schema.ns].title)),
|
|
9
9
|
modelTitle
|
|
10
10
|
}
|
|
11
11
|
return { page }
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
function modelsMenu (req) {
|
|
1
|
+
function modelsMenu (locals, req) {
|
|
2
2
|
const { getPluginPrefix } = this.app.waibu
|
|
3
|
-
const {
|
|
3
|
+
const { pascalCase } = this.app.bajo
|
|
4
4
|
const { getAppTitle } = this.app.waibuMpa
|
|
5
|
-
const { map, pick, groupBy, keys, kebabCase, filter, get } = this.lib._
|
|
5
|
+
const { camelCase, map, pick, groupBy, keys, kebabCase, filter, get } = this.lib._
|
|
6
6
|
|
|
7
7
|
const prefix = getPluginPrefix(this.name)
|
|
8
8
|
const schemas = filter(this.app.dobo.schemas, s => {
|
|
@@ -26,10 +26,10 @@ function modelsMenu (req) {
|
|
|
26
26
|
const items = omenu[k]
|
|
27
27
|
const plugin = this.app[items[0].ns]
|
|
28
28
|
menu.push({
|
|
29
|
-
|
|
29
|
+
title: k,
|
|
30
30
|
children: map(items, item => {
|
|
31
31
|
return {
|
|
32
|
-
|
|
32
|
+
title: camelCase(item.name.slice(plugin.alias.length)),
|
|
33
33
|
href: `waibuAdmin:/${prefix}/${kebabCase(item.name)}/list`
|
|
34
34
|
}
|
|
35
35
|
})
|
|
@@ -13,7 +13,7 @@ async function btnAdd () {
|
|
|
13
13
|
this.params.html = ''
|
|
14
14
|
return
|
|
15
15
|
}
|
|
16
|
-
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('
|
|
16
|
+
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('add')
|
|
17
17
|
this.params.attr.color = this.params.attr.color ?? 'secondary-outline'
|
|
18
18
|
if (!this.params.attr.href) this.params.attr.href = this.component.buildUrl({ base: 'add' })
|
|
19
19
|
this.params.html = await this.component.buildTag({ tag: 'btn', attr: this.params.attr, html: this.params.html })
|
|
@@ -9,7 +9,7 @@ async function btnBack () {
|
|
|
9
9
|
const { attrToArray } = this.plugin.app.waibuMpa
|
|
10
10
|
const { req } = this.component
|
|
11
11
|
this.params.noTag = true
|
|
12
|
-
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('
|
|
12
|
+
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('back')
|
|
13
13
|
if (isEmpty(this.params.attr.icon)) this.params.attr.icon = 'arrowStart'
|
|
14
14
|
this.params.attr.color = this.params.attr.color ?? 'secondary-outline'
|
|
15
15
|
this.params.attr.excludeQs = ['mode', 'id', ...attrToArray(this.params.attr.excludeQs ?? '')]
|
|
@@ -13,7 +13,7 @@ async function btnClone () {
|
|
|
13
13
|
this.params.html = ''
|
|
14
14
|
return
|
|
15
15
|
}
|
|
16
|
-
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('
|
|
16
|
+
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('clone')
|
|
17
17
|
this.params.attr.color = this.params.attr.color ?? 'secondary-outline'
|
|
18
18
|
if (!this.params.attr.href) this.params.attr.href = this.component.buildUrl({ base: 'add', exclude: ['id'] }) + '&mode=clone'
|
|
19
19
|
if (this.params.attr.onList) {
|
|
@@ -20,7 +20,7 @@ async function btnColumns () {
|
|
|
20
20
|
if (isEmpty(fields)) fields = schema.view.fields
|
|
21
21
|
const items = []
|
|
22
22
|
this.params.attr.color = this.params.attr.color ?? 'secondary-outline'
|
|
23
|
-
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('
|
|
23
|
+
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('columns')
|
|
24
24
|
for (const f of schema.view.fields) {
|
|
25
25
|
if (f === 'id') {
|
|
26
26
|
items.push(await this.component.buildTag({ tag: 'formCheck', attr: { checked: true, label: req.t('ID'), value: f, disabled: true } }))
|
|
@@ -44,7 +44,7 @@ async function btnColumns () {
|
|
|
44
44
|
">`)
|
|
45
45
|
html.push(...items)
|
|
46
46
|
const attr = { size: 'sm', 'x-ref': 'apply', margin: 'top-2', color: this.params.attr.applyColor ?? 'primary', icon: this.params.attr.applyIcon ?? 'arrowsStartEnd', href }
|
|
47
|
-
html.push(await this.component.buildTag({ tag: 'btn', attr, html: req.t('
|
|
47
|
+
html.push(await this.component.buildTag({ tag: 'btn', attr, html: req.t('apply') }))
|
|
48
48
|
html.push('</form>')
|
|
49
49
|
this.params.attr.autoClose = 'outside'
|
|
50
50
|
this.params.attr.triggerColor = this.params.attr.color
|
|
@@ -14,7 +14,7 @@ async function btnDelete () {
|
|
|
14
14
|
this.params.html = ''
|
|
15
15
|
return
|
|
16
16
|
}
|
|
17
|
-
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('
|
|
17
|
+
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('delete')
|
|
18
18
|
this.params.attr.color = this.params.attr.color ?? 'danger-outline'
|
|
19
19
|
this.params.attr.id = generateId('alpha')
|
|
20
20
|
if (this.params.attr.onList) {
|
|
@@ -41,7 +41,7 @@ async function btnDelete () {
|
|
|
41
41
|
}
|
|
42
42
|
}`
|
|
43
43
|
}
|
|
44
|
-
const msg = '
|
|
44
|
+
const msg = 'aboutToRemoveRecord'
|
|
45
45
|
this.params.attr['@click'] = `
|
|
46
46
|
await wbs.confirmation(\`${req.t(msg)}\`, { ok: '${this.params.attr.id}:remove', close: 'y', opts: selected })
|
|
47
47
|
`
|
|
@@ -14,7 +14,7 @@ async function btnDetails () {
|
|
|
14
14
|
this.params.html = ''
|
|
15
15
|
return
|
|
16
16
|
}
|
|
17
|
-
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('
|
|
17
|
+
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('details')
|
|
18
18
|
this.params.attr.color = this.params.attr.color ?? 'secondary-outline'
|
|
19
19
|
this.params.attr.id = generateId('alpha')
|
|
20
20
|
if (!this.params.attr.href) this.params.attr.href = this.component.buildUrl({ base: 'details', exclude: ['id'] })
|
|
@@ -14,7 +14,7 @@ async function btnEdit () {
|
|
|
14
14
|
this.params.html = ''
|
|
15
15
|
return
|
|
16
16
|
}
|
|
17
|
-
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('
|
|
17
|
+
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('edit')
|
|
18
18
|
this.params.attr.color = this.params.attr.color ?? 'secondary-outline'
|
|
19
19
|
this.params.attr.id = generateId('alpha')
|
|
20
20
|
if (!this.params.attr.href) this.params.attr.href = this.component.buildUrl({ base: 'edit', exclude: ['id'] })
|
|
@@ -52,7 +52,7 @@ async function btnEdit () {
|
|
|
52
52
|
}
|
|
53
53
|
`
|
|
54
54
|
const html = [
|
|
55
|
-
await this.component.buildTag({ tag: 'dropdownItem', attr: { content: req.t('
|
|
55
|
+
await this.component.buildTag({ tag: 'dropdownItem', attr: { content: req.t('addAsNewClone') } })
|
|
56
56
|
]
|
|
57
57
|
this.params.attr.triggerColor = this.params.attr.color
|
|
58
58
|
this.params.html = await this.component.buildTag({ tag: 'dropdown', attr: this.params.attr, html: html.join('\n') })
|
|
@@ -15,9 +15,9 @@ async function btnExport () {
|
|
|
15
15
|
this.params.html = ''
|
|
16
16
|
return
|
|
17
17
|
}
|
|
18
|
-
if (isEmpty(this.params.attr.trigger)) this.params.attr.trigger = req.t('
|
|
18
|
+
if (isEmpty(this.params.attr.trigger)) this.params.attr.trigger = req.t('export')
|
|
19
19
|
this.params.attr.triggerColor = this.params.attr.triggerColor ?? 'secondary-outline'
|
|
20
|
-
this.params.attr.title = req.t('
|
|
20
|
+
this.params.attr.title = req.t('dataExport')
|
|
21
21
|
const html = await this.component.buildSentence(`
|
|
22
22
|
<c:div x-data="{
|
|
23
23
|
delivery: 'clipboard',
|
|
@@ -105,28 +105,28 @@ async function btnExport () {
|
|
|
105
105
|
">
|
|
106
106
|
<c:grid-row gutter="2">
|
|
107
107
|
<c:grid-col col="6-md">
|
|
108
|
-
<c:fieldset t:legend="
|
|
109
|
-
<c:form-radio x-model="delivery" value="file" t:label="
|
|
110
|
-
<c:form-radio x-model="delivery" value="clipboard" t:label="
|
|
108
|
+
<c:fieldset t:legend="delivery" legend-type="6">
|
|
109
|
+
<c:form-radio x-model="delivery" value="file" t:label="saveAsFile" />
|
|
110
|
+
<c:form-radio x-model="delivery" value="clipboard" t:label="copyToClipboard" />
|
|
111
111
|
</c:fieldset>
|
|
112
|
-
<c:fieldset t:legend="
|
|
113
|
-
<c:form-check x-ref="fkey" x-model="options" value="fkey" t:label="
|
|
114
|
-
<c:form-check x-ref="fvalue" x-model="options" value="fvalue" t:label="
|
|
115
|
-
<c:form-check x-ref="zip" x-model="options" value="zip" t:label="
|
|
112
|
+
<c:fieldset t:legend="options" legend-type="6" margin="top-2">
|
|
113
|
+
<c:form-check x-ref="fkey" x-model="options" value="fkey" t:label="formattedField" />
|
|
114
|
+
<c:form-check x-ref="fvalue" x-model="options" value="fvalue" t:label="formattedValue" />
|
|
115
|
+
<c:form-check x-ref="zip" x-model="options" value="zip" t:label="zipped" />
|
|
116
116
|
</c:fieldset>
|
|
117
117
|
</c:grid-col>
|
|
118
118
|
<c:grid-col col="6-md">
|
|
119
|
-
<c:fieldset t:legend="
|
|
120
|
-
<c:form-radio x-ref="xlsx" x-model="ftype" value="xlsx" t:label="
|
|
121
|
-
<c:form-radio x-ref="csv" x-model="ftype" value="csv" t:label="
|
|
122
|
-
<c:form-radio x-ref="xml" x-model="ftype" value="xml" t:label="
|
|
123
|
-
<c:form-radio x-ref="json" x-model="ftype" value="json" t:label="
|
|
119
|
+
<c:fieldset t:legend="fileType" legend-type="6">
|
|
120
|
+
<c:form-radio x-ref="xlsx" x-model="ftype" value="xlsx" t:label="excelXlsx" />
|
|
121
|
+
<c:form-radio x-ref="csv" x-model="ftype" value="csv" t:label="csv" />
|
|
122
|
+
<c:form-radio x-ref="xml" x-model="ftype" value="xml" t:label="xml" />
|
|
123
|
+
<c:form-radio x-ref="json" x-model="ftype" value="json" t:label="json" />
|
|
124
124
|
</c:fieldset />
|
|
125
125
|
</c:grid-col>
|
|
126
126
|
</c:grid-row>
|
|
127
127
|
<c:div flex="justify-content:end" margin="top-3">
|
|
128
|
-
<c:btn color="secondary" t:content="
|
|
129
|
-
<c:btn color="primary" t:content="
|
|
128
|
+
<c:btn color="secondary" t:content="close" dismiss />
|
|
129
|
+
<c:btn color="primary" t:content="submit" margin="start-2" @click="await submit()" />
|
|
130
130
|
</c:div>
|
|
131
131
|
</c:div>
|
|
132
132
|
`)
|
|
@@ -51,12 +51,12 @@ async function query () {
|
|
|
51
51
|
this.params.noTag = true
|
|
52
52
|
const container = this.params.attr.modal ? 'modal' : 'drawer'
|
|
53
53
|
this.params.html = await this.component.buildSentence(`
|
|
54
|
-
<c:form-input ${count === 0 ? 'disabled' : ''} type="search" t:placeholder="
|
|
54
|
+
<c:form-input ${count === 0 ? 'disabled' : ''} type="search" t:placeholder="query" id="${id}" x-data="{ query: '' }" x-init="
|
|
55
55
|
const url = new URL(window.location.href)
|
|
56
56
|
query = url.searchParams.get('${qsKey.query}') ?? ''
|
|
57
57
|
" x-model="query" @on-query.window="query = $event.detail ?? ''" @keyup.enter="$dispatch('on-submit')">
|
|
58
58
|
<c:form-input-addon>
|
|
59
|
-
<c:${container} ${count === 0 ? 'trigger-disabled' : ''} trigger-icon="${this.params.attr.icon ?? 'dotsThree'}" trigger-on-end t:title="
|
|
59
|
+
<c:${container} ${count === 0 ? 'trigger-disabled' : ''} trigger-icon="${this.params.attr.icon ?? 'dotsThree'}" trigger-on-end t:title="queryBuilder" x-ref="query" x-data="{
|
|
60
60
|
fields: ${jsonStringify(fields, true)},
|
|
61
61
|
builder: '',
|
|
62
62
|
selected: [],
|
|
@@ -151,14 +151,14 @@ async function query () {
|
|
|
151
151
|
${columns.join('\n')}
|
|
152
152
|
</c:grid-row>
|
|
153
153
|
<c:div flex="justify-content:end" margin="top-3">
|
|
154
|
-
<c:btn color="secondary" t:content="
|
|
155
|
-
<c:btn color="primary" t:content="
|
|
156
|
-
<c:btn color="primary" t:content="
|
|
154
|
+
<c:btn color="secondary" t:content="close" dismiss="${container}" />
|
|
155
|
+
<c:btn color="primary" t:content="apply" margin="start-2" @click="submit()" />
|
|
156
|
+
<c:btn color="primary" t:content="submitQuery" margin="start-2" @click="submit(true)" />
|
|
157
157
|
</c:div>
|
|
158
158
|
</c:${container}>
|
|
159
159
|
</c:form-input-addon>
|
|
160
160
|
<c:form-input-addon>
|
|
161
|
-
<c:btn ${count === 0 ? 'disabled' : ''} t:content="
|
|
161
|
+
<c:btn ${count === 0 ? 'disabled' : ''} t:content="submit" x-data="{
|
|
162
162
|
submit () {
|
|
163
163
|
const val = document.getElementById('${id}').value ?? ''
|
|
164
164
|
const url = new URL(window.location.href)
|
|
@@ -30,10 +30,10 @@ async function recsInfo () {
|
|
|
30
30
|
if (!this.params.attr.dropdown) this.params.attr.dropdown = true
|
|
31
31
|
const group = groupAttrs(this.params.attr, ['dropdown'])
|
|
32
32
|
const html = []
|
|
33
|
-
if (this.params.attr.count) html.push(req.t('%s
|
|
33
|
+
if (this.params.attr.count) html.push(req.t('recsFound%s', req.format(count, 'integer')))
|
|
34
34
|
if (this.params.attr.pages) {
|
|
35
35
|
if (!isEmpty(html)) html[html.length - 1] += '.'
|
|
36
|
-
html.push(req.t('
|
|
36
|
+
html.push(req.t('pageOfPages%s%s', req.format(page, 'integer'), req.format(pages, 'integer')))
|
|
37
37
|
}
|
|
38
38
|
if (this.params.attr.recsPerPage) {
|
|
39
39
|
this.params.attr.recsPerPageValues = this.params.attr.recsPerPageValues ?? '10 25 50'
|
|
@@ -48,7 +48,7 @@ async function recsInfo () {
|
|
|
48
48
|
attr.content = limit + ''
|
|
49
49
|
attr.color = attr.color ?? 'secondary-outline'
|
|
50
50
|
html.push(await this.component.buildTag({ tag: 'dropdown', attr, html: items.join('\n') }))
|
|
51
|
-
html.push(' ', req.t('
|
|
51
|
+
html.push(' ', req.t('recsPerPage'))
|
|
52
52
|
}
|
|
53
53
|
this.params.attr = omit(this.params.attr, ['count', 'pages', 'recsPerPage', 'dropdown', 'recsPerPageValues'])
|
|
54
54
|
this.params.html = html.map(h => `<div class="me-1">${h}</div>`).join('\n')
|
|
@@ -31,7 +31,7 @@ async function table () {
|
|
|
31
31
|
const data = get(this, 'component.locals.list.data', [])
|
|
32
32
|
const count = get(this, 'component.locals.list.count', 0)
|
|
33
33
|
if (count === 0) {
|
|
34
|
-
const alert = '<c:alert color="warning" t:content="
|
|
34
|
+
const alert = '<c:alert color="warning" t:content="noRecordFound" margin="top-4"/>'
|
|
35
35
|
this.params.noTag = true
|
|
36
36
|
this.params.html = await this.component.buildSentence(alert)
|
|
37
37
|
return
|