Skip to content
Snippets Groups Projects
Verified Commit 6426c56b authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: doc and code tidy

parent c107f9fa
No related branches found
No related tags found
No related merge requests found
...@@ -26,11 +26,9 @@ in ...@@ -26,11 +26,9 @@ in
cd $CI_PROJECT_DIR || exit 1 cd $CI_PROJECT_DIR || exit 1
#### ${pkgs'.git}/bin/git remote set-url origin https://''${CI_REPOSITORY_URL#*@}
echo_step "Set git remote url to https://pad:secret@''${CI_REPOSITORY_URL#*@}" echo_step "Set git remote url to https://pad:secret@''${CI_REPOSITORY_URL#*@}"
${pkgs'.git}/bin/git remote set-url origin https://pad:''${GITLAB_TOKEN}@''${CI_REPOSITORY_URL#*@} ${pkgs'.git}/bin/git remote set-url origin https://pad:''${GITLAB_TOKEN}@''${CI_REPOSITORY_URL#*@}
${pkgs'.git}/bin/git fetch --all --tags --unshallow ${pkgs'.git}/bin/git fetch --all --tags --unshallow
${pkgs'.git}/bin/git reset --hard origin/master ${pkgs'.git}/bin/git reset --hard origin/master
${pkgs'.git}/bin/git clean -fd ${pkgs'.git}/bin/git clean -fd
......
...@@ -228,7 +228,7 @@ class ContextError extends Popper { ...@@ -228,7 +228,7 @@ class ContextError extends Popper {
} }
/** /**
* Returns the html tag of the control. * Returns the HTML Tag of the control.
* *
* @return {string} * @return {string}
*/ */
......
...@@ -67,39 +67,6 @@ const toggleSwitchElementSymbol = Symbol("toggleSwitchElement"); ...@@ -67,39 +67,6 @@ const toggleSwitchElementSymbol = Symbol("toggleSwitchElement");
*/ */
const extendedSwitchElementSymbol = Symbol("extendedSwitchElement"); const extendedSwitchElementSymbol = Symbol("extendedSwitchElement");
/**
* This CustomControl creates a FieldSet element with a variety of options.
*
* <img src="./images/field-set.png">
*
* You can create this control either by specifying the HTML tag <monster-field-set />` directly in the HTML or using
* Javascript via the `document.createElement('monster-field-set');` method.
*
* ```html
* <monster-field-set></monster-field-set>
* ```
*
* Or you can create this CustomControl directly in Javascript:
*
* ```js
* import {FieldSet} from '@schukai/monster/source/components/form/field-set.mjs';
* document.createElement('monster-field-set');
* ```
*
* @externalExample ../..../example/components/form/field-set.mjs
* @startuml field-set.png
* skinparam monochrome true
* skinparam shadowing false
* HTMLElement <|-- CustomElement
* CustomElement <|-- CustomControl
* CustomControl <|-- FieldSet
* @enduml
*
* @copyright schukai GmbH
* @memberOf Monster.Components.Form
* @summary A simple FieldSet
*/
/** /**
* A field set control that can be used to group form elements. * A field set control that can be used to group form elements.
* *
...@@ -143,6 +110,7 @@ class FieldSet extends CustomControl { ...@@ -143,6 +110,7 @@ class FieldSet extends CustomControl {
* @property {Object} actions Callbacks * @property {Object} actions Callbacks
* @property {string} actions.click="throw Error" Callback when clicked * @property {string} actions.click="throw Error" Callback when clicked
* @property {Object} features Features * @property {Object} features Features
* @property {boolean} features.multipleColumns=true Multiple columns
* @property {Object} classes CSS classes * @property {Object} classes CSS classes
* @property {boolean} disabled=false Disabled state * @property {boolean} disabled=false Disabled state
*/ */
...@@ -152,14 +120,16 @@ class FieldSet extends CustomControl { ...@@ -152,14 +120,16 @@ class FieldSet extends CustomControl {
main: getTemplate(), main: getTemplate(),
}, },
labels: { labels: {
"toggle-switch-on": "", toggleSwitchOn: "",
"toggle-switch-off": "", toggleSwitchOff: "",
"toggle-switch-label": "Expand", toggleSwitchLabel: "Expand",
title: "", title: "",
}, },
classes: {}, classes: {},
disabled: false, disabled: false,
features: {}, features: {
multipleColumns: true,
},
actions: { actions: {
click: () => { click: () => {
throw new Error("the click action is not defined"); throw new Error("the click action is not defined");
...@@ -293,12 +263,12 @@ function updateExtendedFields() { ...@@ -293,12 +263,12 @@ function updateExtendedFields() {
*/ */
function initEventHandler() { function initEventHandler() {
this[toggleSwitchElementSymbol].setOption( this[toggleSwitchElementSymbol].setOption(
"labels.toggle-switch-on", "labels.toggleSwitchOn",
this.getOption("labels.toggle-switch-on"), this.getOption("labels.toggleSwitchOn"),
); );
this[toggleSwitchElementSymbol].setOption( this[toggleSwitchElementSymbol].setOption(
"labels.toggle-switch-off", "labels.toggleSwitchOff",
this.getOption("labels.toggle-switch-off"), this.getOption("labels.toggleSwitchOff"),
); );
this[toggleSwitchElementSymbol].setOption("actions.on", () => { this[toggleSwitchElementSymbol].setOption("actions.on", () => {
......
...@@ -49,25 +49,6 @@ export const STATE_ON = "on"; ...@@ -49,25 +49,6 @@ export const STATE_ON = "on";
*/ */
export const STATE_OFF = "off"; export const STATE_OFF = "off";
/**
* This CustomControl creates a ToggleSwitch element
*
* <img src="./images/toggleswitch.png">
*
*
* @startuml toggleswitch.png
* skinparam monochrome true
* skinparam shadowing false
* HTMLElement <|-- CustomElement
* CustomElement <|-- CustomControl
* CustomControl <|-- ToggleSwitch
* @enduml
*
* @copyright schukai GmbH
* @memberOf Monster.Components.Form
* @summary A simple toggle switch
*/
/** /**
* A simple toggle switch * A simple toggle switch
* *
...@@ -120,8 +101,8 @@ class ToggleSwitch extends CustomControl { ...@@ -120,8 +101,8 @@ class ToggleSwitch extends CustomControl {
off: "off", off: "off",
}, },
labels: { labels: {
"toggle-switch-on": "ON", toggleSwitchOn: "",
"toggle-switch-off": "OFF", toggleSwitchOff: "",
}, },
templates: { templates: {
main: getTemplate(), main: getTemplate(),
...@@ -447,8 +428,8 @@ function getTemplate() { ...@@ -447,8 +428,8 @@ function getTemplate() {
<div data-monster-role="control" part="control" tabindex="0"> <div data-monster-role="control" part="control" tabindex="0">
<div class="switch" data-monster-role="switch" <div class="switch" data-monster-role="switch"
data-monster-attributes="data-monster-state path:value | call:state-callback"> data-monster-attributes="data-monster-state path:value | call:state-callback">
<div class="label on" data-monster-replace="path:labels.toggle-switch-on"></div> <div class="label on" data-monster-replace="path:labels.toggleSwitchOn"></div>
<div class="label off" data-monster-replace="path:labels.toggle-switch-off"></div> <div class="label off" data-monster-replace="path:labels.toggleSwitchOff"></div>
<div data-monster-attributes="class path:classes.handle | suffix:\\ switch-slider"></div> <div data-monster-attributes="class path:classes.handle | suffix:\\ switch-slider"></div>
</div> </div>
</div>`; </div>`;
......
...@@ -19,6 +19,6 @@ export { Collapse }; ...@@ -19,6 +19,6 @@ export { Collapse };
* @since 1.10.0 * @since 1.10.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Components.Form * @memberOf Monster.Components.Form
* @deprecated since 3.64.0 use {@link Monster.Components.Layout.Collapse} * @deprecated since 3.64.0 use Layout.Collapse instead
*/ */
class Collapse extends NewCollapse {} class Collapse extends NewCollapse {}
...@@ -71,10 +71,22 @@ const emptyStateElementSymbol = Symbol("emptyStateElement"); ...@@ -71,10 +71,22 @@ const emptyStateElementSymbol = Symbol("emptyStateElement");
* @memberOf Monster.Components.State * @memberOf Monster.Components.State
* @summary Log is a control to show a log message. * @summary Log is a control to show a log message.
*/ */
class Log extends CustomElement {
/** /**
* A Log component
*
* @fragments /fragments/components/layout/collapse/
* *
* @return {Monster.Components.State.State} * @example /examples/components/layout/collapse-simple
*
* @since 3.74.0
* @copyright schukai GmbH
* @summary A Log component to show a log message.
*/
class Log extends CustomElement {
/**
* @return {void}
*/ */
[assembleMethodSymbol]() { [assembleMethodSymbol]() {
super[assembleMethodSymbol](); super[assembleMethodSymbol]();
...@@ -88,7 +100,7 @@ class Log extends CustomElement { ...@@ -88,7 +100,7 @@ class Log extends CustomElement {
* @returns {symbol} * @returns {symbol}
*/ */
static get [instanceSymbol]() { static get [instanceSymbol]() {
return Symbol.for("@schukai/component-state/log"); return Symbol.for("@schukai/monster/components/state/log@@instance");
} }
/** /**
...@@ -116,6 +128,9 @@ class Log extends CustomElement { ...@@ -116,6 +128,9 @@ class Log extends CustomElement {
}); });
} }
/**
* @return {void}
*/
connectedCallback() { connectedCallback() {
super.connectedCallback(); super.connectedCallback();
...@@ -136,6 +151,11 @@ class Log extends CustomElement { ...@@ -136,6 +151,11 @@ class Log extends CustomElement {
return this; return this;
} }
/**
* Add an entry to the log
* @param entry
* @returns {Log}
*/
addEntry(entry) { addEntry(entry) {
validateInstance(entry, Entry); validateInstance(entry, Entry);
...@@ -150,9 +170,9 @@ class Log extends CustomElement { ...@@ -150,9 +170,9 @@ class Log extends CustomElement {
/** /**
* Add a log message * Add a log message
* * @param message
* @param {string} message * @param date
* @return {Log} * @returns {Log}
*/ */
addMessage(message, date) { addMessage(message, date) {
if (!date) { if (!date) {
...@@ -221,12 +241,6 @@ function initEventHandler() { ...@@ -221,12 +241,6 @@ function initEventHandler() {
} }
}); });
// self[buttonEventHandlerSymbol] = (event) => {
// self.toggle();
// }
//
// self[buttonElementSymbol].addEventListener('click', self[buttonEventHandlerSymbol]);
return this; return this;
} }
......
...@@ -29,44 +29,20 @@ export { State }; ...@@ -29,44 +29,20 @@ export { State };
export const stateElementSymbol = Symbol("state"); export const stateElementSymbol = Symbol("state");
/** /**
* States tell users that there’s a state. that s it! * A state component
* *
* <img src="./images/state.png"> * @fragments /fragments/components/state/state/
* *
* Dependencies: the system uses functions of the [monsterjs](https://monsterjs.org/) library * @example /examples/components/state/state-simple
*
* You can create this control either by specifying the HTML tag <monster-state />` directly in the HTML or using
* Javascript via the `document.createElement('monster-state');` method.
*
* ```html
* <monster-state></monster-state>
* ```
*
* Or you can create this CustomControl directly in Javascript:
*
* ```js
* import {State} from '@schukai/component-state/source/state.js';
* document.createElement('monster-state');
* ```
*
* @externalExample ../../../example/components/state/state.mjs
* @startuml state.png
* skinparam monochrome true
* skinparam shadowing false
* HTMLElement <|-- CustomElement
* CustomElement <|-- CustomControl
* CustomControl <|-- State
* @enduml
* *
* @since 1.5.0 * @since 1.5.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Components.State * @summary States tell users that there’s a state. That's it!
* @summary States tell users that there’s a state. that s it! * @summary The state control is used in the log control, among other things.
*/ **/
class State extends CustomControl { class State extends CustomControl {
/** /**
* * @return {void}
* @return {Monster.Components.State.State}
*/ */
[assembleMethodSymbol]() { [assembleMethodSymbol]() {
super[assembleMethodSymbol](); super[assembleMethodSymbol]();
...@@ -77,7 +53,7 @@ class State extends CustomControl { ...@@ -77,7 +53,7 @@ class State extends CustomControl {
* @returns {symbol} * @returns {symbol}
*/ */
static get [instanceSymbol]() { static get [instanceSymbol]() {
return Symbol.for("@schukai/component-state/state"); return Symbol.for("@schukai/monster/components/state/state@@instance");
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment