@lowdefy/blocks-antd 4.0.0-alpha.9 → 4.0.0-rc.1

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.
Files changed (137) hide show
  1. package/dist/blocks/Affix/Affix.js +2 -3
  2. package/dist/blocks/Affix/style.less +1 -1
  3. package/dist/blocks/Alert/Alert.js +10 -12
  4. package/dist/blocks/Alert/style.less +1 -1
  5. package/dist/blocks/AutoComplete/AutoComplete.js +17 -39
  6. package/dist/blocks/AutoComplete/schema.json +5 -46
  7. package/dist/blocks/AutoComplete/style.less +1 -1
  8. package/dist/blocks/Avatar/Avatar.js +4 -6
  9. package/dist/blocks/Avatar/style.less +1 -1
  10. package/dist/blocks/Badge/Badge.js +2 -3
  11. package/dist/blocks/Badge/style.less +1 -1
  12. package/dist/blocks/Breadcrumb/Breadcrumb.js +13 -16
  13. package/dist/blocks/Breadcrumb/style.less +1 -1
  14. package/dist/blocks/Button/Button.js +6 -7
  15. package/dist/blocks/Button/style.less +1 -1
  16. package/dist/blocks/ButtonSelector/ButtonSelector.js +6 -7
  17. package/dist/blocks/ButtonSelector/style.less +1 -1
  18. package/dist/blocks/Card/Card.js +4 -6
  19. package/dist/blocks/Card/style.less +1 -1
  20. package/dist/blocks/CheckboxSelector/CheckboxSelector.js +6 -7
  21. package/dist/blocks/CheckboxSelector/style.less +1 -1
  22. package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +5 -5
  23. package/dist/blocks/CheckboxSwitch/style.less +1 -1
  24. package/dist/blocks/Collapse/Collapse.js +11 -15
  25. package/dist/blocks/Collapse/style.less +1 -1
  26. package/dist/blocks/Comment/Comment.js +3 -3
  27. package/dist/blocks/Comment/style.less +1 -1
  28. package/dist/blocks/ConfirmModal/ConfirmModal.js +3 -3
  29. package/dist/blocks/ConfirmModal/style.less +1 -1
  30. package/dist/blocks/Content/Content.js +2 -3
  31. package/dist/blocks/Content/style.less +1 -1
  32. package/dist/blocks/ControlledList/ControlledList.js +5 -5
  33. package/dist/blocks/ControlledList/style.less +1 -1
  34. package/dist/blocks/DateRangeSelector/DateRangeSelector.js +11 -14
  35. package/dist/blocks/DateRangeSelector/style.less +1 -1
  36. package/dist/blocks/DateSelector/DateSelector.js +7 -7
  37. package/dist/blocks/DateSelector/style.less +1 -1
  38. package/dist/blocks/DateTimeSelector/DateTimeSelector.js +10 -8
  39. package/dist/blocks/DateTimeSelector/style.less +1 -1
  40. package/dist/blocks/Descriptions/Descriptions.js +13 -15
  41. package/dist/blocks/Descriptions/style.less +1 -1
  42. package/dist/blocks/Divider/Divider.js +2 -3
  43. package/dist/blocks/Divider/style.less +1 -1
  44. package/dist/blocks/Drawer/Drawer.js +5 -7
  45. package/dist/blocks/Drawer/style.less +1 -1
  46. package/dist/blocks/Footer/Footer.js +2 -3
  47. package/dist/blocks/Footer/style.less +1 -1
  48. package/dist/blocks/Header/Header.js +3 -4
  49. package/dist/blocks/Header/style.less +1 -1
  50. package/dist/blocks/Label/Label.js +23 -27
  51. package/dist/blocks/Label/getLabelCol.js +1 -1
  52. package/dist/blocks/Label/getWrapperCol.js +1 -1
  53. package/dist/blocks/Label/labelLogic.js +15 -15
  54. package/dist/blocks/Label/style.less +5 -1
  55. package/dist/blocks/Layout/Layout.js +2 -3
  56. package/dist/blocks/Layout/style.less +1 -1
  57. package/dist/blocks/Menu/Menu.js +49 -57
  58. package/dist/blocks/Menu/style.less +1 -1
  59. package/dist/blocks/Message/Message.js +4 -5
  60. package/dist/blocks/Message/style.less +1 -1
  61. package/dist/blocks/MobileMenu/MobileMenu.js +7 -9
  62. package/dist/blocks/MobileMenu/style.less +1 -1
  63. package/dist/blocks/Modal/Modal.js +11 -14
  64. package/dist/blocks/Modal/style.less +1 -1
  65. package/dist/blocks/MonthSelector/MonthSelector.js +7 -7
  66. package/dist/blocks/MonthSelector/style.less +1 -1
  67. package/dist/blocks/MultipleSelector/MultipleSelector.js +9 -11
  68. package/dist/blocks/MultipleSelector/style.less +1 -1
  69. package/dist/blocks/Notification/Notification.js +5 -7
  70. package/dist/blocks/Notification/style.less +1 -1
  71. package/dist/blocks/NumberInput/NumberInput.js +6 -4
  72. package/dist/blocks/NumberInput/schema.json +7 -0
  73. package/dist/blocks/NumberInput/style.less +1 -1
  74. package/dist/blocks/PageHCF/PageHCF.js +2 -3
  75. package/dist/blocks/PageHCF/style.less +1 -1
  76. package/dist/blocks/PageHCSF/PageHCSF.js +2 -3
  77. package/dist/blocks/PageHCSF/style.less +1 -1
  78. package/dist/blocks/PageHSCF/PageHSCF.js +2 -3
  79. package/dist/blocks/PageHSCF/style.less +1 -1
  80. package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +47 -35
  81. package/dist/blocks/PageHeaderMenu/schema.json +5 -5
  82. package/dist/blocks/PageHeaderMenu/style.less +1 -1
  83. package/dist/blocks/PageSHCF/PageSHCF.js +2 -3
  84. package/dist/blocks/PageSHCF/style.less +1 -1
  85. package/dist/blocks/PageSiderMenu/PageSiderMenu.js +45 -43
  86. package/dist/blocks/PageSiderMenu/schema.json +5 -5
  87. package/dist/blocks/PageSiderMenu/style.less +1 -1
  88. package/dist/blocks/Pagination/Pagination.js +4 -5
  89. package/dist/blocks/Pagination/style.less +1 -1
  90. package/dist/blocks/Paragraph/Paragraph.js +3 -4
  91. package/dist/blocks/Paragraph/style.less +2 -1
  92. package/dist/blocks/ParagraphInput/ParagraphInput.js +5 -5
  93. package/dist/blocks/ParagraphInput/style.less +1 -1
  94. package/dist/blocks/PasswordInput/PasswordInput.js +7 -6
  95. package/dist/blocks/PasswordInput/style.less +1 -1
  96. package/dist/blocks/Progress/Progress.js +2 -3
  97. package/dist/blocks/Progress/style.less +1 -1
  98. package/dist/blocks/RadioSelector/RadioSelector.js +9 -10
  99. package/dist/blocks/RadioSelector/style.less +1 -1
  100. package/dist/blocks/RatingSlider/RatingSlider.js +11 -13
  101. package/dist/blocks/RatingSlider/style.less +1 -1
  102. package/dist/blocks/Result/Result.js +2 -3
  103. package/dist/blocks/Result/style.less +1 -1
  104. package/dist/blocks/Selector/Selector.js +9 -11
  105. package/dist/blocks/Selector/style.less +1 -1
  106. package/dist/blocks/Sider/Sider.js +5 -7
  107. package/dist/blocks/Sider/style.less +1 -1
  108. package/dist/blocks/Statistic/Statistic.js +2 -3
  109. package/dist/blocks/Statistic/style.less +1 -1
  110. package/dist/blocks/Switch/Switch.js +5 -5
  111. package/dist/blocks/Switch/style.less +1 -1
  112. package/dist/blocks/Tabs/Tabs.js +11 -16
  113. package/dist/blocks/Tabs/style.less +1 -1
  114. package/dist/blocks/TextArea/TextArea.js +6 -6
  115. package/dist/blocks/TextArea/style.less +1 -1
  116. package/dist/blocks/TextInput/TextInput.js +9 -8
  117. package/dist/blocks/TextInput/style.less +1 -1
  118. package/dist/blocks/TimelineList/TimelineList.js +10 -10
  119. package/dist/blocks/TimelineList/style.less +1 -1
  120. package/dist/blocks/Title/Title.js +5 -5
  121. package/dist/blocks/Title/style.less +2 -1
  122. package/dist/blocks/TitleInput/TitleInput.js +6 -6
  123. package/dist/blocks/TitleInput/style.less +1 -1
  124. package/dist/blocks/Tooltip/Tooltip.js +2 -3
  125. package/dist/blocks/Tooltip/style.less +1 -1
  126. package/dist/blocks/WeekSelector/WeekSelector.js +7 -7
  127. package/dist/blocks/WeekSelector/style.less +1 -1
  128. package/dist/blocks.js +1 -1
  129. package/dist/color.js +1 -1
  130. package/dist/disabledDate.js +4 -7
  131. package/dist/getUniqueValues.js +1 -1
  132. package/dist/getValueIndex.js +1 -1
  133. package/dist/style.less +1 -1
  134. package/dist/types.js +1 -1
  135. package/dist/useRunAfterUpdate.js +1 -1
  136. package/dist/validationExamples.js +2 -2
  137. package/package.json +28 -29
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -12,11 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ import React from 'react';
16
- import { Collapse } from 'antd';
17
- import { serializer, type } from '@lowdefy/helpers';
18
- import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
19
- function _extends() {
15
+ */ function _extends() {
20
16
  _extends = Object.assign || function(target) {
21
17
  for(var i = 1; i < arguments.length; i++){
22
18
  var source = arguments[i];
@@ -30,12 +26,15 @@ function _extends() {
30
26
  };
31
27
  return _extends.apply(this, arguments);
32
28
  }
29
+ import React from 'react';
30
+ import { Collapse } from 'antd';
31
+ import { serializer, type } from '@lowdefy/helpers';
32
+ import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
33
33
  const CollapseBlock = ({ blockId , events , content , components: { Icon } , methods , properties })=>{
34
34
  const panels = properties.panels || Object.keys(content).sort().map((key)=>({
35
35
  key,
36
36
  title: key
37
- })
38
- );
37
+ }));
39
38
  const additionalProps = {};
40
39
  if (properties.activeKey) {
41
40
  additionalProps.activeKey = properties.activeKey;
@@ -46,7 +45,7 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
46
45
  name: propertiesIconExpand
47
46
  };
48
47
  }
