@globalbrain/sefirot 4.56.0 → 4.58.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/blocks/lens/components/LensFormFilterCondition.vue +2 -1
- package/lib/blocks/lens/components/LensFormFilterGroup.vue +1 -1
- package/lib/blocks/lens/components/{LensAvatarInput.vue → LensInputAvatar.vue} +5 -3
- package/lib/blocks/lens/components/LensInputDropdown.vue +102 -0
- package/lib/blocks/lens/components/LensSheetAvatarField.vue +2 -2
- package/lib/blocks/lens/components/LensTableEditableCell.vue +5 -4
- package/lib/blocks/lens/fields/AvatarField.ts +2 -2
- package/lib/blocks/lens/fields/Field.ts +10 -6
- package/lib/blocks/lens/filter-inputs/SelectFilterInput.ts +2 -1
- package/lib/components/SButton.vue +2 -10
- package/lib/components/SControlInputSearch.vue +6 -3
- package/lib/components/SDescPill.vue +3 -2
- package/lib/components/SDescState.vue +3 -2
- package/lib/components/SInputAddon.vue +4 -2
- package/lib/components/SInputAsyncDropdown.vue +761 -0
- package/lib/components/SInputBase.vue +1 -3
- package/lib/components/SInputCheckbox.vue +10 -18
- package/lib/components/SInputCheckboxes.vue +16 -33
- package/lib/components/SInputDate.vue +10 -20
- package/lib/components/SInputDropdown.vue +22 -43
- package/lib/components/SInputDropdownItem.vue +10 -27
- package/lib/components/SInputFile.vue +10 -18
- package/lib/components/SInputFileUpload.vue +12 -34
- package/lib/components/SInputFileUploadItem.vue +7 -21
- package/lib/components/SInputHMS.vue +6 -7
- package/lib/components/SInputImage.vue +11 -16
- package/lib/components/SInputNumber.vue +1 -3
- package/lib/components/SInputRadio.vue +9 -19
- package/lib/components/SInputRadios.vue +18 -40
- package/lib/components/SInputSegments.vue +15 -26
- package/lib/components/SInputSegmentsOption.vue +7 -7
- package/lib/components/SInputSelect.vue +14 -19
- package/lib/components/SInputSwitch.vue +10 -19
- package/lib/components/SInputSwitches.vue +16 -30
- package/lib/components/SInputText.vue +1 -4
- package/lib/components/SInputTextarea.vue +0 -2
- package/lib/components/SInputYMD.vue +6 -7
- package/lib/components/SPagination.vue +1 -1
- package/lib/components/SPill.vue +2 -2
- package/lib/components/SState.vue +2 -2
- package/lib/components/STableCellPill.vue +3 -2
- package/lib/components/STableCellState.vue +3 -2
- package/lib/composables/Table.ts +8 -15
- package/lib/support/Color.ts +4 -0
- package/lib/support/InputBase.ts +5 -0
- package/lib/support/InputDropdown.ts +15 -0
- package/lib/support/InputFileUpload.ts +22 -0
- package/lib/support/InputOption.ts +8 -0
- package/lib/support/InputText.ts +6 -0
- package/package.json +1 -1
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import IconImage from '~icons/ph/image-bold'
|
|
3
|
-
import {
|
|
3
|
+
import { computed, ref } from 'vue'
|
|
4
4
|
import { useImageSrcFromFile } from '../composables/Image'
|
|
5
|
-
import { type Validatable } from '../composables/Validation'
|
|
6
5
|
import SButton from './SButton.vue'
|
|
7
|
-
import SInputBase, { type
|
|
6
|
+
import SInputBase, { type Props as BaseProps } from './SInputBase.vue'
|
|
8
7
|
|
|
9
8
|
export type Size = 'mini' | 'small' | 'medium'
|
|
10
|
-
export type { Color }
|
|
11
9
|
export type ImageType = 'rectangle' | 'circle'
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
export interface Props extends BaseProps {
|
|
14
12
|
size?: Size
|
|
15
|
-
label?: string
|
|
16
|
-
info?: string
|
|
17
|
-
note?: string
|
|
18
|
-
help?: string
|
|
19
|
-
checkIcon?: Component
|
|
20
|
-
checkText?: string
|
|
21
|
-
checkColor?: Color
|
|
22
13
|
imageType?: ImageType
|
|
23
14
|
imageWidth?: string
|
|
24
15
|
imageAspectRatio?: string
|
|
@@ -29,9 +20,9 @@ const props = withDefaults(defineProps<{
|
|
|
29
20
|
disabled?: boolean
|
|
30
21
|
value?: File | string | null
|
|
31
22
|
modelValue?: File | string | null
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
35
26
|
size: 'small',
|
|
36
27
|
imageType: 'rectangle',
|
|
37
28
|
imageWidth: '96px',
|
|
@@ -91,14 +82,18 @@ function onFileDelete() {
|
|
|
91
82
|
<SInputBase
|
|
92
83
|
class="SInputImage"
|
|
93
84
|
:class="[size]"
|
|
85
|
+
:size
|
|
86
|
+
:name
|
|
94
87
|
:label
|
|
95
88
|
:note
|
|
96
89
|
:info
|
|
97
90
|
:check-icon
|
|
98
91
|
:check-text
|
|
99
92
|
:check-color
|
|
100
|
-
:hide-error
|
|
101
93
|
:validation
|
|
94
|
+
:warning
|
|
95
|
+
:hide-error
|
|
96
|
+
:hide-warning
|
|
102
97
|
>
|
|
103
98
|
<template #default>
|
|
104
99
|
<input
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { type Component, computed } from 'vue'
|
|
3
|
+
import { type Align, type TextColor } from '../support/InputText'
|
|
3
4
|
import { type Props as BaseProps } from './SInputBase.vue'
|
|
4
5
|
import SInputText from './SInputText.vue'
|
|
5
6
|
|
|
@@ -17,9 +18,6 @@ export interface Props extends BaseProps {
|
|
|
17
18
|
displayValue?: string | null
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
export type Align = 'left' | 'center' | 'right'
|
|
21
|
-
export type TextColor = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
|
|
22
|
-
|
|
23
21
|
const props = defineProps<Props>()
|
|
24
22
|
|
|
25
23
|
const emit = defineEmits<{
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type { Color, Size }
|
|
7
|
-
|
|
8
|
-
const props = defineProps<{
|
|
9
|
-
size?: Size
|
|
10
|
-
name?: string
|
|
11
|
-
label?: string
|
|
12
|
-
info?: string
|
|
13
|
-
note?: string
|
|
14
|
-
help?: string
|
|
15
|
-
checkIcon?: Component
|
|
16
|
-
checkText?: string
|
|
17
|
-
checkColor?: Color
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import SInputBase, { type Props as BaseProps } from './SInputBase.vue'
|
|
4
|
+
|
|
5
|
+
export interface Props extends BaseProps {
|
|
18
6
|
text?: string
|
|
19
7
|
disabled?: boolean
|
|
20
8
|
modelValue: boolean
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = defineProps<Props>()
|
|
24
12
|
|
|
25
13
|
const emit = defineEmits<{
|
|
26
14
|
'update:model-value': [value: boolean]
|
|
@@ -54,7 +42,9 @@ function onClick() {
|
|
|
54
42
|
:check-text
|
|
55
43
|
:check-color
|
|
56
44
|
:validation
|
|
45
|
+
:warning
|
|
57
46
|
:hide-error
|
|
47
|
+
:hide-warning
|
|
58
48
|
>
|
|
59
49
|
<div class="container">
|
|
60
50
|
<div
|
|
@@ -1,51 +1,27 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ValueType extends string | number | boolean = string | number | boolean,
|
|
6
|
-
Nullable extends boolean = false
|
|
7
|
-
"
|
|
8
|
-
>
|
|
9
|
-
import { type Component, computed } from 'vue'
|
|
10
|
-
import { type Validatable } from '../composables/Validation'
|
|
11
|
-
import SInputBase, { type Color, type Size } from './SInputBase.vue'
|
|
1
|
+
<script setup lang="ts" generic="T extends string | number | boolean = string | number | boolean, Nullable extends boolean = false">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { type Option } from '../support/InputOption'
|
|
4
|
+
import SInputBase, { type Props as BaseProps } from './SInputBase.vue'
|
|
12
5
|
import SInputRadio from './SInputRadio.vue'
|
|
13
6
|
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
label: string
|
|
18
|
-
value: ValueType
|
|
7
|
+
export interface Props<T extends string | number | boolean = string | number | boolean, Nullable extends boolean = false> extends BaseProps {
|
|
8
|
+
options: Option<T>[]
|
|
9
|
+
nullable?: boolean & Nullable
|
|
19
10
|
disabled?: boolean
|
|
11
|
+
value?: T | null
|
|
12
|
+
modelValue?: T | null
|
|
20
13
|
}
|
|
21
14
|
|
|
22
15
|
type NullValue = Nullable extends true ? null : never
|
|
23
16
|
|
|
24
|
-
const props = withDefaults(defineProps<{
|
|
25
|
-
size?: Size
|
|
26
|
-
name?: string
|
|
27
|
-
label?: string
|
|
28
|
-
info?: string
|
|
29
|
-
note?: string
|
|
30
|
-
help?: string
|
|
31
|
-
checkIcon?: Component
|
|
32
|
-
checkText?: string
|
|
33
|
-
checkColor?: Color
|
|
34
|
-
options: Option<ValueType>[]
|
|
35
|
-
nullable?: Nullable
|
|
36
|
-
disabled?: boolean
|
|
37
|
-
value?: ValueType | null
|
|
38
|
-
modelValue?: ValueType | null
|
|
39
|
-
validation?: Validatable
|
|
40
|
-
hideError?: boolean
|
|
41
|
-
}>(), {
|
|
17
|
+
const props = withDefaults(defineProps<Props<T, Nullable>>(), {
|
|
42
18
|
value: undefined,
|
|
43
19
|
modelValue: undefined
|
|
44
20
|
})
|
|
45
21
|
|
|
46
22
|
const emit = defineEmits<{
|
|
47
|
-
'update:model-value': [value:
|
|
48
|
-
'change': [value:
|
|
23
|
+
'update:model-value': [value: T | NullValue]
|
|
24
|
+
'change': [value: T | NullValue]
|
|
49
25
|
}>()
|
|
50
26
|
|
|
51
27
|
const _value = computed(() => {
|
|
@@ -56,11 +32,11 @@ const _value = computed(() => {
|
|
|
56
32
|
: null
|
|
57
33
|
})
|
|
58
34
|
|
|
59
|
-
function isChecked(value:
|
|
35
|
+
function isChecked(value: T) {
|
|
60
36
|
return value === _value.value
|
|
61
37
|
}
|
|
62
38
|
|
|
63
|
-
function onUpdate(value:
|
|
39
|
+
function onUpdate(value: T) {
|
|
64
40
|
if (value !== _value.value) {
|
|
65
41
|
emit('update:model-value', value)
|
|
66
42
|
return
|
|
@@ -71,7 +47,7 @@ function onUpdate(value: ValueType) {
|
|
|
71
47
|
}
|
|
72
48
|
}
|
|
73
49
|
|
|
74
|
-
function onChange(value:
|
|
50
|
+
function onChange(value: T) {
|
|
75
51
|
if (value !== _value.value) {
|
|
76
52
|
emit('change', value)
|
|
77
53
|
return
|
|
@@ -96,8 +72,10 @@ function onChange(value: ValueType) {
|
|
|
96
72
|
:check-icon
|
|
97
73
|
:check-text
|
|
98
74
|
:check-color
|
|
99
|
-
:hide-error
|
|
100
75
|
:validation
|
|
76
|
+
:warning
|
|
77
|
+
:hide-error
|
|
78
|
+
:hide-warning
|
|
101
79
|
>
|
|
102
80
|
<div class="container">
|
|
103
81
|
<div class="row">
|
|
@@ -1,36 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts" generic="T extends string | number | boolean">
|
|
2
|
-
import {
|
|
3
|
-
import { type
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
label: string
|
|
11
|
-
value: T
|
|
12
|
-
mode?: Mode
|
|
13
|
-
disabled?: boolean
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { type ColorMode } from '../support/Color'
|
|
4
|
+
import { type Option as BaseOption } from '../support/InputOption'
|
|
5
|
+
import SInputBase, { type Props as BaseProps } from './SInputBase.vue'
|
|
6
|
+
import SInputSegmentsOption from './SInputSegmentsOption.vue'
|
|
7
|
+
|
|
8
|
+
export interface Option<T extends string | number | boolean> extends BaseOption<T> {
|
|
9
|
+
mode?: ColorMode
|
|
14
10
|
}
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
size?: Size
|
|
18
|
-
name?: string
|
|
19
|
-
label?: string
|
|
20
|
-
info?: string
|
|
21
|
-
note?: string
|
|
22
|
-
help?: string
|
|
23
|
-
checkIcon?: Component
|
|
24
|
-
checkText?: string
|
|
25
|
-
checkColor?: Color
|
|
12
|
+
export interface Props<T extends string | number | boolean> extends BaseProps {
|
|
26
13
|
options: Option<T>[]
|
|
27
14
|
block?: boolean
|
|
28
15
|
disabled?: boolean
|
|
29
16
|
value?: T
|
|
30
17
|
modelValue?: T
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const props = defineProps<Props<T>>()
|
|
34
21
|
|
|
35
22
|
const emit = defineEmits<{
|
|
36
23
|
'update:model-value': [value: T]
|
|
@@ -66,8 +53,10 @@ function onSelect(value: T) {
|
|
|
66
53
|
:check-icon
|
|
67
54
|
:check-text
|
|
68
55
|
:check-color
|
|
69
|
-
:hide-error
|
|
70
56
|
:validation
|
|
57
|
+
:warning
|
|
58
|
+
:hide-error
|
|
59
|
+
:hide-warning
|
|
71
60
|
>
|
|
72
61
|
<div class="box">
|
|
73
62
|
<SInputSegmentsOption
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
2
|
+
import { type ColorMode } from '../support/Color'
|
|
3
|
+
import { type Size } from '../support/InputBase'
|
|
3
4
|
|
|
4
|
-
export
|
|
5
|
-
export type Mode = 'default' | 'mute' | 'neutral' | 'info' | 'success' | 'warning' | 'danger'
|
|
6
|
-
|
|
7
|
-
const props = defineProps<{
|
|
5
|
+
export interface Props {
|
|
8
6
|
size: Size
|
|
9
7
|
label: string
|
|
10
|
-
mode:
|
|
8
|
+
mode: ColorMode
|
|
11
9
|
active: boolean
|
|
12
10
|
disabled: boolean
|
|
13
|
-
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const props = defineProps<Props>()
|
|
14
14
|
|
|
15
15
|
const emit = defineEmits<{
|
|
16
16
|
click: []
|
|
@@ -1,36 +1,28 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
1
|
+
<script setup lang="ts" generic="T = any">
|
|
2
2
|
import IconCaretDown from '~icons/ph/caret-down'
|
|
3
3
|
import IconCaretUp from '~icons/ph/caret-up'
|
|
4
4
|
import { computed, ref } from 'vue'
|
|
5
|
+
import { type Option } from '../support/InputOption'
|
|
5
6
|
import SInputBase, { type Props as BaseProps } from './SInputBase.vue'
|
|
6
7
|
|
|
7
|
-
export
|
|
8
|
-
export interface Props extends BaseProps {
|
|
8
|
+
export interface Props<T = any> extends BaseProps {
|
|
9
9
|
placeholder?: string
|
|
10
|
-
options: Option[]
|
|
10
|
+
options: Option<T>[]
|
|
11
11
|
nullable?: boolean
|
|
12
12
|
disabled?: boolean
|
|
13
13
|
tabindex?: -1 | 0 | number
|
|
14
|
-
value?:
|
|
15
|
-
modelValue?:
|
|
14
|
+
value?: T | null
|
|
15
|
+
modelValue?: T | null
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export interface Option {
|
|
21
|
-
label: string
|
|
22
|
-
value: any
|
|
23
|
-
disabled?: boolean
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
18
|
+
const props = withDefaults(defineProps<Props<T>>(), {
|
|
27
19
|
value: undefined,
|
|
28
20
|
modelValue: undefined
|
|
29
21
|
})
|
|
30
22
|
|
|
31
23
|
const emit = defineEmits<{
|
|
32
|
-
'update:model-value': [value:
|
|
33
|
-
'change': [value:
|
|
24
|
+
'update:model-value': [value: T | null]
|
|
25
|
+
'change': [value: T | null]
|
|
34
26
|
}>()
|
|
35
27
|
|
|
36
28
|
const _value = computed(() => {
|
|
@@ -52,7 +44,7 @@ const isNotSelected = computed(() => {
|
|
|
52
44
|
return _value.value == null || _value.value === ''
|
|
53
45
|
})
|
|
54
46
|
|
|
55
|
-
function isSelectedOption(option: Option): boolean {
|
|
47
|
+
function isSelectedOption(option: Option<T>): boolean {
|
|
56
48
|
return option.value === _value.value
|
|
57
49
|
}
|
|
58
50
|
|
|
@@ -74,6 +66,7 @@ function emitChange(e: any): void {
|
|
|
74
66
|
class="SInputSelect"
|
|
75
67
|
:class="classes"
|
|
76
68
|
:size
|
|
69
|
+
:name
|
|
77
70
|
:label
|
|
78
71
|
:note
|
|
79
72
|
:info
|
|
@@ -81,8 +74,10 @@ function emitChange(e: any): void {
|
|
|
81
74
|
:check-icon
|
|
82
75
|
:check-text
|
|
83
76
|
:check-color
|
|
84
|
-
:hide-error
|
|
85
77
|
:validation
|
|
78
|
+
:warning
|
|
79
|
+
:hide-error
|
|
80
|
+
:hide-warning
|
|
86
81
|
>
|
|
87
82
|
<div class="box" :class="{ focus: isFocused }">
|
|
88
83
|
<select
|
|
@@ -1,29 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { type
|
|
4
|
-
import SInputBase, { type Color, type Size } from './SInputBase.vue'
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import SInputBase, { type Props as BaseProps } from './SInputBase.vue'
|
|
5
4
|
|
|
6
|
-
export type { Color, Size }
|
|
7
5
|
export type ActiveColor = 'info' | 'success' | 'warning' | 'danger'
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
size?: Size
|
|
11
|
-
name?: string
|
|
12
|
-
label?: string
|
|
13
|
-
info?: string
|
|
14
|
-
note?: string
|
|
7
|
+
export interface Props extends BaseProps {
|
|
15
8
|
text?: string
|
|
16
9
|
color?: ActiveColor
|
|
17
|
-
help?: string
|
|
18
|
-
checkIcon?: Component
|
|
19
|
-
checkText?: string
|
|
20
|
-
checkColor?: Color
|
|
21
10
|
disabled?: boolean
|
|
22
11
|
value?: boolean
|
|
23
12
|
modelValue?: boolean
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
27
16
|
value: undefined,
|
|
28
17
|
modelValue: undefined
|
|
29
18
|
})
|
|
@@ -64,12 +53,14 @@ function emitChange(): void {
|
|
|
64
53
|
:label
|
|
65
54
|
:note
|
|
66
55
|
:info
|
|
56
|
+
:help
|
|
67
57
|
:check-icon
|
|
68
58
|
:check-text
|
|
69
59
|
:check-color
|
|
70
|
-
:help
|
|
71
|
-
:hide-error
|
|
72
60
|
:validation
|
|
61
|
+
:warning
|
|
62
|
+
:hide-error
|
|
63
|
+
:hide-warning
|
|
73
64
|
>
|
|
74
65
|
<div class="container">
|
|
75
66
|
<div class="input" :class="{ on: _value }" role="button" @click="emitChange">
|
|
@@ -1,46 +1,30 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { type
|
|
4
|
-
import SInputBase, { type
|
|
1
|
+
<script setup lang="ts" generic="T = any">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { type Option } from '../support/InputOption'
|
|
4
|
+
import SInputBase, { type Props as BaseProps } from './SInputBase.vue'
|
|
5
5
|
import SInputSwitch from './SInputSwitch.vue'
|
|
6
6
|
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
value: any
|
|
7
|
+
export interface Props<T = any> extends BaseProps {
|
|
8
|
+
options: Option<T>[]
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
modelValue: T[]
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
const props = defineProps<
|
|
15
|
-
size?: Size
|
|
16
|
-
name?: string
|
|
17
|
-
label?: string
|
|
18
|
-
info?: string
|
|
19
|
-
note?: string
|
|
20
|
-
help?: string
|
|
21
|
-
checkIcon?: Component
|
|
22
|
-
checkText?: string
|
|
23
|
-
checkColor?: Color
|
|
24
|
-
options: Option[]
|
|
25
|
-
disabled?: boolean
|
|
26
|
-
modelValue: any[]
|
|
27
|
-
hideError?: boolean
|
|
28
|
-
validation?: Validatable
|
|
29
|
-
}>()
|
|
13
|
+
const props = defineProps<Props<T>>()
|
|
30
14
|
|
|
31
15
|
const emit = defineEmits<{
|
|
32
|
-
'update:model-value': [value:
|
|
16
|
+
'update:model-value': [value: T[]]
|
|
33
17
|
}>()
|
|
34
18
|
|
|
35
19
|
const classes = computed(() => [
|
|
36
20
|
props.size ?? 'small'
|
|
37
21
|
])
|
|
38
22
|
|
|
39
|
-
function isChecked(value:
|
|
23
|
+
function isChecked(value: T): boolean {
|
|
40
24
|
return props.modelValue.includes(value)
|
|
41
25
|
}
|
|
42
26
|
|
|
43
|
-
function onChange(value:
|
|
27
|
+
function onChange(value: T): void {
|
|
44
28
|
const difference = props.modelValue
|
|
45
29
|
.filter((v) => v !== value)
|
|
46
30
|
.concat(props.modelValue.includes(value) ? [] : [value])
|
|
@@ -62,8 +46,10 @@ function onChange(value: any): void {
|
|
|
62
46
|
:check-icon
|
|
63
47
|
:check-text
|
|
64
48
|
:check-color
|
|
65
|
-
:hide-error
|
|
66
49
|
:validation
|
|
50
|
+
:warning
|
|
51
|
+
:hide-error
|
|
52
|
+
:hide-warning
|
|
67
53
|
>
|
|
68
54
|
<div class="container">
|
|
69
55
|
<div class="row">
|
|
@@ -71,7 +57,7 @@ function onChange(value: any): void {
|
|
|
71
57
|
<SInputSwitch
|
|
72
58
|
size="sm"
|
|
73
59
|
:text="option.label"
|
|
74
|
-
:disabled
|
|
60
|
+
:disabled="option.disabled ?? disabled"
|
|
75
61
|
:model-value="isChecked(option.value)"
|
|
76
62
|
@update:model-value="onChange(option.value)"
|
|
77
63
|
/>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { type Component, computed, ref } from 'vue'
|
|
3
|
+
import { type Align, type TextColor } from '../support/InputText'
|
|
3
4
|
import SInputBase, { type Props as BaseProps } from './SInputBase.vue'
|
|
4
5
|
|
|
5
|
-
export type { Color, Size } from './SInputBase.vue'
|
|
6
6
|
export interface Props extends BaseProps {
|
|
7
7
|
type?: string
|
|
8
8
|
placeholder?: string
|
|
@@ -16,9 +16,6 @@ export interface Props extends BaseProps {
|
|
|
16
16
|
displayValue?: string | null
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export type Align = 'left' | 'center' | 'right'
|
|
20
|
-
export type TextColor = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
|
|
21
|
-
|
|
22
19
|
const props = defineProps<Props>()
|
|
23
20
|
|
|
24
21
|
const emit = defineEmits<{
|
|
@@ -4,8 +4,6 @@ import SDivider from './SDivider.vue'
|
|
|
4
4
|
import SInputBase, { type Props as BaseProps } from './SInputBase.vue'
|
|
5
5
|
import SInputSegments from './SInputSegments.vue'
|
|
6
6
|
|
|
7
|
-
export type { Color, Size } from './SInputBase.vue'
|
|
8
|
-
|
|
9
7
|
export interface Props extends BaseProps {
|
|
10
8
|
placeholder?: string
|
|
11
9
|
disabled?: boolean
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, ref } from 'vue'
|
|
3
|
+
import { type Ymd } from '../support/Day'
|
|
3
4
|
import SInputBase, { type Props as BaseProps } from './SInputBase.vue'
|
|
4
5
|
|
|
5
|
-
export type { Color, Size } from './SInputBase.vue'
|
|
6
6
|
export interface Props extends BaseProps {
|
|
7
7
|
placeholder?: Placeholder
|
|
8
8
|
noYear?: boolean
|
|
@@ -14,11 +14,7 @@ export interface Props extends BaseProps {
|
|
|
14
14
|
modelValue?: Value
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export
|
|
18
|
-
year: number | null
|
|
19
|
-
month: number | null
|
|
20
|
-
date: number | null
|
|
21
|
-
}
|
|
17
|
+
export type Value = Ymd
|
|
22
18
|
|
|
23
19
|
export type ValueType = 'year' | 'month' | 'date'
|
|
24
20
|
|
|
@@ -135,6 +131,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
135
131
|
class="SInputYMD"
|
|
136
132
|
:class="[size ?? 'small', { disabled }]"
|
|
137
133
|
:size
|
|
134
|
+
:name
|
|
138
135
|
:label
|
|
139
136
|
:note
|
|
140
137
|
:info
|
|
@@ -142,8 +139,10 @@ function createRequiredTouched(): boolean[] {
|
|
|
142
139
|
:check-icon
|
|
143
140
|
:check-text
|
|
144
141
|
:check-color
|
|
145
|
-
:hide-error
|
|
146
142
|
:validation
|
|
143
|
+
:warning
|
|
144
|
+
:hide-error
|
|
145
|
+
:hide-warning
|
|
147
146
|
>
|
|
148
147
|
<div class="container" :class="{ focus: isFocused, block }">
|
|
149
148
|
<input
|
|
@@ -3,11 +3,11 @@ import IconCaretLeft from '~icons/ph/caret-left-bold'
|
|
|
3
3
|
import IconCaretRight from '~icons/ph/caret-right-bold'
|
|
4
4
|
import { computed } from 'vue'
|
|
5
5
|
import { useTrans } from '../composables/Lang'
|
|
6
|
+
import { type Align } from '../support/InputText'
|
|
6
7
|
import { format } from '../support/Num'
|
|
7
8
|
import SButton from './SButton.vue'
|
|
8
9
|
|
|
9
10
|
export type Size = 'xs' | 'sm' | 'md' | 'mini' | 'small' | 'medium'
|
|
10
|
-
export type Align = 'left' | 'center' | 'right'
|
|
11
11
|
|
|
12
12
|
const props = withDefaults(defineProps<{
|
|
13
13
|
size?: Size
|
package/lib/components/SPill.vue
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
+
import { type ColorMode } from '../support/Color'
|
|
3
4
|
|
|
4
5
|
export type Size = 'mini' | 'small' | 'medium' | 'large'
|
|
5
6
|
export type Type = 'dimm' | 'fill'
|
|
6
|
-
export type Mode = 'default' | 'mute' | 'neutral' | 'info' | 'success' | 'warning' | 'danger'
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
9
9
|
as?: string
|
|
10
10
|
size?: Size
|
|
11
11
|
type?: Type
|
|
12
|
-
mode?:
|
|
12
|
+
mode?: ColorMode
|
|
13
13
|
label?: string
|
|
14
14
|
clickable?: boolean
|
|
15
15
|
}>()
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
+
import { type ColorMode } from '../support/Color'
|
|
3
4
|
|
|
4
5
|
export type Size = 'mini' | 'small' | 'medium' | 'large'
|
|
5
|
-
export type Mode = 'default' | 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
6
6
|
|
|
7
7
|
const props = defineProps<{
|
|
8
8
|
as?: string
|
|
9
9
|
size?: Size
|
|
10
|
-
mode?:
|
|
10
|
+
mode?: ColorMode
|
|
11
11
|
label: string
|
|
12
12
|
}>()
|
|
13
13
|
|