@lowdefy/blocks-antd 4.0.0-alpha.8 → 4.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/blocks/Affix/Affix.js +2 -4
  2. package/dist/blocks/Affix/style.less +1 -1
  3. package/dist/blocks/Alert/Alert.js +19 -27
  4. package/dist/blocks/Alert/style.less +1 -1
  5. package/dist/blocks/AutoComplete/AutoComplete.js +17 -43
  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 +3 -8
  9. package/dist/blocks/Avatar/schema.json +1 -1
  10. package/dist/blocks/Avatar/style.less +1 -1
  11. package/dist/blocks/Badge/Badge.js +2 -4
  12. package/dist/blocks/Badge/schema.json +1 -1
  13. package/dist/blocks/Badge/style.less +1 -1
  14. package/dist/blocks/Breadcrumb/Breadcrumb.js +20 -29
  15. package/dist/blocks/Breadcrumb/schema.json +1 -1
  16. package/dist/blocks/Breadcrumb/style.less +1 -1
  17. package/dist/blocks/Button/Button.js +11 -11
  18. package/dist/blocks/Button/schema.json +1 -1
  19. package/dist/blocks/Button/style.less +1 -1
  20. package/dist/blocks/ButtonSelector/ButtonSelector.js +5 -10
  21. package/dist/blocks/ButtonSelector/style.less +1 -1
  22. package/dist/blocks/Card/Card.js +3 -11
  23. package/dist/blocks/Card/style.less +1 -1
  24. package/dist/blocks/CheckboxSelector/CheckboxSelector.js +5 -10
  25. package/dist/blocks/CheckboxSelector/style.less +1 -1
  26. package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +4 -8
  27. package/dist/blocks/CheckboxSwitch/style.less +1 -1
  28. package/dist/blocks/Collapse/Collapse.js +20 -30
  29. package/dist/blocks/Collapse/schema.json +1 -1
  30. package/dist/blocks/Collapse/style.less +1 -1
  31. package/dist/blocks/Comment/Comment.js +3 -6
  32. package/dist/blocks/Comment/style.less +1 -1
  33. package/dist/blocks/ConfirmModal/ConfirmModal.js +19 -6
  34. package/dist/blocks/ConfirmModal/schema.json +1 -1
  35. package/dist/blocks/ConfirmModal/style.less +1 -1
  36. package/dist/blocks/Content/Content.js +2 -4
  37. package/dist/blocks/Content/style.less +1 -1
  38. package/dist/blocks/ControlledList/ControlledList.js +4 -10
  39. package/dist/blocks/ControlledList/style.less +1 -1
  40. package/dist/blocks/DateRangeSelector/DateRangeSelector.js +10 -17
  41. package/dist/blocks/DateRangeSelector/schema.json +1 -1
  42. package/dist/blocks/DateRangeSelector/style.less +1 -1
  43. package/dist/blocks/DateSelector/DateSelector.js +8 -12
  44. package/dist/blocks/DateSelector/schema.json +1 -1
  45. package/dist/blocks/DateSelector/style.less +1 -1
  46. package/dist/blocks/DateTimeSelector/DateTimeSelector.js +11 -13
  47. package/dist/blocks/DateTimeSelector/schema.json +1 -1
  48. package/dist/blocks/DateTimeSelector/style.less +1 -1
  49. package/dist/blocks/Descriptions/Descriptions.js +7 -15
  50. package/dist/blocks/Descriptions/style.less +1 -1
  51. package/dist/blocks/Divider/Divider.js +2 -9
  52. package/dist/blocks/Divider/style.less +1 -1
  53. package/dist/blocks/Drawer/Drawer.js +5 -8
  54. package/dist/blocks/Drawer/style.less +1 -1
  55. package/dist/blocks/Footer/Footer.js +2 -4
  56. package/dist/blocks/Footer/style.less +1 -1
  57. package/dist/blocks/Header/Header.js +2 -7
  58. package/dist/blocks/Header/schema.json +0 -4
  59. package/dist/blocks/Header/style.less +1 -1
  60. package/dist/blocks/Label/Label.js +30 -37
  61. package/dist/blocks/Label/getLabelCol.js +1 -1
  62. package/dist/blocks/Label/getWrapperCol.js +1 -1
  63. package/dist/blocks/Label/labelLogic.js +11 -11
  64. package/dist/blocks/Label/style.less +5 -1
  65. package/dist/blocks/Layout/Layout.js +2 -9
  66. package/dist/blocks/Layout/style.less +1 -1
  67. package/dist/blocks/Menu/Menu.js +59 -128
  68. package/dist/blocks/Menu/schema.json +1 -15
  69. package/dist/blocks/Menu/style.less +1 -1
  70. package/dist/blocks/Message/Message.js +4 -6
  71. package/dist/blocks/Message/schema.json +1 -1
  72. package/dist/blocks/Message/style.less +1 -1
  73. package/dist/blocks/MobileMenu/MobileMenu.js +6 -10
  74. package/dist/blocks/MobileMenu/schema.json +1 -15
  75. package/dist/blocks/MobileMenu/style.less +1 -1
  76. package/dist/blocks/Modal/Modal.js +20 -24
  77. package/dist/blocks/Modal/style.less +1 -1
  78. package/dist/blocks/MonthSelector/MonthSelector.js +7 -11
  79. package/dist/blocks/MonthSelector/schema.json +1 -1
  80. package/dist/blocks/MonthSelector/style.less +1 -1
  81. package/dist/blocks/MultipleSelector/MultipleSelector.js +8 -14
  82. package/dist/blocks/MultipleSelector/schema.json +3 -3
  83. package/dist/blocks/MultipleSelector/style.less +1 -1
  84. package/dist/blocks/Notification/Notification.js +5 -8
  85. package/dist/blocks/Notification/schema.json +2 -2
  86. package/dist/blocks/Notification/style.less +1 -1
  87. package/dist/blocks/NumberInput/NumberInput.js +6 -8
  88. package/dist/blocks/NumberInput/schema.json +7 -0
  89. package/dist/blocks/NumberInput/style.less +1 -1
  90. package/dist/blocks/PageHCF/PageHCF.js +2 -9
  91. package/dist/blocks/PageHCF/schema.json +0 -29
  92. package/dist/blocks/PageHCF/style.less +1 -1
  93. package/dist/blocks/PageHCSF/PageHCSF.js +2 -9
  94. package/dist/blocks/PageHCSF/schema.json +0 -30
  95. package/dist/blocks/PageHCSF/style.less +1 -1
  96. package/dist/blocks/PageHSCF/PageHSCF.js +2 -9
  97. package/dist/blocks/PageHSCF/schema.json +0 -30
  98. package/dist/blocks/PageHSCF/style.less +1 -1
  99. package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +44 -39
  100. package/dist/blocks/PageHeaderMenu/schema.json +6 -29
  101. package/dist/blocks/PageHeaderMenu/style.less +1 -1
  102. package/dist/blocks/PageSHCF/PageSHCF.js +2 -9
  103. package/dist/blocks/PageSHCF/schema.json +0 -30
  104. package/dist/blocks/PageSHCF/style.less +1 -1
  105. package/dist/blocks/PageSiderMenu/PageSiderMenu.js +42 -48
  106. package/dist/blocks/PageSiderMenu/schema.json +6 -36
  107. package/dist/blocks/PageSiderMenu/style.less +1 -1
  108. package/dist/blocks/Pagination/Pagination.js +6 -13
  109. package/dist/blocks/Pagination/style.less +1 -1
  110. package/dist/blocks/Paragraph/Paragraph.js +2 -6
  111. package/dist/blocks/Paragraph/style.less +2 -1
  112. package/dist/blocks/ParagraphInput/ParagraphInput.js +5 -8
  113. package/dist/blocks/ParagraphInput/style.less +1 -1
  114. package/dist/blocks/PasswordInput/PasswordInput.js +7 -10
  115. package/dist/blocks/PasswordInput/style.less +1 -1
  116. package/dist/blocks/Progress/Progress.js +2 -9
  117. package/dist/blocks/Progress/style.less +1 -1
  118. package/dist/blocks/RadioSelector/RadioSelector.js +8 -13
  119. package/dist/blocks/RadioSelector/style.less +1 -1
  120. package/dist/blocks/RatingSlider/RatingSlider.js +8 -13
  121. package/dist/blocks/RatingSlider/schema.json +2 -2
  122. package/dist/blocks/RatingSlider/style.less +1 -1
  123. package/dist/blocks/Result/Result.js +2 -9
  124. package/dist/blocks/Result/schema.json +1 -1
  125. package/dist/blocks/Result/style.less +1 -1
  126. package/dist/blocks/Selector/Selector.js +8 -14
  127. package/dist/blocks/Selector/schema.json +2 -2
  128. package/dist/blocks/Selector/style.less +1 -1
  129. package/dist/blocks/Sider/Sider.js +7 -11
  130. package/dist/blocks/Sider/schema.json +0 -7
  131. package/dist/blocks/Sider/style.less +1 -1
  132. package/dist/blocks/Statistic/Statistic.js +2 -9
  133. package/dist/blocks/Statistic/schema.json +2 -2
  134. package/dist/blocks/Statistic/style.less +1 -1
  135. package/dist/blocks/Switch/Switch.js +4 -9
  136. package/dist/blocks/Switch/schema.json +2 -2
  137. package/dist/blocks/Switch/style.less +1 -1
  138. package/dist/blocks/Tabs/Tabs.js +21 -32
  139. package/dist/blocks/Tabs/schema.json +1 -1
  140. package/dist/blocks/Tabs/style.less +1 -1
  141. package/dist/blocks/TextArea/TextArea.js +6 -10
  142. package/dist/blocks/TextArea/style.less +1 -1
  143. package/dist/blocks/TextInput/TextInput.js +9 -12
  144. package/dist/blocks/TextInput/schema.json +2 -2
  145. package/dist/blocks/TextInput/style.less +1 -1
  146. package/dist/blocks/TimelineList/TimelineList.js +19 -25
  147. package/dist/blocks/TimelineList/style.less +1 -1
  148. package/dist/blocks/Title/Title.js +3 -9
  149. package/dist/blocks/Title/style.less +2 -1
  150. package/dist/blocks/TitleInput/TitleInput.js +5 -11
  151. package/dist/blocks/TitleInput/style.less +1 -1
  152. package/dist/blocks/Tooltip/Tooltip.js +2 -9
  153. package/dist/blocks/Tooltip/style.less +1 -1
  154. package/dist/blocks/WeekSelector/WeekSelector.js +7 -11
  155. package/dist/blocks/WeekSelector/schema.json +1 -1
  156. package/dist/blocks/WeekSelector/style.less +1 -1
  157. package/dist/blocks.js +1 -1
  158. package/dist/color.js +1 -1
  159. package/dist/disabledDate.js +4 -7
  160. package/dist/getUniqueValues.js +1 -1
  161. package/dist/getValueIndex.js +1 -1
  162. package/dist/style.less +1 -1
  163. package/dist/types.js +1 -1
  164. package/dist/useRunAfterUpdate.js +1 -1
  165. package/dist/validationExamples.js +1 -1
  166. package/package.json +24 -24
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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,12 +31,10 @@ const AffixBlock = ({ blockId , content , methods , properties , rename })=>/*#
31
31
  }
32
32
  });
33
33
  }
34
- }, content.content && content.content())
35
- ;
34
+ }, content.content && content.content());
36
35
  AffixBlock.defaultProps = blockDefaultProps;
37
36
  AffixBlock.meta = {
38
37
  category: 'container',
39
- loading: false,
40
38
  icons: [],
41
39
  styles: [
42
40
  'blocks/Affix/style.less'
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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,19 @@
1
+ function _extends() {
2
+ _extends = Object.assign || function(target) {
3
+ for(var i = 1; i < arguments.length; i++){
4
+ var source = arguments[i];
5
+ for(var key in source){
6
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
7
+ target[key] = source[key];
8
+ }
9
+ }
10
+ }
11
+ return target;
12
+ };
13
+ return _extends.apply(this, arguments);
14
+ }
1
15
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
16
+ Copyright 2020-2022 Lowdefy, Inc
3
17
 
4
18
  Licensed under the Apache License, Version 2.0 (the "License");
5
19
  you may not use this file except in compliance with the License.
@@ -16,20 +30,6 @@
16
30
  import { Alert } from 'antd';
17
31
  import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
18
32
  import { type } from '@lowdefy/helpers';
19
- function _extends() {
20
- _extends = Object.assign || function(target) {
21
- for(var i = 1; i < arguments.length; i++){
22
- var source = arguments[i];
23
- for(var key in source){
24
- if (Object.prototype.hasOwnProperty.call(source, key)) {
25
- target[key] = source[key];
26
- }
27
- }
28
- }
29
- return target;
30
- };
31
- return _extends.apply(this, arguments);
32
- }
33
33
  const AlertBlock = ({ blockId , content , events , components: { Icon } , methods , properties })=>{
34
34
  const additionalProps = {};
35
35
  if (properties.icon) {
@@ -39,12 +39,11 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
39
39
  properties: properties.icon
40
40
  });
41
41
  }
42
- return(/*#__PURE__*/ React.createElement(Alert, _extends({
42
+ return /*#__PURE__*/ React.createElement(Alert, _extends({
43
43
  action: content.action && content.action(),
44
44
  afterClose: ()=>methods.triggerEvent({
45
45
  name: 'afterClose'
46
- })
47
- ,
46
+ }),
48
47
  banner: properties.banner,
49
48
  closable: properties.closable,
50
49
  closeText: properties.closeText,
@@ -63,21 +62,14 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
63
62
  }),
64
63
  onClose: ()=>methods.triggerEvent({
65
64
  name: 'onClose'
66
- })
67
- ,
65
+ }),
68
66
  showIcon: properties.showIcon === false ? false : true,
