dtable-ui-component 6.0.110-hap.1 → 6.0.110-hum.4

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 (203) 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/DTableCustomizeSelect/index.css +30 -59
  21. package/lib/DTableCustomizeSelect/index.js +11 -10
  22. package/lib/DTableCustomizeSelect/select-option-group/KeyCodes.js +109 -0
  23. package/lib/DTableCustomizeSelect/select-option-group/index.css +130 -0
  24. package/lib/DTableCustomizeSelect/select-option-group/index.js +252 -0
  25. package/lib/DTableCustomizeSelect/select-option-group/option.js +48 -0
  26. package/lib/DTableCustomizeSelect/select-option-group/search-input.js +135 -0
  27. package/lib/DTableCustomizeSelect/util.js +12 -0
  28. package/lib/DTableFiltersPopover/index.js +1 -1
  29. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +2 -2
  30. package/lib/DTableFiltersPopover/utils/index.js +1 -1
  31. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +1 -1
  32. package/lib/DTableFiltersPopover/widgets/filter-group.js +2 -2
  33. package/lib/DTableFiltersPopover/widgets/filter-item.js +1 -1
  34. package/lib/DTableFiltersPopover/widgets/filter-list/index.css +3 -3
  35. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +1 -1
  36. package/lib/DTableFiltersPopover/widgets/rate-item.js +5 -5
  37. package/lib/DTableGroupSelect/index.css +3 -16
  38. package/lib/DTableGroupSelect/select-option-group.css +3 -3
  39. package/lib/DTableGroupSelect/select-option-group.js +10 -11
  40. package/lib/DTableIcon/index.js +4 -4
  41. package/lib/DTableIcon/svg-icon.js +4 -4
  42. package/lib/DTableModalHeader/index.js +8 -6
  43. package/lib/DTableRadioGroup/index.js +3 -3
  44. package/lib/DTableSelect/dtable-select-label.js +1 -1
  45. package/lib/DTableSelect/index.js +145 -44
  46. package/lib/DTableSelect/select-dropdown-indicator/index.css +12 -0
  47. package/lib/DTableSelect/select-dropdown-indicator/index.js +20 -0
  48. package/lib/DTableSelect/select-style.js +134 -0
  49. package/lib/DTableSelect/user-select.css +3 -50
  50. package/lib/DateEditor/index.js +10 -13
  51. package/lib/DateEditor/pc-editor.js +1 -1
  52. package/lib/DatePicker/utils.js +4 -4
  53. package/lib/DepartmentMultipleSelectEditor/index.js +3 -3
  54. package/lib/DepartmentSelectFilter/index.js +2 -5
  55. package/lib/DepartmentSingleSelectEditor/index.js +14 -15
  56. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +2 -2
  57. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +6 -6
  58. package/lib/DigitalSignEditor/index.js +14 -15
  59. package/lib/DigitalSignEditor/mb-editor/index.js +4 -4
  60. package/lib/DigitalSignEditor/pc-editor/index.js +6 -7
  61. package/lib/DigitalSignEditor/service.js +1 -1
  62. package/lib/DigitalSignEditor/signature-board/index.js +2 -2
  63. package/lib/DigitalSignFormatter/utils.js +1 -1
  64. package/lib/Drawer/index.js +2 -3
  65. package/lib/FieldDisplaySetting/field-item.js +1 -1
  66. package/lib/FieldDisplaySetting/index.js +9 -11
  67. package/lib/FileEditor/files-previewer/index.js +14 -15
  68. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +2 -2
  69. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +3 -3
  70. package/lib/FileEditor/index.js +14 -15
  71. package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -1
  72. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +6 -6
  73. package/lib/FileEditor/pc-editor/index.js +3 -3
  74. package/lib/FileFormatter/index.js +1 -1
  75. package/lib/FileItemFormatter/index.js +1 -1
  76. package/lib/FileUploader/index.js +1 -1
  77. package/lib/FormulaFormatter/index.js +9 -15
  78. package/lib/GeolocationEditor/index.js +19 -23
  79. package/lib/GeolocationEditor/map-editor-utils.js +6 -10
  80. package/lib/GeolocationEditor/mb-editor/index.js +23 -27
  81. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +6 -9
  82. package/lib/GeolocationEditor/pc-editor/country-editor.js +2 -2
  83. package/lib/GeolocationEditor/pc-editor/index.js +15 -21
  84. package/lib/GeolocationEditor/pc-editor/location-editor.js +2 -2
  85. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +9 -13
  86. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +6 -9
  87. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +7 -24
  88. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +3 -20
  89. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +1 -1
  90. package/lib/GeolocationEditor/pc-editor/province-editor.js +2 -2
  91. package/lib/GeolocationEditor/pc-editor/selector-list.js +1 -1
  92. package/lib/HtmlLongTextFormatter/index.js +1 -1
  93. package/lib/Icon/index.js +17 -13
  94. package/lib/Icon/load-sprite.js +2 -13
  95. package/lib/IconButton/index.js +14 -11
  96. package/lib/ImageEditor/images-previewer/image-preview/index.js +1 -1
  97. package/lib/ImageEditor/index.js +14 -15
  98. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +2 -2
  99. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +5 -5
  100. package/lib/ImageEditor/pc-editor/images-previewer/index.js +1 -1
  101. package/lib/ImageFormatter/index.js +1 -1
  102. package/lib/ImageThumbnail/index.js +2 -2
  103. package/lib/InputItem/custom-input.js +9 -9
  104. package/lib/InputItem/custom-keyboard.js +37 -34
  105. package/lib/InputItem/index.js +49 -52
  106. package/lib/InputItem/input.js +13 -9
  107. package/lib/LinkEditor/pc-popover/index.js +2 -3
  108. package/lib/List/index.js +21 -17
  109. package/lib/List/list-item.js +52 -50
  110. package/lib/MBEditorHeader/index.js +1 -1
  111. package/lib/MobileFullScreenPage/body/index.js +1 -1
  112. package/lib/MobileFullScreenPage/header/index.js +4 -4
  113. package/lib/MobileFullScreenPage/index.js +1 -1
  114. package/lib/MobileModal/index.js +10 -7
  115. package/lib/Modal/alert.js +2 -2
  116. package/lib/Modal/modal.js +31 -28
  117. package/lib/Modal/prompt.js +10 -10
  118. package/lib/MultipleSelectEditor/index.js +8 -6
  119. package/lib/MultipleSelectFormatter/index.js +1 -1
  120. package/lib/PhoneNumberLink/index.js +1 -1
  121. package/lib/Picker/AbstractPicker.js +28 -26
  122. package/lib/Popover/index.js +12 -9
  123. package/lib/Popover/item.js +26 -22
  124. package/lib/Progress/index.js +8 -10
  125. package/lib/Radio/Radio.js +15 -13
  126. package/lib/Radio/RadioItem.js +18 -18
  127. package/lib/RateFormatter/index.js +2 -2
  128. package/lib/RoleStatusEditor/index.js +1 -1
  129. package/lib/RowExpand/index.js +6 -7
  130. package/lib/RowExpandDialog/body/index.js +14 -14
  131. package/lib/RowExpandDialog/column-content/index.js +1 -1
  132. package/lib/RowExpandDialog/header/index.js +3 -4
  133. package/lib/RowExpandDialog/index.js +32 -43
  134. package/lib/RowExpandEditor/add-btn/index.js +6 -7
  135. package/lib/RowExpandEditor/checkbox-editor/index.js +6 -7
  136. package/lib/RowExpandEditor/collaborator-editor/index.js +6 -7
  137. package/lib/RowExpandEditor/date-editor/index.js +6 -7
  138. package/lib/RowExpandEditor/department-editor/index.js +6 -7
  139. package/lib/RowExpandEditor/digital-sign-editor/index.js +6 -7
  140. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +4 -4
  141. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +4 -4
  142. package/lib/RowExpandEditor/duration-editor/index.js +6 -7
  143. package/lib/RowExpandEditor/email-editor/index.js +6 -7
  144. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +1 -1
  145. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +1 -1
  146. package/lib/RowExpandEditor/file-editor/index.js +6 -7
  147. package/lib/RowExpandEditor/geolocation-editor/index.js +6 -7
  148. package/lib/RowExpandEditor/image-editor/index.js +6 -7
  149. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +1 -1
  150. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +1 -1
  151. package/lib/RowExpandEditor/index.js +10 -11
  152. package/lib/RowExpandEditor/long-text-editor/index.js +6 -7
  153. package/lib/RowExpandEditor/multiple-select-editor/index.js +6 -7
  154. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +1 -1
  155. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +5 -5
  156. package/lib/RowExpandEditor/number-editor/index.js +6 -7
  157. package/lib/RowExpandEditor/rate-editor/index.js +6 -7
  158. package/lib/RowExpandEditor/rate-editor/mb-editor.js +1 -1
  159. package/lib/RowExpandEditor/rate-editor/pc-editor.js +5 -5
  160. package/lib/RowExpandEditor/single-select-editor/index.js +6 -7
  161. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +4 -4
  162. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +3 -3
  163. package/lib/RowExpandEditor/text-editor/index.js +6 -7
  164. package/lib/RowExpandEditor/url-editor/index.js +6 -7
  165. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +2 -2
  166. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +2 -2
  167. package/lib/RowExpandFormatter/department-formatter/index.js +3 -6
  168. package/lib/RowExpandFormatter/email-formatter/index.js +1 -1
  169. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +2 -2
  170. package/lib/RowExpandFormatter/formula-formatter/index.js +11 -17
  171. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +2 -2
  172. package/lib/RowExpandFormatter/index.js +7 -11
  173. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +1 -1
  174. package/lib/RowExpandFormatter/link-formatter/index.js +6 -6
  175. package/lib/RowExpandFormatter/rate-formatter/index.js +2 -2
  176. package/lib/RowExpandFormatter/url-formatter/index.js +2 -2
  177. package/lib/RowExpandView/body/index.js +15 -13
  178. package/lib/RowExpandView/index.js +28 -39
  179. package/lib/SelectOptionGroup/index.css +35 -17
  180. package/lib/SelectOptionGroup/index.js +44 -6
  181. package/lib/SelectedDepartments/index.js +3 -3
  182. package/lib/SimpleLongTextFormatter/index.js +2 -2
  183. package/lib/SingleSelectEditor/index.js +8 -6
  184. package/lib/TabBar/Tab.js +10 -10
  185. package/lib/TabBar/index.js +6 -7
  186. package/lib/Tabs/index.js +9 -10
  187. package/lib/TextareaItem/index.js +45 -43
  188. package/lib/Toast/index.js +5 -5
  189. package/lib/assets/icons/close.svg +1 -0
  190. package/lib/formatterConfig/index.js +3 -3
  191. package/lib/select-editor/index.js +14 -15
  192. package/lib/select-editor/pc-editor/index.js +5 -5
  193. package/lib/toaster/alert.js +1 -1
  194. package/lib/toaster/toast.js +1 -1
  195. package/lib/toaster/toastManager.js +14 -12
  196. package/lib/toaster/toaster.js +9 -12
  197. package/lib/utils/class.js +3 -3
  198. package/lib/utils/departments.js +4 -3
  199. package/lib/utils/getLocale.js +5 -11
  200. package/lib/utils/object-utils.js +4 -5
  201. package/lib/utils/url.js +4 -4
  202. package/package.json +2 -2
  203. package/lib/DTableSelect/utils.js +0 -227
