@evergis/uilib-gl 1.0.76 → 1.0.78

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.
@@ -1,4 +1,4 @@
1
- import { memo, Children, cloneElement, Component, isValidElement, useCallback, useRef, useState, useEffect, useMemo, useLayoutEffect, Fragment } from 'react';
1
+ import { memo, Children, cloneElement, Component, isValidElement, useRef, useEffect, useState, useMemo, useCallback, useLayoutEffect, Fragment } from 'react';
2
2
  import styled, { ThemeProvider as ThemeProvider$1, css, useTheme as useTheme$1, keyframes, createGlobalStyle } from 'styled-components';
3
3
  import merge from 'deepmerge';
4
4
  import { rgb, hsl, hsla, opacify, ellipsis, rem, normalize } from 'polished';
@@ -11,13 +11,13 @@ import de from 'date-fns/locale/de';
11
11
  import Locale from 'date-fns/locale/ru';
12
12
  import AutosuggestHighlightMatch from 'autosuggest-highlight/match';
13
13
  import AutosuggestHighlightParse from 'autosuggest-highlight/parse';
14
- import { IMaskMixin } from 'react-imask';
15
14
  import { debounce as debounce$1, throttle, isEqual, isNil, unescape, defaults, keyBy } from 'lodash-es';
16
15
  import { CSSTransition as CSSTransition$1, TransitionGroup } from 'react-transition-group';
17
16
  import Transition from 'react-transition-group/Transition';
18
17
  import { background, border, color, flexbox, fontSize, fontWeight, fontStyle, space, layout, textAlign, position, lineHeight, padding } from 'styled-system';
19
18
  import Bowser from 'bowser';
20
19
  import { Color } from '@evergis/color';
20
+ import { IMaskMixin } from 'react-imask';
21
21
  import Cleave from 'cleave.js';
22
22
  import Cleave$1 from 'cleave.js/react';
23
23
  import Autosuggest from 'react-autosuggest';
@@ -11048,37 +11048,52 @@ const Icon = /*#__PURE__*/styled.span.attrs(props => ({
11048
11048
  kind: "icon_undefined",
11049
11049
  ...props
11050
11050
  }))`
11051
- height: 1rem;
11052
- width: 1rem;
11051
+ height: ${_ref => {
11052
+ let {
11053
+ size = "1rem"
11054
+ } = _ref;
11055
+ return size;
11056
+ }};
11057
+ width: ${_ref2 => {
11058
+ let {
11059
+ size = "1rem"
11060
+ } = _ref2;
11061
+ return size;
11062
+ }};
11053
11063
  line-height: 0.5rem;
11054
- color: ${_ref => {
11064
+ color: ${_ref3 => {
11055
11065
  let {
11056
11066
  theme: {
11057
11067
  icon
11058
11068
  },
11059
11069
  ...props
11060
- } = _ref;
11070
+ } = _ref3;
11061
11071
  return icon == null ? void 0 : icon.color[getIconColors(props)];
11062
11072
  }};
11063
11073
 
11064
11074
  &:after {
11065
- content: ${_ref2 => {
11075
+ content: ${_ref4 => {
11066
11076
  let {
11067
11077
  kind
11068
- } = _ref2;
11078
+ } = _ref4;
11069
11079
  return kind && !!iconTypes[kind] && `"${iconTypes[kind]}"` || iconTypes.icon_undefined;
11070
11080
  }};
11071
- font: 300 1rem "evergis-font";
11081
+ font: 300 ${_ref5 => {
11082
+ let {
11083
+ size = "1rem"
11084
+ } = _ref5;
11085
+ return size;
11086
+ }} "evergis-font";
11072
11087
  }
11073
11088
 
11074
11089
  &[disabled],
11075
11090
  *[disabled] & {
11076
- color: ${_ref3 => {
11091
+ color: ${_ref6 => {
11077
11092
  let {
11078
11093
  theme: {
11079
11094
  icon
11080
11095
  }
11081
- } = _ref3;
11096
+ } = _ref6;
11082
11097
  return icon == null ? void 0 : icon.disabledColor;
11083
11098
  }};
11084
11099
  }
@@ -11087,13 +11102,13 @@ const injectIcon = icon => css`
11087
11102
  height: 1rem;
11088
11103
  width: 1rem;
11089
11104
  line-height: 0.5rem;
11090
- color: ${_ref4 => {
11105
+ color: ${_ref7 => {
11091
11106
  let {
11092
11107
  theme: {
11093
11108
  icon
11094
11109
  },
11095
11110
  ...props
11096
- } = _ref4;
11111
+ } = _ref7;
11097
11112
  return icon == null ? void 0 : icon.color[getIconColors(props)];
11098
11113
  }};
11099
11114
 
@@ -11137,969 +11152,492 @@ const Help = styled.span`
11137
11152
  }
11138
11153
  `;
11139
11154
 
11140
- const IconBefore = styled.span`
11141
- position: absolute;
11142
- left: 0;
11143
- top: 50%;
11144
- transform: translateY(-50%);
11145
- display: flex;
11146
- align-items: center;
11147
- justify-content: center;
11148
- min-height: 2rem;
11149
- min-width: 2rem;
11150
- height: 2rem;
11151
- width: 2rem;
11152
- `;
11153
- const IconAfter = styled.span`
11154
- position: absolute;
11155
- right: ${_ref => {
11156
- let {
11157
- indent
11158
- } = _ref;
11159
- return indent;
11160
- }}rem;
11161
- top: 50%;
11162
- transform: translateY(-50%);
11163
- display: flex;
11164
- align-items: center;
11165
- justify-content: center;
11166
- min-height: 2rem;
11167
- min-width: 2rem;
11168
- height: 2rem;
11169
- width: 2rem;
11170
-
11171
- button {
11172
- width: auto;
11173
- }
11174
- `;
11175
-
11176
- const inputMixin = css`
11177
- display: flex;
11178
- height: ${props => props.height || "auto"};
11179
- padding: 0.34375rem ${_ref => {
11180
- let {
11181
- paddingRight
11182
- } = _ref;
11183
- return `${paddingRight || 0}px`;
11184
- }} 0.34375rem
11185
- ${_ref2 => {
11186
- let {
11187
- extraLeftPaddingWidth
11188
- } = _ref2;
11189
- return extraLeftPaddingWidth ? `${(extraLeftPaddingWidth ?? 0) + 8}px` : "0.5rem";
11190
- }};
11191
- width: 100%;
11192
- background: transparent;
11193
- border: 0.0625rem solid ${_ref3 => {
11155
+ const InputLabel = styled.label`
11156
+ display: inline-block;
11157
+ padding: 0 0 0.25rem 0.5rem;
11158
+ color: ${_ref => {
11194
11159
  let {
11195
- error,
11196
11160
  theme: {
11197
11161
  input
11198
- }
11199
- } = _ref3;
11200
- return error ? input.error : input.borderColor;
11162
+ },
11163
+ error,
11164
+ active
11165
+ } = _ref;
11166
+ return error ? input.error : active ? input.active : input.labelColor;
11201
11167
  }};
