@iankibetsh/shframework 5.3.0 → 5.3.2

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.
Files changed (3) hide show
  1. package/dist/library.js +198 -179
  2. package/dist/library.mjs +198 -179
  3. package/package.json +1 -1
package/dist/library.js CHANGED
@@ -104,7 +104,6 @@ function setTabCounts(url){
104
104
  }
105
105
 
106
106
  function formatHttpCatchError(reason){
107
- console.log(reason);
108
107
  let error = '';
109
108
  if (typeof reason !== 'undefined') {
110
109
  if (typeof reason.response !== 'undefined') {
@@ -135,14 +134,12 @@ function formatHttpCatchError(reason){
135
134
 
136
135
  function getMenuCount(url){
137
136
  shApis.doGet(url).then(res => {
138
- console.log(res);
139
137
  });
140
138
  }
141
139
 
142
140
  const signOutUser = () => {
143
141
  const loginUrl = getShConfig('loginUrl', 'auth/login');
144
142
  const logoutApiEndPoint = getShConfig('logoutApiEndpoint', 'auth/logout');
145
- console.log(loginUrl, logoutApiEndPoint);
146
143
  shApis.doPost(logoutApiEndPoint).then(res => {
147
144
  shStorage.removeItem('access_token');
148
145
  shStorage.removeItem('user');
@@ -2732,7 +2729,7 @@ var script$y = {
2732
2729
  }
2733
2730
  },
2734
2731
  created: function () {
2735
- console.log('created');
2732
+ // console.log('created')
2736
2733
  if (this.labels) {
2737
2734
  this.allLabels = this.labels;
2738
2735
  }
@@ -3236,7 +3233,6 @@ const modelValueUpdated = (e) => {
3236
3233
  emit('update:modelValue',inputModel);
3237
3234
  };
3238
3235
  vue.onMounted(()=>{
3239
- console.log(props);
3240
3236
  props.modelValue && (inputModel.value = props.modelValue);
3241
3237
  const options = props.data ?? props.options;
3242
3238
  if(options){
@@ -3572,7 +3568,6 @@ const handlefailedRequest = reason => {
3572
3568
  };
3573
3569
  const submitBtnWidth = vue.ref(null);
3574
3570
  const setExistingData = (existingData) => {
3575
- console.log(existingData,props);
3576
3571
  if (existingData) {
3577
3572
  const newFields = formFields.value.map(fl => {
3578
3573
  if (existingData[fl.field]) {
@@ -3591,7 +3586,7 @@ vue.watch(() => props.currentData, (newData) => {
3591
3586
  setExistingData(newData);
3592
3587
  });
3593
3588
  vue.onMounted((ev) => {
3594
- console.log(props);
3589
+
3595
3590
  props.fields && props.fields.map(field => {
3596
3591
  let fieldObj = {};
3597
3592
  if (typeof field === 'object') {
@@ -5100,87 +5095,89 @@ const _hoisted_12$1 = {
5100
5095
  class: "alert alert-danger error-loading"
5101
5096
  };
5102
5097
  const _hoisted_13$1 = { class: "sh-thead" };
5103
- const _hoisted_14$1 = ["onClick"];
5098
+ const _hoisted_14$1 = { key: 0 };
5104
5099
  const _hoisted_15$1 = ["onClick"];
5105
5100
  const _hoisted_16 = ["onClick"];
5106
5101
  const _hoisted_17 = ["onClick"];
5107
- const _hoisted_18 = {
5102
+ const _hoisted_18 = ["onClick"];
5103
+ const _hoisted_19 = {
5108
5104
  key: 0,
5109
5105
  class: "text-capitalize"
5110
5106
  };
5111
- const _hoisted_19 = { class: "sh-tbody" };
5112
- const _hoisted_20 = {
5107
+ const _hoisted_20 = { class: "sh-tbody" };
5108
+ const _hoisted_21 = {
5113
5109
  key: 0,
5114
5110
  class: "text-center"
5115
5111
  };
5116
- const _hoisted_21 = ["colspan"];
5117
- const _hoisted_22 = {
5112
+ const _hoisted_22 = ["colspan"];
5113
+ const _hoisted_23 = {
5118
5114
  key: 1,
5119
5115
  class: "text-center alert alert-danger"
5120
5116
  };
5121
- const _hoisted_23 = ["colspan"];
5122
- const _hoisted_24 = {
5117
+ const _hoisted_24 = ["colspan"];
5118
+ const _hoisted_25 = {
5123
5119
  key: 2,
5124
5120
  class: "text-center alert alert-info no_records"
5125
5121
  };
5126
- const _hoisted_25 = ["colspan"];
5127
- const _hoisted_26 = ["onClick"];
5128
- const _hoisted_27 = { key: 1 };
5129
- const _hoisted_28 = {
5122
+ const _hoisted_26 = ["colspan"];
5123
+ const _hoisted_27 = ["onClick"];
5124
+ const _hoisted_28 = { key: 0 };
5125
+ const _hoisted_29 = { key: 1 };
5126
+ const _hoisted_30 = {
5130
5127
  key: 2,
5131
5128
  class: "text-success fw-bold"
5132
5129
  };
5133
- const _hoisted_29 = { key: 3 };
5134
- const _hoisted_30 = ["innerHTML"];
5135
- const _hoisted_31 = ["innerHTML"];
5130
+ const _hoisted_31 = { key: 3 };
5136
5131
  const _hoisted_32 = ["innerHTML"];
5137
5132
  const _hoisted_33 = ["innerHTML"];
5138
5133
  const _hoisted_34 = ["innerHTML"];
5139
5134
  const _hoisted_35 = ["innerHTML"];
5140
- const _hoisted_36 = {
5135
+ const _hoisted_36 = ["innerHTML"];
5136
+ const _hoisted_37 = ["innerHTML"];
5137
+ const _hoisted_38 = {
5141
5138
  key: 0,
5142
5139
  style: {"white-space":"nowrap"}
5143
5140
  };
5144
- const _hoisted_37 = { key: 5 };
5145
- const _hoisted_38 = {
5141
+ const _hoisted_39 = { key: 5 };
5142
+ const _hoisted_40 = {
5146
5143
  key: 0,
5147
5144
  class: "text-center"
5148
5145
  };
5149
- const _hoisted_39 = { key: 1 };
5150
- const _hoisted_40 = {
5146
+ const _hoisted_41 = { key: 1 };
5147
+ const _hoisted_42 = {
5151
5148
  key: 2,
5152
5149
  class: "mobile-list-items"
5153
5150
  };
5154
- const _hoisted_41 = ["onClick"];
5155
- const _hoisted_42 = {
5151
+ const _hoisted_43 = ["onClick"];
5152
+ const _hoisted_44 = {
5156
5153
  key: 0,
5157
5154
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
5158
5155
  };
5159
- const _hoisted_43 = {
5156
+ const _hoisted_45 = {
5160
5157
  key: 1,
5161
5158
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
5162
5159
  };
5163
- const _hoisted_44 = {
5160
+ const _hoisted_46 = {
5164
5161
  key: 2,
5165
5162
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
5166
5163
  };
5167
- const _hoisted_45 = {
5164
+ const _hoisted_47 = {
5168
5165
  key: 3,
5169
5166
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
5170
5167
  };
5171
- const _hoisted_46 = { key: 1 };
5172
- const _hoisted_47 = {
5168
+ const _hoisted_48 = { key: 1 };
5169
+ const _hoisted_49 = {
5173
5170
  key: 2,
5174
5171
  class: "text-primary fw-bold"
5175
5172
  };
5176
- const _hoisted_48 = { key: 3 };
5177
- const _hoisted_49 = ["innerHTML"];
5178
- const _hoisted_50 = ["innerHTML"];
5173
+ const _hoisted_50 = { key: 3 };
5179
5174
  const _hoisted_51 = ["innerHTML"];
5180
5175
  const _hoisted_52 = ["innerHTML"];
5181
5176
  const _hoisted_53 = ["innerHTML"];
5182
5177
  const _hoisted_54 = ["innerHTML"];
5183
- const _hoisted_55 = { key: 0 };
5178
+ const _hoisted_55 = ["innerHTML"];
5179
+ const _hoisted_56 = ["innerHTML"];
5180
+ const _hoisted_57 = { key: 0 };
5184
5181
 
5185
5182
  const __default__ = {
5186
5183
  name: 'sh-table',
@@ -5524,6 +5521,16 @@ const cleanColumn = col=>{
5524
5521
  return newCol
5525
5522
  };
5526
5523
 
5524
+ const showColumn = header=>{
5525
+ if(typeof header === 'string'){
5526
+ return true
5527
+ }
5528
+ if(typeof header === 'object' && header.validator) {
5529
+ return header.validator()
5530
+ }
5531
+ return true
5532
+ };
5533
+
5527
5534
 
5528
5535
  return (_ctx, _cache) => {
5529
5536
  const _component_router_link = vue.resolveComponent("router-link");
@@ -5658,42 +5665,46 @@ return (_ctx, _cache) => {
5658
5665
  vue.createElementVNode("thead", _hoisted_13$1, [
5659
5666
  vue.createElementVNode("tr", null, [
5660
5667
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.tableHeaders, (title) => {
5661
- return (vue.openBlock(), vue.createElementBlock("th", { key: title }, [
5662
- (typeof title === 'string')
5663
- ? (vue.openBlock(), vue.createElementBlock("a", {
5664
- key: 0,
5665
- class: "text-capitalize",
5666
- onClick: $event => (_ctx.changeKey('order_by',title))
5667
- }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_14$1))
5668
- : (typeof title === 'object')
5669
- ? (vue.openBlock(), vue.createElementBlock("a", {
5670
- key: 1,
5671
- class: "text-capitalize",
5672
- onClick: $event => (_ctx.changeKey('order_by',title.key))
5673
- }, vue.toDisplayString(title.label ?? title.key.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_15$1))
5674
- : (typeof title === 'function')
5675
- ? (vue.openBlock(), vue.createElementBlock("a", {
5676
- key: 2,
5677
- class: "text-capitalize",
5678
- onClick: $event => (_ctx.changeKey('order_by',title(null)))
5679
- }, vue.toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_16))
5680
- : (typeof title !== 'undefined')
5668
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: title }, [
5669
+ (showColumn(title))
5670
+ ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_14$1, [
5671
+ (typeof title === 'string')
5681
5672
  ? (vue.openBlock(), vue.createElementBlock("a", {
5682
- key: 3,
5673
+ key: 0,
5683
5674
  class: "text-capitalize",
5684
5675
  onClick: $event => (_ctx.changeKey('order_by',title))
5685
- }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_17))
5686
- : vue.createCommentVNode("v-if", true)
5687
- ]))
5676
+ }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_15$1))
5677
+ : (typeof title === 'object')
5678
+ ? (vue.openBlock(), vue.createElementBlock("a", {
5679
+ key: 1,
5680
+ class: "text-capitalize",
5681
+ onClick: $event => (_ctx.changeKey('order_by',title.key))
5682
+ }, vue.toDisplayString(title.label ?? title.key.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_16))
5683
+ : (typeof title === 'function')
5684
+ ? (vue.openBlock(), vue.createElementBlock("a", {
5685
+ key: 2,
5686
+ class: "text-capitalize",
5687
+ onClick: $event => (_ctx.changeKey('order_by',title(null)))
5688
+ }, vue.toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_17))
5689
+ : (typeof title !== 'undefined')
5690
+ ? (vue.openBlock(), vue.createElementBlock("a", {
5691
+ key: 3,
5692
+ class: "text-capitalize",
5693
+ onClick: $event => (_ctx.changeKey('order_by',title))
5694
+ }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_18))
5695
+ : vue.createCommentVNode("v-if", true)
5696
+ ]))
5697
+ : vue.createCommentVNode("v-if", true)
5698
+ ], 64 /* STABLE_FRAGMENT */))
5688
5699
  }), 128 /* KEYED_FRAGMENT */)),
5689
5700
  (__props.actions)
5690
- ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_18, vue.toDisplayString(__props.actions.label), 1 /* TEXT */))
5701
+ ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_19, vue.toDisplayString(__props.actions.label), 1 /* TEXT */))
5691
5702
  : vue.createCommentVNode("v-if", true)
5692
5703
  ])
5693
5704
  ]),
5694
- vue.createElementVNode("tbody", _hoisted_19, [
5705
+ vue.createElementVNode("tbody", _hoisted_20, [
5695
5706
  (_ctx.loading === 'loading')
5696
- ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_20, [
5707
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_21, [
5697
5708
  vue.createElementVNode("td", {
5698
5709
  colspan: _ctx.tableHeaders.length
5699
5710
  }, _cache[15] || (_cache[15] = [
@@ -5705,22 +5716,22 @@ return (_ctx, _cache) => {
5705
5716
  vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
5706
5717
  ])
5707
5718
  ], -1 /* HOISTED */)
5708
- ]), 8 /* PROPS */, _hoisted_21)
5719
+ ]), 8 /* PROPS */, _hoisted_22)
5709
5720
  ]))
5710
5721
  : (_ctx.loading === 'error')
5711
- ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_22, [
5722
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_23, [
5712
5723
  vue.createElementVNode("td", {
5713
5724
  colspan: _ctx.tableHeaders.length
5714
- }, vue.toDisplayString(_ctx.loading_error), 9 /* TEXT, PROPS */, _hoisted_23)
5725
+ }, vue.toDisplayString(_ctx.loading_error), 9 /* TEXT, PROPS */, _hoisted_24)
5715
5726
  ]))
5716
5727
  : (_ctx.records.length === 0)
5717
- ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_24, [
5728
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_25, [
5718
5729
  vue.createElementVNode("td", {
5719
5730
  colspan: __props.actions ? _ctx.tableHeaders.length + 1 : _ctx.tableHeaders.length
5720
5731
  }, _cache[16] || (_cache[16] = [
5721
5732
  vue.createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */),
5722
5733
  vue.createTextVNode(" No records found ")
5723
- ]), 8 /* PROPS */, _hoisted_25)
5734
+ ]), 8 /* PROPS */, _hoisted_26)
5724
5735
  ]))
5725
5736
  : (_ctx.loading === 'done')
5726
5737
  ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList(_ctx.records, (record, index) => {
@@ -5730,60 +5741,64 @@ return (_ctx, _cache) => {
5730
5741
  onClick: $event => (_ctx.rowSelected(record))
5731
5742
  }, [
5732
5743
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.tableHeaders, (key) => {
5733
- return (vue.openBlock(), vue.createElementBlock("td", { key: key }, [
5734
- (typeof key === 'string' && __props.links && __props.links[key])
5735
- ? (vue.openBlock(), vue.createBlock(_component_router_link, {
5736
- key: 0,
5737
- target: __props.links[key].target ? '_blank':'',
5738
- to: _ctx.replaceLinkUrl(__props.links[key],record),
5739
- class: vue.normalizeClass(_ctx.getLinkClass(__props.links[key])),
5740
- innerHTML: record[key]
5741
- }, null, 8 /* PROPS */, ["target", "to", "class", "innerHTML"]))
5742
- : (_ctx.getFieldType(key) === 'numeric')
5743
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_27, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5744
- : (_ctx.getFieldType(key) === 'money')
5745
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_28, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5746
- : (_ctx.getFieldType(key) === 'date')
5747
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_29, vue.toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
5748
- : (typeof key === 'string')
5749
- ? (vue.openBlock(), vue.createElementBlock("span", {
5750
- key: 4,
5751
- innerHTML: record[key]
5752
- }, null, 8 /* PROPS */, _hoisted_30))
5753
- : (typeof key === 'function')
5754
- ? (vue.openBlock(), vue.createElementBlock("span", {
5755
- key: 5,
5756
- innerHTML: key(record, index)
5757
- }, null, 8 /* PROPS */, _hoisted_31))
5758
- : (typeof key === 'object' && key.callBack)
5759
- ? (vue.openBlock(), vue.createElementBlock("span", {
5760
- key: 6,
5761
- innerHTML: key.callBack(record, index)
5762
- }, null, 8 /* PROPS */, _hoisted_32))
5763
- : (typeof key === 'object' && key.callback)
5744
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: key }, [
5745
+ (showColumn(key))
5746
+ ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_28, [
5747
+ (typeof key === 'string' && __props.links && __props.links[key])
5748
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
5749
+ key: 0,
5750
+ target: __props.links[key].target ? '_blank':'',
5751
+ to: _ctx.replaceLinkUrl(__props.links[key],record),
5752
+ class: vue.normalizeClass(_ctx.getLinkClass(__props.links[key])),
5753
+ innerHTML: record[key]
5754
+ }, null, 8 /* PROPS */, ["target", "to", "class", "innerHTML"]))
5755
+ : (_ctx.getFieldType(key) === 'numeric')
5756
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_29, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5757
+ : (_ctx.getFieldType(key) === 'money')
5758
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_30, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5759
+ : (_ctx.getFieldType(key) === 'date')
5760
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_31, vue.toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
5761
+ : (typeof key === 'string')
5764
5762
  ? (vue.openBlock(), vue.createElementBlock("span", {
5765
- key: 7,
5766
- innerHTML: key.callback(record, index)
5767
- }, null, 8 /* PROPS */, _hoisted_33))
5768
- : (typeof key === 'object' && key.component)
5769
- ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
5770
- key: 8,
5771
- item: record,
5772
- ref_for: true
5773
- }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5774
- : (typeof key === 'object')
5763
+ key: 4,
5764
+ innerHTML: record[key]
5765
+ }, null, 8 /* PROPS */, _hoisted_32))
5766
+ : (typeof key === 'function')
5767
+ ? (vue.openBlock(), vue.createElementBlock("span", {
5768
+ key: 5,
5769
+ innerHTML: key(record, index)
5770
+ }, null, 8 /* PROPS */, _hoisted_33))
5771
+ : (typeof key === 'object' && key.callBack)
5775
5772
  ? (vue.openBlock(), vue.createElementBlock("span", {
5776
- key: 9,
5777
- innerHTML: record[key.key ?? key.field]
5773
+ key: 6,
5774
+ innerHTML: key.callBack(record, index)
5778
5775
  }, null, 8 /* PROPS */, _hoisted_34))
5779
- : (vue.openBlock(), vue.createElementBlock("span", {
5780
- key: 10,
5781
- innerHTML: record[key[0]]
5782
- }, null, 8 /* PROPS */, _hoisted_35))
5783
- ]))
5776
+ : (typeof key === 'object' && key.callback)
5777
+ ? (vue.openBlock(), vue.createElementBlock("span", {
5778
+ key: 7,
5779
+ innerHTML: key.callback(record, index)
5780
+ }, null, 8 /* PROPS */, _hoisted_35))
5781
+ : (typeof key === 'object' && key.component)
5782
+ ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
5783
+ key: 8,
5784
+ item: record,
5785
+ ref_for: true
5786
+ }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5787
+ : (typeof key === 'object')
5788
+ ? (vue.openBlock(), vue.createElementBlock("span", {
5789
+ key: 9,
5790
+ innerHTML: record[key.key ?? key.field]
5791
+ }, null, 8 /* PROPS */, _hoisted_36))
5792
+ : (vue.openBlock(), vue.createElementBlock("span", {
5793
+ key: 10,
5794
+ innerHTML: record[key[0]]
5795
+ }, null, 8 /* PROPS */, _hoisted_37))
5796
+ ]))
5797
+ : vue.createCommentVNode("v-if", true)
5798
+ ], 64 /* STABLE_FRAGMENT */))
5784
5799
  }), 128 /* KEYED_FRAGMENT */)),
