@neo4j-ndl/react
Version:
React implementation of Neo4j Design System
44 lines • 1.78 kB
JavaScript
;
/**
*
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ESTIMATION_FACTORS = exports.EXPAND_BUTTON_RESERVED_WIDTH = exports.RESIZE_DEBOUNCE_DELAY = exports.COLLAPSE_BUTTON_TEXT = exports.ELLIPSIS_CHAR = exports.DEFAULT_MAX_CHARACTERS = void 0;
exports.DEFAULT_MAX_CHARACTERS = 256;
exports.ELLIPSIS_CHAR = '\u2026'; // char: …
exports.COLLAPSE_BUTTON_TEXT = 'View less';
exports.RESIZE_DEBOUNCE_DELAY = 150;
exports.EXPAND_BUTTON_RESERVED_WIDTH = 100;
/**
* Character estimation factors for text truncation
* Note: These are fallback estimates. The component should use DOM measurement
* for better accuracy when possible.
*/
exports.ESTIMATION_FACTORS = {
/** Maximum factor to prevent showing full text */
MAX_FACTOR: 0.75,
/** Base estimation per line for multi-line content */
PER_LINE_BASE: 0.15,
/** Single-line character estimation */
SINGLE_LINE: 0.6,
/** Word boundary threshold */
WORD_BOUNDARY: 0.9,
};
//# sourceMappingURL=constants.js.map