@@ -0,0 +1,252 @@
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 _ClickOutside = _interopRequireDefault(require("../../ClickOutside"));
12
+ var _searchInput = _interopRequireDefault(require("./search-input"));
13
+ var _option = _interopRequireDefault(require("./option"));
14
+ var _KeyCodes = _interopRequireDefault(require("./KeyCodes"));
15
+ require("./index.css");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ const OPTION_HEIGHT = 32;
18
+ class SelectOptionGroup extends _react.Component {
19
+ constructor(props) {
20
+ super(props);
21
+ this.resetMenuStyle = () => {
22
+ const {
23
+ isInModal,
24
+ position
25
+ } = this.props;
26
+ const {
27
+ top,
28
+ height
29
+ } = this.optionGroupRef.getBoundingClientRect();
30
+ if (isInModal) {
31
+ if (position.y + position.height + height > window.innerHeight) {
32
+ this.optionGroupRef.style.top = position.y - height + 'px';
33
+ }
34
+ this.optionGroupRef.style.opacity = 1;
35
+ } else {
36
+ if (height + top > window.innerHeight) {
37
+ const borderWidth = 2;
38
+ this.optionGroupRef.style.top = -1 * (height + borderWidth) + 'px';
39
+ }
40
+ }
41
+ };
42
+ this.onHotKey = event => {
43
+ const keyCode = event.keyCode;
44
+ if (keyCode === _KeyCodes.default.UpArrow) {
45
+ this.onPressUp();
46
+ } else if (keyCode === _KeyCodes.default.DownArrow) {
47
+ this.onPressDown();
48
+ } else if (keyCode === _KeyCodes.default.Enter) {
49
+ let option = this.filterOptions && this.filterOptions[this.state.activeIndex];
50
+ if (option) {
51
+ this.props.onSelectOption(option.value);
52
+ if (!this.props.supportMultipleSelect) {
53
+ this.props.closeSelect();
54
+ }
55
+ }
56
+ } else if (keyCode === _KeyCodes.default.Tab || keyCode === _KeyCodes.default.Escape) {
57
+ this.props.closeSelect();
58
+ }
59
+ };
60
+ this.onPressUp = () => {
61
+ if (this.state.activeIndex > 0) {
62
+ this.setState({
63
+ activeIndex: this.state.activeIndex - 1
64
+ }, () => {
65
+ this.scrollContent();
66
+ });
67
+ }
68
+ };
69
+ this.onPressDown = () => {
70
+ if (this.filterOptions && this.state.activeIndex < this.filterOptions.length - 1) {
71
+ this.setState({
72
+ activeIndex: this.state.activeIndex + 1
73
+ }, () => {
74
+ this.scrollContent();
75
+ });
76
+ }
77
+ };
78
+ this.onMouseDown = e => {
79
+ const {
80
+ isInModal
81
+ } = this.props;
82
+ // prevent event propagation when click option or search input
83
+ if (isInModal) {
84
+ e.stopPropagation();
85
+ e.nativeEvent.stopImmediatePropagation();
86
+ }
87
+ };
88
+ this.scrollContent = () => {
89
+ const {
90
+ offsetHeight,
91
+ scrollTop
92
+ } = this.optionGroupContentRef;
93
+ this.setState({
94
+ disableHover: true
95
+ });
96
+ this.timer = setTimeout(() => {
97
+ this.setState({
98
+ disableHover: false
99
+ });
100
+ }, 500);
101
+ if (this.state.activeIndex * OPTION_HEIGHT === 0) {
102
+ this.optionGroupContentRef.scrollTop = 0;
103
+ return;
104
+ }
105
+ if (this.state.activeIndex * OPTION_HEIGHT < scrollTop) {
106
+ this.optionGroupContentRef.scrollTop = scrollTop - OPTION_HEIGHT;
107
+ } else if (this.state.activeIndex * OPTION_HEIGHT > offsetHeight + scrollTop) {
108
+ this.optionGroupContentRef.scrollTop = scrollTop + OPTION_HEIGHT;
109
+ }
110
+ };
111
+ this.changeIndex = index => {
112
+ this.setState({
113
+ activeIndex: index
114
+ });
115
+ };
116
+ this.onChangeSearch = searchVal => {
117
+ let value = searchVal || '';
118
+ if (value !== this.state.searchVal) {
119
+ this.setState({
120
+ searchVal: value,
121
+ activeIndex: -1
122
+ });
123
+ }
124
+ };
125
+ this.clearSearch = () => {
126
+ this.setState({
127
+ searchVal: '',
128
+ activeIndex: -1
129
+ });
130
+ };
131
+ this.renderOptGroup = searchVal => {
132
+ let {
133
+ noOptionsPlaceholder,
134
+ onSelectOption,
135
+ value
136
+ } = this.props;
137
+ this.filterOptions = this.props.getFilterOptions(searchVal);
138
+ if (this.filterOptions.length === 0) {
139
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
140
+ className: "none-search-result",
141
+ children: noOptionsPlaceholder
142
+ });
143
+ }
144
+ return this.filterOptions.map((opt, i) => {
145
+ let key = opt.value.column ? opt.value.column.key : i;
146
+ let isActive = this.state.activeIndex === i;
147
+ const isSelected = value && (opt.value === value.value || JSON.stringify(opt.value) === JSON.stringify(value.value));
148
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_option.default, {
149
+ index: i,
150
+ isActive: isActive,
151
+ value: opt.value,
152
+ onSelectOption: onSelectOption,
153
+ changeIndex: this.changeIndex,
154
+ supportMultipleSelect: this.props.supportMultipleSelect,
155
+ disableHover: this.state.disableHover,
156
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
157
+ children: opt.label
158
+ }), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
159
+ className: "dtable-font dtable-icon-check"
160
+ })]
161
+ }, key);
162
+ });
163
+ };
164
+ this.state = {
165
+ searchVal: '',
166
+ activeIndex: -1,
167
+ disableHover: false
168
+ };
169
+ this.filterOptions = null;
170
+ this.timer = null;
171
+ }
172
+ componentDidMount() {
173
+ window.addEventListener('keydown', this.onHotKey);
174
+ setTimeout(() => {
175
+ this.resetMenuStyle();
176
+ }, 1);
177
+ }
178
+ componentWillUnmount() {
179
+ this.filterOptions = null;
180
+ this.timer && clearTimeout(this.timer);
181
+ window.removeEventListener('keydown', this.onHotKey);
182
+ }
183
+ render() {
184
+ const {
185
+ searchable,
186
+ searchPlaceholder,
187
+ top,
188
+ left,
189
+ minWidth,
190
+ value,
191
+ isShowSelected,
192
+ isInModal,
193
+ position,
194
+ className
195
+ } = this.props;
196
+ let {
197
+ searchVal
198
+ } = this.state;
199
+ let style = {
200
+ top: top || 0,
201
+ left: left || 0
202
+ };
203
+ if (minWidth) {
204
+ style = {
205
+ top: top || 0,
206
+ left: left || 0,
207
+ minWidth
208
+ };
209
+ }
210
+ if (isInModal) {
211
+ style = {
212
+ position: 'fixed',
213
+ left: position.x,
214
+ top: position.y + position.height,
215
+ minWidth: position.width,
216
+ opacity: 0
217
+ };
218
+ }
219
+ style.top = style.top + 4;
220
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutside.default, {
221
+ onClickOutside: this.props.onClickOutside,
222
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
223
+ className: (0, _classnames.default)('seatable-option-group', className ? 'seatable-option-group-' + className : '', {
224
+ 'pt-0': isShowSelected
225
+ }),
226
+ ref: ref => this.optionGroupRef = ref,
227
+ style: style,
228
+ onMouseDown: this.onMouseDown,
229
+ children: [isShowSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
230
+ className: "editor-list-delete mb-2",
231
+ onClick: e => e.stopPropagation(),
232
+ children: value.label || ''
233
+ }), searchable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
234
+ className: "seatable-option-group-search",
235
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_searchInput.default, {
236
+ className: "option-search-control",
237
+ placeholder: searchPlaceholder,
238
+ onChange: this.onChangeSearch,
239
+ clearValue: this.clearSearch,
240
+ autoFocus: true,
241
+ isClearable: true
242
+ })
243
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
244
+ className: "seatable-option-group-content",
245
+ ref: ref => this.optionGroupContentRef = ref,
246
+ children: this.renderOptGroup(searchVal)
247
+ })]
248
+ })
249
+ });
250
+ }
251
+ }
252
+ var _default = exports.default = SelectOptionGroup;
@@ -0,0 +1,48 @@
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 _util = require("../util");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ class Option extends _react.Component {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.onSelectOption = event => {
17
+ if (this.props.supportMultipleSelect) {
18
+ event.stopPropagation();
19
+ }
20
+ this.props.onSelectOption(this.props.value, event);
21
+ };
22
+ this.onMouseEnter = () => {
23
+ if (!this.props.disableHover) {
24
+ this.props.changeIndex(this.props.index);
25
+ }
26
+ };
27
+ this.onMouseLeave = () => {
28
+ if (!this.props.disableHover) {
29
+ this.props.changeIndex(-1);
30
+ }
31
+ };
32
+ }
33
+ render() {
34
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
35
+ className: (0, _classnames.default)('seatable-select-option', {
36
+ 'seatable-select-option-active': this.props.isActive
37
+ }),
38
+ tabIndex: "0",
39
+ role: "menuitem",
40
+ onClick: this.onSelectOption,
41
+ onKeyDown: _util.onKeyDown,
42
+ onMouseEnter: this.onMouseEnter,
43
+ onMouseLeave: this.onMouseLeave,
44
+ children: this.props.children
45
+ });
46
+ }
47
+ }
48
+ var _default = exports.default = Option;
@@ -0,0 +1,135 @@
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
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ class SearchInput extends _react.Component {
14
+ constructor(props) {
15
+ super(props);
16
+ this.onCompositionStart = () => {
17
+ this.isInputtingChinese = true;
18
+ };
19
+ this.onChange = e => {
20
+ this.timer && clearTimeout(this.timer);
21
+ const {
22
+ onChange,
23
+ wait = 100
24
+ } = this.props;
25
+ let text = e.target.value;
26
+ this.setState({
27
+ searchValue: text || ''
28
+ }, () => {
29
+ if (this.isInputtingChinese) return;
30
+ this.timer = setTimeout(() => {
31
+ onChange && onChange(this.state.searchValue.trim());
32
+ }, wait);
33
+ });
34
+ };
35
+ this.onCompositionEnd = e => {
36
+ this.isInputtingChinese = false;
37
+ this.onChange(e);
38
+ };
39
+ this.clearSearch = e => {
40
+ e && e.stopPropagation && e.stopPropagation();
41
+ const {
42
+ clearValue
43
+ } = this.props;
44
+ this.setState({
45
+ searchValue: ''
46
+ }, () => {
47
+ clearValue && clearValue();
48
+ });
49
+ };
50
+ this.setFocus = isSelectAllText => {
51
+ if (this.inputRef === document.activeElement) return;
52
+ this.inputRef.focus();
53
+ if (isSelectAllText) {
54
+ const txtLength = this.state.searchValue.length;
55
+ this.inputRef.setSelectionRange(0, txtLength);
56
+ }
57
+ };
58
+ this.renderClear = () => {
59
+ const {
60
+ isClearable,
61
+ clearClassName
62
+ } = this.props;
63
+ const {
64
+ searchValue
65
+ } = this.state;
66
+ if (!isClearable || !searchValue) return null;
67
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
68
+ className: (0, _classnames.default)('search-text-clear input-icon-addon', clearClassName),
69
+ onClick: this.clearSearch,
70
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
71
+ symbol: "close"
72
+ })
73
+ });
74
+ };
75
+ this.state = {
76
+ searchValue: props.value || ''
77
+ };
78
+ this.isInputtingChinese = false;
79
+ this.timer = null;
80
+ this.inputRef = null;
81
+ }
82
+ componentDidMount() {
83
+ if (this.props.autoFocus && this.inputRef && this.inputRef !== document.activeElement) {
84
+ setTimeout(() => {
85
+ this.inputRef.focus();
86
+ }, 0);
87
+ }
88
+ }
89
+ UNSAFE_componentWillReceiveProps(nextProps) {
90
+ if (nextProps.value !== this.props.value) {
91
+ this.setState({
92
+ searchValue: nextProps.value
93
+ });
94
+ }
95
+ }
96
+ componentWillUnmount() {
97
+ this.timer && clearTimeout(this.timer);
98
+ this.timer = null;
99
+ this.inputRef = null;
100
+ }
101
+ render() {
102
+ const {
103
+ placeholder,
104
+ autoFocus,
105
+ className,
106
+ onKeyDown,
107
+ disabled = false,
108
+ style = {},
109
+ isClearable
110
+ } = this.props;
111
+ const {
112
+ searchValue
113
+ } = this.state;
114
+ const inputWidth = isClearable && searchValue ? 'calc(100% - 40px)' : '100%';
115
+ style.width = inputWidth;
116
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
117
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
118
+ type: "text",
119
+ name: "search-input",
120
+ value: searchValue,
121
+ className: (0, _classnames.default)('form-control', className),
122
+ onChange: this.onChange,
123
+ autoFocus: autoFocus,
124
+ placeholder: placeholder,
125
+ onCompositionStart: this.onCompositionStart,
126
+ onCompositionEnd: this.onCompositionEnd,
127
+ onKeyDown: onKeyDown,
128
+ disabled: disabled,
129
+ style: style,
130
+ ref: ref => this.inputRef = ref
131
+ }), this.renderClear()]
132
+ });
133
+ }
134
+ }
135
+ var _default = exports.default = SearchInput;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.onKeyDown = void 0;
7
+ const onKeyDown = e => {
8
+ if (e.key === 'Enter' || e.key === 'Space') {
9
+ e.target.click();
10
+ }
11
+ };
12
+ exports.onKeyDown = onKeyDown;
@@ -156,7 +156,7 @@ var _jsxRuntime = require("react/jsx-runtime");
156
156
  firstDayOfWeek: firstDayOfWeek,
