@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
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { pickText, domainOf, humanizeSegment, servesMarket, resolveCapability, recommendProvider, groupByDomain, activeMarkets, bundleSelections, storedSelections, choiceBlock, checkoutBlockers, changeImpact, providerStatus, usableCapabilities, needsProviderChoice, competingProviderAddons, } from './model';
|
|
2
|
-
export { moveItem, moveId, dropIndexFromPointer } from './reorder';
|
|
3
|
-
export { ProviderSortableList, sortableOrder, DEFAULT_PROVIDER_LIST_LABELS, } from './provider-sortable-list';
|
|
1
|
+
export { pickText, domainOf, humanizeSegment, servesMarket, resolveCapability, recommendProvider, groupByDomain, activeMarkets, bundleSelections, storedSelections, choiceBlock, checkoutBlockers, changeImpact, providerStatus, usableCapabilities, needsProviderChoice, competingProviderAddons, } from './model.js';
|
|
2
|
+
export { moveItem, moveId, dropIndexFromPointer } from './reorder.js';
|
|
3
|
+
export { ProviderSortableList, sortableOrder, DEFAULT_PROVIDER_LIST_LABELS, } from './provider-sortable-list.js';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* and replace the order of the eligible ones with what is emitted here.
|
|
17
17
|
*/
|
|
18
18
|
import * as React from 'react';
|
|
19
|
-
import type { ProviderStatus } from './model';
|
|
19
|
+
import type { ProviderStatus } from './model.js';
|
|
20
20
|
export interface ProviderSortableItem {
|
|
21
21
|
id: string;
|
|
22
22
|
/**
|
|
@@ -18,7 +18,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
18
18
|
*/
|
|
19
19
|
import * as React from 'react';
|
|
20
20
|
import { useTranslation } from 'react-i18next';
|
|
21
|
-
import { dropIndexFromPointer, moveId } from './reorder';
|
|
21
|
+
import { dropIndexFromPointer, moveId } from './reorder.js';
|
|
22
22
|
/** Spanish defaults, kept as a plain constant for hosts that want to spread/override it. */
|
|
23
23
|
export const DEFAULT_PROVIDER_LIST_LABELS = {
|
|
24
24
|
ready: 'Listo',
|
package/dist/collection-cell.js
CHANGED
|
@@ -9,7 +9,7 @@ import * as React from 'react';
|
|
|
9
9
|
import { Box, List } from 'lucide-react';
|
|
10
10
|
import { Avatar, AvatarFallback, AvatarImage, Badge, Popover, PopoverContent, PopoverTrigger, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, cn, } from '@asteby/metacore-ui';
|
|
11
11
|
import { getInitials, relationChipStyles } from '@asteby/metacore-ui/lib';
|
|
12
|
-
import { humanizeToken } from './dynamic-columns-helpers';
|
|
12
|
+
import { humanizeToken } from './dynamic-columns-helpers.js';
|
|
13
13
|
/**
|
|
14
14
|
* Tracks the host's dark-mode class on <html> so relation chips pick a tint
|
|
15
15
|
* tuned for the active theme. Replicated from dynamic-columns (kept local to
|
package/dist/custom-stages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ApiClient } from './api-context';
|
|
3
|
-
import type { ColumnDefinition, StageMeta, SmartLaneMeta } from './types';
|
|
2
|
+
import type { ApiClient } from './api-context.js';
|
|
3
|
+
import type { ColumnDefinition, StageMeta, SmartLaneMeta } from './types.js';
|
|
4
4
|
export type CustomStageType = 'stage' | 'smart';
|
|
5
5
|
export type CustomStageFilterOp = 'eq' | 'neq' | 'contains' | 'in';
|
|
6
6
|
export interface CustomStageFilter {
|
package/dist/custom-stages.js
CHANGED
|
@@ -25,7 +25,7 @@ import { Plus, Trash2, Pencil, MoreVertical, Filter, Flag, GripVertical, Lock, R
|
|
|
25
25
|
import { toast } from 'sonner';
|
|
26
26
|
import { Badge, Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Skeleton, } from '@asteby/metacore-ui/primitives';
|
|
27
27
|
import { generateBadgeStyles, optionColor } from '@asteby/metacore-ui/lib';
|
|
28
|
-
import { useApi } from './api-context';
|
|
28
|
+
import { useApi } from './api-context.js';
|
|
29
29
|
// ~8 preset palette names understood by `generateBadgeStyles`.
|
|
30
30
|
export const CUSTOM_STAGE_COLORS = [
|
|
31
31
|
'slate',
|
package/dist/dashboard-grid.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { DashboardGridProps, DashboardWidgetGroup, DashboardWidgetSpec } from './dashboard-types';
|
|
2
|
+
import type { DashboardGridProps, DashboardWidgetGroup, DashboardWidgetSpec } from './dashboard-types.js';
|
|
3
3
|
/** Normalizes flat `widgets` + `groups` into an ordered group list. */
|
|
4
4
|
export declare function normalizeGroups(groups?: DashboardWidgetGroup[], widgets?: DashboardWidgetSpec[]): DashboardWidgetGroup[];
|
|
5
|
-
export declare function DashboardGrid({ groups, widgets, loadData, isAdmin, locale, currency, className, strings, }: DashboardGridProps): React.JSX.Element;
|
|
5
|
+
export declare function DashboardGrid({ groups, widgets, loadData, loadTimeoutMs, isAdmin, locale, currency, className, strings, }: DashboardGridProps): React.JSX.Element;
|
|
6
6
|
//# sourceMappingURL=dashboard-grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-grid.d.ts","sourceRoot":"","sources":["../src/dashboard-grid.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"dashboard-grid.d.ts","sourceRoot":"","sources":["../src/dashboard-grid.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,OAAO,KAAK,EACR,kBAAkB,EAElB,oBAAoB,EACpB,mBAAmB,EACtB,MAAM,mBAAmB,CAAA;AAY1B,uEAAuE;AACvE,wBAAgB,eAAe,CAC3B,MAAM,CAAC,EAAE,oBAAoB,EAAE,EAC/B,OAAO,CAAC,EAAE,mBAAmB,EAAE,GAChC,oBAAoB,EAAE,CAgBxB;AASD,wBAAgB,aAAa,CAAC,EAC1B,MAAM,EACN,OAAO,EACP,QAAQ,EACR,aAAa,EACb,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,GACV,EAAE,kBAAkB,qBAwJpB"}
|
package/dist/dashboard-grid.js
CHANGED
|
@@ -7,9 +7,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
10
|
+
import { LoadState } from '@asteby/metacore-ui/primitives';
|
|
11
|
+
import { useCan, usePermissionsActive } from './permissions-context.js';
|
|
12
|
+
import { WidgetRenderer, WidgetSkeleton, isTallWidget } from './widgets/widget-renderer.js';
|
|
13
|
+
import { DashboardEmptyMockup } from './dashboard-empty-mockup.js';
|
|
13
14
|
const DEFAULT_STRINGS = {
|
|
14
15
|
emptyTitle: 'Your dashboard is taking shape',
|
|
15
16
|
emptyDescription: 'Install an addon with dashboard widgets and your metrics will start living here.',
|
|
@@ -44,7 +45,7 @@ function allKeys(groups) {
|
|
|
44
45
|
keys.push(w.key);
|
|
45
46
|
return keys;
|
|
46
47
|
}
|
|
47
|
-
export function DashboardGrid({ groups, widgets, loadData, isAdmin, locale, currency, className, strings, }) {
|
|
48
|
+
export function DashboardGrid({ groups, widgets, loadData, loadTimeoutMs, isAdmin, locale, currency, className, strings, }) {
|
|
48
49
|
const { t } = useTranslation();
|
|
49
50
|
const can = useCan();
|
|
50
51
|
const permissionsActive = usePermissionsActive();
|
|
@@ -78,6 +79,9 @@ export function DashboardGrid({ groups, widgets, loadData, isAdmin, locale, curr
|
|
|
78
79
|
const keySig = keys.join(',');
|
|
79
80
|
const [data, setData] = React.useState(null);
|
|
80
81
|
const [loading, setLoading] = React.useState(true);
|
|
82
|
+
// Batch failure / hung request -> actionable error with retry (not an eternal skeleton).
|
|
83
|
+
const [loadFailed, setLoadFailed] = React.useState(false);
|
|
84
|
+
const [reloadTick, setReloadTick] = React.useState(0);
|
|
81
85
|
React.useEffect(() => {
|
|
82
86
|
let cancelled = false;
|
|
83
87
|
if (keys.length === 0) {
|
|
@@ -86,6 +90,7 @@ export function DashboardGrid({ groups, widgets, loadData, isAdmin, locale, curr
|
|
|
86
90
|
return;
|
|
87
91
|
}
|
|
88
92
|
setLoading(true);
|
|
93
|
+
setLoadFailed(false);
|
|
89
94
|
loadData(keys)
|
|
90
95
|
.then((res) => {
|
|
91
96
|
if (!cancelled) {
|
|
@@ -94,10 +99,9 @@ export function DashboardGrid({ groups, widgets, loadData, isAdmin, locale, curr
|
|
|
94
99
|
}
|
|
95
100
|
})
|
|
96
101
|
.catch(() => {
|
|
97
|
-
// Batch failure: still render the grid; every widget falls to
|
|
98
|
-
// its empty/error state rather than blanking the page.
|
|
99
102
|
if (!cancelled) {
|
|
100
103
|
setData({});
|
|
104
|
+
setLoadFailed(true);
|
|
101
105
|
setLoading(false);
|
|
102
106
|
}
|
|
103
107
|
});
|
|
@@ -105,7 +109,7 @@ export function DashboardGrid({ groups, widgets, loadData, isAdmin, locale, curr
|
|
|
105
109
|
cancelled = true;
|
|
106
110
|
};
|
|
107
111
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
108
|
-
}, [keySig, loadData]);
|
|
112
|
+
}, [keySig, loadData, reloadTick]);
|
|
109
113
|
// Flatten every group into ONE ordered list (compact KPIs before charts) for
|
|
110
114
|
// the masonry grid. MUST run before any early return — it is a hook, and a
|
|
111
115
|
// conditional hook (placed after the empty-state return) trips React #310
|
|
@@ -126,17 +130,15 @@ export function DashboardGrid({ groups, widgets, loadData, isAdmin, locale, curr
|
|
|
126
130
|
// %-height grid that needed a clamp wrapper.
|
|
127
131
|
'w-full', className), children: _jsx(DashboardEmptyMockup, {}) }));
|
|
128
132
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return (_jsx("div", { className: "mb-4 break-inside-avoid", children: loading ? (_jsx(WidgetSkeleton, { spec: rspec })) : (_jsx(WidgetRenderer, { spec: rspec, data: data?.[spec.key], locale: locale, currency: currency, emptyText: spec.empty ? tr(spec.empty, spec.empty) : s.widgetEmpty, errorText: s.widgetError })) }, spec.key));
|
|
141
|
-
}) }));
|
|
133
|
+
const gridClass = cn(
|
|
134
|
+
// Masonry: balanced CSS columns. Cards take their natural height
|
|
135
|
+
// (compact stats, taller charts) and flow to equalize column
|
|
136
|
+
// height, so there are NO blank cells.
|
|
137
|
+
'columns-1 gap-4 md:columns-2 xl:columns-3', className);
|
|
138
|
+
const translated = (spec) => ({
|
|
139
|
+
...spec,
|
|
140
|
+
title: tr(spec.title, spec.title),
|
|
141
|
+
subtitle: tr(spec.subtitle, spec.subtitle),
|
|
142
|
+
});
|
|
143
|
+
return (_jsx(LoadState, { loading: loading, error: loadFailed, timeoutMs: loadTimeoutMs, onRetry: () => setReloadTick((n) => n + 1), labels: { title: s.loadErrorTitle, hint: s.loadErrorHint, retry: s.retry }, skeleton: _jsx("div", { "data-testid": "dashboard-grid", className: gridClass, children: ordered.map((spec) => (_jsx("div", { className: "mb-4 break-inside-avoid", children: _jsx(WidgetSkeleton, { spec: translated(spec) }) }, spec.key))) }), children: _jsx("div", { "data-testid": "dashboard-grid", className: gridClass, children: ordered.map((spec) => (_jsx("div", { className: "mb-4 break-inside-avoid", children: _jsx(WidgetRenderer, { spec: translated(spec), data: data?.[spec.key], locale: locale, currency: currency, emptyText: spec.empty ? tr(spec.empty, spec.empty) : s.widgetEmpty, errorText: s.widgetError }) }, spec.key))) }) }));
|
|
142
144
|
}
|
|
@@ -111,6 +111,8 @@ export interface DashboardGridProps {
|
|
|
111
111
|
currency?: string;
|
|
112
112
|
/** Extra class on the grid root. */
|
|
113
113
|
className?: string;
|
|
114
|
+
/** Max ms the batch load may take before an error + retry replaces the skeletons. Default 15000; 0 disables. */
|
|
115
|
+
loadTimeoutMs?: number;
|
|
114
116
|
/** Optional override for empty/loading/error copy. */
|
|
115
117
|
strings?: Partial<DashboardGridStrings>;
|
|
116
118
|
}
|
|
@@ -124,5 +126,9 @@ export interface DashboardGridStrings {
|
|
|
124
126
|
widgetError: string;
|
|
125
127
|
/** Per-widget empty (no data) fallback when the spec has no `empty` key. */
|
|
126
128
|
widgetEmpty: string;
|
|
129
|
+
/** Optional overrides of the load-failure state (default: i18n `loadState.*`). */
|
|
130
|
+
loadErrorTitle?: string;
|
|
131
|
+
loadErrorHint?: string;
|
|
132
|
+
retry?: string;
|
|
127
133
|
}
|
|
128
134
|
//# sourceMappingURL=dashboard-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-types.d.ts","sourceRoot":"","sources":["../src/dashboard-types.ts"],"names":[],"mappings":"AAOA,4EAA4E;AAC5E,MAAM,MAAM,UAAU,GAChB,MAAM,GACN,KAAK,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,OAAO,GACP,MAAM,GACN,UAAU,GACV,QAAQ,CAAA;AAEd,mEAAmE;AACnE,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,C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AAc,CAAA;IACxB,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gHAAgH;IAChH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,sDAAsD;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAA;CAC1C;AAED,uEAAuE;AACvE,MAAM,WAAW,oBAAoB;IACjC,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAA;IAClB,sCAAsC;IACtC,gBAAgB,EAAE,MAAM,CAAA;IACxB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAA;IACnB,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CreateRecordDialogProps } from './types';
|
|
1
|
+
import type { CreateRecordDialogProps } from './types.js';
|
|
2
2
|
export declare function CreateRecordDialog({ modelKey, open, onOpenChange, recordId, endpoint, schema, defaults, lockedFields, onCreate, onUpdate, onSaved, }: CreateRecordDialogProps): import("react").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=create-record-dialog.d.ts.map
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
* when omitted, the dialog falls back to the configured `useApi()` transport
|
|
14
14
|
* with the default `/dynamic/${modelKey}` endpoint convention.
|
|
15
15
|
*/
|
|
16
|
-
import { DynamicRecordDialog } from './dynamic-record';
|
|
16
|
+
import { DynamicRecordDialog } from './dynamic-record.js';
|
|
17
17
|
export function CreateRecordDialog({ modelKey, open, onOpenChange, recordId, endpoint, schema, defaults, lockedFields, onCreate, onUpdate, onSaved, }) {
|
|
18
18
|
const mode = recordId ? 'edit' : 'create';
|
|
19
19
|
return (_jsx(DynamicRecordDialog, { open: open, onOpenChange: onOpenChange, mode: mode, model: modelKey, recordId: recordId, endpoint: endpoint, schema: schema, defaults: defaults, lockedFields: lockedFields, onCreate: onCreate, onUpdate: onUpdate, onSaved: onSaved }));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ModelSchema } from './types';
|
|
2
|
-
import { type ResolvedOption } from '../use-options-resolver';
|
|
3
|
-
import type { VisibleWhen } from '../types';
|
|
4
|
-
import { type ItemField } from '../collection-cell';
|
|
5
|
-
import { type GetImageUrl } from '../image-url-context';
|
|
1
|
+
import type { ModelSchema } from './types.js';
|
|
2
|
+
import { type ResolvedOption } from '../use-options-resolver.js';
|
|
3
|
+
import type { VisibleWhen } from '../types.js';
|
|
4
|
+
import { type ItemField } from '../collection-cell.js';
|
|
5
|
+
import { type GetImageUrl } from '../image-url-context.js';
|
|
6
6
|
export type { GetImageUrl };
|
|
7
7
|
export interface FieldOption {
|
|
8
8
|
value: string;
|
|
@@ -10,7 +10,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
10
10
|
// flows through <ApiProvider> from runtime-react. Host-specific runtime values —
|
|
11
11
|
// the image-url resolver and the org IANA timezone — are passed as props so the
|
|
12
12
|
// SDK stays transport- and host-agnostic.
|
|
13
|
-
import { emitRecordMutation } from '../record-mutation-events';
|
|
13
|
+
import { emitRecordMutation } from '../record-mutation-events.js';
|
|
14
14
|
import { createContext, lazy, Suspense, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
/** Model key of the open create/edit dialog — used to hide "+" on self-FK pickers
|
|
@@ -20,51 +20,51 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Di
|
|
|
20
20
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
21
21
|
import { toast } from 'sonner';
|
|
22
22
|
import { format, parseISO } from 'date-fns';
|
|
23
|
-
import { parseCalendarDate } from '../calendar-date';
|
|
23
|
+
import { parseCalendarDate } from '../calendar-date.js';
|
|
24
24
|
import { es } from 'date-fns/locale';
|
|
25
25
|
import { ExternalLink, Loader2, CalendarIcon, Upload, X as XIcon, ScanLine } from 'lucide-react';
|
|
26
|
-
import { BarcodeScanner } from '../barcode-scanner';
|
|
27
|
-
import { useApi } from '../api-context';
|
|
28
|
-
import { useBranchCreateGate } from '../branch-create-gate';
|
|
29
|
-
import { toastServerError, extractFieldErrors, localizeFieldIssue, localizeFieldErrorMap } from '../server-error';
|
|
30
|
-
import { DynamicSelectField, OptionLead, OptionThumb } from '../dynamic-select-field';
|
|
31
|
-
import { RecordPicker } from '../record-picker';
|
|
32
|
-
import { DynamicMultiSelectField } from '../dynamic-multi-select-field';
|
|
33
|
-
import { UploadField, validateUploadFile } from '../upload-field';
|
|
34
|
-
import { DynamicRelations } from '../dynamic-relations';
|
|
35
|
-
import { AuditInfo, readAuditMeta } from '../audit-info';
|
|
36
|
-
import { useOptionsResolver } from '../use-options-resolver';
|
|
37
|
-
import { getFieldRef, getVisibleWhen, evaluateVisibleWhen, getUploadConfig, ATTRIBUTE_CLASSES_KEY } from '../dynamic-form-schema';
|
|
38
|
-
import { useAttributeClasses } from '../attribute-classes';
|
|
39
|
-
import { groupFieldsBySection } from '../form-layout';
|
|
40
|
-
import { FieldSection, WizardProgress } from '../form-layout-ui';
|
|
41
|
-
import { AssistInterview } from '../assist-interview';
|
|
42
|
-
import { RecordPrefillBar } from '../record-prefill-bar';
|
|
43
|
-
import { FieldCell } from '../field-grid';
|
|
44
|
-
import { isNullableBooleanField, omitUntouchedNullBooleans, usesTriState } from '../nullable-boolean';
|
|
45
|
-
import { NullBooleanMark, TriStateBooleanField } from '../tri-state-boolean';
|
|
46
|
-
import { isNilUuid, normalizeNilUuid } from '../nil-uuid';
|
|
47
|
-
import { normalizeRefFieldsForSubmit, withInlineChildren } from './normalize-submit';
|
|
48
|
-
import { relationMin, splitChildErrors } from './inline-relations';
|
|
49
|
-
import { useInlineRelations } from './use-inline-relations';
|
|
26
|
+
import { BarcodeScanner } from '../barcode-scanner.js';
|
|
27
|
+
import { useApi } from '../api-context.js';
|
|
28
|
+
import { useBranchCreateGate } from '../branch-create-gate.js';
|
|
29
|
+
import { toastServerError, extractFieldErrors, localizeFieldIssue, localizeFieldErrorMap } from '../server-error.js';
|
|
30
|
+
import { DynamicSelectField, OptionLead, OptionThumb } from '../dynamic-select-field.js';
|
|
31
|
+
import { RecordPicker } from '../record-picker.js';
|
|
32
|
+
import { DynamicMultiSelectField } from '../dynamic-multi-select-field.js';
|
|
33
|
+
import { UploadField, validateUploadFile } from '../upload-field.js';
|
|
34
|
+
import { DynamicRelations } from '../dynamic-relations.js';
|
|
35
|
+
import { AuditInfo, readAuditMeta } from '../audit-info.js';
|
|
36
|
+
import { useOptionsResolver } from '../use-options-resolver.js';
|
|
37
|
+
import { getFieldRef, getVisibleWhen, evaluateVisibleWhen, getUploadConfig, ATTRIBUTE_CLASSES_KEY } from '../dynamic-form-schema.js';
|
|
38
|
+
import { useAttributeClasses } from '../attribute-classes.js';
|
|
39
|
+
import { groupFieldsBySection } from '../form-layout.js';
|
|
40
|
+
import { FieldSection, WizardProgress } from '../form-layout-ui.js';
|
|
41
|
+
import { AssistInterview } from '../assist-interview.js';
|
|
42
|
+
import { RecordPrefillBar } from '../record-prefill-bar.js';
|
|
43
|
+
import { FieldCell } from '../field-grid.js';
|
|
44
|
+
import { isNullableBooleanField, omitUntouchedNullBooleans, usesTriState } from '../nullable-boolean.js';
|
|
45
|
+
import { NullBooleanMark, TriStateBooleanField } from '../tri-state-boolean.js';
|
|
46
|
+
import { isNilUuid, normalizeNilUuid } from '../nil-uuid.js';
|
|
47
|
+
import { normalizeRefFieldsForSubmit, withInlineChildren } from './normalize-submit.js';
|
|
48
|
+
import { relationMin, splitChildErrors } from './inline-relations.js';
|
|
49
|
+
import { useInlineRelations } from './use-inline-relations.js';
|
|
50
50
|
// La tabla de filas hijas solo se usa al CREAR un registro cuyo modelo declara `create_inline`: se carga bajo demanda para no
|
|
51
51
|
// engordar el grafo inicial del panel (el shell de Ops tiene un techo de no-regresión).
|
|
52
|
-
const InlineRelationRows = lazy(() => import('./inline-relation-rows').then(m => ({ default: m.InlineRelationRows })));
|
|
53
|
-
import { validateDraftRows } from '../draft-rows';
|
|
54
|
-
import { clearFieldErrorTree, lineItemErrorsFor } from '../field-validation-ui';
|
|
55
|
-
import { validateValues, bagHasErrors, exemptUnchangedRuleIssues } from '../validator';
|
|
56
|
-
import { DynamicIcon, Icon, isLucideIconName } from '../dynamic-icon';
|
|
57
|
-
import { IconPickerField } from '../icon-picker-field';
|
|
58
|
-
import { humanizeToken, localizeFieldLabel } from '../dynamic-columns-helpers';
|
|
59
|
-
import { formatDateCell } from '../dynamic-columns';
|
|
60
|
-
import { ImageStack, OptionBadge, statusColorFor, useIsDarkTheme, } from '../display-value';
|
|
61
|
-
import { MediaValue, RichText } from '../rich-url';
|
|
52
|
+
const InlineRelationRows = lazy(() => import('./inline-relation-rows.js').then(m => ({ default: m.InlineRelationRows })));
|
|
53
|
+
import { validateDraftRows } from '../draft-rows.js';
|
|
54
|
+
import { clearFieldErrorTree, lineItemErrorsFor } from '../field-validation-ui.js';
|
|
55
|
+
import { validateValues, bagHasErrors, exemptUnchangedRuleIssues } from '../validator.js';
|
|
56
|
+
import { DynamicIcon, Icon, isLucideIconName } from '../dynamic-icon.js';
|
|
57
|
+
import { IconPickerField } from '../icon-picker-field.js';
|
|
58
|
+
import { humanizeToken, localizeFieldLabel } from '../dynamic-columns-helpers.js';
|
|
59
|
+
import { formatDateCell } from '../dynamic-columns.js';
|
|
60
|
+
import { ImageStack, OptionBadge, statusColorFor, useIsDarkTheme, } from '../display-value.js';
|
|
61
|
+
import { MediaValue, RichText } from '../rich-url.js';
|
|
62
62
|
import { generateBadgeStyles } from '@asteby/metacore-ui/lib';
|
|
63
|
-
import { CollectionCell } from '../collection-cell';
|
|
64
|
-
import { ImageUrlContext, identityImageUrl } from '../image-url-context';
|
|
65
|
-
import { getFieldWidget, useFieldWidgetRegistryVersion } from '../field-widget-registry';
|
|
66
|
-
import { TimeZoneContext, CurrencyContext, useNumberLocale, useSystemActor } from '../org-runtime-context';
|
|
67
|
-
import { AuthorshipCell, hasSpecialAuthorship, readProvenance } from '../provenance';
|
|
63
|
+
import { CollectionCell } from '../collection-cell.js';
|
|
64
|
+
import { ImageUrlContext, identityImageUrl } from '../image-url-context.js';
|
|
65
|
+
import { getFieldWidget, useFieldWidgetRegistryVersion } from '../field-widget-registry.js';
|
|
66
|
+
import { TimeZoneContext, CurrencyContext, useNumberLocale, useSystemActor } from '../org-runtime-context.js';
|
|
67
|
+
import { AuthorshipCell, hasSpecialAuthorship, readProvenance } from '../provenance.js';
|
|
68
68
|
/**
|
|
69
69
|
* Lowercase, accent-free, hyphenated slug ("Asociaciones Médicas" →
|
|
70
70
|
* "asociaciones-medicas"). Pure — used by `FieldDef.deriveFrom`.
|
package/dist/dialogs/export.d.ts
CHANGED
package/dist/dialogs/export.js
CHANGED
|
@@ -13,10 +13,10 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-run
|
|
|
13
13
|
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Button, Label, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, } from '@asteby/metacore-ui/primitives';
|
|
16
|
-
import { Progress, RadioGroup, RadioGroupItem } from './_primitives';
|
|
16
|
+
import { Progress, RadioGroup, RadioGroupItem } from './_primitives.js';
|
|
17
17
|
import { toast } from 'sonner';
|
|
18
18
|
import { Download, ChevronDown, Loader2 } from 'lucide-react';
|
|
19
|
-
import { useApi } from '../api-context';
|
|
19
|
+
import { useApi } from '../api-context.js';
|
|
20
20
|
export function ExportDialog({ open, onOpenChange, model, metadata, currentFilters, hasActiveFilters, }) {
|
|
21
21
|
const api = useApi();
|
|
22
22
|
const { t, i18n } = useTranslation();
|
package/dist/dialogs/import.d.ts
CHANGED
package/dist/dialogs/import.js
CHANGED
|
@@ -7,11 +7,11 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-run
|
|
|
7
7
|
import { useState, useEffect } from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Button, Label, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@asteby/metacore-ui/primitives';
|
|
10
|
-
import { Progress } from './_primitives';
|
|
10
|
+
import { Progress } from './_primitives.js';
|
|
11
11
|
import { toast } from 'sonner';
|
|
12
12
|
import { FileDown, Loader2, Check, AlertCircle } from 'lucide-react';
|
|
13
|
-
import { useApi } from '../api-context';
|
|
14
|
-
import { FilePickButton } from '../file-pick-button';
|
|
13
|
+
import { useApi } from '../api-context.js';
|
|
14
|
+
import { FilePickButton } from '../file-pick-button.js';
|
|
15
15
|
function errorColumn(e) {
|
|
16
16
|
return e.column ?? e.field ?? '';
|
|
17
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type DraftRow } from '../draft-rows';
|
|
3
|
-
import { type InlineFieldMeta } from './inline-relations';
|
|
4
|
-
import type { RelationMeta } from '../types';
|
|
2
|
+
import { type DraftRow } from '../draft-rows.js';
|
|
3
|
+
import { type InlineFieldMeta } from './inline-relations.js';
|
|
4
|
+
import type { RelationMeta } from '../types.js';
|
|
5
5
|
export interface InlineRelationRowsProps {
|
|
6
6
|
relation: Pick<RelationMeta, 'name' | 'label' | 'min'>;
|
|
7
7
|
fields: InlineFieldMeta[];
|
|
@@ -7,9 +7,9 @@ import { useEffect, useId, useRef, useState } from 'react';
|
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { Plus, Trash2 } from 'lucide-react';
|
|
9
9
|
import { Button } from '@asteby/metacore-ui/primitives';
|
|
10
|
-
import { localizeFieldLabel } from '../dynamic-columns-helpers';
|
|
11
|
-
import { appendDraftRow, cellErrorKey, makeDraftRow, removeDraftRow, updateDraftCell, } from '../draft-rows';
|
|
12
|
-
import { relationMin } from './inline-relations';
|
|
10
|
+
import { localizeFieldLabel } from '../dynamic-columns-helpers.js';
|
|
11
|
+
import { appendDraftRow, cellErrorKey, makeDraftRow, removeDraftRow, updateDraftCell, } from '../draft-rows.js';
|
|
12
|
+
import { relationMin } from './inline-relations.js';
|
|
13
13
|
const TOUCH = 'min-h-11 min-w-11';
|
|
14
14
|
const CONTROLS = 'input, select, textarea, button[role="combobox"]';
|
|
15
15
|
function blankValues(fields) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type DraftColumn, type DraftRow } from '../draft-rows';
|
|
2
|
-
import { type FieldIssue, type Translate } from '../server-error';
|
|
3
|
-
import type { RelationMeta } from '../types';
|
|
1
|
+
import { type DraftColumn, type DraftRow } from '../draft-rows.js';
|
|
2
|
+
import { type FieldIssue, type Translate } from '../server-error.js';
|
|
3
|
+
import type { RelationMeta } from '../types.js';
|
|
4
4
|
export declare const CHILDREN_KEY = "_children";
|
|
5
5
|
/** ¿Se captura al crear? Solo `create_inline === true` (ausente = no). */
|
|
6
6
|
export declare const isCreateInline: (rel: Pick<RelationMeta, "create_inline">) => boolean;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Puro (sin React): qué relaciones aplican, qué columnas tiene cada fila,
|
|
3
3
|
// cómo viaja `_children` y cómo se reparten los errores 422
|
|
4
4
|
// `_children.<relación>.<i>.<campo>`.
|
|
5
|
-
import { isManagedRelationColumn } from '../dynamic-relation-helpers';
|
|
6
|
-
import { serializeDraftRows, } from '../draft-rows';
|
|
7
|
-
import { localizeFieldIssue } from '../server-error';
|
|
5
|
+
import { isManagedRelationColumn } from '../dynamic-relation-helpers.js';
|
|
6
|
+
import { serializeDraftRows, } from '../draft-rows.js';
|
|
7
|
+
import { localizeFieldIssue } from '../server-error.js';
|
|
8
8
|
export const CHILDREN_KEY = '_children';
|
|
9
9
|
/** ¿Se captura al crear? Solo `create_inline === true` (ausente = no). */
|
|
10
10
|
export const isCreateInline = (rel) => rel.create_inline === true;
|
|
@@ -26,5 +26,5 @@ type RefFieldMeta = Record<string, any>;
|
|
|
26
26
|
* mutate `values`.
|
|
27
27
|
*/
|
|
28
28
|
export declare function normalizeRefFieldsForSubmit(values: Record<string, any>, fields: RefFieldMeta[] | undefined): Record<string, any>;
|
|
29
|
-
export { withInlineChildren } from './inline-relations';
|
|
29
|
+
export { withInlineChildren } from './inline-relations.js';
|
|
30
30
|
//# sourceMappingURL=normalize-submit.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Pure submit-payload normalization for dynamic record forms. Kept in its own
|
|
2
2
|
// module (no React / UI imports) so it is unit-testable in isolation and
|
|
3
3
|
// reusable by any caller that builds a create/update payload.
|
|
4
|
-
import { isNilUuid } from '../nil-uuid';
|
|
5
|
-
import { getFieldRef } from '../dynamic-form-schema';
|
|
4
|
+
import { isNilUuid } from '../nil-uuid.js';
|
|
5
|
+
import { getFieldRef } from '../dynamic-form-schema.js';
|
|
6
6
|
/**
|
|
7
7
|
* Normalize a submit payload so that EMPTY reference fields go to the server as
|
|
8
8
|
* `null` rather than as `""` or the nil UUID ("00000000-…"). A dynamic FK column
|
|
@@ -69,4 +69,4 @@ export function normalizeRefFieldsForSubmit(values, fields) {
|
|
|
69
69
|
}
|
|
70
70
|
// Relaciones hijas capturadas al crear (`create_inline`): `_children` viaja con
|
|
71
71
|
// el padre; sin ellas el cuerpo no cambia. Ver `inline-relations.ts`.
|
|
72
|
-
export { withInlineChildren } from './inline-relations';
|
|
72
|
+
export { withInlineChildren } from './inline-relations.js';
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
// `deriveRelationFormFields`, el mecanismo que ya usa `<DynamicRelation>`.
|
|
9
9
|
import { unwrapResponse } from '@asteby/metacore-lib/envelope';
|
|
10
10
|
import { useEffect, useState } from 'react';
|
|
11
|
-
import { useApi } from '../api-context';
|
|
12
|
-
import { deriveRelationFormFields } from '../dynamic-relation-helpers';
|
|
13
|
-
import { deriveInlineRowFields, isCreateInline } from './inline-relations';
|
|
11
|
+
import { useApi } from '../api-context.js';
|
|
12
|
+
import { deriveRelationFormFields } from '../dynamic-relation-helpers.js';
|
|
13
|
+
import { deriveInlineRowFields, isCreateInline } from './inline-relations.js';
|
|
14
14
|
export function useInlineRelations(opts) {
|
|
15
15
|
const api = useApi();
|
|
16
16
|
const { enabled, model } = opts;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ViewRecordDialogProps } from './types';
|
|
1
|
+
import type { ViewRecordDialogProps } from './types.js';
|
|
2
2
|
export declare function ViewRecordDialog({ modelKey, open, onOpenChange, recordId, endpoint, schema, onEdit, onDelete, }: ViewRecordDialogProps): import("react").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=view-record-dialog.d.ts.map
|
|
@@ -9,7 +9,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
9
9
|
* supplies `onEdit` / `onDelete`, so the dialog gracefully degrades to a
|
|
10
10
|
* pure viewer when those affordances are not needed.
|
|
11
11
|
*/
|
|
12
|
-
import { DynamicRecordDialog } from './dynamic-record';
|
|
12
|
+
import { DynamicRecordDialog } from './dynamic-record.js';
|
|
13
13
|
export function ViewRecordDialog({ modelKey, open, onOpenChange, recordId, endpoint, schema, onEdit, onDelete, }) {
|
|
14
14
|
return (_jsx(DynamicRecordDialog, { open: open, onOpenChange: onOpenChange, mode: "view", model: modelKey, recordId: recordId, endpoint: endpoint, schema: schema, onEdit: onEdit, onDelete: onDelete }));
|
|
15
15
|
}
|
package/dist/display-value.js
CHANGED
|
@@ -12,7 +12,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { Avatar, AvatarImage, AvatarFallback, Badge } from '@asteby/metacore-ui';
|
|
14
14
|
import { generateBadgeStyles, getInitials, optionColor, } from '@asteby/metacore-ui/lib';
|
|
15
|
-
import { DynamicIcon } from './dynamic-icon';
|
|
15
|
+
import { DynamicIcon } from './dynamic-icon.js';
|
|
16
16
|
/**
|
|
17
17
|
* `true` when the host document is in dark mode. Observes the `<html>` class so
|
|
18
18
|
* badge colors re-derive on theme toggle. SSR/no-DOM safe (starts light).
|
|
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
8
8
|
import { Loader2, MoreHorizontal } from 'lucide-react';
|
|
9
9
|
import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '@asteby/metacore-ui/primitives';
|
|
10
10
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
11
|
-
import { DynamicIcon } from '../dynamic-icon';
|
|
11
|
+
import { DynamicIcon } from '../dynamic-icon.js';
|
|
12
12
|
export function ActionBar({ layout, onAction, className }) {
|
|
13
13
|
const { t } = useTranslation();
|
|
14
14
|
const [busy, setBusy] = useState(null);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { formatFieldValue, type FieldFormatOptions } from './format';
|
|
3
|
-
import type { StatusDef } from './types';
|
|
2
|
+
import { formatFieldValue, type FieldFormatOptions } from './format.js';
|
|
3
|
+
import type { StatusDef } from './types.js';
|
|
4
4
|
export interface HeaderBadge {
|
|
5
5
|
id: string;
|
|
6
6
|
label?: string;
|
|
@@ -7,8 +7,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
7
7
|
import { Check, Copy } from 'lucide-react';
|
|
8
8
|
import { Button } from '@asteby/metacore-ui/primitives';
|
|
9
9
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
10
|
-
import { StatusBadge } from './status-badge';
|
|
11
|
-
import { formatFieldValue } from './format';
|
|
10
|
+
import { StatusBadge } from './status-badge.js';
|
|
11
|
+
import { formatFieldValue } from './format.js';
|
|
12
12
|
export function DocumentHeader({ title, subtitle, subtitleHref, badges, metrics, copyable, actions, leading, renderLink, className, }) {
|
|
13
13
|
const { t } = useTranslation();
|
|
14
14
|
const [copied, setCopied] = useState(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type FieldFormatOptions } from './format';
|
|
3
|
-
import { type DocumentPageRegistration } from './registry';
|
|
4
|
-
import type { DocumentContext, DocumentSlotRenderer, ResolvedAction } from './types';
|
|
2
|
+
import { type FieldFormatOptions } from './format.js';
|
|
3
|
+
import { type DocumentPageRegistration } from './registry.js';
|
|
4
|
+
import type { DocumentContext, DocumentSlotRenderer, ResolvedAction } from './types.js';
|
|
5
5
|
export interface DocumentPageProps extends FieldFormatOptions {
|
|
6
6
|
registration: DocumentPageRegistration;
|
|
7
7
|
record: Record<string, unknown>;
|
|
@@ -8,15 +8,15 @@ import { useMemo, useState } from 'react';
|
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@asteby/metacore-ui/primitives';
|
|
10
10
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
11
|
-
import { ActionBar } from './action-bar';
|
|
12
|
-
import { DocumentSecondaryBar } from './secondary-bar';
|
|
13
|
-
import { DocumentHeader } from './document-header';
|
|
14
|
-
import { SmartButtons } from './smart-buttons';
|
|
15
|
-
import { StatusBadge } from './status-badge';
|
|
16
|
-
import { interpolate, readPath, resolveActions, resolveStatus, resolveTitle } from './evaluate';
|
|
17
|
-
import { formatFieldValue } from './format';
|
|
18
|
-
import { findStatusMachine } from './registry';
|
|
19
|
-
import { useDocumentSources } from './use-document-sources';
|
|
11
|
+
import { ActionBar } from './action-bar.js';
|
|
12
|
+
import { DocumentSecondaryBar } from './secondary-bar.js';
|
|
13
|
+
import { DocumentHeader } from './document-header.js';
|
|
14
|
+
import { SmartButtons } from './smart-buttons.js';
|
|
15
|
+
import { StatusBadge } from './status-badge.js';
|
|
16
|
+
import { interpolate, readPath, resolveActions, resolveStatus, resolveTitle } from './evaluate.js';
|
|
17
|
+
import { formatFieldValue } from './format.js';
|
|
18
|
+
import { findStatusMachine } from './registry.js';
|
|
19
|
+
import { useDocumentSources } from './use-document-sources.js';
|
|
20
20
|
export function DocumentPage(props) {
|
|
21
21
|
const { registration, record, onAction, slots, onNavigate, renderLink, leading, defaultTab, className } = props;
|
|
22
22
|
const { spec } = registration;
|