@oceanbase/ui 1.0.0-alpha.4 → 1.0.0-alpha.6

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 (219) hide show
  1. package/dist/ui.min.css +1 -1
  2. package/dist/ui.min.js +1 -1
  3. package/es/Action/Item.d.ts +6 -15
  4. package/es/Action/Item.js +85 -128
  5. package/es/Action/index.d.ts +6 -3
  6. package/es/BasicLayout/style/index.js +30 -18
  7. package/es/BatchOperationBar/index.d.ts +0 -1
  8. package/es/BatchOperationBar/index.js +17 -13
  9. package/es/BatchOperationBar/style/index.d.ts +10 -0
  10. package/es/BatchOperationBar/style/index.js +51 -0
  11. package/es/Boundary/Components/Code.js +11 -5
  12. package/es/Boundary/Components/Exception.js +85 -74
  13. package/es/Boundary/Components/Function.js +11 -5
  14. package/es/Boundary/index.d.ts +0 -1
  15. package/es/Boundary/index.js +0 -1
  16. package/es/Boundary/style/index.d.ts +10 -0
  17. package/es/Boundary/style/index.js +46 -0
  18. package/es/ContentWithIcon/index.d.ts +0 -1
  19. package/es/ContentWithIcon/index.js +29 -29
  20. package/es/ContentWithIcon/style/index.d.ts +10 -0
  21. package/es/ContentWithIcon/style/index.js +26 -0
  22. package/es/DateRanger/PickerPanel.js +5 -4
  23. package/es/DateRanger/Ranger.d.ts +0 -1
  24. package/es/DateRanger/Ranger.js +13 -8
  25. package/es/DateRanger/style/index.d.ts +10 -0
  26. package/es/DateRanger/style/index.js +126 -0
  27. package/es/Dialog/Anchor.d.ts +2 -10
  28. package/es/Dialog/Anchor.js +67 -96
  29. package/es/Dialog/index.d.ts +0 -1
  30. package/es/Dialog/index.js +537 -578
  31. package/es/Dialog/style/index.d.ts +10 -0
  32. package/es/Dialog/style/index.js +97 -0
  33. package/es/FullscreenBox/index.d.ts +0 -1
  34. package/es/FullscreenBox/index.js +46 -37
  35. package/es/FullscreenBox/style/index.d.ts +10 -0
  36. package/es/FullscreenBox/style/index.js +53 -0
  37. package/es/GraphToolbar/index.d.ts +0 -1
  38. package/es/GraphToolbar/index.js +19 -16
  39. package/es/GraphToolbar/style/index.d.ts +10 -0
  40. package/es/GraphToolbar/style/index.js +60 -0
  41. package/es/Highlight/DiffView/index.d.ts +0 -1
  42. package/es/Highlight/DiffView/index.js +5 -5
  43. package/es/Highlight/JsonView.d.ts +0 -1
  44. package/es/Highlight/JsonView.js +5 -5
  45. package/es/Highlight/index.d.ts +0 -1
  46. package/es/Highlight/index.js +23 -23
  47. package/es/Highlight/style/index.d.ts +10 -0
  48. package/es/Highlight/style/index.js +213 -0
  49. package/es/Login/ActivateForm.d.ts +0 -1
  50. package/es/Login/ActivateForm.js +12 -9
  51. package/es/Login/LoginForm.d.ts +0 -1
  52. package/es/Login/LoginForm.js +20 -15
  53. package/es/Login/RegisterForm.d.ts +0 -1
  54. package/es/Login/RegisterForm.js +14 -11
  55. package/es/Login/index.d.ts +0 -1
  56. package/es/Login/index.js +24 -22
  57. package/es/Login/style/index.d.ts +10 -0
  58. package/es/Login/style/index.js +182 -0
  59. package/es/NavMenu/index.d.ts +1 -2
  60. package/es/NavMenu/index.js +11 -8
  61. package/es/NavMenu/style/index.d.ts +10 -0
  62. package/es/NavMenu/style/index.js +47 -0
  63. package/es/Ranger/QuickPicker.js +8 -4
  64. package/es/Ranger/Ranger.d.ts +0 -1
  65. package/es/Ranger/Ranger.js +12 -9
  66. package/es/Ranger/style/index.d.ts +10 -0
  67. package/es/Ranger/style/index.js +44 -0
  68. package/es/SideTip/index.d.ts +0 -1
  69. package/es/SideTip/index.js +24 -22
  70. package/es/SideTip/style/index.d.ts +10 -0
  71. package/es/SideTip/style/index.js +162 -0
  72. package/es/TagSelect/Group.d.ts +6 -6
  73. package/es/TagSelect/Group.js +5 -3
  74. package/es/TagSelect/Item.js +5 -3
  75. package/es/TaskGraph/Graph/style/index.d.ts +10 -0
  76. package/es/TaskGraph/Graph/style/index.js +28 -0
  77. package/es/TaskGraph/Graph.d.ts +0 -1
  78. package/es/TaskGraph/Graph.js +26 -10
  79. package/es/TaskGraph/index.d.ts +0 -1
  80. package/es/TaskGraph/index.js +10 -7
  81. package/es/TaskGraph/style/index.d.ts +10 -0
  82. package/es/TaskGraph/style/index.js +102 -0
  83. package/es/Welcome/index.d.ts +0 -1
  84. package/es/Welcome/index.js +30 -26
  85. package/es/Welcome/step/style/index.d.ts +10 -0
  86. package/es/Welcome/step/style/index.js +44 -0
  87. package/es/Welcome/step.d.ts +0 -1
  88. package/es/Welcome/step.js +17 -14
  89. package/es/Welcome/style/index.d.ts +10 -0
  90. package/es/Welcome/style/index.js +141 -0
  91. package/es/index.d.ts +0 -1
  92. package/es/index.js +0 -1
  93. package/lib/Action/Item.d.ts +6 -15
  94. package/lib/Action/Item.js +66 -81
  95. package/lib/Action/index.d.ts +6 -3
  96. package/lib/BasicLayout/style/index.js +27 -18
  97. package/lib/BatchOperationBar/index.d.ts +0 -1
  98. package/lib/BatchOperationBar/index.js +54 -50
  99. package/lib/BatchOperationBar/style/index.d.ts +10 -0
  100. package/lib/BatchOperationBar/style/index.js +82 -0
  101. package/lib/Boundary/Components/Code.js +23 -17
  102. package/lib/Boundary/Components/Exception.js +40 -29
  103. package/lib/Boundary/Components/Function.js +18 -12
  104. package/lib/Boundary/index.d.ts +0 -1
  105. package/lib/Boundary/index.js +0 -1
  106. package/lib/Boundary/style/index.d.ts +10 -0
  107. package/lib/Boundary/style/index.js +74 -0
  108. package/lib/ContentWithIcon/index.d.ts +0 -1
  109. package/lib/ContentWithIcon/index.js +35 -32
  110. package/lib/ContentWithIcon/style/index.d.ts +10 -0
  111. package/lib/ContentWithIcon/style/index.js +57 -0
  112. package/lib/DateRanger/PickerPanel.js +2 -2
  113. package/lib/DateRanger/Ranger.d.ts +0 -1
  114. package/lib/DateRanger/Ranger.js +353 -348
  115. package/lib/DateRanger/style/index.d.ts +10 -0
  116. package/lib/DateRanger/style/index.js +195 -0
  117. package/lib/Dialog/Anchor.d.ts +2 -10
  118. package/lib/Dialog/Anchor.js +58 -60
  119. package/lib/Dialog/index.d.ts +0 -1
  120. package/lib/Dialog/index.js +446 -422
  121. package/lib/Dialog/style/index.d.ts +10 -0
  122. package/lib/Dialog/style/index.js +135 -0
  123. package/lib/FullscreenBox/index.d.ts +0 -1
  124. package/lib/FullscreenBox/index.js +47 -38
  125. package/lib/FullscreenBox/style/index.d.ts +10 -0
  126. package/lib/FullscreenBox/style/index.js +86 -0
  127. package/lib/GraphToolbar/index.d.ts +0 -1
  128. package/lib/GraphToolbar/index.js +69 -66
  129. package/lib/GraphToolbar/style/index.d.ts +10 -0
  130. package/lib/GraphToolbar/style/index.js +91 -0
  131. package/lib/Highlight/DiffView/index.d.ts +0 -1
  132. package/lib/Highlight/DiffView/index.js +3 -3
  133. package/lib/Highlight/JsonView.d.ts +0 -1
  134. package/lib/Highlight/JsonView.js +3 -3
  135. package/lib/Highlight/index.d.ts +0 -1
  136. package/lib/Highlight/index.js +32 -29
  137. package/lib/Highlight/style/index.d.ts +10 -0
  138. package/lib/Highlight/style/index.js +293 -0
  139. package/lib/Login/ActivateForm.d.ts +0 -1
  140. package/lib/Login/ActivateForm.js +17 -9
  141. package/lib/Login/LoginForm.d.ts +0 -1
  142. package/lib/Login/LoginForm.js +25 -13
  143. package/lib/Login/RegisterForm.d.ts +0 -1
  144. package/lib/Login/RegisterForm.js +17 -9
  145. package/lib/Login/index.d.ts +0 -1
  146. package/lib/Login/index.js +96 -94
  147. package/lib/Login/style/index.d.ts +10 -0
  148. package/lib/Login/style/index.js +267 -0
  149. package/lib/NavMenu/index.d.ts +1 -2
  150. package/lib/NavMenu/index.js +20 -17
  151. package/lib/NavMenu/style/index.d.ts +10 -0
  152. package/lib/NavMenu/style/index.js +78 -0
  153. package/lib/Ranger/QuickPicker.js +4 -2
  154. package/lib/Ranger/Ranger.d.ts +0 -1
  155. package/lib/Ranger/Ranger.js +48 -45
  156. package/lib/Ranger/style/index.d.ts +10 -0
  157. package/lib/Ranger/style/index.js +82 -0
  158. package/lib/SideTip/index.d.ts +0 -1
  159. package/lib/SideTip/index.js +46 -38
  160. package/lib/SideTip/style/index.d.ts +10 -0
  161. package/lib/SideTip/style/index.js +211 -0
  162. package/lib/TagSelect/Group.d.ts +6 -6
  163. package/lib/TagSelect/Group.js +3 -2
  164. package/lib/TagSelect/Item.js +3 -2
  165. package/lib/TaskGraph/Graph/style/index.d.ts +10 -0
  166. package/lib/TaskGraph/Graph/style/index.js +56 -0
  167. package/lib/TaskGraph/Graph.d.ts +0 -1
  168. package/lib/TaskGraph/Graph.js +16 -7
  169. package/lib/TaskGraph/index.d.ts +0 -1
  170. package/lib/TaskGraph/index.js +6 -5
  171. package/lib/TaskGraph/style/index.d.ts +10 -0
  172. package/lib/TaskGraph/style/index.js +143 -0
  173. package/lib/Welcome/index.d.ts +0 -1
  174. package/lib/Welcome/index.js +64 -59
  175. package/lib/Welcome/step/style/index.d.ts +10 -0
  176. package/lib/Welcome/step/style/index.js +74 -0
  177. package/lib/Welcome/step.d.ts +0 -1
  178. package/lib/Welcome/step.js +17 -13
  179. package/lib/Welcome/style/index.d.ts +10 -0
  180. package/lib/Welcome/style/index.js +188 -0
  181. package/lib/index.d.ts +0 -1
  182. package/lib/index.js +0 -1
  183. package/package.json +4 -7
  184. package/es/BatchOperationBar/index.less +0 -46
  185. package/es/BatchOperationBar/index.less.d.ts +0 -15
  186. package/es/Boundary/index.less +0 -36
  187. package/es/ContentWithIcon/index.less +0 -21
  188. package/es/DateRanger/index.less +0 -180
  189. package/es/Dialog/index.less +0 -116
  190. package/es/FullscreenBox/index.less +0 -51
  191. package/es/GraphToolbar/index.less +0 -65
  192. package/es/Highlight/index.less +0 -381
  193. package/es/Login/index.less +0 -268
  194. package/es/NavMenu/index.less +0 -50
  195. package/es/Ranger/index.less +0 -57
  196. package/es/SideTip/index.less +0 -180
  197. package/es/TaskGraph/graph.less +0 -23
  198. package/es/TaskGraph/index.less +0 -117
  199. package/es/Welcome/index.less +0 -185
  200. package/es/index.less +0 -1
  201. package/es/variable.less +0 -54
  202. package/lib/BatchOperationBar/index.less +0 -46
  203. package/lib/BatchOperationBar/index.less.d.ts +0 -15
  204. package/lib/Boundary/index.less +0 -36
  205. package/lib/ContentWithIcon/index.less +0 -21
  206. package/lib/DateRanger/index.less +0 -180
  207. package/lib/Dialog/index.less +0 -116
  208. package/lib/FullscreenBox/index.less +0 -51
  209. package/lib/GraphToolbar/index.less +0 -65
  210. package/lib/Highlight/index.less +0 -381
  211. package/lib/Login/index.less +0 -268
  212. package/lib/NavMenu/index.less +0 -50
  213. package/lib/Ranger/index.less +0 -57
  214. package/lib/SideTip/index.less +0 -180
  215. package/lib/TaskGraph/graph.less +0 -23
  216. package/lib/TaskGraph/index.less +0 -117
  217. package/lib/Welcome/index.less +0 -185
  218. package/lib/index.less +0 -1
  219. package/lib/variable.less +0 -54