157
157
  updateFilters: this.updateFilters
158
158
  }), !isSupportAdvanced && !readOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCommonAddTool.default, {
159
- className: `popover-add-tool ${canAddFilter ? '' : 'disabled'}`,
159
+ className: "popover-add-tool ".concat(canAddFilter ? '' : 'disabled'),
160
160
  callBack: canAddFilter ? () => this.addFilter() : () => {},
161
161
  footerName: (0, _lang.getLocale)('Add_filter'),
162
162
  addIconClassName: "popover-add-icon"
@@ -107,7 +107,7 @@ class FilterItemUtils {
107
107
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
108
108
  className: "single-select-check-icon",
109
109
  children: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.id) === option.id && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
110
- className: "option-edit dtable-font dtable-icon-check-mark"
110
+ className: "option-edit dtable-font dtable-icon-check"
111
111
  })
112
112
  })]
113
113
  })
@@ -132,7 +132,7 @@ class FilterItemUtils {
132
132
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
133
133
  className: "multiple-check-icon",
134
134
  children: filterTerm.indexOf(option.id) > -1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
135
- className: "option-edit dtable-font dtable-icon-check-mark"
135
+ className: "option-edit dtable-font dtable-icon-check"
136
136
  })
137
137
  })]
138
138
  })
@@ -407,7 +407,7 @@ const getMediaUrl = () => {
407
407
  };
