UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

22 lines 1.87 kB
import _includesInstanceProperty from "core-js-pure/stable/instance/includes.js"; const dataValueReadProps = ['path', 'itemPath', 'value']; export function pickDataValueReadProps(props) { return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => _includesInstanceProperty(dataValueReadProps).call(dataValueReadProps, key))); } export function omitDataValueReadProps(props) { return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => !_includesInstanceProperty(dataValueReadProps).call(dataValueReadProps, key))); } const dataValueWriteProps = ['emptyValue', 'onFocus', 'onBlur', 'onChange']; export function pickDataValueWriteProps(props) { return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => _includesInstanceProperty(dataValueWriteProps).call(dataValueWriteProps, key))); } export function omitDataValueWriteProps(props) { return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => !_includesInstanceProperty(dataValueWriteProps).call(dataValueWriteProps, key))); } export function pickDataValueReadWriteProps(props) { return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => _includesInstanceProperty(dataValueReadProps).call(dataValueReadProps, key) || _includesInstanceProperty(dataValueWriteProps).call(dataValueWriteProps, key))); } export function omitDataValueReadWriteProps(props) { return Object.fromEntries(Object.entries(props !== null && props !== void 0 ? props : {}).filter(([key]) => !_includesInstanceProperty(dataValueReadProps).call(dataValueReadProps, key) && !_includesInstanceProperty(dataValueWriteProps).call(dataValueWriteProps, key))); } //# sourceMappingURL=types.js.map