69
67
  type: properties.type
70
- }, additionalProps)));
68
+ }, additionalProps));
71
69
  };
72
70
  AlertBlock.defaultProps = blockDefaultProps;
73
71
  AlertBlock.meta = {
74
72
  category: 'container',
75
- loading: {
76
- type: 'Skeleton',
77
- properties: {
78
- height: 40
79
- }
80
- },
81
73
  icons: [],
82
74
  styles: [
83
75
  'blocks/Alert/style.less'
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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,14 +14,12 @@
14
14
  limitations under the License.
15
15
  */ import React from 'react';
16
16
  import { AutoComplete } from 'antd';
17
- import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
17
+ import { blockDefaultProps } from '@lowdefy/block-utils';
18
18
  import { type } from '@lowdefy/helpers';
19
19
  import Label from '../Label/Label.js';
20
- import getUniqueValues from '../../getUniqueValues.js';
21
20
  const Option = AutoComplete.Option;
22
21
  const AutoCompleteInput = ({ blockId , components , events , loading , methods , properties , required , validation , value , })=>{
23
- const uniqueValueOptions = getUniqueValues(properties.options || []);
24
- return(/*#__PURE__*/ React.createElement(Label, {
22
+ return /*#__PURE__*/ React.createElement(Label, {
25
23
  blockId: blockId,
26
24
  components: components,
27
25
  events: events,
@@ -32,27 +30,26 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
32
30
  },
33
31
  validation: validation,
34
32
  required: required,
35
- loading: loading,
36
33
  content: {
37
34
  content: ()=>/*#__PURE__*/ React.createElement(AutoComplete, {
38
35
  id: `${blockId}_input`,
39
36
  autoFocus: properties.autoFocus,
40
37
  backfill: properties.backfill,
41
38
  bordered: properties.bordered,
42
- className: methods.makeCssClass(properties.inputStyle),
39
+ className: methods.makeCssClass([
40
+ {
41
+ width: '100%'
42
+ },
43
+ properties.inputStyle
44
+ ]),
43
45
  defaultOpen: properties.defaultOpen,
44
- disabled: properties.disabled,
46
+ disabled: properties.disabled || loading,
45
47
  placeholder: properties.placeholder || 'Type or select item',
46
48
  allowClear: properties.allowClear !== false,
47
49
  size: properties.size,
48
- filterOption: (input, option)=>(option.filterstring || option.children.props.html || '').toLowerCase().indexOf(input.toLowerCase()) >= 0
49
- ,
50
+ filterOption: (input, option)=>`${option.value}`.toLowerCase().indexOf(input.toLowerCase()) >= 0,
50
51
  onChange: (newVal)=>{
51
- let val = type.isPrimitive(uniqueValueOptions[newVal]) ? uniqueValueOptions[newVal] : uniqueValueOptions[newVal].value;
52
- if (type.isNone(val)) {
53
- val = newVal;
54
- }
55
- methods.setValue(val);
52
+ methods.setValue(newVal);
56
53
  methods.triggerEvent({
57
54
  name: 'onChange'
58
55
  });
@@ -65,43 +62,20 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
65
62
  }
66
63
  });
67
64
  },
68
- value: type.isNone(value) ? undefined : value
69
- }, (properties.options || []).map((opt, i)=>type.isPrimitive(opt) ? /*#__PURE__*/ React.createElement(Option, {
65
+ value: type.isNone(value) ? undefined : `${value}`
66
+ }, (properties.options || []).map((opt, i)=>/*#__PURE__*/ React.createElement(Option, {
70
67
  className: methods.makeCssClass(properties.optionsStyle),
71
68
  id: `${blockId}_${i}`,
72
69
  key: i,
73
- value: `${i}`
74
- }, renderHtml({
75
- html: `${opt}`,
76
- methods
77
- })) : /*#__PURE__*/ React.createElement(Option, {
78
- className: methods.makeCssClass([
79
- properties.optionsStyle,
80
- opt.style
81
- ]),
82
- disabled: opt.disabled,
83
- filterstring: opt.filterString,
84
- id: `${blockId}_${i}`,
85
- key: i,
86
- value: `${i}`
87
- }, type.isNone(opt.label) ? renderHtml({
88
- html: `${opt.value}`,
89
- methods
90
- }) : renderHtml({
91
- html: opt.label,
92
- methods
93
- }))
94
- ))
70
+ value: `${opt}`
71
+ }, `${opt}`)))
95
72
  }
96
- }));
73
+ });
97
74
  };
