@ticatec/uniface-element 5.0.2 → 5.0.3

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.
@@ -50,6 +50,23 @@
50
50
  if (disabled) return;
51
51
  focus();
52
52
  }
53
+
54
+ // Only intercept mousedowns that land on the wrapper's own decorative chrome
55
+ // (padding, prefix/suffix, icons) — preventing their default avoids a
56
+ // blur-then-refocus flicker when clicking near the control. A mousedown that
57
+ // originates on the actual form control (input/textarea, including the one
58
+ // rendered by NumberInput.svelte) must NOT be intercepted: preventDefault()
59
+ // there cancels the browser's native text-selection-start behavior for that
60
+ // same event, even though this listener runs on an ancestor during bubbling —
61
+ // that's what made it impossible to drag-select or double-click-select text
62
+ // inside every CommonEditor-based input (SearchBox, TextEditor, PasswordEditor,
63
+ // NumberEditor, TimeEditor, and anything built on CommonPopupEditor).
64
+ const handleContainerMouseDown = (e: MouseEvent) => {
65
+ const tag = (e.target as HTMLElement).tagName;
66
+ if (tag !== 'INPUT' && tag !== 'TEXTAREA') {
67
+ e.preventDefault();
68
+ }
69
+ };
53
70
  </script>
54
71
 
55
72
  <FormEditor {theme} {tooltip} {error} {style} {readonly} {disabled} {compact} {variant}>
@@ -61,7 +78,7 @@
61
78
  <!-- svelte-ignore a11y_click_events_have_key_events -->
62
79
  <!-- svelte-ignore a11y_no_static_element_interactions -->
63
80
  <div class="uniface-common-editor" bind:this={container} {style}
