@happyvertical/smrt-commerce 0.53.3 → 0.53.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/AGENTS.md +19 -3
  2. package/README.md +29 -1
  3. package/agents/commercial-ui.md +78 -0
  4. package/agents/customer-vendor-ui.md +76 -0
  5. package/agents/invoice-calculations.md +17 -0
  6. package/agents/invoice-preparation.md +86 -0
  7. package/agents/invoice-quantity.md +46 -0
  8. package/agents/pricing-versions.md +28 -0
  9. package/agents/purchasing-ui.md +82 -0
  10. package/agents/quote-ui.md +82 -0
  11. package/dist/billing/units.d.ts +1 -7
  12. package/dist/billing/units.d.ts.map +1 -1
  13. package/dist/chunks/calculations-DPuldr1J.js +242 -0
  14. package/dist/chunks/calculations-DPuldr1J.js.map +1 -0
  15. package/dist/chunks/types-CRnln577.js.map +1 -1
  16. package/dist/chunks/{units-CpBepqG1.js → units-CJcAOQm1.js} +3 -39
  17. package/dist/chunks/units-CJcAOQm1.js.map +1 -0
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +164 -44
  21. package/dist/index.js.map +1 -1
  22. package/dist/invoices.d.ts +3 -0
  23. package/dist/invoices.d.ts.map +1 -0
  24. package/dist/invoices.js +2 -0
  25. package/dist/manifest.json +66 -8
  26. package/dist/migrations/invoiceEditorStorage.d.ts +39 -0
  27. package/dist/migrations/invoiceEditorStorage.d.ts.map +1 -0
  28. package/dist/models/ContractLineItem.d.ts +1 -1
  29. package/dist/models/InvoiceLineItem.d.ts +18 -36
  30. package/dist/models/InvoiceLineItem.d.ts.map +1 -1
  31. package/dist/playground.js +201 -3
  32. package/dist/playground.js.map +1 -1
  33. package/dist/smrt-knowledge.json +109 -7
  34. package/dist/svelte/components/CustomerDetail.svelte +150 -0
  35. package/dist/svelte/components/CustomerDetail.svelte.d.ts +28 -0
  36. package/dist/svelte/components/CustomerDetail.svelte.d.ts.map +1 -0
  37. package/dist/svelte/components/CustomerDirectory.svelte +177 -0
  38. package/dist/svelte/components/CustomerDirectory.svelte.d.ts +42 -0
  39. package/dist/svelte/components/CustomerDirectory.svelte.d.ts.map +1 -0
  40. package/dist/svelte/components/CustomerForm.svelte +234 -0
  41. package/dist/svelte/components/CustomerForm.svelte.d.ts +44 -0
  42. package/dist/svelte/components/CustomerForm.svelte.d.ts.map +1 -0
  43. package/dist/svelte/components/InvoiceAllocationFields.svelte +72 -0
  44. package/dist/svelte/components/InvoiceAllocationFields.svelte.d.ts +8 -0
  45. package/dist/svelte/components/InvoiceAllocationFields.svelte.d.ts.map +1 -0
  46. package/dist/svelte/components/InvoiceCard.svelte +2 -2
  47. package/dist/svelte/components/InvoiceEditor.svelte +134 -0
  48. package/dist/svelte/components/InvoiceEditor.svelte.d.ts +8 -0
  49. package/dist/svelte/components/InvoiceEditor.svelte.d.ts.map +1 -0
  50. package/dist/svelte/components/InvoiceLineEditor.svelte +85 -0
  51. package/dist/svelte/components/InvoiceLineEditor.svelte.d.ts +8 -0
  52. package/dist/svelte/components/InvoiceLineEditor.svelte.d.ts.map +1 -0
  53. package/dist/svelte/components/InvoiceReview.svelte +23 -0
  54. package/dist/svelte/components/InvoiceReview.svelte.d.ts +10 -0
  55. package/dist/svelte/components/InvoiceReview.svelte.d.ts.map +1 -0
  56. package/dist/svelte/components/PartyAddressFields.svelte +95 -0
  57. package/dist/svelte/components/PartyAddressFields.svelte.d.ts +25 -0
  58. package/dist/svelte/components/PartyAddressFields.svelte.d.ts.map +1 -0
  59. package/dist/svelte/components/PartyContactFields.svelte +153 -0
  60. package/dist/svelte/components/PartyContactFields.svelte.d.ts +28 -0
  61. package/dist/svelte/components/PartyContactFields.svelte.d.ts.map +1 -0
  62. package/dist/svelte/components/PricingVersionDecision.svelte +88 -0
  63. package/dist/svelte/components/PricingVersionDecision.svelte.d.ts +35 -0
  64. package/dist/svelte/components/PricingVersionDecision.svelte.d.ts.map +1 -0
  65. package/dist/svelte/components/PricingVersionSummary.svelte +46 -0
  66. package/dist/svelte/components/PricingVersionSummary.svelte.d.ts +9 -0
  67. package/dist/svelte/components/PricingVersionSummary.svelte.d.ts.map +1 -0
  68. package/dist/svelte/components/PurchaseOrderEditor.svelte +210 -0
  69. package/dist/svelte/components/PurchaseOrderEditor.svelte.d.ts +79 -0
  70. package/dist/svelte/components/PurchaseOrderEditor.svelte.d.ts.map +1 -0
  71. package/dist/svelte/components/PurchaseSourceSelector.svelte +56 -0
  72. package/dist/svelte/components/PurchaseSourceSelector.svelte.d.ts +30 -0
  73. package/dist/svelte/components/PurchaseSourceSelector.svelte.d.ts.map +1 -0
  74. package/dist/svelte/components/PurchasingPlayground.svelte +133 -0
  75. package/dist/svelte/components/PurchasingPlayground.svelte.d.ts +9 -0
  76. package/dist/svelte/components/PurchasingPlayground.svelte.d.ts.map +1 -0
  77. package/dist/svelte/components/QuoteEditor.svelte +177 -0
  78. package/dist/svelte/components/QuoteEditor.svelte.d.ts +76 -0
  79. package/dist/svelte/components/QuoteEditor.svelte.d.ts.map +1 -0
  80. package/dist/svelte/components/QuotePlayground.svelte +108 -0
  81. package/dist/svelte/components/QuotePlayground.svelte.d.ts +10 -0
  82. package/dist/svelte/components/QuotePlayground.svelte.d.ts.map +1 -0
  83. package/dist/svelte/components/QuoteRevisionComparison.svelte +44 -0
  84. package/dist/svelte/components/QuoteRevisionComparison.svelte.d.ts +14 -0
  85. package/dist/svelte/components/QuoteRevisionComparison.svelte.d.ts.map +1 -0
  86. package/dist/svelte/components/QuoteRevisionHistory.svelte +55 -0
  87. package/dist/svelte/components/QuoteRevisionHistory.svelte.d.ts +15 -0
  88. package/dist/svelte/components/QuoteRevisionHistory.svelte.d.ts.map +1 -0
  89. package/dist/svelte/components/VendorDetail.svelte +134 -0
  90. package/dist/svelte/components/VendorDetail.svelte.d.ts +26 -0
  91. package/dist/svelte/components/VendorDetail.svelte.d.ts.map +1 -0
  92. package/dist/svelte/components/VendorDirectory.svelte +178 -0
  93. package/dist/svelte/components/VendorDirectory.svelte.d.ts +42 -0
  94. package/dist/svelte/components/VendorDirectory.svelte.d.ts.map +1 -0
  95. package/dist/svelte/components/VendorForm.svelte +224 -0
  96. package/dist/svelte/components/VendorForm.svelte.d.ts +42 -0
  97. package/dist/svelte/components/VendorForm.svelte.d.ts.map +1 -0
  98. package/dist/svelte/i18n.d.ts +102 -0
  99. package/dist/svelte/i18n.d.ts.map +1 -1
  100. package/dist/svelte/i18n.js +102 -0
  101. package/dist/svelte/index.d.ts +52 -0
  102. package/dist/svelte/index.d.ts.map +1 -1
  103. package/dist/svelte/index.js +49 -0
  104. package/dist/svelte/invoices/calculations.d.ts +121 -0
  105. package/dist/svelte/invoices/calculations.d.ts.map +1 -0
  106. package/dist/svelte/invoices/calculations.js +259 -0
  107. package/dist/svelte/invoices/currency.d.ts +9 -0
  108. package/dist/svelte/invoices/currency.d.ts.map +1 -0
  109. package/dist/svelte/invoices/currency.js +55 -0
  110. package/dist/svelte/invoices/fields.d.ts +6 -0
  111. package/dist/svelte/invoices/fields.d.ts.map +1 -0
  112. package/dist/svelte/invoices/fields.js +22 -0
  113. package/dist/svelte/invoices/messages.d.ts +53 -0
  114. package/dist/svelte/invoices/messages.d.ts.map +1 -0
  115. package/dist/svelte/invoices/messages.js +53 -0
  116. package/dist/svelte/invoices/types.d.ts +194 -0
  117. package/dist/svelte/invoices/types.d.ts.map +1 -0
  118. package/dist/svelte/invoices/types.js +1 -0
  119. package/dist/svelte/party-types.d.ts +203 -0
  120. package/dist/svelte/party-types.d.ts.map +1 -0
  121. package/dist/svelte/party-types.js +82 -0
  122. package/dist/svelte/playground/InvoicePreparationPreview.svelte +116 -0
  123. package/dist/svelte/playground/InvoicePreparationPreview.svelte.d.ts +4 -0
  124. package/dist/svelte/playground/InvoicePreparationPreview.svelte.d.ts.map +1 -0
  125. package/dist/svelte/playground/PartyFormPreview.svelte +211 -0
  126. package/dist/svelte/playground/PartyFormPreview.svelte.d.ts +8 -0
  127. package/dist/svelte/playground/PartyFormPreview.svelte.d.ts.map +1 -0
  128. package/dist/svelte/playground/PricingVersionPreview.svelte +55 -0
  129. package/dist/svelte/playground/PricingVersionPreview.svelte.d.ts +4 -0
  130. package/dist/svelte/playground/PricingVersionPreview.svelte.d.ts.map +1 -0
  131. package/dist/svelte/playground.d.ts +442 -3
  132. package/dist/svelte/playground.d.ts.map +1 -1
  133. package/dist/svelte/playground.js +199 -3
  134. package/dist/svelte/pricing-i18n.d.ts +10 -0
  135. package/dist/svelte/pricing-i18n.d.ts.map +1 -0
  136. package/dist/svelte/pricing-i18n.js +10 -0
  137. package/dist/svelte/pricing-types.d.ts +38 -0
  138. package/dist/svelte/pricing-types.d.ts.map +1 -0
  139. package/dist/svelte/pricing-types.js +1 -0
  140. package/dist/svelte/purchasing-i18n.d.ts +53 -0
  141. package/dist/svelte/purchasing-i18n.d.ts.map +1 -0
  142. package/dist/svelte/purchasing-i18n.js +53 -0
  143. package/dist/svelte/purchasing-types.d.ts +91 -0
  144. package/dist/svelte/purchasing-types.d.ts.map +1 -0
  145. package/dist/svelte/purchasing-types.js +13 -0
  146. package/dist/svelte/quote-i18n.d.ts +49 -0
  147. package/dist/svelte/quote-i18n.d.ts.map +1 -0
  148. package/dist/svelte/quote-i18n.js +49 -0
  149. package/dist/svelte/quote-types.d.ts +81 -0
  150. package/dist/svelte/quote-types.d.ts.map +1 -0
  151. package/dist/svelte/quote-types.js +51 -0
  152. package/dist/types/index.d.ts +13 -3
  153. package/dist/types/index.d.ts.map +1 -1
  154. package/dist/ui.d.ts.map +1 -1
  155. package/dist/ui.js +150 -6
  156. package/dist/ui.js.map +1 -1
  157. package/package.json +25 -13
  158. package/dist/chunks/units-CpBepqG1.js.map +0 -1
