@plurid/plurid-ui-components-react 0.0.0-19 → 0.0.0-20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/distribution/components/pluridal/containers/EntityView/index.d.ts +32 -0
  2. package/distribution/components/pluridal/containers/EntityView/logic.d.ts +8 -0
  3. package/distribution/components/pluridal/containers/EntityView/styled.d.ts +25 -0
  4. package/distribution/components/pluridal/containers/index.d.ts +5 -0
  5. package/distribution/components/pluridal/head/Head/index.d.ts +11 -1
  6. package/distribution/components/pluridal/head/index.d.ts +12 -1
  7. package/distribution/components/pluridal/index.d.ts +38 -5
  8. package/distribution/components/pluridal/notifications/Notifications/index.d.ts +10 -1
  9. package/distribution/components/pluridal/notifications/index.d.ts +14 -1
  10. package/distribution/components/pluridal/sitting/SittingTray/components/Sittings/index.d.ts +3 -1
  11. package/distribution/components/pluridal/sitting/SittingTray/components/StateImage/index.d.ts +3 -1
  12. package/distribution/components/pluridal/sitting/SittingTray/components/StateLine/index.d.ts +3 -1
  13. package/distribution/components/pluridal/sitting/SittingTray/components/StateLink/index.d.ts +3 -1
  14. package/distribution/components/pluridal/sitting/SittingTray/index.d.ts +3 -1
  15. package/distribution/components/pluridal/sitting/index.d.ts +3 -1
  16. package/distribution/components/pluridal/toolbars/ToolbarGeneral/index.d.ts +3 -1
  17. package/distribution/components/pluridal/toolbars/ToolbarSpecific/index.d.ts +3 -1
  18. package/distribution/components/pluridal/toolbars/index.d.ts +6 -2
  19. package/distribution/index.d.ts +77 -1
  20. package/distribution/index.es.js +331 -76
  21. package/distribution/index.es.js.map +1 -1
  22. package/distribution/index.js +648 -329
  23. package/distribution/index.js.map +1 -1
  24. package/package.json +26 -26
@@ -1,12 +1,12 @@
1
- import React, { useRef, useState, useEffect, forwardRef } from "react";
1
+ import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle } from "react";
2
2
 
3
3
  import themes, { plurid } from "@plurid/plurid-themes";
4
4
 
5
- import styled, { createGlobalStyle, keyframes } from "styled-components";
5
+ import styled, { createGlobalStyle, css, keyframes } from "styled-components";
6
6
 
7
7
  import { PluridIconReset, PluridIconObliterate, PluridIconDelete, PluridIconCopy, PluridIconInfo, PluridIconPlay, PluridIconBranch, PluridIconNewStateline, PluridIconStateShareImage, PluridIconCopyCurrentState, PluridIconCopyStateHistory, PluridIconSittings, PluridIconSpeak } from "@plurid/plurid-icons-react";
8
8
 
9
- import { mergeReferences, useMounted, useFalseAfterTimedTrue, createMarkup } from "@plurid/plurid-functions-react";
9
+ import { mergeReferences, useMounted, useFalseAfterTimedTrue, useThrottledCallback, createMarkup } from "@plurid/plurid-functions-react";
10
10
 
11
11
  import { mathematics, clipboard } from "@plurid/plurid-functions";
12
12
 
@@ -148,7 +148,7 @@ const StyledLoader = styled.div`
148
148
  }
149
149
  `;
150
150
 