64
- onmousedown={(e: MouseEvent)=>{e.preventDefault()}} onclick={handleContainerClick}>
81
+ onmousedown={handleContainerMouseDown} onclick={handleContainerClick}>
65
82
  {#if leadingIcon}
66
83
  <div class="editor-embed-icon" style="flex: 0 0 auto;">
67
84
  {@render leadingIcon()}
@@ -18,6 +18,7 @@
18
18
 
19
19
  let {
20
20
  variant,
21
+ theme,
21
22
  compact = false,
22
23
  disabled = false,
23
24
  readonly = false,
@@ -68,6 +69,7 @@
68
69
  <CommonEditor
69
70
  bind:this={editorRef}
70
71
  {variant}
72
+ {theme}
71
73
  {compact}
72
74
  {style}
73
75
  {tooltip}
@@ -88,7 +90,7 @@
88
90
  {/snippet}
89
91
 
90
92
  {#if showPopup && getTargetElement()}
91
- <Popover target={getTargetElement()} {autoFit} align="right" onclose={closePopup}>
93
+ <Popover target={getTargetElement()} {autoFit} {theme} align="right" onclose={closePopup}>
92
94
  {#if popupLayer}
93
95
  {@render popupLayer()}
94
96
  {/if}
@@ -31,6 +31,7 @@
31
31
  tooltip,
32
32
  error,
33
33
  variant,
34
+ theme,
34
35
  compact = false,
35
36
  value = $bindable(),
36
37
  precision,
@@ -76,6 +77,7 @@
76
77
  {readonly}
77
78
  {disabled}
78
79
  {variant}
80
+ {theme}
79
81
  {compact}
80
82
  {leadingIcon}
81
83
  {trailingIcon}
@@ -17,6 +17,7 @@
17
17
 
18
18
  let {
19
19
  variant,
20
+ theme,
20
21
  compact = false,
21
22
  disabled = false,
22
23
  readonly = false,
@@ -69,7 +70,7 @@
69
70
  </script>
70
71
 
71
72
 
72
- <CommonPopupEditor bind:this={editorRef} {variant} {compact} {style} {tooltip} {disabled} {readonly} {prefix} autoFit
73
+ <CommonPopupEditor bind:this={editorRef} {variant} {theme} {compact} {style} {tooltip} {disabled} {readonly} {prefix} autoFit
73
74
  {suffix} {clear} textValue={value}>
74
75
  <input bind:this={editor} bind:value {disabled} {readonly} {placeholder} {...eventHandlers}/>
75
76
 
@@ -13,6 +13,7 @@
13
13
 
14
14
  let {
15
15
  variant,
16
+ theme,
16
17
  tooltip,
17
18
  compact = false,
18
19
  style,
@@ -71,7 +72,7 @@
71
72
  };
72
73
  </script>
73
74
 
74
- <CommonEditor {variant} {compact} {tooltip} {style} {disabled} input$class='search-box'>
75
+ <CommonEditor {variant} {theme} {compact} {tooltip} {style} {disabled} input$class='search-box'>
75
76
  {#snippet leadingIcon()}
76
77
  <div style="line-height: 16px; font-size: 18px">
77
78
  <i class="icon_google_search"></i>
@@ -18,6 +18,7 @@
18
18
  disabled = false,
19
19
  readonly = false,
20
20
  variant,
21
+ theme,
21
22
  compact = false,
22
23
  style,
23
24
  value = $bindable(),
@@ -56,7 +57,7 @@
56
57
 
57
58
  </script>
58
59
 
59
- <CommonEditor textValue={value} {clear} {disabled} {readonly} {variant} {compact} {style} {tooltip} {error}>
60
+ <CommonEditor textValue={value} {clear} {disabled} {readonly} {variant} {theme} {compact} {style} {tooltip} {error}>
60
61
  <input bind:this={editor} bind:value type={showPassword ? 'text' : 'password'} {...input$} onchange={handleChangeEvent} {...eventHandlers()} />
61
62
  {#snippet trailingIcon()}
62
63
  <div class="password-icon">
@@ -26,6 +26,7 @@
26
26
  disabled = false,
27
27
  readonly = false,
28
28
  variant,
29
+ theme,
29
30
  compact = false,
30
31
  style,
31
32
  value = $bindable(),
@@ -79,7 +80,7 @@
79
80
  </script>
80
81
 
81
82
 
82
- <CommonEditor textValue={value} {clear} {suffix} {prefix} {readonly} {disabled} {variant} {compact} {leadingIcon} {trailingIcon} {tooltip}
83
+ <CommonEditor textValue={value} {clear} {suffix} {prefix} {readonly} {disabled} {variant} {theme} {compact} {leadingIcon} {trailingIcon} {tooltip}
83
84
  {error}>
84
85
  <input bind:this={editor} {...input$} {placeholder} {...eventHandlers}
85
86
  oninput={handleInput} onchange={handleChange} bind:value/>
@@ -22,6 +22,7 @@
22
22
  mandatory = false,
23
23
  precision = 'M',
24
24
  variant,
25
+ theme,
25
26
  compact = false,
26
27
  style,
27
28
  value = $bindable<number | undefined>(),
@@ -202,6 +203,7 @@
202
203
  {disabled}
203
204
  {readonly}
204
205
  {variant}
206
+ {theme}
205
207
  {compact}
206
208
  {leadingIcon}
207
209
  {trailingIcon}
@@ -9,6 +9,7 @@
9
9
 
10
10
  interface Props {
11
11
  variant?: EditorVariant;
12
+ theme?: string;
12
13
  compact?: boolean;
13
14
  style?: string;
14
15
  tooltip?: string;
@@ -30,6 +31,7 @@
30
31
 
31
32
  let {
32
33
  variant,
34
+ theme,
33
35
  compact = false,
34
36
  style,
35
37
  tooltip,
@@ -161,6 +163,7 @@
161
163
 
162
164
  <CommonPopupEditor bind:this={editorRef}
163
165
  {variant}
166
+ {theme}
164
167
  {error}
165
168
  {compact}
166
169
  {style}
@@ -3,6 +3,7 @@ import type { EditorVariant } from "../types";
3
3
  import type UnitOption from "./UnitOption";
4
4
  interface Props {
5
5
  variant?: EditorVariant;
6
+ theme?: string;
6
7
  compact?: boolean;
7
8
  style?: string;
8
9
  tooltip?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticatec/uniface-element",
3
- "version": "5.0.2",
3
+ "version": "5.0.3",
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",