@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
21 lines • 1.44 kB
JavaScript
const dataValueReadProps = ['path', 'itemPath', 'value'];
export function pickDataValueReadProps(props) {
return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => dataValueReadProps.includes(key)));
}
export function omitDataValueReadProps(props) {
return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => !dataValueReadProps.includes(key)));
}
const dataValueWriteProps = ['emptyValue', 'onFocus', 'onBlur', 'onChange'];
export function pickDataValueWriteProps(props) {
return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => dataValueWriteProps.includes(key)));
}
export function omitDataValueWriteProps(props) {
return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => !dataValueWriteProps.includes(key)));
}
export function pickDataValueReadWriteProps(props) {
return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => dataValueReadProps.includes(key) || dataValueWriteProps.includes(key)));
}
export function omitDataValueReadWriteProps(props) {
return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => !dataValueReadProps.includes(key) && !dataValueWriteProps.includes(key)));
}
//# sourceMappingURL=types.js.map