@ticatec/uniface-element 0.3.12 → 0.3.14

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.
@@ -141,6 +141,7 @@
141
141
  // 仅在数值合法时同步 value,此处不触发格式化
142
142
  if (!isNaN(parsed) && utils.isValidNumber(parsed, precision, allowNegative, max, min)) {
143
143
  value = parsed;
144
+ onchange?.(value);
144
145
  }
145
146
  }
146
147
 
@@ -21,6 +21,18 @@
21
21
  let maxFrom;
22
22
  let minTo;
23
23
 
24
+ // 规范化日期值:from设为当天零时,to设为当天23:59:59.999
25
+ const normalizeValue = (date: UniDate, isStart: boolean): Date | null => {
26
+ if (!date) return null;
27
+ return isStart
28
+ ? dayjs(date).startOf('day').toDate()
29
+ : dayjs(date).endOf('day').toDate();
30
+ };
31
+
32
+ // 计算规范化的值(用于内部显示和处理)
33
+ $: normalizedFromValue = normalizeValue(fromValue, true);
34
+ $: normalizedToValue = normalizeValue(toValue, false);
35
+
24
36
 
25
37
  const cleanValue = () => {
26
38
  fromValue = null;
@@ -32,12 +44,12 @@
32
44
  }
33
45
 
34
46
  const handleFormCalendarSelect = (value: dayjs.Dayjs) => {
35
- fromValue = value.toDate();
47
+ fromValue = normalizeValue(value.toDate(), true);
36
48
  }
37
49
 
38
50
 
39
51
  const handleToCalendarSelect = (value: dayjs.Dayjs) => {
40
- toValue = value.toDate();
52
+ toValue = normalizeValue(value.toDate(), false);
41
53
  showPopup = false;
42
54
  }
43
55
 
@@ -45,15 +57,16 @@
45
57
  showPopup = true;
46
58
  }
47
59
 
48
- $: textFrom = toTextValue(fromValue);
49
- $: textTo = toTextValue(toValue);
50
- $: maxFrom = toValue ?? max;
51
- $: minTo = fromValue ?? min;
60
+ // 使用规范化的值进行显示和计算
61
+ $: textFrom = toTextValue(normalizedFromValue);
62
+ $: textTo = toTextValue(normalizedToValue);
63
+ $: maxFrom = normalizedToValue ?? max;
64
+ $: minTo = normalizedFromValue ?? min;
52
65
 
53
66
  let showPopup = false;
54
67
  let rootElement: any;
55
68
 
56
- $: showActionIcon = fromValue != null || toValue != null;
69
+ $: showActionIcon = normalizedFromValue != null || normalizedToValue != null;
57
70
 
58
71
  </script>
59
72
 
@@ -13,6 +13,8 @@
13
13
  export let closeConfirm: DialogCloseConfirm | null = null;
14
14
  export let content$style: string = '';
15
15
 
16
+ export let hideClose: boolean = false;
17
+
16
18
  export let closeAction: ButtonAction | null = null;
17
19
  export let onClose: OnClose | null = null;
18
20
 
@@ -76,7 +78,9 @@
76
78
  }
77
79
  })
78
80
  }
79
- wa.push(closeAction);
81
+ if (!hideClose) {
82
+ wa.push(closeAction);
83
+ }
80
84
  return wa;
81
85
  }
82
86
 
@@ -91,9 +95,11 @@
91
95
  <div class="uniface-dialog-box" style="{dialog$style}; top: {top}px; left: {left}px; width: {width}; height: {height}; ">
92
96
  <div class="title-bar" on:mousedown={handleMouseDown} on:mouseup={handleMouseUp} aria-hidden="true">
93
97
  <div style="flex: 1 1 auto"><span>{title ?? 'New window'}</span></div>
94
- <div style="flex: 0 0 auto; padding-left: 12px">
95
- <i class="icon_google_clear dialog-action-button" aria-hidden="true" on:click={()=>close(ModalResult.Cancel)}></i>
96
- </div>
98
+ {#if !hideClose}
99
+ <div style="flex: 0 0 auto; padding-left: 12px">
100
+ <i class="icon_google_clear dialog-action-button" aria-hidden="true" on:click={()=>close(ModalResult.Cancel)}></i>
101
+ </div>
102
+ {/if}
97
103
  </div>
98
104
  <div class="dialog-content" style={content$style}>
99
105
  <slot></slot>
@@ -26,6 +26,7 @@ declare const Dialog: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWit
26
26
  actions?: ButtonActions | null;
27
27
  closeConfirm?: DialogCloseConfirm | null;
28
28
  content$style?: string;
29
+ hideClose?: boolean;
29
30
  closeAction?: ButtonAction | null;
30
31
  onClose?: OnClose | null;
31
32
  dialog$style?: string;
@@ -120,7 +120,7 @@
120
120
  idleTime = 0;
121
121
  interval = setInterval(() => {
122
122
  idleTime += 100;
123
- if (idleTime >= 500) {
123
+ if (idleTime >= 200) {
124
124
  clearInterval(interval);
125
125
  lazyLoad(text, 1, false);
126
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticatec/uniface-element",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
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",