@iankibetsh/shframework 3.0.9 → 4.0.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.
package/dist/library.js CHANGED
@@ -2094,7 +2094,6 @@ function filterData(e){
2094
2094
  }
2095
2095
  let filterValue = e.target.innerText;
2096
2096
  searchText.value = filterValue;
2097
- console.log(props);
2098
2097
  if (props.url) {
2099
2098
  shApis.doGet(props.url, { all: 1,filter_value: filterValue }).then(res => {
2100
2099
  suggestions.value = res.data.data ?? res.data;
@@ -2107,6 +2106,8 @@ function filterData(e){
2107
2106
  return item
2108
2107
  }
2109
2108
  });
2109
+ } else {
2110
+ console.log("Error: no data or url provided");
2110
2111
  }
2111
2112
  }
2112
2113
 
@@ -2245,7 +2246,8 @@ var script$s = {
2245
2246
  if(this.customComponent && this.customComponent[field]){
2246
2247
  return 'component'
2247
2248
  }
2248
- if(this.suggests && this.suggests.includes(field)){
2249
+ if(this.suggests && this.suggests[field]){
2250
+ // alert('found')
2249
2251
  return 'suggest'
2250
2252
  }
2251
2253
  if(this.editors && this.editors.includes(field)){
@@ -2473,12 +2475,12 @@ var script$s = {
2473
2475
  if (!this.suggests) {
2474
2476
  this.suggests = [];
2475
2477
  }
2476
- this.suggests.push(key);
2478
+ this.suggests[key] = this.fillSelects[key];
2477
2479
  } else if (this.fillSelects[key].data) {
2478
2480
  this.selectData[key] = this.fillSelects[key].data;
2479
2481
  } else {
2480
2482
  shApis.doGet(this.fillSelects[key].url, { all: 1 }).then(res => {
2481
- this.selectData[key] = res.data;
2483
+ this.selectData[key] = res.data.data ?? res.data;
2482
2484
  }).catch(res => {
2483
2485
  console.log(res);
2484
2486
  });
@@ -2694,8 +2696,10 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2694
2696
  "fill-selects": $props.fillSelects[field],
2695
2697
  class: vue.normalizeClass(_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field),
2696
2698
  modelValue: _ctx.form_elements[field],
2697
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2698
- }, null, 8 /* PROPS */, ["select-data", "fill-selects", "class", "modelValue", "onUpdate:modelValue"]))
2699
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2700
+ url: _ctx.suggests[field].url ?? false,
2701
+ data: _ctx.suggests[field].data ?? false
2702
+ }, null, 8 /* PROPS */, ["select-data", "fill-selects", "class", "modelValue", "onUpdate:modelValue", "url", "data"]))
2699
2703
  : vue.createCommentVNode("v-if", true),
2700
2704
  ($options.getFieldType(field) === 'text')
2701
2705
  ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
@@ -4307,7 +4311,7 @@ var script$b = {
4307
4311
  return {
4308
4312
  order_by: '',
4309
4313
  order_method: '',
4310
- per_page: shRepo.getShConfig('tablePerPage', 10),
4314
+ per_page: this.pageCount ?? shRepo.getShConfig('tablePerPage', 10),
4311
4315
  page: 1,
4312
4316
  exactMatch: false,
4313
4317
  filter_value: '',
package/dist/library.mjs CHANGED
@@ -2082,7 +2082,6 @@ function filterData(e){
2082
2082
  }
2083
2083
  let filterValue = e.target.innerText;
2084
2084
  searchText.value = filterValue;
2085
- console.log(props);
2086
2085
  if (props.url) {
2087
2086
  shApis.doGet(props.url, { all: 1,filter_value: filterValue }).then(res => {
2088
2087
  suggestions.value = res.data.data ?? res.data;
@@ -2095,6 +2094,8 @@ function filterData(e){
2095
2094
  return item
2096
2095
  }
2097
2096
  });
2097
+ } else {
2098
+ console.log("Error: no data or url provided");
2098
2099
  }
2099
2100
  }
2100
2101
 
@@ -2233,7 +2234,8 @@ var script$s = {
2233
2234
  if(this.customComponent && this.customComponent[field]){
2234
2235
  return 'component'
2235
2236
  }
2236
- if(this.suggests && this.suggests.includes(field)){
2237
+ if(this.suggests && this.suggests[field]){
2238
+ // alert('found')
2237
2239
  return 'suggest'
2238
2240
  }
2239
2241
  if(this.editors && this.editors.includes(field)){
@@ -2461,12 +2463,12 @@ var script$s = {
2461
2463
  if (!this.suggests) {
2462
2464
  this.suggests = [];
2463
2465
  }
2464
- this.suggests.push(key);
2466
+ this.suggests[key] = this.fillSelects[key];
2465
2467
  } else if (this.fillSelects[key].data) {
2466
2468
  this.selectData[key] = this.fillSelects[key].data;
2467
2469
  } else {
2468
2470
  shApis.doGet(this.fillSelects[key].url, { all: 1 }).then(res => {
2469
- this.selectData[key] = res.data;
2471
+ this.selectData[key] = res.data.data ?? res.data;
2470
2472
  }).catch(res => {
2471
2473
  console.log(res);
2472
2474
  });
@@ -2682,8 +2684,10 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2682
2684
  "fill-selects": $props.fillSelects[field],
2683
2685
  class: normalizeClass(_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field),
2684
2686
  modelValue: _ctx.form_elements[field],
2685
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2686
- }, null, 8 /* PROPS */, ["select-data", "fill-selects", "class", "modelValue", "onUpdate:modelValue"]))
2687
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2688
+ url: _ctx.suggests[field].url ?? false,
2689
+ data: _ctx.suggests[field].data ?? false
2690
+ }, null, 8 /* PROPS */, ["select-data", "fill-selects", "class", "modelValue", "onUpdate:modelValue", "url", "data"]))
2687
2691
  : createCommentVNode("v-if", true),
2688
2692
  ($options.getFieldType(field) === 'text')
2689
2693
  ? withDirectives((openBlock(), createElementBlock("input", {
@@ -4295,7 +4299,7 @@ var script$b = {
4295
4299
  return {
4296
4300
  order_by: '',
4297
4301
  order_method: '',
4298
- per_page: shRepo.getShConfig('tablePerPage', 10),
4302
+ per_page: this.pageCount ?? shRepo.getShConfig('tablePerPage', 10),
4299
4303
  page: 1,
4300
4304
  exactMatch: false,
4301
4305
  filter_value: '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "3.0.9",
3
+ "version": "4.0.2",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",