@iankibetsh/shframework 3.0.3 → 3.0.4
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/dist/library.mjs.css +15 -15
- package/dist/library.js +8 -13
- package/dist/library.mjs +8 -13
- package/package.json +1 -1
|
@@ -63,21 +63,6 @@
|
|
|
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
|
-
|
|
81
66
|
.permissions-main {
|
|
82
67
|
background: #edeff2;
|
|
83
68
|
}
|
|
@@ -110,6 +95,21 @@
|
|
|
110
95
|
flex-grow: 1;
|
|
111
96
|
}
|
|
112
97
|
|
|
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: ['data','url','
|
|
2034
|
+
props: ['data','url','modelValue'],
|
|
2035
2035
|
emits: ['update:modelValue'],
|
|
2036
2036
|
setup(__props, { emit }) {
|
|
2037
2037
|
|
|
@@ -2048,14 +2048,14 @@ vue.onMounted(() => {
|
|
|
2048
2048
|
resetData();
|
|
2049
2049
|
});
|
|
2050
2050
|
function resetData(){
|
|
2051
|
-
const data = props.data
|
|
2051
|
+
const data = props.data;
|
|
2052
2052
|
if(data) {
|
|
2053
2053
|
suggestions.value = data;
|
|
2054
2054
|
}
|
|
2055
2055
|
}
|
|
2056
2056
|
function addSuggestion(sgn){
|
|
2057
2057
|
let selected = selectedSuggestions.value;
|
|
2058
|
-
if(selected.length > 0 && !props.
|
|
2058
|
+
if(selected.length > 0 && !props.allowMultiple){
|
|
2059
2059
|
selected = [];
|
|
2060
2060
|
}
|
|
2061
2061
|
if(!selected.includes(sgn)){
|
|
@@ -2069,7 +2069,7 @@ function updateModelValue(){
|
|
|
2069
2069
|
let selectedItems = selectedSuggestions.value;
|
|
2070
2070
|
if(selectedItems.length === 0) {
|
|
2071
2071
|
emit('update:modelValue', null);
|
|
2072
|
-
} else if (!props.
|
|
2072
|
+
} else if (!props.allowMultiple) {
|
|
2073
2073
|
emit('update:modelValue', selectedItems[0].id);
|
|
2074
2074
|
} else {
|
|
2075
2075
|
const ids = selectedItems.map(item => {
|
|
@@ -2094,23 +2094,18 @@ function filterData(e){
|
|
|
2094
2094
|
}
|
|
2095
2095
|
let filterValue = e.target.innerText;
|
|
2096
2096
|
searchText.value = filterValue;
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
suggestions.value = propsData.filter(item=>{
|
|
2097
|
+
if(props.data) {
|
|
2098
|
+
suggestions.value = props.data.filter(item=>{
|
|
2100
2099
|
if(item.name.toLowerCase().includes(filterValue.toLowerCase())){
|
|
2101
2100
|
return item
|
|
2102
2101
|
}
|
|
2103
2102
|
});
|
|
2104
|
-
}
|
|
2105
|
-
|
|
2106
|
-
const propsUrl = props.url ?? props.fillSelects.url;
|
|
2107
|
-
if (propsUrl) {
|
|
2108
|
-
shApis.doGet(propsUrl, { all: 1,filter_value: filterValue }).then(res => {
|
|
2103
|
+
} else if (props.url) {
|
|
2104
|
+
shApis.doGet(props.url, { all: 1,filter_value: filterValue }).then(res => {
|
|
2109
2105
|
suggestions.value = res.data.data ?? res.data;
|
|
2110
2106
|
}).catch(res => {
|
|
2111
2107
|
console.log(res);
|
|
2112
2108
|
});
|
|
2113
|
-
}
|
|
2114
2109
|
}
|
|
2115
2110
|
}
|
|
2116
2111
|
|
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: ['data','url','
|
|
2022
|
+
props: ['data','url','modelValue'],
|
|
2023
2023
|
emits: ['update:modelValue'],
|
|
2024
2024
|
setup(__props, { emit }) {
|
|
2025
2025
|
|
|
@@ -2036,14 +2036,14 @@ onMounted(() => {
|
|
|
2036
2036
|
resetData();
|
|
2037
2037
|
});
|
|
2038
2038
|
function resetData(){
|
|
2039
|
-
const data = props.data
|
|
2039
|
+
const data = props.data;
|
|
2040
2040
|
if(data) {
|
|
2041
2041
|
suggestions.value = data;
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
2044
|
function addSuggestion(sgn){
|
|
2045
2045
|
let selected = selectedSuggestions.value;
|
|
2046
|
-
if(selected.length > 0 && !props.
|
|
2046
|
+
if(selected.length > 0 && !props.allowMultiple){
|
|
2047
2047
|
selected = [];
|
|
2048
2048
|
}
|
|
2049
2049
|
if(!selected.includes(sgn)){
|
|
@@ -2057,7 +2057,7 @@ function updateModelValue(){
|
|
|
2057
2057
|
let selectedItems = selectedSuggestions.value;
|
|
2058
2058
|
if(selectedItems.length === 0) {
|
|
2059
2059
|
emit('update:modelValue', null);
|
|
2060
|
-
} else if (!props.
|
|
2060
|
+
} else if (!props.allowMultiple) {
|
|
2061
2061
|
emit('update:modelValue', selectedItems[0].id);
|
|
2062
2062
|
} else {
|
|
2063
2063
|
const ids = selectedItems.map(item => {
|
|
@@ -2082,23 +2082,18 @@ function filterData(e){
|
|
|
2082
2082
|
}
|
|
2083
2083
|
let filterValue = e.target.innerText;
|
|
2084
2084
|
searchText.value = filterValue;
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
suggestions.value = propsData.filter(item=>{
|
|
2085
|
+
if(props.data) {
|
|
2086
|
+
suggestions.value = props.data.filter(item=>{
|
|
2088
2087
|
if(item.name.toLowerCase().includes(filterValue.toLowerCase())){
|
|
2089
2088
|
return item
|
|
2090
2089
|
}
|
|
2091
2090
|
});
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
|
-
const propsUrl = props.url ?? props.fillSelects.url;
|
|
2095
|
-
if (propsUrl) {
|
|
2096
|
-
shApis.doGet(propsUrl, { all: 1,filter_value: filterValue }).then(res => {
|
|
2091
|
+
} else if (props.url) {
|
|
2092
|
+
shApis.doGet(props.url, { all: 1,filter_value: filterValue }).then(res => {
|
|
2097
2093
|
suggestions.value = res.data.data ?? res.data;
|
|
2098
2094
|
}).catch(res => {
|
|
2099
2095
|
console.log(res);
|
|
2100
2096
|
});
|
|
2101
|
-
}
|
|
2102
2097
|
}
|
|
2103
2098
|
}
|
|
2104
2099
|
|