@nulogy/components 8.7.3 → 8.8.0
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/dist/main.js
CHANGED
|
@@ -23038,20 +23038,42 @@
|
|
|
23038
23038
|
}
|
|
23039
23039
|
};
|
|
23040
23040
|
|
|
23041
|
-
|
|
23042
|
-
var
|
|
23043
|
-
|
|
23044
|
-
|
|
23041
|
+
function getControlBorderRadius(_ref3) {
|
|
23042
|
+
var border = _ref3.border,
|
|
23043
|
+
isMenuOpen = _ref3.isMenuOpen,
|
|
23044
|
+
menuLength = _ref3.menuLength,
|
|
23045
|
+
menuPlacement = _ref3.menuPlacement,
|
|
23046
|
+
theme = _ref3.theme;
|
|
23047
|
+
var isMenuEmpty = menuLength === 0;
|
|
23048
|
+
if (!isMenuOpen || isMenuEmpty || border !== menuPlacement) return theme.radii.medium;
|
|
23049
|
+
return 0;
|
|
23050
|
+
}
|
|
23051
|
+
function getMenuBorderRadius(_ref4) {
|
|
23052
|
+
var border = _ref4.border,
|
|
23053
|
+
menuPlacement = _ref4.menuPlacement,
|
|
23054
|
+
theme = _ref4.theme;
|
|
23055
|
+
return border === menuPlacement ? {
|
|
23056
|
+
radius: theme.radii.medium,
|
|
23057
|
+
style: "solid"
|
|
23058
|
+
} : {
|
|
23059
|
+
radius: 0,
|
|
23060
|
+
style: "none"
|
|
23061
|
+
};
|
|
23062
|
+
}
|
|
23063
|
+
var showIndicatorSeparator = function showIndicatorSeparator(_ref5) {
|
|
23064
|
+
var isMulti = _ref5.isMulti,
|
|
23065
|
+
hasValue = _ref5.hasValue,
|
|
23066
|
+
hasDefaultOptions = _ref5.hasDefaultOptions;
|
|
23045
23067
|
return isMulti && hasValue && hasDefaultOptions;
|
|
23046
23068
|
};
|
|
23047
23069
|
|
|
23048
|
-
var customStyles = function customStyles(
|
|
23049
|
-
var theme =
|
|
23050
|
-
error =
|
|
23051
|
-
maxHeight =
|
|
23052
|
-
windowed =
|
|
23053
|
-
|
|
23054
|
-
hasDefaultOptions =
|
|
23070
|
+
var customStyles = function customStyles(_ref6) {
|
|
23071
|
+
var theme = _ref6.theme,
|
|
23072
|
+
error = _ref6.error,
|
|
23073
|
+
maxHeight = _ref6.maxHeight,
|
|
23074
|
+
windowed = _ref6.windowed,
|
|
23075
|
+
_ref6$hasDefaultOptio = _ref6.hasDefaultOptions,
|
|
23076
|
+
hasDefaultOptions = _ref6$hasDefaultOptio === void 0 ? true : _ref6$hasDefaultOptio;
|
|
23055
23077
|
return {
|
|
23056
23078
|
option: function option() {
|
|
23057
23079
|
return {
|
|
@@ -23084,8 +23106,34 @@
|
|
|
23084
23106
|
theme: theme
|
|
23085
23107
|
}),
|
|
23086
23108
|
borderRadius: theme.radii.medium,
|
|
23087
|
-
borderBottomLeftRadius:
|
|
23088
|
-
|
|
23109
|
+
borderBottomLeftRadius: getControlBorderRadius({
|
|
23110
|
+
border: "bottom",
|
|
23111
|
+
isMenuOpen: state.selectProps.menuIsOpen,
|
|
23112
|
+
menuLength: state.selectProps.options.length,
|
|
23113
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23114
|
+
theme: theme
|
|
23115
|
+
}),
|
|
23116
|
+
borderBottomRightRadius: getControlBorderRadius({
|
|
23117
|
+
border: "bottom",
|
|
23118
|
+
isMenuOpen: state.selectProps.menuIsOpen,
|
|
23119
|
+
menuLength: state.selectProps.options.length,
|
|
23120
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23121
|
+
theme: theme
|
|
23122
|
+
}),
|
|
23123
|
+
borderTopRightRadius: getControlBorderRadius({
|
|
23124
|
+
border: "top",
|
|
23125
|
+
isMenuOpen: state.selectProps.menuIsOpen,
|
|
23126
|
+
menuLength: state.selectProps.options.length,
|
|
23127
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23128
|
+
theme: theme
|
|
23129
|
+
}),
|
|
23130
|
+
borderTopLeftRadius: getControlBorderRadius({
|
|
23131
|
+
border: "top",
|
|
23132
|
+
isMenuOpen: state.selectProps.menuIsOpen,
|
|
23133
|
+
menuLength: state.selectProps.options.length,
|
|
23134
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23135
|
+
theme: theme
|
|
23136
|
+
}),
|
|
23089
23137
|
"&:hover, &:focus": {
|
|
23090
23138
|
borderColor: getBorderColor({
|
|
23091
23139
|
errored: error,
|
|
@@ -23120,8 +23168,9 @@
|
|
|
23120
23168
|
});
|
|
23121
23169
|
},
|
|
23122
23170
|
menu: function menu(provided, state) {
|
|
23123
|
-
return {
|
|
23171
|
+
return Object.assign(Object.assign({}, provided), {
|
|
23124
23172
|
marginTop: 0,
|
|
23173
|
+
marginBottom: 0,
|
|
23125
23174
|
position: "absolute",
|
|
23126
23175
|
overflowX: "auto",
|
|
23127
23176
|
zIndex: "100",
|
|
@@ -23135,16 +23184,44 @@
|
|
|
23135
23184
|
isFocused: false,
|
|
23136
23185
|
theme: theme
|
|
23137
23186
|
}),
|
|
23138
|
-
borderBottomStyle: "solid",
|
|
23139
23187
|
borderLeftStyle: "solid",
|
|
23140
23188
|
borderRightStyle: "solid",
|
|
23141
|
-
|
|
23189
|
+
borderBottomStyle: getMenuBorderRadius({
|
|
23190
|
+
border: "bottom",
|
|
23191
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23192
|
+
theme: theme
|
|
23193
|
+
}).style,
|
|
23194
|
+
borderTopStyle: getMenuBorderRadius({
|
|
23195
|
+
border: "top",
|
|
23196
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23197
|
+
theme: theme
|
|
23198
|
+
}).style,
|
|
23199
|
+
borderBottomLeftRadius: getMenuBorderRadius({
|
|
23200
|
+
border: "bottom",
|
|
23201
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23202
|
+
theme: theme
|
|
23203
|
+
}).radius,
|
|
23204
|
+
borderBottomRightRadius: getMenuBorderRadius({
|
|
23205
|
+
border: "bottom",
|
|
23206
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23207
|
+
theme: theme
|
|
23208
|
+
}).radius,
|
|
23209
|
+
borderTopLeftRadius: getMenuBorderRadius({
|
|
23210
|
+
border: "top",
|
|
23211
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23212
|
+
theme: theme
|
|
23213
|
+
}).radius,
|
|
23214
|
+
borderTopRightRadius: getMenuBorderRadius({
|
|
23215
|
+
border: "top",
|
|
23216
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23217
|
+
theme: theme
|
|
23218
|
+
}).radius,
|
|
23142
23219
|
boxShadow: getShadow({
|
|
23143
23220
|
errored: error,
|
|
23144
23221
|
isOpen: true,
|
|
23145
23222
|
theme: theme
|
|
23146
23223
|
})
|
|
23147
|
-
};
|
|
23224
|
+
});
|
|
23148
23225
|
},
|
|
23149
23226
|
menuList: function menuList(provided) {
|
|
23150
23227
|
return Object.assign(Object.assign({}, provided), {
|
|
@@ -23274,6 +23351,7 @@
|
|
|
23274
23351
|
initialIsOpen: undefined,
|
|
23275
23352
|
maxHeight: "248px",
|
|
23276
23353
|
menuPosition: "absolute",
|
|
23354
|
+
menuPlacement: "bottom",
|
|
23277
23355
|
multiselect: false,
|
|
23278
23356
|
name: undefined,
|
|
23279
23357
|
onBlur: undefined,
|
package/dist/main.module.js
CHANGED
|
@@ -23012,20 +23012,42 @@ var getShadow = function getShadow(_ref2) {
|
|
|
23012
23012
|
}
|
|
23013
23013
|
};
|
|
23014
23014
|
|
|
23015
|
-
|
|
23016
|
-
var
|
|
23017
|
-
|
|
23018
|
-
|
|
23015
|
+
function getControlBorderRadius(_ref3) {
|
|
23016
|
+
var border = _ref3.border,
|
|
23017
|
+
isMenuOpen = _ref3.isMenuOpen,
|
|
23018
|
+
menuLength = _ref3.menuLength,
|
|
23019
|
+
menuPlacement = _ref3.menuPlacement,
|
|
23020
|
+
theme = _ref3.theme;
|
|
23021
|
+
var isMenuEmpty = menuLength === 0;
|
|
23022
|
+
if (!isMenuOpen || isMenuEmpty || border !== menuPlacement) return theme.radii.medium;
|
|
23023
|
+
return 0;
|
|
23024
|
+
}
|
|
23025
|
+
function getMenuBorderRadius(_ref4) {
|
|
23026
|
+
var border = _ref4.border,
|
|
23027
|
+
menuPlacement = _ref4.menuPlacement,
|
|
23028
|
+
theme = _ref4.theme;
|
|
23029
|
+
return border === menuPlacement ? {
|
|
23030
|
+
radius: theme.radii.medium,
|
|
23031
|
+
style: "solid"
|
|
23032
|
+
} : {
|
|
23033
|
+
radius: 0,
|
|
23034
|
+
style: "none"
|
|
23035
|
+
};
|
|
23036
|
+
}
|
|
23037
|
+
var showIndicatorSeparator = function showIndicatorSeparator(_ref5) {
|
|
23038
|
+
var isMulti = _ref5.isMulti,
|
|
23039
|
+
hasValue = _ref5.hasValue,
|
|
23040
|
+
hasDefaultOptions = _ref5.hasDefaultOptions;
|
|
23019
23041
|
return isMulti && hasValue && hasDefaultOptions;
|
|
23020
23042
|
};
|
|
23021
23043
|
|
|
23022
|
-
var customStyles = function customStyles(
|
|
23023
|
-
var theme =
|
|
23024
|
-
error =
|
|
23025
|
-
maxHeight =
|
|
23026
|
-
windowed =
|
|
23027
|
-
|
|
23028
|
-
hasDefaultOptions =
|
|
23044
|
+
var customStyles = function customStyles(_ref6) {
|
|
23045
|
+
var theme = _ref6.theme,
|
|
23046
|
+
error = _ref6.error,
|
|
23047
|
+
maxHeight = _ref6.maxHeight,
|
|
23048
|
+
windowed = _ref6.windowed,
|
|
23049
|
+
_ref6$hasDefaultOptio = _ref6.hasDefaultOptions,
|
|
23050
|
+
hasDefaultOptions = _ref6$hasDefaultOptio === void 0 ? true : _ref6$hasDefaultOptio;
|
|
23029
23051
|
return {
|
|
23030
23052
|
option: function option() {
|
|
23031
23053
|
return {
|
|
@@ -23058,8 +23080,34 @@ var customStyles = function customStyles(_ref4) {
|
|
|
23058
23080
|
theme: theme
|
|
23059
23081
|
}),
|
|
23060
23082
|
borderRadius: theme.radii.medium,
|
|
23061
|
-
borderBottomLeftRadius:
|
|
23062
|
-
|
|
23083
|
+
borderBottomLeftRadius: getControlBorderRadius({
|
|
23084
|
+
border: "bottom",
|
|
23085
|
+
isMenuOpen: state.selectProps.menuIsOpen,
|
|
23086
|
+
menuLength: state.selectProps.options.length,
|
|
23087
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23088
|
+
theme: theme
|
|
23089
|
+
}),
|
|
23090
|
+
borderBottomRightRadius: getControlBorderRadius({
|
|
23091
|
+
border: "bottom",
|
|
23092
|
+
isMenuOpen: state.selectProps.menuIsOpen,
|
|
23093
|
+
menuLength: state.selectProps.options.length,
|
|
23094
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23095
|
+
theme: theme
|
|
23096
|
+
}),
|
|
23097
|
+
borderTopRightRadius: getControlBorderRadius({
|
|
23098
|
+
border: "top",
|
|
23099
|
+
isMenuOpen: state.selectProps.menuIsOpen,
|
|
23100
|
+
menuLength: state.selectProps.options.length,
|
|
23101
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23102
|
+
theme: theme
|
|
23103
|
+
}),
|
|
23104
|
+
borderTopLeftRadius: getControlBorderRadius({
|
|
23105
|
+
border: "top",
|
|
23106
|
+
isMenuOpen: state.selectProps.menuIsOpen,
|
|
23107
|
+
menuLength: state.selectProps.options.length,
|
|
23108
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23109
|
+
theme: theme
|
|
23110
|
+
}),
|
|
23063
23111
|
"&:hover, &:focus": {
|
|
23064
23112
|
borderColor: getBorderColor({
|
|
23065
23113
|
errored: error,
|
|
@@ -23094,8 +23142,9 @@ var customStyles = function customStyles(_ref4) {
|
|
|
23094
23142
|
});
|
|
23095
23143
|
},
|
|
23096
23144
|
menu: function menu(provided, state) {
|
|
23097
|
-
return {
|
|
23145
|
+
return Object.assign(Object.assign({}, provided), {
|
|
23098
23146
|
marginTop: 0,
|
|
23147
|
+
marginBottom: 0,
|
|
23099
23148
|
position: "absolute",
|
|
23100
23149
|
overflowX: "auto",
|
|
23101
23150
|
zIndex: "100",
|
|
@@ -23109,16 +23158,44 @@ var customStyles = function customStyles(_ref4) {
|
|
|
23109
23158
|
isFocused: false,
|
|
23110
23159
|
theme: theme
|
|
23111
23160
|
}),
|
|
23112
|
-
borderBottomStyle: "solid",
|
|
23113
23161
|
borderLeftStyle: "solid",
|
|
23114
23162
|
borderRightStyle: "solid",
|
|
23115
|
-
|
|
23163
|
+
borderBottomStyle: getMenuBorderRadius({
|
|
23164
|
+
border: "bottom",
|
|
23165
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23166
|
+
theme: theme
|
|
23167
|
+
}).style,
|
|
23168
|
+
borderTopStyle: getMenuBorderRadius({
|
|
23169
|
+
border: "top",
|
|
23170
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23171
|
+
theme: theme
|
|
23172
|
+
}).style,
|
|
23173
|
+
borderBottomLeftRadius: getMenuBorderRadius({
|
|
23174
|
+
border: "bottom",
|
|
23175
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23176
|
+
theme: theme
|
|
23177
|
+
}).radius,
|
|
23178
|
+
borderBottomRightRadius: getMenuBorderRadius({
|
|
23179
|
+
border: "bottom",
|
|
23180
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23181
|
+
theme: theme
|
|
23182
|
+
}).radius,
|
|
23183
|
+
borderTopLeftRadius: getMenuBorderRadius({
|
|
23184
|
+
border: "top",
|
|
23185
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23186
|
+
theme: theme
|
|
23187
|
+
}).radius,
|
|
23188
|
+
borderTopRightRadius: getMenuBorderRadius({
|
|
23189
|
+
border: "top",
|
|
23190
|
+
menuPlacement: state.selectProps.menuPlacement,
|
|
23191
|
+
theme: theme
|
|
23192
|
+
}).radius,
|
|
23116
23193
|
boxShadow: getShadow({
|
|
23117
23194
|
errored: error,
|
|
23118
23195
|
isOpen: true,
|
|
23119
23196
|
theme: theme
|
|
23120
23197
|
})
|
|
23121
|
-
};
|
|
23198
|
+
});
|
|
23122
23199
|
},
|
|
23123
23200
|
menuList: function menuList(provided) {
|
|
23124
23201
|
return Object.assign(Object.assign({}, provided), {
|
|
@@ -23248,6 +23325,7 @@ var SelectDefaultProps = {
|
|
|
23248
23325
|
initialIsOpen: undefined,
|
|
23249
23326
|
maxHeight: "248px",
|
|
23250
23327
|
menuPosition: "absolute",
|
|
23328
|
+
menuPlacement: "bottom",
|
|
23251
23329
|
multiselect: false,
|
|
23252
23330
|
name: undefined,
|
|
23253
23331
|
onBlur: undefined,
|
|
@@ -15,6 +15,7 @@ export declare type SelectProps = {
|
|
|
15
15
|
id?: string;
|
|
16
16
|
initialIsOpen?: boolean;
|
|
17
17
|
menuPosition?: string;
|
|
18
|
+
menuPlacement?: string;
|
|
18
19
|
maxHeight?: string;
|
|
19
20
|
multiselect?: boolean;
|
|
20
21
|
name?: string;
|
|
@@ -50,6 +51,7 @@ export declare const SelectDefaultProps: {
|
|
|
50
51
|
initialIsOpen: any;
|
|
51
52
|
maxHeight: string;
|
|
52
53
|
menuPosition: string;
|
|
54
|
+
menuPlacement: string;
|
|
53
55
|
multiselect: boolean;
|
|
54
56
|
name: any;
|
|
55
57
|
onBlur: any;
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
import { DefaultNDSThemeType } from "../theme.type";
|
|
2
|
+
declare type Placement = "top" | "bottom";
|
|
3
|
+
export declare function getControlBorderRadius({ border, isMenuOpen, menuLength, menuPlacement, theme, }: {
|
|
4
|
+
border: Placement;
|
|
5
|
+
isMenuOpen: boolean;
|
|
6
|
+
menuLength: number;
|
|
7
|
+
menuPlacement: Placement;
|
|
8
|
+
theme: DefaultNDSThemeType;
|
|
9
|
+
}): string | 0;
|
|
10
|
+
export declare function getMenuBorderRadius({ border, menuPlacement, theme, }: {
|
|
11
|
+
border: Placement;
|
|
12
|
+
menuPlacement: Placement;
|
|
13
|
+
theme: DefaultNDSThemeType;
|
|
14
|
+
}): {
|
|
15
|
+
radius: string;
|
|
16
|
+
style: string;
|
|
17
|
+
} | {
|
|
18
|
+
radius: number;
|
|
19
|
+
style: string;
|
|
20
|
+
};
|
|
1
21
|
export declare const showIndicatorSeparator: ({ isMulti, hasValue, hasDefaultOptions }: {
|
|
2
22
|
isMulti: any;
|
|
3
23
|
hasValue: any;
|
|
@@ -28,8 +48,10 @@ declare const customStyles: ({ theme, error, maxHeight, windowed, hasDefaultOpti
|
|
|
28
48
|
boxSizing: string;
|
|
29
49
|
boxShadow: any;
|
|
30
50
|
borderRadius: any;
|
|
31
|
-
borderBottomLeftRadius:
|
|
32
|
-
borderBottomRightRadius:
|
|
51
|
+
borderBottomLeftRadius: string | number;
|
|
52
|
+
borderBottomRightRadius: string | number;
|
|
53
|
+
borderTopRightRadius: string | number;
|
|
54
|
+
borderTopLeftRadius: string | number;
|
|
33
55
|
"&:hover, &:focus": {
|
|
34
56
|
borderColor: any;
|
|
35
57
|
};
|
|
@@ -38,21 +60,7 @@ declare const customStyles: ({ theme, error, maxHeight, windowed, hasDefaultOpti
|
|
|
38
60
|
indicatorsContainer: (provided: any) => any;
|
|
39
61
|
input: () => {};
|
|
40
62
|
valueContainer: (provided: any) => any;
|
|
41
|
-
menu: (provided: any, state: any) =>
|
|
42
|
-
marginTop: number;
|
|
43
|
-
position: string;
|
|
44
|
-
overflowX: string;
|
|
45
|
-
zIndex: string;
|
|
46
|
-
width: string;
|
|
47
|
-
background: any;
|
|
48
|
-
borderWidth: string;
|
|
49
|
-
borderColor: any;
|
|
50
|
-
borderBottomStyle: string;
|
|
51
|
-
borderLeftStyle: string;
|
|
52
|
-
borderRightStyle: string;
|
|
53
|
-
borderRadius: string;
|
|
54
|
-
boxShadow: any;
|
|
55
|
-
};
|
|
63
|
+
menu: (provided: any, state: any) => any;
|
|
56
64
|
menuList: (provided: any) => any;
|
|
57
65
|
multiValue: (provided: any) => any;
|
|
58
66
|
multiValueLabel: () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nulogy/components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.8.0",
|
|
4
4
|
"description": "Component library for the Nulogy Design System - http://nulogy.design",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
"jest": "24.1.0",
|
|
110
110
|
"jest-styled-components": "7",
|
|
111
111
|
"jscodeshift": "^0.11.0",
|
|
112
|
+
"lost-pixel": "^3.2.0",
|
|
112
113
|
"mockdate": "^3.0.2",
|
|
113
114
|
"plop": "^2.4.0",
|
|
114
115
|
"prop-types": "15.7.2",
|