@ticatec/uniface-element 0.3.5 → 0.3.7
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.
|
@@ -44,17 +44,17 @@
|
|
|
44
44
|
{#if selectable}
|
|
45
45
|
<input type="checkbox" bind:checked={selected}/>
|
|
46
46
|
{/if}
|
|
47
|
+
{#if indicatorColumn.displayNo}
|
|
48
|
+
<div style="margin-left: 4px; flex: 1 1 auto; text-align: center">
|
|
49
|
+
<span>{rowNo}</span>
|
|
50
|
+
</div>
|
|
51
|
+
{/if}
|
|
47
52
|
|
|
48
53
|
{#if expandable}
|
|
49
|
-
<div class="expand-icon" style="">
|
|
54
|
+
<div class="expand-icon" style="flex: 0 0 auto">
|
|
50
55
|
<i class={row == expandRow ? 'icon_google_folder' : "icon_google_folder_open"} aria-hidden="true" on:click={showInlineData}></i>
|
|
51
56
|
</div>
|
|
52
57
|
{/if}
|
|
53
|
-
{#if indicatorColumn.displayNo}
|
|
54
|
-
<div style="margin-left: 4px; width: 20px; text-align: left">
|
|
55
|
-
<span>{rowNo}</span>
|
|
56
|
-
</div>
|
|
57
|
-
{/if}
|
|
58
58
|
</div>
|
|
59
59
|
{/if}
|
|
60
60
|
{#each cols as column, colIdx}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
export let value: any = null;
|
|
16
16
|
export let keyField: string = "code";
|
|
17
17
|
export let textField: string = "text";
|
|
18
|
+
export let displayCode: boolean = false;
|
|
18
19
|
export let menu$height: number = 0;
|
|
19
20
|
export let style: string = '';
|
|
20
21
|
export let placeholder: string = "";
|
|
@@ -162,8 +163,8 @@
|
|
|
162
163
|
let isUserTyping: boolean = false;
|
|
163
164
|
|
|
164
165
|
const handleInput = () => {
|
|
166
|
+
isUserTyping = true;
|
|
165
167
|
if (!composing) {
|
|
166
|
-
isUserTyping = true;
|
|
167
168
|
text = inputText;
|
|
168
169
|
value = null;
|
|
169
170
|
oninput?.(text);
|
|
@@ -191,10 +192,17 @@
|
|
|
191
192
|
};
|
|
192
193
|
|
|
193
194
|
const handleBlur = (event: FocusEvent) => {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
setTimeout(() => {
|
|
196
|
+
const focused = scrollElement!=null && scrollElement.contains(document.activeElement);
|
|
197
|
+
console.log('当前组合组件是否聚集', focused, value)
|
|
198
|
+
if (!focused) {
|
|
199
|
+
hasFocus = false;
|
|
200
|
+
if (value == null) {
|
|
201
|
+
inputText = '';
|
|
202
|
+
}
|
|
203
|
+
onblur?.();
|
|
204
|
+
}
|
|
205
|
+
}, 50)
|
|
198
206
|
};
|
|
199
207
|
|
|
200
208
|
const clean = () => {
|
|
@@ -222,9 +230,9 @@
|
|
|
222
230
|
// 如果已选择值,根据焦点状态显示keyField或textField
|
|
223
231
|
let selectedItem = options.find(op => op[keyField] == value);
|
|
224
232
|
if (selectedItem) {
|
|
225
|
-
inputText = hasFocus ? selectedItem[keyField] : selectedItem[textField];
|
|
233
|
+
inputText = hasFocus && displayCode ? selectedItem[keyField] : selectedItem[textField];
|
|
226
234
|
} else {
|
|
227
|
-
inputText = hasFocus ? value : text;
|
|
235
|
+
inputText = hasFocus && displayCode ? value : text;
|
|
228
236
|
}
|
|
229
237
|
}
|
|
230
238
|
}
|
package/package.json
CHANGED