@jetbrains/ring-ui-built 8.0.0-beta.4 → 8.0.0-beta.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 (74) hide show
  1. package/components/_helpers/alert.js +3 -0
  2. package/components/_helpers/caption.js +1 -1
  3. package/components/_helpers/header.js +1 -1
  4. package/components/_helpers/table.js +1 -1
  5. package/components/alert/alert-actions.d.ts +4 -0
  6. package/components/alert/alert-actions.js +51 -0
  7. package/components/alert/alert-heading.d.ts +4 -0
  8. package/components/alert/alert-heading.js +62 -0
  9. package/components/alert/alert.d.ts +14 -1
  10. package/components/alert/alert.js +43 -25
  11. package/components/alert-service/alert-service.d.ts +2 -1
  12. package/components/alert-service/alert-service.js +15 -5
  13. package/components/auth/auth-core.d.ts +5 -9
  14. package/components/auth/auth-core.js +71 -17
  15. package/components/auth/auth.js +7 -1
  16. package/components/auth/down-notification.js +7 -1
  17. package/components/auth/storage.js +7 -1
  18. package/components/clipboard/clipboard.js +7 -1
  19. package/components/collapse/collapse-content.d.ts +7 -0
  20. package/components/collapse/collapse-content.js +67 -35
  21. package/components/collapse/collapse-context.d.ts +1 -0
  22. package/components/collapse/collapse-context.js +1 -0
  23. package/components/collapse/collapse.d.ts +9 -0
  24. package/components/collapse/collapse.js +42 -38
  25. package/components/collapsible-group/collapsible-group.d.ts +14 -1
  26. package/components/collapsible-group/collapsible-group.js +82 -64
  27. package/components/date-picker/consts.d.ts +1 -0
  28. package/components/date-picker/date-input.js +3 -2
  29. package/components/expand/collapsible-group.js +1 -0
  30. package/components/header/header.js +7 -1
  31. package/components/header/smart-profile.js +7 -1
  32. package/components/http/http.d.ts +2 -2
  33. package/components/http/http.js +2 -2
  34. package/components/i18n/i18n.d.ts +1 -0
  35. package/components/i18n/i18n.js +2 -0
  36. package/components/internal/reorder-animation-context.js +159 -0
  37. package/components/internal/reorder-handle.js +750 -0
  38. package/components/internal/reorder-layout-context.js +141 -0
  39. package/components/internal/table-header.js +221 -645
  40. package/components/internal/{virtual-items.js → virtualization.js} +29 -14
  41. package/components/old-browsers-message/white-list.js +2 -2
  42. package/components/storage/storage-local.js +7 -1
  43. package/components/storage/storage.js +7 -1
  44. package/components/style.css +1 -1
  45. package/components/table/default-item-renderer.d.ts +7 -1
  46. package/components/table/default-item-renderer.js +119 -67
  47. package/components/table/internal/reorder-animation-context.d.ts +21 -0
  48. package/components/table/internal/reorder-handle.d.ts +9 -0
  49. package/components/table/internal/reorder-layout-context.d.ts +16 -0
  50. package/components/table/internal/table-header.d.ts +1 -4
  51. package/components/table/internal/{virtual-items.d.ts → virtualization.d.ts} +10 -3
  52. package/components/table/item-virtualization.d.ts +5 -3
  53. package/components/table/item-virtualization.js +13 -11
  54. package/components/table/reorder-animation.d.ts +37 -0
  55. package/components/table/reorder-animation.js +18 -0
  56. package/components/table/reorder-item-layout.d.ts +32 -0
  57. package/components/table/reorder-item-layout.js +57 -0
  58. package/components/table/table-const.d.ts +0 -32
  59. package/components/table/table-const.js +1 -8
  60. package/components/table/table-primitives.d.ts +43 -0
  61. package/components/table/table-primitives.js +62 -5
  62. package/components/table/table-props.d.ts +29 -5
  63. package/components/table/table.d.ts +31 -5
  64. package/components/table/table.js +177 -170
  65. package/components/user-agreement/service.js +7 -1
  66. package/components/user-card/card.js +7 -1
  67. package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
  68. package/components/user-card/smart-user-card-tooltip.js +7 -1
  69. package/components/user-card/tooltip.js +7 -1
  70. package/components/user-card/user-card.js +7 -1
  71. package/components/util-stories.d.ts +2 -2
  72. package/package.json +2 -2
  73. package/components/internal/column-animation.js +0 -133
  74. package/components/table/internal/column-animation.d.ts +0 -16