49
- return(/*#__PURE__*/ React.createElement(Collapse, _extends({
48
+ return /*#__PURE__*/ React.createElement(Collapse, _extends({
50
49
  id: blockId,
51
50
  defaultActiveKey: properties.defaultActiveKey || panels[0].key,
52
51
  bordered: properties.bordered,
@@ -56,8 +55,7 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
56
55
  event: {
57
56
  activeKey
58
57
  }
59
- })
60
- ,
58
+ }),
61
59
  expandIcon: propertiesIconExpand && (({ isActive })=>/*#__PURE__*/ React.createElement(Icon, {
62
60
  blockId: `${blockId}_expandIcon`,
63
61
  events: events,
@@ -65,8 +63,7 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
65
63
  rotate: isActive ? 90 : 0,
66
64
  ...propertiesIconExpand
67
65
  }
68
- })
69
- ),
66
+ })),
70
67
  expandIconPosition: properties.expandIconPosition,
71
68
  destroyInactivePanel: properties.destroyInactivePanel
72
69
  }, additionalProps), panels.map((panel)=>/*#__PURE__*/ React.createElement(Collapse.Panel, {
@@ -79,8 +76,7 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
79
76
  }),
80
77
  key: panel.key,
81
78
  showArrow: properties.showArrow
82
- }, content[panel.key] && content[panel.key]())
83
- )));
79
+ }, content[panel.key] && content[panel.key]())));
84
80
  };
