@luck-design-biz/luckda 1.0.1-12 → 1.0.1-14

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 (95) hide show
  1. package/es/components/LDActions/index.less +3 -1
  2. package/es/components/LdCard/index.js +154 -67
  3. package/es/components/LdTree/index.js +14 -8
  4. package/es/components/LdTree/index.less +2 -0
  5. package/es/helper/ldBuilder.js +1 -1
  6. package/es/locales/zh-CN.js +4 -2
  7. package/es/lowcode/engine/meta/cardlist.props.default.json +27 -7
  8. package/es/lowcode/engine/meta/cardlist.props.json +252 -71
  9. package/es/lowcode/engine/meta/components-list.json +24 -0
  10. package/es/lowcode/engine/meta/iframe.props.default.json +1 -2
  11. package/es/lowcode/engine/meta/iframe.props.json +2 -4
  12. package/es/lowcode/engine/meta/image.props.default.json +3 -3
  13. package/es/lowcode/engine/meta/image.props.json +50 -16
  14. package/es/lowcode/engine/meta/js-editor/auto-complete.json +14 -1
  15. package/es/lowcode/engine/meta/link.props.default.json +1 -2
  16. package/es/lowcode/engine/meta/link.props.json +8 -9
  17. package/es/lowcode/painter/DesignToolbar.js +1 -1
  18. package/es/lowcode/painter/Ribbon.js +12 -0
  19. package/es/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
  20. package/es/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
  21. package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +20 -2
  22. package/es/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
  23. package/es/lowcode/painter/panel-section/GroupClassSelector.js +1 -1
  24. package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
  25. package/es/lowcode/painter/panel-section/TableTopFilter.js +3 -3
  26. package/es/lowcode/painter/style/action-bind-modal.less +5 -3
  27. package/es/lowcode/painter/style/design.less +10 -7
  28. package/es/lowcode/painter/style/list-editor.less +5 -3
  29. package/es/lowcode/painter/style/number-input.less +3 -1
  30. package/es/lowcode/painter/style/outline.less +3 -1
  31. package/es/lowcode/painter/style/panel-attrs.less +7 -3
  32. package/es/lowcode/painter/style/panel.less +9 -7
  33. package/es/lowcode/painter/style/radio.less +1 -1
  34. package/es/lowcode/painter/style/ribbon.less +4 -2
  35. package/es/lowcode/view/lc-components/CardList/index.js +476 -12
  36. package/es/lowcode/view/lc-components/CardList/meta.json +253 -72
  37. package/es/lowcode/view/lc-components/GroupTree/index.js +24 -8
  38. package/es/lowcode/view/lc-components/Iframe/index.js +57 -7
  39. package/es/lowcode/view/lc-components/Iframe/meta.json +2 -4
  40. package/es/lowcode/view/lc-components/Image/index.js +82 -6
  41. package/es/lowcode/view/lc-components/Image/index.less +27 -0
  42. package/es/lowcode/view/lc-components/Image/meta.json +50 -16
  43. package/es/lowcode/view/lc-components/Link/index.js +53 -5
  44. package/es/lowcode/view/lc-components/Link/index.less +15 -0
  45. package/es/lowcode/view/lc-components/Link/meta.json +8 -9
  46. package/es/lowcode/view/lc-components/Table/index.js +3 -5
  47. package/es/lowcode/view/lc-components/Tree/index.js +18 -11
  48. package/lib/components/LDActions/index.less +3 -1
  49. package/lib/components/LdCard/index.js +153 -66
  50. package/lib/components/LdTree/index.js +14 -8
  51. package/lib/components/LdTree/index.less +2 -0
  52. package/lib/helper/ldBuilder.js +2 -2
  53. package/lib/locales/zh-CN.js +4 -2
  54. package/lib/lowcode/engine/meta/cardlist.props.default.json +27 -7
  55. package/lib/lowcode/engine/meta/cardlist.props.json +252 -71
  56. package/lib/lowcode/engine/meta/components-list.json +24 -0
  57. package/lib/lowcode/engine/meta/iframe.props.default.json +1 -2
  58. package/lib/lowcode/engine/meta/iframe.props.json +2 -4
  59. package/lib/lowcode/engine/meta/image.props.default.json +3 -3
  60. package/lib/lowcode/engine/meta/image.props.json +50 -16
  61. package/lib/lowcode/engine/meta/js-editor/auto-complete.json +14 -1
  62. package/lib/lowcode/engine/meta/link.props.default.json +1 -2
  63. package/lib/lowcode/engine/meta/link.props.json +8 -9
  64. package/lib/lowcode/painter/DesignToolbar.js +1 -1
  65. package/lib/lowcode/painter/Ribbon.js +12 -0
  66. package/lib/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
  67. package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
  68. package/lib/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +19 -1
  69. package/lib/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
  70. package/lib/lowcode/painter/panel-section/GroupClassSelector.js +1 -1
  71. package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
  72. package/lib/lowcode/painter/panel-section/TableTopFilter.js +3 -3
  73. package/lib/lowcode/painter/style/action-bind-modal.less +5 -3
  74. package/lib/lowcode/painter/style/design.less +10 -7
  75. package/lib/lowcode/painter/style/list-editor.less +5 -3
  76. package/lib/lowcode/painter/style/number-input.less +3 -1
  77. package/lib/lowcode/painter/style/outline.less +3 -1
  78. package/lib/lowcode/painter/style/panel-attrs.less +7 -3
  79. package/lib/lowcode/painter/style/panel.less +9 -7
  80. package/lib/lowcode/painter/style/radio.less +1 -1
  81. package/lib/lowcode/painter/style/ribbon.less +4 -2
  82. package/lib/lowcode/view/lc-components/CardList/index.js +475 -11
  83. package/lib/lowcode/view/lc-components/CardList/meta.json +253 -72
  84. package/lib/lowcode/view/lc-components/GroupTree/index.js +22 -6
  85. package/lib/lowcode/view/lc-components/Iframe/index.js +55 -5
  86. package/lib/lowcode/view/lc-components/Iframe/meta.json +2 -4
  87. package/lib/lowcode/view/lc-components/Image/index.js +80 -4
  88. package/lib/lowcode/view/lc-components/Image/index.less +27 -0
  89. package/lib/lowcode/view/lc-components/Image/meta.json +50 -16
  90. package/lib/lowcode/view/lc-components/Link/index.js +52 -4
  91. package/lib/lowcode/view/lc-components/Link/index.less +15 -0
  92. package/lib/lowcode/view/lc-components/Link/meta.json +8 -9
  93. package/lib/lowcode/view/lc-components/Table/index.js +3 -5
  94. package/lib/lowcode/view/lc-components/Tree/index.js +17 -10
  95. package/package.json +5 -5
