dtable-ui-component 6.0.110-apv.2 → 6.0.110-ast.2

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 (207) hide show
  1. package/lib/ActionSheet/index.js +35 -42
  2. package/lib/ActivityIndicator/index.js +9 -9
  3. package/lib/AsyncUserSelect/index.js +3 -3
  4. package/lib/Badge/index.js +31 -27
  5. package/lib/CheckboxEditor/index.js +14 -15
  6. package/lib/CollaboratorEditor/index.js +15 -16
  7. package/lib/CollaboratorEditor/pc-editor/index.js +1 -1
  8. package/lib/CollapsibleSettingLayout/index.js +1 -1
  9. package/lib/Comment/body/comment.js +1 -1
  10. package/lib/Comment/body/index.js +9 -7
  11. package/lib/Comment/footer/index.js +1 -1
  12. package/lib/Comment/footer/input/index.js +5 -5
  13. package/lib/Comment/footer/input/participant/index.js +1 -1
  14. package/lib/Comment/footer/participants/participant-select/index.js +2 -2
  15. package/lib/Comment/utils/utilities.js +1 -1
  16. package/lib/DTableColorPicker/ColorPickerPortal/index.js +6 -8
  17. package/lib/DTableColorPicker/index.js +12 -13
  18. package/lib/DTableColorPicker/utils.js +1 -1
  19. package/lib/DTableCommonAddTool/index.js +2 -2
  20. package/lib/DTableCustomizeCollaboratorSelect/index.js +20 -2
  21. package/lib/DTableCustomizeSearchInput/index.css +82 -0
  22. package/lib/DTableCustomizeSearchInput/index.js +141 -0
  23. package/lib/DTableCustomizeSelect/index.css +47 -56
  24. package/lib/DTableCustomizeSelect/index.js +18 -12
  25. package/lib/DTableCustomizeSelect/select-option-group/KeyCodes.js +109 -0
  26. package/lib/DTableCustomizeSelect/select-option-group/index.css +122 -0
  27. package/lib/DTableCustomizeSelect/select-option-group/index.js +261 -0
  28. package/lib/DTableCustomizeSelect/select-option-group/option.js +48 -0
  29. package/lib/DTableCustomizeSelect/util.js +12 -0
  30. package/lib/DTableFiltersPopover/index.js +1 -1
  31. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +2 -2
  32. package/lib/DTableFiltersPopover/utils/index.js +1 -1
  33. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +1 -1
  34. package/lib/DTableFiltersPopover/widgets/filter-group.js +2 -2
  35. package/lib/DTableFiltersPopover/widgets/filter-item.js +1 -1
  36. package/lib/DTableFiltersPopover/widgets/filter-list/index.css +3 -3
  37. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +1 -1
  38. package/lib/DTableFiltersPopover/widgets/rate-item.js +5 -5
  39. package/lib/DTableGroupSelect/index.css +3 -21
  40. package/lib/DTableGroupSelect/select-option-group.css +4 -7
  41. package/lib/DTableGroupSelect/select-option-group.js +9 -23
  42. package/lib/DTableIcon/index.js +4 -4
  43. package/lib/DTableIcon/svg-icon.js +4 -4
  44. package/lib/DTableModalHeader/index.js +8 -6
  45. package/lib/DTableRadioGroup/index.js +3 -3
  46. package/lib/DTableSelect/dtable-select-label.js +1 -1
  47. package/lib/DTableSelect/index.js +163 -40
  48. package/lib/DTableSelect/select-dropdown-indicator/index.css +12 -0
  49. package/lib/DTableSelect/select-dropdown-indicator/index.js +22 -0
  50. package/lib/DTableSelect/select-style.js +139 -0
  51. package/lib/DTableSelect/user-select.css +7 -46
  52. package/lib/DTableSelect/utils.js +56 -70
  53. package/lib/DateEditor/index.js +10 -13
  54. package/lib/DateEditor/pc-editor.js +1 -1
  55. package/lib/DatePicker/utils.js +4 -4
  56. package/lib/DepartmentMultipleSelectEditor/index.js +3 -3
  57. package/lib/DepartmentSelectFilter/index.js +2 -5
  58. package/lib/DepartmentSingleSelectEditor/index.js +14 -15
  59. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +2 -2
  60. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +6 -6
  61. package/lib/DigitalSignEditor/index.js +14 -15
  62. package/lib/DigitalSignEditor/mb-editor/index.js +4 -4
  63. package/lib/DigitalSignEditor/pc-editor/index.js +6 -7
  64. package/lib/DigitalSignEditor/service.js +1 -1
  65. package/lib/DigitalSignEditor/signature-board/index.js +2 -2
  66. package/lib/DigitalSignFormatter/utils.js +1 -1
  67. package/lib/Drawer/index.js +2 -3
  68. package/lib/FieldDisplaySetting/field-item.js +1 -1
  69. package/lib/FieldDisplaySetting/index.js +9 -11
  70. package/lib/FileEditor/files-previewer/index.js +14 -15
  71. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +2 -2
  72. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +3 -3
  73. package/lib/FileEditor/index.js +14 -15
  74. package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -1
  75. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +6 -6
  76. package/lib/FileEditor/pc-editor/index.js +3 -3
  77. package/lib/FileFormatter/index.js +1 -1
  78. package/lib/FileItemFormatter/index.js +1 -1
  79. package/lib/FileUploader/index.js +1 -1
  80. package/lib/FormulaFormatter/index.js +9 -15
  81. package/lib/GeolocationEditor/index.js +19 -23
  82. package/lib/GeolocationEditor/map-editor-utils.js +6 -10
  83. package/lib/GeolocationEditor/mb-editor/index.js +23 -27
  84. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +6 -9
  85. package/lib/GeolocationEditor/pc-editor/country-editor.js +2 -2
  86. package/lib/GeolocationEditor/pc-editor/index.js +15 -21
  87. package/lib/GeolocationEditor/pc-editor/location-editor.js +2 -2
  88. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +9 -13
  89. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +6 -9
  90. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +7 -24
  91. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +3 -20
  92. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +1 -1
  93. package/lib/GeolocationEditor/pc-editor/province-editor.js +2 -2
  94. package/lib/GeolocationEditor/pc-editor/selector-list.js +1 -1
  95. package/lib/HtmlLongTextFormatter/index.js +1 -1
  96. package/lib/Icon/index.js +17 -13
  97. package/lib/Icon/load-sprite.js +2 -13
  98. package/lib/IconButton/index.js +14 -11
  99. package/lib/ImageEditor/images-previewer/image-preview/index.js +1 -1
  100. package/lib/ImageEditor/index.js +14 -15
  101. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +2 -2
  102. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +5 -5
  103. package/lib/ImageEditor/pc-editor/images-previewer/index.js +1 -1
  104. package/lib/ImageFormatter/index.js +1 -1
  105. package/lib/ImageThumbnail/index.js +2 -2
  106. package/lib/InputItem/custom-input.js +9 -9
  107. package/lib/InputItem/custom-keyboard.js +37 -34
  108. package/lib/InputItem/index.js +49 -52
  109. package/lib/InputItem/input.js +13 -9
  110. package/lib/LinkEditor/pc-popover/index.js +2 -3
  111. package/lib/List/index.js +21 -17
  112. package/lib/List/list-item.js +52 -50
  113. package/lib/MBEditorHeader/index.js +1 -1
  114. package/lib/MobileFullScreenPage/body/index.js +1 -1
  115. package/lib/MobileFullScreenPage/header/index.js +4 -4
  116. package/lib/MobileFullScreenPage/index.js +1 -1
  117. package/lib/MobileModal/index.js +10 -7
  118. package/lib/Modal/alert.js +2 -2
  119. package/lib/Modal/modal.js +31 -28
  120. package/lib/Modal/prompt.js +10 -10
  121. package/lib/MultipleSelectEditor/index.js +8 -6
  122. package/lib/MultipleSelectFormatter/index.js +1 -1
  123. package/lib/PhoneNumberLink/index.js +1 -1
  124. package/lib/Picker/AbstractPicker.js +28 -26
  125. package/lib/Popover/index.js +12 -9
  126. package/lib/Popover/item.js +26 -22
  127. package/lib/Progress/index.js +8 -10
  128. package/lib/Radio/Radio.js +15 -13
  129. package/lib/Radio/RadioItem.js +18 -18
  130. package/lib/RateFormatter/index.js +2 -2
  131. package/lib/RoleStatusEditor/index.js +1 -1
  132. package/lib/RowExpand/index.js +6 -7
  133. package/lib/RowExpandDialog/body/index.js +14 -14
  134. package/lib/RowExpandDialog/column-content/index.js +1 -1
  135. package/lib/RowExpandDialog/header/index.js +3 -4
  136. package/lib/RowExpandDialog/index.js +32 -43
  137. package/lib/RowExpandEditor/add-btn/index.js +6 -7
  138. package/lib/RowExpandEditor/checkbox-editor/index.js +6 -7
  139. package/lib/RowExpandEditor/collaborator-editor/index.js +6 -7
  140. package/lib/RowExpandEditor/date-editor/index.js +6 -7
  141. package/lib/RowExpandEditor/department-editor/index.js +6 -7
  142. package/lib/RowExpandEditor/digital-sign-editor/index.js +6 -7
  143. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +4 -4
  144. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +4 -4
  145. package/lib/RowExpandEditor/duration-editor/index.js +6 -7
  146. package/lib/RowExpandEditor/email-editor/index.js +6 -7
  147. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +1 -1
  148. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +1 -1
  149. package/lib/RowExpandEditor/file-editor/index.js +6 -7
  150. package/lib/RowExpandEditor/geolocation-editor/index.js +6 -7
  151. package/lib/RowExpandEditor/image-editor/index.js +6 -7
  152. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +1 -1
  153. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +1 -1
  154. package/lib/RowExpandEditor/index.js +10 -11
  155. package/lib/RowExpandEditor/long-text-editor/index.js +6 -7
  156. package/lib/RowExpandEditor/multiple-select-editor/index.js +6 -7
  157. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +1 -1
  158. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +5 -5
  159. package/lib/RowExpandEditor/number-editor/index.js +6 -7
  160. package/lib/RowExpandEditor/rate-editor/index.js +6 -7
  161. package/lib/RowExpandEditor/rate-editor/mb-editor.js +1 -1
  162. package/lib/RowExpandEditor/rate-editor/pc-editor.js +5 -5
  163. package/lib/RowExpandEditor/single-select-editor/index.js +6 -7
  164. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +4 -4
  165. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +3 -3
  166. package/lib/RowExpandEditor/text-editor/index.js +6 -7
  167. package/lib/RowExpandEditor/url-editor/index.js +6 -7
  168. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +2 -2
  169. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +2 -2
  170. package/lib/RowExpandFormatter/department-formatter/index.js +3 -6
  171. package/lib/RowExpandFormatter/email-formatter/index.js +1 -1
  172. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +2 -2
  173. package/lib/RowExpandFormatter/formula-formatter/index.js +11 -17
  174. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +2 -2
  175. package/lib/RowExpandFormatter/index.js +7 -11
  176. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +1 -1
  177. package/lib/RowExpandFormatter/link-formatter/index.js +6 -6
  178. package/lib/RowExpandFormatter/rate-formatter/index.js +2 -2
  179. package/lib/RowExpandFormatter/url-formatter/index.js +2 -2
  180. package/lib/RowExpandView/body/index.js +15 -13
  181. package/lib/RowExpandView/index.js +28 -39
  182. package/lib/SelectOptionGroup/index.css +29 -17
  183. package/lib/SelectOptionGroup/index.js +23 -20
  184. package/lib/SelectedDepartments/index.js +3 -3
  185. package/lib/SimpleLongTextFormatter/index.js +2 -2
  186. package/lib/SingleSelectEditor/index.js +8 -6
  187. package/lib/TabBar/Tab.js +10 -10
  188. package/lib/TabBar/index.js +6 -7
  189. package/lib/Tabs/index.js +9 -10
  190. package/lib/TextareaItem/index.js +45 -43
  191. package/lib/Toast/index.js +5 -5
  192. package/lib/assets/icons/close.svg +1 -0
  193. package/lib/assets/icons/down.svg +3 -0
  194. package/lib/formatterConfig/index.js +3 -3
  195. package/lib/index.js +7 -0
  196. package/lib/select-editor/index.js +14 -15
  197. package/lib/select-editor/pc-editor/index.js +5 -5
  198. package/lib/toaster/alert.js +1 -1
  199. package/lib/toaster/toast.js +1 -1
  200. package/lib/toaster/toastManager.js +14 -12
  201. package/lib/toaster/toaster.js +9 -12
  202. package/lib/utils/class.js +3 -3
  203. package/lib/utils/departments.js +4 -3
  204. package/lib/utils/getLocale.js +5 -11
  205. package/lib/utils/object-utils.js +4 -5
  206. package/lib/utils/url.js +4 -4
  207. package/package.json +2 -2
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
10
  var _react = _interopRequireWildcard(require("react"));
