@openg2p/registry-widgets 0.1.8 → 0.1.9
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/dist/components/SectionRenderer.d.ts.map +1 -1
- package/dist/components/SectionsContainer.d.ts.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.esm.js +380 -53
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +380 -52
- package/dist/index.js.map +1 -1
- package/dist/registry/defaultWidgets.d.ts.map +1 -1
- package/dist/widgets/HeaderSectionWidget.d.ts +7 -0
- package/dist/widgets/HeaderSectionWidget.d.ts.map +1 -0
- package/dist/widgets/index.d.ts +1 -0
- package/dist/widgets/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionRenderer.d.ts","sourceRoot":"","sources":["../../src/components/SectionRenderer.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAyC,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAM9D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAMlD,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,aAAa,CAAC;IACvB,wBAAwB,CAAC,EAAE,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;IAC5E,UAAU,CAAC,EAAE,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAChD,aAAa,CAAC,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,c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CAAC;IAC1B,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IACpD,UAAU,CAAC,EAAE,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAChD,aAAa,CAAC,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAClE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,wGAAwG;IACxG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAEpE,wHAAwH;IACxH,oBAAoB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrE,0JAA0J;IAC1J,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACpD;AA4ED;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,yMAa/B,sBAAsB,4CAiRxB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1321,6 +1321,11 @@ interface TextAreaWidgetProps {
|
|
|
1321
1321
|
}
|
|
1322
1322
|
declare const TextAreaWidget: ({ config }: TextAreaWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1323
1323
|
|
|
1324
|
+
interface HeaderSectionWidgetProps {
|
|
1325
|
+
config: BaseWidgetConfig;
|
|
1326
|
+
}
|
|
1327
|
+
declare const HeaderSectionWidget: ({ config }: HeaderSectionWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1328
|
+
|
|
1324
1329
|
/**
|
|
1325
1330
|
* Get value from object using dot notation path
|
|
1326
1331
|
* Safely handles nested paths like "person.name" or "address.street.number"
|
|
@@ -1575,5 +1580,5 @@ declare const translatePanelConfig: (panel: PanelConfig, translate: (key: string
|
|
|
1575
1580
|
*/
|
|
1576
1581
|
declare const translateUISchema: (schema: UISchema, translate: (key: string, options?: any) => string) => UISchema;
|
|
1577
1582
|
|
|
1578
|
-
export { ArrayWidget, BooleanWidget, CheckboxWidget, CurrencyInputWidget, DateInputWidget, DateTimeInputWidget, DisplayWidget, FileInputWidget, IterableAccordionWidget, JSONEditorPanel, NumberInputWidget, PanelRenderer, PhoneInputWidget, ProfileWidget, PropertyEditor, RadioWidget, SectionBuilder, SectionRenderer, SectionTree, SectionsContainer, SelectWidget, SimpleTableWidget, TableWidget, TextAreaWidget, TextInputWidget, VisualBuilderPanel, WidgetEventBus, WidgetProvider, WidgetRenderer, applyCaseControl, applyDecimalPrecision, applyMask, createWidgetStore, createZodSchema, evaluateCondition, filterByCharacterType, formatCurrency, formatDate, formatNumber, formatPhone, formatValue, geoHierarchyBuilder, getApiDataSource, getFormattedNumberLength, getSchemaDataSource, getStaticDataSource, getValueByPath, getWidgetValue, initI18n, isAllowedKey, parseDataPath, parseNumber, registerDefaultWidgets, removeMask, resetAll, resetWidget, setDataSource, setError, setLoading, setTouched, setValue, setValueByPath, setValues, setWidgetValue, shouldEnableWidget, shouldShowWidget, transformDataSourceOptions, translatePanelConfig, translateUISchema, translateWidgetConfig, useBaseWidget, useGeoWidgetCascade, useWidgetCascade, useWidgetContext, useWidgetEventBus, useWidgetTranslation, validateNumericValue, validateWidget, widgetRegistry };
|
|
1583
|
+
export { ArrayWidget, BooleanWidget, CheckboxWidget, CurrencyInputWidget, DateInputWidget, DateTimeInputWidget, DisplayWidget, FileInputWidget, HeaderSectionWidget, IterableAccordionWidget, JSONEditorPanel, NumberInputWidget, PanelRenderer, PhoneInputWidget, ProfileWidget, PropertyEditor, RadioWidget, SectionBuilder, SectionRenderer, SectionTree, SectionsContainer, SelectWidget, SimpleTableWidget, TableWidget, TextAreaWidget, TextInputWidget, VisualBuilderPanel, WidgetEventBus, WidgetProvider, WidgetRenderer, applyCaseControl, applyDecimalPrecision, applyMask, createWidgetStore, createZodSchema, evaluateCondition, filterByCharacterType, formatCurrency, formatDate, formatNumber, formatPhone, formatValue, geoHierarchyBuilder, getApiDataSource, getFormattedNumberLength, getSchemaDataSource, getStaticDataSource, getValueByPath, getWidgetValue, initI18n, isAllowedKey, parseDataPath, parseNumber, registerDefaultWidgets, removeMask, resetAll, resetWidget, setDataSource, setError, setLoading, setTouched, setValue, setValueByPath, setValues, setWidgetValue, shouldEnableWidget, shouldShowWidget, transformDataSourceOptions, translatePanelConfig, translateUISchema, translateWidgetConfig, useBaseWidget, useGeoWidgetCascade, useWidgetCascade, useWidgetContext, useWidgetEventBus, useWidgetTranslation, validateNumericValue, validateWidget, widgetRegistry };
|
|
1579
1584
|
export type { ApiAdapter, ApiDataSource, BaseWidgetConfig, BooleanControlType, BooleanRepresentation, CaseControl, CharacterType, ConditionOperator, DataSource, DataSourceRequestHandler, DataSourceType, GeoLevelData, InputMask, NumericType, PanelConfig, RoundingMode, SchemaDataSource, SectionBuilderProps, SectionChanges, SectionConfig, SectionMode, SectionRendererProps, SectionsContainerProps, SectionsFormHandle, StaticDataSource, SupportingDocumentConfig, TextAlign, TreeNode, TreeNodeType, UISchema, UseBaseWidgetOptions, ValidationType, WidgetCascadeConfig, WidgetCondition, WidgetContextValue, WidgetDataPath, WidgetDispatch, WidgetEvent, WidgetEventType, WidgetFormat, WidgetGeoConfig, WidgetOptions, WidgetRegistryEntry, WidgetRenderFunction, WidgetRootState, WidgetState, WidgetStore, WidgetValidation, WidgetValue };
|
package/dist/index.esm.js
CHANGED
|
@@ -3834,8 +3834,6 @@ const SectionRenderer = ({ section, dataSourceRequestHandler: propDataSourceRequ
|
|
|
3834
3834
|
return [];
|
|
3835
3835
|
const snapshot = {};
|
|
3836
3836
|
let hasTable = false;
|
|
3837
|
-
if (!sectionRegisterId)
|
|
3838
|
-
return [];
|
|
3839
3837
|
const resolvePath = (path) => (pathPrefix ? `${pathPrefix}.${path}` : path);
|
|
3840
3838
|
widgets.forEach(widget => {
|
|
3841
3839
|
const widgetPath = widget['widget-data-path'];
|
|
@@ -3865,9 +3863,11 @@ const SectionRenderer = ({ section, dataSourceRequestHandler: propDataSourceRequ
|
|
|
3865
3863
|
: fullPath;
|
|
3866
3864
|
cleanedSnapshot[fieldPath] = value;
|
|
3867
3865
|
});
|
|
3868
|
-
const sectionData =
|
|
3869
|
-
?
|
|
3870
|
-
|
|
3866
|
+
const sectionData = sectionRegisterId
|
|
3867
|
+
? (pathPrefix
|
|
3868
|
+
? getValueByPath(sourceData, resolvePath(sectionRegisterId))
|
|
3869
|
+
: sourceData[sectionRegisterId])
|
|
3870
|
+
: {};
|
|
3871
3871
|
return [
|
|
3872
3872
|
{
|
|
3873
3873
|
...sectionData,
|
|
@@ -4019,7 +4019,7 @@ const SectionRenderer = ({ section, dataSourceRequestHandler: propDataSourceRequ
|
|
|
4019
4019
|
if (JSON.stringify(oldSchemaData) !== JSON.stringify(newSchemaData)) {
|
|
4020
4020
|
try {
|
|
4021
4021
|
const sectionchanges = {
|
|
4022
|
-
section_id: dbSectionId,
|
|
4022
|
+
section_id: dbSectionId ?? originalSection['section-id'],
|
|
4023
4023
|
section_register_id: sectionRegisterId,
|
|
4024
4024
|
records: [...newSchemaData],
|
|
4025
4025
|
files: [...sectionFiles]
|
|
@@ -4034,49 +4034,52 @@ const SectionRenderer = ({ section, dataSourceRequestHandler: propDataSourceRequ
|
|
|
4034
4034
|
};
|
|
4035
4035
|
// IntakeForm: save section then collapse current and expand next (or stay on final section)
|
|
4036
4036
|
const handleIntakeFormSave = useCallback(async () => {
|
|
4037
|
-
if (
|
|
4038
|
-
return;
|
|
4039
|
-
const sectionWidgets = collectWidgets(originalSection.panels);
|
|
4040
|
-
const currentState = store.getState().widget;
|
|
4041
|
-
const currentSchemaData = currentState.values || {};
|
|
4042
|
-
const isSectionValid = sectionValidate(originalSection, currentSchemaData, dispatch);
|
|
4043
|
-
if (!isSectionValid)
|
|
4037
|
+
if (sectionIndex === undefined)
|
|
4044
4038
|
return;
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
const
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
files: [...sectionFiles],
|
|
4039
|
+
// Only run save/validation logic when in draft mode and handlers are available
|
|
4040
|
+
if (isDraft !== false && store && onSectionSave) {
|
|
4041
|
+
const sectionWidgets = collectWidgets(originalSection.panels);
|
|
4042
|
+
const currentState = store.getState().widget;
|
|
4043
|
+
const currentSchemaData = currentState.values || {};
|
|
4044
|
+
const isSectionValid = sectionValidate(originalSection, currentSchemaData, dispatch);
|
|
4045
|
+
if (!isSectionValid)
|
|
4046
|
+
return;
|
|
4047
|
+
const oldSchemaData = schemaData || contextSchemaData;
|
|
4048
|
+
const newSchemaData = trackSectionChages(sectionWidgets, currentSchemaData, namespace);
|
|
4049
|
+
const sectionFiles = [];
|
|
4050
|
+
if (hasSupportingDocuments) {
|
|
4051
|
+
const originalSupportingDocuments = originalSection['section-supporting-documents'] || [];
|
|
4052
|
+
originalSupportingDocuments.forEach((doc) => {
|
|
4053
|
+
const originalDataPath = doc['document-data-path'];
|
|
4054
|
+
const storeDataPath = namespace && originalDataPath
|
|
4055
|
+
? `${namespace}.${originalDataPath}`
|
|
4056
|
+
: originalDataPath;
|
|
4057
|
+
sectionFiles.push(getValueByPath(currentSchemaData, storeDataPath));
|
|
4065
4058
|
});
|
|
4066
4059
|
}
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4060
|
+
if (JSON.stringify(oldSchemaData) !== JSON.stringify(newSchemaData)) {
|
|
4061
|
+
try {
|
|
4062
|
+
await onSectionSave({
|
|
4063
|
+
section_id: dbSectionId ?? originalSection['section-id'],
|
|
4064
|
+
section_register_id: sectionRegisterId,
|
|
4065
|
+
records: [...newSchemaData],
|
|
4066
|
+
files: [...sectionFiles],
|
|
4067
|
+
});
|
|
4068
|
+
}
|
|
4069
|
+
catch (error) {
|
|
4070
|
+
console.error('Section Changes Save failed', error);
|
|
4071
|
+
return;
|
|
4072
|
+
}
|
|
4070
4073
|
}
|
|
4074
|
+
if (mode === 'IntakeForm') {
|
|
4075
|
+
baselineSnapshotRef.current = buildSectionSnapshot(currentSchemaData, namespace);
|
|
4076
|
+
setIntakeFormBaselineTrigger((prev) => prev + 1);
|
|
4077
|
+
}
|
|
4078
|
+
onSectionDirtyChange?.(sectionId, false);
|
|
4071
4079
|
}
|
|
4072
|
-
//
|
|
4073
|
-
if (mode === 'IntakeForm') {
|
|
4074
|
-
baselineSnapshotRef.current = buildSectionSnapshot(currentSchemaData, namespace);
|
|
4075
|
-
setIntakeFormBaselineTrigger((prev) => prev + 1);
|
|
4076
|
-
}
|
|
4077
|
-
onSectionDirtyChange?.(sectionId, false);
|
|
4080
|
+
// Always navigate to the next section
|
|
4078
4081
|
onSectionSaveSuccess?.(sectionIndex);
|
|
4079
|
-
}, [store, onSectionSave, onSectionSaveSuccess, sectionIndex, originalSection, schemaData, contextSchemaData, namespace, hasSupportingDocuments, dbSectionId, sectionRegisterId, dispatch, buildSectionSnapshot, sectionId, onSectionDirtyChange, mode]);
|
|
4082
|
+
}, [store, onSectionSave, onSectionSaveSuccess, sectionIndex, originalSection, schemaData, contextSchemaData, namespace, hasSupportingDocuments, dbSectionId, sectionRegisterId, dispatch, buildSectionSnapshot, sectionId, onSectionDirtyChange, mode, isDraft]);
|
|
4080
4083
|
// Handle cancel button click
|
|
4081
4084
|
const handleCancel = () => {
|
|
4082
4085
|
// Revert values in store to original schema data
|
|
@@ -4397,7 +4400,7 @@ const SectionRenderer = ({ section, dataSourceRequestHandler: propDataSourceRequ
|
|
|
4397
4400
|
gap: '12px',
|
|
4398
4401
|
marginBottom: '20px',
|
|
4399
4402
|
width: '100%',
|
|
4400
|
-
}, children: [jsxRuntimeExports.jsxs("button", { type: "button", onClick: () => onPreviousSection?.(sectionIndex),
|
|
4403
|
+
}, children: [typeof sectionIndex === 'number' && sectionIndex > 0 && (jsxRuntimeExports.jsxs("button", { type: "button", onClick: () => onPreviousSection?.(sectionIndex), className: "intake-form-prev-btn", style: {
|
|
4401
4404
|
fontFamily: 'Roboto, sans-serif',
|
|
4402
4405
|
fontSize: '14px',
|
|
4403
4406
|
fontWeight: 400,
|
|
@@ -4405,25 +4408,25 @@ const SectionRenderer = ({ section, dataSourceRequestHandler: propDataSourceRequ
|
|
|
4405
4408
|
borderRadius: '10px',
|
|
4406
4409
|
border: '1px solid #FD8C3E',
|
|
4407
4410
|
background: '#F3F4F6',
|
|
4408
|
-
color:
|
|
4409
|
-
cursor:
|
|
4411
|
+
color: 'rgba(0, 0, 0, 0.5)',
|
|
4412
|
+
cursor: 'pointer',
|
|
4410
4413
|
display: 'inline-flex',
|
|
4411
4414
|
alignItems: 'center',
|
|
4412
4415
|
gap: '8px',
|
|
4413
|
-
}, children: [jsxRuntimeExports.jsx("img", { src: img$5, alt: "", "aria-hidden": true, style: { width: '14px', height: '14px', opacity:
|
|
4416
|
+
}, children: [jsxRuntimeExports.jsx("img", { src: img$5, alt: "", "aria-hidden": true, style: { width: '14px', height: '14px', opacity: 0.5 } }), translate('common.previous') || 'Prev'] })), jsxRuntimeExports.jsxs("button", { type: "button", onClick: handleIntakeFormSave, className: "intake-form-save-btn", style: {
|
|
4414
4417
|
fontFamily: 'Roboto, sans-serif',
|
|
4415
4418
|
fontSize: '14px',
|
|
4416
4419
|
fontWeight: 400,
|
|
4417
4420
|
padding: '8px 24px',
|
|
4418
4421
|
borderRadius: '10px',
|
|
4419
4422
|
border: '1px solid #FD8C3E',
|
|
4420
|
-
background:
|
|
4421
|
-
color:
|
|
4422
|
-
cursor:
|
|
4423
|
+
background: '#F3F4F6',
|
|
4424
|
+
color: 'rgba(0, 0, 0, 0.5)',
|
|
4425
|
+
cursor: 'pointer',
|
|
4423
4426
|
display: 'inline-flex',
|
|
4424
4427
|
alignItems: 'center',
|
|
4425
4428
|
gap: '8px',
|
|
4426
|
-
}, children: [translate('common.
|
|
4429
|
+
}, children: [translate('common.next') || 'Next', jsxRuntimeExports.jsx("img", { src: img$4, alt: "", "aria-hidden": true, style: { width: '14px', height: '14px' } })] })] })] }) }))] })) : (
|
|
4427
4430
|
/* RegistryView / CRView: standard layout */
|
|
4428
4431
|
jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [sectionToRender['section-title'] && (jsxRuntimeExports.jsxs("div", { style: {
|
|
4429
4432
|
marginTop: '35px',
|
|
@@ -4680,7 +4683,9 @@ const SectionsContainer = ({ sections, dataSourceRequestHandler: propDataSourceR
|
|
|
4680
4683
|
if (index + 1 < safeSections.length) {
|
|
4681
4684
|
setExpandedSectionIndex(index + 1);
|
|
4682
4685
|
}
|
|
4683
|
-
|
|
4686
|
+
else {
|
|
4687
|
+
setExpandedSectionIndex(null);
|
|
4688
|
+
}
|
|
4684
4689
|
}, [safeSections.length]);
|
|
4685
4690
|
// IntakeForm mode: called when Previous clicked - collapse current, expand previous
|
|
4686
4691
|
const handlePreviousSection = useCallback((index) => {
|
|
@@ -8882,6 +8887,326 @@ const TextAreaWidget = ({ config }) => {
|
|
|
8882
8887
|
}, children: charCounterText }))] }), hasError && (jsxRuntimeExports.jsx("p", { className: "text-red-500 text-sm mt-1", children: errorMessage }))] })] }) }));
|
|
8883
8888
|
};
|
|
8884
8889
|
|
|
8890
|
+
const DEFAULT_STATUS_COLORS = {
|
|
8891
|
+
active: '#16A34A',
|
|
8892
|
+
inactive: '#D97706',
|
|
8893
|
+
archived: '#6B7280',
|
|
8894
|
+
};
|
|
8895
|
+
// ── Hook: load data-source options for a single field ────────────
|
|
8896
|
+
// Options are loaded in both view and edit modes because view mode
|
|
8897
|
+
// needs them to resolve display labels (e.g. "active" → "Active").
|
|
8898
|
+
// For API data sources, loading is deferred to edit mode to avoid
|
|
8899
|
+
// unnecessary network calls when only labels are needed.
|
|
8900
|
+
function useFieldDataSource(fieldKey, fieldConfig, isReadonly) {
|
|
8901
|
+
const [options, setOptions] = useState([]);
|
|
8902
|
+
const { dataSourceRequestHandler, schemaData } = useWidgetContext();
|
|
8903
|
+
const values = useSelector((state) => state.widget.values);
|
|
8904
|
+
const dataSource = fieldConfig?.['data-source'];
|
|
8905
|
+
const dsType = dataSource?.type;
|
|
8906
|
+
const dsKey = dataSource
|
|
8907
|
+
? `${fieldKey}-${dsType}-${JSON.stringify(dataSource)}`
|
|
8908
|
+
: '';
|
|
8909
|
+
useEffect(() => {
|
|
8910
|
+
if (!dataSource) {
|
|
8911
|
+
setOptions([]);
|
|
8912
|
+
return;
|
|
8913
|
+
}
|
|
8914
|
+
// API sources: only fetch when editable to avoid unnecessary calls
|
|
8915
|
+
if (dataSource.type === 'api' && isReadonly) {
|
|
8916
|
+
return;
|
|
8917
|
+
}
|
|
8918
|
+
let cancelled = false;
|
|
8919
|
+
const load = async () => {
|
|
8920
|
+
try {
|
|
8921
|
+
let raw = [];
|
|
8922
|
+
if (dataSource.type === 'static') {
|
|
8923
|
+
raw = getStaticDataSource(dataSource);
|
|
8924
|
+
}
|
|
8925
|
+
else if (dataSource.type === 'api') {
|
|
8926
|
+
if (!dataSourceRequestHandler)
|
|
8927
|
+
return;
|
|
8928
|
+
raw = await getApiDataSource(dataSource, values, dataSourceRequestHandler);
|
|
8929
|
+
}
|
|
8930
|
+
else if (dataSource.type === 'schema') {
|
|
8931
|
+
raw = getSchemaDataSource(dataSource, schemaData || {});
|
|
8932
|
+
}
|
|
8933
|
+
const transformed = transformDataSourceOptions(raw, dataSource.valueKey, dataSource.labelKey);
|
|
8934
|
+
if (!cancelled)
|
|
8935
|
+
setOptions(transformed);
|
|
8936
|
+
}
|
|
8937
|
+
catch (err) {
|
|
8938
|
+
console.error(`[HeaderSectionWidget] Error loading data-source for field "${fieldKey}":`, err);
|
|
8939
|
+
if (!cancelled)
|
|
8940
|
+
setOptions([]);
|
|
8941
|
+
}
|
|
8942
|
+
};
|
|
8943
|
+
load();
|
|
8944
|
+
return () => { cancelled = true; };
|
|
8945
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8946
|
+
}, [dsKey, isReadonly, dataSourceRequestHandler]);
|
|
8947
|
+
return options;
|
|
8948
|
+
}
|
|
8949
|
+
// ── Main component ───────────────────────────────────────────────
|
|
8950
|
+
const HeaderSectionWidget = ({ config }) => {
|
|
8951
|
+
const { config: widgetConfig, getFieldValue, } = useBaseWidget({ config });
|
|
8952
|
+
const dispatch = useDispatch();
|
|
8953
|
+
const { translateConfig } = useWidgetTranslation();
|
|
8954
|
+
const { schemaData } = useWidgetContext();
|
|
8955
|
+
const values = useSelector((state) => state.widget.values);
|
|
8956
|
+
const isReadonly = widgetConfig['widget-readonly'] !== false;
|
|
8957
|
+
const dataPath = widgetConfig['widget-data-path'];
|
|
8958
|
+
// ── Per-field config map ──────────────────────────────────────
|
|
8959
|
+
const fieldConfigMap = useMemo(() => {
|
|
8960
|
+
return widgetConfig['widget-field-config'] || {};
|
|
8961
|
+
}, [widgetConfig['widget-field-config']]);
|
|
8962
|
+
// ── Load data source options for the status field ─────────────
|
|
8963
|
+
const statusOptions = useFieldDataSource('status', fieldConfigMap['status'], isReadonly);
|
|
8964
|
+
// ── Resolve field values ──────────────────────────────────────
|
|
8965
|
+
const paths = useMemo(() => {
|
|
8966
|
+
if (!dataPath || typeof dataPath !== 'object')
|
|
8967
|
+
return {};
|
|
8968
|
+
return dataPath;
|
|
8969
|
+
}, [dataPath]);
|
|
8970
|
+
const findValue = useCallback((fieldKey) => {
|
|
8971
|
+
const path = paths[fieldKey];
|
|
8972
|
+
if (!path)
|
|
8973
|
+
return undefined;
|
|
8974
|
+
const searchIn = (source) => {
|
|
8975
|
+
if (!source)
|
|
8976
|
+
return undefined;
|
|
8977
|
+
let v = getValueByPath(source, path);
|
|
8978
|
+
if (v !== undefined)
|
|
8979
|
+
return v;
|
|
8980
|
+
for (const obj of Object.values(source)) {
|
|
8981
|
+
if (obj && typeof obj === 'object' && !Array.isArray(obj)) {
|
|
8982
|
+
v = getValueByPath(obj, path);
|
|
8983
|
+
if (v !== undefined)
|
|
8984
|
+
return v;
|
|
8985
|
+
}
|
|
8986
|
+
}
|
|
8987
|
+
return undefined;
|
|
8988
|
+
};
|
|
8989
|
+
let result = searchIn(values);
|
|
8990
|
+
if (result === undefined)
|
|
8991
|
+
result = searchIn(schemaData);
|
|
8992
|
+
return result;
|
|
8993
|
+
}, [paths, values, schemaData]);
|
|
8994
|
+
const imageUrl = findValue('image') || null;
|
|
8995
|
+
const displayName = findValue('name') || '';
|
|
8996
|
+
const functionalId = findValue('functionalId') || '';
|
|
8997
|
+
const statusValue = findValue('status') || '';
|
|
8998
|
+
const statusReason = findValue('statusReason') || '';
|
|
8999
|
+
const createdBy = findValue('createdBy') || '';
|
|
9000
|
+
const createdAt = findValue('createdAt') || '';
|
|
9001
|
+
const lastApprovedBy = findValue('lastApprovedBy') || '';
|
|
9002
|
+
const lastApprovedAt = findValue('lastApprovedAt') || '';
|
|
9003
|
+
// ── Format options ────────────────────────────────────────────
|
|
9004
|
+
const format = (widgetConfig['widget-data-format'] || {});
|
|
9005
|
+
const imageSize = format.imageSize || 90;
|
|
9006
|
+
const nameColor = format.nameColor || '#ED7C22';
|
|
9007
|
+
const statusColors = {
|
|
9008
|
+
...DEFAULT_STATUS_COLORS,
|
|
9009
|
+
...(format.statusColors || {}),
|
|
9010
|
+
};
|
|
9011
|
+
// ── Value change helpers ──────────────────────────────────────
|
|
9012
|
+
const updateFieldValue = useCallback((fieldKey, newValue) => {
|
|
9013
|
+
const path = paths[fieldKey];
|
|
9014
|
+
if (!path)
|
|
9015
|
+
return;
|
|
9016
|
+
const updated = setValueByPath({ ...values }, path, newValue);
|
|
9017
|
+
dispatch(setValues(updated));
|
|
9018
|
+
}, [paths, values, dispatch]);
|
|
9019
|
+
// ── Status helpers ────────────────────────────────────────────
|
|
9020
|
+
const statusLabel = useMemo(() => {
|
|
9021
|
+
if (!statusValue)
|
|
9022
|
+
return '';
|
|
9023
|
+
const opt = statusOptions.find((o) => String(o.value).toLowerCase() === String(statusValue).toLowerCase());
|
|
9024
|
+
return opt ? opt.label : String(statusValue);
|
|
9025
|
+
}, [statusValue, statusOptions]);
|
|
9026
|
+
const statusColor = statusColors[String(statusValue).toLowerCase()] || '#6B7280';
|
|
9027
|
+
// ── Scoped class for CSS isolation ────────────────────────────
|
|
9028
|
+
const cls = `header-section-widget-${widgetConfig['widget-id']}`;
|
|
9029
|
+
// ── Indicator dot component ───────────────────────────────────
|
|
9030
|
+
const Dot = ({ color }) => (jsxRuntimeExports.jsx("span", { style: {
|
|
9031
|
+
display: 'inline-block',
|
|
9032
|
+
width: 8,
|
|
9033
|
+
height: 8,
|
|
9034
|
+
borderRadius: '50%',
|
|
9035
|
+
backgroundColor: color,
|
|
9036
|
+
flexShrink: 0,
|
|
9037
|
+
marginTop: 6,
|
|
9038
|
+
} }));
|
|
9039
|
+
// ── RENDER ────────────────────────────────────────────────────
|
|
9040
|
+
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("style", { children: `
|
|
9041
|
+
.${cls} {
|
|
9042
|
+
display: flex;
|
|
9043
|
+
flex-direction: row;
|
|
9044
|
+
gap: 1.5rem;
|
|
9045
|
+
width: 100%;
|
|
9046
|
+
font-family: Roboto, sans-serif;
|
|
9047
|
+
padding: 35px 0 16px 0;
|
|
9048
|
+
}
|
|
9049
|
+
|
|
9050
|
+
.${cls} .hdr-left {
|
|
9051
|
+
display: flex;
|
|
9052
|
+
flex-direction: row;
|
|
9053
|
+
align-items: flex-start;
|
|
9054
|
+
gap: 1rem;
|
|
9055
|
+
flex: 1 1 55%;
|
|
9056
|
+
min-width: 0;
|
|
9057
|
+
}
|
|
9058
|
+
|
|
9059
|
+
.${cls} .hdr-right {
|
|
9060
|
+
display: flex;
|
|
9061
|
+
flex-direction: column;
|
|
9062
|
+
gap: 0.5rem;
|
|
9063
|
+
flex: 0 0 auto;
|
|
9064
|
+
min-width: 220px;
|
|
9065
|
+
}
|
|
9066
|
+
|
|
9067
|
+
.${cls} .hdr-avatar {
|
|
9068
|
+
width: ${imageSize}px;
|
|
9069
|
+
height: ${imageSize}px;
|
|
9070
|
+
border-radius: 8px;
|
|
9071
|
+
object-fit: cover;
|
|
9072
|
+
background-color: #e5e7eb;
|
|
9073
|
+
border: 2px solid #d1d5db;
|
|
9074
|
+
flex-shrink: 0;
|
|
9075
|
+
}
|
|
9076
|
+
|
|
9077
|
+
.${cls} .hdr-avatar-placeholder {
|
|
9078
|
+
width: ${imageSize}px;
|
|
9079
|
+
height: ${imageSize}px;
|
|
9080
|
+
border-radius: 8px;
|
|
9081
|
+
background-color: #e5e7eb;
|
|
9082
|
+
border: 2px solid #d1d5db;
|
|
9083
|
+
display: flex;
|
|
9084
|
+
align-items: center;
|
|
9085
|
+
justify-content: center;
|
|
9086
|
+
flex-shrink: 0;
|
|
9087
|
+
overflow: hidden;
|
|
9088
|
+
}
|
|
9089
|
+
|
|
9090
|
+
.${cls} .hdr-avatar-placeholder img {
|
|
9091
|
+
width: 100%;
|
|
9092
|
+
height: 100%;
|
|
9093
|
+
object-fit: cover;
|
|
9094
|
+
border-radius: 8px;
|
|
9095
|
+
}
|
|
9096
|
+
|
|
9097
|
+
.${cls} .hdr-info {
|
|
9098
|
+
display: flex;
|
|
9099
|
+
flex-direction: column;
|
|
9100
|
+
gap: 0.35rem;
|
|
9101
|
+
min-width: 0;
|
|
9102
|
+
flex: 1;
|
|
9103
|
+
}
|
|
9104
|
+
|
|
9105
|
+
.${cls} .hdr-name {
|
|
9106
|
+
font-size: 1.25rem;
|
|
9107
|
+
font-weight: 600;
|
|
9108
|
+
color: ${nameColor};
|
|
9109
|
+
line-height: 1.4;
|
|
9110
|
+
word-wrap: break-word;
|
|
9111
|
+
}
|
|
9112
|
+
|
|
9113
|
+
.${cls} .hdr-field-row {
|
|
9114
|
+
display: flex;
|
|
9115
|
+
align-items: flex-start;
|
|
9116
|
+
gap: 0.5rem;
|
|
9117
|
+
font-size: 0.875rem;
|
|
9118
|
+
line-height: 1.6;
|
|
9119
|
+
}
|
|
9120
|
+
|
|
9121
|
+
.${cls} .hdr-field-label {
|
|
9122
|
+
color: #6b7280;
|
|
9123
|
+
font-weight: 500;
|
|
9124
|
+
white-space: nowrap;
|
|
9125
|
+
}
|
|
9126
|
+
|
|
9127
|
+
.${cls} .hdr-field-value {
|
|
9128
|
+
color: #111827;
|
|
9129
|
+
font-weight: 600;
|
|
9130
|
+
}
|
|
9131
|
+
|
|
9132
|
+
.${cls} .hdr-status-badge {
|
|
9133
|
+
display: inline-block;
|
|
9134
|
+
padding: 2px 12px;
|
|
9135
|
+
border-radius: 4px;
|
|
9136
|
+
font-size: 0.75rem;
|
|
9137
|
+
font-weight: 600;
|
|
9138
|
+
color: #fff;
|
|
9139
|
+
}
|
|
9140
|
+
|
|
9141
|
+
.${cls} .hdr-meta-row {
|
|
9142
|
+
display: flex;
|
|
9143
|
+
align-items: baseline;
|
|
9144
|
+
gap: 0.35rem;
|
|
9145
|
+
font-size: 0.875rem;
|
|
9146
|
+
line-height: 1.6;
|
|
9147
|
+
}
|
|
9148
|
+
|
|
9149
|
+
.${cls} .hdr-meta-label {
|
|
9150
|
+
color: #6b7280;
|
|
9151
|
+
font-weight: 400;
|
|
9152
|
+
}
|
|
9153
|
+
|
|
9154
|
+
.${cls} .hdr-meta-value {
|
|
9155
|
+
color: #111827;
|
|
9156
|
+
font-weight: 600;
|
|
9157
|
+
}
|
|
9158
|
+
|
|
9159
|
+
.${cls} .hdr-select {
|
|
9160
|
+
height: 32px;
|
|
9161
|
+
padding: 0 8px;
|
|
9162
|
+
border: 1px solid #d1d5db;
|
|
9163
|
+
border-radius: 6px;
|
|
9164
|
+
font-size: 0.875rem;
|
|
9165
|
+
font-family: Roboto, sans-serif;
|
|
9166
|
+
background: #fff;
|
|
9167
|
+
min-width: 140px;
|
|
9168
|
+
color: #374151;
|
|
9169
|
+
}
|
|
9170
|
+
.${cls} .hdr-select:focus {
|
|
9171
|
+
outline: none;
|
|
9172
|
+
border-color: #ED7C22;
|
|
9173
|
+
box-shadow: 0 0 0 2px rgba(237, 124, 34, 0.15);
|
|
9174
|
+
}
|
|
9175
|
+
|
|
9176
|
+
.${cls} .hdr-input {
|
|
9177
|
+
height: 32px;
|
|
9178
|
+
padding: 0 8px;
|
|
9179
|
+
border: 1px solid #d1d5db;
|
|
9180
|
+
border-radius: 6px;
|
|
9181
|
+
font-size: 0.875rem;
|
|
9182
|
+
font-family: Roboto, sans-serif;
|
|
9183
|
+
background: #fff;
|
|
9184
|
+
min-width: 140px;
|
|
9185
|
+
color: #374151;
|
|
9186
|
+
}
|
|
9187
|
+
.${cls} .hdr-input:focus {
|
|
9188
|
+
outline: none;
|
|
9189
|
+
border-color: #ED7C22;
|
|
9190
|
+
box-shadow: 0 0 0 2px rgba(237, 124, 34, 0.15);
|
|
9191
|
+
}
|
|
9192
|
+
|
|
9193
|
+
@media (max-width: 768px) {
|
|
9194
|
+
.${cls} {
|
|
9195
|
+
flex-direction: column;
|
|
9196
|
+
}
|
|
9197
|
+
.${cls} .hdr-right {
|
|
9198
|
+
min-width: 0;
|
|
9199
|
+
}
|
|
9200
|
+
}
|
|
9201
|
+
` }), jsxRuntimeExports.jsxs("div", { className: cls, children: [jsxRuntimeExports.jsxs("div", { className: "hdr-left", children: [jsxRuntimeExports.jsxs("div", { children: [imageUrl ? (jsxRuntimeExports.jsx("img", { src: imageUrl, alt: displayName || 'Profile', className: "hdr-avatar", onError: (e) => {
|
|
9202
|
+
e.target.style.display = 'none';
|
|
9203
|
+
const placeholder = e.target
|
|
9204
|
+
.parentElement?.querySelector('.hdr-avatar-placeholder');
|
|
9205
|
+
if (placeholder)
|
|
9206
|
+
placeholder.style.display = 'flex';
|
|
9207
|
+
} })) : null, jsxRuntimeExports.jsx("div", { className: "hdr-avatar-placeholder", style: { display: imageUrl ? 'none' : 'flex' }, children: jsxRuntimeExports.jsx("img", { src: img$f, alt: "Profile Placeholder" }) })] }), jsxRuntimeExports.jsxs("div", { className: "hdr-info", children: [displayName && jsxRuntimeExports.jsx("div", { className: "hdr-name", children: displayName }), jsxRuntimeExports.jsxs("div", { className: "hdr-field-row", children: [jsxRuntimeExports.jsx(Dot, { color: "#9CA3AF" }), jsxRuntimeExports.jsxs("span", { className: "hdr-field-label", children: [translateConfig('Functional Record ID') || 'Functional Record ID', " :"] }), jsxRuntimeExports.jsx("span", { className: "hdr-field-value", children: functionalId || '-' })] }), jsxRuntimeExports.jsxs("div", { className: "hdr-field-row", children: [jsxRuntimeExports.jsx(Dot, { color: isReadonly ? statusColor : '#F59E0B' }), jsxRuntimeExports.jsx("span", { className: "hdr-field-label", children: translateConfig('Record Status') || 'Record Status' }), isReadonly ? (statusLabel ? (jsxRuntimeExports.jsx("span", { className: "hdr-status-badge", style: { backgroundColor: statusColor }, children: statusLabel })) : (jsxRuntimeExports.jsx("span", { className: "hdr-field-value", children: "-" }))) : (jsxRuntimeExports.jsxs("select", { className: "hdr-select", value: statusValue, onChange: (e) => updateFieldValue('status', e.target.value), children: [jsxRuntimeExports.jsx("option", { value: "", children: translateConfig('Select') || 'Select' }), statusOptions.map((opt) => (jsxRuntimeExports.jsx("option", { value: opt.value, children: opt.label }, opt.value)))] }))] }), jsxRuntimeExports.jsxs("div", { className: "hdr-field-row", children: [jsxRuntimeExports.jsx(Dot, { color: isReadonly ? '#9CA3AF' : '#F59E0B' }), jsxRuntimeExports.jsxs("span", { className: "hdr-field-label", children: [translateConfig('Status Reason') || 'Status Reason', " :"] }), isReadonly ? (jsxRuntimeExports.jsx("span", { className: "hdr-field-value", children: statusReason || '-' })) : (jsxRuntimeExports.jsx("input", { type: "text", className: "hdr-input", value: statusReason, placeholder: translateConfig('Enter Reason') || 'Enter Reason', onChange: (e) => updateFieldValue('statusReason', e.target.value) }))] })] })] }), jsxRuntimeExports.jsxs("div", { className: "hdr-right", children: [jsxRuntimeExports.jsxs("div", { className: "hdr-meta-row", children: [jsxRuntimeExports.jsxs("span", { className: "hdr-meta-label", children: [translateConfig('Created by') || 'Created by', " :"] }), jsxRuntimeExports.jsx("span", { className: "hdr-meta-value", children: createdBy || '-' })] }), jsxRuntimeExports.jsxs("div", { className: "hdr-meta-row", children: [jsxRuntimeExports.jsxs("span", { className: "hdr-meta-label", children: [translateConfig('Created at') || 'Created at', " :"] }), jsxRuntimeExports.jsx("span", { className: "hdr-meta-value", children: createdAt || '-' })] }), jsxRuntimeExports.jsxs("div", { className: "hdr-meta-row", children: [jsxRuntimeExports.jsxs("span", { className: "hdr-meta-label", children: [translateConfig('Last Approved by') || 'Last Approved by', " :"] }), jsxRuntimeExports.jsx("span", { className: "hdr-meta-value", children: lastApprovedBy || '-' })] }), jsxRuntimeExports.jsxs("div", { className: "hdr-meta-row", children: [jsxRuntimeExports.jsxs("span", { className: "hdr-meta-label", children: [translateConfig('Last Approved at') || 'Last Approved at', " :"] }), jsxRuntimeExports.jsx("span", { className: "hdr-meta-value", children: lastApprovedAt || '-' })] })] })] })] }));
|
|
9208
|
+
};
|
|
9209
|
+
|
|
8885
9210
|
/**
|
|
8886
9211
|
* Register all default/generic widgets
|
|
8887
9212
|
* This is called automatically when the package is imported
|
|
@@ -8921,6 +9246,8 @@ const registerDefaultWidgets = () => {
|
|
|
8921
9246
|
widgetRegistry.register({ widget: 'display', component: DisplayWidget });
|
|
8922
9247
|
// Profile widget for displaying user identity (image, name, ID)
|
|
8923
9248
|
widgetRegistry.register({ widget: 'profile', component: ProfileWidget });
|
|
9249
|
+
// Header section widget for full-width registry header with profile, status, and metadata
|
|
9250
|
+
widgetRegistry.register({ widget: 'header-section', component: HeaderSectionWidget });
|
|
8924
9251
|
};
|
|
8925
9252
|
// Auto-register on import
|
|
8926
9253
|
registerDefaultWidgets();
|
|
@@ -9277,5 +9604,5 @@ const translateUISchema = (schema, translate) => {
|
|
|
9277
9604
|
};
|
|
9278
9605
|
};
|
|
9279
9606
|
|
|
9280
|
-
export { ArrayWidget, BooleanWidget, CheckboxWidget, CurrencyInputWidget, DateInputWidget, DateTimeInputWidget, DisplayWidget, FileInputWidget, IterableAccordionWidget, JSONEditorPanel, NumberInputWidget, PanelRenderer, PhoneInputWidget, ProfileWidget, PropertyEditor, RadioWidget, SectionBuilder, SectionRenderer, SectionTree, SectionsContainer, SelectWidget, SimpleTableWidget, TableWidget, TextAreaWidget, TextInputWidget, VisualBuilderPanel, WidgetEventBus, WidgetProvider, WidgetRenderer, applyCaseControl, applyDecimalPrecision, applyMask, createWidgetStore, createZodSchema, evaluateCondition, filterByCharacterType, formatCurrency, formatDate, formatNumber, formatPhone, formatValue, geoHierarchyBuilder, getApiDataSource, getFormattedNumberLength, getSchemaDataSource, getStaticDataSource, getValueByPath, getWidgetValue, initI18n, isAllowedKey, parseDataPath, parseNumber, registerDefaultWidgets, removeMask, resetAll, resetWidget, setDataSource, setError, setLoading, setTouched, setValue, setValueByPath, setValues, setWidgetValue, shouldEnableWidget, shouldShowWidget, transformDataSourceOptions, translatePanelConfig, translateUISchema, translateWidgetConfig, useBaseWidget, useGeoWidgetCascade, useWidgetCascade, useWidgetContext, useWidgetEventBus, useWidgetTranslation, validateNumericValue, validateWidget, widgetRegistry };
|
|
9607
|
+
export { ArrayWidget, BooleanWidget, CheckboxWidget, CurrencyInputWidget, DateInputWidget, DateTimeInputWidget, DisplayWidget, FileInputWidget, HeaderSectionWidget, IterableAccordionWidget, JSONEditorPanel, NumberInputWidget, PanelRenderer, PhoneInputWidget, ProfileWidget, PropertyEditor, RadioWidget, SectionBuilder, SectionRenderer, SectionTree, SectionsContainer, SelectWidget, SimpleTableWidget, TableWidget, TextAreaWidget, TextInputWidget, VisualBuilderPanel, WidgetEventBus, WidgetProvider, WidgetRenderer, applyCaseControl, applyDecimalPrecision, applyMask, createWidgetStore, createZodSchema, evaluateCondition, filterByCharacterType, formatCurrency, formatDate, formatNumber, formatPhone, formatValue, geoHierarchyBuilder, getApiDataSource, getFormattedNumberLength, getSchemaDataSource, getStaticDataSource, getValueByPath, getWidgetValue, initI18n, isAllowedKey, parseDataPath, parseNumber, registerDefaultWidgets, removeMask, resetAll, resetWidget, setDataSource, setError, setLoading, setTouched, setValue, setValueByPath, setValues, setWidgetValue, shouldEnableWidget, shouldShowWidget, transformDataSourceOptions, translatePanelConfig, translateUISchema, translateWidgetConfig, useBaseWidget, useGeoWidgetCascade, useWidgetCascade, useWidgetContext, useWidgetEventBus, useWidgetTranslation, validateNumericValue, validateWidget, widgetRegistry };
|
|
9281
9608
|
//# sourceMappingURL=index.esm.js.map
|