tek-ms-recap 1.0.10 → 1.0.11

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.
@@ -18,6 +18,7 @@ export interface RenderInterfaceRecap {
18
18
  onConfirm: (items: RecapItem[], customer: Customer) => void;
19
19
  onCancel: (items: RecapItem[]) => void;
20
20
  onSaveCustomer?: (customer: Customer) => void;
21
+ selectedCustomer?: (customer: Customer) => void;
21
22
  }
22
23
  export declare class RecapSheet {
23
24
  private el;
@@ -31,6 +32,7 @@ export declare class RecapSheet {
31
32
  private onConfirm?;
32
33
  private onCancel?;
33
34
  private onSaveCustomer?;
35
+ private setSelectedCustomer?;
34
36
  constructor(mountPoint: HTMLElement);
35
37
  getItems(): RecapItem[];
36
38
  setItems(_items: RecapItem[]): void;
package/dist/ms-recap.js CHANGED
@@ -29,6 +29,7 @@ var t = [
29
29
  onConfirm;
30
30
  onCancel;
31
31
  onSaveCustomer;
32
+ setSelectedCustomer;
32
33
  constructor(e) {
33
34
  this.el = e, this.clientOverlayEl = document.createElement("div"), this.clientOverlayEl.id = "recap-client-overlay", document.body.appendChild(this.clientOverlayEl), this.newClientOverlayEl = document.createElement("div"), this.newClientOverlayEl.id = "recap-new-client-overlay", document.body.appendChild(this.newClientOverlayEl);
34
35
  }
@@ -60,7 +61,7 @@ var t = [
60
61
  return t[n % t.length];
61
62
  }
62
63
  render(t) {
63
- this.setItems(t.items), this.customers = t.customers, this.onConfirm = t.onConfirm, this.onCancel = t.onCancel, this.onSaveCustomer = t.onSaveCustomer, this.selectedCustomer = null, this.el.innerHTML = `
64
+ this.setItems(t.items), this.customers = t.customers, this.onConfirm = t.onConfirm, this.onCancel = t.onCancel, this.onSaveCustomer = t.onSaveCustomer, this.setSelectedCustomer = t.selectedCustomer, this.selectedCustomer = null, this.el.innerHTML = `
64
65
  <div class="overlay show" id="recap-overlay">
65
66
  <div class="sheet modal-recap" style="max-height:88vh;">
66
67
  <div class="sheet-handle"></div>
@@ -119,7 +120,7 @@ var t = [
119
120
  if (e) {
120
121
  if (this.selectedCustomer) {
121
122
  let t = this.selectedCustomer;
122
- e.innerHTML = `
123
+ this.setSelectedCustomer?.(t), e.innerHTML = `
123
124
  <div style="display:flex; align-items:center; gap:10px; text-align:left;">
124
125
  <div class="avatar" style="background:${this.avatarColorFor(t.phone)}; width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:11px; flex-shrink:0;">
125
126
  ${this.getCustomerInitials(t.firstname, t.lastname)}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tek-ms-recap",
3
3
  "private": false,
4
- "version": "v1.0.10",
4
+ "version": "v1.0.11",
5
5
  "type": "module",
6
6
  "main": "./dist/ms-recap.js",
7
7
  "module": "./dist/ms-recap.js",