@schukai/monster 3.64.0 → 3.65.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +32 -0
- package/example/components/form/button.mjs +1 -1
- package/example/components/form/field-set.mjs +4 -0
- package/example/components/form/select.mjs +1 -1
- package/package.json +2 -1
- package/source/components/datatable/datatable/header.mjs +228 -221
- package/source/components/datatable/style/dataset.pcss +1 -0
- package/source/components/datatable/style/datatable.pcss +1 -0
- package/source/components/datatable/stylesheet/change-button.mjs +8 -4
- package/source/components/datatable/stylesheet/column-bar.mjs +8 -4
- package/source/components/datatable/stylesheet/dataset.mjs +9 -5
- package/source/components/datatable/stylesheet/datasource.mjs +8 -4
- package/source/components/datatable/stylesheet/datatable.mjs +9 -5
- package/source/components/datatable/stylesheet/embedded-pagination.mjs +8 -4
- package/source/components/datatable/stylesheet/filter-button.mjs +8 -4
- package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +8 -4
- package/source/components/datatable/stylesheet/filter-date-range.mjs +8 -4
- package/source/components/datatable/stylesheet/filter-range.mjs +8 -4
- package/source/components/datatable/stylesheet/filter.mjs +8 -4
- package/source/components/datatable/stylesheet/pagination.mjs +8 -4
- package/source/components/datatable/stylesheet/save-button.mjs +8 -4
- package/source/components/datatable/stylesheet/select-filter.mjs +8 -4
- package/source/components/datatable/stylesheet/status.mjs +8 -4
- package/source/components/form/button.mjs +263 -281
- package/source/components/form/field-set.mjs +300 -0
- package/source/components/form/popper.mjs +13 -480
- package/source/components/form/style/field-set.pcss +13 -0
- package/source/components/form/stylesheet/action-button.mjs +8 -4
- package/source/components/form/stylesheet/api-button.mjs +8 -4
- package/source/components/form/stylesheet/button-bar.mjs +9 -5
- package/source/components/form/stylesheet/button.mjs +8 -4
- package/source/components/form/stylesheet/confirm-button.mjs +9 -5
- package/source/components/form/stylesheet/context-error.mjs +8 -4
- package/source/components/form/stylesheet/context-help.mjs +8 -4
- package/source/components/form/stylesheet/field-set.mjs +31 -0
- package/source/components/form/stylesheet/form.mjs +9 -5
- package/source/components/form/stylesheet/message-state-button.mjs +8 -4
- package/source/components/form/stylesheet/popper-button.mjs +8 -4
- package/source/components/form/stylesheet/select.mjs +8 -4
- package/source/components/form/stylesheet/state-button.mjs +8 -4
- package/source/components/form/stylesheet/toggle-switch.mjs +8 -4
- package/source/components/form/stylesheet/tree-select.mjs +8 -4
- package/source/components/host/collapse.mjs +14 -516
- package/source/components/host/config-manager.mjs +9 -2
- package/source/components/host/constants.mjs +9 -4
- package/source/components/host/details.mjs +14 -253
- package/source/components/host/stylesheet/call-button.mjs +8 -4
- package/source/components/host/stylesheet/config-manager.mjs +8 -4
- package/source/components/host/stylesheet/host.mjs +9 -5
- package/source/components/host/stylesheet/overlay.mjs +9 -5
- package/source/components/host/stylesheet/toggle-button.mjs +8 -4
- package/source/components/host/stylesheet/viewer.mjs +8 -4
- package/source/components/layout/collapse.mjs +542 -0
- package/source/components/layout/details.mjs +271 -0
- package/source/components/layout/panel.mjs +6 -0
- package/source/components/layout/popper.mjs +476 -0
- package/source/components/{host → layout}/stylesheet/collapse.mjs +8 -4
- package/source/components/{host → layout}/stylesheet/details.mjs +8 -4
- package/source/components/layout/stylesheet/panel.mjs +8 -4
- package/source/components/{form → layout}/stylesheet/popper.mjs +8 -4
- package/source/components/layout/stylesheet/split-panel.mjs +8 -4
- package/source/components/layout/stylesheet/tabs.mjs +8 -4
- package/source/components/layout/stylesheet/width-toggle.mjs +8 -4
- package/source/components/layout/tabs.mjs +3 -3
- package/source/components/layout/width-toggle.mjs +3 -3
- package/source/components/navigation/style/table-of-content.pcss +84 -0
- package/source/components/navigation/stylesheet/table-of-content.mjs +31 -0
- package/source/components/navigation/table-of-content.mjs +418 -0
- package/source/components/notify/stylesheet/message.mjs +8 -4
- package/source/components/notify/stylesheet/notify.mjs +8 -4
- package/source/components/state/stylesheet/log.mjs +8 -4
- package/source/components/state/stylesheet/state.mjs +9 -5
- package/source/components/style/link.pcss +0 -1
- package/source/components/style/mixin/typography.pcss +7 -7
- package/source/components/style/typography.pcss +1 -1
- package/source/components/stylesheet/badge.mjs +8 -4
- package/source/components/stylesheet/border.mjs +8 -4
- package/source/components/stylesheet/button.mjs +8 -4
- package/source/components/stylesheet/card.mjs +8 -4
- package/source/components/stylesheet/color.mjs +8 -4
- package/source/components/stylesheet/common.mjs +8 -4
- package/source/components/stylesheet/control.mjs +8 -4
- package/source/components/stylesheet/data-grid.mjs +8 -4
- package/source/components/stylesheet/display.mjs +8 -4
- package/source/components/stylesheet/floating-ui.mjs +8 -4
- package/source/components/stylesheet/form.mjs +8 -4
- package/source/components/stylesheet/host.mjs +8 -4
- package/source/components/stylesheet/icons.mjs +8 -4
- package/source/components/stylesheet/link.mjs +8 -4
- package/source/components/stylesheet/mixin/badge.mjs +31 -0
- package/source/components/stylesheet/mixin/button.mjs +31 -0
- package/source/components/stylesheet/mixin/form.mjs +31 -0
- package/source/components/stylesheet/mixin/hover.mjs +31 -0
- package/source/components/stylesheet/mixin/icon.mjs +31 -0
- package/source/components/stylesheet/mixin/media.mjs +31 -0
- package/source/components/stylesheet/mixin/property.mjs +31 -0
- package/source/components/stylesheet/mixin/skeleton.mjs +31 -0
- package/source/components/stylesheet/mixin/spinner.mjs +31 -0
- package/source/components/stylesheet/mixin/typography.mjs +31 -0
- package/source/components/stylesheet/normalize.mjs +8 -4
- package/source/components/stylesheet/popper.mjs +8 -4
- package/source/components/stylesheet/property.mjs +8 -4
- package/source/components/stylesheet/ripple.mjs +8 -4
- package/source/components/stylesheet/skeleton.mjs +8 -4
- package/source/components/stylesheet/space.mjs +8 -4
- package/source/components/stylesheet/spinner.mjs +8 -4
- package/source/components/stylesheet/table.mjs +8 -4
- package/source/components/stylesheet/theme.mjs +8 -4
- package/source/components/stylesheet/typography.mjs +9 -5
- package/source/components/tree-menu/stylesheet/tree-menu.mjs +8 -4
- package/source/dom/ready.mjs +10 -4
- package/source/monster.mjs +17 -80
- package/source/types/proxyobserver.mjs +4 -2
- package/source/types/version.mjs +1 -1
- package/test/cases/monster.mjs +1 -1
- package/test/web/tests.js +4 -4
- package/source/components/form/form-field.mjs +0 -341
- package/source/components/form/style/form-field.pcss +0 -4
- package/source/components/form/stylesheet/form-field.mjs +0 -27
- /package/source/components/{host → layout}/style/collapse.pcss +0 -0
- /package/source/components/{host → layout}/style/details.pcss +0 -0
- /package/source/components/{form → layout}/style/popper.pcss +0 -0
@@ -1,265 +1,26 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright
|
3
|
-
*
|
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
|
-
*
|
40
|
-
*
|
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
|
-
*
|
43
|
-
*
|
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
|
-
|
189
|
-
|
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
|
-
* @
|
202
|
-
* @
|
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
|
-
|
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
|
2
|
+
* Copyright © schukai GmbH and all contributing authors, 2024. All rights reserved.
|
4
3
|
* Node module: @schukai/monster
|
5
|
-
*
|
6
|
-
*
|
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
|
2
|
+
* Copyright © schukai GmbH and all contributing authors, 2024. All rights reserved.
|
4
3
|
* Node module: @schukai/monster
|
5
|
-
*
|
6
|
-
*
|
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";
|