@etsoo/smarterp-core 1.1.6 → 1.1.7

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.
@@ -18,7 +18,7 @@ function AddressTiplist(props) {
18
18
  // App
19
19
  const app = (0, ICoreServiceApp_1.useRequiredAppContext)();
20
20
  // Destruct
21
- const { fullWidth = true, getOptionLabel = (option) => `${option.name} - ${option.formattedAddress} (${option.postalCode})`, name = "address", label = app.get("address") ?? "Address", maxItems = 10, onValueChange, ...rest } = props;
21
+ const { fullWidth = true, getOptionLabel = (option) => `${option.name} - ${option.formattedAddress}${option.postalCode ? ` (${option.postalCode})` : ""}`, name = "address", label = app.get("address") ?? "Address", maxItems = 10, onValueChange, ...rest } = props;
22
22
  // Provider
23
23
  const providerRef = react_1.default.useRef(appscript_1.MapApiProvider.Google);
24
24
  return ((0, jsx_runtime_1.jsx)(materialui_1.Tiplist, { fullWidth: fullWidth, getOptionLabel: getOptionLabel, idField: "placeId", label: label, loadData: async (keyword, _, maxItems) => {
@@ -12,7 +12,7 @@ export function AddressTiplist(props) {
12
12
  // App
13
13
  const app = useRequiredAppContext();
14
14
  // Destruct
15
- const { fullWidth = true, getOptionLabel = (option) => `${option.name} - ${option.formattedAddress} (${option.postalCode})`, name = "address", label = app.get("address") ?? "Address", maxItems = 10, onValueChange, ...rest } = props;
15
+ const { fullWidth = true, getOptionLabel = (option) => `${option.name} - ${option.formattedAddress}${option.postalCode ? ` (${option.postalCode})` : ""}`, name = "address", label = app.get("address") ?? "Address", maxItems = 10, onValueChange, ...rest } = props;
16
16
  // Provider
17
17
  const providerRef = React.useRef(MapApiProvider.Google);
18
18
  return (_jsx(Tiplist, { fullWidth: fullWidth, getOptionLabel: getOptionLabel, idField: "placeId", label: label, loadData: async (keyword, _, maxItems) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "TypeScript APIs for SmartERP Core",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -36,7 +36,9 @@ export function AddressTiplist(props: AddressTiplistProps) {
36
36
  const {
37
37
  fullWidth = true,
38
38
  getOptionLabel = (option) =>
39
- `${option.name} - ${option.formattedAddress} (${option.postalCode})`,
39
+ `${option.name} - ${option.formattedAddress}${
40
+ option.postalCode ? ` (${option.postalCode})` : ""
41
+ }`,
40
42
  name = "address",
41
43
  label = app.get("address") ?? "Address",
42
44
  maxItems = 10,