151
- const Spinner = properties => {
151
+ const Spinner$1 = properties => {
152
152
  const {theme: theme, size: size, style: style, className: className} = properties;
153
153
  const themeValue = theme || plurid;
154
154
  const sizeValue = size || "normal";
@@ -349,7 +349,7 @@ const StyledPureButtonDiv = styled(StyledPureButton).attrs({
349
349
  box-shadow: 0px 3px 3px 0px ${({theme: theme}) => theme.boxShadowUmbraColor};
350
350
  `;
351
351
 
352
- const PureButton = properties => {
352
+ const PureButton$1 = properties => {
353
353
  const {text: text, atClick: atClick, theme: themeProperty, level: levelProperty, size: sizeProperty, disabled: disabled, loading: loading, style: style, className: className} = properties;
354
354
  const theme = themeProperty || plurid;
355
355
  const level = levelProperty !== null && levelProperty !== void 0 ? levelProperty : 0;
@@ -362,7 +362,7 @@ const PureButton = properties => {
362
362
  level: level,
363
363
  size: size,
364
364
  isDisabled: disabled
365
- }, React.createElement(Spinner, {
365
+ }, React.createElement(Spinner$1, {
366
366
  theme: theme,
367
367
  size: "small"
368
368
  }));
@@ -453,12 +453,12 @@ const StyledLinkButtonLoading = styled.div`
453
453
 
454
454
  const DEFAULT_LEVEL$1 = 0;
455
455
 
456
- const LinkButton = properties => {
456
+ const LinkButton$1 = properties => {
457
457
  const {text: text, atClick: atClick, theme: themeProperty, level: levelProperty, inline: inline, disabled: disabled, loading: loading, active: active, style: style, className: className} = properties;
458
458
  const theme = themeProperty || plurid;
459
459
  const level = levelProperty !== null && levelProperty !== void 0 ? levelProperty : DEFAULT_LEVEL$1;
460
460
  if (loading) {
461
- return React.createElement(StyledLinkButtonLoading, null, React.createElement(Spinner, {
461
+ return React.createElement(StyledLinkButtonLoading, null, React.createElement(Spinner$1, {
462
462
  size: "small",
463
463
  theme: theme
464
464
  }));
@@ -478,7 +478,7 @@ const LinkButton = properties => {
478
478
  const StyledRefreshButton = styled.div`
479
479
  `;
480
480
 
481
- const RefreshButton = properties => {
481
+ const RefreshButton$1 = properties => {
482
482
  const {atClick: atClick, theme: themeProperty, text: textProperty, disabled: disabled, hideAtClick: hideAtClickProperty, hideTime: hideTimeProperty} = properties;
483
483
  const theme = themeProperty || plurid;
484
484
  const text = textProperty || "";
@@ -518,9 +518,9 @@ const RefreshButton = properties => {
518
518
  };
519
519
 
520
520
  const buttons = {
521
- PureButton: PureButton,
522
- LinkButton: LinkButton,
523
- RefreshButton: RefreshButton
521
+ PureButton: PureButton$1,
522
+ LinkButton: LinkButton$1,
523
+ RefreshButton: RefreshButton$1
524
524
  };
525
525
 
526
526
  const StyledFormbutton = styled.div`
@@ -569,7 +569,7 @@ const StyledFormbuttonIcon = styled.div`
569
569
  const StyledFormbuttonText = styled.div`
570
570
  `;
571
571
 
572
- const Formbutton = properties => {
572
+ const Formbutton$1 = properties => {
573
573
  const {text: text, Icon: Icon, atClick: atClick, link: link, target: target, theme: theme, devisible: devisible, level: level, iconPosition: iconPosition, inactive: inactive, hoverEffect: hoverEffectProperty, style: style, className: className} = properties;
574
574
  const _theme = theme || plurid;
575
575
  const _level = level !== null && level !== void 0 ? level : 0;
@@ -612,7 +612,7 @@ const StyledFormitem = styled.div`
612
612
  user-select: none;
613
613
  `;
614
614
 
615
- const Formitem = properties => {
615
+ const Formitem$1 = properties => {
616
616
  const {theme: theme, level: level, style: style, className: className, children: children} = properties;
617
617
  const _theme = theme || plurid;
618
618
  const _level = level !== null && level !== void 0 ? level : 0;
@@ -630,7 +630,7 @@ const StyledFormLeftRight = styled.div`
630
630
  justify-content: space-between;
631
631
  `;
632
632
 
633
- const FormLeftRight = properties => {
633
+ const FormLeftRight$1 = properties => {
634
634
  const {theme: theme, style: style, className: className, children: children} = properties;
635
635
  const _theme = theme || plurid;
636
636
  return React.createElement(StyledFormLeftRight, {
@@ -694,7 +694,7 @@ const StyledFormlineElement = styled.div`
694
694
  }
695
695
  `;
696
696
 
697
- const Formline = properties => {
697
+ const Formline$1 = properties => {
698
698
  const {text: text, Element: Element, theme: theme, level: level, responsive: responsive, style: style, className: className, children: children} = properties;
699
699
  const _theme = theme || plurid;
700
700
  const _level = level === undefined ? 0 : level;
@@ -727,7 +727,7 @@ const StyledObliterateContainer = styled.div`
727
727
  margin: 1rem auto;
728
728
  `;
729
729
 
730
- const FormObliterate = properties => {
730
+ const FormObliterate$1 = properties => {
731
731
  const {atObliterate: atObliterate, item: item, theme: theme, devisible: devisible, level: level, style: style, className: className} = properties;
732
732
  const _theme = theme || plurid;
733
733
  const _level = level !== null && level !== void 0 ? level : 0;
@@ -743,17 +743,17 @@ const FormObliterate = properties => {
743
743
  devisible: _devisible,
744
744
  style: Object.assign({}, style),
745
745
  className: className
746
- }, !showObliterate && React.createElement(Formbutton, {
746
+ }, !showObliterate && React.createElement(Formbutton$1, {
747
747
  theme: _theme,
748
748
  text: item ? `obliterate ${item}` : "obliterate",
749
749
  Icon: PluridIconObliterate,
750
750
  atClick: () => setShowObliterate(true),
751
751
  devisible: true
752
- }), showObliterate && React.createElement(StyledObliterateContainer, null, React.createElement("div", null, "remove forever?"), React.createElement(LinkButton, {
752
+ }), showObliterate && React.createElement(StyledObliterateContainer, null, React.createElement("div", null, "remove forever?"), React.createElement(LinkButton$1, {
753
753
  theme: _theme,
754
754
  text: "cancel",
755
755
  atClick: () => setShowObliterate(false)
756
- }), React.createElement(PureButton, {
756
+ }), React.createElement(PureButton$1, {
757
757
  theme: _theme,
758
758
  text: "Obliterate",
759
759
  atClick: event => handleObliterate(event)
@@ -761,14 +761,14 @@ const FormObliterate = properties => {
761
761
  };
762
762
 
763
763
  const form = {
764
- Formbutton: Formbutton,
765
- Formitem: Formitem,
766
- FormLeftRight: FormLeftRight,
767
- Formline: Formline,
768
- FormObliterate: FormObliterate
764
+ Formbutton: Formbutton$1,
765
+ Formitem: Formitem$1,
766
+ FormLeftRight: FormLeftRight$1,
767
+ Formline: Formline$1,
768
+ FormObliterate: FormObliterate$1
769
769
  };
770
770
 
771
- const GlobalStyles = createGlobalStyle`
771
+ const GlobalStyles$1 = createGlobalStyle`
772
772
  *, *::after, *::before {
773
773
  box-sizing: border-box;
774
774
  }
@@ -803,7 +803,7 @@ const GlobalStyles = createGlobalStyle`
803
803
  `;
804
804
 
805
805
  const general = {
806
- GlobalStyles: GlobalStyles
806
+ GlobalStyles: GlobalStyles$1
807
807
  };
808
808
 
809
809
  const setNativeValue = (element, value) => {
@@ -985,7 +985,7 @@ const StyledErrorLine = styled.div`
985
985
  }};
986
986
  `;
987
987
 
988
- const Textline = forwardRef(((properties, reference) => {
988
+ const Textline$1 = forwardRef(((properties, reference) => {
989
989
  const {text: text, atChange: atChange, atKeyDown: atKeyDown, atFocus: atFocus, atBlur: atBlur, type: type, placeholder: placeholder, autoCapitalize: autoCapitalize, autoComplete: autoComplete, autoCorrect: autoCorrect, spellCheck: spellCheck, style: style, className: className, theme: theme, level: level, devisible: devisible, center: center, round: round, width: width, error: error, enterIconLeft: enterIconLeft, enterEmpty: enterEmpty, enterAtClick: enterAtClick, escapeClear: escapeClear, ariaLabel: ariaLabel} = properties;
990
990
  const _type = type || "text";
991
991
  const _theme = theme || plurid;
@@ -1227,7 +1227,7 @@ const StyledFilterUpdate = styled.div`
1227
1227
  }};
1228
1228
  `;
1229
1229
 
1230
- const Dropdown = properties => {
1230
+ const Dropdown$1 = properties => {
1231
1231
  const {selected: selected, selectables: selectables, atSelect: atSelect, left: left, kind: kind, listTop: listTop, dropdownToggled: dropdownToggled, hideAtSelect: hideAtSelect, selectAtHover: selectAtHover, selectedColor: selectedColor, filterable: filterable, style: style, className: className, theme: themeProperty, generalTheme: generalThemeProperty, interactionTheme: interactionThemeProperty, level: level, heightItems: heightItems, width: width, setDropdownToggled: setDropdownToggled, filterUpdate: filterUpdate} = properties;
1232
1232
  const _generalTheme = generalThemeProperty === undefined ? themeProperty === undefined ? plurid : themeProperty : generalThemeProperty;
1233
1233
  const _interactionTheme = interactionThemeProperty === undefined ? themeProperty === undefined ? plurid : themeProperty : interactionThemeProperty;
@@ -1426,7 +1426,7 @@ const Dropdown = properties => {
1426
1426
  setShowFilterUpdate(true);
1427
1427
  }), 5300);
1428
1428
  }
1429
- })), React.createElement(Textline, {
1429
+ })), React.createElement(Textline$1, {
1430
1430
  ref: filterInput,
1431
1431
  theme: interactionTheme,
1432
1432
  text: filterValue,
@@ -1479,7 +1479,7 @@ const StyledEntityPill = styled.div`
1479
1479
  align-items: center;
1480
1480
  `;
1481
1481
 
1482
- const EntityPill = properties => {
1482
+ const EntityPill$1 = properties => {
1483
1483
  const {id: id, remove: remove, text: text, theme: theme, style: style} = properties;
1484
1484
  const textValue = text || id;
1485
1485
  return React.createElement(StyledEntityPill, {
@@ -1502,7 +1502,7 @@ const StyledEntityPillGroup = styled.div`
1502
1502
  justify-content: center;
1503
1503
  `;
1504
1504
 
1505
- const EntityPillGroup = properties => {
1505
+ const EntityPillGroup$1 = properties => {
1506
1506
  const {entities: entities, remove: remove, keyFix: keyFix, theme: theme, style: style, pillStyle: pillStyle} = properties;
1507
1507
  return React.createElement(StyledEntityPillGroup, {
1508
1508
  theme: theme,
@@ -1511,7 +1511,7 @@ const EntityPillGroup = properties => {
1511
1511
  const stringEntity = typeof entity === "string";
1512
1512
  const id = stringEntity ? entity : entity.id;
1513
1513
  const text = stringEntity ? undefined : entity.text;
1514
- return React.createElement(EntityPill, {
1514
+ return React.createElement(EntityPill$1, {
1515
1515
  key: `entity-pill-${id}${keyFix || ""}`,
1516
1516
  id: id,
1517
1517
  text: text,
@@ -1535,7 +1535,7 @@ const StyledInputDescriptor = styled.div`
1535
1535
  color: ${({theme: theme}) => theme.colorPrimary};
1536
1536
  `;
1537
1537
 
1538
- const InputDescriptor = properties => {
1538
+ const InputDescriptor$1 = properties => {
1539
1539
  const {name: name, show: show, theme: themeProperty, style: style, className: className} = properties;
1540
1540
  const theme = themeProperty || plurid;
1541
1541
  return React.createElement(StyledInputDescriptor, {
@@ -1573,14 +1573,14 @@ const StyledInputBox = styled.div`
1573
1573
  const StyledTextBox = styled.div`
1574
1574
  `;
1575
1575
 
1576
- const InputBox = properties => {
1576
+ const InputBox$1 = properties => {
1577
1577
  const {text: text, name: name, atChange: atChange, theme: themeProperty, style: style, className: className, atKeyDown: atKeyDown} = properties;
1578
1578
  const theme = themeProperty || plurid;
1579
1579
  return React.createElement(StyledInputBox, {
1580
1580
  theme: theme,
1581
1581
  className: className,
1582
1582
  style: Object.assign({}, style)
1583
- }, React.createElement(InputDescriptor, {
1583
+ }, React.createElement(InputDescriptor$1, {
1584
1584
  name: name,
1585
1585
  show: text !== "",
1586
1586
  theme: theme
@@ -1602,18 +1602,18 @@ const StyledInputLine = styled.div`
1602
1602
  width: 350px;
1603
1603
  `;
1604
1604
 
1605
- const InputLine = properties => {
1605
+ const InputLine$1 = properties => {
1606
1606
  const {name: name, text: text, atChange: atChange, theme: themeProperty, type: type, error: error, textline: textline, style: style, className: className, atKeyDown: atKeyDown} = properties;
1607
1607
  const theme = themeProperty || plurid;
1608
1608
  return React.createElement(StyledInputLine, {
1609
1609
  theme: theme,
1610
1610
  style: Object.assign({}, style),
1611
1611
  className: className
1612
- }, React.createElement(InputDescriptor, {
1612
+ }, React.createElement(InputDescriptor$1, {
1613
1613
  name: name,
1614
1614
  show: text !== "",
1615
1615
  theme: theme
1616
- }), React.createElement(Textline, Object.assign({
1616
+ }), React.createElement(Textline$1, Object.assign({
1617
1617
  text: text,
1618
1618
  type: type,
1619
1619
  placeholder: name,
@@ -1742,7 +1742,7 @@ const StyledSwitchIcon = styled.div`
1742
1742
  }
1743
1743
  `;
1744
1744
 
1745
- const Switch = properties => {
1745
+ const Switch$1 = properties => {
1746
1746
  const {checked: checked, theme: theme, level: level, round: round, exclusive: exclusive, accent: accent, Icon: Icon, atChange: atChange} = properties;
1747
1747
  const _theme = theme || plurid;
1748
1748
  const _level = level === undefined ? 0 : level;
@@ -1780,18 +1780,18 @@ const StyledInputSwitch = styled.div`
1780
1780
  }};
1781
1781
  `;
1782
1782
 
1783
- const InputSwitch = properties => {
1783
+ const InputSwitch$1 = properties => {
1784
1784
  const {name: name, checked: checked, atChange: atChange, theme: themeProperty, compact: compact, switch: switchProperties, style: style, className: className} = properties;
1785
1785
  const theme = themeProperty || plurid;
1786
1786
  return React.createElement(StyledInputSwitch, {
1787
1787
  compact: compact,
1788
1788
  style: Object.assign({}, style),
1789
1789
  className: className
1790
- }, React.createElement(FormLeftRight, null, React.createElement("div", {
1790
+ }, React.createElement(FormLeftRight$1, null, React.createElement("div", {
1791
1791
  style: {
1792
1792
  marginLeft: "0.9rem"
1793
1793
  }
1794
- }, name), React.createElement(Switch, Object.assign({
1794
+ }, name), React.createElement(Switch$1, Object.assign({
1795
1795
  checked: checked,
1796
1796
  level: 2,
1797
1797
  exclusive: true,
@@ -1832,7 +1832,7 @@ const StyledItemsline = styled.div`
1832
1832
  }
1833
1833
  `;
1834
1834
 
1835
- const Itemsline = properties => {
1835
+ const Itemsline$1 = properties => {
1836
1836
  const {items: items, removeItem: removeItem, theme: theme, level: level, left: left, style: style, className: className} = properties;
1837
1837
  const _theme = theme === undefined ? themes.plurid : theme;
1838
1838
  const _level = level === undefined ? 0 : level;
@@ -2093,7 +2093,7 @@ const DEFAULT_LEVEL = 0;
2093
2093
 
2094
2094
  const DEFAULT_THUMB_SIZE = "large";
2095
2095
 
2096
- const Slider = properties => {
2096
+ const Slider$1 = properties => {
2097
2097
  const {value: value, atChange: atChange, defaultValue: defaultValue, min: min, max: max, step: step, name: name, theme: theme, level: level, thumbSize: thumbSize, width: width, valueSign: valueSign, namedValueAbove: namedValueAbove} = properties;
2098
2098
  const [mouseOver, setMouseOver] = useState(false);
2099
2099
  const _theme = theme || plurid;
@@ -2133,18 +2133,18 @@ const Slider = properties => {
2133
2133
  };
2134
2134
 
2135
2135
  const inputs = {
2136
- Dropdown: Dropdown,
2137
- EntityPill: EntityPill,
2138
- EntityPillGroup: EntityPillGroup,
2139
- InputBox: InputBox,
2140
- InputDescriptor: InputDescriptor,
2141
- InputLine: InputLine,
2142
- InputSwitch: InputSwitch,
2143
- Itemsline: Itemsline,
2136
+ Dropdown: Dropdown$1,
2137
+ EntityPill: EntityPill$1,
2138
+ EntityPillGroup: EntityPillGroup$1,
2139
+ InputBox: InputBox$1,
2140
+ InputDescriptor: InputDescriptor$1,
2141
+ InputLine: InputLine$1,
2142
+ InputSwitch: InputSwitch$1,
2143
+ Itemsline: Itemsline$1,
2144
2144
  Select: PluridSelect,
2145
- Slider: Slider,
2146
- Switch: Switch,
2147
- Textline: Textline
2145
+ Slider: Slider$1,
2146
+ Switch: Switch$1,
2147
+ Textline: Textline$1
2148
2148
  };
2149
2149
 
2150
2150
  const StyledHR = styled.hr`
@@ -2156,7 +2156,7 @@ const StyledHR = styled.hr`
2156
2156
  background-color: ${({theme: theme}) => theme.colorPrimary};
2157
2157
  `;
2158
2158
 
2159
- const HR = properties => {
2159
+ const HR$1 = properties => {
2160
2160
  const {theme: theme, style: style, className: className} = properties;
2161
2161
  const themeValue = theme || plurid;
2162
2162
  return React.createElement(StyledHR, {
@@ -2178,7 +2178,7 @@ const StyledProgressCircle = styled.div`
2178
2178
  }
2179
2179
  `;
2180
2180
 
2181
- const ProgressCircle = properties => {
2181
+ const ProgressCircle$1 = properties => {
2182
2182
  const {progress: progress, size: size, radius: radius, stroke: stroke, theme: theme, style: style, className: className} = properties;
2183
2183
  const progressValue = mathematics.numbers.normalizeBetween(progress, 0, 100);
2184
2184
  const radiusValue = radius || 20;
@@ -2287,7 +2287,7 @@ const StyledTooltipText = styled.div`
2287
2287
  }
2288
2288
  `;
2289
2289
 
2290
- const Tooltip = properties => {
2290
+ const Tooltip$1 = properties => {
2291
2291
  const {tool: Tool, tip: Tip, indicator: indicatorProperty, icon: iconProperty, theme: themeProperty, style: style, className: className} = properties;
2292
2292
  const theme = themeProperty || plurid;
2293
2293
  const indicator = indicatorProperty !== null && indicatorProperty !== void 0 ? indicatorProperty : true;
@@ -2334,10 +2334,10 @@ const Tooltip = properties => {
2334
2334
  };
2335
2335
 
2336
2336
  const markers = {
2337
- HR: HR,
2338
- ProgressCircle: ProgressCircle,
2339
- Spinner: Spinner,
2340
- Tooltip: Tooltip
2337
+ HR: HR$1,
2338
+ ProgressCircle: ProgressCircle$1,
2339
+ Spinner: Spinner$1,
2340
+ Tooltip: Tooltip$1
2341
2341
  };
2342
2342
 
2343
2343
  const StyledHeading1 = styled.h1`
@@ -2382,7 +2382,7 @@ const StyledHeading6 = styled.h5`
2382
2382
  margin: 1rem 0;
2383
2383
  `;
2384
2384
 
2385
- const Heading = properties => {
2385
+ const Heading$1 = properties => {
2386
2386
  const {children: children, theme: themeProperty, type: typeProperty, style: style, className: className} = properties;
2387
2387
  const theme = themeProperty || plurid;
2388
2388
  const type = typeProperty || "h1";
@@ -2449,7 +2449,7 @@ const StyledParagraph = styled.p`
2449
2449
  line-height: 1.4;
2450
2450
  `;
2451
2451
 
2452
- const Paragraph = properties => {
2452
+ const Paragraph$1 = properties => {
2453
2453
  const {children: children, theme: themeProperty, size: sizeProperty, fontFamily: fontFamilyProperty, style: style, className: className} = properties;
2454
2454
  const theme = themeProperty || plurid;
2455
2455
  const size = sizeProperty || "normal";
@@ -2464,8 +2464,8 @@ const Paragraph = properties => {
2464
2464
  };
2465
2465
 
2466
2466
  const typography = {
2467
- Heading: Heading,
2468
- Paragraph: Paragraph
2467
+ Heading: Heading$1,
2468
+ Paragraph: Paragraph$1
2469
2469
  };
2470
2470
 
2471
2471
  const StyledCopyableLine = styled.div`
@@ -2479,7 +2479,7 @@ const StyledData = styled.div`
2479
2479
  user-select: all;
2480
2480
  `;
2481
2481
 
2482
- const CopyableLine = properties => {
2482
+ const CopyableLine$1 = properties => {
2483
2483
  const {data: data, theme: theme, viewData: viewData, copyMessage: copyMessage, copyMessageTime: copyMessageTime, style: style, className: className} = properties;
2484
2484
  const viewDataText = viewData || data;
2485
2485
  const copyMessageText = copyMessage !== null && copyMessage !== void 0 ? copyMessage : "copied";
@@ -2500,7 +2500,7 @@ const CopyableLine = properties => {
2500
2500
  const StyledNewPageLink = styled.a`
2501
2501
  `;
2502
2502
 
2503
- const NewPageLink = properties => {
2503
+ const NewPageLink$1 = properties => {
2504
2504
  const {link: link, text: text, style: style, className: className} = properties;
2505
2505
  return React.createElement(StyledNewPageLink, {
2506
2506
  href: link,
@@ -2524,7 +2524,7 @@ const StyledScrollableLine = styled.div`
2524
2524
  }
2525
2525
  `;
2526
2526
 
2527
- const ScrollableLine = properties => {
2527
+ const ScrollableLine$1 = properties => {
2528
2528
  const {text: text, style: style, className: className} = properties;
2529
2529
  return React.createElement(StyledScrollableLine, {
2530
2530
  style: Object.assign({}, style),
@@ -2538,7 +2538,7 @@ const StyledTextItem = styled.div`
2538
2538
  margin-right: 2rem;
2539
2539
  `;
2540
2540
 
2541
- const TextItem = properties => {
2541
+ const TextItem$1 = properties => {
2542
2542
  const {name: name, render: render, icon: IconProperty} = properties;
2543
2543
  const Icon = IconProperty || PluridIconInfo;
2544
2544
  return React.createElement(StyledTextItem, null, React.createElement(Icon, {
@@ -2551,10 +2551,10 @@ const TextItem = properties => {
2551
2551
  };
2552
2552
 
2553
2553
  const varia = {
2554
- CopyableLine: CopyableLine,
2555
- NewPageLink: NewPageLink,
2556
- ScrollableLine: ScrollableLine,
2557
- TextItem: TextItem
2554
+ CopyableLine: CopyableLine$1,
2555
+ NewPageLink: NewPageLink$1,
2556
+ ScrollableLine: ScrollableLine$1,
2557
+ TextItem: TextItem$1
2558
2558
  };
2559
2559
 
2560
2560
  const universal = {
@@ -2567,6 +2567,256 @@ const universal = {
2567
2567
  varia: varia
2568
2568
  };
2569
2569
 
2570
+ const StyledEntityView = styled.div`
2571
+ position: relative;
2572
+ height: 100%;
2573
+
2574
+ button {
2575
+ font-family: ${({theme: theme}) => theme.fontFamilySansSerif};
2576
+ }
2577
+ `;
2578
+
2579
+ const StyledEntityViewTop = styled.div`
2580
+ display: grid;
2581
+ grid-template-columns: 3fr 1fr;
2582
+ align-items: center;
2583
+ margin-bottom: 30px;
2584
+ `;
2585
+
2586
+ const StyledEntityFilterLine = styled.div`
2587
+ position: relative;
2588
+ `;
2589
+
2590
+ const StyledEntityFilterCancel = styled.div`
2591
+ position: absolute;
2592
+ top: 10px;
2593
+
2594
+ left: ${({filterLength: filterLength}) => filterLength === "SMALL" ? "275px" : "575px"};
2595
+ `;
2596
+
2597
+ const StyledTopButtons = styled.div`
2598
+ text-align: right;
2599
+ `;
2600
+
2601
+ const StyledEntityListContainer = styled.div`
2602
+ `;
2603
+
2604
+ const StyledEntityList = styled.ul`
2605
+ padding: 0;
2606
+ margin: 0;
2607
+ list-style: none;
2608
+ max-height: 500px;
2609
+ overflow: auto;
2610
+
2611
+ background-color: ${({theme: theme}) => theme.backgroundColorSecondaryAlpha};
2612
+ box-shadow: ${({theme: theme}) => theme.boxShadowUmbraInset};
2613
+ opacity: ${({loading: loading}) => {
2614
+ if (loading) {
2615
+ return "0.5";
2616
+ }
2617
+ return "1";
2618
+ }};
2619
+
2620
+ li:first-child {
2621
+ background-color: ${({theme: theme, header: header}) => {
2622
+ if (header) {
2623
+ return theme.backgroundColorTertiary;
2624
+ }
2625
+ return "initial";
2626
+ }};
2627
+ }
2628
+
2629
+ ${({header: header}) => {
2630
+ if (header) {
2631
+ return;
2632
+ }
2633
+ return css`
2634
+ li:hover {
2635
+ background-color: ${({theme: theme}) => theme.backgroundColorPrimary};
2636
+ }
2637
+ `;
2638
+ }}
2639
+ `;
2640
+
2641
+ const StyledEntityListItem = styled.li`
2642
+ display: grid;
2643
+ grid-template-columns: ${({rowTemplate: rowTemplate}) => rowTemplate};
2644
+ grid-gap: 0.5rem;
2645
+ padding: 0.7rem;
2646
+ align-items: center;
2647
+ min-height: 45px;
2648
+ word-break: break-all;
2649
+ `;
2650
+
2651
+ const StyledActionButton = styled.div`
2652
+ width: 200px;
2653
+ position: absolute;
2654
+ bottom: 0;
2655
+ right: 0;
2656
+ `;
2657
+
2658
+ const StyledNoRows = styled.div`
2659
+ margin: 20px 0;
2660
+ text-align: center;
2661
+ `;
2662
+
2663
+ const createSearchTerms = (rows, fields) => rows.map((entity => {
2664
+ const {id: id} = entity;
2665
+ const data = [];
2666
+ for (const field of fields) {
2667
+ const term = entity[field];
2668
+ if (term && typeof term === "string") {
2669
+ data.push(term.toLowerCase().trim());
2670
+ }
2671
+ }
2672
+ return {
2673
+ id: id,
2674
+ data: data
2675
+ };
2676
+ }));
2677
+
2678
+ const {buttons: {PureButton: PluridPureButton}, inputs: {Textline: PluridTextline}, markers: {Spinner: PluridSpinner}} = universal;
2679
+
2680
+ const EntityView = forwardRef(((properties, reference) => {
2681
+ const {entities: entities, searchFields: searchFields, generalTheme: generalTheme, interactionTheme: interactionTheme, rowsHeader: rowsHeader, rowTemplate: rowTemplate, noRows: noRows, abstractRowRenderer: abstractRowRenderer, actionButtonText: actionButtonText, placeholderText: placeholderText, scrollThrottleTime: scrollThrottleTimeProperty, loading: loading, rowRenderFields: rowRenderFields, rowRenderMethods: rowRenderMethods, actionButtonClick: actionButtonClick, filterUpdate: filterUpdate, refresh: refresh, actionScrollBottom: actionScrollBottom} = properties;
2682
+ const placeholder = placeholderText || "search";
2683
+ const scrollThrottleTime = scrollThrottleTimeProperty !== null && scrollThrottleTimeProperty !== void 0 ? scrollThrottleTimeProperty : 1e3;
2684
+ const bottomTimeout = useRef();
2685
+ const entityList = useRef(null);
2686
+ const [searchTerms, setSearchTerms] = useState(createSearchTerms(entities, searchFields));
2687
+ const [filteredRows, setFilteredRows] = useState(entities.map((entity => abstractRowRenderer(rowRenderFields || [], entity, rowRenderMethods || {}))));
2688
+ const [searchValue, setSearchValue] = useState("");
2689
+ const [filterLength, setFilterLength] = useState("SMALL");
2690
+ const [refreshClicked, setRefreshClicked] = useState(false);
2691
+ const handleScroll = useThrottledCallback((() => {
2692
+ const element = entityList.current;
2693
+ if (!element) {
2694
+ return;
2695
+ }
2696
+ const scrolledAmount = element.scrollTop + element.getBoundingClientRect().height;
2697
+ const bottomReached = scrolledAmount >= element.scrollHeight;
2698
+ if (bottomReached && actionScrollBottom && entities) {
2699
+ actionScrollBottom(entities);
2700
+ }
2701
+ }), scrollThrottleTime);
2702
+ const clearFilterValue = () => {
2703
+ setSearchValue("");
2704
+ if (filterUpdate) {
2705
+ filterUpdate("");
2706
+ }
2707
+ };
2708
+ useEffect((() => {
2709
+ setFilteredRows(entities.map((entity => abstractRowRenderer(rowRenderFields || [], entity, rowRenderMethods || {}))));
2710
+ setSearchTerms(createSearchTerms(entities, searchFields));
2711
+ }), [ entities.length, JSON.stringify(entities) ]);
2712
+ useEffect((() => {
2713
+ if (refreshClicked) {
2714
+ setTimeout((() => {
2715
+ setRefreshClicked(false);
2716
+ }), 1500);
2717
+ }
2718
+ }), [ refreshClicked ]);
2719
+ useEffect((() => {
2720
+ bottomTimeout.current = setTimeout((() => {
2721
+ if (entityList.current && actionScrollBottom) {
2722
+ entityList.current.addEventListener("scroll", handleScroll);
2723
+ }
2724
+ }), 100);
2725
+ return () => {
2726
+ if (bottomTimeout.current) {
2727
+ clearTimeout(bottomTimeout.current);
2728
+ }
2729
+ if (entityList.current && actionScrollBottom) {
2730
+ entityList.current.removeEventListener("scroll", handleScroll);
2731
+ }
2732
+ };
2733
+ }), [ entities ]);
2734
+ useEffect((() => {
2735
+ if (searchValue.length <= 30) {
2736
+ if (filterLength !== "SMALL") {
2737
+ setFilterLength("SMALL");
2738
+ }
2739
+ } else {
2740
+ if (filterLength !== "LARGE") {
2741
+ setFilterLength("LARGE");
2742
+ }
2743
+ }
2744
+ }), [ searchValue ]);
2745
+ useImperativeHandle(reference, (() => ({
2746
+ resetFilterValue() {
2747
+ clearFilterValue();
2748
+ },
2749
+ getSearchTerms() {
2750
+ return searchTerms;
2751
+ }
2752
+ })), [ JSON.stringify(searchTerms) ]);
2753
+ return React.createElement(StyledEntityView, {
2754
+ theme: generalTheme
2755
+ }, !!loading && React.createElement(PluridSpinner, {
2756
+ theme: generalTheme
2757
+ }), React.createElement(StyledEntityViewTop, null, React.createElement(StyledEntityFilterLine, null, React.createElement(PluridTextline, {
2758
+ text: searchValue,
2759
+ placeholder: placeholder,
2760
+ atChange: event => {
2761
+ const {value: value} = event.target;
2762
+ setSearchValue(value);
2763
+ if (filterUpdate) {
2764
+ filterUpdate(value);
2765
+ }
2766
+ },
2767
+ atKeyDown: event => {
2768
+ if (event.key === "Escape") {
2769
+ clearFilterValue();
2770
+ }
2771
+ },
2772
+ theme: interactionTheme,
2773
+ spellCheck: false,
2774
+ autoCapitalize: "false",
2775
+ autoComplete: "false",
2776
+ autoCorrect: "false",
2777
+ level: 2,
2778
+ style: {
2779
+ width: filterLength === "SMALL" ? "300px" : "600px",
2780
+ paddingRight: "2rem"
2781
+ }
2782
+ }), searchValue && React.createElement(StyledEntityFilterCancel, {
2783
+ filterLength: filterLength
2784
+ }, React.createElement(PluridIconDelete, {
2785
+ atClick: () => {
2786
+ clearFilterValue();
2787
+ }
2788
+ }))), React.createElement(StyledTopButtons, null, refresh && !refreshClicked && React.createElement(PluridIconReset, {
2789
+ atClick: () => {
2790
+ setRefreshClicked(true);
2791
+ refresh();
2792
+ },
2793
+ theme: generalTheme
2794
+ }))), filteredRows.length === 0 && React.createElement(StyledNoRows, null, noRows), filteredRows.length !== 0 && React.createElement(StyledEntityListContainer, {
2795
+ theme: generalTheme
2796
+ }, React.createElement(StyledEntityList, {
2797
+ theme: generalTheme,
2798
+ header: true
2799
+ }, React.createElement(StyledEntityListItem, {
2800
+ rowTemplate: rowTemplate
2801
+ }, rowsHeader)), React.createElement(StyledEntityList, {
2802
+ theme: generalTheme,
2803
+ ref: entityList,
2804
+ loading: loading
2805
+ }, filteredRows.map((row => React.createElement(StyledEntityListItem, {
2806
+ key: Math.random() + "",
2807
+ rowTemplate: rowTemplate
2808
+ }, row))))), actionButtonText && React.createElement(StyledActionButton, null, React.createElement(PluridPureButton, {
2809
+ text: actionButtonText,
2810
+ atClick: () => actionButtonClick ? actionButtonClick() : undefined,
2811
+ theme: interactionTheme,
2812
+ level: 2
2813
+ })));
2814
+ }));
2815
+
2816
+ const containers = {
2817
+ EntityView: EntityView
2818
+ };
2819
+
2570
2820
  const Head = properties => {
2571
2821
  var _a, _b, _c, _d;
2572
2822
  const {Helmet: Helmet, defaults: defaults, children: children, stateHead: stateHead} = properties;
@@ -3701,11 +3951,16 @@ const toolbars = {
3701
3951
  };
3702
3952
 
3703
3953
  const pluridal = {
3954
+ containers: containers,
3704
3955
  head: head,
3705
3956
  notifications: notifications,
3706
3957
  sitting: sitting,
3707
3958
  toolbars: toolbars
3708
3959
  };
3709
3960
 
3710
- export { pluridal, universal };
3961
+ var index = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, universal.buttons), universal.form), universal.general), universal.inputs), universal.markers), universal.typography), universal.varia), pluridal.containers), pluridal.head), pluridal.notifications), pluridal.sitting), pluridal.toolbars);
3962
+
3963
+ const {buttons: {LinkButton: LinkButton, PureButton: PureButton, RefreshButton: RefreshButton}, form: {FormLeftRight: FormLeftRight, FormObliterate: FormObliterate, Formbutton: Formbutton, Formitem: Formitem, Formline: Formline}, general: {GlobalStyles: GlobalStyles}, inputs: {Dropdown: Dropdown, EntityPill: EntityPill, EntityPillGroup: EntityPillGroup, InputBox: InputBox, InputDescriptor: InputDescriptor, InputLine: InputLine, InputSwitch: InputSwitch, Itemsline: Itemsline, Select: Select, Slider: Slider, Switch: Switch, Textline: Textline}, markers: {HR: HR, ProgressCircle: ProgressCircle, Spinner: Spinner, Tooltip: Tooltip}, typography: {Heading: Heading, Paragraph: Paragraph}, varia: {CopyableLine: CopyableLine, NewPageLink: NewPageLink, ScrollableLine: ScrollableLine, TextItem: TextItem}} = universal;
3964
+
3965
+ export { CopyableLine, Dropdown, EntityPill, EntityPillGroup, FormLeftRight, FormObliterate, Formbutton, Formitem, Formline, GlobalStyles, HR, Heading, InputBox, InputDescriptor, InputLine, InputSwitch, Itemsline, LinkButton, NewPageLink, Paragraph, ProgressCircle, PureButton, RefreshButton, ScrollableLine, Select, Slider, Spinner, Switch, TextItem, Textline, Tooltip, index as default, pluridal, universal };
3711
3966
  //# sourceMappingURL=index.es.js.map