@globalbrain/sefirot 4.19.1 → 4.21.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/SActionListItem.vue +2 -2
- package/lib/components/SActionMenu.vue +15 -15
- package/lib/components/SAvatarStack.vue +2 -2
- package/lib/components/SButton.vue +1 -1
- package/lib/components/SControlActionBarButton.vue +5 -5
- package/lib/components/SControlActionBarClose.vue +1 -1
- package/lib/components/SControlActionBarCollapse.vue +2 -2
- package/lib/components/SControlActionMenu.vue +15 -15
- package/lib/components/SControlButton.vue +14 -14
- package/lib/components/SControlInputSearch.vue +1 -1
- package/lib/components/SControlPagination.vue +6 -4
- package/lib/components/SDesc.vue +2 -2
- package/lib/components/SDescItem.vue +1 -1
- package/lib/components/SDropdown.vue +1 -1
- package/lib/components/SDropdownSectionFilter.vue +1 -1
- package/lib/components/SErrorBoundary.vue +1 -1
- package/lib/components/SFragment.vue +1 -1
- package/lib/components/SInputCheckbox.vue +8 -8
- package/lib/components/SInputCheckboxes.vue +8 -8
- package/lib/components/SInputDate.vue +11 -11
- package/lib/components/SInputDropdown.vue +9 -9
- package/lib/components/SInputFile.vue +11 -11
- package/lib/components/SInputFileUpload.vue +12 -12
- package/lib/components/SInputHMS.vue +12 -12
- package/lib/components/SInputImage.vue +11 -11
- package/lib/components/SInputNumber.vue +19 -19
- package/lib/components/SInputRadio.vue +9 -9
- package/lib/components/SInputRadios.vue +9 -9
- package/lib/components/SInputSegments.vue +9 -9
- package/lib/components/SInputSelect.vue +1 -1
- package/lib/components/SInputSwitch.vue +9 -9
- package/lib/components/SInputSwitches.vue +10 -10
- package/lib/components/SInputText.vue +15 -15
- package/lib/components/SInputTextarea.vue +16 -16
- package/lib/components/SInputYMD.vue +12 -12
- package/lib/components/SLink.vue +3 -3
- package/lib/components/SLocalNav.vue +2 -2
- package/lib/components/SLocalNavAvatar.vue +1 -1
- package/lib/components/SLoginPagePasswordDialog.vue +1 -1
- package/lib/components/SM.vue +1 -1
- package/lib/components/SMFade.vue +1 -1
- package/lib/components/SPagination.vue +9 -15
- package/lib/components/STable.vue +2 -2
- package/lib/components/STableCell.vue +9 -9
- package/lib/components/STableCellAvatar.vue +1 -1
- package/lib/components/STableCellAvatars.vue +1 -1
- package/lib/components/STableCellIndicator.vue +1 -1
- package/lib/components/STableCellState.vue +1 -1
- package/lib/components/STableHeader.vue +1 -1
- package/lib/components/STableHeaderActionItem.vue +3 -3
- package/lib/components/STooltip.vue +1 -1
- package/lib/support/Day.ts +4 -0
- package/lib/validation/rules/after.ts +16 -0
- package/lib/validation/rules/afterOrEqual.ts +16 -0
- package/lib/validation/rules/before.ts +16 -0
- package/lib/validation/rules/beforeOrEqual.ts +16 -0
- package/lib/validation/rules/index.ts +4 -0
- package/lib/validation/validators/after.ts +9 -0
- package/lib/validation/validators/afterOrEqual.ts +9 -0
- package/lib/validation/validators/before.ts +8 -0
- package/lib/validation/validators/beforeOrEqual.ts +9 -0
- package/lib/validation/validators/index.ts +4 -0
- package/package.json +1 -1
|
@@ -88,15 +88,15 @@ function onChange(value: ValueType) {
|
|
|
88
88
|
<SInputBase
|
|
89
89
|
class="SInputRadios"
|
|
90
90
|
:class="[size ?? 'small']"
|
|
91
|
-
:label
|
|
92
|
-
:note
|
|
93
|
-
:info
|
|
94
|
-
:help
|
|
95
|
-
:check-icon
|
|
96
|
-
:check-text
|
|
97
|
-
:check-color
|
|
98
|
-
:hide-error
|
|
99
|
-
:validation
|
|
91
|
+
:label
|
|
92
|
+
:note
|
|
93
|
+
:info
|
|
94
|
+
:help
|
|
95
|
+
:check-icon
|
|
96
|
+
:check-text
|
|
97
|
+
:check-color
|
|
98
|
+
:hide-error
|
|
99
|
+
:validation
|
|
100
100
|
>
|
|
101
101
|
<div class="container">
|
|
102
102
|
<div class="row">
|
|
@@ -61,15 +61,15 @@ function onSelect(value: T) {
|
|
|
61
61
|
<SInputBase
|
|
62
62
|
class="SInputSegments"
|
|
63
63
|
:class="[size ?? 'small', { block }]"
|
|
64
|
-
:label
|
|
65
|
-
:note
|
|
66
|
-
:info
|
|
67
|
-
:help
|
|
68
|
-
:check-icon
|
|
69
|
-
:check-text
|
|
70
|
-
:check-color
|
|
71
|
-
:hide-error
|
|
72
|
-
:validation
|
|
64
|
+
:label
|
|
65
|
+
:note
|
|
66
|
+
:info
|
|
67
|
+
:help
|
|
68
|
+
:check-icon
|
|
69
|
+
:check-text
|
|
70
|
+
:check-color
|
|
71
|
+
:hide-error
|
|
72
|
+
:validation
|
|
73
73
|
>
|
|
74
74
|
<div class="box">
|
|
75
75
|
<SInputSegmentsOption
|
|
@@ -58,15 +58,15 @@ function emitChange(): void {
|
|
|
58
58
|
<SInputBase
|
|
59
59
|
class="SInputSwitch"
|
|
60
60
|
:class="classes"
|
|
61
|
-
:name
|
|
62
|
-
:label
|
|
63
|
-
:note
|
|
64
|
-
:info
|
|
65
|
-
:check-icon
|
|
66
|
-
:check-text
|
|
67
|
-
:check-color
|
|
68
|
-
:help
|
|
69
|
-
:hide-error
|
|
61
|
+
:name
|
|
62
|
+
:label
|
|
63
|
+
:note
|
|
64
|
+
:info
|
|
65
|
+
:check-icon
|
|
66
|
+
:check-text
|
|
67
|
+
:check-color
|
|
68
|
+
:help
|
|
69
|
+
:hide-error
|
|
70
70
|
>
|
|
71
71
|
<div class="container">
|
|
72
72
|
<div class="input" :class="{ on: _value }" role="button" @click="emitChange">
|
|
@@ -54,21 +54,21 @@ function handleChange(value: any): void {
|
|
|
54
54
|
<SInputBase
|
|
55
55
|
class="SInputSwitches"
|
|
56
56
|
:class="classes"
|
|
57
|
-
:name
|
|
58
|
-
:label
|
|
59
|
-
:note
|
|
60
|
-
:info
|
|
61
|
-
:help
|
|
62
|
-
:check-icon
|
|
63
|
-
:check-text
|
|
64
|
-
:check-color
|
|
65
|
-
:hide-error
|
|
57
|
+
:name
|
|
58
|
+
:label
|
|
59
|
+
:note
|
|
60
|
+
:info
|
|
61
|
+
:help
|
|
62
|
+
:check-icon
|
|
63
|
+
:check-text
|
|
64
|
+
:check-color
|
|
65
|
+
:hide-error
|
|
66
66
|
>
|
|
67
67
|
<div class="container">
|
|
68
68
|
<div class="row">
|
|
69
69
|
<div v-for="(option, index) in options" :key="index" class="col">
|
|
70
70
|
<SInputSwitch
|
|
71
|
-
:size
|
|
71
|
+
:size
|
|
72
72
|
:text="option.label"
|
|
73
73
|
:model-value="isChecked(option.value)"
|
|
74
74
|
@update:model-value="handleChange(option.value)"
|
|
@@ -101,19 +101,19 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
|
|
|
101
101
|
<SInputBase
|
|
102
102
|
class="SInputText"
|
|
103
103
|
:class="classes"
|
|
104
|
-
:size
|
|
105
|
-
:name
|
|
106
|
-
:label
|
|
107
|
-
:note
|
|
108
|
-
:info
|
|
109
|
-
:help
|
|
110
|
-
:check-icon
|
|
111
|
-
:check-text
|
|
112
|
-
:check-color
|
|
113
|
-
:validation
|
|
114
|
-
:warning
|
|
115
|
-
:hide-error
|
|
116
|
-
:hide-warning
|
|
104
|
+
:size
|
|
105
|
+
:name
|
|
106
|
+
:label
|
|
107
|
+
:note
|
|
108
|
+
:info
|
|
109
|
+
:help
|
|
110
|
+
:check-icon
|
|
111
|
+
:check-text
|
|
112
|
+
:check-color
|
|
113
|
+
:validation
|
|
114
|
+
:warning
|
|
115
|
+
:hide-error
|
|
116
|
+
:hide-warning
|
|
117
117
|
>
|
|
118
118
|
<div class="box" :class="{ focus: isFocused }" @click="focus">
|
|
119
119
|
<div v-if="$slots['addon-before']" class="addon before">
|
|
@@ -132,8 +132,8 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
|
|
|
132
132
|
:class="inputClasses"
|
|
133
133
|
:id="name"
|
|
134
134
|
:type="type ?? 'text'"
|
|
135
|
-
:placeholder
|
|
136
|
-
:disabled
|
|
135
|
+
:placeholder
|
|
136
|
+
:disabled
|
|
137
137
|
:value="modelValue"
|
|
138
138
|
ref="input"
|
|
139
139
|
@focus="onFocus"
|
|
@@ -80,19 +80,19 @@ const isPreview = ref(false)
|
|
|
80
80
|
<SInputBase
|
|
81
81
|
class="SInputTextarea"
|
|
82
82
|
:class="classes"
|
|
83
|
-
:size
|
|
84
|
-
:name
|
|
85
|
-
:label
|
|
86
|
-
:note
|
|
87
|
-
:info
|
|
88
|
-
:help
|
|
89
|
-
:check-icon
|
|
90
|
-
:check-text
|
|
91
|
-
:check-color
|
|
92
|
-
:validation
|
|
93
|
-
:warning
|
|
94
|
-
:hide-error
|
|
95
|
-
:hide-warning
|
|
83
|
+
:size
|
|
84
|
+
:name
|
|
85
|
+
:label
|
|
86
|
+
:note
|
|
87
|
+
:info
|
|
88
|
+
:help
|
|
89
|
+
:check-icon
|
|
90
|
+
:check-text
|
|
91
|
+
:check-color
|
|
92
|
+
:validation
|
|
93
|
+
:warning
|
|
94
|
+
:hide-error
|
|
95
|
+
:hide-warning
|
|
96
96
|
>
|
|
97
97
|
<div class="box">
|
|
98
98
|
<div v-if="preview !== undefined" class="control">
|
|
@@ -109,10 +109,10 @@ const isPreview = ref(false)
|
|
|
109
109
|
v-show="!isPreview"
|
|
110
110
|
:id="name"
|
|
111
111
|
class="input"
|
|
112
|
-
:style
|
|
113
|
-
:placeholder
|
|
112
|
+
:style
|
|
113
|
+
:placeholder
|
|
114
114
|
:rows="rows === 'fill' ? 3 : rows"
|
|
115
|
-
:disabled
|
|
115
|
+
:disabled
|
|
116
116
|
:value="_value ?? undefined"
|
|
117
117
|
@input="emitInput"
|
|
118
118
|
@blur="emitBlur"
|
|
@@ -143,15 +143,15 @@ function createRequiredTouched(): boolean[] {
|
|
|
143
143
|
<SInputBase
|
|
144
144
|
class="SInputYMD"
|
|
145
145
|
:class="[size ?? 'small', { disabled }]"
|
|
146
|
-
:label
|
|
147
|
-
:note
|
|
148
|
-
:info
|
|
149
|
-
:help
|
|
150
|
-
:check-icon
|
|
151
|
-
:check-text
|
|
152
|
-
:check-color
|
|
153
|
-
:hide-error
|
|
154
|
-
:validation
|
|
146
|
+
:label
|
|
147
|
+
:note
|
|
148
|
+
:info
|
|
149
|
+
:help
|
|
150
|
+
:check-icon
|
|
151
|
+
:check-text
|
|
152
|
+
:check-color
|
|
153
|
+
:hide-error
|
|
154
|
+
:validation
|
|
155
155
|
>
|
|
156
156
|
<div class="container" :class="{ focus: isFocused, block }">
|
|
157
157
|
<input
|
|
@@ -160,7 +160,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
160
160
|
:value="padValue?.year"
|
|
161
161
|
:placeholder="padPlaceholder.year"
|
|
162
162
|
:maxlength="4"
|
|
163
|
-
:disabled
|
|
163
|
+
:disabled
|
|
164
164
|
@focus="onFocus"
|
|
165
165
|
@blur="updateYear"
|
|
166
166
|
>
|
|
@@ -174,7 +174,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
174
174
|
:value="padValue?.month"
|
|
175
175
|
:placeholder="padPlaceholder.month"
|
|
176
176
|
:maxlength="2"
|
|
177
|
-
:disabled
|
|
177
|
+
:disabled
|
|
178
178
|
@focus="onFocus"
|
|
179
179
|
@blur="updateMonth"
|
|
180
180
|
>
|
|
@@ -188,7 +188,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
188
188
|
:value="padValue?.date"
|
|
189
189
|
:placeholder="padPlaceholder.date"
|
|
190
190
|
:maxlength="2"
|
|
191
|
-
:disabled
|
|
191
|
+
:disabled
|
|
192
192
|
@focus="onFocus"
|
|
193
193
|
@blur="updateDate"
|
|
194
194
|
>
|
package/lib/components/SLink.vue
CHANGED
|
@@ -39,10 +39,10 @@ const rel = computed(() => isExternal.value ? 'noopener noreferrer' : null)
|
|
|
39
39
|
:is="component"
|
|
40
40
|
class="SLink"
|
|
41
41
|
:class="{ link: href }"
|
|
42
|
-
:href
|
|
42
|
+
:href
|
|
43
43
|
:to="href"
|
|
44
|
-
:target
|
|
45
|
-
:rel
|
|
44
|
+
:target
|
|
45
|
+
:rel
|
|
46
46
|
>
|
|
47
47
|
<slot />
|
|
48
48
|
</component>
|
|
@@ -40,8 +40,8 @@ const normalizedMenu = computed(() => {
|
|
|
40
40
|
</div>
|
|
41
41
|
<div class="title-bar-body">
|
|
42
42
|
<div class="title-bar-title">
|
|
43
|
-
<SLocalNavTitle :title
|
|
44
|
-
<SLocalNavActions v-if="actions?.length" :actions
|
|
43
|
+
<SLocalNavTitle :title />
|
|
44
|
+
<SLocalNavActions v-if="actions?.length" :actions />
|
|
45
45
|
</div>
|
|
46
46
|
<SLocalNavDescription v-if="description" :text="description" />
|
|
47
47
|
</div>
|
package/lib/components/SM.vue
CHANGED
|
@@ -11,16 +11,18 @@ export type Align = 'left' | 'center' | 'right'
|
|
|
11
11
|
|
|
12
12
|
const props = withDefaults(defineProps<{
|
|
13
13
|
size?: Size
|
|
14
|
+
disabled?: boolean
|
|
14
15
|
align?: Align
|
|
15
16
|
total: number
|
|
16
17
|
page: number
|
|
17
18
|
perPage: number
|
|
18
19
|
}>(), {
|
|
19
20
|
size: 'medium',
|
|
21
|
+
disabled: false,
|
|
20
22
|
align: 'center'
|
|
21
23
|
})
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
defineEmits<{
|
|
24
26
|
prev: []
|
|
25
27
|
next: []
|
|
26
28
|
}>()
|
|
@@ -47,14 +49,6 @@ const hasPrev = computed(() => {
|
|
|
47
49
|
const hasNext = computed(() => {
|
|
48
50
|
return to.value < props.total
|
|
49
51
|
})
|
|
50
|
-
|
|
51
|
-
function prev() {
|
|
52
|
-
hasPrev.value && emit('prev')
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function next() {
|
|
56
|
-
hasNext.value && emit('next')
|
|
57
|
-
}
|
|
58
52
|
</script>
|
|
59
53
|
|
|
60
54
|
<template>
|
|
@@ -63,11 +57,11 @@ function next() {
|
|
|
63
57
|
<SButton
|
|
64
58
|
type="outline"
|
|
65
59
|
mode="mute"
|
|
66
|
-
:size
|
|
60
|
+
:size
|
|
67
61
|
:lead-icon="IconCaretLeft"
|
|
68
62
|
:label="t.prev"
|
|
69
|
-
:disabled="!hasPrev"
|
|
70
|
-
@click="prev"
|
|
63
|
+
:disabled="disabled || !hasPrev"
|
|
64
|
+
@click="$emit('prev')"
|
|
71
65
|
/>
|
|
72
66
|
</div>
|
|
73
67
|
<div class="text">
|
|
@@ -77,11 +71,11 @@ function next() {
|
|
|
77
71
|
<SButton
|
|
78
72
|
type="outline"
|
|
79
73
|
mode="mute"
|
|
80
|
-
:size
|
|
74
|
+
:size
|
|
81
75
|
:trail-icon="IconCaretRight"
|
|
82
76
|
:label="t.next"
|
|
83
|
-
:disabled="!hasNext"
|
|
84
|
-
@click="next"
|
|
77
|
+
:disabled="disabled || !hasNext"
|
|
78
|
+
@click="$emit('next')"
|
|
85
79
|
/>
|
|
86
80
|
</div>
|
|
87
81
|
</div>
|
|
@@ -401,7 +401,7 @@ function getStyles(key: string) {
|
|
|
401
401
|
<div class="row" ref="row">
|
|
402
402
|
<STableItem
|
|
403
403
|
v-for="key in ordersToShow"
|
|
404
|
-
:key
|
|
404
|
+
:key
|
|
405
405
|
:name="key"
|
|
406
406
|
:class-name="unref(options.columns)[key]?.className"
|
|
407
407
|
:style="getStyles(key)"
|
|
@@ -460,7 +460,7 @@ function getStyles(key: string) {
|
|
|
460
460
|
>
|
|
461
461
|
<STableItem
|
|
462
462
|
v-for="key in ordersToShow"
|
|
463
|
-
:key
|
|
463
|
+
:key
|
|
464
464
|
:name="key"
|
|
465
465
|
:class-name="unref(options.columns)[key]?.className"
|
|
466
466
|
:style="getStyles(key)"
|
|
@@ -35,8 +35,8 @@ const computedCell = computed<TableCell | undefined>(() =>
|
|
|
35
35
|
<div class="STableCell" :class="[className, `col-${name}`]">
|
|
36
36
|
<STableCellText
|
|
37
37
|
v-if="!computedCell || computedCell.type === 'text'"
|
|
38
|
-
:value
|
|
39
|
-
:record
|
|
38
|
+
:value
|
|
39
|
+
:record
|
|
40
40
|
:align="computedCell?.align"
|
|
41
41
|
:icon="computedCell?.icon"
|
|
42
42
|
:text="computedCell?.value"
|
|
@@ -47,8 +47,8 @@ const computedCell = computed<TableCell | undefined>(() =>
|
|
|
47
47
|
/>
|
|
48
48
|
<STableCellNumber
|
|
49
49
|
v-else-if="computedCell.type === 'number'"
|
|
50
|
-
:value
|
|
51
|
-
:record
|
|
50
|
+
:value
|
|
51
|
+
:record
|
|
52
52
|
:align="computedCell.align"
|
|
53
53
|
:icon="computedCell.icon"
|
|
54
54
|
:number="computedCell.value"
|
|
@@ -90,8 +90,8 @@ const computedCell = computed<TableCell | undefined>(() =>
|
|
|
90
90
|
/>
|
|
91
91
|
<STableCellAvatar
|
|
92
92
|
v-else-if="computedCell.type === 'avatar'"
|
|
93
|
-
:value
|
|
94
|
-
:record
|
|
93
|
+
:value
|
|
94
|
+
:record
|
|
95
95
|
:image="computedCell.image"
|
|
96
96
|
:name="computedCell.name"
|
|
97
97
|
:link="computedCell.link"
|
|
@@ -108,7 +108,7 @@ const computedCell = computed<TableCell | undefined>(() =>
|
|
|
108
108
|
/>
|
|
109
109
|
<STableCellActions
|
|
110
110
|
v-else-if="computedCell.type === 'actions'"
|
|
111
|
-
:record
|
|
111
|
+
:record
|
|
112
112
|
:actions="computedCell.actions"
|
|
113
113
|
/>
|
|
114
114
|
<STableCellCustom
|
|
@@ -122,8 +122,8 @@ const computedCell = computed<TableCell | undefined>(() =>
|
|
|
122
122
|
<component
|
|
123
123
|
v-else-if="computedCell.type === 'component'"
|
|
124
124
|
:is="computedCell.component"
|
|
125
|
-
:value
|
|
126
|
-
:record
|
|
125
|
+
:value
|
|
126
|
+
:record
|
|
127
127
|
v-bind="computedCell.props"
|
|
128
128
|
/>
|
|
129
129
|
</div>
|
|
@@ -22,7 +22,7 @@ defineProps<{
|
|
|
22
22
|
@click="() => onClick?.(value, record)"
|
|
23
23
|
>
|
|
24
24
|
<div v-if="image || name" class="avatar">
|
|
25
|
-
<SAvatar size="mini" :avatar="image" :name
|
|
25
|
+
<SAvatar size="mini" :avatar="image" :name />
|
|
26
26
|
</div>
|
|
27
27
|
<span v-if="name" class="name">
|
|
28
28
|
{{ name }}
|
|
@@ -50,7 +50,7 @@ const displayNames = computed(() => {
|
|
|
50
50
|
<div v-if="displayAvatars.length" class="avatars">
|
|
51
51
|
<div v-for="(avatar, index) in displayAvatars" :key="index" class="avatar">
|
|
52
52
|
<div class="avatar-box">
|
|
53
|
-
<SAvatar size="mini" :avatar="avatar.image" :name="avatar.name" :tooltip
|
|
53
|
+
<SAvatar size="mini" :avatar="avatar.image" :name="avatar.name" :tooltip />
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
56
|
<div v-if="avatarDiff > 0" class="avatar">
|
|
@@ -13,9 +13,9 @@ withDefaults(defineProps<TableHeaderAction>(), {
|
|
|
13
13
|
<div v-if="show" class="STableHeaderActionItem">
|
|
14
14
|
<SButton
|
|
15
15
|
size="mini"
|
|
16
|
-
:mode
|
|
17
|
-
:label
|
|
18
|
-
:label-mode
|
|
16
|
+
:mode
|
|
17
|
+
:label
|
|
18
|
+
:label-mode
|
|
19
19
|
@click="onClick"
|
|
20
20
|
/>
|
|
21
21
|
</div>
|
|
@@ -97,7 +97,7 @@ onBeforeUnmount(() => {
|
|
|
97
97
|
</script>
|
|
98
98
|
|
|
99
99
|
<template>
|
|
100
|
-
<component ref="root" :is="tag" class="STooltip" :class="rootClasses" :tabindex
|
|
100
|
+
<component ref="root" :is="tag" class="STooltip" :class="rootClasses" :tabindex>
|
|
101
101
|
<component :is="triggerTag" class="trigger" ref="trigger">
|
|
102
102
|
<slot />
|
|
103
103
|
</component>
|
package/lib/support/Day.ts
CHANGED
|
@@ -132,3 +132,7 @@ export function isHms(value: unknown, required: HmsType[] = ['h', 'm', 's']): va
|
|
|
132
132
|
}, [])
|
|
133
133
|
.every((key) => value[key] === null || isString(value[key]))
|
|
134
134
|
}
|
|
135
|
+
|
|
136
|
+
export function isDay(value: unknown): value is Day {
|
|
137
|
+
return dayjs.isDayjs(value)
|
|
138
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Day } from '../../support/Day'
|
|
2
|
+
import { createRule } from '../Rule'
|
|
3
|
+
import { after as baseAfter } from '../validators/after'
|
|
4
|
+
|
|
5
|
+
export const message = {
|
|
6
|
+
en: (date: string) => `Date must be after ${date}.`,
|
|
7
|
+
ja: (date: string) => `${date}より後の日付を指定してください。`
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function after(date: Day, msg?: string) {
|
|
11
|
+
return createRule({
|
|
12
|
+
message: ({ lang }) => msg ?? message[lang](date.format('YYYY-MM-DD')),
|
|
13
|
+
optional: true,
|
|
14
|
+
validation: (value) => baseAfter(value, date)
|
|
15
|
+
})
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Day } from '../../support/Day'
|
|
2
|
+
import { createRule } from '../Rule'
|
|
3
|
+
import { afterOrEqual as baseAfterOrEqual } from '../validators/afterOrEqual'
|
|
4
|
+
|
|
5
|
+
export const message = {
|
|
6
|
+
en: (date: string) => `Date must be after or equal to ${date}.`,
|
|
7
|
+
ja: (date: string) => `${date}より後、または同じ日付を指定してください。`
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function afterOrEqual(date: Day, msg?: string) {
|
|
11
|
+
return createRule({
|
|
12
|
+
message: ({ lang }) => msg ?? message[lang](date.format('YYYY-MM-DD')),
|
|
13
|
+
optional: true,
|
|
14
|
+
validation: (value) => baseAfterOrEqual(value, date)
|
|
15
|
+
})
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Day } from '../../support/Day'
|
|
2
|
+
import { createRule } from '../Rule'
|
|
3
|
+
import { before as baseBefore } from '../validators/before'
|
|
4
|
+
|
|
5
|
+
export const message = {
|
|
6
|
+
en: (date: string) => `Date must be before ${date}.`,
|
|
7
|
+
ja: (date: string) => `${date}より前の日付を指定してください。`
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function before(date: Day, msg?: string) {
|
|
11
|
+
return createRule({
|
|
12
|
+
message: ({ lang }) => msg ?? message[lang](date.format('YYYY-MM-DD')),
|
|
13
|
+
optional: true,
|
|
14
|
+
validation: (value) => baseBefore(value, date)
|
|
15
|
+
})
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Day } from '../../support/Day'
|
|
2
|
+
import { createRule } from '../Rule'
|
|
3
|
+
import { beforeOrEqual as baseBeforeOrEqual } from '../validators/beforeOrEqual'
|
|
4
|
+
|
|
5
|
+
export const message = {
|
|
6
|
+
en: (date: string) => `Date must be before or equal to ${date}.`,
|
|
7
|
+
ja: (date: string) => `${date}より前、または同じ日付を指定してください。`
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function beforeOrEqual(date: Day, msg?: string) {
|
|
11
|
+
return createRule({
|
|
12
|
+
message: ({ lang }) => msg ?? message[lang](date.format('YYYY-MM-DD')),
|
|
13
|
+
optional: true,
|
|
14
|
+
validation: (value) => baseBeforeOrEqual(value, date)
|
|
15
|
+
})
|
|
16
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export { and, not, or } from '@vuelidate/validators'
|
|
2
|
+
export { after } from './after'
|
|
3
|
+
export { afterOrEqual } from './afterOrEqual'
|
|
4
|
+
export { before } from './before'
|
|
5
|
+
export { beforeOrEqual } from './beforeOrEqual'
|
|
2
6
|
export { checked } from './checked'
|
|
3
7
|
export { decimal } from './decimal'
|
|
4
8
|
export { decimalOrHyphen } from './decimalOrHyphen'
|