selective-ui 1.3.0 → 1.4.0
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/selective-ui.css +3 -4
- package/dist/selective-ui.css.map +1 -1
- package/dist/selective-ui.esm.js +23 -10
- package/dist/selective-ui.esm.js.map +1 -1
- package/dist/selective-ui.esm.min.js +2 -2
- package/dist/selective-ui.esm.min.js.br +0 -0
- package/dist/selective-ui.min.css +1 -1
- package/dist/selective-ui.min.css.br +0 -0
- package/dist/selective-ui.min.js +2 -2
- package/dist/selective-ui.min.js.br +0 -0
- package/dist/selective-ui.umd.js +24 -11
- package/dist/selective-ui.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/css/components/placeholder.css +3 -4
- package/src/ts/components/selectbox.ts +23 -9
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
.seui-placeholder {
|
|
2
|
-
display: flex;
|
|
3
2
|
align-items: center;
|
|
4
3
|
|
|
5
4
|
margin-left: 10px;
|
|
6
|
-
max-width: calc(100% -
|
|
7
|
-
height: calc(100% - 10px);
|
|
5
|
+
max-width: calc(100% - 40px);
|
|
8
6
|
text-overflow: ellipsis;
|
|
9
7
|
white-space: nowrap;
|
|
10
8
|
pointer-events: none;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
|
|
11
11
|
font-family: var(--seui-view-text-style);
|
|
12
12
|
font-size: var(--seui-view-text-size) !important;
|
|
13
|
-
overflow: hidden;
|
|
14
13
|
color: var(--seui-view-text-color);
|
|
15
14
|
}
|
|
@@ -867,6 +867,23 @@ export class SelectBox extends Lifecycle {
|
|
|
867
867
|
this.change(false, trigger);
|
|
868
868
|
},
|
|
869
869
|
|
|
870
|
+
deSelectByDataset(_evtToken?: IEventCallback, dataset?: any, trigger: boolean = true) {
|
|
871
|
+
if (dataset) {
|
|
872
|
+
superThis.getModelOption().forEach(optionModel => {
|
|
873
|
+
if (optionModel.dataset) {
|
|
874
|
+
for (let searchKey in dataset) {
|
|
875
|
+
let value = dataset[searchKey];
|
|
876
|
+
!Array.isArray(value) && (value = [value]);
|
|
877
|
+
if (value.includes(optionModel.dataset[searchKey])) {
|
|
878
|
+
optionModel.selectedNonTrigger = false;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
this.change(false, trigger);
|
|
884
|
+
}
|
|
885
|
+
},
|
|
886
|
+
|
|
870
887
|
setValue(_evtToken: IEventCallback | null = null, value: any, trigger: boolean = true, force: boolean = false) {
|
|
871
888
|
if (!Array.isArray(value)) value = [value];
|
|
872
889
|
value = value.filter((v: any) => v !== "" && v != null);
|
|
@@ -899,18 +916,15 @@ export class SelectBox extends Lifecycle {
|
|
|
899
916
|
const result = await container.searchController.loadByValues(missing);
|
|
900
917
|
if (result.success && result.items.length > 0) {
|
|
901
918
|
result.items.forEach((it: any) => {
|
|
902
|
-
if (missing.includes(it.value)) it.selected = true;
|
|
919
|
+
if (missing.includes(it.value) || missing.includes(it.text)) it.selected = true;
|
|
903
920
|
});
|
|
904
921
|
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
922
|
+
container.searchController.applyAjaxResult?.(result.items, false, false);
|
|
923
|
+
|
|
908
924
|
setTimeout(() => {
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
this.change(false, false);
|
|
913
|
-
}, 100);
|
|
925
|
+
container.searchController.resetPagination();
|
|
926
|
+
this.change(false, trigger);
|
|
927
|
+
}, 200);
|
|
914
928
|
} else if (missing.length > 0) {
|
|
915
929
|
console.warn(`Could not load ${missing.length} values:`, missing);
|
|
916
930
|
}
|