10
11
  var _reactstrap = require("reactstrap");
11
12
  var _reactColor = require("react-color");
@@ -179,10 +180,9 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
179
180
  setSpecColor(value[specColor]);
180
181
  return;
181
182
  }
182
- const newValue = {
183
- ...value,
183
+ const newValue = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, value), {}, {
184
184
  [specColor]: val
185
- };
185
+ });
186
186
  updateValue(newValue);
187
187
  };
188
188
  const updateValue = newValue => {
@@ -195,10 +195,9 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
195
195
  setAlphaVal((0, _utils.toPercentage)(value.a));
196
196
  return;
197
197
  }
198
- const newValue = {
199
- ...value,
198
+ const newValue = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, value), {}, {
200
199
  a: parseFloat(alphaVal) / 100
201
- };
200
+ });
202
201
  updateValue(newValue);
203
202
  };
204
203
  const onKeyDown = (event, callBack) => {
@@ -246,18 +245,18 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
246
245
  children: colors.map((color, index) => {
247
246
  const isLight = (0, _utils.isLightColor)(color);
248
247
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
249
- className: `color-item mr-2 ${isLight ? '' : 'dark'}`,
248
+ className: "color-item mr-2 ".concat(isLight ? '' : 'dark'),
250
249
  onClick: () => onSelectDefaultColor(color),
251
250
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
252
251
  className: "colorinput-color d-flex align-items-center justify-content-center",
253
252
  style: {
254
253
  backgroundColor: color
255
254
  },
256
- children: color === `${(0, _utils.rgbaToHex)(value)}` && alphaVal === 100 && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
255
+ children: color === "".concat((0, _utils.rgbaToHex)(value)) && alphaVal === 100 && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
257
256
  className: "dtable-icon-color-check dtable-font dtable-icon-check-mark"
258
257
  })
259
258
  })
