@asteby/metacore-runtime-react 53.24.0 → 53.26.0

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 (383) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/action-modal-dispatcher.d.ts +3 -3
  3. package/dist/action-modal-dispatcher.js +31 -31
  4. package/dist/action-priority.d.ts +1 -1
  5. package/dist/activity-diff.d.ts +1 -1
  6. package/dist/activity-diff.js +1 -1
  7. package/dist/activity-timeline.d.ts +2 -2
  8. package/dist/activity-timeline.js +3 -3
  9. package/dist/activity-value-renderer.d.ts +1 -1
  10. package/dist/activity-value-renderer.js +3 -3
  11. package/dist/addon-loader.d.ts +1 -1
  12. package/dist/addon-loader.js +3 -3
  13. package/dist/addon-page-host.js +1 -1
  14. package/dist/addon-page-loader.d.ts +2 -2
  15. package/dist/addon-page-loader.js +3 -3
  16. package/dist/api-context.js +4 -4
  17. package/dist/approval-gate.d.ts +1 -1
  18. package/dist/approval-gate.js +5 -5
  19. package/dist/assist-interview.d.ts +1 -1
  20. package/dist/assist-interview.js +1 -1
  21. package/dist/attention/index.d.ts +3 -3
  22. package/dist/attention/index.js +3 -3
  23. package/dist/attention/use-nav-badges.js +2 -2
  24. package/dist/attribute-classes.d.ts +1 -1
  25. package/dist/audit-info.d.ts +1 -1
  26. package/dist/audit-info.js +5 -5
  27. package/dist/bulk-image-dialog.d.ts +1 -1
  28. package/dist/bulk-image-dialog.js +5 -5
  29. package/dist/bulk-image-import.d.ts +2 -2
  30. package/dist/bulk-image-import.js +1 -1
  31. package/dist/bulk-image-target.d.ts +1 -1
  32. package/dist/bulk-image-target.js +1 -1
  33. package/dist/bulk-image-wizard.d.ts +1 -1
  34. package/dist/bulk-image-wizard.js +5 -5
  35. package/dist/business/catalog-product-search.d.ts +1 -1
  36. package/dist/business/customer-picker.js +4 -4
  37. package/dist/business/document-editor-model.d.ts +3 -3
  38. package/dist/business/document-editor-model.js +4 -4
  39. package/dist/business/document-editor-panels.d.ts +3 -3
  40. package/dist/business/document-editor-panels.js +1 -1
  41. package/dist/business/document-editor.d.ts +2 -2
  42. package/dist/business/document-editor.js +22 -22
  43. package/dist/business/document-lines.d.ts +2 -2
  44. package/dist/business/document-lines.js +3 -3
  45. package/dist/business/field-errors.d.ts +1 -1
  46. package/dist/business/field-errors.js +1 -1
  47. package/dist/business/format.js +1 -1
  48. package/dist/business/index.d.ts +29 -29
  49. package/dist/business/index.js +29 -29
  50. package/dist/business/inspection-checklist.d.ts +1 -1
  51. package/dist/business/inspection-checklist.js +2 -2
  52. package/dist/business/inspection.d.ts +1 -1
  53. package/dist/business/inspection.js +2 -2
  54. package/dist/business/line-items-editor.d.ts +3 -3
  55. package/dist/business/line-items-editor.js +5 -5
  56. package/dist/business/line-items.d.ts +1 -1
  57. package/dist/business/line-items.js +2 -2
  58. package/dist/business/line-product-cell.d.ts +2 -2
  59. package/dist/business/line-product-cell.js +2 -2
  60. package/dist/business/payment-allocator.d.ts +1 -1
  61. package/dist/business/payment-allocator.js +2 -2
  62. package/dist/business/payment-capture.d.ts +1 -1
  63. package/dist/business/payment-capture.js +3 -3
  64. package/dist/business/payment.js +1 -1
  65. package/dist/business/print-send-dialog.js +1 -1
  66. package/dist/business/product-display.d.ts +1 -1
  67. package/dist/business/product-options.d.ts +1 -1
  68. package/dist/business/product-options.js +4 -4
  69. package/dist/business/product-picker.d.ts +1 -1
  70. package/dist/business/product-picker.js +3 -3
  71. package/dist/business/product-search.d.ts +2 -2
  72. package/dist/business/product-search.js +1 -1
  73. package/dist/business/refund-destination.d.ts +1 -1
  74. package/dist/business/refund-destination.js +2 -2
  75. package/dist/business/refund.js +1 -1
  76. package/dist/business/relate-documents.js +1 -1
  77. package/dist/business/return-wizard.d.ts +2 -2
  78. package/dist/business/return-wizard.js +4 -4
  79. package/dist/business/return.d.ts +2 -2
  80. package/dist/business/return.js +2 -2
  81. package/dist/business/vehicle-picker.js +3 -3
  82. package/dist/cache-coherence.js +3 -3
  83. package/dist/capability-providers/index.d.ts +3 -3
  84. package/dist/capability-providers/index.js +3 -3
  85. package/dist/capability-providers/provider-sortable-list.d.ts +1 -1
  86. package/dist/capability-providers/provider-sortable-list.js +1 -1
  87. package/dist/collection-cell.js +1 -1
  88. package/dist/column-filter-field.d.ts +1 -1
  89. package/dist/column-visibility.d.ts +1 -1
  90. package/dist/custom-stages.d.ts +2 -2
  91. package/dist/custom-stages.js +1 -1
  92. package/dist/dashboard-grid.d.ts +2 -2
  93. package/dist/dashboard-grid.d.ts.map +1 -1
  94. package/dist/dashboard-grid.js +22 -20
  95. package/dist/dashboard-types.d.ts +6 -0
  96. package/dist/dashboard-types.d.ts.map +1 -1
  97. package/dist/dialogs/create-record-dialog.d.ts +1 -1
  98. package/dist/dialogs/create-record-dialog.js +1 -1
  99. package/dist/dialogs/dynamic-record.d.ts +5 -5
  100. package/dist/dialogs/dynamic-record.js +41 -41
  101. package/dist/dialogs/export.d.ts +1 -1
  102. package/dist/dialogs/export.js +2 -2
  103. package/dist/dialogs/import.d.ts +1 -1
  104. package/dist/dialogs/import.js +3 -3
  105. package/dist/dialogs/inline-relation-rows.d.ts +3 -3
  106. package/dist/dialogs/inline-relation-rows.js +3 -3
  107. package/dist/dialogs/inline-relations.d.ts +3 -3
  108. package/dist/dialogs/inline-relations.js +3 -3
  109. package/dist/dialogs/normalize-submit.d.ts +1 -1
  110. package/dist/dialogs/normalize-submit.js +3 -3
  111. package/dist/dialogs/use-inline-relations.d.ts +1 -1
  112. package/dist/dialogs/use-inline-relations.js +3 -3
  113. package/dist/dialogs/view-record-dialog.d.ts +1 -1
  114. package/dist/dialogs/view-record-dialog.js +1 -1
  115. package/dist/display-value.js +1 -1
  116. package/dist/document/action-bar.d.ts +1 -1
  117. package/dist/document/action-bar.js +1 -1
  118. package/dist/document/document-header.d.ts +2 -2
  119. package/dist/document/document-header.js +2 -2
  120. package/dist/document/document-page.d.ts +3 -3
  121. package/dist/document/document-page.js +9 -9
  122. package/dist/document/document-timeline.d.ts +2 -2
  123. package/dist/document/document-timeline.js +2 -2
  124. package/dist/document/evaluate.d.ts +1 -1
  125. package/dist/document/evaluate.js +1 -1
  126. package/dist/document/format.d.ts +1 -1
  127. package/dist/document/index.d.ts +13 -13
  128. package/dist/document/index.js +13 -13
  129. package/dist/document/registry.d.ts +1 -1
  130. package/dist/document/secondary-bar.js +2 -2
  131. package/dist/document/smart-buttons.js +1 -1
  132. package/dist/document/status-badge.d.ts +1 -1
  133. package/dist/document/use-document-sources.d.ts +1 -1
  134. package/dist/document/use-document-sources.js +2 -2
  135. package/dist/document-form-dialog.d.ts +2 -2
  136. package/dist/document-form-dialog.js +16 -16
  137. package/dist/document-template-editor.js +1 -1
  138. package/dist/dynamic-columns-shim.d.ts +1 -1
  139. package/dist/dynamic-columns.d.ts +11 -3
  140. package/dist/dynamic-columns.d.ts.map +1 -1
  141. package/dist/dynamic-columns.js +52 -26
  142. package/dist/dynamic-crud-page.d.ts +2 -2
  143. package/dist/dynamic-crud-page.d.ts.map +1 -1
  144. package/dist/dynamic-crud-page.js +22 -19
  145. package/dist/dynamic-date-field.d.ts +1 -1
  146. package/dist/dynamic-date-field.js +1 -1
  147. package/dist/dynamic-form-schema.d.ts +2 -2
  148. package/dist/dynamic-form-schema.js +4 -4
  149. package/dist/dynamic-form.d.ts +10 -10
  150. package/dist/dynamic-form.js +24 -24
  151. package/dist/dynamic-icon.js +1 -1
  152. package/dist/dynamic-kanban.d.ts +3 -3
  153. package/dist/dynamic-kanban.js +25 -25
  154. package/dist/dynamic-line-items.d.ts +1 -1
  155. package/dist/dynamic-line-items.js +6 -6
  156. package/dist/dynamic-multi-select-field.d.ts +1 -1
  157. package/dist/dynamic-multi-select-field.js +7 -7
  158. package/dist/dynamic-relation-helpers.d.ts +1 -1
  159. package/dist/dynamic-relation-helpers.js +2 -2
  160. package/dist/dynamic-relation.d.ts +2 -2
  161. package/dist/dynamic-relation.js +15 -15
  162. package/dist/dynamic-relations.d.ts +2 -2
  163. package/dist/dynamic-relations.js +1 -1
  164. package/dist/dynamic-row-actions.d.ts +1 -1
  165. package/dist/dynamic-row-actions.js +5 -5
  166. package/dist/dynamic-select-field.d.ts +3 -3
  167. package/dist/dynamic-select-field.js +11 -11
  168. package/dist/dynamic-table.d.ts +5 -3
  169. package/dist/dynamic-table.d.ts.map +1 -1
  170. package/dist/dynamic-table.js +48 -36
  171. package/dist/dynamic-view.d.ts +4 -4
  172. package/dist/dynamic-view.js +7 -7
  173. package/dist/entity-select.js +4 -4
  174. package/dist/field-validation-ui.d.ts +2 -2
  175. package/dist/field-widget-registry.d.ts +1 -1
  176. package/dist/form-layout-ui.d.ts +1 -1
  177. package/dist/form-layout.d.ts +1 -1
  178. package/dist/form-layout.js +1 -1
  179. package/dist/genui/index.d.ts +1 -1
  180. package/dist/genui/index.js +1 -1
  181. package/dist/genui/settings-block.d.ts +1 -1
  182. package/dist/genui/settings-block.js +3 -3
  183. package/dist/host-api-client.d.ts +11 -1
  184. package/dist/host-api-client.d.ts.map +1 -1
  185. package/dist/host-api-client.js +21 -14
  186. package/dist/host-api.d.ts +9 -1
  187. package/dist/host-api.d.ts.map +1 -1
  188. package/dist/host-api.js +57 -2
  189. package/dist/hotswap-reload-policy.d.ts +1 -1
  190. package/dist/hotswap-reload-policy.js +1 -1
  191. package/dist/icon-picker-field.d.ts +1 -1
  192. package/dist/icon-picker-field.js +3 -3
  193. package/dist/icon-resolvers.d.ts +1 -1
  194. package/dist/icon-resolvers.js +1 -1
  195. package/dist/icon-spec.js +1 -1
  196. package/dist/index.d.ts +165 -163
  197. package/dist/index.d.ts.map +1 -1
  198. package/dist/index.js +148 -147
  199. package/dist/license/index.d.ts +6 -6
  200. package/dist/license/index.js +6 -6
  201. package/dist/license/license-expiry-banner.d.ts +1 -1
  202. package/dist/license/license-expiry-banner.js +3 -3
  203. package/dist/license/license-gate.d.ts +1 -1
  204. package/dist/license/license-gate.js +5 -5
  205. package/dist/license/license-status-badge.d.ts +1 -1
  206. package/dist/license/license-status-badge.js +1 -1
  207. package/dist/license/use-license-t.d.ts +1 -1
  208. package/dist/license/use-license-t.js +1 -1
  209. package/dist/license/view.d.ts +1 -1
  210. package/dist/license/view.js +1 -1
  211. package/dist/list-include.d.ts +1 -1
  212. package/dist/manifest-hotswap-subscriber.d.ts +1 -1
  213. package/dist/manifest-hotswap-subscriber.js +1 -1
  214. package/dist/metadata-cache.d.ts +1 -1
  215. package/dist/metadata-cache.js +1 -1
  216. package/dist/model-action-toolbar.d.ts +1 -1
  217. package/dist/model-action-toolbar.js +7 -7
  218. package/dist/model-labels.d.ts +38 -0
  219. package/dist/model-labels.d.ts.map +1 -0
  220. package/dist/model-labels.js +35 -0
  221. package/dist/nav-permissions.d.ts +1 -1
  222. package/dist/nav-permissions.js +1 -1
  223. package/dist/navigation-builder.d.ts +1 -1
  224. package/dist/navigation-builder.js +1 -1
  225. package/dist/option-display.d.ts +1 -1
  226. package/dist/option-display.js +2 -2
  227. package/dist/option-filter.d.ts +1 -1
  228. package/dist/option-when.d.ts +1 -1
  229. package/dist/org-runtime-provider.d.ts +2 -2
  230. package/dist/org-runtime-provider.js +2 -2
  231. package/dist/permissions-context.d.ts +1 -1
  232. package/dist/permissions-manager.js +4 -4
  233. package/dist/primitives/aging.js +1 -1
  234. package/dist/primitives/allocation.js +1 -1
  235. package/dist/primitives/approvals.d.ts +1 -1
  236. package/dist/primitives/contributions.js +1 -1
  237. package/dist/primitives/document-kinds.d.ts +1 -1
  238. package/dist/primitives/index.d.ts +7 -7
  239. package/dist/primitives/index.js +7 -7
  240. package/dist/primitives/panels.d.ts +1 -1
  241. package/dist/primitives/use-contributions.d.ts +2 -2
  242. package/dist/primitives/use-contributions.js +2 -2
  243. package/dist/print-document-button.d.ts +1 -1
  244. package/dist/print-document-button.js +1 -1
  245. package/dist/provenance.js +3 -3
  246. package/dist/query-batch.d.ts +1 -1
  247. package/dist/query-batch.js +1 -1
  248. package/dist/record-actions.d.ts +2 -2
  249. package/dist/record-actions.js +2 -2
  250. package/dist/record-history.d.ts +2 -2
  251. package/dist/record-history.js +3 -3
  252. package/dist/record-picker-dialog.js +3 -3
  253. package/dist/record-picker-option.d.ts +1 -1
  254. package/dist/record-picker-option.js +1 -1
  255. package/dist/record-picker.js +2 -2
  256. package/dist/record-prefill-bar.js +1 -1
  257. package/dist/relation-gallery.js +1 -1
  258. package/dist/requires-addon.d.ts +1 -1
  259. package/dist/rich-cells.js +2 -2
  260. package/dist/rich-url.js +1 -1
  261. package/dist/row-actions-menu.js +5 -5
  262. package/dist/server-error.js +2 -2
  263. package/dist/setup/addon-config-surface.d.ts +3 -3
  264. package/dist/setup/addon-config-surface.js +10 -10
  265. package/dist/setup/connector-blocks-model.d.ts +1 -1
  266. package/dist/setup/connector-blocks.d.ts +1 -1
  267. package/dist/setup/connector-blocks.js +6 -6
  268. package/dist/setup/flow-model.d.ts +1 -1
  269. package/dist/setup/health-card.d.ts +1 -1
  270. package/dist/setup/health-card.js +2 -2
  271. package/dist/setup/index.d.ts +12 -12
  272. package/dist/setup/index.js +12 -12
  273. package/dist/setup/records-table.d.ts +1 -1
  274. package/dist/setup/records-table.js +2 -2
  275. package/dist/setup/setup-flow.d.ts +1 -1
  276. package/dist/setup/setup-flow.js +7 -7
  277. package/dist/setup/setup-form-step.d.ts +1 -1
  278. package/dist/setup/setup-form-step.js +4 -4
  279. package/dist/setup/step-status-badge.d.ts +1 -1
  280. package/dist/setup/step-status-badge.js +2 -2
  281. package/dist/setup/tone.d.ts +1 -1
  282. package/dist/setup/types.d.ts +2 -2
  283. package/dist/sidebar-layout-manager.d.ts +1 -1
  284. package/dist/sidebar-layout-manager.js +2 -2
  285. package/dist/slot.js +1 -1
  286. package/dist/slots/addon-slot.js +4 -4
  287. package/dist/slots/index.d.ts +2 -2
  288. package/dist/slots/index.js +2 -2
  289. package/dist/stage-automations.d.ts +2 -2
  290. package/dist/stage-automations.js +1 -1
  291. package/dist/stage-layout.js +1 -1
  292. package/dist/stage-overrides.d.ts +1 -1
  293. package/dist/stage-overrides.js +1 -1
  294. package/dist/supervised-action.js +1 -1
  295. package/dist/testing.d.ts +1 -1
  296. package/dist/testing.js +1 -1
  297. package/dist/tri-state-boolean.d.ts +2 -2
  298. package/dist/tri-state-boolean.js +1 -1
  299. package/dist/types.d.ts +4 -1
  300. package/dist/types.d.ts.map +1 -1
  301. package/dist/upload-field.d.ts +1 -1
  302. package/dist/upload-field.js +4 -4
  303. package/dist/use-addon-installed-probe.js +3 -3
  304. package/dist/use-addon-settings.d.ts +1 -1
  305. package/dist/use-addon-settings.js +1 -1
  306. package/dist/use-dynamic-filters.d.ts +2 -2
  307. package/dist/use-dynamic-filters.js +6 -6
  308. package/dist/use-edge-device.d.ts +1 -1
  309. package/dist/use-edge-device.js +2 -2
  310. package/dist/use-facet-loaders.d.ts +1 -1
  311. package/dist/use-facet-loaders.js +1 -1
  312. package/dist/use-flip-animation.d.ts +1 -1
  313. package/dist/use-flip-animation.js +1 -1
  314. package/dist/use-host-api-client.d.ts +2 -2
  315. package/dist/use-host-api-client.d.ts.map +1 -1
  316. package/dist/use-host-api-client.js +6 -4
  317. package/dist/use-option-ids.d.ts +1 -1
  318. package/dist/use-option-ids.js +2 -2
  319. package/dist/use-options-resolver.d.ts +2 -2
  320. package/dist/use-options-resolver.js +4 -4
  321. package/dist/use-org-document-templates.js +1 -1
  322. package/dist/use-print-document.js +1 -1
  323. package/dist/use-record-mutation-tick.js +1 -1
  324. package/dist/validator.d.ts +2 -2
  325. package/dist/validator.js +1 -1
  326. package/dist/view-system/card-spec.d.ts +1 -1
  327. package/dist/view-system/cards-view.d.ts +1 -1
  328. package/dist/view-system/cards-view.js +2 -2
  329. package/dist/view-system/index.d.ts +9 -9
  330. package/dist/view-system/index.js +9 -9
  331. package/dist/view-system/model-view.d.ts +3 -3
  332. package/dist/view-system/model-view.js +7 -7
  333. package/dist/view-system/saved-views.d.ts +1 -1
  334. package/dist/view-system/use-view-mode.d.ts +1 -1
  335. package/dist/view-system/view-state.d.ts +1 -1
  336. package/dist/view-system/view-switcher.d.ts +1 -1
  337. package/dist/view-system/view-toolbar.d.ts +1 -1
  338. package/dist/view-system/view-toolbar.js +2 -2
  339. package/dist/views/calendar-view.d.ts +1 -1
  340. package/dist/views/calendar-view.js +2 -2
  341. package/dist/views/chart-view.d.ts +2 -2
  342. package/dist/views/chart-view.js +2 -2
  343. package/dist/views/data-source.d.ts +2 -2
  344. package/dist/views/index.d.ts +3 -3
  345. package/dist/views/index.js +2 -2
  346. package/dist/views/map-view.d.ts +1 -1
  347. package/dist/views/map-view.js +3 -3
  348. package/dist/views/panels.d.ts +1 -1
  349. package/dist/views/panels.js +3 -3
  350. package/dist/views/registry.d.ts +2 -2
  351. package/dist/views/registry.js +12 -12
  352. package/dist/views/split-view.d.ts +1 -1
  353. package/dist/views/split-view.js +4 -4
  354. package/dist/views/timeline-view.d.ts +1 -1
  355. package/dist/views/timeline-view.js +3 -3
  356. package/dist/views/types.d.ts +2 -2
  357. package/dist/widgets/charts.d.ts +1 -1
  358. package/dist/widgets/charts.js +2 -2
  359. package/dist/widgets/lazy-charts.d.ts +1 -1
  360. package/dist/widgets/lazy-charts.js +2 -2
  361. package/dist/widgets/renderers.d.ts +2 -2
  362. package/dist/widgets/renderers.js +2 -2
  363. package/dist/widgets/widget-card.d.ts +1 -1
  364. package/dist/widgets/widget-card.js +2 -2
  365. package/dist/widgets/widget-renderer.d.ts +1 -1
  366. package/dist/widgets/widget-renderer.js +4 -4
  367. package/package.json +10 -10
  368. package/src/__tests__/host-api-client.test.tsx +16 -0
  369. package/src/__tests__/host-api.test.ts +50 -0
  370. package/src/__tests__/initials-avatar-cell.test.tsx +54 -0
  371. package/src/__tests__/load-guard.test.tsx +94 -0
  372. package/src/__tests__/model-labels.test.tsx +31 -0
  373. package/src/dashboard-grid.tsx +49 -35
  374. package/src/dashboard-types.ts +6 -0
  375. package/src/dynamic-columns.tsx +40 -9
  376. package/src/dynamic-crud-page.tsx +10 -7
  377. package/src/dynamic-table.tsx +38 -12
  378. package/src/host-api-client.ts +31 -14
  379. package/src/host-api.ts +54 -1
  380. package/src/index.ts +5 -1
  381. package/src/model-labels.ts +80 -0
  382. package/src/types.ts +3 -0
  383. package/src/use-host-api-client.ts +5 -3