408
408
  const generateDefaultUser = name => {
409
409
  const mediaUrl = getMediaUrl();
410
- const defaultAvatarUrl = `${mediaUrl}avatars/default.png`;
410
+ const defaultAvatarUrl = "".concat(mediaUrl, "avatars/default.png");
411
411
  return {
412
412
  name,
413
413
  email: name,
@@ -49,7 +49,7 @@ class CollaboratorFilter extends _react.Component {
49
49
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
50
50
  className: "collaborator-check-icon",
51
51
  children: isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
52
- className: "option-edit dtable-font dtable-icon-check-mark"
52
+ className: "option-edit dtable-font dtable-icon-check"
53
53
  })
54
54
  })]
55
55
  })
@@ -146,7 +146,7 @@ class FilterGroup extends _react.Component {
146
146
  updateConjunction: this.modifyConjunctionInGroup,
147
147
  deleteFilter: this.deleteFilterInGroup,
148
148
  updateFilter: this.updateFilterInGroup
149
- }, `filter-in-group-${groupIndex}-${subFilterIndex}`);
149
+ }, "filter-in-group-".concat(groupIndex, "-").concat(subFilterIndex));
150
150
  });
151
151
  };
152
152
  }
@@ -157,7 +157,7 @@ class FilterGroup extends _react.Component {
157
157
  readOnly
158
158
  } = this.props;
