2019-12-20 21:46:36 +08:00
|
|
|
/*
|
2019-12-23 21:40:15 +08:00
|
|
|
global ListColumnHelper ChecklistColumnHelper StatusColumnHelper SmartAnnotation I18n
|
2020-02-06 21:43:17 +08:00
|
|
|
AssetColumnHelper DateTimeHelper
|
2019-12-20 21:46:36 +08:00
|
|
|
*/
|
2019-12-05 16:19:19 +08:00
|
|
|
|
|
|
|
$.fn.dataTable.render.newRowName = function(formId, $cell) {
|
|
|
|
$cell.html(`
|
2020-01-23 20:12:58 +08:00
|
|
|
<div class="sci-input-container text-field error-icon">
|
2020-01-15 23:46:01 +08:00
|
|
|
<input class="sci-input-field"
|
2019-12-05 16:19:19 +08:00
|
|
|
form="${formId}"
|
|
|
|
type="text"
|
2019-12-10 15:41:09 +08:00
|
|
|
name="repository_row[name]"
|
2019-12-05 16:19:19 +08:00
|
|
|
value=""
|
2020-01-09 21:57:37 +08:00
|
|
|
placeholder="${I18n.t('repositories.table.enter_row_name')}"
|
2019-12-05 16:19:19 +08:00
|
|
|
data-type="RowName">
|
|
|
|
</div>
|
|
|
|
`);
|
2019-11-18 21:04:53 +08:00
|
|
|
};
|
|
|
|
|
2019-12-05 16:19:19 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryAssetValue = function(formId, columnId, $cell) {
|
2020-02-06 21:43:17 +08:00
|
|
|
AssetColumnHelper.renderCell($cell, formId, columnId);
|
2019-11-18 21:04:53 +08:00
|
|
|
};
|
|
|
|
|
2019-12-05 16:19:19 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryTextValue = function(formId, columnId, $cell) {
|
|
|
|
$cell.html(`
|
2020-01-23 20:12:58 +08:00
|
|
|
<div class="sci-input-container text-field error-icon">
|
2020-01-15 23:46:01 +08:00
|
|
|
<input class="sci-input-field"
|
2019-12-05 16:19:19 +08:00
|
|
|
form="${formId}"
|
|
|
|
type="text"
|
|
|
|
name="repository_cells[${columnId}]"
|
|
|
|
value=""
|
2020-01-09 21:57:37 +08:00
|
|
|
placeholder="${I18n.t('repositories.table.text.enter_text')}"
|
2019-12-05 16:19:19 +08:00
|
|
|
data-type="RepositoryTextValue">
|
|
|
|
</div>`);
|
|
|
|
|
|
|
|
SmartAnnotation.init($cell.find('input'));
|
2019-11-18 21:04:53 +08:00
|
|
|
};
|
|
|
|
|
2019-12-05 16:19:19 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryListValue = function(formId, columnId, $cell) {
|
2019-12-11 21:49:14 +08:00
|
|
|
ListColumnHelper.initialListEditMode(formId, columnId, $cell);
|
2019-11-18 21:04:53 +08:00
|
|
|
};
|
|
|
|
|
2019-12-05 16:19:19 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryStatusValue = function(formId, columnId, $cell) {
|
2019-12-23 21:40:15 +08:00
|
|
|
StatusColumnHelper.initialStatusEditMode(formId, columnId, $cell);
|
2019-11-18 21:04:53 +08:00
|
|
|
};
|
2019-12-06 20:18:35 +08:00
|
|
|
|
2019-12-10 22:48:53 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryChecklistValue = function(formId, columnId, $cell) {
|
2019-12-11 21:49:14 +08:00
|
|
|
ChecklistColumnHelper.initialChecklistEditMode(formId, columnId, $cell);
|
2019-12-06 20:18:35 +08:00
|
|
|
};
|
2019-12-18 18:55:12 +08:00
|
|
|
|
2020-01-17 23:04:19 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryNumberValue = function(formId, columnId, $cell, $header) {
|
|
|
|
let decimals = $header.data('metadata-decimals');
|
|
|
|
|
2019-12-18 18:55:12 +08:00
|
|
|
$cell.html(`
|
2020-01-23 20:12:58 +08:00
|
|
|
<div class="sci-input-container text-field error-icon">
|
2020-01-15 23:46:01 +08:00
|
|
|
<input class="sci-input-field"
|
2019-12-18 18:55:12 +08:00
|
|
|
form="${formId}"
|
2020-01-17 23:04:19 +08:00
|
|
|
type="text"
|
|
|
|
oninput="this.value = this.value.replace(/[^0-9.]/g, '');
|
|
|
|
this.value = this.value.match(/^\\d*(\\.\\d{0,${decimals}})?/)[0];"
|
2019-12-18 18:55:12 +08:00
|
|
|
name="repository_cells[${columnId}]"
|
|
|
|
value=""
|
2020-01-09 21:57:37 +08:00
|
|
|
placeholder="${I18n.t('repositories.table.number.enter_number')}"
|
2019-12-18 18:55:12 +08:00
|
|
|
data-type="RepositoryNumberValue">
|
|
|
|
</div>`);
|
|
|
|
};
|
2019-12-16 22:21:50 +08:00
|
|
|
|
|
|
|
$.fn.dataTable.render.newRepositoryDateTimeValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeEditMode(formId, columnId, $cell, '', 'RepositoryDateTimeValue');
|
2019-12-16 22:21:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
$.fn.dataTable.render.newRepositoryTimeValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeEditMode(formId, columnId, $cell, 'timeonly', 'RepositoryTimeValue');
|
2019-12-16 22:21:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
$.fn.dataTable.render.newRepositoryDateValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeEditMode(formId, columnId, $cell, 'dateonly', 'RepositoryDateValue');
|
2019-12-16 22:21:50 +08:00
|
|
|
};
|
|
|
|
|
2019-12-17 18:27:07 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryDateTimeRangeValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeRangeEditMode(formId, columnId, $cell, '', 'RepositoryDateTimeRangeValue');
|
2019-12-17 18:27:07 +08:00
|
|
|
};
|
|
|
|
|
2019-12-17 20:42:25 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryDateRangeValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeRangeEditMode(formId, columnId, $cell, 'dateonly', 'RepositoryDateRangeValue');
|
2019-12-17 20:42:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
$.fn.dataTable.render.newRepositoryTimeRangeValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeRangeEditMode(formId, columnId, $cell, 'timeonly', 'RepositoryTimeRangeValue');
|
2019-12-17 20:42:25 +08:00
|
|
|
};
|
2022-01-19 20:19:56 +08:00
|
|
|
|
|
|
|
$.fn.dataTable.render.newRepositoryStockValue = function() {
|
|
|
|
return '';
|
|
|
|
};
|