@phoenix-cg/v-filters 0.2.0-beta.2 → 0.2.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v-filters.common.js +50 -6
- package/dist/v-filters.common.js.map +1 -1
- package/dist/v-filters.umd.js +50 -6
- package/dist/v-filters.umd.js.map +1 -1
- package/dist/v-filters.umd.min.js +1 -1
- package/dist/v-filters.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/VFilters.vue +15 -5
package/dist/v-filters.umd.js
CHANGED
|
@@ -4354,7 +4354,7 @@ if (typeof window !== 'undefined') {
|
|
|
4354
4354
|
// Indicate to webpack that this file can be concatenated
|
|
4355
4355
|
/* harmony default export */ var setPublicPath = (null);
|
|
4356
4356
|
|
|
4357
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
4357
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"bb842c1a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/VFilters.vue?vue&type=template&id=bdd514ea&
|
|
4358
4358
|
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"v-filters"},[_c('div',{staticClass:"v-filters_fields"},[_vm._t("before-fields"),_vm._l((_vm.fields),function(field){return _c(_vm.fieldComponentName,{key:field._name,tag:"component",attrs:{"title":field.title}},[_c(_vm.componentsMap[field._type],_vm._b({key:_vm.fieldKey,tag:"component",on:{"input":function($event){return _vm.handleFieldChange(field._name)}},model:{value:(_vm.filters[field._name]),callback:function ($$v) {_vm.$set(_vm.filters, field._name, $$v)},expression:"filters[field._name]"}},'component',field._fieldProps || {},false))],1)}),_vm._t("after-fields"),_vm._t("actions",[_c(_vm.fieldComponentName,{tag:"component"},[(!_vm.immediate)?_c('button',{staticClass:"v-button v-filters_button",on:{"click":_vm.showResult}},[_vm._v(" "+_vm._s(_vm.actionTitle)+" ")]):_vm._e(),(_vm.edited)?_c('button',{staticClass:"v-button v-filters_button __reset",on:{"click":_vm.resetFilters}},[_vm._v(" Сбросить параметры ")]):_vm._e()])],null,{
|
|
4359
4359
|
showResult: _vm.showResult,
|
|
4360
4360
|
resetFilters: _vm.resetFilters,
|
|
@@ -4371,7 +4371,7 @@ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._sel
|
|
|
4371
4371
|
var staticRenderFns = []
|
|
4372
4372
|
|
|
4373
4373
|
|
|
4374
|
-
// CONCATENATED MODULE: ./src/components/VFilters.vue?vue&type=template&id=
|
|
4374
|
+
// CONCATENATED MODULE: ./src/components/VFilters.vue?vue&type=template&id=bdd514ea&
|
|
4375
4375
|
|
|
4376
4376
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
|
|
4377
4377
|
var es_object_keys = __webpack_require__("b64b");
|
|
@@ -4550,6 +4550,35 @@ function _nonIterableRest() {
|
|
|
4550
4550
|
function _slicedToArray(arr, i) {
|
|
4551
4551
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
4552
4552
|
}
|
|
4553
|
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
|
4554
|
+
|
|
4555
|
+
function _arrayWithoutHoles(arr) {
|
|
4556
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
4557
|
+
}
|
|
4558
|
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
|
4559
|
+
|
|
4560
|
+
|
|
4561
|
+
|
|
4562
|
+
|
|
4563
|
+
|
|
4564
|
+
|
|
4565
|
+
|
|
4566
|
+
|
|
4567
|
+
function _iterableToArray(iter) {
|
|
4568
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
|
4569
|
+
}
|
|
4570
|
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
|
4571
|
+
function _nonIterableSpread() {
|
|
4572
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4573
|
+
}
|
|
4574
|
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
|
4575
|
+
|
|
4576
|
+
|
|
4577
|
+
|
|
4578
|
+
|
|
4579
|
+
function _toConsumableArray(arr) {
|
|
4580
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
4581
|
+
}
|
|
4553
4582
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
|
|
4554
4583
|
var es_number_constructor = __webpack_require__("a9e3");
|
|
4555
4584
|
|
|
@@ -5070,6 +5099,7 @@ _curry2(function equals(a, b) {
|
|
|
5070
5099
|
|
|
5071
5100
|
|
|
5072
5101
|
|
|
5102
|
+
|
|
5073
5103
|
//
|
|
5074
5104
|
//
|
|
5075
5105
|
//
|
|
@@ -5204,6 +5234,12 @@ var VFiltersvue_type_script_lang_js_unserialize = function unserialize(input) {
|
|
|
5204
5234
|
fieldKey: {
|
|
5205
5235
|
type: [String, Number],
|
|
5206
5236
|
default: '1'
|
|
5237
|
+
},
|
|
5238
|
+
alwaysSendFields: {
|
|
5239
|
+
type: Array,
|
|
5240
|
+
default: function _default() {
|
|
5241
|
+
return [];
|
|
5242
|
+
}
|
|
5207
5243
|
}
|
|
5208
5244
|
},
|
|
5209
5245
|
data: function data() {
|
|
@@ -5234,8 +5270,9 @@ var VFiltersvue_type_script_lang_js_unserialize = function unserialize(input) {
|
|
|
5234
5270
|
var _this = this;
|
|
5235
5271
|
|
|
5236
5272
|
var filters = {};
|
|
5273
|
+
var fieldsToInclude = [].concat(_toConsumableArray(this.editedFields), _toConsumableArray(this.alwaysSendFields));
|
|
5237
5274
|
Object.keys(this.filters).forEach(function (name) {
|
|
5238
|
-
if (
|
|
5275
|
+
if (fieldsToInclude.includes(name)) {
|
|
5239
5276
|
var filtersValue = _this.filters[name];
|
|
5240
5277
|
var wrappedValue = getType(filtersValue) === 'Object' ? [filtersValue] : filtersValue;
|
|
5241
5278
|
filters[name] = wrappedValue.map(function (value) {
|
|
@@ -5325,11 +5362,11 @@ var VFiltersvue_type_script_lang_js_unserialize = function unserialize(input) {
|
|
|
5325
5362
|
_this2.$set(_this2.filters, field._name, value);
|
|
5326
5363
|
});
|
|
5327
5364
|
this.setUrlParams(isUpdate);
|
|
5328
|
-
!isUpdate && this.doAction();
|
|
5365
|
+
!isUpdate && this.doAction(true);
|
|
5329
5366
|
},
|
|
5330
5367
|
resetFilters: function resetFilters() {
|
|
5331
5368
|
this.editedFields = [];
|
|
5332
|
-
this.$emit('reset-filters');
|
|
5369
|
+
this.$emit('reset-filters', this.flatFilters);
|
|
5333
5370
|
},
|
|
5334
5371
|
addEditedField: function addEditedField(name) {
|
|
5335
5372
|
if (!this.editedFields.includes(name)) {
|
|
@@ -5337,7 +5374,14 @@ var VFiltersvue_type_script_lang_js_unserialize = function unserialize(input) {
|
|
|
5337
5374
|
}
|
|
5338
5375
|
},
|
|
5339
5376
|
doAction: function doAction() {
|
|
5340
|
-
|
|
5377
|
+
var both = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
5378
|
+
|
|
5379
|
+
if (both) {
|
|
5380
|
+
this.requestCount();
|
|
5381
|
+
this.showResult();
|
|
5382
|
+
} else {
|
|
5383
|
+
this.immediate ? this.showResult() : this.requestCount();
|
|
5384
|
+
}
|
|
5341
5385
|
},
|
|
5342
5386
|
requestCount: function requestCount() {
|
|
5343
5387
|
this.$emit('request-count', this.flatFilters);
|