inviton-powerduck 0.0.188 → 0.0.190
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/components/dropdown/index.tsx +20 -18
- package/package.json +1 -1
|
@@ -65,7 +65,7 @@ interface DropdownListArgs extends FormItemWrapperArgs {
|
|
|
65
65
|
containerCssClass?: string;
|
|
66
66
|
options: Array<string> | Array<DropdownOptionGroup> | Array<any>;
|
|
67
67
|
selected: string | any | Array<string> | Array<any>;
|
|
68
|
-
displayMode?: 'default' | 'inline'
|
|
68
|
+
displayMode?: 'default' | 'inline';
|
|
69
69
|
displayMember?: string | RowToString;
|
|
70
70
|
valueMember?: string | RowToString;
|
|
71
71
|
multiselect?: boolean;
|
|
@@ -144,7 +144,7 @@ class DropdownListComponent extends TsxComponent<DropdownListArgs> implements Dr
|
|
|
144
144
|
@Prop() displayMember!: (row) => string | string;
|
|
145
145
|
@Prop() valueMember!: (row) => string | string;
|
|
146
146
|
@Prop() selected!: string | any | Array<string> | Array<any>;
|
|
147
|
-
@Prop() displayMode?: 'default' | 'inline'
|
|
147
|
+
@Prop() displayMode?: 'default' | 'inline';
|
|
148
148
|
@Prop() changed: (newValue: string | any | Array<string> | Array<any>, exclusivity?: MultiSelectExclusivity) => void;
|
|
149
149
|
@Prop() afterBound: (elem: JQuery<Element>, select2Instance: any) => void;
|
|
150
150
|
@Prop() maxWidth?: number;
|
|
@@ -462,10 +462,10 @@ class DropdownListComponent extends TsxComponent<DropdownListArgs> implements Dr
|
|
|
462
462
|
const self = this;
|
|
463
463
|
return (row) => {
|
|
464
464
|
const retVal = $(`<span class="s2-ri-withtb">${row.text
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
465
|
+
}<button class="s2-trailing-button ${self.trailingButton.cssClass || ''
|
|
466
|
+
} btn-sm">${self.trailingButton.icon != null ? `<i class="${self.trailingButton.icon}"></i> ` : ''
|
|
467
|
+
}${self.trailingButton.text || ''
|
|
468
|
+
}</button></span>`);
|
|
469
469
|
retVal.find('button').click((e) => {
|
|
470
470
|
try {
|
|
471
471
|
clearTimeout(self.preventDefaultTimeout);
|
|
@@ -556,10 +556,10 @@ class DropdownListComponent extends TsxComponent<DropdownListArgs> implements Dr
|
|
|
556
556
|
useListviewBuilder: false,
|
|
557
557
|
formatSelection: this.customRenderSelectionResult != null
|
|
558
558
|
? this.handleCustomRenderResult(
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
559
|
+
h,
|
|
560
|
+
this.customRenderSelectionResult,
|
|
561
|
+
'mobile',
|
|
562
|
+
)
|
|
563
563
|
: null,
|
|
564
564
|
formatResult: this.getCustomFormatOptions(h, 'mobile'),
|
|
565
565
|
onItemSelected: (items, exclusivity) => {
|
|
@@ -760,7 +760,7 @@ class DropdownListComponent extends TsxComponent<DropdownListArgs> implements Dr
|
|
|
760
760
|
}
|
|
761
761
|
|
|
762
762
|
displayInline(): boolean {
|
|
763
|
-
if (this.displayMode == null
|
|
763
|
+
if (this.displayMode == null || this.displayMode == 'default') {
|
|
764
764
|
return false;
|
|
765
765
|
}
|
|
766
766
|
|
|
@@ -1044,7 +1044,7 @@ class DropdownListComponent extends TsxComponent<DropdownListArgs> implements Dr
|
|
|
1044
1044
|
}
|
|
1045
1045
|
|
|
1046
1046
|
const modalContent = $(this.$el).closest('.modal-content');
|
|
1047
|
-
if (modalContent.length > 0) {
|
|
1047
|
+
if (modalContent.length > 0 && !isInline) {
|
|
1048
1048
|
s2Args.dropdownParent = modalContent;
|
|
1049
1049
|
}
|
|
1050
1050
|
|
|
@@ -1303,13 +1303,15 @@ class DropdownListComponent extends TsxComponent<DropdownListArgs> implements Dr
|
|
|
1303
1303
|
instance.dropdown._attachPositioningHandler = () => { };
|
|
1304
1304
|
instance.results.ensureHighlightVisible = () => { };
|
|
1305
1305
|
|
|
1306
|
-
const oldTrigger = instance.dropdown.$search
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1306
|
+
const oldTrigger = instance.dropdown.$search?.trigger;
|
|
1307
|
+
if (oldTrigger != null) {
|
|
1308
|
+
instance.dropdown.$search.trigger = (ev: string) => {
|
|
1309
|
+
if (ev == 'focus') {
|
|
1310
|
+
return;
|
|
1311
|
+
}
|
|
1311
1312
|
|
|
1312
|
-
|
|
1313
|
+
oldTrigger.call(instance.dropdown.$search, ev);
|
|
1314
|
+
};
|
|
1313
1315
|
}
|
|
1314
1316
|
|
|
1315
1317
|
setTimeout(() => {
|