@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.
@@ -6203,12 +6203,12 @@ if (typeof window !== 'undefined') {
6203
6203
  // Indicate to webpack that this file can be concatenated
6204
6204
  /* harmony default export */ var setPublicPath = (null);
6205
6205
 
6206
- // 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&
6206
+ // 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&
6207
6207
  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)}
6208
6208
  var staticRenderFns = []
6209
6209
 
6210
6210
 
6211
- // CONCATENATED MODULE: ./src/components/CompositeTable/index.vue?vue&type=template&id=3819ce03&scoped=true&
6211
+ // CONCATENATED MODULE: ./src/components/CompositeTable/index.vue?vue&type=template&id=69fb16da&scoped=true&
6212
6212
 
6213
6213
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
6214
6214
  var es_object_to_string = __webpack_require__("d3b7");
@@ -6483,16 +6483,64 @@ var GenericFiltersvue_type_template_id_577eb898_scoped_true_staticRenderFns = []
6483
6483
 
6484
6484
  // CONCATENATED MODULE: ./src/components/GenericFilters/index.vue?vue&type=template&id=577eb898&scoped=true&
6485
6485
 
6486
- // 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&
6487
- 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)}
6488
- var FilterRowvue_type_template_id_980096d6_scoped_true_staticRenderFns = []
6486
+ // 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&
6487
+ 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)}
6488
+ var FilterRowvue_type_template_id_71e0b52e_staticRenderFns = []
6489
6489
 
6490
6490
 
6491
- // CONCATENATED MODULE: ./src/components/GenericFilters/FilterRow.vue?vue&type=template&id=980096d6&scoped=true&
6491
+ // CONCATENATED MODULE: ./src/components/GenericFilters/FilterRow.vue?vue&type=template&id=71e0b52e&
6492
6492
 
6493
6493
  // 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&
6494
6494
 
6495
6495
 
6496
+
6497
+
6498
+
6499
+
6500
+
6501
+
6502
+
6503
+
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
+ //
6496
6544
  //
6497
6545
  //
6498
6546
  //
@@ -6517,7 +6565,6 @@ var FilterRowvue_type_template_id_980096d6_scoped_true_staticRenderFns = []
6517
6565
  //
6518
6566
  //
