+
-
-
+ rule="{{::$ctrl.rule}}"/>
+
+
+ query_builder
+ clear
+
+
\ No newline at end of file
diff --git a/client/core/src/datePicker/datePicker.js b/client/core/src/datePicker/datePicker.js
index 43f34d9df..2ebed10d6 100644
--- a/client/core/src/datePicker/datePicker.js
+++ b/client/core/src/datePicker/datePicker.js
@@ -27,7 +27,9 @@ class DatePicker extends Component {
this.enabled = true;
this._modelView = null;
this._model = undefined;
-
+ this._optionsChecked = false;
+ this.hasFocus = false;
+ this.hasMouseIn = false;
componentHandler.upgradeElement($element[0].firstChild);
}
@@ -37,7 +39,8 @@ class DatePicker extends Component {
set model(value) {
this._model = value;
if (value && !this.modelView) {
- let initialDateFormat = (this.iniOptions && this.iniOptions.dateFormat) ? this.iniOptions.dateFormat : 'Y-m-d';
+ let options = this._getOptions();
+ let initialDateFormat = (options && options.dateFormat) ? options.dateFormat : 'Y-m-d';
let format = this._formatFlat2Angular(initialDateFormat);
this.modelView = this.$filter('date')(value, format);
}
@@ -135,9 +138,12 @@ class DatePicker extends Component {
}
}
- $onInit() {
- if (!this.iniOptions)
+ _getOptions() {
+ if (this.iniOptions && this._optionsChecked) {
+ return this.iniOptions;
+ } else if (!this.iniOptions) {
this.iniOptions = {};
+ }
if (!this.iniOptions.locale)
this.iniOptions.locale = this.$translate.use();
@@ -157,9 +163,14 @@ class DatePicker extends Component {
}
);
}
+ this._optionsChecked = true;
+ return this.iniOptions;
+ }
- if (this.input)
- this.vp = new Flatpickr(this.input, this.iniOptions);
+ $onInit() {
+ this.iniOptions = this._getOptions();
+ this.isTimePicker = (this.iniOptions && this.iniOptions.enableTime && this.iniOptions.noCalendar);
+ this.vp = new Flatpickr(this.input, this.iniOptions);
}
$onDestroy() {
if (this.vp)
diff --git a/client/core/src/datePicker/datePicker.spec.js b/client/core/src/datePicker/datePicker.spec.js
index 4672a71e8..bd0807dd7 100644
--- a/client/core/src/datePicker/datePicker.spec.js
+++ b/client/core/src/datePicker/datePicker.spec.js
@@ -12,12 +12,12 @@ describe('Component vnDatePicker', () => {
angular.mock.module('client');
});
- beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$timeout_) => {
+ beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$timeout_, _$translate_) => {
$componentController = _$componentController_;
$scope = $rootScope.$new();
$timeout = _$timeout_;
$element = angular.element(`
`);
- $translate = {};
+ $translate = _$translate_;
controller = $componentController('vnDatePicker', {$scope, $element, $translate, $timeout});
}));
diff --git a/client/core/src/datePicker/style.scss b/client/core/src/datePicker/style.scss
index f1bd30dab..d729ba947 100644
--- a/client/core/src/datePicker/style.scss
+++ b/client/core/src/datePicker/style.scss
@@ -1,12 +1,18 @@
vn-date-picker {
+ div {
+ outline: none; //remove chrome outline
+ }
.mdl-chip__action {
- position: absolute;
+ position: absolute;
+ width: auto;
top: 0px;
right: -6px;
margin: 22px 0px;
background-color: white;
}
.material-icons {
- font-size: 18px;
+ font-size: 18px;
+ float: right;
+ margin-right: 5px;
}
}
\ No newline at end of file
diff --git a/client/core/src/icon-menu/icon-menu.html b/client/core/src/icon-menu/icon-menu.html
index 9cf978b55..6f49a6f7e 100644
--- a/client/core/src/icon-menu/icon-menu.html
+++ b/client/core/src/icon-menu/icon-menu.html
@@ -1,5 +1,8 @@