@globalbrain/sefirot 2.0.0-draft.8 → 2.0.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 +512 -267
- 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 +189 -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 +1 -1
- package/lib/components/SInputCheckboxes.vue +74 -0
- package/lib/components/SInputDate.vue +182 -0
- package/lib/components/SInputDropdown.vue +158 -157
- package/lib/components/SInputDropdownItem.vue +46 -48
- package/lib/components/{SInputDropdownItemUserTag.vue → SInputDropdownItemAvatar.vue} +43 -44
- package/lib/components/SInputDropdownItemText.vue +79 -16
- package/lib/components/SInputFile.vue +55 -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 +3 -3
- package/lib/components/SInputSwitch.vue +193 -0
- package/lib/components/SInputSwitches.vue +88 -0
- package/lib/components/SInputText.vue +206 -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 +25 -63
- package/lib/components/SMount.vue +19 -0
- package/lib/components/SSheet.vue +49 -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 +55 -45
- package/lib/components/{SPortalSnackbars.vue → SSnackbars.vue} +17 -20
- package/lib/components/SStep.vue +106 -0
- package/lib/components/SSteps.vue +59 -0
- package/lib/components/STable.vue +241 -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 +102 -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 +57 -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/SPortalModals.vue +0 -74
- package/lib/components/icons/.DS_Store +0 -0
- 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,89 +1,37 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<SInputBase
|
|
3
|
-
class="SInputYMD"
|
|
4
|
-
:class="[size, { disabled }]"
|
|
5
|
-
:label="label"
|
|
6
|
-
:note="note"
|
|
7
|
-
:help="help"
|
|
8
|
-
:error-message="errorMessage"
|
|
9
|
-
:validation="validation"
|
|
10
|
-
>
|
|
11
|
-
<div class="container">
|
|
12
|
-
<input
|
|
13
|
-
v-if="year"
|
|
14
|
-
class="input year"
|
|
15
|
-
type="number"
|
|
16
|
-
:value="modelValue?.year"
|
|
17
|
-
placeholder="YYYY"
|
|
18
|
-
:disabled="disabled"
|
|
19
|
-
@blur="updateYear"
|
|
20
|
-
>
|
|
21
|
-
<div
|
|
22
|
-
v-if="year && month"
|
|
23
|
-
class="separator"
|
|
24
|
-
/>
|
|
25
|
-
<input
|
|
26
|
-
v-if="month"
|
|
27
|
-
class="input month"
|
|
28
|
-
type="number"
|
|
29
|
-
:value="modelValue?.month"
|
|
30
|
-
placeholder="M"
|
|
31
|
-
:disabled="disabled"
|
|
32
|
-
@blur="updateMonth"
|
|
33
|
-
>
|
|
34
|
-
<div
|
|
35
|
-
v-if="month && date"
|
|
36
|
-
class="separator"
|
|
37
|
-
/>
|
|
38
|
-
<input
|
|
39
|
-
v-if="date"
|
|
40
|
-
class="input date"
|
|
41
|
-
type="number"
|
|
42
|
-
:value="modelValue?.date"
|
|
43
|
-
placeholder="D"
|
|
44
|
-
:disabled="disabled"
|
|
45
|
-
@blur="updateDate"
|
|
46
|
-
>
|
|
47
|
-
</div>
|
|
48
|
-
</SInputBase>
|
|
49
|
-
</template>
|
|
50
|
-
|
|
51
1
|
<script setup lang="ts">
|
|
52
|
-
import {
|
|
2
|
+
import { ref } from 'vue'
|
|
53
3
|
import { Validatable } from '../composables/Validation'
|
|
54
4
|
import SInputBase from './SInputBase.vue'
|
|
55
5
|
|
|
56
|
-
type Size = 'mini' | 'small' | 'medium'
|
|
6
|
+
export type Size = 'mini' | 'small' | 'medium'
|
|
57
7
|
|
|
58
|
-
interface Value {
|
|
59
|
-
year
|
|
60
|
-
month
|
|
61
|
-
date
|
|
8
|
+
export interface Value {
|
|
9
|
+
year: number | null
|
|
10
|
+
month: number | null
|
|
11
|
+
date: number | null
|
|
62
12
|
}
|
|
63
13
|
|
|
64
|
-
type ValueType = 'year' | 'month' | 'date'
|
|
14
|
+
export type ValueType = 'year' | 'month' | 'date'
|
|
65
15
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
size?: Size
|
|
18
|
+
label?: string
|
|
19
|
+
note?: string
|
|
20
|
+
help?: string
|
|
21
|
+
noYear?: boolean
|
|
22
|
+
noMonth?: boolean
|
|
23
|
+
noDate?: boolean
|
|
24
|
+
disabled?: boolean
|
|
25
|
+
hideError?: boolean
|
|
26
|
+
modelValue: Value
|
|
27
|
+
validation?: Validatable
|
|
28
|
+
}>()
|
|
29
|
+
|
|
30
|
+
const emit = defineEmits<{
|
|
31
|
+
(e: 'update:modelValue', value: Value): void
|
|
32
|
+
}>()
|
|
71
33
|
|
|
72
|
-
const
|
|
73
|
-
size: { type: String as PropType<Size>, default: 'small' },
|
|
74
|
-
label: { type: String, default: null },
|
|
75
|
-
note: { type: String, default: null },
|
|
76
|
-
help: { type: String, default: null },
|
|
77
|
-
year: { type: Boolean, default: true },
|
|
78
|
-
month: { type: Boolean, default: true },
|
|
79
|
-
date: { type: Boolean, default: true },
|
|
80
|
-
disabled: { type: Boolean, default: false },
|
|
81
|
-
errorMessage: { type: Boolean, default: true },
|
|
82
|
-
modelValue: { type: Object as PropType<Value>, default: null },
|
|
83
|
-
validation: { type: Object as PropType<Validatable>, default: null }
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
const emit = defineEmits(['update:modelValue'])
|
|
34
|
+
const isFocused = ref(false)
|
|
87
35
|
|
|
88
36
|
const touched = {
|
|
89
37
|
year: false,
|
|
@@ -91,40 +39,35 @@ const touched = {
|
|
|
91
39
|
date: false
|
|
92
40
|
}
|
|
93
41
|
|
|
94
|
-
function
|
|
95
|
-
|
|
96
|
-
update('year', value === 0 ? undefined : value)
|
|
42
|
+
function onFocus() {
|
|
43
|
+
isFocused.value = true
|
|
97
44
|
}
|
|
98
45
|
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
update('month', value === 0 ? undefined : value)
|
|
46
|
+
function blur() {
|
|
47
|
+
isFocused.value = false
|
|
102
48
|
}
|
|
103
49
|
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
update('date', value === 0 ? undefined : value)
|
|
50
|
+
function updateYear(e: FocusEvent) {
|
|
51
|
+
update('year', Number((e.target as HTMLInputElement).value))
|
|
107
52
|
}
|
|
108
53
|
|
|
109
|
-
function
|
|
110
|
-
|
|
54
|
+
function updateMonth(e: FocusEvent) {
|
|
55
|
+
update('month', Number((e.target as HTMLInputElement).value))
|
|
56
|
+
}
|
|
111
57
|
|
|
112
|
-
|
|
58
|
+
function updateDate(e: FocusEvent) {
|
|
59
|
+
update('date', Number((e.target as HTMLInputElement).value))
|
|
60
|
+
}
|
|
113
61
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
62
|
+
function update(type: ValueType, value: number) {
|
|
63
|
+
emit('update:modelValue', {
|
|
64
|
+
...props.modelValue,
|
|
65
|
+
[type]: value === 0 ? null : value
|
|
66
|
+
})
|
|
117
67
|
|
|
118
68
|
emitTouch(type)
|
|
119
|
-
}
|
|
120
69
|
|
|
121
|
-
|
|
122
|
-
if (value === undefined) {
|
|
123
|
-
delete data[type]
|
|
124
|
-
return
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
data[type] = value
|
|
70
|
+
blur()
|
|
128
71
|
}
|
|
129
72
|
|
|
130
73
|
function emitTouch(type: ValueType): void {
|
|
@@ -143,7 +86,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
143
86
|
const requiredTouched = [] as boolean[]
|
|
144
87
|
|
|
145
88
|
for (const key in touched) {
|
|
146
|
-
if ((props as any)[key]) {
|
|
89
|
+
if (!(props as any)[`no${key.charAt(0).toUpperCase() + key.slice(1)}`]) {
|
|
147
90
|
requiredTouched.push((touched as any)[key])
|
|
148
91
|
}
|
|
149
92
|
}
|
|
@@ -152,6 +95,59 @@ function createRequiredTouched(): boolean[] {
|
|
|
152
95
|
}
|
|
153
96
|
</script>
|
|
154
97
|
|
|
98
|
+
<template>
|
|
99
|
+
<SInputBase
|
|
100
|
+
class="SInputYMD"
|
|
101
|
+
:class="[size, { disabled }]"
|
|
102
|
+
:label="label"
|
|
103
|
+
:note="note"
|
|
104
|
+
:help="help"
|
|
105
|
+
:hide-error="hideError"
|
|
106
|
+
:validation="validation"
|
|
107
|
+
>
|
|
108
|
+
<div class="container" :class="{ focus: isFocused }">
|
|
109
|
+
<input
|
|
110
|
+
v-if="!noYear"
|
|
111
|
+
class="input year"
|
|
112
|
+
type="number"
|
|
113
|
+
:value="modelValue.year"
|
|
114
|
+
placeholder="YYYY"
|
|
115
|
+
:disabled="disabled"
|
|
116
|
+
@focus="onFocus"
|
|
117
|
+
@blur="updateYear"
|
|
118
|
+
>
|
|
119
|
+
<div
|
|
120
|
+
v-if="!noYear && !noMonth"
|
|
121
|
+
class="separator"
|
|
122
|
+
/>
|
|
123
|
+
<input
|
|
124
|
+
v-if="!noMonth"
|
|
125
|
+
class="input month"
|
|
126
|
+
type="number"
|
|
127
|
+
:value="modelValue.month"
|
|
128
|
+
placeholder="M"
|
|
129
|
+
:disabled="disabled"
|
|
130
|
+
@focus="onFocus"
|
|
131
|
+
@blur="updateMonth"
|
|
132
|
+
>
|
|
133
|
+
<div
|
|
134
|
+
v-if="!noMonth && !noDate"
|
|
135
|
+
class="separator"
|
|
136
|
+
/>
|
|
137
|
+
<input
|
|
138
|
+
v-if="!noDate"
|
|
139
|
+
class="input date"
|
|
140
|
+
type="number"
|
|
141
|
+
:value="modelValue.date"
|
|
142
|
+
placeholder="D"
|
|
143
|
+
:disabled="disabled"
|
|
144
|
+
@focus="onFocus"
|
|
145
|
+
@blur="updateDate"
|
|
146
|
+
>
|
|
147
|
+
</div>
|
|
148
|
+
</SInputBase>
|
|
149
|
+
</template>
|
|
150
|
+
|
|
155
151
|
<style lang="postcss" scoped>
|
|
156
152
|
.SInputYMD.mini {
|
|
157
153
|
.container {
|
|
@@ -177,7 +173,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
177
173
|
|
|
178
174
|
.SInputYMD.small {
|
|
179
175
|
.container {
|
|
180
|
-
padding: 0
|
|
176
|
+
padding: 0 6px;
|
|
181
177
|
}
|
|
182
178
|
|
|
183
179
|
.input {
|
|
@@ -187,7 +183,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
187
183
|
}
|
|
188
184
|
|
|
189
185
|
.input.year { width: 56px; }
|
|
190
|
-
.input.month { width:
|
|
186
|
+
.input.month { width: 32px; }
|
|
191
187
|
.input.date { width: 40px; }
|
|
192
188
|
|
|
193
189
|
.separator {
|
|
@@ -219,25 +215,6 @@ function createRequiredTouched(): boolean[] {
|
|
|
219
215
|
}
|
|
220
216
|
}
|
|
221
217
|
|
|
222
|
-
.SInputYMD.outlined {
|
|
223
|
-
.container {
|
|
224
|
-
border: 1px solid var(--input-outlined-border);
|
|
225
|
-
border-radius: 4px;
|
|
226
|
-
transition: border-color .25s;
|
|
227
|
-
|
|
228
|
-
&:hover {
|
|
229
|
-
border-color: var(--input-focus-border);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.SInputYMD.outlined.disabled {
|
|
235
|
-
.container {
|
|
236
|
-
border-color: var(--input-outlined-border);
|
|
237
|
-
background-color: var(--input-outlined-bg-disabled);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
218
|
.SInputYMD.disabled {
|
|
242
219
|
.container,
|
|
243
220
|
.input {
|
|
@@ -257,17 +234,37 @@ function createRequiredTouched(): boolean[] {
|
|
|
257
234
|
|
|
258
235
|
.container {
|
|
259
236
|
display: inline-flex;
|
|
260
|
-
border: 1px solid var(--
|
|
261
|
-
border-radius:
|
|
262
|
-
|
|
237
|
+
border: 1px solid var(--c-divider);
|
|
238
|
+
border-radius: 6px;
|
|
239
|
+
background-color: var(--c-bg);
|
|
240
|
+
transition: border-color 0.25s;
|
|
263
241
|
|
|
264
242
|
&:hover {
|
|
265
|
-
border-color: var(--
|
|
243
|
+
border-color: var(--c-black);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
&.focus,
|
|
247
|
+
&:hover.focus {
|
|
248
|
+
border-color: var(--c-info);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.dark &:hover {
|
|
252
|
+
border-color: var(--c-gray);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.dark &.focus,
|
|
256
|
+
.dark &:hover.focus {
|
|
257
|
+
border-color: var(--c-info);
|
|
266
258
|
}
|
|
267
259
|
}
|
|
268
260
|
|
|
269
261
|
.input {
|
|
270
262
|
background-color: transparent;
|
|
263
|
+
|
|
264
|
+
&::placeholder {
|
|
265
|
+
font-weight: 500;
|
|
266
|
+
color: var(--c-text-3);
|
|
267
|
+
}
|
|
271
268
|
}
|
|
272
269
|
|
|
273
270
|
.separator::before {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, computed, watch, nextTick } from 'vue'
|
|
3
|
+
import { LinkCallback, LinkSubscriberPayload, useMarkdown, useLink } from '../composables/Markdown'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
tag?: string
|
|
7
|
+
content: string
|
|
8
|
+
callbacks?: LinkCallback[]
|
|
9
|
+
inline?: boolean
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const emit = defineEmits<{
|
|
13
|
+
(e: 'clicked', payload: LinkSubscriberPayload): void
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
const container = ref<Element | null>(null)
|
|
17
|
+
|
|
18
|
+
const { addListeners, subscribe } = useLink({
|
|
19
|
+
container,
|
|
20
|
+
callbacks: props.callbacks
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const markdown = useMarkdown()
|
|
24
|
+
const rendered = computed(() => markdown(props.content, props.inline ?? false))
|
|
25
|
+
|
|
26
|
+
watch(
|
|
27
|
+
rendered,
|
|
28
|
+
() => nextTick(() => addListeners()),
|
|
29
|
+
{ immediate: true }
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
subscribe((payload) => emit('clicked', payload))
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<component
|
|
37
|
+
v-if="$slots.default"
|
|
38
|
+
:is="tag ?? 'div'"
|
|
39
|
+
class="SMarkdown-container"
|
|
40
|
+
ref="container"
|
|
41
|
+
>
|
|
42
|
+
<slot v-bind="{ rendered }" />
|
|
43
|
+
</component>
|
|
44
|
+
|
|
45
|
+
<component
|
|
46
|
+
v-else
|
|
47
|
+
:is="tag ?? 'div'"
|
|
48
|
+
class="SMarkdown-container"
|
|
49
|
+
ref="container"
|
|
50
|
+
v-html="rendered"
|
|
51
|
+
/>
|
|
52
|
+
</template>
|
|
@@ -1,82 +1,44 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-show="show" class="SModal" ref="el">
|
|
3
|
-
<div class="content">
|
|
4
|
-
<component :is="component" v-bind="data ?? {}" @close="close" />
|
|
5
|
-
</div>
|
|
6
|
-
</div>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
1
|
<script setup lang="ts">
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const props = defineProps<{
|
|
14
|
-
id?: number
|
|
15
|
-
component: any
|
|
16
|
-
data?: Record<string, any>
|
|
17
|
-
show: boolean
|
|
18
|
-
}>()
|
|
19
|
-
|
|
20
|
-
const emit = defineEmits<{
|
|
21
|
-
(e: 'close', id?: number): void
|
|
22
|
-
}>()
|
|
23
|
-
|
|
24
|
-
const el = ref<any>(null)
|
|
25
|
-
|
|
26
|
-
onMounted(lock)
|
|
27
|
-
onBeforeUnmount(release)
|
|
28
|
-
|
|
29
|
-
function close() {
|
|
30
|
-
emit('close', props.id)
|
|
2
|
+
export interface Props {
|
|
3
|
+
open: boolean
|
|
4
|
+
closable?: boolean
|
|
31
5
|
}
|
|
32
6
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
7
|
+
withDefaults(defineProps<Props>(), {
|
|
8
|
+
closable: true
|
|
9
|
+
})
|
|
36
10
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
11
|
+
defineEmits<{
|
|
12
|
+
(e: 'close'): void
|
|
13
|
+
}>()
|
|
40
14
|
</script>
|
|
41
15
|
|
|
16
|
+
<template>
|
|
17
|
+
<Teleport to="#sefirot-modals">
|
|
18
|
+
<transition name="fade">
|
|
19
|
+
<div v-if="open" class="SModal" @click="closable && $emit('close')">
|
|
20
|
+
<slot />
|
|
21
|
+
</div>
|
|
22
|
+
</transition>
|
|
23
|
+
</Teleport>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
42
26
|
<style scoped lang="postcss">
|
|
43
27
|
.SModal {
|
|
44
|
-
position:
|
|
28
|
+
position: fixed;
|
|
45
29
|
top: 0;
|
|
46
30
|
right: 0;
|
|
47
31
|
bottom: 0;
|
|
48
32
|
left: 0;
|
|
49
|
-
|
|
33
|
+
z-index: var(--z-index-backdrop);
|
|
34
|
+
background-color: rgba(0, 0, 0, .8);
|
|
35
|
+
transition: opacity 0.25s;
|
|
50
36
|
overflow: hidden;
|
|
51
37
|
overflow-y: auto;
|
|
52
38
|
}
|
|
53
39
|
|
|
54
|
-
.SModal.fade-enter-
|
|
55
|
-
.SModal.fade-leave-
|
|
56
|
-
.content.fade-enter-active,
|
|
57
|
-
.content.fade-leave-active {
|
|
58
|
-
transition: opacity .25s, transform .25s;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.SModal.fade-enter-active .content,
|
|
62
|
-
.content.fade-enter-active {
|
|
63
|
-
transition-delay: .15s;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.SModal.fade-enter-from .content,
|
|
67
|
-
.content.fade-enter-from {
|
|
68
|
-
opacity: 0;
|
|
69
|
-
transform: translateY(8px);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.SModal.fade-leave-to .content,
|
|
73
|
-
.content.fade-leave-to {
|
|
40
|
+
.SModal.fade-enter-from,
|
|
41
|
+
.SModal.fade-leave-to {
|
|
74
42
|
opacity: 0;
|
|
75
|
-
transform: translateY(-8px);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.content {
|
|
79
|
-
margin: 0 auto;
|
|
80
|
-
transition: opacity .25s, transform .25s;
|
|
81
43
|
}
|
|
82
44
|
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, onMounted } from 'vue'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
tag?: string
|
|
6
|
+
}>()
|
|
7
|
+
|
|
8
|
+
const mount = ref(true)
|
|
9
|
+
|
|
10
|
+
onMounted(() => {
|
|
11
|
+
setTimeout(() => { mount.value = false }, 100)
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<component :is="tag ?? 'div'" class="SMount mount-active" :class="{ mount }">
|
|
17
|
+
<slot />
|
|
18
|
+
</component>
|
|
19
|
+
</template>
|
|
@@ -1,92 +1,86 @@
|
|
|
1
|
-
<template>
|
|
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>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
1
|
<script setup lang="ts">
|
|
16
|
-
import SIconX from '
|
|
2
|
+
import SIconX from 'sefirot/components/icons/SIconX.vue'
|
|
17
3
|
|
|
18
|
-
|
|
4
|
+
export interface Props {
|
|
19
5
|
size?: 'small' | 'medium' | 'large'
|
|
20
6
|
closable?: boolean
|
|
21
|
-
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
withDefaults(defineProps<Props>(), {
|
|
10
|
+
size: 'medium',
|
|
11
|
+
closable: true
|
|
12
|
+
})
|
|
22
13
|
|
|
23
|
-
|
|
14
|
+
defineEmits<{
|
|
24
15
|
(e: 'close'): void
|
|
25
16
|
}>()
|
|
26
|
-
|
|
27
|
-
function closeIfClosable() {
|
|
28
|
-
if (props.closable !== false) {
|
|
29
|
-
emit('close')
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
17
|
</script>
|
|
33
18
|
|
|
19
|
+
<template>
|
|
20
|
+
<FMount class="SSheet" :class="[size]" @click.stop>
|
|
21
|
+
<button v-if="closable ?? true" class="close" @click="$emit('close')">
|
|
22
|
+
<SIconX class="icon" />
|
|
23
|
+
</button>
|
|
24
|
+
|
|
25
|
+
<slot />
|
|
26
|
+
</FMount>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
34
29
|
<style scoped lang="postcss">
|
|
35
30
|
.SSheet {
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
position: relative;
|
|
32
|
+
border: 1px solid var(--c-divider-light);
|
|
33
|
+
border-radius: 16px;
|
|
34
|
+
background-color: var(--c-bg);
|
|
35
|
+
transition: opacity 0.25s, transform 0.25s;
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
.dark & {
|
|
38
|
+
background-color: var(--c-bg-mute);
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
.SModal & {
|
|
42
|
+
margin: 96px auto;
|
|
43
|
+
box-shadow: var(--shadow-depth-5);
|
|
44
|
+
|
|
45
|
+
.dark & {
|
|
46
|
+
background-color: var(--c-bg-soft);
|
|
47
|
+
}
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
|
|
48
|
-
.SSheet.small
|
|
49
|
-
.SSheet.medium
|
|
50
|
-
.SSheet.large
|
|
51
|
+
.SSheet.small { max-width: 512px; }
|
|
52
|
+
.SSheet.medium { max-width: 768px; }
|
|
53
|
+
.SSheet.large { max-width: 1024px; }
|
|
51
54
|
|
|
52
|
-
.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
border: 1px solid var(--c-divider-light);
|
|
56
|
-
border-radius: 8px;
|
|
57
|
-
background-color: var(--c-bg);
|
|
58
|
-
box-shadow: var(--shadow-depth-3);
|
|
55
|
+
.SSheet.mount {
|
|
56
|
+
opacity: 0;
|
|
57
|
+
transform: translateY(8px);
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
.close {
|
|
62
61
|
position: absolute;
|
|
63
|
-
top:
|
|
62
|
+
top: 4px;
|
|
64
63
|
right: 4px;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
@media (min-width: 512px) {
|
|
68
|
-
top: 14px;
|
|
69
|
-
right: 12px;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.close-button {
|
|
74
|
-
display: flex;
|
|
64
|
+
display: none;
|
|
75
65
|
justify-content: center;
|
|
76
66
|
align-items: center;
|
|
77
67
|
width: 48px;
|
|
78
68
|
height: 48px;
|
|
79
69
|
color: var(--c-text-3);
|
|
80
|
-
transition: color .25s;
|
|
70
|
+
transition: color 0.25s;
|
|
81
71
|
|
|
82
72
|
&:hover {
|
|
83
73
|
color: var(--c-text-1);
|
|
84
74
|
}
|
|
75
|
+
|
|
76
|
+
.SModal & {
|
|
77
|
+
display: flex;
|
|
78
|
+
}
|
|
85
79
|
}
|
|
86
80
|
|
|
87
|
-
.
|
|
88
|
-
width:
|
|
89
|
-
height:
|
|
81
|
+
.icon {
|
|
82
|
+
width: 24px;
|
|
83
|
+
height: 24px;
|
|
90
84
|
fill: currentColor;
|
|
91
85
|
}
|
|
92
86
|
</style>
|