@iankibetsh/shframework 3.0.1 → 3.0.3

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.
@@ -63,6 +63,21 @@
63
63
  color: white;
64
64
  }
65
65
 
66
+ .sh-selected-item{
67
+ line-height: unset!important;
68
+ }
69
+ .sh-suggestion-input{
70
+ padding: 0.375rem 0.75rem;
71
+ }
72
+ .sh-suggest{
73
+ margin-bottom: 1rem;
74
+ }
75
+ .sh-suggest-control::after{
76
+ margin-top: auto;
77
+ margin-bottom: auto;
78
+ margin-right: 0.255em;
79
+ }
80
+
66
81
  .permissions-main {
67
82
  background: #edeff2;
68
83
  }
@@ -95,21 +110,6 @@
95
110
  flex-grow: 1;
96
111
  }
97
112
 
98
- .sh-selected-item{
99
- line-height: unset!important;
100
- }
101
- .sh-suggestion-input{
102
- padding: 0.375rem 0.75rem;
103
- }
104
- .sh-suggest{
105
- margin-bottom: 1rem;
106
- }
107
- .sh-suggest-control::after{
108
- margin-top: auto;
109
- margin-bottom: auto;
110
- margin-right: 0.255em;
111
- }
112
-
113
113
  .sh-forgot-link, .sh-register-link{
114
114
  cursor: pointer;
115
115
  }
package/dist/library.js CHANGED
@@ -2031,7 +2031,7 @@ const _hoisted_10$5 = {
2031
2031
 
2032
2032
  var script$t = {
2033
2033
  __name: 'ShSuggest',
2034
- props: ['fillSelects','modelValue'],
2034
+ props: ['data','url','fillSelects','modelValue'],
2035
2035
  emits: ['update:modelValue'],
2036
2036
  setup(__props, { emit }) {
2037
2037
 
@@ -2048,8 +2048,9 @@ vue.onMounted(() => {
2048
2048
  resetData();
2049
2049
  });
2050
2050
  function resetData(){
2051
- if(props.fillSelects.data) {
2052
- suggestions.value = props.fillSelects.data;
2051
+ const data = props.data ?? props.fillSelects.data;
2052
+ if(data) {
2053
+ suggestions.value = data;
2053
2054
  }
2054
2055
  }
2055
2056
  function addSuggestion(sgn){
@@ -2093,18 +2094,23 @@ function filterData(e){
2093
2094
  }
2094
2095
  let filterValue = e.target.innerText;
2095
2096
  searchText.value = filterValue;
2096
- if(props.fillSelects.data) {
2097
- suggestions.value = props.fillSelects.data.filter(item=>{
2097
+ const propsData = props.data ?? props.fillSelects.data;
2098
+ if(propsData) {
2099
+ suggestions.value = propsData.filter(item=>{
2098
2100
  if(item.name.toLowerCase().includes(filterValue.toLowerCase())){
2099
2101
  return item
2100
2102
  }
2101
2103
  });
2102
- } else {
2103
- shApis.doGet(props.fillSelects.url, { all: 1,filter_value: filterValue }).then(res => {
2104
- suggestions.value = res.data.data;
2105
- }).catch(res => {
2106
- console.log(res);
2107
- });
2104
+ }
2105
+ else {
2106
+ const propsUrl = props.url ?? props.fillSelects.url;
2107
+ if (propsUrl) {
2108
+ shApis.doGet(propsUrl, { all: 1,filter_value: filterValue }).then(res => {
2109
+ suggestions.value = res.data.data ?? res.data;
2110
+ }).catch(res => {
2111
+ console.log(res);
2112
+ });
2113
+ }
2108
2114
  }
2109
2115
  }
2110
2116
 
package/dist/library.mjs CHANGED
@@ -2019,7 +2019,7 @@ const _hoisted_10$5 = {
2019
2019
 
2020
2020
  var script$t = {
2021
2021
  __name: 'ShSuggest',
2022
- props: ['fillSelects','modelValue'],
2022
+ props: ['data','url','fillSelects','modelValue'],
2023
2023
  emits: ['update:modelValue'],
2024
2024
  setup(__props, { emit }) {
2025
2025
 
@@ -2036,8 +2036,9 @@ onMounted(() => {
2036
2036
  resetData();
2037
2037
  });
2038
2038
  function resetData(){
2039
- if(props.fillSelects.data) {
2040
- suggestions.value = props.fillSelects.data;
2039
+ const data = props.data ?? props.fillSelects.data;
2040
+ if(data) {
2041
+ suggestions.value = data;
2041
2042
  }
2042
2043
  }
2043
2044
  function addSuggestion(sgn){
@@ -2081,18 +2082,23 @@ function filterData(e){
2081
2082
  }
2082
2083
  let filterValue = e.target.innerText;
2083
2084
  searchText.value = filterValue;
2084
- if(props.fillSelects.data) {
2085
- suggestions.value = props.fillSelects.data.filter(item=>{
2085
+ const propsData = props.data ?? props.fillSelects.data;
2086
+ if(propsData) {
2087
+ suggestions.value = propsData.filter(item=>{
2086
2088
  if(item.name.toLowerCase().includes(filterValue.toLowerCase())){
2087
2089
  return item
2088
2090
  }
2089
2091
  });
2090
- } else {
2091
- shApis.doGet(props.fillSelects.url, { all: 1,filter_value: filterValue }).then(res => {
2092
- suggestions.value = res.data.data;
2093
- }).catch(res => {
2094
- console.log(res);
2095
- });
2092
+ }
2093
+ else {
2094
+ const propsUrl = props.url ?? props.fillSelects.url;
2095
+ if (propsUrl) {
2096
+ shApis.doGet(propsUrl, { all: 1,filter_value: filterValue }).then(res => {
2097
+ suggestions.value = res.data.data ?? res.data;
2098
+ }).catch(res => {
2099
+ console.log(res);
2100
+ });
2101
+ }
2096
2102
  }
2097
2103
  }
2098
2104
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",