commons-shared-web-ui 0.0.78 → 0.0.79
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.
|
@@ -6067,7 +6067,12 @@ class SmartFormComponent {
|
|
|
6067
6067
|
const payloadPath = cfg.payloadPrefix ? `${cfg.payloadPrefix}.${payloadField}` : payloadField;
|
|
6068
6068
|
const apiUrl = (cfg.dataApiUrl || '')
|
|
6069
6069
|
.replace(/\{classCode\}/g, encodeURIComponent(code))
|
|
6070
|
-
.replace(/\{templateCode\}/g, encodeURIComponent(templateCode))
|
|
6070
|
+
.replace(/\{templateCode\}/g, encodeURIComponent(templateCode))
|
|
6071
|
+
// Multiple hierarchy templates can share the same templateCode (see 'byId' selection
|
|
6072
|
+
// above, distinguished by templateName with one flagged isDefault) — hierarchyTemplateCode
|
|
6073
|
+
// alone can't disambiguate between them server-side either, so the resolved template's own
|
|
6074
|
+
// unique numeric id is offered as a second placeholder for configs that need it.
|
|
6075
|
+
.replace(/\{templateId\}/g, encodeURIComponent(template?.id ?? ''));
|
|
6071
6076
|
const optionConfig = {
|
|
6072
6077
|
apiUrl,
|
|
6073
6078
|
dataPath: cfg.dataPath,
|
|
@@ -6113,7 +6118,15 @@ class SmartFormComponent {
|
|
|
6113
6118
|
}
|
|
6114
6119
|
if (nodeOvr['placeholder'])
|
|
6115
6120
|
fieldDef['placeholder'] = nodeOvr['placeholder'];
|
|
6121
|
+
if (nodeOvr['disabled'])
|
|
6122
|
+
fieldDef['disabled'] = true;
|
|
6116
6123
|
fields.push(fieldDef);
|
|
6124
|
+
// `leaf: true` stops the walk from descending past this classCode — e.g. a filter
|
|
6125
|
+
// that should offer Country/State/District but not whatever the tenant's template
|
|
6126
|
+
// configures below District (Ward, Sub-District, ...). Without this every consumer
|
|
6127
|
+
// of a given hierarchy template is forced to render its full depth.
|
|
6128
|
+
if (nodeOvr['leaf'])
|
|
6129
|
+
return;
|
|
6117
6130
|
const children = childrenMap.get(code) || [];
|
|
6118
6131
|
if (children.length > 1) {
|
|
6119
6132
|
// Branch point: dynamically build Area Type selector from children
|