@globalbrain/sefirot 0.65.0 → 0.68.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/CHANGELOG.md +49 -0
- package/README.md +5 -17
- package/lib/.DS_Store +0 -0
- package/lib/assets/styles/variables.css +345 -5
- package/lib/components/.DS_Store +0 -0
- package/lib/components/SButton.vue +22 -27
- package/lib/components/SButtonGroup.vue +40 -22
- package/lib/components/SDialog.vue +4 -3
- package/lib/components/SInputBase.vue +27 -5
- package/lib/components/SInputNumber.vue +18 -1
- package/lib/components/SInputRadio.vue +5 -4
- package/lib/components/SInputText.vue +176 -19
- package/lib/components/SInputTextarea.vue +13 -2
- package/lib/components/SInputYMD.vue +244 -0
- package/lib/components/SModal.vue +7 -2
- package/lib/components/SSheet.vue +47 -0
- package/lib/components/SSheetFooter.vue +14 -0
- package/lib/components/SSheetFooterAction.vue +32 -0
- package/lib/components/SSheetFooterActions.vue +19 -0
- package/lib/components/SSheetHeader.vue +75 -0
- package/lib/components/SSheetHeaderTitle.vue +17 -0
- package/lib/components/SSheetMedium.vue +92 -0
- package/lib/components/SSnackbar.vue +7 -2
- package/lib/components/icons/.DS_Store +0 -0
- package/lib/components/icons/SIconGrab.vue +10 -0
- package/lib/components/icons/SIconInbox.vue +5 -0
- package/lib/components/icons/SIconLock.vue +5 -0
- package/lib/components/icons/SIconMoreVertical.vue +7 -0
- package/lib/components/icons/SIconPreloader.vue +239 -0
- package/lib/composables/Modal.ts +16 -5
- package/lib/composables/Tooltip.ts +1 -1
- package/lib/mixins/Sheet.ts +22 -0
- package/lib/validation/rules/every.ts +38 -0
- package/lib/validation/rules/index.ts +13 -1
- package/lib/validation/rules/requiredMonthDate.ts +11 -0
- package/lib/validation/rules/requiredYearMonth.ts +11 -0
- package/lib/validation/rules/requiredYearMonthDate.ts +11 -0
- package/lib/validation/rules/yearMonth.ts +11 -0
- package/lib/validation/rules/yearMonthDate.ts +11 -0
- package/lib/validation/validators/index.ts +13 -1
- package/lib/validation/validators/monthDate.ts +20 -0
- package/lib/validation/validators/requiredMonthDate.ts +8 -0
- package/lib/validation/validators/requiredYearMonth.ts +8 -0
- package/lib/validation/validators/requiredYearMonthDate.ts +9 -0
- package/lib/validation/validators/yearMonth.ts +20 -0
- package/lib/validation/validators/yearMonthDate.ts +21 -0
- package/package.json +30 -29
- package/lib/assets/styles/variables/colors.css +0 -189
- package/lib/assets/styles/variables/easings.css +0 -12
- package/lib/assets/styles/variables/shadows.css +0 -7
- package/lib/assets/styles/variables/typography.css +0 -6
- package/lib/assets/styles/variables/z-indexes.css +0 -8
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
|
|
3
|
+
<g transform="rotate(0 50 50)">
|
|
4
|
+
<rect
|
|
5
|
+
class="bar"
|
|
6
|
+
x="48"
|
|
7
|
+
y="23"
|
|
8
|
+
rx="9.6"
|
|
9
|
+
ry="4.6000000000000005"
|
|
10
|
+
width="4"
|
|
11
|
+
height="14"
|
|
12
|
+
>
|
|
13
|
+
<animate
|
|
14
|
+
attributeName="opacity"
|
|
15
|
+
values="1;0"
|
|
16
|
+
keyTimes="0;1"
|
|
17
|
+
dur="1s"
|
|
18
|
+
begin="-0.9166666666666666s"
|
|
19
|
+
repeatCount="indefinite"
|
|
20
|
+
/>
|
|
21
|
+
</rect>
|
|
22
|
+
</g><g transform="rotate(30 50 50)">
|
|
23
|
+
<rect
|
|
24
|
+
class="bar"
|
|
25
|
+
x="48"
|
|
26
|
+
y="23"
|
|
27
|
+
rx="9.6"
|
|
28
|
+
ry="4.6000000000000005"
|
|
29
|
+
width="4"
|
|
30
|
+
height="14"
|
|
31
|
+
>
|
|
32
|
+
<animate
|
|
33
|
+
attributeName="opacity"
|
|
34
|
+
values="1;0"
|
|
35
|
+
keyTimes="0;1"
|
|
36
|
+
dur="1s"
|
|
37
|
+
begin="-0.8333333333333334s"
|
|
38
|
+
repeatCount="indefinite"
|
|
39
|
+
/>
|
|
40
|
+
</rect>
|
|
41
|
+
</g><g transform="rotate(60 50 50)">
|
|
42
|
+
<rect
|
|
43
|
+
class="bar"
|
|
44
|
+
x="48"
|
|
45
|
+
y="23"
|
|
46
|
+
rx="9.6"
|
|
47
|
+
ry="4.6000000000000005"
|
|
48
|
+
width="4"
|
|
49
|
+
height="14"
|
|
50
|
+
>
|
|
51
|
+
<animate
|
|
52
|
+
attributeName="opacity"
|
|
53
|
+
values="1;0"
|
|
54
|
+
keyTimes="0;1"
|
|
55
|
+
dur="1s"
|
|
56
|
+
begin="-0.75s"
|
|
57
|
+
repeatCount="indefinite"
|
|
58
|
+
/>
|
|
59
|
+
</rect>
|
|
60
|
+
</g><g transform="rotate(90 50 50)">
|
|
61
|
+
<rect
|
|
62
|
+
class="bar"
|
|
63
|
+
x="48"
|
|
64
|
+
y="23"
|
|
65
|
+
rx="9.6"
|
|
66
|
+
ry="4.6000000000000005"
|
|
67
|
+
width="4"
|
|
68
|
+
height="14"
|
|
69
|
+
>
|
|
70
|
+
<animate
|
|
71
|
+
attributeName="opacity"
|
|
72
|
+
values="1;0"
|
|
73
|
+
keyTimes="0;1"
|
|
74
|
+
dur="1s"
|
|
75
|
+
begin="-0.6666666666666666s"
|
|
76
|
+
repeatCount="indefinite"
|
|
77
|
+
/>
|
|
78
|
+
</rect>
|
|
79
|
+
</g><g transform="rotate(120 50 50)">
|
|
80
|
+
<rect
|
|
81
|
+
class="bar"
|
|
82
|
+
x="48"
|
|
83
|
+
y="23"
|
|
84
|
+
rx="9.6"
|
|
85
|
+
ry="4.6000000000000005"
|
|
86
|
+
width="4"
|
|
87
|
+
height="14"
|
|
88
|
+
>
|
|
89
|
+
<animate
|
|
90
|
+
attributeName="opacity"
|
|
91
|
+
values="1;0"
|
|
92
|
+
keyTimes="0;1"
|
|
93
|
+
dur="1s"
|
|
94
|
+
begin="-0.5833333333333334s"
|
|
95
|
+
repeatCount="indefinite"
|
|
96
|
+
/>
|
|
97
|
+
</rect>
|
|
98
|
+
</g><g transform="rotate(150 50 50)">
|
|
99
|
+
<rect
|
|
100
|
+
class="bar"
|
|
101
|
+
x="48"
|
|
102
|
+
y="23"
|
|
103
|
+
rx="9.6"
|
|
104
|
+
ry="4.6000000000000005"
|
|
105
|
+
width="4"
|
|
106
|
+
height="14"
|
|
107
|
+
>
|
|
108
|
+
<animate
|
|
109
|
+
attributeName="opacity"
|
|
110
|
+
values="1;0"
|
|
111
|
+
keyTimes="0;1"
|
|
112
|
+
dur="1s"
|
|
113
|
+
begin="-0.5s"
|
|
114
|
+
repeatCount="indefinite"
|
|
115
|
+
/>
|
|
116
|
+
</rect>
|
|
117
|
+
</g><g transform="rotate(180 50 50)">
|
|
118
|
+
<rect
|
|
119
|
+
class="bar"
|
|
120
|
+
x="48"
|
|
121
|
+
y="23"
|
|
122
|
+
rx="9.6"
|
|
123
|
+
ry="4.6000000000000005"
|
|
124
|
+
width="4"
|
|
125
|
+
height="14"
|
|
126
|
+
>
|
|
127
|
+
<animate
|
|
128
|
+
attributeName="opacity"
|
|
129
|
+
values="1;0"
|
|
130
|
+
keyTimes="0;1"
|
|
131
|
+
dur="1s"
|
|
132
|
+
begin="-0.4166666666666667s"
|
|
133
|
+
repeatCount="indefinite"
|
|
134
|
+
/>
|
|
135
|
+
</rect>
|
|
136
|
+
</g><g transform="rotate(210 50 50)">
|
|
137
|
+
<rect
|
|
138
|
+
class="bar"
|
|
139
|
+
x="48"
|
|
140
|
+
y="23"
|
|
141
|
+
rx="9.6"
|
|
142
|
+
ry="4.6000000000000005"
|
|
143
|
+
width="4"
|
|
144
|
+
height="14"
|
|
145
|
+
>
|
|
146
|
+
<animate
|
|
147
|
+
attributeName="opacity"
|
|
148
|
+
values="1;0"
|
|
149
|
+
keyTimes="0;1"
|
|
150
|
+
dur="1s"
|
|
151
|
+
begin="-0.3333333333333333s"
|
|
152
|
+
repeatCount="indefinite"
|
|
153
|
+
/>
|
|
154
|
+
</rect>
|
|
155
|
+
</g><g transform="rotate(240 50 50)">
|
|
156
|
+
<rect
|
|
157
|
+
class="bar"
|
|
158
|
+
x="48"
|
|
159
|
+
y="23"
|
|
160
|
+
rx="9.6"
|
|
161
|
+
ry="4.6000000000000005"
|
|
162
|
+
width="4"
|
|
163
|
+
height="14"
|
|
164
|
+
>
|
|
165
|
+
<animate
|
|
166
|
+
attributeName="opacity"
|
|
167
|
+
values="1;0"
|
|
168
|
+
keyTimes="0;1"
|
|
169
|
+
dur="1s"
|
|
170
|
+
begin="-0.25s"
|
|
171
|
+
repeatCount="indefinite"
|
|
172
|
+
/>
|
|
173
|
+
</rect>
|
|
174
|
+
</g><g transform="rotate(270 50 50)">
|
|
175
|
+
<rect
|
|
176
|
+
class="bar"
|
|
177
|
+
x="48"
|
|
178
|
+
y="23"
|
|
179
|
+
rx="9.6"
|
|
180
|
+
ry="4.6000000000000005"
|
|
181
|
+
width="4"
|
|
182
|
+
height="14"
|
|
183
|
+
>
|
|
184
|
+
<animate
|
|
185
|
+
attributeName="opacity"
|
|
186
|
+
values="1;0"
|
|
187
|
+
keyTimes="0;1"
|
|
188
|
+
dur="1s"
|
|
189
|
+
begin="-0.16666666666666666s"
|
|
190
|
+
repeatCount="indefinite"
|
|
191
|
+
/>
|
|
192
|
+
</rect>
|
|
193
|
+
</g><g transform="rotate(300 50 50)">
|
|
194
|
+
<rect
|
|
195
|
+
class="bar"
|
|
196
|
+
x="48"
|
|
197
|
+
y="23"
|
|
198
|
+
rx="9.6"
|
|
199
|
+
ry="4.6000000000000005"
|
|
200
|
+
width="4"
|
|
201
|
+
height="14"
|
|
202
|
+
>
|
|
203
|
+
<animate
|
|
204
|
+
attributeName="opacity"
|
|
205
|
+
values="1;0"
|
|
206
|
+
keyTimes="0;1"
|
|
207
|
+
dur="1s"
|
|
208
|
+
begin="-0.08333333333333333s"
|
|
209
|
+
repeatCount="indefinite"
|
|
210
|
+
/>
|
|
211
|
+
</rect>
|
|
212
|
+
</g><g transform="rotate(330 50 50)">
|
|
213
|
+
<rect
|
|
214
|
+
class="bar"
|
|
215
|
+
x="48"
|
|
216
|
+
y="23"
|
|
217
|
+
rx="9.6"
|
|
218
|
+
ry="4.6000000000000005"
|
|
219
|
+
width="4"
|
|
220
|
+
height="14"
|
|
221
|
+
>
|
|
222
|
+
<animate
|
|
223
|
+
attributeName="opacity"
|
|
224
|
+
values="1;0"
|
|
225
|
+
keyTimes="0;1"
|
|
226
|
+
dur="1s"
|
|
227
|
+
begin="0s"
|
|
228
|
+
repeatCount="indefinite"
|
|
229
|
+
/>
|
|
230
|
+
</rect>
|
|
231
|
+
</g></svg>
|
|
232
|
+
</template>
|
|
233
|
+
|
|
234
|
+
<style lang="postcss" scoped>
|
|
235
|
+
.bar {
|
|
236
|
+
fill: var(--preloader-color);
|
|
237
|
+
transition: fill .5s;
|
|
238
|
+
}
|
|
239
|
+
</style>
|
package/lib/composables/Modal.ts
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Options as ModalOptions } from '../store/modal'
|
|
2
2
|
import { useStore } from './Store'
|
|
3
3
|
|
|
4
4
|
export interface Modal {
|
|
5
|
-
open(item
|
|
5
|
+
open(item?: OpenOptions): Promise<any>
|
|
6
6
|
close(): Promise<any>
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
export interface OpenOptions {
|
|
10
|
+
component?: any
|
|
11
|
+
uid?: number
|
|
12
|
+
data?: Record<string, any>
|
|
13
|
+
options?: ModalOptions
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
let modalUid = 0
|
|
10
17
|
|
|
11
|
-
export function useModal(): Modal {
|
|
18
|
+
export function useModal(component?: any): Modal {
|
|
12
19
|
const store = useStore()
|
|
13
20
|
const uid = useModalUid()
|
|
14
21
|
|
|
15
|
-
function open(item:
|
|
16
|
-
return store.dispatch('modal/open', {
|
|
22
|
+
function open(item: OpenOptions = {}) {
|
|
23
|
+
return store.dispatch('modal/open', {
|
|
24
|
+
uid,
|
|
25
|
+
component,
|
|
26
|
+
...item
|
|
27
|
+
})
|
|
17
28
|
}
|
|
18
29
|
|
|
19
30
|
function close() {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineComponent } from '@vue/composition-api'
|
|
2
|
+
import SSheet from '../components/SSheet.vue'
|
|
3
|
+
import SSheetHeader from '../components/SSheetHeader.vue'
|
|
4
|
+
import SSheetHeaderTitle from '../components/SSheetHeaderTitle.vue'
|
|
5
|
+
import SSheetMedium from '../components/SSheetMedium.vue'
|
|
6
|
+
import SSheetFooter from '../components/SSheetFooter.vue'
|
|
7
|
+
import SSheetFooterActions from '../components/SSheetFooterActions.vue'
|
|
8
|
+
import SSheetFooterAction from '../components/SSheetFooterAction.vue'
|
|
9
|
+
|
|
10
|
+
export default function Sheet() {
|
|
11
|
+
return defineComponent({
|
|
12
|
+
components: {
|
|
13
|
+
SSheet,
|
|
14
|
+
SSheetHeader,
|
|
15
|
+
SSheetHeaderTitle,
|
|
16
|
+
SSheetMedium,
|
|
17
|
+
SSheetFooter,
|
|
18
|
+
SSheetFooterActions,
|
|
19
|
+
SSheetFooterAction
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Rule } from './'
|
|
2
|
+
|
|
3
|
+
interface Options {
|
|
4
|
+
[name: string]: Rule[]
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default function every(options: Options): Rule {
|
|
8
|
+
return {
|
|
9
|
+
name: 'each',
|
|
10
|
+
message: 'Error found in items.',
|
|
11
|
+
optional: true,
|
|
12
|
+
validate(value: Record<string, any>[], data): boolean {
|
|
13
|
+
return value.every(item => check(options, item, data))
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function check(
|
|
19
|
+
options: Options,
|
|
20
|
+
item: Record<string, any>,
|
|
21
|
+
data: any
|
|
22
|
+
): boolean {
|
|
23
|
+
for (const key in item) {
|
|
24
|
+
const rules = options[key]
|
|
25
|
+
|
|
26
|
+
if (!rules) {
|
|
27
|
+
continue
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const result = rules.every(rule => rule.validate(item[key], data))
|
|
31
|
+
|
|
32
|
+
if (!result) {
|
|
33
|
+
return false
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return true
|
|
38
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isString } from '../../support/Util'
|
|
2
2
|
import day from './day'
|
|
3
|
+
import every from './every'
|
|
3
4
|
import email from './email'
|
|
4
5
|
import include from './include'
|
|
5
6
|
import includeSome from './includeSome'
|
|
@@ -12,11 +13,16 @@ import not from './not'
|
|
|
12
13
|
import regex from './regex'
|
|
13
14
|
import required from './required'
|
|
14
15
|
import requiredIf from './requiredIf'
|
|
16
|
+
import requiredMonthDate from './requiredMonthDate'
|
|
17
|
+
import requiredYearMonth from './requiredYearMonth'
|
|
18
|
+
import requiredYearMonthDate from './requiredYearMonthDate'
|
|
15
19
|
import rule from './rule'
|
|
16
20
|
import sameAs from './sameAs'
|
|
17
21
|
import url from './url'
|
|
18
22
|
import validateIf from './validateIf'
|
|
19
23
|
import year from './year'
|
|
24
|
+
import yearMonth from './yearMonth'
|
|
25
|
+
import yearMonthDate from './yearMonthDate'
|
|
20
26
|
|
|
21
27
|
export interface Rule {
|
|
22
28
|
name: string
|
|
@@ -34,6 +40,7 @@ export function locate(data: Record<string, any>, locator: Locator): any {
|
|
|
34
40
|
|
|
35
41
|
export {
|
|
36
42
|
day,
|
|
43
|
+
every,
|
|
37
44
|
email,
|
|
38
45
|
include,
|
|
39
46
|
includeSome,
|
|
@@ -46,9 +53,14 @@ export {
|
|
|
46
53
|
regex,
|
|
47
54
|
required,
|
|
48
55
|
requiredIf,
|
|
56
|
+
requiredMonthDate,
|
|
57
|
+
requiredYearMonth,
|
|
58
|
+
requiredYearMonthDate,
|
|
49
59
|
rule,
|
|
50
60
|
sameAs,
|
|
51
61
|
url,
|
|
52
62
|
validateIf,
|
|
53
|
-
year
|
|
63
|
+
year,
|
|
64
|
+
yearMonth,
|
|
65
|
+
yearMonthDate
|
|
54
66
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { requiredMonthDate as baseRequiredMonthDate } from '../validators'
|
|
2
|
+
import { Rule } from './'
|
|
3
|
+
|
|
4
|
+
export default function requiredMonthDate(message?: string): Rule {
|
|
5
|
+
return {
|
|
6
|
+
name: 'requiredMonthDate',
|
|
7
|
+
message: message ?? 'The field is required.',
|
|
8
|
+
optional: true,
|
|
9
|
+
validate: baseRequiredMonthDate
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { requiredYearMonth as baseRequiredYearMonth } from '../validators'
|
|
2
|
+
import { Rule } from './'
|
|
3
|
+
|
|
4
|
+
export default function requiredYearMonth(message?: string): Rule {
|
|
5
|
+
return {
|
|
6
|
+
name: 'requiredYearMonth',
|
|
7
|
+
message: message ?? 'The field is required.',
|
|
8
|
+
optional: true,
|
|
9
|
+
validate: baseRequiredYearMonth
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { requiredYearMonthDate as baseRequiredYearMonthDate } from '../validators'
|
|
2
|
+
import { Rule } from './'
|
|
3
|
+
|
|
4
|
+
export default function requiredYearMonthDate(message?: string): Rule {
|
|
5
|
+
return {
|
|
6
|
+
name: 'requiredYearMonthDate',
|
|
7
|
+
message: message ?? 'The field is required.',
|
|
8
|
+
optional: true,
|
|
9
|
+
validate: baseRequiredYearMonthDate
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { yearMonth as baseYearMonth } from '../validators'
|
|
2
|
+
import { Rule } from './'
|
|
3
|
+
|
|
4
|
+
export default function yearMonth(message?: string): Rule {
|
|
5
|
+
return {
|
|
6
|
+
name: 'yearMonth',
|
|
7
|
+
message: message ?? 'The date is invalid.',
|
|
8
|
+
optional: true,
|
|
9
|
+
validate: baseYearMonth
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { yearMonthDate as baseYearMonthDate } from '../validators'
|
|
2
|
+
import { Rule } from './'
|
|
3
|
+
|
|
4
|
+
export default function year(message?: string): Rule {
|
|
5
|
+
return {
|
|
6
|
+
name: 'yearMonthDate',
|
|
7
|
+
message: message ?? 'The date is invalid.',
|
|
8
|
+
optional: true,
|
|
9
|
+
validate: baseYearMonthDate
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -7,11 +7,17 @@ import maxLength from './maxLength'
|
|
|
7
7
|
import maxValue from './maxValue'
|
|
8
8
|
import minValue from './minValue'
|
|
9
9
|
import month from './month'
|
|
10
|
+
import monthDate from './monthDate'
|
|
10
11
|
import regex from './regex'
|
|
11
12
|
import required from './required'
|
|
13
|
+
import requiredMonthDate from './requiredMonthDate'
|
|
14
|
+
import requiredYearMonth from './requiredYearMonth'
|
|
15
|
+
import requiredYearMonthDate from './requiredYearMonthDate'
|
|
12
16
|
import sameAs from './sameAs'
|
|
13
17
|
import url from './url'
|
|
14
18
|
import year from './year'
|
|
19
|
+
import yearMonthDate from './yearMonthDate'
|
|
20
|
+
import yearMonth from './yearMonth'
|
|
15
21
|
|
|
16
22
|
export {
|
|
17
23
|
day,
|
|
@@ -23,9 +29,15 @@ export {
|
|
|
23
29
|
maxValue,
|
|
24
30
|
minValue,
|
|
25
31
|
month,
|
|
32
|
+
monthDate,
|
|
26
33
|
regex,
|
|
27
34
|
required,
|
|
35
|
+
requiredMonthDate,
|
|
36
|
+
requiredYearMonth,
|
|
37
|
+
requiredYearMonthDate,
|
|
28
38
|
sameAs,
|
|
29
39
|
url,
|
|
30
|
-
year
|
|
40
|
+
year,
|
|
41
|
+
yearMonthDate,
|
|
42
|
+
yearMonth
|
|
31
43
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import day from 'dayjs'
|
|
2
|
+
|
|
3
|
+
export interface MonthDate {
|
|
4
|
+
month?: number
|
|
5
|
+
date?: number
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default function monthDate(value: MonthDate): boolean {
|
|
9
|
+
if (value.month === undefined || value.date === undefined) {
|
|
10
|
+
return true
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const d = day(new Date(2020, value.month - 1, value.date))
|
|
14
|
+
|
|
15
|
+
if (d.month() + 1 !== value.month) {
|
|
16
|
+
return false
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return d.isValid()
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface YearMonthDate {
|
|
2
|
+
year?: number
|
|
3
|
+
month?: number
|
|
4
|
+
date?: number
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default function requiredYearMonthDate(value: YearMonthDate): boolean {
|
|
8
|
+
return !(value.year === undefined || value.month === undefined || value.date === undefined)
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface YearMonth {
|
|
2
|
+
year?: number
|
|
3
|
+
month?: number
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export default function yearMonth(value: YearMonth): boolean {
|
|
7
|
+
if (value.year === undefined || value.month === undefined) {
|
|
8
|
+
return true
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (value.year < 0 || value.year > 9999) {
|
|
12
|
+
return false
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (value.month < 0 || value.month > 12) {
|
|
16
|
+
return false
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return true
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import day from 'dayjs'
|
|
2
|
+
|
|
3
|
+
export interface YearMonthDate {
|
|
4
|
+
year?: number
|
|
5
|
+
month?: number
|
|
6
|
+
date?: number
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function yearMonthDate(value: YearMonthDate): boolean {
|
|
10
|
+
if (value.year === undefined || value.month === undefined || value.date === undefined) {
|
|
11
|
+
return true
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const d = day(new Date(value.year, value.month - 1, value.date))
|
|
15
|
+
|
|
16
|
+
if (d.month() + 1 !== value.month) {
|
|
17
|
+
return false
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return d.isValid()
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@globalbrain/sefirot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.68.0",
|
|
4
4
|
"description": "Vue Components for Global Brain Design System.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib"
|
|
@@ -36,51 +36,52 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@juggle/resize-observer": "^3.3.1",
|
|
39
|
-
"@nuxt/types": "^2.15.
|
|
39
|
+
"@nuxt/types": "^2.15.8",
|
|
40
40
|
"@nuxt/typescript-build": "^2.1.0",
|
|
41
|
-
"@nuxtjs/
|
|
41
|
+
"@nuxtjs/color-mode": "^2.1.1",
|
|
42
|
+
"@nuxtjs/composition-api": "^0.29.3",
|
|
42
43
|
"@nuxtjs/dotenv": "^1.4.1",
|
|
43
|
-
"@nuxtjs/eslint-config-typescript": "^6.0.
|
|
44
|
+
"@nuxtjs/eslint-config-typescript": "^6.0.1",
|
|
44
45
|
"@nuxtjs/google-analytics": "^2.4.0",
|
|
45
46
|
"@nuxtjs/markdownit": "^1.2.10",
|
|
46
|
-
"@types/body-scroll-lock": "^
|
|
47
|
+
"@types/body-scroll-lock": "^3.1.0",
|
|
47
48
|
"@types/escape-html": "^1.0.1",
|
|
48
|
-
"@types/jest": "^
|
|
49
|
-
"@types/lodash-es": "^4.17.
|
|
50
|
-
"@types/markdown-it": "^12.
|
|
51
|
-
"@types/prismjs": "^1.16.
|
|
52
|
-
"@vue/composition-api": "^1.
|
|
53
|
-
"@vue/test-utils": "^1.
|
|
49
|
+
"@types/jest": "^27.0.2",
|
|
50
|
+
"@types/lodash-es": "^4.17.5",
|
|
51
|
+
"@types/markdown-it": "^12.2.3",
|
|
52
|
+
"@types/prismjs": "^1.16.6",
|
|
53
|
+
"@vue/composition-api": "^1.2.4",
|
|
54
|
+
"@vue/test-utils": "^1.2.2",
|
|
55
|
+
"@vue/vue2-jest": "^27.0.0-alpha.2",
|
|
54
56
|
"babel-core": "^7.0.0-bridge.0",
|
|
55
57
|
"body-scroll-lock": "^3.1.5",
|
|
56
|
-
"codecov": "^3.8.
|
|
58
|
+
"codecov": "^3.8.3",
|
|
57
59
|
"conventional-changelog-cli": "^2.1.1",
|
|
58
|
-
"dayjs": "^1.10.
|
|
60
|
+
"dayjs": "^1.10.7",
|
|
59
61
|
"escape-html": "^1.0.3",
|
|
60
|
-
"eslint": "^7.
|
|
62
|
+
"eslint": "^7.32.0",
|
|
61
63
|
"fuse.js": "^6.4.6",
|
|
62
|
-
"jest": "^
|
|
64
|
+
"jest": "^27.3.1",
|
|
63
65
|
"jest-serializer-vue": "^2.0.2",
|
|
64
66
|
"lodash": "^4.17.21",
|
|
65
67
|
"lodash-es": "^4.17.21",
|
|
66
|
-
"markdown-it": "^12.0
|
|
67
|
-
"markdown-it-anchor": "^
|
|
68
|
+
"markdown-it": "^12.2.0",
|
|
69
|
+
"markdown-it-anchor": "^8.4.1",
|
|
68
70
|
"normalize.css": "^8.0.1",
|
|
69
|
-
"nuxt": "^2.15.
|
|
71
|
+
"nuxt": "^2.15.8",
|
|
70
72
|
"portal-vue": "^2.1.7",
|
|
71
73
|
"postcss-custom-properties": "^10.0.0",
|
|
72
74
|
"postcss-nested": "^4.2.3",
|
|
73
|
-
"prismjs": "^1.
|
|
75
|
+
"prismjs": "^1.25.0",
|
|
74
76
|
"push-dir": "^0.4.1",
|
|
75
|
-
"simplebar-vue": "^1.6.
|
|
76
|
-
"ts-jest": "^
|
|
77
|
-
"ts-loader": "^8.
|
|
78
|
-
"typescript": "^4.
|
|
79
|
-
"v-calendar": "^2.3.
|
|
80
|
-
"vue": "^2.6.
|
|
81
|
-
"vue-
|
|
82
|
-
"vue-
|
|
83
|
-
"vue-
|
|
84
|
-
"vue-template-compiler": "^2.6.12"
|
|
77
|
+
"simplebar-vue": "^1.6.8",
|
|
78
|
+
"ts-jest": "^27.0.7",
|
|
79
|
+
"ts-loader": "^8.3.0",
|
|
80
|
+
"typescript": "^4.4.4",
|
|
81
|
+
"v-calendar": "^2.3.4",
|
|
82
|
+
"vue": "^2.6.14",
|
|
83
|
+
"vue-router": "^3.5.2",
|
|
84
|
+
"vue-server-renderer": "^2.6.14",
|
|
85
|
+
"vue-template-compiler": "^2.6.14"
|
|
85
86
|
}
|
|
86
87
|
}
|