@stephenchenorg/astro 7.0.0 → 7.2.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/dist/company-setting/index.d.ts +2 -2
- package/dist/form-validator/index.d.ts +11 -10
- package/dist/form-validator/index.js +8 -5
- package/dist/image/index.d.ts +4 -4
- package/dist/page/index.d.ts +3 -3
- package/dist/pagination-vue/index.d.ts +12 -12
- package/dist/query-params/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as graphql14 from "graphql";
|
|
2
2
|
|
|
3
3
|
//#region src/company-setting/types.d.ts
|
|
4
4
|
interface DataCompanySetting {
|
|
@@ -42,6 +42,6 @@ declare function createCompanySetting(companySetting: Partial<CompanySetting>):
|
|
|
42
42
|
};
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/company-setting/fragments.d.ts
|
|
45
|
-
declare const companySettingFields:
|
|
45
|
+
declare const companySettingFields: graphql14.DocumentNode;
|
|
46
46
|
//#endregion
|
|
47
47
|
export { CompanySetting, DataCompanySetting, companySettingFields, createCompanySetting };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue27 from "vue";
|
|
2
2
|
import { PropType } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/form-validator/types.d.ts
|
|
5
5
|
type FormErrors = Record<string, string[]>;
|
|
6
6
|
interface FormRule {
|
|
7
|
-
validate: (value: any) => boolean;
|
|
7
|
+
validate: (value: any, form: Record<string, any>) => boolean;
|
|
8
8
|
message: string;
|
|
9
|
+
when?: (value: any, form: Record<string, any>) => boolean;
|
|
9
10
|
}
|
|
10
11
|
//#endregion
|
|
11
12
|
//#region src/form-validator/FormValidator.d.ts
|
|
@@ -22,7 +23,7 @@ declare class FormValidator {
|
|
|
22
23
|
}
|
|
23
24
|
//#endregion
|
|
24
25
|
//#region src/form-validator/components/FormField.d.ts
|
|
25
|
-
declare const FormField:
|
|
26
|
+
declare const FormField: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
26
27
|
id: {
|
|
27
28
|
type: StringConstructor;
|
|
28
29
|
required: true;
|
|
@@ -31,9 +32,9 @@ declare const FormField: vue18.DefineComponent<vue18.ExtractPropTypes<{
|
|
|
31
32
|
type: PropType<FormRule[]>;
|
|
32
33
|
default: () => never[];
|
|
33
34
|
};
|
|
34
|
-
}>, () =>
|
|
35
|
+
}>, () => vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
|
|
35
36
|
[key: string]: any;
|
|
36
|
-
}>[] | undefined, {}, {}, {},
|
|
37
|
+
}>[] | undefined, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
37
38
|
id: {
|
|
38
39
|
type: StringConstructor;
|
|
39
40
|
required: true;
|
|
@@ -44,27 +45,27 @@ declare const FormField: vue18.DefineComponent<vue18.ExtractPropTypes<{
|
|
|
44
45
|
};
|
|
45
46
|
}>> & Readonly<{}>, {
|
|
46
47
|
rules: FormRule[];
|
|
47
|
-
}, {}, {}, {}, string,
|
|
48
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
48
49
|
//#endregion
|
|
49
50
|
//#region src/form-validator/components/FormValidatorProvider.d.ts
|
|
50
51
|
interface FormValidatorProviderExposed {
|
|
51
52
|
formValidator: () => FormValidator;
|
|
52
53
|
}
|
|
53
|
-
declare const FormValidatorProvider:
|
|
54
|
+
declare const FormValidatorProvider: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
54
55
|
errors: {
|
|
55
56
|
type: PropType<FormErrors>;
|
|
56
57
|
default: () => {};
|
|
57
58
|
};
|
|
58
|
-
}>, () =>
|
|
59
|
+
}>, () => vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
|
|
59
60
|
[key: string]: any;
|
|
60
|
-
}>[] | undefined, {}, {}, {},
|
|
61
|
+
}>[] | undefined, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
61
62
|
errors: {
|
|
62
63
|
type: PropType<FormErrors>;
|
|
63
64
|
default: () => {};
|
|
64
65
|
};
|
|
65
66
|
}>> & Readonly<{}>, {
|
|
66
67
|
errors: FormErrors;
|
|
67
|
-
}, {}, {}, {}, string,
|
|
68
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
68
69
|
//#endregion
|
|
69
70
|
//#region src/form-validator/useFormValidator.d.ts
|
|
70
71
|
declare function useFormValidator(): FormValidator;
|
|
@@ -49,11 +49,14 @@ var FormValidator = class {
|
|
|
49
49
|
for (const field in this.rules) {
|
|
50
50
|
const fieldRules = this.rules[field];
|
|
51
51
|
const value = data[field];
|
|
52
|
-
for (const rule of fieldRules)
|
|
53
|
-
|
|
54
|
-
if (!
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
for (const rule of fieldRules) {
|
|
53
|
+
if (rule.when && !rule.when(value, data)) continue;
|
|
54
|
+
if (!rule.validate(value, data)) {
|
|
55
|
+
isValid = false;
|
|
56
|
+
if (!errors[field]) errors[field] = [];
|
|
57
|
+
errors[field].push(rule.message);
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
this.setErrors(errors);
|
package/dist/image/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as graphql0 from "graphql";
|
|
2
2
|
|
|
3
3
|
//#region src/image/fragments.d.ts
|
|
4
|
-
declare const imageFields:
|
|
5
|
-
declare const coverFields:
|
|
6
|
-
declare const backgroundFields:
|
|
4
|
+
declare const imageFields: graphql0.DocumentNode;
|
|
5
|
+
declare const coverFields: graphql0.DocumentNode;
|
|
6
|
+
declare const backgroundFields: graphql0.DocumentNode;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/image/types.d.ts
|
|
9
9
|
interface ImageSource {
|
package/dist/page/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as graphql39 from "graphql";
|
|
2
2
|
|
|
3
3
|
//#region src/page/field/fragments.d.ts
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import * as graphql38 from "graphql";
|
|
|
6
6
|
* Page fields fragment requires explicit import image
|
|
7
7
|
* fields fragment `imageFields` from Image module.
|
|
8
8
|
*/
|
|
9
|
-
declare const pageFields:
|
|
9
|
+
declare const pageFields: graphql39.DocumentNode;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/page/types.d.ts
|
|
12
12
|
interface DataPage {
|
|
@@ -88,7 +88,7 @@ declare function pageTextField(fields: PageField[], key: string): string | null;
|
|
|
88
88
|
declare function pageImageFieldForBackground(fields: PageField[], key: string): string;
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/page/seo-meta/fragments.d.ts
|
|
91
|
-
declare const seoMetaFields: (dummyClass: string) =>
|
|
91
|
+
declare const seoMetaFields: (dummyClass: string) => graphql39.DocumentNode;
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/page/seo-meta/helpers.d.ts
|
|
94
94
|
type UseSeoMetaOptions = Partial<Omit<PageMeta, 'title'>> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue3 from "vue";
|
|
2
2
|
import { MaybeRefOrGetter } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/pagination-vue/types.d.ts
|
|
@@ -16,17 +16,17 @@ declare function usePagination(options: {
|
|
|
16
16
|
perPage?: MaybeRefOrGetter<number>;
|
|
17
17
|
visiblePages?: MaybeRefOrGetter<number>;
|
|
18
18
|
}): {
|
|
19
|
-
items:
|
|
20
|
-
showPagination:
|
|
21
|
-
currentPage:
|
|
22
|
-
canFirst:
|
|
23
|
-
canPrev:
|
|
24
|
-
canNext:
|
|
25
|
-
canLast:
|
|
26
|
-
firstUrl:
|
|
27
|
-
prevUrl:
|
|
28
|
-
nextUrl:
|
|
29
|
-
lastUrl:
|
|
19
|
+
items: vue3.ComputedRef<number[]>;
|
|
20
|
+
showPagination: vue3.ComputedRef<boolean>;
|
|
21
|
+
currentPage: vue3.ComputedRef<number>;
|
|
22
|
+
canFirst: vue3.ComputedRef<boolean>;
|
|
23
|
+
canPrev: vue3.ComputedRef<boolean>;
|
|
24
|
+
canNext: vue3.ComputedRef<boolean>;
|
|
25
|
+
canLast: vue3.ComputedRef<boolean>;
|
|
26
|
+
firstUrl: vue3.ComputedRef<string>;
|
|
27
|
+
prevUrl: vue3.ComputedRef<string>;
|
|
28
|
+
nextUrl: vue3.ComputedRef<string>;
|
|
29
|
+
lastUrl: vue3.ComputedRef<string>;
|
|
30
30
|
getUrl: (page: number) => string;
|
|
31
31
|
};
|
|
32
32
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as nanostores37 from "nanostores";
|
|
2
2
|
import qs from "query-string";
|
|
3
3
|
|
|
4
4
|
//#region src/query-params/types.d.ts
|
|
@@ -13,7 +13,7 @@ interface UrlConfig {
|
|
|
13
13
|
declare function createUrlConfig(config: UrlConfig): UrlConfig;
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/query-params/store.d.ts
|
|
16
|
-
declare const urlConfigStore:
|
|
16
|
+
declare const urlConfigStore: nanostores37.PreinitializedWritableAtom<UrlConfig> & object;
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/query-params/url.d.ts
|
|
19
19
|
declare global {
|