@isaiahiroko/tilmart-ngx-apps-admin 0.2.9 → 0.2.13

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.
Files changed (95) hide show
  1. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-sbSJXda_.mjs +92 -0
  2. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-sbSJXda_.mjs.map +1 -0
  3. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-EooAWVy_.mjs +73 -0
  4. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-EooAWVy_.mjs.map +1 -0
  5. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-DrKEqPkW.mjs +605 -0
  6. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-DrKEqPkW.mjs.map +1 -0
  7. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-u5VyaNWX.mjs +97 -0
  8. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-u5VyaNWX.mjs.map +1 -0
  9. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-claims.module-Dk9mz7Wj.mjs → isaiahiroko-tilmart-ngx-apps-admin-claims.module-CLtalsnJ.mjs} +3 -3
  10. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-CLtalsnJ.mjs.map +1 -0
  11. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-BCkLIQta.mjs +88 -0
  12. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-BCkLIQta.mjs.map +1 -0
  13. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-customers.module-CslGiOdq.mjs → isaiahiroko-tilmart-ngx-apps-admin-customers.module-BohEH2SB.mjs} +2 -2
  14. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-customers.module-CslGiOdq.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-customers.module-BohEH2SB.mjs.map} +1 -1
  15. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-z6apTF3A.mjs +86 -0
  16. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-z6apTF3A.mjs.map +1 -0
  17. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-homepage.module-ClHkgqXm.mjs → isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BHgvPIY1.mjs} +38 -12
  18. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BHgvPIY1.mjs.map +1 -0
  19. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-TryMzSXT.mjs → isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-Dnh9hEz_.mjs} +3 -3
  20. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-Dnh9hEz_.mjs.map +1 -0
  21. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-json-builder.component-BFroIYk9.mjs +1579 -0
  22. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-json-builder.component-BFroIYk9.mjs.map +1 -0
  23. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs → isaiahiroko-tilmart-ngx-apps-admin-list-page.base-ChfiBo_X.mjs} +29 -5
  24. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-list-page.base-ChfiBo_X.mjs.map +1 -0
  25. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-aIW0jRhm.mjs +239 -0
  26. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-aIW0jRhm.mjs.map +1 -0
  27. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-overview.module-C6gjcJ84.mjs +105 -0
  28. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-overview.module-C6gjcJ84.mjs.map +1 -0
  29. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-payments.module-DstLDYM7.mjs → isaiahiroko-tilmart-ngx-apps-admin-payments.module-Bej9cdwM.mjs} +3 -3
  30. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-Bej9cdwM.mjs.map +1 -0
  31. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-pickup-locations.module-CKCz9CBw.mjs +634 -0
  32. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-pickup-locations.module-CKCz9CBw.mjs.map +1 -0
  33. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-Dh7PTGG7.mjs +88 -0
  34. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-Dh7PTGG7.mjs.map +1 -0
  35. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-B8gaByYE.mjs +81 -0
  36. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-B8gaByYE.mjs.map +1 -0
  37. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-referrals.module-BIAY4L_u.mjs → isaiahiroko-tilmart-ngx-apps-admin-referrals.module-7OLTrySw.mjs} +3 -3
  38. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-referrals.module-7OLTrySw.mjs.map +1 -0
  39. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-fjoFzY6t.mjs +137 -0
  40. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-fjoFzY6t.mjs.map +1 -0
  41. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-returns.module-C9Iu9CX6.mjs → isaiahiroko-tilmart-ngx-apps-admin-returns.module-D0RKEzAr.mjs} +3 -3
  42. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-D0RKEzAr.mjs.map +1 -0
  43. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-BWZ9OBPH.mjs +84 -0
  44. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-BWZ9OBPH.mjs.map +1 -0
  45. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-settings.module-CFVgAQ2f.mjs → isaiahiroko-tilmart-ngx-apps-admin-settings.module-DZWUhyJg.mjs} +37 -7
  46. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-DZWUhyJg.mjs.map +1 -0
  47. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-BG9DCmG-.mjs +200 -0
  48. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-BG9DCmG-.mjs.map +1 -0
  49. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-staff.module-YjJJe00X.mjs → isaiahiroko-tilmart-ngx-apps-admin-staff.module-Br80U5_k.mjs} +2 -2
  50. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-staff.module-YjJJe00X.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-staff.module-Br80U5_k.mjs.map} +1 -1
  51. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-status-badge-AXfNPKaS.mjs +66 -0
  52. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-status-badge-AXfNPKaS.mjs.map +1 -0
  53. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BFbm7118.mjs +178 -0
  54. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BFbm7118.mjs.map +1 -0
  55. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-users.module-C31RJJJ_.mjs → isaiahiroko-tilmart-ngx-apps-admin-users.module-C8nNzJ5X.mjs} +2 -2
  56. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-users.module-C31RJJJ_.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-users.module-C8nNzJ5X.mjs.map} +1 -1
  57. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs +70 -48
  58. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs.map +1 -1
  59. package/package.json +1 -1
  60. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-ClIiV2uK.mjs +0 -76
  61. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-ClIiV2uK.mjs.map +0 -1
  62. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-CSp0tWes.mjs +0 -70
  63. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-CSp0tWes.mjs.map +0 -1
  64. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-BwjfFXDU.mjs +0 -562
  65. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-BwjfFXDU.mjs.map +0 -1
  66. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-uKkUREjb.mjs +0 -94
  67. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-uKkUREjb.mjs.map +0 -1
  68. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-Dk9mz7Wj.mjs.map +0 -1
  69. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-Dcu1nJBW.mjs +0 -85
  70. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-Dcu1nJBW.mjs.map +0 -1
  71. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-DF7iSJaN.mjs +0 -83
  72. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-DF7iSJaN.mjs.map +0 -1
  73. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-homepage.module-ClHkgqXm.mjs.map +0 -1
  74. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-TryMzSXT.mjs.map +0 -1
  75. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs.map +0 -1
  76. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-vldWwcAr.mjs +0 -190
  77. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-vldWwcAr.mjs.map +0 -1
  78. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-DstLDYM7.mjs.map +0 -1
  79. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-BO4zRytg.mjs +0 -94
  80. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-BO4zRytg.mjs.map +0 -1
  81. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-D8H6ujoy.mjs +0 -78
  82. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-D8H6ujoy.mjs.map +0 -1
  83. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-referrals.module-BIAY4L_u.mjs.map +0 -1
  84. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-DORiIVLQ.mjs +0 -104
  85. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-DORiIVLQ.mjs.map +0 -1
  86. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-C9Iu9CX6.mjs.map +0 -1
  87. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-fYKd3AOq.mjs +0 -81
  88. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-fYKd3AOq.mjs.map +0 -1
  89. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-CFVgAQ2f.mjs.map +0 -1
  90. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-Cs5CLamm.mjs +0 -131
  91. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-Cs5CLamm.mjs.map +0 -1
  92. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-simple-crud.base-C8SPw14H.mjs +0 -140
  93. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-simple-crud.base-C8SPw14H.mjs.map +0 -1
  94. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BSAe0CfZ.mjs +0 -102
  95. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BSAe0CfZ.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-pickup-locations.module-CKCz9CBw.mjs","sources":["../../../projects/admin/src/lib/pages/_shared/state-multiselect/state-multiselect.component.ts","../../../projects/admin/src/lib/pages/pickup-locations/pickup-locations.component.ts","../../../projects/admin/src/lib/pages/pickup-locations/pickup-locations.component.html","../../../projects/admin/src/lib/pages/pickup-locations/pickup-locations.module.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nexport interface StateOption {\n state: string;\n // shown beside the state, e.g. the site that currently ships it: \"(Abuja)\"\n hint?: string;\n // a small marker, e.g. \"📦\" when a stock site sits in that state\n badge?: string;\n badgeTitle?: string;\n}\n\nexport interface StateZone {\n code: string;\n name: string;\n states: StateOption[];\n}\n\n// index/DELIVERY.md §8.3 — a reusable multi-select for Nigerian states, grouped\n// by geopolitical zone: a tri-state checkbox per zone, one per state, search,\n// removable chips of the current selection and per-option hints/badges. Pay-on-\n// delivery rules and delivery zones can adopt it later.\n@Component({\n selector: 'x-state-multiselect',\n standalone: true,\n imports: [FormsModule],\n template: `\n <div class=\"sms\" data-testid=\"state-multiselect\">\n <div class=\"sms-bar\">\n <input class=\"sms-search\" type=\"search\" placeholder=\"Search states…\" [(ngModel)]=\"query\" data-testid=\"sms-search\" />\n <span class=\"sms-count\" data-testid=\"sms-count\">{{ selected.length }} of {{ total }} selected</span>\n <button type=\"button\" class=\"sms-link\" (click)=\"clear()\" [disabled]=\"!selected.length\" data-testid=\"sms-clear\">Clear</button>\n <button type=\"button\" class=\"sms-link\" (click)=\"toggleAllOpen()\">{{ allOpen ? 'Collapse all' : 'Expand all' }}</button>\n </div>\n\n @if (selected.length) {\n <div class=\"sms-chips\" data-testid=\"sms-chips\">\n @for (s of selected; track s) {\n <span class=\"sms-chip\">{{ s }}<button type=\"button\" aria-label=\"Remove {{ s }}\" (click)=\"toggle(s)\">×</button></span>\n }\n </div>\n }\n\n @for (z of zones; track z.code) {\n @if (visible(z).length) {\n <div class=\"sms-zone\" [attr.data-zone]=\"z.code\">\n <div class=\"sms-zone-head\">\n <input\n type=\"checkbox\"\n [checked]=\"zoneState(z) === 'all'\"\n [indeterminate]=\"zoneState(z) === 'some'\"\n (change)=\"toggleZone(z)\"\n [attr.aria-label]=\"'Select all ' + z.name\"\n [attr.data-testid]=\"'sms-zone-' + z.code\"\n />\n <button type=\"button\" class=\"sms-zone-name\" (click)=\"toggleOpen(z.code)\">\n <span class=\"sms-caret\">{{ isOpen(z.code) ? '▾' : '▸' }}</span> {{ z.name }}\n </button>\n <span class=\"sms-zone-count\">{{ zoneCount(z) }}/{{ z.states.length }}</span>\n </div>\n @if (isOpen(z.code)) {\n <div class=\"sms-states\">\n @for (o of visible(z); track o.state) {\n <label class=\"sms-state\" [class.is-on]=\"has(o.state)\">\n <input type=\"checkbox\" [checked]=\"has(o.state)\" (change)=\"toggle(o.state)\" [attr.data-testid]=\"'sms-state-' + o.state\" />\n <span>{{ o.state }}</span>\n @if (o.badge) { <span class=\"sms-badge\" [attr.title]=\"o.badgeTitle\">{{ o.badge }}</span> }\n @if (o.hint) { <span class=\"sms-hint\">({{ o.hint }})</span> }\n </label>\n }\n </div>\n }\n </div>\n }\n }\n </div>\n `,\n styles: [\n `\n .sms { display: flex; flex-direction: column; gap: 10px; }\n .sms-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }\n .sms-search { flex: 1 1 180px; min-width: 140px; padding: 6px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-md, 8px); background: transparent; color: inherit; font: inherit; font-size: 13px; }\n .sms-count { font-size: 12.5px; color: var(--color-text-muted); }\n .sms-link { appearance: none; background: none; border: 0; color: var(--color-accent-hover, #0b3a82); font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 2px 4px; }\n .sms-link:disabled { opacity: 0.4; cursor: default; }\n .sms-chips { display: flex; flex-wrap: wrap; gap: 6px; }\n .sms-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--color-brand, #0b3a82) 12%, transparent); font-size: 12px; font-weight: 600; }\n .sms-chip button { appearance: none; border: 0; background: transparent; cursor: pointer; font-size: 14px; line-height: 1; color: inherit; padding: 0 5px; }\n .sms-zone { border: 1px solid var(--color-border); border-radius: var(--radius-md, 8px); }\n .sms-zone-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; }\n .sms-zone-name { appearance: none; background: none; border: 0; font: inherit; font-weight: 700; font-size: 13.5px; color: inherit; cursor: pointer; flex: 1; text-align: left; padding: 0; }\n .sms-caret { display: inline-block; width: 14px; color: var(--color-text-muted); }\n .sms-zone-count { font-size: 12px; color: var(--color-text-muted); }\n .sms-states { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; padding: 4px 12px 10px 34px; }\n .sms-state { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }\n .sms-state.is-on { font-weight: 700; }\n .sms-hint { color: var(--color-text-muted); font-size: 12px; font-weight: 400; }\n .sms-badge { font-size: 12px; }\n `,\n ],\n})\nexport class StateMultiselectComponent {\n @Input() zones: StateZone[] = [];\n @Input() selected: string[] = [];\n @Output() selectedChange = new EventEmitter<string[]>();\n\n query = '';\n private closed = new Set<string>();\n private allCollapsed = false;\n\n get total(): number {\n return this.zones.reduce((n, z) => n + z.states.length, 0);\n }\n get allOpen(): boolean {\n return !this.allCollapsed;\n }\n\n has(state: string): boolean {\n return this.selected.some((s) => s.toLowerCase() === state.toLowerCase());\n }\n\n visible(z: StateZone): StateOption[] {\n const q = this.query.trim().toLowerCase();\n return q ? z.states.filter((o) => o.state.toLowerCase().includes(q)) : z.states;\n }\n\n zoneCount(z: StateZone): number {\n return z.states.filter((o) => this.has(o.state)).length;\n }\n\n zoneState(z: StateZone): 'none' | 'some' | 'all' {\n const n = this.zoneCount(z);\n return n === 0 ? 'none' : n === z.states.length ? 'all' : 'some';\n }\n\n toggleZone(z: StateZone): void {\n const names = z.states.map((o) => o.state);\n const next =\n this.zoneState(z) === 'all'\n ? this.selected.filter((s) => !names.some((n) => n.toLowerCase() === s.toLowerCase()))\n : [...this.selected, ...names.filter((n) => !this.has(n))];\n this.emit(next);\n }\n\n toggle(state: string): void {\n this.emit(\n this.has(state)\n ? this.selected.filter((s) => s.toLowerCase() !== state.toLowerCase())\n : [...this.selected, state],\n );\n }\n\n clear(): void {\n this.emit([]);\n }\n\n isOpen(code: string): boolean {\n // searching opens every matching zone so results are never hidden\n return !!this.query.trim() || !this.closed.has(code);\n }\n\n toggleOpen(code: string): void {\n this.closed.has(code) ? this.closed.delete(code) : this.closed.add(code);\n }\n\n toggleAllOpen(): void {\n this.allCollapsed = !this.allCollapsed;\n this.closed = this.allCollapsed ? new Set(this.zones.map((z) => z.code)) : new Set();\n }\n\n private emit(next: string[]): void {\n this.selected = next;\n this.selectedChange.emit(next);\n }\n}\n","import { Component } from '@angular/core';\nimport { BaseDirective, notify } from '@thescaffold/ngx-core';\nimport { firstValueFrom } from 'rxjs';\nimport { StateZone } from '../_shared/state-multiselect/state-multiselect.component';\n\ntype Tab = 'locations' | 'coverage' | 'inventory';\n\n// Fields persisted on the stock location (everything else on `draft` is derived).\nconst SITE_FIELDS = [\n 'name', 'type', 'street', 'city', 'state', 'lga', 'landmark', 'lat', 'lng', 'phone', 'contactName',\n 'contactEmail', 'openingHours', 'pickupNote', 'priority', 'pickupEnabled', 'providerStationIds',\n];\n\nconst IMPORT_TEMPLATE = 'sku,location,quantity\\nSKU-001,Lagos Central Warehouse,25\\nSKU-002,Abuja,10\\n';\n\n// index/DELIVERY.md §8.3 / §8.10 — Settings ▸ Pickup locations. A stock location\n// IS the pickup location: one record holds the goods and the address a courier\n// collects from. Admins decide which destination states each site ships (multi-\n// select), see coverage at a glance, and assign stock to locations (move/import).\n@Component({\n standalone: false,\n selector: 'x-pickup-locations',\n templateUrl: './pickup-locations.component.html',\n styleUrl: './pickup-locations.component.scss',\n})\nexport class PickupLocationsComponent extends BaseDirective {\n tab: Tab = 'locations';\n loading = true;\n health: any = null;\n coverage: any = null;\n stateOptions: { value: string; label: string }[] = [];\n lgaOptions: { value: string; label: string }[] = [];\n stations: any[] = [];\n\n // list\n search = '';\n showAll = false;\n\n // edit\n selectedId: string | null = null;\n draft: any = null;\n draftStates: string[] = [];\n private originalStates: string[] = [];\n saving = false;\n formError = '';\n\n // coverage table\n coverageZone = '';\n coverageAttention = false;\n coverageSelected = new Set<string>();\n bulkSite = '';\n\n // inventory: move\n moveFrom = '';\n moveRows: { id: string; variantId: string; sku: string; available: number; reserved: number; checked: boolean }[] = [];\n moveLoading = false;\n moveTo = '';\n newLoc = { name: '', state: '', city: '' };\n showNewLoc = false;\n moving = false;\n moveResult: any = null;\n\n // inventory: import\n importText = '';\n importMode: 'set' | 'add' = 'set';\n importReport: any = null;\n importNewStates: Record<string, string> = {};\n importing = false;\n\n readonly importTemplate = 'data:text/csv;charset=utf-8,' + encodeURIComponent(IMPORT_TEMPLATE);\n\n override init = () => {\n void this.refresh();\n void this.loadStates();\n };\n\n // ── data ──────────────────────────────────────────────────────────────\n private async safe<T = any>(obs: any): Promise<T | undefined> {\n try {\n return (await firstValueFrom(obs)) as T;\n } catch (e: any) {\n const body = e?.error ?? e;\n const msg = body?.message?.message ?? body?.message ?? e?.message ?? 'That did not work.';\n this.formError = String(msg);\n notify(String(msg), undefined, 'error');\n return undefined;\n }\n }\n\n async refresh(): Promise<void> {\n const [cov, health] = await Promise.all([\n this.safe(this.apiService.get('apps/commerce/stock-location/coverage/overview')),\n this.safe(this.apiService.get('apps/commerce/logistics/health')),\n ]);\n this.coverage = (cov as any)?.data ?? null;\n this.health = (health as any)?.data ?? null;\n this.loading = false;\n }\n\n private async loadStates(): Promise<void> {\n const res: any = await this.safe(\n this.apiService.on('apps/commerce/static-list-item').getMany({ listKey: 'ng-state', perPage: 200 } as any),\n );\n this.stateOptions = (res?.data ?? []).map((r: any) => ({ value: r.code, label: r.label }));\n }\n\n private async loadLgas(state: string): Promise<void> {\n this.lgaOptions = [];\n if (!state) return;\n const res: any = await this.safe(\n this.apiService.on('apps/commerce/static-list-item').getMany({ listKey: 'ng-lga', parentCode: state, perPage: 200 } as any),\n );\n this.lgaOptions = (res?.data ?? []).map((r: any) => ({ value: r.code, label: r.label }));\n }\n\n private async loadStations(state: string): Promise<void> {\n this.stations = [];\n if (!state) return;\n const res: any = await this.safe(this.apiService.get(`apps/commerce/logistics/stations?state=${encodeURIComponent(state)}`));\n this.stations = res?.data ?? [];\n }\n\n // ── derived ───────────────────────────────────────────────────────────\n get sites(): any[] {\n const all: any[] = this.coverage?.sites ?? [];\n const q = this.search.trim().toLowerCase();\n return all\n .filter((s) => this.showAll || s.pickupEnabled || (s.state && !/^tbc/i.test(s.state)) || s.stock?.units > 0 || s.id === this.selectedId)\n .filter((s) => !q || `${s.name} ${s.city ?? ''} ${s.state ?? ''}`.toLowerCase().includes(q))\n .sort((a, b) => Number(b.ready) - Number(a.ready) || b.shipsTo.length - a.shipsTo.length || a.name.localeCompare(b.name));\n }\n\n get hiddenSites(): number {\n return (this.coverage?.sites?.length ?? 0) - this.sites.length;\n }\n\n get zones(): StateZone[] {\n if (!this.coverage) return [];\n const sitesById = new Map<string, any>((this.coverage.sites ?? []).map((s: any) => [s.id, s]));\n return this.coverage.zones.map((z: any) => ({\n code: z.code,\n name: z.name,\n states: z.states.map((s: any) => ({\n state: s.state,\n // who ships it now (when it is someone else), so ticking it clearly *moves* it\n hint: s.stockLocationId && s.stockLocationId !== this.selectedId ? sitesById.get(s.stockLocationId)?.name : undefined,\n badge: s.sitesInState?.length ? '📦' : undefined,\n badgeTitle: s.sitesInState?.length ? `Stock site in ${s.state}: ${s.sitesInState.join(', ')}` : undefined,\n })),\n }));\n }\n\n get selectedSite(): any {\n return (this.coverage?.sites ?? []).find((s: any) => s.id === this.selectedId);\n }\n\n /** What Save will move / unassign — shown before the admin commits. */\n get pending(): { moved: { state: string; from: string }[]; added: string[]; unassigned: string[] } {\n const owner = new Map<string, string>();\n const sitesById = new Map<string, any>((this.coverage?.sites ?? []).map((s: any) => [s.id, s]));\n for (const z of this.coverage?.zones ?? []) for (const s of z.states) if (s.stockLocationId) owner.set(s.state, s.stockLocationId);\n const moved: { state: string; from: string }[] = [];\n const added: string[] = [];\n for (const state of this.draftStates) {\n if (this.originalStates.includes(state)) continue;\n const o = owner.get(state);\n if (o && o !== this.selectedId) moved.push({ state, from: sitesById.get(o)?.name ?? 'another site' });\n else added.push(state);\n }\n const unassigned = this.originalStates.filter((s) => !this.draftStates.includes(s));\n return { moved, added, unassigned };\n }\n\n get pendingText(): string {\n const p = this.pending;\n const parts: string[] = [];\n if (p.moved.length) parts.push(`moves ${p.moved.length} state${p.moved.length > 1 ? 's' : ''}: ${p.moved.map((m) => `${m.state} (from ${m.from})`).join(', ')}`);\n if (p.added.length) parts.push(`adds ${p.added.join(', ')}`);\n if (p.unassigned.length) parts.push(`unassigns ${p.unassigned.join(', ')} (those orders will be served automatically by whichever ready site holds the goods)`);\n return parts.length ? `Saving ${parts.join('; ')}.` : '';\n }\n\n get healthText(): string {\n const h = this.health;\n if (!h) return '';\n if (h.status === 'healthy') return `${(h.provider ?? '').toUpperCase()} delivery is working.`;\n const why =\n h.reason === 'wallet_insufficient' ? 'the GIG wallet is too low — please top it up'\n : h.reason === 'credentials_rejected' ? 'GIG rejected our login'\n : 'GIG is not responding';\n return `${(h.provider ?? '').toUpperCase()} is failing: ${why}.`;\n }\n\n // ── list / edit ───────────────────────────────────────────────────────\n async select(site: any): Promise<void> {\n this.formError = '';\n this.selectedId = site.id;\n const res: any = await this.safe(this.apiService.get(`apps/commerce/stock-location/${site.id}`));\n this.draft = { ...(res?.data ?? site) };\n this.draft.providerStationIds = this.draft.providerStationIds ?? {};\n this.originalStates = [...(site.shipsTo ?? [])];\n this.draftStates = [...this.originalStates];\n await Promise.all([this.loadLgas(this.draft.state), this.loadStations(this.draft.state)]);\n }\n\n newSite(): void {\n this.selectedId = null;\n this.formError = '';\n this.draft = { name: '', type: 'warehouse', state: '', city: '', street: '', phone: '', openingHours: '', pickupEnabled: false, priority: 0, providerStationIds: {} };\n this.originalStates = [];\n this.draftStates = [];\n this.lgaOptions = [];\n this.stations = [];\n }\n\n async onStateChange(): Promise<void> {\n this.draft.lga = '';\n this.draft.providerStationIds = {};\n await Promise.all([this.loadLgas(this.draft.state), this.loadStations(this.draft.state)]);\n }\n\n get gigStation(): string {\n return String(this.draft?.providerStationIds?.gig ?? '');\n }\n set gigStation(v: string) {\n this.draft.providerStationIds = v ? { ...this.draft.providerStationIds, gig: Number(v) } : {};\n }\n\n close(): void {\n this.draft = null;\n this.selectedId = null;\n this.formError = '';\n }\n\n async save(): Promise<void> {\n if (!this.draft?.name?.trim()) {\n this.formError = 'Give the location a name.';\n return;\n }\n this.saving = true;\n this.formError = '';\n try {\n const payload: Record<string, any> = {};\n for (const k of SITE_FIELDS) if (this.draft[k] !== undefined && this.draft[k] !== null && this.draft[k] !== '') payload[k] = this.draft[k];\n for (const k of ['lat', 'lng', 'priority']) if (payload[k] !== undefined) payload[k] = Number(payload[k]);\n let id = this.selectedId;\n if (id) {\n const r = await this.safe(this.apiService.patch(`apps/commerce/stock-location/${id}`, payload));\n if (!r) return;\n } else {\n const r: any = await this.safe(this.apiService.post('apps/commerce/stock-location', payload));\n if (!r) return;\n id = r.data?.id;\n }\n const changed = this.pending.moved.length + this.pending.added.length + this.pending.unassigned.length > 0;\n if (id && changed) {\n const r: any = await this.safe(this.apiService.put(`apps/commerce/stock-location/${id}/ships-to`, { states: this.draftStates }));\n if (!r) return;\n }\n notify('Saved.', undefined, 'success');\n await this.refresh();\n const fresh = this.coverage?.sites?.find((s: any) => s.id === id);\n if (fresh) await this.select(fresh);\n } finally {\n this.saving = false;\n }\n }\n\n async remove(): Promise<void> {\n if (!this.selectedId) return;\n if (this.draftStates.length && !confirm(`This site ships ${this.draftStates.length} state(s). Delete it anyway? They will fall back to automatic routing.`)) return;\n const r = await this.safe(this.apiService.delete(`apps/commerce/stock-location/${this.selectedId}`));\n if (!r) return;\n this.close();\n await this.refresh();\n }\n\n // ── health ────────────────────────────────────────────────────────────\n async syncStations(): Promise<void> {\n const r: any = await this.safe(this.apiService.post('apps/commerce/logistics/sync-stations', {}));\n if (r?.data) {\n notify(\n `Synced ${r.data.stations} stations.` + (r.data.needChoice?.length ? ` Choose a preferred station for: ${r.data.needChoice.join(', ')}.` : ''),\n undefined,\n 'success',\n );\n await this.refresh();\n }\n }\n\n // ── coverage table ────────────────────────────────────────────────────\n get coverageRows(): any[] {\n const rows: any[] = [];\n for (const z of this.coverage?.zones ?? []) {\n if (this.coverageZone && z.code !== this.coverageZone) continue;\n for (const s of z.states) {\n const attention = !s.stockLocationId || !s.ready;\n if (this.coverageAttention && !attention) continue;\n rows.push({ ...s, zone: z.name, attention });\n }\n }\n return rows;\n }\n\n toggleRow(state: string): void {\n this.coverageSelected.has(state) ? this.coverageSelected.delete(state) : this.coverageSelected.add(state);\n }\n\n async assignOne(state: string, siteId: string): Promise<void> {\n const r = await this.safe(this.apiService.post('apps/commerce/stock-location/assign', { states: [state], stockLocationId: siteId || null }));\n if (r) await this.refresh();\n }\n\n async assignSelected(siteId: string | null): Promise<void> {\n const states = [...this.coverageSelected];\n if (!states.length) return;\n const r = await this.safe(this.apiService.post('apps/commerce/stock-location/assign', { states, stockLocationId: siteId || null }));\n if (r) {\n this.coverageSelected.clear();\n this.bulkSite = '';\n notify(siteId ? `Assigned ${states.length} state(s).` : `Unassigned ${states.length} state(s).`, undefined, 'success');\n await this.refresh();\n }\n }\n\n // ── inventory: move ───────────────────────────────────────────────────\n async loadMoveRows(): Promise<void> {\n this.moveRows = [];\n this.moveResult = null;\n if (!this.moveFrom) return;\n this.moveLoading = true;\n try {\n const res: any = await this.safe(this.apiService.on('apps/commerce/stock-level').getMany({ locationId: this.moveFrom, perPage: 200 } as any));\n const levels: any[] = (res?.data ?? []).filter((l: any) => l.available > 0);\n this.moveRows = await Promise.all(\n levels.slice(0, 100).map(async (l) => {\n const v: any = await firstValueFrom(this.apiService.get(`apps/commerce/product-variant/${l.variantId}`)).catch(() => undefined);\n return { id: l.id, variantId: l.variantId, sku: v?.data?.sku ?? l.variantId.slice(0, 8), available: l.available, reserved: l.reserved, checked: false };\n }),\n );\n } finally {\n this.moveLoading = false;\n }\n }\n\n get moveSelected(): number {\n return this.moveRows.filter((r) => r.checked).length;\n }\n\n toggleAllMove(on: boolean): void {\n this.moveRows.forEach((r) => (r.checked = on));\n }\n\n async createInlineLocation(): Promise<void> {\n if (!this.newLoc.name.trim() || !this.newLoc.state) {\n notify('A new location needs a name and a state.', undefined, 'error');\n return;\n }\n const r: any = await this.safe(\n this.apiService.post('apps/commerce/stock-location', { name: this.newLoc.name.trim(), type: 'warehouse', state: this.newLoc.state, city: this.newLoc.city || undefined, pickupEnabled: false }),\n );\n if (r?.data?.id) {\n notify('Location created. Add its pickup details under \"By location\" to let a courier collect there.', undefined, 'success');\n this.showNewLoc = false;\n this.newLoc = { name: '', state: '', city: '' };\n await this.refresh();\n this.moveTo = r.data.id;\n }\n }\n\n async moveStock(): Promise<void> {\n const levelIds = this.moveRows.filter((r) => r.checked).map((r) => r.id);\n if (!levelIds.length || !this.moveTo) return;\n this.moving = true;\n try {\n const r: any = await this.safe(this.apiService.post('apps/commerce/stock-location/move-stock', { levelIds, toLocationId: this.moveTo }));\n if (r?.data) {\n this.moveResult = r.data;\n notify(`Moved ${r.data.units} unit(s) across ${r.data.moved} row(s).`, undefined, 'success');\n await this.loadMoveRows();\n this.moveResult = r.data;\n await this.refresh();\n }\n } finally {\n this.moving = false;\n }\n }\n\n // ── inventory: import ─────────────────────────────────────────────────\n onImportFile(ev: Event): void {\n const file = (ev.target as HTMLInputElement).files?.[0];\n if (!file) return;\n const reader = new FileReader();\n reader.onload = () => {\n this.importText = String(reader.result ?? '');\n this.importReport = null;\n };\n reader.readAsText(file);\n }\n\n private parseImport(): { sku: string; location: string; quantity: number }[] {\n const lines = this.importText.split(/\\r?\\n/).map((l) => l.trim()).filter(Boolean);\n const rows = lines.map((l) => l.split(/,|\\t|;/).map((c) => c.trim().replace(/^\"|\"$/g, '')));\n const start = /sku/i.test(rows[0]?.[0] ?? '') ? 1 : 0;\n return rows.slice(start).map(([sku, location, quantity]) => ({ sku, location, quantity: Number(quantity) }));\n }\n\n async previewImport(): Promise<void> {\n await this.runImport(true);\n }\n\n async applyImport(): Promise<void> {\n await this.runImport(false);\n }\n\n private async runImport(dryRun: boolean): Promise<void> {\n const rows = this.parseImport();\n if (!rows.length) {\n notify('Paste or upload rows as: sku, location, quantity.', undefined, 'error');\n return;\n }\n this.importing = true;\n try {\n const newLocations: Record<string, { state: string }> = {};\n for (const [name, state] of Object.entries(this.importNewStates)) if (state) newLocations[name] = { state };\n const r: any = await this.safe(this.apiService.post('apps/commerce/stock-location/import-stock', { rows, mode: this.importMode, dryRun, newLocations }));\n if (!r?.data) return;\n this.importReport = r.data;\n for (const n of r.data.unknownLocations ?? []) this.importNewStates[n] ??= '';\n if (!dryRun) {\n notify(`Imported ${r.data.applied} row(s).`, undefined, 'success');\n await this.refresh();\n }\n } finally {\n this.importing = false;\n }\n }\n\n get canApplyImport(): boolean {\n const r = this.importReport;\n return !!r && r.dryRun && r.applied > 0 && !(r.unknownLocations ?? []).length && !(r.invalid ?? []).length;\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">Pickup locations</div>\n <div class=\"x-page-subtitle\">\n The addresses a courier collects parcels from. Each is also a stock location — choose which states it ships, and where your stock is held.\n </div>\n</div>\n\n@if (health) {\n <div class=\"pl-health\" [class.is-bad]=\"health.status !== 'healthy'\" data-testid=\"delivery-health\">\n <span class=\"pl-dot\"></span>\n <div class=\"pl-health-text\">\n <strong>{{ healthText }}</strong>\n @if (health.waitingBookings) {\n <span class=\"pl-muted\"> {{ health.waitingBookings }} booking(s) waiting.</span>\n }\n @if (health.circuitOpen) {\n <span class=\"pl-muted\"> Customers currently see “delivery unavailable”.</span>\n }\n </div>\n <button type=\"button\" class=\"pl-btn\" (click)=\"syncStations()\" data-testid=\"sync-stations\">Sync carrier stations</button>\n </div>\n}\n\n<nav class=\"pl-tabs\">\n <button type=\"button\" class=\"pl-tab\" [class.is-active]=\"tab === 'locations'\" (click)=\"tab = 'locations'\" data-testid=\"tab-locations\">By location</button>\n <button type=\"button\" class=\"pl-tab\" [class.is-active]=\"tab === 'coverage'\" (click)=\"tab = 'coverage'\" data-testid=\"tab-coverage\">Coverage table</button>\n <button type=\"button\" class=\"pl-tab\" [class.is-active]=\"tab === 'inventory'\" (click)=\"tab = 'inventory'\" data-testid=\"tab-inventory\">Stock &amp; inventory</button>\n</nav>\n\n@if (loading) {\n <p class=\"pl-muted\">Loading…</p>\n} @else {\n @if (coverage?.sitesHoldingStockNotReady?.length) {\n <div class=\"pl-banner\" data-testid=\"not-ready-banner\">\n ⚠ {{ coverage.sitesHoldingStockNotReady.join(', ') }} hold{{ coverage.sitesHoldingStockNotReady.length > 1 ? '' : 's' }} stock but\n {{ coverage.sitesHoldingStockNotReady.length > 1 ? 'aren’t' : 'isn’t' }} ready for pickup — orders for those states ship from other sites.\n </div>\n }\n\n <!-- ───────────── By location ───────────── -->\n @if (tab === 'locations') {\n <div class=\"pl-split\">\n <aside class=\"pl-list\">\n <div class=\"pl-list-head\">\n <input class=\"pl-input\" type=\"search\" placeholder=\"Search locations…\" [(ngModel)]=\"search\" data-testid=\"location-search\" />\n <button type=\"button\" class=\"pl-btn pl-btn-primary\" (click)=\"newSite()\" data-testid=\"add-location\">+ Add location</button>\n </div>\n @for (s of sites; track s.id) {\n <button type=\"button\" class=\"pl-site\" [class.is-active]=\"selectedId === s.id\" (click)=\"select(s)\" [attr.data-testid]=\"'site-' + s.name\">\n <span class=\"pl-site-name\">\n <span class=\"pl-status\" [class.ok]=\"s.ready\" [class.warn]=\"!s.ready\" [title]=\"s.ready ? 'Ready' : (s.pickupEnabled ? 'Needs details' : 'Pickup not enabled')\">{{ s.ready ? '✓' : (s.pickupEnabled ? '⚠' : '⏸') }}</span>\n {{ s.name }}\n </span>\n <span class=\"pl-site-meta\">\n {{ s.shipsTo.length }} states · {{ s.stock.units ? (s.stock.products + ' products in stock') : 'no stock yet' }}\n </span>\n </button>\n } @empty {\n <p class=\"pl-muted\">No locations match.</p>\n }\n @if (hiddenSites > 0 || showAll) {\n <label class=\"pl-showall\"><input type=\"checkbox\" [(ngModel)]=\"showAll\" /> Show all {{ coverage?.sites?.length }} stock locations</label>\n }\n <button type=\"button\" class=\"pl-link\" (click)=\"tab = 'coverage'\">Coverage table →</button>\n </aside>\n\n <section class=\"pl-form\" data-testid=\"location-form\">\n @if (!draft) {\n <p class=\"pl-muted\">Choose a location on the left, or add a new one.</p>\n } @else {\n <div class=\"pl-form-head\">\n <h2>{{ selectedId ? draft.name : 'New location' }}</h2>\n <div class=\"pl-actions\">\n @if (selectedId) { <button type=\"button\" class=\"pl-btn pl-danger\" (click)=\"remove()\">Delete</button> }\n <button type=\"button\" class=\"pl-btn\" (click)=\"close()\">Close</button>\n <button type=\"button\" class=\"pl-btn pl-btn-primary\" [disabled]=\"saving\" (click)=\"save()\" data-testid=\"save-location\">{{ saving ? 'Saving…' : 'Save' }}</button>\n </div>\n </div>\n\n @if (selectedSite && !selectedSite.detailsOk) {\n <div class=\"pl-notice\" data-testid=\"placeholder-notice\">Details are still placeholders — fill in <strong>{{ selectedSite.missing.join(', ') }}</strong> before this site can be enabled for pickup.</div>\n }\n @if (formError) { <div class=\"pl-error\" role=\"alert\" data-testid=\"form-error\">{{ formError }}</div> }\n\n <div class=\"pl-grid\">\n <label class=\"pl-f\">Name <input class=\"pl-input\" [(ngModel)]=\"draft.name\" data-testid=\"f-name\" /></label>\n <label class=\"pl-f pl-check\"><input type=\"checkbox\" [(ngModel)]=\"draft.pickupEnabled\" data-testid=\"f-enabled\" /> A courier may collect here (pickup enabled)</label>\n <label class=\"pl-f pl-wide\">Street address <input class=\"pl-input\" [(ngModel)]=\"draft.street\" data-testid=\"f-street\" /></label>\n <label class=\"pl-f\">State\n <select class=\"pl-input\" [(ngModel)]=\"draft.state\" (ngModelChange)=\"onStateChange()\" data-testid=\"f-state\">\n <option value=\"\">Choose…</option>\n @for (o of stateOptions; track o.value) { <option [value]=\"o.value\">{{ o.label }}</option> }\n </select>\n </label>\n <label class=\"pl-f\">LGA\n <select class=\"pl-input\" [(ngModel)]=\"draft.lga\">\n <option value=\"\">—</option>\n @for (o of lgaOptions; track o.value) { <option [value]=\"o.value\">{{ o.label }}</option> }\n </select>\n </label>\n <label class=\"pl-f\">City / town <input class=\"pl-input\" [(ngModel)]=\"draft.city\" data-testid=\"f-city\" /></label>\n <label class=\"pl-f\">Landmark <input class=\"pl-input\" [(ngModel)]=\"draft.landmark\" /></label>\n <label class=\"pl-f\">Phone <input class=\"pl-input\" [(ngModel)]=\"draft.phone\" data-testid=\"f-phone\" /></label>\n <label class=\"pl-f\">Contact name <input class=\"pl-input\" [(ngModel)]=\"draft.contactName\" /></label>\n <label class=\"pl-f\">Contact email <input class=\"pl-input\" type=\"email\" [(ngModel)]=\"draft.contactEmail\" /></label>\n <label class=\"pl-f\">Courier can collect <input class=\"pl-input\" placeholder=\"Mon–Sat 9am–5pm\" [(ngModel)]=\"draft.openingHours\" data-testid=\"f-hours\" /></label>\n <label class=\"pl-f pl-wide\">Note for the rider <input class=\"pl-input\" placeholder=\"Gate B, ask for dispatch…\" [(ngModel)]=\"draft.pickupNote\" /></label>\n <label class=\"pl-f\">Priority <input class=\"pl-input\" type=\"number\" [(ngModel)]=\"draft.priority\" /></label>\n <label class=\"pl-f\">GIG station\n <select class=\"pl-input\" [(ngModel)]=\"gigStation\" data-testid=\"f-station\">\n <option value=\"\">Automatic</option>\n @for (st of stations; track st.id) { <option [value]=\"st.providerCode\">{{ st.providerName }}{{ st.isPreferred ? ' (preferred)' : '' }}</option> }\n </select>\n </label>\n </div>\n\n @if (selectedSite) {\n <div class=\"pl-stock\">\n Stock held here: <strong>{{ selectedSite.stock.products }}</strong> product(s), <strong>{{ selectedSite.stock.units }}</strong> unit(s).\n <button type=\"button\" class=\"pl-link\" (click)=\"tab = 'inventory'; moveFrom = selectedId || ''; loadMoveRows()\">Manage stock →</button>\n </div>\n @for (p of selectedSite.providers | keyvalue; track p.key) {\n <div class=\"pl-provider\" [class.ok]=\"p.value.ok\">{{ $any(p.key).toUpperCase() }}: {{ p.value.ok ? '✓ can collect here' : ('⚠ ' + (p.value.reason || 'not available')) }}</div>\n }\n }\n\n @if (selectedId || draft.name) {\n <h3 class=\"pl-h3\">Ships orders going to…</h3>\n <x-state-multiselect [zones]=\"zones\" [(selected)]=\"draftStates\"></x-state-multiselect>\n <p class=\"pl-pending\" data-testid=\"pending-summary\">{{ pendingText || 'No changes pending.' }}</p>\n }\n }\n </section>\n </div>\n }\n\n <!-- ───────────── Coverage table ───────────── -->\n @if (tab === 'coverage') {\n <div class=\"pl-cov-bar\">\n <select class=\"pl-input\" [(ngModel)]=\"coverageZone\" data-testid=\"cov-zone\">\n <option value=\"\">All zones</option>\n @for (z of coverage?.zones; track z.code) { <option [value]=\"z.code\">{{ z.name }}</option> }\n </select>\n <label class=\"pl-check\"><input type=\"checkbox\" [(ngModel)]=\"coverageAttention\" data-testid=\"cov-attention\" /> Needs attention only</label>\n <span class=\"pl-grow\"></span>\n @if (coverageSelected.size) {\n <span class=\"pl-muted\">{{ coverageSelected.size }} selected →</span>\n <select class=\"pl-input\" [(ngModel)]=\"bulkSite\" data-testid=\"cov-bulk-site\">\n <option value=\"\">Choose a location…</option>\n @for (s of coverage?.sites; track s.id) { @if (s.state || s.pickupEnabled) { <option [value]=\"s.id\">{{ s.name }}</option> } }\n </select>\n <button type=\"button\" class=\"pl-btn pl-btn-primary\" [disabled]=\"!bulkSite\" (click)=\"assignSelected(bulkSite)\" data-testid=\"cov-assign\">Assign</button>\n <button type=\"button\" class=\"pl-btn\" (click)=\"assignSelected(null)\" data-testid=\"cov-unassign\">Unassign</button>\n }\n </div>\n <table class=\"pl-table\" data-testid=\"coverage-table\">\n <thead><tr><th></th><th>State</th><th>Zone</th><th>Stock site in state</th><th>Ships from</th><th>Ready?</th></tr></thead>\n <tbody>\n @for (r of coverageRows; track r.state) {\n <tr [class.is-attn]=\"r.attention\">\n <td><input type=\"checkbox\" [checked]=\"coverageSelected.has(r.state)\" (change)=\"toggleRow(r.state)\" [attr.data-testid]=\"'cov-row-' + r.state\" /></td>\n <td>{{ r.state }}</td>\n <td>{{ r.zone }}</td>\n <td>{{ r.sitesInState?.join(', ') || '—' }}</td>\n <td>\n <select class=\"pl-input\" [ngModel]=\"r.stockLocationId || ''\" (ngModelChange)=\"assignOne(r.state, $event)\" [attr.data-testid]=\"'cov-site-' + r.state\">\n <option value=\"\">— none —</option>\n @for (s of coverage?.sites; track s.id) { @if (s.state || s.pickupEnabled || s.id === r.stockLocationId) { <option [value]=\"s.id\">{{ s.name }}</option> } }\n </select>\n </td>\n <td>{{ !r.stockLocationId ? '— unassigned' : r.ready ? '✓' : '⚠ not ready' }}</td>\n </tr>\n }\n </tbody>\n </table>\n }\n\n <!-- ───────────── Stock & inventory ───────────── -->\n @if (tab === 'inventory') {\n <div class=\"pl-inv\">\n <section class=\"pl-card\">\n <h3 class=\"pl-h3\">Move stock between locations</h3>\n <div class=\"pl-row\">\n <label class=\"pl-f\">From\n <select class=\"pl-input\" [(ngModel)]=\"moveFrom\" (ngModelChange)=\"loadMoveRows()\" data-testid=\"move-from\">\n <option value=\"\">Choose a location…</option>\n @for (s of coverage?.sites; track s.id) { @if (s.stock.units > 0) { <option [value]=\"s.id\">{{ s.name }} ({{ s.stock.units }} units)</option> } }\n </select>\n </label>\n </div>\n @if (moveLoading) { <p class=\"pl-muted\">Loading stock…</p> }\n @if (moveRows.length) {\n <table class=\"pl-table\" data-testid=\"move-table\">\n <thead><tr><th><input type=\"checkbox\" (change)=\"toggleAllMove($any($event.target).checked)\" aria-label=\"Select all\" /></th><th>SKU</th><th>Available</th><th>Reserved (stays)</th></tr></thead>\n <tbody>\n @for (r of moveRows; track r.id) {\n <tr><td><input type=\"checkbox\" [(ngModel)]=\"r.checked\" /></td><td>{{ r.sku }}</td><td>{{ r.available }}</td><td>{{ r.reserved }}</td></tr>\n }\n </tbody>\n </table>\n <div class=\"pl-row\">\n <label class=\"pl-f\">Move to\n <select class=\"pl-input\" [(ngModel)]=\"moveTo\" data-testid=\"move-to\">\n <option value=\"\">Choose a location…</option>\n @for (s of coverage?.sites; track s.id) { @if (s.id !== moveFrom && (s.state || s.stock.units > 0 || s.pickupEnabled)) { <option [value]=\"s.id\">{{ s.name }}</option> } }\n </select>\n </label>\n <button type=\"button\" class=\"pl-link\" (click)=\"showNewLoc = !showNewLoc\" data-testid=\"new-location-toggle\">+ New location</button>\n <button type=\"button\" class=\"pl-btn pl-btn-primary\" [disabled]=\"!moveSelected || !moveTo || moving\" (click)=\"moveStock()\" data-testid=\"move-submit\">\n {{ moving ? 'Moving…' : 'Move ' + moveSelected + ' selected' }}\n </button>\n </div>\n @if (showNewLoc) {\n <div class=\"pl-inline-new\" data-testid=\"new-location-form\">\n <input class=\"pl-input\" placeholder=\"Name\" [(ngModel)]=\"newLoc.name\" data-testid=\"nl-name\" />\n <select class=\"pl-input\" [(ngModel)]=\"newLoc.state\" data-testid=\"nl-state\">\n <option value=\"\">State…</option>\n @for (o of stateOptions; track o.value) { <option [value]=\"o.value\">{{ o.label }}</option> }\n </select>\n <input class=\"pl-input\" placeholder=\"City (optional)\" [(ngModel)]=\"newLoc.city\" />\n <button type=\"button\" class=\"pl-btn\" (click)=\"createInlineLocation()\" data-testid=\"nl-create\">Create</button>\n <span class=\"pl-muted\">Add pickup details later under “By location”.</span>\n </div>\n }\n @if (moveResult) {\n <p class=\"pl-ok\" data-testid=\"move-result\">Moved {{ moveResult.units }} unit(s) across {{ moveResult.moved }} row(s){{ moveResult.skipped ? '; ' + moveResult.skipped + ' skipped' : '' }}.</p>\n }\n } @else if (moveFrom && !moveLoading) {\n <p class=\"pl-muted\">That location has no available stock to move.</p>\n }\n </section>\n\n <section class=\"pl-card\">\n <h3 class=\"pl-h3\">Import stock</h3>\n <p class=\"pl-muted\">One row per line: <code>sku, location, quantity</code>. <a [href]=\"importTemplate\" download=\"stock-import-template.csv\">Download a template</a>.</p>\n <textarea class=\"pl-input pl-textarea\" rows=\"6\" placeholder=\"sku,location,quantity\" [(ngModel)]=\"importText\" data-testid=\"import-text\"></textarea>\n <div class=\"pl-row\">\n <input type=\"file\" accept=\".csv,.txt,text/csv\" (change)=\"onImportFile($event)\" />\n <label class=\"pl-check\"><input type=\"radio\" name=\"imode\" value=\"set\" [(ngModel)]=\"importMode\" /> Set quantity</label>\n <label class=\"pl-check\"><input type=\"radio\" name=\"imode\" value=\"add\" [(ngModel)]=\"importMode\" /> Add to quantity</label>\n <button type=\"button\" class=\"pl-btn\" [disabled]=\"importing || !importText.trim()\" (click)=\"previewImport()\" data-testid=\"import-preview\">Preview</button>\n <button type=\"button\" class=\"pl-btn pl-btn-primary\" [disabled]=\"importing || !canApplyImport\" (click)=\"applyImport()\" data-testid=\"import-apply\">Apply</button>\n </div>\n @if (importReport) {\n <div class=\"pl-report\" data-testid=\"import-report\">\n <p>{{ importReport.dryRun ? 'Preview' : 'Imported' }}: <strong>{{ importReport.applied }}</strong> of {{ importReport.rows }} row(s) OK.</p>\n @if (importReport.unknownSkus?.length) { <p class=\"pl-error\">Unknown SKUs: {{ importReport.unknownSkus.join(', ') }}</p> }\n @if (importReport.invalid?.length) { <p class=\"pl-error\">Problems: @for (i of importReport.invalid; track i.row) { row {{ i.row }} — {{ i.reason }}; }</p> }\n @if (importReport.unknownLocations?.length) {\n <p class=\"pl-error\">These locations don’t exist yet — pick a state to create them:</p>\n @for (n of importReport.unknownLocations; track n) {\n <div class=\"pl-row\"><span>{{ n }}</span>\n <select class=\"pl-input\" [(ngModel)]=\"importNewStates[n]\" (ngModelChange)=\"previewImport()\" [attr.data-testid]=\"'import-newloc-' + n\">\n <option value=\"\">State…</option>\n @for (o of stateOptions; track o.value) { <option [value]=\"o.value\">{{ o.label }}</option> }\n </select>\n </div>\n }\n }\n @if (importReport.createdLocations?.length) { <p class=\"pl-muted\">Will create: {{ importReport.createdLocations.join(', ') }}.</p> }\n </div>\n }\n </section>\n </div>\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { StateMultiselectComponent } from '../_shared/state-multiselect/state-multiselect.component';\nimport { PickupLocationsComponent } from './pickup-locations.component';\n\n@NgModule({\n declarations: [PickupLocationsComponent],\n imports: [\n SharedModule,\n StateMultiselectComponent,\n RouterModule.forChild([{ path: '', component: PickupLocationsComponent }]),\n ],\n})\nexport class PickupLocationsModule {}\n"],"names":["i2.StateMultiselectComponent","i1"],"mappings":";;;;;;;;;;AAkBA;AACA;AACA;AACA;MAgFa,yBAAyB,CAAA;AA/EtC,IAAA,WAAA,GAAA;QAgFW,IAAA,CAAA,KAAK,GAAgB,EAAE;QACvB,IAAA,CAAA,QAAQ,GAAa,EAAE;AACtB,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,YAAY,EAAY;QAEvD,IAAA,CAAA,KAAK,GAAG,EAAE;AACF,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,GAAG,EAAU;QAC1B,IAAA,CAAA,YAAY,GAAG,KAAK;AAkE7B,IAAA;AAhEC,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5D;AACA,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,CAAC,IAAI,CAAC,YAAY;IAC3B;AAEA,IAAA,GAAG,CAAC,KAAa,E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BAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,yBAAyB;AACzB,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC,CAAC;AAC3E,qBAAA;AACF,iBAAA;;;;;"}
@@ -0,0 +1,88 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, NgModule } from '@angular/core';
3
+ import * as i1$1 from '@angular/router';
4
+ import { RouterModule } from '@angular/router';
5
+ import { SharedModule } from '@thescaffold/ngx-core';
6
+ import { S as SimpleCrudDirective, J as JsonBuilderComponent } from './isaiahiroko-tilmart-ngx-apps-admin-json-builder.component-BFroIYk9.mjs';
7
+ import * as i2 from '@thescaffold/ngx-ui';
8
+ import { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
9
+ import * as i1 from '@angular/forms';
10
+ import * as i3 from '@angular/common';
11
+
12
+ // R1 production-readiness pass — PROMO-02. Was list-only; ops had no way
13
+ // to configure a discount rule. `conditions`/`actions` use the
14
+ // point-and-click builders (`_shared/rule-builders`), with an "Edit as JSON"
15
+ // switch for anything the builders don't cover.
16
+ class PromotionsComponent extends SimpleCrudDirective {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.pageTitle = 'Promotions';
20
+ this.pageSubtitle = 'Automatic and coupon-gated discount rules evaluated at checkout.';
21
+ this.singularLabel = 'promotion';
22
+ this.pluralName = 'promotions';
23
+ this.dataSource = this.apiService.on('apps/commerce/promotion');
24
+ this.columns = [
25
+ { key: 'name', value: 'Name' },
26
+ { key: 'statusHtml', value: 'Status' },
27
+ { key: 'priority', value: 'Priority' },
28
+ { key: 'usageCount', value: 'Used' },
29
+ ];
30
+ this.fields = [
31
+ { key: 'name', label: 'Name', type: 'text', required: true },
32
+ { key: 'description', label: 'Description', type: 'textarea' },
33
+ {
34
+ key: 'status',
35
+ label: 'Status',
36
+ type: 'select',
37
+ options: [
38
+ { value: 'draft', label: 'Draft' },
39
+ { value: 'active', label: 'Active' },
40
+ { value: 'paused', label: 'Paused' },
41
+ { value: 'expired', label: 'Expired' },
42
+ ],
43
+ },
44
+ { key: 'priority', label: 'Priority (lower runs first)', type: 'number' },
45
+ { key: 'stackable', label: 'Stackable with other promotions', type: 'boolean' },
46
+ { key: 'requiresCoupon', label: 'Requires a coupon code', type: 'boolean' },
47
+ { key: 'startsAt', label: 'Starts at', type: 'date' },
48
+ { key: 'endsAt', label: 'Ends at', type: 'date' },
49
+ { key: 'conditions', label: 'When it applies', type: 'builder', builder: 'conditions' },
50
+ { key: 'actions', label: 'What it does', type: 'builder', builder: 'actions' },
51
+ ];
52
+ }
53
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PromotionsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
54
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: PromotionsComponent, isStandalone: false, selector: "x-promotions", usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\n </div>\n\n @if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward every click inside the\n builder to its first checkbox -->\n <div class=\"x-scrud-f x-scrud-f-wide\" [attr.data-testid]=\"'field-' + f.key\">\n <span>{{ f.label }}</span>\n <x-json-builder [kind]=\"f.builder!\" [(value)]=\"draft[f.key]\"></x-json-builder>\n </div>\n } @else {\n <label class=\"x-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n @if (f.allowCustom) {\n <select [ngModel]=\"selectValue(f)\" (ngModelChange)=\"onSelect(f, $event)\" [attr.data-testid]=\"'select-' + f.key\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n <option [value]=\"customOption\">Other\u2026</option>\n </select>\n @if (selectValue(f) === customOption) {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || 'Type a name'\" [attr.data-testid]=\"'custom-' + f.key\" />\n }\n } @else {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n }\n </div>\n </div>\n}\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-scrud-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-scrud-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-scrud-btn:disabled{opacity:.5;cursor:default}.x-scrud-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-scrud-danger{color:var(--color-danger, #c0362c)}.x-scrud-editor{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:14px}.x-scrud-editor-head{display:flex;align-items:center;justify-content:space-between}.x-scrud-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-scrud-editor-actions{display:flex;gap:8px}.x-scrud-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-scrud-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-scrud-f-wide{grid-column:1/-1}.x-scrud-f input,.x-scrud-f select,.x-scrud-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-scrud-f input[type=checkbox]{width:18px;height:18px}.x-scrud-pwd{position:relative;display:flex}.x-scrud-pwd input{flex:1;padding-right:34px!important}.x-scrud-pwd-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);border:none;background:transparent;color:var(--color-text-muted);padding:4px 6px;cursor:pointer}.x-scrud-pwd-toggle:hover{color:var(--color-text)}.x-scrud-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-scrud-required{color:var(--color-danger, #c0362c)}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: JsonBuilderComponent, selector: "x-json-builder", inputs: ["kind", "value"], outputs: ["valueChange"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "component", type: i2.CollectionComponent, selector: "x-webget-collection", inputs: ["data"], outputs: ["search", "filter", "refresh", "select", "page", "show"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
55
+ }
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PromotionsComponent, decorators: [{
57
+ type: Component,
58
+ args: [{ standalone: false, selector: 'x-promotions', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\n </div>\n\n @if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward every click inside the\n builder to its first checkbox -->\n <div class=\"x-scrud-f x-scrud-f-wide\" [attr.data-testid]=\"'field-' + f.key\">\n <span>{{ f.label }}</span>\n <x-json-builder [kind]=\"f.builder!\" [(value)]=\"draft[f.key]\"></x-json-builder>\n </div>\n } @else {\n <label class=\"x-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n @if (f.allowCustom) {\n <select [ngModel]=\"selectValue(f)\" (ngModelChange)=\"onSelect(f, $event)\" [attr.data-testid]=\"'select-' + f.key\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n <option [value]=\"customOption\">Other\u2026</option>\n </select>\n @if (selectValue(f) === customOption) {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || 'Type a name'\" [attr.data-testid]=\"'custom-' + f.key\" />\n }\n } @else {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n }\n </div>\n </div>\n}\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-scrud-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-scrud-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-scrud-btn:disabled{opacity:.5;cursor:default}.x-scrud-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-scrud-danger{color:var(--color-danger, #c0362c)}.x-scrud-editor{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:14px}.x-scrud-editor-head{display:flex;align-items:center;justify-content:space-between}.x-scrud-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-scrud-editor-actions{display:flex;gap:8px}.x-scrud-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-scrud-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-scrud-f-wide{grid-column:1/-1}.x-scrud-f input,.x-scrud-f select,.x-scrud-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-scrud-f input[type=checkbox]{width:18px;height:18px}.x-scrud-pwd{position:relative;display:flex}.x-scrud-pwd input{flex:1;padding-right:34px!important}.x-scrud-pwd-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);border:none;background:transparent;color:var(--color-text-muted);padding:4px 6px;cursor:pointer}.x-scrud-pwd-toggle:hover{color:var(--color-text)}.x-scrud-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-scrud-required{color:var(--color-danger, #c0362c)}\n"] }]
59
+ }] });
60
+
61
+ class PromotionsModule {
62
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PromotionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
63
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: PromotionsModule, declarations: [PromotionsComponent], imports: [SharedModule,
64
+ JsonBuilderComponent,
65
+ ElementsModule,
66
+ WebgetsModule, i1$1.RouterModule] }); }
67
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PromotionsModule, imports: [SharedModule,
68
+ JsonBuilderComponent,
69
+ ElementsModule,
70
+ WebgetsModule,
71
+ RouterModule.forChild([{ path: '', component: PromotionsComponent }])] }); }
72
+ }
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PromotionsModule, decorators: [{
74
+ type: NgModule,
75
+ args: [{
76
+ declarations: [PromotionsComponent],
77
+ imports: [
78
+ SharedModule,
79
+ JsonBuilderComponent,
80
+ ElementsModule,
81
+ WebgetsModule,
82
+ RouterModule.forChild([{ path: '', component: PromotionsComponent }]),
83
+ ],
84
+ }]
85
+ }] });
86
+
87
+ export { PromotionsModule };
88
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-promotions.module-Dh7PTGG7.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-promotions.module-Dh7PTGG7.mjs","sources":["../../../projects/admin/src/lib/pages/promotions/promotions.component.ts","../../../projects/admin/src/lib/pages/_shared/simple-crud.component.html","../../../projects/admin/src/lib/pages/promotions/promotions.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { CrudFieldSpec, SimpleCrudDirective } from '../_shared/simple-crud.base';\n\n// R1 production-readiness pass — PROMO-02. Was list-only; ops had no way\n// to configure a discount rule. `conditions`/`actions` use the\n// point-and-click builders (`_shared/rule-builders`), with an \"Edit as JSON\"\n// switch for anything the builders don't cover.\n@Component({\n standalone: false,\n selector: 'x-promotions',\n templateUrl: '../_shared/simple-crud.component.html',\n styleUrl: '../_shared/simple-crud.component.scss',\n})\nexport class PromotionsComponent extends SimpleCrudDirective {\n protected pageTitle = 'Promotions';\n protected pageSubtitle = 'Automatic and coupon-gated discount rules evaluated at checkout.';\n protected singularLabel = 'promotion';\n protected pluralName = 'promotions';\n protected dataSource = this.apiService.on('apps/commerce/promotion');\n\n protected columns = [\n { key: 'name', value: 'Name' },\n { key: 'statusHtml', value: 'Status' },\n { key: 'priority', value: 'Priority' },\n { key: 'usageCount', value: 'Used' },\n ];\n\n protected fields: CrudFieldSpec[] = [\n { key: 'name', label: 'Name', type: 'text', required: true },\n { key: 'description', label: 'Description', type: 'textarea' },\n {\n key: 'status',\n label: 'Status',\n type: 'select',\n options: [\n { value: 'draft', label: 'Draft' },\n { value: 'active', label: 'Active' },\n { value: 'paused', label: 'Paused' },\n { value: 'expired', label: 'Expired' },\n ],\n },\n { key: 'priority', label: 'Priority (lower runs first)', type: 'number' },\n { key: 'stackable', label: 'Stackable with other promotions', type: 'boolean' },\n { key: 'requiresCoupon', label: 'Requires a coupon code', type: 'boolean' },\n { key: 'startsAt', label: 'Starts at', type: 'date' },\n { key: 'endsAt', label: 'Ends at', type: 'date' },\n { key: 'conditions', label: 'When it applies', type: 'builder', builder: 'conditions' },\n { key: 'actions', label: 'What it does', type: 'builder', builder: 'actions' },\n ];\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\n </div>\n\n @if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving…' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward every click inside the\n builder to its first checkbox -->\n <div class=\"x-scrud-f x-scrud-f-wide\" [attr.data-testid]=\"'field-' + f.key\">\n <span>{{ f.label }}</span>\n <x-json-builder [kind]=\"f.builder!\" [(value)]=\"draft[f.key]\"></x-json-builder>\n </div>\n } @else {\n <label class=\"x-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n @if (f.allowCustom) {\n <select [ngModel]=\"selectValue(f)\" (ngModelChange)=\"onSelect(f, $event)\" [attr.data-testid]=\"'select-' + f.key\">\n <option value=\"\">— choose —</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n <option [value]=\"customOption\">Other…</option>\n </select>\n @if (selectValue(f) === customOption) {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || 'Type a name'\" [attr.data-testid]=\"'custom-' + f.key\" />\n }\n } @else {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">— choose —</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n }\n </div>\n </div>\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { JsonBuilderComponent } from '../_shared/rule-builders/json-builder.component';\nimport { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';\nimport { PromotionsComponent } from './promotions.component';\n\n@NgModule({\n declarations: [PromotionsComponent],\n imports: [\n SharedModule,\n JsonBuilderComponent,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: PromotionsComponent }]),\n ],\n})\nexport class PromotionsModule {}\n"],"names":["i2.JsonBuilderComponent","i3","i4","i1"],"mappings":";;;;;;;;;;;AAGA;AACA;AACA;AACA;AAOM,MAAO,mBAAoB,SAAQ,mBAAmB,CAAA;AAN5D,IAAA,WAAA,GAAA;;QAOY,IAAA,CAAA,SAAS,GAAG,YAAY;QACxB,IAAA,CAAA,YAAY,GAAG,kEAAkE;QACjF,IAAA,CAAA,aAAa,GAAG,WAAW;QAC3B,IAAA,CAAA,UAAU,GAAG,YAAY;QACzB,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,yBAAyB,CAAC;AAE1D,QAAA,IAAA,CAAA,OAAO,GAAG;AAClB,YAAA,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;AAC9B,YAAA,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE;AACtC,YAAA,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;AACtC,YAAA,EAAE,GAAG,EAAE,YAAY,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EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAhB,gBAAgB,EAAA,YAAA,EAAA,CATZ,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAEhC,YAAY;YACZ,oBAAoB;YACpB,cAAc;YACd,aAAa,EAAAC,IAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIJ,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAPzB,YAAY;YACZ,oBAAoB;YACpB,cAAc;YACd,aAAa;AACb,YAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAG5D,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAV5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,oBAAoB;wBACpB,cAAc;wBACd,aAAa;AACb,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC;AACtE,qBAAA;AACF,iBAAA;;;;;"}
@@ -0,0 +1,81 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, NgModule } from '@angular/core';
3
+ import * as i1$1 from '@angular/router';
4
+ import { RouterModule } from '@angular/router';
5
+ import { SharedModule } from '@thescaffold/ngx-core';
6
+ import * as i2 from '@thescaffold/ngx-ui';
7
+ import { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
8
+ import { S as SimpleCrudDirective, J as JsonBuilderComponent } from './isaiahiroko-tilmart-ngx-apps-admin-json-builder.component-BFroIYk9.mjs';
9
+ import * as i1 from '@angular/forms';
10
+ import * as i3 from '@angular/common';
11
+
12
+ // R1 production-readiness pass — CMS-06. Auto-minted on a slug change;
13
+ // was list-only otherwise, with no way for ops to add one manually to
14
+ // fix a stray 404.
15
+ class RedirectsComponent extends SimpleCrudDirective {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.pageTitle = 'Redirects';
19
+ this.pageSubtitle = 'Stored 301/302 path redirects — auto-minted on slug changes (CMS-06), or add one by hand.';
20
+ this.singularLabel = 'redirect';
21
+ this.pluralName = 'redirects';
22
+ this.dataSource = this.apiService.on('apps/commerce/redirect');
23
+ this.columns = [
24
+ { key: 'fromPath', value: 'From' },
25
+ { key: 'toPath', value: 'To' },
26
+ { key: 'statusCode', value: 'Code' },
27
+ { key: 'hitCount', value: 'Hits' },
28
+ ];
29
+ this.fields = [
30
+ { key: 'fromPath', label: 'From path', type: 'text', required: true, placeholder: '/p/old-slug' },
31
+ { key: 'toPath', label: 'To path', type: 'text', required: true, placeholder: '/p/new-slug' },
32
+ {
33
+ key: 'statusCode',
34
+ label: 'Status code',
35
+ type: 'select',
36
+ numericSelect: true,
37
+ options: [
38
+ { value: '301', label: '301 — Permanent' },
39
+ { value: '302', label: '302 — Temporary' },
40
+ ],
41
+ },
42
+ { key: 'reason', label: 'Reason', type: 'text' },
43
+ { key: 'enabled', label: 'Enabled', type: 'boolean' },
44
+ ];
45
+ }
46
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: RedirectsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
47
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: RedirectsComponent, isStandalone: false, selector: "x-redirects", usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\n </div>\n\n @if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward every click inside the\n builder to its first checkbox -->\n <div class=\"x-scrud-f x-scrud-f-wide\" [attr.data-testid]=\"'field-' + f.key\">\n <span>{{ f.label }}</span>\n <x-json-builder [kind]=\"f.builder!\" [(value)]=\"draft[f.key]\"></x-json-builder>\n </div>\n } @else {\n <label class=\"x-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n @if (f.allowCustom) {\n <select [ngModel]=\"selectValue(f)\" (ngModelChange)=\"onSelect(f, $event)\" [attr.data-testid]=\"'select-' + f.key\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n <option [value]=\"customOption\">Other\u2026</option>\n </select>\n @if (selectValue(f) === customOption) {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || 'Type a name'\" [attr.data-testid]=\"'custom-' + f.key\" />\n }\n } @else {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n }\n </div>\n </div>\n}\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-scrud-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-scrud-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-scrud-btn:disabled{opacity:.5;cursor:default}.x-scrud-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-scrud-danger{color:var(--color-danger, #c0362c)}.x-scrud-editor{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:14px}.x-scrud-editor-head{display:flex;align-items:center;justify-content:space-between}.x-scrud-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-scrud-editor-actions{display:flex;gap:8px}.x-scrud-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-scrud-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-scrud-f-wide{grid-column:1/-1}.x-scrud-f input,.x-scrud-f select,.x-scrud-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-scrud-f input[type=checkbox]{width:18px;height:18px}.x-scrud-pwd{position:relative;display:flex}.x-scrud-pwd input{flex:1;padding-right:34px!important}.x-scrud-pwd-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);border:none;background:transparent;color:var(--color-text-muted);padding:4px 6px;cursor:pointer}.x-scrud-pwd-toggle:hover{color:var(--color-text)}.x-scrud-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-scrud-required{color:var(--color-danger, #c0362c)}\n"], dependencies: [{ kind: "component", type: JsonBuilderComponent, selector: "x-json-builder", inputs: ["kind", "value"], outputs: ["valueChange"] }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "component", type: i2.CollectionComponent, selector: "x-webget-collection", inputs: ["data"], outputs: ["search", "filter", "refresh", "select", "page", "show"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
48
+ }
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: RedirectsComponent, decorators: [{
50
+ type: Component,
51
+ args: [{ standalone: false, selector: 'x-redirects', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\n </div>\n\n @if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward every click inside the\n builder to its first checkbox -->\n <div class=\"x-scrud-f x-scrud-f-wide\" [attr.data-testid]=\"'field-' + f.key\">\n <span>{{ f.label }}</span>\n <x-json-builder [kind]=\"f.builder!\" [(value)]=\"draft[f.key]\"></x-json-builder>\n </div>\n } @else {\n <label class=\"x-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n @if (f.allowCustom) {\n <select [ngModel]=\"selectValue(f)\" (ngModelChange)=\"onSelect(f, $event)\" [attr.data-testid]=\"'select-' + f.key\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n <option [value]=\"customOption\">Other\u2026</option>\n </select>\n @if (selectValue(f) === customOption) {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || 'Type a name'\" [attr.data-testid]=\"'custom-' + f.key\" />\n }\n } @else {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n }\n </div>\n </div>\n}\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-scrud-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-scrud-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-scrud-btn:disabled{opacity:.5;cursor:default}.x-scrud-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-scrud-danger{color:var(--color-danger, #c0362c)}.x-scrud-editor{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:14px}.x-scrud-editor-head{display:flex;align-items:center;justify-content:space-between}.x-scrud-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-scrud-editor-actions{display:flex;gap:8px}.x-scrud-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-scrud-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-scrud-f-wide{grid-column:1/-1}.x-scrud-f input,.x-scrud-f select,.x-scrud-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-scrud-f input[type=checkbox]{width:18px;height:18px}.x-scrud-pwd{position:relative;display:flex}.x-scrud-pwd input{flex:1;padding-right:34px!important}.x-scrud-pwd-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);border:none;background:transparent;color:var(--color-text-muted);padding:4px 6px;cursor:pointer}.x-scrud-pwd-toggle:hover{color:var(--color-text)}.x-scrud-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-scrud-required{color:var(--color-danger, #c0362c)}\n"] }]
52
+ }] });
53
+
54
+ class RedirectsModule {
55
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: RedirectsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
56
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: RedirectsModule, declarations: [RedirectsComponent], imports: [JsonBuilderComponent,
57
+ SharedModule,
58
+ ElementsModule,
59
+ WebgetsModule, i1$1.RouterModule] }); }
60
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: RedirectsModule, imports: [JsonBuilderComponent,
61
+ SharedModule,
62
+ ElementsModule,
63
+ WebgetsModule,
64
+ RouterModule.forChild([{ path: '', component: RedirectsComponent }])] }); }
65
+ }
66
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: RedirectsModule, decorators: [{
67
+ type: NgModule,
68
+ args: [{
69
+ declarations: [RedirectsComponent],
70
+ imports: [
71
+ JsonBuilderComponent,
72
+ SharedModule,
73
+ ElementsModule,
74
+ WebgetsModule,
75
+ RouterModule.forChild([{ path: '', component: RedirectsComponent }]),
76
+ ],
77
+ }]
78
+ }] });
79
+
80
+ export { RedirectsModule };
81
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-redirects.module-B8gaByYE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-redirects.module-B8gaByYE.mjs","sources":["../../../projects/admin/src/lib/pages/redirects/redirects.component.ts","../../../projects/admin/src/lib/pages/_shared/simple-crud.component.html","../../../projects/admin/src/lib/pages/redirects/redirects.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { CrudFieldSpec, SimpleCrudDirective } from '../_shared/simple-crud.base';\n\n// R1 production-readiness pass — CMS-06. Auto-minted on a slug change;\n// was list-only otherwise, with no way for ops to add one manually to\n// fix a stray 404.\n@Component({\n standalone: false,\n selector: 'x-redirects',\n templateUrl: '../_shared/simple-crud.component.html',\n styleUrl: '../_shared/simple-crud.component.scss',\n})\nexport class RedirectsComponent extends SimpleCrudDirective {\n protected pageTitle = 'Redirects';\n protected pageSubtitle = 'Stored 301/302 path redirects — auto-minted on slug changes (CMS-06), or add one by hand.';\n protected singularLabel = 'redirect';\n protected pluralName = 'redirects';\n protected dataSource = this.apiService.on('apps/commerce/redirect');\n\n protected columns = [\n { key: 'fromPath', value: 'From' },\n { key: 'toPath', value: 'To' },\n { key: 'statusCode', value: 'Code' },\n { key: 'hitCount', value: 'Hits' },\n ];\n\n protected fields: CrudFieldSpec[] = [\n { key: 'fromPath', label: 'From path', type: 'text', required: true, placeholder: '/p/old-slug' },\n { key: 'toPath', label: 'To path', type: 'text', required: true, placeholder: '/p/new-slug' },\n {\n key: 'statusCode',\n label: 'Status code',\n type: 'select',\n numericSelect: true,\n options: [\n { value: '301', label: '301 — Permanent' },\n { value: '302', label: '302 — Temporary' },\n ],\n },\n { key: 'reason', label: 'Reason', type: 'text' },\n { key: 'enabled', label: 'Enabled', type: 'boolean' },\n ];\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\n </div>\n\n @if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving…' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward every click inside the\n builder to its first checkbox -->\n <div class=\"x-scrud-f x-scrud-f-wide\" [attr.data-testid]=\"'field-' + f.key\">\n <span>{{ f.label }}</span>\n <x-json-builder [kind]=\"f.builder!\" [(value)]=\"draft[f.key]\"></x-json-builder>\n </div>\n } @else {\n <label class=\"x-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n @if (f.allowCustom) {\n <select [ngModel]=\"selectValue(f)\" (ngModelChange)=\"onSelect(f, $event)\" [attr.data-testid]=\"'select-' + f.key\">\n <option value=\"\">— choose —</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n <option [value]=\"customOption\">Other…</option>\n </select>\n @if (selectValue(f) === customOption) {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || 'Type a name'\" [attr.data-testid]=\"'custom-' + f.key\" />\n }\n } @else {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">— choose —</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n }\n </div>\n </div>\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';\nimport { RedirectsComponent } from './redirects.component';\nimport { JsonBuilderComponent } from '../_shared/rule-builders/json-builder.component';\n\n@NgModule({\n declarations: [RedirectsComponent],\n imports: [\n JsonBuilderComponent,\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: RedirectsComponent }]),\n ],\n})\nexport class RedirectsModule {}\n"],"names":["i1.JsonBuilderComponent","i2","i3","i4","i1"],"mappings":";;;;;;;;;;;AAGA;AACA;AACA;AAOM,MAAO,kBAAmB,SAAQ,mBAAmB,CAAA;AAN3D,IAAA,WAAA,GAAA;;QAOY,IAAA,CAAA,SAAS,GAAG,WAAW;QACvB,IAAA,CAAA,YAAY,GAAG,2FAA2F;QAC1G,IAAA,CAAA,aAAa,GAAG,UAAU;QAC1B,IAAA,CAAA,UAAU,GAAG,WAAW;QACxB,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,wBAAwB,CAAC;AAEzD,QAAA,IA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AAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YAPxB,oBAAoB;YACpB,YAAY;YACZ,cAAc;YACd,aAAa;AACb,YAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAG3D,eAAe,EAAA,UAAA,EAAA,CAAA;kBAV3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,kBAAkB,CAAC;AAClC,oBAAA,OAAO,EAAE;wBACP,oBAAoB;wBACpB,YAAY;wBACZ,cAAc;wBACd,aAAa;AACb,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAC;AACrE,qBAAA;AACF,iBAAA;;;;;"}
@@ -5,7 +5,7 @@ import { RouterModule } from '@angular/router';
5
5
  import { SharedModule } from '@thescaffold/ngx-core';
