Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new flowRadioButton Group #1348

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions flow_screen_components/fsc_flowRadioButtonGroup/.forceignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
#

package.xml

# LWC configuration files
**/jsconfig.json
**/.eslintrc.json
./.sfdx
./.sf
./config

# LWC Jest
**/__tests__/**
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { createElement } from 'lwc';
import Fsc_flowRadioButtonGroup from 'c/fsc_flowRadioButtonGroup';

describe('c-fsc-flow-radio-button-group', () => {
afterEach(() => {
// The jsdom instance is shared across test cases in a single file so reset the DOM
while (document.body.firstChild) {
document.body.removeChild(document.body.firstChild);
}
});

it('TODO: test case generated by CLI command, please fill in test logic', () => {
// Arrange
const element = createElement('c-fsc-flow-radio-button-group', {
is: Fsc_flowRadioButtonGroup
});

// Act
document.body.appendChild(element);

// Assert
// const div = element.shadowRoot.querySelector('div');
expect(1).toBe(1);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>
<div class="slds-form-element">
<div class="slds-form-element__control">
<!-- Field Level Help -->
<template if:true={fieldLevelHelp}>
<lightning-helptext content={fieldLevelHelp}
></lightning-helptext>
</template>
<template if:true={required}>
<abbr class="slds-required" title="required">*</abbr>
<lightning-radio-group
class="slds-p-top_xxx-small"
name={name}
label={label}
options={options}
value={value}
type={type}
onchange={handleValueChange}
disabled={disabled}
required>
</lightning-radio-group>
</template>
<template if:false={required}>
<lightning-radio-group
class="slds-p-top_xxx-small"
name={name}
label={label}
options={options}
value={value}
type={type}
disabled={disabled}
onchange={handleValueChange}>
</lightning-radio-group>
</template>
</div>
</div>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { LightningElement, api } from 'lwc';

export default class Fsc_flowRadioGroup extends LightningElement {
@api label;
@api name;
@api options; // [{label: 'Option 1', value: '1'}, {label: 'Option 2', value: '2'}]
@api type; // Radio or Button
@api fieldLevelHelp;
@api disabled;
@api required;
@api value;

handleValueChange(event) {
this.dispatchEvent(new CustomEvent('valuechange', {
detail: {
newValue: event.target.value
}
}));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>56.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
19 changes: 19 additions & 0 deletions flow_screen_components/fsc_flowRadioButtonGroup/sfdx-project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"packageDirectories": [
{
"path": "force-app",
"default": true,
"package": "Flow Radio Button Group for CPE",
"versionName": "ver 0.1",
"versionNumber": "0.1.0.NEXT",
"versionDescription": ""
}
],
"name": "fsc_flowRadioButtonGroup",
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "56.0",
"packageAliases": {
"Flow Radio Button Group for CPE": "0Ho5e000000wkSFCAY"
}
}