@lowdefy/blocks-antd 4.0.0-rc.9 → 4.0.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 (144) hide show
  1. package/dist/blocks/Affix/Affix.js +2 -2
  2. package/dist/blocks/Affix/style.less +1 -1
  3. package/dist/blocks/Alert/Alert.js +7 -20
  4. package/dist/blocks/Alert/style.less +1 -1
  5. package/dist/blocks/AutoComplete/AutoComplete.js +18 -3
  6. package/dist/blocks/AutoComplete/schema.json +12 -0
  7. package/dist/blocks/AutoComplete/style.less +1 -1
  8. package/dist/blocks/Avatar/Avatar.js +2 -2
  9. package/dist/blocks/Avatar/style.less +1 -1
  10. package/dist/blocks/Badge/Badge.js +2 -2
  11. package/dist/blocks/Badge/style.less +1 -1
  12. package/dist/blocks/Breadcrumb/Breadcrumb.js +7 -20
  13. package/dist/blocks/Breadcrumb/style.less +1 -1
  14. package/dist/blocks/Button/Button.js +2 -2
  15. package/dist/blocks/Button/style.less +1 -1
  16. package/dist/blocks/ButtonSelector/ButtonSelector.js +2 -2
  17. package/dist/blocks/ButtonSelector/style.less +1 -1
  18. package/dist/blocks/Card/Card.js +3 -2
  19. package/dist/blocks/Card/style.less +1 -1
  20. package/dist/blocks/Carousel/Carousel.js +9 -22
  21. package/dist/blocks/Carousel/style.less +1 -1
  22. package/dist/blocks/CheckboxSelector/CheckboxSelector.js +2 -2
  23. package/dist/blocks/CheckboxSelector/style.less +1 -1
  24. package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +2 -2
  25. package/dist/blocks/CheckboxSwitch/style.less +1 -1
  26. package/dist/blocks/Collapse/Collapse.js +8 -21
  27. package/dist/blocks/Collapse/style.less +1 -1
  28. package/dist/blocks/Comment/Comment.js +2 -2
  29. package/dist/blocks/Comment/style.less +1 -1
  30. package/dist/blocks/ConfirmModal/ConfirmModal.js +9 -9
  31. package/dist/blocks/ConfirmModal/style.less +1 -1
  32. package/dist/blocks/Content/Content.js +2 -2
  33. package/dist/blocks/Content/style.less +1 -1
  34. package/dist/blocks/ControlledList/ControlledList.js +6 -6
  35. package/dist/blocks/ControlledList/style.less +1 -1
  36. package/dist/blocks/DateRangeSelector/DateRangeSelector.js +9 -9
  37. package/dist/blocks/DateRangeSelector/style.less +1 -1
  38. package/dist/blocks/DateSelector/DateSelector.js +5 -5
  39. package/dist/blocks/DateSelector/style.less +1 -1
  40. package/dist/blocks/DateTimeSelector/DateTimeSelector.js +19 -17
  41. package/dist/blocks/DateTimeSelector/style.less +1 -1
  42. package/dist/blocks/Descriptions/Descriptions.js +3 -3
  43. package/dist/blocks/Descriptions/style.less +1 -1
  44. package/dist/blocks/Divider/Divider.js +2 -2
  45. package/dist/blocks/Divider/style.less +1 -1
  46. package/dist/blocks/Drawer/Drawer.js +4 -4
  47. package/dist/blocks/Drawer/style.less +1 -1
  48. package/dist/blocks/Footer/Footer.js +2 -2
  49. package/dist/blocks/Footer/style.less +1 -1
  50. package/dist/blocks/Header/Header.js +2 -2
  51. package/dist/blocks/Header/style.less +1 -1
  52. package/dist/blocks/Label/Label.js +10 -22
  53. package/dist/blocks/Label/getLabelCol.js +1 -1
  54. package/dist/blocks/Label/getWrapperCol.js +7 -7
  55. package/dist/blocks/Label/labelLogic.js +18 -18
  56. package/dist/blocks/Label/style.less +1 -1
  57. package/dist/blocks/Layout/Layout.js +2 -2
  58. package/dist/blocks/Layout/style.less +1 -1
  59. package/dist/blocks/Menu/Menu.js +35 -43
  60. package/dist/blocks/Menu/style.less +1 -1
  61. package/dist/blocks/Message/Message.js +6 -6
  62. package/dist/blocks/Message/style.less +1 -1
  63. package/dist/blocks/MobileMenu/MobileMenu.js +5 -5
  64. package/dist/blocks/MobileMenu/style.less +1 -1
  65. package/dist/blocks/Modal/Modal.js +12 -25
  66. package/dist/blocks/Modal/style.less +1 -1
  67. package/dist/blocks/MonthSelector/MonthSelector.js +5 -5
  68. package/dist/blocks/MonthSelector/style.less +1 -1
  69. package/dist/blocks/MultipleSelector/MultipleSelector.js +42 -5
  70. package/dist/blocks/MultipleSelector/schema.json +43 -0
  71. package/dist/blocks/MultipleSelector/style.less +2 -1
  72. package/dist/blocks/Notification/Notification.js +2 -2
  73. package/dist/blocks/Notification/style.less +1 -1
  74. package/dist/blocks/NumberInput/NumberInput.js +12 -2
  75. package/dist/blocks/NumberInput/schema.json +9 -1
  76. package/dist/blocks/NumberInput/style.less +1 -1
  77. package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +2 -2
  78. package/dist/blocks/PageHeaderMenu/style.less +1 -1
  79. package/dist/blocks/PageSiderMenu/PageSiderMenu.js +3 -3
  80. package/dist/blocks/PageSiderMenu/style.less +1 -1
  81. package/dist/blocks/Pagination/Pagination.js +4 -4
  82. package/dist/blocks/Pagination/style.less +1 -1
  83. package/dist/blocks/Paragraph/Paragraph.js +3 -2
  84. package/dist/blocks/Paragraph/schema.json +4 -0
  85. package/dist/blocks/Paragraph/style.less +1 -1
  86. package/dist/blocks/ParagraphInput/ParagraphInput.js +2 -2
  87. package/dist/blocks/ParagraphInput/style.less +1 -1
  88. package/dist/blocks/PasswordInput/PasswordInput.js +12 -2
  89. package/dist/blocks/PasswordInput/schema.json +8 -0
  90. package/dist/blocks/PasswordInput/style.less +1 -1
  91. package/dist/blocks/PhoneNumberInput/PhoneNumberInput.js +26 -6
  92. package/dist/blocks/PhoneNumberInput/schema.json +8 -0
  93. package/dist/blocks/PhoneNumberInput/style.less +1 -1
  94. package/dist/blocks/Progress/Progress.js +2 -2
  95. package/dist/blocks/Progress/style.less +1 -1
  96. package/dist/blocks/RadioSelector/RadioSelector.js +2 -2
  97. package/dist/blocks/RadioSelector/style.less +1 -1
  98. package/dist/blocks/RatingSlider/RatingSlider.js +9 -9
  99. package/dist/blocks/RatingSlider/style.less +1 -1
  100. package/dist/blocks/Result/Result.js +2 -2
  101. package/dist/blocks/Result/style.less +1 -1
  102. package/dist/blocks/Selector/Selector.js +17 -2
  103. package/dist/blocks/Selector/schema.json +12 -0
  104. package/dist/blocks/Selector/style.less +1 -1
  105. package/dist/blocks/Sider/Sider.js +5 -5
  106. package/dist/blocks/Sider/style.less +1 -1
  107. package/dist/blocks/Slider/Slider.js +76 -0
  108. package/dist/blocks/Slider/style.less +18 -0
  109. package/dist/blocks/Statistic/Statistic.js +11 -5
  110. package/dist/blocks/Statistic/style.less +1 -1
  111. package/dist/blocks/Switch/Switch.js +2 -2
  112. package/dist/blocks/Switch/style.less +1 -1
  113. package/dist/blocks/Tabs/Tabs.js +55 -53
  114. package/dist/blocks/Tabs/schema.json +1 -5
  115. package/dist/blocks/Tabs/style.less +1 -1
  116. package/dist/blocks/Tag/Tag.js +57 -0
  117. package/dist/blocks/Tag/schema.json +45 -0
  118. package/dist/blocks/Tag/style.less +17 -0
  119. package/dist/blocks/TextArea/TextArea.js +12 -2
  120. package/dist/blocks/TextArea/schema.json +8 -0
  121. package/dist/blocks/TextArea/style.less +1 -1
  122. package/dist/blocks/TextInput/TextInput.js +13 -3
  123. package/dist/blocks/TextInput/schema.json +8 -0
  124. package/dist/blocks/TextInput/style.less +1 -1
  125. package/dist/blocks/TimelineList/TimelineList.js +12 -25
  126. package/dist/blocks/TimelineList/style.less +1 -1
  127. package/dist/blocks/Title/Title.js +2 -2
  128. package/dist/blocks/Title/style.less +1 -1
  129. package/dist/blocks/TitleInput/TitleInput.js +2 -2
  130. package/dist/blocks/TitleInput/style.less +1 -1
  131. package/dist/blocks/Tooltip/Tooltip.js +3 -3
  132. package/dist/blocks/Tooltip/style.less +1 -1
  133. package/dist/blocks/WeekSelector/WeekSelector.js +5 -5
  134. package/dist/blocks/WeekSelector/style.less +1 -1
  135. package/dist/blocks.js +3 -1
  136. package/dist/color.js +1 -1
  137. package/dist/disabledDate.js +2 -3
  138. package/dist/getUniqueValues.js +1 -1
  139. package/dist/getValueIndex.js +1 -1
  140. package/dist/style.less +1 -1
  141. package/dist/types.js +3 -3
  142. package/dist/useRunAfterUpdate.js +1 -1
  143. package/dist/validationExamples.js +1 -1
  144. package/package.json +21 -23
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -16,7 +16,7 @@
16
16
  import { Layout } from 'antd';
