Skip to content

Commit f4b46aa

Browse files
committed
Minor fixes
Set density to Comfy. Added property and behaviour to set default open/closed. Removed readOnly attribute. Added descriptions for input properties.
1 parent 5ff3dbb commit f4b46aa

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
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-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default class TagRecordForm extends LightningElement {
55
@api label;
66
@api fields;
77
@api twoColumns;
8-
@api readOnly;
8+
@api isDefaultOpen;
99

1010
@track fieldArray = [];
1111
@track open;
@@ -20,7 +20,7 @@ export default class TagRecordForm extends LightningElement {
2020
}
2121

2222
if (typeof this.open === 'undefined') {
23-
this.open = true;
23+
this.open = this.isDefaultOpen;
2424
}
2525
} catch (error) {
2626
console.error('Error in connectedCallback: ' + error.message);
@@ -31,7 +31,10 @@ export default class TagRecordForm extends LightningElement {
3131
return this.open ? 'slds-section slds-is-open' : 'slds-section';
3232
}
3333
get mode() {
34-
return this.readOnly ? 'readonly' : 'view';
34+
return 'readonly';
35+
}
36+
get density() {
37+
return 'Comfy';
3538
}
3639
get columns() {
3740
return this.twoColumns ? '2' : '1';

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

+8-4
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,12 @@
1012
<objects>
1113
<object>Account</object>
1214
</objects>
13-
<property name="fields" type="String" />
14-
<property name="label" type="String" />
15-
<property name="readOnly" type="Boolean" default="true" />
16-
<property name="twoColumns" type="Boolean" default="true" />
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." />
1721
<supportedFormFactors>
1822
<supportedFormFactor type="Large" />
1923
<supportedFormFactor type="Small" />

0 commit comments

Comments
 (0)