
Research
/Security News
jscrambler npm Package Compromised in Supply Chain Attack
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.
select-transfer
Advanced tools
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| loading | 是否在加载中 | boolean | false |
| dataSource | 左边栏列表数据 | Array<{checked: boolean, itemId: string}> | [] |
| selectedResList | 右边栏已选数据 | Array<{itemId: string}> | [] |
| maxSelectNum | 最大选择数量 | number | undefined |
| canAllSelect | 可否全选 | boolean | true |
| allListTitle | 左侧列表标题文案 | string | '' |
| other | 其他数据 | any | undefined |
| renderItemContext | 渲染子列表元素方案 | Function | () => {} |
| handleWarnning | 报错提示方法 | Function | () => {} |
| handleSelectRes | 选择元素方法 | Function | () => {} |
import SelectTransferPC from "@alife/select-transfer";
const dataMock = [
{checked: false, itemId: '1', title: 1},
{checked: false, itemId: '2', title: 2},
{checked: false, itemId: '3', title: 3},
{checked: false, itemId: '4', title: 4},
{checked: false, itemId: '5', title: 5},
{checked: false, itemId: '6', title: 6},
];
const selectedExample = [{itemId: '2', title: 2}, {itemId: '3', title: 3}];
const maxSelectNum = 5;
class Demo extends React.Component {
state = {
selectedList: selectedExample,
dataSource: [],
}
async componentDidMount() {
this.setState({
loading: true,
})
const dataSource = await this.mockFetchData();
this.setState({
dataSource,
loading: false,
})
}
mockFetchData = () => {
return new Promise((resolve, reject) => {
try {
setTimeout(() => {
resolve(dataMock)
}, 2000);
} catch(err) {
reject(err)
}
});
}
renderItemContext = (props) => {
return <div>{props.title}</div>
}
handleWarnning = (errObj) => {
console.log('错误', errObj.errorMsg)
}
handleSelectRes = (res) => {
const { selectedResList = [] } = res;
this.setState({
selectedList: [...selectedResList],
})
}
render() {
const { selectedList, dataSource, loading } = this.state;
return (
<SelectTransferPC dataSource={dataSource}
selectedResList={selectedList}
maxSelectNum={maxSelectNum}
loading={loading}
canAllSelect={true}
allListTitle='全部'
renderItemContext={this.renderItemContext}
handleWarnning={this.handleWarnning}
handleSelectRes={this.handleSelectRes}
/>
);
}
}
ReactDOM.render(<Demo />, mountNode);
FAQs
--- PC双栏同步选择组件 ---
The npm package select-transfer receives a total of 6 weekly downloads. As such, select-transfer popularity was classified as not popular.
We found that select-transfer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.