Commit bada37ea authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

update Components.js

parent 69a09663
...@@ -4,7 +4,7 @@ const createInputTextArea = (label, placeholder = '') => { ...@@ -4,7 +4,7 @@ const createInputTextArea = (label, placeholder = '') => {
const fc = $('<div>', {class: 'uk-form-controls'}); const fc = $('<div>', {class: 'uk-form-controls'});
const textarea = $(`<textarea id="${id}" class="uk-textarea" rows="2" placeholder="${placeholder}"></textarea>`); const textarea = $(`<textarea id="${id}" class="uk-textarea" rows="2" placeholder="${placeholder}"></textarea>`);
fc.append(textarea); fc.append(textarea);
container.append(`<label class="uk-form-label uk-text-bold" for="${id}">${label}</label>`).append(fc); container.append(`<label class="uk-form-label" for="${id}">${label}</label>`, fc);
return {container, textarea}; return {container, textarea};
} }
...@@ -14,7 +14,7 @@ const createInputText = (label, placeholder = '') => { ...@@ -14,7 +14,7 @@ const createInputText = (label, placeholder = '') => {
const fc = $('<div>', {class: 'uk-form-controls'}); const fc = $('<div>', {class: 'uk-form-controls'});
const input = $(`<input type="text" id="${id}" class="uk-input" placeholder="${placeholder}">`); const input = $(`<input type="text" id="${id}" class="uk-input" placeholder="${placeholder}">`);
fc.append(input); fc.append(input);
container.append(`<label class="uk-form-label uk-text-bold" for="${id}">${label}</label>`).append(fc); container.append(`<label class="uk-form-label" for="${id}">${label}</label>`, fc);
return {container, input}; return {container, input};
} }
...@@ -48,7 +48,7 @@ const createInputPassword = (label = '') => { ...@@ -48,7 +48,7 @@ const createInputPassword = (label = '') => {
icon.text('visibility'); icon.text('visibility');
inline.append(icon, input); inline.append(icon, input);
fc.append(inline); fc.append(inline);
container.append(`<label class="uk-form-label uk-text-bold" for="${id}">${label}</label>`, fc); container.append(`<label class="uk-form-label" for="${id}">${label}</label>`, fc);
return {container, input}; return {container, input};
} }
...@@ -58,7 +58,7 @@ const createInputNumber = (label, placeholder = '') => { ...@@ -58,7 +58,7 @@ const createInputNumber = (label, placeholder = '') => {
const fc = $('<div>', {class: 'uk-form-controls'}); const fc = $('<div>', {class: 'uk-form-controls'});
const input = $(`<input type="number" id="${id}" class="uk-input" placeholder="${placeholder}">`); const input = $(`<input type="number" id="${id}" class="uk-input" placeholder="${placeholder}">`);
fc.append(input); fc.append(input);
container.append(`<label class="uk-form-label uk-text-bold" for="${id}">${label}</label>`).append(fc); container.append(`<label class="uk-form-label" for="${id}">${label}</label>`).append(fc);
return {container, input}; return {container, input};
} }
...@@ -82,7 +82,7 @@ const createDatePeriod = (label, start_date, finish_date) => { ...@@ -82,7 +82,7 @@ const createDatePeriod = (label, start_date, finish_date) => {
const dateStart = getInputDateTime(start_date[0], start_date[1]); const dateStart = getInputDateTime(start_date[0], start_date[1]);
const dateFinish = getInputDateTime(finish_date[0], finish_date[1]); const dateFinish = getInputDateTime(finish_date[0], finish_date[1]);
fc.append(dateStart).append('<label style="margin: 0 10px;">-</label>').append(dateFinish); fc.append(dateStart).append('<label style="margin: 0 10px;">-</label>').append(dateFinish);
container.append(`<label class="uk-form-label uk-text-bold">${label}</label>`).append(fc); container.append(`<label class="uk-form-label">${label}</label>`, fc);
return {container, dateStart, dateFinish}; return {container, dateStart, dateFinish};
} }
...@@ -91,7 +91,7 @@ const createDateInput = (label, date) => { ...@@ -91,7 +91,7 @@ const createDateInput = (label, date) => {
const fc = $('<div>', {class: 'uk-form-controls'}); const fc = $('<div>', {class: 'uk-form-controls'});
const dateInput = getInputDate(date); const dateInput = getInputDate(date);
fc.append(dateInput); fc.append(dateInput);
container.append(`<label class="uk-form-label uk-text-bold">${label}</label>`).append(fc); container.append(`<label class="uk-form-label">${label}</label>`, fc);
return {container, dateInput}; return {container, dateInput};
} }
...@@ -101,7 +101,7 @@ const createDateTimeInput = (label, date) => { ...@@ -101,7 +101,7 @@ const createDateTimeInput = (label, date) => {
const fc = $('<div>', {class: 'uk-form-controls'}); const fc = $('<div>', {class: 'uk-form-controls'});
const dateTimeInput = getInputDateTime(date[0], date[1]); const dateTimeInput = getInputDateTime(date[0], date[1]);
fc.append(dateTimeInput); fc.append(dateTimeInput);
container.append(`<label class="uk-form-label uk-text-bold">${label}</label>`).append(fc); container.append(`<label class="uk-form-label">${label}</label>`, fc);
return {container, dateTimeInput}; return {container, dateTimeInput};
} }
...@@ -115,7 +115,7 @@ const createSelectComponent = (label, items, multiple = false) => { ...@@ -115,7 +115,7 @@ const createSelectComponent = (label, items, multiple = false) => {
.forEach(item => select.append(`<option value="${item.value}" title="${item.label}">${item.label}</option>`)); .forEach(item => select.append(`<option value="${item.value}" title="${item.label}">${item.label}</option>`));
fc.append(select); fc.append(select);
container.append(`<label class="uk-form-label uk-text-bold">${label}</label>`).append(fc); container.append(`<label class="uk-form-label">${label}</label>`, fc);
return {container, select}; return {container, select};
} }
...@@ -151,7 +151,7 @@ const createUserParamBlock = (label, type, workData, multiSelectable = false, fi ...@@ -151,7 +151,7 @@ const createUserParamBlock = (label, type, workData, multiSelectable = false, fi
}); });
}); });
return $('<div>', {class: 'uk-margin-small'}).append(`<label class="uk-form-label uk-text-bold">${label}</label>`).append(fc); return $('<div>', {class: 'uk-margin-small'}).append(`<label class="uk-form-label">${label}</label>`, fc);
} }
const createSelectFile = label => { const createSelectFile = label => {
...@@ -161,7 +161,7 @@ const createSelectFile = label => { ...@@ -161,7 +161,7 @@ const createSelectFile = label => {
const inputFile = $('<input type="file">'); const inputFile = $('<input type="file">');
fc.append(icon).append(inputFile).append(`<input class="uk-input uk-form-width-medium" type="text" style="font-size: 14px; color: #333; background: #fff; min-width: 245px; width: 100%;" disabled>`); fc.append(icon).append(inputFile).append(`<input class="uk-input uk-form-width-medium" type="text" style="font-size: 14px; color: #333; background: #fff; min-width: 245px; width: 100%;" disabled>`);
container.append(`<label class="uk-form-label uk-text-bold">${label}</label>`).append(fc); container.append(`<label class="uk-form-label">${label}</label>`, fc);
return {container, inputFile}; return {container, inputFile};
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment