@nulogy/components 8.0.1 → 8.1.2

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
@@ -23328,7 +23328,6 @@
23328
23328
  required = _a.required,
23329
23329
  requirementText = _a.requirementText,
23330
23330
  helpText = _a.helpText,
23331
- noOptionsMessage = _a.noOptionsMessage,
23332
23331
  disabled = _a.disabled,
23333
23332
  errorMessage = _a.errorMessage,
23334
23333
  errorList = _a.errorList,
@@ -23337,27 +23336,16 @@
23337
23336
  id = _a.id,
23338
23337
  initialIsOpen = _a.initialIsOpen,
23339
23338
  maxHeight = _a.maxHeight,
23340
- menuPosition = _a.menuPosition,
23341
23339
  multiselect = _a.multiselect,
23342
- name = _a.name,
23343
23340
  onChange = _a.onChange,
23344
23341
  placeholder = _a.placeholder,
23345
23342
  value = _a.value,
23346
23343
  defaultValue = _a.defaultValue,
23347
- className = _a.className,
23348
- classNamePrefix = _a.classNamePrefix,
23349
- onBlur = _a.onBlur,
23350
- menuIsOpen = _a.menuIsOpen,
23351
- onMenuOpen = _a.onMenuOpen,
23352
- onMenuClose = _a.onMenuClose,
23353
- onInputChange = _a.onInputChange,
23354
23344
  components = _a.components,
23355
23345
  ariaLabel = _a["aria-label"],
23356
23346
  _a$windowThreshold = _a.windowThreshold,
23357
23347
  windowThreshold = _a$windowThreshold === void 0 ? 300 : _a$windowThreshold,
23358
- filterOption = _a.filterOption,
23359
- closeMenuOnSelect = _a.closeMenuOnSelect,
23360
- props = __rest(_a, ["autocomplete", "options", "labelText", "required", "requirementText", "helpText", "noOptionsMessage", "disabled", "errorMessage", "errorList", "error", "id", "initialIsOpen", "maxHeight", "menuPosition", "multiselect", "name", "onChange", "placeholder", "value", "defaultValue", "className", "classNamePrefix", "onBlur", "menuIsOpen", "onMenuOpen", "onMenuClose", "onInputChange", "components", "aria-label", "windowThreshold", "filterOption", "closeMenuOnSelect"]);
23348
+ props = __rest(_a, ["autocomplete", "options", "labelText", "required", "requirementText", "helpText", "disabled", "errorMessage", "errorList", "error", "id", "initialIsOpen", "maxHeight", "multiselect", "onChange", "placeholder", "value", "defaultValue", "components", "aria-label", "windowThreshold"]);
23361
23349
 
23362
23350
  var _useTranslation = useTranslation(),
23363
23351
  t = _useTranslation.t;
@@ -23371,14 +23359,9 @@
23371
23359
  labelText: labelText,
23372
23360
  requirementText: requirementText,
23373
23361
  helpText: helpText
