@globalbrain/sefirot 2.14.1 → 2.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/SInputAddon.vue +143 -0
- package/lib/components/SInputBase.vue +47 -9
- package/lib/components/SInputCheckbox.vue +10 -2
- package/lib/components/SInputCheckboxes.vue +10 -2
- package/lib/components/SInputDate.vue +11 -2
- package/lib/components/SInputDropdown.vue +26 -8
- package/lib/components/SInputFile.vue +9 -1
- package/lib/components/SInputHMS.vue +9 -1
- package/lib/components/SInputNumber.vue +16 -2
- package/lib/components/SInputRadio.vue +9 -0
- package/lib/components/SInputRadios.vue +9 -1
- package/lib/components/SInputSelect.vue +9 -1
- package/lib/components/SInputSwitch.vue +9 -1
- package/lib/components/SInputSwitches.vue +9 -1
- package/lib/components/SInputText.vue +224 -112
- package/lib/components/SInputTextarea.vue +9 -1
- package/lib/components/SInputYMD.vue +9 -1
- package/lib/composables/Dropdown.ts +66 -1
- package/lib/composables/Flyout.ts +5 -5
- package/lib/styles/variables.css +1 -0
- package/package.json +18 -18
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import IconCaretDown from '@iconify-icons/ph/caret-down-bold'
|
|
3
|
+
import {
|
|
4
|
+
DropdownSection,
|
|
5
|
+
getSelectedOption,
|
|
6
|
+
useManualDropdownPosition
|
|
7
|
+
} from 'sefirot/composables/Dropdown'
|
|
8
|
+
import { useFlyout } from 'sefirot/composables/Flyout'
|
|
9
|
+
import { computed, ref } from 'vue'
|
|
10
|
+
import { isString } from '../support/Utils'
|
|
11
|
+
import SDropdown from './SDropdown.vue'
|
|
12
|
+
import SIcon from './SIcon.vue'
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(defineProps<{
|
|
15
|
+
label?: any
|
|
16
|
+
clickable?: boolean
|
|
17
|
+
dropdown?: DropdownSection[]
|
|
18
|
+
dropdownCaret?: boolean
|
|
19
|
+
dropdowpPosition?: 'top' | 'bottom'
|
|
20
|
+
disabled?: boolean
|
|
21
|
+
}>(), {
|
|
22
|
+
clickable: true,
|
|
23
|
+
dropdown: () => [],
|
|
24
|
+
dropdownCaret: true
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const emit = defineEmits<{
|
|
28
|
+
(e: 'click'): void
|
|
29
|
+
}>()
|
|
30
|
+
|
|
31
|
+
const container = ref<any>(null)
|
|
32
|
+
|
|
33
|
+
const isFocused = ref(false)
|
|
34
|
+
|
|
35
|
+
const classes = computed(() => [
|
|
36
|
+
{ clickable: props.clickable },
|
|
37
|
+
{ focused: isFocused.value },
|
|
38
|
+
{ disabled: props.disabled }
|
|
39
|
+
])
|
|
40
|
+
|
|
41
|
+
const selectedOptionLabel = computed(() => {
|
|
42
|
+
return getSelectedOption(props.dropdown)?.label ?? null
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const { isOpen, open } = useFlyout(container)
|
|
46
|
+
const { position, update: updatePosition } = useManualDropdownPosition(container)
|
|
47
|
+
|
|
48
|
+
function handleFocus() {
|
|
49
|
+
if (!props.disabled) {
|
|
50
|
+
isFocused.value = true
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function handleBlur() {
|
|
55
|
+
if (!props.disabled) {
|
|
56
|
+
isFocused.value = false
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function handleClickButton() {
|
|
61
|
+
if (!props.disabled) {
|
|
62
|
+
emit('click')
|
|
63
|
+
|
|
64
|
+
if (props.dropdown.length) {
|
|
65
|
+
updatePosition()
|
|
66
|
+
open()
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<template>
|
|
73
|
+
<div class="SInputAddon" :class="classes" ref="container" @click.stop>
|
|
74
|
+
<component
|
|
75
|
+
:is="clickable ? 'button' : 'div'"
|
|
76
|
+
class="action"
|
|
77
|
+
:disabled="clickable ? props.disabled : null"
|
|
78
|
+
@focus="handleFocus"
|
|
79
|
+
@blur="handleBlur"
|
|
80
|
+
@click="handleClickButton"
|
|
81
|
+
>
|
|
82
|
+
<span class="action-label">
|
|
83
|
+
<SIcon
|
|
84
|
+
v-if="props.label && !isString(props.label)"
|
|
85
|
+
class="action-icon"
|
|
86
|
+
:icon="props.label"
|
|
87
|
+
/>
|
|
88
|
+
<span v-else>
|
|
89
|
+
{{ props.label ?? selectedOptionLabel }}
|
|
90
|
+
</span>
|
|
91
|
+
</span>
|
|
92
|
+
|
|
93
|
+
<SIcon
|
|
94
|
+
v-if="props.dropdown.length && props.dropdownCaret"
|
|
95
|
+
class="caret"
|
|
96
|
+
:icon="IconCaretDown"
|
|
97
|
+
/>
|
|
98
|
+
</component>
|
|
99
|
+
|
|
100
|
+
<div v-if="isOpen" class="dialog" :class="position">
|
|
101
|
+
<SDropdown :sections="dropdown" />
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</template>
|
|
105
|
+
|
|
106
|
+
<style scoped lang="postcss">
|
|
107
|
+
.SInputAddon {
|
|
108
|
+
position: relative;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.action {
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
height: 100%;
|
|
115
|
+
background-color: var(--button-fill-mute-bg-color);
|
|
116
|
+
transition: background-color 0.25s;
|
|
117
|
+
|
|
118
|
+
.SInputAddon.clickable &:hover,
|
|
119
|
+
.SInputAddon.clickable.focused & {
|
|
120
|
+
background-color: var(--button-fill-mute-hover-bg-color);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.SInputAddon.clickable &:active {
|
|
124
|
+
background-color: var(--button-fill-mute-active-bg-color);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.SInputAddon.disabled &,
|
|
128
|
+
.SInputAddon.disabled.clickable &:hover,
|
|
129
|
+
.SInputAddon.disabled.clickable &:active,
|
|
130
|
+
.SInputAddon.disabled.clickable.focused & {
|
|
131
|
+
background-color: var(--button-fill-mute-bg-color);
|
|
132
|
+
cursor: not-allowed;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.dialog {
|
|
137
|
+
position: absolute;
|
|
138
|
+
z-index: var(--z-index-dropdown);
|
|
139
|
+
|
|
140
|
+
&.top { bottom: calc(100% + 8px); }
|
|
141
|
+
&.bottom { top: calc(100% + 8px); }
|
|
142
|
+
}
|
|
143
|
+
</style>
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import IconQuestion from '@iconify-icons/ph/question'
|
|
3
|
-
import {
|
|
3
|
+
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
4
|
+
import { DefineComponent, computed, unref, useSlots } from 'vue'
|
|
4
5
|
import { Validatable } from '../composables/Validation'
|
|
5
6
|
import SIcon from './SIcon.vue'
|
|
6
7
|
import STooltip from './STooltip.vue'
|
|
7
8
|
|
|
9
|
+
type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
10
|
+
|
|
8
11
|
const props = defineProps<{
|
|
9
12
|
name?: string
|
|
10
13
|
label?: string
|
|
11
14
|
info?: string
|
|
12
15
|
note?: string
|
|
13
16
|
help?: string
|
|
14
|
-
|
|
17
|
+
checkIcon?: IconifyIcon | DefineComponent
|
|
18
|
+
checkText?: string
|
|
19
|
+
checkColor?: Color
|
|
15
20
|
validation?: Validatable
|
|
21
|
+
hideError?: boolean
|
|
16
22
|
}>()
|
|
17
23
|
|
|
18
24
|
const slots = useSlots()
|
|
@@ -63,6 +69,11 @@ function getErrorMsg(validation: Validatable) {
|
|
|
63
69
|
</div>
|
|
64
70
|
|
|
65
71
|
<span class="label-note">{{ note }}</span>
|
|
72
|
+
|
|
73
|
+
<span v-if="checkIcon || checkText" class="check" :class="checkColor || 'neutral'">
|
|
74
|
+
<SIcon v-if="checkIcon" class="check-icon" :icon="checkIcon" />
|
|
75
|
+
<span v-if="checkText" class="check-text">{{ checkText }}</span>
|
|
76
|
+
</span>
|
|
66
77
|
</label>
|
|
67
78
|
|
|
68
79
|
<slot />
|
|
@@ -75,7 +86,7 @@ function getErrorMsg(validation: Validatable) {
|
|
|
75
86
|
</div>
|
|
76
87
|
</template>
|
|
77
88
|
|
|
78
|
-
<style lang="postcss"
|
|
89
|
+
<style scoped lang="postcss">
|
|
79
90
|
.SInputBase.mini {
|
|
80
91
|
.label { padding-bottom: 6px; }
|
|
81
92
|
.label-text-value { font-size: 12px; }
|
|
@@ -83,15 +94,15 @@ function getErrorMsg(validation: Validatable) {
|
|
|
83
94
|
}
|
|
84
95
|
|
|
85
96
|
.SInputBase.small {
|
|
86
|
-
.label
|
|
87
|
-
.label-text-value
|
|
88
|
-
.label-note
|
|
97
|
+
.label { padding-bottom: 8px; }
|
|
98
|
+
.label-text-value { font-size: 14px; }
|
|
99
|
+
.label-note, .check { transform: translateY(1px); }
|
|
89
100
|
}
|
|
90
101
|
|
|
91
102
|
.SInputBase.medium {
|
|
92
|
-
.label
|
|
93
|
-
.label-text-value
|
|
94
|
-
.label-note
|
|
103
|
+
.label { padding-bottom: 8px; }
|
|
104
|
+
.label-text-value { font-size: 14px; }
|
|
105
|
+
.label-note, .check { transform: translateY(1px); }
|
|
95
106
|
}
|
|
96
107
|
|
|
97
108
|
.SInputBase.has-error {
|
|
@@ -168,4 +179,31 @@ function getErrorMsg(validation: Validatable) {
|
|
|
168
179
|
.help-text + .help-text {
|
|
169
180
|
padding: 0;
|
|
170
181
|
}
|
|
182
|
+
|
|
183
|
+
.check {
|
|
184
|
+
display: inline-flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
gap: 4px;
|
|
187
|
+
margin-left: auto;
|
|
188
|
+
line-height: 16px;
|
|
189
|
+
font-size: 12px;
|
|
190
|
+
|
|
191
|
+
&.neutral { color: var(--c-text-1); }
|
|
192
|
+
&.mute { color: var(--c-text-2); }
|
|
193
|
+
&.info { color: var(--c-info-text); }
|
|
194
|
+
&.success { color: var(--c-success-text); }
|
|
195
|
+
&.warning { color: var(--c-warning-text); }
|
|
196
|
+
&.danger { color: var(--c-danger-text); }
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.check-icon {
|
|
200
|
+
width: 14px;
|
|
201
|
+
height: 14px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.check-icon.SSpinner {
|
|
205
|
+
margin: -4px;
|
|
206
|
+
width: 24px;
|
|
207
|
+
height: 24px;
|
|
208
|
+
}
|
|
171
209
|
</style>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import IconCheck from '@iconify-icons/ph/check'
|
|
3
|
-
import {
|
|
3
|
+
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
4
|
+
import { DefineComponent, PropType } from 'vue'
|
|
4
5
|
import { Validatable } from '../composables/Validation'
|
|
5
6
|
import SIcon from './SIcon.vue'
|
|
6
7
|
import SInputBase from './SInputBase.vue'
|
|
7
8
|
|
|
8
|
-
type Size = 'mini' | 'small' | 'medium'
|
|
9
|
+
export type Size = 'mini' | 'small' | 'medium'
|
|
10
|
+
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
9
11
|
|
|
10
12
|
const props = defineProps({
|
|
11
13
|
size: { type: String as PropType<Size>, default: 'small' },
|
|
@@ -13,6 +15,9 @@ const props = defineProps({
|
|
|
13
15
|
info: { type: String, default: null },
|
|
14
16
|
note: { type: String, default: null },
|
|
15
17
|
help: { type: String, default: null },
|
|
18
|
+
checkIcon: { type: Object as PropType<IconifyIcon | DefineComponent>, default: null },
|
|
19
|
+
checkText: { type: String, default: null },
|
|
20
|
+
checkColor: { type: String as PropType<Color>, default: null },
|
|
16
21
|
text: { type: String, required: true },
|
|
17
22
|
modelValue: { type: Boolean, required: true },
|
|
18
23
|
validation: { type: Object as PropType<Validatable>, default: null }
|
|
@@ -33,6 +38,9 @@ function emitChange() {
|
|
|
33
38
|
:note="note"
|
|
34
39
|
:info="info"
|
|
35
40
|
:help="help"
|
|
41
|
+
:check-icon="checkIcon"
|
|
42
|
+
:check-text="checkText"
|
|
43
|
+
:check-color="checkColor"
|
|
36
44
|
:validation="validation"
|
|
37
45
|
>
|
|
38
46
|
<div class="container">
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
+
import { DefineComponent, PropType } from 'vue'
|
|
3
4
|
import SInputBase from './SInputBase.vue'
|
|
4
5
|
import SInputCheckbox from './SInputCheckbox.vue'
|
|
5
6
|
|
|
6
|
-
type Size = 'mini' | 'small' | 'medium'
|
|
7
|
+
export type Size = 'mini' | 'small' | 'medium'
|
|
8
|
+
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
7
9
|
|
|
8
10
|
interface CheckboxOption {
|
|
9
11
|
label: string
|
|
@@ -17,6 +19,9 @@ const props = defineProps({
|
|
|
17
19
|
info: { type: String, default: null },
|
|
18
20
|
note: { type: String, default: null },
|
|
19
21
|
help: { type: String, default: null },
|
|
22
|
+
checkIcon: { type: Object as PropType<IconifyIcon | DefineComponent>, default: null },
|
|
23
|
+
checkText: { type: String, default: null },
|
|
24
|
+
checkColor: { type: String as PropType<Color>, default: null },
|
|
20
25
|
options: { type: Array as PropType<CheckboxOption[]>, required: true },
|
|
21
26
|
modelValue: { type: Array, required: true }
|
|
22
27
|
})
|
|
@@ -45,6 +50,9 @@ function handleChange(value: unknown): void {
|
|
|
45
50
|
:note="note"
|
|
46
51
|
:info="info"
|
|
47
52
|
:help="help"
|
|
53
|
+
:check-icon="checkIcon"
|
|
54
|
+
:check-text="checkText"
|
|
55
|
+
:check-color="checkColor"
|
|
48
56
|
>
|
|
49
57
|
<div class="container">
|
|
50
58
|
<div class="row">
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
2
3
|
import { DatePicker } from 'v-calendar'
|
|
3
|
-
import { computed } from 'vue'
|
|
4
|
+
import { DefineComponent, computed } from 'vue'
|
|
4
5
|
import { Validatable } from '../composables/Validation'
|
|
5
6
|
import { Day, day } from '../support/Day'
|
|
6
7
|
import SInputBase from './SInputBase.vue'
|
|
7
8
|
|
|
9
|
+
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
10
|
+
|
|
8
11
|
const props = defineProps<{
|
|
9
12
|
name?: string
|
|
10
13
|
label?: string
|
|
11
14
|
info?: string
|
|
12
15
|
note?: string
|
|
13
16
|
help?: string
|
|
14
|
-
|
|
17
|
+
checkIcon?: IconifyIcon | DefineComponent
|
|
18
|
+
checkText?: string
|
|
19
|
+
checkColor?: Color
|
|
15
20
|
modelValue: Day | null
|
|
16
21
|
validation?: Validatable
|
|
22
|
+
hideError?: boolean
|
|
17
23
|
}>()
|
|
18
24
|
|
|
19
25
|
const emit = defineEmits<{
|
|
@@ -45,6 +51,9 @@ function emitBlur() {
|
|
|
45
51
|
:note="note"
|
|
46
52
|
:info="info"
|
|
47
53
|
:help="help"
|
|
54
|
+
:check-icon="checkIcon"
|
|
55
|
+
:check-text="checkText"
|
|
56
|
+
:check-color="checkColor"
|
|
48
57
|
:hide-error="hideError"
|
|
49
58
|
:validation="validation"
|
|
50
59
|
>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import IconCaretDown from '@iconify-icons/ph/caret-down-bold'
|
|
3
3
|
import IconCaretUp from '@iconify-icons/ph/caret-up-bold'
|
|
4
|
+
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
4
5
|
import xor from 'lodash-es/xor'
|
|
5
|
-
import { computed } from 'vue'
|
|
6
|
-
import { DropdownSectionFilter } from '../composables/Dropdown'
|
|
6
|
+
import { DefineComponent, computed, ref } from 'vue'
|
|
7
|
+
import { DropdownSectionFilter, useManualDropdownPosition } from '../composables/Dropdown'
|
|
7
8
|
import { useFlyout } from '../composables/Flyout'
|
|
8
9
|
import { Validatable } from '../composables/Validation'
|
|
9
10
|
import { isArray } from '../support/Utils'
|
|
@@ -13,6 +14,8 @@ import SInputBase from './SInputBase.vue'
|
|
|
13
14
|
import SInputDropdownItem from './SInputDropdownItem.vue'
|
|
14
15
|
|
|
15
16
|
export type Size = 'mini' | 'small' | 'medium'
|
|
17
|
+
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
18
|
+
|
|
16
19
|
export type PrimitiveValue = string | number | boolean | null
|
|
17
20
|
export type ArrayValue = (string | number | boolean)[]
|
|
18
21
|
export type OptionValue = string | number | boolean
|
|
@@ -42,10 +45,14 @@ const props = defineProps<{
|
|
|
42
45
|
note?: string
|
|
43
46
|
help?: string
|
|
44
47
|
placeholder?: string
|
|
48
|
+
checkIcon?: IconifyIcon | DefineComponent
|
|
49
|
+
checkText?: string
|
|
50
|
+
checkColor?: Color
|
|
51
|
+
options: Option[]
|
|
52
|
+
position?: 'top' | 'bottom'
|
|
45
53
|
noSearch?: boolean
|
|
46
54
|
nullable?: boolean
|
|
47
55
|
closeOnClick?: boolean
|
|
48
|
-
options: Option[]
|
|
49
56
|
disabled?: boolean
|
|
50
57
|
modelValue: PrimitiveValue | ArrayValue
|
|
51
58
|
validation?: Validatable
|
|
@@ -55,7 +62,10 @@ const emit = defineEmits<{
|
|
|
55
62
|
(e: 'update:modelValue', value: PrimitiveValue | ArrayValue): void
|
|
56
63
|
}>()
|
|
57
64
|
|
|
58
|
-
const
|
|
65
|
+
const container = ref<any>(null)
|
|
66
|
+
|
|
67
|
+
const { isOpen, open } = useFlyout(container)
|
|
68
|
+
const { position, update: updatePosition } = useManualDropdownPosition(container)
|
|
59
69
|
|
|
60
70
|
const classes = computed(() => [
|
|
61
71
|
props.size ?? 'small',
|
|
@@ -93,7 +103,10 @@ const removable = computed(() => {
|
|
|
93
103
|
})
|
|
94
104
|
|
|
95
105
|
async function handleOpen() {
|
|
96
|
-
!props.disabled
|
|
106
|
+
if (!props.disabled) {
|
|
107
|
+
updatePosition()
|
|
108
|
+
open()
|
|
109
|
+
}
|
|
97
110
|
}
|
|
98
111
|
|
|
99
112
|
function handleSelect(value: OptionValue) {
|
|
@@ -131,6 +144,9 @@ function handleArray(value: OptionValue) {
|
|
|
131
144
|
:note="note"
|
|
132
145
|
:info="info"
|
|
133
146
|
:help="help"
|
|
147
|
+
:check-icon="checkIcon"
|
|
148
|
+
:check-text="checkText"
|
|
149
|
+
:check-color="checkColor"
|
|
134
150
|
:validation="validation"
|
|
135
151
|
>
|
|
136
152
|
<div class="container" ref="container">
|
|
@@ -161,7 +177,7 @@ function handleArray(value: OptionValue) {
|
|
|
161
177
|
</div>
|
|
162
178
|
</div>
|
|
163
179
|
|
|
164
|
-
<div v-if="isOpen" class="dropdown">
|
|
180
|
+
<div v-if="isOpen" class="dropdown" :class="position">
|
|
165
181
|
<SDropdown :sections="dropdownOptions" />
|
|
166
182
|
</div>
|
|
167
183
|
</div>
|
|
@@ -169,7 +185,7 @@ function handleArray(value: OptionValue) {
|
|
|
169
185
|
</SInputBase>
|
|
170
186
|
</template>
|
|
171
187
|
|
|
172
|
-
<style lang="postcss"
|
|
188
|
+
<style scoped lang="postcss">
|
|
173
189
|
.SInputDropdown.mini {
|
|
174
190
|
.box {
|
|
175
191
|
min-height: 32px;
|
|
@@ -301,8 +317,10 @@ function handleArray(value: OptionValue) {
|
|
|
301
317
|
|
|
302
318
|
.dropdown {
|
|
303
319
|
position: absolute;
|
|
304
|
-
top: calc(100% + 8px);
|
|
305
320
|
left: 0;
|
|
306
321
|
z-index: var(--z-index-dropdown);
|
|
322
|
+
|
|
323
|
+
&.top { bottom: calc(100% + 8px); }
|
|
324
|
+
&.bottom { top: calc(100% + 8px); }
|
|
307
325
|
}
|
|
308
326
|
</style>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
+
import { DefineComponent, computed, ref } from 'vue'
|
|
3
4
|
import { Validatable } from '../composables/Validation'
|
|
4
5
|
import SInputBase from './SInputBase.vue'
|
|
5
6
|
|
|
6
7
|
export type Size = 'mini' | 'small' | 'medium'
|
|
8
|
+
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
7
9
|
|
|
8
10
|
const props = defineProps<{
|
|
9
11
|
size?: Size
|
|
@@ -13,6 +15,9 @@ const props = defineProps<{
|
|
|
13
15
|
help?: string
|
|
14
16
|
text?: string
|
|
15
17
|
placeholder?: string
|
|
18
|
+
checkIcon?: IconifyIcon | DefineComponent
|
|
19
|
+
checkText?: string
|
|
20
|
+
checkColor?: Color
|
|
16
21
|
value?: File | null
|
|
17
22
|
modelValue?: File | null
|
|
18
23
|
hideError?: boolean
|
|
@@ -59,6 +64,9 @@ function onChange(e: Event) {
|
|
|
59
64
|
:note="note"
|
|
60
65
|
:info="info"
|
|
61
66
|
:help="help"
|
|
67
|
+
:check-icon="checkIcon"
|
|
68
|
+
:check-text="checkText"
|
|
69
|
+
:check-color="checkColor"
|
|
62
70
|
:validation="validation"
|
|
63
71
|
:hide-error="hideError"
|
|
64
72
|
>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
+
import { DefineComponent, ref } from 'vue'
|
|
3
4
|
import { Validatable } from '../composables/Validation'
|
|
4
5
|
import SInputBase from './SInputBase.vue'
|
|
5
6
|
|
|
6
7
|
export type Size = 'mini' | 'small' | 'medium'
|
|
8
|
+
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
7
9
|
|
|
8
10
|
export interface Value {
|
|
9
11
|
hour: string | null
|
|
@@ -19,6 +21,9 @@ const props = defineProps<{
|
|
|
19
21
|
info?: string
|
|
20
22
|
note?: string
|
|
21
23
|
help?: string
|
|
24
|
+
checkIcon?: IconifyIcon | DefineComponent
|
|
25
|
+
checkText?: string
|
|
26
|
+
checkColor?: Color
|
|
22
27
|
noHour?: boolean
|
|
23
28
|
noMinute?: boolean
|
|
24
29
|
noSecond?: boolean
|
|
@@ -114,6 +119,9 @@ function createRequiredTouched(): boolean[] {
|
|
|
114
119
|
:note="note"
|
|
115
120
|
:info="info"
|
|
116
121
|
:help="help"
|
|
122
|
+
:check-icon="checkIcon"
|
|
123
|
+
:check-text="checkText"
|
|
124
|
+
:check-color="checkColor"
|
|
117
125
|
:hide-error="hideError"
|
|
118
126
|
:validation="validation"
|
|
119
127
|
>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
+
import { DefineComponent, computed } from 'vue'
|
|
3
4
|
import { Validatable } from '../composables/Validation'
|
|
4
5
|
import { isNullish } from '../support/Utils'
|
|
5
6
|
import SInputText from './SInputText.vue'
|
|
6
7
|
|
|
7
8
|
export type Size = 'mini' | 'small' | 'medium'
|
|
8
9
|
export type Align = 'left' | 'center' | 'right'
|
|
10
|
+
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
9
11
|
|
|
10
12
|
const props = defineProps<{
|
|
11
13
|
size?: Size
|
|
@@ -15,6 +17,11 @@ const props = defineProps<{
|
|
|
15
17
|
note?: string
|
|
16
18
|
help?: string
|
|
17
19
|
placeholder?: string
|
|
20
|
+
unitBefore?: string
|
|
21
|
+
unitAfter?: string
|
|
22
|
+
checkIcon?: IconifyIcon | DefineComponent
|
|
23
|
+
checkText?: string
|
|
24
|
+
checkColor?: Color
|
|
18
25
|
align?: Align
|
|
19
26
|
separator?: boolean
|
|
20
27
|
disabled?: boolean
|
|
@@ -73,8 +80,13 @@ function emitUpdate(value: string | null) {
|
|
|
73
80
|
:note="note"
|
|
74
81
|
:info="info"
|
|
75
82
|
:help="help"
|
|
76
|
-
:align="align"
|
|
77
83
|
:placeholder="placeholder"
|
|
84
|
+
:unit-before="unitBefore"
|
|
85
|
+
:unit-after="unitAfter"
|
|
86
|
+
:check-icon="checkIcon"
|
|
87
|
+
:check-text="checkText"
|
|
88
|
+
:check-color="checkColor"
|
|
89
|
+
:align="align"
|
|
78
90
|
:disabled="disabled"
|
|
79
91
|
:hide-error="hideError"
|
|
80
92
|
:display-value="displayValue"
|
|
@@ -84,5 +96,7 @@ function emitUpdate(value: string | null) {
|
|
|
84
96
|
@input="emitUpdate"
|
|
85
97
|
>
|
|
86
98
|
<template v-if="$slots.info" #info><slot name="info" /></template>
|
|
99
|
+
<template v-if="$slots['addon-before']" #addon-before><slot name="addon-before" /></template>
|
|
100
|
+
<template v-if="$slots['addon-after']" #addon-after><slot name="addon-after" /></template>
|
|
87
101
|
</SInputText>
|
|
88
102
|
</template>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
+
import { DefineComponent } from 'vue'
|
|
2
4
|
import { Validatable } from '../composables/Validation'
|
|
3
5
|
import SInputBase from './SInputBase.vue'
|
|
4
6
|
|
|
5
7
|
export type Size = 'mini' | 'small' | 'medium'
|
|
8
|
+
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
6
9
|
|
|
7
10
|
const props = defineProps<{
|
|
8
11
|
size?: Size
|
|
@@ -11,6 +14,9 @@ const props = defineProps<{
|
|
|
11
14
|
info?: string
|
|
12
15
|
note?: string
|
|
13
16
|
help?: string
|
|
17
|
+
checkIcon?: IconifyIcon | DefineComponent
|
|
18
|
+
checkText?: string
|
|
19
|
+
checkColor?: Color
|
|
14
20
|
text: string
|
|
15
21
|
modelValue: boolean
|
|
16
22
|
validation?: Validatable
|
|
@@ -36,6 +42,9 @@ function onClick() {
|
|
|
36
42
|
:note="note"
|
|
37
43
|
:info="info"
|
|
38
44
|
:help="help"
|
|
45
|
+
:check-icon="checkIcon"
|
|
46
|
+
:check-text="checkText"
|
|
47
|
+
:check-color="checkColor"
|
|
39
48
|
:validation="validation"
|
|
40
49
|
:hide-error="hideError"
|
|
41
50
|
>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
+
import { DefineComponent, computed } from 'vue'
|
|
3
4
|
import { Validatable } from '../composables/Validation'
|
|
4
5
|
import SInputBase from './SInputBase.vue'
|
|
5
6
|
import SInputRadio from './SInputRadio.vue'
|
|
6
7
|
|
|
7
8
|
export type Size = 'mini' | 'small' | 'medium'
|
|
9
|
+
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
8
10
|
|
|
9
11
|
export interface Option {
|
|
10
12
|
label: string
|
|
@@ -18,6 +20,9 @@ const props = withDefaults(defineProps<{
|
|
|
18
20
|
info?: string
|
|
19
21
|
note?: string
|
|
20
22
|
help?: string
|
|
23
|
+
checkIcon?: IconifyIcon | DefineComponent
|
|
24
|
+
checkText?: string
|
|
25
|
+
checkColor?: Color
|
|
21
26
|
options: Option[]
|
|
22
27
|
nullable?: boolean
|
|
23
28
|
value?: string | number | boolean | null
|
|
@@ -75,6 +80,9 @@ function onChange(value: string | number | boolean) {
|
|
|
75
80
|
:note="note"
|
|
76
81
|
:info="info"
|
|
77
82
|
:help="help"
|
|
83
|
+
:check-icon="checkIcon"
|
|
84
|
+
:check-text="checkText"
|
|
85
|
+
:check-color="checkColor"
|
|
78
86
|
:hide-error="hideError"
|
|
79
87
|
:validation="validation"
|
|
80
88
|
>
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import IconCaretDown from '@iconify-icons/ph/caret-down-bold'
|
|
3
3
|
import IconCaretUp from '@iconify-icons/ph/caret-up-bold'
|
|
4
|
-
import {
|
|
4
|
+
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
5
|
+
import { DefineComponent, computed, ref } from 'vue'
|
|
5
6
|
import { Validatable } from '../composables/Validation'
|
|
6
7
|
import SIcon from './SIcon.vue'
|
|
7
8
|
import SInputBase from './SInputBase.vue'
|
|
8
9
|
|
|
9
10
|
export type Size = 'mini' | 'small' | 'medium'
|
|
11
|
+
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
10
12
|
export type Value = string | number | boolean | null
|
|
11
13
|
|
|
12
14
|
export interface Option {
|
|
@@ -22,6 +24,9 @@ const props = withDefaults(defineProps<{
|
|
|
22
24
|
note?: string
|
|
23
25
|
help?: string
|
|
24
26
|
placeholder?: string
|
|
27
|
+
checkIcon?: IconifyIcon | DefineComponent
|
|
28
|
+
checkText?: string
|
|
29
|
+
checkColor?: Color
|
|
25
30
|
options: Option[]
|
|
26
31
|
nullable?: boolean
|
|
27
32
|
disabled?: boolean
|
|
@@ -81,6 +86,9 @@ function emitChange(e: any): void {
|
|
|
81
86
|
:note="note"
|
|
82
87
|
:info="info"
|
|
83
88
|
:help="help"
|
|
89
|
+
:check-icon="checkIcon"
|
|
90
|
+
:check-text="checkText"
|
|
91
|
+
:check-color="checkColor"
|
|
84
92
|
:hide-error="hideError"
|
|
85
93
|
:validation="validation"
|
|
86
94
|
>
|