260
- }, `default-color-${index}`);
259
+ }, "default-color-".concat(index));
261
260
  })
262
261
  })]
263
262
  });
@@ -271,7 +270,7 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
271
270
  color: value,
272
271
  onChange: onChangeChromePicker
273
272
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
274
- className: `color-setting d-flex align-items-center ${colorMode}`,
273
+ className: "color-setting d-flex align-items-center ".concat(colorMode),
275
274
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
276
275
  className: "mode-btn d-flex",
277
276
  onClick: onChangeMode,
@@ -345,7 +344,7 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
345
344
  children: currentUsedColors.map((color, index) => {
346
345
  const isLight = (0, _utils.isLightColor)(color);
347
346
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
348
- className: `color-item mr-2 ${isLight ? '' : 'dark'}`,
347
+ className: "color-item mr-2 ".concat(isLight ? '' : 'dark'),
349
348
  onClick: () => onSelectDefaultColor(color),
350
349
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
351
350
  className: "colorinput-color d-flex align-items-center justify-content-center",
@@ -353,7 +352,7 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
353
352
  backgroundColor: color
354
353
  }
355
354
  })
356
- }, `default-color-${index}`);
355
+ }, "default-color-".concat(index));
357
356
  })
358
357
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
359
358
  className: "blank-placeholder d-flex align-items-center justify-content-center",
