@baishuyun/ai-design 2.0.38 → 2.1.0-alpha.0
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.
- package/.storybook/main.ts +31 -31
- package/.storybook/preview.ts +16 -16
- package/CHANGELOG.md +512 -501
- package/components.json +22 -22
- package/package.json +9 -6
- package/scripts/strip-layers.cjs +41 -41
- package/src/components/abs-fullscreen-gradient-bg.tsx +35 -35
- package/src/components/agent-helper/agent-category-select-menu/index.tsx +57 -57
- package/src/components/agent-helper/agent-entry-card/index.tsx +94 -94
- package/src/components/agent-helper/agent-helper-card/index.tsx +179 -179
- package/src/components/agent-helper/agent-helper-card-list/index.tsx +59 -59
- package/src/components/agent-helper/agent-helper-main-layout/index.tsx +60 -60
- package/src/components/agent-helper/agent-sort-select/index.tsx +89 -89
- package/src/components/agent-helper/agent-tag/index.tsx +29 -29
- package/src/components/agent-helper/app-select/index.tsx +559 -559
- package/src/components/agent-helper/condition-group/index.tsx +75 -75
- package/src/components/agent-helper/condition-input/index.tsx +233 -233
- package/src/components/agent-helper/condition-item/index.tsx +237 -237
- package/src/components/agent-helper/condition-quantifier-select/index.tsx +142 -142
- package/src/components/agent-helper/condition-trigger-description/index.tsx +49 -49
- package/src/components/agent-helper/date-picker/calendar-panel.tsx +164 -164
- package/src/components/agent-helper/date-picker/date-input.tsx +91 -91
- package/src/components/agent-helper/date-picker/date-picker.tsx +327 -327
- package/src/components/agent-helper/date-picker/footer-panel.tsx +44 -44
- package/src/components/agent-helper/date-picker/index.ts +3 -3
- package/src/components/agent-helper/date-picker/month-panel.tsx +82 -82
- package/src/components/agent-helper/date-picker/time-panel.tsx +146 -146
- package/src/components/agent-helper/date-picker/types.ts +37 -37
- package/src/components/agent-helper/date-picker/utils.ts +121 -121
- package/src/components/agent-helper/date-picker/year-panel.tsx +86 -86
- package/src/components/agent-helper/exec-log-filter/index.tsx +232 -232
- package/src/components/agent-helper/field-edit-preference-select/index.tsx +291 -291
- package/src/components/agent-helper/field-select/index.tsx +466 -466
- package/src/components/agent-helper/field-value-input/china-address-data.ts +4117 -4117
- package/src/components/agent-helper/field-value-input/display.tsx +71 -71
- package/src/components/agent-helper/field-value-input/icons.tsx +38 -38
- package/src/components/agent-helper/field-value-input/index.tsx +144 -144
- package/src/components/agent-helper/field-value-input/inputs.tsx +247 -247
- package/src/components/agent-helper/field-value-input/picker-inputs.tsx +1141 -1141
- package/src/components/agent-helper/flow-node-action-trigger-select/index.tsx +57 -57
- package/src/components/agent-helper/form-action-trigger-select/index.tsx +60 -60
- package/src/components/agent-helper/form-divider/index.tsx +44 -44
- package/src/components/agent-helper/form-select/index.tsx +732 -732
- package/src/components/agent-helper/monthdays-select/index.tsx +378 -378
- package/src/components/agent-helper/offset-preference-select/index.tsx +268 -268
- package/src/components/agent-helper/offset-type-select/index.tsx +66 -66
- package/src/components/agent-helper/offset-unit-select/index.tsx +54 -54
- package/src/components/agent-helper/placeholder-card/index.tsx +75 -75
- package/src/components/agent-helper/prompt-input/index.tsx +646 -646
- package/src/components/agent-helper/relational-operator-select/index.tsx +179 -179
- package/src/components/agent-helper/repeat-by-type-select/index.tsx +53 -53
- package/src/components/agent-helper/repeat-preference-select/index.tsx +162 -162
- package/src/components/agent-helper/repeat-preference-type-select/index.tsx +58 -58
- package/src/components/agent-helper/search-input/index.tsx +35 -35
- package/src/components/agent-helper/table/index.tsx +114 -114
- package/src/components/agent-helper/trigger-select/index.tsx +121 -121
- package/src/components/agent-helper/trigger-time-preference-select/index.tsx +189 -189
- package/src/components/agent-helper/trigger-time-source-type-select/index.tsx +53 -53
- package/src/components/agent-helper/weekdays-select/index.tsx +230 -230
- package/src/components/agent-scroll-selector.tsx +193 -193
- package/src/components/agent-select.tsx +154 -154
- package/src/components/attachment-part-group.tsx +35 -35
- package/src/components/attachment-part.tsx +296 -296
- package/src/components/attachments-previewer.tsx +272 -272
- package/src/components/base-button.tsx +49 -49
- package/src/components/border-animation.tsx +107 -107
- package/src/components/border-color-animation.tsx +66 -66
- package/src/components/bot-avatar-name.tsx +36 -36
- package/src/components/bot-icon.tsx +23 -23
- package/src/components/bs-entry-select/app-group-folder.tsx +61 -61
- package/src/components/bs-entry-select/bs-entry-select.tsx +296 -296
- package/src/components/bs-entry-select/build-tree.ts +265 -265
- package/src/components/bs-entry-select/entry-item.tsx +45 -45
- package/src/components/bs-entry-select/entry-popover.tsx +99 -99
- package/src/components/bs-entry-select/index.ts +7 -7
- package/src/components/bs-entry-select/other-app-section.tsx +96 -96
- package/src/components/bs-entry-select/scroll-slider.tsx +872 -872
- package/src/components/bs-entry-select/search-input.tsx +4 -4
- package/src/components/bs-entry-select/tree-item-node.tsx +84 -84
- package/src/components/bs-entry-select/types.ts +46 -46
- package/src/components/bs-icons.tsx +1362 -1362
- package/src/components/card-field.tsx +23 -23
- package/src/components/card.tsx +36 -36
- package/src/components/chat-area-header.tsx +65 -65
- package/src/components/check-card.tsx +77 -77
- package/src/components/circle-checker.tsx +66 -66
- package/src/components/collapsible-txt-msg.tsx +75 -75
- package/src/components/collapsible.tsx +9 -9
- package/src/components/confirm-dialog.tsx +139 -139
- package/src/components/date-range-picker.tsx +91 -91
- package/src/components/fake-bot-msg.tsx +51 -51
- package/src/components/field-checker-list-msg.tsx +146 -146
- package/src/components/field-checker.tsx +185 -185
- package/src/components/field-icon.tsx +13 -13
- package/src/components/field-value-checker.tsx +116 -116
- package/src/components/fields-design-info-table.tsx +160 -160
- package/src/components/fields-generating-indicator.tsx +95 -95
- package/src/components/fields-portal.tsx +18 -18
- package/src/components/fields-previewer.tsx +216 -216
- package/src/components/font-icon.tsx +65 -65
- package/src/components/form-info-editor.tsx +263 -263
- package/src/components/formula-tag.tsx +32 -32
- package/src/components/generate-animation.tsx +56 -56
- package/src/components/icon-btn.tsx +43 -43
- package/src/components/icon-card.tsx +67 -67
- package/src/components/icons/calendar-icon.tsx +5 -5
- package/src/components/icons/clear-all-icon.tsx +5 -5
- package/src/components/icons/empty-agent-icon.tsx +93 -93
- package/src/components/icons/empty-table-icon.tsx +104 -104
- package/src/components/icons/grids-icon.tsx +5 -5
- package/src/components/img-part.tsx +27 -27
- package/src/components/legacy-slot.tsx +110 -110
- package/src/components/line-checker.tsx +168 -168
- package/src/components/linear-gradient-border-btn.tsx +48 -48
- package/src/components/linear-gradient-color-bg-animation.tsx +103 -103
- package/src/components/memoized-markdown.tsx +32 -32
- package/src/components/message-content.tsx +21 -21
- package/src/components/number-part.tsx +46 -46
- package/src/components/office-container.tsx +289 -289
- package/src/components/option-item.tsx +27 -27
- package/src/components/output-config-editor.tsx +478 -478
- package/src/components/previewer-header.tsx +270 -270
- package/src/components/primary-confirm-btn.tsx +58 -58
- package/src/components/primary-entry-btn.tsx +48 -48
- package/src/components/radio-card.tsx +63 -63
- package/src/components/scroll-to-bottom-btn.tsx +28 -28
- package/src/components/split-line.tsx +9 -9
- package/src/components/square-checker.tsx +87 -87
- package/src/components/subform-fields-value-checker.tsx +184 -184
- package/src/components/tab-radio-group.tsx +83 -83
- package/src/components/tooltip.tsx +53 -53
- package/src/components/ui/button.tsx +51 -51
- package/src/components/ui/calendar.tsx +57 -57
- package/src/components/ui/dialog.tsx +104 -104
- package/src/components/ui/drawer.tsx +279 -279
- package/src/components/ui/form.tsx +202 -202
- package/src/components/ui/icons.tsx +1267 -1267
- package/src/components/ui/input.tsx +28 -28
- package/src/components/ui/label.tsx +30 -30
- package/src/components/ui/popover.tsx +85 -85
- package/src/components/ui/select.tsx +236 -236
- package/src/components/ui/spinner.tsx +17 -17
- package/src/components/ui/switch.tsx +33 -33
- package/src/components/ui/tabs.tsx +62 -62
- package/src/components/ui/textarea.tsx +28 -28
- package/src/components/ui/tooltip.tsx +53 -53
- package/src/components/user-txt-msg-bubble.tsx +47 -47
- package/src/components/warning-msg.tsx +27 -27
- package/src/const/ui.ts +119 -119
- package/src/css.d.ts +4 -4
- package/src/hooks/use-column-appear.ts +78 -78
- package/src/hooks/use-portal-container.ts +27 -27
- package/src/hooks/use-resizable-width.ts +129 -129
- package/src/hooks/use-select-popover-position.ts +74 -74
- package/src/hooks/use-shadow.ts +127 -127
- package/src/index.ts +226 -226
- package/src/lib/utils.ts +138 -138
- package/src/stories/AbsFullscreenGradientBg.stories.tsx +36 -36
- package/src/stories/AgentCategorySelectMenu.stories.tsx +33 -33
- package/src/stories/AgentEntryCard.stories.tsx +90 -90
- package/src/stories/AgentHelperCard.stories.tsx +105 -105
- package/src/stories/AgentHelperCardList.stories.tsx +120 -120
- package/src/stories/AgentHelperMainLayout.stories.tsx +71 -71
- package/src/stories/AgentScrollSelector.stories.tsx +95 -95
- package/src/stories/AgentSelect.stories.tsx +134 -134
- package/src/stories/AgentTag.stories.tsx +44 -44
- package/src/stories/AppSelect.stories.tsx +250 -250
- package/src/stories/AttachmentPart.stories.tsx +122 -122
- package/src/stories/AttachmentPartGroup.stories.tsx +152 -152
- package/src/stories/AttachmentsPreviewer.stories.tsx +306 -306
- package/src/stories/BaseButton.stories.tsx +33 -33
- package/src/stories/BorderAnimation.stories.tsx +116 -116
- package/src/stories/BorderColorAnimation.stories.tsx +63 -63
- package/src/stories/BotAvatarAndName.stories.ts +24 -24
- package/src/stories/BotIcon.stories.ts +22 -22
- package/src/stories/BsConditionInput.stories.tsx +460 -460
- package/src/stories/BsEntrySelect.stories.tsx +343 -343
- package/src/stories/BsTooltip.stories.tsx +32 -32
- package/src/stories/Card.stories.tsx +28 -28
- package/src/stories/CardField.stories.tsx +87 -87
- package/src/stories/ChatAreaHeader.stories.ts +26 -26
- package/src/stories/CheckCard.stories.tsx +114 -114
- package/src/stories/CircleChecker.stories.tsx +89 -89
- package/src/stories/CollapsibleTextMsg.stories.ts +44 -44
- package/src/stories/ConditionGroup.stories.tsx +216 -216
- package/src/stories/ConditionInput.stories.tsx +502 -502
- package/src/stories/ConditionItem.stories.tsx +163 -163
- package/src/stories/ConditonQuantifierSelect.stories.tsx +54 -54
- package/src/stories/ConditonTriggerDescription.stories.tsx +61 -61
- package/src/stories/ConfirmDialog.stories.tsx +123 -123
- package/src/stories/DataTable.stories.tsx +191 -191
- package/src/stories/DatePicker.stories.tsx +174 -174
- package/src/stories/ExecLogFilter.stories.tsx +145 -145
- package/src/stories/FakeBotMsg.stories.tsx +36 -36
- package/src/stories/FieldEditPreferenceSelect.stories.tsx +161 -161
- package/src/stories/FieldSelect.stories.tsx +228 -228
- package/src/stories/FieldValueInput.stories.tsx +442 -442
- package/src/stories/FlowNodeActionTriggerSelect.stories.tsx +80 -80
- package/src/stories/Form.stories.tsx +302 -302
- package/src/stories/FormActionTriggerSelect.stories.tsx +80 -80
- package/src/stories/FormDivider.stories.tsx +31 -31
- package/src/stories/FormInfoEditor.stories.tsx +173 -173
- package/src/stories/FormSelect.stories.tsx +222 -222
- package/src/stories/FormulaTag.stories.tsx +68 -68
- package/src/stories/GenerateAnimation.stories.ts +20 -20
- package/src/stories/IconBtn.stories.tsx +32 -32
- package/src/stories/IconCard.stories.tsx +35 -35
- package/src/stories/IconLib.tsx +45 -45
- package/src/stories/Icons.stories.ts +22 -22
- package/src/stories/ImgMsgPart.stories.tsx +42 -42
- package/src/stories/Input.stories.tsx +102 -102
- package/src/stories/Label.stories.tsx +66 -66
- package/src/stories/LegacySlot.stories.tsx +56 -56
- package/src/stories/LineChecker.stories.tsx +133 -133
- package/src/stories/LinearGradientBorderBtn.stories.tsx +86 -86
- package/src/stories/LinearGradientColorBgAnimation.stories.tsx +60 -60
- package/src/stories/MemoizedMarkdown.stories.tsx +102 -102
- package/src/stories/MessageContent.stories.tsx +36 -36
- package/src/stories/MonthdaysSelect.stories.tsx +78 -78
- package/src/stories/NumbersMsgPart.stories.tsx +42 -42
- package/src/stories/OfficeContainer.stories.tsx +287 -287
- package/src/stories/OffsetPreferenceSelect.stories.tsx +118 -118
- package/src/stories/OffsetTypeSelect.stories.tsx +75 -75
- package/src/stories/OffsetUnitSelect.stories.tsx +61 -61
- package/src/stories/OptionItem.stories.tsx +77 -77
- package/src/stories/OutputConfigEditor.stories.tsx +96 -96
- package/src/stories/PlaceholderCard.stories.tsx +35 -35
- package/src/stories/PreviewerHeader.stories.tsx +91 -91
- package/src/stories/PrimaryConfirmBtn.stories.tsx +60 -60
- package/src/stories/PrimaryEntryBtn.stories.tsx +74 -74
- package/src/stories/PromptInput.stories.tsx +228 -228
- package/src/stories/RadioCard.stories.tsx +103 -103
- package/src/stories/RelationalOperatorSelect.stories.tsx +61 -61
- package/src/stories/RepeatByTypeSelect.stories.tsx +58 -58
- package/src/stories/RepeatPreferenceSelect.stories.tsx +107 -107
- package/src/stories/RepeatPreferenceTypeSelect.stories.tsx +58 -58
- package/src/stories/ScrollToBottom.stories.tsx +24 -24
- package/src/stories/SearchInput.stories.tsx +50 -50
- package/src/stories/Select.stories.tsx +128 -128
- package/src/stories/SplitLine.stories.tsx +40 -40
- package/src/stories/SquareChecker.stories.tsx +96 -96
- package/src/stories/TabRadioGroup.stories.tsx +84 -84
- package/src/stories/Textarea.stories.tsx +67 -67
- package/src/stories/TriggerSelect.stories.tsx +48 -48
- package/src/stories/TriggerTimePreferenceSelect.stories.tsx +106 -106
- package/src/stories/TriggerTimeSourceTypeSelect.stories.tsx +68 -68
- package/src/stories/UserTextMsgBubble.stories.ts +24 -24
- package/src/stories/WarningMessage.stories.tsx +23 -23
- package/src/stories/WeekdaysSelect.stories.tsx +66 -66
- package/src/stories/assets/demo.css +539 -539
- package/src/stories/assets/demo_index.html +7988 -7988
- package/src/stories/assets/iconfont.css +1377 -1377
- package/src/stories/assets/iconfont.json +2382 -2382
- package/src/stories/assets/iconfont.svg +697 -697
- package/src/stories/collapsible.stories.tsx +47 -47
- package/src/stories/drawer.stories.tsx +196 -196
- package/src/stories/field-checker-list-msg.stories.tsx +95 -95
- package/src/stories/field-checker.stories.tsx +117 -117
- package/src/stories/field-icon.stories.tsx +70 -70
- package/src/stories/field-value-checker.stories.tsx +113 -113
- package/src/stories/fields-design-info-table.stories.tsx +203 -203
- package/src/stories/fields-generating.stories.tsx +41 -41
- package/src/stories/fields-previewer.stories.tsx +77 -77
- package/src/stories/subform-fields-value-checker.stories.tsx +98 -98
- package/src/style.css +226 -226
- package/src/types.ts +8 -8
- package/style.css +3652 -3652
- package/tsconfig.json +13 -13
- package/vite.config.ts +44 -44
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { cn } from '../../../lib/utils';
|
|
2
|
-
|
|
3
|
-
interface FooterPanelProps {
|
|
4
|
-
hasTime: boolean;
|
|
5
|
-
hasDay: boolean;
|
|
6
|
-
todayCls: string;
|
|
7
|
-
onToday: () => void;
|
|
8
|
-
onOk: () => void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function FooterPanel({
|
|
12
|
-
hasTime,
|
|
13
|
-
hasDay,
|
|
14
|
-
todayCls,
|
|
15
|
-
onToday,
|
|
16
|
-
onOk,
|
|
17
|
-
}: FooterPanelProps) {
|
|
18
|
-
if (!hasTime && !hasDay) return null;
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<div className="footer h-[40px] leading-[40px] text-center border-t border-[#e0e0e0]">
|
|
22
|
-
<div className="hms px-[10px]">
|
|
23
|
-
<div
|
|
24
|
-
className={cn(
|
|
25
|
-
'btn cursor-pointer px-[5px] mx-[5px]',
|
|
26
|
-
hasTime ? 'current-time float-left text-[#0265ff] ml-0 pl-0 text-center' : 'today float-left text-[#0265ff] ml-0 pl-0 text-center',
|
|
27
|
-
todayCls === 'disabled' && 'text-[#999] pointer-events-none opacity-80'
|
|
28
|
-
)}
|
|
29
|
-
onClick={onToday}
|
|
30
|
-
>
|
|
31
|
-
{hasTime ? '当前时间' : '今天'}
|
|
32
|
-
</div>
|
|
33
|
-
{hasTime && (
|
|
34
|
-
<div
|
|
35
|
-
className="btn ok mr-0 text-white bg-[#0265ff] rounded-[4px] h-[24px] leading-[24px] mt-[8px] float-right cursor-pointer px-[5px] hover:opacity-80"
|
|
36
|
-
onClick={onOk}
|
|
37
|
-
>
|
|
38
|
-
确定
|
|
39
|
-
</div>
|
|
40
|
-
)}
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
1
|
+
import { cn } from '../../../lib/utils';
|
|
2
|
+
|
|
3
|
+
interface FooterPanelProps {
|
|
4
|
+
hasTime: boolean;
|
|
5
|
+
hasDay: boolean;
|
|
6
|
+
todayCls: string;
|
|
7
|
+
onToday: () => void;
|
|
8
|
+
onOk: () => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function FooterPanel({
|
|
12
|
+
hasTime,
|
|
13
|
+
hasDay,
|
|
14
|
+
todayCls,
|
|
15
|
+
onToday,
|
|
16
|
+
onOk,
|
|
17
|
+
}: FooterPanelProps) {
|
|
18
|
+
if (!hasTime && !hasDay) return null;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div className="footer h-[40px] leading-[40px] text-center border-t border-[#e0e0e0]">
|
|
22
|
+
<div className="hms px-[10px]">
|
|
23
|
+
<div
|
|
24
|
+
className={cn(
|
|
25
|
+
'btn cursor-pointer px-[5px] mx-[5px]',
|
|
26
|
+
hasTime ? 'current-time float-left text-[#0265ff] ml-0 pl-0 text-center' : 'today float-left text-[#0265ff] ml-0 pl-0 text-center',
|
|
27
|
+
todayCls === 'disabled' && 'text-[#999] pointer-events-none opacity-80'
|
|
28
|
+
)}
|
|
29
|
+
onClick={onToday}
|
|
30
|
+
>
|
|
31
|
+
{hasTime ? '当前时间' : '今天'}
|
|
32
|
+
</div>
|
|
33
|
+
{hasTime && (
|
|
34
|
+
<div
|
|
35
|
+
className="btn ok mr-0 text-white bg-[#0265ff] rounded-[4px] h-[24px] leading-[24px] mt-[8px] float-right cursor-pointer px-[5px] hover:opacity-80"
|
|
36
|
+
onClick={onOk}
|
|
37
|
+
>
|
|
38
|
+
确定
|
|
39
|
+
</div>
|
|
40
|
+
)}
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { DatePicker } from './date-picker';
|
|
2
|
-
export { DateInput } from './date-input';
|
|
3
|
-
export type { DateFormat, DatePickerProps, DateInputProps } from './types';
|
|
1
|
+
export { DatePicker } from './date-picker';
|
|
2
|
+
export { DateInput } from './date-input';
|
|
3
|
+
export type { DateFormat, DatePickerProps, DateInputProps } from './types';
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
2
|
-
import { cn } from '../../../lib/utils';
|
|
3
|
-
import { MONTH_NAMES, checkDateValidate } from './utils';
|
|
4
|
-
|
|
5
|
-
interface MonthPanelProps {
|
|
6
|
-
year: number;
|
|
7
|
-
month: number;
|
|
8
|
-
showYear: boolean;
|
|
9
|
-
position: 'absolute' | 'relative';
|
|
10
|
-
minDate: Date;
|
|
11
|
-
maxDate: Date;
|
|
12
|
-
week: number[];
|
|
13
|
-
onYearReduce: () => void;
|
|
14
|
-
onYearAdd: () => void;
|
|
15
|
-
onYearMenu: () => void;
|
|
16
|
-
onMountOk: (m: number) => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const tdBase = 'text-center p-0.5 min-w-[36px] h-[36px] cursor-pointer align-middle rounded-[4px]';
|
|
20
|
-
const tdDisabled = 'text-[#999] relative pointer-events-none before:absolute before:left-0 before:right-0 before:top-[20px] before:h-[28px] before:bg-[#f3f3f3] before:opacity-60 before:content-[""]';
|
|
21
|
-
|
|
22
|
-
export function MonthPanel({
|
|
23
|
-
year,
|
|
24
|
-
month,
|
|
25
|
-
showYear,
|
|
26
|
-
position,
|
|
27
|
-
minDate,
|
|
28
|
-
maxDate,
|
|
29
|
-
week,
|
|
30
|
-
onYearReduce,
|
|
31
|
-
onYearAdd,
|
|
32
|
-
onYearMenu,
|
|
33
|
-
onMountOk,
|
|
34
|
-
}: MonthPanelProps) {
|
|
35
|
-
const checkValidate = (d: Date) => checkDateValidate(d, minDate, maxDate, week, 'month');
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<table cellSpacing={0} cellPadding={0} className="mt bg-white rounded-[4px]" style={{ position }}>
|
|
39
|
-
<thead>
|
|
40
|
-
<tr>
|
|
41
|
-
<td className={cn(tdBase, 'btn prevy hover:text-[#0265ff]')} colSpan={1} onClick={onYearReduce}>
|
|
42
|
-
<ChevronLeft size={14} />
|
|
43
|
-
</td>
|
|
44
|
-
<td className={cn(tdBase, 'year title font-bold p-0.5')} colSpan={1}>
|
|
45
|
-
<span className="title-year hover:text-[#0265ff] cursor-pointer" onClick={onYearMenu}>{year}</span>
|
|
46
|
-
</td>
|
|
47
|
-
<td className={cn(tdBase, 'btn nexty hover:text-[#0265ff]')} colSpan={1} onClick={onYearAdd}>
|
|
48
|
-
<ChevronRight size={14} />
|
|
49
|
-
</td>
|
|
50
|
-
</tr>
|
|
51
|
-
</thead>
|
|
52
|
-
<tbody>
|
|
53
|
-
{[0, 1, 2, 3].map((rowIdx) => (
|
|
54
|
-
<tr key={rowIdx}>
|
|
55
|
-
{[0, 1, 2].map((colIdx) => {
|
|
56
|
-
const m = rowIdx * 3 + colIdx;
|
|
57
|
-
if (m > 11) return <td key={m} className={tdBase} />;
|
|
58
|
-
const valid = checkValidate(new Date(year, m, 1));
|
|
59
|
-
const isSelected = month === m && !showYear;
|
|
60
|
-
const isDisabled = !valid;
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<td
|
|
64
|
-
key={m}
|
|
65
|
-
className={cn(
|
|
66
|
-
tdBase,
|
|
67
|
-
'month w-[58px] h-[38px] hover:bg-[rgba(2,101,255,0.08)]',
|
|
68
|
-
isSelected && 'font-bold p-[1px] text-white border border-[#0265ff] bg-[#0265ff] hover:border-[#0265ff] hover:bg-[#0265ff]',
|
|
69
|
-
isDisabled && tdDisabled
|
|
70
|
-
)}
|
|
71
|
-
onClick={() => { if (!isDisabled) onMountOk(m); }}
|
|
72
|
-
>
|
|
73
|
-
{MONTH_NAMES[m]}
|
|
74
|
-
</td>
|
|
75
|
-
);
|
|
76
|
-
})}
|
|
77
|
-
</tr>
|
|
78
|
-
))}
|
|
79
|
-
</tbody>
|
|
80
|
-
</table>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
1
|
+
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
2
|
+
import { cn } from '../../../lib/utils';
|
|
3
|
+
import { MONTH_NAMES, checkDateValidate } from './utils';
|
|
4
|
+
|
|
5
|
+
interface MonthPanelProps {
|
|
6
|
+
year: number;
|
|
7
|
+
month: number;
|
|
8
|
+
showYear: boolean;
|
|
9
|
+
position: 'absolute' | 'relative';
|
|
10
|
+
minDate: Date;
|
|
11
|
+
maxDate: Date;
|
|
12
|
+
week: number[];
|
|
13
|
+
onYearReduce: () => void;
|
|
14
|
+
onYearAdd: () => void;
|
|
15
|
+
onYearMenu: () => void;
|
|
16
|
+
onMountOk: (m: number) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const tdBase = 'text-center p-0.5 min-w-[36px] h-[36px] cursor-pointer align-middle rounded-[4px]';
|
|
20
|
+
const tdDisabled = 'text-[#999] relative pointer-events-none before:absolute before:left-0 before:right-0 before:top-[20px] before:h-[28px] before:bg-[#f3f3f3] before:opacity-60 before:content-[""]';
|
|
21
|
+
|
|
22
|
+
export function MonthPanel({
|
|
23
|
+
year,
|
|
24
|
+
month,
|
|
25
|
+
showYear,
|
|
26
|
+
position,
|
|
27
|
+
minDate,
|
|
28
|
+
maxDate,
|
|
29
|
+
week,
|
|
30
|
+
onYearReduce,
|
|
31
|
+
onYearAdd,
|
|
32
|
+
onYearMenu,
|
|
33
|
+
onMountOk,
|
|
34
|
+
}: MonthPanelProps) {
|
|
35
|
+
const checkValidate = (d: Date) => checkDateValidate(d, minDate, maxDate, week, 'month');
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<table cellSpacing={0} cellPadding={0} className="mt bg-white rounded-[4px]" style={{ position }}>
|
|
39
|
+
<thead>
|
|
40
|
+
<tr>
|
|
41
|
+
<td className={cn(tdBase, 'btn prevy hover:text-[#0265ff]')} colSpan={1} onClick={onYearReduce}>
|
|
42
|
+
<ChevronLeft size={14} />
|
|
43
|
+
</td>
|
|
44
|
+
<td className={cn(tdBase, 'year title font-bold p-0.5')} colSpan={1}>
|
|
45
|
+
<span className="title-year hover:text-[#0265ff] cursor-pointer" onClick={onYearMenu}>{year}</span>
|
|
46
|
+
</td>
|
|
47
|
+
<td className={cn(tdBase, 'btn nexty hover:text-[#0265ff]')} colSpan={1} onClick={onYearAdd}>
|
|
48
|
+
<ChevronRight size={14} />
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
</thead>
|
|
52
|
+
<tbody>
|
|
53
|
+
{[0, 1, 2, 3].map((rowIdx) => (
|
|
54
|
+
<tr key={rowIdx}>
|
|
55
|
+
{[0, 1, 2].map((colIdx) => {
|
|
56
|
+
const m = rowIdx * 3 + colIdx;
|
|
57
|
+
if (m > 11) return <td key={m} className={tdBase} />;
|
|
58
|
+
const valid = checkValidate(new Date(year, m, 1));
|
|
59
|
+
const isSelected = month === m && !showYear;
|
|
60
|
+
const isDisabled = !valid;
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<td
|
|
64
|
+
key={m}
|
|
65
|
+
className={cn(
|
|
66
|
+
tdBase,
|
|
67
|
+
'month w-[58px] h-[38px] hover:bg-[rgba(2,101,255,0.08)]',
|
|
68
|
+
isSelected && 'font-bold p-[1px] text-white border border-[#0265ff] bg-[#0265ff] hover:border-[#0265ff] hover:bg-[#0265ff]',
|
|
69
|
+
isDisabled && tdDisabled
|
|
70
|
+
)}
|
|
71
|
+
onClick={() => { if (!isDisabled) onMountOk(m); }}
|
|
72
|
+
>
|
|
73
|
+
{MONTH_NAMES[m]}
|
|
74
|
+
</td>
|
|
75
|
+
);
|
|
76
|
+
})}
|
|
77
|
+
</tr>
|
|
78
|
+
))}
|
|
79
|
+
</tbody>
|
|
80
|
+
</table>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
import { cn } from '../../../lib/utils';
|
|
2
|
-
import { checkTimeValidate } from './utils';
|
|
3
|
-
import type { TimeObj } from './types';
|
|
4
|
-
|
|
5
|
-
interface TimePanelProps {
|
|
6
|
-
hours: number;
|
|
7
|
-
minutes: number;
|
|
8
|
-
seconds: number;
|
|
9
|
-
year: number;
|
|
10
|
-
month: number;
|
|
11
|
-
day: number;
|
|
12
|
-
format: string;
|
|
13
|
-
minDate: Date;
|
|
14
|
-
maxDate: Date;
|
|
15
|
-
startTime: TimeObj;
|
|
16
|
-
endTime: TimeObj;
|
|
17
|
-
onHoursChange: (v: number) => void;
|
|
18
|
-
onMinutesChange: (v: number) => void;
|
|
19
|
-
onSecondsChange: (v: number) => void;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const colItemBase = 'h-[32px] leading-[32px] text-center cursor-pointer rounded-[4px] hover:bg-[rgba(2,101,255,0.08)]';
|
|
23
|
-
|
|
24
|
-
export function TimePanel({
|
|
25
|
-
hours,
|
|
26
|
-
minutes,
|
|
27
|
-
seconds,
|
|
28
|
-
year,
|
|
29
|
-
month,
|
|
30
|
-
day,
|
|
31
|
-
format,
|
|
32
|
-
minDate,
|
|
33
|
-
maxDate,
|
|
34
|
-
startTime,
|
|
35
|
-
endTime,
|
|
36
|
-
onHoursChange,
|
|
37
|
-
onMinutesChange,
|
|
38
|
-
onSecondsChange,
|
|
39
|
-
}: TimePanelProps) {
|
|
40
|
-
const hasMinutePart = format.includes('mm');
|
|
41
|
-
const hasSecondPart = format.includes('ss');
|
|
42
|
-
|
|
43
|
-
const renderColumn = (type: 'hours' | 'minutes' | 'seconds') => {
|
|
44
|
-
const colLen = type === 'hours' ? 24 : 60;
|
|
45
|
-
const labels: Record<string, string> = { hours: '时', minutes: '分', seconds: '秒' };
|
|
46
|
-
const currentVal = type === 'hours' ? hours : type === 'minutes' ? minutes : seconds;
|
|
47
|
-
const onChange = type === 'hours' ? onHoursChange : type === 'minutes' ? onMinutesChange : onSecondsChange;
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div className={cn('col flex-1 border-l border-[#e0e0e0]', type)}>
|
|
51
|
-
<div className="label h-[32px] leading-[32px] text-center">{labels[type]}</div>
|
|
52
|
-
<div className="col-list h-[200px] overflow-auto">
|
|
53
|
-
{Array.from({ length: colLen }, (_, index) => {
|
|
54
|
-
const isSelected = currentVal === index;
|
|
55
|
-
let isDisabled = false;
|
|
56
|
-
|
|
57
|
-
const isMinBoundary = minDate.getFullYear() === year && minDate.getMonth() === month && minDate.getDate() === day;
|
|
58
|
-
const isMaxBoundary = maxDate.getFullYear() === year && maxDate.getMonth() === month && maxDate.getDate() === day;
|
|
59
|
-
|
|
60
|
-
if (isMinBoundary) {
|
|
61
|
-
const current: TimeObj = {
|
|
62
|
-
h: type === 'hours' ? index : hours,
|
|
63
|
-
m: type === 'minutes' ? index : minutes,
|
|
64
|
-
s: type === 'seconds' ? index : seconds,
|
|
65
|
-
ms: 0,
|
|
66
|
-
};
|
|
67
|
-
isDisabled = !checkTimeValidate(current, startTime, { h: 23, m: 59, s: 59, ms: 999 });
|
|
68
|
-
}
|
|
69
|
-
if (isMaxBoundary && !isDisabled) {
|
|
70
|
-
const current: TimeObj = {
|
|
71
|
-
h: type === 'hours' ? index : hours,
|
|
72
|
-
m: type === 'minutes' ? index : minutes,
|
|
73
|
-
s: type === 'seconds' ? index : seconds,
|
|
74
|
-
ms: 0,
|
|
75
|
-
};
|
|
76
|
-
isDisabled = !checkTimeValidate(current, { h: 0, m: 0, s: 0, ms: 0 }, endTime);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<div
|
|
81
|
-
key={index}
|
|
82
|
-
className={cn(
|
|
83
|
-
colItemBase,
|
|
84
|
-
isSelected && !isDisabled && 'select bg-[rgba(2,101,255,0.2)]',
|
|
85
|
-
isDisabled && 'text-[#999] pointer-events-none opacity-80'
|
|
86
|
-
)}
|
|
87
|
-
onClick={() => { if (!isDisabled) onChange(index); }}
|
|
88
|
-
>
|
|
89
|
-
{index > 9 ? index : `0${index}`}
|
|
90
|
-
</div>
|
|
91
|
-
);
|
|
92
|
-
})}
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
return (
|
|
99
|
-
<div className="time-range w-[180px]">
|
|
100
|
-
<div className="time-input flex h-[40px] border-l border-[#e0e0e0]">
|
|
101
|
-
<input
|
|
102
|
-
type="number"
|
|
103
|
-
value={hours}
|
|
104
|
-
className="h-[24px] w-[38px] my-[10px] mx-[10px] mt-[10px] text-center pl-[5px] flex-1"
|
|
105
|
-
onChange={(e) => {
|
|
106
|
-
const v = Math.min(23, Math.max(0, parseInt(e.target.value) || 0));
|
|
107
|
-
onHoursChange(v);
|
|
108
|
-
}}
|
|
109
|
-
/>
|
|
110
|
-
{hasMinutePart && (
|
|
111
|
-
<>
|
|
112
|
-
<span className="leading-[40px]">:</span>
|
|
113
|
-
<input
|
|
114
|
-
type="number"
|
|
115
|
-
value={minutes}
|
|
116
|
-
className="h-[24px] w-[38px] my-[10px] mx-[10px] mt-[10px] text-center pl-[5px] flex-1"
|
|
117
|
-
onChange={(e) => {
|
|
118
|
-
const v = Math.min(59, Math.max(0, parseInt(e.target.value) || 0));
|
|
119
|
-
onMinutesChange(v);
|
|
120
|
-
}}
|
|
121
|
-
/>
|
|
122
|
-
</>
|
|
123
|
-
)}
|
|
124
|
-
{hasSecondPart && (
|
|
125
|
-
<>
|
|
126
|
-
<span className="leading-[40px]">:</span>
|
|
127
|
-
<input
|
|
128
|
-
type="number"
|
|
129
|
-
value={seconds}
|
|
130
|
-
className="h-[24px] w-[38px] my-[10px] mx-[10px] mt-[10px] text-center pl-[5px] flex-1"
|
|
131
|
-
onChange={(e) => {
|
|
132
|
-
const v = Math.min(59, Math.max(0, parseInt(e.target.value) || 0));
|
|
133
|
-
onSecondsChange(v);
|
|
134
|
-
}}
|
|
135
|
-
/>
|
|
136
|
-
</>
|
|
137
|
-
)}
|
|
138
|
-
</div>
|
|
139
|
-
<div className="time-select-range flex border-t border-[#e0e0e0]" style={{ height: 'calc(100% - 40px)' }}>
|
|
140
|
-
{renderColumn('hours')}
|
|
141
|
-
{hasMinutePart && renderColumn('minutes')}
|
|
142
|
-
{hasSecondPart && renderColumn('seconds')}
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
);
|
|
146
|
-
}
|
|
1
|
+
import { cn } from '../../../lib/utils';
|
|
2
|
+
import { checkTimeValidate } from './utils';
|
|
3
|
+
import type { TimeObj } from './types';
|
|
4
|
+
|
|
5
|
+
interface TimePanelProps {
|
|
6
|
+
hours: number;
|
|
7
|
+
minutes: number;
|
|
8
|
+
seconds: number;
|
|
9
|
+
year: number;
|
|
10
|
+
month: number;
|
|
11
|
+
day: number;
|
|
12
|
+
format: string;
|
|
13
|
+
minDate: Date;
|
|
14
|
+
maxDate: Date;
|
|
15
|
+
startTime: TimeObj;
|
|
16
|
+
endTime: TimeObj;
|
|
17
|
+
onHoursChange: (v: number) => void;
|
|
18
|
+
onMinutesChange: (v: number) => void;
|
|
19
|
+
onSecondsChange: (v: number) => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const colItemBase = 'h-[32px] leading-[32px] text-center cursor-pointer rounded-[4px] hover:bg-[rgba(2,101,255,0.08)]';
|
|
23
|
+
|
|
24
|
+
export function TimePanel({
|
|
25
|
+
hours,
|
|
26
|
+
minutes,
|
|
27
|
+
seconds,
|
|
28
|
+
year,
|
|
29
|
+
month,
|
|
30
|
+
day,
|
|
31
|
+
format,
|
|
32
|
+
minDate,
|
|
33
|
+
maxDate,
|
|
34
|
+
startTime,
|
|
35
|
+
endTime,
|
|
36
|
+
onHoursChange,
|
|
37
|
+
onMinutesChange,
|
|
38
|
+
onSecondsChange,
|
|
39
|
+
}: TimePanelProps) {
|
|
40
|
+
const hasMinutePart = format.includes('mm');
|
|
41
|
+
const hasSecondPart = format.includes('ss');
|
|
42
|
+
|
|
43
|
+
const renderColumn = (type: 'hours' | 'minutes' | 'seconds') => {
|
|
44
|
+
const colLen = type === 'hours' ? 24 : 60;
|
|
45
|
+
const labels: Record<string, string> = { hours: '时', minutes: '分', seconds: '秒' };
|
|
46
|
+
const currentVal = type === 'hours' ? hours : type === 'minutes' ? minutes : seconds;
|
|
47
|
+
const onChange = type === 'hours' ? onHoursChange : type === 'minutes' ? onMinutesChange : onSecondsChange;
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className={cn('col flex-1 border-l border-[#e0e0e0]', type)}>
|
|
51
|
+
<div className="label h-[32px] leading-[32px] text-center">{labels[type]}</div>
|
|
52
|
+
<div className="col-list h-[200px] overflow-auto">
|
|
53
|
+
{Array.from({ length: colLen }, (_, index) => {
|
|
54
|
+
const isSelected = currentVal === index;
|
|
55
|
+
let isDisabled = false;
|
|
56
|
+
|
|
57
|
+
const isMinBoundary = minDate.getFullYear() === year && minDate.getMonth() === month && minDate.getDate() === day;
|
|
58
|
+
const isMaxBoundary = maxDate.getFullYear() === year && maxDate.getMonth() === month && maxDate.getDate() === day;
|
|
59
|
+
|
|
60
|
+
if (isMinBoundary) {
|
|
61
|
+
const current: TimeObj = {
|
|
62
|
+
h: type === 'hours' ? index : hours,
|
|
63
|
+
m: type === 'minutes' ? index : minutes,
|
|
64
|
+
s: type === 'seconds' ? index : seconds,
|
|
65
|
+
ms: 0,
|
|
66
|
+
};
|
|
67
|
+
isDisabled = !checkTimeValidate(current, startTime, { h: 23, m: 59, s: 59, ms: 999 });
|
|
68
|
+
}
|
|
69
|
+
if (isMaxBoundary && !isDisabled) {
|
|
70
|
+
const current: TimeObj = {
|
|
71
|
+
h: type === 'hours' ? index : hours,
|
|
72
|
+
m: type === 'minutes' ? index : minutes,
|
|
73
|
+
s: type === 'seconds' ? index : seconds,
|
|
74
|
+
ms: 0,
|
|
75
|
+
};
|
|
76
|
+
isDisabled = !checkTimeValidate(current, { h: 0, m: 0, s: 0, ms: 0 }, endTime);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div
|
|
81
|
+
key={index}
|
|
82
|
+
className={cn(
|
|
83
|
+
colItemBase,
|
|
84
|
+
isSelected && !isDisabled && 'select bg-[rgba(2,101,255,0.2)]',
|
|
85
|
+
isDisabled && 'text-[#999] pointer-events-none opacity-80'
|
|
86
|
+
)}
|
|
87
|
+
onClick={() => { if (!isDisabled) onChange(index); }}
|
|
88
|
+
>
|
|
89
|
+
{index > 9 ? index : `0${index}`}
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
})}
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<div className="time-range w-[180px]">
|
|
100
|
+
<div className="time-input flex h-[40px] border-l border-[#e0e0e0]">
|
|
101
|
+
<input
|
|
102
|
+
type="number"
|
|
103
|
+
value={hours}
|
|
104
|
+
className="h-[24px] w-[38px] my-[10px] mx-[10px] mt-[10px] text-center pl-[5px] flex-1"
|
|
105
|
+
onChange={(e) => {
|
|
106
|
+
const v = Math.min(23, Math.max(0, parseInt(e.target.value) || 0));
|
|
107
|
+
onHoursChange(v);
|
|
108
|
+
}}
|
|
109
|
+
/>
|
|
110
|
+
{hasMinutePart && (
|
|
111
|
+
<>
|
|
112
|
+
<span className="leading-[40px]">:</span>
|
|
113
|
+
<input
|
|
114
|
+
type="number"
|
|
115
|
+
value={minutes}
|
|
116
|
+
className="h-[24px] w-[38px] my-[10px] mx-[10px] mt-[10px] text-center pl-[5px] flex-1"
|
|
117
|
+
onChange={(e) => {
|
|
118
|
+
const v = Math.min(59, Math.max(0, parseInt(e.target.value) || 0));
|
|
119
|
+
onMinutesChange(v);
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
122
|
+
</>
|
|
123
|
+
)}
|
|
124
|
+
{hasSecondPart && (
|
|
125
|
+
<>
|
|
126
|
+
<span className="leading-[40px]">:</span>
|
|
127
|
+
<input
|
|
128
|
+
type="number"
|
|
129
|
+
value={seconds}
|
|
130
|
+
className="h-[24px] w-[38px] my-[10px] mx-[10px] mt-[10px] text-center pl-[5px] flex-1"
|
|
131
|
+
onChange={(e) => {
|
|
132
|
+
const v = Math.min(59, Math.max(0, parseInt(e.target.value) || 0));
|
|
133
|
+
onSecondsChange(v);
|
|
134
|
+
}}
|
|
135
|
+
/>
|
|
136
|
+
</>
|
|
137
|
+
)}
|
|
138
|
+
</div>
|
|
139
|
+
<div className="time-select-range flex border-t border-[#e0e0e0]" style={{ height: 'calc(100% - 40px)' }}>
|
|
140
|
+
{renderColumn('hours')}
|
|
141
|
+
{hasMinutePart && renderColumn('minutes')}
|
|
142
|
+
{hasSecondPart && renderColumn('seconds')}
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
export type DateFormat =
|
|
2
|
-
| 'yyyy-MM-dd'
|
|
3
|
-
| 'yyyy-MM-dd HH:mm:ss'
|
|
4
|
-
| 'yyyy-MM-dd HH:mm'
|
|
5
|
-
| 'HH:mm:ss'
|
|
6
|
-
| 'HH:mm'
|
|
7
|
-
| 'yyyy-MM'
|
|
8
|
-
| 'yyyy';
|
|
9
|
-
|
|
10
|
-
export interface DatePickerProps {
|
|
11
|
-
value?: Date;
|
|
12
|
-
onChange?: (date: Date | null, closeFloat?: boolean) => void;
|
|
13
|
-
format?: DateFormat;
|
|
14
|
-
minDate?: Date;
|
|
15
|
-
maxDate?: Date;
|
|
16
|
-
week?: number[];
|
|
17
|
-
className?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface DateInputProps {
|
|
21
|
-
value?: Date;
|
|
22
|
-
onChange?: (date: Date | null) => void;
|
|
23
|
-
format?: DateFormat;
|
|
24
|
-
minDate?: Date;
|
|
25
|
-
maxDate?: Date;
|
|
26
|
-
week?: number[];
|
|
27
|
-
placeholder?: string;
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
className?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface TimeObj {
|
|
33
|
-
h: number;
|
|
34
|
-
m: number;
|
|
35
|
-
s: number;
|
|
36
|
-
ms: number;
|
|
37
|
-
}
|
|
1
|
+
export type DateFormat =
|
|
2
|
+
| 'yyyy-MM-dd'
|
|
3
|
+
| 'yyyy-MM-dd HH:mm:ss'
|
|
4
|
+
| 'yyyy-MM-dd HH:mm'
|
|
5
|
+
| 'HH:mm:ss'
|
|
6
|
+
| 'HH:mm'
|
|
7
|
+
| 'yyyy-MM'
|
|
8
|
+
| 'yyyy';
|
|
9
|
+
|
|
10
|
+
export interface DatePickerProps {
|
|
11
|
+
value?: Date;
|
|
12
|
+
onChange?: (date: Date | null, closeFloat?: boolean) => void;
|
|
13
|
+
format?: DateFormat;
|
|
14
|
+
minDate?: Date;
|
|
15
|
+
maxDate?: Date;
|
|
16
|
+
week?: number[];
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface DateInputProps {
|
|
21
|
+
value?: Date;
|
|
22
|
+
onChange?: (date: Date | null) => void;
|
|
23
|
+
format?: DateFormat;
|
|
24
|
+
minDate?: Date;
|
|
25
|
+
maxDate?: Date;
|
|
26
|
+
week?: number[];
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface TimeObj {
|
|
33
|
+
h: number;
|
|
34
|
+
m: number;
|
|
35
|
+
s: number;
|
|
36
|
+
ms: number;
|
|
37
|
+
}
|