@expressms/smartapp-ui 0.0.2 → 0.0.4

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.
package/README.md CHANGED
@@ -8,5 +8,7 @@ For the styles to work correctly, after installing the library, add styles impor
8
8
 
9
9
  For the library to work, you need to install react and react-dom version 18 or more.
10
10
 
11
+ You can read more about the elements of the library here: https://confluence.ccsteam.ru/display/EI/SmartApp+UI
12
+
11
13
 
12
14
 
@@ -1,7 +1,7 @@
1
1
  export interface IActionModalProps {
2
2
  title: string;
3
3
  buttonName: string;
4
- confirmButtonFunction: (str: string) => void;
4
+ confirmButtonFunction: (str?: string) => void;
5
5
  isModalOpen: boolean;
6
6
  cancelButtonFunction: () => void;
7
7
  placeholder?: string;
@@ -15,6 +15,6 @@ import '../../styles/stories.module.scss';
15
15
  import Avatar from '../Avatar';
16
16
  function Chips(_a) {
17
17
  var name = _a.name, _b = _a.onCancelFunction, onCancelFunction = _b === void 0 ? function () { return undefined; } : _b;
18
- return (_jsxs("div", __assign({ className: "smartapp-chips" }, { children: [_jsxs("div", __assign({ className: "smartapp-chips__info" }, { children: [_jsx(Avatar, { username: name, widthHeight: 24 }), _jsx("p", __assign({ className: "smartapp-chips__info--name" }, { children: name }))] })), _jsx("div", __assign({ onClick: onCancelFunction, className: "smartapp-chips__cancel-icon" }, { children: _jsx(Cancel, {}) }))] })));
18
+ return (_jsxs("div", __assign({ className: "smartapp-chips" }, { children: [_jsxs("div", __assign({ className: "smartapp-chips__info" }, { children: [_jsx(Avatar, { username: name, widthHeight: 24 }), _jsx("p", __assign({ className: "smartapp-chips__info--name" }, { children: name }))] })), _jsx("div", __assign({ onClick: function () { return onCancelFunction(name); }, className: "smartapp-chips__cancel-icon" }, { children: _jsx(Cancel, {}) }))] })));
19
19
  }
20
20
  export default Chips;
@@ -1,4 +1,4 @@
1
1
  export interface IChipsProps {
2
2
  name: string;
3
- onCancelFunction?: () => void;
3
+ onCancelFunction?: (name?: string) => void;
4
4
  }
@@ -27,8 +27,10 @@ function CustomSelect(_a) {
27
27
  } })); },
28
28
  control: function (provided) { return (__assign(__assign({}, provided), { width: width && "".concat(width, "px"), textOverflow: 'ellipsis' })); },
29
29
  };
30
- return (_jsx("div", __assign({ className: "smartapp-custom-select" }, { children: _jsx(Select, { onChange: function (option) { return onChange(option); },
30
+ return (_jsx("div", __assign({ className: "smartapp-custom-select" }, { children: _jsx(Select
31
+ /* @ts-ignore */
32
+ , {
31
33
  /* @ts-ignore */
32
- options: options, defaultValue: defaultValue, styles: customStyles, placeholder: _jsx("div", __assign({ className: "smartapp-custom-select__placeholder" }, { children: placeholder })), components: { IndicatorSeparator: function () { return null; } } }) })));
34
+ onChange: function (option) { return onChange(option); }, options: options, defaultValue: defaultValue, styles: customStyles, placeholder: _jsx("div", __assign({ className: "smartapp-custom-select__placeholder" }, { children: placeholder })), components: { IndicatorSeparator: function () { return null; } } }) })));
33
35
  }
34
36
  export default CustomSelect;
@@ -1,14 +1,12 @@
1
1
  import { IntRange } from '../types';
2
- type TCustomSelectOption = {
2
+ export type TCustomSelectOption = {
3
3
  label: string;
4
4
  value: string;
5
- }[];
5
+ };
6
6
  export type ICustomSelect = {
7
- options: TCustomSelectOption;
8
- onChange: (option: any) => void;
9
- field?: any;
7
+ options: TCustomSelectOption[];
8
+ onChange: (option: TCustomSelectOption) => void;
10
9
  placeholder: string;
11
- defaultValue?: string;
10
+ defaultValue?: TCustomSelectOption;
12
11
  width?: IntRange<120, 360>;
13
12
  };
14
- export {};
@@ -51,8 +51,10 @@ function CustomSelectPriority(_a) {
51
51
  var children = _a.children, props = __rest(_a, ["children"]);
52
52
  return (_jsxs(components.Option, __assign({}, props, { children: [((_b = props === null || props === void 0 ? void 0 : props.data) === null || _b === void 0 ? void 0 : _b.color) && (_jsx("span", __assign({ style: { marginRight: '8px' } }, { children: _jsx(Ellipse, { style: { paddingBottom: '1px' }, color: (_c = props === null || props === void 0 ? void 0 : props.data) === null || _c === void 0 ? void 0 : _c.color }) }))), children] })));
53
53
  };
54
- return (_jsx("div", __assign({ className: "smartapp-custom-select" }, { children: _jsx(Select, { onChange: function (option) { return onChange(option); },
54
+ return (_jsx("div", __assign({ className: "smartapp-custom-select" }, { children: _jsx(Select
55
+ /* @ts-ignore */
56
+ , {
55
57
  /* @ts-ignore */
56
- options: options, defaultValue: defaultValue, styles: customStyles, placeholder: _jsx("div", __assign({ className: "smartapp-custom-select__placeholder" }, { children: placeholder })), components: { Option: Option, Control: Control, DropdownIndicator: DropdownIndicator, IndicatorSeparator: function () { return null; } } }) })));
58
+ onChange: function (option) { return onChange(option); }, options: options, defaultValue: defaultValue, styles: customStyles, placeholder: _jsx("div", __assign({ className: "smartapp-custom-select__placeholder" }, { children: placeholder })), components: { Option: Option, Control: Control, DropdownIndicator: DropdownIndicator, IndicatorSeparator: function () { return null; } } }) })));
57
59
  }
58
60
  export default CustomSelectPriority;
@@ -6,8 +6,7 @@ export type TCustomSelectOptionPriority = {
6
6
  };
7
7
  export interface ICustomSelectPriority {
8
8
  options: TCustomSelectOptionPriority[];
9
- onChange: (option: any) => void;
10
- field?: any;
9
+ onChange: (option: TCustomSelectOptionPriority) => void;
11
10
  placeholder: string;
12
11
  defaultValue?: TCustomSelectOptionPriority;
13
12
  width?: IntRange<130, 360>;
@@ -48,6 +48,10 @@ function CustomSelectPriority(_a) {
48
48
  var props = __rest(_a, []);
49
49
  return (_jsx(components.Option, __assign({}, props, { children: _jsxs("div", __assign({ className: "smartapp-custom-select__option" }, { children: [_jsx("div", __assign({ className: "smartapp-custom-select__option--avatar" }, { children: _jsx(Avatar, { widthHeight: 32, username: (_b = props === null || props === void 0 ? void 0 : props.data) === null || _b === void 0 ? void 0 : _b.username }) })), _jsxs("div", __assign({ className: "smartapp-custom-select__option--info" }, { children: [_jsxs("p", __assign({ className: "smartapp-custom-select__option--info__title" }, { children: [(_c = props === null || props === void 0 ? void 0 : props.data) === null || _c === void 0 ? void 0 : _c.username, " "] })), _jsxs("p", __assign({ className: "smartapp-custom-select__option--info__email" }, { children: [(_d = props === null || props === void 0 ? void 0 : props.data) === null || _d === void 0 ? void 0 : _d.email, " "] }))] }))] })) })));
50
50
  };
51
- return (_jsx("div", __assign({ className: "smartapp-custom-select" }, { children: _jsx(Select, { onChange: function (option) { return onChange(option); }, options: options, defaultValue: defaultValue, styles: customStyles, getOptionLabel: function (option) { return option.username; }, getOptionValue: function (option) { return option.email; }, placeholder: _jsx("div", __assign({ className: "smartapp-custom-select__placeholder" }, { children: placeholder })), components: { Option: Option, Control: Control, DropdownIndicator: DropdownIndicator, IndicatorSeparator: function () { return null; } } }) })));
51
+ return (_jsx("div", __assign({ className: "smartapp-custom-select" }, { children: _jsx(Select
52
+ /* @ts-ignore */
53
+ , {
54
+ /* @ts-ignore */
55
+ onChange: function (option) { return onChange(option); }, options: options, defaultValue: defaultValue, styles: customStyles, getOptionLabel: function (option) { return option.username; }, getOptionValue: function (option) { return option.email; }, placeholder: _jsx("div", __assign({ className: "smartapp-custom-select__placeholder" }, { children: placeholder })), components: { Option: Option, Control: Control, DropdownIndicator: DropdownIndicator, IndicatorSeparator: function () { return null; } } }) })));
52
56
  }
53
57
  export default CustomSelectPriority;
@@ -5,9 +5,8 @@ export type TCustomSelectOptionProfiles = {
5
5
  };
6
6
  export interface ICustomSelectProfiles {
7
7
  options: TCustomSelectOptionProfiles[];
8
- onChange: (option: any) => void;
9
- field?: any;
10
- placeholder: string;
8
+ onChange: (option: TCustomSelectOptionProfiles) => void;
9
+ placeholder?: string;
11
10
  defaultValue?: TCustomSelectOptionProfiles;
12
11
  width?: IntRange<130, 360>;
13
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expressms/smartapp-ui",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "SmartApp UI library",
5
5
  "license": "MIT",
6
6
  "main": "build/main/index.js",
@@ -54,7 +54,6 @@
54
54
  "jest-resolve": "^27.4.2",
55
55
  "jest-watch-typeahead": "^1.0.0",
56
56
  "mini-css-extract-plugin": "^2.4.5",
57
- "node-sass": "^8.0.0",
58
57
  "postcss": "^8.4.4",
59
58
  "postcss-flexbugs-fixes": "^5.0.2",
60
59
  "postcss-loader": "^6.2.1",
@@ -75,7 +74,7 @@
75
74
  "reactjs-popup": "^2.0.5",
76
75
  "resolve": "^1.20.0",
77
76
  "resolve-url-loader": "2.3.1",
78
- "sass": "^1.57.1",
77
+ "sass": "^1.63.6",
79
78
  "sass-loader": "^12.3.0",
80
79
  "semver": "^7.3.5",
81
80
  "source-map-loader": "^3.0.0",