@@ -54,7 +54,7 @@ const rgbaToHex = function (color) {
54
54
  return hex.length === 1 ? '0' + hex : hex;
55
55
  };
56
56
  const alpha = a !== undefined && a !== 1 ? toHex(Math.round(a * 255)) : '';
57
- return `${isNeedPrefix ? '#' : ''}${toHex(r)}${toHex(g)}${toHex(b)}${isNeedAlpha ? alpha : ''}`;
57
+ return "".concat(isNeedPrefix ? '#' : '').concat(toHex(r)).concat(toHex(g)).concat(toHex(b)).concat(isNeedAlpha ? alpha : '');
58
58
  };
59
59
  exports.rgbaToHex = rgbaToHex;
60
60
  const isLightColor = color => {
@@ -18,11 +18,11 @@ function DTableCommonAddTool(_ref) {
18
18
  style
19
19
  } = _ref;
20
20
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
21
- className: `dtable-ui add-item-btn ${className ? className : ''}`,
21
+ className: "dtable-ui add-item-btn ".concat(className ? className : ''),
22
22
  style: style,
23
23
  onClick: e => callBack(e),
24
24
  children: [!hideIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
25
- className: `dtable-font dtable-icon-add-table ${addIconClassName || ''}`
25
+ className: "dtable-font dtable-icon-add-table ".concat(addIconClassName || '')
26
26
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
27
27
  className: "add-new-option text-truncate",
28
28
  children: footerName
@@ -32,6 +32,22 @@ class CollaboratorSelect extends _react.Component {
32
32
  isShowSelectOptions: !this.state.isShowSelectOptions
33
33
  });
34
34
  };
