/** * Use the FuroFeatureToggle to control features from a central registry. * FuroFeatureToggle only needs a key and a boolean value. * These key can be set at any time. * A requested key which was not set, is interpreted as false. * * ## Available toggles * Following toggles are given, use the one which is appropriate to your problem. * Sometimes you want to hide some parts if a key is true and sometimes you have to do the opposite. * * - `data-furo-toggle-append` Appends the element on true state of the key, removes the element on false state * - `data-furo-toggle-remove` Removes the element on true state of the key, appends the element on false state * * - `data-furo-toggle-hide` Adds a hidden attribute to the element on true state of the key, removes the attribute on false state * - `data-furo-toggle-show` Removes a hidden attribute from the element on true state of the key, adds the attribute on false state * * - `data-furo-toggle-disable` Adds a disabled attribute to the element on true state of the key, removes the attribute on false state * - `data-furo-toggle-enable` Removes a disabled attribute from the element on true state of the key, adds the attribute on false state * * - `data-furo-toggle-custom-add` Adds the custom attribute to the element on true state of the key, removes the attribute on false state * - `data-furo-toggle-custom-remove` Removes the custom attribute from the element on true state of the key, adds the attribute on false state * * ## Example usage: * ### js * ```js * // import FuroFeatureToggle * import { FuroFeatureToggle } from '@furo/framework/src/FuroFeatureToggler/FuroFeatureToggle.js'; * * // enabling for a part of your component * FuroFeatureToggle.parseDom(this.shadowRoot) * * // enabling for a part of your component * FuroFeatureToggle.parseDom(this.shadowRoot.querySelector('#partial')) * * * // setting a key * FuroFeatureToggle.setKeyState('feature.key', true); * * ``` * ### html * * ```html * remove: * * span is removed if key state is true, otherwise appended * * append: * * span is appended when key state true, otherwise removed * * enable: * * * disable: * * * hide: *