@commercetools-frontend/experimental-components 7.2.0 → 7.2.1

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.
@@ -9078,11 +9078,11 @@ const RecurrentIntervalPicker = _ref => {
9078
9078
  formatMessage = _useIntl.formatMessage;
9079
9079
  const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
9080
9080
  const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
9081
- const skip = isReadOnly && !value;
9081
+ const skipFetch = isReadOnly && !value;
9082
9082
  const where = isReadOnly && value ? `id="${value}"` : undefined;
9083
9083
  const _useRecurrenceInterva = useRecurrenceIntervals({
9084
9084
  where,
9085
- skip
9085
+ skip: skipFetch
9086
9086
  }),
9087
9087
  recurrencePolicies = _useRecurrenceInterva.recurrencePolicies,
9088
9088
  loading = _useRecurrenceInterva.loading,
@@ -9107,7 +9107,7 @@ const RecurrentIntervalPicker = _ref => {
9107
9107
  }
9108
9108
  return mapped;
9109
9109
  }, [recurrencePolicies, selectedIsMissingInData, value, dataLocale, formatMessage, formatLocalizedFieldToString, loading]);
9110
- const noRecurrentIntervalsConfigured = !loading && recurrencePolicies.length === 0;
9110
+ const noRecurrentIntervalsConfigured = !loading && !skipFetch && recurrencePolicies.length === 0;
9111
9111
  React.useEffect(() => {
9112
9112
  if (error && onError) {
9113
9113
  onError(error);
@@ -9133,7 +9133,7 @@ const RecurrentIntervalPicker = _ref => {
9133
9133
  }) : selectedIsMissingInData ? jsxRuntime.jsx(uiKit.Text.Body, {
9134
9134
  tone: "negative",
9135
9135
  intlMessage: messages$w.missingSelectedWarning
9136
- }) : null, !error && !skip && noRecurrentIntervalsConfigured && jsxRuntime.jsx(uiKit.ContentNotification, {
9136
+ }) : null, !error && noRecurrentIntervalsConfigured && jsxRuntime.jsx(uiKit.ContentNotification, {
9137
9137
  type: "warning",
9138
9138
  children: jsxRuntime.jsx(uiKit.Text.Detail, {
9139
9139
  intlMessage: messages$w.noRecurrentIntervalsConfigured
@@ -9190,7 +9190,8 @@ const ScrollToFieldError = () => {
9190
9190
  // div is used only for custom fields
9191
9191
  document.querySelector(`div[aria-errormessage="${firstElementId}"]`) ?? document.querySelector(`label[for="${id}"]`) ?? document.querySelector(`label#${id}`) ?? firstErrorElement;
9192
9192
  elementToScrollTo.scrollIntoView?.({
9193
- behavior: 'smooth'
9193
+ behavior: 'smooth',
9194
+ block: 'center'
9194
9195
  });
9195
9196
  }
9196
9197
  }
@@ -9056,11 +9056,11 @@ const RecurrentIntervalPicker = _ref => {
9056
9056
  formatMessage = _useIntl.formatMessage;
9057
9057
  const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
9058
9058
  const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
9059
- const skip = isReadOnly && !value;
9059
+ const skipFetch = isReadOnly && !value;
9060
9060
  const where = isReadOnly && value ? `id="${value}"` : undefined;
9061
9061
  const _useRecurrenceInterva = useRecurrenceIntervals({
9062
9062
  where,
9063
- skip
9063
+ skip: skipFetch
9064
9064
  }),
9065
9065
  recurrencePolicies = _useRecurrenceInterva.recurrencePolicies,
9066
9066
  loading = _useRecurrenceInterva.loading,
@@ -9085,7 +9085,7 @@ const RecurrentIntervalPicker = _ref => {
9085
9085
  }
9086
9086
  return mapped;
9087
9087
  }, [recurrencePolicies, selectedIsMissingInData, value, dataLocale, formatMessage, formatLocalizedFieldToString, loading]);
9088
- const noRecurrentIntervalsConfigured = !loading && recurrencePolicies.length === 0;
9088
+ const noRecurrentIntervalsConfigured = !loading && !skipFetch && recurrencePolicies.length === 0;
9089
9089
  React.useEffect(() => {
9090
9090
  if (error && onError) {
9091
9091
  onError(error);
@@ -9111,7 +9111,7 @@ const RecurrentIntervalPicker = _ref => {
9111
9111
  }) : selectedIsMissingInData ? jsxRuntime.jsx(uiKit.Text.Body, {
9112
9112
  tone: "negative",
9113
9113
  intlMessage: messages$w.missingSelectedWarning
9114
- }) : null, !error && !skip && noRecurrentIntervalsConfigured && jsxRuntime.jsx(uiKit.ContentNotification, {
9114
+ }) : null, !error && noRecurrentIntervalsConfigured && jsxRuntime.jsx(uiKit.ContentNotification, {
9115
9115
  type: "warning",
9116
9116
  children: jsxRuntime.jsx(uiKit.Text.Detail, {
9117
9117
  intlMessage: messages$w.noRecurrentIntervalsConfigured
@@ -9168,7 +9168,8 @@ const ScrollToFieldError = () => {
9168
9168
  // div is used only for custom fields
9169
9169
  document.querySelector(`div[aria-errormessage="${firstElementId}"]`) ?? document.querySelector(`label[for="${id}"]`) ?? document.querySelector(`label#${id}`) ?? firstErrorElement;
9170
9170
  elementToScrollTo.scrollIntoView?.({
9171
- behavior: 'smooth'
9171
+ behavior: 'smooth',
9172
+ block: 'center'
9172
9173
  });
9173
9174
  }
9174
9175
  }
@@ -8976,11 +8976,11 @@ const RecurrentIntervalPicker = _ref => {
8976
8976
  formatMessage = _useIntl.formatMessage;
8977
8977
  const dataLocale = useApplicationContext(applicationContext => applicationContext.dataLocale);
8978
8978
  const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
8979
- const skip = isReadOnly && !value;
8979
+ const skipFetch = isReadOnly && !value;
8980
8980
  const where = isReadOnly && value ? `id="${value}"` : undefined;
8981
8981
  const _useRecurrenceInterva = useRecurrenceIntervals({
8982
8982
  where,
8983
- skip
8983
+ skip: skipFetch
8984
8984
  }),
8985
8985
  recurrencePolicies = _useRecurrenceInterva.recurrencePolicies,
8986
8986
  loading = _useRecurrenceInterva.loading,
@@ -9005,7 +9005,7 @@ const RecurrentIntervalPicker = _ref => {
9005
9005
  }
9006
9006
  return mapped;
9007
9007
  }, [recurrencePolicies, selectedIsMissingInData, value, dataLocale, formatMessage, formatLocalizedFieldToString, loading]);
9008
- const noRecurrentIntervalsConfigured = !loading && recurrencePolicies.length === 0;
9008
+ const noRecurrentIntervalsConfigured = !loading && !skipFetch && recurrencePolicies.length === 0;
9009
9009
  useEffect(() => {
9010
9010
  if (error && onError) {
9011
9011
  onError(error);
@@ -9031,7 +9031,7 @@ const RecurrentIntervalPicker = _ref => {
9031
9031
  }) : selectedIsMissingInData ? jsx(Text.Body, {
9032
9032
  tone: "negative",
9033
9033
  intlMessage: messages$w.missingSelectedWarning
9034
- }) : null, !error && !skip && noRecurrentIntervalsConfigured && jsx(ContentNotification, {
9034
+ }) : null, !error && noRecurrentIntervalsConfigured && jsx(ContentNotification, {
9035
9035
  type: "warning",
9036
9036
  children: jsx(Text.Detail, {
9037
9037
  intlMessage: messages$w.noRecurrentIntervalsConfigured
@@ -9088,7 +9088,8 @@ const ScrollToFieldError = () => {
9088
9088
  // div is used only for custom fields
9089
9089
  document.querySelector(`div[aria-errormessage="${firstElementId}"]`) ?? document.querySelector(`label[for="${id}"]`) ?? document.querySelector(`label#${id}`) ?? firstErrorElement;
9090
9090
  elementToScrollTo.scrollIntoView?.({
9091
- behavior: 'smooth'
9091
+ behavior: 'smooth',
9092
+ block: 'center'
9092
9093
  });
9093
9094
  }
9094
9095
  }
@@ -1,4 +1,4 @@
1
- import { TRecurrencePolicyQueryResult } from '../../../../../../types/src/generated/ctp';
1
+ import type { TRecurrencePolicyQueryResult } from '../../../../../../types/src/generated/ctp';
2
2
  declare const handlers: {
3
3
  FetchRecurrencePolicies: {
4
4
  all: (policies?: TRecurrencePolicyQueryResult['results']) => import("msw").GraphQLHandler<import("msw").GraphQLRequest<import("msw").GraphQLVariables>>;
package/dist/styles.css CHANGED
@@ -40,6 +40,12 @@
40
40
  .validated-input-module__container___3L2KB {
41
41
  display: inline;
42
42
  }
43
+ /* imported from label-range.module.css */
44
+
45
+ .label-range-module__label___3Tb0p {
46
+ font-size: 0.9rem;
47
+ font-weight: bold;
48
+ }
43
49
  /* imported from multi-value-search-input.module.css */
44
50
 
45
51
  .multi-value-search-input-module__container___2u64d {
@@ -86,12 +92,6 @@
86
92
  border-bottom-left-radius: var(--border-radius-for-input);
87
93
  border-bottom-right-radius: var(--border-radius-for-input);
88
94
  }
89
- /* imported from label-range.module.css */
90
-
91
- .label-range-module__label___3Tb0p {
92
- font-size: 0.9rem;
93
- font-weight: bold;
94
- }
95
95
  /* imported from search-input.module.css */
96
96
 
97
97
  .search-input-module__block___1uM-y {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/experimental-components",
3
- "version": "7.2.0",
3
+ "version": "7.2.1",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,14 +25,14 @@
25
25
  "dependencies": {
26
26
  "@babel/core": "^7.22.11",
27
27
  "@babel/runtime-corejs3": "^7.21.0",
28
- "@commercetools-frontend/actions-global": "24.1.0",
29
- "@commercetools-frontend/application-components": "24.1.0",
30
- "@commercetools-frontend/application-shell": "24.1.0",
31
- "@commercetools-frontend/application-shell-connectors": "24.1.0",
32
- "@commercetools-frontend/constants": "24.1.0",
33
- "@commercetools-frontend/l10n": "24.1.0",
34
- "@commercetools-frontend/sdk": "24.1.0",
35
- "@commercetools-frontend/sentry": "24.1.0",
28
+ "@commercetools-frontend/actions-global": "24.2.0",
29
+ "@commercetools-frontend/application-components": "24.2.0",
30
+ "@commercetools-frontend/application-shell": "24.2.0",
31
+ "@commercetools-frontend/application-shell-connectors": "24.2.0",
32
+ "@commercetools-frontend/constants": "24.2.0",
33
+ "@commercetools-frontend/l10n": "24.2.0",
34
+ "@commercetools-frontend/sdk": "24.2.0",
35
+ "@commercetools-frontend/sentry": "24.2.0",
36
36
  "@commercetools-frontend/ui-kit": "20.0.0",
37
37
  "@commercetools-uikit/design-system": "20.0.0",
38
38
  "@commercetools-uikit/select-utils": "20.0.0",
@@ -61,7 +61,7 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "@apollo/client": "3.12.4",
64
- "@commercetools/composable-commerce-test-data": "11.2.1",
64
+ "@commercetools/composable-commerce-test-data": "11.4.0",
65
65
  "@testing-library/react": "16.1.0",
66
66
  "@types/debounce-promise": "3.1.9",
67
67
  "@types/jest": "^29.5.2",
@@ -80,7 +80,7 @@
80
80
  "react-test-renderer": "17.0.2",
81
81
  "redux": "4.2.1",
82
82
  "typescript": "5.2.2",
83
- "@commercetools-local/test-data": "1.2.20",
83
+ "@commercetools-local/test-data": "1.2.21",
84
84
  "@commercetools-local/test-utils": "1.2.21"
85
85
  },
86
86
  "peerDependencies": {