159
159
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
160
- className: (0, _classnames.default)('filter-item', 'filter-group', `level-${level}`),
160
+ className: (0, _classnames.default)('filter-item', 'filter-group', "level-".concat(level)),
161
161
  children: [!readOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
162
162
  className: "delete-filter",
163
163
  onClick: this.deleteFilterGroup,
@@ -790,7 +790,7 @@ class FilterItem extends _react.default.Component {
790
790
  isLocked: readOnly
791
791
  })
792
792
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
793
- className: `filter-predicate ml-2 ${_isCheckboxColumn ? 'filter-checkbox-predicate' : ''}`,
793
+ className: "filter-predicate ml-2 ".concat(_isCheckboxColumn ? 'filter-checkbox-predicate' : ''),
794
794
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSelect.default, {
795
795
  value: activePredicate,
796
796
  options: filterPredicateOptions,
@@ -412,20 +412,20 @@
412
412
 
413
413
  .filter-header-icon {
414
414
  display: inline-block;
415
- padding: 0 0.3125rem;
415
+ padding-right: 0.5rem;
416
416
  margin-left: -0.3125rem;
417
417
  }
418
418
 
419
419
  .filter-header-icon .dtable-font,
420
420
  .filter-header-icon .multicolor-icon {
421
421
  font-size: 14px;
422
- color: #aaa;
422
+ color: #999;
423
423
  cursor: default;
424
424
  }
425
425
 
426
426
  .option.option-active .filter-header-icon .dtable-font,
427
427
  .option.option-active .filter-header-icon .multicolor-icon {
428
- color: #fff;
428
+ color: #999;
429
429
  }
430
430
 
431
431
  .dtable-ui-filters-list .single-select-option,
@@ -261,7 +261,7 @@ class FiltersList extends _react.Component {
261
261
  modifyConjunctionInGroup: this.modifyConjunctionInGroup,
262
262
  deleteFilterInGroup: this.deleteFilterInGroup,
263
263
  updateFilterInGroup: this.updateFilterInGroup
264
- }, `filter-group-${index}`);
264
+ }, "filter-group-".concat(index));
265
265
  }
