@globalbrain/sefirot 0.72.0 → 2.0.0-draft.4
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 +8 -808
- package/README.md +1 -1
- package/lib/assets/styles/bootstrap.css +1 -2
- package/lib/assets/styles/variables.css +14 -47
- package/lib/components/SAvatar.vue +9 -18
- package/lib/components/SButton.vue +35 -48
- package/lib/components/SDialog.vue +16 -34
- package/lib/components/SDropdown.vue +36 -55
- package/lib/components/SDropdownItem.vue +27 -39
- package/lib/components/SDropdownItemText.vue +4 -9
- package/lib/components/SDropdownItemUser.vue +4 -12
- package/lib/components/SInputBase.vue +33 -45
- package/lib/components/SInputCheckbox.vue +17 -37
- package/lib/components/SInputDropdown.vue +109 -171
- package/lib/components/SInputDropdownItem.vue +26 -32
- package/lib/components/SInputDropdownItemText.vue +6 -11
- package/lib/components/SInputDropdownItemTextTag.vue +10 -17
- package/lib/components/SInputDropdownItemUser.vue +5 -13
- package/lib/components/SInputDropdownItemUserTag.vue +9 -16
- package/lib/components/SInputFile.vue +38 -53
- package/lib/components/SInputHMS.vue +91 -114
- package/lib/components/SInputNumber.vue +27 -106
- package/lib/components/SInputRadio.vue +21 -34
- package/lib/components/SInputRadios.vue +36 -46
- package/lib/components/SInputText.vue +72 -628
- package/lib/components/SInputTextarea.vue +54 -113
- package/lib/components/SInputYMD.vue +94 -105
- package/lib/components/SLink.vue +16 -52
- package/lib/components/SModal.vue +39 -98
- package/lib/components/SPortalModals.vue +37 -54
- package/lib/components/SPortalSnackbars.vue +9 -24
- package/lib/components/SSheet.vue +73 -28
- package/lib/components/SSheetFooter.vue +5 -3
- package/lib/components/SSheetFooterAction.vue +10 -15
- package/lib/components/SSheetFooterActions.vue +2 -4
- package/lib/components/SSheetMedium.vue +14 -22
- package/lib/components/SSheetTitle.vue +20 -0
- package/lib/components/SSnackbar.vue +18 -28
- package/lib/composables/Dialog.ts +9 -17
- package/lib/composables/Dropdown.ts +2 -2
- package/lib/composables/{Menu.ts → Flyout.ts} +11 -4
- package/lib/composables/Form.ts +42 -44
- package/lib/composables/Modal.ts +11 -19
- package/lib/composables/Snackbar.ts +18 -0
- package/lib/composables/Validation.ts +28 -0
- package/lib/mixins/Sheet.ts +5 -7
- package/lib/store/Sefirot.ts +8 -13
- package/lib/store/dialog/index.ts +20 -10
- package/lib/store/modal/index.ts +11 -18
- package/lib/store/snackbars/index.ts +3 -4
- package/lib/support/{Util.ts → Utils.ts} +0 -2
- package/lib/types/Utils.ts +0 -7
- package/lib/types/vue-shims.d.ts +7 -0
- package/lib/validation/rules/checked.ts +6 -10
- package/lib/validation/rules/fileExtension.ts +9 -9
- package/lib/validation/rules/hms.ts +9 -9
- package/lib/validation/rules/index.ts +10 -74
- package/lib/validation/rules/maxLength.ts +10 -9
- package/lib/validation/rules/minLength.ts +12 -0
- package/lib/validation/rules/required.ts +2 -10
- package/lib/validation/rules/requiredHms.ts +11 -0
- package/lib/validation/rules/requiredIf.ts +3 -11
- package/lib/validation/rules/requiredYmd.ts +11 -0
- package/lib/validation/rules/ymd.ts +11 -0
- package/lib/validation/validators/checked.ts +1 -1
- package/lib/validation/validators/fileExtension.ts +1 -1
- package/lib/validation/validators/hms.ts +5 -5
- package/lib/validation/validators/requiredHms.ts +17 -0
- package/lib/validation/validators/requiredYmd.ts +7 -0
- package/lib/validation/validators/ymd.ts +41 -0
- package/package.json +45 -50
- package/lib/components/SAction.vue +0 -37
- package/lib/components/SActionAvatar.vue +0 -25
- package/lib/components/SActionButton.vue +0 -40
- package/lib/components/SActionPill.vue +0 -35
- package/lib/components/SActionSwitch.vue +0 -37
- package/lib/components/SAlert.vue +0 -145
- package/lib/components/SButtonGroup.vue +0 -160
- package/lib/components/SCard.vue +0 -111
- package/lib/components/SCardFooter.vue +0 -74
- package/lib/components/SCardHeader.vue +0 -213
- package/lib/components/SGrid.vue +0 -237
- package/lib/components/SGridActionLink.vue +0 -53
- package/lib/components/SGridActionMulti.vue +0 -139
- package/lib/components/SGridActionSingle.vue +0 -64
- package/lib/components/SHeader.vue +0 -180
- package/lib/components/SInputCheckboxes.vue +0 -87
- package/lib/components/SInputDate.vue +0 -192
- package/lib/components/SInputDay.vue +0 -87
- package/lib/components/SInputMonth.vue +0 -86
- package/lib/components/SInputSelect.vue +0 -298
- package/lib/components/SInputSwitch.vue +0 -212
- package/lib/components/SInputSwitches.vue +0 -108
- package/lib/components/SInputTime.vue +0 -255
- package/lib/components/SInputYear.vue +0 -60
- package/lib/components/SMarkdown.vue +0 -56
- package/lib/components/SPlaceholderBlank.vue +0 -113
- package/lib/components/SPlaceholderImage.vue +0 -83
- package/lib/components/SPortalScreens.vue +0 -62
- package/lib/components/SProgressBar.vue +0 -89
- package/lib/components/SResponsive.vue +0 -46
- package/lib/components/SScreen.vue +0 -81
- package/lib/components/SSheetHeader.vue +0 -75
- package/lib/components/SSheetHeaderTitle.vue +0 -17
- package/lib/components/SStep.vue +0 -107
- package/lib/components/SSteps.vue +0 -75
- package/lib/components/STag.vue +0 -67
- package/lib/components/STooltip.vue +0 -134
- package/lib/components/SWindow.vue +0 -158
- package/lib/components/icons/SIconCopy.vue +0 -6
- package/lib/composables/Action.ts +0 -141
- package/lib/composables/Alert.ts +0 -50
- package/lib/composables/Card.ts +0 -46
- package/lib/composables/FormValidation.ts +0 -150
- package/lib/composables/Header.ts +0 -72
- package/lib/composables/InputDropdown.ts +0 -6
- package/lib/composables/Markdown.ts +0 -138
- package/lib/composables/Router.ts +0 -20
- package/lib/composables/Step.ts +0 -7
- package/lib/composables/Store.ts +0 -9
- package/lib/composables/Tag.ts +0 -32
- package/lib/composables/Tooltip.ts +0 -91
- package/lib/composables/Utils.ts +0 -115
- package/lib/composables/markdown/LinkPlugin.ts +0 -45
- package/lib/compositions/useForm.ts +0 -17
- package/lib/compositions/useResizeObserver.ts +0 -25
- package/lib/compositions/useTime.ts +0 -26
- package/lib/store/alert/index.ts +0 -32
- package/lib/store/screen/index.ts +0 -46
- package/lib/types/v-calendar.d.ts +0 -5
- package/lib/validation/Validation.ts +0 -151
- package/lib/validation/rules/day.ts +0 -11
- package/lib/validation/rules/email.ts +0 -11
- package/lib/validation/rules/every.ts +0 -38
- package/lib/validation/rules/include.ts +0 -11
- package/lib/validation/rules/includeSome.ts +0 -11
- package/lib/validation/rules/integer.ts +0 -11
- package/lib/validation/rules/maxValue.ts +0 -11
- package/lib/validation/rules/minValue.ts +0 -11
- package/lib/validation/rules/month.ts +0 -11
- package/lib/validation/rules/not.ts +0 -10
- package/lib/validation/rules/regex.ts +0 -11
- package/lib/validation/rules/requiredHMS.ts +0 -11
- package/lib/validation/rules/requiredMonthDate.ts +0 -11
- package/lib/validation/rules/requiredYearMonth.ts +0 -11
- package/lib/validation/rules/requiredYearMonthDate.ts +0 -11
- package/lib/validation/rules/rule.ts +0 -5
- package/lib/validation/rules/sameAs.ts +0 -11
- package/lib/validation/rules/url.ts +0 -11
- package/lib/validation/rules/validateIf.ts +0 -27
- package/lib/validation/rules/year.ts +0 -11
- package/lib/validation/rules/yearMonth.ts +0 -11
- package/lib/validation/rules/yearMonthDate.ts +0 -11
- package/lib/validation/validators/day.ts +0 -29
- package/lib/validation/validators/email.ts +0 -5
- package/lib/validation/validators/include.ts +0 -5
- package/lib/validation/validators/includeSome.ts +0 -5
- package/lib/validation/validators/index.ts +0 -51
- package/lib/validation/validators/integer.ts +0 -6
- package/lib/validation/validators/maxLength.ts +0 -3
- package/lib/validation/validators/maxValue.ts +0 -3
- package/lib/validation/validators/minValue.ts +0 -3
- package/lib/validation/validators/month.ts +0 -3
- package/lib/validation/validators/monthDate.ts +0 -20
- package/lib/validation/validators/regex.ts +0 -3
- package/lib/validation/validators/required.ts +0 -27
- package/lib/validation/validators/requiredHMS.ts +0 -17
- package/lib/validation/validators/requiredMonthDate.ts +0 -8
- package/lib/validation/validators/requiredYearMonth.ts +0 -8
- package/lib/validation/validators/requiredYearMonthDate.ts +0 -9
- package/lib/validation/validators/sameAs.ts +0 -5
- package/lib/validation/validators/url.ts +0 -5
- package/lib/validation/validators/year.ts +0 -3
- package/lib/validation/validators/yearMonth.ts +0 -20
- package/lib/validation/validators/yearMonthDate.ts +0 -21
|
@@ -1,99 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<div
|
|
4
|
-
<
|
|
5
|
-
<div
|
|
6
|
-
v-show="show"
|
|
7
|
-
class="SModal-content"
|
|
8
|
-
:style="contentStyles"
|
|
9
|
-
@click="closeIfClosable"
|
|
10
|
-
>
|
|
11
|
-
<component
|
|
12
|
-
:is="resolvedComponent"
|
|
13
|
-
:if="resolvedComponent"
|
|
14
|
-
v-bind="data"
|
|
15
|
-
@close="close"
|
|
16
|
-
/>
|
|
17
|
-
</div>
|
|
18
|
-
</transition>
|
|
2
|
+
<div v-show="show" class="SModal" ref="el">
|
|
3
|
+
<div class="content">
|
|
4
|
+
<component :is="component" v-bind="data ?? {}" @close="close" />
|
|
19
5
|
</div>
|
|
20
|
-
</
|
|
6
|
+
</div>
|
|
21
7
|
</template>
|
|
22
8
|
|
|
23
|
-
<script lang="ts">
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
|
24
11
|
import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock'
|
|
25
|
-
import { defineComponent, ref, computed, onMounted, onUnmounted } from '@vue/composition-api'
|
|
26
|
-
import { SyntheticMouseEvent } from '../types/Utils'
|
|
27
12
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
width: { type: String, default: 'auto' },
|
|
35
|
-
closable: { type: Boolean, default: true }
|
|
36
|
-
},
|
|
13
|
+
const props = defineProps<{
|
|
14
|
+
id?: number
|
|
15
|
+
component: any
|
|
16
|
+
data?: Record<string, any>
|
|
17
|
+
show: boolean
|
|
18
|
+
}>()
|
|
37
19
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
20
|
+
const emit = defineEmits<{
|
|
21
|
+
(e: 'close', id?: number): void
|
|
22
|
+
}>()
|
|
41
23
|
|
|
42
|
-
|
|
43
|
-
? props.component().then((module: any) => { resolvedComponent.value = module.default })
|
|
44
|
-
: (resolvedComponent.value = props.component)
|
|
24
|
+
const el = ref<any>(null)
|
|
45
25
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}))
|
|
26
|
+
onMounted(lock)
|
|
27
|
+
onBeforeUnmount(release)
|
|
49
28
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
function close() {
|
|
54
|
-
emit('close', props.uid)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function closeIfClosable(e: SyntheticMouseEvent): void {
|
|
58
|
-
if (props.closable) {
|
|
59
|
-
if (!isDescendant(e.target)) {
|
|
60
|
-
close()
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function isDescendant(el: Element): boolean {
|
|
66
|
-
if (el.classList && el.classList.contains('SModal-content')) {
|
|
67
|
-
return false
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const parent = document.getElementsByClassName('SModal-content')[0]
|
|
71
|
-
|
|
72
|
-
return parent && parent.contains(el)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function lock(): void {
|
|
76
|
-
disableBodyScroll(el.value!, { reserveScrollBarGap: true })
|
|
77
|
-
}
|
|
29
|
+
function close() {
|
|
30
|
+
emit('close', props.id)
|
|
31
|
+
}
|
|
78
32
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
33
|
+
function lock() {
|
|
34
|
+
disableBodyScroll(el.value!, { reserveScrollBarGap: true })
|
|
35
|
+
}
|
|
82
36
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
resolvedComponent,
|
|
87
|
-
close,
|
|
88
|
-
closeIfClosable
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
})
|
|
37
|
+
function release() {
|
|
38
|
+
enableBodyScroll(el.value!)
|
|
39
|
+
}
|
|
92
40
|
</script>
|
|
93
41
|
|
|
94
|
-
<style lang="postcss"
|
|
95
|
-
@import "@/assets/styles/variables";
|
|
96
|
-
|
|
42
|
+
<style scoped lang="postcss">
|
|
97
43
|
.SModal {
|
|
98
44
|
position: absolute;
|
|
99
45
|
top: 0;
|
|
@@ -101,40 +47,35 @@ export default defineComponent({
|
|
|
101
47
|
bottom: 0;
|
|
102
48
|
left: 0;
|
|
103
49
|
height: 100vh;
|
|
104
|
-
padding: 32px 16px 96px;
|
|
105
50
|
overflow: hidden;
|
|
106
51
|
overflow-y: auto;
|
|
107
|
-
|
|
108
|
-
@media (min-width: 768px) {
|
|
109
|
-
padding: 48px 24px 96px;
|
|
110
|
-
}
|
|
111
52
|
}
|
|
112
53
|
|
|
113
|
-
.SModal.fade-enter-active .
|
|
114
|
-
.SModal.fade-leave-active .
|
|
115
|
-
.
|
|
116
|
-
.
|
|
54
|
+
.SModal.fade-enter-active .content,
|
|
55
|
+
.SModal.fade-leave-active .content,
|
|
56
|
+
.content.fade-enter-active,
|
|
57
|
+
.content.fade-leave-active {
|
|
117
58
|
transition: opacity .25s, transform .25s;
|
|
118
59
|
}
|
|
119
60
|
|
|
120
|
-
.SModal.fade-enter-active .
|
|
121
|
-
.
|
|
61
|
+
.SModal.fade-enter-active .content,
|
|
62
|
+
.content.fade-enter-active {
|
|
122
63
|
transition-delay: .15s;
|
|
123
64
|
}
|
|
124
65
|
|
|
125
|
-
.SModal.fade-enter .
|
|
126
|
-
.
|
|
66
|
+
.SModal.fade-enter-from .content,
|
|
67
|
+
.content.fade-enter-from {
|
|
127
68
|
opacity: 0;
|
|
128
69
|
transform: translateY(8px);
|
|
129
70
|
}
|
|
130
71
|
|
|
131
|
-
.SModal.fade-leave-to .
|
|
132
|
-
.
|
|
72
|
+
.SModal.fade-leave-to .content,
|
|
73
|
+
.content.fade-leave-to {
|
|
133
74
|
opacity: 0;
|
|
134
75
|
transform: translateY(-8px);
|
|
135
76
|
}
|
|
136
77
|
|
|
137
|
-
.
|
|
78
|
+
.content {
|
|
138
79
|
margin: 0 auto;
|
|
139
80
|
transition: opacity .25s, transform .25s;
|
|
140
81
|
}
|
|
@@ -1,74 +1,57 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<transition name="fade">
|
|
3
3
|
<div v-if="isActive" class="SPortalModals">
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
15
|
</div>
|
|
16
16
|
</transition>
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
|
-
<script lang="ts">
|
|
20
|
-
import {
|
|
21
|
-
import { useRoute } from '
|
|
22
|
-
import { useStore } from '
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { ref, computed, watch } from 'vue'
|
|
21
|
+
import { useRoute } from 'vue-router'
|
|
22
|
+
import { useStore } from 'vuex'
|
|
23
23
|
import SModal from './SModal.vue'
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
SModal
|
|
28
|
-
},
|
|
25
|
+
const route = useRoute()
|
|
26
|
+
const store = useStore()
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const store = useStore()
|
|
28
|
+
const items = computed(() => store.state.modal.items)
|
|
29
|
+
const hasItem = computed(() => items.value.length > 0)
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
const hasItem = computed(() => items.value.length > 0)
|
|
31
|
+
const isActive = ref(false)
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
let timer: any
|
|
38
34
|
|
|
39
|
-
|
|
35
|
+
watch(hasItem, (value) => {
|
|
36
|
+
clearTimeout(timer)
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
? (isActive.value = true)
|
|
46
|
-
: (timer = setTimeout(() => { isActive.value = false }, 250))
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
watch(route, closeAll)
|
|
38
|
+
value
|
|
39
|
+
? (isActive.value = true)
|
|
40
|
+
: (timer = setTimeout(() => { isActive.value = false }, 250))
|
|
41
|
+
})
|
|
50
42
|
|
|
51
|
-
|
|
52
|
-
store.dispatch('modal/close', uid)
|
|
53
|
-
}
|
|
43
|
+
watch(route, closeAll)
|
|
54
44
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
function close(id?: number) {
|
|
46
|
+
store.dispatch('modal/close', id)
|
|
47
|
+
}
|
|
58
48
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
isActive,
|
|
63
|
-
close
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
})
|
|
49
|
+
function closeAll() {
|
|
50
|
+
store.dispatch('modal/closeAll')
|
|
51
|
+
}
|
|
67
52
|
</script>
|
|
68
53
|
|
|
69
|
-
<style lang="postcss"
|
|
70
|
-
@import "@/assets/styles/variables";
|
|
71
|
-
|
|
54
|
+
<style scoped lang="postcss">
|
|
72
55
|
.SPortalModals {
|
|
73
56
|
position: fixed;
|
|
74
57
|
top: 0;
|
|
@@ -84,8 +67,8 @@ export default defineComponent({
|
|
|
84
67
|
transition: opacity .25s;
|
|
85
68
|
}
|
|
86
69
|
|
|
87
|
-
.SPortalModals.fade-enter,
|
|
88
|
-
.SPortalModals.fade-leave-
|
|
70
|
+
.SPortalModals.fade-enter-from,
|
|
71
|
+
.SPortalModals.fade-leave-to {
|
|
89
72
|
opacity: 0;
|
|
90
73
|
}
|
|
91
74
|
</style>
|
|
@@ -14,33 +14,18 @@
|
|
|
14
14
|
</transition>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
|
-
<script lang="ts">
|
|
18
|
-
import {
|
|
19
|
-
import { useStore } from '
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { computed } from 'vue'
|
|
19
|
+
import { useStore } from 'vuex'
|
|
20
20
|
import SSnackbar from './SSnackbar.vue'
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
components: {
|
|
24
|
-
SSnackbar
|
|
25
|
-
},
|
|
22
|
+
const store = useStore()
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const items = computed(() => store.state.snackbars.items)
|
|
31
|
-
const hasItem = computed(() => items.value.length > 0)
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
items,
|
|
35
|
-
hasItem
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
})
|
|
24
|
+
const items = computed(() => store.state.snackbars.items)
|
|
25
|
+
const hasItem = computed(() => items.value.length > 0)
|
|
39
26
|
</script>
|
|
40
27
|
|
|
41
28
|
<style lang="postcss" scoped>
|
|
42
|
-
@import "@/assets/styles/variables";
|
|
43
|
-
|
|
44
29
|
.SPortalSnackbars {
|
|
45
30
|
position: fixed;
|
|
46
31
|
bottom: 0;
|
|
@@ -56,7 +41,7 @@ export default defineComponent({
|
|
|
56
41
|
}
|
|
57
42
|
}
|
|
58
43
|
|
|
59
|
-
.SPortalSnackbars.fade-enter {
|
|
44
|
+
.SPortalSnackbars.fade-enter-from {
|
|
60
45
|
opacity: 0;
|
|
61
46
|
transform: translateY(48px);
|
|
62
47
|
}
|
|
@@ -79,12 +64,12 @@ export default defineComponent({
|
|
|
79
64
|
position: absolute;
|
|
80
65
|
}
|
|
81
66
|
|
|
82
|
-
.item.fade-up-enter,
|
|
67
|
+
.item.fade-up-enter-from,
|
|
83
68
|
.item.fade-up-leave-to {
|
|
84
69
|
opacity: 0;
|
|
85
70
|
}
|
|
86
71
|
|
|
87
|
-
.item.fade-up-enter {
|
|
72
|
+
.item.fade-up-enter-from {
|
|
88
73
|
transform: translateY(48px);
|
|
89
74
|
}
|
|
90
75
|
</style>
|
|
@@ -1,47 +1,92 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
2
|
+
<div class="SSheet" :class="[size ?? 'medium']" @click="closeIfClosable">
|
|
3
|
+
<article class="box" @click.stop>
|
|
4
|
+
<div v-if="closable !== false" class="close">
|
|
5
|
+
<button class="close-button" @click="$emit('close')">
|
|
6
|
+
<SIconX class="close-icon" />
|
|
7
|
+
</button>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<slot :close="() => emit('close')" />
|
|
11
|
+
</article>
|
|
12
|
+
</div>
|
|
5
13
|
</template>
|
|
6
14
|
|
|
7
|
-
<script lang="ts">
|
|
8
|
-
import
|
|
9
|
-
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import SIconX from './icons/SIconX.vue'
|
|
17
|
+
|
|
18
|
+
const props = defineProps<{
|
|
19
|
+
size?: 'small' | 'medium' | 'large'
|
|
20
|
+
closable?: boolean
|
|
21
|
+
}>()
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
const emit = defineEmits<{
|
|
24
|
+
(e: 'close'): void
|
|
25
|
+
}>()
|
|
12
26
|
|
|
13
|
-
|
|
14
|
-
props
|
|
15
|
-
|
|
16
|
-
}
|
|
27
|
+
function closeIfClosable() {
|
|
28
|
+
if (props.closable !== false) {
|
|
29
|
+
emit('close')
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
17
33
|
|
|
18
|
-
|
|
19
|
-
|
|
34
|
+
<style scoped lang="postcss">
|
|
35
|
+
.SSheet {
|
|
36
|
+
padding: 16px 16px 96px;
|
|
37
|
+
min-height: 100vh;
|
|
20
38
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
39
|
+
@media (min-width: 512px) {
|
|
40
|
+
padding: 32px 24px 96px;
|
|
41
|
+
}
|
|
24
42
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
43
|
+
@media (min-width: 768px) {
|
|
44
|
+
padding: 48px 32px 128px;
|
|
28
45
|
}
|
|
29
|
-
}
|
|
30
|
-
</script>
|
|
46
|
+
}
|
|
31
47
|
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
.SSheet.small .box { max-width: 392px; }
|
|
49
|
+
.SSheet.medium .box { max-width: 512px; }
|
|
50
|
+
.SSheet.large .box { max-width: 768px; }
|
|
34
51
|
|
|
35
|
-
.
|
|
52
|
+
.box {
|
|
53
|
+
position: relative;
|
|
36
54
|
margin: 0 auto;
|
|
37
55
|
border: 1px solid var(--c-divider-light);
|
|
38
56
|
border-radius: 8px;
|
|
39
57
|
background-color: var(--c-bg);
|
|
40
58
|
box-shadow: var(--shadow-depth-3);
|
|
41
|
-
overflow: hidden;
|
|
42
59
|
}
|
|
43
60
|
|
|
44
|
-
.
|
|
45
|
-
|
|
46
|
-
|
|
61
|
+
.close {
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: 10px;
|
|
64
|
+
right: 4px;
|
|
65
|
+
z-index: 10;
|
|
66
|
+
|
|
67
|
+
@media (min-width: 512px) {
|
|
68
|
+
top: 14px;
|
|
69
|
+
right: 12px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.close-button {
|
|
74
|
+
display: flex;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
align-items: center;
|
|
77
|
+
width: 48px;
|
|
78
|
+
height: 48px;
|
|
79
|
+
color: var(--c-text-3);
|
|
80
|
+
transition: color .25s;
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
color: var(--c-text-1);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.close-icon {
|
|
88
|
+
width: 20px;
|
|
89
|
+
height: 20px;
|
|
90
|
+
fill: currentColor;
|
|
91
|
+
}
|
|
47
92
|
</style>
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
</footer>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
|
-
<style lang="postcss"
|
|
8
|
-
@import "@/assets/styles/variables";
|
|
9
|
-
|
|
7
|
+
<style scoped lang="postcss">
|
|
10
8
|
.SSheetFooter {
|
|
11
9
|
border-top: 1px solid var(--c-divider-light);
|
|
12
10
|
padding: 0 16px;
|
|
11
|
+
|
|
12
|
+
@media (min-width: 512px) {
|
|
13
|
+
padding: 0 24px;
|
|
14
|
+
}
|
|
13
15
|
}
|
|
14
16
|
</style>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="SSheetFooterAction">
|
|
3
3
|
<SButton
|
|
4
|
-
size="
|
|
5
|
-
:type="type"
|
|
6
|
-
:mode="mode"
|
|
4
|
+
size="small"
|
|
5
|
+
:type="type ?? 'primary'"
|
|
6
|
+
:mode="mode ?? 'neutral'"
|
|
7
7
|
:label="label"
|
|
8
8
|
block
|
|
9
9
|
@click="$emit('click')"
|
|
@@ -11,22 +11,17 @@
|
|
|
11
11
|
</div>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
|
-
<script lang="ts">
|
|
15
|
-
import { PropType, defineComponent } from '@nuxtjs/composition-api'
|
|
14
|
+
<script setup lang="ts">
|
|
16
15
|
import SButton from './SButton.vue'
|
|
17
16
|
|
|
18
17
|
type Type = 'primary' | 'secondary' | 'tertiary' | 'text' | 'mute'
|
|
19
18
|
type Mode = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
defineProps<{
|
|
21
|
+
type?: Type
|
|
22
|
+
mode?: Mode
|
|
23
|
+
label?: string
|
|
24
|
+
}>()
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
type: { type: String as PropType<Type>, default: 'primary' },
|
|
28
|
-
mode: { type: String as PropType<Mode>, default: 'neutral' },
|
|
29
|
-
label: { type: String, default: null }
|
|
30
|
-
}
|
|
31
|
-
})
|
|
26
|
+
defineEmits(['click'])
|
|
32
27
|
</script>
|
|
@@ -5,15 +5,13 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<style lang="postcss" scoped>
|
|
8
|
-
@import "@/assets/styles/variables";
|
|
9
|
-
|
|
10
8
|
.SSheetFooterActions {
|
|
11
9
|
display: flex;
|
|
12
10
|
justify-content: flex-end;
|
|
13
|
-
padding:
|
|
11
|
+
padding: 16px 0 15px;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
.SSheetFooterActions
|
|
14
|
+
.SSheetFooterActions :deep(.SSheetFooterAction + .SSheetFooterAction) {
|
|
17
15
|
padding-left: 8px;
|
|
18
16
|
}
|
|
19
17
|
</style>
|
|
@@ -5,38 +5,30 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<style lang="postcss" scoped>
|
|
8
|
-
@import "@/assets/styles/variables";
|
|
9
|
-
|
|
10
8
|
.SSheetMedium {
|
|
11
|
-
padding: 16px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.SSheetMedium >>> h1 {
|
|
15
|
-
line-height: 32px;
|
|
16
|
-
font-size: 20px;
|
|
17
|
-
font-weight: 500;
|
|
18
|
-
}
|
|
9
|
+
padding: 12px 16px 20px;
|
|
19
10
|
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
@media (min-width: 512px) {
|
|
12
|
+
padding: 16px 24px 26px;
|
|
13
|
+
}
|
|
22
14
|
}
|
|
23
15
|
|
|
24
|
-
.SSheetMedium
|
|
16
|
+
.SSheetMedium :deep(p) {
|
|
25
17
|
margin: 16px 0;
|
|
26
18
|
line-height: 24px;
|
|
27
19
|
font-size: 14px;
|
|
28
20
|
font-weight: 400;
|
|
29
21
|
}
|
|
30
22
|
|
|
31
|
-
.SSheetMedium
|
|
23
|
+
.SSheetMedium :deep(p:first-child) {
|
|
32
24
|
margin-top: 0;
|
|
33
25
|
}
|
|
34
26
|
|
|
35
|
-
.SSheetMedium
|
|
27
|
+
.SSheetMedium :deep(p:last-child) {
|
|
36
28
|
margin-bottom: 0;
|
|
37
29
|
}
|
|
38
30
|
|
|
39
|
-
.SSheetMedium
|
|
31
|
+
.SSheetMedium :deep(a) {
|
|
40
32
|
font-weight: 500;
|
|
41
33
|
color: var(--c-info);
|
|
42
34
|
transition: color .25s;
|
|
@@ -46,22 +38,22 @@
|
|
|
46
38
|
}
|
|
47
39
|
}
|
|
48
40
|
|
|
49
|
-
.SSheetMedium
|
|
41
|
+
.SSheetMedium :deep(ul) {
|
|
50
42
|
margin: 16px 0;
|
|
51
43
|
}
|
|
52
44
|
|
|
53
|
-
.SSheetMedium
|
|
45
|
+
.SSheetMedium :deep(ul:last-child) {
|
|
54
46
|
margin-bottom: 0;
|
|
55
47
|
}
|
|
56
48
|
|
|
57
|
-
.SSheetMedium
|
|
49
|
+
.SSheetMedium :deep(li) {
|
|
58
50
|
position: relative;
|
|
59
51
|
padding-left: 20px;
|
|
60
52
|
font-size: 14px;
|
|
61
53
|
font-weight: 400;
|
|
62
54
|
}
|
|
63
55
|
|
|
64
|
-
.SSheetMedium
|
|
56
|
+
.SSheetMedium :deep(li::before) {
|
|
65
57
|
position: absolute;
|
|
66
58
|
top: 9px;
|
|
67
59
|
left: 4px;
|
|
@@ -72,11 +64,11 @@
|
|
|
72
64
|
content: "";
|
|
73
65
|
}
|
|
74
66
|
|
|
75
|
-
.SSheetMedium
|
|
67
|
+
.SSheetMedium :deep(li + li) {
|
|
76
68
|
margin-top: 4px;
|
|
77
69
|
}
|
|
78
70
|
|
|
79
|
-
.SSheetMedium
|
|
71
|
+
.SSheetMedium :deep(li > ul) {
|
|
80
72
|
margin: 4px 0 0;
|
|
81
73
|
}
|
|
82
74
|
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header class="SSheetTitle">
|
|
3
|
+
<h1 class="title">
|
|
4
|
+
<slot />
|
|
5
|
+
</h1>
|
|
6
|
+
</header>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<style lang="postcss" scoped>
|
|
10
|
+
.title {
|
|
11
|
+
padding: 20px 48px 0 16px;
|
|
12
|
+
line-height: 28px;
|
|
13
|
+
font-size: 20px;
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
|
|
16
|
+
@media (min-width: 512px) {
|
|
17
|
+
padding: 24px 64px 0 24px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</style>
|