Something went wrong on our end
Select Git revision
time-formats.go
-
Volker Schukai authoredVolker Schukai authored
updater.mjs 30.26 KiB
/**
* Copyright © schukai GmbH and all contributing authors, {{copyRightYear}}. All rights reserved.
* Node module: @schukai/monster
*
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
* The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
*
* For those who do not wish to adhere to the AGPLv3, a commercial license is available.
* Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
* For more information about purchasing a commercial license, please contact schukai GmbH.
*
* SPDX-License-Identifier: AGPL-3.0
*/
import {internalSymbol} from "../constants.mjs";
import {diff} from "../data/diff.mjs";
import {Pathfinder} from "../data/pathfinder.mjs";
import {Pipe} from "../data/pipe.mjs";
import {
ATTRIBUTE_ERRORMESSAGE,
ATTRIBUTE_UPDATER_ATTRIBUTES,
ATTRIBUTE_UPDATER_BIND,
ATTRIBUTE_UPDATER_BIND_TYPE,
ATTRIBUTE_UPDATER_INSERT,
ATTRIBUTE_UPDATER_INSERT_REFERENCE,
ATTRIBUTE_UPDATER_REMOVE,
ATTRIBUTE_UPDATER_REPLACE,
ATTRIBUTE_UPDATER_SELECT_THIS,
} from "./constants.mjs";
import {Base} from "../types/base.mjs";
import {isArray, isString, isInstance, isIterable} from "../types/is.mjs";
import {Observer} from "../types/observer.mjs";
import {ProxyObserver} from "../types/proxyobserver.mjs";
import {validateArray, validateInstance} from "../types/validate.mjs";
import {Sleep} from "../util/sleep.mjs";
import {clone} from "../util/clone.mjs";
import {trimSpaces} from "../util/trimspaces.mjs";
import {addAttributeToken, addToObjectLink} from "./attributes.mjs";
import {updaterTransformerMethodsSymbol} from "./customelement.mjs";
import {findTargetElementFromEvent} from "./events.mjs";
import {findDocumentTemplate} from "./template.mjs";
import {getWindow} from "./util.mjs";
export {Updater, addObjectWithUpdaterToElement};
/**
* The updater class connects an object with the DOM. In this way, structures and contents in the DOM can be
* programmatically adapted via attributes.
*
* For example, to include a string from an object, the attribute `data-monster-replace` can be used.
* a further explanation can be found under [monsterjs.org](https://monsterjs.org/)
*
* Changes to attributes are made only when the direct values are changed. If you want to assign changes
* to other values as well, you have to insert the attribute `data-monster-select-this`. This should be
* done with care, as it can reduce performance.
*
* @externalExample ../../example/dom/updater.mjs
* @license AGPLv3
* @since 1.8.0
* @copyright schukai GmbH
* @memberOf Monster.DOM
* @throws {Error} the value is not iterable
* @throws {Error} pipes are not allowed when cloning a node.
* @throws {Error} no template was found with the specified key.
* @throws {Error} the maximum depth for the recursion is reached.
* @throws {TypeError} value is not a object
* @throws {TypeError} value is not an instance of HTMLElement
* @summary The updater class connects an object with the dom
*/