35
+ this.onClick = event => {
36
+ const target = event.target;
37
+ const name = target.className;
38
+ const {
39
+ isShowSelectOptions
40
+ } = this.state;
41
+ if (!isShowSelectOptions || name === 'select-placeholder' || name.includes('icon-fork-number') || this.selector.contains(target)) {
42
+ return;
43
+ }
44
+ const {
45
+ isUsePopover
46
+ } = this.props;
47
+ if (isUsePopover && !this.collaboratorSelectPopoverRef.contains(target) || !isUsePopover && !this.selector.contains(target)) {
48
+ this.closeSelect();
49
+ }
50
+ };
35
51
  this.onMousedown = event => {
36
52
  const name = event.target.className;
37
53
  if (name === 'select-placeholder' || name.includes('icon-fork-number')) {
@@ -81,7 +97,8 @@ class CollaboratorSelect extends _react.Component {
81
97
  getFilterOptions: this.getFilterOptions,
82
98
  supportMultipleSelect: this.props.supportMultipleSelect,
83
99
  stopClickEvent: true,
84
- isShowSelected: true
100
+ isShowSelected: true,
101
+ onClickOutside: this.onClick
85
102
  });
86
103
  }
87
104
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Popover, {
@@ -106,7 +123,8 @@ class CollaboratorSelect extends _react.Component {
106
123
  getFilterOptions: this.getFilterOptions,
107
124
  supportMultipleSelect: this.props.supportMultipleSelect,
108
125
  stopClickEvent: true,
109
- isShowSelected: true
126
+ isShowSelected: true,
127
+ onClickOutside: this.onClick
110
128
  })
111
129
  });
112
130
  };
