comand-component-library 4.3.15 → 4.3.17
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.
- package/dist/comand-component-library.css +1 -1
- package/dist/comand-component-library.js +3846 -3621
- package/package.json +2 -2
- package/src/ComponentLibrary.vue +88 -18
- package/src/assets/data/accordion-data.json +8 -0
- package/src/assets/data/form-elements.json +2 -1
- package/src/assets/data/listOfComponents.json +1 -0
- package/src/assets/data/smart-search.json +14 -0
- package/src/assets/styles/component-library-global-styles.scss +4 -3
- package/src/componentSettingsDataAndControls.vue +35 -2
- package/src/components/CmdAccordion.vue +105 -0
- package/src/components/CmdBox.vue +4 -4
- package/src/components/CmdContainer.vue +1 -1
- package/src/components/CmdFakeSelect.vue +66 -29
- package/src/components/CmdForm.vue +1 -1
- package/src/components/CmdFormElement.vue +67 -23
- package/src/components/CmdInputGroup.vue +67 -31
- package/src/components/CmdMultistepFormWrapper.vue +1 -1
- package/src/components/CmdSection.vue +2 -0
- package/src/components/CmdSmartSearch.vue +25 -9
- package/src/components/CmdToast.vue +1 -1
- package/src/components/CmdTooltip.vue +110 -120
- package/src/components/CmdWidthLimitationWrapper.vue +9 -3
- package/src/index.js +2 -1
- package/src/mixins/FieldValidation.js +7 -0
- package/src/components/CmdTooltipForFormElements.vue +0 -113
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comand-component-library",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.17",
|
|
4
4
|
"license": "GPL-3.0-only",
|
|
5
5
|
"author": "CoManD-UI",
|
|
6
6
|
"private": false,
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"clickout-event": "^1.1.2",
|
|
32
|
-
"comand-frontend-framework": "^4.3.
|
|
32
|
+
"comand-frontend-framework": "^4.3.41",
|
|
33
33
|
"comand-ui-iconfonts": "^1.0.19",
|
|
34
34
|
"core-js": "^3.20.1",
|
|
35
35
|
"prismjs": "^1.27.0",
|
package/src/ComponentLibrary.vue
CHANGED
|
@@ -175,12 +175,49 @@
|
|
|
175
175
|
@click.prevent="openSettingsSidebar('CmdAddressData')"></a>
|
|
176
176
|
</h2>
|
|
177
177
|
<div class="flex-container">
|
|
178
|
-
<CmdAddressData
|
|
179
|
-
|
|
178
|
+
<CmdAddressData
|
|
179
|
+
ref="CmdAddressData"
|
|
180
|
+
:addressData="addressData"
|
|
181
|
+
v-bind="cmdAddressDataSettingsData"
|
|
182
|
+
/>
|
|
180
183
|
</div>
|
|
181
184
|
</CmdWidthLimitationWrapper>
|
|
182
185
|
<!-- end address-data --------------------------------------------------------------------------------------------------->
|
|
183
186
|
|
|
187
|
+
<!-- begin accordion --------------------------------------------------------------------------------------------------->
|
|
188
|
+
<CmdWidthLimitationWrapper>
|
|
189
|
+
<h2 class="headline-demopage" id="section-accordion">
|
|
190
|
+
<span>Accordion</span>
|
|
191
|
+
<a href="#" class="button small icon-cog" title="Open Component Settings"
|
|
192
|
+
@click.prevent="openSettingsSidebar('CmdAccordion')"></a>
|
|
193
|
+
</h2>
|
|
194
|
+
<CmdAccordion ref="CmdAccordion"
|
|
195
|
+
:name="accordionData.name"
|
|
196
|
+
:cmdHeadline="{headlineText: 'Summary (no highlighting)'}"
|
|
197
|
+
:textAccordionBody="accordionData.textAccordionBody"
|
|
198
|
+
v-bind="cmdAccordionSettingsData" />
|
|
199
|
+
<CmdAccordion
|
|
200
|
+
highlightLevel="primary"
|
|
201
|
+
:name="accordionData.name"
|
|
202
|
+
:cmdHeadline="{headlineText: 'Summary (primary highlighting)'}"
|
|
203
|
+
:textAccordionBody="accordionData.textAccordionBody"
|
|
204
|
+
/>
|
|
205
|
+
<CmdAccordion
|
|
206
|
+
highlightLevel="secondary"
|
|
207
|
+
:name="accordionData.name"
|
|
208
|
+
:cmdHeadline="{headlineText: 'Summary (secondary highlighting)'}"
|
|
209
|
+
:textAccordionBody="accordionData.textAccordionBody"
|
|
210
|
+
/>
|
|
211
|
+
<CmdAccordion
|
|
212
|
+
highlightLevel="tertiary"
|
|
213
|
+
:name="accordionData.name"
|
|
214
|
+
:cmdHeadline="{headlineText: 'Summary (tertiary highlighting)'}"
|
|
215
|
+
:textAccordionBody="accordionData.textAccordionBody"
|
|
216
|
+
/>
|
|
217
|
+
|
|
218
|
+
</CmdWidthLimitationWrapper>
|
|
219
|
+
<!-- end accordion --------------------------------------------------------------------------------------------------->
|
|
220
|
+
|
|
184
221
|
<!-- begin advanced form elements ------------------------------------------------------------------------------------------->
|
|
185
222
|
<CmdWidthLimitationWrapper>
|
|
186
223
|
<h2 class="headline-demopage" id="section-advanced-form-elements">Advanced Form Elements</h2>
|
|
@@ -1679,20 +1716,25 @@
|
|
|
1679
1716
|
<a href="#" class="button small icon-cog" title="Open Component Settings"
|
|
1680
1717
|
@click.prevent="openSettingsSidebar('CmdSmartSearch')"></a>
|
|
1681
1718
|
</h2>
|
|
1682
|
-
smartSearchString: {{ smartSearchString }}
|
|
1683
1719
|
<CmdSmartSearch
|
|
1684
1720
|
ref="CmdSmartSearch"
|
|
1685
1721
|
v-bind="smartSearchSettingsData"
|
|
1686
1722
|
:listOfRecommendations="smartSearchData.listOfRecommendations"
|
|
1687
1723
|
v-model="smartSearchString"
|
|
1724
|
+
:maxNumberOfRecommendations="5"
|
|
1688
1725
|
/>
|
|
1689
|
-
|
|
1726
|
+
<output>
|
|
1727
|
+
smartSearchString: {{ smartSearchString }}
|
|
1728
|
+
</output>
|
|
1690
1729
|
<CmdSmartSearch
|
|
1691
|
-
ref="CmdSmartSearch"
|
|
1692
|
-
v-bind="smartSearchSettingsData"
|
|
1693
1730
|
:listOfRecommendations="smartSearchData.listOfRecommendations"
|
|
1694
1731
|
v-model="smartSearchObject"
|
|
1732
|
+
:maxNumberOfRecommendations="5"
|
|
1733
|
+
:openListToTop="true"
|
|
1695
1734
|
/>
|
|
1735
|
+
<output>
|
|
1736
|
+
smartSearchObject: {{ smartSearchObject }}
|
|
1737
|
+
</output>
|
|
1696
1738
|
</CmdWidthLimitationWrapper>
|
|
1697
1739
|
<!-- end smart-search --------------------------------------------------------------------------------------------------->
|
|
1698
1740
|
|
|
@@ -1885,20 +1927,44 @@
|
|
|
1885
1927
|
<a href="#" class="button small icon-cog" title="Open Component Settings"
|
|
1886
1928
|
@click.prevent="openSettingsSidebar('CmdTooltip')"></a>
|
|
1887
1929
|
</h2>
|
|
1888
|
-
<
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
<
|
|
1930
|
+
<a href="#" @click.prevent style="anchor-name: --tooltip-anchor-for-hover;" id="show-on-hover">Show tooltip on hover!</a><br />
|
|
1931
|
+
<CmdTooltip
|
|
1932
|
+
id="tooltip-target-hover"
|
|
1933
|
+
positionAnchor="--tooltip-anchor-for-hover"
|
|
1934
|
+
relatedId="show-on-hover"
|
|
1935
|
+
tooltipText="This is text for a tooltip by hover!"
|
|
1936
|
+
/>
|
|
1937
|
+
|
|
1938
|
+
<a href="#" @click.prevent style="anchor-name: --tooltip-anchor-for-hover-on-delay" id="show-with-delay">Show tooltip on hover with delay!</a><br />
|
|
1939
|
+
<CmdTooltip
|
|
1940
|
+
id="tooltip-target-hover-on-delay"
|
|
1941
|
+
positionAnchor="--tooltip-anchor-for-hover-on-delay"
|
|
1942
|
+
relatedId="show-with-delay"
|
|
1943
|
+
:delayToShowTooltip="2000"
|
|
1944
|
+
>
|
|
1897
1945
|
Tooltip on hover with delay
|
|
1898
1946
|
</CmdTooltip>
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1947
|
+
|
|
1948
|
+
<button
|
|
1949
|
+
type="button"
|
|
1950
|
+
class="button"
|
|
1951
|
+
style="anchor-name: --tooltip-anchor-for-click;"
|
|
1952
|
+
positionAnchor="--tooltip-anchor-for-click"
|
|
1953
|
+
title="Click to open tooltip"
|
|
1954
|
+
popovertarget="tooltip-target-click"
|
|
1955
|
+
aria-describedby="tooltip-target-click"
|
|
1956
|
+
>
|
|
1957
|
+
<span class="icon-questionmark"></span>
|
|
1958
|
+
<span>Toggle Tooltip</span>
|
|
1959
|
+
</button>
|
|
1960
|
+
<CmdTooltip
|
|
1961
|
+
ref="CmdTooltip"
|
|
1962
|
+
:popoverTargetName="'tooltip-target-click'"
|
|
1963
|
+
:showCloseIcon="true"
|
|
1964
|
+
positionAnchor="--tooltip-anchor-for-click"
|
|
1965
|
+
tooltipText="This is text for a tooltip by click!"
|
|
1966
|
+
v-bind="cmdTooltipSettingsData"
|
|
1967
|
+
/>
|
|
1902
1968
|
</CmdWidthLimitationWrapper>
|
|
1903
1969
|
<!-- end tooltip --------------------------------------------------------------------------------------------------->
|
|
1904
1970
|
|
|
@@ -1922,6 +1988,7 @@
|
|
|
1922
1988
|
</h2>
|
|
1923
1989
|
<CmdWidthLimitationWrapper style="border: 1px dashed var(--color-gray-30)" ref="CmdWidthLimitationWrapper"
|
|
1924
1990
|
v-bind="cmdWidthLimitationWrapperSettingsData">
|
|
1991
|
+
<h3>Slot-Content</h3>
|
|
1925
1992
|
<p>Slot-content</p>
|
|
1926
1993
|
<p>Slot-content</p>
|
|
1927
1994
|
<p>Slot-content</p>
|
|
@@ -1981,6 +2048,7 @@
|
|
|
1981
2048
|
|
|
1982
2049
|
<script>
|
|
1983
2050
|
// import example data
|
|
2051
|
+
import accordionData from '@/assets/data/accordion-data.json'
|
|
1984
2052
|
import addressData from '@/assets/data/address-data.json'
|
|
1985
2053
|
import bankAccountData from '@/assets/data/bank-account-data.json'
|
|
1986
2054
|
import boxUserData from '@/assets/data/box-user.json'
|
|
@@ -2197,6 +2265,7 @@ export default {
|
|
|
2197
2265
|
showToast: false,
|
|
2198
2266
|
|
|
2199
2267
|
// assign data from json files to data-properties
|
|
2268
|
+
accordionData,
|
|
2200
2269
|
addressData,
|
|
2201
2270
|
bankAccountData,
|
|
2202
2271
|
boxProductData,
|
|
@@ -2647,6 +2716,7 @@ export default {
|
|
|
2647
2716
|
|
|
2648
2717
|
.comand-versions {
|
|
2649
2718
|
margin: 0;
|
|
2719
|
+
background: var(--color-white);
|
|
2650
2720
|
|
|
2651
2721
|
dd {
|
|
2652
2722
|
white-space: nowrap;
|
|
@@ -20,6 +20,20 @@
|
|
|
20
20
|
"icon": {
|
|
21
21
|
"iconClass": "icon-globe"
|
|
22
22
|
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": 4,
|
|
26
|
+
"displayValue": "Option #4",
|
|
27
|
+
"icon": {
|
|
28
|
+
"iconClass": "icon-user-profile"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": 5,
|
|
33
|
+
"displayValue": "Option #5",
|
|
34
|
+
"icon": {
|
|
35
|
+
"iconClass": "icon-questionmark-circle"
|
|
36
|
+
}
|
|
23
37
|
}
|
|
24
38
|
],
|
|
25
39
|
"cmdFormElement": {
|
|
@@ -236,14 +236,15 @@ a img.flag {
|
|
|
236
236
|
|
|
237
237
|
/* begin tooltip for cmd-form-element and cmd-fake-select ---------------------------------------------------------------------------------------------------------------- */
|
|
238
238
|
.cmd-form-element, .cmd-fake-select, .cmd-input-group {
|
|
239
|
+
/*
|
|
239
240
|
.cmd-tooltip {
|
|
240
241
|
position: absolute;
|
|
241
242
|
right: 0;
|
|
242
243
|
transform: translateY(calc(-100% - calc(var(--default-margin) / 2)));
|
|
243
|
-
left: auto !important; /* overwrite calculated inline-styles from javascript for cmd-tooltip-component
|
|
244
|
-
top: 0 !important; /* overwrite calculated inline-styles from javascript for cmd-tooltip-component
|
|
244
|
+
left: auto !important; /* overwrite calculated inline-styles from javascript for cmd-tooltip-component
|
|
245
|
+
top: 0 !important; /* overwrite calculated inline-styles from javascript for cmd-tooltip-component
|
|
245
246
|
}
|
|
246
|
-
|
|
247
|
+
*/
|
|
247
248
|
&:has([required]) {
|
|
248
249
|
&.has-state, & + .cmd-tooltip {
|
|
249
250
|
.label-text {
|
|
@@ -4,6 +4,32 @@ import navigationData from "@/assets/data/main-navigation.json"
|
|
|
4
4
|
export default {
|
|
5
5
|
data() {
|
|
6
6
|
return {
|
|
7
|
+
cmdAccordionSettingsData: {
|
|
8
|
+
cmdHeadline: {
|
|
9
|
+
headlineText: "Summary",
|
|
10
|
+
headlineLevel: 4
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
cmdAccordionSettingsControls: {
|
|
14
|
+
highlightLevel: [
|
|
15
|
+
{
|
|
16
|
+
text: "none (default)",
|
|
17
|
+
value: "none"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
text: "primary",
|
|
21
|
+
value: "primary"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
text: "secondary",
|
|
25
|
+
value: "secondary"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
text: "tertiary",
|
|
29
|
+
value: "tertiary"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
7
33
|
cmdAddressDataSettingsData: {
|
|
8
34
|
cmdHeadline: {
|
|
9
35
|
headlineText: "Address Data",
|
|
@@ -724,6 +750,12 @@ export default {
|
|
|
724
750
|
showCounter: true,
|
|
725
751
|
showSlideButtons: true
|
|
726
752
|
},
|
|
753
|
+
smartSearchSettingsData: {
|
|
754
|
+
maxNumberOfRecommendations: 3,
|
|
755
|
+
filterByFirstLetter: false,
|
|
756
|
+
openListToTop: false,
|
|
757
|
+
allowUserToEnterNewTerm: true
|
|
758
|
+
},
|
|
727
759
|
cmdSocialNetworksSettingsData: {
|
|
728
760
|
align: "left",
|
|
729
761
|
useGap: true,
|
|
@@ -971,8 +1003,9 @@ export default {
|
|
|
971
1003
|
cmdTooltipSettingsData: {
|
|
972
1004
|
tooltipText: "This is a tooltip!",
|
|
973
1005
|
delayToShowTooltip: 0,
|
|
974
|
-
|
|
975
|
-
toggleVisibilityByClick: false
|
|
1006
|
+
delayToHideTooltip: 100,
|
|
1007
|
+
toggleVisibilityByClick: false,
|
|
1008
|
+
showCloseIcon: true
|
|
976
1009
|
},
|
|
977
1010
|
cmdTooltipSettingsControls: {
|
|
978
1011
|
status: [
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- begin CmdAccordion ---------------------------------------------------------------------------------------- -->
|
|
3
|
+
<details :class="['cmd-accordion', highlightLevel]" :name="accordionName">
|
|
4
|
+
<summary>
|
|
5
|
+
<span :class="[cmdIconClosed.iconClass, 'closed']" :title="cmdIconClosed.tooltip"></span>
|
|
6
|
+
<span :class="[cmdIconOpen.iconClass, 'open']" :title="cmdIconOpen.tooltip"></span>
|
|
7
|
+
<CmdHeadline v-bind="cmdHeadlineProperties" />
|
|
8
|
+
</summary>
|
|
9
|
+
<div class="accordion-body">
|
|
10
|
+
<!-- begin slot-content -->
|
|
11
|
+
<slot>
|
|
12
|
+
<p v-html="textAccordionBody">
|
|
13
|
+
</p>
|
|
14
|
+
</slot>
|
|
15
|
+
<!-- end slot-content -->
|
|
16
|
+
</div>
|
|
17
|
+
</details>
|
|
18
|
+
<!-- end CmdAccordion ---------------------------------------------------------------------------------------- -->
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
export default {
|
|
23
|
+
name: "CmdAccordion",
|
|
24
|
+
props: {
|
|
25
|
+
/**
|
|
26
|
+
* set highlight-level for headline
|
|
27
|
+
*
|
|
28
|
+
* @allowedValues: "none", "primary", "secondary", "tertiary"
|
|
29
|
+
*/
|
|
30
|
+
highlightLevel: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "none",
|
|
33
|
+
validator(value) {
|
|
34
|
+
return value === "none" ||
|
|
35
|
+
value === "primary" ||
|
|
36
|
+
value === "secondary" ||
|
|
37
|
+
value === "tertiary"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* (html-)text for accordion-body
|
|
42
|
+
*/
|
|
43
|
+
textAccordionBody: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: false
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* properties for CmdIcon-component if accordion is collapsed/closed
|
|
49
|
+
*/
|
|
50
|
+
cmdIconClosed: {
|
|
51
|
+
type: Object,
|
|
52
|
+
default() {
|
|
53
|
+
return {
|
|
54
|
+
iconClass: "icon-chevron-one-stripe-right",
|
|
55
|
+
tooltip: "Expand accordion"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* properties for CmdIcon-component if accordion is expanded/open
|
|
61
|
+
*/
|
|
62
|
+
cmdIconOpen: {
|
|
63
|
+
type: Object,
|
|
64
|
+
default() {
|
|
65
|
+
return {
|
|
66
|
+
iconClass: "icon-chevron-one-stripe-down",
|
|
67
|
+
tooltip: "Collapse accordion"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
/**
|
|
72
|
+
* accordion-name is required if multiple-accrdion-boxes should be connect (name must be identical)
|
|
73
|
+
*/
|
|
74
|
+
accordionName: {
|
|
75
|
+
type: Object,
|
|
76
|
+
required: false
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* properties for CmdHeadline-component
|
|
80
|
+
*/
|
|
81
|
+
cmdHeadline: {
|
|
82
|
+
type: Object,
|
|
83
|
+
requiered: true
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
computed: {
|
|
87
|
+
cmdHeadlineProperties() {
|
|
88
|
+
return {
|
|
89
|
+
headlineLevel: 4,
|
|
90
|
+
...this.cmdHeadline
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<style>
|
|
98
|
+
.cmd-accordion {
|
|
99
|
+
summary {
|
|
100
|
+
.cmd-headline {
|
|
101
|
+
margin: 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
</style>
|
|
@@ -269,7 +269,7 @@ export default {
|
|
|
269
269
|
DefaultMessageProperties,
|
|
270
270
|
GlobalCurrency
|
|
271
271
|
],
|
|
272
|
-
emits: ["click", "toggle-collapse"],
|
|
272
|
+
emits: ["click", "toggle-collapse", "toggle-cutofftext"],
|
|
273
273
|
data() {
|
|
274
274
|
return {
|
|
275
275
|
open: this.collapsible ? this.openCollapsedBox : true,
|
|
@@ -554,16 +554,16 @@ export default {
|
|
|
554
554
|
this.open = !this.open
|
|
555
555
|
this.active = !this.active
|
|
556
556
|
|
|
557
|
-
this.$emit(
|
|
557
|
+
this.$emit("toggle-collapse", this.open)
|
|
558
558
|
},
|
|
559
559
|
// toggle cutofftext (between full and faded text)
|
|
560
560
|
toggleCutOffText() {
|
|
561
561
|
this.showCutOffText = !this.showCutOffText
|
|
562
|
-
this.$emit(
|
|
562
|
+
this.$emit("toggle-cutofftext", this.showCutOffText)
|
|
563
563
|
},
|
|
564
564
|
// for boxType === product
|
|
565
565
|
clickOnProduct(product) {
|
|
566
|
-
this.$emit(
|
|
566
|
+
this.$emit("click", product)
|
|
567
567
|
},
|
|
568
568
|
// set focus on first input if box contains form-elements
|
|
569
569
|
setFocus() {
|
|
@@ -135,7 +135,7 @@ export default {
|
|
|
135
135
|
if (this.contentOrientation) {
|
|
136
136
|
htmlClasses.push(this.contentOrientation === "vertical" ? "flex-direction-column" : null)
|
|
137
137
|
}
|
|
138
|
-
if (this.
|
|
138
|
+
if (this.noGap) {
|
|
139
139
|
htmlClasses.push("no-gap")
|
|
140
140
|
}
|
|
141
141
|
if (this.flexNone) {
|
|
@@ -21,34 +21,43 @@
|
|
|
21
21
|
<span class="label-text">
|
|
22
22
|
<span :id="htmlId">{{ labelText }}<sup v-if="$attrs.required !== undefined" aria-hidden="true">*</sup></span>
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
<!-- begin status-icon (linked with tooltip) -->
|
|
25
|
+
<button v-if="($attrs.required || inputRequirements.length) && showStatusIcon"
|
|
26
|
+
type="button"
|
|
27
|
+
class="no-style"
|
|
28
|
+
:title="validationTooltip"
|
|
29
|
+
:aria-errormessage="tooltipId"
|
|
30
|
+
aria-live="assertive"
|
|
31
|
+
:popovertarget="'tooltip-target-' + htmlId"
|
|
32
|
+
:style="'anchor-name: --tooltip-anchor-' + htmlId"
|
|
33
|
+
>
|
|
34
|
+
<!-- begin CmdIcon -->
|
|
35
|
+
<CmdIcon :iconClass="getStatusIconClass" />
|
|
36
36
|
<!-- end CmdIcon -->
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
</button>
|
|
38
|
+
<!-- end status-icon (linked with tooltip) -->
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
style="border: 1px solid red;"
|
|
40
|
+
<!-- begin CmdTooltip -->
|
|
41
|
+
<CmdTooltip
|
|
43
42
|
ref="tooltip"
|
|
43
|
+
:class="['cmd-tooltip-for-form-elements box', validationStatus]"
|
|
44
|
+
:id="'tooltip-target-' + htmlId"
|
|
45
|
+
:scrollContainer="scrollContainerForTooltip"
|
|
46
|
+
:popoverTargetName="'tooltip-target-' + htmlId"
|
|
44
47
|
:validationStatus="validationStatus"
|
|
45
|
-
:validationMessage="getValidationMessage"
|
|
46
|
-
:relatedId="tooltipId"
|
|
47
|
-
:tooltipPopoverTargetName="tooltipPopoverTargetName"
|
|
48
|
-
:cmdListOfRequirements="listOfRequirements"
|
|
49
48
|
:role="validationStatus === 'error' ? 'alert' : 'dialog'"
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
:toggle-visibility-by-click="true"
|
|
50
|
+
:style="'position-anchor: --tooltip-anchor-' + htmlId"
|
|
51
|
+
>
|
|
52
|
+
|
|
53
|
+
<!-- begin CmdListOfRequirements -->
|
|
54
|
+
<CmdListOfRequirements
|
|
55
|
+
v-if="cmdListOfRequirementsProperties.showRequirements"
|
|
56
|
+
v-bind="cmdListOfRequirementsProperties"
|
|
57
|
+
/>
|
|
58
|
+
<!-- end CmdListOfRequirements -->
|
|
59
|
+
</CmdTooltip>
|
|
60
|
+
<!-- end CmdTooltip -->
|
|
52
61
|
</span>
|
|
53
62
|
<!-- end label -->
|
|
54
63
|
</template>
|
|
@@ -200,6 +209,7 @@ export default {
|
|
|
200
209
|
Identifier,
|
|
201
210
|
Tooltip
|
|
202
211
|
],
|
|
212
|
+
emits: ["validation-status-change", "update:modelValue"],
|
|
203
213
|
data() {
|
|
204
214
|
return {
|
|
205
215
|
showOptions: false,
|
|
@@ -215,6 +225,13 @@ export default {
|
|
|
215
225
|
type: String,
|
|
216
226
|
default: 'tooltip-target-' + createUuid()
|
|
217
227
|
},
|
|
228
|
+
/**
|
|
229
|
+
* specify a scroll-container which scrolling hides the tooltip
|
|
230
|
+
*/
|
|
231
|
+
scrollContainerForTooltip: {
|
|
232
|
+
type: String,
|
|
233
|
+
required: false
|
|
234
|
+
},
|
|
218
235
|
/**
|
|
219
236
|
* set different default selectbox-types for
|
|
220
237
|
*
|
|
@@ -371,9 +388,29 @@ export default {
|
|
|
371
388
|
iconType: "auto"
|
|
372
389
|
}
|
|
373
390
|
}
|
|
374
|
-
}
|
|
391
|
+
},
|
|
392
|
+
/**
|
|
393
|
+
* properties for CmdListOfRequirements-component
|
|
394
|
+
*/
|
|
395
|
+
cmdListOfRequirements: {
|
|
396
|
+
type: Object,
|
|
397
|
+
required: false
|
|
398
|
+
}
|
|
375
399
|
},
|
|
376
400
|
computed: {
|
|
401
|
+
cmdListOfRequirementsProperties() {
|
|
402
|
+
return {
|
|
403
|
+
showRequirements: true,
|
|
404
|
+
validationTooltip: "",
|
|
405
|
+
inputRequirements: [],
|
|
406
|
+
inputAttributes: {},
|
|
407
|
+
showHeadline: true,
|
|
408
|
+
inputModelValue: "",
|
|
409
|
+
helplink: {},
|
|
410
|
+
labelText: "",
|
|
411
|
+
...this.cmdListOfRequirements
|
|
412
|
+
}
|
|
413
|
+
},
|
|
377
414
|
validationTooltip() {
|
|
378
415
|
if (!this.useCustomTooltip) {
|
|
379
416
|
return this.getValidationMessage
|
|
@@ -465,7 +502,7 @@ export default {
|
|
|
465
502
|
}
|
|
466
503
|
|
|
467
504
|
this.$emit("update:modelValue", checkboxValues)
|
|
468
|
-
this.$emit(
|
|
505
|
+
this.$emit("validation-status-change", this.validationStatus)
|
|
469
506
|
},
|
|
470
507
|
// toggle options/dropdown
|
|
471
508
|
toggleOptions() {
|
|
@@ -491,8 +528,8 @@ export default {
|
|
|
491
528
|
// hide options after selection
|
|
492
529
|
this.showOptions = false
|
|
493
530
|
|
|
494
|
-
this.$emit(
|
|
495
|
-
this.$emit(
|
|
531
|
+
this.$emit("update:modelValue", optionValue)
|
|
532
|
+
this.$emit("validation-status-change", this.validationStatus)
|
|
496
533
|
},
|
|
497
534
|
// check if a checkbox is changed for selectbox with checkboxes
|
|
498
535
|
optionSelect(event) {
|
|
@@ -508,7 +545,7 @@ export default {
|
|
|
508
545
|
this.validationStatus = "error"
|
|
509
546
|
}
|
|
510
547
|
|
|
511
|
-
this.$emit(
|
|
548
|
+
this.$emit("update:modelValue", value)
|
|
512
549
|
},
|
|
513
550
|
// hide options (in dropdown)
|
|
514
551
|
closeOptions() {
|
|
@@ -526,7 +563,7 @@ export default {
|
|
|
526
563
|
this.validationStatus = "error"
|
|
527
564
|
}
|
|
528
565
|
|
|
529
|
-
this.$emit(
|
|
566
|
+
this.$emit("validation-status-change", this.validationStatus)
|
|
530
567
|
},
|
|
531
568
|
// overwrite requirement-message form fieldValidation.js
|
|
532
569
|
getRequirementMessage() {
|
|
@@ -160,7 +160,7 @@ import CmdSystemMessage from "@/components/CmdSystemMessage.vue";
|
|
|
160
160
|
export default {
|
|
161
161
|
name: "CmdForm",
|
|
162
162
|
components: {CmdSystemMessage},
|
|
163
|
-
emits: ["submit", "update:modelValue"],
|
|
163
|
+
emits: ["validation-status-change", "submit", "update:modelValue"],
|
|
164
164
|
data() {
|
|
165
165
|
return {
|
|
166
166
|
errorOccurred: false,
|