98
75
  AutoCompleteInput.defaultProps = blockDefaultProps;
99
76
  AutoCompleteInput.meta = {
100
77
  valueType: 'string',
101
78
  category: 'input',
102
- loading: {
103
- type: 'SkeletonInput'
104
- },
105
79
  icons: [
106
80
  ...Label.meta.icons
107
81
  ],
@@ -101,52 +101,11 @@
101
101
  },
102
102
  "options": {
103
103
  "default": [],
104
- "oneOf": [
105
- {
106
- "type": "array",
107
- "description": "Options can either be an array of string values, on an array of label, value pairs - supports html.",
108
- "items": {
109
- "type": "string"
110
- }
111
- },
112
- {
113
- "type": "array",
114
- "description": "Options can either be an array of string values, on an array of label, value pairs.",
115
- "items": {
116
- "type": "object",
117
- "required": ["value"],
118
- "properties": {
119
- "label": {
120
- "type": "string",
121
- "description": "Value label shown to user - supports html."
122
- },
123
- "value": {
124
- "description": "Value selected. Can be of any type.",
125
- "type": "string",
126
- "docs": {
127
- "displayType": "yaml"
128
- }
129
- },
130
- "disabled": {
131
- "type": "boolean",
132
- "default": false,
133
- "description": "Disable the option if true."
134
- },
135
- "filterString": {
136
- "type": "string",
137
- "description": "String to match against when filtering selector options during. If no filterString is provided the filter method matches against options.label."
138
- },
139
- "style": {
140
- "type": "object",
141
- "description": "Css style to applied to option.",
142
- "docs": {
143
- "displayType": "yaml"
144
- }
145
- }
146
- }
147
- }
148
- }
149
- ]
104
+ "type": "array",
105
+ "description": "Options can either be an array of string values.",
106
+ "items": {
107
+ "type": "string"
108
+ }
150
109
  },