@@ -0,0 +1,82 @@
1
+
2
+ .seatable-search-input {
3
+ width: 100%;
4
+ padding: 6px 10px;
5
+ min-width: 170px;
6
+ position: relative;
7
+ padding: 0;
8
+ height: 32px;
9
+ border-bottom: 1px solid var(--bs-border-color);
10
+ }
11
+
12
+ .seatable-search-input .form-control {
13
+ height: 32px;
14
+ border: none;
15
+ padding: .375rem 0 .375rem 1rem;
16
+ cursor: pointer;
17
+ border-bottom: 1px solid var(--bs-border-color);
18
+ }
19
+
20
+ .seatable-search-input-multiple .form-control:focus,
21
+ .seatable-search-input .form-control:focus {
22
+ outline: none;
23
+ box-shadow: none;
24
+ }
25
+
26
+ .seatable-search-input .input-icon-addon {
27
+ z-index: 1;
28
+ pointer-events: auto;
29
+ min-width: 2.75rem !important;
30
+ }
31
+
32
+ .seatable-search-input .input-icon-addon svg {
33
+ color: var(--bs-body-secondary-color);
34
+ cursor: pointer;
35
+ }
36
+
37
+ .seatable-search-input .none-search-result {
38
+ height: 100px;
39
+ width: 100%;
40
+ padding: 10px;
41
+ color: var(--bs-body-secondary-color);
42
+ }
43
+
44
+
45
+ .seatable-search-input-multiple {
46
+ width: 100%;
47
+ padding: 6px 10px;
48
+ min-width: 170px;
49
+ position: relative;
50
+ height: 40px;
51
+ }
52
+
53
+ .seatable-search-input-multiple .form-control {
54
+ height: 30px;
55
+ padding: .375rem 2.5rem .375rem 1rem;
56
+ cursor: pointer;
57
+ }
58
+
59
+ .seatable-search-input-multiple .input-icon-addon {
60
+ z-index: 1;
61
+ pointer-events: auto;
62
+ min-width: 2.75rem !important;
63
+ top: 10px;
64
+ height: 30px;
65
+ right: 10px;
66
+ }
67
+
68
+ .seatable-search-input-multiple .input-icon-addon svg {
69
+ color: var(--bs-body-secondary-color);
70
+ cursor: pointer;
71
+ }
72
+
73
+ .seatable-search-input-multiple .none-search-result {
74
+ height: 100px;
75
+ width: 100%;
76
+ padding: 10px;
77
+ color: var(--bs-body-secondary-color);
78
+ }
79
+
80
+ .multiple-selects-editor-list .seatable-search-input-multiple {
81
+ padding: 10px 10px 0;
82
+ }
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _DTableIcon = _interopRequireDefault(require("../DTableIcon"));
12
+ require("./index.css");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ class DTableCustomizeSearchInput extends _react.Component {
15
+ constructor(props) {
16
+ super(props);
17
+ this.onCompositionStart = () => {
18
+ this.isInputtingChinese = true;
19
+ };
20
+ this.onChange = e => {
21
+ this.timer && clearTimeout(this.timer);
22
+ const {
23
+ onChange,
24
+ wait = 100
25
+ } = this.props;
26
+ let text = e.target.value;
27
+ this.setState({
28
+ searchValue: text || ''
29
+ }, () => {
30
+ if (this.isInputtingChinese) return;
31
+ this.timer = setTimeout(() => {
32
+ onChange && onChange(this.state.searchValue.trim());
33
+ }, wait);
34
+ });
35
+ };
36
+ this.onCompositionEnd = e => {
37
+ this.isInputtingChinese = false;
38
+ this.onChange(e);
39
+ };
40
+ this.clearSearch = e => {
41
+ e && e.stopPropagation && e.stopPropagation();
42
+ const {
43
+ clearValue
44
+ } = this.props;
45
+ this.setState({
46
+ searchValue: ''
47
+ }, () => {
48
+ clearValue && clearValue();
49
+ });
50
+ };
51
+ this.setFocus = isSelectAllText => {
52
+ if (this.inputRef === document.activeElement) return;
53
+ this.inputRef.focus();
54
+ if (isSelectAllText) {
55
+ const txtLength = this.state.searchValue.length;
56
+ this.inputRef.setSelectionRange(0, txtLength);
57
+ }
58
+ };
59
+ this.renderClear = () => {
60
+ const {
61
+ isClearable,
62
+ clearClassName
63
+ } = this.props;
64
+ const {
65
+ searchValue
66
+ } = this.state;
67
+ if (!isClearable || !searchValue) return null;
68
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
69
+ className: (0, _classnames.default)('search-text-clear input-icon-addon', clearClassName),
70
+ style: {
71
+ fontSize: '12px'
72
+ },
73
+ onClick: this.clearSearch,
74
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
75
+ symbol: "close",
76
+ color: "var(--bs-icon-secondary-color)"
77
+ })
78
+ });
79
+ };
80
+ this.state = {
81
+ searchValue: props.value || ''
82
+ };
83
+ this.isInputtingChinese = false;
84
+ this.timer = null;
85
+ this.inputRef = null;
86
+ }
87
+ componentDidMount() {
88
+ if (this.props.autoFocus && this.inputRef && this.inputRef !== document.activeElement) {
89
+ setTimeout(() => {
90
+ this.inputRef.focus();
91
+ }, 0);
92
+ }
93
+ }
94
+ UNSAFE_componentWillReceiveProps(nextProps) {
95
+ if (nextProps.value !== this.props.value) {
96
+ this.setState({
97
+ searchValue: nextProps.value
98
+ });
99
+ }
100
+ }
101
+ componentWillUnmount() {
102
+ this.timer && clearTimeout(this.timer);
103
+ this.timer = null;
104
+ this.inputRef = null;
105
+ }
106
+ render() {
107
+ const {
108
+ placeholder,
109
+ autoFocus,
110
+ className,
111
+ onKeyDown,
112
+ disabled = false,
113
+ style = {},
114
+ isClearable,
115
+ isMultiple = false
116
+ } = this.props;
117
+ const {
118
+ searchValue
119
+ } = this.state;
120
+ const inputWidth = isClearable && searchValue && !isMultiple ? 'calc(100% - 40px)' : '100%';
121
+ style.width = inputWidth;
122
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
123
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
124
+ type: "text",
125
+ name: "search-input",
126
+ value: searchValue,
127
+ className: (0, _classnames.default)('form-control', className),
128
+ onChange: this.onChange,
129
+ autoFocus: autoFocus,
130
+ placeholder: placeholder,
131
+ onCompositionStart: this.onCompositionStart,
132
+ onCompositionEnd: this.onCompositionEnd,
133
+ onKeyDown: onKeyDown,
134
+ disabled: disabled,
135
+ style: style,
136
+ ref: ref => this.inputRef = ref
137
+ }), this.renderClear()]
138
+ });
139
+ }
140
+ }
141
+ var _default = exports.default = DTableCustomizeSearchInput;
@@ -1,117 +1,108 @@
1
- .dtable-select {
1
+ .seatable-customize-select {
2
2
  position: relative;
3
- }
4
-
5
- .dtable-select.custom-select {
6
3
  display: flex;
7
4
  padding: 0 16px;
8
- border-radius: 3px;
5
+ border-radius: 4px;
9
6
  align-items: center;
10
7
  justify-content: space-between;
11
8
  max-width: 900px;
12
9
  user-select: none;
13
- -webkit-user-select: none;
14
- -moz-user-select: none;
15
- -o-user-select: none;
16
- -ms-user-select: none;
17
10
  text-align: left;
11
+ line-height: 1.5;
12
+ background-image: none;
13
+ font-size: 14px;
14
+ color: var(--bs-body-color);
15
+ border: 1px solid rgba(0, 40, 100, 0.12);
18
16
  }
19
17
 
20
- .dtable-select.custom-select:focus,
21
- .dtable-select.custom-select.focus {
22
- border-color: #1991eb !important;
23
- box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25);
18
+ .seatable-customize-select:focus,
19
+ .seatable-customize-select.focus {
20
+ border-color: #3E84F7 !important;
24
21
  }
25
22
 
26
- .dtable-select.custom-select.disabled:focus,
27
- .dtable-select.custom-select.focus.disabled,
28
- .dtable-select.custom-select.disabled:hover {
23
+ .seatable-customize-select.disabled:focus,
24
+ .seatable-customize-select.focus.disabled,
25
+ .seatable-customize-select.disabled:hover {
29
26
  border-color: rgba(0, 40, 100, 0.12) !important;
30
27
  box-shadow: unset;
31
28
  cursor: default;
32
29
  }
33
30
 
34
- .dtable-select.custom-select:hover {
31
+ .seatable-customize-select:hover {
35
32
  cursor: pointer;
36
- border-color: rgb(179, 179, 179);
33
+ border-color: var(--bs-border-color);
37
34
  }
38
35
 
39
- .dtable-select .dtable-icon-down3 {
40
- display: inline-block;
41
- font-size: 12px;
42
- color: #666666;
43
- transition: all 0.1s;
36
+ .seatable-customize-select .seatable-multicolor-icon-down {
37
+ width: 12px;
38
+ height: 12px;
39
+ color: var(--bs-icon-color);
44
40
  }
45
41
 
46
- .dtable-select .selected-option {
42
+ .seatable-customize-select .selected-option {
47
43
  display: flex;
48
44
  flex: 1;
49
45
  overflow: hidden;
50
46
  flex-wrap: nowrap;
51
47
  align-items: center;
52
48
  justify-content: space-between;
53
- background: #fff;
49
+ background: inherit;
54
50
  }
55
51
 
56
- .dtable-select.dtable-ui-collaborator-selector .option-group .option-group-content,
57
- .dtable-select.selector-group .option-group .option-group-content {
52
+ .seatable-check-color {
53
+ color: var(--bs-icon-color);
54
+ }
55
+
56
+ .seatable-customize-select.dtable-ui-collaborator-selector .seatable-option-group .seatable-option-group-content,
57
+ .seatable-customize-select.selector-group .seatable-option-group .seatable-option-group-content {
58
58
  padding: 10px;
59
59
  }
60
60
 
61
- .dtable-select.custom-select.dtable-ui-collaborator-selector .option-group .option-group-content {
61
+ .seatable-customize-select.dtable-ui-collaborator-selector .seatable-option-group .seatable-option-group-content {
62
62
  padding: 10px 0;
63
63
  }
64
64
 
65
- .dtable-select.custom-select.dtable-ui-collaborator-selector .option {
65
+ .seatable-customize-select.dtable-ui-collaborator-selector .option {
66
66
  padding: 5px 0 5px 10px !important;
67
67
  line-height: 20px;
68
68
  }
69
69
 
70
- .dtable-select.selector-group .option {
70
+ .seatable-customize-select.selector-group .option {
71
71
  height: 30px;
72
72
  display: flex;
73
73
  align-items: center;
74
74
  }
75
75
 
76
- .dtable-select.selector-group .select-group-option {
76
+ .seatable-customize-select.selector-group .select-group-option {
77
77
  justify-content: space-between;
78
78
  }
79
79
 
80
- .dtable-select.selector-group .selected-option .selected-group {
80
+ .seatable-customize-select.selector-group .selected-option .selected-group {
81
81
  padding: 0 2px;
82
82
  background: #eceff4;
83
83
  border-radius: 3px;
84
84
  }
85
85
 
86
- .dtable-select .selected-option-show {
87
- overflow: hidden;
88
- text-overflow: ellipsis;
89
- white-space: nowrap;
90
- }
91
-
92
- .dtable-select .select-placeholder {
86
+ .seatable-customize-select .select-placeholder {
93
87
  line-height: 1;
94
88
  font-size: 14px;
95
89
  white-space: nowrap;
90
+ color: #868E96;
91
+ margin-right: 8px;
96
92
  }
97
93
 
98
- .option-group .option-group-selector-multiple-select .option-group-search,
99
- .option-group .option-group-selector-single-select .option-group-search {
100
- padding: 0 0 8px 0 !important;
101
- }
102
-
103
- .option-group-selector-multiple-select .form-control,
104
- .option-group-selector-single-select .form-control {
105
- border: none;
106
- border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
107
- border-radius: 4px 4px 0 0;
108
- padding: .375rem .5rem !important;
109
- height: 32px;
94
+ .seatable-customize-select .selected-option-show {
95
+ height: 20px;
96
+ line-height: 20px;
97
+ margin-right: 8px;
98
+ width: calc(100% - 20px);
99
+ white-space: nowrap;
110
100
  }
111
101
 
112
- .option-group-selector-multiple-select .form-control:focus,
113
- .option-group-selector-single-select .form-control:focus {
114
- border-color: transparent !important;
115
- border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
116
- box-shadow: none !important;
102
+ .seatable-customize-select .multiple-check-icon,
103
+ .seatable-customize-select .header-icon .dtable-font,
104
+ .seatable-option-group .select-label .header-icon .dtable-font {
105
+ color: var(--bs-icon-secondary-color) !important;
106
+ cursor: default;
107
+ font-size: 14px;
117
108
  }
@@ -7,9 +7,11 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
- var _SelectOptionGroup = _interopRequireDefault(require("../SelectOptionGroup"));
11
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _selectOptionGroup = _interopRequireDefault(require("./select-option-group"));
12
12
  var _ModalPortal = _interopRequireDefault(require("../ModalPortal"));
13
+ var _util = require("./util");
14
+ var _DTableIcon = _interopRequireDefault(require("../DTableIcon"));
13
15
  require("./index.css");
14
16
  var _jsxRuntime = require("react/jsx-runtime");
15
17
  class DTableCustomizeSelect extends _react.Component {
@@ -23,8 +25,8 @@ class DTableCustomizeSelect extends _react.Component {
23
25
  */
24
26
  if (this.state.isShowSelectOptions) event.stopPropagation();
25
27
  let eventClassName = event.target.className;
26
- if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'option-group-search') return;
27
- // Prevent closing by pressing the spacebar in the search input
28
+ if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'seatable-option-group-search') return;
29
+ // Prevent closing by pressing the space bar in the search input
28
30
  if (event.target.value === '') return;
29
31
  this.setState({
30
32
  isShowSelectOptions: !this.state.isShowSelectOptions
@@ -83,7 +85,7 @@ class DTableCustomizeSelect extends _react.Component {
83
85
  };
84
86
  }
85
87
  render() {
86
- let {
88
+ const {
87
89
  className,
88
90
  value,
89
91
  options,
@@ -93,17 +95,19 @@ class DTableCustomizeSelect extends _react.Component {
93
95
  noOptionsPlaceholder,
94
96
  isLocked,
95
97
  isInModal,
96
- addOptionAble,
97
98
  component
98
99
  } = this.props;
99
100
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
101
+ tabIndex: "0",
102
+ role: "button",
100
103
  ref: node => this.selector = node,
101
- className: (0, _classnames.default)('dtable-select custom-select', {
104
+ className: (0, _classnames.default)('seatable-customize-select custom-select', {
102
105
  'focus': this.state.isShowSelectOptions
103
106
  }, {
104
107
  'disabled': isLocked
105
108
  }, className),
106
109
  onClick: this.onSelectToggle,
110
+ onKeyDown: _util.onKeyDown,
107
111
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
108
112
  className: "selected-option",
109
113
  children: [value && value.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
@@ -112,12 +116,15 @@ class DTableCustomizeSelect extends _react.Component {
112
116
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
113
117
  className: "select-placeholder",
114
118
  children: placeholder
115
- }), !isLocked && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
116
- className: "dtable-font dtable-icon-down3"
119
+ }), !isLocked && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
120
+ className: "d-inline-flex align-items-center",
121
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
122
+ symbol: "down",
123
+ color: "var(--bs-icon-color)"
124
+ })
117
125
  })]
118
- }), this.state.isShowSelectOptions && !isInModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOptionGroup.default, {
126
+ }), this.state.isShowSelectOptions && !isInModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_selectOptionGroup.default, {
119
127
  value: value,
120
- addOptionAble: addOptionAble,
121
128
  component: component,
122
129
  isShowSelected: this.props.isShowSelected,
123
130
  top: this.getSelectedOptionTop(),
@@ -131,10 +138,9 @@ class DTableCustomizeSelect extends _react.Component {
131
138
  getFilterOptions: this.getFilterOptions,
132
139
  supportMultipleSelect: this.props.supportMultipleSelect
133
140
  }), this.state.isShowSelectOptions && isInModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalPortal.default, {
134
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOptionGroup.default, {
141
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_selectOptionGroup.default, {
135
142
  className: className,
136
143
  value: value,
137
- addOptionAble: addOptionAble,
138
144
  component: component,
139
145
  isShowSelected: this.props.isShowSelected,
140
146
  position: this.selector.getBoundingClientRect(),