@tripup-company/element-ui-extended 0.0.11 → 0.0.12

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.
@@ -6212,12 +6212,12 @@ if (typeof window !== 'undefined') {
6212
6212
  // Indicate to webpack that this file can be concatenated
6213
6213
  /* harmony default export */ var setPublicPath = (null);
6214
6214
 
6215
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7229a924-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/CompositeTable/index.vue?vue&type=template&id=3819ce03&scoped=true&
6215
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7229a924-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/CompositeTable/index.vue?vue&type=template&id=69fb16da&scoped=true&
6216
6216
  var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.loading),expression:"loading"}],staticClass:"composite-table"},[_vm._t("default",function(){return [_c('el-row',{attrs:{"gutter":20}},[_c('el-col',{attrs:{"span":18}},[_vm._t("quick-search-filter",function(){return [(_vm.topFilter)?_c('quick-search-filter',{attrs:{"filter":_vm.topFilter,"search":_vm.topSearch},on:{"apply:filter":_vm.handleApplyTopFilter,"reset:filter":_vm.handleResetTopFilter}}):_vm._e()]},null,{ topFilter: _vm.topFilter, search: _vm.search }),_vm._t("table",function(){return [_c('generic-table',{attrs:{"fields":_vm.fields,"data":_vm.data},on:{"sort:change":_vm.handleChangeSort}})]},null,{ fields: _vm.fields, data: _vm.data }),_c('el-row',[_c('el-col',[_vm._t("paginator",function(){return [_c('generic-paginator',{attrs:{"total":_vm.total,"limit":_vm.limit,"current-page":_vm.currentPage},on:{"size:change":_vm.handleSizeChange,"page:change":_vm.handleCurrentChange}})]},null,{ total: _vm.total, limit: _vm.limit, currentPage: _vm.currentPage })],2)],1)],2),_c('el-col',{attrs:{"span":6}},[_vm._t("filter",function(){return [(_vm.filters.length)?_c('generic-filter',{attrs:{"filters":_vm.filters,"search":_vm.search},on:{"apply:filter":_vm.handleApplyFilter,"reset:filter":_vm.handleResetFilter}}):_vm._e()]},null,{ filters: _vm.filters, search: _vm.search })],2)],1)]})],2)}
6217
6217
  var staticRenderFns = []
6218
6218
 
6219
6219
 
6220
- // CONCATENATED MODULE: ./src/components/CompositeTable/index.vue?vue&type=template&id=3819ce03&scoped=true&
6220
+ // CONCATENATED MODULE: ./src/components/CompositeTable/index.vue?vue&type=template&id=69fb16da&scoped=true&
6221
6221
 
6222
6222
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
6223
6223
  var es_object_to_string = __webpack_require__("d3b7");
@@ -6492,16 +6492,64 @@ var GenericFiltersvue_type_template_id_577eb898_scoped_true_staticRenderFns = []
6492
6492
 
6493
6493
  // CONCATENATED MODULE: ./src/components/GenericFilters/index.vue?vue&type=template&id=577eb898&scoped=true&
6494
6494
 
