ingeniuscliq-core 0.3.33 → 0.3.35

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.
@@ -10,7 +10,7 @@ interface FormSelectProps<T extends FieldValues = FieldValues> extends BaseStyle
10
10
  }>;
11
11
  readonly className: string;
12
12
  readonly selectClassName: string;
13
- onValueChange?(value: string): void;
13
+ onValueChange?: (value: string) => void;
14
14
  }
15
- export declare function FormSelect<T extends FieldValues = FieldValues>({ control, name, placeholder, className, options, selectClassName }: FormSelectProps<T>): import("react/jsx-runtime").JSX.Element;
15
+ export declare function FormSelect<T extends FieldValues = FieldValues>({ control, name, placeholder, className, options, selectClassName, onValueChange }: FormSelectProps<T>): import("react/jsx-runtime").JSX.Element;
16
16
  export {};
package/dist/index.js CHANGED
@@ -2497,9 +2497,11 @@ class J5 {
2497
2497
  throw console.error(o), t((a) => ({ ...a, error: o, loading: !1 })), o;
2498
2498
  }
2499
2499
  },
2500
- clearCart: () => {
2500
+ clearCart: async () => {
2501
2501
  try {
2502
- t({ loading: !0, error: null }), this.shopCartService.clearCart(), t({ ...this.initialState, loading: !1 });
2502
+ t({ loading: !0, error: null }), await this.shopCartService.clearCart();
2503
+ let r = await this.shopCartService.getCart();
2504
+ t(() => ({ cart: r.data.data, cartItems: r.data.data.items, loading: !1 }));
2503
2505
  } catch (r) {
2504
2506
  throw console.error(r), t((o) => ({ ...o, error: r, loading: !1 })), r;
2505
2507
  }
@@ -5368,8 +5370,9 @@ function c4({ control: e, name: t, placeholder: n, className: r = "", checkboxPr
5368
5370
  }
5369
5371
  );
5370
5372
  }
5371
- function l4({ control: e, name: t, placeholder: n, className: r = "", options: o, selectClassName: a }) {
5372
- const { t: s } = Zn(), i = () => n || (t ? s(`fields.${t}`) : "");
5373
+ function l4({ control: e, name: t, placeholder: n, className: r = "", options: o, selectClassName: a, onValueChange: s = () => {
5374
+ } }) {
5375
+ const { t: i } = Zn(), c = () => n || (t ? i(`fields.${t}`) : "");
5373
5376
  return /* @__PURE__ */ f(
5374
5377
  Yo,
5375
5378
  {
@@ -5377,14 +5380,16 @@ function l4({ control: e, name: t, placeholder: n, className: r = "", options: o
5377
5380
  name: t,
5378
5381
  className: r,
5379
5382
  withinControl: !0,
5380
- render: (c) => /* @__PURE__ */ Q(
5383
+ render: (u) => /* @__PURE__ */ Q(
5381
5384
  kd,
5382
5385
  {
5383
- onValueChange: c.onChange,
5384
- defaultValue: c.value,
5386
+ onValueChange: (d) => {
5387
+ u.onChange(d), s(d);
5388
+ },
5389
+ defaultValue: u.value,
5385
5390
  children: [
5386
- /* @__PURE__ */ f(pu, { children: /* @__PURE__ */ f(Ld, { className: a, children: /* @__PURE__ */ f(Id, { placeholder: i() }) }) }),
5387
- /* @__PURE__ */ f($d, { children: o.map((u) => /* @__PURE__ */ f(Fd, { value: u.value, children: u.label }, u.value)) })
5391
+ /* @__PURE__ */ f(pu, { children: /* @__PURE__ */ f(Ld, { className: a, children: /* @__PURE__ */ f(Id, { placeholder: c() }) }) }),
5392
+ /* @__PURE__ */ f($d, { children: o.map((d) => /* @__PURE__ */ f(Fd, { value: d.value, children: d.label }, d.value)) })
5388
5393
  ]
5389
5394
  }
5390
5395
  )
@@ -33,16 +33,26 @@ export interface CoreShippingCalculationForm {
33
33
  disabled: boolean;
34
34
  }
35
35
  export interface CoreShippingAddress extends BaseType {
36
- label: string;
37
36
  address: string;
37
+ }
38
+ export interface CoreShippingAddressLocalPickup extends CoreShippingAddress {
39
+ }
40
+ export interface CoreShippingAddressHomeDelivery extends CoreShippingAddress {
41
+ label: string;
42
+ is_default: boolean;
43
+ }
44
+ export interface CoreShippingAddressProvinceMunicipality extends CoreShippingAddressHomeDelivery {
38
45
  province: string;
39
46
  municipality: string;
40
- is_default: boolean;
41
47
  }
42
48
  export interface CoreShippingAddressForm extends BaseType {
43
- label: string;
44
49
  address: string;
50
+ }
51
+ export interface CoreShippingAddressHomeDeliveryForm extends CoreShippingAddressForm {
52
+ label: string;
53
+ is_default: boolean;
54
+ }
55
+ export interface CoreShippingAddressProvinceMunicipalityForm extends CoreShippingAddressHomeDeliveryForm {
45
56
  province: string;
46
57
  municipality: string;
47
- is_default: boolean;
48
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ingeniuscliq-core",
3
- "version": "0.3.33",
3
+ "version": "0.3.35",
4
4
  "description": "IngeniusCliq Core UI y lógica compartida",
5
5
  "license": "MIT",
6
6
  "type": "module",