151
110
  "optionsStyle": {
152
111
  "type": "object",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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 AvatarBlock = ({ blockId , events , components: { Icon } , methods , prop
24
24
  src: properties.src,
25
25
  onClick: ()=>methods.triggerEvent({
26
26
  name: 'onClick'
27
- })
28
- ,
27
+ }),
29
28
  className: methods.makeCssClass([
30
29
  {
31
30
  backgroundColor: !properties.src && properties.color,
@@ -38,14 +37,10 @@ const AvatarBlock = ({ blockId , events , components: { Icon } , methods , prop
38
37
  events: events,
39
38
  properties: properties.icon
40
39
  })
41
- }, properties.content)
42
- ;
40
+ }, properties.content);
43
41
  AvatarBlock.defaultProps = blockDefaultProps;
44
42
  AvatarBlock.meta = {
45
43
  category: 'display',
46
- loading: {
47
- type: 'SkeletonAvatar'
48
- },
49
44
  icons: [],
50
45
  styles: [
51
46
  'blocks/Avatar/style.less'
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "icon": {
27
27
  "type": ["string", "object"],
28
- "description": "Name of an Ant Design Icon or properties of an Icon block to use an icon in avatar.",
28
+ "description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to use an icon in avatar.",
29
29
  "docs": {
30
30
  "displayType": "icon"
31
31
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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.
@@ -32,12 +32,10 @@ const BadgeBlock = ({ blockId , events , content , components: { Icon } , prope
32
32
  events: events,
33
33
  properties: properties.icon
34
34
  }) || properties.count
35
- }, content.content && content.content())
36
- ;
35
+ }, content.content && content.content());
37
36
  BadgeBlock.defaultProps = blockDefaultProps;
