@synerise/ds-inline-edit 1.0.16 → 1.0.17

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
1
  import React from 'react';
2
- import { InlineEditProps } from './InlineEdit.types';
2
+ import { type InlineEditProps } from './InlineEdit.types';
3
3
  declare const InlineEdit: ({ className, style, size, disabled, autoFocus, hideIcon, customIcon, tooltipTitle, error, input, }: InlineEditProps) => React.JSX.Element;
4
4
  export default InlineEdit;
@@ -1,10 +1,10 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { useCallback, useRef, useState, useEffect } from 'react';
3
- import Tooltip from '@synerise/ds-tooltip';
2
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
3
+ import { theme } from '@synerise/ds-core';
4
4
  import Icon, { EditS } from '@synerise/ds-icon';
5
- import { toCamelCase } from '@synerise/ds-utils';
6
5
  import { AutosizeInput } from '@synerise/ds-input';
7
- import { theme } from '@synerise/ds-core';
6
+ import Tooltip from '@synerise/ds-tooltip';
7
+ import { toCamelCase } from '@synerise/ds-utils';
8
8
  import * as S from './InlineEdit.styles';
9
9
  var InlineEdit = function InlineEdit(_ref) {
10
10
  var className = _ref.className,
@@ -23,7 +23,6 @@ var InlineEdit = function InlineEdit(_ref) {
23
23
  focused = _useState[0],
24
24
  setFocused = _useState[1];
25
25
  var handleChange = useCallback(function (event) {
26
- // eslint-disable-next-line no-unused-expressions
27
26
  input.onChange == null || input.onChange(event);
28
27
  }, [input]);
29
28
  var handleFocus = function handleFocus() {
@@ -1,19 +1,27 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { macro } from '@synerise/ds-typography';
3
3
  var applyColor = function applyColor(props) {
4
- if (props.error) return props.theme.palette['red-600'];
4
+ if (props.error) {
5
+ return props.theme.palette['red-600'];
6
+ }
5
7
  return props.theme.palette['grey-800'];
6
8
  };
7
9
  var applyColorFocus = function applyColorFocus(props) {
8
- if (props.error) return props.theme.palette['red-600'];
10
+ if (props.error) {
11
+ return props.theme.palette['red-600'];
12
+ }
9
13
  return props.theme.palette['blue-600'];
10
14
  };
11
15
  var applyDots = function applyDots(props) {
12
- if (props.error) return props.theme.palette['red-600'];
16
+ if (props.error) {
17
+ return props.theme.palette['red-600'];
18
+ }
13
19
  return props.theme.palette['grey-400'];
14
20
  };
15
21
  var applyDotsOnError = function applyDotsOnError(props) {
16
- if (props.error) return "background-image: linear-gradient(to right, " + applyDots(props) + " 20%, rgba(255, 255, 255, 0) 10%);\n background-color: transparent;\n background-position: bottom left;\n background-size: 5px 1px;\n background-repeat: repeat-x;";
22
+ if (props.error) {
23
+ return "background-image: linear-gradient(to right, " + applyDots(props) + " 20%, rgba(255, 255, 255, 0) 10%);\n background-color: transparent;\n background-position: bottom left;\n background-size: 5px 1px;\n background-repeat: repeat-x;";
24
+ }
17
25
  return '';
18
26
  };
19
27
  var fontSize = {
@@ -46,7 +54,7 @@ export var IconWrapper = styled.div.withConfig({
46
54
  export var InPlaceEditableInputContainer = styled.div.withConfig({
47
55
  displayName: "InlineEditstyles__InPlaceEditableInputContainer",
48
56
  componentId: "sc-1itw4az-2"
49
- })(["display:flex;max-width:100%;align-items:center;pointer-events:", ";", "{svg{color:", ";fill:", ";}}input{", "}&:hover{input{color:", ";background-image:linear-gradient(to right,", " 20%,rgba(255,255,255,0) 10%);}", "{background-color:", ";}}", " > .autosize-input{display:inline-block;overflow:hidden;}> .autosize-input > input,> ", "{border:none;background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;", " overflow:hidden;text-overflow:", ";max-width:100%;padding-bottom:", ";margin:0;vertical-align:top;color:", ";::placeholder{color:", ";}}"], function (_ref) {
57
+ })(["display:flex;max-width:100%;align-items:center;pointer-events:", ";", "{svg{color:", ";fill:", ";}}input{", "}&:hover{input{color:", ";background-image:linear-gradient( to right,", " 20%,rgba(255,255,255,0) 10% );}", "{background-color:", ";}}", " > .autosize-input{display:inline-block;overflow:hidden;}> .autosize-input > input,> ", "{border:none;background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;", " overflow:hidden;text-overflow:", ";max-width:100%;padding-bottom:", ";margin:0;vertical-align:top;color:", ";::placeholder{color:", ";}}"], function (_ref) {
50
58
  var disabled = _ref.disabled;
51
59
  return disabled ? 'none' : 'all';
52
60
  }, IconWrapper, function (props) {
@@ -63,7 +71,7 @@ export var InPlaceEditableInputContainer = styled.div.withConfig({
63
71
  var theme = _ref2.theme;
64
72
  return theme.palette['grey-200'];
65
73
  }, function (props) {
66
- return !props.pressed && css(["&&&{&:focus:not(:active),&:focus-within{input{cursor:pointer;background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;background-image:linear-gradient(to right,", " 20%,rgba(255,255,255,0) 10%);}}}"], applyColorFocus(props));
74
+ return !props.pressed && css(["&&&{&:focus:not(:active),&:focus-within{input{cursor:pointer;background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;background-image:linear-gradient( to right,", " 20%,rgba(255,255,255,0) 10% );}}}"], applyColorFocus(props));
67
75
  }, FontStyleWatcher, function (props) {
68
76
  return fontSize[props.size];
69
77
  }, function (props) {
@@ -1,4 +1,4 @@
1
- import type { ReactNode, ChangeEvent, CSSProperties, FocusEventHandler, InputHTMLAttributes, KeyboardEventHandler } from 'react';
1
+ import type { CSSProperties, ChangeEvent, FocusEventHandler, InputHTMLAttributes, KeyboardEventHandler, ReactNode } from 'react';
2
2
  export type InputProps = {
3
3
  name?: string;
4
4
  value: string | number;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { InlineSelectProps } from './InlineSelect.types';
2
+ import { type InlineSelectProps } from './InlineSelect.types';
3
3
  declare const InlineSelect: ({ className, style, expanded, dropdownProps, dropdownOverlayStyle, inputStyle, size, disabled, autoFocus, hideIcon, error, input, placeholder, dataSource, initialValue, onValueChange, }: InlineSelectProps) => React.JSX.Element;
4
4
  export default InlineSelect;
@@ -1,11 +1,11 @@
1
1
  var _excluded = ["value", "onChange"];
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React, { useRef, useState, useEffect } from 'react';
5
- import { NOOP, toCamelCase } from '@synerise/ds-utils';
6
- import Icon, { AngleDownS } from '@synerise/ds-icon';
4
+ import React, { useEffect, useRef, useState } from 'react';
7
5
  import Dropdown from '@synerise/ds-dropdown';
6
+ import Icon, { AngleDownS } from '@synerise/ds-icon';
8
7
  import { AutosizeInput } from '@synerise/ds-input';
8
+ import { NOOP, toCamelCase } from '@synerise/ds-utils';
9
9
  import * as S from './InlineSelect.style';
10
10
  import SelectDropdown from './SelectDropdown/SelectDropdown';
11
11
  var InlineSelect = function InlineSelect(_ref) {
@@ -43,7 +43,6 @@ var InlineSelect = function InlineSelect(_ref) {
43
43
  onChange = input.onChange,
44
44
  inputProps = _objectWithoutPropertiesLoose(input, _excluded);
45
45
  var handleSelect = function handleSelect(item) {
46
- // eslint-disable-next-line no-unused-expressions
47
46
  onValueChange == null || onValueChange(item);
48
47
  setSelectedValue(item.text);
49
48
  };
@@ -1,4 +1,4 @@
1
- import { ThemeProps } from '@synerise/ds-core';
1
+ import { type ThemeProps } from '@synerise/ds-core';
2
2
  type InPlaceEditableInputContainerProps = {
3
3
  size: 'small' | 'normal';
4
4
  disabled?: boolean;
@@ -1,19 +1,27 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { macro } from '@synerise/ds-typography';
3
3
  var applyColor = function applyColor(props) {
4
- if (props.error) return props.theme.palette['red-600'];
4
+ if (props.error) {
5
+ return props.theme.palette['red-600'];
6
+ }
5
7
  return props.theme.palette['blue-600'];
6
8
  };
7
9
  var applyColorHover = function applyColorHover(props) {
8
- if (props.error) return props.theme.palette['red-600'];
10
+ if (props.error) {
11
+ return props.theme.palette['red-600'];
12
+ }
9
13
  return props.theme.palette['blue-500'];
10
14
  };
11
15
  var applyColorActive = function applyColorActive(props) {
12
- if (props.error) return props.theme.palette['red-600'];
16
+ if (props.error) {
17
+ return props.theme.palette['red-600'];
18
+ }
13
19
  return props.theme.palette['blue-700'];
14
20
  };
15
21
  var applyDotsOnError = function applyDotsOnError(props) {
16
- if (props.error) return "background-image: linear-gradient(to right, " + applyColor(props) + " 20%, rgba(255, 255, 255, 0) 10%);\n background-color: transparent;\n background-position: bottom left;\n background-size: 5px 1px;\n background-repeat: repeat-x;";
22
+ if (props.error) {
23
+ return "background-image: linear-gradient(to right, " + applyColor(props) + " 20%, rgba(255, 255, 255, 0) 10%);\n background-color: transparent;\n background-position: bottom left;\n background-size: 5px 1px;\n background-repeat: repeat-x;";
24
+ }
17
25
  return '';
18
26
  };
19
27
  export var FontStyleWatcher = styled.div.withConfig({
@@ -23,7 +31,7 @@ export var FontStyleWatcher = styled.div.withConfig({
23
31
  export var IconWrapper = styled.div.withConfig({
24
32
  displayName: "InlineSelectstyle__IconWrapper",
25
33
  componentId: "sc-188pn99-1"
26
- })(["margin:0;font-size:11px;display:flex;justify-content:center;align-items:center;width:24px;height:24px;line-height:inherit;cursor:pointer;&:hover{background-color:", ";}&&&{svg{transition:transform 0.1s linear;transform:rotateZ(", ");}}"], function (props) {
34
+ })(["margin:0;font-size:11px;display:flex;justify-content:center;align-items:center;width:24px;height:24px;line-height:inherit;cursor:pointer;&:hover{background-color:", ";}&&&{svg{transition:transform 0.1s linear;transform:rotateZ( ", " );}}"], function (props) {
27
35
  return props.theme.palette.white;
28
36
  }, function (props) {
29
37
  return props.expanded ? '180deg' : '0deg';
@@ -48,7 +56,7 @@ export var InPlaceEditableInputContainer = styled.div.withConfig({
48
56
  }, IconWrapper, function (props) {
49
57
  return applyColorHover(props);
50
58
  }, function (props) {
51
- return !props.pressed && !props.dropdownOpened && css(["&&&{&:focus:not(:active),&:focus-within{background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;background-image:linear-gradient(to right,", " 20%,rgba(255,255,255,0) 10%);input{color:transparent;cursor:pointer;text-shadow:0 0 0 ", ";}", "{background-color:transparent;svg{fill:", ";}}}}"], applyColor(props), applyColor(props), IconWrapper, applyColor(props));
59
+ return !props.pressed && !props.dropdownOpened && css(["&&&{&:focus:not(:active),&:focus-within{background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;background-image:linear-gradient( to right,", " 20%,rgba(255,255,255,0) 10% );input{color:transparent;cursor:pointer;text-shadow:0 0 0 ", ";}", "{background-color:transparent;svg{fill:", ";}}}}"], applyColor(props), applyColor(props), IconWrapper, applyColor(props));
52
60
  }, function (props) {
53
61
  return (props.dropdownOpened || props.pressed) && css(["&&&:active,&&&{input{color:transparent;cursor:pointer;text-shadow:0 0 0 ", ";}", "{background-color:transparent;svg{fill:", ";}}}"], applyColorActive(props), IconWrapper, applyColorActive(props));
54
62
  }, FontStyleWatcher, function (_ref3) {
@@ -1,6 +1,6 @@
1
1
  import type { CSSProperties } from 'react';
2
- import type { ListItemProps } from '@synerise/ds-list-item';
3
2
  import type { DropdownProps } from '@synerise/ds-dropdown/dist/Dropdown';
3
+ import type { ListItemProps } from '@synerise/ds-list-item';
4
4
  import type { InputProps } from '../InlineEdit.types';
5
5
  export type InlineSelectProps<ItemType extends ListItemProps = ListItemProps> = {
6
6
  size?: 'normal' | 'small';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { ListItemProps } from '@synerise/ds-list-item';
3
- import { SelectDropdownProps } from './SelectDropdown.types';
3
+ import { type SelectDropdownProps } from './SelectDropdown.types';
4
4
  declare const SelectDropdown: <ItemType extends ListItemProps>({ dataSource, dropdownVisibleRows, dropdownRowHeight, onSelect, closeDropdown, style, }: SelectDropdownProps<ItemType>) => React.JSX.Element;
5
5
  export default SelectDropdown;
@@ -1,6 +1,6 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { useState, useCallback } from 'react';
3
- import { SearchItems } from '@synerise/ds-search/dist/Elements';
2
+ import React, { useCallback, useState } from 'react';
3
+ import { SearchItems } from '@synerise/ds-search';
4
4
  import * as S from './SelectDropdown.style';
5
5
  var DEFAULT_ROW_HEIGHT = 32;
6
6
  var DEFAULT_VISIBLE_ROWS = 10;
@@ -18,8 +18,7 @@ var SelectDropdown = function SelectDropdown(_ref) {
18
18
  setScrollTop = _useState[1];
19
19
  var handleItemClick = useCallback(function (item) {
20
20
  onSelect(item);
21
- // @ts-ignore TODO expects ItemData from @synerise/ds-list-item
22
- // eslint-disable-next-line no-unused-expressions
21
+ // @ts-expect-error Argument of type 'ItemType' is not assignable to parameter of type 'ItemData<MouseEvent<HTMLDivElement, MouseEvent>>
23
22
  item.onClick == null || item.onClick(item);
24
23
  closeDropdown();
25
24
  }, [onSelect, closeDropdown]);
@@ -32,9 +31,7 @@ var SelectDropdown = function SelectDropdown(_ref) {
32
31
  return setScrollTop(event.currentTarget.scrollTop);
33
32
  }
34
33
  }, /*#__PURE__*/React.createElement(SearchItems, {
35
- data: dataSource
36
- // eslint-disable-next-line react/jsx-handler-names
37
- ,
34
+ data: dataSource,
38
35
  itemRender: function itemRender(item) {
39
36
  return /*#__PURE__*/React.createElement(S.ListItem, _extends({
40
37
  key: item == null ? void 0 : item.text
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ScrollbarProps } from '@synerise/ds-scrollbar/dist/Scrollbar.types';
2
+ import { type ScrollbarProps } from '@synerise/ds-scrollbar/dist/Scrollbar.types';
3
3
  export declare const DropdownWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
4
  export declare const ListWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
5
5
  export declare const StyledScrollbar: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<(ScrollbarProps | import("@synerise/ds-scrollbar").VirtualScrollbarProps) & import("react").RefAttributes<HTMLElement>>, any, import("@synerise/ds-scrollbar").ScrollbarAdditionalProps & {
@@ -1,6 +1,6 @@
1
1
  import styled from 'styled-components';
2
- import Scrollbar from '@synerise/ds-scrollbar';
3
2
  import DSListItem from '@synerise/ds-list-item';
3
+ import Scrollbar from '@synerise/ds-scrollbar';
4
4
  export var DropdownWrapper = styled.div.withConfig({
5
5
  displayName: "SelectDropdownstyle__DropdownWrapper",
6
6
  componentId: "sc-1c17xkc-0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-inline-edit",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "InlineEdit UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,20 +34,20 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-dropdown": "^1.0.14",
38
- "@synerise/ds-icon": "^1.5.3",
39
- "@synerise/ds-input": "^1.3.1",
40
- "@synerise/ds-list-item": "^1.0.12",
41
- "@synerise/ds-scrollbar": "^1.1.1",
42
- "@synerise/ds-search": "^1.2.1",
43
- "@synerise/ds-tooltip": "^1.1.11",
44
- "@synerise/ds-typography": "^1.0.12",
45
- "@synerise/ds-utils": "^1.3.0"
37
+ "@synerise/ds-dropdown": "^1.0.15",
38
+ "@synerise/ds-icon": "^1.5.4",
39
+ "@synerise/ds-input": "^1.3.2",
40
+ "@synerise/ds-list-item": "^1.0.13",
41
+ "@synerise/ds-scrollbar": "^1.1.2",
42
+ "@synerise/ds-search": "^1.2.2",
43
+ "@synerise/ds-tooltip": "^1.1.12",
44
+ "@synerise/ds-typography": "^1.0.13",
45
+ "@synerise/ds-utils": "^1.3.1"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@synerise/ds-core": "*",
49
49
  "react": ">=16.9.0 <= 18.3.1",
50
50
  "styled-components": "^5.3.3"
51
51
  },
52
- "gitHead": "11fe1d29b2ac23e70c3d5e6ce8ae20201a619a34"
52
+ "gitHead": "4512641033ba3581a3df208143c547fcfed45895"
53
53
  }