hemfixarna-web-components 1.3.5 → 1.3.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.
- package/dist/cjs/{hemfixarna-address_22.cjs.entry.js → hemfixarna-address_24.cjs.entry.js} +201 -33
- package/dist/{esm/hemfixarna-address_22.entry.js.map → cjs/hemfixarna-address_24.cjs.entry.js.map} +1 -1
- package/dist/cjs/hemfixarna-components.cjs.js +2 -2
- package/dist/cjs/{index-d9e286dc.js → index-83c1daf2.js} +5 -1
- package/dist/{esm/index-9863db6c.js.map → cjs/index-83c1daf2.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/assets/drag-drop.svg +3 -0
- package/dist/collection/collection-manifest.json +10 -8
- package/dist/collection/components/{hemfixarna-byggmax → customers/hemfixarna-byggmax}/hemfixarna-byggmax.js +2 -2
- package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js.map +1 -0
- package/dist/collection/components/{hemfixarna-doro → customers/hemfixarna-doro}/hemfixarna-doro.js +2 -2
- package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js +123 -0
- package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js.map +1 -0
- package/dist/collection/components/{hemfixarna-forebygg → customers/hemfixarna-forebygg}/hemfixarna-forebygg.js +2 -2
- package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js.map +1 -0
- package/dist/collection/components/{hemfixarna-hornbach → customers/hemfixarna-hornbach}/hemfixarna-hornbach.js +2 -2
- package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js.map +1 -0
- package/dist/collection/components/{hemfixarna-kund → customers/hemfixarna-kund}/hemfixarna-kund.js +2 -2
- package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js.map +1 -0
- package/dist/collection/components/{hemfixarna-skanska → customers/hemfixarna-skanska}/hemfixarna-skanska.js +2 -2
- package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js.map +1 -0
- package/dist/collection/components/{hemfixarna-string → customers/hemfixarna-string}/hemfixarna-string-furniture.js +2 -2
- package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string.css +0 -0
- package/dist/collection/components/hemfixarna-box/hemfixarna-box.js +1 -1
- package/dist/collection/components/hemfixarna-box/hemfixarna-box.js.map +1 -1
- package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js.map +1 -1
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +5 -5
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +1 -1
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js +1 -1
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -1
- package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.css +76 -0
- package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.js +164 -0
- package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.js.map +1 -0
- package/dist/collection/components/hemfixarna-order/hemfixarna-order.js +1 -1
- package/dist/collection/components/hemfixarna-order/hemfixarna-order.js.map +1 -1
- package/dist/collection/components/hemfixarna-product/hemfixarna-product.js +3 -3
- package/dist/collection/components/hemfixarna-product/hemfixarna-product.js.map +1 -1
- package/dist/collection/components/hemfixarna-service/hemfixarna-service.js +1 -1
- package/dist/collection/components/hemfixarna-service/hemfixarna-service.js.map +1 -1
- package/dist/collection/components/hemfixarna-start/hemfixarna-start.js.map +1 -1
- package/dist/collection/store/index.js +1 -0
- package/dist/collection/store/index.js.map +1 -1
- package/dist/collection/types/index.js +1 -0
- package/dist/collection/types/index.js.map +1 -1
- package/dist/esm/{hemfixarna-address_22.entry.js → hemfixarna-address_24.entry.js} +197 -31
- package/dist/{cjs/hemfixarna-address_22.cjs.entry.js.map → esm/hemfixarna-address_24.entry.js.map} +1 -1
- package/dist/esm/hemfixarna-components.js +3 -3
- package/dist/esm/{index-9863db6c.js → index-1fd61928.js} +5 -1
- package/dist/{cjs/index-d9e286dc.js.map → esm/index-1fd61928.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/hemfixarna-components/assets/drag-drop.svg +3 -0
- package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -1
- package/dist/hemfixarna-components/{p-62a7c1a2.js → p-33d37833.js} +3 -3
- package/dist/hemfixarna-components/p-e1950643.entry.js +2 -0
- package/dist/types/components/{hemfixarna-byggmax → customers/hemfixarna-byggmax}/hemfixarna-byggmax.d.ts +1 -1
- package/dist/types/components/{hemfixarna-doro → customers/hemfixarna-doro}/hemfixarna-doro.d.ts +1 -1
- package/dist/types/components/customers/hemfixarna-elfa/hemfixarna-elfa.d.ts +9 -0
- package/dist/types/components/{hemfixarna-forebygg → customers/hemfixarna-forebygg}/hemfixarna-forebygg.d.ts +1 -1
- package/dist/types/components/{hemfixarna-hornbach → customers/hemfixarna-hornbach}/hemfixarna-hornbach.d.ts +1 -1
- package/dist/types/components/{hemfixarna-kund → customers/hemfixarna-kund}/hemfixarna-kund.d.ts +1 -1
- package/dist/types/components/{hemfixarna-skanska → customers/hemfixarna-skanska}/hemfixarna-skanska.d.ts +1 -1
- package/dist/types/components/{hemfixarna-string → customers/hemfixarna-string}/hemfixarna-string-furniture.d.ts +1 -1
- package/dist/types/components/hemfixarna-demo/hemfixarna-demo.d.ts +1 -1
- package/dist/types/components/hemfixarna-invoice/hemfixarna-invoice.d.ts +17 -0
- package/dist/types/components.d.ts +36 -0
- package/dist/types/store/index.d.ts +1 -0
- package/dist/types/types/index.d.ts +6 -1
- package/package.json +1 -1
- package/dist/collection/components/hemfixarna-byggmax/hemfixarna-byggmax.js.map +0 -1
- package/dist/collection/components/hemfixarna-doro/hemfixarna-doro.js.map +0 -1
- package/dist/collection/components/hemfixarna-forebygg/hemfixarna-forebygg.js.map +0 -1
- package/dist/collection/components/hemfixarna-hornbach/hemfixarna-hornbach.js.map +0 -1
- package/dist/collection/components/hemfixarna-kund/hemfixarna-kund.js.map +0 -1
- package/dist/collection/components/hemfixarna-skanska/hemfixarna-skanska.js.map +0 -1
- package/dist/collection/components/hemfixarna-string/hemfixarna-string-furniture.js.map +0 -1
- package/dist/hemfixarna-components/p-d5da3c5b.entry.js +0 -2
- /package/dist/collection/components/{hemfixarna-byggmax → customers/hemfixarna-byggmax}/hemfixarna-byggmax.css +0 -0
- /package/dist/collection/components/{hemfixarna-doro → customers/hemfixarna-doro}/hemfixarna-doro.css +0 -0
- /package/dist/collection/components/{hemfixarna-forebygg/hemfixarna-forebygg.css → customers/hemfixarna-elfa/hemfixarna-elfa.css} +0 -0
- /package/dist/collection/components/{hemfixarna-hornbach/hemfixarna-hornbach.css → customers/hemfixarna-forebygg/hemfixarna-forebygg.css} +0 -0
- /package/dist/collection/components/{hemfixarna-skanska/hemfixarna-skanska.css → customers/hemfixarna-hornbach/hemfixarna-hornbach.css} +0 -0
- /package/dist/collection/components/{hemfixarna-string/hemfixarna-string.css → customers/hemfixarna-skanska/hemfixarna-skanska.css} +0 -0
- /package/dist/hemfixarna-components/{p-62a7c1a2.js.map → p-33d37833.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-d5da3c5b.entry.js.map → p-e1950643.entry.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hemfixarna-start.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-start/hemfixarna-start.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"hemfixarna-start.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-start/hemfixarna-start.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,K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uBAAuB,IAC9B,IAAI,CAAC,IAAI,CAAC,QAAQ;WAChB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;WAC1C,GAAG,CAAC,CAAC,CAAC,EAAE;;UAAC,OAAA,CACR,sBAAgB,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAC,CAAC,CAAC,IAAa,CAAC,GAAG,mCAAK,CAAC,CAAC,IAAe,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,GAAmB,CAChH,CAAA;SAAA,CAAC,CACD;QACL,uBAAiB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,GAAI,CAC1C,CACF,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport state from '../../store';\nimport { Category, CustomerCategory, CustomerSubCategory, Icon } from '../../types';\n\n@Component({\n tag: 'hemfixarna-start',\n shadow: false,\n})\nexport class HemfixarnaGrid {\n @Prop() tree?: Category;\n @Prop() slug?: string;\n\n isMainCategory(category: CustomerCategory | CustomerSubCategory): category is CustomerCategory {\n return (category as CustomerCategory).show_products !== undefined;\n }\n\n render() {\n return state.customer ? (\n <div>\n <h2>{state.selectedCustomerCategory ? state.selectedCustomerCategory.name : 'Alla tjänster'}</h2>\n <div class=\"hemfixarna_categories--wrapper\">\n <ul class=\"hemfixarna_categories\">\n {state.selectedCustomerCategory\n ? this.isMainCategory(state.selectedCustomerCategory) && state.selectedCustomerCategory.sub_categories && !state.selectedCustomerCategory.show_products\n ? state.selectedCustomerCategory.sub_categories.map(c => <hemfixarna-box category={c}></hemfixarna-box>)\n : state.selectedCustomerCategory.products\n ? state.selectedCustomerCategory.products.map(c => <hemfixarna-box category={c.fields}></hemfixarna-box>)\n : null\n : state.customer.categories.map(c => <hemfixarna-box category={c}></hemfixarna-box>)}\n </ul>\n <hemfixarna-info list={state.options.trust} />\n </div>\n </div>\n ) : (\n <div>\n <h2>Alla tjänster</h2>\n <div class=\"hemfixarna_categories--wrapper\">\n <ul class=\"hemfixarna_categories\">\n {this.tree.sub_cats\n .sort((a, b) => (a.name < b.name ? -1 : 1))\n .map(c => (\n <hemfixarna-box post={c} icon={(c.icon as Icon).url ?? (c.icon as string)} postTitle={c.name}></hemfixarna-box>\n ))}\n </ul>\n <hemfixarna-info list={state.options.trust} />\n </div>\n </div>\n );\n }\n}\n"]}
|
@@ -20,6 +20,7 @@ const { state, onChange, } = createStore({
|
|
20
20
|
selectedCustomerCategory: null,
|
21
21
|
parentCategory: null,
|
22
22
|
creditSafeUser: null,
|
23
|
+
checkoutInvoice: false,
|
23
24
|
});
|
24
25
|
onChange('cart', cart => {
|
25
26
|
window.sessionStorage.setItem(`hemfixarna-${state.business}-cart`, JSON.stringify(cart));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAgC7C,MAAM,EACJ,KAAK,EACL,QAAQ,GACT,GAGG,WAAW,CAAC;EACd,IAAI,EAAE,CAAC;EACP,YAAY,EAAE,CAAC;EACf,YAAY,EAAE,KAAK;EACnB,gBAAgB,EAAE,IAAI;EACtB,eAAe,EAAE,IAAI;EACrB,eAAe,EAAE,IAAI;EACrB,IAAI,EAAE,EAAE;EACR,QAAQ,EAAE,WAAW;EACrB,OAAO,EAAE,IAAI;EACb,GAAG,EAAE,IAAI;EACT,GAAG,EAAE,IAAI;EACT,KAAK,EAAE,I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GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;EACtE,IAAI,QAAQ,EAAE;IACZ,KAAK,CAAC,cAAc,GAAG,QAAQ,CAAC;IAChC,OAAO;GACR;EACD,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,0BAA0B,EAAE,QAAQ,CAAC,EAAE;EAC9C,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,QAAQ;IAAE,OAAO;EACzC,IAAK,QAAgC,CAAC,MAAM,EAAE;IAC5C,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAM,QAAgC,CAAC,MAAM,CAAC,CAAC;IACtG,IAAI,MAAM,EAAE;MACV,KAAK,CAAC,cAAc,GAAG,MAAM,CAAC;MAC9B,OAAO;KACR;GACF;EACD,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["import { createStore } from '@stencil/store';\nimport { OnChangeHandler } from '@stencil/store/dist/types';\nimport { Business, CartItem, Category, Customer, CustomerCategory, CustomerSubCategory, Product, RotOptions, RutOptions, Service, User, WpOptions } from '../types';\nimport { CreditSafeUser } from '../types/felixtypes';\n\ntype StateType = {\n step: number;\n selectedCategory: Category | null;\n selectedService: Service | null;\n selectedProduct: Product | null;\n cart: Array<CartItem>;\n business: Business | 'undefined';\n options: WpOptions | null;\n rut: boolean;\n rot: boolean;\n token: string | null;\n checkoutStep: number;\n checkoutEdit: boolean;\n user: User | null;\n creditSafeUser: CreditSafeUser | null;\n modal: {\n title?: string;\n text: string[];\n } | null;\n rutOptions: RutOptions | null;\n rotOptions: RotOptions | null;\n customer: Customer | null;\n selectedCustomerCategory: CustomerCategory | CustomerSubCategory | null;\n parentCategory: CustomerCategory | CustomerSubCategory;\n checkoutInvoice: boolean;\n};\n\nconst {\n state,\n onChange,\n}: {\n state: StateType;\n onChange: OnChangeHandler<StateType>;\n} = createStore({\n step: 1,\n checkoutStep: 1,\n checkoutEdit: false,\n selectedCategory: null,\n selectedService: null,\n selectedProduct: null,\n cart: [],\n business: 'undefined',\n options: null,\n rut: true,\n rot: true,\n token: null,\n user: null,\n modal: null,\n rutOptions: null,\n rotOptions: null,\n customer: null,\n selectedCustomerCategory: null,\n parentCategory: null,\n creditSafeUser: null,\n checkoutInvoice: false,\n});\n\nonChange('cart', cart => {\n window.sessionStorage.setItem(`hemfixarna-${state.business}-cart`, JSON.stringify(cart));\n});\n\nonChange('user', user => {\n window.sessionStorage.setItem(`hemfixarna-${state.business}-user`, JSON.stringify(user));\n});\n\nonChange('creditSafeUser', user => {\n window.sessionStorage.setItem(`hemfixarna-${state.business}-creditSafeUser`, JSON.stringify(user));\n});\n\nonChange('selectedProduct', product => {\n if (!state.customer || !product) return;\n const categories = [...state.customer.categories, ...state.customer.categories.map(c => c.sub_categories ?? [])].flat();\n const category = categories.find(c => c && c.id === product.category);\n if (category) {\n state.parentCategory = category;\n return;\n }\n state.parentCategory = null;\n});\n\nonChange('selectedCustomerCategory', category => {\n if (!state.customer || !category) return;\n if ((category as CustomerSubCategory).parent) {\n const parent = state.customer.categories.find(c => c.id === (category as CustomerSubCategory).parent);\n if (parent) {\n state.parentCategory = parent;\n return;\n }\n }\n state.parentCategory = null;\n});\n\nexport default state;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AA8KA,MAAM,CAAN,IAAY,QASX;AATD,WAAY,QAAQ;EAClB,yBAAa,CAAA;EACb,+BAAmB,CAAA;EACnB,+BAAmB,CAAA;EACnB,uCAA2B,CAAA;EAC3B,iCAAqB,CAAA;EACrB,iCAAqB,CAAA;EACrB,yBAAa,CAAA;EACb,yBAAa,CAAA;AACf,CAAC,EATW,QAAQ,KAAR,QAAQ,QASnB;AAED,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;EACrB,oCAAqB,CAAA;EACrB,0CAA2B,CAAA;EAC3B,8CAA+B,CAAA;EAC/B,8CAA+B,CAAA;AACjC,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED,MAAM,CAAN,IAAY,WAEX;AAFD,WAAY,WAAW;EACrB,wCAAyB,CAAA;AAC3B,CAAC,EAFW,WAAW,KAAX,WAAW,QAEtB","sourcesContent":["type Icon = {\n url: string;\n};\n\ninterface Customer {\n ID: number;\n post_title: 'Byggmax';\n post_name: 'byggmax';\n post_type: 'customer';\n filter: 'raw';\n categories: CustomerCategory[];\n}\n\ninterface CustomerCategory {\n id: string;\n name: string;\n icon: string;\n show_products: boolean;\n products: { fields: Product }[] | false;\n sub_categories: CustomerSubCategory[] | false;\n}\n\ninterface CustomerSubCategory {\n id: string;\n name: string;\n icon: string;\n products: { fields: Product }[];\n parent: string;\n}\n\ninterface Part {\n ID: number;\n post_author: number;\n post_date: Date;\n post_date_gmt: Date;\n post_content: string;\n post_title: string;\n post_excerpt: string;\n post_status: string;\n comment_status: string;\n ping_status: string;\n post_password: string;\n post_name: string;\n to_ping: string;\n pinged: string;\n post_modified: Date;\n post_modified_gmt: Date;\n post_content_filtered: string;\n post_parent: 0 | 1;\n guid: string;\n menu_order: 0;\n post_type: string;\n post_mime_type: string;\n comment_count: number;\n filter: string;\n price: number;\n title: string;\n}\n\ninterface Product {\n ID: number;\n post_author: string;\n post_date: Date;\n post_date_gmt: Date;\n post_content: string;\n post_title: string;\n post_excerpt: string;\n post_status: string;\n comment_status: string;\n ping_status: string;\n post_password: string;\n post_name: string;\n to_ping: string;\n pinged: string;\n post_modified: Date;\n post_modified_gmt: Date;\n post_content_filtered: string;\n post_parent: 0;\n guid: string;\n menu_order: 0;\n post_type: string;\n post_mime_type: string;\n comment_count: 0;\n filter: string;\n price: number;\n icon?: Icon | string;\n parts?: Array<Part>;\n list: Array<{ bullet: string }>;\n terms: string;\n terms_checkout: string;\n terms_show_checkbox: boolean;\n rut: boolean;\n rot: boolean;\n hide_start_fee: boolean;\n description: string;\n category: string;\n title: string;\n invoice: string;\n invoice_price: string;\n invoice_description: string;\n}\n\ninterface Service {\n ID: 41857;\n icon?: Icon | string;\n post_author: 34419;\n post_date: Date;\n post_date_gmt: Date;\n post_content: string;\n post_title: string;\n post_excerpt: string;\n post_status: string;\n comment_status: string;\n ping_status: string;\n post_password: string;\n post_name: string;\n to_ping: string;\n pinged: string;\n post_modified: Date;\n post_modified_gmt: Date;\n post_content_filtered: string;\n post_parent: 0;\n guid: string;\n menu_order: 0;\n post_type: 'service';\n post_mime_type: string;\n comment_count: 0;\n filter: string;\n products: Array<Product>;\n}\n\ninterface Category {\n count: number;\n description: string;\n name: string;\n icon?: Icon | string;\n parent: 0 | 1;\n slug: string;\n taxonomy: 'service_cat';\n term_group: 0 | 1;\n term_id: number;\n term_order: string;\n term_taxonomy_id: number;\n sub_cats?: Array<Category>;\n services?: Array<Service>;\n}\n\ninterface WpOptions {\n link: { title: string; url: string };\n trust: { trust_badge: string }[];\n thank_you_image: string;\n start_fee: number;\n terms: string;\n}\ninterface CartPart {\n id: number;\n amount: number;\n price: number;\n name: string;\n}\n\ninterface CartItem {\n id: number;\n price: number;\n name: string;\n amount: number;\n parts: CartPart[];\n rut: boolean;\n rot: boolean;\n start_fee: boolean;\n terms_checkout: string;\n icon?: Icon | string;\n}\n\nexport enum Business {\n kund = 'kund',\n byggmax = 'byggmax',\n skanska = 'skanska',\n string = 'string-furniture',\n hornbach = 'hornbach',\n forebygg = 'forebygg',\n doro = 'doro',\n elfa = 'elfa',\n}\n\nexport enum WidgetStyle {\n standard = 'standard',\n alternative = 'alternative',\n alternative_2 = 'alternative_2',\n alternative_3 = 'alternative_3',\n}\n\nexport enum TopCategory {\n byggmax = 'category/bygg',\n}\n\ninterface User {\n email: string;\n phone: string;\n ssn: string;\n firstName: string;\n lastName: string;\n street: string;\n zip: string;\n town: string;\n}\n\ninterface RutOptions {\n rut_start_fee_heading: string;\n rut_start_fee_text: string;\n rut_start_fee_text_secondary: string;\n}\n\ninterface RotOptions {\n rot_start_fee_heading: string;\n rot_start_fee_text: string;\n rot_start_fee_text_secondary: string;\n}\n\nexport type { CartItem, CartPart, Category, Customer, CustomerCategory, CustomerSubCategory, Icon, Part, Product, RotOptions, RutOptions, Service, User, WpOptions };\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { g as getRenderingRef, f as forceUpdate, r as registerInstance, h, a as getElement, F as Fragment, c as getAssetPath } from './index-
|
1
|
+
import { g as getRenderingRef, f as forceUpdate, r as registerInstance, h, a as getElement, F as Fragment, c as getAssetPath } from './index-1fd61928.js';
|
2
2
|
|
3
3
|
const appendToMap = (map, propName, value) => {
|
4
4
|
const items = map.get(propName);
|
@@ -212,6 +212,7 @@ const { state, onChange, } = createStore({
|
|
212
212
|
selectedCustomerCategory: null,
|
213
213
|
parentCategory: null,
|
214
214
|
creditSafeUser: null,
|
215
|
+
checkoutInvoice: false,
|
215
216
|
});
|
216
217
|
onChange('cart', cart => {
|
217
218
|
window.sessionStorage.setItem(`hemfixarna-${state.business}-cart`, JSON.stringify(cart));
|
@@ -458,7 +459,7 @@ const HemfixarnaBox = class {
|
|
458
459
|
scrollToTop(el);
|
459
460
|
}
|
460
461
|
render() {
|
461
|
-
return this.category ? (h(Fragment, null, isProduct(this.category) ? (h("li", { onClick: () => this.setProduct() }, h("img", { class: "hemfixarna_logo", height: 82, src: this.category.icon, alt: this.category.post_name }), h("div", null, h("p", null, this.category.
|
462
|
+
return this.category ? (h(Fragment, null, isProduct(this.category) ? (h("li", { onClick: () => this.setProduct() }, h("img", { class: "hemfixarna_logo", height: 82, src: this.category.icon, alt: this.category.post_name }), h("div", null, h("p", null, this.category.title), !this.category.invoice ? h("p", { class: "price" }, "Fr\u00E5n ", getProductPrice(this.category), "kr") : null))) : (h("li", { onClick: () => (state.selectedCustomerCategory = this.category) }, h("img", { class: "hemfixarna_logo", height: 82, src: this.category.icon, alt: this.category.name }), h("div", null, h("p", null, this.category.name)))))) : (h("li", { onClick: () => this.setTaxonomy(this.post) }, this.post.icon && h("img", { class: "hemfixarna_logo", height: 82, src: this.icon, alt: this.postTitle }), h("div", null, h("p", null, this.postTitle), state.step === 3 && h("p", { class: "price" }, "Fr\u00E5n ", getProductPrice(this.post), "kr"))));
|
462
463
|
}
|
463
464
|
get el() { return getElement(this); }
|
464
465
|
};
|
@@ -521,6 +522,7 @@ var Business;
|
|
521
522
|
Business["hornbach"] = "hornbach";
|
522
523
|
Business["forebygg"] = "forebygg";
|
523
524
|
Business["doro"] = "doro";
|
525
|
+
Business["elfa"] = "elfa";
|
524
526
|
})(Business || (Business = {}));
|
525
527
|
var WidgetStyle;
|
526
528
|
(function (WidgetStyle) {
|
@@ -536,7 +538,7 @@ var TopCategory;
|
|
536
538
|
|
537
539
|
const hemfixarnaByggmaxCss = "";
|
538
540
|
|
539
|
-
const MyComponent$
|
541
|
+
const MyComponent$8 = class {
|
540
542
|
constructor(hostRef) {
|
541
543
|
registerInstance(this, hostRef);
|
542
544
|
this.tree = null;
|
@@ -553,7 +555,7 @@ const MyComponent$7 = class {
|
|
553
555
|
return (h("hemfixarna-component", { forceOldTree: this.forceOldTree, id: this.id, slug: this.slug, business: Business.byggmax, topCategory: TopCategory.byggmax, loadFromQuery: this.loadFromQuery, widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor }));
|
554
556
|
}
|
555
557
|
};
|
556
|
-
MyComponent$
|
558
|
+
MyComponent$8.style = hemfixarnaByggmaxCss;
|
557
559
|
|
558
560
|
const HemfixarnaCart = class {
|
559
561
|
constructor(hostRef) {
|
@@ -588,7 +590,7 @@ const HemfixarnaCategory = class {
|
|
588
590
|
}
|
589
591
|
};
|
590
592
|
|
591
|
-
const base$
|
593
|
+
const base$2 = `${"https://hemfixarna.se"}/wp-json/headless` ;
|
592
594
|
async function fetchWithType(request, options) {
|
593
595
|
const response = await fetch(request, options);
|
594
596
|
const body = await response.json();
|
@@ -601,7 +603,7 @@ const getTaxonomy = async (endpoint) => {
|
|
601
603
|
const type = endpoint.split('/')[0];
|
602
604
|
const slug = endpoint.split('/')[1];
|
603
605
|
try {
|
604
|
-
const res = await fetch(`${base$
|
606
|
+
const res = await fetch(`${base$2}/${type}/${slug}`);
|
605
607
|
return await res.json();
|
606
608
|
}
|
607
609
|
catch (error) {
|
@@ -610,7 +612,7 @@ const getTaxonomy = async (endpoint) => {
|
|
610
612
|
};
|
611
613
|
const getCustomer = async (slug) => {
|
612
614
|
try {
|
613
|
-
const res = await fetch(`${base$
|
615
|
+
const res = await fetch(`${base$2}/customer/${slug}`);
|
614
616
|
return await res.json();
|
615
617
|
}
|
616
618
|
catch (error) {
|
@@ -619,7 +621,7 @@ const getCustomer = async (slug) => {
|
|
619
621
|
};
|
620
622
|
const getOptions = async () => {
|
621
623
|
try {
|
622
|
-
const res = await fetch(`${base$
|
624
|
+
const res = await fetch(`${base$2}/webcoptions`);
|
623
625
|
return (await res.json());
|
624
626
|
}
|
625
627
|
catch (error) {
|
@@ -628,7 +630,7 @@ const getOptions = async () => {
|
|
628
630
|
};
|
629
631
|
const getRut = async () => {
|
630
632
|
try {
|
631
|
-
const data = await fetchWithType(`${base$
|
633
|
+
const data = await fetchWithType(`${base$2}/rut`);
|
632
634
|
return data;
|
633
635
|
}
|
634
636
|
catch (error) {
|
@@ -637,7 +639,7 @@ const getRut = async () => {
|
|
637
639
|
};
|
638
640
|
const getRot = async () => {
|
639
641
|
try {
|
640
|
-
const res = await fetch(`${base$
|
642
|
+
const res = await fetch(`${base$2}/rot`);
|
641
643
|
return (await res.json());
|
642
644
|
}
|
643
645
|
catch (error) {
|
@@ -659,7 +661,7 @@ const getRot = async () => {
|
|
659
661
|
// }
|
660
662
|
const postOrder = async (data) => {
|
661
663
|
try {
|
662
|
-
const res = await fetch(`${base$
|
664
|
+
const res = await fetch(`${base$2}/weborder`, {
|
663
665
|
method: 'POST',
|
664
666
|
body: JSON.stringify(data),
|
665
667
|
headers: {
|
@@ -673,10 +675,10 @@ const postOrder = async (data) => {
|
|
673
675
|
}
|
674
676
|
};
|
675
677
|
|
676
|
-
const base = `${"https://hemfixarna.se"}/wp-json/felix` ;
|
678
|
+
const base$1 = `${"https://hemfixarna.se"}/wp-json/felix` ;
|
677
679
|
const postPerson = async (felixOrder) => {
|
678
680
|
try {
|
679
|
-
return await fetchWithType(`${base}/createperson`, {
|
681
|
+
return await fetchWithType(`${base$1}/createperson`, {
|
680
682
|
method: 'POST',
|
681
683
|
body: JSON.stringify(felixOrder),
|
682
684
|
headers: {
|
@@ -1012,14 +1014,14 @@ const HemfixarnaComponent = class {
|
|
1012
1014
|
return state.cart.reduce((acc, curr) => acc + curr.amount, 0);
|
1013
1015
|
}
|
1014
1016
|
render() {
|
1015
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
1017
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
1016
1018
|
const logo = getAssetPath(`./assets/hemfixarna.svg`);
|
1017
1019
|
const monteringLogo = getAssetPath(`./assets/montering.svg`);
|
1018
1020
|
const navBackground = ((_a = this.nav) === null || _a === void 0 ? void 0 : _a.background) ? getAssetPath(this.nav.background) : '';
|
1019
1021
|
const navLogo = ((_b = this.nav) === null || _b === void 0 ? void 0 : _b.logo) ? getAssetPath(this.nav.logo) : '';
|
1020
|
-
return (h("div", { class: `hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}` }, this.loadFromQuery && !this.isDemo && this.nav ? (h("nav", { class: "hemfixarna_nav" }, h("div", null, h("div", { class: "hemfixarna_nav--logos" }, h("a", { href: this.nav.url, target: "_blank" }, h("img", { src: navLogo, alt: `${this.business} logo` })), h("a", { href: "https://hemfixarna.se/", target: "_blank" }, h("p", null, "I samarbete med:"), h("img", { src: logo, alt: "hemfixarna_logo", width: 104 }))), h("div", { class: "hemfixarna_nav--links" }, h("a", { href: this.nav.url, target: "_blank" }, "Till ", this.business), h("a", { href: "https://www.hemfixarna.se/", target: "_blank" }, "Till Hemfixarna")), h("img", { src: navBackground, alt: "nav_background" })))) : null, !this.loadFromQuery || this.isDemo ? (h("div", { class: `hemfixarna_box hemfixarna_box--${this.widgetStyle}` }, [WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? h("img", { src: monteringLogo, alt: "montering logo", width: 32, height: 32 }) : null, h("div", null, h("div", null, h("p", { onClick: () => this.openModal(), class: `pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}` }, ((_c = this.product) === null || _c === void 0 ? void 0 : _c.post_title) || ((_d = this.proppedProduct) === null || _d === void 0 ? void 0 : _d.post_title) || (h("span", null, "Montering", h("wbr", null), "/Installation ", (_f = (_e = state.selectedCustomerCategory) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : 'på plats', " - ", h("strong", { class: "underline" }, "se priser h\u00E4r"))), (this.product && ((_g = this.slug) === null || _g === void 0 ? void 0 : _g.includes('product'))) || this.proppedProduct ? (h("span", null, ' från', " ", h("strong", null, getProductPriceWithRotAndRut(this.proppedProduct || this.product), "kr"))) : null)), this.widgetStyle === WidgetStyle.standard ? h("img", { src: logo, width: 104 }) : null, this.widgetStyle === WidgetStyle.alternative ? (h("span", { class: "p-s" }, "Utf\u00F6rs av ", h("strong", null, "Hemfixarna"))) : null), [WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (h("button", { onClick: () => this.openModal(), class: "hemfixarna_btn", style: {
|
1021
|
-
color: ((
|
1022
|
-
backgroundColor: ((
|
1022
|
+
return (h("div", { class: `hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}` }, this.loadFromQuery && !this.isDemo && this.nav ? (h("nav", { class: "hemfixarna_nav" }, h("div", null, h("div", { class: "hemfixarna_nav--logos" }, h("a", { href: this.nav.url, target: "_blank" }, h("img", { src: navLogo, alt: `${this.business} logo` })), h("a", { href: "https://hemfixarna.se/", target: "_blank" }, h("p", null, "I samarbete med:"), h("img", { src: logo, alt: "hemfixarna_logo", width: 104 }))), h("div", { class: "hemfixarna_nav--links" }, h("a", { href: this.nav.url, target: "_blank" }, "Till ", this.business), h("a", { href: "https://www.hemfixarna.se/", target: "_blank" }, "Till Hemfixarna")), h("img", { src: navBackground, alt: "nav_background" })))) : null, !this.loadFromQuery || this.isDemo ? (h("div", { class: `hemfixarna_box hemfixarna_box--${this.widgetStyle}` }, [WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? h("img", { src: monteringLogo, alt: "montering logo", width: 32, height: 32 }) : null, h("div", null, h("div", null, h("p", { onClick: () => this.openModal(), class: `pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}` }, ((_c = this.product) === null || _c === void 0 ? void 0 : _c.post_title) || ((_d = this.proppedProduct) === null || _d === void 0 ? void 0 : _d.post_title) || (h("span", null, "Montering", h("wbr", null), "/Installation ", (_f = (_e = state.selectedCustomerCategory) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : 'på plats', " - ", h("strong", { class: "underline" }, "se priser h\u00E4r"))), (this.product && ((_g = this.slug) === null || _g === void 0 ? void 0 : _g.includes('product'))) || (this.proppedProduct && !((_h = this.product) === null || _h === void 0 ? void 0 : _h.invoice) && !((_j = this.proppedProduct) === null || _j === void 0 ? void 0 : _j.invoice)) ? (h("span", null, ' från', " ", h("strong", null, getProductPriceWithRotAndRut(this.proppedProduct || this.product), "kr"))) : null, ((_k = this.product) === null || _k === void 0 ? void 0 : _k.invoice) || ((_l = this.proppedProduct) === null || _l === void 0 ? void 0 : _l.invoice) ? (h("span", null, ' - ', h("strong", { class: "underling" }, "se priser h\u00E4r"))) : null)), this.widgetStyle === WidgetStyle.standard ? h("img", { src: logo, width: 104 }) : null, this.widgetStyle === WidgetStyle.alternative ? (h("span", { class: "p-s" }, "Utf\u00F6rs av ", h("strong", null, "Hemfixarna"))) : null), [WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (h("button", { onClick: () => this.openModal(), class: "hemfixarna_btn", style: {
|
1023
|
+
color: ((_m = this.buttonColor) === null || _m === void 0 ? void 0 : _m.startsWith('#')) || !((_o = this.buttonColor) === null || _o === void 0 ? void 0 : _o.length) ? this.buttonColor : `#${this.buttonColor}`,
|
1024
|
+
backgroundColor: ((_p = this.buttonBg) === null || _p === void 0 ? void 0 : _p.startsWith('#')) || !((_q = this.buttonBg) === null || _q === void 0 ? void 0 : _q.length) ? this.buttonBg : `#${this.buttonBg}`,
|
1023
1025
|
} }, "Best\u00E4ll h\u00E4r", this.getCartLength() > 0 && h("span", null, this.getCartLength()))) : null, WidgetStyle.alternative_2 === this.widgetStyle ? (h("div", { class: "hemfixarna_altbtn" }, h("strong", { class: "p-s" }, "Utf\u00F6rs av"), h("img", { src: logo, alt: "hemfixarna logo", width: 98 }))) : null)) : null, this.modal && (h("div", null, h("div", { class: `hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}` }, state.modal && (h("div", { class: "hemfixarna_infomodal" }, state.modal.title && h("h2", null, state.modal.title), state.modal.text.map((t) => (h("p", { innerHTML: t }))), h("div", null, h("button", { onClick: () => (state.modal = null) }, "St\u00E4ng")))), (this.tree || state.customer) && (h("hemfixarna-breadcrumbs", { isDemo: this.isDemo, loadFromQuery: this.loadFromQuery, closeModal: () => this.closeModal(), tree: this.tree })), !state.customer || this.slugIsOldFormat(this.slug) ? (h("div", { class: `hemfixarna_content hemfixarna_content--${state.step}` }, state.step === 1 && this.tree && h("hemfixarna-start", { tree: this.tree }), state.step === 2 && state.selectedCategory && h("hemfixarna-category", null), state.step === 3 && state.selectedService && h("hemfixarna-service", null), state.step === 4 && state.selectedProduct && h("hemfixarna-product", null), state.step === 5 && h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && h("hemfixarna-order", { tree: this.tree }))) : (h("div", { class: `hemfixarna_content hemfixarna_content--${state.step}` }, state.step < 4 && h("hemfixarna-start", null), state.step === 4 && state.selectedProduct && h("hemfixarna-product", null), state.step === 5 && h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && h("hemfixarna-order", { tree: this.tree })))), !this.isDemo ? h("div", { class: `hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}` }) : null))));
|
1024
1026
|
}
|
1025
1027
|
static get assetsDirs() { return ["assets"]; }
|
@@ -1033,7 +1035,7 @@ HemfixarnaComponent.style = hemfixarnaCss;
|
|
1033
1035
|
|
1034
1036
|
const hemfixarnaDemoCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\"); :host{font-family:\"Inter\", sans-serif}:host .hemfixarna_widgetstyles label{cursor:pointer}:host .hemfixarna_widgetstyles>div{display:flex;gap:1rem}:host .hemfixarna_widgetstyles h5{margin:1rem 0}:host .hemfixarna_example{margin-bottom:16px;background:#000;padding:16px;color:#fff;display:flex;justify-content:space-between;cursor:pointer;max-width:500px;box-sizing:border-box;position:relative}:host .hemfixarna_example--tooltip{background:#000;top:-48px;font-size:16px;left:40%;color:white;padding:8px;position:absolute;opacity:0}:host .hemfixarna_example--tooltip::after{content:\"\";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent transparent}:host .hemfixarna_example:hover .hemfixarna_example--tooltip{opacity:1}:host .hemfixarna_example p{font-size:14px}:host .hemfixarna_example img{filter:invert(1)}:host .hemfixarna_install{display:grid;gap:8px;margin-top:16px}:host .hemfixarna_product--label{background:#e1e0f5}:host .hemfixarna_categories{max-height:100%;overflow:auto;position:relative}:host .hemfixarna_categories--label{display:flex;align-items:center;justify-content:space-between;padding:8px}:host .hemfixarna_categories--label button{background:#3f3a92;border:none;font-weight:600;padding:3.2px 9.6px;border-radius:10px;margin-right:8px;color:#ece8e8}:host .hemfixarna_categories--label button:active{transform:scale(0.95)}:host .hemfixarna_categories--label--big{font-weight:600;border-bottom:1px solid black}:host p{margin:0}:host span{color:darkolivegreen;font-size:10px}:host button{cursor:pointer}:host>div{display:grid;gap:32px;width:100%;grid-template-columns:1fr 1fr;height:100vh;place-items:center;overflow:hidden;padding:16px 32px;box-sizing:border-box}:host>div>*{width:100%}:host>div>div{max-width:500px}:host>div ul{margin:0;padding:0;list-style:none}:host>div ul ul{gap:1px;display:grid}:host>div ul li{padding-left:16px;background:#fff}";
|
1035
1037
|
|
1036
|
-
const MyComponent$
|
1038
|
+
const MyComponent$7 = class {
|
1037
1039
|
constructor(hostRef) {
|
1038
1040
|
registerInstance(this, hostRef);
|
1039
1041
|
this.debounce = null;
|
@@ -1078,7 +1080,7 @@ const MyComponent$6 = class {
|
|
1078
1080
|
// Your color accessibility logic here
|
1079
1081
|
}
|
1080
1082
|
getTopLevelCategory() {
|
1081
|
-
switch ("
|
1083
|
+
switch ("elfa") {
|
1082
1084
|
case Business.byggmax:
|
1083
1085
|
return TopCategory.byggmax;
|
1084
1086
|
default:
|
@@ -1108,14 +1110,14 @@ const MyComponent$6 = class {
|
|
1108
1110
|
}
|
1109
1111
|
}
|
1110
1112
|
else {
|
1111
|
-
const customer = await getCustomer("
|
1113
|
+
const customer = await getCustomer("elfa");
|
1112
1114
|
if (customer.code !== 'not_found' && customer) {
|
1113
1115
|
this.customer = customer;
|
1114
1116
|
}
|
1115
1117
|
}
|
1116
1118
|
}
|
1117
1119
|
getExample() {
|
1118
|
-
return `<hemfixarna-${"
|
1120
|
+
return `<hemfixarna-${"elfa"}${this.selectedSlug ? ` slug="${this.selectedSlug}" ` : ''}${this.selectedID ? ` id="${this.selectedID}" ` : ''} ${this.widgetStyle === WidgetStyle.standard ? '' : `widgetStyle="${this.widgetStyle}"`} ${this.buttonColor.length ? `buttonColor="${this.buttonColor}"` : ''} ${this.buttonBg.length ? `buttonBg="${this.buttonBg}"` : ''}></hemfixarna-${"elfa"}>`;
|
1119
1121
|
}
|
1120
1122
|
copyExample() {
|
1121
1123
|
navigator.clipboard.writeText(this.getExample());
|
@@ -1140,7 +1142,7 @@ const MyComponent$6 = class {
|
|
1140
1142
|
}
|
1141
1143
|
render() {
|
1142
1144
|
const copy = getAssetPath(`./assets/copy.png`);
|
1143
|
-
return (h("div", null, h("div", null, h("div", { onClick: () => this.copyExample(), class: "hemfixarna_example" }, h("p", null, this.getExample()), h("img", { src: copy, height: 20 }), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText)), "
|
1145
|
+
return (h("div", null, h("div", null, h("div", { onClick: () => this.copyExample(), class: "hemfixarna_example" }, h("p", null, this.getExample()), h("img", { src: copy, height: 20 }), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText)), "elfa" === Business.byggmax && (h("hemfixarna-byggmax", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, forceOldTree: Boolean(process.env.FORCE_OLD_TREE), slug: this.selectedSlug, id: this.selectedID })), "elfa" === Business.skanska && (h("hemfixarna-skanska", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), "elfa" === Business.string && (h("hemfixarna-string-furniture", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), "elfa" === Business.hornbach && (h("hemfixarna-hornbach", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), "elfa" === Business.forebygg && (h("hemfixarna-forebygg", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), "elfa" === Business.doro && (h("hemfixarna-doro", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), "elfa" === Business.elfa && (h("hemfixarna-elfa", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), "elfa" === Business.kund && (h("hemfixarna-kund", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), h("div", { class: "hemfixarna_install" }, h("div", { onClick: () => this.copyCdn(), class: "hemfixarna_example" }, h("p", null, this.cdnLink), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText), h("img", { src: copy, height: 20 }))), h("div", { class: "hemfixarna_widgetstyles" }, h("h5", null, "Widget styles"), h("div", null, Object.values(WidgetStyle).map(style => (h("label", { key: style }, h("input", { type: "radio", value: style, checked: this.widgetStyle === style, onChange: () => (this.widgetStyle = style) }), style)))), h("div", null, h("div", null, h("h5", null, "Button background color"), h("input", { type: "text", value: this.buttonBg, onInput: e => (this.buttonBg = e.target.value) })), h("div", null, h("h5", null, "Button text color"), h("input", { type: "text", value: this.buttonColor, onInput: e => (this.buttonColor = e.target.value) })))), h("span", null, "Write an hexa code no # needed"), this.colorAccessibility ? (h("div", null, h("h5", null, "Tillg\u00E4nglighetsrapport"), h("div", null, h("strong", null, "Liten text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.small) } }, this.colorAccessibility.small), h("br", null), h("strong", null, "Fet text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.bold) } }, this.colorAccessibility.bold), h("br", null), h("strong", null, "Stor text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.large) } }, this.colorAccessibility.large), h("br", null), h("strong", null, "Kontrastf\u00F6rh\u00E5llande:"), " ", this.colorAccessibility.contrast))) : null), h("ul", { class: "hemfixarna_categories" }, this.customer ? (h("div", null, this.customer.categories.map(c => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, c.name), h("span", null, `c-${c.id}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`c-${c.id}`) }, "Kopiera ID"), h("button", { onClick: () => (this.selectedID = `c-${c.id}`) }, "Ladda kategori"))), c.show_products && c.products ? (h("ul", null, c.products.map(p => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_product--label" }, h("div", null, h("p", null, p.fields.post_title), h("span", null, p.fields.ID)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, "Kopiera ID"), h("button", { onClick: () => (this.selectedID = String(p.fields.ID)) }, "Ladda produkt")))))))) : (h("ul", null, c.sub_categories &&
|
1144
1146
|
c.sub_categories.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.name), h("span", null, `c-${sc.id}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`c-${sc.id}`) }, "Kopiera ID"), h("button", { onClick: () => (this.selectedID = `c-${sc.id}`) }, "Ladda kategori"))), h("ul", null, sc.products.map(p => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_product--label" }, h("div", null, h("p", null, p.fields.post_title), h("span", null, p.fields.ID)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, "Kopiera ID"), h("button", { onClick: () => (this.selectedID = String(p.fields.ID)) }, "Ladda produkt"))))))))))))))))) : this.tree ? (h("div", null, this.tree.sub_cats.map(c => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, c.name), h("span", null, `category/${c.slug}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`category/${c.slug}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `category/${c.slug}`) }, "Ladda kategori"))), h("ul", null, c.services.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.post_title), h("span", null, `service/${sc.post_name}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`service/${sc.post_name}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `service/${sc.post_name}`) }, "Ladda kategori"))), h("ul", null, sc.products.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.post_title), h("span", null, `product/${sc.post_name}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`product/${sc.post_name}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `product/${sc.post_name}`) }, "Ladda kategori")))))))))))))))) : null)));
|
1145
1147
|
}
|
1146
1148
|
static get watchers() { return {
|
@@ -1148,11 +1150,11 @@ const MyComponent$6 = class {
|
|
1148
1150
|
"buttonColor": ["debouncedFunction"]
|
1149
1151
|
}; }
|
1150
1152
|
};
|
1151
|
-
MyComponent$
|
1153
|
+
MyComponent$7.style = hemfixarnaDemoCss;
|
1152
1154
|
|
1153
1155
|
const hemfixarnaDoroCss = "";
|
1154
1156
|
|
1155
|
-
const MyComponent$
|
1157
|
+
const MyComponent$6 = class {
|
1156
1158
|
constructor(hostRef) {
|
1157
1159
|
registerInstance(this, hostRef);
|
1158
1160
|
this.id = undefined;
|
@@ -1165,7 +1167,24 @@ const MyComponent$5 = class {
|
|
1165
1167
|
return (h("hemfixarna-component", { widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor, loadFromQuery: this.loadFromQuery, id: this.id, business: Business.doro }));
|
1166
1168
|
}
|
1167
1169
|
};
|
1168
|
-
MyComponent$
|
1170
|
+
MyComponent$6.style = hemfixarnaDoroCss;
|
1171
|
+
|
1172
|
+
const hemfixarnaElfaCss = "";
|
1173
|
+
|
1174
|
+
const MyComponent$5 = class {
|
1175
|
+
constructor(hostRef) {
|
1176
|
+
registerInstance(this, hostRef);
|
1177
|
+
this.id = undefined;
|
1178
|
+
this.loadFromQuery = false;
|
1179
|
+
this.widgetStyle = WidgetStyle.standard;
|
1180
|
+
this.buttonColor = undefined;
|
1181
|
+
this.buttonBg = undefined;
|
1182
|
+
}
|
1183
|
+
render() {
|
1184
|
+
return (h("hemfixarna-component", { widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor, loadFromQuery: this.loadFromQuery, id: this.id, business: Business.elfa }));
|
1185
|
+
}
|
1186
|
+
};
|
1187
|
+
MyComponent$5.style = hemfixarnaElfaCss;
|
1169
1188
|
|
1170
1189
|
const hemfixarnaForebyggCss = "";
|
1171
1190
|
|
@@ -1946,6 +1965,153 @@ const HemfixarnaInfo = class {
|
|
1946
1965
|
}
|
1947
1966
|
};
|
1948
1967
|
|
1968
|
+
const hemfixarnaInvoiceCss = ":host .invoice{gap:16px;display:grid}:host .invoice form>span{text-align:center;padding:16px 0}:host .invoice img{right:unset;left:unset;position:initial;transform:none}:host .invoice label{cursor:pointer;font-size:14px;display:flex;align-items:flex-start;padding:16px 0}:host .invoice label input{margin:0 5px 0 0;accent-color:#ea662c}:host .invoice-preview{display:flex;gap:4px}:host .invoice-preview div{position:relative}:host .invoice-preview div button{position:absolute;top:0;right:0;padding:0}:host .invoice-preview div button img{width:24px;height:24px}:host .invoice-preview div>img{width:100px;height:80px;object-fit:cover}:host .invoice input[type=email],:host .invoice input[type=tel],:host .invoice textarea{padding:16px;border:1px solid #fcd9c9;font-size:16px}:host .invoice textarea{resize:none;height:200px;font-family:\"Inter\", sans-serif}:host .invoice div:has(>input[type=file]){display:flex;align-items:center;justify-content:center;cursor:pointer;background:#fff;border:1px solid #fcd9c9;padding:32px 16px;gap:16px}:host .invoice div:has(>input[type=file]) span{color:#000;font-size:12px}:host .invoice input[type=file]{display:none}";
|
1969
|
+
|
1970
|
+
const base = `${"https://hemfixarna.se"}/wp-json/headless` ;
|
1971
|
+
const HemfixarnaInvoice = class {
|
1972
|
+
constructor(hostRef) {
|
1973
|
+
registerInstance(this, hostRef);
|
1974
|
+
this.formError = null;
|
1975
|
+
this.displayImages = [];
|
1976
|
+
this.formImages = [];
|
1977
|
+
this.formState = 'initial';
|
1978
|
+
}
|
1979
|
+
isValidEmail(email) {
|
1980
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
1981
|
+
return emailRegex.test(email);
|
1982
|
+
}
|
1983
|
+
componentDidRender() {
|
1984
|
+
const form = this.el.querySelector('form');
|
1985
|
+
if (form) {
|
1986
|
+
form.addEventListener('input', () => {
|
1987
|
+
this.formError = null;
|
1988
|
+
});
|
1989
|
+
}
|
1990
|
+
}
|
1991
|
+
disconnectedCallback() {
|
1992
|
+
const form = this.el.querySelector('form');
|
1993
|
+
if (form) {
|
1994
|
+
form.removeEventListener('input', () => {
|
1995
|
+
this.formError = null;
|
1996
|
+
});
|
1997
|
+
}
|
1998
|
+
}
|
1999
|
+
async submit(e) {
|
2000
|
+
var _a;
|
2001
|
+
e.preventDefault();
|
2002
|
+
this.formState = 'loading';
|
2003
|
+
this.formError = null;
|
2004
|
+
const form = e.currentTarget.elements;
|
2005
|
+
const values = {
|
2006
|
+
description: form.descriptionInput.value.length ? form.descriptionInput.value : null,
|
2007
|
+
email: form.emailInput.value.length ? form.emailInput.value : null,
|
2008
|
+
tel: form.telInput.value.length ? form.telInput.value : null,
|
2009
|
+
terms: (_a = form.termsInput) === null || _a === void 0 ? void 0 : _a.checked,
|
2010
|
+
};
|
2011
|
+
if (!values.description) {
|
2012
|
+
this.formError = 'Vänligen fyll i formulärtexten';
|
2013
|
+
this.formState = 'initial';
|
2014
|
+
return;
|
2015
|
+
}
|
2016
|
+
if (!values.email || !this.isValidEmail(values.email)) {
|
2017
|
+
this.formError = 'Vänligen ange en giltig e-postadress';
|
2018
|
+
this.formState = 'initial';
|
2019
|
+
return;
|
2020
|
+
}
|
2021
|
+
if (!values.tel) {
|
2022
|
+
this.formError = 'Vänligen ange ditt telefonnummer';
|
2023
|
+
this.formState = 'initial';
|
2024
|
+
return;
|
2025
|
+
}
|
2026
|
+
if (state.selectedProduct.terms_show_checkbox && !values.terms) {
|
2027
|
+
this.formError = 'Vänligen acceptera villkoren';
|
2028
|
+
this.formState = 'initial';
|
2029
|
+
return;
|
2030
|
+
}
|
2031
|
+
const formData = new FormData();
|
2032
|
+
formData.append('text', values.description);
|
2033
|
+
formData.append('email', values.email);
|
2034
|
+
formData.append('tel', values.tel);
|
2035
|
+
formData.append('customer', state.business);
|
2036
|
+
this.formImages.forEach(file => {
|
2037
|
+
formData.append('images[]', file);
|
2038
|
+
});
|
2039
|
+
formData.append('product', JSON.stringify({
|
2040
|
+
title: state.selectedProduct.post_title,
|
2041
|
+
amount: 1,
|
2042
|
+
has_rut: state.selectedProduct.rut,
|
2043
|
+
has_rot: state.selectedProduct.rot,
|
2044
|
+
ID: state.selectedProduct.ID,
|
2045
|
+
parts: [],
|
2046
|
+
}));
|
2047
|
+
try {
|
2048
|
+
const res = await fetch(`${base}/saveinvoiceproduct`, {
|
2049
|
+
method: 'POST',
|
2050
|
+
body: formData,
|
2051
|
+
});
|
2052
|
+
const { response } = await res.json();
|
2053
|
+
if (response.code === 200) {
|
2054
|
+
state.checkoutInvoice = true;
|
2055
|
+
state.step = 6;
|
2056
|
+
}
|
2057
|
+
else {
|
2058
|
+
this.formError = 'Vi kan inte ta emot din beställning just nu';
|
2059
|
+
this.formState = 'initial';
|
2060
|
+
}
|
2061
|
+
}
|
2062
|
+
catch (error) {
|
2063
|
+
this.formError = 'Vi kan inte ta emot din beställning just nu';
|
2064
|
+
this.formState = 'initial';
|
2065
|
+
}
|
2066
|
+
}
|
2067
|
+
handleImageDrop(e) {
|
2068
|
+
e.preventDefault();
|
2069
|
+
const files = e.dataTransfer.files;
|
2070
|
+
for (let i = 0; i < files.length; i++) {
|
2071
|
+
const file = files[i];
|
2072
|
+
if (file.type.startsWith('image/')) {
|
2073
|
+
const reader = new FileReader();
|
2074
|
+
reader.onload = () => {
|
2075
|
+
this.displayImages = [...this.displayImages, reader.result];
|
2076
|
+
this.formImages = [...this.formImages, file];
|
2077
|
+
};
|
2078
|
+
reader.readAsDataURL(file);
|
2079
|
+
}
|
2080
|
+
}
|
2081
|
+
}
|
2082
|
+
handleFileInputChange(e) {
|
2083
|
+
e.preventDefault();
|
2084
|
+
const files = e.target.files;
|
2085
|
+
for (let i = 0; i < files.length; i++) {
|
2086
|
+
const file = files[i];
|
2087
|
+
if (file.type.startsWith('image/')) {
|
2088
|
+
const reader = new FileReader();
|
2089
|
+
reader.onload = () => {
|
2090
|
+
this.displayImages = [...this.displayImages, reader.result];
|
2091
|
+
this.formImages = [...this.formImages, file];
|
2092
|
+
};
|
2093
|
+
reader.readAsDataURL(file);
|
2094
|
+
}
|
2095
|
+
}
|
2096
|
+
}
|
2097
|
+
handleImageClick() {
|
2098
|
+
this.el.querySelector('.hemfixarna-file-upload').click();
|
2099
|
+
}
|
2100
|
+
preventDragOver(e) {
|
2101
|
+
e.preventDefault();
|
2102
|
+
}
|
2103
|
+
removeImage(index) {
|
2104
|
+
this.displayImages = this.displayImages.filter((_, i) => i !== index);
|
2105
|
+
this.formImages = this.formImages.filter((_, i) => i !== index);
|
2106
|
+
}
|
2107
|
+
render() {
|
2108
|
+
const upload = getAssetPath(`./assets/drag-drop.svg`);
|
2109
|
+
return (h("div", { class: "invoice" }, h("p", null, state.selectedProduct.invoice_description), h("form", { onSubmit: e => this.submit(e) }, h("textarea", { name: "descriptionInput", placeholder: "Beskriv ditt \u00E4rende" }), h("div", { role: "button", "aria-label": "upload image", onDragOver: e => this.preventDragOver(e), onDrop: e => this.handleImageDrop(e), onClick: () => this.handleImageClick() }, h("img", { src: upload, alt: "hemfixarna_logo", width: 24 }), h("div", null, h("p", null, "Bifoga ev bilder"), h("span", null, "(dra bilder hit)")), h("input", { onChange: e => this.handleFileInputChange(e), class: "hemfixarna-file-upload", accept: "image/*", type: "file", multiple: true, name: "fileInput" })), h("div", { class: "invoice-preview" }, this.displayImages.map((img, i) => (h("div", { key: i }, h("img", { src: img, alt: "uploaded image" }), h("button", { onClick: () => this.removeImage(i) }, h("img", { src: getAssetPath(`./assets/close.svg`), alt: "close" })))))), h("input", { placeholder: "E-post", type: "email", name: "emailInput" }), h("input", { placeholder: "Telefonnummer", type: "tel", name: "telInput" }), state.selectedProduct.terms_show_checkbox ? (h("label", null, h("input", { type: "checkbox", name: "termsInput" }), state.selectedProduct.terms)) : null, this.formError ? h("span", null, this.formError) : null, h("input", { type: "submit", value: this.formState === 'loading' ? 'Skickar' : 'Kontakta mig' }))));
|
2110
|
+
}
|
2111
|
+
get el() { return getElement(this); }
|
2112
|
+
};
|
2113
|
+
HemfixarnaInvoice.style = hemfixarnaInvoiceCss;
|
2114
|
+
|
1949
2115
|
const MyComponent$2 = class {
|
1950
2116
|
constructor(hostRef) {
|
1951
2117
|
registerInstance(this, hostRef);
|
@@ -1964,7 +2130,7 @@ const HemfixarnaOrder = class {
|
|
1964
2130
|
constructor(hostRef) {
|
1965
2131
|
registerInstance(this, hostRef);
|
1966
2132
|
this.render = () => {
|
1967
|
-
return (h("div", { style: { background: `url(${state.options.thank_you_image})` }, class: "hemfixarna_order" }, h("div", null), h("div", null, h("h2", null,
|
2133
|
+
return (h("div", { style: { background: `url(${state.options.thank_you_image})` }, class: "hemfixarna_order" }, h("div", null), h("div", null, h("h2", null, state.checkoutInvoice ? 'Tack för din förfrågan' : 'Tack för din bokning'), state.checkoutInvoice ? h("p", null, "Vi \u00E5terkommer inom kort till dig p\u00E5 angivet telefonnummer eller epost") : null, state.checkoutInvoice ? h("div", null) : h("hemfixarna-orderrows", { tree: this.tree, cart: false }), h("span", { onClick: () => this.resetShop() }, h("button", null, "G\u00F6r en ny bokning")), h("hemfixarna-info", { list: [
|
1968
2134
|
{ trust_badge: 'Du kommer bli kontaktad av en Hemfixare för bokning av tid.' },
|
1969
2135
|
{ trust_badge: 'När jobbet är klart kommer du få en faktura med RUT/ROT-avdrag.' },
|
1970
2136
|
] }))));
|
@@ -2145,11 +2311,11 @@ const HemfixarnaProduct = class {
|
|
2145
2311
|
const checked = getAssetPath(`./assets/checked.svg`);
|
2146
2312
|
const plus = getAssetPath(`./assets/plus.svg`);
|
2147
2313
|
const minus = getAssetPath(`./assets/minus.svg`);
|
2148
|
-
return (h("div", { class: "hemfixarna_product" }, h("div", { class: "hemfixarna_product--top" }, state.selectedProduct.icon && (h("img", { width: 80, src: (_a = state.selectedProduct.icon.url) !== null && _a !== void 0 ? _a : state.selectedProduct.icon, alt: state.selectedProduct.post_title })), h("div", null, h("h1", null, state.selectedProduct.post_title), h("h2", null,
|
2314
|
+
return (h("div", { class: "hemfixarna_product" }, h("div", { class: "hemfixarna_product--top" }, state.selectedProduct.icon && (h("img", { width: 80, src: (_a = state.selectedProduct.icon.url) !== null && _a !== void 0 ? _a : state.selectedProduct.icon, alt: state.selectedProduct.post_title })), h("div", null, h("h1", null, state.selectedProduct.post_title), !state.selectedProduct.invoice ? h("h2", null, getProductPrice(state.selectedProduct), " kr/st") : h("h2", null, state.selectedProduct.invoice_price))), h("div", { class: "hemfixarna_product--grid" }, h("div", { class: "hemfixarna_product--left" }, ((_b = state.selectedProduct.list) === null || _b === void 0 ? void 0 : _b.length) && (h("ul", { class: "hemfixarna_features" }, state.selectedProduct.list.map(l => (h("li", { key: l.bullet }, h("img", { src: checked, alt: "checked" }), h("p", null, l.bullet)))))), state.selectedProduct.description && (h("p", { onClick: () => (this.hideDescription = false), class: `hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`, innerHTML: state.selectedProduct.description }))), h("div", { class: "hemfixarna_product--right" }, state.selectedProduct.invoice ? (h("hemfixarna-invoice", null)) : (h(Fragment, null, h("ul", null, h("li", { class: "hemfixarna_product--item" }, h("div", null, h("p", null, "Antal ", state.selectedProduct.post_title), h("p", { class: "hemfixarna_product--price" }, getProductPrice(state.selectedProduct), "kr/st")), h("div", { class: "hemfixarna_counter" }, h("img", { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removeProduct() }), h("span", null, this.getAmount()), h("img", { src: plus, onClick: () => this.addProduct() }))), ((_c = state.selectedProduct.parts) === null || _c === void 0 ? void 0 : _c.length) &&
|
2149
2315
|
state.selectedProduct.parts.map(p => {
|
2150
2316
|
var _a;
|
2151
2317
|
return (h("li", { class: "hemfixarna_part" }, h("div", null, h("p", null, (_a = p.title) !== null && _a !== void 0 ? _a : p.post_title), h("p", { class: "hemfixarna_product--price" }, getPartPrice(p, state.selectedProduct), "kr/st")), h("div", { class: "hemfixarna_counter" }, h("img", { class: `${this.getPartAmount(p.ID) === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removePart(p) }), h("span", null, this.getPartAmount(p.ID)), h("img", { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: plus, onClick: () => this.addPart(p) }))));
|
2152
|
-
})), h("h4", { class: "hemfixarna_product--total" }, "Totalt ", this.getTotalPrice(), " kr"), h("button", { onClick: () => this.goToCart(), class: `hemfixarna_buy ${this.getAmount() === 0 ? 'disabled' : ''}` }, "Forts\u00E4tt"), !state.selectedProduct.hide_start_fee && (state.selectedProduct.rot || state.selectedProduct.rut) && state.rutOptions && state.rotOptions && (h("p", { class: "hemfixarna_terms" }, h("strong", null, state.selectedProduct.rot ? state.rotOptions.rot_start_fee_heading : state.rutOptions.rut_start_fee_heading), h("br", null), h("span", { innerHTML: state.selectedProduct.rot ? state.rotOptions.rot_start_fee_text : state.rutOptions.rut_start_fee_text }))), state.options && h("hemfixarna-info", { list: state.options.trust })))));
|
2318
|
+
})), h("h4", { class: "hemfixarna_product--total" }, "Totalt ", this.getTotalPrice(), " kr"), h("button", { onClick: () => this.goToCart(), class: `hemfixarna_buy ${this.getAmount() === 0 ? 'disabled' : ''}` }, "Forts\u00E4tt"))), !state.selectedProduct.hide_start_fee && (state.selectedProduct.rot || state.selectedProduct.rut) && state.rutOptions && state.rotOptions && (h("p", { class: "hemfixarna_terms" }, h("strong", null, state.selectedProduct.rot ? state.rotOptions.rot_start_fee_heading : state.rutOptions.rut_start_fee_heading), h("br", null), h("span", { innerHTML: state.selectedProduct.rot ? state.rotOptions.rot_start_fee_text : state.rutOptions.rut_start_fee_text }))), state.options && h("hemfixarna-info", { list: state.options.trust })))));
|
2153
2319
|
}
|
2154
2320
|
get el() { return getElement(this); }
|
2155
2321
|
};
|
@@ -2163,7 +2329,7 @@ const HemfixarnaService = class {
|
|
2163
2329
|
.sort((a, b) => (a.post_title < b.post_title ? -1 : 1))
|
2164
2330
|
.map(p => {
|
2165
2331
|
var _a;
|
2166
|
-
return (h("hemfixarna-box", { post: p, icon: (_a = p.icon.url) !== null && _a !== void 0 ? _a : p.icon, postTitle: p.
|
2332
|
+
return (h("hemfixarna-box", { post: p, icon: (_a = p.icon.url) !== null && _a !== void 0 ? _a : p.icon, postTitle: p.title }));
|
2167
2333
|
}))), h("hemfixarna-info", { list: state.options.trust }))));
|
2168
2334
|
}
|
2169
2335
|
};
|
@@ -2228,6 +2394,6 @@ const MyComponent = class {
|
|
2228
2394
|
};
|
2229
2395
|
MyComponent.style = hemfixarnaStringCss;
|
2230
2396
|
|
2231
|
-
export { HemfixarnaAddress as hemfixarna_address, HemfixarnaBox as hemfixarna_box, HemfixarnaBreadcrumbs as hemfixarna_breadcrumbs, MyComponent$
|
2397
|
+
export { HemfixarnaAddress as hemfixarna_address, HemfixarnaBox as hemfixarna_box, HemfixarnaBreadcrumbs as hemfixarna_breadcrumbs, MyComponent$8 as hemfixarna_byggmax, HemfixarnaCart as hemfixarna_cart, HemfixarnaCategory as hemfixarna_category, HemfixarnaCheckout as hemfixarna_checkout, HemfixarnaComponent as hemfixarna_component, MyComponent$7 as hemfixarna_demo, MyComponent$6 as hemfixarna_doro, MyComponent$5 as hemfixarna_elfa, MyComponent$4 as hemfixarna_forebygg, HemfixarnaGetuser as hemfixarna_getuser, MyComponent$3 as hemfixarna_hornbach, HemfixarnaInfo as hemfixarna_info, HemfixarnaInvoice as hemfixarna_invoice, MyComponent$2 as hemfixarna_kund, HemfixarnaOrder as hemfixarna_order, HemfixarnaOrderrows as hemfixarna_orderrows, HemfixarnaProduct as hemfixarna_product, HemfixarnaService as hemfixarna_service, MyComponent$1 as hemfixarna_skanska, HemfixarnaGrid as hemfixarna_start, MyComponent as hemfixarna_string_furniture };
|
2232
2398
|
|
2233
|
-
//# sourceMappingURL=hemfixarna-
|
2399
|
+
//# sourceMappingURL=hemfixarna-address_24.entry.js.map
|
package/dist/{cjs/hemfixarna-address_22.cjs.entry.js.map → esm/hemfixarna-address_24.entry.js.map}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
{"file":"hemfixarna-address.hemfixarna-box.hemfixarna-breadcrumbs.hemfixarna-byggmax.hemfixarna-cart.hemfixarna-category.hemfixarna-checkout.hemfixarna-component.hemfixarna-demo.hemfixarna-doro.hemfixarna-forebygg.hemfixarna-getuser.hemfixarna-hornbach.hemfixarna-info.hemfixarna-kund.hemfixarna-order.hemfixarna-orderrows.hemfixarna-product.hemfixarna-service.hemfixarna-skanska.hemfixarna-start.hemfixarna-string-furniture.entry.
|
1
|
+
{"file":"hemfixarna-address.hemfixarna-box.hemfixarna-breadcrumbs.hemfixarna-byggmax.hemfixarna-cart.hemfixarna-category.hemfixarna-checkout.hemfixarna-component.hemfixarna-demo.hemfixarna-doro.hemfixarna-elfa.hemfixarna-forebygg.hemfixarna-getuser.hemfixarna-hornbach.hemfixarna-info.hemfixarna-invoice.hemfixarna-kund.hemfixarna-order.hemfixarna-orderrows.hemfixarna-product.hemfixarna-service.hemfixarna-skanska.hemfixarna-start.hemfixarna-string-furniture.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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