@schukai/monster 3.64.0 → 3.65.0

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.
Files changed (122) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/example/components/form/button.mjs +1 -1
  3. package/example/components/form/field-set.mjs +4 -0
  4. package/example/components/form/select.mjs +1 -1
  5. package/package.json +2 -1
  6. package/source/components/datatable/datatable/header.mjs +228 -221
  7. package/source/components/datatable/style/dataset.pcss +1 -0
  8. package/source/components/datatable/style/datatable.pcss +1 -0
  9. package/source/components/datatable/stylesheet/change-button.mjs +8 -4
  10. package/source/components/datatable/stylesheet/column-bar.mjs +8 -4
  11. package/source/components/datatable/stylesheet/dataset.mjs +9 -5
  12. package/source/components/datatable/stylesheet/datasource.mjs +8 -4
  13. package/source/components/datatable/stylesheet/datatable.mjs +9 -5
  14. package/source/components/datatable/stylesheet/embedded-pagination.mjs +8 -4
  15. package/source/components/datatable/stylesheet/filter-button.mjs +8 -4
  16. package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +8 -4
  17. package/source/components/datatable/stylesheet/filter-date-range.mjs +8 -4
  18. package/source/components/datatable/stylesheet/filter-range.mjs +8 -4
  19. package/source/components/datatable/stylesheet/filter.mjs +8 -4
  20. package/source/components/datatable/stylesheet/pagination.mjs +8 -4
  21. package/source/components/datatable/stylesheet/save-button.mjs +8 -4
  22. package/source/components/datatable/stylesheet/select-filter.mjs +8 -4
  23. package/source/components/datatable/stylesheet/status.mjs +8 -4
  24. package/source/components/form/button.mjs +263 -281
  25. package/source/components/form/field-set.mjs +300 -0
  26. package/source/components/form/popper.mjs +13 -480
  27. package/source/components/form/style/field-set.pcss +13 -0
  28. package/source/components/form/stylesheet/action-button.mjs +8 -4
  29. package/source/components/form/stylesheet/api-button.mjs +8 -4
  30. package/source/components/form/stylesheet/button-bar.mjs +9 -5
  31. package/source/components/form/stylesheet/button.mjs +8 -4
  32. package/source/components/form/stylesheet/confirm-button.mjs +9 -5
  33. package/source/components/form/stylesheet/context-error.mjs +8 -4
  34. package/source/components/form/stylesheet/context-help.mjs +8 -4
  35. package/source/components/form/stylesheet/field-set.mjs +31 -0
  36. package/source/components/form/stylesheet/form.mjs +9 -5
  37. package/source/components/form/stylesheet/message-state-button.mjs +8 -4
  38. package/source/components/form/stylesheet/popper-button.mjs +8 -4
  39. package/source/components/form/stylesheet/select.mjs +8 -4
  40. package/source/components/form/stylesheet/state-button.mjs +8 -4
  41. package/source/components/form/stylesheet/toggle-switch.mjs +8 -4
  42. package/source/components/form/stylesheet/tree-select.mjs +8 -4
  43. package/source/components/host/collapse.mjs +14 -516
  44. package/source/components/host/config-manager.mjs +9 -2
  45. package/source/components/host/constants.mjs +9 -4
  46. package/source/components/host/details.mjs +14 -253
  47. package/source/components/host/stylesheet/call-button.mjs +8 -4
  48. package/source/components/host/stylesheet/config-manager.mjs +8 -4
  49. package/source/components/host/stylesheet/host.mjs +9 -5
  50. package/source/components/host/stylesheet/overlay.mjs +9 -5
  51. package/source/components/host/stylesheet/toggle-button.mjs +8 -4
  52. package/source/components/host/stylesheet/viewer.mjs +8 -4
  53. package/source/components/layout/collapse.mjs +542 -0
  54. package/source/components/layout/details.mjs +271 -0
  55. package/source/components/layout/panel.mjs +6 -0
  56. package/source/components/layout/popper.mjs +476 -0
  57. package/source/components/{host → layout}/stylesheet/collapse.mjs +8 -4
  58. package/source/components/{host → layout}/stylesheet/details.mjs +8 -4
  59. package/source/components/layout/stylesheet/panel.mjs +8 -4
  60. package/source/components/{form → layout}/stylesheet/popper.mjs +8 -4
  61. package/source/components/layout/stylesheet/split-panel.mjs +8 -4
  62. package/source/components/layout/stylesheet/tabs.mjs +8 -4
  63. package/source/components/layout/stylesheet/width-toggle.mjs +8 -4
  64. package/source/components/layout/tabs.mjs +3 -3
  65. package/source/components/layout/width-toggle.mjs +3 -3
  66. package/source/components/navigation/style/table-of-content.pcss +84 -0
  67. package/source/components/navigation/stylesheet/table-of-content.mjs +31 -0
  68. package/source/components/navigation/table-of-content.mjs +418 -0
  69. package/source/components/notify/stylesheet/message.mjs +8 -4
  70. package/source/components/notify/stylesheet/notify.mjs +8 -4
  71. package/source/components/state/stylesheet/log.mjs +8 -4
  72. package/source/components/state/stylesheet/state.mjs +9 -5
  73. package/source/components/style/link.pcss +0 -1
  74. package/source/components/style/mixin/typography.pcss +7 -7
  75. package/source/components/style/typography.pcss +1 -1
  76. package/source/components/stylesheet/badge.mjs +8 -4
  77. package/source/components/stylesheet/border.mjs +8 -4
  78. package/source/components/stylesheet/button.mjs +8 -4
  79. package/source/components/stylesheet/card.mjs +8 -4
  80. package/source/components/stylesheet/color.mjs +8 -4
  81. package/source/components/stylesheet/common.mjs +8 -4
  82. package/source/components/stylesheet/control.mjs +8 -4
  83. package/source/components/stylesheet/data-grid.mjs +8 -4
  84. package/source/components/stylesheet/display.mjs +8 -4
  85. package/source/components/stylesheet/floating-ui.mjs +8 -4
  86. package/source/components/stylesheet/form.mjs +8 -4
  87. package/source/components/stylesheet/host.mjs +8 -4
  88. package/source/components/stylesheet/icons.mjs +8 -4
  89. package/source/components/stylesheet/link.mjs +8 -4
  90. package/source/components/stylesheet/mixin/badge.mjs +31 -0
  91. package/source/components/stylesheet/mixin/button.mjs +31 -0
  92. package/source/components/stylesheet/mixin/form.mjs +31 -0
  93. package/source/components/stylesheet/mixin/hover.mjs +31 -0
  94. package/source/components/stylesheet/mixin/icon.mjs +31 -0
  95. package/source/components/stylesheet/mixin/media.mjs +31 -0
  96. package/source/components/stylesheet/mixin/property.mjs +31 -0
  97. package/source/components/stylesheet/mixin/skeleton.mjs +31 -0
  98. package/source/components/stylesheet/mixin/spinner.mjs +31 -0
  99. package/source/components/stylesheet/mixin/typography.mjs +31 -0
  100. package/source/components/stylesheet/normalize.mjs +8 -4
  101. package/source/components/stylesheet/popper.mjs +8 -4
  102. package/source/components/stylesheet/property.mjs +8 -4
  103. package/source/components/stylesheet/ripple.mjs +8 -4
  104. package/source/components/stylesheet/skeleton.mjs +8 -4
  105. package/source/components/stylesheet/space.mjs +8 -4
  106. package/source/components/stylesheet/spinner.mjs +8 -4
  107. package/source/components/stylesheet/table.mjs +8 -4
  108. package/source/components/stylesheet/theme.mjs +8 -4
  109. package/source/components/stylesheet/typography.mjs +9 -5
  110. package/source/components/tree-menu/stylesheet/tree-menu.mjs +8 -4
  111. package/source/dom/ready.mjs +10 -4
  112. package/source/monster.mjs +17 -80
  113. package/source/types/proxyobserver.mjs +4 -2
  114. package/source/types/version.mjs +1 -1
  115. package/test/cases/monster.mjs +1 -1
  116. package/test/web/tests.js +4 -4
  117. package/source/components/form/form-field.mjs +0 -341
  118. package/source/components/form/style/form-field.pcss +0 -4
  119. package/source/components/form/stylesheet/form-field.mjs +0 -27
  120. /package/source/components/{host → layout}/style/collapse.pcss +0 -0
  121. /package/source/components/{host → layout}/style/details.pcss +0 -0
  122. /package/source/components/{form → layout}/style/popper.pcss +0 -0