@@ -40,18 +40,20 @@ var import_lodash = require("lodash");
40
40
  var import_moment = __toESM(require("moment"));
41
41
  var import_classnames = __toESM(require("classnames"));
42
42
  var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
43
- var import_util = require("../_util");
44
43
  var import_constant = require("./constant");
45
44
  var import_PickerPanel = __toESM(require("./PickerPanel"));
46
45
  var import_zh_CN = __toESM(require("./locale/zh-CN"));
47
- var import_index = require("./index.less");
46
+ var import_style = __toESM(require("./style"));
48
47
  var import_ahooks = require("ahooks");
49
- var import_util2 = require("@oceanbase/util");
48
+ var import_util = require("@oceanbase/util");
50
49
  var import_jsx_runtime = require("react/jsx-runtime");
51
50
  var DefaultMaxHistoryCapacity = 20;
52
- var prefix = (0, import_util.getPrefix)("date-ranger");
53
51
  var Ranger = import_react.default.forwardRef((props, ref) => {
54
52
  var _a;
53
+ const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
54
+ const prefixCls = getPrefixCls("date-ranger");
55
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
56
+ const prefix = prefixCls;
55
57
  const {
56
58
  selects = [
57
59
  import_constant.NEAR_1_MINUTES,
@@ -123,8 +125,9 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
123
125
  }
124
126
  return false;
125
127
  }, [historyProp]);
126
- const [rangeHistory, setRangeHistory] = (0, import_util2.useLocalStorageState)(
127
- "ob-design-date-ranger-local-storage-range-history-state",
128
+ const localStorageKey = `${prefixCls}-date-ranger-history`;
129
+ const [rangeHistory, setRangeHistory] = (0, import_util.useLocalStorageState)(
130
+ localStorageKey,
128
131
  { defaultValue: [], listenStorageChange: true }
129
132
  );
130
133
  const updateRangeHistory = (range) => {
@@ -281,376 +284,378 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
281
284
  const diffMs = e.diff(s);
282
285
  return diffMs > differenceMs;
283
286
  }) : selects[rangeNameIndex + 1];
284
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
285
- import_design.Space,
286
- {
287
- className: (0, import_classnames.default)(rest.className, {
288
- [prefix]: true,
289
- [`${prefix}-show-range`]: true,
290
- [`${prefix}-back-radio-focused`]: backRadioFocused
291
- }),
292
- style: rest.style,
293
- children: [
294
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { size: 0, children: [
295
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
296
- "div",
297
- {
298
- className: (0, import_classnames.default)(`${prefix}-wrapper`, {
299
- [`${prefix}-wrapper-has-jumper`]: hasRewind || hasForward
300
- }),
301
- children: [
302
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
303
- import_design.Dropdown,
304
- {
305
- trigger: ["click"],
306
- open,
307
- placement: rest.placement,
308
- autoAdjustOverflow,
309
- getPopupContainer,
310
- destroyOnHidden: true,
311
- onOpenChange: (o) => {
312
- if (o === false && tooltipOpen) {
313
- return;
314
- }
315
- setOpen(o);
316
- },
317
- popupRender: (originNode) => {
318
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
319
- "div",
320
- {
321
- ref: popRef,
322
- className: (0, import_classnames.default)(`${prefix}-dropdown-picker`, overlayClassName),
323
- style: overlayStyle,
324
- children: [
325
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Flex, { vertical: true, justify: "space-between", children: [
326
- !historyMenuVisible && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "options", children: originNode }),
327
- history && historyMenuVisible && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "history", children: [
328
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
287
+ return wrapSSR(
288
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
289
+ import_design.Space,
290
+ {
291
+ className: (0, import_classnames.default)(rest.className, {
292
+ [prefix]: true,
293
+ [`${prefix}-show-range`]: true,
294
+ [`${prefix}-back-radio-focused`]: backRadioFocused
295
+ }),
296
+ style: rest.style,
297
+ children: [
298
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { size: 0, children: [
299
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
300
+ "div",
301
+ {
302
+ className: (0, import_classnames.default)(`${prefix}-wrapper`, {
303
+ [`${prefix}-wrapper-has-jumper`]: hasRewind || hasForward
304
+ }),
305
+ children: [
306
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
307
+ import_design.Dropdown,
308
+ {
309
+ trigger: ["click"],
310
+ open,
311
+ placement: rest.placement,
312
+ autoAdjustOverflow,
313
+ getPopupContainer,
314
+ destroyOnHidden: true,
315
+ onOpenChange: (o) => {
316
+ if (o === false && tooltipOpen) {
317
+ return;
318
+ }
319
+ setOpen(o);
320
+ },
321
+ popupRender: (originNode) => {
322
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
323
+ "div",
324
+ {
325
+ ref: popRef,
326
+ className: (0, import_classnames.default)(`${prefix}-dropdown-picker`, overlayClassName),
327
+ style: overlayStyle,
328
+ children: [
329
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Flex, { vertical: true, justify: "space-between", children: [
330
+ !historyMenuVisible && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "options", children: originNode }),
331
+ history && historyMenuVisible && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "history", children: [
332
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
333
+ import_design.Button,
334
+ {
335
+ type: "link",
336
+ style: { paddingLeft: 8, color: token.colorTextBase },
337
+ onClick: (e) => {
338
+ setHistoryMenuVisible(false);
339
+ e.stopPropagation();
340
+ },
341
+ children: [
342
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ArrowLeftOutlined, { color: token.colorTextLabel }),
343
+ getHistoryTitle()
344
+ ]
345
+ }
346
+ ),
347
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
348
+ import_design.Menu,
349
+ {
350
+ onClick: ({ key: rangeString }) => {
351
+ const vList = rangeString.split(",").map((v) => v.trim());
352
+ rangeChange(
353
+ vList.map((v) => {
354
+ return isMoment ? (0, import_moment.default)(v) : (0, import_dayjs.default)(v);
355
+ })
356
+ );
357
+ handleNameChange(import_constant.CUSTOMIZE);
358
+ },
359
+ style: { maxHeight: 480, overflowY: "auto" },
360
+ items: rangeHistory.map((range) => {
361
+ return {
362
+ key: String(range),
363
+ label: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
364
+ import_design.Flex,
365
+ {
366
+ className: `${prefix}-history-menu-item`,
367
+ vertical: true,
368
+ children: [
369
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
370
+ (isMoment ? (0, import_moment.default)(range[0]) : (0, import_dayjs.default)(range[0])).format(
371
+ import_constant.YEAR_DATE_TIME_SECOND_FORMAT_CN
372
+ ),
373
+ "~"
374
+ ] }),
375
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: (isMoment ? (0, import_moment.default)(range[1]) : (0, import_dayjs.default)(range[1])).format(
376
+ import_constant.YEAR_DATE_TIME_SECOND_FORMAT_CN
377
+ ) }),
378
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { className: `${prefix}-menu-text-btn-wrapper`, children: [
379
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
380
+ import_design.Button,
381
+ {
382
+ className: `${prefix}-menu-text-btn`,
383
+ type: "text",
384
+ color: "default",
385
+ variant: "filled",
386
+ size: "small",
387
+ onClick: (e) => {
388
+ e.stopPropagation();
389
+ const vList = range.map((v) => v);
390
+ const text = `${vList.join("~")}`;
391
+ navigator.clipboard.writeText(text);
392
+ import_design.message.success(text);
393
+ },
394
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CopyOutlined, {})
395
+ }
396
+ ),
397
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
398
+ import_design.Button,
399
+ {
400
+ className: `${prefix}-menu-text-btn`,
401
+ type: "text",
402
+ color: "default",
403
+ variant: "filled",
404
+ size: "small",
405
+ onClick: (e) => {
406
+ e.stopPropagation();
407
+ delRangeHistory(range);
408
+ },
409
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.DeleteOutlined, {})
410
+ }
411
+ )
412
+ ] })
413
+ ]
414
+ },
415
+ String(range)
416
+ )
417
+ };
418
+ })
419
+ }
420
+ )
421
+ ] }),
422
+ history && !historyMenuVisible && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
329
423
  import_design.Button,
330
424
  {
331
425
  type: "link",
332
- style: { paddingLeft: 8, color: token.colorTextBase },
426
+ style: { width: "max-content" },
333
427
  onClick: (e) => {
334
- setHistoryMenuVisible(false);
428
+ setHistoryMenuVisible(true);
335
429
  e.stopPropagation();
336
430
  },
337
431
  children: [
338
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ArrowLeftOutlined, { color: token.colorTextLabel }),
339
- getHistoryTitle()
432
+ getHistoryTitle(),
433
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.RightOutlined, {})
340
434
  ]
341
435
  }
342
- ),
343
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
344
- import_design.Menu,
345
- {
346
- onClick: ({ key: rangeString }) => {
347
- const vList = rangeString.split(",").map((v) => v.trim());
348
- rangeChange(
349
- vList.map((v) => {
350
- return isMoment ? (0, import_moment.default)(v) : (0, import_dayjs.default)(v);
351
- })
352
- );
353
- handleNameChange(import_constant.CUSTOMIZE);
354
- },
355
- style: { maxHeight: 480, overflowY: "auto" },
356
- items: rangeHistory.map((range) => {
357
- return {
358
- key: String(range),
359
- label: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
360
- import_design.Flex,
361
- {
362
- className: `${prefix}-history-menu-item`,
363
- vertical: true,
364
- children: [
365
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
366
- (isMoment ? (0, import_moment.default)(range[0]) : (0, import_dayjs.default)(range[0])).format(
367
- import_constant.YEAR_DATE_TIME_SECOND_FORMAT_CN
368
- ),
369
- "~"
370
- ] }),
371
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: (isMoment ? (0, import_moment.default)(range[1]) : (0, import_dayjs.default)(range[1])).format(
372
- import_constant.YEAR_DATE_TIME_SECOND_FORMAT_CN
373
- ) }),
374
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { className: `${prefix}-menu-text-btn-wrapper`, children: [
375
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
376
- import_design.Button,
377
- {
378
- className: `${prefix}-menu-text-btn`,
379
- type: "text",
380
- color: "default",
381
- variant: "filled",
382
- size: "small",
383
- onClick: (e) => {
384
- e.stopPropagation();
385
- const vList = range.map((v) => v);
386
- const text = `${vList.join("~")}`;
387
- navigator.clipboard.writeText(text);
388
- import_design.message.success(text);
389
- },
390
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CopyOutlined, {})
391
- }
392
- ),
393
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
394
- import_design.Button,
395
- {
396
- className: `${prefix}-menu-text-btn`,
397
- type: "text",
398
- color: "default",
399
- variant: "filled",
400
- size: "small",
401
- onClick: (e) => {
402
- e.stopPropagation();
403
- delRangeHistory(range);
404
- },
405
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.DeleteOutlined, {})
406
- }
407
- )
408
- ] })
409
- ]
410
- },
411
- String(range)
412
- )
413
- };
414
- })
415
- }
416
436
  )
