@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.
@@ -20,10 +20,10 @@ import Label from '../Label/Label.js';
20
20
  import getValueIndex from '../../getValueIndex.js';
21
21
  import getUniqueValues from '../../getUniqueValues.js';
22
22
  const Option = Select.Option;
23
- const Selector = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value: value1 , })=>{
23
+ const Selector = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value })=>{
24
24
  const [fetchState, setFetch] = useState(false);
25
25
  const uniqueValueOptions = getUniqueValues(properties.options || []);
26
- return(/*#__PURE__*/ React.createElement(Label, {
26
+ return /*#__PURE__*/ React.createElement(Label, {
27
27
  blockId: blockId,
28
28
  components: {
29
29
  Icon,
@@ -55,12 +55,12 @@ const Selector = ({ blockId , components: { Icon , Link } , events , loading ,
55
55
  ]),
56
56
  mode: "single",
57
57
  autoFocus: properties.autoFocus,
58
- getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
59
- ,
58
+ getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
60
59
  disabled: properties.disabled || loading,
61
60
  placeholder: get(properties, 'placeholder', {
62
61
  default: 'Select item'
63
62
  }),
63
+ status: validation.status,
64
64
  suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
65
65
  blockId: `${blockId}_suffixIcon`,
66
66
  events: events,
@@ -77,8 +77,7 @@ const Selector = ({ blockId , components: { Icon , Link } , events , loading ,
77
77
  default: true
78
78
  }),
79
79
  size: properties.size,
80
- filterOption: (input, option)=>(option.filterstring || option.children.props.html || '').toLowerCase().indexOf(input.toLowerCase()) >= 0
81
- ,
80
+ filterOption: (input, option)=>(option.filterstring || option.children.props.html || '').toLowerCase().indexOf(input.toLowerCase()) >= 0,
82
81
  notFoundContent: fetchState ? 'Loading' : 'Not found',
83
82
  onChange: (newVal)=>{
84
83
  methods.setValue(type.isPrimitive(uniqueValueOptions[newVal]) ? uniqueValueOptions[newVal] : uniqueValueOptions[newVal].value);
@@ -98,7 +97,7 @@ const Selector = ({ blockId , components: { Icon , Link } , events , loading ,
98
97
  setFetch(false);
99
98
  }
100
99
  },
101
- value: getValueIndex(value1, uniqueValueOptions)
100
+ value: getValueIndex(value, uniqueValueOptions)
102
101
  }, uniqueValueOptions.map((opt, i)=>type.isPrimitive(opt) ? /*#__PURE__*/ React.createElement(Option, {
103
102
  className: methods.makeCssClass(properties.optionsStyle),
104
103
  id: `${blockId}_${i}`,
@@ -123,10 +122,9 @@ const Selector = ({ blockId , components: { Icon , Link } , events , loading ,
123
122
  }) : renderHtml({
124
123
  html: opt.label,
125
124
  methods
126
- }))
127
- )))
125
+ })))))
128
126
  }
129
- }));
127
+ });
130
128
  };
131
129
  Selector.defaultProps = blockDefaultProps;
132
130
  Selector.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.
@@ -44,8 +44,7 @@ const SiderBlock = ({ blockId , properties , content , methods , rename })=>{
44
44
  setOpen,
45
45
  methods,
46
46
  rename
47
- })
48
- );
47
+ }));
49
48
  methods.registerMethod(get(rename, 'methods.setOpen', {
50
49
  default: 'setOpen'
51
50
  }), async ({ open })=>await triggerSetOpen({
@@ -53,10 +52,9 @@ const SiderBlock = ({ blockId , properties , content , methods , rename })=>{
53
52
  setOpen,
54
53
  methods,
55
54
  rename
56
- })
57
- );
55
+ }));
58
56
  });
