Skip to content
Snippets Groups Projects
Select Git revision
  • 57deb525c6852f46d7ee5a22c98a7e24b6438599
  • master default protected
  • 1.31
  • 4.38.2
  • 4.38.1
  • 4.38.0
  • 4.37.2
  • 4.37.1
  • 4.37.0
  • 4.36.0
  • 4.35.0
  • 4.34.1
  • 4.34.0
  • 4.33.1
  • 4.33.0
  • 4.32.2
  • 4.32.1
  • 4.32.0
  • 4.31.0
  • 4.30.1
  • 4.30.0
  • 4.29.1
  • 4.29.0
23 results

misc.js

Blame
  • embedded-pagination.mjs 2.57 KiB
    /**
     * Copyright 2023 schukai GmbH
     * SPDX-License-Identifier: AGPL-3.0
     */
    
    import {assembleMethodSymbol, registerCustomElement} from "../../dom/customelement.mjs";
    import {EmbeddedPaginationStyleSheet} from "./stylesheet/embedded-pagination.mjs";
    import {instanceSymbol} from "../../constants.mjs";
    
    import "../form/select.mjs";
    import {Pagination} from "./pagination.mjs";
    
    import "./datasource/dom.mjs";
    import "./datasource/rest.mjs";
    
    
    export {EmbeddedPagination};
    
    /**
     * The EmbeddedPagination component is used to show the current page and the total number of pages.
     *
     * <img src="./images/embedded-pagination.png">
     *
     * Dependencies: the system uses functions of the [monsterjs](https://monsterjs.org/) library
     *
     * You can create this control either by specifying the HTML tag <monster-datatable />` directly in the HTML or using
     * Javascript via the `document.createElement('monster-datatable');` method.
     *
     * ```html
     * <monster-pagination></monster-pagination>
     * ```
     *
     * Or you can create this CustomControl directly in Javascript:
     *
     * ```js
     * import '@schukai/component-datatable/source/pagination.mjs';
     * document.createElement('monster-pagination');
     * ```
     *
     * @startuml embedded-pagination.png
     * skinparam monochrome true
     * skinparam shadowing false
     * HTMLElement <|-- CustomElement
     * CustomElement <|-- Pagination
     * @enduml
     *
     * @copyright schukai GmbH
     * @memberOf Monster.Components.Datatable
     * @summary A datatable
     */
    class EmbeddedPagination extends Pagination {
        /**
         * This method is called by the `instanceof` operator.
         * @returns {symbol}
         */
        static get [instanceSymbol]() {
            return Symbol.for("@schukai/monster/components/embedded-pagination");
        }
    
        [assembleMethodSymbol]() {
            super[assembleMethodSymbol]();
        }
    
        get defaults() {
            return Object.assign(
                {},
                super.defaults,
                {
                    classes: {
                        spinner: "monster-spinner monster-theme-primary-3",
                        spinnerContainer: "monster-theme-primary-2 ",
                        error: "monster-theme-error-2 monster-bg-color-primary-2",
                        errorContainer: "monster-theme-primary-2",
                    },                
                    
                }
            );
    
        }
    
        /**
         *
         * @return {string}
         */
        static getTag() {
            return "monster-embedded-pagination";
        }
    
    
        /**
         * @private
         * @returns {CSSStyleSheet}
         */
        static getControlCSSStyleSheet() {
            return EmbeddedPaginationStyleSheet;
        }
    
    }
    
    
    registerCustomElement(EmbeddedPagination);