417
437
  ] }),
418
- history && !historyMenuVisible && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
419
- import_design.Button,
438
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Divider, { type: "vertical", style: { height: "auto", margin: "0px 4px 0px 0px" } }),
439
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
440
+ import_PickerPanel.default,
420
441
  {
421
- type: "link",
422
- style: { width: "max-content" },
423
- onClick: (e) => {
424
- setHistoryMenuVisible(true);
425
- e.stopPropagation();
442
+ defaultValue: innerValue || [],
443
+ locale,
444
+ disabledDate: pastOnly ? disabledFuture : disabledDate,
445
+ tip,
446
+ isMoment,
447
+ rules,
448
+ hideSecond,
449
+ onOk: (vList) => {
450
+ setIsPlay(false);
451
+ handleNameChange(import_constant.CUSTOMIZE);
452
+ rangeChange(
453
+ vList.map((v) => {
454
+ return isMoment ? (0, import_moment.default)(v) : (0, import_dayjs.default)(v);
455
+ })
456
+ );
457
+ closeTooltip();
426
458
  },
427
- children: [
428
- getHistoryTitle(),
429
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.RightOutlined, {})
430
- ]
459
+ onCancel: () => {
460
+ closeTooltip();
461
+ }
431
462
  }
432
463
  )
433
- ] }),
434
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Divider, { type: "vertical", style: { height: "auto", margin: "0px 4px 0px 0px" } }),
464
+ ]
465
+ }
466
+ );
467
+ },
468
+ menu: {
469
+ selectable: true,
470
+ defaultSelectedKeys: [rangeName],
471
+ onClick: ({ key, domEvent }) => {
472
+ const selected = selects.find((_item) => _item.name === key);
473
+ if (selected == null ? void 0 : selected.range) {
474
+ handleNameChange(key);
475
+ setIsPlay(true);
476
+ rangeChange(selected.range(isMoment ? (0, import_moment.default)() : (0, import_dayjs.default)()));
477
+ }
478
+ },
479
+ items: selects.filter((item) => {
480
+ return !!item;
481
+ }).map((item) => {
482
+ return {
483
+ key: item.name,
484
+ label: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { size: 8, style: { minWidth: 100 }, children: [
485
+ hasTagInPicker && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefix}-label`, children: item.rangeLabel }),
486
+ isEN ? item.enLabel || item.label : item.label
487
+ ] })
488
+ };
489
+ })
490
+ },
491
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
492
+ import_design.Space,
493
+ {
494
+ ref: labelRef,
495
+ size: 0,
496
+ onClick: () => {
497
+ setOpen(true);
498
+ setTooltipOpen(true);
499
+ },
500
+ children: [
435
501
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
436
- import_PickerPanel.default,
502
+ "span",
437
503
  {
438
- defaultValue: innerValue || [],
439
- locale,
440
- disabledDate: pastOnly ? disabledFuture : disabledDate,
441
- tip,
442
- isMoment,
443
- rules,
444
- hideSecond,
445
- onOk: (vList) => {
446
- setIsPlay(false);
447
- handleNameChange(import_constant.CUSTOMIZE);
448
- rangeChange(
449
- vList.map((v) => {
450
- return isMoment ? (0, import_moment.default)(v) : (0, import_dayjs.default)(v);
451
- })
452
- );
453
- closeTooltip();
504
+ className: `${prefix}-label`,
505
+ style: {
506
+ marginLeft: 8
454
507
  },
455
- onCancel: () => {
456
- closeTooltip();
457
- }
508
+ children: rangeLabel
458
509
  }
459
- )
510
+ ),
511
+ simpleMode && isPlay && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-play`, children: label })
460
512
  ]
461
513
  }
462
- );
463
- },
464
- menu: {
465
- selectable: true,
466
- defaultSelectedKeys: [rangeName],
467
- onClick: ({ key, domEvent }) => {
468
- const selected = selects.find((_item) => _item.name === key);
469
- if (selected == null ? void 0 : selected.range) {
470
- handleNameChange(key);
471
- setIsPlay(true);
472
- rangeChange(selected.range(isMoment ? (0, import_moment.default)() : (0, import_dayjs.default)()));
473
- }
514
+ )
515
+ }
516
+ ),
517
+ (!simpleMode || !isPlay) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
518
+ "span",
519
+ {
520
+ ref: rangeRef,
521
+ onClick: () => {
522
+ setOpen(true);
523
+ setTooltipOpen(true);
474
524
  },
475
- items: selects.filter((item) => {
476
- return !!item;
477
- }).map((item) => {
478
- return {
479
- key: item.name,
480
- label: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { size: 8, style: { minWidth: 100 }, children: [
481
- hasTagInPicker && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefix}-label`, children: item.rangeLabel }),
482
- isEN ? item.enLabel || item.label : item.label
483
- ] })
484
- };
485
- })
486
- },
487
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
488
- import_design.Space,
489
- {
490
- ref: labelRef,
491
- size: 0,
492
- onClick: () => {
493
- setOpen(true);
494
- setTooltipOpen(true);
495
- },
496
- children: [
497
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
498
- "span",
499
- {
500
- className: `${prefix}-label`,
501
- style: {
502
- marginLeft: 8
503
- },
504
- children: rangeLabel
525
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
526
+ import_design.DatePicker.RangePicker,
527
+ {
528
+ className: (0, import_classnames.default)(`${prefix}-picker`),
529
+ style: {
530
+ // pointerEvents: 'none',
531
+ border: 0
532
+ },
533
+ format: (v) => {
534
+ if (hideYear && isThisYear) {
535
+ return hideSecond ? v.format(isCn ? import_constant.DATE_TIME_FORMAT_CN : import_constant.DATE_TIME_FORMAT) : v.format(isCn ? import_constant.DATE_TIME_SECOND_FORMAT_CN : import_constant.DATE_TIME_SECOND_FORMAT);
505
536
  }
506
- ),
507
- simpleMode && isPlay && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-play`, children: label })
508
- ]
509
- }
510
- )
511
- }
512
- ),
513
- (!simpleMode || !isPlay) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
514
- "span",
515
- {
516
- ref: rangeRef,
517
- onClick: () => {
518
- setOpen(true);
519
- setTooltipOpen(true);
520
- },
521
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
522
- import_design.DatePicker.RangePicker,
523
- {
524
- className: (0, import_classnames.default)(`${prefix}-picker`),
525
- style: {
526
- // pointerEvents: 'none',
527
- border: 0
528
- },
529
- format: (v) => {
530
- if (hideYear && isThisYear) {
531
- return hideSecond ? v.format(isCn ? import_constant.DATE_TIME_FORMAT_CN : import_constant.DATE_TIME_FORMAT) : v.format(isCn ? import_constant.DATE_TIME_SECOND_FORMAT_CN : import_constant.DATE_TIME_SECOND_FORMAT);
532
- }
533
- return hideSecond ? v.format(isCn ? import_constant.YEAR_DATE_TIME_FORMAT_CN : import_constant.YEAR_DATE_TIME_FORMAT) : v.format(
534
- isCn ? import_constant.YEAR_DATE_TIME_SECOND_FORMAT_CN : import_constant.YEAR_DATE_TIME_SECOND_FORMAT
535
- );
536
- },
537
- value: innerValue,
538
- onChange: datePickerChange,
539
- allowClear: false,
540
- size,
541
- suffixIcon: null,
542
- ...(0, import_lodash.omit)(rest, "value", "onChange", "style", "className"),
543
- open: false
544
- }
545
- )
546
- }
547
- )
548
- ]
537
+ return hideSecond ? v.format(isCn ? import_constant.YEAR_DATE_TIME_FORMAT_CN : import_constant.YEAR_DATE_TIME_FORMAT) : v.format(
538
+ isCn ? import_constant.YEAR_DATE_TIME_SECOND_FORMAT_CN : import_constant.YEAR_DATE_TIME_SECOND_FORMAT
539
+ );
540
+ },
541
+ value: innerValue,
542
+ onChange: datePickerChange,
543
+ allowClear: false,
544
+ size,
545
+ suffixIcon: null,
546
+ ...(0, import_lodash.omit)(rest, "value", "onChange", "style", "className"),
547
+ open: false
548
+ }
549
+ )
550
+ }
551
+ )
552
+ ]
553
+ }
554
+ ),
555
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
556
+ import_design.Radio.Group,
557
+ {
558
+ value: isPlay ? "play" : "",
559
+ className: `${prefix}-playback-control`,
560
+ buttonStyle: "solid",
561
+ children: [
562
+ hasRewind && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
563
+ import_design.Tooltip,
564
+ {
565
+ title: locale.jumpBack,
566
+ getPopupContainer: (trigger) => trigger.parentNode,
567
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
568
+ import_design.Radio.Button,
569
+ {
570
+ value: "stepBack",
571
+ style: {
572
+ paddingInline: 8,
573
+ borderInlineStart: 0,
574
+ borderTopLeftRadius: 0,
575
+ borderBottomLeftRadius: 0
576
+ },
577
+ onMouseEnter: () => setBackRadioFocused(true),
578
+ onMouseLeave: () => setBackRadioFocused(false),
579
+ onClick: () => {
580
+ if (isPlay) {
581
+ setIsPlay(false);
582
+ }
583
+ if (startTime && endTime) {
584
+ const newStartTime = startTime.clone().subtract(differenceMs, "milliseconds");
585
+ const newEndTime = startTime == null ? void 0 : startTime.clone();
586
+ rangeChange([newStartTime, newEndTime]);
587
+ }
588
+ },
589
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LeftOutlined, {})
590
+ }
591
+ )
592
+ }
593
+ ),
594
+ hasForward && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
595
+ import_design.Tooltip,
596
+ {
597
+ title: locale.jumpForward,
598
+ getPopupContainer: (trigger) => trigger.parentNode,
599
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
600
+ import_design.Radio.Button,
601
+ {
602
+ value: "stepForward",
603
+ style: {
604
+ paddingInline: 8,
605
+ borderInlineStart: 0,
606
+ borderTopLeftRadius: 0,
607
+ borderBottomLeftRadius: 0
608
+ },
609
+ onClick: () => {
610
+ if (startTime && endTime) {
611
+ const newStartTime = endTime.clone();
612
+ const newEndTime = endTime.clone().add(differenceMs);
613
+ if (newEndTime.isBefore(/* @__PURE__ */ new Date())) {
614
+ rangeChange([newStartTime, newEndTime]);
615
+ } else {
616
+ setIsPlay(true);
617
+ setNow();
618
+ }
619
+ }
620
+ },
621
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.RightOutlined, {})
622
+ }
623
+ )
624
+ }
625
+ )
626
+ ]
627
+ }
628
+ )
629
+ ] }),
630
+ hasSync && rangeName !== import_constant.CUSTOMIZE && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
631
+ import_design.Button,
632
+ {
633
+ style: { paddingInline: 8, color: token.colorTextSecondary },
634
+ onClick: () => {
635
+ setNow();
636
+ },
637
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SyncOutlined, {})
549
638
  }