@@ -1,5 +1,5 @@
1
1
  import { c } from 'react/compiler-runtime';
2
- import { useState, use } from 'react';
2
+ import React__default, { useState, use } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import chevronRightIcon from '@jetbrains/icons/chevron-12px-right';
5
5
  import chevron12pxDown from '@jetbrains/icons/chevron-12px-down';
@@ -15,17 +15,18 @@ import '../global/memoize.js';
15
15
  import '../collapse/consts.js';
16
16
  import '../global/data-tests.js';
17
17
  import '../global/dom.js';
18
+ import '../global/parse-css-duration.js';
18
19
  import '../collapse/utils.js';
19
20
 
20
- var styles = {"expand":"ring-collapsible-group-expand","collapseRoot":"ring-collapsible-group-collapseRoot","hovered":"ring-collapsible-group-hovered","expanded":"ring-collapsible-group-expanded","focused":"ring-collapsible-group-focused","header":"ring-collapsible-group-header","headerButton":"ring-collapsible-group-headerButton","headerStatic":"ring-collapsible-group-headerStatic","headerContent":"ring-collapsible-group-headerContent","avatarGroup":"ring-collapsible-group-avatarGroup","title":"ring-collapsible-group-title","subtitleGroup":"ring-collapsible-group-subtitleGroup","subtitle":"ring-collapsible-group-subtitle","subtitleChevron":"ring-collapsible-group-subtitleChevron","toggle":"ring-collapsible-group-toggle","toggleIcon":"ring-collapsible-group-toggleIcon","body":"ring-collapsible-group-body"};
21
+ var styles = {"expand":"ring-collapsible-group-expand","collapseRoot":"ring-collapsible-group-collapseRoot","hovered":"ring-collapsible-group-hovered","expanded":"ring-collapsible-group-expanded","focused":"ring-collapsible-group-focused","header":"ring-collapsible-group-header","heading":"ring-collapsible-group-heading","headerButton":"ring-collapsible-group-headerButton","headerStatic":"ring-collapsible-group-headerStatic","headerContent":"ring-collapsible-group-headerContent","avatarGroup":"ring-collapsible-group-avatarGroup","title":"ring-collapsible-group-title","subtitleGroup":"ring-collapsible-group-subtitleGroup","subtitle":"ring-collapsible-group-subtitle","subtitleChevron":"ring-collapsible-group-subtitleChevron","toggle":"ring-collapsible-group-toggle","toggleIcon":"ring-collapsible-group-toggleIcon","body":"ring-collapsible-group-body"};
21
22
 
