UNPKG

tdesign-react

Version:
50 lines (44 loc) 2.65 kB
/** * tdesign v1.16.2 * (c) 2025 tdesign * @license MIT */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var toConsumableArray = require('../../_chunks/dep-a7fe58de.js'); var defineProperty = require('../../_chunks/dep-0fe55884.js'); require('../../_chunks/dep-737b8bd8.js'); require('../../_chunks/dep-b325182b.js'); function getFakeArrowIconClass(prefix, STATUS, cascaderContext) { var disabled = cascaderContext.disabled; return ["".concat(prefix, "-cascader__icon"), defineProperty._defineProperty({}, STATUS.disabled, disabled)]; } function getNodeStatusClass(node, STATUS, cascaderContext) { var checkStrictly = cascaderContext.checkStrictly, multiple = cascaderContext.multiple, value = cascaderContext.value, max = cascaderContext.max, inputVal = cascaderContext.inputVal, isParentFilterable = cascaderContext.isParentFilterable; var expandedActive = !checkStrictly && node.expanded && (multiple ? !node.isLeaf() : true) || checkStrictly && node.expanded && !isParentFilterable; var isLeaf = node.isLeaf(); var isDisabled = node.disabled || multiple && value.length >= max && max !== 0; var isSelected = node.checked || multiple && !checkStrictly && node.expanded && !isLeaf; if (!multiple && !checkStrictly && !isLeaf) { isSelected = node.expanded; } return [defineProperty._defineProperty(defineProperty._defineProperty(defineProperty._defineProperty({}, STATUS.selected, !isDisabled && isSelected), STATUS.expanded, !isDisabled && !inputVal && expandedActive), STATUS.disabled, isDisabled)]; } function getCascaderItemClass(prefix, node, SIZE, STATUS, cascaderContext) { var size = cascaderContext.size, isParentFilterable = cascaderContext.isParentFilterable; return ["".concat(prefix, "-cascader__item")].concat(toConsumableArray._toConsumableArray(getNodeStatusClass(node, STATUS, cascaderContext)), [SIZE[size], defineProperty._defineProperty(defineProperty._defineProperty({}, "".concat(prefix, "-cascader__item--with-icon"), !!node.children), "".concat(prefix, "-cascader__item--leaf"), node.isLeaf() || isParentFilterable)]); } function getCascaderItemIconClass(prefix, node, STATUS, cascaderContext) { return ["".concat(prefix, "-cascader__item-icon"), "".concat(prefix, "-icon")].concat(toConsumableArray._toConsumableArray(getNodeStatusClass(node, STATUS, cascaderContext))); } exports.getCascaderItemClass = getCascaderItemClass; exports.getCascaderItemIconClass = getCascaderItemIconClass; exports.getFakeArrowIconClass = getFakeArrowIconClass; exports.getNodeStatusClass = getNodeStatusClass; //# sourceMappingURL=className.js.map