@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.
- package/CHANGELOG.md +25 -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 +2 -2
- package/dist/dashboard-grid.d.ts.map +1 -1
- package/dist/dashboard-grid.js +22 -20
- package/dist/dashboard-types.d.ts +6 -0
- package/dist/dashboard-types.d.ts.map +1 -1
- 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 +11 -3
- package/dist/dynamic-columns.d.ts.map +1 -1
- package/dist/dynamic-columns.js +52 -26
- package/dist/dynamic-crud-page.d.ts +2 -2
- package/dist/dynamic-crud-page.d.ts.map +1 -1
- package/dist/dynamic-crud-page.js +22 -19
- 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 +5 -3
- package/dist/dynamic-table.d.ts.map +1 -1
- package/dist/dynamic-table.js +48 -36
- 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 -163
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +148 -147
- 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/model-labels.d.ts +38 -0
- package/dist/model-labels.d.ts.map +1 -0
- package/dist/model-labels.js +35 -0
- 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 +4 -1
- package/dist/types.d.ts.map +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 +10 -10
- package/src/__tests__/host-api-client.test.tsx +16 -0
- package/src/__tests__/host-api.test.ts +50 -0
- package/src/__tests__/initials-avatar-cell.test.tsx +54 -0
- package/src/__tests__/load-guard.test.tsx +94 -0
- package/src/__tests__/model-labels.test.tsx +31 -0
- package/src/dashboard-grid.tsx +49 -35
- package/src/dashboard-types.ts +6 -0
- package/src/dynamic-columns.tsx +40 -9
- package/src/dynamic-crud-page.tsx +10 -7
- package/src/dynamic-table.tsx +38 -12
- package/src/host-api-client.ts +31 -14
- package/src/host-api.ts +54 -1
- package/src/index.ts +5 -1
- package/src/model-labels.ts +80 -0
- package/src/types.ts +3 -0
- package/src/use-host-api-client.ts +5 -3
|
@@ -6,8 +6,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { Circle } from 'lucide-react';
|
|
8
8
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
9
|
-
import { DynamicIcon } from '../dynamic-icon';
|
|
10
|
-
import { formatFieldValue } from './format';
|
|
9
|
+
import { DynamicIcon } from '../dynamic-icon.js';
|
|
10
|
+
import { formatFieldValue } from './format.js';
|
|
11
11
|
const TONE_DOT = {
|
|
12
12
|
neutral: 'text-muted-foreground',
|
|
13
13
|
info: 'text-[var(--info,oklch(0.55_0.13_235))]',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DocumentContext, DocumentSpec, Predicate, ResolvedActionLayout, StatusDef, StatusMachine, When } from './types';
|
|
1
|
+
import type { DocumentContext, DocumentSpec, Predicate, ResolvedActionLayout, StatusDef, StatusMachine, When } from './types.js';
|
|
2
2
|
/** Máximo de secundarias visibles; el resto pasa a «Más…» (§5.2 / §6.2). */
|
|
3
3
|
export declare const MAX_VISIBLE_SECONDARY = 3;
|
|
4
4
|
/**
|
package/dist/document/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export { MAX_VISIBLE_SECONDARY, evaluatePredicate, evaluateWhen, interpolate, pruneUnavailableActions, readPath, resolveActions, resolveStatus, resolveTitle, } from './evaluate';
|
|
3
|
-
export { formatFieldValue, type FieldFormatOptions } from './format';
|
|
4
|
-
export { StatusBadge, STATUS_TONE_STYLE, type StatusBadgeProps } from './status-badge';
|
|
5
|
-
export { ActionBar, type ActionBarProps } from './action-bar';
|
|
6
|
-
export { DocumentSecondaryBar, type DocumentSecondaryBarProps, type SecondaryBarItem } from './secondary-bar';
|
|
7
|
-
export { DocumentHeader, type DocumentHeaderProps, type HeaderBadge, type HeaderMetric } from './document-header';
|
|
8
|
-
export { SmartButtons, type SmartButtonItem, type SmartButtonsProps } from './smart-buttons';
|
|
9
|
-
export { DocumentTimeline, type DocumentTimelineProps, type TimelineEntry } from './document-timeline';
|
|
10
|
-
export { CancelWithReason, type CancelPayload, type CancelReason, type CancelWithReasonProps } from './cancel-with-reason';
|
|
11
|
-
export { DocumentPage, type DocumentPageProps } from './document-page';
|
|
12
|
-
export { useDocumentSources, type DocumentSourcesState } from './use-document-sources';
|
|
13
|
-
export { clearDocumentPages, findStatusMachine, getDocumentPage, registerDocumentPage, type DocumentPageRegistration, } from './registry';
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export { MAX_VISIBLE_SECONDARY, evaluatePredicate, evaluateWhen, interpolate, pruneUnavailableActions, readPath, resolveActions, resolveStatus, resolveTitle, } from './evaluate.js';
|
|
3
|
+
export { formatFieldValue, type FieldFormatOptions } from './format.js';
|
|
4
|
+
export { StatusBadge, STATUS_TONE_STYLE, type StatusBadgeProps } from './status-badge.js';
|
|
5
|
+
export { ActionBar, type ActionBarProps } from './action-bar.js';
|
|
6
|
+
export { DocumentSecondaryBar, type DocumentSecondaryBarProps, type SecondaryBarItem } from './secondary-bar.js';
|
|
7
|
+
export { DocumentHeader, type DocumentHeaderProps, type HeaderBadge, type HeaderMetric } from './document-header.js';
|
|
8
|
+
export { SmartButtons, type SmartButtonItem, type SmartButtonsProps } from './smart-buttons.js';
|
|
9
|
+
export { DocumentTimeline, type DocumentTimelineProps, type TimelineEntry } from './document-timeline.js';
|
|
10
|
+
export { CancelWithReason, type CancelPayload, type CancelReason, type CancelWithReasonProps } from './cancel-with-reason.js';
|
|
11
|
+
export { DocumentPage, type DocumentPageProps } from './document-page.js';
|
|
12
|
+
export { useDocumentSources, type DocumentSourcesState } from './use-document-sources.js';
|
|
13
|
+
export { clearDocumentPages, findStatusMachine, getDocumentPage, registerDocumentPage, type DocumentPageRegistration, } from './registry.js';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/document/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export { MAX_VISIBLE_SECONDARY, evaluatePredicate, evaluateWhen, interpolate, pruneUnavailableActions, readPath, resolveActions, resolveStatus, resolveTitle, } from './evaluate';
|
|
3
|
-
export { formatFieldValue } from './format';
|
|
4
|
-
export { StatusBadge, STATUS_TONE_STYLE } from './status-badge';
|
|
5
|
-
export { ActionBar } from './action-bar';
|
|
6
|
-
export { DocumentSecondaryBar } from './secondary-bar';
|
|
7
|
-
export { DocumentHeader } from './document-header';
|
|
8
|
-
export { SmartButtons } from './smart-buttons';
|
|
9
|
-
export { DocumentTimeline } from './document-timeline';
|
|
10
|
-
export { CancelWithReason } from './cancel-with-reason';
|
|
11
|
-
export { DocumentPage } from './document-page';
|
|
12
|
-
export { useDocumentSources } from './use-document-sources';
|
|
13
|
-
export { clearDocumentPages, findStatusMachine, getDocumentPage, registerDocumentPage, } from './registry';
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export { MAX_VISIBLE_SECONDARY, evaluatePredicate, evaluateWhen, interpolate, pruneUnavailableActions, readPath, resolveActions, resolveStatus, resolveTitle, } from './evaluate.js';
|
|
3
|
+
export { formatFieldValue } from './format.js';
|
|
4
|
+
export { StatusBadge, STATUS_TONE_STYLE } from './status-badge.js';
|
|
5
|
+
export { ActionBar } from './action-bar.js';
|
|
6
|
+
export { DocumentSecondaryBar } from './secondary-bar.js';
|
|
7
|
+
export { DocumentHeader } from './document-header.js';
|
|
8
|
+
export { SmartButtons } from './smart-buttons.js';
|
|
9
|
+
export { DocumentTimeline } from './document-timeline.js';
|
|
10
|
+
export { CancelWithReason } from './cancel-with-reason.js';
|
|
11
|
+
export { DocumentPage } from './document-page.js';
|
|
12
|
+
export { useDocumentSources } from './use-document-sources.js';
|
|
13
|
+
export { clearDocumentPages, findStatusMachine, getDocumentPage, registerDocumentPage, } from './registry.js';
|
|
@@ -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
|
*
|
|
@@ -189,6 +189,14 @@ export declare function resolveActorDisplayName(raw: unknown): string | undefine
|
|
|
189
189
|
* any backend that stores just `"2.png"` next to a nested key) and the value
|
|
190
190
|
* branch injected basePath into already-rooted paths (junk URLs).
|
|
191
191
|
*/
|
|
192
|
+
/**
|
|
193
|
+
* Whether `raw` can plausibly be an image reference (URL, data/blob URI,
|
|
194
|
+
* rooted/relative path or a file name with an image extension). A plain label
|
|
195
|
+
* such as "Ana Perez" — what a backend sends when it fills `avatar` with the
|
|
196
|
+
* display name instead of a file — is NOT, and must never be turned into a
|
|
197
|
+
* request (it used to become `apiBaseUrl + "Ana Perez"`, a 404 per row).
|
|
198
|
+
*/
|
|
199
|
+
export declare const looksLikeImageRef: (raw: string) => boolean;
|
|
192
200
|
export declare const resolveAvatarSrc: (col: ColumnDefinition, row: any, value: any, apiBaseUrl?: string) => string | undefined;
|
|
193
201
|
/**
|
|
194
202
|
* Resolves the source of a `type: 'image'` cell with the same contract as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-columns.d.ts","sourceRoot":"","sources":["../src/dynamic-columns.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"dynamic-columns.d.ts","sourceRoot":"","sources":["../src/dynamic-columns.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AA8C9C,OAAO,KAAK,EAAiB,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG9D,OAAO,KAAK,EAER,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,wBAAwB,CAAA;AAE/B,qEAAqE;AACrE,MAAM,WAAW,qBAAqB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,KAAK,MAAM,CAAA;CACtE;AA0BD;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,gBAAgB,EAAE,cAAc,MAAM,KAAG,MACzB,CAAA;AAQrD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,gBAAgB,KAAG,MAAM,GAAG,SAG5D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAC7B,KAAK,gBAAgB,EACrB,OAAO,OAAO,EACd,WAAW,MAAM,EACjB,SAAS,MAAM,KAChB,MAyBF,CAAA;AA2CD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAwBtD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,GAAI,QAAQ,GAAG,EAAE,KAAK,GAAG,EAAE,aAAa,MAAM,KAAG,OAMvF,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,GAAG,EAAE,KAAK,GAAG,KAAG,OAG5D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,GAAG,EAAE,KAAK,GAAG,KAAG,OAyDzD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC3B,QAAQ,GAAG,EACX,KAAK,GAAG,EACR,aAAa,MAAM,EACnB,YAAY,kBAAkB,KAC/B,OAUF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,UAAU,GAAG,KAAG,MAAM,GAAG,SACmD,CAAA;AAkHhH;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,KAAG,MAGnE,CAAA;AAED,6EAA6E;AAC7E,eAAO,MAAM,eAAe,2DAA4D,CAAA;AAExF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAC1B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,MAAM,GAClB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAiD5C;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,gBAAgB,EAAE,KAAK,GAAG,KAAG,MAWtE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,gBAAgB,EAAE,KAAK,GAAG,KAAG,MAOtE,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,GACjE,MAAM,CAKR;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAYT;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOxE;AAED;;;;;;;;;;;;;;GAcG;AACH;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,OAM/C,CAAA;AAED,eAAO,MAAM,gBAAgB,GACzB,KAAK,gBAAgB,EACrB,KAAK,GAAG,EACR,OAAO,GAAG,EACV,mBAAe,KAChB,MAAM,GAAG,SAoBX,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GACxB,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,mBAAe,EACf,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,KAAK,MAAM,KACpE,MAMF,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,KAAK,gBAAgB,EAAE,KAAK,GAAG,KAAG,MAOzE,CAAA;AAsMD;;;;GAIG;AACH;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAA;IACd,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACrC,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;CAClB,CAqBA,CAAA;AAsBD,wBAAgB,4BAA4B,CACxC,OAAO,GAAE,qBAA0B,GACpC,iBAAiB,CA20BnB;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,iBACL,CAAA"}
|
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
|
-
import { generateBadgeStyles, getInitials, 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';
|
|
22
|
+
import { generateBadgeStyles, getInitials, optionColor, relationChipStyles, } from '@asteby/metacore-ui/lib';
|
|
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
|
|
@@ -544,6 +544,23 @@ export function resolveActorDisplayName(raw) {
|
|
|
544
544
|
* any backend that stores just `"2.png"` next to a nested key) and the value
|
|
545
545
|
* branch injected basePath into already-rooted paths (junk URLs).
|
|
546
546
|
*/
|
|
547
|
+
/**
|
|
548
|
+
* Whether `raw` can plausibly be an image reference (URL, data/blob URI,
|
|
549
|
+
* rooted/relative path or a file name with an image extension). A plain label
|
|
550
|
+
* such as "Ana Perez" — what a backend sends when it fills `avatar` with the
|
|
551
|
+
* display name instead of a file — is NOT, and must never be turned into a
|
|
552
|
+
* request (it used to become `apiBaseUrl + "Ana Perez"`, a 404 per row).
|
|
553
|
+
*/
|
|
554
|
+
export const looksLikeImageRef = (raw) => {
|
|
555
|
+
const v = raw.trim();
|
|
556
|
+
if (!v)
|
|
557
|
+
return false;
|
|
558
|
+
if (/^(https?:|data:image\/|blob:)/i.test(v) || v.startsWith('/'))
|
|
559
|
+
return true;
|
|
560
|
+
if (/\s/.test(v))
|
|
561
|
+
return false;
|
|
562
|
+
return v.includes('/') || /\.(png|jpe?g|gif|webp|avif|svg|bmp|ico)(\?.*)?$/i.test(v);
|
|
563
|
+
};
|
|
547
564
|
export const resolveAvatarSrc = (col, row, value, apiBaseUrl = '') => {
|
|
548
565
|
let raw;
|
|
549
566
|
// Explicit per-row logo column (`display_config.image_field`) wins.
|
|
@@ -562,7 +579,7 @@ export const resolveAvatarSrc = (col, row, value, apiBaseUrl = '') => {
|
|
|
562
579
|
}
|
|
563
580
|
if (!raw && value !== undefined && value !== null && value !== '')
|
|
564
581
|
raw = String(value);
|
|
565
|
-
if (!raw)
|
|
582
|
+
if (!raw || !looksLikeImageRef(raw))
|
|
566
583
|
return undefined;
|
|
567
584
|
if (raw.startsWith('http') || raw.startsWith('/'))
|
|
568
585
|
return raw;
|
|
@@ -673,10 +690,12 @@ const ReferenceCell = ({ col, row }) => {
|
|
|
673
690
|
* well as the `creator`/`user` cellStyles. Paths are parameterised so the same
|
|
674
691
|
* JSX serves every variant.
|
|
675
692
|
*/
|
|
676
|
-
const AvatarCell = ({ name, desc, avatarSrc, getImageUrl, shape, color }) => {
|
|
693
|
+
const AvatarCell = ({ name, desc, avatarSrc, getImageUrl, shape, color, autoColor }) => {
|
|
677
694
|
const radius = shape === 'circle' ? 'rounded-full' : 'rounded-lg';
|
|
678
|
-
|
|
679
|
-
|
|
695
|
+
// Brand colour wins; with `autoColor` a stable per-name colour (same hash as
|
|
696
|
+
// every other avatar in the platform) so the imageless case needs no backend colour.
|
|
697
|
+
const brand = brandAvatarColors(color) ?? (autoColor ? brandAvatarColors(`#${optionColor(name)}`) : undefined);
|
|
698
|
+
return (_jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [_jsxs(Avatar, { className: `h-8 w-8 ${radius} ring-1 ring-border/50`, children: [avatarSrc ? (_jsx(AvatarImage, { src: getImageUrl(avatarSrc), alt: name, className: shape === 'circle' ? 'object-cover' : 'object-contain p-0.5' })) : null, _jsx(AvatarFallback, { className: `text-[10px] font-bold ${radius} ${brand ? '' : 'bg-primary/5 text-primary'}`, style: brand ? { backgroundColor: brand.background, color: brand.color } : undefined, children: getInitials(name) })] }), _jsxs("div", { className: "flex flex-col min-w-0 overflow-hidden", children: [_jsx("span", { className: "font-medium text-sm truncate leading-none mb-0.5 text-foreground/90", children: name }), desc && (_jsx("span", { className: "text-[11px] text-muted-foreground truncate leading-none", children: desc }))] })] }));
|
|
680
699
|
};
|
|
681
700
|
/**
|
|
682
701
|
* Avatar cell for the system actor: the OrgRuntimeProvider `systemActor`
|
|
@@ -918,6 +937,8 @@ export function makeDefaultGetDynamicColumns(helpers = {}) {
|
|
|
918
937
|
return _jsx("span", { className: "text-muted-foreground", children: "-" });
|
|
919
938
|
return (_jsxs("div", { className: "flex items-center gap-1.5 text-muted-foreground", title: formatted.title, children: [_jsx(Calendar, { className: "h-3.5 w-3.5 opacity-70" }), _jsx("span", { className: "text-sm font-medium", children: formatted.display })] }));
|
|
920
939
|
}
|
|
940
|
+
case 'initial':
|
|
941
|
+
case 'initials':
|
|
921
942
|
case 'search':
|
|
922
943
|
case 'avatar':
|
|
923
944
|
case 'creator':
|
|
@@ -959,8 +980,13 @@ export function makeDefaultGetDynamicColumns(helpers = {}) {
|
|
|
959
980
|
if (!resolvedName && isSystemActorColumn(renderAs, col.key, namePath)) {
|
|
960
981
|
return (_jsx(SystemActorCell, { fallbackName: String(name), desc: desc ? String(desc) : undefined, getImageUrl: getImageUrl }));
|
|
961
982
|
}
|
|
962
|
-
|
|
963
|
-
|
|
983
|
+
// `initial`/`initials`: declarative imageless avatar — never
|
|
984
|
+
// resolves a source, so it can't hit the network.
|
|
985
|
+
const isInitialStyle = renderAs === 'initial' || renderAs === 'initials';
|
|
986
|
+
const avatarSrc = isInitialStyle
|
|
987
|
+
? undefined
|
|
988
|
+
: resolveAvatarSrc(col, row.original, value, apiBaseUrl);
|
|
989
|
+
return (_jsx(AvatarCell, { name: String(name), desc: desc ? String(desc) : undefined, avatarSrc: avatarSrc, getImageUrl: getImageUrl, shape: avatarShape, color: brandColor ? String(brandColor) : undefined, autoColor: isInitialStyle || styleCfg(col, 'tone') === 'auto' }));
|
|
964
990
|
}
|
|
965
991
|
case 'relative_date': {
|
|
966
992
|
const fmt = formatDateCell(value, 'datetime', dateLocale, timeZone);
|
|
@@ -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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-crud-page.d.ts","sourceRoot":"","sources":["../src/dynamic-crud-page.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAKN,MAAM,OAAO,CAAA;AAMd,OAAO,EAKH,KAAK,eAAe,EACvB,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"dynamic-crud-page.d.ts","sourceRoot":"","sources":["../src/dynamic-crud-page.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAKN,MAAM,OAAO,CAAA;AAMd,OAAO,EAKH,KAAK,eAAe,EACvB,MAAM,wBAAwB,CAAA;AAS/B,OAAO,KAAK,EAAE,qBAAqB,EAAiB,MAAM,SAAS,CAAA;AAEnE,MAAM,WAAW,sBAAsB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;mDAC+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AASD,MAAM,WAAW,sBAAsB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,oBAAoB;IACjC,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;IACb,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,sBAAsB,CAAA;IAC7B,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,8DAA8D;IAC9D,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC/B,sDAAsD;IACtD,OAAO,CAAC,EAAE,sBAAsB,CAAA;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAA;IACrC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B;;;;OAIG;IACH,aAAa,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;IACvE;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAA;CACvD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBAsP1D"}
|
|
@@ -25,18 +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 {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
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';
|
|
40
41
|
const defaultStrings = {
|
|
41
42
|
refresh: 'Refresh',
|
|
42
43
|
export: 'Export',
|
|
@@ -86,12 +87,14 @@ export function DynamicCRUDPage(props) {
|
|
|
86
87
|
cancelled = true;
|
|
87
88
|
};
|
|
88
89
|
}, [model, cachedMeta, api]);
|
|
89
|
-
const title
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
const { title, newLabel: resolvedNewLabel } = useModelLabels({
|
|
91
|
+
model,
|
|
92
|
+
title: metadata?.title,
|
|
93
|
+
titleKey: metadata?.titleKey ?? metadata?.title_key,
|
|
94
|
+
titleOverride: titleOverride ?? ext?.title,
|
|
95
|
+
newLabelOverride: newLabel ?? ext?.newLabel,
|
|
96
|
+
newPrefix: strings.newPrefix,
|
|
97
|
+
});
|
|
95
98
|
const enableCRUD = metadata?.enableCRUDActions ?? false;
|
|
96
99
|
// Una sola primaria: placement create, replaces_create, create_mode o la
|
|
97
100
|
// extensión del modelo ocultan el Crear genérico. El shell de ops debe
|
|
@@ -140,5 +143,5 @@ export function DynamicCRUDPage(props) {
|
|
|
140
143
|
const titleCls = classes?.title ?? 'text-2xl font-bold tracking-tight';
|
|
141
144
|
const toolbarCls = classes?.toolbar ?? 'flex items-center gap-2';
|
|
142
145
|
const tableWrapperCls = classes?.tableWrapper ?? 'flex-1 min-h-0';
|
|
143
|
-
return (_jsxs("div", { className: rootCls, children: [_jsxs("div", { className: containerCls, children: [ext?.headerExtras && _jsx(ext.headerExtras, { model: model, onRefresh: handleRefresh }), headerExtras, _jsxs("div", { className: headerCls, children: [metadata ? (_jsx("h1", { className: titleCls, children: title })) : (_jsx("div", { className: 'h-8 w-48 bg-muted rounded animate-pulse' })), _jsxs("div", { className: toolbarCls, children: [showRefresh && (_jsx("button", { type: 'button', onClick: handleRefresh, "aria-label": strings.refresh, className: 'inline-flex items-center justify-center size-9 rounded-md border border-border bg-background hover:bg-accent text-foreground', children: _jsx(RefreshCw, { className: 'size-4' }) })), metadata && showExport && (_jsxs("button", { type: 'button', onClick: () => setOpenExport(true), className: 'inline-flex items-center gap-2 h-9 px-3 rounded-md border border-border bg-background hover:bg-accent text-sm font-medium text-foreground', children: [_jsx(Download, { className: 'size-4' }), strings.export] })), metadata && showImport && (_jsxs("button", { type: 'button', onClick: () => setOpenImport(true), className: 'inline-flex items-center gap-2 h-9 px-3 rounded-md border border-border bg-background hover:bg-accent text-sm font-medium text-foreground', children: [_jsx(Upload, { className: 'size-4' }), strings.import] })), metadata && !scoped.hideCreate && can(modelCapability(model, 'create')) && _jsx(BulkImageImportButton, { model: model, metadata: metadata, onChange: handleRefresh }), ext?.toolbarExtras && _jsx(ext.toolbarExtras, { model: model, onRefresh: handleRefresh }), toolbarExtras, _jsx(ModelActionToolbar, { model: model, endpoint: dataEndpoint, actions: metadata?.actions, primaryActionKey: ext?.primaryActionKey, onChange: handleRefresh }), showCreate && (_jsxs("button", { type: 'button', "data-primary": 'true', onClick: () => setOpenCreate(true), className: 'inline-flex items-center gap-2 h-9 px-3 rounded-md bg-primary text-primary-foreground hover:opacity-90 text-sm font-medium', children: [_jsx(Plus, { className: 'size-4' }), resolvedNewLabel
|
|
146
|
+
return (_jsxs("div", { className: rootCls, children: [_jsxs("div", { className: containerCls, children: [ext?.headerExtras && _jsx(ext.headerExtras, { model: model, onRefresh: handleRefresh }), headerExtras, _jsxs("div", { className: headerCls, children: [metadata ? (_jsx("h1", { className: titleCls, children: title })) : (_jsx("div", { className: 'h-8 w-48 bg-muted rounded animate-pulse' })), _jsxs("div", { className: toolbarCls, children: [showRefresh && (_jsx("button", { type: 'button', onClick: handleRefresh, "aria-label": strings.refresh, className: 'inline-flex items-center justify-center size-9 rounded-md border border-border bg-background hover:bg-accent text-foreground', children: _jsx(RefreshCw, { className: 'size-4' }) })), metadata && showExport && (_jsxs("button", { type: 'button', onClick: () => setOpenExport(true), className: 'inline-flex items-center gap-2 h-9 px-3 rounded-md border border-border bg-background hover:bg-accent text-sm font-medium text-foreground', children: [_jsx(Download, { className: 'size-4' }), strings.export] })), metadata && showImport && (_jsxs("button", { type: 'button', onClick: () => setOpenImport(true), className: 'inline-flex items-center gap-2 h-9 px-3 rounded-md border border-border bg-background hover:bg-accent text-sm font-medium text-foreground', children: [_jsx(Upload, { className: 'size-4' }), strings.import] })), metadata && !scoped.hideCreate && can(modelCapability(model, 'create')) && _jsx(BulkImageImportButton, { model: model, metadata: metadata, onChange: handleRefresh }), ext?.toolbarExtras && _jsx(ext.toolbarExtras, { model: model, onRefresh: handleRefresh }), toolbarExtras, _jsx(ModelActionToolbar, { model: model, endpoint: dataEndpoint, actions: metadata?.actions, primaryActionKey: ext?.primaryActionKey, onChange: handleRefresh }), showCreate && (_jsxs("button", { type: 'button', "data-primary": 'true', onClick: () => setOpenCreate(true), className: 'inline-flex items-center gap-2 h-9 px-3 rounded-md bg-primary text-primary-foreground hover:opacity-90 text-sm font-medium', children: [_jsx(Plus, { className: 'size-4' }), resolvedNewLabel] }))] })] }), _jsx("div", { className: tableWrapperCls, children: _jsx(DynamicTable, { model: model, endpoint: dataEndpoint, refreshTrigger: refreshKey, defaultFilters: tableFilters }, model) })] }), showCreate && guidedForms && (_jsx(DocumentFormDialog, { open: openCreate, onOpenChange: setOpenCreate, model: model, endpoint: dataEndpoint, forms: guidedForms, initialType: initialCreate?.type, initialSource: initialCreate?.source, onSaved: handleRefresh, onDelegateCreate: onDelegateCreate })), showCreate && !guidedForms && (_jsx(DynamicRecordDialog, { open: openCreate && !initialCreate?.source, onOpenChange: setOpenCreate, mode: 'create', model: model, endpoint: dataEndpoint, onSaved: handleRefresh })), metadata && showExport && (_jsx(ExportDialog, { open: openExport, onOpenChange: setOpenExport, model: model, metadata: metadata })), metadata && showImport && (_jsx(ImportDialog, { open: openImport, onOpenChange: setOpenImport, model: model, metadata: metadata, onImported: handleRefresh }))] }));
|
|
144
147
|
}
|
|
@@ -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>;
|