Permalink
Browse files

fix(styling): fix styling

  • Loading branch information...
VMBindraban
VMBindraban committed Aug 8, 2016
1 parent cd455c2 commit 9210ef358d17da108b73ed7c2ed55fb7d502d383
@@ -1,8 +1,8 @@

<template>
<div repeat.for="filter of filters" class="filters row">
<div repeat.for="filter of filters" class="filters">
<div repeat.for="field of filter">
<div class="row col-md-12">
<div class="col-md-12">
<div class="col-md-4">
<form-field
change.delegate="onChange($parent.$index, $index) & debounce:200"
@@ -45,8 +45,16 @@
</div>
</div>

<div if.bind="field.data.operator === 'between'" class="row col-md-12">
<div class="col-md-offset-8 col-md-4" style="margin-bottom: 15px;">
<div if.bind="field.data.operator === 'between'" class="col-md-12">
<div class="col-md-4">
<input type="text" class="form-control disabled" disabled>
</div>

<div class="col-md-4">
<input type="text" class="form-control disabled" disabled value="and" t="[value]and">
</div>

<div class="col-md-4" style="margin-bottom: 15px;">
<form-field
keypress.delegate="onChange($parent.$index, $index, true) & debounce:500"
value.bind="field.data.between"
@@ -56,17 +64,17 @@
</div>
</div>

<div class="row col-md-12">
<div class="col-md-12">
<div class="col-md-offset-4 col-md-4">
<div class="btn-group btn-group btn-group-justified">
<a
class="btn btn-primary add-block"
class="btn btn-primary add-block btn-sm"
if.bind="$last"
click.delegate="create()"
t="+ Or">+
</a>
<a
class="btn btn-danger remove-block"
class="btn btn-danger remove-block btn-sm"
if.bind="filters.length > 1"
click.delegate="destroy($index)"
t="- Or">-;
@@ -75,8 +83,10 @@
</div>
</div>

<div class="row col-md-12" if.bind="!$last">
<div class="col-md-12" if.bind="!$last">
<hr>
</div>

