@aloudata/aloudata-design 2.14.11 → 2.14.13

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.
@@ -14,8 +14,13 @@ import _ from 'lodash';
14
14
  import React, { useCallback, useContext, useMemo, useState } from 'react';
15
15
  import { SearchLine } from "../Icon";
16
16
  import Input from "../Input";
17
- import { LocaleContext, getTranslator } from "../locale/default";
18
- var DEFAULT_WIDTH = 68;
17
+ import { ELangType, LocaleContext, getTranslator } from "../locale/default";
18
+ var DEFAULT_SMALL_WIDTH = 68;
19
+ var DEFAULT_WIDTH = 78;
20
+ var DEFAULT_EN_SMALL_WIDTH = 88;
21
+ var DEFAULT_EN_WIDTH = 98;
22
+ var DEFAULT_LARGE_WIDTH = 88;
23
+ var DEFAULT_EN_LARGE_WIDTH = 108;
19
24
  export default function InputSearch(props) {
20
25
  var _classnames, _classnames2;
21
26
  var _useContext = useContext(LocaleContext),
@@ -28,11 +33,27 @@ export default function InputSearch(props) {
28
33
  placeholder = props.placeholder,
29
34
  _props$size = props.size,
30
35
  size = _props$size === void 0 ? 'small' : _props$size,
31
- _props$initWidth = props.initWidth,
32
- initWidth = _props$initWidth === void 0 ? DEFAULT_WIDTH : _props$initWidth,
33
36
  defaultValue = props.defaultValue,
34
37
  _props$inputMode = props.inputMode,
35
38
  inputMode = _props$inputMode === void 0 ? false : _props$inputMode;
39
+ var defaultWidth = useMemo(function () {
40
+ if (size === 'small') {
41
+ if (locale === ELangType.EN) {
42
+ return DEFAULT_EN_SMALL_WIDTH;
43
+ }
44
+ return DEFAULT_SMALL_WIDTH;
45
+ } else if (size === 'middle') {
46
+ if (locale === ELangType.EN) {
47
+ return DEFAULT_EN_WIDTH;
48
+ }
49
+ return DEFAULT_WIDTH;
50
+ } else {
51
+ if (locale === ELangType.EN) {
52
+ return DEFAULT_EN_LARGE_WIDTH;
53
+ }
54
+ return DEFAULT_LARGE_WIDTH;
55
+ }
56
+ }, [locale, size]);
36
57
  var _useState = useState(defaultValue || ''),
37
58
  _useState2 = _slicedToArray(_useState, 2),
38
59
  searchValue = _useState2[0],
@@ -63,7 +84,7 @@ export default function InputSearch(props) {
63
84
  return /*#__PURE__*/React.createElement("div", {
64
85
  className: classnames('ald-input-search', (_classnames = {}, _defineProperty(_classnames, 'input-search-size-small', size === 'small'), _defineProperty(_classnames, 'input-search-size-middle', size === 'middle'), _defineProperty(_classnames, 'input-search-size-large', size === 'large'), _classnames)),
65
86
  style: {
66
- '--init-width': initWidth + 'px'
87
+ '--init-width': (props.initWidth || defaultWidth) + 'px'
67
88
  }
68
89
  }, /*#__PURE__*/React.createElement(Input, {
69
90
  className: classnames(className, (_classnames2 = {}, _defineProperty(_classnames2, 'input-search-has-value', searchValue.length !== 0 || inputMode), _defineProperty(_classnames2, 'inputMode', inputMode), _classnames2)),
@@ -17,7 +17,7 @@
17
17
 
18
18
  &.input-search-size-small {
19
19
  ::placeholder {
20
- font-size: 12px;
20
+ font-size: 14px;
21
21
  line-height: 16px; /* 133.333% */
22
22
  }
23
23
  }
@@ -55,7 +55,7 @@
55
55
  ::placeholder {
56
56
  color: var(--alias-colors-text-subtlest, #9ca3af);
57
57
  background-color: var(--alias-colors-bg-skeleton-subtler, #fff);
58
- font-size: 12px;
58
+ font-size: 14px;
59
59
  font-style: normal;
60
60
  font-weight: 400;
61
61
  line-height: 16px; /* 133.333% */
@@ -16,7 +16,7 @@ import TrashLightLine from "../../../Icon/components/TrashLightLine";
16
16
  import IconButton from "../../../IconButton";
17
17
  import AldSelect from "../../../AldSelect";
18
18
  import TextLink from "../../../TextLink";
19
- import { LocaleContext, getTranslator } from "../../../locale/default";
19
+ import { ELangType, LocaleContext, getTranslator } from "../../../locale/default";
20
20
  import { ELogicType, ENodeType } from "../../type";
21
21
  var dargPreviewImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAYSURBVHgB7cAxAQAAAMKg9U9tCU8oAPgYBlQAAX19SpgAAAAASUVORK5CYII=';
22
22
  var TWO = 2;
@@ -213,6 +213,7 @@ export default function LogicItem(_ref) {
213
213
  var id = value.id;
214
214
  changeRecordData(id, data);
215
215
  };
216
+ var isEn = locale === ELangType.EN;
216
217
  if (type === ENodeType.LOGIC) {
217
218
  var nodes = value.nodes,
218
219
  _logicType = value.logicType;
@@ -301,7 +302,9 @@ export default function LogicItem(_ref) {
301
302
  className: "ald-logic-tree-node-drag-icon"
302
303
  })), /*#__PURE__*/React.createElement(AldSelect, {
303
304
  options: logicOptions,
304
- className: "ald-logic-tree-select-relation",
305
+ className: classNames('ald-logic-tree-select-relation', {
306
+ 'ald-logic-tree-select-relation-en': isEn
307
+ }),
305
308
  size: "small",
306
309
  popupMatchSelectWidth: false,
307
310
  value: _logicType,
@@ -1,6 +1,7 @@
1
1
  @recordLineWidth: 48px;
2
2
  @selectWidth: 48px;
3
3
  @dragIConWidth: 16px;
4
+ @enSelectWidth: 60px;
4
5
 
5
6
  .ald-logic-tree-wrap > .ald-logic-tree-logic-node {
6
7
  &.is-hover {
@@ -106,10 +107,11 @@
106
107
  right: 0 !important;
107
108
  }
108
109
  }
110
+ }
109
111
 
110
- .ant-select-arrow {
111
- right: 6px !important;
112
- }
112
+ .ald-logic-tree-select-relation-en {
113
+ left: 10px;
114
+ width: @enSelectWidth !important;
113
115
  }
114
116
  }
115
117