6495
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7229a924-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/GenericFilters/FilterRow.vue?vue&type=template&id=980096d6&scoped=true&
6496
- var FilterRowvue_type_template_id_980096d6_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-row',{staticClass:"m-b-10"},[_c('el-row',[_c('el-col',{attrs:{"lg":4,"md":4,"sm":4,"xs":4}},[_c('el-checkbox',{model:{value:(_vm.showFilter),callback:function ($$v) {_vm.showFilter=$$v},expression:"showFilter"}},[_c('span',[_vm._v(_vm._s(_vm.column.label))])])],1)],1),(_vm.showFilter)?_c('el-row',{staticClass:"m-t-5"},[_c('el-col',{staticClass:"p-b-10",attrs:{"span":24}},[_c('el-select',{attrs:{"placeholder":"Select"},model:{value:(_vm.search.operator),callback:function ($$v) {_vm.$set(_vm.search, "operator", $$v)},expression:"search.operator"}},_vm._l((_vm.column.type==='string' ? _vm.stringOperators : _vm.enumOperators),function(operator){return _c('el-option',{key:operator.value,attrs:{"value":operator.value,"label":operator.label}})}),1)],1),_c('el-col',{attrs:{"span":24}},[(_vm.column.type==='string')?_c('el-input',{directives:[{name:"show",rawName:"v-show",value:(!_vm.isDisableInput(_vm.search.operator)),expression:"!isDisableInput(search.operator)"}],model:{value:(_vm.search.value),callback:function ($$v) {_vm.$set(_vm.search, "value", $$v)},expression:"search.value"}}):_c('el-select',{attrs:{"placeholder":"Select","multiple":_vm.isMultiple},model:{value:(_vm.search.value),callback:function ($$v) {_vm.$set(_vm.search, "value", $$v)},expression:"search.value"}},_vm._l(((_vm.column.type==='enum' ? _vm.column.values : _vm.boolValues)),function(label,value){return _c('el-option',{key:value,attrs:{"value":value,"label":label}})}),1)],1)],1):_vm._e()],1)}
6497
- var FilterRowvue_type_template_id_980096d6_scoped_true_staticRenderFns = []
6495
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7229a924-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/GenericFilters/FilterRow.vue?vue&type=template&id=71e0b52e&
6496
+ var FilterRowvue_type_template_id_71e0b52e_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-row',{staticClass:"m-b-10"},[_c('el-row',[_c('el-col',{attrs:{"lg":4,"md":4,"sm":4,"xs":4}},[_c('el-checkbox',{model:{value:(_vm.showFilter),callback:function ($$v) {_vm.showFilter=$$v},expression:"showFilter"}},[_c('span',[_vm._v(_vm._s(_vm.column.label))])])],1)],1),(_vm.showFilter)?_c('el-row',{staticClass:"m-t-5"},[(_vm.operators.length !== 1)?_c('el-col',{staticClass:"p-b-10",attrs:{"span":24}},[_c('el-select',{attrs:{"placeholder":"Select"},model:{value:(_vm.search.operator),callback:function ($$v) {_vm.$set(_vm.search, "operator", $$v)},expression:"search.operator"}},_vm._l((_vm.operators),function(operator){return _c('el-option',{key:operator.value,attrs:{"label":operator.label,"value":operator.value}})}),1)],1):_vm._e(),_c('el-col',{attrs:{"span":24}},[(_vm.column.type === 'string')?_c('el-input',{directives:[{name:"show",rawName:"v-show",value:(!_vm.isDisableInput(_vm.search.operator)),expression:"!isDisableInput(search.operator)"}],model:{value:(_vm.search.value),callback:function ($$v) {_vm.$set(_vm.search, "value", $$v)},expression:"search.value"}}):(_vm.column.type === 'date')?_c('el-date-picker',{staticClass:"w-100",attrs:{"end-placeholder":"To","format":"dd.MM.yy","placeholder":"Pick a day","range-separator":"-","start-placeholder":"From","type":"daterange","value-format":"yyyy-MM-dd"},model:{value:(_vm.search.value),callback:function ($$v) {_vm.$set(_vm.search, "value", $$v)},expression:"search.value"}}):_c('el-select',{attrs:{"refs":"select","multiple":_vm.isMultiple,"placeholder":"Select","filterable":_vm.filterable,"remote":_vm.remote,"remote-method":_vm.remoteMethodHandler,"loading":_vm.loading,"clearable":""},on:{"change":_vm.updateSearch},model:{value:(_vm.search.value),callback:function ($$v) {_vm.$set(_vm.search, "value", $$v)},expression:"search.value"}},_vm._l((_vm.selectListLocal),function(item){return _c('el-option',{key:item[_vm.selectKey],attrs:{"label":item[_vm.selectLabel],"value":item[_vm.selectValue]}})}),1)],1)],1):_vm._e()],1)}
6497
+ var FilterRowvue_type_template_id_71e0b52e_staticRenderFns = []
6498
6498
 
6499
6499
 
6500
- // CONCATENATED MODULE: ./src/components/GenericFilters/FilterRow.vue?vue&type=template&id=980096d6&scoped=true&
6500
+ // CONCATENATED MODULE: ./src/components/GenericFilters/FilterRow.vue?vue&type=template&id=71e0b52e&
6501
6501
 
