Skip to content

Commit a27d4cd

Browse files
authored
Merge branch 'main' into relatedList
2 parents 0915964 + 227a2cd commit a27d4cd

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

force-app/components/tagRecordForm/lwc/tagRecordForm/tagRecordForm.html

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ <h3 class="slds-section__title slds-truncate slds-p-around_xx-small slds-theme_s
2121
fields={fieldArray}
2222
columns={columns}
2323
mode={mode}
24+
density={density}
2425
>
2526
</lightning-record-form>
2627
</template>

force-app/components/tagRecordForm/lwc/tagRecordForm/tagRecordForm.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export default class TagRecordForm extends LightningElement {
55
@api label;
66
@api fields;
77
@api twoColumns;
8+
@api isDefaultOpen;
89
@api readOnly;
910

1011
@track fieldArray = [];
@@ -20,7 +21,7 @@ export default class TagRecordForm extends LightningElement {
2021
}
2122

2223
if (typeof this.open === 'undefined') {
23-
this.open = true;
24+
this.open = this.isDefaultOpen;
2425
}
2526
} catch (error) {
2627
console.error('Error in connectedCallback: ' + error.message);
@@ -31,7 +32,10 @@ export default class TagRecordForm extends LightningElement {
3132
return this.open ? 'slds-section slds-is-open' : 'slds-section';
3233
}
3334
get mode() {
34-
return this.readOnly ? 'readonly' : 'view';
35+
return 'readonly';
36+
}
37+
get density() {
38+
return 'Comfy';
3539
}
3640
get columns() {
3741
return this.twoColumns ? '2' : '1';

force-app/components/tagRecordForm/lwc/tagRecordForm/tagRecordForm.js-meta.xml

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
33
<apiVersion>62.0</apiVersion>
44
<isExposed>true</isExposed>
5+
<masterLabel>TAG - Record Form</masterLabel>
6+
<description>Simple component that display fields in two columns, with same styling as standard dynamic field sections.</description>
57
<targets>
68
<target>lightning__RecordPage</target>
79
</targets>
@@ -10,10 +12,13 @@
1012
<objects>
1113
<object>Account</object>
1214
</objects>
13-
<property name="fields" type="String" />
14-
<property name="label" type="String" />
15+
<property name="label" type="String" description="Section header." />
16+
<property name="fields" type="String" description="API names seprated by comma." />
17+
<property name="isDefaultOpen" type="Boolean" default="true"
18+
description="If checked, the section is open on page refresh. Closed if unchecked." />
19+
<property name="twoColumns" type="Boolean" default="true"
20+
description="If checked, the fields will display in two columns. One columns if unchecked." />
1521
<property name="readOnly" type="Boolean" default="true" />
16-
<property name="twoColumns" type="Boolean" default="true" />
1722
<supportedFormFactors>
1823
<supportedFormFactor type="Large" />
1924
<supportedFormFactor type="Small" />

0 commit comments

Comments
 (0)