@globalbrain/sefirot 2.20.0 → 2.22.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/SDropdown.vue +1 -1
- package/lib/components/SDropdownSection.vue +11 -1
- package/lib/components/SDropdownSectionActions.vue +61 -0
- package/lib/components/SDropdownSectionComponent.vue +11 -0
- package/lib/components/SDropdownSectionFilter.vue +3 -3
- package/lib/components/SDropdownSectionFilterItem.vue +1 -1
- package/lib/components/SDropdownSectionMenu.vue +1 -1
- package/lib/components/SIcon.vue +1 -1
- package/lib/components/SInputAddon.vue +1 -1
- package/lib/components/SInputBase.vue +6 -3
- package/lib/components/SInputCheckbox.vue +3 -3
- package/lib/components/SInputCheckboxes.vue +2 -2
- package/lib/components/SInputDate.vue +6 -4
- package/lib/components/SInputDropdown.vue +6 -4
- package/lib/components/SInputFile.vue +4 -3
- package/lib/components/SInputHMS.vue +4 -3
- package/lib/components/SInputNumber.vue +6 -5
- package/lib/components/SInputRadio.vue +3 -3
- package/lib/components/SInputRadios.vue +4 -3
- package/lib/components/SInputSelect.vue +4 -3
- package/lib/components/SInputSwitch.vue +217 -41
- package/lib/components/SInputSwitches.vue +6 -5
- package/lib/components/SInputText.vue +4 -3
- package/lib/components/SInputTextarea.vue +38 -32
- package/lib/components/SInputYMD.vue +4 -3
- package/lib/components/SMarkdown.vue +2 -1
- package/lib/components/SSheetFooterAction.vue +2 -1
- package/lib/components/SSnackbar.vue +2 -1
- package/lib/components/SStep.vue +2 -2
- package/lib/components/SSteps.vue +5 -4
- package/lib/components/STable.vue +1 -1
- package/lib/components/STableCell.vue +1 -1
- package/lib/components/STableCellAvatars.vue +1 -1
- package/lib/components/STableCellDay.vue +1 -1
- package/lib/components/STableCellPills.vue +1 -1
- package/lib/components/STableColumn.vue +1 -1
- package/lib/components/STooltip.vue +2 -1
- package/lib/composables/Data.ts +2 -1
- package/lib/composables/Dropdown.ts +23 -3
- package/lib/composables/Flyout.ts +2 -1
- package/lib/composables/Form.ts +6 -3
- package/lib/composables/Grid.ts +2 -1
- package/lib/composables/Markdown.ts +4 -2
- package/lib/composables/Table.ts +4 -3
- package/lib/composables/Tooltip.ts +2 -1
- package/lib/composables/Utils.ts +4 -2
- package/lib/composables/Validation.ts +5 -3
- package/lib/composables/markdown/LinkPlugin.ts +1 -1
- package/lib/mixins/Sheet.ts +1 -1
- package/lib/styles/variables.css +20 -10
- package/lib/support/Day.ts +2 -1
- package/lib/validation/rules/hms.ts +2 -1
- package/lib/validation/rules/requiredHms.ts +2 -1
- package/lib/validation/rules/requiredYmd.ts +2 -1
- package/lib/validation/rules/ymd.ts +2 -1
- package/lib/validation/validators/hms.ts +6 -6
- package/lib/validation/validators/requiredHms.ts +4 -4
- package/lib/validation/validators/requiredYmd.ts +3 -2
- package/package.json +3 -3
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
-
import { DefineComponent
|
|
4
|
-
import {
|
|
2
|
+
import type { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
+
import type { DefineComponent } from 'vue'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
import type { Validatable } from '../composables/Validation'
|
|
5
6
|
import SInputBase from './SInputBase.vue'
|
|
6
7
|
import SInputSwitch from './SInputSwitch.vue'
|
|
7
8
|
|
|
8
9
|
export type Size = 'mini' | 'small' | 'medium'
|
|
9
|
-
export type
|
|
10
|
+
export type CheckColor = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
10
11
|
|
|
11
12
|
export interface Option {
|
|
12
13
|
label: string
|
|
@@ -22,7 +23,7 @@ const props = defineProps<{
|
|
|
22
23
|
help?: string
|
|
23
24
|
checkIcon?: IconifyIcon | DefineComponent
|
|
24
25
|
checkText?: string
|
|
25
|
-
checkColor?:
|
|
26
|
+
checkColor?: CheckColor
|
|
26
27
|
options: Option[]
|
|
27
28
|
disabled?: boolean
|
|
28
29
|
modelValue: (string | number | boolean)[]
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
-
import { DefineComponent
|
|
4
|
-
import {
|
|
2
|
+
import type { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
+
import type { DefineComponent } from 'vue'
|
|
4
|
+
import { computed, ref } from 'vue'
|
|
5
|
+
import type { Validatable } from '../composables/Validation'
|
|
5
6
|
import { isString } from '../support/Utils'
|
|
6
7
|
import SIcon from './SIcon.vue'
|
|
7
8
|
import SInputBase from './SInputBase.vue'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
-
import {
|
|
4
|
-
import { Validatable } from '../composables/Validation'
|
|
2
|
+
import type { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import type { Validatable } from '../composables/Validation'
|
|
5
5
|
import SInputBase from './SInputBase.vue'
|
|
6
6
|
|
|
7
7
|
export type Size = 'mini' | 'small' | 'medium'
|
|
@@ -14,21 +14,30 @@ const props = defineProps<{
|
|
|
14
14
|
info?: string
|
|
15
15
|
note?: string
|
|
16
16
|
help?: string
|
|
17
|
-
checkIcon?: IconifyIcon
|
|
17
|
+
checkIcon?: IconifyIcon
|
|
18
18
|
checkText?: string
|
|
19
19
|
checkColor?: Color
|
|
20
20
|
placeholder?: string
|
|
21
21
|
disabled?: boolean
|
|
22
22
|
rows?: number | 'fill'
|
|
23
|
-
|
|
23
|
+
value?: string | null
|
|
24
|
+
modelValue?: string | null
|
|
24
25
|
hideError?: boolean
|
|
25
26
|
validation?: Validatable
|
|
26
27
|
}>()
|
|
27
28
|
|
|
28
29
|
const emit = defineEmits<{
|
|
29
|
-
(e: 'update:
|
|
30
|
+
(e: 'update:model-value', value: string | null): void
|
|
31
|
+
(e: 'input', value: string | null): void
|
|
32
|
+
(e: 'blur', value: string | null): void
|
|
30
33
|
}>()
|
|
31
34
|
|
|
35
|
+
const _value = computed(() => {
|
|
36
|
+
return props.modelValue !== undefined
|
|
37
|
+
? props.modelValue
|
|
38
|
+
: props.value !== undefined ? props.value : null
|
|
39
|
+
})
|
|
40
|
+
|
|
32
41
|
const classes = computed(() => [
|
|
33
42
|
props.size ?? 'small',
|
|
34
43
|
{ disabled: props.disabled },
|
|
@@ -36,12 +45,17 @@ const classes = computed(() => [
|
|
|
36
45
|
])
|
|
37
46
|
|
|
38
47
|
function emitInput(e: Event): void {
|
|
39
|
-
|
|
48
|
+
const v = (e.target as HTMLInputElement).value || null
|
|
49
|
+
emit('update:model-value', v)
|
|
50
|
+
emit('input', v)
|
|
40
51
|
}
|
|
41
52
|
|
|
42
53
|
function emitBlur(e: FocusEvent): void {
|
|
43
54
|
props.validation?.$touch()
|
|
44
|
-
|
|
55
|
+
|
|
56
|
+
const v = (e.target as HTMLInputElement).value || null
|
|
57
|
+
emit('update:model-value', v)
|
|
58
|
+
emit('blur', v)
|
|
45
59
|
}
|
|
46
60
|
</script>
|
|
47
61
|
|
|
@@ -67,7 +81,7 @@ function emitBlur(e: FocusEvent): void {
|
|
|
67
81
|
:placeholder="placeholder"
|
|
68
82
|
:rows="rows ?? 3"
|
|
69
83
|
:disabled="disabled"
|
|
70
|
-
:value="
|
|
84
|
+
:value="_value ?? undefined"
|
|
71
85
|
@input="emitInput"
|
|
72
86
|
@blur="emitBlur"
|
|
73
87
|
/>
|
|
@@ -78,21 +92,21 @@ function emitBlur(e: FocusEvent): void {
|
|
|
78
92
|
<style scoped lang="postcss">
|
|
79
93
|
.SInputTextarea.mini {
|
|
80
94
|
.input {
|
|
81
|
-
padding: 6px
|
|
95
|
+
padding: 6px 10px;
|
|
82
96
|
width: 100%;
|
|
83
97
|
min-height: 80px;
|
|
84
98
|
line-height: 20px;
|
|
85
|
-
font-size:
|
|
99
|
+
font-size: var(--input-font-size, var(--input-mini-font-size));
|
|
86
100
|
}
|
|
87
101
|
}
|
|
88
102
|
|
|
89
103
|
.SInputTextarea.small {
|
|
90
104
|
.input {
|
|
91
|
-
padding: 12px;
|
|
105
|
+
padding: 7px 12px;
|
|
92
106
|
width: 100%;
|
|
93
107
|
min-height: 96px;
|
|
94
108
|
line-height: 24px;
|
|
95
|
-
font-size:
|
|
109
|
+
font-size: var(--input-font-size, var(--input-small-font-size));
|
|
96
110
|
}
|
|
97
111
|
}
|
|
98
112
|
|
|
@@ -102,25 +116,27 @@ function emitBlur(e: FocusEvent): void {
|
|
|
102
116
|
width: 100%;
|
|
103
117
|
min-height: 96px;
|
|
104
118
|
line-height: 24px;
|
|
105
|
-
font-size:
|
|
119
|
+
font-size: var(--input-font-size, var(--input-medium-font-size));
|
|
106
120
|
}
|
|
107
121
|
}
|
|
108
122
|
|
|
109
123
|
.SInputTextarea.disabled {
|
|
110
124
|
.input,
|
|
111
125
|
.input:hover {
|
|
112
|
-
|
|
126
|
+
border-color: var(--input-disabled-border-color);
|
|
127
|
+
color: var(--input-disabled-value-color);
|
|
128
|
+
background-color: var(--input-disabled-bg-color);
|
|
113
129
|
cursor: not-allowed;
|
|
114
130
|
}
|
|
115
131
|
}
|
|
116
132
|
|
|
117
133
|
.SInputTextarea.has-error {
|
|
118
134
|
.input {
|
|
119
|
-
border-color: var(--
|
|
135
|
+
border-color: var(--input-error-border-color);
|
|
120
136
|
|
|
121
137
|
&:hover,
|
|
122
138
|
&:focus {
|
|
123
|
-
border-color: var(--
|
|
139
|
+
border-color: var(--input-error-border-color);
|
|
124
140
|
}
|
|
125
141
|
}
|
|
126
142
|
}
|
|
@@ -128,34 +144,24 @@ function emitBlur(e: FocusEvent): void {
|
|
|
128
144
|
.input {
|
|
129
145
|
display: block;
|
|
130
146
|
flex-grow: 1;
|
|
131
|
-
border: 1px solid var(--
|
|
147
|
+
border: 1px solid var(--input-border-color);
|
|
132
148
|
border-radius: 6px;
|
|
133
149
|
width: 100%;
|
|
134
150
|
font-weight: 400;
|
|
135
|
-
background-color: var(--
|
|
151
|
+
background-color: var(--input-bg-color);
|
|
136
152
|
transition: border-color 0.25s, background-color 0.25s;
|
|
137
153
|
|
|
138
154
|
&::placeholder {
|
|
139
|
-
|
|
140
|
-
color: var(--c-text-3);
|
|
155
|
+
color: var(--input-placeholder-color);
|
|
141
156
|
}
|
|
142
157
|
|
|
143
158
|
&:hover {
|
|
144
|
-
border-color: var(--
|
|
159
|
+
border-color: var(--input-hover-border-color);
|
|
145
160
|
}
|
|
146
161
|
|
|
147
162
|
&:focus,
|
|
148
163
|
&:hover:focus {
|
|
149
|
-
border-color: var(--
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.dark &:hover {
|
|
153
|
-
border-color: var(--c-gray);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.dark &:focus,
|
|
157
|
-
.dark &:hover:focus {
|
|
158
|
-
border-color: var(--c-info);
|
|
164
|
+
border-color: var(--input-focus-border-color);
|
|
159
165
|
}
|
|
160
166
|
|
|
161
167
|
&.fill {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
-
import { DefineComponent
|
|
4
|
-
import {
|
|
2
|
+
import type { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
+
import type { DefineComponent } from 'vue'
|
|
4
|
+
import { computed, ref } from 'vue'
|
|
5
|
+
import type { Validatable } from '../composables/Validation'
|
|
5
6
|
import SInputBase from './SInputBase.vue'
|
|
6
7
|
|
|
7
8
|
export type Size = 'mini' | 'small' | 'medium'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, nextTick, ref, watch } from 'vue'
|
|
3
|
-
import { LinkCallback, LinkSubscriberPayload
|
|
3
|
+
import type { LinkCallback, LinkSubscriberPayload } from '../composables/Markdown'
|
|
4
|
+
import { useLink, useMarkdown } from '../composables/Markdown'
|
|
4
5
|
|
|
5
6
|
const props = defineProps<{
|
|
6
7
|
tag?: string
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import IconX from '@iconify-icons/ph/x'
|
|
3
|
-
import { SnackbarAction
|
|
3
|
+
import type { SnackbarAction } from '../stores/Snackbars'
|
|
4
|
+
import { useSnackbars } from '../stores/Snackbars'
|
|
4
5
|
import SButton from './SButton.vue'
|
|
5
6
|
import SIcon from './SIcon.vue'
|
|
6
7
|
|
package/lib/components/SStep.vue
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import IconCheck from '@iconify-icons/ph/check'
|
|
3
3
|
import IconX from '@iconify-icons/ph/x'
|
|
4
|
-
import { PropType } from 'vue'
|
|
5
|
-
import { BarMode, StepStatus } from '../composables/Step'
|
|
4
|
+
import type { PropType } from 'vue'
|
|
5
|
+
import type { BarMode, StepStatus } from '../composables/Step'
|
|
6
6
|
import SIcon from './SIcon.vue'
|
|
7
7
|
|
|
8
8
|
defineProps({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { PropType
|
|
3
|
-
import {
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import type { BarMode, Step } from '../composables/Step'
|
|
4
5
|
import SStep from './SStep.vue'
|
|
5
6
|
|
|
6
7
|
const props = defineProps({
|
|
@@ -19,7 +20,7 @@ function getBarLeftMode(index: number): BarMode | null {
|
|
|
19
20
|
const current = props.steps[index]
|
|
20
21
|
const prev = props.steps[index - 1]
|
|
21
22
|
|
|
22
|
-
return isActive(prev) && isActive(current) ? 'active' : 'mute'
|
|
23
|
+
return (isActive(prev) && isActive(current)) ? 'active' : 'mute'
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
function getBarRightMode(index: number): BarMode | null {
|
|
@@ -30,7 +31,7 @@ function getBarRightMode(index: number): BarMode | null {
|
|
|
30
31
|
const current = props.steps[index]
|
|
31
32
|
const next = props.steps[index + 1]
|
|
32
33
|
|
|
33
|
-
return isActive(current) && isActive(next) ? 'active' : 'mute'
|
|
34
|
+
return (isActive(current) && isActive(next)) ? 'active' : 'mute'
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
function isActive(step: Step): boolean {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, reactive, ref, toRefs, watch } from 'vue'
|
|
3
|
-
import { Table } from '../composables/Table'
|
|
3
|
+
import type { Table } from '../composables/Table'
|
|
4
4
|
import SSpinner from './SSpinner.vue'
|
|
5
5
|
import STableCell from './STableCell.vue'
|
|
6
6
|
import STableColumn from './STableColumn.vue'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
-
import { TableCell } from '../composables/Table'
|
|
3
|
+
import type { TableCell } from '../composables/Table'
|
|
4
4
|
import STableCellAvatar from './STableCellAvatar.vue'
|
|
5
5
|
import STableCellAvatars from './STableCellAvatars.vue'
|
|
6
6
|
import STableCellDay from './STableCellDay.vue'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import IconDotsThree from '@iconify-icons/ph/dots-three'
|
|
3
3
|
import { computed, nextTick, ref, unref, watch } from 'vue'
|
|
4
|
-
import { DropdownSection } from '../composables/Dropdown'
|
|
4
|
+
import type { DropdownSection } from '../composables/Dropdown'
|
|
5
5
|
import { useFlyout } from '../composables/Flyout'
|
|
6
6
|
import { isArray } from '../support/Utils'
|
|
7
7
|
import SDropdown from './SDropdown.vue'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, ref } from 'vue'
|
|
3
|
-
import { Position
|
|
3
|
+
import type { Position } from '../composables/Tooltip'
|
|
4
|
+
import { useTooltip } from '../composables/Tooltip'
|
|
4
5
|
import SMarkdown from './SMarkdown.vue'
|
|
5
6
|
|
|
6
7
|
const props = defineProps<{
|
package/lib/composables/Data.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { watchOnce } from '@vueuse/core'
|
|
2
2
|
import cloneDeep from 'lodash-es/cloneDeep'
|
|
3
|
-
import { WatchSource
|
|
3
|
+
import type { WatchSource } from 'vue'
|
|
4
|
+
import { reactive } from 'vue'
|
|
4
5
|
import { isNullish, isObject } from '../support/Utils'
|
|
5
6
|
|
|
6
7
|
export interface Data<T extends Record<string, any>> {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { MaybeRef
|
|
2
|
-
import {
|
|
1
|
+
import type { MaybeRef } from '@vueuse/core'
|
|
2
|
+
import { useElementBounding, useWindowSize } from '@vueuse/core'
|
|
3
|
+
import type { Ref } from 'vue'
|
|
4
|
+
import { ref, unref } from 'vue'
|
|
3
5
|
|
|
4
6
|
export type DropdownSection =
|
|
5
7
|
| DropdownSectionMenu
|
|
6
8
|
| DropdownSectionFilter
|
|
9
|
+
| DropdownSectionComponent
|
|
10
|
+
| DropdownSectionActions
|
|
7
11
|
|
|
8
|
-
export type DropdownSectionType = 'menu' | 'filter'
|
|
12
|
+
export type DropdownSectionType = 'menu' | 'filter' | 'actions' | 'component'
|
|
9
13
|
|
|
10
14
|
export interface DropdownSectionBase {
|
|
11
15
|
type: DropdownSectionType
|
|
@@ -56,6 +60,22 @@ export interface DropdownSectionFilterOptionAvatar extends DropdownSectionFilter
|
|
|
56
60
|
image?: string | null
|
|
57
61
|
}
|
|
58
62
|
|
|
63
|
+
export interface DropdownSectionActions extends DropdownSectionBase {
|
|
64
|
+
type: 'actions'
|
|
65
|
+
options: DropdownSectionActionsOption[]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface DropdownSectionActionsOption {
|
|
69
|
+
mode?: 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
70
|
+
label: string
|
|
71
|
+
onClick(): void
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface DropdownSectionComponent extends DropdownSectionBase {
|
|
75
|
+
type: 'component'
|
|
76
|
+
component: any
|
|
77
|
+
}
|
|
78
|
+
|
|
59
79
|
export interface ManualDropdownPosition {
|
|
60
80
|
container: Ref<any>
|
|
61
81
|
position: Ref<'top' | 'bottom'>
|
package/lib/composables/Form.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { Ref
|
|
1
|
+
import type { Ref } from 'vue'
|
|
2
|
+
import { computed } from 'vue'
|
|
2
3
|
import { useSnackbars } from '../stores/Snackbars'
|
|
3
|
-
import { UseDataInput
|
|
4
|
-
import {
|
|
4
|
+
import type { UseDataInput } from './Data'
|
|
5
|
+
import { useData } from './Data'
|
|
6
|
+
import type { Validation } from './Validation'
|
|
7
|
+
import { useValidation } from './Validation'
|
|
5
8
|
|
|
6
9
|
export interface Form<T extends Record<string, any>> {
|
|
7
10
|
data: T
|
package/lib/composables/Grid.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import MarkdownIt from 'markdown-it'
|
|
2
|
-
import { Ref
|
|
2
|
+
import type { Ref } from 'vue'
|
|
3
|
+
import { onUnmounted } from 'vue'
|
|
3
4
|
import { useRouter } from 'vue-router'
|
|
4
|
-
import { LinkAttrs
|
|
5
|
+
import type { LinkAttrs } from './markdown/LinkPlugin'
|
|
6
|
+
import { isCallbackUrl, isExternalUrl, linkPlugin } from './markdown/LinkPlugin'
|
|
5
7
|
|
|
6
8
|
export type UseMarkdown = (source: string, inline: boolean) => string
|
|
7
9
|
|
package/lib/composables/Table.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { MaybeRef } from '@vueuse/core'
|
|
2
|
-
import { Component
|
|
3
|
-
import {
|
|
1
|
+
import type { MaybeRef } from '@vueuse/core'
|
|
2
|
+
import type { Component } from 'vue'
|
|
3
|
+
import { reactive } from 'vue'
|
|
4
|
+
import type { DropdownSection } from './Dropdown'
|
|
4
5
|
|
|
5
6
|
export interface Table {
|
|
6
7
|
orders: string[]
|
package/lib/composables/Utils.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { MaybeComputedRef
|
|
2
|
-
import {
|
|
1
|
+
import type { MaybeComputedRef } from '@vueuse/core'
|
|
2
|
+
import { resolveUnref } from '@vueuse/core'
|
|
3
|
+
import type { ComputedRef } from 'vue'
|
|
4
|
+
import { computed } from 'vue'
|
|
3
5
|
|
|
4
6
|
export type WhenCondition<T> = MaybeComputedRef<T>
|
|
5
7
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
GlobalConfig,
|
|
3
3
|
Validation,
|
|
4
|
-
ValidationArgs
|
|
4
|
+
ValidationArgs
|
|
5
|
+
} from '@vuelidate/core'
|
|
6
|
+
import {
|
|
5
7
|
useVuelidate
|
|
6
8
|
} from '@vuelidate/core'
|
|
7
|
-
import { Ref, ToRefs } from 'vue'
|
|
9
|
+
import type { Ref, ToRefs } from 'vue'
|
|
8
10
|
|
|
9
11
|
export type { Validation, ValidationArgs, GlobalConfig }
|
|
10
12
|
|
package/lib/mixins/Sheet.ts
CHANGED
package/lib/styles/variables.css
CHANGED
|
@@ -65,16 +65,16 @@
|
|
|
65
65
|
--c-text-dark-2: rgba(235, 235, 245, 0.6);
|
|
66
66
|
--c-text-dark-3: rgba(235, 235, 245, 0.3);
|
|
67
67
|
|
|
68
|
-
--c-info: #
|
|
69
|
-
--c-info-light: #
|
|
70
|
-
--c-info-lighter: #
|
|
71
|
-
--c-info-lghtest: #
|
|
72
|
-
--c-info-dark: #
|
|
73
|
-
--c-info-darker: #
|
|
74
|
-
--c-info-darkest: #
|
|
75
|
-
--c-info-dimm-1: rgba(
|
|
76
|
-
--c-info-dimm-2: rgba(
|
|
77
|
-
--c-info-dimm-3: rgba(
|
|
68
|
+
--c-info: #1668b6;
|
|
69
|
+
--c-info-light: #2997ff;
|
|
70
|
+
--c-info-lighter: #5bafff;
|
|
71
|
+
--c-info-lghtest: #7dc0ff;
|
|
72
|
+
--c-info-dark: #104c85;
|
|
73
|
+
--c-info-darker: #0c3963;
|
|
74
|
+
--c-info-darkest: #092e51;
|
|
75
|
+
--c-info-dimm-1: rgba(22, 104, 182, 0.12);
|
|
76
|
+
--c-info-dimm-2: rgba(22, 104, 182, 0.2);
|
|
77
|
+
--c-info-dimm-3: rgba(22, 104, 182, 0.28);
|
|
78
78
|
--c-info-text: var(--c-info-light);
|
|
79
79
|
--c-info-text-light: var(--c-info-lighter);
|
|
80
80
|
--c-info-text-lighter: var(--c-info-lightest);
|
|
@@ -666,4 +666,14 @@
|
|
|
666
666
|
--input-mini-label-font-size: 12px;
|
|
667
667
|
--input-small-label-font-size: 14px;
|
|
668
668
|
--input-medium-label-font-size: 14px;
|
|
669
|
+
|
|
670
|
+
--input-switch-toggle-color: var(--c-neutral-1);
|
|
671
|
+
--input-switch-bg-color: var(--c-mute);
|
|
672
|
+
--input-switch-disabled-toggle-color: var(--c-gray);
|
|
673
|
+
--input-switch-disabled-bg-color: var(--c-mute);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.dark {
|
|
677
|
+
--input-switch-bg-color: var(--c-bg-elv-1);
|
|
678
|
+
--input-switch-disabled-bg-color: var(--c-mute);
|
|
669
679
|
}
|
package/lib/support/Day.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ConfigType, Dayjs } from 'dayjs'
|
|
2
|
+
import dayjs from 'dayjs'
|
|
2
3
|
import PluginRelativeTime from 'dayjs/plugin/relativeTime'
|
|
3
4
|
import PluginTimezone from 'dayjs/plugin/timezone'
|
|
4
5
|
import PluginUtc from 'dayjs/plugin/utc'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { helpers } from '@vuelidate/validators'
|
|
2
|
-
import { Hms, HmsType
|
|
2
|
+
import type { Hms, HmsType } from '../validators/hms'
|
|
3
|
+
import { hms as baseHms } from '../validators/hms'
|
|
3
4
|
|
|
4
5
|
export function hms(required?: HmsType[], msg?: string) {
|
|
5
6
|
return helpers.withMessage(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { helpers } from '@vuelidate/validators'
|
|
2
|
-
import { Hms, HmsType
|
|
2
|
+
import type { Hms, HmsType } from '../validators/requiredHms'
|
|
3
|
+
import { requiredHms as baseRequiredHms } from '../validators/requiredHms'
|
|
3
4
|
|
|
4
5
|
export function requiredHms(required?: HmsType[], msg?: string) {
|
|
5
6
|
return helpers.withMessage(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { helpers } from '@vuelidate/validators'
|
|
2
|
-
import { Ymd, YmdType
|
|
2
|
+
import type { Ymd, YmdType } from '../validators/requiredYmd'
|
|
3
|
+
import { requiredYmd as baseRequiredYmd } from '../validators/requiredYmd'
|
|
3
4
|
|
|
4
5
|
export function requiredYmd(required?: YmdType[], msg?: string) {
|
|
5
6
|
return helpers.withMessage(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { helpers } from '@vuelidate/validators'
|
|
2
|
-
import { Ymd, YmdType
|
|
2
|
+
import type { Ymd, YmdType } from '../validators/ymd'
|
|
3
|
+
import { ymd as baseYmd } from '../validators/ymd'
|
|
3
4
|
|
|
4
5
|
export function ymd(required?: YmdType[], msg?: string) {
|
|
5
6
|
return helpers.withMessage(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface Hms {
|
|
2
|
-
hour?: string
|
|
3
|
-
minute?: string
|
|
4
|
-
second?: string
|
|
2
|
+
hour?: string | null
|
|
3
|
+
minute?: string | null
|
|
4
|
+
second?: string | null
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export type HmsType = 'h' | 'm' | 's'
|
|
@@ -22,8 +22,8 @@ export function hms(hms: Hms, required: HmsType[] = ['h', 'm', 's']): boolean {
|
|
|
22
22
|
|
|
23
23
|
const valueAsNumber = Number(value)
|
|
24
24
|
|
|
25
|
-
return r === 'h'
|
|
26
|
-
? valueAsNumber >= 0 && valueAsNumber < 24
|
|
27
|
-
: valueAsNumber >= 0 && valueAsNumber < 60
|
|
25
|
+
return (r === 'h')
|
|
26
|
+
? (valueAsNumber >= 0 && valueAsNumber < 24)
|
|
27
|
+
: (valueAsNumber >= 0 && valueAsNumber < 60)
|
|
28
28
|
})
|
|
29
29
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface Hms {
|
|
2
|
-
hour?: string
|
|
3
|
-
minute?: string
|
|
4
|
-
second?: string
|
|
2
|
+
hour?: string | null
|
|
3
|
+
minute?: string | null
|
|
4
|
+
second?: string | null
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export type HmsType = 'h' | 'm' | 's'
|
|
@@ -13,5 +13,5 @@ export const HmsMap = {
|
|
|
13
13
|
} as const
|
|
14
14
|
|
|
15
15
|
export function requiredHms(hms: Hms, required: HmsType[] = ['h', 'm', 's']): boolean {
|
|
16
|
-
return required.every((r) => hms[HmsMap[r]]
|
|
16
|
+
return required.every((r) => hms[HmsMap[r]] != null)
|
|
17
17
|
}
|