6502
6502
  // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/GenericFilters/FilterRow.vue?vue&type=script&lang=js&
6503
6503
 
6504
6504
 
6505
+
6506
+
6507
+
6508
+
6509
+
6510
+
6511
+
6512
+
6513
+
6514
+ //
6515
+ //
6516
+ //
6517
+ //
6518
+ //
6519
+ //
6520
+ //
6521
+ //
6522
+ //
6523
+ //
6524
+ //
6525
+ //
6526
+ //
6527
+ //
6528
+ //
6529
+ //
6530
+ //
6531
+ //
6532
+ //
6533
+ //
6534
+ //
6535
+ //
6536
+ //
6537
+ //
6538
+ //
6539
+ //
6540
+ //
6541
+ //
6542
+ //
6543
+ //
6544
+ //
6545
+ //
6546
+ //
6547
+ //
6548
+ //
6549
+ //
6550
+ //
6551
+ //
6552
+ //
6505
6553
  //
6506
6554
  //
6507
6555
  //
@@ -6526,7 +6574,6 @@ var FilterRowvue_type_template_id_980096d6_scoped_true_staticRenderFns = []
6526
6574
  //
6527
6575
  //
6528
6576
  /* harmony default export */ var FilterRowvue_type_script_lang_js_ = ({
6529
- name: "FilterRow",
6530
6577
  props: {
6531
6578
  column: {
6532
6579
  type: Object,
@@ -6541,79 +6588,183 @@ var FilterRowvue_type_template_id_980096d6_scoped_true_staticRenderFns = []
6541
6588
  }
6542
6589
  }
6543
6590
  },
6544
- computed: {
6545
- isMultiple: function isMultiple() {
6546
- return this.column.is_multiple ? this.column.is_multiple : false;
6547
- }
6548
- },
6549
6591
  data: function data() {
6592
+ var _this$column$selectKe, _this$column$selectLa, _this$column$selectVa, _this$column$filterab, _this$column$remote, _this$column$remoteMe;
6593
+
6550
6594
  return {
6551
- showFilter: this.search.operator !== '',
6595
+ loading: false,
6596
+ selectKey: (_this$column$selectKe = this.column.selectKey) !== null && _this$column$selectKe !== void 0 ? _this$column$selectKe : "key",
6597
+ selectLabel: (_this$column$selectLa = this.column.selectLabel) !== null && _this$column$selectLa !== void 0 ? _this$column$selectLa : "label",
6598
+ selectValue: (_this$column$selectVa = this.column.selectValue) !== null && _this$column$selectVa !== void 0 ? _this$column$selectVa : "key",
6599
+ filterable: (_this$column$filterab = this.column.filterable) !== null && _this$column$filterab !== void 0 ? _this$column$filterab : false,
6600
+ remote: (_this$column$remote = this.column.remote) !== null && _this$column$remote !== void 0 ? _this$column$remote : false,
6601
+ remoteMethod: (_this$column$remoteMe = this.column.remoteMethod) !== null && _this$column$remoteMe !== void 0 ? _this$column$remoteMe : null,
6602
+ selectListLocal: this.search.selectList ? this.search.selectList : this.column.type === "enum" ? this.column.values : this.boolValues,
6603
+ showFilter: this.search.operator !== "",
6552
6604
  stringOperators: [{
6553
- 'value': 'equal',
6554
- 'label': 'is equal'
6605
+ value: "equal",
6606
+ label: "is equal"
6555
6607
  }, {
6556
- 'value': 'not_equal',
6557
- 'label': 'is not equal'
6608
+ value: "not_equal",
6609
+ label: "is not equal"
6558
6610
  }, {
6559
- 'value': 'contains',
6560
- 'label': 'contains'
6611
+ value: "contains",
6612
+ label: "contains"
6561
6613
  }, {
6562
- 'value': 'not_contains',
6563
- 'label': 'doesn’t contain'
6614
+ value: "not_contains",
6615
+ label: "doesn’t contain"
6564
6616
  }, {
6565
- 'value': 'is_null',
6566
- 'label': 'is empty'
6617
+ value: "is_null",
6618
+ label: "is empty"
6567
6619
  }, {
6568
- 'value': 'is_not_null',
6569
- 'label': 'is not empty'
6620
+ value: "is_not_null",
6621
+ label: "is not empty"
6570
6622
  }, {
6571
- 'value': 'start_with',
6572
- 'label': 'begins with'
6623
+ value: "start_with",
6624
+ label: "begins with"
6573
6625
  }, {
6574
- 'value': 'end_with',
6575
- 'label': 'ends with'
6626
+ value: "end_with",
6627
+ label: "ends with"
6576
6628
  }],
6577
- disabledInputOperations: ['is_null', 'is_not_null'],
6629
+ disabledInputOperations: ["is_null", "is_not_null"],
6578
6630
  enumOperators: [{
6579
- 'value': 'equal',
6580
- 'label': 'is'
6581
- }, {
6582
- 'value': 'in',
6583
- 'label': 'in'
6631
+ value: "equal",
6632
+ label: "is"
6633
+ }],
6634
+ enumOperatorsMultiple: [{
6635
+ value: "in",
6636
+ label: "in"
6637
+ }],
6638
+ dateOperators: [{
6639
+ value: "between",
6640
+ label: "between"
6584
6641
  }],
6585
6642
  boolValues: {
6586
- null: 'empty',
6587
- true: 'true',
6588
- false: 'false'
6643
+ null: "empty",
6644
+ true: "true",
6645
+ false: "false"
6589
6646
  }
6590
6647
  };
6591
6648
  },
6649
+ computed: {
6650
+ operators: function operators() {
6651
+ var operators = [];
6652
+
6653
+ switch (this.column.type) {
6654
+ case "string":
6655
+ operators = this.stringOperators;
6656
+ break;
6657
+
6658
+ case "enum":
6659
+ if (this.column.is_multiple) {
6660
+ operators = this.enumOperatorsMultiple;
6661
+ } else {
6662
+ operators = this.enumOperators;
6663
+ }
6664
+
6665
+ break;
6666
+
6667
+ case "date":
6668
+ operators = this.dateOperators;
6669
+ break;
6670
+ }
6671
+
6672
+ return operators;
6673
+ },
6674
+ isMultiple: function isMultiple() {
6675
+ return this.column.is_multiple ? this.column.is_multiple : false;
6676
+ },
6677
+ remoteMethodHandler: {
6678
+ get: function get() {
6679
+ if (this.remoteMethod !== null) {
6680
+ return this.remoteCall;
6681
+ }
6682
+
6683
+ return null;
6684
+ }
6685
+ }
6686
+ },
6592
6687
  watch: {
6593
6688
  showFilter: function showFilter() {
6594
6689
  if (this.showFilter === false) {
6595
- this.search.operator = '';
6596
- this.search.value = '';
6690
+ this.search.operator = "";
6691
+ this.search.value = "";
6692
+ } else if (this.search.operator === "" && this.operators.length === 1) {
6693
+ this.search.operator = this.operators[0].value;
6597
6694
  }
6598
6695
  },
6599
- search: {
6600
- handler: function handler(newValue) {
6601
- if (newValue.operator === '') {
6602
- this.showFilter = false;
6603
- }
6604
- },
6605
- deep: true
6696
+ search: function search() {
6697
+ if (this.search.operator === "") {
6698
+ this.showFilter = false;
6699
+ }
6700
+ }
6701
+ },
6702
+ mounted: function mounted() {
6703
+ if (this.operators.length === 1) {// this.search.operator = this.operators[0].value;
6606
6704
  }
6607
6705
  },
6608
6706
  methods: {
6609
6707
  isDisableInput: function isDisableInput(operator) {
6610
- var disable = this.disabledInputOperations.indexOf(operator) !== -1;
6708
+ var disable = this.disabledInputOperations.includes(operator);
6611
6709
 
6612
6710
  if (disable) {
6613
- this.search.value = '';
6711
+ this.search.value = "";
6614
6712
  }
6615
6713
 
6616
6714
  return disable;
6715
+ },
6716
+ remoteCall: function remoteCall(query) {
6717
+ var _this = this;
6718
+
6719
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
6720
+ var response;
6721
+ return regeneratorRuntime.wrap(function _callee$(_context) {
6722
+ while (1) {
6723
+ switch (_context.prev = _context.next) {
6724
+ case 0:
6725
+ _this.loading = true;
6726
+ _context.next = 3;
6727
+ return _this.remoteMethod.all({
6728
+ search: _this.selectLabel + ":" + query,
6729
+ searchFields: _this.selectLabel + ":like"
6730
+ });
6731
+
6732
+ case 3:
6733
+ response = _context.sent;
6734
+ _this.selectListLocal = response.data;
6735
+ _this.search["selectList"] = response.data;
6736
+ _this.loading = false;
6737
+
6738
+ case 7:
6739
+ case "end":
6740
+ return _context.stop();
6741
+ }
6742
+ }
6743
+ }, _callee);
6744
+ }))();
6745
+ },
6746
+ updateSearch: function updateSearch(key) {
6747
+ if (key && this.remote) {
6748
+ var obj = _defineProperty({}, this.selectKey, key);
6749
+
6750
+ var _iterator = _createForOfIteratorHelper(this.selectListLocal),
6751
+ _step;
6752
+
6753
+ try {
6754
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
6755
+ var item = _step.value;
6756
+
6757
+ if (item[this.selectKey] === key) {
6758
+ obj[this.selectLabel] = item[this.selectLabel];
6759
+ this.search.selectList = [obj];
6760
+ }
6761
+ }
6762
+ } catch (err) {
6763
+ _iterator.e(err);
6764
+ } finally {
6765
+ _iterator.f();
6766
+ }
6767
+ }
6617
6768
  }
