@publishfx/publish-components 2.1.3 → 2.1.5
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.
|
@@ -7,10 +7,11 @@ const generateTimeOptions = (config = {})=>{
|
|
|
7
7
|
const { startHour = 0, endHour = 23, interval = 30, format = "HH:mm" } = config;
|
|
8
8
|
const options = [];
|
|
9
9
|
for(let hour = startHour; hour <= endHour; hour++)for(let minute = 0; minute < 60; minute += interval){
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const hourStr = hour.toString().padStart(2, "0");
|
|
11
|
+
const minuteStr = minute.toString().padStart(2, "0");
|
|
12
|
+
const timeValue = format.replace("HH", hourStr).replace("mm", minuteStr);
|
|
12
13
|
options.push({
|
|
13
|
-
label,
|
|
14
|
+
label: timeValue,
|
|
14
15
|
value: timeValue
|
|
15
16
|
});
|
|
16
17
|
}
|
|
@@ -19,9 +19,6 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.timePickerSelect_select-xuD_LK .arco-select-view {
|
|
22
|
-
background-color: var(--color-bg-2);
|
|
23
|
-
border: 1px solid var(--color-border-2);
|
|
24
|
-
border-radius: var(--border-radius-small);
|
|
25
22
|
min-height: 32px;
|
|
26
23
|
padding: 4px 12px;
|
|
27
24
|
transition: all .2s;
|
|
@@ -64,9 +61,6 @@
|
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
.timePickerSelect_select-xuD_LK .arco-tag {
|
|
67
|
-
background-color: var(--color-fill-2);
|
|
68
|
-
border: 1px solid var(--color-border-2);
|
|
69
|
-
border-radius: var(--border-radius-small);
|
|
70
64
|
height: 24px;
|
|
71
65
|
color: var(--color-text-1);
|
|
72
66
|
align-items: center;
|
|
@@ -155,7 +149,7 @@
|
|
|
155
149
|
|
|
156
150
|
.optionsGrid-aFw9nI {
|
|
157
151
|
gap: 8px;
|
|
158
|
-
max-height:
|
|
152
|
+
max-height: 312px;
|
|
159
153
|
display: grid;
|
|
160
154
|
overflow-y: auto;
|
|
161
155
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
export interface TimeOption {
|
|
5
5
|
/** 选项标签 */
|
|
6
6
|
label: string;
|
|
7
|
-
/**
|
|
8
|
-
value: string
|
|
7
|
+
/** 选项值(时间字符串,如 "00:00") */
|
|
8
|
+
value: string;
|
|
9
9
|
/** 是否禁用 */
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
}
|
|
@@ -15,12 +15,12 @@ export interface TimeOption {
|
|
|
15
15
|
export interface TimePickerSelectProps {
|
|
16
16
|
/** 时间选项列表 */
|
|
17
17
|
options?: TimeOption[];
|
|
18
|
-
/**
|
|
19
|
-
value?: string[]
|
|
18
|
+
/** 选中的值(受控模式),时间字符串数组,如 ["00:00", "00:30"] */
|
|
19
|
+
value?: string[];
|
|
20
20
|
/** 默认选中的值(非受控模式) */
|
|
21
|
-
defaultValue?: string[]
|
|
21
|
+
defaultValue?: string[];
|
|
22
22
|
/** 选中的值改变时的回调 */
|
|
23
|
-
onChange?: (value: string[]
|
|
23
|
+
onChange?: (value: string[], options: TimeOption[]) => void;
|
|
24
24
|
/** 占位符文本 */
|
|
25
25
|
placeholder?: string;
|
|
26
26
|
/** 是否禁用 */
|