@africanies/angular-web-sdk 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/README.md +68 -0
- package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
- package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
- package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +5 -0
- package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/assets/carriers/dhl.svg +7 -0
- package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +20013 -0
- package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
- package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/package.json +35 -0
- package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +5617 -0
- package/.nx/cache/run.json +16 -16
- package/.nx/cache/terminalOutputs/14892813664845064572 +21 -0
- package/.nx/cache/terminalOutputs/17909810599991457481 +40 -0
- package/.nx/cache/terminalOutputs/2927637324428060203 +42 -0
- package/.nx/cache/terminalOutputs/4787481949164239892 +8 -0
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
- package/.nx/workspace-data/d/daemon.log +2377 -0
- package/.nx/workspace-data/d/server-process.json +2 -2
- package/.nx/workspace-data/file-map.json +3465 -3469
- package/.nx/workspace-data/nx_files.nxt +0 -0
- package/.nx/workspace-data/project-graph.json +2 -2
- package/README.md +0 -17
- package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +149 -134
- package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
- package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +14 -13
- package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.spec.ts +15 -0
- package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts +6 -3
- package/libs/africanies-ui/src/lib/table/table.component.ts +70 -65
- package/package.json +1 -1
|
@@ -59,4 +59,19 @@ describe('ShippingModeSwitchComponent', () => {
|
|
|
59
59
|
expect(shipping.mode()).toBe('stn');
|
|
60
60
|
expect(toNigeria.getAttribute('aria-checked')).toBe('true');
|
|
61
61
|
});
|
|
62
|
+
|
|
63
|
+
it('should show the STN/SFN chip only when the mode panel is collapsed', () => {
|
|
64
|
+
fixture.componentRef.setInput('panelOpen', true);
|
|
65
|
+
fixture.detectChanges();
|
|
66
|
+
expect(fixture.nativeElement.textContent).not.toContain('SFN');
|
|
67
|
+
|
|
68
|
+
fixture.componentRef.setInput('panelOpen', false);
|
|
69
|
+
fixture.detectChanges();
|
|
70
|
+
expect(fixture.nativeElement.textContent).toContain('SFN');
|
|
71
|
+
|
|
72
|
+
shipping.setMode('stn');
|
|
73
|
+
fixture.detectChanges();
|
|
74
|
+
expect(fixture.nativeElement.textContent).toContain('STN');
|
|
75
|
+
expect(fixture.nativeElement.textContent).not.toContain('SFN');
|
|
76
|
+
});
|
|
62
77
|
});
|
package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts
CHANGED
|
@@ -128,9 +128,12 @@ const SHIPPING_MODE_GLYPH = `M88.42,68.75a48.8,48.8,0,0,1-4.74,11.1h9.89a7.67,7.
|
|
|
128
128
|
>
|
|
129
129
|
Shipping mode
|
|
130
130
|
</p>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
<!-- STN / SFN chip only when the tiles are collapsed — open panel already shows both modes. -->
|
|
132
|
+
@if (!panelOpen()) {
|
|
133
|
+
<africanies-chip [variant]="modeChipVariant()" size="sm">
|
|
134
|
+
{{ modeChipLabel() }}
|
|
135
|
+
</africanies-chip>
|
|
136
|
+
}
|
|
134
137
|
<span class="min-w-0 flex-1" aria-hidden="true"></span>
|
|
135
138
|
<button
|
|
136
139
|
type="button"
|
|
@@ -45,8 +45,9 @@ import { TableColumn, TableSortChange } from './table-column';
|
|
|
45
45
|
* `<ng-template africaniesCellDef="key">` templates. Columns without a matching
|
|
46
46
|
* template fall back to rendering `row[key]` as plain text.
|
|
47
47
|
*
|
|
48
|
-
* Optional toolbar: top-left **shipping mode** segment
|
|
49
|
-
* `[showShippingMode]="false"` to
|
|
48
|
+
* Optional toolbar: top-left **shipping mode** segment on its own row above
|
|
49
|
+
* Refresh / Filter / Export (on by default; `[showShippingMode]="false"` to
|
|
50
|
+
* hide) and **Refresh** (`showRefresh` →
|
|
50
51
|
* {@link refreshClick}). Refresh is hidden while
|
|
51
52
|
* the body shows empty or error — those states expose Retry instead.
|
|
52
53
|
* While {@link refreshing} is true the rows stay on screen — the refresh icon
|
|
@@ -177,71 +178,75 @@ import { TableColumn, TableSortChange } from './table-column';
|
|
|
177
178
|
showFilter() ||
|
|
178
179
|
showExport()
|
|
179
180
|
) {
|
|
180
|
-
<div class="flex
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
<
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
name="refresh"
|
|
203
|
-
[size]="16"
|
|
204
|
-
[class]="refreshing() ? 'animate-spin' : ''"
|
|
205
|
-
/>
|
|
206
|
-
{{ refreshLabel() }}
|
|
207
|
-
</button>
|
|
208
|
-
}
|
|
209
|
-
</div>
|
|
210
|
-
<div class="flex items-center gap-2">
|
|
211
|
-
@if (showFilter()) {
|
|
212
|
-
<button
|
|
213
|
-
africanies-button
|
|
214
|
-
type="button"
|
|
215
|
-
variant="flat"
|
|
216
|
-
size="sm"
|
|
217
|
-
[attr.aria-label]="filterLabel()"
|
|
218
|
-
(click)="filterClick.emit()"
|
|
219
|
-
>
|
|
220
|
-
<africanies-icon name="filter" [size]="16" />
|
|
221
|
-
{{ filterLabel() }}
|
|
222
|
-
@if (filterCount() > 0) {
|
|
223
|
-
<span
|
|
224
|
-
class="inline-flex min-w-5 items-center justify-center rounded-full bg-ink px-1.5 py-0.5 text-caption font-semibold tabular-nums text-white dark:bg-white dark:text-ink"
|
|
181
|
+
<div class="flex w-full min-w-0 flex-col gap-3">
|
|
182
|
+
@if (showShippingMode()) {
|
|
183
|
+
<africanies-segment
|
|
184
|
+
class="min-w-0 self-start"
|
|
185
|
+
[items]="shippingModeItems"
|
|
186
|
+
[activeId]="shippingModeActiveId()"
|
|
187
|
+
ariaLabel="Shipping mode"
|
|
188
|
+
(activeIdChange)="onShippingModeChange($event)"
|
|
189
|
+
/>
|
|
190
|
+
}
|
|
191
|
+
@if (showToolbarRefresh() || showFilter() || showExport()) {
|
|
192
|
+
<div class="flex flex-wrap items-center justify-between gap-2">
|
|
193
|
+
<div class="flex min-w-0 flex-wrap items-center gap-2">
|
|
194
|
+
@if (showToolbarRefresh()) {
|
|
195
|
+
<button
|
|
196
|
+
africanies-button
|
|
197
|
+
type="button"
|
|
198
|
+
variant="flat"
|
|
199
|
+
size="sm"
|
|
200
|
+
[disabled]="loading() || refreshing()"
|
|
201
|
+
[attr.aria-label]="refreshLabel()"
|
|
202
|
+
(click)="refreshClick.emit()"
|
|
225
203
|
>
|
|
226
|
-
|
|
227
|
-
|
|
204
|
+
<africanies-icon
|
|
205
|
+
name="refresh"
|
|
206
|
+
[size]="16"
|
|
207
|
+
[class]="refreshing() ? 'animate-spin' : ''"
|
|
208
|
+
/>
|
|
209
|
+
{{ refreshLabel() }}
|
|
210
|
+
</button>
|
|
228
211
|
}
|
|
229
|
-
</
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
212
|
+
</div>
|
|
213
|
+
<div class="flex items-center gap-2">
|
|
214
|
+
@if (showFilter()) {
|
|
215
|
+
<button
|
|
216
|
+
africanies-button
|
|
217
|
+
type="button"
|
|
218
|
+
variant="flat"
|
|
219
|
+
size="sm"
|
|
220
|
+
[attr.aria-label]="filterLabel()"
|
|
221
|
+
(click)="filterClick.emit()"
|
|
222
|
+
>
|
|
223
|
+
<africanies-icon name="filter" [size]="16" />
|
|
224
|
+
{{ filterLabel() }}
|
|
225
|
+
@if (filterCount() > 0) {
|
|
226
|
+
<span
|
|
227
|
+
class="inline-flex min-w-5 items-center justify-center rounded-full bg-ink px-1.5 py-0.5 text-caption font-semibold tabular-nums text-white dark:bg-white dark:text-ink"
|
|
228
|
+
>
|
|
229
|
+
{{ filterCount() }}
|
|
230
|
+
</span>
|
|
231
|
+
}
|
|
232
|
+
</button>
|
|
233
|
+
}
|
|
234
|
+
@if (showExport()) {
|
|
235
|
+
<button
|
|
236
|
+
africanies-button
|
|
237
|
+
type="button"
|
|
238
|
+
variant="flat"
|
|
239
|
+
size="sm"
|
|
240
|
+
[attr.aria-label]="exportLabel()"
|
|
241
|
+
(click)="exportClick.emit()"
|
|
242
|
+
>
|
|
243
|
+
<africanies-icon name="download" [size]="16" />
|
|
244
|
+
{{ exportLabel() }}
|
|
245
|
+
</button>
|
|
246
|
+
}
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
}
|
|
245
250
|
</div>
|
|
246
251
|
}
|
|
247
252
|
|