266
266
  const {
267
267
  error_message
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
8
9
  var _react = _interopRequireDefault(require("react"));
9
10
  var _reactstrap = require("reactstrap");
10
11
  var _jsxRuntime = require("react/jsx-runtime");
@@ -56,20 +57,19 @@ class RateItem extends _react.default.Component {
56
57
  };
57
58
  let style = itemStyle;
58
59
  if (enterRateItemIndex >= rateItemIndex) {
59
- style = {
60
- ...itemStyle,
60
+ style = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, itemStyle), {}, {
61
61
  color: rate_style_color,
62
62
  opacity: 0.4
63
- };
63
+ });
64
64
  }
65
65
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
66
66
  onMouseEnter: this.onMouseEnterRateItem,
67
67
  onMouseLeave: this.onMouseLeaveRateItem,
68
68
  style: style,
69
69
  onClick: this.onChangeRateNumber,
70
- className: `rate-item ${value >= rateItemIndex ? 'rate-item-active' : ''}`,
70
+ className: "rate-item ".concat(value >= rateItemIndex ? 'rate-item-active' : ''),
71
71
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
72
- className: `dtable-font ${rateShowType}`,
72
+ className: "dtable-font ".concat(rateShowType),
73
73
  ref: this.tooltipRef
74
74
  }), editable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.UncontrolledTooltip, {
75
75
  placement: "bottom",
@@ -108,7 +108,7 @@
108
108
  border: none;
109
109
  border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
110
110
  border-radius: 4px 4px 0 0;
111
- padding: .375rem .5rem !important;
111
+ padding: .375rem 1rem !important;
112
112
  height: 32px;
113
113
  }
114
114
 
@@ -118,21 +118,8 @@
118
118
  box-shadow: none !important;
119
119
  }
120
120
 
121
- .seatable-group-select .option-group-content .dtable-icon-check {
121
+ .option-group-content .dtable-icon-check {
122
122
  color: #666666;
123
123
  font-size: 14px;
124
- }
125
-
126
- .seatable-group-select .clear-search-text {
127
- position: absolute;
128
- display: inline-block;
129
- height: 12px;
130
- width: 12px;
131
- line-height: 12px;
132
- top: 4px;
133
- right: 22px;
134
- }
135
-
136
- .seatable-group-select .seatable-icon-btn:not(.disabled):hover {
137
- background-color:#FFFFFF;
124
+ margin-left: 16px;
138
125
  }
@@ -16,10 +16,10 @@
16
16
  padding: 0.25rem 8px;
17
17
  }
18
18
 
19
- .group-selector .option .dtable-icon-check-mark {
20
- font-size: 12px;
19
+ .group-selector .option .dtable-icon-check{
20
+ font-size: 14px;
21
21
  color: #666666;
22
- height: 12px !important;
22
+ height: 14px !important;
23
23
  display: flex;
24
24
  align-items: center;
25
25
  justify-content: center;