@praxisui/core 10.0.0-rc.57 → 10.0.0-rc.59
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/README.md +26 -1
- package/ai/component-registry.json +2 -2
- package/fesm2022/praxisui-core-schema.mjs +1008 -81
- package/fesm2022/praxisui-core.mjs +4385 -814
- package/package.json +1 -1
- package/types/praxisui-core-schema.d.ts +294 -0
- package/types/praxisui-core.d.ts +4488 -3882
|
@@ -1202,7 +1202,7 @@ function renderRadialVisualizationHtml(visualization, options) {
|
|
|
1202
1202
|
? Math.max(0, Math.min(100, (targetVal / total) * 100))
|
|
1203
1203
|
: null;
|
|
1204
1204
|
const targetArcHtml = targetPct !== null
|
|
1205
|
-
? `<circle class="pfx-micro-radial-svg__target-arc" cx="18" cy="18" r="13.
|
|
1205
|
+
? `<circle class="pfx-micro-radial-svg__target-arc" cx="18" cy="18" r="13.8" pathLength="100" stroke-dasharray="${targetPct.toFixed(1)}, 100" transform="rotate(-90 18 18)" />`
|
|
1206
1206
|
: '';
|
|
1207
1207
|
const digitTierAttr = radialNumStr.length >= 4
|
|
1208
1208
|
? ' data-digits="4"'
|
|
@@ -1234,10 +1234,10 @@ function renderRadialVisualizationHtml(visualization, options) {
|
|
|
1234
1234
|
</linearGradient>
|
|
1235
1235
|
</defs>
|
|
1236
1236
|
<circle class="pfx-micro-radial-svg__bezel" cx="18" cy="18" r="17" />
|
|
1237
|
-
<circle class="pfx-micro-radial-svg__track" cx="18" cy="18" r="13.
|
|
1237
|
+
<circle class="pfx-micro-radial-svg__track" cx="18" cy="18" r="13.8" pathLength="100" />
|
|
1238
1238
|
${targetArcHtml}
|
|
1239
|
-
<circle class="pfx-micro-radial-svg__bar" cx="18" cy="18" r="13.
|
|
1240
|
-
<circle class="pfx-micro-radial-svg__medallion" cx="18" cy="18" r="9
|
|
1239
|
+
<circle class="pfx-micro-radial-svg__bar" cx="18" cy="18" r="13.8" pathLength="100"${isZero ? ' data-zero="true"' : ''} stroke="url(#${escapeHtml(gradId)})" stroke-dasharray="${dashArray}" transform="rotate(-90 18 18)" />
|
|
1240
|
+
<circle class="pfx-micro-radial-svg__medallion" cx="18" cy="18" r="10.9" />
|
|
1241
1241
|
${svgText}
|
|
1242
1242
|
</svg>
|
|
1243
1243
|
${externalText}
|
|
@@ -1402,15 +1402,8 @@ function renderLineVisualizationHtml(visualization, options) {
|
|
|
1402
1402
|
${leftHtml}
|
|
1403
1403
|
<span class="pfx-micro-viz pfx-micro-viz__line" data-tone="${escapeHtml(tone)}" role="img" aria-label="${escapeHtml(visualization.ariaLabel ?? visualization.fallbackText)}">
|
|
1404
1404
|
<svg class="pfx-micro-line__svg" viewBox="0 0 100 30">
|
|
1405
|
-
<defs>
|
|
1406
|
-
<linearGradient id="${escapeHtml(glowGradId)}" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
1407
|
-
<stop offset="0%" stop-color="currentColor" stop-opacity="0.16" />
|
|
1408
|
-
<stop offset="100%" stop-color="currentColor" stop-opacity="0" />
|
|
1409
|
-
</linearGradient>
|
|
1410
|
-
</defs>
|
|
1411
1405
|
${refLineHtml}
|
|
1412
|
-
<path class="pfx-micro-
|
|
1413
|
-
<path class="pfx-micro-line__path" d="${pathD}" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round" />
|
|
1406
|
+
<path class="pfx-micro-line__path" d="${pathD}" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" />
|
|
1414
1407
|
${endpointHaloHtml}
|
|
1415
1408
|
${circlesHtml}
|
|
1416
1409
|
</svg>
|
|
@@ -1795,7 +1788,7 @@ function renderWaterfallVisualizationHtml(visualization, options) {
|
|
|
1795
1788
|
<span class="pfx-micro-viz-container">
|
|
1796
1789
|
${startSummaryHtml}
|
|
1797
1790
|
<span class="pfx-micro-viz pfx-micro-viz__waterfall" data-tone="${escapeHtml(fallbackTone)}" role="img" aria-label="${escapeHtml(aria)}">
|
|
1798
|
-
<svg class="pfx-micro-waterfall__svg" viewBox="0 0 ${width} ${height}">
|
|
1791
|
+
<svg class="pfx-micro-waterfall__svg" viewBox="0 0 ${width} ${height}" preserveAspectRatio="none">
|
|
1799
1792
|
${baselineHtml}
|
|
1800
1793
|
${connectorsHtml.join('')}
|
|
1801
1794
|
${barsHtml.join('')}
|
|
@@ -2512,6 +2505,368 @@ function isScalarEnum(value) {
|
|
|
2512
2505
|
return Array.isArray(value) && value.length > 0 && value.every(item => item === null || typeof item === 'string' || typeof item === 'boolean' || typeof item === 'number' && Number.isFinite(item));
|
|
2513
2506
|
}
|
|
2514
2507
|
|
|
2508
|
+
/**
|
|
2509
|
+
* Enum que define os tipos de controle (`CONTROL_TYPE`) disponíveis para a apresentação dos campos de formulário.
|
|
2510
|
+
*
|
|
2511
|
+
* O `CONTROL_TYPE` especifica o tipo de elemento de UI (User Interface) que será usado para capturar ou exibir dados do campo.
|
|
2512
|
+
* Essa configuração permite que a camada de apresentação saiba como renderizar o campo e oferecer a interação adequada ao usuário.
|
|
2513
|
+
* Em casos onde o `CONTROL_TYPE` não é especificado, a camada de apresentação pode usar o valor de `TYPE` (definido em `FieldDataType`)
|
|
2514
|
+
* para decidir o controle mais adequado de forma automática.
|
|
2515
|
+
*/
|
|
2516
|
+
const FieldControlType = {
|
|
2517
|
+
AI_PROMPT: 'aiPrompt',
|
|
2518
|
+
APP_BAR: 'appBar',
|
|
2519
|
+
ARC_GAUGE: 'arcGauge',
|
|
2520
|
+
ARRAY_INPUT: 'array',
|
|
2521
|
+
ASYNC_SELECT: 'async-select',
|
|
2522
|
+
AUTO_COMPLETE: 'autoComplete',
|
|
2523
|
+
AVATAR: 'avatar',
|
|
2524
|
+
BARCODE_GENERATOR: 'barcodeGenerator',
|
|
2525
|
+
BOTTOM_NAVIGATION: 'bottomNavigation',
|
|
2526
|
+
BREADCRUMB: 'breadcrumb',
|
|
2527
|
+
BUTTON: 'button',
|
|
2528
|
+
BUTTON_TOGGLE: 'buttonToggle',
|
|
2529
|
+
CALENDAR: 'calendar',
|
|
2530
|
+
CARD: 'card',
|
|
2531
|
+
CHECKBOX: 'checkbox',
|
|
2532
|
+
CHIP_INPUT: 'chipInput',
|
|
2533
|
+
CHIP_LIST: 'chipList',
|
|
2534
|
+
CIRCULAR_GAUGE: 'circularGauge',
|
|
2535
|
+
COLOR_GRADIENT: 'colorGradient',
|
|
2536
|
+
CPF_CNPJ_INPUT: 'cpfCnpjInput',
|
|
2537
|
+
COLOR_PALETTE: 'colorPalette',
|
|
2538
|
+
COLOR_PICKER: 'colorPicker',
|
|
2539
|
+
COLOR_INPUT: 'color',
|
|
2540
|
+
CRON_BUILDER: 'cronBuilder',
|
|
2541
|
+
CONTEXT_MENU: 'contextMenu',
|
|
2542
|
+
CONVERSATIONAL_UI: 'conversationalUI',
|
|
2543
|
+
CURRENCY_INPUT: 'currency',
|
|
2544
|
+
DATE_INPUT: 'dateInput',
|
|
2545
|
+
DATE_PICKER: 'date',
|
|
2546
|
+
DATE_RANGE: 'dateRange',
|
|
2547
|
+
DATE_TIME_PICKER: 'dateTime',
|
|
2548
|
+
DATE_TIME_RANGE: 'dateTimeRange',
|
|
2549
|
+
DATETIME_LOCAL_INPUT: 'dateTimeLocal',
|
|
2550
|
+
DIALOG: 'dialog',
|
|
2551
|
+
DRAWER: 'drawer',
|
|
2552
|
+
DROP_DOWN_TREE: 'dropDownTree',
|
|
2553
|
+
EMAIL_INPUT: 'email',
|
|
2554
|
+
ENTITY_LOOKUP: 'entityLookup',
|
|
2555
|
+
EXPANSION_PANEL: 'expansionPanel',
|
|
2556
|
+
FILE_SAVER: 'fileSaver',
|
|
2557
|
+
FILE_SELECT: 'fileSelect',
|
|
2558
|
+
FILE_UPLOAD: 'upload',
|
|
2559
|
+
FILTER: 'filter',
|
|
2560
|
+
FLOATING_LABEL: 'floatingLabel',
|
|
2561
|
+
FLOATING_ACTION_BUTTON: 'floatingActionButton',
|
|
2562
|
+
GRID: 'grid',
|
|
2563
|
+
GRID_LAYOUT: 'gridLayout',
|
|
2564
|
+
INPUT: 'input',
|
|
2565
|
+
INLINE_SELECT: 'inlineSelect',
|
|
2566
|
+
INLINE_SEARCHABLE_SELECT: 'inlineSearchableSelect',
|
|
2567
|
+
INLINE_ASYNC_SELECT: 'inlineAsyncSelect',
|
|
2568
|
+
INLINE_ENTITY_LOOKUP: 'inlineEntityLookup',
|
|
2569
|
+
INLINE_AUTOCOMPLETE: 'inlineAutocomplete',
|
|
2570
|
+
INLINE_INPUT: 'inlineInput',
|
|
2571
|
+
INLINE_PHONE: 'inlinePhone',
|
|
2572
|
+
INLINE_NUMBER: 'inlineNumber',
|
|
2573
|
+
INLINE_CURRENCY: 'inlineCurrency',
|
|
2574
|
+
INLINE_CURRENCY_RANGE: 'inlineCurrencyRange',
|
|
2575
|
+
INLINE_MULTISELECT: 'inlineMultiSelect',
|
|
2576
|
+
INLINE_TOGGLE: 'inlineToggle',
|
|
2577
|
+
INLINE_RANGE: 'inlineRange',
|
|
2578
|
+
INLINE_PERIOD_RANGE: 'inlinePeriodRange',
|
|
2579
|
+
INLINE_YEAR_RANGE: 'inlineYearRange',
|
|
2580
|
+
INLINE_MONTH_RANGE: 'inlineMonthRange',
|
|
2581
|
+
INLINE_DATE: 'inlineDate',
|
|
2582
|
+
INLINE_DATE_RANGE: 'inlineDateRange',
|
|
2583
|
+
INLINE_TIME: 'inlineTime',
|
|
2584
|
+
INLINE_TIME_RANGE: 'inlineTimeRange',
|
|
2585
|
+
INLINE_TREE_SELECT: 'inlineTreeSelect',
|
|
2586
|
+
INLINE_RATING: 'inlineRating',
|
|
2587
|
+
INLINE_DISTANCE_RADIUS: 'inlineDistanceRadius',
|
|
2588
|
+
INLINE_PIPELINE_STATUS: 'inlinePipelineStatus',
|
|
2589
|
+
INLINE_SCORE_PRIORITY: 'inlineScorePriority',
|
|
2590
|
+
INLINE_RELATIVE_PERIOD: 'inlineRelativePeriod',
|
|
2591
|
+
INLINE_SENTIMENT: 'inlineSentiment',
|
|
2592
|
+
INLINE_COLOR_LABEL: 'inlineColorLabel',
|
|
2593
|
+
LINEAR_GAUGE: 'linearGauge',
|
|
2594
|
+
LIST_VIEW: 'listView',
|
|
2595
|
+
MAP: 'map',
|
|
2596
|
+
MASKED_TEXT_BOX: 'maskedTextBox',
|
|
2597
|
+
MONTH_INPUT: 'month',
|
|
2598
|
+
MULTI_COLUMN_COMBO_BOX: 'multiColumnComboBox',
|
|
2599
|
+
MULTI_SELECT: 'multiSelect',
|
|
2600
|
+
MULTI_SELECT_TREE: 'multiSelectTree',
|
|
2601
|
+
TRANSFER_LIST: 'transferList',
|
|
2602
|
+
NOTIFICATION: 'notification',
|
|
2603
|
+
NUMERIC_TEXT_BOX: 'numericTextBox',
|
|
2604
|
+
PAGER: 'pager',
|
|
2605
|
+
PAGINATOR: 'paginator',
|
|
2606
|
+
PASSWORD: 'password',
|
|
2607
|
+
PDF_VIEWER: 'pdfViewer',
|
|
2608
|
+
PHONE: 'phone',
|
|
2609
|
+
PIVOT_GRID: 'pivotGrid',
|
|
2610
|
+
POPUP: 'popup',
|
|
2611
|
+
PROGRESS_BAR: 'progressBar',
|
|
2612
|
+
PROGRESS_SPINNER: 'progressSpinner',
|
|
2613
|
+
QR_CODE: 'qrCode',
|
|
2614
|
+
RADIO: 'radio',
|
|
2615
|
+
RADIAL_GAUGE: 'radialGauge',
|
|
2616
|
+
RANGE_SLIDER: 'rangeSlider',
|
|
2617
|
+
PRICE_RANGE: 'priceRange',
|
|
2618
|
+
RATING: 'rating',
|
|
2619
|
+
RICH_TEXT_EDITOR: 'richTextEditor',
|
|
2620
|
+
RIPPLE: 'ripple',
|
|
2621
|
+
SCROLL_VIEW: 'scrollView',
|
|
2622
|
+
SEARCH_INPUT: 'search',
|
|
2623
|
+
SEARCHABLE_SELECT: 'searchable-select',
|
|
2624
|
+
SELECTION_LIST: 'selectionList',
|
|
2625
|
+
SELECT: 'select',
|
|
2626
|
+
SIGNATURE: 'signature',
|
|
2627
|
+
SLIDER: 'slider',
|
|
2628
|
+
SORTABLE: 'sortable',
|
|
2629
|
+
SORTABLE_TABLE: 'sortableTable',
|
|
2630
|
+
SPLITTER: 'splitter',
|
|
2631
|
+
SPREADSHEET: 'spreadsheet',
|
|
2632
|
+
STACK_LAYOUT: 'stackLayout',
|
|
2633
|
+
STEP_BAR: 'stepBar',
|
|
2634
|
+
STEPPER: 'stepper',
|
|
2635
|
+
SVG_ICON: 'svgIcon',
|
|
2636
|
+
TABS: 'tabs',
|
|
2637
|
+
TEXTAREA: 'textarea',
|
|
2638
|
+
TIME_INPUT: 'time',
|
|
2639
|
+
TIME_PICKER: 'timePicker',
|
|
2640
|
+
TIME_RANGE: 'timeRange',
|
|
2641
|
+
TIMELINE: 'timeline',
|
|
2642
|
+
TOGGLE: 'toggle',
|
|
2643
|
+
TOOLBAR: 'toolbar',
|
|
2644
|
+
TOOLTIP: 'tooltip',
|
|
2645
|
+
TREE_VIEW: 'treeView',
|
|
2646
|
+
TREE_SELECT: 'treeSelect',
|
|
2647
|
+
TYPOGRAPHY: 'typography',
|
|
2648
|
+
URL_INPUT: 'url',
|
|
2649
|
+
WEEK_INPUT: 'week',
|
|
2650
|
+
WINDOW: 'window',
|
|
2651
|
+
YEAR_INPUT: 'year',
|
|
2652
|
+
};
|
|
2653
|
+
|
|
2654
|
+
const INLINE_FILTER_CONTROL_TYPES = Object.freeze({
|
|
2655
|
+
SELECT: FieldControlType.INLINE_SELECT,
|
|
2656
|
+
SEARCHABLE_SELECT: FieldControlType.INLINE_SEARCHABLE_SELECT,
|
|
2657
|
+
ASYNC_SELECT: FieldControlType.INLINE_ASYNC_SELECT,
|
|
2658
|
+
ENTITY_LOOKUP: FieldControlType.INLINE_ENTITY_LOOKUP,
|
|
2659
|
+
AUTOCOMPLETE: FieldControlType.INLINE_AUTOCOMPLETE,
|
|
2660
|
+
NUMBER: FieldControlType.INLINE_NUMBER,
|
|
2661
|
+
CURRENCY: FieldControlType.INLINE_CURRENCY,
|
|
2662
|
+
CURRENCY_RANGE: FieldControlType.INLINE_CURRENCY_RANGE,
|
|
2663
|
+
MULTI_SELECT: FieldControlType.INLINE_MULTISELECT,
|
|
2664
|
+
INPUT: FieldControlType.INLINE_INPUT,
|
|
2665
|
+
PHONE: FieldControlType.INLINE_PHONE,
|
|
2666
|
+
TOGGLE: FieldControlType.INLINE_TOGGLE,
|
|
2667
|
+
RANGE: FieldControlType.INLINE_RANGE,
|
|
2668
|
+
PERIOD_RANGE: FieldControlType.INLINE_PERIOD_RANGE,
|
|
2669
|
+
YEAR_RANGE: FieldControlType.INLINE_YEAR_RANGE,
|
|
2670
|
+
MONTH_RANGE: FieldControlType.INLINE_MONTH_RANGE,
|
|
2671
|
+
DATE: FieldControlType.INLINE_DATE,
|
|
2672
|
+
DATE_RANGE: FieldControlType.INLINE_DATE_RANGE,
|
|
2673
|
+
TIME: FieldControlType.INLINE_TIME,
|
|
2674
|
+
TIME_RANGE: FieldControlType.INLINE_TIME_RANGE,
|
|
2675
|
+
TREE_SELECT: FieldControlType.INLINE_TREE_SELECT,
|
|
2676
|
+
RATING: FieldControlType.INLINE_RATING,
|
|
2677
|
+
DISTANCE_RADIUS: FieldControlType.INLINE_DISTANCE_RADIUS,
|
|
2678
|
+
PIPELINE_STATUS: FieldControlType.INLINE_PIPELINE_STATUS,
|
|
2679
|
+
SCORE_PRIORITY: FieldControlType.INLINE_SCORE_PRIORITY,
|
|
2680
|
+
RELATIVE_PERIOD: FieldControlType.INLINE_RELATIVE_PERIOD,
|
|
2681
|
+
SENTIMENT: FieldControlType.INLINE_SENTIMENT,
|
|
2682
|
+
COLOR_LABEL: FieldControlType.INLINE_COLOR_LABEL,
|
|
2683
|
+
});
|
|
2684
|
+
const INLINE_FILTER_CONTROL_TYPE_VALUES = Object.freeze(Object.values(INLINE_FILTER_CONTROL_TYPES));
|
|
2685
|
+
const INLINE_FILTER_CONTROL_TYPE_SET = new Set(INLINE_FILTER_CONTROL_TYPE_VALUES);
|
|
2686
|
+
function normalizeInlineControlTypeToken(value) {
|
|
2687
|
+
return String(value || '')
|
|
2688
|
+
.trim()
|
|
2689
|
+
.toLowerCase()
|
|
2690
|
+
.replace(/[-_\s]/g, '');
|
|
2691
|
+
}
|
|
2692
|
+
const INLINE_FILTER_CANONICAL_TOKEN_TO_CONTROL_TYPE_MAP = {
|
|
2693
|
+
inlineselect: INLINE_FILTER_CONTROL_TYPES.SELECT,
|
|
2694
|
+
inlinesearchableselect: INLINE_FILTER_CONTROL_TYPES.SEARCHABLE_SELECT,
|
|
2695
|
+
inlineasyncselect: INLINE_FILTER_CONTROL_TYPES.ASYNC_SELECT,
|
|
2696
|
+
inlineentitylookup: INLINE_FILTER_CONTROL_TYPES.ENTITY_LOOKUP,
|
|
2697
|
+
inlineautocomplete: INLINE_FILTER_CONTROL_TYPES.AUTOCOMPLETE,
|
|
2698
|
+
inlinenumber: INLINE_FILTER_CONTROL_TYPES.NUMBER,
|
|
2699
|
+
inlinecurrency: INLINE_FILTER_CONTROL_TYPES.CURRENCY,
|
|
2700
|
+
inlinecurrencyrange: INLINE_FILTER_CONTROL_TYPES.CURRENCY_RANGE,
|
|
2701
|
+
inlinemultiselect: INLINE_FILTER_CONTROL_TYPES.MULTI_SELECT,
|
|
2702
|
+
inlineinput: INLINE_FILTER_CONTROL_TYPES.INPUT,
|
|
2703
|
+
inlinephone: INLINE_FILTER_CONTROL_TYPES.PHONE,
|
|
2704
|
+
inlinetoggle: INLINE_FILTER_CONTROL_TYPES.TOGGLE,
|
|
2705
|
+
inlinerange: INLINE_FILTER_CONTROL_TYPES.RANGE,
|
|
2706
|
+
inlineperiodrange: INLINE_FILTER_CONTROL_TYPES.PERIOD_RANGE,
|
|
2707
|
+
inlineyearrange: INLINE_FILTER_CONTROL_TYPES.YEAR_RANGE,
|
|
2708
|
+
inlinemonthrange: INLINE_FILTER_CONTROL_TYPES.MONTH_RANGE,
|
|
2709
|
+
inlinedate: INLINE_FILTER_CONTROL_TYPES.DATE,
|
|
2710
|
+
inlinedaterange: INLINE_FILTER_CONTROL_TYPES.DATE_RANGE,
|
|
2711
|
+
inlinetime: INLINE_FILTER_CONTROL_TYPES.TIME,
|
|
2712
|
+
inlinetimerange: INLINE_FILTER_CONTROL_TYPES.TIME_RANGE,
|
|
2713
|
+
inlinetreeselect: INLINE_FILTER_CONTROL_TYPES.TREE_SELECT,
|
|
2714
|
+
inlinerating: INLINE_FILTER_CONTROL_TYPES.RATING,
|
|
2715
|
+
inlinedistanceradius: INLINE_FILTER_CONTROL_TYPES.DISTANCE_RADIUS,
|
|
2716
|
+
inlinepipelinestatus: INLINE_FILTER_CONTROL_TYPES.PIPELINE_STATUS,
|
|
2717
|
+
inlinescorepriority: INLINE_FILTER_CONTROL_TYPES.SCORE_PRIORITY,
|
|
2718
|
+
inlinerelativeperiod: INLINE_FILTER_CONTROL_TYPES.RELATIVE_PERIOD,
|
|
2719
|
+
inlinesentiment: INLINE_FILTER_CONTROL_TYPES.SENTIMENT,
|
|
2720
|
+
inlinecolorlabel: INLINE_FILTER_CONTROL_TYPES.COLOR_LABEL,
|
|
2721
|
+
};
|
|
2722
|
+
const INLINE_FILTER_ALIAS_TOKEN_MAP = {};
|
|
2723
|
+
for (const [token, controlType] of Object.entries(INLINE_FILTER_CANONICAL_TOKEN_TO_CONTROL_TYPE_MAP)) {
|
|
2724
|
+
INLINE_FILTER_ALIAS_TOKEN_MAP[`filter${token}`] = controlType;
|
|
2725
|
+
INLINE_FILTER_ALIAS_TOKEN_MAP[`pdxfilter${token}`] = controlType;
|
|
2726
|
+
}
|
|
2727
|
+
const INLINE_FILTER_TOKEN_TO_CONTROL_TYPE = Object.freeze({
|
|
2728
|
+
...INLINE_FILTER_CANONICAL_TOKEN_TO_CONTROL_TYPE_MAP,
|
|
2729
|
+
...INLINE_FILTER_ALIAS_TOKEN_MAP,
|
|
2730
|
+
});
|
|
2731
|
+
const INLINE_FILTER_ALIAS_TOKENS = Object.freeze(Object.keys(INLINE_FILTER_ALIAS_TOKEN_MAP));
|
|
2732
|
+
const INLINE_FILTER_CANONICAL_TOKEN_TO_BASE_CONTROL_TYPE_MAP = {
|
|
2733
|
+
inlineselect: FieldControlType.SELECT,
|
|
2734
|
+
inlinesearchableselect: FieldControlType.SEARCHABLE_SELECT,
|
|
2735
|
+
inlineasyncselect: FieldControlType.ASYNC_SELECT,
|
|
2736
|
+
inlineentitylookup: FieldControlType.ENTITY_LOOKUP,
|
|
2737
|
+
inlineautocomplete: FieldControlType.AUTO_COMPLETE,
|
|
2738
|
+
inlinenumber: FieldControlType.NUMERIC_TEXT_BOX,
|
|
2739
|
+
inlinecurrency: FieldControlType.CURRENCY_INPUT,
|
|
2740
|
+
inlinecurrencyrange: FieldControlType.PRICE_RANGE,
|
|
2741
|
+
inlinemultiselect: FieldControlType.MULTI_SELECT,
|
|
2742
|
+
inlineinput: FieldControlType.INPUT,
|
|
2743
|
+
inlinephone: FieldControlType.PHONE,
|
|
2744
|
+
inlinetoggle: FieldControlType.TOGGLE,
|
|
2745
|
+
inlinerange: FieldControlType.RANGE_SLIDER,
|
|
2746
|
+
inlineperiodrange: FieldControlType.RANGE_SLIDER,
|
|
2747
|
+
inlineyearrange: FieldControlType.YEAR_INPUT,
|
|
2748
|
+
inlinemonthrange: FieldControlType.MONTH_INPUT,
|
|
2749
|
+
inlinedate: FieldControlType.DATE_PICKER,
|
|
2750
|
+
inlinedaterange: FieldControlType.DATE_RANGE,
|
|
2751
|
+
inlinetime: FieldControlType.TIME_PICKER,
|
|
2752
|
+
inlinetimerange: FieldControlType.TIME_RANGE,
|
|
2753
|
+
inlinetreeselect: FieldControlType.TREE_SELECT,
|
|
2754
|
+
inlinerating: FieldControlType.RATING,
|
|
2755
|
+
inlinedistanceradius: FieldControlType.INLINE_DISTANCE_RADIUS,
|
|
2756
|
+
inlinepipelinestatus: FieldControlType.INLINE_PIPELINE_STATUS,
|
|
2757
|
+
inlinescorepriority: FieldControlType.INLINE_SCORE_PRIORITY,
|
|
2758
|
+
inlinerelativeperiod: FieldControlType.INLINE_RELATIVE_PERIOD,
|
|
2759
|
+
inlinesentiment: FieldControlType.INLINE_SENTIMENT,
|
|
2760
|
+
inlinecolorlabel: FieldControlType.INLINE_COLOR_LABEL,
|
|
2761
|
+
};
|
|
2762
|
+
const INLINE_FILTER_ALIAS_TOKEN_TO_BASE_CONTROL_TYPE_MAP = {};
|
|
2763
|
+
for (const [aliasToken, controlType] of Object.entries(INLINE_FILTER_ALIAS_TOKEN_MAP)) {
|
|
2764
|
+
const canonicalToken = aliasToken.startsWith('pdxfilter')
|
|
2765
|
+
? aliasToken.replace(/^pdxfilter/, '')
|
|
2766
|
+
: aliasToken.replace(/^filter/, '');
|
|
2767
|
+
const baseControlType = INLINE_FILTER_CANONICAL_TOKEN_TO_BASE_CONTROL_TYPE_MAP[canonicalToken];
|
|
2768
|
+
if (baseControlType) {
|
|
2769
|
+
INLINE_FILTER_ALIAS_TOKEN_TO_BASE_CONTROL_TYPE_MAP[aliasToken] = baseControlType;
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
const INLINE_FILTER_TOKEN_TO_BASE_CONTROL_TYPE = Object.freeze({
|
|
2773
|
+
...INLINE_FILTER_CANONICAL_TOKEN_TO_BASE_CONTROL_TYPE_MAP,
|
|
2774
|
+
...INLINE_FILTER_ALIAS_TOKEN_TO_BASE_CONTROL_TYPE_MAP,
|
|
2775
|
+
});
|
|
2776
|
+
function resolveInlineFilterControlType(value) {
|
|
2777
|
+
const token = normalizeInlineControlTypeToken(value);
|
|
2778
|
+
if (!token)
|
|
2779
|
+
return undefined;
|
|
2780
|
+
return INLINE_FILTER_TOKEN_TO_CONTROL_TYPE[token];
|
|
2781
|
+
}
|
|
2782
|
+
function resolveInlineFilterControlTypeToBaseControlType(value) {
|
|
2783
|
+
const token = normalizeInlineControlTypeToken(value);
|
|
2784
|
+
if (!token)
|
|
2785
|
+
return undefined;
|
|
2786
|
+
return INLINE_FILTER_TOKEN_TO_BASE_CONTROL_TYPE[token];
|
|
2787
|
+
}
|
|
2788
|
+
function isInlineFilterControlType(value) {
|
|
2789
|
+
return INLINE_FILTER_CONTROL_TYPE_SET.has(String(value || '').trim());
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
function toUpperSnakeCase(raw) {
|
|
2793
|
+
return raw
|
|
2794
|
+
.trim()
|
|
2795
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1_$2')
|
|
2796
|
+
.replace(/[-\s]+/g, '_')
|
|
2797
|
+
.replace(/__+/g, '_')
|
|
2798
|
+
.toUpperCase();
|
|
2799
|
+
}
|
|
2800
|
+
function normalizeControlTypeToken(value) {
|
|
2801
|
+
return String(value || '')
|
|
2802
|
+
.trim()
|
|
2803
|
+
.toLowerCase()
|
|
2804
|
+
.replace(/[-_\s]/g, '');
|
|
2805
|
+
}
|
|
2806
|
+
const CONTROL_TYPE_TOKEN_TO_KEY = Object.entries(FieldControlType).reduce((acc, [key, controlTypeValue]) => {
|
|
2807
|
+
acc[normalizeControlTypeToken(key)] = key;
|
|
2808
|
+
acc[normalizeControlTypeToken(controlTypeValue)] = key;
|
|
2809
|
+
return acc;
|
|
2810
|
+
}, {});
|
|
2811
|
+
const ALIAS_TOKEN_TO_CONTROL_TYPE = {
|
|
2812
|
+
// Legacy/common synonyms
|
|
2813
|
+
searchable: FieldControlType.SEARCHABLE_SELECT,
|
|
2814
|
+
searchableinput: FieldControlType.SEARCHABLE_SELECT,
|
|
2815
|
+
searchableselect: FieldControlType.SEARCHABLE_SELECT,
|
|
2816
|
+
materialsearchableselect: FieldControlType.SEARCHABLE_SELECT,
|
|
2817
|
+
asyncselect: FieldControlType.ASYNC_SELECT,
|
|
2818
|
+
materialasyncselect: FieldControlType.ASYNC_SELECT,
|
|
2819
|
+
entitylookup: FieldControlType.ENTITY_LOOKUP,
|
|
2820
|
+
materialentitylookup: FieldControlType.ENTITY_LOOKUP,
|
|
2821
|
+
autocomplete: FieldControlType.AUTO_COMPLETE,
|
|
2822
|
+
multiselect: FieldControlType.MULTI_SELECT,
|
|
2823
|
+
multiselecttree: FieldControlType.MULTI_SELECT_TREE,
|
|
2824
|
+
treeselect: FieldControlType.TREE_SELECT,
|
|
2825
|
+
datepicker: FieldControlType.DATE_PICKER,
|
|
2826
|
+
daterange: FieldControlType.DATE_RANGE,
|
|
2827
|
+
datetime: FieldControlType.DATETIME_LOCAL_INPUT,
|
|
2828
|
+
timepicker: FieldControlType.TIME_PICKER,
|
|
2829
|
+
timerange: FieldControlType.TIME_RANGE,
|
|
2830
|
+
pricerange: FieldControlType.PRICE_RANGE,
|
|
2831
|
+
rangeslider: FieldControlType.RANGE_SLIDER,
|
|
2832
|
+
number: FieldControlType.NUMERIC_TEXT_BOX,
|
|
2833
|
+
numeric: FieldControlType.NUMERIC_TEXT_BOX,
|
|
2834
|
+
currencyinput: FieldControlType.CURRENCY_INPUT,
|
|
2835
|
+
switch: FieldControlType.TOGGLE,
|
|
2836
|
+
radiogroup: FieldControlType.RADIO,
|
|
2837
|
+
checkboxgroup: FieldControlType.CHECKBOX,
|
|
2838
|
+
chiplist: FieldControlType.CHIP_LIST,
|
|
2839
|
+
chipinput: FieldControlType.CHIP_INPUT,
|
|
2840
|
+
searchinput: FieldControlType.SEARCH_INPUT,
|
|
2841
|
+
};
|
|
2842
|
+
function normalizeControlTypeKey(value) {
|
|
2843
|
+
const token = normalizeControlTypeToken(value);
|
|
2844
|
+
if (!token)
|
|
2845
|
+
return '';
|
|
2846
|
+
const resolvedKey = CONTROL_TYPE_TOKEN_TO_KEY[token];
|
|
2847
|
+
if (resolvedKey)
|
|
2848
|
+
return resolvedKey;
|
|
2849
|
+
return toUpperSnakeCase(String(value || ''));
|
|
2850
|
+
}
|
|
2851
|
+
function resolveControlTypeAlias(value, fallback = FieldControlType.INPUT) {
|
|
2852
|
+
const raw = String(value || '').trim();
|
|
2853
|
+
if (!raw)
|
|
2854
|
+
return fallback;
|
|
2855
|
+
const token = normalizeControlTypeToken(raw);
|
|
2856
|
+
const inlineAliased = INLINE_FILTER_TOKEN_TO_BASE_CONTROL_TYPE[token];
|
|
2857
|
+
if (inlineAliased)
|
|
2858
|
+
return inlineAliased;
|
|
2859
|
+
const aliased = ALIAS_TOKEN_TO_CONTROL_TYPE[token];
|
|
2860
|
+
if (aliased)
|
|
2861
|
+
return aliased;
|
|
2862
|
+
const resolvedKey = CONTROL_TYPE_TOKEN_TO_KEY[token];
|
|
2863
|
+
if (resolvedKey) {
|
|
2864
|
+
return FieldControlType[resolvedKey];
|
|
2865
|
+
}
|
|
2866
|
+
return raw;
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
const MAX_OPTION_SOURCE_DEPTH = 3;
|
|
2515
2870
|
// Mirrors the backend custom-field key policy. Ordinary static field names are
|
|
2516
2871
|
// outside this boundary; custom keys must be safe across all runtime consumers.
|
|
2517
2872
|
const RESERVED_CUSTOM_FIELD_KEYS = new Set([
|
|
@@ -2809,6 +3164,41 @@ class SchemaNormalizationKernel {
|
|
|
2809
3164
|
.filter((v) => v.length > 0);
|
|
2810
3165
|
return normalized.filter((v, index) => normalized.indexOf(v) === index);
|
|
2811
3166
|
}
|
|
3167
|
+
parseDependsOn(value) {
|
|
3168
|
+
const rawItems = Array.isArray(value)
|
|
3169
|
+
? value
|
|
3170
|
+
: typeof value === 'string'
|
|
3171
|
+
? value.split(',')
|
|
3172
|
+
: [];
|
|
3173
|
+
const normalized = rawItems
|
|
3174
|
+
.map((item) => (typeof item === 'string' ? item.trim() : ''))
|
|
3175
|
+
.filter((item) => item.length > 0);
|
|
3176
|
+
return normalized.filter((item, index) => normalized.indexOf(item) === index);
|
|
3177
|
+
}
|
|
3178
|
+
parseStrictStringRecord(value) {
|
|
3179
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
3180
|
+
return undefined;
|
|
3181
|
+
}
|
|
3182
|
+
const normalized = Object.entries(value)
|
|
3183
|
+
.reduce((acc, [key, mapValue]) => {
|
|
3184
|
+
if (typeof mapValue !== 'string') {
|
|
3185
|
+
return acc;
|
|
3186
|
+
}
|
|
3187
|
+
const normalizedKey = String(key).trim();
|
|
3188
|
+
if (!normalizedKey ||
|
|
3189
|
+
normalizedKey === '__proto__' ||
|
|
3190
|
+
normalizedKey === 'constructor' ||
|
|
3191
|
+
normalizedKey === 'prototype') {
|
|
3192
|
+
return acc;
|
|
3193
|
+
}
|
|
3194
|
+
const normalizedValue = mapValue.trim();
|
|
3195
|
+
if (normalizedValue) {
|
|
3196
|
+
acc[normalizedKey] = normalizedValue;
|
|
3197
|
+
}
|
|
3198
|
+
return acc;
|
|
3199
|
+
}, {});
|
|
3200
|
+
return Object.keys(normalized).length ? normalized : undefined;
|
|
3201
|
+
}
|
|
2812
3202
|
parseStringRecord(value) {
|
|
2813
3203
|
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
2814
3204
|
return undefined;
|
|
@@ -3066,10 +3456,13 @@ class SchemaNormalizationKernel {
|
|
|
3066
3456
|
}
|
|
3067
3457
|
const dialog = {};
|
|
3068
3458
|
if (value.enabled !== undefined) {
|
|
3069
|
-
|
|
3459
|
+
const enabled = this.parseOptionalBoolean(value.enabled);
|
|
3460
|
+
if (enabled !== undefined) {
|
|
3461
|
+
dialog.enabled = enabled;
|
|
3462
|
+
}
|
|
3070
3463
|
}
|
|
3071
|
-
if (value.title
|
|
3072
|
-
const title =
|
|
3464
|
+
if (typeof value.title === 'string') {
|
|
3465
|
+
const title = value.title.trim();
|
|
3073
3466
|
if (title) {
|
|
3074
3467
|
dialog.title = title;
|
|
3075
3468
|
}
|
|
@@ -3081,13 +3474,22 @@ class SchemaNormalizationKernel {
|
|
|
3081
3474
|
}
|
|
3082
3475
|
}
|
|
3083
3476
|
if (value.previewPanel !== undefined) {
|
|
3084
|
-
|
|
3477
|
+
const previewPanel = this.parseOptionalBoolean(value.previewPanel);
|
|
3478
|
+
if (previewPanel !== undefined) {
|
|
3479
|
+
dialog.previewPanel = previewPanel;
|
|
3480
|
+
}
|
|
3085
3481
|
}
|
|
3086
3482
|
if (value.allowColumnChooser !== undefined) {
|
|
3087
|
-
|
|
3483
|
+
const allowColumnChooser = this.parseOptionalBoolean(value.allowColumnChooser);
|
|
3484
|
+
if (allowColumnChooser !== undefined) {
|
|
3485
|
+
dialog.allowColumnChooser = allowColumnChooser;
|
|
3486
|
+
}
|
|
3088
3487
|
}
|
|
3089
3488
|
if (value.allowSavedViews !== undefined) {
|
|
3090
|
-
|
|
3489
|
+
const allowSavedViews = this.parseOptionalBoolean(value.allowSavedViews);
|
|
3490
|
+
if (allowSavedViews !== undefined) {
|
|
3491
|
+
dialog.allowSavedViews = allowSavedViews;
|
|
3492
|
+
}
|
|
3091
3493
|
}
|
|
3092
3494
|
if (Array.isArray(value.resultColumns)) {
|
|
3093
3495
|
const resultColumns = value.resultColumns
|
|
@@ -3097,20 +3499,20 @@ class SchemaNormalizationKernel {
|
|
|
3097
3499
|
dialog.resultColumns = resultColumns;
|
|
3098
3500
|
}
|
|
3099
3501
|
}
|
|
3100
|
-
if (value.openActionLabel
|
|
3101
|
-
const openActionLabel =
|
|
3502
|
+
if (typeof value.openActionLabel === 'string') {
|
|
3503
|
+
const openActionLabel = value.openActionLabel.trim();
|
|
3102
3504
|
if (openActionLabel) {
|
|
3103
3505
|
dialog.openActionLabel = openActionLabel;
|
|
3104
3506
|
}
|
|
3105
3507
|
}
|
|
3106
|
-
if (value.applyActionLabel
|
|
3107
|
-
const applyActionLabel =
|
|
3508
|
+
if (typeof value.applyActionLabel === 'string') {
|
|
3509
|
+
const applyActionLabel = value.applyActionLabel.trim();
|
|
3108
3510
|
if (applyActionLabel) {
|
|
3109
3511
|
dialog.applyActionLabel = applyActionLabel;
|
|
3110
3512
|
}
|
|
3111
3513
|
}
|
|
3112
|
-
if (value.cancelActionLabel
|
|
3113
|
-
const cancelActionLabel =
|
|
3514
|
+
if (typeof value.cancelActionLabel === 'string') {
|
|
3515
|
+
const cancelActionLabel = value.cancelActionLabel.trim();
|
|
3114
3516
|
if (cancelActionLabel) {
|
|
3115
3517
|
dialog.cancelActionLabel = cancelActionLabel;
|
|
3116
3518
|
}
|
|
@@ -3121,19 +3523,19 @@ class SchemaNormalizationKernel {
|
|
|
3121
3523
|
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
3122
3524
|
return undefined;
|
|
3123
3525
|
}
|
|
3124
|
-
const field =
|
|
3526
|
+
const field = typeof value.field === 'string' ? value.field.trim() : '';
|
|
3125
3527
|
if (!field) {
|
|
3126
3528
|
return undefined;
|
|
3127
3529
|
}
|
|
3128
3530
|
const column = { field };
|
|
3129
|
-
if (value.label
|
|
3130
|
-
const label =
|
|
3531
|
+
if (typeof value.label === 'string') {
|
|
3532
|
+
const label = value.label.trim();
|
|
3131
3533
|
if (label) {
|
|
3132
3534
|
column.label = label;
|
|
3133
3535
|
}
|
|
3134
3536
|
}
|
|
3135
|
-
if (value.kind
|
|
3136
|
-
const kind =
|
|
3537
|
+
if (typeof value.kind === 'string') {
|
|
3538
|
+
const kind = value.kind.trim();
|
|
3137
3539
|
if (kind === 'code' ||
|
|
3138
3540
|
kind === 'label' ||
|
|
3139
3541
|
kind === 'description' ||
|
|
@@ -3143,15 +3545,137 @@ class SchemaNormalizationKernel {
|
|
|
3143
3545
|
column.kind = kind;
|
|
3144
3546
|
}
|
|
3145
3547
|
}
|
|
3146
|
-
if (value.width
|
|
3147
|
-
const width =
|
|
3548
|
+
if (typeof value.width === 'string') {
|
|
3549
|
+
const width = value.width.trim();
|
|
3148
3550
|
if (width) {
|
|
3149
3551
|
column.width = width;
|
|
3150
3552
|
}
|
|
3151
3553
|
}
|
|
3152
3554
|
return column;
|
|
3153
3555
|
}
|
|
3154
|
-
|
|
3556
|
+
mergeLookupDialog(base, override) {
|
|
3557
|
+
const merged = {
|
|
3558
|
+
...(this.parseLookupDialog(base) ?? {}),
|
|
3559
|
+
...(this.parseLookupDialog(override) ?? {}),
|
|
3560
|
+
};
|
|
3561
|
+
return Object.keys(merged).length ? merged : undefined;
|
|
3562
|
+
}
|
|
3563
|
+
parseLookupFilterOptions(value) {
|
|
3564
|
+
if (!Array.isArray(value)) {
|
|
3565
|
+
return undefined;
|
|
3566
|
+
}
|
|
3567
|
+
const options = [];
|
|
3568
|
+
const seen = new Set();
|
|
3569
|
+
for (const item of value) {
|
|
3570
|
+
if (typeof item === 'string' ||
|
|
3571
|
+
typeof item === 'number' ||
|
|
3572
|
+
typeof item === 'boolean') {
|
|
3573
|
+
let parsedValue;
|
|
3574
|
+
if (typeof item === 'string') {
|
|
3575
|
+
const trimmed = item.trim();
|
|
3576
|
+
if (!trimmed) {
|
|
3577
|
+
continue;
|
|
3578
|
+
}
|
|
3579
|
+
parsedValue = trimmed;
|
|
3580
|
+
}
|
|
3581
|
+
else if (typeof item === 'number') {
|
|
3582
|
+
if (!Number.isFinite(item)) {
|
|
3583
|
+
continue;
|
|
3584
|
+
}
|
|
3585
|
+
parsedValue = item;
|
|
3586
|
+
}
|
|
3587
|
+
else {
|
|
3588
|
+
parsedValue = item;
|
|
3589
|
+
}
|
|
3590
|
+
const dedupeKey = `${typeof parsedValue}:${String(parsedValue)}`;
|
|
3591
|
+
if (seen.has(dedupeKey)) {
|
|
3592
|
+
continue;
|
|
3593
|
+
}
|
|
3594
|
+
seen.add(dedupeKey);
|
|
3595
|
+
options.push({
|
|
3596
|
+
value: parsedValue,
|
|
3597
|
+
label: String(parsedValue),
|
|
3598
|
+
});
|
|
3599
|
+
continue;
|
|
3600
|
+
}
|
|
3601
|
+
if (!item || typeof item !== 'object' || Array.isArray(item)) {
|
|
3602
|
+
continue;
|
|
3603
|
+
}
|
|
3604
|
+
const raw = item;
|
|
3605
|
+
const isLegacyKeyValue = raw['key'] !== undefined &&
|
|
3606
|
+
raw['key'] !== null &&
|
|
3607
|
+
raw['label'] === undefined &&
|
|
3608
|
+
raw['text'] === undefined &&
|
|
3609
|
+
typeof raw['value'] === 'string' &&
|
|
3610
|
+
raw['key'] !== raw['value'];
|
|
3611
|
+
const rawValue = isLegacyKeyValue
|
|
3612
|
+
? raw['key']
|
|
3613
|
+
: raw['value'] !== undefined && raw['value'] !== null
|
|
3614
|
+
? raw['value']
|
|
3615
|
+
: raw['key'];
|
|
3616
|
+
const rawLabel = isLegacyKeyValue
|
|
3617
|
+
? raw['value']
|
|
3618
|
+
: raw['label'] ?? raw['text'];
|
|
3619
|
+
let parsedValue;
|
|
3620
|
+
if (typeof rawValue === 'string') {
|
|
3621
|
+
const trimmed = rawValue.trim();
|
|
3622
|
+
if (!trimmed) {
|
|
3623
|
+
continue;
|
|
3624
|
+
}
|
|
3625
|
+
parsedValue = trimmed;
|
|
3626
|
+
}
|
|
3627
|
+
else if (typeof rawValue === 'number') {
|
|
3628
|
+
if (!Number.isFinite(rawValue)) {
|
|
3629
|
+
continue;
|
|
3630
|
+
}
|
|
3631
|
+
parsedValue = rawValue;
|
|
3632
|
+
}
|
|
3633
|
+
else if (typeof rawValue === 'boolean') {
|
|
3634
|
+
parsedValue = rawValue;
|
|
3635
|
+
}
|
|
3636
|
+
else {
|
|
3637
|
+
continue;
|
|
3638
|
+
}
|
|
3639
|
+
const dedupeKey = `${typeof parsedValue}:${String(parsedValue)}`;
|
|
3640
|
+
if (seen.has(dedupeKey)) {
|
|
3641
|
+
continue;
|
|
3642
|
+
}
|
|
3643
|
+
seen.add(dedupeKey);
|
|
3644
|
+
let label;
|
|
3645
|
+
if (typeof rawLabel === 'string' && rawLabel.trim().length > 0) {
|
|
3646
|
+
label = rawLabel.trim();
|
|
3647
|
+
}
|
|
3648
|
+
else if ((typeof rawLabel === 'number' && Number.isFinite(rawLabel)) ||
|
|
3649
|
+
typeof rawLabel === 'boolean') {
|
|
3650
|
+
label = String(rawLabel);
|
|
3651
|
+
}
|
|
3652
|
+
else {
|
|
3653
|
+
label = String(parsedValue);
|
|
3654
|
+
}
|
|
3655
|
+
const option = {
|
|
3656
|
+
value: parsedValue,
|
|
3657
|
+
label,
|
|
3658
|
+
};
|
|
3659
|
+
if (typeof raw['icon'] === 'string' && raw['icon'].trim()) {
|
|
3660
|
+
option.icon = raw['icon'].trim();
|
|
3661
|
+
}
|
|
3662
|
+
if (typeof raw['tone'] === 'string' && raw['tone'].trim()) {
|
|
3663
|
+
option.tone = raw['tone'].trim();
|
|
3664
|
+
}
|
|
3665
|
+
if (typeof raw['description'] === 'string' && raw['description'].trim()) {
|
|
3666
|
+
option.description = raw['description'].trim();
|
|
3667
|
+
}
|
|
3668
|
+
if (raw['disabled'] !== undefined) {
|
|
3669
|
+
const disabled = this.parseOptionalBoolean(raw['disabled']);
|
|
3670
|
+
if (disabled !== undefined) {
|
|
3671
|
+
option.disabled = disabled;
|
|
3672
|
+
}
|
|
3673
|
+
}
|
|
3674
|
+
options.push(option);
|
|
3675
|
+
}
|
|
3676
|
+
return options.length ? options : undefined;
|
|
3677
|
+
}
|
|
3678
|
+
parseLookupFilterDefinition(value, optionSourceDepth = 0, visitedOptionSources = new Set()) {
|
|
3155
3679
|
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
3156
3680
|
return undefined;
|
|
3157
3681
|
}
|
|
@@ -3176,8 +3700,38 @@ class SchemaNormalizationKernel {
|
|
|
3176
3700
|
if (defaultOperator && operators.includes(defaultOperator)) {
|
|
3177
3701
|
definition.defaultOperator = defaultOperator;
|
|
3178
3702
|
}
|
|
3179
|
-
if (value.
|
|
3180
|
-
const
|
|
3703
|
+
if (value.options !== undefined) {
|
|
3704
|
+
const options = this.parseLookupFilterOptions(value.options);
|
|
3705
|
+
if (options) {
|
|
3706
|
+
definition.options = options;
|
|
3707
|
+
}
|
|
3708
|
+
}
|
|
3709
|
+
if (typeof value.optionSource === 'string') {
|
|
3710
|
+
const optionSource = value.optionSource.trim();
|
|
3711
|
+
if (optionSource) {
|
|
3712
|
+
definition.optionSource = optionSource;
|
|
3713
|
+
}
|
|
3714
|
+
}
|
|
3715
|
+
else if (value.optionSource &&
|
|
3716
|
+
typeof value.optionSource === 'object' &&
|
|
3717
|
+
!Array.isArray(value.optionSource)) {
|
|
3718
|
+
const optionSource = this.parseOptionSource(value.optionSource, optionSourceDepth + 1, visitedOptionSources);
|
|
3719
|
+
if (optionSource) {
|
|
3720
|
+
definition.optionSource = optionSource;
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
if (value.dependsOn !== undefined) {
|
|
3724
|
+
const dependsOn = this.parseDependsOn(value.dependsOn);
|
|
3725
|
+
if (dependsOn.length) {
|
|
3726
|
+
definition.dependsOn = dependsOn;
|
|
3727
|
+
}
|
|
3728
|
+
}
|
|
3729
|
+
const dependencyFilterMap = this.parseStrictStringRecord(value.dependencyFilterMap);
|
|
3730
|
+
if (dependencyFilterMap) {
|
|
3731
|
+
definition.dependencyFilterMap = dependencyFilterMap;
|
|
3732
|
+
}
|
|
3733
|
+
if (typeof value.optionsSource === 'string') {
|
|
3734
|
+
const optionsSource = value.optionsSource.trim();
|
|
3181
3735
|
if (optionsSource) {
|
|
3182
3736
|
definition.optionsSource = optionsSource;
|
|
3183
3737
|
}
|
|
@@ -3211,7 +3765,7 @@ class SchemaNormalizationKernel {
|
|
|
3211
3765
|
}, {});
|
|
3212
3766
|
return Object.keys(normalized).length ? normalized : undefined;
|
|
3213
3767
|
}
|
|
3214
|
-
parseLookupFiltering(value) {
|
|
3768
|
+
parseLookupFiltering(value, optionSourceDepth = 0, visitedOptionSources = new Set()) {
|
|
3215
3769
|
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
3216
3770
|
return undefined;
|
|
3217
3771
|
}
|
|
@@ -3219,7 +3773,7 @@ class SchemaNormalizationKernel {
|
|
|
3219
3773
|
if (value.availableFilters !== undefined) {
|
|
3220
3774
|
const availableFilters = Array.isArray(value.availableFilters)
|
|
3221
3775
|
? value.availableFilters
|
|
3222
|
-
.map((item) => this.parseLookupFilterDefinition(item))
|
|
3776
|
+
.map((item) => this.parseLookupFilterDefinition(item, optionSourceDepth, visitedOptionSources))
|
|
3223
3777
|
.filter((item) => !!item)
|
|
3224
3778
|
: [];
|
|
3225
3779
|
if (availableFilters.length) {
|
|
@@ -3305,6 +3859,12 @@ class SchemaNormalizationKernel {
|
|
|
3305
3859
|
filtering.searchStrategies = searchStrategies;
|
|
3306
3860
|
}
|
|
3307
3861
|
}
|
|
3862
|
+
if (typeof value.defaultSearchStrategy === 'string') {
|
|
3863
|
+
const defaultSearchStrategy = value.defaultSearchStrategy.trim();
|
|
3864
|
+
if (defaultSearchStrategy) {
|
|
3865
|
+
filtering.defaultSearchStrategy = defaultSearchStrategy;
|
|
3866
|
+
}
|
|
3867
|
+
}
|
|
3308
3868
|
return Object.keys(filtering).length ? filtering : undefined;
|
|
3309
3869
|
}
|
|
3310
3870
|
/** Parse option arrays into `{ key, value }` objects with label preservation. */
|
|
@@ -3335,16 +3895,23 @@ class SchemaNormalizationKernel {
|
|
|
3335
3895
|
return { key: String(opt), value: String(opt) };
|
|
3336
3896
|
});
|
|
3337
3897
|
}
|
|
3338
|
-
parseOptionSource(value) {
|
|
3339
|
-
if (!value ||
|
|
3898
|
+
parseOptionSource(value, depth = 0, visited = new Set()) {
|
|
3899
|
+
if (!value ||
|
|
3900
|
+
typeof value !== 'object' ||
|
|
3901
|
+
Array.isArray(value) ||
|
|
3902
|
+
depth > MAX_OPTION_SOURCE_DEPTH ||
|
|
3903
|
+
visited.has(value)) {
|
|
3340
3904
|
return undefined;
|
|
3341
3905
|
}
|
|
3342
|
-
const
|
|
3343
|
-
|
|
3344
|
-
};
|
|
3345
|
-
if (!optionSource.key) {
|
|
3906
|
+
const key = String(value.key ?? '').trim();
|
|
3907
|
+
if (!key) {
|
|
3346
3908
|
return undefined;
|
|
3347
3909
|
}
|
|
3910
|
+
const nextVisited = new Set(visited);
|
|
3911
|
+
nextVisited.add(value);
|
|
3912
|
+
const optionSource = {
|
|
3913
|
+
key,
|
|
3914
|
+
};
|
|
3348
3915
|
if (value.type !== undefined) {
|
|
3349
3916
|
const optionSourceType = this.parseOptionSourceType(value.type);
|
|
3350
3917
|
if (optionSourceType) {
|
|
@@ -3388,12 +3955,12 @@ class SchemaNormalizationKernel {
|
|
|
3388
3955
|
optionSource.searchPropertyPaths = this.parseStringArray(value.searchPropertyPaths);
|
|
3389
3956
|
}
|
|
3390
3957
|
if (value.dependsOn !== undefined) {
|
|
3391
|
-
const dependsOn = this.
|
|
3958
|
+
const dependsOn = this.parseDependsOn(value.dependsOn);
|
|
3392
3959
|
if (dependsOn.length) {
|
|
3393
3960
|
optionSource.dependsOn = dependsOn;
|
|
3394
3961
|
}
|
|
3395
3962
|
}
|
|
3396
|
-
const dependencyFilterMap = this.
|
|
3963
|
+
const dependencyFilterMap = this.parseStrictStringRecord(value.dependencyFilterMap);
|
|
3397
3964
|
if (dependencyFilterMap) {
|
|
3398
3965
|
optionSource.dependencyFilterMap = dependencyFilterMap;
|
|
3399
3966
|
}
|
|
@@ -3417,10 +3984,14 @@ class SchemaNormalizationKernel {
|
|
|
3417
3984
|
if (create) {
|
|
3418
3985
|
optionSource.create = create;
|
|
3419
3986
|
}
|
|
3420
|
-
const filtering = this.parseLookupFiltering(value.filtering);
|
|
3987
|
+
const filtering = this.parseLookupFiltering(value.filtering, depth, nextVisited);
|
|
3421
3988
|
if (filtering) {
|
|
3422
3989
|
optionSource.filtering = filtering;
|
|
3423
3990
|
}
|
|
3991
|
+
const dialog = this.parseLookupDialog(value.dialog);
|
|
3992
|
+
if (dialog) {
|
|
3993
|
+
optionSource.dialog = dialog;
|
|
3994
|
+
}
|
|
3424
3995
|
if (value.excludeSelfField !== undefined) {
|
|
3425
3996
|
optionSource.excludeSelfField = this.parseBoolean(value.excludeSelfField);
|
|
3426
3997
|
}
|
|
@@ -4085,7 +4656,7 @@ class SchemaNormalizationKernel {
|
|
|
4085
4656
|
// Basic information
|
|
4086
4657
|
// -------------------------------------------------------------------
|
|
4087
4658
|
field.label = ui.label ?? prop.title ?? name;
|
|
4088
|
-
field.type = this.resolveFieldType(prop, ui);
|
|
4659
|
+
field.type = this.resolveFieldType(prop, ui, rootSchema);
|
|
4089
4660
|
if (field.type === 'array')
|
|
4090
4661
|
field.items = normalizeScalarItemsSchema(prop?.items);
|
|
4091
4662
|
const numericFormat = this.resolveNumericFormatToken(prop, ui, field.type);
|
|
@@ -4104,6 +4675,18 @@ class SchemaNormalizationKernel {
|
|
|
4104
4675
|
if (ui.controlType) {
|
|
4105
4676
|
field.controlType = ui.controlType;
|
|
4106
4677
|
}
|
|
4678
|
+
if (this.isCanonicalMonetaryRangeUnion(prop, rootSchema)) {
|
|
4679
|
+
field.type = 'array';
|
|
4680
|
+
const controlToken = normalizeControlTypeToken(field.controlType);
|
|
4681
|
+
const isInlineCurrencyRange = controlToken === 'inlinecurrencyrange' ||
|
|
4682
|
+
resolveInlineFilterControlType(field.controlType) === 'inlineCurrencyRange';
|
|
4683
|
+
if (!isInlineCurrencyRange) {
|
|
4684
|
+
field.controlType = 'priceRange';
|
|
4685
|
+
}
|
|
4686
|
+
}
|
|
4687
|
+
if (this.inferRequireTwoBoundsFromUnion(prop, rootSchema)) {
|
|
4688
|
+
field.requireTwoBounds = true;
|
|
4689
|
+
}
|
|
4107
4690
|
if (field.controlType === 'array' || ui.array !== undefined) {
|
|
4108
4691
|
const arrayConfig = this.normalizeArrayConfig(ui, prop, rootSchema);
|
|
4109
4692
|
if (arrayConfig) {
|
|
@@ -4399,11 +4982,11 @@ class SchemaNormalizationKernel {
|
|
|
4399
4982
|
if (optionSource) {
|
|
4400
4983
|
// Java metadata publishes cascade context beside optionSource. Keep the
|
|
4401
4984
|
// runtime contract canonical by materializing it inside optionSource.
|
|
4402
|
-
const dependsOn = this.
|
|
4985
|
+
const dependsOn = this.parseDependsOn(ui.dependsOn);
|
|
4403
4986
|
if (!optionSource.dependsOn?.length && dependsOn.length) {
|
|
4404
4987
|
optionSource.dependsOn = dependsOn;
|
|
4405
4988
|
}
|
|
4406
|
-
const dependencyFilterMap = this.
|
|
4989
|
+
const dependencyFilterMap = this.parseStrictStringRecord(ui.dependencyFilterMap);
|
|
4407
4990
|
if (!optionSource.dependencyFilterMap &&
|
|
4408
4991
|
dependencyFilterMap) {
|
|
4409
4992
|
optionSource.dependencyFilterMap = dependencyFilterMap;
|
|
@@ -4450,11 +5033,10 @@ class SchemaNormalizationKernel {
|
|
|
4450
5033
|
if (ui.filter !== undefined) {
|
|
4451
5034
|
field.filter = ui.filter;
|
|
4452
5035
|
}
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
}
|
|
5036
|
+
const explicitDialog = ui.dialog !== undefined ? this.parseLookupDialog(ui.dialog) : undefined;
|
|
5037
|
+
const resolvedDialog = this.mergeLookupDialog(field.optionSource?.dialog, explicitDialog);
|
|
5038
|
+
if (resolvedDialog) {
|
|
5039
|
+
field.dialog = resolvedDialog;
|
|
4458
5040
|
}
|
|
4459
5041
|
if (ui.detailActionLabel !== undefined) {
|
|
4460
5042
|
const detailActionLabel = String(ui.detailActionLabel).trim();
|
|
@@ -4562,6 +5144,8 @@ class SchemaNormalizationKernel {
|
|
|
4562
5144
|
'thumbLabel',
|
|
4563
5145
|
'discrete',
|
|
4564
5146
|
'showInputs',
|
|
5147
|
+
'showInlineInputs',
|
|
5148
|
+
'showCurrencySymbol',
|
|
4565
5149
|
'disableThumbSwap',
|
|
4566
5150
|
'vertical',
|
|
4567
5151
|
'invert',
|
|
@@ -4574,20 +5158,25 @@ class SchemaNormalizationKernel {
|
|
|
4574
5158
|
}
|
|
4575
5159
|
}
|
|
4576
5160
|
}
|
|
4577
|
-
|
|
4578
|
-
const
|
|
4579
|
-
if (
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
5161
|
+
for (const guideKey of ['showTicks', 'showAnchors']) {
|
|
5162
|
+
const rawGuide = ui[guideKey];
|
|
5163
|
+
if (rawGuide !== undefined) {
|
|
5164
|
+
const parsedGuide = this.parseOptionalBoolean(rawGuide);
|
|
5165
|
+
if (parsedGuide !== undefined) {
|
|
5166
|
+
field[guideKey] = parsedGuide;
|
|
5167
|
+
}
|
|
5168
|
+
else if (typeof rawGuide === 'string' &&
|
|
5169
|
+
rawGuide.trim().toLowerCase() === 'auto') {
|
|
5170
|
+
field[guideKey] = 'auto';
|
|
5171
|
+
}
|
|
4585
5172
|
}
|
|
4586
5173
|
}
|
|
4587
5174
|
const sliderNumberKeys = [
|
|
5175
|
+
'sliderStep',
|
|
4588
5176
|
'shiftStep',
|
|
4589
5177
|
'minDistance',
|
|
4590
5178
|
'maxDistance',
|
|
5179
|
+
'decimalPlaces',
|
|
4591
5180
|
];
|
|
4592
5181
|
for (const key of sliderNumberKeys) {
|
|
4593
5182
|
if (ui[key] !== undefined) {
|
|
@@ -4621,6 +5210,9 @@ class SchemaNormalizationKernel {
|
|
|
4621
5210
|
'inlineChipSummaryTemplate',
|
|
4622
5211
|
'inlineChipUnitLabel',
|
|
4623
5212
|
'inlinePanelTitle',
|
|
5213
|
+
'inlinePanelSubtitle',
|
|
5214
|
+
'inlinePanelIcon',
|
|
5215
|
+
'inlinePanelIconColor',
|
|
4624
5216
|
'inlineQuickPresets',
|
|
4625
5217
|
'inlineQuickPresetsApplyMode',
|
|
4626
5218
|
'inlineTexts',
|
|
@@ -4639,7 +5231,14 @@ class SchemaNormalizationKernel {
|
|
|
4639
5231
|
'maxYear',
|
|
4640
5232
|
'minTime',
|
|
4641
5233
|
'maxTime',
|
|
5234
|
+
'stepMinute',
|
|
4642
5235
|
'stepMinutes',
|
|
5236
|
+
'interval',
|
|
5237
|
+
'inlineTimeTrackShifts',
|
|
5238
|
+
'inlineTrackShifts',
|
|
5239
|
+
'trackShifts',
|
|
5240
|
+
'minDistanceMinutes',
|
|
5241
|
+
'maxDistanceMinutes',
|
|
4643
5242
|
'startField',
|
|
4644
5243
|
'endField',
|
|
4645
5244
|
'startLabel',
|
|
@@ -4648,6 +5247,19 @@ class SchemaNormalizationKernel {
|
|
|
4648
5247
|
'endPlaceholder',
|
|
4649
5248
|
'inputMinLabel',
|
|
4650
5249
|
'inputMaxLabel',
|
|
5250
|
+
'inputExactLabel',
|
|
5251
|
+
'startMin',
|
|
5252
|
+
'startMax',
|
|
5253
|
+
'endMin',
|
|
5254
|
+
'endMax',
|
|
5255
|
+
'startMinMessage',
|
|
5256
|
+
'startMaxMessage',
|
|
5257
|
+
'endMinMessage',
|
|
5258
|
+
'endMaxMessage',
|
|
5259
|
+
'endMinOffset',
|
|
5260
|
+
'endMinOffsetMessage',
|
|
5261
|
+
'startMaxOffset',
|
|
5262
|
+
'startMaxOffsetMessage',
|
|
4651
5263
|
'maxVisibleChips',
|
|
4652
5264
|
'maxVisibleBadges',
|
|
4653
5265
|
'showSelectAll',
|
|
@@ -4685,21 +5297,51 @@ class SchemaNormalizationKernel {
|
|
|
4685
5297
|
'displayFormat',
|
|
4686
5298
|
'currency',
|
|
4687
5299
|
'currencyCode',
|
|
5300
|
+
'currencyPosition',
|
|
5301
|
+
'thousandSeparator',
|
|
5302
|
+
'thousandsSeparator',
|
|
5303
|
+
'decimalSeparator',
|
|
5304
|
+
'allowNegative',
|
|
5305
|
+
'operatorModes',
|
|
5306
|
+
'defaultOperatorMode',
|
|
5307
|
+
'requireTwoBounds',
|
|
4688
5308
|
'locale',
|
|
4689
5309
|
'precision',
|
|
4690
|
-
'decimalPlaces',
|
|
4691
5310
|
'initialsField',
|
|
4692
5311
|
'optionLabelKey',
|
|
4693
5312
|
'optionValueKey',
|
|
4694
5313
|
'extraProperties',
|
|
4695
5314
|
'rangeMode',
|
|
4696
5315
|
'maxRating',
|
|
5316
|
+
'ratingMin',
|
|
5317
|
+
'ratingMax',
|
|
5318
|
+
'itemsCount',
|
|
5319
|
+
'ratingStep',
|
|
4697
5320
|
'allowHalf',
|
|
5321
|
+
'ratingAllowHalf',
|
|
5322
|
+
'ratingPrecision',
|
|
4698
5323
|
'ratingIcon',
|
|
4699
5324
|
'ratingEmptyIcon',
|
|
4700
5325
|
'ratingHalfIcon',
|
|
5326
|
+
'ratingActiveIcon',
|
|
5327
|
+
'ratingInactiveIcon',
|
|
4701
5328
|
'ratingTone',
|
|
4702
5329
|
'ratingToneColors',
|
|
5330
|
+
'ratingColors',
|
|
5331
|
+
'starColors',
|
|
5332
|
+
'ratingLowColor',
|
|
5333
|
+
'ratingMidColor',
|
|
5334
|
+
'ratingHighColor',
|
|
5335
|
+
'ratingGradientLowColor',
|
|
5336
|
+
'ratingGradientMidColor',
|
|
5337
|
+
'ratingGradientHighColor',
|
|
5338
|
+
'ratingToneLowColor',
|
|
5339
|
+
'ratingToneMidColor',
|
|
5340
|
+
'ratingToneHighColor',
|
|
5341
|
+
'ratingBadgeColor',
|
|
5342
|
+
'ratingBadgeIcon',
|
|
5343
|
+
'ratingBadgeIconColor',
|
|
5344
|
+
'ratingIndicatorColor',
|
|
4703
5345
|
'ratingLabels',
|
|
4704
5346
|
'distanceUnit',
|
|
4705
5347
|
'distanceBaseUnit',
|
|
@@ -4711,6 +5353,14 @@ class SchemaNormalizationKernel {
|
|
|
4711
5353
|
'distanceDecimalsMi',
|
|
4712
5354
|
'distancePresets',
|
|
4713
5355
|
'distanceSubtitle',
|
|
5356
|
+
'distanceIcon',
|
|
5357
|
+
'distanceStart',
|
|
5358
|
+
'distanceEnd',
|
|
5359
|
+
'radiusMin',
|
|
5360
|
+
'radiusMax',
|
|
5361
|
+
'radiusStep',
|
|
5362
|
+
'radiusMode',
|
|
5363
|
+
'distanceSliderStep',
|
|
4714
5364
|
'distanceRadialRings',
|
|
4715
5365
|
'distanceAccentColor',
|
|
4716
5366
|
'distanceRingColor',
|
|
@@ -4728,6 +5378,25 @@ class SchemaNormalizationKernel {
|
|
|
4728
5378
|
'severityBands',
|
|
4729
5379
|
'scorePalette',
|
|
4730
5380
|
'scoreTexts',
|
|
5381
|
+
'scoreSubtitle',
|
|
5382
|
+
'scoreUnit',
|
|
5383
|
+
'scoreDisplayDecimals',
|
|
5384
|
+
'scoreShowScaleLabels',
|
|
5385
|
+
'scoreShowBandChips',
|
|
5386
|
+
'scoreRangeSeparator',
|
|
5387
|
+
'scoreGradientLowColor',
|
|
5388
|
+
'scoreGradientMidColor',
|
|
5389
|
+
'scoreGradientHighColor',
|
|
5390
|
+
'scoreValueFallbackColor',
|
|
5391
|
+
'scoreEmptyGradient',
|
|
5392
|
+
'scoreIcon',
|
|
5393
|
+
'scoreBandsAriaLabel',
|
|
5394
|
+
'scoreBandAriaLabelTemplate',
|
|
5395
|
+
'scoreMin',
|
|
5396
|
+
'scoreMax',
|
|
5397
|
+
'scoreStep',
|
|
5398
|
+
'scoreMode',
|
|
5399
|
+
'scoreSliderStep',
|
|
4731
5400
|
'relativePeriodOptions',
|
|
4732
5401
|
'relativePeriodPresets',
|
|
4733
5402
|
'relativePeriodTexts',
|
|
@@ -4744,6 +5413,114 @@ class SchemaNormalizationKernel {
|
|
|
4744
5413
|
'numberFormat',
|
|
4745
5414
|
'valueLabelFormat',
|
|
4746
5415
|
'scale',
|
|
5416
|
+
'optionSubtitleKey',
|
|
5417
|
+
'optionWeightKey',
|
|
5418
|
+
'optionColorKey',
|
|
5419
|
+
'optionIconKey',
|
|
5420
|
+
'optionEmojiKey',
|
|
5421
|
+
'panelSearchIcon',
|
|
5422
|
+
'panelSearchIconColor',
|
|
5423
|
+
'panelResetIcon',
|
|
5424
|
+
'panelResetIconColor',
|
|
5425
|
+
'optionSelectedIcon',
|
|
5426
|
+
'optionSelectedIconColor',
|
|
5427
|
+
'columns',
|
|
5428
|
+
'pipelineTitle',
|
|
5429
|
+
'pipelineSubtitle',
|
|
5430
|
+
'pipelineMode',
|
|
5431
|
+
'pipelineMultiple',
|
|
5432
|
+
'pipelineSearchable',
|
|
5433
|
+
'pipelineSearchPlaceholder',
|
|
5434
|
+
'pipelineOptionSubtitleKey',
|
|
5435
|
+
'pipelineOptionWeightKey',
|
|
5436
|
+
'pipelineOptionColorKey',
|
|
5437
|
+
'pipelineShowBar',
|
|
5438
|
+
'pipelineShowSelectionPills',
|
|
5439
|
+
'pipelineShowSelectAll',
|
|
5440
|
+
'pipelineSelectAllText',
|
|
5441
|
+
'pipelineShowClearAction',
|
|
5442
|
+
'pipelineClearActionText',
|
|
5443
|
+
'pipelineChipMaxVisible',
|
|
5444
|
+
'statusColors',
|
|
5445
|
+
'pipelineGradientLowColor',
|
|
5446
|
+
'pipelineGradientMidColor',
|
|
5447
|
+
'pipelineGradientHighColor',
|
|
5448
|
+
'pipelineEmptyStateText',
|
|
5449
|
+
'pipelineSelectionActionsAriaLabel',
|
|
5450
|
+
'pipelineOptionsGroupAriaLabelMultiple',
|
|
5451
|
+
'pipelineOptionsGroupAriaLabelSingle',
|
|
5452
|
+
'pipelineSelectionPillsAriaLabel',
|
|
5453
|
+
'pipelineBarAriaLabelEmpty',
|
|
5454
|
+
'pipelineBarAriaLabelSelected',
|
|
5455
|
+
'pipelineIcon',
|
|
5456
|
+
'pipelineSearchIcon',
|
|
5457
|
+
'pipelineSearchIconColor',
|
|
5458
|
+
'relativePeriodTitle',
|
|
5459
|
+
'relativePeriodSubtitle',
|
|
5460
|
+
'relativePeriodShowProgress',
|
|
5461
|
+
'relativePeriodProgressGradientLowColor',
|
|
5462
|
+
'relativePeriodProgressGradientMidColor',
|
|
5463
|
+
'relativePeriodProgressGradientHighColor',
|
|
5464
|
+
'relativePeriodColumns',
|
|
5465
|
+
'relativePeriodCloseOnSelect',
|
|
5466
|
+
'relativePeriodMultiple',
|
|
5467
|
+
'relativePeriodSearchable',
|
|
5468
|
+
'relativePeriodIcon',
|
|
5469
|
+
'relativePeriodIconKey',
|
|
5470
|
+
'relativePeriodSubtitleKey',
|
|
5471
|
+
'relativePeriodSelectedIcon',
|
|
5472
|
+
'relativePeriodSelectedIconColor',
|
|
5473
|
+
'relativePeriodOptionsAriaLabel',
|
|
5474
|
+
'relativePeriodProgressEmptyLabel',
|
|
5475
|
+
'relativePeriodEmptyStateText',
|
|
5476
|
+
'sentimentTitle',
|
|
5477
|
+
'sentimentSubtitle',
|
|
5478
|
+
'sentimentGradientLowColor',
|
|
5479
|
+
'sentimentGradientMidColor',
|
|
5480
|
+
'sentimentGradientHighColor',
|
|
5481
|
+
'sentimentShowBar',
|
|
5482
|
+
'sentimentAnimatedEmoji',
|
|
5483
|
+
'sentimentCloseOnSelect',
|
|
5484
|
+
'sentimentMultiple',
|
|
5485
|
+
'sentimentShowSelectionPills',
|
|
5486
|
+
'sentimentIcon',
|
|
5487
|
+
'sentimentColorKey',
|
|
5488
|
+
'sentimentEmojiKey',
|
|
5489
|
+
'sentimentOptionsAriaLabel',
|
|
5490
|
+
'sentimentSelectionPillsAriaLabel',
|
|
5491
|
+
'sentimentEmptyStateText',
|
|
5492
|
+
'colorLabelTitle',
|
|
5493
|
+
'colorLabelSubtitle',
|
|
5494
|
+
'colorLabelMultiple',
|
|
5495
|
+
'colorLabelColumns',
|
|
5496
|
+
'colorLabelShowSelectedBadges',
|
|
5497
|
+
'colorLabelCloseOnSelect',
|
|
5498
|
+
'colorLabelSelectionTitle',
|
|
5499
|
+
'colorLabelIcon',
|
|
5500
|
+
'colorLabelSelectedIcon',
|
|
5501
|
+
'colorLabelSelectedIconColor',
|
|
5502
|
+
'colorLabelBadgeRemoveIcon',
|
|
5503
|
+
'colorLabelBadgeRemoveIconColor',
|
|
5504
|
+
'colorLabelColorKey',
|
|
5505
|
+
'colorLabelOptionsAriaLabel',
|
|
5506
|
+
'colorLabelSelectionBadgesAriaLabel',
|
|
5507
|
+
'colorLabelRemoveSelectionAriaLabel',
|
|
5508
|
+
'colorLabelEmptyStateText',
|
|
5509
|
+
'startAriaLabel',
|
|
5510
|
+
'endAriaLabel',
|
|
5511
|
+
'inlineQuickPresetsAriaLabel',
|
|
5512
|
+
'inlineQuickPresetsCancelLabel',
|
|
5513
|
+
'inlineQuickPresetsCancelAriaLabel',
|
|
5514
|
+
'inlineQuickPresetsApplyLabel',
|
|
5515
|
+
'inlineQuickPresetsApplyAriaLabel',
|
|
5516
|
+
'shortcutsPosition',
|
|
5517
|
+
'applyOnShortcutClick',
|
|
5518
|
+
'i18nShortcuts',
|
|
5519
|
+
'startView',
|
|
5520
|
+
'startAt',
|
|
5521
|
+
'touchUi',
|
|
5522
|
+
'minDate',
|
|
5523
|
+
'maxDate',
|
|
4747
5524
|
];
|
|
4748
5525
|
for (const key of inlinePassThroughKeys) {
|
|
4749
5526
|
if (ui[key] !== undefined && field[key] === undefined) {
|
|
@@ -4781,27 +5558,150 @@ class SchemaNormalizationKernel {
|
|
|
4781
5558
|
]);
|
|
4782
5559
|
return identity(left) === identity(right);
|
|
4783
5560
|
}
|
|
4784
|
-
|
|
5561
|
+
resolveSchemaNode(node, rootSchema, visited = new Set()) {
|
|
5562
|
+
if (!node || typeof node !== 'object' || Array.isArray(node)) {
|
|
5563
|
+
return node;
|
|
5564
|
+
}
|
|
5565
|
+
const ref = typeof node.$ref === 'string' ? node.$ref.trim() : '';
|
|
5566
|
+
if (!ref || visited.has(ref)) {
|
|
5567
|
+
return node;
|
|
5568
|
+
}
|
|
5569
|
+
const resolved = this.resolveSchemaRef(ref, rootSchema);
|
|
5570
|
+
if (!resolved || typeof resolved !== 'object' || Array.isArray(resolved)) {
|
|
5571
|
+
return node;
|
|
5572
|
+
}
|
|
5573
|
+
const nextVisited = new Set(visited);
|
|
5574
|
+
nextVisited.add(ref);
|
|
5575
|
+
const resolvedDeep = this.resolveSchemaNode(resolved, rootSchema, nextVisited);
|
|
5576
|
+
const { $ref: _ignoredRef, ...rest } = node;
|
|
5577
|
+
return {
|
|
5578
|
+
...(resolvedDeep && typeof resolvedDeep === 'object' ? resolvedDeep : {}),
|
|
5579
|
+
...rest,
|
|
5580
|
+
};
|
|
5581
|
+
}
|
|
5582
|
+
extractSchemaNonNullTypes(node) {
|
|
5583
|
+
if (!node || typeof node !== 'object') {
|
|
5584
|
+
return [];
|
|
5585
|
+
}
|
|
5586
|
+
const collected = [];
|
|
5587
|
+
const pushType = (raw) => {
|
|
5588
|
+
if (typeof raw !== 'string') {
|
|
5589
|
+
return;
|
|
5590
|
+
}
|
|
5591
|
+
const normalized = raw.trim().toLowerCase();
|
|
5592
|
+
if (normalized && normalized !== 'null' && !collected.includes(normalized)) {
|
|
5593
|
+
collected.push(normalized);
|
|
5594
|
+
}
|
|
5595
|
+
};
|
|
5596
|
+
const pushFrom = (raw) => {
|
|
5597
|
+
if (typeof raw === 'string') {
|
|
5598
|
+
pushType(raw);
|
|
5599
|
+
}
|
|
5600
|
+
else if (Array.isArray(raw)) {
|
|
5601
|
+
for (const item of raw) {
|
|
5602
|
+
pushType(item);
|
|
5603
|
+
}
|
|
5604
|
+
}
|
|
5605
|
+
else if (raw instanceof Set) {
|
|
5606
|
+
for (const item of raw) {
|
|
5607
|
+
pushType(item);
|
|
5608
|
+
}
|
|
5609
|
+
}
|
|
5610
|
+
};
|
|
5611
|
+
pushFrom(node.type);
|
|
5612
|
+
pushFrom(node.types);
|
|
5613
|
+
return collected;
|
|
5614
|
+
}
|
|
5615
|
+
extractUnionVariants(prop, rootSchema) {
|
|
5616
|
+
const resolvedProp = this.resolveSchemaNode(prop, rootSchema);
|
|
5617
|
+
if (!resolvedProp || typeof resolvedProp !== 'object' || Array.isArray(resolvedProp)) {
|
|
5618
|
+
return [];
|
|
5619
|
+
}
|
|
5620
|
+
const rawVariants = [
|
|
5621
|
+
...(Array.isArray(resolvedProp.oneOf) ? resolvedProp.oneOf : []),
|
|
5622
|
+
...(Array.isArray(resolvedProp.anyOf) ? resolvedProp.anyOf : []),
|
|
5623
|
+
];
|
|
5624
|
+
return rawVariants
|
|
5625
|
+
.filter((variant) => variant && typeof variant === 'object' && !Array.isArray(variant))
|
|
5626
|
+
.map((variant) => this.resolveSchemaNode(variant, rootSchema));
|
|
5627
|
+
}
|
|
5628
|
+
isArrayVariant(variant) {
|
|
5629
|
+
return this.extractSchemaNonNullTypes(variant).includes('array');
|
|
5630
|
+
}
|
|
5631
|
+
isObjectVariant(variant) {
|
|
5632
|
+
const types = this.extractSchemaNonNullTypes(variant);
|
|
5633
|
+
return (types.includes('object') ||
|
|
5634
|
+
(types.length === 0 &&
|
|
5635
|
+
!!variant?.properties &&
|
|
5636
|
+
typeof variant.properties === 'object' &&
|
|
5637
|
+
!Array.isArray(variant.properties)));
|
|
5638
|
+
}
|
|
5639
|
+
isCanonicalMonetaryRangeUnion(prop, rootSchema) {
|
|
5640
|
+
const variants = this.extractUnionVariants(prop, rootSchema);
|
|
5641
|
+
if (variants.length === 0) {
|
|
5642
|
+
return false;
|
|
5643
|
+
}
|
|
5644
|
+
const hasArrayBranch = variants.some((variant) => this.isArrayVariant(variant));
|
|
5645
|
+
if (!hasArrayBranch) {
|
|
5646
|
+
return false;
|
|
5647
|
+
}
|
|
5648
|
+
return variants.some((variant) => {
|
|
5649
|
+
if (!this.isObjectVariant(variant)) {
|
|
5650
|
+
return false;
|
|
5651
|
+
}
|
|
5652
|
+
const props = variant?.properties;
|
|
5653
|
+
if (!props || typeof props !== 'object' || Array.isArray(props)) {
|
|
5654
|
+
return false;
|
|
5655
|
+
}
|
|
5656
|
+
return (Object.prototype.hasOwnProperty.call(props, 'minPrice') &&
|
|
5657
|
+
props.minPrice != null &&
|
|
5658
|
+
Object.prototype.hasOwnProperty.call(props, 'maxPrice') &&
|
|
5659
|
+
props.maxPrice != null);
|
|
5660
|
+
});
|
|
5661
|
+
}
|
|
5662
|
+
inferRequireTwoBoundsFromUnion(prop, rootSchema) {
|
|
5663
|
+
const variants = this.extractUnionVariants(prop, rootSchema);
|
|
5664
|
+
if (variants.length === 0) {
|
|
5665
|
+
return false;
|
|
5666
|
+
}
|
|
5667
|
+
const requiredPairs = [
|
|
5668
|
+
['minPrice', 'maxPrice'],
|
|
5669
|
+
['min', 'max'],
|
|
5670
|
+
['startDate', 'endDate'],
|
|
5671
|
+
];
|
|
5672
|
+
for (const variant of variants) {
|
|
5673
|
+
if (this.isArrayVariant(variant) && Number(variant?.minItems) === 2) {
|
|
5674
|
+
return true;
|
|
5675
|
+
}
|
|
5676
|
+
if (this.isObjectVariant(variant) && Array.isArray(variant?.required)) {
|
|
5677
|
+
const requiredSet = new Set(variant.required.filter((entry) => typeof entry === 'string'));
|
|
5678
|
+
if (requiredPairs.some(([lower, upper]) => requiredSet.has(lower) && requiredSet.has(upper))) {
|
|
5679
|
+
return true;
|
|
5680
|
+
}
|
|
5681
|
+
}
|
|
5682
|
+
}
|
|
5683
|
+
return false;
|
|
5684
|
+
}
|
|
5685
|
+
resolveFieldType(prop, ui, rootSchema) {
|
|
5686
|
+
if (this.isCanonicalMonetaryRangeUnion(prop, rootSchema)) {
|
|
5687
|
+
return 'array';
|
|
5688
|
+
}
|
|
4785
5689
|
if (ui?.type !== undefined && ui?.type !== null && String(ui.type).trim() !== '') {
|
|
4786
5690
|
return String(ui.type);
|
|
4787
5691
|
}
|
|
4788
5692
|
if (String(ui?.controlType ?? '').trim() === 'array') {
|
|
4789
5693
|
return 'array';
|
|
4790
5694
|
}
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
5695
|
+
const resolvedProp = this.resolveSchemaNode(prop, rootSchema);
|
|
5696
|
+
const propTypes = this.extractSchemaNonNullTypes(resolvedProp);
|
|
5697
|
+
if (propTypes.length === 1) {
|
|
5698
|
+
return propTypes[0];
|
|
4794
5699
|
}
|
|
4795
|
-
if (
|
|
4796
|
-
return String(
|
|
5700
|
+
if (resolvedProp?.type && !Array.isArray(resolvedProp.type)) {
|
|
5701
|
+
return String(resolvedProp.type);
|
|
4797
5702
|
}
|
|
4798
|
-
const variants =
|
|
4799
|
-
|
|
4800
|
-
...(Array.isArray(prop?.anyOf) ? prop.anyOf : []),
|
|
4801
|
-
].filter((variant) => variant && typeof variant === 'object');
|
|
4802
|
-
const nonNullTypes = Array.from(new Set(variants
|
|
4803
|
-
.map((variant) => (typeof variant.type === 'string' ? variant.type.trim() : ''))
|
|
4804
|
-
.filter((type) => !!type && type !== 'null')));
|
|
5703
|
+
const variants = this.extractUnionVariants(prop, rootSchema);
|
|
5704
|
+
const nonNullTypes = Array.from(new Set(variants.flatMap((variant) => this.extractSchemaNonNullTypes(variant))));
|
|
4805
5705
|
if (nonNullTypes.length === 1) {
|
|
4806
5706
|
return nonNullTypes[0];
|
|
4807
5707
|
}
|
|
@@ -5167,20 +6067,24 @@ function resolveSchemaBooleanFormatFromFieldDefinition(def) {
|
|
|
5167
6067
|
return explicit;
|
|
5168
6068
|
const trueLabel = firstNonEmptyString(def.trueLabel) ??
|
|
5169
6069
|
firstNonEmptyString(def.labelTrue) ??
|
|
6070
|
+
firstNonEmptyString(def.presentation?.labelTrue) ??
|
|
5170
6071
|
firstNonEmptyString(def.extraProperties?.trueLabel) ??
|
|
5171
6072
|
firstNonEmptyString(def.extraProperties?.labelTrue);
|
|
5172
6073
|
const falseLabel = firstNonEmptyString(def.falseLabel) ??
|
|
5173
6074
|
firstNonEmptyString(def.labelFalse) ??
|
|
6075
|
+
firstNonEmptyString(def.presentation?.labelFalse) ??
|
|
5174
6076
|
firstNonEmptyString(def.extraProperties?.falseLabel) ??
|
|
5175
6077
|
firstNonEmptyString(def.extraProperties?.labelFalse);
|
|
5176
|
-
if (trueLabel
|
|
5177
|
-
const
|
|
5178
|
-
const
|
|
6078
|
+
if (trueLabel || falseLabel) {
|
|
6079
|
+
const effectiveTrue = trueLabel || 'Sim';
|
|
6080
|
+
const effectiveFalse = falseLabel || 'Não';
|
|
6081
|
+
const tNorm = normalizePresentationToken(effectiveTrue);
|
|
6082
|
+
const fNorm = normalizePresentationToken(effectiveFalse);
|
|
5179
6083
|
if (tNorm === 'ativo' && fNorm === 'inativo')
|
|
5180
6084
|
return 'active-inactive';
|
|
5181
6085
|
if (tNorm === 'sim' && (fNorm === 'nao' || fNorm === 'não'))
|
|
5182
6086
|
return 'yes-no';
|
|
5183
|
-
return `custom|${
|
|
6087
|
+
return `custom|${effectiveTrue}|${effectiveFalse}`;
|
|
5184
6088
|
}
|
|
5185
6089
|
const name = normalizePresentationToken(def.name);
|
|
5186
6090
|
if (name === 'ativo' || name === 'active' || name.endsWith('ativo')) {
|
|
@@ -5418,7 +6322,29 @@ function resolveRendererFromFieldPresentation(def) {
|
|
|
5418
6322
|
},
|
|
5419
6323
|
};
|
|
5420
6324
|
}
|
|
5421
|
-
if (presenter === '
|
|
6325
|
+
if (presenter === 'progress') {
|
|
6326
|
+
const valueExpr = `= row.${def.name.replace(/\./g, '?.')}`;
|
|
6327
|
+
return {
|
|
6328
|
+
type: 'progress',
|
|
6329
|
+
progress: {
|
|
6330
|
+
valueExpr,
|
|
6331
|
+
showLabel: true,
|
|
6332
|
+
...(color ? { color } : {}),
|
|
6333
|
+
},
|
|
6334
|
+
};
|
|
6335
|
+
}
|
|
6336
|
+
if (presenter === 'rating') {
|
|
6337
|
+
const valueExpr = `= row.${def.name.replace(/\./g, '?.')}`;
|
|
6338
|
+
return {
|
|
6339
|
+
type: 'rating',
|
|
6340
|
+
rating: {
|
|
6341
|
+
valueExpr,
|
|
6342
|
+
max: 5,
|
|
6343
|
+
...(color ? { color } : {}),
|
|
6344
|
+
},
|
|
6345
|
+
};
|
|
6346
|
+
}
|
|
6347
|
+
if (presenter === 'iconvalue' || presenter === 'text' || !presenter) {
|
|
5422
6348
|
const rendererIcon = icon || firstNonEmptyString(def.icon);
|
|
5423
6349
|
const affixes = resolveSemanticPresentationAffixes(presentation);
|
|
5424
6350
|
const hasAffixes = !!(affixes.prefix || affixes.suffix);
|
|
@@ -5430,6 +6356,7 @@ function resolveRendererFromFieldPresentation(def) {
|
|
|
5430
6356
|
icon: {
|
|
5431
6357
|
...(!hasAffixes && rendererIcon ? { name: rendererIcon } : {}),
|
|
5432
6358
|
textField: def.name,
|
|
6359
|
+
...(color ? { color } : {}),
|
|
5433
6360
|
...(tooltipText ? { ariaLabel: tooltipText } : {}),
|
|
5434
6361
|
...affixes,
|
|
5435
6362
|
},
|