@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
- if (!showPopup) {
195
- hasFocus = false;
196
- onblur?.();
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
  }
@@ -23,6 +23,7 @@ declare const InputOptionsSelect: $$__sveltets_2_IsomorphicComponent<{
23
23
  value?: any;
24
24
  keyField?: string;
25
25
  textField?: string;
26
+ displayCode?: boolean;
26
27
  menu$height?: number;
27
28
  style?: string;
28
29
  placeholder?: string;
@@ -3915,7 +3915,6 @@ root {
3915
3915
  color: var(--uniface-hover-item-color, #42A5F5);
3916
3916
  font-size: 14px;
3917
3917
  width: 16px;
3918
- position: absolute;
3919
3918
  right: 4px;
3920
3919
  cursor: pointer;
3921
3920
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticatec/uniface-element",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "A comprehensive UI component library for Svelte applications with rich form controls, data tables, layouts and interactive elements",
5
5
  "keywords": [
6
6
  "svelte",