@lowdefy/blocks-antd 5.6.0 → 6.0.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/dist/TagPillRow.js +88 -0
- package/dist/blocks/Affix/gallery.yaml +399 -0
- package/dist/blocks/Affix/tests/Affix.e2e.yaml +72 -0
- package/dist/blocks/Affix/tests.yaml +29 -0
- package/dist/blocks/Alert/gallery.yaml +701 -0
- package/dist/blocks/Alert/tests/Alert.e2e.yaml +161 -0
- package/dist/blocks/Alert/tests.yaml +261 -0
- package/dist/blocks/AutoComplete/gallery.yaml +713 -0
- package/dist/blocks/AutoComplete/tests/AutoComplete.e2e.yaml +330 -0
- package/dist/blocks/AutoComplete/tests.yaml +178 -0
- package/dist/blocks/Avatar/gallery.yaml +1037 -0
- package/dist/blocks/Avatar/tests/Avatar.e2e.yaml +125 -0
- package/dist/blocks/Avatar/tests.yaml +76 -0
- package/dist/blocks/Badge/gallery.yaml +1090 -0
- package/dist/blocks/Badge/tests/Badge.e2e.yaml +195 -0
- package/dist/blocks/Badge/tests.yaml +91 -0
- package/dist/blocks/Breadcrumb/gallery.yaml +484 -0
- package/dist/blocks/Breadcrumb/tests/Breadcrumb.e2e.yaml +165 -0
- package/dist/blocks/Breadcrumb/tests.yaml +106 -0
- package/dist/blocks/Button/gallery.yaml +718 -0
- package/dist/blocks/Button/tests/Button.e2e.yaml +246 -0
- package/dist/blocks/Button/tests.yaml +104 -0
- package/dist/blocks/ButtonSelector/gallery.yaml +891 -0
- package/dist/blocks/ButtonSelector/tests/ButtonSelector.e2e.yaml +188 -0
- package/dist/blocks/ButtonSelector/tests.yaml +167 -0
- package/dist/blocks/Calendar/gallery.yaml +128 -0
- package/dist/blocks/Calendar/tests/Calendar.e2e.yaml +136 -0
- package/dist/blocks/Calendar/tests.yaml +50 -0
- package/dist/blocks/Card/gallery.yaml +1035 -0
- package/dist/blocks/Card/tests/Card.e2e.yaml +209 -0
- package/dist/blocks/Card/tests.yaml +75 -0
- package/dist/blocks/Carousel/gallery.yaml +1971 -0
- package/dist/blocks/Carousel/tests/Carousel.e2e.yaml +211 -0
- package/dist/blocks/Carousel/tests.yaml +117 -0
- package/dist/blocks/CheckboxSelector/gallery.yaml +781 -0
- package/dist/blocks/CheckboxSelector/tests/CheckboxSelector.e2e.yaml +272 -0
- package/dist/blocks/CheckboxSelector/tests.yaml +325 -0
- package/dist/blocks/CheckboxSwitch/gallery.yaml +457 -0
- package/dist/blocks/CheckboxSwitch/tests/CheckboxSwitch.e2e.yaml +126 -0
- package/dist/blocks/CheckboxSwitch/tests.yaml +96 -0
- package/dist/blocks/Collapse/gallery.yaml +1079 -0
- package/dist/blocks/Collapse/tests/Collapse.e2e.yaml +206 -0
- package/dist/blocks/Collapse/tests.yaml +265 -0
- package/dist/blocks/ColorSelector/gallery.yaml +807 -0
- package/dist/blocks/ColorSelector/tests/ColorSelector.e2e.yaml +77 -0
- package/dist/blocks/ColorSelector/tests.yaml +84 -0
- package/dist/blocks/ConfigProvider/gallery.yaml +1003 -0
- package/dist/blocks/ConfigProvider/tests.yaml +62 -0
- package/dist/blocks/ConfirmModal/gallery.yaml +1043 -0
- package/dist/blocks/ConfirmModal/tests/ConfirmModal.e2e.yaml +410 -0
- package/dist/blocks/ConfirmModal/tests.yaml +95 -0
- package/dist/blocks/Content/gallery.yaml +528 -0
- package/dist/blocks/Content/tests/Content.e2e.yaml +71 -0
- package/dist/blocks/Content/tests.yaml +42 -0
- package/dist/blocks/ControlledList/ControlledList.js +1 -1
- package/dist/blocks/ControlledList/gallery.yaml +481 -0
- package/dist/blocks/ControlledList/{style.module.css → style.css} +3 -3
- package/dist/blocks/ControlledList/tests/ControlledList.e2e.yaml +161 -0
- package/dist/blocks/ControlledList/tests.yaml +57 -0
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +7 -0
- package/dist/blocks/DateRangeSelector/e2e.js +28 -2
- package/dist/blocks/DateRangeSelector/gallery.yaml +858 -0
- package/dist/blocks/DateRangeSelector/meta.js +2 -0
- package/dist/blocks/DateRangeSelector/tests/DateRangeSelector.e2e.yaml +204 -0
- package/dist/blocks/DateRangeSelector/tests.yaml +129 -0
- package/dist/blocks/DateSelector/DateSelector.js +6 -0
- package/dist/blocks/DateSelector/e2e.js +28 -2
- package/dist/blocks/DateSelector/gallery.yaml +691 -0
- package/dist/blocks/DateSelector/meta.js +6 -0
- package/dist/blocks/DateSelector/tests/DateSelector.e2e.yaml +229 -0
- package/dist/blocks/DateSelector/tests.yaml +117 -0
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +7 -0
- package/dist/blocks/DateTimeSelector/e2e.js +26 -2
- package/dist/blocks/DateTimeSelector/gallery.yaml +770 -0
- package/dist/blocks/DateTimeSelector/meta.js +2 -0
- package/dist/blocks/DateTimeSelector/tests/DateTimeSelector.e2e.yaml +163 -0
- package/dist/blocks/DateTimeSelector/tests.yaml +140 -0
- package/dist/blocks/Descriptions/gallery.yaml +839 -0
- package/dist/blocks/Descriptions/tests/Descriptions.e2e.yaml +143 -0
- package/dist/blocks/Descriptions/tests.yaml +256 -0
- package/dist/blocks/Divider/gallery.yaml +375 -0
- package/dist/blocks/Divider/tests/Divider.e2e.yaml +107 -0
- package/dist/blocks/Divider/tests.yaml +58 -0
- package/dist/blocks/Drawer/gallery.yaml +1257 -0
- package/dist/blocks/Drawer/tests/Drawer.e2e.yaml +562 -0
- package/dist/blocks/Drawer/tests.yaml +80 -0
- package/dist/blocks/DropdownButton/gallery.yaml +606 -0
- package/dist/blocks/DropdownButton/tests/DropdownButton.e2e.yaml +243 -0
- package/dist/blocks/DropdownMenu/gallery.yaml +578 -0
- package/dist/blocks/DropdownMenu/tests/DropdownMenu.e2e.yaml +267 -0
- package/dist/blocks/Flex/gallery.yaml +1416 -0
- package/dist/blocks/Flex/tests/Flex.e2e.yaml +95 -0
- package/dist/blocks/Flex/tests.yaml +92 -0
- package/dist/blocks/FloatButton/gallery.yaml +518 -0
- package/dist/blocks/FloatButton/tests/FloatButton.e2e.yaml +73 -0
- package/dist/blocks/FloatButton/tests.yaml +59 -0
- package/dist/blocks/Footer/gallery.yaml +355 -0
- package/dist/blocks/Footer/tests/Footer.e2e.yaml +70 -0
- package/dist/blocks/Footer/tests.yaml +28 -0
- package/dist/blocks/Header/gallery.yaml +249 -0
- package/dist/blocks/Header/tests/Header.e2e.yaml +77 -0
- package/dist/blocks/Header/tests.yaml +36 -0
- package/dist/blocks/Label/Label.js +1 -1
- package/dist/blocks/Label/gallery.yaml +762 -0
- package/dist/blocks/Label/{style.module.css → style.css} +28 -28
- package/dist/blocks/Label/tests/Label.e2e.yaml +247 -0
- package/dist/blocks/Label/tests.yaml +212 -0
- package/dist/blocks/Layout/gallery.yaml +548 -0
- package/dist/blocks/Layout/tests/Layout.e2e.yaml +86 -0
- package/dist/blocks/Layout/tests.yaml +28 -0
- package/dist/blocks/ListSelector/gallery.yaml +223 -0
- package/dist/blocks/Masonry/gallery.yaml +989 -0
- package/dist/blocks/Masonry/tests/Masonry.e2e.yaml +128 -0
- package/dist/blocks/Masonry/tests.yaml +42 -0
- package/dist/blocks/MasonryList/gallery.yaml +224 -0
- package/dist/blocks/MasonryList/tests/MasonryList.e2e.yaml +55 -0
- package/dist/blocks/MasonryList/tests.yaml +42 -0
- package/dist/blocks/Menu/gallery.yaml +974 -0
- package/dist/blocks/Menu/tests/Menu.e2e.yaml +484 -0
- package/dist/blocks/Menu/tests.yaml +1053 -0
- package/dist/blocks/Message/gallery.yaml +860 -0
- package/dist/blocks/Message/tests/Message.e2e.yaml +246 -0
- package/dist/blocks/Message/tests.yaml +54 -0
- package/dist/blocks/MobileMenu/gallery.yaml +1172 -0
- package/dist/blocks/MobileMenu/tests/MobileMenu.e2e.yaml +314 -0
- package/dist/blocks/MobileMenu/tests.yaml +359 -0
- package/dist/blocks/Modal/gallery.yaml +1039 -0
- package/dist/blocks/Modal/tests/Modal.e2e.yaml +493 -0
- package/dist/blocks/Modal/tests.yaml +75 -0
- package/dist/blocks/MonthSelector/MonthSelector.js +6 -0
- package/dist/blocks/MonthSelector/e2e.js +26 -2
- package/dist/blocks/MonthSelector/gallery.yaml +687 -0
- package/dist/blocks/MonthSelector/meta.js +6 -0
- package/dist/blocks/MonthSelector/tests/MonthSelector.e2e.yaml +167 -0
- package/dist/blocks/MonthSelector/tests.yaml +124 -0
- package/dist/blocks/MultipleSelector/gallery.yaml +1245 -0
- package/dist/blocks/MultipleSelector/tests/MultipleSelector.e2e.yaml +445 -0
- package/dist/blocks/MultipleSelector/tests.yaml +201 -0
- package/dist/blocks/Notification/gallery.yaml +1376 -0
- package/dist/blocks/Notification/tests/Notification.e2e.yaml +362 -0
- package/dist/blocks/Notification/tests.yaml +97 -0
- package/dist/blocks/NumberInput/gallery.yaml +753 -0
- package/dist/blocks/NumberInput/tests/NumberInput.e2e.yaml +228 -0
- package/dist/blocks/NumberInput/tests.yaml +116 -0
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +1 -1
- package/dist/blocks/PageHeaderMenu/gallery.yaml +480 -0
- package/dist/blocks/PageHeaderMenu/tests/PageHeaderMenu.e2e.yaml +110 -0
- package/dist/blocks/PageHeaderMenu/tests.yaml +173 -0
- package/dist/blocks/PageSidebarLayout/PageSidebarLayout.js +10 -1
- package/dist/blocks/PageSidebarLayout/gallery.yaml +302 -0
- package/dist/blocks/PageSidebarLayout/meta.js +1 -0
- package/dist/blocks/PageSidebarLayout/tests/PageSidebarLayout.e2e.yaml +216 -0
- package/dist/blocks/PageSidebarLayout/tests.yaml +174 -0
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +1 -1
- package/dist/blocks/PageSiderMenu/gallery.yaml +516 -0
- package/dist/blocks/PageSiderMenu/tests/PageSiderMenu.e2e.yaml +175 -0
- package/dist/blocks/PageSiderMenu/tests.yaml +211 -0
- package/dist/blocks/Pagination/gallery.yaml +503 -0
- package/dist/blocks/Pagination/tests/Pagination.e2e.yaml +159 -0
- package/dist/blocks/Pagination/tests.yaml +80 -0
- package/dist/blocks/Paragraph/gallery.yaml +458 -0
- package/dist/blocks/Paragraph/tests/Paragraph.e2e.yaml +153 -0
- package/dist/blocks/Paragraph/tests.yaml +176 -0
- package/dist/blocks/ParagraphInput/gallery.yaml +1483 -0
- package/dist/blocks/ParagraphInput/tests/ParagraphInput.e2e.yaml +189 -0
- package/dist/blocks/ParagraphInput/tests.yaml +163 -0
- package/dist/blocks/PasswordInput/gallery.yaml +420 -0
- package/dist/blocks/PasswordInput/tests/PasswordInput.e2e.yaml +188 -0
- package/dist/blocks/PasswordInput/tests.yaml +78 -0
- package/dist/blocks/PhoneNumberInput/gallery.yaml +677 -0
- package/dist/blocks/PhoneNumberInput/tests/PhoneNumberInput.e2e.yaml +279 -0
- package/dist/blocks/PhoneNumberInput/tests.yaml +25 -0
- package/dist/blocks/Popover/gallery.yaml +1301 -0
- package/dist/blocks/Popover/tests/Popover.e2e.yaml +249 -0
- package/dist/blocks/Popover/tests.yaml +105 -0
- package/dist/blocks/Progress/gallery.yaml +772 -0
- package/dist/blocks/Progress/tests/Progress.e2e.yaml +167 -0
- package/dist/blocks/Progress/tests.yaml +114 -0
- package/dist/blocks/QRCode/gallery.yaml +492 -0
- package/dist/blocks/QRCode/tests/QRCode.e2e.yaml +66 -0
- package/dist/blocks/QRCode/tests.yaml +113 -0
- package/dist/blocks/RadioSelector/gallery.yaml +816 -0
- package/dist/blocks/RadioSelector/tests/RadioSelector.e2e.yaml +269 -0
- package/dist/blocks/RadioSelector/tests.yaml +339 -0
- package/dist/blocks/RatingSlider/gallery.yaml +627 -0
- package/dist/blocks/RatingSlider/tests/RatingSlider.e2e.yaml +188 -0
- package/dist/blocks/RatingSlider/tests.yaml +116 -0
- package/dist/blocks/Result/gallery.yaml +925 -0
- package/dist/blocks/Result/tests/Result.e2e.yaml +126 -0
- package/dist/blocks/Result/tests.yaml +75 -0
- package/dist/blocks/Search/Search.js +1 -1
- package/dist/blocks/Search/SearchModal.js +18 -9
- package/dist/blocks/Search/gallery.yaml +170 -0
- package/dist/blocks/Search/meta.js +2 -1
- package/dist/blocks/Search/{style.module.css → style.css} +19 -12
- package/dist/blocks/Search/tests/Search.e2e.yaml +125 -0
- package/dist/blocks/Search/useSearchIndex.js +24 -2
- package/dist/blocks/SegmentedSelector/gallery.yaml +725 -0
- package/dist/blocks/SegmentedSelector/tests/SegmentedSelector.e2e.yaml +115 -0
- package/dist/blocks/SegmentedSelector/tests.yaml +141 -0
- package/dist/blocks/Selector/gallery.yaml +1055 -0
- package/dist/blocks/Selector/tests/Selector.e2e.yaml +427 -0
- package/dist/blocks/Selector/tests.yaml +196 -0
- package/dist/blocks/Sider/gallery.yaml +994 -0
- package/dist/blocks/Sider/tests/Sider.e2e.yaml +162 -0
- package/dist/blocks/Sider/tests.yaml +20 -0
- package/dist/blocks/Slider/gallery.yaml +600 -0
- package/dist/blocks/Slider/tests/Slider.e2e.yaml +190 -0
- package/dist/blocks/Slider/tests.yaml +68 -0
- package/dist/blocks/Splitter/gallery.yaml +1511 -0
- package/dist/blocks/Splitter/tests/Splitter.e2e.yaml +114 -0
- package/dist/blocks/Splitter/tests.yaml +79 -0
- package/dist/blocks/Statistic/gallery.yaml +460 -0
- package/dist/blocks/Statistic/tests/Statistic.e2e.yaml +137 -0
- package/dist/blocks/Statistic/tests.yaml +77 -0
- package/dist/blocks/Steps/gallery.yaml +550 -0
- package/dist/blocks/Switch/gallery.yaml +502 -0
- package/dist/blocks/Switch/tests/Switch.e2e.yaml +132 -0
- package/dist/blocks/Switch/tests.yaml +87 -0
- package/dist/blocks/Tabs/gallery.yaml +1353 -0
- package/dist/blocks/Tabs/tests/Tabs.e2e.yaml +370 -0
- package/dist/blocks/Tabs/tests.yaml +349 -0
- package/dist/blocks/Tag/gallery.yaml +598 -0
- package/dist/blocks/Tag/tests/Tag.e2e.yaml +173 -0
- package/dist/blocks/Tag/tests.yaml +51 -0
- package/dist/blocks/TagMultipleSelector/TagMultipleSelector.js +53 -0
- package/dist/blocks/TagMultipleSelector/e2e.js +36 -0
- package/dist/blocks/TagMultipleSelector/gallery.yaml +70 -0
- package/dist/blocks/TagMultipleSelector/meta.js +91 -0
- package/dist/blocks/TagMultipleSelector/tests/TagMultipleSelector.e2e.yaml +93 -0
- package/dist/blocks/TagSelector/TagSelector.js +49 -0
- package/dist/blocks/TagSelector/e2e.js +36 -0
- package/dist/blocks/TagSelector/gallery.yaml +70 -0
- package/dist/blocks/TagSelector/meta.js +91 -0
- package/dist/blocks/TagSelector/tests/TagSelector.e2e.yaml +93 -0
- package/dist/blocks/TextArea/gallery.yaml +618 -0
- package/dist/blocks/TextArea/tests/TextArea.e2e.yaml +218 -0
- package/dist/blocks/TextArea/tests.yaml +100 -0
- package/dist/blocks/TextInput/gallery.yaml +560 -0
- package/dist/blocks/TextInput/tests/TextInput.e2e.yaml +287 -0
- package/dist/blocks/TextInput/tests.yaml +114 -0
- package/dist/blocks/TimelineList/gallery.yaml +431 -0
- package/dist/blocks/TimelineList/tests/TimelineList.e2e.yaml +244 -0
- package/dist/blocks/TimelineList/tests.yaml +251 -0
- package/dist/blocks/Title/gallery.yaml +483 -0
- package/dist/blocks/Title/tests/Title.e2e.yaml +180 -0
- package/dist/blocks/Title/tests.yaml +175 -0
- package/dist/blocks/TitleInput/gallery.yaml +1006 -0
- package/dist/blocks/TitleInput/tests/TitleInput.e2e.yaml +195 -0
- package/dist/blocks/TitleInput/tests.yaml +181 -0
- package/dist/blocks/Tooltip/gallery.yaml +1214 -0
- package/dist/blocks/Tooltip/tests/Tooltip.e2e.yaml +195 -0
- package/dist/blocks/Tooltip/tests.yaml +92 -0
- package/dist/blocks/Tour/gallery.yaml +2305 -0
- package/dist/blocks/Tour/tests/Tour.e2e.yaml +90 -0
- package/dist/blocks/Tour/tests.yaml +151 -0
- package/dist/blocks/TreeInput/gallery.yaml +78 -0
- package/dist/blocks/TreeInput/tests/TreeInput.e2e.yaml +139 -0
- package/dist/blocks/TreeInput/tests.yaml +140 -0
- package/dist/blocks/TreeMultipleSelector/gallery.yaml +67 -0
- package/dist/blocks/TreeSelector/gallery.yaml +81 -0
- package/dist/blocks/Watermark/gallery.yaml +479 -0
- package/dist/blocks/Watermark/tests/Watermark.e2e.yaml +62 -0
- package/dist/blocks/Watermark/tests.yaml +86 -0
- package/dist/blocks/WeekSelector/WeekSelector.js +6 -0
- package/dist/blocks/WeekSelector/e2e.js +26 -2
- package/dist/blocks/WeekSelector/gallery.yaml +589 -0
- package/dist/blocks/WeekSelector/meta.js +6 -0
- package/dist/blocks/WeekSelector/tests/WeekSelector.e2e.yaml +154 -0
- package/dist/blocks/WeekSelector/tests.yaml +122 -0
- package/dist/blocks.js +2 -0
- package/dist/disabledDate.js +91 -19
- package/dist/e2e.js +2 -0
- package/dist/getPresets.js +151 -0
- package/dist/getTagColor.js +44 -0
- package/dist/getTagSelectorOptions.js +30 -0
- package/dist/metas.js +2 -0
- package/dist/pickerPresetsStyle.css +26 -0
- package/dist/schemas/disabledDates.js +6 -2
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/presets.js +111 -0
- package/dist/tagSelectorStyle.css +68 -0
- package/package.json +13 -13
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import label from '../../schemas/label.js';
|
|
17
17
|
import icon from '../../schemas/icon.js';
|
|
18
18
|
import disabledDates from '../../schemas/disabledDates.js';
|
|
19
|
+
import { dateRangePresets } from '../../schemas/presets.js';
|
|
19
20
|
import { disabled, inputTitle, autoFocus, allowClear, sizeSmallDefaultLarge } from '../../schemas/inputProperties.js';
|
|
20
21
|
export default {
|
|
21
22
|
category: 'input',
|
|
@@ -120,6 +121,7 @@ export default {
|
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
},
|
|
124
|
+
presets: dateRangePresets,
|
|
123
125
|
separator: {
|
|
124
126
|
type: 'string',
|
|
125
127
|
default: '~',
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# Copyright 2020-2026 Lowdefy, Inc
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
id: daterangeselector
|
|
16
|
+
type: Box
|
|
17
|
+
|
|
18
|
+
events:
|
|
19
|
+
onInit:
|
|
20
|
+
- id: set_defaults
|
|
21
|
+
type: SetState
|
|
22
|
+
params:
|
|
23
|
+
drs_with_value:
|
|
24
|
+
- _date: '2024-06-01'
|
|
25
|
+
- _date: '2024-06-30'
|
|
26
|
+
drs_clearable:
|
|
27
|
+
- _date: '2024-01-01'
|
|
28
|
+
- _date: '2024-01-31'
|
|
29
|
+
|
|
30
|
+
blocks:
|
|
31
|
+
# ============================================
|
|
32
|
+
# BASIC RENDERING
|
|
33
|
+
# ============================================
|
|
34
|
+
|
|
35
|
+
- id: drs_basic
|
|
36
|
+
type: DateRangeSelector
|
|
37
|
+
properties:
|
|
38
|
+
title: Basic Date Range
|
|
39
|
+
|
|
40
|
+
- id: drs_with_value
|
|
41
|
+
type: DateRangeSelector
|
|
42
|
+
properties:
|
|
43
|
+
title: With Value
|
|
44
|
+
|
|
45
|
+
# ============================================
|
|
46
|
+
# PROPERTY TESTS
|
|
47
|
+
# ============================================
|
|
48
|
+
|
|
49
|
+
- id: drs_disabled
|
|
50
|
+
type: DateRangeSelector
|
|
51
|
+
properties:
|
|
52
|
+
title: Disabled
|
|
53
|
+
disabled: true
|
|
54
|
+
|
|
55
|
+
- id: drs_small
|
|
56
|
+
type: DateRangeSelector
|
|
57
|
+
properties:
|
|
58
|
+
title: Small Size
|
|
59
|
+
size: small
|
|
60
|
+
|
|
61
|
+
- id: drs_large
|
|
62
|
+
type: DateRangeSelector
|
|
63
|
+
properties:
|
|
64
|
+
title: Large Size
|
|
65
|
+
size: large
|
|
66
|
+
|
|
67
|
+
- id: drs_placeholder
|
|
68
|
+
type: DateRangeSelector
|
|
69
|
+
properties:
|
|
70
|
+
title: Custom Placeholder
|
|
71
|
+
placeholder:
|
|
72
|
+
- From date
|
|
73
|
+
- To date
|
|
74
|
+
|
|
75
|
+
- id: drs_borderless
|
|
76
|
+
type: DateRangeSelector
|
|
77
|
+
properties:
|
|
78
|
+
title: Borderless
|
|
79
|
+
bordered: false
|
|
80
|
+
|
|
81
|
+
- id: drs_no_allowclear
|
|
82
|
+
type: DateRangeSelector
|
|
83
|
+
properties:
|
|
84
|
+
title: No Allow Clear
|
|
85
|
+
allowClear: false
|
|
86
|
+
|
|
87
|
+
- id: drs_separator
|
|
88
|
+
type: DateRangeSelector
|
|
89
|
+
properties:
|
|
90
|
+
title: Custom Separator
|
|
91
|
+
separator: ' to '
|
|
92
|
+
|
|
93
|
+
- id: drs_with_title
|
|
94
|
+
type: DateRangeSelector
|
|
95
|
+
properties:
|
|
96
|
+
title: Date Range with Title
|
|
97
|
+
|
|
98
|
+
- id: drs_with_label
|
|
99
|
+
type: DateRangeSelector
|
|
100
|
+
properties:
|
|
101
|
+
title: Date Range Label
|
|
102
|
+
label:
|
|
103
|
+
extra: Select start and end dates
|
|
104
|
+
|
|
105
|
+
# ============================================
|
|
106
|
+
# EVENT TESTS
|
|
107
|
+
# ============================================
|
|
108
|
+
|
|
109
|
+
- id: drs_onchange
|
|
110
|
+
type: DateRangeSelector
|
|
111
|
+
properties:
|
|
112
|
+
title: OnChange Test
|
|
113
|
+
events:
|
|
114
|
+
onChange:
|
|
115
|
+
- id: set_onchange
|
|
116
|
+
type: SetState
|
|
117
|
+
params:
|
|
118
|
+
drs_onchange_value:
|
|
119
|
+
_event: value
|
|
120
|
+
|
|
121
|
+
- id: drs_onchange_display
|
|
122
|
+
type: Span
|
|
123
|
+
properties:
|
|
124
|
+
content:
|
|
125
|
+
_if:
|
|
126
|
+
test:
|
|
127
|
+
_ne:
|
|
128
|
+
- _state: drs_onchange_value
|
|
129
|
+
- null
|
|
130
|
+
then: Range selected
|
|
131
|
+
else: ''
|
|
132
|
+
|
|
133
|
+
# ============================================
|
|
134
|
+
# INTERACTION TESTS
|
|
135
|
+
# ============================================
|
|
136
|
+
|
|
137
|
+
- id: drs_interaction
|
|
138
|
+
type: DateRangeSelector
|
|
139
|
+
properties:
|
|
140
|
+
title: Interaction Test
|
|
141
|
+
|
|
142
|
+
- id: drs_clearable
|
|
143
|
+
type: DateRangeSelector
|
|
144
|
+
properties:
|
|
145
|
+
title: Clearable
|
|
146
|
+
allowClear: true
|
|
147
|
+
|
|
148
|
+
# ============================================
|
|
149
|
+
# PRESETS
|
|
150
|
+
# ============================================
|
|
151
|
+
|
|
152
|
+
- id: drs_presets
|
|
153
|
+
type: DateRangeSelector
|
|
154
|
+
properties:
|
|
155
|
+
title: Presets
|
|
156
|
+
format: YYYY-MM-DD
|
|
157
|
+
presets:
|
|
158
|
+
- label: Q1 2024
|
|
159
|
+
value: ['2024-01-01', '2024-03-31']
|
|
160
|
+
- label: Q2 2024
|
|
161
|
+
value:
|
|
162
|
+
- _date: '2024-04-01'
|
|
163
|
+
- _date: '2024-06-30'
|
|
164
|
+
- label: '<b>Html label</b>'
|
|
165
|
+
value: ['2024-07-01', '2024-09-30']
|
|
166
|
+
|
|
167
|
+
- id: drs_no_presets
|
|
168
|
+
type: DateRangeSelector
|
|
169
|
+
properties:
|
|
170
|
+
title: No Presets
|
|
171
|
+
|
|
172
|
+
- id: drs_presets_min_now
|
|
173
|
+
type: DateRangeSelector
|
|
174
|
+
properties:
|
|
175
|
+
title: Presets with a minimum date
|
|
176
|
+
format: YYYY-MM-DD
|
|
177
|
+
disabledDates:
|
|
178
|
+
min:
|
|
179
|
+
_dayjs: [now, { format: YYYY-MM-DD }]
|
|
180
|
+
presets:
|
|
181
|
+
- label: Last 7 Days
|
|
182
|
+
value:
|
|
183
|
+
- _dayjs: [now, { subtract: [7, days] }, { format: YYYY-MM-DD }]
|
|
184
|
+
- _dayjs: [now, { format: YYYY-MM-DD }]
|
|
185
|
+
- label: Next 7 Days
|
|
186
|
+
value:
|
|
187
|
+
- _dayjs: [now, { format: YYYY-MM-DD }]
|
|
188
|
+
- _dayjs: [now, { add: [7, days] }, { format: YYYY-MM-DD }]
|
|
189
|
+
- label: Last Year
|
|
190
|
+
value: ['2025-01-01', '2025-12-31']
|
|
191
|
+
|
|
192
|
+
- id: drs_presets_max_now
|
|
193
|
+
type: DateRangeSelector
|
|
194
|
+
properties:
|
|
195
|
+
title: Presets with a maximum date
|
|
196
|
+
format: YYYY-MM-DD
|
|
197
|
+
disabledDates:
|
|
198
|
+
max:
|
|
199
|
+
_dayjs: [now, { format: YYYY-MM-DD }]
|
|
200
|
+
presets:
|
|
201
|
+
- label: Next 7 Days
|
|
202
|
+
value:
|
|
203
|
+
- _dayjs: [now, { format: YYYY-MM-DD }]
|
|
204
|
+
- _dayjs: [now, { add: [7, days] }, { format: YYYY-MM-DD }]
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Copyright 2020-2026 Lowdefy, Inc
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
- id: default
|
|
16
|
+
type: DateRangeSelector
|
|
17
|
+
- id: properties.title
|
|
18
|
+
type: DateRangeSelector
|
|
19
|
+
properties:
|
|
20
|
+
title: DateRangeSelector title
|
|
21
|
+
- id: 'property.allowClear: false'
|
|
22
|
+
type: DateRangeSelector
|
|
23
|
+
properties:
|
|
24
|
+
allowClear: false
|
|
25
|
+
- id: 'property.autoFocus: true'
|
|
26
|
+
type: DateRangeSelector
|
|
27
|
+
properties:
|
|
28
|
+
autoFocus: true
|
|
29
|
+
- id: 'properties.bordered: false'
|
|
30
|
+
type: DateRangeSelector
|
|
31
|
+
properties:
|
|
32
|
+
bordered: false
|
|
33
|
+
- id: 'property.disabled: true'
|
|
34
|
+
type: DateRangeSelector
|
|
35
|
+
properties:
|
|
36
|
+
disabled: true
|
|
37
|
+
- id: 'property.format: YYYY-MMM-DD'
|
|
38
|
+
type: DateRangeSelector
|
|
39
|
+
properties:
|
|
40
|
+
format: YYYY-MMM-DD
|
|
41
|
+
- id: 'property.placeholder: - Start Date - End Date'
|
|
42
|
+
type: DateRangeSelector
|
|
43
|
+
properties:
|
|
44
|
+
placeholder:
|
|
45
|
+
- From this Start Date
|
|
46
|
+
- To this End Date
|
|
47
|
+
- id: 'property.separator: ǁ'
|
|
48
|
+
type: DateRangeSelector
|
|
49
|
+
properties:
|
|
50
|
+
separator: ǁ
|
|
51
|
+
- id: 'property.size: small'
|
|
52
|
+
type: DateRangeSelector
|
|
53
|
+
properties:
|
|
54
|
+
size: small
|
|
55
|
+
- id: 'property.size: large'
|
|
56
|
+
type: DateRangeSelector
|
|
57
|
+
properties:
|
|
58
|
+
size: large
|
|
59
|
+
- id: 'property.suffixIcon: AiOutlineCalendar'
|
|
60
|
+
type: DateRangeSelector
|
|
61
|
+
properties:
|
|
62
|
+
suffixIcon: AiOutlineCalendar
|
|
63
|
+
- id: 'property.suffixIcon Red: AiOutlineCalendar'
|
|
64
|
+
type: DateRangeSelector
|
|
65
|
+
properties:
|
|
66
|
+
suffixIcon:
|
|
67
|
+
name: AiOutlineCalendar
|
|
68
|
+
color: Red
|
|
69
|
+
- id: 'properties.inputStyle: CSS style applied'
|
|
70
|
+
type: DateRangeSelector
|
|
71
|
+
properties:
|
|
72
|
+
inputStyle:
|
|
73
|
+
border: 1px solid red
|
|
74
|
+
- id: 'property.label span: 5'
|
|
75
|
+
type: DateRangeSelector
|
|
76
|
+
properties:
|
|
77
|
+
label:
|
|
78
|
+
span: 5
|
|
79
|
+
- id: 'property.label align: right'
|
|
80
|
+
type: DateRangeSelector
|
|
81
|
+
properties:
|
|
82
|
+
label:
|
|
83
|
+
align: right
|
|
84
|
+
- id: 'property.label inline: true'
|
|
85
|
+
type: DateRangeSelector
|
|
86
|
+
properties:
|
|
87
|
+
label:
|
|
88
|
+
inline: true
|
|
89
|
+
- id: 'property.label disabled: true'
|
|
90
|
+
type: DateRangeSelector
|
|
91
|
+
properties:
|
|
92
|
+
label:
|
|
93
|
+
disabled: true
|
|
94
|
+
- id: 'property.label colon: true'
|
|
95
|
+
type: DateRangeSelector
|
|
96
|
+
properties:
|
|
97
|
+
label:
|
|
98
|
+
colon: true
|
|
99
|
+
- id: 'property.label extra: extra text added'
|
|
100
|
+
type: DateRangeSelector
|
|
101
|
+
properties:
|
|
102
|
+
label:
|
|
103
|
+
extra: extra text added
|
|
104
|
+
- id: 'properties.disabledDates.min'
|
|
105
|
+
type: DateRangeSelector
|
|
106
|
+
properties:
|
|
107
|
+
disabledDates:
|
|
108
|
+
min: 2020-10-20
|
|
109
|
+
- id: 'properties.disabledDates.max'
|
|
110
|
+
type: DateRangeSelector
|
|
111
|
+
properties:
|
|
112
|
+
disabledDates:
|
|
113
|
+
max: 2020-10-15
|
|
114
|
+
- id: 'properties.disabledDates.dates'
|
|
115
|
+
type: DateRangeSelector
|
|
116
|
+
properties:
|
|
117
|
+
disabledDates:
|
|
118
|
+
dates:
|
|
119
|
+
- _date: 2020-10-26
|
|
120
|
+
- 2020-10-29
|
|
121
|
+
- 2020-11-02
|
|
122
|
+
- id: 'properties.disabledDates.ranges'
|
|
123
|
+
type: DateRangeSelector
|
|
124
|
+
properties:
|
|
125
|
+
disabledDates:
|
|
126
|
+
ranges:
|
|
127
|
+
- ['2020-10-26', '2020-10-29']
|
|
128
|
+
- - 2020-11-01
|
|
129
|
+
- 2020-11-02
|
|
@@ -21,6 +21,7 @@ import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
|
21
21
|
import Label from '../Label/Label.js';
|
|
22
22
|
import withTheme from '../withTheme.js';
|
|
23
23
|
import disabledDate from '../../disabledDate.js';
|
|
24
|
+
import getPresets from '../../getPresets.js';
|
|
24
25
|
dayjs.extend(utc);
|
|
25
26
|
const DateSelector = ({ blockId, classNames = {}, components: { Icon }, events, loading, methods, properties, required, styles = {}, validation, value })=>{
|
|
26
27
|
const [elementId] = useState((0 | Math.random() * 9e2) + 1e2);
|
|
@@ -61,6 +62,11 @@ const DateSelector = ({ blockId, classNames = {}, components: { Icon }, events,
|
|
|
61
62
|
format: properties.format ?? getLocaleDateFormat(methods.getLocale?.()) ?? 'YYYY-MM-DD',
|
|
62
63
|
getPopupContainer: ()=>document.getElementById(`${blockId}_${elementId}_popup`),
|
|
63
64
|
placeholder: properties.placeholder,
|
|
65
|
+
presets: getPresets({
|
|
66
|
+
disabledDates: properties.disabledDates,
|
|
67
|
+
methods,
|
|
68
|
+
presets: properties.presets
|
|
69
|
+
}),
|
|
64
70
|
showToday: properties.showToday,
|
|
65
71
|
size: properties.size,
|
|
66
72
|
status: validation.status,
|
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
17
|
const locator = (page, blockId)=>page.locator(`.ant-picker:has(#${escapeId(blockId)}_input)`);
|
|
18
18
|
const input = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
19
|
+
// The block renders the picker popup into a container inside itself, so the dropdown is scoped to
|
|
20
|
+
// the block rather than to every open picker on the page.
|
|
21
|
+
const pickerDropdown = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-picker-dropdown`);
|
|
22
|
+
const presets = (page, blockId)=>pickerDropdown(page, blockId).locator('.ant-picker-presets');
|
|
23
|
+
const presetItem = (page, blockId, label)=>presets(page, blockId).locator('li', {
|
|
24
|
+
hasText: label
|
|
25
|
+
});
|
|
19
26
|
const monthNames = [
|
|
20
27
|
'Jan',
|
|
21
28
|
'Feb',
|
|
@@ -73,11 +80,18 @@ export default createBlockHelper({
|
|
|
73
80
|
select: async (page, blockId, dateString)=>{
|
|
74
81
|
const [year, month] = dateString.split('-').map(Number);
|
|
75
82
|
await locator(page, blockId).click();
|
|
76
|
-
const dropdown = page
|
|
83
|
+
const dropdown = pickerDropdown(page, blockId);
|
|
77
84
|
await expect(dropdown).toBeVisible();
|
|
78
85
|
await navigateToMonth(dropdown, year, month);
|
|
79
86
|
await dropdown.locator(`.ant-picker-cell-in-view[title="${dateString}"]`).click();
|
|
80
87
|
},
|
|
88
|
+
selectPreset: async (page, blockId, label)=>{
|
|
89
|
+
await locator(page, blockId).click();
|
|
90
|
+
await expect(pickerDropdown(page, blockId)).toBeVisible();
|
|
91
|
+
await presets(page, blockId).getByText(label, {
|
|
92
|
+
exact: true
|
|
93
|
+
}).click();
|
|
94
|
+
},
|
|
81
95
|
clear: async (page, blockId)=>{
|
|
82
96
|
await locator(page, blockId).hover();
|
|
83
97
|
await locator(page, blockId).locator('.ant-picker-clear').click();
|
|
@@ -85,6 +99,18 @@ export default createBlockHelper({
|
|
|
85
99
|
},
|
|
86
100
|
expect: {
|
|
87
101
|
value: (page, blockId, val)=>expect(input(page, blockId)).toHaveValue(val),
|
|
88
|
-
placeholder: (page, blockId, text)=>expect(input(page, blockId)).toHaveAttribute('placeholder', text)
|
|
102
|
+
placeholder: (page, blockId, text)=>expect(input(page, blockId)).toHaveAttribute('placeholder', text),
|
|
103
|
+
presetLabels: (page, blockId, labels)=>expect(presets(page, blockId).locator('li')).toHaveText(labels),
|
|
104
|
+
presetLabelHtml: (page, blockId, { selector, text })=>expect(presets(page, blockId).locator(selector)).toHaveText(text),
|
|
105
|
+
noPresets: (page, blockId)=>expect(presets(page, blockId)).toHaveCount(0),
|
|
106
|
+
// A preset the calendar cannot select is disabled through the list item's pointer events, so
|
|
107
|
+
// asserting on those checks the shortcut is really unclickable and not only styled as such.
|
|
108
|
+
presetDisabled: (page, blockId, label)=>expect(presetItem(page, blockId, label)).toHaveCSS('pointer-events', 'none'),
|
|
109
|
+
presetEnabled: (page, blockId, label)=>expect(presetItem(page, blockId, label)).toHaveCSS('pointer-events', 'auto'),
|
|
110
|
+
dateDisabled: (page, blockId, dateString)=>expect(pickerDropdown(page, blockId).locator(`.ant-picker-cell[title="${dateString}"]`).first()).toHaveClass(/ant-picker-cell-disabled/),
|
|
111
|
+
dateEnabled: (page, blockId, dateString)=>expect(pickerDropdown(page, blockId).locator(`.ant-picker-cell[title="${dateString}"]`).first()).not.toHaveClass(/ant-picker-cell-disabled/),
|
|
112
|
+
// The picker only closes the popup once it accepts the value, so a closed popup is the
|
|
113
|
+
// signal that a selection was committed rather than just shown in the input.
|
|
114
|
+
closed: (page, blockId)=>expect(pickerDropdown(page, blockId)).toBeHidden()
|
|
89
115
|
}
|
|
90
116
|
});
|