85
81
  CollapseBlock.defaultProps = blockDefaultProps;
86
82
  CollapseBlock.meta = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -30,7 +30,7 @@ const CommentBlock = ({ blockId , components , content , properties , methods }
30
30
  content: properties.author.substring(0, 2)
31
31
  };
32
32
  }
33
- return(/*#__PURE__*/ React.createElement(Comment, {
33
+ return /*#__PURE__*/ React.createElement(Comment, {
34
34
  id: blockId,
35
35
  actions: [
36
36
  content.actions && content.actions()
@@ -43,7 +43,7 @@ const CommentBlock = ({ blockId , components , content , properties , methods }
43
43
  properties: avatar,
44
44
  methods: methods
45
45
  })
46
- }, content.children && content.children()));
46
+ }, content.children && content.children());
47
47
  };
48
48
  CommentBlock.defaultProps = blockDefaultProps;
49
49
  CommentBlock.meta = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -81,9 +81,9 @@ const ConfirmModal = ({ blockId , events , content , components: { Icon } , met
81
81
  });
82
82
  });
83
83
  });
84
- return(/*#__PURE__*/ React.createElement("div", {
84
+ return /*#__PURE__*/ React.createElement("div", {
85
85
  id: blockId
86
- }));
86
+ });
87
87
  };