38
37
  BadgeBlock.meta = {
39
38
  category: 'container',
40
- loading: false,
41
39
  icons: [],
42
40
  styles: [
43
41
  'blocks/Badge/style.less'
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "icon": {
33
33
  "type": ["string", "object"],
34
- "description": "Name of an Ant Design Icon or properties of an Icon block to use an icon in badge.",
34
+ "description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to use an icon in badge.",
35
35
  "docs": {
36
36
  "displayType": "icon"
37
37
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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,19 @@
1
+ function _extends() {
2
+ _extends = Object.assign || function(target) {
3
+ for(var i = 1; i < arguments.length; i++){
4
+ var source = arguments[i];
5
+ for(var key in source){
6
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
7
+ target[key] = source[key];
8
+ }
9
+ }
10
+ }
11
+ return target;
12
+ };
13
+ return _extends.apply(this, arguments);
14
+ }
1
15
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
16
+ Copyright 2020-2022 Lowdefy, Inc
3
17
 
4
18
  Licensed under the Apache License, Version 2.0 (the "License");
5
19
  you may not use this file except in compliance with the License.
@@ -16,25 +30,11 @@
16
30
  import { type, get } from '@lowdefy/helpers';
17
31
  import { Breadcrumb } from 'antd';
18
32
  import { blockDefaultProps } from '@lowdefy/block-utils';
19
- function _extends() {
20
- _extends = Object.assign || function(target) {
21
- for(var i = 1; i < arguments.length; i++){
22
- var source = arguments[i];
23
- for(var key in source){
24
- if (Object.prototype.hasOwnProperty.call(source, key)) {
25
- target[key] = source[key];
26
- }
27
- }
28
- }
29
- return target;
30
- };
31
- return _extends.apply(this, arguments);
32
- }
33
33
  const BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , methods , properties , rename , })=>{
34
34
  const onClickActionName = get(rename, 'events.onClick', {
35
35
  default: 'onClick'
36
36
  });
37
- return(/*#__PURE__*/ React.createElement(Breadcrumb, {
37
+ return /*#__PURE__*/ React.createElement(Breadcrumb, {
38
38
  id: blockId,
39
39
  separator: properties.separator,
40
40
  className: methods.makeCssClass(properties.style)
@@ -46,8 +46,7 @@ const BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , met
46
46
  link,
47
47
  index
48
48
  }
49
- })
50
- )
49
+ }))
51
50
  }, /*#__PURE__*/ React.createElement(Link, _extends({
52
51
  id: `${blockId}_${index}`,
53
52
  className: methods.makeCssClass([
@@ -56,30 +55,22 @@ const BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , met
56
55
  },
57
56
  link.style,
58
57
  ])
59
- }, link), (defaultTitle)=>/*#__PURE__*/ React.createElement(React.Fragment, null, link.icon && /*#__PURE__*/ React.createElement(Icon, {
58
+ }, link), ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, link.icon && /*#__PURE__*/ React.createElement(Icon, {
60
59
  blockId: `${blockId}_${index}_icon`,
61
60
  events: events,
62
61
  properties: {
63
62
  name: type.isString(link.icon) && link.icon,
64
63
  ...type.isObject(link.icon) ? link.icon : {},
65
64
  style: {
66
- paddingRight: 8,
65
+ marginRight: 8,
67
66
  ...link.icon.style || {}
68
67
  }
69
68
  }
70
- }), type.isString(link) ? link : link.label || defaultTitle)
71
- ))
72
- )));
69
+ }), type.isString(link) ? link : link.label)))));
73
70
  };
