@globalbrain/sefirot 3.49.0 → 4.0.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/config/nuxt.d.ts +4 -0
- package/config/nuxt.js +31 -0
- package/config/vite.d.ts +8 -0
- package/config/vite.js +69 -0
- package/lib/components/SActionList.vue +0 -1
- package/lib/components/SActionListItem.vue +3 -11
- package/lib/components/SAlert.vue +8 -13
- package/lib/components/SButton.vue +9 -10
- package/lib/components/SCardBlock.vue +0 -6
- package/lib/components/SControlActionBarClose.vue +1 -1
- package/lib/components/SControlActionBarCollapse.vue +2 -2
- package/lib/components/SControlInputSearch.vue +2 -2
- package/lib/components/SDescAvatar.vue +1 -2
- package/lib/components/SDescFile.vue +4 -6
- package/lib/components/SDescPill.vue +1 -2
- package/lib/components/SDescText.vue +1 -1
- package/lib/components/SDropdownSectionDateRange.vue +2 -2
- package/lib/components/SDropdownSectionDateRangeDateFromTo.vue +2 -2
- package/lib/components/SDropdownSectionDateRangeYear.vue +2 -2
- package/lib/components/SDropdownSectionDateRangeYearHalf.vue +2 -2
- package/lib/components/SDropdownSectionDateRangeYearQuarter.vue +2 -2
- package/lib/components/SDropdownSectionFilter.vue +4 -6
- package/lib/components/SIndicator.vue +10 -16
- package/lib/components/SInputAddon.vue +6 -8
- package/lib/components/SInputBase.vue +6 -8
- package/lib/components/SInputCheckbox.vue +7 -11
- package/lib/components/SInputCheckboxes.vue +3 -4
- package/lib/components/SInputDate.vue +3 -4
- package/lib/components/SInputDropdown.vue +10 -13
- package/lib/components/SInputDropdownItemAvatar.vue +2 -3
- package/lib/components/SInputDropdownItemText.vue +2 -3
- package/lib/components/SInputFile.vue +3 -4
- package/lib/components/SInputHMS.vue +4 -5
- package/lib/components/SInputImage.vue +5 -7
- package/lib/components/SInputNumber.vue +10 -11
- package/lib/components/SInputRadio.vue +3 -4
- package/lib/components/SInputRadios.vue +3 -4
- package/lib/components/SInputSegments.vue +3 -4
- package/lib/components/SInputSelect.vue +7 -9
- package/lib/components/SInputSwitch.vue +3 -4
- package/lib/components/SInputSwitches.vue +3 -4
- package/lib/components/SInputText.vue +7 -9
- package/lib/components/SInputTextarea.vue +3 -4
- package/lib/components/SInputYMD.vue +4 -5
- package/lib/components/SLink.vue +1 -1
- package/lib/components/SLocalNavMenu.vue +3 -4
- package/lib/components/SLoginPage.vue +79 -22
- package/lib/components/SLoginPagePasswordDialog.vue +95 -0
- package/lib/components/SPagination.vue +2 -2
- package/lib/components/SPill.vue +1 -5
- package/lib/components/SSnackbar.vue +2 -3
- package/lib/components/SStep.vue +4 -5
- package/lib/components/STable.vue +1 -2
- package/lib/components/STableCell.vue +5 -13
- package/lib/components/STableCellAvatar.vue +10 -27
- package/lib/components/STableCellAvatars.vue +6 -19
- package/lib/components/STableCellDay.vue +4 -11
- package/lib/components/STableCellNumber.vue +8 -9
- package/lib/components/STableCellPill.vue +5 -33
- package/lib/components/STableCellPills.vue +4 -14
- package/lib/components/STableCellState.vue +3 -3
- package/lib/components/STableCellText.vue +22 -50
- package/lib/components/STableColumn.vue +4 -6
- package/lib/components/STableFooter.vue +4 -5
- package/lib/components/STableHeader.vue +2 -19
- package/lib/components/STableHeaderMenu.vue +1 -2
- package/lib/components/STableHeaderMenuItem.vue +2 -3
- package/lib/components/STableItem.vue +1 -1
- package/lib/composables/Data.ts +8 -102
- package/lib/composables/Error.ts +3 -3
- package/lib/composables/Table.ts +17 -22
- package/lib/composables/Utils.ts +2 -2
- package/lib/composables/Validation.ts +76 -14
- package/lib/http/Http.ts +27 -10
- package/lib/mixins/Card.ts +0 -27
- package/lib/mixins/Fundamental.ts +0 -3
- package/lib/support/Day.ts +5 -5
- package/lib/support/Utils.ts +35 -14
- package/lib/validation/validators/maxLength.ts +2 -2
- package/lib/validation/validators/maxValue.ts +2 -2
- package/lib/validation/validators/minLength.ts +2 -2
- package/lib/validation/validators/minValue.ts +2 -2
- package/lib/validation/validators/required.ts +4 -4
- package/package.json +40 -40
- package/lib/components/SCardFooter.vue +0 -22
- package/lib/components/SCardFooterAction.vue +0 -31
- package/lib/components/SCardFooterActions.vue +0 -18
- package/lib/components/SCardHeader.vue +0 -15
- package/lib/components/SCardHeaderAction.vue +0 -28
- package/lib/components/SCardHeaderActionClose.vue +0 -27
- package/lib/components/SCardHeaderActionCollapse.vue +0 -47
- package/lib/components/SCardHeaderActions.vue +0 -13
- package/lib/components/SCardHeaderTitle.vue +0 -29
- package/lib/components/SIcon.vue +0 -13
- package/lib/components/SSheet.vue +0 -87
- package/lib/components/SSheetFooter.vue +0 -16
- package/lib/components/SSheetFooterAction.vue +0 -34
- package/lib/components/SSheetFooterActions.vue +0 -14
- package/lib/components/SSheetForm.vue +0 -15
- package/lib/components/SSheetMedium.vue +0 -72
- package/lib/components/SSheetTitle.vue +0 -13
- package/lib/components/STableHeaderActions.vue +0 -20
- package/lib/composables/D.ts +0 -21
- package/lib/composables/Form.ts +0 -109
- package/lib/composables/V.ts +0 -97
- package/lib/mixins/Sheet.ts +0 -30
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import
|
|
4
|
-
import IconMinus from '@iconify-icons/ph/minus-bold'
|
|
5
|
-
import { computed } from 'vue'
|
|
6
|
-
import { type Validatable } from '../composables/V'
|
|
7
|
-
import SIcon from './SIcon.vue'
|
|
2
|
+
import { type Component, computed } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
8
4
|
import SInputBase from './SInputBase.vue'
|
|
5
|
+
import IconCheck from '~icons/ph/check-bold'
|
|
6
|
+
import IconMinus from '~icons/ph/minus-bold'
|
|
9
7
|
|
|
10
8
|
export type Size = 'mini' | 'small' | 'medium'
|
|
11
9
|
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
@@ -16,7 +14,7 @@ const props = withDefaults(defineProps<{
|
|
|
16
14
|
info?: string
|
|
17
15
|
note?: string
|
|
18
16
|
help?: string
|
|
19
|
-
checkIcon?:
|
|
17
|
+
checkIcon?: Component
|
|
20
18
|
checkText?: string
|
|
21
19
|
checkColor?: Color
|
|
22
20
|
text?: string
|
|
@@ -81,10 +79,8 @@ function onClick() {
|
|
|
81
79
|
>
|
|
82
80
|
<div class="box">
|
|
83
81
|
<div class="check">
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
class="check-icon"
|
|
87
|
-
/>
|
|
82
|
+
<IconMinus v-if="isIndeterminate" class="check-icon" />
|
|
83
|
+
<IconCheck v-else class="check-icon" />
|
|
88
84
|
</div>
|
|
89
85
|
</div>
|
|
90
86
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import {
|
|
4
|
-
import { type Validatable } from '../composables/V'
|
|
2
|
+
import { type Component, computed } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
5
4
|
import SInputBase from './SInputBase.vue'
|
|
6
5
|
import SInputCheckbox from './SInputCheckbox.vue'
|
|
7
6
|
|
|
@@ -23,7 +22,7 @@ const props = withDefaults(defineProps<{
|
|
|
23
22
|
info?: string
|
|
24
23
|
note?: string
|
|
25
24
|
help?: string
|
|
26
|
-
checkIcon?:
|
|
25
|
+
checkIcon?: Component
|
|
27
26
|
checkText?: string
|
|
28
27
|
checkColor?: Color
|
|
29
28
|
options: Option[]
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
2
|
import { DatePicker } from 'v-calendar'
|
|
4
|
-
import { computed } from 'vue'
|
|
5
|
-
import { type Validatable } from '../composables/
|
|
3
|
+
import { type Component, computed } from 'vue'
|
|
4
|
+
import { type Validatable } from '../composables/Validation'
|
|
6
5
|
import { type Day, day } from '../support/Day'
|
|
7
6
|
import SInputBase from './SInputBase.vue'
|
|
8
7
|
|
|
@@ -16,7 +15,7 @@ const props = defineProps<{
|
|
|
16
15
|
info?: string
|
|
17
16
|
note?: string
|
|
18
17
|
help?: string
|
|
19
|
-
checkIcon?:
|
|
18
|
+
checkIcon?: Component
|
|
20
19
|
checkText?: string
|
|
21
20
|
checkColor?: Color
|
|
22
21
|
block?: boolean
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
-
import IconCaretDown from '@iconify-icons/ph/caret-down-bold'
|
|
4
|
-
import IconCaretUp from '@iconify-icons/ph/caret-up-bold'
|
|
5
2
|
import xor from 'lodash-es/xor'
|
|
6
|
-
import { type
|
|
3
|
+
import { type Component, computed, ref } from 'vue'
|
|
7
4
|
import { type DropdownSectionFilter, useManualDropdownPosition } from '../composables/Dropdown'
|
|
8
5
|
import { useFlyout } from '../composables/Flyout'
|
|
9
|
-
import { type Validatable } from '../composables/
|
|
10
|
-
import { isArray } from '../support/Utils'
|
|
6
|
+
import { type Validatable } from '../composables/Validation'
|
|
11
7
|
import SDropdown from './SDropdown.vue'
|
|
12
|
-
import SIcon from './SIcon.vue'
|
|
13
8
|
import SInputBase from './SInputBase.vue'
|
|
14
9
|
import SInputDropdownItem from './SInputDropdownItem.vue'
|
|
10
|
+
import IconCaretDown from '~icons/ph/caret-down-bold'
|
|
11
|
+
import IconCaretUp from '~icons/ph/caret-up-bold'
|
|
15
12
|
|
|
16
13
|
export type Size = 'mini' | 'small' | 'medium'
|
|
17
14
|
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
@@ -46,7 +43,7 @@ const props = defineProps<{
|
|
|
46
43
|
note?: string
|
|
47
44
|
help?: string
|
|
48
45
|
placeholder?: string
|
|
49
|
-
checkIcon?:
|
|
46
|
+
checkIcon?: Component
|
|
50
47
|
checkText?: string
|
|
51
48
|
checkColor?: Color
|
|
52
49
|
options: Option[]
|
|
@@ -82,7 +79,7 @@ const dropdownOptions = computed<DropdownSectionFilter[]>(() => [{
|
|
|
82
79
|
}])
|
|
83
80
|
|
|
84
81
|
const selected = computed(() => {
|
|
85
|
-
if (isArray(props.modelValue)) {
|
|
82
|
+
if (Array.isArray(props.modelValue)) {
|
|
86
83
|
return props.options.filter((o) => (props.modelValue as ArrayValue).includes(o.value))
|
|
87
84
|
}
|
|
88
85
|
|
|
@@ -96,7 +93,7 @@ const hasSelected = computed(() => {
|
|
|
96
93
|
})
|
|
97
94
|
|
|
98
95
|
const removable = computed(() => {
|
|
99
|
-
if (isArray(props.modelValue)) {
|
|
96
|
+
if (Array.isArray(props.modelValue)) {
|
|
100
97
|
return props.nullable || selected.value.length > 1
|
|
101
98
|
}
|
|
102
99
|
|
|
@@ -113,7 +110,7 @@ async function handleOpen() {
|
|
|
113
110
|
function handleSelect(value: OptionValue) {
|
|
114
111
|
props.validation?.$touch()
|
|
115
112
|
|
|
116
|
-
isArray(props.modelValue) ? handleArray(value) : handlePrimitive(value)
|
|
113
|
+
Array.isArray(props.modelValue) ? handleArray(value) : handlePrimitive(value)
|
|
117
114
|
}
|
|
118
115
|
|
|
119
116
|
function handlePrimitive(value: OptionValue) {
|
|
@@ -174,8 +171,8 @@ function handleArray(value: OptionValue) {
|
|
|
174
171
|
</div>
|
|
175
172
|
|
|
176
173
|
<div class="box-icon">
|
|
177
|
-
<
|
|
178
|
-
<
|
|
174
|
+
<IconCaretUp class="box-icon-svg up" />
|
|
175
|
+
<IconCaretDown class="box-icon-svg down" />
|
|
179
176
|
</div>
|
|
180
177
|
</div>
|
|
181
178
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import IconX from '@iconify-icons/ph/x-bold'
|
|
3
2
|
import SAvatar from './SAvatar.vue'
|
|
4
|
-
import
|
|
3
|
+
import IconX from '~icons/ph/x-bold'
|
|
5
4
|
|
|
6
5
|
export type Size = 'mini' | 'small' | 'medium'
|
|
7
6
|
|
|
@@ -36,7 +35,7 @@ const avatarSizeDict = {
|
|
|
36
35
|
|
|
37
36
|
<div v-if="!disabled && removable" class="remove" role="button" @click="$emit('remove', value)">
|
|
38
37
|
<div class="remove-box">
|
|
39
|
-
<
|
|
38
|
+
<IconX class="remove-icon" />
|
|
40
39
|
</div>
|
|
41
40
|
</div>
|
|
42
41
|
</div>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import IconX from '
|
|
3
|
-
import SIcon from './SIcon.vue'
|
|
2
|
+
import IconX from '~icons/ph/x-bold'
|
|
4
3
|
|
|
5
4
|
export type Size = 'mini' | 'small' | 'medium'
|
|
6
5
|
|
|
@@ -23,7 +22,7 @@ defineEmits<{
|
|
|
23
22
|
|
|
24
23
|
<div v-if="!disabled && removable" class="remove" role="button" @click.stop="$emit('remove', value)">
|
|
25
24
|
<div class="remove-box">
|
|
26
|
-
<
|
|
25
|
+
<IconX class="remove-icon" />
|
|
27
26
|
</div>
|
|
28
27
|
</div>
|
|
29
28
|
</div>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import { type Validatable } from '../composables/V'
|
|
2
|
+
import { type Component, computed, ref } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
5
4
|
import SInputBase from './SInputBase.vue'
|
|
6
5
|
|
|
7
6
|
export type Size = 'mini' | 'small' | 'medium'
|
|
@@ -17,7 +16,7 @@ const props = defineProps<{
|
|
|
17
16
|
placeholder?: string
|
|
18
17
|
accept?: string
|
|
19
18
|
multiple?: boolean
|
|
20
|
-
checkIcon?:
|
|
19
|
+
checkIcon?: Component
|
|
21
20
|
checkText?: string
|
|
22
21
|
checkColor?: Color
|
|
23
22
|
value?: File | File[] | null
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import { type Validatable } from '../composables/V'
|
|
2
|
+
import { type Component, computed, ref } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
5
4
|
import SInputBase from './SInputBase.vue'
|
|
6
5
|
|
|
7
6
|
export type Size = 'mini' | 'small' | 'medium'
|
|
@@ -28,7 +27,7 @@ const props = defineProps<{
|
|
|
28
27
|
note?: string
|
|
29
28
|
help?: string
|
|
30
29
|
placeholder?: Placeholder
|
|
31
|
-
checkIcon?:
|
|
30
|
+
checkIcon?: Component
|
|
32
31
|
checkText?: string
|
|
33
32
|
checkColor?: Color
|
|
34
33
|
noHour?: boolean
|
|
@@ -97,7 +96,7 @@ function updateSecond(e: FocusEvent): void {
|
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
function update(type: ValueType, value: string | null) {
|
|
100
|
-
if (_value.value
|
|
99
|
+
if (_value.value == null) {
|
|
101
100
|
return
|
|
102
101
|
}
|
|
103
102
|
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import IconImage from '@iconify-icons/ph/image-bold'
|
|
4
|
-
import { computed, ref } from 'vue'
|
|
2
|
+
import { type Component, computed, ref } from 'vue'
|
|
5
3
|
import { useImageSrcFromFile } from '../composables/Image'
|
|
6
|
-
import { type Validatable } from '../composables/
|
|
4
|
+
import { type Validatable } from '../composables/Validation'
|
|
7
5
|
import SButton from './SButton.vue'
|
|
8
|
-
import SIcon from './SIcon.vue'
|
|
9
6
|
import SInputBase from './SInputBase.vue'
|
|
7
|
+
import IconImage from '~icons/ph/image-bold'
|
|
10
8
|
|
|
11
9
|
export type Size = 'mini' | 'small' | 'medium'
|
|
12
10
|
export type CheckColor = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
@@ -18,7 +16,7 @@ const props = withDefaults(defineProps<{
|
|
|
18
16
|
info?: string
|
|
19
17
|
note?: string
|
|
20
18
|
help?: string
|
|
21
|
-
checkIcon?:
|
|
19
|
+
checkIcon?: Component
|
|
22
20
|
checkText?: string
|
|
23
21
|
checkColor?: CheckColor
|
|
24
22
|
imageType?: ImageType
|
|
@@ -108,7 +106,7 @@ function onFileDelete() {
|
|
|
108
106
|
</div>
|
|
109
107
|
<div v-else class="image-empty">
|
|
110
108
|
<div class="image-empty-inner">
|
|
111
|
-
<
|
|
109
|
+
<IconImage class="image-empty-icon" />
|
|
112
110
|
</div>
|
|
113
111
|
</div>
|
|
114
112
|
</div>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
5
|
-
import { isNullish, isString } from '../support/Utils'
|
|
2
|
+
import { type Component, computed } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
4
|
+
import { isString } from '../support/Utils'
|
|
6
5
|
import SInputText from './SInputText.vue'
|
|
7
6
|
|
|
8
7
|
export type Size = 'mini' | 'small' | 'medium'
|
|
@@ -20,7 +19,7 @@ const props = defineProps<{
|
|
|
20
19
|
placeholder?: string
|
|
21
20
|
unitBefore?: any
|
|
22
21
|
unitAfter?: any
|
|
23
|
-
checkIcon?:
|
|
22
|
+
checkIcon?: Component
|
|
24
23
|
checkText?: string
|
|
25
24
|
checkColor?: CheckColor
|
|
26
25
|
textColor?: TextColor | ((value: number | null) => TextColor)
|
|
@@ -58,27 +57,27 @@ const _textColor = computed(() => {
|
|
|
58
57
|
})
|
|
59
58
|
|
|
60
59
|
const valueWithSeparator = computed(() => {
|
|
61
|
-
if (
|
|
60
|
+
if (_value.value == null) {
|
|
62
61
|
return null
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
return _value.value >=
|
|
64
|
+
return _value.value >= Number.MAX_SAFE_INTEGER
|
|
66
65
|
? 'The number is too big'
|
|
67
66
|
: _value.value.toLocaleString('en-US', { maximumSignificantDigits: 20 })
|
|
68
67
|
})
|
|
69
68
|
|
|
70
69
|
const displayValue = computed(() => {
|
|
71
|
-
if (
|
|
70
|
+
if (props.displayValue != null) {
|
|
72
71
|
return props.displayValue
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
return (!props.separator || valueWithSeparator.value
|
|
74
|
+
return (!props.separator || valueWithSeparator.value == null)
|
|
76
75
|
? null
|
|
77
76
|
: valueWithSeparator.value
|
|
78
77
|
})
|
|
79
78
|
|
|
80
79
|
function emitUpdate(value: string | null) {
|
|
81
|
-
const v =
|
|
80
|
+
const v = value == null ? null : Number(value)
|
|
82
81
|
emit('update:model-value', v)
|
|
83
82
|
emit('input', v)
|
|
84
83
|
}
|
|
@@ -105,7 +104,7 @@ function emitUpdate(value: string | null) {
|
|
|
105
104
|
:disabled="disabled"
|
|
106
105
|
:hide-error="hideError"
|
|
107
106
|
:display-value="displayValue"
|
|
108
|
-
:model-value="_value
|
|
107
|
+
:model-value="_value == null ? null : String(_value)"
|
|
109
108
|
:validation="validation"
|
|
110
109
|
@update:model-value="emitUpdate"
|
|
111
110
|
@input="emitUpdate"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import { type Validatable } from '../composables/V'
|
|
2
|
+
import { type Component, computed } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
5
4
|
import SInputBase from './SInputBase.vue'
|
|
6
5
|
|
|
7
6
|
export type Size = 'mini' | 'small' | 'medium'
|
|
@@ -14,7 +13,7 @@ const props = defineProps<{
|
|
|
14
13
|
info?: string
|
|
15
14
|
note?: string
|
|
16
15
|
help?: string
|
|
17
|
-
checkIcon?:
|
|
16
|
+
checkIcon?: Component
|
|
18
17
|
checkText?: string
|
|
19
18
|
checkColor?: Color
|
|
20
19
|
text?: string
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
Nullable extends boolean = false
|
|
7
7
|
"
|
|
8
8
|
>
|
|
9
|
-
import { type
|
|
10
|
-
import { type
|
|
11
|
-
import { type Validatable } from '../composables/V'
|
|
9
|
+
import { type Component, computed } from 'vue'
|
|
10
|
+
import { type Validatable } from '../composables/Validation'
|
|
12
11
|
import SInputBase from './SInputBase.vue'
|
|
13
12
|
import SInputRadio from './SInputRadio.vue'
|
|
14
13
|
|
|
@@ -32,7 +31,7 @@ const props = withDefaults(defineProps<{
|
|
|
32
31
|
info?: string
|
|
33
32
|
note?: string
|
|
34
33
|
help?: string
|
|
35
|
-
checkIcon?:
|
|
34
|
+
checkIcon?: Component
|
|
36
35
|
checkText?: string
|
|
37
36
|
checkColor?: Color
|
|
38
37
|
options: Option<ValueType>[]
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts" generic="T extends string | number | boolean">
|
|
2
|
-
import { type
|
|
3
|
-
import {
|
|
4
|
-
import { type Validatable } from '../composables/V'
|
|
2
|
+
import { type Component, computed } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
5
4
|
import SInputBase from './SInputBase.vue'
|
|
6
5
|
import SInputSegmentsOption, { type Mode } from './SInputSegmentsOption.vue'
|
|
7
6
|
|
|
@@ -23,7 +22,7 @@ const props = defineProps<{
|
|
|
23
22
|
info?: string
|
|
24
23
|
note?: string
|
|
25
24
|
help?: string
|
|
26
|
-
checkIcon?:
|
|
25
|
+
checkIcon?: Component
|
|
27
26
|
checkText?: string
|
|
28
27
|
checkColor?: CheckColor
|
|
29
28
|
options: Option<T>[]
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import
|
|
4
|
-
import IconCaretUp from '@iconify-icons/ph/caret-up-bold'
|
|
5
|
-
import { type DefineComponent, computed, ref } from 'vue'
|
|
6
|
-
import { type Validatable } from '../composables/V'
|
|
7
|
-
import SIcon from './SIcon.vue'
|
|
2
|
+
import { type Component, computed, ref } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
8
4
|
import SInputBase from './SInputBase.vue'
|
|
5
|
+
import IconCaretDown from '~icons/ph/caret-down-bold'
|
|
6
|
+
import IconCaretUp from '~icons/ph/caret-up-bold'
|
|
9
7
|
|
|
10
8
|
export type Size = 'mini' | 'small' | 'medium'
|
|
11
9
|
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
@@ -24,7 +22,7 @@ const props = withDefaults(defineProps<{
|
|
|
24
22
|
note?: string
|
|
25
23
|
help?: string
|
|
26
24
|
placeholder?: string
|
|
27
|
-
checkIcon?:
|
|
25
|
+
checkIcon?: Component
|
|
28
26
|
checkText?: string
|
|
29
27
|
checkColor?: Color
|
|
30
28
|
options: Option[]
|
|
@@ -124,8 +122,8 @@ function emitChange(e: any): void {
|
|
|
124
122
|
</select>
|
|
125
123
|
|
|
126
124
|
<div class="icon" role="button">
|
|
127
|
-
<
|
|
128
|
-
<
|
|
125
|
+
<IconCaretUp class="icon-svg up" />
|
|
126
|
+
<IconCaretDown class="icon-svg down" />
|
|
129
127
|
</div>
|
|
130
128
|
</div>
|
|
131
129
|
<template v-if="$slots.info" #info><slot name="info" /></template>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import { type Validatable } from '../composables/V'
|
|
2
|
+
import { type Component, computed } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
5
4
|
import SInputBase from './SInputBase.vue'
|
|
6
5
|
|
|
7
6
|
export type Size = 'mini' | 'small' | 'medium'
|
|
@@ -17,7 +16,7 @@ const props = withDefaults(defineProps<{
|
|
|
17
16
|
text?: string
|
|
18
17
|
color?: ActiveColor
|
|
19
18
|
help?: string
|
|
20
|
-
checkIcon?:
|
|
19
|
+
checkIcon?: Component
|
|
21
20
|
checkText?: string
|
|
22
21
|
checkColor?: CheckColor
|
|
23
22
|
disabled?: boolean
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import { type Validatable } from '../composables/V'
|
|
2
|
+
import { type Component, computed } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
5
4
|
import SInputBase from './SInputBase.vue'
|
|
6
5
|
import SInputSwitch from './SInputSwitch.vue'
|
|
7
6
|
|
|
@@ -20,7 +19,7 @@ const props = defineProps<{
|
|
|
20
19
|
info?: string
|
|
21
20
|
note?: string
|
|
22
21
|
help?: string
|
|
23
|
-
checkIcon?:
|
|
22
|
+
checkIcon?: Component
|
|
24
23
|
checkText?: string
|
|
25
24
|
checkColor?: CheckColor
|
|
26
25
|
options: Option[]
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import { type Validatable } from '../composables/V'
|
|
2
|
+
import { type Component, computed, ref } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
5
4
|
import { isString } from '../support/Utils'
|
|
6
|
-
import SIcon from './SIcon.vue'
|
|
7
5
|
import SInputBase from './SInputBase.vue'
|
|
8
6
|
|
|
9
7
|
export interface Props {
|
|
@@ -15,9 +13,9 @@ export interface Props {
|
|
|
15
13
|
help?: string
|
|
16
14
|
type?: string
|
|
17
15
|
placeholder?: string
|
|
18
|
-
unitBefore?:
|
|
19
|
-
unitAfter?:
|
|
20
|
-
checkIcon?:
|
|
16
|
+
unitBefore?: Component | string
|
|
17
|
+
unitAfter?: Component | string
|
|
18
|
+
checkIcon?: Component
|
|
21
19
|
checkText?: string
|
|
22
20
|
checkColor?: CheckColor
|
|
23
21
|
textColor?: TextColor | ((value: string | null) => TextColor)
|
|
@@ -137,7 +135,7 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
|
|
|
137
135
|
<div class="value">
|
|
138
136
|
<div v-if="unitBefore" class="unit before">
|
|
139
137
|
<span v-if="isString(unitBefore)" class="unit-text">{{ unitBefore }}</span>
|
|
140
|
-
<
|
|
138
|
+
<component v-else :is="unitBefore" class="unit-icon" />
|
|
141
139
|
</div>
|
|
142
140
|
|
|
143
141
|
<div class="area">
|
|
@@ -162,7 +160,7 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
|
|
|
162
160
|
|
|
163
161
|
<div v-if="unitAfter" class="unit after">
|
|
164
162
|
<span v-if="isString(unitAfter)" class="unit-text">{{ unitAfter }}</span>
|
|
165
|
-
<
|
|
163
|
+
<component v-else :is="unitAfter" class="unit-icon" />
|
|
166
164
|
</div>
|
|
167
165
|
</div>
|
|
168
166
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import {
|
|
4
|
-
import { type Validatable } from '../composables/V'
|
|
2
|
+
import { type Component, computed, ref } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
5
4
|
import SInputBase from './SInputBase.vue'
|
|
6
5
|
import SInputSegments from './SInputSegments.vue'
|
|
7
6
|
|
|
@@ -15,7 +14,7 @@ const props = withDefaults(defineProps<{
|
|
|
15
14
|
info?: string
|
|
16
15
|
note?: string
|
|
17
16
|
help?: string
|
|
18
|
-
checkIcon?:
|
|
17
|
+
checkIcon?: Component
|
|
19
18
|
checkText?: string
|
|
20
19
|
checkColor?: Color
|
|
21
20
|
placeholder?: string
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import { type Validatable } from '../composables/V'
|
|
2
|
+
import { type Component, computed, ref } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
5
4
|
import SInputBase from './SInputBase.vue'
|
|
6
5
|
|
|
7
6
|
export type Size = 'mini' | 'small' | 'medium'
|
|
@@ -28,7 +27,7 @@ const props = defineProps<{
|
|
|
28
27
|
note?: string
|
|
29
28
|
help?: string
|
|
30
29
|
placeholder?: Placeholder
|
|
31
|
-
checkIcon?:
|
|
30
|
+
checkIcon?: Component
|
|
32
31
|
checkText?: string
|
|
33
32
|
checkColor?: Color
|
|
34
33
|
noYear?: boolean
|
|
@@ -98,7 +97,7 @@ function updateDate(e: FocusEvent) {
|
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
function update(type: ValueType, value: string) {
|
|
101
|
-
if (_value.value
|
|
100
|
+
if (_value.value == null) {
|
|
102
101
|
return
|
|
103
102
|
}
|
|
104
103
|
|
package/lib/components/SLink.vue
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import SIcon from './SIcon.vue'
|
|
2
|
+
import { type Component } from 'vue'
|
|
4
3
|
import SLink from './SLink.vue'
|
|
5
4
|
|
|
6
5
|
export interface MenuItem {
|
|
7
|
-
icon?:
|
|
6
|
+
icon?: Component
|
|
8
7
|
text: string
|
|
9
8
|
link: string
|
|
10
9
|
active?: boolean
|
|
@@ -20,7 +19,7 @@ defineProps<{
|
|
|
20
19
|
<div v-for="nav, index in menu" :key="index" class="group">
|
|
21
20
|
<div v-for="item in nav" :key="item.text" class="item">
|
|
22
21
|
<SLink class="link" :class="{ active: item.active }" :href="item.link">
|
|
23
|
-
<
|
|
22
|
+
<component v-if="item.icon" :is="item.icon" class="icon-svg" />
|
|
24
23
|
<span class="text">{{ item.text }}</span>
|
|
25
24
|
</SLink>
|
|
26
25
|
</div>
|