22
23
  function CollapsibleGroupHeaderContent(t0) {
23
24
  const $ = c(16);
24
- if ($[0] !== "0b0104270833ca27f2118e72fd68547a84ef5bf33921c0d276e95941f6f80768") {
25
+ if ($[0] !== "541af245e7b946a00fb862bbdbeef43dd124294e4c71865b955620d61a2591dd") {
25
26
  for (let $i = 0; $i < 16; $i += 1) {
26
27
  $[$i] = Symbol.for("react.memo_cache_sentinel");
27
28
  }
28
- $[0] = "0b0104270833ca27f2118e72fd68547a84ef5bf33921c0d276e95941f6f80768";
29
+ $[0] = "541af245e7b946a00fb862bbdbeef43dd124294e4c71865b955620d61a2591dd";
29
30
  }
30
31
  const {
31
32
  avatar,
@@ -120,11 +121,11 @@ function CollapsibleGroupHeaderContent(t0) {
120
121
  }
121
122
  function CollapsibleGroupHeader(t0) {
122
123
  const $ = c(16);
123
- if ($[0] !== "0b0104270833ca27f2118e72fd68547a84ef5bf33921c0d276e95941f6f80768") {
124
+ if ($[0] !== "541af245e7b946a00fb862bbdbeef43dd124294e4c71865b955620d61a2591dd") {
124
125
  for (let $i = 0; $i < 16; $i += 1) {
125
126
  $[$i] = Symbol.for("react.memo_cache_sentinel");
126
127
  }
127
- $[0] = "0b0104270833ca27f2118e72fd68547a84ef5bf33921c0d276e95941f6f80768";
128
+ $[0] = "541af245e7b946a00fb862bbdbeef43dd124294e4c71865b955620d61a2591dd";
128
129
  }
129
130
  let avatar;
130
131
  let buttonProps;
@@ -193,11 +194,11 @@ function CollapsibleGroupHeader(t0) {
193
194
  }
194
195
  function CollapsibleGroupHeaderStatic(t0) {
195
196
  const $ = c(5);
196
- if ($[0] !== "0b0104270833ca27f2118e72fd68547a84ef5bf33921c0d276e95941f6f80768") {
197
+ if ($[0] !== "541af245e7b946a00fb862bbdbeef43dd124294e4c71865b955620d61a2591dd") {
197
198
  for (let $i = 0; $i < 5; $i += 1) {
198
199
  $[$i] = Symbol.for("react.memo_cache_sentinel");
199
200
  }
200
- $[0] = "0b0104270833ca27f2118e72fd68547a84ef5bf33921c0d276e95941f6f80768";
201
+ $[0] = "541af245e7b946a00fb862bbdbeef43dd124294e4c71865b955620d61a2591dd";
201
202
  }
202
203
  const {
203
204
  avatar,
@@ -224,12 +225,12 @@ function CollapsibleGroupHeaderStatic(t0) {
224
225
  return t1;
225
226
  }
226
227
  const CollapsibleGroup = t0 => {
227
- const $ = c(29);
228
- if ($[0] !== "0b0104270833ca27f2118e72fd68547a84ef5bf33921c0d276e95941f6f80768") {
229
- for (let $i = 0; $i < 29; $i += 1) {
228
+ const $ = c(33);
229
+ if ($[0] !== "541af245e7b946a00fb862bbdbeef43dd124294e4c71865b955620d61a2591dd") {
230
+ for (let $i = 0; $i < 33; $i += 1) {
230
231
  $[$i] = Symbol.for("react.memo_cache_sentinel");
231
232
  }
232
- $[0] = "0b0104270833ca27f2118e72fd68547a84ef5bf33921c0d276e95941f6f80768";
233
+ $[0] = "541af245e7b946a00fb862bbdbeef43dd124294e4c71865b955620d61a2591dd";
233
234
  }
234
235
  const {
235
236
  ref,
@@ -243,6 +244,8 @@ const CollapsibleGroup = t0 => {
243
244
  onChange: t3,
244
245
  disableAnimation: t4,
245
246
  interactive: t5,
247
+ keepMounted: t6,
248
+ headingLevel,
246
249
  "data-test": dataTest
247
250
  } = t0;
248
251
  const defaultExpanded = t1 === undefined ? false : t1;
@@ -250,13 +253,14 @@ const CollapsibleGroup = t0 => {
250
253
  const onChange = t3 === undefined ? _temp : t3;
251
254
  const disableAnimation = t4 === undefined ? false : t4;
252
255
  const interactive = t5 === undefined ? true : t5;
256
+ const keepMounted = t6 === undefined ? false : t6;
253
257
  const [innerExpanded, setInnerExpanded] = useState(defaultExpanded);
254
258
  const [hovered, setHovered] = useState(false);
255
259
  const [focused, setFocused] = useState(false);
256
260
  const isExpanded = expanded !== null && expanded !== void 0 ? expanded : innerExpanded;
257
- let t6;
261
+ let t7;
258
262
  if ($[1] !== expanded || $[2] !== onChange) {
259
- t6 = collapsed => {
263
+ t7 = collapsed => {
260
264
  const nextExpanded = !collapsed;
261
265
  if (expanded == null) {
262
266
  setInnerExpanded(nextExpanded);
@@ -265,28 +269,28 @@ const CollapsibleGroup = t0 => {
265
269
  };
266
270
  $[1] = expanded;
267
271
  $[2] = onChange;
268
- $[3] = t6;
272
+ $[3] = t7;
269
273
  } else {
270
- t6 = $[3];
274
+ t7 = $[3];
271
275
  }
272
- const handleChange = t6;
273
- let t7;
276
+ const handleChange = t7;
277
+ let t8;
274
278
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
275
- t7 = event => {
279
+ t8 = event => {
276
280
  const nextTarget = event.relatedTarget;
277
281
  if (nextTarget instanceof Node && event.currentTarget.contains(nextTarget)) {
278
282
  return;
279
283
  }
280
284
  setFocused(false);
281
285
  };
282
- $[4] = t7;
286
+ $[4] = t8;
283
287
  } else {
284
- t7 = $[4];
288
+ t8 = $[4];
285
289
  }
286
- const onBlur = t7;
287
- let t8;
290
+ const onBlur = t8;
291
+ let t9;
288
292
  if ($[5] !== className || $[6] !== focused || $[7] !== hovered || $[8] !== isExpanded) {
289
- t8 = classNames(styles.expand, className, {
293
+ t9 = classNames(styles.expand, className, {
290
294
  [styles.hovered]: hovered,
291
295
  [styles.expanded]: isExpanded,
292
296
  [styles.focused]: focused
@@ -295,16 +299,14 @@ const CollapsibleGroup = t0 => {
295
299
  $[6] = focused;
296
300
  $[7] = hovered;
297
301
  $[8] = isExpanded;
298
- $[9] = t8;
302
+ $[9] = t9;
299
303
  } else {
300
- t8 = $[9];
304
+ t9 = $[9];
301
305
  }
302
- const classes = t8;
303
- const t9 = !defaultExpanded;
304
- const t10 = expanded == null ? null : !expanded;
305
- let t11;
306
+ const classes = t9;
307
+ let t10;
306
308
  if ($[10] !== avatar || $[11] !== interactive || $[12] !== subtitle || $[13] !== title) {
307
- t11 = interactive ? /*#__PURE__*/jsx(CollapsibleGroupHeader, {
309
+ t10 = interactive ? /*#__PURE__*/jsx(CollapsibleGroupHeader, {
308
310
  avatar: avatar,
309
311
  titleContent: title,
310
312
  subtitle: subtitle,
@@ -321,60 +323,76 @@ const CollapsibleGroup = t0 => {
321
323
  $[11] = interactive;
322
324
  $[12] = subtitle;
323
325
  $[13] = title;
324
- $[14] = t11;
326
+ $[14] = t10;
325
327
  } else {
326
- t11 = $[14];
328
+ t10 = $[14];
327
329
  }
328
- let t12;
329
- if ($[15] !== children) {
330
- t12 = /*#__PURE__*/jsx(CollapseContent, {
330
+ const header = t10;
331
+ const t11 = !defaultExpanded;
332
+ const t12 = expanded == null ? null : !expanded;
333
+ let t13;
334
+ if ($[15] !== header || $[16] !== headingLevel) {
335
+ t13 = headingLevel != null ? /*#__PURE__*/React__default.createElement(`h${headingLevel}`, {
336
+ className: styles.heading
337
+ }, header) : header;
338
+ $[15] = header;
339
+ $[16] = headingLevel;
340
+ $[17] = t13;
341
+ } else {
342
+ t13 = $[17];
343
+ }
344
+ let t14;
345
+ if ($[18] !== children) {
346
+ t14 = /*#__PURE__*/jsx(CollapseContent, {
331
347
  children: /*#__PURE__*/jsx("div", {
332
348
  className: styles.body,
333
349
  children: children
334
350
  })
335
351
  });
336
- $[15] = children;
337
- $[16] = t12;
352
+ $[18] = children;
353
+ $[19] = t14;
338
354
  } else {
339
- t12 = $[16];
355
+ t14 = $[19];
340
356
  }
341
- let t13;
342
- if ($[17] !== disableAnimation || $[18] !== handleChange || $[19] !== t10 || $[20] !== t11 || $[21] !== t12 || $[22] !== t9) {
343
- t13 = /*#__PURE__*/jsxs(Collapse, {
344
- defaultCollapsed: t9,
345
- collapsed: t10,
357
+ let t15;
358
+ if ($[20] !== disableAnimation || $[21] !== handleChange || $[22] !== keepMounted || $[23] !== t11 || $[24] !== t12 || $[25] !== t13 || $[26] !== t14) {
359
+ t15 = /*#__PURE__*/jsxs(Collapse, {
360
+ defaultCollapsed: t11,
361
+ collapsed: t12,
346
362
  onChange: handleChange,
347
363
  disableAnimation: disableAnimation,
364
+ keepMounted: keepMounted,
348
365
  className: styles.collapseRoot,
349
- children: [t11, t12]
366
+ children: [t13, t14]
350
367
  });
351
- $[17] = disableAnimation;
352
- $[18] = handleChange;
353
- $[19] = t10;
354
- $[20] = t11;
355
- $[21] = t12;
356
- $[22] = t9;
357
- $[23] = t13;
368
+ $[20] = disableAnimation;
369
+ $[21] = handleChange;
370
+ $[22] = keepMounted;
371
+ $[23] = t11;
372
+ $[24] = t12;
373
+ $[25] = t13;
374
+ $[26] = t14;
375
+ $[27] = t15;
358
376
  } else {
359
- t13 = $[23];
377
+ t15 = $[27];
360
378
  }
361
- let t14;
362
- if ($[24] !== classes || $[25] !== dataTest || $[26] !== ref || $[27] !== t13) {
363
- t14 = /*#__PURE__*/jsx("div", {
379
+ let t16;
380
+ if ($[28] !== classes || $[29] !== dataTest || $[30] !== ref || $[31] !== t15) {
381
+ t16 = /*#__PURE__*/jsx("div", {
364
382
  ref: ref,
365
383
  className: classes,
366
384
  "data-test": dataTest,
367
- children: t13
385
+ children: t15
368
386
  });
369
- $[24] = classes;
370
- $[25] = dataTest;
371
- $[26] = ref;
372
- $[27] = t13;
373
- $[28] = t14;
387
+ $[28] = classes;
388
+ $[29] = dataTest;
389
+ $[30] = ref;
390
+ $[31] = t15;
391
+ $[32] = t16;
374
392
  } else {
375
- t14 = $[28];
393
+ t16 = $[32];
376
394
  }
377
- return t14;
395
+ return t16;
378
396
  };
379
397
  CollapsibleGroup.displayName = 'CollapsibleGroup';
380
398
  function _temp() {}
@@ -34,6 +34,7 @@ export interface DateInputTranslations {
34
34
  addSecondDate?: string;
35
35
  addTime?: string;
36
36
  selectName?: string;
37
+ selectDate?: string;
37
38
  }
38
39
  export interface DateSpecificPopupProps {
39
40
  withTime?: false | undefined;
@@ -93,6 +93,7 @@ class DateInput extends React.PureComponent {
93
93
  locale
94
94
  } = this.props;
95
95
  const {
96
+ messages,
96
97
  translate
97
98
  } = this.context;
98
99
  let displayText = '';
@@ -105,7 +106,7 @@ class DateInput extends React.PureComponent {
105
106
  } else if (name === 'time') {
106
107
  displayText = time || '';
107
108
  }
108
- const placeholder = ((_translations$addFirs, _translations$addSeco, _translations$addTime, _translations$selectN) => {
109
+ const placeholder = ((_translations$addFirs, _translations$addSeco, _translations$addTime, _ref, _ref2, _ref3, _translations$selectD) => {
109
110
  switch (name) {
110
111
  case 'from':
111
112
  return fromPlaceholder || ((_translations$addFirs = translations?.addFirstDate) !== null && _translations$addFirs !== void 0 ? _translations$addFirs : translate('addFirstDate'));
@@ -114,7 +115,7 @@ class DateInput extends React.PureComponent {
114
115
  case 'time':
115
116
  return timePlaceholder || ((_translations$addTime = translations?.addTime) !== null && _translations$addTime !== void 0 ? _translations$addTime : translate('addTime'));
116
117
  default:
117
- return ((_translations$selectN = translations?.selectName) !== null && _translations$selectN !== void 0 ? _translations$selectN : translate('selectName')).replace('%name%', name).replace('{{name}}', name);
118
+ return ((_ref = (_ref2 = (_ref3 = (_translations$selectD = translations?.selectDate) !== null && _translations$selectD !== void 0 ? _translations$selectD : translations?.selectName) !== null && _ref3 !== void 0 ? _ref3 : messages.selectDate) !== null && _ref2 !== void 0 ? _ref2 : messages.selectName) !== null && _ref !== void 0 ? _ref : translate('selectDate')).replace('%name%', name).replace('{{name}}', name);
118
119
  }
119
120
  })();
120
121
  const classes = classNames(styles.filter, name !== 'time' && styles[`${name}Input`], divider && (name === 'from' || name === 'time') && styles[`${name}InputWithDivider`], 'ring-js-shortcuts');
@@ -16,6 +16,7 @@ import '../collapse/consts.js';
16
16
  import '../collapse/collapse-content.js';
17
17
  import '../global/data-tests.js';
18
18
  import '../global/dom.js';
19
+ import '../global/parse-css-duration.js';
19
20
  import '../collapse/utils.js';
20
21
 
21
22
  const warnDeprecation = deprecate(() => {}, '`CollapsibleGroup` from `@jetbrains/ring-ui/components/expand/collapsible-group` is deprecated and will be removed in Ring UI 8.0. Import it from `@jetbrains/ring-ui/components/collapsible-group/collapsible-group` instead.');
@@ -79,10 +79,16 @@ import '../alert-service/alert-service.js';
79
79
  import 'react-dom/client';
80
80
  import '../alert/alert.js';
81
81
  import '@jetbrains/icons/exception';
82
- import '@jetbrains/icons/checkmark';
82
+ import '@jetbrains/icons/success';
83
83
  import '@jetbrains/icons/warning';
84
+ import '@jetbrains/icons/info-filled';
84
85
  import '@jetbrains/icons/close';
85
86
  import '../loader-inline/loader-inline.js';
87
+ import '../alert/alert-heading.js';
88
+ import '../heading/heading.js';
89
+ import '../_helpers/heading.js';
90
+ import '../_helpers/alert.js';
91
+ import '../alert/alert-actions.js';
86
92
  import '../alert/container.js';
87
93
  import '../auth/auth.js';
88
94
  import '../auth/window-flow.js';
@@ -9,8 +9,9 @@ import '../global/get-uid.js';
9
9
  import '../alert/alert.js';
10
10
  import 'classnames';
11
11
  import '@jetbrains/icons/exception';
12
- import '@jetbrains/icons/checkmark';
12
+ import '@jetbrains/icons/success';
13
13
  import '@jetbrains/icons/warning';
14
+ import '@jetbrains/icons/info-filled';
14
15
  import '@jetbrains/icons/close';
15
16
  import '../icon/icon.js';
16
17
  import 'util-deprecate';
@@ -29,6 +30,11 @@ import '../global/controls-height.js';
29
30
  import '../global/configuration.js';
30
31
  import '../_helpers/button.classes.js';
31
32
  import '../_helpers/theme.js';
33
+ import '../alert/alert-heading.js';
34
+ import '../heading/heading.js';
35
+ import '../_helpers/heading.js';
36
+ import '../_helpers/alert.js';
37
+ import '../alert/alert-actions.js';
32
38
  import '../alert/container.js';
33
39
  import 'react-dom';
34
40
  import '../avatar/avatar.js';
@@ -20,7 +20,7 @@ export interface RequestParams<RawBody extends boolean = true | false> extends F
20
20
  export type RequestParamsWithoutMethod<RawBody extends boolean = boolean> = Omit<RequestParams<RawBody>, 'method'>;
21
21
  export interface HTTPAuth {
22
22
  requestToken(): Promise<string | null> | string | null;
23
- forceTokenUpdate(): Promise<string | null>;
23
+ forceTokenUpdate(failedToken?: string | null): Promise<string | null>;
24
24
  }
25
25
  export default class HTTP implements Partial<HTTPAuth> {
26
26
  baseUrl: string | null | undefined;
@@ -28,7 +28,7 @@ export default class HTTP implements Partial<HTTPAuth> {
28
28
  fetchConfig: RequestInit;
29
29
  requestToken?: () => Promise<string | null> | string | null;
30
30
  shouldRefreshToken?: (error: string) => boolean;
31
- forceTokenUpdate?: () => Promise<string | null>;
31
+ forceTokenUpdate?: (failedToken?: string | null) => Promise<string | null>;
32
32
  constructor(auth?: HTTPAuth, baseUrl?: string | null | undefined, fetchConfig?: RequestInit);
33
33
  setAuth: (auth: HTTPAuth) => void;
34
34
  setBaseUrl: (baseUrl: string | null | undefined) => void;
@@ -54,7 +54,7 @@ class HTTP {
54
54
  setAuth = auth => {
55
55
  this.requestToken = () => auth.requestToken();
56
56
  this.shouldRefreshToken = auth.constructor.shouldRefreshToken;
57
- this.forceTokenUpdate = () => auth.forceTokenUpdate();
57
+ this.forceTokenUpdate = failedToken => auth.forceTokenUpdate(failedToken);
58
58
  };
59
59
  setBaseUrl = baseUrl => {
60
60
  this.baseUrl = baseUrl;
@@ -170,7 +170,7 @@ class HTTP {
170
170
  }
171
171
  const shouldRefreshToken = typeof error.data.error === 'string' ? this.shouldRefreshToken?.(error.data.error) : false;
172
172
  if (shouldRefreshToken) {
173
- token = await this.forceTokenUpdate?.();
173
+ token = await this.forceTokenUpdate?.(token);
174
174
  response = await this._performRequest(url, token, params);
175
175
  return this._processResponse(response);
176
176
  }
@@ -23,6 +23,7 @@ export declare function getTranslations(): Partial<{
23
23
  addSecondDate: string;
24
24
  addTime: string;
25
25
  selectName: string;
26
+ selectDate: string;
26
27
  setDate: string;
27
28
  setDateTime: string;
28
29
  setPeriod: string;
@@ -18,6 +18,7 @@ var addFirstDate = "Add first date";
18
18
  var addSecondDate = "Add second date";
19
19
  var addTime = "Add time";
20
20
  var selectName = "Select {{name}}";
21
+ var selectDate = "Select a date";
21
22
  var setDate = "Set a date";
22
23
  var setDateTime = "Set date and time";
23
24
  var setPeriod = "Set a period";
@@ -70,6 +71,7 @@ var defaultMessages = {
70
71
  addSecondDate: addSecondDate,
71
72
  addTime: addTime,
72
73
  selectName: selectName,
74
+ selectDate: selectDate,
73
75
  setDate: setDate,
74
76
  setDateTime: setDateTime,
75
77
  setPeriod: setPeriod,
@@ -0,0 +1,159 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { createContext, useState, useRef, useEffect } from 'react';
3
+ import { parseCssDuration } from '../global/parse-css-duration.js';
4
+ import { requestAnimationFrameWithCleanup, setTimeoutWithCleanup } from '../global/schedule-with-cleanup.js';
5
+ import { s as styles } from '../_helpers/table.js';
6
+
7
+ /** How long to wait for the data to change after {@link expectReorder} is called. */
8
+ const pendingReorderTimeoutMs = 1000;
9
+ const ReorderAnimationContext = /*#__PURE__*/createContext({
10
+ reorderAnimation: null,
11
+ expectReorder: () => {}
12
+ });
13
+ function useReorderAnimationContextValue(t0) {
14
+ const $ = c(20);
15
+ if ($[0] !== "669a1fb3f5ac9a1cdad72a7fc204b97d9b35bce2182bb3bb8f0bd0acb524b958") {
16
+ for (let $i = 0; $i < 20; $i += 1) {
17
+ $[$i] = Symbol.for("react.memo_cache_sentinel");
18
+ }
19
+ $[0] = "669a1fb3f5ac9a1cdad72a7fc204b97d9b35bce2182bb3bb8f0bd0acb524b958";
20
+ }
21
+ const {
22
+ noColumnReorderAnimation,
23
+ noItemReorderAnimation,
24
+ tableRef,
25
+ data,
26
+ columns
27
+ } = t0;
28
+ const [reorderAnimation, setReorderAnimation] = useState(null);
29
+ const pendingReorderRef = useRef(null);
30
+ let t1;
31
+ if ($[1] !== columns || $[2] !== data || $[3] !== noColumnReorderAnimation || $[4] !== noItemReorderAnimation) {
32
+ t1 = function expectReorder(reorderSpec) {
33
+ const isColumn = reorderSpec.direction === "columns";
34
+ if (isColumn && noColumnReorderAnimation || !isColumn && noItemReorderAnimation) {
35
+ return;
36
+ }
37
+ if (pendingReorderRef.current) {
38
+ window.clearTimeout(pendingReorderRef.current.timerId);
39
+ }
40
+ const timerId = window.setTimeout(() => {
41
+ pendingReorderRef.current = null;
42
+ }, pendingReorderTimeoutMs);
43
+ pendingReorderRef.current = {
44
+ ...reorderSpec,
45
+ timerId,
46
+ columns,
47
+ data
48
+ };
49
+ };
50
+ $[1] = columns;
51
+ $[2] = data;
52
+ $[3] = noColumnReorderAnimation;
53
+ $[4] = noItemReorderAnimation;
54
+ $[5] = t1;
55
+ } else {
56
+ t1 = $[5];
57
+ }
58
+ const expectReorder = t1;
59
+ let t2;
60
+ let t3;
61
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
62
+ t2 = () => () => {
63
+ if (pendingReorderRef.current) {
64
+ window.clearTimeout(pendingReorderRef.current.timerId);
65
+ pendingReorderRef.current = null;
66
+ }
67
+ };
68
+ t3 = [];
69
+ $[6] = t2;
70
+ $[7] = t3;
71
+ } else {
72
+ t2 = $[6];
73
+ t3 = $[7];
74
+ }
75
+ useEffect(t2, t3);
76
+ let t4;
77
+ let t5;
78
+ if ($[8] !== columns || $[9] !== data || $[10] !== tableRef) {
79
+ t4 = () => {
80
+ const table = tableRef.current;
81
+ const pendingReorder = pendingReorderRef.current;
82
+ if (!table || !pendingReorder) {
83
+ return;
84
+ }
85
+ const {
86
+ direction,
87
+ data: pendingData,
88
+ columns: pendingColumns
89
+ } = pendingReorder;
90
+ const isColumn_0 = direction === "columns";
91
+ if (isColumn_0 && columns === pendingColumns || !isColumn_0 && data === pendingData) {
92
+ return;
93
+ }
94
+ pendingReorderRef.current = null;
95
+ const {
96
+ fromIndex,
97
+ insertionIndex
98
+ } = pendingReorder;
99
+ const index = fromIndex < insertionIndex ? insertionIndex - 1 : insertionIndex;
100
+ return requestAnimationFrameWithCleanup(() => setReorderAnimation(prev => prev == null ? {
101
+ direction,
102
+ index,
103
+ phase: "initial",
104
+ className: styles.reorderAnimationInitial
105
+ } : prev));
106
+ };
107
+ t5 = [data, columns, tableRef];
108
+ $[8] = columns;
109
+ $[9] = data;
110
+ $[10] = tableRef;
111
+ $[11] = t4;
112
+ $[12] = t5;
113
+ } else {
114
+ t4 = $[11];
115
+ t5 = $[12];
116
+ }
117
+ useEffect(t4, t5);
118
+ let t6;
119
+ let t7;
120
+ if ($[13] !== reorderAnimation || $[14] !== tableRef) {
121
+ t6 = () => {
122
+ if (reorderAnimation?.phase === "initial") {
123
+ return requestAnimationFrameWithCleanup(() => setReorderAnimation(prev_0 => prev_0 === reorderAnimation ? {
124
+ ...prev_0,
125
+ phase: "fade-out",
126
+ className: styles.reorderAnimationFadeOut
127
+ } : prev_0));
128
+ }
129
+ if (reorderAnimation?.phase === "fade-out") {
130
+ const fadeOutMs = parseCssDuration(window.getComputedStyle(tableRef.current).getPropertyValue("--reorder-animation-fade-out-duration"));
131
+ return setTimeoutWithCleanup(() => setReorderAnimation(prev_1 => prev_1 === reorderAnimation ? null : prev_1), fadeOutMs);
132
+ }
133
+ };
134
+ t7 = [reorderAnimation, tableRef];
135
+ $[13] = reorderAnimation;
136
+ $[14] = tableRef;
137
+ $[15] = t6;
138
+ $[16] = t7;
139
+ } else {
140
+ t6 = $[15];
141
+ t7 = $[16];
142
+ }
143
+ useEffect(t6, t7);
144
+ let t8;
145
+ if ($[17] !== expectReorder || $[18] !== reorderAnimation) {
146
+ t8 = {
147
+ reorderAnimation,
148
+ expectReorder
149
+ };
150
+ $[17] = expectReorder;
151
+ $[18] = reorderAnimation;
152
+ $[19] = t8;
153
+ } else {
154
+ t8 = $[19];
155
+ }
156
+ return t8;
157
+ }
158
+
159
+ export { ReorderAnimationContext, useReorderAnimationContextValue };