@nextcloud/vue 3.10.2 → 4.1.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/CHANGELOG.md +114 -19
- package/README.md +9 -10
- package/dist/Components/ActionButton.js +24 -3
- package/dist/Components/ActionButton.js.map +1 -1
- package/dist/Components/ActionCaption.js +23 -0
- package/dist/Components/ActionCaption.js.map +1 -0
- package/dist/Components/ActionCheckbox.js +24 -3
- package/dist/Components/ActionCheckbox.js.map +1 -1
- package/dist/Components/ActionInput.js +124 -21
- package/dist/Components/ActionInput.js.map +1 -1
- package/dist/Components/ActionLink.js +24 -3
- package/dist/Components/ActionLink.js.map +1 -1
- package/dist/Components/ActionRadio.js +24 -3
- package/dist/Components/ActionRadio.js.map +1 -1
- package/dist/Components/ActionRouter.js +23 -2
- package/dist/Components/ActionRouter.js.map +1 -1
- package/dist/Components/ActionSeparator.js +1 -1
- package/dist/Components/ActionSeparator.js.map +1 -1
- package/dist/Components/ActionText.js +23 -2
- package/dist/Components/ActionText.js.map +1 -1
- package/dist/Components/ActionTextEditable.js +45 -3
- package/dist/Components/ActionTextEditable.js.map +1 -1
- package/dist/Components/Actions.js +25 -4
- package/dist/Components/Actions.js.map +1 -1
- package/dist/Components/AppContent.js +21 -1
- package/dist/Components/AppContent.js.map +1 -1
- package/dist/Components/AppContentDetails.js +1 -1
- package/dist/Components/AppContentDetails.js.map +1 -1
- package/dist/Components/AppContentList.js +1 -1
- package/dist/Components/AppContentList.js.map +1 -1
- package/dist/Components/AppNavigation.js +109 -2
- package/dist/Components/AppNavigation.js.map +1 -1
- package/dist/Components/AppNavigationCaption.js +66 -1
- package/dist/Components/AppNavigationCaption.js.map +1 -1
- package/dist/Components/AppNavigationCounter.js +2 -2
- package/dist/Components/AppNavigationCounter.js.map +1 -1
- package/dist/Components/AppNavigationIconBullet.js +2 -2
- package/dist/Components/AppNavigationIconBullet.js.map +1 -1
- package/dist/Components/AppNavigationItem.js +49 -7
- package/dist/Components/AppNavigationItem.js.map +1 -1
- package/dist/Components/AppNavigationNew.js +1 -1
- package/dist/Components/AppNavigationNew.js.map +1 -1
- package/dist/Components/AppNavigationNewItem.js +2 -2
- package/dist/Components/AppNavigationNewItem.js.map +1 -1
- package/dist/Components/AppNavigationSettings.js +5 -5
- package/dist/Components/AppNavigationSettings.js.map +1 -1
- package/dist/Components/AppNavigationSpacer.js +1 -1
- package/dist/Components/AppNavigationSpacer.js.map +1 -1
- package/dist/Components/AppNavigationToggle.js +109 -2
- package/dist/Components/AppNavigationToggle.js.map +1 -1
- package/dist/Components/AppSettingsDialog.js +64 -22
- package/dist/Components/AppSettingsDialog.js.map +1 -1
- package/dist/Components/AppSettingsSection.js +1 -1
- package/dist/Components/AppSettingsSection.js.map +1 -1
- package/dist/Components/AppSidebar.js +38 -17
- package/dist/Components/AppSidebar.js.map +1 -1
- package/dist/Components/AppSidebarTab.js +1 -1
- package/dist/Components/AppSidebarTab.js.map +1 -1
- package/dist/Components/Avatar.js +9 -10
- package/dist/Components/Avatar.js.map +1 -1
- package/dist/Components/Breadcrumb.js +33 -12
- package/dist/Components/Breadcrumb.js.map +1 -1
- package/dist/Components/Breadcrumbs.js +59 -17
- package/dist/Components/Breadcrumbs.js.map +1 -1
- package/dist/Components/CheckboxRadioSwitch.js +44 -0
- package/dist/Components/CheckboxRadioSwitch.js.map +1 -0
- package/dist/Components/ColorPicker.js +6 -7
- package/dist/Components/ColorPicker.js.map +1 -1
- package/dist/Components/Content.js +2 -2
- package/dist/Components/Content.js.map +1 -1
- package/dist/Components/CounterBubble.js +23 -0
- package/dist/Components/CounterBubble.js.map +1 -0
- package/dist/Components/DatetimePicker.js +341 -3
- package/dist/Components/DatetimePicker.js.map +1 -1
- package/dist/Components/EmojiPicker.js +14 -14
- package/dist/Components/EmojiPicker.js.map +1 -1
- package/dist/Components/EmptyContent.js +2 -2
- package/dist/Components/EmptyContent.js.map +1 -1
- package/dist/Components/Highlight.js +3 -3
- package/dist/Components/Highlight.js.map +1 -1
- package/dist/Components/ListItem.js +130 -0
- package/dist/Components/ListItem.js.map +1 -0
- package/dist/Components/ListItemIcon.js +20 -21
- package/dist/Components/ListItemIcon.js.map +1 -1
- package/dist/Components/Modal.js +53 -11
- package/dist/Components/Modal.js.map +1 -1
- package/dist/Components/Multiselect.js +22 -23
- package/dist/Components/Multiselect.js.map +1 -1
- package/dist/Components/MultiselectTags.js +24 -25
- package/dist/Components/MultiselectTags.js.map +1 -1
- package/dist/Components/Popover.js +2 -2
- package/dist/Components/Popover.js.map +1 -1
- package/dist/Components/PopoverMenu.js +1 -1
- package/dist/Components/PopoverMenu.js.map +1 -1
- package/dist/Components/ProgressBar.js +2 -2
- package/dist/Components/ProgressBar.js.map +1 -1
- package/dist/Components/RichContenteditable.js +2 -2
- package/dist/Components/RichContenteditable.js.map +1 -1
- package/dist/Components/SettingsInputText.js +22 -1
- package/dist/Components/SettingsInputText.js.map +1 -1
- package/dist/Components/SettingsSection.js +2 -2
- package/dist/Components/SettingsSection.js.map +1 -1
- package/dist/Components/SettingsSelectGroup.js +41 -21
- package/dist/Components/SettingsSelectGroup.js.map +1 -1
- package/dist/Components/TimezonePicker.js +340 -0
- package/dist/Components/TimezonePicker.js.map +1 -0
- package/dist/Components/UserBubble.js +35 -36
- package/dist/Components/UserBubble.js.map +1 -1
- package/dist/Directives/Focus.js +1 -1
- package/dist/Directives/Focus.js.map +1 -1
- package/dist/Directives/Linkify.js +1 -1
- package/dist/Directives/Linkify.js.map +1 -1
- package/dist/Directives/Tooltip.js +2 -2
- package/dist/Directives/Tooltip.js.map +1 -1
- package/dist/Functions/usernameToColor.js +2 -3
- package/dist/Functions/usernameToColor.js.map +1 -1
- package/dist/Mixins/excludeClickOutsideClasses.js +2 -2
- package/dist/Mixins/excludeClickOutsideClasses.js.map +1 -1
- package/dist/Mixins/isFullscreen.js +1 -1
- package/dist/Mixins/isFullscreen.js.map +1 -1
- package/dist/Mixins/isMobile.js +1 -1
- package/dist/Mixins/isMobile.js.map +1 -1
- package/dist/Mixins/richEditor.js +1 -1
- package/dist/Mixins/richEditor.js.map +1 -1
- package/dist/ncvuecomponents.js +276 -69
- package/dist/ncvuecomponents.js.map +1 -1
- package/package.json +28 -43
- package/src/assets/action.scss +0 -132
- package/src/assets/iconfont/README.md +0 -30
- package/src/assets/iconfont/arrow-left-double.svg +0 -3
- package/src/assets/iconfont/arrow-left.svg +0 -3
- package/src/assets/iconfont/arrow-right-double.svg +0 -3
- package/src/assets/iconfont/arrow-right.svg +0 -3
- package/src/assets/iconfont/breadcrumb.svg +0 -1
- package/src/assets/iconfont/checkmark.svg +0 -1
- package/src/assets/iconfont/close.svg +0 -1
- package/src/assets/iconfont/confirm.svg +0 -1
- package/src/assets/iconfont/info.svg +0 -1
- package/src/assets/iconfont/menu.svg +0 -1
- package/src/assets/iconfont/more.svg +0 -1
- package/src/assets/iconfont/pause.svg +0 -1
- package/src/assets/iconfont/play.svg +0 -1
- package/src/assets/iconfont/triangle-s.svg +0 -1
- package/src/assets/iconfont/user-status-away.svg +0 -2
- package/src/assets/iconfont/user-status-dnd.svg +0 -2
- package/src/assets/iconfont/user-status-invisible.svg +0 -2
- package/src/assets/iconfont/user-status-online.svg +0 -2
- package/src/assets/inputs.scss +0 -104
- package/src/assets/variables.scss +0 -57
- package/src/components/ActionButton/ActionButton.vue +0 -160
- package/src/components/ActionButton/index.js +0 -24
- package/src/components/ActionCheckbox/ActionCheckbox.vue +0 -220
- package/src/components/ActionCheckbox/index.js +0 -24
- package/src/components/ActionInput/ActionInput.vue +0 -418
- package/src/components/ActionInput/index.js +0 -24
- package/src/components/ActionLink/ActionLink.vue +0 -132
- package/src/components/ActionLink/index.js +0 -24
- package/src/components/ActionRadio/ActionRadio.vue +0 -219
- package/src/components/ActionRadio/index.js +0 -24
- package/src/components/ActionRouter/ActionRouter.vue +0 -100
- package/src/components/ActionRouter/index.js +0 -24
- package/src/components/ActionSeparator/ActionSeparator.vue +0 -43
- package/src/components/ActionSeparator/index.js +0 -24
- package/src/components/ActionText/ActionText.vue +0 -87
- package/src/components/ActionText/index.js +0 -24
- package/src/components/ActionTextEditable/ActionTextEditable.vue +0 -306
- package/src/components/ActionTextEditable/index.js +0 -24
- package/src/components/Actions/Actions.vue +0 -764
- package/src/components/Actions/index.js +0 -24
- package/src/components/AppContent/AppContent.vue +0 -93
- package/src/components/AppContent/index.js +0 -23
- package/src/components/AppContentDetails/AppContentDetails.vue +0 -34
- package/src/components/AppContentDetails/index.js +0 -23
- package/src/components/AppContentList/AppContentList.vue +0 -44
- package/src/components/AppContentList/index.js +0 -23
- package/src/components/AppNavigation/AppNavigation.vue +0 -190
- package/src/components/AppNavigation/index.js +0 -23
- package/src/components/AppNavigationCaption/AppNavigationCaption.vue +0 -39
- package/src/components/AppNavigationCaption/index.js +0 -3
- package/src/components/AppNavigationCounter/AppNavigationCounter.vue +0 -82
- package/src/components/AppNavigationCounter/index.js +0 -25
- package/src/components/AppNavigationIconBullet/AppNavigationIconBullet.vue +0 -95
- package/src/components/AppNavigationIconBullet/index.js +0 -24
- package/src/components/AppNavigationItem/AppNavigationIconCollapsible.vue +0 -90
- package/src/components/AppNavigationItem/AppNavigationItem.vue +0 -629
- package/src/components/AppNavigationItem/InputConfirmCancel.vue +0 -134
- package/src/components/AppNavigationItem/index.js +0 -24
- package/src/components/AppNavigationNew/AppNavigationNew.vue +0 -76
- package/src/components/AppNavigationNew/index.js +0 -23
- package/src/components/AppNavigationNewItem/AppNavigationNewItem.vue +0 -165
- package/src/components/AppNavigationNewItem/index.js +0 -24
- package/src/components/AppNavigationSettings/AppNavigationSettings.vue +0 -105
- package/src/components/AppNavigationSettings/index.js +0 -23
- package/src/components/AppNavigationSpacer/AppNavigationSpacer.vue +0 -39
- package/src/components/AppNavigationSpacer/index.js +0 -23
- package/src/components/AppNavigationToggle/AppNavigationToggle.vue +0 -78
- package/src/components/AppNavigationToggle/index.js +0 -24
- package/src/components/AppSettingsDialog/AppSettingsDialog.vue +0 -331
- package/src/components/AppSettingsDialog/index.js +0 -25
- package/src/components/AppSettingsSection/AppSettingsSection.vue +0 -64
- package/src/components/AppSettingsSection/index.js +0 -25
- package/src/components/AppSidebar/AppSidebar.vue +0 -802
- package/src/components/AppSidebar/AppSidebarTabs.vue +0 -348
- package/src/components/AppSidebar/index.js +0 -23
- package/src/components/AppSidebarTab/AppSidebarTab.vue +0 -103
- package/src/components/AppSidebarTab/index.js +0 -23
- package/src/components/Avatar/Avatar.vue +0 -758
- package/src/components/Avatar/index.js +0 -25
- package/src/components/Breadcrumb/Breadcrumb.vue +0 -262
- package/src/components/Breadcrumb/index.js +0 -25
- package/src/components/Breadcrumbs/Breadcrumbs.vue +0 -537
- package/src/components/Breadcrumbs/index.js +0 -25
- package/src/components/ColorPicker/ColorPicker.vue +0 -380
- package/src/components/ColorPicker/index.js +0 -25
- package/src/components/Content/Content.vue +0 -77
- package/src/components/Content/index.js +0 -23
- package/src/components/DatetimePicker/DatetimePicker.vue +0 -195
- package/src/components/DatetimePicker/index.js +0 -28
- package/src/components/DatetimePicker/index.scss +0 -405
- package/src/components/EmojiPicker/EmojiPicker.vue +0 -302
- package/src/components/EmojiPicker/index.js +0 -23
- package/src/components/EmptyContent/EmptyContent.vue +0 -120
- package/src/components/EmptyContent/index.js +0 -24
- package/src/components/Highlight/Highlight.vue +0 -183
- package/src/components/Highlight/index.js +0 -25
- package/src/components/ListItemIcon/ListItemIcon.vue +0 -277
- package/src/components/ListItemIcon/index.js +0 -25
- package/src/components/Modal/Modal.vue +0 -833
- package/src/components/Modal/index.js +0 -27
- package/src/components/Multiselect/EllipsisedOption.vue +0 -141
- package/src/components/Multiselect/Multiselect.vue +0 -430
- package/src/components/Multiselect/index.js +0 -28
- package/src/components/Multiselect/index.scss +0 -290
- package/src/components/MultiselectTags/MultiselectTags.vue +0 -179
- package/src/components/MultiselectTags/api.js +0 -115
- package/src/components/MultiselectTags/index.js +0 -23
- package/src/components/Popover/Popover.vue +0 -208
- package/src/components/Popover/index.js +0 -25
- package/src/components/PopoverMenu/PopoverMenu.vue +0 -62
- package/src/components/PopoverMenu/PopoverMenuItem.vue +0 -382
- package/src/components/PopoverMenu/index.js +0 -24
- package/src/components/ProgressBar/ProgressBar.vue +0 -135
- package/src/components/ProgressBar/index.js +0 -25
- package/src/components/RichContenteditable/AutoCompleteResult.vue +0 -191
- package/src/components/RichContenteditable/MentionBubble.vue +0 -165
- package/src/components/RichContenteditable/RichContenteditable.vue +0 -517
- package/src/components/RichContenteditable/index.js +0 -25
- package/src/components/SettingsInputText/SettingsInputText.vue +0 -207
- package/src/components/SettingsInputText/index.js +0 -24
- package/src/components/SettingsSection/SettingsSection.vue +0 -151
- package/src/components/SettingsSection/index.js +0 -24
- package/src/components/SettingsSelectGroup/SettingsSelectGroup.vue +0 -149
- package/src/components/SettingsSelectGroup/index.js +0 -25
- package/src/components/UserBubble/UserBubble.vue +0 -319
- package/src/components/UserBubble/index.js +0 -25
- package/src/components/index.js +0 -110
- package/src/directives/Focus/index.js +0 -29
- package/src/directives/Linkify/index.js +0 -31
- package/src/directives/Tooltip/index.js +0 -32
- package/src/directives/Tooltip/index.scss +0 -117
- package/src/directives/index.js +0 -31
- package/src/fonts/iconfont-vue-f56d517.eot +0 -0
- package/src/fonts/iconfont-vue-f56d517.svg +0 -1
- package/src/fonts/iconfont-vue-f56d517.ttf +0 -0
- package/src/fonts/iconfont-vue-f56d517.woff +0 -0
- package/src/fonts/scss/iconfont-vue.scss +0 -115
- package/src/functions/usernameToColor/index.js +0 -25
- package/src/functions/usernameToColor/usernameToColor.js +0 -68
- package/src/index.js +0 -40
- package/src/l10n.js +0 -42
- package/src/mixins/actionGlobal.js +0 -59
- package/src/mixins/actionText.js +0 -85
- package/src/mixins/excludeClickOutsideClasses/index.js +0 -72
- package/src/mixins/index.js +0 -35
- package/src/mixins/isFullscreen/index.js +0 -46
- package/src/mixins/isMobile/index.js +0 -43
- package/src/mixins/l10n.js +0 -8
- package/src/mixins/richEditor/index.js +0 -160
- package/src/mixins/userStatus.js +0 -76
- package/src/utils/FindRanges.js +0 -47
- package/src/utils/GenColors.js +0 -79
- package/src/utils/GenRandomId.js +0 -31
- package/src/utils/GetChildren.js +0 -47
- package/src/utils/GetParent.js +0 -41
- package/src/utils/IsMobileState.js +0 -49
- package/src/utils/IsOutOfViewport.js +0 -36
- package/src/utils/ScopeComponent.js +0 -37
- package/src/utils/Timer.js +0 -61
- package/src/utils/ValidateChildren.js +0 -50
- package/src/utils/ValidateSlot.js +0 -57
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
*
|
|
4
|
-
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
5
|
-
*
|
|
6
|
-
* @license GNU AGPL version 3 or any later version
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Affero General Public License as
|
|
10
|
-
* published by the Free Software Foundation, either version 3 of the
|
|
11
|
-
* License, or (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Affero General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
import ScopeComponent from '../../utils/ScopeComponent'
|
|
23
|
-
import Modal from './Modal'
|
|
24
|
-
|
|
25
|
-
ScopeComponent(Modal)
|
|
26
|
-
|
|
27
|
-
export default Modal
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
- @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
-
|
|
4
|
-
- @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
5
|
-
-
|
|
6
|
-
- @license GNU AGPL version 3 or any later version
|
|
7
|
-
-
|
|
8
|
-
- This program is free software: you can redistribute it and/or modify
|
|
9
|
-
- it under the terms of the GNU Affero General Public License as
|
|
10
|
-
- published by the Free Software Foundation, either version 3 of the
|
|
11
|
-
- License, or (at your option) any later version.
|
|
12
|
-
-
|
|
13
|
-
- This program is distributed in the hope that it will be useful,
|
|
14
|
-
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
- GNU Affero General Public License for more details.
|
|
17
|
-
-
|
|
18
|
-
- You should have received a copy of the GNU Affero General Public License
|
|
19
|
-
- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
-
|
|
21
|
-
-->
|
|
22
|
-
|
|
23
|
-
<template>
|
|
24
|
-
<div class="name-parts" :title="name">
|
|
25
|
-
<Highlight
|
|
26
|
-
class="name-parts__first"
|
|
27
|
-
:text="part1"
|
|
28
|
-
:search="search"
|
|
29
|
-
:highlight="highlight1" />
|
|
30
|
-
<Highlight
|
|
31
|
-
v-if="part2"
|
|
32
|
-
class="name-parts__last"
|
|
33
|
-
:text="part2"
|
|
34
|
-
:search="search"
|
|
35
|
-
:highlight="highlight2" />
|
|
36
|
-
</div>
|
|
37
|
-
</template>
|
|
38
|
-
<script>
|
|
39
|
-
import Highlight from '../Highlight'
|
|
40
|
-
import FindRanges from '../../utils/FindRanges'
|
|
41
|
-
|
|
42
|
-
export default {
|
|
43
|
-
name: 'EllipsisedOption',
|
|
44
|
-
|
|
45
|
-
components: {
|
|
46
|
-
Highlight,
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
props: {
|
|
50
|
-
option: {
|
|
51
|
-
type: [String, Object],
|
|
52
|
-
required: true,
|
|
53
|
-
default: '',
|
|
54
|
-
},
|
|
55
|
-
label: {
|
|
56
|
-
type: String,
|
|
57
|
-
default: '',
|
|
58
|
-
},
|
|
59
|
-
search: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: '',
|
|
62
|
-
},
|
|
63
|
-
name: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: '',
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
computed: {
|
|
70
|
-
needsTruncate() {
|
|
71
|
-
return this.name && this.name.length >= 10
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* Index at which to split the name if it is longer than 10 characters.
|
|
75
|
-
*
|
|
76
|
-
* @returns {Integer} The position at which to split
|
|
77
|
-
*/
|
|
78
|
-
split() {
|
|
79
|
-
// leave maximum 10 letters
|
|
80
|
-
return this.name.length - Math.min(Math.floor(this.name.length / 2), 10)
|
|
81
|
-
},
|
|
82
|
-
part1() {
|
|
83
|
-
if (this.needsTruncate) {
|
|
84
|
-
return this.name.substr(0, this.split)
|
|
85
|
-
}
|
|
86
|
-
return this.name
|
|
87
|
-
},
|
|
88
|
-
part2() {
|
|
89
|
-
if (this.needsTruncate) {
|
|
90
|
-
return this.name.substr(this.split)
|
|
91
|
-
}
|
|
92
|
-
return ''
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* The ranges to highlight. Since we split the string for ellipsising,
|
|
96
|
-
* the Highlight component cannot figure this out itself and needs the ranges provided.
|
|
97
|
-
*
|
|
98
|
-
* @returns {Array} The array with the ranges to highlight
|
|
99
|
-
*/
|
|
100
|
-
highlight1() {
|
|
101
|
-
if (!this.search) {
|
|
102
|
-
return []
|
|
103
|
-
}
|
|
104
|
-
return FindRanges(this.name, this.search)
|
|
105
|
-
},
|
|
106
|
-
/**
|
|
107
|
-
* We shift the ranges for the second part by the position of the split.
|
|
108
|
-
* Ranges out of the string length are discarded by the Highlight component,
|
|
109
|
-
* so we don't need to take care of this here.
|
|
110
|
-
*
|
|
111
|
-
* @returns {Array} The array with the ranges to highlight
|
|
112
|
-
*/
|
|
113
|
-
highlight2() {
|
|
114
|
-
return this.highlight1.map(range => {
|
|
115
|
-
return {
|
|
116
|
-
start: range.start - this.split,
|
|
117
|
-
end: range.end - this.split,
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
}
|
|
123
|
-
</script>
|
|
124
|
-
<style lang="scss" scoped>
|
|
125
|
-
.name-parts {
|
|
126
|
-
display: flex;
|
|
127
|
-
max-width: 100%;
|
|
128
|
-
&__first {
|
|
129
|
-
overflow: hidden;
|
|
130
|
-
text-overflow: ellipsis;
|
|
131
|
-
}
|
|
132
|
-
&__first,
|
|
133
|
-
&__last {
|
|
134
|
-
// prevent whitespace from being trimmed
|
|
135
|
-
white-space: pre;
|
|
136
|
-
strong {
|
|
137
|
-
font-weight: bold;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
</style>
|
|
@@ -1,430 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
- @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
-
|
|
4
|
-
- @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
5
|
-
-
|
|
6
|
-
- @license GNU AGPL version 3 or any later version
|
|
7
|
-
-
|
|
8
|
-
- This program is free software: you can redistribute it and/or modify
|
|
9
|
-
- it under the terms of the GNU Affero General Public License as
|
|
10
|
-
- published by the Free Software Foundation, either version 3 of the
|
|
11
|
-
- License, or (at your option) any later version.
|
|
12
|
-
-
|
|
13
|
-
- This program is distributed in the hope that it will be useful,
|
|
14
|
-
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
- GNU Affero General Public License for more details.
|
|
17
|
-
-
|
|
18
|
-
- You should have received a copy of the GNU Affero General Public License
|
|
19
|
-
- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
-
|
|
21
|
-
-->
|
|
22
|
-
<docs>
|
|
23
|
-
## Multiselect
|
|
24
|
-
We're wrapping the awesome vue-multiselect library to add our own styling and default props/methods
|
|
25
|
-
You can use all the properties from https://vue-multiselect.js.org that are not declared/overrided here.
|
|
26
|
-
|
|
27
|
-
### Simple examples
|
|
28
|
-
```vue
|
|
29
|
-
<template>
|
|
30
|
-
<div class="wrapper">
|
|
31
|
-
<Multiselect v-model="value1" :options="options" />
|
|
32
|
-
<Multiselect v-model="value2" :options="options" :multiple="true" />
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<script>
|
|
37
|
-
import Multiselect from '../index'
|
|
38
|
-
export default {
|
|
39
|
-
data() {
|
|
40
|
-
return { value1: '2', value2: ['2'], options: ['0', '1', '2', '3', '4'] }
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
</script>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Simple example with objects
|
|
47
|
-
You can either use the exact object or the track-by key to match against your options
|
|
48
|
-
|
|
49
|
-
```vue
|
|
50
|
-
<template>
|
|
51
|
-
<div class="wrapper">
|
|
52
|
-
<Multiselect v-model="value1" :options="options" track-by="id" label="label" />
|
|
53
|
-
<pre>Selected option: {{ value1 }}</pre>
|
|
54
|
-
<br />
|
|
55
|
-
<Multiselect v-model="value2" :options="options" track-by="id" label="label" />
|
|
56
|
-
<pre>Selected option: {{ value2 }}</pre>
|
|
57
|
-
</div>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<script>
|
|
61
|
-
import Multiselect from '../index'
|
|
62
|
-
const options = [
|
|
63
|
-
{ id: 1, label: 'Option 1' },
|
|
64
|
-
{ id: 2, label: 'Option 2' },
|
|
65
|
-
{ id: 3, label: 'Option 3' },
|
|
66
|
-
{ id: 4, label: 'Option 4' }
|
|
67
|
-
]
|
|
68
|
-
export default {
|
|
69
|
-
data() {
|
|
70
|
-
return {
|
|
71
|
-
value1: options[1],
|
|
72
|
-
value2: 2,
|
|
73
|
-
options
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
</script>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Limit with automated tooltip
|
|
81
|
-
```vue
|
|
82
|
-
<template>
|
|
83
|
-
<Multiselect v-model="value"
|
|
84
|
-
:options="options" :multiple="true"
|
|
85
|
-
:tag-width="80" />
|
|
86
|
-
</template>
|
|
87
|
-
|
|
88
|
-
<script>
|
|
89
|
-
import Multiselect from '../index'
|
|
90
|
-
export default {
|
|
91
|
-
data() {
|
|
92
|
-
return {
|
|
93
|
-
value: ['eirmod', 'et', 'magna', 'invidunt', 'tempor'],
|
|
94
|
-
options: ['Consetetur', 'sadipscing', 'elitr', 'sed',
|
|
95
|
-
'diam', 'nonumy', 'eirmod', 'tempor', 'invidunt',
|
|
96
|
-
'ut', 'labore', 'et', 'dolore', 'magna', 'aliquyam', 'erat']
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
</script>
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### User layout
|
|
104
|
-
By specifying `:user-select="true"`, you can benefit from a fully formatted layout.
|
|
105
|
-
The singleLabel slot here is optional of course and here for demonstration purposes
|
|
106
|
-
The ListItemIcon title will be provided by the option key refering to the `label` prop.
|
|
107
|
-
Example here: `displayName`
|
|
108
|
-
|
|
109
|
-
> **Note:** Any extra binding from the object will be added as attribute (`$attrs`) on the ListItemIcon component used here
|
|
110
|
-
|
|
111
|
-
```vue
|
|
112
|
-
<template>
|
|
113
|
-
<Multiselect v-model="value" :options="formattedOptions"
|
|
114
|
-
label="displayName" track-by="user"
|
|
115
|
-
:user-select="true"
|
|
116
|
-
style="width: 250px">
|
|
117
|
-
<template #singleLabel="{ option }">
|
|
118
|
-
<ListItemIcon v-bind="option" :title="option.displayName" :avatar-size="24" :no-margin="true" />
|
|
119
|
-
</template>
|
|
120
|
-
</Multiselect>
|
|
121
|
-
</template>
|
|
122
|
-
|
|
123
|
-
<script>
|
|
124
|
-
import Multiselect from '../index'
|
|
125
|
-
|
|
126
|
-
// Building fake data for the docs
|
|
127
|
-
const options = ['admin', 'user1', 'user2', 'guest', 'group1']
|
|
128
|
-
const formattedOptions = options.map(item => {
|
|
129
|
-
return {
|
|
130
|
-
user: item,
|
|
131
|
-
displayName: item,
|
|
132
|
-
subtitle: `This is the ${item.startsWith('group') ? 'group' : 'user'} ${item}`,
|
|
133
|
-
icon: item.startsWith('group') ? 'icon-group' : 'icon-user',
|
|
134
|
-
isNoUser: item.startsWith('group')
|
|
135
|
-
}
|
|
136
|
-
})
|
|
137
|
-
export default {
|
|
138
|
-
data() {
|
|
139
|
-
return {
|
|
140
|
-
value: formattedOptions[0],
|
|
141
|
-
formattedOptions,
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
}
|
|
145
|
-
</script>
|
|
146
|
-
```
|
|
147
|
-
</docs>
|
|
148
|
-
|
|
149
|
-
<template>
|
|
150
|
-
<!--
|
|
151
|
-
# This is the original Multiselect !
|
|
152
|
-
## tag-placeholder="create"
|
|
153
|
-
-> Hack to allow us to detect when an option needs
|
|
154
|
-
- to be created (with css) and apply the proper
|
|
155
|
-
- styling to this entry, @see [data-select='create']
|
|
156
|
-
## :close-on-select="!multiple"
|
|
157
|
-
-> If multiple choice allowed, leave the dropdown
|
|
158
|
-
- open after select
|
|
159
|
-
## v-on="$listeners", v-bind="$attrs"
|
|
160
|
-
-> Forward all undeclared props to the vue-multiselect child
|
|
161
|
-
-->
|
|
162
|
-
<VueMultiselect
|
|
163
|
-
ref="VueMultiselect"
|
|
164
|
-
v-model="localValue"
|
|
165
|
-
v-bind="$attrs"
|
|
166
|
-
:class="[
|
|
167
|
-
{
|
|
168
|
-
'icon-loading-small': loading
|
|
169
|
-
},
|
|
170
|
-
multiple ? 'multiselect--multiple': 'multiselect--single'
|
|
171
|
-
]"
|
|
172
|
-
:options="options"
|
|
173
|
-
:limit="maxOptions"
|
|
174
|
-
:close-on-select="!multiple"
|
|
175
|
-
:multiple="multiple"
|
|
176
|
-
:label="label"
|
|
177
|
-
:track-by="trackBy"
|
|
178
|
-
tag-placeholder="create"
|
|
179
|
-
v-on="$listeners">
|
|
180
|
-
<!-- This is the scope to format the list of available options in the dropdown
|
|
181
|
-
Two templates to avoid registering the slot unnecessary -->
|
|
182
|
-
<template #option="scope">
|
|
183
|
-
<!-- Avatar display select slot override.
|
|
184
|
-
You CANNOT use this scope, we will replace it by this -->
|
|
185
|
-
<ListItemIcon v-if="userSelect && !$scopedSlots['option']"
|
|
186
|
-
v-bind="scope.option"
|
|
187
|
-
:title="scope.option[label]"
|
|
188
|
-
:search="scope.search" />
|
|
189
|
-
|
|
190
|
-
<!-- Ellipsis in the middle if no option slot
|
|
191
|
-
is defined in the parent -->
|
|
192
|
-
<EllipsisedOption v-else-if="!$scopedSlots['option']"
|
|
193
|
-
:name="getOptionLabel(scope.option)"
|
|
194
|
-
:option="scope.option"
|
|
195
|
-
:search="scope.search"
|
|
196
|
-
:label="label" />
|
|
197
|
-
|
|
198
|
-
<!-- Passing the singleLabel slot -->
|
|
199
|
-
<slot v-else name="option" v-bind="scope" />
|
|
200
|
-
</template>
|
|
201
|
-
|
|
202
|
-
<!-- Registering the limit slot to get the +xxx tooltip.
|
|
203
|
-
You CANNOT use this scope, we will replace it by this -->
|
|
204
|
-
<template v-if="multiple" #limit>
|
|
205
|
-
<span v-tooltip.auto="formatLimitTitle(value)"
|
|
206
|
-
class="multiselect__limit">
|
|
207
|
-
{{ limitString }}
|
|
208
|
-
</span>
|
|
209
|
-
</template>
|
|
210
|
-
|
|
211
|
-
<!-- Passing the singleLabel slot, this is used to format the selected
|
|
212
|
-
option on NON-multiple multiselects -->
|
|
213
|
-
<template v-for="(_, slot) of $scopedSlots" #[slot]="scope">
|
|
214
|
-
<slot :name="slot" v-bind="scope" />
|
|
215
|
-
</template>
|
|
216
|
-
|
|
217
|
-
<span slot="noResult">{{ t('No results') }}</span>
|
|
218
|
-
</VueMultiselect>
|
|
219
|
-
</template>
|
|
220
|
-
|
|
221
|
-
<script>
|
|
222
|
-
import VueMultiselect from 'vue-multiselect'
|
|
223
|
-
|
|
224
|
-
import EllipsisedOption from './EllipsisedOption'
|
|
225
|
-
import l10n from '../../mixins/l10n'
|
|
226
|
-
import ListItemIcon from '../ListItemIcon'
|
|
227
|
-
import Tooltip from '../../directives/Tooltip'
|
|
228
|
-
|
|
229
|
-
export default {
|
|
230
|
-
name: 'Multiselect',
|
|
231
|
-
components: {
|
|
232
|
-
EllipsisedOption,
|
|
233
|
-
ListItemIcon,
|
|
234
|
-
VueMultiselect,
|
|
235
|
-
},
|
|
236
|
-
directives: {
|
|
237
|
-
tooltip: Tooltip,
|
|
238
|
-
},
|
|
239
|
-
mixins: [l10n],
|
|
240
|
-
inheritAttrs: false,
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Every prop that is defined here will break the auto
|
|
244
|
-
* forward to the vue-multiselect component
|
|
245
|
-
* You will have to specify it as a prop on the template
|
|
246
|
-
*/
|
|
247
|
-
props: {
|
|
248
|
-
// eslint-disable-next-line
|
|
249
|
-
value: {
|
|
250
|
-
default() {
|
|
251
|
-
return []
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Allow multiple select ?
|
|
257
|
-
*/
|
|
258
|
-
multiple: {
|
|
259
|
-
type: Boolean,
|
|
260
|
-
default: false,
|
|
261
|
-
},
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Limit the number of results
|
|
265
|
-
*/
|
|
266
|
-
limit: {
|
|
267
|
-
type: Number,
|
|
268
|
-
default: 99999,
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* key to use as label on object options
|
|
273
|
-
*/
|
|
274
|
-
label: {
|
|
275
|
-
type: String,
|
|
276
|
-
default: '',
|
|
277
|
-
},
|
|
278
|
-
/**
|
|
279
|
-
* key to use as id on object options
|
|
280
|
-
*/
|
|
281
|
-
trackBy: {
|
|
282
|
-
type: String,
|
|
283
|
-
default: '',
|
|
284
|
-
},
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Array of available options: Objects, Strings or Integers.
|
|
288
|
-
* If array of objects, visible label will default to option.label.
|
|
289
|
-
* If `labal` prop is passed, label will equal option['label']
|
|
290
|
-
*/
|
|
291
|
-
options: {
|
|
292
|
-
type: Array,
|
|
293
|
-
required: true,
|
|
294
|
-
},
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Enable the big user selector w/ avatar
|
|
298
|
-
* Make sure your objects fit the requirements
|
|
299
|
-
*/
|
|
300
|
-
userSelect: {
|
|
301
|
-
type: Boolean,
|
|
302
|
-
default: false,
|
|
303
|
-
},
|
|
304
|
-
/**
|
|
305
|
-
* Overriding the default slot. Only showing a spiner.
|
|
306
|
-
*/
|
|
307
|
-
loading: {
|
|
308
|
-
type: Boolean,
|
|
309
|
-
default: false,
|
|
310
|
-
},
|
|
311
|
-
/**
|
|
312
|
-
* Enable the automatic limit and width calculation
|
|
313
|
-
* Only works on multiple
|
|
314
|
-
*/
|
|
315
|
-
autoLimit: {
|
|
316
|
-
type: Boolean,
|
|
317
|
-
default: true,
|
|
318
|
-
},
|
|
319
|
-
/**
|
|
320
|
-
* If autoLimit, allow to specify the min-width of every
|
|
321
|
-
* selected option when calculating the number of options
|
|
322
|
-
* to show. This needs to be a positive integer.
|
|
323
|
-
*/
|
|
324
|
-
tagWidth: {
|
|
325
|
-
type: Number,
|
|
326
|
-
default: 150,
|
|
327
|
-
validator: (value) => {
|
|
328
|
-
return value > 0
|
|
329
|
-
},
|
|
330
|
-
},
|
|
331
|
-
},
|
|
332
|
-
|
|
333
|
-
data() {
|
|
334
|
-
return {
|
|
335
|
-
elWidth: 0,
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
computed: {
|
|
339
|
-
/**
|
|
340
|
-
* Calculate the number of options to show
|
|
341
|
-
* depending on the width of the select.
|
|
342
|
-
* Only works if `autoLimit` is `true`
|
|
343
|
-
* @returns {number}
|
|
344
|
-
*/
|
|
345
|
-
maxOptions() {
|
|
346
|
-
if (this.autoLimit && this.elWidth > 0 && this.tagWidth !== 0) {
|
|
347
|
-
const limit = Math.floor(this.elWidth / this.tagWidth)
|
|
348
|
-
return limit > 0 ? limit : 1
|
|
349
|
-
}
|
|
350
|
-
return this.limit ? this.limit : 9999
|
|
351
|
-
},
|
|
352
|
-
/**
|
|
353
|
-
* Make the tooltip limit string for the `autoLimit`
|
|
354
|
-
* @returns {string}
|
|
355
|
-
*/
|
|
356
|
-
limitString() {
|
|
357
|
-
return `+${this.value.length - this.maxOptions}`
|
|
358
|
-
},
|
|
359
|
-
|
|
360
|
-
localValue: {
|
|
361
|
-
get() {
|
|
362
|
-
if (this.trackBy && this.options
|
|
363
|
-
&& typeof this.value !== 'object'
|
|
364
|
-
&& this.options[this.value]) {
|
|
365
|
-
return this.options[this.value]
|
|
366
|
-
}
|
|
367
|
-
return this.value
|
|
368
|
-
},
|
|
369
|
-
set(value) {
|
|
370
|
-
this.$emit('update:value', value)
|
|
371
|
-
this.$emit('change', value)
|
|
372
|
-
},
|
|
373
|
-
},
|
|
374
|
-
},
|
|
375
|
-
|
|
376
|
-
watch: {
|
|
377
|
-
// ensure we update the width when we add or remove data
|
|
378
|
-
value() {
|
|
379
|
-
this.updateWidth()
|
|
380
|
-
},
|
|
381
|
-
},
|
|
382
|
-
|
|
383
|
-
mounted() {
|
|
384
|
-
this.updateWidth()
|
|
385
|
-
window.addEventListener('resize', this.updateWidth)
|
|
386
|
-
},
|
|
387
|
-
beforeDestroy() {
|
|
388
|
-
window.removeEventListener('resize', this.updateWidth)
|
|
389
|
-
},
|
|
390
|
-
|
|
391
|
-
methods: {
|
|
392
|
-
/**
|
|
393
|
-
* Returns the option label
|
|
394
|
-
*
|
|
395
|
-
* @param {String} option The selected option
|
|
396
|
-
* @returns {string}
|
|
397
|
-
*/
|
|
398
|
-
getOptionLabel(option) {
|
|
399
|
-
return String(this.$refs.VueMultiselect?.getOptionLabel(option))
|
|
400
|
-
},
|
|
401
|
-
/**
|
|
402
|
-
* Format array of groups objects to a string
|
|
403
|
-
* for the limit popup using the label prop
|
|
404
|
-
*
|
|
405
|
-
* @param {array} options The selected options
|
|
406
|
-
* @returns {string}
|
|
407
|
-
*/
|
|
408
|
-
formatLimitTitle(options) {
|
|
409
|
-
if (Array.isArray(options) && options.length > 0) {
|
|
410
|
-
let selection = options
|
|
411
|
-
if (typeof options[0] === 'object') {
|
|
412
|
-
selection = options.map(option => option[this.label])
|
|
413
|
-
}
|
|
414
|
-
return selection.slice(this.maxOptions).join(', ')
|
|
415
|
-
}
|
|
416
|
-
return ''
|
|
417
|
-
},
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Update the component width data
|
|
421
|
-
*/
|
|
422
|
-
updateWidth() {
|
|
423
|
-
// width of the tags wrapper minus the padding
|
|
424
|
-
if (this.$el && this.$el.querySelector('.multiselect__tags-wrap')) {
|
|
425
|
-
this.elWidth = this.$el.querySelector('.multiselect__tags-wrap').offsetWidth - 10
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
},
|
|
429
|
-
}
|
|
430
|
-
</script>
|