@ilo-org/react 0.17.6 → 0.17.8
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/lib/cjs/components/Cards/CardGroup/CardGroup.js +4 -1
- package/lib/cjs/components/Cards/CardGroup/index.js +4 -1
- package/lib/cjs/components/Cards/MultilinkCard/MultiLinkCard.js +1 -0
- package/lib/cjs/components/Collapse/Collapse.js +15 -46
- package/lib/cjs/components/Input/Input.js +4 -4
- package/lib/cjs/components/Input/index.js +1 -1
- package/lib/cjs/components/Navigation/Navigation.js +8 -1
- package/lib/cjs/components/SearchField/SearchField.js +3 -3
- package/lib/esm/components/Cards/CardGroup/CardGroup.js +4 -1
- package/lib/esm/components/Cards/CardGroup/index.js +4 -1
- package/lib/esm/components/Cards/MultilinkCard/MultiLinkCard.js +1 -0
- package/lib/esm/components/Collapse/Collapse.js +15 -46
- package/lib/esm/components/Input/Input.js +4 -4
- package/lib/esm/components/Input/index.js +1 -1
- package/lib/esm/components/Navigation/Navigation.js +9 -2
- package/lib/esm/components/SearchField/SearchField.js +4 -4
- package/lib/styles/components/logogrid.css +1 -1
- package/lib/styles/components/multilinkcard.css +1 -1
- package/lib/styles/index.css +2 -2
- package/lib/styles/monorepo.css +2 -2
- package/lib/types/react/src/components/Input/Input.d.ts +2 -2
- package/lib/types/react/src/components/SearchField/SearchField.d.ts +1 -1
- package/package.json +21 -24
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var classNames = require('classnames');
|
|
5
5
|
var hooks_useGlobalSettings = require('../../../hooks/useGlobalSettings.js');
|
|
6
|
+
var components_Button_Button = require('../../Button/Button.js');
|
|
6
7
|
var components_Cards_DataCard_DataCard = require('../DataCard/DataCard.js');
|
|
7
8
|
var components_Cards_DetailCard_DetailCard = require('../DetailCard/DetailCard.js');
|
|
8
9
|
var components_Cards_FactlistCard_FactListCard = require('../FactlistCard/FactListCard.js');
|
|
@@ -15,6 +16,8 @@ require('tslib');
|
|
|
15
16
|
require('react');
|
|
16
17
|
require('../../../GlobalCtx-10114bdd.js');
|
|
17
18
|
require('../../Link/Link.js');
|
|
19
|
+
require('../../Icon/Icon.js');
|
|
20
|
+
require('@ilo-org/icons-react');
|
|
18
21
|
require('../../List/List.js');
|
|
19
22
|
require('../../List/ListItem.js');
|
|
20
23
|
require('../../LinkList/LinkList.js');
|
|
@@ -38,7 +41,7 @@ const CardGroup = ({ cards, titleLevel = "p", cardCount, cta, type, alignment, s
|
|
|
38
41
|
[`${baseClass}__collapsed`]: collapsed,
|
|
39
42
|
});
|
|
40
43
|
return (jsxRuntime.jsxs("div", Object.assign({ className: cardGroupClasses }, { children: [jsxRuntime.jsx("div", Object.assign({ className: `${baseClass}--inner` }, { children: cards &&
|
|
41
|
-
cards.map((card, index) => (jsxRuntime.jsx(Card, Object.assign({}, card, { size: size, theme: theme, alignment: alignment, titleLevel: titleLevel }), index))) })), cta && (jsxRuntime.jsx("div", Object.assign({ className: `${baseClass}--button-wrap` }, { children: jsxRuntime.jsx(
|
|
44
|
+
cards.map((card, index) => (jsxRuntime.jsx(Card, Object.assign({}, card, { size: size, theme: theme, alignment: alignment, titleLevel: titleLevel }), index))) })), cta && (jsxRuntime.jsx("div", Object.assign({ className: `${baseClass}--button-wrap` }, { children: jsxRuntime.jsx(components_Button_Button, { kind: "button", type: "secondary", size: "medium", label: cta.label, url: cta.url }) })))] })));
|
|
42
45
|
};
|
|
43
46
|
|
|
44
47
|
module.exports = CardGroup;
|
|
@@ -7,8 +7,11 @@ require('../../../hooks/useGlobalSettings.js');
|
|
|
7
7
|
require('tslib');
|
|
8
8
|
require('react');
|
|
9
9
|
require('../../../GlobalCtx-10114bdd.js');
|
|
10
|
-
require('
|
|
10
|
+
require('../../Button/Button.js');
|
|
11
11
|
require('../../Link/Link.js');
|
|
12
|
+
require('../../Icon/Icon.js');
|
|
13
|
+
require('@ilo-org/icons-react');
|
|
14
|
+
require('../DataCard/DataCard.js');
|
|
12
15
|
require('../DetailCard/DetailCard.js');
|
|
13
16
|
require('../FactlistCard/FactListCard.js');
|
|
14
17
|
require('../../List/List.js');
|
|
@@ -17,6 +17,7 @@ const MultilinkCard = ({ isvideo, eyebrow, title, size = "standard", alignment,
|
|
|
17
17
|
[`${baseClass}__size__${size}`]: size,
|
|
18
18
|
[`${baseClass}__isvideo`]: isvideo,
|
|
19
19
|
[`${baseClass}__linklist`]: linklist,
|
|
20
|
+
[`${baseClass}__no-image`]: !image,
|
|
20
21
|
});
|
|
21
22
|
return (jsxRuntime.jsxs("div", Object.assign({ className: cardClasses }, { children: [link && (jsxRuntime.jsx("a", Object.assign({ className: `${baseClass}--link`, href: link, title: title }, { children: jsxRuntime.jsx("span", Object.assign({ className: `${baseClass}--link--text` }, { children: title })) }))), jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--wrap` }, { children: [image && (jsxRuntime.jsx("div", Object.assign({ className: `${baseClass}--image--wrapper` }, { children: jsxRuntime.jsx("picture", { children: jsxRuntime.jsx("img", { className: `${baseClass}--picture`, src: image, alt: title }) }) }))), jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--content` }, { children: [eyebrow && jsxRuntime.jsx("p", Object.assign({ className: `${baseClass}--eyebrow` }, { children: eyebrow })), title && TitleElement ? (jsxRuntime.jsx(TitleElement, Object.assign({ className: `${baseClass}--title` }, { children: title }))) : (jsxRuntime.jsx("p", Object.assign({ className: `${baseClass}--title` }, { children: title }))), image && (jsxRuntime.jsx("div", Object.assign({ className: `${baseClass}--image--wrapper` }, { children: jsxRuntime.jsx("picture", { children: jsxRuntime.jsx("img", { className: `${baseClass}--picture`, src: image, alt: title }) }) }))), intro && jsxRuntime.jsx("p", Object.assign({ className: `${baseClass}--intro` }, { children: intro })), linklist && (jsxRuntime.jsx(components_LinkList_LinkList, { headline: linklist.headline, linkgroup: linklist.linkgroup }))] }))] }))] })));
|
|
22
23
|
};
|
|
@@ -383,16 +383,6 @@ function requireReactPropTypesSecret () {
|
|
|
383
383
|
return ReactPropTypesSecret_1;
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
-
var has;
|
|
387
|
-
var hasRequiredHas;
|
|
388
|
-
|
|
389
|
-
function requireHas () {
|
|
390
|
-
if (hasRequiredHas) return has;
|
|
391
|
-
hasRequiredHas = 1;
|
|
392
|
-
has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
393
|
-
return has;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
386
|
/**
|
|
397
387
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
398
388
|
*
|
|
@@ -412,7 +402,7 @@ function requireCheckPropTypes () {
|
|
|
412
402
|
if (process.env.NODE_ENV !== 'production') {
|
|
413
403
|
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
414
404
|
var loggedTypeFailures = {};
|
|
415
|
-
var has =
|
|
405
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
416
406
|
|
|
417
407
|
printWarning = function(text) {
|
|
418
408
|
var message = 'Warning: ' + text;
|
|
@@ -424,7 +414,7 @@ function requireCheckPropTypes () {
|
|
|
424
414
|
// This error was thrown as a convenience so that you can use this stack
|
|
425
415
|
// to find the callsite that caused this warning to fire.
|
|
426
416
|
throw new Error(message);
|
|
427
|
-
} catch (x) {
|
|
417
|
+
} catch (x) {}
|
|
428
418
|
};
|
|
429
419
|
}
|
|
430
420
|
|
|
@@ -453,8 +443,7 @@ function requireCheckPropTypes () {
|
|
|
453
443
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
454
444
|
var err = Error(
|
|
455
445
|
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
456
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
457
|
-
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
446
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
458
447
|
);
|
|
459
448
|
err.name = 'Invariant Violation';
|
|
460
449
|
throw err;
|
|
@@ -522,9 +511,9 @@ function requireFactoryWithTypeCheckers () {
|
|
|
522
511
|
var assign = requireObjectAssign();
|
|
523
512
|
|
|
524
513
|
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
525
|
-
var has = requireHas();
|
|
526
514
|
var checkPropTypes = requireCheckPropTypes();
|
|
527
515
|
|
|
516
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
528
517
|
var printWarning = function() {};
|
|
529
518
|
|
|
530
519
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -625,7 +614,6 @@ function requireFactoryWithTypeCheckers () {
|
|
|
625
614
|
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
626
615
|
var ReactPropTypes = {
|
|
627
616
|
array: createPrimitiveTypeChecker('array'),
|
|
628
|
-
bigint: createPrimitiveTypeChecker('bigint'),
|
|
629
617
|
bool: createPrimitiveTypeChecker('boolean'),
|
|
630
618
|
func: createPrimitiveTypeChecker('function'),
|
|
631
619
|
number: createPrimitiveTypeChecker('number'),
|
|
@@ -671,9 +659,8 @@ function requireFactoryWithTypeCheckers () {
|
|
|
671
659
|
* is prohibitively expensive if they are created too often, such as what
|
|
672
660
|
* happens in oneOfType() for any type before the one that matched.
|
|
673
661
|
*/
|
|
674
|
-
function PropTypeError(message
|
|
662
|
+
function PropTypeError(message) {
|
|
675
663
|
this.message = message;
|
|
676
|
-
this.data = data && typeof data === 'object' ? data: {};
|
|
677
664
|
this.stack = '';
|
|
678
665
|
}
|
|
679
666
|
// Make `instanceof Error` still work for returned errors.
|
|
@@ -708,7 +695,7 @@ function requireFactoryWithTypeCheckers () {
|
|
|
708
695
|
) {
|
|
709
696
|
printWarning(
|
|
710
697
|
'You are manually calling a React.PropTypes validation ' +
|
|
711
|
-
'function for the `' + propFullName + '` prop on `' + componentName
|
|
698
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
712
699
|
'and will throw in the standalone `prop-types` package. ' +
|
|
713
700
|
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
714
701
|
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
@@ -747,10 +734,7 @@ function requireFactoryWithTypeCheckers () {
|
|
|
747
734
|
// 'of type `object`'.
|
|
748
735
|
var preciseType = getPreciseType(propValue);
|
|
749
736
|
|
|
750
|
-
return new PropTypeError(
|
|
751
|
-
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
752
|
-
{expectedType: expectedType}
|
|
753
|
-
);
|
|
737
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
|
754
738
|
}
|
|
755
739
|
return null;
|
|
756
740
|
}
|
|
@@ -894,19 +878,14 @@ function requireFactoryWithTypeCheckers () {
|
|
|
894
878
|
}
|
|
895
879
|
|
|
896
880
|
function validate(props, propName, componentName, location, propFullName) {
|
|
897
|
-
var expectedTypes = [];
|
|
898
881
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
899
882
|
var checker = arrayOfTypeCheckers[i];
|
|
900
|
-
|
|
901
|
-
if (checkerResult == null) {
|
|
883
|
+
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
|
|
902
884
|
return null;
|
|
903
885
|
}
|
|
904
|
-
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
905
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
906
|
-
}
|
|
907
886
|
}
|
|
908
|
-
|
|
909
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '
|
|
887
|
+
|
|
888
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
|
910
889
|
}
|
|
911
890
|
return createChainableTypeChecker(validate);
|
|
912
891
|
}
|
|
@@ -921,13 +900,6 @@ function requireFactoryWithTypeCheckers () {
|
|
|
921
900
|
return createChainableTypeChecker(validate);
|
|
922
901
|
}
|
|
923
902
|
|
|
924
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
925
|
-
return new PropTypeError(
|
|
926
|
-
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
927
|
-
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
928
|
-
);
|
|
929
|
-
}
|
|
930
|
-
|
|
931
903
|
function createShapeTypeChecker(shapeTypes) {
|
|
932
904
|
function validate(props, propName, componentName, location, propFullName) {
|
|
933
905
|
var propValue = props[propName];
|
|
@@ -937,8 +909,8 @@ function requireFactoryWithTypeCheckers () {
|
|
|
937
909
|
}
|
|
938
910
|
for (var key in shapeTypes) {
|
|
939
911
|
var checker = shapeTypes[key];
|
|
940
|
-
if (
|
|
941
|
-
|
|
912
|
+
if (!checker) {
|
|
913
|
+
continue;
|
|
942
914
|
}
|
|
943
915
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
944
916
|
if (error) {
|
|
@@ -957,18 +929,16 @@ function requireFactoryWithTypeCheckers () {
|
|
|
957
929
|
if (propType !== 'object') {
|
|
958
930
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
959
931
|
}
|
|
960
|
-
// We need to check all keys in case some are required but missing from
|
|
932
|
+
// We need to check all keys in case some are required but missing from
|
|
933
|
+
// props.
|
|
961
934
|
var allKeys = assign({}, props[propName], shapeTypes);
|
|
962
935
|
for (var key in allKeys) {
|
|
963
936
|
var checker = shapeTypes[key];
|
|
964
|
-
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
965
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
966
|
-
}
|
|
967
937
|
if (!checker) {
|
|
968
938
|
return new PropTypeError(
|
|
969
939
|
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
970
940
|
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
971
|
-
'\nValid keys: ' +
|
|
941
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
972
942
|
);
|
|
973
943
|
}
|
|
974
944
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
@@ -1162,7 +1132,6 @@ function requireFactoryWithThrowingShims () {
|
|
|
1162
1132
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1163
1133
|
var ReactPropTypes = {
|
|
1164
1134
|
array: shim,
|
|
1165
|
-
bigint: shim,
|
|
1166
1135
|
bool: shim,
|
|
1167
1136
|
func: shim,
|
|
1168
1137
|
number: shim,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
4
5
|
var classNames = require('classnames');
|
|
5
6
|
var hooks_useGlobalSettings = require('../../hooks/useGlobalSettings.js');
|
|
6
7
|
var components_Fieldset_Fieldset = require('../Fieldset/Fieldset.js');
|
|
7
8
|
var components_FormElement_FormElement = require('../FormElement/FormElement.js');
|
|
8
9
|
require('tslib');
|
|
9
|
-
require('react');
|
|
10
10
|
require('../../GlobalCtx-10114bdd.js');
|
|
11
11
|
require('../Tooltip/Tooltip.js');
|
|
12
12
|
require('@popperjs/core');
|
|
13
13
|
|
|
14
|
-
const Input = ({ callback, disabled = false, error, helper, id, label, name, placeholder, required, tooltip, value, type = "text", }) => {
|
|
14
|
+
const Input = React.forwardRef(({ callback, disabled = false, error, helper, id, label, name, placeholder, required, tooltip, value, type = "text", }, ref) => {
|
|
15
15
|
const { prefix } = hooks_useGlobalSettings();
|
|
16
16
|
const baseClass = `${prefix}--input`;
|
|
17
17
|
const InputClasses = classNames("", {
|
|
@@ -26,7 +26,7 @@ const Input = ({ callback, disabled = false, error, helper, id, label, name, pla
|
|
|
26
26
|
callback(e);
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
return (jsxRuntime.jsx(components_Fieldset_Fieldset.default, { children: jsxRuntime.jsx(components_FormElement_FormElement, Object.assign({ elemid: name, label: label, helper: helper, error: error, required: required, tooltip: tooltip }, { children: jsxRuntime.jsx("input", { id: id ? id : name, name: name, onChange: handleChange, disabled: disabled, placeholder: placeholder, required: required, type: type, value: value, className: InputClasses }) })) }));
|
|
30
|
-
};
|
|
29
|
+
return (jsxRuntime.jsx(components_Fieldset_Fieldset.default, { children: jsxRuntime.jsx(components_FormElement_FormElement, Object.assign({ elemid: name, label: label, helper: helper, error: error, required: required, tooltip: tooltip }, { children: jsxRuntime.jsx("input", { id: id ? id : name, name: name, onChange: handleChange, disabled: disabled, placeholder: placeholder, required: required, type: type, value: value, className: InputClasses, ref: ref }) })) }));
|
|
30
|
+
});
|
|
31
31
|
|
|
32
32
|
module.exports = Input;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var components_Input_Input = require('./Input.js');
|
|
4
4
|
require('react/jsx-runtime');
|
|
5
|
+
require('react');
|
|
5
6
|
require('classnames');
|
|
6
7
|
require('../../hooks/useGlobalSettings.js');
|
|
7
8
|
require('tslib');
|
|
8
|
-
require('react');
|
|
9
9
|
require('../../GlobalCtx-10114bdd.js');
|
|
10
10
|
require('../Fieldset/Fieldset.js');
|
|
11
11
|
require('../Tooltip/Tooltip.js');
|
|
@@ -32,6 +32,12 @@ const Navigation = ({ logo, mobilelogo, siteurl, tagline, primarynav, subnav, me
|
|
|
32
32
|
[`${prefix}--select--open`]: toggleLanguageOpen,
|
|
33
33
|
[`${prefix}--context--open`]: toggleLanguageOpen,
|
|
34
34
|
});
|
|
35
|
+
const searchInputRef = React.useRef(null);
|
|
36
|
+
const handleSearchInputFocus = () => {
|
|
37
|
+
if (searchInputRef.current) {
|
|
38
|
+
searchInputRef.current.focus();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
35
41
|
const handleMenuToggle = () => {
|
|
36
42
|
setMenuToggleOpen(!toggleMenuOpen);
|
|
37
43
|
};
|
|
@@ -46,6 +52,7 @@ const Navigation = ({ logo, mobilelogo, siteurl, tagline, primarynav, subnav, me
|
|
|
46
52
|
}
|
|
47
53
|
setSearchTabbable(true);
|
|
48
54
|
setTimeout(() => setSearchToggleOpen(true), 10);
|
|
55
|
+
setTimeout(() => handleSearchInputFocus(), 50);
|
|
49
56
|
};
|
|
50
57
|
const handleSubnavToggle = () => {
|
|
51
58
|
if (toggleSubnavOpen) {
|
|
@@ -70,7 +77,7 @@ const Navigation = ({ logo, mobilelogo, siteurl, tagline, primarynav, subnav, me
|
|
|
70
77
|
return (jsxRuntime.jsxs("header", Object.assign({ className: NavigationClasses }, { children: [jsxRuntime.jsx("div", Object.assign({ className: `${baseClass}--utility-bar` }, { children: jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--language-switcher` }, { children: jsxRuntime.jsxs("div", Object.assign({ className: `${prefix}--language-switcher--wrap` }, { children: [jsxRuntime.jsx("button", Object.assign({ className: `${prefix}--language-switcher--button`, type: "button", onClick: handleLanguageToggle }, { children: languagelabel })), jsxRuntime.jsx(components_ContextMenu_ContextMenu, { links: languagecontextmenu === null || languagecontextmenu === void 0 ? void 0 : languagecontextmenu.links })] })) })) })), jsxRuntime.jsx("div", Object.assign({ className: `${baseClass}--logo-bar` }, { children: jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--inner ${prefix}--container` }, { children: [jsxRuntime.jsx("a", Object.assign({ href: siteurl, className: `${baseClass}--logo-link` }, { children: jsxRuntime.jsx("img", { className: `${baseClass}--logo`, src: logo, alt: "ILO Logo" }) })), jsxRuntime.jsxs("p", Object.assign({ className: `${baseClass}--logo-tagline` }, { children: [tagline === null || tagline === void 0 ? void 0 : tagline.tag, jsxRuntime.jsx("span", Object.assign({ className: `${baseClass}--logo-tagline--small` }, { children: tagline === null || tagline === void 0 ? void 0 : tagline.small }))] })), jsxRuntime.jsx("button", Object.assign({ className: `${baseClass}--menu`, onClick: handleMenuToggle }, { children: menulabel }))] })) })), jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--navigation` }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--inner ${prefix}--container` }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: `${prefix}--mobile--nav` }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: `${prefix}--mobile--nav--logo` }, { children: [jsxRuntime.jsx("a", Object.assign({ href: siteurl, className: `${baseClass}--logo-link` }, { children: jsxRuntime.jsx("img", { className: `${baseClass}--logo`, src: mobilelogo, alt: "ILO Logo" }) })), jsxRuntime.jsx("button", Object.assign({ className: `${baseClass}--menu--close`, onClick: handleMenuToggle }, { children: menucloselabel }))] })), jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--mobile--nav--search` }, { children: jsxRuntime.jsx(components_SearchField_SearchField, { input: searchfield === null || searchfield === void 0 ? void 0 : searchfield.input, action: searchfield === null || searchfield === void 0 ? void 0 : searchfield.action }) })), jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--mobile--nav--language--switcher` }, { children: jsxRuntime.jsx("button", Object.assign({ className: `${prefix}--mobile--nav--language--switcher--button`, onClick: handleLanguageToggle, type: "button" }, { children: languagelabel })) })), jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--mobile--nav--language--select` }, { children: jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--inner ${prefix}--container` }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: `${prefix}--mobile--subnav--menu` }, { children: [jsxRuntime.jsx("button", Object.assign({ className: `${prefix}--mobile--subnav--back`, onClick: handleLanguageToggle, type: "button" }, { children: subnav === null || subnav === void 0 ? void 0 : subnav.mobilebacklabel })), jsxRuntime.jsx("button", Object.assign({ className: `${baseClass}--menu--close`, onClick: handleMenuToggle }, { children: subnav === null || subnav === void 0 ? void 0 : subnav.mobilecloselabel })), jsxRuntime.jsx("h6", Object.assign({ className: `${prefix}--mobile--subnav--label` }, { children: languagelabel }))] })), jsxRuntime.jsx("ul", Object.assign({ className: `${prefix}--nav--set` }, { children: (languagecontextmenu === null || languagecontextmenu === void 0 ? void 0 : languagecontextmenu.links) &&
|
|
71
78
|
languagecontextmenu.links.map((item, index) => (jsxRuntime.jsx("li", Object.assign({ className: `${prefix}--nav--items` }, { children: jsxRuntime.jsx("a", Object.assign({ href: item.url, className: `${prefix}--nav--link ${prefix}--nav--language` }, { children: item.label })) }), index))) }))] })) }))] })), jsxRuntime.jsxs("nav", Object.assign({ className: `${prefix}--nav`, "aria-labelledby": "primary-navigation" }, { children: [jsxRuntime.jsx("h2", Object.assign({ className: `${prefix}--nav--label`, id: "primary-navigation" }, { children: primarynav === null || primarynav === void 0 ? void 0 : primarynav.navlabel })), jsxRuntime.jsxs("ul", Object.assign({ className: `${prefix}--nav--set` }, { children: [(primarynav === null || primarynav === void 0 ? void 0 : primarynav.items) &&
|
|
72
79
|
primarynav.items.map((item, index) => (jsxRuntime.jsx("li", Object.assign({ className: `${prefix}--nav--items` }, { children: jsxRuntime.jsx("a", Object.assign({ href: item.url, className: `${prefix}--nav--link` }, { children: item.label })) }), index))), subnav && (jsxRuntime.jsx("li", Object.assign({ className: `${prefix}--nav--items` }, { children: jsxRuntime.jsx("button", Object.assign({ className: `${prefix}--nav--trigger`, onClick: handleSubnavToggle }, { children: subnav.buttonlabel })) })))] }))] })), jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--search` }, { children: jsxRuntime.jsx("button", Object.assign({ className: `${prefix}--search--button`, type: "button", onClick: handleSearchToggle }, { children: searchlabel })) }))] })), subnav && (jsxRuntime.jsx("nav", Object.assign({ style: { display: subnavTabbable ? "block" : "none" }, className: `${prefix}--subnav`, "aria-labelledby": "secondary-navigation" }, { children: jsxRuntime.jsxs("div", Object.assign({ className: `${prefix}--subnav--inner ${prefix}--container` }, { children: [jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--mobile--subnav` }, { children: jsxRuntime.jsxs("div", Object.assign({ className: `${prefix}--mobile--subnav--menu` }, { children: [jsxRuntime.jsx("button", Object.assign({ className: `${prefix}--mobile--subnav--back`, onClick: handleSubnavToggle, type: "button" }, { children: subnav.mobilebacklabel })), jsxRuntime.jsx("button", Object.assign({ className: `${prefix}--header--menu--close`, onClick: handleMenuToggle }, { children: subnav.mobilecloselabel })), jsxRuntime.jsx("h6", Object.assign({ className: `${prefix}--mobile--subnav--label` }, { children: subnav.buttonlabel }))] })) })), jsxRuntime.jsx("h2", Object.assign({ className: `${prefix}--nav--label`, id: "secondary-navigation" }, { children: subnav.navlabel })), jsxRuntime.jsx("ul", Object.assign({ className: `${prefix}--subnav--set` }, { children: (subnav === null || subnav === void 0 ? void 0 : subnav.items) &&
|
|
73
|
-
subnav.items.map((item, index) => (jsxRuntime.jsx("li", Object.assign({ className: `${prefix}--subnav--items` }, { children: jsxRuntime.jsx("a", Object.assign({ href: item.url, className: `${prefix}--subnav--link` }, { children: item.label })) }), index))) }))] })) }))), jsxRuntime.jsx("div", Object.assign({ style: { display: searchTabbable ? "block" : "none" }, className: `${prefix}--search-box` }, { children: jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--header--inner ${prefix}--container` }, { children: jsxRuntime.jsx(components_SearchField_SearchField, { input: searchfield === null || searchfield === void 0 ? void 0 : searchfield.input, action: searchfield === null || searchfield === void 0 ? void 0 : searchfield.action }) })) }))] }))] })));
|
|
80
|
+
subnav.items.map((item, index) => (jsxRuntime.jsx("li", Object.assign({ className: `${prefix}--subnav--items` }, { children: jsxRuntime.jsx("a", Object.assign({ href: item.url, className: `${prefix}--subnav--link` }, { children: item.label })) }), index))) }))] })) }))), jsxRuntime.jsx("div", Object.assign({ style: { display: searchTabbable ? "block" : "none" }, className: `${prefix}--search-box` }, { children: jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--header--inner ${prefix}--container` }, { children: jsxRuntime.jsx(components_SearchField_SearchField, { input: searchfield === null || searchfield === void 0 ? void 0 : searchfield.input, action: searchfield === null || searchfield === void 0 ? void 0 : searchfield.action, ref: searchInputRef }) })) }))] }))] })));
|
|
74
81
|
};
|
|
75
82
|
|
|
76
83
|
module.exports = Navigation;
|
|
@@ -14,7 +14,7 @@ require('@popperjs/core');
|
|
|
14
14
|
require('../FormElement/FormElement.js');
|
|
15
15
|
require('@ilo-org/icons-react');
|
|
16
16
|
|
|
17
|
-
const SearchField = ({ action, callback, className, input,
|
|
17
|
+
const SearchField = React.forwardRef(({ action, callback, className, input }, ref) => {
|
|
18
18
|
const [searchValue, setSearchValue] = React.useState("");
|
|
19
19
|
const { prefix } = hooks_useGlobalSettings();
|
|
20
20
|
const baseClass = `${prefix}--searchfield`;
|
|
@@ -42,7 +42,7 @@ const SearchField = ({ action, callback, className, input, }) => {
|
|
|
42
42
|
if (!inputHasType) {
|
|
43
43
|
throw new Error("SearchField: Input must have type prop");
|
|
44
44
|
}
|
|
45
|
-
return inputHasType ? (jsxRuntime.jsxs("form", Object.assign({ className: SearchFieldClasses, action: action }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: fieldSetClass }, { children: [jsxRuntime.jsx(components_Input_Input, { id: input === null || input === void 0 ? void 0 : input.id, name: input === null || input === void 0 ? void 0 : input.name, disabled: input === null || input === void 0 ? void 0 : input.disabled, callback: onKeyPress, error: input === null || input === void 0 ? void 0 : input.error, helper: input === null || input === void 0 ? void 0 : input.helper, label: input === null || input === void 0 ? void 0 : input.label, placeholder: input === null || input === void 0 ? void 0 : input.placeholder, type: input === null || input === void 0 ? void 0 : input.type, value: searchValue, className: `${prefix}--input
|
|
46
|
-
};
|
|
45
|
+
return inputHasType ? (jsxRuntime.jsxs("form", Object.assign({ className: SearchFieldClasses, action: action }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: fieldSetClass }, { children: [jsxRuntime.jsx(components_Input_Input, { id: input === null || input === void 0 ? void 0 : input.id, name: input === null || input === void 0 ? void 0 : input.name, disabled: input === null || input === void 0 ? void 0 : input.disabled, callback: onKeyPress, error: input === null || input === void 0 ? void 0 : input.error, helper: input === null || input === void 0 ? void 0 : input.helper, label: input === null || input === void 0 ? void 0 : input.label, placeholder: input === null || input === void 0 ? void 0 : input.placeholder, type: input === null || input === void 0 ? void 0 : input.type, value: searchValue, className: `${prefix}--input`, ref: ref }), jsxRuntime.jsx("span", Object.assign({ onClick: handleClearButtonClick, className: clearButtonClass }, { children: jsxRuntime.jsx(components_Icon_Icon, { name: "close", hidden: true }) }))] })), jsxRuntime.jsx("input", { className: buttonClass, disabled: input === null || input === void 0 ? void 0 : input.disabled, type: "submit", onClick: handleClick })] }))) : null;
|
|
46
|
+
});
|
|
47
47
|
|
|
48
48
|
module.exports = SearchField;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import useGlobalSettings from '../../../hooks/useGlobalSettings.js';
|
|
4
|
+
import Button from '../../Button/Button.js';
|
|
4
5
|
import DataCard from '../DataCard/DataCard.js';
|
|
5
6
|
import DetailCard from '../DetailCard/DetailCard.js';
|
|
6
7
|
import FactlistCard from '../FactlistCard/FactListCard.js';
|
|
@@ -13,6 +14,8 @@ import 'tslib';
|
|
|
13
14
|
import 'react';
|
|
14
15
|
import '../../../GlobalCtx-7fb23cfa.js';
|
|
15
16
|
import '../../Link/Link.js';
|
|
17
|
+
import '../../Icon/Icon.js';
|
|
18
|
+
import '@ilo-org/icons-react';
|
|
16
19
|
import '../../List/List.js';
|
|
17
20
|
import '../../List/ListItem.js';
|
|
18
21
|
import '../../LinkList/LinkList.js';
|
|
@@ -36,7 +39,7 @@ const CardGroup = ({ cards, titleLevel = "p", cardCount, cta, type, alignment, s
|
|
|
36
39
|
[`${baseClass}__collapsed`]: collapsed,
|
|
37
40
|
});
|
|
38
41
|
return (jsxs("div", Object.assign({ className: cardGroupClasses }, { children: [jsx("div", Object.assign({ className: `${baseClass}--inner` }, { children: cards &&
|
|
39
|
-
cards.map((card, index) => (jsx(Card, Object.assign({}, card, { size: size, theme: theme, alignment: alignment, titleLevel: titleLevel }), index))) })), cta && (jsx("div", Object.assign({ className: `${baseClass}--button-wrap` }, { children: jsx(
|
|
42
|
+
cards.map((card, index) => (jsx(Card, Object.assign({}, card, { size: size, theme: theme, alignment: alignment, titleLevel: titleLevel }), index))) })), cta && (jsx("div", Object.assign({ className: `${baseClass}--button-wrap` }, { children: jsx(Button, { kind: "button", type: "secondary", size: "medium", label: cta.label, url: cta.url }) })))] })));
|
|
40
43
|
};
|
|
41
44
|
|
|
42
45
|
export { CardGroup as default };
|
|
@@ -5,8 +5,11 @@ import '../../../hooks/useGlobalSettings.js';
|
|
|
5
5
|
import 'tslib';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../../GlobalCtx-7fb23cfa.js';
|
|
8
|
-
import '
|
|
8
|
+
import '../../Button/Button.js';
|
|
9
9
|
import '../../Link/Link.js';
|
|
10
|
+
import '../../Icon/Icon.js';
|
|
11
|
+
import '@ilo-org/icons-react';
|
|
12
|
+
import '../DataCard/DataCard.js';
|
|
10
13
|
import '../DetailCard/DetailCard.js';
|
|
11
14
|
import '../FactlistCard/FactListCard.js';
|
|
12
15
|
import '../../List/List.js';
|
|
@@ -15,6 +15,7 @@ const MultilinkCard = ({ isvideo, eyebrow, title, size = "standard", alignment,
|
|
|
15
15
|
[`${baseClass}__size__${size}`]: size,
|
|
16
16
|
[`${baseClass}__isvideo`]: isvideo,
|
|
17
17
|
[`${baseClass}__linklist`]: linklist,
|
|
18
|
+
[`${baseClass}__no-image`]: !image,
|
|
18
19
|
});
|
|
19
20
|
return (jsxs("div", Object.assign({ className: cardClasses }, { children: [link && (jsx("a", Object.assign({ className: `${baseClass}--link`, href: link, title: title }, { children: jsx("span", Object.assign({ className: `${baseClass}--link--text` }, { children: title })) }))), jsxs("div", Object.assign({ className: `${baseClass}--wrap` }, { children: [image && (jsx("div", Object.assign({ className: `${baseClass}--image--wrapper` }, { children: jsx("picture", { children: jsx("img", { className: `${baseClass}--picture`, src: image, alt: title }) }) }))), jsxs("div", Object.assign({ className: `${baseClass}--content` }, { children: [eyebrow && jsx("p", Object.assign({ className: `${baseClass}--eyebrow` }, { children: eyebrow })), title && TitleElement ? (jsx(TitleElement, Object.assign({ className: `${baseClass}--title` }, { children: title }))) : (jsx("p", Object.assign({ className: `${baseClass}--title` }, { children: title }))), image && (jsx("div", Object.assign({ className: `${baseClass}--image--wrapper` }, { children: jsx("picture", { children: jsx("img", { className: `${baseClass}--picture`, src: image, alt: title }) }) }))), intro && jsx("p", Object.assign({ className: `${baseClass}--intro` }, { children: intro })), linklist && (jsx(LinkList, { headline: linklist.headline, linkgroup: linklist.linkgroup }))] }))] }))] })));
|
|
20
21
|
};
|
|
@@ -381,16 +381,6 @@ function requireReactPropTypesSecret () {
|
|
|
381
381
|
return ReactPropTypesSecret_1;
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
-
var has;
|
|
385
|
-
var hasRequiredHas;
|
|
386
|
-
|
|
387
|
-
function requireHas () {
|
|
388
|
-
if (hasRequiredHas) return has;
|
|
389
|
-
hasRequiredHas = 1;
|
|
390
|
-
has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
391
|
-
return has;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
384
|
/**
|
|
395
385
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
396
386
|
*
|
|
@@ -410,7 +400,7 @@ function requireCheckPropTypes () {
|
|
|
410
400
|
if (process.env.NODE_ENV !== 'production') {
|
|
411
401
|
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
412
402
|
var loggedTypeFailures = {};
|
|
413
|
-
var has =
|
|
403
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
414
404
|
|
|
415
405
|
printWarning = function(text) {
|
|
416
406
|
var message = 'Warning: ' + text;
|
|
@@ -422,7 +412,7 @@ function requireCheckPropTypes () {
|
|
|
422
412
|
// This error was thrown as a convenience so that you can use this stack
|
|
423
413
|
// to find the callsite that caused this warning to fire.
|
|
424
414
|
throw new Error(message);
|
|
425
|
-
} catch (x) {
|
|
415
|
+
} catch (x) {}
|
|
426
416
|
};
|
|
427
417
|
}
|
|
428
418
|
|
|
@@ -451,8 +441,7 @@ function requireCheckPropTypes () {
|
|
|
451
441
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
452
442
|
var err = Error(
|
|
453
443
|
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
454
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
455
|
-
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
444
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
456
445
|
);
|
|
457
446
|
err.name = 'Invariant Violation';
|
|
458
447
|
throw err;
|
|
@@ -520,9 +509,9 @@ function requireFactoryWithTypeCheckers () {
|
|
|
520
509
|
var assign = requireObjectAssign();
|
|
521
510
|
|
|
522
511
|
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
523
|
-
var has = requireHas();
|
|
524
512
|
var checkPropTypes = requireCheckPropTypes();
|
|
525
513
|
|
|
514
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
526
515
|
var printWarning = function() {};
|
|
527
516
|
|
|
528
517
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -623,7 +612,6 @@ function requireFactoryWithTypeCheckers () {
|
|
|
623
612
|
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
624
613
|
var ReactPropTypes = {
|
|
625
614
|
array: createPrimitiveTypeChecker('array'),
|
|
626
|
-
bigint: createPrimitiveTypeChecker('bigint'),
|
|
627
615
|
bool: createPrimitiveTypeChecker('boolean'),
|
|
628
616
|
func: createPrimitiveTypeChecker('function'),
|
|
629
617
|
number: createPrimitiveTypeChecker('number'),
|
|
@@ -669,9 +657,8 @@ function requireFactoryWithTypeCheckers () {
|
|
|
669
657
|
* is prohibitively expensive if they are created too often, such as what
|
|
670
658
|
* happens in oneOfType() for any type before the one that matched.
|
|
671
659
|
*/
|
|
672
|
-
function PropTypeError(message
|
|
660
|
+
function PropTypeError(message) {
|
|
673
661
|
this.message = message;
|
|
674
|
-
this.data = data && typeof data === 'object' ? data: {};
|
|
675
662
|
this.stack = '';
|
|
676
663
|
}
|
|
677
664
|
// Make `instanceof Error` still work for returned errors.
|
|
@@ -706,7 +693,7 @@ function requireFactoryWithTypeCheckers () {
|
|
|
706
693
|
) {
|
|
707
694
|
printWarning(
|
|
708
695
|
'You are manually calling a React.PropTypes validation ' +
|
|
709
|
-
'function for the `' + propFullName + '` prop on `' + componentName
|
|
696
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
710
697
|
'and will throw in the standalone `prop-types` package. ' +
|
|
711
698
|
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
712
699
|
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
@@ -745,10 +732,7 @@ function requireFactoryWithTypeCheckers () {
|
|
|
745
732
|
// 'of type `object`'.
|
|
746
733
|
var preciseType = getPreciseType(propValue);
|
|
747
734
|
|
|
748
|
-
return new PropTypeError(
|
|
749
|
-
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
750
|
-
{expectedType: expectedType}
|
|
751
|
-
);
|
|
735
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
|
752
736
|
}
|
|
753
737
|
return null;
|
|
754
738
|
}
|
|
@@ -892,19 +876,14 @@ function requireFactoryWithTypeCheckers () {
|
|
|
892
876
|
}
|
|
893
877
|
|
|
894
878
|
function validate(props, propName, componentName, location, propFullName) {
|
|
895
|
-
var expectedTypes = [];
|
|
896
879
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
897
880
|
var checker = arrayOfTypeCheckers[i];
|
|
898
|
-
|
|
899
|
-
if (checkerResult == null) {
|
|
881
|
+
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
|
|
900
882
|
return null;
|
|
901
883
|
}
|
|
902
|
-
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
903
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
904
|
-
}
|
|
905
884
|
}
|
|
906
|
-
|
|
907
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '
|
|
885
|
+
|
|
886
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
|
908
887
|
}
|
|
909
888
|
return createChainableTypeChecker(validate);
|
|
910
889
|
}
|
|
@@ -919,13 +898,6 @@ function requireFactoryWithTypeCheckers () {
|
|
|
919
898
|
return createChainableTypeChecker(validate);
|
|
920
899
|
}
|
|
921
900
|
|
|
922
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
923
|
-
return new PropTypeError(
|
|
924
|
-
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
925
|
-
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
926
|
-
);
|
|
927
|
-
}
|
|
928
|
-
|
|
929
901
|
function createShapeTypeChecker(shapeTypes) {
|
|
930
902
|
function validate(props, propName, componentName, location, propFullName) {
|
|
931
903
|
var propValue = props[propName];
|
|
@@ -935,8 +907,8 @@ function requireFactoryWithTypeCheckers () {
|
|
|
935
907
|
}
|
|
936
908
|
for (var key in shapeTypes) {
|
|
937
909
|
var checker = shapeTypes[key];
|
|
938
|
-
if (
|
|
939
|
-
|
|
910
|
+
if (!checker) {
|
|
911
|
+
continue;
|
|
940
912
|
}
|
|
941
913
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
942
914
|
if (error) {
|
|
@@ -955,18 +927,16 @@ function requireFactoryWithTypeCheckers () {
|
|
|
955
927
|
if (propType !== 'object') {
|
|
956
928
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
957
929
|
}
|
|
958
|
-
// We need to check all keys in case some are required but missing from
|
|
930
|
+
// We need to check all keys in case some are required but missing from
|
|
931
|
+
// props.
|
|
959
932
|
var allKeys = assign({}, props[propName], shapeTypes);
|
|
960
933
|
for (var key in allKeys) {
|
|
961
934
|
var checker = shapeTypes[key];
|
|
962
|
-
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
963
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
964
|
-
}
|
|
965
935
|
if (!checker) {
|
|
966
936
|
return new PropTypeError(
|
|
967
937
|
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
968
938
|
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
969
|
-
'\nValid keys: ' +
|
|
939
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
970
940
|
);
|
|
971
941
|
}
|
|
972
942
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
@@ -1160,7 +1130,6 @@ function requireFactoryWithThrowingShims () {
|
|
|
1160
1130
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1161
1131
|
var ReactPropTypes = {
|
|
1162
1132
|
array: shim,
|
|
1163
|
-
bigint: shim,
|
|
1164
1133
|
bool: shim,
|
|
1165
1134
|
func: shim,
|
|
1166
1135
|
number: shim,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import useGlobalSettings from '../../hooks/useGlobalSettings.js';
|
|
4
5
|
import Fieldset from '../Fieldset/Fieldset.js';
|
|
5
6
|
import FormElement from '../FormElement/FormElement.js';
|
|
6
7
|
import 'tslib';
|
|
7
|
-
import 'react';
|
|
8
8
|
import '../../GlobalCtx-7fb23cfa.js';
|
|
9
9
|
import '../Tooltip/Tooltip.js';
|
|
10
10
|
import '@popperjs/core';
|
|
11
11
|
|
|
12
|
-
const Input = ({ callback, disabled = false, error, helper, id, label, name, placeholder, required, tooltip, value, type = "text", }) => {
|
|
12
|
+
const Input = forwardRef(({ callback, disabled = false, error, helper, id, label, name, placeholder, required, tooltip, value, type = "text", }, ref) => {
|
|
13
13
|
const { prefix } = useGlobalSettings();
|
|
14
14
|
const baseClass = `${prefix}--input`;
|
|
15
15
|
const InputClasses = classNames("", {
|
|
@@ -24,7 +24,7 @@ const Input = ({ callback, disabled = false, error, helper, id, label, name, pla
|
|
|
24
24
|
callback(e);
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
return (jsx(Fieldset, { children: jsx(FormElement, Object.assign({ elemid: name, label: label, helper: helper, error: error, required: required, tooltip: tooltip }, { children: jsx("input", { id: id ? id : name, name: name, onChange: handleChange, disabled: disabled, placeholder: placeholder, required: required, type: type, value: value, className: InputClasses }) })) }));
|
|
28
|
-
};
|
|
27
|
+
return (jsx(Fieldset, { children: jsx(FormElement, Object.assign({ elemid: name, label: label, helper: helper, error: error, required: required, tooltip: tooltip }, { children: jsx("input", { id: id ? id : name, name: name, onChange: handleChange, disabled: disabled, placeholder: placeholder, required: required, type: type, value: value, className: InputClasses, ref: ref }) })) }));
|
|
28
|
+
});
|
|
29
29
|
|
|
30
30
|
export { Input as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { default as Input } from './Input.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
|
+
import 'react';
|
|
3
4
|
import 'classnames';
|
|
4
5
|
import '../../hooks/useGlobalSettings.js';
|
|
5
6
|
import 'tslib';
|
|
6
|
-
import 'react';
|
|
7
7
|
import '../../GlobalCtx-7fb23cfa.js';
|
|
8
8
|
import '../Fieldset/Fieldset.js';
|
|
9
9
|
import '../Tooltip/Tooltip.js';
|