zet-lib 1.2.115 → 1.2.117
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 +15 -15
- package/lib/zRoute.js +1 -1
- package/package.json +1 -1
package/lib/Form.js
CHANGED
|
@@ -110,7 +110,7 @@ Form.field = (obj) => {
|
|
|
110
110
|
selects = ''
|
|
111
111
|
switch (type) {
|
|
112
112
|
case 'text':
|
|
113
|
-
displayForm = `${prepend}${inputGroupLeft}<input autocomplete="off" ${disabled} ${readonly} autofocus="" ${tabindex} ${additional_attributes} type="${type}" ${
|
|
113
|
+
displayForm = `${prepend}${inputGroupLeft}<input autocomplete="off" ${disabled} ${readonly} autofocus="" ${tabindex} ${additional_attributes} type="${type}" class="form-control ${obj.class}" ${id} ${name} ${placeholder} ${style} ${required} value="${value}" data-t="${value}" ${htmlOptions}>${inputGroupRight}${information}${append}`
|
|
114
114
|
break
|
|
115
115
|
|
|
116
116
|
case 'checkbox':
|
|
@@ -138,15 +138,15 @@ Form.field = (obj) => {
|
|
|
138
138
|
case 'range':
|
|
139
139
|
let min = !obj.min ? 0 : obj.min
|
|
140
140
|
let max = !obj.max ? 100 : obj.max
|
|
141
|
-
displayForm = `${prepend}${inputGroupLeft}<input onmouseover="titlerange(this)" onchange="titlerange(this)" autocomplete="off" autofocus="" ${tabindex} type="${type}" class="form-range" step="1" ${id} ${name} ${placeholder} ${style} ${required} value="${value}" data-t="${value}" min="${min}" max="${max}" ${htmlOptions}>${inputGroupRight}${information}${append}`
|
|
141
|
+
displayForm = `${prepend}${inputGroupLeft}<input onmouseover="titlerange(this)" onchange="titlerange(this)" autocomplete="off" autofocus="" ${tabindex} type="${type}" class="form-range ${obj.class}" step="1" ${id} ${name} ${placeholder} ${style} ${required} value="${value}" data-t="${value}" min="${min}" max="${max}" ${htmlOptions}>${inputGroupRight}${information}${append}`
|
|
142
142
|
break
|
|
143
143
|
|
|
144
144
|
case 'hidden':
|
|
145
|
-
displayForm = `${prepend}<input autocomplete="off" autofocus="" ${tabindex} type="${type}" ${additional_attributes} ${style}
|
|
145
|
+
displayForm = `${prepend}<input autocomplete="off" autofocus="" ${tabindex} type="${type}" ${additional_attributes} ${style} class="form-control ${obj.class}" ${id} ${name} ${placeholder} ${required} value="${value}" data-t="${value}" ${htmlOptions}>${append}`
|
|
146
146
|
break
|
|
147
147
|
|
|
148
148
|
case 'textarea':
|
|
149
|
-
displayForm = `${prepend}${inputGroupLeft}<textarea ${tabindex} ${disabled} ${
|
|
149
|
+
displayForm = `${prepend}${inputGroupLeft}<textarea ${tabindex} ${disabled} class="form-control ${obj.class}" ${id} ${name} ${additional_attributes} ${placeholder} ${readonly} ${style} ${htmlOptions} rows="4">${value}</textarea>${inputGroupRight}${information}${append}`
|
|
150
150
|
break
|
|
151
151
|
|
|
152
152
|
case 'image':
|
|
@@ -172,7 +172,7 @@ Form.field = (obj) => {
|
|
|
172
172
|
break
|
|
173
173
|
|
|
174
174
|
case 'email':
|
|
175
|
-
displayForm = `${prepend}<input autocomplete="off" autofocus="" ${readonly} ${disabled} ${additional_attributes} ${tabindex} ${style} type="email" ${
|
|
175
|
+
displayForm = `${prepend}<input autocomplete="off" autofocus="" ${readonly} ${disabled} ${additional_attributes} ${tabindex} ${style} type="email" class="form-control ${obj.class}" ${id} ${name} ${placeholder} ${required} value="${value}" ${htmlOptions}>${information}${append}`
|
|
176
176
|
break
|
|
177
177
|
|
|
178
178
|
case 'number':
|
|
@@ -192,12 +192,12 @@ Form.field = (obj) => {
|
|
|
192
192
|
break
|
|
193
193
|
|
|
194
194
|
case 'password':
|
|
195
|
-
displayForm = `${prepend}${inputGroupLeft}<input autocomplete="off" autofocus="" ${disabled} ${readonly} ${additional_attributes} ${tabindex} ${style} type="password" ${
|
|
195
|
+
displayForm = `${prepend}${inputGroupLeft}<input autocomplete="off" autofocus="" ${disabled} ${readonly} ${additional_attributes} ${tabindex} ${style} type="password" class="form-control ${obj.class}" ${id} ${name} ${placeholder} ${required} value="${value}" ${htmlOptions}><span toggle="#password" class="bx bi-eye field-icon toggle-password"></span>${inputGroupRight}${information}${append}`
|
|
196
196
|
break
|
|
197
197
|
|
|
198
198
|
case 'switch':
|
|
199
199
|
checked = value == 1 ? ' checked ' : ''
|
|
200
|
-
displayForm = `${prepend}<p><input ${tabindex} type="checkbox" ${
|
|
200
|
+
displayForm = `${prepend}<p><input ${tabindex} type="checkbox" class="form-control ${obj.class}" ${readonly} ${style} ${id} ${additional_attributes} ${name} ${checked} ></p>${information}${append}`
|
|
201
201
|
break
|
|
202
202
|
|
|
203
203
|
case 'lexical':
|
|
@@ -206,7 +206,7 @@ Form.field = (obj) => {
|
|
|
206
206
|
|
|
207
207
|
case 'checkbox':
|
|
208
208
|
checked = value == 1 ? ' checked ' : ''
|
|
209
|
-
displayForm = `${prepend}<input ${tabindex} type="${type}" ${
|
|
209
|
+
displayForm = `${prepend}<input ${tabindex} type="${type}" class="form-control ${obj.class}" ${readonly} ${style} ${id} ${additional_attributes} ${name} ${checked} >${information}${append}`
|
|
210
210
|
break
|
|
211
211
|
|
|
212
212
|
case 'dropdown_checkbox':
|
|
@@ -284,7 +284,7 @@ Form.field = (obj) => {
|
|
|
284
284
|
//var selected = item.value == value ? ' selected ' : '';
|
|
285
285
|
const checked = item.value == value ? ' checked ' : ''
|
|
286
286
|
radios += `<div class="form-check">
|
|
287
|
-
<input class="form-check-input" type="radio" name="${obj.name}" ${additional_attributes} value="${item.value}" id="${obj.id}${index}" ${checked}>
|
|
287
|
+
<input class="form-check-input ${obj.class}" type="radio" name="${obj.name}" ${additional_attributes} value="${item.value}" id="${obj.id}${index}" ${checked}>
|
|
288
288
|
<label class="form-check-label" for="${obj.id}${index}">
|
|
289
289
|
${item.label}
|
|
290
290
|
</label>
|
|
@@ -359,7 +359,7 @@ Form.field = (obj) => {
|
|
|
359
359
|
case 'typeahead':
|
|
360
360
|
let typeahead_value = Util.replaceAll(obj.typeaheadvalue, '"', `'`)
|
|
361
361
|
displayForm = `${prepend}<div class="input-group">
|
|
362
|
-
<input ${tabindex} type="text" class="form-control" id="${obj.id}Typeahead" autocomplete="off" data-provide="typeahead" id="${obj.id}Typeahead" placeholder="Please type a word" value="${typeahead_value}" >
|
|
362
|
+
<input ${tabindex} type="text" class="form-control ${obj.class}" id="${obj.id}Typeahead" autocomplete="off" data-provide="typeahead" id="${obj.id}Typeahead" placeholder="Please type a word" value="${typeahead_value}" >
|
|
363
363
|
<input type="hidden" ${id} ${name} ${placeholder} ${classview} ${required} value="${value}">
|
|
364
364
|
<span id="${obj.id}Clear" class="input-group-addon input-group-text dropdownadd" title="Clear" style="cursor: pointer;" title=" Add Data "><img src="/assets/icons/ban.svg" class="icons-bg-black" ></span>
|
|
365
365
|
</div>${information}${append}`
|
|
@@ -421,15 +421,15 @@ Form.field = (obj) => {
|
|
|
421
421
|
break
|
|
422
422
|
|
|
423
423
|
case 'json':
|
|
424
|
-
displayForm += `<textarea ${additional_attributes} ${
|
|
424
|
+
displayForm += `<textarea ${additional_attributes} class="form-control ${obj.class}" ${id} ${name} ${placeholder} ${readonly} ${style} ${htmlOptions} rows="4">${JSON.stringify(obj.value)}</textarea>${information}${append}`
|
|
425
425
|
break
|
|
426
426
|
|
|
427
427
|
case 'json_array':
|
|
428
|
-
displayForm += `<textarea ${additional_attributes} ${
|
|
428
|
+
displayForm += `<textarea ${additional_attributes} class="form-control ${obj.class}" ${id} ${name} ${placeholder} ${readonly} ${style} ${htmlOptions} rows="4">${JSON.stringify(obj.value)}</textarea>${information}${append}`
|
|
429
429
|
break
|
|
430
430
|
|
|
431
431
|
case 'array':
|
|
432
|
-
displayForm += `<textarea ${additional_attributes} ${
|
|
432
|
+
displayForm += `<textarea ${additional_attributes} class="form-control ${obj.class}" ${id} ${name} ${placeholder} ${readonly} ${style} ${htmlOptions} rows="4">${JSON.stringify(obj.value)}</textarea>${information}${append}`
|
|
433
433
|
break
|
|
434
434
|
|
|
435
435
|
case 'virtual':
|
|
@@ -450,7 +450,7 @@ Form.field = (obj) => {
|
|
|
450
450
|
break
|
|
451
451
|
|
|
452
452
|
case 'location':
|
|
453
|
-
displayForm = `${prepend}<input type="text" class="form-control" id="search_map_location" placeholder="type a place" ${required} value="" ${htmlOptions}>${information}${append}
|
|
453
|
+
displayForm = `${prepend}<input type="text" class="form-control ${obj.class}" id="search_map_location" placeholder="type a place" ${required} value="" ${htmlOptions}>${information}${append}
|
|
454
454
|
<textarea ${id} ${name} style="display: none" ${readonly} rows="2">${JSON.stringify(obj.value)}</textarea>
|
|
455
455
|
<div id="map_${obj.id}" style="background-color:#C3C3C3;width: 100%;height: ${obj.height}px"></div>`
|
|
456
456
|
break
|
|
@@ -481,7 +481,7 @@ Form.field = (obj) => {
|
|
|
481
481
|
|
|
482
482
|
break
|
|
483
483
|
default:
|
|
484
|
-
displayForm = `${prepend}${inputGroupLeft}<input ${disabled} autocomplete="nope" autofocus="" ${readonly} ${tabindex} type="${type}" ${
|
|
484
|
+
displayForm = `${prepend}${inputGroupLeft}<input ${disabled} autocomplete="nope" autofocus="" ${readonly} ${tabindex} type="${type}" class="form-control ${obj.class}" ${id} ${name} ${placeholder} ${required} value="${value}" data-t="${value}" ${htmlOptions}>${inputGroupRight}${information}${append}`
|
|
485
485
|
break
|
|
486
486
|
}
|
|
487
487
|
|
package/lib/zRoute.js
CHANGED
|
@@ -4590,7 +4590,7 @@ zRoute.tableBody = (req, res, relations, dataObject, parentTable, fieldName, MYM
|
|
|
4590
4590
|
let myobj = obj[key]
|
|
4591
4591
|
myobj.value = data[key]
|
|
4592
4592
|
myobj.class = `${parentTable}_${fieldName}_${key}`
|
|
4593
|
-
myobj.name =
|
|
4593
|
+
myobj.name = `${parentTable}[${fieldName}][${index}][${key}]`
|
|
4594
4594
|
myobj.additional_attributes = ` data-name="${key}" data-id="${parentTable}_${fieldName}_${key}" `
|
|
4595
4595
|
html += `<td class="td_${key}_${MYMODEL.table}">${cForm.field(myobj)}</td>`
|
|
4596
4596
|
}
|