@globalbrain/sefirot 3.5.0 → 3.6.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/composables/Image.ts +8 -1
- package/lib/validation/rules/decimal.ts +3 -2
- package/lib/validation/rules/decimalOrHyphen.ts +8 -0
- package/lib/validation/rules/index.ts +5 -0
- package/lib/validation/rules/negativeInteger.ts +9 -0
- package/lib/validation/rules/positiveInteger.ts +9 -0
- package/lib/validation/rules/zeroOrNegativeInteger.ts +9 -0
- package/lib/validation/rules/zeroOrPositiveInteger.ts +9 -0
- package/lib/validation/validators/hyphen.ts +3 -0
- package/lib/validation/validators/index.ts +4 -0
- package/lib/validation/validators/negativeInteger.ts +3 -0
- package/lib/validation/validators/positiveInteger.ts +3 -0
- package/lib/validation/validators/zero.ts +3 -0
- package/package.json +11 -10
package/lib/composables/Image.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isClient } from '@vueuse/core'
|
|
1
2
|
import { type MaybeRefOrGetter, type Ref, ref, toValue, watchEffect } from 'vue'
|
|
2
3
|
import { isFile, isString } from '../support/Utils'
|
|
3
4
|
|
|
@@ -13,7 +14,13 @@ export interface ImageSrcFromFile {
|
|
|
13
14
|
export function useImageSrcFromFile(
|
|
14
15
|
file: MaybeRefOrGetter<File | string | null>
|
|
15
16
|
): ImageSrcFromFile {
|
|
16
|
-
|
|
17
|
+
if (!isClient) {
|
|
18
|
+
return {
|
|
19
|
+
src: ref(null)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const reader = new window.FileReader()
|
|
17
24
|
const src = ref<string | null>(null)
|
|
18
25
|
|
|
19
26
|
reader.onload = function () {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { decimal as baseDecimal, helpers } from '@vuelidate/validators'
|
|
1
|
+
import { and, decimal as baseDecimal, helpers, not } from '@vuelidate/validators'
|
|
2
|
+
import { hyphen } from '../validators'
|
|
2
3
|
|
|
3
4
|
export function decimal(msg?: string) {
|
|
4
5
|
return helpers.withMessage(
|
|
5
6
|
() => msg ?? 'The value must be valid decimal numbers.',
|
|
6
|
-
baseDecimal
|
|
7
|
+
and(not(hyphen), baseDecimal)
|
|
7
8
|
)
|
|
8
9
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { and, not, or } from '@vuelidate/validators'
|
|
2
2
|
export * from './checked'
|
|
3
3
|
export * from './decimal'
|
|
4
|
+
export * from './decimalOrHyphen'
|
|
4
5
|
export * from './email'
|
|
5
6
|
export * from './fileExtension'
|
|
6
7
|
export * from './hms'
|
|
@@ -11,6 +12,8 @@ export * from './maxValue'
|
|
|
11
12
|
export * from './minLength'
|
|
12
13
|
export * from './minValue'
|
|
13
14
|
export * from './month'
|
|
15
|
+
export * from './negativeInteger'
|
|
16
|
+
export * from './positiveInteger'
|
|
14
17
|
export * from './required'
|
|
15
18
|
export * from './requiredHms'
|
|
16
19
|
export * from './requiredIf'
|
|
@@ -18,3 +21,5 @@ export * from './requiredYmd'
|
|
|
18
21
|
export * from './rule'
|
|
19
22
|
export * from './url'
|
|
20
23
|
export * from './ymd'
|
|
24
|
+
export * from './zeroOrNegativeInteger'
|
|
25
|
+
export * from './zeroOrPositiveInteger'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { helpers } from '@vuelidate/validators'
|
|
2
|
+
import { negativeInteger as baseNegativeInteger } from '../validators'
|
|
3
|
+
|
|
4
|
+
export function negativeInteger(msg?: string) {
|
|
5
|
+
return helpers.withMessage(
|
|
6
|
+
() => msg ?? 'The value must be valid negative integer.',
|
|
7
|
+
baseNegativeInteger
|
|
8
|
+
)
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { helpers } from '@vuelidate/validators'
|
|
2
|
+
import { positiveInteger as basePositiveInteger } from '../validators'
|
|
3
|
+
|
|
4
|
+
export function positiveInteger(msg?: string) {
|
|
5
|
+
return helpers.withMessage(
|
|
6
|
+
() => msg ?? 'The value must be valid positive integer.',
|
|
7
|
+
basePositiveInteger
|
|
8
|
+
)
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { helpers, or } from '@vuelidate/validators'
|
|
2
|
+
import { negativeInteger, zero } from '../validators'
|
|
3
|
+
|
|
4
|
+
export function zeroOrNegativeInteger(msg?: string) {
|
|
5
|
+
return helpers.withMessage(
|
|
6
|
+
() => msg ?? 'The value must be zero or valid negative integer.',
|
|
7
|
+
or(zero, negativeInteger)
|
|
8
|
+
)
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { helpers, or } from '@vuelidate/validators'
|
|
2
|
+
import { positiveInteger, zero } from '../validators'
|
|
3
|
+
|
|
4
|
+
export function zeroOrPositiveInteger(msg?: string) {
|
|
5
|
+
return helpers.withMessage(
|
|
6
|
+
() => msg ?? 'The value must be zero or valid positive integer.',
|
|
7
|
+
or(zero, positiveInteger)
|
|
8
|
+
)
|
|
9
|
+
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export * from './checked'
|
|
2
2
|
export * from './fileExtension'
|
|
3
3
|
export * from './hms'
|
|
4
|
+
export * from './hyphen'
|
|
4
5
|
export * from './maxFileSize'
|
|
5
6
|
export * from './maxTotalFileSize'
|
|
6
7
|
export * from './month'
|
|
8
|
+
export * from './negativeInteger'
|
|
9
|
+
export * from './positiveInteger'
|
|
7
10
|
export * from './requiredHms'
|
|
8
11
|
export * from './requiredYmd'
|
|
9
12
|
export * from './ymd'
|
|
13
|
+
export * from './zero'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@globalbrain/sefirot",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"packageManager": "pnpm@8.10.
|
|
3
|
+
"version": "3.6.0",
|
|
4
|
+
"packageManager": "pnpm@8.10.5",
|
|
5
5
|
"description": "Vue Components for Global Brain Design System.",
|
|
6
6
|
"author": "Kia Ishii <ka.ishii@globalbrains.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -72,15 +72,15 @@
|
|
|
72
72
|
"@types/body-scroll-lock": "^3.1.2",
|
|
73
73
|
"@types/lodash-es": "^4.17.11",
|
|
74
74
|
"@types/markdown-it": "^13.0.6",
|
|
75
|
-
"@types/node": "^20.9.
|
|
76
|
-
"@vitejs/plugin-vue": "^4.
|
|
77
|
-
"@vitest/coverage-v8": "^1.0.0-beta.
|
|
78
|
-
"@vue/test-utils": "^2.4.
|
|
75
|
+
"@types/node": "^20.9.2",
|
|
76
|
+
"@vitejs/plugin-vue": "^4.5.0",
|
|
77
|
+
"@vitest/coverage-v8": "^1.0.0-beta.5",
|
|
78
|
+
"@vue/test-utils": "^2.4.2",
|
|
79
79
|
"@vuelidate/core": "^2.0.3",
|
|
80
80
|
"@vuelidate/validators": "^2.0.4",
|
|
81
81
|
"@vueuse/core": "^10.6.1",
|
|
82
82
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
83
|
-
"eslint": "^8.
|
|
83
|
+
"eslint": "^8.54.0",
|
|
84
84
|
"fuse.js": "^7.0.0",
|
|
85
85
|
"happy-dom": "^12.10.3",
|
|
86
86
|
"histoire": "^0.17.5",
|
|
@@ -90,12 +90,13 @@
|
|
|
90
90
|
"pinia": "^2.1.7",
|
|
91
91
|
"postcss": "^8.4.31",
|
|
92
92
|
"postcss-nested": "^6.0.1",
|
|
93
|
+
"punycode": "^2.3.1",
|
|
93
94
|
"release-it": "^17.0.0",
|
|
94
95
|
"typescript": "~5.2.2",
|
|
95
96
|
"v-calendar": "^3.1.2",
|
|
96
|
-
"vite": "^
|
|
97
|
-
"vitepress": "1.0.0-rc.
|
|
98
|
-
"vitest": "^1.0.0-beta.
|
|
97
|
+
"vite": "^5.0.0",
|
|
98
|
+
"vitepress": "1.0.0-rc.29",
|
|
99
|
+
"vitest": "^1.0.0-beta.5",
|
|
99
100
|
"vue": "^3.3.8",
|
|
100
101
|
"vue-router": "^4.2.5",
|
|
101
102
|
"vue-tsc": "^1.8.22"
|