@lowdefy/blocks-antd 4.7.3 → 5.1.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 +6 -12
- package/dist/blocks/Affix/{schema.js → meta.js} +23 -14
- package/dist/blocks/Alert/Alert.js +17 -12
- package/dist/blocks/Alert/e2e.js +1 -1
- package/dist/blocks/Alert/meta.js +186 -0
- package/dist/blocks/AutoComplete/AutoComplete.js +21 -22
- package/dist/blocks/AutoComplete/meta.js +266 -0
- package/dist/blocks/Avatar/Avatar.js +58 -18
- package/dist/blocks/Avatar/meta.js +277 -0
- package/dist/blocks/Badge/Badge.js +13 -12
- package/dist/blocks/Badge/{schema.js → meta.js} +80 -1
- package/dist/blocks/Breadcrumb/Breadcrumb.js +40 -41
- package/dist/blocks/Breadcrumb/meta.js +90 -0
- package/dist/blocks/Button/Button.js +77 -39
- package/dist/blocks/Button/meta.js +230 -0
- package/dist/blocks/ButtonSelector/ButtonSelector.js +54 -59
- package/dist/blocks/ButtonSelector/meta.js +213 -0
- package/dist/blocks/Calendar/Calendar.js +153 -0
- package/dist/blocks/Calendar/e2e.js +27 -0
- package/dist/blocks/Calendar/meta.js +148 -0
- package/dist/blocks/Card/Card.js +22 -21
- package/dist/blocks/Card/meta.js +170 -0
- package/dist/blocks/Carousel/Carousel.js +6 -12
- package/dist/blocks/Carousel/{schema.js → meta.js} +61 -22
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +58 -64
- package/dist/blocks/CheckboxSelector/meta.js +150 -0
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +38 -44
- package/dist/blocks/CheckboxSwitch/meta.js +183 -0
- package/dist/blocks/Collapse/Collapse.js +21 -12
- package/dist/blocks/Collapse/meta.js +179 -0
- package/dist/blocks/ColorSelector/ColorSelector.js +97 -0
- package/dist/blocks/ColorSelector/e2e.js +32 -0
- package/dist/blocks/ColorSelector/meta.js +250 -0
- package/dist/blocks/ConfigProvider/ConfigProvider.js +51 -0
- package/dist/blocks/{Alert/style.less → ConfigProvider/e2e.js} +5 -3
- package/dist/blocks/{ControlledList/schema.js → ConfigProvider/meta.js} +43 -45
- package/dist/blocks/ConfirmModal/ConfirmModal.js +45 -25
- package/dist/blocks/ConfirmModal/{schema.js → meta.js} +93 -35
- package/dist/blocks/Content/Content.js +5 -12
- package/dist/blocks/{Layout/schema.js → Content/meta.js} +11 -3
- package/dist/blocks/ControlledList/ControlledList.js +42 -54
- package/dist/blocks/ControlledList/meta.js +158 -0
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +31 -29
- package/dist/blocks/DateRangeSelector/meta.js +297 -0
- package/dist/blocks/DateSelector/DateSelector.js +28 -28
- package/dist/blocks/DateSelector/meta.js +241 -0
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +28 -28
- package/dist/blocks/DateTimeSelector/meta.js +282 -0
- package/dist/blocks/Descriptions/Descriptions.js +20 -22
- package/dist/blocks/Descriptions/{schema.js → meta.js} +71 -15
- package/dist/blocks/Divider/Divider.js +8 -14
- package/dist/blocks/Divider/meta.js +86 -0
- package/dist/blocks/Drawer/Drawer.js +23 -16
- package/dist/blocks/Drawer/{schema.js → meta.js} +62 -61
- package/dist/blocks/DropdownButton/DropdownButton.js +221 -0
- package/dist/blocks/DropdownButton/e2e.js +30 -0
- package/dist/blocks/DropdownButton/meta.js +317 -0
- package/dist/blocks/DropdownMenu/DropdownMenu.js +130 -0
- package/dist/blocks/DropdownMenu/e2e.js +28 -0
- package/dist/blocks/DropdownMenu/meta.js +322 -0
- package/dist/blocks/Flex/Flex.js +31 -0
- package/dist/blocks/{Comment → Flex}/e2e.js +1 -2
- package/dist/blocks/Flex/meta.js +115 -0
- package/dist/blocks/FloatButton/FloatButton.js +46 -0
- package/dist/blocks/FloatButton/e2e.js +28 -0
- package/dist/blocks/FloatButton/meta.js +156 -0
- package/dist/blocks/Footer/Footer.js +8 -17
- package/dist/blocks/{Header/schema.js → Footer/meta.js} +11 -12
- package/dist/blocks/Header/Header.js +38 -18
- package/dist/blocks/Header/meta.js +318 -0
- package/dist/blocks/Label/Label.js +19 -27
- package/dist/blocks/Label/labelLogic.js +37 -41
- package/dist/blocks/Label/meta.js +148 -0
- package/dist/blocks/Label/style.module.css +185 -0
- package/dist/blocks/Layout/Layout.js +10 -13
- package/dist/blocks/{Content/schema.js → Layout/meta.js} +11 -3
- package/dist/blocks/Masonry/Masonry.js +37 -0
- package/dist/blocks/{Affix/style.less → Masonry/e2e.js} +9 -3
- package/dist/blocks/Masonry/meta.js +86 -0
- package/dist/blocks/MasonryList/MasonryList.js +42 -0
- package/dist/blocks/{AutoComplete/style.less → MasonryList/e2e.js} +9 -3
- package/dist/blocks/MasonryList/meta.js +86 -0
- package/dist/blocks/Menu/Menu.js +153 -124
- package/dist/blocks/Menu/meta.js +544 -0
- package/dist/blocks/Message/Message.js +18 -16
- package/dist/blocks/Message/{schema.js → meta.js} +29 -14
- package/dist/blocks/MobileMenu/MobileMenu.js +28 -23
- package/dist/blocks/MobileMenu/{schema.js → meta.js} +48 -31
- package/dist/blocks/Modal/Modal.js +20 -16
- package/dist/blocks/Modal/meta.js +234 -0
- package/dist/blocks/MonthSelector/MonthSelector.js +30 -30
- package/dist/blocks/MonthSelector/meta.js +260 -0
- package/dist/blocks/MultipleSelector/MultipleSelector.js +57 -37
- package/dist/blocks/MultipleSelector/{schema.js → meta.js} +178 -151
- package/dist/blocks/Notification/Notification.js +39 -23
- package/dist/blocks/Notification/{schema.js → meta.js} +36 -22
- package/dist/blocks/NumberInput/NumberInput.js +12 -21
- package/dist/blocks/NumberInput/meta.js +250 -0
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +137 -189
- package/dist/blocks/PageHeaderMenu/meta.js +420 -0
- package/dist/blocks/PageSidebarLayout/PageSidebarLayout.js +511 -0
- package/dist/blocks/PageSidebarLayout/e2e.js +34 -0
- package/dist/blocks/PageSidebarLayout/meta.js +516 -0
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +188 -196
- package/dist/blocks/PageSiderMenu/meta.js +486 -0
- package/dist/blocks/Pagination/Pagination.js +6 -15
- package/dist/blocks/Pagination/meta.js +233 -0
- package/dist/blocks/Paragraph/Paragraph.js +28 -16
- package/dist/blocks/Paragraph/{schema.js → meta.js} +68 -18
- package/dist/blocks/ParagraphInput/ParagraphInput.js +34 -17
- package/dist/blocks/ParagraphInput/{schema.js → meta.js} +134 -18
- package/dist/blocks/PasswordInput/PasswordInput.js +9 -16
- package/dist/blocks/PasswordInput/meta.js +195 -0
- package/dist/blocks/PhoneNumberInput/PhoneNumberInput.js +37 -33
- package/dist/blocks/PhoneNumberInput/formatPhoneNumber.js +25 -0
- package/dist/blocks/PhoneNumberInput/meta.js +225 -0
- package/dist/blocks/PhoneNumberInput/upstream-formatting-spec.md +173 -0
- package/dist/blocks/Popover/Popover.js +7 -12
- package/dist/blocks/Popover/{schema.js → meta.js} +81 -11
- package/dist/blocks/Progress/Progress.js +7 -12
- package/dist/blocks/Progress/{schema.js → meta.js} +74 -4
- package/dist/blocks/QRCode/QRCode.js +39 -0
- package/dist/blocks/{Footer/schema.js → QRCode/e2e.js} +9 -15
- package/dist/blocks/QRCode/meta.js +152 -0
- package/dist/blocks/RadioSelector/RadioSelector.js +55 -63
- package/dist/blocks/RadioSelector/meta.js +179 -0
- package/dist/blocks/RatingSlider/RatingSlider.js +95 -103
- package/dist/blocks/RatingSlider/meta.js +221 -0
- package/dist/blocks/Result/Result.js +13 -12
- package/dist/blocks/Result/meta.js +129 -0
- package/dist/blocks/Search/Search.js +135 -0
- package/dist/blocks/Search/SearchHighlight.js +33 -0
- package/dist/blocks/Search/SearchModal.js +171 -0
- package/dist/blocks/Search/SearchResults.js +129 -0
- package/dist/blocks/Search/meta.js +258 -0
- package/dist/blocks/Search/style.module.css +96 -0
- package/dist/blocks/Search/useListKeyboardNav.js +45 -0
- package/dist/blocks/Search/useRecentSearches.js +77 -0
- package/dist/blocks/Search/useSearchIndex.js +144 -0
- package/dist/blocks/SegmentedSelector/SegmentedSelector.js +93 -0
- package/dist/blocks/SegmentedSelector/e2e.js +32 -0
- package/dist/blocks/SegmentedSelector/meta.js +222 -0
- package/dist/blocks/Selector/Selector.js +41 -30
- package/dist/blocks/Selector/meta.js +380 -0
- package/dist/blocks/Sider/Sider.js +19 -18
- package/dist/blocks/Sider/{schema.js → meta.js} +20 -34
- package/dist/blocks/Slider/Slider.js +8 -20
- package/dist/blocks/Slider/meta.js +226 -0
- package/dist/blocks/Splitter/Splitter.js +70 -0
- package/dist/blocks/Splitter/e2e.js +24 -0
- package/dist/blocks/Splitter/meta.js +193 -0
- package/dist/blocks/Statistic/Statistic.js +26 -15
- package/dist/blocks/Statistic/{schema.js → meta.js} +41 -4
- package/dist/blocks/Steps/Steps.js +94 -0
- package/dist/blocks/Steps/e2e.js +31 -0
- package/dist/blocks/Steps/meta.js +246 -0
- package/dist/blocks/Switch/Switch.js +59 -54
- package/dist/blocks/Switch/meta.js +178 -0
- package/dist/blocks/Tabs/Tabs.js +49 -18
- package/dist/blocks/Tabs/meta.js +258 -0
- package/dist/blocks/Tag/Tag.js +17 -15
- package/dist/blocks/Tag/{schema.js → meta.js} +35 -13
- package/dist/blocks/TextArea/TextArea.js +10 -16
- package/dist/blocks/TextArea/meta.js +255 -0
- package/dist/blocks/TextInput/TextInput.js +23 -18
- package/dist/blocks/TextInput/meta.js +286 -0
- package/dist/blocks/TimelineList/TimelineList.js +29 -27
- package/dist/blocks/TimelineList/{schema.js → meta.js} +45 -8
- package/dist/blocks/Title/Title.js +34 -21
- package/dist/blocks/Title/{schema.js → meta.js} +117 -14
- package/dist/blocks/TitleInput/TitleInput.js +43 -25
- package/dist/blocks/TitleInput/{schema.js → meta.js} +156 -18
- package/dist/blocks/Tooltip/Tooltip.js +16 -16
- package/dist/blocks/Tooltip/{schema.js → meta.js} +74 -19
- package/dist/blocks/Tour/Tour.js +75 -0
- package/dist/blocks/Tour/e2e.js +31 -0
- package/dist/blocks/Tour/meta.js +255 -0
- package/dist/blocks/TreeSelector/TreeSelector.js +6 -12
- package/dist/blocks/TreeSelector/{schema.js → meta.js} +134 -25
- package/dist/blocks/Watermark/Watermark.js +34 -0
- package/dist/blocks/Watermark/e2e.js +23 -0
- package/dist/blocks/Watermark/meta.js +148 -0
- package/dist/blocks/WeekSelector/WeekSelector.js +35 -31
- package/dist/blocks/WeekSelector/meta.js +269 -0
- package/dist/blocks/buildMenuItems.js +95 -0
- package/dist/blocks/headerActions.js +220 -0
- package/dist/blocks/useItemShortcuts.js +64 -0
- package/dist/blocks/withTheme.js +40 -0
- package/dist/blocks.js +17 -1
- package/dist/disabledDate.js +15 -7
- package/dist/e2e.js +4 -1
- package/dist/metas.js +92 -0
- package/dist/schemas/breadcrumbList.js +64 -0
- package/dist/schemas/disabledDates.js +83 -0
- package/dist/{blocks/Avatar/style.less → schemas/icon.js} +10 -3
- package/dist/schemas/index.js +21 -0
- package/dist/schemas/inputProperties.js +70 -0
- package/dist/schemas/label.js +62 -0
- package/dist/schemas/menuLinks.js +49 -0
- package/dist/schemas/options.js +84 -0
- package/dist/types.js +4 -18
- package/package.json +19 -17
- package/dist/blocks/Affix/schema.json +0 -34
- package/dist/blocks/Alert/schema.js +0 -84
- package/dist/blocks/Alert/schema.json +0 -62
- package/dist/blocks/AutoComplete/schema.js +0 -181
- package/dist/blocks/AutoComplete/schema.json +0 -160
- package/dist/blocks/Avatar/schema.js +0 -98
- package/dist/blocks/Avatar/schema.json +0 -71
- package/dist/blocks/Badge/schema.json +0 -70
- package/dist/blocks/Badge/style.less +0 -17
- package/dist/blocks/Breadcrumb/schema.js +0 -95
- package/dist/blocks/Breadcrumb/schema.json +0 -78
- package/dist/blocks/Breadcrumb/style.less +0 -17
- package/dist/blocks/Button/schema.js +0 -123
- package/dist/blocks/Button/schema.json +0 -91
- package/dist/blocks/Button/style.less +0 -17
- package/dist/blocks/ButtonSelector/schema.js +0 -214
- package/dist/blocks/ButtonSelector/schema.json +0 -188
- package/dist/blocks/ButtonSelector/style.less +0 -18
- package/dist/blocks/Card/schema.js +0 -75
- package/dist/blocks/Card/schema.json +0 -58
- package/dist/blocks/Card/style.less +0 -17
- package/dist/blocks/Carousel/schema.json +0 -183
- package/dist/blocks/Carousel/style.less +0 -17
- package/dist/blocks/CheckboxSelector/schema.js +0 -220
- package/dist/blocks/CheckboxSelector/schema.json +0 -193
- package/dist/blocks/CheckboxSelector/style.less +0 -19
- package/dist/blocks/CheckboxSwitch/schema.js +0 -122
- package/dist/blocks/CheckboxSwitch/schema.json +0 -105
- package/dist/blocks/CheckboxSwitch/style.less +0 -19
- package/dist/blocks/Collapse/schema.js +0 -110
- package/dist/blocks/Collapse/schema.json +0 -90
- package/dist/blocks/Collapse/style.less +0 -17
- package/dist/blocks/Comment/Comment.js +0 -56
- package/dist/blocks/Comment/schema.js +0 -56
- package/dist/blocks/Comment/schema.json +0 -39
- package/dist/blocks/Comment/style.less +0 -18
- package/dist/blocks/ConfirmModal/schema.json +0 -122
- package/dist/blocks/ConfirmModal/style.less +0 -17
- package/dist/blocks/Content/schema.json +0 -16
- package/dist/blocks/Content/style.less +0 -17
- package/dist/blocks/ControlledList/schema.json +0 -73
- package/dist/blocks/ControlledList/style.less +0 -19
- package/dist/blocks/DateRangeSelector/schema.js +0 -266
- package/dist/blocks/DateRangeSelector/schema.json +0 -221
- package/dist/blocks/DateRangeSelector/style.less +0 -18
- package/dist/blocks/DateSelector/schema.js +0 -219
- package/dist/blocks/DateSelector/schema.json +0 -183
- package/dist/blocks/DateSelector/style.less +0 -18
- package/dist/blocks/DateTimeSelector/schema.js +0 -251
- package/dist/blocks/DateTimeSelector/schema.json +0 -215
- package/dist/blocks/DateTimeSelector/style.less +0 -18
- package/dist/blocks/Descriptions/schema.json +0 -186
- package/dist/blocks/Descriptions/style.less +0 -17
- package/dist/blocks/Divider/schema.js +0 -56
- package/dist/blocks/Divider/schema.json +0 -35
- package/dist/blocks/Divider/style.less +0 -17
- package/dist/blocks/Drawer/schema.json +0 -121
- package/dist/blocks/Drawer/style.less +0 -17
- package/dist/blocks/Footer/schema.json +0 -16
- package/dist/blocks/Footer/style.less +0 -17
- package/dist/blocks/Header/schema.json +0 -22
- package/dist/blocks/Header/style.less +0 -17
- package/dist/blocks/Label/schema.js +0 -83
- package/dist/blocks/Label/schema.json +0 -62
- package/dist/blocks/Label/style.less +0 -34
- package/dist/blocks/Layout/schema.json +0 -16
- package/dist/blocks/Layout/style.less +0 -17
- package/dist/blocks/Menu/schema.js +0 -283
- package/dist/blocks/Menu/schema.json +0 -236
- package/dist/blocks/Menu/style.less +0 -17
- package/dist/blocks/Message/schema.json +0 -48
- package/dist/blocks/Message/style.less +0 -17
- package/dist/blocks/MobileMenu/schema.json +0 -236
- package/dist/blocks/MobileMenu/style.less +0 -19
- package/dist/blocks/Modal/schema.js +0 -142
- package/dist/blocks/Modal/schema.json +0 -125
- package/dist/blocks/Modal/style.less +0 -17
- package/dist/blocks/MonthSelector/schema.js +0 -219
- package/dist/blocks/MonthSelector/schema.json +0 -183
- package/dist/blocks/MonthSelector/style.less +0 -18
- package/dist/blocks/MultipleSelector/schema.json +0 -297
- package/dist/blocks/MultipleSelector/style.less +0 -19
- package/dist/blocks/Notification/schema.json +0 -85
- package/dist/blocks/Notification/style.less +0 -18
- package/dist/blocks/NumberInput/schema.js +0 -193
- package/dist/blocks/NumberInput/schema.json +0 -172
- package/dist/blocks/NumberInput/style.less +0 -18
- package/dist/blocks/PageHeaderMenu/schema.js +0 -241
- package/dist/blocks/PageHeaderMenu/schema.json +0 -215
- package/dist/blocks/PageHeaderMenu/style.less +0 -23
- package/dist/blocks/PageSiderMenu/schema.js +0 -321
- package/dist/blocks/PageSiderMenu/schema.json +0 -283
- package/dist/blocks/PageSiderMenu/style.less +0 -26
- package/dist/blocks/Pagination/schema.js +0 -101
- package/dist/blocks/Pagination/schema.json +0 -75
- package/dist/blocks/Pagination/style.less +0 -17
- package/dist/blocks/Paragraph/schema.json +0 -135
- package/dist/blocks/Paragraph/style.less +0 -18
- package/dist/blocks/ParagraphInput/schema.json +0 -162
- package/dist/blocks/ParagraphInput/style.less +0 -17
- package/dist/blocks/PasswordInput/schema.js +0 -152
- package/dist/blocks/PasswordInput/schema.json +0 -131
- package/dist/blocks/PasswordInput/style.less +0 -18
- package/dist/blocks/PhoneNumberInput/schema.js +0 -243
- package/dist/blocks/PhoneNumberInput/schema.json +0 -216
- package/dist/blocks/PhoneNumberInput/style.less +0 -33
- package/dist/blocks/Popover/schema.json +0 -86
- package/dist/blocks/Popover/style.less +0 -17
- package/dist/blocks/Progress/schema.json +0 -76
- package/dist/blocks/Progress/style.less +0 -17
- package/dist/blocks/RadioSelector/schema.js +0 -217
- package/dist/blocks/RadioSelector/schema.json +0 -190
- package/dist/blocks/RadioSelector/style.less +0 -19
- package/dist/blocks/RatingSlider/schema.js +0 -196
- package/dist/blocks/RatingSlider/schema.json +0 -169
- package/dist/blocks/RatingSlider/style.less +0 -19
- package/dist/blocks/Result/schema.js +0 -55
- package/dist/blocks/Result/schema.json +0 -30
- package/dist/blocks/Result/style.less +0 -17
- package/dist/blocks/Selector/schema.js +0 -287
- package/dist/blocks/Selector/schema.json +0 -258
- package/dist/blocks/Selector/style.less +0 -18
- package/dist/blocks/Sider/schema.json +0 -71
- package/dist/blocks/Sider/style.less +0 -17
- package/dist/blocks/Slider/style.less +0 -18
- package/dist/blocks/Statistic/schema.json +0 -74
- package/dist/blocks/Statistic/style.less +0 -17
- package/dist/blocks/Switch/schema.js +0 -162
- package/dist/blocks/Switch/schema.json +0 -136
- package/dist/blocks/Switch/style.less +0 -18
- package/dist/blocks/Tabs/schema.js +0 -124
- package/dist/blocks/Tabs/schema.json +0 -93
- package/dist/blocks/Tabs/style.less +0 -17
- package/dist/blocks/Tag/schema.json +0 -45
- package/dist/blocks/Tag/style.less +0 -17
- package/dist/blocks/TextArea/schema.js +0 -196
- package/dist/blocks/TextArea/schema.json +0 -172
- package/dist/blocks/TextArea/style.less +0 -18
- package/dist/blocks/TextInput/schema.js +0 -223
- package/dist/blocks/TextInput/schema.json +0 -189
- package/dist/blocks/TextInput/style.less +0 -18
- package/dist/blocks/TimelineList/schema.json +0 -65
- package/dist/blocks/TimelineList/style.less +0 -17
- package/dist/blocks/Title/schema.json +0 -136
- package/dist/blocks/Title/style.less +0 -18
- package/dist/blocks/TitleInput/schema.json +0 -171
- package/dist/blocks/TitleInput/style.less +0 -17
- package/dist/blocks/Tooltip/schema.json +0 -91
- package/dist/blocks/Tooltip/style.less +0 -17
- package/dist/blocks/TreeSelector/schema.json +0 -166
- package/dist/blocks/TreeSelector/style.less +0 -27
- package/dist/blocks/WeekSelector/schema.js +0 -219
- package/dist/blocks/WeekSelector/schema.json +0 -183
- package/dist/blocks/WeekSelector/style.less +0 -18
- package/dist/color.js +0 -85
- package/dist/schemas.js +0 -75
- package/dist/style.less +0 -17
|
@@ -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
|
+
*/ import LabelMeta from '../Label/meta.js';
|
|
16
|
+
import label from '../../schemas/label.js';
|
|
17
|
+
import { disabled, autoFocus, variant, bordered, allowClear, sizeSmallDefaultLarge } from '../../schemas/inputProperties.js';
|
|
18
|
+
export default {
|
|
19
|
+
category: 'input',
|
|
20
|
+
icons: [
|
|
21
|
+
...LabelMeta.icons
|
|
22
|
+
],
|
|
23
|
+
valueType: 'string',
|
|
24
|
+
cssKeys: {
|
|
25
|
+
element: 'The AutoComplete element.',
|
|
26
|
+
selector: 'The inner value container of the AutoComplete (antd `content` semantic slot).',
|
|
27
|
+
label: 'The AutoComplete label.',
|
|
28
|
+
extra: 'The AutoComplete extra content.',
|
|
29
|
+
feedback: 'The AutoComplete validation feedback.',
|
|
30
|
+
options: 'The AutoComplete options.'
|
|
31
|
+
},
|
|
32
|
+
events: {
|
|
33
|
+
onBlur: 'Trigger action event occurs when selector loses focus.',
|
|
34
|
+
onChange: {
|
|
35
|
+
description: 'Trigger actions when selection is changed.',
|
|
36
|
+
event: {
|
|
37
|
+
value: 'The selected value.'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
onFocus: 'Trigger action when an selector gets focus.',
|
|
41
|
+
onClear: 'Trigger action when selector gets cleared.',
|
|
42
|
+
onSearch: {
|
|
43
|
+
description: 'Called when searching items.',
|
|
44
|
+
event: {
|
|
45
|
+
value: 'The search input value.'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
properties: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
additionalProperties: false,
|
|
52
|
+
properties: {
|
|
53
|
+
allowClear: {
|
|
54
|
+
...allowClear,
|
|
55
|
+
default: true,
|
|
56
|
+
description: 'Allow the user to clear the selected value, sets the value to null.'
|
|
57
|
+
},
|
|
58
|
+
autoFocus,
|
|
59
|
+
bordered,
|
|
60
|
+
backfill: {
|
|
61
|
+
type: 'boolean',
|
|
62
|
+
default: false,
|
|
63
|
+
description: 'Backfill selected item the input when using keyboard'
|
|
64
|
+
},
|
|
65
|
+
defaultOpen: {
|
|
66
|
+
type: 'boolean',
|
|
67
|
+
default: false,
|
|
68
|
+
description: 'Initial open state of dropdown.'
|
|
69
|
+
},
|
|
70
|
+
disabled,
|
|
71
|
+
label,
|
|
72
|
+
options: {
|
|
73
|
+
default: [],
|
|
74
|
+
type: 'array',
|
|
75
|
+
description: 'Options can either be an array of string values.',
|
|
76
|
+
items: {
|
|
77
|
+
type: 'string'
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
placeholder: {
|
|
81
|
+
type: 'string',
|
|
82
|
+
default: 'Type or select item',
|
|
83
|
+
description: 'Placeholder text inside the block before user selects input.'
|
|
84
|
+
},
|
|
85
|
+
size: sizeSmallDefaultLarge,
|
|
86
|
+
title: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
description: 'Title to describe the input component, if no title is specified the block id is displayed.'
|
|
89
|
+
},
|
|
90
|
+
variant,
|
|
91
|
+
theme: {
|
|
92
|
+
type: 'object',
|
|
93
|
+
description: 'Antd design token overrides for this block. See <a href="https://ant.design/components/overview#design-token">antd design tokens</a>.',
|
|
94
|
+
docs: {
|
|
95
|
+
displayType: 'yaml',
|
|
96
|
+
link: 'https://ant.design/components/select#design-token'
|
|
97
|
+
},
|
|
98
|
+
properties: {
|
|
99
|
+
borderRadius: {
|
|
100
|
+
type: 'number',
|
|
101
|
+
default: 6,
|
|
102
|
+
description: 'Border radius of the input.'
|
|
103
|
+
},
|
|
104
|
+
borderRadiusLG: {
|
|
105
|
+
type: 'number',
|
|
106
|
+
default: 8,
|
|
107
|
+
description: 'Border radius for large size.'
|
|
108
|
+
},
|
|
109
|
+
borderRadiusSM: {
|
|
110
|
+
type: 'number',
|
|
111
|
+
default: 4,
|
|
112
|
+
description: 'Border radius for small size.'
|
|
113
|
+
},
|
|
114
|
+
controlHeight: {
|
|
115
|
+
type: 'number',
|
|
116
|
+
default: 32,
|
|
117
|
+
description: 'Height of the input.'
|
|
118
|
+
},
|
|
119
|
+
controlHeightLG: {
|
|
120
|
+
type: 'number',
|
|
121
|
+
default: 40,
|
|
122
|
+
description: 'Height for large size.'
|
|
123
|
+
},
|
|
124
|
+
controlHeightSM: {
|
|
125
|
+
type: 'number',
|
|
126
|
+
default: 24,
|
|
127
|
+
description: 'Height for small size.'
|
|
128
|
+
},
|
|
129
|
+
fontSize: {
|
|
130
|
+
type: 'number',
|
|
131
|
+
default: 14,
|
|
132
|
+
description: 'Font size of the input text.'
|
|
133
|
+
},
|
|
134
|
+
fontSizeLG: {
|
|
135
|
+
type: 'number',
|
|
136
|
+
default: 16,
|
|
137
|
+
description: 'Font size for large size.'
|
|
138
|
+
},
|
|
139
|
+
fontSizeSM: {
|
|
140
|
+
type: 'number',
|
|
141
|
+
default: 14,
|
|
142
|
+
description: 'Font size for small size.'
|
|
143
|
+
},
|
|
144
|
+
colorPrimary: {
|
|
145
|
+
type: 'string',
|
|
146
|
+
description: 'Primary color, used for focus border and active state.'
|
|
147
|
+
},
|
|
148
|
+
colorPrimaryHover: {
|
|
149
|
+
type: 'string',
|
|
150
|
+
description: 'Primary hover color, used for hover border state.'
|
|
151
|
+
},
|
|
152
|
+
colorBgContainer: {
|
|
153
|
+
type: 'string',
|
|
154
|
+
default: '#ffffff',
|
|
155
|
+
description: 'Background color of the selector.'
|
|
156
|
+
},
|
|
157
|
+
colorBgElevated: {
|
|
158
|
+
type: 'string',
|
|
159
|
+
default: '#ffffff',
|
|
160
|
+
description: 'Background color of the dropdown.'
|
|
161
|
+
},
|
|
162
|
+
colorText: {
|
|
163
|
+
type: 'string',
|
|
164
|
+
description: 'Text color of the input.'
|
|
165
|
+
},
|
|
166
|
+
colorTextPlaceholder: {
|
|
167
|
+
type: 'string',
|
|
168
|
+
description: 'Placeholder text color.'
|
|
169
|
+
},
|
|
170
|
+
colorTextDisabled: {
|
|
171
|
+
type: 'string',
|
|
172
|
+
description: 'Text color when disabled.'
|
|
173
|
+
},
|
|
174
|
+
colorBorder: {
|
|
175
|
+
type: 'string',
|
|
176
|
+
description: 'Border color of the input.'
|
|
177
|
+
},
|
|
178
|
+
hoverBorderColor: {
|
|
179
|
+
type: 'string',
|
|
180
|
+
description: 'Border color when hovered.'
|
|
181
|
+
},
|
|
182
|
+
activeBorderColor: {
|
|
183
|
+
type: 'string',
|
|
184
|
+
description: 'Border color when focused/active.'
|
|
185
|
+
},
|
|
186
|
+
activeOutlineColor: {
|
|
187
|
+
type: 'string',
|
|
188
|
+
description: 'Outline color when focused.'
|
|
189
|
+
},
|
|
190
|
+
clearBg: {
|
|
191
|
+
type: 'string',
|
|
192
|
+
default: '#ffffff',
|
|
193
|
+
description: 'Background color of the clear button.'
|
|
194
|
+
},
|
|
195
|
+
optionSelectedBg: {
|
|
196
|
+
type: 'string',
|
|
197
|
+
default: '#e6f4ff',
|
|
198
|
+
description: 'Background color of the selected option.'
|
|
199
|
+
},
|
|
200
|
+
optionSelectedColor: {
|
|
201
|
+
type: 'string',
|
|
202
|
+
default: 'rgba(0, 0, 0, 0.88)',
|
|
203
|
+
description: 'Text color of the selected option.'
|
|
204
|
+
},
|
|
205
|
+
optionSelectedFontWeight: {
|
|
206
|
+
type: 'number',
|
|
207
|
+
default: 600,
|
|
208
|
+
description: 'Font weight of the selected option.'
|
|
209
|
+
},
|
|
210
|
+
optionActiveBg: {
|
|
211
|
+
type: 'string',
|
|
212
|
+
default: 'rgba(0, 0, 0, 0.04)',
|
|
213
|
+
description: 'Background color of the active (hovered) option.'
|
|
214
|
+
},
|
|
215
|
+
optionFontSize: {
|
|
216
|
+
type: 'number',
|
|
217
|
+
default: 14,
|
|
218
|
+
description: 'Font size of dropdown option text.'
|
|
219
|
+
},
|
|
220
|
+
optionHeight: {
|
|
221
|
+
type: 'number',
|
|
222
|
+
default: 32,
|
|
223
|
+
description: 'Height of each dropdown option.'
|
|
224
|
+
},
|
|
225
|
+
optionLineHeight: {
|
|
226
|
+
type: 'number',
|
|
227
|
+
description: 'Line height of dropdown option text.'
|
|
228
|
+
},
|
|
229
|
+
optionPadding: {
|
|
230
|
+
type: [
|
|
231
|
+
'string',
|
|
232
|
+
'number'
|
|
233
|
+
],
|
|
234
|
+
default: '5px 12px',
|
|
235
|
+
description: 'Padding of each dropdown option.'
|
|
236
|
+
},
|
|
237
|
+
selectorBg: {
|
|
238
|
+
type: 'string',
|
|
239
|
+
default: '#ffffff',
|
|
240
|
+
description: 'Background color of the selector input.'
|
|
241
|
+
},
|
|
242
|
+
zIndexPopup: {
|
|
243
|
+
type: 'number',
|
|
244
|
+
default: 1050,
|
|
245
|
+
description: 'Z-index of the dropdown popup.'
|
|
246
|
+
},
|
|
247
|
+
showArrowPaddingInlineEnd: {
|
|
248
|
+
type: 'number',
|
|
249
|
+
default: 18,
|
|
250
|
+
description: 'Right padding when the arrow icon is shown.'
|
|
251
|
+
},
|
|
252
|
+
lineWidth: {
|
|
253
|
+
type: 'number',
|
|
254
|
+
default: 1,
|
|
255
|
+
description: 'Border width of the input.'
|
|
256
|
+
},
|
|
257
|
+
paddingInline: {
|
|
258
|
+
type: 'number',
|
|
259
|
+
default: 11,
|
|
260
|
+
description: 'Horizontal padding of the input.'
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
};
|
|
@@ -14,10 +14,53 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { Avatar } from 'antd';
|
|
17
|
-
import {
|
|
18
|
-
|
|
17
|
+
import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
18
|
+
import withTheme from '../withTheme.js';
|
|
19
|
+
const AvatarBlock = ({ blockId, classNames = {}, events, components: { Icon }, methods, properties, styles = {} })=>{
|
|
20
|
+
if (properties.group) {
|
|
21
|
+
return /*#__PURE__*/ React.createElement(Avatar.Group, {
|
|
22
|
+
id: blockId,
|
|
23
|
+
className: classNames.element,
|
|
24
|
+
style: {
|
|
25
|
+
cursor: events.onClick && 'pointer',
|
|
26
|
+
...styles.element
|
|
27
|
+
},
|
|
28
|
+
maxCount: properties.group.maxCount,
|
|
29
|
+
maxPopoverPlacement: properties.group.maxPopoverPlacement,
|
|
30
|
+
maxPopoverTrigger: properties.group.maxPopoverTrigger,
|
|
31
|
+
maxStyle: styles.max,
|
|
32
|
+
shape: properties.group.shape ?? properties.shape,
|
|
33
|
+
size: properties.group.size ?? properties.size,
|
|
34
|
+
onClick: ()=>methods.triggerEvent({
|
|
35
|
+
name: 'onClick'
|
|
36
|
+
})
|
|
37
|
+
}, (properties.group.avatars ?? []).map((avatar, i)=>/*#__PURE__*/ React.createElement(Avatar, {
|
|
38
|
+
key: `${blockId}_${i}`,
|
|
39
|
+
alt: avatar.alt,
|
|
40
|
+
gap: avatar.gap,
|
|
41
|
+
shape: avatar.shape,
|
|
42
|
+
size: avatar.size,
|
|
43
|
+
src: avatar.src,
|
|
44
|
+
style: {
|
|
45
|
+
backgroundColor: !avatar.src && avatar.color
|
|
46
|
+
},
|
|
47
|
+
icon: avatar.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
48
|
+
blockId: `${blockId}_avatar_${i}_icon`,
|
|
49
|
+
classNames: {
|
|
50
|
+
element: classNames.icon
|
|
51
|
+
},
|
|
52
|
+
events: events,
|
|
53
|
+
properties: avatar.icon,
|
|
54
|
+
styles: {
|
|
55
|
+
element: styles.icon
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
}, avatar.content)));
|
|
59
|
+
}
|
|
60
|
+
return /*#__PURE__*/ React.createElement(Avatar, {
|
|
19
61
|
id: blockId,
|
|
20
62
|
alt: properties.alt,
|
|
63
|
+
className: classNames.element,
|
|
21
64
|
gap: properties.gap,
|
|
22
65
|
shape: properties.shape,
|
|
23
66
|
size: properties.size,
|
|
@@ -25,25 +68,22 @@ const AvatarBlock = ({ blockId, events, components: { Icon }, methods, propertie
|
|
|
25
68
|
onClick: ()=>methods.triggerEvent({
|
|
26
69
|
name: 'onClick'
|
|
27
70
|
}),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
properties.style
|
|
34
|
-
]),
|
|
71
|
+
style: {
|
|
72
|
+
backgroundColor: !properties.src && properties.color,
|
|
73
|
+
cursor: events.onClick && 'pointer',
|
|
74
|
+
...styles.element
|
|
75
|
+
},
|
|
35
76
|
icon: properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
36
77
|
blockId: `${blockId}_icon`,
|
|
78
|
+
classNames: {
|
|
79
|
+
element: classNames.icon
|
|
80
|
+
},
|
|
37
81
|
events: events,
|
|
38
|
-
properties: properties.icon
|
|
82
|
+
properties: properties.icon,
|
|
83
|
+
styles: {
|
|
84
|
+
element: styles.icon
|
|
85
|
+
}
|
|
39
86
|
})
|
|
40
87
|
}, properties.content);
|
|
41
|
-
AvatarBlock.defaultProps = blockDefaultProps;
|
|
42
|
-
AvatarBlock.meta = {
|
|
43
|
-
category: 'display',
|
|
44
|
-
icons: [],
|
|
45
|
-
styles: [
|
|
46
|
-
'blocks/Avatar/style.less'
|
|
47
|
-
]
|
|
48
88
|
};
|
|
49
|
-
export default AvatarBlock;
|
|
89
|
+
export default withTheme('Avatar', withBlockDefaults(AvatarBlock));
|
|
@@ -0,0 +1,277 @@
|
|
|
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
|
+
category: 'display',
|
|
17
|
+
icons: [],
|
|
18
|
+
valueType: null,
|
|
19
|
+
cssKeys: {
|
|
20
|
+
element: 'The Avatar element.',
|
|
21
|
+
icon: 'The icon in the Avatar.',
|
|
22
|
+
max: 'The Avatar max overflow style.'
|
|
23
|
+
},
|
|
24
|
+
events: {
|
|
25
|
+
onClick: 'Triggered when avatar item is clicked.'
|
|
26
|
+
},
|
|
27
|
+
properties: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
additionalProperties: false,
|
|
30
|
+
properties: {
|
|
31
|
+
alt: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
description: 'This attribute defines the alternative text describing the image.'
|
|
34
|
+
},
|
|
35
|
+
color: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'The background color of the avatar if not using a src url. Should be a hex color string. Color is a random color if not specified.',
|
|
38
|
+
docs: {
|
|
39
|
+
displayType: 'color'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
content: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'Text to display inside avatar.'
|
|
45
|
+
},
|
|
46
|
+
gap: {
|
|
47
|
+
type: 'number',
|
|
48
|
+
description: 'Letter type unit distance between left and right sides.'
|
|
49
|
+
},
|
|
50
|
+
icon: {
|
|
51
|
+
type: [
|
|
52
|
+
'string',
|
|
53
|
+
'object'
|
|
54
|
+
],
|
|
55
|
+
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 use an icon in avatar.",
|
|
56
|
+
docs: {
|
|
57
|
+
displayType: 'icon'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
shape: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
enum: [
|
|
63
|
+
'circle',
|
|
64
|
+
'square'
|
|
65
|
+
],
|
|
66
|
+
default: 'circle',
|
|
67
|
+
description: 'Shape of the avatar.'
|
|
68
|
+
},
|
|
69
|
+
size: {
|
|
70
|
+
type: [
|
|
71
|
+
'string',
|
|
72
|
+
'object'
|
|
73
|
+
],
|
|
74
|
+
default: 'default',
|
|
75
|
+
enum: [
|
|
76
|
+
'default',
|
|
77
|
+
'small',
|
|
78
|
+
'large'
|
|
79
|
+
],
|
|
80
|
+
description: 'Size of the avatar; default, small, large or responsive.',
|
|
81
|
+
docs: {
|
|
82
|
+
displayType: 'string'
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
src: {
|
|
86
|
+
type: 'string',
|
|
87
|
+
description: 'The address of the image for an image avatar.'
|
|
88
|
+
},
|
|
89
|
+
group: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
description: 'Render as an avatar group with multiple avatars. When set, the block renders Avatar.Group wrapping data-driven avatars.',
|
|
92
|
+
docs: {
|
|
93
|
+
displayType: 'yaml'
|
|
94
|
+
},
|
|
95
|
+
properties: {
|
|
96
|
+
maxCount: {
|
|
97
|
+
type: 'number',
|
|
98
|
+
description: 'Max avatars to show. Excess shows as "+N".'
|
|
99
|
+
},
|
|
100
|
+
maxPopoverPlacement: {
|
|
101
|
+
type: 'string',
|
|
102
|
+
enum: [
|
|
103
|
+
'top',
|
|
104
|
+
'bottom'
|
|
105
|
+
],
|
|
106
|
+
default: 'top',
|
|
107
|
+
description: 'Placement of the overflow popover.'
|
|
108
|
+
},
|
|
109
|
+
maxPopoverTrigger: {
|
|
110
|
+
type: 'string',
|
|
111
|
+
enum: [
|
|
112
|
+
'hover',
|
|
113
|
+
'click'
|
|
114
|
+
],
|
|
115
|
+
default: 'hover',
|
|
116
|
+
description: 'Trigger mode for the overflow popover.'
|
|
117
|
+
},
|
|
118
|
+
shape: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
enum: [
|
|
121
|
+
'circle',
|
|
122
|
+
'square'
|
|
123
|
+
],
|
|
124
|
+
description: 'Default shape for all avatars in the group.'
|
|
125
|
+
},
|
|
126
|
+
size: {
|
|
127
|
+
type: [
|
|
128
|
+
'string',
|
|
129
|
+
'number'
|
|
130
|
+
],
|
|
131
|
+
enum: [
|
|
132
|
+
'default',
|
|
133
|
+
'small',
|
|
134
|
+
'large'
|
|
135
|
+
],
|
|
136
|
+
description: 'Default size for all avatars in the group.'
|
|
137
|
+
},
|
|
138
|
+
avatars: {
|
|
139
|
+
type: 'array',
|
|
140
|
+
description: 'Array of avatar configurations.',
|
|
141
|
+
items: {
|
|
142
|
+
type: 'object',
|
|
143
|
+
properties: {
|
|
144
|
+
alt: {
|
|
145
|
+
type: 'string',
|
|
146
|
+
description: 'Alt text for image avatar.'
|
|
147
|
+
},
|
|
148
|
+
color: {
|
|
149
|
+
type: 'string',
|
|
150
|
+
description: 'Background color.',
|
|
151
|
+
docs: {
|
|
152
|
+
displayType: 'color'
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
content: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
description: 'Text content inside the avatar.'
|
|
158
|
+
},
|
|
159
|
+
gap: {
|
|
160
|
+
type: 'number',
|
|
161
|
+
description: 'Letter type unit distance between left and right sides.'
|
|
162
|
+
},
|
|
163
|
+
icon: {
|
|
164
|
+
type: [
|
|
165
|
+
'string',
|
|
166
|
+
'object'
|
|
167
|
+
],
|
|
168
|
+
description: 'Icon name or properties.',
|
|
169
|
+
docs: {
|
|
170
|
+
displayType: 'icon'
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
shape: {
|
|
174
|
+
type: 'string',
|
|
175
|
+
enum: [
|
|
176
|
+
'circle',
|
|
177
|
+
'square'
|
|
178
|
+
],
|
|
179
|
+
description: 'Override shape for this avatar.'
|
|
180
|
+
},
|
|
181
|
+
size: {
|
|
182
|
+
type: [
|
|
183
|
+
'string',
|
|
184
|
+
'number'
|
|
185
|
+
],
|
|
186
|
+
enum: [
|
|
187
|
+
'default',
|
|
188
|
+
'small',
|
|
189
|
+
'large'
|
|
190
|
+
],
|
|
191
|
+
description: 'Override size for this avatar.',
|
|
192
|
+
docs: {
|
|
193
|
+
displayType: 'string'
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
src: {
|
|
197
|
+
type: 'string',
|
|
198
|
+
description: 'Image URL.'
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
theme: {
|
|
206
|
+
type: 'object',
|
|
207
|
+
description: 'Antd design token overrides for this block. See <a href="https://ant.design/components/overview#design-token">antd design tokens</a>.',
|
|
208
|
+
docs: {
|
|
209
|
+
displayType: 'yaml',
|
|
210
|
+
link: 'https://ant.design/components/avatar#design-token'
|
|
211
|
+
},
|
|
212
|
+
properties: {
|
|
213
|
+
containerSize: {
|
|
214
|
+
type: 'number',
|
|
215
|
+
default: 32,
|
|
216
|
+
description: 'Size of the avatar.'
|
|
217
|
+
},
|
|
218
|
+
containerSizeLG: {
|
|
219
|
+
type: 'number',
|
|
220
|
+
default: 40,
|
|
221
|
+
description: 'Size of the large avatar.'
|
|
222
|
+
},
|
|
223
|
+
containerSizeSM: {
|
|
224
|
+
type: 'number',
|
|
225
|
+
default: 24,
|
|
226
|
+
description: 'Size of the small avatar.'
|
|
227
|
+
},
|
|
228
|
+
textFontSize: {
|
|
229
|
+
type: 'number',
|
|
230
|
+
default: 14,
|
|
231
|
+
description: 'Text font size of the avatar.'
|
|
232
|
+
},
|
|
233
|
+
textFontSizeLG: {
|
|
234
|
+
type: 'number',
|
|
235
|
+
default: 14,
|
|
236
|
+
description: 'Text font size of the large avatar.'
|
|
237
|
+
},
|
|
238
|
+
textFontSizeSM: {
|
|
239
|
+
type: 'number',
|
|
240
|
+
default: 14,
|
|
241
|
+
description: 'Text font size of the small avatar.'
|
|
242
|
+
},
|
|
243
|
+
iconFontSize: {
|
|
244
|
+
type: 'number',
|
|
245
|
+
default: 18,
|
|
246
|
+
description: 'Icon size within the avatar.'
|
|
247
|
+
},
|
|
248
|
+
iconFontSizeLG: {
|
|
249
|
+
type: 'number',
|
|
250
|
+
default: 24,
|
|
251
|
+
description: 'Icon size within the large avatar.'
|
|
252
|
+
},
|
|
253
|
+
iconFontSizeSM: {
|
|
254
|
+
type: 'number',
|
|
255
|
+
default: 14,
|
|
256
|
+
description: 'Icon size within the small avatar.'
|
|
257
|
+
},
|
|
258
|
+
groupSpace: {
|
|
259
|
+
type: 'number',
|
|
260
|
+
default: 4,
|
|
261
|
+
description: 'Spacing between grouped avatars.'
|
|
262
|
+
},
|
|
263
|
+
groupOverlapping: {
|
|
264
|
+
type: 'number',
|
|
265
|
+
default: -8,
|
|
266
|
+
description: 'Negative margin for avatar overlap in groups.'
|
|
267
|
+
},
|
|
268
|
+
groupBorderColor: {
|
|
269
|
+
type: 'string',
|
|
270
|
+
default: '#ffffff',
|
|
271
|
+
description: 'Border color applied to grouped avatars.'
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
};
|
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { type } from '@lowdefy/helpers';
|
|
17
17
|
import { Badge } from 'antd';
|
|
18
|
-
import {
|
|
19
|
-
|
|
18
|
+
import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
19
|
+
import withTheme from '../withTheme.js';
|
|
20
|
+
const BadgeBlock = ({ blockId, classNames = {}, events, content, components: { Icon }, properties, styles = {} })=>/*#__PURE__*/ React.createElement(Badge, {
|
|
20
21
|
id: blockId,
|
|
22
|
+
className: classNames.element,
|
|
21
23
|
color: properties.color,
|
|
22
24
|
dot: properties.dot,
|
|
23
25
|
offset: properties.offset,
|
|
@@ -25,20 +27,19 @@ const BadgeBlock = ({ blockId, events, content, components: { Icon }, properties
|
|
|
25
27
|
showZero: properties.showZero,
|
|
26
28
|
size: properties.size,
|
|
27
29
|
status: properties.status,
|
|
30
|
+
style: styles.element,
|
|
28
31
|
text: properties.text,
|
|
29
32
|
title: properties.title,
|
|
30
33
|
count: properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
31
34
|
blockId: `${blockId}_icon`,
|
|
35
|
+
classNames: {
|
|
36
|
+
element: classNames.icon
|
|
37
|
+
},
|
|
32
38
|
events: events,
|
|
33
|
-
properties: properties.icon
|
|
39
|
+
properties: properties.icon,
|
|
40
|
+
styles: {
|
|
41
|
+
element: styles.icon
|
|
42
|
+
}
|
|
34
43
|
}) || properties.count
|
|
35
44
|
}, content.content && content.content());
|
|
36
|
-
|
|
37
|
-
BadgeBlock.meta = {
|
|
38
|
-
category: 'container',
|
|
39
|
-
icons: [],
|
|
40
|
-
styles: [
|
|
41
|
-
'blocks/Badge/style.less'
|
|
42
|
-
]
|
|
43
|
-
};
|
|
44
|
-
export default BadgeBlock;
|
|
45
|
+
export default withTheme('Badge', withBlockDefaults(BadgeBlock));
|