blue-chestnut-solar-expert 0.0.62 → 0.0.64
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/{eraser-icon_18.cjs.entry.js → eraser-icon_19.cjs.entry.js} +22 -21
- package/dist/cjs/eraser-icon_19.cjs.entry.js.map +1 -0
- package/dist/cjs/{lerc-BC1SKbTC.js → lerc-CQf05pmr.js} +9 -9
- package/dist/cjs/{lerc-BC1SKbTC.js.map → lerc-CQf05pmr.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/loading-widget.cjs.entry.js +2 -2
- package/dist/cjs/loading-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/loading-widget.entry.cjs.js.map +1 -1
- package/dist/cjs/stencil-library.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/map-draw/map-draw.js +54 -54
- package/dist/collection/components/map-draw/map-draw.js.map +1 -1
- package/dist/collection/components/map-draw/map-selector.js +3 -3
- package/dist/collection/components/map-draw/polygon-buttons.js +1 -1
- package/dist/collection/components/map-draw/polygon-information.js +18 -11
- package/dist/collection/components/map-draw/polygon-information.js.map +1 -1
- package/dist/collection/components/map-draw/tool-box.js +3 -3
- package/dist/collection/components/map-draw/tutorial-component.js +36 -3
- package/dist/collection/components/map-draw/tutorial-component.js.map +1 -1
- package/dist/collection/components/settings/settings.js +8 -8
- package/dist/collection/components/solar-expert/solar-expert.js +3 -1
- package/dist/collection/components/solar-expert/solar-expert.js.map +1 -1
- package/dist/collection/components/solar-system-form/solar-system-form.js +36 -36
- package/dist/collection/components/widgets/loading-widget.js +1 -1
- package/dist/collection/components/widgets/toast-notification.js +133 -0
- package/dist/collection/components/widgets/toast-notification.js.map +1 -0
- package/dist/collection/output.css +113 -110
- package/dist/collection/types/lang.js.map +1 -1
- package/dist/collection/utils/lang/english.js +7 -0
- package/dist/collection/utils/lang/english.js.map +1 -1
- package/dist/collection/utils/lang/german.js +7 -0
- package/dist/collection/utils/lang/german.js.map +1 -1
- package/dist/collection/utils/lang/spanish.js +7 -0
- package/dist/collection/utils/lang/spanish.js.map +1 -1
- package/dist/collection/utils/solar.js +1 -0
- package/dist/collection/utils/solar.js.map +1 -1
- package/dist/components/eraser-icon.js +1 -1
- package/dist/components/house-icon.js +1 -1
- package/dist/components/icon-selector.js +1 -1
- package/dist/components/loading-widget.js +2 -2
- package/dist/components/loading-widget.js.map +1 -1
- package/dist/components/map-draw.js +1 -1
- package/dist/components/map-selector.js +1 -1
- package/dist/components/marker-icon.js +1 -1
- package/dist/components/move-icon.js +1 -1
- package/dist/components/octagon-minus-icon.js +1 -1
- package/dist/components/p-1jcVNjsm.js +47 -0
- package/dist/components/p-1jcVNjsm.js.map +1 -0
- package/dist/components/p-4FooU4eR.js +40 -0
- package/dist/components/p-4FooU4eR.js.map +1 -0
- package/dist/components/p-6rmvkwsO.js +163 -0
- package/dist/components/p-6rmvkwsO.js.map +1 -0
- package/dist/components/p-BYULvwxQ.js +40 -0
- package/dist/components/p-BYULvwxQ.js.map +1 -0
- package/dist/components/{p-CRQ8cKpY.js → p-B_6Ue-UQ.js} +23 -2
- package/dist/components/p-B_6Ue-UQ.js.map +1 -0
- package/dist/components/p-BcBvva_X.js +40 -0
- package/dist/components/p-BcBvva_X.js.map +1 -0
- package/dist/components/p-But3uNm3.js +76 -0
- package/dist/components/p-But3uNm3.js.map +1 -0
- package/dist/components/p-COCnOrkb.js +121 -0
- package/dist/components/p-COCnOrkb.js.map +1 -0
- package/dist/components/p-COL7rExT.js +86 -0
- package/dist/components/p-COL7rExT.js.map +1 -0
- package/dist/components/p-CpGXfh7Q.js +114 -0
- package/dist/components/p-CpGXfh7Q.js.map +1 -0
- package/dist/components/p-Cu7ckMQp.js +40 -0
- package/dist/components/p-Cu7ckMQp.js.map +1 -0
- package/dist/components/p-CxwiRuTf.js +623 -0
- package/dist/components/p-CxwiRuTf.js.map +1 -0
- package/dist/components/p-DCMO4ssM.js +40 -0
- package/dist/components/p-DCMO4ssM.js.map +1 -0
- package/dist/components/p-DWrXodHT.js +40 -0
- package/dist/components/p-DWrXodHT.js.map +1 -0
- package/dist/components/{p-N0461-xw.js → p-De6Uhz0b.js} +93 -86
- package/dist/components/p-De6Uhz0b.js.map +1 -0
- package/dist/components/{p-CH_OwRlu.js → p-DoOT28vq.js} +3 -3
- package/dist/components/{p-CH_OwRlu.js.map → p-DoOT28vq.js.map} +1 -1
- package/dist/components/{p-DJcc5dax.js → p-IzVa21Wl.js} +40 -40
- package/dist/components/{p-DJcc5dax.js.map → p-IzVa21Wl.js.map} +1 -1
- package/dist/components/p-JzJ_ZuEh.js +89 -0
- package/dist/components/p-JzJ_ZuEh.js.map +1 -0
- package/dist/components/p-kB7DMoo7.js +40 -0
- package/dist/components/p-kB7DMoo7.js.map +1 -0
- package/dist/components/p-rW0sFWOp.js +40 -0
- package/dist/components/p-rW0sFWOp.js.map +1 -0
- package/dist/components/polygon-buttons.js +1 -1
- package/dist/components/polygon-information.js +1 -1
- package/dist/components/search-icon.js +1 -1
- package/dist/components/settings-icon.js +1 -1
- package/dist/components/settings-modal.js +1 -1
- package/dist/components/solar-expert.js +42 -34
- package/dist/components/solar-expert.js.map +1 -1
- package/dist/components/solar-system-form.js +1 -1
- package/dist/components/toast-notification.d.ts +11 -0
- package/dist/components/toast-notification.js +11 -0
- package/dist/components/toast-notification.js.map +1 -0
- package/dist/components/tool-box.js +1 -1
- package/dist/components/tutorial-component.js +1 -1
- package/dist/components/undo-icon.js +1 -1
- package/dist/esm/eraser-icon_19.entry.js +7 -0
- package/dist/esm/{eraser-icon_18.entry.js.map → eraser-icon_19.entry.js.map} +1 -1
- package/dist/esm/{lerc-C1dTV3Ec.js → lerc-j3yBkoBc.js} +3 -3
- package/dist/esm/{lerc-C1dTV3Ec.js.map → lerc-j3yBkoBc.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-widget.entry.js +2 -2
- package/dist/esm/loading-widget.entry.js.map +1 -1
- package/dist/esm/stencil-library.js +1 -1
- package/dist/stencil-library/loading-widget.entry.esm.js.map +1 -1
- package/dist/stencil-library/p-741a746a.entry.js +2 -0
- package/dist/stencil-library/p-741a746a.entry.js.map +1 -0
- package/dist/stencil-library/p-c6J1w7ew.js +2 -0
- package/dist/stencil-library/{p-DN5z5Lnk.js.map → p-c6J1w7ew.js.map} +1 -1
- package/dist/stencil-library/{p-d3e17162.entry.js → p-d2fcb2d8.entry.js} +2 -2
- package/dist/stencil-library/{p-DYtW7_ih.js → p-rVA7BFlW.js} +4 -4
- package/dist/stencil-library/{p-DYtW7_ih.js.map → p-rVA7BFlW.js.map} +1 -1
- package/dist/stencil-library/stencil-library.esm.js +1 -1
- package/dist/types/components/map-draw/map-draw.d.ts +5 -4
- package/dist/types/components/map-draw/polygon-information.d.ts +1 -0
- package/dist/types/components/map-draw/tutorial-component.d.ts +9 -0
- package/dist/types/components/widgets/toast-notification.d.ts +14 -0
- package/dist/types/components.d.ts +19 -0
- package/dist/types/types/lang.d.ts +7 -0
- package/package.json +1 -1
- package/dist/cjs/eraser-icon_18.cjs.entry.js.map +0 -1
- package/dist/components/p-B7UJpRdF.js +0 -40
- package/dist/components/p-B7UJpRdF.js.map +0 -1
- package/dist/components/p-BELtn8mh.js +0 -40
- package/dist/components/p-BELtn8mh.js.map +0 -1
- package/dist/components/p-BFxdD9Vs.js +0 -40
- package/dist/components/p-BFxdD9Vs.js.map +0 -1
- package/dist/components/p-BXbeMtbx.js +0 -76
- package/dist/components/p-BXbeMtbx.js.map +0 -1
- package/dist/components/p-BYE5N70N.js +0 -163
- package/dist/components/p-BYE5N70N.js.map +0 -1
- package/dist/components/p-BnTinS5t.js +0 -40
- package/dist/components/p-BnTinS5t.js.map +0 -1
- package/dist/components/p-BsLLB46f.js +0 -114
- package/dist/components/p-BsLLB46f.js.map +0 -1
- package/dist/components/p-CO7fYxHj.js +0 -40
- package/dist/components/p-CO7fYxHj.js.map +0 -1
- package/dist/components/p-CRQ8cKpY.js.map +0 -1
- package/dist/components/p-CZydnQHs.js +0 -114
- package/dist/components/p-CZydnQHs.js.map +0 -1
- package/dist/components/p-CcItlhA2.js +0 -60
- package/dist/components/p-CcItlhA2.js.map +0 -1
- package/dist/components/p-Dcu7-bdb.js +0 -623
- package/dist/components/p-Dcu7-bdb.js.map +0 -1
- package/dist/components/p-DotCjbjt.js +0 -40
- package/dist/components/p-DotCjbjt.js.map +0 -1
- package/dist/components/p-Dqekrz_n.js +0 -40
- package/dist/components/p-Dqekrz_n.js.map +0 -1
- package/dist/components/p-DvYICeab.js +0 -40
- package/dist/components/p-DvYICeab.js.map +0 -1
- package/dist/components/p-Dvlk0vkV.js +0 -47
- package/dist/components/p-Dvlk0vkV.js.map +0 -1
- package/dist/components/p-N0461-xw.js.map +0 -1
- package/dist/esm/eraser-icon_18.entry.js +0 -7
- package/dist/stencil-library/p-0cc467c4.entry.js +0 -2
- package/dist/stencil-library/p-0cc467c4.entry.js.map +0 -1
- package/dist/stencil-library/p-DN5z5Lnk.js +0 -2
- /package/dist/stencil-library/{p-d3e17162.entry.js.map → p-d2fcb2d8.entry.js.map} +0 -0
|
@@ -246,13 +246,13 @@ export class SolarSystemForm {
|
|
|
246
246
|
// Reusable style objects
|
|
247
247
|
const borderStyle = { border: "1px solid var(--color-border)" };
|
|
248
248
|
const errorBorderStyle = { border: "1px solid var(--color-error)" };
|
|
249
|
-
return (h("div", { key: '
|
|
249
|
+
return (h("div", { key: 'd2ba771761d0de6db760488b3be5be4e39091f14', class: "flex flex-col justify-center items-center w-full h-full pt-4" // style={{
|
|
250
250
|
,
|
|
251
251
|
// display: (Object.keys(this.systemConfigs).length === 0)
|
|
252
252
|
// ? "none"
|
|
253
253
|
// : "flex",
|
|
254
254
|
// }}
|
|
255
|
-
id: "solar-system-form" }, h("h1", { key: '
|
|
255
|
+
id: "solar-system-form" }, h("h1", { key: '905b435114ee0379b4858110085b7d1c7c679f1f', class: "text-2xl font-bold text-secondary mb-4 w-full" }, t.solarSystemForm.title), h("div", { key: '3857d2a6b47a172f128d6226f456aec4d7d9eb7f', class: "w-full bg-primary rounded-4xl space-y-6" }, h("div", { key: '3ddafc4ed02b8b352e6c14e3efe249ed60d1729b', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'e2098c3681dbd8862b253498262bb852ea39b125', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.systemInformation), h("div", { key: '6d134107926d09325557d4e03bf85def6081c180', class: "flex flex-col sm:flex-row gap-4" }, h("div", { key: '61341c64c166fde66baf893bcffab45476e9ec9e', class: "flex-1 bg-muted rounded-4xl p-4 space-y-3" }, h("div", { key: '79077e45f09655beaafe72b73ea6ba0cf394684a', class: "flex items-center justify-between" }, h("label", { key: 'a0ff494e0e639457cd8eb2d421cb1aad0fae8caa', class: "text-sm font-medium text-text-muted" }, t.solarSystemForm.numberOfPanels), !this.isIOS()
|
|
256
256
|
? (h("input", { type: "number", class: "w-20 px-3 py-1 rounded-full bg-muted text-muted-foreground text-right", value: this.numberOfPanels, readOnly: true }))
|
|
257
257
|
: (h("input", { type: "number", min: "1", max: this.maxPanels, class: "w-20 px-3 py-1 rounded-full focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground text-center", style: borderStyle, value: this.numberOfPanels, onInput: (e) => {
|
|
258
258
|
const value = parseInt(e.target
|
|
@@ -264,34 +264,34 @@ export class SolarSystemForm {
|
|
|
264
264
|
value;
|
|
265
265
|
this.recalculate();
|
|
266
266
|
}
|
|
267
|
-
} }))), !this.isIOS() && (h("input", { key: '
|
|
267
|
+
} }))), !this.isIOS() && (h("input", { key: '0c51740b74dae1c33f148978b53296c7343044e0', type: "range", min: "1", max: this.maxPanels, step: "1", class: "input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted", value: this.numberOfPanels, onInput: (e) => {
|
|
268
268
|
this.numberOfPanels = parseInt(e.target
|
|
269
269
|
.value);
|
|
270
270
|
this.recalculate();
|
|
271
|
-
} }))), h("div", { key: '
|
|
272
|
-
this.numberOfPanels).toFixed(1), " kWp"))))), h("div", { key: '
|
|
271
|
+
} }))), h("div", { key: 'd37d9e324d98cde4d5e91b186c91d5b08b630f1d', class: "flex-1 bg-muted rounded-4xl p-4" }, h("div", { key: '0454b3be5e44d069651606746430a4ca6a96f240', class: "flex items-center justify-between" }, h("label", { key: 'b0e37bc9d9e332266e4bcee1b3a9582566aff797', class: "text-sm font-medium text-text-muted" }, t.solarSystemForm.panelPeakPower), h("span", { key: 'f13b8dfa1a0a3ce76da4ae6cf2d74756d0def935', class: "text-text-muted" }, this.panelPeakPower.toFixed(2), " kW")), h("div", { key: 'c58b782a4f08dfb3cbf51d280e7285e40e473aaa', class: "flex items-center justify-between mt-4" }, h("span", { key: '55bcaa73ff1681ee7e4e3b790e25b75aa35434b6', class: "text-sm font-medium text-text-muted" }, t.solarSystemForm.totalSystemPeakPower), h("span", { key: 'd9a24f29e8a0eb735cad45884d86aefdcc9c3b1b', class: "font-bold text-text-muted" }, (DEFAULT_SOLAR_PANEL_TYPE.kWattPeak *
|
|
272
|
+
this.numberOfPanels).toFixed(1), " kWp"))))), h("div", { key: '2722b473b27781e6cce9b22bfef5a0a74fc7ee4d', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'f51c3e70d734140390984e715a2b578ebb6a3a18', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.householdConsumptionTitle), h("div", { key: '43a0ac5205e3f0b936871ad9418cade350ff5dfe', class: "grid grid-rows-2 gap-0" }, h("div", { key: '1e96d71a0e95a8fee9a0b6d85754bf4f22a6bf36', class: "grid grid-cols-2 gap-4" }, h("label", { key: 'cfc68e2c7b6b979fe23b167212ca1038ebeb9632', class: "block text-sm font-medium text-text-muted" }, t.solarSystemForm.annualConsumption), h("label", { key: '86c4d0e244d5de9926f9b6c61b64385788f32669', class: "block text-sm font-medium text-text-muted" }, t.solarSystemForm.consumptionProfileTitle)), h("div", { key: '0beea23733546568caad0f3dee93d63606d6fdfe', class: "grid grid-cols-2 gap-4" }, h("input", { key: '13c721565b5f97af85b5dda3c345a339c43cfd0e', type: "number", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground", style: borderStyle, value: this.householdConsumption, onInput: (e) => {
|
|
273
273
|
this.householdConsumption = parseInt(e.target
|
|
274
274
|
.value);
|
|
275
275
|
this.recalculate();
|
|
276
|
-
} }), h("select", { key: '
|
|
276
|
+
} }), h("select", { key: 'f3840f0c92a359686f2a16cca5b0472f30ea15e3', class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground", style: borderStyle, onChange: (e) => {
|
|
277
277
|
this.consumptionProfile =
|
|
278
278
|
e.target
|
|
279
279
|
.value;
|
|
280
280
|
this.recalculate();
|
|
281
|
-
} }, h("option", { key: '
|
|
281
|
+
} }, h("option", { key: 'fa946a4c17516db99ab4240d6160103f4955c9b3', value: "mostly_at_home", selected: this.consumptionProfile ===
|
|
282
282
|
"mostly_at_home" }, t.solarSystemForm.consumptionProfiles
|
|
283
|
-
.mostlyAtHome), h("option", { key: '
|
|
283
|
+
.mostlyAtHome), h("option", { key: '0ed9a688409a796c860759dc35a28454e2bbc894', value: "mostly_away", selected: this.consumptionProfile ===
|
|
284
284
|
"mostly_away" }, t.solarSystemForm.consumptionProfiles
|
|
285
|
-
.mostlyAway))))), h("div", { key: '
|
|
285
|
+
.mostlyAway))))), h("div", { key: '4ae5e9540c0e71b641cb3bb61d4e5ff0cc1be91b', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: '22d6f4d6fa2f131be325bfd560e0f1d44531bde8', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.additionalComponents.title), h("div", { key: 'e8ad78b747eabb39af1bbf6beb9d85b935090fbd', class: "flex flex-col gap-4" }, h("div", { key: 'f9690d6dd03f15f5eedfba7bf0189e0407e2ecd4', class: "flex flex-col bg-muted rounded-4xl p-4 gap-4" }, h("div", { key: 'd113b871187187b085236f8ef4dbc20672c3e2ec', class: "flex items-center justify-between" }, h("div", { key: '4751e61f1ccd565432b97fb3c324a4660d3faed6', class: "flex items-center gap-2" }, h("input", { key: 'd0118bb3d5ee004ad0fd44a3c137333e0eeb2a8b', type: "checkbox", id: "heatPump", class: "w-4 h-4 accent-tertiary border-border rounded-full focus:ring-tertiary focus:ring-offset-0 focus:ring-2", checked: this.heatPump > 0, onChange: (e) => {
|
|
286
286
|
this.heatPump =
|
|
287
287
|
e.target
|
|
288
288
|
.checked
|
|
289
289
|
? 100
|
|
290
290
|
: 0;
|
|
291
291
|
this.recalculate();
|
|
292
|
-
} }), h("label", { key: '
|
|
292
|
+
} }), h("label", { key: '5fe137e7cec477774d9e53ee20e1d1d537894d2c', htmlFor: "heatPump", class: "text-text-muted" }, t.solarSystemForm
|
|
293
293
|
.additionalComponents
|
|
294
|
-
.heatPump)), (this.heatPump > 0 && !this.isIOS()) && (h("span", { key: '
|
|
294
|
+
.heatPump)), (this.heatPump > 0 && !this.isIOS()) && (h("span", { key: '8772c0bcebf70cd19cf885fa7806c50dc8539097', class: "text-text-muted" }, this.heatPump, " m\u00B2"))), this.heatPump > 0 && (h("div", { key: 'de748c4ad3d677984fc1cca40e593ab714ccbf48', class: "flex flex-col gap-2" }, this.isIOS()
|
|
295
295
|
? (h("div", { class: "flex items-center gap-2" }, h("input", { type: "number", min: "10", max: "300", step: "10", class: "flex-1 px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.heatPump, onInput: (e) => {
|
|
296
296
|
const value = parseInt(e.target
|
|
297
297
|
.value);
|
|
@@ -307,45 +307,45 @@ export class SolarSystemForm {
|
|
|
307
307
|
parseInt(e.target
|
|
308
308
|
.value);
|
|
309
309
|
this.recalculate();
|
|
310
|
-
} }))))), h("div", { key: '
|
|
310
|
+
} }))))), h("div", { key: '6c8c7115d55e2c5ee6a54851cdfba688661ede4b', class: "flex flex-col bg-muted rounded-4xl p-4 gap-4" }, h("div", { key: '0a4809e48ac74da215370f112349e32a6f08e76e', class: "flex items-center justify-between" }, h("div", { key: '5f62212ef256e052b06db9e98399201bde8037b6', class: "flex items-center gap-2" }, h("input", { key: 'f2bf729c5ab14e7d9b703d8039f59090e639682f', type: "checkbox", id: "electricCar", class: "w-4 h-4 accent-tertiary border-border rounded focus:ring-tertiary focus:ring-offset-0 focus:ring-2", checked: this.electricCar, onChange: (e) => {
|
|
311
311
|
this.electricCar =
|
|
312
312
|
e.target
|
|
313
313
|
.checked;
|
|
314
314
|
this.recalculate();
|
|
315
|
-
} }), h("label", { key: '
|
|
315
|
+
} }), h("label", { key: '8a9821d04372700dbded0cb3f9717f9fd4b1b1cc', htmlFor: "electricCar", class: "text-text-muted" }, t.solarSystemForm
|
|
316
316
|
.additionalComponents
|
|
317
|
-
.electricCar))), this.electricCar && (h("div", { key: '
|
|
317
|
+
.electricCar))), this.electricCar && (h("div", { key: '6a5a852117986816aac6f472640c8b0b8a690ce4', class: "flex flex-col gap-2" }, h("div", { key: 'ec9676e4e6d833cab01cfc3cadab9549f548087e', class: "grid grid-cols-2 gap-4" }, h("label", { key: 'a1a3e882c0baff681967e07d68eb071b722a0863', class: "text-sm text-text-muted" }, t.solarSystemForm
|
|
318
318
|
.additionalComponents
|
|
319
|
-
.chargingTime), h("label", { key: '
|
|
319
|
+
.chargingTime), h("label", { key: 'e4eafc1c790249d21880125600cf953f5d863a94', class: "text-sm text-text-muted" }, t.solarSystemForm
|
|
320
320
|
.additionalComponents
|
|
321
|
-
.kilometersPerYear)), h("div", { key: '
|
|
321
|
+
.kilometersPerYear)), h("div", { key: '915c1dd050ae00d84e6b20d378cfed197ba8c8de', class: "grid grid-cols-2 gap-4" }, h("select", { key: '7e3787b7c6a459e64e8d6cef1d1b2c435f98e98e', class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", onChange: (e) => {
|
|
322
322
|
this.electricCarChargingTime =
|
|
323
323
|
e.target
|
|
324
324
|
.value;
|
|
325
325
|
this.recalculate();
|
|
326
|
-
}, style: borderStyle }, h("option", { key: '
|
|
326
|
+
}, style: borderStyle }, h("option", { key: 'e5dc819ba30e96cd784f8b0eb16ef1117f7a3227', value: "day", selected: this
|
|
327
327
|
.electricCarChargingTime ===
|
|
328
328
|
"day" }, t.solarSystemForm
|
|
329
329
|
.additionalComponents
|
|
330
|
-
.chargingTimeDay), h("option", { key: '
|
|
330
|
+
.chargingTimeDay), h("option", { key: 'b76054befb0c77256f33c6d8162978c5648ac464', value: "night", selected: this
|
|
331
331
|
.electricCarChargingTime ===
|
|
332
332
|
"night" }, t.solarSystemForm
|
|
333
333
|
.additionalComponents
|
|
334
|
-
.chargingTimeNight)), h("input", { key: '
|
|
334
|
+
.chargingTimeNight)), h("input", { key: 'fa135ccd00d2a6672a54fed11ed38d8458ea1e7c', type: "number", min: "1000", max: "50000", step: "1000", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", value: this.kmDrivenPerYear, onInput: (e) => {
|
|
335
335
|
this.kmDrivenPerYear =
|
|
336
336
|
parseInt(e.target
|
|
337
337
|
.value);
|
|
338
338
|
this.recalculate();
|
|
339
|
-
}, style: borderStyle }))))), h("div", { key: '
|
|
339
|
+
}, style: borderStyle }))))), h("div", { key: '2148cbff01986d7fa86e8b03e47c57d90f712360', class: "flex flex-col bg-muted rounded-4xl p-4 gap-4" }, h("div", { key: 'fd86a822750f62629e88c084d92377eece3ebbd4', class: "flex items-center justify-between" }, h("div", { key: '212d9da35671fd2f1d7c243bc2052e253f9e26d9', class: "flex items-center gap-2" }, h("input", { key: '6a9a6b27378919e1c6f48e9c5dfae03ef7d97646', type: "checkbox", id: "battery", class: "w-4 h-4 accent-tertiary border-border rounded-full focus:ring-tertiary focus:ring-offset-0 focus:ring-2", checked: this.battery > 0, onChange: (e) => {
|
|
340
340
|
this.battery =
|
|
341
341
|
e.target
|
|
342
342
|
.checked
|
|
343
343
|
? 5
|
|
344
344
|
: 0;
|
|
345
345
|
this.recalculate();
|
|
346
|
-
} }), h("label", { key: '
|
|
346
|
+
} }), h("label", { key: '3ff0e094dfe08e2a4c401243aaebf6480c2cfafc', htmlFor: "battery", class: "text-text-muted" }, t.solarSystemForm
|
|
347
347
|
.additionalComponents
|
|
348
|
-
.battery)), (this.battery > 0 && !this.isIOS()) && (h("span", { key: '
|
|
348
|
+
.battery)), (this.battery > 0 && !this.isIOS()) && (h("span", { key: '585a71124051d15ea2cc342bee629a8c494239d7', class: "text-text-muted" }, this.battery, " kWh"))), this.battery > 0 && (h("div", { key: '6d74a5cda4b8834860ff972eb293e86527b830c9', class: "flex flex-col gap-2" }, this.isIOS()
|
|
349
349
|
? (h("div", { class: "flex items-center gap-2" }, h("input", { type: "number", min: "1", max: "20", step: "1", class: "flex-1 px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", value: this.battery, onInput: (e) => {
|
|
350
350
|
const value = parseInt(e.target
|
|
351
351
|
.value);
|
|
@@ -360,52 +360,52 @@ export class SolarSystemForm {
|
|
|
360
360
|
this.battery = parseInt(e.target
|
|
361
361
|
.value);
|
|
362
362
|
this.recalculate();
|
|
363
|
-
} }))))))), h("div", { key: '
|
|
363
|
+
} }))))))), h("div", { key: 'e2d75f070f8c3c41a9cfd4adda9d14e9b34fbbab', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'ba377a0cc8b569320a3e0e057a034819ad227c7b', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.electricityCostsTitle), h("div", { key: '070c1e3a58c2568e171df10274a5e57aa49044a1', style: {
|
|
364
364
|
display: "grid",
|
|
365
365
|
gridTemplateColumns: "repeat(auto-fit, minmax(250px, 1fr))",
|
|
366
366
|
gap: "1rem",
|
|
367
|
-
} }, h("div", { key: '
|
|
367
|
+
} }, h("div", { key: 'bec93178987f87678bccb9132acff50a983a38e6' }, h("label", { key: 'f8cdb70052462357f1ebb63bb76833d6987b8d1f', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.electricityPrice), h("input", { key: '40c29d37ee01616589c83001f8186a3bd96a7185', type: "number", step: "0.01", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.electricityPrice.toFixed(2), onInput: (e) => {
|
|
368
368
|
this.electricityPrice = parseFloat(e.target
|
|
369
369
|
.value);
|
|
370
370
|
this.recalculate();
|
|
371
|
-
} })), h("div", { key: '
|
|
371
|
+
} })), h("div", { key: '88003e2615bacc56b5431477a23cb58ab2c086d1' }, h("label", { key: '85b506656400f55c43cda84296b6099ffd288ffa', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.compensationRate), h("input", { key: 'd208d073142c69d94156731407f9252dbeeb515f', type: "number", step: "0.01", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.compensationRate.toFixed(2), onInput: (e) => {
|
|
372
372
|
this.compensationRate = parseFloat(e.target
|
|
373
373
|
.value);
|
|
374
374
|
this.recalculate();
|
|
375
|
-
} })), h("div", { key: '
|
|
375
|
+
} })), h("div", { key: '2cdf720721e6d0bcc68251f44c2d1f35e68a72af' }, h("label", { key: '914cb694b2e155b3fb2c175575652c62c5faba48', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.annualPriceIncrease), h("input", { key: 'f5eae03441d921092a1059f12791b5089d723604', type: "number", step: "0.1", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.annualPriceIncrease.toFixed(1), onInput: (e) => {
|
|
376
376
|
this.annualPriceIncrease = parseFloat(e.target
|
|
377
377
|
.value);
|
|
378
378
|
this.recalculate();
|
|
379
|
-
} })))), h("div", { key: '
|
|
379
|
+
} })))), h("div", { key: '0997b03cf6fc81af0bd88326de1e3eb7d82383ba', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'faa0a1320b89856ca7d21987ecffd7acf9fff7d2', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.resultsTitle), h("div", { key: '0de956455634f10fa2c3ee446ef408c1c1379fd8', class: "bg-muted rounded-4xl p-4" }, h("div", { key: '9785278b17204c208a6dcf9cb725aa504f287695', class: "flex flex-col sm:flex-row sm:items-center justify-between" }, h("span", { key: 'f5fa467fdd8fceaf3520905ba281347b98d28978', class: "text-text-muted" }, t.solarSystemForm.autonomy), h("span", { key: 'a70afec8557be41ab510ed3cc4c8725b9c42ca0d', class: "text-xl font-bold text-secondary mt-1 sm:mt-0" }, this.autonomy > 100
|
|
380
380
|
? "100"
|
|
381
|
-
: this.formatEuropeanNumber(this.autonomy, 1), "%")), h("div", { key: '
|
|
382
|
-
.solarSystemForm.year)), h("div", { key: '
|
|
383
|
-
.monetaryBenefit20Years)), h("span", { key: '
|
|
381
|
+
: this.formatEuropeanNumber(this.autonomy, 1), "%")), h("div", { key: '9b9eef4e512e1b1638723adfed3546138e9639f7', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("span", { key: 'e56aace60e06d29e6a4a37da366734ed462fec45', class: "text-text-muted" }, t.solarSystemForm.totalEnergyConsumption), h("span", { key: '99d3c569ffab6950c47acaf62a3de4a9adae865a', class: "text-xl font-bold text-secondary mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.totalEnergyConsumption, 0), " kWh/", t.solarSystemForm.year)), h("div", { key: '3347f4ec972333f3e18db8b401609ab20b8a1081', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("span", { key: 'c590ae2fdc8162d058072f856b24fbe43390376d', class: "text-text-muted" }, t.solarSystemForm.totalEnergyProduction), h("span", { key: 'b27c9cc1718635c790c1d48f58fd4b9fc23d8b80', class: "text-xl font-bold text-secondary mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.totalEnergyProduction, 0), " kWh/", t.solarSystemForm.year)), h("div", { key: 'e800c4780891997859381fb60edc001dd071d6c1', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("div", { key: 'b5247a88b14de6ae9b2ce8e1a779ff0cad81cd07', class: "flex items-center gap-2" }, h("span", { key: '8370e3ea7372c5a54ba97a6b8fcdad431f507062', class: "text-text-muted" }, t.solarSystemForm.costSavings)), h("span", { key: '229bc59b95c275ef31922c93ce83270901b2c9c8', class: "text-xl font-bold text-success mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.costSavings), "\u20AC/", t
|
|
382
|
+
.solarSystemForm.year)), h("div", { key: '0f814b127c62bb3734cfb953daed01f63d4410ef', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("div", { key: '1e7106e04c1c255f989f252b773129c979c578c2', class: "flex items-center gap-2" }, h("span", { key: '7c0038774cbdf0dbade48f01fefd52390276b6ad', class: "text-text-muted" }, t.solarSystemForm.compensation20Years)), h("span", { key: '7bb7ec01098ebc11b903b9ad86dc5fa4daa0e2fb', class: "text-xl font-bold text-success mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.compensation20Years), "\u20AC")), h("div", { key: '7c412b9eed8946a0c429d503e3267ee355597c19', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("div", { key: '4f84bb48e3129fda7e67dc246fb528c0d9d2da64', class: "flex items-center gap-2" }, h("span", { key: 'd22ff2fdb7d48feefef81a21c1c7afc208c57b46', class: "text-text-muted" }, t.solarSystemForm
|
|
383
|
+
.monetaryBenefit20Years)), h("span", { key: 'ee077e796e852bc5267e53cbbba2e63472cd4042', class: "text-xl font-bold text-success mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.savedCosts20Years), "\u20AC")))), h("div", { key: 'b3acf989b51c9cc06ecf12c8a7241bd9dacdaf5d', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: '450dfbb3a61eb297f7b1eda98b0a1a1cbe25a9cb', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.requestOffer), h("div", { key: 'a09d2165122481dabd30dee31adf726f4d1ec675', style: {
|
|
384
384
|
display: "grid",
|
|
385
385
|
gridTemplateColumns: "repeat(auto-fit, minmax(250px, 1fr))",
|
|
386
386
|
gap: "1rem",
|
|
387
|
-
} }, h("div", { key: '
|
|
387
|
+
} }, h("div", { key: '26ce393447d7aa425d5448b751c4ea2e2088d951' }, h("label", { key: 'aa4bdbbc1c21d48ac8b2f3e936572b943e22846e', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.name), h("input", { key: 'a6c7a0bff5f44723f814c893a211911f4cfffd09', type: "text", class: `w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground`, style: this.nameError
|
|
388
388
|
? errorBorderStyle
|
|
389
389
|
: borderStyle, value: this.name, onInput: (e) => {
|
|
390
390
|
this.name =
|
|
391
391
|
e.target
|
|
392
392
|
.value;
|
|
393
393
|
this.validateForm();
|
|
394
|
-
}, placeholder: "Your name" }), this.nameError && (h("p", { key: '
|
|
394
|
+
}, placeholder: "Your name" }), this.nameError && (h("p", { key: 'd1f07fddb4323979be4381a81340cf124e24db85', class: "text-error text-sm mt-1" }, this.nameError))), h("div", { key: '76e537f26bac79cd95b8fa91963f461fe292e642' }, h("label", { key: 'a6a00a29b2d8093d7c7d4779757613849955f34f', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.email), h("input", { key: 'bc3191a8fe75b3fcdf7ea5c0d34f3a456607a231', type: "email", class: `w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground`, style: this.emailError
|
|
395
395
|
? errorBorderStyle
|
|
396
396
|
: borderStyle, value: this.email, onInput: (e) => {
|
|
397
397
|
this.email =
|
|
398
398
|
e.target
|
|
399
399
|
.value;
|
|
400
400
|
this.validateForm();
|
|
401
|
-
}, placeholder: "your.email@example.com" }), this.emailError && (h("p", { key: '
|
|
401
|
+
}, placeholder: "your.email@example.com" }), this.emailError && (h("p", { key: '9e1039e0e200f8e58f56159b41ad2d622b21deda', class: "text-error text-sm mt-1" }, this.emailError))), h("div", { key: '3bda8788e10cc6754ac4adf43abde9c4c01cfff1' }, h("label", { key: '8e04f620261552f13e07bbb84cd814cdfbb545c5', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.phone), h("input", { key: 'a2b6b2f56ad93b9cb690683daa10779987423fbd', type: "tel", class: `w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground`, style: this.phoneError
|
|
402
402
|
? errorBorderStyle
|
|
403
403
|
: borderStyle, value: this.phone, onInput: (e) => {
|
|
404
404
|
this.phone =
|
|
405
405
|
e.target
|
|
406
406
|
.value;
|
|
407
407
|
this.validateForm();
|
|
408
|
-
}, placeholder: "+34 123 456 789" }), this.phoneError && (h("p", { key: '
|
|
408
|
+
}, placeholder: "+34 123 456 789" }), this.phoneError && (h("p", { key: 'b7a1376df5dcdf99587ece835333c4fb9f4a59b5', class: "text-error text-sm mt-1" }, this.phoneError)))), h("div", { key: '25d505f689b02c4b16cc9facdb8139708435222f', class: "flex flex-col items-center gap-4" }, h("button", { key: 'b6361bf33d70ef94fa812274e055c880b45824d5', onClick: () => this.handleRequestOffer(), disabled: !this.name.trim() ||
|
|
409
409
|
!this.email.trim() || !!this.nameError ||
|
|
410
410
|
!!this.emailError || !!this.phoneError ||
|
|
411
411
|
this.isSubmitting, class: `px-6 py-3 rounded-4xl transition-colors duration-200 flex items-center gap-2 ${this.isSubmitting
|
|
@@ -414,9 +414,9 @@ export class SolarSystemForm {
|
|
|
414
414
|
color: this.isSubmitting
|
|
415
415
|
? "var(--color-text-muted)"
|
|
416
416
|
: "#ffffff",
|
|
417
|
-
} }, this.isSubmitting && (h("div", { key: '
|
|
417
|
+
} }, this.isSubmitting && (h("div", { key: 'c65535e0b52108d8c79340cfc7ff89d3b65082e5', class: "w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin" })), this.isSubmitting
|
|
418
418
|
? t.solarSystemForm.sending
|
|
419
|
-
: t.solarSystemForm.requestOfferButton), this.submitMessage && (h("div", { key: '
|
|
419
|
+
: t.solarSystemForm.requestOfferButton), this.submitMessage && (h("div", { key: '061a4c8ae79d7f04300a307f6a569e578546e20b', class: `text-sm px-4 py-2 rounded-4xl ${this.submitSuccess
|
|
420
420
|
? "bg-success/10 text-success border border-success/20"
|
|
421
421
|
: "bg-error/10 text-error border border-error/20"}` }, this.submitMessage)))))));
|
|
422
422
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export class LoadingWidget {
|
|
3
3
|
render() {
|
|
4
|
-
return (h("div", { key: '
|
|
4
|
+
return (h("div", { key: '60316e73e9161a81e299e5e0632fc83c30d3fc15', class: "absolute flex items-center justify-center bg-muted bg-opacity-75 z-20 pt-7 rounded-4xl" }, h("div", { key: 'f8edb698475d859fe07e53efe8e66a42e66dba29', class: "animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-secondary" })));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "loading-widget"; }
|
|
7
7
|
static get originalStyleUrls() {
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class ToastNotification {
|
|
3
|
+
message = "";
|
|
4
|
+
type = "info";
|
|
5
|
+
duration = 5000; // Duration in milliseconds
|
|
6
|
+
isVisible = false;
|
|
7
|
+
isExiting = false;
|
|
8
|
+
timeoutId;
|
|
9
|
+
componentWillLoad() {
|
|
10
|
+
this.showToast();
|
|
11
|
+
}
|
|
12
|
+
showToast() {
|
|
13
|
+
this.isVisible = true;
|
|
14
|
+
this.isExiting = false;
|
|
15
|
+
// Auto-hide after duration
|
|
16
|
+
this.timeoutId = window.setTimeout(() => {
|
|
17
|
+
this.hideToast();
|
|
18
|
+
}, this.duration);
|
|
19
|
+
}
|
|
20
|
+
hideToast() {
|
|
21
|
+
this.isExiting = true;
|
|
22
|
+
// Remove from DOM after animation completes
|
|
23
|
+
// setTimeout(() => {
|
|
24
|
+
// this.isVisible = false;
|
|
25
|
+
// }, 300); // Match the CSS transition duration
|
|
26
|
+
}
|
|
27
|
+
disconnectedCallback() {
|
|
28
|
+
if (this.timeoutId) {
|
|
29
|
+
clearTimeout(this.timeoutId);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
getToastStyles() {
|
|
33
|
+
const baseStyles = "fixed bottom-4 left-1/2 transform -translate-x-1/2 z-50 px-4 py-3 rounded-lg shadow-lg transition-all duration-300 ease-in-out";
|
|
34
|
+
const typeStyles = {
|
|
35
|
+
success: "bg-success/90 text-success-foreground border border-success/20",
|
|
36
|
+
info: "bg-info/90 text-info-foreground border border-info/20",
|
|
37
|
+
warning: "bg-warning/90 text-warning-foreground border border-warning/20",
|
|
38
|
+
error: "bg-error/90 text-error-foreground border border-error/20",
|
|
39
|
+
};
|
|
40
|
+
const animationStyles = this.isExiting
|
|
41
|
+
? "opacity-0 translate-y-2 scale-95"
|
|
42
|
+
: "opacity-100 translate-y-0 scale-100";
|
|
43
|
+
return `${baseStyles} ${typeStyles[this.type]} ${animationStyles}`;
|
|
44
|
+
}
|
|
45
|
+
render() {
|
|
46
|
+
if (!this.isVisible) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return (h("div", { class: this.getToastStyles() }, h("div", { class: "flex items-center gap-2" }, h("span", { class: "text-sm font-medium" }, this.message))));
|
|
50
|
+
}
|
|
51
|
+
static get is() { return "toast-notification"; }
|
|
52
|
+
static get originalStyleUrls() {
|
|
53
|
+
return {
|
|
54
|
+
"$": ["../../output.css"]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
static get styleUrls() {
|
|
58
|
+
return {
|
|
59
|
+
"$": ["../../output.css"]
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
static get properties() {
|
|
63
|
+
return {
|
|
64
|
+
"message": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"attribute": "message",
|
|
67
|
+
"mutable": false,
|
|
68
|
+
"complexType": {
|
|
69
|
+
"original": "string",
|
|
70
|
+
"resolved": "string",
|
|
71
|
+
"references": {}
|
|
72
|
+
},
|
|
73
|
+
"required": false,
|
|
74
|
+
"optional": false,
|
|
75
|
+
"docs": {
|
|
76
|
+
"tags": [],
|
|
77
|
+
"text": ""
|
|
78
|
+
},
|
|
79
|
+
"getter": false,
|
|
80
|
+
"setter": false,
|
|
81
|
+
"reflect": false,
|
|
82
|
+
"defaultValue": "\"\""
|
|
83
|
+
},
|
|
84
|
+
"type": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"attribute": "type",
|
|
87
|
+
"mutable": false,
|
|
88
|
+
"complexType": {
|
|
89
|
+
"original": "\"success\" | \"info\" | \"warning\" | \"error\"",
|
|
90
|
+
"resolved": "\"error\" | \"info\" | \"success\" | \"warning\"",
|
|
91
|
+
"references": {}
|
|
92
|
+
},
|
|
93
|
+
"required": false,
|
|
94
|
+
"optional": false,
|
|
95
|
+
"docs": {
|
|
96
|
+
"tags": [],
|
|
97
|
+
"text": ""
|
|
98
|
+
},
|
|
99
|
+
"getter": false,
|
|
100
|
+
"setter": false,
|
|
101
|
+
"reflect": false,
|
|
102
|
+
"defaultValue": "\"info\""
|
|
103
|
+
},
|
|
104
|
+
"duration": {
|
|
105
|
+
"type": "number",
|
|
106
|
+
"attribute": "duration",
|
|
107
|
+
"mutable": false,
|
|
108
|
+
"complexType": {
|
|
109
|
+
"original": "number",
|
|
110
|
+
"resolved": "number",
|
|
111
|
+
"references": {}
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"optional": false,
|
|
115
|
+
"docs": {
|
|
116
|
+
"tags": [],
|
|
117
|
+
"text": ""
|
|
118
|
+
},
|
|
119
|
+
"getter": false,
|
|
120
|
+
"setter": false,
|
|
121
|
+
"reflect": false,
|
|
122
|
+
"defaultValue": "5000"
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
static get states() {
|
|
127
|
+
return {
|
|
128
|
+
"isVisible": {},
|
|
129
|
+
"isExiting": {}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=toast-notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-notification.js","sourceRoot":"","sources":["../../../src/components/widgets/toast-notification.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAO1D,MAAM,OAAO,iBAAiB;IAE1B,OAAO,GAAW,EAAE,CAAC;IAErB,IAAI,GAA6C,MAAM,CAAC;IAExD,QAAQ,GAAW,IAAI,CAAC,CAAC,2BAA2B;IAG5C,SAAS,GAAY,KAAK,CAAC;IAE3B,SAAS,GAAY,KAAK,CAAC;IAE3B,SAAS,CAAS;IAE1B,iBAAiB;QACb,IAAI,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC;IAEO,SAAS;QACb,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAEvB,2BAA2B;QAC3B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;YACpC,IAAI,CAAC,SAAS,EAAE,CAAC;QACrB,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtB,CAAC;IAEO,SAAS;QACb,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,4CAA4C;QAC5C,qBAAqB;QACrB,8BAA8B;QAC9B,gDAAgD;IACpD,CAAC;IAED,oBAAoB;QAChB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACjB,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;IACL,CAAC;IAEO,cAAc;QAClB,MAAM,UAAU,GACZ,gIAAgI,CAAC;QAErI,MAAM,UAAU,GAAG;YACf,OAAO,EACH,gEAAgE;YACpE,IAAI,EAAE,uDAAuD;YAC7D,OAAO,EACH,gEAAgE;YACpE,KAAK,EAAE,0DAA0D;SACpE,CAAC;QAEF,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS;YAClC,CAAC,CAAC,kCAAkC;YACpC,CAAC,CAAC,qCAAqC,CAAC;QAE5C,OAAO,GAAG,UAAU,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,eAAe,EAAE,CAAC;IACvE,CAAC;IAED,MAAM;QACF,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,OAAO,CACH,WAAK,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE;YAC7B,WAAK,KAAK,EAAC,yBAAyB;gBAChC,YAAM,KAAK,EAAC,qBAAqB,IAAE,IAAI,CAAC,OAAO,CAAQ,CACrD,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, State } from \"@stencil/core\";\r\n\r\n@Component({\r\n tag: \"toast-notification\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class ToastNotification {\r\n @Prop()\r\n message: string = \"\";\r\n @Prop()\r\n type: \"success\" | \"info\" | \"warning\" | \"error\" = \"info\";\r\n @Prop()\r\n duration: number = 5000; // Duration in milliseconds\r\n\r\n @State()\r\n private isVisible: boolean = false;\r\n @State()\r\n private isExiting: boolean = false;\r\n\r\n private timeoutId: number;\r\n\r\n componentWillLoad() {\r\n this.showToast();\r\n }\r\n\r\n private showToast() {\r\n this.isVisible = true;\r\n this.isExiting = false;\r\n\r\n // Auto-hide after duration\r\n this.timeoutId = window.setTimeout(() => {\r\n this.hideToast();\r\n }, this.duration);\r\n }\r\n\r\n private hideToast() {\r\n this.isExiting = true;\r\n\r\n // Remove from DOM after animation completes\r\n // setTimeout(() => {\r\n // this.isVisible = false;\r\n // }, 300); // Match the CSS transition duration\r\n }\r\n\r\n disconnectedCallback() {\r\n if (this.timeoutId) {\r\n clearTimeout(this.timeoutId);\r\n }\r\n }\r\n\r\n private getToastStyles() {\r\n const baseStyles =\r\n \"fixed bottom-4 left-1/2 transform -translate-x-1/2 z-50 px-4 py-3 rounded-lg shadow-lg transition-all duration-300 ease-in-out\";\r\n\r\n const typeStyles = {\r\n success:\r\n \"bg-success/90 text-success-foreground border border-success/20\",\r\n info: \"bg-info/90 text-info-foreground border border-info/20\",\r\n warning:\r\n \"bg-warning/90 text-warning-foreground border border-warning/20\",\r\n error: \"bg-error/90 text-error-foreground border border-error/20\",\r\n };\r\n\r\n const animationStyles = this.isExiting\r\n ? \"opacity-0 translate-y-2 scale-95\"\r\n : \"opacity-100 translate-y-0 scale-100\";\r\n\r\n return `${baseStyles} ${typeStyles[this.type]} ${animationStyles}`;\r\n }\r\n\r\n render() {\r\n if (!this.isVisible) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div class={this.getToastStyles()}>\r\n <div class=\"flex items-center gap-2\">\r\n <span class=\"text-sm font-medium\">{this.message}</span>\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|