bukazu-portal-react 3.1.16 → 3.1.17

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.
@@ -27079,15 +27079,18 @@ function UV({
27079
27079
  }) {
27080
27080
  const { insurances: t, required_costs: n } = e.total_costs, { not_on_site: r } = n;
27081
27081
  return /* @__PURE__ */ f("div", { className: "costs-section", children: /* @__PURE__ */ f("table", { children: /* @__PURE__ */ M("tbody", { children: [
27082
- t.cancel_insurance && /* @__PURE__ */ f(pt, { children: Object.keys(t).map((a) => /* @__PURE__ */ f(
27083
- St,
27084
- {
27085
- name: a,
27086
- formatName: !0,
27087
- amount: t[a]
27088
- },
27089
- a
27090
- )) }),
27082
+ t && /* @__PURE__ */ f(pt, { children: Object.keys(t).map((a) => {
27083
+ if (t[a] > 0)
27084
+ return /* @__PURE__ */ f(
27085
+ St,
27086
+ {
27087
+ name: a,
27088
+ formatName: !0,
27089
+ amount: t[a]
27090
+ },
27091
+ a
27092
+ );
27093
+ }) }),
27091
27094
  e.required_house_costs.map((a) => {
27092
27095
  if (!a.on_site && a.gl !== "0120")
27093
27096
  return a.method === "none" ? /* @__PURE__ */ f(St, { ...a }, a.id) : a.amount === 0 ? null : /* @__PURE__ */ f(
@@ -519,7 +519,7 @@ See https://reactjs.org/docs/forms.html#controlled-components`),F=H.initialPage?
519
519
  price
520
520
  }
521
521
  }
522
- `,bb=({errors:e,house:t,options:n,values:r})=>{var a,i;if(t.discounts&&t.discounts!=="0"||(a=n.bookingForm)!=null&&a.showDiscountCode){let o=t.discounts?t.discounts.split(","):[];return R("div",{className:"form-section",children:[t.discounts&&t.discounts!=="0"&&R(dt,{children:[R("div",{className:"form-row inline",children:[f("label",{htmlFor:"discount",children:f(J,{id:"discount"})}),f(Nt,{component:"select",name:"discount",children:o.map(s=>R("option",{value:s,children:[s,"%"]},s))})]}),R("div",{className:"form-row inline",children:[f("label",{htmlFor:"discount_reason",children:f(J,{id:"discount_reason"})}),f(Nt,{name:"discount_reason"}),e.discount_reason&&f("div",{className:"error-message bu-error-message",children:e.discount_reason})]}),f("div",{children:f("i",{style:{fontSize:14},children:t.discounts_info})})]}),((i=n.bookingForm)==null?void 0:i.showDiscountCode)&&f(dV,{errors:e,house:t,values:r})]})}else return null};bb.propTypes={house:T.object.isRequired,errors:T.object.isRequired};const wb=({error:e})=>e?f("div",{className:"input-feedback",children:e}):null;wb.propTypes={error:T.object};const Qf=({field:{name:e,value:t,onChange:n,onBlur:r},id:a,label:i,...o})=>R("div",{children:[f("input",{name:e,id:a,type:"radio",value:a,checked:a===t,onChange:n,onBlur:r,className:"radio-button",...o}),f("label",{htmlFor:a,children:i})]});Qf.propTypes={field:T.object,id:T.string,label:T.object};const Ob=({error:e,touched:t,label:n,className:r,children:a})=>R("div",{className:r,children:[f("div",{className:"legend",children:n}),a,t&&f(wb,{error:e})]});Ob.propTypes={error:T.object,touched:T.object,className:T.string,label:T.string,children:T.node.isRequired};function pV({house:e}){return f(dt,{children:e.allow_option&&f("div",{children:R(Ob,{id:"is_option",className:"booking_option",children:[f(Nt,{component:Qf,name:"is_option",id:"true",disabled:!e.allow_option,label:f(J,{id:"option"})}),f(Nt,{component:Qf,name:"is_option",id:"false",label:f(J,{id:"booking"})})]})})})}function mV({description:e}){let t=f("span",{});return e&&(t=f("span",{style:{padding:"0 0 0 8px"},children:f(sn,{buttonText:f(ns,{}),children:f("p",{children:e})})})),t}function wt({name:e,amount:t,description:n,method_name:r,formatName:a,forceMethod:i}){return R("tr",{children:[R("td",{children:[a?f(J,{id:e}):e,n&&R(dt,{children:[" ",f(mV,{description:n})]})]}),f("td",{className:"price",children:t&&t>0?R(dt,{children:["€"," ",f(kn,{value:t,minimumFractionDigits:2,maximumFractionDigits:2}),i&&R(dt,{children:[" ",r]})]}):f(dt,{children:r})})]})}wt.defaultValues={formatName:!1,forceMethod:!1};function vV({prices:e}){const{insurances:t,required_costs:n}=e.total_costs,{not_on_site:r}=n;return f("div",{className:"costs-section",children:f("table",{children:R("tbody",{children:[t.cancel_insurance&&f(dt,{children:Object.keys(t).map(a=>f(wt,{name:a,formatName:!0,amount:t[a]},a))}),e.required_house_costs.map(a=>{if(!a.on_site&&a.gl!=="0120")return a.method==="none"?f(wt,{...a},a.id):a.amount===0?null:f(wt,{...a,amount:r==null?void 0:r.find(i=>i.id==a.id).amount},a.id)})]})})})}const yV=yt`
522
+ `,bb=({errors:e,house:t,options:n,values:r})=>{var a,i;if(t.discounts&&t.discounts!=="0"||(a=n.bookingForm)!=null&&a.showDiscountCode){let o=t.discounts?t.discounts.split(","):[];return R("div",{className:"form-section",children:[t.discounts&&t.discounts!=="0"&&R(dt,{children:[R("div",{className:"form-row inline",children:[f("label",{htmlFor:"discount",children:f(J,{id:"discount"})}),f(Nt,{component:"select",name:"discount",children:o.map(s=>R("option",{value:s,children:[s,"%"]},s))})]}),R("div",{className:"form-row inline",children:[f("label",{htmlFor:"discount_reason",children:f(J,{id:"discount_reason"})}),f(Nt,{name:"discount_reason"}),e.discount_reason&&f("div",{className:"error-message bu-error-message",children:e.discount_reason})]}),f("div",{children:f("i",{style:{fontSize:14},children:t.discounts_info})})]}),((i=n.bookingForm)==null?void 0:i.showDiscountCode)&&f(dV,{errors:e,house:t,values:r})]})}else return null};bb.propTypes={house:T.object.isRequired,errors:T.object.isRequired};const wb=({error:e})=>e?f("div",{className:"input-feedback",children:e}):null;wb.propTypes={error:T.object};const Qf=({field:{name:e,value:t,onChange:n,onBlur:r},id:a,label:i,...o})=>R("div",{children:[f("input",{name:e,id:a,type:"radio",value:a,checked:a===t,onChange:n,onBlur:r,className:"radio-button",...o}),f("label",{htmlFor:a,children:i})]});Qf.propTypes={field:T.object,id:T.string,label:T.object};const Ob=({error:e,touched:t,label:n,className:r,children:a})=>R("div",{className:r,children:[f("div",{className:"legend",children:n}),a,t&&f(wb,{error:e})]});Ob.propTypes={error:T.object,touched:T.object,className:T.string,label:T.string,children:T.node.isRequired};function pV({house:e}){return f(dt,{children:e.allow_option&&f("div",{children:R(Ob,{id:"is_option",className:"booking_option",children:[f(Nt,{component:Qf,name:"is_option",id:"true",disabled:!e.allow_option,label:f(J,{id:"option"})}),f(Nt,{component:Qf,name:"is_option",id:"false",label:f(J,{id:"booking"})})]})})})}function mV({description:e}){let t=f("span",{});return e&&(t=f("span",{style:{padding:"0 0 0 8px"},children:f(sn,{buttonText:f(ns,{}),children:f("p",{children:e})})})),t}function wt({name:e,amount:t,description:n,method_name:r,formatName:a,forceMethod:i}){return R("tr",{children:[R("td",{children:[a?f(J,{id:e}):e,n&&R(dt,{children:[" ",f(mV,{description:n})]})]}),f("td",{className:"price",children:t&&t>0?R(dt,{children:["€"," ",f(kn,{value:t,minimumFractionDigits:2,maximumFractionDigits:2}),i&&R(dt,{children:[" ",r]})]}):f(dt,{children:r})})]})}wt.defaultValues={formatName:!1,forceMethod:!1};function vV({prices:e}){const{insurances:t,required_costs:n}=e.total_costs,{not_on_site:r}=n;return f("div",{className:"costs-section",children:f("table",{children:R("tbody",{children:[t&&f(dt,{children:Object.keys(t).map(a=>{if(t[a]>0)return f(wt,{name:a,formatName:!0,amount:t[a]},a)})}),e.required_house_costs.map(a=>{if(!a.on_site&&a.gl!=="0120")return a.method==="none"?f(wt,{...a},a.id):a.amount===0?null:f(wt,{...a,amount:r==null?void 0:r.find(i=>i.id==a.id).amount},a.id)})]})})})}const yV=yt`
523
523
  query BookingPriceTotalQuery(
524
524
  $id: ID!
525
525
  $house_id: String!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bukazu-portal-react",
3
- "version": "3.1.16",
3
+ "version": "3.1.17",
4
4
  "description": "A package for loading the calendar and search module from bukazu loading into a react app.",
5
5
  "repository": "https://github.com/BUKAZU/React-portal",
6
6
  "scripts": {
@@ -7,6 +7,7 @@ interface Props {
7
7
  total_costs: {
8
8
  insurances: {
9
9
  cancel_insurance: number;
10
+ insurance_costs: number;
10
11
  };
11
12
  required_costs: {
12
13
  not_on_site: CostType[];
@@ -21,20 +22,25 @@ export default function InsurancesAndRequired({
21
22
  }: Props): React.ReactNode {
22
23
  const { insurances, required_costs } = prices.total_costs;
23
24
  const { not_on_site } = required_costs;
25
+
24
26
  return (
25
27
  <div className="costs-section">
26
28
  <table>
27
29
  <tbody>
28
- {insurances.cancel_insurance && (
30
+ {insurances && (
29
31
  <>
30
- {Object.keys(insurances).map((key) => (
31
- <CostRow
32
- name={key}
33
- key={key}
34
- formatName={true}
35
- amount={insurances[key]}
36
- />
37
- ))}
32
+ {Object.keys(insurances).map((key: string) => {
33
+ if (insurances[key] > 0) {
34
+ return (
35
+ <CostRow
36
+ name={key}
37
+ key={key}
38
+ formatName={true}
39
+ amount={insurances[key]}
40
+ />
41
+ );
42
+ }
43
+ })}
38
44
  </>
39
45
  )}
40
46
  {prices.required_house_costs.map((cost) => {