@bigbinary/neetoui 8.0.0 → 8.1.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/DatePicker.js +10 -2
- package/dist/DatePicker.js.map +1 -1
- package/dist/Slider.js +12 -0
- package/dist/Slider.js.map +1 -1
- package/dist/Table.js +12 -1
- package/dist/Table.js.map +1 -1
- package/dist/TimePicker.js +9 -1
- package/dist/TimePicker.js.map +1 -1
- package/dist/Tree.js +12 -0
- package/dist/Tree.js.map +1 -1
- package/dist/TreeSelect.js +9 -0
- package/dist/TreeSelect.js.map +1 -1
- package/dist/cjs/DatePicker.js +10 -2
- package/dist/cjs/DatePicker.js.map +1 -1
- package/dist/cjs/Slider.js +12 -0
- package/dist/cjs/Slider.js.map +1 -1
- package/dist/cjs/Table.js +12 -1
- package/dist/cjs/Table.js.map +1 -1
- package/dist/cjs/TimePicker.js +9 -1
- package/dist/cjs/TimePicker.js.map +1 -1
- package/dist/cjs/Tree.js +12 -0
- package/dist/cjs/Tree.js.map +1 -1
- package/dist/cjs/TreeSelect.js +9 -0
- package/dist/cjs/TreeSelect.js.map +1 -1
- package/dist/cjs/constants.js +34 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/formik/Checkbox.js +14 -11
- package/dist/cjs/formik/Checkbox.js.map +1 -1
- package/dist/cjs/formik/Input.js +14 -11
- package/dist/cjs/formik/Input.js.map +1 -1
- package/dist/cjs/formik/MultiEmailInput.js +8 -3
- package/dist/cjs/formik/MultiEmailInput.js.map +1 -1
- package/dist/cjs/formik/Radio.js +12 -6
- package/dist/cjs/formik/Radio.js.map +1 -1
- package/dist/cjs/formik/Select.js +9 -4
- package/dist/cjs/formik/Select.js.map +1 -1
- package/dist/cjs/formik/Slider.js +17 -3
- package/dist/cjs/formik/Slider.js.map +1 -1
- package/dist/cjs/formik/Switch.js +15 -5
- package/dist/cjs/formik/Switch.js.map +1 -1
- package/dist/cjs/formik/Textarea.js +14 -11
- package/dist/cjs/formik/Textarea.js.map +1 -1
- package/dist/cjs/formik/TreeSelect.js +16 -3
- package/dist/cjs/formik/TreeSelect.js.map +1 -1
- package/dist/cjs/formik/index.js +8 -0
- package/dist/cjs/formik/index.js.map +1 -1
- package/dist/cjs/{index-e17b2a64.js → index-34eccc77.js} +13 -1
- package/dist/cjs/index-34eccc77.js.map +1 -0
- package/dist/cjs/index.js +9 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/constants.js +20 -0
- package/dist/constants.js.map +1 -0
- package/dist/formik/Checkbox.js +15 -12
- package/dist/formik/Checkbox.js.map +1 -1
- package/dist/formik/Input.js +15 -12
- package/dist/formik/Input.js.map +1 -1
- package/dist/formik/MultiEmailInput.js +9 -4
- package/dist/formik/MultiEmailInput.js.map +1 -1
- package/dist/formik/Radio.js +13 -7
- package/dist/formik/Radio.js.map +1 -1
- package/dist/formik/Select.js +11 -6
- package/dist/formik/Select.js.map +1 -1
- package/dist/formik/Slider.js +18 -4
- package/dist/formik/Slider.js.map +1 -1
- package/dist/formik/Switch.js +16 -6
- package/dist/formik/Switch.js.map +1 -1
- package/dist/formik/Textarea.js +15 -12
- package/dist/formik/Textarea.js.map +1 -1
- package/dist/formik/TreeSelect.js +17 -4
- package/dist/formik/TreeSelect.js.map +1 -1
- package/dist/formik/index.js +8 -0
- package/dist/formik/index.js.map +1 -1
- package/dist/{index-7862413e.js → index-23406db4.js} +13 -1
- package/dist/index-23406db4.js.map +1 -0
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/index-e17b2a64.js.map +0 -1
- package/dist/index-7862413e.js.map +0 -1
package/dist/cjs/TimePicker.js
CHANGED
|
@@ -25,7 +25,7 @@ require('react-colorful');
|
|
|
25
25
|
require('./tinycolor-b1e9a7b2.js');
|
|
26
26
|
require('./Dropdown.js');
|
|
27
27
|
require('./index-7a8fe498.js');
|
|
28
|
-
var DatePicker = require('./index-
|
|
28
|
+
var DatePicker = require('./index-34eccc77.js');
|
|
29
29
|
require('./Input.js');
|
|
30
30
|
require('./Label.js');
|
|
31
31
|
require('./MultiEmailInput.js');
|
|
@@ -57,6 +57,7 @@ require('react-dom');
|
|
|
57
57
|
require('@babel/runtime/helpers/esm/defineProperty');
|
|
58
58
|
require('@babel/runtime/helpers/esm/toConsumableArray');
|
|
59
59
|
require('antd/lib/slider');
|
|
60
|
+
require('./constants.js');
|
|
60
61
|
require('./Switch.js');
|
|
61
62
|
require('./Tab.js');
|
|
62
63
|
require('antd/lib/table');
|
|
@@ -81,6 +82,13 @@ require('@babel/runtime/helpers/esm/inheritsLoose');
|
|
|
81
82
|
require('./index-63580e68.js');
|
|
82
83
|
require('@babel/runtime/helpers/esm/assertThisInitialized');
|
|
83
84
|
require('antd/lib/date-picker');
|
|
85
|
+
require('antd/locale/de_DE');
|
|
86
|
+
require('antd/locale/en_US');
|
|
87
|
+
require('antd/locale/es_ES');
|
|
88
|
+
require('antd/locale/fr_FR');
|
|
89
|
+
require('antd/locale/nl_NL');
|
|
90
|
+
require('antd/locale/pl_PL');
|
|
91
|
+
require('antd/locale/pt_PT');
|
|
84
92
|
require('@babel/runtime/helpers/toArray');
|
|
85
93
|
require('@babel/runtime/helpers/esm/classCallCheck');
|
|
86
94
|
require('@babel/runtime/helpers/esm/createClass');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimePicker.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimePicker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/cjs/Tree.js
CHANGED
|
@@ -6,8 +6,17 @@ var _extends = require('@babel/runtime/helpers/extends');
|
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var classnames = require('classnames');
|
|
9
|
+
var reactI18next = require('react-i18next');
|
|
10
|
+
var constants = require('./constants.js');
|
|
9
11
|
var index = require('./index-7a8fe498.js');
|
|
10
12
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
13
|
+
require('antd/locale/de_DE');
|
|
14
|
+
require('antd/locale/en_US');
|
|
15
|
+
require('antd/locale/es_ES');
|
|
16
|
+
require('antd/locale/fr_FR');
|
|
17
|
+
require('antd/locale/nl_NL');
|
|
18
|
+
require('antd/locale/pl_PL');
|
|
19
|
+
require('antd/locale/pt_PT');
|
|
11
20
|
require('@babel/runtime/helpers/slicedToArray');
|
|
12
21
|
require('@babel/runtime/helpers/classCallCheck');
|
|
13
22
|
require('@babel/runtime/helpers/createClass');
|
|
@@ -42,7 +51,10 @@ var SwitcherIcon = function SwitcherIcon(_ref) {
|
|
|
42
51
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
43
52
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
44
53
|
var Tree = function Tree(props) {
|
|
54
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
55
|
+
i18n = _useTranslation.i18n;
|
|
45
56
|
return /*#__PURE__*/React__default["default"].createElement(_ConfigProvider__default["default"], {
|
|
57
|
+
locale: constants.ANTD_LOCALE[i18n.language || "en"],
|
|
46
58
|
theme: {
|
|
47
59
|
token: _objectSpread({}, index.ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES),
|
|
48
60
|
components: {
|
package/dist/cjs/Tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.js","sources":["../../src/components/Tree/SwitcherIcon.jsx","../../src/components/Tree/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { Down, Right } from \"neetoicons\";\n\nconst SwitcherIcon = ({ expanded }) =>\n expanded ? <Down size={16} /> : <Right size={16} />;\n\nexport default SwitcherIcon;\n","import React from \"react\";\n\nimport { ConfigProvider, Tree as TreeComponent } from \"antd\";\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES } from \"utils\";\n\nimport SwitcherIcon from \"./SwitcherIcon\";\n\nconst Tree = props => (\n <ConfigProvider\n
|
|
1
|
+
{"version":3,"file":"Tree.js","sources":["../../src/components/Tree/SwitcherIcon.jsx","../../src/components/Tree/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { Down, Right } from \"neetoicons\";\n\nconst SwitcherIcon = ({ expanded }) =>\n expanded ? <Down size={16} /> : <Right size={16} />;\n\nexport default SwitcherIcon;\n","import React from \"react\";\n\nimport { ConfigProvider, Tree as TreeComponent } from \"antd\";\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ANTD_LOCALE } from \"components/constants\";\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES } from \"utils\";\n\nimport SwitcherIcon from \"./SwitcherIcon\";\n\nconst Tree = props => {\n const { i18n } = useTranslation();\n\n return (\n <ConfigProvider\n locale={ANTD_LOCALE[i18n.language || \"en\"]}\n theme={{\n token: { ...ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES },\n components: {\n Tree: {\n directoryNodeSelectedBg: \"rgb(var(--neeto-ui-primary-500))\",\n directoryNodeSelectedColor: \"rgb(var(--neeto-ui-white))\",\n nodeHoverBg: \"rgb(var(--neeto-ui-gray-100))\",\n nodeSelectedBg: \"rgb(var(--neeto-ui-primary-100))\",\n },\n },\n }}\n >\n <TreeComponent\n switcherIcon={SwitcherIcon}\n {...props}\n className={classnames(\"neeto-ui-tree\", props.className)}\n />\n </ConfigProvider>\n );\n};\n\nTree.propTypes = {\n /**\n * Whether to allow dropping on the node\n */\n allowDrop: PropTypes.bool,\n /**\n * Whether to automatically expand a parent treeNode\n */\n autoExpandParent: PropTypes.bool,\n /**\n * Whether treeNode fill remaining horizontal space\n */\n blockNode: PropTypes.bool,\n /**\n * Add a Checkbox before the treeNodes.\n */\n checkable: PropTypes.bool,\n /**\n * Specifies the keys of the checked treeNodes\n */\n checkedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Check treeNode precisely; parent treeNode and children treeNodes are not associated\n */\n checkStrictly: PropTypes.bool,\n /**\n * Specifies the keys of the default checked treeNodes.\n */\n defaultCheckedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Specify the keys of the default expanded treeNodes.\n */\n defaultExpandedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Specifies the keys of the default selected treeNodes.\n */\n defaultSelectedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Callback function for when the onCheck event occurs.\n */\n onCheck: PropTypes.func,\n /**\n * Whether disabled the tree\n */\n disabled: PropTypes.bool,\n /**\n * The treeNodes data Array, if set it then you need not to construct children TreeNode. (key should be unique across the whole array).\n */\n treeData: PropTypes.array,\n /**\n * Callback function for when the user clicks a treeNode.\n */\n onSelect: PropTypes.func,\n /**\n * Shows a connecting line.\n */\n showLine: PropTypes.bool,\n /**\n * Config virtual scroll height. Will not support horizontal scroll when enable this.\n */\n height: PropTypes.number,\n /**\n * Specifies whether this Tree or the node is draggable.\n */\n draggable: PropTypes.bool,\n /**\n * Callback function for when the onDragEnter event occurs\n */\n onDragEnter: PropTypes.func,\n /**\n * Callback function for when the onDragStart event occurs\n */\n onDragStart: PropTypes.func,\n /**\n * Callback function for when the onDragEnter event occurs\n */\n onDragEnd: PropTypes.func,\n /**\n * Callback function for when the onDragLeave event occurs\n */\n onDragLeave: PropTypes.func,\n /**\n * Callback function for when the onDragOver event occurs\n */\n onDragOver: PropTypes.func,\n /**\n * Callback function for when the onDrop event occurs\n */\n onDrop: PropTypes.func,\n /**\n * Defines a function to filter (highlight) treeNodes. When the function returns true, the corresponding treeNode will be highlighted\n */\n filterTreeNode: PropTypes.func,\n /**\n * Load data asynchronously\n */\n loadData: PropTypes.func,\n /**\n * Set loaded tree nodes. Need work with loadData\n */\n loadedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Whether can be selected\n */\n selectable: PropTypes.bool,\n /**\n * Specifies the keys of the selected treeNodes, multiple selection needs to set multiple to true\n */\n selectedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Allows selecting multiple treeNodes\n */\n multiple: PropTypes.bool,\n /**\n * Customize tree node title render\n */\n titleRender: PropTypes.func,\n /**\n * Disable virtual scroll when set to false\n */\n virtual: PropTypes.bool,\n /**\n * Callback function for when a treeNode is expanded or collapsed\n */\n onExpand: PropTypes.func,\n /**\n * Callback function for when a treeNode is loaded\n */\n onLoad: PropTypes.func,\n /**\n * Customize collapse/expand icon of tree node\n */\n switcherIcon: PropTypes.node,\n};\n\nexport default Tree;\n"],"names":["SwitcherIcon","_ref","expanded","React","createElement","Down","size","Right","Tree","props","_useTranslation","useTranslation","i18n","_ConfigProvider","locale","ANTD_LOCALE","language","theme","token","_objectSpread","ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES","components","directoryNodeSelectedBg","directoryNodeSelectedColor","nodeHoverBg","nodeSelectedBg","_Tree","_extends","switcherIcon","className","classnames"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IA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inary/neeto-icons');
|
|
11
11
|
var reactI18next = require('react-i18next');
|
|
12
12
|
var index = require('./index-7a8fe498.js');
|
|
13
|
+
var constants = require('./constants.js');
|
|
13
14
|
var Label = require('./Label.js');
|
|
14
15
|
require('@babel/runtime/helpers/slicedToArray');
|
|
15
16
|
require('@babel/runtime/helpers/classCallCheck');
|
|
@@ -23,6 +24,13 @@ require('@bigbinary/neeto-cist');
|
|
|
23
24
|
require('qs');
|
|
24
25
|
require('ramda');
|
|
25
26
|
require('./en-c1fe180c.js');
|
|
27
|
+
require('antd/locale/de_DE');
|
|
28
|
+
require('antd/locale/en_US');
|
|
29
|
+
require('antd/locale/es_ES');
|
|
30
|
+
require('antd/locale/fr_FR');
|
|
31
|
+
require('antd/locale/nl_NL');
|
|
32
|
+
require('antd/locale/pl_PL');
|
|
33
|
+
require('antd/locale/pt_PT');
|
|
26
34
|
require('./Button.js');
|
|
27
35
|
require('react-router-dom');
|
|
28
36
|
require('framer-motion');
|
|
@@ -77,6 +85,7 @@ var TreeSelect = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
77
85
|
var SuffixIcon = suffixIcon !== null && suffixIcon !== void 0 ? suffixIcon : neetoIcons.Down;
|
|
78
86
|
var SwitcherIcon = switcherIcon !== null && switcherIcon !== void 0 ? switcherIcon : neetoIcons.Down;
|
|
79
87
|
return /*#__PURE__*/React__default["default"].createElement(_ConfigProvider__default["default"], {
|
|
88
|
+
locale: constants.ANTD_LOCALE[i18n.language || "en"],
|
|
80
89
|
theme: {
|
|
81
90
|
token: _objectSpread({}, index.ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES),
|
|
82
91
|
components: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeSelect.js","sources":["../../src/components/TreeSelect.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { TreeSelect as AntdTreeSelect, ConfigProvider } from \"antd\";\nimport classnames from \"classnames\";\nimport { Down } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES, getLocale } from \"utils\";\n\nimport Label from \"./Label\";\n\nconst TreeSelect = forwardRef(\n (\n {\n allowClear,\n className,\n disabled = false,\n error,\n fieldNames,\n label = \"\",\n onChange,\n placeholder = \"\",\n required = false,\n showSearch = false,\n size = \"middle\",\n suffixIcon,\n switcherIcon,\n treeData,\n treeDataSimpleMode = true,\n value,\n ...otherProps\n },\n ref\n ) => {\n const { t, i18n } = useTranslation();\n const SuffixIcon = suffixIcon ?? Down;\n\n const SwitcherIcon = switcherIcon ?? Down;\n\n return (\n <ConfigProvider\n theme={{\n token: { ...ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES },\n components: {\n TreeSelect: {\n nodeHoverBg: \"rgb(var(--neeto-ui-gray-100))\",\n nodeSelectedBg: \"rgb(var(--neeto-ui-primary-500))\",\n\n // Global overrides\n colorBgElevated: \"rgb(var(--neeto-ui-white))\",\n },\n },\n }}\n >\n <div className=\"neeto-ui-input__wrapper\">\n {label && (\n <Label {...{ required }} data-testid=\"treeselect-label\">\n {label}\n </Label>\n )}\n <AntdTreeSelect\n {...{\n allowClear,\n disabled,\n fieldNames,\n onChange,\n placeholder,\n ref,\n showSearch,\n size,\n treeData,\n treeDataSimpleMode,\n }}\n data-cy=\"neeto-ui-tree-select-wrapper\"\n dropdownStyle={{ zIndex: 100000 }}\n popupClassName=\"neeto-ui-tree-select-dropdown\"\n suffixIcon={<SuffixIcon />}\n treeNodeFilterProp={fieldNames?.label ?? \"label\"}\n value={value || undefined}\n className={classnames(\"neeto-ui-tree-select__wrapper\", className, {\n \"neeto-ui-tree-select__error\": error,\n })}\n notFoundContent={\n // eslint-disable-next-line @bigbinary/neeto/hard-coded-strings-should-be-localized\n <div className=\"neeto-ui-text-center neeto-ui-p-1\">\n {getLocale(i18n, t, \"neetoui.treeSelect.noOptions\")}\n </div>\n }\n switcherIcon={props => (\n <div {...props}>\n <SwitcherIcon />\n </div>\n )}\n {...otherProps}\n />\n {error && (\n <p className=\"neeto-ui-input__error\" data-testid=\"treeselect-error\">\n {error}\n </p>\n )}\n </div>\n </ConfigProvider>\n );\n }\n);\n\nTreeSelect.displayName = \"TreeSelect\";\n\nTreeSelect.propTypes = {\n /**\n * Controls whether the value is allowed to be cleared or not.\n */\n allowClear: PropTypes.bool,\n /**\n * To specify additional classes.\n */\n className: PropTypes.string,\n /**\n * To disable the TreeSelect component.\n */\n disabled: PropTypes.bool,\n /**\n * To display the specified error.\n */\n error: PropTypes.string,\n /**\n * This prop can be used to override the default keys of label and value pairs in options.\n */\n fieldNames: PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n }),\n /**\n * To display a label above the TreeSelect component.\n */\n label: PropTypes.string,\n /**\n * The callback function that will be triggered when value changes.\n */\n onChange: PropTypes.func,\n /**\n * Callback function to be executed when search input changes that can be\n * used for advanced usecases. This is not necessary as basic search works\n * when `showSearch` is enabled.\n */\n onSearch: PropTypes.func,\n /**\n * The placeholder string to be displayed.\n */\n placeholder: PropTypes.string,\n /**\n * To specify whether TreeSelect field is required or not.\n */\n required: PropTypes.bool,\n /**\n * The search value to make search controlled. This is not required as basic search\n * works when `showSearch` is enabled.\n */\n searchValue: PropTypes.string,\n /**\n * To enable search for the TreeSelect component.\n */\n showSearch: PropTypes.bool,\n /**\n * To specify the size of the TreeSelect component.\n */\n size: PropTypes.oneOf([\"small\", \"middle\", \"large\"]),\n /**\n * To specify the icon at the end of the TreeSelect component.\n */\n suffixIcon: PropTypes.node,\n /**\n * To specify the icon next to options that have children.\n */\n switcherIcon: PropTypes.node,\n /**\n * The options to be passed to the TreeSelect component.\n */\n treeData: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n disabled: PropTypes.bool,\n children: PropTypes.array,\n })\n ),\n PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n label: PropTypes.string,\n value: PropTypes.string,\n disabled: PropTypes.bool,\n pId: PropTypes.string,\n })\n ),\n ]),\n /**\n * This prop specifies the format of data that has to be passed in the `treeData` prop.\n * When enabled, treeData can be a flat array of the form `{ id, label, value, pId }`.\n */\n treeDataSimpleMode: PropTypes.bool,\n /**\n * The currently selected option.\n */\n value: PropTypes.string,\n};\n\nexport default TreeSelect;\n"],"names":["TreeSelect","forwardRef","_ref","ref","_fieldNames$label","allowClear","className","_ref$disabled","disabled","error","fieldNames","_ref$label","label","onChange","_ref$placeholder","placeholder","_ref$required","required","_ref$showSearch","showSearch","_ref$size","size","suffixIcon","switcherIcon","treeData","_ref$treeDataSimpleMo","treeDataSimpleMode","value","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","i18n","SuffixIcon","Down","SwitcherIcon","React","createElement","_ConfigProvider","theme","token","_objectSpread","ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES","components","nodeHoverBg","nodeSelectedBg","colorBgElevated","Label","_TreeSelect","_extends","dropdownStyle","zIndex","popupClassName","treeNodeFilterProp","undefined","classnames","notFoundContent","getLocale","props","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYMA,IAAAA,UAAU,gBAAGC,gBAAU,CAC3B,UAAAC,IAAA,EAoBEC,GAAG,EACA;AAAA,EAAA,IAAAC,iBAAA,CAAA;AAAA,EAAA,IAnBDC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IAAAC,aAAA,GAAAL,IAAA,CACTM,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;IAChBE,KAAK,GAAAP,IAAA,CAALO,KAAK;IACLC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IAAAC,UAAA,GAAAT,IAAA,CACVU,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KA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UAAU,EAAI,IAAA,CAAA;AAC3BoB,IAAAA,kBAAkB,EAAAnD,CAAAA,iBAAA,GAAEM,UAAU,aAAVA,UAAU,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAVA,UAAU,CAAEE,KAAK,MAAAR,IAAAA,IAAAA,iBAAA,KAAAA,KAAAA,CAAAA,GAAAA,iBAAA,GAAI,OAAQ;IACjDuB,KAAK,EAAEA,KAAK,IAAI6B,SAAU;AAC1BlD,IAAAA,SAAS,EAAEmD,8BAAU,CAAC,+BAA+B,EAAEnD,SAAS,EAAE;AAChE,MAAA,6BAA6B,EAAEG,KAAAA;AACjC,KAAC,CAAE;IACHiD,eAAe;AAAA;AACb;AACApB,IAAAA,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKjC,MAAAA,SAAS,EAAC,mCAAA;KACZqD,EAAAA,eAAS,CAACzB,IAAI,EAAED,CAAC,EAAE,8BAA8B,CAAC,CAEtD;IACDV,YAAY,EAAE,SAAAA,YAAAA,CAAAqC,KAAK,EAAA;AAAA,MAAA,oBACjBtB,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAASqB,KAAK,eACZtB,yBAAA,CAAAC,aAAA,CAACF,YAAY,EAAA,IAAA,CAAG,CACZ,CAAA;AAAA,KAAA;AACN,GAAA,EACET,UAAU,CACd,CAAA,EACDnB,KAAK,iBACJ6B,yBAAA,CAAAC,aAAA,CAAA,GAAA,EAAA;AAAGjC,IAAAA,SAAS,EAAC,uBAAuB;IAAC,aAAY,EAAA,kBAAA;GAC9CG,EAAAA,KAAK,CAET,CACG,CACS,CAAA;AAErB,CAAC,EACF;AAEDT,UAAU,CAAC6D,WAAW,GAAG,YAAY;;;;"}
|
|
1
|
+
{"version":3,"file":"TreeSelect.js","sources":["../../src/components/TreeSelect.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { TreeSelect as AntdTreeSelect, ConfigProvider } from \"antd\";\nimport classnames from \"classnames\";\nimport { Down } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES, getLocale } from \"utils\";\n\nimport { ANTD_LOCALE } from \"./constants\";\nimport Label from \"./Label\";\n\nconst TreeSelect = forwardRef(\n (\n {\n allowClear,\n className,\n disabled = false,\n error,\n fieldNames,\n label = \"\",\n onChange,\n placeholder = \"\",\n required = false,\n showSearch = false,\n size = \"middle\",\n suffixIcon,\n switcherIcon,\n treeData,\n treeDataSimpleMode = true,\n value,\n ...otherProps\n },\n ref\n ) => {\n const { t, i18n } = useTranslation();\n const SuffixIcon = suffixIcon ?? Down;\n\n const SwitcherIcon = switcherIcon ?? Down;\n\n return (\n <ConfigProvider\n locale={ANTD_LOCALE[i18n.language || \"en\"]}\n theme={{\n token: { ...ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES },\n components: {\n TreeSelect: {\n nodeHoverBg: \"rgb(var(--neeto-ui-gray-100))\",\n nodeSelectedBg: \"rgb(var(--neeto-ui-primary-500))\",\n\n // Global overrides\n colorBgElevated: \"rgb(var(--neeto-ui-white))\",\n },\n },\n }}\n >\n <div className=\"neeto-ui-input__wrapper\">\n {label && (\n <Label {...{ required }} data-testid=\"treeselect-label\">\n {label}\n </Label>\n )}\n <AntdTreeSelect\n {...{\n allowClear,\n disabled,\n fieldNames,\n onChange,\n placeholder,\n ref,\n showSearch,\n size,\n treeData,\n treeDataSimpleMode,\n }}\n data-cy=\"neeto-ui-tree-select-wrapper\"\n dropdownStyle={{ zIndex: 100000 }}\n popupClassName=\"neeto-ui-tree-select-dropdown\"\n suffixIcon={<SuffixIcon />}\n treeNodeFilterProp={fieldNames?.label ?? \"label\"}\n value={value || undefined}\n className={classnames(\"neeto-ui-tree-select__wrapper\", className, {\n \"neeto-ui-tree-select__error\": error,\n })}\n notFoundContent={\n // eslint-disable-next-line @bigbinary/neeto/hard-coded-strings-should-be-localized\n <div className=\"neeto-ui-text-center neeto-ui-p-1\">\n {getLocale(i18n, t, \"neetoui.treeSelect.noOptions\")}\n </div>\n }\n switcherIcon={props => (\n <div {...props}>\n <SwitcherIcon />\n </div>\n )}\n {...otherProps}\n />\n {error && (\n <p className=\"neeto-ui-input__error\" data-testid=\"treeselect-error\">\n {error}\n </p>\n )}\n </div>\n </ConfigProvider>\n );\n }\n);\n\nTreeSelect.displayName = \"TreeSelect\";\n\nTreeSelect.propTypes = {\n /**\n * Controls whether the value is allowed to be cleared or not.\n */\n allowClear: PropTypes.bool,\n /**\n * To specify additional classes.\n */\n className: PropTypes.string,\n /**\n * To disable the TreeSelect component.\n */\n disabled: PropTypes.bool,\n /**\n * To display the specified error.\n */\n error: PropTypes.string,\n /**\n * This prop can be used to override the default keys of label and value pairs in options.\n */\n fieldNames: PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n }),\n /**\n * To display a label above the TreeSelect component.\n */\n label: PropTypes.string,\n /**\n * The callback function that will be triggered when value changes.\n */\n onChange: PropTypes.func,\n /**\n * Callback function to be executed when search input changes that can be\n * used for advanced usecases. This is not necessary as basic search works\n * when `showSearch` is enabled.\n */\n onSearch: PropTypes.func,\n /**\n * The placeholder string to be displayed.\n */\n placeholder: PropTypes.string,\n /**\n * To specify whether TreeSelect field is required or not.\n */\n required: PropTypes.bool,\n /**\n * The search value to make search controlled. This is not required as basic search\n * works when `showSearch` is enabled.\n */\n searchValue: PropTypes.string,\n /**\n * To enable search for the TreeSelect component.\n */\n showSearch: PropTypes.bool,\n /**\n * To specify the size of the TreeSelect component.\n */\n size: PropTypes.oneOf([\"small\", \"middle\", \"large\"]),\n /**\n * To specify the icon at the end of the TreeSelect component.\n */\n suffixIcon: PropTypes.node,\n /**\n * To specify the icon next to options that have children.\n */\n switcherIcon: PropTypes.node,\n /**\n * The options to be passed to the TreeSelect component.\n */\n treeData: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n disabled: PropTypes.bool,\n children: PropTypes.array,\n })\n ),\n PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n label: PropTypes.string,\n value: PropTypes.string,\n disabled: PropTypes.bool,\n pId: PropTypes.string,\n })\n ),\n ]),\n /**\n * This prop specifies the format of data that has to be passed in the `treeData` prop.\n * When enabled, treeData can be a flat array of the form `{ id, label, value, pId }`.\n */\n treeDataSimpleMode: PropTypes.bool,\n /**\n * The currently selected option.\n */\n value: PropTypes.string,\n};\n\nexport default TreeSelect;\n"],"names":["TreeSelect","forwardRef","_ref","ref","_fieldNames$label","allowClear","className","_ref$disabled","disabled","error","fieldNames","_ref$label","label","onChange","_ref$placeholder","placeholder","_ref$required","required","_ref$showSearch","showSearch","_ref$size","size","suffixIcon","switcherIcon","treeData","_ref$treeDataSimpleMo","treeDataSimpleMode","value","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","i18n","SuffixIcon","Down","SwitcherIcon","React","createElement","_ConfigProvider","locale","ANTD_LOCALE","language","theme","token","_objectSpread","ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES","components","nodeHoverBg","nodeSelectedBg","colorBgElevated","Label","_TreeSelect","_extends","dropdownStyle","zIndex","popupClassName","treeNodeFilterProp","undefined","classnames","notFoundContent","getLocale","props","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaMA,IAAAA,UAAU,gBAAGC,gBAAU,CAC3B,UAAAC,IAAA,EAoBEC,GAAG,EACA;AAAA,EAAA,IAAAC,iBAAA,CAAA;AAAA,EAAA,IAnBDC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IAAAC,aAAA,GAAAL,IAAA,CACTM,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;IAChBE,KAAK,GAAAP,IAAA,CAALO,KAAK;IACLC,UAAU,GAAAR,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@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var deDE = require('antd/locale/de_DE');
|
|
6
|
+
var enUS = require('antd/locale/en_US');
|
|
7
|
+
var esES = require('antd/locale/es_ES');
|
|
8
|
+
var frFR = require('antd/locale/fr_FR');
|
|
9
|
+
var nlNL = require('antd/locale/nl_NL');
|
|
10
|
+
var plPL = require('antd/locale/pl_PL');
|
|
11
|
+
var ptPT = require('antd/locale/pt_PT');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var deDE__default = /*#__PURE__*/_interopDefaultLegacy(deDE);
|
|
16
|
+
var enUS__default = /*#__PURE__*/_interopDefaultLegacy(enUS);
|
|
17
|
+
var esES__default = /*#__PURE__*/_interopDefaultLegacy(esES);
|
|
18
|
+
var frFR__default = /*#__PURE__*/_interopDefaultLegacy(frFR);
|
|
19
|
+
var nlNL__default = /*#__PURE__*/_interopDefaultLegacy(nlNL);
|
|
20
|
+
var plPL__default = /*#__PURE__*/_interopDefaultLegacy(plPL);
|
|
21
|
+
var ptPT__default = /*#__PURE__*/_interopDefaultLegacy(ptPT);
|
|
22
|
+
|
|
23
|
+
var ANTD_LOCALE = {
|
|
24
|
+
en: enUS__default["default"],
|
|
25
|
+
es: esES__default["default"],
|
|
26
|
+
fr: frFR__default["default"],
|
|
27
|
+
de: deDE__default["default"],
|
|
28
|
+
nl: nlNL__default["default"],
|
|
29
|
+
pl: plPL__default["default"],
|
|
30
|
+
pt: ptPT__default["default"]
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.ANTD_LOCALE = ANTD_LOCALE;
|
|
34
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/components/constants.js"],"sourcesContent":["import deDE from \"antd/locale/de_DE\";\nimport enUS from \"antd/locale/en_US\";\nimport esES from \"antd/locale/es_ES\";\nimport frFR from \"antd/locale/fr_FR\";\nimport nlNL from \"antd/locale/nl_NL\";\nimport plPL from \"antd/locale/pl_PL\";\nimport ptPT from \"antd/locale/pt_PT\";\n\nexport const ANTD_LOCALE = {\n en: enUS,\n es: esES,\n fr: frFR,\n de: deDE,\n nl: nlNL,\n pl: plPL,\n pt: ptPT,\n};\n"],"names":["ANTD_LOCALE","en","enUS","es","esES","fr","frFR","de","deDE","nl","nlNL","pl","plPL","pt","ptPT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQO,IAAMA,WAAW,GAAG;AACzBC,EAAAA,EAAE,EAAEC,wBAAI;AACRC,EAAAA,EAAE,EAAEC,wBAAI;AACRC,EAAAA,EAAE,EAAEC,wBAAI;AACRC,EAAAA,EAAE,EAAEC,wBAAI;AACRC,EAAAA,EAAE,EAAEC,wBAAI;AACRC,EAAAA,EAAE,EAAEC,wBAAI;AACRC,EAAAA,EAAE,EAAEC,wBAAAA;AACN;;;;"}
|
|
@@ -5,7 +5,7 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
5
5
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var formik = require('formik');
|
|
8
|
-
var
|
|
8
|
+
var ramda = require('ramda');
|
|
9
9
|
var Checkbox$1 = require('../Checkbox.js');
|
|
10
10
|
require('classnames');
|
|
11
11
|
require('../useId-4e3deb5c.js');
|
|
@@ -23,7 +23,6 @@ require('dayjs/plugin/weekday');
|
|
|
23
23
|
require('dayjs/plugin/weekOfYear');
|
|
24
24
|
require('@bigbinary/neeto-cist');
|
|
25
25
|
require('qs');
|
|
26
|
-
require('ramda');
|
|
27
26
|
require('../en-c1fe180c.js');
|
|
28
27
|
require('../Label.js');
|
|
29
28
|
require('@bigbinary/neeto-icons');
|
|
@@ -52,23 +51,27 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
52
51
|
name: name
|
|
53
52
|
}, function (_ref2) {
|
|
54
53
|
var field = _ref2.field,
|
|
55
|
-
meta = _ref2.meta
|
|
54
|
+
meta = _ref2.meta,
|
|
55
|
+
form = _ref2.form;
|
|
56
|
+
var status = form.status,
|
|
57
|
+
setStatus = form.setStatus;
|
|
58
|
+
var fieldStatus = formik.getIn(status, name);
|
|
59
|
+
var fieldProps = _objectSpread(_objectSpread({}, field), {}, {
|
|
60
|
+
onChange: function onChange(e) {
|
|
61
|
+
setStatus(ramda.dissoc(name));
|
|
62
|
+
field.onChange(e);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
56
65
|
return /*#__PURE__*/React__default["default"].createElement(Checkbox$1, _extends__default["default"]({
|
|
57
66
|
checked: field.value
|
|
58
|
-
}, _objectSpread(_objectSpread({},
|
|
67
|
+
}, _objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
59
68
|
ref: ref
|
|
60
69
|
}), {
|
|
61
|
-
error: meta.touched ? meta.error : ""
|
|
70
|
+
error: meta.touched ? meta.error || fieldStatus : ""
|
|
62
71
|
}, rest));
|
|
63
72
|
});
|
|
64
73
|
});
|
|
65
74
|
Checkbox.displayName = "Checkbox";
|
|
66
|
-
Checkbox.propTypes = {
|
|
67
|
-
/**
|
|
68
|
-
* The name of the Checkbox.
|
|
69
|
-
*/
|
|
70
|
-
name: index.propTypes.exports.string
|
|
71
|
-
};
|
|
72
75
|
|
|
73
76
|
module.exports = Checkbox;
|
|
74
77
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../src/formik/Checkbox.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { Field } from \"formik\";\nimport PropTypes from \"prop-types\";\n\nimport CheckboxField from \"components/Checkbox\";\n\nconst Checkbox = forwardRef(({ name, ...rest }, ref) => (\n <Field {...{ name }}>\n {({ field, meta }) => (\n <CheckboxField\n
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../src/formik/Checkbox.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { Field, getIn } from \"formik\";\nimport PropTypes from \"prop-types\";\nimport { dissoc } from \"ramda\";\n\nimport CheckboxField from \"components/Checkbox\";\n\nconst Checkbox = forwardRef(({ name, ...rest }, ref) => (\n <Field {...{ name }}>\n {({ field, meta, form }) => {\n const { status, setStatus } = form;\n const fieldStatus = getIn(status, name);\n\n const fieldProps = {\n ...field,\n onChange: e => {\n setStatus(dissoc(name));\n field.onChange(e);\n },\n };\n\n return (\n <CheckboxField\n checked={field.value}\n {...{ ...fieldProps, ref }}\n error={meta.touched ? meta.error || fieldStatus : \"\"}\n {...rest}\n />\n );\n }}\n </Field>\n));\n\nCheckbox.displayName = \"Checkbox\";\n\nCheckbox.propTypes = {\n /**\n * The name of the Checkbox.\n */\n name: PropTypes.string,\n};\n\nexport default Checkbox;\n"],"names":["Checkbox","forwardRef","_ref","ref","name","rest","_objectWithoutProperties","_excluded","React","createElement","Field","_ref2","field","meta","form","status","setStatus","fieldStatus","getIn","fieldProps","_objectSpread","onChange","e","dissoc","CheckboxField","_extends","checked","value","error","touched","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,QAAQ,gBAAGC,gBAAU,CAAC,UAAAC,IAAA,EAAoBC,GAAG,EAAA;AAAA,EAAA,IAApBC,IAAI,GAAAF,IAAA,CAAJE,IAAI;AAAKC,IAAAA,IAAI,GAAAC,4CAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA,CAAA;AAAA,EAAA,oBAC1CC,yBAAA,CAAAC,aAAA,CAACC,YAAK,EAAA;AAAON,IAAAA,IAAI,EAAJA,IAAAA;GACV,EAAA,UAAAO,KAAA,EAA2B;AAAA,IAAA,IAAxBC,KAAK,GAAAD,KAAA,CAALC,KAAK;MAAEC,IAAI,GAAAF,KAAA,CAAJE,IAAI;MAAEC,IAAI,GAAAH,KAAA,CAAJG,IAAI,CAAA;AACnB,IAAA,IAAQC,MAAM,GAAgBD,IAAI,CAA1BC,MAAM;MAAEC,SAAS,GAAKF,IAAI,CAAlBE,SAAS,CAAA;AACzB,IAAA,IAAMC,WAAW,GAAGC,YAAK,CAACH,MAAM,EAAEX,IAAI,CAAC,CAAA;AAEvC,IAAA,IAAMe,UAAU,GAAAC,aAAA,CAAAA,aAAA,KACXR,KAAK,CAAA,EAAA,EAAA,EAAA;AACRS,MAAAA,QAAQ,EAAE,SAAAA,QAAAC,CAAAA,CAAC,EAAI;AACbN,QAAAA,SAAS,CAACO,YAAM,CAACnB,IAAI,CAAC,CAAC,CAAA;AACvBQ,QAAAA,KAAK,CAACS,QAAQ,CAACC,CAAC,CAAC,CAAA;AACnB,OAAA;KACD,CAAA,CAAA;AAED,IAAA,oBACEd,yBAAA,CAAAC,aAAA,CAACe,UAAa,EAAAC,4BAAA,CAAA;MACZC,OAAO,EAAEd,KAAK,CAACe,KAAAA;AAAM,KAAA,EAAAP,aAAA,CAAAA,aAAA,CAAA,EAAA,EACZD,UAAU,CAAA,EAAA,EAAA,EAAA;AAAEhB,MAAAA,GAAG,EAAHA,GAAAA;AAAG,KAAA,CAAA,EAAA;MACxByB,KAAK,EAAEf,IAAI,CAACgB,OAAO,GAAGhB,IAAI,CAACe,KAAK,IAAIX,WAAW,GAAG,EAAA;AAAG,KAAA,EACjDZ,IAAI,CACR,CAAA,CAAA;AAEN,GAAC,CACK,CAAA;AAAA,CACT,EAAC;AAEFL,QAAQ,CAAC8B,WAAW,GAAG,UAAU;;;;"}
|
package/dist/cjs/formik/Input.js
CHANGED
|
@@ -5,11 +5,10 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
5
5
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var formik = require('formik');
|
|
8
|
-
var
|
|
8
|
+
var ramda = require('ramda');
|
|
9
9
|
var Input = require('../Input.js');
|
|
10
10
|
require('@babel/runtime/helpers/slicedToArray');
|
|
11
11
|
require('classnames');
|
|
12
|
-
require('ramda');
|
|
13
12
|
require('../useId-4e3deb5c.js');
|
|
14
13
|
require('react-router-dom');
|
|
15
14
|
require('@bigbinary/neeto-hotkeys');
|
|
@@ -52,21 +51,25 @@ var FormikInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
52
51
|
name: name
|
|
53
52
|
}, function (_ref2) {
|
|
54
53
|
var field = _ref2.field,
|
|
55
|
-
meta = _ref2.meta
|
|
54
|
+
meta = _ref2.meta,
|
|
55
|
+
form = _ref2.form;
|
|
56
|
+
var status = form.status,
|
|
57
|
+
setStatus = form.setStatus;
|
|
58
|
+
var fieldStatus = formik.getIn(status, name);
|
|
59
|
+
var fieldProps = _objectSpread(_objectSpread({}, field), {}, {
|
|
60
|
+
onChange: function onChange(e) {
|
|
61
|
+
setStatus(ramda.dissoc(name));
|
|
62
|
+
field.onChange(e);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
56
65
|
return /*#__PURE__*/React__default["default"].createElement(Input, _extends__default["default"]({}, _objectSpread({
|
|
57
66
|
ref: ref
|
|
58
|
-
},
|
|
59
|
-
error: meta.touched ? meta.error : ""
|
|
67
|
+
}, fieldProps), {
|
|
68
|
+
error: meta.touched ? meta.error || fieldStatus : ""
|
|
60
69
|
}, rest));
|
|
61
70
|
});
|
|
62
71
|
});
|
|
63
72
|
FormikInput.displayName = "FormikInput";
|
|
64
|
-
FormikInput.propTypes = {
|
|
65
|
-
/**
|
|
66
|
-
* The name of the input field.
|
|
67
|
-
*/
|
|
68
|
-
name: index.propTypes.exports.string
|
|
69
|
-
};
|
|
70
73
|
|
|
71
74
|
module.exports = FormikInput;
|
|
72
75
|
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../../src/formik/Input.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { Field } from \"formik\";\nimport PropTypes from \"prop-types\";\n\nimport Input from \"components/Input\";\n\nconst FormikInput = forwardRef(({ name, ...rest }, ref) => (\n <Field {...{ name }}>\n {({ field, meta }) => (\n <Input\n
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../src/formik/Input.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { Field, getIn } from \"formik\";\nimport PropTypes from \"prop-types\";\nimport { dissoc } from \"ramda\";\n\nimport Input from \"components/Input\";\n\nconst FormikInput = forwardRef(({ name, ...rest }, ref) => (\n <Field {...{ name }}>\n {({ field, meta, form }) => {\n const { status, setStatus } = form;\n const fieldStatus = getIn(status, name);\n\n const fieldProps = {\n ...field,\n onChange: e => {\n setStatus(dissoc(name));\n field.onChange(e);\n },\n };\n\n return (\n <Input\n {...{ ref, ...fieldProps }}\n error={meta.touched ? meta.error || fieldStatus : \"\"}\n {...rest}\n />\n );\n }}\n </Field>\n));\n\nFormikInput.displayName = \"FormikInput\";\n\nFormikInput.propTypes = {\n /**\n * The name of the input field.\n */\n name: PropTypes.string,\n};\n\nexport default FormikInput;\n"],"names":["FormikInput","forwardRef","_ref","ref","name","rest","_objectWithoutProperties","_excluded","React","createElement","Field","_ref2","field","meta","form","status","setStatus","fieldStatus","getIn","fieldProps","_objectSpread","onChange","e","dissoc","Input","_extends","error","touched","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,WAAW,gBAAGC,gBAAU,CAAC,UAAAC,IAAA,EAAoBC,GAAG,EAAA;AAAA,EAAA,IAApBC,IAAI,GAAAF,IAAA,CAAJE,IAAI;AAAKC,IAAAA,IAAI,GAAAC,4CAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA,CAAA;AAAA,EAAA,oBAC7CC,yBAAA,CAAAC,aAAA,CAACC,YAAK,EAAA;AAAON,IAAAA,IAAI,EAAJA,IAAAA;GACV,EAAA,UAAAO,KAAA,EAA2B;AAAA,IAAA,IAAxBC,KAAK,GAAAD,KAAA,CAALC,KAAK;MAAEC,IAAI,GAAAF,KAAA,CAAJE,IAAI;MAAEC,IAAI,GAAAH,KAAA,CAAJG,IAAI,CAAA;AACnB,IAAA,IAAQC,MAAM,GAAgBD,IAAI,CAA1BC,MAAM;MAAEC,SAAS,GAAKF,IAAI,CAAlBE,SAAS,CAAA;AACzB,IAAA,IAAMC,WAAW,GAAGC,YAAK,CAACH,MAAM,EAAEX,IAAI,CAAC,CAAA;AAEvC,IAAA,IAAMe,UAAU,GAAAC,aAAA,CAAAA,aAAA,KACXR,KAAK,CAAA,EAAA,EAAA,EAAA;AACRS,MAAAA,QAAQ,EAAE,SAAAA,QAAAC,CAAAA,CAAC,EAAI;AACbN,QAAAA,SAAS,CAACO,YAAM,CAACnB,IAAI,CAAC,CAAC,CAAA;AACvBQ,QAAAA,KAAK,CAACS,QAAQ,CAACC,CAAC,CAAC,CAAA;AACnB,OAAA;KACD,CAAA,CAAA;IAED,oBACEd,yBAAA,CAAAC,aAAA,CAACe,KAAK,EAAAC,4BAAA,KAAAL,aAAA,CAAA;AACEjB,MAAAA,GAAG,EAAHA,GAAAA;AAAG,KAAA,EAAKgB,UAAU,CAAA,EAAA;MACxBO,KAAK,EAAEb,IAAI,CAACc,OAAO,GAAGd,IAAI,CAACa,KAAK,IAAIT,WAAW,GAAG,EAAA;AAAG,KAAA,EACjDZ,IAAI,CACR,CAAA,CAAA;AAEN,GAAC,CACK,CAAA;AAAA,CACT,EAAC;AAEFL,WAAW,CAAC4B,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -5,11 +5,11 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
|
5
5
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var formik = require('formik');
|
|
8
|
+
var ramda = require('ramda');
|
|
8
9
|
var MultiEmailInput = require('../MultiEmailInput.js');
|
|
9
10
|
require('@babel/runtime/helpers/defineProperty');
|
|
10
11
|
require('@babel/runtime/helpers/toConsumableArray');
|
|
11
12
|
require('classnames');
|
|
12
|
-
require('ramda');
|
|
13
13
|
require('../react-select-creatable.esm-23eddf9f.js');
|
|
14
14
|
require('@babel/runtime/helpers/esm/extends');
|
|
15
15
|
require('@babel/runtime/helpers/esm/objectSpread2');
|
|
@@ -71,16 +71,21 @@ var FormikMultiEmailInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
71
71
|
_useField2$ = _useField2[2],
|
|
72
72
|
setValue = _useField2$.setValue,
|
|
73
73
|
setTouched = _useField2$.setTouched;
|
|
74
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
75
|
+
status = _useFormikContext.status,
|
|
76
|
+
setStatus = _useFormikContext.setStatus;
|
|
77
|
+
var fieldStatus = formik.getIn(status, name);
|
|
74
78
|
return /*#__PURE__*/React__default["default"].createElement(MultiEmailInput, _extends__default["default"]({
|
|
75
79
|
ref: ref,
|
|
76
|
-
error: meta.touched ? meta.error : "",
|
|
80
|
+
error: meta.touched ? meta.error || fieldStatus : "",
|
|
77
81
|
name: field.name,
|
|
78
82
|
value: field.value,
|
|
79
83
|
onBlur: function onBlur() {
|
|
80
84
|
return setTouched(true);
|
|
81
85
|
},
|
|
82
86
|
onChange: function onChange(value) {
|
|
83
|
-
|
|
87
|
+
setStatus(ramda.dissoc(name));
|
|
88
|
+
setValue(value);
|
|
84
89
|
}
|
|
85
90
|
}, otherProps));
|
|
86
91
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiEmailInput.js","sources":["../../../src/formik/MultiEmailInput.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { useField } from \"formik\";\nimport PropTypes from \"prop-types\";\n\nimport EmailInput from \"components/MultiEmailInput\";\n\nconst FormikMultiEmailInput = forwardRef(({ name, ...otherProps }, ref) => {\n const [field, meta, { setValue, setTouched }] = useField(name);\n\n return (\n <EmailInput\n {...{ ref }}\n error={meta.touched ? meta.error : \"\"}\n name={field.name}\n value={field.value}\n onBlur={() => setTouched(true)}\n onChange={value => setValue(value)}\n {...otherProps}\n />\n );\n});\n\nFormikMultiEmailInput.displayName = \"FormikMultiEmailInput\";\n\nFormikMultiEmailInput.propTypes = {\n /**\n * The name of the email input field.\n */\n name: PropTypes.string,\n};\n\nexport default FormikMultiEmailInput;\n"],"names":["FormikMultiEmailInput","forwardRef","_ref","ref","name","otherProps","_objectWithoutProperties","_excluded","_useField","useField","_useField2","_slicedToArray","field","meta","_useField2$","setValue","setTouched","React","createElement","EmailInput","_extends","error","touched","value","onBlur","onChange","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"MultiEmailInput.js","sources":["../../../src/formik/MultiEmailInput.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { useField, useFormikContext, getIn } from \"formik\";\nimport PropTypes from \"prop-types\";\nimport { dissoc } from \"ramda\";\n\nimport EmailInput from \"components/MultiEmailInput\";\n\nconst FormikMultiEmailInput = forwardRef(({ name, ...otherProps }, ref) => {\n const [field, meta, { setValue, setTouched }] = useField(name);\n\n const { status, setStatus } = useFormikContext();\n const fieldStatus = getIn(status, name);\n\n return (\n <EmailInput\n {...{ ref }}\n error={meta.touched ? meta.error || fieldStatus : \"\"}\n name={field.name}\n value={field.value}\n onBlur={() => setTouched(true)}\n onChange={value => {\n setStatus(dissoc(name));\n setValue(value);\n }}\n {...otherProps}\n />\n );\n});\n\nFormikMultiEmailInput.displayName = \"FormikMultiEmailInput\";\n\nFormikMultiEmailInput.propTypes = {\n /**\n * The name of the email input field.\n */\n name: PropTypes.string,\n};\n\nexport default FormikMultiEmailInput;\n"],"names":["FormikMultiEmailInput","forwardRef","_ref","ref","name","otherProps","_objectWithoutProperties","_excluded","_useField","useField","_useField2","_slicedToArray","field","meta","_useField2$","setValue","setTouched","_useFormikContext","useFormikContext","status","setStatus","fieldStatus","getIn","React","createElement","EmailInput","_extends","error","touched","value","onBlur","onChange","dissoc","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQMA,IAAAA,qBAAqB,gBAAGC,gBAAU,CAAC,UAAAC,IAAA,EAA0BC,GAAG,EAAK;AAAA,EAAA,IAA/BC,IAAI,GAAAF,IAAA,CAAJE,IAAI;AAAKC,IAAAA,UAAU,GAAAC,4CAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA,CAAA;AAC7D,EAAA,IAAAC,SAAA,GAAgDC,eAAQ,CAACL,IAAI,CAAC;IAAAM,UAAA,GAAAC,kCAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAvDI,IAAAA,KAAK,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,IAAI,GAAAH,UAAA,CAAA,CAAA,CAAA;AAAAI,IAAAA,WAAA,GAAAJ,UAAA,CAAA,CAAA,CAAA;IAAIK,QAAQ,GAAAD,WAAA,CAARC,QAAQ;IAAEC,UAAU,GAAAF,WAAA,CAAVE,UAAU,CAAA;EAE1C,IAAAC,iBAAA,GAA8BC,uBAAgB,EAAE;IAAxCC,MAAM,GAAAF,iBAAA,CAANE,MAAM;IAAEC,SAAS,GAAAH,iBAAA,CAATG,SAAS,CAAA;AACzB,EAAA,IAAMC,WAAW,GAAGC,YAAK,CAACH,MAAM,EAAEf,IAAI,CAAC,CAAA;AAEvC,EAAA,oBACEmB,yBAAA,CAAAC,aAAA,CAACC,eAAU,EAAAC,4BAAA,CAAA;AACHvB,IAAAA,GAAG,EAAHA,GAAG;IACTwB,KAAK,EAAEd,IAAI,CAACe,OAAO,GAAGf,IAAI,CAACc,KAAK,IAAIN,WAAW,GAAG,EAAG;IACrDjB,IAAI,EAAEQ,KAAK,CAACR,IAAK;IACjByB,KAAK,EAAEjB,KAAK,CAACiB,KAAM;IACnBC,MAAM,EAAE,SAAAA,MAAA,GAAA;MAAA,OAAMd,UAAU,CAAC,IAAI,CAAC,CAAA;KAAC;AAC/Be,IAAAA,QAAQ,EAAE,SAAAA,QAAAF,CAAAA,KAAK,EAAI;AACjBT,MAAAA,SAAS,CAACY,YAAM,CAAC5B,IAAI,CAAC,CAAC,CAAA;MACvBW,QAAQ,CAACc,KAAK,CAAC,CAAA;AACjB,KAAA;AAAE,GAAA,EACExB,UAAU,CACd,CAAA,CAAA;AAEN,CAAC,EAAC;AAEFL,qBAAqB,CAACiC,WAAW,GAAG,uBAAuB;;;;"}
|
package/dist/cjs/formik/Radio.js
CHANGED
|
@@ -6,6 +6,7 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
|
6
6
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var formik = require('formik');
|
|
9
|
+
var ramda = require('ramda');
|
|
9
10
|
var Radio = require('../Radio.js');
|
|
10
11
|
require('classnames');
|
|
11
12
|
require('../Label.js');
|
|
@@ -31,7 +32,6 @@ require('dayjs/plugin/weekday');
|
|
|
31
32
|
require('dayjs/plugin/weekOfYear');
|
|
32
33
|
require('@bigbinary/neeto-cist');
|
|
33
34
|
require('qs');
|
|
34
|
-
require('ramda');
|
|
35
35
|
require('../en-c1fe180c.js');
|
|
36
36
|
|
|
37
37
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -52,22 +52,28 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
52
52
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
53
53
|
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
54
54
|
var _useFormikContext = formik.useFormikContext(),
|
|
55
|
-
setFieldValue = _useFormikContext.setFieldValue
|
|
55
|
+
setFieldValue = _useFormikContext.setFieldValue,
|
|
56
|
+
status = _useFormikContext.status,
|
|
57
|
+
setStatus = _useFormikContext.setStatus;
|
|
56
58
|
var _useField = formik.useField({
|
|
57
59
|
name: name
|
|
58
60
|
}),
|
|
59
61
|
_useField2 = _slicedToArray__default["default"](_useField, 2),
|
|
60
62
|
field = _useField2[0],
|
|
61
63
|
meta = _useField2[1];
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
var fieldStatus = formik.getIn(status, name);
|
|
65
|
+
var fieldProps = _objectSpread(_objectSpread({}, field), {}, {
|
|
64
66
|
onChange: function onChange(event) {
|
|
65
|
-
|
|
67
|
+
setStatus(ramda.dissoc(name));
|
|
68
|
+
setFieldValue(name, event.target.value);
|
|
66
69
|
}
|
|
70
|
+
});
|
|
71
|
+
return /*#__PURE__*/React__default["default"].createElement(Radio, _extends__default["default"]({
|
|
72
|
+
error: meta.touched ? meta.error || fieldStatus : ""
|
|
67
73
|
}, _objectSpread(_objectSpread({
|
|
68
74
|
className: className,
|
|
69
75
|
label: label
|
|
70
|
-
},
|
|
76
|
+
}, fieldProps), props)));
|
|
71
77
|
};
|
|
72
78
|
RadioGroup.Item = Radio.Item;
|
|
73
79
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sources":["../../../src/formik/Radio.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { useField, useFormikContext } from \"formik\";\n\nimport Radio from \"components/Radio\";\n\nconst RadioGroup = ({ label, name, className = \"\", ...props }) => {\n const { setFieldValue } = useFormikContext();\n const [field, meta] = useField({ name });\n\n return (\n <Radio\n error={meta.touched ? meta.error : \"\"}\n
|
|
1
|
+
{"version":3,"file":"Radio.js","sources":["../../../src/formik/Radio.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { useField, useFormikContext, getIn } from \"formik\";\nimport { dissoc } from \"ramda\";\n\nimport Radio from \"components/Radio\";\n\nconst RadioGroup = ({ label, name, className = \"\", ...props }) => {\n const { setFieldValue, status, setStatus } = useFormikContext();\n const [field, meta] = useField({ name });\n\n const fieldStatus = getIn(status, name);\n\n const fieldProps = {\n ...field,\n onChange: event => {\n setStatus(dissoc(name));\n setFieldValue(name, event.target.value);\n },\n };\n\n return (\n <Radio\n error={meta.touched ? meta.error || fieldStatus : \"\"}\n {...{ className, label, ...fieldProps, ...props }}\n />\n );\n};\n\nRadioGroup.Item = Radio.Item;\n\nRadioGroup.propTypes = Radio.propTypes;\n\nexport default RadioGroup;\n"],"names":["RadioGroup","_ref","label","name","_ref$className","className","props","_objectWithoutProperties","_excluded","_useFormikContext","useFormikContext","setFieldValue","status","setStatus","_useField","useField","_useField2","_slicedToArray","field","meta","fieldStatus","getIn","fieldProps","_objectSpread","onChange","event","dissoc","target","value","React","createElement","Radio","_extends","error","touched","Item"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAMA,UAAU,GAAG,SAAbA,UAAUA,CAAAC,IAAA,EAAkD;AAAA,EAAA,IAA5CC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA;AAAKE,IAAAA,KAAK,GAAAC,4CAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA,CAAA;EACzD,IAAAC,iBAAA,GAA6CC,uBAAgB,EAAE;IAAvDC,aAAa,GAAAF,iBAAA,CAAbE,aAAa;IAAEC,MAAM,GAAAH,iBAAA,CAANG,MAAM;IAAEC,SAAS,GAAAJ,iBAAA,CAATI,SAAS,CAAA;EACxC,IAAAC,SAAA,GAAsBC,eAAQ,CAAC;AAAEZ,MAAAA,IAAI,EAAJA,IAAAA;AAAK,KAAC,CAAC;IAAAa,UAAA,GAAAC,kCAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAjCI,IAAAA,KAAK,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,IAAI,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAElB,EAAA,IAAMI,WAAW,GAAGC,YAAK,CAACT,MAAM,EAAET,IAAI,CAAC,CAAA;AAEvC,EAAA,IAAMmB,UAAU,GAAAC,aAAA,CAAAA,aAAA,KACXL,KAAK,CAAA,EAAA,EAAA,EAAA;AACRM,IAAAA,QAAQ,EAAE,SAAAA,QAAAC,CAAAA,KAAK,EAAI;AACjBZ,MAAAA,SAAS,CAACa,YAAM,CAACvB,IAAI,CAAC,CAAC,CAAA;MACvBQ,aAAa,CAACR,IAAI,EAAEsB,KAAK,CAACE,MAAM,CAACC,KAAK,CAAC,CAAA;AACzC,KAAA;GACD,CAAA,CAAA;AAED,EAAA,oBACEC,yBAAA,CAAAC,aAAA,CAACC,KAAK,EAAAC,4BAAA,CAAA;IACJC,KAAK,EAAEd,IAAI,CAACe,OAAO,GAAGf,IAAI,CAACc,KAAK,IAAIb,WAAW,GAAG,EAAA;GAAGG,EAAAA,aAAA,CAAAA,aAAA,CAAA;AAC/ClB,IAAAA,SAAS,EAATA,SAAS;AAAEH,IAAAA,KAAK,EAALA,KAAAA;GAAUoB,EAAAA,UAAU,CAAKhB,EAAAA,KAAK,CAC/C,CAAA,CAAA,CAAA;AAEN,EAAC;AAEDN,UAAU,CAACmC,IAAI,GAAGJ,KAAK,CAACI,IAAI;;;;"}
|
|
@@ -81,6 +81,10 @@ var SelectField = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
81
81
|
_useField2$ = _useField2[2],
|
|
82
82
|
setValue = _useField2$.setValue,
|
|
83
83
|
setTouched = _useField2$.setTouched;
|
|
84
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
85
|
+
status = _useFormikContext.status,
|
|
86
|
+
setStatus = _useFormikContext.setStatus;
|
|
87
|
+
var fieldStatus = formik.getIn(status, name);
|
|
84
88
|
var isMenuOpen = React.useRef(otherProps.defaultMenuIsOpen);
|
|
85
89
|
var getRealOptionValue = function getRealOptionValue(option) {
|
|
86
90
|
if (typeof getOptionValue !== "function") {
|
|
@@ -96,19 +100,20 @@ var SelectField = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
96
100
|
};
|
|
97
101
|
return /*#__PURE__*/React__default["default"].createElement(Select, _extends__default["default"]({
|
|
98
102
|
options: options,
|
|
99
|
-
error: meta.touched ? meta.error : "",
|
|
103
|
+
error: meta.touched ? meta.error || fieldStatus : "",
|
|
100
104
|
getOptionValue: getOptionValue || ramda.prop("value"),
|
|
101
105
|
innerRef: ref,
|
|
102
106
|
isMulti: !!isMulti,
|
|
103
107
|
name: field.name,
|
|
104
108
|
value: ramda.either(ramda.isNil, ramda.isEmpty)(field.value) ? null : buildValueObj(field.value, options),
|
|
105
|
-
onChange: function onChange(value) {
|
|
106
|
-
return setValue(value);
|
|
107
|
-
},
|
|
108
109
|
onBlur: function onBlur() {
|
|
109
110
|
return React.startTransition(function () {
|
|
110
111
|
setTouched(true);
|
|
111
112
|
});
|
|
113
|
+
},
|
|
114
|
+
onChange: function onChange(value) {
|
|
115
|
+
setStatus(ramda.dissoc(name));
|
|
116
|
+
setValue(value);
|
|
112
117
|
}
|
|
113
118
|
}, otherProps, {
|
|
114
119
|
onKeyDown: function onKeyDown(event) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/formik/Select.jsx"],"sourcesContent":["import React, { forwardRef, useRef, startTransition } from \"react\";\n\nimport { useField } from \"formik\";\nimport PropTypes from \"prop-types\";\nimport { prop, either, isNil, isEmpty } from \"ramda\";\n\nimport Select from \"components/Select\";\n\nconst SelectField = forwardRef((props, ref) => {\n const {\n name = \"\",\n options = [],\n getOptionValue = null,\n isMulti = false,\n ...otherProps\n } = props;\n const [field, meta, { setValue, setTouched }] = useField(name);\n\n const isMenuOpen = useRef(otherProps.defaultMenuIsOpen);\n\n const getRealOptionValue = option => {\n if (typeof getOptionValue !== \"function\") {\n return option.value;\n }\n\n return getOptionValue(option);\n };\n\n const buildValueObj = (value, options) => {\n if (typeof value === \"object\") return value;\n\n return options.filter(option => getRealOptionValue(option) === value)[0];\n };\n\n return (\n <Select\n {...{ options }}\n error={meta.touched ? meta.error : \"\"}\n getOptionValue={getOptionValue || prop(\"value\")}\n innerRef={ref}\n isMulti={!!isMulti}\n name={field.name}\n value={\n either(isNil, isEmpty)(field.value)\n ? null\n : buildValueObj(field.value, options)\n }\n
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/formik/Select.jsx"],"sourcesContent":["import React, { forwardRef, useRef, startTransition } from \"react\";\n\nimport { getIn, useFormikContext, useField } from \"formik\";\nimport PropTypes from \"prop-types\";\nimport { prop, either, isNil, isEmpty, dissoc } from \"ramda\";\n\nimport Select from \"components/Select\";\n\nconst SelectField = forwardRef((props, ref) => {\n const {\n name = \"\",\n options = [],\n getOptionValue = null,\n isMulti = false,\n ...otherProps\n } = props;\n const [field, meta, { setValue, setTouched }] = useField(name);\n const { status, setStatus } = useFormikContext();\n const fieldStatus = getIn(status, name);\n\n const isMenuOpen = useRef(otherProps.defaultMenuIsOpen);\n\n const getRealOptionValue = option => {\n if (typeof getOptionValue !== \"function\") {\n return option.value;\n }\n\n return getOptionValue(option);\n };\n\n const buildValueObj = (value, options) => {\n if (typeof value === \"object\") return value;\n\n return options.filter(option => getRealOptionValue(option) === value)[0];\n };\n\n return (\n <Select\n {...{ options }}\n error={meta.touched ? meta.error || fieldStatus : \"\"}\n getOptionValue={getOptionValue || prop(\"value\")}\n innerRef={ref}\n isMulti={!!isMulti}\n name={field.name}\n value={\n either(isNil, isEmpty)(field.value)\n ? null\n : buildValueObj(field.value, options)\n }\n onBlur={() =>\n startTransition(() => {\n setTouched(true);\n })\n }\n onChange={value => {\n setStatus(dissoc(name));\n setValue(value);\n }}\n {...otherProps}\n onKeyDown={event => {\n if (event.key === \"Enter\" && isMenuOpen.current) {\n event.stopPropagation();\n }\n otherProps.onKeyDown?.(event);\n }}\n onMenuClose={() => {\n isMenuOpen.current = false;\n otherProps.onMenuClose?.();\n }}\n onMenuOpen={() => {\n isMenuOpen.current = true;\n otherProps.onMenuOpen?.();\n }}\n />\n );\n});\n\nSelectField.displayName = \"SelectField\";\n\nSelectField.propTypes = {\n /**\n * The name of the select input.\n */\n name: PropTypes.string,\n /**\n * To provide the options to be displayed in the select component.\n */\n options: PropTypes.array,\n /**\n * To provide the function to get the value of the option.\n */\n getOptionValue: PropTypes.string,\n /**\n * To specify whether multiple options can be selected.\n */\n isMulti: PropTypes.bool,\n};\n\nexport default SelectField;\n"],"names":["SelectField","forwardRef","props","ref","_props$name","name","_props$options","options","_props$getOptionValue","getOptionValue","_props$isMulti","isMulti","otherProps","_objectWithoutProperties","_excluded","_useField","useField","_useField2","_slicedToArray","field","meta","_useField2$","setValue","setTouched","_useFormikContext","useFormikContext","status","setStatus","fieldStatus","getIn","isMenuOpen","useRef","defaultMenuIsOpen","getRealOptionValue","option","value","buildValueObj","_typeof","filter","React","createElement","Select","_extends","error","touched","prop","innerRef","either","isNil","isEmpty","onBlur","startTransition","onChange","dissoc","onKeyDown","event","_otherProps$onKeyDown","key","current","stopPropagation","call","onMenuClose","_otherProps$onMenuClo","onMenuOpen","_otherProps$onMenuOpe","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQMA,IAAAA,WAAW,gBAAGC,gBAAU,CAAC,UAACC,KAAK,EAAEC,GAAG,EAAK;AAC7C,EAAA,IAAAC,WAAA,GAMIF,KAAK,CALPG,IAAI;AAAJA,IAAAA,IAAI,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,WAAA;IAAAE,cAAA,GAKPJ,KAAK,CAJPK,OAAO;AAAPA,IAAAA,OAAO,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA;IAAAE,qBAAA,GAIVN,KA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C,qBAAA,CAAA;MAClB,IAAID,KAAK,CAACE,GAAG,KAAK,OAAO,IAAI3B,UAAU,CAAC4B,OAAO,EAAE;QAC/CH,KAAK,CAACI,eAAe,EAAE,CAAA;AACzB,OAAA;AACA,MAAA,CAAAH,qBAAA,GAAA5C,UAAU,CAAC0C,SAAS,MAAAE,IAAAA,IAAAA,qBAAA,KAApBA,KAAAA,CAAAA,IAAAA,qBAAA,CAAAI,IAAA,CAAAhD,UAAU,EAAa2C,KAAK,CAAC,CAAA;KAC7B;IACFM,WAAW,EAAE,SAAAA,WAAAA,GAAM;AAAA,MAAA,IAAAC,qBAAA,CAAA;MACjBhC,UAAU,CAAC4B,OAAO,GAAG,KAAK,CAAA;AAC1B,MAAA,CAAAI,qBAAA,GAAAlD,UAAU,CAACiD,WAAW,MAAA,IAAA,IAAAC,qBAAA,KAAA,KAAA,CAAA,IAAtBA,qBAAA,CAAAF,IAAA,CAAAhD,UAAU,CAAgB,CAAA;KAC1B;IACFmD,UAAU,EAAE,SAAAA,UAAAA,GAAM;AAAA,MAAA,IAAAC,qBAAA,CAAA;MAChBlC,UAAU,CAAC4B,OAAO,GAAG,IAAI,CAAA;AACzB,MAAA,CAAAM,qBAAA,GAAApD,UAAU,CAACmD,UAAU,MAAA,IAAA,IAAAC,qBAAA,KAAA,KAAA,CAAA,IAArBA,qBAAA,CAAAJ,IAAA,CAAAhD,UAAU,CAAe,CAAA;AAC3B,KAAA;GACA,CAAA,CAAA,CAAA;AAEN,CAAC,EAAC;AAEFZ,WAAW,CAACiE,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -6,9 +6,19 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
|
6
6
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var formik = require('formik');
|
|
9
|
+
var ramda = require('ramda');
|
|
9
10
|
var Slider = require('../Slider.js');
|
|
10
11
|
require('antd/lib/config-provider');
|
|
11
12
|
require('antd/lib/slider');
|
|
13
|
+
require('react-i18next');
|
|
14
|
+
require('../constants.js');
|
|
15
|
+
require('antd/locale/de_DE');
|
|
16
|
+
require('antd/locale/en_US');
|
|
17
|
+
require('antd/locale/es_ES');
|
|
18
|
+
require('antd/locale/fr_FR');
|
|
19
|
+
require('antd/locale/nl_NL');
|
|
20
|
+
require('antd/locale/pl_PL');
|
|
21
|
+
require('antd/locale/pt_PT');
|
|
12
22
|
require('../Label.js');
|
|
13
23
|
require('classnames');
|
|
14
24
|
require('@bigbinary/neeto-icons');
|
|
@@ -33,7 +43,6 @@ require('dayjs/plugin/weekday');
|
|
|
33
43
|
require('dayjs/plugin/weekOfYear');
|
|
34
44
|
require('@bigbinary/neeto-cist');
|
|
35
45
|
require('qs');
|
|
36
|
-
require('ramda');
|
|
37
46
|
require('../en-c1fe180c.js');
|
|
38
47
|
|
|
39
48
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -57,8 +66,12 @@ var FormikSlider = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
57
66
|
_useField2$ = _useField2[2],
|
|
58
67
|
setValue = _useField2$.setValue,
|
|
59
68
|
setTouched = _useField2$.setTouched;
|
|
69
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
70
|
+
status = _useFormikContext.status,
|
|
71
|
+
setStatus = _useFormikContext.setStatus;
|
|
72
|
+
var fieldStatus = formik.getIn(status, name);
|
|
60
73
|
return /*#__PURE__*/React__default["default"].createElement(Slider, _extends__default["default"]({
|
|
61
|
-
error: meta.error || ""
|
|
74
|
+
error: meta.error || fieldStatus || ""
|
|
62
75
|
}, _objectSpread(_objectSpread({
|
|
63
76
|
ref: ref
|
|
64
77
|
}, field), {}, {
|
|
@@ -68,7 +81,8 @@ var FormikSlider = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
68
81
|
return setTouched(true);
|
|
69
82
|
},
|
|
70
83
|
onChange: function onChange(value) {
|
|
71
|
-
|
|
84
|
+
setStatus(ramda.dissoc(name));
|
|
85
|
+
setValue(value);
|
|
72
86
|
}
|
|
73
87
|
}, otherProps));
|
|
74
88
|
});
|