Add prettier

This commit is contained in:
RainLoop Team 2019-07-04 22:09:27 +03:00
parent 08da3030b0
commit 450528ff00
61 changed files with 516 additions and 1456 deletions

View file

@ -1,32 +1,26 @@
import ko from 'ko';
import {isUnd} from 'Common/Utils';
import {AbstractComponent} from 'Component/Abstract';
import { isUnd } from 'Common/Utils';
import { AbstractComponent } from 'Component/Abstract';
class AbstracCheckbox extends AbstractComponent
{
class AbstractCheckbox extends AbstractComponent {
/**
* @param {Object} params = {}
*/
constructor(params = {}) {
super();
this.value = params.value;
if (isUnd(this.value) || !this.value.subscribe)
{
if (isUnd(this.value) || !this.value.subscribe) {
this.value = ko.observable(isUnd(this.value) ? false : !!this.value);
}
this.enable = params.enable;
if (isUnd(this.enable) || !this.enable.subscribe)
{
if (isUnd(this.enable) || !this.enable.subscribe) {
this.enable = ko.observable(isUnd(this.enable) ? true : !!this.enable);
}
this.disable = params.disable;
if (isUnd(this.disable) || !this.disable.subscribe)
{
if (isUnd(this.disable) || !this.disable.subscribe) {
this.disable = ko.observable(isUnd(this.disable) ? false : !!this.disable);
}
@ -41,11 +35,10 @@ class AbstracCheckbox extends AbstractComponent
}
click() {
if (!this.readOnly && this.enable() && !this.disable())
{
if (!this.readOnly && this.enable() && !this.disable()) {
this.value(!this.value());
}
}
}
export {AbstracCheckbox, AbstracCheckbox as default};
export { AbstractCheckbox, AbstractCheckbox as default };

View file

@ -1,43 +1,37 @@
import _ from '_';
import ko from 'ko';
import {isUnd} from 'Common/Utils';
import {AbstractComponent} from 'Component/Abstract';
import { isUnd } from 'Common/Utils';
import { AbstractComponent } from 'Component/Abstract';
class AbstracRadio extends AbstractComponent
{
class AbstractRadio extends AbstractComponent {
/**
* @param {Object} params
*/
constructor(params) {
super();
this.values = ko.observableArray([]);
this.value = params.value;
if (isUnd(this.value) || !this.value.subscribe)
{
if (isUnd(this.value) || !this.value.subscribe) {
this.value = ko.observable('');
}
this.inline = isUnd(params.inline) ? false : params.inline;
this.readOnly = isUnd(params.readOnly) ? false : !!params.readOnly;
if (params.values)
{
this.values(_.map(params.values, (label, value) => ({label: label, value: value})));
if (params.values) {
this.values(_.map(params.values, (label, value) => ({ label: label, value: value })));
}
this.click = _.bind(this.click, this);
}
click(value) {
if (!this.readOnly && value)
{
if (!this.readOnly && value) {
this.value(value.value);
}
}
}
export {AbstracRadio, AbstracRadio as default};
export { AbstractRadio, AbstractRadio as default };

View file

@ -1,7 +1,7 @@
import {componentExportHelper} from 'Component/Abstract';
import {AbstracCheckbox} from 'Component/AbstracCheckbox';
import {AbstractCheckbox} from 'Component/AbstractCheckbox';
class CheckboxComponent extends AbstracCheckbox {}
class CheckboxComponent extends AbstractCheckbox {}
export default componentExportHelper(CheckboxComponent, 'CheckboxComponent');

View file

@ -1,7 +1,7 @@
import {componentExportHelper} from 'Component/Abstract';
import {AbstracCheckbox} from 'Component/AbstracCheckbox';
import {AbstractCheckbox} from 'Component/AbstractCheckbox';
class ClassicCheckboxComponent extends AbstracCheckbox {}
class ClassicCheckboxComponent extends AbstractCheckbox {}
export default componentExportHelper(ClassicCheckboxComponent, 'ClassicCheckboxComponent');

View file

@ -2,9 +2,9 @@
import _ from '_';
import ko from 'ko';
import {componentExportHelper} from 'Component/Abstract';
import {AbstracCheckbox} from 'Component/AbstracCheckbox';
import {AbstractCheckbox} from 'Component/AbstractCheckbox';
class CheckboxMaterialDesignComponent extends AbstracCheckbox
class CheckboxMaterialDesignComponent extends AbstractCheckbox
{
/**
* @param {Object} params

View file

@ -1,7 +1,7 @@
import {componentExportHelper} from 'Component/Abstract';
import {AbstracRadio} from 'Component/AbstracRadio';
import {AbstractRadio} from 'Component/AbstractRadio';
class RadioComponent extends AbstracRadio {}
class RadioComponent extends AbstractRadio {}
export default componentExportHelper(RadioComponent, 'RadioComponent');

View file

@ -118,9 +118,9 @@
}
}
.e-contact-foreach {
border-bottom: 1px solid #ddd;
}
// .e-contact-foreach {
// border-bottom: 1px solid #ddd;
// }
.e-contact-item {
position: relative;
@ -133,6 +133,7 @@
margin: 0px;
border: 0px solid transparent;
z-index: 100;
border-bottom: 1px solid #ddd;
.delimiter {
position: relative;
@ -413,7 +414,7 @@
margin: 0px;
border: 0px solid transparent;
z-index: 100;
border-bottom: 1px solid #ddd;
}
}

View file

@ -93,9 +93,9 @@ class ContactsPopupView extends AbstractViewNext
(property) => -1 < inArray(property.type(), [ContactPropertyType.FirstName, ContactPropertyType.LastName])
);
this.viewPropertiesOther = this.viewProperties.filter(
(property) => -1 < inArray(property.type(), [ContactPropertyType.Note])
);
// this.viewPropertiesOther = this.viewProperties.filter(
// (property) => -1 < inArray(property.type(), [ContactPropertyType.Note])
// );
this.viewPropertiesOther = ko.computed(() => {
const list = _.filter(this.viewProperties(),

View file

@ -3,13 +3,3 @@ import 'core-js/features/array/includes';
import 'core-js/features/string/includes';
import 'core-js/features/promise';
import 'raf/polyfill';
/* eslint-disable no-undefined, consistent-return */
const log = console && console.log ? console.log : undefined;
console.log = log ? (...props) => {
if (props && props[0] && 0 === props[0].indexOf('JQMIGRATE:')) {
return;
}
return log(...props);
} : undefined;