@schukai/monster 3.63.0 → 3.63.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +21 -0
- package/package.json +1 -1
- package/source/components/datatable/dataset.mjs +0 -3
- package/source/components/datatable/datatable.mjs +18 -4
- package/source/components/datatable/pagination.mjs +0 -2
- package/source/components/datatable/save-button.mjs +269 -239
- package/source/components/datatable/status.mjs +2 -2
- package/source/components/datatable/style/column-bar.pcss +5 -3
- package/source/components/datatable/style/dataset.pcss +1 -0
- package/source/components/datatable/style/datatable.pcss +8 -18
- package/source/components/datatable/style/embedded-pagination.pcss +2 -2
- package/source/components/datatable/style/filter.pcss +1 -1
- package/source/components/datatable/style/pagination.pcss +3 -3
- package/source/components/datatable/stylesheet/change-button.mjs +1 -1
- package/source/components/datatable/stylesheet/column-bar.mjs +1 -1
- package/source/components/datatable/stylesheet/dataset.mjs +1 -1
- package/source/components/datatable/stylesheet/datatable.mjs +1 -1
- package/source/components/datatable/stylesheet/embedded-pagination.mjs +1 -1
- package/source/components/datatable/stylesheet/filter.mjs +1 -1
- package/source/components/datatable/stylesheet/pagination.mjs +1 -1
- package/source/components/datatable/stylesheet/save-button.mjs +1 -1
- package/source/components/datatable/stylesheet/select-filter.mjs +1 -1
- package/source/components/datatable/stylesheet/status.mjs +1 -1
- package/source/components/form/context-error.mjs +7 -8
- package/source/components/form/context-help.mjs +7 -2
- package/source/components/form/select.mjs +22 -5
- package/source/components/form/style/context-error.pcss +1 -1
- package/source/components/form/style/context-help.pcss +5 -1
- package/source/components/form/style/select.pcss +81 -56
- package/source/components/form/style/toggle-switch.pcss +0 -6
- package/source/components/form/stylesheet/action-button.mjs +1 -1
- package/source/components/form/stylesheet/context-error.mjs +1 -1
- package/source/components/form/stylesheet/context-help.mjs +1 -1
- package/source/components/form/stylesheet/select.mjs +1 -1
- package/source/components/form/stylesheet/state-button.mjs +1 -1
- package/source/components/form/stylesheet/toggle-switch.mjs +1 -1
- package/source/components/form/toggle-switch.mjs +23 -19
- package/source/components/host/collapse.mjs +0 -5
- package/source/components/host/style/collapse.pcss +3 -2
- package/source/components/host/stylesheet/call-button.mjs +1 -1
- package/source/components/host/stylesheet/collapse.mjs +1 -1
- package/source/components/host/stylesheet/details.mjs +1 -1
- package/source/components/host/stylesheet/host.mjs +1 -1
- package/source/components/host/stylesheet/overlay.mjs +1 -1
- package/source/components/host/stylesheet/toggle-button.mjs +1 -1
- package/source/components/host/stylesheet/viewer.mjs +1 -1
- package/source/components/layout/split-screen.mjs +3 -1
- package/source/components/layout/style/tabs.pcss +0 -1
- package/source/components/layout/style/width-toggle.pcss +26 -0
- package/source/components/layout/stylesheet/tabs.mjs +1 -1
- package/source/components/layout/stylesheet/width-toggle.mjs +27 -0
- package/source/components/layout/tabs.mjs +17 -1
- package/source/components/layout/width-toggle.mjs +242 -0
- package/source/components/notify/stylesheet/message.mjs +1 -1
- package/source/components/style/color.pcss +11 -0
- package/source/components/style/icons.pcss +73 -69
- package/source/components/style/mixin/icon.pcss +32 -37
- package/source/components/style/mixin/property.pcss +38 -2
- package/source/components/style/property.pcss +2 -0
- package/source/components/style/table.pcss +6 -4
- package/source/components/style/theme.pcss +33 -5
- package/source/components/stylesheet/color.mjs +1 -1
- package/source/components/stylesheet/icons.mjs +1 -1
- package/source/components/stylesheet/property.mjs +1 -1
- package/source/components/stylesheet/table.mjs +1 -1
- package/source/components/stylesheet/theme.mjs +1 -1
- package/source/dom/customcontrol.mjs +7 -1
- package/source/dom/util/init-options-from-attributes.mjs +61 -48
- package/source/monster.mjs +2 -0
- package/source/types/version.mjs +1 -1
- package/test/cases/monster.mjs +1 -1
- package/test/web/test.html +2 -2
- package/test/web/tests.js +54 -26
@@ -20,7 +20,7 @@ const ThemeStyleSheet = new CSSStyleSheet();
|
|
20
20
|
try {
|
21
21
|
ThemeStyleSheet.insertRule(`
|
22
22
|
@layer theme {
|
23
|
-
.monster-theme-primary-1{background-color:var(--monster-bg-color-primary-1);color:var(--monster-color-primary-1)}.monster-theme-primary-disabled-1{background-color:var(--monster-bg-color-primary-disabled-1);color:var(--monster-color-primary-disabled-1)}.monster-theme-secondary-1{background-color:var(--monster-bg-color-secondary-1);color:var(--monster-color-secondary-1)}.monster-theme-tertiary-1{background-color:var(--monster-bg-color-tertiary-1);color:var(--monster-color-tertiary-1)}.monster-theme-destructive-1{background-color:var(--monster-bg-color-destructive-1);color:var(--monster-color-destructive-1)}.monster-theme-success-1{background-color:var(--monster-bg-color-success-1);color:var(--monster-color-success-1)}.monster-theme-warning-1{background-color:var(--monster-bg-color-warning-1);color:var(--monster-color-warning-1)}.monster-theme-error-1{background-color:var(--monster-bg-color-error-1);color:var(--monster-color-error-1)}.monster-theme-selection-1{background-color:var(--monster-bg-color-selection-1);color:var(--monster-color-selection-1)}.monster-border-color-1{border-color:var(--monster-color-border-1)}.monster-color-neutral-1{color:var(--monster-color-primary-1)}.monster-bg-color-primary-1{background-color:var(--monster-bg-color-primary-1)}.monster-bg-color-secondary-1{background-color:var(--monster-bg-color-secondary-1)}.monster-bg-color-tertiary-1{background-color:var(--monster-bg-color-tertiary-1)}.monster-color-primary-1{background-color:var(--monster-bg-color-primary-1);color:var(--monster-color-primary-1)}.monster-color-secondary-1{background-color:var(--monster-bg-color-secondary-1);color:var(--monster-color-secondary-1)}.monster-color-tertiary-1{background-color:var(--monster-bg-color-tertiary-1);color:var(--monster-color-tertiary-1)}.monster-color-destructive-1{background-color:var(--monster-bg-color-destructive-1);color:var(--monster-color-destructive-1)}.monster-color-success-1{background-color:var(--monster-bg-color-success-1);color:var(--monster-color-success-1)}.monster-color-warning-1{background-color:var(--monster-bg-color-warning-1);color:var(--monster-color-warning-1)}.monster-color-error-1{background-color:var(--monster-bg-color-error-1);color:var(--monster-color-error-1)}.monster-color-selection-1{background-color:var(--monster-bg-color-selection-1);color:var(--monster-color-selection-1)}.monster-theme-primary-2{background-color:var(--monster-bg-color-primary-2);color:var(--monster-color-primary-2)}.monster-theme-primary-disabled-2{background-color:var(--monster-bg-color-primary-disabled-2);color:var(--monster-color-primary-disabled-2)}.monster-theme-secondary-2{background-color:var(--monster-bg-color-secondary-2);color:var(--monster-color-secondary-2)}.monster-theme-tertiary-2{background-color:var(--monster-bg-color-tertiary-2);color:var(--monster-color-tertiary-2)}.monster-theme-destructive-2{background-color:var(--monster-bg-color-destructive-2);color:var(--monster-color-destructive-2)}.monster-theme-success-2{background-color:var(--monster-bg-color-success-2);color:var(--monster-color-success-2)}.monster-theme-warning-2{background-color:var(--monster-bg-color-warning-2);color:var(--monster-color-warning-2)}.monster-theme-error-2{background-color:var(--monster-bg-color-error-2);color:var(--monster-color-error-2)}.monster-theme-selection-2{background-color:var(--monster-bg-color-selection-2);color:var(--monster-color-selection-2)}.monster-border-color-2{border-color:var(--monster-color-border-2)}.monster-color-neutral-2{color:var(--monster-color-primary-2)}.monster-bg-color-primary-2{background-color:var(--monster-bg-color-primary-2)}.monster-bg-color-secondary-2{background-color:var(--monster-bg-color-secondary-2)}.monster-bg-color-tertiary-2{background-color:var(--monster-bg-color-tertiary-2)}.monster-color-primary-2{background-color:var(--monster-bg-color-primary-2);color:var(--monster-color-primary-2)}.monster-color-secondary-2{background-color:var(--monster-bg-color-secondary-2);color:var(--monster-color-secondary-2)}.monster-color-tertiary-2{background-color:var(--monster-bg-color-tertiary-2);color:var(--monster-color-tertiary-2)}.monster-color-destructive-2{background-color:var(--monster-bg-color-destructive-2);color:var(--monster-color-destructive-2)}.monster-color-success-2{background-color:var(--monster-bg-color-success-2);color:var(--monster-color-success-2)}.monster-color-warning-2{background-color:var(--monster-bg-color-warning-2);color:var(--monster-color-warning-2)}.monster-color-error-2{background-color:var(--monster-bg-color-error-2);color:var(--monster-color-error-2)}.monster-color-selection-2{background-color:var(--monster-bg-color-selection-2);color:var(--monster-color-selection-2)}.monster-theme-primary-3{background-color:var(--monster-bg-color-primary-3);color:var(--monster-color-primary-3)}.monster-theme-primary-disabled-3{background-color:var(--monster-bg-color-primary-disabled-3);color:var(--monster-color-primary-disabled-3)}.monster-theme-secondary-3{background-color:var(--monster-bg-color-secondary-3);color:var(--monster-color-secondary-3)}.monster-theme-tertiary-3{background-color:var(--monster-bg-color-tertiary-3);color:var(--monster-color-tertiary-3)}.monster-theme-destructive-3{background-color:var(--monster-bg-color-destructive-3);color:var(--monster-color-destructive-3)}.monster-theme-success-3{background-color:var(--monster-bg-color-success-3);color:var(--monster-color-success-3)}.monster-theme-warning-3{background-color:var(--monster-bg-color-warning-3);color:var(--monster-color-warning-3)}.monster-theme-error-3{background-color:var(--monster-bg-color-error-3);color:var(--monster-color-error-3)}.monster-theme-selection-3{background-color:var(--monster-bg-color-selection-3);color:var(--monster-color-selection-3)}.monster-border-color-3{border-color:var(--monster-color-border-3)}.monster-color-neutral-3{color:var(--monster-color-primary-3)}.monster-bg-color-primary-3{background-color:var(--monster-bg-color-primary-3)}.monster-bg-color-secondary-3{background-color:var(--monster-bg-color-secondary-3)}.monster-bg-color-tertiary-3{background-color:var(--monster-bg-color-tertiary-3)}.monster-color-primary-3{background-color:var(--monster-bg-color-primary-3);color:var(--monster-color-primary-3)}.monster-color-secondary-3{background-color:var(--monster-bg-color-secondary-3);color:var(--monster-color-secondary-3)}.monster-color-tertiary-3{background-color:var(--monster-bg-color-tertiary-3);color:var(--monster-color-tertiary-3)}.monster-color-destructive-3{background-color:var(--monster-bg-color-destructive-3);color:var(--monster-color-destructive-3)}.monster-color-success-3{background-color:var(--monster-bg-color-success-3);color:var(--monster-color-success-3)}.monster-color-warning-3{background-color:var(--monster-bg-color-warning-3);color:var(--monster-color-warning-3)}.monster-color-error-3{background-color:var(--monster-bg-color-error-3);color:var(--monster-color-error-3)}.monster-color-selection-3{background-color:var(--monster-bg-color-selection-3);color:var(--monster-color-selection-3)}.monster-theme-primary-4{background-color:var(--monster-bg-color-primary-4);color:var(--monster-color-primary-4)}.monster-theme-primary-disabled-4{background-color:var(--monster-bg-color-primary-disabled-4);color:var(--monster-color-primary-disabled-4)}.monster-theme-secondary-4{background-color:var(--monster-bg-color-secondary-4);color:var(--monster-color-secondary-4)}.monster-theme-tertiary-4{background-color:var(--monster-bg-color-tertiary-4);color:var(--monster-color-tertiary-4)}.monster-theme-destructive-4{background-color:var(--monster-bg-color-destructive-4);color:var(--monster-color-destructive-4)}.monster-theme-success-4{background-color:var(--monster-bg-color-success-4);color:var(--monster-color-success-4)}.monster-theme-warning-4{background-color:var(--monster-bg-color-warning-4);color:var(--monster-color-warning-4)}.monster-theme-error-4{background-color:var(--monster-bg-color-error-4);color:var(--monster-color-error-4)}.monster-theme-selection-4{background-color:var(--monster-bg-color-selection-4);color:var(--monster-color-selection-4)}.monster-border-color-4{border-color:var(--monster-color-border-4)}.monster-color-neutral-4{color:var(--monster-color-primary-4)}.monster-bg-color-primary-4{background-color:var(--monster-bg-color-primary-4)}.monster-bg-color-secondary-4{background-color:var(--monster-bg-color-secondary-4)}.monster-bg-color-tertiary-4{background-color:var(--monster-bg-color-tertiary-4)}.monster-color-primary-4{background-color:var(--monster-bg-color-primary-4);color:var(--monster-color-primary-4)}.monster-color-secondary-4{background-color:var(--monster-bg-color-secondary-4);color:var(--monster-color-secondary-4)}.monster-color-tertiary-4{background-color:var(--monster-bg-color-tertiary-4);color:var(--monster-color-tertiary-4)}.monster-color-destructive-4{background-color:var(--monster-bg-color-destructive-4);color:var(--monster-color-destructive-4)}.monster-color-success-4{background-color:var(--monster-bg-color-success-4);color:var(--monster-color-success-4)}.monster-color-warning-4{background-color:var(--monster-bg-color-warning-4);color:var(--monster-color-warning-4)}.monster-color-error-4{background-color:var(--monster-bg-color-error-4);color:var(--monster-color-error-4)}.monster-color-selection-4{background-color:var(--monster-bg-color-selection-4);color:var(--monster-color-selection-4)}
|
23
|
+
.monster-theme-primary-1{background-color:var(--monster-bg-color-primary-1);color:var(--monster-color-primary-1)}.monster-theme-primary-disabled-1{background-color:var(--monster-bg-color-primary-disabled-1);color:var(--monster-color-primary-disabled-1)}.monster-theme-secondary-1{background-color:var(--monster-bg-color-secondary-1);color:var(--monster-color-secondary-1)}.monster-theme-tertiary-1{background-color:var(--monster-bg-color-tertiary-1);color:var(--monster-color-tertiary-1)}.monster-theme-destructive-1{background-color:var(--monster-bg-color-destructive-1);color:var(--monster-color-destructive-1)}.monster-theme-success-1{background-color:var(--monster-bg-color-success-1);color:var(--monster-color-success-1)}.monster-theme-warning-1{background-color:var(--monster-bg-color-warning-1);color:var(--monster-color-warning-1)}.monster-theme-error-1{background-color:var(--monster-bg-color-error-1);color:var(--monster-color-error-1)}.monster-theme-selection-1{background-color:var(--monster-bg-color-selection-1);color:var(--monster-color-selection-1)}.monster-border-color-1{border-color:var(--monster-color-border-1)}.monster-color-neutral-1{color:var(--monster-color-primary-1)}.monster-bg-color-primary-1{background-color:var(--monster-bg-color-primary-1)}.monster-bg-color-secondary-1{background-color:var(--monster-bg-color-secondary-1)}.monster-bg-color-tertiary-1{background-color:var(--monster-bg-color-tertiary-1)}.monster-color-primary-1{background-color:var(--monster-bg-color-primary-1);color:var(--monster-color-primary-1)}.monster-color-secondary-1{background-color:var(--monster-bg-color-secondary-1);color:var(--monster-color-secondary-1)}.monster-color-tertiary-1{background-color:var(--monster-bg-color-tertiary-1);color:var(--monster-color-tertiary-1)}.monster-color-destructive-1{background-color:var(--monster-bg-color-destructive-1);color:var(--monster-color-destructive-1)}.monster-color-success-1{background-color:var(--monster-bg-color-success-1);color:var(--monster-color-success-1)}.monster-color-warning-1{background-color:var(--monster-bg-color-warning-1);color:var(--monster-color-warning-1)}.monster-color-error-1{background-color:var(--monster-bg-color-error-1);color:var(--monster-color-error-1)}.monster-color-selection-1{background-color:var(--monster-bg-color-selection-1);color:var(--monster-color-selection-1)}.monster-theme-primary-2{background-color:var(--monster-bg-color-primary-2);color:var(--monster-color-primary-2)}.monster-theme-primary-disabled-2{background-color:var(--monster-bg-color-primary-disabled-2);color:var(--monster-color-primary-disabled-2)}.monster-theme-secondary-2{background-color:var(--monster-bg-color-secondary-2);color:var(--monster-color-secondary-2)}.monster-theme-tertiary-2{background-color:var(--monster-bg-color-tertiary-2);color:var(--monster-color-tertiary-2)}.monster-theme-destructive-2{background-color:var(--monster-bg-color-destructive-2);color:var(--monster-color-destructive-2)}.monster-theme-success-2{background-color:var(--monster-bg-color-success-2);color:var(--monster-color-success-2)}.monster-theme-warning-2{background-color:var(--monster-bg-color-warning-2);color:var(--monster-color-warning-2)}.monster-theme-error-2{background-color:var(--monster-bg-color-error-2);color:var(--monster-color-error-2)}.monster-theme-selection-2{background-color:var(--monster-bg-color-selection-2);color:var(--monster-color-selection-2)}.monster-border-color-2{border-color:var(--monster-color-border-2)}.monster-color-neutral-2{color:var(--monster-color-primary-2)}.monster-bg-color-primary-2{background-color:var(--monster-bg-color-primary-2)}.monster-bg-color-secondary-2{background-color:var(--monster-bg-color-secondary-2)}.monster-bg-color-tertiary-2{background-color:var(--monster-bg-color-tertiary-2)}.monster-color-primary-2{background-color:var(--monster-bg-color-primary-2);color:var(--monster-color-primary-2)}.monster-color-secondary-2{background-color:var(--monster-bg-color-secondary-2);color:var(--monster-color-secondary-2)}.monster-color-tertiary-2{background-color:var(--monster-bg-color-tertiary-2);color:var(--monster-color-tertiary-2)}.monster-color-destructive-2{background-color:var(--monster-bg-color-destructive-2);color:var(--monster-color-destructive-2)}.monster-color-success-2{background-color:var(--monster-bg-color-success-2);color:var(--monster-color-success-2)}.monster-color-warning-2{background-color:var(--monster-bg-color-warning-2);color:var(--monster-color-warning-2)}.monster-color-error-2{background-color:var(--monster-bg-color-error-2);color:var(--monster-color-error-2)}.monster-color-selection-2{background-color:var(--monster-bg-color-selection-2);color:var(--monster-color-selection-2)}.monster-theme-primary-3{background-color:var(--monster-bg-color-primary-3);color:var(--monster-color-primary-3)}.monster-theme-primary-disabled-3{background-color:var(--monster-bg-color-primary-disabled-3);color:var(--monster-color-primary-disabled-3)}.monster-theme-secondary-3{background-color:var(--monster-bg-color-secondary-3);color:var(--monster-color-secondary-3)}.monster-theme-tertiary-3{background-color:var(--monster-bg-color-tertiary-3);color:var(--monster-color-tertiary-3)}.monster-theme-destructive-3{background-color:var(--monster-bg-color-destructive-3);color:var(--monster-color-destructive-3)}.monster-theme-success-3{background-color:var(--monster-bg-color-success-3);color:var(--monster-color-success-3)}.monster-theme-warning-3{background-color:var(--monster-bg-color-warning-3);color:var(--monster-color-warning-3)}.monster-theme-error-3{background-color:var(--monster-bg-color-error-3);color:var(--monster-color-error-3)}.monster-theme-selection-3{background-color:var(--monster-bg-color-selection-3);color:var(--monster-color-selection-3)}.monster-border-color-3{border-color:var(--monster-color-border-3)}.monster-color-neutral-3{color:var(--monster-color-primary-3)}.monster-bg-color-primary-3{background-color:var(--monster-bg-color-primary-3)}.monster-bg-color-secondary-3{background-color:var(--monster-bg-color-secondary-3)}.monster-bg-color-tertiary-3{background-color:var(--monster-bg-color-tertiary-3)}.monster-color-primary-3{background-color:var(--monster-bg-color-primary-3);color:var(--monster-color-primary-3)}.monster-color-secondary-3{background-color:var(--monster-bg-color-secondary-3);color:var(--monster-color-secondary-3)}.monster-color-tertiary-3{background-color:var(--monster-bg-color-tertiary-3);color:var(--monster-color-tertiary-3)}.monster-color-destructive-3{background-color:var(--monster-bg-color-destructive-3);color:var(--monster-color-destructive-3)}.monster-color-success-3{background-color:var(--monster-bg-color-success-3);color:var(--monster-color-success-3)}.monster-color-warning-3{background-color:var(--monster-bg-color-warning-3);color:var(--monster-color-warning-3)}.monster-color-error-3{background-color:var(--monster-bg-color-error-3);color:var(--monster-color-error-3)}.monster-color-selection-3{background-color:var(--monster-bg-color-selection-3);color:var(--monster-color-selection-3)}.monster-theme-primary-4{background-color:var(--monster-bg-color-primary-4);color:var(--monster-color-primary-4)}.monster-theme-primary-disabled-4{background-color:var(--monster-bg-color-primary-disabled-4);color:var(--monster-color-primary-disabled-4)}.monster-theme-secondary-4{background-color:var(--monster-bg-color-secondary-4);color:var(--monster-color-secondary-4)}.monster-theme-tertiary-4{background-color:var(--monster-bg-color-tertiary-4);color:var(--monster-color-tertiary-4)}.monster-theme-destructive-4{background-color:var(--monster-bg-color-destructive-4);color:var(--monster-color-destructive-4)}.monster-theme-success-4{background-color:var(--monster-bg-color-success-4);color:var(--monster-color-success-4)}.monster-theme-warning-4{background-color:var(--monster-bg-color-warning-4);color:var(--monster-color-warning-4)}.monster-theme-error-4{background-color:var(--monster-bg-color-error-4);color:var(--monster-color-error-4)}.monster-theme-selection-4{background-color:var(--monster-bg-color-selection-4);color:var(--monster-color-selection-4)}.monster-border-color-4{border-color:var(--monster-color-border-4)}.monster-color-neutral-4{color:var(--monster-color-primary-4)}.monster-bg-color-primary-4{background-color:var(--monster-bg-color-primary-4)}.monster-bg-color-secondary-4{background-color:var(--monster-bg-color-secondary-4)}.monster-bg-color-tertiary-4{background-color:var(--monster-bg-color-tertiary-4)}.monster-color-primary-4{background-color:var(--monster-bg-color-primary-4);color:var(--monster-color-primary-4)}.monster-color-secondary-4{background-color:var(--monster-bg-color-secondary-4);color:var(--monster-color-secondary-4)}.monster-color-tertiary-4{background-color:var(--monster-bg-color-tertiary-4);color:var(--monster-color-tertiary-4)}.monster-color-destructive-4{background-color:var(--monster-bg-color-destructive-4);color:var(--monster-color-destructive-4)}.monster-color-success-4{background-color:var(--monster-bg-color-success-4);color:var(--monster-color-success-4)}.monster-color-warning-4{background-color:var(--monster-bg-color-warning-4);color:var(--monster-color-warning-4)}.monster-color-error-4{background-color:var(--monster-bg-color-error-4);color:var(--monster-color-error-4)}.monster-color-selection-4{background-color:var(--monster-bg-color-selection-4);color:var(--monster-color-selection-4)}.monster-theme-control-container-1,.monster-theme-control-row-1{border:1px solid var(--monster-theme-control-border-color)}.monster-theme-control-container-1,.monster-theme-control-element,.monster-theme-control-row-1{background-color:var(--monster-theme-control-bg-color);color:var(--monster-theme-control-color)}.monster-theme-control-background{background-color:var(--monster-theme-control-bg-color)}.monster-theme-background-inherit{background-color:inherit!important}.monster-theme-on{background-color:var(--monster-theme-on-bg-color);color:var(--monster-theme-on-color)}.monster-theme-off{background-color:var(--monster-theme-off-bg-color);color:var(--monster-theme-off-color)}
|
24
24
|
}`, 0);
|
25
25
|
} catch (e) {
|
26
26
|
addAttributeToken(document.getRootNode().querySelector('html'), ATTRIBUTE_ERRORMESSAGE, e + "");
|
@@ -25,7 +25,7 @@ const attachedInternalSymbol = Symbol("attachedInternal");
|
|
25
25
|
* After defining a `CustomElement`, the `registerCustomElement` method must be called with the new class name. Only then
|
26
26
|
* will the tag defined via the `getTag` method be made known to the DOM.
|
27
27
|
*
|
28
|
-
* <img src="./images/
|
28
|
+
* <img src="./images/custom-control.png">
|
29
29
|
*
|
30
30
|
* This control uses `attachInternals()` to integrate the control into a form. If the target environment does not support
|
31
31
|
* this method, the [polyfill](https://www.npmjs.com/package/element-internals-polyfill) can be used.
|
@@ -41,6 +41,12 @@ const attachedInternalSymbol = Symbol("attachedInternal");
|
|
41
41
|
*
|
42
42
|
* Read the HTML specification for Custom Element Reactions: {@link https://html.spec.whatwg.org/dev/custom-elements.html#custom-element-reactions|Custom Element Reactions}.
|
43
43
|
*
|
44
|
+
* @startuml custom-control.png
|
45
|
+
* skinparam monochrome true
|
46
|
+
* skinparam shadowing false
|
47
|
+
* HTMLElement <|-- CustomElement
|
48
|
+
* CustomElement <|-- CustomControl
|
49
|
+
* @enduml
|
44
50
|
* @summary A base class for custom controls based on CustomElement.
|
45
51
|
* @copyright schukai GmbH
|
46
52
|
* @license AGPLv3
|
@@ -5,12 +5,18 @@
|
|
5
5
|
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
6
6
|
*/
|
7
7
|
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
|
11
|
-
|
8
|
+
import {Pathfinder} from "../../data/pathfinder.mjs";
|
9
|
+
import {
|
10
|
+
isBoolean,
|
11
|
+
isString,
|
12
|
+
isObject,
|
13
|
+
isArray,
|
14
|
+
isFunction,
|
15
|
+
isInteger,
|
16
|
+
} from "../../types/is.mjs";
|
17
|
+
import {extractKeys} from "./extract-keys.mjs";
|
12
18
|
|
13
|
-
export {
|
19
|
+
export {initOptionsFromAttributes};
|
14
20
|
|
15
21
|
/**
|
16
22
|
* Initializes the given options object based on the attributes of the current DOM element.
|
@@ -22,6 +28,7 @@ export { initOptionsFromAttributes };
|
|
22
28
|
* For example, the attribute 'data-monster-option-foo' maps to the 'bar' property in the options object.
|
23
29
|
*
|
24
30
|
* The mapping object would look like this:
|
31
|
+
*
|
25
32
|
* {
|
26
33
|
* 'foo': (value) => value + 'bar'
|
27
34
|
* // the value of the attribute 'data-monster-option-foo' is appended with 'bar'
|
@@ -32,6 +39,8 @@ export { initOptionsFromAttributes };
|
|
32
39
|
* // and assigned to the 'bar.baz' property in the options object.
|
33
40
|
* // e.g. <div data-monster-option-bar-baz="foo"></div>
|
34
41
|
* }
|
42
|
+
*
|
43
|
+
* Array values have to be separated by '::'.
|
35
44
|
*
|
36
45
|
* @since 3.38.0
|
37
46
|
* @param {HTMLElement} element - The DOM element to be used as the source of the attributes.
|
@@ -42,56 +51,60 @@ export { initOptionsFromAttributes };
|
|
42
51
|
* @this HTMLElement - The context of the DOM element.
|
43
52
|
*/
|
44
53
|
function initOptionsFromAttributes(
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
54
|
+
element,
|
55
|
+
options,
|
56
|
+
mapping = {},
|
57
|
+
prefix = "data-monster-option-",
|
49
58
|
) {
|
50
|
-
|
51
|
-
|
59
|
+
if (!(element instanceof HTMLElement)) return options;
|
60
|
+
if (!element.hasAttributes()) return options;
|
52
61
|
|
53
|
-
|
54
|
-
|
62
|
+
const keyMap = extractKeys(options);
|
63
|
+
const finder = new Pathfinder(options);
|
55
64
|
|
56
|
-
|
57
|
-
|
65
|
+
element.getAttributeNames().forEach((name) => {
|
66
|
+
if (!name.startsWith(prefix)) return;
|
58
67
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
68
|
+
// check if the attribute name is a valid option.
|
69
|
+
// the mapping between the attribute is simple. The dash is replaced by a dot.
|
70
|
+
// e.g. data-monster-url => url
|
71
|
+
const optionName = keyMap.get(name.substring(prefix.length).toLowerCase());
|
72
|
+
if (!finder.exists(optionName)) return;
|
64
73
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
74
|
+
if (element.hasAttribute(name)) {
|
75
|
+
let value = element.getAttribute(name);
|
76
|
+
if (
|
77
|
+
mapping.hasOwnProperty(optionName) &&
|
78
|
+
isFunction(mapping[optionName])
|
79
|
+
) {
|
80
|
+
value = mapping[optionName](value);
|
81
|
+
}
|
73
82
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
83
|
+
let optionValue = finder.getVia(optionName);
|
84
|
+
if (optionValue === null || optionValue === undefined) {
|
85
|
+
optionValue = value;
|
86
|
+
}
|
78
87
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
88
|
+
//const typeOfOptionValue = typeof optionValue;
|
89
|
+
if (optionValue === null || optionValue === undefined) {
|
90
|
+
value = null;
|
91
|
+
} else if (isBoolean(optionValue)) {
|
92
|
+
value = value === "true";
|
93
|
+
} else if (isInteger(optionValue)) {
|
94
|
+
value = Number(value);
|
95
|
+
} else if (isString(optionValue)) {
|
96
|
+
value = String(value);
|
97
|
+
} else if (isObject(optionValue)) {
|
98
|
+
value = JSON.parse(value);
|
99
|
+
} else if (isArray(optionValue)) {
|
100
|
+
value = value.split("::");
|
101
|
+
} else {
|
102
|
+
value = optionValue;
|
103
|
+
}
|
91
104
|
|
92
|
-
|
93
|
-
|
94
|
-
|
105
|
+
finder.setVia(optionName, value);
|
106
|
+
}
|
107
|
+
});
|
95
108
|
|
96
|
-
|
109
|
+
return options;
|
97
110
|
}
|
package/source/monster.mjs
CHANGED
@@ -29,6 +29,7 @@ export * from "./components/form/util/floating-ui.mjs";
|
|
29
29
|
export * from "./components/form/context-help.mjs";
|
30
30
|
export * from "./components/form/tabs.mjs";
|
31
31
|
export * from "./components/form/state-button.mjs";
|
32
|
+
export * from "./components/form/form-field.mjs";
|
32
33
|
export * from "./components/form/popper.mjs";
|
33
34
|
export * from "./components/form/select.mjs";
|
34
35
|
export * from "./components/form/confirm-button.mjs";
|
@@ -48,6 +49,7 @@ export * from "./components/form/stylesheet/message-state-button.mjs";
|
|
48
49
|
export * from "./components/form/stylesheet/button-bar.mjs";
|
49
50
|
export * from "./components/form/stylesheet/context-help.mjs";
|
50
51
|
export * from "./components/form/stylesheet/state-button.mjs";
|
52
|
+
export * from "./components/form/stylesheet/form-field.mjs";
|
51
53
|
export * from "./components/form/stylesheet/popper.mjs";
|
52
54
|
export * from "./components/form/stylesheet/select.mjs";
|
53
55
|
export * from "./components/form/stylesheet/confirm-button.mjs";
|
package/source/types/version.mjs
CHANGED
package/test/cases/monster.mjs
CHANGED
package/test/web/test.html
CHANGED
@@ -15,8 +15,8 @@
|
|
15
15
|
</head>
|
16
16
|
<body>
|
17
17
|
<div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
|
18
|
-
<h1 style='margin-bottom: 0.1em;'>Monster 3.
|
19
|
-
<div id="lastupdate" style='font-size:0.7em'>last update
|
18
|
+
<h1 style='margin-bottom: 0.1em;'>Monster 3.63.0</h1>
|
19
|
+
<div id="lastupdate" style='font-size:0.7em'>last update Mi 27. Mär 12:32:39 CET 2024</div>
|
20
20
|
</div>
|
21
21
|
<div id="mocha-errors"
|
22
22
|
style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>
|