@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,27 @@
|
|
|
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(`#${escapeId(blockId)}`);
|
|
18
|
+
export default createBlockHelper({
|
|
19
|
+
locator,
|
|
20
|
+
do: {
|
|
21
|
+
add: (page, blockId)=>page.locator(`#${escapeId(blockId)}_add_button`).click(),
|
|
22
|
+
remove: (page, blockId, index)=>page.locator(`#${escapeId(blockId)}_${index}_remove_icon`).click()
|
|
23
|
+
},
|
|
24
|
+
expect: {
|
|
25
|
+
itemCount: (page, blockId, count)=>expect(locator(page, blockId).locator('.ant-list-item')).toHaveCount(count)
|
|
26
|
+
}
|
|
27
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
title: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Controlled list title.'
|
|
24
|
+
},
|
|
25
|
+
addToFront: {
|
|
26
|
+
type: 'boolean',
|
|
27
|
+
default: false,
|
|
28
|
+
description: 'When true, add new items to the front of the list.'
|
|
29
|
+
},
|
|
30
|
+
hideAddButton: {
|
|
31
|
+
type: 'boolean',
|
|
32
|
+
default: false,
|
|
33
|
+
description: 'When true, hide the add new item button.'
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
enum: [
|
|
38
|
+
'small',
|
|
39
|
+
'default',
|
|
40
|
+
'large'
|
|
41
|
+
],
|
|
42
|
+
default: 'default',
|
|
43
|
+
description: 'When true, hide the add new item button.'
|
|
44
|
+
},
|
|
45
|
+
style: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
description: 'Css style object to applied to content.',
|
|
48
|
+
docs: {
|
|
49
|
+
displayType: 'yaml'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
addItemButton: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
description: 'Custom add item button properties.',
|
|
55
|
+
docs: {
|
|
56
|
+
displayType: 'button'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
removeItemIcon: {
|
|
60
|
+
type: [
|
|
61
|
+
'string',
|
|
62
|
+
'object'
|
|
63
|
+
],
|
|
64
|
+
description: 'Custom remove item icon properties.',
|
|
65
|
+
docs: {
|
|
66
|
+
displayType: 'icon'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
footerStyle: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
description: 'Css style object to applied to controlled list footer.',
|
|
72
|
+
docs: {
|
|
73
|
+
displayType: 'yaml'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
itemStyle: {
|
|
77
|
+
type: 'object',
|
|
78
|
+
description: 'Css style object to applied to controlled list items.',
|
|
79
|
+
docs: {
|
|
80
|
+
displayType: 'yaml'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
noDataTitle: {
|
|
84
|
+
type: 'string',
|
|
85
|
+
description: 'Title to show when list is empty.'
|
|
86
|
+
},
|
|
87
|
+
minItems: {
|
|
88
|
+
type: 'number',
|
|
89
|
+
default: 0,
|
|
90
|
+
description: 'Minimum number of items in the controlled list.'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
@@ -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.
|
|
@@ -78,9 +78,13 @@ const DateRangeSelector = ({ blockId, components: { Icon }, events, loading, met
|
|
|
78
78
|
properties: properties.suffixIcon ?? 'AiOutlineCalendar'
|
|
79
79
|
}),
|
|
80
80
|
onChange: (newVal)=>{
|
|
81
|
-
|
|
81
|
+
const val = !newVal ? null : newVal.map((val)=>moment.utc(val.add(val.utcOffset(), 'minutes')).startOf('day').toDate());
|
|
82
|
+
methods.setValue(val);
|
|
82
83
|
methods.triggerEvent({
|
|
83
|
-
name: 'onChange'
|
|
84
|
+
name: 'onChange',
|
|
85
|
+
event: {
|
|
86
|
+
value: val
|
|
87
|
+
}
|
|
84
88
|
});
|
|
85
89
|
},
|
|
86
90
|
value: rangeValue(value)
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
const locator = (page, blockId)=>page.locator(`.ant-picker-range:has(#${escapeId(blockId)}_input)`);
|
|
17
|
+
export default createBlockHelper({
|
|
18
|
+
locator,
|
|
19
|
+
do: {
|
|
20
|
+
open: (page, blockId)=>locator(page, blockId).click(),
|
|
21
|
+
clear: async (page, blockId)=>{
|
|
22
|
+
await locator(page, blockId).hover();
|
|
23
|
+
await locator(page, blockId).locator('.ant-picker-clear').click();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
@@ -0,0 +1,266 @@
|
|
|
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
|
+
allowClear: {
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
default: true,
|
|
24
|
+
description: 'Allow the user to clear their input.'
|
|
25
|
+
},
|
|
26
|
+
autoFocus: {
|
|
27
|
+
type: 'boolean',
|
|
28
|
+
default: false,
|
|
29
|
+
description: 'Autofocus to the block on page load.'
|
|
30
|
+
},
|
|
31
|
+
bordered: {
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
default: true,
|
|
34
|
+
description: 'Whether or not the input has a border style.'
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
type: 'boolean',
|
|
38
|
+
default: false,
|
|
39
|
+
description: 'Disable the block if true.'
|
|
40
|
+
},
|
|
41
|
+
disabledDates: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
description: 'Disable specific dates so that they can not be chosen.',
|
|
44
|
+
properties: {
|
|
45
|
+
min: {
|
|
46
|
+
type: [
|
|
47
|
+
'string',
|
|
48
|
+
'object'
|
|
49
|
+
],
|
|
50
|
+
description: 'Disable all dates less than the minimum date. Can be a date string or a _date object.',
|
|
51
|
+
docs: {
|
|
52
|
+
displayType: 'date'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
max: {
|
|
56
|
+
type: [
|
|
57
|
+
'string',
|
|
58
|
+
'object'
|
|
59
|
+
],
|
|
60
|
+
description: 'Disable all dates greater than the maximum date. Can be a date string or a _date object.',
|
|
61
|
+
docs: {
|
|
62
|
+
displayType: 'date'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
dates: {
|
|
66
|
+
type: 'array',
|
|
67
|
+
description: 'Array of specific dates to be disabled. Can be date strings or a _date objects.',
|
|
68
|
+
items: {
|
|
69
|
+
type: [
|
|
70
|
+
'string',
|
|
71
|
+
'object'
|
|
72
|
+
],
|
|
73
|
+
description: 'Specific dates to be disabled.',
|
|
74
|
+
docs: {
|
|
75
|
+
displayType: 'date'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
ranges: {
|
|
80
|
+
type: 'array',
|
|
81
|
+
description: 'Array of array pairs of start and end dates be disabled. Can be date strings or a _date objects.',
|
|
82
|
+
items: {
|
|
83
|
+
type: 'array',
|
|
84
|
+
description: 'Specific date ranges to be disabled.',
|
|
85
|
+
items: {
|
|
86
|
+
type: [
|
|
87
|
+
'string',
|
|
88
|
+
'object'
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
docs: {
|
|
92
|
+
displayType: 'dateRange'
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
format: {
|
|
99
|
+
type: 'string',
|
|
100
|
+
default: 'YYYY-MM-DD',
|
|
101
|
+
description: 'Format in which to parse the date value, eg. "DD MMMM YYYY" will parse a date value of 1999-12-31 as "31 December 1999". The format has to conform to moment.js formats.'
|
|
102
|
+
},
|
|
103
|
+
inputStyle: {
|
|
104
|
+
type: 'object',
|
|
105
|
+
description: 'Css style to applied to input.',
|
|
106
|
+
docs: {
|
|
107
|
+
displayType: 'yaml'
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
label: {
|
|
111
|
+
type: 'object',
|
|
112
|
+
description: 'Label properties.',
|
|
113
|
+
additionalProperties: false,
|
|
114
|
+
properties: {
|
|
115
|
+
align: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
enum: [
|
|
118
|
+
'left',
|
|
119
|
+
'right'
|
|
120
|
+
],
|
|
121
|
+
default: 'left',
|
|
122
|
+
description: 'Align label left or right when inline.'
|
|
123
|
+
},
|
|
124
|
+
colon: {
|
|
125
|
+
type: 'boolean',
|
|
126
|
+
default: true,
|
|
127
|
+
description: 'Append label with colon.'
|
|
128
|
+
},
|
|
129
|
+
extra: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
description: 'Extra text to display beneath the content - supports html.'
|
|
132
|
+
},
|
|
133
|
+
title: {
|
|
134
|
+
type: 'string',
|
|
135
|
+
description: 'Label title - supports html.'
|
|
136
|
+
},
|
|
137
|
+
span: {
|
|
138
|
+
type: 'number',
|
|
139
|
+
description: 'Label inline span.'
|
|
140
|
+
},
|
|
141
|
+
disabled: {
|
|
142
|
+
type: 'boolean',
|
|
143
|
+
default: false,
|
|
144
|
+
description: 'Hide input label.'
|
|
145
|
+
},
|
|
146
|
+
hasFeedback: {
|
|
147
|
+
type: 'boolean',
|
|
148
|
+
default: true,
|
|
149
|
+
description: 'Display feedback extra from validation, this does not disable validation.'
|
|
150
|
+
},
|
|
151
|
+
inline: {
|
|
152
|
+
type: 'boolean',
|
|
153
|
+
default: false,
|
|
154
|
+
description: 'Render input and label inline.'
|
|
155
|
+
},
|
|
156
|
+
extraStyle: {
|
|
157
|
+
type: 'object',
|
|
158
|
+
description: 'Css style to applied to label extra.',
|
|
159
|
+
docs: {
|
|
160
|
+
displayType: 'yaml'
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
feedbackStyle: {
|
|
164
|
+
type: 'object',
|
|
165
|
+
description: 'Css style to applied to label feedback.',
|
|
166
|
+
docs: {
|
|
167
|
+
displayType: 'yaml'
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
placeholder: {
|
|
173
|
+
type: 'array',
|
|
174
|
+
default: [
|
|
175
|
+
'Start Date',
|
|
176
|
+
'End Date'
|
|
177
|
+
],
|
|
178
|
+
description: 'Placeholder text inside the block before user types input.',
|
|
179
|
+
docs: {
|
|
180
|
+
displayType: 'manual',
|
|
181
|
+
block: {
|
|
182
|
+
id: 'block_properties_placeholder',
|
|
183
|
+
layout: {
|
|
184
|
+
_global: 'settings_input_layout'
|
|
185
|
+
},
|
|
186
|
+
type: 'Label',
|
|
187
|
+
properties: {
|
|
188
|
+
title: 'placeholder',
|
|
189
|
+
span: 8,
|
|
190
|
+
align: 'right',
|
|
191
|
+
extra: 'Placeholder text inside the block before user types input.'
|
|
192
|
+
},
|
|
193
|
+
blocks: [
|
|
194
|
+
{
|
|
195
|
+
id: 'block.properties.placeholder.0',
|
|
196
|
+
layout: {
|
|
197
|
+
span: 12
|
|
198
|
+
},
|
|
199
|
+
type: 'TextInput',
|
|
200
|
+
properties: {
|
|
201
|
+
size: 'small',
|
|
202
|
+
label: {
|
|
203
|
+
disabled: true
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: 'block.properties.placeholder.1',
|
|
209
|
+
layout: {
|
|
210
|
+
span: 12
|
|
211
|
+
},
|
|
212
|
+
type: 'TextInput',
|
|
213
|
+
properties: {
|
|
214
|
+
size: 'small',
|
|
215
|
+
label: {
|
|
216
|
+
disabled: true
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
separator: {
|
|
225
|
+
type: 'string',
|
|
226
|
+
default: '~',
|
|
227
|
+
description: 'Separator symbol shown between start and end date inputs.'
|
|
228
|
+
},
|
|
229
|
+
size: {
|
|
230
|
+
type: 'string',
|
|
231
|
+
enum: [
|
|
232
|
+
'small',
|
|
233
|
+
'default',
|
|
234
|
+
'large'
|
|
235
|
+
],
|
|
236
|
+
default: 'default',
|
|
237
|
+
description: 'Size of the block.'
|
|
238
|
+
},
|
|
239
|
+
suffixIcon: {
|
|
240
|
+
type: [
|
|
241
|
+
'string',
|
|
242
|
+
'object'
|
|
243
|
+
],
|
|
244
|
+
default: 'AiOutlineCalendar',
|
|
245
|
+
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 right-hand side of the date picker.",
|
|
246
|
+
docs: {
|
|
247
|
+
displayType: 'icon'
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
title: {
|
|
251
|
+
type: 'string',
|
|
252
|
+
description: 'Title to describe the input component, if no title is specified the block id is displayed - supports html.'
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
events: {
|
|
257
|
+
type: 'object',
|
|
258
|
+
additionalProperties: false,
|
|
259
|
+
properties: {
|
|
260
|
+
onChange: {
|
|
261
|
+
type: 'array',
|
|
262
|
+
description: 'Trigger actions when selection is changed.'
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
};
|
|
@@ -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.
|
|
@@ -66,9 +66,13 @@ const DateSelector = ({ blockId, components: { Icon }, events, loading, methods,
|
|
|
66
66
|
}),
|
|
67
67
|
disabledDate: disabledDate(properties.disabledDates),
|
|
68
68
|
onChange: (newVal)=>{
|
|
69
|
-
|
|
69
|
+
const val = !newVal ? null : moment.utc(newVal.add(newVal.utcOffset(), 'minutes')).startOf('day').toDate();
|
|
70
|
+
methods.setValue(val);
|
|
70
71
|
methods.triggerEvent({
|
|
71
|
-
name: 'onChange'
|
|
72
|
+
name: 'onChange',
|
|
73
|
+
event: {
|
|
74
|
+
value: val
|
|
75
|
+
}
|
|
72
76
|
});
|
|
73
77
|
},
|
|
74
78
|
value: type.isDate(value) ? moment.utc(value).startOf('day') : null
|
|
@@ -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
|
+
});
|