6
6
  import * as i2 from '@thescaffold/ngx-ui';
7
7
  import { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
8
- import { L as ListPageDirective } from './isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs';
8
+ import { L as ListPageDirective } from './isaiahiroko-tilmart-ngx-apps-admin-list-page.base-ChfiBo_X.mjs';
9
9
  import * as i3 from '@angular/common';
10
10
 
11
11
  // Referral/reward view (docs/TRD.md §7).
@@ -19,7 +19,7 @@ class ReferralsComponent extends ListPageDirective {
19
19
  this.columns = [
20
20
  { key: 'code', value: 'Code' },
21
21
  { key: 'referredContactPhone', value: 'Referred contact' },
22
- { key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },
22
+ { key: 'statusHtml', value: 'Status' },
23
23
  { key: 'convertedAt', value: 'Converted', type: 'date' },
24
24
  { key: 'createdAt', value: 'Referred on', type: 'date' },
25
25
  ];
@@ -78,4 +78,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
78
78
  }] });
79
79
 
80
80
  export { ReferralsModule };
81
- //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-referrals.module-BIAY4L_u.mjs.map
81
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-referrals.module-7OLTrySw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-referrals.module-7OLTrySw.mjs","sources":["../../../projects/admin/src/lib/pages/referrals/referrals.component.ts","../../../projects/admin/src/lib/pages/referrals/referrals.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { ListPageDirective } from '../_shared/list-page.base';\n\n// Referral/reward view (docs/TRD.md §7).\n@Component({\n standalone: false,\n selector: 'x-referrals',\n template: `\n <div class=\"x-page-head\">\n <div class=\"x-page-title\">Referrals</div>\n <div class=\"x-page-subtitle\">Who referred whom, and reward status.</div>\n </div>\n\n @if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n `,\n styles: [\n `\n .x-page-head {\n margin-bottom: 20px;\n }\n .x-page-title {\n font-size: 24px;\n font-weight: 800;\n color: var(--color-text);\n }\n .x-page-subtitle {\n font-size: 13.5px;\n color: var(--color-text-muted);\n margin-top: 2px;\n }\n `,\n ],\n})\nexport class ReferralsComponent extends ListPageDirective {\n name = 'referral';\n protected pluralName = 'referrals';\n // P5.14 — the commerce Referral (ACC-11); the Salama grocery route is gone.\n protected dataSource = this.apiService.on('apps/commerce/referral');\n\n protected columns = [\n { key: 'code', value: 'Code' },\n { key: 'referredContactPhone', value: 'Referred contact' },\n { key: 'statusHtml', value: 'Status' },\n { key: 'convertedAt', value: 'Converted', type: 'date' },\n { key: 'createdAt', value: 'Referred on', type: 'date' },\n ];\n\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';\nimport { ReferralsComponent } from './referrals.component';\n\n@NgModule({\n declarations: [ReferralsComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: ReferralsComponent }]),\n ],\n})\nexport class ReferralsModule {}\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;AAGA;AAkCM,MAAO,kBAAmB,SAAQ,iBAAiB,CAAA;AAjCzD,IAAA,WAAA,GAAA;;QAkCE,IAAA,CAAA,IAAI,GAAG,UAAU;QACP,IAAA,CAAA,UAAU,GAAG,WAAW;;QAExB,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,wBAAwB,CAAC;AAEzD,QAAA,IAAA,CAAA,OAAO,GAAG;AAClB,YAAA,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;AAC9B,YAAA,EAAE,GAAG,EAAE,sBAAsB,EAAE,KAAK,EAAE,kBAAkB,EAAE;AAC1D,YAAA,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE;YACtC,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE;YACxD,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE;SACzD;AAEF,IAAA;+GAdY,kBAAkB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,S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