5785
5800
  (__props.actions)
5786
- ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_36, [
5801
+ ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_38, [
5787
5802
  vue.createVNode(script$g, {
5788
5803
  emitAction: _ctx.doEmitAction,
5789
5804
  actions: __props.actions,
@@ -5791,14 +5806,14 @@ return (_ctx, _cache) => {
5791
5806
  }, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
5792
5807
  ]))
5793
5808
  : vue.createCommentVNode("v-if", true)
5794
- ], 10 /* CLASS, PROPS */, _hoisted_26))
5809
+ ], 10 /* CLASS, PROPS */, _hoisted_27))
5795
5810
  }), 128 /* KEYED_FRAGMENT */))
5796
5811
  : vue.createCommentVNode("v-if", true)
5797
5812
  ])
5798
5813
  ], 2 /* CLASS */))
5799
- : (vue.openBlock(), vue.createElementBlock("div", _hoisted_37, [
5814
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_39, [
5800
5815
  (_ctx.loading === 'loading')
5801
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_38, _cache[17] || (_cache[17] = [
5816
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_40, _cache[17] || (_cache[17] = [
5802
5817
  vue.createElementVNode("div", { class: "text-center" }, [
5803
5818
  vue.createElementVNode("div", {
5804
5819
  class: "spinner-border",
@@ -5809,11 +5824,11 @@ return (_ctx, _cache) => {
5809
5824
  ], -1 /* HOISTED */)
5810
5825
  ])))
5811
5826
  : (_ctx.loading === 'error')
5812
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_39, [
5827
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_41, [
5813
5828
  vue.createElementVNode("span", null, vue.toDisplayString(_ctx.loading_error), 1 /* TEXT */)
5814
5829
  ]))
5815
5830
  : (_ctx.loading === 'done')
5816
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_40, [
5831
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_42, [
5817
5832
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.records, (record, index) => {
5818
5833
  return (vue.openBlock(), vue.createElementBlock("div", {
5819
5834
  key: record.id,
@@ -5824,68 +5839,72 @@ return (_ctx, _cache) => {
5824
5839
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
5825
5840
  key: key[0]
5826
5841
  }, [
5827
- (typeof key === 'string' )
5828
- ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_42, vue.toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
5829
- : (typeof key === 'function')
5830
- ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_43, vue.toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
5831
- : (typeof key === 'object')
5832
- ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_44, vue.toDisplayString(key.label ?? key.key.replace(/_/g, ' ')), 1 /* TEXT */))
5833
- : (vue.openBlock(), vue.createElementBlock("p", _hoisted_45, vue.toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
5834
- vue.createElementVNode("span", null, [
5835
- (typeof key === 'string' && __props.links && __props.links[key])
5836
- ? (vue.openBlock(), vue.createBlock(_component_router_link, {
5837
- key: 0,
5838
- to: _ctx.replaceLinkUrl(__props.links[key],record),
5839
- class: vue.normalizeClass(_ctx.getLinkClass(__props.links[key])),
5840
- innerHTML: record[key]
5841
- }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
5842
- : (_ctx.getFieldType(key) === 'numeric')
5843
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_46, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5844
- : (_ctx.getFieldType(key) === 'money')
5845
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_47, "KES " + vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5846
- : (_ctx.getFieldType(key) === 'date')
5847
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_48, vue.toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
5848
- : (typeof key === 'string')
5849
- ? (vue.openBlock(), vue.createElementBlock("span", {
5850
- key: 4,
5851
- innerHTML: record[key]
5852
- }, null, 8 /* PROPS */, _hoisted_49))
5853
- : (typeof key === 'object' && key.callBack)
5854
- ? (vue.openBlock(), vue.createElementBlock("span", {
5855
- key: 5,
5856
- innerHTML: key.callBack(record, index)
5857
- }, null, 8 /* PROPS */, _hoisted_50))
5858
- : (typeof key === 'object' && key.callback)
5859
- ? (vue.openBlock(), vue.createElementBlock("span", {
5860
- key: 6,
5861
- innerHTML: key.callback(record, index)
5862
- }, null, 8 /* PROPS */, _hoisted_51))
5863
- : (typeof key === 'object' && key.component)
5864
- ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
5865
- key: 7,
5866
- item: record,
5867
- ref_for: true
5868
- }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5869
- : (typeof key === 'object')
5842
+ (showColumn(key))
5843
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
5844
+ (typeof key === 'string' )
5845
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_44, vue.toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
5846
+ : (typeof key === 'function')
5847
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_45, vue.toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
5848
+ : (typeof key === 'object')
5849
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_46, vue.toDisplayString(key.label ?? key.key.replace(/_/g, ' ')), 1 /* TEXT */))
5850
+ : (vue.openBlock(), vue.createElementBlock("p", _hoisted_47, vue.toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
5851
+ vue.createElementVNode("span", null, [
5852
+ (typeof key === 'string' && __props.links && __props.links[key])
5853
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
5854
+ key: 0,
5855
+ to: _ctx.replaceLinkUrl(__props.links[key],record),
5856
+ class: vue.normalizeClass(_ctx.getLinkClass(__props.links[key])),
5857
+ innerHTML: record[key]
5858
+ }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
5859
+ : (_ctx.getFieldType(key) === 'numeric')
5860
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_48, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5861
+ : (_ctx.getFieldType(key) === 'money')
5862
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_49, "KES " + vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5863
+ : (_ctx.getFieldType(key) === 'date')
5864
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_50, vue.toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
5865
+ : (typeof key === 'string')
5866
+ ? (vue.openBlock(), vue.createElementBlock("span", {
5867
+ key: 4,
5868
+ innerHTML: record[key]
5869
+ }, null, 8 /* PROPS */, _hoisted_51))
5870
+ : (typeof key === 'object' && key.callBack)
5870
5871
  ? (vue.openBlock(), vue.createElementBlock("span", {
5871
- key: 8,
5872
- innerHTML: record[key.key ?? key.field]
5872
+ key: 5,
5873
+ innerHTML: key.callBack(record, index)
5873
5874
  }, null, 8 /* PROPS */, _hoisted_52))
5874
- : (typeof key === 'function')
5875
+ : (typeof key === 'object' && key.callback)
5875
5876
  ? (vue.openBlock(), vue.createElementBlock("span", {
5876
- key: 9,
5877
- innerHTML: key(record, index )
5877
+ key: 6,
5878
+ innerHTML: key.callback(record, index)
5878
5879
  }, null, 8 /* PROPS */, _hoisted_53))
5879
- : (vue.openBlock(), vue.createElementBlock("span", {
5880
- key: 10,
5881
- innerHTML: record[key[0]]
5882
- }, null, 8 /* PROPS */, _hoisted_54))
5883
- ]),
5880
+ : (typeof key === 'object' && key.component)
5881
+ ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
5882
+ key: 7,
5883
+ item: record,
5884
+ ref_for: true
5885
+ }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5886
+ : (typeof key === 'object')
5887
+ ? (vue.openBlock(), vue.createElementBlock("span", {
5888
+ key: 8,
5889
+ innerHTML: record[key.key ?? key.field]
5890
+ }, null, 8 /* PROPS */, _hoisted_54))
5891
+ : (typeof key === 'function')
5892
+ ? (vue.openBlock(), vue.createElementBlock("span", {
5893
+ key: 9,
5894
+ innerHTML: key(record, index )
5895
+ }, null, 8 /* PROPS */, _hoisted_55))
5896
+ : (vue.openBlock(), vue.createElementBlock("span", {
5897
+ key: 10,
5898
+ innerHTML: record[key[0]]
5899
+ }, null, 8 /* PROPS */, _hoisted_56))
5900
+ ])
5901
+ ], 64 /* STABLE_FRAGMENT */))
5902
+ : vue.createCommentVNode("v-if", true),
5884
5903
  _cache[18] || (_cache[18] = vue.createElementVNode("hr", { class: "my-2" }, null, -1 /* HOISTED */))
5885
5904
  ], 64 /* STABLE_FRAGMENT */))
5886
5905
  }), 128 /* KEYED_FRAGMENT */)),
5887
5906
  (__props.actions)
5888
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_55, [
5907
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_57, [
5889
5908
  vue.createVNode(script$g, {
5890
5909
  emitAction: _ctx.doEmitAction,
5891
5910
  actions: __props.actions,
@@ -5893,7 +5912,7 @@ return (_ctx, _cache) => {
5893
5912
  }, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
5894
5913
  ]))
5895
5914
  : vue.createCommentVNode("v-if", true)
5896
- ], 8 /* PROPS */, _hoisted_41))
5915
+ ], 8 /* PROPS */, _hoisted_43))
5897
5916
  }), 128 /* KEYED_FRAGMENT */))
