@alifd/adaptor-helper
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -391,3 +391,19 @@ var STATE_MARK = { | ||
}; | ||
var filterDemoState = function filterDemoState(state) { | ||
return function (_ref6) { | ||
var node = _ref6.node; | ||
var _node$props = node.props, | ||
props = _node$props === void 0 ? {} : _node$props; | ||
var _props$data = props.data, | ||
data = _props$data === void 0 ? "" : _props$data; | ||
var demoState = STATE_MARK[data.substring(0, 1)] || "normal"; | ||
export { ContentType, NodeType, STATE_MARK, STATE_PREFIX_MARK, Types$1 as Types, findOptionLabel, findProp, generateDemos, getDefaultProps, getStates, normalizeAdaptor, parseData, uuid }; | ||
if (props.state) { | ||
demoState = props.state; | ||
} | ||
return demoState === state; | ||
}; | ||
}; | ||
export { ContentType, NodeType, STATE_MARK, STATE_PREFIX_MARK, Types$1 as Types, filterDemoState, findOptionLabel, findProp, generateDemos, getDefaultProps, getStates, normalizeAdaptor, parseData, uuid }; |
@@ -234,2 +234,18 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
return demos; | ||
}; | ||
export var filterDemoState = function filterDemoState(state) { | ||
return function (_ref6) { | ||
var node = _ref6.node; | ||
var _node$props = node.props, | ||
props = _node$props === void 0 ? {} : _node$props; | ||
var _props$data = props.data, | ||
data = _props$data === void 0 ? "" : _props$data; | ||
var demoState = STATE_MARK[data.substring(0, 1)] || "normal"; | ||
if (props.state) { | ||
demoState = props.state; | ||
} | ||
return demoState === state; | ||
}; | ||
}; |
export { parseData, NodeType, ContentType } from "./parse-data"; | ||
export { default as Types } from "./types"; | ||
export { STATE_MARK, STATE_PREFIX_MARK } from "./state-mark"; | ||
export { normalizeAdaptor, getDefaultProps, getStates, findProp, findOptionLabel, uuid, generateDemos } from "./adaptor"; | ||
export { normalizeAdaptor, getDefaultProps, getStates, findProp, findOptionLabel, uuid, generateDemos, filterDemoState } from "./adaptor"; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.generateDemos = exports.getStates = exports.uuid = exports.findOptionLabel = exports.findProp = exports.getDefaultProps = exports.normalizeAdaptor = void 0; | ||
exports.filterDemoState = exports.generateDemos = exports.getStates = exports.uuid = exports.findOptionLabel = exports.findProp = exports.getDefaultProps = exports.normalizeAdaptor = void 0; | ||
@@ -266,2 +266,21 @@ var _stateMark = require("./state-mark"); | ||
exports.generateDemos = generateDemos; | ||
exports.generateDemos = generateDemos; | ||
var filterDemoState = function filterDemoState(state) { | ||
return function (_ref6) { | ||
var node = _ref6.node; | ||
var _node$props = node.props, | ||
props = _node$props === void 0 ? {} : _node$props; | ||
var _props$data = props.data, | ||
data = _props$data === void 0 ? "" : _props$data; | ||
var demoState = _stateMark.STATE_MARK[data.substring(0, 1)] || "normal"; | ||
if (props.state) { | ||
demoState = props.state; | ||
} | ||
return demoState === state; | ||
}; | ||
}; | ||
exports.filterDemoState = filterDemoState; |
@@ -84,2 +84,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "filterDemoState", { | ||
enumerable: true, | ||
get: function get() { | ||
return _adaptor.filterDemoState; | ||
} | ||
}); | ||
@@ -86,0 +92,0 @@ var _parseData = require("./parse-data"); |
{ | ||
"name": "@alifd/adaptor-helper", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Next adaptor utils", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -274,1 +274,15 @@ import { STATE_MARK, STATE_PREFIX_MARK } from "./state-mark"; | ||
}; | ||
export const filterDemoState = ((state: string) => { | ||
return ({ node }: IDemo ) => { | ||
const { props = {} } = node; | ||
const { data = "" } = props; | ||
let demoState = STATE_MARK[data.substring(0, 1)] || "normal"; | ||
if (props.state) { | ||
demoState = props.state; | ||
} | ||
return demoState === state; | ||
}; | ||
}); |
@@ -16,2 +16,3 @@ export { | ||
generateDemos, | ||
filterDemoState, | ||
} from "./adaptor"; |
@@ -65,2 +65,3 @@ import Types from "./types"; | ||
export declare const generateDemos: (adaptor: IAdaptor) => IDemo[]; | ||
export declare const filterDemoState: (state: string) => ({ node }: IDemo) => boolean; | ||
export {}; |
export { parseData, NodeType, ContentType, } from "./parse-data"; | ||
export { default as Types } from "./types"; | ||
export { STATE_MARK, STATE_PREFIX_MARK } from "./state-mark"; | ||
export { normalizeAdaptor, getDefaultProps, getStates, findProp, findOptionLabel, uuid, generateDemos, } from "./adaptor"; | ||
export { normalizeAdaptor, getDefaultProps, getStates, findProp, findOptionLabel, uuid, generateDemos, filterDemoState, } from "./adaptor"; |
@@ -393,6 +393,23 @@ (function (global, factory) { | ||
}; | ||
var filterDemoState = function filterDemoState(state) { | ||
return function (_ref6) { | ||
var node = _ref6.node; | ||
var _node$props = node.props, | ||
props = _node$props === void 0 ? {} : _node$props; | ||
var _props$data = props.data, | ||
data = _props$data === void 0 ? "" : _props$data; | ||
var demoState = STATE_MARK[data.substring(0, 1)] || "normal"; | ||
if (props.state) { | ||
demoState = props.state; | ||
} | ||
return demoState === state; | ||
}; | ||
}; | ||
exports.STATE_MARK = STATE_MARK; | ||
exports.STATE_PREFIX_MARK = STATE_PREFIX_MARK; | ||
exports.Types = Types$1; | ||
exports.filterDemoState = filterDemoState; | ||
exports.findOptionLabel = findOptionLabel; | ||
@@ -399,0 +416,0 @@ exports.findProp = findProp; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
100844
2159