@@ -5,7 +5,6 @@
5
5
  "group": "basic",
6
6
  "groupName": "基础",
7
7
  "desc": "用于显示图像或照片。以便用户可以轻松地创建具有自定义图片样式和布局的界面。",
8
- "hidden": true,
9
8
  "order": 1,
10
9
  "props": [
11
10
  {
@@ -18,7 +17,7 @@
18
17
  "key": "src",
19
18
  "name": "图片地址",
20
19
  "desc": "图片地址",
21
- "type": "_ImageUploder"
20
+ "type": "string"
22
21
  },
23
22
  {
24
23
  "key": "width",
@@ -27,6 +26,13 @@
27
26
  "type": "number",
28
27
  "default": 350
29
28
  },
29
+ {
30
+ "key": "autoWidth",
31
+ "name": "宽度自适应",
32
+ "desc": "是否图片宽度自适应",
33
+ "type": "switch",
34
+ "default": false
35
+ },
30
36
  {
31
37
  "key": "height",
32
38
  "name": "高度",
@@ -35,10 +41,10 @@
35
41
  "default": 200
36
42
  },
37
43
  {
38
- "key": "autoWidth",
39
- "name": "宽度自适应",
40
- "desc": "是否图片宽度自适应",
41
- "type": "boolean",
44
+ "key": "autoHeight",
45
+ "name": "高度自适应",
46
+ "desc": "是否图片高度自适应",
47
+ "type": "switch",
42
48
  "default": false
43
49
  },
44
50
  {
@@ -48,16 +54,16 @@
48
54
  "type": "select",
49
55
  "options": [
50
56
  {
51
- "label": "铺满",
52
- "value": "fill"
57
+ "label": "铺满(Cover)",
58
+ "value": "cover"
53
59
  },
54
60
  {
55
- "label": "适合",
56
- "value": "fit"
61
+ "label": "适合(Contain)",
62
+ "value": "contain"
57
63
  },
58
64
  {
59
- "label": "拉伸",
60
- "value": "Stretch"
65
+ "label": "拉伸(Fill)",
66
+ "value": "fill"
61
67
  }
62
68
  ],
63
69
  "default": "fill"
@@ -66,8 +72,36 @@
66
72
  "key": "roundRadios",
67
73
  "name": "圆角",
68
74
  "desc": "图片四周圆角大小,可设置“0 1px 2px 3px",
69
- "type": "string",
70
- "default": "0"
75
+ "type": "select",
76
+ "options": [
77
+ {
78
+ "label": "大(16px)",
79
+ "value": "16px"
80
+ },
81
+ {
82
+ "label": "中(8px)",
83
+ "value": "8px"
84
+ },
85
+ {
86
+ "label": "小(4px)",
87
+ "value": "4px"
88
+ },
89
+ {
90
+ "label": "无(0px)",
91
+ "value": "0px"
92
+ },
93
+ {
94
+ "label": "自定义",
95
+ "value": ""
96
+ }
97
+ ],
98
+ "default": ""
99
+ },
100
+ {
101
+ "key": "borderRadios",
102
+ "name": "圆角大小",
103
+ "desc": "自定义圆角大小",
104
+ "type": "string"
71
105
  },
72
106
  {
73
107
  "key": "title",
@@ -85,7 +119,7 @@
85
119
  "key": "preview",
86
120
  "name": "开启图片预览",
87
121
  "desc": "是否开启点击打开图片预览",
88
- "type": "boolean",
122
+ "type": "switch",
89
123
  "default": false
90
124
  }
91
125
  ],