6519
6567
  /* harmony default export */ var FilterRowvue_type_script_lang_js_ = ({
6520
- name: "FilterRow",
6521
6568
  props: {
6522
6569
  column: {
6523
6570
  type: Object,
@@ -6532,79 +6579,183 @@ var FilterRowvue_type_template_id_980096d6_scoped_true_staticRenderFns = []
6532
6579
  }
6533
6580
  }
6534
6581
  },
6535
- computed: {
6536
- isMultiple: function isMultiple() {
6537
- return this.column.is_multiple ? this.column.is_multiple : false;
6538
- }
6539
- },
6540
6582
  data: function data() {
6583
+ var _this$column$selectKe, _this$column$selectLa, _this$column$selectVa, _this$column$filterab, _this$column$remote, _this$column$remoteMe;
6584
+
6541
6585
  return {
6542
- showFilter: this.search.operator !== '',
6586
+ loading: false,
6587
+ selectKey: (_this$column$selectKe = this.column.selectKey) !== null && _this$column$selectKe !== void 0 ? _this$column$selectKe : "key",
6588
+ selectLabel: (_this$column$selectLa = this.column.selectLabel) !== null && _this$column$selectLa !== void 0 ? _this$column$selectLa : "label",
6589
+ selectValue: (_this$column$selectVa = this.column.selectValue) !== null && _this$column$selectVa !== void 0 ? _this$column$selectVa : "key",
6590
+ filterable: (_this$column$filterab = this.column.filterable) !== null && _this$column$filterab !== void 0 ? _this$column$filterab : false,
6591
+ remote: (_this$column$remote = this.column.remote) !== null && _this$column$remote !== void 0 ? _this$column$remote : false,
6592
+ remoteMethod: (_this$column$remoteMe = this.column.remoteMethod) !== null && _this$column$remoteMe !== void 0 ? _this$column$remoteMe : null,
6593
+ selectListLocal: this.search.selectList ? this.search.selectList : this.column.type === "enum" ? this.column.values : this.boolValues,
6594
+ showFilter: this.search.operator !== "",
6543
6595
  stringOperators: [{
6544
- 'value': 'equal',
6545
- 'label': 'is equal'
6596
+ value: "equal",
6597
+ label: "is equal"
6546
6598
  }, {
6547
- 'value': 'not_equal',
6548
- 'label': 'is not equal'
6599
+ value: "not_equal",
6600
+ label: "is not equal"
6549
6601
  }, {
6550
- 'value': 'contains',
6551
- 'label': 'contains'
6602
+ value: "contains",
6603
+ label: "contains"
6552
6604
  }, {
6553
- 'value': 'not_contains',
6554
- 'label': 'doesn’t contain'
6605
+ value: "not_contains",
6606
+ label: "doesn’t contain"
6555
6607
  }, {
6556
- 'value': 'is_null',
6557
- 'label': 'is empty'
6608
+ value: "is_null",
6609
+ label: "is empty"
6558
6610
  }, {
6559
- 'value': 'is_not_null',
6560
- 'label': 'is not empty'
6611
+ value: "is_not_null",
6612
+ label: "is not empty"
6561
6613
  }, {
6562
- 'value': 'start_with',
6563
- 'label': 'begins with'
6614
+ value: "start_with",
6615
+ label: "begins with"
6564
6616
  }, {
6565
- 'value': 'end_with',
6566
- 'label': 'ends with'
6617
+ value: "end_with",
6618
+ label: "ends with"
6567
6619
  }],
6568
- disabledInputOperations: ['is_null', 'is_not_null'],
6620
+ disabledInputOperations: ["is_null", "is_not_null"],
6569
6621
  enumOperators: [{
6570
- 'value': 'equal',
6571
- 'label': 'is'
6572
- }, {
6573
- 'value': 'in',
6574
- 'label': 'in'
6622
+ value: "equal",
6623
+ label: "is"
6624
+ }],
6625
+ enumOperatorsMultiple: [{
6626
+ value: "in",
6627
+ label: "in"
6628
+ }],
6629
+ dateOperators: [{
6630
+ value: "between",
6631
+ label: "between"
6575
6632
  }],
6576
6633
  boolValues: {
6577
- null: 'empty',
6578
- true: 'true',
6579
- false: 'false'
6634
+ null: "empty",
6635
+ true: "true",
6636
+ false: "false"
6580
6637
  }
6581
6638
  };
6582
6639
  },
6640
+ computed: {
6641
+ operators: function operators() {
6642
+ var operators = [];
6643
+
6644
+ switch (this.column.type) {
6645
+ case "string":
6646
+ operators = this.stringOperators;
6647
+ break;
6648
+
6649
+ case "enum":
6650
+ if (this.column.is_multiple) {
6651
+ operators = this.enumOperatorsMultiple;
6652
+ } else {
6653
+ operators = this.enumOperators;
6654
+ }
6655
+
6656
+ break;
6657
+
6658
+ case "date":
6659
+ operators = this.dateOperators;
6660
+ break;
6661
+ }
6662
+
6663
+ return operators;
6664
+ },
6665
+ isMultiple: function isMultiple() {
6666
+ return this.column.is_multiple ? this.column.is_multiple : false;
6667
+ },
6668
+ remoteMethodHandler: {
6669
+ get: function get() {
6670
+ if (this.remoteMethod !== null) {
6671
+ return this.remoteCall;
6672
+ }
6673
+
6674
+ return null;
6675
+ }
6676
+ }
6677
+ },
6583
6678
  watch: {
6584
6679
  showFilter: function showFilter() {
6585
6680
  if (this.showFilter === false) {
6586
- this.search.operator = '';
6587
- this.search.value = '';
6681
+ this.search.operator = "";
6682
+ this.search.value = "";
6683
+ } else if (this.search.operator === "" && this.operators.length === 1) {
6684
+ this.search.operator = this.operators[0].value;
6588
6685
  }
6589
6686
  },
6590
- search: {
6591
- handler: function handler(newValue) {
6592
- if (newValue.operator === '') {
6593
- this.showFilter = false;
6594
- }
6595
- },
6596
- deep: true
6687
+ search: function search() {
6688
+ if (this.search.operator === "") {
6689
+ this.showFilter = false;
6690
+ }
6691
+ }
6692
+ },
6693
+ mounted: function mounted() {
6694
+ if (this.operators.length === 1) {// this.search.operator = this.operators[0].value;
6597
6695
  }
6598
6696
  },
6599
6697
  methods: {
6600
6698
  isDisableInput: function isDisableInput(operator) {
6601
- var disable = this.disabledInputOperations.indexOf(operator) !== -1;
6699
+ var disable = this.disabledInputOperations.includes(operator);
6602
6700
 
6603
6701
  if (disable) {
6604
- this.search.value = '';
6702
+ this.search.value = "";
6605
6703
  }
6606
6704
 
6607
6705
  return disable;
6706
+ },
6707
+ remoteCall: function remoteCall(query) {
6708
+ var _this = this;
6709
+
6710
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
6711
+ var response;
6712
+ return regeneratorRuntime.wrap(function _callee$(_context) {
6713
+ while (1) {
6714
+ switch (_context.prev = _context.next) {
6715
+ case 0:
6716
+ _this.loading = true;
6717
+ _context.next = 3;
6718
+ return _this.remoteMethod.all({
6719
+ search: _this.selectLabel + ":" + query,
6720
+ searchFields: _this.selectLabel + ":like"
6721
+ });
6722
+
6723
+ case 3:
6724
+ response = _context.sent;
6725
+ _this.selectListLocal = response.data;
6726
+ _this.search["selectList"] = response.data;
6727
+ _this.loading = false;
6728
+
6729
+ case 7:
6730
+ case "end":
6731
+ return _context.stop();
6732
+ }
6733
+ }
6734
+ }, _callee);
6735
+ }))();
6736
+ },
6737
+ updateSearch: function updateSearch(key) {
6738
+ if (key && this.remote) {
6739
+ var obj = _defineProperty({}, this.selectKey, key);
6740
+
6741
+ var _iterator = _createForOfIteratorHelper(this.selectListLocal),
6742
+ _step;
6743
+
6744
+ try {
6745
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
6746
+ var item = _step.value;
6747
+
6748
+ if (item[this.selectKey] === key) {
6749
+ obj[this.selectLabel] = item[this.selectLabel];
6750
+ this.search.selectList = [obj];
6751
+ }
6752
+ }
6753
+ } catch (err) {
6754
+ _iterator.e(err);
6755
+ } finally {
6756
+ _iterator.f();
6757
+ }
6758
+ }
6608
6759
  }