88
88
  ConfirmModal.defaultProps = blockDefaultProps;
89
89
  ConfirmModal.meta = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -19,8 +19,7 @@ const Content = Layout.Content;
19
19
  const ContentBlock = ({ blockId , content , methods , properties })=>/*#__PURE__*/ React.createElement(Content, {
20
20
  id: blockId,
21
21
  className: methods.makeCssClass(properties.style)
22
- }, content.content && content.content())
23
- ;
22
+ }, content.content && content.content());
24
23
  ContentBlock.defaultProps = blockDefaultProps;
25
24
  ContentBlock.meta = {
26
25
  category: 'container',
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -17,7 +17,7 @@ import { get } from '@lowdefy/helpers';
17
17
  import { List, Typography } from 'antd';
18
18
  import { blockDefaultProps } from '@lowdefy/block-utils';
19
19
  import Button from '../Button/Button.js';
20
- const ControlledListBlock = ({ blockId , components: { Icon , Link } , events , list , methods , properties , })=>{
20
+ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events , list , methods , properties })=>{
21
21
  useEffect(()=>{
22
22
  methods.registerMethod('moveItemDown', methods.moveItemDown);
23
23
  methods.registerMethod('moveItemUp', methods.moveItemUp);
@@ -42,7 +42,7 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
42
42
  width: '100%'
43
43
  }
44
44
  };
45
- return(/*#__PURE__*/ React.createElement(List, {
45
+ return /*#__PURE__*/ React.createElement(List, {
46
46
  id: blockId,
47
47
  size: properties.size,
48
48
  header: (properties.title || properties.addToFront && !properties.hideAddButton) && /*#__PURE__*/ React.createElement("div", {
@@ -115,12 +115,12 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
115
115
  }
116
116
  },
117
117
  onClick: ()=>methods.removeItem(i)
118
- }),
118
+ })
119
119
  ]
120
120
  }, item.content && item.content({
121
121
  width: '100%'
122
122
  }))
123
- }));
123
+ });
124
124
  };
125
125
  ControlledListBlock.defaultProps = blockDefaultProps;
126
126
  ControlledListBlock.meta = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -21,14 +21,12 @@ import Label from '../Label/Label.js';
21
21
  import disabledDate from '../../disabledDate.js';
22
22
  const RangePicker = DatePicker.RangePicker;
23
23
  const rangeValue = (value, format)=>{
24
- if (value && format) return value.map((val)=>moment.utc(val, format).startOf('day')
25
- );
26
- if (value) return value.map((val)=>moment.utc(val).startOf('day')
27
- );
24
+ if (value && format) return value.map((val)=>moment.utc(val, format).startOf('day'));
25
+ if (value) return value.map((val)=>moment.utc(val).startOf('day'));
28
26
  return null;
29
27
  };