17
17
  import { blockDefaultProps } from '@lowdefy/block-utils';
18
18
  const Content = Layout.Content;
19
- const ContentBlock = ({ blockId , content , methods , properties })=>/*#__PURE__*/ React.createElement(Content, {
19
+ const ContentBlock = ({ blockId, content, methods, properties })=>/*#__PURE__*/ React.createElement(Content, {
20
20
  id: blockId,
21
21
  className: methods.makeCssClass(properties.style)
22
22
  }, content.content && content.content());
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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);
@@ -62,7 +62,7 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
62
62
  properties: {
63
63
  icon: 'AiOutlinePlus',
64
64
  size: properties.size,
65
- title: get(properties, 'addItemButton.title ') || 'Add Item',
65
+ title: get(properties, 'addItemButton.title ') ?? 'Add Item',
66
66
  type: 'default',
67
67
  ...properties.addItemButton
68
68
  },
@@ -83,7 +83,7 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
83
83
  properties: {
84
84
  icon: 'AiOutlinePlus',
85
85
  size: properties.size,
86
- title: get(properties, 'addItemButton.title ') || 'Add Item',
86
+ title: get(properties, 'addItemButton.title ') ?? 'Add Item',
87
87
  type: 'dashed',
88
88
  ...properties.addItemButton
89
89
  },
@@ -91,7 +91,7 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
91
91
  })),
