@isaiahiroko/tilmart-ngx-apps-admin 0.2.0 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-articles.module-OeLRnPwN.mjs → isaiahiroko-tilmart-ngx-apps-admin-articles.module-Cpx9BZcg.mjs} +5 -5
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-articles.module-OeLRnPwN.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-articles.module-Cpx9BZcg.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-attribute-templates.module-CwQnW1cH.mjs +239 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-attribute-templates.module-CwQnW1cH.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-audit.module-C9gvw8X2.mjs → isaiahiroko-tilmart-ngx-apps-admin-audit.module-D5YaCThD.mjs} +6 -6
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-audit.module-C9gvw8X2.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-audit.module-D5YaCThD.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-KSapnx6Y.mjs +76 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-KSapnx6Y.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-7I0ni-tQ.mjs +70 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-7I0ni-tQ.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-bulk-upload.module-BGTbsYUP.mjs +370 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-bulk-upload.module-BGTbsYUP.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-BwjfFXDU.mjs +562 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-BwjfFXDU.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-OTUfenf0.mjs +94 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-OTUfenf0.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-Dk9mz7Wj.mjs +137 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-Dk9mz7Wj.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-compatibility-rules.module-xN-JUWwp.mjs → isaiahiroko-tilmart-ngx-apps-admin-compatibility-rules.module-JiFnNJj_.mjs} +6 -6
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-compatibility-rules.module-xN-JUWwp.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-compatibility-rules.module-JiFnNJj_.mjs.map} +1 -1
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-content.module-DLdKAUqc.mjs → isaiahiroko-tilmart-ngx-apps-admin-content.module-Bx6Zj0WX.mjs} +5 -5
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-content.module-DLdKAUqc.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-content.module-Bx6Zj0WX.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-CoRh6Hxq.mjs +85 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-CoRh6Hxq.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-customers.module-CslGiOdq.mjs +123 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-customers.module-CslGiOdq.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-data-quality.module-Bfgh3zE5.mjs → isaiahiroko-tilmart-ngx-apps-admin-data-quality.module-CvFmMoJe.mjs} +6 -6
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-data-quality.module-Bfgh3zE5.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-data-quality.module-CvFmMoJe.mjs.map} +1 -1
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-data-requests.module-C6tPNlup.mjs → isaiahiroko-tilmart-ngx-apps-admin-data-requests.module-CuZwNVPO.mjs} +6 -6
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-data-requests.module-C6tPNlup.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-data-requests.module-CuZwNVPO.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-BPRnC17l.mjs +83 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-BPRnC17l.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BZ3UmxE3.mjs → isaiahiroko-tilmart-ngx-apps-admin-homepage.module-vtAoIwSu.mjs} +5 -5
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BZ3UmxE3.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-homepage.module-vtAoIwSu.mjs.map} +1 -1
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-inbox.module-BZDTa1L-.mjs → isaiahiroko-tilmart-ngx-apps-admin-inbox.module-CRkfjWQT.mjs} +6 -6
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-inbox.module-BZDTa1L-.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-inbox.module-CRkfjWQT.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs +66 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-macros.module-BO4bdER2.mjs → isaiahiroko-tilmart-ngx-apps-admin-macros.module-CElxL9W4.mjs} +5 -5
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-macros.module-BO4bdER2.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-macros.module-CElxL9W4.mjs.map} +1 -1
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-moderation.module-CZOCrias.mjs → isaiahiroko-tilmart-ngx-apps-admin-moderation.module-PGmFX7nk.mjs} +6 -6
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-moderation.module-CZOCrias.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-moderation.module-PGmFX7nk.mjs.map} +1 -1
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-navigation.module-DoKzzRgn.mjs → isaiahiroko-tilmart-ngx-apps-admin-navigation.module-De1Cvqqa.mjs} +6 -6
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-navigation.module-DoKzzRgn.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-navigation.module-De1Cvqqa.mjs.map} +1 -1
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-order-board.module-DIOjhptn.mjs → isaiahiroko-tilmart-ngx-apps-admin-order-board.module-CmLNiEEP.mjs} +4 -4
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-order-board.module-DIOjhptn.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-order-board.module-CmLNiEEP.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-vldWwcAr.mjs +190 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-vldWwcAr.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-DstLDYM7.mjs +114 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-DstLDYM7.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-DG03OY1q.mjs +94 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-DG03OY1q.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-queues.module-K-zYYVFy.mjs → isaiahiroko-tilmart-ngx-apps-admin-queues.module-D7iLwX0A.mjs} +6 -6
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-queues.module-K-zYYVFy.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-queues.module-D7iLwX0A.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-oQw5Xo5T.mjs +78 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-oQw5Xo5T.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-referrals.module-QLNhuh7q.mjs → isaiahiroko-tilmart-ngx-apps-admin-referrals.module-BIAY4L_u.mjs} +9 -34
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-referrals.module-BIAY4L_u.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-reports.module-DBZov0We.mjs → isaiahiroko-tilmart-ngx-apps-admin-reports.module-DORiIVLQ.mjs} +5 -5
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-reports.module-DBZov0We.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-reports.module-DORiIVLQ.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-C9Iu9CX6.mjs +163 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-C9Iu9CX6.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-CGBBHwId.mjs +81 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-CGBBHwId.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-Cz6xPNwB.mjs +318 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-Cz6xPNwB.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-shipments.module-XuaOKr8v.mjs → isaiahiroko-tilmart-ngx-apps-admin-shipments.module-Cs5CLamm.mjs} +13 -32
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-Cs5CLamm.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-simple-crud.base-C8SPw14H.mjs +140 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-simple-crud.base-C8SPw14H.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-Bt9W1oGR.mjs +102 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-Bt9W1oGR.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-trace.module-Pwr-82Rc.mjs → isaiahiroko-tilmart-ngx-apps-admin-trace.module-9sRlGZCC.mjs} +6 -6
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-trace.module-Pwr-82Rc.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-trace.module-9sRlGZCC.mjs.map} +1 -1
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-users.module-Bx_7fI2g.mjs → isaiahiroko-tilmart-ngx-apps-admin-users.module-C31RJJJ_.mjs} +9 -34
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-users.module-C31RJJJ_.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs +104 -72
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs.map +1 -1
- package/package.json +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-baskets.module-_lHPl1dT.mjs +0 -294
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-baskets.module-_lHPl1dT.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-Bvx2tVOi.mjs +0 -224
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-Bvx2tVOi.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-Ccsd8Yx3.mjs +0 -106
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-Ccsd8Yx3.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-CQNCSlsd.mjs +0 -106
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-CQNCSlsd.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-customers.module-12XdV9zo.mjs +0 -106
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-customers.module-12XdV9zo.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-Ddw49QW0.mjs +0 -185
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-Ddw49QW0.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-BhqAtTZs.mjs +0 -106
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-BhqAtTZs.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-procurement.module-qXW-g0pf.mjs +0 -274
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-procurement.module-qXW-g0pf.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-DG9uTDqX.mjs +0 -106
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-DG9uTDqX.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-Hm2dO_bC.mjs +0 -106
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-Hm2dO_bC.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-referrals.module-QLNhuh7q.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-Bd2gdo6_.mjs +0 -106
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-Bd2gdo6_.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-BkVY06ci.mjs +0 -105
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-BkVY06ci.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-DKeZTldO.mjs +0 -222
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-DKeZTldO.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-XuaOKr8v.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-DYiAkF7E.mjs +0 -107
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-DYiAkF7E.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-users.module-Bx_7fI2g.mjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1$
|
|
3
|
+
import * as i1$1 from '@angular/router';
|
|
4
4
|
import { RouterModule } from '@angular/router';
|
|
5
5
|
import { BaseDirective, using, notify, SharedModule } from '@thescaffold/ngx-core';
|
|
6
|
-
import * as
|
|
6
|
+
import * as i2 from '@thescaffold/ngx-ui';
|
|
7
7
|
import { ElementsModule } from '@thescaffold/ngx-ui';
|
|
8
8
|
import { takeUntil, firstValueFrom } from 'rxjs';
|
|
9
|
-
import * as
|
|
9
|
+
import * as i3 from '@angular/common';
|
|
10
10
|
import * as i1 from '@angular/forms';
|
|
11
11
|
|
|
12
12
|
const LOCATIONS = [
|
|
@@ -250,7 +250,7 @@ class NavigationComponent extends BaseDirective {
|
|
|
250
250
|
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
251
251
|
}
|
|
252
252
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: NavigationComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
253
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: NavigationComponent, isStandalone: false, selector: "x-navigation", usesInheritance: true, ngImport: i0, template: "<div class=\"x-nav-head\">\n <div class=\"x-nav-title\">Navigation</div>\n <div class=\"x-nav-sub\">Storefront menus \u2014 the shell consumes the <code>header_primary</code> menu.</div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n <div class=\"x-nav-layout\">\n <aside class=\"x-nav-list\">\n <div class=\"x-nav-new\">\n <select [(ngModel)]=\"newMenuLocation\">\n @for (l of locations; track l) { <option [value]=\"l\">{{ l }}</option> }\n </select>\n <input type=\"text\" placeholder=\"Menu name\" [(ngModel)]=\"newMenuName\" />\n <button type=\"button\" (click)=\"createMenu()\">Add menu</button>\n </div>\n @for (m of menus; track m.id) {\n <button\n type=\"button\"\n class=\"x-nav-list-item\"\n [class.x-nav-list-active]=\"selected?.id === m.id\"\n (click)=\"select(m)\"\n >\n <span class=\"x-nav-list-title\">{{ m.name }}</span>\n <span class=\"x-nav-list-meta\">{{ m.location }}</span>\n </button>\n } @empty {\n <div class=\"x-nav-empty\">No menus yet.</div>\n }\n </aside>\n\n <section class=\"x-nav-editor\">\n @if (!selected) {\n <div class=\"x-nav-empty\">Pick a menu, or add one.</div>\n } @else {\n <div class=\"x-nav-editor-head\">\n <span>{{ selected.name }} \u2014 <code>{{ selected.location }}</code></span>\n <span>\n <button type=\"button\" class=\"x-nav-btn\" (click)=\"addItem()\">Add link</button>\n <button type=\"button\" class=\"x-nav-btn x-nav-danger\" (click)=\"deleteMenu()\">Delete menu</button>\n </span>\n </div>\n\n @if (!topLevel.length) {\n <div class=\"x-nav-empty\">No links yet.</div>\n } @else {\n <div class=\"x-nav-items\">\n @for (item of topLevel; track item.id; let i = $index) {\n <div\n class=\"x-nav-item\"\n [class.x-nav-item-off]=\"!item.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-nav-item-row\">\n <span class=\"x-nav-grip\">\u283F</span>\n <div class=\"x-nav-order\">\n <button type=\"button\" (click)=\"moveItem(i, -1)\" [disabled]=\"i === 0\">\u25B2</button>\n <button type=\"button\" (click)=\"moveItem(i, 1)\" [disabled]=\"i === topLevel.length - 1\">\u25BC</button>\n </div>\n <span class=\"x-nav-item-label\">{{ item.label }}</span>\n <span class=\"x-nav-item-url\">{{ item.url }}</span>\n <span class=\"x-nav-item-actions\">\n <button type=\"button\" class=\"x-nav-toggle\" (click)=\"toggleItem(item)\">{{ item.enabled ? 'On' : 'Off' }}</button>\n <button type=\"button\" class=\"x-nav-link\" (click)=\"editItem(item)\">Edit</button>\n <button type=\"button\" class=\"x-nav-link x-nav-danger\" (click)=\"removeItem(item)\">Delete</button>\n </span>\n </div>\n\n @for (child of childrenOf(item.id); track child.id) {\n <div class=\"x-nav-child\" [class.x-nav-item-off]=\"!child.enabled\">\n <span class=\"x-nav-child-label\">\u21B3 {{ child.label }}</span>\n <span class=\"x-nav-item-url\">{{ child.url }}</span>\n <span class=\"x-nav-item-actions\">\n <button type=\"button\" class=\"x-nav-toggle\" (click)=\"toggleItem(child)\">{{ child.enabled ? 'On' : 'Off' }}</button>\n <button type=\"button\" class=\"x-nav-link\" (click)=\"editItem(child)\">Edit</button>\n <button type=\"button\" class=\"x-nav-link x-nav-danger\" (click)=\"removeItem(child)\">Delete</button>\n </span>\n </div>\n }\n </div>\n }\n </div>\n }\n\n @if (editingItem) {\n <ng-container *ngTemplateOutlet=\"itemForm\"></ng-container>\n }\n }\n </section>\n </div>\n}\n\n<ng-template #itemForm>\n <div class=\"x-nav-form\">\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">Label<input type=\"text\" [(ngModel)]=\"itemModel.label\" /></label>\n <label class=\"x-nav-f\">URL<input type=\"text\" [(ngModel)]=\"itemModel.url\" placeholder=\"/c/solar-panels\" /></label>\n </div>\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">\n Parent\n <select [(ngModel)]=\"itemModel.parentId\">\n <option value=\"\">\u2014 top level \u2014</option>\n @for (p of parentOptions; track p.id) { <option [value]=\"p.id\">{{ p.label }}</option> }\n </select>\n </label>\n <label class=\"x-nav-f\">Icon<input type=\"text\" [(ngModel)]=\"itemModel.icon\" /></label>\n <label class=\"x-nav-f x-nav-check\">\n <input type=\"checkbox\" [(ngModel)]=\"itemModel.openInNewTab\" /> New tab\n </label>\n </div>\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">Starts<input type=\"datetime-local\" [(ngModel)]=\"itemModel.startsAt\" /></label>\n <label class=\"x-nav-f\">Ends<input type=\"datetime-local\" [(ngModel)]=\"itemModel.endsAt\" /></label>\n </div>\n <div class=\"x-nav-form-actions\">\n <button type=\"button\" class=\"x-nav-btn x-nav-btn-primary\" (click)=\"saveItem()\">Save link</button>\n <button type=\"button\" class=\"x-nav-btn\" (click)=\"cancelItemEdit()\">Cancel</button>\n </div>\n </div>\n</ng-template>\n\n<style>\n .x-nav-head { margin-bottom: 20px; }\n .x-nav-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-nav-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-nav-sub code, .x-nav-editor-head code { font-family: var(--font-mono); font-size: 12px; }\n .x-nav-empty { font-size: 14px; color: var(--color-text-muted); padding: 12px 0; }\n .x-nav-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }\n .x-nav-list { display: flex; flex-direction: column; gap: 6px; }\n .x-nav-new { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }\n .x-nav-new select, .x-nav-new input, .x-nav-f input, .x-nav-f select {\n border: 1px solid var(--color-border); border-radius: var(--radius-md);\n padding: 6px 10px; font-size: 13px; background: var(--color-surface); color: var(--color-text);\n }\n .x-nav-new button, .x-nav-btn {\n border: 1px solid var(--color-border); background: transparent; border-radius: var(--radius-md);\n padding: 6px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--color-text-muted);\n }\n .x-nav-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-nav-danger { color: var(--color-danger, #c0362c); }\n .x-nav-list-item {\n text-align: left; border: 1px solid var(--color-border); border-radius: var(--radius-md);\n background: var(--color-surface); padding: 8px 10px; cursor: pointer;\n display: flex; flex-direction: column; gap: 2px;\n }\n .x-nav-list-active { border-color: var(--color-accent); }\n .x-nav-list-title { font-size: 13px; font-weight: 700; color: var(--color-text); }\n .x-nav-list-meta { font-size: 11px; color: var(--color-text-muted); }\n .x-nav-editor { min-width: 0; }\n .x-nav-editor-head {\n display: flex; justify-content: space-between; align-items: center;\n font-size: 13px; font-weight: 700; color: var(--color-text); margin-bottom: 12px;\n }\n .x-nav-editor-head button { margin-left: 6px; }\n .x-nav-items { display: flex; flex-direction: column; gap: 8px; }\n .x-nav-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 10px 12px; }\n .x-nav-item-off { opacity: 0.5; }\n .x-nav-item-row, .x-nav-child { display: flex; align-items: center; gap: 10px; }\n .x-nav-child { padding: 6px 0 0 28px; font-size: 12.5px; }\n .x-nav-grip { cursor: grab; color: var(--color-text-muted); }\n .x-nav-order { display: flex; flex-direction: column; }\n .x-nav-order button { border: 0; background: transparent; cursor: pointer; color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px; }\n .x-nav-order button:disabled { opacity: 0.3; }\n .x-nav-item-label, .x-nav-child-label { font-weight: 700; font-size: 13px; }\n .x-nav-item-url { font-size: 11.5px; color: var(--color-text-muted); font-family: var(--font-mono); flex: 1; }\n .x-nav-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-nav-toggle { border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; color: var(--color-text-muted); }\n .x-nav-link { border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--color-accent-hover); }\n .x-nav-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 10px; }\n .x-nav-f { display: flex; flex-direction: column; gap: 4px; flex: 1; font-size: 11.5px; color: var(--color-text-muted); font-weight: 700; }\n .x-nav-check { flex-direction: row; align-items: center; gap: 6px; }\n .x-nav-f-row { display: flex; gap: 10px; }\n .x-nav-form-actions { display: flex; gap: 8px; }\n</style>\n", styles: [".x-nav-head{margin-bottom:20px}.x-nav-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-nav-sub{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-nav-sub code,.x-nav-editor-head code{font-family:var(--font-mono);font-size:12px}.x-nav-empty{font-size:14px;color:var(--color-text-muted);padding:12px 0}.x-nav-layout{display:grid;grid-template-columns:240px 1fr;gap:20px;align-items:start}.x-nav-list{display:flex;flex-direction:column;gap:6px}.x-nav-new{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}.x-nav-new select,.x-nav-new input,.x-nav-f input,.x-nav-f select{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)}.x-nav-new button,.x-nav-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-nav-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-nav-danger{color:var(--color-danger, #c0362c)}.x-nav-list-item{text-align:left;border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface);padding:8px 10px;cursor:pointer;display:flex;flex-direction:column;gap:2px}.x-nav-list-active{border-color:var(--color-accent)}.x-nav-list-title{font-size:13px;font-weight:700;color:var(--color-text)}.x-nav-list-meta{font-size:11px;color:var(--color-text-muted)}.x-nav-editor{min-width:0}.x-nav-editor-head{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:700;color:var(--color-text);margin-bottom:12px}.x-nav-editor-head button{margin-left:6px}.x-nav-items{display:flex;flex-direction:column;gap:8px}.x-nav-item{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:10px 12px}.x-nav-item-off{opacity:.5}.x-nav-item-row,.x-nav-child{display:flex;align-items:center;gap:10px}.x-nav-child{padding:6px 0 0 28px;font-size:12.5px}.x-nav-grip{cursor:grab;color:var(--color-text-muted)}.x-nav-order{display:flex;flex-direction:column}.x-nav-order button{border:0;background:transparent;cursor:pointer;color:var(--color-text-muted);font-size:10px;line-height:1.1;padding:1px 3px}.x-nav-order button:disabled{opacity:.3}.x-nav-item-label,.x-nav-child-label{font-weight:700;font-size:13px}.x-nav-item-url{font-size:11.5px;color:var(--color-text-muted);font-family:var(--font-mono);flex:1}.x-nav-item-actions{display:flex;gap:8px;align-items:center}.x-nav-toggle{border:1px solid var(--color-border);border-radius:var(--radius-sm);background:transparent;padding:3px 10px;font-size:11.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-nav-link{border:0;background:transparent;cursor:pointer;font-size:12px;font-weight:700;color:var(--color-accent-hover)}.x-nav-form{margin-top:12px;padding-top:12px;border-top:1px solid var(--color-border);display:flex;flex-direction:column;gap:10px}.x-nav-f{display:flex;flex-direction:column;gap:4px;flex:1;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-nav-check{flex-direction:row;align-items:center;gap:6px}.x-nav-f-row{display:flex;gap:10px}.x-nav-form-actions{display:flex;gap:8px}\n"], dependencies: [{ kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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.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: i1$1.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }] }); }
|
|
253
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: NavigationComponent, isStandalone: false, selector: "x-navigation", usesInheritance: true, ngImport: i0, template: "<div class=\"x-nav-head\">\n <div class=\"x-nav-title\">Navigation</div>\n <div class=\"x-nav-sub\">Storefront menus \u2014 the shell consumes the <code>header_primary</code> menu.</div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n <div class=\"x-nav-layout\">\n <aside class=\"x-nav-list\">\n <div class=\"x-nav-new\">\n <select [(ngModel)]=\"newMenuLocation\">\n @for (l of locations; track l) { <option [value]=\"l\">{{ l }}</option> }\n </select>\n <input type=\"text\" placeholder=\"Menu name\" [(ngModel)]=\"newMenuName\" />\n <button type=\"button\" (click)=\"createMenu()\">Add menu</button>\n </div>\n @for (m of menus; track m.id) {\n <button\n type=\"button\"\n class=\"x-nav-list-item\"\n [class.x-nav-list-active]=\"selected?.id === m.id\"\n (click)=\"select(m)\"\n >\n <span class=\"x-nav-list-title\">{{ m.name }}</span>\n <span class=\"x-nav-list-meta\">{{ m.location }}</span>\n </button>\n } @empty {\n <div class=\"x-nav-empty\">No menus yet.</div>\n }\n </aside>\n\n <section class=\"x-nav-editor\">\n @if (!selected) {\n <div class=\"x-nav-empty\">Pick a menu, or add one.</div>\n } @else {\n <div class=\"x-nav-editor-head\">\n <span>{{ selected.name }} \u2014 <code>{{ selected.location }}</code></span>\n <span>\n <button type=\"button\" class=\"x-nav-btn\" (click)=\"addItem()\">Add link</button>\n <button type=\"button\" class=\"x-nav-btn x-nav-danger\" (click)=\"deleteMenu()\">Delete menu</button>\n </span>\n </div>\n\n @if (!topLevel.length) {\n <div class=\"x-nav-empty\">No links yet.</div>\n } @else {\n <div class=\"x-nav-items\">\n @for (item of topLevel; track item.id; let i = $index) {\n <div\n class=\"x-nav-item\"\n [class.x-nav-item-off]=\"!item.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-nav-item-row\">\n <span class=\"x-nav-grip\">\u283F</span>\n <div class=\"x-nav-order\">\n <button type=\"button\" (click)=\"moveItem(i, -1)\" [disabled]=\"i === 0\">\u25B2</button>\n <button type=\"button\" (click)=\"moveItem(i, 1)\" [disabled]=\"i === topLevel.length - 1\">\u25BC</button>\n </div>\n <span class=\"x-nav-item-label\">{{ item.label }}</span>\n <span class=\"x-nav-item-url\">{{ item.url }}</span>\n <span class=\"x-nav-item-actions\">\n <button type=\"button\" class=\"x-nav-toggle\" (click)=\"toggleItem(item)\">{{ item.enabled ? 'On' : 'Off' }}</button>\n <button type=\"button\" class=\"x-nav-link\" (click)=\"editItem(item)\">Edit</button>\n <button type=\"button\" class=\"x-nav-link x-nav-danger\" (click)=\"removeItem(item)\">Delete</button>\n </span>\n </div>\n\n @for (child of childrenOf(item.id); track child.id) {\n <div class=\"x-nav-child\" [class.x-nav-item-off]=\"!child.enabled\">\n <span class=\"x-nav-child-label\">\u21B3 {{ child.label }}</span>\n <span class=\"x-nav-item-url\">{{ child.url }}</span>\n <span class=\"x-nav-item-actions\">\n <button type=\"button\" class=\"x-nav-toggle\" (click)=\"toggleItem(child)\">{{ child.enabled ? 'On' : 'Off' }}</button>\n <button type=\"button\" class=\"x-nav-link\" (click)=\"editItem(child)\">Edit</button>\n <button type=\"button\" class=\"x-nav-link x-nav-danger\" (click)=\"removeItem(child)\">Delete</button>\n </span>\n </div>\n }\n </div>\n }\n </div>\n }\n\n @if (editingItem) {\n <ng-container *ngTemplateOutlet=\"itemForm\"></ng-container>\n }\n }\n </section>\n </div>\n}\n\n<ng-template #itemForm>\n <div class=\"x-nav-form\">\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">Label<input type=\"text\" [(ngModel)]=\"itemModel.label\" /></label>\n <label class=\"x-nav-f\">URL<input type=\"text\" [(ngModel)]=\"itemModel.url\" placeholder=\"/c/solar-panels\" /></label>\n </div>\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">\n Parent\n <select [(ngModel)]=\"itemModel.parentId\">\n <option value=\"\">\u2014 top level \u2014</option>\n @for (p of parentOptions; track p.id) { <option [value]=\"p.id\">{{ p.label }}</option> }\n </select>\n </label>\n <label class=\"x-nav-f\">Icon<input type=\"text\" [(ngModel)]=\"itemModel.icon\" /></label>\n <label class=\"x-nav-f x-nav-check\">\n <input type=\"checkbox\" [(ngModel)]=\"itemModel.openInNewTab\" /> New tab\n </label>\n </div>\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">Starts<input type=\"datetime-local\" [(ngModel)]=\"itemModel.startsAt\" /></label>\n <label class=\"x-nav-f\">Ends<input type=\"datetime-local\" [(ngModel)]=\"itemModel.endsAt\" /></label>\n </div>\n <div class=\"x-nav-form-actions\">\n <button type=\"button\" class=\"x-nav-btn x-nav-btn-primary\" (click)=\"saveItem()\">Save link</button>\n <button type=\"button\" class=\"x-nav-btn\" (click)=\"cancelItemEdit()\">Cancel</button>\n </div>\n </div>\n</ng-template>\n\n<style>\n .x-nav-head { margin-bottom: 20px; }\n .x-nav-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-nav-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-nav-sub code, .x-nav-editor-head code { font-family: var(--font-mono); font-size: 12px; }\n .x-nav-empty { font-size: 14px; color: var(--color-text-muted); padding: 12px 0; }\n .x-nav-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }\n .x-nav-list { display: flex; flex-direction: column; gap: 6px; }\n .x-nav-new { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }\n .x-nav-new select, .x-nav-new input, .x-nav-f input, .x-nav-f select {\n border: 1px solid var(--color-border); border-radius: var(--radius-md);\n padding: 6px 10px; font-size: 13px; background: var(--color-surface); color: var(--color-text);\n }\n .x-nav-new button, .x-nav-btn {\n border: 1px solid var(--color-border); background: transparent; border-radius: var(--radius-md);\n padding: 6px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--color-text-muted);\n }\n .x-nav-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-nav-danger { color: var(--color-danger, #c0362c); }\n .x-nav-list-item {\n text-align: left; border: 1px solid var(--color-border); border-radius: var(--radius-md);\n background: var(--color-surface); padding: 8px 10px; cursor: pointer;\n display: flex; flex-direction: column; gap: 2px;\n }\n .x-nav-list-active { border-color: var(--color-accent); }\n .x-nav-list-title { font-size: 13px; font-weight: 700; color: var(--color-text); }\n .x-nav-list-meta { font-size: 11px; color: var(--color-text-muted); }\n .x-nav-editor { min-width: 0; }\n .x-nav-editor-head {\n display: flex; justify-content: space-between; align-items: center;\n font-size: 13px; font-weight: 700; color: var(--color-text); margin-bottom: 12px;\n }\n .x-nav-editor-head button { margin-left: 6px; }\n .x-nav-items { display: flex; flex-direction: column; gap: 8px; }\n .x-nav-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 10px 12px; }\n .x-nav-item-off { opacity: 0.5; }\n .x-nav-item-row, .x-nav-child { display: flex; align-items: center; gap: 10px; }\n .x-nav-child { padding: 6px 0 0 28px; font-size: 12.5px; }\n .x-nav-grip { cursor: grab; color: var(--color-text-muted); }\n .x-nav-order { display: flex; flex-direction: column; }\n .x-nav-order button { border: 0; background: transparent; cursor: pointer; color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px; }\n .x-nav-order button:disabled { opacity: 0.3; }\n .x-nav-item-label, .x-nav-child-label { font-weight: 700; font-size: 13px; }\n .x-nav-item-url { font-size: 11.5px; color: var(--color-text-muted); font-family: var(--font-mono); flex: 1; }\n .x-nav-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-nav-toggle { border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; color: var(--color-text-muted); }\n .x-nav-link { border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--color-accent-hover); }\n .x-nav-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 10px; }\n .x-nav-f { display: flex; flex-direction: column; gap: 4px; flex: 1; font-size: 11.5px; color: var(--color-text-muted); font-weight: 700; }\n .x-nav-check { flex-direction: row; align-items: center; gap: 6px; }\n .x-nav-f-row { display: flex; gap: 10px; }\n .x-nav-form-actions { display: flex; gap: 8px; }\n</style>\n", styles: [".x-nav-head{margin-bottom:20px}.x-nav-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-nav-sub{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-nav-sub code,.x-nav-editor-head code{font-family:var(--font-mono);font-size:12px}.x-nav-empty{font-size:14px;color:var(--color-text-muted);padding:12px 0}.x-nav-layout{display:grid;grid-template-columns:240px 1fr;gap:20px;align-items:start}.x-nav-list{display:flex;flex-direction:column;gap:6px}.x-nav-new{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}.x-nav-new select,.x-nav-new input,.x-nav-f input,.x-nav-f select{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)}.x-nav-new button,.x-nav-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-nav-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-nav-danger{color:var(--color-danger, #c0362c)}.x-nav-list-item{text-align:left;border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface);padding:8px 10px;cursor:pointer;display:flex;flex-direction:column;gap:2px}.x-nav-list-active{border-color:var(--color-accent)}.x-nav-list-title{font-size:13px;font-weight:700;color:var(--color-text)}.x-nav-list-meta{font-size:11px;color:var(--color-text-muted)}.x-nav-editor{min-width:0}.x-nav-editor-head{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:700;color:var(--color-text);margin-bottom:12px}.x-nav-editor-head button{margin-left:6px}.x-nav-items{display:flex;flex-direction:column;gap:8px}.x-nav-item{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:10px 12px}.x-nav-item-off{opacity:.5}.x-nav-item-row,.x-nav-child{display:flex;align-items:center;gap:10px}.x-nav-child{padding:6px 0 0 28px;font-size:12.5px}.x-nav-grip{cursor:grab;color:var(--color-text-muted)}.x-nav-order{display:flex;flex-direction:column}.x-nav-order button{border:0;background:transparent;cursor:pointer;color:var(--color-text-muted);font-size:10px;line-height:1.1;padding:1px 3px}.x-nav-order button:disabled{opacity:.3}.x-nav-item-label,.x-nav-child-label{font-weight:700;font-size:13px}.x-nav-item-url{font-size:11.5px;color:var(--color-text-muted);font-family:var(--font-mono);flex:1}.x-nav-item-actions{display:flex;gap:8px;align-items:center}.x-nav-toggle{border:1px solid var(--color-border);border-radius:var(--radius-sm);background:transparent;padding:3px 10px;font-size:11.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-nav-link{border:0;background:transparent;cursor:pointer;font-size:12px;font-weight:700;color:var(--color-accent-hover)}.x-nav-form{margin-top:12px;padding-top:12px;border-top:1px solid var(--color-border);display:flex;flex-direction:column;gap:10px}.x-nav-f{display:flex;flex-direction:column;gap:4px;flex:1;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-nav-check{flex-direction:row;align-items:center;gap:6px}.x-nav-f-row{display:flex;gap:10px}.x-nav-form-actions{display:flex;gap:8px}\n"], dependencies: [{ kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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.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"] }] }); }
|
|
254
254
|
}
|
|
255
255
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: NavigationComponent, decorators: [{
|
|
256
256
|
type: Component,
|
|
@@ -260,7 +260,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
260
260
|
class NavigationModule {
|
|
261
261
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: NavigationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
262
262
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: NavigationModule, declarations: [NavigationComponent], imports: [SharedModule,
|
|
263
|
-
ElementsModule, i1$
|
|
263
|
+
ElementsModule, i1$1.RouterModule] }); }
|
|
264
264
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: NavigationModule, imports: [SharedModule,
|
|
265
265
|
ElementsModule,
|
|
266
266
|
RouterModule.forChild([{ path: '', component: NavigationComponent }])] }); }
|
|
@@ -278,4 +278,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
278
278
|
}] });
|
|
279
279
|
|
|
280
280
|
export { NavigationModule };
|
|
281
|
-
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-navigation.module-
|
|
281
|
+
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-navigation.module-De1Cvqqa.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-navigation.module-DoKzzRgn.mjs","sources":["../../../projects/admin/src/lib/pages/navigation/navigation.component.ts","../../../projects/admin/src/lib/pages/navigation/navigation.component.html","../../../projects/admin/src/lib/pages/navigation/navigation.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { BaseDirective, notify, using } from '@thescaffold/ngx-core';\nimport { firstValueFrom, takeUntil } from 'rxjs';\n\ninterface MenuVm {\n id: string;\n location: string;\n name: string;\n enabled: boolean;\n}\n\ninterface ItemVm {\n id: string;\n menuId: string;\n label: string;\n url: string;\n position: number;\n parentId?: string;\n icon?: string;\n openInNewTab: boolean;\n startsAt?: string;\n endsAt?: string;\n enabled: boolean;\n}\n\nconst LOCATIONS = [\n 'header_primary',\n 'header_secondary',\n 'footer',\n 'mobile_drawer',\n 'utility_bar',\n];\n\n// P6.12, CMS-03 — the ops navigation editor. Menus (one per location) and\n// their items: label, url, nesting (`parentId`), schedule and order. The\n// storefront shell consumes `header_primary` (P6.12 shell wiring).\n@Component({\n standalone: false,\n selector: 'x-navigation',\n templateUrl: './navigation.component.html',\n})\nexport class NavigationComponent extends BaseDirective {\n private readonly menuSource = this.apiService.on('apps/commerce/navigation-menu');\n private readonly itemSource = this.apiService.on('apps/commerce/navigation-item');\n\n readonly locations = LOCATIONS;\n\n loading = true;\n menus: MenuVm[] = [];\n selected?: MenuVm;\n items: ItemVm[] = [];\n\n newMenuLocation = LOCATIONS[0];\n newMenuName = '';\n\n editingItem?: ItemVm;\n itemModel: {\n label: string;\n url: string;\n parentId: string;\n icon: string;\n openInNewTab: boolean;\n startsAt: string;\n endsAt: string;\n } = this.blankItem();\n\n private dragIndex: number | null = null;\n\n override init = () => {\n this.load();\n };\n\n get topLevel(): ItemVm[] {\n return this.items\n .filter((i) => !i.parentId)\n .sort((a, b) => a.position - b.position);\n }\n\n childrenOf(parentId: string): ItemVm[] {\n return this.items\n .filter((i) => i.parentId === parentId)\n .sort((a, b) => a.position - b.position);\n }\n\n get parentOptions(): ItemVm[] {\n // Only top-level items can be parents (one level of nesting).\n return this.items.filter((i) => !i.parentId && i.id !== this.editingItem?.id);\n }\n\n load(): void {\n this.loading = true;\n this.menuSource\n .getMany({ perPage: 100 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n this.menus = (res?.data ?? []).sort((a: any, b: any) =>\n String(a.location).localeCompare(String(b.location)),\n );\n this.loading = false;\n if (this.selected) {\n this.selected = this.menus.find((m) => m.id === this.selected!.id);\n }\n }),\n );\n }\n\n async createMenu(): Promise<void> {\n const name = this.newMenuName.trim();\n if (!name) return;\n try {\n const res: any = await firstValueFrom(\n this.menuSource.create({\n location: this.newMenuLocation,\n name,\n enabled: true,\n } as any),\n );\n this.newMenuName = '';\n notify('Menu created.', undefined, 'success');\n this.load();\n if (res?.data?.id) setTimeout(() => this.select({ ...res.data }), 200);\n } catch {\n notify('Could not create the menu.', undefined, 'error');\n }\n }\n\n select(menu: MenuVm): void {\n this.selected = menu;\n this.editingItem = undefined;\n this.loadItems();\n }\n\n async deleteMenu(): Promise<void> {\n if (!this.selected) return;\n try {\n await firstValueFrom(this.menuSource.remove(this.selected.id));\n this.selected = undefined;\n this.items = [];\n notify('Menu deleted.', undefined, 'success');\n this.load();\n } catch {\n notify('Could not delete the menu.', undefined, 'error');\n }\n }\n\n private loadItems(): void {\n if (!this.selected) return;\n this.itemSource\n .getMany({ menuId: this.selected.id, perPage: 200 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n this.items = ((res?.data ?? []) as ItemVm[]).filter(\n (i) => i.menuId === this.selected!.id,\n );\n }),\n );\n }\n\n async addItem(): Promise<void> {\n if (!this.selected) return;\n try {\n await firstValueFrom(\n this.itemSource.create({\n menuId: this.selected.id,\n label: 'New link',\n url: '/',\n position: this.topLevel.length,\n enabled: true,\n } as any),\n );\n this.loadItems();\n } catch {\n notify('Could not add the item.', undefined, 'error');\n }\n }\n\n editItem(item: ItemVm): void {\n this.editingItem = item;\n this.itemModel = {\n label: item.label,\n url: typeof item.url === 'string' ? item.url : '',\n parentId: item.parentId ?? '',\n icon: item.icon ?? '',\n openInNewTab: !!item.openInNewTab,\n startsAt: this.toLocal(item.startsAt),\n endsAt: this.toLocal(item.endsAt),\n };\n }\n\n cancelItemEdit(): void {\n this.editingItem = undefined;\n this.itemModel = this.blankItem();\n }\n\n async saveItem(): Promise<void> {\n if (!this.editingItem) return;\n try {\n await firstValueFrom(\n this.itemSource.update(this.editingItem.id, {\n label: this.itemModel.label.trim() || 'Link',\n url: this.itemModel.url.trim() || '/',\n parentId: this.itemModel.parentId || null,\n icon: this.itemModel.icon.trim() || undefined,\n openInNewTab: this.itemModel.openInNewTab,\n startsAt: this.itemModel.startsAt ? new Date(this.itemModel.startsAt).toISOString() : null,\n endsAt: this.itemModel.endsAt ? new Date(this.itemModel.endsAt).toISOString() : null,\n } as any),\n );\n notify('Item saved.', undefined, 'success');\n this.cancelItemEdit();\n this.loadItems();\n } catch {\n notify('Could not save the item.', undefined, 'error');\n }\n }\n\n async toggleItem(item: ItemVm): Promise<void> {\n const next = !item.enabled;\n try {\n await firstValueFrom(this.itemSource.update(item.id, { enabled: next } as any));\n item.enabled = next;\n } catch {\n notify('Could not update the item.', undefined, 'error');\n }\n }\n\n async removeItem(item: ItemVm): Promise<void> {\n try {\n // Detach any children first so they don't dangle.\n await Promise.all(\n this.childrenOf(item.id).map((child) =>\n firstValueFrom(this.itemSource.update(child.id, { parentId: null } as any)),\n ),\n );\n await firstValueFrom(this.itemSource.remove(item.id));\n this.items = this.items.filter((i) => i.id !== item.id);\n if (this.editingItem?.id === item.id) this.cancelItemEdit();\n notify('Item removed.', undefined, 'success');\n } catch {\n notify('Could not remove the item.', undefined, 'error');\n }\n }\n\n onDragStart(index: number): void {\n this.dragIndex = index;\n }\n\n onDragOver(event: DragEvent): void {\n event.preventDefault();\n }\n\n onDrop(targetIndex: number): void {\n if (this.dragIndex === null || this.dragIndex === targetIndex) return;\n const ordered = this.topLevel;\n const [moved] = ordered.splice(this.dragIndex, 1);\n ordered.splice(targetIndex, 0, moved);\n this.dragIndex = null;\n void this.persistOrder(ordered);\n }\n\n moveItem(index: number, dir: -1 | 1): void {\n const ordered = this.topLevel;\n const target = index + dir;\n if (target < 0 || target >= ordered.length) return;\n [ordered[index], ordered[target]] = [ordered[target], ordered[index]];\n void this.persistOrder(ordered);\n }\n\n private async persistOrder(ordered: ItemVm[]): Promise<void> {\n const changed: ItemVm[] = [];\n ordered.forEach((item, i) => {\n if (item.position !== i) {\n item.position = i;\n changed.push(item);\n }\n });\n try {\n await Promise.all(\n changed.map((item) =>\n firstValueFrom(this.itemSource.update(item.id, { position: item.position } as any)),\n ),\n );\n } catch {\n notify('Could not save the new order.', undefined, 'error');\n this.loadItems();\n }\n }\n\n private blankItem() {\n return {\n label: '',\n url: '',\n parentId: '',\n icon: '',\n openInNewTab: false,\n startsAt: '',\n endsAt: '',\n };\n }\n\n private toLocal(iso?: string): string {\n if (!iso) return '';\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return '';\n const pad = (n: number) => String(n).padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;\n }\n}\n","<div class=\"x-nav-head\">\n <div class=\"x-nav-title\">Navigation</div>\n <div class=\"x-nav-sub\">Storefront menus — the shell consumes the <code>header_primary</code> menu.</div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n <div class=\"x-nav-layout\">\n <aside class=\"x-nav-list\">\n <div class=\"x-nav-new\">\n <select [(ngModel)]=\"newMenuLocation\">\n @for (l of locations; track l) { <option [value]=\"l\">{{ l }}</option> }\n </select>\n <input type=\"text\" placeholder=\"Menu name\" [(ngModel)]=\"newMenuName\" />\n <button type=\"button\" (click)=\"createMenu()\">Add menu</button>\n </div>\n @for (m of menus; track m.id) {\n <button\n type=\"button\"\n class=\"x-nav-list-item\"\n [class.x-nav-list-active]=\"selected?.id === m.id\"\n (click)=\"select(m)\"\n >\n <span class=\"x-nav-list-title\">{{ m.name }}</span>\n <span class=\"x-nav-list-meta\">{{ m.location }}</span>\n </button>\n } @empty {\n <div class=\"x-nav-empty\">No menus yet.</div>\n }\n </aside>\n\n <section class=\"x-nav-editor\">\n @if (!selected) {\n <div class=\"x-nav-empty\">Pick a menu, or add one.</div>\n } @else {\n <div class=\"x-nav-editor-head\">\n <span>{{ selected.name }} — <code>{{ selected.location }}</code></span>\n <span>\n <button type=\"button\" class=\"x-nav-btn\" (click)=\"addItem()\">Add link</button>\n <button type=\"button\" class=\"x-nav-btn x-nav-danger\" (click)=\"deleteMenu()\">Delete menu</button>\n </span>\n </div>\n\n @if (!topLevel.length) {\n <div class=\"x-nav-empty\">No links yet.</div>\n } @else {\n <div class=\"x-nav-items\">\n @for (item of topLevel; track item.id; let i = $index) {\n <div\n class=\"x-nav-item\"\n [class.x-nav-item-off]=\"!item.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-nav-item-row\">\n <span class=\"x-nav-grip\">⠿</span>\n <div class=\"x-nav-order\">\n <button type=\"button\" (click)=\"moveItem(i, -1)\" [disabled]=\"i === 0\">▲</button>\n <button type=\"button\" (click)=\"moveItem(i, 1)\" [disabled]=\"i === topLevel.length - 1\">▼</button>\n </div>\n <span class=\"x-nav-item-label\">{{ item.label }}</span>\n <span class=\"x-nav-item-url\">{{ item.url }}</span>\n <span class=\"x-nav-item-actions\">\n <button type=\"button\" class=\"x-nav-toggle\" (click)=\"toggleItem(item)\">{{ item.enabled ? 'On' : 'Off' }}</button>\n <button type=\"button\" class=\"x-nav-link\" (click)=\"editItem(item)\">Edit</button>\n <button type=\"button\" class=\"x-nav-link x-nav-danger\" (click)=\"removeItem(item)\">Delete</button>\n </span>\n </div>\n\n @for (child of childrenOf(item.id); track child.id) {\n <div class=\"x-nav-child\" [class.x-nav-item-off]=\"!child.enabled\">\n <span class=\"x-nav-child-label\">↳ {{ child.label }}</span>\n <span class=\"x-nav-item-url\">{{ child.url }}</span>\n <span class=\"x-nav-item-actions\">\n <button type=\"button\" class=\"x-nav-toggle\" (click)=\"toggleItem(child)\">{{ child.enabled ? 'On' : 'Off' }}</button>\n <button type=\"button\" class=\"x-nav-link\" (click)=\"editItem(child)\">Edit</button>\n <button type=\"button\" class=\"x-nav-link x-nav-danger\" (click)=\"removeItem(child)\">Delete</button>\n </span>\n </div>\n }\n </div>\n }\n </div>\n }\n\n @if (editingItem) {\n <ng-container *ngTemplateOutlet=\"itemForm\"></ng-container>\n }\n }\n </section>\n </div>\n}\n\n<ng-template #itemForm>\n <div class=\"x-nav-form\">\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">Label<input type=\"text\" [(ngModel)]=\"itemModel.label\" /></label>\n <label class=\"x-nav-f\">URL<input type=\"text\" [(ngModel)]=\"itemModel.url\" placeholder=\"/c/solar-panels\" /></label>\n </div>\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">\n Parent\n <select [(ngModel)]=\"itemModel.parentId\">\n <option value=\"\">— top level —</option>\n @for (p of parentOptions; track p.id) { <option [value]=\"p.id\">{{ p.label }}</option> }\n </select>\n </label>\n <label class=\"x-nav-f\">Icon<input type=\"text\" [(ngModel)]=\"itemModel.icon\" /></label>\n <label class=\"x-nav-f x-nav-check\">\n <input type=\"checkbox\" [(ngModel)]=\"itemModel.openInNewTab\" /> New tab\n </label>\n </div>\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">Starts<input type=\"datetime-local\" [(ngModel)]=\"itemModel.startsAt\" /></label>\n <label class=\"x-nav-f\">Ends<input type=\"datetime-local\" [(ngModel)]=\"itemModel.endsAt\" /></label>\n </div>\n <div class=\"x-nav-form-actions\">\n <button type=\"button\" class=\"x-nav-btn x-nav-btn-primary\" (click)=\"saveItem()\">Save link</button>\n <button type=\"button\" class=\"x-nav-btn\" (click)=\"cancelItemEdit()\">Cancel</button>\n </div>\n </div>\n</ng-template>\n\n<style>\n .x-nav-head { margin-bottom: 20px; }\n .x-nav-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-nav-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-nav-sub code, .x-nav-editor-head code { font-family: var(--font-mono); font-size: 12px; }\n .x-nav-empty { font-size: 14px; color: var(--color-text-muted); padding: 12px 0; }\n .x-nav-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }\n .x-nav-list { display: flex; flex-direction: column; gap: 6px; }\n .x-nav-new { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }\n .x-nav-new select, .x-nav-new input, .x-nav-f input, .x-nav-f select {\n border: 1px solid var(--color-border); border-radius: var(--radius-md);\n padding: 6px 10px; font-size: 13px; background: var(--color-surface); color: var(--color-text);\n }\n .x-nav-new button, .x-nav-btn {\n border: 1px solid var(--color-border); background: transparent; border-radius: var(--radius-md);\n padding: 6px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--color-text-muted);\n }\n .x-nav-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-nav-danger { color: var(--color-danger, #c0362c); }\n .x-nav-list-item {\n text-align: left; border: 1px solid var(--color-border); border-radius: var(--radius-md);\n background: var(--color-surface); padding: 8px 10px; cursor: pointer;\n display: flex; flex-direction: column; gap: 2px;\n }\n .x-nav-list-active { border-color: var(--color-accent); }\n .x-nav-list-title { font-size: 13px; font-weight: 700; color: var(--color-text); }\n .x-nav-list-meta { font-size: 11px; color: var(--color-text-muted); }\n .x-nav-editor { min-width: 0; }\n .x-nav-editor-head {\n display: flex; justify-content: space-between; align-items: center;\n font-size: 13px; font-weight: 700; color: var(--color-text); margin-bottom: 12px;\n }\n .x-nav-editor-head button { margin-left: 6px; }\n .x-nav-items { display: flex; flex-direction: column; gap: 8px; }\n .x-nav-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 10px 12px; }\n .x-nav-item-off { opacity: 0.5; }\n .x-nav-item-row, .x-nav-child { display: flex; align-items: center; gap: 10px; }\n .x-nav-child { padding: 6px 0 0 28px; font-size: 12.5px; }\n .x-nav-grip { cursor: grab; color: var(--color-text-muted); }\n .x-nav-order { display: flex; flex-direction: column; }\n .x-nav-order button { border: 0; background: transparent; cursor: pointer; color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px; }\n .x-nav-order button:disabled { opacity: 0.3; }\n .x-nav-item-label, .x-nav-child-label { font-weight: 700; font-size: 13px; }\n .x-nav-item-url { font-size: 11.5px; color: var(--color-text-muted); font-family: var(--font-mono); flex: 1; }\n .x-nav-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-nav-toggle { border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; color: var(--color-text-muted); }\n .x-nav-link { border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--color-accent-hover); }\n .x-nav-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 10px; }\n .x-nav-f { display: flex; flex-direction: column; gap: 4px; flex: 1; font-size: 11.5px; color: var(--color-text-muted); font-weight: 700; }\n .x-nav-check { flex-direction: row; align-items: center; gap: 6px; }\n .x-nav-f-row { display: flex; gap: 10px; }\n .x-nav-form-actions { display: flex; gap: 8px; }\n</style>\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { NavigationComponent } from './navigation.component';\n\n@NgModule({\n declarations: [NavigationComponent],\n imports: [\n SharedModule,\n ElementsModule,\n RouterModule.forChild([{ path: '', component: NavigationComponent }]),\n ],\n})\nexport class NavigationModule {}\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;AAyBA,MAAM,SAAS,GAAG;IAChB,gBAAgB;IAChB,kBAAkB;IAClB,QAAQ;IACR,eAAe;IACf,aAAa;CACd;AAED;AACA;AACA;AAMM,MAAO,mBAAoB,SAAQ,aAAa,CAAA;AALtD,IAAA,WAAA,GAAA;;QA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,UAAA,EAAA,CAAA;kBAR5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;AACd,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC;AACtE,qBAAA;AACF,iBAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-navigation.module-De1Cvqqa.mjs","sources":["../../../projects/admin/src/lib/pages/navigation/navigation.component.ts","../../../projects/admin/src/lib/pages/navigation/navigation.component.html","../../../projects/admin/src/lib/pages/navigation/navigation.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { BaseDirective, notify, using } from '@thescaffold/ngx-core';\nimport { firstValueFrom, takeUntil } from 'rxjs';\n\ninterface MenuVm {\n id: string;\n location: string;\n name: string;\n enabled: boolean;\n}\n\ninterface ItemVm {\n id: string;\n menuId: string;\n label: string;\n url: string;\n position: number;\n parentId?: string;\n icon?: string;\n openInNewTab: boolean;\n startsAt?: string;\n endsAt?: string;\n enabled: boolean;\n}\n\nconst LOCATIONS = [\n 'header_primary',\n 'header_secondary',\n 'footer',\n 'mobile_drawer',\n 'utility_bar',\n];\n\n// P6.12, CMS-03 — the ops navigation editor. Menus (one per location) and\n// their items: label, url, nesting (`parentId`), schedule and order. The\n// storefront shell consumes `header_primary` (P6.12 shell wiring).\n@Component({\n standalone: false,\n selector: 'x-navigation',\n templateUrl: './navigation.component.html',\n})\nexport class NavigationComponent extends BaseDirective {\n private readonly menuSource = this.apiService.on('apps/commerce/navigation-menu');\n private readonly itemSource = this.apiService.on('apps/commerce/navigation-item');\n\n readonly locations = LOCATIONS;\n\n loading = true;\n menus: MenuVm[] = [];\n selected?: MenuVm;\n items: ItemVm[] = [];\n\n newMenuLocation = LOCATIONS[0];\n newMenuName = '';\n\n editingItem?: ItemVm;\n itemModel: {\n label: string;\n url: string;\n parentId: string;\n icon: string;\n openInNewTab: boolean;\n startsAt: string;\n endsAt: string;\n } = this.blankItem();\n\n private dragIndex: number | null = null;\n\n override init = () => {\n this.load();\n };\n\n get topLevel(): ItemVm[] {\n return this.items\n .filter((i) => !i.parentId)\n .sort((a, b) => a.position - b.position);\n }\n\n childrenOf(parentId: string): ItemVm[] {\n return this.items\n .filter((i) => i.parentId === parentId)\n .sort((a, b) => a.position - b.position);\n }\n\n get parentOptions(): ItemVm[] {\n // Only top-level items can be parents (one level of nesting).\n return this.items.filter((i) => !i.parentId && i.id !== this.editingItem?.id);\n }\n\n load(): void {\n this.loading = true;\n this.menuSource\n .getMany({ perPage: 100 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n this.menus = (res?.data ?? []).sort((a: any, b: any) =>\n String(a.location).localeCompare(String(b.location)),\n );\n this.loading = false;\n if (this.selected) {\n this.selected = this.menus.find((m) => m.id === this.selected!.id);\n }\n }),\n );\n }\n\n async createMenu(): Promise<void> {\n const name = this.newMenuName.trim();\n if (!name) return;\n try {\n const res: any = await firstValueFrom(\n this.menuSource.create({\n location: this.newMenuLocation,\n name,\n enabled: true,\n } as any),\n );\n this.newMenuName = '';\n notify('Menu created.', undefined, 'success');\n this.load();\n if (res?.data?.id) setTimeout(() => this.select({ ...res.data }), 200);\n } catch {\n notify('Could not create the menu.', undefined, 'error');\n }\n }\n\n select(menu: MenuVm): void {\n this.selected = menu;\n this.editingItem = undefined;\n this.loadItems();\n }\n\n async deleteMenu(): Promise<void> {\n if (!this.selected) return;\n try {\n await firstValueFrom(this.menuSource.remove(this.selected.id));\n this.selected = undefined;\n this.items = [];\n notify('Menu deleted.', undefined, 'success');\n this.load();\n } catch {\n notify('Could not delete the menu.', undefined, 'error');\n }\n }\n\n private loadItems(): void {\n if (!this.selected) return;\n this.itemSource\n .getMany({ menuId: this.selected.id, perPage: 200 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n this.items = ((res?.data ?? []) as ItemVm[]).filter(\n (i) => i.menuId === this.selected!.id,\n );\n }),\n );\n }\n\n async addItem(): Promise<void> {\n if (!this.selected) return;\n try {\n await firstValueFrom(\n this.itemSource.create({\n menuId: this.selected.id,\n label: 'New link',\n url: '/',\n position: this.topLevel.length,\n enabled: true,\n } as any),\n );\n this.loadItems();\n } catch {\n notify('Could not add the item.', undefined, 'error');\n }\n }\n\n editItem(item: ItemVm): void {\n this.editingItem = item;\n this.itemModel = {\n label: item.label,\n url: typeof item.url === 'string' ? item.url : '',\n parentId: item.parentId ?? '',\n icon: item.icon ?? '',\n openInNewTab: !!item.openInNewTab,\n startsAt: this.toLocal(item.startsAt),\n endsAt: this.toLocal(item.endsAt),\n };\n }\n\n cancelItemEdit(): void {\n this.editingItem = undefined;\n this.itemModel = this.blankItem();\n }\n\n async saveItem(): Promise<void> {\n if (!this.editingItem) return;\n try {\n await firstValueFrom(\n this.itemSource.update(this.editingItem.id, {\n label: this.itemModel.label.trim() || 'Link',\n url: this.itemModel.url.trim() || '/',\n parentId: this.itemModel.parentId || null,\n icon: this.itemModel.icon.trim() || undefined,\n openInNewTab: this.itemModel.openInNewTab,\n startsAt: this.itemModel.startsAt ? new Date(this.itemModel.startsAt).toISOString() : null,\n endsAt: this.itemModel.endsAt ? new Date(this.itemModel.endsAt).toISOString() : null,\n } as any),\n );\n notify('Item saved.', undefined, 'success');\n this.cancelItemEdit();\n this.loadItems();\n } catch {\n notify('Could not save the item.', undefined, 'error');\n }\n }\n\n async toggleItem(item: ItemVm): Promise<void> {\n const next = !item.enabled;\n try {\n await firstValueFrom(this.itemSource.update(item.id, { enabled: next } as any));\n item.enabled = next;\n } catch {\n notify('Could not update the item.', undefined, 'error');\n }\n }\n\n async removeItem(item: ItemVm): Promise<void> {\n try {\n // Detach any children first so they don't dangle.\n await Promise.all(\n this.childrenOf(item.id).map((child) =>\n firstValueFrom(this.itemSource.update(child.id, { parentId: null } as any)),\n ),\n );\n await firstValueFrom(this.itemSource.remove(item.id));\n this.items = this.items.filter((i) => i.id !== item.id);\n if (this.editingItem?.id === item.id) this.cancelItemEdit();\n notify('Item removed.', undefined, 'success');\n } catch {\n notify('Could not remove the item.', undefined, 'error');\n }\n }\n\n onDragStart(index: number): void {\n this.dragIndex = index;\n }\n\n onDragOver(event: DragEvent): void {\n event.preventDefault();\n }\n\n onDrop(targetIndex: number): void {\n if (this.dragIndex === null || this.dragIndex === targetIndex) return;\n const ordered = this.topLevel;\n const [moved] = ordered.splice(this.dragIndex, 1);\n ordered.splice(targetIndex, 0, moved);\n this.dragIndex = null;\n void this.persistOrder(ordered);\n }\n\n moveItem(index: number, dir: -1 | 1): void {\n const ordered = this.topLevel;\n const target = index + dir;\n if (target < 0 || target >= ordered.length) return;\n [ordered[index], ordered[target]] = [ordered[target], ordered[index]];\n void this.persistOrder(ordered);\n }\n\n private async persistOrder(ordered: ItemVm[]): Promise<void> {\n const changed: ItemVm[] = [];\n ordered.forEach((item, i) => {\n if (item.position !== i) {\n item.position = i;\n changed.push(item);\n }\n });\n try {\n await Promise.all(\n changed.map((item) =>\n firstValueFrom(this.itemSource.update(item.id, { position: item.position } as any)),\n ),\n );\n } catch {\n notify('Could not save the new order.', undefined, 'error');\n this.loadItems();\n }\n }\n\n private blankItem() {\n return {\n label: '',\n url: '',\n parentId: '',\n icon: '',\n openInNewTab: false,\n startsAt: '',\n endsAt: '',\n };\n }\n\n private toLocal(iso?: string): string {\n if (!iso) return '';\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return '';\n const pad = (n: number) => String(n).padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;\n }\n}\n","<div class=\"x-nav-head\">\n <div class=\"x-nav-title\">Navigation</div>\n <div class=\"x-nav-sub\">Storefront menus — the shell consumes the <code>header_primary</code> menu.</div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n <div class=\"x-nav-layout\">\n <aside class=\"x-nav-list\">\n <div class=\"x-nav-new\">\n <select [(ngModel)]=\"newMenuLocation\">\n @for (l of locations; track l) { <option [value]=\"l\">{{ l }}</option> }\n </select>\n <input type=\"text\" placeholder=\"Menu name\" [(ngModel)]=\"newMenuName\" />\n <button type=\"button\" (click)=\"createMenu()\">Add menu</button>\n </div>\n @for (m of menus; track m.id) {\n <button\n type=\"button\"\n class=\"x-nav-list-item\"\n [class.x-nav-list-active]=\"selected?.id === m.id\"\n (click)=\"select(m)\"\n >\n <span class=\"x-nav-list-title\">{{ m.name }}</span>\n <span class=\"x-nav-list-meta\">{{ m.location }}</span>\n </button>\n } @empty {\n <div class=\"x-nav-empty\">No menus yet.</div>\n }\n </aside>\n\n <section class=\"x-nav-editor\">\n @if (!selected) {\n <div class=\"x-nav-empty\">Pick a menu, or add one.</div>\n } @else {\n <div class=\"x-nav-editor-head\">\n <span>{{ selected.name }} — <code>{{ selected.location }}</code></span>\n <span>\n <button type=\"button\" class=\"x-nav-btn\" (click)=\"addItem()\">Add link</button>\n <button type=\"button\" class=\"x-nav-btn x-nav-danger\" (click)=\"deleteMenu()\">Delete menu</button>\n </span>\n </div>\n\n @if (!topLevel.length) {\n <div class=\"x-nav-empty\">No links yet.</div>\n } @else {\n <div class=\"x-nav-items\">\n @for (item of topLevel; track item.id; let i = $index) {\n <div\n class=\"x-nav-item\"\n [class.x-nav-item-off]=\"!item.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-nav-item-row\">\n <span class=\"x-nav-grip\">⠿</span>\n <div class=\"x-nav-order\">\n <button type=\"button\" (click)=\"moveItem(i, -1)\" [disabled]=\"i === 0\">▲</button>\n <button type=\"button\" (click)=\"moveItem(i, 1)\" [disabled]=\"i === topLevel.length - 1\">▼</button>\n </div>\n <span class=\"x-nav-item-label\">{{ item.label }}</span>\n <span class=\"x-nav-item-url\">{{ item.url }}</span>\n <span class=\"x-nav-item-actions\">\n <button type=\"button\" class=\"x-nav-toggle\" (click)=\"toggleItem(item)\">{{ item.enabled ? 'On' : 'Off' }}</button>\n <button type=\"button\" class=\"x-nav-link\" (click)=\"editItem(item)\">Edit</button>\n <button type=\"button\" class=\"x-nav-link x-nav-danger\" (click)=\"removeItem(item)\">Delete</button>\n </span>\n </div>\n\n @for (child of childrenOf(item.id); track child.id) {\n <div class=\"x-nav-child\" [class.x-nav-item-off]=\"!child.enabled\">\n <span class=\"x-nav-child-label\">↳ {{ child.label }}</span>\n <span class=\"x-nav-item-url\">{{ child.url }}</span>\n <span class=\"x-nav-item-actions\">\n <button type=\"button\" class=\"x-nav-toggle\" (click)=\"toggleItem(child)\">{{ child.enabled ? 'On' : 'Off' }}</button>\n <button type=\"button\" class=\"x-nav-link\" (click)=\"editItem(child)\">Edit</button>\n <button type=\"button\" class=\"x-nav-link x-nav-danger\" (click)=\"removeItem(child)\">Delete</button>\n </span>\n </div>\n }\n </div>\n }\n </div>\n }\n\n @if (editingItem) {\n <ng-container *ngTemplateOutlet=\"itemForm\"></ng-container>\n }\n }\n </section>\n </div>\n}\n\n<ng-template #itemForm>\n <div class=\"x-nav-form\">\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">Label<input type=\"text\" [(ngModel)]=\"itemModel.label\" /></label>\n <label class=\"x-nav-f\">URL<input type=\"text\" [(ngModel)]=\"itemModel.url\" placeholder=\"/c/solar-panels\" /></label>\n </div>\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">\n Parent\n <select [(ngModel)]=\"itemModel.parentId\">\n <option value=\"\">— top level —</option>\n @for (p of parentOptions; track p.id) { <option [value]=\"p.id\">{{ p.label }}</option> }\n </select>\n </label>\n <label class=\"x-nav-f\">Icon<input type=\"text\" [(ngModel)]=\"itemModel.icon\" /></label>\n <label class=\"x-nav-f x-nav-check\">\n <input type=\"checkbox\" [(ngModel)]=\"itemModel.openInNewTab\" /> New tab\n </label>\n </div>\n <div class=\"x-nav-f-row\">\n <label class=\"x-nav-f\">Starts<input type=\"datetime-local\" [(ngModel)]=\"itemModel.startsAt\" /></label>\n <label class=\"x-nav-f\">Ends<input type=\"datetime-local\" [(ngModel)]=\"itemModel.endsAt\" /></label>\n </div>\n <div class=\"x-nav-form-actions\">\n <button type=\"button\" class=\"x-nav-btn x-nav-btn-primary\" (click)=\"saveItem()\">Save link</button>\n <button type=\"button\" class=\"x-nav-btn\" (click)=\"cancelItemEdit()\">Cancel</button>\n </div>\n </div>\n</ng-template>\n\n<style>\n .x-nav-head { margin-bottom: 20px; }\n .x-nav-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-nav-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-nav-sub code, .x-nav-editor-head code { font-family: var(--font-mono); font-size: 12px; }\n .x-nav-empty { font-size: 14px; color: var(--color-text-muted); padding: 12px 0; }\n .x-nav-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }\n .x-nav-list { display: flex; flex-direction: column; gap: 6px; }\n .x-nav-new { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }\n .x-nav-new select, .x-nav-new input, .x-nav-f input, .x-nav-f select {\n border: 1px solid var(--color-border); border-radius: var(--radius-md);\n padding: 6px 10px; font-size: 13px; background: var(--color-surface); color: var(--color-text);\n }\n .x-nav-new button, .x-nav-btn {\n border: 1px solid var(--color-border); background: transparent; border-radius: var(--radius-md);\n padding: 6px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--color-text-muted);\n }\n .x-nav-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-nav-danger { color: var(--color-danger, #c0362c); }\n .x-nav-list-item {\n text-align: left; border: 1px solid var(--color-border); border-radius: var(--radius-md);\n background: var(--color-surface); padding: 8px 10px; cursor: pointer;\n display: flex; flex-direction: column; gap: 2px;\n }\n .x-nav-list-active { border-color: var(--color-accent); }\n .x-nav-list-title { font-size: 13px; font-weight: 700; color: var(--color-text); }\n .x-nav-list-meta { font-size: 11px; color: var(--color-text-muted); }\n .x-nav-editor { min-width: 0; }\n .x-nav-editor-head {\n display: flex; justify-content: space-between; align-items: center;\n font-size: 13px; font-weight: 700; color: var(--color-text); margin-bottom: 12px;\n }\n .x-nav-editor-head button { margin-left: 6px; }\n .x-nav-items { display: flex; flex-direction: column; gap: 8px; }\n .x-nav-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 10px 12px; }\n .x-nav-item-off { opacity: 0.5; }\n .x-nav-item-row, .x-nav-child { display: flex; align-items: center; gap: 10px; }\n .x-nav-child { padding: 6px 0 0 28px; font-size: 12.5px; }\n .x-nav-grip { cursor: grab; color: var(--color-text-muted); }\n .x-nav-order { display: flex; flex-direction: column; }\n .x-nav-order button { border: 0; background: transparent; cursor: pointer; color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px; }\n .x-nav-order button:disabled { opacity: 0.3; }\n .x-nav-item-label, .x-nav-child-label { font-weight: 700; font-size: 13px; }\n .x-nav-item-url { font-size: 11.5px; color: var(--color-text-muted); font-family: var(--font-mono); flex: 1; }\n .x-nav-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-nav-toggle { border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; color: var(--color-text-muted); }\n .x-nav-link { border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--color-accent-hover); }\n .x-nav-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 10px; }\n .x-nav-f { display: flex; flex-direction: column; gap: 4px; flex: 1; font-size: 11.5px; color: var(--color-text-muted); font-weight: 700; }\n .x-nav-check { flex-direction: row; align-items: center; gap: 6px; }\n .x-nav-f-row { display: flex; gap: 10px; }\n .x-nav-form-actions { display: flex; gap: 8px; }\n</style>\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { NavigationComponent } from './navigation.component';\n\n@NgModule({\n declarations: [NavigationComponent],\n imports: [\n SharedModule,\n ElementsModule,\n RouterModule.forChild([{ path: '', component: NavigationComponent }]),\n ],\n})\nexport class NavigationModule {}\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;AAyBA,MAAM,SAAS,GAAG;IAChB,gBAAgB;IAChB,kBAAkB;IAClB,QAAQ;IACR,eAAe;IACf,aAAa;CACd;AAED;AACA;AACA;AAMM,MAAO,mBAAoB,SAAQ,aAAa,CAAA;AALtD,IAAA,WAAA,GAAA;;QAMmB,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,+BAA+B,CAAC;QAChE,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,+BAA+B,CAAC;QAExE,IAAA,CAAA,SAAS,GAAG,SAAS;QAE9B,IAAA,CAAA,OAAO,GAAG,IAAI;QACd,IAAA,CAAA,KAAK,GAAa,EAAE;QAEpB,IAAA,CAAA,KAAK,GAAa,EAAE;AAEpB,QAAA,IAAA,CAAA,eAAe,GAAG,SAAS,CAAC,CAAC,CAAC;QAC9B,IAAA,CAAA,WAAW,GAAG,EAAE;AAGhB,QAAA,IAAA,CAAA,SAAS,GAQL,IAAI,CAAC,SAAS,EAAE;QAEZ,IAAA,CAAA,SAAS,GAAkB,IAAI;QAE9B,IAAA,CAAA,IAAI,GAAG,MAAK;YACnB,IAAI,CAAC,IAAI,EAAE;AACb,QAAA,CAAC;AA+OF,IAAA;AA7OC,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC;aACT,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;AACzB,aAAA,IAAI,CAAC,C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,gBAAgB,EAAA,YAAA,EAAA,CAPZ,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAEhC,YAAY;YACZ,cAAc,EAAAF,IAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIL,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,YALzB,YAAY;YACZ,cAAc;AACd,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;kBAR5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;AACd,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC;AACtE,qBAAA;AACF,iBAAA;;;;;"}
|
|
@@ -3,10 +3,10 @@ import { Component, NgModule } from '@angular/core';
|
|
|
3
3
|
import * as i1 from '@angular/router';
|
|
4
4
|
import { RouterModule } from '@angular/router';
|
|
5
5
|
import { BaseDirective, using, SharedModule } from '@thescaffold/ngx-core';
|
|
6
|
-
import * as
|
|
6
|
+
import * as i2 from '@thescaffold/ngx-ui';
|
|
7
7
|
import { ElementsModule } from '@thescaffold/ngx-ui';
|
|
8
8
|
import { BehaviorSubject, takeUntil } from 'rxjs';
|
|
9
|
-
import * as
|
|
9
|
+
import * as i3 from '@angular/common';
|
|
10
10
|
|
|
11
11
|
// ORD-12 — the ops work queues. Each column is a stage of the order
|
|
12
12
|
// lifecycle a team acts on; cards carry an age so a stale one stands out
|
|
@@ -84,7 +84,7 @@ class OrderBoardComponent extends BaseDirective {
|
|
|
84
84
|
return `${Math.floor(hours / 24)}d`;
|
|
85
85
|
}
|
|
86
86
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrderBoardComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
87
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: OrderBoardComponent, isStandalone: false, selector: "x-order-board", usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Order board</div>\n <div class=\"x-page-subtitle\">Every open order by ops queue (ORD-12). Cards are oldest-first.</div>\n</div>\n\n@if (columns$ | async; as columns) {\n <div class=\"x-board\">\n @for (col of columns; track col.key) {\n <div class=\"x-board-col\">\n <div class=\"x-board-col-head\">\n <span>{{ col.label }}</span>\n <span class=\"x-board-col-count\">{{ col.cards.length }}</span>\n </div>\n <div class=\"x-board-col-body\">\n @for (card of col.cards; track card.id) {\n <a class=\"x-order-card\" [routerLink]=\"['../orders']\" [queryParams]=\"{ q: card.orderNumber }\">\n <div class=\"x-order-card-row\">\n <span class=\"x-order-card-num\">{{ card.orderNumber }}</span>\n <span class=\"x-order-card-age\" [class.stale]=\"card.ageHours >= 48\">{{ card.ageLabel }}</span>\n </div>\n <div class=\"x-order-card-total\">{{ card.totalLabel }}</div>\n </a>\n } @empty {\n <div class=\"x-board-col-empty\">None</div>\n }\n </div>\n </div>\n }\n </div>\n} @else {\n <x-element-loader></x-element-loader>\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-board{display:flex;gap:14px;overflow-x:auto;padding-bottom:12px}.x-board-col{flex:0 0 230px;background:var(--color-surface-2, var(--color-surface));border:1px solid var(--color-border);border-radius:10px;display:flex;flex-direction:column;max-height:calc(100vh - 180px)}.x-board-col-head{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;color:var(--color-text-muted)}.x-board-col-count{background:var(--color-surface);border:1px solid var(--color-border);border-radius:10px;padding:1px 7px;font-size:11px}.x-board-col-body{display:flex;flex-direction:column;gap:8px;padding:0 10px 10px;overflow-y:auto}.x-board-col-empty{font-size:12px;color:var(--color-text-muted);padding:8px 4px;text-align:center}.x-order-card{display:block;text-decoration:none;background:var(--color-surface);border:1px solid var(--color-border);border-radius:8px;padding:10px 12px}.x-order-card-row{display:flex;justify-content:space-between;align-items:baseline}.x-order-card-num{font-family:var(--font-mono);font-size:12px;color:var(--color-text)}.x-order-card-age{font-size:11px;color:var(--color-text-muted)}.x-order-card-age.stale{color:var(--color-danger);font-weight:700}.x-order-card-total{font-size:13px;font-weight:800;color:var(--color-text);margin-top:6px}\n"], dependencies: [{ kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type:
|
|
87
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: OrderBoardComponent, isStandalone: false, selector: "x-order-board", usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Order board</div>\n <div class=\"x-page-subtitle\">Every open order by ops queue (ORD-12). Cards are oldest-first.</div>\n</div>\n\n@if (columns$ | async; as columns) {\n <div class=\"x-board\">\n @for (col of columns; track col.key) {\n <div class=\"x-board-col\">\n <div class=\"x-board-col-head\">\n <span>{{ col.label }}</span>\n <span class=\"x-board-col-count\">{{ col.cards.length }}</span>\n </div>\n <div class=\"x-board-col-body\">\n @for (card of col.cards; track card.id) {\n <a class=\"x-order-card\" [routerLink]=\"['../orders']\" [queryParams]=\"{ q: card.orderNumber }\">\n <div class=\"x-order-card-row\">\n <span class=\"x-order-card-num\">{{ card.orderNumber }}</span>\n <span class=\"x-order-card-age\" [class.stale]=\"card.ageHours >= 48\">{{ card.ageLabel }}</span>\n </div>\n <div class=\"x-order-card-total\">{{ card.totalLabel }}</div>\n </a>\n } @empty {\n <div class=\"x-board-col-empty\">None</div>\n }\n </div>\n </div>\n }\n </div>\n} @else {\n <x-element-loader></x-element-loader>\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-board{display:flex;gap:14px;overflow-x:auto;padding-bottom:12px}.x-board-col{flex:0 0 230px;background:var(--color-surface-2, var(--color-surface));border:1px solid var(--color-border);border-radius:10px;display:flex;flex-direction:column;max-height:calc(100vh - 180px)}.x-board-col-head{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;color:var(--color-text-muted)}.x-board-col-count{background:var(--color-surface);border:1px solid var(--color-border);border-radius:10px;padding:1px 7px;font-size:11px}.x-board-col-body{display:flex;flex-direction:column;gap:8px;padding:0 10px 10px;overflow-y:auto}.x-board-col-empty{font-size:12px;color:var(--color-text-muted);padding:8px 4px;text-align:center}.x-order-card{display:block;text-decoration:none;background:var(--color-surface);border:1px solid var(--color-border);border-radius:8px;padding:10px 12px}.x-order-card-row{display:flex;justify-content:space-between;align-items:baseline}.x-order-card-num{font-family:var(--font-mono);font-size:12px;color:var(--color-text)}.x-order-card-age{font-size:11px;color:var(--color-text-muted)}.x-order-card-age.stale{color:var(--color-danger);font-weight:700}.x-order-card-total{font-size:13px;font-weight:800;color:var(--color-text);margin-top:6px}\n"], dependencies: [{ kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
|
|
88
88
|
}
|
|
89
89
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrderBoardComponent, decorators: [{
|
|
90
90
|
type: Component,
|
|
@@ -112,4 +112,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
112
112
|
}] });
|
|
113
113
|
|
|
114
114
|
export { OrderBoardModule };
|
|
115
|
-
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-order-board.module-
|
|
115
|
+
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-order-board.module-CmLNiEEP.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-order-board.module-DIOjhptn.mjs","sources":["../../../projects/admin/src/lib/pages/order-board/order-board.component.ts","../../../projects/admin/src/lib/pages/order-board/order-board.component.html","../../../projects/admin/src/lib/pages/order-board/order-board.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { BaseDirective, using } from '@thescaffold/ngx-core';\nimport { BehaviorSubject, takeUntil } from 'rxjs';\n\n// ORD-12 — the ops work queues. Each column is a stage of the order\n// lifecycle a team acts on; cards carry an age so a stale one stands out\n// (a crude SLA cue until per-queue SLA timers + assignment land in P7).\nconst QUEUES: { key: string; label: string; statuses: string[] }[] = [\n { key: 'awaiting_payment', label: 'Awaiting payment', statuses: ['pending_payment', 'on_hold'] },\n { key: 'new', label: 'New — to confirm', statuses: ['payment_received', 'confirmed'] },\n { key: 'processing', label: 'Being prepared', statuses: ['processing', 'partially_fulfilled'] },\n {\n key: 'ready',\n label: 'Ready to ship / pick',\n statuses: ['ready_to_ship', 'ready_for_pickup'],\n },\n {\n key: 'in_transit',\n label: 'In transit',\n statuses: ['dispatched', 'out_for_delivery'],\n },\n { key: 'exceptions', label: 'Delivery exceptions', statuses: ['failed_delivery'] },\n {\n key: 'returns',\n label: 'Returns in flight',\n statuses: ['return_in_flight', 'returned'],\n },\n { key: 'done', label: 'Delivered / done', statuses: ['delivered', 'completed'] },\n];\n\nfunction naira(amount: number, currency = 'NGN'): string {\n return `${currency} ${Math.round(amount).toLocaleString('en-US')}`;\n}\n\ninterface CardVm {\n id: string;\n orderNumber: string;\n totalLabel: string;\n ageLabel: string;\n ageHours: number;\n status: string;\n}\n\ninterface ColumnVm {\n key: string;\n label: string;\n cards: CardVm[];\n}\n\n@Component({\n standalone: false,\n selector: 'x-order-board',\n templateUrl: './order-board.component.html',\n styleUrl: './order-board.component.scss',\n})\nexport class OrderBoardComponent extends BaseDirective {\n readonly columns$ = new BehaviorSubject<ColumnVm[] | null>(null);\n\n override init = () => {\n this.apiService\n .on('apps/commerce/order')\n .getMany({ page: 1, perPage: 400 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using(({ data }: { data: any[] }) => {\n const byQueue = new Map<string, CardVm[]>();\n const now = Date.now();\n for (const order of data ?? []) {\n const queue = QUEUES.find((q) => q.statuses.includes(order.status));\n if (!queue) continue;\n const placed = order.placedAt ?? order.createdAt;\n const ageHours = placed\n ? Math.max(0, (now - new Date(placed).getTime()) / 3_600_000)\n : 0;\n const card: CardVm = {\n id: order.id,\n orderNumber: order.orderNumber,\n totalLabel: naira(Number(order.grandTotal ?? 0), order.currency),\n ageHours,\n ageLabel: this.ageLabel(ageHours),\n status: order.status,\n };\n const list = byQueue.get(queue.key) ?? [];\n list.push(card);\n byQueue.set(queue.key, list);\n }\n this.columns$.next(\n QUEUES.map((q) => ({\n key: q.key,\n label: q.label,\n cards: (byQueue.get(q.key) ?? []).sort((a, b) => b.ageHours - a.ageHours),\n })),\n );\n }),\n );\n };\n\n private ageLabel(hours: number): string {\n if (hours < 1) return 'just now';\n if (hours < 24) return `${Math.floor(hours)}h`;\n return `${Math.floor(hours / 24)}d`;\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">Order board</div>\n <div class=\"x-page-subtitle\">Every open order by ops queue (ORD-12). Cards are oldest-first.</div>\n</div>\n\n@if (columns$ | async; as columns) {\n <div class=\"x-board\">\n @for (col of columns; track col.key) {\n <div class=\"x-board-col\">\n <div class=\"x-board-col-head\">\n <span>{{ col.label }}</span>\n <span class=\"x-board-col-count\">{{ col.cards.length }}</span>\n </div>\n <div class=\"x-board-col-body\">\n @for (card of col.cards; track card.id) {\n <a class=\"x-order-card\" [routerLink]=\"['../orders']\" [queryParams]=\"{ q: card.orderNumber }\">\n <div class=\"x-order-card-row\">\n <span class=\"x-order-card-num\">{{ card.orderNumber }}</span>\n <span class=\"x-order-card-age\" [class.stale]=\"card.ageHours >= 48\">{{ card.ageLabel }}</span>\n </div>\n <div class=\"x-order-card-total\">{{ card.totalLabel }}</div>\n </a>\n } @empty {\n <div class=\"x-board-col-empty\">None</div>\n }\n </div>\n </div>\n }\n </div>\n} @else {\n <x-element-loader></x-element-loader>\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { OrderBoardComponent } from './order-board.component';\n\n@NgModule({\n declarations: [OrderBoardComponent],\n imports: [\n SharedModule,\n ElementsModule,\n RouterModule.forChild([{ path: '', component: OrderBoardComponent }]),\n ],\n})\nexport class OrderBoardModule {}\n"],"names":["i2","i3"],"mappings":";;;;;;;;;;AAIA;AACA;AACA;AACA,MAAM,MAAM,GAAyD;AACnE,IAAA,EAAE,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE;AAChG,IAAA,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,kBAAkB,EAAE,WAAW,CAAC,EAAE;AACtF,IAAA,EA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AA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;AACd,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC;AACtE,qBAAA;AACF,iBAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-order-board.module-CmLNiEEP.mjs","sources":["../../../projects/admin/src/lib/pages/order-board/order-board.component.ts","../../../projects/admin/src/lib/pages/order-board/order-board.component.html","../../../projects/admin/src/lib/pages/order-board/order-board.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { BaseDirective, using } from '@thescaffold/ngx-core';\nimport { BehaviorSubject, takeUntil } from 'rxjs';\n\n// ORD-12 — the ops work queues. Each column is a stage of the order\n// lifecycle a team acts on; cards carry an age so a stale one stands out\n// (a crude SLA cue until per-queue SLA timers + assignment land in P7).\nconst QUEUES: { key: string; label: string; statuses: string[] }[] = [\n { key: 'awaiting_payment', label: 'Awaiting payment', statuses: ['pending_payment', 'on_hold'] },\n { key: 'new', label: 'New — to confirm', statuses: ['payment_received', 'confirmed'] },\n { key: 'processing', label: 'Being prepared', statuses: ['processing', 'partially_fulfilled'] },\n {\n key: 'ready',\n label: 'Ready to ship / pick',\n statuses: ['ready_to_ship', 'ready_for_pickup'],\n },\n {\n key: 'in_transit',\n label: 'In transit',\n statuses: ['dispatched', 'out_for_delivery'],\n },\n { key: 'exceptions', label: 'Delivery exceptions', statuses: ['failed_delivery'] },\n {\n key: 'returns',\n label: 'Returns in flight',\n statuses: ['return_in_flight', 'returned'],\n },\n { key: 'done', label: 'Delivered / done', statuses: ['delivered', 'completed'] },\n];\n\nfunction naira(amount: number, currency = 'NGN'): string {\n return `${currency} ${Math.round(amount).toLocaleString('en-US')}`;\n}\n\ninterface CardVm {\n id: string;\n orderNumber: string;\n totalLabel: string;\n ageLabel: string;\n ageHours: number;\n status: string;\n}\n\ninterface ColumnVm {\n key: string;\n label: string;\n cards: CardVm[];\n}\n\n@Component({\n standalone: false,\n selector: 'x-order-board',\n templateUrl: './order-board.component.html',\n styleUrl: './order-board.component.scss',\n})\nexport class OrderBoardComponent extends BaseDirective {\n readonly columns$ = new BehaviorSubject<ColumnVm[] | null>(null);\n\n override init = () => {\n this.apiService\n .on('apps/commerce/order')\n .getMany({ page: 1, perPage: 400 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using(({ data }: { data: any[] }) => {\n const byQueue = new Map<string, CardVm[]>();\n const now = Date.now();\n for (const order of data ?? []) {\n const queue = QUEUES.find((q) => q.statuses.includes(order.status));\n if (!queue) continue;\n const placed = order.placedAt ?? order.createdAt;\n const ageHours = placed\n ? Math.max(0, (now - new Date(placed).getTime()) / 3_600_000)\n : 0;\n const card: CardVm = {\n id: order.id,\n orderNumber: order.orderNumber,\n totalLabel: naira(Number(order.grandTotal ?? 0), order.currency),\n ageHours,\n ageLabel: this.ageLabel(ageHours),\n status: order.status,\n };\n const list = byQueue.get(queue.key) ?? [];\n list.push(card);\n byQueue.set(queue.key, list);\n }\n this.columns$.next(\n QUEUES.map((q) => ({\n key: q.key,\n label: q.label,\n cards: (byQueue.get(q.key) ?? []).sort((a, b) => b.ageHours - a.ageHours),\n })),\n );\n }),\n );\n };\n\n private ageLabel(hours: number): string {\n if (hours < 1) return 'just now';\n if (hours < 24) return `${Math.floor(hours)}h`;\n return `${Math.floor(hours / 24)}d`;\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">Order board</div>\n <div class=\"x-page-subtitle\">Every open order by ops queue (ORD-12). Cards are oldest-first.</div>\n</div>\n\n@if (columns$ | async; as columns) {\n <div class=\"x-board\">\n @for (col of columns; track col.key) {\n <div class=\"x-board-col\">\n <div class=\"x-board-col-head\">\n <span>{{ col.label }}</span>\n <span class=\"x-board-col-count\">{{ col.cards.length }}</span>\n </div>\n <div class=\"x-board-col-body\">\n @for (card of col.cards; track card.id) {\n <a class=\"x-order-card\" [routerLink]=\"['../orders']\" [queryParams]=\"{ q: card.orderNumber }\">\n <div class=\"x-order-card-row\">\n <span class=\"x-order-card-num\">{{ card.orderNumber }}</span>\n <span class=\"x-order-card-age\" [class.stale]=\"card.ageHours >= 48\">{{ card.ageLabel }}</span>\n </div>\n <div class=\"x-order-card-total\">{{ card.totalLabel }}</div>\n </a>\n } @empty {\n <div class=\"x-board-col-empty\">None</div>\n }\n </div>\n </div>\n }\n </div>\n} @else {\n <x-element-loader></x-element-loader>\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { OrderBoardComponent } from './order-board.component';\n\n@NgModule({\n declarations: [OrderBoardComponent],\n imports: [\n SharedModule,\n ElementsModule,\n RouterModule.forChild([{ path: '', component: OrderBoardComponent }]),\n ],\n})\nexport class OrderBoardModule {}\n"],"names":[],"mappings":";;;;;;;;;;AAIA;AACA;AACA;AACA,MAAM,MAAM,GAAyD;AACnE,IAAA,EAAE,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE;AAChG,IAAA,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,kBAAkB,EAAE,WAAW,CAAC,EAAE;AACtF,IAAA,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC,EAAE;AAC/F,IAAA;AACE,QAAA,GAAG,EAAE,OAAO;AACZ,QAAA,KAAK,EAAE,sBAAsB;AAC7B,QAAA,QAAQ,EAAE,CAAC,eAAe,EAAE,kBAAkB,CAAC;AAChD,KAAA;AACD,IAAA;AACE,Q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+1,190 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, TemplateRef, ViewChild, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/router';
|
|
4
|
+
import { ActivatedRoute, RouterModule } from '@angular/router';
|
|
5
|
+
import { using, notify, SharedModule } from '@thescaffold/ngx-core';
|
|
6
|
+
import * as i2 from '@thescaffold/ngx-ui';
|
|
7
|
+
import { FlyoutService, ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
|
|
8
|
+
import { downloadBlob } from '@isaiahiroko/tilmart-ngx-ui';
|
|
9
|
+
import { takeUntil } from 'rxjs';
|
|
10
|
+
import { L as ListPageDirective } from './isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs';
|
|
11
|
+
import * as i3 from '@angular/common';
|
|
12
|
+
|
|
13
|
+
function naira(amount, currency = 'NGN') {
|
|
14
|
+
return `${currency} ${Math.round(amount).toLocaleString('en-US')}`;
|
|
15
|
+
}
|
|
16
|
+
// Ops action buttons per current status — each entry is a permitted
|
|
17
|
+
// `OrderWorkflow.transition` target. Matches the PRD Appendix B matrix;
|
|
18
|
+
// fulfilment-driven statuses (dispatched, delivered, …) are set by the
|
|
19
|
+
// Shipments page, not here.
|
|
20
|
+
const ACTIONS = {
|
|
21
|
+
payment_received: [{ to: 'confirmed', label: 'Confirm' }, { to: 'on_hold', label: 'Hold' }],
|
|
22
|
+
on_hold: [{ to: 'confirmed', label: 'Release' }, { to: 'cancelled', label: 'Cancel' }],
|
|
23
|
+
confirmed: [{ to: 'processing', label: 'Start preparing' }, { to: 'cancelled', label: 'Cancel' }],
|
|
24
|
+
processing: [{ to: 'cancelled', label: 'Cancel' }],
|
|
25
|
+
pending_payment: [{ to: 'cancelled', label: 'Cancel' }],
|
|
26
|
+
};
|
|
27
|
+
class OrdersComponent extends ListPageDirective {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.flyoutService = inject(FlyoutService);
|
|
31
|
+
this.route = inject(ActivatedRoute);
|
|
32
|
+
this.pluralName = 'orders';
|
|
33
|
+
this.dataSource = this.apiService.on('apps/commerce/order');
|
|
34
|
+
this.lineSource = this.apiService.on('apps/commerce/order-line');
|
|
35
|
+
this.historySource = this.apiService.on('apps/commerce/order-status-history');
|
|
36
|
+
this.paymentSource = this.apiService.on('apps/commerce/payment');
|
|
37
|
+
this.shipmentSource = this.apiService.on('apps/commerce/shipment');
|
|
38
|
+
this.columns = [
|
|
39
|
+
{ key: 'orderNumber', value: 'Order' },
|
|
40
|
+
{ key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },
|
|
41
|
+
{ key: 'grandTotalLabel', value: 'Total' },
|
|
42
|
+
{ key: 'paidLabel', value: 'Paid' },
|
|
43
|
+
{ key: 'placedAt', value: 'Placed', type: 'date' },
|
|
44
|
+
];
|
|
45
|
+
this.detail = null;
|
|
46
|
+
this.detailActions = [];
|
|
47
|
+
this.naira = naira;
|
|
48
|
+
this.init = () => {
|
|
49
|
+
this.query = this.route.snapshot.queryParamMap.get('q') ?? '';
|
|
50
|
+
this.list();
|
|
51
|
+
};
|
|
52
|
+
// ORD-11 — the order's VAT invoice as a PDF. Fetched as a Blob (auth
|
|
53
|
+
// header, not a cookie) and saved under the invoice's document number.
|
|
54
|
+
this.downloadingInvoice = false;
|
|
55
|
+
}
|
|
56
|
+
view(item) {
|
|
57
|
+
this.detail = null;
|
|
58
|
+
this.detailActions = ACTIONS[item.status] ?? [];
|
|
59
|
+
this.flyoutService.open(this.detailFlyout);
|
|
60
|
+
this.lineSource
|
|
61
|
+
.getMany({ orderId: item.id, page: 1, perPage: 200 })
|
|
62
|
+
.pipe(takeUntil(this.$))
|
|
63
|
+
.subscribe(using(({ data: lines }) => {
|
|
64
|
+
this.detail = {
|
|
65
|
+
id: item.id,
|
|
66
|
+
orderNumber: item.orderNumber,
|
|
67
|
+
status: item.status,
|
|
68
|
+
currency: item.currency,
|
|
69
|
+
businessName: item.businessName,
|
|
70
|
+
recipientName: item.recipientName,
|
|
71
|
+
recipientPhone: item.recipientPhone,
|
|
72
|
+
subtotal: Number(item.subtotal ?? 0),
|
|
73
|
+
deliveryTotal: Number(item.deliveryTotal ?? 0),
|
|
74
|
+
taxTotal: Number(item.taxTotal ?? 0),
|
|
75
|
+
grandTotal: Number(item.grandTotal ?? 0),
|
|
76
|
+
amountPaid: Number(item.amountPaid ?? 0),
|
|
77
|
+
codAmountDue: Number(item.codAmountDue ?? 0),
|
|
78
|
+
lines: lines ?? [],
|
|
79
|
+
history: [],
|
|
80
|
+
payments: [],
|
|
81
|
+
shipments: [],
|
|
82
|
+
};
|
|
83
|
+
this.historySource
|
|
84
|
+
.getMany({ orderId: item.id, page: 1, perPage: 100 })
|
|
85
|
+
.pipe(takeUntil(this.$))
|
|
86
|
+
.subscribe(using(({ data }) => {
|
|
87
|
+
if (this.detail)
|
|
88
|
+
this.detail.history = data ?? [];
|
|
89
|
+
}));
|
|
90
|
+
this.paymentSource
|
|
91
|
+
.getMany({ orderId: item.id, page: 1, perPage: 20 })
|
|
92
|
+
.pipe(takeUntil(this.$))
|
|
93
|
+
.subscribe(using(({ data }) => {
|
|
94
|
+
if (this.detail)
|
|
95
|
+
this.detail.payments = data ?? [];
|
|
96
|
+
}));
|
|
97
|
+
this.shipmentSource
|
|
98
|
+
.getMany({ orderId: item.id, page: 1, perPage: 50 })
|
|
99
|
+
.pipe(takeUntil(this.$))
|
|
100
|
+
.subscribe(using(({ data }) => {
|
|
101
|
+
if (this.detail)
|
|
102
|
+
this.detail.shipments = data ?? [];
|
|
103
|
+
}));
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
downloadInvoice() {
|
|
107
|
+
if (!this.detail || this.downloadingInvoice)
|
|
108
|
+
return;
|
|
109
|
+
const { id, orderNumber } = this.detail;
|
|
110
|
+
this.downloadingInvoice = true;
|
|
111
|
+
this.apiService.requestService
|
|
112
|
+
.raw('get', `apps/commerce/document/order/${id}/invoice`, { format: 'pdf' }, { responseType: 'blob' })
|
|
113
|
+
.pipe(takeUntil(this.$))
|
|
114
|
+
.subscribe({
|
|
115
|
+
next: (blob) => {
|
|
116
|
+
this.downloadingInvoice = false;
|
|
117
|
+
downloadBlob(blob, `INV-${orderNumber}.pdf`);
|
|
118
|
+
},
|
|
119
|
+
error: () => {
|
|
120
|
+
this.downloadingInvoice = false;
|
|
121
|
+
notify('Could not generate the invoice PDF.', undefined, 'error');
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
transition(to) {
|
|
126
|
+
if (!this.detail)
|
|
127
|
+
return;
|
|
128
|
+
this.apiService
|
|
129
|
+
.post(`apps/commerce/order/${this.detail.id}/transition`, { toStatus: to })
|
|
130
|
+
.pipe(takeUntil(this.$))
|
|
131
|
+
.subscribe(using((res) => {
|
|
132
|
+
if (res?.status === 'error') {
|
|
133
|
+
notify(res.message || 'That transition is not allowed.', undefined, 'error');
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
notify(`Order moved to ${to.replace(/_/g, ' ')}.`, undefined, 'success');
|
|
137
|
+
this.flyoutService.dismiss();
|
|
138
|
+
this.list();
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
mapRow(order) {
|
|
142
|
+
return {
|
|
143
|
+
...order,
|
|
144
|
+
grandTotalLabel: naira(Number(order.grandTotal ?? 0), order.currency),
|
|
145
|
+
paidLabel: naira(Number(order.amountPaid ?? 0), order.currency),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
extraCollectionFields() {
|
|
149
|
+
return {
|
|
150
|
+
links: {
|
|
151
|
+
secondary: [{ title: 'View', fn: (_link, item) => this.view(item) }],
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
156
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: OrdersComponent, isStandalone: false, selector: "x-orders", viewQueries: [{ propertyName: "detailFlyout", first: true, predicate: ["detailFlyout"], descendants: true, read: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Orders</div>\n <div class=\"x-page-subtitle\">Every order \u2014 search, drill in, move it forward.</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<ng-template #detailFlyout>\n <x-webget-flyout [data]=\"{ title: 'Order detail' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div>\n <div class=\"fw-bold font-monospace\">\n {{ detail.orderNumber }}\n <a\n class=\"small ms-2\"\n [routerLink]=\"['/admin/trace']\"\n [queryParams]=\"{ ref: detail.orderNumber }\"\n >full trace \u2192</a>\n </div>\n <span class=\"badge text-bg-light border mt-1\">{{ detail.status }}</span>\n @if (detail.businessName) {\n <div class=\"text-secondary small mt-1\">Invoice to: {{ detail.businessName }}</div>\n }\n @if (detail.recipientName) {\n <div class=\"text-secondary small\">Recipient: {{ detail.recipientName }} \u00B7 {{ detail.recipientPhone }}</div>\n }\n </div>\n\n <div class=\"d-flex flex-wrap gap-2\">\n <button\n type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n [disabled]=\"downloadingInvoice\"\n (click)=\"downloadInvoice()\"\n >\n {{ downloadingInvoice ? 'Preparing\u2026' : 'Download invoice (PDF)' }}\n </button>\n </div>\n\n @if (detailActions.length) {\n <div class=\"d-flex flex-wrap gap-2\">\n @for (action of detailActions; track action.to) {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" (click)=\"transition(action.to)\">\n {{ action.label }}\n </button>\n }\n </div>\n }\n\n <table class=\"table table-sm\">\n <thead><tr><th>Item</th><th>Qty</th><th class=\"text-end\">Amount</th></tr></thead>\n <tbody>\n @for (line of detail.lines; track line.id) {\n <tr>\n <td>{{ line.nameSnapshot || line.variantId }}</td>\n <td>{{ line.quantity }}</td>\n <td class=\"text-end\">{{ naira(line.unitPrice * line.quantity, detail.currency) }}</td>\n </tr>\n } @empty {\n <tr><td colspan=\"3\" class=\"text-secondary\">No lines.</td></tr>\n }\n </tbody>\n </table>\n\n <div class=\"small\">\n <div class=\"d-flex justify-content-between\"><span>Subtotal</span><span>{{ naira(detail.subtotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>Delivery</span><span>{{ naira(detail.deliveryTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>VAT (incl.)</span><span>{{ naira(detail.taxTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between fw-bold\"><span>Total</span><span>{{ naira(detail.grandTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>Paid</span><span>{{ naira(detail.amountPaid, detail.currency) }}</span></div>\n @if (detail.codAmountDue > 0) {\n <div class=\"d-flex justify-content-between text-warning\"><span>Due on delivery</span><span>{{ naira(detail.codAmountDue, detail.currency) }}</span></div>\n }\n </div>\n\n <hr class=\"my-1\" />\n <div>\n <div class=\"fw-bold small mb-1\">Payments</div>\n @for (payment of detail.payments; track payment.id) {\n <div class=\"small text-secondary\">\n {{ payment.provider }} \u00B7 {{ payment.method || 'card' }} \u00B7 {{ payment.status }}\n \u00B7 {{ naira(payment.amount, payment.currency) }}\n </div>\n } @empty {\n <div class=\"small text-secondary\">None.</div>\n }\n </div>\n\n <div>\n <div class=\"fw-bold small mb-1\">Shipments</div>\n @for (shipment of detail.shipments; track shipment.id) {\n <div class=\"small text-secondary\">\n {{ shipment.status }}@if (shipment.trackingRef) { \u00B7 {{ shipment.trackingRef }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">None yet \u2014 create one on the Shipments page.</div>\n }\n </div>\n\n <div>\n <div class=\"fw-bold small mb-1\">History</div>\n @for (row of detail.history; track row.id) {\n <div class=\"small text-secondary\">\n {{ row.toStatus }} \u00B7 {{ row.createdAt | date: 'MMM d, h:mm a' }}\n @if (row.reason) { \u2014 {{ row.reason }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">No transitions recorded.</div>\n }\n </div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n </div>\n </x-webget-flyout>\n</ng-template>\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}\n"], dependencies: [{ kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { 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: "component", type: i2.FlyoutComponent, selector: "x-webget-flyout", inputs: ["data"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.DatePipe, name: "date" }] }); }
|
|
157
|
+
}
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersComponent, decorators: [{
|
|
159
|
+
type: Component,
|
|
160
|
+
args: [{ standalone: false, selector: 'x-orders', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Orders</div>\n <div class=\"x-page-subtitle\">Every order \u2014 search, drill in, move it forward.</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<ng-template #detailFlyout>\n <x-webget-flyout [data]=\"{ title: 'Order detail' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div>\n <div class=\"fw-bold font-monospace\">\n {{ detail.orderNumber }}\n <a\n class=\"small ms-2\"\n [routerLink]=\"['/admin/trace']\"\n [queryParams]=\"{ ref: detail.orderNumber }\"\n >full trace \u2192</a>\n </div>\n <span class=\"badge text-bg-light border mt-1\">{{ detail.status }}</span>\n @if (detail.businessName) {\n <div class=\"text-secondary small mt-1\">Invoice to: {{ detail.businessName }}</div>\n }\n @if (detail.recipientName) {\n <div class=\"text-secondary small\">Recipient: {{ detail.recipientName }} \u00B7 {{ detail.recipientPhone }}</div>\n }\n </div>\n\n <div class=\"d-flex flex-wrap gap-2\">\n <button\n type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n [disabled]=\"downloadingInvoice\"\n (click)=\"downloadInvoice()\"\n >\n {{ downloadingInvoice ? 'Preparing\u2026' : 'Download invoice (PDF)' }}\n </button>\n </div>\n\n @if (detailActions.length) {\n <div class=\"d-flex flex-wrap gap-2\">\n @for (action of detailActions; track action.to) {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" (click)=\"transition(action.to)\">\n {{ action.label }}\n </button>\n }\n </div>\n }\n\n <table class=\"table table-sm\">\n <thead><tr><th>Item</th><th>Qty</th><th class=\"text-end\">Amount</th></tr></thead>\n <tbody>\n @for (line of detail.lines; track line.id) {\n <tr>\n <td>{{ line.nameSnapshot || line.variantId }}</td>\n <td>{{ line.quantity }}</td>\n <td class=\"text-end\">{{ naira(line.unitPrice * line.quantity, detail.currency) }}</td>\n </tr>\n } @empty {\n <tr><td colspan=\"3\" class=\"text-secondary\">No lines.</td></tr>\n }\n </tbody>\n </table>\n\n <div class=\"small\">\n <div class=\"d-flex justify-content-between\"><span>Subtotal</span><span>{{ naira(detail.subtotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>Delivery</span><span>{{ naira(detail.deliveryTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>VAT (incl.)</span><span>{{ naira(detail.taxTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between fw-bold\"><span>Total</span><span>{{ naira(detail.grandTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>Paid</span><span>{{ naira(detail.amountPaid, detail.currency) }}</span></div>\n @if (detail.codAmountDue > 0) {\n <div class=\"d-flex justify-content-between text-warning\"><span>Due on delivery</span><span>{{ naira(detail.codAmountDue, detail.currency) }}</span></div>\n }\n </div>\n\n <hr class=\"my-1\" />\n <div>\n <div class=\"fw-bold small mb-1\">Payments</div>\n @for (payment of detail.payments; track payment.id) {\n <div class=\"small text-secondary\">\n {{ payment.provider }} \u00B7 {{ payment.method || 'card' }} \u00B7 {{ payment.status }}\n \u00B7 {{ naira(payment.amount, payment.currency) }}\n </div>\n } @empty {\n <div class=\"small text-secondary\">None.</div>\n }\n </div>\n\n <div>\n <div class=\"fw-bold small mb-1\">Shipments</div>\n @for (shipment of detail.shipments; track shipment.id) {\n <div class=\"small text-secondary\">\n {{ shipment.status }}@if (shipment.trackingRef) { \u00B7 {{ shipment.trackingRef }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">None yet \u2014 create one on the Shipments page.</div>\n }\n </div>\n\n <div>\n <div class=\"fw-bold small mb-1\">History</div>\n @for (row of detail.history; track row.id) {\n <div class=\"small text-secondary\">\n {{ row.toStatus }} \u00B7 {{ row.createdAt | date: 'MMM d, h:mm a' }}\n @if (row.reason) { \u2014 {{ row.reason }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">No transitions recorded.</div>\n }\n </div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n </div>\n </x-webget-flyout>\n</ng-template>\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}\n"] }]
|
|
161
|
+
}], propDecorators: { detailFlyout: [{
|
|
162
|
+
type: ViewChild,
|
|
163
|
+
args: ['detailFlyout', { read: TemplateRef, static: true }]
|
|
164
|
+
}] } });
|
|
165
|
+
|
|
166
|
+
class OrdersModule {
|
|
167
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
168
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, declarations: [OrdersComponent], imports: [SharedModule,
|
|
169
|
+
ElementsModule,
|
|
170
|
+
WebgetsModule, i1.RouterModule] }); }
|
|
171
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, imports: [SharedModule,
|
|
172
|
+
ElementsModule,
|
|
173
|
+
WebgetsModule,
|
|
174
|
+
RouterModule.forChild([{ path: '', component: OrdersComponent }])] }); }
|
|
175
|
+
}
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, decorators: [{
|
|
177
|
+
type: NgModule,
|
|
178
|
+
args: [{
|
|
179
|
+
declarations: [OrdersComponent],
|
|
180
|
+
imports: [
|
|
181
|
+
SharedModule,
|
|
182
|
+
ElementsModule,
|
|
183
|
+
WebgetsModule,
|
|
184
|
+
RouterModule.forChild([{ path: '', component: OrdersComponent }]),
|
|
185
|
+
],
|
|
186
|
+
}]
|
|
187
|
+
}] });
|
|
188
|
+
|
|
189
|
+
export { OrdersModule };
|
|
190
|
+
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-orders.module-vldWwcAr.mjs.map
|