zet-lib 1.3.5 → 1.3.7

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/lib/Form.js CHANGED
@@ -62,7 +62,7 @@ Form.field = (obj) => {
62
62
  }
63
63
  }
64
64
  let type = obj.type || 'text',
65
- id = Form.addProperty('id', [obj.id]),
65
+ id = obj.isTableModule ? '' : Form.addProperty('id', [obj.id]),
66
66
  name = obj.name ? ` name="${obj.name}" ` : '',
67
67
  title = obj.title || '',
68
68
  prepend = obj.prepend || '',
@@ -916,7 +916,7 @@ Form.modal = (obj, LANGUAGE = {}) => {
916
916
  <input type="hidden" id="serialize_right" name="serialize_right" value=''/>
917
917
  </form>
918
918
  </div> <!-- .dynagrid-config-form -->`,
919
- footer: `<select id="zgrid_default_type" class="form-control select-sm" style="width:100px"><option value="1">Data Table</option><option value="2">Table</option> </select>
919
+ footer: `<select id="zgrid_default_type" class="form-control select-sm" style="width:100px"><option value="1">Standart</option><option value="2">Fixed Header</option><option value="3">Footer Total</option><option value="4">No Wrap</option><option value="5">Fixed Header & No Wrap</option><option value="6">Footer Total & No Wrap</option><option value="7">Fixed Header & Footer & No Wrap</option></select>
920
920
  <button type="reset" class="btn btn-default refresh gridreload image-button" title="Abort any changes and reset settings">
921
921
  <img src="/assets/icons/refresh.svg" class="icons-bg-black"> ${LANGUAGE.reset || 'Reset'}
922
922
  </button>
@@ -13,7 +13,7 @@ langs['grid_labeling'] = 'Labeling'
13
13
  langs['grid_configure_field_labeling'] = 'Configure Field Labeling'
14
14
  langs['grid_personalize_labeling'] = 'Personalize Labeling'
15
15
  langs['grid_personalize_setting'] = 'Personalize grid settings'
16
- langs['grid_refresh'] = 'Refresh / Factory Reset'
16
+ langs['grid_refresh'] = 'Refresh / Reset Filter'
17
17
  langs.settings = 'Setting'
18
18
  langs.settings_info = 'Settings'
19
19
  langs.grid_settings = 'Settings Grid'
@@ -13,7 +13,7 @@ langs['grid_labeling'] = 'Penamaan'
13
13
  langs['grid_configure_field_labeling'] = 'Configure Field Labeling'
14
14
  langs['grid_personalize_labeling'] = 'Personalize Labeling'
15
15
  langs['grid_personalize_setting'] = 'Personalize grid settings'
16
- langs['grid_refresh'] = 'Muat Ulang / Kembali setelan pabrik'
16
+ langs['grid_refresh'] = 'Muat Ulang / Hapus filter'
17
17
  langs.settings = 'Pengaturan'
18
18
  langs.settings_info = 'Pengaturan'
19
19
  langs.grid_settings = 'Pengaturan Grid'
package/lib/zRoute.js CHANGED
@@ -2475,7 +2475,7 @@ zRoute.forms = (req, res, MYMODEL, relations, data = {}, tableRelations = {}) =>
2475
2475
  break
2476
2476
  case 'radio':
2477
2477
  obj.type = 'radio'
2478
- obj.class = '';
2478
+ obj.class = ''
2479
2479
  obj.data = relations[key]
2480
2480
  obj.array = relations[key + 'Array']
2481
2481
  break
@@ -4736,6 +4736,7 @@ zRoute.tableBody = (req, res, relations, dataObject, parentTable, fieldName, MYM
4736
4736
  myobj.class = `${parentTable}_${fieldName}_${key}`
4737
4737
  myobj.name = `${parentTable}[${fieldName}][${index}][${key}]`
4738
4738
  myobj.additional_attributes = ` data-name="${key}" data-id="${parentTable}_${fieldName}_${key}" `
4739
+ myobj.isTableModule = 1
4739
4740
  html += `<td class="td_${key}_${MYMODEL.table}">${cForm.field(myobj)}</td>`
4740
4741
  }
4741
4742
  html += `<td style="vertical-align:top"><span class="icon-small icons-danger trash_${fieldName}_${MYMODEL.table}" onclick="$(this).closest('tr').remove()" title="Delete"><img class="icons-bg-white griddelete icon-image" src="/assets/icons/trash-filled.svg"></span></td>`
package/lib/zdataTable.js CHANGED
@@ -10,8 +10,7 @@ class dataTable {
10
10
  this.visibles = datas.visiblesObj //array object
11
11
  this.setColumns = ''
12
12
  this.setTable = ''
13
- this.srcScript = '/modules/datatables.min.js'
14
- this.dataTableScript = '/js/datatable-grids.js'
13
+ this.srcScript = '/modules/datatable/datatables.min.js'
15
14
  this.dataTableButtons = '/js/datatable-buttons.js'
16
15
  this.customButtons = ''
17
16
  this.MYMODEL = null
@@ -24,6 +23,30 @@ class dataTable {
24
23
  this.hasLevels = Object.keys(this.level_approval).length == 0 ? false : true
25
24
  this.visiblesKey = this.visibles.map((item) => item.key)
26
25
  this.gridType = datas.gridType || 1
26
+ if (this.gridType == 1) {
27
+ this.dataTableScript = '/modules/datatable/normal.js'
28
+ } else if (this.gridType == 2) {
29
+ this.dataTableScript = '/modules/datatable/fixed-header.js'
30
+ } else if (this.gridType == 3) {
31
+ this.dataTableScript = '/modules/datatable/footer-total.js'
32
+ } else if (this.gridType == 4) {
33
+ this.dataTableScript = '/modules/datatable/normal.js'
34
+ this.additionalCss = `<style>thead > tr > th {white-space: nowrap;}</style>`
35
+ } else if (this.gridType == 5) {
36
+ this.dataTableScript = '/modules/datatable/fixed-header.js'
37
+ this.additionalCss = `<style>thead > tr > th {white-space: nowrap;}</style>`
38
+ } else if (this.gridType == 6) {
39
+ this.dataTableScript = '/modules/datatable/footer-total.js'
40
+ this.additionalCss = `<style>thead > tr > th {white-space: nowrap;}</style>`
41
+ } else if (this.gridType == 7) {
42
+ this.dataTableScript = '/modules/datatable/fixed-header-totalnowrap.js'
43
+ this.additionalCss = `<style>thead > tr > th {white-space: nowrap;}</style>`
44
+ } else {
45
+ this.dataTableScript = '/modules/datatable/normal.js'
46
+ this.additionalCss = `<style>thead > tr > th {white-space: nowrap;}</style>`
47
+ }
48
+ this.totalFields = []
49
+ this.additionalCss = ''
27
50
  }
28
51
 
29
52
  // for filter html
@@ -32,6 +55,7 @@ class dataTable {
32
55
  this.relations = obj.relations
33
56
  this.routeName = this.MYMODEL.routeName
34
57
  this.types = obj.TYPES
58
+ this.totalFields = this.visiblesKey.filter((item) => this.MYMODEL.widgets[item] && this.MYMODEL.widgets[item].name == 'number')
35
59
  delete obj.MYMODEL
36
60
  delete obj.relations
37
61
  delete obj.TYPES
@@ -164,6 +188,7 @@ class dataTable {
164
188
  script += `var dataTableFields = ${JSON.stringify(this.visiblesKey, null, 2)};${Util.newLine}`
165
189
  script += `var dataTableTypes = ${JSON.stringify(this.types, null, 2)};${Util.newLine}`
166
190
  script += `var dataTableRoute = "${this.routeName}";${Util.newLine}`
191
+ script += `var dataTableHasTotalFields = ${JSON.stringify(this.totalFields)};${Util.newLine}`
167
192
  script += `</script>${Util.newLine}`
168
193
  script += `<script type="text/javascript" src="${this.dataTableScript}"></script>${Util.newLine}`
169
194
  if (this.searchColumns.FILTERKEY) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"