@lowdefy/blocks-antd 4.5.2 → 4.7.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/blocks/Affix/Affix.js +1 -1
- package/dist/blocks/Affix/e2e.js +19 -0
- package/dist/blocks/Affix/schema.js +48 -0
- package/dist/blocks/Affix/style.less +1 -1
- package/dist/blocks/Alert/Alert.js +1 -1
- package/dist/blocks/Alert/e2e.js +32 -0
- package/dist/blocks/Alert/schema.js +84 -0
- package/dist/blocks/Alert/style.less +1 -1
- package/dist/blocks/AutoComplete/AutoComplete.js +5 -2
- package/dist/blocks/AutoComplete/e2e.js +42 -0
- package/dist/blocks/AutoComplete/schema.js +181 -0
- package/dist/blocks/AutoComplete/style.less +1 -1
- package/dist/blocks/Avatar/Avatar.js +1 -1
- package/dist/blocks/Avatar/e2e.js +19 -0
- package/dist/blocks/Avatar/schema.js +98 -0
- package/dist/blocks/Avatar/style.less +1 -1
- package/dist/blocks/Badge/Badge.js +1 -1
- package/dist/blocks/Badge/e2e.js +23 -0
- package/dist/blocks/Badge/schema.js +101 -0
- package/dist/blocks/Badge/style.less +1 -1
- package/dist/blocks/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/blocks/Breadcrumb/e2e.js +23 -0
- package/dist/blocks/Breadcrumb/schema.js +95 -0
- package/dist/blocks/Breadcrumb/style.less +1 -1
- package/dist/blocks/Button/Button.js +1 -1
- package/dist/blocks/Button/e2e.js +29 -0
- package/dist/blocks/Button/schema.js +123 -0
- package/dist/blocks/Button/style.less +1 -1
- package/dist/blocks/ButtonSelector/ButtonSelector.js +7 -3
- package/dist/blocks/ButtonSelector/e2e.js +30 -0
- package/dist/blocks/ButtonSelector/schema.js +214 -0
- package/dist/blocks/ButtonSelector/style.less +1 -1
- package/dist/blocks/Card/Card.js +1 -1
- package/dist/blocks/Card/e2e.js +28 -0
- package/dist/blocks/Card/schema.js +75 -0
- package/dist/blocks/Card/style.less +1 -1
- package/dist/blocks/Carousel/Carousel.js +1 -1
- package/dist/blocks/Carousel/e2e.js +23 -0
- package/dist/blocks/Carousel/schema.js +202 -0
- package/dist/blocks/Carousel/style.less +1 -1
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +5 -2
- package/dist/blocks/CheckboxSelector/e2e.js +36 -0
- package/dist/blocks/CheckboxSelector/schema.js +220 -0
- package/dist/blocks/CheckboxSelector/style.less +1 -1
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +5 -2
- package/dist/blocks/CheckboxSwitch/e2e.js +33 -0
- package/dist/blocks/CheckboxSwitch/schema.js +122 -0
- package/dist/blocks/CheckboxSwitch/style.less +1 -1
- package/dist/blocks/Collapse/Collapse.js +1 -1
- package/dist/blocks/Collapse/e2e.js +34 -0
- package/dist/blocks/Collapse/schema.js +110 -0
- package/dist/blocks/Collapse/style.less +1 -1
- package/dist/blocks/Comment/Comment.js +1 -1
- package/dist/blocks/Comment/e2e.js +24 -0
- package/dist/blocks/Comment/schema.js +56 -0
- package/dist/blocks/Comment/style.less +1 -1
- package/dist/blocks/ConfirmModal/ConfirmModal.js +1 -1
- package/dist/blocks/ConfirmModal/e2e.js +30 -0
- package/dist/blocks/ConfirmModal/schema.js +148 -0
- package/dist/blocks/ConfirmModal/style.less +1 -1
- package/dist/blocks/Content/Content.js +1 -1
- package/dist/blocks/Content/e2e.js +19 -0
- package/dist/blocks/Content/schema.js +30 -0
- package/dist/blocks/Content/style.less +1 -1
- package/dist/blocks/ControlledList/ControlledList.js +1 -1
- package/dist/blocks/ControlledList/e2e.js +27 -0
- package/dist/blocks/ControlledList/schema.js +94 -0
- package/dist/blocks/ControlledList/style.less +1 -1
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +7 -3
- package/dist/blocks/DateRangeSelector/e2e.js +26 -0
- package/dist/blocks/DateRangeSelector/schema.js +266 -0
- package/dist/blocks/DateRangeSelector/style.less +1 -1
- package/dist/blocks/DateSelector/DateSelector.js +7 -3
- package/dist/blocks/DateSelector/e2e.js +32 -0
- package/dist/blocks/DateSelector/schema.js +219 -0
- package/dist/blocks/DateSelector/style.less +1 -1
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +7 -3
- package/dist/blocks/DateTimeSelector/e2e.js +32 -0
- package/dist/blocks/DateTimeSelector/schema.js +251 -0
- package/dist/blocks/DateTimeSelector/style.less +1 -1
- package/dist/blocks/Descriptions/Descriptions.js +1 -1
- package/dist/blocks/Descriptions/e2e.js +26 -0
- package/dist/blocks/Descriptions/schema.js +213 -0
- package/dist/blocks/Descriptions/style.less +1 -1
- package/dist/blocks/Divider/Divider.js +1 -1
- package/dist/blocks/Divider/e2e.js +19 -0
- package/dist/blocks/Divider/schema.js +56 -0
- package/dist/blocks/Divider/style.less +1 -1
- package/dist/blocks/Drawer/Drawer.js +1 -1
- package/dist/blocks/Drawer/e2e.js +27 -0
- package/dist/blocks/Drawer/schema.js +146 -0
- package/dist/blocks/Drawer/style.less +1 -1
- package/dist/blocks/Footer/Footer.js +1 -1
- package/dist/blocks/Footer/e2e.js +19 -0
- package/dist/blocks/Footer/schema.js +30 -0
- package/dist/blocks/Footer/style.less +1 -1
- package/dist/blocks/Header/Header.js +1 -1
- package/dist/blocks/Header/e2e.js +19 -0
- package/dist/blocks/Header/schema.js +39 -0
- package/dist/blocks/Header/style.less +1 -1
- package/dist/blocks/Label/Label.js +1 -1
- package/dist/blocks/Label/e2e.js +24 -0
- package/dist/blocks/Label/getLabelCol.js +1 -1
- package/dist/blocks/Label/getWrapperCol.js +1 -1
- package/dist/blocks/Label/labelLogic.js +1 -1
- package/dist/blocks/Label/schema.js +83 -0
- package/dist/blocks/Label/style.less +1 -1
- package/dist/blocks/Layout/Layout.js +1 -1
- package/dist/blocks/Layout/e2e.js +19 -0
- package/dist/blocks/Layout/schema.js +30 -0
- package/dist/blocks/Layout/style.less +1 -1
- package/dist/blocks/Menu/Menu.js +1 -1
- package/dist/blocks/Menu/e2e.js +30 -0
- package/dist/blocks/Menu/schema.js +283 -0
- package/dist/blocks/Menu/style.less +1 -1
- package/dist/blocks/Message/Message.js +1 -1
- package/dist/blocks/Message/e2e.js +27 -0
- package/dist/blocks/Message/schema.js +71 -0
- package/dist/blocks/Message/style.less +1 -1
- package/dist/blocks/MobileMenu/MobileMenu.js +1 -1
- package/dist/blocks/MobileMenu/e2e.js +32 -0
- package/dist/blocks/MobileMenu/schema.js +276 -0
- package/dist/blocks/MobileMenu/style.less +1 -1
- package/dist/blocks/Modal/Modal.js +1 -1
- package/dist/blocks/Modal/e2e.js +30 -0
- package/dist/blocks/Modal/schema.js +142 -0
- package/dist/blocks/Modal/style.less +1 -1
- package/dist/blocks/MonthSelector/MonthSelector.js +7 -3
- package/dist/blocks/MonthSelector/e2e.js +32 -0
- package/dist/blocks/MonthSelector/schema.js +219 -0
- package/dist/blocks/MonthSelector/style.less +1 -1
- package/dist/blocks/MultipleSelector/MultipleSelector.js +1 -1
- package/dist/blocks/MultipleSelector/e2e.js +42 -0
- package/dist/blocks/MultipleSelector/schema.js +332 -0
- package/dist/blocks/MultipleSelector/style.less +1 -1
- package/dist/blocks/Notification/Notification.js +1 -1
- package/dist/blocks/Notification/e2e.js +27 -0
- package/dist/blocks/Notification/schema.js +115 -0
- package/dist/blocks/Notification/style.less +1 -1
- package/dist/blocks/NumberInput/NumberInput.js +5 -2
- package/dist/blocks/NumberInput/e2e.js +29 -0
- package/dist/blocks/NumberInput/schema.js +193 -0
- package/dist/blocks/NumberInput/style.less +1 -1
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +1 -1
- package/dist/blocks/PageHeaderMenu/e2e.js +34 -0
- package/dist/blocks/PageHeaderMenu/schema.js +241 -0
- package/dist/blocks/PageHeaderMenu/style.less +1 -1
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +1 -1
- package/dist/blocks/PageSiderMenu/e2e.js +30 -0
- package/dist/blocks/PageSiderMenu/schema.js +321 -0
- package/dist/blocks/PageSiderMenu/style.less +1 -1
- package/dist/blocks/Pagination/Pagination.js +1 -1
- package/dist/blocks/Pagination/e2e.js +28 -0
- package/dist/blocks/Pagination/schema.js +101 -0
- package/dist/blocks/Pagination/style.less +1 -1
- package/dist/blocks/Paragraph/Paragraph.js +1 -1
- package/dist/blocks/Paragraph/e2e.js +27 -0
- package/dist/blocks/Paragraph/schema.js +162 -0
- package/dist/blocks/Paragraph/style.less +1 -1
- package/dist/blocks/ParagraphInput/ParagraphInput.js +1 -1
- package/dist/blocks/ParagraphInput/e2e.js +33 -0
- package/dist/blocks/ParagraphInput/schema.js +192 -0
- package/dist/blocks/ParagraphInput/style.less +1 -1
- package/dist/blocks/PasswordInput/PasswordInput.js +5 -2
- package/dist/blocks/PasswordInput/e2e.js +28 -0
- package/dist/blocks/PasswordInput/schema.js +152 -0
- package/dist/blocks/PasswordInput/style.less +1 -1
- package/dist/blocks/PhoneNumberInput/PhoneNumberInput.js +17 -3
- package/dist/blocks/PhoneNumberInput/e2e.js +28 -0
- package/dist/blocks/PhoneNumberInput/schema.js +243 -0
- package/dist/blocks/PhoneNumberInput/style.less +2 -2
- package/dist/blocks/Popover/Popover.js +1 -1
- package/dist/blocks/Popover/e2e.js +29 -0
- package/dist/blocks/Popover/schema.js +104 -0
- package/dist/blocks/Popover/style.less +1 -1
- package/dist/blocks/Progress/Progress.js +1 -1
- package/dist/blocks/Progress/e2e.js +23 -0
- package/dist/blocks/Progress/schema.js +110 -0
- package/dist/blocks/Progress/style.less +1 -1
- package/dist/blocks/RadioSelector/RadioSelector.js +7 -3
- package/dist/blocks/RadioSelector/e2e.js +30 -0
- package/dist/blocks/RadioSelector/schema.js +217 -0
- package/dist/blocks/RadioSelector/style.less +1 -1
- package/dist/blocks/RatingSlider/RatingSlider.js +7 -7
- package/dist/blocks/RatingSlider/e2e.js +33 -0
- package/dist/blocks/RatingSlider/schema.js +196 -0
- package/dist/blocks/RatingSlider/style.less +1 -1
- package/dist/blocks/Result/Result.js +1 -1
- package/dist/blocks/Result/e2e.js +30 -0
- package/dist/blocks/Result/schema.js +55 -0
- package/dist/blocks/Result/style.less +1 -1
- package/dist/blocks/Selector/Selector.js +7 -3
- package/dist/blocks/Selector/e2e.js +43 -0
- package/dist/blocks/Selector/schema.js +287 -0
- package/dist/blocks/Selector/style.less +1 -1
- package/dist/blocks/Sider/Sider.js +1 -1
- package/dist/blocks/Sider/e2e.js +19 -0
- package/dist/blocks/Sider/schema.js +98 -0
- package/dist/blocks/Sider/style.less +1 -1
- package/dist/blocks/Slider/Slider.js +5 -2
- package/dist/blocks/Slider/e2e.js +33 -0
- package/dist/blocks/Slider/style.less +1 -1
- package/dist/blocks/Statistic/Statistic.js +1 -1
- package/dist/blocks/Statistic/e2e.js +26 -0
- package/dist/blocks/Statistic/schema.js +94 -0
- package/dist/blocks/Statistic/style.less +1 -1
- package/dist/blocks/Switch/Switch.js +5 -2
- package/dist/blocks/Switch/e2e.js +27 -0
- package/dist/blocks/Switch/schema.js +162 -0
- package/dist/blocks/Switch/style.less +1 -1
- package/dist/blocks/Tabs/Tabs.js +1 -1
- package/dist/blocks/Tabs/e2e.js +31 -0
- package/dist/blocks/Tabs/schema.js +124 -0
- package/dist/blocks/Tabs/style.less +1 -1
- package/dist/blocks/Tag/Tag.js +1 -1
- package/dist/blocks/Tag/e2e.js +23 -0
- package/dist/blocks/Tag/schema.js +62 -0
- package/dist/blocks/Tag/style.less +1 -1
- package/dist/blocks/TextArea/TextArea.js +5 -2
- package/dist/blocks/TextArea/e2e.js +28 -0
- package/dist/blocks/TextArea/schema.js +196 -0
- package/dist/blocks/TextArea/style.less +1 -1
- package/dist/blocks/TextInput/TextInput.js +5 -2
- package/dist/blocks/TextInput/e2e.js +29 -0
- package/dist/blocks/TextInput/schema.js +223 -0
- package/dist/blocks/TextInput/style.less +1 -1
- package/dist/blocks/TimelineList/TimelineList.js +1 -1
- package/dist/blocks/TimelineList/e2e.js +23 -0
- package/dist/blocks/TimelineList/schema.js +86 -0
- package/dist/blocks/TimelineList/style.less +1 -1
- package/dist/blocks/Title/Title.js +1 -1
- package/dist/blocks/Title/e2e.js +24 -0
- package/dist/blocks/Title/schema.js +168 -0
- package/dist/blocks/Title/style.less +1 -1
- package/dist/blocks/TitleInput/TitleInput.js +1 -1
- package/dist/blocks/TitleInput/e2e.js +33 -0
- package/dist/blocks/TitleInput/schema.js +207 -0
- package/dist/blocks/TitleInput/style.less +1 -1
- package/dist/blocks/Tooltip/Tooltip.js +1 -1
- package/dist/blocks/Tooltip/e2e.js +28 -0
- package/dist/blocks/Tooltip/schema.js +109 -0
- package/dist/blocks/Tooltip/style.less +1 -1
- package/dist/blocks/TreeSelector/TreeSelector.js +7 -3
- package/dist/blocks/TreeSelector/e2e.js +33 -0
- package/dist/blocks/TreeSelector/schema.js +184 -0
- package/dist/blocks/TreeSelector/style.less +1 -1
- package/dist/blocks/WeekSelector/WeekSelector.js +7 -3
- package/dist/blocks/WeekSelector/e2e.js +32 -0
- package/dist/blocks/WeekSelector/schema.js +219 -0
- package/dist/blocks/WeekSelector/style.less +1 -1
- package/dist/blocks.js +1 -1
- package/dist/color.js +1 -1
- package/dist/disabledDate.js +1 -1
- package/dist/e2e.js +76 -0
- package/dist/getUniqueValues.js +1 -1
- package/dist/getValueIndex.js +1 -1
- package/dist/schemas.js +75 -0
- package/dist/style.less +1 -1
- package/dist/types.js +1 -1
- package/dist/useRunAfterUpdate.js +1 -1
- package/dist/validationExamples.js +1 -1
- package/package.json +12 -16
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
import { expect } from '@playwright/test';
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)}`);
|
|
18
|
+
// Menu items render inside a Drawer portal, not inside #bl-${blockId}.
|
|
19
|
+
const drawerMenu = (page)=>page.locator('.ant-drawer .ant-menu');
|
|
20
|
+
export default createBlockHelper({
|
|
21
|
+
locator,
|
|
22
|
+
do: {
|
|
23
|
+
clickMenuItem: (page, _blockId, text)=>drawerMenu(page).locator('.ant-menu-item').filter({
|
|
24
|
+
hasText: text
|
|
25
|
+
}).click()
|
|
26
|
+
},
|
|
27
|
+
expect: {
|
|
28
|
+
menuItemActive: (page, _blockId, text)=>expect(drawerMenu(page).locator('.ant-menu-item-selected').filter({
|
|
29
|
+
hasText: text
|
|
30
|
+
})).toBeVisible()
|
|
31
|
+
}
|
|
32
|
+
});
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
properties: {
|
|
21
|
+
toggleMenuButton: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
description: 'Toggle menu button properties.',
|
|
24
|
+
docs: {
|
|
25
|
+
displayType: 'button'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
drawer: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
description: 'Menu drawer properties.',
|
|
31
|
+
docs: {
|
|
32
|
+
displayType: 'yaml'
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
menuId: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'App menu id used to get menu links.'
|
|
38
|
+
},
|
|
39
|
+
selectedKeys: {
|
|
40
|
+
type: 'array',
|
|
41
|
+
description: 'Array with the keys of currently selected menu items.',
|
|
42
|
+
items: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: "Selected menu item 'id'."
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
subMenuCloseDelay: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
description: 'Delay time to hide submenu when mouse leaves (in seconds).'
|
|
50
|
+
},
|
|
51
|
+
subMenuOpenDelay: {
|
|
52
|
+
type: 'number',
|
|
53
|
+
description: 'Delay time to show submenu when mouse enters (in seconds).'
|
|
54
|
+
},
|
|
55
|
+
theme: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
enum: [
|
|
58
|
+
'dark',
|
|
59
|
+
'light'
|
|
60
|
+
],
|
|
61
|
+
default: 'light',
|
|
62
|
+
description: 'Color theme of menu.'
|
|
63
|
+
},
|
|
64
|
+
links: {
|
|
65
|
+
type: 'array',
|
|
66
|
+
items: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
required: [
|
|
69
|
+
'id',
|
|
70
|
+
'type'
|
|
71
|
+
],
|
|
72
|
+
properties: {
|
|
73
|
+
id: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
description: 'Menu item id.'
|
|
76
|
+
},
|
|
77
|
+
type: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
enum: [
|
|
80
|
+
'MenuDivider',
|
|
81
|
+
'MenuLink',
|
|
82
|
+
'MenuGroup'
|
|
83
|
+
],
|
|
84
|
+
default: 'MenuLink',
|
|
85
|
+
description: 'Menu item type.'
|
|
86
|
+
},
|
|
87
|
+
pageId: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
description: 'Page to link to.'
|
|
90
|
+
},
|
|
91
|
+
style: {
|
|
92
|
+
type: 'object',
|
|
93
|
+
description: 'Css style to applied to link.',
|
|
94
|
+
docs: {
|
|
95
|
+
displayType: 'yaml'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
properties: {
|
|
99
|
+
type: 'object',
|
|
100
|
+
description: 'properties from menu item.',
|
|
101
|
+
properties: {
|
|
102
|
+
title: {
|
|
103
|
+
type: 'string',
|
|
104
|
+
description: 'Menu item title.'
|
|
105
|
+
},
|
|
106
|
+
icon: {
|
|
107
|
+
type: [
|
|
108
|
+
'string',
|
|
109
|
+
'object'
|
|
110
|
+
],
|
|
111
|
+
description: "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to customize icon on menu item.",
|
|
112
|
+
docs: {
|
|
113
|
+
displayType: 'icon'
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
danger: {
|
|
117
|
+
type: 'boolean',
|
|
118
|
+
default: false,
|
|
119
|
+
description: 'Apply danger style to menu item.'
|
|
120
|
+
},
|
|
121
|
+
dashed: {
|
|
122
|
+
type: 'boolean',
|
|
123
|
+
default: false,
|
|
124
|
+
description: 'Whether the divider line is dashed.'
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
links: {
|
|
129
|
+
type: 'array',
|
|
130
|
+
items: {
|
|
131
|
+
type: 'object',
|
|
132
|
+
required: [
|
|
133
|
+
'id',
|
|
134
|
+
'type'
|
|
135
|
+
],
|
|
136
|
+
properties: {
|
|
137
|
+
id: {
|
|
138
|
+
type: 'string',
|
|
139
|
+
description: 'Menu item id.'
|
|
140
|
+
},
|
|
141
|
+
type: {
|
|
142
|
+
type: 'string',
|
|
143
|
+
enum: [
|
|
144
|
+
'MenuDivider',
|
|
145
|
+
'MenuLink',
|
|
146
|
+
'MenuGroup'
|
|
147
|
+
],
|
|
148
|
+
default: 'MenuLink',
|
|
149
|
+
description: 'Menu item type.'
|
|
150
|
+
},
|
|
151
|
+
style: {
|
|
152
|
+
type: 'object',
|
|
153
|
+
description: 'Css style to applied to sub-link.',
|
|
154
|
+
docs: {
|
|
155
|
+
displayType: 'yaml'
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
pageId: {
|
|
159
|
+
type: 'string',
|
|
160
|
+
description: 'Page to link to.'
|
|
161
|
+
},
|
|
162
|
+
properties: {
|
|
163
|
+
type: 'object',
|
|
164
|
+
description: 'properties from menu item.',
|
|
165
|
+
properties: {
|
|
166
|
+
title: {
|
|
167
|
+
type: 'string',
|
|
168
|
+
description: 'Menu item title.'
|
|
169
|
+
},
|
|
170
|
+
danger: {
|
|
171
|
+
type: 'boolean',
|
|
172
|
+
default: false,
|
|
173
|
+
description: 'Apply danger style to menu item.'
|
|
174
|
+
},
|
|
175
|
+
dashed: {
|
|
176
|
+
type: 'boolean',
|
|
177
|
+
default: false,
|
|
178
|
+
description: 'Whether the divider line is dashed.'
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
links: {
|
|
182
|
+
type: 'array',
|
|
183
|
+
items: {
|
|
184
|
+
type: 'object',
|
|
185
|
+
required: [
|
|
186
|
+
'id',
|
|
187
|
+
'type'
|
|
188
|
+
],
|
|
189
|
+
properties: {
|
|
190
|
+
id: {
|
|
191
|
+
type: 'string',
|
|
192
|
+
description: 'Menu item id.'
|
|
193
|
+
},
|
|
194
|
+
type: {
|
|
195
|
+
type: 'string',
|
|
196
|
+
enum: [
|
|
197
|
+
'MenuDivider',
|
|
198
|
+
'MenuLink'
|
|
199
|
+
],
|
|
200
|
+
default: 'MenuLink',
|
|
201
|
+
description: 'Menu item type.'
|
|
202
|
+
},
|
|
203
|
+
style: {
|
|
204
|
+
type: 'object',
|
|
205
|
+
description: 'Css style to applied to sub-link.',
|
|
206
|
+
docs: {
|
|
207
|
+
displayType: 'yaml'
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
pageId: {
|
|
211
|
+
type: 'string',
|
|
212
|
+
description: 'Page to link to.'
|
|
213
|
+
},
|
|
214
|
+
properties: {
|
|
215
|
+
type: 'object',
|
|
216
|
+
description: 'properties from menu item.',
|
|
217
|
+
properties: {
|
|
218
|
+
title: {
|
|
219
|
+
type: 'string',
|
|
220
|
+
description: 'Menu item title.'
|
|
221
|
+
},
|
|
222
|
+
danger: {
|
|
223
|
+
type: 'boolean',
|
|
224
|
+
default: false,
|
|
225
|
+
description: 'Apply danger style to menu item.'
|
|
226
|
+
},
|
|
227
|
+
dashed: {
|
|
228
|
+
type: 'boolean',
|
|
229
|
+
default: false,
|
|
230
|
+
description: 'Whether the divider line is dashed.'
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
events: {
|
|
247
|
+
type: 'object',
|
|
248
|
+
additionalProperties: false,
|
|
249
|
+
properties: {
|
|
250
|
+
onToggleDrawer: {
|
|
251
|
+
type: 'array',
|
|
252
|
+
description: 'Trigger action when mobile menu drawer is toggled.'
|
|
253
|
+
},
|
|
254
|
+
onClose: {
|
|
255
|
+
type: 'array',
|
|
256
|
+
description: 'Trigger action when mobile menu is closed.'
|
|
257
|
+
},
|
|
258
|
+
onOpen: {
|
|
259
|
+
type: 'array',
|
|
260
|
+
description: 'Trigger action when mobile menu is opened.'
|
|
261
|
+
},
|
|
262
|
+
onMenuItemSelect: {
|
|
263
|
+
type: 'array',
|
|
264
|
+
description: 'Trigger action when menu item is selected.'
|
|
265
|
+
},
|
|
266
|
+
onMenuItemClick: {
|
|
267
|
+
type: 'array',
|
|
268
|
+
description: 'Trigger action when menu item is clicked.'
|
|
269
|
+
},
|
|
270
|
+
onToggleMenuGroup: {
|
|
271
|
+
type: 'array',
|
|
272
|
+
description: 'Trigger action when mobile menu group is opened.'
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
16
|
+
import { expect } from '@playwright/test';
|
|
17
|
+
// Modal renders as a portal. Ant Design 4 does not forward the id prop to the
|
|
18
|
+
// portal DOM element, so we target the first visible non-confirm modal.
|
|
19
|
+
const locator = (page, _blockId)=>page.locator('.ant-modal:visible').first();
|
|
20
|
+
export default createBlockHelper({
|
|
21
|
+
locator,
|
|
22
|
+
do: {
|
|
23
|
+
close: (page, _blockId)=>locator(page, _blockId).locator('.ant-modal-close').click(),
|
|
24
|
+
ok: (page, _blockId)=>locator(page, _blockId).locator('.ant-btn-primary').click(),
|
|
25
|
+
cancel: (page, _blockId)=>locator(page, _blockId).locator('.ant-btn:not(.ant-btn-primary)').click()
|
|
26
|
+
},
|
|
27
|
+
expect: {
|
|
28
|
+
title: (page, _blockId, text)=>expect(locator(page, _blockId).locator('.ant-modal-title')).toHaveText(text)
|
|
29
|
+
}
|
|
30
|
+
});
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
properties: {
|
|
21
|
+
bodyStyle: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
description: 'Css style to applied to modal body.',
|
|
24
|
+
docs: {
|
|
25
|
+
displayType: 'yaml'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
centered: {
|
|
29
|
+
type: 'boolean',
|
|
30
|
+
default: false,
|
|
31
|
+
description: 'Center the modal vertically.'
|
|
32
|
+
},
|
|
33
|
+
closable: {
|
|
34
|
+
type: 'boolean',
|
|
35
|
+
default: true,
|
|
36
|
+
description: 'Whether a close (x) button is visible on top right of the modal dialog or not.'
|
|
37
|
+
},
|
|
38
|
+
title: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: "The modal dialog's title - supports html."
|
|
41
|
+
},
|
|
42
|
+
footer: {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
default: true,
|
|
45
|
+
description: 'Show footer area.'
|
|
46
|
+
},
|
|
47
|
+
mask: {
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
default: true,
|
|
50
|
+
description: 'Whether show mask or not.'
|
|
51
|
+
},
|
|
52
|
+
maskStyle: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
description: 'Css style to applied to modal mask.',
|
|
55
|
+
docs: {
|
|
56
|
+
displayType: 'yaml'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
maskClosable: {
|
|
60
|
+
type: 'boolean',
|
|
61
|
+
default: true,
|
|
62
|
+
description: 'Whether to close the modal dialog when the mask (area outside the modal) is clicked.'
|
|
63
|
+
},
|
|
64
|
+
okText: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
default: 'Ok',
|
|
67
|
+
description: 'Text of the Ok button.'
|
|
68
|
+
},
|
|
69
|
+
okButtonProps: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
description: 'Set additional properties for the ok button.',
|
|
72
|
+
docs: {
|
|
73
|
+
displayType: 'yaml'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
style: {
|
|
77
|
+
type: 'object',
|
|
78
|
+
description: 'Css style to applied to modal.',
|
|
79
|
+
docs: {
|
|
80
|
+
displayType: 'yaml'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
cancelText: {
|
|
84
|
+
type: 'string',
|
|
85
|
+
default: 'Cancel',
|
|
86
|
+
description: 'Text of the Cancel button.'
|
|
87
|
+
},
|
|
88
|
+
cancelButtonProps: {
|
|
89
|
+
type: 'object',
|
|
90
|
+
description: 'Set additional properties for the cancel button.',
|
|
91
|
+
docs: {
|
|
92
|
+
displayType: 'yaml'
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
width: {
|
|
96
|
+
type: [
|
|
97
|
+
'string',
|
|
98
|
+
'number'
|
|
99
|
+
],
|
|
100
|
+
default: '520px',
|
|
101
|
+
description: 'Width of the modal dialog.',
|
|
102
|
+
docs: {
|
|
103
|
+
displayType: 'string'
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
wrapperStyle: {
|
|
107
|
+
type: 'object',
|
|
108
|
+
description: 'Css style to applied to modal wrapper.',
|
|
109
|
+
docs: {
|
|
110
|
+
displayType: 'yaml'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
zIndex: {
|
|
114
|
+
type: 'integer',
|
|
115
|
+
default: 1000,
|
|
116
|
+
description: 'The z-index of the modal. Useful when displaying two modals simultaneously.'
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
events: {
|
|
121
|
+
type: 'object',
|
|
122
|
+
additionalProperties: false,
|
|
123
|
+
properties: {
|
|
124
|
+
onOk: {
|
|
125
|
+
type: 'array',
|
|
126
|
+
description: 'Trigger actions when Ok button is clicked.'
|
|
127
|
+
},
|
|
128
|
+
onOpen: {
|
|
129
|
+
type: 'array',
|
|
130
|
+
description: 'Trigger actions when modal is opened.'
|
|
131
|
+
},
|
|
132
|
+
onCancel: {
|
|
133
|
+
type: 'array',
|
|
134
|
+
description: 'Trigger actions when Cancel button is clicked.'
|
|
135
|
+
},
|
|
136
|
+
onClose: {
|
|
137
|
+
type: 'array',
|
|
138
|
+
description: 'Trigger actions after onOk or onCancel is completed.'
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -67,9 +67,13 @@ const MonthSelector = ({ blockId, components: { Icon }, events, loading, methods
|
|
|
67
67
|
properties: properties.suffixIcon ?? 'AiOutlineCalendar'
|
|
68
68
|
}),
|
|
69
69
|
onChange: (newVal)=>{
|
|
70
|
-
|
|
70
|
+
const val = !newVal ? null : moment.utc(newVal.add(newVal.utcOffset(), 'minutes')).startOf('month').toDate();
|
|
71
|
+
methods.setValue(val);
|
|
71
72
|
methods.triggerEvent({
|
|
72
|
-
name: 'onChange'
|
|
73
|
+
name: 'onChange',
|
|
74
|
+
event: {
|
|
75
|
+
value: val
|
|
76
|
+
}
|
|
73
77
|
});
|
|
74
78
|
}
|
|
75
79
|
}))
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
import { expect } from '@playwright/test';
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`.ant-picker:has(#${escapeId(blockId)}_input)`);
|
|
18
|
+
const input = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
19
|
+
export default createBlockHelper({
|
|
20
|
+
locator,
|
|
21
|
+
do: {
|
|
22
|
+
open: (page, blockId)=>locator(page, blockId).click(),
|
|
23
|
+
clear: async (page, blockId)=>{
|
|
24
|
+
await locator(page, blockId).hover();
|
|
25
|
+
await locator(page, blockId).locator('.ant-picker-clear').click();
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
expect: {
|
|
29
|
+
value: (page, blockId, val)=>expect(input(page, blockId)).toHaveValue(val),
|
|
30
|
+
placeholder: (page, blockId, text)=>expect(input(page, blockId)).toHaveAttribute('placeholder', text)
|
|
31
|
+
}
|
|
32
|
+
});
|