92
92
  bordered: true,
93
93
  locale: {
94
- emptyText: properties.noDataTitle || 'No Items'
94
+ emptyText: properties.noDataTitle ?? 'No Items'
95
95
  },
96
96
  dataSource: list,
97
97
  renderItem: (item, i)=>/*#__PURE__*/ React.createElement(List.Item, {
@@ -111,7 +111,7 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
111
111
  style: {
112
112
  paddingLeft: properties.size === 'small' ? 2 : properties.size === 'large' ? 6 : 4,
113
113
  fontSize: properties.size === 'small' ? 16 : properties.size === 'large' ? 20 : 18,
114
- ...properties.removeItemIcon && properties.removeItemIcon.style ? properties.removeItemIcon.style : {}
114
+ ...properties.removeItemIcon?.style ? properties.removeItemIcon.style : {}
115
115
  }
116
116
  },
117
117
  onClick: ()=>methods.removeItem(i)
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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,7 +25,7 @@ const rangeValue = (value, format)=>{
25
25
  if (value) return value.map((val)=>moment.utc(val).startOf('day'));
26
26
  return null;
27
27
  };
28
- const DateRangeSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value })=>{
28
+ const DateRangeSelector = ({ blockId, components: { Icon }, events, loading, methods, properties, required, validation, value })=>{
29
29
  return /*#__PURE__*/ React.createElement(Label, {
30
30
  blockId: blockId,
31
31
  components: {
@@ -59,22 +59,22 @@ const DateRangeSelector = ({ blockId , components: { Icon } , events , loading
59
59
  ]),
60
60
  disabled: properties.disabled || loading,
61
61
  disabledDate: disabledDate(properties.disabledDates),
62
- format: properties.format || 'YYYY-MM-DD',
62
+ format: properties.format ?? 'YYYY-MM-DD',
63
63
  getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
64
- separator: properties.separator || '~',
64
+ separator: properties.separator ?? '~',
65
65
  size: properties.size,
66
66
  status: validation.status,
67
- placeholder: type.isArray(properties.placeholder) && [
68
- properties.placeholder[0] || 'Start Date',
69
- properties.placeholder[1] || 'End Date'
70
- ] || [
67
+ placeholder: (type.isArray(properties.placeholder) && [
68
+ properties.placeholder[0] ?? 'Start Date',
69
+ properties.placeholder[1] ?? 'End Date'
70
+ ]) ?? [
71
71
  'Start Date',
72
72
  'End Date'
73
73
  ],
74
74
  suffixIcon: /*#__PURE__*/ React.createElement(Icon, {
75
75
  blockId: `${blockId}_suffixIcon`,
76
76
  events: events,
77
- properties: properties.suffixIcon || 'AiOutlineCalendar'
77
+ properties: properties.suffixIcon ?? 'AiOutlineCalendar'
78
78
  }),
79
79
  onChange: (newVal)=>{
80
80
  methods.setValue(!newVal ? null : newVal.map((val)=>moment.utc(val.add(val.utcOffset(), 'minutes')).startOf('day').toDate()));
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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,7 +19,7 @@ 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 })=>{
22
+ const DateSelector = ({ blockId, components: { Icon }, events, loading, methods, properties, required, validation, value })=>{
23
23
  return /*#__PURE__*/ React.createElement(Label, {
24
24
  blockId: blockId,
25
25
  components: {
@@ -52,16 +52,16 @@ const DateSelector = ({ blockId , components: { Icon } , events , loading , met
52
52
  properties.inputStyle
53
53
  ]),
54
54
  disabled: properties.disabled || loading,
55
- format: properties.format || 'YYYY-MM-DD',
55
+ format: properties.format ?? 'YYYY-MM-DD',
56
56
  getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
57
- placeholder: properties.placeholder || 'Select Date',
57
+ placeholder: properties.placeholder ?? 'Select Date',
58
58
  showToday: properties.showToday,
59
59
  size: properties.size,
60
60
  status: validation.status,
61
61
  suffixIcon: /*#__PURE__*/ React.createElement(Icon, {
62
62
  blockId: `${blockId}_suffixIcon`,
63
63
  events: events,
64
- properties: properties.suffixIcon || 'AiOutlineCalendar'
64
+ properties: properties.suffixIcon ?? 'AiOutlineCalendar'
65
65
  }),
66
66
  disabledDate: disabledDate(properties.disabledDates),
67
67
  onChange: (newVal)=>{
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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,14 @@ 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
+ const onChange = (newVal)=>{
25
+ methods.setValue(!newVal ? null : moment.utc(newVal.add(properties.selectUTC ? newVal.utcOffset() : 0, 'minutes')).startOf(timeUnit).toDate());
26
+ methods.triggerEvent({
27
+ name: 'onChange'
28
+ });
29
+ };
24
30
  return /*#__PURE__*/ React.createElement(Label, {
25
31
  blockId: blockId,
26
32
  components: {
@@ -54,9 +60,9 @@ const DateTimeSelector = ({ blockId , components: { Icon } , events , loading ,
54
60
  ]),
55
61
  disabled: properties.disabled || loading,
56
62
  disabledDate: disabledDate(properties.disabledDates),
57
- format: properties.format || 'YYYY-MM-DD HH:mm',
63
+ format: properties.format ?? 'YYYY-MM-DD HH:mm',
58
64
  getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
59
- placeholder: properties.placeholder || 'Select Date & Time',
65
+ placeholder: properties.placeholder ?? 'Select Date & Time',
60
66
  showNow: properties.showNow,
61
67
  showToday: properties.showToday,
62
68
  size: properties.size,
@@ -64,22 +70,18 @@ const DateTimeSelector = ({ blockId , components: { Icon } , events , loading ,
64
70
  suffixIcon: /*#__PURE__*/ React.createElement(Icon, {
65
71
  blockId: `${blockId}_suffixIcon`,
66
72
  events: events,
67
- properties: properties.suffixIcon || 'AiOutlineCalendar'
73
+ properties: properties.suffixIcon ?? 'AiOutlineCalendar'
68
74
  }),
69
75
  showTime: {
70
- format: properties.timeFormat || 'HH:mm',
71
- hourStep: properties.hourStep || 1,
72
- minuteStep: properties.minuteStep || 5,
73
- secondStep: properties.secondStep || 30
74
- },
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.
78
- methods.setValue(!newVal ? null : moment.utc(newVal.add(properties.selectUTC ? newVal.utcOffset() : 0, 'minutes')).startOf(timeUnit).toDate());
79
- methods.triggerEvent({
80
- name: 'onChange'
81
- });
76
+ format: properties.timeFormat ?? 'HH:mm',
77
+ hourStep: properties.hourStep ?? 1,
78
+ minuteStep: properties.minuteStep ?? 5,
79
+ secondStep: properties.secondStep ?? 30
82
80
  },
81
+ onChange: onChange,
82
+ onSelect: // NOTE: we use on select instead of onChange to make the block UX
83
+ // more like the DataSelector which changes date on click and not on ok.
84
+ onChange,
83
85
  value: !type.isDate(value) ? null : properties.selectUTC ? moment.utc(value) : moment(value)
84
86
  }))
85
87
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -16,7 +16,7 @@
16
16
  import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
17
17
  import { Descriptions } from 'antd';
18
18
  import { type } from '@lowdefy/helpers';
19
- const DescriptionsBlock = ({ blockId , content , properties , methods })=>{
19
+ const DescriptionsBlock = ({ blockId, content, properties, methods })=>{
20
20
  let dataItem = properties.items || [];
21
21
  if (type.isObject(dataItem)) {
22
22
  dataItem = Object.keys(dataItem).map((key)=>({
@@ -24,7 +24,7 @@ const DescriptionsBlock = ({ blockId , content , properties , methods })=>{
24
24
  key
25
25
  }));
26
26
  }
27
- const { makeCssClass } = methods;
27
+ const { makeCssClass } = methods;
28
28
  return /*#__PURE__*/ React.createElement(Descriptions, {
29
29
  id: blockId,
30
30
  bordered: properties.bordered,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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,7 +15,7 @@
15
15
  */ import React from 'react';
16
16
  import { Divider } from 'antd';
17
17
  import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
18
- const DividerBlock = ({ blockId , properties , methods })=>/*#__PURE__*/ React.createElement(Divider, {
18
+ const DividerBlock = ({ blockId, properties, methods })=>/*#__PURE__*/ React.createElement(Divider, {
19
19
  id: blockId,
20
20
  dashed: properties.dashed,
21
21
  orientation: properties.orientation,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -16,7 +16,7 @@
16
16
  import { Drawer } from 'antd';
17
17
  import { get } from '@lowdefy/helpers';
18
18
  import { blockDefaultProps } from '@lowdefy/block-utils';
19
- const triggerSetOpen = ({ state , setOpen , methods , rename })=>{
19
+ const triggerSetOpen = ({ state, setOpen, methods, rename })=>{
20
20
  if (!state) {
21
21
  methods.triggerEvent({
22
22
  name: get(rename, 'events.onClose', {
@@ -38,7 +38,7 @@ const triggerSetOpen = ({ state , setOpen , methods , rename })=>{
38
38
  });
39
39
  setOpen(state);
40
40
  };
41
- const DrawerBlock = ({ blockId , content , properties , methods , rename , onClose })=>{
41
+ const DrawerBlock = ({ blockId, content, properties, methods, rename, onClose })=>{
42
42
  const [openState, setOpen] = useState(false);
43
43
  useEffect(()=>{
44
44
  methods.registerMethod(get(rename, 'methods.toggleOpen', {
@@ -51,7 +51,7 @@ const DrawerBlock = ({ blockId , content , properties , methods , rename , onClo
51
51
  }));
52
52
  methods.registerMethod(get(rename, 'methods.setOpen', {
53
53
  default: 'setOpen'
54
- }), ({ open })=>triggerSetOpen({
54
+ }), ({ open })=>triggerSetOpen({
55
55
  state: !!open,
56
56
  setOpen,
57
57
  methods,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -16,7 +16,7 @@
16
16
  import { Layout } from 'antd';
17
17
  import { blockDefaultProps } from '@lowdefy/block-utils';
18
18
  const Footer = Layout.Footer;
19
- const FooterBlock = ({ blockId , content , methods , properties })=>/*#__PURE__*/ React.createElement(Footer, {
19
+ const FooterBlock = ({ blockId, content, methods, properties })=>/*#__PURE__*/ React.createElement(Footer, {
20
20
  id: blockId,
21
21
  className: `${methods.makeCssClass([
22
22
  {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -16,7 +16,7 @@
16
16
  import { Layout } from 'antd';
17
17
  import { blockDefaultProps } from '@lowdefy/block-utils';
18
18
  const Header = Layout.Header;
19
- const HeaderBlock = ({ blockId , content , methods , properties })=>/*#__PURE__*/ React.createElement(Header, {
19
+ const HeaderBlock = ({ blockId, content, methods, properties })=>/*#__PURE__*/ React.createElement(Header, {
20
20
  id: blockId,
21
21
  className: `${methods.makeCssClass([
22
22
  {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -14,20 +14,6 @@
14
14
  limitations under the License.
15
15
  */ // Derived from https://github.com/ant-design/ant-design/blob/master/components/form/FormItemLabel.tsx
16
16
  // MIT Copyright (c) 2015-present Ant UED, https://xtech.antfin.com/ - 2020-09-08
17
- function _extends() {
18
- _extends = Object.assign || function(target) {
19
- for(var i = 1; i < arguments.length; i++){
20
- var source = arguments[i];
21
- for(var key in source){
22
- if (Object.prototype.hasOwnProperty.call(source, key)) {
23
- target[key] = source[key];
24
- }
25
- }
26
- }
27
- return target;
28
- };
29
- return _extends.apply(this, arguments);
30
- }
31
17
  import React from 'react';
32
18
  import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
33
19
  import { Col, Row } from 'antd';
@@ -39,8 +25,8 @@ const validationKeyMap = {
39
25
  warning: 'warnings'
40
26
  };
41
27
  let iconMap;
42
- const Label = ({ blockId , components: { Icon } , content , methods , properties , required , validation })=>{
43
- const { extraClassName , feedbackClassName , iconClassName , label , labelClassName , labelCol , labelColClassName , rowClassName , showExtra , showFeedback , wrapperCol } = labelLogic({
28
+ const Label = ({ blockId, components: { Icon }, content, methods, properties, required, validation })=>{
29
+ const { extraClassName, feedbackClassName, iconClassName, label, labelClassName, labelCol, labelColClassName, rowClassName, showExtra, showFeedback, wrapperCol } = labelLogic({
44
30
  blockId,
45
31
  content,
46
32
  methods,
@@ -71,18 +57,20 @@ const Label = ({ blockId , components: { Icon } , content , methods , propertie
71
57
  return /*#__PURE__*/ React.createElement(Row, {
72
58
  id: blockId,
73
59
  className: rowClassName
74
- }, label && /*#__PURE__*/ React.createElement(Col, _extends({}, labelCol, {
60
+ }, label && /*#__PURE__*/ React.createElement(Col, {
61
+ ...labelCol,
75
62
  className: labelColClassName
76
- }), /*#__PURE__*/ React.createElement("label", {
63
+ }, /*#__PURE__*/ React.createElement("label", {
77
64
  htmlFor: `${blockId}_input`,
78
65
  className: labelClassName,
79
66
  title: label
80
67
  }, renderHtml({
81
68
  html: label,
82
69
  methods
83
- }))), /*#__PURE__*/ React.createElement(Col, _extends({}, wrapperCol, {
70
+ }))), /*#__PURE__*/ React.createElement(Col, {
71
+ ...wrapperCol,
84
72
  className: "ant-form-item-control"
85
- }), /*#__PURE__*/ React.createElement("div", {
73
+ }, /*#__PURE__*/ React.createElement("div", {
86
74
  className: "ant-form-item-control-input"
87
75
  }, /*#__PURE__*/ React.createElement("div", {
88
76
  className: "ant-form-item-control-input-content"
@@ -91,7 +79,7 @@ const Label = ({ blockId , components: { Icon } , content , methods , propertie
91
79
  motionName: "show-help",
92
80
  motionAppear: true,
93
81
  removeOnLeave: true
94
- }, ({ className: motionClassName })=>/*#__PURE__*/ React.createElement("div", {
82
+ }, ({ className: motionClassName })=>/*#__PURE__*/ React.createElement("div", {
95
83
  className: classNames(extraClassName, motionClassName)
96
84
  }, showFeedback ? /*#__PURE__*/ React.createElement("div", {
97
85
  className: classNames(feedbackClassName)
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -31,7 +31,7 @@
31
31
  span: 24 - value.span
32
32
  };
33
33
  }
34
- if (value.sm && value.sm.span) {
34
+ if (value.sm?.span) {
35
35
  defaultVal.sm = {
36
36
  span: 24 - value.sm.span
37
37
  };
@@ -39,27 +39,27 @@
39
39
  span: 24 - value.sm.span
40
40
  };
41
41
  }
42
- if (value.xs && value.xs.span) {
42
+ if (value.xs?.span) {
43
43
  defaultVal.xs = {
44
44
  span: 24 - value.xs.span
45
45
  };
46
46
  }
47
- if (value.md && value.md.span) {
47
+ if (value.md?.span) {
48
48
  defaultVal.md = {
49
49
  span: 24 - value.md.span
50
50
  };
51
51
  }
52
- if (value.lg && value.lg.span) {
52
+ if (value.lg?.span) {
53
53
  defaultVal.lg = {
54
54
  span: 24 - value.lg.span
55
55
  };
56
56
  }
57
- if (value.xl && value.xl.span) {
57
+ if (value.xl?.span) {
58
58
  defaultVal.xl = {
59
59
  span: 24 - value.xl.span
60
60
  };
61
61
  }
62
- if (value.xxl && value.xxl.span) {
62
+ if (value.xxl?.span) {
63
63
  defaultVal.xxl = {
64
64
  span: 24 - value.xxl.span
65
65
  };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -16,10 +16,10 @@
16
16
  import classNames from 'classnames';
17
17
  import getWrapperCol from './getWrapperCol.js';
18
18
  import getLabelCol from './getLabelCol.js';
19
- const labelLogic = ({ blockId , content , methods , properties ={} , required =false , validation ={
19
+ const labelLogic = ({ blockId, content, methods, properties = {}, required = false, validation = {
20
20
  messages: [],
21
21
  status: null
22
- } })=>{
22
+ } })=>{
23
23
  const wrapperCol = getWrapperCol(properties, properties.inline);
24
24
  const labelCol = getLabelCol(properties, properties.inline);
25
25
  // render label priority order: content.label area -> properties.title -> blockId and do not render an empty label
@@ -27,19 +27,19 @@ const labelLogic = ({ blockId , content , methods , properties ={} , required =f
27
27
  label = label === '' ? null : label;
28
28
  // trim colon when colon is set, and the user inputs a colon, because antd class renders a colon
29
29
  if (type.isString(label) && properties.colon && label.trim() !== '') {
30
- label = label.replace(/[:|:]\s*$/, '');
30
+ label = label.replace(/[:|:]\s*$/u, '');
31
31
  }
32
32
  const rowClassName = classNames({
33
- [`ant-form-item`]: true,
34
- [`ant-form-item-with-help`]: false,
33
+ 'ant-form-item': true,
34
+ 'ant-form-item-with-help': false,
35
35
  [methods.makeCssClass({
36
36
  flexWrap: properties.inline && 'inherit',
37
37
  marginBottom: 0
38
38
  })]: true
39
39
  });
40
40
  const labelColClassName = classNames({
41
- [`ant-form-item-label`]: true,
42
- [`ant-form-item-label-left`]: properties.align === 'left' || !properties.align,
41
+ 'ant-form-item-label': true,
42
+ 'ant-form-item-label-left': properties.align === 'left' || !properties.align,
43
43
  [methods.makeCssClass({
44
44
  overflow: properties.inline && 'inherit',
45
45
  whiteSpace: !properties.inline && 'normal',
@@ -47,8 +47,8 @@ const labelLogic = ({ blockId , content , methods , properties ={} , required =f
47
47
  })]: true
48
48
  });
49
49
  const labelClassName = classNames({
50
- [`ant-form-item-required`]: required,
51
- [`ant-form-item-no-colon`]: properties.colon === false,
50
+ 'ant-form-item-required': required,
51
+ 'ant-form-item-no-colon': properties.colon === false,
52
52
  [methods.makeCssClass([
53
53
  {
54
54
  height: 'fit-content !important',
@@ -68,10 +68,10 @@ const labelLogic = ({ blockId , content , methods , properties ={} , required =f
68
68
  ])]: true
69
69
  });
70
70
  const feedbackClassName = classNames({
71
- [`ant-form-item-explain-success`]: validation.status === 'success',
72
- [`ant-form-item-explain-warning`]: validation.status === 'warning',
73
- [`ant-form-item-explain-error`]: validation.status === 'error',
74
- [`ant-form-item-explain-validating`]: validation.status === 'validating',
71
+ 'ant-form-item-explain-success': validation.status === 'success',
72
+ 'ant-form-item-explain-warning': validation.status === 'warning',
73
+ 'ant-form-item-explain-error': validation.status === 'error',
74
+ 'ant-form-item-explain-validating': validation.status === 'validating',
75
75
  [methods.makeCssClass([
76
76
  {
77
77
  marginTop: properties.size === 'small' ? -4 : 0
@@ -81,10 +81,10 @@ const labelLogic = ({ blockId , content , methods , properties ={} , required =f
81
81
  });
82
82
  const iconClassName = classNames({
83
83
  'ant-form-item-feedback-icon': true,
84
- [`ant-form-item-feedback-icon-success`]: validation.status === 'success',
85
- [`ant-form-item-feedback-icon-warning`]: validation.status === 'warning',
86
- [`ant-form-item-feedback-icon-error`]: validation.status === 'error',
87
- [`ant-form-item-feedback-icon-validating`]: validation.status === 'validating',
84
+ 'ant-form-item-feedback-icon-success': validation.status === 'success',
85
+ 'ant-form-item-feedback-icon-warning': validation.status === 'warning',
86
+ 'ant-form-item-feedback-icon-error': validation.status === 'error',
87
+ 'ant-form-item-feedback-icon-validating': validation.status === 'validating',
88
88
  'ldf-feedback-icon': true
89
89
  });
90
90
  const showExtra = !!properties.extra && (!validation.status || validation.status === 'success');
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.