5898
5917
  ]))
5899
5918
  : vue.createCommentVNode("v-if", true)
package/dist/library.mjs CHANGED
@@ -92,7 +92,6 @@ function setTabCounts(url){
92
92
  }
93
93
 
94
94
  function formatHttpCatchError(reason){
95
- console.log(reason);
96
95
  let error = '';
97
96
  if (typeof reason !== 'undefined') {
98
97
  if (typeof reason.response !== 'undefined') {
@@ -123,14 +122,12 @@ function formatHttpCatchError(reason){
123
122
 
124
123
  function getMenuCount(url){
125
124
  shApis.doGet(url).then(res => {
126
- console.log(res);
127
125
  });
128
126
  }
129
127
 
130
128
  const signOutUser = () => {
131
129
  const loginUrl = getShConfig('loginUrl', 'auth/login');
132
130
  const logoutApiEndPoint = getShConfig('logoutApiEndpoint', 'auth/logout');
133
- console.log(loginUrl, logoutApiEndPoint);
134
131
  shApis.doPost(logoutApiEndPoint).then(res => {
135
132
  shStorage.removeItem('access_token');
136
133
  shStorage.removeItem('user');
@@ -2720,7 +2717,7 @@ var script$y = {
2720
2717
  }
2721
2718
  },
2722
2719
  created: function () {
2723
- console.log('created');
2720
+ // console.log('created')
2724
2721
  if (this.labels) {
2725
2722
  this.allLabels = this.labels;
2726
2723
  }
@@ -3224,7 +3221,6 @@ const modelValueUpdated = (e) => {
3224
3221
  emit('update:modelValue',inputModel);
3225
3222
  };
3226
3223
  onMounted(()=>{
3227
- console.log(props);
3228
3224
  props.modelValue && (inputModel.value = props.modelValue);
3229
3225
  const options = props.data ?? props.options;
3230
3226
  if(options){
@@ -3560,7 +3556,6 @@ const handlefailedRequest = reason => {
3560
3556
  };
3561
3557
  const submitBtnWidth = ref(null);
3562
3558
  const setExistingData = (existingData) => {
3563
- console.log(existingData,props);
3564
3559
  if (existingData) {
3565
3560
  const newFields = formFields.value.map(fl => {
3566
3561
  if (existingData[fl.field]) {
@@ -3579,7 +3574,7 @@ watch(() => props.currentData, (newData) => {
3579
3574
  setExistingData(newData);
3580
3575
  });
3581
3576
  onMounted((ev) => {
3582
- console.log(props);
3577
+
3583
3578
  props.fields && props.fields.map(field => {
3584
3579
  let fieldObj = {};
3585
3580
  if (typeof field === 'object') {
@@ -5088,87 +5083,89 @@ const _hoisted_12$1 = {
5088
5083
  class: "alert alert-danger error-loading"
5089
5084
  };
5090
5085
  const _hoisted_13$1 = { class: "sh-thead" };
5091
- const _hoisted_14$1 = ["onClick"];
5086
+ const _hoisted_14$1 = { key: 0 };
5092
5087
  const _hoisted_15$1 = ["onClick"];
5093
5088
  const _hoisted_16 = ["onClick"];
5094
5089
  const _hoisted_17 = ["onClick"];
5095
- const _hoisted_18 = {
5090
+ const _hoisted_18 = ["onClick"];
5091
+ const _hoisted_19 = {
5096
5092
  key: 0,
5097
5093
  class: "text-capitalize"
5098
5094
  };
5099
- const _hoisted_19 = { class: "sh-tbody" };
5100
- const _hoisted_20 = {
5095
+ const _hoisted_20 = { class: "sh-tbody" };
5096
+ const _hoisted_21 = {
5101
5097
  key: 0,
5102
5098
  class: "text-center"
5103
5099
  };
5104
- const _hoisted_21 = ["colspan"];
5105
- const _hoisted_22 = {
5100
+ const _hoisted_22 = ["colspan"];
5101
+ const _hoisted_23 = {
5106
5102
  key: 1,
5107
5103
  class: "text-center alert alert-danger"
5108
5104
  };
5109
- const _hoisted_23 = ["colspan"];
5110
- const _hoisted_24 = {
5105
+ const _hoisted_24 = ["colspan"];
5106
+ const _hoisted_25 = {
5111
5107
  key: 2,
5112
5108
  class: "text-center alert alert-info no_records"
5113
5109
  };
5114
- const _hoisted_25 = ["colspan"];
5115
- const _hoisted_26 = ["onClick"];
5116
- const _hoisted_27 = { key: 1 };
5117
- const _hoisted_28 = {
5110
+ const _hoisted_26 = ["colspan"];
5111
+ const _hoisted_27 = ["onClick"];
5112
+ const _hoisted_28 = { key: 0 };
5113
+ const _hoisted_29 = { key: 1 };
5114
+ const _hoisted_30 = {
5118
5115
  key: 2,
5119
5116
  class: "text-success fw-bold"
5120
5117
  };
5121
- const _hoisted_29 = { key: 3 };
5122
- const _hoisted_30 = ["innerHTML"];
5123
- const _hoisted_31 = ["innerHTML"];
5118
+ const _hoisted_31 = { key: 3 };
5124
5119
  const _hoisted_32 = ["innerHTML"];
5125
5120
  const _hoisted_33 = ["innerHTML"];
5126
5121
  const _hoisted_34 = ["innerHTML"];
5127
5122
  const _hoisted_35 = ["innerHTML"];
5128
- const _hoisted_36 = {
5123
+ const _hoisted_36 = ["innerHTML"];
5124
+ const _hoisted_37 = ["innerHTML"];
5125
+ const _hoisted_38 = {
5129
5126
  key: 0,
5130
5127
  style: {"white-space":"nowrap"}
5131
5128
  };
5132
- const _hoisted_37 = { key: 5 };
5133
- const _hoisted_38 = {
5129
+ const _hoisted_39 = { key: 5 };
5130
+ const _hoisted_40 = {
5134
5131
  key: 0,
5135
5132
  class: "text-center"
5136
5133
  };
5137
- const _hoisted_39 = { key: 1 };
5138
- const _hoisted_40 = {
5134
+ const _hoisted_41 = { key: 1 };
5135
+ const _hoisted_42 = {
5139
5136
  key: 2,
5140
5137
  class: "mobile-list-items"
5141
5138
  };
5142
- const _hoisted_41 = ["onClick"];
5143
- const _hoisted_42 = {
5139
+ const _hoisted_43 = ["onClick"];
5140
+ const _hoisted_44 = {
5144
5141
  key: 0,
5145
5142
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
5146
5143
  };
5147
- const _hoisted_43 = {
5144
+ const _hoisted_45 = {
5148
5145
  key: 1,
5149
5146
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
5150
5147
  };
5151
- const _hoisted_44 = {
5148
+ const _hoisted_46 = {
5152
5149
  key: 2,
5153
5150
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
5154
5151
  };
5155
- const _hoisted_45 = {
5152
+ const _hoisted_47 = {
5156
5153
  key: 3,
5157
5154
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
5158
5155
  };
5159
- const _hoisted_46 = { key: 1 };
5160
- const _hoisted_47 = {
5156
+ const _hoisted_48 = { key: 1 };
5157
+ const _hoisted_49 = {
5161
5158
  key: 2,
5162
5159
  class: "text-primary fw-bold"
5163
5160
  };
5164
- const _hoisted_48 = { key: 3 };
5165
- const _hoisted_49 = ["innerHTML"];
5166
- const _hoisted_50 = ["innerHTML"];
5161
+ const _hoisted_50 = { key: 3 };
5167
5162
  const _hoisted_51 = ["innerHTML"];
5168
5163
  const _hoisted_52 = ["innerHTML"];
5169
5164
  const _hoisted_53 = ["innerHTML"];
5170
5165
  const _hoisted_54 = ["innerHTML"];
5171
- const _hoisted_55 = { key: 0 };
5166
+ const _hoisted_55 = ["innerHTML"];
5167
+ const _hoisted_56 = ["innerHTML"];
5168
+ const _hoisted_57 = { key: 0 };
5172
5169
 
5173
5170
  const __default__ = {
5174
5171
  name: 'sh-table',
@@ -5512,6 +5509,16 @@ const cleanColumn = col=>{
5512
5509
  return newCol
5513
5510
  };
5514
5511
 
5512
+ const showColumn = header=>{
5513
+ if(typeof header === 'string'){
5514
+ return true
5515
+ }
5516
+ if(typeof header === 'object' && header.validator) {
5517
+ return header.validator()
5518
+ }
5519
+ return true
5520
+ };
5521
+
5515
5522
 
5516
5523
  return (_ctx, _cache) => {
5517
5524
  const _component_router_link = resolveComponent("router-link");
@@ -5646,42 +5653,46 @@ return (_ctx, _cache) => {
5646
5653
  createElementVNode("thead", _hoisted_13$1, [
5647
5654
  createElementVNode("tr", null, [
5648
5655
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tableHeaders, (title) => {
5649
- return (openBlock(), createElementBlock("th", { key: title }, [
5650
- (typeof title === 'string')
5651
- ? (openBlock(), createElementBlock("a", {
5652
- key: 0,
5653
- class: "text-capitalize",
5654
- onClick: $event => (_ctx.changeKey('order_by',title))
5655
- }, toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_14$1))
5656
- : (typeof title === 'object')
5657
- ? (openBlock(), createElementBlock("a", {
5658
- key: 1,
5659
- class: "text-capitalize",
5660
- onClick: $event => (_ctx.changeKey('order_by',title.key))
5661
- }, toDisplayString(title.label ?? title.key.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_15$1))
5662
- : (typeof title === 'function')
5663
- ? (openBlock(), createElementBlock("a", {
5664
- key: 2,
5665
- class: "text-capitalize",
5666
- onClick: $event => (_ctx.changeKey('order_by',title(null)))
5667
- }, toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_16))
5668
- : (typeof title !== 'undefined')
5656
+ return (openBlock(), createElementBlock(Fragment, { key: title }, [
5657
+ (showColumn(title))
5658
+ ? (openBlock(), createElementBlock("th", _hoisted_14$1, [
5659
+ (typeof title === 'string')
5669
5660
  ? (openBlock(), createElementBlock("a", {
5670
- key: 3,
5661
+ key: 0,
5671
5662
  class: "text-capitalize",
5672
5663
  onClick: $event => (_ctx.changeKey('order_by',title))
5673
- }, toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_17))
5674
- : createCommentVNode("v-if", true)
5675
- ]))
5664
+ }, toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_15$1))
5665
+ : (typeof title === 'object')
5666
+ ? (openBlock(), createElementBlock("a", {
5667
+ key: 1,
5668
+ class: "text-capitalize",
5669
+ onClick: $event => (_ctx.changeKey('order_by',title.key))
5670
+ }, toDisplayString(title.label ?? title.key.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_16))
5671
+ : (typeof title === 'function')
5672
+ ? (openBlock(), createElementBlock("a", {
5673
+ key: 2,
5674
+ class: "text-capitalize",
5675
+ onClick: $event => (_ctx.changeKey('order_by',title(null)))
5676
+ }, toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_17))
5677
+ : (typeof title !== 'undefined')
5678
+ ? (openBlock(), createElementBlock("a", {
5679
+ key: 3,
5680
+ class: "text-capitalize",
5681
+ onClick: $event => (_ctx.changeKey('order_by',title))
5682
+ }, toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_18))
5683
+ : createCommentVNode("v-if", true)
5684
+ ]))
5685
+ : createCommentVNode("v-if", true)
5686
+ ], 64 /* STABLE_FRAGMENT */))
5676
5687
  }), 128 /* KEYED_FRAGMENT */)),
5677
5688
  (__props.actions)
5678
- ? (openBlock(), createElementBlock("th", _hoisted_18, toDisplayString(__props.actions.label), 1 /* TEXT */))
5689
+ ? (openBlock(), createElementBlock("th", _hoisted_19, toDisplayString(__props.actions.label), 1 /* TEXT */))
5679
5690
  : createCommentVNode("v-if", true)
5680
5691
  ])
5681
5692
  ]),
5682
- createElementVNode("tbody", _hoisted_19, [
5693
+ createElementVNode("tbody", _hoisted_20, [
5683
5694
  (_ctx.loading === 'loading')
5684
- ? (openBlock(), createElementBlock("tr", _hoisted_20, [
5695
+ ? (openBlock(), createElementBlock("tr", _hoisted_21, [
5685
5696
  createElementVNode("td", {
5686
5697
  colspan: _ctx.tableHeaders.length
5687
5698
  }, _cache[15] || (_cache[15] = [
@@ -5693,22 +5704,22 @@ return (_ctx, _cache) => {
5693
5704
  createElementVNode("span", { class: "visually-hidden" }, "Loading...")
5694
5705
  ])
5695
5706
  ], -1 /* HOISTED */)
5696
- ]), 8 /* PROPS */, _hoisted_21)
5707
+ ]), 8 /* PROPS */, _hoisted_22)
5697
5708
  ]))
5698
5709
  : (_ctx.loading === 'error')
5699
- ? (openBlock(), createElementBlock("tr", _hoisted_22, [
5710
+ ? (openBlock(), createElementBlock("tr", _hoisted_23, [
5700
5711
  createElementVNode("td", {
5701
5712
  colspan: _ctx.tableHeaders.length
5702
- }, toDisplayString(_ctx.loading_error), 9 /* TEXT, PROPS */, _hoisted_23)
5713
+ }, toDisplayString(_ctx.loading_error), 9 /* TEXT, PROPS */, _hoisted_24)
5703
5714
  ]))
5704
5715
  : (_ctx.records.length === 0)
5705
- ? (openBlock(), createElementBlock("tr", _hoisted_24, [
5716
+ ? (openBlock(), createElementBlock("tr", _hoisted_25, [
5706
5717
  createElementVNode("td", {
5707
5718
  colspan: __props.actions ? _ctx.tableHeaders.length + 1 : _ctx.tableHeaders.length
5708
5719
  }, _cache[16] || (_cache[16] = [
5709
5720
  createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */),
5710
5721
  createTextVNode(" No records found ")
5711
- ]), 8 /* PROPS */, _hoisted_25)
5722
+ ]), 8 /* PROPS */, _hoisted_26)
5712
5723
  ]))
5713
5724
  : (_ctx.loading === 'done')
5714
5725
  ? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(_ctx.records, (record, index) => {
@@ -5718,60 +5729,64 @@ return (_ctx, _cache) => {
5718
5729
  onClick: $event => (_ctx.rowSelected(record))
5719
5730
  }, [
5720
5731
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tableHeaders, (key) => {
5721
- return (openBlock(), createElementBlock("td", { key: key }, [
5722
- (typeof key === 'string' && __props.links && __props.links[key])
5723
- ? (openBlock(), createBlock(_component_router_link, {
5724
- key: 0,
5725
- target: __props.links[key].target ? '_blank':'',
5726
- to: _ctx.replaceLinkUrl(__props.links[key],record),
5727
- class: normalizeClass(_ctx.getLinkClass(__props.links[key])),
5728
- innerHTML: record[key]
5729
- }, null, 8 /* PROPS */, ["target", "to", "class", "innerHTML"]))
5730
- : (_ctx.getFieldType(key) === 'numeric')
5731
- ? (openBlock(), createElementBlock("span", _hoisted_27, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5732
- : (_ctx.getFieldType(key) === 'money')
5733
- ? (openBlock(), createElementBlock("span", _hoisted_28, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5734
- : (_ctx.getFieldType(key) === 'date')
5735
- ? (openBlock(), createElementBlock("span", _hoisted_29, toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
5736
- : (typeof key === 'string')
5737
- ? (openBlock(), createElementBlock("span", {
5738
- key: 4,
5739
- innerHTML: record[key]
5740
- }, null, 8 /* PROPS */, _hoisted_30))
5741
- : (typeof key === 'function')
5742
- ? (openBlock(), createElementBlock("span", {
5743
- key: 5,
5744
- innerHTML: key(record, index)
5745
- }, null, 8 /* PROPS */, _hoisted_31))
5746
- : (typeof key === 'object' && key.callBack)
5747
- ? (openBlock(), createElementBlock("span", {
5748
- key: 6,
5749
- innerHTML: key.callBack(record, index)
5750
- }, null, 8 /* PROPS */, _hoisted_32))
5751
- : (typeof key === 'object' && key.callback)
5732
+ return (openBlock(), createElementBlock(Fragment, { key: key }, [
5733
+ (showColumn(key))
5734
+ ? (openBlock(), createElementBlock("td", _hoisted_28, [
5735
+ (typeof key === 'string' && __props.links && __props.links[key])
5736
+ ? (openBlock(), createBlock(_component_router_link, {
5737
+ key: 0,
5738
+ target: __props.links[key].target ? '_blank':'',
5739
+ to: _ctx.replaceLinkUrl(__props.links[key],record),
5740
+ class: normalizeClass(_ctx.getLinkClass(__props.links[key])),
5741
+ innerHTML: record[key]
5742
+ }, null, 8 /* PROPS */, ["target", "to", "class", "innerHTML"]))
5743
+ : (_ctx.getFieldType(key) === 'numeric')
5744
+ ? (openBlock(), createElementBlock("span", _hoisted_29, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5745
+ : (_ctx.getFieldType(key) === 'money')
5746
+ ? (openBlock(), createElementBlock("span", _hoisted_30, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5747
+ : (_ctx.getFieldType(key) === 'date')
5748
+ ? (openBlock(), createElementBlock("span", _hoisted_31, toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
5749
+ : (typeof key === 'string')
5752
5750
  ? (openBlock(), createElementBlock("span", {
5753
- key: 7,
5754
- innerHTML: key.callback(record, index)
5755
- }, null, 8 /* PROPS */, _hoisted_33))
5756
- : (typeof key === 'object' && key.component)
5757
- ? (openBlock(), createBlock(resolveDynamicComponent(key.component), mergeProps({
5758
- key: 8,
5759
- item: record,
5760
- ref_for: true
5761
- }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5762
- : (typeof key === 'object')
5751
+ key: 4,
5752
+ innerHTML: record[key]
5753
+ }, null, 8 /* PROPS */, _hoisted_32))
5754
+ : (typeof key === 'function')
5755
+ ? (openBlock(), createElementBlock("span", {
5756
+ key: 5,
5757
+ innerHTML: key(record, index)
5758
+ }, null, 8 /* PROPS */, _hoisted_33))
5759
+ : (typeof key === 'object' && key.callBack)
5763
5760
  ? (openBlock(), createElementBlock("span", {
5764
- key: 9,
5765
- innerHTML: record[key.key ?? key.field]
5761
+ key: 6,
5762
+ innerHTML: key.callBack(record, index)
5766
5763
  }, null, 8 /* PROPS */, _hoisted_34))
5767
- : (openBlock(), createElementBlock("span", {
5768
- key: 10,
5769
- innerHTML: record[key[0]]
5770
- }, null, 8 /* PROPS */, _hoisted_35))
5771
- ]))
5764
+ : (typeof key === 'object' && key.callback)
5765
+ ? (openBlock(), createElementBlock("span", {
5766
+ key: 7,
5767
+ innerHTML: key.callback(record, index)
5768
+ }, null, 8 /* PROPS */, _hoisted_35))
5769
+ : (typeof key === 'object' && key.component)
5770
+ ? (openBlock(), createBlock(resolveDynamicComponent(key.component), mergeProps({
5771
+ key: 8,
5772
+ item: record,
5773
+ ref_for: true
5774
+ }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5775
+ : (typeof key === 'object')
5776
+ ? (openBlock(), createElementBlock("span", {
5777
+ key: 9,
5778
+ innerHTML: record[key.key ?? key.field]
5779
+ }, null, 8 /* PROPS */, _hoisted_36))
5780
+ : (openBlock(), createElementBlock("span", {
5781
+ key: 10,
5782
+ innerHTML: record[key[0]]
5783
+ }, null, 8 /* PROPS */, _hoisted_37))
5784
+ ]))
5785
+ : createCommentVNode("v-if", true)
5786
+ ], 64 /* STABLE_FRAGMENT */))
5772
5787
  }), 128 /* KEYED_FRAGMENT */)),
5773
5788
  (__props.actions)
5774
- ? (openBlock(), createElementBlock("td", _hoisted_36, [
5789
+ ? (openBlock(), createElementBlock("td", _hoisted_38, [
5775
5790
  createVNode(script$g, {
5776
5791
  emitAction: _ctx.doEmitAction,
5777
5792
  actions: __props.actions,
@@ -5779,14 +5794,14 @@ return (_ctx, _cache) => {
5779
5794
  }, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
5780
5795
  ]))
5781
5796
  : createCommentVNode("v-if", true)
5782
- ], 10 /* CLASS, PROPS */, _hoisted_26))
5797
+ ], 10 /* CLASS, PROPS */, _hoisted_27))
5783
5798
  }), 128 /* KEYED_FRAGMENT */))
5784
5799
  : createCommentVNode("v-if", true)
5785
5800
  ])
5786
5801
  ], 2 /* CLASS */))
5787
- : (openBlock(), createElementBlock("div", _hoisted_37, [
5802
+ : (openBlock(), createElementBlock("div", _hoisted_39, [
5788
5803
  (_ctx.loading === 'loading')
5789
- ? (openBlock(), createElementBlock("div", _hoisted_38, _cache[17] || (_cache[17] = [
5804
+ ? (openBlock(), createElementBlock("div", _hoisted_40, _cache[17] || (_cache[17] = [
5790
5805
  createElementVNode("div", { class: "text-center" }, [
5791
5806
  createElementVNode("div", {
5792
5807
  class: "spinner-border",
@@ -5797,11 +5812,11 @@ return (_ctx, _cache) => {
5797
5812
  ], -1 /* HOISTED */)
5798
5813
  ])))
5799
5814
  : (_ctx.loading === 'error')
5800
- ? (openBlock(), createElementBlock("div", _hoisted_39, [
5815
+ ? (openBlock(), createElementBlock("div", _hoisted_41, [
5801
5816
  createElementVNode("span", null, toDisplayString(_ctx.loading_error), 1 /* TEXT */)
5802
5817
  ]))
5803
5818
  : (_ctx.loading === 'done')
5804
- ? (openBlock(), createElementBlock("div", _hoisted_40, [
5819
+ ? (openBlock(), createElementBlock("div", _hoisted_42, [
5805
5820
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.records, (record, index) => {
5806
5821
  return (openBlock(), createElementBlock("div", {
5807
5822
  key: record.id,
@@ -5812,68 +5827,72 @@ return (_ctx, _cache) => {
5812
5827
  return (openBlock(), createElementBlock(Fragment, {
5813
5828
  key: key[0]
5814
5829
  }, [
5815
- (typeof key === 'string' )
5816
- ? (openBlock(), createElementBlock("p", _hoisted_42, toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
5817
- : (typeof key === 'function')
5818
- ? (openBlock(), createElementBlock("p", _hoisted_43, toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
5819
- : (typeof key === 'object')
5820
- ? (openBlock(), createElementBlock("p", _hoisted_44, toDisplayString(key.label ?? key.key.replace(/_/g, ' ')), 1 /* TEXT */))
5821
- : (openBlock(), createElementBlock("p", _hoisted_45, toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
5822
- createElementVNode("span", null, [
5823
- (typeof key === 'string' && __props.links && __props.links[key])
5824
- ? (openBlock(), createBlock(_component_router_link, {
5825
- key: 0,
5826
- to: _ctx.replaceLinkUrl(__props.links[key],record),
5827
- class: normalizeClass(_ctx.getLinkClass(__props.links[key])),
5828
- innerHTML: record[key]
5829
- }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
5830
- : (_ctx.getFieldType(key) === 'numeric')
5831
- ? (openBlock(), createElementBlock("span", _hoisted_46, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5832
- : (_ctx.getFieldType(key) === 'money')
5833
- ? (openBlock(), createElementBlock("span", _hoisted_47, "KES " + toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5834
- : (_ctx.getFieldType(key) === 'date')
5835
- ? (openBlock(), createElementBlock("span", _hoisted_48, toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
5836
- : (typeof key === 'string')
5837
- ? (openBlock(), createElementBlock("span", {
5838
- key: 4,
5839
- innerHTML: record[key]
5840
- }, null, 8 /* PROPS */, _hoisted_49))
5841
- : (typeof key === 'object' && key.callBack)
5842
- ? (openBlock(), createElementBlock("span", {
5843
- key: 5,
5844
- innerHTML: key.callBack(record, index)
5845
- }, null, 8 /* PROPS */, _hoisted_50))
5846
- : (typeof key === 'object' && key.callback)
5847
- ? (openBlock(), createElementBlock("span", {
5848
- key: 6,
5849
- innerHTML: key.callback(record, index)
5850
- }, null, 8 /* PROPS */, _hoisted_51))
5851
- : (typeof key === 'object' && key.component)
5852
- ? (openBlock(), createBlock(resolveDynamicComponent(key.component), mergeProps({
5853
- key: 7,
5854
- item: record,
5855
- ref_for: true
5856
- }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5857
- : (typeof key === 'object')
5830
+ (showColumn(key))
5831
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
5832
+ (typeof key === 'string' )
5833
+ ? (openBlock(), createElementBlock("p", _hoisted_44, toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
5834
+ : (typeof key === 'function')
5835
+ ? (openBlock(), createElementBlock("p", _hoisted_45, toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
5836
+ : (typeof key === 'object')
5837
+ ? (openBlock(), createElementBlock("p", _hoisted_46, toDisplayString(key.label ?? key.key.replace(/_/g, ' ')), 1 /* TEXT */))
5838
+ : (openBlock(), createElementBlock("p", _hoisted_47, toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
5839
+ createElementVNode("span", null, [
5840
+ (typeof key === 'string' && __props.links && __props.links[key])
5841
+ ? (openBlock(), createBlock(_component_router_link, {
5842
+ key: 0,
5843
+ to: _ctx.replaceLinkUrl(__props.links[key],record),
5844
+ class: normalizeClass(_ctx.getLinkClass(__props.links[key])),
5845
+ innerHTML: record[key]
5846
+ }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
5847
+ : (_ctx.getFieldType(key) === 'numeric')
5848
+ ? (openBlock(), createElementBlock("span", _hoisted_48, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5849
+ : (_ctx.getFieldType(key) === 'money')
5850
+ ? (openBlock(), createElementBlock("span", _hoisted_49, "KES " + toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5851
+ : (_ctx.getFieldType(key) === 'date')
5852
+ ? (openBlock(), createElementBlock("span", _hoisted_50, toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
5853
+ : (typeof key === 'string')
5854
+ ? (openBlock(), createElementBlock("span", {
5855
+ key: 4,
5856
+ innerHTML: record[key]
5857
+ }, null, 8 /* PROPS */, _hoisted_51))
5858
+ : (typeof key === 'object' && key.callBack)
5858
5859
  ? (openBlock(), createElementBlock("span", {
5859
- key: 8,
5860
- innerHTML: record[key.key ?? key.field]
5860
+ key: 5,
5861
+ innerHTML: key.callBack(record, index)
5861
5862
  }, null, 8 /* PROPS */, _hoisted_52))
5862
- : (typeof key === 'function')
5863
+ : (typeof key === 'object' && key.callback)
5863
5864
  ? (openBlock(), createElementBlock("span", {
5864
- key: 9,
5865
- innerHTML: key(record, index )
5865
+ key: 6,
5866
+ innerHTML: key.callback(record, index)
5866
5867
  }, null, 8 /* PROPS */, _hoisted_53))
5867
- : (openBlock(), createElementBlock("span", {
5868
- key: 10,
5869
- innerHTML: record[key[0]]
5870
- }, null, 8 /* PROPS */, _hoisted_54))
5871
- ]),
5868
+ : (typeof key === 'object' && key.component)
5869
+ ? (openBlock(), createBlock(resolveDynamicComponent(key.component), mergeProps({
5870
+ key: 7,
5871
+ item: record,
5872
+ ref_for: true
5873
+ }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5874
+ : (typeof key === 'object')
5875
+ ? (openBlock(), createElementBlock("span", {
5876
+ key: 8,
5877
+ innerHTML: record[key.key ?? key.field]
5878
+ }, null, 8 /* PROPS */, _hoisted_54))
5879
+ : (typeof key === 'function')
5880
+ ? (openBlock(), createElementBlock("span", {
5881
+ key: 9,
5882
+ innerHTML: key(record, index )
5883
+ }, null, 8 /* PROPS */, _hoisted_55))
5884
+ : (openBlock(), createElementBlock("span", {
5885
+ key: 10,
5886
+ innerHTML: record[key[0]]
5887
+ }, null, 8 /* PROPS */, _hoisted_56))
5888
+ ])
5889
+ ], 64 /* STABLE_FRAGMENT */))
5890
+ : createCommentVNode("v-if", true),
5872
5891
  _cache[18] || (_cache[18] = createElementVNode("hr", { class: "my-2" }, null, -1 /* HOISTED */))
5873
5892
  ], 64 /* STABLE_FRAGMENT */))
5874
5893
  }), 128 /* KEYED_FRAGMENT */)),
5875
5894
  (__props.actions)
5876
- ? (openBlock(), createElementBlock("div", _hoisted_55, [
5895
+ ? (openBlock(), createElementBlock("div", _hoisted_57, [
5877
5896
  createVNode(script$g, {
5878
5897
  emitAction: _ctx.doEmitAction,
5879
5898
  actions: __props.actions,
@@ -5881,7 +5900,7 @@ return (_ctx, _cache) => {
5881
5900
  }, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
5882
5901
  ]))
5883
5902
  : createCommentVNode("v-if", true)
5884
- ], 8 /* PROPS */, _hoisted_41))
5903
+ ], 8 /* PROPS */, _hoisted_43))
5885
5904
  }), 128 /* KEYED_FRAGMENT */))
5886
5905
  ]))
5887
5906
  : createCommentVNode("v-if", true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "5.3.0",
3
+ "version": "5.3.2",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",