@@ -1,265 +1,26 @@
1
1
  /**
2
- * Copyright 2023 schukai GmbH
3
- * SPDX-License-Identifier: AGPL-3.0
4
- */
5
-
6
- import {
7
- assembleMethodSymbol,
8
- registerCustomElement,
9
- } from "../../dom/customelement.mjs";
10
- import { Host } from "./host.mjs";
11
- import { DetailsStyleSheet } from "./stylesheet/details.mjs";
12
- import { ATTRIBUTE_BUTTON_LABEL } from "./constants.mjs";
13
- import { isString } from "../../types/is.mjs";
14
- import { generateUniqueConfigKey } from "./util.mjs";
15
- import { Collapse, nameSymbol } from "./collapse.mjs";
16
- import { instanceSymbol } from "../../constants.mjs";
17
-
18
- export { Details };
19
-
20
- /**
21
- * @private
22
- * @type {symbol}
23
- */
24
- const buttonElementSymbol = Symbol("buttonElement");
25
-
26
- /**
27
- * @private
28
- * @type {symbol}
29
- */
30
- const buttonEventHandlerSymbol = Symbol("buttonEventHandler");
31
-
32
- /**
33
- * The Details component is used to show a details.
34
- *
35
- * <img src="./images/details.png">
36
- *
37
- * Dependencies: the system uses functions of the [monsterjs](https://monsterjs.org/) library
2
+ * Copyright © schukai GmbH and all contributing authors, {{copyRightYear}}. All rights reserved.
3
+ * Node module: @schukai/monster
38
4
  *
39
- * You can create this control either by specifying the HTML tag <monster-details />` directly in the HTML or using
40
- * Javascript via the `document.createElement('monster-details');` method.
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
41
7
  *
42
- * ```html
43
- * <monster-details></monster-details>
44
- * ```
45
- *
46
- * Or you can create this CustomControl directly in Javascript:
47
- *
48
- * ```js
49
- * import '@schukai/component-state/source/details.mjs';
50
- * document.createElement('monster-details');
51
- * ```
52
- *
53
- * The Body should have a class "hidden" to ensure that the styles are applied correctly.
54
- *
55
- * ```css
56
- * body.hidden {
57
- * visibility: hidden;
58
- * }
59
- * ```
60
- *
61
- * @startuml details.png
62
- * skinparam monochrome true
63
- * skinparam shadowing false
64
- * HTMLElement <|-- CustomElement
65
- * CustomElement <|-- Collapse
66
- * Collapse <|-- Details
67
- * @enduml
68
- *
69
- * @copyright schukai GmbH
70
- * @memberOf Monster.Components.Host
71
- * @summary A simple details component
72
- * @fires Monster.Components.Host.Details.event:monster-details-before-open
73
- * @fires Monster.Components.Host.Details.event:monster-details-open
74
- * @fires Monster.Components.Host.Details.event:monster-details-before-close
75
- * @fires Monster.Components.Host.Details.event:monster-details-closed
76
- */
77
- class Details extends Collapse {
78
- /**
79
- * This method is called by the `instanceof` operator.
80
- * @returns {symbol}
81
- */
82
- static get [instanceSymbol]() {
83
- return Symbol.for("@schukai/component-host/details@@instance");
84
- }
85
-
86
- /**
87
- *
88
- */
89
- constructor() {
90
- super();
91
- // the name is only used for the host config and the event name
92
- this[nameSymbol] = "details";
93
- }
94
-
95
- /**
96
- * To set the options via the html tag the attribute `data-monster-options` must be used.
97
- * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
98
- *
99
- * The individual configuration values can be found in the table.
100
- *
101
- * @property {Object} templates Template definitions
102
- * @property {string} templates.main Main template
103
- * @property {Object} classes CSS classes
104
- * @property {string} classes.button CSS class for the button
105
- * @property {Object} button Button configuration
106
- * @property {string} button.label Button label
107
- * @property {Object} features Feature configuration
108
- * @property {boolean} features.accordion Enable accordion mode
109
- * @property {boolean} features.persistState Persist the state in the host configuration
110
- */
111
- get defaults() {
112
- return Object.assign({}, super.defaults, {
113
- templates: {
114
- main: getTemplate(),
115
- },
116
- labels: {
117
- button: "Details",
118
- },
119
- });
120
- }
121
-
122
- /**
123
- *
124
- * @returns {Monster.Components.Host.Details}
125
- */
126
- [assembleMethodSymbol]() {
127
- super[assembleMethodSymbol]();
128
-
129
- initButtonLabel.call(this);
130
- initControlReferences.call(this);
131
- initEventHandler.call(this);
132
- }
133
-
134
- connectedCallback() {
135
- super.connectedCallback();
136
-
137
- const containDocument = this.shadowRoot;
138
-
139
- if (containDocument !== null) {
140
- const previousElement = this.previousElementSibling;
141
- if (previousElement && previousElement.tagName === "MONSTER-DETAILS") {
142
- this[buttonElementSymbol].style.borderTop = "0";
143
- }
144
- }
145
- }
146
-
147
- /**
148
- *
149
- * @return {string}
150
- */
151
- static getTag() {
152
- return "monster-details";
153
- }
154
-
155
- /**
156
- * @return {Array<CSSStyleSheet>}
157
- */
158
- static getCSSStyleSheet() {
159
- const css = super.getCSSStyleSheet();
160
- css.push(DetailsStyleSheet);
161
- return css;
162
- }
163
- }
164
-
165
- /**
166
- * @private
167
- * @return {Select}
168
- * @throws {Error} no shadow-root is defined
169
- */
170
- function initControlReferences() {
171
- if (!this.shadowRoot) {
172
- throw new Error("no shadow-root is defined");
173
- }
174
-
175
- this[buttonElementSymbol] = this.shadowRoot.querySelector(
176
- "[data-monster-role=button]",
177
- );
178
- }
179
-
180
- /**
181
- * @private
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 schukai GmbH.
182
11
  */
