@globalbrain/sefirot 3.14.0 → 3.16.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/lib/components/SButton.vue +41 -28
- package/lib/components/SCard.vue +2 -2
- package/lib/components/SCardBlock.vue +32 -6
- package/lib/components/SControl.vue +50 -0
- package/lib/components/SControlButton.vue +45 -0
- package/lib/components/SControlCenter.vue +24 -0
- package/lib/components/SControlInputSearch.vue +68 -0
- package/lib/components/SControlLeft.vue +24 -0
- package/lib/components/SControlPagination.vue +26 -0
- package/lib/components/SControlRight.vue +24 -0
- package/lib/components/SControlText.vue +12 -0
- package/lib/components/SInputBase.vue +1 -1
- package/lib/components/SInputCheckbox.vue +1 -1
- package/lib/components/SInputCheckboxes.vue +1 -1
- package/lib/components/SInputDate.vue +1 -1
- package/lib/components/SInputDropdown.vue +1 -1
- package/lib/components/SInputFile.vue +1 -1
- package/lib/components/SInputHMS.vue +1 -1
- package/lib/components/SInputImage.vue +1 -1
- package/lib/components/SInputNumber.vue +1 -1
- package/lib/components/SInputRadio.vue +1 -1
- package/lib/components/SInputRadios.vue +1 -1
- package/lib/components/SInputSegments.vue +1 -1
- package/lib/components/SInputSelect.vue +1 -1
- package/lib/components/SInputSwitch.vue +1 -1
- package/lib/components/SInputSwitches.vue +1 -1
- package/lib/components/SInputText.vue +10 -8
- package/lib/components/SInputTextarea.vue +1 -1
- package/lib/components/SInputYMD.vue +1 -1
- package/lib/components/SPagination.vue +132 -0
- package/lib/components/STable.vue +6 -2
- package/lib/components/STableColumn.vue +1 -1
- package/lib/components/SW.vue +1 -1
- package/lib/composables/Card.ts +16 -4
- package/lib/composables/Control.ts +43 -0
- package/lib/composables/D.ts +21 -0
- package/lib/composables/Data.ts +4 -0
- package/lib/composables/Form.ts +4 -0
- package/lib/composables/Table.ts +11 -9
- package/lib/composables/V.ts +73 -0
- package/lib/composables/Validation.ts +4 -0
- package/lib/mixins/Control.ts +30 -0
- package/lib/styles/utilities.css +113 -3
- package/package.json +1 -1
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { type IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
3
|
import { type DefineComponent, computed, ref } from 'vue'
|
|
4
|
-
import { type Validatable } from '../composables/
|
|
4
|
+
import { type Validatable } from '../composables/V'
|
|
5
5
|
import { isString } from '../support/Utils'
|
|
6
6
|
import SIcon from './SIcon.vue'
|
|
7
7
|
import SInputBase from './SInputBase.vue'
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
export type Align = 'left' | 'center' | 'right'
|
|
11
|
-
export type CheckColor = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
12
|
-
export type TextColor = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
|
|
13
|
-
|
|
14
|
-
const props = defineProps<{
|
|
9
|
+
export interface Props {
|
|
15
10
|
size?: Size
|
|
16
11
|
name?: string
|
|
17
12
|
label?: string
|
|
@@ -32,7 +27,14 @@ const props = defineProps<{
|
|
|
32
27
|
displayValue?: string | null
|
|
33
28
|
hideError?: boolean
|
|
34
29
|
validation?: Validatable
|
|
35
|
-
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type Size = 'mini' | 'small' | 'medium'
|
|
33
|
+
export type Align = 'left' | 'center' | 'right'
|
|
34
|
+
export type CheckColor = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
35
|
+
export type TextColor = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
|
|
36
|
+
|
|
37
|
+
const props = defineProps<Props>()
|
|
36
38
|
|
|
37
39
|
const emit = defineEmits<{
|
|
38
40
|
(e: 'update:model-value', value: string | null): void
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { type IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
3
|
import { computed } from 'vue'
|
|
4
|
-
import { type Validatable } from '../composables/
|
|
4
|
+
import { type Validatable } from '../composables/V'
|
|
5
5
|
import SInputBase from './SInputBase.vue'
|
|
6
6
|
|
|
7
7
|
export type Size = 'mini' | 'small' | 'medium'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { type IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
3
|
import { type DefineComponent, computed, ref } from 'vue'
|
|
4
|
-
import { type Validatable } from '../composables/
|
|
4
|
+
import { type Validatable } from '../composables/V'
|
|
5
5
|
import SInputBase from './SInputBase.vue'
|
|
6
6
|
|
|
7
7
|
export type Size = 'mini' | 'small' | 'medium'
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import IconCaretLeft from '@iconify-icons/ph/caret-left-bold'
|
|
3
|
+
import IconCaretRight from '@iconify-icons/ph/caret-right-bold'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
import { useTrans } from '../composables/Lang'
|
|
6
|
+
import { format } from '../support/Num'
|
|
7
|
+
import SButton from './SButton.vue'
|
|
8
|
+
|
|
9
|
+
export type Size = 'mini' | 'small' | 'medium'
|
|
10
|
+
export type Align = 'left' | 'center' | 'right'
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(defineProps<{
|
|
13
|
+
size?: Size
|
|
14
|
+
align?: Align
|
|
15
|
+
total: number
|
|
16
|
+
page: number
|
|
17
|
+
perPage: number
|
|
18
|
+
}>(), {
|
|
19
|
+
size: 'medium',
|
|
20
|
+
align: 'center'
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const emit = defineEmits<{
|
|
24
|
+
(e: 'prev'): void
|
|
25
|
+
(e: 'next'): void
|
|
26
|
+
}>()
|
|
27
|
+
|
|
28
|
+
const { t } = useTrans({
|
|
29
|
+
en: { prev: 'Prev', next: 'Next' },
|
|
30
|
+
ja: { prev: '前へ', next: '次へ' }
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const from = computed(() => {
|
|
34
|
+
return props.page === 1 ? 1 : (props.page - 1) * props.perPage + 1
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const to = computed(() => {
|
|
38
|
+
const value = props.page * props.perPage
|
|
39
|
+
|
|
40
|
+
return value > props.total ? props.total : value
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const hasPrev = computed(() => {
|
|
44
|
+
return props.page > 1
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const hasNext = computed(() => {
|
|
48
|
+
return to.value < props.total
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
function prev() {
|
|
52
|
+
hasPrev.value && emit('prev')
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function next() {
|
|
56
|
+
hasNext.value && emit('next')
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<template>
|
|
61
|
+
<div class="SPagination" :class="[size, align]">
|
|
62
|
+
<div class="button prev">
|
|
63
|
+
<SButton
|
|
64
|
+
type="outline"
|
|
65
|
+
mode="mute"
|
|
66
|
+
:size="size"
|
|
67
|
+
:lead-icon="IconCaretLeft"
|
|
68
|
+
:label="t.prev"
|
|
69
|
+
:disabled="!hasPrev"
|
|
70
|
+
@click="prev"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="text">
|
|
74
|
+
{{ format(from) }}–{{ format(to) }} of {{ format(props.total) }}
|
|
75
|
+
</div>
|
|
76
|
+
<div class="button next">
|
|
77
|
+
<SButton
|
|
78
|
+
type="outline"
|
|
79
|
+
mode="mute"
|
|
80
|
+
:size="size"
|
|
81
|
+
:trail-icon="IconCaretRight"
|
|
82
|
+
:label="t.next"
|
|
83
|
+
:disabled="!hasNext"
|
|
84
|
+
@click="next"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<style scoped lang="postcss">
|
|
91
|
+
.SPagination {
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.text {
|
|
97
|
+
padding: 0 8px;
|
|
98
|
+
line-height: 24px;
|
|
99
|
+
font-size: 14px;
|
|
100
|
+
color: var(--c-text-2);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.SPagination.mini {
|
|
104
|
+
gap: 8px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.SPagination.small {
|
|
108
|
+
gap: 8px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.SPagination.medium {
|
|
112
|
+
gap: 12px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.SPagination.left {
|
|
116
|
+
.prev { order: 1; }
|
|
117
|
+
.next { order: 2; }
|
|
118
|
+
.text { order: 3; }
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.SPagination.center {
|
|
122
|
+
.prev { order: 1; }
|
|
123
|
+
.text { order: 2; }
|
|
124
|
+
.next { order: 3; }
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.SPagination.right {
|
|
128
|
+
.text { order: 1; }
|
|
129
|
+
.prev { order: 2; }
|
|
130
|
+
.next { order: 3; }
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
@@ -491,7 +491,9 @@ function updateSelected(selected: unknown[]) {
|
|
|
491
491
|
width: 100%;
|
|
492
492
|
|
|
493
493
|
.STable.borderless & {
|
|
494
|
+
border-top: 0;
|
|
494
495
|
border-right: 0;
|
|
496
|
+
border-bottom: 0;
|
|
495
497
|
border-left: 0;
|
|
496
498
|
border-radius: 0;
|
|
497
499
|
}
|
|
@@ -523,7 +525,8 @@ function updateSelected(selected: unknown[]) {
|
|
|
523
525
|
display: none;
|
|
524
526
|
}
|
|
525
527
|
|
|
526
|
-
.STable.has-header
|
|
528
|
+
.STable.has-header &,
|
|
529
|
+
.STable.borderless & {
|
|
527
530
|
border-radius: 0;
|
|
528
531
|
}
|
|
529
532
|
}
|
|
@@ -533,7 +536,8 @@ function updateSelected(selected: unknown[]) {
|
|
|
533
536
|
line-height: 0;
|
|
534
537
|
max-height: var(--table-max-height, 100%);
|
|
535
538
|
|
|
536
|
-
.STable.has-footer
|
|
539
|
+
.STable.has-footer &,
|
|
540
|
+
.STable.borderless & {
|
|
537
541
|
border-radius: 0;
|
|
538
542
|
}
|
|
539
543
|
}
|
package/lib/components/SW.vue
CHANGED
package/lib/composables/Card.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComputedRef, type Ref, computed, inject, provide, ref, toValue } from 'vue'
|
|
2
2
|
|
|
3
3
|
export interface CardState {
|
|
4
4
|
isCollapsed: Ref<boolean>
|
|
@@ -6,7 +6,10 @@ export interface CardState {
|
|
|
6
6
|
toggleCollapse(): void
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export type CardBlockSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'
|
|
10
|
+
|
|
11
|
+
export const CardStateKey = 'sefirot-card-state-key'
|
|
12
|
+
export const CardBlockSizeKey = 'sefirot-card-block-size-key'
|
|
10
13
|
|
|
11
14
|
export function provideCardState(): CardState {
|
|
12
15
|
const isCollapsed = ref(false)
|
|
@@ -25,13 +28,17 @@ export function provideCardState(): CardState {
|
|
|
25
28
|
toggleCollapse
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
provide(
|
|
31
|
+
provide(CardStateKey, cardState)
|
|
29
32
|
|
|
30
33
|
return cardState
|
|
31
34
|
}
|
|
32
35
|
|
|
36
|
+
export function provideCardBlockSize(cardBlockSize: ComputedRef<CardBlockSize | null>): void {
|
|
37
|
+
provide(CardBlockSizeKey, cardBlockSize)
|
|
38
|
+
}
|
|
39
|
+
|
|
33
40
|
export function useCardState(): CardState {
|
|
34
|
-
const cardState = inject(
|
|
41
|
+
const cardState = inject<CardState | null>(CardStateKey, null) || null
|
|
35
42
|
|
|
36
43
|
if (!cardState) {
|
|
37
44
|
throw new Error(
|
|
@@ -43,3 +50,8 @@ export function useCardState(): CardState {
|
|
|
43
50
|
|
|
44
51
|
return cardState
|
|
45
52
|
}
|
|
53
|
+
|
|
54
|
+
export function useCardBlockSize(): ComputedRef<CardBlockSize | null> {
|
|
55
|
+
const cardSize = inject<ComputedRef<CardBlockSize | null> | null>(CardBlockSizeKey, null) || null
|
|
56
|
+
return computed(() => toValue(cardSize))
|
|
57
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ComputedRef, computed, inject, provide, toValue } from 'vue'
|
|
2
|
+
|
|
3
|
+
export type ControlSize = 'small' | 'medium'
|
|
4
|
+
export type ControlPosition = 'left' | 'center' | 'right'
|
|
5
|
+
|
|
6
|
+
export const ControlSizeKey = 'sefirot-control-size-key'
|
|
7
|
+
export const ControlPositionKey = 'sefirot-control-position-key'
|
|
8
|
+
|
|
9
|
+
export function provideControlSize(controlSize: ComputedRef<ControlSize>): void {
|
|
10
|
+
provide(ControlSizeKey, controlSize)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function provideControlPosition(controlPosition: ControlPosition): void {
|
|
14
|
+
provide(ControlPositionKey, controlPosition)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function useControlSize(): ComputedRef<ControlSize> {
|
|
18
|
+
const controlSize = inject<ComputedRef<ControlSize> | null>(ControlSizeKey, null) || null
|
|
19
|
+
|
|
20
|
+
if (!controlSize) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
'[sefirot] Unexpected call to `useControlSize`. This probably means'
|
|
23
|
+
+ ' you are using `<SControl>` child component outside of `<SControl>`.'
|
|
24
|
+
+ ' Make sure to wrap the component within `<SControl>` component.'
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return computed(() => toValue(controlSize))
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function useControlPosition(): ControlPosition {
|
|
32
|
+
const controlPosition = inject<ControlPosition | null>(ControlPositionKey, null) || null
|
|
33
|
+
|
|
34
|
+
if (!controlPosition) {
|
|
35
|
+
throw new Error(
|
|
36
|
+
'[sefirot] Unexpected call to `useControlPosition`. This probably means'
|
|
37
|
+
+ ' you are using `<SControl>` child component outside of `<SControl>`.'
|
|
38
|
+
+ ' Make sure to wrap the component within `<SControl>` component.'
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return controlPosition
|
|
43
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Ref, ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
export interface D<T extends Record<string, any>> {
|
|
4
|
+
data: Ref<T>
|
|
5
|
+
init(): void
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function useD<T extends Record<string, any>>(data: T): D<T> {
|
|
9
|
+
const initialData = JSON.parse(JSON.stringify(data))
|
|
10
|
+
|
|
11
|
+
const refData = ref(data) as Ref<T>
|
|
12
|
+
|
|
13
|
+
function init(): void {
|
|
14
|
+
refData.value = initialData
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
data: refData,
|
|
19
|
+
init
|
|
20
|
+
}
|
|
21
|
+
}
|
package/lib/composables/Data.ts
CHANGED
package/lib/composables/Form.ts
CHANGED
package/lib/composables/Table.ts
CHANGED
|
@@ -8,27 +8,29 @@ export interface Table<
|
|
|
8
8
|
R extends Record<string, any> = any,
|
|
9
9
|
SR extends Record<string, any> = any
|
|
10
10
|
> {
|
|
11
|
+
records?: MaybeRef<R[] | null | undefined>
|
|
11
12
|
orders: MaybeRef<O[]>
|
|
12
13
|
columns: MaybeRef<TableColumns<O, R, SR>>
|
|
13
|
-
|
|
14
|
+
summary?: MaybeRef<SR | null | undefined>
|
|
15
|
+
indexField?: keyof R
|
|
16
|
+
loading?: MaybeRef<boolean | undefined>
|
|
17
|
+
rowSize?: MaybeRef<number | undefined>
|
|
18
|
+
borderless?: MaybeRef<boolean>
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use `<SControl>` to add equivalent features.
|
|
22
|
+
*/
|
|
14
23
|
actions?: MaybeRef<TableHeaderAction[]>
|
|
15
|
-
|
|
24
|
+
menu?: MaybeRef<TableMenu[] | TableMenu[][]>
|
|
16
25
|
header?: MaybeRef<boolean | undefined>
|
|
17
26
|
footer?: MaybeRef<boolean | undefined>
|
|
18
|
-
summary?: MaybeRef<SR | null | undefined>
|
|
19
27
|
total?: MaybeRef<number | null | undefined>
|
|
20
28
|
page?: MaybeRef<number | null | undefined>
|
|
21
29
|
perPage?: MaybeRef<number | null | undefined>
|
|
22
|
-
/** @deprecated use `actions` instead */
|
|
23
30
|
reset?: MaybeRef<boolean | undefined>
|
|
24
|
-
borderless?: MaybeRef<boolean>
|
|
25
|
-
loading?: MaybeRef<boolean | undefined>
|
|
26
|
-
rowSize?: MaybeRef<number | undefined>
|
|
27
31
|
borderSize?: MaybeRef<number | undefined>
|
|
28
|
-
indexField?: keyof R
|
|
29
32
|
onPrev?(): void
|
|
30
33
|
onNext?(): void
|
|
31
|
-
/** @deprecated use `actions` instead */
|
|
32
34
|
onReset?(): void
|
|
33
35
|
}
|
|
34
36
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type Validation, type ValidationArgs, useVuelidate } from '@vuelidate/core'
|
|
2
|
+
import { type MaybeRefOrGetter, type Ref, computed, toValue } from 'vue'
|
|
3
|
+
import { type Snackbar, useSnackbars } from '../stores/Snackbars'
|
|
4
|
+
import { useTrans } from './Lang'
|
|
5
|
+
|
|
6
|
+
export interface V<
|
|
7
|
+
Data extends { [key in keyof Rules]: any },
|
|
8
|
+
Rules extends ValidationArgs = ValidationArgs
|
|
9
|
+
> {
|
|
10
|
+
validation: Ref<Validation<Rules, Data>>
|
|
11
|
+
validate(): Promise<boolean>
|
|
12
|
+
validateAndNotify(message?: Snackbar): Promise<boolean>
|
|
13
|
+
reset(): void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Validatable {
|
|
17
|
+
readonly $dirty: boolean
|
|
18
|
+
readonly $invalid: boolean
|
|
19
|
+
readonly $errors: ValidatableError[]
|
|
20
|
+
readonly $touch: () => void
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ValidatableError {
|
|
24
|
+
readonly $message: string | Ref<string>
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function useV<
|
|
28
|
+
Data extends { [key in keyof Rules]: any },
|
|
29
|
+
Rules extends ValidationArgs = ValidationArgs
|
|
30
|
+
>(
|
|
31
|
+
data: MaybeRefOrGetter<Data>,
|
|
32
|
+
rules: MaybeRefOrGetter<Rules>
|
|
33
|
+
): V<Data, Rules> {
|
|
34
|
+
const { t } = useTrans({
|
|
35
|
+
en: { notify: 'Form contains errors. Please correct them and try again.' },
|
|
36
|
+
ja: { notify: 'フォームにエラーがあります。内容を確認し、再度お試しください。' }
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const snackbars = useSnackbars()
|
|
40
|
+
|
|
41
|
+
const d = computed(() => toValue(data))
|
|
42
|
+
const r = computed(() => toValue(rules))
|
|
43
|
+
|
|
44
|
+
const validation = useVuelidate(r, d)
|
|
45
|
+
|
|
46
|
+
function reset(): void {
|
|
47
|
+
validation.value.$reset()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function validate(): Promise<boolean> {
|
|
51
|
+
return validation.value.$validate()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function validateAndNotify(message?: Snackbar): Promise<boolean> {
|
|
55
|
+
const valid = await validate()
|
|
56
|
+
|
|
57
|
+
if (!valid) {
|
|
58
|
+
snackbars.push(message ?? {
|
|
59
|
+
mode: 'danger',
|
|
60
|
+
text: t.notify
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return valid
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
validation,
|
|
69
|
+
validate,
|
|
70
|
+
validateAndNotify,
|
|
71
|
+
reset
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type App } from 'vue'
|
|
2
|
+
import SControl from '../components/SControl.vue'
|
|
3
|
+
import SControlButton from '../components/SControlButton.vue'
|
|
4
|
+
import SControlCenter from '../components/SControlCenter.vue'
|
|
5
|
+
import SControlInputSearch from '../components/SControlInputSearch.vue'
|
|
6
|
+
import SControlLeft from '../components/SControlLeft.vue'
|
|
7
|
+
import SControlRight from '../components/SControlRight.vue'
|
|
8
|
+
import SControlText from '../components/SControlText.vue'
|
|
9
|
+
|
|
10
|
+
export function mixin(app: App): void {
|
|
11
|
+
app.component('SControl', SControl)
|
|
12
|
+
app.component('SControlButton', SControlButton)
|
|
13
|
+
app.component('SControlCenter', SControlCenter)
|
|
14
|
+
app.component('SControlInputSearch', SControlInputSearch)
|
|
15
|
+
app.component('SControlLeft', SControlLeft)
|
|
16
|
+
app.component('SControlRight', SControlRight)
|
|
17
|
+
app.component('SControlText', SControlText)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare module 'vue' {
|
|
21
|
+
export interface GlobalComponents {
|
|
22
|
+
SControl: typeof SControl
|
|
23
|
+
SControlButton: typeof SControlButton
|
|
24
|
+
SControlCenter: typeof SControlCenter
|
|
25
|
+
SControlInputSearch: typeof SControlInputSearch
|
|
26
|
+
SControlLeft: typeof SControlLeft
|
|
27
|
+
SControlRight: typeof SControlRight
|
|
28
|
+
SControlText: typeof SControlText
|
|
29
|
+
}
|
|
30
|
+
}
|
package/lib/styles/utilities.css
CHANGED
|
@@ -1,3 +1,113 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
}
|
|
1
|
+
.bg-elv-1 { background-color: var(--c-bg-elv-1); }
|
|
2
|
+
.bg-elv-2 { background-color: var(--c-bg-elv-2); }
|
|
3
|
+
.bg-elv-3 { background-color: var(--c-bg-elv-3); }
|
|
4
|
+
.bg-elv-4 { background-color: var(--c-bg-elv-4); }
|
|
5
|
+
|
|
6
|
+
.s-flex { display: flex; }
|
|
7
|
+
|
|
8
|
+
.s-font-12 { font-size: 12px; }
|
|
9
|
+
.s-font-14 { font-size: 14px; }
|
|
10
|
+
.s-font-16 { font-size: 16px; }
|
|
11
|
+
.s-font-20 { font-size: 20px; }
|
|
12
|
+
.s-font-24 { font-size: 24px; }
|
|
13
|
+
.s-font-32 { font-size: 32px; }
|
|
14
|
+
|
|
15
|
+
.s-font-w-100 { font-weight: 100; }
|
|
16
|
+
.s-font-w-200 { font-weight: 200; }
|
|
17
|
+
.s-font-w-300 { font-weight: 300; }
|
|
18
|
+
.s-font-w-400 { font-weight: 400; }
|
|
19
|
+
.s-font-w-500 { font-weight: 500; }
|
|
20
|
+
.s-font-w-600 { font-weight: 600; }
|
|
21
|
+
.s-font-w-700 { font-weight: 700; }
|
|
22
|
+
.s-font-w-800 { font-weight: 800; }
|
|
23
|
+
.s-font-w-900 { font-weight: 900; }
|
|
24
|
+
|
|
25
|
+
.s-gap-4 { gap: 4px; }
|
|
26
|
+
.s-gap-8 { gap: 8px; }
|
|
27
|
+
.s-gap-12 { gap: 12px; }
|
|
28
|
+
.s-gap-16 { gap: 16px; }
|
|
29
|
+
|
|
30
|
+
.s-grow { flex-grow: 1; }
|
|
31
|
+
.s-grow-0 { flex-grow: 0; }
|
|
32
|
+
|
|
33
|
+
.s-nowrap { white-space: nowrap; }
|
|
34
|
+
|
|
35
|
+
.s-overflow-hidden { overflow: hidden; }
|
|
36
|
+
|
|
37
|
+
.s-p-8 { padding: 8px; }
|
|
38
|
+
.s-p-12 { padding: 12px; }
|
|
39
|
+
.s-p-16 { padding: 16px; }
|
|
40
|
+
.s-p-24 { padding: 24px; }
|
|
41
|
+
.s-p-32 { padding: 32px; }
|
|
42
|
+
.s-p-48 { padding: 48px; }
|
|
43
|
+
.s-p-56 { padding: 56px; }
|
|
44
|
+
.s-p-64 { padding: 64px; }
|
|
45
|
+
|
|
46
|
+
.s-pb-8 { padding-bottom: 8px; }
|
|
47
|
+
.s-pb-12 { padding-bottom: 12px; }
|
|
48
|
+
.s-pb-16 { padding-bottom: 16px; }
|
|
49
|
+
.s-pb-24 { padding-bottom: 24px; }
|
|
50
|
+
.s-pb-32 { padding-bottom: 32px; }
|
|
51
|
+
.s-pb-48 { padding-bottom: 48px; }
|
|
52
|
+
.s-pb-56 { padding-bottom: 56px; }
|
|
53
|
+
.s-pb-64 { padding-bottom: 64px; }
|
|
54
|
+
|
|
55
|
+
.s-pl-8 { padding-left: 8px; }
|
|
56
|
+
.s-pl-12 { padding-left: 12px; }
|
|
57
|
+
.s-pl-16 { padding-left: 16px; }
|
|
58
|
+
.s-pl-24 { padding-left: 24px; }
|
|
59
|
+
.s-pl-32 { padding-left: 32px; }
|
|
60
|
+
.s-pl-48 { padding-left: 48px; }
|
|
61
|
+
.s-pl-56 { padding-left: 56px; }
|
|
62
|
+
.s-pl-64 { padding-left: 64px; }
|
|
63
|
+
|
|
64
|
+
.s-pr-8 { padding-right: 8px; }
|
|
65
|
+
.s-pr-12 { padding-right: 12px; }
|
|
66
|
+
.s-pr-16 { padding-right: 16px; }
|
|
67
|
+
.s-pr-24 { padding-right: 24px; }
|
|
68
|
+
.s-pr-32 { padding-right: 32px; }
|
|
69
|
+
.s-pr-48 { padding-right: 48px; }
|
|
70
|
+
.s-pr-56 { padding-right: 56px; }
|
|
71
|
+
.s-pr-64 { padding-right: 64px; }
|
|
72
|
+
|
|
73
|
+
.s-pt-8 { padding-top: 8px; }
|
|
74
|
+
.s-pt-12 { padding-top: 12px; }
|
|
75
|
+
.s-pt-16 { padding-top: 16px; }
|
|
76
|
+
.s-pt-24 { padding-top: 24px; }
|
|
77
|
+
.s-pt-32 { padding-top: 32px; }
|
|
78
|
+
.s-pt-48 { padding-top: 48px; }
|
|
79
|
+
.s-pt-56 { padding-top: 56px; }
|
|
80
|
+
.s-pt-64 { padding-top: 64px; }
|
|
81
|
+
|
|
82
|
+
.s-px-8 { padding-right: 8px; padding-left: 8px; }
|
|
83
|
+
.s-px-12 { padding-right: 12px; padding-left: 12px; }
|
|
84
|
+
.s-px-16 { padding-right: 16px; padding-left: 16px; }
|
|
85
|
+
.s-px-24 { padding-right: 24px; padding-left: 24px; }
|
|
86
|
+
.s-px-32 { padding-right: 32px; padding-left: 32px; }
|
|
87
|
+
.s-px-48 { padding-right: 48px; padding-left: 48px; }
|
|
88
|
+
.s-px-56 { padding-right: 56px; padding-left: 56px; }
|
|
89
|
+
.s-px-64 { padding-right: 64px; padding-left: 64px; }
|
|
90
|
+
|
|
91
|
+
.s-py-8 { padding-top: 8px; padding-bottom: 8px; }
|
|
92
|
+
.s-py-12 { padding-top: 12px; padding-bottom: 12px; }
|
|
93
|
+
.s-py-16 { padding-top: 16px; padding-bottom: 16px; }
|
|
94
|
+
.s-py-24 { padding-top: 24px; padding-bottom: 24px; }
|
|
95
|
+
.s-py-32 { padding-top: 32px; padding-bottom: 32px; }
|
|
96
|
+
.s-py-48 { padding-top: 48px; padding-bottom: 48px; }
|
|
97
|
+
.s-py-56 { padding-top: 56px; padding-bottom: 56px; }
|
|
98
|
+
.s-py-64 { padding-top: 64px; padding-bottom: 64px; }
|
|
99
|
+
|
|
100
|
+
.s-shrink { flex-shrink: 1; }
|
|
101
|
+
.s-shrink-0 { flex-shrink: 0; }
|
|
102
|
+
|
|
103
|
+
.s-text-1 { color: var(--c-text-1); }
|
|
104
|
+
.s-text-2 { color: var(--c-text-2); }
|
|
105
|
+
.s-text-3 { color: var(--c-text-3); }
|
|
106
|
+
|
|
107
|
+
.s-w-256 { width: 256px; }
|
|
108
|
+
.s-w-320 { width: 320px; }
|
|
109
|
+
.s-w-512 { width: 512px; }
|
|
110
|
+
|
|
111
|
+
.s-max-w-256 { max-width: 256px; }
|
|
112
|
+
.s-max-w-320 { max-width: 320px; }
|
|
113
|
+
.s-max-w-512 { max-width: 512px; }
|