<div class="clearfix"></div>
</div>
</template>
@@ -26,6 +26,8 @@ define(['exports', 'extend'], function (exports, _extend) {

var blocks = [];

this.populate = [];

this.filters.forEach(function (block, index) {
var filtersParsed = {};

@@ -43,7 +45,9 @@ define(['exports', 'extend'], function (exports, _extend) {
var criteriaWhere = blocks.length > 1 ? { where: { or: blocks } } : { where: blocks[0] };
var currentSort = this.criteria.sort || {};

this.criteria = Object.assign(criteriaWhere, { sort: currentSort });
this.criteria = Object.assign(criteriaWhere, { sort: currentSort, populate: this.populate.join(',') });

console.log(this.criteria);
};

CriteriaBuilder.prototype.parseOperator = function parseOperator(filter) {
@@ -81,17 +85,21 @@ define(['exports', 'extend'], function (exports, _extend) {
};

CriteriaBuilder.prototype.parseField = function parseField(fieldName, data) {
var _ref4;
var _fieldName$, _ref4;

fieldName = fieldName.split('.');

if (fieldName.length > 1) {
var _fieldName$, _ref3;
if (fieldName.length === 1) {
var _ref3;

return _ref3 = {}, _ref3[fieldName[0]] = data, _ref3;
}

return _ref3 = {}, _ref3[fieldName[0]] = (_fieldName$ = {}, _fieldName$[fieldName[1]] = data, _fieldName$), _ref3;
if (this.populate.indexOf(fieldName[0]) < 0) {
this.populate.push(fieldName[0]);
}

return _ref4 = {}, _ref4[fieldName[0]] = data, _ref4;
return _ref4 = {}, _ref4[fieldName[0]] = (_fieldName$ = {}, _fieldName$[fieldName[1]] = data, _fieldName$), _ref4;
};

CriteriaBuilder.prototype.toArray = function toArray(value) {
@@ -75,7 +75,7 @@ define(['exports', 'aurelia-framework', 'aurelia-view-manager', './criteriaBuild
throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
}

var _dec, _dec2, _dec3, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3;
var _dec, _dec2, _dec3, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;

var Filter = exports.Filter = (_dec = (0, _aureliaFramework.customElement)('filter'), _dec2 = (0, _aureliaViewManager.resolvedView)('spoonx/filter', 'filter'), _dec3 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec(_class = _dec2(_class = (_class2 = function (_CriteriaBuilder) {
_inherits(Filter, _CriteriaBuilder);
@@ -91,6 +91,8 @@ define(['exports', 'aurelia-framework', 'aurelia-view-manager', './criteriaBuild

_initDefineProp(_this, 'entity', _descriptor3, _this);

_initDefineProp(_this, 'excludeColumns', _descriptor4, _this);

_this.filters = [];
_this.fieldElement = {
key: 'field',
@@ -276,9 +278,15 @@ define(['exports', 'aurelia-framework', 'aurelia-view-manager', './criteriaBuild
};

Filter.prototype.generateFields = function generateFields(columns, entityName) {
var excludeColumns = this.excludeColumns ? this.excludeColumns.replace(/\s/g, '').split(',') : [];

for (var column in columns) {
var columnName = entityName ? entityName + '.' + column : column;

if (excludeColumns.indexOf(columnName) > -1) {
continue;
}

this.columns.push({
name: columnName,
value: columnName,
@@ -303,5 +311,8 @@ define(['exports', 'aurelia-framework', 'aurelia-view-manager', './criteriaBuild
initializer: function initializer() {
return null;
}
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'excludeColumns', [_aureliaFramework.bindable], {
enumerable: true,
initializer: null
})), _class2)) || _class) || _class);
});
@@ -14,6 +14,7 @@ export declare class Filter extends CriteriaBuilder {
criteria: any;
columns: any;
entity: any;
excludeColumns: any;
filters: any;
fieldElement: any;
operatorElement: any;
@@ -1,8 +1,8 @@

<template>
<div repeat.for="filter of filters" class="filters row">
<div repeat.for="filter of filters" class="filters">
<div repeat.for="field of filter">
<div class="row col-md-12">
<div class="col-md-12">
<div class="col-md-4">
<form-field
change.delegate="onChange($parent.$index, $index) & debounce:200"
@@ -45,8 +45,16 @@
</div>
</div>

<div if.bind="field.data.operator === 'between'" class="row col-md-12">
<div class="col-md-offset-8 col-md-4" style="margin-bottom: 15px;">
<div if.bind="field.data.operator === 'between'" class="col-md-12">
<div class="col-md-4">
<input type="text" class="form-control disabled" disabled>
</div>

<div class="col-md-4">
<input type="text" class="form-control disabled" disabled value="and" t="[value]and">
</div>

<div class="col-md-4" style="margin-bottom: 15px;">
<form-field
keypress.delegate="onChange($parent.$index, $index, true) & debounce:500"
value.bind="field.data.between"
@@ -56,17 +64,17 @@
</div>
</div>

<div class="row col-md-12">
<div class="col-md-12">
<div class="col-md-offset-4 col-md-4">
<div class="btn-group btn-group btn-group-justified">
<a
class="btn btn-primary add-block"
class="btn btn-primary add-block btn-sm"
if.bind="$last"
click.delegate="create()"
t="+ Or">+
</a>
<a
class="btn btn-danger remove-block"
class="btn btn-danger remove-block btn-sm"
if.bind="filters.length > 1"
click.delegate="destroy($index)"
t="- Or">-;
@@ -75,8 +83,10 @@
</div>
</div>

<div class="row col-md-12" if.bind="!$last">
<div class="col-md-12" if.bind="!$last">
<hr>
</div>

<div class="clearfix"></div>
</div>
</template>
@@ -1,8 +1,8 @@

<template>
<div repeat.for="filter of filters" class="filters row">
<div repeat.for="filter of filters" class="filters">
<div repeat.for="field of filter">
<div class="row col-md-12">
<div class="col-md-12">
<div class="col-md-4">
<form-field
change.delegate="onChange($parent.$index, $index) & debounce:200"
@@ -45,8 +45,16 @@
</div>
</div>

<div if.bind="field.data.operator === 'between'" class="row col-md-12">
<div class="col-md-offset-8 col-md-4" style="margin-bottom: 15px;">
<div if.bind="field.data.operator === 'between'" class="col-md-12">
<div class="col-md-4">
<input type="text" class="form-control disabled" disabled>
</div>

<div class="col-md-4">
<input type="text" class="form-control disabled" disabled value="and" t="[value]and">
</div>

<div class="col-md-4" style="margin-bottom: 15px;">
<form-field
keypress.delegate="onChange($parent.$index, $index, true) & debounce:500"
value.bind="field.data.between"
@@ -56,17 +64,17 @@
</div>
</div>

<div class="row col-md-12">
<div class="col-md-12">
<div class="col-md-offset-4 col-md-4">
<div class="btn-group btn-group btn-group-justified">
<a
class="btn btn-primary add-block"
class="btn btn-primary add-block btn-sm"
if.bind="$last"
click.delegate="create()"
t="+ Or">+
</a>
<a
class="btn btn-danger remove-block"
class="btn btn-danger remove-block btn-sm"
if.bind="filters.length > 1"
click.delegate="destroy($index)"
t="- Or">-;
@@ -75,8 +83,10 @@
</div>
</div>

<div class="row col-md-12" if.bind="!$last">
<div class="col-md-12" if.bind="!$last">
<hr>
</div>

<div class="clearfix"></div>
</div>
</template>
@@ -23,6 +23,8 @@ var CriteriaBuilder = exports.CriteriaBuilder = function () {

var blocks = [];

this.populate = [];

this.filters.forEach(function (block, index) {
var filtersParsed = {};

@@ -40,7 +42,9 @@ var CriteriaBuilder = exports.CriteriaBuilder = function () {
var criteriaWhere = blocks.length > 1 ? { where: { or: blocks } } : { where: blocks[0] };
var currentSort = this.criteria.sort || {};

this.criteria = Object.assign(criteriaWhere, { sort: currentSort });
this.criteria = Object.assign(criteriaWhere, { sort: currentSort, populate: this.populate.join(',') });

console.log(this.criteria);
};

CriteriaBuilder.prototype.parseOperator = function parseOperator(filter) {
@@ -78,17 +82,21 @@ var CriteriaBuilder = exports.CriteriaBuilder = function () {
};

CriteriaBuilder.prototype.parseField = function parseField(fieldName, data) {
var _ref4;
var _fieldName$, _ref4;

fieldName = fieldName.split('.');

if (fieldName.length > 1) {
var _fieldName$, _ref3;
if (fieldName.length === 1) {
var _ref3;

return _ref3 = {}, _ref3[fieldName[0]] = data, _ref3;
}

return _ref3 = {}, _ref3[fieldName[0]] = (_fieldName$ = {}, _fieldName$[fieldName[1]] = data, _fieldName$), _ref3;
if (this.populate.indexOf(fieldName[0]) < 0) {
this.populate.push(fieldName[0]);
}

return _ref4 = {}, _ref4[fieldName[0]] = data, _ref4;
return _ref4 = {}, _ref4[fieldName[0]] = (_fieldName$ = {}, _fieldName$[fieldName[1]] = data, _fieldName$), _ref4;
};

CriteriaBuilder.prototype.toArray = function toArray(value) {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
});
exports.Filter = undefined;

var _dec, _dec2, _dec3, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3;
var _dec, _dec2, _dec3, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;

var _aureliaFramework = require('aurelia-framework');

@@ -76,6 +76,8 @@ var Filter = exports.Filter = (_dec = (0, _aureliaFramework.customElement)('filt

_initDefineProp(_this, 'entity', _descriptor3, _this);

_initDefineProp(_this, 'excludeColumns', _descriptor4, _this);

_this.filters = [];
_this.fieldElement = {
key: 'field',
@@ -261,9 +263,15 @@ var Filter = exports.Filter = (_dec = (0, _aureliaFramework.customElement)('filt
};

Filter.prototype.generateFields = function generateFields(columns, entityName) {
var excludeColumns = this.excludeColumns ? this.excludeColumns.replace(/\s/g, '').split(',') : [];

for (var column in columns) {
var columnName = entityName ? entityName + '.' + column : column;

if (excludeColumns.indexOf(columnName) > -1) {
continue;
}

this.columns.push({
name: columnName,
value: columnName,
@@ -288,4 +296,7 @@ var Filter = exports.Filter = (_dec = (0, _aureliaFramework.customElement)('filt
initializer: function initializer() {
return null;
}
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'excludeColumns', [_aureliaFramework.bindable], {
enumerable: true,
initializer: null
})), _class2)) || _class) || _class);
Oops, something went wrong.

0 comments on commit 9210ef3

Please sign in to comment.