define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
- exports.getStoragePrefix = exports.triggerEvent = exports.serialize = exports.getUuid = exports.getType = exports.isPlainObject = exports.inherit = exports.extend = exports.convertLegacyUrl = exports.clone = void 0;
+ exports.stringToBool = exports.getStoragePrefix = exports.triggerEvent = exports.serialize = exports.getUuid = exports.getType = exports.isPlainObject = exports.inherit = exports.extend = exports.convertLegacyUrl = exports.clone = void 0;
const _clone = function (variable) {
if (typeof variable === 'object' && (Array.isArray(variable) || isPlainObject(variable))) {
return _cloneObject(variable);
return _prefix;
}
exports.getStoragePrefix = getStoragePrefix;
+ /**
+ * Interprets a string value as a boolean value similar to the behavior of the
+ * legacy functions `elAttrBool()` and `elDataBool()`.
+ */
+ function stringToBool(value) {
+ return value === '1' || value === 'true';
+ }
+ exports.stringToBool = stringToBool;
});
}
return null;
},
+ /**
+ * Shorthand function to hide an element by setting its 'display' value to 'none'.
+ */
+ hide(element) {
+ element.style.setProperty('display', 'none', '');
+ },
+ /**
+ * Shorthand function to show an element previously hidden by using `elHide()`.
+ */
+ show(element) {
+ element.style.removeProperty('display');
+ },
};
// expose on window object for backward compatibility
window.bc_wcfDomUtil = DomUtil;
export function getStoragePrefix() {
return _prefix;
}
-
+
+/**
+ * Interprets a string value as a boolean value similar to the behavior of the
+ * legacy functions `elAttrBool()` and `elDataBool()`.
+ */
+export function stringToBool(value: string | null): boolean {
+ return value === '1' || value === 'true';
+}
return null;
},
+
+ /**
+ * Shorthand function to hide an element by setting its 'display' value to 'none'.
+ */
+ hide(element: HTMLElement): void {
+ element.style.setProperty('display', 'none', '');
+ },
+
+ /**
+ * Shorthand function to show an element previously hidden by using `elHide()`.
+ */
+ show(element: HTMLElement): void {
+ element.style.removeProperty('display');
+ },
};
interface Dimensions {