@@ -107,7 +141,7 @@
107
141
  {
108
142
  "key": "onClick",
109
143
  "name": "点击事件",
110
- "desc": "点击文本时,执行方法",
144
+ "desc": "点击图片时,执行方法",
111
145
  "func": "(e)=>{\n\t\n}"
112
146
  }
113
147
  ]
@@ -1,14 +1,53 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- var _excluded = ["id"];
3
- import React, { useRef } from 'react';
3
+ var _excluded = ["id", "css", "onClick", "advance"];
4
+ import React, { useEffect, useRef } from 'react';
4
5
  import { useMemoizedFn } from 'ahooks';
5
6
  import { omitBadProps } from "../../../engine/tools/helper";
6
7
  import defaultMeta from "../../../engine/meta/link.props.default.json";
7
8
  import Wrapper from "../Wrapper";
9
+ import styled from 'styled-components';
10
+ import { useContext } from "../../../engine/provider/ContextProvider";
11
+ import { RUNTIME } from "../../../constants";
12
+ var StyledLink = styled.a.withConfig({
13
+ displayName: "StyledLink",
14
+ componentId: "luckda-6530__sc-13gzda1-0"
15
+ })(["display:", ";max-width:", ";white-space:", ";overflow:", ";text-overflow:", ";", ";"], function (props) {
16
+ return props.textOverflow && 'inline-block';
17
+ }, function (props) {
18
+ return props.textOverflow && '100%';
19
+ }, function (props) {
20
+ return props.textOverflow && 'nowrap';
21
+ }, function (props) {
22
+ return props.textOverflow && 'hidden';
23
+ }, function (props) {
24
+ return props.textOverflow && 'ellipsis';
25
+ }, function (props) {
26
+ return props.$css;
27
+ });
8
28
  var LCLink = function LCLink(_ref) {
9
29
  var id = _ref.id,
30
+ css = _ref.css,
31
+ onClick = _ref.onClick,
32
+ advance = _ref.advance,
10
33
  props = _objectWithoutProperties(_ref, _excluded);
11
34
  var ref = useRef();
35
+ var ctx = useContext();
36
+ useEffect(function () {
37
+ ctx.doAction(advance.events.onMount);
38
+ return function () {
39
+ return ctx.doAction(advance.events.onUnmount);
40
+ };
41
+ }, []);
42
+ var handleClick = useMemoizedFn(function (e) {
43
+ if (onClick) {
44
+ onClick(e);
45
+ return;
46
+ }
47
+ ctx.doAction(advance.events.onClick, {
48
+ e: e
49
+ });
50
+ });
12
51
  var getTargetDom = useMemoizedFn(function () {
13
52
  return ref.current;
14
53
  });
@@ -16,9 +55,18 @@ var LCLink = function LCLink(_ref) {
16
55
  id: id,
17
56
  displayName: "Link",
18
57
  getTargetDom: getTargetDom
19
- }, /*#__PURE__*/React.createElement("div", {
20
- ref: ref
21
- }, "LCLink"));
58
+ }, /*#__PURE__*/React.createElement(StyledLink, _extends({
59
+ $css: css
60
+ }, props, {
61
+ ref: ref,
62
+ href: "".concat(props.url, "?").concat(props.params),
63
+ target: props.isBlank ? '_blank' : '_self',
64
+ title: props.textOverflow && props.content,
65
+ onClick: function onClick(e) {
66
+ handleClick(e);
67
+ ctx.runtime === RUNTIME.DESIGN && e.preventDefault();
68
+ }
69
+ }), props.content));
22
70
  };
