@hitkey-io/strapi-plugin-region 1.0.0 → 1.0.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.
@@ -5,7 +5,7 @@ const react = require("react");
5
5
  const reactIntl = require("react-intl");
6
6
  const designSystem = require("@strapi/design-system");
7
7
  const reactTooltip = require("@radix-ui/react-tooltip");
8
- const index = require("./index-C8USiGWk.js");
8
+ const index = require("./index-CK-3sF3l.js");
9
9
  const PLUGIN_ID = "strapi-plugin-region";
10
10
  const Input = react.forwardRef((props, ref) => {
11
11
  const { name, value, onChange, label, error, hint, required, disabled, attribute } = props;
@@ -45,7 +45,7 @@ const Input = react.forwardRef((props, ref) => {
45
45
  [selectedCountry, allCountries]
46
46
  );
47
47
  const regions = countryData?.regions ?? [];
48
- react.useMemo(
48
+ const regionData = react.useMemo(
49
49
  () => regions.find((r) => r.shortCode === selectedRegion) ?? null,
50
50
  [selectedRegion, regions]
51
51
  );
@@ -75,6 +75,7 @@ const Input = react.forwardRef((props, ref) => {
75
75
  designSystem.Combobox,
76
76
  {
77
77
  value: selectedCountry,
78
+ textValue: countryData?.countryName ?? "",
78
79
  onChange: handleCountryChange,
79
80
  onClear: () => handleCountryChange(void 0),
80
81
  clearLabel: formatMessage({
@@ -94,6 +95,7 @@ const Input = react.forwardRef((props, ref) => {
94
95
  designSystem.Combobox,
95
96
  {
96
97
  value: selectedRegion,
98
+ textValue: regionData?.name ?? "",
97
99
  onChange: handleRegionChange,
98
100
  onClear: () => {
99
101
  onChange({
@@ -3,7 +3,7 @@ import { forwardRef, useMemo } from "react";
3
3
  import { useIntl } from "react-intl";
4
4
  import { Field, Grid, Combobox, ComboboxOption } from "@strapi/design-system";
5
5
  import { Provider } from "@radix-ui/react-tooltip";
6
- import { u as useCountries } from "./index-Cpq91_9N.mjs";
6
+ import { u as useCountries } from "./index-DewAD-wn.mjs";
7
7
  const PLUGIN_ID = "strapi-plugin-region";
8
8
  const Input = forwardRef((props, ref) => {
9
9
  const { name, value, onChange, label, error, hint, required, disabled, attribute } = props;
@@ -43,7 +43,7 @@ const Input = forwardRef((props, ref) => {
43
43
  [selectedCountry, allCountries]
44
44
  );
45
45
  const regions = countryData?.regions ?? [];
46
- useMemo(
46
+ const regionData = useMemo(
47
47
  () => regions.find((r) => r.shortCode === selectedRegion) ?? null,
48
48
  [selectedRegion, regions]
49
49
  );
@@ -73,6 +73,7 @@ const Input = forwardRef((props, ref) => {
73
73
  Combobox,
74
74
  {
75
75
  value: selectedCountry,
76
+ textValue: countryData?.countryName ?? "",
76
77
  onChange: handleCountryChange,
77
78
  onClear: () => handleCountryChange(void 0),
78
79
  clearLabel: formatMessage({
@@ -92,6 +93,7 @@ const Input = forwardRef((props, ref) => {
92
93
  Combobox,
93
94
  {
94
95
  value: selectedRegion,
96
+ textValue: regionData?.name ?? "",
95
97
  onChange: handleRegionChange,
96
98
  onClear: () => {
97
99
  onChange({
@@ -18929,7 +18929,7 @@ const index = {
18929
18929
  },
18930
18930
  icon: ForwardRef,
18931
18931
  components: {
18932
- Input: async () => Promise.resolve().then(() => require("./Input-ClJGentv.js"))
18932
+ Input: async () => Promise.resolve().then(() => require("./Input-Bmdg_AIq.js"))
18933
18933
  },
18934
18934
  options: {
18935
18935
  base: [
@@ -18928,7 +18928,7 @@ const index = {
18928
18928
  },
18929
18929
  icon: ForwardRef,
18930
18930
  components: {
18931
- Input: async () => import("./Input-DV9NWUHU.mjs")
18931
+ Input: async () => import("./Input-D40fvg2A.mjs")
18932
18932
  },
18933
18933
  options: {
18934
18934
  base: [
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-C8USiGWk.js");
2
+ const index = require("../_chunks/index-CK-3sF3l.js");
3
3
  require("react");
4
4
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-Cpq91_9N.mjs";
1
+ import { i } from "../_chunks/index-DewAD-wn.mjs";
2
2
  import "react";
3
3
  export {
4
4
  i as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitkey-io/strapi-plugin-region",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Strapi 5 custom field for selecting country and region",
5
5
  "license": "MIT",
6
6
  "author": "Nikolay Larsen <nikolay@velkomb.com>",