@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
@@ -0,0 +1,271 @@
1
+ /**
2
+ * Copyright © schukai GmbH 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 schukai GmbH.
11
+ */
12
+
13
+ import {
14
+ assembleMethodSymbol,
15
+ registerCustomElement,
16
+ } from "../../dom/customelement.mjs";
17
+ import { DetailsStyleSheet } from "./stylesheet/details.mjs";
18
+ import { ATTRIBUTE_BUTTON_LABEL } from "../host/constants.mjs";
19
+ import { isString } from "../../types/is.mjs";
20
+ import { generateUniqueConfigKey } from "../host/util.mjs";
21
+ import { Collapse, nameSymbol } from "./collapse.mjs";
22
+ import { instanceSymbol } from "../../constants.mjs";
23
+
24
+ export { Details };
25
+
26
+ /**
27
+ * @private
28
+ * @type {symbol}
29
+ */
30
+ const buttonElementSymbol = Symbol("buttonElement");
31
+
32
+ /**
33
+ * @private
34
+ * @type {symbol}
35
+ */
36
+ const buttonEventHandlerSymbol = Symbol("buttonEventHandler");
37
+
38
+ /**
39
+ * The Details component is used to show a details.
40
+ *
41
+ * <img src="./images/details.png">
42
+ *
43
+ * Dependencies: the system uses functions of the [monsterjs](https://monsterjs.org/) library
44
+ *
45
+ * You can create this control either by specifying the HTML tag <monster-details />` directly in the HTML or using
46
+ * Javascript via the `document.createElement('monster-details');` method.
47
+ *
48
+ * ```html
49
+ * <monster-details></monster-details>
50
+ * ```
51
+ *
52
+ * Or you can create this CustomControl directly in Javascript:
53
+ *
54
+ * ```js
55
+ * import '@schukai/component-state/source/details.mjs';
56
+ * document.createElement('monster-details');
57
+ * ```
58
+ *
59
+ * The Body should have a class "hidden" to ensure that the styles are applied correctly.
60
+ *
61
+ * ```css
62
+ * body.hidden {
63
+ * visibility: hidden;
64
+ * }
65
+ * ```
66
+ *
67
+ * @startuml details.png
68
+ * skinparam monochrome true
69
+ * skinparam shadowing false
70
+ * HTMLElement <|-- CustomElement
71
+ * CustomElement <|-- Collapse
72
+ * Collapse <|-- Details
73
+ * @enduml
74
+ *
75
+ * @copyright schukai GmbH
76
+ * @memberOf Monster.Components.Layout
77
+ * @summary A simple details component
78
+ * @fires Monster.Components.Layout.Details.event:monster-details-before-open
79
+ * @fires Monster.Components.Layout.Details.event:monster-details-open
80
+ * @fires Monster.Components.Layout.Details.event:monster-details-before-close
81
+ * @fires Monster.Components.Layout.Details.event:monster-details-closed
82
+ */
83
+ class Details extends Collapse {
84
+ /**
85
+ * This method is called by the `instanceof` operator.
86
+ * @returns {symbol}
87
+ */
88
+ static get [instanceSymbol]() {
89
+ return Symbol.for("@schukai/monster/components/layout/details@@instance");
90
+ }
91
+
92
+ /**
93
+ *
94
+ */
95
+ constructor() {
96
+ super();
97
+ // the name is only used for the host config and the event name
98
+ this[nameSymbol] = "details";
99
+ }
100
+
101
+ /**
102
+ * To set the options via the html tag the attribute `data-monster-options` must be used.
103
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
104
+ *
105
+ * The individual configuration values can be found in the table.
106
+ *
107
+ * @property {Object} templates Template definitions
108
+ * @property {string} templates.main Main template
109
+ * @property {Object} classes CSS classes
110
+ * @property {string} classes.button CSS class for the button
111
+ * @property {Object} button Button configuration
112
+ * @property {string} button.label Button label
113
+ * @property {Object} features Feature configuration
114
+ * @property {boolean} features.accordion Enable accordion mode
115
+ * @property {boolean} features.persistState Persist the state in the host configuration
116
+ */
117
+ get defaults() {
118
+ return Object.assign({}, super.defaults, {
119
+ templates: {
120
+ main: getTemplate(),
121
+ },
122
+ labels: {
123
+ button: "Details",
124
+ },
125
+ });
126
+ }
127
+
128
+ /**
129
+ *
130
+ * @returns {Monster.Components.Layout.Details}
131
+ */
132
+ [assembleMethodSymbol]() {
133
+ super[assembleMethodSymbol]();
134
+
135
+ initButtonLabel.call(this);
136
+ initControlReferences.call(this);
137
+ initEventHandler.call(this);
138
+ }
139
+
140
+ connectedCallback() {
141
+ super.connectedCallback();
142
+
143
+ const containDocument = this.shadowRoot;
144
+
145
+ if (containDocument !== null) {
146
+ const previousElement = this.previousElementSibling;
147
+ if (previousElement && previousElement.tagName === "MONSTER-DETAILS") {
148
+ this[buttonElementSymbol].style.borderTop = "0";
149
+ }
150
+ }
151
+ }
152
+
153
+ /**
154
+ *
155
+ * @return {string}
156
+ */
157
+ static getTag() {
158
+ return "monster-details";
159
+ }
160
+
161
+ /**
162
+ * @return {Array<CSSStyleSheet>}
163
+ */
164
+ static getCSSStyleSheet() {
165
+ const css = super.getCSSStyleSheet();
166
+ css.push(DetailsStyleSheet);
167
+ return css;
168
+ }
169
+ }
170
+
171
+ /**
172
+ * @private
173
+ * @return {Select}
174
+ * @throws {Error} no shadow-root is defined
175
+ */
176
+ function initControlReferences() {
177
+ if (!this.shadowRoot) {
178
+ throw new Error("no shadow-root is defined");
179
+ }
180
+
181
+ this[buttonElementSymbol] = this.shadowRoot.querySelector(
182
+ "[data-monster-role=button]",
183
+ );
184
+ }
185
+
186
+ /**
187
+ * @private
188
+ */
189
+ function initEventHandler() {
190
+ if (!this.shadowRoot) {
191
+ throw new Error("no shadow-root is defined");
192
+ }
193
+
194
+ this[buttonEventHandlerSymbol] = (event) => {
195
+ this.toggle();
196
+ };
197
+
198
+ this[buttonElementSymbol].addEventListener(
199
+ "click",
200
+ this[buttonEventHandlerSymbol],
201
+ );
202
+
203
+ return this;
204
+ }
205
+
206
+ /**
207
+ * @private
208
+ * @return {string}
209
+ */
210
+ function initButtonLabel() {
211
+ let label;
212
+ const setLabel = false;
213
+ if (this.hasAttribute(ATTRIBUTE_BUTTON_LABEL)) {
214
+ label = this.getAttribute(ATTRIBUTE_BUTTON_LABEL);
215
+ } else {
216
+ label = this.innerText;
217
+ }
218
+
219
+ if (!isString(label)) {
220
+ label = "";
221
+ }
222
+
223
+ label = label.trim();
224
+
225
+ if (label === "") {
226
+ label = this.getOption("labels.button", "Details");
227
+ }
228
+
229
+ if (label.length > 100) {
230
+ label = `${label.substring(0, 99)}…`;
231
+ }
232
+
233
+ this.setAttribute(ATTRIBUTE_BUTTON_LABEL, label);
234
+ this.setOption("labels.button", label);
235
+
236
+ return label;
237
+ }
238
+
239
+ /**
240
+ * @private
241
+ * @returns {string}
242
+ */
243
+ function getConfigKey() {
244
+ return generateUniqueConfigKey("details", this.id, "state");
245
+ }
246
+
247
+ /**
248
+ * @private
249
+ * @return {string}
250
+ */
251
+ function getTemplate() {
252
+ // language=HTML
253
+ return `
254
+ <div data-monster-role="control" part="control" class="overflow-hidden">
255
+ <div data-monster-role="summary" part="summary">
256
+ <button part="button" data-monster-attributes="class path:classes.button"
257
+ data-monster-role="button"
258
+ data-monster-replace="path:labels.button | default:click me">click me
259
+ </button>
260
+ </div>
261
+ <div data-monster-role="detail">
262
+ <div data-monster-attributes="class path:classes.container" part="container"
263
+ data-monster-role="container">
264
+ <slot></slot>
265
+ </div>
266
+ <div class="deco-line" data-monster-role="deco"></div>
267
+ </div>
268
+ </div>`;
269
+ }
270
+
271
+ registerCustomElement(Details);
@@ -116,6 +116,12 @@ class Panel extends CustomElement {
116
116
  connectedCallback() {
117
117
  super.connectedCallback();
118
118
  attachResizeObserver.call(this);
119
+
120
+ // disable scrolling in parent node
121
+ if (this.parentNode && this.parentNode instanceof HTMLElement) {
122
+ this.parentNode.style.overflow = "hidden";
123
+ }
124
+
119
125
  }
120
126
 
121
127
  /**