6618
6769
  }
6619
6770
  });
@@ -6729,11 +6880,11 @@ function normalizeComponent (
6729
6880
 
6730
6881
  var component = normalizeComponent(
6731
6882
  GenericFilters_FilterRowvue_type_script_lang_js_,
6732
- FilterRowvue_type_template_id_980096d6_scoped_true_render,
6733
- FilterRowvue_type_template_id_980096d6_scoped_true_staticRenderFns,
6883
+ FilterRowvue_type_template_id_71e0b52e_render,
6884
+ FilterRowvue_type_template_id_71e0b52e_staticRenderFns,
6734
6885
  false,
6735
6886
  null,
6736
- "980096d6",
6887
+ null,
6737
6888
  null
6738
6889
 
6739
6890
  )
@@ -7971,8 +8122,8 @@ var QuickSearchFilter_component = normalizeComponent(
7971
8122
  return _objectSpread2(_objectSpread2({}, query), filter);
7972
8123
  },
7973
8124
  currentPage: function currentPage() {
7974
- if (this.listQueryService.getListQuery().meta) {
7975
- return this.listQueryService.getListQuery().meta.page;
8125
+ if (this.meta) {
8126
+ return this.meta.page;
7976
8127
  }
7977
8128
 
7978
8129
  return 0;
@@ -7987,12 +8138,8 @@ var QuickSearchFilter_component = normalizeComponent(
7987
8138
  return 0;
7988
8139
  },
7989
8140
  limit: function limit() {
7990
- var _this$listQueryServic;
7991
-
7992
- if ((_this$listQueryServic = this.listQueryService.getListQuery().meta) !== null && _this$listQueryServic !== void 0 && _this$listQueryServic.limit) {
7993
- var _this$listQueryServic2;
7994
-
7995
- return (_this$listQueryServic2 = this.listQueryService.getListQuery().meta) === null || _this$listQueryServic2 === void 0 ? void 0 : _this$listQueryServic2.limit;
8141
+ if (this.meta) {
8142
+ return this.meta.limit;
7996
8143
  }
7997
8144
 
7998
8145
  return 10;
@@ -8122,7 +8269,7 @@ var CompositeTable_component = normalizeComponent(
8122
8269
  staticRenderFns,
8123
8270
  false,
8124
8271
  null,
8125
- "3819ce03",
8272
+ "69fb16da",
8126
8273
  null
8127
8274
 
8128
8275
  )