74
71
  BreadcrumbBlock.defaultProps = blockDefaultProps;
75
72
  BreadcrumbBlock.meta = {
76
73
  category: 'display',
77
- loading: {
78
- type: 'SkeletonParagraph',
79
- properties: {
80
- lines: 1
81
- }
82
- },
83
74
  icons: [],
84
75
  styles: [
85
76
  'blocks/Breadcrumb/style.less'
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "icon": {
55
55
  "type": ["string", "object"],
56
- "description": "Name of an Ant Design Icon or properties of an Icon block to use an icon in breadcrumb link.",
56
+ "description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to use an icon in breadcrumb link.",
57
57
  "docs": {
58
58
  "displayType": "icon"
59
59
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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,11 +17,11 @@ import { Button } from 'antd';
17
17
  import { get, type } from '@lowdefy/helpers';
18
18
  import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
19
19
  import color from '../../color.js';
20
- const ButtonBlock = ({ blockId , events , loading , components: { Icon } , methods , onClick , properties , rename , })=>{
20
+ const ButtonBlock = ({ blockId , components: { Icon } , events , loading , methods , onClick , properties , rename , })=>{
21
21
  const onClickActionName = get(rename, 'events.onClick', {
22
22
  default: 'onClick'
23
23
  });
24
- return(/*#__PURE__*/ React.createElement(Button, {
24
+ return /*#__PURE__*/ React.createElement(Button, {
25
25
  block: properties.block,
26
26
  className: methods.makeCssClass([
27
27
  {
@@ -34,16 +34,20 @@ const ButtonBlock = ({ blockId , events , loading , components: { Icon } , meth
34
34
  '&:hover': properties.color && {
35
35
  backgroundColor: color(properties.color, 5),
36
36
  borderColor: color(properties.color, 5)
37
+ },
38
+ '&:focus': properties.color && {
39
+ backgroundColor: properties.color,
40
+ borderColor: properties.color
37
41
  }
38
42
  },
39
43
  properties.style,
40
44
  ]),
41
- disabled: properties.disabled || get(events, `${onClickActionName}.loading`),
45
+ disabled: properties.disabled || get(events, `${onClickActionName}.loading`) || loading,
42
46
  ghost: properties.ghost,
43
47
  danger: properties.danger,
44
48
  href: properties.href,
45
49
  id: blockId,
46
- loading: loading || get(events, `${onClickActionName}.loading`),
50
+ loading: get(events, `${onClickActionName}.loading`),
47
51
  shape: properties.shape,
48
52
  size: properties.size,
49
53
  type: get(properties, 'type', {
@@ -56,19 +60,15 @@ const ButtonBlock = ({ blockId , events , loading , components: { Icon } , meth
56
60
  }),
57
61
  onClick: onClick || (()=>methods.triggerEvent({
58
62
  name: onClickActionName
59
- })
60
- )
63
+ }))
61
64
  }, !properties.hideTitle && renderHtml({
62
65
  html: type.isNone(properties.title) ? blockId : properties.title,
63
66
  methods
64
- })));
67
+ }));
65
68
  };
66
69
  ButtonBlock.defaultProps = blockDefaultProps;
67
70
  ButtonBlock.meta = {
68
71
  category: 'display',
69
- loading: {
70
- type: 'SkeletonButton'
71
- },
72
72
  icons: [],
73
73
  styles: [
74
74
  'blocks/Button/style.less'
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "icon": {
44
44
  "type": ["string", "object"],
45
- "description": "Name of an Ant Design Icon or properties of an Icon block to use icon in button.",
45
+ "description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to use icon in button.",
46
46
  "docs": {
47
47
  "displayType": "icon"
48
48
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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,7 +21,7 @@ import getValueIndex from '../../getValueIndex.js';
21
21
  import getUniqueValues from '../../getUniqueValues.js';
22
22
  const ButtonSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods , })=>{
23
23
  const uniqueValueOptions = getUniqueValues(properties.options || []);
24
- return(/*#__PURE__*/ React.createElement(Label, {
24
+ return /*#__PURE__*/ React.createElement(Label, {
25
25
  blockId: blockId,
26
26
  components: components,
27
27
  events: events,
@@ -32,7 +32,6 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
32
32
  },
33
33
  validation: validation,
34
34
  required: required,
35
- loading: loading,
36
35
  content: {
37
36
  content: ()=>/*#__PURE__*/ React.createElement(Radio.Group, {
38
37
  id: `${blockId}_input`,
@@ -45,7 +44,7 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
45
44
  },
46
45
  properties.inputStyle,
47
46
  ]),
48
- disabled: properties.disabled,
47
+ disabled: properties.disabled || loading,
49
48
  size: properties.size,
50
49
  buttonStyle: properties.buttonStyle ? properties.buttonStyle : 'solid',
51
50
  onChange: (event)=>{
@@ -74,18 +73,14 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
74
73
  }) : renderHtml({
75
74
  html: opt.label,
76
75
  methods
77
- }))
78
- ))
76
+ }))))
79
77
  }
80
- }));
78
+ });
81
79
  };
82
80
  ButtonSelector.defaultProps = blockDefaultProps;
83
81
  ButtonSelector.meta = {
84
82
  valueType: 'any',
85
83
  category: 'input',
86
- loading: {
87
- type: 'SkeletonInput'
88
- },
89
84
  icons: [
90
85
  ...Label.meta.icons
91
86
  ],
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 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.