30
- const DateRangeSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value , })=>{
31
- return(/*#__PURE__*/ React.createElement(Label, {
28
+ const DateRangeSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value })=>{
29
+ return /*#__PURE__*/ React.createElement(Label, {
32
30
  blockId: blockId,
33
31
  components: {
34
32
  Icon
@@ -62,25 +60,24 @@ const DateRangeSelector = ({ blockId , components: { Icon } , events , loading
62
60
  disabled: properties.disabled || loading,
63
61
  disabledDate: disabledDate(properties.disabledDates),
64
62
  format: properties.format || 'YYYY-MM-DD',
65
- getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
66
- ,
63
+ getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
67
64
  separator: properties.separator || '~',
68
65
  size: properties.size,
66
+ status: validation.status,
69
67
  placeholder: type.isArray(properties.placeholder) && [
70
68
  properties.placeholder[0] || 'Start Date',
71
- properties.placeholder[1] || 'End Date',
69
+ properties.placeholder[1] || 'End Date'
72
70
  ] || [
73
71
  'Start Date',
74
72
  'End Date'
75
73
  ],
76
- suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
74
+ suffixIcon: /*#__PURE__*/ React.createElement(Icon, {
77
75
  blockId: `${blockId}_suffixIcon`,
78
76
  events: events,
79
77
  properties: properties.suffixIcon || 'AiOutlineCalendar'
80
78
  }),
81
79
  onChange: (newVal)=>{
82
- methods.setValue(!newVal ? null : newVal.map((val)=>moment.utc(val.add(val.utcOffset(), 'minutes')).startOf('day').toDate()
83
- ));
80
+ methods.setValue(!newVal ? null : newVal.map((val)=>moment.utc(val.add(val.utcOffset(), 'minutes')).startOf('day').toDate()));
84
81
  methods.triggerEvent({
85
82
  name: 'onChange'
86
83
  });
@@ -88,7 +85,7 @@ const DateRangeSelector = ({ blockId , components: { Icon } , events , loading
88
85
  value: rangeValue(value)
89
86
  }))
90
87
  }
91
- }));
88
+ });
92
89
  };
93
90
  DateRangeSelector.defaultProps = blockDefaultProps;
94
91
  DateRangeSelector.meta = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -19,8 +19,8 @@ import { blockDefaultProps } from '@lowdefy/block-utils';
19
19
  import { DatePicker } from 'antd';
20
20
  import Label from '../Label/Label.js';
21
21
  import disabledDate from '../../disabledDate.js';
22
- const DateSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value , })=>{
23
- return(/*#__PURE__*/ React.createElement(Label, {
22
+ const DateSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value })=>{
23
+ return /*#__PURE__*/ React.createElement(Label, {
24
24
  blockId: blockId,
25
25
  components: {
26
26
  Icon
@@ -53,12 +53,12 @@ const DateSelector = ({ blockId , components: { Icon } , events , loading , met
53
53
  ]),
54
54
  disabled: properties.disabled || loading,
55
55
  format: properties.format || 'YYYY-MM-DD',
56
- getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
57
- ,
56
+ getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
58
57
  placeholder: properties.placeholder || 'Select Date',
59
58
  showToday: properties.showToday,
60
59
  size: properties.size,
61
- suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
60
+ status: validation.status,
61
+ suffixIcon: /*#__PURE__*/ React.createElement(Icon, {
62
62
  blockId: `${blockId}_suffixIcon`,
63
63
  events: events,
64
64
  properties: properties.suffixIcon || 'AiOutlineCalendar'
@@ -73,7 +73,7 @@ const DateSelector = ({ blockId , components: { Icon } , events , loading , met
73
73
  value: type.isDate(value) ? moment.utc(value).startOf('day') : null
74
74
  }))
75
75
  }
76
- }));
76
+ });
77
77
  };
78
78
  DateSelector.defaultProps = blockDefaultProps;
79
79
  DateSelector.meta = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -19,9 +19,9 @@ import { type } from '@lowdefy/helpers';
19
19
  import { blockDefaultProps } from '@lowdefy/block-utils';
20
20
  import Label from '../Label/Label.js';