6609
6760
  }
6610
6761
  });
@@ -6720,11 +6871,11 @@ function normalizeComponent (
6720
6871
 
6721
6872
  var component = normalizeComponent(
6722
6873
  GenericFilters_FilterRowvue_type_script_lang_js_,
6723
- FilterRowvue_type_template_id_980096d6_scoped_true_render,
6724
- FilterRowvue_type_template_id_980096d6_scoped_true_staticRenderFns,
6874
+ FilterRowvue_type_template_id_71e0b52e_render,
6875
+ FilterRowvue_type_template_id_71e0b52e_staticRenderFns,
6725
6876
  false,
6726
6877
  null,
6727
- "980096d6",
6878
+ null,
6728
6879
  null
6729
6880
 
6730
6881
  )
@@ -7962,8 +8113,8 @@ var QuickSearchFilter_component = normalizeComponent(
7962
8113
  return _objectSpread2(_objectSpread2({}, query), filter);
7963
8114
  },
7964
8115
  currentPage: function currentPage() {
7965
- if (this.listQueryService.getListQuery().meta) {
7966
- return this.listQueryService.getListQuery().meta.page;
8116
+ if (this.meta) {
8117
+ return this.meta.page;
7967
8118
  }
7968
8119
 
7969
8120
  return 0;
@@ -7978,12 +8129,8 @@ var QuickSearchFilter_component = normalizeComponent(
7978
8129
  return 0;
7979
8130
  },
7980
8131
  limit: function limit() {
7981
- var _this$listQueryServic;
7982
-
7983
- if ((_this$listQueryServic = this.listQueryService.getListQuery().meta) !== null && _this$listQueryServic !== void 0 && _this$listQueryServic.limit) {
7984
- var _this$listQueryServic2;
7985
-
7986
- return (_this$listQueryServic2 = this.listQueryService.getListQuery().meta) === null || _this$listQueryServic2 === void 0 ? void 0 : _this$listQueryServic2.limit;
8132
+ if (this.meta) {
8133
+ return this.meta.limit;
7987
8134
  }
7988
8135
 
7989
8136
  return 10;
@@ -8113,7 +8260,7 @@ var CompositeTable_component = normalizeComponent(
8113
8260
  staticRenderFns,
8114
8261
  false,
8115
8262
  null,
8116
- "3819ce03",
8263
+ "69fb16da",
8117
8264
  null
8118
8265
 
8119
8266
  )