@schukai/monster 4.101.0 → 4.103.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Copyright © Volker Schukai and all contributing authors, {{copyRightYear}}. All rights reserved.
3
+ * Node module: @schukai/monster
4
+ *
5
+ * This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
6
+ * The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
7
+ *
8
+ * For those who do not wish to adhere to the AGPLv3, a commercial license is available.
9
+ * Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
10
+ * For more information about purchasing a commercial license, please contact Volker Schukai.
11
+ *
12
+ * SPDX-License-Identifier: AGPL-3.0
13
+ */
14
+
15
+ import { instanceSymbol } from "../../constants.mjs";
16
+ import { registerCustomElement } from "../../dom/customelement.mjs";
17
+ import { ContextHelpStyleSheet } from "./stylesheet/context-help.mjs";
18
+ import { ThemeStyleSheet } from "../stylesheet/theme.mjs";
19
+ import { ContextBase } from "./context-base.mjs";
20
+
21
+ export { ContextInfo };
22
+
23
+ /**
24
+ * A context info control.
25
+ *
26
+ * @fragments /fragments/components/form/context-info
27
+ *
28
+ * @since 3.55.0
29
+ * @copyright Volker Schukai
30
+ * @summary A context info control
31
+ */
32
+ class ContextInfo extends ContextBase {
33
+ /**
34
+ * This method is called by the `instanceof` operator.
35
+ * @return {symbol}
36
+ */
37
+ static get [instanceSymbol]() {
38
+ return Symbol.for(
39
+ "@schukai/monster/components/form/context-info@@instance",
40
+ );
41
+ }
42
+
43
+ /**
44
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
45
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
46
+ *
47
+ * The individual configuration values can be found in the table.
48
+ *
49
+ * @property {Object} templates - The templates for the control.
50
+ * @property {string} templates.main - The main template.
51
+ * @property {string} mode - The mode of the popper. Possible values are `click`, `enter` and `hover`.
52
+ * @property {string} content - The content of the popper.
53
+ * @property {object} popper - The popper options.
54
+ * @property {string} popper.placement - The placement of the popper.
55
+ * @property {Object} classes - Custom CSS classes.
56
+ * @property {string} classes.button - CSS class for the button element.
57
+ */
58
+ get defaults() {
59
+ return Object.assign({}, super.defaults, {
60
+ templates: {
61
+ main: getTemplate(),
62
+ },
63
+ mode: "auto",
64
+ classes: {
65
+ button: "monster-theme-primary-2",
66
+ },
67
+ });
68
+ }
69
+
70
+ /**
71
+ * @return {string}
72
+ */
73
+ static getTag() {
74
+ return "monster-context-info";
75
+ }
76
+
77
+ /**
78
+ * @return {CSSStyleSheet[]}
79
+ */
80
+ static getCSSStyleSheet() {
81
+ return [ContextHelpStyleSheet, ThemeStyleSheet];
82
+ }
83
+ }
84
+
85
+ /**
86
+ * @private
87
+ * @return {string}
88
+ */
89
+ function getTemplate() {
90
+ // language=HTML
91
+ return `
92
+ <div data-monster-role="control" part="control">
93
+
94
+ <div data-monster-role="button"
95
+ data-monster-attributes="class path:classes.button"
96
+ part="button"><svg class="hidden"
97
+ xmlns="http://www.w3.org/2000/svg"
98
+ width="1.2em"
99
+ height="1.2em"
100
+ fill="currentColor"
101
+ viewBox="0 0 16 16">
102
+ <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
103
+ <path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/>
104
+ </svg></div>
105
+
106
+ <div data-monster-role="popper" part="popper" tabindex="-1" class="monster-color-primary-1">
107
+ <div data-monster-role="arrow"></div>
108
+ <div part="content" class="flex">
109
+ <slot></slot>
110
+ </div>
111
+ </div>
112
+
113
+ </div>
114
+ `;
115
+ }
116
+
117
+ registerCustomElement(ContextInfo);
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Copyright © Volker Schukai and all contributing authors, {{copyRightYear}}. All rights reserved.
3
+ * Node module: @schukai/monster
4
+ *
5
+ * This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
6
+ * The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
7
+ *
8
+ * For those who do not wish to adhere to the AGPLv3, a commercial license is available.
9
+ * Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
10
+ * For more information about purchasing a commercial license, please contact Volker Schukai.
11
+ *
12
+ * SPDX-License-Identifier: AGPL-3.0
13
+ */
14
+
15
+ import { instanceSymbol } from "../../constants.mjs";
16
+ import { registerCustomElement } from "../../dom/customelement.mjs";
17
+ import { ContextHelpStyleSheet } from "./stylesheet/context-help.mjs";
18
+ import { ThemeStyleSheet } from "../stylesheet/theme.mjs";
19
+ import { ContextBase } from "./context-base.mjs";
20
+
21
+ export { ContextNote };
22
+
23
+ /**
24
+ * A context note control.
25
+ *
26
+ * @fragments /fragments/components/form/context-note
27
+ *
28
+ * @since 3.55.0
29
+ * @copyright Volker Schukai
30
+ * @summary A context note control
31
+ */
32
+ class ContextNote extends ContextBase {
33
+ /**
34
+ * This method is called by the `instanceof` operator.
35
+ * @return {symbol}
36
+ */
37
+ static get [instanceSymbol]() {
38
+ return Symbol.for(
39
+ "@schukai/monster/components/form/context-note@@instance",
40
+ );
41
+ }
42
+
43
+ /**
44
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
45
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
46
+ *
47
+ * The individual configuration values can be found in the table.
48
+ *
49
+ * @property {Object} templates - The templates for the control.
50
+ * @property {string} templates.main - The main template.
51
+ * @property {string} mode - The mode of the popper. Possible values are `click`, `enter` and `hover`.
52
+ * @property {string} content - The content of the popper.
53
+ * @property {object} popper - The popper options.
54
+ * @property {string} popper.placement - The placement of the popper.
55
+ * @property {Object} classes - Custom CSS classes.
56
+ * @property {string} classes.button - CSS class for the button element.
57
+ */
58
+ get defaults() {
59
+ return Object.assign({}, super.defaults, {
60
+ templates: {
61
+ main: getTemplate(),
62
+ },
63
+ mode: "auto",
64
+ classes: {
65
+ button: "monster-theme-secondary-2",
66
+ },
67
+ });
68
+ }
69
+
70
+ /**
71
+ * @return {string}
72
+ */
73
+ static getTag() {
74
+ return "monster-context-note";
75
+ }
76
+
77
+ /**
78
+ * @return {CSSStyleSheet[]}
79
+ */
80
+ static getCSSStyleSheet() {
81
+ return [ContextHelpStyleSheet, ThemeStyleSheet];
82
+ }
83
+ }
84
+
85
+ /**
86
+ * @private
87
+ * @return {string}
88
+ */
89
+ function getTemplate() {
90
+ // language=HTML
91
+ return `
92
+ <div data-monster-role="control" part="control">
93
+
94
+ <div data-monster-role="button"
95
+ data-monster-attributes="class path:classes.button"
96
+ part="button"><svg class="hidden"
97
+ xmlns="http://www.w3.org/2000/svg"
98
+ width="1.2em"
99
+ height="1.2em"
100
+ fill="currentColor"
101
+ viewBox="0 0 16 16">
102
+ <path d="M5 4a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1zm-.5 2.5A.5.5 0 0 1 5 6h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5M5 8a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1zm0 2a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z"/>
103
+ <path d="M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2zm10-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1"/>
104
+ </svg></div>
105
+
106
+ <div data-monster-role="popper" part="popper" tabindex="-1" class="monster-color-primary-1">
107
+ <div data-monster-role="arrow"></div>
108
+ <div part="content" class="flex">
109
+ <slot></slot>
110
+ </div>
111
+ </div>
112
+
113
+ </div>
114
+ `;
115
+ }
116
+
117
+ registerCustomElement(ContextNote);
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Copyright © Volker Schukai and all contributing authors, {{copyRightYear}}. All rights reserved.
3
+ * Node module: @schukai/monster
4
+ *
5
+ * This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
6
+ * The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
7
+ *
8
+ * For those who do not wish to adhere to the AGPLv3, a commercial license is available.
9
+ * Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
10
+ * For more information about purchasing a commercial license, please contact Volker Schukai.
11
+ *
12
+ * SPDX-License-Identifier: AGPL-3.0
13
+ */
14
+
15
+ import { instanceSymbol } from "../../constants.mjs";
16
+ import { registerCustomElement } from "../../dom/customelement.mjs";
17
+ import { ContextHelpStyleSheet } from "./stylesheet/context-help.mjs";
18
+ import { ThemeStyleSheet } from "../stylesheet/theme.mjs";
19
+ import { ContextBase } from "./context-base.mjs";
20
+
21
+ export { ContextSuccess };
22
+
23
+ /**
24
+ * A context success control.
25
+ *
26
+ * @fragments /fragments/components/form/context-success
27
+ *
28
+ * @since 3.55.0
29
+ * @copyright Volker Schukai
30
+ * @summary A context success control
31
+ */
32
+ class ContextSuccess extends ContextBase {
33
+ /**
34
+ * This method is called by the `instanceof` operator.
35
+ * @return {symbol}
36
+ */
37
+ static get [instanceSymbol]() {
38
+ return Symbol.for(
39
+ "@schukai/monster/components/form/context-success@@instance",
40
+ );
41
+ }
42
+
43
+ /**
44
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
45
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
46
+ *
47
+ * The individual configuration values can be found in the table.
48
+ *
49
+ * @property {Object} templates - The templates for the control.
50
+ * @property {string} templates.main - The main template.
51
+ * @property {string} mode - The mode of the popper. Possible values are `click`, `enter` and `hover`.
52
+ * @property {string} content - The content of the popper.
53
+ * @property {object} popper - The popper options.
54
+ * @property {string} popper.placement - The placement of the popper.
55
+ * @property {Object} classes - Custom CSS classes.
56
+ * @property {string} classes.button - CSS class for the button element.
57
+ */
58
+ get defaults() {
59
+ return Object.assign({}, super.defaults, {
60
+ templates: {
61
+ main: getTemplate(),
62
+ },
63
+ mode: "auto",
64
+ classes: {
65
+ button: "monster-theme-success-2",
66
+ },
67
+ });
68
+ }
69
+
70
+ /**
71
+ * @return {string}
72
+ */
73
+ static getTag() {
74
+ return "monster-context-success";
75
+ }
76
+
77
+ /**
78
+ * @return {CSSStyleSheet[]}
79
+ */
80
+ static getCSSStyleSheet() {
81
+ return [ContextHelpStyleSheet, ThemeStyleSheet];
82
+ }
83
+ }
84
+
85
+ /**
86
+ * @private
87
+ * @return {string}
88
+ */
89
+ function getTemplate() {
90
+ // language=HTML
91
+ return `
92
+ <div data-monster-role="control" part="control">
93
+
94
+ <div data-monster-role="button"
95
+ data-monster-attributes="class path:classes.button"
96
+ part="button"><svg class="hidden"
97
+ xmlns="http://www.w3.org/2000/svg"
98
+ width="1.2em"
99
+ height="1.2em"
100
+ fill="currentColor"
101
+ viewBox="0 0 16 16">
102
+ <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
103
+ <path d="m10.97 4.97-.02.022-3.473 4.425-2.093-2.094a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05"/>
104
+ </svg></div>
105
+
106
+ <div data-monster-role="popper" part="popper" tabindex="-1" class="monster-color-primary-1">
107
+ <div data-monster-role="arrow"></div>
108
+ <div part="content" class="flex">
109
+ <slot></slot>
110
+ </div>
111
+ </div>
112
+
113
+ </div>
114
+ `;
115
+ }
116
+
117
+ registerCustomElement(ContextSuccess);
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Copyright © Volker Schukai and all contributing authors, {{copyRightYear}}. All rights reserved.
3
+ * Node module: @schukai/monster
4
+ *
5
+ * This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
6
+ * The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
7
+ *
8
+ * For those who do not wish to adhere to the AGPLv3, a commercial license is available.
9
+ * Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
10
+ * For more information about purchasing a commercial license, please contact Volker Schukai.
11
+ *
12
+ * SPDX-License-Identifier: AGPL-3.0
13
+ */
14
+
15
+ import { instanceSymbol } from "../../constants.mjs";
16
+ import { registerCustomElement } from "../../dom/customelement.mjs";
17
+ import { ContextHelpStyleSheet } from "./stylesheet/context-help.mjs";
18
+ import { ThemeStyleSheet } from "../stylesheet/theme.mjs";
19
+ import { ContextBase } from "./context-base.mjs";
20
+
21
+ export { ContextWarning };
22
+
23
+ /**
24
+ * A context warning control.
25
+ *
26
+ * @fragments /fragments/components/form/context-warning
27
+ *
28
+ * @since 3.55.0
29
+ * @copyright Volker Schukai
30
+ * @summary A context warning control
31
+ */
32
+ class ContextWarning extends ContextBase {
33
+ /**
34
+ * This method is called by the `instanceof` operator.
35
+ * @return {symbol}
36
+ */
37
+ static get [instanceSymbol]() {
38
+ return Symbol.for(
39
+ "@schukai/monster/components/form/context-warning@@instance",
40
+ );
41
+ }
42
+
43
+ /**
44
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
45
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
46
+ *
47
+ * The individual configuration values can be found in the table.
48
+ *
49
+ * @property {Object} templates - The templates for the control.
50
+ * @property {string} templates.main - The main template.
51
+ * @property {string} mode - The mode of the popper. Possible values are `click`, `enter` and `hover`.
52
+ * @property {string} content - The content of the popper.
53
+ * @property {object} popper - The popper options.
54
+ * @property {string} popper.placement - The placement of the popper.
55
+ * @property {Object} classes - Custom CSS classes.
56
+ * @property {string} classes.button - CSS class for the button element.
57
+ */
58
+ get defaults() {
59
+ return Object.assign({}, super.defaults, {
60
+ templates: {
61
+ main: getTemplate(),
62
+ },
63
+ mode: "auto",
64
+ classes: {
65
+ button: "monster-theme-warning-2",
66
+ },
67
+ });
68
+ }
69
+
70
+ /**
71
+ * @return {string}
72
+ */
73
+ static getTag() {
74
+ return "monster-context-warning";
75
+ }
76
+
77
+ /**
78
+ * @return {CSSStyleSheet[]}
79
+ */
80
+ static getCSSStyleSheet() {
81
+ return [ContextHelpStyleSheet, ThemeStyleSheet];
82
+ }
83
+ }
84
+
85
+ /**
86
+ * @private
87
+ * @return {string}
88
+ */
89
+ function getTemplate() {
90
+ // language=HTML
91
+ return `
92
+ <div data-monster-role="control" part="control">
93
+
94
+ <div data-monster-role="button"
95
+ data-monster-attributes="class path:classes.button"
96
+ part="button"><svg class="hidden"
97
+ xmlns="http://www.w3.org/2000/svg"
98
+ width="1.2em"
99
+ height="1.2em"
100
+ fill="currentColor"
101
+ viewBox="0 0 16 16">
102
+ <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
103
+ <path d="M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z"/>
104
+ </svg></div>
105
+
106
+ <div data-monster-role="popper" part="popper" tabindex="-1" class="monster-color-primary-1">
107
+ <div data-monster-role="arrow"></div>
108
+ <div part="content" class="flex">
109
+ <slot></slot>
110
+ </div>
111
+ </div>
112
+
113
+ </div>
114
+ `;
115
+ }
116
+
117
+ registerCustomElement(ContextWarning);