@plurid/plurid-ui-components-react 0.0.0-12 → 0.0.0-13

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.
@@ -7,6 +7,7 @@ export interface DropdownProperties {
7
7
  atSelect: (selection: PluridUIDropdownSelectable | string, kind?: string) => void;
8
8
  left?: boolean;
9
9
  kind?: string;
10
+ listTop?: string;
10
11
  dropdownToggled?: boolean;
11
12
  /**
12
13
  * Hide dropdown after click selection.
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Theme } from '@plurid/plurid-themes';
3
3
  export interface TextlineProperties {
4
4
  text: string;
5
- atChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
5
+ atChange: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
6
6
  atKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
7
7
  atFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
8
8
  atBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
@@ -30,12 +30,12 @@ export interface TextlineProperties {
30
30
  export declare type TextlineType = TextlineProperties & React.RefAttributes<any>;
31
31
  /**
32
32
  * @param text `string`
33
- * @param atChange `(event: React.ChangeEvent<HTMLInputElement>) => void`
33
+ * @param atChange `(event: React.ChangeEvent<HTMLInputElement>, value: string) => void`
34
34
  * @param atKeyDown `(event: React.KeyboardEvent<HTMLInputElement>) => void`
35
35
  * @param atFocus `(event: React.FocusEvent<HTMLInputElement>) => void`
36
36
  * @param atBlur `(event: React.FocusEvent<HTMLInputElement>) => void`
37
37
  *
38
- * @param type optional - `'text' | 'password'`
38
+ * @param type optional - `'text' | 'password' | 'number'`
39
39
  * @param placeholder optional - `string`
40
40
  * @param autoCapitalize optional - `string`
41
41
  * @param autoComplete optional - `string`
@@ -1020,7 +1020,9 @@ const Textline = forwardRef(((properties, reference) => {
1020
1020
  }, React.createElement("input", {
1021
1021
  type: _type,
1022
1022
  value: text,
1023
- onChange: atChange,
1023
+ onChange: event => {
1024
+ atChange(event, event.target.value);
1025
+ },
1024
1026
  onKeyDown: handleKeyDown,
1025
1027
  onFocus: atFocus,
1026
1028
  onBlur: atBlur,
@@ -1089,6 +1091,7 @@ const StyledDropdownList = styled.div`
1089
1091
  }
1090
1092
  }};
1091
1093
  color: ${props => props.theme.colorPrimary};
1094
+ position: absolute;
1092
1095
  left: ${props => {
1093
1096
  if (props.left) {
1094
1097
  return "0px";
@@ -1100,6 +1103,12 @@ const StyledDropdownList = styled.div`
1100
1103
  return "auto";
1101
1104
  }
1102
1105
  return "0px";
1106
+ }};
1107
+ top: ${props => {
1108
+ if (props.listTop) {
1109
+ return props.listTop;
1110
+ }
1111
+ return "25px";
1103
1112
  }};
1104
1113
  height: ${props => {
1105
1114
  if (props.heightItems) {
@@ -1136,8 +1145,6 @@ const StyledDropdownList = styled.div`
1136
1145
  return "initial";
1137
1146
  }};
1138
1147
 
1139
- position: absolute;
1140
- top: 25px;
1141
1148
  border-radius: 10px;
1142
1149
  min-width: 60px;
1143
1150
 
@@ -1219,7 +1226,7 @@ const StyledFilterUpdate = styled.div`
1219
1226
  `;
1220
1227
 
1221
1228
  const Dropdown = properties => {
1222
- const {selected: selected, selectables: selectables, atSelect: atSelect, left: left, kind: kind, 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;
1229
+ 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;
1223
1230
  const _generalTheme = generalThemeProperty === undefined ? themeProperty === undefined ? plurid : themeProperty : generalThemeProperty;
1224
1231
  const _interactionTheme = interactionThemeProperty === undefined ? themeProperty === undefined ? plurid : themeProperty : interactionThemeProperty;
1225
1232
  const _level = level !== null && level !== void 0 ? level : 0;
@@ -1391,6 +1398,7 @@ const Dropdown = properties => {
1391
1398
  }, typeof selected === "string" ? selected : selected.value), showList && React.createElement(StyledDropdownList, {
1392
1399
  theme: interactionTheme,
1393
1400
  left: left,
1401
+ listTop: listTop,
1394
1402
  level: _level,
1395
1403
  heightItems: heightItems && filterable && filteredSelectables.length < heightItems ? filteredSelectables.length + 1 : heightItems,
1396
1404
  heightBeyond: filteredSelectables.length > (heightItems || 0),