@lowdefy/blocks-antd 5.5.1 → 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/CheckboxSelector.js +54 -29
- package/dist/blocks/CheckboxSelector/gallery.yaml +781 -0
- package/dist/blocks/CheckboxSelector/meta.js +24 -4
- 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 +4 -4
- package/dist/blocks/Label/gallery.yaml +762 -0
- package/dist/blocks/Label/labelLogic.js +4 -1
- 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/RadioSelector.js +50 -25
- package/dist/blocks/RadioSelector/gallery.yaml +816 -0
- package/dist/blocks/RadioSelector/meta.js +23 -3
- 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
|
@@ -0,0 +1,493 @@
|
|
|
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: modal
|
|
16
|
+
type: Box
|
|
17
|
+
|
|
18
|
+
blocks:
|
|
19
|
+
# ============================================
|
|
20
|
+
# BASIC RENDERING
|
|
21
|
+
# ============================================
|
|
22
|
+
|
|
23
|
+
- id: modal_basic
|
|
24
|
+
type: Modal
|
|
25
|
+
properties:
|
|
26
|
+
title: Basic Modal
|
|
27
|
+
slots:
|
|
28
|
+
content:
|
|
29
|
+
blocks:
|
|
30
|
+
- id: modal_basic_content
|
|
31
|
+
type: Paragraph
|
|
32
|
+
properties:
|
|
33
|
+
content: This is the modal content.
|
|
34
|
+
|
|
35
|
+
- id: open_basic
|
|
36
|
+
type: Button
|
|
37
|
+
properties:
|
|
38
|
+
title: Open Basic Modal
|
|
39
|
+
events:
|
|
40
|
+
onClick:
|
|
41
|
+
- id: open_modal
|
|
42
|
+
type: CallMethod
|
|
43
|
+
params:
|
|
44
|
+
blockId: modal_basic
|
|
45
|
+
method: setOpen
|
|
46
|
+
args:
|
|
47
|
+
- open: true
|
|
48
|
+
|
|
49
|
+
# ============================================
|
|
50
|
+
# PROPERTY TESTS
|
|
51
|
+
# ============================================
|
|
52
|
+
|
|
53
|
+
# Custom title
|
|
54
|
+
- id: modal_custom_title
|
|
55
|
+
type: Modal
|
|
56
|
+
properties:
|
|
57
|
+
title: <strong>Custom HTML Title</strong>
|
|
58
|
+
slots:
|
|
59
|
+
content:
|
|
60
|
+
blocks:
|
|
61
|
+
- id: modal_custom_title_content
|
|
62
|
+
type: Paragraph
|
|
63
|
+
properties:
|
|
64
|
+
content: Modal with custom title.
|
|
65
|
+
|
|
66
|
+
- id: open_custom_title
|
|
67
|
+
type: Button
|
|
68
|
+
properties:
|
|
69
|
+
title: Open Custom Title Modal
|
|
70
|
+
events:
|
|
71
|
+
onClick:
|
|
72
|
+
- id: open_modal
|
|
73
|
+
type: CallMethod
|
|
74
|
+
params:
|
|
75
|
+
blockId: modal_custom_title
|
|
76
|
+
method: setOpen
|
|
77
|
+
args:
|
|
78
|
+
- open: true
|
|
79
|
+
|
|
80
|
+
# Centered modal
|
|
81
|
+
- id: modal_centered
|
|
82
|
+
type: Modal
|
|
83
|
+
properties:
|
|
84
|
+
title: Centered Modal
|
|
85
|
+
centered: true
|
|
86
|
+
slots:
|
|
87
|
+
content:
|
|
88
|
+
blocks:
|
|
89
|
+
- id: modal_centered_content
|
|
90
|
+
type: Paragraph
|
|
91
|
+
properties:
|
|
92
|
+
content: This modal is centered vertically.
|
|
93
|
+
|
|
94
|
+
- id: open_centered
|
|
95
|
+
type: Button
|
|
96
|
+
properties:
|
|
97
|
+
title: Open Centered Modal
|
|
98
|
+
events:
|
|
99
|
+
onClick:
|
|
100
|
+
- id: open_modal
|
|
101
|
+
type: CallMethod
|
|
102
|
+
params:
|
|
103
|
+
blockId: modal_centered
|
|
104
|
+
method: setOpen
|
|
105
|
+
args:
|
|
106
|
+
- open: true
|
|
107
|
+
|
|
108
|
+
# No close button
|
|
109
|
+
- id: modal_no_close
|
|
110
|
+
type: Modal
|
|
111
|
+
properties:
|
|
112
|
+
title: No Close Button
|
|
113
|
+
closable: false
|
|
114
|
+
slots:
|
|
115
|
+
content:
|
|
116
|
+
blocks:
|
|
117
|
+
- id: modal_no_close_content
|
|
118
|
+
type: Paragraph
|
|
119
|
+
properties:
|
|
120
|
+
content: This modal has no close button.
|
|
121
|
+
|
|
122
|
+
- id: open_no_close
|
|
123
|
+
type: Button
|
|
124
|
+
properties:
|
|
125
|
+
title: Open No Close Modal
|
|
126
|
+
events:
|
|
127
|
+
onClick:
|
|
128
|
+
- id: open_modal
|
|
129
|
+
type: CallMethod
|
|
130
|
+
params:
|
|
131
|
+
blockId: modal_no_close
|
|
132
|
+
method: setOpen
|
|
133
|
+
args:
|
|
134
|
+
- open: true
|
|
135
|
+
|
|
136
|
+
# Custom button text
|
|
137
|
+
- id: modal_custom_buttons
|
|
138
|
+
type: Modal
|
|
139
|
+
properties:
|
|
140
|
+
title: Custom Buttons
|
|
141
|
+
okText: Confirm
|
|
142
|
+
cancelText: Dismiss
|
|
143
|
+
slots:
|
|
144
|
+
content:
|
|
145
|
+
blocks:
|
|
146
|
+
- id: modal_custom_buttons_content
|
|
147
|
+
type: Paragraph
|
|
148
|
+
properties:
|
|
149
|
+
content: Modal with custom button text.
|
|
150
|
+
|
|
151
|
+
- id: open_custom_buttons
|
|
152
|
+
type: Button
|
|
153
|
+
properties:
|
|
154
|
+
title: Open Custom Buttons Modal
|
|
155
|
+
events:
|
|
156
|
+
onClick:
|
|
157
|
+
- id: open_modal
|
|
158
|
+
type: CallMethod
|
|
159
|
+
params:
|
|
160
|
+
blockId: modal_custom_buttons
|
|
161
|
+
method: setOpen
|
|
162
|
+
args:
|
|
163
|
+
- open: true
|
|
164
|
+
|
|
165
|
+
# Custom width
|
|
166
|
+
- id: modal_custom_width
|
|
167
|
+
type: Modal
|
|
168
|
+
properties:
|
|
169
|
+
title: Custom Width
|
|
170
|
+
width: 800
|
|
171
|
+
slots:
|
|
172
|
+
content:
|
|
173
|
+
blocks:
|
|
174
|
+
- id: modal_custom_width_content
|
|
175
|
+
type: Paragraph
|
|
176
|
+
properties:
|
|
177
|
+
content: This modal is 800px wide.
|
|
178
|
+
|
|
179
|
+
- id: open_custom_width
|
|
180
|
+
type: Button
|
|
181
|
+
properties:
|
|
182
|
+
title: Open Wide Modal
|
|
183
|
+
events:
|
|
184
|
+
onClick:
|
|
185
|
+
- id: open_modal
|
|
186
|
+
type: CallMethod
|
|
187
|
+
params:
|
|
188
|
+
blockId: modal_custom_width
|
|
189
|
+
method: setOpen
|
|
190
|
+
args:
|
|
191
|
+
- open: true
|
|
192
|
+
|
|
193
|
+
# No footer
|
|
194
|
+
- id: modal_no_footer
|
|
195
|
+
type: Modal
|
|
196
|
+
properties:
|
|
197
|
+
title: No Footer
|
|
198
|
+
footer: false
|
|
199
|
+
slots:
|
|
200
|
+
content:
|
|
201
|
+
blocks:
|
|
202
|
+
- id: modal_no_footer_content
|
|
203
|
+
type: Paragraph
|
|
204
|
+
properties:
|
|
205
|
+
content: This modal has no footer.
|
|
206
|
+
|
|
207
|
+
- id: open_no_footer
|
|
208
|
+
type: Button
|
|
209
|
+
properties:
|
|
210
|
+
title: Open No Footer Modal
|
|
211
|
+
events:
|
|
212
|
+
onClick:
|
|
213
|
+
- id: open_modal
|
|
214
|
+
type: CallMethod
|
|
215
|
+
params:
|
|
216
|
+
blockId: modal_no_footer
|
|
217
|
+
method: setOpen
|
|
218
|
+
args:
|
|
219
|
+
- open: true
|
|
220
|
+
|
|
221
|
+
# Mask not closable
|
|
222
|
+
- id: modal_mask_not_closable
|
|
223
|
+
type: Modal
|
|
224
|
+
properties:
|
|
225
|
+
title: Mask Not Closable
|
|
226
|
+
maskClosable: false
|
|
227
|
+
slots:
|
|
228
|
+
content:
|
|
229
|
+
blocks:
|
|
230
|
+
- id: modal_mask_not_closable_content
|
|
231
|
+
type: Paragraph
|
|
232
|
+
properties:
|
|
233
|
+
content: Click on mask does not close this modal.
|
|
234
|
+
|
|
235
|
+
- id: open_mask_not_closable
|
|
236
|
+
type: Button
|
|
237
|
+
properties:
|
|
238
|
+
title: Open Mask Not Closable Modal
|
|
239
|
+
events:
|
|
240
|
+
onClick:
|
|
241
|
+
- id: open_modal
|
|
242
|
+
type: CallMethod
|
|
243
|
+
params:
|
|
244
|
+
blockId: modal_mask_not_closable
|
|
245
|
+
method: setOpen
|
|
246
|
+
args:
|
|
247
|
+
- open: true
|
|
248
|
+
|
|
249
|
+
# ============================================
|
|
250
|
+
# EVENT TESTS
|
|
251
|
+
# ============================================
|
|
252
|
+
|
|
253
|
+
# onOk event
|
|
254
|
+
- id: modal_onok
|
|
255
|
+
type: Modal
|
|
256
|
+
properties:
|
|
257
|
+
title: OnOk Event Test
|
|
258
|
+
events:
|
|
259
|
+
onOk:
|
|
260
|
+
- id: set_ok_fired
|
|
261
|
+
type: SetState
|
|
262
|
+
params:
|
|
263
|
+
modal_ok_fired: true
|
|
264
|
+
slots:
|
|
265
|
+
content:
|
|
266
|
+
blocks:
|
|
267
|
+
- id: modal_onok_content
|
|
268
|
+
type: Paragraph
|
|
269
|
+
properties:
|
|
270
|
+
content: Click Ok to test onOk event.
|
|
271
|
+
|
|
272
|
+
- id: open_onok
|
|
273
|
+
type: Button
|
|
274
|
+
properties:
|
|
275
|
+
title: Open OnOk Modal
|
|
276
|
+
events:
|
|
277
|
+
onClick:
|
|
278
|
+
- id: open_modal
|
|
279
|
+
type: CallMethod
|
|
280
|
+
params:
|
|
281
|
+
blockId: modal_onok
|
|
282
|
+
method: setOpen
|
|
283
|
+
args:
|
|
284
|
+
- open: true
|
|
285
|
+
|
|
286
|
+
- id: onok_display
|
|
287
|
+
type: Span
|
|
288
|
+
properties:
|
|
289
|
+
content:
|
|
290
|
+
_if:
|
|
291
|
+
test:
|
|
292
|
+
_eq:
|
|
293
|
+
- _state: modal_ok_fired
|
|
294
|
+
- true
|
|
295
|
+
then: Ok fired
|
|
296
|
+
else: ''
|
|
297
|
+
|
|
298
|
+
# onCancel event
|
|
299
|
+
- id: modal_oncancel
|
|
300
|
+
type: Modal
|
|
301
|
+
properties:
|
|
302
|
+
title: OnCancel Event Test
|
|
303
|
+
events:
|
|
304
|
+
onCancel:
|
|
305
|
+
- id: set_cancel_fired
|
|
306
|
+
type: SetState
|
|
307
|
+
params:
|
|
308
|
+
modal_cancel_fired: true
|
|
309
|
+
slots:
|
|
310
|
+
content:
|
|
311
|
+
blocks:
|
|
312
|
+
- id: modal_oncancel_content
|
|
313
|
+
type: Paragraph
|
|
314
|
+
properties:
|
|
315
|
+
content: Click Cancel to test onCancel event.
|
|
316
|
+
|
|
317
|
+
- id: open_oncancel
|
|
318
|
+
type: Button
|
|
319
|
+
properties:
|
|
320
|
+
title: Open OnCancel Modal
|
|
321
|
+
events:
|
|
322
|
+
onClick:
|
|
323
|
+
- id: open_modal
|
|
324
|
+
type: CallMethod
|
|
325
|
+
params:
|
|
326
|
+
blockId: modal_oncancel
|
|
327
|
+
method: setOpen
|
|
328
|
+
args:
|
|
329
|
+
- open: true
|
|
330
|
+
|
|
331
|
+
- id: oncancel_display
|
|
332
|
+
type: Span
|
|
333
|
+
properties:
|
|
334
|
+
content:
|
|
335
|
+
_if:
|
|
336
|
+
test:
|
|
337
|
+
_eq:
|
|
338
|
+
- _state: modal_cancel_fired
|
|
339
|
+
- true
|
|
340
|
+
then: Cancel fired
|
|
341
|
+
else: ''
|
|
342
|
+
|
|
343
|
+
# onOpen event
|
|
344
|
+
- id: modal_onopen
|
|
345
|
+
type: Modal
|
|
346
|
+
properties:
|
|
347
|
+
title: OnOpen Event Test
|
|
348
|
+
events:
|
|
349
|
+
onOpen:
|
|
350
|
+
- id: set_open_fired
|
|
351
|
+
type: SetState
|
|
352
|
+
params:
|
|
353
|
+
modal_open_fired: true
|
|
354
|
+
slots:
|
|
355
|
+
content:
|
|
356
|
+
blocks:
|
|
357
|
+
- id: modal_onopen_content
|
|
358
|
+
type: Paragraph
|
|
359
|
+
properties:
|
|
360
|
+
content: Modal has onOpen event.
|
|
361
|
+
|
|
362
|
+
- id: open_onopen
|
|
363
|
+
type: Button
|
|
364
|
+
properties:
|
|
365
|
+
title: Open OnOpen Modal
|
|
366
|
+
events:
|
|
367
|
+
onClick:
|
|
368
|
+
- id: open_modal
|
|
369
|
+
type: CallMethod
|
|
370
|
+
params:
|
|
371
|
+
blockId: modal_onopen
|
|
372
|
+
method: setOpen
|
|
373
|
+
args:
|
|
374
|
+
- open: true
|
|
375
|
+
|
|
376
|
+
- id: onopen_display
|
|
377
|
+
type: Span
|
|
378
|
+
properties:
|
|
379
|
+
content:
|
|
380
|
+
_if:
|
|
381
|
+
test:
|
|
382
|
+
_eq:
|
|
383
|
+
- _state: modal_open_fired
|
|
384
|
+
- true
|
|
385
|
+
then: Open fired
|
|
386
|
+
else: ''
|
|
387
|
+
|
|
388
|
+
# onClose event
|
|
389
|
+
- id: modal_onclose
|
|
390
|
+
type: Modal
|
|
391
|
+
properties:
|
|
392
|
+
title: OnClose Event Test
|
|
393
|
+
events:
|
|
394
|
+
onClose:
|
|
395
|
+
- id: set_close_fired
|
|
396
|
+
type: SetState
|
|
397
|
+
params:
|
|
398
|
+
modal_close_fired: true
|
|
399
|
+
slots:
|
|
400
|
+
content:
|
|
401
|
+
blocks:
|
|
402
|
+
- id: modal_onclose_content
|
|
403
|
+
type: Paragraph
|
|
404
|
+
properties:
|
|
405
|
+
content: Modal has onClose event.
|
|
406
|
+
|
|
407
|
+
- id: open_onclose
|
|
408
|
+
type: Button
|
|
409
|
+
properties:
|
|
410
|
+
title: Open OnClose Modal
|
|
411
|
+
events:
|
|
412
|
+
onClick:
|
|
413
|
+
- id: open_modal
|
|
414
|
+
type: CallMethod
|
|
415
|
+
params:
|
|
416
|
+
blockId: modal_onclose
|
|
417
|
+
method: setOpen
|
|
418
|
+
args:
|
|
419
|
+
- open: true
|
|
420
|
+
|
|
421
|
+
- id: onclose_display
|
|
422
|
+
type: Span
|
|
423
|
+
properties:
|
|
424
|
+
content:
|
|
425
|
+
_if:
|
|
426
|
+
test:
|
|
427
|
+
_eq:
|
|
428
|
+
- _state: modal_close_fired
|
|
429
|
+
- true
|
|
430
|
+
then: Close fired
|
|
431
|
+
else: ''
|
|
432
|
+
|
|
433
|
+
# ============================================
|
|
434
|
+
# METHOD TESTS
|
|
435
|
+
# ============================================
|
|
436
|
+
|
|
437
|
+
# toggleOpen method
|
|
438
|
+
- id: modal_toggle
|
|
439
|
+
type: Modal
|
|
440
|
+
properties:
|
|
441
|
+
title: Toggle Modal
|
|
442
|
+
slots:
|
|
443
|
+
content:
|
|
444
|
+
blocks:
|
|
445
|
+
- id: modal_toggle_content
|
|
446
|
+
type: Paragraph
|
|
447
|
+
properties:
|
|
448
|
+
content: Test toggleOpen method.
|
|
449
|
+
|
|
450
|
+
- id: toggle_modal
|
|
451
|
+
type: Button
|
|
452
|
+
properties:
|
|
453
|
+
title: Toggle Modal
|
|
454
|
+
events:
|
|
455
|
+
onClick:
|
|
456
|
+
- id: toggle
|
|
457
|
+
type: CallMethod
|
|
458
|
+
params:
|
|
459
|
+
blockId: modal_toggle
|
|
460
|
+
method: toggleOpen
|
|
461
|
+
|
|
462
|
+
# Custom footer area
|
|
463
|
+
- id: modal_custom_footer
|
|
464
|
+
type: Modal
|
|
465
|
+
properties:
|
|
466
|
+
title: Custom Footer Modal
|
|
467
|
+
slots:
|
|
468
|
+
content:
|
|
469
|
+
blocks:
|
|
470
|
+
- id: modal_custom_footer_content
|
|
471
|
+
type: Paragraph
|
|
472
|
+
properties:
|
|
473
|
+
content: This modal has a custom footer.
|
|
474
|
+
footer:
|
|
475
|
+
blocks:
|
|
476
|
+
- id: custom_footer_text
|
|
477
|
+
type: Paragraph
|
|
478
|
+
properties:
|
|
479
|
+
content: Custom footer content
|
|
480
|
+
|
|
481
|
+
- id: open_custom_footer
|
|
482
|
+
type: Button
|
|
483
|
+
properties:
|
|
484
|
+
title: Open Custom Footer Modal
|
|
485
|
+
events:
|
|
486
|
+
onClick:
|
|
487
|
+
- id: open_modal
|
|
488
|
+
type: CallMethod
|
|
489
|
+
params:
|
|
490
|
+
blockId: modal_custom_footer
|
|
491
|
+
method: setOpen
|
|
492
|
+
args:
|
|
493
|
+
- open: true
|
|
@@ -0,0 +1,75 @@
|
|
|
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: Modal
|
|
17
|
+
- id: properties.title
|
|
18
|
+
type: Modal
|
|
19
|
+
properties:
|
|
20
|
+
title: Modal title
|
|
21
|
+
- id: 'properties: centered: true'
|
|
22
|
+
type: Modal
|
|
23
|
+
properties:
|
|
24
|
+
centered: true
|
|
25
|
+
- id: 'properties: closable: false'
|
|
26
|
+
type: Modal
|
|
27
|
+
properties:
|
|
28
|
+
closable: false
|
|
29
|
+
- id: 'properties: footer: false'
|
|
30
|
+
type: Modal
|
|
31
|
+
properties:
|
|
32
|
+
footer: false
|
|
33
|
+
- id: 'properties: mask: false'
|
|
34
|
+
type: Modal
|
|
35
|
+
properties:
|
|
36
|
+
mask: false
|
|
37
|
+
- id: 'properties: maskClosable: false'
|
|
38
|
+
type: Modal
|
|
39
|
+
properties:
|
|
40
|
+
maskClosable: false
|
|
41
|
+
- id: 'properties: okText: Text of the OK button'
|
|
42
|
+
type: Modal
|
|
43
|
+
properties:
|
|
44
|
+
okText: Text of the OK button
|
|
45
|
+
- id: 'properties: cancelText: Text of the Cancel button'
|
|
46
|
+
type: Modal
|
|
47
|
+
properties:
|
|
48
|
+
cancelText: Text of the Cancel button
|
|
49
|
+
- id: 'properties: width: 350px - 520px is default'
|
|
50
|
+
type: Modal
|
|
51
|
+
properties:
|
|
52
|
+
width: 350
|
|
53
|
+
- id: 'properties: zIndex: 1200 - 1000 is the default'
|
|
54
|
+
type: Modal
|
|
55
|
+
properties:
|
|
56
|
+
zIndex: 1200
|
|
57
|
+
- id: 'properties: bodyStyle: border: 10px solid blue'
|
|
58
|
+
type: Modal
|
|
59
|
+
properties:
|
|
60
|
+
bodyStyle:
|
|
61
|
+
border: 10px solid blue
|
|
62
|
+
- id: 'properties: maskStyle: border: 10px solid blue'
|
|
63
|
+
type: Modal
|
|
64
|
+
properties:
|
|
65
|
+
maskStyle:
|
|
66
|
+
border: 10px solid blue
|
|
67
|
+
- id: 'properties: wrapperStyle: border: 10px solid blue'
|
|
68
|
+
type: Modal
|
|
69
|
+
properties:
|
|
70
|
+
wrapperStyle:
|
|
71
|
+
border: 10px solid blue
|
|
72
|
+
- id: 'with html in title'
|
|
73
|
+
type: Modal
|
|
74
|
+
properties:
|
|
75
|
+
title: '<div style="color:green;">Modal Html Title</div>'
|
|
@@ -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 MonthSelector = ({ blockId, classNames = {}, components: { Icon }, events, loading, methods, properties, required, styles = {}, validation, value })=>{
|
|
26
27
|
const [elementId] = useState((0 | Math.random() * 9e2) + 1e2);
|
|
@@ -63,6 +64,11 @@ const MonthSelector = ({ blockId, classNames = {}, components: { Icon }, events,
|
|
|
63
64
|
format: properties.format ?? getLocaleDateFormat(methods.getLocale?.(), 'month') ?? 'YYYY-MM',
|
|
64
65
|
getPopupContainer: ()=>document.getElementById(`${blockId}_${elementId}_popup`),
|
|
65
66
|
placeholder: properties.placeholder,
|
|
67
|
+
presets: getPresets({
|
|
68
|
+
disabledDates: properties.disabledDates,
|
|
69
|
+
methods,
|
|
70
|
+
presets: properties.presets
|
|
71
|
+
}),
|
|
66
72
|
size: properties.size,
|
|
67
73
|
status: validation.status,
|
|
68
74
|
value: type.isDate(value) ? dayjs.utc(value).startOf('month') : null,
|
|
@@ -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 navigateToYear = async (dropdown, targetYear)=>{
|
|
20
27
|
const headerView = dropdown.locator('.ant-picker-header-view');
|
|
21
28
|
while(true){
|
|
@@ -45,11 +52,18 @@ export default createBlockHelper({
|
|
|
45
52
|
select: async (page, blockId, monthString)=>{
|
|
46
53
|
const [year] = monthString.split('-').map(Number);
|
|
47
54
|
await locator(page, blockId).click();
|
|
48
|
-
const dropdown = page
|
|
55
|
+
const dropdown = pickerDropdown(page, blockId);
|
|
49
56
|
await expect(dropdown).toBeVisible();
|
|
50
57
|
await navigateToYear(dropdown, year);
|
|
51
58
|
await dropdown.locator(`.ant-picker-cell-in-view[title="${monthString}"]`).click();
|
|
52
59
|
},
|
|
60
|
+
selectPreset: async (page, blockId, label)=>{
|
|
61
|
+
await locator(page, blockId).click();
|
|
62
|
+
await expect(pickerDropdown(page, blockId)).toBeVisible();
|
|
63
|
+
await presets(page, blockId).getByText(label, {
|
|
64
|
+
exact: true
|
|
65
|
+
}).click();
|
|
66
|
+
},
|
|
53
67
|
clear: async (page, blockId)=>{
|
|
54
68
|
await locator(page, blockId).hover();
|
|
55
69
|
await locator(page, blockId).locator('.ant-picker-clear').click();
|
|
@@ -57,6 +71,16 @@ export default createBlockHelper({
|
|
|
57
71
|
},
|
|
58
72
|
expect: {
|
|
59
73
|
value: (page, blockId, val)=>expect(input(page, blockId)).toHaveValue(val),
|
|
60
|
-
placeholder: (page, blockId, text)=>expect(input(page, blockId)).toHaveAttribute('placeholder', text)
|
|
74
|
+
placeholder: (page, blockId, text)=>expect(input(page, blockId)).toHaveAttribute('placeholder', text),
|
|
75
|
+
presetLabels: (page, blockId, labels)=>expect(presets(page, blockId).locator('li')).toHaveText(labels),
|
|
76
|
+
presetLabelHtml: (page, blockId, { selector, text })=>expect(presets(page, blockId).locator(selector)).toHaveText(text),
|
|
77
|
+
noPresets: (page, blockId)=>expect(presets(page, blockId)).toHaveCount(0),
|
|
78
|
+
// A preset the calendar cannot select is disabled through the list item's pointer events, so
|
|
79
|
+
// asserting on those checks the shortcut is really unclickable and not only styled as such.
|
|
80
|
+
presetDisabled: (page, blockId, label)=>expect(presetItem(page, blockId, label)).toHaveCSS('pointer-events', 'none'),
|
|
81
|
+
presetEnabled: (page, blockId, label)=>expect(presetItem(page, blockId, label)).toHaveCSS('pointer-events', 'auto'),
|
|
82
|
+
// The picker only closes the popup once it accepts the value, so a closed popup is the
|
|
83
|
+
// signal that a selection was committed rather than just shown in the input.
|
|
84
|
+
closed: (page, blockId)=>expect(pickerDropdown(page, blockId)).toBeHidden()
|
|
61
85
|
}
|
|
62
86
|
});
|