@@ -23,28 +23,28 @@ import { useTranslation } from 'react-i18next';
23
23
  import { Button } from '@asteby/metacore-ui/primitives';
24
24
  import { Loader2, ReceiptText } from 'lucide-react';
25
25
  import { toast } from 'sonner';
26
- import { useApi } from '../api-context';
27
- import { useOrgTaxRate, useTimeZone } from '../org-runtime-context';
28
- import { FieldCell, FieldGrid, FieldLabel } from '../field-grid';
29
- import { FormErrorBanner } from './feedback';
30
- import { DocumentLinesGrid } from './line-items-editor';
31
- import { computeTotals, serializeLineItems, taxBreakdown } from './line-items';
32
- import { roundMoney, toAmount, useFormatter } from './format';
33
- import { catalogRecordToProduct, createCatalogProductSearch } from './catalog-product-search';
34
- import { withOptionDisplays } from './product-display';
35
- import { requestRecordCreate, requestRecordEdit, withSearchPrefill } from '../record-picker-actions';
36
- import { allocationAmountField, allocationIssueMessages, allocationPayload, creditStatus, editorLinesConfig, fieldDisplayMeta, linesFromSource, localIssues, sourceLoadSummary, sourceTracksRemaining, partyDefaults, partySummaryRows, recordLabel, seedRecord, sourceHeaderSeeds, splitEditorFields, toOpenDocuments, friendlyOptionLabel, gatedOptionFixes, gatedOptions, withFriendlyOptions, } from './document-editor-model';
37
- import { CollapsibleSection, DraftPreview, EditorSection, PartyCard, PreviewPanel, TotalsPanel, ValidationChecklist, } from './document-editor-panels';
38
- import { PaymentAllocator } from './payment-allocator';
39
- import { actionErrorBannerMessage, buildFieldDefaults, prefillFromFieldRelationRequest, renderField } from '../action-modal-dispatcher';
40
- import { extractFieldErrors, localizeFieldErrorMap } from '../server-error';
41
- import { validateValues, bagHasErrors } from '../validator';
42
- import { clearFieldErrorTree } from '../field-validation-ui';
43
- import { emitRecordMutation } from '../record-mutation-events';
44
- import { evaluateVisibleWhen, getVisibleWhen } from '../dynamic-form-schema';
45
- import { useInstalledAddons } from '../installed-addons-context';
46
- import { allocatePayment, validateAllocation } from '../primitives/allocation';
47
- import { useDocumentContributions } from '../primitives/use-contributions';
26
+ import { useApi } from '../api-context.js';
27
+ import { useOrgTaxRate, useTimeZone } from '../org-runtime-context.js';
28
+ import { FieldCell, FieldGrid, FieldLabel } from '../field-grid.js';
29
+ import { FormErrorBanner } from './feedback.js';
30
+ import { DocumentLinesGrid } from './line-items-editor.js';
31
+ import { computeTotals, serializeLineItems, taxBreakdown } from './line-items.js';
32
+ import { roundMoney, toAmount, useFormatter } from './format.js';
33
+ import { catalogRecordToProduct, createCatalogProductSearch } from './catalog-product-search.js';
34
+ import { withOptionDisplays } from './product-display.js';
35
+ import { requestRecordCreate, requestRecordEdit, withSearchPrefill } from '../record-picker-actions.js';
36
+ import { allocationAmountField, allocationIssueMessages, allocationPayload, creditStatus, editorLinesConfig, fieldDisplayMeta, linesFromSource, localIssues, sourceLoadSummary, sourceTracksRemaining, partyDefaults, partySummaryRows, recordLabel, seedRecord, sourceHeaderSeeds, splitEditorFields, toOpenDocuments, friendlyOptionLabel, gatedOptionFixes, gatedOptions, withFriendlyOptions, } from './document-editor-model.js';
37
+ import { CollapsibleSection, DraftPreview, EditorSection, PartyCard, PreviewPanel, TotalsPanel, ValidationChecklist, } from './document-editor-panels.js';
38
+ import { PaymentAllocator } from './payment-allocator.js';
39
+ import { actionErrorBannerMessage, buildFieldDefaults, prefillFromFieldRelationRequest, renderField } from '../action-modal-dispatcher.js';
40
+ import { extractFieldErrors, localizeFieldErrorMap } from '../server-error.js';
41
+ import { validateValues, bagHasErrors } from '../validator.js';
42
+ import { clearFieldErrorTree } from '../field-validation-ui.js';
43
+ import { emitRecordMutation } from '../record-mutation-events.js';
44
+ import { evaluateVisibleWhen, getVisibleWhen } from '../dynamic-form-schema.js';
45
+ import { useInstalledAddons } from '../installed-addons-context.js';
46
+ import { allocatePayment, validateAllocation } from '../primitives/allocation.js';
47
+ import { useDocumentContributions } from '../primitives/use-contributions.js';
48
48
  export function DocumentEditor({ model, endpoint, forms, type, record, initialSource, onSaved, onCancel, searchProducts, productModel, productLabelField = 'name', defaultTaxRate, currency, today, fullscreen = false, }) {
49
49
  const { t, i18n } = useTranslation();
50
50
  const lang = i18n?.language;
@@ -1,5 +1,5 @@
1
- import { type CatalogLineField, type LineItem } from './line-items';
2
- import { type ProductResult, type ProductVariant } from './product-search';
1
+ import { type CatalogLineField, type LineItem } from './line-items.js';
2
+ import { type ProductResult, type ProductVariant } from './product-search.js';
3
3
  export type PriceSource = 'sale' | 'cost' | 'origin';
4
4
  export type DocumentLinesMode = 'free' | 'from_source';
5
5
  /** Precio que se escribe en el renglón según el documento. */
@@ -1,8 +1,8 @@
1
1
  // Helpers del editor único de renglones (DocumentLinesGrid / LineItemsEditor).
2
2
  // Puros: el componente solo pinta. `serializeLineItems` sigue siendo la puerta al backend.
3
- import { toAmount } from './format';
4
- import { CATALOG_LINE_FIELDS, makeLine } from './line-items';
5
- import { availableStock } from './product-search';
3
+ import { toAmount } from './format.js';
4
+ import { CATALOG_LINE_FIELDS, makeLine } from './line-items.js';
5
+ import { availableStock } from './product-search.js';
6
6
  /** Precio que se escribe en el renglón según el documento. */
7
7
  export function priceFromProduct(product, variant, source) {
8
8
  const list = variant?.price ?? product.price;
@@ -1,4 +1,4 @@
1
- import { type Translate } from '../server-error';
1
+ import { type Translate } from '../server-error.js';
2
2
  export interface MappedApiError {
3
3
  /** HTTP status si el error lo trae (axios `response.status`). */
4
4
  status?: number;
@@ -5,7 +5,7 @@
5
5
  // aquí a `{ fields, form }`: los campos se pintan junto al input y `form` (lo que
6
6
  // no se pudo atribuir a un campo) va a un banner persistente — el toast solo
7
7
  // confirma éxitos.
8
- import { extractFieldErrors, extractServerError, localizeFieldErrorMap, } from '../server-error';
8
+ import { extractFieldErrors, extractServerError, localizeFieldErrorMap, } from '../server-error.js';
9
9
  const CONFLICT_HINTS = [
10
10
  { re: /duplicate|already exists|unique|23505|ya existe/i, es: 'Ya existe un registro con ese valor' },
11
11
  ];
@@ -5,7 +5,7 @@
5
5
  // fechas por zona horaria. La moneda y la zona son config de la org — nunca se
6
6
  // hardcodean: salen de <CurrencyContext>/<TimeZoneContext> o de `opts`.
7
7
  import { useMemo } from 'react';
8
- import { useCurrency, useTimeZone } from '../org-runtime-context';
8
+ import { useCurrency, useTimeZone } from '../org-runtime-context.js';
9
9
  /** Locale por defecto del producto. */
10
10
  export const DEFAULT_LOCALE = 'es-MX';
11
11
  /** Moneda cuando ni la org ni el llamador dan una (mismo fallback que las celdas). */
@@ -1,30 +1,30 @@
1
- export * from './format';
2
- export * from './field-errors';
3
- export * from './feedback';
4
- export * from './line-items';
5
- export * from './document-lines';
6
- export * from './line-items-editor';
7
- export * from './line-product-cell';
8
- export * from './payment';
9
- export * from './payment-capture';
10
- export * from './refund';
11
- export * from './refund-destination';
12
- export * from './product-search';
13
- export * from './product-picker';
14
- export * from './product-options';
15
- export * from './customer-picker';
16
- export * from './catalog';
17
- export * from './return';
18
- export * from './return-wizard';
19
- export * from './inspection';
20
- export * from './inspection-checklist';
21
- export * from './vehicle-picker';
22
- export * from './relate-documents';
23
- export * from './print-send-dialog';
24
- export * from './catalog-product-search';
25
- export * from './product-display';
26
- export * from './document-editor-model';
27
- export * from './document-editor-panels';
28
- export * from './payment-allocator';
29
- export * from './document-editor';
1
+ export * from './format.js';
2
+ export * from './field-errors.js';
3
+ export * from './feedback.js';
4
+ export * from './line-items.js';
5
+ export * from './document-lines.js';
6
+ export * from './line-items-editor.js';
7
+ export * from './line-product-cell.js';
8
+ export * from './payment.js';
9
+ export * from './payment-capture.js';
10
+ export * from './refund.js';
11
+ export * from './refund-destination.js';
12
+ export * from './product-search.js';
13
+ export * from './product-picker.js';
14
+ export * from './product-options.js';
15
+ export * from './customer-picker.js';
16
+ export * from './catalog.js';
17
+ export * from './return.js';
18
+ export * from './return-wizard.js';
19
+ export * from './inspection.js';
20
+ export * from './inspection-checklist.js';
21
+ export * from './vehicle-picker.js';
22
+ export * from './relate-documents.js';
23
+ export * from './print-send-dialog.js';
24
+ export * from './catalog-product-search.js';
25
+ export * from './product-display.js';
26
+ export * from './document-editor-model.js';
27
+ export * from './document-editor-panels.js';
28
+ export * from './payment-allocator.js';
29
+ export * from './document-editor.js';
30
30
  //# sourceMappingURL=index.d.ts.map
@@ -1,29 +1,29 @@
1
- export * from './format';
2
- export * from './field-errors';
3
- export * from './feedback';
4
- export * from './line-items';
5
- export * from './document-lines';
6
- export * from './line-items-editor';
7
- export * from './line-product-cell';
8
- export * from './payment';
9
- export * from './payment-capture';
10
- export * from './refund';
11
- export * from './refund-destination';
12
- export * from './product-search';
13
- export * from './product-picker';
14
- export * from './product-options';
15
- export * from './customer-picker';
16
- export * from './catalog';
17
- export * from './return';
18
- export * from './return-wizard';
19
- export * from './inspection';
20
- export * from './inspection-checklist';
21
- export * from './vehicle-picker';
22
- export * from './relate-documents';
23
- export * from './print-send-dialog';
24
- export * from './catalog-product-search';
25
- export * from './product-display';
26
- export * from './document-editor-model';
27
- export * from './document-editor-panels';
28
- export * from './payment-allocator';
29
- export * from './document-editor';
1
+ export * from './format.js';
2
+ export * from './field-errors.js';
3
+ export * from './feedback.js';
4
+ export * from './line-items.js';
5
+ export * from './document-lines.js';
6
+ export * from './line-items-editor.js';
7
+ export * from './line-product-cell.js';
8
+ export * from './payment.js';
9
+ export * from './payment-capture.js';
10
+ export * from './refund.js';
11
+ export * from './refund-destination.js';
12
+ export * from './product-search.js';
13
+ export * from './product-picker.js';
14
+ export * from './product-options.js';
15
+ export * from './customer-picker.js';
16
+ export * from './catalog.js';
17
+ export * from './return.js';
18
+ export * from './return-wizard.js';
19
+ export * from './inspection.js';
20
+ export * from './inspection-checklist.js';
21
+ export * from './vehicle-picker.js';
22
+ export * from './relate-documents.js';
23
+ export * from './print-send-dialog.js';
24
+ export * from './catalog-product-search.js';
25
+ export * from './product-display.js';
26
+ export * from './document-editor-model.js';
27
+ export * from './document-editor-panels.js';
28
+ export * from './payment-allocator.js';
29
+ export * from './document-editor.js';
@@ -1,4 +1,4 @@
1
- import { type InspectionHeader, type InspectionPoint, type InspectionRules, type InspectionValidation, type TreadThresholds } from './inspection';
1
+ import { type InspectionHeader, type InspectionPoint, type InspectionRules, type InspectionValidation, type TreadThresholds } from './inspection.js';
2
2
  export interface InspectionUploadResult {
3
3
  url: string;
4
4
  /** Si el host no lo dice, se deduce del archivo. */
@@ -8,8 +8,8 @@ import { useMemo, useRef, useState } from 'react';
8
8
  import { useTranslation } from 'react-i18next';
9
9
  import { Camera, Loader2, Trash2, Video } from 'lucide-react';
10
10
  import { Badge, Button, Input, Textarea } from '@asteby/metacore-ui';
11
- import { useFormatter } from './format';
12
- import { DEFAULT_TREAD_THRESHOLDS, FUEL_LEVELS, hasRecommendation, newInspectionKey, summarizeInspection, treadStatus, validateInspection, } from './inspection';
11
+ import { useFormatter } from './format.js';
12
+ import { DEFAULT_TREAD_THRESHOLDS, FUEL_LEVELS, hasRecommendation, newInspectionKey, summarizeInspection, treadStatus, validateInspection, } from './inspection.js';
13
13
  const STATUS_STYLE = {
14
14
  pending: 'border-border text-muted-foreground',
15
15
  ok: 'border-emerald-500/50 bg-emerald-500/15 text-emerald-700 dark:text-emerald-300',
@@ -1,4 +1,4 @@
1
- import { type LineItem } from './line-items';
1
+ import { type LineItem } from './line-items.js';
2
2
  /** Semáforo de un punto: pendiente (sin revisar), verde, amarillo, rojo. */
3
3
  export type InspectionStatus = 'pending' | 'ok' | 'attention' | 'urgent';
4
4
  /**
@@ -2,8 +2,8 @@
2
2
  // alineación, garantía): lógica pura del <InspectionChecklist> (benchmark §7,
3
3
  // TAL-4/TAL-5). El semáforo, el resumen y la salida hacia el backend viven aquí
4
4
  // para que el componente y los addons (que guardan por una acción) coincidan.
5
- import { makeLine } from './line-items';
6
- import { roundMoney, toAmount } from './format';
5
+ import { makeLine } from './line-items.js';
6
+ import { roundMoney, toAmount } from './format.js';
7
7
  export const FUEL_LEVELS = ['empty', 'quarter', 'half', 'three_quarters', 'full'];
8
8
  export const DEFAULT_TREAD_THRESHOLDS = { urgent: 1.6, attention: 3 };
9
9
  let seq = 0;
@@ -1,6 +1,6 @@
1
- import { type DocumentLinesMode, type PriceSource } from './document-lines';
2
- import { type LineItem, type LineItemsPolicy, type LineItemsValidation } from './line-items';
3
- import { type ProductQuery, type ProductResult } from './product-search';
1
+ import { type DocumentLinesMode, type PriceSource } from './document-lines.js';
2
+ import { type LineItem, type LineItemsPolicy, type LineItemsValidation } from './line-items.js';
3
+ import { type ProductQuery, type ProductResult } from './product-search.js';
4
4
  export type LineItemsColumn = 'discount' | 'tax' | 'technician' | 'lot' | 'dot' | 'unit';
5
5
  export interface DocumentLinesGridProps {
6
6
  value: LineItem[];
@@ -6,11 +6,11 @@ import { useEffect, useMemo, useRef, useState } from 'react';
6
6
  import { useTranslation } from 'react-i18next';
7
7
  import { Heading, Minus, Pencil, Plus, StickyNote, Trash2 } from 'lucide-react';
8
8
  import { Button, Input, ProductThumb } from '@asteby/metacore-ui';
9
- import { useCan } from '../permissions-context';
10
- import { useFormatter } from './format';
11
- import { addProductLine, applyCatalogPending, applyProductToLine, refreshLineFromProduct, lineGridKeyCommand, } from './document-lines';
12
- import { computeLine, computeTotals, makeLine, validateLineItems, } from './line-items';
13
- import { LineProductCell } from './line-product-cell';
9
+ import { useCan } from '../permissions-context.js';
10
+ import { useFormatter } from './format.js';
11
+ import { addProductLine, applyCatalogPending, applyProductToLine, refreshLineFromProduct, lineGridKeyCommand, } from './document-lines.js';
12
+ import { computeLine, computeTotals, makeLine, validateLineItems, } from './line-items.js';
13
+ import { LineProductCell } from './line-product-cell.js';
14
14
  const num = (s) => (s.trim() === '' ? 0 : Number(s.replace(',', '.')) || 0);
15
15
  export function DocumentLinesGrid({ value, onChange, columns = ['discount'], policy, serverErrors, onValidate, onRequestProduct, search, priceSource = 'sale', mode = 'free', discountMode = 'percent', quantityStepper, mergeSameProduct = true, warehouseId, allowSections = true, readOnly = false, editPermission, currency, showTotals = true, onCreateProduct, onEditProduct, productLabel, unitLabel, }) {
16
16
  const { t } = useTranslation();
@@ -1,4 +1,4 @@
1
- import type { ProductVariant } from './product-search';
1
+ import type { ProductVariant } from './product-search.js';
2
2
  export type LineItemKind = 'item' | 'section' | 'note';
3
3
  export interface LineItem {
4
4
  /** Clave estable de UI (no se envía al backend). */
@@ -2,8 +2,8 @@
2
2
  // Lógica pura del <LineItemsEditor>: cálculo, validación y serialización. El
3
3
  // guardado de renglones fallaba (PIT-018) por mandar al API cadenas vacías y
4
4
  // claves de UI; `serializeLineItems` es la única puerta de salida hacia el backend.
5
- import { newDraftKey } from '../draft-rows';
6
- import { roundMoney, toAmount } from './format';
5
+ import { newDraftKey } from '../draft-rows.js';
6
+ import { roundMoney, toAmount } from './format.js';
7
7
  export const CATALOG_LINE_FIELDS = ['description', 'sku', 'unit_price', 'tax_rate', 'unit'];
8
8
  /** Clave de UI única en el proceso (núcleo compartido con las filas borrador). */
9
9
  export function newLineKey() {
@@ -1,6 +1,6 @@
1
1
  import { type KeyboardEvent } from 'react';
2
- import { type ProductHit, type ProductSearchFn } from './product-options';
3
- import type { ProductResult, ProductVariant } from './product-search';
2
+ import { type ProductHit, type ProductSearchFn } from './product-options.js';
3
+ import type { ProductResult, ProductVariant } from './product-search.js';
4
4
  export type LineProductSearch = ProductSearchFn;
5
5
  /** @deprecated Alias de {@link ProductHit}. */
6
6
  export type LineProductHit = ProductHit;
@@ -15,8 +15,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
15
15
  // buscado. El grid llena el renglón con el producto nuevo al guardarlo.
16
16
  import { forwardRef, useState } from 'react';
17
17
  import { useTranslation } from 'react-i18next';
18
- import { RecordPicker } from '../record-picker';
19
- import { ProductHitRow, productHitKey, productHitLabel, useProductSearch, } from './product-options';
18
+ import { RecordPicker } from '../record-picker.js';
19
+ import { ProductHitRow, productHitKey, productHitLabel, useProductSearch, } from './product-options.js';
20
20
  export const LineProductCell = forwardRef(function LineProductCell({ search, text, onTextChange, onPick, onKeyDownClosed, warehouseId, currency, placeholder, ariaLabel, disabled, invalid, className, dataCell, onCreate, entityLabel, hint }, ref) {
21
21
  const { t } = useTranslation();
22
22
  // Solo se busca/abre mientras se escribe: enfocar un renglón libre ya
@@ -1,4 +1,4 @@
1
- import type { AllocationResult, AllocationStrategy, OpenDocument } from '../primitives/allocation';
1
+ import type { AllocationResult, AllocationStrategy, OpenDocument } from '../primitives/allocation.js';
2
2
  export interface PaymentAllocatorValue {
3
3
  strategy: AllocationStrategy;
4
4
  manual: Record<string, number>;
@@ -7,8 +7,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { Badge, Button } from '@asteby/metacore-ui/primitives';
9
9
  import { Input } from '@asteby/metacore-ui';
10
- import { manualFromAllocations, overdueDays } from './document-editor-model';
11
- import { useFormatter } from './format';
10
+ import { manualFromAllocations, overdueDays } from './document-editor-model.js';
11
+ import { useFormatter } from './format.js';
12
12
  const num = (s) => (s.trim() === '' ? 0 : Number(s.replace(',', '.')) || 0);
13
13
  export function PaymentAllocator({ documents, result, value, onChange, currency, loading, readOnly, today }) {
14
14
  const { t } = useTranslation();
@@ -1,4 +1,4 @@
1
- import { serializePayment, type PaymentMethodOption, type PaymentPolicy, type PaymentTender } from './payment';
1
+ import { serializePayment, type PaymentMethodOption, type PaymentPolicy, type PaymentTender } from './payment.js';
2
2
  export interface PaymentCaptureProps {
3
3
  /** Total a cobrar. */
4
4
  total: number;
@@ -4,9 +4,9 @@ import { useMemo } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { Trash2 } from 'lucide-react';
6
6
  import { Button, Input } from '@asteby/metacore-ui';
7
- import { useCan } from '../permissions-context';
8
- import { useFormatter } from './format';
9
- import { newTender, serializePayment, summarizePayment, validatePayment, } from './payment';
7
+ import { useCan } from '../permissions-context.js';
8
+ import { useFormatter } from './format.js';
9
+ import { newTender, serializePayment, summarizePayment, validatePayment, } from './payment.js';
10
10
  export function PaymentCapture({ total, methods, value, onChange, onSubmit, policy, serverErrors, submitLabel, submitting, submitPermission, currency, disabled, }) {
11
11
  const { t } = useTranslation();
12
12
  const can = useCan();
@@ -1,6 +1,6 @@
1
1
  // Cobro mixto (POS/Caja, Apartado, Cobranza, Factura «Registrar pago», OT).
2
2
  // Lógica pura de <PaymentCapture>: resumen (pagado/pendiente/cambio) y validación.
3
- import { roundMoney, toAmount } from './format';
3
+ import { roundMoney, toAmount } from './format.js';
4
4
  let seq = 0;
5
5
  export function newTender(method, amount = 0) {
6
6
  seq += 1;
@@ -7,7 +7,7 @@ import { useEffect, useState } from 'react';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { Mail, MessageCircle, Printer, Loader2 } from 'lucide-react';
9
9
  import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Input, } from '@asteby/metacore-ui/primitives';
10
- import { FormErrorBanner } from './feedback';
10
+ import { FormErrorBanner } from './feedback.js';
11
11
  function defaultPrint(doc) {
12
12
  if (!doc.pdfUrl || typeof window === 'undefined')
13
13
  return;
@@ -1,4 +1,4 @@
1
- import type { ProductResult } from './product-search';
1
+ import type { ProductResult } from './product-search.js';
2
2
  interface ApiLike {
3
3
  get: (url: string, cfg?: {
4
4
  params?: Record<string, unknown>;
@@ -1,4 +1,4 @@
1
- import { type ProductQuery, type ProductResult, type ProductVariant } from './product-search';
1
+ import { type ProductQuery, type ProductResult, type ProductVariant } from './product-search.js';
2
2
  /** A pickable row: a product, or one concrete variant of it. */
3
3
  export interface ProductHit {
4
4
  product: ProductResult;
@@ -8,10 +8,10 @@ import { useMemo } from 'react';
8
8
  import { useTranslation } from 'react-i18next';
9
9
  import { Badge } from '@asteby/metacore-ui/primitives';
10
10
  import { ProductThumb } from '@asteby/metacore-ui/shared';
11
- import { useLatestSearch, useRecordSearch } from '../record-picker';
12
- import { useFormatter } from './format';
13
- import { OptionDisplayRow } from '../option-display';
14
- import { availableStock, parseProductQuery, } from './product-search';
11
+ import { useLatestSearch, useRecordSearch } from '../record-picker.js';
12
+ import { useFormatter } from './format.js';
13
+ import { OptionDisplayRow } from '../option-display.js';
14
+ import { availableStock, parseProductQuery, } from './product-search.js';
15
15
  /** Products with variants expand to one row per variant. */
16
16
  export function flattenProductHits(results) {
17
17
  return results.flatMap((p) => (p.variants?.length ?? 0) > 0 ? p.variants.map((v) => ({ product: p, variant: v })) : [{ product: p }]);
@@ -1,4 +1,4 @@
1
- import { type ProductQuery, type ProductResult, type ProductVariant } from './product-search';
1
+ import { type ProductQuery, type ProductResult, type ProductVariant } from './product-search.js';
2
2
  export interface ProductPickerProps {
3
3
  /**
4
4
  * Búsqueda: recibe la consulta ya clasificada (`barcode` | `tire_size` |
@@ -5,9 +5,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  // producto del DocumentEditor, ver product-options.tsx).
6
6
  import { useState } from 'react';
7
7
  import { useTranslation } from 'react-i18next';
8
- import { RecordPicker } from '../record-picker';
9
- import { ProductHitRow, productHitKey, productHitLabel, useProductSearch } from './product-options';
10
- import { availableStock } from './product-search';
8
+ import { RecordPicker } from '../record-picker.js';
9
+ import { ProductHitRow, productHitKey, productHitLabel, useProductSearch } from './product-options.js';
10
+ import { availableStock } from './product-search.js';
11
11
  /**
12
12
  * @deprecated Configuración fina de {@link RecordPicker}; para pantallas nuevas
13
13
  * usa RecordPicker con `useProductSearch` / `ProductHitRow`.
@@ -1,5 +1,5 @@
1
- import type { LineItem } from './line-items';
2
- import type { OptionDisplayData } from '../option-display';
1
+ import type { LineItem } from './line-items.js';
2
+ import type { OptionDisplayData } from '../option-display.js';
3
3
  export interface TireSize {
4
4
  width: number;
5
5
  ratio: number;
@@ -1,4 +1,4 @@
1
- import { makeLine } from './line-items';
1
+ import { makeLine } from './line-items.js';
2
2
  // 205/55R16, 205 55 16, 205-55-16, 205/55ZR16, 2055516 (sin separadores).
3
3
  const TIRE_RE = /^(\d{3})\s*[\/\-x\s]?\s*(\d{2})\s*[\/\-x\s]?\s*(?:z?r|-)?\s*(\d{2})$/i;
4
4
  const BARCODE_RE = /^\d{8,14}$/;
@@ -1,4 +1,4 @@
1
- import { type RefundAllocation, type RefundDestinationOption, type RefundValidation } from './refund';
1
+ import { type RefundAllocation, type RefundDestinationOption, type RefundValidation } from './refund.js';
2
2
  export interface RefundDestinationProps {
3
3
  /** Monto total a reembolsar. */
4
4
  total: number;
@@ -4,8 +4,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import { useMemo } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { Button, Input } from '@asteby/metacore-ui';
7
- import { useFormatter, roundMoney } from './format';
8
- import { DEFAULT_REFUND_DESTINATIONS, singleDestination, validateRefund, } from './refund';
7
+ import { useFormatter, roundMoney } from './format.js';
8
+ import { DEFAULT_REFUND_DESTINATIONS, singleDestination, validateRefund, } from './refund.js';
9
9
  export function RefundDestination({ total, value, onChange, options = DEFAULT_REFUND_DESTINATIONS, onValidate, serverErrors, allowSplit = false, currency, disabled, }) {
10
10
  const { t } = useTranslation();
11
11
  const fmt = useFormatter({ currency });
@@ -1,6 +1,6 @@
1
1
  // Destino de un reembolso (ReturnWizard, cancelación de apartado, anticipos).
2
2
  // Lógica pura de <RefundDestination>.
3
- import { roundMoney, toAmount } from './format';
3
+ import { roundMoney, toAmount } from './format.js';
4
4
  /** Catálogo por defecto: el llamador filtra/limita según el documento. */
5
5
  export const DEFAULT_REFUND_DESTINATIONS = [
6
6
  { kind: 'cash', label: 'Efectivo' },
@@ -8,7 +8,7 @@ import { useState } from 'react';
8
8
  import { useTranslation } from 'react-i18next';
9
9
  import { Link2, X } from 'lucide-react';
10
10
  import { Badge, Button } from '@asteby/metacore-ui';
11
- import { RecordPicker, useLatestSearch } from '../record-picker';
11
+ import { RecordPicker, useLatestSearch } from '../record-picker.js';
12
12
  function docTitle(d) {
13
13
  return d.label || d.folio || d.uuid || d.id || '';
14
14
  }
@@ -1,5 +1,5 @@
1
- import { type RefundDestinationOption } from './refund';
2
- import { type ReturnSubmitPayload, type ReturnableLine } from './return';
1
+ import { type RefundDestinationOption } from './refund.js';
2
+ import { type ReturnSubmitPayload, type ReturnableLine } from './return.js';
3
3
  export interface ReturnWizardProps {
4
4
  lines: ReturnableLine[];
5
5
  /** ¿Hay un addon de almacén que confirma la recepción? Sin él, «Recibir» es un paso. */
@@ -5,10 +5,10 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
5
5
  import { useMemo, useState } from 'react';
6
6
  import { useTranslation } from 'react-i18next';
7
7
  import { Button, Input } from '@asteby/metacore-ui';
8
- import { useFormatter } from './format';
9
- import { RefundDestination } from './refund-destination';
10
- import { DEFAULT_REFUND_DESTINATIONS, } from './refund';
11
- import { RETURN_CONDITION_DESTINATIONS, computeReturnTotals, creditNoteRelation, defaultStockDestination, returnSteps, returnableQty, serializeReturn, validateReturnChoices, validateReturnRefund, } from './return';
8
+ import { useFormatter } from './format.js';
9
+ import { RefundDestination } from './refund-destination.js';
10
+ import { DEFAULT_REFUND_DESTINATIONS, } from './refund.js';
11
+ import { RETURN_CONDITION_DESTINATIONS, computeReturnTotals, creditNoteRelation, defaultStockDestination, returnSteps, returnableQty, serializeReturn, validateReturnChoices, validateReturnRefund, } from './return.js';
12
12
  const DEFAULT_REASONS = [
13
13
  { value: 'not_wanted', label: 'No lo quiso' },
14
14
  { value: 'defective', label: 'Defectuoso' },
@@ -1,4 +1,4 @@
1
- import { type RefundAllocation, type RefundDestinationOption } from './refund';
1
+ import { type RefundAllocation, type RefundDestinationOption } from './refund.js';
2
2
  /** Estado físico de lo que regresa. */
3
3
  export type ReturnCondition = 'sellable' | 'defective';
4
4
  /** A dónde va la mercancía: stock vendible, merma o garantía (reclamo al proveedor). */
@@ -78,7 +78,7 @@ export declare function serializeReturn(args: {
78
78
  refund: RefundAllocation[];
79
79
  }): ReturnSubmitPayload;
80
80
  /** Valida el paso de reembolso contra el total de la devolución. */
81
- export declare function validateReturnRefund(total: number, refund: RefundAllocation[], options?: RefundDestinationOption[]): import("./refund").RefundValidation;
81
+ export declare function validateReturnRefund(total: number, refund: RefundAllocation[], options?: RefundDestinationOption[]): import("./refund.js").RefundValidation;
82
82
  export type RmaState = 'draft' | 'authorized' | 'received' | 'settled' | 'closed' | 'rejected' | 'cancelled';
83
83
  export declare const RMA_TRANSITIONS: Record<RmaState, RmaState[]>;
84
84
  /** Estados a los que se llega con motivo obligatorio. */
@@ -1,8 +1,8 @@
1
1
  // Devolución de mercancía (ReturnWizard: POS, Pedido, Factura, RMA, OT, devolución
2
2
  // a proveedor). Lógica pura, sin endpoints: cada consumidor cablea el envío.
3
3
  // Flujo (benchmark §8.2): renglones → condición y destino → recepción → reembolso o NC.
4
- import { roundMoney, toAmount } from './format';
5
- import { validateRefund } from './refund';
4
+ import { roundMoney, toAmount } from './format.js';
5
+ import { validateRefund } from './refund.js';
6
6
  export const RETURN_CONDITION_DESTINATIONS = {
7
7
  sellable: ['stock'],
8
8
  defective: ['scrap', 'warranty'],
@@ -8,9 +8,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
8
8
  import { useCallback, useState } from 'react';
9
9
  import { useTranslation } from 'react-i18next';
10
10
  import { Car } from 'lucide-react';
11
- import { RecordPicker, useLatestSearch } from '../record-picker';
12
- import { useRecordPickerDialog } from '../record-picker-dialog';
13
- import { useCan } from '../permissions-context';
11
+ import { RecordPicker, useLatestSearch } from '../record-picker.js';
12
+ import { useRecordPickerDialog } from '../record-picker-dialog.js';
13
+ import { useCan } from '../permissions-context.js';
14
14
  function snake(model) {
15
15
  return model.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase();
16
16
  }
@@ -15,9 +15,9 @@
15
15
  // cache, the read batch (rows, metadata, i18n), the option lists, and the
16
16
  // react-query cache.
17
17
  import { useEffect } from 'react';
18
- import { useMetadataCache } from './metadata-cache';
19
- import { invalidateOptionsCache } from './use-options-resolver';
20
- import { invalidateQueryBatchAll } from './query-batch';
18
+ import { useMetadataCache } from './metadata-cache.js';
19
+ import { invalidateOptionsCache } from './use-options-resolver.js';
20
+ import { invalidateQueryBatchAll } from './query-batch.js';
21
21
  export const CACHE_EPOCH_HEADER = 'x-cache-epoch';
22
22
  export const CACHE_EPOCH_OBSERVED_EVENT = 'metacore:cache-epoch-observed';
23
23
  export const CACHE_EPOCH_CHANGED_EVENT = 'metacore:cache-epoch-changed';
@@ -1,4 +1,4 @@
1
- export { pickText, domainOf, humanizeSegment, servesMarket, resolveCapability, recommendProvider, groupByDomain, activeMarkets, bundleSelections, storedSelections, choiceBlock, checkoutBlockers, changeImpact, providerStatus, usableCapabilities, needsProviderChoice, competingProviderAddons, type CapabilityProvider as CapabilityProviderBinding, type I18nText as ProviderI18nText, type CapabilityView, type CapabilityDomain, type ConnectionState, type ProviderInfo, type Market, type CapabilitiesPayload, type ResolutionReason, type Resolution, type CellStatus, type DomainCell, type DomainGroup, type ChoiceBlock, type ChangeImpact, type UsableCapability, type ProviderStatus, } from './model';
2
- export { moveItem, moveId, dropIndexFromPointer } from './reorder';
3
- export { ProviderSortableList, sortableOrder, DEFAULT_PROVIDER_LIST_LABELS, type ProviderSortableItem, type ProviderSortableListLabels, type ProviderSortableListProps, } from './provider-sortable-list';
1
+ export { pickText, domainOf, humanizeSegment, servesMarket, resolveCapability, recommendProvider, groupByDomain, activeMarkets, bundleSelections, storedSelections, choiceBlock, checkoutBlockers, changeImpact, providerStatus, usableCapabilities, needsProviderChoice, competingProviderAddons, type CapabilityProvider as CapabilityProviderBinding, type I18nText as ProviderI18nText, type CapabilityView, type CapabilityDomain, type ConnectionState, type ProviderInfo, type Market, type CapabilitiesPayload, type ResolutionReason, type Resolution, type CellStatus, type DomainCell, type DomainGroup, type ChoiceBlock, type ChangeImpact, type UsableCapability, type ProviderStatus, } from './model.js';
2
+ export { moveItem, moveId, dropIndexFromPointer } from './reorder.js';
3
+ export { ProviderSortableList, sortableOrder, DEFAULT_PROVIDER_LIST_LABELS, type ProviderSortableItem, type ProviderSortableListLabels, type ProviderSortableListProps, } from './provider-sortable-list.js';
4
4
  //# sourceMappingURL=index.d.ts.map