@bigbinary/neeto-fields-frontend 1.1.5 → 1.1.6

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
@@ -1,12 +1,12 @@
1
1
  import React, { useContext, useState, useRef, useEffect, useMemo, useLayoutEffect, useCallback, createContext, memo, useReducer } from 'react';
2
- import { Switch, TimePicker, DatePicker, Select, Input, Textarea, Typography, Pane, Label, Button as Button$1, Dropdown, NoData, Table, Spinner, Alert } from '@bigbinary/neetoui';
2
+ import { Checkbox as Checkbox$1, TimePicker, DatePicker, Select, Input, Textarea, Typography, Pane, Label, Button as Button$1, Dropdown, NoData, Table, Spinner, Alert } from '@bigbinary/neetoui';
3
3
  import { toLabelAndValue, isNotEmpty, capitalize as capitalize$1, filterBy, findBy, slugify, humanize, countBy, existsBy, noop as noop$2 } from '@bigbinary/neeto-commons-frontend/pure';
4
4
  import { values, map, isNotNil, isEmpty, isNil, pluck, clone as clone$1, pipe, mergeAll, omit, prop, pick, assoc, any, not, head } from 'ramda';
5
5
  import { useFormikContext, useField, FieldArray } from 'formik';
6
6
  import { useFuncDebounce, useDebounce, handleMetaClick } from '@bigbinary/neeto-commons-frontend/react-utils';
7
7
  import * as yup from 'yup';
8
8
  import { Check, Info, Delete, MenuHorizontal, Reorder } from '@bigbinary/neeto-icons';
9
- import { Button, ActionBlock, Input as Input$1, Select as Select$1, Switch as Switch$1, Form } from '@bigbinary/neetoui/formik';
9
+ import { Button, ActionBlock, Input as Input$1, Select as Select$1, Switch, Form } from '@bigbinary/neetoui/formik';
10
10
  import Container from '@bigbinary/neeto-molecules/Container';
11
11
  import Header from '@bigbinary/neeto-molecules/Header';
12
12
  import MenuBar from '@bigbinary/neeto-molecules/MenuBar';
@@ -6051,7 +6051,7 @@ var useFormikFields = function useFormikFields(_ref) {
6051
6051
  error: individualSubmit ? meta.error : meta.touched && meta.error,
6052
6052
  options: isDropdown ? buildOptionsToLabelAndValue(fieldData) : undefined,
6053
6053
  value: getValueForField(formikFieldProps.value),
6054
- label: !individualSubmit && capitalize$1(name),
6054
+ label: capitalize$1(name),
6055
6055
  disabled: disabled
6056
6056
  })
6057
6057
  };
@@ -6061,7 +6061,7 @@ var Checkbox = function Checkbox(props) {
6061
6061
  var _useFormikFields = useFormikFields(props),
6062
6062
  handleSubmit = _useFormikFields.handleSubmit,
6063
6063
  fieldProps = _useFormikFields.fieldProps;
6064
- return /*#__PURE__*/React.createElement(Switch, _extends({}, fieldProps, {
6064
+ return /*#__PURE__*/React.createElement(Checkbox$1, _extends({}, fieldProps, {
6065
6065
  checked: fieldProps.value,
6066
6066
  onChange: function onChange(_ref) {
6067
6067
  var checked = _ref.target.checked;
@@ -6841,7 +6841,7 @@ var FieldForm = function FieldForm(_ref) {
6841
6841
  }), isAdditionalDataNeeded(chosenKind) && /*#__PURE__*/React.createElement(AdditionalInputs, null), !hideRequiredSwitch && /*#__PURE__*/React.createElement(Label, {
6842
6842
  className: "flex items-center gap-2",
6843
6843
  "data-cy": "is-required-switch-container"
6844
- }, /*#__PURE__*/React.createElement(Switch$1, {
6844
+ }, /*#__PURE__*/React.createElement(Switch, {
6845
6845
  "data-cy": "is-required-switch",
6846
6846
  name: "isRequired"
6847
6847
  }), /*#__PURE__*/React.createElement(Typography, {
@@ -7367,7 +7367,7 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
7367
7367
  inactiveFieldsCount: inactiveFieldsCount,
7368
7368
  handleBlockClick: handleBlockClick
7369
7369
  });
7370
- }, [activeFieldsCount, inactiveFieldsCount]);
7370
+ }, [activeFieldsCount, inactiveFieldsCount, state]);
7371
7371
  var menuBarItems = useMemo(function () {
7372
7372
  return renderMenuBarItems({
7373
7373
  isOwnerBased: isOwnerBased,
@@ -12074,9 +12074,7 @@ var FieldValuesContainer = function FieldValuesContainer(_ref) {
12074
12074
  _ref$disabled = _ref.disabled,
12075
12075
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
12076
12076
  isRequiredColumnName = _ref.isRequiredColumnName,
12077
- fieldContainerClassName = _ref.fieldContainerClassName,
12078
12077
  fieldClassName = _ref.fieldClassName,
12079
- labelClassName = _ref.labelClassName,
12080
12078
  _ref$onMutationSucces = _ref.onMutationSuccess,
12081
12079
  onMutationSuccess = _ref$onMutationSucces === void 0 ? noop$2 : _ref$onMutationSucces;
12082
12080
  var _useTranslation = useTranslation(),
@@ -12124,7 +12122,7 @@ var FieldValuesContainer = function FieldValuesContainer(_ref) {
12124
12122
  };
12125
12123
  var fields = propFields || fetchedFields;
12126
12124
  return /*#__PURE__*/React.createElement("div", {
12127
- className: classnames("space-y-3", {
12125
+ className: classnames("space-y-3 py-3", {
12128
12126
  "neeto-ui-border-gray-300 rounded-lg border bg-white px-4 py-2": showBorder
12129
12127
  }, className)
12130
12128
  }, isFieldsLoading ? /*#__PURE__*/React.createElement("div", {
@@ -12136,12 +12134,9 @@ var FieldValuesContainer = function FieldValuesContainer(_ref) {
12136
12134
  });
12137
12135
  if (Field) {
12138
12136
  return /*#__PURE__*/React.createElement("div", {
12139
- className: classnames(fieldContainerClassName, "space-y-1"),
12137
+ className: classnames(fieldClassName, "space-y-1"),
12140
12138
  key: field.id
12141
- }, /*#__PURE__*/React.createElement(Typography, {
12142
- className: labelClassName,
12143
- style: "h5"
12144
- }, capitalize$1(field.name)), /*#__PURE__*/React.createElement(FieldValueInputWrapper, {
12139
+ }, /*#__PURE__*/React.createElement(FieldValueInputWrapper, {
12145
12140
  className: fieldClassName,
12146
12141
  onSubmit: function onSubmit(values) {
12147
12142
  return handleSubmit(field, values);