@bigbinary/neeto-fields-frontend 1.3.37 → 1.3.39

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/index.js CHANGED
@@ -7,7 +7,7 @@ import { useFormikContext, useField, FieldArray } from 'formik';
7
7
  import { t as t$1 } from 'i18next';
8
8
  import * as yup from 'yup';
9
9
  import { Select, Button, ActionBlock as ActionBlock$1, Input as Input$1, Switch, Form } from '@bigbinary/neetoui/formik';
10
- import { joinHyphenCase, buildUrl, getQueryParams, dateFormat } from '@bigbinary/neeto-commons-frontend/utils';
10
+ import { joinHyphenCase, buildUrl, getQueryParams, dateFormat, hyphenize } from '@bigbinary/neeto-commons-frontend/utils';
11
11
  import { Check, Delete, Reorder } from '@bigbinary/neeto-icons';
12
12
  import { useTranslation, Trans } from 'react-i18next';
13
13
  import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE, PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
@@ -1511,32 +1511,21 @@ var getPermittedKinds = function getPermittedKinds(_ref2) {
1511
1511
  var allowedKinds = _ref2.allowedKinds,
1512
1512
  selectedKind = _ref2.selectedKind;
1513
1513
  var filteredKinds = pick(allowedKinds, FIELD_KINDS);
1514
- var permittedKinds = filterBy({
1514
+ return filterBy({
1515
1515
  group: selectedKind === null || selectedKind === void 0 ? void 0 : selectedKind.group
1516
1516
  }, values(filteredKinds));
1517
- return permittedKinds;
1518
1517
  };
1519
1518
  var generateValidationSchema = function generateValidationSchema(additionalValidations) {
1520
1519
  return yup.object().shape(_objectSpread$b(_objectSpread$b({}, BASIC_FIELD_FORM_VALIDATIONS), additionalValidations));
1521
1520
  };
1522
1521
  var renderFormFooter = function renderFormFooter(_ref3) {
1523
1522
  var onClose = _ref3.onClose,
1524
- loading = _ref3.loading,
1525
- _ref3$dirty = _ref3.dirty,
1526
- dirty = _ref3$dirty === void 0 ? true : _ref3$dirty;
1523
+ loading = _ref3.loading;
1527
1524
  return /*#__PURE__*/React.createElement(Pane.Footer, null, /*#__PURE__*/React.createElement(ActionBlock$1, {
1528
1525
  cancelButtonProps: {
1529
- onClick: onClose,
1530
- style: "text",
1531
- disabled: loading
1526
+ onClick: onClose
1532
1527
  },
1533
- submitButtonProps: {
1534
- label: t$1("neetoFields.labels.saveChanges"),
1535
- className: "mr-2",
1536
- type: "submit",
1537
- disabled: !dirty,
1538
- loading: loading
1539
- }
1528
+ isSubmitting: loading
1540
1529
  }));
1541
1530
  };
1542
1531
  var getDefaultOption = function getDefaultOption() {
@@ -1880,15 +1869,13 @@ var Add = function Add(_ref) {
1880
1869
  onSubmit: handleSubmit
1881
1870
  }
1882
1871
  }, function (_ref2) {
1883
- var dirty = _ref2.dirty,
1884
- kind = _ref2.values.kind;
1872
+ var kind = _ref2.values.kind;
1885
1873
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FieldForm, _extends({
1886
1874
  chosenKind: kind.value,
1887
1875
  kindSelectOptions: filteredKinds
1888
1876
  }, props)), renderFormFooter({
1889
1877
  onClose: onClose,
1890
- loading: isSubmitting,
1891
- dirty: dirty
1878
+ loading: isSubmitting
1892
1879
  }));
1893
1880
  }));
1894
1881
  };
@@ -1954,8 +1941,7 @@ var Edit = function Edit(_ref) {
1954
1941
  onSubmit: handleSubmit
1955
1942
  }
1956
1943
  }, function (_ref2) {
1957
- var kind = _ref2.values.kind,
1958
- dirty = _ref2.dirty;
1944
+ var kind = _ref2.values.kind;
1959
1945
  var permittedKinds = getPermittedKinds({
1960
1946
  allowedKinds: allowedKinds,
1961
1947
  selectedKind: kind
@@ -1966,8 +1952,7 @@ var Edit = function Edit(_ref) {
1966
1952
  kindSelectOptions: permittedKinds
1967
1953
  }, props)), renderFormFooter({
1968
1954
  onClose: onClose,
1969
- loading: isSubmitting,
1970
- dirty: dirty
1955
+ loading: isSubmitting
1971
1956
  }));
1972
1957
  }));
1973
1958
  };
@@ -8013,7 +7998,9 @@ var InlineFieldValueInput = function InlineFieldValueInput(_ref2) {
8013
7998
  _ref3$component = _ref3.component,
8014
7999
  CustomDisplayComponent = _ref3$component === void 0 ? null : _ref3$component;
8015
8000
  var DisplayComponent = CustomDisplayComponent || DefaultDisplayComponent;
8016
- return isEditable ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FieldValueInputWrapper, {
8001
+ return isEditable ? /*#__PURE__*/React.createElement("div", {
8002
+ "data-cy": "inline-field-value-input-".concat(hyphenize(field.name))
8003
+ }, /*#__PURE__*/React.createElement(FieldValueInputWrapper, {
8017
8004
  field: field,
8018
8005
  fieldValues: fieldValues,
8019
8006
  onSubmit: function onSubmit(values) {