11202
- border-radius: ${_ref4 => {
11168
+ cursor: pointer;
11169
+ font: ${_ref2 => {
11203
11170
  let {
11204
11171
  theme: {
11205
- borderRadius
11172
+ fonts
11206
11173
  }
11207
- } = _ref4;
11208
- return borderRadius.medium;
11174
+ } = _ref2;
11175
+ return fonts.description;
11209
11176
  }};
11210
- box-sizing: border-box;
11211
- color: ${_ref5 => {
11177
+
11178
+ &[disabled] {
11179
+ pointer-events: none;
11180
+ color: ${_ref3 => {
11212
11181
  let {
11213
11182
  theme: {
11214
11183
  input
11215
11184
  }
11216
- } = _ref5;
11217
- return input.color;
11185
+ } = _ref3;
11186
+ return input.disabledLabelColor;
11218
11187
  }};
11219
- font: ${_ref6 => {
11188
+ }
11189
+ `;
11190
+
11191
+ const DATE_FORMAT = "dd.MM.yyyy";
11192
+ const TIME_FORMAT = "HH:mm:ss";
11193
+ const SEPARATED_TIME_FORMAT = "HH : mm : ss";
11194
+ const DATE_TIME_FORMAT = /*#__PURE__*/[DATE_FORMAT, TIME_FORMAT].join(" ");
11195
+ const dateFormat = (value, withTime) => withTime ? format(value, DATE_TIME_FORMAT) : format(value, DATE_FORMAT);
11196
+ const rangeValueFormat = _ref => {
11220
11197
  let {
11221
- theme: {
11222
- fonts
11223
- }
11224
- } = _ref6;
11225
- return fonts.standard;
11226
- }};
11198
+ value,
11199
+ endValue,
11200
+ withTime
11201
+ } = _ref;
11202
+ if (!value) return "";
11203
+ const formattedValue = dateFormat(value, withTime);
11204
+ const formattedEndValue = !endValue ? "" : dateFormat(endValue, withTime);
11205
+ return endValue ? `${formattedValue} - ${formattedEndValue}` : formattedValue;
11206
+ };
11207
+ const getLocale = value => {
11208
+ switch (value) {
11209
+ case "en":
11210
+ return en;
11227
11211
 
11228
- ${IconBefore} + & {
11229
- padding-left: 2rem;
11212
+ case "it":
11213
+ return it;
11214
+
11215
+ case "de":
11216
+ return de;
11217
+
11218
+ default:
11219
+ return Locale;
11230
11220
  }
11221
+ };
11231
11222
 
11232
- &:focus {
11233
- outline: none;
11234
- border-color: ${_ref7 => {
11223
+ const isTouchDevice = () => "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
11224
+
11225
+ const preventDefault = e => {
11226
+ e.preventDefault();
11227
+ };
11228
+
11229
+ function randomInteger(min, max) {
11230
+ const random = min - 0.5 + Math.random() * (max - min + 1);
11231
+ return Math.round(random);
11232
+ }
11233
+ const toNumber = value => Number((value || 0).toString().replace(/\s/g, ""));
11234
+ const clamp = (value, max, min) => Math.max(Math.min(value, toNumber(max)), toNumber(min));
11235
+
11236
+ const getRealChildren = array => {
11237
+ return Children.toArray(array).filter(child => !!child);
11238
+ };
11239
+
11240
+ const Link = styled.a`
11241
+ text-decoration: none;
11242
+ font: ${_ref => {
11235
11243
  let {
11236
- error,
11237
11244
  theme: {
11238
- input
11239
- }
11240
- } = _ref7;
11241
- return error ? input.error : input.active;
11245
+ fonts
11246
+ },
11247
+ description
11248
+ } = _ref;
11249
+ return description ? fonts.description : fonts.standard;
11242
11250
  }};
11243
- }
11251
+ color: ${_ref2 => {
11252
+ let {
11253
+ theme: {
11254
+ link
11255
+ },
11256
+ ...props
11257
+ } = _ref2;
11258
+ return link.color[getLinkColors(props)];
11259
+ }};
11260
+ cursor: pointer;
11244
11261
 
11245
- &::placeholder {
11246
- color: ${_ref8 => {
11262
+ &:hover {
11263
+ color: ${_ref3 => {
11247
11264
  let {
11248
11265
  theme: {
11249
- input
11250
- }
11251
- } = _ref8;
11252
- return input.placeholderColor;
11266
+ link
11267
+ },
11268
+ ...props
11269
+ } = _ref3;
11270
+ return link.hoverColor[getLinkColors(props)];
11253
11271
  }};
11254
11272
  }
11255
11273
 
11256
- &[disabled] {
11257
- pointer-events: none;
11258
- color: ${_ref9 => {
11274
+ &:active {
11275
+ color: ${_ref4 => {
11259
11276
  let {
11260
11277
  theme: {
11261
- input
11262
- }
11263
- } = _ref9;
11264
- return input.disabledColor;
11278
+ link
11279
+ },
11280
+ ...props
11281
+ } = _ref4;
11282
+ return link.activeColor[getLinkColors(props)];
11265
11283
  }};
11266
- border: 0.0635rem dashed ${_ref10 => {
11284
+ }
11285
+
11286
+ &:visited {
11287
+ color: ${_ref5 => {
11267
11288
  let {
11268
11289
  theme: {
11269
- input
11290
+ link
11270
11291
  }
11271
- } = _ref10;
11272
- return input.disabledBorderColor;
11292
+ } = _ref5;
11293
+ return link.visitedColor;
11273
11294
  }};
11274
-
11275
- &::placeholder {
11276
- color: ${_ref11 => {
11295
+ }
11296
+ `;
11297
+ const ValueLink = styled.a`
11298
+ color: ${_ref6 => {
11277
11299
  let {
11278
11300
  theme: {
11279
- input
11301
+ link
11280
11302
  }
11281
- } = _ref11;
11282
- return input.disabledPlaceholderColor;
11303
+ } = _ref6;
11304
+ return link.color.primary;
11283
11305
  }};
11284
- }
11285
- }
11306
+ text-decoration: none;
11286
11307
  `;
11287
- const StyledInput = /*#__PURE__*/styled.input.attrs(props => ({
11288
- width: "14rem",
11289
- height: "auto",
11290
- paddingRight: 0.5,
11291
- paddingLeft: false,
11292
- ...props
11293
- }))`
11294
- ${inputMixin};
11295
- `;
11296
- const ChipInputHolder = styled.div`
11297
- ${inputMixin};
11298
- height: 2rem;
11299
- align-items: center;
11300
- padding: 0 ${_ref12 => {
11301
- let {
11302
- paddingRight
11303
- } = _ref12;
11304
- return `${paddingRight || 0}rem`;
11305
- }} 0 0.5rem;
11306
- `;
11307
- const ValuePrefix = styled.div`
11308
- position: absolute;
11309
- left: 0.5rem;
11310
- top: 50%;
11311
- transform: translateY(-50%);
11312
- font-size: 1rem;
11313
- opacity: 0.28;
11314
11308
 
11315
- ${IconBefore} + & {
11316
- padding-left: 1.5rem;
11317
- }
11318
- `;
11309
+ const isReactDomElement = Element => typeof Element === "object" && Element !== null && typeof Element.type === "string"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
11319
11310
 
11320
- const InputContainer = styled.span`
11321
- display: flex;
11322
- align-items: center;
11323
- position: relative;
11324
- width: ${_ref => {
11325
- let {
11326
- width
11327
- } = _ref;
11328
- return width;
11329
- }};
11311
+ const isReactElement = Element => typeof Element === "object" && Element !== null && !!Element.$$typeof; // eslint-disable-next-line @typescript-eslint/no-explicit-any
11330
11312
 
11331
- ${_ref2 => {
11332
- let {
11333
- active,
11334
- theme: {
11335
- input
11336
- }
11337
- } = _ref2;
11338
- return active && `
11339
- &:hover {
11340
- input {
11341
- outline: none;
11342
- border-color: ${input.active};
11343
- }
11344
- }
11345
-
11346
- input {
11347
- outline: none;
11348
- border-color: ${input.active};
11313
+ const isDomNode = x => // eslint-disable-next-line @typescript-eslint/no-explicit-any
11314
+ typeof window.Node === "object" ? // eslint-disable-next-line @typescript-eslint/no-explicit-any
11315
+ x instanceof window.Node : x !== null && typeof x === "object" && typeof x.nodeType === "number" && typeof x.nodeName === "string";
11316
+ const combineRefs = function () {
11317
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
11318
+ refs[_key] = arguments[_key];
11319
+ }
11320
+
11321
+ return refElement => refs.forEach(ref => {
11322
+ if (typeof ref === "function") {
11323
+ ref(refElement);
11349
11324
  }
11350
- `;
11351
- }}
11325
+ });
11326
+ }; // TODO:HACK: из за отстутсвия innerRef у styled компонентов
11327
+ // был создан такой хак распознавания является ли
11328
+ // стилизованный компонент простым (div, span, form, ...)
11329
+ // так как у таких компонентов нужно использовать `ref`
11330
+ // у других, имеющие вложенность нужно использовать `innerRef`
11331
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11352
11332
 
11353
- &:hover {
11354
- input {
11355
- border-color: ${_ref3 => {
11356
- let {
11357
- active,
11358
- theme: {
11359
- input
11360
- },
11361
- error
11362
- } = _ref3;
11363
- return !active && (error ? input.error : input.hoverBorderColor);
11364
- }};
11333
+ const isSimpleStyledComponent = Element => // eslint-disable-next-line @typescript-eslint/no-explicit-any
11334
+ Element && Element.target && styled[Element.target] || // eslint-disable-next-line @typescript-eslint/no-explicit-any
11335
+ Element.type && Element.type.target && styled[Element.type.target]; // eslint-disable-next-line @typescript-eslint/no-explicit-any
11365
11336
 
11366
- &:focus {
11367
- outline: none;
11368
- border-color: ${_ref4 => {
11369
- let {
11370
- theme: {
11371
- input
11372
- },
11373
- error
11374
- } = _ref4;
11375
- return error ? input.error : input.active;
11376
- }};
11377
- }
11378
- }
11379
- }
11337
+ const cloneWithRefs = (Element, ref) => {
11338
+ const refProp = isReactDomElement(Element) ? "ref" : isSimpleStyledComponent(Element) ? "ref" : "innerRef";
11339
+ return cloneElement(Element, { ...Element.props,
11340
+ [refProp]: combineRefs(ref, Element.props[refProp])
11341
+ });
11342
+ }; // https://github.com/mui-org/material-ui/blob/v1-beta/src/utils/ClickAwayListener.js
11380
11343
 
11381
- &[disabled] {
11382
- pointer-events: none;
11344
+ const isDescendant = (el, target) => {
11345
+ if (target !== null && target.parentNode) {
11346
+ return el === target || isDescendant(el, target.parentNode);
11383
11347
  }
11384
11348
 
11385
- ${ChipInputHolder} {
11386
- border-color: ${_ref5 => {
11387
- let {
11388
- active,
11389
- theme: {
11390
- input
11391
- }
11392
- } = _ref5;
11393
- return active && input.active;
11394
- }};
11395
- }
11396
- `;
11349
+ return false;
11350
+ };
11351
+ const isOutside = (el, target) => document.contains(target) && !isDescendant(el, target); // eslint-disable-next-line @typescript-eslint/no-explicit-any
11397
11352
 
11398
- const IconButtonInnerChild = styled.span``;
11399
- const buttonActiveMixin = css`
11400
- background: ${_ref => {
11401
- let {
11402
- theme: {
11403
- palette
11404
- }
11405
- } = _ref;
11406
- return palette.element;
11407
- }};
11353
+ const isNumeric = number => !isNaN(parseFloat(number)) && isFinite(number);
11354
+ const randomRgba = () => {
11355
+ // eslint-disable-next-line id-length
11356
+ const o = Math.round; // eslint-disable-next-line id-length
11408
11357
 
11409
- span[kind]:after,
11410
- :hover ${IconButtonInnerChild}, ${IconButtonInnerChild} {
11411
- color: ${_ref2 => {
11412
- let {
11413
- theme: {
11414
- palette
11415
- }
11416
- } = _ref2;
11417
- return palette.background;
11418
- }};
11419
- }
11420
- `;
11421
- const buttonHoverMixin = css`
11422
- &:hover {
11423
- background: ${_ref3 => {
11424
- let {
11425
- hasBg,
11426
- theme: {
11427
- palette
11428
- }
11429
- } = _ref3;
11430
- return hasBg ? palette.elementDark : "none";
11431
- }};
11432
- transition: background ${transition.hover};
11358
+ const r = Math.random; // eslint-disable-next-line id-length
11433
11359
 
11434
- > ${Icon}, ${IconButtonInnerChild} {
11435
- transition: all ${transition.hover};
11436
- }
11360
+ const s = 255;
11361
+ return `rgba(${o(r() * s)},${o(r() * s)},${o(r() * s)},${r().toFixed(1)})`;
11362
+ };
11363
+ function getTextWidth(value, font) {
11364
+ const canvas = document.createElement("canvas");
11365
+ const ctx = canvas.getContext("2d");
11366
+
11367
+ if (ctx) {
11368
+ ctx.font = font;
11369
+ return ctx.measureText(value).width;
11437
11370
  }
11438
- `;
11439
- const buttonMixin = css`
11440
- user-select: none;
11441
- position: relative;
11442
- display: flex;
11443
- align-items: center;
11444
- justify-content: center;
11445
- flex-direction: ${_ref4 => {
11446
- let {
11447
- iconRight
11448
- } = _ref4;
11449
- return iconRight ? "row-reverse" : "row";
11450
- }};
11451
- padding: 0 1rem;
11452
- height: 2.25rem;
11453
- width: ${props => props.notFixedWidth ? "auto" : "3rem"};
11454
- background: none;
11455
- border: none;
11456
- border-radius: 1.25rem;
11457
- outline: none;
11458
- cursor: pointer;
11459
- backface-visibility: hidden;
11460
- transform: translateZ(0) scale(1, 1);
11461
11371
 
11462
- ${_ref5 => {
11463
- let {
11464
- active
11465
- } = _ref5;
11466
- return active ? buttonActiveMixin : buttonHoverMixin;
11467
- }};
11372
+ return null;
11373
+ }
11468
11374
 
11469
- &:active > ${Icon} {
11470
- transform: scale(1.125, 1.125);
11471
- transition: all ${transition.press};
11472
- }
11375
+ const getFont = style => style ? `${style.fontWeight} ${style.fontSize} ${style.fontFamily}` : "";
11473
11376
 
11474
- ${Icon}, ${IconButtonInnerChild} {
11475
- display: block;
11476
- position: relative;
11477
- transition: color ${transition.release};
11377
+ function isTextFitElementWidth(text, element) {
11378
+ const style = window.getComputedStyle(element);
11379
+ const valueWidth = getTextWidth(text, getFont(style) || "") || 0;
11380
+ const spanWidth = element.getBoundingClientRect().width;
11381
+ return valueWidth <= spanWidth;
11382
+ } // eslint-disable-next-line @typescript-eslint/no-explicit-any
11478
11383
 
11479
- &:after {
11480
- display: block;
11481
- position: absolute;
11482
- left: 0;
11483
- z-index: 2;
11384
+ function sendRefSafety(refHandler, element) {
11385
+ if (refHandler) {
11386
+ if (typeof refHandler === "function") {
11387
+ refHandler(element);
11388
+ } else {
11389
+ refHandler.current = element;
11484
11390
  }
11485
11391
  }
11392
+ }
11393
+ const typeId = value => value; // eslint-disable-next-line @typescript-eslint/no-explicit-any
11486
11394
 
11487
- &[disabled],
11488
- ${InputContainer}[disabled] & {
11489
- ${Icon}, ${IconButtonInnerChild} {
11490
- color: ${_ref6 => {
11491
- let {
11492
- theme: {
11493
- iconButton
11494
- }
11495
- } = _ref6;
11496
- return iconButton.disabledColor;
11497
- }};
11498
- }
11499
- pointer-events: none;
11395
+ const isDefined = value => value !== null && value !== undefined;
11396
+ const isValidUrl = value => {
11397
+ try {
11398
+ new URL(value);
11399
+ } catch (_) {
11400
+ return false;
11500
11401
  }
11501
- `;
11502
- const IconButtonButton = /*#__PURE__*/styled.button.attrs(props => ({
11503
- tabIndex: -1,
11504
- ...props
11505
- }))`
11506
- flex-shrink: 0;
11507
11402
 
11508
- &:hover > ${Icon}, &:hover > ${IconButtonInnerChild} {
11509
- color: ${_ref7 => {
11510
- let {
11511
- theme: {
11512
- iconButton
11513
- },
11514
- ...props
11515
- } = _ref7;
11516
- return iconButton.hoverColor[getIconColors(props)];
11517
- }};
11518
- }
11403
+ return true;
11404
+ };
11405
+ const urlify = text => {
11406
+ const urlRegex = /(((https?:\/\/)|(www\.))[^\s]+)/g;
11407
+ const urls = text.match(urlRegex);
11408
+ const textParts = text.split(" ");
11409
+ return React.createElement(React.Fragment, null, textParts.map(part => {
11410
+ const currentUrl = urls == null ? void 0 : urls.find(url => url === part);
11411
+ return currentUrl ? React.createElement(ValueLink, {
11412
+ key: part,
11413
+ href: currentUrl,
11414
+ target: "_blank"
11415
+ }, `${currentUrl} `) : React.createElement("span", {
11416
+ key: part
11417
+ }, `${part} `);
11418
+ }));
11419
+ };
11420
+ const getNumberFromPixels = pixels => typeof pixels === "string" && +pixels.slice(0, -2) || 0;
11421
+ const FILE_SIZE_STEP = 1024;
11422
+ const MB_FILE_SIZE = FILE_SIZE_STEP * FILE_SIZE_STEP;
11519
11423
 
11520
- &:active > ${Icon}, &:active > ${IconButtonInnerChild} {
11521
- color: ${_ref8 => {
11522
- let {
11523
- theme: {
11524
- iconButton
11525
- },
11526
- ...props
11527
- } = _ref8;
11528
- return iconButton.activeColor[getIconColors(props)];
11529
- }};
11530
- }
11424
+ const getFixedFileSize = (bytes, fileSizeStep) => bytes % fileSizeStep === 0 ? bytes / fileSizeStep : (bytes / fileSizeStep).toFixed(2);
11531
11425
 
11532
- ${Icon}, ${IconButtonInnerChild} {
11533
- color: ${_ref9 => {
11534
- let {
11535
- theme: {
11536
- iconButton
11537
- },
11538
- ...props
11539
- } = _ref9;
11540
- return iconButton.color[getIconColors(props)];
11541
- }};
11426
+ const fileSizeFormat = function (bytes) {
11427
+ if (bytes === void 0) {
11428
+ bytes = 0;
11542
11429
  }
11543
11430
 
11544
- ${IconButtonInnerChild} {
11545
- margin: ${_ref10 => {
11546
- let {
11547
- iconRight
11548
- } = _ref10;
11549
- return iconRight ? "0 0.5rem 0 0" : "0 0 0 0.5rem";
11550
- }};
11431
+ return bytes >= MB_FILE_SIZE ? `${getFixedFileSize(bytes, MB_FILE_SIZE)} mb` : `${getFixedFileSize(bytes, FILE_SIZE_STEP)} kb`;
11432
+ };
11433
+ const getHighlightParts = (text, highlightText) => {
11434
+ const matches = AutosuggestHighlightMatch(text || "", highlightText);
11435
+ return AutosuggestHighlightParse(text || "", matches);
11436
+ };
11437
+ const sortNumbers = (a, b) => a - b;
11438
+ const getUnicodeFromString = code => {
11439
+ const num = Number(code);
11440
+
11441
+ if (!isNaN(num)) {
11442
+ return String.fromCodePoint(num);
11551
11443
  }
11552
11444
 
11553
- ${buttonMixin};
11554
- `;
11445
+ return null;
11446
+ };
11555
11447
 
11556
- const IconButtonComponent = _ref => {
11448
+ const getTippyProps = _ref => {
11557
11449
  let {
11558
- kind,
11450
+ onRequestClose,
11451
+ onCreate,
11559
11452
  children,
11560
- innerRef,
11561
- icon,
11562
- tabIndex = -1,
11563
- ...props
11453
+ content,
11454
+ isManualTrigger,
11455
+ isVisible,
11456
+ light,
11457
+ dark,
11458
+ hasContentScroll,
11459
+ hidden,
11460
+ className,
11461
+ indent = 0,
11462
+ distance = 0,
11463
+ flip = true,
11464
+ ...rest
11564
11465
  } = _ref;
11565
- return React.createElement(IconButtonButton, Object.assign({
11566
- ref: innerRef,
11567
- notFixedWidth: !!children,
11568
- tabIndex: tabIndex
11569
- }, props), icon || React.createElement(Icon, {
11570
- kind: kind
11571
- }), children && React.createElement(IconButtonInnerChild, null, children));
11466
+ return {
11467
+ theme: light ? "light" : dark ? "dark" : "none",
11468
+ offset: [indent, distance],
11469
+ popperOptions: {
11470
+ modifiers: flip ? [{
11471
+ name: "flip",
11472
+ options: {
11473
+ flipVariations: false
11474
+ }
11475
+ }] : []
11476
+ },
11477
+ ...rest
11478
+ };
11572
11479
  };
11573
11480
 
11574
- const IconButton = /*#__PURE__*/memo(IconButtonComponent);
11481
+ class Tippy extends Component {
11482
+ constructor() {
11483
+ super(...arguments);
11484
+ this.container = typeof document !== "undefined" ? document.createElement("div") : void 0;
11575
11485
 
11576
- const ChipContainer = styled.span`
11577
- display: inline-flex;
11578
- align-items: center;
11579
- padding: 0.3125rem 0.6875rem;
11580
- background-color: ${_ref => {
11581
- let {
11582
- theme: {
11583
- chip
11584
- },
11585
- ...props
11586
- } = _ref;
11587
- return chip.backgroundColor[getVariant(props)];
11588
- }};
11589
- border-radius: ${_ref2 => {
11590
- let {
11591
- theme: {
11592
- borderRadius
11593
- }
11594
- } = _ref2;
11595
- return borderRadius.large;
11596
- }};
11597
- `;
11598
- const Text = styled.span`
11599
- font: ${_ref3 => {
11600
- let {
11601
- theme: {
11602
- fonts
11603
- }
11604
- } = _ref3;
11605
- return fonts.description;
11606
- }};
11607
- color: ${_ref4 => {
11608
- let {
11609
- theme: {
11610
- palette
11611
- },
11612
- isStandard,
11613
- disabled
11614
- } = _ref4;
11615
- return disabled ? palette.textDisabled : isStandard ? palette.textPrimary : "#fff";
11616
- }};
11617
- `;
11618
- const iconButtonMixin = css`
11619
- && {
11620
- height: 0.875rem;
11621
- width: 0.875rem;
11622
- margin-left: 0.875rem;
11623
- cursor: pointer;
11486
+ this.onRef = node => {
11487
+ if (node && (!this.tip || this.tip.reference !== node)) {
11488
+ this.tip = tippy(node, getTippyProps(this.props));
11489
+ this.setContent();
11624
11490
 
11625
- ${Icon} {
11626
- height: 10px;
11627
- width: 11px;
11491
+ if (this.props.hidden) {
11492
+ var _this$tip, _this$tip2;
11628
11493
 
11629
- &:after {
11630
- font-size: 0.6875rem;
11631
- color: ${_ref5 => {
11632
- let {
11633
- theme: {
11634
- palette
11635
- }
11636
- } = _ref5;
11637
- return palette.textSecondary;
11638
- }};
11494
+ (_this$tip = this.tip) == null ? void 0 : _this$tip.hide();
11495
+ (_this$tip2 = this.tip) == null ? void 0 : _this$tip2.disable();
11496
+ }
11639
11497
  }
11640
- }
11641
- }
11642
- `;
11643
- const ActionButton = /*#__PURE__*/styled(IconButton)`
11644
- ${iconButtonMixin};
11645
- `;
11646
- const RegularIconButton = /*#__PURE__*/styled(IconButton)`
11647
- ${iconButtonMixin};
11648
- `;
11649
- const TooltipContent = styled.div`
11650
- max-width: 15rem;
11651
- `;
11652
-
11653
- const DATE_FORMAT = "dd.MM.yyyy";
11654
- const TIME_FORMAT = "HH:mm:ss";
11655
- const SEPARATED_TIME_FORMAT = "HH : mm : ss";
11656
- const DATE_TIME_FORMAT = /*#__PURE__*/[DATE_FORMAT, TIME_FORMAT].join(" ");
11657
- const dateFormat = (value, withTime) => withTime ? format(value, DATE_TIME_FORMAT) : format(value, DATE_FORMAT);
11658
- const rangeValueFormat = _ref => {
11659
- let {
11660
- value,
11661
- endValue,
11662
- withTime
11663
- } = _ref;
11664
- if (!value) return "";
11665
- const formattedValue = dateFormat(value, withTime);
11666
- const formattedEndValue = !endValue ? "" : dateFormat(endValue, withTime);
11667
- return endValue ? `${formattedValue} - ${formattedEndValue}` : formattedValue;
11668
- };
11669
- const getLocale = value => {
11670
- switch (value) {
11671
- case "en":
11672
- return en;
11498
+ };
11673
11499
 
11674
- case "it":
11675
- return it;
11500
+ this.closeOnOutsideEvent = e => {
11501
+ const {
11502
+ isVisible,
11503
+ onRequestClose
11504
+ } = this.props;
11676
11505
 
11677
- case "de":
11678
- return de;
11506
+ if (isVisible && onRequestClose && isOutside(this.container, e.target)) {
11507
+ onRequestClose(e);
11508
+ }
11509
+ };
11679
11510
 
11680
- default:
11681
- return Locale;
11511
+ this.closeOnScrollEvent = e => {
11512
+ const {
11513
+ hasContentScroll
11514
+ } = this.props;
11515
+ !hasContentScroll && this.closeOnOutsideEvent(e);
11516
+ };
11682
11517
  }
11683
- };
11684
-
11685
- const isTouchDevice = () => "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
11686
-
11687
- const preventDefault = e => {
11688
- e.preventDefault();
11689
- };
11690
-
11691
- function randomInteger(min, max) {
11692
- const random = min - 0.5 + Math.random() * (max - min + 1);
11693
- return Math.round(random);
11694
- }
11695
- const toNumber = value => Number((value || 0).toString().replace(/\s/g, ""));
11696
- const clamp = (value, max, min) => Math.max(Math.min(value, toNumber(max)), toNumber(min));
11697
11518
 
11698
- const getRealChildren = array => {
11699
- return Children.toArray(array).filter(child => !!child);
11700
- };
11519
+ setContent() {
11520
+ const {
11521
+ content
11522
+ } = this.props;
11701
11523
 
11702
- const Link = styled.a`
11703
- text-decoration: none;
11704
- font: ${_ref => {
11705
- let {
11706
- theme: {
11707
- fonts
11708
- },
11709
- description
11710
- } = _ref;
11711
- return description ? fonts.description : fonts.standard;
11712
- }};
11713
- color: ${_ref2 => {
11714
- let {
11715
- theme: {
11716
- link
11717
- },
11718
- ...props
11719
- } = _ref2;
11720
- return link.color[getLinkColors(props)];
11721
- }};
11722
- cursor: pointer;
11524
+ if (!this.container || !this.tip) {
11525
+ return;
11526
+ }
11723
11527
 
11724
- &:hover {
11725
- color: ${_ref3 => {
11726
- let {
11727
- theme: {
11728
- link
11729
- },
11730
- ...props
11731
- } = _ref3;
11732
- return link.hoverColor[getLinkColors(props)];
11733
- }};
11528
+ if (isValidElement(content)) {
11529
+ this.tip.setContent(this.container);
11530
+ } else if (typeof content === "string") {
11531
+ this.tip.setContent(content);
11532
+ }
11734
11533
  }
11735
11534
 
11736
- &:active {
11737
- color: ${_ref4 => {
11738
- let {
11739
- theme: {
11740
- link
11741
- },
11742
- ...props
11743
- } = _ref4;
11744
- return link.activeColor[getLinkColors(props)];
11745
- }};
11746
- }
11535
+ manualTrigger() {
11536
+ const {
11537
+ isVisible
11538
+ } = this.props;
11747
11539
 
11748
- &:visited {
11749
- color: ${_ref5 => {
11750
- let {
11751
- theme: {
11752
- link
11540
+ if (isVisible) {
11541
+ this.tip && this.tip.show();
11542
+ } else {
11543
+ this.tip && this.tip.hide();
11753
11544
  }
11754
- } = _ref5;
11755
- return link.visitedColor;
11756
- }};
11757
11545
  }
11758
- `;
11759
- const ValueLink = styled.a`
11760
- color: ${_ref6 => {
11761
- let {
11762
- theme: {
11763
- link
11764
- }
11765
- } = _ref6;
11766
- return link.color.primary;
11767
- }};
11768
- text-decoration: none;
11769
- `;
11770
-
11771
- const isReactDomElement = Element => typeof Element === "object" && Element !== null && typeof Element.type === "string"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
11772
11546
 
11773
- const isReactElement = Element => typeof Element === "object" && Element !== null && !!Element.$$typeof; // eslint-disable-next-line @typescript-eslint/no-explicit-any
11547
+ addListeners() {
11548
+ setTimeout(() => {
11549
+ // eslint-disable-next-line no-restricted-globals
11550
+ addEventListener("click", this.closeOnOutsideEvent); // eslint-disable-next-line no-restricted-globals
11774
11551
 
11775
- const isDomNode = x => // eslint-disable-next-line @typescript-eslint/no-explicit-any
11776
- typeof window.Node === "object" ? // eslint-disable-next-line @typescript-eslint/no-explicit-any
11777
- x instanceof window.Node : x !== null && typeof x === "object" && typeof x.nodeType === "number" && typeof x.nodeName === "string";
11778
- const combineRefs = function () {
11779
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
11780
- refs[_key] = arguments[_key];
11552
+ addEventListener("scroll", this.closeOnScrollEvent, true);
11553
+ }, 0);
11781
11554
  }
11782
11555
 
11783
- return refElement => refs.forEach(ref => {
11784
- if (typeof ref === "function") {
11785
- ref(refElement);
11786
- }
11787
- });
11788
- }; // TODO:HACK: из за отстутсвия innerRef у styled компонентов
11789
- // был создан такой хак распознавания является ли
11790
- // стилизованный компонент простым (div, span, form, ...)
11791
- // так как у таких компонентов нужно использовать `ref`
11792
- // у других, имеющие вложенность нужно использовать `innerRef`
11793
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
11556
+ removeListeners() {
11557
+ // eslint-disable-next-line no-restricted-globals
11558
+ removeEventListener("click", this.closeOnOutsideEvent); // eslint-disable-next-line no-restricted-globals
11794
11559
 
11795
- const isSimpleStyledComponent = Element => // eslint-disable-next-line @typescript-eslint/no-explicit-any
11796
- Element && Element.target && styled[Element.target] || // eslint-disable-next-line @typescript-eslint/no-explicit-any
11797
- Element.type && Element.type.target && styled[Element.type.target]; // eslint-disable-next-line @typescript-eslint/no-explicit-any
11560
+ removeEventListener("scroll", this.closeOnScrollEvent);
11561
+ }
11798
11562
 
11799
- const cloneWithRefs = (Element, ref) => {
11800
- const refProp = isReactDomElement(Element) ? "ref" : isSimpleStyledComponent(Element) ? "ref" : "innerRef";
11801
- return cloneElement(Element, { ...Element.props,
11802
- [refProp]: combineRefs(ref, Element.props[refProp])
11803
- });
11804
- }; // https://github.com/mui-org/material-ui/blob/v1-beta/src/utils/ClickAwayListener.js
11563
+ componentDidMount() {
11564
+ const {
11565
+ onCreate,
11566
+ isManualTrigger,
11567
+ isVisible
11568
+ } = this.props;
11569
+ onCreate && onCreate(this.tip);
11805
11570
 
11806
- const isDescendant = (el, target) => {
11807
- if (target !== null && target.parentNode) {
11808
- return el === target || isDescendant(el, target.parentNode);
11571
+ if (isManualTrigger && isVisible) {
11572
+ this.manualTrigger();
11573
+ this.addListeners();
11574
+ }
11809
11575
  }
11810
11576
 
11811
- return false;
11812
- };
11813
- const isOutside = (el, target) => document.contains(target) && !isDescendant(el, target); // eslint-disable-next-line @typescript-eslint/no-explicit-any
11814
-
11815
- const isNumeric = number => !isNaN(parseFloat(number)) && isFinite(number);
11816
- const randomRgba = () => {
11817
- // eslint-disable-next-line id-length
11818
- const o = Math.round; // eslint-disable-next-line id-length
11577
+ componentDidUpdate(_ref) {
11578
+ let {
11579
+ content: prevContent,
11580
+ isVisible: prevIsVisible,
11581
+ hidden: prevIsHidden
11582
+ } = _ref;
11583
+ const {
11584
+ isManualTrigger,
11585
+ isVisible,
11586
+ content,
11587
+ hidden
11588
+ } = this.props;
11819
11589
 
11820
- const r = Math.random; // eslint-disable-next-line id-length
11590
+ if (!prevIsHidden && hidden) {
11591
+ var _this$tip3, _this$tip4;
11821
11592
 
11822
- const s = 255;
11823
- return `rgba(${o(r() * s)},${o(r() * s)},${o(r() * s)},${r().toFixed(1)})`;
11824
- };
11825
- function getTextWidth(value, font) {
11826
- const canvas = document.createElement("canvas");
11827
- const ctx = canvas.getContext("2d");
11593
+ (_this$tip3 = this.tip) == null ? void 0 : _this$tip3.hide();
11594
+ (_this$tip4 = this.tip) == null ? void 0 : _this$tip4.disable();
11595
+ } else if (prevIsHidden && !hidden) {
11596
+ var _this$tip5, _this$tip6;
11828
11597
 
11829
- if (ctx) {
11830
- ctx.font = font;
11831
- return ctx.measureText(value).width;
11832
- }
11598
+ (_this$tip5 = this.tip) == null ? void 0 : _this$tip5.show();
11599
+ (_this$tip6 = this.tip) == null ? void 0 : _this$tip6.enable();
11600
+ }
11833
11601
 
11834
- return null;
11835
- }
11602
+ this.tip && this.tip.setProps(getTippyProps(this.props));
11603
+ isManualTrigger && this.manualTrigger();
11836
11604
 
11837
- const getFont = style => style ? `${style.fontWeight} ${style.fontSize} ${style.fontFamily}` : "";
11605
+ if (isManualTrigger && isVisible && !prevIsVisible) {
11606
+ this.addListeners();
11607
+ }
11838
11608
 
11839
- function isTextFitElementWidth(text, element) {
11840
- const style = window.getComputedStyle(element);
11841
- const valueWidth = getTextWidth(text, getFont(style) || "") || 0;
11842
- const spanWidth = element.getBoundingClientRect().width;
11843
- return valueWidth <= spanWidth;
11844
- } // eslint-disable-next-line @typescript-eslint/no-explicit-any
11609
+ if (isManualTrigger && !isVisible && prevIsVisible) {
11610
+ this.removeListeners();
11611
+ }
11845
11612
 
11846
- function sendRefSafety(refHandler, element) {
11847
- if (refHandler) {
11848
- if (typeof refHandler === "function") {
11849
- refHandler(element);
11850
- } else {
11851
- refHandler.current = element;
11613
+ if (prevContent !== content && typeof content === "string") {
11614
+ this.setContent();
11852
11615
  }
11853
11616
  }
11854
- }
11855
- const typeId = value => value; // eslint-disable-next-line @typescript-eslint/no-explicit-any
11856
11617
 
11857
- const isDefined = value => value !== null && value !== undefined;
11858
- const isValidUrl = value => {
11859
- try {
11860
- new URL(value);
11861
- } catch (_) {
11862
- return false;
11618
+ componentWillUnmount() {
11619
+ this.tip && this.tip.destroy();
11620
+ delete this.tip;
11621
+ delete this.container;
11622
+ this.removeListeners();
11863
11623
  }
11864
11624
 
11865
- return true;
11866
- };
11867
- const urlify = text => {
11868
- const urlRegex = /(((https?:\/\/)|(www\.))[^\s]+)/g;
11869
- const urls = text.match(urlRegex);
11870
- const textParts = text.split(" ");
11871
- return React.createElement(React.Fragment, null, textParts.map(part => {
11872
- const currentUrl = urls == null ? void 0 : urls.find(url => url === part);
11873
- return currentUrl ? React.createElement(ValueLink, {
11874
- key: part,
11875
- href: currentUrl,
11876
- target: "_blank"
11877
- }, `${currentUrl} `) : React.createElement("span", {
11878
- key: part
11879
- }, `${part} `);
11880
- }));
11881
- };
11882
- const getNumberFromPixels = pixels => typeof pixels === "string" && +pixels.slice(0, -2) || 0;
11883
- const FILE_SIZE_STEP = 1024;
11884
- const MB_FILE_SIZE = FILE_SIZE_STEP * FILE_SIZE_STEP;
11885
-
11886
- const getFixedFileSize = (bytes, fileSizeStep) => bytes % fileSizeStep === 0 ? bytes / fileSizeStep : (bytes / fileSizeStep).toFixed(2);
11887
-
11888
- const fileSizeFormat = function (bytes) {
11889
- if (bytes === void 0) {
11890
- bytes = 0;
11891
- }
11892
-
11893
- return bytes >= MB_FILE_SIZE ? `${getFixedFileSize(bytes, MB_FILE_SIZE)} mb` : `${getFixedFileSize(bytes, FILE_SIZE_STEP)} kb`;
11894
- };
11895
- const getHighlightParts = (text, highlightText) => {
11896
- const matches = AutosuggestHighlightMatch(text || "", highlightText);
11897
- return AutosuggestHighlightParse(text || "", matches);
11898
- };
11899
- const sortNumbers = (a, b) => a - b;
11900
- const getUnicodeFromString = code => {
11901
- const num = Number(code);
11902
-
11903
- if (!isNaN(num)) {
11904
- return String.fromCodePoint(num);
11905
- }
11906
-
11907
- return null;
11908
- };
11909
-
11910
- const getTippyProps = _ref => {
11911
- let {
11912
- onRequestClose,
11913
- onCreate,
11914
- children,
11915
- content,
11916
- isManualTrigger,
11917
- isVisible,
11918
- light,
11919
- dark,
11920
- hasContentScroll,
11921
- hidden,
11922
- className,
11923
- indent = 0,
11924
- distance = 0,
11925
- flip = true,
11926
- ...rest
11927
- } = _ref;
11928
- return {
11929
- theme: light ? "light" : dark ? "dark" : "none",
11930
- offset: [indent, distance],
11931
- popperOptions: {
11932
- modifiers: flip ? [{
11933
- name: "flip",
11934
- options: {
11935
- flipVariations: false
11936
- }
11937
- }] : []
11938
- },
11939
- ...rest
11940
- };
11941
- };
11942
-
11943
- class Tippy extends Component {
11944
- constructor() {
11945
- super(...arguments);
11946
- this.container = typeof document !== "undefined" ? document.createElement("div") : void 0;
11947
-
11948
- this.onRef = node => {
11949
- if (node && (!this.tip || this.tip.reference !== node)) {
11950
- this.tip = tippy(node, getTippyProps(this.props));
11951
- this.setContent();
11952
-
11953
- if (this.props.hidden) {
11954
- var _this$tip, _this$tip2;
11955
-
11956
- (_this$tip = this.tip) == null ? void 0 : _this$tip.hide();
11957
- (_this$tip2 = this.tip) == null ? void 0 : _this$tip2.disable();
11958
- }
11959
- }
11960
- };
11961
-
11962
- this.closeOnOutsideEvent = e => {
11963
- const {
11964
- isVisible,
11965
- onRequestClose
11966
- } = this.props;
11967
-
11968
- if (isVisible && onRequestClose && isOutside(this.container, e.target)) {
11969
- onRequestClose(e);
11970
- }
11971
- };
11972
-
11973
- this.closeOnScrollEvent = e => {
11974
- const {
11975
- hasContentScroll
11976
- } = this.props;
11977
- !hasContentScroll && this.closeOnOutsideEvent(e);
11978
- };
11979
- }
11980
-
11981
- setContent() {
11982
- const {
11983
- content
11984
- } = this.props;
11985
-
11986
- if (!this.container || !this.tip) {
11987
- return;
11988
- }
11989
-
11990
- if (isValidElement(content)) {
11991
- this.tip.setContent(this.container);
11992
- } else if (typeof content === "string") {
11993
- this.tip.setContent(content);
11994
- }
11995
- }
11996
-
11997
- manualTrigger() {
11998
- const {
11999
- isVisible
12000
- } = this.props;
12001
-
12002
- if (isVisible) {
12003
- this.tip && this.tip.show();
12004
- } else {
12005
- this.tip && this.tip.hide();
12006
- }
12007
- }
12008
-
12009
- addListeners() {
12010
- setTimeout(() => {
12011
- // eslint-disable-next-line no-restricted-globals
12012
- addEventListener("click", this.closeOnOutsideEvent); // eslint-disable-next-line no-restricted-globals
12013
-
12014
- addEventListener("scroll", this.closeOnScrollEvent, true);
12015
- }, 0);
12016
- }
12017
-
12018
- removeListeners() {
12019
- // eslint-disable-next-line no-restricted-globals
12020
- removeEventListener("click", this.closeOnOutsideEvent); // eslint-disable-next-line no-restricted-globals
12021
-
12022
- removeEventListener("scroll", this.closeOnScrollEvent);
12023
- }
12024
-
12025
- componentDidMount() {
12026
- const {
12027
- onCreate,
12028
- isManualTrigger,
12029
- isVisible
12030
- } = this.props;
12031
- onCreate && onCreate(this.tip);
12032
-
12033
- if (isManualTrigger && isVisible) {
12034
- this.manualTrigger();
12035
- this.addListeners();
12036
- }
12037
- }
12038
-
12039
- componentDidUpdate(_ref) {
12040
- let {
12041
- content: prevContent,
12042
- isVisible: prevIsVisible,
12043
- hidden: prevIsHidden
12044
- } = _ref;
12045
- const {
12046
- isManualTrigger,
12047
- isVisible,
12048
- content,
12049
- hidden
12050
- } = this.props;
12051
-
12052
- if (!prevIsHidden && hidden) {
12053
- var _this$tip3, _this$tip4;
12054
-
12055
- (_this$tip3 = this.tip) == null ? void 0 : _this$tip3.hide();
12056
- (_this$tip4 = this.tip) == null ? void 0 : _this$tip4.disable();
12057
- } else if (prevIsHidden && !hidden) {
12058
- var _this$tip5, _this$tip6;
12059
-
12060
- (_this$tip5 = this.tip) == null ? void 0 : _this$tip5.show();
12061
- (_this$tip6 = this.tip) == null ? void 0 : _this$tip6.enable();
12062
- }
12063
-
12064
- this.tip && this.tip.setProps(getTippyProps(this.props));
12065
- isManualTrigger && this.manualTrigger();
12066
-
12067
- if (isManualTrigger && isVisible && !prevIsVisible) {
12068
- this.addListeners();
12069
- }
12070
-
12071
- if (isManualTrigger && !isVisible && prevIsVisible) {
12072
- this.removeListeners();
12073
- }
12074
-
12075
- if (prevContent !== content && typeof content === "string") {
12076
- this.setContent();
12077
- }
12078
- }
12079
-
12080
- componentWillUnmount() {
12081
- this.tip && this.tip.destroy();
12082
- delete this.tip;
12083
- delete this.container;
12084
- this.removeListeners();
12085
- }
12086
-
12087
- render() {
12088
- const {
12089
- content,
12090
- children
12091
- } = this.props;
12092
- return React.createElement(React.Fragment, null, typeof children === "function" && children(this.onRef), this.container && isValidElement(content) && createPortal(content, this.container));
12093
- }
12094
-
12095
- }
12096
- Tippy.defaultProps = {
12097
- delay: [1000, 1000],
12098
- duration: [100, 100],
12099
- isManualTrigger: true,
12100
- distance: 8,
12101
- indent: -6,
12102
- arrow: false
11625
+ render() {
11626
+ const {
11627
+ content,
11628
+ children
11629
+ } = this.props;
11630
+ return React.createElement(React.Fragment, null, typeof children === "function" && children(this.onRef), this.container && isValidElement(content) && createPortal(content, this.container));
11631
+ }
11632
+
11633
+ }
11634
+ Tippy.defaultProps = {
11635
+ delay: [1000, 1000],
11636
+ duration: [100, 100],
11637
+ isManualTrigger: true,
11638
+ distance: 8,
11639
+ indent: -6,
11640
+ arrow: false
12103
11641
  };
12104
11642
 
12105
11643
  const cornerSize = "6px";
@@ -12256,228 +11794,10 @@ const Tooltip = /*#__PURE__*/styled(Tippy).attrs(props => ({
12256
11794
  ${tippyMixin}
12257
11795
  `;
12258
11796
 
12259
- const ChipComponent = _ref => {
11797
+ const WithLabelContainer = styled.div`
11798
+ width: ${_ref => {
12260
11799
  let {
12261
- text,
12262
- primary,
12263
- secondary,
12264
- error,
12265
- additionalButton,
12266
- additionalAction,
12267
- onRemove,
12268
- additionalButtonTooltip,
12269
- removeButtonTooltip,
12270
- disabled,
12271
- tooltipDelay = 300,
12272
- onMouseDown,
12273
- children,
12274
- ...props
12275
- } = _ref;
12276
- const remove = useCallback(e => {
12277
- onRemove && onRemove(text, e);
12278
- }, [onRemove, text]);
12279
- const isStandard = !primary && !secondary && !error;
12280
- return React.createElement(ChipContainer, Object.assign({
12281
- primary: primary,
12282
- secondary: secondary,
12283
- error: error
12284
- }, props), children, React.createElement(Text, {
12285
- isStandard: isStandard,
12286
- disabled: disabled
12287
- }, text), React.createElement(ThemeProvider, {
12288
- theme: isStandard ? theme : theme$1
12289
- }, React.createElement(React.Fragment, null, additionalButton && (additionalButtonTooltip ? React.createElement(Tooltip, {
12290
- arrow: true,
12291
- placement: "top",
12292
- content: React.createElement(TooltipContent, null, additionalButtonTooltip),
12293
- delay: tooltipDelay ? [tooltipDelay, tooltipDelay] : undefined
12294
- }, ref => React.createElement(ActionButton, {
12295
- kind: additionalButton,
12296
- onClick: additionalAction,
12297
- innerRef: ref
12298
- })) : React.createElement(RegularIconButton, {
12299
- kind: additionalButton,
12300
- onClick: additionalAction
12301
- })), !!onRemove && (removeButtonTooltip ? React.createElement(Tooltip, {
12302
- arrow: true,
12303
- placement: "top",
12304
- content: React.createElement(TooltipContent, null, removeButtonTooltip),
12305
- delay: tooltipDelay ? [tooltipDelay, tooltipDelay] : undefined
12306
- }, ref => React.createElement(ActionButton, {
12307
- kind: "close",
12308
- innerRef: ref,
12309
- onClick: e => {
12310
- e.stopPropagation();
12311
- remove(e);
12312
- }
12313
- })) : React.createElement(RegularIconButton, {
12314
- kind: "close",
12315
- onMouseDown: e => e.stopPropagation(),
12316
- onClick: e => {
12317
- e.stopPropagation();
12318
- remove(e);
12319
- }
12320
- })))));
12321
- };
12322
-
12323
- const Chip = /*#__PURE__*/memo(ChipComponent);
12324
-
12325
- const WideChip = /*#__PURE__*/styled(_ref => {
12326
- let { ...props
12327
- } = _ref;
12328
- return React.createElement(Chip, Object.assign({}, props));
12329
- })`
12330
- height: 1rem;
12331
- cursor: default;
12332
-
12333
- ${ChipContainer} {
12334
- width: 100%;
12335
- justify-content: space-between;
12336
- }
12337
- `;
12338
-
12339
- const CheckMark = /*#__PURE__*/styled(Icon)`
12340
- position: absolute;
12341
- right: -1.5rem;
12342
- color: ${_ref => {
12343
- let {
12344
- theme: {
12345
- palette
12346
- }
12347
- } = _ref;
12348
- return palette.primary;
12349
- }};
12350
- `;
12351
-
12352
- const InputComponent = _ref => {
12353
- var _valuePrefixRef$curre, _valuePrefixRef$curre2;
12354
-
12355
- let {
12356
- width = "14rem",
12357
- iconAfter,
12358
- iconBefore,
12359
- valuePrefix,
12360
- children,
12361
- disabled,
12362
- success,
12363
- innerRef,
12364
- disableInputOnly,
12365
- asChip,
12366
- onRemove,
12367
- active,
12368
- onMouseDown,
12369
- ...props
12370
- } = _ref;
12371
- const valuePrefixRef = useRef(null);
12372
- const [, setRefVisible] = useState(false);
12373
- const realChildren = getRealChildren(children);
12374
- const childrenCount = realChildren.length;
12375
- const paddingRight = childrenCount * 2 + (iconAfter ? 32 : 0);
12376
- return React.createElement(InputContainer, {
12377
- disabled: disabled,
12378
- error: props.error,
12379
- width: width,
12380
- active: active
12381
- }, iconBefore && React.createElement(IconBefore, {
12382
- onMouseDown: preventDefault
12383
- }, iconBefore), valuePrefix && React.createElement(ValuePrefix, {
12384
- onMouseDown: preventDefault,
12385
- ref: el => {
12386
- valuePrefixRef.current = el;
12387
- setRefVisible(!!el);
12388
- }
12389
- }, valuePrefix), props.value && asChip ? React.createElement(ChipInputHolder, {
12390
- paddingLeft: !!iconBefore,
12391
- paddingRight: paddingRight,
12392
- extraLeftPaddingWidth: ((_valuePrefixRef$curre = valuePrefixRef.current) == null ? void 0 : _valuePrefixRef$curre.getBoundingClientRect().width) ?? undefined,
12393
- ref: innerRef,
12394
- onMouseDown: onMouseDown
12395
- }, React.createElement(WideChip, {
12396
- text: `${props.value}`,
12397
- onRemove: onRemove,
12398
- onMouseDown: e => {
12399
- e.stopPropagation(); // @ts-ignore
12400
-
12401
- onMouseDown && onMouseDown(e);
12402
- },
12403
- primary: true
12404
- })) : React.createElement(StyledInput, Object.assign({
12405
- ref: innerRef,
12406
- width: width,
12407
- disabled: disabled || disableInputOnly,
12408
- paddingLeft: !!iconBefore,
12409
- extraLeftPaddingWidth: ((_valuePrefixRef$curre2 = valuePrefixRef.current) == null ? void 0 : _valuePrefixRef$curre2.getBoundingClientRect().width) ?? undefined,
12410
- paddingRight: paddingRight,
12411
- onMouseDown: onMouseDown
12412
- }, props)), iconAfter ? React.createElement(IconAfter, {
12413
- indent: 0
12414
- }, iconAfter) : React.createElement(React.Fragment, null, realChildren.map((child, index) => React.createElement(IconAfter, {
12415
- onMouseDown: preventDefault,
12416
- indent: 2 * index,
12417
- key: index
12418
- }, child))), success && React.createElement(CheckMark, {
12419
- kind: "success"
12420
- }));
12421
- };
12422
-
12423
- const Input = /*#__PURE__*/withLabel( /*#__PURE__*/memo(InputComponent));
12424
-
12425
- const InputLabel = styled.label`
12426
- display: inline-block;
12427
- padding: 0 0 0.25rem 0.5rem;
12428
- color: ${_ref => {
12429
- let {
12430
- theme: {
12431
- input
12432
- },
12433
- error,
12434
- active
12435
- } = _ref;
12436
- return error ? input.error : active ? input.active : input.labelColor;
12437
- }};
12438
- cursor: pointer;
12439
- font: ${_ref2 => {
12440
- let {
12441
- theme: {
12442
- fonts
12443
- }
12444
- } = _ref2;
12445
- return fonts.description;
12446
- }};
12447
-
12448
- &[disabled] {
12449
- pointer-events: none;
12450
- color: ${_ref3 => {
12451
- let {
12452
- theme: {
12453
- input
12454
- }
12455
- } = _ref3;
12456
- return input.disabledLabelColor;
12457
- }};
12458
- }
12459
- `;
12460
-
12461
- /* eslint-disable @typescript-eslint/no-explicit-any */
12462
- const MaskedComponent = /*#__PURE__*/IMaskMixin(_ref => {
12463
- let {
12464
- innerRef,
12465
- inputRef,
12466
- ...props
12467
- } = _ref;
12468
- const attachRef = useCallback(ref => {
12469
- sendRefSafety(inputRef, ref);
12470
- sendRefSafety(innerRef, ref);
12471
- }, [innerRef, inputRef]);
12472
- return React.createElement(Input, Object.assign({}, props, {
12473
- innerRef: attachRef
12474
- }));
12475
- });
12476
-
12477
- const WithLabelContainer = styled.div`
12478
- width: ${_ref => {
12479
- let {
12480
- width
11800
+ width
12481
11801
  } = _ref;
12482
11802
  return width || "100%";
12483
11803
  }};
@@ -12496,6 +11816,7 @@ const Asterisk = styled.span`
12496
11816
  } = _ref2;
12497
11817
  return palette.error;
12498
11818
  }};
11819
+
12499
11820
  :before {
12500
11821
  content: "*";
12501
11822
  }
@@ -12909,938 +12230,1374 @@ const CollapseComponent = _ref => {
12909
12230
  }, children)));
12910
12231
  };
12911
12232
 
12912
- const Collapse = /*#__PURE__*/memo(CollapseComponent);
12233
+ const Collapse = /*#__PURE__*/memo(CollapseComponent);
12234
+
12235
+ const Blank = styled.div`
12236
+ width: ${_ref => {
12237
+ let {
12238
+ width
12239
+ } = _ref;
12240
+ return width || "auto";
12241
+ }};
12242
+ height: ${_ref2 => {
12243
+ let {
12244
+ height
12245
+ } = _ref2;
12246
+ return height || "";
12247
+ }};
12248
+ max-height: ${_ref3 => {
12249
+ let {
12250
+ maxHeight
12251
+ } = _ref3;
12252
+ return maxHeight || "auto";
12253
+ }};
12254
+ min-width: ${_ref4 => {
12255
+ let {
12256
+ minWidth
12257
+ } = _ref4;
12258
+ return minWidth || "auto";
12259
+ }};
12260
+ background-color: ${_ref5 => {
12261
+ let {
12262
+ theme: {
12263
+ blank
12264
+ }
12265
+ } = _ref5;
12266
+ return blank.backgroundColor;
12267
+ }};
12268
+ box-shadow: ${_ref6 => {
12269
+ let {
12270
+ theme: {
12271
+ shadows
12272
+ },
12273
+ shadow
12274
+ } = _ref6;
12275
+ return shadows[shadow || "raised"];
12276
+ }};
12277
+ color: ${_ref7 => {
12278
+ let {
12279
+ theme: {
12280
+ palette
12281
+ }
12282
+ } = _ref7;
12283
+ return palette.textPrimary;
12284
+ }};
12285
+ border-radius: 0.375rem;
12286
+ line-height: initial;
12287
+ overflow-y: auto;
12288
+ `;
12289
+
12290
+ const BaseButton = styled.button`
12291
+ user-select: none;
12292
+ position: relative;
12293
+ font: ${_ref => {
12294
+ let {
12295
+ theme: {
12296
+ fonts
12297
+ }
12298
+ } = _ref;
12299
+ return fonts.button;
12300
+ }};
12301
+ border: none;
12302
+ outline: none;
12303
+ padding-left: 1em;
12304
+ padding-right: 1em;
12305
+ text-transform: uppercase;
12306
+ border-radius: ${_ref2 => {
12307
+ let {
12308
+ theme: {
12309
+ borderRadius
12310
+ }
12311
+ } = _ref2;
12312
+ return borderRadius.medium;
12313
+ }};
12314
+ min-height: 2.5em;
12315
+ max-height: 6em;
12316
+ box-sizing: border-box;
12317
+ ${/*#__PURE__*/ellipsis("18em")};
12318
+ cursor: pointer;
12319
+
12320
+ &:hover {
12321
+ transition: background-color ${transition.hover};
12322
+ }
12323
+
12324
+ &:active {
12325
+ transition: background-color ${transition.press}, box-shadow ${transition.press};
12326
+ }
12327
+
12328
+ &[disabled] {
12329
+ pointer-events: none;
12330
+ }
12331
+ `;
12332
+ const FlatButton = /*#__PURE__*/styled(BaseButton)`
12333
+ color: ${_ref3 => {
12334
+ let {
12335
+ theme: {
12336
+ flatButton
12337
+ },
12338
+ ...props
12339
+ } = _ref3;
12340
+ return flatButton.color[getVariant(props)];
12341
+ }};
12342
+ background-color: ${_ref4 => {
12343
+ let {
12344
+ theme: {
12345
+ flatButton
12346
+ }
12347
+ } = _ref4;
12348
+ return flatButton.backgroundColor;
12349
+ }};
12350
+
12351
+ &:hover {
12352
+ color: ${_ref5 => {
12353
+ let {
12354
+ theme: {
12355
+ flatButton
12356
+ },
12357
+ ...props
12358
+ } = _ref5;
12359
+ return flatButton.hoverColor[getVariant(props)];
12360
+ }};
12361
+ background-color: ${_ref6 => {
12362
+ let {
12363
+ theme: {
12364
+ flatButton
12365
+ }
12366
+ } = _ref6;
12367
+ return flatButton.hoverBackgroundColor;
12368
+ }};
12369
+ }
12370
+
12371
+ &:active {
12372
+ color: ${_ref7 => {
12373
+ let {
12374
+ theme: {
12375
+ flatButton
12376
+ },
12377
+ ...props
12378
+ } = _ref7;
12379
+ return flatButton.activeColor[getVariant(props)];
12380
+ }};
12381
+ background-color: ${_ref8 => {
12382
+ let {
12383
+ theme: {
12384
+ flatButton
12385
+ }
12386
+ } = _ref8;
12387
+ return flatButton.activeBackgroundColor;
12388
+ }};
12389
+ }
12390
+
12391
+ &[disabled] {
12392
+ color: ${_ref9 => {
12393
+ let {
12394
+ theme: {
12395
+ flatButton
12396
+ }
12397
+ } = _ref9;
12398
+ return flatButton.disabledColor;
12399
+ }};
12400
+ background-color: ${_ref10 => {
12401
+ let {
12402
+ theme: {
12403
+ flatButton
12404
+ }
12405
+ } = _ref10;
12406
+ return flatButton.disabledBackgroundColor;
12407
+ }};
12408
+ }
12409
+ `;
12410
+ const RaisedButton = /*#__PURE__*/styled(BaseButton)`
12411
+ color: ${_ref11 => {
12412
+ let {
12413
+ theme: {
12414
+ raisedButton
12415
+ },
12416
+ ...props
12417
+ } = _ref11;
12418
+ return raisedButton.color[getVariant(props)];
12419
+ }};
12420
+ background-color: ${_ref12 => {
12421
+ let {
12422
+ theme: {
12423
+ raisedButton
12424
+ },
12425
+ ...props
12426
+ } = _ref12;
12427
+ return raisedButton.backgroundColor[getVariant(props)];
12428
+ }};
12429
+ box-shadow: ${_ref13 => {
12430
+ let {
12431
+ theme: {
12432
+ shadows
12433
+ }
12434
+ } = _ref13;
12435
+ return shadows.normal;
12436
+ }};
12437
+
12438
+ &:hover {
12439
+ color: ${_ref14 => {
12440
+ let {
12441
+ theme: {
12442
+ raisedButton
12443
+ },
12444
+ ...props
12445
+ } = _ref14;
12446
+ return raisedButton.hoverColor[getVariant(props)];
12447
+ }};
12448
+ background-color: ${_ref15 => {
12449
+ let {
12450
+ theme: {
12451
+ raisedButton
12452
+ },
12453
+ ...props
12454
+ } = _ref15;
12455
+ return raisedButton.hoverBackgroundColor[getVariant(props)];
12456
+ }};
12457
+ }
12458
+
12459
+ &:active {
12460
+ color: ${_ref16 => {
12461
+ let {
12462
+ theme: {
12463
+ raisedButton
12464
+ },
12465
+ ...props
12466
+ } = _ref16;
12467
+ return raisedButton.activeColor[getVariant(props)];
12468
+ }};
12469
+ background-color: ${_ref17 => {
12470
+ let {
12471
+ theme: {
12472
+ raisedButton
12473
+ },
12474
+ ...props
12475
+ } = _ref17;
12476
+ return raisedButton.activeBackgroundColor[getVariant(props)];
12477
+ }};
12478
+ box-shadow: ${_ref18 => {
12479
+ let {
12480
+ theme: {
12481
+ shadows
12482
+ }
12483
+ } = _ref18;
12484
+ return shadows.pressed;
12485
+ }};
12486
+ }
12487
+
12488
+ &[disabled] {
12489
+ pointer-events: none;
12490
+ box-shadow: none;
12491
+ color: ${_ref19 => {
12492
+ let {
12493
+ theme: {
12494
+ raisedButton
12495
+ }
12496
+ } = _ref19;
12497
+ return raisedButton.disabledColor;
12498
+ }};
12499
+ background-color: ${_ref20 => {
12500
+ let {
12501
+ theme: {
12502
+ raisedButton
12503
+ }
12504
+ } = _ref20;
12505
+ return raisedButton.disabledBackgroundColor;
12506
+ }};
12507
+ }
12508
+ `;
12509
+
12510
+ const DEFAULT_LOADER_SIZE = "110px";
12913
12511
 
12914
- const Blank = styled.div`
12915
- width: ${_ref => {
12512
+ const setHeight = height => typeof height === "number" ? `${height}px` : typeof height === "undefined" ? DEFAULT_LOADER_SIZE : height;
12513
+
12514
+ const setWidth = width => typeof width === "number" ? `${width}px` : typeof width === "undefined" ? "100%" : width;
12515
+
12516
+ const CardLoaderPreview = styled.div`
12517
+ display: flex;
12518
+ flex-grow: 1;
12519
+ background-color: ${_ref => {
12916
12520
  let {
12917
- width
12521
+ theme
12918
12522
  } = _ref;
12919
- return width || "auto";
12523
+ return theme.palette.elementDark;
12920
12524
  }};
12921
- height: ${_ref2 => {
12525
+ `;
12526
+ const CardLoaderBar = styled.div`
12527
+ width: 100%;
12528
+ background-color: ${_ref2 => {
12922
12529
  let {
12923
- height
12530
+ theme
12924
12531
  } = _ref2;
12925
- return height || "";
12532
+ return theme.palette.elementDark;
12926
12533
  }};
12927
- max-height: ${_ref3 => {
12534
+ margin-bottom: 10px;
12535
+ border-radius: 0.75rem;
12536
+ `;
12537
+ const CardLoaderBars = styled.div`
12538
+ display: flex;
12539
+ flex-direction: column;
12540
+ width: 100%;
12541
+ `;
12542
+ const CardLoaderShining = styled.div`
12543
+ position: absolute;
12544
+ top: 0;
12545
+ left: 0;
12546
+ background-color: #333;
12547
+ width: 100%;
12548
+ animation-duration: 0.6s;
12549
+ animation-iteration-count: infinite;
12550
+ animation-name: loader-animate;
12551
+ animation-timing-function: linear;
12552
+ background: -webkit-linear-gradient(
12553
+ left,
12554
+ rgba(255, 255, 255, 0) 0%,
12555
+ rgba(255, 255, 255, 0.6) 30%,
12556
+ rgba(255, 255, 255, 0) 81%
12557
+ );
12558
+ background: -o-linear-gradient(
12559
+ left,
12560
+ rgba(255, 255, 255, 0) 0%,
12561
+ rgba(255, 255, 255, 0.6) 30%,
12562
+ rgba(255, 255, 255, 0) 81%
12563
+ );
12564
+ background: linear-gradient(
12565
+ to right,
12566
+ rgba(255, 255, 255, 0) 0%,
12567
+ rgba(255, 255, 255, 0.6) 30%,
12568
+ rgba(255, 255, 255, 0) 81%
12569
+ );
12570
+ filter: progid:DXImageTransform.Microsoft.gradient(
12571
+ startColorstr='#00ffffff',
12572
+ endColorstr='#00ffffff',
12573
+ GradientType=1);
12574
+
12575
+ @keyframes loader-animate {
12576
+ 0% {
12577
+ transform: translate3d(-100%, 0, 0);
12578
+ }
12579
+ 100% {
12580
+ transform: translate3d(100%, 0, 0);
12581
+ }
12582
+ }
12583
+ `;
12584
+ const CardLoaderContainer = styled.div`
12585
+ position: relative;
12586
+ display: flex;
12587
+ width: ${_ref3 => {
12928
12588
  let {
12929
- maxHeight
12589
+ width
12930
12590
  } = _ref3;
12931
- return maxHeight || "auto";
12591
+ return setWidth(width);
12932
12592
  }};
12933
- min-width: ${_ref4 => {
12593
+
12594
+ ${CardLoaderPreview} {
12595
+ height: ${_ref4 => {
12934
12596
  let {
12935
- minWidth
12597
+ height
12936
12598
  } = _ref4;
12937
- return minWidth || "auto";
12599
+ return setHeight(height);
12938
12600
  }};
12939
- background-color: ${_ref5 => {
12601
+ width: ${_ref5 => {
12940
12602
  let {
12941
- theme: {
12942
- blank
12943
- }
12603
+ height
12944
12604
  } = _ref5;
12945
- return blank.backgroundColor;
12605
+ return setHeight(height);
12946
12606
  }};
12947
- box-shadow: ${_ref6 => {
12607
+ min-height: ${_ref6 => {
12948
12608
  let {
12949
- theme: {
12950
- shadows
12951
- },
12952
- shadow
12609
+ height
12953
12610
  } = _ref6;
12954
- return shadows[shadow || "raised"];
12611
+ return setHeight(height);
12955
12612
  }};
12956
- color: ${_ref7 => {
12613
+ min-width: ${_ref7 => {
12957
12614
  let {
12958
- theme: {
12959
- palette
12960
- }
12615
+ height
12961
12616
  } = _ref7;
12962
- return palette.textPrimary;
12617
+ return setHeight(height);
12963
12618
  }};
12964
- border-radius: 0.375rem;
12965
- line-height: initial;
12966
- overflow-y: auto;
12967
- `;
12619
+ }
12968
12620
 
12969
- const BaseButton = styled.button`
12970
- user-select: none;
12971
- position: relative;
12972
- font: ${_ref => {
12973
- let {
12974
- theme: {
12975
- fonts
12976
- }
12977
- } = _ref;
12978
- return fonts.button;
12979
- }};
12980
- border: none;
12981
- outline: none;
12982
- padding-left: 1em;
12983
- padding-right: 1em;
12984
- text-transform: uppercase;
12985
- border-radius: ${_ref2 => {
12621
+ ${CardLoaderShining},
12622
+ ${CardLoaderBars} {
12623
+ height: ${_ref8 => {
12986
12624
  let {
12987
- theme: {
12988
- borderRadius
12989
- }
12990
- } = _ref2;
12991
- return borderRadius.medium;
12625
+ height
12626
+ } = _ref8;
12627
+ return setHeight(height);
12992
12628
  }};
12993
- min-height: 2.5em;
12994
- max-height: 6em;
12995
- box-sizing: border-box;
12996
- ${/*#__PURE__*/ellipsis("18em")};
12997
- cursor: pointer;
12998
-
12999
- &:hover {
13000
- transition: background-color ${transition.hover};
13001
12629
  }
13002
12630
 
13003
- &:active {
13004
- transition: background-color ${transition.press}, box-shadow ${transition.press};
12631
+ ${CardLoaderPreview} {
12632
+ margin-right: 0.75rem;
13005
12633
  }
13006
12634
 
13007
- &[disabled] {
13008
- pointer-events: none;
13009
- }
13010
- `;
13011
- const FlatButton = /*#__PURE__*/styled(BaseButton)`
13012
- color: ${_ref3 => {
12635
+ ${CardLoaderBars} {
12636
+ padding-top: calc(${_ref9 => {
13013
12637
  let {
13014
- theme: {
13015
- flatButton
13016
- },
13017
- ...props
13018
- } = _ref3;
13019
- return flatButton.color[getVariant(props)];
13020
- }};
13021
- background-color: ${_ref4 => {
12638
+ height
12639
+ } = _ref9;
12640
+ return setHeight(height);
12641
+ }} / 6);
12642
+ box-sizing: border-box;
12643
+
12644
+ ${CardLoaderBar} {
12645
+ &:first-child {
12646
+ height: calc(${_ref10 => {
13022
12647
  let {
13023
- theme: {
13024
- flatButton
12648
+ height
12649
+ } = _ref10;
12650
+ return setHeight(height);
12651
+ }} / 4);
12652
+ }
12653
+
12654
+ &:not(:first-child) {
12655
+ height: calc(${_ref11 => {
12656
+ let {
12657
+ height
12658
+ } = _ref11;
12659
+ return setHeight(height);
12660
+ }} / 6);
12661
+ }
13025
12662
  }
13026
- } = _ref4;
13027
- return flatButton.backgroundColor;
13028
- }};
12663
+ }
12664
+ `;
13029
12665
 
13030
- &:hover {
13031
- color: ${_ref5 => {
12666
+ const CardLoader = _ref => {
12667
+ let {
12668
+ animate = true,
12669
+ height,
12670
+ width
12671
+ } = _ref;
12672
+ return React.createElement(CardLoaderContainer, {
12673
+ height: height,
12674
+ width: width
12675
+ }, React.createElement(CardLoaderPreview, null), React.createElement(CardLoaderBars, null, React.createElement(CardLoaderBar, null), React.createElement(CardLoaderBar, null)), animate && React.createElement(CardLoaderShining, null));
12676
+ };
12677
+
12678
+ const DEFAULT_DIVIDER_SIZE = 1;
12679
+ const verticalDivider = css`
12680
+ height: inherit;
12681
+ border-left: ${_ref => {
12682
+ let {
12683
+ size
12684
+ } = _ref;
12685
+ return rem(size || 0);
12686
+ }} solid ${_ref2 => {
13032
12687
  let {
13033
12688
  theme: {
13034
- flatButton
13035
- },
13036
- ...props
13037
- } = _ref5;
13038
- return flatButton.hoverColor[getVariant(props)];
12689
+ divider
12690
+ }
12691
+ } = _ref2;
12692
+ return divider.color;
13039
12693
  }};
13040
- background-color: ${_ref6 => {
12694
+ `;
12695
+ const horizontalDivider = css`
12696
+ width: inherit;
12697
+ border-bottom: ${_ref3 => {
12698
+ let {
12699
+ size
12700
+ } = _ref3;
12701
+ return rem(size || 0);
12702
+ }} solid ${_ref4 => {
13041
12703
  let {
13042
12704
  theme: {
13043
- flatButton
12705
+ divider
13044
12706
  }
13045
- } = _ref6;
13046
- return flatButton.hoverBackgroundColor;
12707
+ } = _ref4;
12708
+ return divider.color;
13047
12709
  }};
13048
- }
12710
+ `;
12711
+ const Divider = /*#__PURE__*/styled.div.attrs(props => ({
12712
+ size: DEFAULT_DIVIDER_SIZE,
12713
+ ...props
12714
+ }))`
12715
+ display: flex;
12716
+ align-self: stretch;
12717
+ border-radius: 0.0625rem;
13049
12718
 
13050
- &:active {
13051
- color: ${_ref7 => {
12719
+ ${_ref5 => {
13052
12720
  let {
13053
- theme: {
13054
- flatButton
13055
- },
13056
- ...props
13057
- } = _ref7;
13058
- return flatButton.activeColor[getVariant(props)];
12721
+ horizontal,
12722
+ vertical
12723
+ } = _ref5;
12724
+ if (horizontal || !vertical) return horizontalDivider;
12725
+ return verticalDivider;
13059
12726
  }};
13060
- background-color: ${_ref8 => {
12727
+ `;
12728
+
12729
+ const ElementsArea = styled.div`
12730
+ background: ${_ref => {
13061
12731
  let {
13062
12732
  theme: {
13063
- flatButton
12733
+ elementsArea
13064
12734
  }
13065
- } = _ref8;
13066
- return flatButton.activeBackgroundColor;
12735
+ } = _ref;
12736
+ return elementsArea.backgroundColor;
13067
12737
  }};
13068
- }
12738
+ `;
13069
12739
 
13070
- &[disabled] {
13071
- color: ${_ref9 => {
12740
+ const setWidth$1 = width => typeof width === "number" ? `${width}px` : typeof width === "undefined" ? "auto" : width;
12741
+
12742
+ const Flex = styled.div`
12743
+ display: flex;
12744
+ flex-direction: ${_ref => {
13072
12745
  let {
13073
- theme: {
13074
- flatButton
13075
- }
13076
- } = _ref9;
13077
- return flatButton.disabledColor;
12746
+ column
12747
+ } = _ref;
12748
+ return column ? "column" : "row";
13078
12749
  }};
13079
- background-color: ${_ref10 => {
12750
+ width: 100%;
12751
+ gap: ${_ref2 => {
13080
12752
  let {
13081
- theme: {
13082
- flatButton
13083
- }
13084
- } = _ref10;
13085
- return flatButton.disabledBackgroundColor;
12753
+ gap
12754
+ } = _ref2;
12755
+ return gap;
13086
12756
  }};
13087
- }
12757
+ box-sizing: border-box;
12758
+ ${background}
12759
+ ${border}
12760
+ ${color}
12761
+ ${flexbox}
12762
+ ${fontSize}
12763
+ ${fontWeight}
12764
+ ${fontStyle}
12765
+ ${space}
12766
+ ${layout}
12767
+ ${textAlign}
12768
+ ${position}
12769
+ ${lineHeight}
13088
12770
  `;
13089
- const RaisedButton = /*#__PURE__*/styled(BaseButton)`
13090
- color: ${_ref11 => {
13091
- let {
13092
- theme: {
13093
- raisedButton
13094
- },
13095
- ...props
13096
- } = _ref11;
13097
- return raisedButton.color[getVariant(props)];
13098
- }};
13099
- background-color: ${_ref12 => {
12771
+ const FlexSpan = styled.span`
12772
+ box-sizing: border-box;
12773
+ width: ${_ref3 => {
13100
12774
  let {
13101
- theme: {
13102
- raisedButton
13103
- },
13104
- ...props
13105
- } = _ref12;
13106
- return raisedButton.backgroundColor[getVariant(props)];
12775
+ width
12776
+ } = _ref3;
12777
+ return setWidth$1(width);
13107
12778
  }};
13108
- box-shadow: ${_ref13 => {
12779
+ white-space: ${_ref4 => {
13109
12780
  let {
13110
- theme: {
13111
- shadows
13112
- }
13113
- } = _ref13;
13114
- return shadows.normal;
12781
+ whiteSpace
12782
+ } = _ref4;
12783
+ return whiteSpace;
13115
12784
  }};
12785
+ ${background}
12786
+ ${border}
12787
+ ${color}
12788
+ ${flexbox}
12789
+ ${fontSize}
12790
+ ${fontWeight}
12791
+ ${fontStyle}
12792
+ ${space}
12793
+ ${layout}
12794
+ ${textAlign}
12795
+ ${position}
12796
+ ${lineHeight}
12797
+ `;
13116
12798
 
13117
- &:hover {
13118
- color: ${_ref14 => {
12799
+ var LoadingStatus;
12800
+
12801
+ (function (LoadingStatus) {
12802
+ LoadingStatus["Loading"] = "loading";
12803
+ LoadingStatus["Ok"] = "ok";
12804
+ LoadingStatus["Error"] = "error";
12805
+ })(LoadingStatus || (LoadingStatus = {}));
12806
+
12807
+ const progressMove = keyframes`
12808
+ 0% {
12809
+ left: 0;
12810
+ }
12811
+ 33.3% {
12812
+ left: 0;
12813
+ }
12814
+ 100% {
12815
+ left: 100%;
12816
+ }
12817
+ `;
12818
+ const progressGrow = keyframes`
12819
+ 0% {
12820
+ width: 0;
12821
+ }
12822
+ 66.6% {
12823
+ width: 60%;
12824
+ }
12825
+ 100% {
12826
+ width: 60%;
12827
+ }
12828
+ `;
12829
+ const transitionMixin = css`
12830
+ animation: ${progressMove} 1200ms ease-in-out infinite, ${progressGrow} 1200ms ease-in-out infinite;
12831
+ `;
12832
+ const smoothTransition = css`
12833
+ transition: width 300ms linear;
12834
+ `;
12835
+ const LinearProgress = styled.div`
12836
+ position: relative;
12837
+ height: 0.25rem;
12838
+ width: 100%;
12839
+ overflow: hidden;
12840
+ border-radius: ${_ref => {
13119
12841
  let {
13120
12842
  theme: {
13121
- raisedButton
13122
- },
13123
- ...props
13124
- } = _ref14;
13125
- return raisedButton.hoverColor[getVariant(props)];
12843
+ borderRadius
12844
+ }
12845
+ } = _ref;
12846
+ return borderRadius.medium;
13126
12847
  }};
13127
- background-color: ${_ref15 => {
12848
+ background-color: ${_ref2 => {
13128
12849
  let {
13129
12850
  theme: {
13130
- raisedButton
13131
- },
13132
- ...props
13133
- } = _ref15;
13134
- return raisedButton.hoverBackgroundColor[getVariant(props)];
12851
+ linearProgress
12852
+ }
12853
+ } = _ref2;
12854
+ return linearProgress.formBackgroundColor;
13135
12855
  }};
13136
- }
13137
12856
 
13138
- &:active {
13139
- color: ${_ref16 => {
12857
+ &:after {
12858
+ content: "";
12859
+ position: absolute;
12860
+ left: 0;
12861
+ height: 0.25rem;
12862
+ width: ${_ref3 => {
13140
12863
  let {
13141
- theme: {
13142
- raisedButton
13143
- },
13144
- ...props
13145
- } = _ref16;
13146
- return raisedButton.activeColor[getVariant(props)];
12864
+ done
12865
+ } = _ref3;
12866
+ return done !== void 0 ? `${done}%` : 0;
13147
12867
  }};
13148
- background-color: ${_ref17 => {
12868
+ background-color: ${_ref4 => {
13149
12869
  let {
13150
12870
  theme: {
13151
- raisedButton
12871
+ linearProgress
13152
12872
  },
13153
12873
  ...props
13154
- } = _ref17;
13155
- return raisedButton.activeBackgroundColor[getVariant(props)];
13156
- }};
13157
- box-shadow: ${_ref18 => {
13158
- let {
13159
- theme: {
13160
- shadows
13161
- }
13162
- } = _ref18;
13163
- return shadows.pressed;
13164
- }};
13165
- }
13166
-
13167
- &[disabled] {
13168
- pointer-events: none;
13169
- box-shadow: none;
13170
- color: ${_ref19 => {
13171
- let {
13172
- theme: {
13173
- raisedButton
13174
- }
13175
- } = _ref19;
13176
- return raisedButton.disabledColor;
12874
+ } = _ref4;
12875
+ return linearProgress.fillBackgroundColor[getColorOrMono(props)];
13177
12876
  }};
13178
- background-color: ${_ref20 => {
12877
+ ${_ref5 => {
13179
12878
  let {
13180
- theme: {
13181
- raisedButton
13182
- }
13183
- } = _ref20;
13184
- return raisedButton.disabledBackgroundColor;
12879
+ done
12880
+ } = _ref5;
12881
+ return done === void 0 ? transitionMixin : smoothTransition;
13185
12882
  }};
13186
12883
  }
13187
12884
  `;
13188
12885
 
13189
- const DEFAULT_LOADER_SIZE = "110px";
13190
-
13191
- const setHeight = height => typeof height === "number" ? `${height}px` : typeof height === "undefined" ? DEFAULT_LOADER_SIZE : height;
13192
-
13193
- const setWidth = width => typeof width === "number" ? `${width}px` : typeof width === "undefined" ? "100%" : width;
13194
-
13195
- const CardLoaderPreview = styled.div`
13196
- display: flex;
13197
- flex-grow: 1;
13198
- background-color: ${_ref => {
12886
+ const imageBaseMixin = css`
12887
+ object-fit: cover;
12888
+ border-radius: ${_ref => {
13199
12889
  let {
13200
- theme
12890
+ theme: {
12891
+ borderRadius
12892
+ }
13201
12893
  } = _ref;
13202
- return theme.palette.elementDark;
12894
+ return borderRadius.medium;
13203
12895
  }};
12896
+ display: block;
13204
12897
  `;
13205
- const CardLoaderBar = styled.div`
13206
- width: 100%;
13207
- background-color: ${_ref2 => {
12898
+ const ImageBase = /*#__PURE__*/styled.img.attrs(_ref2 => {
13208
12899
  let {
13209
- theme
12900
+ src,
12901
+ fallback
13210
12902
  } = _ref2;
13211
- return theme.palette.elementDark;
13212
- }};
13213
- margin-bottom: 10px;
13214
- border-radius: 0.75rem;
13215
- `;
13216
- const CardLoaderBars = styled.div`
13217
- display: flex;
13218
- flex-direction: column;
13219
- width: 100%;
13220
- `;
13221
- const CardLoaderShining = styled.div`
13222
- position: absolute;
13223
- top: 0;
13224
- left: 0;
13225
- background-color: #333;
13226
- width: 100%;
13227
- animation-duration: 0.6s;
13228
- animation-iteration-count: infinite;
13229
- animation-name: loader-animate;
13230
- animation-timing-function: linear;
13231
- background: -webkit-linear-gradient(
13232
- left,
13233
- rgba(255, 255, 255, 0) 0%,
13234
- rgba(255, 255, 255, 0.6) 30%,
13235
- rgba(255, 255, 255, 0) 81%
13236
- );
13237
- background: -o-linear-gradient(
13238
- left,
13239
- rgba(255, 255, 255, 0) 0%,
13240
- rgba(255, 255, 255, 0.6) 30%,
13241
- rgba(255, 255, 255, 0) 81%
13242
- );
13243
- background: linear-gradient(
13244
- to right,
13245
- rgba(255, 255, 255, 0) 0%,
13246
- rgba(255, 255, 255, 0.6) 30%,
13247
- rgba(255, 255, 255, 0) 81%
13248
- );
13249
- filter: progid:DXImageTransform.Microsoft.gradient(
13250
- startColorstr='#00ffffff',
13251
- endColorstr='#00ffffff',
13252
- GradientType=1);
13253
-
13254
- @keyframes loader-animate {
13255
- 0% {
13256
- transform: translate3d(-100%, 0, 0);
13257
- }
13258
- 100% {
13259
- transform: translate3d(100%, 0, 0);
13260
- }
13261
- }
12903
+ return {
12904
+ src: src || fallback || defaultStub
12905
+ };
12906
+ })`
12907
+ ${imageBaseMixin};
13262
12908
  `;
13263
- const CardLoaderContainer = styled.div`
12909
+ const ImageLoadingContainer = styled.div`
12910
+ ${imageBaseMixin};
13264
12911
  position: relative;
13265
- display: flex;
13266
- width: ${_ref3 => {
12912
+ background: ${_ref3 => {
13267
12913
  let {
13268
- width
12914
+ theme
13269
12915
  } = _ref3;
13270
- return setWidth(width);
12916
+ return theme.palette.elementDark;
13271
12917
  }};
13272
-
13273
- ${CardLoaderPreview} {
13274
- height: ${_ref4 => {
12918
+ width: ${_ref4 => {
13275
12919
  let {
13276
- height
12920
+ width
13277
12921
  } = _ref4;
13278
- return setHeight(height);
12922
+ return typeof width === "number" ? `${width}px` : width;
13279
12923
  }};
13280
- width: ${_ref5 => {
12924
+ height: ${_ref5 => {
13281
12925
  let {
13282
12926
  height
13283
12927
  } = _ref5;
13284
- return setHeight(height);
13285
- }};
13286
- min-height: ${_ref6 => {
13287
- let {
13288
- height
13289
- } = _ref6;
13290
- return setHeight(height);
13291
- }};
13292
- min-width: ${_ref7 => {
13293
- let {
13294
- height
13295
- } = _ref7;
13296
- return setHeight(height);
12928
+ return typeof height === "number" ? `${height}px` : height;
13297
12929
  }};
13298
- }
12930
+ `;
12931
+ const ImageLoadingProgress = /*#__PURE__*/styled(LinearProgress)`
12932
+ top: 50%;
12933
+ transform: translateY(-50%);
12934
+ left: 13.3%;
12935
+ width: calc(100% - (13.3% * 2));
12936
+ `;
13299
12937
 
13300
- ${CardLoaderShining},
13301
- ${CardLoaderBars} {
13302
- height: ${_ref8 => {
12938
+ const LoadableImageComponent = _ref => {
13303
12939
  let {
13304
- height
13305
- } = _ref8;
13306
- return setHeight(height);
13307
- }};
13308
- }
12940
+ src,
12941
+ fallback,
12942
+ loading,
12943
+ ...restProps
12944
+ } = _ref;
12945
+ const [loadingStatus, setLoadingStatus] = useState(LoadingStatus.Loading);
12946
+ useEffect(() => {
12947
+ if (src) {
12948
+ setLoadingStatus(LoadingStatus.Loading);
12949
+ }
12950
+ }, [src]);
12951
+ const onLoadImage = useCallback(() => {
12952
+ if (loadingStatus === LoadingStatus.Loading) {
12953
+ setLoadingStatus(LoadingStatus.Ok);
12954
+ }
12955
+ }, [loadingStatus]);
12956
+ const onErrorImage = useCallback(() => {
12957
+ if (loadingStatus === LoadingStatus.Loading) {
12958
+ setLoadingStatus(LoadingStatus.Error);
12959
+ }
12960
+ }, [loadingStatus]);
12961
+ const imageBase = React.createElement(ImageBase, Object.assign({
12962
+ src: loadingStatus === LoadingStatus.Error ? "" : src,
12963
+ fallback: fallback,
12964
+ onLoad: onLoadImage,
12965
+ onError: onErrorImage,
12966
+ onErrorCapture: onErrorImage
12967
+ }, restProps));
12968
+ return loadingStatus !== LoadingStatus.Loading && !loading ? imageBase : React.createElement(ImageLoadingContainer, Object.assign({}, restProps), React.createElement("div", {
12969
+ style: {
12970
+ display: "none"
12971
+ }
12972
+ }, imageBase), React.createElement(ImageLoadingProgress, null));
12973
+ };
13309
12974
 
13310
- ${CardLoaderPreview} {
13311
- margin-right: 0.75rem;
13312
- }
12975
+ const LoadableImage = /*#__PURE__*/memo(LoadableImageComponent);
13313
12976
 
13314
- ${CardLoaderBars} {
13315
- padding-top: calc(${_ref9 => {
12977
+ const Image = /*#__PURE__*/memo(_ref => {
13316
12978
  let {
13317
- height
13318
- } = _ref9;
13319
- return setHeight(height);
13320
- }} / 6);
13321
- box-sizing: border-box;
12979
+ src,
12980
+ loadable,
12981
+ loading,
12982
+ ...restProps
12983
+ } = _ref;
12984
+ return loading || loadable ? React.createElement(LoadableImage, Object.assign({
12985
+ src: src,
12986
+ loading: loading
12987
+ }, restProps)) : React.createElement(ImageBase, Object.assign({
12988
+ src: src
12989
+ }, restProps));
12990
+ });
13322
12991
 
13323
- ${CardLoaderBar} {
13324
- &:first-child {
13325
- height: calc(${_ref10 => {
12992
+ const Message = styled.div`
12993
+ padding: 1em;
12994
+ background-color: ${_ref => {
13326
12995
  let {
13327
- height
13328
- } = _ref10;
13329
- return setHeight(height);
13330
- }} / 4);
13331
- }
13332
-
13333
- &:not(:first-child) {
13334
- height: calc(${_ref11 => {
12996
+ theme: {
12997
+ message
12998
+ },
12999
+ ...props
13000
+ } = _ref;
13001
+ return message.backgroundColor[getMessageColors(props)];
13002
+ }};
13003
+ border: 0.0625rem solid ${_ref2 => {
13335
13004
  let {
13336
- height
13337
- } = _ref11;
13338
- return setHeight(height);
13339
- }} / 6);
13340
- }
13005
+ theme: {
13006
+ message
13007
+ },
13008
+ ...props
13009
+ } = _ref2;
13010
+ return message.borderColor[getMessageColors(props)];
13011
+ }};
13012
+ border-radius: ${_ref3 => {
13013
+ let {
13014
+ theme: {
13015
+ borderRadius
13016
+ }
13017
+ } = _ref3;
13018
+ return borderRadius.medium;
13019
+ }};
13020
+ font: ${_ref4 => {
13021
+ let {
13022
+ theme: {
13023
+ fonts
13341
13024
  }
13025
+ } = _ref4;
13026
+ return fonts.standard;
13027
+ }};
13028
+ color: ${_ref5 => {
13029
+ let {
13030
+ theme: {
13031
+ message
13032
+ },
13033
+ ...props
13034
+ } = _ref5;
13035
+ return message.color[getMessageColors(props)];
13036
+ }};
13037
+ text-align: ${_ref6 => {
13038
+ let {
13039
+ textRight,
13040
+ textCenter
13041
+ } = _ref6;
13042
+ return textRight ? "right" : textCenter ? "center" : "left";
13043
+ }};
13044
+
13045
+ > * {
13046
+ color: inherit;
13342
13047
  }
13343
13048
  `;
13344
13049
 
13345
- const CardLoader = _ref => {
13050
+ const Paragraph = styled.p`
13051
+ margin: 0 0 0.5rem;
13052
+ font: ${_ref => {
13346
13053
  let {
13347
- animate = true,
13348
- height,
13349
- width
13054
+ theme: {
13055
+ fonts
13056
+ }
13350
13057
  } = _ref;
13351
- return React.createElement(CardLoaderContainer, {
13352
- height: height,
13353
- width: width
13354
- }, React.createElement(CardLoaderPreview, null), React.createElement(CardLoaderBars, null, React.createElement(CardLoaderBar, null), React.createElement(CardLoaderBar, null)), animate && React.createElement(CardLoaderShining, null));
13355
- };
13058
+ return fonts.standard;
13059
+ }};
13060
+ color: ${_ref2 => {
13061
+ let {
13062
+ theme: {
13063
+ palette
13064
+ }
13065
+ } = _ref2;
13066
+ return palette.textPrimary;
13067
+ }};
13068
+ `;
13356
13069
 
13357
- const DEFAULT_DIVIDER_SIZE = 1;
13358
- const verticalDivider = css`
13359
- height: inherit;
13360
- border-left: ${_ref => {
13070
+ const H4 = styled.h4`
13071
+ font: ${_ref => {
13361
13072
  let {
13362
- size
13073
+ theme: {
13074
+ fonts
13075
+ }
13363
13076
  } = _ref;
13364
- return rem(size || 0);
13365
- }} solid ${_ref2 => {
13077
+ return fonts.standard;
13078
+ }};
13079
+ color: ${_ref2 => {
13366
13080
  let {
13367
13081
  theme: {
13368
- divider
13082
+ palette
13369
13083
  }
13370
13084
  } = _ref2;
13371
- return divider.color;
13085
+ return palette.textPrimary;
13372
13086
  }};
13373
13087
  `;
13374
- const horizontalDivider = css`
13375
- width: inherit;
13376
- border-bottom: ${_ref3 => {
13088
+ const H3 = styled.h3`
13089
+ font: ${_ref3 => {
13377
13090
  let {
13378
- size
13091
+ theme: {
13092
+ fonts
13093
+ }
13379
13094
  } = _ref3;
13380
- return rem(size || 0);
13381
- }} solid ${_ref4 => {
13095
+ return fonts.subtitle;
13096
+ }};
13097
+ color: ${_ref4 => {
13382
13098
  let {
13383
13099
  theme: {
13384
- divider
13100
+ palette
13385
13101
  }
13386
13102
  } = _ref4;
13387
- return divider.color;
13103
+ return palette.textPrimary;
13388
13104
  }};
13389
13105
  `;
13390
- const Divider = /*#__PURE__*/styled.div.attrs(props => ({
13391
- size: DEFAULT_DIVIDER_SIZE,
13392
- ...props
13393
- }))`
13394
- display: flex;
13395
- align-self: stretch;
13396
- border-radius: 0.0625rem;
13397
-
13398
- ${_ref5 => {
13106
+ const H2 = styled.h2`
13107
+ font: ${_ref5 => {
13399
13108
  let {
13400
- horizontal,
13401
- vertical
13109
+ theme: {
13110
+ fonts
13111
+ }
13402
13112
  } = _ref5;
13403
- if (horizontal || !vertical) return horizontalDivider;
13404
- return verticalDivider;
13113
+ return fonts.h2;
13405
13114
  }};
13406
- `;
13407
-
13408
- const ElementsArea = styled.div`
13409
- background: ${_ref => {
13115
+ color: ${_ref6 => {
13410
13116
  let {
13411
13117
  theme: {
13412
- elementsArea
13118
+ palette
13413
13119
  }
13414
- } = _ref;
13415
- return elementsArea.backgroundColor;
13120
+ } = _ref6;
13121
+ return palette.textPrimary;
13416
13122
  }};
13417
13123
  `;
13418
-
13419
- const setWidth$1 = width => typeof width === "number" ? `${width}px` : typeof width === "undefined" ? "auto" : width;
13420
-
13421
- const Flex = styled.div`
13422
- display: flex;
13423
- flex-direction: ${_ref => {
13124
+ const H1 = styled.h1`
13125
+ font: ${_ref7 => {
13424
13126
  let {
13425
- column
13426
- } = _ref;
13427
- return column ? "column" : "row";
13127
+ theme: {
13128
+ fonts
13129
+ }
13130
+ } = _ref7;
13131
+ return fonts.h1;
13428
13132
  }};
13429
- width: 100%;
13430
- gap: ${_ref2 => {
13133
+ color: ${_ref8 => {
13431
13134
  let {
13432
- gap
13433
- } = _ref2;
13434
- return gap;
13135
+ theme: {
13136
+ palette
13137
+ }
13138
+ } = _ref8;
13139
+ return palette.textPrimary;
13435
13140
  }};
13436
- box-sizing: border-box;
13437
- ${background}
13438
- ${border}
13439
- ${color}
13440
- ${flexbox}
13441
- ${fontSize}
13442
- ${fontWeight}
13443
- ${fontStyle}
13444
- ${space}
13445
- ${layout}
13446
- ${textAlign}
13447
- ${position}
13448
- ${lineHeight}
13449
13141
  `;
13450
- const FlexSpan = styled.span`
13451
- box-sizing: border-box;
13452
- width: ${_ref3 => {
13142
+ const Description = styled.div`
13143
+ font: ${_ref9 => {
13453
13144
  let {
13454
- width
13455
- } = _ref3;
13456
- return setWidth$1(width);
13145
+ theme: {
13146
+ fonts
13147
+ }
13148
+ } = _ref9;
13149
+ return fonts.description;
13457
13150
  }};
13458
- white-space: ${_ref4 => {
13151
+ color: ${_ref10 => {
13459
13152
  let {
13460
- whiteSpace
13461
- } = _ref4;
13462
- return whiteSpace;
13153
+ theme: {
13154
+ palette
13155
+ }
13156
+ } = _ref10;
13157
+ return palette.textSecondary;
13463
13158
  }};
13464
- ${background}
13465
- ${border}
13466
- ${color}
13467
- ${flexbox}
13468
- ${fontSize}
13469
- ${fontWeight}
13470
- ${fontStyle}
13471
- ${space}
13472
- ${layout}
13473
- ${textAlign}
13474
- ${position}
13475
- ${lineHeight}
13159
+ `;
13160
+ const textOverflowEllipsisMixin = `
13161
+ overflow: hidden;
13162
+ text-overflow: ellipsis;
13163
+ white-space: nowrap;
13476
13164
  `;
13477
13165
 
13478
- var LoadingStatus;
13479
-
13480
- (function (LoadingStatus) {
13481
- LoadingStatus["Loading"] = "loading";
13482
- LoadingStatus["Ok"] = "ok";
13483
- LoadingStatus["Error"] = "error";
13484
- })(LoadingStatus || (LoadingStatus = {}));
13485
-
13486
- const progressMove = keyframes`
13487
- 0% {
13488
- left: 0;
13489
- }
13490
- 33.3% {
13491
- left: 0;
13492
- }
13493
- 100% {
13494
- left: 100%;
13495
- }
13166
+ const IconBefore = styled.span`
13167
+ position: absolute;
13168
+ left: 0;
13169
+ top: 50%;
13170
+ transform: translateY(-50%);
13171
+ display: flex;
13172
+ align-items: center;
13173
+ justify-content: center;
13174
+ min-height: 2rem;
13175
+ min-width: 2rem;
13176
+ height: 2rem;
13177
+ width: 2rem;
13496
13178
  `;
13497
- const progressGrow = keyframes`
13498
- 0% {
13499
- width: 0;
13500
- }
13501
- 66.6% {
13502
- width: 60%;
13503
- }
13504
- 100% {
13505
- width: 60%;
13179
+ const IconAfter = styled.span`
13180
+ position: absolute;
13181
+ right: ${_ref => {
13182
+ let {
13183
+ indent
13184
+ } = _ref;
13185
+ return indent;
13186
+ }}rem;
13187
+ top: 50%;
13188
+ transform: translateY(-50%);
13189
+ display: flex;
13190
+ align-items: center;
13191
+ justify-content: center;
13192
+ min-height: 2rem;
13193
+ min-width: 2rem;
13194
+ height: 2rem;
13195
+ width: 2rem;
13196
+
13197
+ button {
13198
+ width: auto;
13506
13199
  }
13507
13200
  `;
13508
- const transitionMixin = css`
13509
- animation: ${progressMove} 1200ms ease-in-out infinite, ${progressGrow} 1200ms ease-in-out infinite;
13510
- `;
13511
- const smoothTransition = css`
13512
- transition: width 300ms linear;
13513
- `;
13514
- const LinearProgress = styled.div`
13515
- position: relative;
13516
- height: 0.25rem;
13201
+
13202
+ const inputMixin = css`
13203
+ display: flex;
13204
+ height: ${props => props.height || "auto"};
13205
+ padding: 0.34375rem ${_ref => {
13206
+ let {
13207
+ paddingRight
13208
+ } = _ref;
13209
+ return `${paddingRight || 0}px`;
13210
+ }} 0.34375rem
13211
+ ${_ref2 => {
13212
+ let {
13213
+ extraLeftPaddingWidth
13214
+ } = _ref2;
13215
+ return extraLeftPaddingWidth ? `${(extraLeftPaddingWidth ?? 0) + 8}px` : "0.5rem";
13216
+ }};
13517
13217
  width: 100%;
13518
- overflow: hidden;
13519
- border-radius: ${_ref => {
13218
+ background: transparent;
13219
+ border: 0.0625rem solid ${_ref3 => {
13220
+ let {
13221
+ error,
13222
+ theme: {
13223
+ input
13224
+ }
13225
+ } = _ref3;
13226
+ return error ? input.error : input.borderColor;
13227
+ }};
13228
+ border-radius: ${_ref4 => {
13520
13229
  let {
13521
13230
  theme: {
13522
13231
  borderRadius
13523
13232
  }
13524
- } = _ref;
13233
+ } = _ref4;
13525
13234
  return borderRadius.medium;
13526
13235
  }};
13527
- background-color: ${_ref2 => {
13236
+ box-sizing: border-box;
13237
+ color: ${_ref5 => {
13528
13238
  let {
13529
13239
  theme: {
13530
- linearProgress
13240
+ input
13531
13241
  }
13532
- } = _ref2;
13533
- return linearProgress.formBackgroundColor;
13242
+ } = _ref5;
13243
+ return input.color;
13534
13244
  }};
13535
-
13536
- &:after {
13537
- content: "";
13538
- position: absolute;
13539
- left: 0;
13540
- height: 0.25rem;
13541
- width: ${_ref3 => {
13245
+ font: ${_ref6 => {
13542
13246
  let {
13543
- done
13544
- } = _ref3;
13545
- return done !== void 0 ? `${done}%` : 0;
13247
+ theme: {
13248
+ fonts
13249
+ }
13250
+ } = _ref6;
13251
+ return fonts.standard;
13546
13252
  }};
13547
- background-color: ${_ref4 => {
13253
+
13254
+ ${IconBefore} + & {
13255
+ padding-left: 2rem;
13256
+ }
13257
+
13258
+ &:focus {
13259
+ outline: none;
13260
+ border-color: ${_ref7 => {
13548
13261
  let {
13262
+ error,
13549
13263
  theme: {
13550
- linearProgress
13551
- },
13552
- ...props
13553
- } = _ref4;
13554
- return linearProgress.fillBackgroundColor[getColorOrMono(props)];
13264
+ input
13265
+ }
13266
+ } = _ref7;
13267
+ return error ? input.error : input.active;
13555
13268
  }};
13556
- ${_ref5 => {
13269
+ }
13270
+
13271
+ &::placeholder {
13272
+ color: ${_ref8 => {
13557
13273
  let {
13558
- done
13559
- } = _ref5;
13560
- return done === void 0 ? transitionMixin : smoothTransition;
13274
+ theme: {
13275
+ input
13276
+ }
13277
+ } = _ref8;
13278
+ return input.placeholderColor;
13561
13279
  }};
13562
13280
  }
13563
- `;
13564
13281
 
13565
- const imageBaseMixin = css`
13566
- object-fit: cover;
13567
- border-radius: ${_ref => {
13282
+ &[disabled] {
13283
+ pointer-events: none;
13284
+ color: ${_ref9 => {
13568
13285
  let {
13569
13286
  theme: {
13570
- borderRadius
13287
+ input
13571
13288
  }
13572
- } = _ref;
13573
- return borderRadius.medium;
13289
+ } = _ref9;
13290
+ return input.disabledColor;
13574
13291
  }};
13575
- display: block;
13576
- `;
13577
- const ImageBase = /*#__PURE__*/styled.img.attrs(_ref2 => {
13578
- let {
13579
- src,
13580
- fallback
13581
- } = _ref2;
13582
- return {
13583
- src: src || fallback || defaultStub
13584
- };
13585
- })`
13586
- ${imageBaseMixin};
13587
- `;
13588
- const ImageLoadingContainer = styled.div`
13589
- ${imageBaseMixin};
13590
- position: relative;
13591
- background: ${_ref3 => {
13292
+ border: 0.0635rem dashed ${_ref10 => {
13592
13293
  let {
13593
- theme
13594
- } = _ref3;
13595
- return theme.palette.elementDark;
13294
+ theme: {
13295
+ input
13296
+ }
13297
+ } = _ref10;
13298
+ return input.disabledBorderColor;
13596
13299
  }};
13597
- width: ${_ref4 => {
13300
+
13301
+ &::placeholder {
13302
+ color: ${_ref11 => {
13598
13303
  let {
13599
- width
13600
- } = _ref4;
13601
- return typeof width === "number" ? `${width}px` : width;
13304
+ theme: {
13305
+ input
13306
+ }
13307
+ } = _ref11;
13308
+ return input.disabledPlaceholderColor;
13602
13309
  }};
13603
- height: ${_ref5 => {
13310
+ }
13311
+ }
13312
+ `;
13313
+ const StyledInput = /*#__PURE__*/styled.input.attrs(props => ({
13314
+ width: "14rem",
13315
+ height: "auto",
13316
+ paddingRight: 0.5,
13317
+ paddingLeft: false,
13318
+ ...props
13319
+ }))`
13320
+ ${inputMixin};
13321
+ `;
13322
+ const ChipInputHolder = styled.div`
13323
+ ${inputMixin};
13324
+ height: 2rem;
13325
+ align-items: center;
13326
+ padding: 0 ${_ref12 => {
13604
13327
  let {
13605
- height
13606
- } = _ref5;
13607
- return typeof height === "number" ? `${height}px` : height;
13608
- }};
13328
+ paddingRight
13329
+ } = _ref12;
13330
+ return `${paddingRight || 0}rem`;
13331
+ }} 0 0.5rem;
13609
13332
  `;
13610
- const ImageLoadingProgress = /*#__PURE__*/styled(LinearProgress)`
13333
+ const ValuePrefix = styled.div`
13334
+ position: absolute;
13335
+ left: 0.5rem;
13611
13336
  top: 50%;
13612
13337
  transform: translateY(-50%);
13613
- left: 13.3%;
13614
- width: calc(100% - (13.3% * 2));
13615
- `;
13616
-
13617
- const LoadableImageComponent = _ref => {
13618
- let {
13619
- src,
13620
- fallback,
13621
- loading,
13622
- ...restProps
13623
- } = _ref;
13624
- const [loadingStatus, setLoadingStatus] = useState(LoadingStatus.Loading);
13625
- useEffect(() => {
13626
- if (src) {
13627
- setLoadingStatus(LoadingStatus.Loading);
13628
- }
13629
- }, [src]);
13630
- const onLoadImage = useCallback(() => {
13631
- if (loadingStatus === LoadingStatus.Loading) {
13632
- setLoadingStatus(LoadingStatus.Ok);
13633
- }
13634
- }, [loadingStatus]);
13635
- const onErrorImage = useCallback(() => {
13636
- if (loadingStatus === LoadingStatus.Loading) {
13637
- setLoadingStatus(LoadingStatus.Error);
13638
- }
13639
- }, [loadingStatus]);
13640
- const imageBase = React.createElement(ImageBase, Object.assign({
13641
- src: loadingStatus === LoadingStatus.Error ? "" : src,
13642
- fallback: fallback,
13643
- onLoad: onLoadImage,
13644
- onError: onErrorImage,
13645
- onErrorCapture: onErrorImage
13646
- }, restProps));
13647
- return loadingStatus !== LoadingStatus.Loading && !loading ? imageBase : React.createElement(ImageLoadingContainer, Object.assign({}, restProps), React.createElement("div", {
13648
- style: {
13649
- display: "none"
13650
- }
13651
- }, imageBase), React.createElement(ImageLoadingProgress, null));
13652
- };
13653
-
13654
- const LoadableImage = /*#__PURE__*/memo(LoadableImageComponent);
13338
+ font-size: 1rem;
13339
+ opacity: 0.28;
13655
13340
 
13656
- const Image = /*#__PURE__*/memo(_ref => {
13657
- let {
13658
- src,
13659
- loadable,
13660
- loading,
13661
- ...restProps
13662
- } = _ref;
13663
- return loading || loadable ? React.createElement(LoadableImage, Object.assign({
13664
- src: src,
13665
- loading: loading
13666
- }, restProps)) : React.createElement(ImageBase, Object.assign({
13667
- src: src
13668
- }, restProps));
13669
- });
13341
+ ${IconBefore} + & {
13342
+ padding-left: 1.5rem;
13343
+ }
13344
+ `;
13670
13345
 
13671
- const Message = styled.div`
13672
- padding: 1em;
13673
- background-color: ${_ref => {
13346
+ const InputContainer = styled.span`
13347
+ display: flex;
13348
+ align-items: center;
13349
+ position: relative;
13350
+ width: ${_ref => {
13674
13351
  let {
13675
- theme: {
13676
- message
13677
- },
13678
- ...props
13352
+ width
13679
13353
  } = _ref;
13680
- return message.backgroundColor[getMessageColors(props)];
13681
- }};
13682
- border: 0.0625rem solid ${_ref2 => {
13683
- let {
13684
- theme: {
13685
- message
13686
- },
13687
- ...props
13688
- } = _ref2;
13689
- return message.borderColor[getMessageColors(props)];
13690
- }};
13691
- border-radius: ${_ref3 => {
13692
- let {
13693
- theme: {
13694
- borderRadius
13695
- }
13696
- } = _ref3;
13697
- return borderRadius.medium;
13354
+ return width;
13698
13355
  }};
13699
- font: ${_ref4 => {
13356
+
13357
+ ${_ref2 => {
13700
13358
  let {
13359
+ active,
13701
13360
  theme: {
13702
- fonts
13361
+ input
13703
13362
  }
13704
- } = _ref4;
13705
- return fonts.standard;
13706
- }};
13707
- color: ${_ref5 => {
13363
+ } = _ref2;
13364
+ return active && `
13365
+ &:hover {
13366
+ input {
13367
+ outline: none;
13368
+ border-color: ${input.active};
13369
+ }
13370
+ }
13371
+
13372
+ input {
13373
+ outline: none;
13374
+ border-color: ${input.active};
13375
+ }
13376
+ `;
13377
+ }}
13378
+
13379
+ &:hover {
13380
+ input {
13381
+ border-color: ${_ref3 => {
13708
13382
  let {
13383
+ active,
13709
13384
  theme: {
13710
- message
13385
+ input
13711
13386
  },
13712
- ...props
13713
- } = _ref5;
13714
- return message.color[getMessageColors(props)];
13387
+ error
13388
+ } = _ref3;
13389
+ return !active && (error ? input.error : input.hoverBorderColor);
13715
13390
  }};
13716
- text-align: ${_ref6 => {
13391
+
13392
+ &:focus {
13393
+ outline: none;
13394
+ border-color: ${_ref4 => {
13717
13395
  let {
13718
- textRight,
13719
- textCenter
13720
- } = _ref6;
13721
- return textRight ? "right" : textCenter ? "center" : "left";
13396
+ theme: {
13397
+ input
13398
+ },
13399
+ error
13400
+ } = _ref4;
13401
+ return error ? input.error : input.active;
13722
13402
  }};
13403
+ }
13404
+ }
13405
+ }
13723
13406
 
13724
- > * {
13725
- color: inherit;
13407
+ &[disabled] {
13408
+ pointer-events: none;
13726
13409
  }
13727
- `;
13728
13410
 
13729
- const Paragraph = styled.p`
13730
- margin: 0 0 0.5rem;
13731
- font: ${_ref => {
13732
- let {
13733
- theme: {
13734
- fonts
13735
- }
13736
- } = _ref;
13737
- return fonts.standard;
13738
- }};
13739
- color: ${_ref2 => {
13411
+ ${ChipInputHolder} {
13412
+ border-color: ${_ref5 => {
13740
13413
  let {
13414
+ active,
13741
13415
  theme: {
13742
- palette
13416
+ input
13743
13417
  }
13744
- } = _ref2;
13745
- return palette.textPrimary;
13418
+ } = _ref5;
13419
+ return active && input.active;
13746
13420
  }};
13421
+ }
13747
13422
  `;
13748
13423
 
13749
- const H4 = styled.h4`
13750
- font: ${_ref => {
13424
+ const IconButtonInnerChild = styled.span``;
13425
+ const buttonActiveMixin = css`
13426
+ background: ${_ref => {
13751
13427
  let {
13752
13428
  theme: {
13753
- fonts
13429
+ palette
13754
13430
  }
13755
13431
  } = _ref;
13756
- return fonts.standard;
13432
+ return palette.element;
13757
13433
  }};
13758
- color: ${_ref2 => {
13434
+
13435
+ span[kind]:after,
13436
+ :hover ${IconButtonInnerChild}, ${IconButtonInnerChild} {
13437
+ color: ${_ref2 => {
13759
13438
  let {
13760
13439
  theme: {
13761
13440
  palette
13762
13441
  }
13763
13442
  } = _ref2;
13764
- return palette.textPrimary;
13443
+ return palette.background;
13765
13444
  }};
13445
+ }
13766
13446
  `;
13767
- const H3 = styled.h3`
13768
- font: ${_ref3 => {
13447
+ const buttonHoverMixin = css`
13448
+ &:hover {
13449
+ background: ${_ref3 => {
13769
13450
  let {
13451
+ hasBg,
13770
13452
  theme: {
13771
- fonts
13453
+ palette
13772
13454
  }
13773
13455
  } = _ref3;
13774
- return fonts.subtitle;
13456
+ return hasBg ? palette.elementDark : "none";
13775
13457
  }};
13776
- color: ${_ref4 => {
13777
- let {
13778
- theme: {
13779
- palette
13458
+ transition: background ${transition.hover};
13459
+
13460
+ > ${Icon}, ${IconButtonInnerChild} {
13461
+ transition: all ${transition.hover};
13780
13462
  }
13463
+ }
13464
+ `;
13465
+ const buttonMixin = css`
13466
+ user-select: none;
13467
+ position: relative;
13468
+ display: flex;
13469
+ align-items: center;
13470
+ justify-content: center;
13471
+ flex-direction: ${_ref4 => {
13472
+ let {
13473
+ iconRight
13781
13474
  } = _ref4;
13782
- return palette.textPrimary;
13475
+ return iconRight ? "row-reverse" : "row";
13783
13476
  }};
13784
- `;
13785
- const H2 = styled.h2`
13786
- font: ${_ref5 => {
13477
+ padding: 0 1rem;
13478
+ height: 2.25rem;
13479
+ width: ${props => props.notFixedWidth ? "auto" : "3rem"};
13480
+ background: none;
13481
+ border: none;
13482
+ border-radius: 1.25rem;
13483
+ outline: none;
13484
+ cursor: pointer;
13485
+ backface-visibility: hidden;
13486
+ transform: translateZ(0) scale(1, 1);
13487
+
13488
+ ${_ref5 => {
13787
13489
  let {
13788
- theme: {
13789
- fonts
13790
- }
13490
+ active
13791
13491
  } = _ref5;
13792
- return fonts.h2;
13492
+ return active ? buttonActiveMixin : buttonHoverMixin;
13793
13493
  }};
13794
- color: ${_ref6 => {
13494
+
13495
+ &:active > ${Icon} {
13496
+ transform: scale(1.125, 1.125);
13497
+ transition: all ${transition.press};
13498
+ }
13499
+
13500
+ ${Icon}, ${IconButtonInnerChild} {
13501
+ display: block;
13502
+ position: relative;
13503
+ transition: color ${transition.release};
13504
+
13505
+ &:after {
13506
+ display: block;
13507
+ position: absolute;
13508
+ left: 0;
13509
+ z-index: 2;
13510
+ }
13511
+ }
13512
+
13513
+ &[disabled],
13514
+ ${InputContainer}[disabled] & {
13515
+ ${Icon}, ${IconButtonInnerChild} {
13516
+ color: ${_ref6 => {
13795
13517
  let {
13796
13518
  theme: {
13797
- palette
13519
+ iconButton
13798
13520
  }
13799
13521
  } = _ref6;
13800
- return palette.textPrimary;
13522
+ return iconButton.disabledColor;
13801
13523
  }};
13524
+ }
13525
+ pointer-events: none;
13526
+ }
13802
13527
  `;
13803
- const H1 = styled.h1`
13804
- font: ${_ref7 => {
13528
+ const IconButtonButton = /*#__PURE__*/styled.button.attrs(props => ({
13529
+ tabIndex: -1,
13530
+ ...props
13531
+ }))`
13532
+ flex-shrink: 0;
13533
+
13534
+ &:hover > ${Icon}, &:hover > ${IconButtonInnerChild} {
13535
+ color: ${_ref7 => {
13805
13536
  let {
13806
13537
  theme: {
13807
- fonts
13808
- }
13538
+ iconButton
13539
+ },
13540
+ ...props
13809
13541
  } = _ref7;
13810
- return fonts.h1;
13542
+ return iconButton.hoverColor[getIconColors(props)];
13811
13543
  }};
13812
- color: ${_ref8 => {
13544
+ }
13545
+
13546
+ &:active > ${Icon}, &:active > ${IconButtonInnerChild} {
13547
+ color: ${_ref8 => {
13813
13548
  let {
13814
13549
  theme: {
13815
- palette
13816
- }
13550
+ iconButton
13551
+ },
13552
+ ...props
13817
13553
  } = _ref8;
13818
- return palette.textPrimary;
13554
+ return iconButton.activeColor[getIconColors(props)];
13819
13555
  }};
13820
- `;
13821
- const Description = styled.div`
13822
- font: ${_ref9 => {
13556
+ }
13557
+
13558
+ ${Icon}, ${IconButtonInnerChild} {
13559
+ color: ${_ref9 => {
13823
13560
  let {
13824
13561
  theme: {
13825
- fonts
13826
- }
13562
+ iconButton
13563
+ },
13564
+ ...props
13827
13565
  } = _ref9;
13828
- return fonts.description;
13566
+ return iconButton.color[getIconColors(props)];
13829
13567
  }};
13830
- color: ${_ref10 => {
13568
+ }
13569
+
13570
+ ${IconButtonInnerChild} {
13571
+ margin: ${_ref10 => {
13831
13572
  let {
13832
- theme: {
13833
- palette
13834
- }
13573
+ iconRight
13835
13574
  } = _ref10;
13836
- return palette.textSecondary;
13575
+ return iconRight ? "0 0.5rem 0 0" : "0 0 0 0.5rem";
13837
13576
  }};
13577
+ }
13578
+
13579
+ ${buttonMixin};
13838
13580
  `;
13839
- const textOverflowEllipsisMixin = `
13840
- overflow: hidden;
13841
- text-overflow: ellipsis;
13842
- white-space: nowrap;
13843
- `;
13581
+
13582
+ const IconButtonComponent = _ref => {
13583
+ let {
13584
+ kind,
13585
+ children,
13586
+ innerRef,
13587
+ icon,
13588
+ tabIndex = -1,
13589
+ ...props
13590
+ } = _ref;
13591
+ return React.createElement(IconButtonButton, Object.assign({
13592
+ ref: innerRef,
13593
+ notFixedWidth: !!children,
13594
+ tabIndex: tabIndex
13595
+ }, props), icon || React.createElement(Icon, {
13596
+ kind: kind
13597
+ }), children && React.createElement(IconButtonInnerChild, null, children));
13598
+ };
13599
+
13600
+ const IconButton = /*#__PURE__*/memo(IconButtonComponent);
13844
13601
 
13845
13602
  const LegendToggler = /*#__PURE__*/styled(IconButton).attrs(props => ({
13846
13603
  kind: "expand",
@@ -13921,7 +13678,7 @@ const LegendToggler = /*#__PURE__*/styled(IconButton).attrs(props => ({
13921
13678
  }
13922
13679
  `;
13923
13680
 
13924
- const Input$1 = /*#__PURE__*/styled.input.attrs(() => ({
13681
+ const Input = /*#__PURE__*/styled.input.attrs(() => ({
13925
13682
  type: "checkbox",
13926
13683
  hidden: true
13927
13684
  }))``;
@@ -14077,7 +13834,7 @@ const Label = styled.label`
14077
13834
  pointer-events: none;
14078
13835
  }
14079
13836
 
14080
- ${Input$1}:checked + ${Box} ${Border} {
13837
+ ${Input}:checked + ${Box} ${Border} {
14081
13838
  fill: ${_ref5 => {
14082
13839
  let {
14083
13840
  theme: {
@@ -14089,7 +13846,7 @@ const Label = styled.label`
14089
13846
  transition: fill ${transition.press}; // appear
14090
13847
  }
14091
13848
 
14092
- &:hover > ${Input$1}:checked + ${Box} ${Border} {
13849
+ &:hover > ${Input}:checked + ${Box} ${Border} {
14093
13850
  fill: ${_ref6 => {
14094
13851
  let {
14095
13852
  theme: {
@@ -14100,7 +13857,7 @@ const Label = styled.label`
14100
13857
  }};
14101
13858
  }
14102
13859
 
14103
- ${Input$1}[disabled] + ${Box} ${Border} {
13860
+ ${Input}[disabled] + ${Box} ${Border} {
14104
13861
  fill: ${_ref7 => {
14105
13862
  let {
14106
13863
  theme: {
@@ -14111,7 +13868,7 @@ const Label = styled.label`
14111
13868
  }};
14112
13869
  }
14113
13870
 
14114
- ${Input$1}:checked[disabled] + ${Box} ${Border} {
13871
+ ${Input}:checked[disabled] + ${Box} ${Border} {
14115
13872
  fill: transparent;
14116
13873
  }
14117
13874
 
@@ -14126,7 +13883,7 @@ const Label = styled.label`
14126
13883
  }};
14127
13884
  }
14128
13885
 
14129
- &:hover > ${Input$1}:checked + ${Box} ${BoxFill} {
13886
+ &:hover > ${Input}:checked + ${Box} ${BoxFill} {
14130
13887
  fill: ${_ref9 => {
14131
13888
  let {
14132
13889
  theme: {
@@ -14137,7 +13894,7 @@ const Label = styled.label`
14137
13894
  }};
14138
13895
  }
14139
13896
 
14140
- ${Input$1}:checked + ${Box} ${BoxFill} {
13897
+ ${Input}:checked + ${Box} ${BoxFill} {
14141
13898
  fill: ${_ref10 => {
14142
13899
  let {
14143
13900
  theme: {
@@ -14155,7 +13912,7 @@ const Label = styled.label`
14155
13912
  transition: all ${transition.press}; // appear
14156
13913
  }
14157
13914
 
14158
- ${Input$1}:checked[disabled] + ${Box} ${BoxFill} {
13915
+ ${Input}:checked[disabled] + ${Box} ${BoxFill} {
14159
13916
  fill: ${_ref11 => {
14160
13917
  let {
14161
13918
  theme: {
@@ -14166,7 +13923,7 @@ const Label = styled.label`
14166
13923
  }};
14167
13924
  }
14168
13925
 
14169
- ${Input$1}:checked + ${Box} ${Check} {
13926
+ ${Input}:checked + ${Box} ${Check} {
14170
13927
  opacity: ${_ref12 => {
14171
13928
  let {
14172
13929
  indeterminate
@@ -14181,7 +13938,7 @@ const Label = styled.label`
14181
13938
  }}; // appear
14182
13939
  }
14183
13940
 
14184
- ${Input$1}:checked + ${Box} ${Square} {
13941
+ ${Input}:checked + ${Box} ${Square} {
14185
13942
  opacity: ${_ref14 => {
14186
13943
  let {
14187
13944
  indeterminate
@@ -14241,7 +13998,7 @@ const CheckboxComponent = _ref => {
14241
13998
  title: title
14242
13999
  }, label && labelLeft && React.createElement(LabelText, {
14243
14000
  labelLeft: true
14244
- }, label), React.createElement(Input$1, Object.assign({}, props)), React.createElement(Box, {
14001
+ }, label), React.createElement(Input, Object.assign({}, props)), React.createElement(Box, {
14245
14002
  labelLeft: labelLeft
14246
14003
  }, React.createElement(Svg, null, React.createElement(Border, null), React.createElement(BoxFill, null), React.createElement(Check, {
14247
14004
  indeterminate: indeterminate
@@ -14251,6 +14008,149 @@ const CheckboxComponent = _ref => {
14251
14008
  };
14252
14009
  const Checkbox = /*#__PURE__*/memo(CheckboxComponent);
14253
14010
 
14011
+ const ChipContainer = styled.span`
14012
+ display: inline-flex;
14013
+ align-items: center;
14014
+ padding: 0.3125rem 0.6875rem;
14015
+ background-color: ${_ref => {
14016
+ let {
14017
+ theme: {
14018
+ chip
14019
+ },
14020
+ ...props
14021
+ } = _ref;
14022
+ return chip.backgroundColor[getVariant(props)];
14023
+ }};
14024
+ border-radius: ${_ref2 => {
14025
+ let {
14026
+ theme: {
14027
+ borderRadius
14028
+ }
14029
+ } = _ref2;
14030
+ return borderRadius.large;
14031
+ }};
14032
+ `;
14033
+ const Text = styled.span`
14034
+ font: ${_ref3 => {
14035
+ let {
14036
+ theme: {
14037
+ fonts
14038
+ }
14039
+ } = _ref3;
14040
+ return fonts.description;
14041
+ }};
14042
+ color: ${_ref4 => {
14043
+ let {
14044
+ theme: {
14045
+ palette
14046
+ },
14047
+ isStandard,
14048
+ disabled
14049
+ } = _ref4;
14050
+ return disabled ? palette.textDisabled : isStandard ? palette.textPrimary : "#fff";
14051
+ }};
14052
+ `;
14053
+ const iconButtonMixin = css`
14054
+ && {
14055
+ height: 0.875rem;
14056
+ width: 0.875rem;
14057
+ margin-left: 0.875rem;
14058
+ cursor: pointer;
14059
+
14060
+ ${Icon} {
14061
+ height: 10px;
14062
+ width: 11px;
14063
+
14064
+ &:after {
14065
+ font-size: 0.6875rem;
14066
+ color: ${_ref5 => {
14067
+ let {
14068
+ theme: {
14069
+ palette
14070
+ }
14071
+ } = _ref5;
14072
+ return palette.textSecondary;
14073
+ }};
14074
+ }
14075
+ }
14076
+ }
14077
+ `;
14078
+ const ActionButton = /*#__PURE__*/styled(IconButton)`
14079
+ ${iconButtonMixin};
14080
+ `;
14081
+ const RegularIconButton = /*#__PURE__*/styled(IconButton)`
14082
+ ${iconButtonMixin};
14083
+ `;
14084
+ const TooltipContent = styled.div`
14085
+ max-width: 15rem;
14086
+ `;
14087
+
14088
+ const ChipComponent = _ref => {
14089
+ let {
14090
+ text,
14091
+ primary,
14092
+ secondary,
14093
+ error,
14094
+ additionalButton,
14095
+ additionalAction,
14096
+ onRemove,
14097
+ additionalButtonTooltip,
14098
+ removeButtonTooltip,
14099
+ disabled,
14100
+ tooltipDelay = 300,
14101
+ onMouseDown,
14102
+ children,
14103
+ ...props
14104
+ } = _ref;
14105
+ const remove = useCallback(e => {
14106
+ onRemove && onRemove(text, e);
14107
+ }, [onRemove, text]);
14108
+ const isStandard = !primary && !secondary && !error;
14109
+ return React.createElement(ChipContainer, Object.assign({
14110
+ primary: primary,
14111
+ secondary: secondary,
14112
+ error: error
14113
+ }, props), children, React.createElement(Text, {
14114
+ isStandard: isStandard,
14115
+ disabled: disabled
14116
+ }, text), React.createElement(ThemeProvider, {
14117
+ theme: isStandard ? theme : theme$1
14118
+ }, React.createElement(React.Fragment, null, additionalButton && (additionalButtonTooltip ? React.createElement(Tooltip, {
14119
+ arrow: true,
14120
+ placement: "top",
14121
+ content: React.createElement(TooltipContent, null, additionalButtonTooltip),
14122
+ delay: tooltipDelay ? [tooltipDelay, tooltipDelay] : undefined
14123
+ }, ref => React.createElement(ActionButton, {
14124
+ kind: additionalButton,
14125
+ onClick: additionalAction,
14126
+ innerRef: ref
14127
+ })) : React.createElement(RegularIconButton, {
14128
+ kind: additionalButton,
14129
+ onClick: additionalAction
14130
+ })), !!onRemove && (removeButtonTooltip ? React.createElement(Tooltip, {
14131
+ arrow: true,
14132
+ placement: "top",
14133
+ content: React.createElement(TooltipContent, null, removeButtonTooltip),
14134
+ delay: tooltipDelay ? [tooltipDelay, tooltipDelay] : undefined
14135
+ }, ref => React.createElement(ActionButton, {
14136
+ kind: "close",
14137
+ innerRef: ref,
14138
+ onClick: e => {
14139
+ e.stopPropagation();
14140
+ remove(e);
14141
+ }
14142
+ })) : React.createElement(RegularIconButton, {
14143
+ kind: "close",
14144
+ onMouseDown: e => e.stopPropagation(),
14145
+ onClick: e => {
14146
+ e.stopPropagation();
14147
+ remove(e);
14148
+ }
14149
+ })))));
14150
+ };
14151
+
14152
+ const Chip = /*#__PURE__*/memo(ChipComponent);
14153
+
14254
14154
  const scale = 32;
14255
14155
 
14256
14156
  const rotate = keyframes`
@@ -14498,7 +14398,123 @@ const ColorButton = _ref7 => {
14498
14398
  }), React.createElement(Background, {
14499
14399
  color: color
14500
14400
  }));
14501
- };
14401
+ };
14402
+
14403
+ const WideChip = /*#__PURE__*/styled(_ref => {
14404
+ let { ...props
14405
+ } = _ref;
14406
+ return React.createElement(Chip, Object.assign({}, props));
14407
+ })`
14408
+ height: 1rem;
14409
+ cursor: default;
14410
+
14411
+ ${ChipContainer} {
14412
+ width: 100%;
14413
+ justify-content: space-between;
14414
+ }
14415
+ `;
14416
+
14417
+ const CheckMark = /*#__PURE__*/styled(Icon)`
14418
+ position: absolute;
14419
+ right: -1.5rem;
14420
+ color: ${_ref => {
14421
+ let {
14422
+ theme: {
14423
+ palette
14424
+ }
14425
+ } = _ref;
14426
+ return palette.primary;
14427
+ }};
14428
+ `;
14429
+
14430
+ const InputComponent = _ref => {
14431
+ var _valuePrefixRef$curre, _valuePrefixRef$curre2;
14432
+
14433
+ let {
14434
+ width = "14rem",
14435
+ iconAfter,
14436
+ iconBefore,
14437
+ valuePrefix,
14438
+ children,
14439
+ disabled,
14440
+ success,
14441
+ innerRef,
14442
+ disableInputOnly,
14443
+ asChip,
14444
+ onRemove,
14445
+ active,
14446
+ onMouseDown,
14447
+ ...props
14448
+ } = _ref;
14449
+ const valuePrefixRef = useRef(null);
14450
+ const [, setRefVisible] = useState(false);
14451
+ const realChildren = getRealChildren(children);
14452
+ const childrenCount = realChildren.length;
14453
+ const paddingRight = childrenCount * 2 + (iconAfter ? 32 : 0);
14454
+ return React.createElement(InputContainer, {
14455
+ disabled: disabled,
14456
+ error: props.error,
14457
+ width: width,
14458
+ active: active
14459
+ }, iconBefore && React.createElement(IconBefore, {
14460
+ onMouseDown: preventDefault
14461
+ }, iconBefore), valuePrefix && React.createElement(ValuePrefix, {
14462
+ onMouseDown: preventDefault,
14463
+ ref: el => {
14464
+ valuePrefixRef.current = el;
14465
+ setRefVisible(!!el);
14466
+ }
14467
+ }, valuePrefix), props.value && asChip ? React.createElement(ChipInputHolder, {
14468
+ paddingLeft: !!iconBefore,
14469
+ paddingRight: paddingRight,
14470
+ extraLeftPaddingWidth: ((_valuePrefixRef$curre = valuePrefixRef.current) == null ? void 0 : _valuePrefixRef$curre.getBoundingClientRect().width) ?? undefined,
14471
+ ref: innerRef,
14472
+ onMouseDown: onMouseDown
14473
+ }, React.createElement(WideChip, {
14474
+ text: `${props.value}`,
14475
+ onRemove: onRemove,
14476
+ onMouseDown: e => {
14477
+ e.stopPropagation(); // @ts-ignore
14478
+
14479
+ onMouseDown && onMouseDown(e);
14480
+ },
14481
+ primary: true
14482
+ })) : React.createElement(StyledInput, Object.assign({
14483
+ ref: innerRef,
14484
+ width: width,
14485
+ disabled: disabled || disableInputOnly,
14486
+ paddingLeft: !!iconBefore,
14487
+ extraLeftPaddingWidth: ((_valuePrefixRef$curre2 = valuePrefixRef.current) == null ? void 0 : _valuePrefixRef$curre2.getBoundingClientRect().width) ?? undefined,
14488
+ paddingRight: paddingRight,
14489
+ onMouseDown: onMouseDown
14490
+ }, props)), iconAfter ? React.createElement(IconAfter, {
14491
+ indent: 0
14492
+ }, iconAfter) : React.createElement(React.Fragment, null, realChildren.map((child, index) => React.createElement(IconAfter, {
14493
+ onMouseDown: preventDefault,
14494
+ indent: 2 * index,
14495
+ key: index
14496
+ }, child))), success && React.createElement(CheckMark, {
14497
+ kind: "success"
14498
+ }));
14499
+ };
14500
+
14501
+ const Input$1 = /*#__PURE__*/withLabel( /*#__PURE__*/memo(InputComponent));
14502
+
14503
+ /* eslint-disable @typescript-eslint/no-explicit-any */
14504
+ const MaskedComponent = /*#__PURE__*/IMaskMixin(_ref => {
14505
+ let {
14506
+ innerRef,
14507
+ inputRef,
14508
+ ...props
14509
+ } = _ref;
14510
+ const attachRef = useCallback(ref => {
14511
+ sendRefSafety(inputRef, ref);
14512
+ sendRefSafety(innerRef, ref);
14513
+ }, [innerRef, inputRef]);
14514
+ return React.createElement(Input$1, Object.assign({}, props, {
14515
+ innerRef: attachRef
14516
+ }));
14517
+ });
14502
14518
 
14503
14519
  const Container = styled.div`
14504
14520
  position: relative;
@@ -18765,7 +18781,7 @@ const ColorPicker = /*#__PURE__*/memo(ColorPickerComponent);
18765
18781
  const OptionContainer = styled.div`
18766
18782
  display: flex;
18767
18783
  justify-content: flex-start;
18768
- align-items: flex-start;
18784
+ align-items: center;
18769
18785
  min-height: 1.25em;
18770
18786
  padding: 0.75rem 1rem;
18771
18787
  color: ${_ref => {
@@ -18864,6 +18880,44 @@ const OptionValueContainer = styled.span`
18864
18880
  display: flex;
18865
18881
  flex-direction: column;
18866
18882
  `;
18883
+ const OptionToggler = /*#__PURE__*/styled(LegendToggler)`
18884
+ padding: 1rem 1rem 0.25rem 1rem;
18885
+
18886
+ ${Icon} + span {
18887
+ font: ${_ref7 => {
18888
+ let {
18889
+ theme: {
18890
+ fonts
18891
+ }
18892
+ } = _ref7;
18893
+ return fonts.description;
18894
+ }};
18895
+ }
18896
+
18897
+ ${Icon}, ${Icon} + span {
18898
+ color: ${_ref8 => {
18899
+ let {
18900
+ theme: {
18901
+ palette
18902
+ }
18903
+ } = _ref8;
18904
+ return palette.textDisabled;
18905
+ }};
18906
+ }
18907
+
18908
+ :hover {
18909
+ ${Icon}, ${Icon} + span {
18910
+ color: ${_ref9 => {
18911
+ let {
18912
+ theme: {
18913
+ palette
18914
+ }
18915
+ } = _ref9;
18916
+ return palette.textPrimary;
18917
+ }};
18918
+ }
18919
+ }
18920
+ `;
18867
18921
 
18868
18922
  const isSelected = (item, selectedOptions) => {
18869
18923
  if (selectedOptions && selectedOptions.length > 0) {
@@ -18896,6 +18950,7 @@ const OptionComponent = _ref => {
18896
18950
  value,
18897
18951
  text,
18898
18952
  icon,
18953
+ prefix,
18899
18954
  disabled,
18900
18955
  description,
18901
18956
  primary,
@@ -18940,7 +18995,7 @@ const OptionComponent = _ref => {
18940
18995
  name: value,
18941
18996
  value: value,
18942
18997
  disabled: disabled
18943
- }), !!icon && React.createElement(OptionIcon, null, React.createElement(Icon, {
18998
+ }), prefix, !!icon && React.createElement(OptionIcon, null, React.createElement(Icon, {
18944
18999
  kind: icon,
18945
19000
  disabled: disabled
18946
19001
  })), React.createElement(OptionValueWrapper, null, React.createElement(OptionValueContainer, null, React.createElement(OptionText, {
@@ -18959,7 +19014,7 @@ function removeItem(array, index) {
18959
19014
  }
18960
19015
  function addItem(array, newItem) {
18961
19016
  return array.concat([newItem]);
18962
- }
19017
+ } // eslint-disable-next-line max-lines-per-function
18963
19018
 
18964
19019
  const MenuComponent = _ref => {
18965
19020
  let {
@@ -18994,47 +19049,64 @@ const MenuComponent = _ref => {
18994
19049
 
18995
19050
  selectOption && selectOption(newOptions, item);
18996
19051
  }, [children, loading, multiple, options, selectOption, selectedOptions, setFocusedOption]);
19052
+ const formatOptions = useCallback(() => {
19053
+ return options == null ? void 0 : options.reduce((result, current, index) => ({ ...result,
19054
+ [index]: current.opened ?? true
19055
+ }), {});
19056
+ }, [options]);
19057
+ const [visibleGroups, setVisibleGroups] = useState(formatOptions());
19058
+ const toggleVisibleGroup = useCallback(index => {
19059
+ setVisibleGroups({ ...visibleGroups,
19060
+ [index]: !(visibleGroups != null && visibleGroups[index])
19061
+ });
19062
+ }, [visibleGroups]);
19063
+ const getOptionsArray = useCallback((currentOptions, i) => {
19064
+ const result = [];
19065
+ const titleOption = currentOptions[0].title ? currentOptions[0] : null;
19066
+
19067
+ if (titleOption) {
19068
+ result.push(React.createElement(OptionToggler, {
19069
+ toggled: visibleGroups == null ? void 0 : visibleGroups[i || 0],
19070
+ onClick: () => toggleVisibleGroup(i || 0)
19071
+ }, titleOption.text));
19072
+ }
19073
+
19074
+ result.push(...currentOptions.filter(_ref2 => {
19075
+ let {
19076
+ title
19077
+ } = _ref2;
19078
+ return !title && (visibleGroups == null ? void 0 : visibleGroups[i || 0]);
19079
+ }).map(item => {
19080
+ return React.createElement(Option, {
19081
+ key: `opt-${item.value}`,
19082
+ item: item,
19083
+ selectedOptions: selectedOptions,
19084
+ multiple: multiple,
19085
+ heading: item.heading || loading,
19086
+ select: select
19087
+ });
19088
+ }));
19089
+
19090
+ if (!titleOption && i !== undefined && i > 0) {
19091
+ result.push(React.createElement(DividerLine, null));
19092
+ }
19093
+
19094
+ return result;
19095
+ }, [visibleGroups, toggleVisibleGroup, multiple, loading, select, selectedOptions]);
18997
19096
  const renderOptions = useMemo(() => {
18998
19097
  if (!(options != null && options.length)) return null;
18999
- let newElements = [];
19000
-
19001
- for (let i = 0; i < options.length; i++) {
19002
- let newArr = [];
19003
-
19004
- if (Array.isArray(options[i])) {
19005
- const curOption = options[i];
19006
- newArr = curOption.map(item => {
19007
- return React.createElement(Option, {
19008
- key: `arr-${item.value}` || "null-child-value",
19009
- item: item,
19010
- select: select,
19011
- selectedOptions: selectedOptions,
19012
- multiple: multiple
19013
- });
19014
- });
19098
+ const result = [];
19015
19099
 
19016
- if (i > 0) {
19017
- newElements = newElements.concat(React.createElement(DividerLine, {
19018
- key: `divider${i}`
19019
- }));
19020
- }
19021
- } else {
19022
- const curOption = options[i];
19023
- newArr.push(React.createElement(Option, {
19024
- key: `opt-${curOption.text}-${i}`,
19025
- heading: curOption.heading || loading,
19026
- item: curOption,
19027
- selectedOptions: selectedOptions,
19028
- multiple: multiple,
19029
- select: select
19030
- }));
19100
+ if (Array.isArray(options[0])) {
19101
+ for (let i = 0; i < options.length; i++) {
19102
+ result.push(...getOptionsArray(options[i], i));
19031
19103
  }
19032
-
19033
- newElements = newElements.concat(newArr);
19104
+ } else {
19105
+ result.push(...getOptionsArray(options));
19034
19106
  }
19035
19107
 
19036
- return newElements;
19037
- }, [loading, multiple, options, select, selectedOptions]);
19108
+ return result;
19109
+ }, [options, getOptionsArray]);
19038
19110
  const renderChildren = useMemo(() => {
19039
19111
  if (!children || multiple) return null; // options passed as children
19040
19112
 
@@ -19043,6 +19115,7 @@ const MenuComponent = _ref => {
19043
19115
  text,
19044
19116
  value,
19045
19117
  icon,
19118
+ prefix,
19046
19119
  onClick,
19047
19120
  synthKey,
19048
19121
  disabled
@@ -19054,12 +19127,15 @@ const MenuComponent = _ref => {
19054
19127
  onClick: onClick,
19055
19128
  disabled: disabled,
19056
19129
  heading: loading
19057
- }, icon && React.createElement(OptionIcon, null, React.createElement(Icon, {
19130
+ }, prefix, icon && React.createElement(OptionIcon, null, React.createElement(Icon, {
19058
19131
  kind: icon,
19059
19132
  disabled: disabled
19060
19133
  })), text || item);
19061
19134
  });
19062
19135
  }, [children, className, loading, multiple]);
19136
+ useEffect(() => {
19137
+ setVisibleGroups(formatOptions()); // eslint-disable-next-line react-hooks/exhaustive-deps
19138
+ }, [options]);
19063
19139
  return React.createElement(React.Fragment, null, title, title && React.createElement(DividerLine, {
19064
19140
  style: {
19065
19141
  marginTop: 0
@@ -19627,7 +19703,7 @@ const DropdownComponent = _ref => {
19627
19703
  }, searchable && React.createElement(SearchInputContainer, {
19628
19704
  width: menuWidth ?? width,
19629
19705
  minWidth: menuMinWidth ?? width
19630
- }, React.createElement(Input, {
19706
+ }, React.createElement(Input$1, {
19631
19707
  value: search,
19632
19708
  onChange: e => setSearch(e.target.value),
19633
19709
  placeholder: searchPlaceholder ?? "Найти",
@@ -20117,7 +20193,7 @@ const SearchFieldComponent = _ref => {
20117
20193
  onSearchRequest();
20118
20194
  }
20119
20195
  }, [onSearchRequest]);
20120
- return React.createElement(Input, Object.assign({
20196
+ return React.createElement(Input$1, Object.assign({
20121
20197
  type: "text",
20122
20198
  placeholder: placeholder
20123
20199
  }, props, {
@@ -21128,7 +21204,7 @@ const InputComponent$1 = _ref => {
21128
21204
  marginLeft: "0.5rem"
21129
21205
  }
21130
21206
  }, selectedSuggestion == null ? void 0 : selectedSuggestion.prefix) : null;
21131
- return React.createElement(Input, Object.assign({
21207
+ return React.createElement(Input$1, Object.assign({
21132
21208
  iconBefore: icon || prefix
21133
21209
  }, props));
21134
21210
  };
@@ -22334,7 +22410,7 @@ const ChipInputComponent = _ref => {
22334
22410
  }
22335
22411
  }, [changeChips, chipsProp, onChangeChips]);
22336
22412
  const chipOptions = createChipOptions();
22337
- return React.createElement(Container$3, null, React.createElement(RowFlex, null, React.createElement(Input, Object.assign({
22413
+ return React.createElement(Container$3, null, React.createElement(RowFlex, null, React.createElement(Input$1, Object.assign({
22338
22414
  value: value,
22339
22415
  onChange: onChangeInput,
22340
22416
  onKeyPress: handleKeyPress,
@@ -23244,7 +23320,7 @@ const TimeComponent = _ref => {
23244
23320
  const hasSeparator = index !== array.length - 1;
23245
23321
  return React.createElement(InputsGroup, {
23246
23322
  key: `time-input-${index}`
23247
- }, React.createElement(Input, {
23323
+ }, React.createElement(Input$1, {
23248
23324
  width: "2.6rem",
23249
23325
  label: !hasLabel ? "" : hasSeparator ? `${(timeLabelText || timeLabel)[key]} :` : (timeLabelText || timeLabel)[key],
23250
23326
  id: key,
@@ -25032,7 +25108,7 @@ const RangeNumberInputComponent = _ref => {
25032
25108
  anchor: ref => React.createElement(Anchor, {
25033
25109
  width: "100%",
25034
25110
  className: className
25035
- }, React.createElement(Input, {
25111
+ }, React.createElement(Input$1, {
25036
25112
  innerRef: ref,
25037
25113
  label: label,
25038
25114
  width: "100%",
@@ -25242,7 +25318,7 @@ _ref => {
25242
25318
  case "int64":
25243
25319
  case "int32":
25244
25320
  if (fromTable && selectedOption != null && selectedOption.range) {
25245
- return React.createElement(Input, {
25321
+ return React.createElement(Input$1, {
25246
25322
  label: label,
25247
25323
  width: "100%",
25248
25324
  iconBefore: prefix ?? renderMenu(options),
@@ -25286,7 +25362,7 @@ _ref => {
25286
25362
 
25287
25363
  case "string":
25288
25364
  if (fromTable && selectedOption != null && selectedOption.checkboxes) {
25289
- return React.createElement(Input, {
25365
+ return React.createElement(Input$1, {
25290
25366
  label: label,
25291
25367
  width: "100%",
25292
25368
  iconBefore: prefix ?? renderMenu(options),
@@ -25324,7 +25400,7 @@ _ref => {
25324
25400
  },
25325
25401
  onBlur: () => onFilterChange(selectedOption, filterValue !== "" ? filterValue : null),
25326
25402
  active: active
25327
- }, !isDisabled ? renderClearButton : undefined) : React.createElement(Input, {
25403
+ }, !isDisabled ? renderClearButton : undefined) : React.createElement(Input$1, {
25328
25404
  label: label,
25329
25405
  width: "100%",
25330
25406
  iconBefore: prefix ?? renderMenu(options),
@@ -28142,7 +28218,7 @@ const useObserveRect = () => {
28142
28218
 
28143
28219
  return () => rectObserver.current && rectObserver.current.unobserve();
28144
28220
  }, [node]);
28145
- const ref = useCallback(onSetNode, []);
28221
+ const ref = useCallback(onSetNode, [onSetNode]);
28146
28222
  return [ref, rect];
28147
28223
  };
28148
28224
 
@@ -28373,41 +28449,48 @@ const TreeItems = styled.ul`
28373
28449
  } = _ref;
28374
28450
  return isExpanded ? "auto" : 0;
28375
28451
  }};
28376
- margin: 0 0 0 1.5rem;
28452
+ margin: 0 0 0 0.5rem;
28377
28453
  padding: 0;
28378
28454
  list-style: none;
28379
28455
  overflow: hidden;
28456
+ transition: max-height ${transition.hover};
28380
28457
  `;
28381
- const TreeItem = styled.li`
28382
- margin-top: 1rem;
28383
- `;
28458
+ const TreeItemWrapper = styled.li``;
28384
28459
  const TreeRow = /*#__PURE__*/styled(Flex)`
28385
- cursor: ${_ref2 => {
28386
- let {
28387
- hasChildren
28388
- } = _ref2;
28389
- return hasChildren ? "pointer" : "default";
28390
- }};
28391
28460
  align-items: center;
28392
- line-height: 1.5rem;
28393
- ${_ref3 => {
28461
+ min-height: 1.5rem;
28462
+ ${_ref2 => {
28394
28463
  let {
28395
28464
  theme: {
28396
28465
  palette
28397
28466
  },
28398
28467
  disabled
28399
- } = _ref3;
28468
+ } = _ref2;
28400
28469
  return disabled && `color: ${palette.textDisabled}`;
28401
28470
  }};
28402
28471
 
28472
+ cursor: pointer;
28473
+
28474
+ &:hover {
28475
+ border-radius: 0.25rem;
28476
+ background-color: ${_ref3 => {
28477
+ let {
28478
+ theme
28479
+ } = _ref3;
28480
+ return theme.palette.elementDeep;
28481
+ }};
28482
+ }
28483
+
28403
28484
  ${Icon} {
28404
- margin-right: 0.75rem;
28485
+ width: 0.875rem;
28486
+ height: 0.875rem;
28487
+
28488
+ &:after {
28489
+ font-size: 0.875rem;
28490
+ }
28405
28491
  }
28406
28492
  `;
28407
- const ExpandButton = /*#__PURE__*/styled(Icon).attrs(props => ({
28408
- kind: "expand",
28409
- ...props
28410
- }))`
28493
+ const TreeExpand = /*#__PURE__*/styled(Icon)`
28411
28494
  visibility: ${_ref4 => {
28412
28495
  let {
28413
28496
  hasChildren
@@ -28418,53 +28501,162 @@ const ExpandButton = /*#__PURE__*/styled(Icon).attrs(props => ({
28418
28501
  let {
28419
28502
  isExpanded
28420
28503
  } = _ref5;
28421
- return isExpanded ? "rotate(-180deg)" : "";
28504
+ return isExpanded ? "" : "rotate(-90deg)";
28422
28505
  }};
28423
28506
  transition: transform ${transition.press};
28507
+ width: 0.875rem;
28508
+ height: 0.875rem;
28509
+ margin-top: -0.125rem;
28510
+ margin-right: 0.5rem;
28511
+ cursor: pointer;
28512
+
28513
+ &:after {
28514
+ font-size: 0.875rem;
28515
+ }
28424
28516
  `;
28425
28517
  const TreeContent = /*#__PURE__*/styled(Flex)`
28426
28518
  align-items: center;
28427
- `;
28428
- const ItemIcon = /*#__PURE__*/styled(Icon)`
28429
- margin-left: 0.25rem;
28519
+ gap: 0 0.25rem;
28430
28520
  `;
28431
28521
  const TreeText = styled.div`
28432
- margin-right: 0.75rem;
28522
+ font-size: 0.75rem;
28523
+ font-weight: ${_ref6 => {
28524
+ let {
28525
+ isLeaf
28526
+ } = _ref6;
28527
+ return isLeaf ? "600" : "normal";
28528
+ }};
28529
+ ${textOverflowEllipsisMixin}
28433
28530
  `;
28434
28531
  const TreeDescription = styled.div`
28435
28532
  margin-top: 2px;
28436
- margin-left: ${_ref6 => {
28533
+ margin-left: ${_ref7 => {
28437
28534
  let {
28438
28535
  isFolder
28439
- } = _ref6;
28536
+ } = _ref7;
28440
28537
  return isFolder ? "5.4" : "3.4";
28441
28538
  }}rem;
28442
- opacity: 0.54;
28443
- font-size: 14px;
28539
+ color: ${_ref8 => {
28540
+ let {
28541
+ theme: {
28542
+ palette
28543
+ }
28544
+ } = _ref8;
28545
+ return palette.textSecondary;
28546
+ }};
28547
+ font-size: 0.75rem;
28444
28548
  font-weight: 400;
28445
28549
  width: 100%;
28550
+
28551
+ ${textOverflowEllipsisMixin}
28552
+ `;
28553
+ const LoadMoreButton = styled.button`
28554
+ margin-top: 0.5rem;
28555
+ margin-left: 3.4rem;
28556
+ padding: 0.5rem 1rem;
28557
+ background: transparent;
28558
+ border: 1px solid ${_ref9 => {
28559
+ let {
28560
+ theme: {
28561
+ palette
28562
+ }
28563
+ } = _ref9;
28564
+ return palette.element;
28565
+ }};
28566
+ border-radius: ${_ref10 => {
28567
+ let {
28568
+ theme: {
28569
+ borderRadius
28570
+ }
28571
+ } = _ref10;
28572
+ return borderRadius.small;
28573
+ }};
28574
+ color: ${_ref11 => {
28575
+ let {
28576
+ theme: {
28577
+ palette
28578
+ }
28579
+ } = _ref11;
28580
+ return palette.textSecondary;
28581
+ }};
28582
+ font-size: 14px;
28583
+ cursor: pointer;
28584
+ transition: all ${transition.hover};
28585
+
28586
+ &:hover {
28587
+ background-color: ${_ref12 => {
28588
+ let {
28589
+ theme: {
28590
+ palette
28591
+ }
28592
+ } = _ref12;
28593
+ return palette.element;
28594
+ }};
28595
+ border-color: ${_ref13 => {
28596
+ let {
28597
+ theme: {
28598
+ palette
28599
+ }
28600
+ } = _ref13;
28601
+ return palette.primary;
28602
+ }};
28603
+ }
28604
+
28605
+ &:active {
28606
+ background-color: ${_ref14 => {
28607
+ let {
28608
+ theme: {
28609
+ palette
28610
+ }
28611
+ } = _ref14;
28612
+ return palette.element;
28613
+ }};
28614
+ }
28615
+
28616
+ &:disabled {
28617
+ opacity: 0.5;
28618
+ cursor: not-allowed;
28619
+ }
28620
+ `;
28621
+ const LoadingContainer = /*#__PURE__*/styled(Flex)`
28622
+ margin-left: 3.4rem;
28623
+ margin-top: 0.5rem;
28624
+ align-items: center;
28625
+ gap: 0.5rem;
28626
+ color: ${_ref15 => {
28627
+ let {
28628
+ theme: {
28629
+ palette
28630
+ }
28631
+ } = _ref15;
28632
+ return palette.textSecondary;
28633
+ }};
28634
+ font-size: 14px;
28446
28635
  `;
28447
28636
 
28448
- const TreeItem$1 = _ref => {
28637
+ const TreeItemComponent = _ref => {
28449
28638
  let {
28450
28639
  item,
28451
- hasChildren,
28452
- isChildExpanded,
28640
+ parentItem,
28641
+ isExpanded,
28453
28642
  isIndeterminate,
28454
28643
  isSelected,
28455
28644
  isDisabled,
28456
- chipValue,
28457
28645
  selectable,
28458
- expandIcon,
28459
- collapseIcon,
28460
- childIcon,
28461
28646
  renderTree,
28462
- onChange,
28463
- onClick
28647
+ loadMoreText = "Загрузить еще",
28648
+ withLoadMore,
28649
+ onLoadMore,
28650
+ onExpand,
28651
+ onSelect,
28652
+ onItemClick
28464
28653
  } = _ref;
28465
28654
  const {
28466
28655
  id,
28467
28656
  text,
28657
+ isLeaf,
28658
+ loading,
28659
+ totalCount = 0,
28468
28660
  icon,
28469
28661
  children,
28470
28662
  description,
@@ -28473,57 +28665,129 @@ const TreeItem$1 = _ref => {
28473
28665
  className,
28474
28666
  selectable: itemSelectable = true,
28475
28667
  withTooltip,
28476
- onClick: onItemClick
28668
+ onClick
28477
28669
  } = item;
28478
- return React.createElement(TreeItem, {
28670
+ const hasChildren = (children == null ? void 0 : children.length) > 0 || isLeaf;
28671
+ const onExpandClick = useCallback(event => {
28672
+ event.stopPropagation();
28673
+ onExpand(item, !isExpanded);
28674
+ }, [id, onExpand, isExpanded]);
28675
+ useEffect(() => {
28676
+ if (isExpanded) {
28677
+ // Notify on mount for partial load
28678
+ onExpand(item, true, true);
28679
+ }
28680
+ }, []);
28681
+ return React.createElement(TreeItemWrapper, {
28479
28682
  className: className
28480
28683
  }, React.createElement(TreeRow, {
28481
- onClick: onItemClick,
28684
+ onClick: () => onClick ? onClick() : onItemClick == null ? void 0 : onItemClick(item),
28482
28685
  disabled: isDisabled,
28483
28686
  hasChildren: hasChildren
28484
- }, React.createElement(ExpandButton, {
28485
- isExpanded: isChildExpanded,
28687
+ }, React.createElement(TreeExpand, {
28688
+ kind: "expand",
28689
+ isExpanded: isExpanded,
28486
28690
  hasChildren: hasChildren,
28487
28691
  disabled: isDisabled,
28488
- onClick: () => onClick(id, hasChildren)
28692
+ onClick: onExpandClick
28489
28693
  }), selectable && itemSelectable && React.createElement(Checkbox, {
28490
- onChange: () => onChange(item),
28694
+ onChange: () => onSelect == null ? void 0 : onSelect(item),
28491
28695
  checked: isSelected,
28492
28696
  indeterminate: isIndeterminate,
28493
28697
  disabled: isDisabled
28494
28698
  }), React.createElement(TreeContent, {
28495
- onClick: () => onClick(id, hasChildren)
28496
- }, (hasChildren ? expandIcon || collapseIcon : icon || childIcon) && !customIcon && React.createElement(ItemIcon, {
28497
- kind: hasChildren ? isChildExpanded ? expandIcon : collapseIcon : icon || childIcon
28498
- }), customIcon && icon, !withTooltip && React.createElement(TreeText, null, text), withTooltip && React.createElement(Tooltip, {
28699
+ onClick: () => onExpand(item, !isExpanded)
28700
+ }, (icon || isLeaf) && !customIcon && React.createElement(Icon, {
28701
+ kind: icon ? icon : "folder_outline"
28702
+ }), customIcon && customIcon, !withTooltip && React.createElement(TreeText, {
28703
+ isLeaf: isLeaf
28704
+ }, text), withTooltip && React.createElement(Tooltip, {
28499
28705
  arrow: true,
28500
28706
  content: text
28501
28707
  }, ref => React.createElement(TreeText, {
28708
+ isLeaf: isLeaf,
28502
28709
  ref: ref
28503
- }, text)), !!chipValue && React.createElement(Chip, {
28504
- text: chipValue,
28505
- disabled: isDisabled
28506
- }), additionalInfo), description && React.createElement(TreeDescription, {
28710
+ }, text)), additionalInfo), description && React.createElement(TreeDescription, {
28507
28711
  isFolder: hasChildren
28508
- }, description)), renderTree(children, isChildExpanded));
28712
+ }, description)), renderTree(children, isExpanded, parentItem), loading && isExpanded && React.createElement(LoadingContainer, null, React.createElement(CircularProgress, {
28713
+ diameter: 1
28714
+ })), withLoadMore && isExpanded && !!totalCount && (children == null ? void 0 : children.length) < totalCount && React.createElement(LoadMoreButton, {
28715
+ disabled: loading,
28716
+ onClick: () => onLoadMore == null ? void 0 : onLoadMore(item)
28717
+ }, loadMoreText));
28718
+ };
28719
+
28720
+ const TreeItem = /*#__PURE__*/memo(TreeItemComponent);
28721
+
28722
+ /**
28723
+ * Рекурсивно находит элемент дерева по id
28724
+ * @param items - массив элементов дерева
28725
+ * @param id - id искомого элемента
28726
+ * @returns найденный элемент или undefined, если элемент не найден
28727
+ */
28728
+ const findTreeItemById = (items, id) => {
28729
+ for (const item of items) {
28730
+ var _item$children;
28731
+
28732
+ if (item.id === id) {
28733
+ return item;
28734
+ }
28735
+
28736
+ if ((_item$children = item.children) != null && _item$children.length) {
28737
+ const found = findTreeItemById(item.children, id);
28738
+
28739
+ if (found) {
28740
+ return found;
28741
+ }
28742
+ }
28743
+ }
28744
+
28745
+ return undefined;
28746
+ };
28747
+ /**
28748
+ * Рекурсивно заменяет элемент дерева по id
28749
+ * @param items - массив элементов дерева
28750
+ * @param id - id элемента для замены
28751
+ * @param newItem - новый элемент или функция для обновления элемента
28752
+ * @returns новый массив элементов дерева с замененным элементом
28753
+ */
28754
+
28755
+ const replaceTreeItemById = (items, id, newItem) => {
28756
+ return items.map(item => {
28757
+ var _item$children2;
28758
+
28759
+ if (item.id === id) {
28760
+ return typeof newItem === "function" ? newItem(item) : newItem;
28761
+ }
28762
+
28763
+ if ((_item$children2 = item.children) != null && _item$children2.length) {
28764
+ return { ...item,
28765
+ children: replaceTreeItemById(item.children, id, newItem)
28766
+ };
28767
+ }
28768
+
28769
+ return item;
28770
+ });
28509
28771
  };
28510
28772
 
28511
28773
  const TreeComponent = _ref => {
28512
28774
  let {
28513
28775
  className,
28514
28776
  data = [],
28777
+ setData,
28778
+ loadNode,
28779
+ loadMoreText,
28515
28780
  selectable,
28516
28781
  selected = [],
28517
28782
  expanded = [],
28518
28783
  allExpanded,
28519
28784
  allSelected,
28520
- childIcon = "next",
28521
- collapseIcon = "folder_outline",
28522
- expandIcon = "folder_outline",
28523
28785
  setExpanded,
28524
28786
  setSelected,
28525
- customChip,
28526
- Item = TreeItem$1
28787
+ withLoadMore,
28788
+ onItemClick,
28789
+ onExpand,
28790
+ Item = TreeItem
28527
28791
  } = _ref;
28528
28792
  const expand = useCallback(id => {
28529
28793
  const newExpanded = [...expanded];
@@ -28537,11 +28801,59 @@ const TreeComponent = _ref => {
28537
28801
 
28538
28802
  setExpanded && setExpanded(newExpanded);
28539
28803
  }, [expanded, setExpanded]);
28540
- const onClick = useCallback((id, hasChildren) => {
28541
- if (hasChildren) {
28542
- expand(id);
28804
+ const onItemUpdate = useCallback((id, updateItem) => {
28805
+ setData == null ? void 0 : setData(current => replaceTreeItemById(current, id, updateItem));
28806
+ }, [setData]);
28807
+ const onItemExpand = useCallback(async (item, isExpanded, onlyReload) => {
28808
+ !onlyReload && expand(item.id);
28809
+
28810
+ if (item.isLeaf && (onlyReload || item.children === null) && loadNode) {
28811
+ try {
28812
+ onItemUpdate(item.id, currentItem => ({ ...currentItem,
28813
+ loading: true
28814
+ }));
28815
+ const {
28816
+ children,
28817
+ totalCount
28818
+ } = await loadNode(item);
28819
+ onItemUpdate(item.id, currentItem => ({ ...currentItem,
28820
+ children,
28821
+ totalCount
28822
+ }));
28823
+ } finally {
28824
+ onItemUpdate(item.id, currentItem => ({ ...currentItem,
28825
+ loading: false
28826
+ }));
28827
+ }
28828
+ }
28829
+
28830
+ onExpand == null ? void 0 : onExpand(item, isExpanded, onlyReload);
28831
+ }, [expand, onExpand, onItemUpdate, loadNode]);
28832
+ const onLoadMore = useCallback(async item => {
28833
+ if (!loadNode) {
28834
+ return;
28543
28835
  }
28544
- }, [expand]);
28836
+
28837
+ try {
28838
+ var _item$children;
28839
+
28840
+ onItemUpdate(item.id, currentItem => ({ ...currentItem,
28841
+ loading: true
28842
+ }));
28843
+ const {
28844
+ children,
28845
+ totalCount
28846
+ } = await loadNode(item, (_item$children = item.children) == null ? void 0 : _item$children.length);
28847
+ onItemUpdate(item.id, currentItem => ({ ...currentItem,
28848
+ children: [...(currentItem.children || []), ...children],
28849
+ totalCount
28850
+ }));
28851
+ } finally {
28852
+ onItemUpdate(item.id, currentItem => ({ ...currentItem,
28853
+ loading: false
28854
+ }));
28855
+ }
28856
+ }, [loadNode, onItemUpdate]);
28545
28857
  const getChildren = useCallback(items => {
28546
28858
  if (!items) return [];
28547
28859
  return items.reduce((result, item) => {
@@ -28628,25 +28940,14 @@ const TreeComponent = _ref => {
28628
28940
 
28629
28941
  setSelected(newSelected);
28630
28942
  }, [getChildren, removeItem, selected, setSelected]);
28631
- const onChange = useCallback(parent => {
28943
+ const onSelect = useCallback(parent => {
28632
28944
  if (getIsSomeSelected([parent])) {
28633
28945
  deselectChildren(parent);
28634
28946
  } else {
28635
28947
  selectChildren(parent);
28636
28948
  }
28637
28949
  }, [deselectChildren, getIsSomeSelected, selectChildren]);
28638
- const getChildrenChipsValue = useCallback(children => {
28639
- return children == null ? void 0 : children.reduce((result, item) => result + (Number(item.chip) || 0) + Number(getChildrenChipsValue(item == null ? void 0 : item.children) || 0), 0);
28640
- }, []);
28641
- const getChipValue = useCallback(_ref6 => {
28642
- let {
28643
- id,
28644
- chip,
28645
- children
28646
- } = _ref6;
28647
- return children != null && children.length && !customChip && !(expanded != null && expanded.includes(id)) ? getChildrenChipsValue(children) || Number(chip) || undefined : Number(chip) || undefined;
28648
- }, [expanded, getChildrenChipsValue, customChip]);
28649
- const renderTree = useCallback(function (items, isExpanded) {
28950
+ const renderTree = useCallback(function (items, isExpanded, parentItem) {
28650
28951
  if (isExpanded === void 0) {
28651
28952
  isExpanded = true;
28652
28953
  }
@@ -28654,45 +28955,43 @@ const TreeComponent = _ref => {
28654
28955
  return !(items != null && items.length) ? null : React.createElement(TreeItems, {
28655
28956
  isExpanded: isExpanded
28656
28957
  }, items.map(item => {
28657
- var _getChipValue;
28658
-
28659
28958
  const {
28660
28959
  id,
28661
28960
  children
28662
28961
  } = item;
28663
- const hasChildren = !!(children != null && children.length);
28664
- const isChildExpanded = expanded == null ? void 0 : expanded.includes(id);
28962
+ const isExpanded = expanded == null ? void 0 : expanded.includes(id);
28665
28963
  const isIndeterminate = getIsIndeterminate(children);
28666
28964
  const isSelected = isIndeterminate || getIsSomeSelected([item]);
28667
28965
  const isDisabled = getIsDisabled(item);
28668
- const chipValue = (_getChipValue = getChipValue(item)) == null ? void 0 : _getChipValue.toString();
28669
28966
  return React.createElement(Item, {
28670
28967
  key: id,
28968
+ parentItem: parentItem,
28671
28969
  item: item,
28672
- hasChildren: hasChildren,
28673
- isChildExpanded: isChildExpanded,
28970
+ isExpanded: isExpanded,
28674
28971
  isIndeterminate: isIndeterminate,
28675
28972
  isSelected: isSelected,
28676
28973
  isDisabled: isDisabled,
28677
- chipValue: chipValue,
28678
28974
  selectable: selectable,
28679
- expandIcon: expandIcon,
28680
- collapseIcon: collapseIcon,
28681
- childIcon: childIcon,
28975
+ loadMoreText: loadMoreText,
28682
28976
  renderTree: renderTree,
28683
- onChange: onChange,
28684
- onClick: onClick
28977
+ onSelect: onSelect,
28978
+ onExpand: onItemExpand,
28979
+ onItemClick: onItemClick,
28980
+ withLoadMore: withLoadMore,
28981
+ onLoadMore: onLoadMore,
28982
+ setData: setData,
28983
+ onItemUpdate: onItemUpdate
28685
28984
  });
28686
28985
  }));
28687
- }, [expanded, getChipValue, getIsIndeterminate, getIsSomeSelected, getIsDisabled, selectable, expandIcon, collapseIcon, childIcon, onClick, onChange]);
28986
+ }, [expanded, getIsIndeterminate, getIsSomeSelected, getIsDisabled, selectable, withLoadMore, onLoadMore, onItemClick, onSelect, onItemExpand, setData, onItemUpdate]);
28688
28987
  useEffect(() => {
28689
28988
  if (!data.length || !allExpanded && !allSelected) return;
28690
28989
  const newExpanded = [];
28691
28990
  const newSelected = [];
28692
28991
  getChildren(data).forEach(item => {
28693
- var _item$children;
28992
+ var _item$children2;
28694
28993
 
28695
- if ((_item$children = item.children) != null && _item$children.length) {
28994
+ if ((_item$children2 = item.children) != null && _item$children2.length) {
28696
28995
  newExpanded.push(item.id);
28697
28996
  } else if (!item.disabled) {
28698
28997
  newSelected.push(item.id);
@@ -31002,5 +31301,5 @@ const JSONEditorBase = _ref => {
31002
31301
 
31003
31302
  const JSONEditor = /*#__PURE__*/memo(JSONEditorBase);
31004
31303
 
31005
- export { ActionButton, Actions, ActionsGroup, AdditionalInfo, AnchorContainer, AutoComplete, BaseButton, Blank, Box, ButtonsGroup, ButtonsGroupComponent, CSSTransition, Card, CardBodyContainer, Header$1 as CardHeader, ImageGradientOverlay as CardImageGradientOverlay, ImageOverlay as CardImageOverlay, CardLoader, Checkbox, CheckboxComponent, Chip, ChipAutoCompleDivider, ChipAutoCompleSlider, ChipAutoComplete, ChipAutoCompleteControlFlex, ChipAutoCompleteImagePlaceholder, ChipAutoCompleteItem, ChipAutoCompleteItemIcon, ChipAutoCompleteItemImage, ChipAutoCompleteMode, ChipAutoCompleteTags, ChipContainer, ChipInput, Circle, CircularProgress, Collapse, CollapseWrapper, ColorButton, ColorInput, ColorPicker, ComparisonOperator, Container$5 as Container, CustomButton, CustomToggle, DATE_FORMAT, DATE_TIME_FORMAT, DataGrid, DatePicker, Description, Dialog, DialogActions, DialogComponent, DialogContent, DialogOverlay, DialogTitle, Divider, DividerLine, DragAreaWrapper, DraggableTree, DraggableTreeContainer, DraggableTreeItem, DropHereTitle, Dropdown, DropdownContainer, DropdownField, ElementsArea, ExpandButton, Expander, FILE_SIZE_STEP, FadingIcon, FieldValue, FileExt, FileInfoComment, FileInfoName, FileInfoProgress, FileInfoTitle, FileSymbolContainer, FilterInput, FlatButton, Flex, FlexSpan, FocusTrap, GlobalsContainer, H1, H2, H3, H4, Handlers, HueMap, HueSlider, selection as IcoMoonSelection, Icon, IconButton, IconButtonButton, IconButtonInnerChild, IconMenu, IconToggle, IconToggleButton, IconToggleText, Image, ImageLoader, InjectGlobalStyles, Input, InputLabel, InputsGroup, InputsGroupContainer, InputsGroupELement, InputsGroupElements, InputsGroupLabel, ItemContainer, ItemIcon, JSONEditor, JSONEditorContainer, JSONEditorLinearProgress, JSONEditorWrapper, Label$2 as Label, LabeledTextarea, LeftSide, LegendToggler, LinearLoader, LinearProgress, Link, ListTransition, MAX_NUMBER, MB_FILE_SIZE, MIN_NUMBER, MaskedComponent, Menu, MenuContainer, Message, MultiSelectContainer, Notifications, NumberInput, NumberRangeContainer, NumberRangeInputContainer, NumberRangeSlider, NumberRangeSliderContainer, NumberRangeSliderLabel, OpacitySlider, Option, OptionContainer, OptionDescription, OptionIcon, OptionText, OptionValueContainer, OptionValueWrapper, PaginationFull, PaginationSimple, Paragraph, PasswordToggle, Placeholder, Popover, PopoverTransition, Popup$1 as Popup, Portal, Preview, Radio$1 as Radio, RadioGroup, RaisedButton, RangeDateInput, RangeDatePicker, RangeNumberInput, RangeSliderButtons, RangeSliderContainer, RatioLine, RegularIconButton, SEPARATED_TIME_FORMAT, SearchField, SearchInputContainer, SelectFromComputerTitle, SimpleInput, Slider, SliderContainer$2 as SliderContainer, HandleContainer as SliderHandle, Label$1 as SliderLabel, LowerTrackBackground as SliderLowerTrackBackground, SliderPopover, Track as SliderTrack, SortToggle, Spinner, Stepper, Switch, SwitchArea, SwitchContainer, SwitchTitle, Switcher, SymbolLibrary, SymbolPreview, THROTTLING_DELAY, TIME_FORMAT, TabBlock, TabContainer, TabContainerLine, Tabs, Text, TextTrim, Textarea, ThemeProvider, Tippy, TitleText, Tooltip, TooltipContent, Tree, TreeContainer, TreeContent, TreeDescription, TreeItem, TreeItems, TreeRow, TreeText, UnicodeBig, UnicodeSmall, Uploader, UploaderItemArea, UploaderItemsContainer, UploaderTitle, UploaderTitleContainer, UploaderTitleImage, UploaderTitleWrapper, ValueLink, WaitingButton, WaitingButtonComponent, WithLabelContainer, Wizard, addItem, borderRadius, buttonMixin, clamp, cloneWithRefs, collapseDuration, combineRefs, createColorOrMono, createIconColors, createLinkStates, createMessageColors, createTheme, createToggleStates, createVariants, cropLeftBorderRadius, cropRightBorderRadius, theme$1 as darkTheme, dateFormat, defaultOptions, defaultStub, theme as defaultTheme, fileSizeFormat, fonts, getChipColor, getColorOrMono, getHighlightParts, getIconColors, getLinkColors, getLocale, getMessageColors, getNumberFromPixels, getRealChildren, getTagColor, getTextWidth, getTheme, getToggleStates, getUnicodeFromString, getVariant, horizontalDivider, iconTypes, injectIcon, isDefined, isDescendant, isDomNode, isNumeric, isOutside, isReactDomElement, isReactElement, isSimpleStyledComponent, isTextFitElementWidth, isTouchDevice, isValidUrl, mapToSimpleOption, palette, photo, preventDefault, randomInteger, randomRgba, rangeValueFormat, removeItem, sendRefSafety, shadows, sortNumbers, stub, textOverflowEllipsisMixin, toNumber, toSimpleOption, transition, transparencyDark2, transparencyDark4, Transparency_dark8 as transparencyDark8, transparencyLight2, transparencyLight4, Transparency_light8 as transparencyLight8, typeId, urlify, useAsyncAutocomplete, useDelayedStyleLoader, useDialogShadow, useDragAndDropEffect, useEventListener, useForceUpdate, useMounted, useMutationObserver, usePrevValue, useStyleLoader, useTheme, useThrottling, useToggle, useUndraggableEffect, useUnselectableEffect, verticalDivider, withLabel };
31304
+ export { ActionButton, Actions, ActionsGroup, AdditionalInfo, AnchorContainer, AutoComplete, BaseButton, Blank, Box, ButtonsGroup, ButtonsGroupComponent, CSSTransition, Card, CardBodyContainer, Header$1 as CardHeader, ImageGradientOverlay as CardImageGradientOverlay, ImageOverlay as CardImageOverlay, CardLoader, Checkbox, CheckboxComponent, Chip, ChipAutoCompleDivider, ChipAutoCompleSlider, ChipAutoComplete, ChipAutoCompleteControlFlex, ChipAutoCompleteImagePlaceholder, ChipAutoCompleteItem, ChipAutoCompleteItemIcon, ChipAutoCompleteItemImage, ChipAutoCompleteMode, ChipAutoCompleteTags, ChipContainer, ChipInput, Circle, CircularProgress, Collapse, CollapseWrapper, ColorButton, ColorInput, ColorPicker, ComparisonOperator, Container$5 as Container, CustomButton, CustomToggle, DATE_FORMAT, DATE_TIME_FORMAT, DataGrid, DatePicker, Description, Dialog, DialogActions, DialogComponent, DialogContent, DialogOverlay, DialogTitle, Divider, DividerLine, DragAreaWrapper, DraggableTree, DraggableTreeContainer, DraggableTreeItem, DropHereTitle, Dropdown, DropdownContainer, DropdownField, ElementsArea, Expander, FILE_SIZE_STEP, FadingIcon, FieldValue, FileExt, FileInfoComment, FileInfoName, FileInfoProgress, FileInfoTitle, FileSymbolContainer, FilterInput, FlatButton, Flex, FlexSpan, FocusTrap, GlobalsContainer, H1, H2, H3, H4, Handlers, HueMap, HueSlider, selection as IcoMoonSelection, Icon, IconButton, IconButtonButton, IconButtonInnerChild, IconMenu, IconToggle, IconToggleButton, IconToggleText, Image, ImageLoader, InjectGlobalStyles, Input$1 as Input, InputsGroup, InputsGroupContainer, InputsGroupELement, InputsGroupElements, InputsGroupLabel, ItemContainer, JSONEditor, JSONEditorContainer, JSONEditorLinearProgress, JSONEditorWrapper, Label$2 as Label, LabeledTextarea, LeftSide, LegendToggler, LinearLoader, LinearProgress, Link, ListTransition, LoadMoreButton, LoadingContainer, MAX_NUMBER, MB_FILE_SIZE, MIN_NUMBER, MaskedComponent, Menu, MenuContainer, Message, MultiSelectContainer, Notifications, NumberInput, NumberRangeContainer, NumberRangeInputContainer, NumberRangeSlider, NumberRangeSliderContainer, NumberRangeSliderLabel, OpacitySlider, Option, OptionContainer, OptionDescription, OptionIcon, OptionText, OptionToggler, OptionValueContainer, OptionValueWrapper, PaginationFull, PaginationSimple, Paragraph, PasswordToggle, Placeholder, Popover, PopoverTransition, Popup$1 as Popup, Portal, Preview, Radio$1 as Radio, RadioGroup, RaisedButton, RangeDateInput, RangeDatePicker, RangeNumberInput, RatioLine, RegularIconButton, SEPARATED_TIME_FORMAT, SearchField, SearchInputContainer, SelectFromComputerTitle, SimpleInput, Slider, SliderContainer$2 as SliderContainer, HandleContainer as SliderHandle, Label$1 as SliderLabel, LowerTrackBackground as SliderLowerTrackBackground, SliderPopover, Track as SliderTrack, SortToggle, Spinner, Stepper, Switch, SwitchArea, SwitchContainer, SwitchTitle, Switcher, SymbolLibrary, SymbolPreview, THROTTLING_DELAY, TIME_FORMAT, TabBlock, TabContainer, TabContainerLine, Tabs, Text, TextTrim, Textarea, ThemeProvider, Tippy, TitleText, Tooltip, TooltipContent, Tree, TreeContainer, TreeContent, TreeDescription, TreeExpand, TreeItem, TreeItemWrapper, TreeItems, TreeRow, TreeText, UnicodeBig, UnicodeSmall, Uploader, UploaderItemArea, UploaderItemsContainer, UploaderTitle, UploaderTitleContainer, UploaderTitleImage, UploaderTitleWrapper, ValueLink, WaitingButton, WaitingButtonComponent, WithLabelContainer, Wizard, addItem, borderRadius, buttonMixin, clamp, cloneWithRefs, collapseDuration, combineRefs, createColorOrMono, createIconColors, createLinkStates, createMessageColors, createTheme, createToggleStates, createVariants, cropLeftBorderRadius, cropRightBorderRadius, theme$1 as darkTheme, dateFormat, defaultOptions, defaultStub, theme as defaultTheme, fileSizeFormat, findTreeItemById, fonts, getChipColor, getColorOrMono, getHighlightParts, getIconColors, getLinkColors, getLocale, getMessageColors, getNumberFromPixels, getRealChildren, getTagColor, getTextWidth, getTheme, getToggleStates, getUnicodeFromString, getVariant, horizontalDivider, iconTypes, injectIcon, isDefined, isDescendant, isDomNode, isNumeric, isOutside, isReactDomElement, isReactElement, isSimpleStyledComponent, isTextFitElementWidth, isTouchDevice, isValidUrl, mapToSimpleOption, palette, photo, preventDefault, randomInteger, randomRgba, rangeValueFormat, removeItem, replaceTreeItemById, sendRefSafety, shadows, sortNumbers, stub, textOverflowEllipsisMixin, toNumber, toSimpleOption, transition, transparencyDark2, transparencyDark4, Transparency_dark8 as transparencyDark8, transparencyLight2, transparencyLight4, Transparency_light8 as transparencyLight8, typeId, urlify, useAsyncAutocomplete, useDelayedStyleLoader, useDialogShadow, useDragAndDropEffect, useEventListener, useForceUpdate, useMounted, useMutationObserver, usePrevValue, useStyleLoader, useTheme, useThrottling, useToggle, useUndraggableEffect, useUnselectableEffect, verticalDivider, withLabel };
31006
31305
  //# sourceMappingURL=uilib-gl.esm.js.map