@asteby/metacore-runtime-react 53.25.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.
- package/CHANGELOG.md +11 -0
- package/dist/action-modal-dispatcher.d.ts +3 -3
- package/dist/action-modal-dispatcher.js +31 -31
- package/dist/action-priority.d.ts +1 -1
- package/dist/activity-diff.d.ts +1 -1
- package/dist/activity-diff.js +1 -1
- package/dist/activity-timeline.d.ts +2 -2
- package/dist/activity-timeline.js +3 -3
- package/dist/activity-value-renderer.d.ts +1 -1
- package/dist/activity-value-renderer.js +3 -3
- package/dist/addon-loader.d.ts +1 -1
- package/dist/addon-loader.js +3 -3
- package/dist/addon-page-host.js +1 -1
- package/dist/addon-page-loader.d.ts +2 -2
- package/dist/addon-page-loader.js +3 -3
- package/dist/api-context.js +4 -4
- package/dist/approval-gate.d.ts +1 -1
- package/dist/approval-gate.js +5 -5
- package/dist/assist-interview.d.ts +1 -1
- package/dist/assist-interview.js +1 -1
- package/dist/attention/index.d.ts +3 -3
- package/dist/attention/index.js +3 -3
- package/dist/attention/use-nav-badges.js +2 -2
- package/dist/attribute-classes.d.ts +1 -1
- package/dist/audit-info.d.ts +1 -1
- package/dist/audit-info.js +5 -5
- package/dist/bulk-image-dialog.d.ts +1 -1
- package/dist/bulk-image-dialog.js +5 -5
- package/dist/bulk-image-import.d.ts +2 -2
- package/dist/bulk-image-import.js +1 -1
- package/dist/bulk-image-target.d.ts +1 -1
- package/dist/bulk-image-target.js +1 -1
- package/dist/bulk-image-wizard.d.ts +1 -1
- package/dist/bulk-image-wizard.js +5 -5
- package/dist/business/catalog-product-search.d.ts +1 -1
- package/dist/business/customer-picker.js +4 -4
- package/dist/business/document-editor-model.d.ts +3 -3
- package/dist/business/document-editor-model.js +4 -4
- package/dist/business/document-editor-panels.d.ts +3 -3
- package/dist/business/document-editor-panels.js +1 -1
- package/dist/business/document-editor.d.ts +2 -2
- package/dist/business/document-editor.js +22 -22
- package/dist/business/document-lines.d.ts +2 -2
- package/dist/business/document-lines.js +3 -3
- package/dist/business/field-errors.d.ts +1 -1
- package/dist/business/field-errors.js +1 -1
- package/dist/business/format.js +1 -1
- package/dist/business/index.d.ts +29 -29
- package/dist/business/index.js +29 -29
- package/dist/business/inspection-checklist.d.ts +1 -1
- package/dist/business/inspection-checklist.js +2 -2
- package/dist/business/inspection.d.ts +1 -1
- package/dist/business/inspection.js +2 -2
- package/dist/business/line-items-editor.d.ts +3 -3
- package/dist/business/line-items-editor.js +5 -5
- package/dist/business/line-items.d.ts +1 -1
- package/dist/business/line-items.js +2 -2
- package/dist/business/line-product-cell.d.ts +2 -2
- package/dist/business/line-product-cell.js +2 -2
- package/dist/business/payment-allocator.d.ts +1 -1
- package/dist/business/payment-allocator.js +2 -2
- package/dist/business/payment-capture.d.ts +1 -1
- package/dist/business/payment-capture.js +3 -3
- package/dist/business/payment.js +1 -1
- package/dist/business/print-send-dialog.js +1 -1
- package/dist/business/product-display.d.ts +1 -1
- package/dist/business/product-options.d.ts +1 -1
- package/dist/business/product-options.js +4 -4
- package/dist/business/product-picker.d.ts +1 -1
- package/dist/business/product-picker.js +3 -3
- package/dist/business/product-search.d.ts +2 -2
- package/dist/business/product-search.js +1 -1
- package/dist/business/refund-destination.d.ts +1 -1
- package/dist/business/refund-destination.js +2 -2
- package/dist/business/refund.js +1 -1
- package/dist/business/relate-documents.js +1 -1
- package/dist/business/return-wizard.d.ts +2 -2
- package/dist/business/return-wizard.js +4 -4
- package/dist/business/return.d.ts +2 -2
- package/dist/business/return.js +2 -2
- package/dist/business/vehicle-picker.js +3 -3
- package/dist/cache-coherence.js +3 -3
- package/dist/capability-providers/index.d.ts +3 -3
- package/dist/capability-providers/index.js +3 -3
- package/dist/capability-providers/provider-sortable-list.d.ts +1 -1
- package/dist/capability-providers/provider-sortable-list.js +1 -1
- package/dist/collection-cell.js +1 -1
- package/dist/column-filter-field.d.ts +1 -1
- package/dist/column-visibility.d.ts +1 -1
- package/dist/custom-stages.d.ts +2 -2
- package/dist/custom-stages.js +1 -1
- package/dist/dashboard-grid.d.ts +1 -1
- package/dist/dashboard-grid.js +3 -3
- package/dist/dialogs/create-record-dialog.d.ts +1 -1
- package/dist/dialogs/create-record-dialog.js +1 -1
- package/dist/dialogs/dynamic-record.d.ts +5 -5
- package/dist/dialogs/dynamic-record.js +41 -41
- package/dist/dialogs/export.d.ts +1 -1
- package/dist/dialogs/export.js +2 -2
- package/dist/dialogs/import.d.ts +1 -1
- package/dist/dialogs/import.js +3 -3
- package/dist/dialogs/inline-relation-rows.d.ts +3 -3
- package/dist/dialogs/inline-relation-rows.js +3 -3
- package/dist/dialogs/inline-relations.d.ts +3 -3
- package/dist/dialogs/inline-relations.js +3 -3
- package/dist/dialogs/normalize-submit.d.ts +1 -1
- package/dist/dialogs/normalize-submit.js +3 -3
- package/dist/dialogs/use-inline-relations.d.ts +1 -1
- package/dist/dialogs/use-inline-relations.js +3 -3
- package/dist/dialogs/view-record-dialog.d.ts +1 -1
- package/dist/dialogs/view-record-dialog.js +1 -1
- package/dist/display-value.js +1 -1
- package/dist/document/action-bar.d.ts +1 -1
- package/dist/document/action-bar.js +1 -1
- package/dist/document/document-header.d.ts +2 -2
- package/dist/document/document-header.js +2 -2
- package/dist/document/document-page.d.ts +3 -3
- package/dist/document/document-page.js +9 -9
- package/dist/document/document-timeline.d.ts +2 -2
- package/dist/document/document-timeline.js +2 -2
- package/dist/document/evaluate.d.ts +1 -1
- package/dist/document/evaluate.js +1 -1
- package/dist/document/format.d.ts +1 -1
- package/dist/document/index.d.ts +13 -13
- package/dist/document/index.js +13 -13
- package/dist/document/registry.d.ts +1 -1
- package/dist/document/secondary-bar.js +2 -2
- package/dist/document/smart-buttons.js +1 -1
- package/dist/document/status-badge.d.ts +1 -1
- package/dist/document/use-document-sources.d.ts +1 -1
- package/dist/document/use-document-sources.js +2 -2
- package/dist/document-form-dialog.d.ts +2 -2
- package/dist/document-form-dialog.js +16 -16
- package/dist/document-template-editor.js +1 -1
- package/dist/dynamic-columns-shim.d.ts +1 -1
- package/dist/dynamic-columns.d.ts +3 -3
- package/dist/dynamic-columns.js +19 -19
- package/dist/dynamic-crud-page.d.ts +2 -2
- package/dist/dynamic-crud-page.js +13 -13
- package/dist/dynamic-date-field.d.ts +1 -1
- package/dist/dynamic-date-field.js +1 -1
- package/dist/dynamic-form-schema.d.ts +2 -2
- package/dist/dynamic-form-schema.js +4 -4
- package/dist/dynamic-form.d.ts +10 -10
- package/dist/dynamic-form.js +24 -24
- package/dist/dynamic-icon.js +1 -1
- package/dist/dynamic-kanban.d.ts +3 -3
- package/dist/dynamic-kanban.js +25 -25
- package/dist/dynamic-line-items.d.ts +1 -1
- package/dist/dynamic-line-items.js +6 -6
- package/dist/dynamic-multi-select-field.d.ts +1 -1
- package/dist/dynamic-multi-select-field.js +7 -7
- package/dist/dynamic-relation-helpers.d.ts +1 -1
- package/dist/dynamic-relation-helpers.js +2 -2
- package/dist/dynamic-relation.d.ts +2 -2
- package/dist/dynamic-relation.js +15 -15
- package/dist/dynamic-relations.d.ts +2 -2
- package/dist/dynamic-relations.js +1 -1
- package/dist/dynamic-row-actions.d.ts +1 -1
- package/dist/dynamic-row-actions.js +5 -5
- package/dist/dynamic-select-field.d.ts +3 -3
- package/dist/dynamic-select-field.js +11 -11
- package/dist/dynamic-table.d.ts +2 -2
- package/dist/dynamic-table.js +24 -24
- package/dist/dynamic-view.d.ts +4 -4
- package/dist/dynamic-view.js +7 -7
- package/dist/entity-select.js +4 -4
- package/dist/field-validation-ui.d.ts +2 -2
- package/dist/field-widget-registry.d.ts +1 -1
- package/dist/form-layout-ui.d.ts +1 -1
- package/dist/form-layout.d.ts +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/genui/index.d.ts +1 -1
- package/dist/genui/index.js +1 -1
- package/dist/genui/settings-block.d.ts +1 -1
- package/dist/genui/settings-block.js +3 -3
- package/dist/host-api-client.d.ts +11 -1
- package/dist/host-api-client.d.ts.map +1 -1
- package/dist/host-api-client.js +21 -14
- package/dist/host-api.d.ts +9 -1
- package/dist/host-api.d.ts.map +1 -1
- package/dist/host-api.js +57 -2
- package/dist/hotswap-reload-policy.d.ts +1 -1
- package/dist/hotswap-reload-policy.js +1 -1
- package/dist/icon-picker-field.d.ts +1 -1
- package/dist/icon-picker-field.js +3 -3
- package/dist/icon-resolvers.d.ts +1 -1
- package/dist/icon-resolvers.js +1 -1
- package/dist/icon-spec.js +1 -1
- package/dist/index.d.ts +165 -165
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +148 -148
- package/dist/license/index.d.ts +6 -6
- package/dist/license/index.js +6 -6
- package/dist/license/license-expiry-banner.d.ts +1 -1
- package/dist/license/license-expiry-banner.js +3 -3
- package/dist/license/license-gate.d.ts +1 -1
- package/dist/license/license-gate.js +5 -5
- package/dist/license/license-status-badge.d.ts +1 -1
- package/dist/license/license-status-badge.js +1 -1
- package/dist/license/use-license-t.d.ts +1 -1
- package/dist/license/use-license-t.js +1 -1
- package/dist/license/view.d.ts +1 -1
- package/dist/license/view.js +1 -1
- package/dist/list-include.d.ts +1 -1
- package/dist/manifest-hotswap-subscriber.d.ts +1 -1
- package/dist/manifest-hotswap-subscriber.js +1 -1
- package/dist/metadata-cache.d.ts +1 -1
- package/dist/metadata-cache.js +1 -1
- package/dist/model-action-toolbar.d.ts +1 -1
- package/dist/model-action-toolbar.js +7 -7
- package/dist/nav-permissions.d.ts +1 -1
- package/dist/nav-permissions.js +1 -1
- package/dist/navigation-builder.d.ts +1 -1
- package/dist/navigation-builder.js +1 -1
- package/dist/option-display.d.ts +1 -1
- package/dist/option-display.js +2 -2
- package/dist/option-filter.d.ts +1 -1
- package/dist/option-when.d.ts +1 -1
- package/dist/org-runtime-provider.d.ts +2 -2
- package/dist/org-runtime-provider.js +2 -2
- package/dist/permissions-context.d.ts +1 -1
- package/dist/permissions-manager.js +4 -4
- package/dist/primitives/aging.js +1 -1
- package/dist/primitives/allocation.js +1 -1
- package/dist/primitives/approvals.d.ts +1 -1
- package/dist/primitives/contributions.js +1 -1
- package/dist/primitives/document-kinds.d.ts +1 -1
- package/dist/primitives/index.d.ts +7 -7
- package/dist/primitives/index.js +7 -7
- package/dist/primitives/panels.d.ts +1 -1
- package/dist/primitives/use-contributions.d.ts +2 -2
- package/dist/primitives/use-contributions.js +2 -2
- package/dist/print-document-button.d.ts +1 -1
- package/dist/print-document-button.js +1 -1
- package/dist/provenance.js +3 -3
- package/dist/query-batch.d.ts +1 -1
- package/dist/query-batch.js +1 -1
- package/dist/record-actions.d.ts +2 -2
- package/dist/record-actions.js +2 -2
- package/dist/record-history.d.ts +2 -2
- package/dist/record-history.js +3 -3
- package/dist/record-picker-dialog.js +3 -3
- package/dist/record-picker-option.d.ts +1 -1
- package/dist/record-picker-option.js +1 -1
- package/dist/record-picker.js +2 -2
- package/dist/record-prefill-bar.js +1 -1
- package/dist/relation-gallery.js +1 -1
- package/dist/requires-addon.d.ts +1 -1
- package/dist/rich-cells.js +2 -2
- package/dist/rich-url.js +1 -1
- package/dist/row-actions-menu.js +5 -5
- package/dist/server-error.js +2 -2
- package/dist/setup/addon-config-surface.d.ts +3 -3
- package/dist/setup/addon-config-surface.js +10 -10
- package/dist/setup/connector-blocks-model.d.ts +1 -1
- package/dist/setup/connector-blocks.d.ts +1 -1
- package/dist/setup/connector-blocks.js +6 -6
- package/dist/setup/flow-model.d.ts +1 -1
- package/dist/setup/health-card.d.ts +1 -1
- package/dist/setup/health-card.js +2 -2
- package/dist/setup/index.d.ts +12 -12
- package/dist/setup/index.js +12 -12
- package/dist/setup/records-table.d.ts +1 -1
- package/dist/setup/records-table.js +2 -2
- package/dist/setup/setup-flow.d.ts +1 -1
- package/dist/setup/setup-flow.js +7 -7
- package/dist/setup/setup-form-step.d.ts +1 -1
- package/dist/setup/setup-form-step.js +4 -4
- package/dist/setup/step-status-badge.d.ts +1 -1
- package/dist/setup/step-status-badge.js +2 -2
- package/dist/setup/tone.d.ts +1 -1
- package/dist/setup/types.d.ts +2 -2
- package/dist/sidebar-layout-manager.d.ts +1 -1
- package/dist/sidebar-layout-manager.js +2 -2
- package/dist/slot.js +1 -1
- package/dist/slots/addon-slot.js +4 -4
- package/dist/slots/index.d.ts +2 -2
- package/dist/slots/index.js +2 -2
- package/dist/stage-automations.d.ts +2 -2
- package/dist/stage-automations.js +1 -1
- package/dist/stage-layout.js +1 -1
- package/dist/stage-overrides.d.ts +1 -1
- package/dist/stage-overrides.js +1 -1
- package/dist/supervised-action.js +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/tri-state-boolean.d.ts +2 -2
- package/dist/tri-state-boolean.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/upload-field.d.ts +1 -1
- package/dist/upload-field.js +4 -4
- package/dist/use-addon-installed-probe.js +3 -3
- package/dist/use-addon-settings.d.ts +1 -1
- package/dist/use-addon-settings.js +1 -1
- package/dist/use-dynamic-filters.d.ts +2 -2
- package/dist/use-dynamic-filters.js +6 -6
- package/dist/use-edge-device.d.ts +1 -1
- package/dist/use-edge-device.js +2 -2
- package/dist/use-facet-loaders.d.ts +1 -1
- package/dist/use-facet-loaders.js +1 -1
- package/dist/use-flip-animation.d.ts +1 -1
- package/dist/use-flip-animation.js +1 -1
- package/dist/use-host-api-client.d.ts +2 -2
- package/dist/use-host-api-client.d.ts.map +1 -1
- package/dist/use-host-api-client.js +6 -4
- package/dist/use-option-ids.d.ts +1 -1
- package/dist/use-option-ids.js +2 -2
- package/dist/use-options-resolver.d.ts +2 -2
- package/dist/use-options-resolver.js +4 -4
- package/dist/use-org-document-templates.js +1 -1
- package/dist/use-print-document.js +1 -1
- package/dist/use-record-mutation-tick.js +1 -1
- package/dist/validator.d.ts +2 -2
- package/dist/validator.js +1 -1
- package/dist/view-system/card-spec.d.ts +1 -1
- package/dist/view-system/cards-view.d.ts +1 -1
- package/dist/view-system/cards-view.js +2 -2
- package/dist/view-system/index.d.ts +9 -9
- package/dist/view-system/index.js +9 -9
- package/dist/view-system/model-view.d.ts +3 -3
- package/dist/view-system/model-view.js +7 -7
- package/dist/view-system/saved-views.d.ts +1 -1
- package/dist/view-system/use-view-mode.d.ts +1 -1
- package/dist/view-system/view-state.d.ts +1 -1
- package/dist/view-system/view-switcher.d.ts +1 -1
- package/dist/view-system/view-toolbar.d.ts +1 -1
- package/dist/view-system/view-toolbar.js +2 -2
- package/dist/views/calendar-view.d.ts +1 -1
- package/dist/views/calendar-view.js +2 -2
- package/dist/views/chart-view.d.ts +2 -2
- package/dist/views/chart-view.js +2 -2
- package/dist/views/data-source.d.ts +2 -2
- package/dist/views/index.d.ts +3 -3
- package/dist/views/index.js +2 -2
- package/dist/views/map-view.d.ts +1 -1
- package/dist/views/map-view.js +3 -3
- package/dist/views/panels.d.ts +1 -1
- package/dist/views/panels.js +3 -3
- package/dist/views/registry.d.ts +2 -2
- package/dist/views/registry.js +12 -12
- package/dist/views/split-view.d.ts +1 -1
- package/dist/views/split-view.js +4 -4
- package/dist/views/timeline-view.d.ts +1 -1
- package/dist/views/timeline-view.js +3 -3
- package/dist/views/types.d.ts +2 -2
- package/dist/widgets/charts.d.ts +1 -1
- package/dist/widgets/charts.js +2 -2
- package/dist/widgets/lazy-charts.d.ts +1 -1
- package/dist/widgets/lazy-charts.js +2 -2
- package/dist/widgets/renderers.d.ts +2 -2
- package/dist/widgets/renderers.js +2 -2
- package/dist/widgets/widget-card.d.ts +1 -1
- package/dist/widgets/widget-card.js +2 -2
- package/dist/widgets/widget-renderer.d.ts +1 -1
- package/dist/widgets/widget-renderer.js +4 -4
- package/package.json +9 -9
- package/src/__tests__/host-api-client.test.tsx +16 -0
- package/src/__tests__/host-api.test.ts +50 -0
- package/src/host-api-client.ts +31 -14
- package/src/host-api.ts +54 -1
- package/src/index.ts +2 -1
- package/src/use-host-api-client.ts +5 -3
|
@@ -13,8 +13,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
13
13
|
import { Loader2 } from 'lucide-react';
|
|
14
14
|
import { Button } from '@asteby/metacore-ui/primitives';
|
|
15
15
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
16
|
-
import { DynamicIcon } from '../dynamic-icon';
|
|
17
|
-
import { useRecordActions } from '../record-actions';
|
|
16
|
+
import { DynamicIcon } from '../dynamic-icon.js';
|
|
17
|
+
import { useRecordActions } from '../record-actions.js';
|
|
18
18
|
export function DocumentSecondaryBar({ items = [], model, record, children, className }) {
|
|
19
19
|
const { t } = useTranslation();
|
|
20
20
|
const contributed = useRecordActions(model ?? '', model ? record : null);
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
// salvo que la definición pida `hideWhenEmpty`.
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
7
|
-
import { DynamicIcon } from '../dynamic-icon';
|
|
7
|
+
import { DynamicIcon } from '../dynamic-icon.js';
|
|
8
8
|
export function SmartButtons({ items, className }) {
|
|
9
9
|
const { t } = useTranslation();
|
|
10
10
|
if (items.length === 0)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type LucideIcon } from 'lucide-react';
|
|
2
|
-
import type { StatusDef, StatusTone } from './types';
|
|
2
|
+
import type { StatusDef, StatusTone } from './types.js';
|
|
3
3
|
type BadgeVariant = 'muted' | 'info' | 'success' | 'warning' | 'danger';
|
|
4
4
|
export declare const STATUS_TONE_STYLE: Record<StatusTone, {
|
|
5
5
|
variant: BadgeVariant;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { useApi } from '../api-context';
|
|
3
|
-
import { buildRelationFilterParams } from '../dynamic-relation-helpers';
|
|
2
|
+
import { useApi } from '../api-context.js';
|
|
3
|
+
import { buildRelationFilterParams } from '../dynamic-relation-helpers.js';
|
|
4
4
|
const DEFAULT_LIMIT = 50;
|
|
5
5
|
// El kernel ≥ 0.139.2 acepta listas `in:` largas; se parte para no exceder la URL.
|
|
6
6
|
const VIA_CHUNK = 40;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type DocumentLinesGridProps } from './business/line-items-editor';
|
|
2
|
-
import type { DocumentFormType, DocumentFormsManifest, TableMetadata } from './types';
|
|
1
|
+
import { type DocumentLinesGridProps } from './business/line-items-editor.js';
|
|
2
|
+
import type { DocumentFormType, DocumentFormsManifest, TableMetadata } from './types.js';
|
|
3
3
|
export interface DocumentFormDialogProps {
|
|
4
4
|
open: boolean;
|
|
5
5
|
onOpenChange: (open: boolean) => void;
|
|
@@ -15,22 +15,22 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@asteby/metacore-ui/primitives';
|
|
16
16
|
import { Loader2 } from 'lucide-react';
|
|
17
17
|
import { toast } from 'sonner';
|
|
18
|
-
import { useApi } from './api-context';
|
|
19
|
-
import { useOrgTaxRate, useTimeZone } from './org-runtime-context';
|
|
20
|
-
import { DynamicIcon } from './dynamic-icon';
|
|
21
|
-
import { FieldCell, FieldGrid, FieldLabel } from './field-grid';
|
|
22
|
-
import { FormErrorBanner } from './business/feedback';
|
|
23
|
-
import { DocumentLinesGrid, } from './business/line-items-editor';
|
|
24
|
-
import { serializeLineItems, validateLineItems } from './business/line-items';
|
|
25
|
-
import { actionErrorBannerMessage, buildFieldDefaults, renderField, } from './action-modal-dispatcher';
|
|
26
|
-
import { extractFieldErrors, localizeFieldErrorMap } from './server-error';
|
|
27
|
-
import { validateValues, bagHasErrors } from './validator';
|
|
28
|
-
import { clearFieldErrorTree } from './field-validation-ui';
|
|
29
|
-
import { emitRecordMutation } from './record-mutation-events';
|
|
30
|
-
import { isLineItemsField, resolveWidget, scopeValueFromFilterToken } from './dynamic-form-schema';
|
|
31
|
-
import { createCatalogProductSearch, withDefaultTaxRate } from './business/catalog-product-search';
|
|
32
|
-
import { DocumentEditor } from './business/document-editor';
|
|
33
|
-
import { editorLinesConfig, isEditorLayout, isFullscreenEditor } from './business/document-editor-model';
|
|
18
|
+
import { useApi } from './api-context.js';
|
|
19
|
+
import { useOrgTaxRate, useTimeZone } from './org-runtime-context.js';
|
|
20
|
+
import { DynamicIcon } from './dynamic-icon.js';
|
|
21
|
+
import { FieldCell, FieldGrid, FieldLabel } from './field-grid.js';
|
|
22
|
+
import { FormErrorBanner } from './business/feedback.js';
|
|
23
|
+
import { DocumentLinesGrid, } from './business/line-items-editor.js';
|
|
24
|
+
import { serializeLineItems, validateLineItems } from './business/line-items.js';
|
|
25
|
+
import { actionErrorBannerMessage, buildFieldDefaults, renderField, } from './action-modal-dispatcher.js';
|
|
26
|
+
import { extractFieldErrors, localizeFieldErrorMap } from './server-error.js';
|
|
27
|
+
import { validateValues, bagHasErrors } from './validator.js';
|
|
28
|
+
import { clearFieldErrorTree } from './field-validation-ui.js';
|
|
29
|
+
import { emitRecordMutation } from './record-mutation-events.js';
|
|
30
|
+
import { isLineItemsField, resolveWidget, scopeValueFromFilterToken } from './dynamic-form-schema.js';
|
|
31
|
+
import { createCatalogProductSearch, withDefaultTaxRate } from './business/catalog-product-search.js';
|
|
32
|
+
import { DocumentEditor } from './business/document-editor.js';
|
|
33
|
+
import { editorLinesConfig, isEditorLayout, isFullscreenEditor } from './business/document-editor-model.js';
|
|
34
34
|
/**
|
|
35
35
|
* Si «Crear» de estos formularios es un alta delegada: un único tipo (p. ej.
|
|
36
36
|
* ya acotado por el filtro de la vista) con `create_model`. Con varios tipos el
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
// className. Host surfaces (ops Plantillas) can wrap this or roll their own
|
|
5
5
|
// using the hooks in use-org-document-templates.
|
|
6
6
|
import { useEffect, useState } from 'react';
|
|
7
|
-
import { useOrgDocumentTemplate, usePreviewOrgDocumentTemplate, useResetOrgDocumentTemplate, useSaveOrgDocumentTemplate, } from './use-org-document-templates';
|
|
7
|
+
import { useOrgDocumentTemplate, usePreviewOrgDocumentTemplate, useResetOrgDocumentTemplate, useSaveOrgDocumentTemplate, } from './use-org-document-templates.js';
|
|
8
8
|
export function DocumentTemplateEditor({ addonKey, documentKey, onSaved, onError, className, disabled, }) {
|
|
9
9
|
const { template, isLoading } = useOrgDocumentTemplate(addonKey, documentKey);
|
|
10
10
|
const save = useSaveOrgDocumentTemplate();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type Locale } from 'date-fns';
|
|
3
|
-
import type { ColumnDefinition } from './types';
|
|
4
|
-
import type { GetDynamicColumns, RowActionPredicate } from './dynamic-columns-shim';
|
|
3
|
+
import type { ColumnDefinition } from './types.js';
|
|
4
|
+
import type { GetDynamicColumns, RowActionPredicate } from './dynamic-columns-shim.js';
|
|
5
5
|
/** Host-supplied helpers consumed by avatar/image cell renderers. */
|
|
6
6
|
export interface DynamicColumnsHelpers {
|
|
7
7
|
/**
|
|
@@ -45,7 +45,7 @@ export declare const aggregateOf: (col: ColumnDefinition) => string | undefined;
|
|
|
45
45
|
* empty filtered set reads cleanly.
|
|
46
46
|
*/
|
|
47
47
|
export declare const formatAggregateTotal: (col: ColumnDefinition, value: unknown, currency?: string, locale?: string) => string;
|
|
48
|
-
export { RowActionMenuItem } from './row-actions-menu';
|
|
48
|
+
export { RowActionMenuItem } from './row-actions-menu.js';
|
|
49
49
|
/**
|
|
50
50
|
* State-machine gate for per-row actions.
|
|
51
51
|
*
|
package/dist/dynamic-columns.js
CHANGED
|
@@ -14,29 +14,29 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
// argument so the SDK stays free of environment-bound code.
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
import { format } from 'date-fns';
|
|
17
|
-
import { isCalendarDayValue, parseCalendarDate } from './calendar-date';
|
|
17
|
+
import { isCalendarDayValue, parseCalendarDate } from './calendar-date.js';
|
|
18
18
|
import { es, enUS } from 'date-fns/locale';
|
|
19
19
|
import { Calendar, Check, Copy, Mail, Minus } from 'lucide-react';
|
|
20
20
|
import { Avatar, AvatarFallback, AvatarImage, Badge, Checkbox, InitialsAvatar, } from '@asteby/metacore-ui';
|
|
21
21
|
import { DataTableColumnHeader, FilterableColumnHeader, } from '@asteby/metacore-ui/data-table';
|
|
22
22
|
import { generateBadgeStyles, getInitials, optionColor, relationChipStyles, } from '@asteby/metacore-ui/lib';
|
|
23
|
-
import { Progress } from './dialogs/_primitives';
|
|
24
|
-
import { RelativeDateCell, brandAvatarColors } from './relative-date';
|
|
25
|
-
import { useSystemActor } from './org-runtime-context';
|
|
26
|
-
import { AuthorshipCell, hasSpecialAuthorship } from './provenance';
|
|
27
|
-
import { humanizeToken, resolveColumnOptions, translateMetadataLabel } from './dynamic-columns-helpers';
|
|
28
|
-
import { objectLabel } from './dynamic-relation-helpers';
|
|
29
|
-
import { OptionBadge, RelationThumbnail, ImageStack, statusColorFor, useIsDarkTheme, useImageErrorGuard, } from './display-value';
|
|
30
|
-
import { MediaValue } from './rich-url';
|
|
31
|
-
import { OptionsContext } from './options-context';
|
|
32
|
-
import { DynamicIcon, Icon, isLucideIconName } from './dynamic-icon';
|
|
33
|
-
import { CollectionCell } from './collection-cell';
|
|
34
|
-
import { ChipsCell, MeterCell, SwatchCell } from './rich-cells';
|
|
35
|
-
import { isNilUuid, normalizeNilUuid } from './nil-uuid';
|
|
36
|
-
import { useOptionsResolver } from './use-options-resolver';
|
|
37
|
-
import { RowActionsMenu } from './row-actions-menu';
|
|
38
|
-
import { isColumnVisibleInTable } from './column-visibility';
|
|
39
|
-
import { NullBooleanMark } from './tri-state-boolean';
|
|
23
|
+
import { Progress } from './dialogs/_primitives.js';
|
|
24
|
+
import { RelativeDateCell, brandAvatarColors } from './relative-date.js';
|
|
25
|
+
import { useSystemActor } from './org-runtime-context.js';
|
|
26
|
+
import { AuthorshipCell, hasSpecialAuthorship } from './provenance.js';
|
|
27
|
+
import { humanizeToken, resolveColumnOptions, translateMetadataLabel } from './dynamic-columns-helpers.js';
|
|
28
|
+
import { objectLabel } from './dynamic-relation-helpers.js';
|
|
29
|
+
import { OptionBadge, RelationThumbnail, ImageStack, statusColorFor, useIsDarkTheme, useImageErrorGuard, } from './display-value.js';
|
|
30
|
+
import { MediaValue } from './rich-url.js';
|
|
31
|
+
import { OptionsContext } from './options-context.js';
|
|
32
|
+
import { DynamicIcon, Icon, isLucideIconName } from './dynamic-icon.js';
|
|
33
|
+
import { CollectionCell } from './collection-cell.js';
|
|
34
|
+
import { ChipsCell, MeterCell, SwatchCell } from './rich-cells.js';
|
|
35
|
+
import { isNilUuid, normalizeNilUuid } from './nil-uuid.js';
|
|
36
|
+
import { useOptionsResolver } from './use-options-resolver.js';
|
|
37
|
+
import { RowActionsMenu } from './row-actions-menu.js';
|
|
38
|
+
import { isColumnVisibleInTable } from './column-visibility.js';
|
|
39
|
+
import { NullBooleanMark } from './tri-state-boolean.js';
|
|
40
40
|
const defaultGetImageUrl = (path) => path;
|
|
41
41
|
const getNestedValue = (obj, path) => path.split('.').reduce((acc, part) => acc && acc[part], obj);
|
|
42
42
|
/**
|
|
@@ -116,7 +116,7 @@ const CodeCell = ({ text, maxLength }) => {
|
|
|
116
116
|
};
|
|
117
117
|
// RowActionMenuItem vive en row-actions-menu.tsx (junto al menú que lo usa);
|
|
118
118
|
// se re-exporta aquí por compatibilidad (dynamic-kanban, hosts).
|
|
119
|
-
export { RowActionMenuItem } from './row-actions-menu';
|
|
119
|
+
export { RowActionMenuItem } from './row-actions-menu.js';
|
|
120
120
|
/**
|
|
121
121
|
* Lifecycle column used by `requiresState`: prefer `status` (workshop, vehicles,
|
|
122
122
|
* …) and fall back to `state` (purchases, inventory transfers, …). Empty string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type DelegatedCreate } from './document-form-dialog';
|
|
3
|
-
import type { DocumentFormsManifest } from './types';
|
|
2
|
+
import { type DelegatedCreate } from './document-form-dialog.js';
|
|
3
|
+
import type { DocumentFormsManifest } from './types.js';
|
|
4
4
|
export interface DynamicCRUDPageStrings {
|
|
5
5
|
refresh?: string;
|
|
6
6
|
export?: string;
|
|
@@ -25,19 +25,19 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
25
25
|
// register a model-extension registry and feed it via `headerExtras`.
|
|
26
26
|
import { useCallback, useEffect, useMemo, useState, } from 'react';
|
|
27
27
|
import { Plus, Download, Upload, RefreshCw } from 'lucide-react';
|
|
28
|
-
import { useApi } from './api-context';
|
|
29
|
-
import { useMetadataCache } from './metadata-cache';
|
|
30
|
-
import { DynamicTable } from './dynamic-table';
|
|
31
|
-
import { DynamicRecordDialog } from './dialogs/dynamic-record';
|
|
32
|
-
import { DocumentFormDialog, resolveDocumentForms, scopeDocumentFormsToFilter, withoutDelegatedTypes, } from './document-form-dialog';
|
|
33
|
-
import { ExportDialog } from './dialogs/export';
|
|
34
|
-
import { ImportDialog } from './dialogs/import';
|
|
35
|
-
import { useModelLabels } from './model-labels';
|
|
36
|
-
import { getModelExtension } from './model-extension-registry';
|
|
37
|
-
import { ModelActionToolbar } from './model-action-toolbar';
|
|
38
|
-
import { BulkImageImportButton } from './bulk-image-dialog';
|
|
39
|
-
import { resolveListPrimaryAction } from './list-primary-action';
|
|
40
|
-
import { useCan, modelCapability } from './permissions-context';
|
|
28
|
+
import { useApi } from './api-context.js';
|
|
29
|
+
import { useMetadataCache } from './metadata-cache.js';
|
|
30
|
+
import { DynamicTable } from './dynamic-table.js';
|
|
31
|
+
import { DynamicRecordDialog } from './dialogs/dynamic-record.js';
|
|
32
|
+
import { DocumentFormDialog, resolveDocumentForms, scopeDocumentFormsToFilter, withoutDelegatedTypes, } from './document-form-dialog.js';
|
|
33
|
+
import { ExportDialog } from './dialogs/export.js';
|
|
34
|
+
import { ImportDialog } from './dialogs/import.js';
|
|
35
|
+
import { useModelLabels } from './model-labels.js';
|
|
36
|
+
import { getModelExtension } from './model-extension-registry.js';
|
|
37
|
+
import { ModelActionToolbar } from './model-action-toolbar.js';
|
|
38
|
+
import { BulkImageImportButton } from './bulk-image-dialog.js';
|
|
39
|
+
import { resolveListPrimaryAction } from './list-primary-action.js';
|
|
40
|
+
import { useCan, modelCapability } from './permissions-context.js';
|
|
41
41
|
const defaultStrings = {
|
|
42
42
|
refresh: 'Refresh',
|
|
43
43
|
export: 'Export',
|
|
@@ -15,7 +15,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
15
15
|
import { useState } from 'react';
|
|
16
16
|
import { Button, Calendar, Popover, PopoverContent, PopoverTrigger, } from '@asteby/metacore-ui/primitives';
|
|
17
17
|
import { CalendarIcon } from 'lucide-react';
|
|
18
|
-
import { parseCalendarDate } from './calendar-date';
|
|
18
|
+
import { parseCalendarDate } from './calendar-date.js';
|
|
19
19
|
const toDate = parseCalendarDate;
|
|
20
20
|
// Format a Date back to "YYYY-MM-DD" (local, no timezone shift).
|
|
21
21
|
function toISO(d) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { ActionFieldDef, FieldOptionsConfig, VisibleWhen } from './types';
|
|
3
|
-
import { applyOptionWhen, getDependsOn } from './option-when';
|
|
2
|
+
import type { ActionFieldDef, FieldOptionsConfig, VisibleWhen } from './types.js';
|
|
3
|
+
import { applyOptionWhen, getDependsOn } from './option-when.js';
|
|
4
4
|
export { applyOptionWhen, getDependsOn };
|
|
5
5
|
/**
|
|
6
6
|
* Apps register validator implementations by slug. The slug is the value
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// callers (and unit tests) can use the zod schema without pulling in React or
|
|
3
3
|
// metacore-ui primitives.
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { fieldValidationOf } from './validator';
|
|
6
|
-
import { applyOptionWhen, getDependsOn } from './option-when';
|
|
7
|
-
import { resolveValidatorToken } from './use-org-config-bridge';
|
|
8
|
-
import { isNullableBooleanField } from './nullable-boolean';
|
|
5
|
+
import { fieldValidationOf } from './validator.js';
|
|
6
|
+
import { applyOptionWhen, getDependsOn } from './option-when.js';
|
|
7
|
+
import { resolveValidatorToken } from './use-org-config-bridge.js';
|
|
8
|
+
import { isNullableBooleanField } from './nullable-boolean.js';
|
|
9
9
|
// Viven en option-when.ts (el validador también los usa); se re-exportan aquí
|
|
10
10
|
// para no romper a quien los importaba de este módulo.
|
|
11
11
|
export { applyOptionWhen, getDependsOn };
|
package/dist/dynamic-form.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { type FormLayout } from './form-layout';
|
|
2
|
-
import type { ActionFieldDef } from './types';
|
|
3
|
-
import { buildZodSchema, resolveWidget } from './dynamic-form-schema';
|
|
1
|
+
import { type FormLayout } from './form-layout.js';
|
|
2
|
+
import type { ActionFieldDef } from './types.js';
|
|
3
|
+
import { buildZodSchema, resolveWidget } from './dynamic-form-schema.js';
|
|
4
4
|
export { buildZodSchema, resolveWidget };
|
|
5
|
-
export { DynamicLineItems } from './dynamic-line-items';
|
|
6
|
-
export { DynamicSelectField } from './dynamic-select-field';
|
|
7
|
-
export { DynamicMultiSelectField } from './dynamic-multi-select-field';
|
|
8
|
-
export { DynamicDateField } from './dynamic-date-field';
|
|
9
|
-
export { UploadField } from './upload-field';
|
|
10
|
-
export { IconPickerField } from './icon-picker-field';
|
|
11
|
-
export { ColorPickerField, DEFAULT_ROLE_COLOR, normalizeHex } from './color-picker-field';
|
|
5
|
+
export { DynamicLineItems } from './dynamic-line-items.js';
|
|
6
|
+
export { DynamicSelectField } from './dynamic-select-field.js';
|
|
7
|
+
export { DynamicMultiSelectField } from './dynamic-multi-select-field.js';
|
|
8
|
+
export { DynamicDateField } from './dynamic-date-field.js';
|
|
9
|
+
export { UploadField } from './upload-field.js';
|
|
10
|
+
export { IconPickerField } from './icon-picker-field.js';
|
|
11
|
+
export { ColorPickerField, DEFAULT_ROLE_COLOR, normalizeHex } from './color-picker-field.js';
|
|
12
12
|
export interface DynamicFormProps {
|
|
13
13
|
fields: ActionFieldDef[];
|
|
14
14
|
initialValues?: Record<string, any>;
|
package/dist/dynamic-form.js
CHANGED
|
@@ -3,33 +3,33 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
// pattern + ActionFieldDef renderer so callers can reuse the form layout
|
|
4
4
|
// outside the full record-edit modal.
|
|
5
5
|
import { useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
6
|
-
import { groupFieldsBySection } from './form-layout';
|
|
7
|
-
import { FieldSection, WizardProgress } from './form-layout-ui';
|
|
8
|
-
import { AssistInterview } from './assist-interview';
|
|
6
|
+
import { groupFieldsBySection } from './form-layout.js';
|
|
7
|
+
import { FieldSection, WizardProgress } from './form-layout-ui.js';
|
|
8
|
+
import { AssistInterview } from './assist-interview.js';
|
|
9
9
|
import { Input, Textarea, Label, Switch, Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@asteby/metacore-ui/primitives';
|
|
10
|
-
import { buildZodSchema, resolveWidget, isLineItemsField, evaluateBalance, applyOptionWhen, getDependsOn, getVisibleWhen, evaluateVisibleWhen, } from './dynamic-form-schema';
|
|
10
|
+
import { buildZodSchema, resolveWidget, isLineItemsField, evaluateBalance, applyOptionWhen, getDependsOn, getVisibleWhen, evaluateVisibleWhen, } from './dynamic-form-schema.js';
|
|
11
11
|
import { ScanLine } from 'lucide-react';
|
|
12
|
-
import { BarcodeScanner } from './barcode-scanner';
|
|
13
|
-
import { getOptionFilter } from './option-filter';
|
|
14
|
-
import { useOptionsResolver } from './use-options-resolver';
|
|
15
|
-
import { DynamicLineItems } from './dynamic-line-items';
|
|
16
|
-
import { DynamicSelectField } from './dynamic-select-field';
|
|
17
|
-
import { DynamicMultiSelectField } from './dynamic-multi-select-field';
|
|
18
|
-
import { DynamicDateField } from './dynamic-date-field';
|
|
19
|
-
import { UploadField } from './upload-field';
|
|
20
|
-
import { IconPickerField } from './icon-picker-field';
|
|
21
|
-
import { ColorPickerField } from './color-picker-field';
|
|
22
|
-
import { getFieldWidget, useFieldWidgetRegistryVersion } from './field-widget-registry';
|
|
23
|
-
import { isBooleanField, isNullableBooleanField, usesTriState } from './nullable-boolean';
|
|
24
|
-
import { TriStateBooleanField } from './tri-state-boolean';
|
|
12
|
+
import { BarcodeScanner } from './barcode-scanner.js';
|
|
13
|
+
import { getOptionFilter } from './option-filter.js';
|
|
14
|
+
import { useOptionsResolver } from './use-options-resolver.js';
|
|
15
|
+
import { DynamicLineItems } from './dynamic-line-items.js';
|
|
16
|
+
import { DynamicSelectField } from './dynamic-select-field.js';
|
|
17
|
+
import { DynamicMultiSelectField } from './dynamic-multi-select-field.js';
|
|
18
|
+
import { DynamicDateField } from './dynamic-date-field.js';
|
|
19
|
+
import { UploadField } from './upload-field.js';
|
|
20
|
+
import { IconPickerField } from './icon-picker-field.js';
|
|
21
|
+
import { ColorPickerField } from './color-picker-field.js';
|
|
22
|
+
import { getFieldWidget, useFieldWidgetRegistryVersion } from './field-widget-registry.js';
|
|
23
|
+
import { isBooleanField, isNullableBooleanField, usesTriState } from './nullable-boolean.js';
|
|
24
|
+
import { TriStateBooleanField } from './tri-state-boolean.js';
|
|
25
25
|
export { buildZodSchema, resolveWidget };
|
|
26
|
-
export { DynamicLineItems } from './dynamic-line-items';
|
|
27
|
-
export { DynamicSelectField } from './dynamic-select-field';
|
|
28
|
-
export { DynamicMultiSelectField } from './dynamic-multi-select-field';
|
|
29
|
-
export { DynamicDateField } from './dynamic-date-field';
|
|
30
|
-
export { UploadField } from './upload-field';
|
|
31
|
-
export { IconPickerField } from './icon-picker-field';
|
|
32
|
-
export { ColorPickerField, DEFAULT_ROLE_COLOR, normalizeHex } from './color-picker-field';
|
|
26
|
+
export { DynamicLineItems } from './dynamic-line-items.js';
|
|
27
|
+
export { DynamicSelectField } from './dynamic-select-field.js';
|
|
28
|
+
export { DynamicMultiSelectField } from './dynamic-multi-select-field.js';
|
|
29
|
+
export { DynamicDateField } from './dynamic-date-field.js';
|
|
30
|
+
export { UploadField } from './upload-field.js';
|
|
31
|
+
export { IconPickerField } from './icon-picker-field.js';
|
|
32
|
+
export { ColorPickerField, DEFAULT_ROLE_COLOR, normalizeHex } from './color-picker-field.js';
|
|
33
33
|
// Valores iniciales del formulario: el registro (edición) gana sobre el default
|
|
34
34
|
// del campo. Se calcula de forma síncrona en el primer render para que ningún
|
|
35
35
|
// widget (p.ej. un Select de Radix) monte con '' y emita un cambio espurio que
|
package/dist/dynamic-icon.js
CHANGED
|
@@ -6,7 +6,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
import dynamicIconImports from 'lucide-react/dynamicIconImports';
|
|
8
8
|
import { Glyph } from '@asteby/metacore-ui/icons';
|
|
9
|
-
import { resolveIconSpec } from './icon-resolvers';
|
|
9
|
+
import { resolveIconSpec } from './icon-resolvers.js';
|
|
10
10
|
function pascalToKebab(pascal) {
|
|
11
11
|
return pascal
|
|
12
12
|
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
package/dist/dynamic-kanban.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { summarizeFilterValues, translateOptionLabels } from './filter-chips';
|
|
3
|
-
import type { RowActionPredicate } from './dynamic-columns-shim';
|
|
4
|
-
import type { TableMetadata, ColumnDefinition, StageMeta, StageTransition } from './types';
|
|
2
|
+
import { summarizeFilterValues, translateOptionLabels } from './filter-chips.js';
|
|
3
|
+
import type { RowActionPredicate } from './dynamic-columns-shim.js';
|
|
4
|
+
import type { TableMetadata, ColumnDefinition, StageMeta, StageTransition } from './types.js';
|
|
5
5
|
export { summarizeFilterValues, translateOptionLabels };
|
|
6
6
|
/**
|
|
7
7
|
* Resolves the board lanes for a kanban view. Prefers the model-level
|
package/dist/dynamic-kanban.js
CHANGED
|
@@ -25,12 +25,12 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
25
25
|
// Transitions: when the metadata carries `transitions[]`, a card may only be
|
|
26
26
|
// dropped into a lane reachable from its current stage. Disallowed lanes dim
|
|
27
27
|
// while dragging and reject the drop.
|
|
28
|
-
import { BOOLEAN_UNSET_FILTER_VALUE } from './nullable-boolean';
|
|
28
|
+
import { BOOLEAN_UNSET_FILTER_VALUE } from './nullable-boolean.js';
|
|
29
29
|
import { useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
30
30
|
import { useTranslation } from 'react-i18next';
|
|
31
|
-
import { useTimeZone, useCurrency, useNumberLocale } from './org-runtime-context';
|
|
31
|
+
import { useTimeZone, useCurrency, useNumberLocale } from './org-runtime-context.js';
|
|
32
32
|
import { QueryClient, QueryClientContext, QueryClientProvider, useQueryClient, } from '@tanstack/react-query';
|
|
33
|
-
import { useI18nResourceVersion } from './use-i18n-resource-version';
|
|
33
|
+
import { useI18nResourceVersion } from './use-i18n-resource-version.js';
|
|
34
34
|
import { DndContext, KeyboardSensor, PointerSensor, closestCenter, defaultDropAnimationSideEffects, pointerWithin, rectIntersection, useSensor, useSensors, useDraggable, useDroppable, } from '@dnd-kit/core';
|
|
35
35
|
import { SortableContext, horizontalListSortingStrategy, sortableKeyboardCoordinates, useSortable, } from '@dnd-kit/sortable';
|
|
36
36
|
import { CSS } from '@dnd-kit/utilities';
|
|
@@ -47,28 +47,28 @@ import { Badge, Button, Card, CardContent, Input, Popover, PopoverContent, Popov
|
|
|
47
47
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from '@asteby/metacore-ui';
|
|
48
48
|
import { ColumnFilterControl, FilterValueCombobox } from '@asteby/metacore-ui/data-table';
|
|
49
49
|
import { generateBadgeStyles, optionColor } from '@asteby/metacore-ui/lib';
|
|
50
|
-
import { useApi } from './api-context';
|
|
51
|
-
import { useRealtimeDefault, useRealtimeTick } from './realtime-context';
|
|
52
|
-
import { useStageAutomations, StageAutomationsButton, } from './stage-automations';
|
|
53
|
-
import { useCustomStages, splitCustomStages, mergeLaneStages, resolveSmartLanes, cardMatchesStageFilters, smartLaneParams, AddStageColumn, CustomStageDialog, CustomStageDeleteDialog, StageConfigDialog, SmartLane, } from './custom-stages';
|
|
54
|
-
import { useStageOverrides } from './stage-overrides';
|
|
55
|
-
import { useDynamicFilters } from './use-dynamic-filters';
|
|
56
|
-
import { FilterChipsRow, summarizeFilterValues, translateOptionLabels, } from './filter-chips';
|
|
57
|
-
import { dedupeById, useInfiniteScrollSentinel } from './use-infinite-scroll';
|
|
58
|
-
import { useOptimisticMutation } from './use-optimistic-mutation';
|
|
59
|
-
import { useFlipAnimation } from './use-flip-animation';
|
|
60
|
-
import { PortalDragOverlay } from './portal-drag-overlay';
|
|
61
|
-
import { objectLabel } from './dynamic-relation-helpers';
|
|
62
|
-
import { useMetadataCache } from './metadata-cache';
|
|
63
|
-
import { cacheScope } from './cache-scope';
|
|
64
|
-
import { useRecordMutationTick } from './use-record-mutation-tick';
|
|
65
|
-
import { useOptionsResolver } from './use-options-resolver';
|
|
66
|
-
import { ActivityValueRenderer } from './activity-value-renderer';
|
|
67
|
-
import { isColumnVisibleInTable } from './column-visibility';
|
|
68
|
-
import { aggregateOf, formatAggregateTotal, isRowActionVisible, lifecycleStageField, relationKeyFor, RowActionMenuItem, } from './dynamic-columns';
|
|
69
|
-
import { useCan, usePermissionsActive, useRoleGate, resolveRowActions } from './permissions-context';
|
|
70
|
-
import { useDynamicRowActions } from './dynamic-row-actions';
|
|
71
|
-
import { useStageLayout } from './stage-layout';
|
|
50
|
+
import { useApi } from './api-context.js';
|
|
51
|
+
import { useRealtimeDefault, useRealtimeTick } from './realtime-context.js';
|
|
52
|
+
import { useStageAutomations, StageAutomationsButton, } from './stage-automations.js';
|
|
53
|
+
import { useCustomStages, splitCustomStages, mergeLaneStages, resolveSmartLanes, cardMatchesStageFilters, smartLaneParams, AddStageColumn, CustomStageDialog, CustomStageDeleteDialog, StageConfigDialog, SmartLane, } from './custom-stages.js';
|
|
54
|
+
import { useStageOverrides } from './stage-overrides.js';
|
|
55
|
+
import { useDynamicFilters } from './use-dynamic-filters.js';
|
|
56
|
+
import { FilterChipsRow, summarizeFilterValues, translateOptionLabels, } from './filter-chips.js';
|
|
57
|
+
import { dedupeById, useInfiniteScrollSentinel } from './use-infinite-scroll.js';
|
|
58
|
+
import { useOptimisticMutation } from './use-optimistic-mutation.js';
|
|
59
|
+
import { useFlipAnimation } from './use-flip-animation.js';
|
|
60
|
+
import { PortalDragOverlay } from './portal-drag-overlay.js';
|
|
61
|
+
import { objectLabel } from './dynamic-relation-helpers.js';
|
|
62
|
+
import { useMetadataCache } from './metadata-cache.js';
|
|
63
|
+
import { cacheScope } from './cache-scope.js';
|
|
64
|
+
import { useRecordMutationTick } from './use-record-mutation-tick.js';
|
|
65
|
+
import { useOptionsResolver } from './use-options-resolver.js';
|
|
66
|
+
import { ActivityValueRenderer } from './activity-value-renderer.js';
|
|
67
|
+
import { isColumnVisibleInTable } from './column-visibility.js';
|
|
68
|
+
import { aggregateOf, formatAggregateTotal, isRowActionVisible, lifecycleStageField, relationKeyFor, RowActionMenuItem, } from './dynamic-columns.js';
|
|
69
|
+
import { useCan, usePermissionsActive, useRoleGate, resolveRowActions } from './permissions-context.js';
|
|
70
|
+
import { useDynamicRowActions } from './dynamic-row-actions.js';
|
|
71
|
+
import { useStageLayout } from './stage-layout.js';
|
|
72
72
|
// Re-exported for tests + backward-compat: these live in ./filter-chips now
|
|
73
73
|
// (shared with DynamicTable) but were historically imported from here.
|
|
74
74
|
export { summarizeFilterValues, translateOptionLabels };
|
|
@@ -11,12 +11,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
import { Input, Textarea, Switch, Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@asteby/metacore-ui/primitives';
|
|
12
12
|
import { useEffect, useRef, useState } from 'react';
|
|
13
13
|
import { Plus, Trash2, Check } from 'lucide-react';
|
|
14
|
-
import { usesTriState } from './nullable-boolean';
|
|
15
|
-
import { TriStateBooleanField } from './tri-state-boolean';
|
|
16
|
-
import { resolveWidget, getItemFields, computeLineItemTotals, applyLineItemRowFormulas, autofillLineFromOption, evaluateBalance, toNumber, getDependsOn, resolveDependsValue, getOptionsConfig, resolveOptionsSource, applyOptionWhen, } from './dynamic-form-schema';
|
|
17
|
-
import { DynamicSelectField, DEFAULT_DEPENDS_HINT } from './dynamic-select-field';
|
|
18
|
-
import { getOptionFilter } from './option-filter';
|
|
19
|
-
import { useOptionsResolver } from './use-options-resolver';
|
|
14
|
+
import { usesTriState } from './nullable-boolean.js';
|
|
15
|
+
import { TriStateBooleanField } from './tri-state-boolean.js';
|
|
16
|
+
import { resolveWidget, getItemFields, computeLineItemTotals, applyLineItemRowFormulas, autofillLineFromOption, evaluateBalance, toNumber, getDependsOn, resolveDependsValue, getOptionsConfig, resolveOptionsSource, applyOptionWhen, } from './dynamic-form-schema.js';
|
|
17
|
+
import { DynamicSelectField, DEFAULT_DEPENDS_HINT } from './dynamic-select-field.js';
|
|
18
|
+
import { getOptionFilter } from './option-filter.js';
|
|
19
|
+
import { useOptionsResolver } from './use-options-resolver.js';
|
|
20
20
|
const fmtNumber = (n) => n.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
21
21
|
/** Numeric columns render right-aligned (debit/credit/amount feel). */
|
|
22
22
|
function isNumericCol(col) {
|
|
@@ -23,13 +23,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
23
23
|
// with ONE `?ids=` lookup (useResolveOptionIds): a chip reads "Cargando…" while
|
|
24
24
|
// it resolves and "(registro eliminado)" when the record is gone — never the id.
|
|
25
25
|
import { useMemo, useState } from 'react';
|
|
26
|
-
import { getOptionFilter } from './option-filter';
|
|
27
|
-
import { RecordPicker } from './record-picker';
|
|
28
|
-
import { OptionLead } from './record-picker-option';
|
|
29
|
-
import { useOptionsResolver } from './use-options-resolver';
|
|
30
|
-
import { useResolveOptionIds } from './use-option-ids';
|
|
31
|
-
import { DELETED_RECORD_LABEL } from './dynamic-select-field';
|
|
32
|
-
import { getFieldRef } from './dynamic-form-schema';
|
|
26
|
+
import { getOptionFilter } from './option-filter.js';
|
|
27
|
+
import { RecordPicker } from './record-picker.js';
|
|
28
|
+
import { OptionLead } from './record-picker-option.js';
|
|
29
|
+
import { useOptionsResolver } from './use-options-resolver.js';
|
|
30
|
+
import { useResolveOptionIds } from './use-option-ids.js';
|
|
31
|
+
import { DELETED_RECORD_LABEL } from './dynamic-select-field.js';
|
|
32
|
+
import { getFieldRef } from './dynamic-form-schema.js';
|
|
33
33
|
export function DynamicMultiSelectField({ field, value, onChange, staticOptions }) {
|
|
34
34
|
const ref = getFieldRef(field);
|
|
35
35
|
const [query, setQuery] = useState('');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActionFieldDef, ColumnDefinition, TableMetadata } from './types';
|
|
1
|
+
import type { ActionFieldDef, ColumnDefinition, TableMetadata } from './types.js';
|
|
2
2
|
export type DynamicRelationKind = 'one_to_many' | 'many_to_many';
|
|
3
3
|
export declare function isManagedRelationColumn(key: string): boolean;
|
|
4
4
|
export declare function relationMediaKind(col: ColumnDefinition): 'image' | 'file' | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isNilUuid } from './nil-uuid';
|
|
2
|
-
import { humanizeToken } from './dynamic-columns-helpers';
|
|
1
|
+
import { isNilUuid } from './nil-uuid.js';
|
|
2
|
+
import { humanizeToken } from './dynamic-columns-helpers.js';
|
|
3
3
|
// An enum-like column renders a single token value (status/select/option/badge)
|
|
4
4
|
// rather than free text, so an unmatched value should be humanized, not leaked.
|
|
5
5
|
function isEnumLikeColumn(col) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { DynamicRelationKind } from './dynamic-relation-helpers';
|
|
2
|
-
export { buildCreatePayload, buildPivotAttachPayload, buildPivotRowIndex, buildRelationFilterParams, deriveRelationFormFields, diffSelection, extractSelectedTargetIds, formatRelationCell, objectLabel, pickOptionLabel, relationRowKey, } from './dynamic-relation-helpers';
|
|
1
|
+
export type { DynamicRelationKind } from './dynamic-relation-helpers.js';
|
|
2
|
+
export { buildCreatePayload, buildPivotAttachPayload, buildPivotRowIndex, buildRelationFilterParams, deriveRelationFormFields, diffSelection, extractSelectedTargetIds, formatRelationCell, objectLabel, pickOptionLabel, relationRowKey, } from './dynamic-relation-helpers.js';
|
|
3
3
|
export interface DynamicRelationStrings {
|
|
4
4
|
title: string;
|
|
5
5
|
emptyState: string;
|
package/dist/dynamic-relation.js
CHANGED
|
@@ -10,22 +10,22 @@ import { flexRender, getCoreRowModel, useReactTable, } from '@tanstack/react-tab
|
|
|
10
10
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
11
11
|
import { Button, Skeleton, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, Dialog, DialogContent, DialogHeader, DialogTitle, Input, MultiSelect, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@asteby/metacore-ui/primitives';
|
|
12
12
|
import { Plus, Trash2, Pencil, Search } from 'lucide-react';
|
|
13
|
-
import { useApi } from './api-context';
|
|
14
|
-
import { useMetadataCache } from './metadata-cache';
|
|
15
|
-
import { cacheScope } from './cache-scope';
|
|
16
|
-
import { OptionsContext } from './options-context';
|
|
17
|
-
import { DynamicForm } from './dynamic-form';
|
|
18
|
-
import { useImageUrl } from './image-url-context';
|
|
19
|
-
import { useTimeZone, useCurrency } from './org-runtime-context';
|
|
20
|
-
import { makeDefaultGetDynamicColumns } from './dynamic-columns';
|
|
21
|
-
import { isColumnVisibleInLineSubtable } from './column-visibility';
|
|
22
|
-
import { useOptionsResolver } from './use-options-resolver';
|
|
23
|
-
import { dedupeById, useInfiniteScrollSentinel } from './use-infinite-scroll';
|
|
13
|
+
import { useApi } from './api-context.js';
|
|
14
|
+
import { useMetadataCache } from './metadata-cache.js';
|
|
15
|
+
import { cacheScope } from './cache-scope.js';
|
|
16
|
+
import { OptionsContext } from './options-context.js';
|
|
17
|
+
import { DynamicForm } from './dynamic-form.js';
|
|
18
|
+
import { useImageUrl } from './image-url-context.js';
|
|
19
|
+
import { useTimeZone, useCurrency } from './org-runtime-context.js';
|
|
20
|
+
import { makeDefaultGetDynamicColumns } from './dynamic-columns.js';
|
|
21
|
+
import { isColumnVisibleInLineSubtable } from './column-visibility.js';
|
|
22
|
+
import { useOptionsResolver } from './use-options-resolver.js';
|
|
23
|
+
import { dedupeById, useInfiniteScrollSentinel } from './use-infinite-scroll.js';
|
|
24
24
|
import { toast } from 'sonner';
|
|
25
|
-
import { RelationGallery } from './relation-gallery';
|
|
26
|
-
import { extractUploadedValue, readImageSize } from './upload-field';
|
|
27
|
-
import { buildCreatePayload, buildPivotAttachPayload, buildPivotRowIndex, buildRelationFilterParams, deriveRelationFormFields, diffSelection, extractSelectedTargetIds, pickOptionLabel, relationColumnUi, relationDerivedValues, galleryLeadImage, contiguousPositionUpdates, relationGalleryColumn, relationInitialValues, relationPositionKey, relationPositionSortable, relationRowKey, sortRelationRows, } from './dynamic-relation-helpers';
|
|
28
|
-
export { buildCreatePayload, buildPivotAttachPayload, buildPivotRowIndex, buildRelationFilterParams, deriveRelationFormFields, diffSelection, extractSelectedTargetIds, formatRelationCell, objectLabel, pickOptionLabel, relationRowKey, } from './dynamic-relation-helpers';
|
|
25
|
+
import { RelationGallery } from './relation-gallery.js';
|
|
26
|
+
import { extractUploadedValue, readImageSize } from './upload-field.js';
|
|
27
|
+
import { buildCreatePayload, buildPivotAttachPayload, buildPivotRowIndex, buildRelationFilterParams, deriveRelationFormFields, diffSelection, extractSelectedTargetIds, pickOptionLabel, relationColumnUi, relationDerivedValues, galleryLeadImage, contiguousPositionUpdates, relationGalleryColumn, relationInitialValues, relationPositionKey, relationPositionSortable, relationRowKey, sortRelationRows, } from './dynamic-relation-helpers.js';
|
|
28
|
+
export { buildCreatePayload, buildPivotAttachPayload, buildPivotRowIndex, buildRelationFilterParams, deriveRelationFormFields, diffSelection, extractSelectedTargetIds, formatRelationCell, objectLabel, pickOptionLabel, relationRowKey, } from './dynamic-relation-helpers.js';
|
|
29
29
|
const DEFAULT_STRINGS = {
|
|
30
30
|
title: '',
|
|
31
31
|
emptyState: 'No hay registros relacionados.',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type DynamicRelationStrings } from './dynamic-relation';
|
|
2
|
-
import type { RelationMeta } from './types';
|
|
1
|
+
import { type DynamicRelationStrings } from './dynamic-relation.js';
|
|
2
|
+
import type { RelationMeta } from './types.js';
|
|
3
3
|
export interface DynamicRelationsProps {
|
|
4
4
|
/**
|
|
5
5
|
* The parent record. Its `id` (or `parentIdKey`) seeds every child list's
|