21
21
  import disabledDate from '../../disabledDate.js';
22
- const DateTimeSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value , })=>{
22
+ const DateTimeSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value })=>{
23
23
  const timeUnit = !type.isString(properties.timeFormat) ? 'minute' : properties.timeFormat === 'HH:mm:ss' ? 'second' : properties.timeFormat === 'HH' ? 'hour' : 'minute';
24
- return(/*#__PURE__*/ React.createElement(Label, {
24
+ return /*#__PURE__*/ React.createElement(Label, {
25
25
  blockId: blockId,
26
26
  components: {
27
27
  Icon
@@ -55,13 +55,13 @@ const DateTimeSelector = ({ blockId , components: { Icon } , events , loading ,
55
55
  disabled: properties.disabled || loading,
56
56
  disabledDate: disabledDate(properties.disabledDates),
57
57
  format: properties.format || 'YYYY-MM-DD HH:mm',
58
- getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
59
- ,
58
+ getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
60
59
  placeholder: properties.placeholder || 'Select Date & Time',
61
60
  showNow: properties.showNow,
62
61
  showToday: properties.showToday,
63
62
  size: properties.size,
64
- suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
63
+ status: validation.status,
64
+ suffixIcon: /*#__PURE__*/ React.createElement(Icon, {
65
65
  blockId: `${blockId}_suffixIcon`,
66
66
  events: events,
67
67
  properties: properties.suffixIcon || 'AiOutlineCalendar'
@@ -72,7 +72,9 @@ const DateTimeSelector = ({ blockId , components: { Icon } , events , loading ,
72
72
  minuteStep: properties.minuteStep || 5,
73
73
  secondStep: properties.secondStep || 30
74
74
  },
75
- onChange: (newVal)=>{
75
+ onSelect: (newVal)=>{
76
+ // NOTE: we use on select instead of onChange to make the block UX
77
+ // more like the DataSelector which changes date on click and not on ok.
76
78
  methods.setValue(!newVal ? null : moment.utc(newVal.add(properties.selectUTC ? newVal.utcOffset() : 0, 'minutes')).startOf(timeUnit).toDate());
77
79
  methods.triggerEvent({
78
80
  name: 'onChange'
@@ -81,7 +83,7 @@ const DateTimeSelector = ({ blockId , components: { Icon } , events , loading ,
81
83
  value: !type.isDate(value) ? null : properties.selectUTC ? moment.utc(value) : moment(value)
82
84
  }))
83
85
  }
84
- }));
86
+ });
85
87
  };
86
88
  DateTimeSelector.defaultProps = blockDefaultProps;
87
89
  DateTimeSelector.meta = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -22,11 +22,10 @@ const DescriptionsBlock = ({ blockId , content , properties , methods })=>{
22
22
  dataItem = Object.keys(dataItem).map((key)=>({
23
23
  value: dataItem[key],
24
24
  key
25
- })
26
- );
25
+ }));
27
26
  }
28
27
  const { makeCssClass } = methods;
29
- return(/*#__PURE__*/ React.createElement(Descriptions, {
28
+ return /*#__PURE__*/ React.createElement(Descriptions, {
30
29
  id: blockId,
31
30
  bordered: properties.bordered,
32
31
  colon: properties.colon,
@@ -40,19 +39,18 @@ const DescriptionsBlock = ({ blockId , content , properties , methods })=>{
40
39
  html: properties.title,
41
40
  methods
42
41
  })
43
- }, dataItem.map((item1, i)=>{
44
- let row = item1;
45
- if (type.isPrimitive(item1)) {
42
+ }, dataItem.map((item, i)=>{
43
+ let row = item;
44
+ if (type.isPrimitive(item)) {
46
45
  row = {
47
- value: item1,
48
- key: item1.toString()
46
+ value: item,
47
+ key: item.toString()
49
48
  };
50
49
  }
51
- const itemOption = (properties.itemOptions || []).find((item)=>row.key === item.key
52
- ) || {};
50
+ const itemOption = (properties.itemOptions || []).find((item)=>row.key === item.key) || {};
53
51
  const value = type.isFunction(itemOption.transformValue) ? itemOption.transformValue(row.value, row, i) : row.value;
54
52
  const label = type.isFunction(itemOption.transformLabel) ? itemOption.transformLabel(row.key || row.label, row, i) : row.key || row.label;
55
- return(/*#__PURE__*/ React.createElement(Descriptions.Item, {
53
+ return /*#__PURE__*/ React.createElement(Descriptions.Item, {
56
54
  key: i,
57
55
  label: renderHtml({
58
56
  html: label,
@@ -66,13 +64,13 @@ const DescriptionsBlock = ({ blockId , content , properties , methods })=>{
66
64
  whiteSpace: 'pre-wrap'
67
65
  },
68
66
  type.isFunction(itemOption.style) ? itemOption.style(row, i) : itemOption.style,
69
- row.style,
67
+ row.style
70
68
  ])}`
71
69
  }, renderHtml({
72
70
  html: value,
73
71
  methods
74
- })));
75
- })));
72
+ }));
73
+ }));
76
74
  };
77
75
  DescriptionsBlock.defaultProps = blockDefaultProps;
78
76
  DescriptionsBlock.meta = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -25,8 +25,7 @@ const DividerBlock = ({ blockId , properties , methods })=>/*#__PURE__*/ React.
25
25
  }, renderHtml({
26
26
  html: properties.title,
27
27
  methods
28
- }))
29
- ;
28
+ }));
30
29
  DividerBlock.defaultProps = blockDefaultProps;
31
30
  DividerBlock.meta = {
32
31
  category: 'display',
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -48,8 +48,7 @@ const DrawerBlock = ({ blockId , content , properties , methods , rename , onClo
48
48
  setOpen,
49
49
  methods,
50
50
  rename
51
- })
52
- );
51
+ }));
53
52
  methods.registerMethod(get(rename, 'methods.setOpen', {
54
53
  default: 'setOpen'
55
54
  }), ({ open })=>triggerSetOpen({
@@ -57,10 +56,9 @@ const DrawerBlock = ({ blockId , content , properties , methods , rename , onClo
57
56
  setOpen,
58
57
  methods,
59
58
  rename
60
- })
61
- );
59
+ }));
62
60
  });
63
- return(/*#__PURE__*/ React.createElement(Drawer, {
61
+ return /*#__PURE__*/ React.createElement(Drawer, {
64
62
  id: blockId,
65
63
  closable: properties.closable,
66
64
  extra: content.extra && content.extra(),
@@ -93,7 +91,7 @@ const DrawerBlock = ({ blockId , content , properties , methods , rename , onClo
93
91
  bodyStyle: methods.makeCssClass(properties.bodyStyle, true),
94
92
  maskStyle: methods.makeCssClass(properties.maskStyle, true),
95
93
  contentWrapperStyle: methods.makeCssClass(properties.contentWrapperStyle, true)
96
- }, content.content && content.content()));
94
+ }, content.content && content.content());
97
95
  };
98
96
  DrawerBlock.defaultProps = blockDefaultProps;
99
97
  DrawerBlock.meta = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -24,8 +24,7 @@ const FooterBlock = ({ blockId , content , methods , properties })=>/*#__PURE__
24
24
  },
25
25
  properties.style
26
26
  ])} hide-on-print`
27
- }, content.content && content.content())
28
- ;
27
+ }, content.content && content.content());
29
28
  FooterBlock.defaultProps = blockDefaultProps;
30
29
  FooterBlock.meta = {
31
30
  category: 'container',
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -22,10 +22,9 @@ const HeaderBlock = ({ blockId , content , methods , properties })=>/*#__PURE__
22
22
  {
23
23
  backgroundColor: properties.theme === 'light' && '#fff'
24
24
  },
25
- properties.style,
25
+ properties.style
26
26
  ])} hide-on-print`
27
- }, content.content && content.content())
28
- ;
27
+ }, content.content && content.content());
29
28
  HeaderBlock.defaultProps = blockDefaultProps;
30
29
  HeaderBlock.meta = {
31
30
  category: 'container',
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.