@stephenchenorg/astro 6.0.0 → 6.1.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.
@@ -1,4 +1,4 @@
1
- import * as vue17 from "vue";
1
+ import * as vue27 from "vue";
2
2
  import { PropType } from "vue";
3
3
 
4
4
  //#region src/form-validator/types.d.ts
@@ -22,7 +22,7 @@ declare class FormValidator {
22
22
  }
23
23
  //#endregion
24
24
  //#region src/form-validator/components/FormField.d.ts
25
- declare const FormField: vue17.DefineComponent<vue17.ExtractPropTypes<{
25
+ declare const FormField: vue27.DefineComponent<vue27.ExtractPropTypes<{
26
26
  id: {
27
27
  type: StringConstructor;
28
28
  required: true;
@@ -31,9 +31,9 @@ declare const FormField: vue17.DefineComponent<vue17.ExtractPropTypes<{
31
31
  type: PropType<FormRule[]>;
32
32
  default: () => never[];
33
33
  };
34
- }>, () => vue17.VNode<vue17.RendererNode, vue17.RendererElement, {
34
+ }>, () => vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
35
35
  [key: string]: any;
36
- }>[] | undefined, {}, {}, {}, vue17.ComponentOptionsMixin, vue17.ComponentOptionsMixin, {}, string, vue17.PublicProps, Readonly<vue17.ExtractPropTypes<{
36
+ }>[] | undefined, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
37
37
  id: {
38
38
  type: StringConstructor;
39
39
  required: true;
@@ -44,27 +44,27 @@ declare const FormField: vue17.DefineComponent<vue17.ExtractPropTypes<{
44
44
  };
45
45
  }>> & Readonly<{}>, {
46
46
  rules: FormRule[];
47
- }, {}, {}, {}, string, vue17.ComponentProvideOptions, true, {}, any>;
47
+ }, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
48
48
  //#endregion
49
49
  //#region src/form-validator/components/FormValidatorProvider.d.ts
50
50
  interface FormValidatorProviderExposed {
51
51
  formValidator: () => FormValidator;
52
52
  }
53
- declare const FormValidatorProvider: vue17.DefineComponent<vue17.ExtractPropTypes<{
53
+ declare const FormValidatorProvider: vue27.DefineComponent<vue27.ExtractPropTypes<{
54
54
  errors: {
55
55
  type: PropType<FormErrors>;
56
56
  default: () => {};
57
57
  };
58
- }>, () => vue17.VNode<vue17.RendererNode, vue17.RendererElement, {
58
+ }>, () => vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
59
59
  [key: string]: any;
60
- }>[] | undefined, {}, {}, {}, vue17.ComponentOptionsMixin, vue17.ComponentOptionsMixin, {}, string, vue17.PublicProps, Readonly<vue17.ExtractPropTypes<{
60
+ }>[] | undefined, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
61
61
  errors: {
62
62
  type: PropType<FormErrors>;
63
63
  default: () => {};
64
64
  };
65
65
  }>> & Readonly<{}>, {
66
66
  errors: FormErrors;
67
- }, {}, {}, {}, string, vue17.ComponentProvideOptions, true, {}, any>;
67
+ }, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
68
68
  //#endregion
69
69
  //#region src/form-validator/useFormValidator.d.ts
70
70
  declare function useFormValidator(): FormValidator;
@@ -1,9 +1,9 @@
1
- import * as graphql1 from "graphql";
1
+ import * as graphql12 from "graphql";
2
2
 
3
3
  //#region src/image/fragments.d.ts
4
- declare const imageFields: graphql1.DocumentNode;
5
- declare const coverFields: graphql1.DocumentNode;
6
- declare const backgroundFields: graphql1.DocumentNode;
4
+ declare const imageFields: graphql12.DocumentNode;
5
+ declare const coverFields: graphql12.DocumentNode;
6
+ declare const backgroundFields: graphql12.DocumentNode;
7
7
  //#endregion
8
8
  //#region src/image/types.d.ts
