waibu-db 1.1.4 → 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.
@@ -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
- "Page %s of %s pages": "Hal %s dari %s",
3
- "%s record(s) found": "Ditemukan %s data",
4
- "recs per page": "data per halaman",
5
- "Add as New Clone": "Tambah sbg Duplikat",
6
- "Details": "Detil",
7
- "Clone": "Gandakan",
8
- "Delivery": "Penyampaian",
9
- "Save as File": "Simpan sbg Berkas",
10
- "Formatted Field": "Kolom Terformat",
11
- "Formatted Value": "Nilai Terformat",
12
- "Zipped": "Di kompres",
13
- "File Type": "Tipe Berkas",
14
- "You're about to remove one or more records. Are you really sure to do this?": "Anda akan menghapus satu atau lebih data. Anda yakin akan melakukannya?",
15
- "Columns": "Kolom",
16
- "No statistic yet, sorry": "Maaf, belum ada statistik",
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
- "List": "Daftar",
19
- "Add": "Tambah",
20
- "Edit": "Ubah",
21
- "Yes": "Ya",
22
- "No": "Tidak",
23
- "Db": "DB",
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="Reset" />
10
- <c:btn type="submit" color="primary" t:content="Submit" margin="start-2"/>
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="Add more after submit"/>
15
- <c:form-switch name="_cloneprev" t:label="Clone previous"/>
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="Reset" margin="start-2"/>
15
- <c:btn type="submit" color="primary" t:content="Submit" margin="start-2"/>
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('Add') %>" />
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('Details') %>" />
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('Edit') %>" />
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('List') %>" />
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 %>">Sorry, action '%s' is permanently disabled at database level. For more information,
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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-db",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "DB Helper",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,10 +26,10 @@ function modelsMenu (locals, req) {
26
26
  const items = omenu[k]
27
27
  const plugin = this.app[items[0].ns]
28
28
  menu.push({
29
- name: k,
29
+ title: k,
30
30
  children: map(items, item => {
31
31
  return {
32
- name: req.t(camelCase(item.name.slice(plugin.alias.length))),
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('Add')
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('Back')
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('Clone')
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('Columns')
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('Apply') }))
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('Delete')
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 = 'You\'re about to remove one or more records. Are you really sure to do this?'
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('Details')
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('Edit')
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('Add as New Clone') } })
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('Export')
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('Data Export')
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="Delivery" legend-type="6">
109
- <c:form-radio x-model="delivery" value="file" t:label="Save as File" />
110
- <c:form-radio x-model="delivery" value="clipboard" t:label="Copy to Clipboard" />
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="Options" legend-type="6" margin="top-2">
113
- <c:form-check x-ref="fkey" x-model="options" value="fkey" t:label="Formatted Field" />
114
- <c:form-check x-ref="fvalue" x-model="options" value="fvalue" t:label="Formatted Value" />
115
- <c:form-check x-ref="zip" x-model="options" value="zip" t:label="Zipped" />
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="File Type" legend-type="6">
120
- <c:form-radio x-ref="xlsx" x-model="ftype" value="xlsx" t:label="Excel XLSX" />
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" />
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="Close" dismiss />
129
- <c:btn color="primary" t:content="Submit" margin="start-2" @click="await submit()" />
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="Query" id="${id}" x-data="{ query: '' }" x-init="
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="Query Builder" x-ref="query" x-data="{
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="Close" dismiss="${container}" />
155
- <c:btn color="primary" t:content="Apply" margin="start-2" @click="submit()" />
156
- <c:btn color="primary" t:content="Submit Query" margin="start-2" @click="submit(true)" />
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="Submit" x-data="{
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 record(s) found', req.format(count, 'integer')))
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('Page %s of %s pages', req.format(page, 'integer'), req.format(pages, 'integer')))
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('recs per page'))
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="No record found" margin="top-4"/>'
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