183
- function initEventHandler() {
184
- if (!this.shadowRoot) {
185
- throw new Error("no shadow-root is defined");
186
- }
187
12
 
188
- this[buttonEventHandlerSymbol] = (event) => {
189
- this.toggle();
190
- };
191
-
192
- this[buttonElementSymbol].addEventListener(
193
- "click",
194
- this[buttonEventHandlerSymbol],
195
- );
196
-
197
- return this;
198
- }
13
+ import { Collapse as NewCollapse } from "../layout/collapse.mjs";
14
+ export { Details };
199
15
 
200
16
  /**
201
- * @private
202
- * @return {string}
17
+ * @since 1.10.0
18
+ * @copyright schukai GmbH
19
+ * @memberOf Monster.Components.Form
20
+ * @deprecated since 3.64.0 use {@link Monster.Components.Layout.Details}
203
21
  */
204
- function initButtonLabel() {
205
- let label;
206
- const setLabel = false;
207
- if (this.hasAttribute(ATTRIBUTE_BUTTON_LABEL)) {
208
- label = this.getAttribute(ATTRIBUTE_BUTTON_LABEL);
209
- } else {
210
- label = this.innerText;
211
- }
212
-
213
- if (!isString(label)) {
214
- label = "";
215
- }
216
-
217
- label = label.trim();
218
-
219
- if (label === "") {
220
- label = this.getOption("labels.button", "Details");
221
- }
222
-
223
- if (label.length > 100) {
224
- label = `${label.substring(0, 99)}…`;
225
- }
226
-
227
- this.setAttribute(ATTRIBUTE_BUTTON_LABEL, label);
228
- this.setOption("labels.button", label);
22
+ class Details extends NewCollapse {
229
23
 
230
- return label;
231
24
  }
232
25
 
233
- /**
234
- * @private
235
- * @returns {string}
236
- */
237
- function getConfigKey() {
238
- return generateUniqueConfigKey("details", this.id, "state");
239
- }
240
-
241
- /**
242
- * @private
243
- * @return {string}
244
- */
245
- function getTemplate() {
246
- // language=HTML
247
- return `
248
- <div data-monster-role="control" part="control" class="overflow-hidden">
249
- <div data-monster-role="summary" part="summary">
250
- <button part="button" data-monster-attributes="class path:classes.button"
251
- data-monster-role="button"
252
- data-monster-replace="path:labels.button | default:click me">click me
253
- </button>
254
- </div>
255
- <div data-monster-role="detail">
256
- <div data-monster-attributes="class path:classes.container" part="container"
257
- data-monster-role="container">
258
- <slot></slot>
259
- </div>
260
- <div class="deco-line" data-monster-role="deco"></div>
261
- </div>
262
- </div>`;
263
- }
264
26
 
265
- registerCustomElement(Details);
@@ -1,9 +1,13 @@
1
-
2
1
  /**
3
- * Copyright schukai GmbH and contributors 2024. All Rights Reserved.
2
+ * Copyright © schukai GmbH and all contributing authors, 2024. All rights reserved.
4
3
  * Node module: @schukai/monster
5
- * This file is licensed under the AGPLv3 License.
6
- * License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
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 schukai GmbH.
7
11
  */
8
12
 
9
13
  import {addAttributeToken} from "../../../dom/attributes.mjs";
@@ -1,9 +1,13 @@
1
-
2
1
  /**
3
- * Copyright schukai GmbH and contributors 2024. All Rights Reserved.
2
+ * Copyright © schukai GmbH and all contributing authors, 2024. All rights reserved.
4
3
  * Node module: @schukai/monster
5
- * This file is licensed under the AGPLv3 License.
6
- * License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
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 schukai GmbH.
7
11
  */
8
12
 
9
13
  import {addAttributeToken} from "../../../dom/attributes.mjs";