23
71
  LCLink.defaultProps = omitBadProps(defaultMeta);
24
72
  export default LCLink;
@@ -0,0 +1,15 @@
1
+ .alink {
2
+ display: inline-block;
3
+ max-width: 100%;
4
+ white-space: nowrap;
5
+ overflow: hidden;
6
+ text-overflow: ellipsis;
7
+
8
+ a {
9
+ display: inline-block;
10
+ max-width: 100%;
11
+ white-space: nowrap;
12
+ overflow: hidden;
13
+ text-overflow: ellipsis;
14
+ }
15
+ }
@@ -5,7 +5,6 @@
5
5
  "group": "basic",
6
6
  "groupName": "基础",
7
7
  "desc": "用于创建可点击的链接,以便用户可以跳转到其他页面或访问相关内容。超链组件提供了简单而直观的方式来创建和管理链接。",
8
- "hidden": true,
9
8
  "order": 1,
10
9
  "props": [
11
10
  {
@@ -23,8 +22,8 @@
23
22
  {
24
23
  "key": "textOverflow",
25
24
  "name": "单行截断",
26
- "desc": "文字超过一行,使甲...显示;开后此项后,同时会显示html标签的title",
27
- "type": "boolean",
25
+ "desc": "文字超过一行,使用...显示;开后此项后,同时会显示html标签的title",
26
+ "type": "switch",
28
27
  "default": false
29
28
  },
30
29
  {
@@ -51,16 +50,16 @@
51
50
  "type": "string"
52
51
  },
53
52
  {
54
- "key": "isLayer",
55
- "name": "弹窗打开",
56
- "desc": "是否以弹窗形式打开",
57
- "type": "boolean",
58
- "default": false
53
+ "key": "isBlank",
54
+ "name": "新开页面",
55
+ "desc": "是否新开页面",
56
+ "type": "switch",
57
+ "default": true
59
58
  },
60
59
  {
61
60
  "key": "params",
62
61
  "name": "携带参数",
63
- "desc": "超链的携带参数",
62
+ "desc": "超链的携带参数,key=value形式,多个参数中间用&拼接,例如:pageNo=1&pageSize=20",
64
63
  "type": "string"
65
64
  },
66
65
  {
@@ -448,12 +448,12 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
448
448
  }
449
449
  return resultComp;
450
450
  }, [topActionGroup, impexp]);