@@ -0,0 +1,88 @@
1
+ <script lang="ts">
2
+ import { Form, FormGroup, Input, Textarea } from '@happyvertical/smrt-ui/forms';
3
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
4
+ import { Button } from '@happyvertical/smrt-ui/ui';
5
+ import type { Snippet } from 'svelte';
6
+ import type { HTMLFormAttributes } from 'svelte/elements';
7
+ import { PRICING_MESSAGES as M } from '../pricing-i18n.js';
8
+ import type {
9
+ PricingDecisionAction,
10
+ PricingHiddenField,
11
+ PricingVersionData,
12
+ } from '../pricing-types.js';
13
+ import PricingVersionSummary from './PricingVersionSummary.svelte';
14
+
15
+ export interface Props {
16
+ /** Authorized immutable version snapshot; displaying it records no decision. */
17
+ version: PricingVersionData;
18
+ /** Caller-owned native form destination. */
19
+ action: string;
20
+ /** Explicit available decisions; no acceptance/award action is inferred. */
21
+ actions: readonly PricingDecisionAction[];
22
+ /** Ordered exact hidden values, including caller-owned version/request/tenant tokens. */
23
+ hiddenFields?: readonly PricingHiddenField[];
24
+ /** Retained reason text, including text returned after a rejected action. */
25
+ reason?: string;
26
+ /** Native field name for the reason; omit to use reason. */
27
+ reasonName?: string;
28
+ /** Localized reason label override. */
29
+ reasonLabel?: string;
30
+ /** Whether the server requires a reason for these decisions. */
31
+ reasonRequired?: boolean;
32
+ /** Caller-returned form error; does not reset text or hidden identity. */
33
+ error?: string;
34
+ /** Hide mutation controls for a viewer; this is not server authorization. */
35
+ readOnly?: boolean;
36
+ /** Disable decisions while an application-controlled submission is in flight. */
37
+ busy?: boolean;
38
+ /** Optional progressive enhancement; native submission remains the default. */
39
+ onsubmit?: HTMLFormAttributes['onsubmit'];
40
+ /** Additional caller-owned native fields or decision context within the form. */
41
+ children?: Snippet;
42
+ }
43
+ const {
44
+ version,
45
+ action,
46
+ actions,
47
+ hiddenFields = [],
48
+ reason = '',
49
+ reasonName = 'reason',
50
+ reasonLabel,
51
+ reasonRequired = false,
52
+ error,
53
+ readOnly = false,
54
+ busy = false,
55
+ onsubmit,
56
+ children,
57
+ }: Props = $props();
58
+ const { t } = useI18n();
59
+ const id = $props.id();
60
+ </script>
61
+
62
+ <section class="pricing-decision">
63
+ <PricingVersionSummary {version} />
64
+ {#if error}<p role="alert">{error}</p>{/if}
65
+ {#if readOnly}
66
+ <p>{t(M['commerce.pricing.read_only'])}</p>
67
+ {#if reason}<p>{reason}</p>{/if}
68
+ {:else if !actions.length}
69
+ <p>{t(M['commerce.pricing.no_actions'])}</p>
70
+ {:else}
71
+ <Form method="POST" {action} preventDefault={false} {onsubmit}>
72
+ {#each hiddenFields as field}<Input type="hidden" name={field.name} value={field.value} />{/each}
73
+ <FormGroup label={reasonLabel ?? t(M['commerce.pricing.reason'])} id={`${id}-reason`}>
74
+ <Textarea id={`${id}-reason`} name={reasonName} value={reason} required={reasonRequired} readonly={busy} />
75
+ </FormGroup>
76
+ {#if children}{@render children()}{/if}
77
+ <div class="decisions">{#each actions as decision}
78
+ <Button type="submit" name={decision.name} value={decision.value} formaction={decision.formAction} disabled={busy || decision.disabled}>{decision.label}</Button>
79
+ {/each}</div>
80
+ </Form>
81
+ {/if}
82
+ </section>
83
+
84
+ <style>
85
+ .pricing-decision { min-width: 0; overflow-wrap: anywhere; }
86
+ .decisions { display: flex; flex-wrap: wrap; gap: var(--smrt-spacing-3); margin-top: var(--smrt-spacing-3); }
87
+ .decisions :global(button) { max-width: 100%; white-space: normal; }
88
+ </style>
@@ -0,0 +1,35 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLFormAttributes } from 'svelte/elements';
3
+ import type { PricingDecisionAction, PricingHiddenField, PricingVersionData } from '../pricing-types.js';
4
+ export interface Props {
5
+ /** Authorized immutable version snapshot; displaying it records no decision. */
6
+ version: PricingVersionData;
7
+ /** Caller-owned native form destination. */
8
+ action: string;
9
+ /** Explicit available decisions; no acceptance/award action is inferred. */
10
+ actions: readonly PricingDecisionAction[];
11
+ /** Ordered exact hidden values, including caller-owned version/request/tenant tokens. */
12
+ hiddenFields?: readonly PricingHiddenField[];
13
+ /** Retained reason text, including text returned after a rejected action. */
14
+ reason?: string;
15
+ /** Native field name for the reason; omit to use reason. */
16
+ reasonName?: string;
17
+ /** Localized reason label override. */
18
+ reasonLabel?: string;
19
+ /** Whether the server requires a reason for these decisions. */
20
+ reasonRequired?: boolean;
21
+ /** Caller-returned form error; does not reset text or hidden identity. */
22
+ error?: string;
23
+ /** Hide mutation controls for a viewer; this is not server authorization. */
24
+ readOnly?: boolean;
25
+ /** Disable decisions while an application-controlled submission is in flight. */
26
+ busy?: boolean;
27
+ /** Optional progressive enhancement; native submission remains the default. */
28
+ onsubmit?: HTMLFormAttributes['onsubmit'];
29
+ /** Additional caller-owned native fields or decision context within the form. */
30
+ children?: Snippet;
31
+ }
32
+ declare const PricingVersionDecision: import("svelte").Component<Props, {}, "">;
33
+ type PricingVersionDecision = ReturnType<typeof PricingVersionDecision>;
34
+ export default PricingVersionDecision;
35
+ //# sourceMappingURL=PricingVersionDecision.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PricingVersionDecision.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/PricingVersionDecision.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAI7B,MAAM,WAAW,KAAK;IACpB,gFAAgF;IAChF,OAAO,EAAE,kBAAkB,CAAC;IAC5B,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC1C,yFAAyF;IACzF,YAAY,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC7C,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iFAAiF;IACjF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC1C,iFAAiF;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAwDD,QAAA,MAAM,sBAAsB,2CAAwC,CAAC;AACrE,KAAK,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACxE,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,46 @@
1
+ <script lang="ts">
2
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
3
+ import { PRICING_MESSAGES as M } from '../pricing-i18n.js';
4
+ import type { PricingVersionData } from '../pricing-types.js';
5
+ import { quoteMinorText } from '../quote-types.js';
6
+
7
+ export interface Props {
8
+ /** Immutable, authorized version data from the owning application. */
9
+ version: PricingVersionData;
10
+ }
11
+ const { version }: Props = $props();
12
+ const { t } = useI18n();
13
+ function amount(value: number | null): string {
14
+ try {
15
+ return (
16
+ quoteMinorText({ ...version.total, amountMinor: value }) ??
17
+ t(M['commerce.pricing.unknown'])
18
+ );
19
+ } catch (error) {
20
+ if (error instanceof RangeError) return t(M['commerce.pricing.unknown']);
21
+ throw error;
22
+ }
23
+ }
24
+ </script>
25
+
26
+ <section class="pricing-summary" aria-label={version.label}>
27
+ <h3>{version.label}</h3>
28
+ <p>{version.counterparty} · {version.status}</p>
29
+ <p><strong>{t(M['commerce.pricing.total'])}: {amount(version.total.amountMinor)} {version.total.currency}</strong></p>
30
+ {#if version.reason}<p>{version.reason}</p>{/if}
31
+ <h4>{t(M['commerce.pricing.sources'])}</h4>
32
+ {#if version.sources?.length}
33
+ <ul>{#each version.sources as source (source.id)}
34
+ <li><span>{source.label}</span><strong>{amount(source.amountMinor)}</strong>
35
+ {#if source.description}<p>{source.description}</p>{/if}
36
+ </li>
37
+ {/each}</ul>
38
+ {:else}<p>{t(M['commerce.pricing.no_sources'])}</p>{/if}
39
+ </section>
40
+
41
+ <style>
42
+ .pricing-summary { min-width: 0; overflow-wrap: anywhere; }
43
+ .pricing-summary ul { display: grid; gap: var(--smrt-spacing-3); padding-inline-start: var(--smrt-spacing-5); }
44
+ .pricing-summary li { min-width: 0; }
45
+ .pricing-summary li strong { display: block; }
46
+ </style>
@@ -0,0 +1,9 @@
1
+ import type { PricingVersionData } from '../pricing-types.js';
2
+ export interface Props {
3
+ /** Immutable, authorized version data from the owning application. */
4
+ version: PricingVersionData;
5
+ }
6
+ declare const PricingVersionSummary: import("svelte").Component<Props, {}, "">;
7
+ type PricingVersionSummary = ReturnType<typeof PricingVersionSummary>;
8
+ export default PricingVersionSummary;
9
+ //# sourceMappingURL=PricingVersionSummary.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PricingVersionSummary.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/PricingVersionSummary.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI9D,MAAM,WAAW,KAAK;IACpB,sEAAsE;IACtE,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAyCD,QAAA,MAAM,qBAAqB,2CAAwC,CAAC;AACpE,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACtE,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,210 @@
1
+ <script lang="ts">
2
+ import {
3
+ Checkbox,
4
+ Form,
5
+ FormGroup,
6
+ Input,
7
+ Select,
8
+ Textarea,
9
+ } from '@happyvertical/smrt-ui/forms';
10
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
11
+ import { Button } from '@happyvertical/smrt-ui/ui';
12
+ import type { Snippet } from 'svelte';
13
+ import type { HTMLFormAttributes } from 'svelte/elements';
14
+ import { P } from '../purchasing-i18n.js';
15
+ import {
16
+ type PurchaseDraftValues,
17
+ type PurchaseFieldNames,
18
+ type PurchaseReviewSnapshot,
19
+ type PurchaseSourceOption,
20
+ purchaseFieldNames,
21
+ } from '../purchasing-types.js';
22
+ import { type QuoteMoneyMinor, quoteMinorText } from '../quote-types.js';
23
+ import type { QuoteFormAttributes } from './QuoteEditor.svelte';
24
+
25
+ /** Native purchase/award preparation, review and explicit confirmation; never writes a record. */
26
+ export interface Props {
27
+ /** Caller-selected operation; reducing retains every predecessor allocation. */
28
+ operation?: 'create' | 'amend' | 'reduce';
29
+ /** Retained source. For reductions, the server must enforce predecessor/source identity. */
30
+ source: PurchaseSourceOption;
31
+ /** Currency and decimal places come from the owning financial contract. */
32
+ currency: string;
33
+ /** Explicit currency/asset scale (0–8); amounts entered in ordinary major units. */
34
+ minorUnitDigits: number;
35
+ /** Raw submitted values, including errors and explicit zero amounts. */
36
+ values: PurchaseDraftValues;
37
+ /** Caller-approved instrument choices, with no fixed construction policy. */
38
+ instruments: { value: string; label: string }[];
39
+ /** Native POST action URL. */
40
+ action: string;
41
+ /** Caller-owned tenant/request/source/predecessor IDs. */
42
+ hiddenFields?: { name: string; value: string }[];
43
+ /** Existing route field-name adaptation. */
44
+ names?: Partial<PurchaseFieldNames>;
45
+ /** Canonical field errors or allocation IDs. */
46
+ errors?: Record<string, string>;
47
+ /** Server validation or uncertain-outcome message. */
48
+ message?: string;
49
+ /** Server-produced review snapshot. Omit until explicit review succeeds. */
50
+ review?: PurchaseReviewSnapshot;
51
+ /** Previously reviewed fingerprint retained after an uncertain committed response. */
52
+ retryFingerprint?: string;
53
+ /** Presentation capability; caller must independently enforce authority. */
54
+ readonly?: boolean;
55
+ /** Disable writes while caller transport is in flight. */
56
+ busy?: boolean;
57
+ /** Native submitter names and values expected by the caller. */
58
+ intents?: { name: string; review: string; record: string; edit: string };
59
+ /** Optional row editing. Retained reduction rows cannot be removed. */
60
+ rowActions?: { add: string; removePrefix: string };
61
+ /** Caller confirmation value; a new review fingerprint requires fresh confirmation. */
62
+ confirmationValue?: string;
63
+ /** Application-specific labels, including the explicit approval statement. */
64
+ labels?: {
65
+ title?: string;
66
+ review?: string;
67
+ record?: string;
68
+ confirmation?: string;
69
+ allocations?: string;
70
+ };
71
+ /** Optional navigation URL. */
72
+ cancelHref?: string;
73
+ /** Native form enhancement; caller prevents default when handling transport. */
74
+ onsubmit?: HTMLFormAttributes['onsubmit'];
75
+ /** Native encoding/ID and caller-owned Svelte form-retry attachments. */
76
+ formAttributes?: QuoteFormAttributes;
77
+ /** Domain-specific allocation, policy or source evidence composition. */
78
+ extensions?: Snippet;
79
+ /** Authorized private attachment surface outside the editor form; never loaded by Commerce. */
80
+ attachments?: Snippet;
81
+ }
82
+ let {
83
+ operation = 'create',
84
+ source,
85
+ currency,
86
+ minorUnitDigits,
87
+ values,
88
+ instruments,
89
+ action,
90
+ hiddenFields = [],
91
+ names = {},
92
+ errors = {},
93
+ message,
94
+ review,
95
+ retryFingerprint,
96
+ readonly = false,
97
+ busy = false,
98
+ intents = {
99
+ name: 'intent',
100
+ review: 'review',
101
+ record: 'record',
102
+ edit: 'edit',
103
+ },
104
+ rowActions,
105
+ confirmationValue = 'yes',
106
+ labels = {},
107
+ cancelHref,
108
+ onsubmit,
109
+ formAttributes = {},
110
+ extensions,
111
+ attachments,
112
+ }: Props = $props();
113
+ const { t } = useI18n();
114
+ const fields = $derived({ ...purchaseFieldNames, ...names });
115
+ const title = $derived(
116
+ labels.title ??
117
+ t(
118
+ P[
119
+ operation === 'reduce'
120
+ ? 'commerce.purchase.reduce'
121
+ : operation === 'amend'
122
+ ? 'commerce.purchase.amend'
123
+ : 'commerce.purchase.create'
124
+ ],
125
+ ),
126
+ );
127
+ const fingerprint = $derived(review?.fingerprint ?? retryFingerprint);
128
+ function displayMoney(value: QuoteMoneyMinor): string {
129
+ try {
130
+ return quoteMinorText(value) ?? t(P['commerce.purchase.unknown']);
131
+ } catch (error) {
132
+ if (error instanceof RangeError)
133
+ return t(P['commerce.purchase.unavailable']);
134
+ throw error;
135
+ }
136
+ }
137
+ const money = (amountMinor: number | null) =>
138
+ displayMoney({ currency, minorUnitDigits, amountMinor });
139
+ </script>
140
+ <section class="purchase-editor" aria-label={title}>
141
+ <h2>{title}</h2>
142
+ <p>{t(P['commerce.purchase.boundary'])}</p>
143
+ <p>{source.vendor} — {source.label} · {currency}</p>
144
+ {#if source.notice}<p role="status">{source.notice}</p>{/if}
145
+ {#if operation==='reduce'}<p>{t(P['commerce.purchase.reduction_hint'])}</p>{/if}
146
+ {#if readonly}<p>{t(P['commerce.purchase.readonly'])}</p>{/if}
147
+ {#if message}<p role="alert">{message}</p>{/if}
148
+ <Form {...formAttributes} {action} method="post" {onsubmit} preventDefault={false}>
149
+ {#each hiddenFields as field}<Input type="hidden" name={field.name} value={field.value} />{/each}
150
+ <fieldset disabled={readonly || busy || source.disabled}>
151
+ <legend>{title}</legend>
152
+ <!-- The first submitter is the safe default for native Enter-in-input submission. -->
153
+ {#if !readonly}<Button type="submit" name={intents.name} value={fingerprint ? intents.record : intents.review} density="touch">{fingerprint ? labels.record??t(P['commerce.purchase.record']) : labels.review??t(P['commerce.purchase.review_button'])}</Button>{/if}
154
+ <FormGroup label={t(P['commerce.purchase.instrument'])} error={errors.instrument} required>
155
+ <Select name={fields.instrument} value={values.instrument} required density="touch">
156
+ <option value="">{t(P['commerce.purchase.choose_instrument'])}</option>
157
+ {#if values.instrument && !instruments.some(item=>item.value===values.instrument)}<option value={values.instrument}>{values.instrument}</option>{/if}
158
+ {#each instruments as item}<option value={item.value}>{item.label}</option>{/each}
159
+ </Select>
160
+ </FormGroup>
161
+ <fieldset>
162
+ <legend>{labels.allocations??t(P['commerce.purchase.allocations'])} ({currency})</legend>
163
+ {#each values.allocations as allocation (allocation.id)}
164
+ <div class="allocation">
165
+ <Input type="hidden" name={fields.allocationId} value={allocation.id} />
166
+ <FormGroup label={allocation.label} error={errors[allocation.id]} required={operation==='reduce' && allocation.retained || allocation.required}>
167
+ <Input name={fields.allocationAmount} value={allocation.amount} inputmode="decimal" required={operation==='reduce' && allocation.retained || allocation.required} density="touch" />
168
+ </FormGroup>
169
+ {#if allocation.sourceMinor !== undefined}<p>{t(P['commerce.purchase.source_amount'])}: {money(allocation.sourceMinor)} {currency}</p>{/if}
170
+ {#if allocation.minimumMinor !== undefined}<p>{t(P['commerce.purchase.minimum'])}: {money(allocation.minimumMinor)} {currency}</p>{/if}
171
+ {#if allocation.maximumMinor !== undefined}<p>{t(P['commerce.purchase.maximum'])}: {money(allocation.maximumMinor)} {currency}</p>{/if}
172
+ {#if rowActions && !readonly && !(operation==='reduce' && allocation.retained)}<Button type="submit" name={intents.name} value={`${rowActions.removePrefix}${allocation.id}`} formnovalidate variant="secondary" density="touch">{t(P['commerce.purchase.remove'],{label:allocation.label})}</Button>{/if}
173
+ </div>
174
+ {:else}<p>{t(P['commerce.purchase.empty_allocations'])}</p>{/each}
175
+ {#if rowActions && !readonly}<Button type="submit" name={intents.name} value={rowActions.add} formnovalidate variant="secondary" density="touch">{t(P['commerce.purchase.add'])}</Button>{/if}
176
+ </fieldset>
177
+ <FormGroup label={`${t(P['commerce.purchase.tax'])} (${currency})`} error={errors.tax} required><Input name={fields.tax} value={values.tax} inputmode="decimal" required density="touch" /></FormGroup>
178
+ {#each [{key:'scope',label:'commerce.purchase.scope'}, {key:'inclusions',label:'commerce.purchase.inclusions'}, {key:'exclusions',label:'commerce.purchase.exclusions'}, {key:'reason',label:'commerce.purchase.reason'}] as field}
179
+ <FormGroup label={t(P[field.label as keyof typeof P])} error={errors[field.key]} required={field.key==='scope' || field.key==='reason'}><Textarea name={fields[field.key as keyof PurchaseFieldNames]} value={values[field.key as 'scope']} required={field.key==='scope' || field.key==='reason'} /></FormGroup>
180
+ {/each}
181
+ {@render extensions?.()}
182
+ {#if fingerprint}
183
+ <h3>{t(P['commerce.purchase.review'])}</h3>
184
+ {#if review}
185
+ <p>{review.sourceLabel}</p><p>{t(P['commerce.purchase.total'])}: {displayMoney(review.total)} {review.total.currency}</p>
186
+ <p>{t(P['commerce.purchase.tax'])}: {displayMoney({...review.total,amountMinor:review.taxMinor})} {review.total.currency}</p>
187
+ <p>{review.scope}</p>{#each review.notices??[] as notice}<p role="status">{notice}</p>{/each}
188
+ {:else}<p>{t(P['commerce.purchase.uncertain'])}</p>{/if}
189
+ <Input type="hidden" name={fields.fingerprint} value={fingerprint} />
190
+ {#if !readonly}
191
+ {#key fingerprint}<Checkbox name={fields.confirmation} value={confirmationValue} label={labels.confirmation??t(P['commerce.purchase.confirm'])} required density="touch" />{/key}
192
+ <div class="actions"><Button type="submit" name={intents.name} value={intents.record} density="touch">{labels.record??t(P['commerce.purchase.record'])}</Button><Button type="submit" name={intents.name} value={intents.edit} formnovalidate variant="secondary" density="touch">{t(P['commerce.purchase.edit'])}</Button></div>
193
+ {/if}
194
+ {:else if !readonly}<Button type="submit" name={intents.name} value={intents.review} density="touch">{labels.review??t(P['commerce.purchase.review_button'])}</Button>{/if}
195
+ </fieldset>
196
+ {#if cancelHref}<Button href={cancelHref} variant="secondary" density="touch">{t(P['commerce.purchase.cancel'])}</Button>{/if}
197
+ </Form>
198
+ {#if attachments}
199
+ <fieldset class="editor-attachments" disabled={readonly || busy}>
200
+ {@render attachments()}
201
+ </fieldset>
202
+ {/if}
203
+ </section>
204
+ <style>
205
+ .editor-attachments { min-width: 0; margin: 0; padding: 0; border: 0; }
206
+ .purchase-editor{max-width:48rem;min-width:0;overflow-wrap:anywhere;color:var(--smrt-color-on-surface)}
207
+ fieldset{min-width:0;margin-block:var(--smrt-spacing-4,1rem);padding:var(--smrt-spacing-4,1rem);border:1px solid var(--smrt-color-outline-variant);border-radius:var(--smrt-radius-md,0.5rem)}
208
+ .allocation{margin-block:var(--smrt-spacing-4,1rem)}
209
+ .actions{display:flex;flex-wrap:wrap;gap:var(--smrt-spacing-3,0.75rem);margin-block:var(--smrt-spacing-4,1rem)}
210
+ </style>
@@ -0,0 +1,79 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLFormAttributes } from 'svelte/elements';
3
+ import { type PurchaseDraftValues, type PurchaseFieldNames, type PurchaseReviewSnapshot, type PurchaseSourceOption } from '../purchasing-types.js';
4
+ import type { QuoteFormAttributes } from './QuoteEditor.svelte';
5
+ /** Native purchase/award preparation, review and explicit confirmation; never writes a record. */
6
+ export interface Props {
7
+ /** Caller-selected operation; reducing retains every predecessor allocation. */
8
+ operation?: 'create' | 'amend' | 'reduce';
9
+ /** Retained source. For reductions, the server must enforce predecessor/source identity. */
10
+ source: PurchaseSourceOption;
11
+ /** Currency and decimal places come from the owning financial contract. */
12
+ currency: string;
13
+ /** Explicit currency/asset scale (0–8); amounts entered in ordinary major units. */
14
+ minorUnitDigits: number;
15
+ /** Raw submitted values, including errors and explicit zero amounts. */
16
+ values: PurchaseDraftValues;
17
+ /** Caller-approved instrument choices, with no fixed construction policy. */
18
+ instruments: {
19
+ value: string;
20
+ label: string;
21
+ }[];
22
+ /** Native POST action URL. */
23
+ action: string;
24
+ /** Caller-owned tenant/request/source/predecessor IDs. */
25
+ hiddenFields?: {
26
+ name: string;
27
+ value: string;
28
+ }[];
29
+ /** Existing route field-name adaptation. */
30
+ names?: Partial<PurchaseFieldNames>;
31
+ /** Canonical field errors or allocation IDs. */
32
+ errors?: Record<string, string>;
33
+ /** Server validation or uncertain-outcome message. */
34
+ message?: string;
35
+ /** Server-produced review snapshot. Omit until explicit review succeeds. */
36
+ review?: PurchaseReviewSnapshot;
37
+ /** Previously reviewed fingerprint retained after an uncertain committed response. */
38
+ retryFingerprint?: string;
39
+ /** Presentation capability; caller must independently enforce authority. */
40
+ readonly?: boolean;
41
+ /** Disable writes while caller transport is in flight. */
42
+ busy?: boolean;
43
+ /** Native submitter names and values expected by the caller. */
44
+ intents?: {
45
+ name: string;
46
+ review: string;
47
+ record: string;
48
+ edit: string;
49
+ };
50
+ /** Optional row editing. Retained reduction rows cannot be removed. */
51
+ rowActions?: {
52
+ add: string;
53
+ removePrefix: string;
54
+ };
55
+ /** Caller confirmation value; a new review fingerprint requires fresh confirmation. */
56
+ confirmationValue?: string;
57
+ /** Application-specific labels, including the explicit approval statement. */
58
+ labels?: {
59
+ title?: string;
60
+ review?: string;
61
+ record?: string;
62
+ confirmation?: string;
63
+ allocations?: string;
64
+ };
65
+ /** Optional navigation URL. */
66
+ cancelHref?: string;
67
+ /** Native form enhancement; caller prevents default when handling transport. */
68
+ onsubmit?: HTMLFormAttributes['onsubmit'];
69
+ /** Native encoding/ID and caller-owned Svelte form-retry attachments. */
70
+ formAttributes?: QuoteFormAttributes;
71
+ /** Domain-specific allocation, policy or source evidence composition. */
72
+ extensions?: Snippet;
73
+ /** Authorized private attachment surface outside the editor form; never loaded by Commerce. */
74
+ attachments?: Snippet;
75
+ }
76
+ declare const PurchaseOrderEditor: import("svelte").Component<Props, {}, "">;
77
+ type PurchaseOrderEditor = ReturnType<typeof PurchaseOrderEditor>;
78
+ export default PurchaseOrderEditor;
79
+ //# sourceMappingURL=PurchaseOrderEditor.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PurchaseOrderEditor.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/PurchaseOrderEditor.svelte.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAE1B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,kGAAkG;AAClG,MAAM,WAAW,KAAK;IACpB,gFAAgF;IAChF,SAAS,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC1C,4FAA4F;IAC5F,MAAM,EAAE,oBAAoB,CAAC;IAC7B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,eAAe,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,MAAM,EAAE,mBAAmB,CAAC;IAC5B,6EAA6E;IAC7E,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAChD,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjD,4CAA4C;IAC5C,KAAK,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACpC,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gEAAgE;IAChE,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACzE,uEAAuE;IACvE,UAAU,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,uFAAuF;IACvF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,8EAA8E;IAC9E,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,+BAA+B;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC1C,yEAAyE;IACzE,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,yEAAyE;IACzE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA0ID,QAAA,MAAM,mBAAmB,2CAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,56 @@
1
+ <script lang="ts">
2
+ import { Form, FormGroup, Input, Select } from '@happyvertical/smrt-ui/forms';
3
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
4
+ import { Button } from '@happyvertical/smrt-ui/ui';
5
+ import type { HTMLFormAttributes } from 'svelte/elements';
6
+ import { P } from '../purchasing-i18n.js';
7
+ import type { PurchaseSourceOption } from '../purchasing-types.js';
8
+ /** Native source discovery; choosing a source never records a purchase or award. */
9
+ export interface Props {
10
+ /** Authorized source options with caller-owned availability and labels. */
11
+ sources: PurchaseSourceOption[];
12
+ /** Selected source ID retained after a failed action. */
13
+ value?: string;
14
+ /** Native source-selection endpoint. */
15
+ action: string;
16
+ /** Field name expected by the caller's route. */
17
+ name?: string;
18
+ /** Caller-owned search/context fields. */
19
+ hiddenFields?: { name: string; value: string }[];
20
+ /** Presentation-only disabled capability. */
21
+ disabled?: boolean;
22
+ /** Optional field validation error. */
23
+ error?: string;
24
+ /** Optional localized field label. */
25
+ label?: string;
26
+ /** Optional caller enhancement; native GET remains enabled by default. */
27
+ onsubmit?: HTMLFormAttributes['onsubmit'];
28
+ }
29
+ let {
30
+ sources,
31
+ value = '',
32
+ action,
33
+ name = 'source',
34
+ hiddenFields = [],
35
+ disabled = false,
36
+ error,
37
+ label,
38
+ onsubmit,
39
+ }: Props = $props();
40
+ const { t } = useI18n();
41
+ </script>
42
+ <div class="purchase-source">
43
+ <Form {action} {onsubmit} method="get" preventDefault={false}>
44
+ {#each hiddenFields as field}<Input type="hidden" name={field.name} value={field.value} />{/each}
45
+ <FormGroup label={label ?? t(P['commerce.purchase.source'])} {error} required>
46
+ <Select {name} {value} disabled={disabled || sources.every(source=>source.disabled)} required density="touch">
47
+ <option value="">{t(P['commerce.purchase.choose'])}</option>
48
+ {#if value && !sources.some(source=>source.id===value)}<option value={value} disabled>{value}</option>{/if}
49
+ {#each sources as source}<option value={source.id} disabled={source.disabled}>{source.vendor} — {source.label}{source.notice ? ` (${source.notice})` : ''}</option>{/each}
50
+ </Select>
51
+ </FormGroup>
52
+ {#if sources.length===0}<p>{t(P['commerce.purchase.empty_sources'])}</p>{/if}
53
+ <Button type="submit" disabled={disabled || sources.every(source=>source.disabled)} density="touch">{t(P['commerce.purchase.use'])}</Button>
54
+ </Form>
55
+ </div>
56
+ <style>.purchase-source{max-width:48rem;min-width:0;overflow-wrap:anywhere;color:var(--smrt-color-on-surface)}</style>
@@ -0,0 +1,30 @@
1
+ import type { HTMLFormAttributes } from 'svelte/elements';
2
+ import type { PurchaseSourceOption } from '../purchasing-types.js';
3
+ /** Native source discovery; choosing a source never records a purchase or award. */
4
+ export interface Props {
5
+ /** Authorized source options with caller-owned availability and labels. */
6
+ sources: PurchaseSourceOption[];
7
+ /** Selected source ID retained after a failed action. */
8
+ value?: string;
9
+ /** Native source-selection endpoint. */
10
+ action: string;
11
+ /** Field name expected by the caller's route. */
12
+ name?: string;
13
+ /** Caller-owned search/context fields. */
14
+ hiddenFields?: {
15
+ name: string;
16
+ value: string;
17
+ }[];
18
+ /** Presentation-only disabled capability. */
19
+ disabled?: boolean;
20
+ /** Optional field validation error. */
21
+ error?: string;
22
+ /** Optional localized field label. */
23
+ label?: string;
24
+ /** Optional caller enhancement; native GET remains enabled by default. */
25
+ onsubmit?: HTMLFormAttributes['onsubmit'];
26
+ }
27
+ declare const PurchaseSourceSelector: import("svelte").Component<Props, {}, "">;
28
+ type PurchaseSourceSelector = ReturnType<typeof PurchaseSourceSelector>;
29
+ export default PurchaseSourceSelector;
30
+ //# sourceMappingURL=PurchaseSourceSelector.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PurchaseSourceSelector.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/PurchaseSourceSelector.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,oFAAoF;AACpF,MAAM,WAAW,KAAK;IACpB,2EAA2E;IAC3E,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjD,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;CAC3C;AAwCD,QAAA,MAAM,sBAAsB,2CAAwC,CAAC;AACrE,KAAK,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACxE,eAAe,sBAAsB,CAAC"}