zet-lib 1.0.69 → 1.0.71

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/moduleLib.js CHANGED
@@ -266,17 +266,8 @@ m.typeahead = (req, res, elem, data) => {
266
266
  elemData = elemData.replace('#', '')
267
267
  let element = elem.replace('Typeahead', '')
268
268
 
269
- script +=
270
- 'const ' +
271
- elemData +
272
- 'Data = ' +
273
- JSON.stringify(
274
- data.filter(function (value, index, arr) {
275
- return index > 0
276
- })
277
- ) +
278
- ';' +
279
- newLine
269
+ // var script using existing cache
270
+ script += `var ${elemData}Data = [];${Util.newLine}`
280
271
  script += `$("body").on("change", "${elem}", function(){
281
272
  var current = $("${elem}").typeahead("getActive");
282
273
  if(current){
package/lib/zRoute.js CHANGED
@@ -2568,6 +2568,10 @@ zRoute.moduleLib = (req, res, MYMODEL, relations, zForms = '', data = {}) => {
2568
2568
  scriptTemp += `<script>var ${key}Object = ${JSON.stringify(relObject)};</script>${Util.newLine}`
2569
2569
  }
2570
2570
  }
2571
+ } else if (MYMODEL.widgets[keys].name == 'typeahead') {
2572
+ //employee_payroll_salary___employee_id_1
2573
+ let name = `${MYMODEL.widgets[keys].table}_${MYMODEL.table}___${keys}_${res.locals.companyId}`
2574
+ scriptTemp += `<script>${keys}TypeaheadData = ${JSON.stringify(myCache.get(name))}</script>`
2571
2575
  }
2572
2576
  }
2573
2577
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.0.69",
3
+ "version": "1.0.71",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"