451
- var renderFilterArea = useMemoizedFn(function () {
451
+ var renderFilterArea = useCallback(function () {
452
452
  return topFilter ? /*#__PURE__*/React.createElement(TopFilter, {
453
453
  filter: topFilter,
454
454
  instance: instanceRef
455
455
  }) : null;
456
- });
456
+ }, [topFilter]);
457
457
  var _wrapperProps = useCreation(function () {
458
458
  return _defineProperty({
459
459
  id: id
@@ -464,9 +464,7 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
464
464
  var condition = _zebra !== null && _zebra !== void 0 && _zebra.condition ? executeCode(ctx, _zebra.condition, ['params'], params) : _zebra && params.node.rowIndex % 2 === 0;
465
465
  return condition ? {
466
466
  'background-color': _zebra.color || _zebra
467
- } : {
468
- 'background-color': '#fff'
469
- };
467
+ } : {};
470
468
  });
471
469
  var _readFilter = useMemoizedFn(function (params, filters) {
472
470
  ctx.doAction(advance.events.onFilterChanged, {
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["id", "wrapperRef", "className", "dataset", "width", "height", "showLine", "defaultExpandDeep", "actions", "editable", "showRootAdd", "onlyRoot", "rootAddSetting", "doubleClickExpand", "onDoubleClick", "treeNodeCheckable", "treeNodeDisableCheckbox", "treeNodeDisable", "onTreeNodeRender", "treeNodeIcon", "advance", "cancelSelect", "defaultSelect"];
6
- import React, { useRef, useImperativeHandle, useState, useEffect } from 'react';
5
+ var _excluded = ["id", "className", "dataset", "width", "height", "showLine", "defaultExpandDeep", "actions", "editable", "showRootAdd", "onlyRoot", "rootAddSetting", "doubleClickExpand", "onDoubleClick", "treeNodeCheckable", "treeNodeDisableCheckbox", "treeNodeDisable", "onTreeNodeRender", "treeNodeIcon", "advance", "cancelSelect", "defaultSelect"];
6
+ import React, { useRef, useImperativeHandle, useState, forwardRef } from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { useMemoizedFn, useCreation } from 'ahooks';
9
9
  import classNames from 'classnames';
@@ -13,13 +13,14 @@ import { suid } from '@luck-design-biz/base/utils';
13
13
  import { useContext } from "../../../engine/provider/ContextProvider";
14
14
  import Wrapper from "../Wrapper";
15
15
  import { LdTree } from "../../../../index";
16
+ import useCombinedRefs from "../../../engine/tools/useCombinedRefs";
16
17
  import { omitBadProps, executeCode } from "../../../engine/tools/helper";
17
18
  import defaultMeta from "../../../engine/meta/tree.props.default.json";
19
+ import { LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT } from "../../../constants";
18
20
  import styles from "./index.less";
19
21
  var PRIMARY = window.appConfig.constraintKeys.PRIMARY;
20
- var LCTree = function LCTree(_ref) {
22
+ var LCTree = /*#__PURE__*/forwardRef(function (_ref, ref) {
21
23
  var id = _ref.id,
22
- wrapperRef = _ref.wrapperRef,
23
24
  className = _ref.className,
24
25
  dataset = _ref.dataset,
25
26
  width = _ref.width,
@@ -43,20 +44,20 @@ var LCTree = function LCTree(_ref) {
43
44
  defaultSelect = _ref.defaultSelect,
44
45
  props = _objectWithoutProperties(_ref, _excluded);
45
46
  var ctx = useContext();
46
- var ref = useRef();
47
47
  var apiRef = useRef();
48
- var treeRef = useRef();
48
+ var wrapperRef = useRef();
49
+ var instanceRef = useCombinedRefs(ref);
49
50
  var _useState = useState([]),
50
51
  _useState2 = _slicedToArray(_useState, 2),
51
52
  selectedKeys = _useState2[0],
52
53
  setSelectedKeys = _useState2[1];
53
54
  var getTargetDom = useMemoizedFn(function () {
54
- return ref.current;
55
+ return wrapperRef.current;
55
56
  });
56
57
  useImperativeHandle(apiRef, function () {
57
58
  return {
58
59
  getInstance: function getInstance() {
59
- return treeRef.current;
60
+ return instanceRef.current;
60
61
  }
61
62
  };
62
63
  });
@@ -141,6 +142,11 @@ var LCTree = function LCTree(_ref) {
141
142
  doAction();
142
143
  }
143
144
  };
145
+ var _wrapperProps = useCreation(function () {
146
+ return _defineProperty({
147
+ id: id
148
+ }, LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT);
149
+ }, []);
144
150
  return /*#__PURE__*/React.createElement(Wrapper, {
145
151
  id: id,
146
152
  displayName: "Tree",
@@ -151,8 +157,9 @@ var LCTree = function LCTree(_ref) {
151
157
  height: height,
152
158
  id: id,
153
159
  ldId: id,
154
- ref: treeRef,
155
- boxRef: ref,
160
+ ref: instanceRef,
161
+ wrapper: wrapperRef,
162
+ wrapperProps: _wrapperProps,
156
163
  className: classNames(styles['lc-component-tree'], _defineProperty({}, className, !!className)),
157
164
  dataSetKey: dataset === null || dataset === void 0 ? void 0 : dataset.code,
158
165
  showLine: showLine,
@@ -218,7 +225,7 @@ var LCTree = function LCTree(_ref) {
218
225
  onSelect: handleSelect,
219
226
  afterInit: afterInit
220
227
  }, events, props)));
221
- };
228
+ });
222
229
  LCTree.propTypes = {
223
230
  /**
224
231
  * @name 唯一标识
@@ -1,3 +1,5 @@
1
+ @import '~@luck-helper/ui-design/es/style/themes/default.less';
2
+
1
3
  @spanDefault: #262626;
2
4
  @spanPrimary: var(--ant-primary-color);
3
5
  @spanDanger: #ff4d4f;
@@ -16,7 +18,7 @@
16
18
  }
17
19
 
18
20
  button.default {
19
- background-color: white;
21
+ background-color: @component-background;
20
22
  }
21
23
  span.default {
22
24
  color: @spanDefault;