9
9
  interface ImageSource {
@@ -1,4 +1,4 @@
1
- import * as graphql39 from "graphql";
1
+ import * as graphql38 from "graphql";
2
2
 
3
3
  //#region src/page/field/fragments.d.ts
4
4
 
@@ -6,7 +6,7 @@ import * as graphql39 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: graphql39.DocumentNode;
9
+ declare const pageFields: graphql38.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) => graphql39.DocumentNode;
91
+ declare const seoMetaFields: (dummyClass: string) => graphql38.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 vue27 from "vue";
1
+ import * as vue1 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: vue27.ComputedRef<number[]>;
20
- showPagination: vue27.ComputedRef<boolean>;
21
- currentPage: vue27.ComputedRef<number>;
22
- canFirst: vue27.ComputedRef<boolean>;
23
- canPrev: vue27.ComputedRef<boolean>;
24
- canNext: vue27.ComputedRef<boolean>;
25
- canLast: vue27.ComputedRef<boolean>;
26
- firstUrl: vue27.ComputedRef<string>;
27
- prevUrl: vue27.ComputedRef<string>;
28
- nextUrl: vue27.ComputedRef<string>;
29
- lastUrl: vue27.ComputedRef<string>;
19
+ items: vue1.ComputedRef<number[]>;
20
+ showPagination: vue1.ComputedRef<boolean>;
21
+ currentPage: vue1.ComputedRef<number>;
22
+ canFirst: vue1.ComputedRef<boolean>;
23
+ canPrev: vue1.ComputedRef<boolean>;
24
+ canNext: vue1.ComputedRef<boolean>;
25
+ canLast: vue1.ComputedRef<boolean>;
26
+ firstUrl: vue1.ComputedRef<string>;
27
+ prevUrl: vue1.ComputedRef<string>;
28
+ nextUrl: vue1.ComputedRef<string>;
29
+ lastUrl: vue1.ComputedRef<string>;
30
30
  getUrl: (page: number) => string;
31
31
  };
32
32
  //#endregion
@@ -60,6 +60,10 @@ declare class ProductVariantSelector {
60
60
  * 確認是否已選擇所有商品規格選項
61
61
  */
62
62
  areAllAttributesSelected(): boolean;
63
+ /**
64
+ * 確認是否已選擇有效的商品規格
65
+ */
66
+ isValidVariantSelected(): boolean;
63
67
  /**
64
68
  * 確認是否有足夠的庫存
65
69
  */
@@ -45,6 +45,12 @@ var ProductVariantSelector = class {
45
45
  return Object.keys(this.selectedAttributes).length === this.variantAttributes.length;
46
46
  }
47
47
  /**
48
+ * 確認是否已選擇有效的商品規格
49
+ */
50
+ isValidVariantSelected() {
51
+ return typeof this.currentVariant !== "undefined" && this.currentVariant.inventory > 0;
52
+ }
53
+ /**
48
54
  * 確認是否有足夠的庫存
49
55
  */
50
56
  hasEnoughStock(stock) {
@@ -1,4 +1,4 @@
1
- import * as nanostores4 from "nanostores";
1
+ import * as nanostores16 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: nanostores4.PreinitializedWritableAtom<UrlConfig> & object;
16
+ declare const urlConfigStore: nanostores16.PreinitializedWritableAtom<UrlConfig> & object;
17
17
  //#endregion
18
18
  //#region src/query-params/url.d.ts
19
19
  declare global {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stephenchenorg/astro",
3
3
  "type": "module",
4
- "version": "6.0.0",
4
+ "version": "6.1.0",
5
5
  "description": "Stephenchenorg Astro 前端通用套件",
6
6
  "license": "MIT",
7
7
  "homepage": "https://stephenchenorg-astro.netlify.app",
@@ -10,7 +10,14 @@
10
10
  "url": "git+https://github.com/stephenchenorg/package.astro.git"
11
11
  },
12
12
  "keywords": [
13
- "astro"
13
+ "astro",
14
+ "vue",
15
+ "components",
16
+ "query-string",
17
+ "pagination",
18
+ "product-variant",
19
+ "form-validator",
20
+ "query-params"
14
21
  ],
15
22
  "exports": {
16
23
  "./api": {