@happyvertical/smrt-manufacturing 0.54.2 → 0.54.4
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/AGENTS.md +1 -1
- package/README.md +12 -2
- package/dist/index.js +57 -1
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +3 -2
- package/dist/smrt-knowledge.json +7 -6
- package/dist/svelte/components/AssemblyForm.svelte +93 -12
- package/dist/svelte/components/AssemblyForm.svelte.d.ts +14 -3
- package/dist/svelte/components/AssemblyForm.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ProductionRunList.svelte +197 -1
- package/dist/svelte/components/ProductionRunList.svelte.d.ts +15 -0
- package/dist/svelte/components/ProductionRunList.svelte.d.ts.map +1 -1
- package/dist/svelte/i18n.d.ts +23 -0
- package/dist/svelte/i18n.d.ts.map +1 -1
- package/dist/svelte/i18n.js +23 -0
- package/dist/svelte/index.d.ts +1 -1
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +1 -1
- package/dist/svelte/types.d.ts +40 -87
- package/dist/svelte/types.d.ts.map +1 -1
- package/dist/svelte/types.js +29 -85
- package/dist/views.d.ts +95 -0
- package/dist/views.d.ts.map +1 -0
- package/dist/views.js +72 -0
- package/dist/views.js.map +1 -0
- package/package.json +14 -10
|
@@ -6,9 +6,16 @@
|
|
|
6
6
|
* `ProductionRunService`, adapts them with `toProductionRunView`, and records
|
|
7
7
|
* the completion it is handed (the service checks the quantity again under
|
|
8
8
|
* its lock).
|
|
9
|
+
*
|
|
10
|
+
* `onsettarget`, `onfinish` and `oncancel` add a management column to open
|
|
11
|
+
* runs, each control rendered only when its handler is given: a target field,
|
|
12
|
+
* and Finish and Cancel run buttons that ask for confirmation first. The host
|
|
13
|
+
* calls `ProductionRunService.setTarget`, `finish` and `cancel` and refreshes
|
|
14
|
+
* the runs.
|
|
9
15
|
*/
|
|
10
16
|
|
|
11
17
|
import { Button, ProgressBar, StatusBadge } from '@happyvertical/smrt-ui';
|
|
18
|
+
import { ConfirmDialog } from '@happyvertical/smrt-ui/feedback';
|
|
12
19
|
import { Form, Input } from '@happyvertical/smrt-ui/forms';
|
|
13
20
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
14
21
|
import { M } from '../i18n.js';
|
|
@@ -18,6 +25,7 @@ import {
|
|
|
18
25
|
productionRunStatusLabelKey,
|
|
19
26
|
productionRunStatusTone,
|
|
20
27
|
validateCompletionQty,
|
|
28
|
+
validateTargetQty,
|
|
21
29
|
} from '../types.js';
|
|
22
30
|
|
|
23
31
|
const { t } = useI18n();
|
|
@@ -33,17 +41,47 @@ export interface ProductionRunListProps {
|
|
|
33
41
|
* `false` or throw to report a failure.
|
|
34
42
|
*/
|
|
35
43
|
oncomplete?: (runId: string, qty: number) => HandlerResult;
|
|
44
|
+
/**
|
|
45
|
+
* Changes the run's target quantity; omit to hide the target field. Return
|
|
46
|
+
* `false` or throw to report a failure.
|
|
47
|
+
*/
|
|
48
|
+
onsettarget?: (run: ProductionRunView, target: number) => HandlerResult;
|
|
49
|
+
/**
|
|
50
|
+
* Finishes the run, short of its target, once confirmed; omit to hide the
|
|
51
|
+
* button. Return `false` or throw to report a failure.
|
|
52
|
+
*/
|
|
53
|
+
onfinish?: (run: ProductionRunView) => HandlerResult;
|
|
54
|
+
/**
|
|
55
|
+
* Cancels the run once confirmed; omit to hide the button. Return `false` or
|
|
56
|
+
* throw to report a failure.
|
|
57
|
+
*/
|
|
58
|
+
oncancel?: (run: ProductionRunView) => HandlerResult;
|
|
36
59
|
/** Message shown when there are no runs. */
|
|
37
60
|
emptyMessage?: string;
|
|
38
61
|
}
|
|
39
62
|
|
|
40
|
-
const {
|
|
63
|
+
const {
|
|
64
|
+
runs,
|
|
65
|
+
oncomplete,
|
|
66
|
+
onsettarget,
|
|
67
|
+
onfinish,
|
|
68
|
+
oncancel,
|
|
69
|
+
emptyMessage,
|
|
70
|
+
}: ProductionRunListProps = $props();
|
|
71
|
+
|
|
72
|
+
const manage = $derived(Boolean(onsettarget || onfinish || oncancel));
|
|
41
73
|
|
|
42
74
|
const uid = $props.id();
|
|
43
75
|
|
|
44
76
|
let drafts = $state<Record<string, string>>({});
|
|
45
77
|
let errors = $state<Record<string, string>>({});
|
|
46
78
|
let busy = $state<Record<string, boolean>>({});
|
|
79
|
+
let targetDrafts = $state<Record<string, string>>({});
|
|
80
|
+
let manageErrors = $state<Record<string, string>>({});
|
|
81
|
+
let confirming = $state<{
|
|
82
|
+
kind: 'finish' | 'cancel';
|
|
83
|
+
run: ProductionRunView;
|
|
84
|
+
} | null>(null);
|
|
47
85
|
|
|
48
86
|
/** What is left, at the six-decimal quantity precision the service uses. */
|
|
49
87
|
function remainingOf(run: ProductionRunView): number {
|
|
@@ -76,6 +114,61 @@ async function report(run: ProductionRunView) {
|
|
|
76
114
|
busy[run.id] = false;
|
|
77
115
|
}
|
|
78
116
|
}
|
|
117
|
+
|
|
118
|
+
async function setTarget(run: ProductionRunView) {
|
|
119
|
+
if (!onsettarget) return;
|
|
120
|
+
const result = validateTargetQty(targetDrafts[run.id] ?? '', run);
|
|
121
|
+
if (!result.ok) {
|
|
122
|
+
manageErrors[run.id] =
|
|
123
|
+
result.reason === 'below_done'
|
|
124
|
+
? t(M['manufacturing.production_run_list.error_target_low'], {
|
|
125
|
+
completed: run.completedQty,
|
|
126
|
+
})
|
|
127
|
+
: t(M['manufacturing.production_run_list.error_target']);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
manageErrors[run.id] = '';
|
|
131
|
+
busy[run.id] = true;
|
|
132
|
+
try {
|
|
133
|
+
if ((await onsettarget(run, result.qty)) === false) {
|
|
134
|
+
manageErrors[run.id] = t(
|
|
135
|
+
M['manufacturing.production_run_list.target_failed'],
|
|
136
|
+
);
|
|
137
|
+
} else {
|
|
138
|
+
targetDrafts[run.id] = '';
|
|
139
|
+
}
|
|
140
|
+
} catch {
|
|
141
|
+
manageErrors[run.id] = t(
|
|
142
|
+
M['manufacturing.production_run_list.target_failed'],
|
|
143
|
+
);
|
|
144
|
+
} finally {
|
|
145
|
+
busy[run.id] = false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
async function confirmAction() {
|
|
150
|
+
const pending = confirming;
|
|
151
|
+
if (!pending) return;
|
|
152
|
+
const { kind, run } = pending;
|
|
153
|
+
const handler = kind === 'finish' ? onfinish : oncancel;
|
|
154
|
+
confirming = null;
|
|
155
|
+
if (!handler) return;
|
|
156
|
+
manageErrors[run.id] = '';
|
|
157
|
+
busy[run.id] = true;
|
|
158
|
+
try {
|
|
159
|
+
if ((await handler(run)) === false) {
|
|
160
|
+
manageErrors[run.id] = t(
|
|
161
|
+
M[`manufacturing.production_run_list.${kind}_failed`],
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
} catch {
|
|
165
|
+
manageErrors[run.id] = t(
|
|
166
|
+
M[`manufacturing.production_run_list.${kind}_failed`],
|
|
167
|
+
);
|
|
168
|
+
} finally {
|
|
169
|
+
busy[run.id] = false;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
79
172
|
</script>
|
|
80
173
|
|
|
81
174
|
{#if runs.length === 0}
|
|
@@ -94,6 +187,9 @@ async function report(run: ProductionRunView) {
|
|
|
94
187
|
{#if oncomplete}
|
|
95
188
|
<th scope="col">{t(M['manufacturing.production_run_list.report'])}</th>
|
|
96
189
|
{/if}
|
|
190
|
+
{#if manage}
|
|
191
|
+
<th scope="col">{t(M['manufacturing.production_run_list.manage'])}</th>
|
|
192
|
+
{/if}
|
|
97
193
|
</tr>
|
|
98
194
|
</thead>
|
|
99
195
|
<tbody>
|
|
@@ -156,6 +252,74 @@ async function report(run: ProductionRunView) {
|
|
|
156
252
|
{/if}
|
|
157
253
|
</td>
|
|
158
254
|
{/if}
|
|
255
|
+
{#if manage}
|
|
256
|
+
{@const manageErrorId = `${uid}-${run.id}-manage-error`}
|
|
257
|
+
<td>
|
|
258
|
+
{#if isProductionRunOpen(run.status)}
|
|
259
|
+
<div class="run-list-manage">
|
|
260
|
+
{#if onsettarget}
|
|
261
|
+
<Form class="run-list-report" onsubmit={() => setTarget(run)}>
|
|
262
|
+
<Input
|
|
263
|
+
type="number"
|
|
264
|
+
inputmode="decimal"
|
|
265
|
+
step="any"
|
|
266
|
+
min="0"
|
|
267
|
+
value={targetDrafts[run.id] ?? ''}
|
|
268
|
+
placeholder={String(run.targetQty)}
|
|
269
|
+
oninput={(event) => {
|
|
270
|
+
targetDrafts[run.id] = (event.currentTarget as HTMLInputElement).value;
|
|
271
|
+
}}
|
|
272
|
+
disabled={busy[run.id]}
|
|
273
|
+
aria-label={t(M['manufacturing.production_run_list.target_aria'], { label: run.label })}
|
|
274
|
+
aria-invalid={manageErrors[run.id] ? 'true' : undefined}
|
|
275
|
+
aria-describedby={manageErrors[run.id] ? manageErrorId : undefined}
|
|
276
|
+
/>
|
|
277
|
+
<Button
|
|
278
|
+
type="submit"
|
|
279
|
+
size="sm"
|
|
280
|
+
variant="secondary"
|
|
281
|
+
disabled={busy[run.id]}
|
|
282
|
+
aria-label={t(M['manufacturing.production_run_list.target_submit_aria'], { label: run.label })}
|
|
283
|
+
>
|
|
284
|
+
{t(M['manufacturing.production_run_list.target_submit'])}
|
|
285
|
+
</Button>
|
|
286
|
+
</Form>
|
|
287
|
+
{/if}
|
|
288
|
+
{#if onfinish || oncancel}
|
|
289
|
+
<div class="run-list-actions">
|
|
290
|
+
{#if onfinish}
|
|
291
|
+
<Button
|
|
292
|
+
type="button"
|
|
293
|
+
size="sm"
|
|
294
|
+
variant="secondary"
|
|
295
|
+
disabled={busy[run.id]}
|
|
296
|
+
aria-label={t(M['manufacturing.production_run_list.finish_aria'], { label: run.label })}
|
|
297
|
+
onclick={() => (confirming = { kind: 'finish', run })}
|
|
298
|
+
>
|
|
299
|
+
{t(M['manufacturing.production_run_list.finish'])}
|
|
300
|
+
</Button>
|
|
301
|
+
{/if}
|
|
302
|
+
{#if oncancel}
|
|
303
|
+
<Button
|
|
304
|
+
type="button"
|
|
305
|
+
size="sm"
|
|
306
|
+
variant="secondary"
|
|
307
|
+
disabled={busy[run.id]}
|
|
308
|
+
aria-label={t(M['manufacturing.production_run_list.cancel_aria'], { label: run.label })}
|
|
309
|
+
onclick={() => (confirming = { kind: 'cancel', run })}
|
|
310
|
+
>
|
|
311
|
+
{t(M['manufacturing.production_run_list.cancel'])}
|
|
312
|
+
</Button>
|
|
313
|
+
{/if}
|
|
314
|
+
</div>
|
|
315
|
+
{/if}
|
|
316
|
+
</div>
|
|
317
|
+
{#if manageErrors[run.id]}
|
|
318
|
+
<p class="run-list-error" id={manageErrorId} role="alert">{manageErrors[run.id]}</p>
|
|
319
|
+
{/if}
|
|
320
|
+
{/if}
|
|
321
|
+
</td>
|
|
322
|
+
{/if}
|
|
159
323
|
</tr>
|
|
160
324
|
{/each}
|
|
161
325
|
</tbody>
|
|
@@ -163,6 +327,26 @@ async function report(run: ProductionRunView) {
|
|
|
163
327
|
</div>
|
|
164
328
|
{/if}
|
|
165
329
|
|
|
330
|
+
{#if confirming}
|
|
331
|
+
{@const pending = confirming}
|
|
332
|
+
<ConfirmDialog
|
|
333
|
+
open
|
|
334
|
+
destructive={pending.kind === 'cancel'}
|
|
335
|
+
title={t(M[`manufacturing.production_run_list.${pending.kind}_title`])}
|
|
336
|
+
message={t(M[`manufacturing.production_run_list.${pending.kind}_message`], {
|
|
337
|
+
label: pending.run.label,
|
|
338
|
+
completed: pending.run.completedQty,
|
|
339
|
+
target: pending.run.targetQty,
|
|
340
|
+
})}
|
|
341
|
+
confirmLabel={t(M[`manufacturing.production_run_list.${pending.kind}_confirm`])}
|
|
342
|
+
cancelLabel={pending.kind === 'cancel'
|
|
343
|
+
? t(M['manufacturing.production_run_list.cancel_keep'])
|
|
344
|
+
: undefined}
|
|
345
|
+
onconfirm={confirmAction}
|
|
346
|
+
oncancel={() => (confirming = null)}
|
|
347
|
+
/>
|
|
348
|
+
{/if}
|
|
349
|
+
|
|
166
350
|
<style>
|
|
167
351
|
.run-list-scroll {
|
|
168
352
|
overflow-x: auto;
|
|
@@ -201,6 +385,18 @@ async function report(run: ProductionRunView) {
|
|
|
201
385
|
width: 6rem;
|
|
202
386
|
}
|
|
203
387
|
|
|
388
|
+
.run-list-manage {
|
|
389
|
+
display: flex;
|
|
390
|
+
flex-wrap: wrap;
|
|
391
|
+
gap: 0.5rem;
|
|
392
|
+
align-items: center;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.run-list-actions {
|
|
396
|
+
display: flex;
|
|
397
|
+
gap: 0.5rem;
|
|
398
|
+
}
|
|
399
|
+
|
|
204
400
|
.run-list-error {
|
|
205
401
|
margin: 0.25rem 0 0;
|
|
206
402
|
color: var(--smrt-color-error, inherit);
|
|
@@ -9,6 +9,21 @@ export interface ProductionRunListProps {
|
|
|
9
9
|
* `false` or throw to report a failure.
|
|
10
10
|
*/
|
|
11
11
|
oncomplete?: (runId: string, qty: number) => HandlerResult;
|
|
12
|
+
/**
|
|
13
|
+
* Changes the run's target quantity; omit to hide the target field. Return
|
|
14
|
+
* `false` or throw to report a failure.
|
|
15
|
+
*/
|
|
16
|
+
onsettarget?: (run: ProductionRunView, target: number) => HandlerResult;
|
|
17
|
+
/**
|
|
18
|
+
* Finishes the run, short of its target, once confirmed; omit to hide the
|
|
19
|
+
* button. Return `false` or throw to report a failure.
|
|
20
|
+
*/
|
|
21
|
+
onfinish?: (run: ProductionRunView) => HandlerResult;
|
|
22
|
+
/**
|
|
23
|
+
* Cancels the run once confirmed; omit to hide the button. Return `false` or
|
|
24
|
+
* throw to report a failure.
|
|
25
|
+
*/
|
|
26
|
+
oncancel?: (run: ProductionRunView) => HandlerResult;
|
|
12
27
|
/** Message shown when there are no runs. */
|
|
13
28
|
emptyMessage?: string;
|
|
14
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductionRunList.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ProductionRunList.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductionRunList.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ProductionRunList.svelte.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,KAAK,iBAAiB,EAKvB,MAAM,aAAa,CAAC;AAGrB,qFAAqF;AACrF,KAAK,aAAa,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,IAAI,EAAE,iBAAiB,EAAE,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,aAAa,CAAC;IAC3D;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,KAAK,aAAa,CAAC;IACxE;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,aAAa,CAAC;IACrD;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,aAAa,CAAC;IACrD,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA6OD,QAAA,MAAM,iBAAiB,4DAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
package/dist/svelte/i18n.d.ts
CHANGED
|
@@ -51,7 +51,10 @@ export declare const M: {
|
|
|
51
51
|
readonly 'manufacturing.assembly_form.submit_edit': "manufacturing.assembly_form.submit_edit";
|
|
52
52
|
readonly 'manufacturing.assembly_form.saving': "manufacturing.assembly_form.saving";
|
|
53
53
|
readonly 'manufacturing.assembly_form.cancel': "manufacturing.assembly_form.cancel";
|
|
54
|
+
readonly 'manufacturing.assembly_form.sku_code': "manufacturing.assembly_form.sku_code";
|
|
55
|
+
readonly 'manufacturing.assembly_form.sku_code_help': "manufacturing.assembly_form.sku_code_help";
|
|
54
56
|
readonly 'manufacturing.assembly_form.error_name': "manufacturing.assembly_form.error_name";
|
|
57
|
+
readonly 'manufacturing.assembly_form.error_sku_code': "manufacturing.assembly_form.error_sku_code";
|
|
55
58
|
readonly 'manufacturing.assembly_form.error_price': "manufacturing.assembly_form.error_price";
|
|
56
59
|
readonly 'manufacturing.assembly_form.error_labour': "manufacturing.assembly_form.error_labour";
|
|
57
60
|
readonly 'manufacturing.assembly_list.caption': "manufacturing.assembly_list.caption";
|
|
@@ -119,6 +122,26 @@ export declare const M: {
|
|
|
119
122
|
readonly 'manufacturing.production_run_list.error_qty': "manufacturing.production_run_list.error_qty";
|
|
120
123
|
readonly 'manufacturing.production_run_list.error_too_many': "manufacturing.production_run_list.error_too_many";
|
|
121
124
|
readonly 'manufacturing.production_run_list.error_failed': "manufacturing.production_run_list.error_failed";
|
|
125
|
+
readonly 'manufacturing.production_run_list.manage': "manufacturing.production_run_list.manage";
|
|
126
|
+
readonly 'manufacturing.production_run_list.target_aria': "manufacturing.production_run_list.target_aria";
|
|
127
|
+
readonly 'manufacturing.production_run_list.target_submit': "manufacturing.production_run_list.target_submit";
|
|
128
|
+
readonly 'manufacturing.production_run_list.target_submit_aria': "manufacturing.production_run_list.target_submit_aria";
|
|
129
|
+
readonly 'manufacturing.production_run_list.error_target': "manufacturing.production_run_list.error_target";
|
|
130
|
+
readonly 'manufacturing.production_run_list.error_target_low': "manufacturing.production_run_list.error_target_low";
|
|
131
|
+
readonly 'manufacturing.production_run_list.target_failed': "manufacturing.production_run_list.target_failed";
|
|
132
|
+
readonly 'manufacturing.production_run_list.finish': "manufacturing.production_run_list.finish";
|
|
133
|
+
readonly 'manufacturing.production_run_list.finish_aria': "manufacturing.production_run_list.finish_aria";
|
|
134
|
+
readonly 'manufacturing.production_run_list.finish_title': "manufacturing.production_run_list.finish_title";
|
|
135
|
+
readonly 'manufacturing.production_run_list.finish_message': "manufacturing.production_run_list.finish_message";
|
|
136
|
+
readonly 'manufacturing.production_run_list.finish_confirm': "manufacturing.production_run_list.finish_confirm";
|
|
137
|
+
readonly 'manufacturing.production_run_list.finish_failed': "manufacturing.production_run_list.finish_failed";
|
|
138
|
+
readonly 'manufacturing.production_run_list.cancel': "manufacturing.production_run_list.cancel";
|
|
139
|
+
readonly 'manufacturing.production_run_list.cancel_aria': "manufacturing.production_run_list.cancel_aria";
|
|
140
|
+
readonly 'manufacturing.production_run_list.cancel_title': "manufacturing.production_run_list.cancel_title";
|
|
141
|
+
readonly 'manufacturing.production_run_list.cancel_message': "manufacturing.production_run_list.cancel_message";
|
|
142
|
+
readonly 'manufacturing.production_run_list.cancel_confirm': "manufacturing.production_run_list.cancel_confirm";
|
|
143
|
+
readonly 'manufacturing.production_run_list.cancel_keep': "manufacturing.production_run_list.cancel_keep";
|
|
144
|
+
readonly 'manufacturing.production_run_list.cancel_failed': "manufacturing.production_run_list.cancel_failed";
|
|
122
145
|
readonly 'manufacturing.production_run_status.planned': "manufacturing.production_run_status.planned";
|
|
123
146
|
readonly 'manufacturing.production_run_status.in_progress': "manufacturing.production_run_status.in_progress";
|
|
124
147
|
readonly 'manufacturing.production_run_status.done': "manufacturing.production_run_status.done";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/svelte/i18n.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/svelte/i18n.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6LZ,CAAC"}
|
package/dist/svelte/i18n.js
CHANGED
|
@@ -52,7 +52,10 @@ export const M = defineMessages({
|
|
|
52
52
|
'manufacturing.assembly_form.submit_edit': 'Save changes',
|
|
53
53
|
'manufacturing.assembly_form.saving': 'Saving...',
|
|
54
54
|
'manufacturing.assembly_form.cancel': 'Cancel',
|
|
55
|
+
'manufacturing.assembly_form.sku_code': 'Part number',
|
|
56
|
+
'manufacturing.assembly_form.sku_code_help': "The code of the assembly's SKU. It must be unique.",
|
|
55
57
|
'manufacturing.assembly_form.error_name': 'Enter a name.',
|
|
58
|
+
'manufacturing.assembly_form.error_sku_code': 'Enter a part number.',
|
|
56
59
|
'manufacturing.assembly_form.error_price': 'Enter a price of zero or more, with no more decimals than the currency has.',
|
|
57
60
|
'manufacturing.assembly_form.error_labour': 'Enter a whole number of minutes, zero or more.',
|
|
58
61
|
'manufacturing.assembly_list.caption': 'Assemblies',
|
|
@@ -120,6 +123,26 @@ export const M = defineMessages({
|
|
|
120
123
|
'manufacturing.production_run_list.error_qty': 'Enter a quantity greater than zero.',
|
|
121
124
|
'manufacturing.production_run_list.error_too_many': 'Only {remaining} left to build.',
|
|
122
125
|
'manufacturing.production_run_list.error_failed': 'The completion could not be recorded.',
|
|
126
|
+
'manufacturing.production_run_list.manage': 'Manage run',
|
|
127
|
+
'manufacturing.production_run_list.target_aria': 'Target quantity for {label}',
|
|
128
|
+
'manufacturing.production_run_list.target_submit': 'Set target',
|
|
129
|
+
'manufacturing.production_run_list.target_submit_aria': 'Set the target quantity for {label}',
|
|
130
|
+
'manufacturing.production_run_list.error_target': 'Enter a target greater than zero.',
|
|
131
|
+
'manufacturing.production_run_list.error_target_low': 'The target cannot be below the {completed} already done.',
|
|
132
|
+
'manufacturing.production_run_list.target_failed': 'The target could not be changed.',
|
|
133
|
+
'manufacturing.production_run_list.finish': 'Finish',
|
|
134
|
+
'manufacturing.production_run_list.finish_aria': 'Finish {label}',
|
|
135
|
+
'manufacturing.production_run_list.finish_title': 'Finish this run?',
|
|
136
|
+
'manufacturing.production_run_list.finish_message': '{label} will be marked done at {completed} of {target}. No more completions can be reported.',
|
|
137
|
+
'manufacturing.production_run_list.finish_confirm': 'Finish run',
|
|
138
|
+
'manufacturing.production_run_list.finish_failed': 'The run could not be finished.',
|
|
139
|
+
'manufacturing.production_run_list.cancel': 'Cancel run',
|
|
140
|
+
'manufacturing.production_run_list.cancel_aria': 'Cancel {label}',
|
|
141
|
+
'manufacturing.production_run_list.cancel_title': 'Cancel this run?',
|
|
142
|
+
'manufacturing.production_run_list.cancel_message': '{label} will be cancelled. Completions already reported stay.',
|
|
143
|
+
'manufacturing.production_run_list.cancel_confirm': 'Cancel run',
|
|
144
|
+
'manufacturing.production_run_list.cancel_keep': 'Keep run',
|
|
145
|
+
'manufacturing.production_run_list.cancel_failed': 'The run could not be cancelled.',
|
|
123
146
|
'manufacturing.production_run_status.planned': 'Planned',
|
|
124
147
|
'manufacturing.production_run_status.in_progress': 'In progress',
|
|
125
148
|
'manufacturing.production_run_status.done': 'Done',
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -29,5 +29,5 @@ export type OperationFormProps = ComponentProps<typeof OperationForm>;
|
|
|
29
29
|
export type OperationListProps = ComponentProps<typeof OperationList>;
|
|
30
30
|
export type ProductionRunListProps = ComponentProps<typeof ProductionRunList>;
|
|
31
31
|
export type RequirementsTreeProps = ComponentProps<typeof RequirementsTree>;
|
|
32
|
-
export { type AssemblyFieldPolicy, type AssemblyFormDraft, type AssemblyFormField, type AssemblyFormInitial, type AssemblyFormInvalidField, type AssemblyFormValidation, type AssemblyFormValues, type AssemblyView, assemblyFormDraft, type BomComponentOption, type BomEditorLine, type BomLineDraft, type BomLineDraftField, type BomLineInput, type BomLineValidation, type CompletionQtyValidation, type ComponentKind, componentKindLabelKey, currencyExponent, formatPriceInput, isProductionRunOpen, keepProtectedFields, type OperationFormDraft, type OperationFormField, type OperationFormInitial, type OperationFormValidation, type OperationFormValues, type OperationView, operationStatusBadgeKey, type ProductionRunStatus, type ProductionRunView, productionRunStatusLabelKey, productionRunStatusTone, type RequirementLineView, type RequirementTotalView, splitLabourMinutes, toAssemblyView, toBomEditorLine, toBomEditorLines, toProductionRunView, toRequirementTotals, toRequirementTree, validateAssemblyForm, validateBomLineInput, validateCompletionQty, validateOperationForm, } from './types.js';
|
|
32
|
+
export { type AssemblyFieldPolicy, type AssemblyFormDraft, type AssemblyFormErrors, type AssemblyFormField, type AssemblyFormInitial, type AssemblyFormInvalidField, type AssemblyFormValidation, type AssemblyFormValues, type AssemblyView, assemblyFormDraft, type BomComponentOption, type BomEditorLine, type BomLineDraft, type BomLineDraftField, type BomLineInput, type BomLineValidation, type CompletionQtyValidation, type ComponentKind, componentKindLabelKey, currencyExponent, formatPriceInput, isProductionRunOpen, keepProtectedFields, type OperationFormDraft, type OperationFormField, type OperationFormInitial, type OperationFormValidation, type OperationFormValues, type OperationView, operationStatusBadgeKey, type ProductionRunStatus, type ProductionRunView, productionRunStatusLabelKey, productionRunStatusTone, type RequirementLineView, type RequirementTotalView, splitLabourMinutes, type TargetQtyValidation, toAssemblyView, toBomEditorLine, toBomEditorLines, toProductionRunView, toRequirementTotals, toRequirementTree, validateAssemblyForm, validateBomLineInput, validateCompletionQty, validateOperationForm, validateTargetQty, } from './types.js';
|
|
33
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svelte/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAC5D,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAC5D,OAAO,SAAS,MAAM,+BAA+B,CAAC;AACtD,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,aAAa,MAAM,mCAAmC,CAAC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index.js
CHANGED
|
@@ -22,7 +22,7 @@ import OperationList from './components/OperationList.svelte';
|
|
|
22
22
|
import ProductionRunList from './components/ProductionRunList.svelte';
|
|
23
23
|
import RequirementsTree from './components/RequirementsTree.svelte';
|
|
24
24
|
export { AssemblyForm, AssemblyList, BomEditor, BomStructureTree, OperationForm, OperationList, ProductionRunList, RequirementsTree, };
|
|
25
|
-
export { assemblyFormDraft, componentKindLabelKey, currencyExponent, formatPriceInput, isProductionRunOpen, keepProtectedFields, operationStatusBadgeKey, productionRunStatusLabelKey, productionRunStatusTone, splitLabourMinutes, toAssemblyView, toBomEditorLine, toBomEditorLines, toProductionRunView, toRequirementTotals, toRequirementTree, validateAssemblyForm, validateBomLineInput, validateCompletionQty, validateOperationForm, } from './types.js';
|
|
25
|
+
export { assemblyFormDraft, componentKindLabelKey, currencyExponent, formatPriceInput, isProductionRunOpen, keepProtectedFields, operationStatusBadgeKey, productionRunStatusLabelKey, productionRunStatusTone, splitLabourMinutes, toAssemblyView, toBomEditorLine, toBomEditorLines, toProductionRunView, toRequirementTotals, toRequirementTree, validateAssemblyForm, validateBomLineInput, validateCompletionQty, validateOperationForm, validateTargetQty, } from './types.js';
|
|
26
26
|
// Auto-register with ModuleUIRegistry
|
|
27
27
|
ModuleUIRegistry.registerModule(MANUFACTURING_MODULE_META);
|
|
28
28
|
ModuleUIRegistry.register('@happyvertical/smrt-manufacturing', 'operation-list', OperationList);
|
package/dist/svelte/types.d.ts
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { Assembly } from '../models/Assembly.js';
|
|
8
8
|
import type { ProductionRun, ProductionRunStatus } from '../models/ProductionRun.js';
|
|
9
|
-
import type {
|
|
10
|
-
import type { Explosion, RequirementsPlan } from '../types.js';
|
|
9
|
+
import type { ComponentKind } from '../views.js';
|
|
11
10
|
/** One row of `OperationList`; an `Operation` satisfies it. */
|
|
12
11
|
export interface OperationView {
|
|
13
12
|
/** The `Operation` id. */
|
|
@@ -68,7 +67,7 @@ export interface AssemblyFieldPolicy {
|
|
|
68
67
|
} | undefined>>;
|
|
69
68
|
}
|
|
70
69
|
/** A field of `AssemblyForm`, named as `Assembly` and `Product` name it. */
|
|
71
|
-
export type AssemblyFormField = 'name' | 'description' | 'category' | 'partReference' | 'price' | 'estimatedLabourMinutes' | 'defaultOperationId' | 'tags';
|
|
70
|
+
export type AssemblyFormField = 'name' | 'description' | 'category' | 'partReference' | 'price' | 'estimatedLabourMinutes' | 'defaultOperationId' | 'tags' | 'skuCode';
|
|
72
71
|
/** Existing values passed to `AssemblyForm` when editing; an `Assembly` satisfies it. */
|
|
73
72
|
export interface AssemblyFormInitial {
|
|
74
73
|
name: string;
|
|
@@ -82,6 +81,11 @@ export interface AssemblyFormInitial {
|
|
|
82
81
|
/** The default `Operation` id, or `null` for none. */
|
|
83
82
|
defaultOperationId: string | null;
|
|
84
83
|
tags: readonly string[];
|
|
84
|
+
/**
|
|
85
|
+
* The part number: the code of the assembly's `Sku`. Optional; read only
|
|
86
|
+
* when the form shows the part-number field.
|
|
87
|
+
*/
|
|
88
|
+
skuCode?: string;
|
|
85
89
|
}
|
|
86
90
|
/**
|
|
87
91
|
* What `AssemblyForm` hands to `onsubmit`; text is trimmed. A hidden or
|
|
@@ -100,9 +104,14 @@ export interface AssemblyFormValues {
|
|
|
100
104
|
/** The chosen `Operation` id, or `null` for none. */
|
|
101
105
|
defaultOperationId: string | null;
|
|
102
106
|
tags: string[];
|
|
107
|
+
/**
|
|
108
|
+
* The trimmed part number (SKU code, never empty). Present only when the
|
|
109
|
+
* form showed the part-number field.
|
|
110
|
+
*/
|
|
111
|
+
skuCode?: string;
|
|
103
112
|
}
|
|
104
113
|
/** A field `validateAssemblyForm` can reject. */
|
|
105
|
-
export type AssemblyFormInvalidField = 'name' | 'price' | 'estimatedLabourMinutes';
|
|
114
|
+
export type AssemblyFormInvalidField = 'name' | 'price' | 'estimatedLabourMinutes' | 'skuCode';
|
|
106
115
|
/** The raw text `AssemblyForm` collects, before trimming and checks. */
|
|
107
116
|
export interface AssemblyFormDraft {
|
|
108
117
|
name: string;
|
|
@@ -116,6 +125,17 @@ export interface AssemblyFormDraft {
|
|
|
116
125
|
defaultOperationId: string;
|
|
117
126
|
/** Comma-separated. */
|
|
118
127
|
tags: string;
|
|
128
|
+
/** The part number as typed; present only when the form shows the field. */
|
|
129
|
+
skuCode?: string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Errors the host reports back to `AssemblyForm`, such as a part number
|
|
133
|
+
* already in use. A field message shows under that field; `form` shows above
|
|
134
|
+
* the actions.
|
|
135
|
+
*/
|
|
136
|
+
export interface AssemblyFormErrors {
|
|
137
|
+
form?: string;
|
|
138
|
+
fields?: Partial<Record<AssemblyFormField, string>>;
|
|
119
139
|
}
|
|
120
140
|
/** Result of {@link validateAssemblyForm}. */
|
|
121
141
|
export type AssemblyFormValidation = {
|
|
@@ -149,11 +169,13 @@ export declare function keepProtectedFields(values: AssemblyFormValues, initial:
|
|
|
149
169
|
* required, the labour estimate is a whole number of minutes of zero or more
|
|
150
170
|
* (empty counts as zero), and the price is an amount of zero or more with at
|
|
151
171
|
* most `exponent` decimals (empty counts as zero; 2 unless the currency says
|
|
152
|
-
* otherwise).
|
|
172
|
+
* otherwise). A part number, when the draft carries one, must not be empty.
|
|
173
|
+
* Fields in `skip` (hidden or
|
|
153
174
|
* read-only in the form) are not checked.
|
|
154
175
|
*/
|
|
155
176
|
export declare function validateAssemblyForm(draft: Readonly<Partial<AssemblyFormDraft>>, skip?: readonly AssemblyFormField[], exponent?: number): AssemblyFormValidation;
|
|
156
|
-
export type { ComponentKind };
|
|
177
|
+
export type { BomEditorLine, ComponentKind, RequirementLineView, RequirementTotalView, } from '../views.js';
|
|
178
|
+
export { toBomEditorLine, toBomEditorLines, toRequirementTotals, toRequirementTree, } from '../views.js';
|
|
157
179
|
/** One row of {@link AssemblyList}. */
|
|
158
180
|
export interface AssemblyView {
|
|
159
181
|
/** The assembly id. */
|
|
@@ -179,39 +201,6 @@ export declare function toAssemblyView(assembly: Pick<Assembly, 'id' | 'name' |
|
|
|
179
201
|
skuCodes?: readonly string[];
|
|
180
202
|
activeBomVersion?: number | null;
|
|
181
203
|
}): AssemblyView;
|
|
182
|
-
/** One line of {@link BomEditor}. */
|
|
183
|
-
export interface BomEditorLine {
|
|
184
|
-
/** The bill line id. */
|
|
185
|
-
id: string;
|
|
186
|
-
/** The component SKU the line consumes. */
|
|
187
|
-
componentSkuId: string;
|
|
188
|
-
/** The component's product name, or its SKU code when that is unknown. */
|
|
189
|
-
componentName: string;
|
|
190
|
-
/** The component's SKU code; empty when the SKU is missing. */
|
|
191
|
-
skuCode: string;
|
|
192
|
-
/** What the component is. */
|
|
193
|
-
kind: ComponentKind;
|
|
194
|
-
/** Quantity per produced unit, before waste. */
|
|
195
|
-
qtyPerUnit: number;
|
|
196
|
-
/** Unit of measure. */
|
|
197
|
-
uom: string;
|
|
198
|
-
/** Expected waste, in percent. */
|
|
199
|
-
wastePercent: number;
|
|
200
|
-
/** Free-form notes. */
|
|
201
|
-
notes: string;
|
|
202
|
-
/**
|
|
203
|
-
* For a sub-assembly, the id of its own active bill; `null` when it has
|
|
204
|
-
* none, and for every other kind.
|
|
205
|
-
*/
|
|
206
|
-
subBomId: string | null;
|
|
207
|
-
}
|
|
208
|
-
/** Adapt one resolved bill line for {@link BomEditor}. */
|
|
209
|
-
export declare function toBomEditorLine(entry: BillStructureLine): BomEditorLine;
|
|
210
|
-
/**
|
|
211
|
-
* Adapt a whole bill from `AssemblyService.getBillStructure` for
|
|
212
|
-
* {@link BomEditor}, keeping its line order.
|
|
213
|
-
*/
|
|
214
|
-
export declare function toBomEditorLines(structure: BillStructure): BomEditorLine[];
|
|
215
204
|
/** A component the editor offers when adding a line. */
|
|
216
205
|
export interface BomComponentOption {
|
|
217
206
|
/** The component SKU id. */
|
|
@@ -299,54 +288,18 @@ export type CompletionQtyValidation = {
|
|
|
299
288
|
* service checks again under its lock).
|
|
300
289
|
*/
|
|
301
290
|
export declare function validateCompletionQty(raw: string, run: Pick<ProductionRunView, 'targetQty' | 'completedQty'>): CompletionQtyValidation;
|
|
302
|
-
/**
|
|
303
|
-
export
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
/** Component SKU code; empty when unknown. */
|
|
311
|
-
skuCode: string;
|
|
312
|
-
/** What the component is. */
|
|
313
|
-
kind: ComponentKind;
|
|
314
|
-
/** Quantity required for the run (net of stock in a plan). */
|
|
315
|
-
required: number;
|
|
316
|
-
/** The line's unit. */
|
|
317
|
-
uom: string;
|
|
318
|
-
/** Unallocated available stock; `null` for a gross explosion. */
|
|
319
|
-
available: number | null;
|
|
320
|
-
/** How much is short; `null` for a gross explosion. */
|
|
321
|
-
short: number | null;
|
|
322
|
-
/** A sub-assembly with an active bill. */
|
|
323
|
-
buildable: boolean;
|
|
324
|
-
/** The lines of this sub-assembly's bill that were walked. */
|
|
325
|
-
children: RequirementLineView[];
|
|
326
|
-
}
|
|
327
|
-
/** One row of the totals table of `RequirementsTree`. */
|
|
328
|
-
export interface RequirementTotalView {
|
|
329
|
-
/** The component SKU. */
|
|
330
|
-
componentSkuId: string;
|
|
331
|
-
/** Component name; empty when it cannot be resolved. */
|
|
332
|
-
name: string;
|
|
333
|
-
/** Component SKU code; empty when unknown. */
|
|
334
|
-
skuCode: string;
|
|
335
|
-
/** Total required, summed over the lines not opened. */
|
|
336
|
-
required: number;
|
|
337
|
-
/** The first line's unit. */
|
|
338
|
-
uom: string;
|
|
339
|
-
/** Total short; `null` for a gross explosion. */
|
|
340
|
-
short: number | null;
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Nest the depth-first lines of an {@link Explosion} or a
|
|
344
|
-
* {@link RequirementsPlan} for `RequirementsTree`.
|
|
345
|
-
*/
|
|
346
|
-
export declare function toRequirementTree(source: Pick<Explosion | RequirementsPlan, 'lines'>): RequirementLineView[];
|
|
291
|
+
/** Result of {@link validateTargetQty}. */
|
|
292
|
+
export type TargetQtyValidation = {
|
|
293
|
+
ok: true;
|
|
294
|
+
qty: number;
|
|
295
|
+
} | {
|
|
296
|
+
ok: false;
|
|
297
|
+
reason: 'invalid' | 'below_done';
|
|
298
|
+
};
|
|
347
299
|
/**
|
|
348
|
-
*
|
|
349
|
-
* not
|
|
300
|
+
* Check a typed target quantity: greater than zero, within the quantity
|
|
301
|
+
* limits, and not below what the run has already completed (the service
|
|
302
|
+
* checks again under its lock).
|
|
350
303
|
*/
|
|
351
|
-
export declare function
|
|
304
|
+
export declare function validateTargetQty(raw: string, run: Pick<ProductionRunView, 'completedQty'>): TargetQtyValidation;
|
|
352
305
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/svelte/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/svelte/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,+DAA+D;AAC/D,MAAM,WAAW,aAAa;IAC5B,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,gFAA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