@oceanbase/ui 0.4.20 → 0.4.22

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