23374
- }, /*#__PURE__*/React__default['default'].createElement(WindowedSelect__default['default'], {
23362
+ }, /*#__PURE__*/React__default['default'].createElement(WindowedSelect__default['default'], Object.assign({
23375
23363
  ref: ref,
23376
- className: className,
23377
- classNamePrefix: classNamePrefix,
23378
- noOptionsMessage: noOptionsMessage,
23379
23364
  placeholder: placeholder || t("select ..."),
23380
- options: options,
23381
- labelText: labelText,
23382
23365
  windowThreshold: windowThreshold,
23383
23366
  styles: customStyles({
23384
23367
  theme: themeContext,
@@ -23392,19 +23375,12 @@
23392
23375
  "aria-invalid": error,
23393
23376
  defaultMenuIsOpen: initialIsOpen,
23394
23377
  inputId: id,
23395
- onBlur: onBlur,
23396
23378
  onChange: onChange && function (option) {
23397
23379
  return onChange(extractValue(option, multiselect));
23398
23380
  },
23399
23381
  defaultValue: getReactSelectValue(options, defaultValue),
23400
23382
  value: getReactSelectValue(options, value),
23401
- name: name,
23402
23383
  isMulti: multiselect,
23403
- menuIsOpen: menuIsOpen,
23404
- onMenuOpen: onMenuOpen,
23405
- onMenuClose: onMenuClose,
23406
- menuPosition: menuPosition,
23407
- onInputChange: onInputChange,
23408
23384
  theme: themeContext,
23409
23385
  components: Object.assign({
23410
23386
  Option: SelectOption,
@@ -23417,9 +23393,9 @@
23417
23393
  Input: SelectInput
23418
23394
  }, components),
23419
23395
  "aria-label": ariaLabel,
23420
- filterOption: filterOption,
23421
- closeMenuOnSelect: closeMenuOnSelect
23422
- }), /*#__PURE__*/React__default['default'].createElement(InlineValidation, {
23396
+ options: options,
23397
+ labelText: labelText
23398
+ }, props)), /*#__PURE__*/React__default['default'].createElement(InlineValidation, {
23423
23399
  mt: "x1",
23424
23400
  errorMessage: errorMessage,
23425
23401
  errorList: errorList
@@ -26114,38 +26090,39 @@
26114
26090
  children = _this$props.children,
26115
26091
  onTabClick = _this$props.onTabClick;
26116
26092
  var selectedIndex = this.getSelectedIndex();
26117
- return React__default['default'].Children.map(children, function (tab, index) {
26118
- if (tab) {
26119
- return /*#__PURE__*/React__default['default'].cloneElement(tab, {
26120
- onClick: function onClick(e) {
26121
- var _a, _b;
26122
-
26123
- setFocusToTab(index);
26124
-
26125
- if ((_a = tab === null || tab === void 0 ? void 0 : tab.props) === null || _a === void 0 ? void 0 : _a.onClick) {
26126
- (_b = tab === null || tab === void 0 ? void 0 : tab.props) === null || _b === void 0 ? void 0 : _b.onClick(e);
26127
- }
26093
+ var tabs = React__default['default'].Children.toArray(children);
26094
+ return tabs.filter(function (tab) {
26095
+ return Boolean(tab);
26096
+ }).map(function (tab, index) {
26097
+ return /*#__PURE__*/React__default['default'].cloneElement(tab, {
26098
+ onClick: function onClick(e) {
26099
+ var _a, _b;
26100
+
26101
+ setFocusToTab(index);
26102
+
26103
+ if ((_a = tab === null || tab === void 0 ? void 0 : tab.props) === null || _a === void 0 ? void 0 : _a.onClick) {
26104
+ (_b = tab === null || tab === void 0 ? void 0 : tab.props) === null || _b === void 0 ? void 0 : _b.onClick(e);
26105
+ }
26128
26106
 
26129
- if (onTabClick) {
26130
- onTabClick(e, index);
26131
- } else {
26132
- _this2.handleTabClick(index);
26133
- }
26134
- },
26135
- onFocus: function onFocus(e) {
26136
- e.stopPropagation();
26137
- },
26138
- onKeyDown: handleArrowNavigation,
26139
- index: index,
26140
- tabIndex: index === focusedIndex ? 0 : -1,
26141
- selected: index === selectedIndex,
26142
- "aria-selected": index === selectedIndex,
26143
- fullWidth: fitted,
26144
- ref: function ref(_ref) {
26145
- _this2.tabRefs[index] = _ref;
26107
+ if (onTabClick) {
26108
+ onTabClick(e, index);
26109
+ } else {
26110
+ _this2.handleTabClick(index);
26146
26111
  }
26147
- });
26148
- }
26112
+ },
26113
+ onFocus: function onFocus(e) {
26114
+ e.stopPropagation();
26115
+ },
26116
+ onKeyDown: handleArrowNavigation,
26117
+ index: index,
26118
+ tabIndex: index === focusedIndex ? 0 : -1,
26119
+ selected: index === selectedIndex,
26120
+ "aria-selected": index === selectedIndex,
26121
+ fullWidth: fitted,
26122
+ ref: function ref(_ref) {
26123
+ _this2.tabRefs[index] = _ref;
26124
+ }
26125
+ });
26149
26126
  });
26150
26127
  };
26151
26128
 
@@ -26154,7 +26131,10 @@
26154
26131
  children = _this$props2.children,
26155
26132
  renderTabContentOnlyWhenSelected = _this$props2.renderTabContentOnlyWhenSelected;
26156
26133
  var selectedIndex = this.getSelectedIndex();
26157
- var tabContent = React__default['default'].Children.map(children, function (tab, index) {
26134
+ var tabs = React__default['default'].Children.toArray(children);
26135
+ var tabContent = tabs.filter(function (tab) {
26136
+ return Boolean(tab);
26137
+ }).map(function (tab, index) {
26158
26138
  var _a;
26159
26139
 
26160
26140
  var selected = index === selectedIndex;
@@ -23302,7 +23302,6 @@ var ReactSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
23302
23302
  required = _a.required,
23303
23303
  requirementText = _a.requirementText,
23304
23304
  helpText = _a.helpText,
23305
- noOptionsMessage = _a.noOptionsMessage,
23306
23305
  disabled = _a.disabled,
23307
23306
  errorMessage = _a.errorMessage,
23308
23307
  errorList = _a.errorList,
@@ -23311,27 +23310,16 @@ var ReactSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
23311
23310
  id = _a.id,
23312
23311
  initialIsOpen = _a.initialIsOpen,
23313
23312
  maxHeight = _a.maxHeight,
23314
- menuPosition = _a.menuPosition,
23315
23313
  multiselect = _a.multiselect,
23316
- name = _a.name,
23317
23314
  onChange = _a.onChange,
23318
23315
  placeholder = _a.placeholder,
23319
23316
  value = _a.value,
23320
23317
  defaultValue = _a.defaultValue,
23321
- className = _a.className,
23322
- classNamePrefix = _a.classNamePrefix,
23323
- onBlur = _a.onBlur,
23324
- menuIsOpen = _a.menuIsOpen,
23325
- onMenuOpen = _a.onMenuOpen,
23326
- onMenuClose = _a.onMenuClose,
23327
- onInputChange = _a.onInputChange,
23328
23318
  components = _a.components,
23329
23319
  ariaLabel = _a["aria-label"],
23330
23320
  _a$windowThreshold = _a.windowThreshold,
23331
23321
  windowThreshold = _a$windowThreshold === void 0 ? 300 : _a$windowThreshold,
23332
- filterOption = _a.filterOption,
23333
- closeMenuOnSelect = _a.closeMenuOnSelect,
23334
- props = __rest(_a, ["autocomplete", "options", "labelText", "required", "requirementText", "helpText", "noOptionsMessage", "disabled", "errorMessage", "errorList", "error", "id", "initialIsOpen", "maxHeight", "menuPosition", "multiselect", "name", "onChange", "placeholder", "value", "defaultValue", "className", "classNamePrefix", "onBlur", "menuIsOpen", "onMenuOpen", "onMenuClose", "onInputChange", "components", "aria-label", "windowThreshold", "filterOption", "closeMenuOnSelect"]);
23322
+ props = __rest(_a, ["autocomplete", "options", "labelText", "required", "requirementText", "helpText", "disabled", "errorMessage", "errorList", "error", "id", "initialIsOpen", "maxHeight", "multiselect", "onChange", "placeholder", "value", "defaultValue", "components", "aria-label", "windowThreshold"]);
23335
23323
 
23336
23324
  var _useTranslation = useTranslation(),
23337
23325
  t = _useTranslation.t;
@@ -23345,14 +23333,9 @@ var ReactSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
23345
23333
  labelText: labelText,
23346
23334
  requirementText: requirementText,
23347
23335
  helpText: helpText
23348
- }, /*#__PURE__*/React__default.createElement(WindowedSelect, {
23336
+ }, /*#__PURE__*/React__default.createElement(WindowedSelect, Object.assign({
23349
23337
  ref: ref,
23350
- className: className,
23351
- classNamePrefix: classNamePrefix,
23352
- noOptionsMessage: noOptionsMessage,
23353
23338
  placeholder: placeholder || t("select ..."),
23354
- options: options,
23355
- labelText: labelText,
23356
23339
  windowThreshold: windowThreshold,
23357
23340
  styles: customStyles({
23358
23341
  theme: themeContext,
@@ -23366,19 +23349,12 @@ var ReactSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
23366
23349
  "aria-invalid": error,
23367
23350
  defaultMenuIsOpen: initialIsOpen,
23368
23351
  inputId: id,
23369
- onBlur: onBlur,
23370
23352
  onChange: onChange && function (option) {
23371
23353
  return onChange(extractValue(option, multiselect));
23372
23354
  },
23373
23355
  defaultValue: getReactSelectValue(options, defaultValue),
23374
23356
  value: getReactSelectValue(options, value),
23375
- name: name,
23376
23357
  isMulti: multiselect,
23377
- menuIsOpen: menuIsOpen,
23378
- onMenuOpen: onMenuOpen,
23379
- onMenuClose: onMenuClose,
23380
- menuPosition: menuPosition,
23381
- onInputChange: onInputChange,
23382
23358
  theme: themeContext,
23383
23359
  components: Object.assign({
23384
23360
  Option: SelectOption,
@@ -23391,9 +23367,9 @@ var ReactSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
23391
23367
  Input: SelectInput
23392
23368
  }, components),
23393
23369
  "aria-label": ariaLabel,
23394
- filterOption: filterOption,
23395
- closeMenuOnSelect: closeMenuOnSelect
23396
- }), /*#__PURE__*/React__default.createElement(InlineValidation, {
23370
+ options: options,
23371
+ labelText: labelText
23372
+ }, props)), /*#__PURE__*/React__default.createElement(InlineValidation, {
23397
23373
  mt: "x1",
23398
23374
  errorMessage: errorMessage,
23399
23375
  errorList: errorList
@@ -26088,38 +26064,39 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
26088
26064
  children = _this$props.children,
26089
26065
  onTabClick = _this$props.onTabClick;
26090
26066
  var selectedIndex = this.getSelectedIndex();
26091
- return React__default.Children.map(children, function (tab, index) {
26092
- if (tab) {
26093
- return /*#__PURE__*/React__default.cloneElement(tab, {
26094
- onClick: function onClick(e) {
26095
- var _a, _b;
26096
-
26097
- setFocusToTab(index);
26098
-
26099
- if ((_a = tab === null || tab === void 0 ? void 0 : tab.props) === null || _a === void 0 ? void 0 : _a.onClick) {
26100
- (_b = tab === null || tab === void 0 ? void 0 : tab.props) === null || _b === void 0 ? void 0 : _b.onClick(e);
26101
- }
26067
+ var tabs = React__default.Children.toArray(children);
26068
+ return tabs.filter(function (tab) {
26069
+ return Boolean(tab);
26070
+ }).map(function (tab, index) {
26071
+ return /*#__PURE__*/React__default.cloneElement(tab, {
26072
+ onClick: function onClick(e) {
26073
+ var _a, _b;
26074
+
26075
+ setFocusToTab(index);
26076
+
26077
+ if ((_a = tab === null || tab === void 0 ? void 0 : tab.props) === null || _a === void 0 ? void 0 : _a.onClick) {
26078
+ (_b = tab === null || tab === void 0 ? void 0 : tab.props) === null || _b === void 0 ? void 0 : _b.onClick(e);
26079
+ }
26102
26080
 
26103
- if (onTabClick) {
26104
- onTabClick(e, index);
26105
- } else {
26106
- _this2.handleTabClick(index);
26107
- }
26108
- },
26109
- onFocus: function onFocus(e) {
26110
- e.stopPropagation();
26111
- },
26112
- onKeyDown: handleArrowNavigation,
26113
- index: index,
26114
- tabIndex: index === focusedIndex ? 0 : -1,
26115
- selected: index === selectedIndex,
26116
- "aria-selected": index === selectedIndex,
26117
- fullWidth: fitted,
26118
- ref: function ref(_ref) {
26119
- _this2.tabRefs[index] = _ref;
26081
+ if (onTabClick) {
26082
+ onTabClick(e, index);
26083
+ } else {
26084
+ _this2.handleTabClick(index);
26120
26085
  }
26121
- });
26122
- }
26086
+ },
26087
+ onFocus: function onFocus(e) {
26088
+ e.stopPropagation();
26089
+ },
26090
+ onKeyDown: handleArrowNavigation,
26091
+ index: index,
26092
+ tabIndex: index === focusedIndex ? 0 : -1,
26093
+ selected: index === selectedIndex,
26094
+ "aria-selected": index === selectedIndex,
26095
+ fullWidth: fitted,
26096
+ ref: function ref(_ref) {
26097
+ _this2.tabRefs[index] = _ref;
26098
+ }
26099
+ });
26123
26100
  });
26124
26101
  };
26125
26102
 
@@ -26128,7 +26105,10 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
26128
26105
  children = _this$props2.children,
26129
26106
  renderTabContentOnlyWhenSelected = _this$props2.renderTabContentOnlyWhenSelected;
26130
26107
  var selectedIndex = this.getSelectedIndex();
26131
- var tabContent = React__default.Children.map(children, function (tab, index) {
26108
+ var tabs = React__default.Children.toArray(children);
26109
+ var tabContent = tabs.filter(function (tab) {
26110
+ return Boolean(tab);
26111
+ }).map(function (tab, index) {
26132
26112
  var _a;
26133
26113
 
26134
26114
  var selected = index === selectedIndex;
@@ -1,36 +1,4 @@
1
1
  import React from "react";
2
- export declare const SelectDefaultProps: {
3
- autocomplete: boolean;
4
- disabled: any;
5
- defaultValue: any;
6
- error: any;
7
- errorMessage: any;
8
- errorList: any;
9
- labelText: any;
10
- helpText: any;
11
- noOptionsMessage: any;
12
- requirementText: any;
13
- id: any;
14
- initialIsOpen: any;
15
- maxHeight: string;
16
- menuPosition: string;
17
- multiselect: boolean;
18
- name: any;
19
- onBlur: any;
20
- onChange: any;
21
- placeholder: any;
22
- required: boolean;
23
- value: any;
24
- className: any;
25
- classNamePrefix: string;
26
- menuIsOpen: any;
27
- onMenuOpen: any;
28
- onMenuClose: any;
29
- onInputChange: any;
30
- components: any;
31
- closeMenuOnSelect: boolean;
32
- };
33
- export declare const getOption: (options: any, value: any) => any;
34
2
  export declare type SelectProps = {
35
3
  options?: any[];
36
4
  windowThreshold?: number;
@@ -65,6 +33,39 @@ export declare type SelectProps = {
65
33
  components?: any;
66
34
  closeMenuOnSelect?: boolean;
67
35
  "aria-label"?: string;
36
+ [key: string]: any;
68
37
  };
69
- declare const ReactSelect: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<unknown>>;
38
+ export declare const SelectDefaultProps: {
39
+ autocomplete: boolean;
40
+ disabled: any;
41
+ defaultValue: any;
42
+ error: any;
43
+ errorMessage: any;
44
+ errorList: any;
45
+ labelText: any;
46
+ helpText: any;
47
+ noOptionsMessage: any;
48
+ requirementText: any;
49
+ id: any;
50
+ initialIsOpen: any;
51
+ maxHeight: string;
52
+ menuPosition: string;
53
+ multiselect: boolean;
54
+ name: any;
55
+ onBlur: any;
56
+ onChange: any;
57
+ placeholder: any;
58
+ required: boolean;
59
+ value: any;
60
+ className: any;
61
+ classNamePrefix: string;
62
+ menuIsOpen: any;
63
+ onMenuOpen: any;
64
+ onMenuClose: any;
65
+ onInputChange: any;
66
+ components: any;
67
+ closeMenuOnSelect: boolean;
68
+ };
69
+ export declare const getOption: (options: any, value: any) => any;
70
+ declare const ReactSelect: React.ForwardRefExoticComponent<Pick<SelectProps, React.ReactText> & React.RefAttributes<unknown>>;
70
71
  export default ReactSelect;
@@ -107,3 +107,4 @@ export declare const UsingRefToControlFocus: {
107
107
  name: string;
108
108
  };
109
109
  };
110
+ export declare const WithCustomProps: () => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nulogy/components",
3
- "version": "8.0.1",
3
+ "version": "8.1.2",
4
4
  "description": "Component library for the Nulogy Design System - http://nulogy.design",
5
5
  "private": false,
6
6
  "publishConfig": {