Something went wrong on our end
Select Git revision
-
Volker Schukai authoredVolker Schukai authored
api-button.mjs 13.79 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 { instanceSymbol } from "../../constants.mjs";
import { buildMap } from "../../data/buildmap.mjs";
import { Pathfinder } from "../../data/pathfinder.mjs";
import { addAttributeToken } from "../../dom/attributes.mjs";
import {
ATTRIBUTE_ERRORMESSAGE,
ATTRIBUTE_ROLE,
} from "../../dom/constants.mjs";
import {
assembleMethodSymbol,
registerCustomElement,
} from "../../dom/customelement.mjs";
import {
findTargetElementFromEvent,
fireCustomEvent,
} from "../../dom/events.mjs";
import { isArray, isPrimitive, isIterable } from "../../types/is.mjs";
import { validateString } from "../../types/validate.mjs";
import { ActionButton } from "./action-button.mjs";
import { ApiButtonStyleSheet } from "./stylesheet/api-button.mjs";
import { isObject, isFunction } from "../../types/is.mjs";
import { getGlobal } from "../../types/global.mjs";
import { Formatter } from "../../text/formatter.mjs";
export { ApiButton };
/**
* @private
* @type {symbol}
*/
const containerElementSymbol = Symbol("containerElement");
/**
* The ApiButton is a button that opens a popper element with possible actions.
*
* <img src="./images/api-button.png">
*
* Dependencies: the system uses functions of the [monsterjs](https://monsterjs.org/) library
* as well as [pooperjs](https://popper.js.org/docs/v2/).
*
* You can create this control either by specifying the HTML tag <monster-action-button />` directly in the HTML or using
* Javascript via the `document.createElement('monster-action-button');` method.
*
* ```html
* <monster-action-button></monster-action-button>
* ```
*
* Or you can create this CustomControl directly in Javascript:
*
* ```js
* import {PopperButton} from '@schukai/component-form/source/action-button.js';
* document.createElement('monster-action-button');
* ```
*
* The `data-monster-button-class` attribute can be used to change the CSS class of the button.
*