@demos-europe/demosplan-ui 0.0.1
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/LICENSE +21 -0
- package/buildTokens.js +59 -0
- package/components/DpButton/DpButton.stories.mdx +136 -0
- package/components/DpButton/DpButton.vue +118 -0
- package/components/DpDetails/DpDetails.stories.mdx +55 -0
- package/components/DpDetails/DpDetails.vue +58 -0
- package/components/DpIcon/DpIcon.stories.mdx +396 -0
- package/components/DpIcon/DpIcon.vue +51 -0
- package/components/DpIcon/util/iconVariables.js +148 -0
- package/components/DpInput/DpInput.stories.mdx +127 -0
- package/components/DpInput/DpInput.vue +284 -0
- package/components/DpLabel/DpLabel.stories.mdx +103 -0
- package/components/DpLabel/DpLabel.vue +112 -0
- package/components/DpLoading/DpLoading.stories.mdx +63 -0
- package/components/DpLoading/DpLoading.vue +63 -0
- package/components/core/DpAccordion.vue +108 -0
- package/components/core/DpAnonymizeText.vue +136 -0
- package/components/core/DpAutocomplete.vue +133 -0
- package/components/core/DpBulkEditHeader.vue +53 -0
- package/components/core/DpButtonIcon.vue +47 -0
- package/components/core/DpButtonRow.vue +155 -0
- package/components/core/DpCard.vue +54 -0
- package/components/core/DpChangeStateAtDate.vue +223 -0
- package/components/core/DpCheckboxGroup.vue +93 -0
- package/components/core/DpContextualHelp.vue +54 -0
- package/components/core/DpCopyPasteButton.vue +47 -0
- package/components/core/DpDashboardTaskCard.vue +123 -0
- package/components/core/DpDataTable/DataTableSearch.js +44 -0
- package/components/core/DpDataTable/DpColumnSelector.vue +133 -0
- package/components/core/DpDataTable/DpDataTable.vue +647 -0
- package/components/core/DpDataTable/DpDataTableExtended.vue +377 -0
- package/components/core/DpDataTable/DpResizeHandle.vue +37 -0
- package/components/core/DpDataTable/DpSelectPageItemCount.vue +70 -0
- package/components/core/DpDataTable/DpTableHeader.vue +197 -0
- package/components/core/DpDataTable/DpTableRow.vue +355 -0
- package/components/core/DpDataTable/DpWrapTrigger.vue +48 -0
- package/components/core/DpDataTable/lib/ResizableColumns.js +83 -0
- package/components/core/DpEditableList.vue +161 -0
- package/components/core/DpEditor/DpBoilerPlate.vue +140 -0
- package/components/core/DpEditor/DpBoilerPlateModal.vue +166 -0
- package/components/core/DpEditor/DpEditor.vue +1281 -0
- package/components/core/DpEditor/DpLinkModal.vue +117 -0
- package/components/core/DpEditor/DpRecommendationModal/DpInsertableRecommendation.vue +137 -0
- package/components/core/DpEditor/DpRecommendationModal.vue +283 -0
- package/components/core/DpEditor/DpResizableImage.vue +121 -0
- package/components/core/DpEditor/DpUploadModal.vue +121 -0
- package/components/core/DpEditor/libs/Decoration.js +66 -0
- package/components/core/DpEditor/libs/SegmentRangeChangePlugin.js +35 -0
- package/components/core/DpEditor/libs/editorAnonymize.js +66 -0
- package/components/core/DpEditor/libs/editorBuildSuggestion.js +269 -0
- package/components/core/DpEditor/libs/editorCustomDelete.js +32 -0
- package/components/core/DpEditor/libs/editorCustomImage.js +100 -0
- package/components/core/DpEditor/libs/editorCustomInsert.js +32 -0
- package/components/core/DpEditor/libs/editorCustomLink.js +46 -0
- package/components/core/DpEditor/libs/editorCustomMark.js +32 -0
- package/components/core/DpEditor/libs/editorInsertAtCursorPos.js +41 -0
- package/components/core/DpEditor/libs/editorObscure.js +60 -0
- package/components/core/DpEditor/libs/editorUnAnonymize.js +56 -0
- package/components/core/DpEditor/libs/handleWordPaste.js +360 -0
- package/components/core/DpEditor/libs/preventDrop.js +31 -0
- package/components/core/DpEditor/libs/preventKeyboardInput.js +27 -0
- package/components/core/DpEditor/libs/preventPaste.js +28 -0
- package/components/core/DpFlyout.vue +119 -0
- package/components/core/DpInlineNotification.vue +116 -0
- package/components/core/DpModal.vue +208 -0
- package/components/core/DpObscure.vue +29 -0
- package/components/core/DpPager.vue +139 -0
- package/components/core/DpProgressBar.vue +67 -0
- package/components/core/DpRegisterFlyout.vue +58 -0
- package/components/core/DpResettableInput.vue +140 -0
- package/components/core/DpSkeletonBox.vue +32 -0
- package/components/core/DpSlidebar.vue +86 -0
- package/components/core/DpSlidingPagination.vue +45 -0
- package/components/core/DpSplitButton.vue +77 -0
- package/components/core/DpSwitcher.vue +62 -0
- package/components/core/DpTableCardList/DpTableCard.vue +61 -0
- package/components/core/DpTableCardList/DpTableCardListHeader.vue +83 -0
- package/components/core/DpTabs/DpTab.vue +52 -0
- package/components/core/DpTabs/DpTabs.vue +165 -0
- package/components/core/DpTextWrapper.vue +65 -0
- package/components/core/DpToggleForm.vue +72 -0
- package/components/core/DpTooltipIcon.vue +52 -0
- package/components/core/DpTransitionExpand.vue +87 -0
- package/components/core/DpTreeList/DpTreeList.vue +334 -0
- package/components/core/DpTreeList/DpTreeListCheckbox.vue +79 -0
- package/components/core/DpTreeList/DpTreeListNode.vue +348 -0
- package/components/core/DpTreeList/DpTreeListToggle.vue +71 -0
- package/components/core/DpTreeList/utils/constants.js +14 -0
- package/components/core/DpUpload/DpUpload.vue +223 -0
- package/components/core/DpUpload/DpUploadFiles.vue +269 -0
- package/components/core/DpUpload/DpUploadedFile.vue +80 -0
- package/components/core/DpUpload/DpUploadedFileList.vue +56 -0
- package/components/core/DpUpload/utils/GetFileIdsByHash.js +42 -0
- package/components/core/DpUpload/utils/UppyTranslations.js +31 -0
- package/components/core/DpVideoPlayer.vue +115 -0
- package/components/core/HeightLimit.vue +121 -0
- package/components/core/MultistepNav.vue +89 -0
- package/components/core/form/DpCheckbox.vue +108 -0
- package/components/core/form/DpDateRangePicker.vue +186 -0
- package/components/core/form/DpDatepicker.vue +160 -0
- package/components/core/form/DpDatetimePicker.vue +194 -0
- package/components/core/form/DpFormRow.vue +79 -0
- package/components/core/form/DpMultiselect.vue +164 -0
- package/components/core/form/DpRadio.vue +128 -0
- package/components/core/form/DpSearchField.vue +110 -0
- package/components/core/form/DpSelect.vue +149 -0
- package/components/core/form/DpTextArea.vue +152 -0
- package/components/core/form/DpTimePicker.vue +374 -0
- package/components/core/form/DpToggle.vue +78 -0
- package/components/core/index.js +132 -0
- package/components/core/notify/DpNotifyContainer.vue +122 -0
- package/components/core/notify/DpNotifyMessage.vue +95 -0
- package/components/core/shared/DpStickyElement.vue +95 -0
- package/components/index.js +24 -0
- package/components/shared/translations.js +15 -0
- package/directives/CleanHtml/CleanHtml.js +50 -0
- package/directives/CleanHtml/CleanHtml.stories.mdx +64 -0
- package/directives/Tooltip/Tooltip.js +40 -0
- package/directives/Tooltip/Tooltip.stories.mdx +42 -0
- package/directives/index.js +17 -0
- package/lib/index.js +14 -0
- package/lib/prefixClass.js +47 -0
- package/mixins/index.js +14 -0
- package/mixins/prefixClassMixin.js +22 -0
- package/package.json +52 -0
- package/shared/props.js +86 -0
- package/style/index.css +7 -0
- package/tailwind.config.js +24 -0
- package/tokens/color.json +358 -0
- package/tokens/color.stories.mdx +45 -0
- package/tokens/fontSize.json +100 -0
- package/tokens/space.json +33 -0
- package/utils/lengthHint.js +69 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<license>
|
|
2
|
+
(c) 2010-present DEMOS E-Partizipation GmbH.
|
|
3
|
+
|
|
4
|
+
This file is part of the package @demos-europe/demosplan-ui,
|
|
5
|
+
for more information see the license file.
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
</license>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<dp-flyout
|
|
12
|
+
align="left"
|
|
13
|
+
class="u-ml-0_5"
|
|
14
|
+
:has-menu="false">
|
|
15
|
+
<template v-slot:trigger>
|
|
16
|
+
<div class="c-header__nav-item-link">
|
|
17
|
+
{{ Translator.trans('register.action') }}
|
|
18
|
+
<i
|
|
19
|
+
class="fa fa-angle-down"
|
|
20
|
+
aria-hidden="true" />
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<div class="space-stack-s">
|
|
25
|
+
<a
|
|
26
|
+
class="display--block"
|
|
27
|
+
:href="Routing.generate('DemosPlan_citizen_registration_form')"
|
|
28
|
+
v-text="Translator.trans('register')" />
|
|
29
|
+
<a
|
|
30
|
+
class="display--block"
|
|
31
|
+
:href="Routing.generate('DemosPlan_orga_register_form')"
|
|
32
|
+
v-text="Translator.trans('register.orga')" />
|
|
33
|
+
</div>
|
|
34
|
+
</dp-flyout>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import DpFlyout from './DpFlyout'
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
name: 'DpRegisterFlyout',
|
|
42
|
+
|
|
43
|
+
components: {
|
|
44
|
+
DpFlyout
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
mounted () {
|
|
48
|
+
/*
|
|
49
|
+
* The placeholder element is shown until all javascript has been loaded
|
|
50
|
+
* and parsed to prevent a flash of missing content.
|
|
51
|
+
*/
|
|
52
|
+
const placeholder = document.getElementById('registerFlyoutPlaceholder')
|
|
53
|
+
if (placeholder) {
|
|
54
|
+
placeholder.remove()
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<license>
|
|
2
|
+
(c) 2010-present DEMOS E-Partizipation GmbH.
|
|
3
|
+
|
|
4
|
+
This file is part of the package @demos-europe/demosplan-ui,
|
|
5
|
+
for more information see the license file.
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
</license>
|
|
9
|
+
|
|
10
|
+
<documentation>
|
|
11
|
+
<!--
|
|
12
|
+
An Inputfield wich comes with an dismiss-icon if there is some Text typed.
|
|
13
|
+
|
|
14
|
+
Clicking the dismiss-"x" emits "reset".
|
|
15
|
+
|
|
16
|
+
To provide the interface for dpInput all configuration attributes for the input can be passed via `inputAttributes`.
|
|
17
|
+
|
|
18
|
+
-->
|
|
19
|
+
</documentation>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div class="position--relative">
|
|
23
|
+
<dp-input
|
|
24
|
+
:id="id"
|
|
25
|
+
:data-cy="dataCy"
|
|
26
|
+
has-icon
|
|
27
|
+
:required="required"
|
|
28
|
+
v-bind="inputAttributes"
|
|
29
|
+
@blur="$emit('blur', currentValue)"
|
|
30
|
+
@input="$emit('input', currentValue)"
|
|
31
|
+
@enter="$emit('enter', currentValue)"
|
|
32
|
+
@focus="$emit('focus')"
|
|
33
|
+
:pattern="pattern"
|
|
34
|
+
v-model="currentValue" />
|
|
35
|
+
<button
|
|
36
|
+
v-if="!inputAttributes.disabled"
|
|
37
|
+
class="btn--blank o-link--default"
|
|
38
|
+
:class="buttonClass"
|
|
39
|
+
:disabled="currentValue === defaultValue"
|
|
40
|
+
@click="resetValue">
|
|
41
|
+
<dp-icon
|
|
42
|
+
icon="xmark"
|
|
43
|
+
:size="iconSize" />
|
|
44
|
+
</button>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import { DpIcon, DpInput } from 'demosplan-ui/components'
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
name: 'DpResettableInput',
|
|
53
|
+
|
|
54
|
+
components: {
|
|
55
|
+
DpIcon,
|
|
56
|
+
DpInput
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
props: {
|
|
60
|
+
dataCy: {
|
|
61
|
+
type: String,
|
|
62
|
+
required: false,
|
|
63
|
+
default: ''
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* By default, the normal variant is used. If set to 'small', a smaller variant is displayed
|
|
68
|
+
*/
|
|
69
|
+
buttonVariant: {
|
|
70
|
+
type: String,
|
|
71
|
+
required: false,
|
|
72
|
+
default: 'medium',
|
|
73
|
+
validator: (prop) => ['small', 'medium'].includes(prop)
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
defaultValue: {
|
|
77
|
+
type: String,
|
|
78
|
+
required: false,
|
|
79
|
+
default: ''
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
id: {
|
|
83
|
+
type: String,
|
|
84
|
+
required: true
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
inputAttributes: {
|
|
88
|
+
type: Object,
|
|
89
|
+
required: false,
|
|
90
|
+
default: () => ({})
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
pattern: {
|
|
94
|
+
type: String,
|
|
95
|
+
required: false,
|
|
96
|
+
default: ''
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
required: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
required: false,
|
|
102
|
+
default: false
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
value: {
|
|
106
|
+
type: String,
|
|
107
|
+
required: false,
|
|
108
|
+
default: ''
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
data () {
|
|
113
|
+
return {
|
|
114
|
+
currentValue: this.value
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
computed: {
|
|
119
|
+
buttonClass () {
|
|
120
|
+
return this.buttonVariant === 'small' ? 'o-form__control-search-reset--small' : 'o-form__control-search-reset'
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
iconSize () {
|
|
124
|
+
return this.buttonVariant
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
watch: {
|
|
129
|
+
value: function () {
|
|
130
|
+
this.currentValue = this.value
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
methods: {
|
|
135
|
+
resetValue () {
|
|
136
|
+
this.$emit('reset')
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<license>
|
|
2
|
+
(c) 2010-present DEMOS E-Partizipation GmbH.
|
|
3
|
+
|
|
4
|
+
This file is part of the package @demos-europe/demosplan-ui,
|
|
5
|
+
for more information see the license file.
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
</license>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<span
|
|
12
|
+
:style="{height: height, width: width}"
|
|
13
|
+
class="c-skeleton-box" />
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'DpSkeletonBox',
|
|
19
|
+
|
|
20
|
+
props: {
|
|
21
|
+
height: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '1em'
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
width: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: '100%'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<license>
|
|
2
|
+
(c) 2010-present DEMOS E-Partizipation GmbH.
|
|
3
|
+
|
|
4
|
+
This file is part of the package @demos-europe/demosplan-ui,
|
|
5
|
+
for more information see the license file.
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
</license>
|
|
9
|
+
|
|
10
|
+
<documentation>
|
|
11
|
+
<!-- This component initializes a SideNav instance and contains a minimal template (mostly for the closing button)
|
|
12
|
+
closing happens via data-slidebar-hide attribute; opening happens via emitted event instead of data-slidebar-show attribute
|
|
13
|
+
because sidenav may be initialized before corresponding DOM elements exist
|
|
14
|
+
|
|
15
|
+
Put content inside the default slot
|
|
16
|
+
-->
|
|
17
|
+
</documentation>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div
|
|
21
|
+
class="c-slidebar u-pr-0"
|
|
22
|
+
data-slidebar="right">
|
|
23
|
+
<div
|
|
24
|
+
class="c-slidebar__container"
|
|
25
|
+
data-slidebar-container=""
|
|
26
|
+
data-cy="sidebarModal">
|
|
27
|
+
<div class="u-ml-1_5">
|
|
28
|
+
<button
|
|
29
|
+
type="button"
|
|
30
|
+
class="btn--blank o-link--default u-mt-0_5 u-n-ml u-mb u-p-0_25"
|
|
31
|
+
@click="$emit('close')"
|
|
32
|
+
data-slidebar-hide="">
|
|
33
|
+
<dp-icon icon="close" />
|
|
34
|
+
</button>
|
|
35
|
+
<slot />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import { hasOwnProp, SideNav } from 'demosplan-utils'
|
|
43
|
+
import { DpIcon } from 'demosplan-ui/components'
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
name: 'DpSlidebar',
|
|
47
|
+
|
|
48
|
+
components: {
|
|
49
|
+
DpIcon
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
data () {
|
|
53
|
+
return {
|
|
54
|
+
sideNav: {}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
methods: {
|
|
59
|
+
hideSlideBar () {
|
|
60
|
+
if (hasOwnProp(this.sideNav, 'hideSideNav')) {
|
|
61
|
+
this.sideNav.hideSideNav()
|
|
62
|
+
this.$emit('close')
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
showSlideBar () {
|
|
67
|
+
if (hasOwnProp(this.sideNav, 'showSideNav')) {
|
|
68
|
+
this.sideNav.showSideNav()
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
mounted () {
|
|
74
|
+
// Initialize SideNav
|
|
75
|
+
this.sideNav = new SideNav()
|
|
76
|
+
|
|
77
|
+
this.$root.$on('hide-slidebar', () => {
|
|
78
|
+
this.hideSlideBar()
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
this.$root.$on('show-slidebar', () => {
|
|
82
|
+
this.showSlideBar()
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</script>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<license>
|
|
2
|
+
(c) 2010-present DEMOS E-Partizipation GmbH.
|
|
3
|
+
|
|
4
|
+
This file is part of the package @demos-europe/demosplan-ui,
|
|
5
|
+
for more information see the license file.
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
</license>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { prefixClass } from 'demosplan-ui/lib'
|
|
12
|
+
import SlidingPagination from 'vue-sliding-pagination'
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'DpSlidingPagination',
|
|
16
|
+
functional: true,
|
|
17
|
+
methods: {
|
|
18
|
+
prefixClass (classList) {
|
|
19
|
+
return prefixClass(classList)
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
render (createElement, context) {
|
|
23
|
+
const current = context.data.attrs.current
|
|
24
|
+
const total = context.data.attrs.total
|
|
25
|
+
const customizedProperties = {
|
|
26
|
+
ariaPaginationLabel: Translator.trans('pager.label'),
|
|
27
|
+
ariaGotoPageLabel: Translator.trans('pager.goto.page.from.pages', { page: current, total: total }),
|
|
28
|
+
ariaPreviousPageLabel: Translator.trans('pager.previous'),
|
|
29
|
+
ariaNextPageLabel: Translator.trans('pager.next'),
|
|
30
|
+
ariaCurrentPageLabel: Translator.trans('pager.page.from.pages.current.page', { page: current, total: total }),
|
|
31
|
+
classMap: {
|
|
32
|
+
componentClass: prefixClass('c-sliding-pagination'),
|
|
33
|
+
list: prefixClass('c-sliding-pagination__list'),
|
|
34
|
+
element: prefixClass('c-sliding-pagination__list-element'),
|
|
35
|
+
elementDisabled: prefixClass('c-sliding-pagination__list-element--disabled'),
|
|
36
|
+
elementActive: prefixClass('c-sliding-pagination__list-element--active'),
|
|
37
|
+
page: prefixClass('c-sliding-pagination__page')
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
context.data.attrs = { ...context.data.attrs, ...customizedProperties }
|
|
41
|
+
|
|
42
|
+
return createElement(SlidingPagination, context.data, context.children)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<license>
|
|
2
|
+
(c) 2010-present DEMOS E-Partizipation GmbH.
|
|
3
|
+
|
|
4
|
+
This file is part of the package @demos-europe/demosplan-ui,
|
|
5
|
+
for more information see the license file.
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
</license>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
v-click-outside="close"
|
|
13
|
+
class="c-splitbutton">
|
|
14
|
+
<slot>
|
|
15
|
+
<button
|
|
16
|
+
class="btn btn--primary"
|
|
17
|
+
type="button">
|
|
18
|
+
Primary Action Button
|
|
19
|
+
</button>
|
|
20
|
+
</slot><!--
|
|
21
|
+
--><button
|
|
22
|
+
v-if="hasDropdownContent"
|
|
23
|
+
class="c-splitbutton__trigger"
|
|
24
|
+
:class="{'is-open': isOpen}"
|
|
25
|
+
type="button"
|
|
26
|
+
aria-haspopup="true"
|
|
27
|
+
:aria-expanded="isOpen"
|
|
28
|
+
@click="toggleDropdown"
|
|
29
|
+
@keyup.esc.prevent="isOpen ? isOpen = !isOpen : ''">
|
|
30
|
+
<i class="fa fa-caret-down c-splitbutton__trigger-icon" />
|
|
31
|
+
<span class="hide-visually">{{ Translator.trans(isOpen ? 'dropdown.close' : 'dropdown.open') }}</span>
|
|
32
|
+
</button>
|
|
33
|
+
<div
|
|
34
|
+
v-if="hasDropdownContent"
|
|
35
|
+
class="c-splitbutton__dropdown"
|
|
36
|
+
role="menu"
|
|
37
|
+
:class="{'is-open': isOpen}">
|
|
38
|
+
<slot name="dropdown">
|
|
39
|
+
Dropdown Actions
|
|
40
|
+
</slot>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
import ClickOutside from 'vue-click-outside'
|
|
47
|
+
|
|
48
|
+
export default {
|
|
49
|
+
name: 'DpSplitButton',
|
|
50
|
+
|
|
51
|
+
directives: {
|
|
52
|
+
ClickOutside
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
data () {
|
|
56
|
+
return {
|
|
57
|
+
isOpen: false,
|
|
58
|
+
hasDropdownContent: false
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
methods: {
|
|
63
|
+
close () {
|
|
64
|
+
this.isOpen = false
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
toggleDropdown () {
|
|
68
|
+
this.isOpen = (this.isOpen === false)
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
mounted () {
|
|
73
|
+
this.popupItem = this.$el
|
|
74
|
+
this.hasDropdownContent = (typeof this.$slots.dropdown !== 'undefined')
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<license>
|
|
2
|
+
(c) 2010-present DEMOS E-Partizipation GmbH.
|
|
3
|
+
|
|
4
|
+
This file is part of the package @demos-europe/demosplan-ui,
|
|
5
|
+
for more information see the license file.
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
</license>
|
|
9
|
+
|
|
10
|
+
<!--
|
|
11
|
+
This component is the generic switcher (toggle) component. It toggles the view/values between two states. The two options (states) are defined in parent with slots: option1 and option2.
|
|
12
|
+
If the first option is checked, the data: isFirstOptionActive = true. On click the toggle method emits the 'input' event to the parent.
|
|
13
|
+
|
|
14
|
+
For now the component is used in DpFragmentSwitcher component, which toggles the statements/fragments view in the assessment table.
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div class="o-switcher">
|
|
19
|
+
<input
|
|
20
|
+
type="checkbox"
|
|
21
|
+
:id="inputId "
|
|
22
|
+
@change="toggle">
|
|
23
|
+
<label :for="inputId">
|
|
24
|
+
<div
|
|
25
|
+
class="o-switcher__option float--left"
|
|
26
|
+
:class="{'o-switcher__option--checked': active}">
|
|
27
|
+
<slot name="option1" />
|
|
28
|
+
</div>
|
|
29
|
+
<div
|
|
30
|
+
class="o-switcher__option float--right"
|
|
31
|
+
:class="{'o-switcher__option--checked': false === active}"
|
|
32
|
+
data-cy="fragmentTab">
|
|
33
|
+
<slot name="option2" />
|
|
34
|
+
</div>
|
|
35
|
+
</label>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
export default {
|
|
41
|
+
name: 'DpSwitcher',
|
|
42
|
+
|
|
43
|
+
props: {
|
|
44
|
+
active: {
|
|
45
|
+
required: false,
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
inputId: {
|
|
51
|
+
required: true,
|
|
52
|
+
type: String
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
methods: {
|
|
57
|
+
toggle () {
|
|
58
|
+
this.$emit('input', (this.active === false))
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<license>
|
|
2
|
+
(c) 2010-present DEMOS E-Partizipation GmbH.
|
|
3
|
+
|
|
4
|
+
This file is part of the package @demos-europe/demosplan-ui,
|
|
5
|
+
for more information see the license file.
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
</license>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<li
|
|
12
|
+
:class="{'is-expanded': isOpen}"
|
|
13
|
+
v-cloak>
|
|
14
|
+
<!-- item header -->
|
|
15
|
+
<div
|
|
16
|
+
data-add-animation>
|
|
17
|
+
<slot name="header" />
|
|
18
|
+
</div>
|
|
19
|
+
<!-- item content - hidden with table-cards:toggle-view 'collapsed' (List view) -->
|
|
20
|
+
<transition name="fading">
|
|
21
|
+
<div
|
|
22
|
+
v-show="isOpen"
|
|
23
|
+
class="u-p-0_5">
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
26
|
+
</transition>
|
|
27
|
+
</li>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
name: 'DpTableCard',
|
|
34
|
+
|
|
35
|
+
props: {
|
|
36
|
+
open: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
required: false,
|
|
39
|
+
default: false
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
data () {
|
|
44
|
+
return {
|
|
45
|
+
isOpen: this.open
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
watch: {
|
|
50
|
+
open (newVal) {
|
|
51
|
+
this.isOpen = newVal
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
methods: {
|
|
56
|
+
toggle (val) {
|
|
57
|
+
this.isOpen = (typeof val !== 'undefined') ? val : (this.isOpen === false)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<license>
|
|
2
|
+
(c) 2010-present DEMOS E-Partizipation GmbH.
|
|
3
|
+
|
|
4
|
+
This file is part of the package @demos-europe/demosplan-ui,
|
|
5
|
+
for more information see the license file.
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
</license>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<dp-sticky-element>
|
|
12
|
+
<!-- search and buttons -->
|
|
13
|
+
<dp-search-field
|
|
14
|
+
v-if="searchable"
|
|
15
|
+
class="layout__item u-1-of-2 u-mb-0_5"
|
|
16
|
+
:placeholder="searchPlaceholder"
|
|
17
|
+
@reset="$emit('reset-search')"
|
|
18
|
+
@search="val => $emit('search', val)" /><!--
|
|
19
|
+
--><slot name="header-buttons" />
|
|
20
|
+
<!-- header with checkbox and labels-->
|
|
21
|
+
<div class="layout__item u-pv-0_5 border--bottom">
|
|
22
|
+
<dp-checkbox
|
|
23
|
+
v-if="selectable"
|
|
24
|
+
id="selectAll"
|
|
25
|
+
class="display--inline-block"
|
|
26
|
+
@change="val => $emit('select-all', val)" /><!--
|
|
27
|
+
--><div
|
|
28
|
+
class="layout__item weight--bold"
|
|
29
|
+
:class="[item.classes ? item.classes : '', item.width ? item.width : '']"
|
|
30
|
+
v-for="(item, idx) in items"
|
|
31
|
+
:key="idx">
|
|
32
|
+
{{ item.label }}
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</dp-sticky-element>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
import DpCheckbox from '../form/DpCheckbox'
|
|
40
|
+
import DpStickyElement from '../shared/DpStickyElement'
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: 'DpTableCardListHeader',
|
|
44
|
+
|
|
45
|
+
components: {
|
|
46
|
+
DpCheckbox,
|
|
47
|
+
DpSearchField: () => import('../form/DpSearchField'),
|
|
48
|
+
DpStickyElement
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
props: {
|
|
52
|
+
/**
|
|
53
|
+
* Items to display in the list header
|
|
54
|
+
* { label: 'columnLabel', width: 'u-x-of-x', classes: 'your css classes' }
|
|
55
|
+
*/
|
|
56
|
+
items: {
|
|
57
|
+
type: Array,
|
|
58
|
+
required: true
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Add a search field above the list
|
|
63
|
+
*/
|
|
64
|
+
searchable: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
searchPlaceholder: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: ''
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Adds a checkbox in the first column
|
|
76
|
+
*/
|
|
77
|
+
selectable: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: false
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<license>
|
|
2
|
+
(c) 2010-present DEMOS E-Partizipation GmbH.
|
|
3
|
+
|
|
4
|
+
This file is part of the package @demos-europe/demosplan-ui,
|
|
5
|
+
for more information see the license file.
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
</license>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<section
|
|
12
|
+
v-show="isActive"
|
|
13
|
+
:id="id"
|
|
14
|
+
role="tabpanel">
|
|
15
|
+
<slot />
|
|
16
|
+
</section>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: 'DpTab',
|
|
22
|
+
|
|
23
|
+
props: {
|
|
24
|
+
id: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The label is passed to the DpTab child component, but then it is used
|
|
31
|
+
* in the parent component DpTabs.
|
|
32
|
+
*/
|
|
33
|
+
label: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A html string may be passed here which is appended to the tab label.
|
|
40
|
+
*/
|
|
41
|
+
suffix: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: false,
|
|
44
|
+
default: null
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
data: () => ({
|
|
49
|
+
isActive: false
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
</script>
|