@globalbrain/sefirot 2.0.0-draft.8 → 2.1.0
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/README.md +6 -6
- package/lib/components/SAvatar.vue +17 -17
- package/lib/components/SButton.vue +520 -276
- package/lib/components/SButtonGroup.vue +149 -0
- package/lib/components/SDropdown.vue +26 -150
- package/lib/components/SDropdownSection.vue +48 -0
- package/lib/components/SDropdownSectionFilter.vue +190 -0
- package/lib/components/SDropdownSectionFilterItem.vue +21 -0
- package/lib/components/SDropdownSectionFilterItemAvatar.vue +31 -0
- package/lib/components/SDropdownSectionFilterItemText.vue +20 -0
- package/lib/components/SDropdownSectionMenu.vue +39 -0
- package/lib/components/SIcon.vue +13 -0
- package/lib/components/SInputBase.vue +31 -31
- package/lib/components/SInputCheckbox.vue +4 -3
- package/lib/components/SInputCheckboxes.vue +74 -0
- package/lib/components/SInputDate.vue +182 -0
- package/lib/components/SInputDropdown.vue +159 -157
- package/lib/components/SInputDropdownItem.vue +46 -48
- package/lib/components/SInputDropdownItemAvatar.vue +99 -0
- package/lib/components/SInputDropdownItemText.vue +79 -16
- package/lib/components/SInputFile.vue +56 -60
- package/lib/components/SInputHMS.vue +120 -110
- package/lib/components/SInputNumber.vue +38 -9
- package/lib/components/SInputRadio.vue +39 -36
- package/lib/components/SInputRadios.vue +40 -53
- package/lib/components/SInputSelect.vue +7 -6
- package/lib/components/SInputSwitch.vue +193 -0
- package/lib/components/SInputSwitches.vue +88 -0
- package/lib/components/SInputText.vue +207 -62
- package/lib/components/SInputTextarea.vue +46 -32
- package/lib/components/SInputYMD.vue +123 -126
- package/lib/components/SMarkdown.vue +52 -0
- package/lib/components/SModal.vue +33 -57
- package/lib/components/SMount.vue +19 -0
- package/lib/components/SSheet.vue +50 -55
- package/lib/components/SSheetFooter.vue +1 -1
- package/lib/components/SSheetFooterAction.vue +24 -17
- package/lib/components/SSheetFooterActions.vue +1 -4
- package/lib/components/SSheetForm.vue +15 -0
- package/lib/components/SSheetMedium.vue +8 -10
- package/lib/components/SSheetTitle.vue +7 -14
- package/lib/components/SSnackbar.vue +58 -47
- package/lib/components/{SPortalSnackbars.vue → SSnackbars.vue} +17 -20
- package/lib/components/{icons/SIconPreloader.vue → SSpinner.vue} +5 -4
- package/lib/components/SStep.vue +107 -0
- package/lib/components/SSteps.vue +59 -0
- package/lib/components/STable.vue +242 -0
- package/lib/components/STableCell.vue +82 -0
- package/lib/components/STableCellAvatar.vue +69 -0
- package/lib/components/STableCellAvatars.vue +93 -0
- package/lib/components/STableCellDay.vue +40 -0
- package/lib/components/STableCellPill.vue +84 -0
- package/lib/components/STableCellText.vue +103 -0
- package/lib/components/STableColumn.vue +255 -0
- package/lib/components/STableFooter.vue +115 -0
- package/lib/components/STableHeader.vue +74 -0
- package/lib/components/STableItem.vue +38 -0
- package/lib/components/STooltip.vue +112 -0
- package/lib/composables/Dropdown.ts +40 -99
- package/lib/composables/Form.ts +21 -18
- package/lib/composables/Grid.ts +117 -0
- package/lib/composables/Markdown.ts +138 -0
- package/lib/composables/Step.ts +7 -0
- package/lib/composables/Table.ts +103 -0
- package/lib/composables/Tooltip.ts +91 -0
- package/lib/composables/Validation.ts +5 -9
- package/lib/composables/markdown/LinkPlugin.ts +45 -0
- package/lib/mixins/Sheet.ts +5 -3
- package/lib/stores/Snackbars.ts +48 -0
- package/lib/{assets/styles → styles}/base.css +0 -0
- package/lib/{assets/styles → styles}/bootstrap.css +1 -0
- package/lib/{assets/styles → styles}/variables.css +55 -48
- package/lib/support/Day.ts +8 -0
- package/lib/support/Num.ts +3 -0
- package/lib/support/Time.ts +5 -2
- package/lib/support/Utils.ts +4 -3
- package/lib/types/shims.d.ts +3 -0
- package/lib/validation/validators/requiredYmd.ts +1 -1
- package/lib/validation/validators/ymd.ts +4 -4
- package/package.json +59 -37
- package/CHANGELOG.md +0 -47
- package/lib/.DS_Store +0 -0
- package/lib/components/.DS_Store +0 -0
- package/lib/components/SDialog.vue +0 -140
- package/lib/components/SDropdownItem.vue +0 -78
- package/lib/components/SDropdownItemText.vue +0 -22
- package/lib/components/SDropdownItemUser.vue +0 -40
- package/lib/components/SInputDropdownItemTextTag.vue +0 -94
- package/lib/components/SInputDropdownItemUser.vue +0 -41
- package/lib/components/SInputDropdownItemUserTag.vue +0 -100
- package/lib/components/SPortalModals.vue +0 -74
- package/lib/components/icons/.DS_Store +0 -0
- package/lib/components/icons/SIconActivity.vue +0 -5
- package/lib/components/icons/SIconArrowDown.vue +0 -5
- package/lib/components/icons/SIconArrowLeft.vue +0 -5
- package/lib/components/icons/SIconArrowRight.vue +0 -5
- package/lib/components/icons/SIconArrowUp.vue +0 -5
- package/lib/components/icons/SIconBarChart.vue +0 -7
- package/lib/components/icons/SIconBriefcase.vue +0 -5
- package/lib/components/icons/SIconBuilding.vue +0 -5
- package/lib/components/icons/SIconCalendar.vue +0 -5
- package/lib/components/icons/SIconCheck.vue +0 -5
- package/lib/components/icons/SIconCheckCircle.vue +0 -6
- package/lib/components/icons/SIconCheckCircleThin.vue +0 -6
- package/lib/components/icons/SIconCheckSquare.vue +0 -6
- package/lib/components/icons/SIconChevronDown.vue +0 -5
- package/lib/components/icons/SIconChevronLeft.vue +0 -5
- package/lib/components/icons/SIconChevronRight.vue +0 -5
- package/lib/components/icons/SIconChevronUp.vue +0 -5
- package/lib/components/icons/SIconClock.vue +0 -6
- package/lib/components/icons/SIconCode.vue +0 -6
- package/lib/components/icons/SIconDatabase.vue +0 -5
- package/lib/components/icons/SIconDollarSign.vue +0 -5
- package/lib/components/icons/SIconDownload.vue +0 -6
- package/lib/components/icons/SIconDownloadCloud.vue +0 -6
- package/lib/components/icons/SIconEdit.vue +0 -6
- package/lib/components/icons/SIconEdit2.vue +0 -5
- package/lib/components/icons/SIconEdit3.vue +0 -6
- package/lib/components/icons/SIconEdit3Off.vue +0 -6
- package/lib/components/icons/SIconExternalLink.vue +0 -6
- package/lib/components/icons/SIconEye.vue +0 -6
- package/lib/components/icons/SIconFile.vue +0 -5
- package/lib/components/icons/SIconFilePlus.vue +0 -6
- package/lib/components/icons/SIconFileText.vue +0 -8
- package/lib/components/icons/SIconFlag.vue +0 -5
- package/lib/components/icons/SIconGitBranch.vue +0 -5
- package/lib/components/icons/SIconGitCommit.vue +0 -5
- package/lib/components/icons/SIconGitPullRequest.vue +0 -6
- package/lib/components/icons/SIconGlobe.vue +0 -5
- package/lib/components/icons/SIconGrab.vue +0 -10
- package/lib/components/icons/SIconGrid.vue +0 -8
- package/lib/components/icons/SIconHome.vue +0 -5
- package/lib/components/icons/SIconImage.vue +0 -6
- package/lib/components/icons/SIconInbox.vue +0 -5
- package/lib/components/icons/SIconInfo.vue +0 -7
- package/lib/components/icons/SIconLayout.vue +0 -5
- package/lib/components/icons/SIconList.vue +0 -10
- package/lib/components/icons/SIconLock.vue +0 -5
- package/lib/components/icons/SIconLogout.vue +0 -6
- package/lib/components/icons/SIconMail.vue +0 -6
- package/lib/components/icons/SIconMapPin.vue +0 -6
- package/lib/components/icons/SIconMoon.vue +0 -5
- package/lib/components/icons/SIconMoreHorizontal.vue +0 -7
- package/lib/components/icons/SIconMoreVertical.vue +0 -7
- package/lib/components/icons/SIconPauseFill.vue +0 -6
- package/lib/components/icons/SIconPlayCircle.vue +0 -6
- package/lib/components/icons/SIconPlayFill.vue +0 -5
- package/lib/components/icons/SIconPlus.vue +0 -5
- package/lib/components/icons/SIconPlusCircle.vue +0 -8
- package/lib/components/icons/SIconPlusOff.vue +0 -7
- package/lib/components/icons/SIconPreloaderDark.vue +0 -52
- package/lib/components/icons/SIconPreloaderLight.vue +0 -52
- package/lib/components/icons/SIconProgress.vue +0 -5
- package/lib/components/icons/SIconRadio.vue +0 -6
- package/lib/components/icons/SIconSave.vue +0 -5
- package/lib/components/icons/SIconSearch.vue +0 -5
- package/lib/components/icons/SIconSend.vue +0 -5
- package/lib/components/icons/SIconSettings.vue +0 -6
- package/lib/components/icons/SIconShare2.vue +0 -5
- package/lib/components/icons/SIconSkipBackFill.vue +0 -6
- package/lib/components/icons/SIconSliders.vue +0 -12
- package/lib/components/icons/SIconSun.vue +0 -13
- package/lib/components/icons/SIconTelescope.vue +0 -5
- package/lib/components/icons/SIconTrash.vue +0 -5
- package/lib/components/icons/SIconTrash2.vue +0 -7
- package/lib/components/icons/SIconTrash2Off.vue +0 -6
- package/lib/components/icons/SIconTrello.vue +0 -7
- package/lib/components/icons/SIconUser.vue +0 -6
- package/lib/components/icons/SIconUsers.vue +0 -8
- package/lib/components/icons/SIconWarning.vue +0 -7
- package/lib/components/icons/SIconX.vue +0 -5
- package/lib/components/icons/SIconXCircle.vue +0 -6
- package/lib/components/icons/SIconXCircleThin.vue +0 -6
- package/lib/components/icons/SIconXSquare.vue +0 -6
- package/lib/components/icons/SIconZap.vue +0 -5
- package/lib/composables/Dialog.ts +0 -38
- package/lib/composables/Modal.ts +0 -34
- package/lib/composables/Snackbar.ts +0 -18
- package/lib/store/Sefirot.ts +0 -17
- package/lib/store/dialog/index.ts +0 -42
- package/lib/store/modal/index.ts +0 -61
- package/lib/store/snackbars/index.ts +0 -70
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="SDialog" :class="{ 'load-only': isLoadOnly }">
|
|
3
|
-
<p v-if="title" class="title">{{ title }}</p>
|
|
4
|
-
<p v-if="text" class="text">{{ text }}</p>
|
|
5
|
-
|
|
6
|
-
<div v-if="isTypeLoading" class="load">
|
|
7
|
-
<div class="load-icon">
|
|
8
|
-
<SIconPreloader class="load-svg" />
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div v-if="actions.length > 0" class="actions">
|
|
13
|
-
<div v-for="(action, index) in actions" :key="index" class="action">
|
|
14
|
-
<SButton
|
|
15
|
-
size="small"
|
|
16
|
-
:type="getActionType(action.type)"
|
|
17
|
-
:label="action.label"
|
|
18
|
-
@click="action.callback"
|
|
19
|
-
/>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<script setup lang="ts">
|
|
26
|
-
import { PropType, computed } from 'vue'
|
|
27
|
-
import { Action } from '../store/dialog'
|
|
28
|
-
import SIconPreloader from './icons/SIconPreloader.vue'
|
|
29
|
-
import SButton from './SButton.vue'
|
|
30
|
-
|
|
31
|
-
const props = defineProps({
|
|
32
|
-
type: { type: String as PropType<'confirm' | 'loading'>, default: 'confirm' },
|
|
33
|
-
title: { type: String, default: null },
|
|
34
|
-
text: { type: String, default: null },
|
|
35
|
-
actions: { type: Array as PropType<Action[]>, default: () => [] }
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
const isTypeLoading = computed(() => props.type === 'loading')
|
|
39
|
-
const isLoadOnly = computed(() => isTypeLoading.value && !props.title && !props.text)
|
|
40
|
-
|
|
41
|
-
function getActionType(value?: 'text' | 'mute'): 'text' | 'mute' {
|
|
42
|
-
return value !== 'mute' ? 'text' : 'mute'
|
|
43
|
-
}
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<style lang="postcss" scoped>
|
|
47
|
-
.SDialog {
|
|
48
|
-
margin: 96px 16px;
|
|
49
|
-
border: 1px solid var(--c-divider-light);
|
|
50
|
-
border-radius: 8px;
|
|
51
|
-
padding: 16px 16px 8px;
|
|
52
|
-
max-width: 392px;
|
|
53
|
-
background-color: var(--c-bg);
|
|
54
|
-
box-shadow: var(--shadow-depth-3);
|
|
55
|
-
|
|
56
|
-
@media (min-width: 424px) {
|
|
57
|
-
margin: 64px auto;
|
|
58
|
-
padding: 24px 24px 16px;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.SDialog.load-only {
|
|
63
|
-
margin: 128px auto;
|
|
64
|
-
padding: 0;
|
|
65
|
-
width: 80px;
|
|
66
|
-
height: 80px;
|
|
67
|
-
|
|
68
|
-
.load {
|
|
69
|
-
display: flex;
|
|
70
|
-
justify-content: center;
|
|
71
|
-
align-items: center;
|
|
72
|
-
margin: 0;
|
|
73
|
-
padding: 0;
|
|
74
|
-
width: 80px;
|
|
75
|
-
height: 80px;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.load-svg {
|
|
79
|
-
transform: translate(0);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@media (min-width: 424px) {
|
|
83
|
-
margin: 128px auto;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.title {
|
|
88
|
-
line-height: 28px;
|
|
89
|
-
font-size: 16px;
|
|
90
|
-
font-weight: 500;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.text {
|
|
94
|
-
line-height: 20px;
|
|
95
|
-
font-size: 14px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.load {
|
|
99
|
-
margin-top: 2px;
|
|
100
|
-
transform: translateY(1px);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.load-svg {
|
|
104
|
-
width: 48px;
|
|
105
|
-
height: 48px;
|
|
106
|
-
transform: translate(-10px, 2px);
|
|
107
|
-
|
|
108
|
-
@media (min-width: 424px) {
|
|
109
|
-
transform: translate(-12px, 6px);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.progress {
|
|
114
|
-
padding-top: 14px;
|
|
115
|
-
padding-bottom: 8px;
|
|
116
|
-
|
|
117
|
-
@media (min-width: 424px) {
|
|
118
|
-
padding-top: 16px;
|
|
119
|
-
padding-bottom: 4px;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.actions {
|
|
124
|
-
display: flex;
|
|
125
|
-
justify-content: flex-end;
|
|
126
|
-
flex-wrap: wrap;
|
|
127
|
-
margin: 0 -8px;
|
|
128
|
-
padding-top: 12px;
|
|
129
|
-
|
|
130
|
-
@media (min-width: 424px) {
|
|
131
|
-
margin: 0 -10px;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.action {
|
|
136
|
-
@media (min-width: 424px) {
|
|
137
|
-
padding: 0 4px;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
</style>
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<li class="SDropdownItem" role="button" @click="$emit('click')">
|
|
3
|
-
<div v-if="item" class="content">
|
|
4
|
-
<component :is="component" :item="item" />
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
|
-
<div class="status">
|
|
8
|
-
<SIconCheck v-if="isActive" class="status-icon" />
|
|
9
|
-
</div>
|
|
10
|
-
</li>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script setup lang="ts">
|
|
14
|
-
import { ComputedRef, PropType, computed } from 'vue'
|
|
15
|
-
import { isArray, isEqual } from '../support/Utils'
|
|
16
|
-
import SIconCheck from './icons/SIconCheck.vue'
|
|
17
|
-
import SDropdownItemText from './SDropdownItemText.vue'
|
|
18
|
-
import SDropdownItemUser from './SDropdownItemUser.vue'
|
|
19
|
-
|
|
20
|
-
const props = defineProps({
|
|
21
|
-
selected: { type: Object as PropType<ComputedRef<any>>, default: null },
|
|
22
|
-
item: { type: Object as PropType<any>, default: null }
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
defineEmits(['click'])
|
|
26
|
-
|
|
27
|
-
const component = computed(() => {
|
|
28
|
-
if (props.item.type === 'text') {
|
|
29
|
-
return SDropdownItemText
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (props.item.type === 'user') {
|
|
33
|
-
return SDropdownItemUser
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
throw new Error('Invalid item type.')
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
const isActive = computed(() => {
|
|
40
|
-
if (!props.selected) {
|
|
41
|
-
return false
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const selected = props.selected.value
|
|
45
|
-
const value = props.item.value
|
|
46
|
-
|
|
47
|
-
return isArray(selected)
|
|
48
|
-
? !!selected.find(s => isEqual(s, value))
|
|
49
|
-
: isEqual(selected, value)
|
|
50
|
-
})
|
|
51
|
-
</script>
|
|
52
|
-
|
|
53
|
-
<style lang="postcss" scoped>
|
|
54
|
-
@import "@/assets/styles/variables";
|
|
55
|
-
|
|
56
|
-
.SDropdownItem {
|
|
57
|
-
display: flex;
|
|
58
|
-
justify-content: space-between;
|
|
59
|
-
padding: 8px 12px 8px 16px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.status {
|
|
63
|
-
display: flex;
|
|
64
|
-
justify-content: center;
|
|
65
|
-
align-items: center;
|
|
66
|
-
margin-left: 8px;
|
|
67
|
-
width: 16px;
|
|
68
|
-
height: 16px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.status-icon {
|
|
72
|
-
width: 16px;
|
|
73
|
-
height: 16px;
|
|
74
|
-
transform: translateY(1px);
|
|
75
|
-
fill: var(--c-text-1);
|
|
76
|
-
transition: fill .25s;
|
|
77
|
-
}
|
|
78
|
-
</style>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="SDropdownItemText">
|
|
3
|
-
<p class="text">{{ item.text }}</p>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import { PropType } from 'vue'
|
|
9
|
-
|
|
10
|
-
defineProps({
|
|
11
|
-
item: { type: Object as PropType<any>, required: true }
|
|
12
|
-
})
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<style lang="postcss" scoped>
|
|
16
|
-
.text {
|
|
17
|
-
margin: 0;
|
|
18
|
-
line-height: 16px;
|
|
19
|
-
font-size: 12px;
|
|
20
|
-
font-weight: 500;
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="SDropdownItemUser">
|
|
3
|
-
<div class="avatar">
|
|
4
|
-
<SAvatar size="mini" :avatar="item.avatar" :name="item.name" />
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
|
-
<p class="name">{{ item.name }}</p>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import { PropType } from 'vue'
|
|
13
|
-
import { UserItem } from '../composables/Dropdown'
|
|
14
|
-
import SAvatar from './SAvatar.vue'
|
|
15
|
-
|
|
16
|
-
defineProps({
|
|
17
|
-
item: { type: Object as PropType<UserItem>, required: true }
|
|
18
|
-
})
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<style lang="postcss" scoped>
|
|
22
|
-
.SDropdownItemUser {
|
|
23
|
-
position: relative;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.avatar {
|
|
27
|
-
position: absolute;
|
|
28
|
-
top: 0;
|
|
29
|
-
left: -4px;
|
|
30
|
-
width: 24px;
|
|
31
|
-
height: 24px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.name {
|
|
35
|
-
padding-left: 32px;
|
|
36
|
-
line-height: 24px;
|
|
37
|
-
font-size: 12px;
|
|
38
|
-
font-weight: 500;
|
|
39
|
-
}
|
|
40
|
-
</style>
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="SInputDropdownItemTextTag" :class="{ disabled }">
|
|
3
|
-
<p class="text">{{ item.text }}</p>
|
|
4
|
-
|
|
5
|
-
<div v-if="!disabled" class="remove" role="button" @click="$emit('remove')">
|
|
6
|
-
<div class="remove-box">
|
|
7
|
-
<SIconX class="remove-icon" />
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script setup lang="ts">
|
|
14
|
-
import { PropType } from 'vue'
|
|
15
|
-
import SIconX from './icons/SIconX.vue'
|
|
16
|
-
|
|
17
|
-
defineProps({
|
|
18
|
-
item: { type: Object as PropType<any>, required: true },
|
|
19
|
-
disabled: { type: Boolean, default: false }
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
defineEmits(['remove'])
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<style lang="postcss" scoped>
|
|
26
|
-
.SInputDropdownItemTextTag {
|
|
27
|
-
display: flex;
|
|
28
|
-
border-radius: 12px;
|
|
29
|
-
padding: 0 0 0 10px;
|
|
30
|
-
background-color: var(--c-white-mute);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.dark .SInputDropdownItemTextTag {
|
|
34
|
-
background-color: var(--c-black-mute);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.SInputDropdownItemTextTag.disabled {
|
|
38
|
-
padding: 0 10px 0;
|
|
39
|
-
background-color: var(--c-gray-light-4);
|
|
40
|
-
|
|
41
|
-
.text {
|
|
42
|
-
color: var(--c-text-2);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.dark .SInputDropdownItemTextTag.disabled {
|
|
47
|
-
background-color: var(--c-gray-dark-2);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.text {
|
|
51
|
-
margin: 0;
|
|
52
|
-
line-height: 24px;
|
|
53
|
-
font-size: 12px;
|
|
54
|
-
font-weight: 500;
|
|
55
|
-
white-space: nowrap;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.remove {
|
|
59
|
-
display: flex;
|
|
60
|
-
justify-content: center;
|
|
61
|
-
align-items: center;
|
|
62
|
-
margin-left: 2px;
|
|
63
|
-
width: 24px;
|
|
64
|
-
height: 24px;
|
|
65
|
-
|
|
66
|
-
&:hover .remove-box {
|
|
67
|
-
color: var(--c-text-1);
|
|
68
|
-
background-color: var(--c-gray-light-4)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.dark .remove {
|
|
73
|
-
&:hover .remove-box {
|
|
74
|
-
background-color: var(--c-gray-dark-2)
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.remove-box {
|
|
79
|
-
display: flex;
|
|
80
|
-
justify-content: center;
|
|
81
|
-
align-items: center;
|
|
82
|
-
border-radius: 50%;
|
|
83
|
-
width: 20px;
|
|
84
|
-
height: 20px;
|
|
85
|
-
color: var(--c-text-2);
|
|
86
|
-
transition: color .25s, background-color .25s;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.remove-icon {
|
|
90
|
-
width: 12px;
|
|
91
|
-
height: 12px;
|
|
92
|
-
fill: currentColor;
|
|
93
|
-
}
|
|
94
|
-
</style>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="SInputDropdownItemUser" :class="{ disabled }">
|
|
3
|
-
<div class="avatar">
|
|
4
|
-
<SAvatar size="mini" :avatar="item.avatar" :name="item.name" />
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
|
-
<p class="name">{{ item.name }}</p>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import { PropType } from 'vue'
|
|
13
|
-
import { UserItem } from '../composables/Dropdown'
|
|
14
|
-
import SAvatar from './SAvatar.vue'
|
|
15
|
-
|
|
16
|
-
defineProps({
|
|
17
|
-
item: { type: Object as PropType<UserItem>, required: true },
|
|
18
|
-
disabled: { type: Boolean, default: false }
|
|
19
|
-
})
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<style lang="postcss" scoped>
|
|
23
|
-
.SInputDropdownItemUser {
|
|
24
|
-
position: relative;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.avatar {
|
|
28
|
-
position: absolute;
|
|
29
|
-
top: 0;
|
|
30
|
-
left: 0;
|
|
31
|
-
width: 24px;
|
|
32
|
-
height: 24px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.name {
|
|
36
|
-
padding-left: 32px;
|
|
37
|
-
line-height: 24px;
|
|
38
|
-
font-size: 12px;
|
|
39
|
-
font-weight: 500;
|
|
40
|
-
}
|
|
41
|
-
</style>
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="SInputDropdownItemUserTag" :class="{ disabled }">
|
|
3
|
-
<div class="user">
|
|
4
|
-
<div class="avatar">
|
|
5
|
-
<SAvatar size="nano" :avatar="item.avatar" :name="item.name" />
|
|
6
|
-
</div>
|
|
7
|
-
|
|
8
|
-
<p class="name">{{ item.name }}</p>
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
<div v-if="!disabled" class="remove" role="button" @click="$emit('remove')">
|
|
12
|
-
<div class="remove-box">
|
|
13
|
-
<SIconX class="remove-icon" />
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script setup lang="ts">
|
|
20
|
-
import { PropType } from 'vue'
|
|
21
|
-
import { UserItem } from '../composables/Dropdown'
|
|
22
|
-
import SIconX from './icons/SIconX.vue'
|
|
23
|
-
import SAvatar from './SAvatar.vue'
|
|
24
|
-
|
|
25
|
-
defineProps({
|
|
26
|
-
item: { type: Object as PropType<UserItem>, required: true },
|
|
27
|
-
disabled: { type: Boolean, default: false }
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
defineEmits(['remove'])
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
<style lang="postcss" scoped>
|
|
34
|
-
.SInputDropdownItemUserTag {
|
|
35
|
-
display: flex;
|
|
36
|
-
border-radius: 12px;
|
|
37
|
-
padding: 0 0 0 0;
|
|
38
|
-
background-color: var(--c-white-mute);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.SInputDropdownItemUserTag.disabled {
|
|
42
|
-
padding: 0 10px 0 0;
|
|
43
|
-
background-color: var(--c-gray-light-4);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.dark .SInputDropdownItemUserTag {
|
|
47
|
-
background-color: var(--c-black-mute);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.user {
|
|
51
|
-
display: flex;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.avatar {
|
|
55
|
-
padding: 2px 0 0 2px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.name {
|
|
59
|
-
padding-left: 6px;
|
|
60
|
-
font-size: 12px;
|
|
61
|
-
font-weight: 500;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.remove {
|
|
65
|
-
display: flex;
|
|
66
|
-
justify-content: center;
|
|
67
|
-
align-items: center;
|
|
68
|
-
margin-left: 2px;
|
|
69
|
-
width: 24px;
|
|
70
|
-
height: 24px;
|
|
71
|
-
|
|
72
|
-
&:hover .remove-box {
|
|
73
|
-
color: var(--c-text-1);
|
|
74
|
-
background-color: var(--c-gray-light-4)
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.dark .remove {
|
|
79
|
-
&:hover .remove-box {
|
|
80
|
-
background-color: var(--c-gray-dark-2)
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.remove-box {
|
|
85
|
-
display: flex;
|
|
86
|
-
justify-content: center;
|
|
87
|
-
align-items: center;
|
|
88
|
-
border-radius: 50%;
|
|
89
|
-
width: 20px;
|
|
90
|
-
height: 20px;
|
|
91
|
-
color: var(--c-text-2);
|
|
92
|
-
transition: color .25s, background-color .25s;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.remove-icon {
|
|
96
|
-
width: 12px;
|
|
97
|
-
height: 12px;
|
|
98
|
-
fill: currentColor;
|
|
99
|
-
}
|
|
100
|
-
</style>
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<transition name="fade">
|
|
3
|
-
<div v-if="isActive" class="SPortalModals">
|
|
4
|
-
<transition-group name="fade" :duration="250" appear>
|
|
5
|
-
<SModal
|
|
6
|
-
v-for="(item, index) in items"
|
|
7
|
-
:key="item.id"
|
|
8
|
-
:id="item.id"
|
|
9
|
-
:show="index === items.length - 1"
|
|
10
|
-
:component="item.component"
|
|
11
|
-
:data="item.data"
|
|
12
|
-
@close="id => close(id)"
|
|
13
|
-
/>
|
|
14
|
-
</transition-group>
|
|
15
|
-
</div>
|
|
16
|
-
</transition>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script setup lang="ts">
|
|
20
|
-
import { ref, computed, watch } from 'vue'
|
|
21
|
-
import { useRoute } from 'vue-router'
|
|
22
|
-
import { useStore } from 'vuex'
|
|
23
|
-
import SModal from './SModal.vue'
|
|
24
|
-
|
|
25
|
-
const route = useRoute()
|
|
26
|
-
const store = useStore()
|
|
27
|
-
|
|
28
|
-
const items = computed(() => store.state.modal.items)
|
|
29
|
-
const hasItem = computed(() => items.value.length > 0)
|
|
30
|
-
|
|
31
|
-
const isActive = ref(false)
|
|
32
|
-
|
|
33
|
-
let timer: any
|
|
34
|
-
|
|
35
|
-
watch(hasItem, (value) => {
|
|
36
|
-
clearTimeout(timer)
|
|
37
|
-
|
|
38
|
-
value
|
|
39
|
-
? (isActive.value = true)
|
|
40
|
-
: (timer = setTimeout(() => { isActive.value = false }, 250))
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
watch(route, closeAll)
|
|
44
|
-
|
|
45
|
-
function close(id?: number) {
|
|
46
|
-
store.dispatch('modal/close', id)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function closeAll() {
|
|
50
|
-
store.dispatch('modal/closeAll')
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<style scoped lang="postcss">
|
|
55
|
-
.SPortalModals {
|
|
56
|
-
position: fixed;
|
|
57
|
-
top: 0;
|
|
58
|
-
right: 0;
|
|
59
|
-
bottom: 0;
|
|
60
|
-
left: 0;
|
|
61
|
-
z-index: var(--z-index-backdrop);
|
|
62
|
-
background-color: rgba(0, 0, 0, .8);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.SPortalModals.fade-enter-active,
|
|
66
|
-
.SPortalModals.fade-leave-active {
|
|
67
|
-
transition: opacity .25s;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.SPortalModals.fade-enter-from,
|
|
71
|
-
.SPortalModals.fade-leave-to {
|
|
72
|
-
opacity: 0;
|
|
73
|
-
}
|
|
74
|
-
</style>
|
|
Binary file
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M15,22c-0.4,0-0.8-0.3-0.9-0.7L9,6.2l-2.1,6.2C6.8,12.7,6.4,13,6,13H2c-0.6,0-1-0.4-1-1s0.4-1,1-1h3.3l2.8-8.3C8.2,2.3,8.6,2,9,2s0.8,0.3,0.9,0.7L15,17.8l2.1-6.2c0.1-0.4,0.5-0.7,0.9-0.7h4c0.6,0,1,0.4,1,1s-0.4,1-1,1h-3.3l-2.8,8.3C15.8,21.7,15.4,22,15,22z" />
|
|
4
|
-
</svg>
|
|
5
|
-
</template>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M19.7,11.3c-0.4-0.4-1-0.4-1.4,0L13,16.6V5c0-0.6-0.4-1-1-1s-1,0.4-1,1v11.6l-5.3-5.3c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l7,7c0.1,0.1,0.2,0.2,0.3,0.2C11.7,20,11.9,20,12,20s0.3,0,0.4-0.1c0.1-0.1,0.2-0.1,0.3-0.2l7-7C20.1,12.3,20.1,11.7,19.7,11.3z" />
|
|
4
|
-
</svg>
|
|
5
|
-
</template>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M19,11H7.4l5.3-5.3c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0l-7,7c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.2-0.1,0.5,0,0.8c0.1,0.1,0.1,0.2,0.2,0.3l7,7c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L7.4,13H19c0.6,0,1-0.4,1-1S19.6,11,19,11z" />
|
|
4
|
-
</svg>
|
|
5
|
-
</template>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M19.9,12.4c0.1-0.2,0.1-0.5,0-0.8c-0.1-0.1-0.1-0.2-0.2-0.3l-7-7c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l5.3,5.3H5c-0.6,0-1,0.4-1,1s0.4,1,1,1h11.6l-5.3,5.3c-0.4,0.4-0.4,1,0,1.4c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3l7-7C19.8,12.6,19.9,12.5,19.9,12.4z" />
|
|
4
|
-
</svg>
|
|
5
|
-
</template>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M19.7,11.3l-7-7c-0.1-0.1-0.2-0.2-0.3-0.2c-0.2-0.1-0.5-0.1-0.8,0c-0.1,0.1-0.2,0.1-0.3,0.2l-7,7c-0.4,0.4-0.4,1,0,1.4s1,0.4,1.4,0L11,7.4V19c0,0.6,0.4,1,1,1s1-0.4,1-1V7.4l5.3,5.3c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3C20.1,12.3,20.1,11.7,19.7,11.3z" />
|
|
4
|
-
</svg>
|
|
5
|
-
</template>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M12,21c-0.6,0-1-0.4-1-1V10c0-0.6,0.4-1,1-1s1,0.4,1,1v10C13,20.6,12.6,21,12,21z" />
|
|
4
|
-
<path d="M18,21c-0.6,0-1-0.4-1-1V4c0-0.6,0.4-1,1-1s1,0.4,1,1v16C19,20.6,18.6,21,18,21z" />
|
|
5
|
-
<path d="M6,21c-0.6,0-1-0.4-1-1v-4c0-0.6,0.4-1,1-1s1,0.4,1,1v4C7,20.6,6.6,21,6,21z" />
|
|
6
|
-
</svg>
|
|
7
|
-
</template>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M20,6h-3V5c0-1.7-1.3-3-3-3h-4C8.3,2,7,3.3,7,5v1H4C2.3,6,1,7.3,1,9v10c0,1.7,1.3,3,3,3h16c1.7,0,3-1.3,3-3V9C23,7.3,21.7,6,20,6z M9,5c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1v1H9V5zM15,8v12H9V8H15zM3,19V9c0-0.6,0.4-1,1-1h3v12H4C3.4,20,3,19.6,3,19zM21,19c0,0.6-0.4,1-1,1h-3V8h3c0.6,0,1,0.4,1,1V19z" />
|
|
4
|
-
</svg>
|
|
5
|
-
</template>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M21,20H20V5a3,3,0,0,0-3-3H7A3,3,0,0,0,4,5V20H3a1,1,0,0,0,0,2H21a1,1,0,0,0,0-2ZM6,5A1,1,0,0,1,7,4H17a1,1,0,0,1,1,1V20H16V14a1,1,0,0,0-1-1H9a1,1,0,0,0-1,1v6H6Zm8,15H10V15h4Z" />
|
|
4
|
-
</svg>
|
|
5
|
-
</template>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M19,3h-2V2c0-0.6-0.4-1-1-1s-1,0.4-1,1v1H9V2c0-0.6-0.4-1-1-1S7,1.4,7,2v1H5C3.3,3,2,4.3,2,6v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V6C22,4.3,20.7,3,19,3zM5,5h2v1c0,0.6,0.4,1,1,1s1-0.4,1-1V5h6v1c0,0.6,0.4,1,1,1s1-0.4,1-1V5h2c0.6,0,1,0.4,1,1v3H4V6C4,5.4,4.4,5,5,5zM19,21H5c-0.6,0-1-0.4-1-1v-9h16v9C20,20.6,19.6,21,19,21z" />
|
|
4
|
-
</svg>
|
|
5
|
-
</template>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M12,23C12,23,12,23,12,23C5.9,23,1,18.1,1,12C1,5.9,5.9,1,12,1c0,0,0,0,0,0c1.6,0,3.1,0.3,4.5,1C17,2.2,17.2,2.8,17,3.3c-0.2,0.5-0.8,0.7-1.3,0.5C14.5,3.3,13.3,3,12,3c0,0,0,0,0,0c-5,0-9,4-9,9c0,5,4,9,9,9c0,0,0,0,0,0c5,0,9-4,9-9v-0.9c0-0.6,0.4-1,1-1s1,0.4,1,1V12C23,18.1,18.1,23,12,23z" />
|
|
4
|
-
<path d="M12,15c-0.3,0-0.5-0.1-0.7-0.3l-3-3c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l2.3,2.3l9.3-9.3c0.4-0.4,1-0.4,1.4,0c0.4,0.4,0.4,1,0,1.4l-10,10C12.5,14.9,12.3,15,12,15z" />
|
|
5
|
-
</svg>
|
|
6
|
-
</template>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M12,23h0A11,11,0,0,1,1,12,11,11,0,0,1,12,1h0a10.89,10.89,0,0,1,4.46,1,.5.5,0,1,1-.41.91A9.9,9.9,0,0,0,12,2h0A10,10,0,0,0,2,12,10,10,0,0,0,12,22h0A10,10,0,0,0,22,12V11a.5.5,0,1,1,1,0v1A11,11,0,0,1,12,23Z" />
|
|
4
|
-
<path d="M11.48,14.61h0a.5.5,0,0,1-.35-.15L8,11.31a.5.5,0,1,1,.71-.71l2.79,2.8L22.65,2.2a.5.5,0,1,1,.71.71L11.83,14.46A.5.5,0,0,1,11.48,14.61Z" />
|
|
5
|
-
</svg>
|
|
6
|
-
</template>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
-
<path d="M12,15c-0.3,0-0.5-0.1-0.7-0.3l-3-3c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l2.3,2.3l9.3-9.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-10,10C12.5,14.9,12.3,15,12,15z" />
|
|
4
|
-
<path d="M19,22H5c-1.7,0-3-1.3-3-3V5c0-1.7,1.3-3,3-3h11c0.6,0,1,0.4,1,1s-0.4,1-1,1H5C4.4,4,4,4.4,4,5v14c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1v-7c0-0.6,0.4-1,1-1s1,0.4,1,1v7C22,20.7,20.7,22,19,22z" />
|
|
5
|
-
</svg>
|
|
6
|
-
</template>
|