@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,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2019 Georg Ehrke
|
|
3
|
-
*
|
|
4
|
-
* @author Georg Ehrke <oc.list@georgehrke.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
|
-
export const directive = {
|
|
24
|
-
inserted(el) {
|
|
25
|
-
el.focus()
|
|
26
|
-
},
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default directive
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Raimund Schlüßler
|
|
3
|
-
* @copyright 2020 Raimund Schlüßler <raimund.schluessler@mailbox.org>
|
|
4
|
-
*
|
|
5
|
-
* This library is free software; you can redistribute it and/or
|
|
6
|
-
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
|
7
|
-
* License as published by the Free Software Foundation; either
|
|
8
|
-
* version 3 of the License, or any later version.
|
|
9
|
-
*
|
|
10
|
-
* This library is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public
|
|
16
|
-
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
import linkifyStr from 'linkifyjs/string'
|
|
20
|
-
|
|
21
|
-
// Use function shorthand for same behavior on bind and update
|
|
22
|
-
// https://vuejs.org/v2/guide/custom-directive.html#Function-Shorthand
|
|
23
|
-
export const directive = function(el, binding) {
|
|
24
|
-
if (binding.value?.linkify === true) {
|
|
25
|
-
el.innerHTML = linkifyStr(binding.value.text, {
|
|
26
|
-
defaultProtocol: 'https',
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default directive
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>
|
|
3
|
-
*
|
|
4
|
-
* @author Julius Härtl <jus@bitgrid.net>
|
|
5
|
-
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
6
|
-
*
|
|
7
|
-
* @license GNU AGPL version 3 or any later version
|
|
8
|
-
*
|
|
9
|
-
* This program is free software: you can redistribute it and/or modify
|
|
10
|
-
* it under the terms of the GNU Affero General Public License as
|
|
11
|
-
* published by the Free Software Foundation, either version 3 of the
|
|
12
|
-
* License, or (at your option) any later version.
|
|
13
|
-
*
|
|
14
|
-
* This program is distributed in the hope that it will be useful,
|
|
15
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
-
* GNU Affero General Public License for more details.
|
|
18
|
-
*
|
|
19
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
20
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
import { VTooltip } from 'v-tooltip'
|
|
24
|
-
import './index.scss'
|
|
25
|
-
|
|
26
|
-
// force scope the tooltip and use .vue-tooltip
|
|
27
|
-
// instead of .tooltip to avoid server compatibility
|
|
28
|
-
// issues and the use of !important
|
|
29
|
-
VTooltip.options.defaultTemplate = `<div class="vue-tooltip" role="tooltip" data-v-${SCOPE_VERSION}><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>`
|
|
30
|
-
VTooltip.options.defaultHtml = false
|
|
31
|
-
|
|
32
|
-
export default VTooltip
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2016, John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
* @copyright Copyright (c) 2016, Robin Appelman <robin@icewind.nl>
|
|
4
|
-
* @copyright Copyright (c) 2016, Jan-Christoph Borchardt <hey@jancborchardt.net>
|
|
5
|
-
* @copyright Copyright (c) 2016, Erik Pellikka <erik@pellikka.org>
|
|
6
|
-
* @copyright Copyright (c) 2015, Vincent Petry <pvince81@owncloud.com>
|
|
7
|
-
*
|
|
8
|
-
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
|
9
|
-
* Copyright 2011-2015 Twitter, Inc.
|
|
10
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
$arrow-width: 10px;
|
|
14
|
-
|
|
15
|
-
.vue-tooltip[data-v-#{$scope_version}] {
|
|
16
|
-
position: absolute;
|
|
17
|
-
z-index: 100000;
|
|
18
|
-
right: auto;
|
|
19
|
-
left: auto;
|
|
20
|
-
display: block;
|
|
21
|
-
margin: 0;
|
|
22
|
-
/* default to top */
|
|
23
|
-
margin-top: -3px;
|
|
24
|
-
padding: 10px 0;
|
|
25
|
-
text-align: left;
|
|
26
|
-
text-align: start;
|
|
27
|
-
opacity: 0;
|
|
28
|
-
line-height: 1.6;
|
|
29
|
-
|
|
30
|
-
line-break: auto;
|
|
31
|
-
filter: drop-shadow(0 1px 10px var(--color-box-shadow));
|
|
32
|
-
|
|
33
|
-
// TOP
|
|
34
|
-
&[x-placement^='top'] {
|
|
35
|
-
.tooltip-arrow {
|
|
36
|
-
bottom: 0;
|
|
37
|
-
margin-top: 0;
|
|
38
|
-
margin-bottom: 0;
|
|
39
|
-
border-width: $arrow-width $arrow-width 0 $arrow-width;
|
|
40
|
-
border-right-color: transparent;
|
|
41
|
-
border-bottom-color: transparent;
|
|
42
|
-
border-left-color: transparent;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// BOTTOM
|
|
47
|
-
&[x-placement^='bottom'] {
|
|
48
|
-
.tooltip-arrow {
|
|
49
|
-
top: 0;
|
|
50
|
-
margin-top: 0;
|
|
51
|
-
margin-bottom: 0;
|
|
52
|
-
border-width: 0 $arrow-width $arrow-width $arrow-width;
|
|
53
|
-
border-top-color: transparent;
|
|
54
|
-
border-right-color: transparent;
|
|
55
|
-
border-left-color: transparent;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// RIGHT
|
|
60
|
-
&[x-placement^='right'] {
|
|
61
|
-
.tooltip-arrow {
|
|
62
|
-
right: 100%;
|
|
63
|
-
margin-right: 0;
|
|
64
|
-
margin-left: 0;
|
|
65
|
-
border-width: $arrow-width $arrow-width $arrow-width 0;
|
|
66
|
-
border-top-color: transparent;
|
|
67
|
-
border-bottom-color: transparent;
|
|
68
|
-
border-left-color: transparent;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// LEFT
|
|
73
|
-
&[x-placement^='left'] {
|
|
74
|
-
.tooltip-arrow {
|
|
75
|
-
left: 100%;
|
|
76
|
-
margin-right: 0;
|
|
77
|
-
margin-left: 0;
|
|
78
|
-
border-width: $arrow-width 0 $arrow-width $arrow-width;
|
|
79
|
-
border-top-color: transparent;
|
|
80
|
-
border-right-color: transparent;
|
|
81
|
-
border-bottom-color: transparent;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// HIDDEN / SHOWN
|
|
86
|
-
&[aria-hidden='true'] {
|
|
87
|
-
visibility: hidden;
|
|
88
|
-
transition: opacity .15s, visibility .15s;
|
|
89
|
-
opacity: 0;
|
|
90
|
-
}
|
|
91
|
-
&[aria-hidden='false'] {
|
|
92
|
-
visibility: visible;
|
|
93
|
-
transition: opacity .15s;
|
|
94
|
-
opacity: 1;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// CONTENT
|
|
98
|
-
.tooltip-inner {
|
|
99
|
-
max-width: 350px;
|
|
100
|
-
padding: 5px 8px;
|
|
101
|
-
text-align: center;
|
|
102
|
-
color: var(--color-main-text);
|
|
103
|
-
border-radius: var(--border-radius);
|
|
104
|
-
background-color: var(--color-main-background);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// ARROW
|
|
108
|
-
.tooltip-arrow {
|
|
109
|
-
position: absolute;
|
|
110
|
-
z-index: 1;
|
|
111
|
-
width: 0;
|
|
112
|
-
height: 0;
|
|
113
|
-
margin: 0;
|
|
114
|
-
border-style: solid;
|
|
115
|
-
border-color: var(--color-main-background);
|
|
116
|
-
}
|
|
117
|
-
}
|
package/src/directives/index.js
DELETED
|
@@ -1,31 +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
|
-
import Focus from './Focus'
|
|
24
|
-
import Linkify from './Linkify'
|
|
25
|
-
import Tooltip from './Tooltip'
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
Focus,
|
|
29
|
-
Linkify,
|
|
30
|
-
Tooltip,
|
|
31
|
-
}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" ><svg xmlns="http://www.w3.org/2000/svg"><metadata></metadata><defs><font id="iconfont-vue-f56d517" horiz-adv-x="5000"><font-face font-family="iconfont-vue-f56d517" font-weight="400" font-stretch="normal" units-per-em="5000" panose-1="2 0 5 3 0 0 0 0 0 0" ascent="5000" descent="0" x-height="0" bbox="-32 0 5011 5000" underline-thickness="0" underline-position="50" unicode-range="U+ea01-ea12" /><missing-glyph horiz-adv-x="0" /><glyph glyph-name="arrow-left-double" unicode="" d="M3750 3906 l-1406 -1406 l1406 -1406 l0 312 l-1094 1094 l1094 1094 l0 312 ZM2344 3906 l-1406 -1406 l1406 -1406 l0 312 l-1094 1094 l1094 1094 l0 312 Z" /><glyph glyph-name="arrow-left" unicode="" d="M1563 2500 l1875 -1875 l0 -312 l-2188 2187 l2188 2188 l0 -313 l-1875 -1875 Z" /><glyph glyph-name="arrow-right-double" unicode="" d="M1250 1094 l1406 1406 l-1406 1406 l0 -312 l1094 -1094 l-1094 -1094 l0 -312 ZM2656 1094 l1407 1406 l-1407 1406 l0 -312 l1094 -1094 l-1094 -1094 l0 -312 Z" /><glyph glyph-name="arrow-right" unicode="" d="M3438 2500 l-1875 1875 l0 313 l2187 -2188 l-2187 -2187 l0 312 l1875 1875 Z" /><glyph glyph-name="breadcrumb" unicode="" d="M148 5000 l-148 -85 l1394 -2415 l-1394 -2415 l148 -85 l1443 2500 l-1443 2500 Z" /><glyph glyph-name="checkmark" unicode="" d="M4045 3971 l-2061 -2061 l-1029 1029 l-442 -441 l1471 -1471 l2503 2502 l-442 442 Z" /><glyph glyph-name="close" unicode="" d="M4375 1156 l-531 -531 l-1344 1344 l-1344 -1344 l-531 531 l1344 1344 l-1344 1344 l531 531 l1344 -1344 l1344 1344 l531 -531 l-1344 -1344 l1344 -1344 Z" /><glyph glyph-name="confirm" unicode="" d="M2656 4844 q-101 0 -180 -57 q-74 -52 -109 -138 q-35 -86 -19 -175 q18 -96 90 -167 l1495 -1494 l-3616 0 q-77 1 -139 -26 q-58 -24 -99 -70 q-39 -44 -59 -101 q-20 -56 -20 -116 q0 -60 20 -116 q20 -57 59 -101 q41 -46 99 -70 q62 -27 139 -25 l3616 0 l-1495 -1495 q-55 -53 -81 -116 q-24 -59 -21 -121 q3 -58 30 -113 q25 -54 68 -97 q43 -43 96 -68 q55 -26 114 -29 q62 -3 120 21 q63 25 116 81 l2029 2028 q59 60 80 141 q21 80 1 159 q-21 82 -81 142 l-2029 2028 q-44 45 -102 70 q-58 25 -122 25 Z" /><glyph glyph-name="info" unicode="" d="M2422 4688 q-111 0 -213 -43 q-98 -42 -174 -117.5 q-76 -75.5 -117 -174.5 q-43 -101 -43 -212.5 q0 -111.5 43 -212.5 q41 -98 117 -174 q76 -76 174 -117 q102 -43 213 -43 q111 0 213 43 q98 41 173.5 117 q75.5 76 117.5 174 q43 101 43 212.5 q0 111.5 -43 212.5 q-42 99 -117.5 174.5 q-75.5 75.5 -173.5 117.5 q-102 43 -213 43 ZM1563 3125 q-86 0 -158 -43 q-71 -41 -112 -112 q-43 -72 -43 -157.5 q0 -85.5 43 -157.5 q41 -71 112 -112 q72 -43 158 -43 l625 0 l0 -1562 l-625 0 q-86 0 -158 -43 q-71 -41 -112 -112 q-43 -73 -43 -158 q0 -85 43 -158 q41 -71 112 -112 q72 -43 158 -42 l1875 0 q85 0 157 42 q71 41 112 112 q43 73 43 158 q0 85 -43 158 q-41 71 -112 112 q-72 43 -157 43 l-625 0 l0 1875 q0 85 -43 157 q-41 71 -112 112 q-73 43 -158 43 l-937 0 Z" /><glyph glyph-name="menu" unicode="" d="M625 4375 l0 -625 l3750 0 l0 625 l-3750 0 ZM625 2813 l0 -625 l3750 0 l0 625 l-3750 0 ZM625 1250 l0 -625 l3750 0 l0 625 l-3750 0 Z" /><glyph glyph-name="more" unicode="" d="M781 3047 q112 0 213 -43 q98 -42 174 -117.5 q76 -75.5 117 -173.5 q43 -102 43 -213 q0 -111 -43 -213 q-41 -98 -117 -173.5 q-76 -75.5 -174 -117.5 q-101 -43 -212.5 -43 q-111.5 0 -213.5 43 q-98 42 -173.5 117.5 q-75.5 75.5 -117.5 173.5 q-43 102 -43 213 q0 111 43 213 q42 98 117.5 173.5 q75.5 75.5 173.5 117.5 q102 43 213 43 ZM2500 3047 q111 0 213 -43 q98 -42 173.5 -117.5 q75.5 -75.5 117.5 -173.5 q43 -102 43 -213 q0 -111 -43 -213 q-42 -98 -117.5 -173.5 q-75.5 -75.5 -173.5 -117.5 q-102 -43 -213 -43 q-111 0 -213 43 q-98 42 -173.5 117.5 q-75.5 75.5 -117.5 173.5 q-43 102 -43 213 q0 111 43 213 q42 98 117.5 173.5 q75.5 75.5 173.5 117.5 q102 43 213 43 ZM4219 3047 q111 0 213 -43 q98 -42 173.5 -117.5 q75.5 -75.5 117.5 -173.5 q43 -102 43 -213 q0 -111 -43 -213 q-42 -98 -117.5 -173.5 q-75.5 -75.5 -173.5 -117.5 q-102 -43 -213.5 -43 q-111.5 0 -212.5 43 q-98 42 -174 117.5 q-76 75.5 -117 173.5 q-43 102 -43 213 q0 111 43 213 q41 98 117 173.5 q76 75.5 174 117.5 q101 43 213 43 Z" /><glyph glyph-name="pause" unicode="" d="M938 4063 l0 -3125 l1250 0 l0 3125 l-1250 0 ZM2813 4063 l0 -3125 l1250 0 l0 3125 l-1250 0 Z" /><glyph glyph-name="play" unicode="" d="M625 4375 l3750 -1875 l-3750 -1875 l0 3750 Z" /><glyph glyph-name="triangle-s" unicode="" d="M1250 3125 l1250 -1250 l1250 1248 l-2500 2 Z" /><glyph glyph-name="user-status-away" unicode="" d="M2156 4969 q-360 -46 -695 -197 q-326 -147 -601 -380 q-274 -231 -472 -528 q-202 -301 -309 -642 q-110 -353 -110 -722 q0 -406 128 -788 q123 -370 356 -686 q229 -313 542 -542 q316 -232 686 -356 q382 -128 788 -128 q369 0 722 107 q342 104 644 301 q298 194 533 463 q236 270 389 593 q156 331 212 692 q-188 -204 -423.5 -351 q-235.5 -147 -498.5 -225 q-269 -80 -547 -80 q-322 0 -628 103 q-295 99 -548 286 q-251 184 -435 435 q-187 253 -286 548 q-103 306 -103 628 q0 293 80 568 q78 269 225.5 498.5 q147.5 229.5 350.5 402.5 Z" /><glyph glyph-name="user-status-dnd" unicode="" d="M2500 5000 q-406 0 -788 -128 q-370 -124 -686 -356 q-313 -229 -542 -542 q-232 -316 -356 -686 q-128 -382 -128 -788 q0 -406 128 -788 q124 -370 356 -686 q229 -313 542 -542 q316 -232 686 -356 q382 -128 788 -128 q406 0 788 128 q370 124 686 356 q313 229 542 542 q232 316 356 686 q128 382 128 788 q0 406 -128 788 q-124 370 -356 686 q-229 313 -542 542 q-316 232 -686 356 q-382 128 -788 128 ZM1563 2969 l1875 0 q91 0 178 -38 q84 -37 150 -103 q66 -66 102 -149 q38 -87 38 -179 q0 -92 -38 -179 q-36 -83 -102 -149 q-66 -66 -150 -103 q-87 -38 -178 -38 l-1875 0 q-92 0 -179 38 q-84 37 -150 103 q-66 66 -102 149 q-38 87 -38 179 q0 92 38 179 q36 83 102 149 q66 66 150 103 q87 38 179 38 Z" /><glyph glyph-name="user-status-invisible" unicode="" d="M2500 5000 q-406 0 -788 -128 q-370 -124 -686 -356 q-313 -229 -542 -542 q-232 -316 -356 -686 q-128 -382 -128 -788 q0 -406 128 -788 q124 -370 356 -686 q229 -313 542 -542 q316 -232 686 -356 q382 -128 788 -128 q406 0 788 128 q370 124 686 356 q313 229 542 542 q232 316 356 686 q128 382 128 788 q0 406 -128 788 q-124 370 -356 686 q-229 313 -542 542 q-316 232 -686 356 q-382 128 -788 128 ZM2500 4000 q311 0 590 -116 q271 -112 476.5 -317.5 q205.5 -205.5 317.5 -476.5 q116 -279 116 -590 q0 -311 -116 -590 q-112 -271 -317.5 -476.5 q-205.5 -205.5 -476.5 -317.5 q-279 -116 -590 -116 q-311 0 -590 116 q-271 112 -476.5 317.5 q-205.5 205.5 -317.5 476.5 q-116 279 -116 590 q0 311 116 590 q112 271 317.5 476.5 q205.5 205.5 476.5 317.5 q279 116 590 116 Z" /><glyph glyph-name="user-status-online" unicode="" d="M1500 1500 l2000 0 l0 2000 l-2000 0 l0 -2000 ZM2500 5000 q-406 0 -788 -128 q-370 -124 -686 -356 q-313 -229 -542 -542 q-232 -316 -356 -686 q-128 -382 -128 -788 q0 -406 128 -788 q124 -370 356 -686 q229 -313 542 -542 q316 -232 686 -356 q382 -128 788 -128 q406 0 788 128 q370 124 686 356 q313 229 542 542 q232 316 356 686 q128 382 128 788 q0 406 -128 788 q-124 370 -356 686 q-229 313 -542 542 q-316 232 -686 356 q-382 128 -788 128 Z" /></font></defs></svg>
|
|
Binary file
|
|
Binary file
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
$__iconfont__data: map-merge(if(global_variable_exists('__iconfont__data'), $__iconfont__data, ()), (
|
|
2
|
-
"iconfont-vue-f56d517": (
|
|
3
|
-
"arrow-left-double": "\ea01",
|
|
4
|
-
"arrow-left": "\ea02",
|
|
5
|
-
"arrow-right-double": "\ea03",
|
|
6
|
-
"arrow-right": "\ea04",
|
|
7
|
-
"breadcrumb": "\ea05",
|
|
8
|
-
"checkmark": "\ea06",
|
|
9
|
-
"close": "\ea07",
|
|
10
|
-
"confirm": "\ea08",
|
|
11
|
-
"info": "\ea09",
|
|
12
|
-
"menu": "\ea0a",
|
|
13
|
-
"more": "\ea0b",
|
|
14
|
-
"pause": "\ea0c",
|
|
15
|
-
"play": "\ea0d",
|
|
16
|
-
"triangle-s": "\ea0e",
|
|
17
|
-
"user-status-away": "\ea0f",
|
|
18
|
-
"user-status-dnd": "\ea10",
|
|
19
|
-
"user-status-invisible": "\ea11",
|
|
20
|
-
"user-status-online": "\ea12"
|
|
21
|
-
)
|
|
22
|
-
));
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
$create-font-face: true !default; // should the @font-face tag get created?
|
|
26
|
-
|
|
27
|
-
// should there be a custom class for each icon? will be .filename
|
|
28
|
-
$create-icon-classes: true !default;
|
|
29
|
-
|
|
30
|
-
// what is the common class name that icons share? in this case icons need to have .icon.filename in their classes
|
|
31
|
-
// this requires you to have 2 classes on each icon html element, but reduced redeclaration of the font family
|
|
32
|
-
// for each icon
|
|
33
|
-
$icon-common-class: 'icon' !default;
|
|
34
|
-
|
|
35
|
-
// if you whish to prefix your filenames, here you can do so.
|
|
36
|
-
// if this string stays empty, your classes will use the filename, for example
|
|
37
|
-
// an icon called star.svg will result in a class called .star
|
|
38
|
-
// if you use the prefix to be 'icon-' it would result in .icon-star
|
|
39
|
-
$icon-prefix: '' !default;
|
|
40
|
-
|
|
41
|
-
// helper function to get the correct font group
|
|
42
|
-
@function iconfont-group($group: null) {
|
|
43
|
-
@if (null == $group) {
|
|
44
|
-
$group: nth(map-keys($__iconfont__data), 1);
|
|
45
|
-
}
|
|
46
|
-
@if (false == map-has-key($__iconfont__data, $group)) {
|
|
47
|
-
@warn 'Undefined Iconfont Family!';
|
|
48
|
-
@return ();
|
|
49
|
-
}
|
|
50
|
-
@return map-get($__iconfont__data, $group);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// helper function to get the correct icon of a group
|
|
54
|
-
@function iconfont-item($name) {
|
|
55
|
-
$slash: str-index($name, '/');
|
|
56
|
-
$group: null;
|
|
57
|
-
@if ($slash) {
|
|
58
|
-
$group: str-slice($name, 0, $slash - 1);
|
|
59
|
-
$name: str-slice($name, $slash + 1);
|
|
60
|
-
} @else {
|
|
61
|
-
$group: nth(map-keys($__iconfont__data), 1);
|
|
62
|
-
}
|
|
63
|
-
$group: iconfont-group($group);
|
|
64
|
-
@if (false == map-has-key($group, $name)) {
|
|
65
|
-
@warn 'Undefined Iconfont Glyph!';
|
|
66
|
-
@return '';
|
|
67
|
-
}
|
|
68
|
-
@return map-get($group, $name);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// complete mixing to include the icon
|
|
72
|
-
// usage:
|
|
73
|
-
// .my_icon{ @include iconfont('star') }
|
|
74
|
-
@mixin iconfont($icon) {
|
|
75
|
-
$slash: str-index($icon, '/');
|
|
76
|
-
$group: null;
|
|
77
|
-
@if ($slash) {
|
|
78
|
-
$group: str-slice($icon, 0, $slash - 1);
|
|
79
|
-
} @else {
|
|
80
|
-
$group: nth(map-keys($__iconfont__data), 1);
|
|
81
|
-
}
|
|
82
|
-
&:before {
|
|
83
|
-
font-family: $group;
|
|
84
|
-
font-style: normal;
|
|
85
|
-
font-weight: 400;
|
|
86
|
-
content: iconfont-item($icon);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// creates the font face tag if the variable is set to true (default)
|
|
91
|
-
@if $create-font-face == true {
|
|
92
|
-
@font-face {
|
|
93
|
-
font-family: "iconfont-vue-f56d517";
|
|
94
|
-
src: url('../iconfont-vue-f56d517.eot'); /* IE9 Compat Modes */
|
|
95
|
-
src: url('../iconfont-vue-f56d517.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
|
96
|
-
url('../iconfont-vue-f56d517.woff') format('woff'), /* Pretty Modern Browsers */
|
|
97
|
-
url('../iconfont-vue-f56d517.ttf') format('truetype'), /* Safari, Android, iOS */
|
|
98
|
-
url('../iconfont-vue-f56d517.svg') format('svg'); /* Legacy iOS */
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// creates icon classes for each individual loaded svg (default)
|
|
103
|
-
@if $create-icon-classes == true {
|
|
104
|
-
.#{$icon-common-class} {
|
|
105
|
-
font-style: normal;
|
|
106
|
-
font-weight: 400;
|
|
107
|
-
|
|
108
|
-
@each $icon, $content in map-get($__iconfont__data, "iconfont-vue-f56d517") {
|
|
109
|
-
&.#{$icon-prefix}#{$icon}:before {
|
|
110
|
-
font-family: "iconfont-vue-f56d517";
|
|
111
|
-
content: iconfont-item("iconfont-vue-f56d517/#{$icon}");
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
|
|
3
|
-
*
|
|
4
|
-
* @author Julius Härtl <jus@bitgrid.net>
|
|
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
|
-
import usernameToColor from './usernameToColor'
|
|
24
|
-
|
|
25
|
-
export default usernameToColor
|
|
@@ -1,68 +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
|
-
import md5 from 'md5'
|
|
24
|
-
import GenColors from '../../utils/GenColors'
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Originally taken from https://github.com/nextcloud/server/blob/master/core/js/placeholder.js
|
|
28
|
-
* @param {string} username Display name or user id to generate from
|
|
29
|
-
* @returns {Object} the rgb colors as {r:255, g:255, b:255}
|
|
30
|
-
*/
|
|
31
|
-
const usernameToColor = function(username) {
|
|
32
|
-
// Normalize hash
|
|
33
|
-
let hash = username.toLowerCase()
|
|
34
|
-
|
|
35
|
-
// Already a md5 hash?
|
|
36
|
-
if (hash.match(/^([0-9a-f]{4}-?){8}$/) === null) {
|
|
37
|
-
hash = md5(hash)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
hash = hash.replace(/[^0-9a-f]/g, '')
|
|
41
|
-
|
|
42
|
-
const steps = 6
|
|
43
|
-
const finalPalette = GenColors(steps)
|
|
44
|
-
|
|
45
|
-
// Convert a string to an integer evenly
|
|
46
|
-
function hashToInt(hash, maximum) {
|
|
47
|
-
let finalInt = 0
|
|
48
|
-
const result = []
|
|
49
|
-
|
|
50
|
-
// Splitting evenly the string
|
|
51
|
-
for (let i = 0; i < hash.length; i++) {
|
|
52
|
-
// chars in md5 goes up to f, hex:16
|
|
53
|
-
result.push(parseInt(hash.charAt(i), 16) % 16)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Adds up all results
|
|
57
|
-
for (const j in result) {
|
|
58
|
-
finalInt += result[j]
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// chars in md5 goes up to f, hex:16
|
|
62
|
-
// make sure we're always using int in our operation
|
|
63
|
-
return parseInt(parseInt(finalInt, 10) % maximum, 10)
|
|
64
|
-
}
|
|
65
|
-
return finalPalette[hashToInt(hash, steps * 3)]
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export default usernameToColor
|