Skip to content
Snippets Groups Projects
Select Git revision
  • b9a373183f86548594ba7a37888f27cca4eaa6ed
  • master default protected
  • 1.31
  • 4.24.3
  • 4.24.2
  • 4.24.1
  • 4.24.0
  • 4.23.6
  • 4.23.5
  • 4.23.4
  • 4.23.3
  • 4.23.2
  • 4.23.1
  • 4.23.0
  • 4.22.3
  • 4.22.2
  • 4.22.1
  • 4.22.0
  • 4.21.0
  • 4.20.1
  • 4.20.0
  • 4.19.0
  • 4.18.0
23 results

create-new-class.nix

Blame
  • customelement.mjs 27.94 KiB
    /**
     * Copyright schukai GmbH and contributors 2023. All Rights Reserved.
     * Node module: @schukai/monster
     * This file is licensed under the AGPLv3 License.
     * License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
     */
    
    import {internalSymbol} from "../constants.mjs";
    import {extend} from "../data/extend.mjs";
    import {Pathfinder} from "../data/pathfinder.mjs";
    import {Formatter} from "../text/formatter.mjs";
    
    import {parseDataURL} from "../types/dataurl.mjs";
    import {getGlobalObject} from "../types/global.mjs";
    import {isArray, isFunction, isIterable, isObject, isString} from "../types/is.mjs";
    import {Observer} from "../types/observer.mjs";
    import {ProxyObserver} from "../types/proxyobserver.mjs";
    import {validateFunction, validateInstance, validateObject, validateString} from "../types/validate.mjs";
    import {clone} from "../util/clone.mjs";
    import {addAttributeToken, getLinkedObjects, hasObjectLink} from "./attributes.mjs";
    import {
        ATTRIBUTE_DISABLED,
        ATTRIBUTE_ERRORMESSAGE,
        ATTRIBUTE_OPTIONS,
        ATTRIBUTE_OPTIONS_SELECTOR,
        customElementUpdaterLinkSymbol,
    } from "./constants.mjs";
    import {findDocumentTemplate, Template} from "./template.mjs";
    import {addObjectWithUpdaterToElement} from "./updater.mjs";
    import {instanceSymbol} from "../constants.mjs";
    import {getDocumentTranslations, Translations} from "../i18n/translations.mjs";
    
    export {
        CustomElement,
        initMethodSymbol,
        assembleMethodSymbol,
        attributeObserverSymbol,
        registerCustomElement,
        getSlottedElements,
    };
    
    /**
     * @memberOf Monster.DOM
     * @type {symbol}
     */
    const initMethodSymbol = Symbol.for("@schukai/monster/dom/@@initMethodSymbol");
    
    /**
     * @memberOf Monster.DOM
     * @type {symbol}
     */
    const assembleMethodSymbol = Symbol.for("@schukai/monster/dom/@@assembleMethodSymbol");
    
    /**
     * this symbol holds the attribute observer callbacks. The key is the attribute name.
     * @memberOf Monster.DOM
     * @type {symbol}
     */
    const attributeObserverSymbol = Symbol.for("@schukai/monster/dom/@@attributeObserver");
    
    /**
     * HTMLElement
     * @external HTMLElement
     * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
     *
     * @startuml customelement-sequencediagram.png
     * skinparam monochrome true
     * skinparam shadowing false
     *
     * autonumber