59
- return(/*#__PURE__*/ React.createElement(Sider, {
57
+ return /*#__PURE__*/ React.createElement(Sider, {
60
58
  id: blockId,
61
59
  className: `${methods.makeCssClass([
62
60
  {
@@ -74,7 +72,7 @@ const SiderBlock = ({ blockId , properties , content , methods , rename })=>{
74
72
  onBreakpoint: ()=>methods.triggerEvent({
75
73
  name: 'onBreakpoint'
76
74
  })
77
- }, content.content && content.content()));
75
+ }, content.content && content.content());
78
76
  };
79
77
  SiderBlock.defaultProps = blockDefaultProps;
80
78
  SiderBlock.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.
@@ -39,8 +39,7 @@ const StatisticBlock = ({ blockId , components: { Icon } , events , properties
39
39
  events: events,
40
40
  properties: properties.suffixIcon
41
41
  }) : properties.suffix || ''
42
- })
43
- ;
42
+ });
44
43
  StatisticBlock.defaultProps = blockDefaultProps;
45
44
  StatisticBlock.meta = {
46
45
  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.
@@ -17,7 +17,7 @@ import { Switch } from 'antd';
17
17
  import { blockDefaultProps } from '@lowdefy/block-utils';
18
18
  import { type, serializer } from '@lowdefy/helpers';
19
19
  import Label from '../Label/Label.js';
20
- const SwitchBlock = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value , })=>{
20
+ const SwitchBlock = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value })=>{
21
21
  let propertiesIconChecked = serializer.copy(properties.checkedIcon);
22
22
  if (type.isString(propertiesIconChecked)) {
23
23
  propertiesIconChecked = {
@@ -30,7 +30,7 @@ const SwitchBlock = ({ blockId , components: { Icon , Link } , events , loading
30
30
  name: propertiesIconUnchecked
31
31
  };
32
32
  }
33
- return(/*#__PURE__*/ React.createElement(Label, {
33
+ return /*#__PURE__*/ React.createElement(Label, {
34
34
  blockId: blockId,
35
35
  components: {
36
36
  Icon,
@@ -54,7 +54,7 @@ const SwitchBlock = ({ blockId , components: { Icon , Link } , events , loading
54
54
  backgroundColor: `${properties.color} !important`
55
55
  }
56
56
  },
57
- properties.inputStyle,
57
+ properties.inputStyle
58
58
  ]),
59
59
  disabled: properties.disabled || loading,
60
60
  id: `${blockId}_input`,
@@ -83,7 +83,7 @@ const SwitchBlock = ({ blockId , components: { Icon , Link } , events , loading
83
83
  }
84
84
  })
85
85
  }
86
- }));
86
+ });
87
87
  };
88
88
  SwitchBlock.defaultProps = blockDefaultProps;
89
89
  SwitchBlock.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.
@@ -12,10 +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 { blockDefaultProps } from '@lowdefy/block-utils';
17
- import { Tabs } from 'antd';
18
- function _extends() {
15
+ */ function _extends() {
19
16
  _extends = Object.assign || function(target) {
20
17
  for(var i = 1; i < arguments.length; i++){
21
18
  var source = arguments[i];
@@ -29,18 +26,19 @@ function _extends() {
29
26
  };
30
27
  return _extends.apply(this, arguments);
31
28
  }
29
+ import React from 'react';
30
+ import { blockDefaultProps } from '@lowdefy/block-utils';
31
+ import { Tabs } from 'antd';
32
32
  const getTabs = ({ content , properties })=>{
33
33
  let tabs = properties.tabs;
34
34
  if (!tabs) {
35
35
  tabs = Object.keys(content).sort().map((key)=>({
36
36
  key,
37
37
  title: key
38
- })
39
- );
38
+ }));
40
39
  }
41
40
  // remove extraAreaKey key area from tabs
42
- return tabs.filter((tab)=>tab.key !== properties.extraAreaKey
43
- );
41
+ return tabs.filter((tab)=>tab.key !== properties.extraAreaKey);
44
42
  };
45
43
  const getAdditionalProps = ({ content , properties })=>{
46
44
  const additionalProps = {};
@@ -61,7 +59,7 @@ const TabsBlock = ({ blockId , components: { Icon } , events , content , method
61
59
  content,
62
60
  properties
63
61
  });
64
- return(/*#__PURE__*/ React.createElement(Tabs, _extends({
62
+ return /*#__PURE__*/ React.createElement(Tabs, _extends({
65
63
  animated: properties.animated !== undefined ? properties.animated : true,
66
64
  defaultActiveKey: properties.defaultActiveKey || tabs[0].key,
67
65
  id: blockId,
@@ -70,8 +68,7 @@ const TabsBlock = ({ blockId , components: { Icon } , events , content , method
70
68
  event: {
71
69
  activeKey
72
70
  }
73
- })
74
- ,
71
+ }),
75
72
  size: properties.size || 'default',
76
73
  tabBarStyle: methods.makeCssClass(properties.tabBarStyle, true),
77
74
  tabPosition: properties.tabPosition || 'top',
@@ -81,8 +78,7 @@ const TabsBlock = ({ blockId , components: { Icon } , events , content , method
81
78
  event: {
82
79
  direction
83
80
  }
84
- })
85
- ,
81
+ }),
86
82
  onTabClick: (key)=>methods.triggerEvent({
87
83
  name: 'onTabClick',
88
84
  event: {
@@ -99,8 +95,7 @@ const TabsBlock = ({ blockId , components: { Icon } , events , content , method
99
95
  events: events,
100
96
  properties: tab.icon
101
97
  }), tab.title || tab.key)
102
- }, content[tab.key] && content[tab.key]())
103
- )));
98
+ }, content[tab.key] && content[tab.key]())));
104
99
  };
105
100
  TabsBlock.defaultProps = blockDefaultProps;
106
101
  TabsBlock.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 { Input } from 'antd';
19
19
  import Label from '../Label/Label.js';
20
20
  import useRunAfterUpdate from '../../useRunAfterUpdate.js';
21
21
  const TextAreaComp = Input.TextArea;
22
- const TextAreaBlock = ({ blockId , components , events , loading , properties , required , validation , value , methods , })=>{
23
- return(/*#__PURE__*/ React.createElement(Label, {
22
+ const TextAreaBlock = ({ blockId , components , events , loading , properties , required , validation , value , methods })=>{
23
+ return /*#__PURE__*/ React.createElement(Label, {
24
24
  blockId: blockId,
25
25
  components: components,
26
26
  events: events,
@@ -34,7 +34,7 @@ const TextAreaBlock = ({ blockId , components , events , loading , properties ,
34
34
  content: {
35
35
  content: ()=>{
36
36
  const runAfterUpdate = useRunAfterUpdate();
37
- return(/*#__PURE__*/ React.createElement(TextAreaComp, {
37
+ return /*#__PURE__*/ React.createElement(TextAreaComp, {
38
38
  id: `${blockId}_input`,
39
39
  allowClear: properties.allowClear,
40
40
  autoFocus: properties.autoFocus,
@@ -68,10 +68,10 @@ const TextAreaBlock = ({ blockId , components , events , loading , properties ,
68
68
  name: 'onPressEnter'
69
69
  });
70
70
  }
71
- }));
71
+ });
72
72
  }
73
73
  }
74
- }));
74
+ });
75
75
  };
76
76
  TextAreaBlock.defaultProps = blockDefaultProps;
77
77
  TextAreaBlock.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.
@@ -17,8 +17,8 @@ import { Input } from 'antd';
17
17
  import { blockDefaultProps } from '@lowdefy/block-utils';
18
18
  import Label from '../Label/Label.js';
19
19
  import useRunAfterUpdate from '../../useRunAfterUpdate.js';
20
- const TextInput = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value , })=>{
21
- return(/*#__PURE__*/ React.createElement(Label, {
20
+ const TextInput = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value })=>{
21
+ return /*#__PURE__*/ React.createElement(Label, {
22
22
  blockId: blockId,
23
23
  components: {
24
24
  Icon,
@@ -35,7 +35,7 @@ const TextInput = ({ blockId , components: { Icon , Link } , events , loading ,
35
35
  content: {
36
36
  content: ()=>{
37
37
  const runAfterUpdate = useRunAfterUpdate();
38
- return(/*#__PURE__*/ React.createElement(Input, {
38
+ return /*#__PURE__*/ React.createElement(Input, {
39
39
  id: `${blockId}_input`,
40
40
  allowClear: properties.allowClear,
41
41
  autoFocus: properties.autoFocus,
@@ -45,6 +45,7 @@ const TextInput = ({ blockId , components: { Icon , Link } , events , loading ,
45
45
  maxLength: properties.maxLength,
46
46
  placeholder: properties.placeholder,
47
47
  size: properties.size,
48
+ status: validation.status,
48
49
  value: value,
49
50
  onChange: (event)=>{
50
51
  methods.setValue(event.target.value);
@@ -67,15 +68,15 @@ const TextInput = ({ blockId , components: { Icon , Link } , events , loading ,
67
68
  events: events,
68
69
  properties: properties.prefixIcon
69
70
  }),
70
- suffix: properties.suffix || properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
71
+ suffix: (properties.suffix || properties.suffixIcon) && /*#__PURE__*/ React.createElement(React.Fragment, null, properties.suffix && properties.suffix, properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
71
72
  blockId: `${blockId}_suffixIcon`,
72
73
  events: events,
73
74
  properties: properties.suffixIcon
74
- })
75
- }));
75
+ }))
76
+ });
76
77
  }
77
78
  }
78
- }));
79
+ });
79
80
  };
80
81
  TextInput.defaultProps = blockDefaultProps;
81
82
  TextInput.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.
@@ -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 { Timeline } from 'antd';
17
- import { blockDefaultProps } from '@lowdefy/block-utils';
18
- import { get, mergeObjects, serializer, type } from '@lowdefy/helpers';
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,6 +26,10 @@ function _extends() {
30
26
  };
31
27
  return _extends.apply(this, arguments);
32
28
  }
29
+ import React from 'react';
30
+ import { Timeline } from 'antd';
31
+ import { blockDefaultProps } from '@lowdefy/block-utils';
32
+ import { get, mergeObjects, serializer, type } from '@lowdefy/helpers';
33
33
  // TODO: need to pass value to list blocks to render item level settings.
34
34
  const TimelineList = ({ blockId , components: { Icon } , events , list , methods , properties })=>{
35
35
  // Temporary fix until list blocks get value from state
@@ -38,7 +38,7 @@ const TimelineList = ({ blockId , components: { Icon } , events , list , method
38
38
  if (properties.mode) {
39
39
  other.mode = properties.mode;
40
40
  }
41
- return(/*#__PURE__*/ React.createElement(Timeline, _extends({
41
+ return /*#__PURE__*/ React.createElement(Timeline, _extends({
42
42
  id: blockId,
43
43
  className: methods.makeCssClass([
44
44
  {
@@ -72,7 +72,7 @@ const TimelineList = ({ blockId , components: { Icon } , events , list , method
72
72
  style = {};
73
73
  }
74
74
  const color = get(value, `${i}.${properties.colorField || 'color'}`);
75
- return(/*#__PURE__*/ React.createElement(Timeline.Item, {
75
+ return /*#__PURE__*/ React.createElement(Timeline.Item, {
76
76
  key: `${blockId}_${i}`,
77
77
  color: color,
78
78
  position: get(value, `${i}.${properties.positionField || 'position'}`),
@@ -88,8 +88,8 @@ const TimelineList = ({ blockId , components: { Icon } , events , list , method
88
88
  icon
89
89
  ])
90
90
  })
91
- }, child.content && child.content()));
92
- })));
91
+ }, child.content && child.content());
92
+ }));
93
93
  };
94
94
  TimelineList.defaultProps = blockDefaultProps;
95
95
  TimelineList.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.
@@ -18,13 +18,13 @@ import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
18
18
  import { type } from '@lowdefy/helpers';
19
19
  const Title = Typography.Title;
20
20
  const TitleBlock = ({ blockId , components: { Icon } , events , properties , methods })=>{
21
- return(/*#__PURE__*/ React.createElement(Title, {
21
+ return /*#__PURE__*/ React.createElement(Title, {
22
22
  id: blockId,
23
23
  className: methods.makeCssClass([
24
24
  properties.color && {
25
25
  color: `${properties.color} !important`
26
26
  },
27
- properties.style,
27
+ properties.style
28
28
  ]),
29
29
  code: properties.code,
30
30
  copyable: type.isObject(properties.copyable) ? {
@@ -49,7 +49,7 @@ const TitleBlock = ({ blockId , components: { Icon } , events , properties , me
49
49
  blockId: `${blockId}_copyable_after_icon`,
50
50
  events: events,
51
51
  properties: properties.copyable.icon[1]
52
- }),
52
+ })
53
53
  ] : /*#__PURE__*/ React.createElement(Icon, {
54
54
  blockId: `${blockId}_copyable_icon`,
55
55
  events: events,
@@ -96,7 +96,7 @@ const TitleBlock = ({ blockId , components: { Icon } , events , properties , me
96
96
  }, renderHtml({
97
97
  html: properties.content,
98
98
  methods
99
- })));
99
+ }));
100
100
  };
101
101
  TitleBlock.defaultProps = blockDefaultProps;
102
102
  TitleBlock.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.
@@ -15,3 +15,4 @@
15
15
  */
16
16
 
17
17
  @import 'antd/lib/typography/style/index.less';
18
+ @import 'antd/lib/tooltip/style/index.less';
@@ -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 { Typography } from 'antd';
17
17
  import { blockDefaultProps } from '@lowdefy/block-utils';
18
18
  import { type } from '@lowdefy/helpers';
19
19
  const Title = Typography.Title;
20
- const TitleInput = ({ blockId , components: { Icon } , events , loading , methods , properties , value , })=>{
20
+ const TitleInput = ({ blockId , components: { Icon } , events , loading , methods , properties , value })=>{
21
21
  const [editing, setEdit] = useState(false);
22
22
  const editableEvents = {
23
23
  onStart: ()=>{
@@ -37,7 +37,7 @@ const TitleInput = ({ blockId , components: { Icon } , events , loading , metho
37
37
  });
38
38
  }
39
39
  };
40
- return(/*#__PURE__*/ React.createElement(Title, {
40
+ return /*#__PURE__*/ React.createElement(Title, {
41
41
  id: blockId,
42
42
  code: properties.code,
43
43
  italic: properties.italic,
@@ -49,7 +49,7 @@ const TitleInput = ({ blockId , components: { Icon } , events , loading , metho
49
49
  properties.color && {
50
50
  color: `${properties.color} !important`
51
51
  },
52
- properties.style,
52
+ properties.style
53
53
  ]),
54
54
  copyable: type.isObject(properties.copyable) ? {
55
55
  text: properties.copyable.text,
@@ -73,7 +73,7 @@ const TitleInput = ({ blockId , components: { Icon } , events , loading , metho
73
73
  events: events,
74
74
  blockId: `${blockId}_copyable_after_icon`,
75
75
  properties: properties.copyable.icon[1]
76
- }),
76
+ })
77
77
  ] : /*#__PURE__*/ React.createElement(Icon, {
78
78
  blockId: `${blockId}_copyable_icon`,
79
79
  events: events,
@@ -108,7 +108,7 @@ const TitleInput = ({ blockId , components: { Icon } , events , loading , metho
108
108
  autoSize: properties.editable.autoSize,
109
109
  ...editableEvents
110
110
  } : properties.editable !== false && editableEvents
111
- }, !type.isNone(value) ? value.toString() : ''));
111
+ }, !type.isNone(value) ? value.toString() : '');
112
112
  };
113
113
  TitleInput.defaultProps = blockDefaultProps;
114
114
  TitleInput.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.
@@ -36,8 +36,7 @@ const TooltipBlock = ({ blockId , content , properties , methods })=>/*#__PURE_
36
36
  name: 'onVisibleChange'
37
37
  })
38
38
  }, content.content && content.content(), '' // required by antd to wrap element in span tag.
39
- )
40
- ;
39
+ );
41
40
  TooltipBlock.defaultProps = blockDefaultProps;
42
41
  TooltipBlock.meta = {
43
42
  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.
@@ -20,8 +20,8 @@ import moment from 'moment';
20
20
  import disabledDate from '../../disabledDate.js';
21
21
  import Label from '../Label/Label.js';
22
22
  const WeekPicker = DatePicker.WeekPicker;
23
- const WeekSelector = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value , })=>{
24
- return(/*#__PURE__*/ React.createElement(Label, {
23
+ const WeekSelector = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value })=>{
24
+ return /*#__PURE__*/ React.createElement(Label, {
25
25
  blockId: blockId,
26
26
  components: {
27
27
  Icon,
@@ -56,11 +56,11 @@ const WeekSelector = ({ blockId , components: { Icon , Link } , events , loadin
56
56
  disabled: properties.disabled || loading,
57
57
  disabledDate: disabledDate(properties.disabledDates),
58
58
  format: properties.format || 'YYYY-wo',
59
- getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
60
- ,
59
+ getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
61
60
  placeholder: properties.placeholder || 'Select Week',
62
61
  size: properties.size,
63
- suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
62
+ status: validation.status,
63
+ suffixIcon: /*#__PURE__*/ React.createElement(Icon, {
64
64
  blockId: `${blockId}_suffixIcon`,
65
65
  events: events,
66
66
  properties: properties.suffixIcon || 'AiOutlineCalendar'
@@ -74,7 +74,7 @@ const WeekSelector = ({ blockId , components: { Icon , Link } , events , loadin
74
74
  value: value && type.isDate(value) ? moment.utc(value).startOf('week') : null
75
75
  }))
76
76
  }
77
- }));
77
+ });
78
78
  };
79
79
  WeekSelector.defaultProps = blockDefaultProps;
80
80
  WeekSelector.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.
package/dist/blocks.js CHANGED
@@ -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.