550
639
  ),
551
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
552
- import_design.Radio.Group,
640
+ hasZoomOut && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
641
+ import_design.Button,
553
642
  {
554
- value: isPlay ? "play" : "",
555
- className: `${prefix}-playback-control`,
556
- buttonStyle: "solid",
557
- children: [
558
- hasRewind && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
559
- import_design.Tooltip,
560
- {
561
- title: locale.jumpBack,
562
- getPopupContainer: (trigger) => trigger.parentNode,
563
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
564
- import_design.Radio.Button,
565
- {
566
- value: "stepBack",
567
- style: {
568
- paddingInline: 8,
569
- borderInlineStart: 0,
570
- borderTopLeftRadius: 0,
571
- borderBottomLeftRadius: 0
572
- },
573
- onMouseEnter: () => setBackRadioFocused(true),
574
- onMouseLeave: () => setBackRadioFocused(false),
575
- onClick: () => {
576
- if (isPlay) {
577
- setIsPlay(false);
578
- }
579
- if (startTime && endTime) {
580
- const newStartTime = startTime.clone().subtract(differenceMs, "milliseconds");
581
- const newEndTime = startTime == null ? void 0 : startTime.clone();
582
- rangeChange([newStartTime, newEndTime]);
583
- }
584
- },
585
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LeftOutlined, {})
586
- }
587
- )
588
- }
589
- ),
590
- hasForward && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
591
- import_design.Tooltip,
592
- {
593
- title: locale.jumpForward,
594
- getPopupContainer: (trigger) => trigger.parentNode,
595
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
596
- import_design.Radio.Button,
597
- {
598
- value: "stepForward",
599
- style: {
600
- paddingInline: 8,
601
- borderInlineStart: 0,
602
- borderTopLeftRadius: 0,
603
- borderBottomLeftRadius: 0
604
- },
605
- onClick: () => {
606
- if (startTime && endTime) {
607
- const newStartTime = endTime.clone();
608
- const newEndTime = endTime.clone().add(differenceMs);
609
- if (newEndTime.isBefore(/* @__PURE__ */ new Date())) {
610
- rangeChange([newStartTime, newEndTime]);
611
- } else {
612
- setIsPlay(true);
613
- setNow();
614
- }
615
- }
616
- },
617
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.RightOutlined, {})
618
- }
619
- )
620
- }
621
- )
622
- ]
643
+ disabled: !nextRangeItem,
644
+ style: { color: token.colorTextSecondary },
645
+ onClick: () => {
646
+ setIsPlay(true);
647
+ if (nextRangeItem) {
648
+ setRangeName(nextRangeItem.name);
649
+ rangeChange(nextRangeItem.range(isMoment ? (0, import_moment.default)() : (0, import_dayjs.default)()));
650
+ return;
651
+ }
652
+ },
653
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ZoomOutOutlined, {})
623
654
  }
624
655
  )
625
- ] }),
626
- hasSync && rangeName !== import_constant.CUSTOMIZE && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
627
- import_design.Button,
628
- {
629
- style: { paddingInline: 8, color: token.colorTextSecondary },
630
- onClick: () => {
631
- setNow();
632
- },
633
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SyncOutlined, {})
634
- }
635
- ),
636
- hasZoomOut && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
637
- import_design.Button,
638
- {
639
- disabled: !nextRangeItem,
640
- style: { color: token.colorTextSecondary },
641
- onClick: () => {
642
- setIsPlay(true);
643
- if (nextRangeItem) {
644
- setRangeName(nextRangeItem.name);
645
- rangeChange(nextRangeItem.range(isMoment ? (0, import_moment.default)() : (0, import_dayjs.default)()));
646
- return;
647
- }
648
- },
649
- icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ZoomOutOutlined, {})
650
- }
651
- )
652
- ]
653
- }
656
+ ]
657
+ }
658
+ )
654
659
  );
655
660
  });
656
661
  var Ranger_default = (0, import_LocaleWrapper.default)({