@kanda-libs/ks-component-ts 0.3.52 → 0.3.54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanda-libs/ks-component-ts",
3
- "version": "0.3.52",
3
+ "version": "0.3.54",
4
4
  "description": "Kanda form component library",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
@@ -7,6 +7,7 @@ import {
7
7
  } from "@kanda-libs/ks-frontend-services";
8
8
  import usePreviousValue from "~/hooks/usePreviousValue";
9
9
  import { DEBOUNCE_INTERVAL, SKELETON_DATA } from "./constants";
10
+ import { InfoCompanyRequestFunction } from "~/generated/operations/infoCompany";
10
11
 
11
12
  export interface SearchHook {
12
13
  results: InfoCompany[];
@@ -20,10 +21,16 @@ const useSearch = (query = ""): SearchHook => {
20
21
  const { previousValue: previousQuery, hasChanged: queryHasChanged } =
21
22
  usePreviousValue(debouncedQuery);
22
23
 
24
+ const service = {
25
+ key: services.infoCompany.infoCompany.key,
26
+ method: (
27
+ services.infoCompany.infoCompany
28
+ .method as unknown as () => InfoCompanyRequestFunction
29
+ )(),
30
+ };
31
+
23
32
  const { data, isValidating, mutate } = useLoadData(
24
- (debouncedQuery &&
25
- services.infoCompany
26
- .infoCompany) as typeof services.infoCompany.infoCompany,
33
+ debouncedQuery ? service : false,
27
34
  { shouldRetryOnError: false },
28
35
  {
29
36
  params: {
@@ -13,6 +13,7 @@ import {
13
13
  useSubmit,
14
14
  } from "@kanda-libs/ks-frontend-services";
15
15
  import { StringIndexedObject } from "~/types";
16
+ import { InfoIPRequestFunction } from "~/generated/operations/infoIP";
16
17
 
17
18
  export interface Hook {
18
19
  Handle: HandleComponent;
@@ -28,8 +29,15 @@ export default function useFingerprintBooleanInputUncontrolled(
28
29
 
29
30
  const { setValue } = useFormContext();
30
31
 
32
+ const service = {
33
+ key: services.infoCompany.infoCompany.key,
34
+ method: (
35
+ services.infoIP.infoIP.method as unknown as () => InfoIPRequestFunction
36
+ )(),
37
+ };
38
+
31
39
  const { submit: getIp } = useSubmit(
32
- services.infoIP.infoIP as unknown as Service<
40
+ service as unknown as Service<
33
41
  InfoIP,
34
42
  StringIndexedObject,
35
43
  StringIndexedObject
@@ -2,6 +2,7 @@ import * as t from "io-ts";
2
2
  import { CheckoutOption } from "./CheckoutOption";
3
3
  import { FinanceRate } from "./FinanceRate";
4
4
  import { Money } from "./Money";
5
+ import { Signature } from "./Signature";
5
6
 
6
7
  export const CustomerOptions = t.intersection([
7
8
  t.type({
@@ -10,6 +11,7 @@ export const CustomerOptions = t.intersection([
10
11
  }),
11
12
  t.partial({
12
13
  deposit_value: Money,
14
+ agree_commission_terms: Signature,
13
15
  }),
14
16
  ]);
15
17
 
@@ -17,4 +19,5 @@ export interface CustomerOptions {
17
19
  checkout_option: CheckoutOption;
18
20
  finance_option: FinanceRate;
19
21
  deposit_value?: Money;
22
+ agree_commission_terms?: Signature;
20
23
  }